diff --git a/extra/protobuf/protobuf-3.19.4/BUILD b/extra/protobuf/protobuf-3.19.4/BUILD deleted file mode 100644 index 1690d421984e..000000000000 --- a/extra/protobuf/protobuf-3.19.4/BUILD +++ /dev/null @@ -1,1349 +0,0 @@ -# Bazel (https://bazel.build/) BUILD file for Protobuf. - -load("@bazel_skylib//rules:common_settings.bzl", "string_flag") -load("@rules_cc//cc:defs.bzl", "cc_binary", "cc_library", "cc_test", "objc_library", native_cc_proto_library = "cc_proto_library") -load("@rules_proto//proto:defs.bzl", "proto_lang_toolchain", "proto_library") -load("@rules_python//python:defs.bzl", "py_library") -load("@rules_java//java:defs.bzl", "java_binary", "java_lite_proto_library", "java_proto_library") -load(":cc_proto_blacklist_test.bzl", "cc_proto_blacklist_test") - -licenses(["notice"]) - -exports_files(["LICENSE"]) - -################################################################################ -# build configuration -################################################################################ - -################################################################################ -# ZLIB configuration -################################################################################ - -ZLIB_DEPS = ["@zlib//:zlib"] - -################################################################################ -# Protobuf Runtime Library -################################################################################ - -MSVC_COPTS = [ - "/wd4018", # -Wno-sign-compare - "/wd4065", # switch statement contains 'default' but no 'case' labels - "/wd4146", # unary minus operator applied to unsigned type, result still unsigned - "/wd4244", # 'conversion' conversion from 'type1' to 'type2', possible loss of data - "/wd4251", # 'identifier' : class 'type' needs to have dll-interface to be used by clients of class 'type2' - "/wd4267", # 'var' : conversion from 'size_t' to 'type', possible loss of data - "/wd4305", # 'identifier' : truncation from 'type1' to 'type2' - "/wd4307", # 'operator' : integral constant overflow - "/wd4309", # 'conversion' : truncation of constant value - "/wd4334", # 'operator' : result of 32-bit shift implicitly converted to 64 bits (was 64-bit shift intended?) - "/wd4355", # 'this' : used in base member initializer list - "/wd4506", # no definition for inline function 'function' - "/wd4800", # 'type' : forcing value to bool 'true' or 'false' (performance warning) - "/wd4996", # The compiler encountered a deprecated declaration. -] - -COPTS = select({ - ":msvc": MSVC_COPTS, - "//conditions:default": [ - "-DHAVE_ZLIB", - "-Wmissing-field-initializers", - "-Woverloaded-virtual", - "-Wno-sign-compare", - ], -}) - -load(":compiler_config_setting.bzl", "create_compiler_config_setting") - -create_compiler_config_setting( - name = "msvc", - value = "msvc-cl", - visibility = [ - # Public, but Protobuf only visibility. - "//:__subpackages__", - ], -) - -# Android NDK builds can specify different crosstool_top flags to choose which -# STL they use for C++. We need these multiple variants to catch all of those -# versions of crosstool_top and reliably detect Android. -# -# For more info on the various crosstool_tops used by NDK Bazel builds, see: -# https://docs.bazel.build/versions/master/android-ndk.html#configuring-the-stl - -config_setting( - name = "android", - values = { - "crosstool_top": "//external:android/crosstool", - }, - visibility = [ - # Public, but Protobuf only visibility. - "//:__subpackages__", - ], -) - -config_setting( - name = "android-stlport", - values = { - "crosstool_top": "@androidndk//:toolchain-stlport", - }, - visibility = [ - # Public, but Protobuf only visibility. - "//:__subpackages__", - ], -) - -config_setting( - name = "android-libcpp", - values = { - "crosstool_top": "@androidndk//:toolchain-libcpp", - }, - visibility = [ - # Public, but Protobuf only visibility. - "//:__subpackages__", - ], -) - -config_setting( - name = "android-gnu-libstdcpp", - values = { - "crosstool_top": "@androidndk//:toolchain-gnu-libstdcpp", - }, - visibility = [ - # Public, but Protobuf only visibility. - "//:__subpackages__", - ], -) - -config_setting( - name = "android-default", - values = { - "crosstool_top": "@androidndk//:default_crosstool", - }, - visibility = [ - # Public, but Protobuf only visibility. - "//:__subpackages__", - ], -) - -# Android and MSVC builds do not need to link in a separate pthread library. -LINK_OPTS = select({ - ":android": [], - ":android-stlport": [], - ":android-libcpp": [], - ":android-gnu-libstdcpp": [], - ":android-default": [], - ":msvc": [ - # Suppress linker warnings about files with no symbols defined. - "-ignore:4221", - ], - "//conditions:default": [ - "-lpthread", - "-lm", - ], -}) - -load( - ":protobuf.bzl", - "adapt_proto_library", - "cc_proto_library", - "internal_copied_filegroup", - "internal_gen_well_known_protos_java", - "internal_protobuf_py_tests", - "py_proto_library", -) - -cc_library( - name = "protobuf_lite", - srcs = [ - # AUTOGEN(protobuf_lite_srcs) - "src/google/protobuf/any_lite.cc", - "src/google/protobuf/arena.cc", - "src/google/protobuf/arenastring.cc", - "src/google/protobuf/extension_set.cc", - "src/google/protobuf/generated_enum_util.cc", - "src/google/protobuf/generated_message_table_driven_lite.cc", - "src/google/protobuf/generated_message_tctable_lite.cc", - "src/google/protobuf/generated_message_util.cc", - "src/google/protobuf/implicit_weak_message.cc", - "src/google/protobuf/inlined_string_field.cc", - "src/google/protobuf/io/coded_stream.cc", - "src/google/protobuf/io/io_win32.cc", - "src/google/protobuf/io/strtod.cc", - "src/google/protobuf/io/zero_copy_stream.cc", - "src/google/protobuf/io/zero_copy_stream_impl.cc", - "src/google/protobuf/io/zero_copy_stream_impl_lite.cc", - "src/google/protobuf/map.cc", - "src/google/protobuf/message_lite.cc", - "src/google/protobuf/parse_context.cc", - "src/google/protobuf/repeated_field.cc", - "src/google/protobuf/repeated_ptr_field.cc", - "src/google/protobuf/stubs/bytestream.cc", - "src/google/protobuf/stubs/common.cc", - "src/google/protobuf/stubs/int128.cc", - "src/google/protobuf/stubs/status.cc", - "src/google/protobuf/stubs/statusor.cc", - "src/google/protobuf/stubs/stringpiece.cc", - "src/google/protobuf/stubs/stringprintf.cc", - "src/google/protobuf/stubs/structurally_valid.cc", - "src/google/protobuf/stubs/strutil.cc", - "src/google/protobuf/stubs/time.cc", - "src/google/protobuf/wire_format_lite.cc", - ], - hdrs = glob([ - "src/google/protobuf/**/*.h", - "src/google/protobuf/**/*.inc", - ]), - copts = COPTS, - includes = ["src/"], - linkopts = LINK_OPTS, - visibility = ["//visibility:public"], -) - -PROTOBUF_DEPS = select({ - ":msvc": [], - "//conditions:default": ZLIB_DEPS, -}) - -cc_library( - name = "protobuf", - srcs = [ - # AUTOGEN(protobuf_srcs) - "src/google/protobuf/any.cc", - "src/google/protobuf/any.pb.cc", - "src/google/protobuf/api.pb.cc", - "src/google/protobuf/compiler/importer.cc", - "src/google/protobuf/compiler/parser.cc", - "src/google/protobuf/descriptor.cc", - "src/google/protobuf/descriptor.pb.cc", - "src/google/protobuf/descriptor_database.cc", - "src/google/protobuf/duration.pb.cc", - "src/google/protobuf/dynamic_message.cc", - "src/google/protobuf/empty.pb.cc", - "src/google/protobuf/extension_set_heavy.cc", - "src/google/protobuf/field_mask.pb.cc", - "src/google/protobuf/generated_message_bases.cc", - "src/google/protobuf/generated_message_reflection.cc", - "src/google/protobuf/generated_message_table_driven.cc", - "src/google/protobuf/generated_message_tctable_full.cc", - "src/google/protobuf/io/gzip_stream.cc", - "src/google/protobuf/io/printer.cc", - "src/google/protobuf/io/tokenizer.cc", - "src/google/protobuf/map_field.cc", - "src/google/protobuf/message.cc", - "src/google/protobuf/reflection_ops.cc", - "src/google/protobuf/service.cc", - "src/google/protobuf/source_context.pb.cc", - "src/google/protobuf/struct.pb.cc", - "src/google/protobuf/stubs/substitute.cc", - "src/google/protobuf/text_format.cc", - "src/google/protobuf/timestamp.pb.cc", - "src/google/protobuf/type.pb.cc", - "src/google/protobuf/unknown_field_set.cc", - "src/google/protobuf/util/delimited_message_util.cc", - "src/google/protobuf/util/field_comparator.cc", - "src/google/protobuf/util/field_mask_util.cc", - "src/google/protobuf/util/internal/datapiece.cc", - "src/google/protobuf/util/internal/default_value_objectwriter.cc", - "src/google/protobuf/util/internal/error_listener.cc", - "src/google/protobuf/util/internal/field_mask_utility.cc", - "src/google/protobuf/util/internal/json_escaping.cc", - "src/google/protobuf/util/internal/json_objectwriter.cc", - "src/google/protobuf/util/internal/json_stream_parser.cc", - "src/google/protobuf/util/internal/object_writer.cc", - "src/google/protobuf/util/internal/proto_writer.cc", - "src/google/protobuf/util/internal/protostream_objectsource.cc", - "src/google/protobuf/util/internal/protostream_objectwriter.cc", - "src/google/protobuf/util/internal/type_info.cc", - "src/google/protobuf/util/internal/utility.cc", - "src/google/protobuf/util/json_util.cc", - "src/google/protobuf/util/message_differencer.cc", - "src/google/protobuf/util/time_util.cc", - "src/google/protobuf/util/type_resolver_util.cc", - "src/google/protobuf/wire_format.cc", - "src/google/protobuf/wrappers.pb.cc", - ], - hdrs = glob([ - "src/**/*.h", - "src/**/*.inc", - ]), - copts = COPTS, - includes = ["src/"], - linkopts = LINK_OPTS, - visibility = ["//visibility:public"], - deps = [":protobuf_lite"] + PROTOBUF_DEPS, -) - -# This provides just the header files for use in projects that need to build -# shared libraries for dynamic loading. This target is available until Bazel -# adds native support for such use cases. -# TODO(keveman): Remove this target once the support gets added to Bazel. -cc_library( - name = "protobuf_headers", - hdrs = glob([ - "src/**/*.h", - "src/**/*.inc", - ]), - includes = ["src/"], - visibility = ["//visibility:public"], -) - -# Map of all well known protos. -# name => (include path, imports) -WELL_KNOWN_PROTO_MAP = { - "any": ("src/google/protobuf/any.proto", []), - "api": ( - "src/google/protobuf/api.proto", - [ - "source_context", - "type", - ], - ), - "compiler_plugin": ( - "src/google/protobuf/compiler/plugin.proto", - ["descriptor"], - ), - "descriptor": ("src/google/protobuf/descriptor.proto", []), - "duration": ("src/google/protobuf/duration.proto", []), - "empty": ("src/google/protobuf/empty.proto", []), - "field_mask": ("src/google/protobuf/field_mask.proto", []), - "source_context": ("src/google/protobuf/source_context.proto", []), - "struct": ("src/google/protobuf/struct.proto", []), - "timestamp": ("src/google/protobuf/timestamp.proto", []), - "type": ( - "src/google/protobuf/type.proto", - [ - "any", - "source_context", - ], - ), - "wrappers": ("src/google/protobuf/wrappers.proto", []), -} - -WELL_KNOWN_PROTOS = [value[0] for value in WELL_KNOWN_PROTO_MAP.values()] - -LITE_WELL_KNOWN_PROTO_MAP = { - "any": ("src/google/protobuf/any.proto", []), - "api": ( - "src/google/protobuf/api.proto", - [ - "source_context", - "type", - ], - ), - "duration": ("src/google/protobuf/duration.proto", []), - "empty": ("src/google/protobuf/empty.proto", []), - "field_mask": ("src/google/protobuf/field_mask.proto", []), - "source_context": ("src/google/protobuf/source_context.proto", []), - "struct": ("src/google/protobuf/struct.proto", []), - "timestamp": ("src/google/protobuf/timestamp.proto", []), - "type": ( - "src/google/protobuf/type.proto", - [ - "any", - "source_context", - ], - ), - "wrappers": ("src/google/protobuf/wrappers.proto", []), -} - -LITE_WELL_KNOWN_PROTOS = [value[0] for value in LITE_WELL_KNOWN_PROTO_MAP.values()] - -filegroup( - name = "well_known_protos", - srcs = WELL_KNOWN_PROTOS, - visibility = ["//visibility:public"], -) - -filegroup( - name = "lite_well_known_protos", - srcs = LITE_WELL_KNOWN_PROTOS, - visibility = ["//visibility:public"], -) - -adapt_proto_library( - name = "cc_wkt_protos_genproto", - visibility = ["//visibility:public"], - deps = [proto + "_proto" for proto in WELL_KNOWN_PROTO_MAP.keys()], -) - -cc_library( - name = "cc_wkt_protos", - deprecation = "Only for backward compatibility. Do not use.", - visibility = ["//visibility:public"], -) - -################################################################################ -# Well Known Types Proto Library Rules -# -# These proto_library rules can be used with one of the language specific proto -# library rules i.e. java_proto_library: -# -# java_proto_library( -# name = "any_java_proto", -# deps = ["@com_google_protobuf//:any_proto], -# ) -################################################################################ - -[proto_library( - name = proto[0] + "_proto", - srcs = [proto[1][0]], - strip_import_prefix = "src", - visibility = ["//visibility:public"], - deps = [dep + "_proto" for dep in proto[1][1]], -) for proto in WELL_KNOWN_PROTO_MAP.items()] - -[native_cc_proto_library( - name = proto + "_cc_proto", - visibility = ["//visibility:private"], - deps = [proto + "_proto"], -) for proto in WELL_KNOWN_PROTO_MAP.keys()] - -cc_proto_blacklist_test( - name = "cc_proto_blacklist_test", - tags = [ - # Exclude this target from wildcard expansion (//...). Due to - # https://github.com/bazelbuild/bazel/issues/10590, this test has to - # be nominated using the `@com_google_protobuf//` prefix. We do that, - # e.g., in kokoro/linux/bazel/build.sh. - # See also https://github.com/protocolbuffers/protobuf/pull/7096. - "manual", - ], - deps = [proto + "_cc_proto" for proto in WELL_KNOWN_PROTO_MAP.keys()], -) - -################################################################################ -# Protocol Buffers Compiler -################################################################################ - -cc_library( - name = "protoc_lib", - srcs = [ - # AUTOGEN(protoc_lib_srcs) - "src/google/protobuf/compiler/code_generator.cc", - "src/google/protobuf/compiler/command_line_interface.cc", - "src/google/protobuf/compiler/cpp/cpp_enum.cc", - "src/google/protobuf/compiler/cpp/cpp_enum_field.cc", - "src/google/protobuf/compiler/cpp/cpp_extension.cc", - "src/google/protobuf/compiler/cpp/cpp_field.cc", - "src/google/protobuf/compiler/cpp/cpp_file.cc", - "src/google/protobuf/compiler/cpp/cpp_generator.cc", - "src/google/protobuf/compiler/cpp/cpp_helpers.cc", - "src/google/protobuf/compiler/cpp/cpp_map_field.cc", - "src/google/protobuf/compiler/cpp/cpp_message.cc", - "src/google/protobuf/compiler/cpp/cpp_message_field.cc", - "src/google/protobuf/compiler/cpp/cpp_padding_optimizer.cc", - "src/google/protobuf/compiler/cpp/cpp_parse_function_generator.cc", - "src/google/protobuf/compiler/cpp/cpp_primitive_field.cc", - "src/google/protobuf/compiler/cpp/cpp_service.cc", - "src/google/protobuf/compiler/cpp/cpp_string_field.cc", - "src/google/protobuf/compiler/csharp/csharp_doc_comment.cc", - "src/google/protobuf/compiler/csharp/csharp_enum.cc", - "src/google/protobuf/compiler/csharp/csharp_enum_field.cc", - "src/google/protobuf/compiler/csharp/csharp_field_base.cc", - "src/google/protobuf/compiler/csharp/csharp_generator.cc", - "src/google/protobuf/compiler/csharp/csharp_helpers.cc", - "src/google/protobuf/compiler/csharp/csharp_map_field.cc", - "src/google/protobuf/compiler/csharp/csharp_message.cc", - "src/google/protobuf/compiler/csharp/csharp_message_field.cc", - "src/google/protobuf/compiler/csharp/csharp_primitive_field.cc", - "src/google/protobuf/compiler/csharp/csharp_reflection_class.cc", - "src/google/protobuf/compiler/csharp/csharp_repeated_enum_field.cc", - "src/google/protobuf/compiler/csharp/csharp_repeated_message_field.cc", - "src/google/protobuf/compiler/csharp/csharp_repeated_primitive_field.cc", - "src/google/protobuf/compiler/csharp/csharp_source_generator_base.cc", - "src/google/protobuf/compiler/csharp/csharp_wrapper_field.cc", - "src/google/protobuf/compiler/java/java_context.cc", - "src/google/protobuf/compiler/java/java_doc_comment.cc", - "src/google/protobuf/compiler/java/java_enum.cc", - "src/google/protobuf/compiler/java/java_enum_field.cc", - "src/google/protobuf/compiler/java/java_enum_field_lite.cc", - "src/google/protobuf/compiler/java/java_enum_lite.cc", - "src/google/protobuf/compiler/java/java_extension.cc", - "src/google/protobuf/compiler/java/java_extension_lite.cc", - "src/google/protobuf/compiler/java/java_field.cc", - "src/google/protobuf/compiler/java/java_file.cc", - "src/google/protobuf/compiler/java/java_generator.cc", - "src/google/protobuf/compiler/java/java_generator_factory.cc", - "src/google/protobuf/compiler/java/java_helpers.cc", - "src/google/protobuf/compiler/java/java_kotlin_generator.cc", - "src/google/protobuf/compiler/java/java_map_field.cc", - "src/google/protobuf/compiler/java/java_map_field_lite.cc", - "src/google/protobuf/compiler/java/java_message.cc", - "src/google/protobuf/compiler/java/java_message_builder.cc", - "src/google/protobuf/compiler/java/java_message_builder_lite.cc", - "src/google/protobuf/compiler/java/java_message_field.cc", - "src/google/protobuf/compiler/java/java_message_field_lite.cc", - "src/google/protobuf/compiler/java/java_message_lite.cc", - "src/google/protobuf/compiler/java/java_name_resolver.cc", - "src/google/protobuf/compiler/java/java_primitive_field.cc", - "src/google/protobuf/compiler/java/java_primitive_field_lite.cc", - "src/google/protobuf/compiler/java/java_service.cc", - "src/google/protobuf/compiler/java/java_shared_code_generator.cc", - "src/google/protobuf/compiler/java/java_string_field.cc", - "src/google/protobuf/compiler/java/java_string_field_lite.cc", - "src/google/protobuf/compiler/js/js_generator.cc", - "src/google/protobuf/compiler/js/well_known_types_embed.cc", - "src/google/protobuf/compiler/objectivec/objectivec_enum.cc", - "src/google/protobuf/compiler/objectivec/objectivec_enum_field.cc", - "src/google/protobuf/compiler/objectivec/objectivec_extension.cc", - "src/google/protobuf/compiler/objectivec/objectivec_field.cc", - "src/google/protobuf/compiler/objectivec/objectivec_file.cc", - "src/google/protobuf/compiler/objectivec/objectivec_generator.cc", - "src/google/protobuf/compiler/objectivec/objectivec_helpers.cc", - "src/google/protobuf/compiler/objectivec/objectivec_map_field.cc", - "src/google/protobuf/compiler/objectivec/objectivec_message.cc", - "src/google/protobuf/compiler/objectivec/objectivec_message_field.cc", - "src/google/protobuf/compiler/objectivec/objectivec_oneof.cc", - "src/google/protobuf/compiler/objectivec/objectivec_primitive_field.cc", - "src/google/protobuf/compiler/php/php_generator.cc", - "src/google/protobuf/compiler/plugin.cc", - "src/google/protobuf/compiler/plugin.pb.cc", - "src/google/protobuf/compiler/python/python_generator.cc", - "src/google/protobuf/compiler/ruby/ruby_generator.cc", - "src/google/protobuf/compiler/subprocess.cc", - "src/google/protobuf/compiler/zip_writer.cc", - ], - copts = COPTS, - includes = ["src/"], - linkopts = LINK_OPTS, - visibility = ["//visibility:public"], - deps = [":protobuf"], -) - -cc_binary( - name = "protoc", - srcs = ["src/google/protobuf/compiler/main.cc"], - linkopts = LINK_OPTS, - visibility = ["//visibility:public"], - deps = [":protoc_lib"], -) - -################################################################################ -# Tests -################################################################################ - -filegroup( - name = "testdata", - srcs = glob(["src/google/protobuf/testdata/**/*"]), - visibility = ["//:__subpackages__"], -) - -RELATIVE_LITE_TEST_PROTOS = [ - # AUTOGEN(lite_test_protos) - "google/protobuf/map_lite_unittest.proto", - "google/protobuf/unittest_import_lite.proto", - "google/protobuf/unittest_import_public_lite.proto", - "google/protobuf/unittest_lite.proto", -] - -LITE_TEST_PROTOS = ["src/" + s for s in RELATIVE_LITE_TEST_PROTOS] - -RELATIVE_TEST_PROTOS = [ - # AUTOGEN(test_protos) - "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_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.proto", - "google/protobuf/unittest_import_public.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_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_enum.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", - "google/protobuf/unittest_proto3_lite.proto", - "google/protobuf/unittest_proto3_optional.proto", - "google/protobuf/unittest_well_known_types.proto", - "google/protobuf/util/internal/testdata/anys.proto", - "google/protobuf/util/internal/testdata/books.proto", - "google/protobuf/util/internal/testdata/default_value.proto", - "google/protobuf/util/internal/testdata/default_value_test.proto", - "google/protobuf/util/internal/testdata/field_mask.proto", - "google/protobuf/util/internal/testdata/maps.proto", - "google/protobuf/util/internal/testdata/oneofs.proto", - "google/protobuf/util/internal/testdata/proto3.proto", - "google/protobuf/util/internal/testdata/struct.proto", - "google/protobuf/util/internal/testdata/timestamp_duration.proto", - "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", -] - -TEST_PROTOS = ["src/" + s for s in RELATIVE_TEST_PROTOS] - -GENERIC_RELATIVE_TEST_PROTOS = [ - "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.proto", - "google/protobuf/unittest_import_public.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_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_enum.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", - "google/protobuf/unittest_proto3_lite.proto", - "google/protobuf/unittest_proto3_optional.proto", - "google/protobuf/unittest_well_known_types.proto", -] - -GENERIC_TEST_PROTOS = ["src/" + s for s in GENERIC_RELATIVE_TEST_PROTOS] - -proto_library( - name = "generic_test_protos", - srcs = LITE_TEST_PROTOS + GENERIC_TEST_PROTOS, - strip_import_prefix = "src", - visibility = ["//:__subpackages__"], - deps = [ - "//:any_proto", - "//:api_proto", - "//:descriptor_proto", - "//:duration_proto", - "//:empty_proto", - "//:field_mask_proto", - "//:source_context_proto", - "//:struct_proto", - "//:timestamp_proto", - "//:type_proto", - "//:wrappers_proto", - ], -) - -cc_proto_library( - name = "cc_test_protos", - srcs = LITE_TEST_PROTOS + TEST_PROTOS, - include = "src", - default_runtime = ":protobuf", - protoc = ":protoc", - deps = [":cc_wkt_protos"], -) - -COMMON_TEST_SRCS = [ - # AUTOGEN(common_test_srcs) - "src/google/protobuf/arena_test_util.cc", - "src/google/protobuf/map_lite_test_util.cc", - "src/google/protobuf/test_util_lite.cc", - "src/google/protobuf/map_test_util.inc", - "src/google/protobuf/reflection_tester.cc", - "src/google/protobuf/test_util.cc", - "src/google/protobuf/test_util.inc", - "src/google/protobuf/testing/file.cc", - "src/google/protobuf/testing/googletest.cc", -] - -cc_binary( - name = "test_plugin", - testonly = True, - srcs = [ - # AUTOGEN(test_plugin_srcs) - "src/google/protobuf/compiler/mock_code_generator.cc", - "src/google/protobuf/compiler/test_plugin.cc", - "src/google/protobuf/testing/file.cc", - ], - deps = [ - ":protobuf", - ":protoc_lib", - "@com_google_googletest//:gtest", - ], -) - -cc_test( - name = "win32_test", - srcs = ["src/google/protobuf/io/io_win32_unittest.cc"], - tags = [ - "manual", - "windows", - ], - deps = [ - ":protobuf_lite", - "@com_google_googletest//:gtest", - "@com_google_googletest//:gtest_main", - ], -) - -cc_test( - name = "protobuf_test", - srcs = COMMON_TEST_SRCS + [ - # AUTOGEN(test_srcs) - "src/google/protobuf/any_test.cc", - "src/google/protobuf/arena_unittest.cc", - "src/google/protobuf/arenastring_unittest.cc", - "src/google/protobuf/compiler/annotation_test_util.cc", - "src/google/protobuf/compiler/command_line_interface_unittest.cc", - "src/google/protobuf/compiler/cpp/cpp_bootstrap_unittest.cc", - "src/google/protobuf/compiler/cpp/cpp_move_unittest.cc", - "src/google/protobuf/compiler/cpp/cpp_plugin_unittest.cc", - "src/google/protobuf/compiler/cpp/cpp_unittest.cc", - "src/google/protobuf/compiler/cpp/cpp_unittest.inc", - "src/google/protobuf/compiler/cpp/metadata_test.cc", - "src/google/protobuf/compiler/csharp/csharp_bootstrap_unittest.cc", - "src/google/protobuf/compiler/csharp/csharp_generator_unittest.cc", - "src/google/protobuf/compiler/importer_unittest.cc", - "src/google/protobuf/compiler/java/java_doc_comment_unittest.cc", - "src/google/protobuf/compiler/java/java_plugin_unittest.cc", - "src/google/protobuf/compiler/mock_code_generator.cc", - "src/google/protobuf/compiler/objectivec/objectivec_helpers_unittest.cc", - "src/google/protobuf/compiler/parser_unittest.cc", - "src/google/protobuf/compiler/python/python_plugin_unittest.cc", - "src/google/protobuf/compiler/ruby/ruby_generator_unittest.cc", - "src/google/protobuf/descriptor_database_unittest.cc", - "src/google/protobuf/descriptor_unittest.cc", - "src/google/protobuf/drop_unknown_fields_test.cc", - "src/google/protobuf/dynamic_message_unittest.cc", - "src/google/protobuf/extension_set_unittest.cc", - "src/google/protobuf/generated_message_reflection_unittest.cc", - "src/google/protobuf/inlined_string_field_unittest.cc", - "src/google/protobuf/io/coded_stream_unittest.cc", - "src/google/protobuf/io/io_win32_unittest.cc", - "src/google/protobuf/io/printer_unittest.cc", - "src/google/protobuf/io/tokenizer_unittest.cc", - "src/google/protobuf/io/zero_copy_stream_unittest.cc", - "src/google/protobuf/map_field_test.cc", - "src/google/protobuf/map_test.cc", - "src/google/protobuf/map_test.inc", - "src/google/protobuf/message_unittest.cc", - "src/google/protobuf/message_unittest.inc", - "src/google/protobuf/no_field_presence_test.cc", - "src/google/protobuf/preserve_unknown_enum_test.cc", - "src/google/protobuf/proto3_arena_lite_unittest.cc", - "src/google/protobuf/proto3_arena_unittest.cc", - "src/google/protobuf/proto3_lite_unittest.cc", - "src/google/protobuf/proto3_lite_unittest.inc", - "src/google/protobuf/reflection_ops_unittest.cc", - "src/google/protobuf/repeated_field_reflection_unittest.cc", - "src/google/protobuf/repeated_field_unittest.cc", - "src/google/protobuf/stubs/bytestream_unittest.cc", - "src/google/protobuf/stubs/common_unittest.cc", - "src/google/protobuf/stubs/int128_unittest.cc", - "src/google/protobuf/stubs/status_test.cc", - "src/google/protobuf/stubs/statusor_test.cc", - "src/google/protobuf/stubs/stringpiece_unittest.cc", - "src/google/protobuf/stubs/stringprintf_unittest.cc", - "src/google/protobuf/stubs/structurally_valid_unittest.cc", - "src/google/protobuf/stubs/strutil_unittest.cc", - "src/google/protobuf/stubs/template_util_unittest.cc", - "src/google/protobuf/stubs/time_test.cc", - "src/google/protobuf/text_format_unittest.cc", - "src/google/protobuf/unknown_field_set_unittest.cc", - "src/google/protobuf/util/delimited_message_util_test.cc", - "src/google/protobuf/util/field_comparator_test.cc", - "src/google/protobuf/util/field_mask_util_test.cc", - "src/google/protobuf/util/internal/default_value_objectwriter_test.cc", - "src/google/protobuf/util/internal/json_objectwriter_test.cc", - "src/google/protobuf/util/internal/json_stream_parser_test.cc", - "src/google/protobuf/util/internal/protostream_objectsource_test.cc", - "src/google/protobuf/util/internal/protostream_objectwriter_test.cc", - "src/google/protobuf/util/internal/type_info_test_helper.cc", - "src/google/protobuf/util/json_util_test.cc", - "src/google/protobuf/util/message_differencer_unittest.cc", - "src/google/protobuf/util/time_util_test.cc", - "src/google/protobuf/util/type_resolver_util_test.cc", - "src/google/protobuf/well_known_types_unittest.cc", - "src/google/protobuf/wire_format_unittest.cc", - "src/google/protobuf/wire_format_unittest.inc", - ] + select({ - "//conditions:default": [ - # AUTOGEN(non_msvc_test_srcs) - ], - ":msvc": [], - }), - copts = COPTS + select({ - ":msvc": [], - "//conditions:default": [ - "-Wno-deprecated-declarations", - ], - }), - data = [ - ":test_plugin", - ] + glob([ - "src/google/protobuf/**/*", - # Files for csharp_bootstrap_unittest.cc. - "conformance/**/*", - "csharp/src/**/*", - ]), - includes = [ - "src/", - ], - linkopts = LINK_OPTS, - deps = [ - ":cc_test_protos", - ":protobuf", - ":protoc_lib", - "@com_google_googletest//:gtest", - "@com_google_googletest//:gtest_main", - ] + PROTOBUF_DEPS, -) - -################################################################################ -# Java support -################################################################################ - -internal_gen_well_known_protos_java( - name = "gen_well_known_protos_java", - visibility = [ - "//java:__subpackages__", - ], - deps = [proto + "_proto" for proto in WELL_KNOWN_PROTO_MAP.keys()], -) - -internal_gen_well_known_protos_java( - name = "gen_well_known_protos_javalite", - javalite = True, - visibility = [ - "//java:__subpackages__", - ], - deps = [proto + "_proto" for proto in LITE_WELL_KNOWN_PROTO_MAP.keys()], -) - -alias( - name = "protobuf_java", - actual = "//java/core", - visibility = ["//visibility:public"], -) - -alias( - name = "protobuf_javalite", - actual = "//java/lite", - visibility = ["//visibility:public"], -) - -alias( - name = "protobuf_java_util", - actual = "//java/util", - visibility = ["//visibility:public"], -) - -alias( - name = "java_toolchain", - actual = "//java/core:toolchain", - visibility = ["//visibility:public"], -) - -alias( - name = "javalite_toolchain", - actual = "//java/lite:toolchain", - visibility = ["//visibility:public"], -) - -################################################################################ -# Python support -################################################################################ - -py_library( - name = "python_srcs", - srcs = glob( - [ - "python/google/protobuf/**/*.py", - ], - exclude = [ - "python/google/protobuf/internal/*_test.py", - "python/google/protobuf/internal/test_util.py", - ], - ), - imports = ["python"], - srcs_version = "PY2AND3", -) - -cc_binary( - name = "python/google/protobuf/internal/_api_implementation.so", - srcs = ["python/google/protobuf/internal/api_implementation.cc"], - copts = COPTS + [ - "-DPYTHON_PROTO2_CPP_IMPL_V2", - ], - linkshared = 1, - linkstatic = 1, - tags = [ - # Exclude this target from wildcard expansion (//...) because it may - # not even be buildable. It will be built if it is needed according - # to :use_fast_cpp_protos. - # https://docs.bazel.build/versions/master/be/common-definitions.html#common-attributes - "manual", - ], - deps = select({ - "//conditions:default": [], - ":use_fast_cpp_protos": ["//external:python_headers"], - }), -) - -cc_binary( - name = "python/google/protobuf/pyext/_message.so", - srcs = glob([ - "python/google/protobuf/pyext/*.cc", - "python/google/protobuf/pyext/*.h", - ]), - copts = COPTS + [ - "-DGOOGLE_PROTOBUF_HAS_ONEOF=1", - ] + select({ - "//conditions:default": [], - ":allow_oversize_protos": ["-DPROTOBUF_PYTHON_ALLOW_OVERSIZE_PROTOS=1"], - }), - includes = [ - "python/", - "src/", - ], - linkshared = 1, - linkstatic = 1, - tags = [ - # Exclude this target from wildcard expansion (//...) because it may - # not even be buildable. It will be built if it is needed according - # to :use_fast_cpp_protos. - # https://docs.bazel.build/versions/master/be/common-definitions.html#common-attributes - "manual", - ], - deps = [ - ":protobuf", - ":proto_api", - ] + select({ - "//conditions:default": [], - ":use_fast_cpp_protos": ["//external:python_headers"], - }), -) - -config_setting( - name = "use_fast_cpp_protos", - values = { - "define": "use_fast_cpp_protos=true", - }, - visibility = [ - # Public, but Protobuf only visibility. - "//:__subpackages__", - ], -) - -config_setting( - name = "allow_oversize_protos", - values = { - "define": "allow_oversize_protos=true", - }, - visibility = [ - # Public, but Protobuf only visibility. - "//:__subpackages__", - ], -) - -# Copy the builtin proto files from src/google/protobuf to -# python/google/protobuf. This way, the generated Python sources will be in the -# same directory as the Python runtime sources. This is necessary for the -# modules to be imported correctly since they are all part of the same Python -# package. -internal_copied_filegroup( - name = "protos_python", - srcs = WELL_KNOWN_PROTOS, - dest = "python", - strip_prefix = "src", -) - -# TODO(dzc): Remove this once py_proto_library can have labels in srcs, in -# which case we can simply add :protos_python in srcs. -COPIED_WELL_KNOWN_PROTOS = ["python/" + s[4:] for s in WELL_KNOWN_PROTOS] - -py_proto_library( - name = "protobuf_python", - srcs = COPIED_WELL_KNOWN_PROTOS, - include = "python", - data = select({ - "//conditions:default": [], - ":use_fast_cpp_protos": [ - ":python/google/protobuf/internal/_api_implementation.so", - ":python/google/protobuf/pyext/_message.so", - ], - }), - default_runtime = "", - protoc = ":protoc", - py_libs = [ - ":python_srcs", - ], - srcs_version = "PY2AND3", - visibility = ["//visibility:public"], -) - -# Copy the test proto files from src/google/protobuf to -# python/google/protobuf. This way, the generated Python sources will be in the -# same directory as the Python runtime sources. This is necessary for the -# modules to be imported correctly by the tests since they are all part of the -# same Python package. -internal_copied_filegroup( - name = "protos_python_test", - srcs = LITE_TEST_PROTOS + TEST_PROTOS, - dest = "python", - strip_prefix = "src", -) - -# TODO(dzc): Remove this once py_proto_library can have labels in srcs, in -# which case we can simply add :protos_python_test in srcs. -COPIED_LITE_TEST_PROTOS = ["python/" + s for s in RELATIVE_LITE_TEST_PROTOS] - -COPIED_TEST_PROTOS = ["python/" + s for s in RELATIVE_TEST_PROTOS] - -py_proto_library( - name = "python_common_test_protos", - srcs = COPIED_LITE_TEST_PROTOS + COPIED_TEST_PROTOS, - include = "python", - default_runtime = "", - protoc = ":protoc", - srcs_version = "PY2AND3", - deps = [":protobuf_python"], -) - -py_proto_library( - name = "python_specific_test_protos", - srcs = glob([ - "python/google/protobuf/internal/*.proto", - "python/google/protobuf/internal/import_test_package/*.proto", - ]), - include = "python", - default_runtime = ":protobuf_python", - protoc = ":protoc", - srcs_version = "PY2AND3", - deps = [":python_common_test_protos"], -) - -py_library( - name = "python_tests", - srcs = glob( - [ - "python/google/protobuf/internal/*_test.py", - "python/google/protobuf/internal/test_util.py", - "python/google/protobuf/internal/import_test_package/__init__.py", - ], - ), - imports = ["python"], - srcs_version = "PY2AND3", - deps = [ - ":protobuf_python", - ":python_common_test_protos", - ":python_specific_test_protos", - ], -) - -internal_protobuf_py_tests( - name = "python_tests_batch", - data = glob([ - "src/google/protobuf/**/*", - ]), - modules = [ - "descriptor_database_test", - "descriptor_pool_test", - "descriptor_test", - "generator_test", - "json_format_test", - "message_factory_test", - "message_test", - "proto_builder_test", - "reflection_test", - "service_reflection_test", - "symbol_database_test", - "text_encoding_test", - "text_format_test", - "unknown_fields_test", - "wire_format_test", - ], - deps = [":python_tests"], -) - -cc_library( - name = "proto_api", - hdrs = ["python/google/protobuf/proto_api.h"], - visibility = ["//visibility:public"], - deps = [ - "//external:python_headers", - ], -) - -proto_lang_toolchain( - name = "cc_toolchain", - blacklisted_protos = [proto + "_proto" for proto in WELL_KNOWN_PROTO_MAP.keys()], - command_line = "--cpp_out=$(OUT)", - runtime = ":protobuf", - visibility = ["//visibility:public"], -) - -alias( - name = "objectivec", - actual = "//objectivec", - visibility = ["//visibility:public"], -) - -alias( - name = "protobuf_objc", - actual = "//objectivec", - visibility = ["//visibility:public"], -) - -################################################################################ -# Test generated proto support -################################################################################ - -genrule( - name = "generated_protos", - srcs = ["src/google/protobuf/unittest_import.proto"], - outs = ["unittest_gen.proto"], - cmd = "cat $(SRCS) | sed 's|google/|src/google/|' > $(OUTS)", -) - -proto_library( - name = "generated_protos_proto", - srcs = [ - "src/google/protobuf/unittest_import_public.proto", - "unittest_gen.proto", - ], -) - -py_proto_library( - name = "generated_protos_py", - srcs = [ - "src/google/protobuf/unittest_import_public.proto", - "unittest_gen.proto", - ], - default_runtime = "", - protoc = ":protoc", -) - -################################################################################ -# Conformance tests -################################################################################ - -proto_library( - name = "test_messages_proto2_proto", - srcs = ["src/google/protobuf/test_messages_proto2.proto"], - visibility = ["//visibility:public"], -) - -proto_library( - name = "test_messages_proto3_proto", - srcs = ["src/google/protobuf/test_messages_proto3.proto"], - visibility = ["//visibility:public"], - deps = [ - ":any_proto", - ":duration_proto", - ":field_mask_proto", - ":struct_proto", - ":timestamp_proto", - ":wrappers_proto", - ], -) - -cc_proto_library( - name = "test_messages_proto2_proto_cc", - srcs = ["src/google/protobuf/test_messages_proto2.proto"], -) - -cc_proto_library( - name = "test_messages_proto3_proto_cc", - srcs = ["src/google/protobuf/test_messages_proto3.proto"], - deps = [ - ":cc_wkt_protos", - ], -) - -proto_library( - name = "conformance_proto", - srcs = ["conformance/conformance.proto"], - visibility = ["//visibility:public"], -) - -cc_proto_library( - name = "conformance_proto_cc", - srcs = ["conformance/conformance.proto"], -) - -cc_library( - name = "jsoncpp", - srcs = ["conformance/third_party/jsoncpp/jsoncpp.cpp"], - hdrs = ["conformance/third_party/jsoncpp/json.h"], - includes = ["conformance"], -) - -cc_library( - name = "conformance_test", - srcs = [ - "conformance/conformance_test.cc", - "conformance/conformance_test_runner.cc", - ], - hdrs = [ - "conformance/conformance_test.h", - ], - includes = [ - "conformance", - "src", - ], - deps = [":conformance_proto_cc"], -) - -cc_library( - name = "binary_json_conformance_suite", - srcs = ["conformance/binary_json_conformance_suite.cc"], - hdrs = ["conformance/binary_json_conformance_suite.h"], - deps = [ - ":conformance_test", - ":jsoncpp", - ":test_messages_proto2_proto_cc", - ":test_messages_proto3_proto_cc", - ], -) - -cc_library( - name = "text_format_conformance_suite", - srcs = ["conformance/text_format_conformance_suite.cc"], - hdrs = ["conformance/text_format_conformance_suite.h"], - deps = [ - ":conformance_test", - ":test_messages_proto2_proto_cc", - ":test_messages_proto3_proto_cc", - ], -) - -cc_binary( - name = "conformance_test_runner", - srcs = ["conformance/conformance_test_main.cc"], - visibility = ["//visibility:public"], - deps = [ - ":binary_json_conformance_suite", - ":conformance_test", - ":text_format_conformance_suite", - ], -) - -# TODO: re-enable this test if appropriate, or replace with something that -# uses the new setup. -# sh_test( -# name = "build_files_updated_unittest", -# srcs = [ -# "build_files_updated_unittest.sh", -# ], -# data = [ -# "BUILD", -# "cmake/extract_includes.bat.in", -# "cmake/libprotobuf.cmake", -# "cmake/libprotobuf-lite.cmake", -# "cmake/libprotoc.cmake", -# "cmake/tests.cmake", -# "src/Makefile.am", -# "update_file_lists.sh", -# ], -# ) - -java_proto_library( - name = "test_messages_proto2_java_proto", - visibility = [ - "//java:__subpackages__", - ], - deps = [":test_messages_proto2_proto"], -) - -java_proto_library( - name = "test_messages_proto3_java_proto", - visibility = [ - "//java:__subpackages__", - ], - deps = [":test_messages_proto3_proto"], -) - -java_proto_library( - name = "conformance_java_proto", - visibility = [ - "//java:__subpackages__", - ], - deps = [":conformance_proto"], -) - -java_lite_proto_library( - name = "test_messages_proto2_java_proto_lite", - visibility = [ - "//java:__subpackages__", - ], - deps = [":test_messages_proto2_proto"], -) - -java_lite_proto_library( - name = "conformance_java_proto_lite", - visibility = [ - "//java:__subpackages__", - ], - deps = [":conformance_proto"], -) - -java_lite_proto_library( - name = "test_messages_proto3_java_proto_lite", - visibility = [ - "//java:__subpackages__", - ], - deps = [":test_messages_proto3_proto"], -) - -java_binary( - name = "conformance_java", - srcs = ["conformance/ConformanceJava.java"], - main_class = "ConformanceJava", - visibility = [ - "//java:__subpackages__", - ], - deps = [ - ":conformance_java_proto", - ":test_messages_proto2_java_proto", - ":test_messages_proto3_java_proto", - "//:protobuf_java", - "//:protobuf_java_util", - ], -) - -java_binary( - name = "conformance_java_lite", - srcs = ["conformance/ConformanceJavaLite.java"], - main_class = "ConformanceJavaLite", - visibility = [ - "//java:__subpackages__", - ], - deps = [ - ":conformance_java_proto_lite", - ":test_messages_proto2_java_proto_lite", - ":test_messages_proto3_java_proto_lite", - "//:protobuf_java_util", - "//:protobuf_javalite", - ], -) - -exports_files([ - "conformance/conformance_test_runner.sh", - "conformance/failure_list_java.txt", - "conformance/failure_list_java_lite.txt", - "conformance/text_format_failure_list_java.txt", - "conformance/text_format_failure_list_java_lite.txt", -]) - -filegroup( - name = "bzl_srcs", - srcs = glob(["**/*.bzl"]), - visibility = ["//visibility:public"], -) diff --git a/extra/protobuf/protobuf-3.19.4/CHANGES.txt b/extra/protobuf/protobuf-3.19.4/CHANGES.txt deleted file mode 100644 index b3c43613f18e..000000000000 --- a/extra/protobuf/protobuf-3.19.4/CHANGES.txt +++ /dev/null @@ -1,3081 +0,0 @@ -2022-01-28 version 3.19.4 (C++/Java/Python/PHP/Objective-C/C#/Ruby/JavaScript) - - Python - * Make libprotobuf symbols local on OSX to fix issue #9395 (#9435) - - Ruby - * Fixed a data loss bug that could occur when the number of `optional` - fields in a message is an exact multiple of 32. (#9440). - - PHP - * Fixed a data loss bug that could occur when the number of `optional` - fields in a message is an exact multiple of 32. (#9440). - -2022-01-10 version 3.19.3 (C++/Java/Python/PHP/Objective-C/C#/Ruby/JavaScript) - - Python - * Fix missing Windows wheel for Python 3.10 on PyPI - -2022-01-05 version 3.19.2 (C++/Java/Python/PHP/Objective-C/C#/Ruby/JavaScript) - - Java - * Improve performance characteristics of UnknownFieldSet parsing (#9371) - -2021-10-28 version 3.19.1 (C++/Java/Python/PHP/Objective-C/C#/Ruby/JavaScript) - - Bazel - * Ensure that release archives contain everything needed for Bazel (#9131) - * Align dependency handling with Bazel best practices (#9165) - - JavaScript - * Fix `ReferenceError: window is not defined` when getting the global object (#9156) - - Ruby - * Fix memory leak in MessageClass.encode (#9150) - -2021-10-15 version 3.19.0 (C++/Java/Python/PHP/Objective-C/C#/Ruby/JavaScript) - - C++ - * Make proto2::Message::DiscardUnknownFields() non-virtual - * Separate RepeatedPtrField into its own header file - * For default floating point values of 0, consider all bits significant - * cmake: support `MSVC_RUNTIME_LIBRARY` property (#8851) - * Fix shadowing warnings (#8926) - * Fix for issue #8484, constant initialization doesn't compile in msvc clang-cl environment (#8993) - * Fix build on AIX and SunOS (#8373) (#9065) - * Add Android stlport and default toolchains to BUILD. (#8290) - - Java - * For default floating point values of 0, consider all bits significant - * Annotate `//java/com/google/protobuf/util/...` with nullness annotations - * Use ArrayList copy constructor (#7853) - - Kotlin - * Switch Kotlin proto DSLs to be implemented with inline value classes - * Fix inlining and deprecation for repeated string fields in kotlin (#9120) - - Python - * Proto2 DecodeError now includes message name in error message - * Make MessageToDict convert map keys to strings (#8122) - * Add python-requires in setup.py (#8989) - * Add python 3.10 (#9034) - - JavaScript - * Skip exports if not available by CommonJS (#8856) - * JS: Comply with CSP no-unsafe-eval. (#8864) - - PHP - * Added "object" as a reserved name for PHP (#8962) - - Ruby - * Override Map.clone to use Map's dup method (#7938) - * Ruby: build extensions for arm64-darwin (#8232) - * Add class method Timestamp.from_time to ruby well known types (#8562) - * Adopt pure ruby DSL implementation for JRuby (#9047) - * Add size to Map class (#8068) - * Fix for descriptor_pb.rb: google/protobuf should be required first (#9121) - - C# - * Correctly set ExtensionRegistry when parsing with MessageParser, but using an already existing CodedInputStream (#7246) - * [C#] Make FieldDescriptor propertyName public (#7642) - -2021-10-04 version 3.18.1 (C++/Java/Python/PHP/Objective-C/C#/Ruby/JavaScript) - - Python - * Update setup.py to reflect that we now require at least Python 3.5 (#8989) - * Performance fix for DynamicMessage: force GetRaw() to be inlined (#9023) - - Ruby - * Update ruby_generator.cc to allow proto2 imports in proto3 (#9003) - -2021-09-13 version 3.18.0 (C++/Java/Python/PHP/Objective-C/C#/Ruby/JavaScript) - - Python - * Removed Python 2.x support. - * Pure python descriptor_pool.AddSerializedFile() will always build the - file and return FileDescriptor which is same with python c++ extension - * type errors thrown by MergeFrom now report fully qualified class names - * Protobuf python generated code are simplified. Some platforms that uses - "is"("is not") to compare the enum or descriptor's label/type may fail, - should use "=="("!=") instead. - - C++ - * Generated code now uses the c++11 standard integer types int{32,64}_t and - uint{32,64}_t - * Reduce memory usage of the DescriptorPool type. - * Moved the zero-argument New() method on messages to the base class (internal - optimization). - * Unused return values marked with `PROTOBUF_MUST_USE_RESULT` are now - correctly attributed. - * Demotes PrintPath log for maps in MessageDifferencer down from WARNING to - INFO. - * Make sure FullMessageName() is always private. - * Fix race condition in EnumDescriptor. - * Remove MessageLite::GetMaybeArenaPointer. - - Java - * Add @deprecated javadoc for set/get/has methods - * correctly decode \? escape sequence in text protos - * Avoid depending on Objects.requireNonNull() until we can verify that no - users are depending on older Android versions. - * disallow null string map values in put and putAll - * Add `@CheckReturnValue` to `ByteString` API. - * Make the `hasPresence` method public in `FieldDescriptor`. - * Report more detailed messages in Duration and Timestamp proto parsing - errors. - * New Timestamps.fromDate utility method that converts a java.util.Date to a - Timestamp proto object. - - Kotlin - * Generated Kotlin code is Explicit API mode compatible - -2021-09-13 version 3.18.0 (C++/Java/Python/PHP/Objective-C/C#/Ruby/JavaScript) - C++ - * Fix warnings raised by clang 11 (#8664) - * Make StringPiece constructible from std::string_view (#8707) - * Add missing capability attributes for LLVM 12 (#8714) - * Stop using std::iterator (deprecated in C++17). (#8741) - * Move field_access_listener from libprotobuf-lite to libprotobuf (#8775) - * Fix #7047 Safely handle setlocale (#8735) - * Remove deprecated version of SetTotalBytesLimit() (#8794) - * Support arena allocation of google::protobuf::AnyMetadata (#8758) - * Fix undefined symbol error around SharedCtor() (#8827) - * Fix default value of enum(int) in json_util with proto2 (#8835) - * Better Smaller ByteSizeLong - * Introduce event filters for inject_field_listener_events - * Reduce memory usage of DescriptorPool - * For lazy fields copy serialized form when allowed. - * Re-introduce the InlinedStringField class - * v2 access listener - * Reduce padding in the proto's ExtensionRegistry map. - * GetExtension performance optimizations - * Make tracker a static variable rather than call static functions - * Support extensions in field access listener - * Annotate MergeFrom for field access listener - * Fix incomplete types for field access listener - * Add map_entry/new_map_entry to SpecificField in MessageDifferencer. They - record the map items which are different in MessageDifferencer's reporter. - * Reduce binary size due to fieldless proto messages - * TextFormat: ParseInfoTree supports getting field end location in addition to - start. - * Fix repeated enum extension size in field listener - * Enable Any Text Expansion for Descriptors::DebugString() - * Switch from int{8,16,32,64} to int{8,16,32,64}_t - * Reduce memory usage of the DescriptorPool type. - - Java - * Fix errorprone conflict (#8723) - * Removing deprecated TimeUtil class. (#8749) - * Optimized FieldDescriptor.valueOf() to avoid array copying. - * Removing deprecated TimeUtil class. - * Add Durations.parseUnchecked(String) and Timestamps.parseUnchecked(String) - * FieldMaskUtil: Add convenience method to mask the fields out of a given proto. - - JavaScript - * Optimize binary parsing of repeated float64 - * Fix for optimization when reading doubles from binary wire format - * Replace toArray implementation with toJSON. - - Python - * Drops support for 2.7 and 3.5. - - PHP - * Migrate PHP & Ruby to ABSL wyhash (#8854) - * Added support for PHP 8.1 (currently in RC1) to the C extension (#8964) - * Fixed PHP SEGV when constructing messages from a destructor. (#8969) - - Ruby - * Move DSL implementation from C to pure Ruby (#8850) - * Fixed a memory bug with RepeatedField#+. (#8970) - - Other - * [csharp] ByteString.CreateCodedInput should use ArraySegment offset and count (#8740) - * [ObjC] Add support for using the proto package to prefix symbols. (#8760) - * field_presence.md: fix Go example (#8788) - - - Kotlin - * Suppress NOTHING_TO_INLINE in Kotlin generated inline functions. - -2021-06-04 version 3.17.3 (C++/Java/Python/PHP/Objective-C/C#/Ruby/JavaScript) - Python - * Note: This is the last release to support Python 2.7. Future releases will - require Python >= 3.5. - - C++ - * Introduce FieldAccessListener. - * Stop emitting boilerplate {Copy/Merge}From in each ProtoBuf class - * Fixed some uninitialized variable warnings in generated_message_reflection.cc. - - Kotlin - * Fix duplicate proto files error (#8699) - - Java - * Fixed parser to check that we are at a proper limit when a sub-message has - finished parsing. - -2021-05-25 version 3.17.2 (C++/Java/Python/PHP/Objective-C/C#/Ruby/JavaScript) - Kotlin - * Fix duplicate class error (#8653) - - PHP - * Fixed SEGV in sub-message getters for well-known types when message is unset - (#8670) - -2021-05-07 version 3.17.1 (C++/Java/Python/PHP/Objective-C/C#/Ruby/JavaScript) - PHP - * Fixed PHP memory leaks and arginfo errors. (#8614) - * Fixed JSON parser to allow multiple values from the same oneof as long as - all but one are null. - - Ruby - * Fixed memory bug: properly root repeated/map field when assigning. (#8639) - * Fixed JSON parser to allow multiple values from the same oneof as long as - all but one are null. - - -2021-05-07 version 3.17.0 (C++/Java/Python/PHP/Objective-C/C#/Ruby/JavaScript) - - Protocol Compiler - * Fix the generated source information for reserved values in Enums. - - C++ - * Fix -Wunused-parameter in map fields (fixes #8494) (#8500) - * Use byteswap.h when building against musl libc (#8503) - * Fix -Wundefined-inline error when using SharedCtor() or SharedDtor() (#8532) - * Fix bug where `Descriptor::DebugString()` printed proto3 synthetic oneofs. - * Provide stable versions of `SortAndUnique()`. - * Make sure to cache proto3 optional message fields when they are cleared. - * Expose UnsafeArena methods to Reflection. - * Use std::string::empty() rather than std::string::size() > 0. - - Kotlin - * Restrict extension setter and getter operators to non-nullable T. - - Java - * updating GSON and Guava to more recent versions (#8524) - * Reduce the time spent evaluating isExtensionNumber by storing the extension - ranges in a TreeMap for faster queries. This is particularly relevant for - protos which define a large number of extension ranges, for example when - each tag is defined as an extension. - * Fix java bytecode estimation logic for optional fields. - * Optimize Descriptor.isExtensionNumber. - - Python - * Add MethodDescriptor.CopyToProto() (#8327) - * Remove unused python_protobuf.{cc,h} (#8513) - * Start publishing python aarch64 manylinux wheels normally (#8530) - * Fix constness issue detected by MSVC standard conforming mode (#8568) - * Make JSON parsing match C++ and Java when multiple fields from the same - oneof are present and all but one is null. - - Ruby - * Add support for proto3 json_name in compiler and field definitions (#8356) - * Fixed memory leak of Ruby arena objects. (#8461) - * Fix source gem compilation (#8471) - * Fix various exceptions in Ruby on 64-bit Windows (#8563) - * Fix crash when calculating Message hash values on 64-bit Windows (#8565) - - Conformance Tests - * Added a conformance test for the case of multiple fields from the same - oneof. - -2021-04-06 version 3.16.0 (C++/Java/Python/PHP/Objective-C/C#/Ruby/JavaScript) - Other - * Opensourcing kotlin protos (#8272) - * Use a newer version of rules_proto, with the new rule `proto_descriptor_set` (#8469) - - C++ - * Fix compiler warnings issue found in conformance_test_runner #8189 (#8190) - * Fix MinGW-w64 build issues. (#8286) - * [Protoc] C++ Resolved an issue where NO_DESTROY and CONSTINIT are in incorrect order (#8296) - * Fix PROTOBUF_CONSTINIT macro redefinition (#8323) - * Delete StringPiecePod (#8353) - * Fix gcc error: comparison of unsigned expression in '>= 0' is always … (#8309) - * Fix cmake install on iOS (#8301) - * Create a CMake option to control whether or not RTTI is enabled (#8347) - * Fix endian.h location on FreeBSD (#8351) - * Refactor util::Status (#8354) - * Make util::Status more similar to absl::Status (#8405) - * Fix -Wsuggest-destructor-override for generated C++ proto classes. (#8408) - * Refactor StatusOr and StringPiece (#8406) - * Refactor uint128 (#8416) - * The ::pb namespace is no longer exposed due to conflicts. - * Allow MessageDifferencer::TreatAsSet() (and friends) to override previous - calls instead of crashing. - * Reduce the size of generated proto headers for protos with `string` or - `bytes` fields. - * Move arena() operation on uncommon path to out-of-line routine - * For iterator-pair function parameter types, take both iterators by value. - * Code-space savings and perhaps some modest performance improvements in - RepeatedPtrField. - * Eliminate nullptr check from every tag parse. - * Remove unused _$name$_cached_byte_size_ fields. - * Serialize extension ranges together when not broken by a proto field in the - middle. - * Do out-of-line allocation and deallocation of string object in ArenaString. - * Streamline ParseContext::ParseMessage to avoid code bloat and improve - performance. - * New member functions RepeatedField::Assign, RepeatedPtrField::{Add, Assign}. - * Fix undefined behavior warning due to innocuous uninitialization of value - on an error path. - * Avoid expensive inlined code space for encoding message length for messages - >= 128 bytes and instead do a procedure call to a shared out-of-line routine. - * util::DefaultFieldComparator will be final in a future version of protobuf. - Subclasses should inherit from SimpleFieldComparator instead. - - C# - * Add .NET 5 target and improve WriteString performance with SIMD (#8147) - - Java - * deps: update JUnit and Truth (#8319) - * Detect invalid overflow of byteLimit and return InvalidProtocolBufferException as documented. - * Exceptions thrown while reading from an InputStream in parseFrom are now - included as causes. - * Support potentially more efficient proto parsing from RopeByteStrings. - * Clarify runtime of ByteString.Output.toStringBuffer(). - * Added UnsafeByteOperations to protobuf-lite (#8426) - - JavaScript - * Make Any.pack() chainable. - - Python - * Fix some constness / char literal issues being found by MSVC standard conforming mode (#8344) - * Switch on "new" buffer API (#8339) - * Enable crosscompiling aarch64 python wheels under dockcross manylinux docker image (#8280) - * Fixed a bug in text format where a trailing colon was printed for repeated field. - * When TextFormat encounters a duplicate message map key, replace the current - one instead of merging. - - Objective-C - * Move the class map to a CFDictionary. (#8328) - - PHP - * read_property() handler is not supposed to return NULL (#8362) - * Changed parameter type from long to integer (#7613) - * fix: README supported PHP version for C extension (#8236) - - Ruby - * Fixed quadratic memory usage when appending to arrays. (#8364) - * Fixed memory leak of Ruby arena objects. (#8461) - * Add support for proto3 json_name in compiler and field definitions. (#8356) - - Other - * Some doc on AOT compilation and protobuf (#8294) - * [CMake] Ability to pass options to protoc executable from cmake (#8374) - * Add --fatal_warnings flag to treat warnings as errors (#8131) - * [bazel] Remove deprecated way to depend on googletest (#8396) - * add error returns missing from protoc to prevent it from exiting with… (#8409) - - -2021-04-07 version 3.15.8 (C++/Java/Python/PHP/Objective-C/C#/Ruby/JavaScript) - - Ruby - * Fixed memory leak of Ruby arena objects (#8461) - -2021-04-02 version 3.15.7 (C++/Java/Python/PHP/Objective-C/C#/Ruby/JavaScript) - - C++ - * Remove the ::pb namespace (alias) (#8423) - - Ruby - * Fix unbounded memory growth for Ruby <2.7 (#8429) - * Fixed message equality in cases where the message type is different (#8434) - -2021-03-10 version 3.15.6 (C++/Java/Python/PHP/Objective-C/C#/Ruby/JavaScript) - - Ruby - * Fixed bug in string comparison logic (#8386) - -2021-03-04 version 3.15.5 (C++/Java/Python/PHP/Objective-C/C#/Ruby/JavaScript) - - Ruby - * Fixed quadratic memory use in array append (#8379) - - PHP - * Fixed quadratic memory use in array append (#8379) - - C++ - * Do not disable RTTI by default in the CMake build (#8377) - -2021-03-02 version 3.15.4 (C++/Java/Python/PHP/Objective-C/C#/Ruby/JavaScript) - - Ruby - * Fixed SEGV when users pass nil messages (#8363) - * Fixed quadratic memory usage when appending to arrays (#8364) - - C++ - * Create a CMake option to control whether or not RTTI is enabled (#8361) - - PHP - * read_property() handler is not supposed to return NULL (#8362) - -2021-02-25 version 3.15.3 (C++/Java/Python/PHP/Objective-C/C#/Ruby/JavaScript) - - Ruby - * Ruby <2.7 now uses WeakMap too, which prevents memory leaks. (#8341) - -2021-02-23 version 3.15.2 (C++/Java/Python/PHP/Objective-C/C#/Ruby/JavaScript) - - Ruby - * Fix for FieldDescriptor.get(msg) (#8330) - - C++ - * Fix PROTOBUF_CONSTINIT macro redefinition (#8323) - -2021-02-05 version 3.15.1 (C++/Java/Python/PHP/Objective-C/C#/Ruby/JavaScript) - - Ruby - * Bugfix for Message.[] for repeated or map fields (#8313) - -2021-02-05 version 3.15.0 (C++/Java/Python/PHP/Objective-C/C#/Ruby/JavaScript) - - Protocol Compiler - * Optional fields for proto3 are enabled by default, and no longer require - the --experimental_allow_proto3_optional flag. - - C++ - * MessageDifferencer: fixed bug when using custom ignore with multiple - unknown fields - * Use init_seg in MSVC to push initialization to an earlier phase. - * Runtime no longer triggers -Wsign-compare warnings. - * Fixed -Wtautological-constant-out-of-range-compare warning. - * DynamicCastToGenerated works for nullptr input for even if RTTI is disabled - * Arena is refactored and optimized. - * Clarified/specified that the exact value of Arena::SpaceAllocated() is an - implementation detail users must not rely on. It should not be used in - unit tests. - * Change the signature of Any::PackFrom() to return false on error. - * Add fast reflection getter API for strings. - * Constant initialize the global message instances - * Avoid potential for missed wakeup in UnknownFieldSet - * Now Proto3 Oneof fields have "has" methods for checking their presence in - C++. - * Bugfix for NVCC - * Return early in _InternalSerialize for empty maps. - * Adding functionality for outputting map key values in proto path logging - output (does not affect comparison logic) and stop printing 'value' in the - path. The modified print functionality is in the - MessageDifferencer::StreamReporter. - * Fixed https://github.com/protocolbuffers/protobuf/issues/8129 - * Ensure that null char symbol, package and file names do not result in a - crash. - * Constant initialize the global message instances - * Pretty print 'max' instead of numeric values in reserved ranges. - * Removed remaining instances of std::is_pod, which is deprecated in C++20. - * Changes to reduce code size for unknown field handling by making uncommon - cases out of line. - * Fix std::is_pod deprecated in C++20 (#7180) - * Fix some -Wunused-parameter warnings (#8053) - * Fix detecting file as directory on zOS issue #8051 (#8052) - * Don't include sys/param.h for _BYTE_ORDER (#8106) - * remove CMAKE_THREAD_LIBS_INIT from pkgconfig CFLAGS (#8154) - * Fix TextFormatMapTest.DynamicMessage issue#5136 (#8159) - * Fix for compiler warning issue#8145 (#8160) - * fix: support deprecated enums for GCC < 6 (#8164) - * Fix some warning when compiling with Visual Studio 2019 on x64 target (#8125) - - Python - * Provided an override for the reverse() method that will reverse the internal - collection directly instead of using the other methods of the BaseContainer. - * MessageFactory.CreateProtoype can be overridden to customize class creation. - * Fix PyUnknownFields memory leak (#7928) - * Add macOS Big Sur compatibility (#8126) - - JavaScript - * Generate `getDescriptor` methods with `*` as their `this` type. - * Enforce `let/const` for generated messages. - * js/binary/utils.js: Fix jspb.utils.joinUnsignedDecimalString to work with negative bitsLow and low but non-zero bitsHigh parameter. (#8170) - - PHP - * Added support for PHP 8. (#8105) - * unregister INI entries and fix invalid read on shutdown (#8042) - * Fix PhpDoc comments for message accessors to include "|null". (#8136) - * fix: convert native PHP floats to single precision (#8187) - * Fixed PHP to support field numbers >=2**28. (#8235) - * feat: add support for deprecated fields to PHP compiler (#8223) - * Protect against stack overflow if the user derives from Message. (#8248) - * Fixed clone for Message, RepeatedField, and MapField. (#8245) - * Updated upb to allow nonzero offset minutes in JSON timestamps. (#8258) - - Ruby - * Added support for Ruby 3. (#8184) - * Rewrote the data storage layer to be based on upb_msg objects from the - upb library. This should lead to much better parsing performance, - particularly for large messages. (#8184). - * Fill out JRuby support (#7923) - * [Ruby] Fix: (SIGSEGV) gRPC-Ruby issue on Windows. memory alloc infinite - recursion/run out of memory (#8195) - * Fix jruby support to handle messages nested more than 1 level deep (#8194) - - Java - * Avoid possible UnsupportedOperationException when using CodedInputSteam - with a direct ByteBuffer. - * Make Durations.comparator() and Timestamps.comparator() Serializable. - * Add more detailed error information for dynamic message field type - validation failure - * Removed declarations of functions declared in java_names.h from - java_helpers.h. - * Now Proto3 Oneof fields have "has" methods for checking their presence in - Java. - * Annotates Java proto generated *_FIELD_NUMBER constants. - * Add -assumevalues to remove JvmMemoryAccessor on Android. - - C# - * Fix parsing negative Int32Value that crosses segment boundary (#8035) - * Change ByteString to use memory and support unsafe create without copy (#7645) - * Optimize MapField serialization by removing MessageAdapter (#8143) - * Allow FileDescriptors to be parsed with extension registries (#8220) - * Optimize writing small strings (#8149) - -2020-11-11 version 3.14.0 (C++/Java/Python/PHP/Objective-C/C#/Ruby/JavaScript) - - Protocol Compiler - * The proto compiler no longer requires a .proto filename when it is not - generating code. - * Added flag `--deterministic_output` to `protoc --encode=...`. - * Fixed deadlock when using google.protobuf.Any embedded in aggregate options. - - C++ - * Arenas are now unconditionally enabled. cc_enable_arenas no longer has - any effect. - * Removed inlined string support, which is incompatible with arenas. - * Fix a memory corruption bug in reflection when mixing optional and - non-optional fields. - * Make SpaceUsed() calculation more thorough for map fields. - * Add stack overflow protection for text format with unknown field values. - * FieldPath::FollowAll() now returns a bool to signal if an out-of-bounds - error was encountered. - * Performance improvements for Map. - * Minor formatting fix when dumping a descriptor to .proto format with - DebugString. - * UBSAN fix in RepeatedField (#2073). - * When running under ASAN, skip a test that makes huge allocations. - * Fixed a crash that could happen when creating more than 256 extensions in - a single message. - * Fix a crash in BuildFile when passing in invalid descriptor proto. - * Parser security fix when operating with CodedInputStream. - * Warn against the use of AllowUnknownExtension. - * Migrated to C++11 for-range loops instead of index-based loops where - possible. This fixes a lot of warnings when compiling with -Wsign-compare. - * Fix segment fault for proto3 optional (#7805) - * Adds a CMake option to build `libprotoc` separately (#7949) - - Java - * Bugfix in mergeFrom() when a oneof has multiple message fields. - * Fix RopeByteString.RopeInputStream.read() returning -1 when told to read - 0 bytes when not at EOF. - * Redefine remove(Object) on primitive repeated field Lists to avoid - autoboxing. - * Support "\u" escapes in textformat string literals. - * Trailing empty spaces are no longer ignored for FieldMask. - * Fix FieldMaskUtil.subtract to recursively remove mask. - * Mark enums with `@java.lang.Deprecated` if the proto enum has option - `deprecated = true;`. - * Adding forgotten duration.proto to the lite library (#7738) - - Python - * Print google.protobuf.NullValue as null instead of "NULL_VALUE" when it is - used outside WKT Value/Struct. - * Fix bug occurring when attempting to deep copy an enum type in python 3. - * Add a setuptools extension for generating Python protobufs (#7783) - * Remove uses of pkg_resources in non-namespace packages. (#7902) - * [bazel/py] Omit google/__init__.py from the Protobuf runtime. (#7908) - * Removed the unnecessary setuptools package dependency for Python package (#7511) - * Fix PyUnknownFields memory leak (#7928) - - PHP - * Added support for "==" to the PHP C extension (#7883) - * Added `==` operators for Map and Array. (#7900) - * Native C well-known types (#7944) - * Optimized away hex2bin() call in generated code (#8006) - * New version of upb, and a new hash function wyhash in third_party. (#8000) - * add missing hasOneof method to check presence of oneof fields (#8003) - - Go: - * Update go_package options to reference google.golang.org/protobuf module. - - C#: - * annotate ByteString.CopyFrom(ReadOnlySpan) as SecuritySafeCritical (#7701) - * Fix C# optional field reflection when there are regular fields too (#7705) - * Fix parsing negative Int32Value that crosses segment boundary (#8035) - - Javascript: - * JS: parse (un)packed fields conditionally (#7379) - -2020-07-14 version 3.13.0 (C++/Java/Python/PHP/Objective-C/C#/Ruby/JavaScript) - - PHP: - * The C extension is completely rewritten. The new C extension has significantly - better parsing performance and fixes a handful of conformance issues. It will - also make it easier to add support for more features like proto2 and proto3 presence. - * The new C extension does not support PHP 5.x. PHP 5.x users can still use pure-PHP. - - C++: - * Removed deprecated unsafe arena string accessors - * Enabled heterogeneous lookup for std::string keys in maps. - * Removed implicit conversion from StringPiece to std::string - * Fix use-after-destroy bug when the Map is allocated in the arena. - * Improved the randomness of map ordering - * Added stack overflow protection for text format with unknown fields - * Use std::hash for proto maps to help with portability. - * Added more Windows macros to proto whitelist. - * Arena constructors for map entry messages are now marked "explicit" - (for regular messages they were already explicit). - * Fix subtle aliasing bug in RepeatedField::Add - * Fix mismatch between MapEntry ByteSize and Serialize with respect to unset - fields. - - Python: - * JSON format conformance fixes: - * Reject lowercase t for Timestamp json format. - * Print full_name directly for extensions (no camelCase). - * Reject boolean values for integer fields. - * Reject NaN, Infinity, -Infinity that is not quoted. - * Base64 fixes for bytes fields: accept URL-safe base64 and missing padding. - * Bugfix for fields/files named "async" or "await". - * Improved the error message when AttributeError is returned from __getattr__ - in EnumTypeWrapper. - - Java: - * Fixed a bug where setting optional proto3 enums with setFooValue() would - not mark the value as present. - * Add Subtract function to FieldMaskUtil. - - C#: - * Dropped support for netstandard1.0 (replaced by support for netstandard1.1). - This was required to modernize the parsing stack to use the `Span` - type internally. (#7351) - * Add `ParseFrom(ReadOnlySequence)` method to enable GC friendly - parsing with reduced allocations and buffer copies. (#7351) - * Add support for serialization directly to a `IBufferWriter` or - to a `Span` to enable GC friendly serialization. - The new API is available as extension methods on the `IMessage` type. (#7576) - * Add `GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE` define to make - generated code compatible with old C# compilers (pre-roslyn compilers - from .NET framework and old versions of mono) that do not support - ref structs. Users that are still on a legacy stack that does - not support C# 7.2 compiler might need to use the new define - in their projects to be able to build the newly generated code. (#7490) - * Due to the major overhaul of parsing and serialization internals (#7351 and #7576), - it is recommended to regenerate your generated code to achieve the best - performance (the legacy generated code will still work, but might incur - a slight performance penalty). - -2020-07-28 version 3.12.4 (C++/Java/Python/PHP/Objective-C/C#/Ruby/JavaScript) - -This release contains no significant changes, but exists because 3.12.3 was -mistakenly tagged at the wrong commit. - -2020-06-01 version 3.12.3 (C++/Java/Python/PHP/Objective-C/C#/Ruby/JavaScript) - - Objective-C - * Tweak the union used for Extensions to support old generated code. #7573 - -2020-05-26 version 3.12.2 (C++/Java/Python/PHP/Objective-C/C#/Ruby/JavaScript) - - C++ - * Simplified the template export macros to fix the build for mingw32. (#7539) - - Objective-C - * Fix for the :protobuf_objc target in the Bazel BUILD file. (#7538) - -2020-05-20 version 3.12.1 (C++/Java/Python/PHP/Objective-C/C#/Ruby/JavaScript) - - Ruby - * Re-add binary gems for Ruby 2.3 and 2.4. These are EOL upstream, however - many people still use them and dropping support will require more - coordination. - -2020-05-12 version 3.12.0 (C++/Java/Python/PHP/Objective-C/C#/Ruby/JavaScript) - - Protocol Compiler - * [experimental] Singular, non-message typed fields in proto3 now support - presence tracking. This is enabled by adding the "optional" field label and - passing the --experimental_allow_proto3_optional flag to protoc. - * For usage info, see docs/field_presence.md. - * During this experimental phase, code generators should update to support - proto3 presence, see docs/implementing_proto3_presence.md for instructions. - * Allow duplicate symbol names when multiple descriptor sets are passed on - the command-line, to match the behavior when multiple .proto files are passed. - * Deterministic `protoc --descriptor_set_out` (#7175) - - C++ - * [experimental] Added proto3 presence support. - * New descriptor APIs to support proto3 presence. - * Enable Arenas by default on all .proto files. - * Documented that users are not allowed to subclass Message or MessageLite. - * Mark generated classes as final; inheriting from protos is strongly discouraged. - * Add stack overflow protection for text format with unknown fields. - * Add accessors for map key and value FieldDescriptors. - * Add FieldMaskUtil::FromFieldNumbers(). - * MessageDifferencer: use ParsePartial() on Any fields so the diff does not - fail when there are missing required fields. - * ReflectionOps::Merge(): lookup messages in the right factory, if it can. - * Added Descriptor::WellKnownTypes enum and Descriptor::well_known_type() - accessor as an easier way of determining if a message is a Well-Known Type. - * Optimized RepeatedField::Add() when it is used in a loop. - * Made proto move/swap more efficient. - * De-virtualize the GetArena() method in MessageLite. - * Improves performance of json_stream_parser.cc by factor 1000 (#7230) - * bug: #7076 undefine Windows OUT and OPTIONAL macros (#7087) - * Fixed a bug in FieldDescriptor::DebugString() that would erroneously print - an "optional" label for a field in a oneof. - * Fix bug in parsing bool extensions that assumed they are always 1 byte. - * Fix off-by-one error in FieldOptions::ByteSize() when extensions are present. - * Clarified the comments to show an example of the difference between - Descriptor::extension and DescriptorPool::FindAllExtensions. - * Add a compiler option 'code_size' to force optimize_for=code_size on all - protos where this is possible. - - Java - * [experimental] Added proto3 presence support. - * Mark java enum _VALUE constants as @Deprecated if the enum field is deprecated - * reduce size for enums with allow_alias set to true. - * Sort map fields alphabetically by the field's key when printing textproto. - * Fixed a bug in map sorting that appeared in -rc1 and -rc2 (#7508). - * TextFormat.merge() handles Any as top level type. - * Throw a descriptive IllegalArgumentException when calling - getValueDescriptor() on enum special value UNRECOGNIZED instead of - ArrayIndexOutOfBoundsException. - * Fixed an issue with JsonFormat.printer() where setting printingEnumsAsInts() - would override the configuration passed into includingDefaultValueFields(). - * Implement overrides of indexOf() and contains() on primitive lists returned - for repeated fields to avoid autoboxing the list contents. - * Add overload to FieldMaskUtil.fromStringList that accepts a descriptor. - * [bazel] Move Java runtime/toolchains into //java (#7190) - - Python - * [experimental] Added proto3 presence support. - * [experimental] fast import protobuf module, only works with cpp generated code linked in. - * Truncate 'float' fields to 4 bytes of precision in setters for pure-Python - implementation (C++ extension was already doing this). - * Fixed a memory leak in C++ bindings. - * Added a deprecation warning when code tries to create Descriptor objects - directly. - * Fix unintended comparison between bytes and string in descriptor.py. - * Avoid printing excess digits for float fields in TextFormat. - * Remove Python 2.5 syntax compatibility from the proto compiler generated _pb2.py module code. - * Drop 3.3, 3.4 and use single version docker images for all python tests (#7396) - - JavaScript - * Fix js message pivot selection (#6813) - - PHP - * Persistent Descriptor Pool (#6899) - * Implement lazy loading of php class for proto messages (#6911) - * Correct @return in Any.unpack docblock (#7089) - * Ignore unknown enum value when ignore_unknown specified (#7455) - - Ruby - * [experimental] Implemented proto3 presence for Ruby. (#7406) - * Stop building binary gems for ruby <2.5 (#7453) - * Fix for wrappers with a zero value (#7195) - * Fix for JSON serialization of 0/empty-valued wrapper types (#7198) - * Call "Class#new" over rb_class_new_instance in decoding (#7352) - * Build extensions for Ruby 2.7 (#7027) - * assigning 'nil' to submessage should clear the field. (#7397) - - C# - * [experimental] Add support for proto3 presence fields in C# (#7382) - * Mark GetOption API as obsolete and expose the "GetOptions()" method on descriptors instead (#7491) - * Remove Has/Clear members for C# message fields in proto2 (#7429) - * Enforce recursion depth checking for unknown fields (#7132) - * Fix conformance test failures for Google.Protobuf (#6910) - * Cleanup various bits of Google.Protobuf (#6674) - * Fix latest ArgumentException for C# extensions (#6938) - * Remove unnecessary branch from ReadTag (#7289) - - Objective-C - * [experimental] ObjC Proto3 optional support (#7421) - * Block subclassing of generated classes (#7124) - * Use references to Obj C classes instead of names in descriptors. (#7026) - * Revisit how the WKTs are bundled with ObjC. (#7173) - - Other - * Add a proto_lang_toolchain for javalite (#6882) - * [bazel] Update gtest and deprecate //external:{gtest,gtest_main} (#7237) - * Add application note for explicit presence tracking. (#7390) - * Howto doc for implementing proto3 presence in a code generator. (#7407) - - -2020-02-14 version 3.11.4 (C++/Java/Python/PHP/Objective-C/C#/Ruby/JavaScript) - - C# - * Fix latest ArgumentException for C# extensions (#7188) - * Enforce recursion depth checking for unknown fields (#7210) - - Ruby - * Fix wrappers with a zero value (#7195) - * Fix JSON serialization of 0/empty-valued wrapper types (#7198) - -2020-01-31 version 3.11.3 (C++/Java/Python/PHP/Objective-C/C#/Ruby/JavaScript) - - C++ - * Add OUT and OPTIONAL to windows portability files (#7087) - - PHP - * Refactored ulong to zend_ulong for php7.4 compatibility (#7147) - * Call register_class before getClass from desc to fix segfault (#7077) - - -2019-12-10 version 3.11.2 (C++/Java/Python/PHP/Objective-C/C#/Ruby/JavaScript) - - PHP - * Make c extension portable for php 7.4 (#6968) - - -2019-12-02 version 3.11.1 (C++/Java/Python/PHP/Objective-C/C#/Ruby/JavaScript) - - PHP - * Extern declare protobuf_globals (#6946) - - -2019-11-19 version 3.11.0 (C++/Java/Python/PHP/Objective-C/C#/Ruby/JavaScript) - - C++ - * Make serialization method naming consistent - * Make proto runtime + generated code free of deprecation warnings - * Moved ShutdownProtobufLibrary() to message_lite.h. For backward compatibility a declaration is still available in stubs/common.h, but users should prefer message_lite.h - * Removed non-namespace macro EXPECT_OK() - * Removed mathlimits.h from stubs in favor of using std::numeric_limits from C++11 - * Fixed bug in parser when ending on a group tag - * Add a helper function to UnknownFieldSet to deal with the changing return value of message::unknown_fields() - * Fix incorrect use of string_view iterators - * Support direct pickling of nested messages - * Skip extension tag validation for MessageSet if unknown dependencies are allowed - * Updated deprecation macros to annotate deprecated code (#6612) - * Remove conversion warning in MapEntryFuncs::ByteSizeLong (#6766) - * Revert "Make shared libraries be able to link to MSVC static runtime libraries, so that VC runtime is not required." (#6914) - - Java - * Remove the usage of MethodHandle, so that Android users prior to API version 26 can use protobuf-java - * Publish ProGuard config for javalite - * Fix for StrictMode disk read violation in ExtensionRegistryLite - * Include part of the ByteString's content in its toString(). - * Include unknown fields when merging proto3 messages in Java lite builders - - Python - * Add float_precision option in json format printer - * Optionally print bytes fields as messages in unknown fields, if possible - * FieldPath: fix testing IsSet on root path '' - * Experimental code gen (fast import protobuf module) which only work with cpp generated code linked in - - JavaScript - * Remove guard for Symbol iterator for jspb.Map - - PHP - * Avoid too much overhead in layout_init (#6716) - * Lazily Create Singular Wrapper Message (#6833) - * Implement lazy loading of php class for proto messages (#6911) - - Ruby - * Ruby lazy wrappers optimization (#6797) - - C# - * (RepeatedField): Capacity property to resize the internal array (#6530) - * Experimental proto2 support is now officially available (#4642, #5183, #5350, #5936) - * Getting started doc: https://github.com/protocolbuffers/protobuf/blob/master/docs/csharp/proto2.md - * Add length checks to ExtensionCollection (#6759) - * Optimize parsing of some primitive and wrapper types (#6843) - * Use 3 parameter Encoding.GetString for default string values (#6828) - * Change _Extensions property to normal body rather than expression (#6856) - - Objective C - * Fixed unaligned reads for 32bit arm with newer Xcode versions (#6678) - - -2019-09-03 version 3.10.0 (C++/Java/Python/PHP/Objective-C/C#/Ruby/JavaScript) - - C++ - * Switch the proto parser to the faster MOMI parser. - * Properly escape Struct keys in the proto3 JSON serializer. - * Fix crash on uninitialized map entries. - * Informed the compiler of has-bit invariant to produce better code - * Unused imports of files defining descriptor extensions will now be reported - * Add proto2::util::RemoveSubranges to remove multiple subranges in linear time. - * Added BaseTextGenerator::GetCurrentIndentationSize() - * Made implicit weak fields compatible with the Apple linker - * Support 32 bit values for ProtoStreamObjectWriter to Struct. - * Removed the internal-only header coded_stream_inl.h and the internal-only methods defined there. - * Enforced no SWIG wrapping of descriptor_database.h (other headers already had this restriction). - * Implementation of the equivalent of the MOMI parser for serialization. This removes one of the two serialization routines, by making the fast array serialization routine completely general. SerializeToCodedStream can now be implemented in terms of the much much faster array serialization. The array serialization regresses slightly, but when array serialization is not possible this wins big. - * Do not convert unknown field name to snake case to accurately report error. - * Fix a UBSAN warnings. (#6333) - * Add podspec for C++ (#6404) - * protoc: fix source code info location for missing label (#6436) - * C++ Add move constructor for Reflection's SetString (#6477) - - Java - * Call loadDescriptor outside of synchronized block to remove one possible source of deadlock. - * Have oneof enums implement a separate interface (other than EnumLite) for clarity. - * Opensource Android Memory Accessors - * Update TextFormat to make use of the new TypeRegistry. - * Support getFieldBuilder and getRepeatedFieldBuilder in ExtendableBuilder - * Update JsonFormat to make use of the new TypeRegistry. - * Add proguard config generator for GmmBenchmarkSuiteLite. - * Change ProtobufArrayList to use Object[] instead of ArrayList for 5-10% faster parsing - * Implement ProtobufArrayList.add(E) for 20% (5%-40%) faster overall protolite2 parsing - * Make a copy of JsonFormat.TypeRegistry at the protobuf top level package. This will eventually replace JsonFormat.TypeRegistry. - * Fix javadoc warnings in generated files (#6231) - * Java: Add Automatic-Module-Name entries to the Manifest (#6568) - - Python - * Add descriptor methods in descriptor_pool are deprecated. - * Uses explicit imports to prevent multithread test failures in py3. - * Added __delitem__ for Python extension dict - * Update six version to 1.12.0 and fix legacy_create_init issue (#6391) - - JavaScript - * Remove deprecated boolean option to getResultBase64String(). - * Fix sint64 zig-zag encoding. - * Simplify hash64 string conversion to avoid DIGIT array. Should reduce overhead if these functions aren't used, and be more efficient by avoiding linear array searches. - * Change the parameter types of binaryReaderFn in ExtensionFieldBinaryInfo to (number, ?, ?). - * Create dates.ts and time_of_days.ts to mirror Java versions. This is a near-identical conversion of c.g.type.util.{Dates,TimeOfDays} respectively. - * Migrate moneys to TypeScript. - - PHP - * Fix incorrect leap day for Timestamp (#6696) - * Initialize well known type values (#6713) - - Ruby - * Fix scope resolution for Google namespace (#5878) - * Support hashes for struct initializers (#5716) - * Optimized away the creation of empty string objects. (#6502) - * Roll forward Ruby upb changes now that protobuf Ruby build is fixed (#5866) - * Optimized layout_mark() for Ruby (#6521) - * Optimization for layout_init() (#6547) - * Fix for GC of Ruby map frames. (#6533) - * Fixed leap year handling by reworking upb_mktime() -> upb_timegm(). (#6695) - - Objective C - * Remove OSReadLittle* due to alignment requirements (#6678) - * Don't use unions and instead use memcpy for the type swaps. (#6672) - - Other - * Override CocoaPods module to lowercase (#6464) - - -2019-06-28 version 3.9.0 (C++/Java/Python/PHP/Objective-C/C#/Ruby/JavaScript) - - C++ - * Optimize and simplify implementation of RepeatedPtrFieldBase - * Don't create unnecessary unknown field sets. - * Remove branch from accessors to repeated field element array. - * Added delimited parse and serialize util. - * Reduce size by not emitting constants for fieldnumbers - * Fix a bug when comparing finite and infinite field values with explicit tolerances. - * TextFormat::Parser should use a custom Finder to look up extensions by number if one is provided. - * Add MessageLite::Utf8DebugString() to make MessageLite more compatible with Message. - * Fail fast for better performance in DescriptorPool::FindExtensionByNumber() if descriptor has no defined extensions. - * Adding the file name to help debug colliding extensions - * Added FieldDescriptor::PrintableNameForExtension() and DescriptorPool::FindExtensionByPrintableName(). - The latter will replace Reflection::FindKnownExtensionByName(). - * Replace NULL with nullptr - * Created a new Add method in repeated field that allows adding a range of elements all at once. - * Enabled enum name-to-value mapping functions for C++ lite - * Avoid dynamic initialization in descriptor.proto generated code - * Move stream functions to MessageLite from Message. - * Move all zero_copy_stream functionality to io_lite. - * Do not create array of matched fields for simple repeated fields - * Enabling silent mode by default to reduce make compilation noise. (#6237) - - Java - * Expose TextFormat.Printer and make it configurable. Deprecate the static methods. - * Library for constructing google.protobuf.Struct and google.protobuf.Value - * Make OneofDescriptor extend GenericDescriptor. - * Expose streamingness of service methods from MethodDescriptor. - * Fix a bug where TextFormat fails to parse Any filed with > 1 embedded message sub-fields. - * Establish consistent JsonFormat behavior for nulls in oneofs, regardless of order. - * Update GSON version to 3.8.5. (#6268) - * Add `protobuf_java_lite` Bazel target. (#6177) - - Python - * Change implementation of Name() for enums that allow aliases in proto2 in Python - to be in line with claims in C++ implementation (to return first value). - * Explicitly say what field cannot be set when the new value fails a type check. - * Duplicate register in descriptor pool will raise errors - * Add __slots__ to all well_known_types classes, custom attributes are not allowed anymore. - * text_format only present 8 valid digits for float fields by default - - JavaScript - * Add Oneof enum to the list of goog.provide - - PHP - * Make php message class final to avoid mocking. (#6277) - * Rename get/setXXXValue to get/setXXXWrapper. (#6295) - - Ruby - * Remove to_hash methods. (#6166) - - -2019-04-29 version 3.8.0 (C++/Java/Python/PHP/Objective-C/C#/Ruby/JavaScript) - - C++ - * Use std::atomic in case of myriad2 platform - * Always declare enums to be int-sized - * Added DebugString() and ShortDebugString() methods on MessageLite - * Specialized different parse loop control flows - * Make hasbits potentially in register. The or's start forming an obstacle because it's a read modify store on the same mem address on each iteration. - * Move to an internal MACRO for parser validity checks. - * Improve map parsing performance. - * Make MergePartialFromCodedStream non virtual. This allows direct calls, potential inlining and is also a code health improvement - * Add an overall limit to parse_context to prevent reading past it. This allows to remove a annoying level of indirection. - * Fix a mistake, we shouldn't verify map key/value strings for utf8 in opt mode for proto2. - * Further improvements to cut binary size. - * Prepare to make MergePartialFromCodedStream non-virtual. - * A report on some interesting behavior change in python (caused by b/27494216) made me realize there is a check that needs to be done in case the parse ended on a end group tag. - * Add a note of caution to the comments around skip in CodedOutputStream. - * Simplify end check. - * Add overload for ParseMessage for MessageLite/Message types. If the explicit type is not known inlining won't help de-virtualizing the virtual call. - * Reduce linker input. It turns out that ParseMessage is not inlined, producing template instantiations that are used only once and save nothing but cost more. - * Improve the parser. - * [c++17] Changed proto2::RepeatedPtrField iterators to no longer derive from the deprecated std::iterator class. - * Change the default value of case_insensitive_enum_parsing to false for JsonStringToMessage. - * Add a warning if a field name doesn't match the style guide. - * Fix TextFormat not round-trip correctly when float value is max float. - * Added locationed info for some errors at compiler - * Python reserved keywords are now working with getattr()/setattr() for most descriptors. - * Added AllowUnknownField() in text_format - * Append '_' to C++ reserved keywords for message, enum, extension - * Fix MSVC warning C4244 in protobuf's parse_context.h. - * Updating Iterators to be compatible with C++17 in MSVC. - * Use capability annotation in mutex.h - * Fix "UndefinedBehaviorSanitizer: cfi-bad-type" - * CriticalSectionLock class as a lightweight replacement for std::mutex on Windows platforms. - * Removed vestigial wire_format_lite_inl.h - - C# - * Added System.Memory dependency. - - Java - * Make Java protoc code generator ignore optimize_for LITE_RUNTIME. Users should instead use the Java lite protoc plugin. - * Change Extension getMessageDefaultInstance() to return Message instead of MessageLite. - * Prevent malicious input streams from leaking buffers for ByteString or ByteBuffer parsing. - * Release new Javalite runtime. - * Show warning in case potential file name conflict. - * Allow Java reserved keywords to be used in extensions. - * Added setAllowUnknownFields() in text format - * Add memoization to ExtensionRegistryLite.getEmptyRegistry() - * Improve performance of CodedOutputStream.writeUInt32NoTag - * Add an optimized mismatch-finding algorithm to UnsafeUtil. - * When serializing uint32 varints, check that we have MAX_VARINT32_SIZE bytes left, not just MAX_VARINT_SIZE. - * Minor optimization to RopeByteString.PieceIterator - - JavaScript - * Simplify generated toObject code when the default value is used. - - Python - * Changes implementation of Name() for enums that allow aliases in proto2 in Python to be in line with claims in C++ implementation (to return first value). - * Added double_format option in text format printer. - * Added iter and __contains__ to extension dict - * Added allow_unknown_field option in python text format parser - * Fixed Timestamp.ToDatetime() loses precision issue - * Support unknown field in text format printer. - * Float field will be convert to inf if bigger than struct.unpack('f', b'\xff\xff\x7f\x7f')[0] which is about 3.4028234664e+38, - convert to -inf if smaller than -3.4028234664e+38 - * Allowed casting str->bytes in Message.__setstate__ - - Ruby - * Helper methods to get enum name for Ruby. - - -2019-01-24 version 3.7.0 (C++/Java/Python/PHP/Objective-C/C#/Ruby/JavaScript) - - C++ - * Introduced new MOMI (maybe-outside-memory-interval) parser. - * Add an option to json_util to parse enum as case-insensitive. In the future, enum parsing in json_util will become case-sensitive. - * Added conformance test for enum aliases - * Added support for --cpp_out=speed:... - * Added use of C++ override keyword where appropriate - * Many other cleanups and fixes. - - Java - * Fix illegal reflective access warning in JDK 9+ - * Add BOM - - Python - * Added Python 3.7 compatibility. - * Modified ParseFromString to return bytes parsed . - * Introduce Proto C API. - * FindFileContainingSymbol in descriptor pool is now able to find field and enum values. - * reflection.MakeClass() and reflection.ParseMessage() are deprecated. - * Added DescriptorPool.FindMethodByName() method in pure python (c extension already has it) - * Flipped proto3 to preserve unknown fields by default. - * Added support for memoryview in python3 proto message parsing. - * Added MergeFrom for repeated scalar fields in c extension (pure python already has it) - * Surrogates are now rejected at setters in python3. - * Added public unknown field API. - * RecursionLimit is also set to max if allow_oversize_protos is enabled. - * Disallow duplicate scalars in proto3 text_format parse. - * Fix some segment faults for c extension map field. - - PHP - * Most issues for json encoding/decoding in the c extension have been fixed. There are still some edge cases not fixed. For more details, check conformance/failure_list_php_c.txt. - * Supports php 7.3 - * Added helper methods to convert between enum values and names. - * Allow setting/getting wrapper message fields using primitive values. - * Various bug fixes. - - Ruby - * Ruby 2.6 support. - * Drops support for ruby < 2.3. - * Most issues for json encoding/decoding in the c extension have been fixed. There are still some edge cases not fixed. For more details, check conformance/failure_list_ruby.txt. - * Json parsing can specify an option to ignore unknown fields: msg.decode_json(data, {ignore_unknown_fields: true}). - * Added support for proto2 syntax (partially). - * Various bug fixes. - - Csharp - * More support for FieldMask include merge, intersect and more. - * Increasing the default recursion limit to 100. - * Support loading FileDescriptors dynamically. - * Provide access to comments from descriptors. - * Added Any.Is method. - * Compatible with C# 6 - * Added IComparable and comparison operators on Timestamp. - - Objective C - * Add ability to introspect list of enum values (#4678) - * Copy the value when setting message/data fields (#5215) - * Support suppressing the objc package prefix checks on a list of files (#5309) - * More complete keyword and NSObject method (via categories) checks for field names, can result in more fields being rename, but avoids the collisions at runtime (#5289) - * Small fixes to TextFormat generation for extensions (#5362) - * Provide more details/context in deprecation messages (#5412) - * Array/Dictionary enumeration blocks NS_NOESCAPE annotation for Swift (#5421) - * Properly annotate extensions for ARC when their names imply behaviors (#5427) - * Enum alias name collision improvements (#5480) - - -2018-07-27 version 3.6.1 (C++/Java/Python/PHP/Objective-C/C#/Ruby/JavaScript) - - C++ - * Introduced workaround for Windows issue with std::atomic and std::once_flag - initialization (#4777, #4773). - - PHP - * Added compatibility with PHP 7.3 (#4898). - - Ruby - * Fixed Ruby crash involving Any encoding (#4718). - -2018-06-01 version 3.6.0 (C++/Java/Python/PHP/Objective-C/C#/Ruby/JavaScript) - - C++ - * Starting from this release, we now require C++11. For those we cannot yet - upgrade to C++11, we will try to keep the 3.5.x branch updated with - critical bug fixes only. If you have any concerns about this, please - comment on issue #2780. - * Moved to C++11 types like std::atomic and std::unique_ptr and away from our - old custom-built equivalents. - * Added support for repeated message fields in lite protos using implicit - weak fields. This is an experimental feature that allows the linker to - strip out more unused messages than previously was possible. - * Fixed SourceCodeInfo for interpreted options and extension range options. - * Fixed always_print_enums_as_ints option for JSON serialization. - * Added support for ignoring unknown enum values when parsing JSON. - * Create std::string in Arena memory. - * Fixed ValidateDateTime to correctly check the day. - * Fixed bug in ZeroCopyStreamByteSink. - * Various other cleanups and fixes. - - Java - * Dropped support for Java 6. - * Added a UTF-8 decoder that uses Unsafe to directly decode a byte buffer. - * Added deprecation annotations to generated code for deprecated oneof - fields. - * Fixed map field serialization in DynamicMessage. - * Cleanup and documentation for Java Lite runtime. - * Various other fixes and cleanups - * Fixed unboxed arraylists to handle an edge case - * Improved performance for copying between unboxed arraylists - * Fixed lite protobuf to avoid Java compiler warnings - * Improved test coverage for lite runtime - * Performance improvements for lite runtime - - Python - * Fixed bytes/string map key incompatibility between C++ and pure-Python - implementations (issue #4029) - * Added __init__.py files to compiler and util subpackages - * Use /MT for all Windows versions - * Fixed an issue affecting the Python-C++ implementation when used with - Cython (issue #2896) - * Various text format fixes - * Various fixes to resolve behavior differences between the pure-Python and - Python-C++ implementations - - PHP - * Added php_metadata_namespace to control the file path of generated metadata - file. - * Changed generated classes of nested message/enum. E.g., Foo.Bar, which - previously generates Foo_Bar, now generates Foo/Bar - * Added array constructor. When creating a message, users can pass a php - array whose content is field name to value pairs into constructor. The - created message will be initialized according to the array. Note that - message field should use a message value instead of a sub-array. - * Various bug fixes. - - Objective-C - * We removed some helper class methods from GPBDictionary to shrink the size - of the library, the functionary is still there, but you may need to do some - specific +alloc / -init… methods instead. - * Minor improvements in the performance of object field getters/setters by - avoiding some memory management overhead. - * Fix a memory leak during the raising of some errors. - * Make header importing completely order independent. - * Small code improvements for things the undefined behaviors compiler option - was flagging. - - Ruby - * Added ruby_package file option to control the module of generated class. - * Various bug fixes. - - Javascript - * Allow setting string to int64 field. - - Csharp - * Unknown fields are now parsed and then sent back on the wire. They can be - discarded at parse time via a CodedInputStream option. - * Movement towards working with .NET 3.5 and Unity - * Expression trees are no longer used - * AOT generics issues in Unity/il2cpp have a workaround (see this commit for - details) - * Floating point values are now compared bitwise (affects NaN value - comparisons) - * The default size limit when parsing is now 2GB rather than 64MB - * MessageParser now supports parsing from a slice of a byte array - * JSON list parsing now accepts null values where the underlying proto - representation does - -2017-12-20 version 3.5.1 (C++/Java/Python/PHP/Objective-C/C#/Ruby/JavaScript) - Planned Future Changes - * Make C++ implementation C++11 only: we plan to require C++11 to build - protobuf code starting from 3.6.0 release. Please join this github issue: - https://github.com/protocolbuffers/protobuf/issues/2780 to provide your feedback. - - protoc - * Fixed a bug introduced in 3.5.0 and protoc in Windows now accepts non-ascii - characters in paths again. - - C++ - * Removed several usages of C++11 features in the code base. - * Fixed some compiler warnings. - - PHP - * Fixed memory leak in C-extension implementation. - * Added discardUnknokwnFields API. - * Removed duplicated typedef in C-extension headers. - * Avoided calling private php methods (timelib_update_ts). - * Fixed Any.php to use fully-qualified name for DescriptorPool. - - Ruby - * Added Google_Protobuf_discard_unknown for discarding unknown fields in - messages. - - C# - * Unknown fields are now preserved by default. - * Floating point values are now bitwise compared, affecting message equality - check and Contains() API in map and repeated fields. - - -2017-11-13 version 3.5.0 (C++/Java/Python/PHP/Objective-C/C#/Ruby/JavaScript) - Planned Future Changes - * Make C++ implementation C++11 only: we plan to require C++11 to build - protobuf code starting from 3.6.0 release. Please join this github issue: - https://github.com/protocolbuffers/protobuf/issues/2780 to provide your feedback. - - General - * Unknown fields are now preserved in proto3 for most of the language - implementations for proto3 by default. See the per-language section for - details. - * reserve keyword are now supported in enums - - C++ - * Proto3 messages are now preserving unknown fields by default. If you rely on - unknowns fields being dropped. Please use DiscardUnknownFields() explicitly. - * Deprecated the unsafe_arena_release_* and unsafe_arena_add_allocated_* - methods for string fields. - * Added move constructor and move assignment to RepeatedField, - RepeatedPtrField and google::protobuf::Any. - * Added perfect forwarding in Arena::CreateMessage - * In-progress experimental support for implicit weak fields with lite protos. - This feature allows the linker to strip out more unused messages and reduce - binary size. - * Various performance optimizations. - - Java - * Proto3 messages are now preserving unknown fields by default. If you’d like - to drop unknown fields, please use the DiscardUnknownFieldsParser API. For - example: - Parser parser = DiscardUnknownFieldsParser.wrap(Foo.parser()); - Foo foo = parser.parseFrom(input); - * Added a new CodedInputStream decoder for Iterable with direct - ByteBuffers. - * TextFormat now prints unknown length-delimited fields as messages if - possible. - * FieldMaskUtil.merge() no longer creates unnecessary empty messages when a - message field is unset in both source message and destination message. - * Various performance optimizations. - - Python - * Proto3 messages are now preserving unknown fields by default. Use - message.DiscardUnknownFields() to drop unknown fields. - * Add FieldDescriptor.file in generated code. - * Add descriptor pool FindOneofByName in pure python. - * Change unknown enum values into unknown field set . - * Add more Python dict/list compatibility for Struct/ListValue. - * Add utf-8 support for text_format.Merge()/Parse(). - * Support numeric unknown enum values for proto3 JSON format. - * Add warning for Unexpected end-group tag in cpp extension. - - PHP - * Proto3 messages are now preserving unknown fields. - * Provide well known type messages in runtime. - * Add prefix ‘PB’ to generated class of reserved names. - * Fixed all conformance tests for encode/decode json in php runtime. C - extension needs more work. - - Objective-C - * Fixed some issues around copying of messages with unknown fields and then - mutating the unknown fields in the copy. - - C# - * Added unknown field support in JsonParser. - * Fixed oneof message field merge. - * Simplify parsing messages from array slices. - - Ruby - * Unknown fields are now preserved by default. - * Fixed several bugs for segment fault. - - Javascript - * Decoder can handle both paced and unpacked data no matter how the proto is - defined. - * Decoder now accept long varint for 32 bit integers. - - -2017-08-14 version 3.4.0 (C++/Java/Python/PHP/Objective-C/C#/Ruby/JavaScript) - Planned Future Changes - * There are some changes that are not included in this release but are planned - for the near future - - Preserve unknown fields in proto3: We are going to bring unknown fields - back into proto3. In this release, some languages start to support - preserving unknown fields in proto3, controlled by flags/options. Some - languages also introduce explicit APIs to drop unknown fields for - migration. Please read the change log sections by languages for details. - For general timeline and plan: - - https://docs.google.com/document/d/1KMRX-G91Aa-Y2FkEaHeeviLRRNblgIahbsk4wA14gRk/view - - For issues and discussions: - - https://github.com/protocolbuffers/protobuf/issues/272 - - - Make C++ implementation C++11 only: we plan to require C++11 to build - protobuf code starting from 3.5.0 or 3.6.0 release, after unknown fields - semantic changes are finished. Please join this - github issue: - - https://github.com/protocolbuffers/protobuf/issues/2780 - - to provide your feedback. - - General - * Extension ranges now accept options and are customizable. - * "reserve" keyword now supports “max” in field number ranges, - e.g. reserve 1000 to max; - - C++ - * Proto3 messages are now able to preserve unknown fields. The default - behavior is still to drop unknowns, which will be flipped in a future - release. If you rely on unknowns fields being dropped. Please use - Message::DiscardUnknownFields() explicitly. - * Packable proto3 fields are now packed by default in serialization. - * Following C++11 features are introduced when C++11 is available: - - move-constructor and move-assignment are introduced to messages - - Repeated fields constructor now takes std::initializer_list - - rvalue setters are introduced for string fields - * Experimental Table-Driven parsing and serialization available to test. To - enable it, pass in table_driven_parsing table_driven_serialization protoc - generator flags for C++ - - $ protoc --cpp_out=table_driven_parsing,table_driven_serialization:./ \ - test.proto - - * lite generator parameter supported by the generator. Once set, all generated - files, use lite runtime regardless of the optimizer_for setting in the - .proto file. - * Various optimizations to make C++ code more performant on PowerPC platform - * Fixed maps data corruption when the maps are modified by both reflection API - and generated API. - * Deterministic serialization on maps reflection now uses stable sort. - * file() accessors are introduced to various *Descriptor classes to make - writing template function easier. - * ByteSize() and SpaceUsed() are deprecated.Use ByteSizeLong() and - SpaceUsedLong() instead - * Consistent hash function is used for maps in DEBUG and NDEBUG build. - * "using namespace std" is removed from stubs/common.h - * Various performance optimizations and bug fixes - - Java - * Introduced new parser API DiscardUnknownFieldsParser in preparation of - proto3 unknown fields preservation change. Users who want to drop unknown - fields should migrate to use this new parser API. For example: - - Parser parser = DiscardUnknownFieldsParser.wrap(Foo.parser()); - Foo foo = parser.parseFrom(input); - - * Introduced new TextFormat API printUnicodeFieldValue() that prints field - value without escaping unicode characters. - * Added Durations.compare(Duration, Duration) and - Timestamps.compare(Timestamp, Timestamp). - * JsonFormat now accepts base64url encoded bytes fields. - * Optimized CodedInputStream to do less copies when parsing large bytes - fields. - * Optimized TextFormat to allocate less memory when printing. - - Python - * SerializeToString API is changed to SerializeToString(self, **kwargs), - deterministic parameter is accepted for deterministic serialization. - * Added sort_keys parameter in json format to make the output deterministic. - * Added indent parameter in json format. - * Added extension support in json format. - * Added __repr__ support for repeated field in cpp implementation. - * Added file in FieldDescriptor. - * Added pretty-print filter to text format. - * Services and method descriptors are always printed even if generic_service - option is turned off. - * Note: AppEngine 2.5 is deprecated on June 2017 that AppEngine 2.5 will - never update protobuf runtime. Users who depend on AppEngine 2.5 should use - old protoc. - - PHP - * Support PHP generic services. Specify file option php_generic_service=true - to enable generating service interface. - * Message, repeated and map fields setters take value instead of reference. - * Added map iterator in c extension. - * Support json  encode/decode. - * Added more type info in getter/setter phpdoc - * Fixed the problem that c extension and php implementation cannot be used - together. - * Added file option php_namespace to use custom php namespace instead of - package. - * Added fluent setter. - * Added descriptor API in runtime for custom encode/decode. - * Various bug fixes. - - Objective-C - * Fix for GPBExtensionRegistry copying and add tests. - * Optimize GPBDictionary.m codegen to reduce size of overall library by 46K - per architecture. - * Fix some cases of reading of 64bit map values. - * Properly error on a tag with field number zero. - * Preserve unknown fields in proto3 syntax files. - * Document the exceptions on some of the writing apis. - - C# - * Implemented IReadOnlyDictionary in MapField - * Added TryUnpack method for Any message in addition to Unpack. - * Converted C# projects to MSBuild (csproj) format. - - Ruby - * Several bug fixes. - - Javascript - * Added support of field option js_type. Now one can specify the JS type of a - 64-bit integer field to be string in the generated code by adding option - [jstype = JS_STRING] on the field. - -2017-04-05 version 3.3.0 (C++/Java/Python/PHP/Objective-C/C#/Ruby/JavaScript) - Planned Future Changes - * There are some changes that are not included in this release but are - planned for the near future: - - Preserve unknown fields in proto3: please read this doc: - - https://docs.google.com/document/d/1KMRX-G91Aa-Y2FkEaHeeviLRRNblgIahbsk4wA14gRk/view - - for the timeline and follow up this github issue: - - https://github.com/protocolbuffers/protobuf/issues/272 - - for discussion. - - Make C++ implementation C++11 only: we plan to require C++11 to build - protobuf code starting from 3.4.0 or 3.5.0 release. Please join this - github issue: - - https://github.com/protocolbuffers/protobuf/issues/2780 - - to provide your feedback. - - C++ - * Fixed map fields serialization of DynamicMessage to correctly serialize - both key and value regardless of their presence. - * Parser now rejects field number 0 correctly. - * New API Message::SpaceUsedLong() that’s equivalent to - Message::SpaceUsed() but returns the value in size_t. - * JSON support - - New flag always_print_enums_as_ints in JsonPrintOptions. - - New flag preserve_proto_field_names in JsonPrintOptions. It will instruct - the JSON printer to use the original field name declared in the .proto - file instead of converting them to lowerCamelCase when printing JSON. - - JsonPrintOptions.always_print_primtive_fields now works for oneof message - fields. - - Fixed a bug that doesn’t allow different fields to set the same json_name - value. - - Fixed a performance bug that causes excessive memory copy when printing - large messages. - * Various performance optimizations. - - Java - * Map field setters eagerly validate inputs and throw NullPointerExceptions - as appropriate. - * Added ByteBuffer overloads to the generated parsing methods and the Parser - interface. - * proto3 enum's getNumber() method now throws on UNRECOGNIZED values. - * Output of JsonFormat is now locale independent. - - Python - * Added FindServiceByName() in the pure-Python DescriptorPool. This works only - for descriptors added with DescriptorPool.Add(). Generated descriptor_pool - does not support this yet. - * Added a descriptor_pool parameter for parsing Any in text_format.Parse(). - * descriptor_pool.FindFileContainingSymbol() now is able to find nested - extensions. - * Extending empty [] to repeated field now sets parent message presence. - - PHP - * Added file option php_class_prefix. The prefix will be prepended to all - generated classes defined in the file. - * When encoding, negative int32 values are sign-extended to int64. - * Repeated/Map field setter accepts a regular PHP array. Type checking is - done on the array elements. - * encode/decode are renamed to serializeToString/mergeFromString. - * Added mergeFrom, clear method on Message. - * Fixed a bug that oneof accessor didn’t return the field name that is - actually set. - * C extension now works with php7. - * This is the first GA release of PHP. We guarantee that old generated code - can always work with new runtime and new generated code. - - Objective-C - * Fixed help for GPBTimestamp for dates before the epoch that contain - fractional seconds. - * Added GPBMessageDropUnknownFieldsRecursively() to remove unknowns from a - message and any sub messages. - * Addressed a threading race in extension registration/lookup. - * Increased the max message parsing depth to 100 to match the other languages. - * Removed some use of dispatch_once in favor of atomic compare/set since it - needs to be heap based. - * Fixes for new Xcode 8.3 warnings. - - C# - * Fixed MapField.Values.CopyTo, which would throw an exception unnecessarily - if provided exactly the right size of array to copy to. - * Fixed enum JSON formatting when multiple names mapped to the same numeric - value. - * Added JSON formatting option to format enums as integers. - * Modified RepeatedField to implement IReadOnlyList. - * Introduced the start of custom option handling; it's not as pleasant as it - might be, but the information is at least present. We expect to extend code - generation to improve this in the future. - * Introduced ByteString.FromStream and ByteString.FromStreamAsync to - efficiently create a ByteString from a stream. - * Added whole-message deprecation, which decorates the class with [Obsolete]. - - Ruby - * Fixed Message#to_h for messages with map fields. - * Fixed memcpy() in binary gems to work for old glibc, without breaking the - build for non-glibc libc’s like musl. - - Javascript - * Added compatibility tests for version 3.0.0. - * Added conformance tests. - * Fixed serialization of extensions: we need to emit a value even if it is - falsy (like the number 0). - * Use closurebuilder.py in favor of calcdeps.py for compiling JavaScript. - -2017-01-23 version 3.2.0 (C++/Java/Python/PHP/Ruby/Objective-C/C#/JavaScript/Lite) - General - * Added protoc version number to protoc plugin protocol. It can be used by - protoc plugin to detect which version of protoc is used with the plugin and - mitigate known problems in certain version of protoc. - - C++ - * The default parsing byte size limit has been raised from 64MB to 2GB. - * Added rvalue setters for non-arena string fields. - * Enabled debug logging for Android. - * Fixed a double-free problem when using Reflection::SetAllocatedMessage() - with extension fields. - * Fixed several deterministic serialization bugs: - * MessageLite::SerializeAsString() now respects the global deterministic - serialization flag. - * Extension fields are serialized deterministically as well. Fixed protocol - compiler to correctly report importing-self as an error. - * Fixed FileDescriptor::DebugString() to print custom options correctly. - * Various performance/codesize optimizations and cleanups. - - Java - * The default parsing byte size limit has been raised from 64MB to 2GB. - * Added recursion limit when parsing JSON. - * Fixed a bug that enumType.getDescriptor().getOptions() doesn't have custom - options. - * Fixed generated code to support field numbers up to 2^29-1. - - Python - * You can now assign NumPy scalars/arrays (np.int32, np.int64) to protobuf - fields, and assigning other numeric types has been optimized for - performance. - * Pure-Python: message types are now garbage-collectable. - * Python/C++: a lot of internal cleanup/refactoring. - - PHP (Alpha) - * For 64-bit integers type (int64/uint64/sfixed64/fixed64/sint64), use PHP - integer on 64-bit environment and PHP string on 32-bit environment. - * PHP generated code also conforms to PSR-4 now. - * Fixed ZTS build for c extension. - * Fixed c extension build on Mac. - * Fixed c extension build on 32-bit linux. - * Fixed the bug that message without namespace is not found in the descriptor - pool. (#2240) - * Fixed the bug that repeated field is not iterable in c extension. - * Message names Empty will be converted to GPBEmpty in generated code. - * Added phpdoc in generated files. - * The released API is almost stable. Unless there is large problem, we won't - change it. See - https://developers.google.com/protocol-buffers/docs/reference/php-generated - for more details. - - Objective-C - * Added support for push/pop of the stream limit on CodedInputStream for - anyone doing manual parsing. - - C# - * No changes. - - Ruby - * Message objects now support #respond_to? for field getters/setters. - * You can now compare “message == non_message_object” and it will return false - instead of throwing an exception. - * JRuby: fixed #hashCode to properly reflect the values in the message. - - Javascript - * Deserialization of repeated fields no longer has quadratic performance - behavior. - * UTF-8 encoding/decoding now properly supports high codepoints. - * Added convenience methods for some well-known types: Any, Struct, and - Timestamp. These make it easier to convert data between native JavaScript - types and the well-known protobuf types. - -2016-09-23 version 3.1.0 (C++/Java/Python/PHP/Ruby/Objective-C/C#/JavaScript/Lite) - General - * Proto3 support in PHP (alpha). - * Various bug fixes. - - C++ - * Added MessageLite::ByteSizeLong() that’s equivalent to - MessageLite::ByteSize() but returns the value in size_t. Useful to check - whether a message is over the 2G size limit that protobuf can support. - * Moved default_instances to global variables. This allows default_instance - addresses to be known at compile time. - * Adding missing generic gcc 64-bit atomicops. - * Restore New*Callback into google::protobuf namespace since these are used - by the service stubs code - * JSON support. - * Fixed some conformance issues. - * Fixed a JSON serialization bug for bytes fields. - - Java - * Fixed a bug in TextFormat that doesn’t accept empty repeated fields (i.e., - “field: [ ]”). - * JSON support - * Fixed JsonFormat to do correct snake_case-to-camelCase conversion for - non-style-conforming field names. - * Fixed JsonFormat to parse empty Any message correctly. - * Added an option to JsonFormat.Parser to ignore unknown fields. - * Experimental API - * Added UnsafeByteOperations.unsafeWrap(byte[]) to wrap a byte array into - ByteString without copy. - - Python - * JSON support - * Fixed some conformance issues. - - PHP (Alpha) - * We have added the proto3 support for PHP via both a pure PHP package and a - native c extension. The pure PHP package is intended to provide usability - to wider range of PHP platforms, while the c extension is intended to - provide higher performance. Both implementations provide the same runtime - APIs and share the same generated code. Users don’t need to re-generate - code for the same proto definition when they want to switch the - implementation later. The pure PHP package is included in the php/src - directory, and the c extension is included in the php/ext directory. - - Both implementations provide idiomatic PHP APIs: - * All messages and enums are defined as PHP classes. - * All message fields can only be accessed via getter/setter. - * Both repeated field elements and map elements are stored in containers - that act like a normal PHP array. - - Unlike several existing third-party PHP implementations for protobuf, our - implementations are built on a "strongly-typed" philosophy: message fields - and array/map containers will throw exceptions eagerly when values of the - incorrect type (not including those that can be type converted, e.g., - double <-> integer <-> numeric string) are inserted. - - Currently, pure PHP runtime supports php5.5, 5.6 and 7 on linux. C - extension runtime supports php5.5 and 5.6 on linux. - - See php/README.md for more details about installment. See - https://developers.google.com/protocol-buffers/docs/phptutorial for more - details about APIs. - - Objective-C - * Helpers are now provided for working the Any well known type (see - GPBWellKnownTypes.h for the api additions). - * Some improvements in startup code (especially when extensions aren’t used). - - Javascript - * Fixed missing import of jspb.Map - * Fixed valueWriterFn variable name - - Ruby - * Fixed hash computation for JRuby's RubyMessage - * Make sure map parsing frames are GC-rooted. - * Added API support for well-known types. - - C# - * Removed check on dependency in the C# reflection API. - -2016-09-06 version 3.0.2 (C++/Java/Python/Ruby/Objective-C/C#/JavaScript/Lite) - General - * Various bug fixes. - - Objective C - * Fix for oneofs in proto3 syntax files where fields were set to the zero - value. - * Fix for embedded null character in strings. - * CocoaDocs support - - Ruby - * Fixed memory corruption bug in parsing that could occur under GC pressure. - - Javascript - * jspb.Map is now properly exported to CommonJS modules. - - C# - * Removed legacy_enum_values flag. - - -2016-07-27 version 3.0.0 (C++/Java/Python/Ruby/Objective-C/C#/JavaScript/Lite) - General - * This log only contains changes since the beta-4 release. Summarized change - log since the last stable release (v2.6.1) can be found in the github - release page. - - Compatibility Notice - * v3.0.0 is the first API stable release of the v3.x series. We do not expect - any future API breaking changes. - * For C++, Java Lite and Objective-C, source level compatibility is - guaranteed. Upgrading from v3.0.0 to newer minor version releases will be - source compatible. For example, if your code compiles against protobuf - v3.0.0, it will continue to compile after you upgrade protobuf library to - v3.1.0. - * For other languages, both source level compatibility and binary level - compatibility are guaranteed. For example, if you have a Java binary built - against protobuf v3.0.0. After switching the protobuf runtime binary to - v3.1.0, your built binary should continue to work. - * Compatibility is only guaranteed for documented API and documented - behaviors. If you are using undocumented API (e.g., use anything in the C++ - internal namespace), it can be broken by minor version releases in an - undetermined manner. - - Ruby - * When you assign a string field `a.string_field = "X"`, we now call - #encode(UTF-8) on the string and freeze the copy. This saves you from - needing to ensure the string is already encoded as UTF-8. It also prevents - you from mutating the string after it has been assigned (this is how we - ensure it stays valid UTF-8). - * The generated file for `foo.proto` is now `foo_pb.rb` instead of just - `foo.rb`. This makes it easier to see which imports/requires are from - protobuf generated code, and also prevents conflicts with any `foo.rb` file - you might have written directly in Ruby. It is a backward-incompatible - change: you will need to update all of your `require` statements. - * For package names like `foo_bar`, we now translate this to the Ruby module - `FooBar`. This is more idiomatic Ruby than what we used to do (`Foo_bar`). - - JavaScript - * Scalar fields like numbers and boolean now return defaults instead of - `undefined` or `null` when they are unset. You can test for presence - explicitly by calling `hasFoo()`, which we now generate for scalar fields. - - Java Lite - * Java Lite is now implemented as a separate plugin, maintained in the - `javalite` branch. Both lite runtime and protoc artifacts will be available - in Maven. - - C# - * Target platforms now .NET 4.5, selected portable subsets and .NET Core. - * legacy_enum_values option is no longer supported. - -2016-07-15 version 3.0.0-beta-4 (C++/Java/Python/Ruby/Objective-C/C#/JavaScript) - General - * Added a deterministic serialization API for C++. The deterministic - serialization guarantees that given a binary, equal messages will be - serialized to the same bytes. This allows applications like MapReduce to - group equal messages based on the serialized bytes. The deterministic - serialization is, however, NOT canonical across languages; it is also - unstable across different builds with schema changes due to unknown fields. - Users who need canonical serialization, e.g. persistent storage in a - canonical form, fingerprinting, etc, should define their own - canonicalization specification and implement the serializer using reflection - APIs rather than relying on this API. - * Added OneofOptions. You can now define custom options for oneof groups. - import "google/protobuf/descriptor.proto"; - extend google.protobuf.OneofOptions { - optional int32 my_oneof_extension = 12345; - } - message Foo { - oneof oneof_group { - (my_oneof_extension) = 54321; - ... - } - } - - C++ (beta) - * Introduced a deterministic serialization API in - CodedOutputStream::SetSerializationDeterministic(bool). See the notes about - deterministic serialization in the General section. - * Added google::protobuf::Map::swap() to swap two map fields. - * Fixed a memory leak when calling Reflection::ReleaseMessage() on a message - allocated on arena. - * Improved error reporting when parsing text format protos. - * JSON - - Added a new parser option to ignore unknown fields when parsing JSON. - - Added convenient methods for message to/from JSON conversion. - * Various performance optimizations. - - Java (beta) - * File option "java_generate_equals_and_hash" is now deprecated. equals() and - hashCode() methods are generated by default. - * Added a new JSON printer option "omittingInsignificantWhitespace" to produce - a more compact JSON output. The printer will pretty-print by default. - * Updated Java runtime to be compatible with 2.5.0/2.6.1 generated protos. - - Python (beta) - * Added support to pretty print Any messages in text format. - * Added a flag to ignore unknown fields when parsing JSON. - * Bugfix: "@type" field of a JSON Any message is now correctly put before - other fields. - - Objective-C (beta) - * Updated the code to support compiling with more compiler warnings - enabled. (Issue 1616) - * Exposing more detailed errors for parsing failures. (PR 1623) - * Small (breaking) change to the naming of some methods on the support classes - for map<>. There were collisions with the system provided KVO support, so - the names were changed to avoid those issues. (PR 1699) - * Fixed for proper Swift bridging of error handling during parsing. (PR 1712) - * Complete support for generating sources that will go into a Framework and - depend on generated sources from other Frameworks. (Issue 1457) - - C# (beta) - * RepeatedField optimizations. - * Support for .NET Core. - * Minor bug fixes. - * Ability to format a single value in JsonFormatter (advanced usage only). - * Modifications to attributes applied to generated code. - - Javascript (alpha) - * Maps now have a real map API instead of being treated as repeated fields. - * Well-known types are now provided in the google-protobuf package, and the - code generator knows to require() them from that package. - * Bugfix: non-canonical varints are correctly decoded. - - Ruby (alpha) - * Accessors for oneof fields now return default values instead of nil. - - Java Lite - * Java lite support is removed from protocol compiler. It will be supported - as a protocol compiler plugin in a separate code branch. - -2016-05-16 version 3.0.0-beta-3 (C++/Java/Python/Ruby/Nano/Objective-C/C#/JavaScript) - General - * Supported Proto3 lite-runtime in C++/Java for mobile platforms. - * Any type now supports APIs to specify prefixes other than - type.googleapis.com - * Removed javanano_use_deprecated_package option; Nano will always has its own - ".nano" package. - - C++ (Beta) - * Improved hash maps. - - Improved hash maps comments. In particular, please note that equal hash - maps will not necessarily have the same iteration order and - serialization. - - Added a new hash maps implementation that will become the default in a - later release. - * Arenas - - Several inlined methods in Arena were moved to out-of-line to improve - build performance and code size. - - Added SpaceAllocatedAndUsed() to report both space used and allocated - - Added convenient class UnsafeArenaAllocatedRepeatedPtrFieldBackInserter - * Any - - Allow custom type URL prefixes in Any packing. - - TextFormat now expand the Any type rather than printing bytes. - * Performance optimizations and various bug fixes. - - Java (Beta) - * Introduced an ExperimentalApi annotation. Annotated APIs are experimental - and are subject to change in a backward incompatible way in future releases. - * Introduced zero-copy serialization as an ExperimentalApi - - Introduction of the `ByteOutput` interface. This is similar to - `OutputStream` but provides semantics for lazy writing (i.e. no - immediate copy required) of fields that are considered to be immutable. - - `ByteString` now supports writing to a `ByteOutput`, which will directly - expose the internals of the `ByteString` (i.e. `byte[]` or `ByteBuffer`) - to the `ByteOutput` without copying. - - `CodedOutputStream` now supports writing to a `ByteOutput`. `ByteString` - instances that are too large to fit in the internal buffer will be - (lazily) written to the `ByteOutput` directly. - - This allows applications using large `ByteString` fields to avoid - duplication of these fields entirely. Such an application can supply a - `ByteOutput` that chains together the chunks received from - `CodedOutputStream` before forwarding them onto the IO system. - * Other related changes to `CodedOutputStream` - - Additional use of `sun.misc.Unsafe` where possible to perform fast - access to `byte[]` and `ByteBuffer` values and avoiding unnecessary - range checking. - - `ByteBuffer`-backed `CodedOutputStream` now writes directly to the - `ByteBuffer` rather than to an intermediate array. - * Improved lite-runtime. - - Lite protos now implement deep equals/hashCode/toString - - Significantly improved the performance of Builder#mergeFrom() and - Builder#mergeDelimitedFrom() - * Various bug fixes and small feature enhancement. - - Fixed stack overflow when in hashCode() for infinite recursive oneofs. - - Fixed the lazy field parsing in lite to merge rather than overwrite. - - TextFormat now supports reporting line/column numbers on errors. - - Updated to add appropriate @Override for better compiler errors. - - Python (Beta) - * Added JSON format for Any, Struct, Value and ListValue - * [ ] is now accepted for both repeated scalar fields and repeated message - fields in text format parser. - * Numerical field name is now supported in text format. - * Added DiscardUnknownFields API for python protobuf message. - - Objective-C (Beta) - * Proto comments now come over as HeaderDoc comments in the generated sources - so Xcode can pick them up and display them. - * The library headers have been updated to use HeaderDoc comments so Xcode can - pick them up and display them. - * The per message and per field overhead in both generated code and runtime - object sizes was reduced. - * Generated code now include deprecated annotations when the proto file - included them. - - C# (Beta) - In general: some changes are breaking, which require regenerating messages. - Most user-written code will not be impacted *except* for the renaming of enum - values. - - * Allow custom type URL prefixes in `Any` packing, and ignore them when - unpacking - * `protoc` is now in a separate NuGet package (Google.Protobuf.Tools) - * New option: `internal_access` to generate internal classes - * Enum values are now PascalCased, and if there's a prefix which matches the - name of the enum, that is removed (so an enum `COLOR` with a value - `COLOR_BLUE` would generate a value of just `Blue`). An option - (`legacy_enum_values`) is temporarily available to disable this, but the - option will be removed for GA. - * `json_name` option is now honored - * If group tags are encountered when parsing, they are validated more - thoroughly (although we don't support actual groups) - * NuGet dependencies are better specified - * Breaking: `Preconditions` is renamed to `ProtoPreconditions` - * Breaking: `GeneratedCodeInfo` is renamed to `GeneratedClrTypeInfo` - * `JsonFormatter` now allows writing to a `TextWriter` - * New interface, `ICustomDiagnosticMessage` to allow more compact - representations from `ToString` - * `CodedInputStream` and `CodedOutputStream` now implement `IDisposable`, - which simply disposes of the streams they were constructed with - * Map fields no longer support null values (in line with other languages) - * Improvements in JSON formatting and parsing - - Javascript (Alpha) - * Better support for "bytes" fields: bytes fields can be read as either a - base64 string or UInt8Array (in environments where TypedArray is supported). - * New support for CommonJS imports. This should make it easier to use the - JavaScript support in Node.js and tools like WebPack. See js/README.md for - more information. - * Some significant internal refactoring to simplify and modularize the code. - - Ruby (Alpha) - * JSON serialization now properly uses camelCased names, with a runtime option - that will preserve original names from .proto files instead. - * Well-known types are now included in the distribution. - * Release now includes binary gems for Windows, Mac, and Linux instead of just - source gems. - * Bugfix for serializing oneofs. - - C++/Java Lite (Alpha) - A new "lite" generator parameter was introduced in the protoc for C++ and - Java for Proto3 syntax messages. Example usage: - - ./protoc --cpp_out=lite:$OUTPUT_PATH foo.proto - - The protoc will treat the current input and all the transitive dependencies - as LITE. The same generator parameter must be used to generate the - dependencies. - - In Proto3 syntax files, "optimized_for=LITE_RUNTIME" is no longer supported. - - -2015-12-30 version 3.0.0-beta-2 (C++/Java/Python/Ruby/Nano/Objective-C/C#/JavaScript) - General - * Introduced a new language implementation: JavaScript. - * Added a new field option "json_name". By default proto field names are - converted to "lowerCamelCase" in proto3 JSON format. This option can be - used to override this behavior and specify a different JSON name for the - field. - * Added conformance tests to ensure implementations are following proto3 JSON - specification. - - C++ (Beta) - * Various bug fixes and improvements to the JSON support utility: - - Duplicate map keys in JSON are now rejected (i.e., translation will - fail). - - Fixed wire-format for google.protobuf.Value/ListValue. - - Fixed precision loss when converting google.protobuf.Timestamp. - - Fixed a bug when parsing invalid UTF-8 code points. - - Fixed a memory leak. - - Reduced call stack usage. - - Java (Beta) - * Cleaned up some unused methods on CodedOutputStream. - * Presized lists for packed fields during parsing in the lite runtime to - reduce allocations and improve performance. - * Improved the performance of unknown fields in the lite runtime. - * Introduced UnsafeByteStrings to support zero-copy ByteString creation. - * Various bug fixes and improvements to the JSON support utility: - - Fixed a thread-safety bug. - - Added a new option “preservingProtoFieldNames” to JsonFormat. - - Added a new option “includingDefaultValueFields” to JsonFormat. - - Updated the JSON utility to comply with proto3 JSON specification. - - Python (Beta) - * Added proto3 JSON format utility. It includes support for all field types - and a few well-known types except for Any and Struct. - * Added runtime support for Any, Timestamp, Duration and FieldMask. - * [ ] is now accepted for repeated scalar fields in text format parser. - * Map fields now have proper O(1) performance for lookup/insert/delete - when using the Python/C++ implementation. They were previously using O(n) - search-based algorithms because the C++ reflection interface didn't - support true map operations. - - Objective-C (Beta) - * Various bug-fixes and code tweaks to pass more strict compiler warnings. - * Now has conformance test coverage and is passing all tests. - - C# (Beta) - * Various bug-fixes. - * Code generation: Files generated in directories based on namespace. - * Code generation: Include comments from .proto files in XML doc - comments (naively) - * Code generation: Change organization/naming of "reflection class" (access - to file descriptor) - * Code generation and library: Add Parser property to MessageDescriptor, - and introduce a non-generic parser type. - * Library: Added TypeRegistry to support JSON parsing/formatting of Any. - * Library: Added Any.Pack/Unpack support. - * Library: Implemented JSON parsing. - - Javascript (Alpha) - * Added proto3 support for JavaScript. The runtime is written in pure - JavaScript and works in browsers and in Node.js. To generate JavaScript - code for your proto, invoke protoc with "--js_out". See js/README.md - for more build instructions. - -2015-08-26 version 3.0.0-beta-1 (C++/Java/Python/Ruby/Nano/Objective-C/C#) - About Beta - * This is the first beta release of protobuf v3.0.0. Not all languages - have reached beta stage. Languages not marked as beta are still in - alpha (i.e., be prepared for API breaking changes). - - General - * Proto3 JSON is supported in several languages (fully supported in C++ - and Java, partially supported in Ruby/C#). The JSON spec is defined in - the proto3 language guide: - - https://developers.google.com/protocol-buffers/docs/proto3#json - - We will publish a more detailed spec to define the exact behavior of - proto3-conformant JSON serializers and parsers. Until then, do not rely - on specific behaviors of the implementation if it’s not documented in - the above spec. More specifically, the behavior is not yet finalized for - the following: - - Parsing invalid JSON input (e.g., input with trailing commas). - - Non-camelCase names in JSON input. - - The same field appears multiple times in JSON input. - - JSON arrays contain “null” values. - - The message has unknown fields. - - * Proto3 now enforces strict UTF-8 checking. Parsing will fail if a string - field contains non UTF-8 data. - - C++ (Beta) - * Introduced new utility functions/classes in the google/protobuf/util - directory: - - MessageDifferencer: compare two proto messages and report their - differences. - - JsonUtil: support converting protobuf binary format to/from JSON. - - TimeUtil: utility functions to work with well-known types Timestamp - and Duration. - - FieldMaskUtil: utility functions to work with FieldMask. - - * Performance optimization of arena construction and destruction. - * Bug fixes for arena and maps support. - * Changed to use cmake for Windows Visual Studio builds. - * Added Bazel support. - - Java (Beta) - * Introduced a new util package that will be distributed as a separate - artifact in maven. It contains: - - JsonFormat: convert proto messages to/from JSON. - - TimeUtil: utility functions to work with Timestamp and Duration. - - FieldMaskUtil: utility functions to work with FieldMask. - - * The static PARSER in each generated message is deprecated, and it will - be removed in a future release. A static parser() getter is generated - for each message type instead. - * Performance optimizations for String fields serialization. - * Performance optimizations for Lite runtime on Android: - - Reduced allocations - - Reduced method overhead after ProGuarding - - Reduced code size after ProGuarding - - Python (Alpha) - * Removed legacy Python 2.5 support. - * Moved to a single Python 2.x/3.x-compatible codebase, instead of using 2to3. - * Fixed build/tests on Python 2.6, 2.7, 3.3, and 3.4. - - Pure-Python works on all four. - - Python/C++ implementation works on all but 3.4, due to changes in the - Python/C++ API in 3.4. - * Some preliminary work has been done to allow for multiple DescriptorPools - with Python/C++. - - Ruby (Alpha) - * Many bugfixes: - - fixed parsing/serialization of bytes, sint, sfixed types - - other parser bugfixes - - fixed memory leak affecting Ruby 2.2 - - JavaNano (Alpha) - * JavaNano generated code now will be put in a nano package by default to - avoid conflicts with Java generated code. - - Objective-C (Alpha) - * Added non-null markup to ObjC library. Requires SDK 8.4+ to build. - * Many bugfixes: - - Removed the class/enum filter. - - Renamed some internal types to avoid conflicts with the well-known types - protos. - - Added missing support for parsing repeated primitive fields in packed or - unpacked forms. - - Added *Count for repeated and map<> fields to avoid auto-create when - checking for them being set. - - C# (Alpha) - * Namespace changed to Google.Protobuf (and NuGet package will be named - correspondingly). - * Target platforms now .NET 4.5 and selected portable subsets only. - * Removed lite runtime. - * Reimplementation to use mutable message types. - * Null references used to represent "no value" for message type fields. - * Proto3 semantics supported; proto2 files are prohibited for C# codegen. - Most proto3 features supported: - - JSON formatting (a.k.a. serialization to JSON), including well-known - types (except for Any). - - Wrapper types mapped to nullable value types (or string/ByteString - allowing nullability). JSON parsing is not supported yet. - - maps - - oneof - - enum unknown value preservation - -2015-05-25 version 3.0.0-alpha-3 (Objective-C/C#): - General - * Introduced two new language implementations (Objective-C, C#) to proto3. - * Explicit "optional" keyword are disallowed in proto3 syntax, as fields are - optional by default. - * Group fields are no longer supported in proto3 syntax. - * Changed repeated primitive fields to use packed serialization by default in - proto3 (implemented for C++, Java, Python in this release). The user can - still disable packed serialization by setting packed to false for now. - * Added well-known type protos (any.proto, empty.proto, timestamp.proto, - duration.proto, etc.). Users can import and use these protos just like - regular proto files. Additional runtime support will be added for them in - future releases (in the form of utility helper functions, or having them - replaced by language specific types in generated code). - * Added a "reserved" keyword in both proto2 and proto3 syntax. User can use - this keyword to declare reserved field numbers and names to prevent them - from being reused by other fields in the same message. - - To reserve field numbers, add a reserved declaration in your message: - - message TestMessage { - reserved 2, 15, 9 to 11, 3; - } - - This reserves field numbers 2, 3, 9, 10, 11 and 15. If a user uses any of - these as field numbers, the protocol buffer compiler will report an error. - - Field names can also be reserved: - - message TestMessage { - reserved "foo", "bar"; - } - - * Various bug fixes since 3.0.0-alpha-2 - - Objective-C - Objective-C includes a code generator and a native objective-c runtime - library. By adding “--objc_out” to protoc, the code generator will generate - a header(*.pbobjc.h) and an implementation file(*.pbobjc.m) for each proto - file. - - In this first release, the generated interface provides: enums, messages, - field support(single, repeated, map, oneof), proto2 and proto3 syntax - support, parsing and serialization. It’s compatible with ARC and non-ARC - usage. Besides, user can also access it via the swift bridging header. - - See objectivec/README.md for details. - - C# - * C# protobufs are based on project - https://github.com/jskeet/protobuf-csharp-port. The original project was - frozen and all the new development will happen here. - * Codegen plugin for C# was completely rewritten to C++ and is now an - integral part of protoc. - * Some refactorings and cleanup has been applied to the C# runtime library. - * Only proto2 is supported in C# at the moment, proto3 support is in - progress and will likely bring significant breaking changes to the API. - - See csharp/README.md for details. - - C++ - * Added runtime support for Any type. To use Any in your proto file, first - import the definition of Any: - - // foo.proto - import "google/protobuf/any.proto"; - message Foo { - google.protobuf.Any any_field = 1; - } - message Bar { - int32 value = 1; - } - - Then in C++ you can access the Any field using PackFrom()/UnpackTo() - methods: - - Foo foo; - Bar bar = ...; - foo.mutable_any_field()->PackFrom(bar); - ... - if (foo.any_field().IsType()) { - foo.any_field().UnpackTo(&bar); - ... - } - * In text format, entries of a map field will be sorted by key. - - Java - * Continued optimizations on the lite runtime to improve performance for - Android. - - Python - * Added map support. - - maps now have a dict-like interface (msg.map_field[key] = value) - - existing code that modifies maps via the repeated field interface - will need to be updated. - - Ruby - * Improvements to RepeatedField's emulation of the Ruby Array API. - * Various speedups and internal cleanups. - -2015-02-26 version 3.0.0-alpha-2 (Python/Ruby/JavaNano): - General - * Introduced three new language implementations (Ruby, JavaNano, and - Python) to proto3. - * Various bug fixes since 3.0.0-alpha-1 - - Python: - Python has received several updates, most notably support for proto3 - semantics in any .proto file that declares syntax="proto3". - Messages declared in proto3 files no longer represent field presence - for scalar fields (number, enums, booleans, or strings). You can - no longer call HasField() for such fields, and they are serialized - based on whether they have a non-zero/empty/false value. - - One other notable change is in the C++-accelerated implementation. - Descriptor objects (which describe the protobuf schema and allow - reflection over it) are no longer duplicated between the Python - and C++ layers. The Python descriptors are now simple wrappers - around the C++ descriptors. This change should significantly - reduce the memory usage of programs that use a lot of message - types. - - Ruby: - We have added proto3 support for Ruby via a native C extension. - - The Ruby extension itself is included in the ruby/ directory, and details on - building and installing the extension are in ruby/README.md. The extension - will also be published as a Ruby gem. Code generator support is included as - part of `protoc` with the `--ruby_out` flag. - - The Ruby extension implements a user-friendly DSL to define message types - (also generated by the code generator from `.proto` files). Once a message - type is defined, the user may create instances of the message that behave in - ways idiomatic to Ruby. For example: - - - Message fields are present as ordinary Ruby properties (getter method - `foo` and setter method `foo=`). - - Repeated field elements are stored in a container that acts like a native - Ruby array, and map elements are stored in a container that acts like a - native Ruby hashmap. - - The usual well-known methods, such as `#to_s`, `#dup`, and the like, are - present. - - Unlike several existing third-party Ruby extensions for protobuf, this - extension is built on a "strongly-typed" philosophy: message fields and - array/map containers will throw exceptions eagerly when values of the - incorrect type are inserted. - - See ruby/README.md for details. - - JavaNano: - JavaNano is a special code generator and runtime library designed especially - for resource-restricted systems, like Android. It is very resource-friendly - in both the amount of code and the runtime overhead. Here is an an overview - of JavaNano features compared with the official Java protobuf: - - - No descriptors or message builders. - - All messages are mutable; fields are public Java fields. - - For optional fields only, encapsulation behind setter/getter/hazzer/ - clearer functions is opt-in, which provide proper 'has' state support. - - For proto2, if not opted in, has state (field presence) is not available. - Serialization outputs all fields not equal to their defaults. - The behavior is consistent with proto3 semantics. - - Required fields (proto2 only) are always serialized. - - Enum constants are integers; protection against invalid values only - when parsing from the wire. - - Enum constants can be generated into container interfaces bearing - the enum's name (so the referencing code is in Java style). - - CodedInputByteBufferNano can only take byte[] (not InputStream). - - Similarly CodedOutputByteBufferNano can only write to byte[]. - - Repeated fields are in arrays, not ArrayList or Vector. Null array - elements are allowed and silently ignored. - - Full support for serializing/deserializing repeated packed fields. - - Support extensions (in proto2). - - Unset messages/groups are null, not an immutable empty default - instance. - - toByteArray(...) and mergeFrom(...) are now static functions of - MessageNano. - - The 'bytes' type translates to the Java type byte[]. - - See javanano/README.txt for details. - -2014-12-01 version 3.0.0-alpha-1 (C++/Java): - - General - * Introduced Protocol Buffers language version 3 (aka proto3). - - When protobuf was initially opensourced it implemented Protocol Buffers - language version 2 (aka proto2), which is why the version number - started from v2.0.0. From v3.0.0, a new language version (proto3) is - introduced while the old version (proto2) will continue to be supported. - - The main intent of introducing proto3 is to clean up protobuf before - pushing the language as the foundation of Google's new API platform. - In proto3, the language is simplified, both for ease of use and to - make it available in a wider range of programming languages. At the - same time a few features are added to better support common idioms - found in APIs. - - The following are the main new features in language version 3: - - 1. Removal of field presence logic for primitive value fields, removal - of required fields, and removal of default values. This makes proto3 - significantly easier to implement with open struct representations, - as in languages like Android Java, Objective C, or Go. - 2. Removal of unknown fields. - 3. Removal of extensions, which are instead replaced by a new standard - type called Any. - 4. Fix semantics for unknown enum values. - 5. Addition of maps. - 6. Addition of a small set of standard types for representation of time, - dynamic data, etc. - 7. A well-defined encoding in JSON as an alternative to binary proto - encoding. - - This release (v3.0.0-alpha-1) includes partial proto3 support for C++ and - Java. Items 6 (well-known types) and 7 (JSON format) in the above feature - list are not implemented. - - A new notion "syntax" is introduced to specify whether a .proto file - uses proto2 or proto3: - - // foo.proto - syntax = "proto3"; - message Bar {...} - - If omitted, the protocol compiler will generate a warning and "proto2" will - be used as the default. This warning will be turned into an error in a - future release. - - We recommend that new Protocol Buffers users use proto3. However, we do not - generally recommend that existing users migrate from proto2 from proto3 due - to API incompatibility, and we will continue to support proto2 for a long - time. - - * Added support for map fields (implemented in C++/Java for both proto2 and - proto3). - - Map fields can be declared using the following syntax: - - message Foo { - map values = 1; - } - - Data of a map field will be stored in memory as an unordered map and it - can be accessed through generated accessors. - - C++ - * Added arena allocation support (for both proto2 and proto3). - - Profiling shows memory allocation and deallocation constitutes a significant - fraction of CPU-time spent in protobuf code and arena allocation is a - technique introduced to reduce this cost. With arena allocation, new - objects will be allocated from a large piece of preallocated memory and - deallocation of these objects is almost free. Early adoption shows 20% to - 50% improvement in some Google binaries. - - To enable arena support, add the following option to your .proto file: - - option cc_enable_arenas = true; - - Protocol compiler will generate additional code to make the generated - message classes work with arenas. This does not change the existing API - of protobuf messages and does not affect wire format. Your existing code - should continue to work after adding this option. In the future we will - make this option enabled by default. - - To actually take advantage of arena allocation, you need to use the arena - APIs when creating messages. A quick example of using the arena API: - - { - google::protobuf::Arena arena; - // Allocate a protobuf message in the arena. - MyMessage* message = Arena::CreateMessage(&arena); - // All submessages will be allocated in the same arena. - if (!message->ParseFromString(data)) { - // Deal with malformed input data. - } - // Must not delete the message here. It will be deleted automatically - // when the arena is destroyed. - } - - Currently arena does not work with map fields. Enabling arena in a .proto - file containing map fields will result in compile errors in the generated - code. This will be addressed in a future release. - -2014-10-20 version 2.6.1: - - C++ - * Added atomicops support for Solaris. - * Released memory allocated by InitializeDefaultRepeatedFields() and - GetEmptyString(). Some memory sanitizers reported them as memory leaks. - - Java - * Updated DynamicMessage.setField() to handle repeated enum values - correctly. - * Fixed a bug that caused NullPointerException to be thrown when - converting manually constructed FileDescriptorProto to - FileDescriptor. - - Python - * Fixed WhichOneof() to work with de-serialized protobuf messages. - * Fixed a missing file problem of Python C++ implementation. - -2014-08-15 version 2.6.0: - - General - * Added oneofs(unions) feature. Fields in the same oneof will share - memory and at most one field can be set at the same time. Use the - oneof keyword to define a oneof like: - message SampleMessage { - oneof test_oneof { - string name = 4; - YourMessage sub_message = 9; - } - } - * Files, services, enums, messages, methods and enum values can be marked - as deprecated now. - * Added Support for list values, including lists of messages, when - parsing text-formatted protos in C++ and Java. - For example: foo: [1, 2, 3] - - C++ - * Enhanced customization on TestFormat printing. - * Added SwapFields() in reflection API to swap a subset of fields. - Added SetAllocatedMessage() in reflection API. - * Repeated primitive extensions are now packable. The - [packed=true] option only affects serializers. Therefore, it is - possible to switch a repeated extension field to packed format - without breaking backwards-compatibility. - * Various speed optimizations. - - Java - * writeTo() method in ByteString can now write a substring to an - output stream. Added endWith() method for ByteString. - * ByteString and ByteBuffer are now supported in CodedInputStream - and CodedOutputStream. - * java_generate_equals_and_hash can now be used with the LITE_RUNTIME. - - Python - * A new C++-backed extension module (aka "cpp api v2") that replaces the - old ("cpp api v1") one. Much faster than the pure Python code. This one - resolves many bugs and is recommended for general use over the - pure Python when possible. - * Descriptors now have enum_types_by_name and extension_types_by_name dict - attributes. - * Support for Python 3. - -2013-02-27 version 2.5.0: - - General - * New notion "import public" that allows a proto file to forward the content - it imports to its importers. For example, - // foo.proto - import public "bar.proto"; - import "baz.proto"; - - // qux.proto - import "foo.proto"; - // Stuff defined in bar.proto may be used in this file, but stuff from - // baz.proto may NOT be used without importing it explicitly. - This is useful for moving proto files. To move a proto file, just leave - a single "import public" in the old proto file. - * New enum option "allow_alias" that specifies whether different symbols can - be assigned the same numeric value. Default value is "true". Setting it to - false causes the compiler to reject enum definitions where multiple symbols - have the same numeric value. - Note: We plan to flip the default value to "false" in a future release. - Projects using enum aliases should set the option to "true" in their .proto - files. - - C++ - * New generated method set_allocated_foo(Type* foo) for message and string - fields. This method allows you to set the field to a pre-allocated object - and the containing message takes the ownership of that object. - * Added SetAllocatedExtension() and ReleaseExtension() to extensions API. - * Custom options are now formatted correctly when descriptors are printed in - text format. - * Various speed optimizations. - - Java - * Comments in proto files are now collected and put into generated code as - comments for corresponding classes and data members. - * Added Parser to parse directly into messages without a Builder. For - example, - Foo foo = Foo.PARSER.ParseFrom(input); - Using Parser is ~25% faster than using Builder to parse messages. - * Added getters/setters to access the underlying ByteString of a string field - directly. - * ByteString now supports more operations: substring(), prepend(), and - append(). The implementation of ByteString uses a binary tree structure - to support these operations efficiently. - * New method findInitializationErrors() that lists all missing required - fields. - * Various code size and speed optimizations. - - Python - * Added support for dynamic message creation. DescriptorDatabase, - DescriptorPool, and MessageFactory work like their C++ counterparts to - simplify Descriptor construction from *DescriptorProtos, and MessageFactory - provides a message instance from a Descriptor. - * Added pickle support for protobuf messages. - * Unknown fields are now preserved after parsing. - * Fixed bug where custom options were not correctly populated. Custom - options can be accessed now. - * Added EnumTypeWrapper that provides better accessibility to enum types. - * Added ParseMessage(descriptor, bytes) to generate a new Message instance - from a descriptor and a byte string. - -2011-05-01 version 2.4.1: - - C++ - * Fixed the friendship problem for old compilers to make the library now gcc 3 - compatible again. - * Fixed vcprojects/extract_includes.bat to extract compiler/plugin.h. - - Java - * Removed usages of JDK 1.6 only features to make the library now JDK 1.5 - compatible again. - * Fixed a bug about negative enum values. - * serialVersionUID is now defined in generated messages for java serializing. - * Fixed protoc to use java.lang.Object, which makes "Object" now a valid - message name again. - - Python - * Experimental C++ implementation now requires C++ protobuf library installed. - See the README.txt in the python directory for details. - -2011-02-02 version 2.4.0: - - General - * The RPC (cc|java|py)_generic_services default value is now false instead of - true. - * Custom options can have aggregate types. For example, - message MyOption { - optional string comment = 1; - optional string author = 2; - } - extend google.protobuf.FieldOptions { - optional MyOption myoption = 12345; - } - This option can now be set as follows: - message SomeType { - optional int32 field = 1 [(myoption) = { comment:'x' author:'y' }]; - } - - C++ - * Various speed and code size optimizations. - * Added a release_foo() method on string and message fields. - * Fixed gzip_output_stream sub-stream handling. - - Java - * Builders now maintain sub-builders for sub-messages. Use getFooBuilder() to - get the builder for the sub-message "foo". This allows you to repeatedly - modify deeply-nested sub-messages without rebuilding them. - * Builder.build() no longer invalidates the Builder for generated messages - (You may continue to modify it and then build another message). - * Code generator will generate efficient equals() and hashCode() - implementations if new option java_generate_equals_and_hash is enabled. - (Otherwise, reflection-based implementations are used.) - * Generated messages now implement Serializable. - * Fields with [deprecated=true] will be marked with @Deprecated in Java. - * Added lazy conversion of UTF-8 encoded strings to String objects to improve - performance. - * Various optimizations. - * Enum value can be accessed directly, instead of calling getNumber() on the - enum member. - * For each enum value, an integer constant is also generated with the suffix - _VALUE. - - Python - * Added an experimental C++ implementation for Python messages via a Python - extension. Implementation type is controlled by an environment variable - PROTOCOL_BUFFERS_PYTHON_IMPLEMENTATION (valid values: "cpp" and "python") - The default value is currently "python" but will be changed to "cpp" in - future release. - * Improved performance on message instantiation significantly. - Most of the work on message instantiation is done just once per message - class, instead of once per message instance. - * Improved performance on text message parsing. - * Allow add() to forward keyword arguments to the concrete class. - E.g. instead of - item = repeated_field.add() - item.foo = bar - item.baz = quux - You can do: - repeated_field.add(foo=bar, baz=quux) - * Added a sort() interface to the BaseContainer. - * Added an extend() method to repeated composite fields. - * Added UTF8 debug string support. - -2010-01-08 version 2.3.0: - - General - * Parsers for repeated numeric fields now always accept both packed and - unpacked input. The [packed=true] option only affects serializers. - Therefore, it is possible to switch a field to packed format without - breaking backwards-compatibility -- as long as all parties are using - protobuf 2.3.0 or above, at least. - * The generic RPC service code generated by the C++, Java, and Python - generators can be disabled via file options: - option cc_generic_services = false; - option java_generic_services = false; - option py_generic_services = false; - This allows plugins to generate alternative code, possibly specific to some - particular RPC implementation. - - protoc - * Now supports a plugin system for code generators. Plugins can generate - code for new languages or inject additional code into the output of other - code generators. Plugins are just binaries which accept a protocol buffer - on stdin and write a protocol buffer to stdout, so they may be written in - any language. See src/google/protobuf/compiler/plugin.proto. - **WARNING**: Plugins are experimental. The interface may change in a - future version. - * If the output location ends in .zip or .jar, protoc will write its output - to a zip/jar archive instead of a directory. For example: - protoc --java_out=myproto_srcs.jar --python_out=myproto.zip myproto.proto - Currently the archive contents are not compressed, though this could change - in the future. - * inf, -inf, and nan can now be used as default values for float and double - fields. - - C++ - * Various speed and code size optimizations. - * DynamicMessageFactory is now fully thread-safe. - * Message::Utf8DebugString() method is like DebugString() but avoids escaping - UTF-8 bytes. - * Compiled-in message types can now contain dynamic extensions, through use - of CodedInputStream::SetExtensionRegistry(). - * Now compiles shared libraries (DLLs) by default on Cygwin and MinGW, to - match other platforms. Use --disable-shared to avoid this. - - Java - * parseDelimitedFrom() and mergeDelimitedFrom() now detect EOF and return - false/null instead of throwing an exception. - * Fixed some initialization ordering bugs. - * Fixes for OpenJDK 7. - - Python - * 10-25 times faster than 2.2.0, still pure-Python. - * Calling a mutating method on a sub-message always instantiates the message - in its parent even if the mutating method doesn't actually mutate anything - (e.g. parsing from an empty string). - * Expanded descriptors a bit. - -2009-08-11 version 2.2.0: - - C++ - * Lite mode: The "optimize_for = LITE_RUNTIME" option causes the compiler - to generate code which only depends libprotobuf-lite, which is much smaller - than libprotobuf but lacks descriptors, reflection, and some other features. - * Fixed bug where Message.Swap(Message) was only implemented for - optimize_for_speed. Swap now properly implemented in both modes - (Issue 91). - * Added RemoveLast and SwapElements(index1, index2) to Reflection - interface for repeated elements. - * Added Swap(Message) to Reflection interface. - * Floating-point literals in generated code that are intended to be - single-precision now explicitly have 'f' suffix to avoid pedantic warnings - produced by some compilers. - * The [deprecated=true] option now causes the C++ code generator to generate - a GCC-style deprecation annotation (no-op on other compilers). - * google::protobuf::GetEnumDescriptor() returns the - EnumDescriptor for that type -- useful for templates which cannot call - SomeGeneratedEnumType_descriptor(). - * Various optimizations and obscure bug fixes. - - Java - * Lite mode: The "optimize_for = LITE_RUNTIME" option causes the compiler - to generate code which only depends libprotobuf-lite, which is much smaller - than libprotobuf but lacks descriptors, reflection, and some other features. - * Lots of style cleanups. - - Python - * Fixed endianness bug with floats and doubles. - * Text format parsing support. - * Fix bug with parsing packed repeated fields in embedded messages. - * Ability to initialize fields by passing keyword args to constructor. - * Support iterators in extend and __setslice__ for containers. - -2009-05-13 version 2.1.0: - - General - * Repeated fields of primitive types (types other that string, group, and - nested messages) may now use the option [packed = true] to get a more - efficient encoding. In the new encoding, the entire list is written - as a single byte blob using the "length-delimited" wire type. Within - this blob, the individual values are encoded the same way they would - be normally except without a tag before each value (thus, they are - tightly "packed"). - * For each field, the generated code contains an integer constant assigned - to the field number. For example, the .proto file: - message Foo { optional int bar_baz = 123; } - would generate the following constants, all with the integer value 123: - C++: Foo::kBarBazFieldNumber - Java: Foo.BAR_BAZ_FIELD_NUMBER - Python: Foo.BAR_BAZ_FIELD_NUMBER - Constants are also generated for extensions, with the same naming scheme. - These constants may be used as switch cases. - * Updated bundled Google Test to version 1.3.0. Google Test is now bundled - in its verbatim form as a nested autoconf package, so you can drop in any - other version of Google Test if needed. - * optimize_for = SPEED is now the default, by popular demand. Use - optimize_for = CODE_SIZE if code size is more important in your app. - * It is now an error to define a default value for a repeated field. - Previously, this was silently ignored (it had no effect on the generated - code). - * Fields can now be marked deprecated like: - optional int32 foo = 1 [deprecated = true]; - Currently this does not have any actual effect, but in the future the code - generators may generate deprecation annotations in each language. - * Cross-compiling should now be possible using the --with-protoc option to - configure. See README.txt for more info. - - protoc - * --error_format=msvs option causes errors to be printed in Visual Studio - format, which should allow them to be clicked on in the build log to go - directly to the error location. - * The type name resolver will no longer resolve type names to fields. For - example, this now works: - message Foo {} - message Bar { - optional int32 Foo = 1; - optional Foo baz = 2; - } - Previously, the type of "baz" would resolve to "Bar.Foo", and you'd get - an error because Bar.Foo is a field, not a type. Now the type of "baz" - resolves to the message type Foo. This change is unlikely to make a - difference to anyone who follows the Protocol Buffers style guide. - - C++ - * Several optimizations, including but not limited to: - - Serialization, especially to flat arrays, is 10%-50% faster, possibly - more for small objects. - - Several descriptor operations which previously required locking no longer - do. - - Descriptors are now constructed lazily on first use, rather than at - process startup time. This should save memory in programs which do not - use descriptors or reflection. - - UnknownFieldSet completely redesigned to be more efficient (especially in - terms of memory usage). - - Various optimizations to reduce code size (though the serialization speed - optimizations increased code size). - * Message interface has method ParseFromBoundedZeroCopyStream() which parses - a limited number of bytes from an input stream rather than parsing until - EOF. - * GzipInputStream and GzipOutputStream support reading/writing gzip- or - zlib-compressed streams if zlib is available. - (google/protobuf/io/gzip_stream.h) - * DescriptorPool::FindAllExtensions() and corresponding - DescriptorDatabase::FindAllExtensions() can be used to enumerate all - extensions of a given type. - * For each enum type Foo, protoc will generate functions: - const string& Foo_Name(Foo value); - bool Foo_Parse(const string& name, Foo* result); - The former returns the name of the enum constant corresponding to the given - value while the latter finds the value corresponding to a name. - * RepeatedField and RepeatedPtrField now have back-insertion iterators. - * String fields now have setters that take a char* and a size, in addition - to the existing ones that took char* or const string&. - * DescriptorPool::AllowUnknownDependencies() may be used to tell - DescriptorPool to create placeholder descriptors for unknown entities - referenced in a FileDescriptorProto. This can allow you to parse a .proto - file without having access to other .proto files that it imports, for - example. - * Updated gtest to latest version. The gtest package is now included as a - nested autoconf package, so it should be able to drop new versions into the - "gtest" subdirectory without modification. - - Java - * Fixed bug where Message.mergeFrom(Message) failed to merge extensions. - * Message interface has new method toBuilder() which is equivalent to - newBuilderForType().mergeFrom(this). - * All enums now implement the ProtocolMessageEnum interface. - * Setting a field to null now throws NullPointerException. - * Fixed tendency for TextFormat's parsing to overflow the stack when - parsing large string values. The underlying problem is with Java's - regex implementation (which unfortunately uses recursive backtracking - rather than building an NFA). Worked around by making use of possessive - quantifiers. - * Generated service classes now also generate pure interfaces. For a service - Foo, Foo.Interface is a pure interface containing all of the service's - defined methods. Foo.newReflectiveService() can be called to wrap an - instance of this interface in a class that implements the generic - RpcService interface, which provides reflection support that is usually - needed by RPC server implementations. - * RPC interfaces now support blocking operation in addition to non-blocking. - The protocol compiler generates separate blocking and non-blocking stubs - which operate against separate blocking and non-blocking RPC interfaces. - RPC implementations will have to implement the new interfaces in order to - support blocking mode. - * New I/O methods parseDelimitedFrom(), mergeDelimitedFrom(), and - writeDelimitedTo() read and write "delimited" messages from/to a stream, - meaning that the message size precedes the data. This way, you can write - multiple messages to a stream without having to worry about delimiting - them yourself. - * Throw a more descriptive exception when build() is double-called. - * Add a method to query whether CodedInputStream is at the end of the input - stream. - * Add a method to reset a CodedInputStream's size counter; useful when - reading many messages with the same stream. - * equals() and hashCode() now account for unknown fields. - - Python - * Added slicing support for repeated scalar fields. Added slice retrieval and - removal of repeated composite fields. - * Updated RPC interfaces to allow for blocking operation. A client may - now pass None for a callback when making an RPC, in which case the - call will block until the response is received, and the response - object will be returned directly to the caller. This interface change - cannot be used in practice until RPC implementations are updated to - implement it. - * Changes to input_stream.py should make protobuf compatible with appengine. - -2008-11-25 version 2.0.3: - - protoc - * Enum values may now have custom options, using syntax similar to field - options. - * Fixed bug where .proto files which use custom options but don't actually - define them (i.e. they import another .proto file defining the options) - had to explicitly import descriptor.proto. - * Adjacent string literals in .proto files will now be concatenated, like in - C. - * If an input file is a Windows absolute path (e.g. "C:\foo\bar.proto") and - the import path only contains "." (or contains "." but does not contain - the file), protoc incorrectly thought that the file was under ".", because - it thought that the path was relative (since it didn't start with a slash). - This has been fixed. - - C++ - * Generated message classes now have a Swap() method which efficiently swaps - the contents of two objects. - * All message classes now have a SpaceUsed() method which returns an estimate - of the number of bytes of allocated memory currently owned by the object. - This is particularly useful when you are reusing a single message object - to improve performance but want to make sure it doesn't bloat up too large. - * New method Message::SerializeAsString() returns a string containing the - serialized data. May be more convenient than calling - SerializeToString(string*). - * In debug mode, log error messages when string-type fields are found to - contain bytes that are not valid UTF-8. - * Fixed bug where a message with multiple extension ranges couldn't parse - extensions. - * Fixed bug where MergeFrom(const Message&) didn't do anything if invoked on - a message that contained no fields (but possibly contained extensions). - * Fixed ShortDebugString() to not be O(n^2). Durr. - * Fixed crash in TextFormat parsing if the first token in the input caused a - tokenization error. - * Fixed obscure bugs in zero_copy_stream_impl.cc. - * Added support for HP C++ on Tru64. - * Only build tests on "make check", not "make". - * Fixed alignment issue that caused crashes when using DynamicMessage on - 64-bit Sparc machines. - * Simplify template usage to work with MSVC 2003. - * Work around GCC 4.3.x x86_64 compiler bug that caused crashes on startup. - (This affected Fedora 9 in particular.) - * Now works on "Solaris 10 using recent Sun Studio". - - Java - * New overload of mergeFrom() which parses a slice of a byte array instead - of the whole thing. - * New method ByteString.asReadOnlyByteBuffer() does what it sounds like. - * Improved performance of isInitialized() when optimizing for code size. - - Python - * Corrected ListFields() signature in Message base class to match what - subclasses actually implement. - * Some minor refactoring. - * Don't pass self as first argument to superclass constructor (no longer - allowed in Python 2.6). - -2008-09-29 version 2.0.2: - - General - * License changed from Apache 2.0 to 3-Clause BSD. - * It is now possible to define custom "options", which are basically - annotations which may be placed on definitions in a .proto file. - For example, you might define a field option called "foo" like so: - import "google/protobuf/descriptor.proto" - extend google.protobuf.FieldOptions { - optional string foo = 12345; - } - Then you annotate a field using the "foo" option: - message MyMessage { - optional int32 some_field = 1 [(foo) = "bar"] - } - The value of this option is then visible via the message's - Descriptor: - const FieldDescriptor* field = - MyMessage::descriptor()->FindFieldByName("some_field"); - assert(field->options().GetExtension(foo) == "bar"); - This feature has been implemented and tested in C++ and Java. - Other languages may or may not need to do extra work to support - custom options, depending on how they construct descriptors. - - C++ - * Fixed some GCC warnings that only occur when using -pedantic. - * Improved static initialization code, making ordering more - predictable among other things. - * TextFormat will no longer accept messages which contain multiple - instances of a singular field. Previously, the latter instance - would overwrite the former. - * Now works on systems that don't have hash_map. - - Java - * Print @Override annotation in generated code where appropriate. - - Python - * Strings now use the "unicode" type rather than the "str" type. - String fields may still be assigned ASCII "str" values; they will - automatically be converted. - * Adding a property to an object representing a repeated field now - raises an exception. For example: - # No longer works (and never should have). - message.some_repeated_field.foo = 1 - - Windows - * We now build static libraries rather than DLLs by default on MSVC. - See vsprojects/readme.txt for more information. - -2008-08-15 version 2.0.1: - - protoc - * New flags --encode and --decode can be used to convert between protobuf text - format and binary format from the command-line. - * New flag --descriptor_set_out can be used to write FileDescriptorProtos for - all parsed files directly into a single output file. This is particularly - useful if you wish to parse .proto files from programs written in languages - other than C++: just run protoc as a background process and have it output - a FileDescriptorList, then parse that natively. - * Improved error message when an enum value's name conflicts with another - symbol defined in the enum type's scope, e.g. if two enum types declared - in the same scope have values with the same name. This is disallowed for - compatibility with C++, but this wasn't clear from the error. - * Fixed absolute output paths on Windows. - * Allow trailing slashes in --proto_path mappings. - - C++ - * Reflection objects are now per-class rather than per-instance. To make this - possible, the Reflection interface had to be changed such that all methods - take the Message instance as a parameter. This change improves performance - significantly in memory-bandwidth-limited use cases, since it makes the - message objects smaller. Note that source-incompatible interface changes - like this will not be made again after the library leaves beta. - * Heuristically detect sub-messages when printing unknown fields. - * Fix static initialization ordering bug that caused crashes at startup when - compiling on Mac with static linking. - * Fixed TokenizerTest when compiling with -DNDEBUG on Linux. - * Fixed incorrect definition of kint32min. - * Fix bytes type setter to work with byte sequences with embedded NULLs. - * Other irrelevant tweaks. - - Java - * Fixed UnknownFieldSet's parsing of varints larger than 32 bits. - * Fixed TextFormat's parsing of "inf" and "nan". - * Fixed TextFormat's parsing of comments. - * Added info to Java POM that will be required when we upload the - package to a Maven repo. - - Python - * MergeFrom(message) and CopyFrom(message) are now implemented. - * SerializeToString() raises an exception if the message is missing required - fields. - * Code organization improvements. - * Fixed doc comments for RpcController and RpcChannel, which had somehow been - swapped. - * Fixed text_format_test on Windows where floating-point exponents sometimes - contain extra zeros. - * Fix Python service CallMethod() implementation. - - Other - * Improved readmes. - * VIM syntax highlighting improvements. - -2008-07-07 version 2.0.0: - - * First public release. diff --git a/extra/protobuf/protobuf-3.19.4/CONTRIBUTORS.txt b/extra/protobuf/protobuf-3.19.4/CONTRIBUTORS.txt deleted file mode 100644 index b8d97fc23d85..000000000000 --- a/extra/protobuf/protobuf-3.19.4/CONTRIBUTORS.txt +++ /dev/null @@ -1,102 +0,0 @@ -This file contains a list of people who have made large contributions -to the public version of Protocol Buffers. - -Original Protocol Buffers design and implementation: - Sanjay Ghemawat - Jeff Dean - Daniel Dulitz - Craig Silverstein - Paul Haahr - Corey Anderson - (and many others) - -Proto2 C++ and Java primary author: - Kenton Varda - -Proto2 Python primary authors: - Will Robinson - Petar Petrov - -Java Nano primary authors: - Brian Duff - Tom Chao - Max Cai - Ulas Kirazci - -Large code contributions: - Jason Hsueh - Joseph Schorr - Wenbo Zhu - -Large quantity of code reviews: - Scott Bruce - Frank Yellin - Neal Norwitz - Jeffrey Yasskin - Ambrose Feinstein - -Documentation: - Lisa Carey - -Maven packaging: - Gregory Kick - -Patch contributors: - Kevin Ko - * Small patch to handle trailing slashes in --proto_path flag. - Johan Euphrosine - * Small patch to fix Python CallMethod(). - Ulrich Kunitz - * Small optimizations to Python serialization. - Leandro Lucarella - * VI syntax highlighting tweaks. - * Fix compiler to not make output executable. - Dilip Joseph - * Heuristic detection of sub-messages when printing unknown fields in - text format. - Brian Atkinson - * Added @Override annotation to generated Java code where appropriate. - Vincent Choinière - * Tru64 support. - Monty Taylor - * Solaris 10 + Sun Studio fixes. - Alek Storm - * Slicing support for repeated scalar fields for the Python API. - Oleg Smolsky - * MS Visual Studio error format option. - * Detect unordered_map in stl_hash.m4. - Brian Olson - * gzip/zlib I/O support. - Michael Poole - * Fixed warnings about generated constructors not explicitly initializing - all fields (only present with certain compiler settings). - * Added generation of field number constants. - Wink Saville - * Fixed initialization ordering problem in logging code. - Will Pierce - * Small patch improving performance of in Python serialization. - Alexandre Vassalotti - * Emacs mode for Protocol Buffers (editors/protobuf-mode.el). - Scott Stafford - * Added Swap(), SwapElements(), and RemoveLast() to Reflection interface. - Alexander Melnikov - * HPUX support. - Oliver Jowett - * Detect whether zlib is new enough in configure script. - * Fixes for Solaris 10 32/64-bit confusion. - Evan Jones - * Optimize Java serialization code when writing a small message to a stream. - * Optimize Java serialization of strings so that UTF-8 encoding happens only - once per string per serialization call. - * Clean up some Java warnings. - * Fix bug with permanent callbacks that delete themselves when run. - Michael Kucharski - * Added CodedInputStream.getTotalBytesRead(). - Kacper Kowalik - * Fixed m4/acx_pthread.m4 problem for some Linux distributions. - William Orr - * Fixed detection of sched_yield on Solaris. - * Added atomicops for Solaris - Andrew Paprocki - * Fixed minor IBM xlC compiler build issues - * Added atomicops for AIX (POWER) diff --git a/extra/protobuf/protobuf-3.19.4/LICENSE b/extra/protobuf/protobuf-3.19.4/LICENSE deleted file mode 100644 index 19b305b00060..000000000000 --- a/extra/protobuf/protobuf-3.19.4/LICENSE +++ /dev/null @@ -1,32 +0,0 @@ -Copyright 2008 Google Inc. All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are -met: - - * Redistributions of source code must retain the above copyright -notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above -copyright notice, this list of conditions and the following disclaimer -in the documentation and/or other materials provided with the -distribution. - * Neither the name of Google Inc. nor the names of its -contributors may be used to endorse or promote products derived from -this software without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -Code generated by the Protocol Buffer compiler is owned by the owner -of the input file used when generating it. This code is not -standalone and requires a support library to be linked with it. This -support library is itself covered by the above license. diff --git a/extra/protobuf/protobuf-3.19.4/Makefile.am b/extra/protobuf/protobuf-3.19.4/Makefile.am deleted file mode 100644 index 41d4061a98e6..000000000000 --- a/extra/protobuf/protobuf-3.19.4/Makefile.am +++ /dev/null @@ -1,1456 +0,0 @@ -## Process this file with automake to produce Makefile.in - -ACLOCAL_AMFLAGS = -I m4 - -AUTOMAKE_OPTIONS = foreign - -# Build . before src so that our all-local and clean-local hooks kicks in at -# the right time. -SUBDIRS = . src - -# Always include third_party directories in distributions. -DIST_SUBDIRS = src conformance benchmarks third_party/googletest - -# Build gmock before we build protobuf tests. We don't add gmock to SUBDIRS -# because then "make check" would also build and run all of gmock's own tests, -# which takes a lot of time and is generally not useful to us. Also, we don't -# want "make install" to recurse into gmock since we don't want to overwrite -# the installed version of gmock if there is one. -check-local: - @echo "Making lib/libgmock.a lib/libgmock_main.a in gmock" - @cd third_party/googletest/googletest && $(MAKE) $(AM_MAKEFLAGS) lib/libgtest.la lib/libgtest_main.la - @cd third_party/googletest/googlemock && $(MAKE) $(AM_MAKEFLAGS) lib/libgmock.la lib/libgmock_main.la - -# We would like to clean gmock when "make clean" is invoked. But we have to -# be careful because clean-local is also invoked during "make distclean", but -# "make distclean" already recurses into gmock because it's listed among the -# DIST_SUBDIRS. distclean will delete gmock/Makefile, so if we then try to -# cd to the directory again and "make clean" it will fail. So, check that the -# Makefile exists before recursing. -clean-local: - @if test -e third_party/googletest/Makefile; then \ - echo "Making clean in googletest"; \ - cd third_party/googletest && $(MAKE) $(AM_MAKEFLAGS) clean; \ - fi; \ - if test -e conformance/Makefile; then \ - echo "Making clean in conformance"; \ - cd conformance && $(MAKE) $(AM_MAKEFLAGS) clean; \ - fi; \ - if test -e benchmarks/Makefile; then \ - echo "Making clean in benchmarks"; \ - cd benchmarks && $(MAKE) $(AM_MAKEFLAGS) clean; \ - fi; \ - if test -e objectivec/DevTools; then \ - echo "Cleaning any ObjC pyc files"; \ - rm -f objectivec/DevTools/*.pyc; \ - fi - -pkgconfigdir = $(libdir)/pkgconfig -pkgconfig_DATA = protobuf.pc protobuf-lite.pc - -csharp_EXTRA_DIST= \ - global.json \ - csharp/.gitignore \ - csharp/CHANGES.txt \ - csharp/Google.Protobuf.Tools.targets \ - csharp/Google.Protobuf.Tools.nuspec \ - csharp/README.md \ - csharp/build_packages.bat \ - csharp/build_tools.sh \ - csharp/buildall.bat \ - csharp/buildall.sh \ - csharp/generate_protos.sh \ - csharp/install_dotnet_sdk.ps1 \ - csharp/keys/Google.Protobuf.public.snk \ - csharp/keys/Google.Protobuf.snk \ - csharp/keys/README.md \ - csharp/protos/README.md \ - csharp/protos/map_unittest_proto3.proto \ - csharp/protos/old_extensions1.proto \ - csharp/protos/old_extensions2.proto \ - csharp/protos/unittest_issue6936_a.proto \ - csharp/protos/unittest_issue6936_b.proto \ - csharp/protos/unittest_issue6936_c.proto \ - csharp/protos/unittest_custom_options_proto3.proto \ - csharp/protos/unittest_import_public_proto3.proto \ - csharp/protos/unittest_import_public.proto \ - csharp/protos/unittest_import_proto3.proto \ - csharp/protos/unittest_import.proto \ - csharp/protos/unittest_issues.proto \ - csharp/protos/unittest_proto3.proto \ - csharp/protos/unittest_selfreferential_options.proto \ - csharp/protos/unittest.proto \ - csharp/src/AddressBook/AddPerson.cs \ - csharp/src/AddressBook/Addressbook.cs \ - csharp/src/AddressBook/AddressBook.csproj \ - csharp/src/AddressBook/ListPeople.cs \ - csharp/src/AddressBook/Program.cs \ - csharp/src/AddressBook/SampleUsage.cs \ - csharp/src/Google.Protobuf.Benchmarks/BenchmarkDatasetConfig.cs \ - csharp/src/Google.Protobuf.Benchmarks/BenchmarkMessage1Proto3.cs \ - csharp/src/Google.Protobuf.Benchmarks/Benchmarks.cs \ - csharp/src/Google.Protobuf.Benchmarks/ByteStringBenchmark.cs \ - csharp/src/Google.Protobuf.Benchmarks/Google.Protobuf.Benchmarks.csproj \ - csharp/src/Google.Protobuf.Benchmarks/GoogleMessageBenchmark.cs \ - csharp/src/Google.Protobuf.Benchmarks/ParseMessagesBenchmark.cs \ - csharp/src/Google.Protobuf.Benchmarks/ParseRawPrimitivesBenchmark.cs \ - csharp/src/Google.Protobuf.Benchmarks/Program.cs \ - csharp/src/Google.Protobuf.Benchmarks/wrapper_benchmark_messages.proto \ - csharp/src/Google.Protobuf.Benchmarks/WrapperBenchmarkMessages.cs \ - csharp/src/Google.Protobuf.Benchmarks/WriteMessagesBenchmark.cs \ - csharp/src/Google.Protobuf.Benchmarks/WriteRawPrimitivesBenchmark.cs \ - csharp/src/Google.Protobuf.Conformance/Conformance.cs \ - csharp/src/Google.Protobuf.Conformance/Google.Protobuf.Conformance.csproj \ - csharp/src/Google.Protobuf.Conformance/Program.cs \ - csharp/src/Google.Protobuf.JsonDump/Google.Protobuf.JsonDump.csproj \ - csharp/src/Google.Protobuf.JsonDump/Program.cs \ - csharp/src/Google.Protobuf.Test/Buffers/ArrayBufferWriter.cs \ - csharp/src/Google.Protobuf.Test/ByteStringTest.cs \ - csharp/src/Google.Protobuf.Test/CodedInputStreamExtensions.cs \ - csharp/src/Google.Protobuf.Test/CodedInputStreamTest.cs \ - csharp/src/Google.Protobuf.Test/CodedOutputStreamTest.cs \ - csharp/src/Google.Protobuf.Test/Collections/MapFieldTest.cs \ - csharp/src/Google.Protobuf.Test/Collections/ProtobufEqualityComparersTest.cs \ - csharp/src/Google.Protobuf.Test/Collections/RepeatedFieldTest.cs \ - csharp/src/Google.Protobuf.Test/Compatibility/PropertyInfoExtensionsTest.cs \ - csharp/src/Google.Protobuf.Test/Compatibility/StreamExtensionsTest.cs \ - csharp/src/Google.Protobuf.Test/Compatibility/TypeExtensionsTest.cs \ - csharp/src/Google.Protobuf.Test/DeprecatedMemberTest.cs \ - csharp/src/Google.Protobuf.Test/EqualityTester.cs \ - csharp/src/Google.Protobuf.Test/ExtensionSetTest.cs \ - csharp/src/Google.Protobuf.Test/FieldCodecTest.cs \ - csharp/src/Google.Protobuf.Test/FieldMaskTreeTest.cs \ - csharp/src/Google.Protobuf.Test/GeneratedMessageTest.cs \ - csharp/src/Google.Protobuf.Test/GeneratedMessageTest.Proto2.cs \ - csharp/src/Google.Protobuf.Test/Google.Protobuf.Test.csproj \ - csharp/src/Google.Protobuf.Test/IssuesTest.cs \ - csharp/src/Google.Protobuf.Test/JsonFormatterTest.cs \ - csharp/src/Google.Protobuf.Test/JsonParserTest.cs \ - csharp/src/Google.Protobuf.Test/JsonTokenizerTest.cs \ - csharp/src/Google.Protobuf.Test/LegacyGeneratedCodeTest.cs \ - csharp/src/Google.Protobuf.Test/MessageParsingHelpers.cs \ - csharp/src/Google.Protobuf.Test/Proto3OptionalTest.cs \ - csharp/src/Google.Protobuf.Test/ReadOnlySequenceFactory.cs \ - csharp/src/Google.Protobuf.Test/RefStructCompatibilityTest.cs \ - csharp/src/Google.Protobuf.Test/Reflection/CustomOptionsTest.cs \ - csharp/src/Google.Protobuf.Test/Reflection/DescriptorDeclarationTest.cs \ - csharp/src/Google.Protobuf.Test/Reflection/DescriptorsTest.cs \ - csharp/src/Google.Protobuf.Test/Reflection/FieldAccessTest.cs \ - csharp/src/Google.Protobuf.Test/Reflection/TypeRegistryTest.cs \ - csharp/src/Google.Protobuf.Test/SampleEnum.cs \ - csharp/src/Google.Protobuf.Test/SampleMessages.cs \ - csharp/src/Google.Protobuf.Test/SampleNaNs.cs \ - csharp/src/Google.Protobuf.Test/TestCornerCases.cs \ - csharp/src/Google.Protobuf.Test.TestProtos/Google.Protobuf.Test.TestProtos.csproj \ - csharp/src/Google.Protobuf.Test.TestProtos/UnittestIssue6936A.cs \ - csharp/src/Google.Protobuf.Test.TestProtos/UnittestIssue6936B.cs \ - csharp/src/Google.Protobuf.Test.TestProtos/UnittestIssue6936C.cs \ - csharp/src/Google.Protobuf.Test.TestProtos/ForeignMessagePartial.cs \ - csharp/src/Google.Protobuf.Test.TestProtos/MapUnittestProto3.cs \ - csharp/src/Google.Protobuf.Test.TestProtos/OldExtensions1.cs \ - csharp/src/Google.Protobuf.Test.TestProtos/OldExtensions2.cs \ - csharp/src/Google.Protobuf.Test.TestProtos/TestMessagesProto2.cs \ - csharp/src/Google.Protobuf.Test.TestProtos/TestMessagesProto3.cs \ - csharp/src/Google.Protobuf.Test.TestProtos/UnittestCustomOptionsProto3.cs \ - csharp/src/Google.Protobuf.Test.TestProtos/UnittestImportProto3.cs \ - csharp/src/Google.Protobuf.Test.TestProtos/UnittestImportPublicProto3.cs \ - csharp/src/Google.Protobuf.Test.TestProtos/UnittestImportPublic.cs \ - csharp/src/Google.Protobuf.Test.TestProtos/UnittestImport.cs \ - csharp/src/Google.Protobuf.Test.TestProtos/UnittestIssues.cs \ - csharp/src/Google.Protobuf.Test.TestProtos/UnittestProto3.cs \ - csharp/src/Google.Protobuf.Test.TestProtos/UnittestProto3Optional.cs \ - csharp/src/Google.Protobuf.Test.TestProtos/UnittestSelfreferentialOptions.cs \ - csharp/src/Google.Protobuf.Test.TestProtos/UnittestWellKnownTypes.cs \ - csharp/src/Google.Protobuf.Test.TestProtos/Unittest.cs \ - csharp/src/Google.Protobuf.Test/WellKnownTypes/AnyTest.cs \ - csharp/src/Google.Protobuf.Test/WellKnownTypes/DurationTest.cs \ - csharp/src/Google.Protobuf.Test/WellKnownTypes/FieldMaskTest.cs \ - csharp/src/Google.Protobuf.Test/WellKnownTypes/TimestampTest.cs \ - csharp/src/Google.Protobuf.Test/WellKnownTypes/WrappersTest.cs \ - csharp/src/Google.Protobuf.Test/UnknownFieldSetTest.cs \ - csharp/src/Google.Protobuf.Test/testprotos.pb \ - csharp/src/Google.Protobuf.sln \ - csharp/src/Google.Protobuf/ByteArray.cs \ - csharp/src/Google.Protobuf/ByteString.cs \ - csharp/src/Google.Protobuf/ByteStringAsync.cs \ - csharp/src/Google.Protobuf/CodedInputStream.cs \ - csharp/src/Google.Protobuf/CodedOutputStream.ComputeSize.cs \ - csharp/src/Google.Protobuf/CodedOutputStream.cs \ - csharp/src/Google.Protobuf/Collections/Lists.cs \ - csharp/src/Google.Protobuf/Collections/MapField.cs \ - csharp/src/Google.Protobuf/Collections/ProtobufEqualityComparers.cs \ - csharp/src/Google.Protobuf/Collections/ReadOnlyDictionary.cs \ - csharp/src/Google.Protobuf/Collections/RepeatedField.cs \ - csharp/src/Google.Protobuf/Compatibility/MethodInfoExtensions.cs \ - csharp/src/Google.Protobuf/Compatibility/PropertyInfoExtensions.cs \ - csharp/src/Google.Protobuf/Compatibility/StreamExtensions.cs \ - csharp/src/Google.Protobuf/Compatibility/TypeExtensions.cs \ - csharp/src/Google.Protobuf/Extension.cs \ - csharp/src/Google.Protobuf/ExtensionRegistry.cs \ - csharp/src/Google.Protobuf/ExtensionSet.cs \ - csharp/src/Google.Protobuf/ExtensionValue.cs \ - csharp/src/Google.Protobuf/FieldCodec.cs \ - csharp/src/Google.Protobuf/FieldMaskTree.cs \ - csharp/src/Google.Protobuf/FrameworkPortability.cs \ - csharp/src/Google.Protobuf/Google.Protobuf.csproj \ - csharp/src/Google.Protobuf/IBufferMessage.cs \ - csharp/src/Google.Protobuf/ICustomDiagnosticMessage.cs \ - csharp/src/Google.Protobuf/IDeepCloneable.cs \ - csharp/src/Google.Protobuf/IExtendableMessage.cs \ - csharp/src/Google.Protobuf/IMessage.cs \ - csharp/src/Google.Protobuf/InvalidJsonException.cs \ - csharp/src/Google.Protobuf/InvalidProtocolBufferException.cs \ - csharp/src/Google.Protobuf/JsonFormatter.cs \ - csharp/src/Google.Protobuf/JsonParser.cs \ - csharp/src/Google.Protobuf/JsonToken.cs \ - csharp/src/Google.Protobuf/JsonTokenizer.cs \ - csharp/src/Google.Protobuf/LimitedInputStream.cs \ - csharp/src/Google.Protobuf/MessageExtensions.cs \ - csharp/src/Google.Protobuf/MessageParser.cs \ - csharp/src/Google.Protobuf/ObjectIntPair.cs \ - csharp/src/Google.Protobuf/ParseContext.cs \ - csharp/src/Google.Protobuf/ParserInternalState.cs \ - csharp/src/Google.Protobuf/ParsingPrimitives.cs \ - csharp/src/Google.Protobuf/ParsingPrimitivesMessages.cs \ - csharp/src/Google.Protobuf/ParsingPrimitivesWrappers.cs \ - csharp/src/Google.Protobuf/ProtoPreconditions.cs \ - csharp/src/Google.Protobuf/SegmentedBufferHelper.cs \ - csharp/src/Google.Protobuf/Properties/AssemblyInfo.cs \ - csharp/src/Google.Protobuf/Reflection/CustomOptions.cs \ - csharp/src/Google.Protobuf/Reflection/Descriptor.cs \ - csharp/src/Google.Protobuf/Reflection/DescriptorBase.cs \ - csharp/src/Google.Protobuf/Reflection/DescriptorDeclaration.cs \ - csharp/src/Google.Protobuf/Reflection/DescriptorPool.cs \ - csharp/src/Google.Protobuf/Reflection/DescriptorUtil.cs \ - csharp/src/Google.Protobuf/Reflection/DescriptorValidationException.cs \ - csharp/src/Google.Protobuf/Reflection/EnumDescriptor.cs \ - csharp/src/Google.Protobuf/Reflection/EnumValueDescriptor.cs \ - csharp/src/Google.Protobuf/Reflection/ExtensionAccessor.cs \ - csharp/src/Google.Protobuf/Reflection/ExtensionCollection.cs \ - csharp/src/Google.Protobuf/Reflection/FieldAccessorBase.cs \ - csharp/src/Google.Protobuf/Reflection/FieldDescriptor.cs \ - csharp/src/Google.Protobuf/Reflection/FieldType.cs \ - csharp/src/Google.Protobuf/Reflection/FileDescriptor.cs \ - csharp/src/Google.Protobuf/Reflection/GeneratedClrTypeInfo.cs \ - csharp/src/Google.Protobuf/Reflection/IDescriptor.cs \ - csharp/src/Google.Protobuf/Reflection/IFieldAccessor.cs \ - csharp/src/Google.Protobuf/Reflection/MapFieldAccessor.cs \ - csharp/src/Google.Protobuf/Reflection/MessageDescriptor.cs \ - csharp/src/Google.Protobuf/Reflection/MethodDescriptor.cs \ - csharp/src/Google.Protobuf/Reflection/OneofAccessor.cs \ - csharp/src/Google.Protobuf/Reflection/OneofDescriptor.cs \ - csharp/src/Google.Protobuf/Reflection/OriginalNameAttribute.cs \ - csharp/src/Google.Protobuf/Reflection/PackageDescriptor.cs \ - csharp/src/Google.Protobuf/Reflection/ReflectionUtil.cs \ - csharp/src/Google.Protobuf/Reflection/RepeatedFieldAccessor.cs \ - csharp/src/Google.Protobuf/Reflection/ServiceDescriptor.cs \ - csharp/src/Google.Protobuf/Reflection/SingleFieldAccessor.cs \ - csharp/src/Google.Protobuf/Reflection/TypeRegistry.cs \ - csharp/src/Google.Protobuf/WellKnownTypes/Any.cs \ - csharp/src/Google.Protobuf/WellKnownTypes/AnyPartial.cs \ - csharp/src/Google.Protobuf/WellKnownTypes/Api.cs \ - csharp/src/Google.Protobuf/WellKnownTypes/Duration.cs \ - csharp/src/Google.Protobuf/WellKnownTypes/DurationPartial.cs \ - csharp/src/Google.Protobuf/WellKnownTypes/Empty.cs \ - csharp/src/Google.Protobuf/WellKnownTypes/FieldMask.cs \ - csharp/src/Google.Protobuf/WellKnownTypes/FieldMaskPartial.cs \ - csharp/src/Google.Protobuf/WellKnownTypes/SourceContext.cs \ - csharp/src/Google.Protobuf/WellKnownTypes/Struct.cs \ - csharp/src/Google.Protobuf/WellKnownTypes/TimeExtensions.cs \ - csharp/src/Google.Protobuf/WellKnownTypes/Timestamp.cs \ - csharp/src/Google.Protobuf/WellKnownTypes/TimestampPartial.cs \ - csharp/src/Google.Protobuf/WellKnownTypes/Type.cs \ - csharp/src/Google.Protobuf/WellKnownTypes/ValuePartial.cs \ - csharp/src/Google.Protobuf/WellKnownTypes/Wrappers.cs \ - csharp/src/Google.Protobuf/WellKnownTypes/WrappersPartial.cs \ - csharp/src/Google.Protobuf/WireFormat.cs \ - csharp/src/Google.Protobuf/WritingPrimitivesMessages.cs \ - csharp/src/Google.Protobuf/WritingPrimitives.cs \ - csharp/src/Google.Protobuf/WriterInternalState.cs \ - csharp/src/Google.Protobuf/WriteContext.cs \ - csharp/src/Google.Protobuf/WriteBufferHelper.cs \ - csharp/src/Google.Protobuf/UnknownField.cs \ - csharp/src/Google.Protobuf/UnknownFieldSet.cs \ - csharp/src/Google.Protobuf/UnsafeByteOperations.cs - -java_EXTRA_DIST= \ - java/README.md \ - java/bom/pom.xml \ - java/core/BUILD \ - java/core/generate-sources-build.xml \ - java/core/generate-test-sources-build.xml \ - java/core/pom.xml \ - java/core/pom_template.xml \ - java/core/src/main/java/com/google/protobuf/AbstractMessage.java \ - java/core/src/main/java/com/google/protobuf/AbstractMessageLite.java \ - java/core/src/main/java/com/google/protobuf/AbstractParser.java \ - java/core/src/main/java/com/google/protobuf/AbstractProtobufList.java \ - java/core/src/main/java/com/google/protobuf/AllocatedBuffer.java \ - java/core/src/main/java/com/google/protobuf/Android.java \ - java/core/src/main/java/com/google/protobuf/ArrayDecoders.java \ - java/core/src/main/java/com/google/protobuf/BinaryReader.java \ - java/core/src/main/java/com/google/protobuf/BinaryWriter.java \ - java/core/src/main/java/com/google/protobuf/BlockingRpcChannel.java \ - java/core/src/main/java/com/google/protobuf/BlockingService.java \ - java/core/src/main/java/com/google/protobuf/BooleanArrayList.java \ - java/core/src/main/java/com/google/protobuf/BufferAllocator.java \ - java/core/src/main/java/com/google/protobuf/ByteBufferWriter.java \ - java/core/src/main/java/com/google/protobuf/ByteOutput.java \ - java/core/src/main/java/com/google/protobuf/ByteString.java \ - java/core/src/main/java/com/google/protobuf/CanIgnoreReturnValue.java \ - java/core/src/main/java/com/google/protobuf/CheckReturnValue.java \ - java/core/src/main/java/com/google/protobuf/CodedInputStream.java \ - java/core/src/main/java/com/google/protobuf/CodedInputStreamReader.java \ - java/core/src/main/java/com/google/protobuf/CodedOutputStream.java \ - java/core/src/main/java/com/google/protobuf/CodedOutputStreamWriter.java \ - java/core/src/main/java/com/google/protobuf/DescriptorMessageInfoFactory.java \ - java/core/src/main/java/com/google/protobuf/Descriptors.java \ - java/core/src/main/java/com/google/protobuf/DiscardUnknownFieldsParser.java \ - java/core/src/main/java/com/google/protobuf/DoubleArrayList.java \ - java/core/src/main/java/com/google/protobuf/DynamicMessage.java \ - java/core/src/main/java/com/google/protobuf/ExperimentalApi.java \ - java/core/src/main/java/com/google/protobuf/Extension.java \ - java/core/src/main/java/com/google/protobuf/ExtensionLite.java \ - java/core/src/main/java/com/google/protobuf/ExtensionRegistry.java \ - java/core/src/main/java/com/google/protobuf/ExtensionRegistryFactory.java \ - java/core/src/main/java/com/google/protobuf/ExtensionRegistryLite.java \ - java/core/src/main/java/com/google/protobuf/ExtensionSchema.java \ - java/core/src/main/java/com/google/protobuf/ExtensionSchemaFull.java \ - java/core/src/main/java/com/google/protobuf/ExtensionSchemaLite.java \ - java/core/src/main/java/com/google/protobuf/ExtensionSchemas.java \ - java/core/src/main/java/com/google/protobuf/FieldInfo.java \ - java/core/src/main/java/com/google/protobuf/FieldSet.java \ - java/core/src/main/java/com/google/protobuf/FieldType.java \ - java/core/src/main/java/com/google/protobuf/FloatArrayList.java \ - java/core/src/main/java/com/google/protobuf/GeneratedMessage.java \ - java/core/src/main/java/com/google/protobuf/GeneratedMessageInfoFactory.java \ - java/core/src/main/java/com/google/protobuf/GeneratedMessageLite.java \ - java/core/src/main/java/com/google/protobuf/GeneratedMessageV3.java \ - java/core/src/main/java/com/google/protobuf/IntArrayList.java \ - java/core/src/main/java/com/google/protobuf/Internal.java \ - java/core/src/main/java/com/google/protobuf/InvalidProtocolBufferException.java \ - java/core/src/main/java/com/google/protobuf/IterableByteBufferInputStream.java \ - java/core/src/main/java/com/google/protobuf/JavaType.java \ - java/core/src/main/java/com/google/protobuf/LazyField.java \ - java/core/src/main/java/com/google/protobuf/LazyFieldLite.java \ - java/core/src/main/java/com/google/protobuf/LazyStringArrayList.java \ - java/core/src/main/java/com/google/protobuf/LazyStringList.java \ - java/core/src/main/java/com/google/protobuf/ListFieldSchema.java \ - java/core/src/main/java/com/google/protobuf/LongArrayList.java \ - java/core/src/main/java/com/google/protobuf/ManifestSchemaFactory.java \ - java/core/src/main/java/com/google/protobuf/MapEntry.java \ - java/core/src/main/java/com/google/protobuf/MapEntryLite.java \ - java/core/src/main/java/com/google/protobuf/MapField.java \ - java/core/src/main/java/com/google/protobuf/MapFieldLite.java \ - java/core/src/main/java/com/google/protobuf/MapFieldSchema.java \ - java/core/src/main/java/com/google/protobuf/MapFieldSchemaFull.java \ - java/core/src/main/java/com/google/protobuf/MapFieldSchemaLite.java \ - java/core/src/main/java/com/google/protobuf/MapFieldSchemas.java \ - java/core/src/main/java/com/google/protobuf/Message.java \ - java/core/src/main/java/com/google/protobuf/MessageInfo.java \ - java/core/src/main/java/com/google/protobuf/MessageInfoFactory.java \ - java/core/src/main/java/com/google/protobuf/MessageLite.java \ - java/core/src/main/java/com/google/protobuf/MessageLiteOrBuilder.java \ - java/core/src/main/java/com/google/protobuf/MessageLiteToString.java \ - java/core/src/main/java/com/google/protobuf/MessageOrBuilder.java \ - java/core/src/main/java/com/google/protobuf/MessageReflection.java \ - java/core/src/main/java/com/google/protobuf/MessageSchema.java \ - java/core/src/main/java/com/google/protobuf/MessageSetSchema.java \ - java/core/src/main/java/com/google/protobuf/MutabilityOracle.java \ - java/core/src/main/java/com/google/protobuf/NewInstanceSchema.java \ - java/core/src/main/java/com/google/protobuf/NewInstanceSchemaFull.java \ - java/core/src/main/java/com/google/protobuf/NewInstanceSchemaLite.java \ - java/core/src/main/java/com/google/protobuf/NewInstanceSchemas.java \ - java/core/src/main/java/com/google/protobuf/NioByteString.java \ - java/core/src/main/java/com/google/protobuf/OneofInfo.java \ - java/core/src/main/java/com/google/protobuf/Parser.java \ - java/core/src/main/java/com/google/protobuf/PrimitiveNonBoxingCollection.java \ - java/core/src/main/java/com/google/protobuf/ProtoSyntax.java \ - java/core/src/main/java/com/google/protobuf/Protobuf.java \ - java/core/src/main/java/com/google/protobuf/ProtobufArrayList.java \ - java/core/src/main/java/com/google/protobuf/ProtobufLists.java \ - java/core/src/main/java/com/google/protobuf/ProtocolMessageEnum.java \ - java/core/src/main/java/com/google/protobuf/ProtocolStringList.java \ - java/core/src/main/java/com/google/protobuf/RawMessageInfo.java \ - java/core/src/main/java/com/google/protobuf/Reader.java \ - java/core/src/main/java/com/google/protobuf/RepeatedFieldBuilder.java \ - java/core/src/main/java/com/google/protobuf/RepeatedFieldBuilderV3.java \ - java/core/src/main/java/com/google/protobuf/RopeByteString.java \ - java/core/src/main/java/com/google/protobuf/RpcCallback.java \ - java/core/src/main/java/com/google/protobuf/RpcChannel.java \ - java/core/src/main/java/com/google/protobuf/RpcController.java \ - java/core/src/main/java/com/google/protobuf/RpcUtil.java \ - java/core/src/main/java/com/google/protobuf/Schema.java \ - java/core/src/main/java/com/google/protobuf/SchemaFactory.java \ - java/core/src/main/java/com/google/protobuf/SchemaUtil.java \ - java/core/src/main/java/com/google/protobuf/Service.java \ - java/core/src/main/java/com/google/protobuf/ServiceException.java \ - java/core/src/main/java/com/google/protobuf/SingleFieldBuilder.java \ - java/core/src/main/java/com/google/protobuf/SingleFieldBuilderV3.java \ - java/core/src/main/java/com/google/protobuf/SmallSortedMap.java \ - java/core/src/main/java/com/google/protobuf/StructuralMessageInfo.java \ - java/core/src/main/java/com/google/protobuf/TextFormat.java \ - java/core/src/main/java/com/google/protobuf/TextFormatEscaper.java \ - java/core/src/main/java/com/google/protobuf/TextFormatParseInfoTree.java \ - java/core/src/main/java/com/google/protobuf/TextFormatParseLocation.java \ - java/core/src/main/java/com/google/protobuf/TypeRegistry.java \ - java/core/src/main/java/com/google/protobuf/UninitializedMessageException.java \ - java/core/src/main/java/com/google/protobuf/UnknownFieldSchema.java \ - java/core/src/main/java/com/google/protobuf/UnknownFieldSet.java \ - java/core/src/main/java/com/google/protobuf/UnknownFieldSetLite.java \ - java/core/src/main/java/com/google/protobuf/UnknownFieldSetLiteSchema.java \ - java/core/src/main/java/com/google/protobuf/UnknownFieldSetSchema.java \ - java/core/src/main/java/com/google/protobuf/UnmodifiableLazyStringList.java \ - java/core/src/main/java/com/google/protobuf/UnsafeByteOperations.java \ - java/core/src/main/java/com/google/protobuf/UnsafeUtil.java \ - java/core/src/main/java/com/google/protobuf/Utf8.java \ - java/core/src/main/java/com/google/protobuf/WireFormat.java \ - java/core/src/main/java/com/google/protobuf/Writer.java \ - java/core/src/test/java/com/google/protobuf/AbstractMessageTest.java \ - java/core/src/test/java/com/google/protobuf/AbstractProto2LiteSchemaTest.java \ - java/core/src/test/java/com/google/protobuf/AbstractProto2SchemaTest.java \ - java/core/src/test/java/com/google/protobuf/AbstractProto3LiteSchemaTest.java \ - java/core/src/test/java/com/google/protobuf/AbstractProto3SchemaTest.java \ - java/core/src/test/java/com/google/protobuf/AbstractSchemaTest.java \ - java/core/src/test/java/com/google/protobuf/AnyTest.java \ - java/core/src/test/java/com/google/protobuf/ArrayDecodersTest.java \ - java/core/src/test/java/com/google/protobuf/BinaryProtocolTest.java \ - java/core/src/test/java/com/google/protobuf/BooleanArrayListTest.java \ - java/core/src/test/java/com/google/protobuf/BoundedByteStringTest.java \ - java/core/src/test/java/com/google/protobuf/ByteBufferWriterTest.java \ - java/core/src/test/java/com/google/protobuf/ByteStringTest.java \ - java/core/src/test/java/com/google/protobuf/CachedFieldSizeTest.java \ - java/core/src/test/java/com/google/protobuf/CheckUtf8Test.java \ - java/core/src/test/java/com/google/protobuf/CodedAdapterTest.java \ - java/core/src/test/java/com/google/protobuf/CodedInputStreamTest.java \ - java/core/src/test/java/com/google/protobuf/CodedOutputStreamTest.java \ - java/core/src/test/java/com/google/protobuf/DecodeUtf8Test.java \ - java/core/src/test/java/com/google/protobuf/DeprecatedFieldTest.java \ - java/core/src/test/java/com/google/protobuf/DescriptorsTest.java \ - java/core/src/test/java/com/google/protobuf/DiscardUnknownFieldsTest.java \ - java/core/src/test/java/com/google/protobuf/DoubleArrayListTest.java \ - java/core/src/test/java/com/google/protobuf/DynamicMessageTest.java \ - java/core/src/test/java/com/google/protobuf/EnumTest.java \ - java/core/src/test/java/com/google/protobuf/ExperimentalMessageFactory.java \ - java/core/src/test/java/com/google/protobuf/ExperimentalSerializationUtil.java \ - java/core/src/test/java/com/google/protobuf/ExperimentalTestDataProvider.java \ - java/core/src/test/java/com/google/protobuf/ExtensionRegistryFactoryTest.java \ - java/core/src/test/java/com/google/protobuf/FieldPresenceTest.java \ - java/core/src/test/java/com/google/protobuf/FloatArrayListTest.java \ - java/core/src/test/java/com/google/protobuf/ForceFieldBuildersPreRun.java \ - java/core/src/test/java/com/google/protobuf/GeneratedMessageTest.java \ - java/core/src/test/java/com/google/protobuf/IntArrayListTest.java \ - java/core/src/test/java/com/google/protobuf/IsValidUtf8Test.java \ - java/core/src/test/java/com/google/protobuf/IsValidUtf8TestUtil.java \ - java/core/src/test/java/com/google/protobuf/LazyFieldLiteTest.java \ - java/core/src/test/java/com/google/protobuf/LazyFieldTest.java \ - java/core/src/test/java/com/google/protobuf/LazyMessageLiteTest.java \ - java/core/src/test/java/com/google/protobuf/LazyStringArrayListTest.java \ - java/core/src/test/java/com/google/protobuf/LazyStringEndToEndTest.java \ - java/core/src/test/java/com/google/protobuf/LiteEqualsAndHashTest.java \ - java/core/src/test/java/com/google/protobuf/LiteralByteStringTest.java \ - java/core/src/test/java/com/google/protobuf/LongArrayListTest.java \ - java/core/src/test/java/com/google/protobuf/MapForProto2LiteTest.java \ - java/core/src/test/java/com/google/protobuf/MapForProto2Test.java \ - java/core/src/test/java/com/google/protobuf/MapLiteTest.java \ - java/core/src/test/java/com/google/protobuf/MapTest.java \ - java/core/src/test/java/com/google/protobuf/MessageTest.java \ - java/core/src/test/java/com/google/protobuf/NestedBuildersTest.java \ - java/core/src/test/java/com/google/protobuf/NioByteStringTest.java \ - java/core/src/test/java/com/google/protobuf/PackedFieldTest.java \ - java/core/src/test/java/com/google/protobuf/ParseExceptionsTest.java \ - java/core/src/test/java/com/google/protobuf/ParserLiteTest.java \ - java/core/src/test/java/com/google/protobuf/ParserTest.java \ - java/core/src/test/java/com/google/protobuf/Proto2ExtensionLookupSchemaTest.java \ - java/core/src/test/java/com/google/protobuf/Proto2LiteSchemaTest.java \ - java/core/src/test/java/com/google/protobuf/Proto2MessageFactory.java \ - java/core/src/test/java/com/google/protobuf/Proto2MessageInfoFactory.java \ - java/core/src/test/java/com/google/protobuf/Proto2MessageLiteFactory.java \ - java/core/src/test/java/com/google/protobuf/Proto2SchemaTest.java \ - java/core/src/test/java/com/google/protobuf/Proto2UnknownEnumValueTest.java \ - java/core/src/test/java/com/google/protobuf/Proto3LiteSchemaTest.java \ - java/core/src/test/java/com/google/protobuf/Proto3MessageFactory.java \ - java/core/src/test/java/com/google/protobuf/Proto3MessageInfoFactory.java \ - java/core/src/test/java/com/google/protobuf/Proto3MessageLiteFactory.java \ - java/core/src/test/java/com/google/protobuf/Proto3MessageLiteInfoFactory.java \ - java/core/src/test/java/com/google/protobuf/Proto3SchemaTest.java \ - java/core/src/test/java/com/google/protobuf/ProtobufArrayListTest.java \ - java/core/src/test/java/com/google/protobuf/RepeatedFieldBuilderV3Test.java \ - java/core/src/test/java/com/google/protobuf/RopeByteStringSubstringTest.java \ - java/core/src/test/java/com/google/protobuf/RopeByteStringTest.java \ - java/core/src/test/java/com/google/protobuf/ServiceTest.java \ - java/core/src/test/java/com/google/protobuf/SingleFieldBuilderV3Test.java \ - java/core/src/test/java/com/google/protobuf/SmallSortedMapTest.java \ - java/core/src/test/java/com/google/protobuf/TestBadIdentifiers.java \ - java/core/src/test/java/com/google/protobuf/TestBadIdentifiersLite.java \ - java/core/src/test/java/com/google/protobuf/TestSchemas.java \ - java/core/src/test/java/com/google/protobuf/TestSchemasLite.java \ - java/core/src/test/java/com/google/protobuf/TestUtil.java \ - java/core/src/test/java/com/google/protobuf/TestUtilLite.java \ - java/core/src/test/java/com/google/protobuf/TextFormatParseInfoTreeTest.java \ - java/core/src/test/java/com/google/protobuf/TextFormatParseLocationTest.java \ - java/core/src/test/java/com/google/protobuf/TextFormatTest.java \ - java/core/src/test/java/com/google/protobuf/TypeRegistryTest.java \ - java/core/src/test/java/com/google/protobuf/UnknownEnumValueTest.java \ - java/core/src/test/java/com/google/protobuf/UnknownFieldSetTest.java \ - java/core/src/test/java/com/google/protobuf/UnknownFieldSetPerformanceTest.java \ - java/core/src/test/java/com/google/protobuf/UnmodifiableLazyStringListTest.java \ - java/core/src/test/java/com/google/protobuf/Utf8Test.java \ - java/core/src/test/java/com/google/protobuf/Utf8Utils.java \ - java/core/src/test/java/com/google/protobuf/WellKnownTypesTest.java \ - java/core/src/test/java/com/google/protobuf/WireFormatLiteTest.java \ - java/core/src/test/java/com/google/protobuf/WireFormatTest.java \ - java/core/src/test/java/com/google/protobuf/WrappersLiteOfMethodTest.java \ - java/core/src/test/java/com/google/protobuf/WrappersOfMethodTest.java \ - java/core/src/test/proto/com/google/protobuf/any_test.proto \ - java/core/src/test/proto/com/google/protobuf/cached_field_size_test.proto \ - java/core/src/test/proto/com/google/protobuf/deprecated_file.proto \ - java/core/src/test/proto/com/google/protobuf/field_presence_test.proto \ - java/core/src/test/proto/com/google/protobuf/lazy_fields_lite.proto \ - java/core/src/test/proto/com/google/protobuf/lite_equals_and_hash.proto \ - java/core/src/test/proto/com/google/protobuf/map_for_proto2_lite_test.proto \ - java/core/src/test/proto/com/google/protobuf/map_for_proto2_test.proto \ - java/core/src/test/proto/com/google/protobuf/map_initialization_order_test.proto \ - java/core/src/test/proto/com/google/protobuf/map_lite_test.proto \ - java/core/src/test/proto/com/google/protobuf/map_test.proto \ - java/core/src/test/proto/com/google/protobuf/message_lite_extension_util_test.proto\ - java/core/src/test/proto/com/google/protobuf/multiple_files_test.proto \ - java/core/src/test/proto/com/google/protobuf/nested_builders_test.proto \ - java/core/src/test/proto/com/google/protobuf/nested_extension.proto \ - java/core/src/test/proto/com/google/protobuf/nested_extension_lite.proto \ - java/core/src/test/proto/com/google/protobuf/non_nested_extension.proto \ - java/core/src/test/proto/com/google/protobuf/non_nested_extension_lite.proto \ - java/core/src/test/proto/com/google/protobuf/outer_class_name_test.proto \ - java/core/src/test/proto/com/google/protobuf/outer_class_name_test2.proto \ - java/core/src/test/proto/com/google/protobuf/outer_class_name_test3.proto \ - java/core/src/test/proto/com/google/protobuf/packed_field_test.proto \ - java/core/src/test/proto/com/google/protobuf/proto2_message.proto \ - java/core/src/test/proto/com/google/protobuf/proto2_message_lite.proto \ - java/core/src/test/proto/com/google/protobuf/proto2_unknown_enum_values.proto \ - java/core/src/test/proto/com/google/protobuf/proto3_message.proto \ - java/core/src/test/proto/com/google/protobuf/proto3_message_lite.proto \ - java/core/src/test/proto/com/google/protobuf/test_bad_identifiers.proto \ - java/core/src/test/proto/com/google/protobuf/test_check_utf8.proto \ - java/core/src/test/proto/com/google/protobuf/test_check_utf8_size.proto \ - java/core/src/test/proto/com/google/protobuf/test_custom_options.proto \ - java/core/src/test/proto/com/google/protobuf/wrappers_test.proto \ - java/internal/BUILD \ - java/internal/testing.bzl \ - java/kotlin/generate-sources-build.xml \ - java/kotlin/generate-test-sources-build.xml \ - java/kotlin/pom.xml \ - java/kotlin/src/main/kotlin/com/google/protobuf/ByteStrings.kt \ - java/kotlin/src/main/kotlin/com/google/protobuf/DslList.kt \ - java/kotlin/src/main/kotlin/com/google/protobuf/DslMap.kt \ - java/kotlin/src/main/kotlin/com/google/protobuf/DslProxy.kt \ - java/kotlin/src/main/kotlin/com/google/protobuf/ExtendableMessageExtensions.kt \ - java/kotlin/src/main/kotlin/com/google/protobuf/ExtendableMessageLiteExtensions.kt\ - java/kotlin/src/main/kotlin/com/google/protobuf/ExtensionList.kt \ - java/kotlin/src/main/kotlin/com/google/protobuf/OnlyForUseByGeneratedProtoCode.kt\ - java/kotlin/src/main/kotlin/com/google/protobuf/ProtoDslMarker.kt \ - java/kotlin/src/main/kotlin/com/google/protobuf/UnmodifiableCollections.kt \ - java/kotlin/src/test/kotlin/com/google/protobuf/ByteStringsTest.kt \ - java/kotlin/src/test/kotlin/com/google/protobuf/DslListTest.kt \ - java/kotlin/src/test/kotlin/com/google/protobuf/DslMapTest.kt \ - java/kotlin/src/test/kotlin/com/google/protobuf/ExtendableMessageExtensionsTest.kt\ - java/kotlin/src/test/kotlin/com/google/protobuf/ExtensionListTest.kt \ - java/kotlin/src/test/kotlin/com/google/protobuf/Proto2Test.kt \ - java/kotlin/src/test/kotlin/com/google/protobuf/Proto3Test.kt \ - java/kotlin/src/test/proto/com/google/protobuf/evil_names_proto2.proto \ - java/kotlin/src/test/proto/com/google/protobuf/evil_names_proto3.proto \ - java/kotlin/src/test/proto/com/google/protobuf/example_extensible_message.proto \ - java/kotlin/src/test/proto/com/google/protobuf/multiple_files_proto3.proto \ - java/kotlin-lite/generate-sources-build.xml \ - java/kotlin-lite/generate-test-sources-build.xml \ - java/kotlin-lite/lite.awk \ - java/kotlin-lite/pom.xml \ - java/kotlin-lite/process-lite-sources-build.xml \ - java/kotlin-lite/src/test/kotlin/com/google/protobuf/ExtendableMessageLiteExtensionsTest.kt\ - java/kotlin-lite/src/test/kotlin/com/google/protobuf/Proto2LiteTest.kt \ - java/lite.md \ - java/lite/BUILD \ - java/lite/generate-sources-build.xml \ - java/lite/generate-test-sources-build.xml \ - java/lite/lite.awk \ - java/lite/pom.xml \ - java/lite/pom_template.xml \ - java/lite/process-lite-sources-build.xml \ - java/lite/src/test/java/com/google/protobuf/LiteTest.java \ - java/lite/src/test/java/com/google/protobuf/Proto2MessageLiteInfoFactory.java \ - java/BUILD \ - java/pom.xml \ - java/util/BUILD \ - java/util/pom.xml \ - java/util/pom_template.xml \ - java/util/src/main/java/com/google/protobuf/util/Durations.java \ - java/util/src/main/java/com/google/protobuf/util/FieldMaskTree.java \ - java/util/src/main/java/com/google/protobuf/util/FieldMaskUtil.java \ - java/util/src/main/java/com/google/protobuf/util/JsonFormat.java \ - java/util/src/main/java/com/google/protobuf/util/Structs.java \ - java/util/src/main/java/com/google/protobuf/util/Timestamps.java \ - java/util/src/main/java/com/google/protobuf/util/Values.java \ - java/util/src/test/java/com/google/protobuf/util/FieldMaskTreeTest.java \ - java/util/src/test/java/com/google/protobuf/util/FieldMaskUtilTest.java \ - java/util/src/test/java/com/google/protobuf/util/JsonFormatTest.java \ - java/util/src/test/java/com/google/protobuf/util/StructsTest.java \ - java/util/src/test/java/com/google/protobuf/util/ValuesTest.java \ - java/util/src/test/proto/com/google/protobuf/util/json_test.proto - -objectivec_EXTRA_DIST= \ - objectivec/.clang-format \ - objectivec/BUILD \ - objectivec/DevTools/check_version_stamps.sh \ - objectivec/DevTools/compile_testing_protos.sh \ - objectivec/DevTools/full_mac_build.sh \ - objectivec/DevTools/pddm.py \ - objectivec/DevTools/pddm_tests.py \ - objectivec/generate_well_known_types.sh \ - objectivec/google/protobuf/Any.pbobjc.h \ - objectivec/google/protobuf/Api.pbobjc.h \ - objectivec/google/protobuf/Duration.pbobjc.h \ - objectivec/google/protobuf/Empty.pbobjc.h \ - objectivec/google/protobuf/FieldMask.pbobjc.h \ - objectivec/google/protobuf/SourceContext.pbobjc.h \ - objectivec/google/protobuf/Struct.pbobjc.h \ - objectivec/google/protobuf/Timestamp.pbobjc.h \ - objectivec/google/protobuf/Type.pbobjc.h \ - objectivec/google/protobuf/Wrappers.pbobjc.h \ - objectivec/GPBAny.pbobjc.h \ - objectivec/GPBAny.pbobjc.m \ - objectivec/GPBApi.pbobjc.h \ - objectivec/GPBApi.pbobjc.m \ - objectivec/GPBArray.h \ - objectivec/GPBArray.m \ - objectivec/GPBArray_PackagePrivate.h \ - objectivec/GPBBootstrap.h \ - objectivec/GPBCodedInputStream.h \ - objectivec/GPBCodedInputStream.m \ - objectivec/GPBCodedInputStream_PackagePrivate.h \ - objectivec/GPBCodedOutputStream.h \ - objectivec/GPBCodedOutputStream.m \ - objectivec/GPBCodedOutputStream_PackagePrivate.h \ - objectivec/GPBDescriptor.h \ - objectivec/GPBDescriptor.m \ - objectivec/GPBDescriptor_PackagePrivate.h \ - objectivec/GPBDictionary.h \ - objectivec/GPBDictionary.m \ - objectivec/GPBDictionary_PackagePrivate.h \ - objectivec/GPBDuration.pbobjc.h \ - objectivec/GPBDuration.pbobjc.m \ - objectivec/GPBEmpty.pbobjc.h \ - objectivec/GPBEmpty.pbobjc.m \ - objectivec/GPBExtensionInternals.h \ - objectivec/GPBExtensionInternals.m \ - objectivec/GPBExtensionRegistry.h \ - objectivec/GPBExtensionRegistry.m \ - objectivec/GPBFieldMask.pbobjc.h \ - objectivec/GPBFieldMask.pbobjc.m \ - objectivec/GPBMessage.h \ - objectivec/GPBMessage.m \ - objectivec/GPBMessage_PackagePrivate.h \ - objectivec/GPBProtocolBuffers.h \ - objectivec/GPBProtocolBuffers.m \ - objectivec/GPBProtocolBuffers_RuntimeSupport.h \ - objectivec/GPBRootObject.h \ - objectivec/GPBRootObject.m \ - objectivec/GPBRootObject_PackagePrivate.h \ - objectivec/GPBRuntimeTypes.h \ - objectivec/GPBSourceContext.pbobjc.h \ - objectivec/GPBSourceContext.pbobjc.m \ - objectivec/GPBStruct.pbobjc.h \ - objectivec/GPBStruct.pbobjc.m \ - objectivec/GPBTimestamp.pbobjc.h \ - objectivec/GPBTimestamp.pbobjc.m \ - objectivec/GPBType.pbobjc.h \ - objectivec/GPBType.pbobjc.m \ - objectivec/GPBUnknownField.h \ - objectivec/GPBUnknownField.m \ - objectivec/GPBUnknownField_PackagePrivate.h \ - objectivec/GPBUnknownFieldSet.h \ - objectivec/GPBUnknownFieldSet.m \ - objectivec/GPBUnknownFieldSet_PackagePrivate.h \ - objectivec/GPBUtilities.h \ - objectivec/GPBUtilities.m \ - objectivec/GPBUtilities_PackagePrivate.h \ - objectivec/GPBWellKnownTypes.h \ - objectivec/GPBWellKnownTypes.m \ - objectivec/GPBWireFormat.h \ - objectivec/GPBWireFormat.m \ - objectivec/GPBWrappers.pbobjc.h \ - objectivec/GPBWrappers.pbobjc.m \ - objectivec/ProtocolBuffers_iOS.xcodeproj/project.pbxproj \ - objectivec/ProtocolBuffers_iOS.xcodeproj/project.xcworkspace/contents.xcworkspacedata \ - objectivec/ProtocolBuffers_iOS.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist \ - objectivec/ProtocolBuffers_iOS.xcodeproj/project.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings \ - objectivec/ProtocolBuffers_iOS.xcodeproj/xcshareddata/xcschemes/PerformanceTests.xcscheme \ - objectivec/ProtocolBuffers_iOS.xcodeproj/xcshareddata/xcschemes/ProtocolBuffers.xcscheme \ - objectivec/ProtocolBuffers_OSX.xcodeproj/project.pbxproj \ - objectivec/ProtocolBuffers_OSX.xcodeproj/project.xcworkspace/contents.xcworkspacedata \ - objectivec/ProtocolBuffers_OSX.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist \ - objectivec/ProtocolBuffers_OSX.xcodeproj/project.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings \ - objectivec/ProtocolBuffers_OSX.xcodeproj/xcshareddata/xcschemes/PerformanceTests.xcscheme \ - objectivec/ProtocolBuffers_OSX.xcodeproj/xcshareddata/xcschemes/ProtocolBuffers.xcscheme \ - objectivec/ProtocolBuffers_tvOS.xcodeproj/project.pbxproj \ - objectivec/ProtocolBuffers_tvOS.xcodeproj/project.xcworkspace/contents.xcworkspacedata \ - objectivec/ProtocolBuffers_tvOS.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist \ - objectivec/ProtocolBuffers_tvOS.xcodeproj/project.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings \ - objectivec/ProtocolBuffers_tvOS.xcodeproj/xcshareddata/xcschemes/PerformanceTests.xcscheme \ - objectivec/ProtocolBuffers_tvOS.xcodeproj/xcshareddata/xcschemes/ProtocolBuffers.xcscheme \ - objectivec/README.md \ - objectivec/Tests/CocoaPods/OSXCocoaPodsTester/OSXCocoaPodsTester.xcodeproj/project.pbxproj \ - objectivec/Tests/CocoaPods/OSXCocoaPodsTester/OSXCocoaPodsTester.xcodeproj/project.xcworkspace/contents.xcworkspacedata \ - objectivec/Tests/CocoaPods/OSXCocoaPodsTester/OSXCocoaPodsTester.xcodeproj/xcshareddata/xcschemes/OSXCocoaPodsTester.xcscheme \ - objectivec/Tests/CocoaPods/OSXCocoaPodsTester/OSXCocoaPodsTester/AppDelegate.h \ - objectivec/Tests/CocoaPods/OSXCocoaPodsTester/OSXCocoaPodsTester/AppDelegate.m \ - objectivec/Tests/CocoaPods/OSXCocoaPodsTester/OSXCocoaPodsTester/Assets.xcassets/AppIcon.appiconset/Contents.json \ - objectivec/Tests/CocoaPods/OSXCocoaPodsTester/OSXCocoaPodsTester/Base.lproj/MainMenu.xib \ - objectivec/Tests/CocoaPods/OSXCocoaPodsTester/OSXCocoaPodsTester/Info.plist \ - objectivec/Tests/CocoaPods/OSXCocoaPodsTester/OSXCocoaPodsTester/main.m \ - objectivec/Tests/CocoaPods/OSXCocoaPodsTester/Podfile-framework \ - objectivec/Tests/CocoaPods/OSXCocoaPodsTester/Podfile-static \ - objectivec/Tests/CocoaPods/README.md \ - objectivec/Tests/CocoaPods/iOSCocoaPodsTester/Podfile-framework \ - objectivec/Tests/CocoaPods/iOSCocoaPodsTester/Podfile-static \ - objectivec/Tests/CocoaPods/iOSCocoaPodsTester/iOSCocoaPodsTester.xcodeproj/project.pbxproj \ - objectivec/Tests/CocoaPods/iOSCocoaPodsTester/iOSCocoaPodsTester.xcodeproj/project.xcworkspace/contents.xcworkspacedata \ - objectivec/Tests/CocoaPods/iOSCocoaPodsTester/iOSCocoaPodsTester.xcodeproj/xcshareddata/xcschemes/iOSCocoaPodsTester.xcscheme \ - objectivec/Tests/CocoaPods/iOSCocoaPodsTester/iOSCocoaPodsTester/AppDelegate.h \ - objectivec/Tests/CocoaPods/iOSCocoaPodsTester/iOSCocoaPodsTester/AppDelegate.m \ - objectivec/Tests/CocoaPods/iOSCocoaPodsTester/iOSCocoaPodsTester/Assets.xcassets/AppIcon.appiconset/Contents.json \ - objectivec/Tests/CocoaPods/iOSCocoaPodsTester/iOSCocoaPodsTester/Base.lproj/LaunchScreen.storyboard \ - objectivec/Tests/CocoaPods/iOSCocoaPodsTester/iOSCocoaPodsTester/Base.lproj/Main.storyboard \ - objectivec/Tests/CocoaPods/iOSCocoaPodsTester/iOSCocoaPodsTester/Info.plist \ - objectivec/Tests/CocoaPods/iOSCocoaPodsTester/iOSCocoaPodsTester/ViewController.h \ - objectivec/Tests/CocoaPods/iOSCocoaPodsTester/iOSCocoaPodsTester/ViewController.m \ - objectivec/Tests/CocoaPods/iOSCocoaPodsTester/iOSCocoaPodsTester/main.m \ - objectivec/Tests/CocoaPods/run_tests.sh \ - objectivec/Tests/golden_message \ - objectivec/Tests/golden_packed_fields_message \ - objectivec/Tests/GPBARCUnittestProtos.m \ - objectivec/Tests/GPBArrayTests.m \ - objectivec/Tests/GPBCodedInputStreamTests.m \ - objectivec/Tests/GPBCodedOuputStreamTests.m \ - objectivec/Tests/GPBCompileTest01.m \ - objectivec/Tests/GPBCompileTest02.m \ - objectivec/Tests/GPBCompileTest03.m \ - objectivec/Tests/GPBCompileTest04.m \ - objectivec/Tests/GPBCompileTest05.m \ - objectivec/Tests/GPBCompileTest06.m \ - objectivec/Tests/GPBCompileTest07.m \ - objectivec/Tests/GPBCompileTest08.m \ - objectivec/Tests/GPBCompileTest09.m \ - objectivec/Tests/GPBCompileTest10.m \ - objectivec/Tests/GPBCompileTest11.m \ - objectivec/Tests/GPBCompileTest12.m \ - objectivec/Tests/GPBCompileTest13.m \ - objectivec/Tests/GPBCompileTest14.m \ - objectivec/Tests/GPBCompileTest15.m \ - objectivec/Tests/GPBCompileTest16.m \ - objectivec/Tests/GPBCompileTest17.m \ - objectivec/Tests/GPBCompileTest18.m \ - objectivec/Tests/GPBCompileTest19.m \ - objectivec/Tests/GPBCompileTest20.m \ - objectivec/Tests/GPBCompileTest21.m \ - objectivec/Tests/GPBCompileTest22.m \ - objectivec/Tests/GPBCompileTest23.m \ - objectivec/Tests/GPBCompileTest24.m \ - objectivec/Tests/GPBCompileTest25.m \ - objectivec/Tests/GPBConcurrencyTests.m \ - objectivec/Tests/GPBDescriptorTests.m \ - objectivec/Tests/GPBDictionaryTests+Bool.m \ - objectivec/Tests/GPBDictionaryTests+Int32.m \ - objectivec/Tests/GPBDictionaryTests+Int64.m \ - objectivec/Tests/GPBDictionaryTests+String.m \ - objectivec/Tests/GPBDictionaryTests+UInt32.m \ - objectivec/Tests/GPBDictionaryTests+UInt64.m \ - objectivec/Tests/GPBDictionaryTests.m \ - objectivec/Tests/GPBDictionaryTests.pddm \ - objectivec/Tests/GPBExtensionRegistryTest.m \ - objectivec/Tests/GPBMessageTests+ClassNames.m \ - objectivec/Tests/GPBMessageTests+Merge.m \ - objectivec/Tests/GPBMessageTests+Runtime.m \ - objectivec/Tests/GPBMessageTests+Serialization.m \ - objectivec/Tests/GPBMessageTests.m \ - objectivec/Tests/GPBObjectiveCPlusPlusTest.mm \ - objectivec/Tests/GPBPerfTests.m \ - objectivec/Tests/GPBSwiftTests.swift \ - objectivec/Tests/GPBTestUtilities.h \ - objectivec/Tests/GPBTestUtilities.m \ - objectivec/Tests/GPBUnittestProtos.m \ - objectivec/Tests/GPBUnittestProtos2.m \ - objectivec/Tests/GPBUnknownFieldSetTest.m \ - objectivec/Tests/GPBUtilitiesTests.m \ - objectivec/Tests/GPBWellKnownTypesTest.m \ - objectivec/Tests/GPBWireFormatTests.m \ - objectivec/Tests/text_format_extensions_unittest_data.txt \ - objectivec/Tests/text_format_map_unittest_data.txt \ - objectivec/Tests/text_format_unittest_data.txt \ - objectivec/Tests/unittest_cycle.proto \ - objectivec/Tests/unittest_deprecated.proto \ - objectivec/Tests/unittest_deprecated_file.proto \ - objectivec/Tests/unittest_extension_chain_a.proto \ - objectivec/Tests/unittest_extension_chain_b.proto \ - objectivec/Tests/unittest_extension_chain_c.proto \ - objectivec/Tests/unittest_extension_chain_d.proto \ - objectivec/Tests/unittest_extension_chain_e.proto \ - objectivec/Tests/unittest_extension_chain_f.proto \ - objectivec/Tests/unittest_extension_chain_g.proto \ - objectivec/Tests/unittest_objc.proto \ - objectivec/Tests/unittest_objc_options.proto \ - objectivec/Tests/unittest_objc_startup.proto \ - objectivec/Tests/unittest_runtime_proto2.proto \ - objectivec/Tests/unittest_runtime_proto3.proto \ - objectivec/Tests/UnitTests-Bridging-Header.h \ - objectivec/Tests/UnitTests-Info.plist \ - Protobuf.podspec - -php_EXTRA_DIST= \ - composer.json \ - php/README.md \ - php/REFCOUNTING.md \ - php/composer.json \ - php/ext/google/protobuf/arena.c \ - php/ext/google/protobuf/arena.h \ - php/ext/google/protobuf/array.c \ - php/ext/google/protobuf/array.h \ - php/ext/google/protobuf/config.m4 \ - php/ext/google/protobuf/convert.c \ - php/ext/google/protobuf/convert.h \ - php/ext/google/protobuf/def.c \ - php/ext/google/protobuf/def.h \ - php/ext/google/protobuf/map.c \ - php/ext/google/protobuf/map.h \ - php/ext/google/protobuf/message.c \ - php/ext/google/protobuf/message.h \ - php/ext/google/protobuf/names.c \ - php/ext/google/protobuf/names.h \ - php/ext/google/protobuf/package.xml \ - php/ext/google/protobuf/php-upb.c \ - php/ext/google/protobuf/php-upb.h \ - php/ext/google/protobuf/protobuf.c \ - php/ext/google/protobuf/protobuf.h \ - php/ext/google/protobuf/wkt.inc \ - php/generate_descriptor_protos.sh \ - php/generate_test_protos.sh \ - php/release.sh \ - php/src/GPBMetadata/Google/Protobuf/Any.php \ - php/src/GPBMetadata/Google/Protobuf/Api.php \ - php/src/GPBMetadata/Google/Protobuf/Duration.php \ - php/src/GPBMetadata/Google/Protobuf/FieldMask.php \ - php/src/GPBMetadata/Google/Protobuf/GPBEmpty.php \ - php/src/GPBMetadata/Google/Protobuf/Internal/Descriptor.php \ - php/src/GPBMetadata/Google/Protobuf/SourceContext.php \ - php/src/GPBMetadata/Google/Protobuf/Struct.php \ - php/src/GPBMetadata/Google/Protobuf/Timestamp.php \ - php/src/GPBMetadata/Google/Protobuf/Type.php \ - php/src/GPBMetadata/Google/Protobuf/Wrappers.php \ - php/src/Google/Protobuf/Any.php \ - php/src/Google/Protobuf/Api.php \ - php/src/Google/Protobuf/BoolValue.php \ - php/src/Google/Protobuf/BytesValue.php \ - php/src/Google/Protobuf/Descriptor.php \ - php/src/Google/Protobuf/DescriptorPool.php \ - php/src/Google/Protobuf/DoubleValue.php \ - php/src/Google/Protobuf/Duration.php \ - php/src/Google/Protobuf/Enum.php \ - php/src/Google/Protobuf/EnumDescriptor.php \ - php/src/Google/Protobuf/EnumValue.php \ - php/src/Google/Protobuf/EnumValueDescriptor.php \ - php/src/Google/Protobuf/Field.php \ - php/src/Google/Protobuf/FieldDescriptor.php \ - php/src/Google/Protobuf/FieldMask.php \ - php/src/Google/Protobuf/Field/Cardinality.php \ - php/src/Google/Protobuf/Field_Cardinality.php \ - php/src/Google/Protobuf/Field/Kind.php \ - php/src/Google/Protobuf/Field_Kind.php \ - php/src/Google/Protobuf/FloatValue.php \ - php/src/Google/Protobuf/GPBEmpty.php \ - php/src/Google/Protobuf/Int32Value.php \ - php/src/Google/Protobuf/Int64Value.php \ - php/src/Google/Protobuf/Internal/AnyBase.php \ - php/src/Google/Protobuf/Internal/CodedInputStream.php \ - php/src/Google/Protobuf/Internal/CodedOutputStream.php \ - php/src/Google/Protobuf/Internal/Descriptor.php \ - php/src/Google/Protobuf/Internal/DescriptorPool.php \ - php/src/Google/Protobuf/Internal/DescriptorProto.php \ - php/src/Google/Protobuf/Internal/DescriptorProto/ExtensionRange.php \ - php/src/Google/Protobuf/Internal/DescriptorProto/ReservedRange.php \ - php/src/Google/Protobuf/Internal/EnumBuilderContext.php \ - php/src/Google/Protobuf/Internal/EnumDescriptor.php \ - php/src/Google/Protobuf/Internal/EnumDescriptorProto.php \ - php/src/Google/Protobuf/Internal/EnumDescriptorProto/EnumReservedRange.php \ - php/src/Google/Protobuf/Internal/EnumOptions.php \ - php/src/Google/Protobuf/Internal/EnumValueDescriptorProto.php \ - php/src/Google/Protobuf/Internal/EnumValueOptions.php \ - php/src/Google/Protobuf/Internal/ExtensionRangeOptions.php \ - php/src/Google/Protobuf/Internal/FieldDescriptorProto.php \ - php/src/Google/Protobuf/Internal/FieldDescriptor.php \ - php/src/Google/Protobuf/Internal/FieldDescriptorProto.php \ - php/src/Google/Protobuf/Internal/FieldDescriptorProto/Label.php \ - php/src/Google/Protobuf/Internal/FieldDescriptorProto/Type.php \ - php/src/Google/Protobuf/Internal/FieldOptions.php \ - php/src/Google/Protobuf/Internal/FieldOptions/CType.php \ - php/src/Google/Protobuf/Internal/FieldOptions/JSType.php \ - php/src/Google/Protobuf/Internal/FileDescriptor.php \ - php/src/Google/Protobuf/Internal/FileDescriptorProto.php \ - php/src/Google/Protobuf/Internal/FileDescriptorSet.php \ - php/src/Google/Protobuf/Internal/FileOptions.php \ - php/src/Google/Protobuf/Internal/FileOptions/OptimizeMode.php \ - php/src/Google/Protobuf/Internal/GPBDecodeException.php \ - php/src/Google/Protobuf/Internal/GPBJsonWire.php \ - php/src/Google/Protobuf/Internal/GPBLabel.php \ - php/src/Google/Protobuf/Internal/GPBType.php \ - php/src/Google/Protobuf/Internal/GPBUtil.php \ - php/src/Google/Protobuf/Internal/GPBWire.php \ - php/src/Google/Protobuf/Internal/GPBWireType.php \ - php/src/Google/Protobuf/Internal/GeneratedCodeInfo.php \ - php/src/Google/Protobuf/Internal/GeneratedCodeInfo/Annotation.php \ - php/src/Google/Protobuf/Internal/GetPublicDescriptorTrait.php \ - php/src/Google/Protobuf/Internal/HasPublicDescriptorTrait.php \ - php/src/Google/Protobuf/Internal/MapEntry.php \ - php/src/Google/Protobuf/Internal/MapField.php \ - php/src/Google/Protobuf/Internal/MapFieldIter.php \ - php/src/Google/Protobuf/Internal/Message.php \ - php/src/Google/Protobuf/Internal/MessageBuilderContext.php \ - php/src/Google/Protobuf/Internal/MessageOptions.php \ - php/src/Google/Protobuf/Internal/MethodDescriptorProto.php \ - php/src/Google/Protobuf/Internal/MethodOptions.php \ - php/src/Google/Protobuf/Internal/MethodOptions/IdempotencyLevel.php \ - php/src/Google/Protobuf/Internal/OneofDescriptor.php \ - php/src/Google/Protobuf/Internal/OneofDescriptorProto.php \ - php/src/Google/Protobuf/Internal/OneofField.php \ - php/src/Google/Protobuf/Internal/OneofOptions.php \ - php/src/Google/Protobuf/Internal/RawInputStream.php \ - php/src/Google/Protobuf/Internal/RepeatedField.php \ - php/src/Google/Protobuf/Internal/RepeatedFieldIter.php \ - php/src/Google/Protobuf/Internal/ServiceDescriptorProto.php \ - php/src/Google/Protobuf/Internal/ServiceOptions.php \ - php/src/Google/Protobuf/Internal/SourceCodeInfo.php \ - php/src/Google/Protobuf/Internal/SourceCodeInfo/Location.php \ - php/src/Google/Protobuf/Internal/TimestampBase.php \ - php/src/Google/Protobuf/Internal/UninterpretedOption.php \ - php/src/Google/Protobuf/Internal/UninterpretedOption/NamePart.php \ - php/src/Google/Protobuf/Internal/DescriptorProto_ExtensionRange.php \ - php/src/Google/Protobuf/Internal/DescriptorProto_ReservedRange.php \ - php/src/Google/Protobuf/Internal/EnumDescriptorProto_EnumReservedRange.php \ - php/src/Google/Protobuf/Internal/FieldDescriptorProto_Label.php \ - php/src/Google/Protobuf/Internal/FieldDescriptorProto_Type.php \ - php/src/Google/Protobuf/Internal/FieldOptions_CType.php \ - php/src/Google/Protobuf/Internal/FieldOptions_JSType.php \ - php/src/Google/Protobuf/Internal/FileOptions_OptimizeMode.php \ - php/src/Google/Protobuf/Internal/GeneratedCodeInfo_Annotation.php \ - php/src/Google/Protobuf/Internal/MethodOptions_IdempotencyLevel.php \ - php/src/Google/Protobuf/Internal/SourceCodeInfo_Location.php \ - php/src/Google/Protobuf/Internal/UninterpretedOption_NamePart.php \ - php/src/Google/Protobuf/ListValue.php \ - php/src/Google/Protobuf/Method.php \ - php/src/Google/Protobuf/Mixin.php \ - php/src/Google/Protobuf/NullValue.php \ - php/src/Google/Protobuf/OneofDescriptor.php \ - php/src/Google/Protobuf/Option.php \ - php/src/Google/Protobuf/SourceContext.php \ - php/src/Google/Protobuf/StringValue.php \ - php/src/Google/Protobuf/Struct.php \ - php/src/Google/Protobuf/Syntax.php \ - php/src/Google/Protobuf/Timestamp.php \ - php/src/Google/Protobuf/Type.php \ - php/src/Google/Protobuf/UInt32Value.php \ - php/src/Google/Protobuf/UInt64Value.php \ - php/src/Google/Protobuf/Value.php \ - php/src/phpdoc.dist.xml \ - php/tests/ArrayTest.php \ - php/tests/compatibility_test.sh \ - php/tests/compile_extension.sh \ - php/tests/DescriptorsTest.php \ - php/tests/EncodeDecodeTest.php \ - php/tests/force_c_ext.php \ - php/tests/gdb_test.sh \ - php/tests/GeneratedClassTest.php \ - php/tests/GeneratedPhpdocTest.php \ - php/tests/GeneratedServiceTest.php \ - php/tests/MapFieldTest.php \ - php/tests/memory_leak_test.php \ - php/tests/memory_leak_test.sh \ - php/tests/multirequest.php \ - php/tests/multirequest.sh \ - php/tests/PhpImplementationTest.php \ - php/tests/proto/empty/echo.proto \ - php/tests/proto/test.proto \ - php/tests/proto/test_descriptors.proto \ - php/tests/proto/test_empty_php_namespace.proto \ - php/tests/proto/test_import_descriptor_proto.proto \ - php/tests/proto/test_include.proto \ - php/tests/proto/test_no_namespace.proto \ - php/tests/proto/test_php_namespace.proto \ - php/tests/proto/test_prefix.proto \ - php/tests/proto/test_reserved_enum_lower.proto \ - php/tests/proto/test_reserved_enum_upper.proto \ - php/tests/proto/test_reserved_enum_value_lower.proto \ - php/tests/proto/test_reserved_enum_value_upper.proto \ - php/tests/proto/test_reserved_message_lower.proto \ - php/tests/proto/test_reserved_message_upper.proto \ - php/tests/proto/test_service.proto \ - php/tests/proto/test_service_namespace.proto \ - php/tests/proto/test_wrapper_type_setters.proto \ - php/tests/test_base.php \ - php/tests/test_util.php \ - php/tests/valgrind.supp \ - php/tests/WellKnownTest.php \ - php/tests/WrapperTypeSettersTest.php - -python_EXTRA_DIST= \ - python/MANIFEST.in \ - python/google/__init__.py \ - python/google/protobuf/__init__.py \ - python/google/protobuf/compiler/__init__.py \ - python/google/protobuf/descriptor.py \ - python/google/protobuf/descriptor_database.py \ - python/google/protobuf/descriptor_pool.py \ - python/google/protobuf/internal/__init__.py \ - python/google/protobuf/internal/_parameterized.py \ - python/google/protobuf/internal/any_test.proto \ - python/google/protobuf/internal/any_test.proto \ - python/google/protobuf/internal/api_implementation.cc \ - python/google/protobuf/internal/api_implementation.py \ - python/google/protobuf/internal/containers.py \ - python/google/protobuf/internal/decoder.py \ - python/google/protobuf/internal/descriptor_database_test.py \ - python/google/protobuf/internal/descriptor_pool_test.py \ - python/google/protobuf/internal/descriptor_pool_test1.proto \ - python/google/protobuf/internal/descriptor_pool_test2.proto \ - python/google/protobuf/internal/descriptor_test.py \ - python/google/protobuf/internal/encoder.py \ - python/google/protobuf/internal/enum_type_wrapper.py \ - python/google/protobuf/internal/extension_dict.py \ - python/google/protobuf/internal/factory_test1.proto \ - python/google/protobuf/internal/factory_test2.proto \ - python/google/protobuf/internal/file_options_test.proto \ - python/google/protobuf/internal/generator_test.py \ - python/google/protobuf/internal/import_test_package/__init__.py \ - python/google/protobuf/internal/import_test_package/inner.proto \ - python/google/protobuf/internal/import_test_package/outer.proto \ - python/google/protobuf/internal/json_format_test.py \ - python/google/protobuf/internal/keywords_test.py \ - python/google/protobuf/internal/message_factory_test.py \ - python/google/protobuf/internal/message_listener.py \ - python/google/protobuf/internal/message_set_extensions.proto \ - python/google/protobuf/internal/message_test.py \ - python/google/protobuf/internal/missing_enum_values.proto \ - python/google/protobuf/internal/more_extensions.proto \ - python/google/protobuf/internal/more_extensions_dynamic.proto \ - python/google/protobuf/internal/more_messages.proto \ - python/google/protobuf/internal/no_package.proto \ - python/google/protobuf/internal/packed_field_test.proto \ - python/google/protobuf/internal/proto_builder_test.py \ - python/google/protobuf/internal/python_message.py \ - python/google/protobuf/internal/python_protobuf.cc \ - python/google/protobuf/internal/reflection_test.py \ - python/google/protobuf/internal/service_reflection_test.py \ - python/google/protobuf/internal/symbol_database_test.py \ - python/google/protobuf/internal/test_bad_identifiers.proto \ - python/google/protobuf/internal/test_proto3_optional.proto \ - python/google/protobuf/internal/test_util.py \ - python/google/protobuf/internal/testing_refleaks.py \ - python/google/protobuf/internal/text_encoding_test.py \ - python/google/protobuf/internal/text_format_test.py \ - python/google/protobuf/internal/type_checkers.py \ - python/google/protobuf/internal/unknown_fields_test.py \ - python/google/protobuf/internal/well_known_types.py \ - python/google/protobuf/internal/well_known_types.py \ - python/google/protobuf/internal/well_known_types_test.py \ - python/google/protobuf/internal/well_known_types_test.py \ - python/google/protobuf/internal/wire_format.py \ - python/google/protobuf/internal/wire_format_test.py \ - python/google/protobuf/json_format.py \ - python/google/protobuf/message.py \ - python/google/protobuf/message_factory.py \ - python/google/protobuf/proto_api.h \ - python/google/protobuf/proto_builder.py \ - python/google/protobuf/pyext/README \ - python/google/protobuf/pyext/__init__.py \ - python/google/protobuf/pyext/cpp_message.py \ - python/google/protobuf/pyext/descriptor.cc \ - python/google/protobuf/pyext/descriptor.h \ - python/google/protobuf/pyext/descriptor_containers.cc \ - python/google/protobuf/pyext/descriptor_containers.h \ - python/google/protobuf/pyext/descriptor_database.cc \ - python/google/protobuf/pyext/descriptor_database.h \ - python/google/protobuf/pyext/descriptor_pool.cc \ - python/google/protobuf/pyext/descriptor_pool.h \ - python/google/protobuf/pyext/extension_dict.cc \ - python/google/protobuf/pyext/extension_dict.h \ - python/google/protobuf/pyext/map_container.cc \ - python/google/protobuf/pyext/map_container.h \ - python/google/protobuf/pyext/message.cc \ - python/google/protobuf/pyext/message.h \ - python/google/protobuf/pyext/field.cc \ - python/google/protobuf/pyext/field.h \ - python/google/protobuf/pyext/unknown_fields.cc \ - python/google/protobuf/pyext/unknown_fields.h \ - python/google/protobuf/pyext/message_factory.cc \ - python/google/protobuf/pyext/message_factory.h \ - python/google/protobuf/pyext/message_module.cc \ - python/google/protobuf/pyext/proto2_api_test.proto \ - python/google/protobuf/pyext/python.proto \ - python/google/protobuf/pyext/repeated_composite_container.cc \ - python/google/protobuf/pyext/repeated_composite_container.h \ - python/google/protobuf/pyext/repeated_scalar_container.cc \ - python/google/protobuf/pyext/repeated_scalar_container.h \ - python/google/protobuf/pyext/safe_numerics.h \ - python/google/protobuf/pyext/scoped_pyobject_ptr.h \ - python/google/protobuf/python_protobuf.h \ - python/google/protobuf/reflection.py \ - python/google/protobuf/service.py \ - python/google/protobuf/service_reflection.py \ - python/google/protobuf/symbol_database.py \ - python/google/protobuf/text_encoding.py \ - python/google/protobuf/text_format.py \ - python/google/protobuf/util/__init__.py \ - python/release.sh \ - python/mox.py \ - python/setup.cfg \ - python/setup.py \ - python/stubout.py \ - python/tox.ini \ - python/README.md - -ruby_EXTRA_DIST= \ - ruby/Gemfile \ - ruby/.gitignore \ - ruby/README.md \ - ruby/Rakefile \ - ruby/compatibility_tests/v3.0.0/tests/test_import.proto \ - ruby/compatibility_tests/v3.0.0/tests/stress.rb \ - ruby/compatibility_tests/v3.0.0/tests/repeated_field_test.rb \ - ruby/compatibility_tests/v3.0.0/tests/generated_code_test.rb \ - ruby/compatibility_tests/v3.0.0/tests/generated_code.proto \ - ruby/compatibility_tests/v3.0.0/tests/basic.rb \ - ruby/compatibility_tests/v3.0.0/test.sh \ - ruby/compatibility_tests/v3.0.0/Rakefile \ - ruby/compatibility_tests/v3.0.0/README.md \ - ruby/ext/google/protobuf_c/convert.c \ - ruby/ext/google/protobuf_c/convert.h \ - ruby/ext/google/protobuf_c/defs.c \ - ruby/ext/google/protobuf_c/defs.h \ - ruby/ext/google/protobuf_c/extconf.rb \ - ruby/ext/google/protobuf_c/map.c \ - ruby/ext/google/protobuf_c/map.h \ - ruby/ext/google/protobuf_c/message.c \ - ruby/ext/google/protobuf_c/message.h \ - ruby/ext/google/protobuf_c/protobuf.c \ - ruby/ext/google/protobuf_c/protobuf.h \ - ruby/ext/google/protobuf_c/repeated_field.c \ - ruby/ext/google/protobuf_c/repeated_field.h \ - ruby/ext/google/protobuf_c/ruby-upb.c \ - ruby/ext/google/protobuf_c/ruby-upb.h \ - ruby/ext/google/protobuf_c/wrap_memcpy.c \ - ruby/google-protobuf.gemspec \ - ruby/lib/google/protobuf/descriptor_dsl.rb \ - ruby/lib/google/protobuf/message_exts.rb \ - ruby/lib/google/protobuf/repeated_field.rb \ - ruby/lib/google/protobuf/well_known_types.rb \ - ruby/lib/google/protobuf.rb \ - ruby/pom.xml \ - ruby/src/main/java/com/google/protobuf/jruby/RubyDescriptor.java \ - ruby/src/main/java/com/google/protobuf/jruby/RubyDescriptorPool.java \ - ruby/src/main/java/com/google/protobuf/jruby/RubyEnum.java \ - ruby/src/main/java/com/google/protobuf/jruby/RubyEnumDescriptor.java \ - ruby/src/main/java/com/google/protobuf/jruby/RubyFieldDescriptor.java \ - ruby/src/main/java/com/google/protobuf/jruby/RubyFileDescriptor.java \ - ruby/src/main/java/com/google/protobuf/jruby/RubyMap.java \ - ruby/src/main/java/com/google/protobuf/jruby/RubyMessage.java \ - ruby/src/main/java/com/google/protobuf/jruby/RubyOneofDescriptor.java \ - ruby/src/main/java/com/google/protobuf/jruby/RubyProtobuf.java \ - ruby/src/main/java/com/google/protobuf/jruby/RubyRepeatedField.java \ - ruby/src/main/java/com/google/protobuf/jruby/SentinelOuterClass.java \ - ruby/src/main/java/com/google/protobuf/jruby/Utils.java \ - ruby/src/main/java/google/ProtobufJavaService.java \ - ruby/src/main/sentinel.proto \ - ruby/tests/basic_proto2.rb \ - ruby/tests/basic_test_proto2.proto \ - ruby/tests/basic_test.proto \ - ruby/tests/basic.rb \ - ruby/tests/common_tests.rb \ - ruby/tests/encode_decode_test.rb \ - ruby/tests/gc_test.rb \ - ruby/tests/repeated_field_test.rb \ - ruby/tests/stress.rb \ - ruby/tests/generated_code_proto2_test.rb \ - ruby/tests/generated_code_proto2.proto \ - ruby/tests/generated_code.proto \ - ruby/tests/multi_level_nesting_test.proto \ - ruby/tests/multi_level_nesting_test.rb \ - ruby/tests/test_import_proto2.proto \ - ruby/tests/test_import.proto \ - ruby/tests/test_ruby_package_proto2.proto \ - ruby/tests/test_ruby_package.proto \ - ruby/tests/generated_code_test.rb \ - ruby/tests/well_known_types_test.rb \ - ruby/tests/type_errors.rb \ - ruby/travis-test.sh - -js_EXTRA_DIST= \ - js/README.md \ - js/binary/arith.js \ - js/binary/arith_test.js \ - js/binary/constants.js \ - js/binary/decoder.js \ - js/binary/decoder_test.js \ - js/binary/encoder.js \ - js/binary/message_test.js \ - js/binary/proto_test.js \ - js/binary/reader.js \ - js/binary/reader_test.js \ - js/binary/utils.js \ - js/binary/utils_test.js \ - js/binary/writer.js \ - js/binary/writer_test.js \ - js/commonjs/export.js \ - js/commonjs/export_asserts.js \ - js/commonjs/export_testdeps.js \ - js/commonjs/import_test.js \ - js/commonjs/jasmine.json \ - js/commonjs/rewrite_tests_for_commonjs.js \ - js/commonjs/strict_test.js \ - js/commonjs/test6/test6.proto \ - js/commonjs/test7/test7.proto \ - js/compatibility_tests/v3.0.0/binary/arith_test.js \ - js/compatibility_tests/v3.0.0/binary/decoder_test.js \ - js/compatibility_tests/v3.0.0/binary/proto_test.js \ - js/compatibility_tests/v3.0.0/binary/reader_test.js \ - js/compatibility_tests/v3.0.0/binary/utils_test.js \ - js/compatibility_tests/v3.0.0/binary/writer_test.js \ - js/compatibility_tests/v3.0.0/commonjs/export_asserts.js \ - js/compatibility_tests/v3.0.0/commonjs/export_testdeps.js \ - js/compatibility_tests/v3.0.0/commonjs/import_test.js \ - js/compatibility_tests/v3.0.0/commonjs/jasmine.json \ - js/compatibility_tests/v3.0.0/commonjs/rewrite_tests_for_commonjs.js \ - js/compatibility_tests/v3.0.0/commonjs/test6/test6.proto \ - js/compatibility_tests/v3.0.0/commonjs/test7/test7.proto \ - js/compatibility_tests/v3.0.0/data.proto \ - js/compatibility_tests/v3.0.0/debug_test.js \ - js/compatibility_tests/v3.0.0/jasmine1.json \ - js/compatibility_tests/v3.0.0/jasmine2.json \ - js/compatibility_tests/v3.0.0/jasmine3.json \ - js/compatibility_tests/v3.0.0/message_test.js \ - js/compatibility_tests/v3.0.0/proto3_test.js \ - js/compatibility_tests/v3.0.0/proto3_test.proto \ - js/compatibility_tests/v3.0.0/test2.proto \ - js/compatibility_tests/v3.0.0/test3.proto \ - js/compatibility_tests/v3.0.0/test4.proto \ - js/compatibility_tests/v3.0.0/test5.proto \ - js/compatibility_tests/v3.0.0/testbinary.proto \ - js/compatibility_tests/v3.0.0/testempty.proto \ - js/compatibility_tests/v3.0.0/test.proto \ - js/compatibility_tests/v3.0.0/test.sh \ - js/compatibility_tests/v3.1.0/testempty.proto \ - js/compatibility_tests/v3.1.0/testbinary.proto \ - js/compatibility_tests/v3.1.0/test5.proto \ - js/compatibility_tests/v3.1.0/test4.proto \ - js/compatibility_tests/v3.1.0/test3.proto \ - js/compatibility_tests/v3.1.0/test2.proto \ - js/compatibility_tests/v3.1.0/test.proto \ - js/compatibility_tests/v3.1.0/proto3_test.proto \ - js/compatibility_tests/v3.1.0/proto3_test.js \ - js/compatibility_tests/v3.1.0/message_test.js \ - js/compatibility_tests/v3.1.0/maps_test.js \ - js/compatibility_tests/v3.1.0/debug_test.js \ - js/compatibility_tests/v3.1.0/data.proto \ - js/compatibility_tests/v3.1.0/commonjs/test7/test7.proto \ - js/compatibility_tests/v3.1.0/commonjs/test6/test6.proto \ - js/compatibility_tests/v3.1.0/binary/writer_test.js \ - js/compatibility_tests/v3.1.0/binary/utils_test.js \ - js/compatibility_tests/v3.1.0/binary/reader_test.js \ - js/compatibility_tests/v3.1.0/binary/proto_test.js \ - js/compatibility_tests/v3.1.0/binary/decoder_test.js \ - js/compatibility_tests/v3.1.0/binary/arith_test.js \ - js/data.proto \ - js/debug.js \ - js/debug_test.js \ - js/experimental/runtime/kernel/message_set.js \ - js/experimental/runtime/kernel/message_set_test.js \ - js/experimental/runtime/kernel/tag.js \ - js/experimental/runtime/kernel/tag_test.js \ - js/gulpfile.js \ - js/jasmine.json \ - js/map.js \ - js/maps_test.js \ - js/message.js \ - js/message_test.js \ - js/node_loader.js \ - js/package.json \ - js/proto3_test.js \ - js/proto3_test.proto \ - js/test.proto \ - js/test2.proto \ - js/test3.proto \ - js/test4.proto \ - js/test5.proto \ - js/test8.proto \ - js/test9.proto \ - js/test10.proto \ - js/test11.proto \ - js/test12.proto \ - js/test13.proto \ - js/test14.proto \ - js/test15.proto \ - js/test_bootstrap.js \ - js/testbinary.proto \ - js/testempty.proto \ - js/testlargenumbers.proto \ - js/experimental/runtime/testing/jasmine_protobuf.js \ - js/experimental/runtime/testing/ensure_custom_equality_test.js \ - js/experimental/runtime/testing/binary/test_message.js \ - js/experimental/runtime/kernel/writer_test.js \ - js/experimental/runtime/kernel/writer.js \ - js/experimental/runtime/kernel/wire_type.js \ - js/experimental/runtime/kernel/uint8arrays_test.js \ - js/experimental/runtime/kernel/uint8arrays.js \ - js/experimental/runtime/kernel/uint32_test_pairs.js \ - js/experimental/runtime/kernel/typed_arrays_test.js \ - js/experimental/runtime/kernel/typed_arrays.js \ - js/experimental/runtime/kernel/textencoding_test.js \ - js/experimental/runtime/kernel/textencoding.js \ - js/experimental/runtime/kernel/storage.js \ - js/experimental/runtime/kernel/sint64_test_pairs.js \ - js/experimental/runtime/kernel/sint32_test_pairs.js \ - js/experimental/runtime/kernel/sfixed64_test_pairs.js \ - js/experimental/runtime/kernel/sfixed32_test_pairs.js \ - js/experimental/runtime/kernel/reader_test.js \ - js/experimental/runtime/kernel/reader.js \ - js/experimental/runtime/kernel/packed_uint32_test_pairs.js \ - js/experimental/runtime/kernel/packed_sint64_test_pairs.js \ - js/experimental/runtime/kernel/packed_sint32_test_pairs.js \ - js/experimental/runtime/kernel/packed_sfixed64_test_pairs.js \ - js/experimental/runtime/kernel/packed_sfixed32_test_pairs.js \ - js/experimental/runtime/kernel/packed_int64_test_pairs.js \ - js/experimental/runtime/kernel/packed_int32_test_pairs.js \ - js/experimental/runtime/kernel/packed_float_test_pairs.js \ - js/experimental/runtime/kernel/packed_fixed32_test_pairs.js \ - js/experimental/runtime/kernel/packed_double_test_pairs.js \ - js/experimental/runtime/kernel/packed_bool_test_pairs.js \ - js/experimental/runtime/kernel/kernel_test.js \ - js/experimental/runtime/kernel/kernel_repeated_test.js \ - js/experimental/runtime/kernel/kernel_compatibility_test.js \ - js/experimental/runtime/kernel/kernel.js \ - js/experimental/runtime/kernel/internal_message.js \ - js/experimental/runtime/kernel/int64_test_pairs.js \ - js/experimental/runtime/kernel/int32_test_pairs.js \ - js/experimental/runtime/kernel/indexer_test.js \ - js/experimental/runtime/kernel/indexer.js \ - js/experimental/runtime/kernel/float_test_pairs.js \ - js/experimental/runtime/kernel/fixed32_test_pairs.js \ - js/experimental/runtime/kernel/field.js \ - js/experimental/runtime/kernel/double_test_pairs.js \ - js/experimental/runtime/kernel/conformance/wire_format.js \ - js/experimental/runtime/kernel/conformance/test_all_types_proto3.js \ - js/experimental/runtime/kernel/conformance/test_all_types_proto2.js \ - js/experimental/runtime/kernel/conformance/conformance_testee_runner_node.js \ - js/experimental/runtime/kernel/conformance/conformance_testee.js \ - js/experimental/runtime/kernel/conformance/conformance_response.js \ - js/experimental/runtime/kernel/conformance/conformance_request.js \ - js/experimental/runtime/kernel/buffer_decoder_test.js \ - js/experimental/runtime/kernel/buffer_decoder_helper.js \ - js/experimental/runtime/kernel/buffer_decoder.js \ - js/experimental/runtime/kernel/bool_test_pairs.js \ - js/experimental/runtime/kernel/binary_storage_test.js \ - js/experimental/runtime/kernel/binary_storage.js \ - js/experimental/runtime/internal/checks_test.js \ - js/experimental/runtime/internal/checks.js \ - js/experimental/runtime/int64_test.js \ - js/experimental/runtime/int64.js \ - js/experimental/runtime/bytestring_test.js \ - js/experimental/runtime/bytestring_internal.js \ - js/experimental/runtime/bytestring.js \ - js/experimental/benchmarks/code_size/kernel/popular_types.js \ - js/experimental/benchmarks/code_size/kernel/all_types.js \ - js/experimental/benchmarks/code_size/code_size_base.js \ - js/experimental/benchmarks/code_size/apps_jspb/popular_types_proto3.js \ - js/experimental/benchmarks/code_size/apps_jspb/popular_types_proto2.js \ - js/experimental/benchmarks/code_size/apps_jspb/all_types_proto3.js \ - js/experimental/benchmarks/code_size/apps_jspb/all_types_proto2.js - -all_EXTRA_DIST=$(csharp_EXTRA_DIST) $(java_EXTRA_DIST) $(objectivec_EXTRA_DIST) $(php_EXTRA_DIST) $(python_EXTRA_DIST) $(ruby_EXTRA_DIST) $(js_EXTRA_DIST) - -EXTRA_DIST = $(@DIST_LANG@_EXTRA_DIST) \ - autogen.sh \ - generate_descriptor_proto.sh \ - README.md \ - LICENSE \ - CONTRIBUTORS.txt \ - CHANGES.txt \ - update_file_lists.sh \ - BUILD \ - WORKSPACE \ - cmake/CMakeLists.txt \ - cmake/README.md \ - cmake/conformance.cmake \ - cmake/examples.cmake \ - cmake/extract_includes.bat.in \ - cmake/install.cmake \ - cmake/libprotobuf.cmake \ - cmake/libprotobuf-lite.cmake \ - cmake/libprotoc.cmake \ - cmake/protobuf-config-version.cmake.in \ - cmake/protobuf-config.cmake.in \ - cmake/protobuf-lite.pc.cmake \ - cmake/protobuf-module.cmake.in \ - cmake/protobuf-options.cmake \ - cmake/protobuf.pc.cmake \ - cmake/protoc.cmake \ - cmake/tests.cmake \ - cmake/version.rc.in \ - compiler_config_setting.bzl \ - build_files_updated_unittest.sh \ - cc_proto_blacklist_test.bzl \ - editors/README.txt \ - editors/proto.vim \ - editors/protobuf-mode.el \ - examples/AddPerson.java \ - examples/BUILD \ - examples/CMakeLists.txt \ - examples/ListPeople.java \ - examples/Makefile \ - examples/README.md \ - examples/WORKSPACE \ - examples/add_person.cc \ - examples/add_person.dart \ - examples/add_person.go \ - examples/add_person.py \ - examples/add_person_test.go \ - examples/addressbook.proto \ - examples/list_people.cc \ - examples/list_people.dart \ - examples/list_people.go \ - examples/list_people.py \ - examples/list_people_test.go \ - examples/pubspec.yaml \ - maven_install.json \ - protobuf.bzl \ - protobuf_deps.bzl \ - protobuf_version.bzl \ - third_party/zlib.BUILD \ - util/python/BUILD \ - internal.bzl - - -# Deletes all the files generated by autogen.sh. -MAINTAINERCLEANFILES = \ - aclocal.m4 \ - ar-lib \ - config.guess \ - config.sub \ - configure \ - depcomp \ - install-sh \ - ltmain.sh \ - Makefile.in \ - missing \ - mkinstalldirs \ - config.h.in \ - stamp.h.in \ - m4/ltsugar.m4 \ - m4/libtool.m4 \ - m4/ltversion.m4 \ - m4/lt~obsolete.m4 \ - m4/ltoptions.m4 diff --git a/extra/protobuf/protobuf-3.19.4/Makefile.in b/extra/protobuf/protobuf-3.19.4/Makefile.in deleted file mode 100644 index b469edee1f71..000000000000 --- a/extra/protobuf/protobuf-3.19.4/Makefile.in +++ /dev/null @@ -1,2377 +0,0 @@ -# Makefile.in generated by automake 1.16.5 from Makefile.am. -# @configure_input@ - -# Copyright (C) 1994-2021 Free Software Foundation, Inc. - -# This Makefile.in is free software; the Free Software Foundation -# gives unlimited permission to copy and/or distribute it, -# with or without modifications, as long as this notice is preserved. - -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY, to the extent permitted by law; without -# even the implied warranty of MERCHANTABILITY or FITNESS FOR A -# PARTICULAR PURPOSE. - -@SET_MAKE@ - -VPATH = @srcdir@ -am__is_gnu_make = { \ - if test -z '$(MAKELEVEL)'; then \ - false; \ - elif test -n '$(MAKE_HOST)'; then \ - true; \ - elif test -n '$(MAKE_VERSION)' && test -n '$(CURDIR)'; then \ - true; \ - else \ - false; \ - fi; \ -} -am__make_running_with_option = \ - case $${target_option-} in \ - ?) ;; \ - *) echo "am__make_running_with_option: internal error: invalid" \ - "target option '$${target_option-}' specified" >&2; \ - exit 1;; \ - esac; \ - has_opt=no; \ - sane_makeflags=$$MAKEFLAGS; \ - if $(am__is_gnu_make); then \ - sane_makeflags=$$MFLAGS; \ - else \ - case $$MAKEFLAGS in \ - *\\[\ \ ]*) \ - bs=\\; \ - sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \ - | sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \ - esac; \ - fi; \ - skip_next=no; \ - strip_trailopt () \ - { \ - flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \ - }; \ - for flg in $$sane_makeflags; do \ - test $$skip_next = yes && { skip_next=no; continue; }; \ - case $$flg in \ - *=*|--*) continue;; \ - -*I) strip_trailopt 'I'; skip_next=yes;; \ - -*I?*) strip_trailopt 'I';; \ - -*O) strip_trailopt 'O'; skip_next=yes;; \ - -*O?*) strip_trailopt 'O';; \ - -*l) strip_trailopt 'l'; skip_next=yes;; \ - -*l?*) strip_trailopt 'l';; \ - -[dEDm]) skip_next=yes;; \ - -[JT]) skip_next=yes;; \ - esac; \ - case $$flg in \ - *$$target_option*) has_opt=yes; break;; \ - esac; \ - done; \ - test $$has_opt = yes -am__make_dryrun = (target_option=n; $(am__make_running_with_option)) -am__make_keepgoing = (target_option=k; $(am__make_running_with_option)) -pkgdatadir = $(datadir)/@PACKAGE@ -pkgincludedir = $(includedir)/@PACKAGE@ -pkglibdir = $(libdir)/@PACKAGE@ -pkglibexecdir = $(libexecdir)/@PACKAGE@ -am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd -install_sh_DATA = $(install_sh) -c -m 644 -install_sh_PROGRAM = $(install_sh) -c -install_sh_SCRIPT = $(install_sh) -c -INSTALL_HEADER = $(INSTALL_DATA) -transform = $(program_transform_name) -NORMAL_INSTALL = : -PRE_INSTALL = : -POST_INSTALL = : -NORMAL_UNINSTALL = : -PRE_UNINSTALL = : -POST_UNINSTALL = : -build_triplet = @build@ -host_triplet = @host@ -target_triplet = @target@ -subdir = . -ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 -am__aclocal_m4_deps = $(top_srcdir)/m4/ac_system_extensions.m4 \ - $(top_srcdir)/m4/acx_check_suncc.m4 \ - $(top_srcdir)/m4/ax_cxx_compile_stdcxx.m4 \ - $(top_srcdir)/m4/ax_prog_cc_for_build.m4 \ - $(top_srcdir)/m4/ax_prog_cxx_for_build.m4 \ - $(top_srcdir)/m4/ax_pthread.m4 $(top_srcdir)/m4/libtool.m4 \ - $(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \ - $(top_srcdir)/m4/ltversion.m4 $(top_srcdir)/m4/lt~obsolete.m4 \ - $(top_srcdir)/m4/stl_hash.m4 $(top_srcdir)/configure.ac -am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ - $(ACLOCAL_M4) -DIST_COMMON = $(srcdir)/Makefile.am $(top_srcdir)/configure \ - $(am__configure_deps) $(am__DIST_COMMON) -am__CONFIG_DISTCLEAN_FILES = config.status config.cache config.log \ - configure.lineno config.status.lineno -mkinstalldirs = $(install_sh) -d -CONFIG_HEADER = config.h -CONFIG_CLEAN_FILES = protobuf.pc protobuf-lite.pc -CONFIG_CLEAN_VPATH_FILES = -AM_V_P = $(am__v_P_@AM_V@) -am__v_P_ = $(am__v_P_@AM_DEFAULT_V@) -am__v_P_0 = false -am__v_P_1 = : -AM_V_GEN = $(am__v_GEN_@AM_V@) -am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@) -am__v_GEN_0 = @echo " GEN " $@; -am__v_GEN_1 = -AM_V_at = $(am__v_at_@AM_V@) -am__v_at_ = $(am__v_at_@AM_DEFAULT_V@) -am__v_at_0 = @ -am__v_at_1 = -SOURCES = -DIST_SOURCES = -RECURSIVE_TARGETS = all-recursive check-recursive cscopelist-recursive \ - ctags-recursive dvi-recursive html-recursive info-recursive \ - install-data-recursive install-dvi-recursive \ - install-exec-recursive install-html-recursive \ - install-info-recursive install-pdf-recursive \ - install-ps-recursive install-recursive installcheck-recursive \ - installdirs-recursive pdf-recursive ps-recursive \ - tags-recursive uninstall-recursive -am__can_run_installinfo = \ - case $$AM_UPDATE_INFO_DIR in \ - n|no|NO) false;; \ - *) (install-info --version) >/dev/null 2>&1;; \ - esac -am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; -am__vpath_adj = case $$p in \ - $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \ - *) f=$$p;; \ - esac; -am__strip_dir = f=`echo $$p | sed -e 's|^.*/||'`; -am__install_max = 40 -am__nobase_strip_setup = \ - srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'` -am__nobase_strip = \ - for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||" -am__nobase_list = $(am__nobase_strip_setup); \ - for p in $$list; do echo "$$p $$p"; done | \ - sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \ - $(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \ - if (++n[$$2] == $(am__install_max)) \ - { print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \ - END { for (dir in files) print dir, files[dir] }' -am__base_list = \ - sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \ - sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g' -am__uninstall_files_from_dir = { \ - test -z "$$files" \ - || { test ! -d "$$dir" && test ! -f "$$dir" && test ! -r "$$dir"; } \ - || { echo " ( cd '$$dir' && rm -f" $$files ")"; \ - $(am__cd) "$$dir" && rm -f $$files; }; \ - } -am__installdirs = "$(DESTDIR)$(pkgconfigdir)" -DATA = $(pkgconfig_DATA) -RECURSIVE_CLEAN_TARGETS = mostlyclean-recursive clean-recursive \ - distclean-recursive maintainer-clean-recursive -am__recursive_targets = \ - $(RECURSIVE_TARGETS) \ - $(RECURSIVE_CLEAN_TARGETS) \ - $(am__extra_recursive_targets) -AM_RECURSIVE_TARGETS = $(am__recursive_targets:-recursive=) TAGS CTAGS \ - cscope distdir distdir-am dist dist-all distcheck -am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP) \ - config.h.in -# Read a list of newline-separated strings from the standard input, -# and print each of them once, without duplicates. Input order is -# *not* preserved. -am__uniquify_input = $(AWK) '\ - BEGIN { nonempty = 0; } \ - { items[$$0] = 1; nonempty = 1; } \ - END { if (nonempty) { for (i in items) print i; }; } \ -' -# Make sure the list of sources is unique. This is necessary because, -# e.g., the same source file might be shared among _SOURCES variables -# for different programs/libraries. -am__define_uniq_tagged_files = \ - list='$(am__tagged_files)'; \ - unique=`for i in $$list; do \ - if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ - done | $(am__uniquify_input)` -am__DIST_COMMON = $(srcdir)/Makefile.in $(srcdir)/config.h.in \ - $(srcdir)/protobuf-lite.pc.in $(srcdir)/protobuf.pc.in \ - README.md ar-lib compile config.guess config.sub install-sh \ - ltmain.sh missing -DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) -distdir = $(PACKAGE)-$(VERSION) -top_distdir = $(distdir) -am__remove_distdir = \ - if test -d "$(distdir)"; then \ - find "$(distdir)" -type d ! -perm -200 -exec chmod u+w {} ';' \ - && rm -rf "$(distdir)" \ - || { sleep 5 && rm -rf "$(distdir)"; }; \ - else :; fi -am__post_remove_distdir = $(am__remove_distdir) -am__relativize = \ - dir0=`pwd`; \ - sed_first='s,^\([^/]*\)/.*$$,\1,'; \ - sed_rest='s,^[^/]*/*,,'; \ - sed_last='s,^.*/\([^/]*\)$$,\1,'; \ - sed_butlast='s,/*[^/]*$$,,'; \ - while test -n "$$dir1"; do \ - first=`echo "$$dir1" | sed -e "$$sed_first"`; \ - if test "$$first" != "."; then \ - if test "$$first" = ".."; then \ - dir2=`echo "$$dir0" | sed -e "$$sed_last"`/"$$dir2"; \ - dir0=`echo "$$dir0" | sed -e "$$sed_butlast"`; \ - else \ - first2=`echo "$$dir2" | sed -e "$$sed_first"`; \ - if test "$$first2" = "$$first"; then \ - dir2=`echo "$$dir2" | sed -e "$$sed_rest"`; \ - else \ - dir2="../$$dir2"; \ - fi; \ - dir0="$$dir0"/"$$first"; \ - fi; \ - fi; \ - dir1=`echo "$$dir1" | sed -e "$$sed_rest"`; \ - done; \ - reldir="$$dir2" -DIST_ARCHIVES = $(distdir).tar.gz -GZIP_ENV = --best -DIST_TARGETS = dist-gzip -# Exists only to be overridden by the user if desired. -AM_DISTCHECK_DVI_TARGET = dvi -distuninstallcheck_listfiles = find . -type f -print -am__distuninstallcheck_listfiles = $(distuninstallcheck_listfiles) \ - | sed 's|^\./|$(prefix)/|' | grep -v '$(infodir)/dir$$' -distcleancheck_listfiles = find . -type f -print -ACLOCAL = @ACLOCAL@ -AMTAR = @AMTAR@ -AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ -AR = @AR@ -AUTOCONF = @AUTOCONF@ -AUTOHEADER = @AUTOHEADER@ -AUTOMAKE = @AUTOMAKE@ -AWK = @AWK@ -BUILD_EXEEXT = @BUILD_EXEEXT@ -BUILD_OBJEXT = @BUILD_OBJEXT@ -CC = @CC@ -CCDEPMODE = @CCDEPMODE@ -CC_FOR_BUILD = @CC_FOR_BUILD@ -CFLAGS = @CFLAGS@ -CFLAGS_FOR_BUILD = @CFLAGS_FOR_BUILD@ -CPP = @CPP@ -CPPFLAGS = @CPPFLAGS@ -CPPFLAGS_FOR_BUILD = @CPPFLAGS_FOR_BUILD@ -CPP_FOR_BUILD = @CPP_FOR_BUILD@ -CSCOPE = @CSCOPE@ -CTAGS = @CTAGS@ -CXX = @CXX@ -CXXCPP = @CXXCPP@ -CXXCPPFLAGS_FOR_BUILD = @CXXCPPFLAGS_FOR_BUILD@ -CXXCPP_FOR_BUILD = @CXXCPP_FOR_BUILD@ -CXXDEPMODE = @CXXDEPMODE@ -CXXFLAGS = @CXXFLAGS@ -CXXFLAGS_FOR_BUILD = @CXXFLAGS_FOR_BUILD@ -CXX_FOR_BUILD = @CXX_FOR_BUILD@ -CYGPATH_W = @CYGPATH_W@ -DEFS = @DEFS@ -DEPDIR = @DEPDIR@ -DIST_LANG = @DIST_LANG@ -DLLTOOL = @DLLTOOL@ -DSYMUTIL = @DSYMUTIL@ -DUMPBIN = @DUMPBIN@ -ECHO_C = @ECHO_C@ -ECHO_N = @ECHO_N@ -ECHO_T = @ECHO_T@ -EGREP = @EGREP@ -ETAGS = @ETAGS@ -EXEEXT = @EXEEXT@ -FGREP = @FGREP@ -GREP = @GREP@ -HAVE_CXX11 = @HAVE_CXX11@ -INSTALL = @INSTALL@ -INSTALL_DATA = @INSTALL_DATA@ -INSTALL_PROGRAM = @INSTALL_PROGRAM@ -INSTALL_SCRIPT = @INSTALL_SCRIPT@ -INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ -ISAINFO = @ISAINFO@ -LD = @LD@ -LDFLAGS = @LDFLAGS@ -LDFLAGS_FOR_BUILD = @LDFLAGS_FOR_BUILD@ -LIBATOMIC_LIBS = @LIBATOMIC_LIBS@ -LIBLOG_LIBS = @LIBLOG_LIBS@ -LIBOBJS = @LIBOBJS@ -LIBS = @LIBS@ -LIBTOOL = @LIBTOOL@ -LIPO = @LIPO@ -LN_S = @LN_S@ -LTLIBOBJS = @LTLIBOBJS@ -LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@ -MAINT = @MAINT@ -MAKEINFO = @MAKEINFO@ -MANIFEST_TOOL = @MANIFEST_TOOL@ -MKDIR_P = @MKDIR_P@ -NM = @NM@ -NMEDIT = @NMEDIT@ -OBJC = @OBJC@ -OBJCDEPMODE = @OBJCDEPMODE@ -OBJCFLAGS = @OBJCFLAGS@ -OBJDUMP = @OBJDUMP@ -OBJEXT = @OBJEXT@ -OTOOL = @OTOOL@ -OTOOL64 = @OTOOL64@ -PACKAGE = @PACKAGE@ -PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ -PACKAGE_NAME = @PACKAGE_NAME@ -PACKAGE_STRING = @PACKAGE_STRING@ -PACKAGE_TARNAME = @PACKAGE_TARNAME@ -PACKAGE_URL = @PACKAGE_URL@ -PACKAGE_VERSION = @PACKAGE_VERSION@ -PATH_SEPARATOR = @PATH_SEPARATOR@ -POW_LIB = @POW_LIB@ -PROTOBUF_OPT_FLAG = @PROTOBUF_OPT_FLAG@ -PROTOC = @PROTOC@ -PTHREAD_CC = @PTHREAD_CC@ -PTHREAD_CFLAGS = @PTHREAD_CFLAGS@ -PTHREAD_LIBS = @PTHREAD_LIBS@ -RANLIB = @RANLIB@ -SED = @SED@ -SET_MAKE = @SET_MAKE@ -SHELL = @SHELL@ -STRIP = @STRIP@ -VERSION = @VERSION@ -abs_builddir = @abs_builddir@ -abs_srcdir = @abs_srcdir@ -abs_top_builddir = @abs_top_builddir@ -abs_top_srcdir = @abs_top_srcdir@ -ac_ct_AR = @ac_ct_AR@ -ac_ct_CC = @ac_ct_CC@ -ac_ct_CC_FOR_BUILD = @ac_ct_CC_FOR_BUILD@ -ac_ct_CXX = @ac_ct_CXX@ -ac_ct_CXX_FOR_BUILD = @ac_ct_CXX_FOR_BUILD@ -ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ -ac_ct_OBJC = @ac_ct_OBJC@ -am__include = @am__include@ -am__leading_dot = @am__leading_dot@ -am__quote = @am__quote@ -am__tar = @am__tar@ -am__untar = @am__untar@ -ax_pthread_config = @ax_pthread_config@ -bindir = @bindir@ -build = @build@ -build_alias = @build_alias@ -build_cpu = @build_cpu@ -build_os = @build_os@ -build_vendor = @build_vendor@ -builddir = @builddir@ -datadir = @datadir@ -datarootdir = @datarootdir@ -docdir = @docdir@ -dvidir = @dvidir@ -exec_prefix = @exec_prefix@ -host = @host@ -host_alias = @host_alias@ -host_cpu = @host_cpu@ -host_os = @host_os@ -host_vendor = @host_vendor@ -htmldir = @htmldir@ -includedir = @includedir@ -infodir = @infodir@ -install_sh = @install_sh@ -libdir = @libdir@ -libexecdir = @libexecdir@ -localedir = @localedir@ -localstatedir = @localstatedir@ -mandir = @mandir@ -mkdir_p = @mkdir_p@ -oldincludedir = @oldincludedir@ -pdfdir = @pdfdir@ -prefix = @prefix@ -program_transform_name = @program_transform_name@ -psdir = @psdir@ -runstatedir = @runstatedir@ -sbindir = @sbindir@ -sharedstatedir = @sharedstatedir@ -srcdir = @srcdir@ -subdirs = @subdirs@ -sysconfdir = @sysconfdir@ -target = @target@ -target_alias = @target_alias@ -target_cpu = @target_cpu@ -target_os = @target_os@ -target_vendor = @target_vendor@ -top_build_prefix = @top_build_prefix@ -top_builddir = @top_builddir@ -top_srcdir = @top_srcdir@ -ACLOCAL_AMFLAGS = -I m4 -AUTOMAKE_OPTIONS = foreign - -# Build . before src so that our all-local and clean-local hooks kicks in at -# the right time. -SUBDIRS = . src - -# Always include third_party directories in distributions. -DIST_SUBDIRS = src conformance benchmarks third_party/googletest -pkgconfigdir = $(libdir)/pkgconfig -pkgconfig_DATA = protobuf.pc protobuf-lite.pc -csharp_EXTRA_DIST = \ - global.json \ - csharp/.gitignore \ - csharp/CHANGES.txt \ - csharp/Google.Protobuf.Tools.targets \ - csharp/Google.Protobuf.Tools.nuspec \ - csharp/README.md \ - csharp/build_packages.bat \ - csharp/build_tools.sh \ - csharp/buildall.bat \ - csharp/buildall.sh \ - csharp/generate_protos.sh \ - csharp/install_dotnet_sdk.ps1 \ - csharp/keys/Google.Protobuf.public.snk \ - csharp/keys/Google.Protobuf.snk \ - csharp/keys/README.md \ - csharp/protos/README.md \ - csharp/protos/map_unittest_proto3.proto \ - csharp/protos/old_extensions1.proto \ - csharp/protos/old_extensions2.proto \ - csharp/protos/unittest_issue6936_a.proto \ - csharp/protos/unittest_issue6936_b.proto \ - csharp/protos/unittest_issue6936_c.proto \ - csharp/protos/unittest_custom_options_proto3.proto \ - csharp/protos/unittest_import_public_proto3.proto \ - csharp/protos/unittest_import_public.proto \ - csharp/protos/unittest_import_proto3.proto \ - csharp/protos/unittest_import.proto \ - csharp/protos/unittest_issues.proto \ - csharp/protos/unittest_proto3.proto \ - csharp/protos/unittest_selfreferential_options.proto \ - csharp/protos/unittest.proto \ - csharp/src/AddressBook/AddPerson.cs \ - csharp/src/AddressBook/Addressbook.cs \ - csharp/src/AddressBook/AddressBook.csproj \ - csharp/src/AddressBook/ListPeople.cs \ - csharp/src/AddressBook/Program.cs \ - csharp/src/AddressBook/SampleUsage.cs \ - csharp/src/Google.Protobuf.Benchmarks/BenchmarkDatasetConfig.cs \ - csharp/src/Google.Protobuf.Benchmarks/BenchmarkMessage1Proto3.cs \ - csharp/src/Google.Protobuf.Benchmarks/Benchmarks.cs \ - csharp/src/Google.Protobuf.Benchmarks/ByteStringBenchmark.cs \ - csharp/src/Google.Protobuf.Benchmarks/Google.Protobuf.Benchmarks.csproj \ - csharp/src/Google.Protobuf.Benchmarks/GoogleMessageBenchmark.cs \ - csharp/src/Google.Protobuf.Benchmarks/ParseMessagesBenchmark.cs \ - csharp/src/Google.Protobuf.Benchmarks/ParseRawPrimitivesBenchmark.cs \ - csharp/src/Google.Protobuf.Benchmarks/Program.cs \ - csharp/src/Google.Protobuf.Benchmarks/wrapper_benchmark_messages.proto \ - csharp/src/Google.Protobuf.Benchmarks/WrapperBenchmarkMessages.cs \ - csharp/src/Google.Protobuf.Benchmarks/WriteMessagesBenchmark.cs \ - csharp/src/Google.Protobuf.Benchmarks/WriteRawPrimitivesBenchmark.cs \ - csharp/src/Google.Protobuf.Conformance/Conformance.cs \ - csharp/src/Google.Protobuf.Conformance/Google.Protobuf.Conformance.csproj \ - csharp/src/Google.Protobuf.Conformance/Program.cs \ - csharp/src/Google.Protobuf.JsonDump/Google.Protobuf.JsonDump.csproj \ - csharp/src/Google.Protobuf.JsonDump/Program.cs \ - csharp/src/Google.Protobuf.Test/Buffers/ArrayBufferWriter.cs \ - csharp/src/Google.Protobuf.Test/ByteStringTest.cs \ - csharp/src/Google.Protobuf.Test/CodedInputStreamExtensions.cs \ - csharp/src/Google.Protobuf.Test/CodedInputStreamTest.cs \ - csharp/src/Google.Protobuf.Test/CodedOutputStreamTest.cs \ - csharp/src/Google.Protobuf.Test/Collections/MapFieldTest.cs \ - csharp/src/Google.Protobuf.Test/Collections/ProtobufEqualityComparersTest.cs \ - csharp/src/Google.Protobuf.Test/Collections/RepeatedFieldTest.cs \ - csharp/src/Google.Protobuf.Test/Compatibility/PropertyInfoExtensionsTest.cs \ - csharp/src/Google.Protobuf.Test/Compatibility/StreamExtensionsTest.cs \ - csharp/src/Google.Protobuf.Test/Compatibility/TypeExtensionsTest.cs \ - csharp/src/Google.Protobuf.Test/DeprecatedMemberTest.cs \ - csharp/src/Google.Protobuf.Test/EqualityTester.cs \ - csharp/src/Google.Protobuf.Test/ExtensionSetTest.cs \ - csharp/src/Google.Protobuf.Test/FieldCodecTest.cs \ - csharp/src/Google.Protobuf.Test/FieldMaskTreeTest.cs \ - csharp/src/Google.Protobuf.Test/GeneratedMessageTest.cs \ - csharp/src/Google.Protobuf.Test/GeneratedMessageTest.Proto2.cs \ - csharp/src/Google.Protobuf.Test/Google.Protobuf.Test.csproj \ - csharp/src/Google.Protobuf.Test/IssuesTest.cs \ - csharp/src/Google.Protobuf.Test/JsonFormatterTest.cs \ - csharp/src/Google.Protobuf.Test/JsonParserTest.cs \ - csharp/src/Google.Protobuf.Test/JsonTokenizerTest.cs \ - csharp/src/Google.Protobuf.Test/LegacyGeneratedCodeTest.cs \ - csharp/src/Google.Protobuf.Test/MessageParsingHelpers.cs \ - csharp/src/Google.Protobuf.Test/Proto3OptionalTest.cs \ - csharp/src/Google.Protobuf.Test/ReadOnlySequenceFactory.cs \ - csharp/src/Google.Protobuf.Test/RefStructCompatibilityTest.cs \ - csharp/src/Google.Protobuf.Test/Reflection/CustomOptionsTest.cs \ - csharp/src/Google.Protobuf.Test/Reflection/DescriptorDeclarationTest.cs \ - csharp/src/Google.Protobuf.Test/Reflection/DescriptorsTest.cs \ - csharp/src/Google.Protobuf.Test/Reflection/FieldAccessTest.cs \ - csharp/src/Google.Protobuf.Test/Reflection/TypeRegistryTest.cs \ - csharp/src/Google.Protobuf.Test/SampleEnum.cs \ - csharp/src/Google.Protobuf.Test/SampleMessages.cs \ - csharp/src/Google.Protobuf.Test/SampleNaNs.cs \ - csharp/src/Google.Protobuf.Test/TestCornerCases.cs \ - csharp/src/Google.Protobuf.Test.TestProtos/Google.Protobuf.Test.TestProtos.csproj \ - csharp/src/Google.Protobuf.Test.TestProtos/UnittestIssue6936A.cs \ - csharp/src/Google.Protobuf.Test.TestProtos/UnittestIssue6936B.cs \ - csharp/src/Google.Protobuf.Test.TestProtos/UnittestIssue6936C.cs \ - csharp/src/Google.Protobuf.Test.TestProtos/ForeignMessagePartial.cs \ - csharp/src/Google.Protobuf.Test.TestProtos/MapUnittestProto3.cs \ - csharp/src/Google.Protobuf.Test.TestProtos/OldExtensions1.cs \ - csharp/src/Google.Protobuf.Test.TestProtos/OldExtensions2.cs \ - csharp/src/Google.Protobuf.Test.TestProtos/TestMessagesProto2.cs \ - csharp/src/Google.Protobuf.Test.TestProtos/TestMessagesProto3.cs \ - csharp/src/Google.Protobuf.Test.TestProtos/UnittestCustomOptionsProto3.cs \ - csharp/src/Google.Protobuf.Test.TestProtos/UnittestImportProto3.cs \ - csharp/src/Google.Protobuf.Test.TestProtos/UnittestImportPublicProto3.cs \ - csharp/src/Google.Protobuf.Test.TestProtos/UnittestImportPublic.cs \ - csharp/src/Google.Protobuf.Test.TestProtos/UnittestImport.cs \ - csharp/src/Google.Protobuf.Test.TestProtos/UnittestIssues.cs \ - csharp/src/Google.Protobuf.Test.TestProtos/UnittestProto3.cs \ - csharp/src/Google.Protobuf.Test.TestProtos/UnittestProto3Optional.cs \ - csharp/src/Google.Protobuf.Test.TestProtos/UnittestSelfreferentialOptions.cs \ - csharp/src/Google.Protobuf.Test.TestProtos/UnittestWellKnownTypes.cs \ - csharp/src/Google.Protobuf.Test.TestProtos/Unittest.cs \ - csharp/src/Google.Protobuf.Test/WellKnownTypes/AnyTest.cs \ - csharp/src/Google.Protobuf.Test/WellKnownTypes/DurationTest.cs \ - csharp/src/Google.Protobuf.Test/WellKnownTypes/FieldMaskTest.cs \ - csharp/src/Google.Protobuf.Test/WellKnownTypes/TimestampTest.cs \ - csharp/src/Google.Protobuf.Test/WellKnownTypes/WrappersTest.cs \ - csharp/src/Google.Protobuf.Test/UnknownFieldSetTest.cs \ - csharp/src/Google.Protobuf.Test/testprotos.pb \ - csharp/src/Google.Protobuf.sln \ - csharp/src/Google.Protobuf/ByteArray.cs \ - csharp/src/Google.Protobuf/ByteString.cs \ - csharp/src/Google.Protobuf/ByteStringAsync.cs \ - csharp/src/Google.Protobuf/CodedInputStream.cs \ - csharp/src/Google.Protobuf/CodedOutputStream.ComputeSize.cs \ - csharp/src/Google.Protobuf/CodedOutputStream.cs \ - csharp/src/Google.Protobuf/Collections/Lists.cs \ - csharp/src/Google.Protobuf/Collections/MapField.cs \ - csharp/src/Google.Protobuf/Collections/ProtobufEqualityComparers.cs \ - csharp/src/Google.Protobuf/Collections/ReadOnlyDictionary.cs \ - csharp/src/Google.Protobuf/Collections/RepeatedField.cs \ - csharp/src/Google.Protobuf/Compatibility/MethodInfoExtensions.cs \ - csharp/src/Google.Protobuf/Compatibility/PropertyInfoExtensions.cs \ - csharp/src/Google.Protobuf/Compatibility/StreamExtensions.cs \ - csharp/src/Google.Protobuf/Compatibility/TypeExtensions.cs \ - csharp/src/Google.Protobuf/Extension.cs \ - csharp/src/Google.Protobuf/ExtensionRegistry.cs \ - csharp/src/Google.Protobuf/ExtensionSet.cs \ - csharp/src/Google.Protobuf/ExtensionValue.cs \ - csharp/src/Google.Protobuf/FieldCodec.cs \ - csharp/src/Google.Protobuf/FieldMaskTree.cs \ - csharp/src/Google.Protobuf/FrameworkPortability.cs \ - csharp/src/Google.Protobuf/Google.Protobuf.csproj \ - csharp/src/Google.Protobuf/IBufferMessage.cs \ - csharp/src/Google.Protobuf/ICustomDiagnosticMessage.cs \ - csharp/src/Google.Protobuf/IDeepCloneable.cs \ - csharp/src/Google.Protobuf/IExtendableMessage.cs \ - csharp/src/Google.Protobuf/IMessage.cs \ - csharp/src/Google.Protobuf/InvalidJsonException.cs \ - csharp/src/Google.Protobuf/InvalidProtocolBufferException.cs \ - csharp/src/Google.Protobuf/JsonFormatter.cs \ - csharp/src/Google.Protobuf/JsonParser.cs \ - csharp/src/Google.Protobuf/JsonToken.cs \ - csharp/src/Google.Protobuf/JsonTokenizer.cs \ - csharp/src/Google.Protobuf/LimitedInputStream.cs \ - csharp/src/Google.Protobuf/MessageExtensions.cs \ - csharp/src/Google.Protobuf/MessageParser.cs \ - csharp/src/Google.Protobuf/ObjectIntPair.cs \ - csharp/src/Google.Protobuf/ParseContext.cs \ - csharp/src/Google.Protobuf/ParserInternalState.cs \ - csharp/src/Google.Protobuf/ParsingPrimitives.cs \ - csharp/src/Google.Protobuf/ParsingPrimitivesMessages.cs \ - csharp/src/Google.Protobuf/ParsingPrimitivesWrappers.cs \ - csharp/src/Google.Protobuf/ProtoPreconditions.cs \ - csharp/src/Google.Protobuf/SegmentedBufferHelper.cs \ - csharp/src/Google.Protobuf/Properties/AssemblyInfo.cs \ - csharp/src/Google.Protobuf/Reflection/CustomOptions.cs \ - csharp/src/Google.Protobuf/Reflection/Descriptor.cs \ - csharp/src/Google.Protobuf/Reflection/DescriptorBase.cs \ - csharp/src/Google.Protobuf/Reflection/DescriptorDeclaration.cs \ - csharp/src/Google.Protobuf/Reflection/DescriptorPool.cs \ - csharp/src/Google.Protobuf/Reflection/DescriptorUtil.cs \ - csharp/src/Google.Protobuf/Reflection/DescriptorValidationException.cs \ - csharp/src/Google.Protobuf/Reflection/EnumDescriptor.cs \ - csharp/src/Google.Protobuf/Reflection/EnumValueDescriptor.cs \ - csharp/src/Google.Protobuf/Reflection/ExtensionAccessor.cs \ - csharp/src/Google.Protobuf/Reflection/ExtensionCollection.cs \ - csharp/src/Google.Protobuf/Reflection/FieldAccessorBase.cs \ - csharp/src/Google.Protobuf/Reflection/FieldDescriptor.cs \ - csharp/src/Google.Protobuf/Reflection/FieldType.cs \ - csharp/src/Google.Protobuf/Reflection/FileDescriptor.cs \ - csharp/src/Google.Protobuf/Reflection/GeneratedClrTypeInfo.cs \ - csharp/src/Google.Protobuf/Reflection/IDescriptor.cs \ - csharp/src/Google.Protobuf/Reflection/IFieldAccessor.cs \ - csharp/src/Google.Protobuf/Reflection/MapFieldAccessor.cs \ - csharp/src/Google.Protobuf/Reflection/MessageDescriptor.cs \ - csharp/src/Google.Protobuf/Reflection/MethodDescriptor.cs \ - csharp/src/Google.Protobuf/Reflection/OneofAccessor.cs \ - csharp/src/Google.Protobuf/Reflection/OneofDescriptor.cs \ - csharp/src/Google.Protobuf/Reflection/OriginalNameAttribute.cs \ - csharp/src/Google.Protobuf/Reflection/PackageDescriptor.cs \ - csharp/src/Google.Protobuf/Reflection/ReflectionUtil.cs \ - csharp/src/Google.Protobuf/Reflection/RepeatedFieldAccessor.cs \ - csharp/src/Google.Protobuf/Reflection/ServiceDescriptor.cs \ - csharp/src/Google.Protobuf/Reflection/SingleFieldAccessor.cs \ - csharp/src/Google.Protobuf/Reflection/TypeRegistry.cs \ - csharp/src/Google.Protobuf/WellKnownTypes/Any.cs \ - csharp/src/Google.Protobuf/WellKnownTypes/AnyPartial.cs \ - csharp/src/Google.Protobuf/WellKnownTypes/Api.cs \ - csharp/src/Google.Protobuf/WellKnownTypes/Duration.cs \ - csharp/src/Google.Protobuf/WellKnownTypes/DurationPartial.cs \ - csharp/src/Google.Protobuf/WellKnownTypes/Empty.cs \ - csharp/src/Google.Protobuf/WellKnownTypes/FieldMask.cs \ - csharp/src/Google.Protobuf/WellKnownTypes/FieldMaskPartial.cs \ - csharp/src/Google.Protobuf/WellKnownTypes/SourceContext.cs \ - csharp/src/Google.Protobuf/WellKnownTypes/Struct.cs \ - csharp/src/Google.Protobuf/WellKnownTypes/TimeExtensions.cs \ - csharp/src/Google.Protobuf/WellKnownTypes/Timestamp.cs \ - csharp/src/Google.Protobuf/WellKnownTypes/TimestampPartial.cs \ - csharp/src/Google.Protobuf/WellKnownTypes/Type.cs \ - csharp/src/Google.Protobuf/WellKnownTypes/ValuePartial.cs \ - csharp/src/Google.Protobuf/WellKnownTypes/Wrappers.cs \ - csharp/src/Google.Protobuf/WellKnownTypes/WrappersPartial.cs \ - csharp/src/Google.Protobuf/WireFormat.cs \ - csharp/src/Google.Protobuf/WritingPrimitivesMessages.cs \ - csharp/src/Google.Protobuf/WritingPrimitives.cs \ - csharp/src/Google.Protobuf/WriterInternalState.cs \ - csharp/src/Google.Protobuf/WriteContext.cs \ - csharp/src/Google.Protobuf/WriteBufferHelper.cs \ - csharp/src/Google.Protobuf/UnknownField.cs \ - csharp/src/Google.Protobuf/UnknownFieldSet.cs \ - csharp/src/Google.Protobuf/UnsafeByteOperations.cs - -java_EXTRA_DIST = \ - java/README.md \ - java/bom/pom.xml \ - java/core/BUILD \ - java/core/generate-sources-build.xml \ - java/core/generate-test-sources-build.xml \ - java/core/pom.xml \ - java/core/pom_template.xml \ - java/core/src/main/java/com/google/protobuf/AbstractMessage.java \ - java/core/src/main/java/com/google/protobuf/AbstractMessageLite.java \ - java/core/src/main/java/com/google/protobuf/AbstractParser.java \ - java/core/src/main/java/com/google/protobuf/AbstractProtobufList.java \ - java/core/src/main/java/com/google/protobuf/AllocatedBuffer.java \ - java/core/src/main/java/com/google/protobuf/Android.java \ - java/core/src/main/java/com/google/protobuf/ArrayDecoders.java \ - java/core/src/main/java/com/google/protobuf/BinaryReader.java \ - java/core/src/main/java/com/google/protobuf/BinaryWriter.java \ - java/core/src/main/java/com/google/protobuf/BlockingRpcChannel.java \ - java/core/src/main/java/com/google/protobuf/BlockingService.java \ - java/core/src/main/java/com/google/protobuf/BooleanArrayList.java \ - java/core/src/main/java/com/google/protobuf/BufferAllocator.java \ - java/core/src/main/java/com/google/protobuf/ByteBufferWriter.java \ - java/core/src/main/java/com/google/protobuf/ByteOutput.java \ - java/core/src/main/java/com/google/protobuf/ByteString.java \ - java/core/src/main/java/com/google/protobuf/CanIgnoreReturnValue.java \ - java/core/src/main/java/com/google/protobuf/CheckReturnValue.java \ - java/core/src/main/java/com/google/protobuf/CodedInputStream.java \ - java/core/src/main/java/com/google/protobuf/CodedInputStreamReader.java \ - java/core/src/main/java/com/google/protobuf/CodedOutputStream.java \ - java/core/src/main/java/com/google/protobuf/CodedOutputStreamWriter.java \ - java/core/src/main/java/com/google/protobuf/DescriptorMessageInfoFactory.java \ - java/core/src/main/java/com/google/protobuf/Descriptors.java \ - java/core/src/main/java/com/google/protobuf/DiscardUnknownFieldsParser.java \ - java/core/src/main/java/com/google/protobuf/DoubleArrayList.java \ - java/core/src/main/java/com/google/protobuf/DynamicMessage.java \ - java/core/src/main/java/com/google/protobuf/ExperimentalApi.java \ - java/core/src/main/java/com/google/protobuf/Extension.java \ - java/core/src/main/java/com/google/protobuf/ExtensionLite.java \ - java/core/src/main/java/com/google/protobuf/ExtensionRegistry.java \ - java/core/src/main/java/com/google/protobuf/ExtensionRegistryFactory.java \ - java/core/src/main/java/com/google/protobuf/ExtensionRegistryLite.java \ - java/core/src/main/java/com/google/protobuf/ExtensionSchema.java \ - java/core/src/main/java/com/google/protobuf/ExtensionSchemaFull.java \ - java/core/src/main/java/com/google/protobuf/ExtensionSchemaLite.java \ - java/core/src/main/java/com/google/protobuf/ExtensionSchemas.java \ - java/core/src/main/java/com/google/protobuf/FieldInfo.java \ - java/core/src/main/java/com/google/protobuf/FieldSet.java \ - java/core/src/main/java/com/google/protobuf/FieldType.java \ - java/core/src/main/java/com/google/protobuf/FloatArrayList.java \ - java/core/src/main/java/com/google/protobuf/GeneratedMessage.java \ - java/core/src/main/java/com/google/protobuf/GeneratedMessageInfoFactory.java \ - java/core/src/main/java/com/google/protobuf/GeneratedMessageLite.java \ - java/core/src/main/java/com/google/protobuf/GeneratedMessageV3.java \ - java/core/src/main/java/com/google/protobuf/IntArrayList.java \ - java/core/src/main/java/com/google/protobuf/Internal.java \ - java/core/src/main/java/com/google/protobuf/InvalidProtocolBufferException.java \ - java/core/src/main/java/com/google/protobuf/IterableByteBufferInputStream.java \ - java/core/src/main/java/com/google/protobuf/JavaType.java \ - java/core/src/main/java/com/google/protobuf/LazyField.java \ - java/core/src/main/java/com/google/protobuf/LazyFieldLite.java \ - java/core/src/main/java/com/google/protobuf/LazyStringArrayList.java \ - java/core/src/main/java/com/google/protobuf/LazyStringList.java \ - java/core/src/main/java/com/google/protobuf/ListFieldSchema.java \ - java/core/src/main/java/com/google/protobuf/LongArrayList.java \ - java/core/src/main/java/com/google/protobuf/ManifestSchemaFactory.java \ - java/core/src/main/java/com/google/protobuf/MapEntry.java \ - java/core/src/main/java/com/google/protobuf/MapEntryLite.java \ - java/core/src/main/java/com/google/protobuf/MapField.java \ - java/core/src/main/java/com/google/protobuf/MapFieldLite.java \ - java/core/src/main/java/com/google/protobuf/MapFieldSchema.java \ - java/core/src/main/java/com/google/protobuf/MapFieldSchemaFull.java \ - java/core/src/main/java/com/google/protobuf/MapFieldSchemaLite.java \ - java/core/src/main/java/com/google/protobuf/MapFieldSchemas.java \ - java/core/src/main/java/com/google/protobuf/Message.java \ - java/core/src/main/java/com/google/protobuf/MessageInfo.java \ - java/core/src/main/java/com/google/protobuf/MessageInfoFactory.java \ - java/core/src/main/java/com/google/protobuf/MessageLite.java \ - java/core/src/main/java/com/google/protobuf/MessageLiteOrBuilder.java \ - java/core/src/main/java/com/google/protobuf/MessageLiteToString.java \ - java/core/src/main/java/com/google/protobuf/MessageOrBuilder.java \ - java/core/src/main/java/com/google/protobuf/MessageReflection.java \ - java/core/src/main/java/com/google/protobuf/MessageSchema.java \ - java/core/src/main/java/com/google/protobuf/MessageSetSchema.java \ - java/core/src/main/java/com/google/protobuf/MutabilityOracle.java \ - java/core/src/main/java/com/google/protobuf/NewInstanceSchema.java \ - java/core/src/main/java/com/google/protobuf/NewInstanceSchemaFull.java \ - java/core/src/main/java/com/google/protobuf/NewInstanceSchemaLite.java \ - java/core/src/main/java/com/google/protobuf/NewInstanceSchemas.java \ - java/core/src/main/java/com/google/protobuf/NioByteString.java \ - java/core/src/main/java/com/google/protobuf/OneofInfo.java \ - java/core/src/main/java/com/google/protobuf/Parser.java \ - java/core/src/main/java/com/google/protobuf/PrimitiveNonBoxingCollection.java \ - java/core/src/main/java/com/google/protobuf/ProtoSyntax.java \ - java/core/src/main/java/com/google/protobuf/Protobuf.java \ - java/core/src/main/java/com/google/protobuf/ProtobufArrayList.java \ - java/core/src/main/java/com/google/protobuf/ProtobufLists.java \ - java/core/src/main/java/com/google/protobuf/ProtocolMessageEnum.java \ - java/core/src/main/java/com/google/protobuf/ProtocolStringList.java \ - java/core/src/main/java/com/google/protobuf/RawMessageInfo.java \ - java/core/src/main/java/com/google/protobuf/Reader.java \ - java/core/src/main/java/com/google/protobuf/RepeatedFieldBuilder.java \ - java/core/src/main/java/com/google/protobuf/RepeatedFieldBuilderV3.java \ - java/core/src/main/java/com/google/protobuf/RopeByteString.java \ - java/core/src/main/java/com/google/protobuf/RpcCallback.java \ - java/core/src/main/java/com/google/protobuf/RpcChannel.java \ - java/core/src/main/java/com/google/protobuf/RpcController.java \ - java/core/src/main/java/com/google/protobuf/RpcUtil.java \ - java/core/src/main/java/com/google/protobuf/Schema.java \ - java/core/src/main/java/com/google/protobuf/SchemaFactory.java \ - java/core/src/main/java/com/google/protobuf/SchemaUtil.java \ - java/core/src/main/java/com/google/protobuf/Service.java \ - java/core/src/main/java/com/google/protobuf/ServiceException.java \ - java/core/src/main/java/com/google/protobuf/SingleFieldBuilder.java \ - java/core/src/main/java/com/google/protobuf/SingleFieldBuilderV3.java \ - java/core/src/main/java/com/google/protobuf/SmallSortedMap.java \ - java/core/src/main/java/com/google/protobuf/StructuralMessageInfo.java \ - java/core/src/main/java/com/google/protobuf/TextFormat.java \ - java/core/src/main/java/com/google/protobuf/TextFormatEscaper.java \ - java/core/src/main/java/com/google/protobuf/TextFormatParseInfoTree.java \ - java/core/src/main/java/com/google/protobuf/TextFormatParseLocation.java \ - java/core/src/main/java/com/google/protobuf/TypeRegistry.java \ - java/core/src/main/java/com/google/protobuf/UninitializedMessageException.java \ - java/core/src/main/java/com/google/protobuf/UnknownFieldSchema.java \ - java/core/src/main/java/com/google/protobuf/UnknownFieldSet.java \ - java/core/src/main/java/com/google/protobuf/UnknownFieldSetLite.java \ - java/core/src/main/java/com/google/protobuf/UnknownFieldSetLiteSchema.java \ - java/core/src/main/java/com/google/protobuf/UnknownFieldSetSchema.java \ - java/core/src/main/java/com/google/protobuf/UnmodifiableLazyStringList.java \ - java/core/src/main/java/com/google/protobuf/UnsafeByteOperations.java \ - java/core/src/main/java/com/google/protobuf/UnsafeUtil.java \ - java/core/src/main/java/com/google/protobuf/Utf8.java \ - java/core/src/main/java/com/google/protobuf/WireFormat.java \ - java/core/src/main/java/com/google/protobuf/Writer.java \ - java/core/src/test/java/com/google/protobuf/AbstractMessageTest.java \ - java/core/src/test/java/com/google/protobuf/AbstractProto2LiteSchemaTest.java \ - java/core/src/test/java/com/google/protobuf/AbstractProto2SchemaTest.java \ - java/core/src/test/java/com/google/protobuf/AbstractProto3LiteSchemaTest.java \ - java/core/src/test/java/com/google/protobuf/AbstractProto3SchemaTest.java \ - java/core/src/test/java/com/google/protobuf/AbstractSchemaTest.java \ - java/core/src/test/java/com/google/protobuf/AnyTest.java \ - java/core/src/test/java/com/google/protobuf/ArrayDecodersTest.java \ - java/core/src/test/java/com/google/protobuf/BinaryProtocolTest.java \ - java/core/src/test/java/com/google/protobuf/BooleanArrayListTest.java \ - java/core/src/test/java/com/google/protobuf/BoundedByteStringTest.java \ - java/core/src/test/java/com/google/protobuf/ByteBufferWriterTest.java \ - java/core/src/test/java/com/google/protobuf/ByteStringTest.java \ - java/core/src/test/java/com/google/protobuf/CachedFieldSizeTest.java \ - java/core/src/test/java/com/google/protobuf/CheckUtf8Test.java \ - java/core/src/test/java/com/google/protobuf/CodedAdapterTest.java \ - java/core/src/test/java/com/google/protobuf/CodedInputStreamTest.java \ - java/core/src/test/java/com/google/protobuf/CodedOutputStreamTest.java \ - java/core/src/test/java/com/google/protobuf/DecodeUtf8Test.java \ - java/core/src/test/java/com/google/protobuf/DeprecatedFieldTest.java \ - java/core/src/test/java/com/google/protobuf/DescriptorsTest.java \ - java/core/src/test/java/com/google/protobuf/DiscardUnknownFieldsTest.java \ - java/core/src/test/java/com/google/protobuf/DoubleArrayListTest.java \ - java/core/src/test/java/com/google/protobuf/DynamicMessageTest.java \ - java/core/src/test/java/com/google/protobuf/EnumTest.java \ - java/core/src/test/java/com/google/protobuf/ExperimentalMessageFactory.java \ - java/core/src/test/java/com/google/protobuf/ExperimentalSerializationUtil.java \ - java/core/src/test/java/com/google/protobuf/ExperimentalTestDataProvider.java \ - java/core/src/test/java/com/google/protobuf/ExtensionRegistryFactoryTest.java \ - java/core/src/test/java/com/google/protobuf/FieldPresenceTest.java \ - java/core/src/test/java/com/google/protobuf/FloatArrayListTest.java \ - java/core/src/test/java/com/google/protobuf/ForceFieldBuildersPreRun.java \ - java/core/src/test/java/com/google/protobuf/GeneratedMessageTest.java \ - java/core/src/test/java/com/google/protobuf/IntArrayListTest.java \ - java/core/src/test/java/com/google/protobuf/IsValidUtf8Test.java \ - java/core/src/test/java/com/google/protobuf/IsValidUtf8TestUtil.java \ - java/core/src/test/java/com/google/protobuf/LazyFieldLiteTest.java \ - java/core/src/test/java/com/google/protobuf/LazyFieldTest.java \ - java/core/src/test/java/com/google/protobuf/LazyMessageLiteTest.java \ - java/core/src/test/java/com/google/protobuf/LazyStringArrayListTest.java \ - java/core/src/test/java/com/google/protobuf/LazyStringEndToEndTest.java \ - java/core/src/test/java/com/google/protobuf/LiteEqualsAndHashTest.java \ - java/core/src/test/java/com/google/protobuf/LiteralByteStringTest.java \ - java/core/src/test/java/com/google/protobuf/LongArrayListTest.java \ - java/core/src/test/java/com/google/protobuf/MapForProto2LiteTest.java \ - java/core/src/test/java/com/google/protobuf/MapForProto2Test.java \ - java/core/src/test/java/com/google/protobuf/MapLiteTest.java \ - java/core/src/test/java/com/google/protobuf/MapTest.java \ - java/core/src/test/java/com/google/protobuf/MessageTest.java \ - java/core/src/test/java/com/google/protobuf/NestedBuildersTest.java \ - java/core/src/test/java/com/google/protobuf/NioByteStringTest.java \ - java/core/src/test/java/com/google/protobuf/PackedFieldTest.java \ - java/core/src/test/java/com/google/protobuf/ParseExceptionsTest.java \ - java/core/src/test/java/com/google/protobuf/ParserLiteTest.java \ - java/core/src/test/java/com/google/protobuf/ParserTest.java \ - java/core/src/test/java/com/google/protobuf/Proto2ExtensionLookupSchemaTest.java \ - java/core/src/test/java/com/google/protobuf/Proto2LiteSchemaTest.java \ - java/core/src/test/java/com/google/protobuf/Proto2MessageFactory.java \ - java/core/src/test/java/com/google/protobuf/Proto2MessageInfoFactory.java \ - java/core/src/test/java/com/google/protobuf/Proto2MessageLiteFactory.java \ - java/core/src/test/java/com/google/protobuf/Proto2SchemaTest.java \ - java/core/src/test/java/com/google/protobuf/Proto2UnknownEnumValueTest.java \ - java/core/src/test/java/com/google/protobuf/Proto3LiteSchemaTest.java \ - java/core/src/test/java/com/google/protobuf/Proto3MessageFactory.java \ - java/core/src/test/java/com/google/protobuf/Proto3MessageInfoFactory.java \ - java/core/src/test/java/com/google/protobuf/Proto3MessageLiteFactory.java \ - java/core/src/test/java/com/google/protobuf/Proto3MessageLiteInfoFactory.java \ - java/core/src/test/java/com/google/protobuf/Proto3SchemaTest.java \ - java/core/src/test/java/com/google/protobuf/ProtobufArrayListTest.java \ - java/core/src/test/java/com/google/protobuf/RepeatedFieldBuilderV3Test.java \ - java/core/src/test/java/com/google/protobuf/RopeByteStringSubstringTest.java \ - java/core/src/test/java/com/google/protobuf/RopeByteStringTest.java \ - java/core/src/test/java/com/google/protobuf/ServiceTest.java \ - java/core/src/test/java/com/google/protobuf/SingleFieldBuilderV3Test.java \ - java/core/src/test/java/com/google/protobuf/SmallSortedMapTest.java \ - java/core/src/test/java/com/google/protobuf/TestBadIdentifiers.java \ - java/core/src/test/java/com/google/protobuf/TestBadIdentifiersLite.java \ - java/core/src/test/java/com/google/protobuf/TestSchemas.java \ - java/core/src/test/java/com/google/protobuf/TestSchemasLite.java \ - java/core/src/test/java/com/google/protobuf/TestUtil.java \ - java/core/src/test/java/com/google/protobuf/TestUtilLite.java \ - java/core/src/test/java/com/google/protobuf/TextFormatParseInfoTreeTest.java \ - java/core/src/test/java/com/google/protobuf/TextFormatParseLocationTest.java \ - java/core/src/test/java/com/google/protobuf/TextFormatTest.java \ - java/core/src/test/java/com/google/protobuf/TypeRegistryTest.java \ - java/core/src/test/java/com/google/protobuf/UnknownEnumValueTest.java \ - java/core/src/test/java/com/google/protobuf/UnknownFieldSetTest.java \ - java/core/src/test/java/com/google/protobuf/UnknownFieldSetPerformanceTest.java \ - java/core/src/test/java/com/google/protobuf/UnmodifiableLazyStringListTest.java \ - java/core/src/test/java/com/google/protobuf/Utf8Test.java \ - java/core/src/test/java/com/google/protobuf/Utf8Utils.java \ - java/core/src/test/java/com/google/protobuf/WellKnownTypesTest.java \ - java/core/src/test/java/com/google/protobuf/WireFormatLiteTest.java \ - java/core/src/test/java/com/google/protobuf/WireFormatTest.java \ - java/core/src/test/java/com/google/protobuf/WrappersLiteOfMethodTest.java \ - java/core/src/test/java/com/google/protobuf/WrappersOfMethodTest.java \ - java/core/src/test/proto/com/google/protobuf/any_test.proto \ - java/core/src/test/proto/com/google/protobuf/cached_field_size_test.proto \ - java/core/src/test/proto/com/google/protobuf/deprecated_file.proto \ - java/core/src/test/proto/com/google/protobuf/field_presence_test.proto \ - java/core/src/test/proto/com/google/protobuf/lazy_fields_lite.proto \ - java/core/src/test/proto/com/google/protobuf/lite_equals_and_hash.proto \ - java/core/src/test/proto/com/google/protobuf/map_for_proto2_lite_test.proto \ - java/core/src/test/proto/com/google/protobuf/map_for_proto2_test.proto \ - java/core/src/test/proto/com/google/protobuf/map_initialization_order_test.proto \ - java/core/src/test/proto/com/google/protobuf/map_lite_test.proto \ - java/core/src/test/proto/com/google/protobuf/map_test.proto \ - java/core/src/test/proto/com/google/protobuf/message_lite_extension_util_test.proto\ - java/core/src/test/proto/com/google/protobuf/multiple_files_test.proto \ - java/core/src/test/proto/com/google/protobuf/nested_builders_test.proto \ - java/core/src/test/proto/com/google/protobuf/nested_extension.proto \ - java/core/src/test/proto/com/google/protobuf/nested_extension_lite.proto \ - java/core/src/test/proto/com/google/protobuf/non_nested_extension.proto \ - java/core/src/test/proto/com/google/protobuf/non_nested_extension_lite.proto \ - java/core/src/test/proto/com/google/protobuf/outer_class_name_test.proto \ - java/core/src/test/proto/com/google/protobuf/outer_class_name_test2.proto \ - java/core/src/test/proto/com/google/protobuf/outer_class_name_test3.proto \ - java/core/src/test/proto/com/google/protobuf/packed_field_test.proto \ - java/core/src/test/proto/com/google/protobuf/proto2_message.proto \ - java/core/src/test/proto/com/google/protobuf/proto2_message_lite.proto \ - java/core/src/test/proto/com/google/protobuf/proto2_unknown_enum_values.proto \ - java/core/src/test/proto/com/google/protobuf/proto3_message.proto \ - java/core/src/test/proto/com/google/protobuf/proto3_message_lite.proto \ - java/core/src/test/proto/com/google/protobuf/test_bad_identifiers.proto \ - java/core/src/test/proto/com/google/protobuf/test_check_utf8.proto \ - java/core/src/test/proto/com/google/protobuf/test_check_utf8_size.proto \ - java/core/src/test/proto/com/google/protobuf/test_custom_options.proto \ - java/core/src/test/proto/com/google/protobuf/wrappers_test.proto \ - java/internal/BUILD \ - java/internal/testing.bzl \ - java/kotlin/generate-sources-build.xml \ - java/kotlin/generate-test-sources-build.xml \ - java/kotlin/pom.xml \ - java/kotlin/src/main/kotlin/com/google/protobuf/ByteStrings.kt \ - java/kotlin/src/main/kotlin/com/google/protobuf/DslList.kt \ - java/kotlin/src/main/kotlin/com/google/protobuf/DslMap.kt \ - java/kotlin/src/main/kotlin/com/google/protobuf/DslProxy.kt \ - java/kotlin/src/main/kotlin/com/google/protobuf/ExtendableMessageExtensions.kt \ - java/kotlin/src/main/kotlin/com/google/protobuf/ExtendableMessageLiteExtensions.kt\ - java/kotlin/src/main/kotlin/com/google/protobuf/ExtensionList.kt \ - java/kotlin/src/main/kotlin/com/google/protobuf/OnlyForUseByGeneratedProtoCode.kt\ - java/kotlin/src/main/kotlin/com/google/protobuf/ProtoDslMarker.kt \ - java/kotlin/src/main/kotlin/com/google/protobuf/UnmodifiableCollections.kt \ - java/kotlin/src/test/kotlin/com/google/protobuf/ByteStringsTest.kt \ - java/kotlin/src/test/kotlin/com/google/protobuf/DslListTest.kt \ - java/kotlin/src/test/kotlin/com/google/protobuf/DslMapTest.kt \ - java/kotlin/src/test/kotlin/com/google/protobuf/ExtendableMessageExtensionsTest.kt\ - java/kotlin/src/test/kotlin/com/google/protobuf/ExtensionListTest.kt \ - java/kotlin/src/test/kotlin/com/google/protobuf/Proto2Test.kt \ - java/kotlin/src/test/kotlin/com/google/protobuf/Proto3Test.kt \ - java/kotlin/src/test/proto/com/google/protobuf/evil_names_proto2.proto \ - java/kotlin/src/test/proto/com/google/protobuf/evil_names_proto3.proto \ - java/kotlin/src/test/proto/com/google/protobuf/example_extensible_message.proto \ - java/kotlin/src/test/proto/com/google/protobuf/multiple_files_proto3.proto \ - java/kotlin-lite/generate-sources-build.xml \ - java/kotlin-lite/generate-test-sources-build.xml \ - java/kotlin-lite/lite.awk \ - java/kotlin-lite/pom.xml \ - java/kotlin-lite/process-lite-sources-build.xml \ - java/kotlin-lite/src/test/kotlin/com/google/protobuf/ExtendableMessageLiteExtensionsTest.kt\ - java/kotlin-lite/src/test/kotlin/com/google/protobuf/Proto2LiteTest.kt \ - java/lite.md \ - java/lite/BUILD \ - java/lite/generate-sources-build.xml \ - java/lite/generate-test-sources-build.xml \ - java/lite/lite.awk \ - java/lite/pom.xml \ - java/lite/pom_template.xml \ - java/lite/process-lite-sources-build.xml \ - java/lite/src/test/java/com/google/protobuf/LiteTest.java \ - java/lite/src/test/java/com/google/protobuf/Proto2MessageLiteInfoFactory.java \ - java/BUILD \ - java/pom.xml \ - java/util/BUILD \ - java/util/pom.xml \ - java/util/pom_template.xml \ - java/util/src/main/java/com/google/protobuf/util/Durations.java \ - java/util/src/main/java/com/google/protobuf/util/FieldMaskTree.java \ - java/util/src/main/java/com/google/protobuf/util/FieldMaskUtil.java \ - java/util/src/main/java/com/google/protobuf/util/JsonFormat.java \ - java/util/src/main/java/com/google/protobuf/util/Structs.java \ - java/util/src/main/java/com/google/protobuf/util/Timestamps.java \ - java/util/src/main/java/com/google/protobuf/util/Values.java \ - java/util/src/test/java/com/google/protobuf/util/FieldMaskTreeTest.java \ - java/util/src/test/java/com/google/protobuf/util/FieldMaskUtilTest.java \ - java/util/src/test/java/com/google/protobuf/util/JsonFormatTest.java \ - java/util/src/test/java/com/google/protobuf/util/StructsTest.java \ - java/util/src/test/java/com/google/protobuf/util/ValuesTest.java \ - java/util/src/test/proto/com/google/protobuf/util/json_test.proto - -objectivec_EXTRA_DIST = \ - objectivec/.clang-format \ - objectivec/BUILD \ - objectivec/DevTools/check_version_stamps.sh \ - objectivec/DevTools/compile_testing_protos.sh \ - objectivec/DevTools/full_mac_build.sh \ - objectivec/DevTools/pddm.py \ - objectivec/DevTools/pddm_tests.py \ - objectivec/generate_well_known_types.sh \ - objectivec/google/protobuf/Any.pbobjc.h \ - objectivec/google/protobuf/Api.pbobjc.h \ - objectivec/google/protobuf/Duration.pbobjc.h \ - objectivec/google/protobuf/Empty.pbobjc.h \ - objectivec/google/protobuf/FieldMask.pbobjc.h \ - objectivec/google/protobuf/SourceContext.pbobjc.h \ - objectivec/google/protobuf/Struct.pbobjc.h \ - objectivec/google/protobuf/Timestamp.pbobjc.h \ - objectivec/google/protobuf/Type.pbobjc.h \ - objectivec/google/protobuf/Wrappers.pbobjc.h \ - objectivec/GPBAny.pbobjc.h \ - objectivec/GPBAny.pbobjc.m \ - objectivec/GPBApi.pbobjc.h \ - objectivec/GPBApi.pbobjc.m \ - objectivec/GPBArray.h \ - objectivec/GPBArray.m \ - objectivec/GPBArray_PackagePrivate.h \ - objectivec/GPBBootstrap.h \ - objectivec/GPBCodedInputStream.h \ - objectivec/GPBCodedInputStream.m \ - objectivec/GPBCodedInputStream_PackagePrivate.h \ - objectivec/GPBCodedOutputStream.h \ - objectivec/GPBCodedOutputStream.m \ - objectivec/GPBCodedOutputStream_PackagePrivate.h \ - objectivec/GPBDescriptor.h \ - objectivec/GPBDescriptor.m \ - objectivec/GPBDescriptor_PackagePrivate.h \ - objectivec/GPBDictionary.h \ - objectivec/GPBDictionary.m \ - objectivec/GPBDictionary_PackagePrivate.h \ - objectivec/GPBDuration.pbobjc.h \ - objectivec/GPBDuration.pbobjc.m \ - objectivec/GPBEmpty.pbobjc.h \ - objectivec/GPBEmpty.pbobjc.m \ - objectivec/GPBExtensionInternals.h \ - objectivec/GPBExtensionInternals.m \ - objectivec/GPBExtensionRegistry.h \ - objectivec/GPBExtensionRegistry.m \ - objectivec/GPBFieldMask.pbobjc.h \ - objectivec/GPBFieldMask.pbobjc.m \ - objectivec/GPBMessage.h \ - objectivec/GPBMessage.m \ - objectivec/GPBMessage_PackagePrivate.h \ - objectivec/GPBProtocolBuffers.h \ - objectivec/GPBProtocolBuffers.m \ - objectivec/GPBProtocolBuffers_RuntimeSupport.h \ - objectivec/GPBRootObject.h \ - objectivec/GPBRootObject.m \ - objectivec/GPBRootObject_PackagePrivate.h \ - objectivec/GPBRuntimeTypes.h \ - objectivec/GPBSourceContext.pbobjc.h \ - objectivec/GPBSourceContext.pbobjc.m \ - objectivec/GPBStruct.pbobjc.h \ - objectivec/GPBStruct.pbobjc.m \ - objectivec/GPBTimestamp.pbobjc.h \ - objectivec/GPBTimestamp.pbobjc.m \ - objectivec/GPBType.pbobjc.h \ - objectivec/GPBType.pbobjc.m \ - objectivec/GPBUnknownField.h \ - objectivec/GPBUnknownField.m \ - objectivec/GPBUnknownField_PackagePrivate.h \ - objectivec/GPBUnknownFieldSet.h \ - objectivec/GPBUnknownFieldSet.m \ - objectivec/GPBUnknownFieldSet_PackagePrivate.h \ - objectivec/GPBUtilities.h \ - objectivec/GPBUtilities.m \ - objectivec/GPBUtilities_PackagePrivate.h \ - objectivec/GPBWellKnownTypes.h \ - objectivec/GPBWellKnownTypes.m \ - objectivec/GPBWireFormat.h \ - objectivec/GPBWireFormat.m \ - objectivec/GPBWrappers.pbobjc.h \ - objectivec/GPBWrappers.pbobjc.m \ - objectivec/ProtocolBuffers_iOS.xcodeproj/project.pbxproj \ - objectivec/ProtocolBuffers_iOS.xcodeproj/project.xcworkspace/contents.xcworkspacedata \ - objectivec/ProtocolBuffers_iOS.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist \ - objectivec/ProtocolBuffers_iOS.xcodeproj/project.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings \ - objectivec/ProtocolBuffers_iOS.xcodeproj/xcshareddata/xcschemes/PerformanceTests.xcscheme \ - objectivec/ProtocolBuffers_iOS.xcodeproj/xcshareddata/xcschemes/ProtocolBuffers.xcscheme \ - objectivec/ProtocolBuffers_OSX.xcodeproj/project.pbxproj \ - objectivec/ProtocolBuffers_OSX.xcodeproj/project.xcworkspace/contents.xcworkspacedata \ - objectivec/ProtocolBuffers_OSX.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist \ - objectivec/ProtocolBuffers_OSX.xcodeproj/project.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings \ - objectivec/ProtocolBuffers_OSX.xcodeproj/xcshareddata/xcschemes/PerformanceTests.xcscheme \ - objectivec/ProtocolBuffers_OSX.xcodeproj/xcshareddata/xcschemes/ProtocolBuffers.xcscheme \ - objectivec/ProtocolBuffers_tvOS.xcodeproj/project.pbxproj \ - objectivec/ProtocolBuffers_tvOS.xcodeproj/project.xcworkspace/contents.xcworkspacedata \ - objectivec/ProtocolBuffers_tvOS.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist \ - objectivec/ProtocolBuffers_tvOS.xcodeproj/project.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings \ - objectivec/ProtocolBuffers_tvOS.xcodeproj/xcshareddata/xcschemes/PerformanceTests.xcscheme \ - objectivec/ProtocolBuffers_tvOS.xcodeproj/xcshareddata/xcschemes/ProtocolBuffers.xcscheme \ - objectivec/README.md \ - objectivec/Tests/CocoaPods/OSXCocoaPodsTester/OSXCocoaPodsTester.xcodeproj/project.pbxproj \ - objectivec/Tests/CocoaPods/OSXCocoaPodsTester/OSXCocoaPodsTester.xcodeproj/project.xcworkspace/contents.xcworkspacedata \ - objectivec/Tests/CocoaPods/OSXCocoaPodsTester/OSXCocoaPodsTester.xcodeproj/xcshareddata/xcschemes/OSXCocoaPodsTester.xcscheme \ - objectivec/Tests/CocoaPods/OSXCocoaPodsTester/OSXCocoaPodsTester/AppDelegate.h \ - objectivec/Tests/CocoaPods/OSXCocoaPodsTester/OSXCocoaPodsTester/AppDelegate.m \ - objectivec/Tests/CocoaPods/OSXCocoaPodsTester/OSXCocoaPodsTester/Assets.xcassets/AppIcon.appiconset/Contents.json \ - objectivec/Tests/CocoaPods/OSXCocoaPodsTester/OSXCocoaPodsTester/Base.lproj/MainMenu.xib \ - objectivec/Tests/CocoaPods/OSXCocoaPodsTester/OSXCocoaPodsTester/Info.plist \ - objectivec/Tests/CocoaPods/OSXCocoaPodsTester/OSXCocoaPodsTester/main.m \ - objectivec/Tests/CocoaPods/OSXCocoaPodsTester/Podfile-framework \ - objectivec/Tests/CocoaPods/OSXCocoaPodsTester/Podfile-static \ - objectivec/Tests/CocoaPods/README.md \ - objectivec/Tests/CocoaPods/iOSCocoaPodsTester/Podfile-framework \ - objectivec/Tests/CocoaPods/iOSCocoaPodsTester/Podfile-static \ - objectivec/Tests/CocoaPods/iOSCocoaPodsTester/iOSCocoaPodsTester.xcodeproj/project.pbxproj \ - objectivec/Tests/CocoaPods/iOSCocoaPodsTester/iOSCocoaPodsTester.xcodeproj/project.xcworkspace/contents.xcworkspacedata \ - objectivec/Tests/CocoaPods/iOSCocoaPodsTester/iOSCocoaPodsTester.xcodeproj/xcshareddata/xcschemes/iOSCocoaPodsTester.xcscheme \ - objectivec/Tests/CocoaPods/iOSCocoaPodsTester/iOSCocoaPodsTester/AppDelegate.h \ - objectivec/Tests/CocoaPods/iOSCocoaPodsTester/iOSCocoaPodsTester/AppDelegate.m \ - objectivec/Tests/CocoaPods/iOSCocoaPodsTester/iOSCocoaPodsTester/Assets.xcassets/AppIcon.appiconset/Contents.json \ - objectivec/Tests/CocoaPods/iOSCocoaPodsTester/iOSCocoaPodsTester/Base.lproj/LaunchScreen.storyboard \ - objectivec/Tests/CocoaPods/iOSCocoaPodsTester/iOSCocoaPodsTester/Base.lproj/Main.storyboard \ - objectivec/Tests/CocoaPods/iOSCocoaPodsTester/iOSCocoaPodsTester/Info.plist \ - objectivec/Tests/CocoaPods/iOSCocoaPodsTester/iOSCocoaPodsTester/ViewController.h \ - objectivec/Tests/CocoaPods/iOSCocoaPodsTester/iOSCocoaPodsTester/ViewController.m \ - objectivec/Tests/CocoaPods/iOSCocoaPodsTester/iOSCocoaPodsTester/main.m \ - objectivec/Tests/CocoaPods/run_tests.sh \ - objectivec/Tests/golden_message \ - objectivec/Tests/golden_packed_fields_message \ - objectivec/Tests/GPBARCUnittestProtos.m \ - objectivec/Tests/GPBArrayTests.m \ - objectivec/Tests/GPBCodedInputStreamTests.m \ - objectivec/Tests/GPBCodedOuputStreamTests.m \ - objectivec/Tests/GPBCompileTest01.m \ - objectivec/Tests/GPBCompileTest02.m \ - objectivec/Tests/GPBCompileTest03.m \ - objectivec/Tests/GPBCompileTest04.m \ - objectivec/Tests/GPBCompileTest05.m \ - objectivec/Tests/GPBCompileTest06.m \ - objectivec/Tests/GPBCompileTest07.m \ - objectivec/Tests/GPBCompileTest08.m \ - objectivec/Tests/GPBCompileTest09.m \ - objectivec/Tests/GPBCompileTest10.m \ - objectivec/Tests/GPBCompileTest11.m \ - objectivec/Tests/GPBCompileTest12.m \ - objectivec/Tests/GPBCompileTest13.m \ - objectivec/Tests/GPBCompileTest14.m \ - objectivec/Tests/GPBCompileTest15.m \ - objectivec/Tests/GPBCompileTest16.m \ - objectivec/Tests/GPBCompileTest17.m \ - objectivec/Tests/GPBCompileTest18.m \ - objectivec/Tests/GPBCompileTest19.m \ - objectivec/Tests/GPBCompileTest20.m \ - objectivec/Tests/GPBCompileTest21.m \ - objectivec/Tests/GPBCompileTest22.m \ - objectivec/Tests/GPBCompileTest23.m \ - objectivec/Tests/GPBCompileTest24.m \ - objectivec/Tests/GPBCompileTest25.m \ - objectivec/Tests/GPBConcurrencyTests.m \ - objectivec/Tests/GPBDescriptorTests.m \ - objectivec/Tests/GPBDictionaryTests+Bool.m \ - objectivec/Tests/GPBDictionaryTests+Int32.m \ - objectivec/Tests/GPBDictionaryTests+Int64.m \ - objectivec/Tests/GPBDictionaryTests+String.m \ - objectivec/Tests/GPBDictionaryTests+UInt32.m \ - objectivec/Tests/GPBDictionaryTests+UInt64.m \ - objectivec/Tests/GPBDictionaryTests.m \ - objectivec/Tests/GPBDictionaryTests.pddm \ - objectivec/Tests/GPBExtensionRegistryTest.m \ - objectivec/Tests/GPBMessageTests+ClassNames.m \ - objectivec/Tests/GPBMessageTests+Merge.m \ - objectivec/Tests/GPBMessageTests+Runtime.m \ - objectivec/Tests/GPBMessageTests+Serialization.m \ - objectivec/Tests/GPBMessageTests.m \ - objectivec/Tests/GPBObjectiveCPlusPlusTest.mm \ - objectivec/Tests/GPBPerfTests.m \ - objectivec/Tests/GPBSwiftTests.swift \ - objectivec/Tests/GPBTestUtilities.h \ - objectivec/Tests/GPBTestUtilities.m \ - objectivec/Tests/GPBUnittestProtos.m \ - objectivec/Tests/GPBUnittestProtos2.m \ - objectivec/Tests/GPBUnknownFieldSetTest.m \ - objectivec/Tests/GPBUtilitiesTests.m \ - objectivec/Tests/GPBWellKnownTypesTest.m \ - objectivec/Tests/GPBWireFormatTests.m \ - objectivec/Tests/text_format_extensions_unittest_data.txt \ - objectivec/Tests/text_format_map_unittest_data.txt \ - objectivec/Tests/text_format_unittest_data.txt \ - objectivec/Tests/unittest_cycle.proto \ - objectivec/Tests/unittest_deprecated.proto \ - objectivec/Tests/unittest_deprecated_file.proto \ - objectivec/Tests/unittest_extension_chain_a.proto \ - objectivec/Tests/unittest_extension_chain_b.proto \ - objectivec/Tests/unittest_extension_chain_c.proto \ - objectivec/Tests/unittest_extension_chain_d.proto \ - objectivec/Tests/unittest_extension_chain_e.proto \ - objectivec/Tests/unittest_extension_chain_f.proto \ - objectivec/Tests/unittest_extension_chain_g.proto \ - objectivec/Tests/unittest_objc.proto \ - objectivec/Tests/unittest_objc_options.proto \ - objectivec/Tests/unittest_objc_startup.proto \ - objectivec/Tests/unittest_runtime_proto2.proto \ - objectivec/Tests/unittest_runtime_proto3.proto \ - objectivec/Tests/UnitTests-Bridging-Header.h \ - objectivec/Tests/UnitTests-Info.plist \ - Protobuf.podspec - -php_EXTRA_DIST = \ - composer.json \ - php/README.md \ - php/REFCOUNTING.md \ - php/composer.json \ - php/ext/google/protobuf/arena.c \ - php/ext/google/protobuf/arena.h \ - php/ext/google/protobuf/array.c \ - php/ext/google/protobuf/array.h \ - php/ext/google/protobuf/config.m4 \ - php/ext/google/protobuf/convert.c \ - php/ext/google/protobuf/convert.h \ - php/ext/google/protobuf/def.c \ - php/ext/google/protobuf/def.h \ - php/ext/google/protobuf/map.c \ - php/ext/google/protobuf/map.h \ - php/ext/google/protobuf/message.c \ - php/ext/google/protobuf/message.h \ - php/ext/google/protobuf/names.c \ - php/ext/google/protobuf/names.h \ - php/ext/google/protobuf/package.xml \ - php/ext/google/protobuf/php-upb.c \ - php/ext/google/protobuf/php-upb.h \ - php/ext/google/protobuf/protobuf.c \ - php/ext/google/protobuf/protobuf.h \ - php/ext/google/protobuf/wkt.inc \ - php/generate_descriptor_protos.sh \ - php/generate_test_protos.sh \ - php/release.sh \ - php/src/GPBMetadata/Google/Protobuf/Any.php \ - php/src/GPBMetadata/Google/Protobuf/Api.php \ - php/src/GPBMetadata/Google/Protobuf/Duration.php \ - php/src/GPBMetadata/Google/Protobuf/FieldMask.php \ - php/src/GPBMetadata/Google/Protobuf/GPBEmpty.php \ - php/src/GPBMetadata/Google/Protobuf/Internal/Descriptor.php \ - php/src/GPBMetadata/Google/Protobuf/SourceContext.php \ - php/src/GPBMetadata/Google/Protobuf/Struct.php \ - php/src/GPBMetadata/Google/Protobuf/Timestamp.php \ - php/src/GPBMetadata/Google/Protobuf/Type.php \ - php/src/GPBMetadata/Google/Protobuf/Wrappers.php \ - php/src/Google/Protobuf/Any.php \ - php/src/Google/Protobuf/Api.php \ - php/src/Google/Protobuf/BoolValue.php \ - php/src/Google/Protobuf/BytesValue.php \ - php/src/Google/Protobuf/Descriptor.php \ - php/src/Google/Protobuf/DescriptorPool.php \ - php/src/Google/Protobuf/DoubleValue.php \ - php/src/Google/Protobuf/Duration.php \ - php/src/Google/Protobuf/Enum.php \ - php/src/Google/Protobuf/EnumDescriptor.php \ - php/src/Google/Protobuf/EnumValue.php \ - php/src/Google/Protobuf/EnumValueDescriptor.php \ - php/src/Google/Protobuf/Field.php \ - php/src/Google/Protobuf/FieldDescriptor.php \ - php/src/Google/Protobuf/FieldMask.php \ - php/src/Google/Protobuf/Field/Cardinality.php \ - php/src/Google/Protobuf/Field_Cardinality.php \ - php/src/Google/Protobuf/Field/Kind.php \ - php/src/Google/Protobuf/Field_Kind.php \ - php/src/Google/Protobuf/FloatValue.php \ - php/src/Google/Protobuf/GPBEmpty.php \ - php/src/Google/Protobuf/Int32Value.php \ - php/src/Google/Protobuf/Int64Value.php \ - php/src/Google/Protobuf/Internal/AnyBase.php \ - php/src/Google/Protobuf/Internal/CodedInputStream.php \ - php/src/Google/Protobuf/Internal/CodedOutputStream.php \ - php/src/Google/Protobuf/Internal/Descriptor.php \ - php/src/Google/Protobuf/Internal/DescriptorPool.php \ - php/src/Google/Protobuf/Internal/DescriptorProto.php \ - php/src/Google/Protobuf/Internal/DescriptorProto/ExtensionRange.php \ - php/src/Google/Protobuf/Internal/DescriptorProto/ReservedRange.php \ - php/src/Google/Protobuf/Internal/EnumBuilderContext.php \ - php/src/Google/Protobuf/Internal/EnumDescriptor.php \ - php/src/Google/Protobuf/Internal/EnumDescriptorProto.php \ - php/src/Google/Protobuf/Internal/EnumDescriptorProto/EnumReservedRange.php \ - php/src/Google/Protobuf/Internal/EnumOptions.php \ - php/src/Google/Protobuf/Internal/EnumValueDescriptorProto.php \ - php/src/Google/Protobuf/Internal/EnumValueOptions.php \ - php/src/Google/Protobuf/Internal/ExtensionRangeOptions.php \ - php/src/Google/Protobuf/Internal/FieldDescriptorProto.php \ - php/src/Google/Protobuf/Internal/FieldDescriptor.php \ - php/src/Google/Protobuf/Internal/FieldDescriptorProto.php \ - php/src/Google/Protobuf/Internal/FieldDescriptorProto/Label.php \ - php/src/Google/Protobuf/Internal/FieldDescriptorProto/Type.php \ - php/src/Google/Protobuf/Internal/FieldOptions.php \ - php/src/Google/Protobuf/Internal/FieldOptions/CType.php \ - php/src/Google/Protobuf/Internal/FieldOptions/JSType.php \ - php/src/Google/Protobuf/Internal/FileDescriptor.php \ - php/src/Google/Protobuf/Internal/FileDescriptorProto.php \ - php/src/Google/Protobuf/Internal/FileDescriptorSet.php \ - php/src/Google/Protobuf/Internal/FileOptions.php \ - php/src/Google/Protobuf/Internal/FileOptions/OptimizeMode.php \ - php/src/Google/Protobuf/Internal/GPBDecodeException.php \ - php/src/Google/Protobuf/Internal/GPBJsonWire.php \ - php/src/Google/Protobuf/Internal/GPBLabel.php \ - php/src/Google/Protobuf/Internal/GPBType.php \ - php/src/Google/Protobuf/Internal/GPBUtil.php \ - php/src/Google/Protobuf/Internal/GPBWire.php \ - php/src/Google/Protobuf/Internal/GPBWireType.php \ - php/src/Google/Protobuf/Internal/GeneratedCodeInfo.php \ - php/src/Google/Protobuf/Internal/GeneratedCodeInfo/Annotation.php \ - php/src/Google/Protobuf/Internal/GetPublicDescriptorTrait.php \ - php/src/Google/Protobuf/Internal/HasPublicDescriptorTrait.php \ - php/src/Google/Protobuf/Internal/MapEntry.php \ - php/src/Google/Protobuf/Internal/MapField.php \ - php/src/Google/Protobuf/Internal/MapFieldIter.php \ - php/src/Google/Protobuf/Internal/Message.php \ - php/src/Google/Protobuf/Internal/MessageBuilderContext.php \ - php/src/Google/Protobuf/Internal/MessageOptions.php \ - php/src/Google/Protobuf/Internal/MethodDescriptorProto.php \ - php/src/Google/Protobuf/Internal/MethodOptions.php \ - php/src/Google/Protobuf/Internal/MethodOptions/IdempotencyLevel.php \ - php/src/Google/Protobuf/Internal/OneofDescriptor.php \ - php/src/Google/Protobuf/Internal/OneofDescriptorProto.php \ - php/src/Google/Protobuf/Internal/OneofField.php \ - php/src/Google/Protobuf/Internal/OneofOptions.php \ - php/src/Google/Protobuf/Internal/RawInputStream.php \ - php/src/Google/Protobuf/Internal/RepeatedField.php \ - php/src/Google/Protobuf/Internal/RepeatedFieldIter.php \ - php/src/Google/Protobuf/Internal/ServiceDescriptorProto.php \ - php/src/Google/Protobuf/Internal/ServiceOptions.php \ - php/src/Google/Protobuf/Internal/SourceCodeInfo.php \ - php/src/Google/Protobuf/Internal/SourceCodeInfo/Location.php \ - php/src/Google/Protobuf/Internal/TimestampBase.php \ - php/src/Google/Protobuf/Internal/UninterpretedOption.php \ - php/src/Google/Protobuf/Internal/UninterpretedOption/NamePart.php \ - php/src/Google/Protobuf/Internal/DescriptorProto_ExtensionRange.php \ - php/src/Google/Protobuf/Internal/DescriptorProto_ReservedRange.php \ - php/src/Google/Protobuf/Internal/EnumDescriptorProto_EnumReservedRange.php \ - php/src/Google/Protobuf/Internal/FieldDescriptorProto_Label.php \ - php/src/Google/Protobuf/Internal/FieldDescriptorProto_Type.php \ - php/src/Google/Protobuf/Internal/FieldOptions_CType.php \ - php/src/Google/Protobuf/Internal/FieldOptions_JSType.php \ - php/src/Google/Protobuf/Internal/FileOptions_OptimizeMode.php \ - php/src/Google/Protobuf/Internal/GeneratedCodeInfo_Annotation.php \ - php/src/Google/Protobuf/Internal/MethodOptions_IdempotencyLevel.php \ - php/src/Google/Protobuf/Internal/SourceCodeInfo_Location.php \ - php/src/Google/Protobuf/Internal/UninterpretedOption_NamePart.php \ - php/src/Google/Protobuf/ListValue.php \ - php/src/Google/Protobuf/Method.php \ - php/src/Google/Protobuf/Mixin.php \ - php/src/Google/Protobuf/NullValue.php \ - php/src/Google/Protobuf/OneofDescriptor.php \ - php/src/Google/Protobuf/Option.php \ - php/src/Google/Protobuf/SourceContext.php \ - php/src/Google/Protobuf/StringValue.php \ - php/src/Google/Protobuf/Struct.php \ - php/src/Google/Protobuf/Syntax.php \ - php/src/Google/Protobuf/Timestamp.php \ - php/src/Google/Protobuf/Type.php \ - php/src/Google/Protobuf/UInt32Value.php \ - php/src/Google/Protobuf/UInt64Value.php \ - php/src/Google/Protobuf/Value.php \ - php/src/phpdoc.dist.xml \ - php/tests/ArrayTest.php \ - php/tests/compatibility_test.sh \ - php/tests/compile_extension.sh \ - php/tests/DescriptorsTest.php \ - php/tests/EncodeDecodeTest.php \ - php/tests/force_c_ext.php \ - php/tests/gdb_test.sh \ - php/tests/GeneratedClassTest.php \ - php/tests/GeneratedPhpdocTest.php \ - php/tests/GeneratedServiceTest.php \ - php/tests/MapFieldTest.php \ - php/tests/memory_leak_test.php \ - php/tests/memory_leak_test.sh \ - php/tests/multirequest.php \ - php/tests/multirequest.sh \ - php/tests/PhpImplementationTest.php \ - php/tests/proto/empty/echo.proto \ - php/tests/proto/test.proto \ - php/tests/proto/test_descriptors.proto \ - php/tests/proto/test_empty_php_namespace.proto \ - php/tests/proto/test_import_descriptor_proto.proto \ - php/tests/proto/test_include.proto \ - php/tests/proto/test_no_namespace.proto \ - php/tests/proto/test_php_namespace.proto \ - php/tests/proto/test_prefix.proto \ - php/tests/proto/test_reserved_enum_lower.proto \ - php/tests/proto/test_reserved_enum_upper.proto \ - php/tests/proto/test_reserved_enum_value_lower.proto \ - php/tests/proto/test_reserved_enum_value_upper.proto \ - php/tests/proto/test_reserved_message_lower.proto \ - php/tests/proto/test_reserved_message_upper.proto \ - php/tests/proto/test_service.proto \ - php/tests/proto/test_service_namespace.proto \ - php/tests/proto/test_wrapper_type_setters.proto \ - php/tests/test_base.php \ - php/tests/test_util.php \ - php/tests/valgrind.supp \ - php/tests/WellKnownTest.php \ - php/tests/WrapperTypeSettersTest.php - -python_EXTRA_DIST = \ - python/MANIFEST.in \ - python/google/__init__.py \ - python/google/protobuf/__init__.py \ - python/google/protobuf/compiler/__init__.py \ - python/google/protobuf/descriptor.py \ - python/google/protobuf/descriptor_database.py \ - python/google/protobuf/descriptor_pool.py \ - python/google/protobuf/internal/__init__.py \ - python/google/protobuf/internal/_parameterized.py \ - python/google/protobuf/internal/any_test.proto \ - python/google/protobuf/internal/any_test.proto \ - python/google/protobuf/internal/api_implementation.cc \ - python/google/protobuf/internal/api_implementation.py \ - python/google/protobuf/internal/containers.py \ - python/google/protobuf/internal/decoder.py \ - python/google/protobuf/internal/descriptor_database_test.py \ - python/google/protobuf/internal/descriptor_pool_test.py \ - python/google/protobuf/internal/descriptor_pool_test1.proto \ - python/google/protobuf/internal/descriptor_pool_test2.proto \ - python/google/protobuf/internal/descriptor_test.py \ - python/google/protobuf/internal/encoder.py \ - python/google/protobuf/internal/enum_type_wrapper.py \ - python/google/protobuf/internal/extension_dict.py \ - python/google/protobuf/internal/factory_test1.proto \ - python/google/protobuf/internal/factory_test2.proto \ - python/google/protobuf/internal/file_options_test.proto \ - python/google/protobuf/internal/generator_test.py \ - python/google/protobuf/internal/import_test_package/__init__.py \ - python/google/protobuf/internal/import_test_package/inner.proto \ - python/google/protobuf/internal/import_test_package/outer.proto \ - python/google/protobuf/internal/json_format_test.py \ - python/google/protobuf/internal/keywords_test.py \ - python/google/protobuf/internal/message_factory_test.py \ - python/google/protobuf/internal/message_listener.py \ - python/google/protobuf/internal/message_set_extensions.proto \ - python/google/protobuf/internal/message_test.py \ - python/google/protobuf/internal/missing_enum_values.proto \ - python/google/protobuf/internal/more_extensions.proto \ - python/google/protobuf/internal/more_extensions_dynamic.proto \ - python/google/protobuf/internal/more_messages.proto \ - python/google/protobuf/internal/no_package.proto \ - python/google/protobuf/internal/packed_field_test.proto \ - python/google/protobuf/internal/proto_builder_test.py \ - python/google/protobuf/internal/python_message.py \ - python/google/protobuf/internal/python_protobuf.cc \ - python/google/protobuf/internal/reflection_test.py \ - python/google/protobuf/internal/service_reflection_test.py \ - python/google/protobuf/internal/symbol_database_test.py \ - python/google/protobuf/internal/test_bad_identifiers.proto \ - python/google/protobuf/internal/test_proto3_optional.proto \ - python/google/protobuf/internal/test_util.py \ - python/google/protobuf/internal/testing_refleaks.py \ - python/google/protobuf/internal/text_encoding_test.py \ - python/google/protobuf/internal/text_format_test.py \ - python/google/protobuf/internal/type_checkers.py \ - python/google/protobuf/internal/unknown_fields_test.py \ - python/google/protobuf/internal/well_known_types.py \ - python/google/protobuf/internal/well_known_types.py \ - python/google/protobuf/internal/well_known_types_test.py \ - python/google/protobuf/internal/well_known_types_test.py \ - python/google/protobuf/internal/wire_format.py \ - python/google/protobuf/internal/wire_format_test.py \ - python/google/protobuf/json_format.py \ - python/google/protobuf/message.py \ - python/google/protobuf/message_factory.py \ - python/google/protobuf/proto_api.h \ - python/google/protobuf/proto_builder.py \ - python/google/protobuf/pyext/README \ - python/google/protobuf/pyext/__init__.py \ - python/google/protobuf/pyext/cpp_message.py \ - python/google/protobuf/pyext/descriptor.cc \ - python/google/protobuf/pyext/descriptor.h \ - python/google/protobuf/pyext/descriptor_containers.cc \ - python/google/protobuf/pyext/descriptor_containers.h \ - python/google/protobuf/pyext/descriptor_database.cc \ - python/google/protobuf/pyext/descriptor_database.h \ - python/google/protobuf/pyext/descriptor_pool.cc \ - python/google/protobuf/pyext/descriptor_pool.h \ - python/google/protobuf/pyext/extension_dict.cc \ - python/google/protobuf/pyext/extension_dict.h \ - python/google/protobuf/pyext/map_container.cc \ - python/google/protobuf/pyext/map_container.h \ - python/google/protobuf/pyext/message.cc \ - python/google/protobuf/pyext/message.h \ - python/google/protobuf/pyext/field.cc \ - python/google/protobuf/pyext/field.h \ - python/google/protobuf/pyext/unknown_fields.cc \ - python/google/protobuf/pyext/unknown_fields.h \ - python/google/protobuf/pyext/message_factory.cc \ - python/google/protobuf/pyext/message_factory.h \ - python/google/protobuf/pyext/message_module.cc \ - python/google/protobuf/pyext/proto2_api_test.proto \ - python/google/protobuf/pyext/python.proto \ - python/google/protobuf/pyext/repeated_composite_container.cc \ - python/google/protobuf/pyext/repeated_composite_container.h \ - python/google/protobuf/pyext/repeated_scalar_container.cc \ - python/google/protobuf/pyext/repeated_scalar_container.h \ - python/google/protobuf/pyext/safe_numerics.h \ - python/google/protobuf/pyext/scoped_pyobject_ptr.h \ - python/google/protobuf/python_protobuf.h \ - python/google/protobuf/reflection.py \ - python/google/protobuf/service.py \ - python/google/protobuf/service_reflection.py \ - python/google/protobuf/symbol_database.py \ - python/google/protobuf/text_encoding.py \ - python/google/protobuf/text_format.py \ - python/google/protobuf/util/__init__.py \ - python/release.sh \ - python/mox.py \ - python/setup.cfg \ - python/setup.py \ - python/stubout.py \ - python/tox.ini \ - python/README.md - -ruby_EXTRA_DIST = \ - ruby/Gemfile \ - ruby/.gitignore \ - ruby/README.md \ - ruby/Rakefile \ - ruby/compatibility_tests/v3.0.0/tests/test_import.proto \ - ruby/compatibility_tests/v3.0.0/tests/stress.rb \ - ruby/compatibility_tests/v3.0.0/tests/repeated_field_test.rb \ - ruby/compatibility_tests/v3.0.0/tests/generated_code_test.rb \ - ruby/compatibility_tests/v3.0.0/tests/generated_code.proto \ - ruby/compatibility_tests/v3.0.0/tests/basic.rb \ - ruby/compatibility_tests/v3.0.0/test.sh \ - ruby/compatibility_tests/v3.0.0/Rakefile \ - ruby/compatibility_tests/v3.0.0/README.md \ - ruby/ext/google/protobuf_c/convert.c \ - ruby/ext/google/protobuf_c/convert.h \ - ruby/ext/google/protobuf_c/defs.c \ - ruby/ext/google/protobuf_c/defs.h \ - ruby/ext/google/protobuf_c/extconf.rb \ - ruby/ext/google/protobuf_c/map.c \ - ruby/ext/google/protobuf_c/map.h \ - ruby/ext/google/protobuf_c/message.c \ - ruby/ext/google/protobuf_c/message.h \ - ruby/ext/google/protobuf_c/protobuf.c \ - ruby/ext/google/protobuf_c/protobuf.h \ - ruby/ext/google/protobuf_c/repeated_field.c \ - ruby/ext/google/protobuf_c/repeated_field.h \ - ruby/ext/google/protobuf_c/ruby-upb.c \ - ruby/ext/google/protobuf_c/ruby-upb.h \ - ruby/ext/google/protobuf_c/wrap_memcpy.c \ - ruby/google-protobuf.gemspec \ - ruby/lib/google/protobuf/descriptor_dsl.rb \ - ruby/lib/google/protobuf/message_exts.rb \ - ruby/lib/google/protobuf/repeated_field.rb \ - ruby/lib/google/protobuf/well_known_types.rb \ - ruby/lib/google/protobuf.rb \ - ruby/pom.xml \ - ruby/src/main/java/com/google/protobuf/jruby/RubyDescriptor.java \ - ruby/src/main/java/com/google/protobuf/jruby/RubyDescriptorPool.java \ - ruby/src/main/java/com/google/protobuf/jruby/RubyEnum.java \ - ruby/src/main/java/com/google/protobuf/jruby/RubyEnumDescriptor.java \ - ruby/src/main/java/com/google/protobuf/jruby/RubyFieldDescriptor.java \ - ruby/src/main/java/com/google/protobuf/jruby/RubyFileDescriptor.java \ - ruby/src/main/java/com/google/protobuf/jruby/RubyMap.java \ - ruby/src/main/java/com/google/protobuf/jruby/RubyMessage.java \ - ruby/src/main/java/com/google/protobuf/jruby/RubyOneofDescriptor.java \ - ruby/src/main/java/com/google/protobuf/jruby/RubyProtobuf.java \ - ruby/src/main/java/com/google/protobuf/jruby/RubyRepeatedField.java \ - ruby/src/main/java/com/google/protobuf/jruby/SentinelOuterClass.java \ - ruby/src/main/java/com/google/protobuf/jruby/Utils.java \ - ruby/src/main/java/google/ProtobufJavaService.java \ - ruby/src/main/sentinel.proto \ - ruby/tests/basic_proto2.rb \ - ruby/tests/basic_test_proto2.proto \ - ruby/tests/basic_test.proto \ - ruby/tests/basic.rb \ - ruby/tests/common_tests.rb \ - ruby/tests/encode_decode_test.rb \ - ruby/tests/gc_test.rb \ - ruby/tests/repeated_field_test.rb \ - ruby/tests/stress.rb \ - ruby/tests/generated_code_proto2_test.rb \ - ruby/tests/generated_code_proto2.proto \ - ruby/tests/generated_code.proto \ - ruby/tests/multi_level_nesting_test.proto \ - ruby/tests/multi_level_nesting_test.rb \ - ruby/tests/test_import_proto2.proto \ - ruby/tests/test_import.proto \ - ruby/tests/test_ruby_package_proto2.proto \ - ruby/tests/test_ruby_package.proto \ - ruby/tests/generated_code_test.rb \ - ruby/tests/well_known_types_test.rb \ - ruby/tests/type_errors.rb \ - ruby/travis-test.sh - -js_EXTRA_DIST = \ - js/README.md \ - js/binary/arith.js \ - js/binary/arith_test.js \ - js/binary/constants.js \ - js/binary/decoder.js \ - js/binary/decoder_test.js \ - js/binary/encoder.js \ - js/binary/message_test.js \ - js/binary/proto_test.js \ - js/binary/reader.js \ - js/binary/reader_test.js \ - js/binary/utils.js \ - js/binary/utils_test.js \ - js/binary/writer.js \ - js/binary/writer_test.js \ - js/commonjs/export.js \ - js/commonjs/export_asserts.js \ - js/commonjs/export_testdeps.js \ - js/commonjs/import_test.js \ - js/commonjs/jasmine.json \ - js/commonjs/rewrite_tests_for_commonjs.js \ - js/commonjs/strict_test.js \ - js/commonjs/test6/test6.proto \ - js/commonjs/test7/test7.proto \ - js/compatibility_tests/v3.0.0/binary/arith_test.js \ - js/compatibility_tests/v3.0.0/binary/decoder_test.js \ - js/compatibility_tests/v3.0.0/binary/proto_test.js \ - js/compatibility_tests/v3.0.0/binary/reader_test.js \ - js/compatibility_tests/v3.0.0/binary/utils_test.js \ - js/compatibility_tests/v3.0.0/binary/writer_test.js \ - js/compatibility_tests/v3.0.0/commonjs/export_asserts.js \ - js/compatibility_tests/v3.0.0/commonjs/export_testdeps.js \ - js/compatibility_tests/v3.0.0/commonjs/import_test.js \ - js/compatibility_tests/v3.0.0/commonjs/jasmine.json \ - js/compatibility_tests/v3.0.0/commonjs/rewrite_tests_for_commonjs.js \ - js/compatibility_tests/v3.0.0/commonjs/test6/test6.proto \ - js/compatibility_tests/v3.0.0/commonjs/test7/test7.proto \ - js/compatibility_tests/v3.0.0/data.proto \ - js/compatibility_tests/v3.0.0/debug_test.js \ - js/compatibility_tests/v3.0.0/jasmine1.json \ - js/compatibility_tests/v3.0.0/jasmine2.json \ - js/compatibility_tests/v3.0.0/jasmine3.json \ - js/compatibility_tests/v3.0.0/message_test.js \ - js/compatibility_tests/v3.0.0/proto3_test.js \ - js/compatibility_tests/v3.0.0/proto3_test.proto \ - js/compatibility_tests/v3.0.0/test2.proto \ - js/compatibility_tests/v3.0.0/test3.proto \ - js/compatibility_tests/v3.0.0/test4.proto \ - js/compatibility_tests/v3.0.0/test5.proto \ - js/compatibility_tests/v3.0.0/testbinary.proto \ - js/compatibility_tests/v3.0.0/testempty.proto \ - js/compatibility_tests/v3.0.0/test.proto \ - js/compatibility_tests/v3.0.0/test.sh \ - js/compatibility_tests/v3.1.0/testempty.proto \ - js/compatibility_tests/v3.1.0/testbinary.proto \ - js/compatibility_tests/v3.1.0/test5.proto \ - js/compatibility_tests/v3.1.0/test4.proto \ - js/compatibility_tests/v3.1.0/test3.proto \ - js/compatibility_tests/v3.1.0/test2.proto \ - js/compatibility_tests/v3.1.0/test.proto \ - js/compatibility_tests/v3.1.0/proto3_test.proto \ - js/compatibility_tests/v3.1.0/proto3_test.js \ - js/compatibility_tests/v3.1.0/message_test.js \ - js/compatibility_tests/v3.1.0/maps_test.js \ - js/compatibility_tests/v3.1.0/debug_test.js \ - js/compatibility_tests/v3.1.0/data.proto \ - js/compatibility_tests/v3.1.0/commonjs/test7/test7.proto \ - js/compatibility_tests/v3.1.0/commonjs/test6/test6.proto \ - js/compatibility_tests/v3.1.0/binary/writer_test.js \ - js/compatibility_tests/v3.1.0/binary/utils_test.js \ - js/compatibility_tests/v3.1.0/binary/reader_test.js \ - js/compatibility_tests/v3.1.0/binary/proto_test.js \ - js/compatibility_tests/v3.1.0/binary/decoder_test.js \ - js/compatibility_tests/v3.1.0/binary/arith_test.js \ - js/data.proto \ - js/debug.js \ - js/debug_test.js \ - js/experimental/runtime/kernel/message_set.js \ - js/experimental/runtime/kernel/message_set_test.js \ - js/experimental/runtime/kernel/tag.js \ - js/experimental/runtime/kernel/tag_test.js \ - js/gulpfile.js \ - js/jasmine.json \ - js/map.js \ - js/maps_test.js \ - js/message.js \ - js/message_test.js \ - js/node_loader.js \ - js/package.json \ - js/proto3_test.js \ - js/proto3_test.proto \ - js/test.proto \ - js/test2.proto \ - js/test3.proto \ - js/test4.proto \ - js/test5.proto \ - js/test8.proto \ - js/test9.proto \ - js/test10.proto \ - js/test11.proto \ - js/test12.proto \ - js/test13.proto \ - js/test14.proto \ - js/test15.proto \ - js/test_bootstrap.js \ - js/testbinary.proto \ - js/testempty.proto \ - js/testlargenumbers.proto \ - js/experimental/runtime/testing/jasmine_protobuf.js \ - js/experimental/runtime/testing/ensure_custom_equality_test.js \ - js/experimental/runtime/testing/binary/test_message.js \ - js/experimental/runtime/kernel/writer_test.js \ - js/experimental/runtime/kernel/writer.js \ - js/experimental/runtime/kernel/wire_type.js \ - js/experimental/runtime/kernel/uint8arrays_test.js \ - js/experimental/runtime/kernel/uint8arrays.js \ - js/experimental/runtime/kernel/uint32_test_pairs.js \ - js/experimental/runtime/kernel/typed_arrays_test.js \ - js/experimental/runtime/kernel/typed_arrays.js \ - js/experimental/runtime/kernel/textencoding_test.js \ - js/experimental/runtime/kernel/textencoding.js \ - js/experimental/runtime/kernel/storage.js \ - js/experimental/runtime/kernel/sint64_test_pairs.js \ - js/experimental/runtime/kernel/sint32_test_pairs.js \ - js/experimental/runtime/kernel/sfixed64_test_pairs.js \ - js/experimental/runtime/kernel/sfixed32_test_pairs.js \ - js/experimental/runtime/kernel/reader_test.js \ - js/experimental/runtime/kernel/reader.js \ - js/experimental/runtime/kernel/packed_uint32_test_pairs.js \ - js/experimental/runtime/kernel/packed_sint64_test_pairs.js \ - js/experimental/runtime/kernel/packed_sint32_test_pairs.js \ - js/experimental/runtime/kernel/packed_sfixed64_test_pairs.js \ - js/experimental/runtime/kernel/packed_sfixed32_test_pairs.js \ - js/experimental/runtime/kernel/packed_int64_test_pairs.js \ - js/experimental/runtime/kernel/packed_int32_test_pairs.js \ - js/experimental/runtime/kernel/packed_float_test_pairs.js \ - js/experimental/runtime/kernel/packed_fixed32_test_pairs.js \ - js/experimental/runtime/kernel/packed_double_test_pairs.js \ - js/experimental/runtime/kernel/packed_bool_test_pairs.js \ - js/experimental/runtime/kernel/kernel_test.js \ - js/experimental/runtime/kernel/kernel_repeated_test.js \ - js/experimental/runtime/kernel/kernel_compatibility_test.js \ - js/experimental/runtime/kernel/kernel.js \ - js/experimental/runtime/kernel/internal_message.js \ - js/experimental/runtime/kernel/int64_test_pairs.js \ - js/experimental/runtime/kernel/int32_test_pairs.js \ - js/experimental/runtime/kernel/indexer_test.js \ - js/experimental/runtime/kernel/indexer.js \ - js/experimental/runtime/kernel/float_test_pairs.js \ - js/experimental/runtime/kernel/fixed32_test_pairs.js \ - js/experimental/runtime/kernel/field.js \ - js/experimental/runtime/kernel/double_test_pairs.js \ - js/experimental/runtime/kernel/conformance/wire_format.js \ - js/experimental/runtime/kernel/conformance/test_all_types_proto3.js \ - js/experimental/runtime/kernel/conformance/test_all_types_proto2.js \ - js/experimental/runtime/kernel/conformance/conformance_testee_runner_node.js \ - js/experimental/runtime/kernel/conformance/conformance_testee.js \ - js/experimental/runtime/kernel/conformance/conformance_response.js \ - js/experimental/runtime/kernel/conformance/conformance_request.js \ - js/experimental/runtime/kernel/buffer_decoder_test.js \ - js/experimental/runtime/kernel/buffer_decoder_helper.js \ - js/experimental/runtime/kernel/buffer_decoder.js \ - js/experimental/runtime/kernel/bool_test_pairs.js \ - js/experimental/runtime/kernel/binary_storage_test.js \ - js/experimental/runtime/kernel/binary_storage.js \ - js/experimental/runtime/internal/checks_test.js \ - js/experimental/runtime/internal/checks.js \ - js/experimental/runtime/int64_test.js \ - js/experimental/runtime/int64.js \ - js/experimental/runtime/bytestring_test.js \ - js/experimental/runtime/bytestring_internal.js \ - js/experimental/runtime/bytestring.js \ - js/experimental/benchmarks/code_size/kernel/popular_types.js \ - js/experimental/benchmarks/code_size/kernel/all_types.js \ - js/experimental/benchmarks/code_size/code_size_base.js \ - js/experimental/benchmarks/code_size/apps_jspb/popular_types_proto3.js \ - js/experimental/benchmarks/code_size/apps_jspb/popular_types_proto2.js \ - js/experimental/benchmarks/code_size/apps_jspb/all_types_proto3.js \ - js/experimental/benchmarks/code_size/apps_jspb/all_types_proto2.js - -all_EXTRA_DIST = $(csharp_EXTRA_DIST) $(java_EXTRA_DIST) $(objectivec_EXTRA_DIST) $(php_EXTRA_DIST) $(python_EXTRA_DIST) $(ruby_EXTRA_DIST) $(js_EXTRA_DIST) -EXTRA_DIST = $(@DIST_LANG@_EXTRA_DIST) \ - autogen.sh \ - generate_descriptor_proto.sh \ - README.md \ - LICENSE \ - CONTRIBUTORS.txt \ - CHANGES.txt \ - update_file_lists.sh \ - BUILD \ - WORKSPACE \ - cmake/CMakeLists.txt \ - cmake/README.md \ - cmake/conformance.cmake \ - cmake/examples.cmake \ - cmake/extract_includes.bat.in \ - cmake/install.cmake \ - cmake/libprotobuf.cmake \ - cmake/libprotobuf-lite.cmake \ - cmake/libprotoc.cmake \ - cmake/protobuf-config-version.cmake.in \ - cmake/protobuf-config.cmake.in \ - cmake/protobuf-lite.pc.cmake \ - cmake/protobuf-module.cmake.in \ - cmake/protobuf-options.cmake \ - cmake/protobuf.pc.cmake \ - cmake/protoc.cmake \ - cmake/tests.cmake \ - cmake/version.rc.in \ - compiler_config_setting.bzl \ - build_files_updated_unittest.sh \ - cc_proto_blacklist_test.bzl \ - editors/README.txt \ - editors/proto.vim \ - editors/protobuf-mode.el \ - examples/AddPerson.java \ - examples/BUILD \ - examples/CMakeLists.txt \ - examples/ListPeople.java \ - examples/Makefile \ - examples/README.md \ - examples/WORKSPACE \ - examples/add_person.cc \ - examples/add_person.dart \ - examples/add_person.go \ - examples/add_person.py \ - examples/add_person_test.go \ - examples/addressbook.proto \ - examples/list_people.cc \ - examples/list_people.dart \ - examples/list_people.go \ - examples/list_people.py \ - examples/list_people_test.go \ - examples/pubspec.yaml \ - maven_install.json \ - protobuf.bzl \ - protobuf_deps.bzl \ - protobuf_version.bzl \ - third_party/zlib.BUILD \ - util/python/BUILD \ - internal.bzl - - -# Deletes all the files generated by autogen.sh. -MAINTAINERCLEANFILES = \ - aclocal.m4 \ - ar-lib \ - config.guess \ - config.sub \ - configure \ - depcomp \ - install-sh \ - ltmain.sh \ - Makefile.in \ - missing \ - mkinstalldirs \ - config.h.in \ - stamp.h.in \ - m4/ltsugar.m4 \ - m4/libtool.m4 \ - m4/ltversion.m4 \ - m4/lt~obsolete.m4 \ - m4/ltoptions.m4 - -all: config.h - $(MAKE) $(AM_MAKEFLAGS) all-recursive - -.SUFFIXES: -am--refresh: Makefile - @: -$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__configure_deps) - @for dep in $?; do \ - case '$(am__configure_deps)' in \ - *$$dep*) \ - echo ' cd $(srcdir) && $(AUTOMAKE) --foreign'; \ - $(am__cd) $(srcdir) && $(AUTOMAKE) --foreign \ - && exit 0; \ - exit 1;; \ - esac; \ - done; \ - echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign Makefile'; \ - $(am__cd) $(top_srcdir) && \ - $(AUTOMAKE) --foreign Makefile -Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status - @case '$?' in \ - *config.status*) \ - echo ' $(SHELL) ./config.status'; \ - $(SHELL) ./config.status;; \ - *) \ - echo ' cd $(top_builddir) && $(SHELL) ./config.status $@ $(am__maybe_remake_depfiles)'; \ - cd $(top_builddir) && $(SHELL) ./config.status $@ $(am__maybe_remake_depfiles);; \ - esac; - -$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) - $(SHELL) ./config.status --recheck - -$(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps) - $(am__cd) $(srcdir) && $(AUTOCONF) -$(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps) - $(am__cd) $(srcdir) && $(ACLOCAL) $(ACLOCAL_AMFLAGS) -$(am__aclocal_m4_deps): - -config.h: stamp-h1 - @test -f $@ || rm -f stamp-h1 - @test -f $@ || $(MAKE) $(AM_MAKEFLAGS) stamp-h1 - -stamp-h1: $(srcdir)/config.h.in $(top_builddir)/config.status - @rm -f stamp-h1 - cd $(top_builddir) && $(SHELL) ./config.status config.h -$(srcdir)/config.h.in: @MAINTAINER_MODE_TRUE@ $(am__configure_deps) - ($(am__cd) $(top_srcdir) && $(AUTOHEADER)) - rm -f stamp-h1 - touch $@ - -distclean-hdr: - -rm -f config.h stamp-h1 -protobuf.pc: $(top_builddir)/config.status $(srcdir)/protobuf.pc.in - cd $(top_builddir) && $(SHELL) ./config.status $@ -protobuf-lite.pc: $(top_builddir)/config.status $(srcdir)/protobuf-lite.pc.in - cd $(top_builddir) && $(SHELL) ./config.status $@ - -mostlyclean-libtool: - -rm -f *.lo - -clean-libtool: - -rm -rf .libs _libs - -distclean-libtool: - -rm -f libtool config.lt -install-pkgconfigDATA: $(pkgconfig_DATA) - @$(NORMAL_INSTALL) - @list='$(pkgconfig_DATA)'; test -n "$(pkgconfigdir)" || list=; \ - if test -n "$$list"; then \ - echo " $(MKDIR_P) '$(DESTDIR)$(pkgconfigdir)'"; \ - $(MKDIR_P) "$(DESTDIR)$(pkgconfigdir)" || exit 1; \ - fi; \ - for p in $$list; do \ - if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ - echo "$$d$$p"; \ - done | $(am__base_list) | \ - while read files; do \ - echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(pkgconfigdir)'"; \ - $(INSTALL_DATA) $$files "$(DESTDIR)$(pkgconfigdir)" || exit $$?; \ - done - -uninstall-pkgconfigDATA: - @$(NORMAL_UNINSTALL) - @list='$(pkgconfig_DATA)'; test -n "$(pkgconfigdir)" || list=; \ - files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \ - dir='$(DESTDIR)$(pkgconfigdir)'; $(am__uninstall_files_from_dir) - -# This directory's subdirectories are mostly independent; you can cd -# into them and run 'make' without going through this Makefile. -# To change the values of 'make' variables: instead of editing Makefiles, -# (1) if the variable is set in 'config.status', edit 'config.status' -# (which will cause the Makefiles to be regenerated when you run 'make'); -# (2) otherwise, pass the desired values on the 'make' command line. -$(am__recursive_targets): - @fail=; \ - if $(am__make_keepgoing); then \ - failcom='fail=yes'; \ - else \ - failcom='exit 1'; \ - fi; \ - dot_seen=no; \ - target=`echo $@ | sed s/-recursive//`; \ - case "$@" in \ - distclean-* | maintainer-clean-*) list='$(DIST_SUBDIRS)' ;; \ - *) list='$(SUBDIRS)' ;; \ - esac; \ - for subdir in $$list; do \ - echo "Making $$target in $$subdir"; \ - if test "$$subdir" = "."; then \ - dot_seen=yes; \ - local_target="$$target-am"; \ - else \ - local_target="$$target"; \ - fi; \ - ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \ - || eval $$failcom; \ - done; \ - if test "$$dot_seen" = "no"; then \ - $(MAKE) $(AM_MAKEFLAGS) "$$target-am" || exit 1; \ - fi; test -z "$$fail" - -ID: $(am__tagged_files) - $(am__define_uniq_tagged_files); mkid -fID $$unique -tags: tags-recursive -TAGS: tags - -tags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) - set x; \ - here=`pwd`; \ - if ($(ETAGS) --etags-include --version) >/dev/null 2>&1; then \ - include_option=--etags-include; \ - empty_fix=.; \ - else \ - include_option=--include; \ - empty_fix=; \ - fi; \ - list='$(SUBDIRS)'; for subdir in $$list; do \ - if test "$$subdir" = .; then :; else \ - test ! -f $$subdir/TAGS || \ - set "$$@" "$$include_option=$$here/$$subdir/TAGS"; \ - fi; \ - done; \ - $(am__define_uniq_tagged_files); \ - shift; \ - if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \ - test -n "$$unique" || unique=$$empty_fix; \ - if test $$# -gt 0; then \ - $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ - "$$@" $$unique; \ - else \ - $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ - $$unique; \ - fi; \ - fi -ctags: ctags-recursive - -CTAGS: ctags -ctags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) - $(am__define_uniq_tagged_files); \ - test -z "$(CTAGS_ARGS)$$unique" \ - || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ - $$unique - -GTAGS: - here=`$(am__cd) $(top_builddir) && pwd` \ - && $(am__cd) $(top_srcdir) \ - && gtags -i $(GTAGS_ARGS) "$$here" -cscope: cscope.files - test ! -s cscope.files \ - || $(CSCOPE) -b -q $(AM_CSCOPEFLAGS) $(CSCOPEFLAGS) -i cscope.files $(CSCOPE_ARGS) -clean-cscope: - -rm -f cscope.files -cscope.files: clean-cscope cscopelist -cscopelist: cscopelist-recursive - -cscopelist-am: $(am__tagged_files) - list='$(am__tagged_files)'; \ - case "$(srcdir)" in \ - [\\/]* | ?:[\\/]*) sdir="$(srcdir)" ;; \ - *) sdir=$(subdir)/$(srcdir) ;; \ - esac; \ - for i in $$list; do \ - if test -f "$$i"; then \ - echo "$(subdir)/$$i"; \ - else \ - echo "$$sdir/$$i"; \ - fi; \ - done >> $(top_builddir)/cscope.files - -distclean-tags: - -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags - -rm -f cscope.out cscope.in.out cscope.po.out cscope.files -distdir: $(BUILT_SOURCES) - $(MAKE) $(AM_MAKEFLAGS) distdir-am - -distdir-am: $(DISTFILES) - $(am__remove_distdir) - test -d "$(distdir)" || mkdir "$(distdir)" - @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ - topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ - list='$(DISTFILES)'; \ - dist_files=`for file in $$list; do echo $$file; done | \ - sed -e "s|^$$srcdirstrip/||;t" \ - -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ - case $$dist_files in \ - */*) $(MKDIR_P) `echo "$$dist_files" | \ - sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ - sort -u` ;; \ - esac; \ - for file in $$dist_files; do \ - if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ - if test -d $$d/$$file; then \ - dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ - if test -d "$(distdir)/$$file"; then \ - find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ - fi; \ - if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ - cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ - find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ - fi; \ - cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ - else \ - test -f "$(distdir)/$$file" \ - || cp -p $$d/$$file "$(distdir)/$$file" \ - || exit 1; \ - fi; \ - done - @list='$(DIST_SUBDIRS)'; for subdir in $$list; do \ - if test "$$subdir" = .; then :; else \ - $(am__make_dryrun) \ - || test -d "$(distdir)/$$subdir" \ - || $(MKDIR_P) "$(distdir)/$$subdir" \ - || exit 1; \ - dir1=$$subdir; dir2="$(distdir)/$$subdir"; \ - $(am__relativize); \ - new_distdir=$$reldir; \ - dir1=$$subdir; dir2="$(top_distdir)"; \ - $(am__relativize); \ - new_top_distdir=$$reldir; \ - echo " (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) top_distdir="$$new_top_distdir" distdir="$$new_distdir" \\"; \ - echo " am__remove_distdir=: am__skip_length_check=: am__skip_mode_fix=: distdir)"; \ - ($(am__cd) $$subdir && \ - $(MAKE) $(AM_MAKEFLAGS) \ - top_distdir="$$new_top_distdir" \ - distdir="$$new_distdir" \ - am__remove_distdir=: \ - am__skip_length_check=: \ - am__skip_mode_fix=: \ - distdir) \ - || exit 1; \ - fi; \ - done - -test -n "$(am__skip_mode_fix)" \ - || find "$(distdir)" -type d ! -perm -755 \ - -exec chmod u+rwx,go+rx {} \; -o \ - ! -type d ! -perm -444 -links 1 -exec chmod a+r {} \; -o \ - ! -type d ! -perm -400 -exec chmod a+r {} \; -o \ - ! -type d ! -perm -444 -exec $(install_sh) -c -m a+r {} {} \; \ - || chmod -R a+r "$(distdir)" -dist-gzip: distdir - tardir=$(distdir) && $(am__tar) | eval GZIP= gzip $(GZIP_ENV) -c >$(distdir).tar.gz - $(am__post_remove_distdir) - -dist-bzip2: distdir - tardir=$(distdir) && $(am__tar) | BZIP2=$${BZIP2--9} bzip2 -c >$(distdir).tar.bz2 - $(am__post_remove_distdir) - -dist-lzip: distdir - tardir=$(distdir) && $(am__tar) | lzip -c $${LZIP_OPT--9} >$(distdir).tar.lz - $(am__post_remove_distdir) - -dist-xz: distdir - tardir=$(distdir) && $(am__tar) | XZ_OPT=$${XZ_OPT--e} xz -c >$(distdir).tar.xz - $(am__post_remove_distdir) - -dist-zstd: distdir - tardir=$(distdir) && $(am__tar) | zstd -c $${ZSTD_CLEVEL-$${ZSTD_OPT--19}} >$(distdir).tar.zst - $(am__post_remove_distdir) - -dist-tarZ: distdir - @echo WARNING: "Support for distribution archives compressed with" \ - "legacy program 'compress' is deprecated." >&2 - @echo WARNING: "It will be removed altogether in Automake 2.0" >&2 - tardir=$(distdir) && $(am__tar) | compress -c >$(distdir).tar.Z - $(am__post_remove_distdir) - -dist-shar: distdir - @echo WARNING: "Support for shar distribution archives is" \ - "deprecated." >&2 - @echo WARNING: "It will be removed altogether in Automake 2.0" >&2 - shar $(distdir) | eval GZIP= gzip $(GZIP_ENV) -c >$(distdir).shar.gz - $(am__post_remove_distdir) - -dist-zip: distdir - -rm -f $(distdir).zip - zip -rq $(distdir).zip $(distdir) - $(am__post_remove_distdir) - -dist dist-all: - $(MAKE) $(AM_MAKEFLAGS) $(DIST_TARGETS) am__post_remove_distdir='@:' - $(am__post_remove_distdir) - -# This target untars the dist file and tries a VPATH configuration. Then -# it guarantees that the distribution is self-contained by making another -# tarfile. -distcheck: dist - case '$(DIST_ARCHIVES)' in \ - *.tar.gz*) \ - eval GZIP= gzip $(GZIP_ENV) -dc $(distdir).tar.gz | $(am__untar) ;;\ - *.tar.bz2*) \ - bzip2 -dc $(distdir).tar.bz2 | $(am__untar) ;;\ - *.tar.lz*) \ - lzip -dc $(distdir).tar.lz | $(am__untar) ;;\ - *.tar.xz*) \ - xz -dc $(distdir).tar.xz | $(am__untar) ;;\ - *.tar.Z*) \ - uncompress -c $(distdir).tar.Z | $(am__untar) ;;\ - *.shar.gz*) \ - eval GZIP= gzip $(GZIP_ENV) -dc $(distdir).shar.gz | unshar ;;\ - *.zip*) \ - unzip $(distdir).zip ;;\ - *.tar.zst*) \ - zstd -dc $(distdir).tar.zst | $(am__untar) ;;\ - esac - chmod -R a-w $(distdir) - chmod u+w $(distdir) - mkdir $(distdir)/_build $(distdir)/_build/sub $(distdir)/_inst - chmod a-w $(distdir) - test -d $(distdir)/_build || exit 0; \ - dc_install_base=`$(am__cd) $(distdir)/_inst && pwd | sed -e 's,^[^:\\/]:[\\/],/,'` \ - && dc_destdir="$${TMPDIR-/tmp}/am-dc-$$$$/" \ - && am__cwd=`pwd` \ - && $(am__cd) $(distdir)/_build/sub \ - && ../../configure \ - $(AM_DISTCHECK_CONFIGURE_FLAGS) \ - $(DISTCHECK_CONFIGURE_FLAGS) \ - --srcdir=../.. --prefix="$$dc_install_base" \ - && $(MAKE) $(AM_MAKEFLAGS) \ - && $(MAKE) $(AM_MAKEFLAGS) $(AM_DISTCHECK_DVI_TARGET) \ - && $(MAKE) $(AM_MAKEFLAGS) check \ - && $(MAKE) $(AM_MAKEFLAGS) install \ - && $(MAKE) $(AM_MAKEFLAGS) installcheck \ - && $(MAKE) $(AM_MAKEFLAGS) uninstall \ - && $(MAKE) $(AM_MAKEFLAGS) distuninstallcheck_dir="$$dc_install_base" \ - distuninstallcheck \ - && chmod -R a-w "$$dc_install_base" \ - && ({ \ - (cd ../.. && umask 077 && mkdir "$$dc_destdir") \ - && $(MAKE) $(AM_MAKEFLAGS) DESTDIR="$$dc_destdir" install \ - && $(MAKE) $(AM_MAKEFLAGS) DESTDIR="$$dc_destdir" uninstall \ - && $(MAKE) $(AM_MAKEFLAGS) DESTDIR="$$dc_destdir" \ - distuninstallcheck_dir="$$dc_destdir" distuninstallcheck; \ - } || { rm -rf "$$dc_destdir"; exit 1; }) \ - && rm -rf "$$dc_destdir" \ - && $(MAKE) $(AM_MAKEFLAGS) dist \ - && rm -rf $(DIST_ARCHIVES) \ - && $(MAKE) $(AM_MAKEFLAGS) distcleancheck \ - && cd "$$am__cwd" \ - || exit 1 - $(am__post_remove_distdir) - @(echo "$(distdir) archives ready for distribution: "; \ - list='$(DIST_ARCHIVES)'; for i in $$list; do echo $$i; done) | \ - sed -e 1h -e 1s/./=/g -e 1p -e 1x -e '$$p' -e '$$x' -distuninstallcheck: - @test -n '$(distuninstallcheck_dir)' || { \ - echo 'ERROR: trying to run $@ with an empty' \ - '$$(distuninstallcheck_dir)' >&2; \ - exit 1; \ - }; \ - $(am__cd) '$(distuninstallcheck_dir)' || { \ - echo 'ERROR: cannot chdir into $(distuninstallcheck_dir)' >&2; \ - exit 1; \ - }; \ - test `$(am__distuninstallcheck_listfiles) | wc -l` -eq 0 \ - || { echo "ERROR: files left after uninstall:" ; \ - if test -n "$(DESTDIR)"; then \ - echo " (check DESTDIR support)"; \ - fi ; \ - $(distuninstallcheck_listfiles) ; \ - exit 1; } >&2 -distcleancheck: distclean - @if test '$(srcdir)' = . ; then \ - echo "ERROR: distcleancheck can only run from a VPATH build" ; \ - exit 1 ; \ - fi - @test `$(distcleancheck_listfiles) | wc -l` -eq 0 \ - || { echo "ERROR: files left in build directory after distclean:" ; \ - $(distcleancheck_listfiles) ; \ - exit 1; } >&2 -check-am: all-am - $(MAKE) $(AM_MAKEFLAGS) check-local -check: check-recursive -all-am: Makefile $(DATA) config.h -installdirs: installdirs-recursive -installdirs-am: - for dir in "$(DESTDIR)$(pkgconfigdir)"; do \ - test -z "$$dir" || $(MKDIR_P) "$$dir"; \ - done -install: install-recursive -install-exec: install-exec-recursive -install-data: install-data-recursive -uninstall: uninstall-recursive - -install-am: all-am - @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am - -installcheck: installcheck-recursive -install-strip: - if test -z '$(STRIP)'; then \ - $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ - install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ - install; \ - else \ - $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ - install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ - "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \ - fi -mostlyclean-generic: - -clean-generic: - -distclean-generic: - -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) - -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) - -maintainer-clean-generic: - @echo "This command is intended for maintainers to use" - @echo "it deletes files that may require special tools to rebuild." - -test -z "$(MAINTAINERCLEANFILES)" || rm -f $(MAINTAINERCLEANFILES) -clean: clean-recursive - -clean-am: clean-generic clean-libtool clean-local mostlyclean-am - -distclean: distclean-recursive - -rm -f $(am__CONFIG_DISTCLEAN_FILES) - -rm -f Makefile -distclean-am: clean-am distclean-generic distclean-hdr \ - distclean-libtool distclean-tags - -dvi: dvi-recursive - -dvi-am: - -html: html-recursive - -html-am: - -info: info-recursive - -info-am: - -install-data-am: install-pkgconfigDATA - -install-dvi: install-dvi-recursive - -install-dvi-am: - -install-exec-am: - -install-html: install-html-recursive - -install-html-am: - -install-info: install-info-recursive - -install-info-am: - -install-man: - -install-pdf: install-pdf-recursive - -install-pdf-am: - -install-ps: install-ps-recursive - -install-ps-am: - -installcheck-am: - -maintainer-clean: maintainer-clean-recursive - -rm -f $(am__CONFIG_DISTCLEAN_FILES) - -rm -rf $(top_srcdir)/autom4te.cache - -rm -f Makefile -maintainer-clean-am: distclean-am maintainer-clean-generic - -mostlyclean: mostlyclean-recursive - -mostlyclean-am: mostlyclean-generic mostlyclean-libtool - -pdf: pdf-recursive - -pdf-am: - -ps: ps-recursive - -ps-am: - -uninstall-am: uninstall-pkgconfigDATA - -.MAKE: $(am__recursive_targets) all check-am install-am install-strip - -.PHONY: $(am__recursive_targets) CTAGS GTAGS TAGS all all-am \ - am--refresh check check-am check-local clean clean-cscope \ - clean-generic clean-libtool clean-local cscope cscopelist-am \ - ctags ctags-am dist dist-all dist-bzip2 dist-gzip dist-lzip \ - dist-shar dist-tarZ dist-xz dist-zip dist-zstd distcheck \ - distclean distclean-generic distclean-hdr distclean-libtool \ - distclean-tags distcleancheck distdir distuninstallcheck dvi \ - dvi-am html html-am info info-am install install-am \ - install-data install-data-am install-dvi install-dvi-am \ - install-exec install-exec-am install-html install-html-am \ - install-info install-info-am install-man install-pdf \ - install-pdf-am install-pkgconfigDATA install-ps install-ps-am \ - install-strip installcheck installcheck-am installdirs \ - installdirs-am maintainer-clean maintainer-clean-generic \ - mostlyclean mostlyclean-generic mostlyclean-libtool pdf pdf-am \ - ps ps-am tags tags-am uninstall uninstall-am \ - uninstall-pkgconfigDATA - -.PRECIOUS: Makefile - - -# Build gmock before we build protobuf tests. We don't add gmock to SUBDIRS -# because then "make check" would also build and run all of gmock's own tests, -# which takes a lot of time and is generally not useful to us. Also, we don't -# want "make install" to recurse into gmock since we don't want to overwrite -# the installed version of gmock if there is one. -check-local: - @echo "Making lib/libgmock.a lib/libgmock_main.a in gmock" - @cd third_party/googletest/googletest && $(MAKE) $(AM_MAKEFLAGS) lib/libgtest.la lib/libgtest_main.la - @cd third_party/googletest/googlemock && $(MAKE) $(AM_MAKEFLAGS) lib/libgmock.la lib/libgmock_main.la - -# We would like to clean gmock when "make clean" is invoked. But we have to -# be careful because clean-local is also invoked during "make distclean", but -# "make distclean" already recurses into gmock because it's listed among the -# DIST_SUBDIRS. distclean will delete gmock/Makefile, so if we then try to -# cd to the directory again and "make clean" it will fail. So, check that the -# Makefile exists before recursing. -clean-local: - @if test -e third_party/googletest/Makefile; then \ - echo "Making clean in googletest"; \ - cd third_party/googletest && $(MAKE) $(AM_MAKEFLAGS) clean; \ - fi; \ - if test -e conformance/Makefile; then \ - echo "Making clean in conformance"; \ - cd conformance && $(MAKE) $(AM_MAKEFLAGS) clean; \ - fi; \ - if test -e benchmarks/Makefile; then \ - echo "Making clean in benchmarks"; \ - cd benchmarks && $(MAKE) $(AM_MAKEFLAGS) clean; \ - fi; \ - if test -e objectivec/DevTools; then \ - echo "Cleaning any ObjC pyc files"; \ - rm -f objectivec/DevTools/*.pyc; \ - fi - -# Tell versions [3.59,3.63) of GNU make to not export all variables. -# Otherwise a system limit (for SysV at least) may be exceeded. -.NOEXPORT: diff --git a/extra/protobuf/protobuf-3.19.4/README.md b/extra/protobuf/protobuf-3.19.4/README.md deleted file mode 100644 index 618dc2a775bb..000000000000 --- a/extra/protobuf/protobuf-3.19.4/README.md +++ /dev/null @@ -1,85 +0,0 @@ -Protocol Buffers - Google's data interchange format -=================================================== - -Copyright 2008 Google Inc. - -https://developers.google.com/protocol-buffers/ - -Overview --------- - -Protocol Buffers (a.k.a., protobuf) are Google's language-neutral, -platform-neutral, extensible mechanism for serializing structured data. You -can find [protobuf's documentation on the Google Developers site](https://developers.google.com/protocol-buffers/). - -This README file contains protobuf installation instructions. To install -protobuf, you need to install the protocol compiler (used to compile .proto -files) and the protobuf runtime for your chosen programming language. - -Protocol Compiler Installation ------------------------------- - -The protocol compiler is written in C++. If you are using C++, please follow -the [C++ Installation Instructions](src/README.md) to install protoc along -with the C++ runtime. - -For non-C++ users, the simplest way to install the protocol compiler is to -download a pre-built binary from our release page: - - [https://github.com/protocolbuffers/protobuf/releases](https://github.com/protocolbuffers/protobuf/releases) - -In the downloads section of each release, you can find pre-built binaries in -zip packages: protoc-$VERSION-$PLATFORM.zip. It contains the protoc binary -as well as a set of standard .proto files distributed along with protobuf. - -If you are looking for an old version that is not available in the release -page, check out the maven repo here: - - [https://repo1.maven.org/maven2/com/google/protobuf/protoc/](https://repo1.maven.org/maven2/com/google/protobuf/protoc/) - -These pre-built binaries are only provided for released versions. If you want -to use the github master version at HEAD, or you need to modify protobuf code, -or you are using C++, it's recommended to build your own protoc binary from -source. - -If you would like to build protoc binary from source, see the [C++ Installation -Instructions](src/README.md). - -Protobuf Runtime Installation ------------------------------ - -Protobuf supports several different programming languages. For each programming -language, you can find instructions in the corresponding source directory about -how to install protobuf runtime for that specific language: - -| Language | Source | -|--------------------------------------|-------------------------------------------------------------| -| C++ (include C++ runtime and protoc) | [src](src) | -| Java | [java](java) | -| Python | [python](python) | -| Objective-C | [objectivec](objectivec) | -| C# | [csharp](csharp) | -| JavaScript | [js](js) | -| Ruby | [ruby](ruby) | -| Go | [protocolbuffers/protobuf-go](https://github.com/protocolbuffers/protobuf-go)| -| PHP | [php](php) | -| Dart | [dart-lang/protobuf](https://github.com/dart-lang/protobuf) | - -Quick Start ------------ - -The best way to learn how to use protobuf is to follow the tutorials in our -developer guide: - -https://developers.google.com/protocol-buffers/docs/tutorials - -If you want to learn from code examples, take a look at the examples in the -[examples](examples) directory. - -Documentation -------------- - -The complete documentation for Protocol Buffers is available via the -web at: - -https://developers.google.com/protocol-buffers/ diff --git a/extra/protobuf/protobuf-3.19.4/WORKSPACE b/extra/protobuf/protobuf-3.19.4/WORKSPACE deleted file mode 100644 index e500967fe4ed..000000000000 --- a/extra/protobuf/protobuf-3.19.4/WORKSPACE +++ /dev/null @@ -1,58 +0,0 @@ -workspace(name = "com_google_protobuf") - -load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive") - -local_repository( - name = "com_google_protobuf_examples", - path = "examples", -) - -http_archive( - name = "com_google_googletest", - sha256 = "9dc9157a9a1551ec7a7e43daea9a694a0bb5fb8bec81235d8a1e6ef64c716dcb", - strip_prefix = "googletest-release-1.10.0", - urls = [ - "https://mirror.bazel.build/github.com/google/googletest/archive/release-1.10.0.tar.gz", - "https://github.com/google/googletest/archive/release-1.10.0.tar.gz", - ], -) - -http_archive( - name = "com_github_google_benchmark", - sha256 = "2a778d821997df7d8646c9c59b8edb9a573a6e04c534c01892a40aa524a7b68c", - strip_prefix = "benchmark-bf585a2789e30585b4e3ce6baf11ef2750b54677", - urls = [ - "https://github.com/google/benchmark/archive/bf585a2789e30585b4e3ce6baf11ef2750b54677.zip", - ], -) - -# Load common dependencies. -load("//:protobuf_deps.bzl", "PROTOBUF_MAVEN_ARTIFACTS", "protobuf_deps") -protobuf_deps() - -bind( - name = "python_headers", - actual = "//util/python:python_headers", -) - -load("@rules_jvm_external//:defs.bzl", "maven_install") - -maven_install( - artifacts = PROTOBUF_MAVEN_ARTIFACTS, - # For updating instructions, see: - # https://github.com/bazelbuild/rules_jvm_external#updating-maven_installjson - maven_install_json = "//:maven_install.json", - repositories = [ - "https://repo1.maven.org/maven2", - "https://repo.maven.apache.org/maven2", - ], -) - -load("@maven//:defs.bzl", "pinned_maven_install") - -pinned_maven_install() - -# For `cc_proto_blacklist_test` and `build_test`. -load("@bazel_skylib//:workspace.bzl", "bazel_skylib_workspace") - -bazel_skylib_workspace() diff --git a/extra/protobuf/protobuf-3.19.4/aclocal.m4 b/extra/protobuf/protobuf-3.19.4/aclocal.m4 deleted file mode 100644 index 6579e62e1212..000000000000 --- a/extra/protobuf/protobuf-3.19.4/aclocal.m4 +++ /dev/null @@ -1,1258 +0,0 @@ -# generated automatically by aclocal 1.16.5 -*- Autoconf -*- - -# Copyright (C) 1996-2021 Free Software Foundation, Inc. - -# This file is free software; the Free Software Foundation -# gives unlimited permission to copy and/or distribute it, -# with or without modifications, as long as this notice is preserved. - -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY, to the extent permitted by law; without -# even the implied warranty of MERCHANTABILITY or FITNESS FOR A -# PARTICULAR PURPOSE. - -m4_ifndef([AC_CONFIG_MACRO_DIRS], [m4_defun([_AM_CONFIG_MACRO_DIRS], [])m4_defun([AC_CONFIG_MACRO_DIRS], [_AM_CONFIG_MACRO_DIRS($@)])]) -m4_ifndef([AC_AUTOCONF_VERSION], - [m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl -m4_if(m4_defn([AC_AUTOCONF_VERSION]), [2.71],, -[m4_warning([this file was generated for autoconf 2.71. -You have another version of autoconf. It may work, but is not guaranteed to. -If you have problems, you may need to regenerate the build system entirely. -To do so, use the procedure documented by the package, typically 'autoreconf'.])]) - -# Copyright (C) 2002-2021 Free Software Foundation, Inc. -# -# This file is free software; the Free Software Foundation -# gives unlimited permission to copy and/or distribute it, -# with or without modifications, as long as this notice is preserved. - -# AM_AUTOMAKE_VERSION(VERSION) -# ---------------------------- -# Automake X.Y traces this macro to ensure aclocal.m4 has been -# generated from the m4 files accompanying Automake X.Y. -# (This private macro should not be called outside this file.) -AC_DEFUN([AM_AUTOMAKE_VERSION], -[am__api_version='1.16' -dnl Some users find AM_AUTOMAKE_VERSION and mistake it for a way to -dnl require some minimum version. Point them to the right macro. -m4_if([$1], [1.16.5], [], - [AC_FATAL([Do not call $0, use AM_INIT_AUTOMAKE([$1]).])])dnl -]) - -# _AM_AUTOCONF_VERSION(VERSION) -# ----------------------------- -# aclocal traces this macro to find the Autoconf version. -# This is a private macro too. Using m4_define simplifies -# the logic in aclocal, which can simply ignore this definition. -m4_define([_AM_AUTOCONF_VERSION], []) - -# AM_SET_CURRENT_AUTOMAKE_VERSION -# ------------------------------- -# Call AM_AUTOMAKE_VERSION and AM_AUTOMAKE_VERSION so they can be traced. -# This function is AC_REQUIREd by AM_INIT_AUTOMAKE. -AC_DEFUN([AM_SET_CURRENT_AUTOMAKE_VERSION], -[AM_AUTOMAKE_VERSION([1.16.5])dnl -m4_ifndef([AC_AUTOCONF_VERSION], - [m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl -_AM_AUTOCONF_VERSION(m4_defn([AC_AUTOCONF_VERSION]))]) - -# Copyright (C) 2011-2021 Free Software Foundation, Inc. -# -# This file is free software; the Free Software Foundation -# gives unlimited permission to copy and/or distribute it, -# with or without modifications, as long as this notice is preserved. - -# AM_PROG_AR([ACT-IF-FAIL]) -# ------------------------- -# Try to determine the archiver interface, and trigger the ar-lib wrapper -# if it is needed. If the detection of archiver interface fails, run -# ACT-IF-FAIL (default is to abort configure with a proper error message). -AC_DEFUN([AM_PROG_AR], -[AC_BEFORE([$0], [LT_INIT])dnl -AC_BEFORE([$0], [AC_PROG_LIBTOOL])dnl -AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl -AC_REQUIRE_AUX_FILE([ar-lib])dnl -AC_CHECK_TOOLS([AR], [ar lib "link -lib"], [false]) -: ${AR=ar} - -AC_CACHE_CHECK([the archiver ($AR) interface], [am_cv_ar_interface], - [AC_LANG_PUSH([C]) - am_cv_ar_interface=ar - AC_COMPILE_IFELSE([AC_LANG_SOURCE([[int some_variable = 0;]])], - [am_ar_try='$AR cru libconftest.a conftest.$ac_objext >&AS_MESSAGE_LOG_FD' - AC_TRY_EVAL([am_ar_try]) - if test "$ac_status" -eq 0; then - am_cv_ar_interface=ar - else - am_ar_try='$AR -NOLOGO -OUT:conftest.lib conftest.$ac_objext >&AS_MESSAGE_LOG_FD' - AC_TRY_EVAL([am_ar_try]) - if test "$ac_status" -eq 0; then - am_cv_ar_interface=lib - else - am_cv_ar_interface=unknown - fi - fi - rm -f conftest.lib libconftest.a - ]) - AC_LANG_POP([C])]) - -case $am_cv_ar_interface in -ar) - ;; -lib) - # Microsoft lib, so override with the ar-lib wrapper script. - # FIXME: It is wrong to rewrite AR. - # But if we don't then we get into trouble of one sort or another. - # A longer-term fix would be to have automake use am__AR in this case, - # and then we could set am__AR="$am_aux_dir/ar-lib \$(AR)" or something - # similar. - AR="$am_aux_dir/ar-lib $AR" - ;; -unknown) - m4_default([$1], - [AC_MSG_ERROR([could not determine $AR interface])]) - ;; -esac -AC_SUBST([AR])dnl -]) - -# AM_AUX_DIR_EXPAND -*- Autoconf -*- - -# Copyright (C) 2001-2021 Free Software Foundation, Inc. -# -# This file is free software; the Free Software Foundation -# gives unlimited permission to copy and/or distribute it, -# with or without modifications, as long as this notice is preserved. - -# For projects using AC_CONFIG_AUX_DIR([foo]), Autoconf sets -# $ac_aux_dir to '$srcdir/foo'. In other projects, it is set to -# '$srcdir', '$srcdir/..', or '$srcdir/../..'. -# -# Of course, Automake must honor this variable whenever it calls a -# tool from the auxiliary directory. The problem is that $srcdir (and -# therefore $ac_aux_dir as well) can be either absolute or relative, -# depending on how configure is run. This is pretty annoying, since -# it makes $ac_aux_dir quite unusable in subdirectories: in the top -# source directory, any form will work fine, but in subdirectories a -# relative path needs to be adjusted first. -# -# $ac_aux_dir/missing -# fails when called from a subdirectory if $ac_aux_dir is relative -# $top_srcdir/$ac_aux_dir/missing -# fails if $ac_aux_dir is absolute, -# fails when called from a subdirectory in a VPATH build with -# a relative $ac_aux_dir -# -# The reason of the latter failure is that $top_srcdir and $ac_aux_dir -# are both prefixed by $srcdir. In an in-source build this is usually -# harmless because $srcdir is '.', but things will broke when you -# start a VPATH build or use an absolute $srcdir. -# -# So we could use something similar to $top_srcdir/$ac_aux_dir/missing, -# iff we strip the leading $srcdir from $ac_aux_dir. That would be: -# am_aux_dir='\$(top_srcdir)/'`expr "$ac_aux_dir" : "$srcdir//*\(.*\)"` -# and then we would define $MISSING as -# MISSING="\${SHELL} $am_aux_dir/missing" -# This will work as long as MISSING is not called from configure, because -# unfortunately $(top_srcdir) has no meaning in configure. -# However there are other variables, like CC, which are often used in -# configure, and could therefore not use this "fixed" $ac_aux_dir. -# -# Another solution, used here, is to always expand $ac_aux_dir to an -# absolute PATH. The drawback is that using absolute paths prevent a -# configured tree to be moved without reconfiguration. - -AC_DEFUN([AM_AUX_DIR_EXPAND], -[AC_REQUIRE([AC_CONFIG_AUX_DIR_DEFAULT])dnl -# Expand $ac_aux_dir to an absolute path. -am_aux_dir=`cd "$ac_aux_dir" && pwd` -]) - -# AM_CONDITIONAL -*- Autoconf -*- - -# Copyright (C) 1997-2021 Free Software Foundation, Inc. -# -# This file is free software; the Free Software Foundation -# gives unlimited permission to copy and/or distribute it, -# with or without modifications, as long as this notice is preserved. - -# AM_CONDITIONAL(NAME, SHELL-CONDITION) -# ------------------------------------- -# Define a conditional. -AC_DEFUN([AM_CONDITIONAL], -[AC_PREREQ([2.52])dnl - m4_if([$1], [TRUE], [AC_FATAL([$0: invalid condition: $1])], - [$1], [FALSE], [AC_FATAL([$0: invalid condition: $1])])dnl -AC_SUBST([$1_TRUE])dnl -AC_SUBST([$1_FALSE])dnl -_AM_SUBST_NOTMAKE([$1_TRUE])dnl -_AM_SUBST_NOTMAKE([$1_FALSE])dnl -m4_define([_AM_COND_VALUE_$1], [$2])dnl -if $2; then - $1_TRUE= - $1_FALSE='#' -else - $1_TRUE='#' - $1_FALSE= -fi -AC_CONFIG_COMMANDS_PRE( -[if test -z "${$1_TRUE}" && test -z "${$1_FALSE}"; then - AC_MSG_ERROR([[conditional "$1" was never defined. -Usually this means the macro was only invoked conditionally.]]) -fi])]) - -# Copyright (C) 1999-2021 Free Software Foundation, Inc. -# -# This file is free software; the Free Software Foundation -# gives unlimited permission to copy and/or distribute it, -# with or without modifications, as long as this notice is preserved. - - -# There are a few dirty hacks below to avoid letting 'AC_PROG_CC' be -# written in clear, in which case automake, when reading aclocal.m4, -# will think it sees a *use*, and therefore will trigger all it's -# C support machinery. Also note that it means that autoscan, seeing -# CC etc. in the Makefile, will ask for an AC_PROG_CC use... - - -# _AM_DEPENDENCIES(NAME) -# ---------------------- -# See how the compiler implements dependency checking. -# NAME is "CC", "CXX", "OBJC", "OBJCXX", "UPC", or "GJC". -# We try a few techniques and use that to set a single cache variable. -# -# We don't AC_REQUIRE the corresponding AC_PROG_CC since the latter was -# modified to invoke _AM_DEPENDENCIES(CC); we would have a circular -# dependency, and given that the user is not expected to run this macro, -# just rely on AC_PROG_CC. -AC_DEFUN([_AM_DEPENDENCIES], -[AC_REQUIRE([AM_SET_DEPDIR])dnl -AC_REQUIRE([AM_OUTPUT_DEPENDENCY_COMMANDS])dnl -AC_REQUIRE([AM_MAKE_INCLUDE])dnl -AC_REQUIRE([AM_DEP_TRACK])dnl - -m4_if([$1], [CC], [depcc="$CC" am_compiler_list=], - [$1], [CXX], [depcc="$CXX" am_compiler_list=], - [$1], [OBJC], [depcc="$OBJC" am_compiler_list='gcc3 gcc'], - [$1], [OBJCXX], [depcc="$OBJCXX" am_compiler_list='gcc3 gcc'], - [$1], [UPC], [depcc="$UPC" am_compiler_list=], - [$1], [GCJ], [depcc="$GCJ" am_compiler_list='gcc3 gcc'], - [depcc="$$1" am_compiler_list=]) - -AC_CACHE_CHECK([dependency style of $depcc], - [am_cv_$1_dependencies_compiler_type], -[if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then - # We make a subdir and do the tests there. Otherwise we can end up - # making bogus files that we don't know about and never remove. For - # instance it was reported that on HP-UX the gcc test will end up - # making a dummy file named 'D' -- because '-MD' means "put the output - # in D". - rm -rf conftest.dir - mkdir conftest.dir - # Copy depcomp to subdir because otherwise we won't find it if we're - # using a relative directory. - cp "$am_depcomp" conftest.dir - cd conftest.dir - # We will build objects and dependencies in a subdirectory because - # it helps to detect inapplicable dependency modes. For instance - # both Tru64's cc and ICC support -MD to output dependencies as a - # side effect of compilation, but ICC will put the dependencies in - # the current directory while Tru64 will put them in the object - # directory. - mkdir sub - - am_cv_$1_dependencies_compiler_type=none - if test "$am_compiler_list" = ""; then - am_compiler_list=`sed -n ['s/^#*\([a-zA-Z0-9]*\))$/\1/p'] < ./depcomp` - fi - am__universal=false - m4_case([$1], [CC], - [case " $depcc " in #( - *\ -arch\ *\ -arch\ *) am__universal=true ;; - esac], - [CXX], - [case " $depcc " in #( - *\ -arch\ *\ -arch\ *) am__universal=true ;; - esac]) - - for depmode in $am_compiler_list; do - # Setup a source with many dependencies, because some compilers - # like to wrap large dependency lists on column 80 (with \), and - # we should not choose a depcomp mode which is confused by this. - # - # We need to recreate these files for each test, as the compiler may - # overwrite some of them when testing with obscure command lines. - # This happens at least with the AIX C compiler. - : > sub/conftest.c - for i in 1 2 3 4 5 6; do - echo '#include "conftst'$i'.h"' >> sub/conftest.c - # Using ": > sub/conftst$i.h" creates only sub/conftst1.h with - # Solaris 10 /bin/sh. - echo '/* dummy */' > sub/conftst$i.h - done - echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf - - # We check with '-c' and '-o' for the sake of the "dashmstdout" - # mode. It turns out that the SunPro C++ compiler does not properly - # handle '-M -o', and we need to detect this. Also, some Intel - # versions had trouble with output in subdirs. - am__obj=sub/conftest.${OBJEXT-o} - am__minus_obj="-o $am__obj" - case $depmode in - gcc) - # This depmode causes a compiler race in universal mode. - test "$am__universal" = false || continue - ;; - nosideeffect) - # After this tag, mechanisms are not by side-effect, so they'll - # only be used when explicitly requested. - if test "x$enable_dependency_tracking" = xyes; then - continue - else - break - fi - ;; - msvc7 | msvc7msys | msvisualcpp | msvcmsys) - # This compiler won't grok '-c -o', but also, the minuso test has - # not run yet. These depmodes are late enough in the game, and - # so weak that their functioning should not be impacted. - am__obj=conftest.${OBJEXT-o} - am__minus_obj= - ;; - none) break ;; - esac - if depmode=$depmode \ - source=sub/conftest.c object=$am__obj \ - depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \ - $SHELL ./depcomp $depcc -c $am__minus_obj sub/conftest.c \ - >/dev/null 2>conftest.err && - grep sub/conftst1.h sub/conftest.Po > /dev/null 2>&1 && - grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 && - grep $am__obj sub/conftest.Po > /dev/null 2>&1 && - ${MAKE-make} -s -f confmf > /dev/null 2>&1; then - # icc doesn't choke on unknown options, it will just issue warnings - # or remarks (even with -Werror). So we grep stderr for any message - # that says an option was ignored or not supported. - # When given -MP, icc 7.0 and 7.1 complain thusly: - # icc: Command line warning: ignoring option '-M'; no argument required - # The diagnosis changed in icc 8.0: - # icc: Command line remark: option '-MP' not supported - if (grep 'ignoring option' conftest.err || - grep 'not supported' conftest.err) >/dev/null 2>&1; then :; else - am_cv_$1_dependencies_compiler_type=$depmode - break - fi - fi - done - - cd .. - rm -rf conftest.dir -else - am_cv_$1_dependencies_compiler_type=none -fi -]) -AC_SUBST([$1DEPMODE], [depmode=$am_cv_$1_dependencies_compiler_type]) -AM_CONDITIONAL([am__fastdep$1], [ - test "x$enable_dependency_tracking" != xno \ - && test "$am_cv_$1_dependencies_compiler_type" = gcc3]) -]) - - -# AM_SET_DEPDIR -# ------------- -# Choose a directory name for dependency files. -# This macro is AC_REQUIREd in _AM_DEPENDENCIES. -AC_DEFUN([AM_SET_DEPDIR], -[AC_REQUIRE([AM_SET_LEADING_DOT])dnl -AC_SUBST([DEPDIR], ["${am__leading_dot}deps"])dnl -]) - - -# AM_DEP_TRACK -# ------------ -AC_DEFUN([AM_DEP_TRACK], -[AC_ARG_ENABLE([dependency-tracking], [dnl -AS_HELP_STRING( - [--enable-dependency-tracking], - [do not reject slow dependency extractors]) -AS_HELP_STRING( - [--disable-dependency-tracking], - [speeds up one-time build])]) -if test "x$enable_dependency_tracking" != xno; then - am_depcomp="$ac_aux_dir/depcomp" - AMDEPBACKSLASH='\' - am__nodep='_no' -fi -AM_CONDITIONAL([AMDEP], [test "x$enable_dependency_tracking" != xno]) -AC_SUBST([AMDEPBACKSLASH])dnl -_AM_SUBST_NOTMAKE([AMDEPBACKSLASH])dnl -AC_SUBST([am__nodep])dnl -_AM_SUBST_NOTMAKE([am__nodep])dnl -]) - -# Generate code to set up dependency tracking. -*- Autoconf -*- - -# Copyright (C) 1999-2021 Free Software Foundation, Inc. -# -# This file is free software; the Free Software Foundation -# gives unlimited permission to copy and/or distribute it, -# with or without modifications, as long as this notice is preserved. - -# _AM_OUTPUT_DEPENDENCY_COMMANDS -# ------------------------------ -AC_DEFUN([_AM_OUTPUT_DEPENDENCY_COMMANDS], -[{ - # Older Autoconf quotes --file arguments for eval, but not when files - # are listed without --file. Let's play safe and only enable the eval - # if we detect the quoting. - # TODO: see whether this extra hack can be removed once we start - # requiring Autoconf 2.70 or later. - AS_CASE([$CONFIG_FILES], - [*\'*], [eval set x "$CONFIG_FILES"], - [*], [set x $CONFIG_FILES]) - shift - # Used to flag and report bootstrapping failures. - am_rc=0 - for am_mf - do - # Strip MF so we end up with the name of the file. - am_mf=`AS_ECHO(["$am_mf"]) | sed -e 's/:.*$//'` - # Check whether this is an Automake generated Makefile which includes - # dependency-tracking related rules and includes. - # Grep'ing the whole file directly is not great: AIX grep has a line - # limit of 2048, but all sed's we know have understand at least 4000. - sed -n 's,^am--depfiles:.*,X,p' "$am_mf" | grep X >/dev/null 2>&1 \ - || continue - am_dirpart=`AS_DIRNAME(["$am_mf"])` - am_filepart=`AS_BASENAME(["$am_mf"])` - AM_RUN_LOG([cd "$am_dirpart" \ - && sed -e '/# am--include-marker/d' "$am_filepart" \ - | $MAKE -f - am--depfiles]) || am_rc=$? - done - if test $am_rc -ne 0; then - AC_MSG_FAILURE([Something went wrong bootstrapping makefile fragments - for automatic dependency tracking. If GNU make was not used, consider - re-running the configure script with MAKE="gmake" (or whatever is - necessary). You can also try re-running configure with the - '--disable-dependency-tracking' option to at least be able to build - the package (albeit without support for automatic dependency tracking).]) - fi - AS_UNSET([am_dirpart]) - AS_UNSET([am_filepart]) - AS_UNSET([am_mf]) - AS_UNSET([am_rc]) - rm -f conftest-deps.mk -} -])# _AM_OUTPUT_DEPENDENCY_COMMANDS - - -# AM_OUTPUT_DEPENDENCY_COMMANDS -# ----------------------------- -# This macro should only be invoked once -- use via AC_REQUIRE. -# -# This code is only required when automatic dependency tracking is enabled. -# This creates each '.Po' and '.Plo' makefile fragment that we'll need in -# order to bootstrap the dependency handling code. -AC_DEFUN([AM_OUTPUT_DEPENDENCY_COMMANDS], -[AC_CONFIG_COMMANDS([depfiles], - [test x"$AMDEP_TRUE" != x"" || _AM_OUTPUT_DEPENDENCY_COMMANDS], - [AMDEP_TRUE="$AMDEP_TRUE" MAKE="${MAKE-make}"])]) - -# Do all the work for Automake. -*- Autoconf -*- - -# Copyright (C) 1996-2021 Free Software Foundation, Inc. -# -# This file is free software; the Free Software Foundation -# gives unlimited permission to copy and/or distribute it, -# with or without modifications, as long as this notice is preserved. - -# This macro actually does too much. Some checks are only needed if -# your package does certain things. But this isn't really a big deal. - -dnl Redefine AC_PROG_CC to automatically invoke _AM_PROG_CC_C_O. -m4_define([AC_PROG_CC], -m4_defn([AC_PROG_CC]) -[_AM_PROG_CC_C_O -]) - -# AM_INIT_AUTOMAKE(PACKAGE, VERSION, [NO-DEFINE]) -# AM_INIT_AUTOMAKE([OPTIONS]) -# ----------------------------------------------- -# The call with PACKAGE and VERSION arguments is the old style -# call (pre autoconf-2.50), which is being phased out. PACKAGE -# and VERSION should now be passed to AC_INIT and removed from -# the call to AM_INIT_AUTOMAKE. -# We support both call styles for the transition. After -# the next Automake release, Autoconf can make the AC_INIT -# arguments mandatory, and then we can depend on a new Autoconf -# release and drop the old call support. -AC_DEFUN([AM_INIT_AUTOMAKE], -[AC_PREREQ([2.65])dnl -m4_ifdef([_$0_ALREADY_INIT], - [m4_fatal([$0 expanded multiple times -]m4_defn([_$0_ALREADY_INIT]))], - [m4_define([_$0_ALREADY_INIT], m4_expansion_stack)])dnl -dnl Autoconf wants to disallow AM_ names. We explicitly allow -dnl the ones we care about. -m4_pattern_allow([^AM_[A-Z]+FLAGS$])dnl -AC_REQUIRE([AM_SET_CURRENT_AUTOMAKE_VERSION])dnl -AC_REQUIRE([AC_PROG_INSTALL])dnl -if test "`cd $srcdir && pwd`" != "`pwd`"; then - # Use -I$(srcdir) only when $(srcdir) != ., so that make's output - # is not polluted with repeated "-I." - AC_SUBST([am__isrc], [' -I$(srcdir)'])_AM_SUBST_NOTMAKE([am__isrc])dnl - # test to see if srcdir already configured - if test -f $srcdir/config.status; then - AC_MSG_ERROR([source directory already configured; run "make distclean" there first]) - fi -fi - -# test whether we have cygpath -if test -z "$CYGPATH_W"; then - if (cygpath --version) >/dev/null 2>/dev/null; then - CYGPATH_W='cygpath -w' - else - CYGPATH_W=echo - fi -fi -AC_SUBST([CYGPATH_W]) - -# Define the identity of the package. -dnl Distinguish between old-style and new-style calls. -m4_ifval([$2], -[AC_DIAGNOSE([obsolete], - [$0: two- and three-arguments forms are deprecated.]) -m4_ifval([$3], [_AM_SET_OPTION([no-define])])dnl - AC_SUBST([PACKAGE], [$1])dnl - AC_SUBST([VERSION], [$2])], -[_AM_SET_OPTIONS([$1])dnl -dnl Diagnose old-style AC_INIT with new-style AM_AUTOMAKE_INIT. -m4_if( - m4_ifset([AC_PACKAGE_NAME], [ok]):m4_ifset([AC_PACKAGE_VERSION], [ok]), - [ok:ok],, - [m4_fatal([AC_INIT should be called with package and version arguments])])dnl - AC_SUBST([PACKAGE], ['AC_PACKAGE_TARNAME'])dnl - AC_SUBST([VERSION], ['AC_PACKAGE_VERSION'])])dnl - -_AM_IF_OPTION([no-define],, -[AC_DEFINE_UNQUOTED([PACKAGE], ["$PACKAGE"], [Name of package]) - AC_DEFINE_UNQUOTED([VERSION], ["$VERSION"], [Version number of package])])dnl - -# Some tools Automake needs. -AC_REQUIRE([AM_SANITY_CHECK])dnl -AC_REQUIRE([AC_ARG_PROGRAM])dnl -AM_MISSING_PROG([ACLOCAL], [aclocal-${am__api_version}]) -AM_MISSING_PROG([AUTOCONF], [autoconf]) -AM_MISSING_PROG([AUTOMAKE], [automake-${am__api_version}]) -AM_MISSING_PROG([AUTOHEADER], [autoheader]) -AM_MISSING_PROG([MAKEINFO], [makeinfo]) -AC_REQUIRE([AM_PROG_INSTALL_SH])dnl -AC_REQUIRE([AM_PROG_INSTALL_STRIP])dnl -AC_REQUIRE([AC_PROG_MKDIR_P])dnl -# For better backward compatibility. To be removed once Automake 1.9.x -# dies out for good. For more background, see: -# -# -AC_SUBST([mkdir_p], ['$(MKDIR_P)']) -# We need awk for the "check" target (and possibly the TAP driver). The -# system "awk" is bad on some platforms. -AC_REQUIRE([AC_PROG_AWK])dnl -AC_REQUIRE([AC_PROG_MAKE_SET])dnl -AC_REQUIRE([AM_SET_LEADING_DOT])dnl -_AM_IF_OPTION([tar-ustar], [_AM_PROG_TAR([ustar])], - [_AM_IF_OPTION([tar-pax], [_AM_PROG_TAR([pax])], - [_AM_PROG_TAR([v7])])]) -_AM_IF_OPTION([no-dependencies],, -[AC_PROVIDE_IFELSE([AC_PROG_CC], - [_AM_DEPENDENCIES([CC])], - [m4_define([AC_PROG_CC], - m4_defn([AC_PROG_CC])[_AM_DEPENDENCIES([CC])])])dnl -AC_PROVIDE_IFELSE([AC_PROG_CXX], - [_AM_DEPENDENCIES([CXX])], - [m4_define([AC_PROG_CXX], - m4_defn([AC_PROG_CXX])[_AM_DEPENDENCIES([CXX])])])dnl -AC_PROVIDE_IFELSE([AC_PROG_OBJC], - [_AM_DEPENDENCIES([OBJC])], - [m4_define([AC_PROG_OBJC], - m4_defn([AC_PROG_OBJC])[_AM_DEPENDENCIES([OBJC])])])dnl -AC_PROVIDE_IFELSE([AC_PROG_OBJCXX], - [_AM_DEPENDENCIES([OBJCXX])], - [m4_define([AC_PROG_OBJCXX], - m4_defn([AC_PROG_OBJCXX])[_AM_DEPENDENCIES([OBJCXX])])])dnl -]) -# Variables for tags utilities; see am/tags.am -if test -z "$CTAGS"; then - CTAGS=ctags -fi -AC_SUBST([CTAGS]) -if test -z "$ETAGS"; then - ETAGS=etags -fi -AC_SUBST([ETAGS]) -if test -z "$CSCOPE"; then - CSCOPE=cscope -fi -AC_SUBST([CSCOPE]) - -AC_REQUIRE([AM_SILENT_RULES])dnl -dnl The testsuite driver may need to know about EXEEXT, so add the -dnl 'am__EXEEXT' conditional if _AM_COMPILER_EXEEXT was seen. This -dnl macro is hooked onto _AC_COMPILER_EXEEXT early, see below. -AC_CONFIG_COMMANDS_PRE(dnl -[m4_provide_if([_AM_COMPILER_EXEEXT], - [AM_CONDITIONAL([am__EXEEXT], [test -n "$EXEEXT"])])])dnl - -# POSIX will say in a future version that running "rm -f" with no argument -# is OK; and we want to be able to make that assumption in our Makefile -# recipes. So use an aggressive probe to check that the usage we want is -# actually supported "in the wild" to an acceptable degree. -# See automake bug#10828. -# To make any issue more visible, cause the running configure to be aborted -# by default if the 'rm' program in use doesn't match our expectations; the -# user can still override this though. -if rm -f && rm -fr && rm -rf; then : OK; else - cat >&2 <<'END' -Oops! - -Your 'rm' program seems unable to run without file operands specified -on the command line, even when the '-f' option is present. This is contrary -to the behaviour of most rm programs out there, and not conforming with -the upcoming POSIX standard: - -Please tell bug-automake@gnu.org about your system, including the value -of your $PATH and any error possibly output before this message. This -can help us improve future automake versions. - -END - if test x"$ACCEPT_INFERIOR_RM_PROGRAM" = x"yes"; then - echo 'Configuration will proceed anyway, since you have set the' >&2 - echo 'ACCEPT_INFERIOR_RM_PROGRAM variable to "yes"' >&2 - echo >&2 - else - cat >&2 <<'END' -Aborting the configuration process, to ensure you take notice of the issue. - -You can download and install GNU coreutils to get an 'rm' implementation -that behaves properly: . - -If you want to complete the configuration process using your problematic -'rm' anyway, export the environment variable ACCEPT_INFERIOR_RM_PROGRAM -to "yes", and re-run configure. - -END - AC_MSG_ERROR([Your 'rm' program is bad, sorry.]) - fi -fi -dnl The trailing newline in this macro's definition is deliberate, for -dnl backward compatibility and to allow trailing 'dnl'-style comments -dnl after the AM_INIT_AUTOMAKE invocation. See automake bug#16841. -]) - -dnl Hook into '_AC_COMPILER_EXEEXT' early to learn its expansion. Do not -dnl add the conditional right here, as _AC_COMPILER_EXEEXT may be further -dnl mangled by Autoconf and run in a shell conditional statement. -m4_define([_AC_COMPILER_EXEEXT], -m4_defn([_AC_COMPILER_EXEEXT])[m4_provide([_AM_COMPILER_EXEEXT])]) - -# When config.status generates a header, we must update the stamp-h file. -# This file resides in the same directory as the config header -# that is generated. The stamp files are numbered to have different names. - -# Autoconf calls _AC_AM_CONFIG_HEADER_HOOK (when defined) in the -# loop where config.status creates the headers, so we can generate -# our stamp files there. -AC_DEFUN([_AC_AM_CONFIG_HEADER_HOOK], -[# Compute $1's index in $config_headers. -_am_arg=$1 -_am_stamp_count=1 -for _am_header in $config_headers :; do - case $_am_header in - $_am_arg | $_am_arg:* ) - break ;; - * ) - _am_stamp_count=`expr $_am_stamp_count + 1` ;; - esac -done -echo "timestamp for $_am_arg" >`AS_DIRNAME(["$_am_arg"])`/stamp-h[]$_am_stamp_count]) - -# Copyright (C) 2001-2021 Free Software Foundation, Inc. -# -# This file is free software; the Free Software Foundation -# gives unlimited permission to copy and/or distribute it, -# with or without modifications, as long as this notice is preserved. - -# AM_PROG_INSTALL_SH -# ------------------ -# Define $install_sh. -AC_DEFUN([AM_PROG_INSTALL_SH], -[AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl -if test x"${install_sh+set}" != xset; then - case $am_aux_dir in - *\ * | *\ *) - install_sh="\${SHELL} '$am_aux_dir/install-sh'" ;; - *) - install_sh="\${SHELL} $am_aux_dir/install-sh" - esac -fi -AC_SUBST([install_sh])]) - -# Copyright (C) 2003-2021 Free Software Foundation, Inc. -# -# This file is free software; the Free Software Foundation -# gives unlimited permission to copy and/or distribute it, -# with or without modifications, as long as this notice is preserved. - -# Check whether the underlying file-system supports filenames -# with a leading dot. For instance MS-DOS doesn't. -AC_DEFUN([AM_SET_LEADING_DOT], -[rm -rf .tst 2>/dev/null -mkdir .tst 2>/dev/null -if test -d .tst; then - am__leading_dot=. -else - am__leading_dot=_ -fi -rmdir .tst 2>/dev/null -AC_SUBST([am__leading_dot])]) - -# Add --enable-maintainer-mode option to configure. -*- Autoconf -*- -# From Jim Meyering - -# Copyright (C) 1996-2021 Free Software Foundation, Inc. -# -# This file is free software; the Free Software Foundation -# gives unlimited permission to copy and/or distribute it, -# with or without modifications, as long as this notice is preserved. - -# AM_MAINTAINER_MODE([DEFAULT-MODE]) -# ---------------------------------- -# Control maintainer-specific portions of Makefiles. -# Default is to disable them, unless 'enable' is passed literally. -# For symmetry, 'disable' may be passed as well. Anyway, the user -# can override the default with the --enable/--disable switch. -AC_DEFUN([AM_MAINTAINER_MODE], -[m4_case(m4_default([$1], [disable]), - [enable], [m4_define([am_maintainer_other], [disable])], - [disable], [m4_define([am_maintainer_other], [enable])], - [m4_define([am_maintainer_other], [enable]) - m4_warn([syntax], [unexpected argument to AM@&t@_MAINTAINER_MODE: $1])]) -AC_MSG_CHECKING([whether to enable maintainer-specific portions of Makefiles]) - dnl maintainer-mode's default is 'disable' unless 'enable' is passed - AC_ARG_ENABLE([maintainer-mode], - [AS_HELP_STRING([--]am_maintainer_other[-maintainer-mode], - am_maintainer_other[ make rules and dependencies not useful - (and sometimes confusing) to the casual installer])], - [USE_MAINTAINER_MODE=$enableval], - [USE_MAINTAINER_MODE=]m4_if(am_maintainer_other, [enable], [no], [yes])) - AC_MSG_RESULT([$USE_MAINTAINER_MODE]) - AM_CONDITIONAL([MAINTAINER_MODE], [test $USE_MAINTAINER_MODE = yes]) - MAINT=$MAINTAINER_MODE_TRUE - AC_SUBST([MAINT])dnl -] -) - -# Check to see how 'make' treats includes. -*- Autoconf -*- - -# Copyright (C) 2001-2021 Free Software Foundation, Inc. -# -# This file is free software; the Free Software Foundation -# gives unlimited permission to copy and/or distribute it, -# with or without modifications, as long as this notice is preserved. - -# AM_MAKE_INCLUDE() -# ----------------- -# Check whether make has an 'include' directive that can support all -# the idioms we need for our automatic dependency tracking code. -AC_DEFUN([AM_MAKE_INCLUDE], -[AC_MSG_CHECKING([whether ${MAKE-make} supports the include directive]) -cat > confinc.mk << 'END' -am__doit: - @echo this is the am__doit target >confinc.out -.PHONY: am__doit -END -am__include="#" -am__quote= -# BSD make does it like this. -echo '.include "confinc.mk" # ignored' > confmf.BSD -# Other make implementations (GNU, Solaris 10, AIX) do it like this. -echo 'include confinc.mk # ignored' > confmf.GNU -_am_result=no -for s in GNU BSD; do - AM_RUN_LOG([${MAKE-make} -f confmf.$s && cat confinc.out]) - AS_CASE([$?:`cat confinc.out 2>/dev/null`], - ['0:this is the am__doit target'], - [AS_CASE([$s], - [BSD], [am__include='.include' am__quote='"'], - [am__include='include' am__quote=''])]) - if test "$am__include" != "#"; then - _am_result="yes ($s style)" - break - fi -done -rm -f confinc.* confmf.* -AC_MSG_RESULT([${_am_result}]) -AC_SUBST([am__include])]) -AC_SUBST([am__quote])]) - -# Fake the existence of programs that GNU maintainers use. -*- Autoconf -*- - -# Copyright (C) 1997-2021 Free Software Foundation, Inc. -# -# This file is free software; the Free Software Foundation -# gives unlimited permission to copy and/or distribute it, -# with or without modifications, as long as this notice is preserved. - -# AM_MISSING_PROG(NAME, PROGRAM) -# ------------------------------ -AC_DEFUN([AM_MISSING_PROG], -[AC_REQUIRE([AM_MISSING_HAS_RUN]) -$1=${$1-"${am_missing_run}$2"} -AC_SUBST($1)]) - -# AM_MISSING_HAS_RUN -# ------------------ -# Define MISSING if not defined so far and test if it is modern enough. -# If it is, set am_missing_run to use it, otherwise, to nothing. -AC_DEFUN([AM_MISSING_HAS_RUN], -[AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl -AC_REQUIRE_AUX_FILE([missing])dnl -if test x"${MISSING+set}" != xset; then - MISSING="\${SHELL} '$am_aux_dir/missing'" -fi -# Use eval to expand $SHELL -if eval "$MISSING --is-lightweight"; then - am_missing_run="$MISSING " -else - am_missing_run= - AC_MSG_WARN(['missing' script is too old or missing]) -fi -]) - -# Helper functions for option handling. -*- Autoconf -*- - -# Copyright (C) 2001-2021 Free Software Foundation, Inc. -# -# This file is free software; the Free Software Foundation -# gives unlimited permission to copy and/or distribute it, -# with or without modifications, as long as this notice is preserved. - -# _AM_MANGLE_OPTION(NAME) -# ----------------------- -AC_DEFUN([_AM_MANGLE_OPTION], -[[_AM_OPTION_]m4_bpatsubst($1, [[^a-zA-Z0-9_]], [_])]) - -# _AM_SET_OPTION(NAME) -# -------------------- -# Set option NAME. Presently that only means defining a flag for this option. -AC_DEFUN([_AM_SET_OPTION], -[m4_define(_AM_MANGLE_OPTION([$1]), [1])]) - -# _AM_SET_OPTIONS(OPTIONS) -# ------------------------ -# OPTIONS is a space-separated list of Automake options. -AC_DEFUN([_AM_SET_OPTIONS], -[m4_foreach_w([_AM_Option], [$1], [_AM_SET_OPTION(_AM_Option)])]) - -# _AM_IF_OPTION(OPTION, IF-SET, [IF-NOT-SET]) -# ------------------------------------------- -# Execute IF-SET if OPTION is set, IF-NOT-SET otherwise. -AC_DEFUN([_AM_IF_OPTION], -[m4_ifset(_AM_MANGLE_OPTION([$1]), [$2], [$3])]) - -# Copyright (C) 1999-2021 Free Software Foundation, Inc. -# -# This file is free software; the Free Software Foundation -# gives unlimited permission to copy and/or distribute it, -# with or without modifications, as long as this notice is preserved. - -# _AM_PROG_CC_C_O -# --------------- -# Like AC_PROG_CC_C_O, but changed for automake. We rewrite AC_PROG_CC -# to automatically call this. -AC_DEFUN([_AM_PROG_CC_C_O], -[AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl -AC_REQUIRE_AUX_FILE([compile])dnl -AC_LANG_PUSH([C])dnl -AC_CACHE_CHECK( - [whether $CC understands -c and -o together], - [am_cv_prog_cc_c_o], - [AC_LANG_CONFTEST([AC_LANG_PROGRAM([])]) - # Make sure it works both with $CC and with simple cc. - # Following AC_PROG_CC_C_O, we do the test twice because some - # compilers refuse to overwrite an existing .o file with -o, - # though they will create one. - am_cv_prog_cc_c_o=yes - for am_i in 1 2; do - if AM_RUN_LOG([$CC -c conftest.$ac_ext -o conftest2.$ac_objext]) \ - && test -f conftest2.$ac_objext; then - : OK - else - am_cv_prog_cc_c_o=no - break - fi - done - rm -f core conftest* - unset am_i]) -if test "$am_cv_prog_cc_c_o" != yes; then - # Losing compiler, so override with the script. - # FIXME: It is wrong to rewrite CC. - # But if we don't then we get into trouble of one sort or another. - # A longer-term fix would be to have automake use am__CC in this case, - # and then we could set am__CC="\$(top_srcdir)/compile \$(CC)" - CC="$am_aux_dir/compile $CC" -fi -AC_LANG_POP([C])]) - -# For backward compatibility. -AC_DEFUN_ONCE([AM_PROG_CC_C_O], [AC_REQUIRE([AC_PROG_CC])]) - -# Copyright (C) 2001-2021 Free Software Foundation, Inc. -# -# This file is free software; the Free Software Foundation -# gives unlimited permission to copy and/or distribute it, -# with or without modifications, as long as this notice is preserved. - -# AM_RUN_LOG(COMMAND) -# ------------------- -# Run COMMAND, save the exit status in ac_status, and log it. -# (This has been adapted from Autoconf's _AC_RUN_LOG macro.) -AC_DEFUN([AM_RUN_LOG], -[{ echo "$as_me:$LINENO: $1" >&AS_MESSAGE_LOG_FD - ($1) >&AS_MESSAGE_LOG_FD 2>&AS_MESSAGE_LOG_FD - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&AS_MESSAGE_LOG_FD - (exit $ac_status); }]) - -# Check to make sure that the build environment is sane. -*- Autoconf -*- - -# Copyright (C) 1996-2021 Free Software Foundation, Inc. -# -# This file is free software; the Free Software Foundation -# gives unlimited permission to copy and/or distribute it, -# with or without modifications, as long as this notice is preserved. - -# AM_SANITY_CHECK -# --------------- -AC_DEFUN([AM_SANITY_CHECK], -[AC_MSG_CHECKING([whether build environment is sane]) -# Reject unsafe characters in $srcdir or the absolute working directory -# name. Accept space and tab only in the latter. -am_lf=' -' -case `pwd` in - *[[\\\"\#\$\&\'\`$am_lf]]*) - AC_MSG_ERROR([unsafe absolute working directory name]);; -esac -case $srcdir in - *[[\\\"\#\$\&\'\`$am_lf\ \ ]]*) - AC_MSG_ERROR([unsafe srcdir value: '$srcdir']);; -esac - -# Do 'set' in a subshell so we don't clobber the current shell's -# arguments. Must try -L first in case configure is actually a -# symlink; some systems play weird games with the mod time of symlinks -# (eg FreeBSD returns the mod time of the symlink's containing -# directory). -if ( - am_has_slept=no - for am_try in 1 2; do - echo "timestamp, slept: $am_has_slept" > conftest.file - set X `ls -Lt "$srcdir/configure" conftest.file 2> /dev/null` - if test "$[*]" = "X"; then - # -L didn't work. - set X `ls -t "$srcdir/configure" conftest.file` - fi - if test "$[*]" != "X $srcdir/configure conftest.file" \ - && test "$[*]" != "X conftest.file $srcdir/configure"; then - - # If neither matched, then we have a broken ls. This can happen - # if, for instance, CONFIG_SHELL is bash and it inherits a - # broken ls alias from the environment. This has actually - # happened. Such a system could not be considered "sane". - AC_MSG_ERROR([ls -t appears to fail. Make sure there is not a broken - alias in your environment]) - fi - if test "$[2]" = conftest.file || test $am_try -eq 2; then - break - fi - # Just in case. - sleep 1 - am_has_slept=yes - done - test "$[2]" = conftest.file - ) -then - # Ok. - : -else - AC_MSG_ERROR([newly created file is older than distributed files! -Check your system clock]) -fi -AC_MSG_RESULT([yes]) -# If we didn't sleep, we still need to ensure time stamps of config.status and -# generated files are strictly newer. -am_sleep_pid= -if grep 'slept: no' conftest.file >/dev/null 2>&1; then - ( sleep 1 ) & - am_sleep_pid=$! -fi -AC_CONFIG_COMMANDS_PRE( - [AC_MSG_CHECKING([that generated files are newer than configure]) - if test -n "$am_sleep_pid"; then - # Hide warnings about reused PIDs. - wait $am_sleep_pid 2>/dev/null - fi - AC_MSG_RESULT([done])]) -rm -f conftest.file -]) - -# Copyright (C) 2009-2021 Free Software Foundation, Inc. -# -# This file is free software; the Free Software Foundation -# gives unlimited permission to copy and/or distribute it, -# with or without modifications, as long as this notice is preserved. - -# AM_SILENT_RULES([DEFAULT]) -# -------------------------- -# Enable less verbose build rules; with the default set to DEFAULT -# ("yes" being less verbose, "no" or empty being verbose). -AC_DEFUN([AM_SILENT_RULES], -[AC_ARG_ENABLE([silent-rules], [dnl -AS_HELP_STRING( - [--enable-silent-rules], - [less verbose build output (undo: "make V=1")]) -AS_HELP_STRING( - [--disable-silent-rules], - [verbose build output (undo: "make V=0")])dnl -]) -case $enable_silent_rules in @%:@ ((( - yes) AM_DEFAULT_VERBOSITY=0;; - no) AM_DEFAULT_VERBOSITY=1;; - *) AM_DEFAULT_VERBOSITY=m4_if([$1], [yes], [0], [1]);; -esac -dnl -dnl A few 'make' implementations (e.g., NonStop OS and NextStep) -dnl do not support nested variable expansions. -dnl See automake bug#9928 and bug#10237. -am_make=${MAKE-make} -AC_CACHE_CHECK([whether $am_make supports nested variables], - [am_cv_make_support_nested_variables], - [if AS_ECHO([['TRUE=$(BAR$(V)) -BAR0=false -BAR1=true -V=1 -am__doit: - @$(TRUE) -.PHONY: am__doit']]) | $am_make -f - >/dev/null 2>&1; then - am_cv_make_support_nested_variables=yes -else - am_cv_make_support_nested_variables=no -fi]) -if test $am_cv_make_support_nested_variables = yes; then - dnl Using '$V' instead of '$(V)' breaks IRIX make. - AM_V='$(V)' - AM_DEFAULT_V='$(AM_DEFAULT_VERBOSITY)' -else - AM_V=$AM_DEFAULT_VERBOSITY - AM_DEFAULT_V=$AM_DEFAULT_VERBOSITY -fi -AC_SUBST([AM_V])dnl -AM_SUBST_NOTMAKE([AM_V])dnl -AC_SUBST([AM_DEFAULT_V])dnl -AM_SUBST_NOTMAKE([AM_DEFAULT_V])dnl -AC_SUBST([AM_DEFAULT_VERBOSITY])dnl -AM_BACKSLASH='\' -AC_SUBST([AM_BACKSLASH])dnl -_AM_SUBST_NOTMAKE([AM_BACKSLASH])dnl -]) - -# Copyright (C) 2001-2021 Free Software Foundation, Inc. -# -# This file is free software; the Free Software Foundation -# gives unlimited permission to copy and/or distribute it, -# with or without modifications, as long as this notice is preserved. - -# AM_PROG_INSTALL_STRIP -# --------------------- -# One issue with vendor 'install' (even GNU) is that you can't -# specify the program used to strip binaries. This is especially -# annoying in cross-compiling environments, where the build's strip -# is unlikely to handle the host's binaries. -# Fortunately install-sh will honor a STRIPPROG variable, so we -# always use install-sh in "make install-strip", and initialize -# STRIPPROG with the value of the STRIP variable (set by the user). -AC_DEFUN([AM_PROG_INSTALL_STRIP], -[AC_REQUIRE([AM_PROG_INSTALL_SH])dnl -# Installed binaries are usually stripped using 'strip' when the user -# run "make install-strip". However 'strip' might not be the right -# tool to use in cross-compilation environments, therefore Automake -# will honor the 'STRIP' environment variable to overrule this program. -dnl Don't test for $cross_compiling = yes, because it might be 'maybe'. -if test "$cross_compiling" != no; then - AC_CHECK_TOOL([STRIP], [strip], :) -fi -INSTALL_STRIP_PROGRAM="\$(install_sh) -c -s" -AC_SUBST([INSTALL_STRIP_PROGRAM])]) - -# Copyright (C) 2006-2021 Free Software Foundation, Inc. -# -# This file is free software; the Free Software Foundation -# gives unlimited permission to copy and/or distribute it, -# with or without modifications, as long as this notice is preserved. - -# _AM_SUBST_NOTMAKE(VARIABLE) -# --------------------------- -# Prevent Automake from outputting VARIABLE = @VARIABLE@ in Makefile.in. -# This macro is traced by Automake. -AC_DEFUN([_AM_SUBST_NOTMAKE]) - -# AM_SUBST_NOTMAKE(VARIABLE) -# -------------------------- -# Public sister of _AM_SUBST_NOTMAKE. -AC_DEFUN([AM_SUBST_NOTMAKE], [_AM_SUBST_NOTMAKE($@)]) - -# Check how to create a tarball. -*- Autoconf -*- - -# Copyright (C) 2004-2021 Free Software Foundation, Inc. -# -# This file is free software; the Free Software Foundation -# gives unlimited permission to copy and/or distribute it, -# with or without modifications, as long as this notice is preserved. - -# _AM_PROG_TAR(FORMAT) -# -------------------- -# Check how to create a tarball in format FORMAT. -# FORMAT should be one of 'v7', 'ustar', or 'pax'. -# -# Substitute a variable $(am__tar) that is a command -# writing to stdout a FORMAT-tarball containing the directory -# $tardir. -# tardir=directory && $(am__tar) > result.tar -# -# Substitute a variable $(am__untar) that extract such -# a tarball read from stdin. -# $(am__untar) < result.tar -# -AC_DEFUN([_AM_PROG_TAR], -[# Always define AMTAR for backward compatibility. Yes, it's still used -# in the wild :-( We should find a proper way to deprecate it ... -AC_SUBST([AMTAR], ['$${TAR-tar}']) - -# We'll loop over all known methods to create a tar archive until one works. -_am_tools='gnutar m4_if([$1], [ustar], [plaintar]) pax cpio none' - -m4_if([$1], [v7], - [am__tar='$${TAR-tar} chof - "$$tardir"' am__untar='$${TAR-tar} xf -'], - - [m4_case([$1], - [ustar], - [# The POSIX 1988 'ustar' format is defined with fixed-size fields. - # There is notably a 21 bits limit for the UID and the GID. In fact, - # the 'pax' utility can hang on bigger UID/GID (see automake bug#8343 - # and bug#13588). - am_max_uid=2097151 # 2^21 - 1 - am_max_gid=$am_max_uid - # The $UID and $GID variables are not portable, so we need to resort - # to the POSIX-mandated id(1) utility. Errors in the 'id' calls - # below are definitely unexpected, so allow the users to see them - # (that is, avoid stderr redirection). - am_uid=`id -u || echo unknown` - am_gid=`id -g || echo unknown` - AC_MSG_CHECKING([whether UID '$am_uid' is supported by ustar format]) - if test $am_uid -le $am_max_uid; then - AC_MSG_RESULT([yes]) - else - AC_MSG_RESULT([no]) - _am_tools=none - fi - AC_MSG_CHECKING([whether GID '$am_gid' is supported by ustar format]) - if test $am_gid -le $am_max_gid; then - AC_MSG_RESULT([yes]) - else - AC_MSG_RESULT([no]) - _am_tools=none - fi], - - [pax], - [], - - [m4_fatal([Unknown tar format])]) - - AC_MSG_CHECKING([how to create a $1 tar archive]) - - # Go ahead even if we have the value already cached. We do so because we - # need to set the values for the 'am__tar' and 'am__untar' variables. - _am_tools=${am_cv_prog_tar_$1-$_am_tools} - - for _am_tool in $_am_tools; do - case $_am_tool in - gnutar) - for _am_tar in tar gnutar gtar; do - AM_RUN_LOG([$_am_tar --version]) && break - done - am__tar="$_am_tar --format=m4_if([$1], [pax], [posix], [$1]) -chf - "'"$$tardir"' - am__tar_="$_am_tar --format=m4_if([$1], [pax], [posix], [$1]) -chf - "'"$tardir"' - am__untar="$_am_tar -xf -" - ;; - plaintar) - # Must skip GNU tar: if it does not support --format= it doesn't create - # ustar tarball either. - (tar --version) >/dev/null 2>&1 && continue - am__tar='tar chf - "$$tardir"' - am__tar_='tar chf - "$tardir"' - am__untar='tar xf -' - ;; - pax) - am__tar='pax -L -x $1 -w "$$tardir"' - am__tar_='pax -L -x $1 -w "$tardir"' - am__untar='pax -r' - ;; - cpio) - am__tar='find "$$tardir" -print | cpio -o -H $1 -L' - am__tar_='find "$tardir" -print | cpio -o -H $1 -L' - am__untar='cpio -i -H $1 -d' - ;; - none) - am__tar=false - am__tar_=false - am__untar=false - ;; - esac - - # If the value was cached, stop now. We just wanted to have am__tar - # and am__untar set. - test -n "${am_cv_prog_tar_$1}" && break - - # tar/untar a dummy directory, and stop if the command works. - rm -rf conftest.dir - mkdir conftest.dir - echo GrepMe > conftest.dir/file - AM_RUN_LOG([tardir=conftest.dir && eval $am__tar_ >conftest.tar]) - rm -rf conftest.dir - if test -s conftest.tar; then - AM_RUN_LOG([$am__untar /dev/null 2>&1 && break - fi - done - rm -rf conftest.dir - - AC_CACHE_VAL([am_cv_prog_tar_$1], [am_cv_prog_tar_$1=$_am_tool]) - AC_MSG_RESULT([$am_cv_prog_tar_$1])]) - -AC_SUBST([am__tar]) -AC_SUBST([am__untar]) -]) # _AM_PROG_TAR - -m4_include([m4/ac_system_extensions.m4]) -m4_include([m4/acx_check_suncc.m4]) -m4_include([m4/ax_cxx_compile_stdcxx.m4]) -m4_include([m4/ax_prog_cc_for_build.m4]) -m4_include([m4/ax_prog_cxx_for_build.m4]) -m4_include([m4/ax_pthread.m4]) -m4_include([m4/libtool.m4]) -m4_include([m4/ltoptions.m4]) -m4_include([m4/ltsugar.m4]) -m4_include([m4/ltversion.m4]) -m4_include([m4/lt~obsolete.m4]) -m4_include([m4/stl_hash.m4]) diff --git a/extra/protobuf/protobuf-3.19.4/ar-lib b/extra/protobuf/protobuf-3.19.4/ar-lib deleted file mode 100755 index c349042c3fac..000000000000 --- a/extra/protobuf/protobuf-3.19.4/ar-lib +++ /dev/null @@ -1,271 +0,0 @@ -#! /bin/sh -# Wrapper for Microsoft lib.exe - -me=ar-lib -scriptversion=2019-07-04.01; # UTC - -# Copyright (C) 2010-2021 Free Software Foundation, Inc. -# Written by Peter Rosin . -# -# This program is free software; you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation; either version 2, or (at your option) -# any later version. -# -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with this program. If not, see . - -# As a special exception to the GNU General Public License, if you -# distribute this file as part of a program that contains a -# configuration script generated by Autoconf, you may include it under -# the same distribution terms that you use for the rest of that program. - -# This file is maintained in Automake, please report -# bugs to or send patches to -# . - - -# func_error message -func_error () -{ - echo "$me: $1" 1>&2 - exit 1 -} - -file_conv= - -# func_file_conv build_file -# Convert a $build file to $host form and store it in $file -# Currently only supports Windows hosts. -func_file_conv () -{ - file=$1 - case $file in - / | /[!/]*) # absolute file, and not a UNC file - if test -z "$file_conv"; then - # lazily determine how to convert abs files - case `uname -s` in - MINGW*) - file_conv=mingw - ;; - CYGWIN* | MSYS*) - file_conv=cygwin - ;; - *) - file_conv=wine - ;; - esac - fi - case $file_conv in - mingw) - file=`cmd //C echo "$file " | sed -e 's/"\(.*\) " *$/\1/'` - ;; - cygwin | msys) - file=`cygpath -m "$file" || echo "$file"` - ;; - wine) - file=`winepath -w "$file" || echo "$file"` - ;; - esac - ;; - esac -} - -# func_at_file at_file operation archive -# Iterate over all members in AT_FILE performing OPERATION on ARCHIVE -# for each of them. -# When interpreting the content of the @FILE, do NOT use func_file_conv, -# since the user would need to supply preconverted file names to -# binutils ar, at least for MinGW. -func_at_file () -{ - operation=$2 - archive=$3 - at_file_contents=`cat "$1"` - eval set x "$at_file_contents" - shift - - for member - do - $AR -NOLOGO $operation:"$member" "$archive" || exit $? - done -} - -case $1 in - '') - func_error "no command. Try '$0 --help' for more information." - ;; - -h | --h*) - cat <&2 << __EOF__ -Could not find source code. Make sure you are running this script from the -root of the distribution tree. -__EOF__ - exit 1 -fi - -set -ex - -# The absence of a m4 directory in googletest causes autoreconf to fail when -# building under the CentOS docker image. It's a warning in regular build on -# Ubuntu/gLinux as well. (This is only needed if git submodules have been -# initialized, which is typically only needed for testing; see the installation -# instructions for details.) -if test -d third_party/googletest; then - mkdir -p third_party/googletest/m4 -fi - -# TODO(kenton): Remove the ",no-obsolete" part and fix the resulting warnings. -autoreconf -f -i -Wall,no-obsolete - -rm -rf autom4te.cache config.h.in~ -exit 0 diff --git a/extra/protobuf/protobuf-3.19.4/build_files_updated_unittest.sh b/extra/protobuf/protobuf-3.19.4/build_files_updated_unittest.sh deleted file mode 100755 index 87541c35faa2..000000000000 --- a/extra/protobuf/protobuf-3.19.4/build_files_updated_unittest.sh +++ /dev/null @@ -1,62 +0,0 @@ -#!/bin/bash - -# This script verifies that BUILD files and cmake files are in sync with src/Makefile.am - -set -eo pipefail - -if [ "$(uname)" != "Linux" ]; then - echo "build_files_updated_unittest only supported on Linux. Skipping..." - exit 0 -fi - -# Keep in sync with files needed by update_file_lists.sh -generated_files=( - "BUILD" - "cmake/extract_includes.bat.in" - "cmake/libprotobuf-lite.cmake" - "cmake/libprotobuf.cmake" - "cmake/libprotoc.cmake" - "cmake/tests.cmake" - "src/Makefile.am" -) - -# If we're running in Bazel, use the Bazel-provided temp-dir. -if [ -n "${TEST_TMPDIR}" ]; then - # Env-var TEST_TMPDIR is set, assume that this is Bazel. - # Bazel may have opinions whether we are allowed to delete TEST_TMPDIR. - test_root="${TEST_TMPDIR}/build_files_updated_unittest" - mkdir "${test_root}" -else - # Seems like we're not executed by Bazel. - test_root=$(mktemp -d) -fi - -# From now on, fail if there are any unbound variables. -set -u - -# Remove artifacts after test is finished. -function cleanup { - rm -rf "${test_root}" -} -trap cleanup EXIT - -# Create golden dir and add snapshot of current state. -golden_dir="${test_root}/golden" -mkdir -p "${golden_dir}/cmake" "${golden_dir}/src" -for file in ${generated_files[@]}; do - cp "${file}" "${golden_dir}/${file}" -done - -# Create test dir, copy current state into it, and execute update script. -test_dir="${test_root}/test" -cp -R "${golden_dir}" "${test_dir}" - -cp "update_file_lists.sh" "${test_dir}/update_file_lists.sh" -chmod +x "${test_dir}/update_file_lists.sh" -cd "${test_root}/test" -bash "${test_dir}/update_file_lists.sh" - -# Test whether there are any differences -for file in ${generated_files[@]}; do - diff -du "${golden_dir}/${file}" "${test_dir}/${file}" -done diff --git a/extra/protobuf/protobuf-3.19.4/cc_proto_blacklist_test.bzl b/extra/protobuf/protobuf-3.19.4/cc_proto_blacklist_test.bzl deleted file mode 100644 index df54293cbd0f..000000000000 --- a/extra/protobuf/protobuf-3.19.4/cc_proto_blacklist_test.bzl +++ /dev/null @@ -1,38 +0,0 @@ -"""Contains a unittest to verify that `cc_proto_library` does not generate code for blacklisted `.proto` sources (i.e. WKPs).""" - -load("@bazel_skylib//lib:unittest.bzl", "asserts", "unittest") - -def _cc_proto_blacklist_test_impl(ctx): - """Verifies that there are no C++ compile actions for Well-Known-Protos. - - Args: - ctx: The rule context. - - Returns: A (not further specified) sequence of providers. - """ - - env = unittest.begin(ctx) - - for dep in ctx.attr.deps: - files = len(dep.files.to_list()) - asserts.equals( - env, - 0, - files, - "Expected that target '{}' does not provide files, got {}".format( - dep.label, - files, - ), - ) - - return unittest.end(env) - -cc_proto_blacklist_test = unittest.make( - impl = _cc_proto_blacklist_test_impl, - attrs = { - "deps": attr.label_list( - mandatory = True, - providers = [CcInfo], - ), - }, -) diff --git a/extra/protobuf/protobuf-3.19.4/cmake/CMakeLists.txt b/extra/protobuf/protobuf-3.19.4/cmake/CMakeLists.txt deleted file mode 100644 index efe6b97f5e63..000000000000 --- a/extra/protobuf/protobuf-3.19.4/cmake/CMakeLists.txt +++ /dev/null @@ -1,317 +0,0 @@ -# Minimum CMake required -### cmake_minimum_required(VERSION 3.1.3) - -if(protobuf_VERBOSE) - message(STATUS "Protocol Buffers Configuring...") -endif() - -# CMake policies -cmake_policy(SET CMP0022 NEW) -# On MacOS use @rpath/ for target's install name prefix path -if (POLICY CMP0042) - cmake_policy(SET CMP0042 NEW) -endif () -# Clear VERSION variables when no VERSION is given to project() -if(POLICY CMP0048) - cmake_policy(SET CMP0048 NEW) -endif() -# MSVC runtime library flags are selected by an abstraction. -if(POLICY CMP0091) - cmake_policy(SET CMP0091 NEW) -endif() - -# Project -project(protobuf C CXX) - -# Add c++11 flags -if (CYGWIN) - set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=gnu++11") -else() -# set(CMAKE_CXX_STANDARD 11) -# set(CMAKE_CXX_STANDARD_REQUIRED ON) - set(CMAKE_CXX_EXTENSIONS OFF) -endif() - -# The Intel compiler isn't able to deal with noinline member functions of -# template classes defined in headers. As such it spams the output with -# warning #2196: routine is both "inline" and "noinline" -# This silences that warning. -if (CMAKE_CXX_COMPILER_ID MATCHES Intel) - string(APPEND CMAKE_CXX_FLAGS " -diag-disable=2196") -endif() - -# Options -if(WITH_PROTOC) - set(protobuf_PROTOC_EXE ${WITH_PROTOC} CACHE FILEPATH "Protocol Buffer Compiler executable" FORCE) -endif() -option(protobuf_BUILD_TESTS "Build tests" ON) -option(protobuf_BUILD_CONFORMANCE "Build conformance tests" OFF) -option(protobuf_BUILD_EXAMPLES "Build examples" OFF) -option(protobuf_BUILD_PROTOC_BINARIES "Build libprotoc and protoc compiler" ON) -option(protobuf_BUILD_LIBPROTOC "Build libprotoc" OFF) -option(protobuf_DISABLE_RTTI "Remove runtime type information in the binaries" OFF) -if (BUILD_SHARED_LIBS) - set(protobuf_BUILD_SHARED_LIBS_DEFAULT ON) -else (BUILD_SHARED_LIBS) - set(protobuf_BUILD_SHARED_LIBS_DEFAULT OFF) -endif (BUILD_SHARED_LIBS) -option(protobuf_BUILD_SHARED_LIBS "Build Shared Libraries" ${protobuf_BUILD_SHARED_LIBS_DEFAULT}) -include(CMakeDependentOption) -cmake_dependent_option(protobuf_MSVC_STATIC_RUNTIME "Link static runtime libraries" ON - "NOT protobuf_BUILD_SHARED_LIBS" OFF) -set(protobuf_WITH_ZLIB_DEFAULT ON) -option(protobuf_WITH_ZLIB "Build with zlib support" ${protobuf_WITH_ZLIB_DEFAULT}) -set(protobuf_DEBUG_POSTFIX "d" - CACHE STRING "Default debug postfix") -mark_as_advanced(protobuf_DEBUG_POSTFIX) -# User options -include(protobuf-options.cmake) - -# Overrides for option dependencies -if (protobuf_BUILD_PROTOC_BINARIES OR protobuf_BUILD_TESTS) - set(protobuf_BUILD_LIBPROTOC ON) -endif () -# Path to main configure script -set(protobuf_CONFIGURE_SCRIPT "../configure.ac") - -# Parse configure script -set(protobuf_AC_INIT_REGEX - "^AC_INIT\\(\\[([^]]+)\\],\\[([^]]+)\\],\\[([^]]+)\\],\\[([^]]+)\\]\\)$") -file(STRINGS "${protobuf_CONFIGURE_SCRIPT}" protobuf_AC_INIT_LINE - LIMIT_COUNT 1 REGEX "^AC_INIT") -# Description -string(REGEX REPLACE "${protobuf_AC_INIT_REGEX}" "\\1" - protobuf_DESCRIPTION "${protobuf_AC_INIT_LINE}") -# Version -string(REGEX REPLACE "${protobuf_AC_INIT_REGEX}" "\\2" - protobuf_VERSION_STRING "${protobuf_AC_INIT_LINE}") -# Contact -string(REGEX REPLACE "${protobuf_AC_INIT_REGEX}" "\\3" - protobuf_CONTACT "${protobuf_AC_INIT_LINE}") -# Parse version tweaks -set(protobuf_VERSION_REGEX "^([0-9]+)\\.([0-9]+)\\.([0-9]+)([-]rc[-]|\\.)?([0-9]*)$") -string(REGEX REPLACE "${protobuf_VERSION_REGEX}" "\\1" - protobuf_VERSION_MAJOR "${protobuf_VERSION_STRING}") -string(REGEX REPLACE "${protobuf_VERSION_REGEX}" "\\2" - protobuf_VERSION_MINOR "${protobuf_VERSION_STRING}") -string(REGEX REPLACE "${protobuf_VERSION_REGEX}" "\\3" - protobuf_VERSION_PATCH "${protobuf_VERSION_STRING}") -string(REGEX REPLACE "${protobuf_VERSION_REGEX}" "\\5" - protobuf_VERSION_PRERELEASE "${protobuf_VERSION_STRING}") - -### message(STATUS "${protobuf_VERSION_PRERELEASE}") - -# Package version -set(protobuf_VERSION - "${protobuf_VERSION_MAJOR}.${protobuf_VERSION_MINOR}.${protobuf_VERSION_PATCH}") - -if(protobuf_VERSION_PRERELEASE) - set(protobuf_VERSION "${protobuf_VERSION}.${protobuf_VERSION_PRERELEASE}") -else() - set(protobuf_VERSION "${protobuf_VERSION}") -endif() -### message(STATUS "${protobuf_VERSION}") - -if(protobuf_VERBOSE) - message(STATUS "Configuration script parsing status [") - message(STATUS " Description : ${protobuf_DESCRIPTION}") - message(STATUS " Version : ${protobuf_VERSION} (${protobuf_VERSION_STRING})") - message(STATUS " Contact : ${protobuf_CONTACT}") - message(STATUS "]") -endif() - -add_definitions(-DGOOGLE_PROTOBUF_CMAKE_BUILD) - -if (protobuf_DISABLE_RTTI) - add_definitions(-DGOOGLE_PROTOBUF_NO_RTTI=1) -endif() - -find_package(Threads REQUIRED) - -### set(_protobuf_FIND_ZLIB) -### if (protobuf_WITH_ZLIB) -### find_package(ZLIB) -### if (ZLIB_FOUND) -### set(HAVE_ZLIB 1) -### # FindZLIB module define ZLIB_INCLUDE_DIRS variable -### # Set ZLIB_INCLUDE_DIRECTORIES for compatible -### set(ZLIB_INCLUDE_DIRECTORIES ${ZLIB_INCLUDE_DIRECTORIES} ${ZLIB_INCLUDE_DIRS}) -### # Using imported target if exists -### if (TARGET ZLIB::ZLIB) -### set(ZLIB_LIBRARIES ZLIB::ZLIB) -### set(_protobuf_FIND_ZLIB "if(NOT ZLIB_FOUND)\n find_package(ZLIB)\nendif()") -### endif (TARGET ZLIB::ZLIB) -### else (ZLIB_FOUND) -### set(HAVE_ZLIB 0) -### # Explicitly set these to empty (override NOT_FOUND) so cmake doesn't -### # complain when we use them later. -### set(ZLIB_INCLUDE_DIRECTORIES) -### set(ZLIB_LIBRARIES) -### endif (ZLIB_FOUND) -### endif (protobuf_WITH_ZLIB) -### -### if (HAVE_ZLIB) -### add_definitions(-DHAVE_ZLIB) -### endif (HAVE_ZLIB) - -### An extra option instead this above -if (protobuf_WITH_ZLIB) - add_definitions(-DHAVE_ZLIB) -endif (protobuf_WITH_ZLIB) - -# We need to link with libatomic on systems that do not have builtin atomics, or -# don't have builtin support for 8 byte atomics -set(protobuf_LINK_LIBATOMIC false) -if (NOT MSVC) - include(CheckCXXSourceCompiles) - set(OLD_CMAKE_REQUIRED_FLAGS ${CMAKE_REQUIRED_FLAGS}) - set(CMAKE_REQUIRED_FLAGS ${CMAKE_REQUIRED_FLAGS} -std=c++11) - check_cxx_source_compiles(" - #include - int main() { - return std::atomic{}; - } - " protobuf_HAVE_BUILTIN_ATOMICS) - if (NOT protobuf_HAVE_BUILTIN_ATOMICS) - set(protobuf_LINK_LIBATOMIC true) - endif (NOT protobuf_HAVE_BUILTIN_ATOMICS) - set(CMAKE_REQUIRED_FLAGS ${OLD_CMAKE_REQUIRED_FLAGS}) -endif (NOT MSVC) - -if (protobuf_BUILD_SHARED_LIBS) - set(protobuf_SHARED_OR_STATIC "SHARED") -else (protobuf_BUILD_SHARED_LIBS) - set(protobuf_SHARED_OR_STATIC "STATIC") - # The CMAKE__FLAGS(_)? is meant to be user controlled. - # Prior to CMake 3.15, the MSVC runtime library was pushed into the same flags - # making programmatic control difficult. Prefer the functionality in newer - # CMake versions when available. - if(CMAKE_VERSION VERSION_GREATER 3.15 OR CMAKE_VERSION VERSION_EQUAL 3.15) - set(CMAKE_MSVC_RUNTIME_LIBRARY MultiThreaded$<$:Debug>) - else() - # In case we are building static libraries, link also the runtime library statically - # so that MSVCR*.DLL is not required at runtime. - # https://msdn.microsoft.com/en-us/library/2kzt1wy3.aspx - # This is achieved by replacing msvc option /MD with /MT and /MDd with /MTd - # http://www.cmake.org/Wiki/CMake_FAQ#How_can_I_build_my_MSVC_application_with_a_static_runtime.3F - if (MSVC AND protobuf_MSVC_STATIC_RUNTIME) - foreach(flag_var - CMAKE_CXX_FLAGS CMAKE_CXX_FLAGS_DEBUG CMAKE_CXX_FLAGS_RELEASE - CMAKE_CXX_FLAGS_MINSIZEREL CMAKE_CXX_FLAGS_RELWITHDEBINFO) - if(${flag_var} MATCHES "/MD") - string(REGEX REPLACE "/MD" "/MT" ${flag_var} "${${flag_var}}") - endif(${flag_var} MATCHES "/MD") - endforeach(flag_var) - endif (MSVC AND protobuf_MSVC_STATIC_RUNTIME) - endif() -endif (protobuf_BUILD_SHARED_LIBS) - -if (MSVC) - if (CMAKE_CXX_COMPILER_ID STREQUAL "MSVC") - # Build with multiple processes - add_definitions(/MP) - endif() - # Set source file and execution character sets to UTF-8 - add_definitions(/utf-8) - # MSVC warning suppressions - add_definitions( - /wd4018 # 'expression' : signed/unsigned mismatch - /wd4065 # switch statement contains 'default' but no 'case' labels - /wd4146 # unary minus operator applied to unsigned type, result still unsigned - /wd4244 # 'conversion' conversion from 'type1' to 'type2', possible loss of data - /wd4251 # 'identifier' : class 'type' needs to have dll-interface to be used by clients of class 'type2' - /wd4267 # 'var' : conversion from 'size_t' to 'type', possible loss of data - /wd4305 # 'identifier' : truncation from 'type1' to 'type2' - /wd4307 # 'operator' : integral constant overflow - /wd4309 # 'conversion' : truncation of constant value - /wd4334 # 'operator' : result of 32-bit shift implicitly converted to 64 bits (was 64-bit shift intended?) - /wd4355 # 'this' : used in base member initializer list - /wd4506 # no definition for inline function 'function' - /wd4800 # 'type' : forcing value to bool 'true' or 'false' (performance warning) - /wd4996 # The compiler encountered a deprecated declaration. - ) - # Allow big object - add_definitions(/bigobj) - string(REPLACE "/" "\\" PROTOBUF_SOURCE_WIN32_PATH ${protobuf_SOURCE_DIR}) - string(REPLACE "/" "\\" PROTOBUF_BINARY_WIN32_PATH ${protobuf_BINARY_DIR}) - string(REPLACE "." "," protobuf_RC_FILEVERSION "${protobuf_VERSION}") - configure_file(extract_includes.bat.in extract_includes.bat) - - # Suppress linker warnings about files with no symbols defined. - set(CMAKE_STATIC_LINKER_FLAGS "${CMAKE_STATIC_LINKER_FLAGS} /ignore:4221") - - if (CMAKE_CXX_COMPILER_ID STREQUAL "MSVC") - # Configure Resource Compiler - enable_language(RC) - # use English language (0x409) in resource compiler - set(rc_flags "/l0x409") - # fix rc.exe invocations because of usage of add_definitions() - set(CMAKE_RC_COMPILE_OBJECT " ${rc_flags} /fo ") - endif() - - configure_file(version.rc.in ${CMAKE_CURRENT_BINARY_DIR}/version.rc @ONLY) -endif (MSVC) - - -get_filename_component(protobuf_source_dir ${protobuf_SOURCE_DIR} PATH) - -include_directories( - ${ZLIB_INCLUDE_DIRECTORIES} - ${protobuf_BINARY_DIR} - ${protobuf_source_dir}/src) - -if (MSVC) - # Add the "lib" prefix for generated .lib outputs. - set(LIB_PREFIX lib) -else (MSVC) - # When building with "make", "lib" prefix will be added automatically by - # the build tool. - set(LIB_PREFIX) -endif (MSVC) - -if (protobuf_UNICODE) - add_definitions(-DUNICODE -D_UNICODE) -endif (protobuf_UNICODE) - -include(libprotobuf-lite.cmake) -include(libprotobuf.cmake) -if (protobuf_BUILD_LIBPROTOC) - include(libprotoc.cmake) -endif (protobuf_BUILD_LIBPROTOC) -if (protobuf_BUILD_PROTOC_BINARIES) - include(protoc.cmake) - if (NOT DEFINED protobuf_PROTOC_EXE) - set(protobuf_PROTOC_EXE protoc) - endif (NOT DEFINED protobuf_PROTOC_EXE) -endif (protobuf_BUILD_PROTOC_BINARIES) - -# Ensure we have a protoc executable if we need one -if (protobuf_BUILD_TESTS OR protobuf_BUILD_CONFORMANCE OR protobuf_BUILD_EXAMPLES) - if (NOT DEFINED protobuf_PROTOC_EXE) - find_program(protobuf_PROTOC_EXE protoc) - if (NOT protobuf_PROTOC_EXE) - message(FATAL "Build requires 'protoc' but binary not found and not building protoc.") - endif () - endif () - if(protobuf_VERBOSE) - message(STATUS "Using protoc : ${protobuf_PROTOC_EXE}") - endif(protobuf_VERBOSE) -endif () - -if (protobuf_BUILD_TESTS) - include(tests.cmake) -endif (protobuf_BUILD_TESTS) - -if (protobuf_BUILD_CONFORMANCE) - include(conformance.cmake) -endif (protobuf_BUILD_CONFORMANCE) - -### include(install.cmake) - -if (protobuf_BUILD_EXAMPLES) - include(examples.cmake) -endif (protobuf_BUILD_EXAMPLES) - -if(protobuf_VERBOSE) - message(STATUS "Protocol Buffers Configuring done") -endif(protobuf_VERBOSE) diff --git a/extra/protobuf/protobuf-3.19.4/cmake/README.md b/extra/protobuf/protobuf-3.19.4/cmake/README.md deleted file mode 100644 index 89d00c1b6f4f..000000000000 --- a/extra/protobuf/protobuf-3.19.4/cmake/README.md +++ /dev/null @@ -1,345 +0,0 @@ -This directory contains *CMake* files that can be used to build protobuf -with *MSVC* on *Windows*. You can build the project from *Command Prompt* -and using an *Visual Studio* IDE. - -You need to have [CMake](http://www.cmake.org), [Visual Studio](https://www.visualstudio.com) -and optionally [Git](http://git-scm.com) installed on your computer before proceeding. - -Most of the instructions will be given to the *Сommand Prompt*, but the same -actions can be performed using appropriate GUI tools. - -Environment Setup -================= - -Open the appropriate *Command Prompt* from the *Start* menu. - -For example *x86 Native Tools Command Prompt for VS 2019*: - - C:\Program Files (x86)\Microsoft Visual Studio\2019\Professional> - -Change to your working directory: - - C:\Program Files (x86)\Microsoft Visual Studio\2019\Professional>cd C:\Path\to - C:\Path\to> - -Where *C:\Path\to* is path to your real working directory. - -Create a folder where protobuf headers/libraries/binaries will be installed after built: - - C:\Path\to>mkdir install - -If *cmake* command is not available from *Command Prompt*, add it to system *PATH* variable: - - C:\Path\to>set PATH=%PATH%;C:\Program Files (x86)\CMake\bin - -If *git* command is not available from *Command Prompt*, add it to system *PATH* variable: - - C:\Path\to>set PATH=%PATH%;C:\Program Files\Git\cmd - -Good. Now you are ready to continue. - -Getting Sources -=============== - -You can get the latest stable source packages from the release page: - - https://github.com/protocolbuffers/protobuf/releases/latest - -For example: if you only need C++, download `protobuf-cpp-[VERSION].tar.gz`; if -you need C++ and Java, download `protobuf-java-[VERSION].tar.gz` (every package -contains C++ source already); if you need C++ and multiple other languages, -download `protobuf-all-[VERSION].tar.gz`. - -Or you can use git to clone from protobuf git repository. - - C:\Path\to> git clone -b [release_tag] https://github.com/protocolbuffers/protobuf.git - -Where *[release_tag]* is a git tag like *v3.0.0-beta-1* or a branch name like *master* -if you want to get the latest code. - -Go to the project folder: - - C:\Path\to>cd protobuf - C:\Path\to\protobuf> - -Remember to update any submodules if you are using git clone (you can skip this -step if you are using a release .tar.gz or .zip package): - -```console -C:\Path\to> git submodule update --init --recursive -``` - -Now go to *cmake* folder in protobuf sources: - - C:\Path\to\protobuf>cd cmake - C:\Path\to\protobuf\cmake> - -Good. Now you are ready to *CMake* configuration. - -CMake Configuration -=================== - -*CMake* supports a lot of different -[generators](http://www.cmake.org/cmake/help/latest/manual/cmake-generators.7.html) -for various native build systems. -We are only interested in -[Makefile](http://www.cmake.org/cmake/help/latest/manual/cmake-generators.7.html#makefile-generators) -and -[Visual Studio](http://www.cmake.org/cmake/help/latest/manual/cmake-generators.7.html#visual-studio-generators) -generators. - -We will use shadow building to separate the temporary files from the protobuf source code. - -Create a temporary *build* folder and change your working directory to it: - - C:\Path\to\protobuf\cmake>mkdir build & cd build - C:\Path\to\protobuf\cmake\build> - -The *Makefile* generator can build the project in only one configuration, so you need to build -a separate folder for each configuration. - -To start using a *Release* configuration: - - C:\Path\to\protobuf\cmake\build>mkdir release & cd release - C:\Path\to\protobuf\cmake\build\release>cmake -G "NMake Makefiles" ^ - -DCMAKE_BUILD_TYPE=Release ^ - -DCMAKE_INSTALL_PREFIX=../../../../install ^ - ../.. - -It will generate *nmake* *Makefile* in current directory. - -To use *Debug* configuration: - - C:\Path\to\protobuf\cmake\build>mkdir debug & cd debug - C:\Path\to\protobuf\cmake\build\debug>cmake -G "NMake Makefiles" ^ - -DCMAKE_BUILD_TYPE=Debug ^ - -DCMAKE_INSTALL_PREFIX=../../../../install ^ - ../.. - -It will generate *nmake* *Makefile* in current directory. - -To create *Visual Studio* solution file: - - C:\Path\to\protobuf\cmake\build>mkdir solution & cd solution - C:\Path\to\protobuf\cmake\build\solution>cmake -G "Visual Studio 16 2019" ^ - -DCMAKE_INSTALL_PREFIX=../../../../install ^ - ../.. - -It will generate *Visual Studio* solution file *protobuf.sln* in current directory. - -If the *gmock* directory does not exist, and you do not want to build protobuf unit tests, -you need to add *cmake* command argument `-Dprotobuf_BUILD_TESTS=OFF` to disable testing. - -To make a *Visual Studio* file for Visual Studio 16 2019, create the *Visual Studio* -solution file above and edit the CMakeCache file. - - C:Path\to\protobuf\cmake\build\solution\CMakeCache - -Then create the *Visual Studio* solution file again - -Compiling -========= - -To compile protobuf: - - C:\Path\to\protobuf\cmake\build\release>nmake - -or - - C:\Path\to\protobuf\cmake\build\debug>nmake - -And wait for the compilation to finish. - -If you prefer to use the IDE: - - * Open the generated protobuf.sln file in Microsoft Visual Studio. - * Choose "Debug" or "Release" configuration as desired. - * From the Build menu, choose "Build Solution". - -And wait for the compilation to finish. - -Testing -======= - -To run unit-tests, first you must compile protobuf as described above. -Then run: - - C:\Path\to\protobuf\cmake\build\release>nmake check - -or - - C:\Path\to\protobuf\cmake\build\debug>nmake check - -You can also build project *check* from Visual Studio solution. -Yes, it may sound strange, but it works. - -You should see output similar to: - - Running main() from gmock_main.cc - [==========] Running 1546 tests from 165 test cases. - - ... - - [==========] 1546 tests from 165 test cases ran. (2529 ms total) - [ PASSED ] 1546 tests. - -To run specific tests: - - C:\Path\to\protobuf>cmake\build\release\tests.exe --gtest_filter=AnyTest* - Running main() from gmock_main.cc - Note: Google Test filter = AnyTest* - [==========] Running 3 tests from 1 test case. - [----------] Global test environment set-up. - [----------] 3 tests from AnyTest - [ RUN ] AnyTest.TestPackAndUnpack - [ OK ] AnyTest.TestPackAndUnpack (0 ms) - [ RUN ] AnyTest.TestPackAndUnpackAny - [ OK ] AnyTest.TestPackAndUnpackAny (0 ms) - [ RUN ] AnyTest.TestIs - [ OK ] AnyTest.TestIs (0 ms) - [----------] 3 tests from AnyTest (1 ms total) - - [----------] Global test environment tear-down - [==========] 3 tests from 1 test case ran. (2 ms total) - [ PASSED ] 3 tests. - -Note that the tests must be run from the source folder. - -If all tests are passed, safely continue. - -Installing -========== - -To install protobuf to the specified *install* folder: - - C:\Path\to\protobuf\cmake\build\release>nmake install - -or - - C:\Path\to\protobuf\cmake\build\debug>nmake install - -You can also build project *INSTALL* from Visual Studio solution. -It sounds not so strange and it works. - -This will create the following folders under the *install* location: - * bin - that contains protobuf *protoc.exe* compiler; - * include - that contains C++ headers and protobuf *.proto files; - * lib - that contains linking libraries and *CMake* configuration files for *protobuf* package. - -Now you can if needed: - * Copy the contents of the include directory to wherever you want to put headers. - * Copy protoc.exe wherever you put build tools (probably somewhere in your PATH). - * Copy linking libraries libprotobuf[d].lib, libprotobuf-lite[d].lib, and libprotoc[d].lib wherever you put libraries. - -To avoid conflicts between the MSVC debug and release runtime libraries, when -compiling a debug build of your application, you may need to link against a -debug build of libprotobufd.lib with "d" postfix. Similarly, release builds should link against -release libprotobuf.lib library. - -DLLs vs. static linking -======================= - -Static linking is now the default for the Protocol Buffer libraries. Due to -issues with Win32's use of a separate heap for each DLL, as well as binary -compatibility issues between different versions of MSVC's STL library, it is -recommended that you use static linkage only. However, it is possible to -build libprotobuf and libprotoc as DLLs if you really want. To do this, -do the following: - - * Add an additional flag `-Dprotobuf_BUILD_SHARED_LIBS=ON` when invoking cmake - * Follow the same steps as described in the above section. - * When compiling your project, make sure to `#define PROTOBUF_USE_DLLS`. - -When distributing your software to end users, we strongly recommend that you -do NOT install libprotobuf.dll or libprotoc.dll to any shared location. -Instead, keep these libraries next to your binaries, in your application's -own install directory. C++ makes it very difficult to maintain binary -compatibility between releases, so it is likely that future versions of these -libraries will *not* be usable as drop-in replacements. - -If your project is itself a DLL intended for use by third-party software, we -recommend that you do NOT expose protocol buffer objects in your library's -public interface, and that you statically link protocol buffers into your -library. - -ZLib support -============ - -If you want to include GzipInputStream and GzipOutputStream -(google/protobuf/io/gzip_stream.h) in libprotobuf, you will need to do a few -additional steps. - -Obtain a copy of the zlib library. The pre-compiled DLL at zlib.net works. -You need prepare it: - - * Make sure zlib's two headers are in your `C:\Path\to\install\include` path - * Make sure zlib's linking libraries (*.lib file) is in your - `C:\Path\to\install\lib` library path. - -You can also compile it from source by yourself. - -Getting sources: - - C:\Path\to>git clone -b v1.2.8 https://github.com/madler/zlib.git - C:\Path\to>cd zlib - -Compiling and Installing: - - C:\Path\to\zlib>mkdir build & cd build - C:\Path\to\zlib\build>mkdir release & cd release - C:\Path\to\zlib\build\release>cmake -G "NMake Makefiles" -DCMAKE_BUILD_TYPE=Release ^ - -DCMAKE_INSTALL_PREFIX=../../../install ../.. - C:\Path\to\zlib\build\release>nmake & nmake install - -You can make *debug* version or use *Visual Studio* generator also as before for the -protobuf project. - -Now add *bin* folder from *install* to system *PATH*: - - C:\Path\to>set PATH=%PATH%;C:\Path\to\install\bin - -You need reconfigure protobuf with flag `-Dprotobuf_WITH_ZLIB=ON` when invoking cmake. - -Note that if you have compiled ZLIB yourself, as stated above, -further disable the option `-Dprotobuf_MSVC_STATIC_RUNTIME=OFF`. - -If it reports NOTFOUND for zlib_include or zlib_lib, you might haven't put -the headers or the .lib file in the right directory. - -If you already have ZLIB library and headers at some other location on your system then alternatively you can define following configuration flags to locate them: - - -DZLIB_INCLUDE_DIR= - -DZLIB_LIB= - -Build and testing protobuf as usual. - -Notes on Compiler Warnings -========================== - -The following warnings have been disabled while building the protobuf libraries -and compiler. You may have to disable some of them in your own project as -well, or live with them. - -* C4018 - 'expression' : signed/unsigned mismatch -* C4146 - unary minus operator applied to unsigned type, result still unsigned -* C4244 - Conversion from 'type1' to 'type2', possible loss of data. -* C4251 - 'identifier' : class 'type' needs to have dll-interface to be used by - clients of class 'type2' -* C4267 - Conversion from 'size_t' to 'type', possible loss of data. -* C4305 - 'identifier' : truncation from 'type1' to 'type2' -* C4355 - 'this' : used in base member initializer list -* C4800 - 'type' : forcing value to bool 'true' or 'false' (performance warning) -* C4996 - 'function': was declared deprecated - -C4251 is of particular note, if you are compiling the Protocol Buffer library -as a DLL (see previous section). The protocol buffer library uses templates in -its public interfaces. MSVC does not provide any reasonable way to export -template classes from a DLL. However, in practice, it appears that exporting -templates is not necessary anyway. Since the complete definition of any -template is available in the header files, anyone importing the DLL will just -end up compiling instances of the templates into their own binary. The -Protocol Buffer implementation does not rely on static template members being -unique, so there should be no problem with this, but MSVC prints warning -nevertheless. So, we disable it. Unfortunately, this warning will also be -produced when compiling code which merely uses protocol buffers, meaning you -may have to disable it in your code too. diff --git a/extra/protobuf/protobuf-3.19.4/cmake/conformance.cmake b/extra/protobuf/protobuf-3.19.4/cmake/conformance.cmake deleted file mode 100644 index b9485ff9d057..000000000000 --- a/extra/protobuf/protobuf-3.19.4/cmake/conformance.cmake +++ /dev/null @@ -1,49 +0,0 @@ - -add_custom_command( - OUTPUT ${protobuf_source_dir}/conformance/conformance.pb.cc - DEPENDS ${protobuf_PROTOC_EXE} ${protobuf_source_dir}/conformance/conformance.proto - COMMAND ${protobuf_PROTOC_EXE} ${protobuf_source_dir}/conformance/conformance.proto - --proto_path=${protobuf_source_dir}/conformance - --cpp_out=${protobuf_source_dir}/conformance -) - -add_custom_command( - OUTPUT ${protobuf_source_dir}/src/google/protobuf/test_messages_proto3.pb.cc - ${protobuf_source_dir}/src/google/protobuf/test_messages_proto2.pb.cc - DEPENDS ${protobuf_PROTOC_EXE} ${protobuf_source_dir}/src/google/protobuf/test_messages_proto3.proto - ${protobuf_PROTOC_EXE} ${protobuf_source_dir}/src/google/protobuf/test_messages_proto2.proto - COMMAND ${protobuf_PROTOC_EXE} ${protobuf_source_dir}/src/google/protobuf/test_messages_proto3.proto - ${protobuf_source_dir}/src/google/protobuf/test_messages_proto2.proto - --proto_path=${protobuf_source_dir}/src - --cpp_out=${protobuf_source_dir}/src -) - -add_executable(conformance_test_runner - ${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_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_proto2.pb.cc - ${protobuf_source_dir}/src/google/protobuf/test_messages_proto3.pb.cc -) - -target_include_directories( - conformance_test_runner - PUBLIC ${protobuf_source_dir}/conformance) - -target_include_directories( - conformance_cpp - PUBLIC ${protobuf_source_dir}/conformance) - -target_link_libraries(conformance_test_runner libprotobuf) -target_link_libraries(conformance_cpp libprotobuf) diff --git a/extra/protobuf/protobuf-3.19.4/cmake/examples.cmake b/extra/protobuf/protobuf-3.19.4/cmake/examples.cmake deleted file mode 100644 index e5cad63f6765..000000000000 --- a/extra/protobuf/protobuf-3.19.4/cmake/examples.cmake +++ /dev/null @@ -1,57 +0,0 @@ -if(protobuf_VERBOSE) - message(STATUS "Protocol Buffers Examples Configuring...") -endif() - -get_filename_component(examples_dir "../examples" ABSOLUTE) - -if(protobuf_VERBOSE) - message(STATUS "Protocol Buffers Examples Configuring done") -endif() -include(ExternalProject) - -# Internal utility function: Create a custom target representing a build of examples with custom options. -function(add_examples_build NAME) - - ExternalProject_Add(${NAME} - PREFIX ${NAME} - SOURCE_DIR "${examples_dir}" - BINARY_DIR ${NAME} - STAMP_DIR ${NAME}/logs - INSTALL_COMMAND "" #Skip - LOG_CONFIGURE 1 - CMAKE_CACHE_ARGS "-DCMAKE_BUILD_TYPE:STRING=${CMAKE_BUILD_TYPE}" - "-Dprotobuf_VERBOSE:BOOL=${protobuf_VERBOSE}" - ${ARGN} - ) - set_property(TARGET ${NAME} PROPERTY FOLDER "Examples") - set_property(TARGET ${NAME} PROPERTY EXCLUDE_FROM_ALL TRUE) -endfunction() - -# Add examples as an external project. -# sub_directory cannot be used because the find_package(protobuf) call would cause failures with redefined targets. -add_examples_build(examples "-Dprotobuf_DIR:PATH=${CMAKE_BINARY_DIR}/${CMAKE_INSTALL_CMAKEDIR}") -add_dependencies(examples libprotobuf protoc) - -option(protobuf_BUILD_EXAMPLES_MULTITEST "Build Examples in multiple configurations. Useful for testing." OFF) -mark_as_advanced(protobuf_BUILD_EXAMPLES_MULTITEST) -if(protobuf_BUILD_EXAMPLES_MULTITEST) - set_property(GLOBAL PROPERTY USE_FOLDERS ON) - - #Build using the legacy compatibility module. - add_examples_build(examples-legacy - "-Dprotobuf_DIR:PATH=${CMAKE_BINARY_DIR}/${CMAKE_INSTALL_CMAKEDIR}" - "-Dprotobuf_MODULE_COMPATIBLE:BOOL=TRUE" - ) - add_dependencies(examples-legacy libprotobuf protoc) - - #Build using the installed library. - add_examples_build(examples-installed - "-Dprotobuf_DIR:PATH=${CMAKE_INSTALL_PREFIX}/${CMAKE_INSTALL_CMAKEDIR}" - ) - - #Build using the installed library in legacy compatibility mode. - add_examples_build(examples-installed-legacy - "-Dprotobuf_DIR:PATH=${CMAKE_INSTALL_PREFIX}/${CMAKE_INSTALL_CMAKEDIR}" - "-Dprotobuf_MODULE_COMPATIBLE:BOOL=TRUE" - ) -endif() diff --git a/extra/protobuf/protobuf-3.19.4/cmake/extract_includes.bat.in b/extra/protobuf/protobuf-3.19.4/cmake/extract_includes.bat.in deleted file mode 100644 index 605c5f966ba3..000000000000 --- a/extra/protobuf/protobuf-3.19.4/cmake/extract_includes.bat.in +++ /dev/null @@ -1,143 +0,0 @@ -mkdir include -mkdir include\google -mkdir include\google\protobuf -mkdir include\google\protobuf\compiler -mkdir include\google\protobuf\compiler\cpp -mkdir include\google\protobuf\compiler\csharp -mkdir include\google\protobuf\compiler\java -mkdir include\google\protobuf\compiler\js -mkdir include\google\protobuf\compiler\objectivec -mkdir include\google\protobuf\compiler\php -mkdir include\google\protobuf\compiler\python -mkdir include\google\protobuf\compiler\ruby -mkdir include\google\protobuf\io -mkdir include\google\protobuf\stubs -mkdir include\google\protobuf\util -copy "${PROTOBUF_SOURCE_WIN32_PATH}\..\src\google\protobuf\any.h" include\google\protobuf\any.h -copy "${PROTOBUF_SOURCE_WIN32_PATH}\..\src\google\protobuf\any.pb.h" include\google\protobuf\any.pb.h -copy "${PROTOBUF_SOURCE_WIN32_PATH}\..\src\google\protobuf\api.pb.h" include\google\protobuf\api.pb.h -copy "${PROTOBUF_SOURCE_WIN32_PATH}\..\src\google\protobuf\arena.h" include\google\protobuf\arena.h -copy "${PROTOBUF_SOURCE_WIN32_PATH}\..\src\google\protobuf\arena_impl.h" include\google\protobuf\arena_impl.h -copy "${PROTOBUF_SOURCE_WIN32_PATH}\..\src\google\protobuf\arenastring.h" include\google\protobuf\arenastring.h -copy "${PROTOBUF_SOURCE_WIN32_PATH}\..\src\google\protobuf\compiler\code_generator.h" include\google\protobuf\compiler\code_generator.h -copy "${PROTOBUF_SOURCE_WIN32_PATH}\..\src\google\protobuf\compiler\command_line_interface.h" include\google\protobuf\compiler\command_line_interface.h -copy "${PROTOBUF_SOURCE_WIN32_PATH}\..\src\google\protobuf\compiler\cpp\cpp_file.h" include\google\protobuf\compiler\cpp\cpp_file.h -copy "${PROTOBUF_SOURCE_WIN32_PATH}\..\src\google\protobuf\compiler\cpp\cpp_generator.h" include\google\protobuf\compiler\cpp\cpp_generator.h -copy "${PROTOBUF_SOURCE_WIN32_PATH}\..\src\google\protobuf\compiler\cpp\cpp_helpers.h" include\google\protobuf\compiler\cpp\cpp_helpers.h -copy "${PROTOBUF_SOURCE_WIN32_PATH}\..\src\google\protobuf\compiler\cpp\cpp_names.h" include\google\protobuf\compiler\cpp\cpp_names.h -copy "${PROTOBUF_SOURCE_WIN32_PATH}\..\src\google\protobuf\compiler\csharp\csharp_doc_comment.h" include\google\protobuf\compiler\csharp\csharp_doc_comment.h -copy "${PROTOBUF_SOURCE_WIN32_PATH}\..\src\google\protobuf\compiler\csharp\csharp_generator.h" include\google\protobuf\compiler\csharp\csharp_generator.h -copy "${PROTOBUF_SOURCE_WIN32_PATH}\..\src\google\protobuf\compiler\csharp\csharp_names.h" include\google\protobuf\compiler\csharp\csharp_names.h -copy "${PROTOBUF_SOURCE_WIN32_PATH}\..\src\google\protobuf\compiler\csharp\csharp_options.h" include\google\protobuf\compiler\csharp\csharp_options.h -copy "${PROTOBUF_SOURCE_WIN32_PATH}\..\src\google\protobuf\compiler\importer.h" include\google\protobuf\compiler\importer.h -copy "${PROTOBUF_SOURCE_WIN32_PATH}\..\src\google\protobuf\compiler\java\java_generator.h" include\google\protobuf\compiler\java\java_generator.h -copy "${PROTOBUF_SOURCE_WIN32_PATH}\..\src\google\protobuf\compiler\java\java_kotlin_generator.h" include\google\protobuf\compiler\java\java_kotlin_generator.h -copy "${PROTOBUF_SOURCE_WIN32_PATH}\..\src\google\protobuf\compiler\java\java_names.h" include\google\protobuf\compiler\java\java_names.h -copy "${PROTOBUF_SOURCE_WIN32_PATH}\..\src\google\protobuf\compiler\js\js_generator.h" include\google\protobuf\compiler\js\js_generator.h -copy "${PROTOBUF_SOURCE_WIN32_PATH}\..\src\google\protobuf\compiler\objectivec\objectivec_generator.h" include\google\protobuf\compiler\objectivec\objectivec_generator.h -copy "${PROTOBUF_SOURCE_WIN32_PATH}\..\src\google\protobuf\compiler\objectivec\objectivec_helpers.h" include\google\protobuf\compiler\objectivec\objectivec_helpers.h -copy "${PROTOBUF_SOURCE_WIN32_PATH}\..\src\google\protobuf\compiler\parser.h" include\google\protobuf\compiler\parser.h -copy "${PROTOBUF_SOURCE_WIN32_PATH}\..\src\google\protobuf\compiler\php\php_generator.h" include\google\protobuf\compiler\php\php_generator.h -copy "${PROTOBUF_SOURCE_WIN32_PATH}\..\src\google\protobuf\compiler\plugin.h" include\google\protobuf\compiler\plugin.h -copy "${PROTOBUF_SOURCE_WIN32_PATH}\..\src\google\protobuf\compiler\plugin.pb.h" include\google\protobuf\compiler\plugin.pb.h -copy "${PROTOBUF_SOURCE_WIN32_PATH}\..\src\google\protobuf\compiler\python\python_generator.h" include\google\protobuf\compiler\python\python_generator.h -copy "${PROTOBUF_SOURCE_WIN32_PATH}\..\src\google\protobuf\compiler\ruby\ruby_generator.h" include\google\protobuf\compiler\ruby\ruby_generator.h -copy "${PROTOBUF_SOURCE_WIN32_PATH}\..\src\google\protobuf\descriptor.h" include\google\protobuf\descriptor.h -copy "${PROTOBUF_SOURCE_WIN32_PATH}\..\src\google\protobuf\descriptor.pb.h" include\google\protobuf\descriptor.pb.h -copy "${PROTOBUF_SOURCE_WIN32_PATH}\..\src\google\protobuf\descriptor_database.h" include\google\protobuf\descriptor_database.h -copy "${PROTOBUF_SOURCE_WIN32_PATH}\..\src\google\protobuf\duration.pb.h" include\google\protobuf\duration.pb.h -copy "${PROTOBUF_SOURCE_WIN32_PATH}\..\src\google\protobuf\dynamic_message.h" include\google\protobuf\dynamic_message.h -copy "${PROTOBUF_SOURCE_WIN32_PATH}\..\src\google\protobuf\empty.pb.h" include\google\protobuf\empty.pb.h -copy "${PROTOBUF_SOURCE_WIN32_PATH}\..\src\google\protobuf\explicitly_constructed.h" include\google\protobuf\explicitly_constructed.h -copy "${PROTOBUF_SOURCE_WIN32_PATH}\..\src\google\protobuf\extension_set.h" include\google\protobuf\extension_set.h -copy "${PROTOBUF_SOURCE_WIN32_PATH}\..\src\google\protobuf\extension_set_inl.h" include\google\protobuf\extension_set_inl.h -copy "${PROTOBUF_SOURCE_WIN32_PATH}\..\src\google\protobuf\field_access_listener.h" include\google\protobuf\field_access_listener.h -copy "${PROTOBUF_SOURCE_WIN32_PATH}\..\src\google\protobuf\field_mask.pb.h" include\google\protobuf\field_mask.pb.h -copy "${PROTOBUF_SOURCE_WIN32_PATH}\..\src\google\protobuf\generated_enum_reflection.h" include\google\protobuf\generated_enum_reflection.h -copy "${PROTOBUF_SOURCE_WIN32_PATH}\..\src\google\protobuf\generated_enum_util.h" include\google\protobuf\generated_enum_util.h -copy "${PROTOBUF_SOURCE_WIN32_PATH}\..\src\google\protobuf\generated_message_bases.h" include\google\protobuf\generated_message_bases.h -copy "${PROTOBUF_SOURCE_WIN32_PATH}\..\src\google\protobuf\generated_message_reflection.h" include\google\protobuf\generated_message_reflection.h -copy "${PROTOBUF_SOURCE_WIN32_PATH}\..\src\google\protobuf\generated_message_table_driven.h" include\google\protobuf\generated_message_table_driven.h -copy "${PROTOBUF_SOURCE_WIN32_PATH}\..\src\google\protobuf\generated_message_table_driven_lite.h" include\google\protobuf\generated_message_table_driven_lite.h -copy "${PROTOBUF_SOURCE_WIN32_PATH}\..\src\google\protobuf\generated_message_tctable_decl.h" include\google\protobuf\generated_message_tctable_decl.h -copy "${PROTOBUF_SOURCE_WIN32_PATH}\..\src\google\protobuf\generated_message_tctable_impl.h" include\google\protobuf\generated_message_tctable_impl.h -copy "${PROTOBUF_SOURCE_WIN32_PATH}\..\src\google\protobuf\generated_message_tctable_impl.inc" include\google\protobuf\generated_message_tctable_impl.inc -copy "${PROTOBUF_SOURCE_WIN32_PATH}\..\src\google\protobuf\generated_message_util.h" include\google\protobuf\generated_message_util.h -copy "${PROTOBUF_SOURCE_WIN32_PATH}\..\src\google\protobuf\has_bits.h" include\google\protobuf\has_bits.h -copy "${PROTOBUF_SOURCE_WIN32_PATH}\..\src\google\protobuf\implicit_weak_message.h" include\google\protobuf\implicit_weak_message.h -copy "${PROTOBUF_SOURCE_WIN32_PATH}\..\src\google\protobuf\inlined_string_field.h" include\google\protobuf\inlined_string_field.h -copy "${PROTOBUF_SOURCE_WIN32_PATH}\..\src\google\protobuf\io\coded_stream.h" include\google\protobuf\io\coded_stream.h -copy "${PROTOBUF_SOURCE_WIN32_PATH}\..\src\google\protobuf\io\gzip_stream.h" include\google\protobuf\io\gzip_stream.h -copy "${PROTOBUF_SOURCE_WIN32_PATH}\..\src\google\protobuf\io\io_win32.h" include\google\protobuf\io\io_win32.h -copy "${PROTOBUF_SOURCE_WIN32_PATH}\..\src\google\protobuf\io\printer.h" include\google\protobuf\io\printer.h -copy "${PROTOBUF_SOURCE_WIN32_PATH}\..\src\google\protobuf\io\strtod.h" include\google\protobuf\io\strtod.h -copy "${PROTOBUF_SOURCE_WIN32_PATH}\..\src\google\protobuf\io\tokenizer.h" include\google\protobuf\io\tokenizer.h -copy "${PROTOBUF_SOURCE_WIN32_PATH}\..\src\google\protobuf\io\zero_copy_stream.h" include\google\protobuf\io\zero_copy_stream.h -copy "${PROTOBUF_SOURCE_WIN32_PATH}\..\src\google\protobuf\io\zero_copy_stream_impl.h" include\google\protobuf\io\zero_copy_stream_impl.h -copy "${PROTOBUF_SOURCE_WIN32_PATH}\..\src\google\protobuf\io\zero_copy_stream_impl_lite.h" include\google\protobuf\io\zero_copy_stream_impl_lite.h -copy "${PROTOBUF_SOURCE_WIN32_PATH}\..\src\google\protobuf\map.h" include\google\protobuf\map.h -copy "${PROTOBUF_SOURCE_WIN32_PATH}\..\src\google\protobuf\map_entry.h" include\google\protobuf\map_entry.h -copy "${PROTOBUF_SOURCE_WIN32_PATH}\..\src\google\protobuf\map_entry_lite.h" include\google\protobuf\map_entry_lite.h -copy "${PROTOBUF_SOURCE_WIN32_PATH}\..\src\google\protobuf\map_field.h" include\google\protobuf\map_field.h -copy "${PROTOBUF_SOURCE_WIN32_PATH}\..\src\google\protobuf\map_field_inl.h" include\google\protobuf\map_field_inl.h -copy "${PROTOBUF_SOURCE_WIN32_PATH}\..\src\google\protobuf\map_field_lite.h" include\google\protobuf\map_field_lite.h -copy "${PROTOBUF_SOURCE_WIN32_PATH}\..\src\google\protobuf\map_type_handler.h" include\google\protobuf\map_type_handler.h -copy "${PROTOBUF_SOURCE_WIN32_PATH}\..\src\google\protobuf\message.h" include\google\protobuf\message.h -copy "${PROTOBUF_SOURCE_WIN32_PATH}\..\src\google\protobuf\message_lite.h" include\google\protobuf\message_lite.h -copy "${PROTOBUF_SOURCE_WIN32_PATH}\..\src\google\protobuf\metadata.h" include\google\protobuf\metadata.h -copy "${PROTOBUF_SOURCE_WIN32_PATH}\..\src\google\protobuf\metadata_lite.h" include\google\protobuf\metadata_lite.h -copy "${PROTOBUF_SOURCE_WIN32_PATH}\..\src\google\protobuf\parse_context.h" include\google\protobuf\parse_context.h -copy "${PROTOBUF_SOURCE_WIN32_PATH}\..\src\google\protobuf\port.h" include\google\protobuf\port.h -copy "${PROTOBUF_SOURCE_WIN32_PATH}\..\src\google\protobuf\port_def.inc" include\google\protobuf\port_def.inc -copy "${PROTOBUF_SOURCE_WIN32_PATH}\..\src\google\protobuf\port_undef.inc" include\google\protobuf\port_undef.inc -copy "${PROTOBUF_SOURCE_WIN32_PATH}\..\src\google\protobuf\reflection.h" include\google\protobuf\reflection.h -copy "${PROTOBUF_SOURCE_WIN32_PATH}\..\src\google\protobuf\reflection_ops.h" include\google\protobuf\reflection_ops.h -copy "${PROTOBUF_SOURCE_WIN32_PATH}\..\src\google\protobuf\repeated_field.h" include\google\protobuf\repeated_field.h -copy "${PROTOBUF_SOURCE_WIN32_PATH}\..\src\google\protobuf\repeated_ptr_field.h" include\google\protobuf\repeated_ptr_field.h -copy "${PROTOBUF_SOURCE_WIN32_PATH}\..\src\google\protobuf\service.h" include\google\protobuf\service.h -copy "${PROTOBUF_SOURCE_WIN32_PATH}\..\src\google\protobuf\source_context.pb.h" include\google\protobuf\source_context.pb.h -copy "${PROTOBUF_SOURCE_WIN32_PATH}\..\src\google\protobuf\struct.pb.h" include\google\protobuf\struct.pb.h -copy "${PROTOBUF_SOURCE_WIN32_PATH}\..\src\google\protobuf\stubs\bytestream.h" include\google\protobuf\stubs\bytestream.h -copy "${PROTOBUF_SOURCE_WIN32_PATH}\..\src\google\protobuf\stubs\callback.h" include\google\protobuf\stubs\callback.h -copy "${PROTOBUF_SOURCE_WIN32_PATH}\..\src\google\protobuf\stubs\casts.h" include\google\protobuf\stubs\casts.h -copy "${PROTOBUF_SOURCE_WIN32_PATH}\..\src\google\protobuf\stubs\common.h" include\google\protobuf\stubs\common.h -copy "${PROTOBUF_SOURCE_WIN32_PATH}\..\src\google\protobuf\stubs\hash.h" include\google\protobuf\stubs\hash.h -copy "${PROTOBUF_SOURCE_WIN32_PATH}\..\src\google\protobuf\stubs\logging.h" include\google\protobuf\stubs\logging.h -copy "${PROTOBUF_SOURCE_WIN32_PATH}\..\src\google\protobuf\stubs\macros.h" include\google\protobuf\stubs\macros.h -copy "${PROTOBUF_SOURCE_WIN32_PATH}\..\src\google\protobuf\stubs\map_util.h" include\google\protobuf\stubs\map_util.h -copy "${PROTOBUF_SOURCE_WIN32_PATH}\..\src\google\protobuf\stubs\mutex.h" include\google\protobuf\stubs\mutex.h -copy "${PROTOBUF_SOURCE_WIN32_PATH}\..\src\google\protobuf\stubs\once.h" include\google\protobuf\stubs\once.h -copy "${PROTOBUF_SOURCE_WIN32_PATH}\..\src\google\protobuf\stubs\platform_macros.h" include\google\protobuf\stubs\platform_macros.h -copy "${PROTOBUF_SOURCE_WIN32_PATH}\..\src\google\protobuf\stubs\port.h" include\google\protobuf\stubs\port.h -copy "${PROTOBUF_SOURCE_WIN32_PATH}\..\src\google\protobuf\stubs\status.h" include\google\protobuf\stubs\status.h -copy "${PROTOBUF_SOURCE_WIN32_PATH}\..\src\google\protobuf\stubs\stl_util.h" include\google\protobuf\stubs\stl_util.h -copy "${PROTOBUF_SOURCE_WIN32_PATH}\..\src\google\protobuf\stubs\stringpiece.h" include\google\protobuf\stubs\stringpiece.h -copy "${PROTOBUF_SOURCE_WIN32_PATH}\..\src\google\protobuf\stubs\strutil.h" include\google\protobuf\stubs\strutil.h -copy "${PROTOBUF_SOURCE_WIN32_PATH}\..\src\google\protobuf\stubs\template_util.h" include\google\protobuf\stubs\template_util.h -copy "${PROTOBUF_SOURCE_WIN32_PATH}\..\src\google\protobuf\text_format.h" include\google\protobuf\text_format.h -copy "${PROTOBUF_SOURCE_WIN32_PATH}\..\src\google\protobuf\timestamp.pb.h" include\google\protobuf\timestamp.pb.h -copy "${PROTOBUF_SOURCE_WIN32_PATH}\..\src\google\protobuf\type.pb.h" include\google\protobuf\type.pb.h -copy "${PROTOBUF_SOURCE_WIN32_PATH}\..\src\google\protobuf\unknown_field_set.h" include\google\protobuf\unknown_field_set.h -copy "${PROTOBUF_SOURCE_WIN32_PATH}\..\src\google\protobuf\util\delimited_message_util.h" include\google\protobuf\util\delimited_message_util.h -copy "${PROTOBUF_SOURCE_WIN32_PATH}\..\src\google\protobuf\util\field_comparator.h" include\google\protobuf\util\field_comparator.h -copy "${PROTOBUF_SOURCE_WIN32_PATH}\..\src\google\protobuf\util\field_mask_util.h" include\google\protobuf\util\field_mask_util.h -copy "${PROTOBUF_SOURCE_WIN32_PATH}\..\src\google\protobuf\util\json_util.h" include\google\protobuf\util\json_util.h -copy "${PROTOBUF_SOURCE_WIN32_PATH}\..\src\google\protobuf\util\message_differencer.h" include\google\protobuf\util\message_differencer.h -copy "${PROTOBUF_SOURCE_WIN32_PATH}\..\src\google\protobuf\util\time_util.h" include\google\protobuf\util\time_util.h -copy "${PROTOBUF_SOURCE_WIN32_PATH}\..\src\google\protobuf\util\type_resolver.h" include\google\protobuf\util\type_resolver.h -copy "${PROTOBUF_SOURCE_WIN32_PATH}\..\src\google\protobuf\util\type_resolver_util.h" include\google\protobuf\util\type_resolver_util.h -copy "${PROTOBUF_SOURCE_WIN32_PATH}\..\src\google\protobuf\wire_format.h" include\google\protobuf\wire_format.h -copy "${PROTOBUF_SOURCE_WIN32_PATH}\..\src\google\protobuf\wire_format_lite.h" include\google\protobuf\wire_format_lite.h -copy "${PROTOBUF_SOURCE_WIN32_PATH}\..\src\google\protobuf\wrappers.pb.h" include\google\protobuf\wrappers.pb.h -copy "${PROTOBUF_SOURCE_WIN32_PATH}\..\src\google\protobuf\any.proto" include\google\protobuf\any.proto -copy "${PROTOBUF_SOURCE_WIN32_PATH}\..\src\google\protobuf\api.proto" include\google\protobuf\api.proto -copy "${PROTOBUF_SOURCE_WIN32_PATH}\..\src\google\protobuf\compiler\plugin.proto" include\google\protobuf\compiler\plugin.proto -copy "${PROTOBUF_SOURCE_WIN32_PATH}\..\src\google\protobuf\descriptor.proto" include\google\protobuf\descriptor.proto -copy "${PROTOBUF_SOURCE_WIN32_PATH}\..\src\google\protobuf\duration.proto" include\google\protobuf\duration.proto -copy "${PROTOBUF_SOURCE_WIN32_PATH}\..\src\google\protobuf\empty.proto" include\google\protobuf\empty.proto -copy "${PROTOBUF_SOURCE_WIN32_PATH}\..\src\google\protobuf\field_mask.proto" include\google\protobuf\field_mask.proto -copy "${PROTOBUF_SOURCE_WIN32_PATH}\..\src\google\protobuf\source_context.proto" include\google\protobuf\source_context.proto -copy "${PROTOBUF_SOURCE_WIN32_PATH}\..\src\google\protobuf\struct.proto" include\google\protobuf\struct.proto -copy "${PROTOBUF_SOURCE_WIN32_PATH}\..\src\google\protobuf\timestamp.proto" include\google\protobuf\timestamp.proto -copy "${PROTOBUF_SOURCE_WIN32_PATH}\..\src\google\protobuf\type.proto" include\google\protobuf\type.proto -copy "${PROTOBUF_SOURCE_WIN32_PATH}\..\src\google\protobuf\wrappers.proto" include\google\protobuf\wrappers.proto diff --git a/extra/protobuf/protobuf-3.19.4/cmake/install.cmake b/extra/protobuf/protobuf-3.19.4/cmake/install.cmake deleted file mode 100644 index 4e1c5deb32e7..000000000000 --- a/extra/protobuf/protobuf-3.19.4/cmake/install.cmake +++ /dev/null @@ -1,156 +0,0 @@ -include(GNUInstallDirs) - -configure_file(${CMAKE_CURRENT_SOURCE_DIR}/protobuf.pc.cmake - ${CMAKE_CURRENT_BINARY_DIR}/protobuf.pc @ONLY) -configure_file(${CMAKE_CURRENT_SOURCE_DIR}/protobuf-lite.pc.cmake - ${CMAKE_CURRENT_BINARY_DIR}/protobuf-lite.pc @ONLY) - -set(_protobuf_libraries libprotobuf-lite libprotobuf) -if (protobuf_BUILD_LIBPROTOC) - list(APPEND _protobuf_libraries libprotoc) -endif (protobuf_BUILD_LIBPROTOC) - -foreach(_library ${_protobuf_libraries}) - set_property(TARGET ${_library} - PROPERTY INTERFACE_INCLUDE_DIRECTORIES - $ - $) - if (UNIX AND NOT APPLE) - set_property(TARGET ${_library} - PROPERTY INSTALL_RPATH "$ORIGIN") - elseif (APPLE) - set_property(TARGET ${_library} - PROPERTY INSTALL_RPATH "@loader_path") - endif() - install(TARGETS ${_library} EXPORT protobuf-targets - RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} COMPONENT ${_library} - LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} COMPONENT ${_library} - ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR} COMPONENT ${_library}) -endforeach() - -if (protobuf_BUILD_PROTOC_BINARIES) - install(TARGETS protoc EXPORT protobuf-targets - RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} COMPONENT protoc - BUNDLE DESTINATION ${CMAKE_INSTALL_BINDIR} COMPONENT protoc) - if (UNIX AND NOT APPLE) - set_property(TARGET protoc - PROPERTY INSTALL_RPATH "$ORIGIN/../${CMAKE_INSTALL_LIBDIR}") - elseif (APPLE) - set_property(TARGET protoc - PROPERTY INSTALL_RPATH "@loader_path/../lib") - endif() -endif (protobuf_BUILD_PROTOC_BINARIES) - -install(FILES ${CMAKE_CURRENT_BINARY_DIR}/protobuf.pc ${CMAKE_CURRENT_BINARY_DIR}/protobuf-lite.pc DESTINATION "${CMAKE_INSTALL_LIBDIR}/pkgconfig") - -file(STRINGS extract_includes.bat.in _extract_strings - REGEX "^copy") -foreach(_extract_string ${_extract_strings}) - string(REGEX REPLACE "^.* .+ include\\\\(.+)$" "\\1" - _header ${_extract_string}) - string(REPLACE "\\" "/" _header ${_header}) - get_filename_component(_extract_from "${protobuf_SOURCE_DIR}/../src/${_header}" ABSOLUTE) - get_filename_component(_extract_name ${_header} NAME) - get_filename_component(_extract_to "${CMAKE_INSTALL_INCLUDEDIR}/${_header}" PATH) - if(EXISTS "${_extract_from}") - install(FILES "${_extract_from}" - DESTINATION "${_extract_to}" - COMPONENT protobuf-headers - RENAME "${_extract_name}") - else() - message(AUTHOR_WARNING "The file \"${_extract_from}\" is listed in " - "\"${protobuf_SOURCE_DIR}/cmake/extract_includes.bat.in\" " - "but there not exists. The file will not be installed.") - endif() -endforeach() - -# Internal function for parsing auto tools scripts -function(_protobuf_auto_list FILE_NAME VARIABLE) - file(STRINGS ${FILE_NAME} _strings) - set(_list) - foreach(_string ${_strings}) - set(_found) - string(REGEX MATCH "^[ \t]*${VARIABLE}[ \t]*=[ \t]*" _found "${_string}") - if(_found) - string(LENGTH "${_found}" _length) - string(SUBSTRING "${_string}" ${_length} -1 _draft_list) - foreach(_item ${_draft_list}) - string(STRIP "${_item}" _item) - list(APPEND _list "${_item}") - endforeach() - endif() - endforeach() - set(${VARIABLE} ${_list} PARENT_SCOPE) -endfunction() - -# Install well-known type proto files -_protobuf_auto_list("../src/Makefile.am" nobase_dist_proto_DATA) -foreach(_file ${nobase_dist_proto_DATA}) - get_filename_component(_file_from "../src/${_file}" ABSOLUTE) - get_filename_component(_file_name ${_file} NAME) - get_filename_component(_file_path ${_file} PATH) - if(EXISTS "${_file_from}") - install(FILES "${_file_from}" - DESTINATION "${CMAKE_INSTALL_INCLUDEDIR}/${_file_path}" - COMPONENT protobuf-protos - RENAME "${_file_name}") - else() - message(AUTHOR_WARNING "The file \"${_file_from}\" is listed in " - "\"${protobuf_SOURCE_DIR}/../src/Makefile.am\" as nobase_dist_proto_DATA " - "but there not exists. The file will not be installed.") - endif() -endforeach() - -# Install configuration -set(_cmakedir_desc "Directory relative to CMAKE_INSTALL to install the cmake configuration files") -set(_exampledir_desc "Directory relative to CMAKE_INSTALL_DATA to install examples") -if(NOT MSVC) - set(CMAKE_INSTALL_CMAKEDIR "${CMAKE_INSTALL_LIBDIR}/cmake/protobuf" CACHE STRING "${_cmakedir_desc}") - set(CMAKE_INSTALL_EXAMPLEDIR "${CMAKE_INSTALL_DATADIR}/protobuf/examples" CACHE STRING "${_exampledir_desc}") -else() - set(CMAKE_INSTALL_CMAKEDIR "cmake" CACHE STRING "${_cmakedir_desc}") - set(CMAKE_INSTALL_EXAMPLEDIR "examples" CACHE STRING "${_exampledir_desc}") -endif() -mark_as_advanced(CMAKE_INSTALL_CMAKEDIR) -mark_as_advanced(CMAKE_INSTALL_EXAMPLEDIR) - -configure_file(protobuf-config.cmake.in - ${CMAKE_INSTALL_CMAKEDIR}/protobuf-config.cmake @ONLY) -configure_file(protobuf-config-version.cmake.in - ${CMAKE_INSTALL_CMAKEDIR}/protobuf-config-version.cmake @ONLY) -configure_file(protobuf-module.cmake.in - ${CMAKE_INSTALL_CMAKEDIR}/protobuf-module.cmake @ONLY) -configure_file(protobuf-options.cmake - ${CMAKE_INSTALL_CMAKEDIR}/protobuf-options.cmake @ONLY) - -# Allows the build directory to be used as a find directory. - -if (protobuf_BUILD_PROTOC_BINARIES) - export(TARGETS libprotobuf-lite libprotobuf libprotoc protoc - NAMESPACE protobuf:: - FILE ${CMAKE_INSTALL_CMAKEDIR}/protobuf-targets.cmake - ) -else (protobuf_BUILD_PROTOC_BINARIES) - export(TARGETS libprotobuf-lite libprotobuf - NAMESPACE protobuf:: - FILE ${CMAKE_INSTALL_CMAKEDIR}/protobuf-targets.cmake - ) -endif (protobuf_BUILD_PROTOC_BINARIES) - -install(EXPORT protobuf-targets - DESTINATION "${CMAKE_INSTALL_CMAKEDIR}" - NAMESPACE protobuf:: - COMPONENT protobuf-export) - -install(DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/${CMAKE_INSTALL_CMAKEDIR}/ - DESTINATION "${CMAKE_INSTALL_CMAKEDIR}" - COMPONENT protobuf-export - PATTERN protobuf-targets.cmake EXCLUDE -) - -option(protobuf_INSTALL_EXAMPLES "Install the examples folder" OFF) -if(protobuf_INSTALL_EXAMPLES) - install(DIRECTORY ../examples/ - DESTINATION "${CMAKE_INSTALL_EXAMPLEDIR}" - COMPONENT protobuf-examples) -endif() diff --git a/extra/protobuf/protobuf-3.19.4/cmake/libprotobuf-lite.cmake b/extra/protobuf/protobuf-3.19.4/cmake/libprotobuf-lite.cmake deleted file mode 100644 index c1f203d2d8d3..000000000000 --- a/extra/protobuf/protobuf-3.19.4/cmake/libprotobuf-lite.cmake +++ /dev/null @@ -1,172 +0,0 @@ -set(libprotobuf_lite_files - ${protobuf_source_dir}/src/google/protobuf/any_lite.cc - ${protobuf_source_dir}/src/google/protobuf/arena.cc - ${protobuf_source_dir}/src/google/protobuf/arenastring.cc - ${protobuf_source_dir}/src/google/protobuf/extension_set.cc - ${protobuf_source_dir}/src/google/protobuf/generated_enum_util.cc - ${protobuf_source_dir}/src/google/protobuf/generated_message_table_driven_lite.cc - ${protobuf_source_dir}/src/google/protobuf/generated_message_tctable_lite.cc - ${protobuf_source_dir}/src/google/protobuf/generated_message_util.cc - ${protobuf_source_dir}/src/google/protobuf/implicit_weak_message.cc - ${protobuf_source_dir}/src/google/protobuf/inlined_string_field.cc - ${protobuf_source_dir}/src/google/protobuf/io/coded_stream.cc - ${protobuf_source_dir}/src/google/protobuf/io/io_win32.cc - ${protobuf_source_dir}/src/google/protobuf/io/strtod.cc - ${protobuf_source_dir}/src/google/protobuf/io/zero_copy_stream.cc - ${protobuf_source_dir}/src/google/protobuf/io/zero_copy_stream_impl.cc - ${protobuf_source_dir}/src/google/protobuf/io/zero_copy_stream_impl_lite.cc - ${protobuf_source_dir}/src/google/protobuf/map.cc - ${protobuf_source_dir}/src/google/protobuf/message_lite.cc - ${protobuf_source_dir}/src/google/protobuf/parse_context.cc - ${protobuf_source_dir}/src/google/protobuf/repeated_field.cc - ${protobuf_source_dir}/src/google/protobuf/repeated_ptr_field.cc - ${protobuf_source_dir}/src/google/protobuf/stubs/bytestream.cc - ${protobuf_source_dir}/src/google/protobuf/stubs/common.cc - ${protobuf_source_dir}/src/google/protobuf/stubs/int128.cc - ${protobuf_source_dir}/src/google/protobuf/stubs/status.cc - ${protobuf_source_dir}/src/google/protobuf/stubs/statusor.cc - ${protobuf_source_dir}/src/google/protobuf/stubs/stringpiece.cc - ${protobuf_source_dir}/src/google/protobuf/stubs/stringprintf.cc - ${protobuf_source_dir}/src/google/protobuf/stubs/structurally_valid.cc - ${protobuf_source_dir}/src/google/protobuf/stubs/strutil.cc - ${protobuf_source_dir}/src/google/protobuf/stubs/time.cc - ${protobuf_source_dir}/src/google/protobuf/wire_format_lite.cc -) - -set(libprotobuf_lite_includes - ${protobuf_source_dir}/src/google/protobuf/any.h - ${protobuf_source_dir}/src/google/protobuf/arena.h - ${protobuf_source_dir}/src/google/protobuf/arena_impl.h - ${protobuf_source_dir}/src/google/protobuf/arenastring.h - ${protobuf_source_dir}/src/google/protobuf/explicitly_constructed.h - ${protobuf_source_dir}/src/google/protobuf/extension_set.h - ${protobuf_source_dir}/src/google/protobuf/extension_set_inl.h - ${protobuf_source_dir}/src/google/protobuf/generated_enum_util.h - ${protobuf_source_dir}/src/google/protobuf/generated_message_table_driven.h - ${protobuf_source_dir}/src/google/protobuf/generated_message_table_driven_lite.h - ${protobuf_source_dir}/src/google/protobuf/generated_message_tctable_decl.h - ${protobuf_source_dir}/src/google/protobuf/generated_message_tctable_impl.h - ${protobuf_source_dir}/src/google/protobuf/generated_message_tctable_impl.inc - ${protobuf_source_dir}/src/google/protobuf/generated_message_util.h - ${protobuf_source_dir}/src/google/protobuf/has_bits.h - ${protobuf_source_dir}/src/google/protobuf/implicit_weak_message.h - ${protobuf_source_dir}/src/google/protobuf/inlined_string_field.h - ${protobuf_source_dir}/src/google/protobuf/io/coded_stream.h - ${protobuf_source_dir}/src/google/protobuf/io/io_win32.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/map.h - ${protobuf_source_dir}/src/google/protobuf/map_entry_lite.h - ${protobuf_source_dir}/src/google/protobuf/map_field_lite.h - ${protobuf_source_dir}/src/google/protobuf/map_type_handler.h - ${protobuf_source_dir}/src/google/protobuf/message_lite.h - ${protobuf_source_dir}/src/google/protobuf/metadata_lite.h - ${protobuf_source_dir}/src/google/protobuf/parse_context.h - ${protobuf_source_dir}/src/google/protobuf/port.h - ${protobuf_source_dir}/src/google/protobuf/repeated_field.h - ${protobuf_source_dir}/src/google/protobuf/repeated_ptr_field.h - ${protobuf_source_dir}/src/google/protobuf/stubs/bytestream.h - ${protobuf_source_dir}/src/google/protobuf/stubs/callback.h - ${protobuf_source_dir}/src/google/protobuf/stubs/casts.h - ${protobuf_source_dir}/src/google/protobuf/stubs/common.h - ${protobuf_source_dir}/src/google/protobuf/stubs/hash.h - ${protobuf_source_dir}/src/google/protobuf/stubs/logging.h - ${protobuf_source_dir}/src/google/protobuf/stubs/macros.h - ${protobuf_source_dir}/src/google/protobuf/stubs/map_util.h - ${protobuf_source_dir}/src/google/protobuf/stubs/mutex.h - ${protobuf_source_dir}/src/google/protobuf/stubs/once.h - ${protobuf_source_dir}/src/google/protobuf/stubs/platform_macros.h - ${protobuf_source_dir}/src/google/protobuf/stubs/port.h - ${protobuf_source_dir}/src/google/protobuf/stubs/status.h - ${protobuf_source_dir}/src/google/protobuf/stubs/stl_util.h - ${protobuf_source_dir}/src/google/protobuf/stubs/stringpiece.h - ${protobuf_source_dir}/src/google/protobuf/stubs/strutil.h - ${protobuf_source_dir}/src/google/protobuf/stubs/template_util.h - ${protobuf_source_dir}/src/google/protobuf/wire_format_lite.h -) - -if (CMAKE_CXX_COMPILER_ID STREQUAL "MSVC") -set(libprotobuf_lite_rc_files - ${CMAKE_CURRENT_BINARY_DIR}/version.rc -) -endif() - -add_library(libprotobuf-lite ${protobuf_SHARED_OR_STATIC} - ${libprotobuf_lite_files} ${libprotobuf_lite_includes} ${libprotobuf_lite_rc_files}) - -ADD_OBJDUMP_TARGET(show_libprotobuf-lite "$" - DEPENDS libprotobuf-lite) -ADD_LIBRARY(ext::libprotobuf-lite ALIAS libprotobuf-lite) - -target_link_libraries(libprotobuf-lite ${CMAKE_THREAD_LIBS_INIT}) -if(protobuf_LINK_LIBATOMIC) - target_link_libraries(libprotobuf-lite atomic) -endif() -if(${CMAKE_SYSTEM_NAME} STREQUAL "Android") - target_link_libraries(libprotobuf-lite log) -endif() -target_include_directories(libprotobuf-lite PUBLIC ${protobuf_source_dir}/src) -if(MSVC AND protobuf_BUILD_SHARED_LIBS) - target_compile_definitions(libprotobuf-lite - PUBLIC PROTOBUF_USE_DLLS - PRIVATE LIBPROTOBUF_EXPORTS) -endif() -set_target_properties(libprotobuf-lite PROPERTIES - VERSION ${protobuf_VERSION} - OUTPUT_NAME ${LIB_PREFIX}protobuf-lite - DEBUG_POSTFIX "${protobuf_DEBUG_POSTFIX}") -add_library(protobuf::libprotobuf-lite ALIAS libprotobuf-lite) -### - -IF(protobuf_BUILD_SHARED_LIBS) - SET_TARGET_PROPERTIES(libprotobuf-lite PROPERTIES - DEBUG_POSTFIX "" - LIBRARY_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/library_output_directory - RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/library_output_directory - ) - - IF(LINUX) - SET_TARGET_PROPERTIES(libprotobuf-lite - PROPERTIES LINK_FLAGS - "-Wl,--version-script=${CMAKE_CURRENT_SOURCE_DIR}/libprotobuf.ver" - ) - SET_TARGET_PROPERTIES(libprotobuf-lite - PROPERTIES LINK_DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/libprotobuf.ver - ) - ENDIF() - - IF(WIN32) - ADD_CUSTOM_COMMAND(TARGET libprotobuf-lite POST_BUILD - COMMAND ${CMAKE_COMMAND} -E copy_if_different - "${CMAKE_BINARY_DIR}/library_output_directory/${CMAKE_CFG_INTDIR}/$" - "${CMAKE_BINARY_DIR}/runtime_output_directory/${CMAKE_CFG_INTDIR}/$" - ) - - SET_TARGET_PROPERTIES(libprotobuf-lite PROPERTIES - DEBUG_POSTFIX "-debug") - INSTALL_DEBUG_TARGET(libprotobuf-lite - DESTINATION "${INSTALL_BINDIR}" - COMPONENT SharedLibraries - ) - ENDIF() - - INSTALL_PRIVATE_LIBRARY(libprotobuf-lite) - - IF(WITH_ROUTER) - IF(APPLE OR WIN32) - INSTALL(TARGETS libprotobuf-lite - DESTINATION "${ROUTER_INSTALL_PLUGINDIR}" COMPONENT Router - ) - ELSEIF(UNIX) - INSTALL(TARGETS libprotobuf-lite - LIBRARY - DESTINATION "${ROUTER_INSTALL_LIBDIR}" - COMPONENT Router - NAMELINK_SKIP - ) - ENDIF() - ENDIF() - -ENDIF() diff --git a/extra/protobuf/protobuf-3.19.4/cmake/libprotobuf.cmake b/extra/protobuf/protobuf-3.19.4/cmake/libprotobuf.cmake deleted file mode 100644 index a69d447e5bf3..000000000000 --- a/extra/protobuf/protobuf-3.19.4/cmake/libprotobuf.cmake +++ /dev/null @@ -1,172 +0,0 @@ -set(libprotobuf_files - ${protobuf_source_dir}/src/google/protobuf/any.cc - ${protobuf_source_dir}/src/google/protobuf/any.pb.cc - ${protobuf_source_dir}/src/google/protobuf/api.pb.cc - ${protobuf_source_dir}/src/google/protobuf/compiler/importer.cc - ${protobuf_source_dir}/src/google/protobuf/compiler/parser.cc - ${protobuf_source_dir}/src/google/protobuf/descriptor.cc - ${protobuf_source_dir}/src/google/protobuf/descriptor.pb.cc - ${protobuf_source_dir}/src/google/protobuf/descriptor_database.cc - ${protobuf_source_dir}/src/google/protobuf/duration.pb.cc - ${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_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/generated_message_tctable_full.cc - ${protobuf_source_dir}/src/google/protobuf/io/gzip_stream.cc - ${protobuf_source_dir}/src/google/protobuf/io/printer.cc - ${protobuf_source_dir}/src/google/protobuf/io/tokenizer.cc - ${protobuf_source_dir}/src/google/protobuf/map_field.cc - ${protobuf_source_dir}/src/google/protobuf/message.cc - ${protobuf_source_dir}/src/google/protobuf/reflection_ops.cc - ${protobuf_source_dir}/src/google/protobuf/service.cc - ${protobuf_source_dir}/src/google/protobuf/source_context.pb.cc - ${protobuf_source_dir}/src/google/protobuf/struct.pb.cc - ${protobuf_source_dir}/src/google/protobuf/stubs/substitute.cc - ${protobuf_source_dir}/src/google/protobuf/text_format.cc - ${protobuf_source_dir}/src/google/protobuf/timestamp.pb.cc - ${protobuf_source_dir}/src/google/protobuf/type.pb.cc - ${protobuf_source_dir}/src/google/protobuf/unknown_field_set.cc - ${protobuf_source_dir}/src/google/protobuf/util/delimited_message_util.cc - ${protobuf_source_dir}/src/google/protobuf/util/field_comparator.cc - ${protobuf_source_dir}/src/google/protobuf/util/field_mask_util.cc - ${protobuf_source_dir}/src/google/protobuf/util/internal/datapiece.cc - ${protobuf_source_dir}/src/google/protobuf/util/internal/default_value_objectwriter.cc - ${protobuf_source_dir}/src/google/protobuf/util/internal/error_listener.cc - ${protobuf_source_dir}/src/google/protobuf/util/internal/field_mask_utility.cc - ${protobuf_source_dir}/src/google/protobuf/util/internal/json_escaping.cc - ${protobuf_source_dir}/src/google/protobuf/util/internal/json_objectwriter.cc - ${protobuf_source_dir}/src/google/protobuf/util/internal/json_stream_parser.cc - ${protobuf_source_dir}/src/google/protobuf/util/internal/object_writer.cc - ${protobuf_source_dir}/src/google/protobuf/util/internal/proto_writer.cc - ${protobuf_source_dir}/src/google/protobuf/util/internal/protostream_objectsource.cc - ${protobuf_source_dir}/src/google/protobuf/util/internal/protostream_objectwriter.cc - ${protobuf_source_dir}/src/google/protobuf/util/internal/type_info.cc - ${protobuf_source_dir}/src/google/protobuf/util/internal/utility.cc - ${protobuf_source_dir}/src/google/protobuf/util/json_util.cc - ${protobuf_source_dir}/src/google/protobuf/util/message_differencer.cc - ${protobuf_source_dir}/src/google/protobuf/util/time_util.cc - ${protobuf_source_dir}/src/google/protobuf/util/type_resolver_util.cc - ${protobuf_source_dir}/src/google/protobuf/wire_format.cc - ${protobuf_source_dir}/src/google/protobuf/wrappers.pb.cc -) - -set(libprotobuf_includes - ${protobuf_source_dir}/src/google/protobuf/any.pb.h - ${protobuf_source_dir}/src/google/protobuf/api.pb.h - ${protobuf_source_dir}/src/google/protobuf/compiler/importer.h - ${protobuf_source_dir}/src/google/protobuf/compiler/parser.h - ${protobuf_source_dir}/src/google/protobuf/descriptor.h - ${protobuf_source_dir}/src/google/protobuf/descriptor.pb.h - ${protobuf_source_dir}/src/google/protobuf/descriptor_database.h - ${protobuf_source_dir}/src/google/protobuf/duration.pb.h - ${protobuf_source_dir}/src/google/protobuf/dynamic_message.h - ${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_enum_reflection.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 - ${protobuf_source_dir}/src/google/protobuf/io/tokenizer.h - ${protobuf_source_dir}/src/google/protobuf/map_entry.h - ${protobuf_source_dir}/src/google/protobuf/map_field.h - ${protobuf_source_dir}/src/google/protobuf/map_field_inl.h - ${protobuf_source_dir}/src/google/protobuf/message.h - ${protobuf_source_dir}/src/google/protobuf/metadata.h - ${protobuf_source_dir}/src/google/protobuf/reflection.h - ${protobuf_source_dir}/src/google/protobuf/reflection_ops.h - ${protobuf_source_dir}/src/google/protobuf/service.h - ${protobuf_source_dir}/src/google/protobuf/source_context.pb.h - ${protobuf_source_dir}/src/google/protobuf/struct.pb.h - ${protobuf_source_dir}/src/google/protobuf/text_format.h - ${protobuf_source_dir}/src/google/protobuf/timestamp.pb.h - ${protobuf_source_dir}/src/google/protobuf/type.pb.h - ${protobuf_source_dir}/src/google/protobuf/unknown_field_set.h - ${protobuf_source_dir}/src/google/protobuf/util/delimited_message_util.h - ${protobuf_source_dir}/src/google/protobuf/util/field_comparator.h - ${protobuf_source_dir}/src/google/protobuf/util/field_mask_util.h - ${protobuf_source_dir}/src/google/protobuf/util/json_util.h - ${protobuf_source_dir}/src/google/protobuf/util/message_differencer.h - ${protobuf_source_dir}/src/google/protobuf/util/time_util.h - ${protobuf_source_dir}/src/google/protobuf/util/type_resolver.h - ${protobuf_source_dir}/src/google/protobuf/util/type_resolver_util.h - ${protobuf_source_dir}/src/google/protobuf/wire_format.h - ${protobuf_source_dir}/src/google/protobuf/wrappers.pb.h -) - -if (CMAKE_CXX_COMPILER_ID STREQUAL "MSVC") -set(libprotobuf_rc_files - ${CMAKE_CURRENT_BINARY_DIR}/version.rc -) -endif() - -add_library(libprotobuf ${protobuf_SHARED_OR_STATIC} - ${libprotobuf_lite_files} ${libprotobuf_files} ${libprotobuf_includes} ${libprotobuf_rc_files}) - -ADD_OBJDUMP_TARGET(show_libprotobuf "$" - DEPENDS libprotobuf) -ADD_LIBRARY(ext::libprotobuf ALIAS libprotobuf) - -target_link_libraries(libprotobuf ${CMAKE_THREAD_LIBS_INIT}) -if(protobuf_WITH_ZLIB) - target_link_libraries(libprotobuf ${ZLIB_LIBRARIES}) -endif() -if(protobuf_LINK_LIBATOMIC) - target_link_libraries(libprotobuf atomic) -endif() -if(${CMAKE_SYSTEM_NAME} STREQUAL "Android") - target_link_libraries(libprotobuf log) -endif() -target_include_directories(libprotobuf PUBLIC ${protobuf_source_dir}/src) -if(MSVC AND protobuf_BUILD_SHARED_LIBS) - target_compile_definitions(libprotobuf - PUBLIC PROTOBUF_USE_DLLS - PRIVATE LIBPROTOBUF_EXPORTS) -endif() -set_target_properties(libprotobuf PROPERTIES - VERSION ${protobuf_VERSION} - OUTPUT_NAME ${LIB_PREFIX}protobuf - DEBUG_POSTFIX "${protobuf_DEBUG_POSTFIX}") -add_library(protobuf::libprotobuf ALIAS libprotobuf) - -### -IF(protobuf_BUILD_SHARED_LIBS) - SET_TARGET_PROPERTIES(libprotobuf PROPERTIES - DEBUG_POSTFIX "" - LIBRARY_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/library_output_directory - RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/library_output_directory - ) - - IF(LINUX) - SET_TARGET_PROPERTIES(libprotobuf - PROPERTIES LINK_FLAGS - "-Wl,--version-script=${CMAKE_CURRENT_SOURCE_DIR}/libprotobuf.ver" - ) - SET_TARGET_PROPERTIES(libprotobuf - PROPERTIES LINK_DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/libprotobuf.ver - ) - ENDIF() - - IF(WIN32) - ADD_CUSTOM_COMMAND(TARGET libprotobuf POST_BUILD - COMMAND ${CMAKE_COMMAND} -E copy_if_different - "${CMAKE_BINARY_DIR}/library_output_directory/${CMAKE_CFG_INTDIR}/$" - "${CMAKE_BINARY_DIR}/runtime_output_directory/${CMAKE_CFG_INTDIR}/$" - ) - - SET_TARGET_PROPERTIES(libprotobuf PROPERTIES - DEBUG_POSTFIX "-debug") - INSTALL_DEBUG_TARGET(libprotobuf - DESTINATION "${INSTALL_BINDIR}" - COMPONENT SharedLibraries - ) - ENDIF() - - INSTALL_PRIVATE_LIBRARY(libprotobuf) - -ENDIF() diff --git a/extra/protobuf/protobuf-3.19.4/cmake/libprotobuf.ver b/extra/protobuf/protobuf-3.19.4/cmake/libprotobuf.ver deleted file mode 100644 index a4fcd133eff5..000000000000 --- a/extra/protobuf/protobuf-3.19.4/cmake/libprotobuf.ver +++ /dev/null @@ -1,45 +0,0 @@ -/* - Hide all symbols from the standard library. - - This is a workaround for libstdc++ problems on redhat 6, which are caused - by our INSTALL_DEBUG_TARGET cmake macro: we *link* with one .so library, - but *run* with a different version. - - The installed mysqld-debug will not start because of: - bin/mysqld-debug: symbol lookup error: undefined symbol: _ZNSs4backEv - Running c++filt on that symbol, we get - std::basic_string, std::allocator >::back() - - Parts of the std C++ library are not found in /usr/lib64/libstdc++.so.6 - but must be linked from -lstdc++_nonshared. - - Try on RedHat 6: - readelf -Ws /usr/lib64/libstdc++.so.6 | grep _ZNSs4backEv - - That symbol has a weak implementation in libprotobuf-lite-debug.so - but is undefined in mysqld-debug, which means mysqld-debug will not - run with libprotobuf-lite.so (the non-debug version). - - The solution is to add this version-script which explicitly makes - all symbols from the standard library hidden. It is really only needed - on RedHat 6/7, but we might as well use it on all Linuxes. - - https://itanium-cxx-abi.github.io/cxx-abi/abi.html#mangling - - ::= St # ::std:: - ::= Sa # ::std::allocator - ::= Sb # ::std::basic_string - ::= Ss # ::std::basic_string < char, - ::std::char_traits, - ::std::allocator > - ::= Si # ::std::basic_istream > - ::= So # ::std::basic_ostream > - ::= Sd # ::std::basic_iostream > - */ - -MYSQL_HIDE_STD { - local: - _ZS[tabsiod]*; - _ZNS[tabsiod]*; - _ZNKS[tabsiod]*; -}; diff --git a/extra/protobuf/protobuf-3.19.4/cmake/libprotoc.cmake b/extra/protobuf/protobuf-3.19.4/cmake/libprotoc.cmake deleted file mode 100644 index 4139172d4863..000000000000 --- a/extra/protobuf/protobuf-3.19.4/cmake/libprotoc.cmake +++ /dev/null @@ -1,152 +0,0 @@ -set(libprotoc_files - ${protobuf_source_dir}/src/google/protobuf/compiler/code_generator.cc - ${protobuf_source_dir}/src/google/protobuf/compiler/command_line_interface.cc - ${protobuf_source_dir}/src/google/protobuf/compiler/cpp/cpp_enum.cc - ${protobuf_source_dir}/src/google/protobuf/compiler/cpp/cpp_enum_field.cc - ${protobuf_source_dir}/src/google/protobuf/compiler/cpp/cpp_extension.cc - ${protobuf_source_dir}/src/google/protobuf/compiler/cpp/cpp_field.cc - ${protobuf_source_dir}/src/google/protobuf/compiler/cpp/cpp_file.cc - ${protobuf_source_dir}/src/google/protobuf/compiler/cpp/cpp_generator.cc - ${protobuf_source_dir}/src/google/protobuf/compiler/cpp/cpp_helpers.cc - ${protobuf_source_dir}/src/google/protobuf/compiler/cpp/cpp_map_field.cc - ${protobuf_source_dir}/src/google/protobuf/compiler/cpp/cpp_message.cc - ${protobuf_source_dir}/src/google/protobuf/compiler/cpp/cpp_message_field.cc - ${protobuf_source_dir}/src/google/protobuf/compiler/cpp/cpp_padding_optimizer.cc - ${protobuf_source_dir}/src/google/protobuf/compiler/cpp/cpp_parse_function_generator.cc - ${protobuf_source_dir}/src/google/protobuf/compiler/cpp/cpp_primitive_field.cc - ${protobuf_source_dir}/src/google/protobuf/compiler/cpp/cpp_service.cc - ${protobuf_source_dir}/src/google/protobuf/compiler/cpp/cpp_string_field.cc - ${protobuf_source_dir}/src/google/protobuf/compiler/csharp/csharp_doc_comment.cc - ${protobuf_source_dir}/src/google/protobuf/compiler/csharp/csharp_enum.cc - ${protobuf_source_dir}/src/google/protobuf/compiler/csharp/csharp_enum_field.cc - ${protobuf_source_dir}/src/google/protobuf/compiler/csharp/csharp_field_base.cc - ${protobuf_source_dir}/src/google/protobuf/compiler/csharp/csharp_generator.cc - ${protobuf_source_dir}/src/google/protobuf/compiler/csharp/csharp_helpers.cc - ${protobuf_source_dir}/src/google/protobuf/compiler/csharp/csharp_map_field.cc - ${protobuf_source_dir}/src/google/protobuf/compiler/csharp/csharp_message.cc - ${protobuf_source_dir}/src/google/protobuf/compiler/csharp/csharp_message_field.cc - ${protobuf_source_dir}/src/google/protobuf/compiler/csharp/csharp_primitive_field.cc - ${protobuf_source_dir}/src/google/protobuf/compiler/csharp/csharp_reflection_class.cc - ${protobuf_source_dir}/src/google/protobuf/compiler/csharp/csharp_repeated_enum_field.cc - ${protobuf_source_dir}/src/google/protobuf/compiler/csharp/csharp_repeated_message_field.cc - ${protobuf_source_dir}/src/google/protobuf/compiler/csharp/csharp_repeated_primitive_field.cc - ${protobuf_source_dir}/src/google/protobuf/compiler/csharp/csharp_source_generator_base.cc - ${protobuf_source_dir}/src/google/protobuf/compiler/csharp/csharp_wrapper_field.cc - ${protobuf_source_dir}/src/google/protobuf/compiler/java/java_context.cc - ${protobuf_source_dir}/src/google/protobuf/compiler/java/java_doc_comment.cc - ${protobuf_source_dir}/src/google/protobuf/compiler/java/java_enum.cc - ${protobuf_source_dir}/src/google/protobuf/compiler/java/java_enum_field.cc - ${protobuf_source_dir}/src/google/protobuf/compiler/java/java_enum_field_lite.cc - ${protobuf_source_dir}/src/google/protobuf/compiler/java/java_enum_lite.cc - ${protobuf_source_dir}/src/google/protobuf/compiler/java/java_extension.cc - ${protobuf_source_dir}/src/google/protobuf/compiler/java/java_extension_lite.cc - ${protobuf_source_dir}/src/google/protobuf/compiler/java/java_field.cc - ${protobuf_source_dir}/src/google/protobuf/compiler/java/java_file.cc - ${protobuf_source_dir}/src/google/protobuf/compiler/java/java_generator.cc - ${protobuf_source_dir}/src/google/protobuf/compiler/java/java_generator_factory.cc - ${protobuf_source_dir}/src/google/protobuf/compiler/java/java_helpers.cc - ${protobuf_source_dir}/src/google/protobuf/compiler/java/java_kotlin_generator.cc - ${protobuf_source_dir}/src/google/protobuf/compiler/java/java_map_field.cc - ${protobuf_source_dir}/src/google/protobuf/compiler/java/java_map_field_lite.cc - ${protobuf_source_dir}/src/google/protobuf/compiler/java/java_message.cc - ${protobuf_source_dir}/src/google/protobuf/compiler/java/java_message_builder.cc - ${protobuf_source_dir}/src/google/protobuf/compiler/java/java_message_builder_lite.cc - ${protobuf_source_dir}/src/google/protobuf/compiler/java/java_message_field.cc - ${protobuf_source_dir}/src/google/protobuf/compiler/java/java_message_field_lite.cc - ${protobuf_source_dir}/src/google/protobuf/compiler/java/java_message_lite.cc - ${protobuf_source_dir}/src/google/protobuf/compiler/java/java_name_resolver.cc - ${protobuf_source_dir}/src/google/protobuf/compiler/java/java_primitive_field.cc - ${protobuf_source_dir}/src/google/protobuf/compiler/java/java_primitive_field_lite.cc - ${protobuf_source_dir}/src/google/protobuf/compiler/java/java_service.cc - ${protobuf_source_dir}/src/google/protobuf/compiler/java/java_shared_code_generator.cc - ${protobuf_source_dir}/src/google/protobuf/compiler/java/java_string_field.cc - ${protobuf_source_dir}/src/google/protobuf/compiler/java/java_string_field_lite.cc - ${protobuf_source_dir}/src/google/protobuf/compiler/js/js_generator.cc - ${protobuf_source_dir}/src/google/protobuf/compiler/js/well_known_types_embed.cc - ${protobuf_source_dir}/src/google/protobuf/compiler/objectivec/objectivec_enum.cc - ${protobuf_source_dir}/src/google/protobuf/compiler/objectivec/objectivec_enum_field.cc - ${protobuf_source_dir}/src/google/protobuf/compiler/objectivec/objectivec_extension.cc - ${protobuf_source_dir}/src/google/protobuf/compiler/objectivec/objectivec_field.cc - ${protobuf_source_dir}/src/google/protobuf/compiler/objectivec/objectivec_file.cc - ${protobuf_source_dir}/src/google/protobuf/compiler/objectivec/objectivec_generator.cc - ${protobuf_source_dir}/src/google/protobuf/compiler/objectivec/objectivec_helpers.cc - ${protobuf_source_dir}/src/google/protobuf/compiler/objectivec/objectivec_map_field.cc - ${protobuf_source_dir}/src/google/protobuf/compiler/objectivec/objectivec_message.cc - ${protobuf_source_dir}/src/google/protobuf/compiler/objectivec/objectivec_message_field.cc - ${protobuf_source_dir}/src/google/protobuf/compiler/objectivec/objectivec_oneof.cc - ${protobuf_source_dir}/src/google/protobuf/compiler/objectivec/objectivec_primitive_field.cc - ${protobuf_source_dir}/src/google/protobuf/compiler/php/php_generator.cc - ${protobuf_source_dir}/src/google/protobuf/compiler/plugin.cc - ${protobuf_source_dir}/src/google/protobuf/compiler/plugin.pb.cc - ${protobuf_source_dir}/src/google/protobuf/compiler/python/python_generator.cc - ${protobuf_source_dir}/src/google/protobuf/compiler/ruby/ruby_generator.cc - ${protobuf_source_dir}/src/google/protobuf/compiler/subprocess.cc - ${protobuf_source_dir}/src/google/protobuf/compiler/zip_writer.cc -) - -set(libprotoc_headers - ${protobuf_source_dir}/src/google/protobuf/compiler/code_generator.h - ${protobuf_source_dir}/src/google/protobuf/compiler/command_line_interface.h - ${protobuf_source_dir}/src/google/protobuf/compiler/cpp/cpp_file.h - ${protobuf_source_dir}/src/google/protobuf/compiler/cpp/cpp_generator.h - ${protobuf_source_dir}/src/google/protobuf/compiler/cpp/cpp_helpers.h - ${protobuf_source_dir}/src/google/protobuf/compiler/cpp/cpp_names.h - ${protobuf_source_dir}/src/google/protobuf/compiler/csharp/csharp_doc_comment.h - ${protobuf_source_dir}/src/google/protobuf/compiler/csharp/csharp_generator.h - ${protobuf_source_dir}/src/google/protobuf/compiler/csharp/csharp_names.h - ${protobuf_source_dir}/src/google/protobuf/compiler/csharp/csharp_options.h - ${protobuf_source_dir}/src/google/protobuf/compiler/importer.h - ${protobuf_source_dir}/src/google/protobuf/compiler/java/java_generator.h - ${protobuf_source_dir}/src/google/protobuf/compiler/java/java_kotlin_generator.h - ${protobuf_source_dir}/src/google/protobuf/compiler/java/java_names.h - ${protobuf_source_dir}/src/google/protobuf/compiler/js/js_generator.h - ${protobuf_source_dir}/src/google/protobuf/compiler/objectivec/objectivec_generator.h - ${protobuf_source_dir}/src/google/protobuf/compiler/objectivec/objectivec_helpers.h - ${protobuf_source_dir}/src/google/protobuf/compiler/parser.h - ${protobuf_source_dir}/src/google/protobuf/compiler/php/php_generator.h - ${protobuf_source_dir}/src/google/protobuf/compiler/plugin.h - ${protobuf_source_dir}/src/google/protobuf/compiler/plugin.pb.h - ${protobuf_source_dir}/src/google/protobuf/compiler/python/python_generator.h - ${protobuf_source_dir}/src/google/protobuf/compiler/ruby/ruby_generator.h -) - -if (CMAKE_CXX_COMPILER_ID STREQUAL "MSVC") -set(libprotoc_rc_files - ${CMAKE_CURRENT_BINARY_DIR}/version.rc -) -endif() - -add_library(libprotoc ${protobuf_SHARED_OR_STATIC} - ${libprotoc_files} ${libprotoc_headers} ${libprotoc_rc_files}) - -ADD_OBJDUMP_TARGET(show_libprotoc "$" - DEPENDS libprotoc) -ADD_LIBRARY(ext::libprotoc ALIAS libprotoc) - -target_link_libraries(libprotoc libprotobuf) -if(MSVC AND protobuf_BUILD_SHARED_LIBS) - target_compile_definitions(libprotoc - PUBLIC PROTOBUF_USE_DLLS - PRIVATE LIBPROTOC_EXPORTS) -endif() -set_target_properties(libprotoc PROPERTIES - COMPILE_DEFINITIONS LIBPROTOC_EXPORTS - VERSION ${protobuf_VERSION} - OUTPUT_NAME ${LIB_PREFIX}protoc - DEBUG_POSTFIX "${protobuf_DEBUG_POSTFIX}") -add_library(protobuf::libprotoc ALIAS libprotoc) - -### -IF(protobuf_BUILD_SHARED_LIBS) - SET_TARGET_PROPERTIES(libprotoc PROPERTIES - DEBUG_POSTFIX "" - LIBRARY_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/library_output_directory - RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/library_output_directory) - IF(WIN32) - ADD_CUSTOM_COMMAND(TARGET libprotoc POST_BUILD - COMMAND ${CMAKE_COMMAND} -E copy_if_different - "${CMAKE_BINARY_DIR}/library_output_directory/${CMAKE_CFG_INTDIR}/libprotoc.dll" - "${CMAKE_BINARY_DIR}/runtime_output_directory/${CMAKE_CFG_INTDIR}/libprotoc.dll" - ) - ENDIF() -ENDIF() diff --git a/extra/protobuf/protobuf-3.19.4/cmake/protobuf-config-version.cmake.in b/extra/protobuf/protobuf-3.19.4/cmake/protobuf-config-version.cmake.in deleted file mode 100644 index 3fa01763ee65..000000000000 --- a/extra/protobuf/protobuf-3.19.4/cmake/protobuf-config-version.cmake.in +++ /dev/null @@ -1,60 +0,0 @@ -set(PACKAGE_VERSION "@protobuf_VERSION@") -set(${PACKAGE_FIND_NAME}_VERSION_PRERELEASE "@protobuf_VERSION_PRERELEASE@" PARENT_SCOPE) - -# Prerelease versions cannot be passed in directly via the find_package command, -# so we allow users to specify it in a variable -if(NOT DEFINED "${PACKAGE_FIND_NAME}_FIND_VERSION_PRERELEASE") - set("${${PACKAGE_FIND_NAME}_FIND_VERSION_PRERELEASE}" "") -else() - set(PACKAGE_FIND_VERSION ${PACKAGE_FIND_VERSION}-${${PACKAGE_FIND_NAME}_FIND_VERSION_PRERELEASE}) -endif() -set(PACKAGE_FIND_VERSION_PRERELEASE "${${PACKAGE_FIND_NAME}_FIND_VERSION_PRERELEASE}") - -# VERSION_EQUAL ignores the prerelease strings, so we use STREQUAL. -if(PACKAGE_FIND_VERSION STREQUAL PACKAGE_VERSION) - set(PACKAGE_VERSION_EXACT TRUE) -endif() - -set(PACKAGE_VERSION_COMPATIBLE TRUE) #Assume true until shown otherwise - -if(PACKAGE_FIND_VERSION) #Only perform version checks if one is given - if(NOT PACKAGE_FIND_VERSION_MAJOR EQUAL "@protobuf_VERSION_MAJOR@") - set(PACKAGE_VERSION_COMPATIBLE FALSE) - elseif(PACKAGE_FIND_VERSION VERSION_GREATER PACKAGE_VERSION) - set(PACKAGE_VERSION_COMPATIBLE FALSE) - elseif(PACKAGE_FIND_VERSION VERSION_EQUAL PACKAGE_VERSION) - # Do not match prerelease versions to non-prerelease version requests. - if(NOT "@protobuf_VERSION_PRERELEASE@" STREQUAL "" AND PACKAGE_FIND_VERSION_PRERELEASE STREQUAL "") - message(AUTHOR_WARNING "To use this prerelease version of ${PACKAGE_FIND_NAME}, set ${PACKAGE_FIND_NAME}_FIND_VERSION_PRERELEASE to '@protobuf_VERSION_PRERELEASE@' or greater.") - set(PACKAGE_VERSION_COMPATIBLE FALSE) - endif() - - # Not robustly SemVer compliant, but protobuf never uses '.' separated prerelease identifiers. - if(PACKAGE_FIND_VERSION_PRERELEASE STRGREATER "@protobuf_VERSION_PRERELEASE@") - set(PACKAGE_VERSION_COMPATIBLE FALSE) - endif() - endif() -endif() - -# Check and save build options used to create this package -macro(_check_and_save_build_option OPTION VALUE) - if(DEFINED ${PACKAGE_FIND_NAME}_${OPTION} AND - NOT ${PACKAGE_FIND_NAME}_${OPTION} STREQUAL ${VALUE}) - set(PACKAGE_VERSION_UNSUITABLE TRUE) - endif() - set(${PACKAGE_FIND_NAME}_${OPTION} ${VALUE} PARENT_SCOPE) -endmacro() -_check_and_save_build_option(WITH_ZLIB @protobuf_WITH_ZLIB@) -_check_and_save_build_option(MSVC_STATIC_RUNTIME @protobuf_MSVC_STATIC_RUNTIME@) -_check_and_save_build_option(BUILD_SHARED_LIBS @protobuf_BUILD_SHARED_LIBS@) - -# if the installed or the using project don't have CMAKE_SIZEOF_VOID_P set, ignore it: -if(CMAKE_SIZEOF_VOID_P AND "@CMAKE_SIZEOF_VOID_P@") - # check that the installed version has the same 32/64bit-ness as the one which is currently searching: - if(NOT CMAKE_SIZEOF_VOID_P EQUAL "@CMAKE_SIZEOF_VOID_P@") - math(EXPR installedBits "@CMAKE_SIZEOF_VOID_P@ * 8") - set(PACKAGE_VERSION "${PACKAGE_VERSION} (${installedBits}bit)") - set(PACKAGE_VERSION_UNSUITABLE TRUE) - endif() -endif() - diff --git a/extra/protobuf/protobuf-3.19.4/cmake/protobuf-config.cmake.in b/extra/protobuf/protobuf-3.19.4/cmake/protobuf-config.cmake.in deleted file mode 100644 index 9197625dc25b..000000000000 --- a/extra/protobuf/protobuf-3.19.4/cmake/protobuf-config.cmake.in +++ /dev/null @@ -1,152 +0,0 @@ -# User options -include("${CMAKE_CURRENT_LIST_DIR}/protobuf-options.cmake") - -# Depend packages -@_protobuf_FIND_ZLIB@ - -# Imported targets -include("${CMAKE_CURRENT_LIST_DIR}/protobuf-targets.cmake") - -function(protobuf_generate) - include(CMakeParseArguments) - - set(_options APPEND_PATH) - set(_singleargs LANGUAGE OUT_VAR EXPORT_MACRO PROTOC_OUT_DIR PLUGIN) - if(COMMAND target_sources) - list(APPEND _singleargs TARGET) - endif() - set(_multiargs PROTOS IMPORT_DIRS GENERATE_EXTENSIONS PROTOC_OPTIONS) - - cmake_parse_arguments(protobuf_generate "${_options}" "${_singleargs}" "${_multiargs}" "${ARGN}") - - if(NOT protobuf_generate_PROTOS AND NOT protobuf_generate_TARGET) - message(SEND_ERROR "Error: protobuf_generate called without any targets or source files") - return() - endif() - - if(NOT protobuf_generate_OUT_VAR AND NOT protobuf_generate_TARGET) - message(SEND_ERROR "Error: protobuf_generate called without a target or output variable") - return() - endif() - - if(NOT protobuf_generate_LANGUAGE) - set(protobuf_generate_LANGUAGE cpp) - endif() - string(TOLOWER ${protobuf_generate_LANGUAGE} protobuf_generate_LANGUAGE) - - if(NOT protobuf_generate_PROTOC_OUT_DIR) - set(protobuf_generate_PROTOC_OUT_DIR ${CMAKE_CURRENT_BINARY_DIR}) - endif() - - if(protobuf_generate_EXPORT_MACRO AND protobuf_generate_LANGUAGE STREQUAL cpp) - set(_dll_export_decl "dllexport_decl=${protobuf_generate_EXPORT_MACRO}:") - endif() - - if(protobuf_generate_PLUGIN) - set(_plugin "--plugin=${protobuf_generate_PLUGIN}") - endif() - - if(NOT protobuf_generate_GENERATE_EXTENSIONS) - if(protobuf_generate_LANGUAGE STREQUAL cpp) - set(protobuf_generate_GENERATE_EXTENSIONS .pb.h .pb.cc) - elseif(protobuf_generate_LANGUAGE STREQUAL python) - set(protobuf_generate_GENERATE_EXTENSIONS _pb2.py) - else() - message(SEND_ERROR "Error: protobuf_generate given unknown Language ${LANGUAGE}, please provide a value for GENERATE_EXTENSIONS") - return() - endif() - endif() - - if(protobuf_generate_TARGET) - get_target_property(_source_list ${protobuf_generate_TARGET} SOURCES) - foreach(_file ${_source_list}) - if(_file MATCHES "proto$") - list(APPEND protobuf_generate_PROTOS ${_file}) - endif() - endforeach() - endif() - - if(NOT protobuf_generate_PROTOS) - message(SEND_ERROR "Error: protobuf_generate could not find any .proto files") - return() - endif() - - if(protobuf_generate_APPEND_PATH) - # Create an include path for each file specified - foreach(_file ${protobuf_generate_PROTOS}) - get_filename_component(_abs_file ${_file} ABSOLUTE) - get_filename_component(_abs_path ${_abs_file} PATH) - list(FIND _protobuf_include_path ${_abs_path} _contains_already) - if(${_contains_already} EQUAL -1) - list(APPEND _protobuf_include_path -I ${_abs_path}) - endif() - endforeach() - endif() - - foreach(DIR ${protobuf_generate_IMPORT_DIRS}) - get_filename_component(ABS_PATH ${DIR} ABSOLUTE) - list(FIND _protobuf_include_path ${ABS_PATH} _contains_already) - if(${_contains_already} EQUAL -1) - list(APPEND _protobuf_include_path -I ${ABS_PATH}) - endif() - endforeach() - - if(NOT _protobuf_include_path) - set(_protobuf_include_path -I ${CMAKE_CURRENT_SOURCE_DIR}) - endif() - - set(_generated_srcs_all) - foreach(_proto ${protobuf_generate_PROTOS}) - get_filename_component(_abs_file ${_proto} ABSOLUTE) - get_filename_component(_abs_dir ${_abs_file} DIRECTORY) - - get_filename_component(_file_full_name ${_proto} NAME) - string(FIND "${_file_full_name}" "." _file_last_ext_pos REVERSE) - string(SUBSTRING "${_file_full_name}" 0 ${_file_last_ext_pos} _basename) - - set(_suitable_include_found FALSE) - foreach(DIR ${_protobuf_include_path}) - if(NOT DIR STREQUAL "-I") - file(RELATIVE_PATH _rel_dir ${DIR} ${_abs_dir}) - string(FIND "${_rel_dir}" "../" _is_in_parent_folder) - if (NOT ${_is_in_parent_folder} EQUAL 0) - set(_suitable_include_found TRUE) - break() - endif() - endif() - endforeach() - - if(NOT _suitable_include_found) - message(SEND_ERROR "Error: protobuf_generate could not find any correct proto include directory.") - return() - endif() - - set(_generated_srcs) - foreach(_ext ${protobuf_generate_GENERATE_EXTENSIONS}) - list(APPEND _generated_srcs "${protobuf_generate_PROTOC_OUT_DIR}/${_rel_dir}/${_basename}${_ext}") - endforeach() - list(APPEND _generated_srcs_all ${_generated_srcs}) - - add_custom_command( - OUTPUT ${_generated_srcs} - COMMAND protobuf::protoc - ARGS ${protobuf_generate_PROTOC_OPTIONS} --${protobuf_generate_LANGUAGE}_out ${_dll_export_decl}${protobuf_generate_PROTOC_OUT_DIR} ${_plugin} ${_protobuf_include_path} ${_abs_file} - DEPENDS ${_abs_file} protobuf::protoc - COMMENT "Running ${protobuf_generate_LANGUAGE} protocol buffer compiler on ${_proto}. Custom options: ${protobuf_generate_PROTOC_OPTIONS}" - VERBATIM ) - endforeach() - - set_source_files_properties(${_generated_srcs_all} PROPERTIES GENERATED TRUE) - if(protobuf_generate_OUT_VAR) - set(${protobuf_generate_OUT_VAR} ${_generated_srcs_all} PARENT_SCOPE) - endif() - if(protobuf_generate_TARGET) - target_sources(${protobuf_generate_TARGET} PRIVATE ${_generated_srcs_all}) - endif() - -endfunction() - -# CMake FindProtobuf module compatible file -if(protobuf_MODULE_COMPATIBLE) - include("${CMAKE_CURRENT_LIST_DIR}/protobuf-module.cmake") -endif() diff --git a/extra/protobuf/protobuf-3.19.4/cmake/protobuf-lite.pc.cmake b/extra/protobuf/protobuf-3.19.4/cmake/protobuf-lite.pc.cmake deleted file mode 100644 index 9745cb89c7a7..000000000000 --- a/extra/protobuf/protobuf-3.19.4/cmake/protobuf-lite.pc.cmake +++ /dev/null @@ -1,11 +0,0 @@ -prefix=@CMAKE_INSTALL_PREFIX@ -exec_prefix=@CMAKE_INSTALL_PREFIX@ -libdir=@CMAKE_INSTALL_FULL_LIBDIR@ -includedir=@CMAKE_INSTALL_FULL_INCLUDEDIR@ - -Name: Protocol Buffers -Description: Google's Data Interchange Format -Version: @protobuf_VERSION@ -Libs: -L${libdir} -lprotobuf-lite @CMAKE_THREAD_LIBS_INIT@ -Cflags: -I${includedir} -Conflicts: protobuf diff --git a/extra/protobuf/protobuf-3.19.4/cmake/protobuf-module.cmake.in b/extra/protobuf/protobuf-3.19.4/cmake/protobuf-module.cmake.in deleted file mode 100644 index 09b9d29c2212..000000000000 --- a/extra/protobuf/protobuf-3.19.4/cmake/protobuf-module.cmake.in +++ /dev/null @@ -1,187 +0,0 @@ -# This file contains backwards compatibility patches for various legacy functions and variables -# Functions - -function(PROTOBUF_GENERATE_CPP SRCS HDRS) - cmake_parse_arguments(protobuf_generate_cpp "" "EXPORT_MACRO" "" ${ARGN}) - - set(_proto_files "${protobuf_generate_cpp_UNPARSED_ARGUMENTS}") - if(NOT _proto_files) - message(SEND_ERROR "Error: PROTOBUF_GENERATE_CPP() called without any proto files") - return() - endif() - - if(PROTOBUF_GENERATE_CPP_APPEND_PATH) - set(_append_arg APPEND_PATH) - endif() - - if(DEFINED Protobuf_IMPORT_DIRS) - set(_import_arg IMPORT_DIRS ${Protobuf_IMPORT_DIRS}) - endif() - - set(_outvar) - protobuf_generate(${_append_arg} LANGUAGE cpp EXPORT_MACRO ${protobuf_generate_cpp_EXPORT_MACRO} OUT_VAR _outvar ${_import_arg} PROTOS ${_proto_files}) - - set(${SRCS}) - set(${HDRS}) - foreach(_file ${_outvar}) - if(_file MATCHES "cc$") - list(APPEND ${SRCS} ${_file}) - else() - list(APPEND ${HDRS} ${_file}) - endif() - endforeach() - set(${SRCS} ${${SRCS}} PARENT_SCOPE) - set(${HDRS} ${${HDRS}} PARENT_SCOPE) -endfunction() - -function(PROTOBUF_GENERATE_PYTHON SRCS) - if(NOT ARGN) - message(SEND_ERROR "Error: PROTOBUF_GENERATE_PYTHON() called without any proto files") - return() - endif() - - if(PROTOBUF_GENERATE_CPP_APPEND_PATH) - set(_append_arg APPEND_PATH) - endif() - - if(DEFINED Protobuf_IMPORT_DIRS) - set(_import_arg IMPORT_DIRS ${Protobuf_IMPORT_DIRS}) - endif() - - set(_outvar) - protobuf_generate(${_append_arg} LANGUAGE python OUT_VAR _outvar ${_import_arg} PROTOS ${ARGN}) - set(${SRCS} ${_outvar} PARENT_SCOPE) -endfunction() - -# Environment - -# Backwards compatibility -# Define camel case versions of input variables -foreach(UPPER - PROTOBUF_SRC_ROOT_FOLDER - PROTOBUF_IMPORT_DIRS - PROTOBUF_DEBUG - PROTOBUF_LIBRARY - PROTOBUF_PROTOC_LIBRARY - PROTOBUF_INCLUDE_DIR - PROTOBUF_PROTOC_EXECUTABLE - PROTOBUF_LIBRARY_DEBUG - PROTOBUF_PROTOC_LIBRARY_DEBUG - PROTOBUF_LITE_LIBRARY - PROTOBUF_LITE_LIBRARY_DEBUG - ) - if (DEFINED ${UPPER}) - string(REPLACE "PROTOBUF_" "Protobuf_" Camel ${UPPER}) - if (NOT DEFINED ${Camel}) - set(${Camel} ${${UPPER}}) - endif() - endif() -endforeach() - -if(DEFINED Protobuf_SRC_ROOT_FOLDER) - message(AUTHOR_WARNING "Variable Protobuf_SRC_ROOT_FOLDER defined, but not" - " used in CONFIG mode") -endif() - -include(SelectLibraryConfigurations) - -# Internal function: search for normal library as well as a debug one -# if the debug one is specified also include debug/optimized keywords -# in *_LIBRARIES variable -function(_protobuf_find_libraries name filename) - if(${name}_LIBRARIES) - # Use result recorded by a previous call. - elseif(${name}_LIBRARY) - # Honor cache entry used by CMake 3.5 and lower. - set(${name}_LIBRARIES "${${name}_LIBRARY}" PARENT_SCOPE) - else() - get_target_property(${name}_LIBRARY_RELEASE protobuf::lib${filename} - LOCATION_RELEASE) - get_target_property(${name}_LIBRARY_RELWITHDEBINFO protobuf::lib${filename} - LOCATION_RELWITHDEBINFO) - get_target_property(${name}_LIBRARY_MINSIZEREL protobuf::lib${filename} - LOCATION_MINSIZEREL) - get_target_property(${name}_LIBRARY_DEBUG protobuf::lib${filename} - LOCATION_DEBUG) - - select_library_configurations(${name}) - set(${name}_LIBRARY ${${name}_LIBRARY} PARENT_SCOPE) - set(${name}_LIBRARIES ${${name}_LIBRARIES} PARENT_SCOPE) - endif() -endfunction() - -# -# Main. -# - -# By default have PROTOBUF_GENERATE_CPP macro pass -I to protoc -# for each directory where a proto file is referenced. -if(NOT DEFINED PROTOBUF_GENERATE_CPP_APPEND_PATH) - set(PROTOBUF_GENERATE_CPP_APPEND_PATH TRUE) -endif() - -# The Protobuf library -_protobuf_find_libraries(Protobuf protobuf) - -# The Protobuf Lite library -_protobuf_find_libraries(Protobuf_LITE protobuf-lite) - -# The Protobuf Protoc Library -_protobuf_find_libraries(Protobuf_PROTOC protoc) - -# Set the include directory -get_target_property(Protobuf_INCLUDE_DIRS protobuf::libprotobuf - INTERFACE_INCLUDE_DIRECTORIES) - -# Set the protoc Executable -get_target_property(Protobuf_PROTOC_EXECUTABLE protobuf::protoc - IMPORTED_LOCATION_RELEASE) -if(NOT EXISTS "${Protobuf_PROTOC_EXECUTABLE}") - get_target_property(Protobuf_PROTOC_EXECUTABLE protobuf::protoc - IMPORTED_LOCATION_RELWITHDEBINFO) -endif() -if(NOT EXISTS "${Protobuf_PROTOC_EXECUTABLE}") - get_target_property(Protobuf_PROTOC_EXECUTABLE protobuf::protoc - IMPORTED_LOCATION_MINSIZEREL) -endif() -if(NOT EXISTS "${Protobuf_PROTOC_EXECUTABLE}") - get_target_property(Protobuf_PROTOC_EXECUTABLE protobuf::protoc - IMPORTED_LOCATION_DEBUG) -endif() -if(NOT EXISTS "${Protobuf_PROTOC_EXECUTABLE}") - get_target_property(Protobuf_PROTOC_EXECUTABLE protobuf::protoc - IMPORTED_LOCATION_NOCONFIG) -endif() - -# Version info variable -set(Protobuf_VERSION "@protobuf_VERSION@") - -include(FindPackageHandleStandardArgs) -FIND_PACKAGE_HANDLE_STANDARD_ARGS(Protobuf - REQUIRED_VARS Protobuf_PROTOC_EXECUTABLE Protobuf_LIBRARIES Protobuf_INCLUDE_DIRS - VERSION_VAR Protobuf_VERSION -) - -# Backwards compatibility -# Define upper case versions of output variables -foreach(Camel - Protobuf_VERSION - Protobuf_SRC_ROOT_FOLDER - Protobuf_IMPORT_DIRS - Protobuf_DEBUG - Protobuf_INCLUDE_DIRS - Protobuf_LIBRARIES - Protobuf_PROTOC_LIBRARIES - Protobuf_LITE_LIBRARIES - Protobuf_LIBRARY - Protobuf_PROTOC_LIBRARY - Protobuf_INCLUDE_DIR - Protobuf_PROTOC_EXECUTABLE - Protobuf_LIBRARY_DEBUG - Protobuf_PROTOC_LIBRARY_DEBUG - Protobuf_LITE_LIBRARY - Protobuf_LITE_LIBRARY_DEBUG - ) - string(TOUPPER ${Camel} UPPER) - set(${UPPER} ${${Camel}}) -endforeach() diff --git a/extra/protobuf/protobuf-3.19.4/cmake/protobuf-options.cmake b/extra/protobuf/protobuf-3.19.4/cmake/protobuf-options.cmake deleted file mode 100644 index 93ec898e4a44..000000000000 --- a/extra/protobuf/protobuf-3.19.4/cmake/protobuf-options.cmake +++ /dev/null @@ -1,7 +0,0 @@ -# Verbose output -option(protobuf_VERBOSE "Enable for verbose output" OFF) -mark_as_advanced(protobuf_VERBOSE) - -# FindProtobuf module compatible -option(protobuf_MODULE_COMPATIBLE "CMake built-in FindProtobuf.cmake module compatible" OFF) -mark_as_advanced(protobuf_MODULE_COMPATIBLE) diff --git a/extra/protobuf/protobuf-3.19.4/cmake/protobuf.pc.cmake b/extra/protobuf/protobuf-3.19.4/cmake/protobuf.pc.cmake deleted file mode 100644 index f068e6926e72..000000000000 --- a/extra/protobuf/protobuf-3.19.4/cmake/protobuf.pc.cmake +++ /dev/null @@ -1,11 +0,0 @@ -prefix=@CMAKE_INSTALL_PREFIX@ -exec_prefix=@CMAKE_INSTALL_PREFIX@ -libdir=@CMAKE_INSTALL_FULL_LIBDIR@ -includedir=@CMAKE_INSTALL_FULL_INCLUDEDIR@ - -Name: Protocol Buffers -Description: Google's Data Interchange Format -Version: @protobuf_VERSION@ -Libs: -L${libdir} -lprotobuf @CMAKE_THREAD_LIBS_INIT@ -Cflags: -I${includedir} -Conflicts: protobuf-lite diff --git a/extra/protobuf/protobuf-3.19.4/cmake/protoc.cmake b/extra/protobuf/protobuf-3.19.4/cmake/protoc.cmake deleted file mode 100644 index dae1e1c77b8a..000000000000 --- a/extra/protobuf/protobuf-3.19.4/cmake/protoc.cmake +++ /dev/null @@ -1,30 +0,0 @@ -set(protoc_files - ${protobuf_source_dir}/src/google/protobuf/compiler/main.cc -) - -if (CMAKE_CXX_COMPILER_ID STREQUAL "MSVC") -set(protoc_rc_files - ${CMAKE_CURRENT_BINARY_DIR}/version.rc -) -endif() - -add_executable(protoc ${protoc_files} ${protoc_rc_files}) -target_link_libraries(protoc libprotoc libprotobuf) -add_executable(protobuf::protoc ALIAS protoc) - -set_target_properties(protoc PROPERTIES - VERSION ${protobuf_VERSION}) - -### -SET_TARGET_PROPERTIES(protoc PROPERTIES - RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/runtime_output_directory) - -# The target symlink_protobuf_dlls will take care of the required -# symbolic links to make protobuf(-lite) library accessible to all -# kind of modules: binaries, plugins, including its debug builds. -# All targets which link with protobuf(-lite) depend on this target. -# This target will also work when building individual components, -# like router. -IF(TARGET symlink_protobuf_dlls) - ADD_DEPENDENCIES(protoc symlink_protobuf_dlls) -ENDIF() diff --git a/extra/protobuf/protobuf-3.19.4/cmake/tests.cmake b/extra/protobuf/protobuf-3.19.4/cmake/tests.cmake deleted file mode 100644 index 529685856ec0..000000000000 --- a/extra/protobuf/protobuf-3.19.4/cmake/tests.cmake +++ /dev/null @@ -1,252 +0,0 @@ -if (NOT EXISTS "${PROJECT_SOURCE_DIR}/../third_party/googletest/CMakeLists.txt") - message(FATAL_ERROR - "Cannot find third_party/googletest directory that's needed to " - "build tests. If you use git, make sure you have cloned submodules:\n" - " git submodule update --init --recursive\n" - "If instead you want to skip tests, run cmake with:\n" - " cmake -Dprotobuf_BUILD_TESTS=OFF\n") -endif() - -option(protobuf_ABSOLUTE_TEST_PLUGIN_PATH - "Using absolute test_plugin path in tests" ON) -mark_as_advanced(protobuf_ABSOLUTE_TEST_PLUGIN_PATH) - -set(googlemock_source_dir "${protobuf_source_dir}/third_party/googletest/googlemock") -set(googletest_source_dir "${protobuf_source_dir}/third_party/googletest/googletest") -include_directories( - ${googlemock_source_dir} - ${googletest_source_dir} - ${googletest_source_dir}/include - ${googlemock_source_dir}/include -) - -add_library(gmock STATIC - "${googlemock_source_dir}/src/gmock-all.cc" - "${googletest_source_dir}/src/gtest-all.cc" -) -target_link_libraries(gmock ${CMAKE_THREAD_LIBS_INIT}) -add_library(gmock_main STATIC "${googlemock_source_dir}/src/gmock_main.cc") -target_link_libraries(gmock_main gmock) - -set(lite_test_protos - google/protobuf/map_lite_unittest.proto - google/protobuf/unittest_import_lite.proto - google/protobuf/unittest_import_public_lite.proto - google/protobuf/unittest_lite.proto -) - -set(tests_protos - 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_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_import.proto - google/protobuf/unittest_import_public.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_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_enum.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 - google/protobuf/unittest_proto3_lite.proto - google/protobuf/unittest_proto3_optional.proto - google/protobuf/unittest_well_known_types.proto - google/protobuf/util/internal/testdata/anys.proto - google/protobuf/util/internal/testdata/books.proto - google/protobuf/util/internal/testdata/default_value.proto - google/protobuf/util/internal/testdata/default_value_test.proto - google/protobuf/util/internal/testdata/field_mask.proto - google/protobuf/util/internal/testdata/maps.proto - google/protobuf/util/internal/testdata/oneofs.proto - google/protobuf/util/internal/testdata/proto3.proto - google/protobuf/util/internal/testdata/struct.proto - google/protobuf/util/internal/testdata/timestamp_duration.proto - 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 -) - -macro(compile_proto_file filename) - get_filename_component(dirname ${filename} PATH) - get_filename_component(basename ${filename} NAME_WE) - add_custom_command( - OUTPUT ${protobuf_source_dir}/src/${dirname}/${basename}.pb.cc - DEPENDS ${protobuf_PROTOC_EXE} ${protobuf_source_dir}/src/${dirname}/${basename}.proto - COMMAND ${protobuf_PROTOC_EXE} ${protobuf_source_dir}/src/${dirname}/${basename}.proto - --proto_path=${protobuf_source_dir}/src - --cpp_out=${protobuf_source_dir}/src - --experimental_allow_proto3_optional - ) -endmacro(compile_proto_file) - -set(lite_test_proto_files) -foreach(proto_file ${lite_test_protos}) - compile_proto_file(${proto_file}) - string(REPLACE .proto .pb.cc pb_file ${proto_file}) - set(lite_test_proto_files ${lite_test_proto_files} - ${protobuf_source_dir}/src/${pb_file}) -endforeach(proto_file) - -set(tests_proto_files) -foreach(proto_file ${tests_protos}) - compile_proto_file(${proto_file}) - string(REPLACE .proto .pb.cc pb_file ${proto_file}) - set(tests_proto_files ${tests_proto_files} - ${protobuf_source_dir}/src/${pb_file}) -endforeach(proto_file) - -set(common_lite_test_files - ${protobuf_source_dir}/src/google/protobuf/arena_test_util.cc - ${protobuf_source_dir}/src/google/protobuf/map_lite_test_util.cc - ${protobuf_source_dir}/src/google/protobuf/test_util_lite.cc -) - -set(common_test_files - ${common_lite_test_files} - ${protobuf_source_dir}/src/google/protobuf/map_test_util.inc - ${protobuf_source_dir}/src/google/protobuf/reflection_tester.cc - ${protobuf_source_dir}/src/google/protobuf/test_util.cc - ${protobuf_source_dir}/src/google/protobuf/test_util.inc - ${protobuf_source_dir}/src/google/protobuf/testing/file.cc - ${protobuf_source_dir}/src/google/protobuf/testing/googletest.cc -) - -set(tests_files - ${protobuf_source_dir}/src/google/protobuf/any_test.cc - ${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 - ${protobuf_source_dir}/src/google/protobuf/compiler/cpp/cpp_unittest.cc - ${protobuf_source_dir}/src/google/protobuf/compiler/cpp/cpp_unittest.inc - ${protobuf_source_dir}/src/google/protobuf/compiler/cpp/metadata_test.cc - ${protobuf_source_dir}/src/google/protobuf/compiler/csharp/csharp_bootstrap_unittest.cc - ${protobuf_source_dir}/src/google/protobuf/compiler/csharp/csharp_generator_unittest.cc - ${protobuf_source_dir}/src/google/protobuf/compiler/importer_unittest.cc - ${protobuf_source_dir}/src/google/protobuf/compiler/java/java_doc_comment_unittest.cc - ${protobuf_source_dir}/src/google/protobuf/compiler/java/java_plugin_unittest.cc - ${protobuf_source_dir}/src/google/protobuf/compiler/mock_code_generator.cc - ${protobuf_source_dir}/src/google/protobuf/compiler/objectivec/objectivec_helpers_unittest.cc - ${protobuf_source_dir}/src/google/protobuf/compiler/parser_unittest.cc - ${protobuf_source_dir}/src/google/protobuf/compiler/python/python_plugin_unittest.cc - ${protobuf_source_dir}/src/google/protobuf/compiler/ruby/ruby_generator_unittest.cc - ${protobuf_source_dir}/src/google/protobuf/descriptor_database_unittest.cc - ${protobuf_source_dir}/src/google/protobuf/descriptor_unittest.cc - ${protobuf_source_dir}/src/google/protobuf/drop_unknown_fields_test.cc - ${protobuf_source_dir}/src/google/protobuf/dynamic_message_unittest.cc - ${protobuf_source_dir}/src/google/protobuf/extension_set_unittest.cc - ${protobuf_source_dir}/src/google/protobuf/generated_message_reflection_unittest.cc - ${protobuf_source_dir}/src/google/protobuf/inlined_string_field_unittest.cc - ${protobuf_source_dir}/src/google/protobuf/io/coded_stream_unittest.cc - ${protobuf_source_dir}/src/google/protobuf/io/io_win32_unittest.cc - ${protobuf_source_dir}/src/google/protobuf/io/printer_unittest.cc - ${protobuf_source_dir}/src/google/protobuf/io/tokenizer_unittest.cc - ${protobuf_source_dir}/src/google/protobuf/io/zero_copy_stream_unittest.cc - ${protobuf_source_dir}/src/google/protobuf/map_field_test.cc - ${protobuf_source_dir}/src/google/protobuf/map_test.cc - ${protobuf_source_dir}/src/google/protobuf/map_test.inc - ${protobuf_source_dir}/src/google/protobuf/message_unittest.cc - ${protobuf_source_dir}/src/google/protobuf/message_unittest.inc - ${protobuf_source_dir}/src/google/protobuf/no_field_presence_test.cc - ${protobuf_source_dir}/src/google/protobuf/preserve_unknown_enum_test.cc - ${protobuf_source_dir}/src/google/protobuf/proto3_arena_lite_unittest.cc - ${protobuf_source_dir}/src/google/protobuf/proto3_arena_unittest.cc - ${protobuf_source_dir}/src/google/protobuf/proto3_lite_unittest.cc - ${protobuf_source_dir}/src/google/protobuf/proto3_lite_unittest.inc - ${protobuf_source_dir}/src/google/protobuf/reflection_ops_unittest.cc - ${protobuf_source_dir}/src/google/protobuf/repeated_field_reflection_unittest.cc - ${protobuf_source_dir}/src/google/protobuf/repeated_field_unittest.cc - ${protobuf_source_dir}/src/google/protobuf/stubs/bytestream_unittest.cc - ${protobuf_source_dir}/src/google/protobuf/stubs/common_unittest.cc - ${protobuf_source_dir}/src/google/protobuf/stubs/int128_unittest.cc - ${protobuf_source_dir}/src/google/protobuf/stubs/status_test.cc - ${protobuf_source_dir}/src/google/protobuf/stubs/statusor_test.cc - ${protobuf_source_dir}/src/google/protobuf/stubs/stringpiece_unittest.cc - ${protobuf_source_dir}/src/google/protobuf/stubs/stringprintf_unittest.cc - ${protobuf_source_dir}/src/google/protobuf/stubs/structurally_valid_unittest.cc - ${protobuf_source_dir}/src/google/protobuf/stubs/strutil_unittest.cc - ${protobuf_source_dir}/src/google/protobuf/stubs/template_util_unittest.cc - ${protobuf_source_dir}/src/google/protobuf/stubs/time_test.cc - ${protobuf_source_dir}/src/google/protobuf/text_format_unittest.cc - ${protobuf_source_dir}/src/google/protobuf/unknown_field_set_unittest.cc - ${protobuf_source_dir}/src/google/protobuf/util/delimited_message_util_test.cc - ${protobuf_source_dir}/src/google/protobuf/util/field_comparator_test.cc - ${protobuf_source_dir}/src/google/protobuf/util/field_mask_util_test.cc - ${protobuf_source_dir}/src/google/protobuf/util/internal/default_value_objectwriter_test.cc - ${protobuf_source_dir}/src/google/protobuf/util/internal/json_objectwriter_test.cc - ${protobuf_source_dir}/src/google/protobuf/util/internal/json_stream_parser_test.cc - ${protobuf_source_dir}/src/google/protobuf/util/internal/protostream_objectsource_test.cc - ${protobuf_source_dir}/src/google/protobuf/util/internal/protostream_objectwriter_test.cc - ${protobuf_source_dir}/src/google/protobuf/util/internal/type_info_test_helper.cc - ${protobuf_source_dir}/src/google/protobuf/util/json_util_test.cc - ${protobuf_source_dir}/src/google/protobuf/util/message_differencer_unittest.cc - ${protobuf_source_dir}/src/google/protobuf/util/time_util_test.cc - ${protobuf_source_dir}/src/google/protobuf/util/type_resolver_util_test.cc - ${protobuf_source_dir}/src/google/protobuf/well_known_types_unittest.cc - ${protobuf_source_dir}/src/google/protobuf/wire_format_unittest.cc - ${protobuf_source_dir}/src/google/protobuf/wire_format_unittest.inc -) - -if(protobuf_ABSOLUTE_TEST_PLUGIN_PATH) - add_compile_options(-DGOOGLE_PROTOBUF_TEST_PLUGIN_PATH="$") -endif() - -if(MINGW) - set_source_files_properties(${tests_files} PROPERTIES COMPILE_FLAGS "-Wno-narrowing") - - # required for tests on MinGW Win64 - if (CMAKE_SIZEOF_VOID_P EQUAL 8) - set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -Wl,--stack,16777216") - set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wa,-mbig-obj") - endif() - -endif() - -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 -) - -add_executable(test_plugin ${test_plugin_files}) -target_link_libraries(test_plugin libprotoc libprotobuf gmock) - -set(lite_test_files - ${protobuf_source_dir}/src/google/protobuf/lite_unittest.cc -) -add_executable(lite-test ${lite_test_files} ${common_lite_test_files} ${lite_test_proto_files}) -target_link_libraries(lite-test libprotobuf-lite gmock_main) - -set(lite_arena_test_files - ${protobuf_source_dir}/src/google/protobuf/lite_arena_unittest.cc -) -add_executable(lite-arena-test ${lite_arena_test_files} ${common_lite_test_files} ${lite_test_proto_files}) -target_link_libraries(lite-arena-test libprotobuf-lite gmock_main) - -add_custom_target(check - COMMAND tests - DEPENDS tests test_plugin - WORKING_DIRECTORY ${protobuf_source_dir}) diff --git a/extra/protobuf/protobuf-3.19.4/cmake/version.rc.in b/extra/protobuf/protobuf-3.19.4/cmake/version.rc.in deleted file mode 100644 index f6e7c4a3f9e4..000000000000 --- a/extra/protobuf/protobuf-3.19.4/cmake/version.rc.in +++ /dev/null @@ -1,45 +0,0 @@ -#define VS_FF_DEBUG 0x1L -#define VS_VERSION_INFO 0x1L -#define VS_FFI_FILEFLAGSMASK 0x17L -#define VER_PRIVATEBUILD 0x0L -#define VER_PRERELEASE 0x0L -#define VOS__WINDOWS32 0x4L -#define VFT_DLL 0x2L -#define VFT2_UNKNOWN 0x0L - -#ifndef DEBUG -#define VER_DEBUG 0 -#else -#define VER_DEBUG VS_FF_DEBUG -#endif - - -VS_VERSION_INFO VERSIONINFO - FILEVERSION @protobuf_RC_FILEVERSION@ - PRODUCTVERSION @protobuf_RC_FILEVERSION@ - FILEFLAGSMASK VS_FFI_FILEFLAGSMASK - FILEFLAGS VER_DEBUG - FILEOS VOS__WINDOWS32 - FILETYPE VFT_DLL -BEGIN - BLOCK "VarFileInfo" - BEGIN - // English language (0x409) and the Windows Unicode codepage (1200) - VALUE "Translation", 0x409, 1200 - END - BLOCK "StringFileInfo" - BEGIN - BLOCK "040904b0" - BEGIN - VALUE "FileDescription", "Compiled with @CMAKE_CXX_COMPILER_ID@ @CMAKE_CXX_COMPILER_VERSION@\0" - VALUE "ProductVersion", "@protobuf_VERSION@\0" - VALUE "FileVersion", "@protobuf_VERSION@\0" - VALUE "InternalName", "protobuf\0" - VALUE "ProductName", "Protocol Buffers - Google's Data Interchange Format\0" - VALUE "CompanyName", "Google Inc.\0" - VALUE "LegalCopyright", "Copyright 2008 Google Inc. All rights reserved.\0" - VALUE "Licence", "BSD\0" - VALUE "Info", "https://developers.google.com/protocol-buffers/\0" - END - END -END diff --git a/extra/protobuf/protobuf-3.19.4/compile b/extra/protobuf/protobuf-3.19.4/compile deleted file mode 100755 index df363c8fbfbc..000000000000 --- a/extra/protobuf/protobuf-3.19.4/compile +++ /dev/null @@ -1,348 +0,0 @@ -#! /bin/sh -# Wrapper for compilers which do not understand '-c -o'. - -scriptversion=2018-03-07.03; # UTC - -# Copyright (C) 1999-2021 Free Software Foundation, Inc. -# Written by Tom Tromey . -# -# This program is free software; you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation; either version 2, or (at your option) -# any later version. -# -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with this program. If not, see . - -# As a special exception to the GNU General Public License, if you -# distribute this file as part of a program that contains a -# configuration script generated by Autoconf, you may include it under -# the same distribution terms that you use for the rest of that program. - -# This file is maintained in Automake, please report -# bugs to or send patches to -# . - -nl=' -' - -# We need space, tab and new line, in precisely that order. Quoting is -# there to prevent tools from complaining about whitespace usage. -IFS=" "" $nl" - -file_conv= - -# func_file_conv build_file lazy -# Convert a $build file to $host form and store it in $file -# Currently only supports Windows hosts. If the determined conversion -# type is listed in (the comma separated) LAZY, no conversion will -# take place. -func_file_conv () -{ - file=$1 - case $file in - / | /[!/]*) # absolute file, and not a UNC file - if test -z "$file_conv"; then - # lazily determine how to convert abs files - case `uname -s` in - MINGW*) - file_conv=mingw - ;; - CYGWIN* | MSYS*) - file_conv=cygwin - ;; - *) - file_conv=wine - ;; - esac - fi - case $file_conv/,$2, in - *,$file_conv,*) - ;; - mingw/*) - file=`cmd //C echo "$file " | sed -e 's/"\(.*\) " *$/\1/'` - ;; - cygwin/* | msys/*) - file=`cygpath -m "$file" || echo "$file"` - ;; - wine/*) - file=`winepath -w "$file" || echo "$file"` - ;; - esac - ;; - esac -} - -# func_cl_dashL linkdir -# Make cl look for libraries in LINKDIR -func_cl_dashL () -{ - func_file_conv "$1" - if test -z "$lib_path"; then - lib_path=$file - else - lib_path="$lib_path;$file" - fi - linker_opts="$linker_opts -LIBPATH:$file" -} - -# func_cl_dashl library -# Do a library search-path lookup for cl -func_cl_dashl () -{ - lib=$1 - found=no - save_IFS=$IFS - IFS=';' - for dir in $lib_path $LIB - do - IFS=$save_IFS - if $shared && test -f "$dir/$lib.dll.lib"; then - found=yes - lib=$dir/$lib.dll.lib - break - fi - if test -f "$dir/$lib.lib"; then - found=yes - lib=$dir/$lib.lib - break - fi - if test -f "$dir/lib$lib.a"; then - found=yes - lib=$dir/lib$lib.a - break - fi - done - IFS=$save_IFS - - if test "$found" != yes; then - lib=$lib.lib - fi -} - -# func_cl_wrapper cl arg... -# Adjust compile command to suit cl -func_cl_wrapper () -{ - # Assume a capable shell - lib_path= - shared=: - linker_opts= - for arg - do - if test -n "$eat"; then - eat= - else - case $1 in - -o) - # configure might choose to run compile as 'compile cc -o foo foo.c'. - eat=1 - case $2 in - *.o | *.[oO][bB][jJ]) - func_file_conv "$2" - set x "$@" -Fo"$file" - shift - ;; - *) - func_file_conv "$2" - set x "$@" -Fe"$file" - shift - ;; - esac - ;; - -I) - eat=1 - func_file_conv "$2" mingw - set x "$@" -I"$file" - shift - ;; - -I*) - func_file_conv "${1#-I}" mingw - set x "$@" -I"$file" - shift - ;; - -l) - eat=1 - func_cl_dashl "$2" - set x "$@" "$lib" - shift - ;; - -l*) - func_cl_dashl "${1#-l}" - set x "$@" "$lib" - shift - ;; - -L) - eat=1 - func_cl_dashL "$2" - ;; - -L*) - func_cl_dashL "${1#-L}" - ;; - -static) - shared=false - ;; - -Wl,*) - arg=${1#-Wl,} - save_ifs="$IFS"; IFS=',' - for flag in $arg; do - IFS="$save_ifs" - linker_opts="$linker_opts $flag" - done - IFS="$save_ifs" - ;; - -Xlinker) - eat=1 - linker_opts="$linker_opts $2" - ;; - -*) - set x "$@" "$1" - shift - ;; - *.cc | *.CC | *.cxx | *.CXX | *.[cC]++) - func_file_conv "$1" - set x "$@" -Tp"$file" - shift - ;; - *.c | *.cpp | *.CPP | *.lib | *.LIB | *.Lib | *.OBJ | *.obj | *.[oO]) - func_file_conv "$1" mingw - set x "$@" "$file" - shift - ;; - *) - set x "$@" "$1" - shift - ;; - esac - fi - shift - done - if test -n "$linker_opts"; then - linker_opts="-link$linker_opts" - fi - exec "$@" $linker_opts - exit 1 -} - -eat= - -case $1 in - '') - echo "$0: No command. Try '$0 --help' for more information." 1>&2 - exit 1; - ;; - -h | --h*) - cat <<\EOF -Usage: compile [--help] [--version] PROGRAM [ARGS] - -Wrapper for compilers which do not understand '-c -o'. -Remove '-o dest.o' from ARGS, run PROGRAM with the remaining -arguments, and rename the output as expected. - -If you are trying to build a whole package this is not the -right script to run: please start by reading the file 'INSTALL'. - -Report bugs to . -EOF - exit $? - ;; - -v | --v*) - echo "compile $scriptversion" - exit $? - ;; - cl | *[/\\]cl | cl.exe | *[/\\]cl.exe | \ - icl | *[/\\]icl | icl.exe | *[/\\]icl.exe ) - func_cl_wrapper "$@" # Doesn't return... - ;; -esac - -ofile= -cfile= - -for arg -do - if test -n "$eat"; then - eat= - else - case $1 in - -o) - # configure might choose to run compile as 'compile cc -o foo foo.c'. - # So we strip '-o arg' only if arg is an object. - eat=1 - case $2 in - *.o | *.obj) - ofile=$2 - ;; - *) - set x "$@" -o "$2" - shift - ;; - esac - ;; - *.c) - cfile=$1 - set x "$@" "$1" - shift - ;; - *) - set x "$@" "$1" - shift - ;; - esac - fi - shift -done - -if test -z "$ofile" || test -z "$cfile"; then - # If no '-o' option was seen then we might have been invoked from a - # pattern rule where we don't need one. That is ok -- this is a - # normal compilation that the losing compiler can handle. If no - # '.c' file was seen then we are probably linking. That is also - # ok. - exec "$@" -fi - -# Name of file we expect compiler to create. -cofile=`echo "$cfile" | sed 's|^.*[\\/]||; s|^[a-zA-Z]:||; s/\.c$/.o/'` - -# Create the lock directory. -# Note: use '[/\\:.-]' here to ensure that we don't use the same name -# that we are using for the .o file. Also, base the name on the expected -# object file name, since that is what matters with a parallel build. -lockdir=`echo "$cofile" | sed -e 's|[/\\:.-]|_|g'`.d -while true; do - if mkdir "$lockdir" >/dev/null 2>&1; then - break - fi - sleep 1 -done -# FIXME: race condition here if user kills between mkdir and trap. -trap "rmdir '$lockdir'; exit 1" 1 2 15 - -# Run the compile. -"$@" -ret=$? - -if test -f "$cofile"; then - test "$cofile" = "$ofile" || mv "$cofile" "$ofile" -elif test -f "${cofile}bj"; then - test "${cofile}bj" = "$ofile" || mv "${cofile}bj" "$ofile" -fi - -rmdir "$lockdir" -exit $ret - -# Local Variables: -# mode: shell-script -# sh-indentation: 2 -# eval: (add-hook 'before-save-hook 'time-stamp) -# time-stamp-start: "scriptversion=" -# time-stamp-format: "%:y-%02m-%02d.%02H" -# time-stamp-time-zone: "UTC0" -# time-stamp-end: "; # UTC" -# End: diff --git a/extra/protobuf/protobuf-3.19.4/compiler_config_setting.bzl b/extra/protobuf/protobuf-3.19.4/compiler_config_setting.bzl deleted file mode 100644 index f4d1f7b9ef4a..000000000000 --- a/extra/protobuf/protobuf-3.19.4/compiler_config_setting.bzl +++ /dev/null @@ -1,23 +0,0 @@ -"""Creates config_setting that allows selecting based on 'compiler' value.""" - -def create_compiler_config_setting(name, value, visibility = None): - # The "do_not_use_tools_cpp_compiler_present" attribute exists to - # distinguish between older versions of Bazel that do not support - # "@bazel_tools//tools/cpp:compiler" flag_value, and newer ones that do. - # In the future, the only way to select on the compiler will be through - # flag_values{"@bazel_tools//tools/cpp:compiler"} and the else branch can - # be removed. - if hasattr(cc_common, "do_not_use_tools_cpp_compiler_present"): - native.config_setting( - name = name, - flag_values = { - "@bazel_tools//tools/cpp:compiler": value, - }, - visibility = visibility, - ) - else: - native.config_setting( - name = name, - values = {"compiler": value}, - visibility = visibility, - ) diff --git a/extra/protobuf/protobuf-3.19.4/config.guess b/extra/protobuf/protobuf-3.19.4/config.guess deleted file mode 100755 index f50dcdb6de2a..000000000000 --- a/extra/protobuf/protobuf-3.19.4/config.guess +++ /dev/null @@ -1,1480 +0,0 @@ -#! /bin/sh -# Attempt to guess a canonical system name. -# Copyright 1992-2018 Free Software Foundation, Inc. - -timestamp='2018-02-24' - -# This file is free software; you can redistribute it and/or modify it -# under the terms of the GNU General Public License as published by -# the Free Software Foundation; either version 3 of the License, or -# (at your option) any later version. -# -# This program is distributed in the hope that it will be useful, but -# WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -# General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with this program; if not, see . -# -# As a special exception to the GNU General Public License, if you -# distribute this file as part of a program that contains a -# configuration script generated by Autoconf, you may include it under -# the same distribution terms that you use for the rest of that -# program. This Exception is an additional permission under section 7 -# of the GNU General Public License, version 3 ("GPLv3"). -# -# Originally written by Per Bothner; maintained since 2000 by Ben Elliston. -# -# You can get the latest version of this script from: -# https://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.guess -# -# Please send patches to . - - -me=`echo "$0" | sed -e 's,.*/,,'` - -usage="\ -Usage: $0 [OPTION] - -Output the configuration name of the system \`$me' is run on. - -Options: - -h, --help print this help, then exit - -t, --time-stamp print date of last modification, then exit - -v, --version print version number, then exit - -Report bugs and patches to ." - -version="\ -GNU config.guess ($timestamp) - -Originally written by Per Bothner. -Copyright 1992-2018 Free Software Foundation, Inc. - -This is free software; see the source for copying conditions. There is NO -warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE." - -help=" -Try \`$me --help' for more information." - -# Parse command line -while test $# -gt 0 ; do - case $1 in - --time-stamp | --time* | -t ) - echo "$timestamp" ; exit ;; - --version | -v ) - echo "$version" ; exit ;; - --help | --h* | -h ) - echo "$usage"; exit ;; - -- ) # Stop option processing - shift; break ;; - - ) # Use stdin as input. - break ;; - -* ) - echo "$me: invalid option $1$help" >&2 - exit 1 ;; - * ) - break ;; - esac -done - -if test $# != 0; then - echo "$me: too many arguments$help" >&2 - exit 1 -fi - -trap 'exit 1' 1 2 15 - -# CC_FOR_BUILD -- compiler used by this script. Note that the use of a -# compiler to aid in system detection is discouraged as it requires -# temporary files to be created and, as you can see below, it is a -# headache to deal with in a portable fashion. - -# Historically, `CC_FOR_BUILD' used to be named `HOST_CC'. We still -# use `HOST_CC' if defined, but it is deprecated. - -# Portable tmp directory creation inspired by the Autoconf team. - -set_cc_for_build=' -trap "exitcode=\$?; (rm -f \$tmpfiles 2>/dev/null; rmdir \$tmp 2>/dev/null) && exit \$exitcode" 0 ; -trap "rm -f \$tmpfiles 2>/dev/null; rmdir \$tmp 2>/dev/null; exit 1" 1 2 13 15 ; -: ${TMPDIR=/tmp} ; - { tmp=`(umask 077 && mktemp -d "$TMPDIR/cgXXXXXX") 2>/dev/null` && test -n "$tmp" && test -d "$tmp" ; } || - { test -n "$RANDOM" && tmp=$TMPDIR/cg$$-$RANDOM && (umask 077 && mkdir $tmp) ; } || - { tmp=$TMPDIR/cg-$$ && (umask 077 && mkdir $tmp) && echo "Warning: creating insecure temp directory" >&2 ; } || - { echo "$me: cannot create a temporary directory in $TMPDIR" >&2 ; exit 1 ; } ; -dummy=$tmp/dummy ; -tmpfiles="$dummy.c $dummy.o $dummy.rel $dummy" ; -case $CC_FOR_BUILD,$HOST_CC,$CC in - ,,) echo "int x;" > "$dummy.c" ; - for c in cc gcc c89 c99 ; do - if ($c -c -o "$dummy.o" "$dummy.c") >/dev/null 2>&1 ; then - CC_FOR_BUILD="$c"; break ; - fi ; - done ; - if test x"$CC_FOR_BUILD" = x ; then - CC_FOR_BUILD=no_compiler_found ; - fi - ;; - ,,*) CC_FOR_BUILD=$CC ;; - ,*,*) CC_FOR_BUILD=$HOST_CC ;; -esac ; set_cc_for_build= ;' - -# This is needed to find uname on a Pyramid OSx when run in the BSD universe. -# (ghazi@noc.rutgers.edu 1994-08-24) -if (test -f /.attbin/uname) >/dev/null 2>&1 ; then - PATH=$PATH:/.attbin ; export PATH -fi - -UNAME_MACHINE=`(uname -m) 2>/dev/null` || UNAME_MACHINE=unknown -UNAME_RELEASE=`(uname -r) 2>/dev/null` || UNAME_RELEASE=unknown -UNAME_SYSTEM=`(uname -s) 2>/dev/null` || UNAME_SYSTEM=unknown -UNAME_VERSION=`(uname -v) 2>/dev/null` || UNAME_VERSION=unknown - -case "$UNAME_SYSTEM" in -Linux|GNU|GNU/*) - # If the system lacks a compiler, then just pick glibc. - # We could probably try harder. - LIBC=gnu - - eval "$set_cc_for_build" - cat <<-EOF > "$dummy.c" - #include - #if defined(__UCLIBC__) - LIBC=uclibc - #elif defined(__dietlibc__) - LIBC=dietlibc - #else - LIBC=gnu - #endif - EOF - eval "`$CC_FOR_BUILD -E "$dummy.c" 2>/dev/null | grep '^LIBC' | sed 's, ,,g'`" - - # If ldd exists, use it to detect musl libc. - if command -v ldd >/dev/null && \ - ldd --version 2>&1 | grep -q ^musl - then - LIBC=musl - fi - ;; -esac - -# Note: order is significant - the case branches are not exclusive. - -case "$UNAME_MACHINE:$UNAME_SYSTEM:$UNAME_RELEASE:$UNAME_VERSION" in - *:NetBSD:*:*) - # NetBSD (nbsd) targets should (where applicable) match one or - # more of the tuples: *-*-netbsdelf*, *-*-netbsdaout*, - # *-*-netbsdecoff* and *-*-netbsd*. For targets that recently - # switched to ELF, *-*-netbsd* would select the old - # object file format. This provides both forward - # compatibility and a consistent mechanism for selecting the - # object file format. - # - # Note: NetBSD doesn't particularly care about the vendor - # portion of the name. We always set it to "unknown". - sysctl="sysctl -n hw.machine_arch" - UNAME_MACHINE_ARCH=`(uname -p 2>/dev/null || \ - "/sbin/$sysctl" 2>/dev/null || \ - "/usr/sbin/$sysctl" 2>/dev/null || \ - echo unknown)` - case "$UNAME_MACHINE_ARCH" in - armeb) machine=armeb-unknown ;; - arm*) machine=arm-unknown ;; - sh3el) machine=shl-unknown ;; - sh3eb) machine=sh-unknown ;; - sh5el) machine=sh5le-unknown ;; - earmv*) - arch=`echo "$UNAME_MACHINE_ARCH" | sed -e 's,^e\(armv[0-9]\).*$,\1,'` - endian=`echo "$UNAME_MACHINE_ARCH" | sed -ne 's,^.*\(eb\)$,\1,p'` - machine="${arch}${endian}"-unknown - ;; - *) machine="$UNAME_MACHINE_ARCH"-unknown ;; - esac - # The Operating System including object format, if it has switched - # to ELF recently (or will in the future) and ABI. - case "$UNAME_MACHINE_ARCH" in - earm*) - os=netbsdelf - ;; - arm*|i386|m68k|ns32k|sh3*|sparc|vax) - eval "$set_cc_for_build" - if echo __ELF__ | $CC_FOR_BUILD -E - 2>/dev/null \ - | grep -q __ELF__ - then - # Once all utilities can be ECOFF (netbsdecoff) or a.out (netbsdaout). - # Return netbsd for either. FIX? - os=netbsd - else - os=netbsdelf - fi - ;; - *) - os=netbsd - ;; - esac - # Determine ABI tags. - case "$UNAME_MACHINE_ARCH" in - earm*) - expr='s/^earmv[0-9]/-eabi/;s/eb$//' - abi=`echo "$UNAME_MACHINE_ARCH" | sed -e "$expr"` - ;; - esac - # The OS release - # Debian GNU/NetBSD machines have a different userland, and - # thus, need a distinct triplet. However, they do not need - # kernel version information, so it can be replaced with a - # suitable tag, in the style of linux-gnu. - case "$UNAME_VERSION" in - Debian*) - release='-gnu' - ;; - *) - release=`echo "$UNAME_RELEASE" | sed -e 's/[-_].*//' | cut -d. -f1,2` - ;; - esac - # Since CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM: - # contains redundant information, the shorter form: - # CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM is used. - echo "$machine-${os}${release}${abi}" - exit ;; - *:Bitrig:*:*) - UNAME_MACHINE_ARCH=`arch | sed 's/Bitrig.//'` - echo "$UNAME_MACHINE_ARCH"-unknown-bitrig"$UNAME_RELEASE" - exit ;; - *:OpenBSD:*:*) - UNAME_MACHINE_ARCH=`arch | sed 's/OpenBSD.//'` - echo "$UNAME_MACHINE_ARCH"-unknown-openbsd"$UNAME_RELEASE" - exit ;; - *:LibertyBSD:*:*) - UNAME_MACHINE_ARCH=`arch | sed 's/^.*BSD\.//'` - echo "$UNAME_MACHINE_ARCH"-unknown-libertybsd"$UNAME_RELEASE" - exit ;; - *:MidnightBSD:*:*) - echo "$UNAME_MACHINE"-unknown-midnightbsd"$UNAME_RELEASE" - exit ;; - *:ekkoBSD:*:*) - echo "$UNAME_MACHINE"-unknown-ekkobsd"$UNAME_RELEASE" - exit ;; - *:SolidBSD:*:*) - echo "$UNAME_MACHINE"-unknown-solidbsd"$UNAME_RELEASE" - exit ;; - macppc:MirBSD:*:*) - echo powerpc-unknown-mirbsd"$UNAME_RELEASE" - exit ;; - *:MirBSD:*:*) - echo "$UNAME_MACHINE"-unknown-mirbsd"$UNAME_RELEASE" - exit ;; - *:Sortix:*:*) - echo "$UNAME_MACHINE"-unknown-sortix - exit ;; - *:Redox:*:*) - echo "$UNAME_MACHINE"-unknown-redox - exit ;; - mips:OSF1:*.*) - echo mips-dec-osf1 - exit ;; - alpha:OSF1:*:*) - case $UNAME_RELEASE in - *4.0) - UNAME_RELEASE=`/usr/sbin/sizer -v | awk '{print $3}'` - ;; - *5.*) - UNAME_RELEASE=`/usr/sbin/sizer -v | awk '{print $4}'` - ;; - esac - # According to Compaq, /usr/sbin/psrinfo has been available on - # OSF/1 and Tru64 systems produced since 1995. I hope that - # covers most systems running today. This code pipes the CPU - # types through head -n 1, so we only detect the type of CPU 0. - ALPHA_CPU_TYPE=`/usr/sbin/psrinfo -v | sed -n -e 's/^ The alpha \(.*\) processor.*$/\1/p' | head -n 1` - case "$ALPHA_CPU_TYPE" in - "EV4 (21064)") - UNAME_MACHINE=alpha ;; - "EV4.5 (21064)") - UNAME_MACHINE=alpha ;; - "LCA4 (21066/21068)") - UNAME_MACHINE=alpha ;; - "EV5 (21164)") - UNAME_MACHINE=alphaev5 ;; - "EV5.6 (21164A)") - UNAME_MACHINE=alphaev56 ;; - "EV5.6 (21164PC)") - UNAME_MACHINE=alphapca56 ;; - "EV5.7 (21164PC)") - UNAME_MACHINE=alphapca57 ;; - "EV6 (21264)") - UNAME_MACHINE=alphaev6 ;; - "EV6.7 (21264A)") - UNAME_MACHINE=alphaev67 ;; - "EV6.8CB (21264C)") - UNAME_MACHINE=alphaev68 ;; - "EV6.8AL (21264B)") - UNAME_MACHINE=alphaev68 ;; - "EV6.8CX (21264D)") - UNAME_MACHINE=alphaev68 ;; - "EV6.9A (21264/EV69A)") - UNAME_MACHINE=alphaev69 ;; - "EV7 (21364)") - UNAME_MACHINE=alphaev7 ;; - "EV7.9 (21364A)") - UNAME_MACHINE=alphaev79 ;; - esac - # A Pn.n version is a patched version. - # A Vn.n version is a released version. - # A Tn.n version is a released field test version. - # A Xn.n version is an unreleased experimental baselevel. - # 1.2 uses "1.2" for uname -r. - echo "$UNAME_MACHINE"-dec-osf"`echo "$UNAME_RELEASE" | sed -e 's/^[PVTX]//' | tr ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijklmnopqrstuvwxyz`" - # Reset EXIT trap before exiting to avoid spurious non-zero exit code. - exitcode=$? - trap '' 0 - exit $exitcode ;; - Amiga*:UNIX_System_V:4.0:*) - echo m68k-unknown-sysv4 - exit ;; - *:[Aa]miga[Oo][Ss]:*:*) - echo "$UNAME_MACHINE"-unknown-amigaos - exit ;; - *:[Mm]orph[Oo][Ss]:*:*) - echo "$UNAME_MACHINE"-unknown-morphos - exit ;; - *:OS/390:*:*) - echo i370-ibm-openedition - exit ;; - *:z/VM:*:*) - echo s390-ibm-zvmoe - exit ;; - *:OS400:*:*) - echo powerpc-ibm-os400 - exit ;; - arm:RISC*:1.[012]*:*|arm:riscix:1.[012]*:*) - echo arm-acorn-riscix"$UNAME_RELEASE" - exit ;; - arm*:riscos:*:*|arm*:RISCOS:*:*) - echo arm-unknown-riscos - exit ;; - SR2?01:HI-UX/MPP:*:* | SR8000:HI-UX/MPP:*:*) - echo hppa1.1-hitachi-hiuxmpp - exit ;; - Pyramid*:OSx*:*:* | MIS*:OSx*:*:* | MIS*:SMP_DC-OSx*:*:*) - # akee@wpdis03.wpafb.af.mil (Earle F. Ake) contributed MIS and NILE. - if test "`(/bin/universe) 2>/dev/null`" = att ; then - echo pyramid-pyramid-sysv3 - else - echo pyramid-pyramid-bsd - fi - exit ;; - NILE*:*:*:dcosx) - echo pyramid-pyramid-svr4 - exit ;; - DRS?6000:unix:4.0:6*) - echo sparc-icl-nx6 - exit ;; - DRS?6000:UNIX_SV:4.2*:7* | DRS?6000:isis:4.2*:7*) - case `/usr/bin/uname -p` in - sparc) echo sparc-icl-nx7; exit ;; - esac ;; - s390x:SunOS:*:*) - echo "$UNAME_MACHINE"-ibm-solaris2"`echo "$UNAME_RELEASE" | sed -e 's/[^.]*//'`" - exit ;; - sun4H:SunOS:5.*:*) - echo sparc-hal-solaris2"`echo "$UNAME_RELEASE"|sed -e 's/[^.]*//'`" - exit ;; - sun4*:SunOS:5.*:* | tadpole*:SunOS:5.*:*) - echo sparc-sun-solaris2"`echo "$UNAME_RELEASE" | sed -e 's/[^.]*//'`" - exit ;; - i86pc:AuroraUX:5.*:* | i86xen:AuroraUX:5.*:*) - echo i386-pc-auroraux"$UNAME_RELEASE" - exit ;; - i86pc:SunOS:5.*:* | i86xen:SunOS:5.*:*) - eval "$set_cc_for_build" - SUN_ARCH=i386 - # If there is a compiler, see if it is configured for 64-bit objects. - # Note that the Sun cc does not turn __LP64__ into 1 like gcc does. - # This test works for both compilers. - if [ "$CC_FOR_BUILD" != no_compiler_found ]; then - if (echo '#ifdef __amd64'; echo IS_64BIT_ARCH; echo '#endif') | \ - (CCOPTS="" $CC_FOR_BUILD -E - 2>/dev/null) | \ - grep IS_64BIT_ARCH >/dev/null - then - SUN_ARCH=x86_64 - fi - fi - echo "$SUN_ARCH"-pc-solaris2"`echo "$UNAME_RELEASE"|sed -e 's/[^.]*//'`" - exit ;; - sun4*:SunOS:6*:*) - # According to config.sub, this is the proper way to canonicalize - # SunOS6. Hard to guess exactly what SunOS6 will be like, but - # it's likely to be more like Solaris than SunOS4. - echo sparc-sun-solaris3"`echo "$UNAME_RELEASE"|sed -e 's/[^.]*//'`" - exit ;; - sun4*:SunOS:*:*) - case "`/usr/bin/arch -k`" in - Series*|S4*) - UNAME_RELEASE=`uname -v` - ;; - esac - # Japanese Language versions have a version number like `4.1.3-JL'. - echo sparc-sun-sunos"`echo "$UNAME_RELEASE"|sed -e 's/-/_/'`" - exit ;; - sun3*:SunOS:*:*) - echo m68k-sun-sunos"$UNAME_RELEASE" - exit ;; - sun*:*:4.2BSD:*) - UNAME_RELEASE=`(sed 1q /etc/motd | awk '{print substr($5,1,3)}') 2>/dev/null` - test "x$UNAME_RELEASE" = x && UNAME_RELEASE=3 - case "`/bin/arch`" in - sun3) - echo m68k-sun-sunos"$UNAME_RELEASE" - ;; - sun4) - echo sparc-sun-sunos"$UNAME_RELEASE" - ;; - esac - exit ;; - aushp:SunOS:*:*) - echo sparc-auspex-sunos"$UNAME_RELEASE" - exit ;; - # The situation for MiNT is a little confusing. The machine name - # can be virtually everything (everything which is not - # "atarist" or "atariste" at least should have a processor - # > m68000). The system name ranges from "MiNT" over "FreeMiNT" - # to the lowercase version "mint" (or "freemint"). Finally - # the system name "TOS" denotes a system which is actually not - # MiNT. But MiNT is downward compatible to TOS, so this should - # be no problem. - atarist[e]:*MiNT:*:* | atarist[e]:*mint:*:* | atarist[e]:*TOS:*:*) - echo m68k-atari-mint"$UNAME_RELEASE" - exit ;; - atari*:*MiNT:*:* | atari*:*mint:*:* | atarist[e]:*TOS:*:*) - echo m68k-atari-mint"$UNAME_RELEASE" - exit ;; - *falcon*:*MiNT:*:* | *falcon*:*mint:*:* | *falcon*:*TOS:*:*) - echo m68k-atari-mint"$UNAME_RELEASE" - exit ;; - milan*:*MiNT:*:* | milan*:*mint:*:* | *milan*:*TOS:*:*) - echo m68k-milan-mint"$UNAME_RELEASE" - exit ;; - hades*:*MiNT:*:* | hades*:*mint:*:* | *hades*:*TOS:*:*) - echo m68k-hades-mint"$UNAME_RELEASE" - exit ;; - *:*MiNT:*:* | *:*mint:*:* | *:*TOS:*:*) - echo m68k-unknown-mint"$UNAME_RELEASE" - exit ;; - m68k:machten:*:*) - echo m68k-apple-machten"$UNAME_RELEASE" - exit ;; - powerpc:machten:*:*) - echo powerpc-apple-machten"$UNAME_RELEASE" - exit ;; - RISC*:Mach:*:*) - echo mips-dec-mach_bsd4.3 - exit ;; - RISC*:ULTRIX:*:*) - echo mips-dec-ultrix"$UNAME_RELEASE" - exit ;; - VAX*:ULTRIX*:*:*) - echo vax-dec-ultrix"$UNAME_RELEASE" - exit ;; - 2020:CLIX:*:* | 2430:CLIX:*:*) - echo clipper-intergraph-clix"$UNAME_RELEASE" - exit ;; - mips:*:*:UMIPS | mips:*:*:RISCos) - eval "$set_cc_for_build" - sed 's/^ //' << EOF > "$dummy.c" -#ifdef __cplusplus -#include /* for printf() prototype */ - int main (int argc, char *argv[]) { -#else - int main (argc, argv) int argc; char *argv[]; { -#endif - #if defined (host_mips) && defined (MIPSEB) - #if defined (SYSTYPE_SYSV) - printf ("mips-mips-riscos%ssysv\\n", argv[1]); exit (0); - #endif - #if defined (SYSTYPE_SVR4) - printf ("mips-mips-riscos%ssvr4\\n", argv[1]); exit (0); - #endif - #if defined (SYSTYPE_BSD43) || defined(SYSTYPE_BSD) - printf ("mips-mips-riscos%sbsd\\n", argv[1]); exit (0); - #endif - #endif - exit (-1); - } -EOF - $CC_FOR_BUILD -o "$dummy" "$dummy.c" && - dummyarg=`echo "$UNAME_RELEASE" | sed -n 's/\([0-9]*\).*/\1/p'` && - SYSTEM_NAME=`"$dummy" "$dummyarg"` && - { echo "$SYSTEM_NAME"; exit; } - echo mips-mips-riscos"$UNAME_RELEASE" - exit ;; - Motorola:PowerMAX_OS:*:*) - echo powerpc-motorola-powermax - exit ;; - Motorola:*:4.3:PL8-*) - echo powerpc-harris-powermax - exit ;; - Night_Hawk:*:*:PowerMAX_OS | Synergy:PowerMAX_OS:*:*) - echo powerpc-harris-powermax - exit ;; - Night_Hawk:Power_UNIX:*:*) - echo powerpc-harris-powerunix - exit ;; - m88k:CX/UX:7*:*) - echo m88k-harris-cxux7 - exit ;; - m88k:*:4*:R4*) - echo m88k-motorola-sysv4 - exit ;; - m88k:*:3*:R3*) - echo m88k-motorola-sysv3 - exit ;; - AViiON:dgux:*:*) - # DG/UX returns AViiON for all architectures - UNAME_PROCESSOR=`/usr/bin/uname -p` - if [ "$UNAME_PROCESSOR" = mc88100 ] || [ "$UNAME_PROCESSOR" = mc88110 ] - then - if [ "$TARGET_BINARY_INTERFACE"x = m88kdguxelfx ] || \ - [ "$TARGET_BINARY_INTERFACE"x = x ] - then - echo m88k-dg-dgux"$UNAME_RELEASE" - else - echo m88k-dg-dguxbcs"$UNAME_RELEASE" - fi - else - echo i586-dg-dgux"$UNAME_RELEASE" - fi - exit ;; - M88*:DolphinOS:*:*) # DolphinOS (SVR3) - echo m88k-dolphin-sysv3 - exit ;; - M88*:*:R3*:*) - # Delta 88k system running SVR3 - echo m88k-motorola-sysv3 - exit ;; - XD88*:*:*:*) # Tektronix XD88 system running UTekV (SVR3) - echo m88k-tektronix-sysv3 - exit ;; - Tek43[0-9][0-9]:UTek:*:*) # Tektronix 4300 system running UTek (BSD) - echo m68k-tektronix-bsd - exit ;; - *:IRIX*:*:*) - echo mips-sgi-irix"`echo "$UNAME_RELEASE"|sed -e 's/-/_/g'`" - exit ;; - ????????:AIX?:[12].1:2) # AIX 2.2.1 or AIX 2.1.1 is RT/PC AIX. - echo romp-ibm-aix # uname -m gives an 8 hex-code CPU id - exit ;; # Note that: echo "'`uname -s`'" gives 'AIX ' - i*86:AIX:*:*) - echo i386-ibm-aix - exit ;; - ia64:AIX:*:*) - if [ -x /usr/bin/oslevel ] ; then - IBM_REV=`/usr/bin/oslevel` - else - IBM_REV="$UNAME_VERSION.$UNAME_RELEASE" - fi - echo "$UNAME_MACHINE"-ibm-aix"$IBM_REV" - exit ;; - *:AIX:2:3) - if grep bos325 /usr/include/stdio.h >/dev/null 2>&1; then - eval "$set_cc_for_build" - sed 's/^ //' << EOF > "$dummy.c" - #include - - main() - { - if (!__power_pc()) - exit(1); - puts("powerpc-ibm-aix3.2.5"); - exit(0); - } -EOF - if $CC_FOR_BUILD -o "$dummy" "$dummy.c" && SYSTEM_NAME=`"$dummy"` - then - echo "$SYSTEM_NAME" - else - echo rs6000-ibm-aix3.2.5 - fi - elif grep bos324 /usr/include/stdio.h >/dev/null 2>&1; then - echo rs6000-ibm-aix3.2.4 - else - echo rs6000-ibm-aix3.2 - fi - exit ;; - *:AIX:*:[4567]) - IBM_CPU_ID=`/usr/sbin/lsdev -C -c processor -S available | sed 1q | awk '{ print $1 }'` - if /usr/sbin/lsattr -El "$IBM_CPU_ID" | grep ' POWER' >/dev/null 2>&1; then - IBM_ARCH=rs6000 - else - IBM_ARCH=powerpc - fi - if [ -x /usr/bin/lslpp ] ; then - IBM_REV=`/usr/bin/lslpp -Lqc bos.rte.libc | - awk -F: '{ print $3 }' | sed s/[0-9]*$/0/` - else - IBM_REV="$UNAME_VERSION.$UNAME_RELEASE" - fi - echo "$IBM_ARCH"-ibm-aix"$IBM_REV" - exit ;; - *:AIX:*:*) - echo rs6000-ibm-aix - exit ;; - ibmrt:4.4BSD:*|romp-ibm:4.4BSD:*) - echo romp-ibm-bsd4.4 - exit ;; - ibmrt:*BSD:*|romp-ibm:BSD:*) # covers RT/PC BSD and - echo romp-ibm-bsd"$UNAME_RELEASE" # 4.3 with uname added to - exit ;; # report: romp-ibm BSD 4.3 - *:BOSX:*:*) - echo rs6000-bull-bosx - exit ;; - DPX/2?00:B.O.S.:*:*) - echo m68k-bull-sysv3 - exit ;; - 9000/[34]??:4.3bsd:1.*:*) - echo m68k-hp-bsd - exit ;; - hp300:4.4BSD:*:* | 9000/[34]??:4.3bsd:2.*:*) - echo m68k-hp-bsd4.4 - exit ;; - 9000/[34678]??:HP-UX:*:*) - HPUX_REV=`echo "$UNAME_RELEASE"|sed -e 's/[^.]*.[0B]*//'` - case "$UNAME_MACHINE" in - 9000/31?) HP_ARCH=m68000 ;; - 9000/[34]??) HP_ARCH=m68k ;; - 9000/[678][0-9][0-9]) - if [ -x /usr/bin/getconf ]; then - sc_cpu_version=`/usr/bin/getconf SC_CPU_VERSION 2>/dev/null` - sc_kernel_bits=`/usr/bin/getconf SC_KERNEL_BITS 2>/dev/null` - case "$sc_cpu_version" in - 523) HP_ARCH=hppa1.0 ;; # CPU_PA_RISC1_0 - 528) HP_ARCH=hppa1.1 ;; # CPU_PA_RISC1_1 - 532) # CPU_PA_RISC2_0 - case "$sc_kernel_bits" in - 32) HP_ARCH=hppa2.0n ;; - 64) HP_ARCH=hppa2.0w ;; - '') HP_ARCH=hppa2.0 ;; # HP-UX 10.20 - esac ;; - esac - fi - if [ "$HP_ARCH" = "" ]; then - eval "$set_cc_for_build" - sed 's/^ //' << EOF > "$dummy.c" - - #define _HPUX_SOURCE - #include - #include - - int main () - { - #if defined(_SC_KERNEL_BITS) - long bits = sysconf(_SC_KERNEL_BITS); - #endif - long cpu = sysconf (_SC_CPU_VERSION); - - switch (cpu) - { - case CPU_PA_RISC1_0: puts ("hppa1.0"); break; - case CPU_PA_RISC1_1: puts ("hppa1.1"); break; - case CPU_PA_RISC2_0: - #if defined(_SC_KERNEL_BITS) - switch (bits) - { - case 64: puts ("hppa2.0w"); break; - case 32: puts ("hppa2.0n"); break; - default: puts ("hppa2.0"); break; - } break; - #else /* !defined(_SC_KERNEL_BITS) */ - puts ("hppa2.0"); break; - #endif - default: puts ("hppa1.0"); break; - } - exit (0); - } -EOF - (CCOPTS="" $CC_FOR_BUILD -o "$dummy" "$dummy.c" 2>/dev/null) && HP_ARCH=`"$dummy"` - test -z "$HP_ARCH" && HP_ARCH=hppa - fi ;; - esac - if [ "$HP_ARCH" = hppa2.0w ] - then - eval "$set_cc_for_build" - - # hppa2.0w-hp-hpux* has a 64-bit kernel and a compiler generating - # 32-bit code. hppa64-hp-hpux* has the same kernel and a compiler - # generating 64-bit code. GNU and HP use different nomenclature: - # - # $ CC_FOR_BUILD=cc ./config.guess - # => hppa2.0w-hp-hpux11.23 - # $ CC_FOR_BUILD="cc +DA2.0w" ./config.guess - # => hppa64-hp-hpux11.23 - - if echo __LP64__ | (CCOPTS="" $CC_FOR_BUILD -E - 2>/dev/null) | - grep -q __LP64__ - then - HP_ARCH=hppa2.0w - else - HP_ARCH=hppa64 - fi - fi - echo "$HP_ARCH"-hp-hpux"$HPUX_REV" - exit ;; - ia64:HP-UX:*:*) - HPUX_REV=`echo "$UNAME_RELEASE"|sed -e 's/[^.]*.[0B]*//'` - echo ia64-hp-hpux"$HPUX_REV" - exit ;; - 3050*:HI-UX:*:*) - eval "$set_cc_for_build" - sed 's/^ //' << EOF > "$dummy.c" - #include - int - main () - { - long cpu = sysconf (_SC_CPU_VERSION); - /* The order matters, because CPU_IS_HP_MC68K erroneously returns - true for CPU_PA_RISC1_0. CPU_IS_PA_RISC returns correct - results, however. */ - if (CPU_IS_PA_RISC (cpu)) - { - switch (cpu) - { - case CPU_PA_RISC1_0: puts ("hppa1.0-hitachi-hiuxwe2"); break; - case CPU_PA_RISC1_1: puts ("hppa1.1-hitachi-hiuxwe2"); break; - case CPU_PA_RISC2_0: puts ("hppa2.0-hitachi-hiuxwe2"); break; - default: puts ("hppa-hitachi-hiuxwe2"); break; - } - } - else if (CPU_IS_HP_MC68K (cpu)) - puts ("m68k-hitachi-hiuxwe2"); - else puts ("unknown-hitachi-hiuxwe2"); - exit (0); - } -EOF - $CC_FOR_BUILD -o "$dummy" "$dummy.c" && SYSTEM_NAME=`"$dummy"` && - { echo "$SYSTEM_NAME"; exit; } - echo unknown-hitachi-hiuxwe2 - exit ;; - 9000/7??:4.3bsd:*:* | 9000/8?[79]:4.3bsd:*:*) - echo hppa1.1-hp-bsd - exit ;; - 9000/8??:4.3bsd:*:*) - echo hppa1.0-hp-bsd - exit ;; - *9??*:MPE/iX:*:* | *3000*:MPE/iX:*:*) - echo hppa1.0-hp-mpeix - exit ;; - hp7??:OSF1:*:* | hp8?[79]:OSF1:*:*) - echo hppa1.1-hp-osf - exit ;; - hp8??:OSF1:*:*) - echo hppa1.0-hp-osf - exit ;; - i*86:OSF1:*:*) - if [ -x /usr/sbin/sysversion ] ; then - echo "$UNAME_MACHINE"-unknown-osf1mk - else - echo "$UNAME_MACHINE"-unknown-osf1 - fi - exit ;; - parisc*:Lites*:*:*) - echo hppa1.1-hp-lites - exit ;; - C1*:ConvexOS:*:* | convex:ConvexOS:C1*:*) - echo c1-convex-bsd - exit ;; - C2*:ConvexOS:*:* | convex:ConvexOS:C2*:*) - if getsysinfo -f scalar_acc - then echo c32-convex-bsd - else echo c2-convex-bsd - fi - exit ;; - C34*:ConvexOS:*:* | convex:ConvexOS:C34*:*) - echo c34-convex-bsd - exit ;; - C38*:ConvexOS:*:* | convex:ConvexOS:C38*:*) - echo c38-convex-bsd - exit ;; - C4*:ConvexOS:*:* | convex:ConvexOS:C4*:*) - echo c4-convex-bsd - exit ;; - CRAY*Y-MP:*:*:*) - echo ymp-cray-unicos"$UNAME_RELEASE" | sed -e 's/\.[^.]*$/.X/' - exit ;; - CRAY*[A-Z]90:*:*:*) - echo "$UNAME_MACHINE"-cray-unicos"$UNAME_RELEASE" \ - | sed -e 's/CRAY.*\([A-Z]90\)/\1/' \ - -e y/ABCDEFGHIJKLMNOPQRSTUVWXYZ/abcdefghijklmnopqrstuvwxyz/ \ - -e 's/\.[^.]*$/.X/' - exit ;; - CRAY*TS:*:*:*) - echo t90-cray-unicos"$UNAME_RELEASE" | sed -e 's/\.[^.]*$/.X/' - exit ;; - CRAY*T3E:*:*:*) - echo alphaev5-cray-unicosmk"$UNAME_RELEASE" | sed -e 's/\.[^.]*$/.X/' - exit ;; - CRAY*SV1:*:*:*) - echo sv1-cray-unicos"$UNAME_RELEASE" | sed -e 's/\.[^.]*$/.X/' - exit ;; - *:UNICOS/mp:*:*) - echo craynv-cray-unicosmp"$UNAME_RELEASE" | sed -e 's/\.[^.]*$/.X/' - exit ;; - F30[01]:UNIX_System_V:*:* | F700:UNIX_System_V:*:*) - FUJITSU_PROC=`uname -m | tr ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijklmnopqrstuvwxyz` - FUJITSU_SYS=`uname -p | tr ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijklmnopqrstuvwxyz | sed -e 's/\///'` - FUJITSU_REL=`echo "$UNAME_RELEASE" | sed -e 's/ /_/'` - echo "${FUJITSU_PROC}-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}" - exit ;; - 5000:UNIX_System_V:4.*:*) - FUJITSU_SYS=`uname -p | tr ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijklmnopqrstuvwxyz | sed -e 's/\///'` - FUJITSU_REL=`echo "$UNAME_RELEASE" | tr ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijklmnopqrstuvwxyz | sed -e 's/ /_/'` - echo "sparc-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}" - exit ;; - i*86:BSD/386:*:* | i*86:BSD/OS:*:* | *:Ascend\ Embedded/OS:*:*) - echo "$UNAME_MACHINE"-pc-bsdi"$UNAME_RELEASE" - exit ;; - sparc*:BSD/OS:*:*) - echo sparc-unknown-bsdi"$UNAME_RELEASE" - exit ;; - *:BSD/OS:*:*) - echo "$UNAME_MACHINE"-unknown-bsdi"$UNAME_RELEASE" - exit ;; - *:FreeBSD:*:*) - UNAME_PROCESSOR=`/usr/bin/uname -p` - case "$UNAME_PROCESSOR" in - amd64) - UNAME_PROCESSOR=x86_64 ;; - i386) - UNAME_PROCESSOR=i586 ;; - esac - echo "$UNAME_PROCESSOR"-unknown-freebsd"`echo "$UNAME_RELEASE"|sed -e 's/[-(].*//'`" - exit ;; - i*:CYGWIN*:*) - echo "$UNAME_MACHINE"-pc-cygwin - exit ;; - *:MINGW64*:*) - echo "$UNAME_MACHINE"-pc-mingw64 - exit ;; - *:MINGW*:*) - echo "$UNAME_MACHINE"-pc-mingw32 - exit ;; - *:MSYS*:*) - echo "$UNAME_MACHINE"-pc-msys - exit ;; - i*:PW*:*) - echo "$UNAME_MACHINE"-pc-pw32 - exit ;; - *:Interix*:*) - case "$UNAME_MACHINE" in - x86) - echo i586-pc-interix"$UNAME_RELEASE" - exit ;; - authenticamd | genuineintel | EM64T) - echo x86_64-unknown-interix"$UNAME_RELEASE" - exit ;; - IA64) - echo ia64-unknown-interix"$UNAME_RELEASE" - exit ;; - esac ;; - i*:UWIN*:*) - echo "$UNAME_MACHINE"-pc-uwin - exit ;; - amd64:CYGWIN*:*:* | x86_64:CYGWIN*:*:*) - echo x86_64-unknown-cygwin - exit ;; - prep*:SunOS:5.*:*) - echo powerpcle-unknown-solaris2"`echo "$UNAME_RELEASE"|sed -e 's/[^.]*//'`" - exit ;; - *:GNU:*:*) - # the GNU system - echo "`echo "$UNAME_MACHINE"|sed -e 's,[-/].*$,,'`-unknown-$LIBC`echo "$UNAME_RELEASE"|sed -e 's,/.*$,,'`" - exit ;; - *:GNU/*:*:*) - # other systems with GNU libc and userland - echo "$UNAME_MACHINE-unknown-`echo "$UNAME_SYSTEM" | sed 's,^[^/]*/,,' | tr "[:upper:]" "[:lower:]"``echo "$UNAME_RELEASE"|sed -e 's/[-(].*//'`-$LIBC" - exit ;; - i*86:Minix:*:*) - echo "$UNAME_MACHINE"-pc-minix - exit ;; - aarch64:Linux:*:*) - echo "$UNAME_MACHINE"-unknown-linux-"$LIBC" - exit ;; - aarch64_be:Linux:*:*) - UNAME_MACHINE=aarch64_be - echo "$UNAME_MACHINE"-unknown-linux-"$LIBC" - exit ;; - alpha:Linux:*:*) - case `sed -n '/^cpu model/s/^.*: \(.*\)/\1/p' < /proc/cpuinfo` in - EV5) UNAME_MACHINE=alphaev5 ;; - EV56) UNAME_MACHINE=alphaev56 ;; - PCA56) UNAME_MACHINE=alphapca56 ;; - PCA57) UNAME_MACHINE=alphapca56 ;; - EV6) UNAME_MACHINE=alphaev6 ;; - EV67) UNAME_MACHINE=alphaev67 ;; - EV68*) UNAME_MACHINE=alphaev68 ;; - esac - objdump --private-headers /bin/sh | grep -q ld.so.1 - if test "$?" = 0 ; then LIBC=gnulibc1 ; fi - echo "$UNAME_MACHINE"-unknown-linux-"$LIBC" - exit ;; - arc:Linux:*:* | arceb:Linux:*:*) - echo "$UNAME_MACHINE"-unknown-linux-"$LIBC" - exit ;; - arm*:Linux:*:*) - eval "$set_cc_for_build" - if echo __ARM_EABI__ | $CC_FOR_BUILD -E - 2>/dev/null \ - | grep -q __ARM_EABI__ - then - echo "$UNAME_MACHINE"-unknown-linux-"$LIBC" - else - if echo __ARM_PCS_VFP | $CC_FOR_BUILD -E - 2>/dev/null \ - | grep -q __ARM_PCS_VFP - then - echo "$UNAME_MACHINE"-unknown-linux-"$LIBC"eabi - else - echo "$UNAME_MACHINE"-unknown-linux-"$LIBC"eabihf - fi - fi - exit ;; - avr32*:Linux:*:*) - echo "$UNAME_MACHINE"-unknown-linux-"$LIBC" - exit ;; - cris:Linux:*:*) - echo "$UNAME_MACHINE"-axis-linux-"$LIBC" - exit ;; - crisv32:Linux:*:*) - echo "$UNAME_MACHINE"-axis-linux-"$LIBC" - exit ;; - e2k:Linux:*:*) - echo "$UNAME_MACHINE"-unknown-linux-"$LIBC" - exit ;; - frv:Linux:*:*) - echo "$UNAME_MACHINE"-unknown-linux-"$LIBC" - exit ;; - hexagon:Linux:*:*) - echo "$UNAME_MACHINE"-unknown-linux-"$LIBC" - exit ;; - i*86:Linux:*:*) - echo "$UNAME_MACHINE"-pc-linux-"$LIBC" - exit ;; - ia64:Linux:*:*) - echo "$UNAME_MACHINE"-unknown-linux-"$LIBC" - exit ;; - k1om:Linux:*:*) - echo "$UNAME_MACHINE"-unknown-linux-"$LIBC" - exit ;; - m32r*:Linux:*:*) - echo "$UNAME_MACHINE"-unknown-linux-"$LIBC" - exit ;; - m68*:Linux:*:*) - echo "$UNAME_MACHINE"-unknown-linux-"$LIBC" - exit ;; - mips:Linux:*:* | mips64:Linux:*:*) - eval "$set_cc_for_build" - sed 's/^ //' << EOF > "$dummy.c" - #undef CPU - #undef ${UNAME_MACHINE} - #undef ${UNAME_MACHINE}el - #if defined(__MIPSEL__) || defined(__MIPSEL) || defined(_MIPSEL) || defined(MIPSEL) - CPU=${UNAME_MACHINE}el - #else - #if defined(__MIPSEB__) || defined(__MIPSEB) || defined(_MIPSEB) || defined(MIPSEB) - CPU=${UNAME_MACHINE} - #else - CPU= - #endif - #endif -EOF - eval "`$CC_FOR_BUILD -E "$dummy.c" 2>/dev/null | grep '^CPU'`" - test "x$CPU" != x && { echo "$CPU-unknown-linux-$LIBC"; exit; } - ;; - mips64el:Linux:*:*) - echo "$UNAME_MACHINE"-unknown-linux-"$LIBC" - exit ;; - openrisc*:Linux:*:*) - echo or1k-unknown-linux-"$LIBC" - exit ;; - or32:Linux:*:* | or1k*:Linux:*:*) - echo "$UNAME_MACHINE"-unknown-linux-"$LIBC" - exit ;; - padre:Linux:*:*) - echo sparc-unknown-linux-"$LIBC" - exit ;; - parisc64:Linux:*:* | hppa64:Linux:*:*) - echo hppa64-unknown-linux-"$LIBC" - exit ;; - parisc:Linux:*:* | hppa:Linux:*:*) - # Look for CPU level - case `grep '^cpu[^a-z]*:' /proc/cpuinfo 2>/dev/null | cut -d' ' -f2` in - PA7*) echo hppa1.1-unknown-linux-"$LIBC" ;; - PA8*) echo hppa2.0-unknown-linux-"$LIBC" ;; - *) echo hppa-unknown-linux-"$LIBC" ;; - esac - exit ;; - ppc64:Linux:*:*) - echo powerpc64-unknown-linux-"$LIBC" - exit ;; - ppc:Linux:*:*) - echo powerpc-unknown-linux-"$LIBC" - exit ;; - ppc64le:Linux:*:*) - echo powerpc64le-unknown-linux-"$LIBC" - exit ;; - ppcle:Linux:*:*) - echo powerpcle-unknown-linux-"$LIBC" - exit ;; - riscv32:Linux:*:* | riscv64:Linux:*:*) - echo "$UNAME_MACHINE"-unknown-linux-"$LIBC" - exit ;; - s390:Linux:*:* | s390x:Linux:*:*) - echo "$UNAME_MACHINE"-ibm-linux-"$LIBC" - exit ;; - sh64*:Linux:*:*) - echo "$UNAME_MACHINE"-unknown-linux-"$LIBC" - exit ;; - sh*:Linux:*:*) - echo "$UNAME_MACHINE"-unknown-linux-"$LIBC" - exit ;; - sparc:Linux:*:* | sparc64:Linux:*:*) - echo "$UNAME_MACHINE"-unknown-linux-"$LIBC" - exit ;; - tile*:Linux:*:*) - echo "$UNAME_MACHINE"-unknown-linux-"$LIBC" - exit ;; - vax:Linux:*:*) - echo "$UNAME_MACHINE"-dec-linux-"$LIBC" - exit ;; - x86_64:Linux:*:*) - if objdump -f /bin/sh | grep -q elf32-x86-64; then - echo "$UNAME_MACHINE"-pc-linux-"$LIBC"x32 - else - echo "$UNAME_MACHINE"-pc-linux-"$LIBC" - fi - exit ;; - xtensa*:Linux:*:*) - echo "$UNAME_MACHINE"-unknown-linux-"$LIBC" - exit ;; - i*86:DYNIX/ptx:4*:*) - # ptx 4.0 does uname -s correctly, with DYNIX/ptx in there. - # earlier versions are messed up and put the nodename in both - # sysname and nodename. - echo i386-sequent-sysv4 - exit ;; - i*86:UNIX_SV:4.2MP:2.*) - # Unixware is an offshoot of SVR4, but it has its own version - # number series starting with 2... - # I am not positive that other SVR4 systems won't match this, - # I just have to hope. -- rms. - # Use sysv4.2uw... so that sysv4* matches it. - echo "$UNAME_MACHINE"-pc-sysv4.2uw"$UNAME_VERSION" - exit ;; - i*86:OS/2:*:*) - # If we were able to find `uname', then EMX Unix compatibility - # is probably installed. - echo "$UNAME_MACHINE"-pc-os2-emx - exit ;; - i*86:XTS-300:*:STOP) - echo "$UNAME_MACHINE"-unknown-stop - exit ;; - i*86:atheos:*:*) - echo "$UNAME_MACHINE"-unknown-atheos - exit ;; - i*86:syllable:*:*) - echo "$UNAME_MACHINE"-pc-syllable - exit ;; - i*86:LynxOS:2.*:* | i*86:LynxOS:3.[01]*:* | i*86:LynxOS:4.[02]*:*) - echo i386-unknown-lynxos"$UNAME_RELEASE" - exit ;; - i*86:*DOS:*:*) - echo "$UNAME_MACHINE"-pc-msdosdjgpp - exit ;; - i*86:*:4.*:*) - UNAME_REL=`echo "$UNAME_RELEASE" | sed 's/\/MP$//'` - if grep Novell /usr/include/link.h >/dev/null 2>/dev/null; then - echo "$UNAME_MACHINE"-univel-sysv"$UNAME_REL" - else - echo "$UNAME_MACHINE"-pc-sysv"$UNAME_REL" - fi - exit ;; - i*86:*:5:[678]*) - # UnixWare 7.x, OpenUNIX and OpenServer 6. - case `/bin/uname -X | grep "^Machine"` in - *486*) UNAME_MACHINE=i486 ;; - *Pentium) UNAME_MACHINE=i586 ;; - *Pent*|*Celeron) UNAME_MACHINE=i686 ;; - esac - echo "$UNAME_MACHINE-unknown-sysv${UNAME_RELEASE}${UNAME_SYSTEM}{$UNAME_VERSION}" - exit ;; - i*86:*:3.2:*) - if test -f /usr/options/cb.name; then - UNAME_REL=`sed -n 's/.*Version //p' /dev/null >/dev/null ; then - UNAME_REL=`(/bin/uname -X|grep Release|sed -e 's/.*= //')` - (/bin/uname -X|grep i80486 >/dev/null) && UNAME_MACHINE=i486 - (/bin/uname -X|grep '^Machine.*Pentium' >/dev/null) \ - && UNAME_MACHINE=i586 - (/bin/uname -X|grep '^Machine.*Pent *II' >/dev/null) \ - && UNAME_MACHINE=i686 - (/bin/uname -X|grep '^Machine.*Pentium Pro' >/dev/null) \ - && UNAME_MACHINE=i686 - echo "$UNAME_MACHINE"-pc-sco"$UNAME_REL" - else - echo "$UNAME_MACHINE"-pc-sysv32 - fi - exit ;; - pc:*:*:*) - # Left here for compatibility: - # uname -m prints for DJGPP always 'pc', but it prints nothing about - # the processor, so we play safe by assuming i586. - # Note: whatever this is, it MUST be the same as what config.sub - # prints for the "djgpp" host, or else GDB configure will decide that - # this is a cross-build. - echo i586-pc-msdosdjgpp - exit ;; - Intel:Mach:3*:*) - echo i386-pc-mach3 - exit ;; - paragon:*:*:*) - echo i860-intel-osf1 - exit ;; - i860:*:4.*:*) # i860-SVR4 - if grep Stardent /usr/include/sys/uadmin.h >/dev/null 2>&1 ; then - echo i860-stardent-sysv"$UNAME_RELEASE" # Stardent Vistra i860-SVR4 - else # Add other i860-SVR4 vendors below as they are discovered. - echo i860-unknown-sysv"$UNAME_RELEASE" # Unknown i860-SVR4 - fi - exit ;; - mini*:CTIX:SYS*5:*) - # "miniframe" - echo m68010-convergent-sysv - exit ;; - mc68k:UNIX:SYSTEM5:3.51m) - echo m68k-convergent-sysv - exit ;; - M680?0:D-NIX:5.3:*) - echo m68k-diab-dnix - exit ;; - M68*:*:R3V[5678]*:*) - test -r /sysV68 && { echo 'm68k-motorola-sysv'; exit; } ;; - 3[345]??:*:4.0:3.0 | 3[34]??A:*:4.0:3.0 | 3[34]??,*:*:4.0:3.0 | 3[34]??/*:*:4.0:3.0 | 4400:*:4.0:3.0 | 4850:*:4.0:3.0 | SKA40:*:4.0:3.0 | SDS2:*:4.0:3.0 | SHG2:*:4.0:3.0 | S7501*:*:4.0:3.0) - OS_REL='' - test -r /etc/.relid \ - && OS_REL=.`sed -n 's/[^ ]* [^ ]* \([0-9][0-9]\).*/\1/p' < /etc/.relid` - /bin/uname -p 2>/dev/null | grep 86 >/dev/null \ - && { echo i486-ncr-sysv4.3"$OS_REL"; exit; } - /bin/uname -p 2>/dev/null | /bin/grep entium >/dev/null \ - && { echo i586-ncr-sysv4.3"$OS_REL"; exit; } ;; - 3[34]??:*:4.0:* | 3[34]??,*:*:4.0:*) - /bin/uname -p 2>/dev/null | grep 86 >/dev/null \ - && { echo i486-ncr-sysv4; exit; } ;; - NCR*:*:4.2:* | MPRAS*:*:4.2:*) - OS_REL='.3' - test -r /etc/.relid \ - && OS_REL=.`sed -n 's/[^ ]* [^ ]* \([0-9][0-9]\).*/\1/p' < /etc/.relid` - /bin/uname -p 2>/dev/null | grep 86 >/dev/null \ - && { echo i486-ncr-sysv4.3"$OS_REL"; exit; } - /bin/uname -p 2>/dev/null | /bin/grep entium >/dev/null \ - && { echo i586-ncr-sysv4.3"$OS_REL"; exit; } - /bin/uname -p 2>/dev/null | /bin/grep pteron >/dev/null \ - && { echo i586-ncr-sysv4.3"$OS_REL"; exit; } ;; - m68*:LynxOS:2.*:* | m68*:LynxOS:3.0*:*) - echo m68k-unknown-lynxos"$UNAME_RELEASE" - exit ;; - mc68030:UNIX_System_V:4.*:*) - echo m68k-atari-sysv4 - exit ;; - TSUNAMI:LynxOS:2.*:*) - echo sparc-unknown-lynxos"$UNAME_RELEASE" - exit ;; - rs6000:LynxOS:2.*:*) - echo rs6000-unknown-lynxos"$UNAME_RELEASE" - exit ;; - PowerPC:LynxOS:2.*:* | PowerPC:LynxOS:3.[01]*:* | PowerPC:LynxOS:4.[02]*:*) - echo powerpc-unknown-lynxos"$UNAME_RELEASE" - exit ;; - SM[BE]S:UNIX_SV:*:*) - echo mips-dde-sysv"$UNAME_RELEASE" - exit ;; - RM*:ReliantUNIX-*:*:*) - echo mips-sni-sysv4 - exit ;; - RM*:SINIX-*:*:*) - echo mips-sni-sysv4 - exit ;; - *:SINIX-*:*:*) - if uname -p 2>/dev/null >/dev/null ; then - UNAME_MACHINE=`(uname -p) 2>/dev/null` - echo "$UNAME_MACHINE"-sni-sysv4 - else - echo ns32k-sni-sysv - fi - exit ;; - PENTIUM:*:4.0*:*) # Unisys `ClearPath HMP IX 4000' SVR4/MP effort - # says - echo i586-unisys-sysv4 - exit ;; - *:UNIX_System_V:4*:FTX*) - # From Gerald Hewes . - # How about differentiating between stratus architectures? -djm - echo hppa1.1-stratus-sysv4 - exit ;; - *:*:*:FTX*) - # From seanf@swdc.stratus.com. - echo i860-stratus-sysv4 - exit ;; - i*86:VOS:*:*) - # From Paul.Green@stratus.com. - echo "$UNAME_MACHINE"-stratus-vos - exit ;; - *:VOS:*:*) - # From Paul.Green@stratus.com. - echo hppa1.1-stratus-vos - exit ;; - mc68*:A/UX:*:*) - echo m68k-apple-aux"$UNAME_RELEASE" - exit ;; - news*:NEWS-OS:6*:*) - echo mips-sony-newsos6 - exit ;; - R[34]000:*System_V*:*:* | R4000:UNIX_SYSV:*:* | R*000:UNIX_SV:*:*) - if [ -d /usr/nec ]; then - echo mips-nec-sysv"$UNAME_RELEASE" - else - echo mips-unknown-sysv"$UNAME_RELEASE" - fi - exit ;; - BeBox:BeOS:*:*) # BeOS running on hardware made by Be, PPC only. - echo powerpc-be-beos - exit ;; - BeMac:BeOS:*:*) # BeOS running on Mac or Mac clone, PPC only. - echo powerpc-apple-beos - exit ;; - BePC:BeOS:*:*) # BeOS running on Intel PC compatible. - echo i586-pc-beos - exit ;; - BePC:Haiku:*:*) # Haiku running on Intel PC compatible. - echo i586-pc-haiku - exit ;; - x86_64:Haiku:*:*) - echo x86_64-unknown-haiku - exit ;; - SX-4:SUPER-UX:*:*) - echo sx4-nec-superux"$UNAME_RELEASE" - exit ;; - SX-5:SUPER-UX:*:*) - echo sx5-nec-superux"$UNAME_RELEASE" - exit ;; - SX-6:SUPER-UX:*:*) - echo sx6-nec-superux"$UNAME_RELEASE" - exit ;; - SX-7:SUPER-UX:*:*) - echo sx7-nec-superux"$UNAME_RELEASE" - exit ;; - SX-8:SUPER-UX:*:*) - echo sx8-nec-superux"$UNAME_RELEASE" - exit ;; - SX-8R:SUPER-UX:*:*) - echo sx8r-nec-superux"$UNAME_RELEASE" - exit ;; - SX-ACE:SUPER-UX:*:*) - echo sxace-nec-superux"$UNAME_RELEASE" - exit ;; - Power*:Rhapsody:*:*) - echo powerpc-apple-rhapsody"$UNAME_RELEASE" - exit ;; - *:Rhapsody:*:*) - echo "$UNAME_MACHINE"-apple-rhapsody"$UNAME_RELEASE" - exit ;; - *:Darwin:*:*) - UNAME_PROCESSOR=`uname -p` || UNAME_PROCESSOR=unknown - eval "$set_cc_for_build" - if test "$UNAME_PROCESSOR" = unknown ; then - UNAME_PROCESSOR=powerpc - fi - if test "`echo "$UNAME_RELEASE" | sed -e 's/\..*//'`" -le 10 ; then - if [ "$CC_FOR_BUILD" != no_compiler_found ]; then - if (echo '#ifdef __LP64__'; echo IS_64BIT_ARCH; echo '#endif') | \ - (CCOPTS="" $CC_FOR_BUILD -E - 2>/dev/null) | \ - grep IS_64BIT_ARCH >/dev/null - then - case $UNAME_PROCESSOR in - i386) UNAME_PROCESSOR=x86_64 ;; - powerpc) UNAME_PROCESSOR=powerpc64 ;; - esac - fi - # On 10.4-10.6 one might compile for PowerPC via gcc -arch ppc - if (echo '#ifdef __POWERPC__'; echo IS_PPC; echo '#endif') | \ - (CCOPTS="" $CC_FOR_BUILD -E - 2>/dev/null) | \ - grep IS_PPC >/dev/null - then - UNAME_PROCESSOR=powerpc - fi - fi - elif test "$UNAME_PROCESSOR" = i386 ; then - # Avoid executing cc on OS X 10.9, as it ships with a stub - # that puts up a graphical alert prompting to install - # developer tools. Any system running Mac OS X 10.7 or - # later (Darwin 11 and later) is required to have a 64-bit - # processor. This is not true of the ARM version of Darwin - # that Apple uses in portable devices. - UNAME_PROCESSOR=x86_64 - fi - echo "$UNAME_PROCESSOR"-apple-darwin"$UNAME_RELEASE" - exit ;; - *:procnto*:*:* | *:QNX:[0123456789]*:*) - UNAME_PROCESSOR=`uname -p` - if test "$UNAME_PROCESSOR" = x86; then - UNAME_PROCESSOR=i386 - UNAME_MACHINE=pc - fi - echo "$UNAME_PROCESSOR"-"$UNAME_MACHINE"-nto-qnx"$UNAME_RELEASE" - exit ;; - *:QNX:*:4*) - echo i386-pc-qnx - exit ;; - NEO-*:NONSTOP_KERNEL:*:*) - echo neo-tandem-nsk"$UNAME_RELEASE" - exit ;; - NSE-*:NONSTOP_KERNEL:*:*) - echo nse-tandem-nsk"$UNAME_RELEASE" - exit ;; - NSR-*:NONSTOP_KERNEL:*:*) - echo nsr-tandem-nsk"$UNAME_RELEASE" - exit ;; - NSV-*:NONSTOP_KERNEL:*:*) - echo nsv-tandem-nsk"$UNAME_RELEASE" - exit ;; - NSX-*:NONSTOP_KERNEL:*:*) - echo nsx-tandem-nsk"$UNAME_RELEASE" - exit ;; - *:NonStop-UX:*:*) - echo mips-compaq-nonstopux - exit ;; - BS2000:POSIX*:*:*) - echo bs2000-siemens-sysv - exit ;; - DS/*:UNIX_System_V:*:*) - echo "$UNAME_MACHINE"-"$UNAME_SYSTEM"-"$UNAME_RELEASE" - exit ;; - *:Plan9:*:*) - # "uname -m" is not consistent, so use $cputype instead. 386 - # is converted to i386 for consistency with other x86 - # operating systems. - if test "$cputype" = 386; then - UNAME_MACHINE=i386 - else - UNAME_MACHINE="$cputype" - fi - echo "$UNAME_MACHINE"-unknown-plan9 - exit ;; - *:TOPS-10:*:*) - echo pdp10-unknown-tops10 - exit ;; - *:TENEX:*:*) - echo pdp10-unknown-tenex - exit ;; - KS10:TOPS-20:*:* | KL10:TOPS-20:*:* | TYPE4:TOPS-20:*:*) - echo pdp10-dec-tops20 - exit ;; - XKL-1:TOPS-20:*:* | TYPE5:TOPS-20:*:*) - echo pdp10-xkl-tops20 - exit ;; - *:TOPS-20:*:*) - echo pdp10-unknown-tops20 - exit ;; - *:ITS:*:*) - echo pdp10-unknown-its - exit ;; - SEI:*:*:SEIUX) - echo mips-sei-seiux"$UNAME_RELEASE" - exit ;; - *:DragonFly:*:*) - echo "$UNAME_MACHINE"-unknown-dragonfly"`echo "$UNAME_RELEASE"|sed -e 's/[-(].*//'`" - exit ;; - *:*VMS:*:*) - UNAME_MACHINE=`(uname -p) 2>/dev/null` - case "$UNAME_MACHINE" in - A*) echo alpha-dec-vms ; exit ;; - I*) echo ia64-dec-vms ; exit ;; - V*) echo vax-dec-vms ; exit ;; - esac ;; - *:XENIX:*:SysV) - echo i386-pc-xenix - exit ;; - i*86:skyos:*:*) - echo "$UNAME_MACHINE"-pc-skyos"`echo "$UNAME_RELEASE" | sed -e 's/ .*$//'`" - exit ;; - i*86:rdos:*:*) - echo "$UNAME_MACHINE"-pc-rdos - exit ;; - i*86:AROS:*:*) - echo "$UNAME_MACHINE"-pc-aros - exit ;; - x86_64:VMkernel:*:*) - echo "$UNAME_MACHINE"-unknown-esx - exit ;; - amd64:Isilon\ OneFS:*:*) - echo x86_64-unknown-onefs - exit ;; -esac - -echo "$0: unable to guess system type" >&2 - -case "$UNAME_MACHINE:$UNAME_SYSTEM" in - mips:Linux | mips64:Linux) - # If we got here on MIPS GNU/Linux, output extra information. - cat >&2 <&2 </dev/null || echo unknown` -uname -r = `(uname -r) 2>/dev/null || echo unknown` -uname -s = `(uname -s) 2>/dev/null || echo unknown` -uname -v = `(uname -v) 2>/dev/null || echo unknown` - -/usr/bin/uname -p = `(/usr/bin/uname -p) 2>/dev/null` -/bin/uname -X = `(/bin/uname -X) 2>/dev/null` - -hostinfo = `(hostinfo) 2>/dev/null` -/bin/universe = `(/bin/universe) 2>/dev/null` -/usr/bin/arch -k = `(/usr/bin/arch -k) 2>/dev/null` -/bin/arch = `(/bin/arch) 2>/dev/null` -/usr/bin/oslevel = `(/usr/bin/oslevel) 2>/dev/null` -/usr/convex/getsysinfo = `(/usr/convex/getsysinfo) 2>/dev/null` - -UNAME_MACHINE = "$UNAME_MACHINE" -UNAME_RELEASE = "$UNAME_RELEASE" -UNAME_SYSTEM = "$UNAME_SYSTEM" -UNAME_VERSION = "$UNAME_VERSION" -EOF - -exit 1 - -# Local variables: -# eval: (add-hook 'write-file-functions 'time-stamp) -# time-stamp-start: "timestamp='" -# time-stamp-format: "%:y-%02m-%02d" -# time-stamp-end: "'" -# End: diff --git a/extra/protobuf/protobuf-3.19.4/config.h.in b/extra/protobuf/protobuf-3.19.4/config.h.in deleted file mode 100644 index dfef8e3d969e..000000000000 --- a/extra/protobuf/protobuf-3.19.4/config.h.in +++ /dev/null @@ -1,218 +0,0 @@ -/* config.h.in. Generated from configure.ac by autoheader. */ - -/* the name of */ -#undef HASH_MAP_CLASS - -/* the location of or */ -#undef HASH_MAP_H - -/* the namespace of hash_map/hash_set */ -#undef HASH_NAMESPACE - -/* the name of */ -#undef HASH_SET_CLASS - -/* the location of or */ -#undef HASH_SET_H - -/* define if the compiler supports basic C++11 syntax */ -#undef HAVE_CXX11 - -/* Define to 1 if you have the header file. */ -#undef HAVE_DLFCN_H - -/* Define to 1 if you have the header file. */ -#undef HAVE_FCNTL_H - -/* Define to 1 if you have the `ftruncate' function. */ -#undef HAVE_FTRUNCATE - -/* define if the compiler has hash_map */ -#undef HAVE_HASH_MAP - -/* define if the compiler has hash_set */ -#undef HAVE_HASH_SET - -/* Define to 1 if you have the header file. */ -#undef HAVE_INTTYPES_H - -/* Define to 1 if you have the header file. */ -#undef HAVE_LIMITS_H - -/* Define to 1 if you have the `memset' function. */ -#undef HAVE_MEMSET - -/* Define to 1 if you have the header file. */ -#undef HAVE_MINIX_CONFIG_H - -/* Define to 1 if you have the `mkdir' function. */ -#undef HAVE_MKDIR - -/* Define if you have POSIX threads libraries and header files. */ -#undef HAVE_PTHREAD - -/* Have PTHREAD_PRIO_INHERIT. */ -#undef HAVE_PTHREAD_PRIO_INHERIT - -/* Define to 1 if you have the header file. */ -#undef HAVE_STDINT_H - -/* Define to 1 if you have the header file. */ -#undef HAVE_STDIO_H - -/* Define to 1 if you have the header file. */ -#undef HAVE_STDLIB_H - -/* Define to 1 if you have the `strchr' function. */ -#undef HAVE_STRCHR - -/* Define to 1 if you have the `strerror' function. */ -#undef HAVE_STRERROR - -/* Define to 1 if you have the header file. */ -#undef HAVE_STRINGS_H - -/* Define to 1 if you have the header file. */ -#undef HAVE_STRING_H - -/* Define to 1 if you have the `strtol' function. */ -#undef HAVE_STRTOL - -/* Define to 1 if you have the header file. */ -#undef HAVE_SYS_STAT_H - -/* Define to 1 if you have the header file. */ -#undef HAVE_SYS_TYPES_H - -/* Define to 1 if you have the header file. */ -#undef HAVE_UNISTD_H - -/* Define to 1 if you have the header file. */ -#undef HAVE_WCHAR_H - -/* Enable classes using zlib compression. */ -#undef HAVE_ZLIB - -/* Define to the sub-directory where libtool stores uninstalled libraries. */ -#undef LT_OBJDIR - -/* Name of package */ -#undef PACKAGE - -/* Define to the address where bug reports for this package should be sent. */ -#undef PACKAGE_BUGREPORT - -/* Define to the full name of this package. */ -#undef PACKAGE_NAME - -/* Define to the full name and version of this package. */ -#undef PACKAGE_STRING - -/* Define to the one symbol short name of this package. */ -#undef PACKAGE_TARNAME - -/* Define to the home page for this package. */ -#undef PACKAGE_URL - -/* Define to the version of this package. */ -#undef PACKAGE_VERSION - -/* Define to necessary symbol if this constant uses a non-standard name on - your system. */ -#undef PTHREAD_CREATE_JOINABLE - -/* Define to 1 if all of the C90 standard headers exist (not just the ones - required in a freestanding environment). This macro is provided for - backward compatibility; new code need not use it. */ -#undef STDC_HEADERS - -/* Enable extensions on AIX 3, Interix. */ -#ifndef _ALL_SOURCE -# undef _ALL_SOURCE -#endif -/* Enable general extensions on macOS. */ -#ifndef _DARWIN_C_SOURCE -# undef _DARWIN_C_SOURCE -#endif -/* Enable general extensions on Solaris. */ -#ifndef __EXTENSIONS__ -# undef __EXTENSIONS__ -#endif -/* Enable GNU extensions on systems that have them. */ -#ifndef _GNU_SOURCE -# undef _GNU_SOURCE -#endif -/* Enable X/Open compliant socket functions that do not require linking - with -lxnet on HP-UX 11.11. */ -#ifndef _HPUX_ALT_XOPEN_SOCKET_API -# undef _HPUX_ALT_XOPEN_SOCKET_API -#endif -/* Identify the host operating system as Minix. - This macro does not affect the system headers' behavior. - A future release of Autoconf may stop defining this macro. */ -#ifndef _MINIX -# undef _MINIX -#endif -/* Enable general extensions on NetBSD. - Enable NetBSD compatibility extensions on Minix. */ -#ifndef _NETBSD_SOURCE -# undef _NETBSD_SOURCE -#endif -/* Enable OpenBSD compatibility extensions on NetBSD. - Oddly enough, this does nothing on OpenBSD. */ -#ifndef _OPENBSD_SOURCE -# undef _OPENBSD_SOURCE -#endif -/* Define to 1 if needed for POSIX-compatible behavior. */ -#ifndef _POSIX_SOURCE -# undef _POSIX_SOURCE -#endif -/* Define to 2 if needed for POSIX-compatible behavior. */ -#ifndef _POSIX_1_SOURCE -# undef _POSIX_1_SOURCE -#endif -/* Enable POSIX-compatible threading on Solaris. */ -#ifndef _POSIX_PTHREAD_SEMANTICS -# undef _POSIX_PTHREAD_SEMANTICS -#endif -/* Enable extensions specified by ISO/IEC TS 18661-5:2014. */ -#ifndef __STDC_WANT_IEC_60559_ATTRIBS_EXT__ -# undef __STDC_WANT_IEC_60559_ATTRIBS_EXT__ -#endif -/* Enable extensions specified by ISO/IEC TS 18661-1:2014. */ -#ifndef __STDC_WANT_IEC_60559_BFP_EXT__ -# undef __STDC_WANT_IEC_60559_BFP_EXT__ -#endif -/* Enable extensions specified by ISO/IEC TS 18661-2:2015. */ -#ifndef __STDC_WANT_IEC_60559_DFP_EXT__ -# undef __STDC_WANT_IEC_60559_DFP_EXT__ -#endif -/* Enable extensions specified by ISO/IEC TS 18661-4:2015. */ -#ifndef __STDC_WANT_IEC_60559_FUNCS_EXT__ -# undef __STDC_WANT_IEC_60559_FUNCS_EXT__ -#endif -/* Enable extensions specified by ISO/IEC TS 18661-3:2015. */ -#ifndef __STDC_WANT_IEC_60559_TYPES_EXT__ -# undef __STDC_WANT_IEC_60559_TYPES_EXT__ -#endif -/* Enable extensions specified by ISO/IEC TR 24731-2:2010. */ -#ifndef __STDC_WANT_LIB_EXT2__ -# undef __STDC_WANT_LIB_EXT2__ -#endif -/* Enable extensions specified by ISO/IEC 24747:2009. */ -#ifndef __STDC_WANT_MATH_SPEC_FUNCS__ -# undef __STDC_WANT_MATH_SPEC_FUNCS__ -#endif -/* Enable extensions on HP NonStop. */ -#ifndef _TANDEM_SOURCE -# undef _TANDEM_SOURCE -#endif -/* Enable X/Open extensions. Define to 500 only if necessary - to make mbstate_t available. */ -#ifndef _XOPEN_SOURCE -# undef _XOPEN_SOURCE -#endif - - -/* Version number of package */ -#undef VERSION diff --git a/extra/protobuf/protobuf-3.19.4/config.sub b/extra/protobuf/protobuf-3.19.4/config.sub deleted file mode 100755 index 1d8e98bcee23..000000000000 --- a/extra/protobuf/protobuf-3.19.4/config.sub +++ /dev/null @@ -1,1801 +0,0 @@ -#! /bin/sh -# Configuration validation subroutine script. -# Copyright 1992-2018 Free Software Foundation, Inc. - -timestamp='2018-02-22' - -# This file is free software; you can redistribute it and/or modify it -# under the terms of the GNU General Public License as published by -# the Free Software Foundation; either version 3 of the License, or -# (at your option) any later version. -# -# This program is distributed in the hope that it will be useful, but -# WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -# General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with this program; if not, see . -# -# As a special exception to the GNU General Public License, if you -# distribute this file as part of a program that contains a -# configuration script generated by Autoconf, you may include it under -# the same distribution terms that you use for the rest of that -# program. This Exception is an additional permission under section 7 -# of the GNU General Public License, version 3 ("GPLv3"). - - -# Please send patches to . -# -# Configuration subroutine to validate and canonicalize a configuration type. -# Supply the specified configuration type as an argument. -# If it is invalid, we print an error message on stderr and exit with code 1. -# Otherwise, we print the canonical config type on stdout and succeed. - -# You can get the latest version of this script from: -# https://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.sub - -# This file is supposed to be the same for all GNU packages -# and recognize all the CPU types, system types and aliases -# that are meaningful with *any* GNU software. -# Each package is responsible for reporting which valid configurations -# it does not support. The user should be able to distinguish -# a failure to support a valid configuration from a meaningless -# configuration. - -# The goal of this file is to map all the various variations of a given -# machine specification into a single specification in the form: -# CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM -# or in some cases, the newer four-part form: -# CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM -# It is wrong to echo any other type of specification. - -me=`echo "$0" | sed -e 's,.*/,,'` - -usage="\ -Usage: $0 [OPTION] CPU-MFR-OPSYS or ALIAS - -Canonicalize a configuration name. - -Options: - -h, --help print this help, then exit - -t, --time-stamp print date of last modification, then exit - -v, --version print version number, then exit - -Report bugs and patches to ." - -version="\ -GNU config.sub ($timestamp) - -Copyright 1992-2018 Free Software Foundation, Inc. - -This is free software; see the source for copying conditions. There is NO -warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE." - -help=" -Try \`$me --help' for more information." - -# Parse command line -while test $# -gt 0 ; do - case $1 in - --time-stamp | --time* | -t ) - echo "$timestamp" ; exit ;; - --version | -v ) - echo "$version" ; exit ;; - --help | --h* | -h ) - echo "$usage"; exit ;; - -- ) # Stop option processing - shift; break ;; - - ) # Use stdin as input. - break ;; - -* ) - echo "$me: invalid option $1$help" - exit 1 ;; - - *local*) - # First pass through any local machine types. - echo "$1" - exit ;; - - * ) - break ;; - esac -done - -case $# in - 0) echo "$me: missing argument$help" >&2 - exit 1;; - 1) ;; - *) echo "$me: too many arguments$help" >&2 - exit 1;; -esac - -# Separate what the user gave into CPU-COMPANY and OS or KERNEL-OS (if any). -# Here we must recognize all the valid KERNEL-OS combinations. -maybe_os=`echo "$1" | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\2/'` -case $maybe_os in - nto-qnx* | linux-gnu* | linux-android* | linux-dietlibc | linux-newlib* | \ - linux-musl* | linux-uclibc* | uclinux-uclibc* | uclinux-gnu* | kfreebsd*-gnu* | \ - knetbsd*-gnu* | netbsd*-gnu* | netbsd*-eabi* | \ - kopensolaris*-gnu* | cloudabi*-eabi* | \ - storm-chaos* | os2-emx* | rtmk-nova*) - os=-$maybe_os - basic_machine=`echo "$1" | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\1/'` - ;; - android-linux) - os=-linux-android - basic_machine=`echo "$1" | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\1/'`-unknown - ;; - *) - basic_machine=`echo "$1" | sed 's/-[^-]*$//'` - if [ "$basic_machine" != "$1" ] - then os=`echo "$1" | sed 's/.*-/-/'` - else os=; fi - ;; -esac - -### Let's recognize common machines as not being operating systems so -### that things like config.sub decstation-3100 work. We also -### recognize some manufacturers as not being operating systems, so we -### can provide default operating systems below. -case $os in - -sun*os*) - # Prevent following clause from handling this invalid input. - ;; - -dec* | -mips* | -sequent* | -encore* | -pc532* | -sgi* | -sony* | \ - -att* | -7300* | -3300* | -delta* | -motorola* | -sun[234]* | \ - -unicom* | -ibm* | -next | -hp | -isi* | -apollo | -altos* | \ - -convergent* | -ncr* | -news | -32* | -3600* | -3100* | -hitachi* |\ - -c[123]* | -convex* | -sun | -crds | -omron* | -dg | -ultra | -tti* | \ - -harris | -dolphin | -highlevel | -gould | -cbm | -ns | -masscomp | \ - -apple | -axis | -knuth | -cray | -microblaze*) - os= - basic_machine=$1 - ;; - -bluegene*) - os=-cnk - ;; - -sim | -cisco | -oki | -wec | -winbond) - os= - basic_machine=$1 - ;; - -scout) - ;; - -wrs) - os=-vxworks - basic_machine=$1 - ;; - -chorusos*) - os=-chorusos - basic_machine=$1 - ;; - -chorusrdb) - os=-chorusrdb - basic_machine=$1 - ;; - -hiux*) - os=-hiuxwe2 - ;; - -sco6) - os=-sco5v6 - basic_machine=`echo "$1" | sed -e 's/86-.*/86-pc/'` - ;; - -sco5) - os=-sco3.2v5 - basic_machine=`echo "$1" | sed -e 's/86-.*/86-pc/'` - ;; - -sco4) - os=-sco3.2v4 - basic_machine=`echo "$1" | sed -e 's/86-.*/86-pc/'` - ;; - -sco3.2.[4-9]*) - os=`echo $os | sed -e 's/sco3.2./sco3.2v/'` - basic_machine=`echo "$1" | sed -e 's/86-.*/86-pc/'` - ;; - -sco3.2v[4-9]*) - # Don't forget version if it is 3.2v4 or newer. - basic_machine=`echo "$1" | sed -e 's/86-.*/86-pc/'` - ;; - -sco5v6*) - # Don't forget version if it is 3.2v4 or newer. - basic_machine=`echo "$1" | sed -e 's/86-.*/86-pc/'` - ;; - -sco*) - os=-sco3.2v2 - basic_machine=`echo "$1" | sed -e 's/86-.*/86-pc/'` - ;; - -udk*) - basic_machine=`echo "$1" | sed -e 's/86-.*/86-pc/'` - ;; - -isc) - os=-isc2.2 - basic_machine=`echo "$1" | sed -e 's/86-.*/86-pc/'` - ;; - -clix*) - basic_machine=clipper-intergraph - ;; - -isc*) - basic_machine=`echo "$1" | sed -e 's/86-.*/86-pc/'` - ;; - -lynx*178) - os=-lynxos178 - ;; - -lynx*5) - os=-lynxos5 - ;; - -lynx*) - os=-lynxos - ;; - -ptx*) - basic_machine=`echo "$1" | sed -e 's/86-.*/86-sequent/'` - ;; - -psos*) - os=-psos - ;; - -mint | -mint[0-9]*) - basic_machine=m68k-atari - os=-mint - ;; -esac - -# Decode aliases for certain CPU-COMPANY combinations. -case $basic_machine in - # Recognize the basic CPU types without company name. - # Some are omitted here because they have special meanings below. - 1750a | 580 \ - | a29k \ - | aarch64 | aarch64_be \ - | alpha | alphaev[4-8] | alphaev56 | alphaev6[78] | alphapca5[67] \ - | alpha64 | alpha64ev[4-8] | alpha64ev56 | alpha64ev6[78] | alpha64pca5[67] \ - | am33_2.0 \ - | arc | arceb \ - | arm | arm[bl]e | arme[lb] | armv[2-8] | armv[3-8][lb] | armv7[arm] \ - | avr | avr32 \ - | ba \ - | be32 | be64 \ - | bfin \ - | c4x | c8051 | clipper \ - | d10v | d30v | dlx | dsp16xx \ - | e2k | epiphany \ - | fido | fr30 | frv | ft32 \ - | h8300 | h8500 | hppa | hppa1.[01] | hppa2.0 | hppa2.0[nw] | hppa64 \ - | hexagon \ - | i370 | i860 | i960 | ia16 | ia64 \ - | ip2k | iq2000 \ - | k1om \ - | le32 | le64 \ - | lm32 \ - | m32c | m32r | m32rle | m68000 | m68k | m88k \ - | maxq | mb | microblaze | microblazeel | mcore | mep | metag \ - | mips | mipsbe | mipseb | mipsel | mipsle \ - | mips16 \ - | mips64 | mips64el \ - | mips64octeon | mips64octeonel \ - | mips64orion | mips64orionel \ - | mips64r5900 | mips64r5900el \ - | mips64vr | mips64vrel \ - | mips64vr4100 | mips64vr4100el \ - | mips64vr4300 | mips64vr4300el \ - | mips64vr5000 | mips64vr5000el \ - | mips64vr5900 | mips64vr5900el \ - | mipsisa32 | mipsisa32el \ - | mipsisa32r2 | mipsisa32r2el \ - | mipsisa32r6 | mipsisa32r6el \ - | mipsisa64 | mipsisa64el \ - | mipsisa64r2 | mipsisa64r2el \ - | mipsisa64r6 | mipsisa64r6el \ - | mipsisa64sb1 | mipsisa64sb1el \ - | mipsisa64sr71k | mipsisa64sr71kel \ - | mipsr5900 | mipsr5900el \ - | mipstx39 | mipstx39el \ - | mn10200 | mn10300 \ - | moxie \ - | mt \ - | msp430 \ - | nds32 | nds32le | nds32be \ - | nios | nios2 | nios2eb | nios2el \ - | ns16k | ns32k \ - | open8 | or1k | or1knd | or32 \ - | pdp10 | pj | pjl \ - | powerpc | powerpc64 | powerpc64le | powerpcle \ - | pru \ - | pyramid \ - | riscv32 | riscv64 \ - | rl78 | rx \ - | score \ - | sh | sh[1234] | sh[24]a | sh[24]aeb | sh[23]e | sh[234]eb | sheb | shbe | shle | sh[1234]le | sh3ele \ - | sh64 | sh64le \ - | sparc | sparc64 | sparc64b | sparc64v | sparc86x | sparclet | sparclite \ - | sparcv8 | sparcv9 | sparcv9b | sparcv9v \ - | spu \ - | tahoe | tic4x | tic54x | tic55x | tic6x | tic80 | tron \ - | ubicom32 \ - | v850 | v850e | v850e1 | v850e2 | v850es | v850e2v3 \ - | visium \ - | wasm32 \ - | x86 | xc16x | xstormy16 | xtensa \ - | z8k | z80) - basic_machine=$basic_machine-unknown - ;; - c54x) - basic_machine=tic54x-unknown - ;; - c55x) - basic_machine=tic55x-unknown - ;; - c6x) - basic_machine=tic6x-unknown - ;; - leon|leon[3-9]) - basic_machine=sparc-$basic_machine - ;; - m6811 | m68hc11 | m6812 | m68hc12 | m68hcs12x | nvptx | picochip) - basic_machine=$basic_machine-unknown - os=-none - ;; - m88110 | m680[12346]0 | m683?2 | m68360 | m5200 | v70 | w65) - ;; - ms1) - basic_machine=mt-unknown - ;; - - strongarm | thumb | xscale) - basic_machine=arm-unknown - ;; - xgate) - basic_machine=$basic_machine-unknown - os=-none - ;; - xscaleeb) - basic_machine=armeb-unknown - ;; - - xscaleel) - basic_machine=armel-unknown - ;; - - # We use `pc' rather than `unknown' - # because (1) that's what they normally are, and - # (2) the word "unknown" tends to confuse beginning users. - i*86 | x86_64) - basic_machine=$basic_machine-pc - ;; - # Object if more than one company name word. - *-*-*) - echo Invalid configuration \`"$1"\': machine \`"$basic_machine"\' not recognized 1>&2 - exit 1 - ;; - # Recognize the basic CPU types with company name. - 580-* \ - | a29k-* \ - | aarch64-* | aarch64_be-* \ - | alpha-* | alphaev[4-8]-* | alphaev56-* | alphaev6[78]-* \ - | alpha64-* | alpha64ev[4-8]-* | alpha64ev56-* | alpha64ev6[78]-* \ - | alphapca5[67]-* | alpha64pca5[67]-* | arc-* | arceb-* \ - | arm-* | armbe-* | armle-* | armeb-* | armv*-* \ - | avr-* | avr32-* \ - | ba-* \ - | be32-* | be64-* \ - | bfin-* | bs2000-* \ - | c[123]* | c30-* | [cjt]90-* | c4x-* \ - | c8051-* | clipper-* | craynv-* | cydra-* \ - | d10v-* | d30v-* | dlx-* \ - | e2k-* | elxsi-* \ - | f30[01]-* | f700-* | fido-* | fr30-* | frv-* | fx80-* \ - | h8300-* | h8500-* \ - | hppa-* | hppa1.[01]-* | hppa2.0-* | hppa2.0[nw]-* | hppa64-* \ - | hexagon-* \ - | i*86-* | i860-* | i960-* | ia16-* | ia64-* \ - | ip2k-* | iq2000-* \ - | k1om-* \ - | le32-* | le64-* \ - | lm32-* \ - | m32c-* | m32r-* | m32rle-* \ - | m68000-* | m680[012346]0-* | m68360-* | m683?2-* | m68k-* \ - | m88110-* | m88k-* | maxq-* | mcore-* | metag-* \ - | microblaze-* | microblazeel-* \ - | mips-* | mipsbe-* | mipseb-* | mipsel-* | mipsle-* \ - | mips16-* \ - | mips64-* | mips64el-* \ - | mips64octeon-* | mips64octeonel-* \ - | mips64orion-* | mips64orionel-* \ - | mips64r5900-* | mips64r5900el-* \ - | mips64vr-* | mips64vrel-* \ - | mips64vr4100-* | mips64vr4100el-* \ - | mips64vr4300-* | mips64vr4300el-* \ - | mips64vr5000-* | mips64vr5000el-* \ - | mips64vr5900-* | mips64vr5900el-* \ - | mipsisa32-* | mipsisa32el-* \ - | mipsisa32r2-* | mipsisa32r2el-* \ - | mipsisa32r6-* | mipsisa32r6el-* \ - | mipsisa64-* | mipsisa64el-* \ - | mipsisa64r2-* | mipsisa64r2el-* \ - | mipsisa64r6-* | mipsisa64r6el-* \ - | mipsisa64sb1-* | mipsisa64sb1el-* \ - | mipsisa64sr71k-* | mipsisa64sr71kel-* \ - | mipsr5900-* | mipsr5900el-* \ - | mipstx39-* | mipstx39el-* \ - | mmix-* \ - | mt-* \ - | msp430-* \ - | nds32-* | nds32le-* | nds32be-* \ - | nios-* | nios2-* | nios2eb-* | nios2el-* \ - | none-* | np1-* | ns16k-* | ns32k-* \ - | open8-* \ - | or1k*-* \ - | orion-* \ - | pdp10-* | pdp11-* | pj-* | pjl-* | pn-* | power-* \ - | powerpc-* | powerpc64-* | powerpc64le-* | powerpcle-* \ - | pru-* \ - | pyramid-* \ - | riscv32-* | riscv64-* \ - | rl78-* | romp-* | rs6000-* | rx-* \ - | sh-* | sh[1234]-* | sh[24]a-* | sh[24]aeb-* | sh[23]e-* | sh[34]eb-* | sheb-* | shbe-* \ - | shle-* | sh[1234]le-* | sh3ele-* | sh64-* | sh64le-* \ - | sparc-* | sparc64-* | sparc64b-* | sparc64v-* | sparc86x-* | sparclet-* \ - | sparclite-* \ - | sparcv8-* | sparcv9-* | sparcv9b-* | sparcv9v-* | sv1-* | sx*-* \ - | tahoe-* \ - | tic30-* | tic4x-* | tic54x-* | tic55x-* | tic6x-* | tic80-* \ - | tile*-* \ - | tron-* \ - | ubicom32-* \ - | v850-* | v850e-* | v850e1-* | v850es-* | v850e2-* | v850e2v3-* \ - | vax-* \ - | visium-* \ - | wasm32-* \ - | we32k-* \ - | x86-* | x86_64-* | xc16x-* | xps100-* \ - | xstormy16-* | xtensa*-* \ - | ymp-* \ - | z8k-* | z80-*) - ;; - # Recognize the basic CPU types without company name, with glob match. - xtensa*) - basic_machine=$basic_machine-unknown - ;; - # Recognize the various machine names and aliases which stand - # for a CPU type and a company and sometimes even an OS. - 386bsd) - basic_machine=i386-pc - os=-bsd - ;; - 3b1 | 7300 | 7300-att | att-7300 | pc7300 | safari | unixpc) - basic_machine=m68000-att - ;; - 3b*) - basic_machine=we32k-att - ;; - a29khif) - basic_machine=a29k-amd - os=-udi - ;; - abacus) - basic_machine=abacus-unknown - ;; - adobe68k) - basic_machine=m68010-adobe - os=-scout - ;; - alliant | fx80) - basic_machine=fx80-alliant - ;; - altos | altos3068) - basic_machine=m68k-altos - ;; - am29k) - basic_machine=a29k-none - os=-bsd - ;; - amd64) - basic_machine=x86_64-pc - ;; - amd64-*) - basic_machine=x86_64-`echo "$basic_machine" | sed 's/^[^-]*-//'` - ;; - amdahl) - basic_machine=580-amdahl - os=-sysv - ;; - amiga | amiga-*) - basic_machine=m68k-unknown - ;; - amigaos | amigados) - basic_machine=m68k-unknown - os=-amigaos - ;; - amigaunix | amix) - basic_machine=m68k-unknown - os=-sysv4 - ;; - apollo68) - basic_machine=m68k-apollo - os=-sysv - ;; - apollo68bsd) - basic_machine=m68k-apollo - os=-bsd - ;; - aros) - basic_machine=i386-pc - os=-aros - ;; - asmjs) - basic_machine=asmjs-unknown - ;; - aux) - basic_machine=m68k-apple - os=-aux - ;; - balance) - basic_machine=ns32k-sequent - os=-dynix - ;; - blackfin) - basic_machine=bfin-unknown - os=-linux - ;; - blackfin-*) - basic_machine=bfin-`echo "$basic_machine" | sed 's/^[^-]*-//'` - os=-linux - ;; - bluegene*) - basic_machine=powerpc-ibm - os=-cnk - ;; - c54x-*) - basic_machine=tic54x-`echo "$basic_machine" | sed 's/^[^-]*-//'` - ;; - c55x-*) - basic_machine=tic55x-`echo "$basic_machine" | sed 's/^[^-]*-//'` - ;; - c6x-*) - basic_machine=tic6x-`echo "$basic_machine" | sed 's/^[^-]*-//'` - ;; - c90) - basic_machine=c90-cray - os=-unicos - ;; - cegcc) - basic_machine=arm-unknown - os=-cegcc - ;; - convex-c1) - basic_machine=c1-convex - os=-bsd - ;; - convex-c2) - basic_machine=c2-convex - os=-bsd - ;; - convex-c32) - basic_machine=c32-convex - os=-bsd - ;; - convex-c34) - basic_machine=c34-convex - os=-bsd - ;; - convex-c38) - basic_machine=c38-convex - os=-bsd - ;; - cray | j90) - basic_machine=j90-cray - os=-unicos - ;; - craynv) - basic_machine=craynv-cray - os=-unicosmp - ;; - cr16 | cr16-*) - basic_machine=cr16-unknown - os=-elf - ;; - crds | unos) - basic_machine=m68k-crds - ;; - crisv32 | crisv32-* | etraxfs*) - basic_machine=crisv32-axis - ;; - cris | cris-* | etrax*) - basic_machine=cris-axis - ;; - crx) - basic_machine=crx-unknown - os=-elf - ;; - da30 | da30-*) - basic_machine=m68k-da30 - ;; - decstation | decstation-3100 | pmax | pmax-* | pmin | dec3100 | decstatn) - basic_machine=mips-dec - ;; - decsystem10* | dec10*) - basic_machine=pdp10-dec - os=-tops10 - ;; - decsystem20* | dec20*) - basic_machine=pdp10-dec - os=-tops20 - ;; - delta | 3300 | motorola-3300 | motorola-delta \ - | 3300-motorola | delta-motorola) - basic_machine=m68k-motorola - ;; - delta88) - basic_machine=m88k-motorola - os=-sysv3 - ;; - dicos) - basic_machine=i686-pc - os=-dicos - ;; - djgpp) - basic_machine=i586-pc - os=-msdosdjgpp - ;; - dpx20 | dpx20-*) - basic_machine=rs6000-bull - os=-bosx - ;; - dpx2*) - basic_machine=m68k-bull - os=-sysv3 - ;; - e500v[12]) - basic_machine=powerpc-unknown - os=$os"spe" - ;; - e500v[12]-*) - basic_machine=powerpc-`echo "$basic_machine" | sed 's/^[^-]*-//'` - os=$os"spe" - ;; - ebmon29k) - basic_machine=a29k-amd - os=-ebmon - ;; - elxsi) - basic_machine=elxsi-elxsi - os=-bsd - ;; - encore | umax | mmax) - basic_machine=ns32k-encore - ;; - es1800 | OSE68k | ose68k | ose | OSE) - basic_machine=m68k-ericsson - os=-ose - ;; - fx2800) - basic_machine=i860-alliant - ;; - genix) - basic_machine=ns32k-ns - ;; - gmicro) - basic_machine=tron-gmicro - os=-sysv - ;; - go32) - basic_machine=i386-pc - os=-go32 - ;; - h3050r* | hiux*) - basic_machine=hppa1.1-hitachi - os=-hiuxwe2 - ;; - h8300hms) - basic_machine=h8300-hitachi - os=-hms - ;; - h8300xray) - basic_machine=h8300-hitachi - os=-xray - ;; - h8500hms) - basic_machine=h8500-hitachi - os=-hms - ;; - harris) - basic_machine=m88k-harris - os=-sysv3 - ;; - hp300-*) - basic_machine=m68k-hp - ;; - hp300bsd) - basic_machine=m68k-hp - os=-bsd - ;; - hp300hpux) - basic_machine=m68k-hp - os=-hpux - ;; - hp3k9[0-9][0-9] | hp9[0-9][0-9]) - basic_machine=hppa1.0-hp - ;; - hp9k2[0-9][0-9] | hp9k31[0-9]) - basic_machine=m68000-hp - ;; - hp9k3[2-9][0-9]) - basic_machine=m68k-hp - ;; - hp9k6[0-9][0-9] | hp6[0-9][0-9]) - basic_machine=hppa1.0-hp - ;; - hp9k7[0-79][0-9] | hp7[0-79][0-9]) - basic_machine=hppa1.1-hp - ;; - hp9k78[0-9] | hp78[0-9]) - # FIXME: really hppa2.0-hp - basic_machine=hppa1.1-hp - ;; - hp9k8[67]1 | hp8[67]1 | hp9k80[24] | hp80[24] | hp9k8[78]9 | hp8[78]9 | hp9k893 | hp893) - # FIXME: really hppa2.0-hp - basic_machine=hppa1.1-hp - ;; - hp9k8[0-9][13679] | hp8[0-9][13679]) - basic_machine=hppa1.1-hp - ;; - hp9k8[0-9][0-9] | hp8[0-9][0-9]) - basic_machine=hppa1.0-hp - ;; - hppaosf) - basic_machine=hppa1.1-hp - os=-osf - ;; - hppro) - basic_machine=hppa1.1-hp - os=-proelf - ;; - i370-ibm* | ibm*) - basic_machine=i370-ibm - ;; - i*86v32) - basic_machine=`echo "$1" | sed -e 's/86.*/86-pc/'` - os=-sysv32 - ;; - i*86v4*) - basic_machine=`echo "$1" | sed -e 's/86.*/86-pc/'` - os=-sysv4 - ;; - i*86v) - basic_machine=`echo "$1" | sed -e 's/86.*/86-pc/'` - os=-sysv - ;; - i*86sol2) - basic_machine=`echo "$1" | sed -e 's/86.*/86-pc/'` - os=-solaris2 - ;; - i386mach) - basic_machine=i386-mach - os=-mach - ;; - vsta) - basic_machine=i386-unknown - os=-vsta - ;; - iris | iris4d) - basic_machine=mips-sgi - case $os in - -irix*) - ;; - *) - os=-irix4 - ;; - esac - ;; - isi68 | isi) - basic_machine=m68k-isi - os=-sysv - ;; - leon-*|leon[3-9]-*) - basic_machine=sparc-`echo "$basic_machine" | sed 's/-.*//'` - ;; - m68knommu) - basic_machine=m68k-unknown - os=-linux - ;; - m68knommu-*) - basic_machine=m68k-`echo "$basic_machine" | sed 's/^[^-]*-//'` - os=-linux - ;; - magnum | m3230) - basic_machine=mips-mips - os=-sysv - ;; - merlin) - basic_machine=ns32k-utek - os=-sysv - ;; - microblaze*) - basic_machine=microblaze-xilinx - ;; - mingw64) - basic_machine=x86_64-pc - os=-mingw64 - ;; - mingw32) - basic_machine=i686-pc - os=-mingw32 - ;; - mingw32ce) - basic_machine=arm-unknown - os=-mingw32ce - ;; - miniframe) - basic_machine=m68000-convergent - ;; - *mint | -mint[0-9]* | *MiNT | *MiNT[0-9]*) - basic_machine=m68k-atari - os=-mint - ;; - mips3*-*) - basic_machine=`echo "$basic_machine" | sed -e 's/mips3/mips64/'` - ;; - mips3*) - basic_machine=`echo "$basic_machine" | sed -e 's/mips3/mips64/'`-unknown - ;; - monitor) - basic_machine=m68k-rom68k - os=-coff - ;; - morphos) - basic_machine=powerpc-unknown - os=-morphos - ;; - moxiebox) - basic_machine=moxie-unknown - os=-moxiebox - ;; - msdos) - basic_machine=i386-pc - os=-msdos - ;; - ms1-*) - basic_machine=`echo "$basic_machine" | sed -e 's/ms1-/mt-/'` - ;; - msys) - basic_machine=i686-pc - os=-msys - ;; - mvs) - basic_machine=i370-ibm - os=-mvs - ;; - nacl) - basic_machine=le32-unknown - os=-nacl - ;; - ncr3000) - basic_machine=i486-ncr - os=-sysv4 - ;; - netbsd386) - basic_machine=i386-unknown - os=-netbsd - ;; - netwinder) - basic_machine=armv4l-rebel - os=-linux - ;; - news | news700 | news800 | news900) - basic_machine=m68k-sony - os=-newsos - ;; - news1000) - basic_machine=m68030-sony - os=-newsos - ;; - news-3600 | risc-news) - basic_machine=mips-sony - os=-newsos - ;; - necv70) - basic_machine=v70-nec - os=-sysv - ;; - next | m*-next) - basic_machine=m68k-next - case $os in - -nextstep* ) - ;; - -ns2*) - os=-nextstep2 - ;; - *) - os=-nextstep3 - ;; - esac - ;; - nh3000) - basic_machine=m68k-harris - os=-cxux - ;; - nh[45]000) - basic_machine=m88k-harris - os=-cxux - ;; - nindy960) - basic_machine=i960-intel - os=-nindy - ;; - mon960) - basic_machine=i960-intel - os=-mon960 - ;; - nonstopux) - basic_machine=mips-compaq - os=-nonstopux - ;; - np1) - basic_machine=np1-gould - ;; - neo-tandem) - basic_machine=neo-tandem - ;; - nse-tandem) - basic_machine=nse-tandem - ;; - nsr-tandem) - basic_machine=nsr-tandem - ;; - nsv-tandem) - basic_machine=nsv-tandem - ;; - nsx-tandem) - basic_machine=nsx-tandem - ;; - op50n-* | op60c-*) - basic_machine=hppa1.1-oki - os=-proelf - ;; - openrisc | openrisc-*) - basic_machine=or32-unknown - ;; - os400) - basic_machine=powerpc-ibm - os=-os400 - ;; - OSE68000 | ose68000) - basic_machine=m68000-ericsson - os=-ose - ;; - os68k) - basic_machine=m68k-none - os=-os68k - ;; - pa-hitachi) - basic_machine=hppa1.1-hitachi - os=-hiuxwe2 - ;; - paragon) - basic_machine=i860-intel - os=-osf - ;; - parisc) - basic_machine=hppa-unknown - os=-linux - ;; - parisc-*) - basic_machine=hppa-`echo "$basic_machine" | sed 's/^[^-]*-//'` - os=-linux - ;; - pbd) - basic_machine=sparc-tti - ;; - pbb) - basic_machine=m68k-tti - ;; - pc532 | pc532-*) - basic_machine=ns32k-pc532 - ;; - pc98) - basic_machine=i386-pc - ;; - pc98-*) - basic_machine=i386-`echo "$basic_machine" | sed 's/^[^-]*-//'` - ;; - pentium | p5 | k5 | k6 | nexgen | viac3) - basic_machine=i586-pc - ;; - pentiumpro | p6 | 6x86 | athlon | athlon_*) - basic_machine=i686-pc - ;; - pentiumii | pentium2 | pentiumiii | pentium3) - basic_machine=i686-pc - ;; - pentium4) - basic_machine=i786-pc - ;; - pentium-* | p5-* | k5-* | k6-* | nexgen-* | viac3-*) - basic_machine=i586-`echo "$basic_machine" | sed 's/^[^-]*-//'` - ;; - pentiumpro-* | p6-* | 6x86-* | athlon-*) - basic_machine=i686-`echo "$basic_machine" | sed 's/^[^-]*-//'` - ;; - pentiumii-* | pentium2-* | pentiumiii-* | pentium3-*) - basic_machine=i686-`echo "$basic_machine" | sed 's/^[^-]*-//'` - ;; - pentium4-*) - basic_machine=i786-`echo "$basic_machine" | sed 's/^[^-]*-//'` - ;; - pn) - basic_machine=pn-gould - ;; - power) basic_machine=power-ibm - ;; - ppc | ppcbe) basic_machine=powerpc-unknown - ;; - ppc-* | ppcbe-*) - basic_machine=powerpc-`echo "$basic_machine" | sed 's/^[^-]*-//'` - ;; - ppcle | powerpclittle) - basic_machine=powerpcle-unknown - ;; - ppcle-* | powerpclittle-*) - basic_machine=powerpcle-`echo "$basic_machine" | sed 's/^[^-]*-//'` - ;; - ppc64) basic_machine=powerpc64-unknown - ;; - ppc64-*) basic_machine=powerpc64-`echo "$basic_machine" | sed 's/^[^-]*-//'` - ;; - ppc64le | powerpc64little) - basic_machine=powerpc64le-unknown - ;; - ppc64le-* | powerpc64little-*) - basic_machine=powerpc64le-`echo "$basic_machine" | sed 's/^[^-]*-//'` - ;; - ps2) - basic_machine=i386-ibm - ;; - pw32) - basic_machine=i586-unknown - os=-pw32 - ;; - rdos | rdos64) - basic_machine=x86_64-pc - os=-rdos - ;; - rdos32) - basic_machine=i386-pc - os=-rdos - ;; - rom68k) - basic_machine=m68k-rom68k - os=-coff - ;; - rm[46]00) - basic_machine=mips-siemens - ;; - rtpc | rtpc-*) - basic_machine=romp-ibm - ;; - s390 | s390-*) - basic_machine=s390-ibm - ;; - s390x | s390x-*) - basic_machine=s390x-ibm - ;; - sa29200) - basic_machine=a29k-amd - os=-udi - ;; - sb1) - basic_machine=mipsisa64sb1-unknown - ;; - sb1el) - basic_machine=mipsisa64sb1el-unknown - ;; - sde) - basic_machine=mipsisa32-sde - os=-elf - ;; - sei) - basic_machine=mips-sei - os=-seiux - ;; - sequent) - basic_machine=i386-sequent - ;; - sh5el) - basic_machine=sh5le-unknown - ;; - simso-wrs) - basic_machine=sparclite-wrs - os=-vxworks - ;; - sps7) - basic_machine=m68k-bull - os=-sysv2 - ;; - spur) - basic_machine=spur-unknown - ;; - st2000) - basic_machine=m68k-tandem - ;; - stratus) - basic_machine=i860-stratus - os=-sysv4 - ;; - strongarm-* | thumb-*) - basic_machine=arm-`echo "$basic_machine" | sed 's/^[^-]*-//'` - ;; - sun2) - basic_machine=m68000-sun - ;; - sun2os3) - basic_machine=m68000-sun - os=-sunos3 - ;; - sun2os4) - basic_machine=m68000-sun - os=-sunos4 - ;; - sun3os3) - basic_machine=m68k-sun - os=-sunos3 - ;; - sun3os4) - basic_machine=m68k-sun - os=-sunos4 - ;; - sun4os3) - basic_machine=sparc-sun - os=-sunos3 - ;; - sun4os4) - basic_machine=sparc-sun - os=-sunos4 - ;; - sun4sol2) - basic_machine=sparc-sun - os=-solaris2 - ;; - sun3 | sun3-*) - basic_machine=m68k-sun - ;; - sun4) - basic_machine=sparc-sun - ;; - sun386 | sun386i | roadrunner) - basic_machine=i386-sun - ;; - sv1) - basic_machine=sv1-cray - os=-unicos - ;; - symmetry) - basic_machine=i386-sequent - os=-dynix - ;; - t3e) - basic_machine=alphaev5-cray - os=-unicos - ;; - t90) - basic_machine=t90-cray - os=-unicos - ;; - tile*) - basic_machine=$basic_machine-unknown - os=-linux-gnu - ;; - tx39) - basic_machine=mipstx39-unknown - ;; - tx39el) - basic_machine=mipstx39el-unknown - ;; - toad1) - basic_machine=pdp10-xkl - os=-tops20 - ;; - tower | tower-32) - basic_machine=m68k-ncr - ;; - tpf) - basic_machine=s390x-ibm - os=-tpf - ;; - udi29k) - basic_machine=a29k-amd - os=-udi - ;; - ultra3) - basic_machine=a29k-nyu - os=-sym1 - ;; - v810 | necv810) - basic_machine=v810-nec - os=-none - ;; - vaxv) - basic_machine=vax-dec - os=-sysv - ;; - vms) - basic_machine=vax-dec - os=-vms - ;; - vpp*|vx|vx-*) - basic_machine=f301-fujitsu - ;; - vxworks960) - basic_machine=i960-wrs - os=-vxworks - ;; - vxworks68) - basic_machine=m68k-wrs - os=-vxworks - ;; - vxworks29k) - basic_machine=a29k-wrs - os=-vxworks - ;; - w65*) - basic_machine=w65-wdc - os=-none - ;; - w89k-*) - basic_machine=hppa1.1-winbond - os=-proelf - ;; - x64) - basic_machine=x86_64-pc - ;; - xbox) - basic_machine=i686-pc - os=-mingw32 - ;; - xps | xps100) - basic_machine=xps100-honeywell - ;; - xscale-* | xscalee[bl]-*) - basic_machine=`echo "$basic_machine" | sed 's/^xscale/arm/'` - ;; - ymp) - basic_machine=ymp-cray - os=-unicos - ;; - none) - basic_machine=none-none - os=-none - ;; - -# Here we handle the default manufacturer of certain CPU types. It is in -# some cases the only manufacturer, in others, it is the most popular. - w89k) - basic_machine=hppa1.1-winbond - ;; - op50n) - basic_machine=hppa1.1-oki - ;; - op60c) - basic_machine=hppa1.1-oki - ;; - romp) - basic_machine=romp-ibm - ;; - mmix) - basic_machine=mmix-knuth - ;; - rs6000) - basic_machine=rs6000-ibm - ;; - vax) - basic_machine=vax-dec - ;; - pdp11) - basic_machine=pdp11-dec - ;; - we32k) - basic_machine=we32k-att - ;; - sh[1234] | sh[24]a | sh[24]aeb | sh[34]eb | sh[1234]le | sh[23]ele) - basic_machine=sh-unknown - ;; - cydra) - basic_machine=cydra-cydrome - ;; - orion) - basic_machine=orion-highlevel - ;; - orion105) - basic_machine=clipper-highlevel - ;; - mac | mpw | mac-mpw) - basic_machine=m68k-apple - ;; - pmac | pmac-mpw) - basic_machine=powerpc-apple - ;; - *-unknown) - # Make sure to match an already-canonicalized machine name. - ;; - *) - echo Invalid configuration \`"$1"\': machine \`"$basic_machine"\' not recognized 1>&2 - exit 1 - ;; -esac - -# Here we canonicalize certain aliases for manufacturers. -case $basic_machine in - *-digital*) - basic_machine=`echo "$basic_machine" | sed 's/digital.*/dec/'` - ;; - *-commodore*) - basic_machine=`echo "$basic_machine" | sed 's/commodore.*/cbm/'` - ;; - *) - ;; -esac - -# Decode manufacturer-specific aliases for certain operating systems. - -if [ x"$os" != x"" ] -then -case $os in - # First match some system type aliases that might get confused - # with valid system types. - # -solaris* is a basic system type, with this one exception. - -auroraux) - os=-auroraux - ;; - -solaris1 | -solaris1.*) - os=`echo $os | sed -e 's|solaris1|sunos4|'` - ;; - -solaris) - os=-solaris2 - ;; - -unixware*) - os=-sysv4.2uw - ;; - -gnu/linux*) - os=`echo $os | sed -e 's|gnu/linux|linux-gnu|'` - ;; - # es1800 is here to avoid being matched by es* (a different OS) - -es1800*) - os=-ose - ;; - # Now accept the basic system types. - # The portable systems comes first. - # Each alternative MUST end in a * to match a version number. - # -sysv* is not here because it comes later, after sysvr4. - -gnu* | -bsd* | -mach* | -minix* | -genix* | -ultrix* | -irix* \ - | -*vms* | -sco* | -esix* | -isc* | -aix* | -cnk* | -sunos | -sunos[34]*\ - | -hpux* | -unos* | -osf* | -luna* | -dgux* | -auroraux* | -solaris* \ - | -sym* | -kopensolaris* | -plan9* \ - | -amigaos* | -amigados* | -msdos* | -newsos* | -unicos* | -aof* \ - | -aos* | -aros* | -cloudabi* | -sortix* \ - | -nindy* | -vxsim* | -vxworks* | -ebmon* | -hms* | -mvs* \ - | -clix* | -riscos* | -uniplus* | -iris* | -rtu* | -xenix* \ - | -hiux* | -knetbsd* | -mirbsd* | -netbsd* \ - | -bitrig* | -openbsd* | -solidbsd* | -libertybsd* \ - | -ekkobsd* | -kfreebsd* | -freebsd* | -riscix* | -lynxos* \ - | -bosx* | -nextstep* | -cxux* | -aout* | -elf* | -oabi* \ - | -ptx* | -coff* | -ecoff* | -winnt* | -domain* | -vsta* \ - | -udi* | -eabi* | -lites* | -ieee* | -go32* | -aux* \ - | -chorusos* | -chorusrdb* | -cegcc* | -glidix* \ - | -cygwin* | -msys* | -pe* | -psos* | -moss* | -proelf* | -rtems* \ - | -midipix* | -mingw32* | -mingw64* | -linux-gnu* | -linux-android* \ - | -linux-newlib* | -linux-musl* | -linux-uclibc* \ - | -uxpv* | -beos* | -mpeix* | -udk* | -moxiebox* \ - | -interix* | -uwin* | -mks* | -rhapsody* | -darwin* \ - | -openstep* | -oskit* | -conix* | -pw32* | -nonstopux* \ - | -storm-chaos* | -tops10* | -tenex* | -tops20* | -its* \ - | -os2* | -vos* | -palmos* | -uclinux* | -nucleus* \ - | -morphos* | -superux* | -rtmk* | -windiss* \ - | -powermax* | -dnix* | -nx6 | -nx7 | -sei* | -dragonfly* \ - | -skyos* | -haiku* | -rdos* | -toppers* | -drops* | -es* \ - | -onefs* | -tirtos* | -phoenix* | -fuchsia* | -redox* | -bme* \ - | -midnightbsd*) - # Remember, each alternative MUST END IN *, to match a version number. - ;; - -qnx*) - case $basic_machine in - x86-* | i*86-*) - ;; - *) - os=-nto$os - ;; - esac - ;; - -nto-qnx*) - ;; - -nto*) - os=`echo $os | sed -e 's|nto|nto-qnx|'` - ;; - -sim | -xray | -os68k* | -v88r* \ - | -windows* | -osx | -abug | -netware* | -os9* \ - | -macos* | -mpw* | -magic* | -mmixware* | -mon960* | -lnews*) - ;; - -mac*) - os=`echo "$os" | sed -e 's|mac|macos|'` - ;; - -linux-dietlibc) - os=-linux-dietlibc - ;; - -linux*) - os=`echo $os | sed -e 's|linux|linux-gnu|'` - ;; - -sunos5*) - os=`echo "$os" | sed -e 's|sunos5|solaris2|'` - ;; - -sunos6*) - os=`echo "$os" | sed -e 's|sunos6|solaris3|'` - ;; - -opened*) - os=-openedition - ;; - -os400*) - os=-os400 - ;; - -wince*) - os=-wince - ;; - -utek*) - os=-bsd - ;; - -dynix*) - os=-bsd - ;; - -acis*) - os=-aos - ;; - -atheos*) - os=-atheos - ;; - -syllable*) - os=-syllable - ;; - -386bsd) - os=-bsd - ;; - -ctix* | -uts*) - os=-sysv - ;; - -nova*) - os=-rtmk-nova - ;; - -ns2) - os=-nextstep2 - ;; - -nsk*) - os=-nsk - ;; - # Preserve the version number of sinix5. - -sinix5.*) - os=`echo $os | sed -e 's|sinix|sysv|'` - ;; - -sinix*) - os=-sysv4 - ;; - -tpf*) - os=-tpf - ;; - -triton*) - os=-sysv3 - ;; - -oss*) - os=-sysv3 - ;; - -svr4*) - os=-sysv4 - ;; - -svr3) - os=-sysv3 - ;; - -sysvr4) - os=-sysv4 - ;; - # This must come after -sysvr4. - -sysv*) - ;; - -ose*) - os=-ose - ;; - -*mint | -mint[0-9]* | -*MiNT | -MiNT[0-9]*) - os=-mint - ;; - -zvmoe) - os=-zvmoe - ;; - -dicos*) - os=-dicos - ;; - -pikeos*) - # Until real need of OS specific support for - # particular features comes up, bare metal - # configurations are quite functional. - case $basic_machine in - arm*) - os=-eabi - ;; - *) - os=-elf - ;; - esac - ;; - -nacl*) - ;; - -ios) - ;; - -none) - ;; - *) - # Get rid of the `-' at the beginning of $os. - os=`echo $os | sed 's/[^-]*-//'` - echo Invalid configuration \`"$1"\': system \`"$os"\' not recognized 1>&2 - exit 1 - ;; -esac -else - -# Here we handle the default operating systems that come with various machines. -# The value should be what the vendor currently ships out the door with their -# machine or put another way, the most popular os provided with the machine. - -# Note that if you're going to try to match "-MANUFACTURER" here (say, -# "-sun"), then you have to tell the case statement up towards the top -# that MANUFACTURER isn't an operating system. Otherwise, code above -# will signal an error saying that MANUFACTURER isn't an operating -# system, and we'll never get to this point. - -case $basic_machine in - score-*) - os=-elf - ;; - spu-*) - os=-elf - ;; - *-acorn) - os=-riscix1.2 - ;; - arm*-rebel) - os=-linux - ;; - arm*-semi) - os=-aout - ;; - c4x-* | tic4x-*) - os=-coff - ;; - c8051-*) - os=-elf - ;; - hexagon-*) - os=-elf - ;; - tic54x-*) - os=-coff - ;; - tic55x-*) - os=-coff - ;; - tic6x-*) - os=-coff - ;; - # This must come before the *-dec entry. - pdp10-*) - os=-tops20 - ;; - pdp11-*) - os=-none - ;; - *-dec | vax-*) - os=-ultrix4.2 - ;; - m68*-apollo) - os=-domain - ;; - i386-sun) - os=-sunos4.0.2 - ;; - m68000-sun) - os=-sunos3 - ;; - m68*-cisco) - os=-aout - ;; - mep-*) - os=-elf - ;; - mips*-cisco) - os=-elf - ;; - mips*-*) - os=-elf - ;; - or32-*) - os=-coff - ;; - *-tti) # must be before sparc entry or we get the wrong os. - os=-sysv3 - ;; - sparc-* | *-sun) - os=-sunos4.1.1 - ;; - pru-*) - os=-elf - ;; - *-be) - os=-beos - ;; - *-ibm) - os=-aix - ;; - *-knuth) - os=-mmixware - ;; - *-wec) - os=-proelf - ;; - *-winbond) - os=-proelf - ;; - *-oki) - os=-proelf - ;; - *-hp) - os=-hpux - ;; - *-hitachi) - os=-hiux - ;; - i860-* | *-att | *-ncr | *-altos | *-motorola | *-convergent) - os=-sysv - ;; - *-cbm) - os=-amigaos - ;; - *-dg) - os=-dgux - ;; - *-dolphin) - os=-sysv3 - ;; - m68k-ccur) - os=-rtu - ;; - m88k-omron*) - os=-luna - ;; - *-next) - os=-nextstep - ;; - *-sequent) - os=-ptx - ;; - *-crds) - os=-unos - ;; - *-ns) - os=-genix - ;; - i370-*) - os=-mvs - ;; - *-gould) - os=-sysv - ;; - *-highlevel) - os=-bsd - ;; - *-encore) - os=-bsd - ;; - *-sgi) - os=-irix - ;; - *-siemens) - os=-sysv4 - ;; - *-masscomp) - os=-rtu - ;; - f30[01]-fujitsu | f700-fujitsu) - os=-uxpv - ;; - *-rom68k) - os=-coff - ;; - *-*bug) - os=-coff - ;; - *-apple) - os=-macos - ;; - *-atari*) - os=-mint - ;; - *) - os=-none - ;; -esac -fi - -# Here we handle the case where we know the os, and the CPU type, but not the -# manufacturer. We pick the logical manufacturer. -vendor=unknown -case $basic_machine in - *-unknown) - case $os in - -riscix*) - vendor=acorn - ;; - -sunos*) - vendor=sun - ;; - -cnk*|-aix*) - vendor=ibm - ;; - -beos*) - vendor=be - ;; - -hpux*) - vendor=hp - ;; - -mpeix*) - vendor=hp - ;; - -hiux*) - vendor=hitachi - ;; - -unos*) - vendor=crds - ;; - -dgux*) - vendor=dg - ;; - -luna*) - vendor=omron - ;; - -genix*) - vendor=ns - ;; - -mvs* | -opened*) - vendor=ibm - ;; - -os400*) - vendor=ibm - ;; - -ptx*) - vendor=sequent - ;; - -tpf*) - vendor=ibm - ;; - -vxsim* | -vxworks* | -windiss*) - vendor=wrs - ;; - -aux*) - vendor=apple - ;; - -hms*) - vendor=hitachi - ;; - -mpw* | -macos*) - vendor=apple - ;; - -*mint | -mint[0-9]* | -*MiNT | -MiNT[0-9]*) - vendor=atari - ;; - -vos*) - vendor=stratus - ;; - esac - basic_machine=`echo "$basic_machine" | sed "s/unknown/$vendor/"` - ;; -esac - -echo "$basic_machine$os" -exit - -# Local variables: -# eval: (add-hook 'write-file-functions 'time-stamp) -# time-stamp-start: "timestamp='" -# time-stamp-format: "%:y-%02m-%02d" -# time-stamp-end: "'" -# End: diff --git a/extra/protobuf/protobuf-3.19.4/configure b/extra/protobuf/protobuf-3.19.4/configure deleted file mode 100755 index 6763252620e7..000000000000 --- a/extra/protobuf/protobuf-3.19.4/configure +++ /dev/null @@ -1,25116 +0,0 @@ -#! /bin/sh -# Guess values for system-dependent variables and create Makefiles. -# Generated by GNU Autoconf 2.71 for Protocol Buffers 3.19.4. -# -# Report bugs to . -# -# -# Copyright (C) 1992-1996, 1998-2017, 2020-2021 Free Software Foundation, -# Inc. -# -# -# This configure script is free software; the Free Software Foundation -# gives unlimited permission to copy, distribute and modify it. -## -------------------- ## -## M4sh Initialization. ## -## -------------------- ## - -# Be more Bourne compatible -DUALCASE=1; export DUALCASE # for MKS sh -as_nop=: -if test ${ZSH_VERSION+y} && (emulate sh) >/dev/null 2>&1 -then : - emulate sh - NULLCMD=: - # Pre-4.2 versions of Zsh do word splitting on ${1+"$@"}, which - # is contrary to our usage. Disable this feature. - alias -g '${1+"$@"}'='"$@"' - setopt NO_GLOB_SUBST -else $as_nop - case `(set -o) 2>/dev/null` in #( - *posix*) : - set -o posix ;; #( - *) : - ;; -esac -fi - - - -# Reset variables that may have inherited troublesome values from -# the environment. - -# IFS needs to be set, to space, tab, and newline, in precisely that order. -# (If _AS_PATH_WALK were called with IFS unset, it would have the -# side effect of setting IFS to empty, thus disabling word splitting.) -# Quoting is to prevent editors from complaining about space-tab. -as_nl=' -' -export as_nl -IFS=" "" $as_nl" - -PS1='$ ' -PS2='> ' -PS4='+ ' - -# Ensure predictable behavior from utilities with locale-dependent output. -LC_ALL=C -export LC_ALL -LANGUAGE=C -export LANGUAGE - -# We cannot yet rely on "unset" to work, but we need these variables -# to be unset--not just set to an empty or harmless value--now, to -# avoid bugs in old shells (e.g. pre-3.0 UWIN ksh). This construct -# also avoids known problems related to "unset" and subshell syntax -# in other old shells (e.g. bash 2.01 and pdksh 5.2.14). -for as_var in BASH_ENV ENV MAIL MAILPATH CDPATH -do eval test \${$as_var+y} \ - && ( (unset $as_var) || exit 1) >/dev/null 2>&1 && unset $as_var || : -done - -# Ensure that fds 0, 1, and 2 are open. -if (exec 3>&0) 2>/dev/null; then :; else exec 0&1) 2>/dev/null; then :; else exec 1>/dev/null; fi -if (exec 3>&2) ; then :; else exec 2>/dev/null; fi - -# The user is always right. -if ${PATH_SEPARATOR+false} :; then - PATH_SEPARATOR=: - (PATH='/bin;/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 && { - (PATH='/bin:/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 || - PATH_SEPARATOR=';' - } -fi - - -# Find who we are. Look in the path if we contain no directory separator. -as_myself= -case $0 in #(( - *[\\/]* ) as_myself=$0 ;; - *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - case $as_dir in #((( - '') as_dir=./ ;; - */) ;; - *) as_dir=$as_dir/ ;; - esac - test -r "$as_dir$0" && as_myself=$as_dir$0 && break - done -IFS=$as_save_IFS - - ;; -esac -# We did not find ourselves, most probably we were run as `sh COMMAND' -# in which case we are not to be found in the path. -if test "x$as_myself" = x; then - as_myself=$0 -fi -if test ! -f "$as_myself"; then - printf "%s\n" "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2 - exit 1 -fi - - -# Use a proper internal environment variable to ensure we don't fall - # into an infinite loop, continuously re-executing ourselves. - if test x"${_as_can_reexec}" != xno && test "x$CONFIG_SHELL" != x; then - _as_can_reexec=no; export _as_can_reexec; - # We cannot yet assume a decent shell, so we have to provide a -# neutralization value for shells without unset; and this also -# works around shells that cannot unset nonexistent variables. -# Preserve -v and -x to the replacement shell. -BASH_ENV=/dev/null -ENV=/dev/null -(unset BASH_ENV) >/dev/null 2>&1 && unset BASH_ENV ENV -case $- in # (((( - *v*x* | *x*v* ) as_opts=-vx ;; - *v* ) as_opts=-v ;; - *x* ) as_opts=-x ;; - * ) as_opts= ;; -esac -exec $CONFIG_SHELL $as_opts "$as_myself" ${1+"$@"} -# Admittedly, this is quite paranoid, since all the known shells bail -# out after a failed `exec'. -printf "%s\n" "$0: could not re-execute with $CONFIG_SHELL" >&2 -exit 255 - fi - # We don't want this to propagate to other subprocesses. - { _as_can_reexec=; unset _as_can_reexec;} -if test "x$CONFIG_SHELL" = x; then - as_bourne_compatible="as_nop=: -if test \${ZSH_VERSION+y} && (emulate sh) >/dev/null 2>&1 -then : - emulate sh - NULLCMD=: - # Pre-4.2 versions of Zsh do word splitting on \${1+\"\$@\"}, which - # is contrary to our usage. Disable this feature. - alias -g '\${1+\"\$@\"}'='\"\$@\"' - setopt NO_GLOB_SUBST -else \$as_nop - case \`(set -o) 2>/dev/null\` in #( - *posix*) : - set -o posix ;; #( - *) : - ;; -esac -fi -" - as_required="as_fn_return () { (exit \$1); } -as_fn_success () { as_fn_return 0; } -as_fn_failure () { as_fn_return 1; } -as_fn_ret_success () { return 0; } -as_fn_ret_failure () { return 1; } - -exitcode=0 -as_fn_success || { exitcode=1; echo as_fn_success failed.; } -as_fn_failure && { exitcode=1; echo as_fn_failure succeeded.; } -as_fn_ret_success || { exitcode=1; echo as_fn_ret_success failed.; } -as_fn_ret_failure && { exitcode=1; echo as_fn_ret_failure succeeded.; } -if ( set x; as_fn_ret_success y && test x = \"\$1\" ) -then : - -else \$as_nop - exitcode=1; echo positional parameters were not saved. -fi -test x\$exitcode = x0 || exit 1 -blah=\$(echo \$(echo blah)) -test x\"\$blah\" = xblah || exit 1 -test -x / || exit 1" - as_suggested=" as_lineno_1=";as_suggested=$as_suggested$LINENO;as_suggested=$as_suggested" as_lineno_1a=\$LINENO - as_lineno_2=";as_suggested=$as_suggested$LINENO;as_suggested=$as_suggested" as_lineno_2a=\$LINENO - eval 'test \"x\$as_lineno_1'\$as_run'\" != \"x\$as_lineno_2'\$as_run'\" && - test \"x\`expr \$as_lineno_1'\$as_run' + 1\`\" = \"x\$as_lineno_2'\$as_run'\"' || exit 1 - - test -n \"\${ZSH_VERSION+set}\${BASH_VERSION+set}\" || ( - ECHO='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\' - ECHO=\$ECHO\$ECHO\$ECHO\$ECHO\$ECHO - ECHO=\$ECHO\$ECHO\$ECHO\$ECHO\$ECHO\$ECHO - PATH=/empty FPATH=/empty; export PATH FPATH - test \"X\`printf %s \$ECHO\`\" = \"X\$ECHO\" \\ - || test \"X\`print -r -- \$ECHO\`\" = \"X\$ECHO\" ) || exit 1 -test \$(( 1 + 1 )) = 2 || exit 1" - if (eval "$as_required") 2>/dev/null -then : - as_have_required=yes -else $as_nop - as_have_required=no -fi - if test x$as_have_required = xyes && (eval "$as_suggested") 2>/dev/null -then : - -else $as_nop - as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -as_found=false -for as_dir in /bin$PATH_SEPARATOR/usr/bin$PATH_SEPARATOR$PATH -do - IFS=$as_save_IFS - case $as_dir in #((( - '') as_dir=./ ;; - */) ;; - *) as_dir=$as_dir/ ;; - esac - as_found=: - case $as_dir in #( - /*) - for as_base in sh bash ksh sh5; do - # Try only shells that exist, to save several forks. - as_shell=$as_dir$as_base - if { test -f "$as_shell" || test -f "$as_shell.exe"; } && - as_run=a "$as_shell" -c "$as_bourne_compatible""$as_required" 2>/dev/null -then : - CONFIG_SHELL=$as_shell as_have_required=yes - if as_run=a "$as_shell" -c "$as_bourne_compatible""$as_suggested" 2>/dev/null -then : - break 2 -fi -fi - done;; - esac - as_found=false -done -IFS=$as_save_IFS -if $as_found -then : - -else $as_nop - if { test -f "$SHELL" || test -f "$SHELL.exe"; } && - as_run=a "$SHELL" -c "$as_bourne_compatible""$as_required" 2>/dev/null -then : - CONFIG_SHELL=$SHELL as_have_required=yes -fi -fi - - - if test "x$CONFIG_SHELL" != x -then : - export CONFIG_SHELL - # We cannot yet assume a decent shell, so we have to provide a -# neutralization value for shells without unset; and this also -# works around shells that cannot unset nonexistent variables. -# Preserve -v and -x to the replacement shell. -BASH_ENV=/dev/null -ENV=/dev/null -(unset BASH_ENV) >/dev/null 2>&1 && unset BASH_ENV ENV -case $- in # (((( - *v*x* | *x*v* ) as_opts=-vx ;; - *v* ) as_opts=-v ;; - *x* ) as_opts=-x ;; - * ) as_opts= ;; -esac -exec $CONFIG_SHELL $as_opts "$as_myself" ${1+"$@"} -# Admittedly, this is quite paranoid, since all the known shells bail -# out after a failed `exec'. -printf "%s\n" "$0: could not re-execute with $CONFIG_SHELL" >&2 -exit 255 -fi - - if test x$as_have_required = xno -then : - printf "%s\n" "$0: This script requires a shell more modern than all" - printf "%s\n" "$0: the shells that I found on your system." - if test ${ZSH_VERSION+y} ; then - printf "%s\n" "$0: In particular, zsh $ZSH_VERSION has bugs and should" - printf "%s\n" "$0: be upgraded to zsh 4.3.4 or later." - else - printf "%s\n" "$0: Please tell bug-autoconf@gnu.org and -$0: protobuf@googlegroups.com about your system, including -$0: any error possibly output before this message. Then -$0: install a modern shell, or manually run the script -$0: under such a shell if you do have one." - fi - exit 1 -fi -fi -fi -SHELL=${CONFIG_SHELL-/bin/sh} -export SHELL -# Unset more variables known to interfere with behavior of common tools. -CLICOLOR_FORCE= GREP_OPTIONS= -unset CLICOLOR_FORCE GREP_OPTIONS - -## --------------------- ## -## M4sh Shell Functions. ## -## --------------------- ## -# as_fn_unset VAR -# --------------- -# Portably unset VAR. -as_fn_unset () -{ - { eval $1=; unset $1;} -} -as_unset=as_fn_unset - - -# as_fn_set_status STATUS -# ----------------------- -# Set $? to STATUS, without forking. -as_fn_set_status () -{ - return $1 -} # as_fn_set_status - -# as_fn_exit STATUS -# ----------------- -# Exit the shell with STATUS, even in a "trap 0" or "set -e" context. -as_fn_exit () -{ - set +e - as_fn_set_status $1 - exit $1 -} # as_fn_exit -# as_fn_nop -# --------- -# Do nothing but, unlike ":", preserve the value of $?. -as_fn_nop () -{ - return $? -} -as_nop=as_fn_nop - -# as_fn_mkdir_p -# ------------- -# Create "$as_dir" as a directory, including parents if necessary. -as_fn_mkdir_p () -{ - - case $as_dir in #( - -*) as_dir=./$as_dir;; - esac - test -d "$as_dir" || eval $as_mkdir_p || { - as_dirs= - while :; do - case $as_dir in #( - *\'*) as_qdir=`printf "%s\n" "$as_dir" | sed "s/'/'\\\\\\\\''/g"`;; #'( - *) as_qdir=$as_dir;; - esac - as_dirs="'$as_qdir' $as_dirs" - as_dir=`$as_dirname -- "$as_dir" || -$as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ - X"$as_dir" : 'X\(//\)[^/]' \| \ - X"$as_dir" : 'X\(//\)$' \| \ - X"$as_dir" : 'X\(/\)' \| . 2>/dev/null || -printf "%s\n" X"$as_dir" | - sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ - s//\1/ - q - } - /^X\(\/\/\)[^/].*/{ - s//\1/ - q - } - /^X\(\/\/\)$/{ - s//\1/ - q - } - /^X\(\/\).*/{ - s//\1/ - q - } - s/.*/./; q'` - test -d "$as_dir" && break - done - test -z "$as_dirs" || eval "mkdir $as_dirs" - } || test -d "$as_dir" || as_fn_error $? "cannot create directory $as_dir" - - -} # as_fn_mkdir_p - -# as_fn_executable_p FILE -# ----------------------- -# Test if FILE is an executable regular file. -as_fn_executable_p () -{ - test -f "$1" && test -x "$1" -} # as_fn_executable_p -# as_fn_append VAR VALUE -# ---------------------- -# Append the text in VALUE to the end of the definition contained in VAR. Take -# advantage of any shell optimizations that allow amortized linear growth over -# repeated appends, instead of the typical quadratic growth present in naive -# implementations. -if (eval "as_var=1; as_var+=2; test x\$as_var = x12") 2>/dev/null -then : - eval 'as_fn_append () - { - eval $1+=\$2 - }' -else $as_nop - as_fn_append () - { - eval $1=\$$1\$2 - } -fi # as_fn_append - -# as_fn_arith ARG... -# ------------------ -# Perform arithmetic evaluation on the ARGs, and store the result in the -# global $as_val. Take advantage of shells that can avoid forks. The arguments -# must be portable across $(()) and expr. -if (eval "test \$(( 1 + 1 )) = 2") 2>/dev/null -then : - eval 'as_fn_arith () - { - as_val=$(( $* )) - }' -else $as_nop - as_fn_arith () - { - as_val=`expr "$@" || test $? -eq 1` - } -fi # as_fn_arith - -# as_fn_nop -# --------- -# Do nothing but, unlike ":", preserve the value of $?. -as_fn_nop () -{ - return $? -} -as_nop=as_fn_nop - -# as_fn_error STATUS ERROR [LINENO LOG_FD] -# ---------------------------------------- -# Output "`basename $0`: error: ERROR" to stderr. If LINENO and LOG_FD are -# provided, also output the error to LOG_FD, referencing LINENO. Then exit the -# script with STATUS, using 1 if that was 0. -as_fn_error () -{ - as_status=$1; test $as_status -eq 0 && as_status=1 - if test "$4"; then - as_lineno=${as_lineno-"$3"} as_lineno_stack=as_lineno_stack=$as_lineno_stack - printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: $2" >&$4 - fi - printf "%s\n" "$as_me: error: $2" >&2 - as_fn_exit $as_status -} # as_fn_error - -if expr a : '\(a\)' >/dev/null 2>&1 && - test "X`expr 00001 : '.*\(...\)'`" = X001; then - as_expr=expr -else - as_expr=false -fi - -if (basename -- /) >/dev/null 2>&1 && test "X`basename -- / 2>&1`" = "X/"; then - as_basename=basename -else - as_basename=false -fi - -if (as_dir=`dirname -- /` && test "X$as_dir" = X/) >/dev/null 2>&1; then - as_dirname=dirname -else - as_dirname=false -fi - -as_me=`$as_basename -- "$0" || -$as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \ - X"$0" : 'X\(//\)$' \| \ - X"$0" : 'X\(/\)' \| . 2>/dev/null || -printf "%s\n" X/"$0" | - sed '/^.*\/\([^/][^/]*\)\/*$/{ - s//\1/ - q - } - /^X\/\(\/\/\)$/{ - s//\1/ - q - } - /^X\/\(\/\).*/{ - s//\1/ - q - } - s/.*/./; q'` - -# Avoid depending upon Character Ranges. -as_cr_letters='abcdefghijklmnopqrstuvwxyz' -as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ' -as_cr_Letters=$as_cr_letters$as_cr_LETTERS -as_cr_digits='0123456789' -as_cr_alnum=$as_cr_Letters$as_cr_digits - - - as_lineno_1=$LINENO as_lineno_1a=$LINENO - as_lineno_2=$LINENO as_lineno_2a=$LINENO - eval 'test "x$as_lineno_1'$as_run'" != "x$as_lineno_2'$as_run'" && - test "x`expr $as_lineno_1'$as_run' + 1`" = "x$as_lineno_2'$as_run'"' || { - # Blame Lee E. McMahon (1931-1989) for sed's syntax. :-) - sed -n ' - p - /[$]LINENO/= - ' <$as_myself | - sed ' - s/[$]LINENO.*/&-/ - t lineno - b - :lineno - N - :loop - s/[$]LINENO\([^'$as_cr_alnum'_].*\n\)\(.*\)/\2\1\2/ - t loop - s/-\n.*// - ' >$as_me.lineno && - chmod +x "$as_me.lineno" || - { printf "%s\n" "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2; as_fn_exit 1; } - - # If we had to re-execute with $CONFIG_SHELL, we're ensured to have - # already done that, so ensure we don't try to do so again and fall - # in an infinite loop. This has already happened in practice. - _as_can_reexec=no; export _as_can_reexec - # Don't try to exec as it changes $[0], causing all sort of problems - # (the dirname of $[0] is not the place where we might find the - # original and so on. Autoconf is especially sensitive to this). - . "./$as_me.lineno" - # Exit status is that of the last command. - exit -} - - -# Determine whether it's possible to make 'echo' print without a newline. -# These variables are no longer used directly by Autoconf, but are AC_SUBSTed -# for compatibility with existing Makefiles. -ECHO_C= ECHO_N= ECHO_T= -case `echo -n x` in #((((( --n*) - case `echo 'xy\c'` in - *c*) ECHO_T=' ';; # ECHO_T is single tab character. - xy) ECHO_C='\c';; - *) echo `echo ksh88 bug on AIX 6.1` > /dev/null - ECHO_T=' ';; - esac;; -*) - ECHO_N='-n';; -esac - -# For backward compatibility with old third-party macros, we provide -# the shell variables $as_echo and $as_echo_n. New code should use -# AS_ECHO(["message"]) and AS_ECHO_N(["message"]), respectively. -as_echo='printf %s\n' -as_echo_n='printf %s' - - -rm -f conf$$ conf$$.exe conf$$.file -if test -d conf$$.dir; then - rm -f conf$$.dir/conf$$.file -else - rm -f conf$$.dir - mkdir conf$$.dir 2>/dev/null -fi -if (echo >conf$$.file) 2>/dev/null; then - if ln -s conf$$.file conf$$ 2>/dev/null; then - as_ln_s='ln -s' - # ... but there are two gotchas: - # 1) On MSYS, both `ln -s file dir' and `ln file dir' fail. - # 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable. - # In both cases, we have to default to `cp -pR'. - ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe || - as_ln_s='cp -pR' - elif ln conf$$.file conf$$ 2>/dev/null; then - as_ln_s=ln - else - as_ln_s='cp -pR' - fi -else - as_ln_s='cp -pR' -fi -rm -f conf$$ conf$$.exe conf$$.dir/conf$$.file conf$$.file -rmdir conf$$.dir 2>/dev/null - -if mkdir -p . 2>/dev/null; then - as_mkdir_p='mkdir -p "$as_dir"' -else - test -d ./-p && rmdir ./-p - as_mkdir_p=false -fi - -as_test_x='test -x' -as_executable_p=as_fn_executable_p - -# Sed expression to map a string onto a valid CPP name. -as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'" - -# Sed expression to map a string onto a valid variable name. -as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'" - -SHELL=${CONFIG_SHELL-/bin/sh} - - -test -n "$DJDIR" || exec 7<&0 &1 - -# Name of the host. -# hostname on some systems (SVR3.2, old GNU/Linux) returns a bogus exit status, -# so uname gets run too. -ac_hostname=`(hostname || uname -n) 2>/dev/null | sed 1q` - -# -# Initializations. -# -ac_default_prefix=/usr/local -ac_clean_files= -ac_config_libobj_dir=. -LIBOBJS= -cross_compiling=no -subdirs= -MFLAGS= -MAKEFLAGS= - -# Identity of this package. -PACKAGE_NAME='Protocol Buffers' -PACKAGE_TARNAME='protobuf' -PACKAGE_VERSION='3.19.4' -PACKAGE_STRING='Protocol Buffers 3.19.4' -PACKAGE_BUGREPORT='protobuf@googlegroups.com' -PACKAGE_URL='' - -ac_unique_file="src/google/protobuf/message.cc" -# Factoring default headers for most tests. -ac_includes_default="\ -#include -#ifdef HAVE_STDIO_H -# include -#endif -#ifdef HAVE_STDLIB_H -# include -#endif -#ifdef HAVE_STRING_H -# include -#endif -#ifdef HAVE_INTTYPES_H -# include -#endif -#ifdef HAVE_STDINT_H -# include -#endif -#ifdef HAVE_STRINGS_H -# include -#endif -#ifdef HAVE_SYS_TYPES_H -# include -#endif -#ifdef HAVE_SYS_STAT_H -# include -#endif -#ifdef HAVE_UNISTD_H -# include -#endif" - -ac_header_cxx_list= -enable_option_checking=no -ac_subst_vars='am__EXEEXT_FALSE -am__EXEEXT_TRUE -LTLIBOBJS -subdirs -LIBLOG_LIBS -OBJC_CONFORMANCE_TEST_FALSE -OBJC_CONFORMANCE_TEST_TRUE -HAVE_PTHREAD_FALSE -HAVE_PTHREAD_TRUE -PTHREAD_CFLAGS -PTHREAD_LIBS -PTHREAD_CC -ax_pthread_config -USE_EXTERNAL_PROTOC_FALSE -USE_EXTERNAL_PROTOC_TRUE -PROTOC -LIBATOMIC_LIBS -HAVE_CXX11 -HAVE_ZLIB_FALSE -HAVE_ZLIB_TRUE -POW_LIB -LIBOBJS -HAVE_LD_VERSION_SCRIPT_FALSE -HAVE_LD_VERSION_SCRIPT_TRUE -LT_SYS_LIBRARY_PATH -OTOOL64 -OTOOL -LIPO -NMEDIT -DSYMUTIL -MANIFEST_TOOL -RANLIB -DLLTOOL -OBJDUMP -LN_S -NM -ac_ct_DUMPBIN -DUMPBIN -LD -FGREP -EGREP -GREP -SED -LIBTOOL -ISAINFO -PROTOBUF_OPT_FLAG -am__fastdepOBJC_FALSE -am__fastdepOBJC_TRUE -OBJCDEPMODE -ac_ct_OBJC -OBJCFLAGS -OBJC -GCC_FALSE -GCC_TRUE -ac_ct_AR -AR -CXXCPPFLAGS_FOR_BUILD -CXXFLAGS_FOR_BUILD -CXXCPP_FOR_BUILD -ac_ct_CXX_FOR_BUILD -CXX_FOR_BUILD -CXXCPP -LDFLAGS_FOR_BUILD -CPPFLAGS_FOR_BUILD -CFLAGS_FOR_BUILD -BUILD_OBJEXT -BUILD_EXEEXT -CPP_FOR_BUILD -ac_ct_CC_FOR_BUILD -CC_FOR_BUILD -CPP -am__fastdepCXX_FALSE -am__fastdepCXX_TRUE -CXXDEPMODE -ac_ct_CXX -CXXFLAGS -CXX -am__fastdepCC_FALSE -am__fastdepCC_TRUE -CCDEPMODE -am__nodep -AMDEPBACKSLASH -AMDEP_FALSE -AMDEP_TRUE -am__include -DEPDIR -OBJEXT -EXEEXT -ac_ct_CC -CPPFLAGS -LDFLAGS -CFLAGS -CC -AM_BACKSLASH -AM_DEFAULT_VERBOSITY -AM_DEFAULT_V -AM_V -CSCOPE -ETAGS -CTAGS -am__untar -am__tar -AMTAR -am__leading_dot -SET_MAKE -AWK -mkdir_p -MKDIR_P -INSTALL_STRIP_PROGRAM -STRIP -install_sh -MAKEINFO -AUTOHEADER -AUTOMAKE -AUTOCONF -ACLOCAL -VERSION -PACKAGE -CYGPATH_W -am__isrc -INSTALL_DATA -INSTALL_SCRIPT -INSTALL_PROGRAM -target_os -target_vendor -target_cpu -target -host_os -host_vendor -host_cpu -host -build_os -build_vendor -build_cpu -build -DIST_LANG -MAINT -MAINTAINER_MODE_FALSE -MAINTAINER_MODE_TRUE -target_alias -host_alias -build_alias -LIBS -ECHO_T -ECHO_N -ECHO_C -DEFS -mandir -localedir -libdir -psdir -pdfdir -dvidir -htmldir -infodir -docdir -oldincludedir -includedir -runstatedir -localstatedir -sharedstatedir -sysconfdir -datadir -datarootdir -libexecdir -sbindir -bindir -program_transform_name -prefix -exec_prefix -PACKAGE_URL -PACKAGE_BUGREPORT -PACKAGE_STRING -PACKAGE_VERSION -PACKAGE_TARNAME -PACKAGE_NAME -PATH_SEPARATOR -SHELL -am__quote' -ac_subst_files='' -ac_user_opts=' -enable_option_checking -enable_maintainer_mode -enable_silent_rules -with_zlib -with_zlib_include -with_zlib_lib -with_protoc -enable_dependency_tracking -enable_64bit_solaris -enable_shared -enable_static -with_pic -enable_fast_install -with_aix_soname -with_gnu_ld -with_sysroot -enable_libtool_lock -' - ac_precious_vars='build_alias -host_alias -target_alias -DIST_LANG -CC -CFLAGS -LDFLAGS -LIBS -CPPFLAGS -CXX -CXXFLAGS -CCC -CPP -CXXCPP -OBJC -OBJCFLAGS -LT_SYS_LIBRARY_PATH' -ac_subdirs_all='third_party/googletest' - -# Initialize some variables set by options. -ac_init_help= -ac_init_version=false -ac_unrecognized_opts= -ac_unrecognized_sep= -# The variables have the same names as the options, with -# dashes changed to underlines. -cache_file=/dev/null -exec_prefix=NONE -no_create= -no_recursion= -prefix=NONE -program_prefix=NONE -program_suffix=NONE -program_transform_name=s,x,x, -silent= -site= -srcdir= -verbose= -x_includes=NONE -x_libraries=NONE - -# Installation directory options. -# These are left unexpanded so users can "make install exec_prefix=/foo" -# and all the variables that are supposed to be based on exec_prefix -# by default will actually change. -# Use braces instead of parens because sh, perl, etc. also accept them. -# (The list follows the same order as the GNU Coding Standards.) -bindir='${exec_prefix}/bin' -sbindir='${exec_prefix}/sbin' -libexecdir='${exec_prefix}/libexec' -datarootdir='${prefix}/share' -datadir='${datarootdir}' -sysconfdir='${prefix}/etc' -sharedstatedir='${prefix}/com' -localstatedir='${prefix}/var' -runstatedir='${localstatedir}/run' -includedir='${prefix}/include' -oldincludedir='/usr/include' -docdir='${datarootdir}/doc/${PACKAGE_TARNAME}' -infodir='${datarootdir}/info' -htmldir='${docdir}' -dvidir='${docdir}' -pdfdir='${docdir}' -psdir='${docdir}' -libdir='${exec_prefix}/lib' -localedir='${datarootdir}/locale' -mandir='${datarootdir}/man' - -ac_prev= -ac_dashdash= -for ac_option -do - # If the previous option needs an argument, assign it. - if test -n "$ac_prev"; then - eval $ac_prev=\$ac_option - ac_prev= - continue - fi - - case $ac_option in - *=?*) ac_optarg=`expr "X$ac_option" : '[^=]*=\(.*\)'` ;; - *=) ac_optarg= ;; - *) ac_optarg=yes ;; - esac - - case $ac_dashdash$ac_option in - --) - ac_dashdash=yes ;; - - -bindir | --bindir | --bindi | --bind | --bin | --bi) - ac_prev=bindir ;; - -bindir=* | --bindir=* | --bindi=* | --bind=* | --bin=* | --bi=*) - bindir=$ac_optarg ;; - - -build | --build | --buil | --bui | --bu) - ac_prev=build_alias ;; - -build=* | --build=* | --buil=* | --bui=* | --bu=*) - build_alias=$ac_optarg ;; - - -cache-file | --cache-file | --cache-fil | --cache-fi \ - | --cache-f | --cache- | --cache | --cach | --cac | --ca | --c) - ac_prev=cache_file ;; - -cache-file=* | --cache-file=* | --cache-fil=* | --cache-fi=* \ - | --cache-f=* | --cache-=* | --cache=* | --cach=* | --cac=* | --ca=* | --c=*) - cache_file=$ac_optarg ;; - - --config-cache | -C) - cache_file=config.cache ;; - - -datadir | --datadir | --datadi | --datad) - ac_prev=datadir ;; - -datadir=* | --datadir=* | --datadi=* | --datad=*) - datadir=$ac_optarg ;; - - -datarootdir | --datarootdir | --datarootdi | --datarootd | --dataroot \ - | --dataroo | --dataro | --datar) - ac_prev=datarootdir ;; - -datarootdir=* | --datarootdir=* | --datarootdi=* | --datarootd=* \ - | --dataroot=* | --dataroo=* | --dataro=* | --datar=*) - datarootdir=$ac_optarg ;; - - -disable-* | --disable-*) - ac_useropt=`expr "x$ac_option" : 'x-*disable-\(.*\)'` - # Reject names that are not valid shell variable names. - expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && - as_fn_error $? "invalid feature name: \`$ac_useropt'" - ac_useropt_orig=$ac_useropt - ac_useropt=`printf "%s\n" "$ac_useropt" | sed 's/[-+.]/_/g'` - case $ac_user_opts in - *" -"enable_$ac_useropt" -"*) ;; - *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--disable-$ac_useropt_orig" - ac_unrecognized_sep=', ';; - esac - eval enable_$ac_useropt=no ;; - - -docdir | --docdir | --docdi | --doc | --do) - ac_prev=docdir ;; - -docdir=* | --docdir=* | --docdi=* | --doc=* | --do=*) - docdir=$ac_optarg ;; - - -dvidir | --dvidir | --dvidi | --dvid | --dvi | --dv) - ac_prev=dvidir ;; - -dvidir=* | --dvidir=* | --dvidi=* | --dvid=* | --dvi=* | --dv=*) - dvidir=$ac_optarg ;; - - -enable-* | --enable-*) - ac_useropt=`expr "x$ac_option" : 'x-*enable-\([^=]*\)'` - # Reject names that are not valid shell variable names. - expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && - as_fn_error $? "invalid feature name: \`$ac_useropt'" - ac_useropt_orig=$ac_useropt - ac_useropt=`printf "%s\n" "$ac_useropt" | sed 's/[-+.]/_/g'` - case $ac_user_opts in - *" -"enable_$ac_useropt" -"*) ;; - *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--enable-$ac_useropt_orig" - ac_unrecognized_sep=', ';; - esac - eval enable_$ac_useropt=\$ac_optarg ;; - - -exec-prefix | --exec_prefix | --exec-prefix | --exec-prefi \ - | --exec-pref | --exec-pre | --exec-pr | --exec-p | --exec- \ - | --exec | --exe | --ex) - ac_prev=exec_prefix ;; - -exec-prefix=* | --exec_prefix=* | --exec-prefix=* | --exec-prefi=* \ - | --exec-pref=* | --exec-pre=* | --exec-pr=* | --exec-p=* | --exec-=* \ - | --exec=* | --exe=* | --ex=*) - exec_prefix=$ac_optarg ;; - - -gas | --gas | --ga | --g) - # Obsolete; use --with-gas. - with_gas=yes ;; - - -help | --help | --hel | --he | -h) - ac_init_help=long ;; - -help=r* | --help=r* | --hel=r* | --he=r* | -hr*) - ac_init_help=recursive ;; - -help=s* | --help=s* | --hel=s* | --he=s* | -hs*) - ac_init_help=short ;; - - -host | --host | --hos | --ho) - ac_prev=host_alias ;; - -host=* | --host=* | --hos=* | --ho=*) - host_alias=$ac_optarg ;; - - -htmldir | --htmldir | --htmldi | --htmld | --html | --htm | --ht) - ac_prev=htmldir ;; - -htmldir=* | --htmldir=* | --htmldi=* | --htmld=* | --html=* | --htm=* \ - | --ht=*) - htmldir=$ac_optarg ;; - - -includedir | --includedir | --includedi | --included | --include \ - | --includ | --inclu | --incl | --inc) - ac_prev=includedir ;; - -includedir=* | --includedir=* | --includedi=* | --included=* | --include=* \ - | --includ=* | --inclu=* | --incl=* | --inc=*) - includedir=$ac_optarg ;; - - -infodir | --infodir | --infodi | --infod | --info | --inf) - ac_prev=infodir ;; - -infodir=* | --infodir=* | --infodi=* | --infod=* | --info=* | --inf=*) - infodir=$ac_optarg ;; - - -libdir | --libdir | --libdi | --libd) - ac_prev=libdir ;; - -libdir=* | --libdir=* | --libdi=* | --libd=*) - libdir=$ac_optarg ;; - - -libexecdir | --libexecdir | --libexecdi | --libexecd | --libexec \ - | --libexe | --libex | --libe) - ac_prev=libexecdir ;; - -libexecdir=* | --libexecdir=* | --libexecdi=* | --libexecd=* | --libexec=* \ - | --libexe=* | --libex=* | --libe=*) - libexecdir=$ac_optarg ;; - - -localedir | --localedir | --localedi | --localed | --locale) - ac_prev=localedir ;; - -localedir=* | --localedir=* | --localedi=* | --localed=* | --locale=*) - localedir=$ac_optarg ;; - - -localstatedir | --localstatedir | --localstatedi | --localstated \ - | --localstate | --localstat | --localsta | --localst | --locals) - ac_prev=localstatedir ;; - -localstatedir=* | --localstatedir=* | --localstatedi=* | --localstated=* \ - | --localstate=* | --localstat=* | --localsta=* | --localst=* | --locals=*) - localstatedir=$ac_optarg ;; - - -mandir | --mandir | --mandi | --mand | --man | --ma | --m) - ac_prev=mandir ;; - -mandir=* | --mandir=* | --mandi=* | --mand=* | --man=* | --ma=* | --m=*) - mandir=$ac_optarg ;; - - -nfp | --nfp | --nf) - # Obsolete; use --without-fp. - with_fp=no ;; - - -no-create | --no-create | --no-creat | --no-crea | --no-cre \ - | --no-cr | --no-c | -n) - no_create=yes ;; - - -no-recursion | --no-recursion | --no-recursio | --no-recursi \ - | --no-recurs | --no-recur | --no-recu | --no-rec | --no-re | --no-r) - no_recursion=yes ;; - - -oldincludedir | --oldincludedir | --oldincludedi | --oldincluded \ - | --oldinclude | --oldinclud | --oldinclu | --oldincl | --oldinc \ - | --oldin | --oldi | --old | --ol | --o) - ac_prev=oldincludedir ;; - -oldincludedir=* | --oldincludedir=* | --oldincludedi=* | --oldincluded=* \ - | --oldinclude=* | --oldinclud=* | --oldinclu=* | --oldincl=* | --oldinc=* \ - | --oldin=* | --oldi=* | --old=* | --ol=* | --o=*) - oldincludedir=$ac_optarg ;; - - -prefix | --prefix | --prefi | --pref | --pre | --pr | --p) - ac_prev=prefix ;; - -prefix=* | --prefix=* | --prefi=* | --pref=* | --pre=* | --pr=* | --p=*) - prefix=$ac_optarg ;; - - -program-prefix | --program-prefix | --program-prefi | --program-pref \ - | --program-pre | --program-pr | --program-p) - ac_prev=program_prefix ;; - -program-prefix=* | --program-prefix=* | --program-prefi=* \ - | --program-pref=* | --program-pre=* | --program-pr=* | --program-p=*) - program_prefix=$ac_optarg ;; - - -program-suffix | --program-suffix | --program-suffi | --program-suff \ - | --program-suf | --program-su | --program-s) - ac_prev=program_suffix ;; - -program-suffix=* | --program-suffix=* | --program-suffi=* \ - | --program-suff=* | --program-suf=* | --program-su=* | --program-s=*) - program_suffix=$ac_optarg ;; - - -program-transform-name | --program-transform-name \ - | --program-transform-nam | --program-transform-na \ - | --program-transform-n | --program-transform- \ - | --program-transform | --program-transfor \ - | --program-transfo | --program-transf \ - | --program-trans | --program-tran \ - | --progr-tra | --program-tr | --program-t) - ac_prev=program_transform_name ;; - -program-transform-name=* | --program-transform-name=* \ - | --program-transform-nam=* | --program-transform-na=* \ - | --program-transform-n=* | --program-transform-=* \ - | --program-transform=* | --program-transfor=* \ - | --program-transfo=* | --program-transf=* \ - | --program-trans=* | --program-tran=* \ - | --progr-tra=* | --program-tr=* | --program-t=*) - program_transform_name=$ac_optarg ;; - - -pdfdir | --pdfdir | --pdfdi | --pdfd | --pdf | --pd) - ac_prev=pdfdir ;; - -pdfdir=* | --pdfdir=* | --pdfdi=* | --pdfd=* | --pdf=* | --pd=*) - pdfdir=$ac_optarg ;; - - -psdir | --psdir | --psdi | --psd | --ps) - ac_prev=psdir ;; - -psdir=* | --psdir=* | --psdi=* | --psd=* | --ps=*) - psdir=$ac_optarg ;; - - -q | -quiet | --quiet | --quie | --qui | --qu | --q \ - | -silent | --silent | --silen | --sile | --sil) - silent=yes ;; - - -runstatedir | --runstatedir | --runstatedi | --runstated \ - | --runstate | --runstat | --runsta | --runst | --runs \ - | --run | --ru | --r) - ac_prev=runstatedir ;; - -runstatedir=* | --runstatedir=* | --runstatedi=* | --runstated=* \ - | --runstate=* | --runstat=* | --runsta=* | --runst=* | --runs=* \ - | --run=* | --ru=* | --r=*) - runstatedir=$ac_optarg ;; - - -sbindir | --sbindir | --sbindi | --sbind | --sbin | --sbi | --sb) - ac_prev=sbindir ;; - -sbindir=* | --sbindir=* | --sbindi=* | --sbind=* | --sbin=* \ - | --sbi=* | --sb=*) - sbindir=$ac_optarg ;; - - -sharedstatedir | --sharedstatedir | --sharedstatedi \ - | --sharedstated | --sharedstate | --sharedstat | --sharedsta \ - | --sharedst | --shareds | --shared | --share | --shar \ - | --sha | --sh) - ac_prev=sharedstatedir ;; - -sharedstatedir=* | --sharedstatedir=* | --sharedstatedi=* \ - | --sharedstated=* | --sharedstate=* | --sharedstat=* | --sharedsta=* \ - | --sharedst=* | --shareds=* | --shared=* | --share=* | --shar=* \ - | --sha=* | --sh=*) - sharedstatedir=$ac_optarg ;; - - -site | --site | --sit) - ac_prev=site ;; - -site=* | --site=* | --sit=*) - site=$ac_optarg ;; - - -srcdir | --srcdir | --srcdi | --srcd | --src | --sr) - ac_prev=srcdir ;; - -srcdir=* | --srcdir=* | --srcdi=* | --srcd=* | --src=* | --sr=*) - srcdir=$ac_optarg ;; - - -sysconfdir | --sysconfdir | --sysconfdi | --sysconfd | --sysconf \ - | --syscon | --sysco | --sysc | --sys | --sy) - ac_prev=sysconfdir ;; - -sysconfdir=* | --sysconfdir=* | --sysconfdi=* | --sysconfd=* | --sysconf=* \ - | --syscon=* | --sysco=* | --sysc=* | --sys=* | --sy=*) - sysconfdir=$ac_optarg ;; - - -target | --target | --targe | --targ | --tar | --ta | --t) - ac_prev=target_alias ;; - -target=* | --target=* | --targe=* | --targ=* | --tar=* | --ta=* | --t=*) - target_alias=$ac_optarg ;; - - -v | -verbose | --verbose | --verbos | --verbo | --verb) - verbose=yes ;; - - -version | --version | --versio | --versi | --vers | -V) - ac_init_version=: ;; - - -with-* | --with-*) - ac_useropt=`expr "x$ac_option" : 'x-*with-\([^=]*\)'` - # Reject names that are not valid shell variable names. - expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && - as_fn_error $? "invalid package name: \`$ac_useropt'" - ac_useropt_orig=$ac_useropt - ac_useropt=`printf "%s\n" "$ac_useropt" | sed 's/[-+.]/_/g'` - case $ac_user_opts in - *" -"with_$ac_useropt" -"*) ;; - *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--with-$ac_useropt_orig" - ac_unrecognized_sep=', ';; - esac - eval with_$ac_useropt=\$ac_optarg ;; - - -without-* | --without-*) - ac_useropt=`expr "x$ac_option" : 'x-*without-\(.*\)'` - # Reject names that are not valid shell variable names. - expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && - as_fn_error $? "invalid package name: \`$ac_useropt'" - ac_useropt_orig=$ac_useropt - ac_useropt=`printf "%s\n" "$ac_useropt" | sed 's/[-+.]/_/g'` - case $ac_user_opts in - *" -"with_$ac_useropt" -"*) ;; - *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--without-$ac_useropt_orig" - ac_unrecognized_sep=', ';; - esac - eval with_$ac_useropt=no ;; - - --x) - # Obsolete; use --with-x. - with_x=yes ;; - - -x-includes | --x-includes | --x-include | --x-includ | --x-inclu \ - | --x-incl | --x-inc | --x-in | --x-i) - ac_prev=x_includes ;; - -x-includes=* | --x-includes=* | --x-include=* | --x-includ=* | --x-inclu=* \ - | --x-incl=* | --x-inc=* | --x-in=* | --x-i=*) - x_includes=$ac_optarg ;; - - -x-libraries | --x-libraries | --x-librarie | --x-librari \ - | --x-librar | --x-libra | --x-libr | --x-lib | --x-li | --x-l) - ac_prev=x_libraries ;; - -x-libraries=* | --x-libraries=* | --x-librarie=* | --x-librari=* \ - | --x-librar=* | --x-libra=* | --x-libr=* | --x-lib=* | --x-li=* | --x-l=*) - x_libraries=$ac_optarg ;; - - -*) as_fn_error $? "unrecognized option: \`$ac_option' -Try \`$0 --help' for more information" - ;; - - *=*) - ac_envvar=`expr "x$ac_option" : 'x\([^=]*\)='` - # Reject names that are not valid shell variable names. - case $ac_envvar in #( - '' | [0-9]* | *[!_$as_cr_alnum]* ) - as_fn_error $? "invalid variable name: \`$ac_envvar'" ;; - esac - eval $ac_envvar=\$ac_optarg - export $ac_envvar ;; - - *) - # FIXME: should be removed in autoconf 3.0. - printf "%s\n" "$as_me: WARNING: you should use --build, --host, --target" >&2 - expr "x$ac_option" : ".*[^-._$as_cr_alnum]" >/dev/null && - printf "%s\n" "$as_me: WARNING: invalid host type: $ac_option" >&2 - : "${build_alias=$ac_option} ${host_alias=$ac_option} ${target_alias=$ac_option}" - ;; - - esac -done - -if test -n "$ac_prev"; then - ac_option=--`echo $ac_prev | sed 's/_/-/g'` - as_fn_error $? "missing argument to $ac_option" -fi - -if test -n "$ac_unrecognized_opts"; then - case $enable_option_checking in - no) ;; - fatal) as_fn_error $? "unrecognized options: $ac_unrecognized_opts" ;; - *) printf "%s\n" "$as_me: WARNING: unrecognized options: $ac_unrecognized_opts" >&2 ;; - esac -fi - -# Check all directory arguments for consistency. -for ac_var in exec_prefix prefix bindir sbindir libexecdir datarootdir \ - datadir sysconfdir sharedstatedir localstatedir includedir \ - oldincludedir docdir infodir htmldir dvidir pdfdir psdir \ - libdir localedir mandir runstatedir -do - eval ac_val=\$$ac_var - # Remove trailing slashes. - case $ac_val in - */ ) - ac_val=`expr "X$ac_val" : 'X\(.*[^/]\)' \| "X$ac_val" : 'X\(.*\)'` - eval $ac_var=\$ac_val;; - esac - # Be sure to have absolute directory names. - case $ac_val in - [\\/$]* | ?:[\\/]* ) continue;; - NONE | '' ) case $ac_var in *prefix ) continue;; esac;; - esac - as_fn_error $? "expected an absolute directory name for --$ac_var: $ac_val" -done - -# There might be people who depend on the old broken behavior: `$host' -# used to hold the argument of --host etc. -# FIXME: To remove some day. -build=$build_alias -host=$host_alias -target=$target_alias - -# FIXME: To remove some day. -if test "x$host_alias" != x; then - if test "x$build_alias" = x; then - cross_compiling=maybe - elif test "x$build_alias" != "x$host_alias"; then - cross_compiling=yes - fi -fi - -ac_tool_prefix= -test -n "$host_alias" && ac_tool_prefix=$host_alias- - -test "$silent" = yes && exec 6>/dev/null - - -ac_pwd=`pwd` && test -n "$ac_pwd" && -ac_ls_di=`ls -di .` && -ac_pwd_ls_di=`cd "$ac_pwd" && ls -di .` || - as_fn_error $? "working directory cannot be determined" -test "X$ac_ls_di" = "X$ac_pwd_ls_di" || - as_fn_error $? "pwd does not report name of working directory" - - -# Find the source files, if location was not specified. -if test -z "$srcdir"; then - ac_srcdir_defaulted=yes - # Try the directory containing this script, then the parent directory. - ac_confdir=`$as_dirname -- "$as_myself" || -$as_expr X"$as_myself" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ - X"$as_myself" : 'X\(//\)[^/]' \| \ - X"$as_myself" : 'X\(//\)$' \| \ - X"$as_myself" : 'X\(/\)' \| . 2>/dev/null || -printf "%s\n" X"$as_myself" | - sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ - s//\1/ - q - } - /^X\(\/\/\)[^/].*/{ - s//\1/ - q - } - /^X\(\/\/\)$/{ - s//\1/ - q - } - /^X\(\/\).*/{ - s//\1/ - q - } - s/.*/./; q'` - srcdir=$ac_confdir - if test ! -r "$srcdir/$ac_unique_file"; then - srcdir=.. - fi -else - ac_srcdir_defaulted=no -fi -if test ! -r "$srcdir/$ac_unique_file"; then - test "$ac_srcdir_defaulted" = yes && srcdir="$ac_confdir or .." - as_fn_error $? "cannot find sources ($ac_unique_file) in $srcdir" -fi -ac_msg="sources are in $srcdir, but \`cd $srcdir' does not work" -ac_abs_confdir=`( - cd "$srcdir" && test -r "./$ac_unique_file" || as_fn_error $? "$ac_msg" - pwd)` -# When building in place, set srcdir=. -if test "$ac_abs_confdir" = "$ac_pwd"; then - srcdir=. -fi -# Remove unnecessary trailing slashes from srcdir. -# Double slashes in file names in object file debugging info -# mess up M-x gdb in Emacs. -case $srcdir in -*/) srcdir=`expr "X$srcdir" : 'X\(.*[^/]\)' \| "X$srcdir" : 'X\(.*\)'`;; -esac -for ac_var in $ac_precious_vars; do - eval ac_env_${ac_var}_set=\${${ac_var}+set} - eval ac_env_${ac_var}_value=\$${ac_var} - eval ac_cv_env_${ac_var}_set=\${${ac_var}+set} - eval ac_cv_env_${ac_var}_value=\$${ac_var} -done - -# -# Report the --help message. -# -if test "$ac_init_help" = "long"; then - # Omit some internal or obsolete options to make the list less imposing. - # This message is too long to be a string in the A/UX 3.1 sh. - cat <<_ACEOF -\`configure' configures Protocol Buffers 3.19.4 to adapt to many kinds of systems. - -Usage: $0 [OPTION]... [VAR=VALUE]... - -To assign environment variables (e.g., CC, CFLAGS...), specify them as -VAR=VALUE. See below for descriptions of some of the useful variables. - -Defaults for the options are specified in brackets. - -Configuration: - -h, --help display this help and exit - --help=short display options specific to this package - --help=recursive display the short help of all the included packages - -V, --version display version information and exit - -q, --quiet, --silent do not print \`checking ...' messages - --cache-file=FILE cache test results in FILE [disabled] - -C, --config-cache alias for \`--cache-file=config.cache' - -n, --no-create do not create output files - --srcdir=DIR find the sources in DIR [configure dir or \`..'] - -Installation directories: - --prefix=PREFIX install architecture-independent files in PREFIX - [$ac_default_prefix] - --exec-prefix=EPREFIX install architecture-dependent files in EPREFIX - [PREFIX] - -By default, \`make install' will install all the files in -\`$ac_default_prefix/bin', \`$ac_default_prefix/lib' etc. You can specify -an installation prefix other than \`$ac_default_prefix' using \`--prefix', -for instance \`--prefix=\$HOME'. - -For better control, use the options below. - -Fine tuning of the installation directories: - --bindir=DIR user executables [EPREFIX/bin] - --sbindir=DIR system admin executables [EPREFIX/sbin] - --libexecdir=DIR program executables [EPREFIX/libexec] - --sysconfdir=DIR read-only single-machine data [PREFIX/etc] - --sharedstatedir=DIR modifiable architecture-independent data [PREFIX/com] - --localstatedir=DIR modifiable single-machine data [PREFIX/var] - --runstatedir=DIR modifiable per-process data [LOCALSTATEDIR/run] - --libdir=DIR object code libraries [EPREFIX/lib] - --includedir=DIR C header files [PREFIX/include] - --oldincludedir=DIR C header files for non-gcc [/usr/include] - --datarootdir=DIR read-only arch.-independent data root [PREFIX/share] - --datadir=DIR read-only architecture-independent data [DATAROOTDIR] - --infodir=DIR info documentation [DATAROOTDIR/info] - --localedir=DIR locale-dependent data [DATAROOTDIR/locale] - --mandir=DIR man documentation [DATAROOTDIR/man] - --docdir=DIR documentation root [DATAROOTDIR/doc/protobuf] - --htmldir=DIR html documentation [DOCDIR] - --dvidir=DIR dvi documentation [DOCDIR] - --pdfdir=DIR pdf documentation [DOCDIR] - --psdir=DIR ps documentation [DOCDIR] -_ACEOF - - cat <<\_ACEOF - -Program names: - --program-prefix=PREFIX prepend PREFIX to installed program names - --program-suffix=SUFFIX append SUFFIX to installed program names - --program-transform-name=PROGRAM run sed PROGRAM on installed program names - -System types: - --build=BUILD configure for building on BUILD [guessed] - --host=HOST cross-compile to build programs to run on HOST [BUILD] - --target=TARGET configure for building compilers for TARGET [HOST] -_ACEOF -fi - -if test -n "$ac_init_help"; then - case $ac_init_help in - short | recursive ) echo "Configuration of Protocol Buffers 3.19.4:";; - esac - cat <<\_ACEOF - -Optional Features: - --disable-option-checking ignore unrecognized --enable/--with options - --disable-FEATURE do not include FEATURE (same as --enable-FEATURE=no) - --enable-FEATURE[=ARG] include FEATURE [ARG=yes] - --disable-maintainer-mode - disable make rules and dependencies not useful (and - sometimes confusing) to the casual installer - --enable-silent-rules less verbose build output (undo: "make V=1") - --disable-silent-rules verbose build output (undo: "make V=0") - --enable-dependency-tracking - do not reject slow dependency extractors - --disable-dependency-tracking - speeds up one-time build - --disable-64bit-solaris Build 64 bit binary on Solaris [default=on] - --enable-shared[=PKGS] build shared libraries [default=yes] - --enable-static[=PKGS] build static libraries [default=yes] - --enable-fast-install[=PKGS] - optimize for fast installation [default=yes] - --disable-libtool-lock avoid locking (might break parallel builds) - -Optional Packages: - --with-PACKAGE[=ARG] use PACKAGE [ARG=yes] - --without-PACKAGE do not use PACKAGE (same as --with-PACKAGE=no) - --with-zlib include classes for streaming compressed data in and - out [default=check] - --with-zlib-include=PATH - zlib include directory - --with-zlib-lib=PATH zlib lib directory - --with-protoc=COMMAND use the given protoc command instead of building a - new one when building tests (useful for - cross-compiling) - --with-pic[=PKGS] try to use only PIC/non-PIC objects [default=use - both] - --with-aix-soname=aix|svr4|both - shared library versioning (aka "SONAME") variant to - provide on AIX, [default=aix]. - --with-gnu-ld assume the C compiler uses GNU ld [default=no] - --with-sysroot[=DIR] Search for dependent libraries within DIR (or the - compiler's sysroot if not specified). - -Some influential environment variables: - DIST_LANG language to include in the distribution package (i.e., make - dist) - CC C compiler command - CFLAGS C compiler flags - LDFLAGS linker flags, e.g. -L if you have libraries in a - nonstandard directory - LIBS libraries to pass to the linker, e.g. -l - CPPFLAGS (Objective) C/C++ preprocessor flags, e.g. -I if - you have headers in a nonstandard directory - CXX C++ compiler command - CXXFLAGS C++ compiler flags - CPP C preprocessor - CXXCPP C++ preprocessor - OBJC Objective C compiler command - OBJCFLAGS Objective C compiler flags - LT_SYS_LIBRARY_PATH - User-defined run-time library search path. - -Use these variables to override the choices made by `configure' or to help -it to find libraries and programs with nonstandard names/locations. - -Report bugs to . -_ACEOF -ac_status=$? -fi - -if test "$ac_init_help" = "recursive"; then - # If there are subdirs, report their specific --help. - for ac_dir in : $ac_subdirs_all; do test "x$ac_dir" = x: && continue - test -d "$ac_dir" || - { cd "$srcdir" && ac_pwd=`pwd` && srcdir=. && test -d "$ac_dir"; } || - continue - ac_builddir=. - -case "$ac_dir" in -.) ac_dir_suffix= ac_top_builddir_sub=. ac_top_build_prefix= ;; -*) - ac_dir_suffix=/`printf "%s\n" "$ac_dir" | sed 's|^\.[\\/]||'` - # A ".." for each directory in $ac_dir_suffix. - ac_top_builddir_sub=`printf "%s\n" "$ac_dir_suffix" | sed 's|/[^\\/]*|/..|g;s|/||'` - case $ac_top_builddir_sub in - "") ac_top_builddir_sub=. ac_top_build_prefix= ;; - *) ac_top_build_prefix=$ac_top_builddir_sub/ ;; - esac ;; -esac -ac_abs_top_builddir=$ac_pwd -ac_abs_builddir=$ac_pwd$ac_dir_suffix -# for backward compatibility: -ac_top_builddir=$ac_top_build_prefix - -case $srcdir in - .) # We are building in place. - ac_srcdir=. - ac_top_srcdir=$ac_top_builddir_sub - ac_abs_top_srcdir=$ac_pwd ;; - [\\/]* | ?:[\\/]* ) # Absolute name. - ac_srcdir=$srcdir$ac_dir_suffix; - ac_top_srcdir=$srcdir - ac_abs_top_srcdir=$srcdir ;; - *) # Relative name. - ac_srcdir=$ac_top_build_prefix$srcdir$ac_dir_suffix - ac_top_srcdir=$ac_top_build_prefix$srcdir - ac_abs_top_srcdir=$ac_pwd/$srcdir ;; -esac -ac_abs_srcdir=$ac_abs_top_srcdir$ac_dir_suffix - - cd "$ac_dir" || { ac_status=$?; continue; } - # Check for configure.gnu first; this name is used for a wrapper for - # Metaconfig's "Configure" on case-insensitive file systems. - if test -f "$ac_srcdir/configure.gnu"; then - echo && - $SHELL "$ac_srcdir/configure.gnu" --help=recursive - elif test -f "$ac_srcdir/configure"; then - echo && - $SHELL "$ac_srcdir/configure" --help=recursive - else - printf "%s\n" "$as_me: WARNING: no configuration information is in $ac_dir" >&2 - fi || ac_status=$? - cd "$ac_pwd" || { ac_status=$?; break; } - done -fi - -test -n "$ac_init_help" && exit $ac_status -if $ac_init_version; then - cat <<\_ACEOF -Protocol Buffers configure 3.19.4 -generated by GNU Autoconf 2.71 - -Copyright (C) 2021 Free Software Foundation, Inc. -This configure script is free software; the Free Software Foundation -gives unlimited permission to copy, distribute and modify it. -_ACEOF - exit -fi - -## ------------------------ ## -## Autoconf initialization. ## -## ------------------------ ## - -# ac_fn_c_try_compile LINENO -# -------------------------- -# Try to compile conftest.$ac_ext, and return whether this succeeded. -ac_fn_c_try_compile () -{ - as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack - rm -f conftest.$ac_objext conftest.beam - if { { ac_try="$ac_compile" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" -printf "%s\n" "$ac_try_echo"; } >&5 - (eval "$ac_compile") 2>conftest.err - ac_status=$? - if test -s conftest.err; then - grep -v '^ *+' conftest.err >conftest.er1 - cat conftest.er1 >&5 - mv -f conftest.er1 conftest.err - fi - printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 - test $ac_status = 0; } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest.$ac_objext -then : - ac_retval=0 -else $as_nop - printf "%s\n" "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - ac_retval=1 -fi - eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno - as_fn_set_status $ac_retval - -} # ac_fn_c_try_compile - -# ac_fn_cxx_try_compile LINENO -# ---------------------------- -# Try to compile conftest.$ac_ext, and return whether this succeeded. -ac_fn_cxx_try_compile () -{ - as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack - rm -f conftest.$ac_objext conftest.beam - if { { ac_try="$ac_compile" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" -printf "%s\n" "$ac_try_echo"; } >&5 - (eval "$ac_compile") 2>conftest.err - ac_status=$? - if test -s conftest.err; then - grep -v '^ *+' conftest.err >conftest.er1 - cat conftest.er1 >&5 - mv -f conftest.er1 conftest.err - fi - printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 - test $ac_status = 0; } && { - test -z "$ac_cxx_werror_flag" || - test ! -s conftest.err - } && test -s conftest.$ac_objext -then : - ac_retval=0 -else $as_nop - printf "%s\n" "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - ac_retval=1 -fi - eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno - as_fn_set_status $ac_retval - -} # ac_fn_cxx_try_compile - -# ac_fn_c_try_cpp LINENO -# ---------------------- -# Try to preprocess conftest.$ac_ext, and return whether this succeeded. -ac_fn_c_try_cpp () -{ - as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack - if { { ac_try="$ac_cpp conftest.$ac_ext" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" -printf "%s\n" "$ac_try_echo"; } >&5 - (eval "$ac_cpp conftest.$ac_ext") 2>conftest.err - ac_status=$? - if test -s conftest.err; then - grep -v '^ *+' conftest.err >conftest.er1 - cat conftest.er1 >&5 - mv -f conftest.er1 conftest.err - fi - printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 - test $ac_status = 0; } > conftest.i && { - test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || - test ! -s conftest.err - } -then : - ac_retval=0 -else $as_nop - printf "%s\n" "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - ac_retval=1 -fi - eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno - as_fn_set_status $ac_retval - -} # ac_fn_c_try_cpp - -# ac_fn_cxx_try_cpp LINENO -# ------------------------ -# Try to preprocess conftest.$ac_ext, and return whether this succeeded. -ac_fn_cxx_try_cpp () -{ - as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack - if { { ac_try="$ac_cpp conftest.$ac_ext" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" -printf "%s\n" "$ac_try_echo"; } >&5 - (eval "$ac_cpp conftest.$ac_ext") 2>conftest.err - ac_status=$? - if test -s conftest.err; then - grep -v '^ *+' conftest.err >conftest.er1 - cat conftest.er1 >&5 - mv -f conftest.er1 conftest.err - fi - printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 - test $ac_status = 0; } > conftest.i && { - test -z "$ac_cxx_preproc_warn_flag$ac_cxx_werror_flag" || - test ! -s conftest.err - } -then : - ac_retval=0 -else $as_nop - printf "%s\n" "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - ac_retval=1 -fi - eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno - as_fn_set_status $ac_retval - -} # ac_fn_cxx_try_cpp - -# ac_fn_cxx_check_header_compile LINENO HEADER VAR INCLUDES -# --------------------------------------------------------- -# Tests whether HEADER exists and can be compiled using the include files in -# INCLUDES, setting the cache variable VAR accordingly. -ac_fn_cxx_check_header_compile () -{ - as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 -printf %s "checking for $2... " >&6; } -if eval test \${$3+y} -then : - printf %s "(cached) " >&6 -else $as_nop - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -$4 -#include <$2> -_ACEOF -if ac_fn_cxx_try_compile "$LINENO" -then : - eval "$3=yes" -else $as_nop - eval "$3=no" -fi -rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext -fi -eval ac_res=\$$3 - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 -printf "%s\n" "$ac_res" >&6; } - eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno - -} # ac_fn_cxx_check_header_compile - -# ac_fn_objc_try_compile LINENO -# ----------------------------- -# Try to compile conftest.$ac_ext, and return whether this succeeded. -ac_fn_objc_try_compile () -{ - as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack - rm -f conftest.$ac_objext conftest.beam - if { { ac_try="$ac_compile" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" -printf "%s\n" "$ac_try_echo"; } >&5 - (eval "$ac_compile") 2>conftest.err - ac_status=$? - if test -s conftest.err; then - grep -v '^ *+' conftest.err >conftest.er1 - cat conftest.er1 >&5 - mv -f conftest.er1 conftest.err - fi - printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 - test $ac_status = 0; } && { - test -z "$ac_objc_werror_flag" || - test ! -s conftest.err - } && test -s conftest.$ac_objext -then : - ac_retval=0 -else $as_nop - printf "%s\n" "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - ac_retval=1 -fi - eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno - as_fn_set_status $ac_retval - -} # ac_fn_objc_try_compile - -# ac_fn_check_decl LINENO SYMBOL VAR INCLUDES EXTRA-OPTIONS FLAG-VAR -# ------------------------------------------------------------------ -# Tests whether SYMBOL is declared in INCLUDES, setting cache variable VAR -# accordingly. Pass EXTRA-OPTIONS to the compiler, using FLAG-VAR. -ac_fn_check_decl () -{ - as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack - as_decl_name=`echo $2|sed 's/ *(.*//'` - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether $as_decl_name is declared" >&5 -printf %s "checking whether $as_decl_name is declared... " >&6; } -if eval test \${$3+y} -then : - printf %s "(cached) " >&6 -else $as_nop - as_decl_use=`echo $2|sed -e 's/(/((/' -e 's/)/) 0&/' -e 's/,/) 0& (/g'` - eval ac_save_FLAGS=\$$6 - as_fn_append $6 " $5" - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -$4 -int -main (void) -{ -#ifndef $as_decl_name -#ifdef __cplusplus - (void) $as_decl_use; -#else - (void) $as_decl_name; -#endif -#endif - - ; - return 0; -} -_ACEOF -if ac_fn_cxx_try_compile "$LINENO" -then : - eval "$3=yes" -else $as_nop - eval "$3=no" -fi -rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext - eval $6=\$ac_save_FLAGS - -fi -eval ac_res=\$$3 - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 -printf "%s\n" "$ac_res" >&6; } - eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno - -} # ac_fn_check_decl - -# ac_fn_c_try_link LINENO -# ----------------------- -# Try to link conftest.$ac_ext, and return whether this succeeded. -ac_fn_c_try_link () -{ - as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack - rm -f conftest.$ac_objext conftest.beam conftest$ac_exeext - if { { ac_try="$ac_link" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" -printf "%s\n" "$ac_try_echo"; } >&5 - (eval "$ac_link") 2>conftest.err - ac_status=$? - if test -s conftest.err; then - grep -v '^ *+' conftest.err >conftest.er1 - cat conftest.er1 >&5 - mv -f conftest.er1 conftest.err - fi - printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 - test $ac_status = 0; } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest$ac_exeext && { - test "$cross_compiling" = yes || - test -x conftest$ac_exeext - } -then : - ac_retval=0 -else $as_nop - printf "%s\n" "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - ac_retval=1 -fi - # Delete the IPA/IPO (Inter Procedural Analysis/Optimization) information - # created by the PGI compiler (conftest_ipa8_conftest.oo), as it would - # interfere with the next link command; also delete a directory that is - # left behind by Apple's compiler. We do this before executing the actions. - rm -rf conftest.dSYM conftest_ipa8_conftest.oo - eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno - as_fn_set_status $ac_retval - -} # ac_fn_c_try_link - -# ac_fn_c_check_header_compile LINENO HEADER VAR INCLUDES -# ------------------------------------------------------- -# Tests whether HEADER exists and can be compiled using the include files in -# INCLUDES, setting the cache variable VAR accordingly. -ac_fn_c_check_header_compile () -{ - as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 -printf %s "checking for $2... " >&6; } -if eval test \${$3+y} -then : - printf %s "(cached) " >&6 -else $as_nop - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -$4 -#include <$2> -_ACEOF -if ac_fn_c_try_compile "$LINENO" -then : - eval "$3=yes" -else $as_nop - eval "$3=no" -fi -rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext -fi -eval ac_res=\$$3 - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 -printf "%s\n" "$ac_res" >&6; } - eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno - -} # ac_fn_c_check_header_compile - -# ac_fn_c_check_func LINENO FUNC VAR -# ---------------------------------- -# Tests whether FUNC exists, setting the cache variable VAR accordingly -ac_fn_c_check_func () -{ - as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 -printf %s "checking for $2... " >&6; } -if eval test \${$3+y} -then : - printf %s "(cached) " >&6 -else $as_nop - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -/* Define $2 to an innocuous variant, in case declares $2. - For example, HP-UX 11i declares gettimeofday. */ -#define $2 innocuous_$2 - -/* System header to define __stub macros and hopefully few prototypes, - which can conflict with char $2 (); below. */ - -#include -#undef $2 - -/* Override any GCC internal prototype to avoid an error. - Use char because int might match the return type of a GCC - builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif -char $2 (); -/* The GNU C library defines this for functions which it implements - to always fail with ENOSYS. Some functions are actually named - something starting with __ and the normal name is an alias. */ -#if defined __stub_$2 || defined __stub___$2 -choke me -#endif - -int -main (void) -{ -return $2 (); - ; - return 0; -} -_ACEOF -if ac_fn_c_try_link "$LINENO" -then : - eval "$3=yes" -else $as_nop - eval "$3=no" -fi -rm -f core conftest.err conftest.$ac_objext conftest.beam \ - conftest$ac_exeext conftest.$ac_ext -fi -eval ac_res=\$$3 - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 -printf "%s\n" "$ac_res" >&6; } - eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno - -} # ac_fn_c_check_func - -# ac_fn_cxx_try_link LINENO -# ------------------------- -# Try to link conftest.$ac_ext, and return whether this succeeded. -ac_fn_cxx_try_link () -{ - as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack - rm -f conftest.$ac_objext conftest.beam conftest$ac_exeext - if { { ac_try="$ac_link" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" -printf "%s\n" "$ac_try_echo"; } >&5 - (eval "$ac_link") 2>conftest.err - ac_status=$? - if test -s conftest.err; then - grep -v '^ *+' conftest.err >conftest.er1 - cat conftest.er1 >&5 - mv -f conftest.er1 conftest.err - fi - printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 - test $ac_status = 0; } && { - test -z "$ac_cxx_werror_flag" || - test ! -s conftest.err - } && test -s conftest$ac_exeext && { - test "$cross_compiling" = yes || - test -x conftest$ac_exeext - } -then : - ac_retval=0 -else $as_nop - printf "%s\n" "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - ac_retval=1 -fi - # Delete the IPA/IPO (Inter Procedural Analysis/Optimization) information - # created by the PGI compiler (conftest_ipa8_conftest.oo), as it would - # interfere with the next link command; also delete a directory that is - # left behind by Apple's compiler. We do this before executing the actions. - rm -rf conftest.dSYM conftest_ipa8_conftest.oo - eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno - as_fn_set_status $ac_retval - -} # ac_fn_cxx_try_link - -# ac_fn_cxx_try_run LINENO -# ------------------------ -# Try to run conftest.$ac_ext, and return whether this succeeded. Assumes that -# executables *can* be run. -ac_fn_cxx_try_run () -{ - as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack - if { { ac_try="$ac_link" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" -printf "%s\n" "$ac_try_echo"; } >&5 - (eval "$ac_link") 2>&5 - ac_status=$? - printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 - test $ac_status = 0; } && { ac_try='./conftest$ac_exeext' - { { case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" -printf "%s\n" "$ac_try_echo"; } >&5 - (eval "$ac_try") 2>&5 - ac_status=$? - printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 - test $ac_status = 0; }; } -then : - ac_retval=0 -else $as_nop - printf "%s\n" "$as_me: program exited with status $ac_status" >&5 - printf "%s\n" "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - ac_retval=$ac_status -fi - rm -rf conftest.dSYM conftest_ipa8_conftest.oo - eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno - as_fn_set_status $ac_retval - -} # ac_fn_cxx_try_run - -# ac_fn_cxx_check_func LINENO FUNC VAR -# ------------------------------------ -# Tests whether FUNC exists, setting the cache variable VAR accordingly -ac_fn_cxx_check_func () -{ - as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 -printf %s "checking for $2... " >&6; } -if eval test \${$3+y} -then : - printf %s "(cached) " >&6 -else $as_nop - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -/* Define $2 to an innocuous variant, in case declares $2. - For example, HP-UX 11i declares gettimeofday. */ -#define $2 innocuous_$2 - -/* System header to define __stub macros and hopefully few prototypes, - which can conflict with char $2 (); below. */ - -#include -#undef $2 - -/* Override any GCC internal prototype to avoid an error. - Use char because int might match the return type of a GCC - builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif -char $2 (); -/* The GNU C library defines this for functions which it implements - to always fail with ENOSYS. Some functions are actually named - something starting with __ and the normal name is an alias. */ -#if defined __stub_$2 || defined __stub___$2 -choke me -#endif - -int -main (void) -{ -return $2 (); - ; - return 0; -} -_ACEOF -if ac_fn_cxx_try_link "$LINENO" -then : - eval "$3=yes" -else $as_nop - eval "$3=no" -fi -rm -f core conftest.err conftest.$ac_objext conftest.beam \ - conftest$ac_exeext conftest.$ac_ext -fi -eval ac_res=\$$3 - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 -printf "%s\n" "$ac_res" >&6; } - eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno - -} # ac_fn_cxx_check_func -ac_configure_args_raw= -for ac_arg -do - case $ac_arg in - *\'*) - ac_arg=`printf "%s\n" "$ac_arg" | sed "s/'/'\\\\\\\\''/g"` ;; - esac - as_fn_append ac_configure_args_raw " '$ac_arg'" -done - -case $ac_configure_args_raw in - *$as_nl*) - ac_safe_unquote= ;; - *) - ac_unsafe_z='|&;<>()$`\\"*?[ '' ' # This string ends in space, tab. - ac_unsafe_a="$ac_unsafe_z#~" - ac_safe_unquote="s/ '\\([^$ac_unsafe_a][^$ac_unsafe_z]*\\)'/ \\1/g" - ac_configure_args_raw=` printf "%s\n" "$ac_configure_args_raw" | sed "$ac_safe_unquote"`;; -esac - -cat >config.log <<_ACEOF -This file contains any messages produced by compilers while -running configure, to aid debugging if configure makes a mistake. - -It was created by Protocol Buffers $as_me 3.19.4, which was -generated by GNU Autoconf 2.71. Invocation command line was - - $ $0$ac_configure_args_raw - -_ACEOF -exec 5>>config.log -{ -cat <<_ASUNAME -## --------- ## -## Platform. ## -## --------- ## - -hostname = `(hostname || uname -n) 2>/dev/null | sed 1q` -uname -m = `(uname -m) 2>/dev/null || echo unknown` -uname -r = `(uname -r) 2>/dev/null || echo unknown` -uname -s = `(uname -s) 2>/dev/null || echo unknown` -uname -v = `(uname -v) 2>/dev/null || echo unknown` - -/usr/bin/uname -p = `(/usr/bin/uname -p) 2>/dev/null || echo unknown` -/bin/uname -X = `(/bin/uname -X) 2>/dev/null || echo unknown` - -/bin/arch = `(/bin/arch) 2>/dev/null || echo unknown` -/usr/bin/arch -k = `(/usr/bin/arch -k) 2>/dev/null || echo unknown` -/usr/convex/getsysinfo = `(/usr/convex/getsysinfo) 2>/dev/null || echo unknown` -/usr/bin/hostinfo = `(/usr/bin/hostinfo) 2>/dev/null || echo unknown` -/bin/machine = `(/bin/machine) 2>/dev/null || echo unknown` -/usr/bin/oslevel = `(/usr/bin/oslevel) 2>/dev/null || echo unknown` -/bin/universe = `(/bin/universe) 2>/dev/null || echo unknown` - -_ASUNAME - -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - case $as_dir in #((( - '') as_dir=./ ;; - */) ;; - *) as_dir=$as_dir/ ;; - esac - printf "%s\n" "PATH: $as_dir" - done -IFS=$as_save_IFS - -} >&5 - -cat >&5 <<_ACEOF - - -## ----------- ## -## Core tests. ## -## ----------- ## - -_ACEOF - - -# Keep a trace of the command line. -# Strip out --no-create and --no-recursion so they do not pile up. -# Strip out --silent because we don't want to record it for future runs. -# Also quote any args containing shell meta-characters. -# Make two passes to allow for proper duplicate-argument suppression. -ac_configure_args= -ac_configure_args0= -ac_configure_args1= -ac_must_keep_next=false -for ac_pass in 1 2 -do - for ac_arg - do - case $ac_arg in - -no-create | --no-c* | -n | -no-recursion | --no-r*) continue ;; - -q | -quiet | --quiet | --quie | --qui | --qu | --q \ - | -silent | --silent | --silen | --sile | --sil) - continue ;; - *\'*) - ac_arg=`printf "%s\n" "$ac_arg" | sed "s/'/'\\\\\\\\''/g"` ;; - esac - case $ac_pass in - 1) as_fn_append ac_configure_args0 " '$ac_arg'" ;; - 2) - as_fn_append ac_configure_args1 " '$ac_arg'" - if test $ac_must_keep_next = true; then - ac_must_keep_next=false # Got value, back to normal. - else - case $ac_arg in - *=* | --config-cache | -C | -disable-* | --disable-* \ - | -enable-* | --enable-* | -gas | --g* | -nfp | --nf* \ - | -q | -quiet | --q* | -silent | --sil* | -v | -verb* \ - | -with-* | --with-* | -without-* | --without-* | --x) - case "$ac_configure_args0 " in - "$ac_configure_args1"*" '$ac_arg' "* ) continue ;; - esac - ;; - -* ) ac_must_keep_next=true ;; - esac - fi - as_fn_append ac_configure_args " '$ac_arg'" - ;; - esac - done -done -{ ac_configure_args0=; unset ac_configure_args0;} -{ ac_configure_args1=; unset ac_configure_args1;} - -# When interrupted or exit'd, cleanup temporary files, and complete -# config.log. We remove comments because anyway the quotes in there -# would cause problems or look ugly. -# WARNING: Use '\'' to represent an apostrophe within the trap. -# WARNING: Do not start the trap code with a newline, due to a FreeBSD 4.0 bug. -trap 'exit_status=$? - # Sanitize IFS. - IFS=" "" $as_nl" - # Save into config.log some information that might help in debugging. - { - echo - - printf "%s\n" "## ---------------- ## -## Cache variables. ## -## ---------------- ##" - echo - # The following way of writing the cache mishandles newlines in values, -( - for ac_var in `(set) 2>&1 | sed -n '\''s/^\([a-zA-Z_][a-zA-Z0-9_]*\)=.*/\1/p'\''`; do - eval ac_val=\$$ac_var - case $ac_val in #( - *${as_nl}*) - case $ac_var in #( - *_cv_*) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: cache variable $ac_var contains a newline" >&5 -printf "%s\n" "$as_me: WARNING: cache variable $ac_var contains a newline" >&2;} ;; - esac - case $ac_var in #( - _ | IFS | as_nl) ;; #( - BASH_ARGV | BASH_SOURCE) eval $ac_var= ;; #( - *) { eval $ac_var=; unset $ac_var;} ;; - esac ;; - esac - done - (set) 2>&1 | - case $as_nl`(ac_space='\'' '\''; set) 2>&1` in #( - *${as_nl}ac_space=\ *) - sed -n \ - "s/'\''/'\''\\\\'\'''\''/g; - s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\''\\2'\''/p" - ;; #( - *) - sed -n "/^[_$as_cr_alnum]*_cv_[_$as_cr_alnum]*=/p" - ;; - esac | - sort -) - echo - - printf "%s\n" "## ----------------- ## -## Output variables. ## -## ----------------- ##" - echo - for ac_var in $ac_subst_vars - do - eval ac_val=\$$ac_var - case $ac_val in - *\'\''*) ac_val=`printf "%s\n" "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;; - esac - printf "%s\n" "$ac_var='\''$ac_val'\''" - done | sort - echo - - if test -n "$ac_subst_files"; then - printf "%s\n" "## ------------------- ## -## File substitutions. ## -## ------------------- ##" - echo - for ac_var in $ac_subst_files - do - eval ac_val=\$$ac_var - case $ac_val in - *\'\''*) ac_val=`printf "%s\n" "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;; - esac - printf "%s\n" "$ac_var='\''$ac_val'\''" - done | sort - echo - fi - - if test -s confdefs.h; then - printf "%s\n" "## ----------- ## -## confdefs.h. ## -## ----------- ##" - echo - cat confdefs.h - echo - fi - test "$ac_signal" != 0 && - printf "%s\n" "$as_me: caught signal $ac_signal" - printf "%s\n" "$as_me: exit $exit_status" - } >&5 - rm -f core *.core core.conftest.* && - rm -f -r conftest* confdefs* conf$$* $ac_clean_files && - exit $exit_status -' 0 -for ac_signal in 1 2 13 15; do - trap 'ac_signal='$ac_signal'; as_fn_exit 1' $ac_signal -done -ac_signal=0 - -# confdefs.h avoids OS command line length limits that DEFS can exceed. -rm -f -r conftest* confdefs.h - -printf "%s\n" "/* confdefs.h */" > confdefs.h - -# Predefined preprocessor variables. - -printf "%s\n" "#define PACKAGE_NAME \"$PACKAGE_NAME\"" >>confdefs.h - -printf "%s\n" "#define PACKAGE_TARNAME \"$PACKAGE_TARNAME\"" >>confdefs.h - -printf "%s\n" "#define PACKAGE_VERSION \"$PACKAGE_VERSION\"" >>confdefs.h - -printf "%s\n" "#define PACKAGE_STRING \"$PACKAGE_STRING\"" >>confdefs.h - -printf "%s\n" "#define PACKAGE_BUGREPORT \"$PACKAGE_BUGREPORT\"" >>confdefs.h - -printf "%s\n" "#define PACKAGE_URL \"$PACKAGE_URL\"" >>confdefs.h - - -# Let the site file select an alternate cache file if it wants to. -# Prefer an explicitly selected file to automatically selected ones. -if test -n "$CONFIG_SITE"; then - ac_site_files="$CONFIG_SITE" -elif test "x$prefix" != xNONE; then - ac_site_files="$prefix/share/config.site $prefix/etc/config.site" -else - ac_site_files="$ac_default_prefix/share/config.site $ac_default_prefix/etc/config.site" -fi - -for ac_site_file in $ac_site_files -do - case $ac_site_file in #( - */*) : - ;; #( - *) : - ac_site_file=./$ac_site_file ;; -esac - if test -f "$ac_site_file" && test -r "$ac_site_file"; then - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: loading site script $ac_site_file" >&5 -printf "%s\n" "$as_me: loading site script $ac_site_file" >&6;} - sed 's/^/| /' "$ac_site_file" >&5 - . "$ac_site_file" \ - || { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 -printf "%s\n" "$as_me: error: in \`$ac_pwd':" >&2;} -as_fn_error $? "failed to load site script $ac_site_file -See \`config.log' for more details" "$LINENO" 5; } - fi -done - -if test -r "$cache_file"; then - # Some versions of bash will fail to source /dev/null (special files - # actually), so we avoid doing that. DJGPP emulates it as a regular file. - if test /dev/null != "$cache_file" && test -f "$cache_file"; then - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: loading cache $cache_file" >&5 -printf "%s\n" "$as_me: loading cache $cache_file" >&6;} - case $cache_file in - [\\/]* | ?:[\\/]* ) . "$cache_file";; - *) . "./$cache_file";; - esac - fi -else - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: creating cache $cache_file" >&5 -printf "%s\n" "$as_me: creating cache $cache_file" >&6;} - >$cache_file -fi - -# Test code for whether the C compiler supports C89 (global declarations) -ac_c_conftest_c89_globals=' -/* Does the compiler advertise C89 conformance? - Do not test the value of __STDC__, because some compilers set it to 0 - while being otherwise adequately conformant. */ -#if !defined __STDC__ -# error "Compiler does not advertise C89 conformance" -#endif - -#include -#include -struct stat; -/* Most of the following tests are stolen from RCS 5.7 src/conf.sh. */ -struct buf { int x; }; -struct buf * (*rcsopen) (struct buf *, struct stat *, int); -static char *e (p, i) - char **p; - int i; -{ - return p[i]; -} -static char *f (char * (*g) (char **, int), char **p, ...) -{ - char *s; - va_list v; - va_start (v,p); - s = g (p, va_arg (v,int)); - va_end (v); - return s; -} - -/* OSF 4.0 Compaq cc is some sort of almost-ANSI by default. It has - function prototypes and stuff, but not \xHH hex character constants. - These do not provoke an error unfortunately, instead are silently treated - as an "x". The following induces an error, until -std is added to get - proper ANSI mode. Curiously \x00 != x always comes out true, for an - array size at least. It is necessary to write \x00 == 0 to get something - that is true only with -std. */ -int osf4_cc_array ['\''\x00'\'' == 0 ? 1 : -1]; - -/* IBM C 6 for AIX is almost-ANSI by default, but it replaces macro parameters - inside strings and character constants. */ -#define FOO(x) '\''x'\'' -int xlc6_cc_array[FOO(a) == '\''x'\'' ? 1 : -1]; - -int test (int i, double x); -struct s1 {int (*f) (int a);}; -struct s2 {int (*f) (double a);}; -int pairnames (int, char **, int *(*)(struct buf *, struct stat *, int), - int, int);' - -# Test code for whether the C compiler supports C89 (body of main). -ac_c_conftest_c89_main=' -ok |= (argc == 0 || f (e, argv, 0) != argv[0] || f (e, argv, 1) != argv[1]); -' - -# Test code for whether the C compiler supports C99 (global declarations) -ac_c_conftest_c99_globals=' -// Does the compiler advertise C99 conformance? -#if !defined __STDC_VERSION__ || __STDC_VERSION__ < 199901L -# error "Compiler does not advertise C99 conformance" -#endif - -#include -extern int puts (const char *); -extern int printf (const char *, ...); -extern int dprintf (int, const char *, ...); -extern void *malloc (size_t); - -// Check varargs macros. These examples are taken from C99 6.10.3.5. -// dprintf is used instead of fprintf to avoid needing to declare -// FILE and stderr. -#define debug(...) dprintf (2, __VA_ARGS__) -#define showlist(...) puts (#__VA_ARGS__) -#define report(test,...) ((test) ? puts (#test) : printf (__VA_ARGS__)) -static void -test_varargs_macros (void) -{ - int x = 1234; - int y = 5678; - debug ("Flag"); - debug ("X = %d\n", x); - showlist (The first, second, and third items.); - report (x>y, "x is %d but y is %d", x, y); -} - -// Check long long types. -#define BIG64 18446744073709551615ull -#define BIG32 4294967295ul -#define BIG_OK (BIG64 / BIG32 == 4294967297ull && BIG64 % BIG32 == 0) -#if !BIG_OK - #error "your preprocessor is broken" -#endif -#if BIG_OK -#else - #error "your preprocessor is broken" -#endif -static long long int bignum = -9223372036854775807LL; -static unsigned long long int ubignum = BIG64; - -struct incomplete_array -{ - int datasize; - double data[]; -}; - -struct named_init { - int number; - const wchar_t *name; - double average; -}; - -typedef const char *ccp; - -static inline int -test_restrict (ccp restrict text) -{ - // See if C++-style comments work. - // Iterate through items via the restricted pointer. - // Also check for declarations in for loops. - for (unsigned int i = 0; *(text+i) != '\''\0'\''; ++i) - continue; - return 0; -} - -// Check varargs and va_copy. -static bool -test_varargs (const char *format, ...) -{ - va_list args; - va_start (args, format); - va_list args_copy; - va_copy (args_copy, args); - - const char *str = ""; - int number = 0; - float fnumber = 0; - - while (*format) - { - switch (*format++) - { - case '\''s'\'': // string - str = va_arg (args_copy, const char *); - break; - case '\''d'\'': // int - number = va_arg (args_copy, int); - break; - case '\''f'\'': // float - fnumber = va_arg (args_copy, double); - break; - default: - break; - } - } - va_end (args_copy); - va_end (args); - - return *str && number && fnumber; -} -' - -# Test code for whether the C compiler supports C99 (body of main). -ac_c_conftest_c99_main=' - // Check bool. - _Bool success = false; - success |= (argc != 0); - - // Check restrict. - if (test_restrict ("String literal") == 0) - success = true; - char *restrict newvar = "Another string"; - - // Check varargs. - success &= test_varargs ("s, d'\'' f .", "string", 65, 34.234); - test_varargs_macros (); - - // Check flexible array members. - struct incomplete_array *ia = - malloc (sizeof (struct incomplete_array) + (sizeof (double) * 10)); - ia->datasize = 10; - for (int i = 0; i < ia->datasize; ++i) - ia->data[i] = i * 1.234; - - // Check named initializers. - struct named_init ni = { - .number = 34, - .name = L"Test wide string", - .average = 543.34343, - }; - - ni.number = 58; - - int dynamic_array[ni.number]; - dynamic_array[0] = argv[0][0]; - dynamic_array[ni.number - 1] = 543; - - // work around unused variable warnings - ok |= (!success || bignum == 0LL || ubignum == 0uLL || newvar[0] == '\''x'\'' - || dynamic_array[ni.number - 1] != 543); -' - -# Test code for whether the C compiler supports C11 (global declarations) -ac_c_conftest_c11_globals=' -// Does the compiler advertise C11 conformance? -#if !defined __STDC_VERSION__ || __STDC_VERSION__ < 201112L -# error "Compiler does not advertise C11 conformance" -#endif - -// Check _Alignas. -char _Alignas (double) aligned_as_double; -char _Alignas (0) no_special_alignment; -extern char aligned_as_int; -char _Alignas (0) _Alignas (int) aligned_as_int; - -// Check _Alignof. -enum -{ - int_alignment = _Alignof (int), - int_array_alignment = _Alignof (int[100]), - char_alignment = _Alignof (char) -}; -_Static_assert (0 < -_Alignof (int), "_Alignof is signed"); - -// Check _Noreturn. -int _Noreturn does_not_return (void) { for (;;) continue; } - -// Check _Static_assert. -struct test_static_assert -{ - int x; - _Static_assert (sizeof (int) <= sizeof (long int), - "_Static_assert does not work in struct"); - long int y; -}; - -// Check UTF-8 literals. -#define u8 syntax error! -char const utf8_literal[] = u8"happens to be ASCII" "another string"; - -// Check duplicate typedefs. -typedef long *long_ptr; -typedef long int *long_ptr; -typedef long_ptr long_ptr; - -// Anonymous structures and unions -- taken from C11 6.7.2.1 Example 1. -struct anonymous -{ - union { - struct { int i; int j; }; - struct { int k; long int l; } w; - }; - int m; -} v1; -' - -# Test code for whether the C compiler supports C11 (body of main). -ac_c_conftest_c11_main=' - _Static_assert ((offsetof (struct anonymous, i) - == offsetof (struct anonymous, w.k)), - "Anonymous union alignment botch"); - v1.i = 2; - v1.w.k = 5; - ok |= v1.i != 5; -' - -# Test code for whether the C compiler supports C11 (complete). -ac_c_conftest_c11_program="${ac_c_conftest_c89_globals} -${ac_c_conftest_c99_globals} -${ac_c_conftest_c11_globals} - -int -main (int argc, char **argv) -{ - int ok = 0; - ${ac_c_conftest_c89_main} - ${ac_c_conftest_c99_main} - ${ac_c_conftest_c11_main} - return ok; -} -" - -# Test code for whether the C compiler supports C99 (complete). -ac_c_conftest_c99_program="${ac_c_conftest_c89_globals} -${ac_c_conftest_c99_globals} - -int -main (int argc, char **argv) -{ - int ok = 0; - ${ac_c_conftest_c89_main} - ${ac_c_conftest_c99_main} - return ok; -} -" - -# Test code for whether the C compiler supports C89 (complete). -ac_c_conftest_c89_program="${ac_c_conftest_c89_globals} - -int -main (int argc, char **argv) -{ - int ok = 0; - ${ac_c_conftest_c89_main} - return ok; -} -" - -# Test code for whether the C++ compiler supports C++98 (global declarations) -ac_cxx_conftest_cxx98_globals=' -// Does the compiler advertise C++98 conformance? -#if !defined __cplusplus || __cplusplus < 199711L -# error "Compiler does not advertise C++98 conformance" -#endif - -// These inclusions are to reject old compilers that -// lack the unsuffixed header files. -#include -#include - -// and are *not* freestanding headers in C++98. -extern void assert (int); -namespace std { - extern int strcmp (const char *, const char *); -} - -// Namespaces, exceptions, and templates were all added after "C++ 2.0". -using std::exception; -using std::strcmp; - -namespace { - -void test_exception_syntax() -{ - try { - throw "test"; - } catch (const char *s) { - // Extra parentheses suppress a warning when building autoconf itself, - // due to lint rules shared with more typical C programs. - assert (!(strcmp) (s, "test")); - } -} - -template struct test_template -{ - T const val; - explicit test_template(T t) : val(t) {} - template T add(U u) { return static_cast(u) + val; } -}; - -} // anonymous namespace -' - -# Test code for whether the C++ compiler supports C++98 (body of main) -ac_cxx_conftest_cxx98_main=' - assert (argc); - assert (! argv[0]); -{ - test_exception_syntax (); - test_template tt (2.0); - assert (tt.add (4) == 6.0); - assert (true && !false); -} -' - -# Test code for whether the C++ compiler supports C++11 (global declarations) -ac_cxx_conftest_cxx11_globals=' -// Does the compiler advertise C++ 2011 conformance? -#if !defined __cplusplus || __cplusplus < 201103L -# error "Compiler does not advertise C++11 conformance" -#endif - -namespace cxx11test -{ - constexpr int get_val() { return 20; } - - struct testinit - { - int i; - double d; - }; - - class delegate - { - public: - delegate(int n) : n(n) {} - delegate(): delegate(2354) {} - - virtual int getval() { return this->n; }; - protected: - int n; - }; - - class overridden : public delegate - { - public: - overridden(int n): delegate(n) {} - virtual int getval() override final { return this->n * 2; } - }; - - class nocopy - { - public: - nocopy(int i): i(i) {} - nocopy() = default; - nocopy(const nocopy&) = delete; - nocopy & operator=(const nocopy&) = delete; - private: - int i; - }; - - // for testing lambda expressions - template Ret eval(Fn f, Ret v) - { - return f(v); - } - - // for testing variadic templates and trailing return types - template auto sum(V first) -> V - { - return first; - } - template auto sum(V first, Args... rest) -> V - { - return first + sum(rest...); - } -} -' - -# Test code for whether the C++ compiler supports C++11 (body of main) -ac_cxx_conftest_cxx11_main=' -{ - // Test auto and decltype - auto a1 = 6538; - auto a2 = 48573953.4; - auto a3 = "String literal"; - - int total = 0; - for (auto i = a3; *i; ++i) { total += *i; } - - decltype(a2) a4 = 34895.034; -} -{ - // Test constexpr - short sa[cxx11test::get_val()] = { 0 }; -} -{ - // Test initializer lists - cxx11test::testinit il = { 4323, 435234.23544 }; -} -{ - // Test range-based for - int array[] = {9, 7, 13, 15, 4, 18, 12, 10, 5, 3, - 14, 19, 17, 8, 6, 20, 16, 2, 11, 1}; - for (auto &x : array) { x += 23; } -} -{ - // Test lambda expressions - using cxx11test::eval; - assert (eval ([](int x) { return x*2; }, 21) == 42); - double d = 2.0; - assert (eval ([&](double x) { return d += x; }, 3.0) == 5.0); - assert (d == 5.0); - assert (eval ([=](double x) mutable { return d += x; }, 4.0) == 9.0); - assert (d == 5.0); -} -{ - // Test use of variadic templates - using cxx11test::sum; - auto a = sum(1); - auto b = sum(1, 2); - auto c = sum(1.0, 2.0, 3.0); -} -{ - // Test constructor delegation - cxx11test::delegate d1; - cxx11test::delegate d2(); - cxx11test::delegate d3(45); -} -{ - // Test override and final - cxx11test::overridden o1(55464); -} -{ - // Test nullptr - char *c = nullptr; -} -{ - // Test template brackets - test_template<::test_template> v(test_template(12)); -} -{ - // Unicode literals - char const *utf8 = u8"UTF-8 string \u2500"; - char16_t const *utf16 = u"UTF-8 string \u2500"; - char32_t const *utf32 = U"UTF-32 string \u2500"; -} -' - -# Test code for whether the C compiler supports C++11 (complete). -ac_cxx_conftest_cxx11_program="${ac_cxx_conftest_cxx98_globals} -${ac_cxx_conftest_cxx11_globals} - -int -main (int argc, char **argv) -{ - int ok = 0; - ${ac_cxx_conftest_cxx98_main} - ${ac_cxx_conftest_cxx11_main} - return ok; -} -" - -# Test code for whether the C compiler supports C++98 (complete). -ac_cxx_conftest_cxx98_program="${ac_cxx_conftest_cxx98_globals} -int -main (int argc, char **argv) -{ - int ok = 0; - ${ac_cxx_conftest_cxx98_main} - return ok; -} -" - -as_fn_append ac_header_cxx_list " stdio.h stdio_h HAVE_STDIO_H" -as_fn_append ac_header_cxx_list " stdlib.h stdlib_h HAVE_STDLIB_H" -as_fn_append ac_header_cxx_list " string.h string_h HAVE_STRING_H" -as_fn_append ac_header_cxx_list " inttypes.h inttypes_h HAVE_INTTYPES_H" -as_fn_append ac_header_cxx_list " stdint.h stdint_h HAVE_STDINT_H" -as_fn_append ac_header_cxx_list " strings.h strings_h HAVE_STRINGS_H" -as_fn_append ac_header_cxx_list " sys/stat.h sys_stat_h HAVE_SYS_STAT_H" -as_fn_append ac_header_cxx_list " sys/types.h sys_types_h HAVE_SYS_TYPES_H" -as_fn_append ac_header_cxx_list " unistd.h unistd_h HAVE_UNISTD_H" -as_fn_append ac_header_cxx_list " wchar.h wchar_h HAVE_WCHAR_H" -as_fn_append ac_header_cxx_list " minix/config.h minix_config_h HAVE_MINIX_CONFIG_H" - -# Auxiliary files required by this configure script. -ac_aux_files="ltmain.sh ar-lib compile missing install-sh config.guess config.sub" - -# Locations in which to look for auxiliary files. -ac_aux_dir_candidates="${srcdir}${PATH_SEPARATOR}${srcdir}/..${PATH_SEPARATOR}${srcdir}/../.." - -# Search for a directory containing all of the required auxiliary files, -# $ac_aux_files, from the $PATH-style list $ac_aux_dir_candidates. -# If we don't find one directory that contains all the files we need, -# we report the set of missing files from the *first* directory in -# $ac_aux_dir_candidates and give up. -ac_missing_aux_files="" -ac_first_candidate=: -printf "%s\n" "$as_me:${as_lineno-$LINENO}: looking for aux files: $ac_aux_files" >&5 -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -as_found=false -for as_dir in $ac_aux_dir_candidates -do - IFS=$as_save_IFS - case $as_dir in #((( - '') as_dir=./ ;; - */) ;; - *) as_dir=$as_dir/ ;; - esac - as_found=: - - printf "%s\n" "$as_me:${as_lineno-$LINENO}: trying $as_dir" >&5 - ac_aux_dir_found=yes - ac_install_sh= - for ac_aux in $ac_aux_files - do - # As a special case, if "install-sh" is required, that requirement - # can be satisfied by any of "install-sh", "install.sh", or "shtool", - # and $ac_install_sh is set appropriately for whichever one is found. - if test x"$ac_aux" = x"install-sh" - then - if test -f "${as_dir}install-sh"; then - printf "%s\n" "$as_me:${as_lineno-$LINENO}: ${as_dir}install-sh found" >&5 - ac_install_sh="${as_dir}install-sh -c" - elif test -f "${as_dir}install.sh"; then - printf "%s\n" "$as_me:${as_lineno-$LINENO}: ${as_dir}install.sh found" >&5 - ac_install_sh="${as_dir}install.sh -c" - elif test -f "${as_dir}shtool"; then - printf "%s\n" "$as_me:${as_lineno-$LINENO}: ${as_dir}shtool found" >&5 - ac_install_sh="${as_dir}shtool install -c" - else - ac_aux_dir_found=no - if $ac_first_candidate; then - ac_missing_aux_files="${ac_missing_aux_files} install-sh" - else - break - fi - fi - else - if test -f "${as_dir}${ac_aux}"; then - printf "%s\n" "$as_me:${as_lineno-$LINENO}: ${as_dir}${ac_aux} found" >&5 - else - ac_aux_dir_found=no - if $ac_first_candidate; then - ac_missing_aux_files="${ac_missing_aux_files} ${ac_aux}" - else - break - fi - fi - fi - done - if test "$ac_aux_dir_found" = yes; then - ac_aux_dir="$as_dir" - break - fi - ac_first_candidate=false - - as_found=false -done -IFS=$as_save_IFS -if $as_found -then : - -else $as_nop - as_fn_error $? "cannot find required auxiliary files:$ac_missing_aux_files" "$LINENO" 5 -fi - - -# These three variables are undocumented and unsupported, -# and are intended to be withdrawn in a future Autoconf release. -# They can cause serious problems if a builder's source tree is in a directory -# whose full name contains unusual characters. -if test -f "${ac_aux_dir}config.guess"; then - ac_config_guess="$SHELL ${ac_aux_dir}config.guess" -fi -if test -f "${ac_aux_dir}config.sub"; then - ac_config_sub="$SHELL ${ac_aux_dir}config.sub" -fi -if test -f "$ac_aux_dir/configure"; then - ac_configure="$SHELL ${ac_aux_dir}configure" -fi - -# Check that the precious variables saved in the cache have kept the same -# value. -ac_cache_corrupted=false -for ac_var in $ac_precious_vars; do - eval ac_old_set=\$ac_cv_env_${ac_var}_set - eval ac_new_set=\$ac_env_${ac_var}_set - eval ac_old_val=\$ac_cv_env_${ac_var}_value - eval ac_new_val=\$ac_env_${ac_var}_value - case $ac_old_set,$ac_new_set in - set,) - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&5 -printf "%s\n" "$as_me: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&2;} - ac_cache_corrupted=: ;; - ,set) - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: \`$ac_var' was not set in the previous run" >&5 -printf "%s\n" "$as_me: error: \`$ac_var' was not set in the previous run" >&2;} - ac_cache_corrupted=: ;; - ,);; - *) - if test "x$ac_old_val" != "x$ac_new_val"; then - # differences in whitespace do not lead to failure. - ac_old_val_w=`echo x $ac_old_val` - ac_new_val_w=`echo x $ac_new_val` - if test "$ac_old_val_w" != "$ac_new_val_w"; then - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: \`$ac_var' has changed since the previous run:" >&5 -printf "%s\n" "$as_me: error: \`$ac_var' has changed since the previous run:" >&2;} - ac_cache_corrupted=: - else - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: warning: ignoring whitespace changes in \`$ac_var' since the previous run:" >&5 -printf "%s\n" "$as_me: warning: ignoring whitespace changes in \`$ac_var' since the previous run:" >&2;} - eval $ac_var=\$ac_old_val - fi - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: former value: \`$ac_old_val'" >&5 -printf "%s\n" "$as_me: former value: \`$ac_old_val'" >&2;} - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: current value: \`$ac_new_val'" >&5 -printf "%s\n" "$as_me: current value: \`$ac_new_val'" >&2;} - fi;; - esac - # Pass precious variables to config.status. - if test "$ac_new_set" = set; then - case $ac_new_val in - *\'*) ac_arg=$ac_var=`printf "%s\n" "$ac_new_val" | sed "s/'/'\\\\\\\\''/g"` ;; - *) ac_arg=$ac_var=$ac_new_val ;; - esac - case " $ac_configure_args " in - *" '$ac_arg' "*) ;; # Avoid dups. Use of quotes ensures accuracy. - *) as_fn_append ac_configure_args " '$ac_arg'" ;; - esac - fi -done -if $ac_cache_corrupted; then - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 -printf "%s\n" "$as_me: error: in \`$ac_pwd':" >&2;} - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: changes in the environment can compromise the build" >&5 -printf "%s\n" "$as_me: error: changes in the environment can compromise the build" >&2;} - as_fn_error $? "run \`${MAKE-make} distclean' and/or \`rm $cache_file' - and start over" "$LINENO" 5 -fi -## -------------------- ## -## Main body of script. ## -## -------------------- ## - -ac_ext=c -ac_cpp='$CPP $CPPFLAGS' -ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' -ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' -ac_compiler_gnu=$ac_cv_c_compiler_gnu - - - - -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether to enable maintainer-specific portions of Makefiles" >&5 -printf %s "checking whether to enable maintainer-specific portions of Makefiles... " >&6; } - # Check whether --enable-maintainer-mode was given. -if test ${enable_maintainer_mode+y} -then : - enableval=$enable_maintainer_mode; USE_MAINTAINER_MODE=$enableval -else $as_nop - USE_MAINTAINER_MODE=yes -fi - - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $USE_MAINTAINER_MODE" >&5 -printf "%s\n" "$USE_MAINTAINER_MODE" >&6; } - if test $USE_MAINTAINER_MODE = yes; then - MAINTAINER_MODE_TRUE= - MAINTAINER_MODE_FALSE='#' -else - MAINTAINER_MODE_TRUE='#' - MAINTAINER_MODE_FALSE= -fi - - MAINT=$MAINTAINER_MODE_TRUE - - - - -# The config file is generated but not used by the source code, since we only -# need very few of them, e.g. HAVE_PTHREAD and HAVE_ZLIB. Those macros are -# passed down in CXXFLAGS manually in src/Makefile.am -ac_config_headers="$ac_config_headers config.h" - - - - -case "$DIST_LANG" in - "") DIST_LANG=all ;; - all | cpp | csharp | java | python | javanano | objectivec | ruby | js | php) ;; - *) { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 -printf "%s\n" "$as_me: error: in \`$ac_pwd':" >&2;} -as_fn_error $? "unknown language: $DIST_LANG -See \`config.log' for more details" "$LINENO" 5; } ;; -esac - - -# autoconf's default CXXFLAGS are usually "-g -O2". These aren't necessarily -# the best choice for libprotobuf. -if test "x${ac_cv_env_CFLAGS_set}" = "x" -then : - CFLAGS="" -fi -if test "x${ac_cv_env_CXXFLAGS_set}" = "x" -then : - CXXFLAGS="" -fi - - - - - # Make sure we can run config.sub. -$SHELL "${ac_aux_dir}config.sub" sun4 >/dev/null 2>&1 || - as_fn_error $? "cannot run $SHELL ${ac_aux_dir}config.sub" "$LINENO" 5 - -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking build system type" >&5 -printf %s "checking build system type... " >&6; } -if test ${ac_cv_build+y} -then : - printf %s "(cached) " >&6 -else $as_nop - ac_build_alias=$build_alias -test "x$ac_build_alias" = x && - ac_build_alias=`$SHELL "${ac_aux_dir}config.guess"` -test "x$ac_build_alias" = x && - as_fn_error $? "cannot guess build type; you must specify one" "$LINENO" 5 -ac_cv_build=`$SHELL "${ac_aux_dir}config.sub" $ac_build_alias` || - as_fn_error $? "$SHELL ${ac_aux_dir}config.sub $ac_build_alias failed" "$LINENO" 5 - -fi -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_build" >&5 -printf "%s\n" "$ac_cv_build" >&6; } -case $ac_cv_build in -*-*-*) ;; -*) as_fn_error $? "invalid value of canonical build" "$LINENO" 5;; -esac -build=$ac_cv_build -ac_save_IFS=$IFS; IFS='-' -set x $ac_cv_build -shift -build_cpu=$1 -build_vendor=$2 -shift; shift -# Remember, the first character of IFS is used to create $*, -# except with old shells: -build_os=$* -IFS=$ac_save_IFS -case $build_os in *\ *) build_os=`echo "$build_os" | sed 's/ /-/g'`;; esac - - -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking host system type" >&5 -printf %s "checking host system type... " >&6; } -if test ${ac_cv_host+y} -then : - printf %s "(cached) " >&6 -else $as_nop - if test "x$host_alias" = x; then - ac_cv_host=$ac_cv_build -else - ac_cv_host=`$SHELL "${ac_aux_dir}config.sub" $host_alias` || - as_fn_error $? "$SHELL ${ac_aux_dir}config.sub $host_alias failed" "$LINENO" 5 -fi - -fi -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_host" >&5 -printf "%s\n" "$ac_cv_host" >&6; } -case $ac_cv_host in -*-*-*) ;; -*) as_fn_error $? "invalid value of canonical host" "$LINENO" 5;; -esac -host=$ac_cv_host -ac_save_IFS=$IFS; IFS='-' -set x $ac_cv_host -shift -host_cpu=$1 -host_vendor=$2 -shift; shift -# Remember, the first character of IFS is used to create $*, -# except with old shells: -host_os=$* -IFS=$ac_save_IFS -case $host_os in *\ *) host_os=`echo "$host_os" | sed 's/ /-/g'`;; esac - - -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking target system type" >&5 -printf %s "checking target system type... " >&6; } -if test ${ac_cv_target+y} -then : - printf %s "(cached) " >&6 -else $as_nop - if test "x$target_alias" = x; then - ac_cv_target=$ac_cv_host -else - ac_cv_target=`$SHELL "${ac_aux_dir}config.sub" $target_alias` || - as_fn_error $? "$SHELL ${ac_aux_dir}config.sub $target_alias failed" "$LINENO" 5 -fi - -fi -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_target" >&5 -printf "%s\n" "$ac_cv_target" >&6; } -case $ac_cv_target in -*-*-*) ;; -*) as_fn_error $? "invalid value of canonical target" "$LINENO" 5;; -esac -target=$ac_cv_target -ac_save_IFS=$IFS; IFS='-' -set x $ac_cv_target -shift -target_cpu=$1 -target_vendor=$2 -shift; shift -# Remember, the first character of IFS is used to create $*, -# except with old shells: -target_os=$* -IFS=$ac_save_IFS -case $target_os in *\ *) target_os=`echo "$target_os" | sed 's/ /-/g'`;; esac - - -# The aliases save the names the user supplied, while $host etc. -# will get canonicalized. -test -n "$target_alias" && - test "$program_prefix$program_suffix$program_transform_name" = \ - NONENONEs,x,x, && - program_prefix=${target_alias}- - -am__api_version='1.16' - - - # Find a good install program. We prefer a C program (faster), -# so one script is as good as another. But avoid the broken or -# incompatible versions: -# SysV /etc/install, /usr/sbin/install -# SunOS /usr/etc/install -# IRIX /sbin/install -# AIX /bin/install -# AmigaOS /C/install, which installs bootblocks on floppy discs -# AIX 4 /usr/bin/installbsd, which doesn't work without a -g flag -# AFS /usr/afsws/bin/install, which mishandles nonexistent args -# SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff" -# OS/2's system install, which has a completely different semantic -# ./install, which can be erroneously created by make from ./install.sh. -# Reject install programs that cannot install multiple files. -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for a BSD-compatible install" >&5 -printf %s "checking for a BSD-compatible install... " >&6; } -if test -z "$INSTALL"; then -if test ${ac_cv_path_install+y} -then : - printf %s "(cached) " >&6 -else $as_nop - as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - case $as_dir in #((( - '') as_dir=./ ;; - */) ;; - *) as_dir=$as_dir/ ;; - esac - # Account for fact that we put trailing slashes in our PATH walk. -case $as_dir in #(( - ./ | /[cC]/* | \ - /etc/* | /usr/sbin/* | /usr/etc/* | /sbin/* | /usr/afsws/bin/* | \ - ?:[\\/]os2[\\/]install[\\/]* | ?:[\\/]OS2[\\/]INSTALL[\\/]* | \ - /usr/ucb/* ) ;; - *) - # OSF1 and SCO ODT 3.0 have their own names for install. - # Don't use installbsd from OSF since it installs stuff as root - # by default. - for ac_prog in ginstall scoinst install; do - for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir$ac_prog$ac_exec_ext"; then - if test $ac_prog = install && - grep dspmsg "$as_dir$ac_prog$ac_exec_ext" >/dev/null 2>&1; then - # AIX install. It has an incompatible calling convention. - : - elif test $ac_prog = install && - grep pwplus "$as_dir$ac_prog$ac_exec_ext" >/dev/null 2>&1; then - # program-specific install script used by HP pwplus--don't use. - : - else - rm -rf conftest.one conftest.two conftest.dir - echo one > conftest.one - echo two > conftest.two - mkdir conftest.dir - if "$as_dir$ac_prog$ac_exec_ext" -c conftest.one conftest.two "`pwd`/conftest.dir/" && - test -s conftest.one && test -s conftest.two && - test -s conftest.dir/conftest.one && - test -s conftest.dir/conftest.two - then - ac_cv_path_install="$as_dir$ac_prog$ac_exec_ext -c" - break 3 - fi - fi - fi - done - done - ;; -esac - - done -IFS=$as_save_IFS - -rm -rf conftest.one conftest.two conftest.dir - -fi - if test ${ac_cv_path_install+y}; then - INSTALL=$ac_cv_path_install - else - # As a last resort, use the slow shell script. Don't cache a - # value for INSTALL within a source directory, because that will - # break other packages using the cache if that directory is - # removed, or if the value is a relative name. - INSTALL=$ac_install_sh - fi -fi -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $INSTALL" >&5 -printf "%s\n" "$INSTALL" >&6; } - -# Use test -z because SunOS4 sh mishandles braces in ${var-val}. -# It thinks the first close brace ends the variable substitution. -test -z "$INSTALL_PROGRAM" && INSTALL_PROGRAM='${INSTALL}' - -test -z "$INSTALL_SCRIPT" && INSTALL_SCRIPT='${INSTALL}' - -test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644' - -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether build environment is sane" >&5 -printf %s "checking whether build environment is sane... " >&6; } -# Reject unsafe characters in $srcdir or the absolute working directory -# name. Accept space and tab only in the latter. -am_lf=' -' -case `pwd` in - *[\\\"\#\$\&\'\`$am_lf]*) - as_fn_error $? "unsafe absolute working directory name" "$LINENO" 5;; -esac -case $srcdir in - *[\\\"\#\$\&\'\`$am_lf\ \ ]*) - as_fn_error $? "unsafe srcdir value: '$srcdir'" "$LINENO" 5;; -esac - -# Do 'set' in a subshell so we don't clobber the current shell's -# arguments. Must try -L first in case configure is actually a -# symlink; some systems play weird games with the mod time of symlinks -# (eg FreeBSD returns the mod time of the symlink's containing -# directory). -if ( - am_has_slept=no - for am_try in 1 2; do - echo "timestamp, slept: $am_has_slept" > conftest.file - set X `ls -Lt "$srcdir/configure" conftest.file 2> /dev/null` - if test "$*" = "X"; then - # -L didn't work. - set X `ls -t "$srcdir/configure" conftest.file` - fi - if test "$*" != "X $srcdir/configure conftest.file" \ - && test "$*" != "X conftest.file $srcdir/configure"; then - - # If neither matched, then we have a broken ls. This can happen - # if, for instance, CONFIG_SHELL is bash and it inherits a - # broken ls alias from the environment. This has actually - # happened. Such a system could not be considered "sane". - as_fn_error $? "ls -t appears to fail. Make sure there is not a broken - alias in your environment" "$LINENO" 5 - fi - if test "$2" = conftest.file || test $am_try -eq 2; then - break - fi - # Just in case. - sleep 1 - am_has_slept=yes - done - test "$2" = conftest.file - ) -then - # Ok. - : -else - as_fn_error $? "newly created file is older than distributed files! -Check your system clock" "$LINENO" 5 -fi -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -printf "%s\n" "yes" >&6; } -# If we didn't sleep, we still need to ensure time stamps of config.status and -# generated files are strictly newer. -am_sleep_pid= -if grep 'slept: no' conftest.file >/dev/null 2>&1; then - ( sleep 1 ) & - am_sleep_pid=$! -fi - -rm -f conftest.file - -test "$program_prefix" != NONE && - program_transform_name="s&^&$program_prefix&;$program_transform_name" -# Use a double $ so make ignores it. -test "$program_suffix" != NONE && - program_transform_name="s&\$&$program_suffix&;$program_transform_name" -# Double any \ or $. -# By default was `s,x,x', remove it if useless. -ac_script='s/[\\$]/&&/g;s/;s,x,x,$//' -program_transform_name=`printf "%s\n" "$program_transform_name" | sed "$ac_script"` - - -# Expand $ac_aux_dir to an absolute path. -am_aux_dir=`cd "$ac_aux_dir" && pwd` - - - if test x"${MISSING+set}" != xset; then - MISSING="\${SHELL} '$am_aux_dir/missing'" -fi -# Use eval to expand $SHELL -if eval "$MISSING --is-lightweight"; then - am_missing_run="$MISSING " -else - am_missing_run= - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: 'missing' script is too old or missing" >&5 -printf "%s\n" "$as_me: WARNING: 'missing' script is too old or missing" >&2;} -fi - -if test x"${install_sh+set}" != xset; then - case $am_aux_dir in - *\ * | *\ *) - install_sh="\${SHELL} '$am_aux_dir/install-sh'" ;; - *) - install_sh="\${SHELL} $am_aux_dir/install-sh" - esac -fi - -# Installed binaries are usually stripped using 'strip' when the user -# run "make install-strip". However 'strip' might not be the right -# tool to use in cross-compilation environments, therefore Automake -# will honor the 'STRIP' environment variable to overrule this program. -if test "$cross_compiling" != no; then - if test -n "$ac_tool_prefix"; then - # Extract the first word of "${ac_tool_prefix}strip", so it can be a program name with args. -set dummy ${ac_tool_prefix}strip; ac_word=$2 -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -printf %s "checking for $ac_word... " >&6; } -if test ${ac_cv_prog_STRIP+y} -then : - printf %s "(cached) " >&6 -else $as_nop - if test -n "$STRIP"; then - ac_cv_prog_STRIP="$STRIP" # Let the user override the test. -else -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - case $as_dir in #((( - '') as_dir=./ ;; - */) ;; - *) as_dir=$as_dir/ ;; - esac - for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then - ac_cv_prog_STRIP="${ac_tool_prefix}strip" - printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 - break 2 - fi -done - done -IFS=$as_save_IFS - -fi -fi -STRIP=$ac_cv_prog_STRIP -if test -n "$STRIP"; then - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $STRIP" >&5 -printf "%s\n" "$STRIP" >&6; } -else - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 -printf "%s\n" "no" >&6; } -fi - - -fi -if test -z "$ac_cv_prog_STRIP"; then - ac_ct_STRIP=$STRIP - # Extract the first word of "strip", so it can be a program name with args. -set dummy strip; ac_word=$2 -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -printf %s "checking for $ac_word... " >&6; } -if test ${ac_cv_prog_ac_ct_STRIP+y} -then : - printf %s "(cached) " >&6 -else $as_nop - if test -n "$ac_ct_STRIP"; then - ac_cv_prog_ac_ct_STRIP="$ac_ct_STRIP" # Let the user override the test. -else -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - case $as_dir in #((( - '') as_dir=./ ;; - */) ;; - *) as_dir=$as_dir/ ;; - esac - for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then - ac_cv_prog_ac_ct_STRIP="strip" - printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 - break 2 - fi -done - done -IFS=$as_save_IFS - -fi -fi -ac_ct_STRIP=$ac_cv_prog_ac_ct_STRIP -if test -n "$ac_ct_STRIP"; then - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_ct_STRIP" >&5 -printf "%s\n" "$ac_ct_STRIP" >&6; } -else - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 -printf "%s\n" "no" >&6; } -fi - - if test "x$ac_ct_STRIP" = x; then - STRIP=":" - else - case $cross_compiling:$ac_tool_warned in -yes:) -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 -printf "%s\n" "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} -ac_tool_warned=yes ;; -esac - STRIP=$ac_ct_STRIP - fi -else - STRIP="$ac_cv_prog_STRIP" -fi - -fi -INSTALL_STRIP_PROGRAM="\$(install_sh) -c -s" - - - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for a race-free mkdir -p" >&5 -printf %s "checking for a race-free mkdir -p... " >&6; } -if test -z "$MKDIR_P"; then - if test ${ac_cv_path_mkdir+y} -then : - printf %s "(cached) " >&6 -else $as_nop - as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH$PATH_SEPARATOR/opt/sfw/bin -do - IFS=$as_save_IFS - case $as_dir in #((( - '') as_dir=./ ;; - */) ;; - *) as_dir=$as_dir/ ;; - esac - for ac_prog in mkdir gmkdir; do - for ac_exec_ext in '' $ac_executable_extensions; do - as_fn_executable_p "$as_dir$ac_prog$ac_exec_ext" || continue - case `"$as_dir$ac_prog$ac_exec_ext" --version 2>&1` in #( - 'mkdir ('*'coreutils) '* | \ - 'BusyBox '* | \ - 'mkdir (fileutils) '4.1*) - ac_cv_path_mkdir=$as_dir$ac_prog$ac_exec_ext - break 3;; - esac - done - done - done -IFS=$as_save_IFS - -fi - - test -d ./--version && rmdir ./--version - if test ${ac_cv_path_mkdir+y}; then - MKDIR_P="$ac_cv_path_mkdir -p" - else - # As a last resort, use the slow shell script. Don't cache a - # value for MKDIR_P within a source directory, because that will - # break other packages using the cache if that directory is - # removed, or if the value is a relative name. - MKDIR_P="$ac_install_sh -d" - fi -fi -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $MKDIR_P" >&5 -printf "%s\n" "$MKDIR_P" >&6; } - -for ac_prog in gawk mawk nawk awk -do - # Extract the first word of "$ac_prog", so it can be a program name with args. -set dummy $ac_prog; ac_word=$2 -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -printf %s "checking for $ac_word... " >&6; } -if test ${ac_cv_prog_AWK+y} -then : - printf %s "(cached) " >&6 -else $as_nop - if test -n "$AWK"; then - ac_cv_prog_AWK="$AWK" # Let the user override the test. -else -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - case $as_dir in #((( - '') as_dir=./ ;; - */) ;; - *) as_dir=$as_dir/ ;; - esac - for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then - ac_cv_prog_AWK="$ac_prog" - printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 - break 2 - fi -done - done -IFS=$as_save_IFS - -fi -fi -AWK=$ac_cv_prog_AWK -if test -n "$AWK"; then - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $AWK" >&5 -printf "%s\n" "$AWK" >&6; } -else - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 -printf "%s\n" "no" >&6; } -fi - - - test -n "$AWK" && break -done - -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether ${MAKE-make} sets \$(MAKE)" >&5 -printf %s "checking whether ${MAKE-make} sets \$(MAKE)... " >&6; } -set x ${MAKE-make} -ac_make=`printf "%s\n" "$2" | sed 's/+/p/g; s/[^a-zA-Z0-9_]/_/g'` -if eval test \${ac_cv_prog_make_${ac_make}_set+y} -then : - printf %s "(cached) " >&6 -else $as_nop - cat >conftest.make <<\_ACEOF -SHELL = /bin/sh -all: - @echo '@@@%%%=$(MAKE)=@@@%%%' -_ACEOF -# GNU make sometimes prints "make[1]: Entering ...", which would confuse us. -case `${MAKE-make} -f conftest.make 2>/dev/null` in - *@@@%%%=?*=@@@%%%*) - eval ac_cv_prog_make_${ac_make}_set=yes;; - *) - eval ac_cv_prog_make_${ac_make}_set=no;; -esac -rm -f conftest.make -fi -if eval test \$ac_cv_prog_make_${ac_make}_set = yes; then - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -printf "%s\n" "yes" >&6; } - SET_MAKE= -else - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 -printf "%s\n" "no" >&6; } - SET_MAKE="MAKE=${MAKE-make}" -fi - -rm -rf .tst 2>/dev/null -mkdir .tst 2>/dev/null -if test -d .tst; then - am__leading_dot=. -else - am__leading_dot=_ -fi -rmdir .tst 2>/dev/null - -# Check whether --enable-silent-rules was given. -if test ${enable_silent_rules+y} -then : - enableval=$enable_silent_rules; -fi - -case $enable_silent_rules in # ((( - yes) AM_DEFAULT_VERBOSITY=0;; - no) AM_DEFAULT_VERBOSITY=1;; - *) AM_DEFAULT_VERBOSITY=1;; -esac -am_make=${MAKE-make} -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether $am_make supports nested variables" >&5 -printf %s "checking whether $am_make supports nested variables... " >&6; } -if test ${am_cv_make_support_nested_variables+y} -then : - printf %s "(cached) " >&6 -else $as_nop - if printf "%s\n" 'TRUE=$(BAR$(V)) -BAR0=false -BAR1=true -V=1 -am__doit: - @$(TRUE) -.PHONY: am__doit' | $am_make -f - >/dev/null 2>&1; then - am_cv_make_support_nested_variables=yes -else - am_cv_make_support_nested_variables=no -fi -fi -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $am_cv_make_support_nested_variables" >&5 -printf "%s\n" "$am_cv_make_support_nested_variables" >&6; } -if test $am_cv_make_support_nested_variables = yes; then - AM_V='$(V)' - AM_DEFAULT_V='$(AM_DEFAULT_VERBOSITY)' -else - AM_V=$AM_DEFAULT_VERBOSITY - AM_DEFAULT_V=$AM_DEFAULT_VERBOSITY -fi -AM_BACKSLASH='\' - -if test "`cd $srcdir && pwd`" != "`pwd`"; then - # Use -I$(srcdir) only when $(srcdir) != ., so that make's output - # is not polluted with repeated "-I." - am__isrc=' -I$(srcdir)' - # test to see if srcdir already configured - if test -f $srcdir/config.status; then - as_fn_error $? "source directory already configured; run \"make distclean\" there first" "$LINENO" 5 - fi -fi - -# test whether we have cygpath -if test -z "$CYGPATH_W"; then - if (cygpath --version) >/dev/null 2>/dev/null; then - CYGPATH_W='cygpath -w' - else - CYGPATH_W=echo - fi -fi - - -# Define the identity of the package. - PACKAGE='protobuf' - VERSION='3.19.4' - - -printf "%s\n" "#define PACKAGE \"$PACKAGE\"" >>confdefs.h - - -printf "%s\n" "#define VERSION \"$VERSION\"" >>confdefs.h - -# Some tools Automake needs. - -ACLOCAL=${ACLOCAL-"${am_missing_run}aclocal-${am__api_version}"} - - -AUTOCONF=${AUTOCONF-"${am_missing_run}autoconf"} - - -AUTOMAKE=${AUTOMAKE-"${am_missing_run}automake-${am__api_version}"} - - -AUTOHEADER=${AUTOHEADER-"${am_missing_run}autoheader"} - - -MAKEINFO=${MAKEINFO-"${am_missing_run}makeinfo"} - -# For better backward compatibility. To be removed once Automake 1.9.x -# dies out for good. For more background, see: -# -# -mkdir_p='$(MKDIR_P)' - -# We need awk for the "check" target (and possibly the TAP driver). The -# system "awk" is bad on some platforms. -# Always define AMTAR for backward compatibility. Yes, it's still used -# in the wild :-( We should find a proper way to deprecate it ... -AMTAR='$${TAR-tar}' - - -# We'll loop over all known methods to create a tar archive until one works. -_am_tools='gnutar plaintar pax cpio none' - -# The POSIX 1988 'ustar' format is defined with fixed-size fields. - # There is notably a 21 bits limit for the UID and the GID. In fact, - # the 'pax' utility can hang on bigger UID/GID (see automake bug#8343 - # and bug#13588). - am_max_uid=2097151 # 2^21 - 1 - am_max_gid=$am_max_uid - # The $UID and $GID variables are not portable, so we need to resort - # to the POSIX-mandated id(1) utility. Errors in the 'id' calls - # below are definitely unexpected, so allow the users to see them - # (that is, avoid stderr redirection). - am_uid=`id -u || echo unknown` - am_gid=`id -g || echo unknown` - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether UID '$am_uid' is supported by ustar format" >&5 -printf %s "checking whether UID '$am_uid' is supported by ustar format... " >&6; } - if test $am_uid -le $am_max_uid; then - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -printf "%s\n" "yes" >&6; } - else - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 -printf "%s\n" "no" >&6; } - _am_tools=none - fi - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether GID '$am_gid' is supported by ustar format" >&5 -printf %s "checking whether GID '$am_gid' is supported by ustar format... " >&6; } - if test $am_gid -le $am_max_gid; then - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -printf "%s\n" "yes" >&6; } - else - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 -printf "%s\n" "no" >&6; } - _am_tools=none - fi - - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking how to create a ustar tar archive" >&5 -printf %s "checking how to create a ustar tar archive... " >&6; } - - # Go ahead even if we have the value already cached. We do so because we - # need to set the values for the 'am__tar' and 'am__untar' variables. - _am_tools=${am_cv_prog_tar_ustar-$_am_tools} - - for _am_tool in $_am_tools; do - case $_am_tool in - gnutar) - for _am_tar in tar gnutar gtar; do - { echo "$as_me:$LINENO: $_am_tar --version" >&5 - ($_am_tar --version) >&5 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && break - done - am__tar="$_am_tar --format=ustar -chf - "'"$$tardir"' - am__tar_="$_am_tar --format=ustar -chf - "'"$tardir"' - am__untar="$_am_tar -xf -" - ;; - plaintar) - # Must skip GNU tar: if it does not support --format= it doesn't create - # ustar tarball either. - (tar --version) >/dev/null 2>&1 && continue - am__tar='tar chf - "$$tardir"' - am__tar_='tar chf - "$tardir"' - am__untar='tar xf -' - ;; - pax) - am__tar='pax -L -x ustar -w "$$tardir"' - am__tar_='pax -L -x ustar -w "$tardir"' - am__untar='pax -r' - ;; - cpio) - am__tar='find "$$tardir" -print | cpio -o -H ustar -L' - am__tar_='find "$tardir" -print | cpio -o -H ustar -L' - am__untar='cpio -i -H ustar -d' - ;; - none) - am__tar=false - am__tar_=false - am__untar=false - ;; - esac - - # If the value was cached, stop now. We just wanted to have am__tar - # and am__untar set. - test -n "${am_cv_prog_tar_ustar}" && break - - # tar/untar a dummy directory, and stop if the command works. - rm -rf conftest.dir - mkdir conftest.dir - echo GrepMe > conftest.dir/file - { echo "$as_me:$LINENO: tardir=conftest.dir && eval $am__tar_ >conftest.tar" >&5 - (tardir=conftest.dir && eval $am__tar_ >conftest.tar) >&5 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } - rm -rf conftest.dir - if test -s conftest.tar; then - { echo "$as_me:$LINENO: $am__untar &5 - ($am__untar &5 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } - { echo "$as_me:$LINENO: cat conftest.dir/file" >&5 - (cat conftest.dir/file) >&5 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } - grep GrepMe conftest.dir/file >/dev/null 2>&1 && break - fi - done - rm -rf conftest.dir - - if test ${am_cv_prog_tar_ustar+y} -then : - printf %s "(cached) " >&6 -else $as_nop - am_cv_prog_tar_ustar=$_am_tool -fi - - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $am_cv_prog_tar_ustar" >&5 -printf "%s\n" "$am_cv_prog_tar_ustar" >&6; } - - - - - -# Variables for tags utilities; see am/tags.am -if test -z "$CTAGS"; then - CTAGS=ctags -fi - -if test -z "$ETAGS"; then - ETAGS=etags -fi - -if test -z "$CSCOPE"; then - CSCOPE=cscope -fi - - - -# POSIX will say in a future version that running "rm -f" with no argument -# is OK; and we want to be able to make that assumption in our Makefile -# recipes. So use an aggressive probe to check that the usage we want is -# actually supported "in the wild" to an acceptable degree. -# See automake bug#10828. -# To make any issue more visible, cause the running configure to be aborted -# by default if the 'rm' program in use doesn't match our expectations; the -# user can still override this though. -if rm -f && rm -fr && rm -rf; then : OK; else - cat >&2 <<'END' -Oops! - -Your 'rm' program seems unable to run without file operands specified -on the command line, even when the '-f' option is present. This is contrary -to the behaviour of most rm programs out there, and not conforming with -the upcoming POSIX standard: - -Please tell bug-automake@gnu.org about your system, including the value -of your $PATH and any error possibly output before this message. This -can help us improve future automake versions. - -END - if test x"$ACCEPT_INFERIOR_RM_PROGRAM" = x"yes"; then - echo 'Configuration will proceed anyway, since you have set the' >&2 - echo 'ACCEPT_INFERIOR_RM_PROGRAM variable to "yes"' >&2 - echo >&2 - else - cat >&2 <<'END' -Aborting the configuration process, to ensure you take notice of the issue. - -You can download and install GNU coreutils to get an 'rm' implementation -that behaves properly: . - -If you want to complete the configuration process using your problematic -'rm' anyway, export the environment variable ACCEPT_INFERIOR_RM_PROGRAM -to "yes", and re-run configure. - -END - as_fn_error $? "Your 'rm' program is bad, sorry." "$LINENO" 5 - fi -fi - - -# Silent rules enabled: the output is minimal but informative. -# In particular, the warnings from the compiler stick out very clearly. -# To see all logs, use the --disable-silent-rules on configure or via make V=1 -# Check whether --enable-silent-rules was given. -if test ${enable_silent_rules+y} -then : - enableval=$enable_silent_rules; -fi - -case $enable_silent_rules in # ((( - yes) AM_DEFAULT_VERBOSITY=0;; - no) AM_DEFAULT_VERBOSITY=1;; - *) AM_DEFAULT_VERBOSITY=0;; -esac -am_make=${MAKE-make} -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether $am_make supports nested variables" >&5 -printf %s "checking whether $am_make supports nested variables... " >&6; } -if test ${am_cv_make_support_nested_variables+y} -then : - printf %s "(cached) " >&6 -else $as_nop - if printf "%s\n" 'TRUE=$(BAR$(V)) -BAR0=false -BAR1=true -V=1 -am__doit: - @$(TRUE) -.PHONY: am__doit' | $am_make -f - >/dev/null 2>&1; then - am_cv_make_support_nested_variables=yes -else - am_cv_make_support_nested_variables=no -fi -fi -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $am_cv_make_support_nested_variables" >&5 -printf "%s\n" "$am_cv_make_support_nested_variables" >&6; } -if test $am_cv_make_support_nested_variables = yes; then - AM_V='$(V)' - AM_DEFAULT_V='$(AM_DEFAULT_VERBOSITY)' -else - AM_V=$AM_DEFAULT_VERBOSITY - AM_DEFAULT_V=$AM_DEFAULT_VERBOSITY -fi -AM_BACKSLASH='\' - - - -# Check whether --with-zlib was given. -if test ${with_zlib+y} -then : - withval=$with_zlib; -else $as_nop - with_zlib=check -fi - - - -# Check whether --with-zlib-include was given. -if test ${with_zlib_include+y} -then : - withval=$with_zlib_include; CPPFLAGS="-I$withval $CPPFLAGS" -fi - - - -# Check whether --with-zlib-lib was given. -if test ${with_zlib_lib+y} -then : - withval=$with_zlib_lib; LDFLAGS="-L$withval $LDFLAGS" -fi - - - -# Check whether --with-protoc was given. -if test ${with_protoc+y} -then : - withval=$with_protoc; -else $as_nop - with_protoc=no -fi - - -# Checks for programs. - - - - - - - - - -ac_ext=c -ac_cpp='$CPP $CPPFLAGS' -ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' -ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' -ac_compiler_gnu=$ac_cv_c_compiler_gnu -if test -n "$ac_tool_prefix"; then - # Extract the first word of "${ac_tool_prefix}gcc", so it can be a program name with args. -set dummy ${ac_tool_prefix}gcc; ac_word=$2 -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -printf %s "checking for $ac_word... " >&6; } -if test ${ac_cv_prog_CC+y} -then : - printf %s "(cached) " >&6 -else $as_nop - if test -n "$CC"; then - ac_cv_prog_CC="$CC" # Let the user override the test. -else -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - case $as_dir in #((( - '') as_dir=./ ;; - */) ;; - *) as_dir=$as_dir/ ;; - esac - for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then - ac_cv_prog_CC="${ac_tool_prefix}gcc" - printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 - break 2 - fi -done - done -IFS=$as_save_IFS - -fi -fi -CC=$ac_cv_prog_CC -if test -n "$CC"; then - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 -printf "%s\n" "$CC" >&6; } -else - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 -printf "%s\n" "no" >&6; } -fi - - -fi -if test -z "$ac_cv_prog_CC"; then - ac_ct_CC=$CC - # Extract the first word of "gcc", so it can be a program name with args. -set dummy gcc; ac_word=$2 -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -printf %s "checking for $ac_word... " >&6; } -if test ${ac_cv_prog_ac_ct_CC+y} -then : - printf %s "(cached) " >&6 -else $as_nop - if test -n "$ac_ct_CC"; then - ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test. -else -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - case $as_dir in #((( - '') as_dir=./ ;; - */) ;; - *) as_dir=$as_dir/ ;; - esac - for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then - ac_cv_prog_ac_ct_CC="gcc" - printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 - break 2 - fi -done - done -IFS=$as_save_IFS - -fi -fi -ac_ct_CC=$ac_cv_prog_ac_ct_CC -if test -n "$ac_ct_CC"; then - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CC" >&5 -printf "%s\n" "$ac_ct_CC" >&6; } -else - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 -printf "%s\n" "no" >&6; } -fi - - if test "x$ac_ct_CC" = x; then - CC="" - else - case $cross_compiling:$ac_tool_warned in -yes:) -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 -printf "%s\n" "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} -ac_tool_warned=yes ;; -esac - CC=$ac_ct_CC - fi -else - CC="$ac_cv_prog_CC" -fi - -if test -z "$CC"; then - if test -n "$ac_tool_prefix"; then - # Extract the first word of "${ac_tool_prefix}cc", so it can be a program name with args. -set dummy ${ac_tool_prefix}cc; ac_word=$2 -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -printf %s "checking for $ac_word... " >&6; } -if test ${ac_cv_prog_CC+y} -then : - printf %s "(cached) " >&6 -else $as_nop - if test -n "$CC"; then - ac_cv_prog_CC="$CC" # Let the user override the test. -else -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - case $as_dir in #((( - '') as_dir=./ ;; - */) ;; - *) as_dir=$as_dir/ ;; - esac - for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then - ac_cv_prog_CC="${ac_tool_prefix}cc" - printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 - break 2 - fi -done - done -IFS=$as_save_IFS - -fi -fi -CC=$ac_cv_prog_CC -if test -n "$CC"; then - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 -printf "%s\n" "$CC" >&6; } -else - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 -printf "%s\n" "no" >&6; } -fi - - - fi -fi -if test -z "$CC"; then - # Extract the first word of "cc", so it can be a program name with args. -set dummy cc; ac_word=$2 -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -printf %s "checking for $ac_word... " >&6; } -if test ${ac_cv_prog_CC+y} -then : - printf %s "(cached) " >&6 -else $as_nop - if test -n "$CC"; then - ac_cv_prog_CC="$CC" # Let the user override the test. -else - ac_prog_rejected=no -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - case $as_dir in #((( - '') as_dir=./ ;; - */) ;; - *) as_dir=$as_dir/ ;; - esac - for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then - if test "$as_dir$ac_word$ac_exec_ext" = "/usr/ucb/cc"; then - ac_prog_rejected=yes - continue - fi - ac_cv_prog_CC="cc" - printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 - break 2 - fi -done - done -IFS=$as_save_IFS - -if test $ac_prog_rejected = yes; then - # We found a bogon in the path, so make sure we never use it. - set dummy $ac_cv_prog_CC - shift - if test $# != 0; then - # We chose a different compiler from the bogus one. - # However, it has the same basename, so the bogon will be chosen - # first if we set CC to just the basename; use the full file name. - shift - ac_cv_prog_CC="$as_dir$ac_word${1+' '}$@" - fi -fi -fi -fi -CC=$ac_cv_prog_CC -if test -n "$CC"; then - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 -printf "%s\n" "$CC" >&6; } -else - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 -printf "%s\n" "no" >&6; } -fi - - -fi -if test -z "$CC"; then - if test -n "$ac_tool_prefix"; then - for ac_prog in cl.exe - do - # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args. -set dummy $ac_tool_prefix$ac_prog; ac_word=$2 -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -printf %s "checking for $ac_word... " >&6; } -if test ${ac_cv_prog_CC+y} -then : - printf %s "(cached) " >&6 -else $as_nop - if test -n "$CC"; then - ac_cv_prog_CC="$CC" # Let the user override the test. -else -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - case $as_dir in #((( - '') as_dir=./ ;; - */) ;; - *) as_dir=$as_dir/ ;; - esac - for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then - ac_cv_prog_CC="$ac_tool_prefix$ac_prog" - printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 - break 2 - fi -done - done -IFS=$as_save_IFS - -fi -fi -CC=$ac_cv_prog_CC -if test -n "$CC"; then - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 -printf "%s\n" "$CC" >&6; } -else - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 -printf "%s\n" "no" >&6; } -fi - - - test -n "$CC" && break - done -fi -if test -z "$CC"; then - ac_ct_CC=$CC - for ac_prog in cl.exe -do - # Extract the first word of "$ac_prog", so it can be a program name with args. -set dummy $ac_prog; ac_word=$2 -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -printf %s "checking for $ac_word... " >&6; } -if test ${ac_cv_prog_ac_ct_CC+y} -then : - printf %s "(cached) " >&6 -else $as_nop - if test -n "$ac_ct_CC"; then - ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test. -else -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - case $as_dir in #((( - '') as_dir=./ ;; - */) ;; - *) as_dir=$as_dir/ ;; - esac - for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then - ac_cv_prog_ac_ct_CC="$ac_prog" - printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 - break 2 - fi -done - done -IFS=$as_save_IFS - -fi -fi -ac_ct_CC=$ac_cv_prog_ac_ct_CC -if test -n "$ac_ct_CC"; then - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CC" >&5 -printf "%s\n" "$ac_ct_CC" >&6; } -else - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 -printf "%s\n" "no" >&6; } -fi - - - test -n "$ac_ct_CC" && break -done - - if test "x$ac_ct_CC" = x; then - CC="" - else - case $cross_compiling:$ac_tool_warned in -yes:) -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 -printf "%s\n" "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} -ac_tool_warned=yes ;; -esac - CC=$ac_ct_CC - fi -fi - -fi -if test -z "$CC"; then - if test -n "$ac_tool_prefix"; then - # Extract the first word of "${ac_tool_prefix}clang", so it can be a program name with args. -set dummy ${ac_tool_prefix}clang; ac_word=$2 -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -printf %s "checking for $ac_word... " >&6; } -if test ${ac_cv_prog_CC+y} -then : - printf %s "(cached) " >&6 -else $as_nop - if test -n "$CC"; then - ac_cv_prog_CC="$CC" # Let the user override the test. -else -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - case $as_dir in #((( - '') as_dir=./ ;; - */) ;; - *) as_dir=$as_dir/ ;; - esac - for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then - ac_cv_prog_CC="${ac_tool_prefix}clang" - printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 - break 2 - fi -done - done -IFS=$as_save_IFS - -fi -fi -CC=$ac_cv_prog_CC -if test -n "$CC"; then - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 -printf "%s\n" "$CC" >&6; } -else - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 -printf "%s\n" "no" >&6; } -fi - - -fi -if test -z "$ac_cv_prog_CC"; then - ac_ct_CC=$CC - # Extract the first word of "clang", so it can be a program name with args. -set dummy clang; ac_word=$2 -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -printf %s "checking for $ac_word... " >&6; } -if test ${ac_cv_prog_ac_ct_CC+y} -then : - printf %s "(cached) " >&6 -else $as_nop - if test -n "$ac_ct_CC"; then - ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test. -else -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - case $as_dir in #((( - '') as_dir=./ ;; - */) ;; - *) as_dir=$as_dir/ ;; - esac - for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then - ac_cv_prog_ac_ct_CC="clang" - printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 - break 2 - fi -done - done -IFS=$as_save_IFS - -fi -fi -ac_ct_CC=$ac_cv_prog_ac_ct_CC -if test -n "$ac_ct_CC"; then - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CC" >&5 -printf "%s\n" "$ac_ct_CC" >&6; } -else - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 -printf "%s\n" "no" >&6; } -fi - - if test "x$ac_ct_CC" = x; then - CC="" - else - case $cross_compiling:$ac_tool_warned in -yes:) -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 -printf "%s\n" "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} -ac_tool_warned=yes ;; -esac - CC=$ac_ct_CC - fi -else - CC="$ac_cv_prog_CC" -fi - -fi - - -test -z "$CC" && { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 -printf "%s\n" "$as_me: error: in \`$ac_pwd':" >&2;} -as_fn_error $? "no acceptable C compiler found in \$PATH -See \`config.log' for more details" "$LINENO" 5; } - -# Provide some information about the compiler. -printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for C compiler version" >&5 -set X $ac_compile -ac_compiler=$2 -for ac_option in --version -v -V -qversion -version; do - { { ac_try="$ac_compiler $ac_option >&5" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" -printf "%s\n" "$ac_try_echo"; } >&5 - (eval "$ac_compiler $ac_option >&5") 2>conftest.err - ac_status=$? - if test -s conftest.err; then - sed '10a\ -... rest of stderr output deleted ... - 10q' conftest.err >conftest.er1 - cat conftest.er1 >&5 - fi - rm -f conftest.er1 conftest.err - printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 - test $ac_status = 0; } -done - -cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - -int -main (void) -{ - - ; - return 0; -} -_ACEOF -ac_clean_files_save=$ac_clean_files -ac_clean_files="$ac_clean_files a.out a.out.dSYM a.exe b.out" -# Try to create an executable without -o first, disregard a.out. -# It will help us diagnose broken compilers, and finding out an intuition -# of exeext. -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether the C compiler works" >&5 -printf %s "checking whether the C compiler works... " >&6; } -ac_link_default=`printf "%s\n" "$ac_link" | sed 's/ -o *conftest[^ ]*//'` - -# The possible output files: -ac_files="a.out conftest.exe conftest a.exe a_out.exe b.out conftest.*" - -ac_rmfiles= -for ac_file in $ac_files -do - case $ac_file in - *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM | *.o | *.obj ) ;; - * ) ac_rmfiles="$ac_rmfiles $ac_file";; - esac -done -rm -f $ac_rmfiles - -if { { ac_try="$ac_link_default" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" -printf "%s\n" "$ac_try_echo"; } >&5 - (eval "$ac_link_default") 2>&5 - ac_status=$? - printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 - test $ac_status = 0; } -then : - # Autoconf-2.13 could set the ac_cv_exeext variable to `no'. -# So ignore a value of `no', otherwise this would lead to `EXEEXT = no' -# in a Makefile. We should not override ac_cv_exeext if it was cached, -# so that the user can short-circuit this test for compilers unknown to -# Autoconf. -for ac_file in $ac_files '' -do - test -f "$ac_file" || continue - case $ac_file in - *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM | *.o | *.obj ) - ;; - [ab].out ) - # We found the default executable, but exeext='' is most - # certainly right. - break;; - *.* ) - if test ${ac_cv_exeext+y} && test "$ac_cv_exeext" != no; - then :; else - ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'` - fi - # We set ac_cv_exeext here because the later test for it is not - # safe: cross compilers may not add the suffix if given an `-o' - # argument, so we may need to know it at that point already. - # Even if this section looks crufty: it has the advantage of - # actually working. - break;; - * ) - break;; - esac -done -test "$ac_cv_exeext" = no && ac_cv_exeext= - -else $as_nop - ac_file='' -fi -if test -z "$ac_file" -then : - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 -printf "%s\n" "no" >&6; } -printf "%s\n" "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - -{ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 -printf "%s\n" "$as_me: error: in \`$ac_pwd':" >&2;} -as_fn_error 77 "C compiler cannot create executables -See \`config.log' for more details" "$LINENO" 5; } -else $as_nop - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -printf "%s\n" "yes" >&6; } -fi -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for C compiler default output file name" >&5 -printf %s "checking for C compiler default output file name... " >&6; } -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_file" >&5 -printf "%s\n" "$ac_file" >&6; } -ac_exeext=$ac_cv_exeext - -rm -f -r a.out a.out.dSYM a.exe conftest$ac_cv_exeext b.out -ac_clean_files=$ac_clean_files_save -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for suffix of executables" >&5 -printf %s "checking for suffix of executables... " >&6; } -if { { ac_try="$ac_link" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" -printf "%s\n" "$ac_try_echo"; } >&5 - (eval "$ac_link") 2>&5 - ac_status=$? - printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 - test $ac_status = 0; } -then : - # If both `conftest.exe' and `conftest' are `present' (well, observable) -# catch `conftest.exe'. For instance with Cygwin, `ls conftest' will -# work properly (i.e., refer to `conftest.exe'), while it won't with -# `rm'. -for ac_file in conftest.exe conftest conftest.*; do - test -f "$ac_file" || continue - case $ac_file in - *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM | *.o | *.obj ) ;; - *.* ) ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'` - break;; - * ) break;; - esac -done -else $as_nop - { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 -printf "%s\n" "$as_me: error: in \`$ac_pwd':" >&2;} -as_fn_error $? "cannot compute suffix of executables: cannot compile and link -See \`config.log' for more details" "$LINENO" 5; } -fi -rm -f conftest conftest$ac_cv_exeext -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_exeext" >&5 -printf "%s\n" "$ac_cv_exeext" >&6; } - -rm -f conftest.$ac_ext -EXEEXT=$ac_cv_exeext -ac_exeext=$EXEEXT -cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -#include -int -main (void) -{ -FILE *f = fopen ("conftest.out", "w"); - return ferror (f) || fclose (f) != 0; - - ; - return 0; -} -_ACEOF -ac_clean_files="$ac_clean_files conftest.out" -# Check that the compiler produces executables we can run. If not, either -# the compiler is broken, or we cross compile. -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether we are cross compiling" >&5 -printf %s "checking whether we are cross compiling... " >&6; } -if test "$cross_compiling" != yes; then - { { ac_try="$ac_link" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" -printf "%s\n" "$ac_try_echo"; } >&5 - (eval "$ac_link") 2>&5 - ac_status=$? - printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 - test $ac_status = 0; } - if { ac_try='./conftest$ac_cv_exeext' - { { case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" -printf "%s\n" "$ac_try_echo"; } >&5 - (eval "$ac_try") 2>&5 - ac_status=$? - printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 - test $ac_status = 0; }; }; then - cross_compiling=no - else - if test "$cross_compiling" = maybe; then - cross_compiling=yes - else - { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 -printf "%s\n" "$as_me: error: in \`$ac_pwd':" >&2;} -as_fn_error 77 "cannot run C compiled programs. -If you meant to cross compile, use \`--host'. -See \`config.log' for more details" "$LINENO" 5; } - fi - fi -fi -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $cross_compiling" >&5 -printf "%s\n" "$cross_compiling" >&6; } - -rm -f conftest.$ac_ext conftest$ac_cv_exeext conftest.out -ac_clean_files=$ac_clean_files_save -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for suffix of object files" >&5 -printf %s "checking for suffix of object files... " >&6; } -if test ${ac_cv_objext+y} -then : - printf %s "(cached) " >&6 -else $as_nop - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - -int -main (void) -{ - - ; - return 0; -} -_ACEOF -rm -f conftest.o conftest.obj -if { { ac_try="$ac_compile" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" -printf "%s\n" "$ac_try_echo"; } >&5 - (eval "$ac_compile") 2>&5 - ac_status=$? - printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 - test $ac_status = 0; } -then : - for ac_file in conftest.o conftest.obj conftest.*; do - test -f "$ac_file" || continue; - case $ac_file in - *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM ) ;; - *) ac_cv_objext=`expr "$ac_file" : '.*\.\(.*\)'` - break;; - esac -done -else $as_nop - printf "%s\n" "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - -{ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 -printf "%s\n" "$as_me: error: in \`$ac_pwd':" >&2;} -as_fn_error $? "cannot compute suffix of object files: cannot compile -See \`config.log' for more details" "$LINENO" 5; } -fi -rm -f conftest.$ac_cv_objext conftest.$ac_ext -fi -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_objext" >&5 -printf "%s\n" "$ac_cv_objext" >&6; } -OBJEXT=$ac_cv_objext -ac_objext=$OBJEXT -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether the compiler supports GNU C" >&5 -printf %s "checking whether the compiler supports GNU C... " >&6; } -if test ${ac_cv_c_compiler_gnu+y} -then : - printf %s "(cached) " >&6 -else $as_nop - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - -int -main (void) -{ -#ifndef __GNUC__ - choke me -#endif - - ; - return 0; -} -_ACEOF -if ac_fn_c_try_compile "$LINENO" -then : - ac_compiler_gnu=yes -else $as_nop - ac_compiler_gnu=no -fi -rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext -ac_cv_c_compiler_gnu=$ac_compiler_gnu - -fi -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_compiler_gnu" >&5 -printf "%s\n" "$ac_cv_c_compiler_gnu" >&6; } -ac_compiler_gnu=$ac_cv_c_compiler_gnu - -if test $ac_compiler_gnu = yes; then - GCC=yes -else - GCC= -fi -ac_test_CFLAGS=${CFLAGS+y} -ac_save_CFLAGS=$CFLAGS -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether $CC accepts -g" >&5 -printf %s "checking whether $CC accepts -g... " >&6; } -if test ${ac_cv_prog_cc_g+y} -then : - printf %s "(cached) " >&6 -else $as_nop - ac_save_c_werror_flag=$ac_c_werror_flag - ac_c_werror_flag=yes - ac_cv_prog_cc_g=no - CFLAGS="-g" - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - -int -main (void) -{ - - ; - return 0; -} -_ACEOF -if ac_fn_c_try_compile "$LINENO" -then : - ac_cv_prog_cc_g=yes -else $as_nop - CFLAGS="" - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - -int -main (void) -{ - - ; - return 0; -} -_ACEOF -if ac_fn_c_try_compile "$LINENO" -then : - -else $as_nop - ac_c_werror_flag=$ac_save_c_werror_flag - CFLAGS="-g" - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - -int -main (void) -{ - - ; - return 0; -} -_ACEOF -if ac_fn_c_try_compile "$LINENO" -then : - ac_cv_prog_cc_g=yes -fi -rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext -fi -rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext -fi -rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext - ac_c_werror_flag=$ac_save_c_werror_flag -fi -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_g" >&5 -printf "%s\n" "$ac_cv_prog_cc_g" >&6; } -if test $ac_test_CFLAGS; then - CFLAGS=$ac_save_CFLAGS -elif test $ac_cv_prog_cc_g = yes; then - if test "$GCC" = yes; then - CFLAGS="-g -O2" - else - CFLAGS="-g" - fi -else - if test "$GCC" = yes; then - CFLAGS="-O2" - else - CFLAGS= - fi -fi -ac_prog_cc_stdc=no -if test x$ac_prog_cc_stdc = xno -then : - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $CC option to enable C11 features" >&5 -printf %s "checking for $CC option to enable C11 features... " >&6; } -if test ${ac_cv_prog_cc_c11+y} -then : - printf %s "(cached) " >&6 -else $as_nop - ac_cv_prog_cc_c11=no -ac_save_CC=$CC -cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -$ac_c_conftest_c11_program -_ACEOF -for ac_arg in '' -std=gnu11 -do - CC="$ac_save_CC $ac_arg" - if ac_fn_c_try_compile "$LINENO" -then : - ac_cv_prog_cc_c11=$ac_arg -fi -rm -f core conftest.err conftest.$ac_objext conftest.beam - test "x$ac_cv_prog_cc_c11" != "xno" && break -done -rm -f conftest.$ac_ext -CC=$ac_save_CC -fi - -if test "x$ac_cv_prog_cc_c11" = xno -then : - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: unsupported" >&5 -printf "%s\n" "unsupported" >&6; } -else $as_nop - if test "x$ac_cv_prog_cc_c11" = x -then : - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: none needed" >&5 -printf "%s\n" "none needed" >&6; } -else $as_nop - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_c11" >&5 -printf "%s\n" "$ac_cv_prog_cc_c11" >&6; } - CC="$CC $ac_cv_prog_cc_c11" -fi - ac_cv_prog_cc_stdc=$ac_cv_prog_cc_c11 - ac_prog_cc_stdc=c11 -fi -fi -if test x$ac_prog_cc_stdc = xno -then : - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $CC option to enable C99 features" >&5 -printf %s "checking for $CC option to enable C99 features... " >&6; } -if test ${ac_cv_prog_cc_c99+y} -then : - printf %s "(cached) " >&6 -else $as_nop - ac_cv_prog_cc_c99=no -ac_save_CC=$CC -cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -$ac_c_conftest_c99_program -_ACEOF -for ac_arg in '' -std=gnu99 -std=c99 -c99 -qlanglvl=extc1x -qlanglvl=extc99 -AC99 -D_STDC_C99= -do - CC="$ac_save_CC $ac_arg" - if ac_fn_c_try_compile "$LINENO" -then : - ac_cv_prog_cc_c99=$ac_arg -fi -rm -f core conftest.err conftest.$ac_objext conftest.beam - test "x$ac_cv_prog_cc_c99" != "xno" && break -done -rm -f conftest.$ac_ext -CC=$ac_save_CC -fi - -if test "x$ac_cv_prog_cc_c99" = xno -then : - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: unsupported" >&5 -printf "%s\n" "unsupported" >&6; } -else $as_nop - if test "x$ac_cv_prog_cc_c99" = x -then : - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: none needed" >&5 -printf "%s\n" "none needed" >&6; } -else $as_nop - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_c99" >&5 -printf "%s\n" "$ac_cv_prog_cc_c99" >&6; } - CC="$CC $ac_cv_prog_cc_c99" -fi - ac_cv_prog_cc_stdc=$ac_cv_prog_cc_c99 - ac_prog_cc_stdc=c99 -fi -fi -if test x$ac_prog_cc_stdc = xno -then : - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $CC option to enable C89 features" >&5 -printf %s "checking for $CC option to enable C89 features... " >&6; } -if test ${ac_cv_prog_cc_c89+y} -then : - printf %s "(cached) " >&6 -else $as_nop - ac_cv_prog_cc_c89=no -ac_save_CC=$CC -cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -$ac_c_conftest_c89_program -_ACEOF -for ac_arg in '' -qlanglvl=extc89 -qlanglvl=ansi -std -Ae "-Aa -D_HPUX_SOURCE" "-Xc -D__EXTENSIONS__" -do - CC="$ac_save_CC $ac_arg" - if ac_fn_c_try_compile "$LINENO" -then : - ac_cv_prog_cc_c89=$ac_arg -fi -rm -f core conftest.err conftest.$ac_objext conftest.beam - test "x$ac_cv_prog_cc_c89" != "xno" && break -done -rm -f conftest.$ac_ext -CC=$ac_save_CC -fi - -if test "x$ac_cv_prog_cc_c89" = xno -then : - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: unsupported" >&5 -printf "%s\n" "unsupported" >&6; } -else $as_nop - if test "x$ac_cv_prog_cc_c89" = x -then : - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: none needed" >&5 -printf "%s\n" "none needed" >&6; } -else $as_nop - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_c89" >&5 -printf "%s\n" "$ac_cv_prog_cc_c89" >&6; } - CC="$CC $ac_cv_prog_cc_c89" -fi - ac_cv_prog_cc_stdc=$ac_cv_prog_cc_c89 - ac_prog_cc_stdc=c89 -fi -fi - -ac_ext=c -ac_cpp='$CPP $CPPFLAGS' -ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' -ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' -ac_compiler_gnu=$ac_cv_c_compiler_gnu - - - ac_ext=c -ac_cpp='$CPP $CPPFLAGS' -ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' -ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' -ac_compiler_gnu=$ac_cv_c_compiler_gnu -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether $CC understands -c and -o together" >&5 -printf %s "checking whether $CC understands -c and -o together... " >&6; } -if test ${am_cv_prog_cc_c_o+y} -then : - printf %s "(cached) " >&6 -else $as_nop - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - -int -main (void) -{ - - ; - return 0; -} -_ACEOF - # Make sure it works both with $CC and with simple cc. - # Following AC_PROG_CC_C_O, we do the test twice because some - # compilers refuse to overwrite an existing .o file with -o, - # though they will create one. - am_cv_prog_cc_c_o=yes - for am_i in 1 2; do - if { echo "$as_me:$LINENO: $CC -c conftest.$ac_ext -o conftest2.$ac_objext" >&5 - ($CC -c conftest.$ac_ext -o conftest2.$ac_objext) >&5 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } \ - && test -f conftest2.$ac_objext; then - : OK - else - am_cv_prog_cc_c_o=no - break - fi - done - rm -f core conftest* - unset am_i -fi -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $am_cv_prog_cc_c_o" >&5 -printf "%s\n" "$am_cv_prog_cc_c_o" >&6; } -if test "$am_cv_prog_cc_c_o" != yes; then - # Losing compiler, so override with the script. - # FIXME: It is wrong to rewrite CC. - # But if we don't then we get into trouble of one sort or another. - # A longer-term fix would be to have automake use am__CC in this case, - # and then we could set am__CC="\$(top_srcdir)/compile \$(CC)" - CC="$am_aux_dir/compile $CC" -fi -ac_ext=c -ac_cpp='$CPP $CPPFLAGS' -ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' -ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' -ac_compiler_gnu=$ac_cv_c_compiler_gnu - -DEPDIR="${am__leading_dot}deps" - -ac_config_commands="$ac_config_commands depfiles" - -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether ${MAKE-make} supports the include directive" >&5 -printf %s "checking whether ${MAKE-make} supports the include directive... " >&6; } -cat > confinc.mk << 'END' -am__doit: - @echo this is the am__doit target >confinc.out -.PHONY: am__doit -END -am__include="#" -am__quote= -# BSD make does it like this. -echo '.include "confinc.mk" # ignored' > confmf.BSD -# Other make implementations (GNU, Solaris 10, AIX) do it like this. -echo 'include confinc.mk # ignored' > confmf.GNU -_am_result=no -for s in GNU BSD; do - { echo "$as_me:$LINENO: ${MAKE-make} -f confmf.$s && cat confinc.out" >&5 - (${MAKE-make} -f confmf.$s && cat confinc.out) >&5 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } - case $?:`cat confinc.out 2>/dev/null` in #( - '0:this is the am__doit target') : - case $s in #( - BSD) : - am__include='.include' am__quote='"' ;; #( - *) : - am__include='include' am__quote='' ;; -esac ;; #( - *) : - ;; -esac - if test "$am__include" != "#"; then - _am_result="yes ($s style)" - break - fi -done -rm -f confinc.* confmf.* -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: ${_am_result}" >&5 -printf "%s\n" "${_am_result}" >&6; } - -# Check whether --enable-dependency-tracking was given. -if test ${enable_dependency_tracking+y} -then : - enableval=$enable_dependency_tracking; -fi - -if test "x$enable_dependency_tracking" != xno; then - am_depcomp="$ac_aux_dir/depcomp" - AMDEPBACKSLASH='\' - am__nodep='_no' -fi - if test "x$enable_dependency_tracking" != xno; then - AMDEP_TRUE= - AMDEP_FALSE='#' -else - AMDEP_TRUE='#' - AMDEP_FALSE= -fi - - - -depcc="$CC" am_compiler_list= - -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking dependency style of $depcc" >&5 -printf %s "checking dependency style of $depcc... " >&6; } -if test ${am_cv_CC_dependencies_compiler_type+y} -then : - printf %s "(cached) " >&6 -else $as_nop - if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then - # We make a subdir and do the tests there. Otherwise we can end up - # making bogus files that we don't know about and never remove. For - # instance it was reported that on HP-UX the gcc test will end up - # making a dummy file named 'D' -- because '-MD' means "put the output - # in D". - rm -rf conftest.dir - mkdir conftest.dir - # Copy depcomp to subdir because otherwise we won't find it if we're - # using a relative directory. - cp "$am_depcomp" conftest.dir - cd conftest.dir - # We will build objects and dependencies in a subdirectory because - # it helps to detect inapplicable dependency modes. For instance - # both Tru64's cc and ICC support -MD to output dependencies as a - # side effect of compilation, but ICC will put the dependencies in - # the current directory while Tru64 will put them in the object - # directory. - mkdir sub - - am_cv_CC_dependencies_compiler_type=none - if test "$am_compiler_list" = ""; then - am_compiler_list=`sed -n 's/^#*\([a-zA-Z0-9]*\))$/\1/p' < ./depcomp` - fi - am__universal=false - case " $depcc " in #( - *\ -arch\ *\ -arch\ *) am__universal=true ;; - esac - - for depmode in $am_compiler_list; do - # Setup a source with many dependencies, because some compilers - # like to wrap large dependency lists on column 80 (with \), and - # we should not choose a depcomp mode which is confused by this. - # - # We need to recreate these files for each test, as the compiler may - # overwrite some of them when testing with obscure command lines. - # This happens at least with the AIX C compiler. - : > sub/conftest.c - for i in 1 2 3 4 5 6; do - echo '#include "conftst'$i'.h"' >> sub/conftest.c - # Using ": > sub/conftst$i.h" creates only sub/conftst1.h with - # Solaris 10 /bin/sh. - echo '/* dummy */' > sub/conftst$i.h - done - echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf - - # We check with '-c' and '-o' for the sake of the "dashmstdout" - # mode. It turns out that the SunPro C++ compiler does not properly - # handle '-M -o', and we need to detect this. Also, some Intel - # versions had trouble with output in subdirs. - am__obj=sub/conftest.${OBJEXT-o} - am__minus_obj="-o $am__obj" - case $depmode in - gcc) - # This depmode causes a compiler race in universal mode. - test "$am__universal" = false || continue - ;; - nosideeffect) - # After this tag, mechanisms are not by side-effect, so they'll - # only be used when explicitly requested. - if test "x$enable_dependency_tracking" = xyes; then - continue - else - break - fi - ;; - msvc7 | msvc7msys | msvisualcpp | msvcmsys) - # This compiler won't grok '-c -o', but also, the minuso test has - # not run yet. These depmodes are late enough in the game, and - # so weak that their functioning should not be impacted. - am__obj=conftest.${OBJEXT-o} - am__minus_obj= - ;; - none) break ;; - esac - if depmode=$depmode \ - source=sub/conftest.c object=$am__obj \ - depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \ - $SHELL ./depcomp $depcc -c $am__minus_obj sub/conftest.c \ - >/dev/null 2>conftest.err && - grep sub/conftst1.h sub/conftest.Po > /dev/null 2>&1 && - grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 && - grep $am__obj sub/conftest.Po > /dev/null 2>&1 && - ${MAKE-make} -s -f confmf > /dev/null 2>&1; then - # icc doesn't choke on unknown options, it will just issue warnings - # or remarks (even with -Werror). So we grep stderr for any message - # that says an option was ignored or not supported. - # When given -MP, icc 7.0 and 7.1 complain thusly: - # icc: Command line warning: ignoring option '-M'; no argument required - # The diagnosis changed in icc 8.0: - # icc: Command line remark: option '-MP' not supported - if (grep 'ignoring option' conftest.err || - grep 'not supported' conftest.err) >/dev/null 2>&1; then :; else - am_cv_CC_dependencies_compiler_type=$depmode - break - fi - fi - done - - cd .. - rm -rf conftest.dir -else - am_cv_CC_dependencies_compiler_type=none -fi - -fi -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $am_cv_CC_dependencies_compiler_type" >&5 -printf "%s\n" "$am_cv_CC_dependencies_compiler_type" >&6; } -CCDEPMODE=depmode=$am_cv_CC_dependencies_compiler_type - - if - test "x$enable_dependency_tracking" != xno \ - && test "$am_cv_CC_dependencies_compiler_type" = gcc3; then - am__fastdepCC_TRUE= - am__fastdepCC_FALSE='#' -else - am__fastdepCC_TRUE='#' - am__fastdepCC_FALSE= -fi - - - - - - - - -ac_ext=cpp -ac_cpp='$CXXCPP $CPPFLAGS' -ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' -ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' -ac_compiler_gnu=$ac_cv_cxx_compiler_gnu -if test -z "$CXX"; then - if test -n "$CCC"; then - CXX=$CCC - else - if test -n "$ac_tool_prefix"; then - for ac_prog in g++ c++ gpp aCC CC cxx cc++ cl.exe FCC KCC RCC xlC_r xlC clang++ - do - # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args. -set dummy $ac_tool_prefix$ac_prog; ac_word=$2 -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -printf %s "checking for $ac_word... " >&6; } -if test ${ac_cv_prog_CXX+y} -then : - printf %s "(cached) " >&6 -else $as_nop - if test -n "$CXX"; then - ac_cv_prog_CXX="$CXX" # Let the user override the test. -else -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - case $as_dir in #((( - '') as_dir=./ ;; - */) ;; - *) as_dir=$as_dir/ ;; - esac - for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then - ac_cv_prog_CXX="$ac_tool_prefix$ac_prog" - printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 - break 2 - fi -done - done -IFS=$as_save_IFS - -fi -fi -CXX=$ac_cv_prog_CXX -if test -n "$CXX"; then - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $CXX" >&5 -printf "%s\n" "$CXX" >&6; } -else - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 -printf "%s\n" "no" >&6; } -fi - - - test -n "$CXX" && break - done -fi -if test -z "$CXX"; then - ac_ct_CXX=$CXX - for ac_prog in g++ c++ gpp aCC CC cxx cc++ cl.exe FCC KCC RCC xlC_r xlC clang++ -do - # Extract the first word of "$ac_prog", so it can be a program name with args. -set dummy $ac_prog; ac_word=$2 -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -printf %s "checking for $ac_word... " >&6; } -if test ${ac_cv_prog_ac_ct_CXX+y} -then : - printf %s "(cached) " >&6 -else $as_nop - if test -n "$ac_ct_CXX"; then - ac_cv_prog_ac_ct_CXX="$ac_ct_CXX" # Let the user override the test. -else -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - case $as_dir in #((( - '') as_dir=./ ;; - */) ;; - *) as_dir=$as_dir/ ;; - esac - for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then - ac_cv_prog_ac_ct_CXX="$ac_prog" - printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 - break 2 - fi -done - done -IFS=$as_save_IFS - -fi -fi -ac_ct_CXX=$ac_cv_prog_ac_ct_CXX -if test -n "$ac_ct_CXX"; then - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CXX" >&5 -printf "%s\n" "$ac_ct_CXX" >&6; } -else - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 -printf "%s\n" "no" >&6; } -fi - - - test -n "$ac_ct_CXX" && break -done - - if test "x$ac_ct_CXX" = x; then - CXX="g++" - else - case $cross_compiling:$ac_tool_warned in -yes:) -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 -printf "%s\n" "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} -ac_tool_warned=yes ;; -esac - CXX=$ac_ct_CXX - fi -fi - - fi -fi -# Provide some information about the compiler. -printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for C++ compiler version" >&5 -set X $ac_compile -ac_compiler=$2 -for ac_option in --version -v -V -qversion; do - { { ac_try="$ac_compiler $ac_option >&5" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" -printf "%s\n" "$ac_try_echo"; } >&5 - (eval "$ac_compiler $ac_option >&5") 2>conftest.err - ac_status=$? - if test -s conftest.err; then - sed '10a\ -... rest of stderr output deleted ... - 10q' conftest.err >conftest.er1 - cat conftest.er1 >&5 - fi - rm -f conftest.er1 conftest.err - printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 - test $ac_status = 0; } -done - -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether the compiler supports GNU C++" >&5 -printf %s "checking whether the compiler supports GNU C++... " >&6; } -if test ${ac_cv_cxx_compiler_gnu+y} -then : - printf %s "(cached) " >&6 -else $as_nop - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - -int -main (void) -{ -#ifndef __GNUC__ - choke me -#endif - - ; - return 0; -} -_ACEOF -if ac_fn_cxx_try_compile "$LINENO" -then : - ac_compiler_gnu=yes -else $as_nop - ac_compiler_gnu=no -fi -rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext -ac_cv_cxx_compiler_gnu=$ac_compiler_gnu - -fi -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_cxx_compiler_gnu" >&5 -printf "%s\n" "$ac_cv_cxx_compiler_gnu" >&6; } -ac_compiler_gnu=$ac_cv_cxx_compiler_gnu - -if test $ac_compiler_gnu = yes; then - GXX=yes -else - GXX= -fi -ac_test_CXXFLAGS=${CXXFLAGS+y} -ac_save_CXXFLAGS=$CXXFLAGS -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether $CXX accepts -g" >&5 -printf %s "checking whether $CXX accepts -g... " >&6; } -if test ${ac_cv_prog_cxx_g+y} -then : - printf %s "(cached) " >&6 -else $as_nop - ac_save_cxx_werror_flag=$ac_cxx_werror_flag - ac_cxx_werror_flag=yes - ac_cv_prog_cxx_g=no - CXXFLAGS="-g" - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - -int -main (void) -{ - - ; - return 0; -} -_ACEOF -if ac_fn_cxx_try_compile "$LINENO" -then : - ac_cv_prog_cxx_g=yes -else $as_nop - CXXFLAGS="" - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - -int -main (void) -{ - - ; - return 0; -} -_ACEOF -if ac_fn_cxx_try_compile "$LINENO" -then : - -else $as_nop - ac_cxx_werror_flag=$ac_save_cxx_werror_flag - CXXFLAGS="-g" - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - -int -main (void) -{ - - ; - return 0; -} -_ACEOF -if ac_fn_cxx_try_compile "$LINENO" -then : - ac_cv_prog_cxx_g=yes -fi -rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext -fi -rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext -fi -rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext - ac_cxx_werror_flag=$ac_save_cxx_werror_flag -fi -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cxx_g" >&5 -printf "%s\n" "$ac_cv_prog_cxx_g" >&6; } -if test $ac_test_CXXFLAGS; then - CXXFLAGS=$ac_save_CXXFLAGS -elif test $ac_cv_prog_cxx_g = yes; then - if test "$GXX" = yes; then - CXXFLAGS="-g -O2" - else - CXXFLAGS="-g" - fi -else - if test "$GXX" = yes; then - CXXFLAGS="-O2" - else - CXXFLAGS= - fi -fi -ac_prog_cxx_stdcxx=no -if test x$ac_prog_cxx_stdcxx = xno -then : - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $CXX option to enable C++11 features" >&5 -printf %s "checking for $CXX option to enable C++11 features... " >&6; } -if test ${ac_cv_prog_cxx_11+y} -then : - printf %s "(cached) " >&6 -else $as_nop - ac_cv_prog_cxx_11=no -ac_save_CXX=$CXX -cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -$ac_cxx_conftest_cxx11_program -_ACEOF -for ac_arg in '' -std=gnu++11 -std=gnu++0x -std=c++11 -std=c++0x -qlanglvl=extended0x -AA -do - CXX="$ac_save_CXX $ac_arg" - if ac_fn_cxx_try_compile "$LINENO" -then : - ac_cv_prog_cxx_cxx11=$ac_arg -fi -rm -f core conftest.err conftest.$ac_objext conftest.beam - test "x$ac_cv_prog_cxx_cxx11" != "xno" && break -done -rm -f conftest.$ac_ext -CXX=$ac_save_CXX -fi - -if test "x$ac_cv_prog_cxx_cxx11" = xno -then : - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: unsupported" >&5 -printf "%s\n" "unsupported" >&6; } -else $as_nop - if test "x$ac_cv_prog_cxx_cxx11" = x -then : - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: none needed" >&5 -printf "%s\n" "none needed" >&6; } -else $as_nop - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cxx_cxx11" >&5 -printf "%s\n" "$ac_cv_prog_cxx_cxx11" >&6; } - CXX="$CXX $ac_cv_prog_cxx_cxx11" -fi - ac_cv_prog_cxx_stdcxx=$ac_cv_prog_cxx_cxx11 - ac_prog_cxx_stdcxx=cxx11 -fi -fi -if test x$ac_prog_cxx_stdcxx = xno -then : - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $CXX option to enable C++98 features" >&5 -printf %s "checking for $CXX option to enable C++98 features... " >&6; } -if test ${ac_cv_prog_cxx_98+y} -then : - printf %s "(cached) " >&6 -else $as_nop - ac_cv_prog_cxx_98=no -ac_save_CXX=$CXX -cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -$ac_cxx_conftest_cxx98_program -_ACEOF -for ac_arg in '' -std=gnu++98 -std=c++98 -qlanglvl=extended -AA -do - CXX="$ac_save_CXX $ac_arg" - if ac_fn_cxx_try_compile "$LINENO" -then : - ac_cv_prog_cxx_cxx98=$ac_arg -fi -rm -f core conftest.err conftest.$ac_objext conftest.beam - test "x$ac_cv_prog_cxx_cxx98" != "xno" && break -done -rm -f conftest.$ac_ext -CXX=$ac_save_CXX -fi - -if test "x$ac_cv_prog_cxx_cxx98" = xno -then : - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: unsupported" >&5 -printf "%s\n" "unsupported" >&6; } -else $as_nop - if test "x$ac_cv_prog_cxx_cxx98" = x -then : - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: none needed" >&5 -printf "%s\n" "none needed" >&6; } -else $as_nop - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cxx_cxx98" >&5 -printf "%s\n" "$ac_cv_prog_cxx_cxx98" >&6; } - CXX="$CXX $ac_cv_prog_cxx_cxx98" -fi - ac_cv_prog_cxx_stdcxx=$ac_cv_prog_cxx_cxx98 - ac_prog_cxx_stdcxx=cxx98 -fi -fi - -ac_ext=c -ac_cpp='$CPP $CPPFLAGS' -ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' -ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' -ac_compiler_gnu=$ac_cv_c_compiler_gnu - -depcc="$CXX" am_compiler_list= - -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking dependency style of $depcc" >&5 -printf %s "checking dependency style of $depcc... " >&6; } -if test ${am_cv_CXX_dependencies_compiler_type+y} -then : - printf %s "(cached) " >&6 -else $as_nop - if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then - # We make a subdir and do the tests there. Otherwise we can end up - # making bogus files that we don't know about and never remove. For - # instance it was reported that on HP-UX the gcc test will end up - # making a dummy file named 'D' -- because '-MD' means "put the output - # in D". - rm -rf conftest.dir - mkdir conftest.dir - # Copy depcomp to subdir because otherwise we won't find it if we're - # using a relative directory. - cp "$am_depcomp" conftest.dir - cd conftest.dir - # We will build objects and dependencies in a subdirectory because - # it helps to detect inapplicable dependency modes. For instance - # both Tru64's cc and ICC support -MD to output dependencies as a - # side effect of compilation, but ICC will put the dependencies in - # the current directory while Tru64 will put them in the object - # directory. - mkdir sub - - am_cv_CXX_dependencies_compiler_type=none - if test "$am_compiler_list" = ""; then - am_compiler_list=`sed -n 's/^#*\([a-zA-Z0-9]*\))$/\1/p' < ./depcomp` - fi - am__universal=false - case " $depcc " in #( - *\ -arch\ *\ -arch\ *) am__universal=true ;; - esac - - for depmode in $am_compiler_list; do - # Setup a source with many dependencies, because some compilers - # like to wrap large dependency lists on column 80 (with \), and - # we should not choose a depcomp mode which is confused by this. - # - # We need to recreate these files for each test, as the compiler may - # overwrite some of them when testing with obscure command lines. - # This happens at least with the AIX C compiler. - : > sub/conftest.c - for i in 1 2 3 4 5 6; do - echo '#include "conftst'$i'.h"' >> sub/conftest.c - # Using ": > sub/conftst$i.h" creates only sub/conftst1.h with - # Solaris 10 /bin/sh. - echo '/* dummy */' > sub/conftst$i.h - done - echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf - - # We check with '-c' and '-o' for the sake of the "dashmstdout" - # mode. It turns out that the SunPro C++ compiler does not properly - # handle '-M -o', and we need to detect this. Also, some Intel - # versions had trouble with output in subdirs. - am__obj=sub/conftest.${OBJEXT-o} - am__minus_obj="-o $am__obj" - case $depmode in - gcc) - # This depmode causes a compiler race in universal mode. - test "$am__universal" = false || continue - ;; - nosideeffect) - # After this tag, mechanisms are not by side-effect, so they'll - # only be used when explicitly requested. - if test "x$enable_dependency_tracking" = xyes; then - continue - else - break - fi - ;; - msvc7 | msvc7msys | msvisualcpp | msvcmsys) - # This compiler won't grok '-c -o', but also, the minuso test has - # not run yet. These depmodes are late enough in the game, and - # so weak that their functioning should not be impacted. - am__obj=conftest.${OBJEXT-o} - am__minus_obj= - ;; - none) break ;; - esac - if depmode=$depmode \ - source=sub/conftest.c object=$am__obj \ - depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \ - $SHELL ./depcomp $depcc -c $am__minus_obj sub/conftest.c \ - >/dev/null 2>conftest.err && - grep sub/conftst1.h sub/conftest.Po > /dev/null 2>&1 && - grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 && - grep $am__obj sub/conftest.Po > /dev/null 2>&1 && - ${MAKE-make} -s -f confmf > /dev/null 2>&1; then - # icc doesn't choke on unknown options, it will just issue warnings - # or remarks (even with -Werror). So we grep stderr for any message - # that says an option was ignored or not supported. - # When given -MP, icc 7.0 and 7.1 complain thusly: - # icc: Command line warning: ignoring option '-M'; no argument required - # The diagnosis changed in icc 8.0: - # icc: Command line remark: option '-MP' not supported - if (grep 'ignoring option' conftest.err || - grep 'not supported' conftest.err) >/dev/null 2>&1; then :; else - am_cv_CXX_dependencies_compiler_type=$depmode - break - fi - fi - done - - cd .. - rm -rf conftest.dir -else - am_cv_CXX_dependencies_compiler_type=none -fi - -fi -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $am_cv_CXX_dependencies_compiler_type" >&5 -printf "%s\n" "$am_cv_CXX_dependencies_compiler_type" >&6; } -CXXDEPMODE=depmode=$am_cv_CXX_dependencies_compiler_type - - if - test "x$enable_dependency_tracking" != xno \ - && test "$am_cv_CXX_dependencies_compiler_type" = gcc3; then - am__fastdepCXX_TRUE= - am__fastdepCXX_FALSE='#' -else - am__fastdepCXX_TRUE='#' - am__fastdepCXX_FALSE= -fi - - -ac_ext=c -ac_cpp='$CPP $CPPFLAGS' -ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' -ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' -ac_compiler_gnu=$ac_cv_c_compiler_gnu -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking how to run the C preprocessor" >&5 -printf %s "checking how to run the C preprocessor... " >&6; } -# On Suns, sometimes $CPP names a directory. -if test -n "$CPP" && test -d "$CPP"; then - CPP= -fi -if test -z "$CPP"; then - if test ${ac_cv_prog_CPP+y} -then : - printf %s "(cached) " >&6 -else $as_nop - # Double quotes because $CC needs to be expanded - for CPP in "$CC -E" "$CC -E -traditional-cpp" cpp /lib/cpp - do - ac_preproc_ok=false -for ac_c_preproc_warn_flag in '' yes -do - # Use a header file that comes with gcc, so configuring glibc - # with a fresh cross-compiler works. - # On the NeXT, cc -E runs the code through the compiler's parser, - # not just through cpp. "Syntax error" is here to catch this case. - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -#include - Syntax error -_ACEOF -if ac_fn_c_try_cpp "$LINENO" -then : - -else $as_nop - # Broken: fails on valid input. -continue -fi -rm -f conftest.err conftest.i conftest.$ac_ext - - # OK, works on sane cases. Now check whether nonexistent headers - # can be detected and how. - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -#include -_ACEOF -if ac_fn_c_try_cpp "$LINENO" -then : - # Broken: success on invalid input. -continue -else $as_nop - # Passes both tests. -ac_preproc_ok=: -break -fi -rm -f conftest.err conftest.i conftest.$ac_ext - -done -# Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped. -rm -f conftest.i conftest.err conftest.$ac_ext -if $ac_preproc_ok -then : - break -fi - - done - ac_cv_prog_CPP=$CPP - -fi - CPP=$ac_cv_prog_CPP -else - ac_cv_prog_CPP=$CPP -fi -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $CPP" >&5 -printf "%s\n" "$CPP" >&6; } -ac_preproc_ok=false -for ac_c_preproc_warn_flag in '' yes -do - # Use a header file that comes with gcc, so configuring glibc - # with a fresh cross-compiler works. - # On the NeXT, cc -E runs the code through the compiler's parser, - # not just through cpp. "Syntax error" is here to catch this case. - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -#include - Syntax error -_ACEOF -if ac_fn_c_try_cpp "$LINENO" -then : - -else $as_nop - # Broken: fails on valid input. -continue -fi -rm -f conftest.err conftest.i conftest.$ac_ext - - # OK, works on sane cases. Now check whether nonexistent headers - # can be detected and how. - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -#include -_ACEOF -if ac_fn_c_try_cpp "$LINENO" -then : - # Broken: success on invalid input. -continue -else $as_nop - # Passes both tests. -ac_preproc_ok=: -break -fi -rm -f conftest.err conftest.i conftest.$ac_ext - -done -# Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped. -rm -f conftest.i conftest.err conftest.$ac_ext -if $ac_preproc_ok -then : - -else $as_nop - { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 -printf "%s\n" "$as_me: error: in \`$ac_pwd':" >&2;} -as_fn_error $? "C preprocessor \"$CPP\" fails sanity check -See \`config.log' for more details" "$LINENO" 5; } -fi - -ac_ext=c -ac_cpp='$CPP $CPPFLAGS' -ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' -ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' -ac_compiler_gnu=$ac_cv_c_compiler_gnu - - - - -save_cross_compiling=$cross_compiling -save_ac_tool_prefix=$ac_tool_prefix -cross_compiling=no -ac_tool_prefix= - -ac_ext=c -ac_build_cpp='$CPP_FOR_BUILD $CPPFLAGS_FOR_BUILD' -ac_build_compile='$CC_FOR_BUILD -c $CFLAGS_FOR_BUILD $CPPFLAGS_FOR_BUILD conftest.$ac_ext >&5' -ac_build_link='$CC_FOR_BUILD -o conftest$ac_build_exeext $CFLAGS_FOR_BUILD $CPPFLAGS_FOR_BUILD $LDFLAGS_FOR_BUILD conftest.$ac_ext $LIBS >&5' -ac_compiler_gnu=$ac_cv_c_compiler_gnu -if test -n "$ac_tool_prefix"; then - # Extract the first word of "${ac_tool_prefix}gcc", so it can be a program name with args. -set dummy ${ac_tool_prefix}gcc; ac_word=$2 -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -printf %s "checking for $ac_word... " >&6; } -if test ${ac_cv_prog_CC_FOR_BUILD+y} -then : - printf %s "(cached) " >&6 -else $as_nop - if test -n "$CC_FOR_BUILD"; then - ac_cv_prog_CC_FOR_BUILD="$CC_FOR_BUILD" # Let the user override the test. -else -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - case $as_dir in #((( - '') as_dir=./ ;; - */) ;; - *) as_dir=$as_dir/ ;; - esac - for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then - ac_cv_prog_CC_FOR_BUILD="${ac_tool_prefix}gcc" - printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 - break 2 - fi -done - done -IFS=$as_save_IFS - -fi -fi -CC_FOR_BUILD=$ac_cv_prog_CC_FOR_BUILD -if test -n "$CC_FOR_BUILD"; then - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $CC_FOR_BUILD" >&5 -printf "%s\n" "$CC_FOR_BUILD" >&6; } -else - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 -printf "%s\n" "no" >&6; } -fi - - -fi -if test -z "$ac_cv_prog_CC_FOR_BUILD"; then - ac_ct_CC_FOR_BUILD=$CC_FOR_BUILD - # Extract the first word of "gcc", so it can be a program name with args. -set dummy gcc; ac_word=$2 -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -printf %s "checking for $ac_word... " >&6; } -if test ${ac_cv_prog_ac_ct_CC_FOR_BUILD+y} -then : - printf %s "(cached) " >&6 -else $as_nop - if test -n "$ac_ct_CC_FOR_BUILD"; then - ac_cv_prog_ac_ct_CC_FOR_BUILD="$ac_ct_CC_FOR_BUILD" # Let the user override the test. -else -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - case $as_dir in #((( - '') as_dir=./ ;; - */) ;; - *) as_dir=$as_dir/ ;; - esac - for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then - ac_cv_prog_ac_ct_CC_FOR_BUILD="gcc" - printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 - break 2 - fi -done - done -IFS=$as_save_IFS - -fi -fi -ac_ct_CC_FOR_BUILD=$ac_cv_prog_ac_ct_CC_FOR_BUILD -if test -n "$ac_ct_CC_FOR_BUILD"; then - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CC_FOR_BUILD" >&5 -printf "%s\n" "$ac_ct_CC_FOR_BUILD" >&6; } -else - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 -printf "%s\n" "no" >&6; } -fi - - if test "x$ac_ct_CC_FOR_BUILD" = x; then - CC_FOR_BUILD="" - else - case $cross_compiling:$ac_tool_warned in -yes:) -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with build triplet" >&5 -printf "%s\n" "$as_me: WARNING: using cross tools not prefixed with build triplet" >&2;} -ac_tool_warned=yes ;; -esac - CC_FOR_BUILD=$ac_ct_CC_FOR_BUILD - fi -else - CC_FOR_BUILD="$ac_cv_prog_CC_FOR_BUILD" -fi - -if test -z "$CC_FOR_BUILD"; then - if test -n "$ac_tool_prefix"; then - # Extract the first word of "${ac_tool_prefix}cc", so it can be a program name with args. -set dummy ${ac_tool_prefix}cc; ac_word=$2 -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -printf %s "checking for $ac_word... " >&6; } -if test ${ac_cv_prog_CC_FOR_BUILD+y} -then : - printf %s "(cached) " >&6 -else $as_nop - if test -n "$CC_FOR_BUILD"; then - ac_cv_prog_CC_FOR_BUILD="$CC_FOR_BUILD" # Let the user override the test. -else -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - case $as_dir in #((( - '') as_dir=./ ;; - */) ;; - *) as_dir=$as_dir/ ;; - esac - for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then - ac_cv_prog_CC_FOR_BUILD="${ac_tool_prefix}cc" - printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 - break 2 - fi -done - done -IFS=$as_save_IFS - -fi -fi -CC_FOR_BUILD=$ac_cv_prog_CC_FOR_BUILD -if test -n "$CC_FOR_BUILD"; then - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $CC_FOR_BUILD" >&5 -printf "%s\n" "$CC_FOR_BUILD" >&6; } -else - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 -printf "%s\n" "no" >&6; } -fi - - - fi -fi -if test -z "$CC_FOR_BUILD"; then - # Extract the first word of "cc", so it can be a program name with args. -set dummy cc; ac_word=$2 -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -printf %s "checking for $ac_word... " >&6; } -if test ${ac_cv_prog_CC_FOR_BUILD+y} -then : - printf %s "(cached) " >&6 -else $as_nop - if test -n "$CC_FOR_BUILD"; then - ac_cv_prog_CC_FOR_BUILD="$CC_FOR_BUILD" # Let the user override the test. -else - ac_prog_rejected=no -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - case $as_dir in #((( - '') as_dir=./ ;; - */) ;; - *) as_dir=$as_dir/ ;; - esac - for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then - if test "$as_dir$ac_word$ac_exec_ext" = "/usr/ucb/cc"; then - ac_prog_rejected=yes - continue - fi - ac_cv_prog_CC_FOR_BUILD="cc" - printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 - break 2 - fi -done - done -IFS=$as_save_IFS - -if test $ac_prog_rejected = yes; then - # We found a bogon in the path, so make sure we never use it. - set dummy $ac_cv_prog_CC_FOR_BUILD - shift - if test $# != 0; then - # We chose a different compiler from the bogus one. - # However, it has the same basename, so the bogon will be chosen - # first if we set CC_FOR_BUILD to just the basename; use the full file name. - shift - ac_cv_prog_CC_FOR_BUILD="$as_dir$ac_word${1+' '}$@" - fi -fi -fi -fi -CC_FOR_BUILD=$ac_cv_prog_CC_FOR_BUILD -if test -n "$CC_FOR_BUILD"; then - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $CC_FOR_BUILD" >&5 -printf "%s\n" "$CC_FOR_BUILD" >&6; } -else - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 -printf "%s\n" "no" >&6; } -fi - - -fi -if test -z "$CC_FOR_BUILD"; then - if test -n "$ac_tool_prefix"; then - for ac_prog in cl.exe - do - # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args. -set dummy $ac_tool_prefix$ac_prog; ac_word=$2 -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -printf %s "checking for $ac_word... " >&6; } -if test ${ac_cv_prog_CC_FOR_BUILD+y} -then : - printf %s "(cached) " >&6 -else $as_nop - if test -n "$CC_FOR_BUILD"; then - ac_cv_prog_CC_FOR_BUILD="$CC_FOR_BUILD" # Let the user override the test. -else -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - case $as_dir in #((( - '') as_dir=./ ;; - */) ;; - *) as_dir=$as_dir/ ;; - esac - for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then - ac_cv_prog_CC_FOR_BUILD="$ac_tool_prefix$ac_prog" - printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 - break 2 - fi -done - done -IFS=$as_save_IFS - -fi -fi -CC_FOR_BUILD=$ac_cv_prog_CC_FOR_BUILD -if test -n "$CC_FOR_BUILD"; then - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $CC_FOR_BUILD" >&5 -printf "%s\n" "$CC_FOR_BUILD" >&6; } -else - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 -printf "%s\n" "no" >&6; } -fi - - - test -n "$CC_FOR_BUILD" && break - done -fi -if test -z "$CC_FOR_BUILD"; then - ac_ct_CC_FOR_BUILD=$CC_FOR_BUILD - for ac_prog in cl.exe -do - # Extract the first word of "$ac_prog", so it can be a program name with args. -set dummy $ac_prog; ac_word=$2 -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -printf %s "checking for $ac_word... " >&6; } -if test ${ac_cv_prog_ac_ct_CC_FOR_BUILD+y} -then : - printf %s "(cached) " >&6 -else $as_nop - if test -n "$ac_ct_CC_FOR_BUILD"; then - ac_cv_prog_ac_ct_CC_FOR_BUILD="$ac_ct_CC_FOR_BUILD" # Let the user override the test. -else -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - case $as_dir in #((( - '') as_dir=./ ;; - */) ;; - *) as_dir=$as_dir/ ;; - esac - for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then - ac_cv_prog_ac_ct_CC_FOR_BUILD="$ac_prog" - printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 - break 2 - fi -done - done -IFS=$as_save_IFS - -fi -fi -ac_ct_CC_FOR_BUILD=$ac_cv_prog_ac_ct_CC_FOR_BUILD -if test -n "$ac_ct_CC_FOR_BUILD"; then - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CC_FOR_BUILD" >&5 -printf "%s\n" "$ac_ct_CC_FOR_BUILD" >&6; } -else - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 -printf "%s\n" "no" >&6; } -fi - - - test -n "$ac_ct_CC_FOR_BUILD" && break -done - - if test "x$ac_ct_CC_FOR_BUILD" = x; then - CC_FOR_BUILD="" - else - case $cross_compiling:$ac_tool_warned in -yes:) -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with build triplet" >&5 -printf "%s\n" "$as_me: WARNING: using cross tools not prefixed with build triplet" >&2;} -ac_tool_warned=yes ;; -esac - CC_FOR_BUILD=$ac_ct_CC_FOR_BUILD - fi -fi - -fi -if test -z "$CC_FOR_BUILD"; then - if test -n "$ac_tool_prefix"; then - # Extract the first word of "${ac_tool_prefix}clang", so it can be a program name with args. -set dummy ${ac_tool_prefix}clang; ac_word=$2 -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -printf %s "checking for $ac_word... " >&6; } -if test ${ac_cv_prog_CC_FOR_BUILD+y} -then : - printf %s "(cached) " >&6 -else $as_nop - if test -n "$CC_FOR_BUILD"; then - ac_cv_prog_CC_FOR_BUILD="$CC_FOR_BUILD" # Let the user override the test. -else -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - case $as_dir in #((( - '') as_dir=./ ;; - */) ;; - *) as_dir=$as_dir/ ;; - esac - for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then - ac_cv_prog_CC_FOR_BUILD="${ac_tool_prefix}clang" - printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 - break 2 - fi -done - done -IFS=$as_save_IFS - -fi -fi -CC_FOR_BUILD=$ac_cv_prog_CC_FOR_BUILD -if test -n "$CC_FOR_BUILD"; then - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $CC_FOR_BUILD" >&5 -printf "%s\n" "$CC_FOR_BUILD" >&6; } -else - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 -printf "%s\n" "no" >&6; } -fi - - -fi -if test -z "$ac_cv_prog_CC_FOR_BUILD"; then - ac_ct_CC_FOR_BUILD=$CC_FOR_BUILD - # Extract the first word of "clang", so it can be a program name with args. -set dummy clang; ac_word=$2 -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -printf %s "checking for $ac_word... " >&6; } -if test ${ac_cv_prog_ac_ct_CC_FOR_BUILD+y} -then : - printf %s "(cached) " >&6 -else $as_nop - if test -n "$ac_ct_CC_FOR_BUILD"; then - ac_cv_prog_ac_ct_CC_FOR_BUILD="$ac_ct_CC_FOR_BUILD" # Let the user override the test. -else -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - case $as_dir in #((( - '') as_dir=./ ;; - */) ;; - *) as_dir=$as_dir/ ;; - esac - for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then - ac_cv_prog_ac_ct_CC_FOR_BUILD="clang" - printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 - break 2 - fi -done - done -IFS=$as_save_IFS - -fi -fi -ac_ct_CC_FOR_BUILD=$ac_cv_prog_ac_ct_CC_FOR_BUILD -if test -n "$ac_ct_CC_FOR_BUILD"; then - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CC_FOR_BUILD" >&5 -printf "%s\n" "$ac_ct_CC_FOR_BUILD" >&6; } -else - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 -printf "%s\n" "no" >&6; } -fi - - if test "x$ac_ct_CC_FOR_BUILD" = x; then - CC_FOR_BUILD="" - else - case $cross_compiling:$ac_tool_warned in -yes:) -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with build triplet" >&5 -printf "%s\n" "$as_me: WARNING: using cross tools not prefixed with build triplet" >&2;} -ac_tool_warned=yes ;; -esac - CC_FOR_BUILD=$ac_ct_CC_FOR_BUILD - fi -else - CC_FOR_BUILD="$ac_cv_prog_CC_FOR_BUILD" -fi - -fi - - -test -z "$CC_FOR_BUILD" && { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 -printf "%s\n" "$as_me: error: in \`$ac_pwd':" >&2;} -as_fn_error $? "no acceptable C compiler found in \$PATH -See \`config.log' for more details" "$LINENO" 5; } - -# Provide some information about the compiler. -printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for C compiler version" >&5 -set X $ac_build_compile -ac_compiler=$2 -for ac_option in --version -v -V -qversion -version; do - { { ac_try="$ac_compiler $ac_option >&5" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" -printf "%s\n" "$ac_try_echo"; } >&5 - (eval "$ac_compiler $ac_option >&5") 2>conftest.err - ac_status=$? - if test -s conftest.err; then - sed '10a\ -... rest of stderr output deleted ... - 10q' conftest.err >conftest.er1 - cat conftest.er1 >&5 - fi - rm -f conftest.er1 conftest.err - printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 - test $ac_status = 0; } -done - -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether the compiler supports GNU C" >&5 -printf %s "checking whether the compiler supports GNU C... " >&6; } -if test ${ac_cv_c_compiler_gnu+y} -then : - printf %s "(cached) " >&6 -else $as_nop - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - -int -main (void) -{ -#ifndef __GNUC__ - choke me -#endif - - ; - return 0; -} -_ACEOF -if ac_fn_c_try_compile "$LINENO" -then : - ac_compiler_gnu=yes -else $as_nop - ac_compiler_gnu=no -fi -rm -f core conftest.err conftest.$ac_build_objext conftest.beam conftest.$ac_ext -ac_cv_c_compiler_gnu=$ac_compiler_gnu - -fi -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_compiler_gnu" >&5 -printf "%s\n" "$ac_cv_c_compiler_gnu" >&6; } -ac_compiler_gnu=$ac_cv_c_compiler_gnu - -if test $ac_compiler_gnu = yes; then - GCC=yes -else - GCC= -fi -ac_test_CFLAGS=${CFLAGS_FOR_BUILD+y} -ac_save_CFLAGS=$CFLAGS_FOR_BUILD -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether $CC_FOR_BUILD accepts -g" >&5 -printf %s "checking whether $CC_FOR_BUILD accepts -g... " >&6; } -if test ${ac_cv_build_prog_cc_g+y} -then : - printf %s "(cached) " >&6 -else $as_nop - ac_save_c_werror_flag=$ac_c_werror_flag - ac_c_werror_flag=yes - ac_cv_build_prog_cc_g=no - CFLAGS_FOR_BUILD="-g" - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - -int -main (void) -{ - - ; - return 0; -} -_ACEOF -if ac_fn_c_try_compile "$LINENO" -then : - ac_cv_build_prog_cc_g=yes -else $as_nop - CFLAGS_FOR_BUILD="" - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - -int -main (void) -{ - - ; - return 0; -} -_ACEOF -if ac_fn_c_try_compile "$LINENO" -then : - -else $as_nop - ac_c_werror_flag=$ac_save_c_werror_flag - CFLAGS_FOR_BUILD="-g" - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - -int -main (void) -{ - - ; - return 0; -} -_ACEOF -if ac_fn_c_try_compile "$LINENO" -then : - ac_cv_build_prog_cc_g=yes -fi -rm -f core conftest.err conftest.$ac_build_objext conftest.beam conftest.$ac_ext -fi -rm -f core conftest.err conftest.$ac_build_objext conftest.beam conftest.$ac_ext -fi -rm -f core conftest.err conftest.$ac_build_objext conftest.beam conftest.$ac_ext - ac_c_werror_flag=$ac_save_c_werror_flag -fi -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_build_prog_cc_g" >&5 -printf "%s\n" "$ac_cv_build_prog_cc_g" >&6; } -if test $ac_test_CFLAGS; then - CFLAGS_FOR_BUILD=$ac_save_CFLAGS -elif test $ac_cv_build_prog_cc_g = yes; then - if test "$GCC" = yes; then - CFLAGS_FOR_BUILD="-g -O2" - else - CFLAGS_FOR_BUILD="-g" - fi -else - if test "$GCC" = yes; then - CFLAGS_FOR_BUILD="-O2" - else - CFLAGS_FOR_BUILD= - fi -fi -ac_prog_cc_stdc=no -if test x$ac_prog_cc_stdc = xno -then : - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $CC_FOR_BUILD option to enable C11 features" >&5 -printf %s "checking for $CC_FOR_BUILD option to enable C11 features... " >&6; } -if test ${ac_cv_prog_cc_c11+y} -then : - printf %s "(cached) " >&6 -else $as_nop - ac_cv_prog_cc_c11=no -ac_save_CC=$CC_FOR_BUILD -cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -$ac_c_conftest_c11_program -_ACEOF -for ac_arg in '' -std=gnu11 -do - CC_FOR_BUILD="$ac_save_CC $ac_arg" - if ac_fn_c_try_compile "$LINENO" -then : - ac_cv_prog_cc_c11=$ac_arg -fi -rm -f core conftest.err conftest.$ac_build_objext conftest.beam - test "x$ac_cv_prog_cc_c11" != "xno" && break -done -rm -f conftest.$ac_ext -CC_FOR_BUILD=$ac_save_CC -fi - -if test "x$ac_cv_prog_cc_c11" = xno -then : - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: unsupported" >&5 -printf "%s\n" "unsupported" >&6; } -else $as_nop - if test "x$ac_cv_prog_cc_c11" = x -then : - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: none needed" >&5 -printf "%s\n" "none needed" >&6; } -else $as_nop - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_c11" >&5 -printf "%s\n" "$ac_cv_prog_cc_c11" >&6; } - CC_FOR_BUILD="$CC_FOR_BUILD $ac_cv_prog_cc_c11" -fi - ac_cv_prog_cc_stdc=$ac_cv_prog_cc_c11 - ac_prog_cc_stdc=c11 -fi -fi -if test x$ac_prog_cc_stdc = xno -then : - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $CC_FOR_BUILD option to enable C99 features" >&5 -printf %s "checking for $CC_FOR_BUILD option to enable C99 features... " >&6; } -if test ${ac_cv_prog_cc_c99+y} -then : - printf %s "(cached) " >&6 -else $as_nop - ac_cv_prog_cc_c99=no -ac_save_CC=$CC_FOR_BUILD -cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -$ac_c_conftest_c99_program -_ACEOF -for ac_arg in '' -std=gnu99 -std=c99 -c99 -qlanglvl=extc1x -qlanglvl=extc99 -AC99 -D_STDC_C99= -do - CC_FOR_BUILD="$ac_save_CC $ac_arg" - if ac_fn_c_try_compile "$LINENO" -then : - ac_cv_prog_cc_c99=$ac_arg -fi -rm -f core conftest.err conftest.$ac_build_objext conftest.beam - test "x$ac_cv_prog_cc_c99" != "xno" && break -done -rm -f conftest.$ac_ext -CC_FOR_BUILD=$ac_save_CC -fi - -if test "x$ac_cv_prog_cc_c99" = xno -then : - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: unsupported" >&5 -printf "%s\n" "unsupported" >&6; } -else $as_nop - if test "x$ac_cv_prog_cc_c99" = x -then : - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: none needed" >&5 -printf "%s\n" "none needed" >&6; } -else $as_nop - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_c99" >&5 -printf "%s\n" "$ac_cv_prog_cc_c99" >&6; } - CC_FOR_BUILD="$CC_FOR_BUILD $ac_cv_prog_cc_c99" -fi - ac_cv_prog_cc_stdc=$ac_cv_prog_cc_c99 - ac_prog_cc_stdc=c99 -fi -fi -if test x$ac_prog_cc_stdc = xno -then : - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $CC_FOR_BUILD option to enable C89 features" >&5 -printf %s "checking for $CC_FOR_BUILD option to enable C89 features... " >&6; } -if test ${ac_cv_prog_cc_c89+y} -then : - printf %s "(cached) " >&6 -else $as_nop - ac_cv_prog_cc_c89=no -ac_save_CC=$CC_FOR_BUILD -cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -$ac_c_conftest_c89_program -_ACEOF -for ac_arg in '' -qlanglvl=extc89 -qlanglvl=ansi -std -Ae "-Aa -D_HPUX_SOURCE" "-Xc -D__EXTENSIONS__" -do - CC_FOR_BUILD="$ac_save_CC $ac_arg" - if ac_fn_c_try_compile "$LINENO" -then : - ac_cv_prog_cc_c89=$ac_arg -fi -rm -f core conftest.err conftest.$ac_build_objext conftest.beam - test "x$ac_cv_prog_cc_c89" != "xno" && break -done -rm -f conftest.$ac_ext -CC_FOR_BUILD=$ac_save_CC -fi - -if test "x$ac_cv_prog_cc_c89" = xno -then : - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: unsupported" >&5 -printf "%s\n" "unsupported" >&6; } -else $as_nop - if test "x$ac_cv_prog_cc_c89" = x -then : - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: none needed" >&5 -printf "%s\n" "none needed" >&6; } -else $as_nop - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_c89" >&5 -printf "%s\n" "$ac_cv_prog_cc_c89" >&6; } - CC_FOR_BUILD="$CC_FOR_BUILD $ac_cv_prog_cc_c89" -fi - ac_cv_prog_cc_stdc=$ac_cv_prog_cc_c89 - ac_prog_cc_stdc=c89 -fi -fi - -ac_ext=c -ac_build_cpp='$CPP_FOR_BUILD $CPPFLAGS_FOR_BUILD' -ac_build_compile='$CC_FOR_BUILD -c $CFLAGS_FOR_BUILD $CPPFLAGS_FOR_BUILD conftest.$ac_ext >&5' -ac_build_link='$CC_FOR_BUILD -o conftest$ac_build_exeext $CFLAGS_FOR_BUILD $CPPFLAGS_FOR_BUILD $LDFLAGS_FOR_BUILD conftest.$ac_ext $LIBS >&5' -ac_compiler_gnu=$ac_cv_c_compiler_gnu - - - ac_ext=c -ac_build_cpp='$CPP_FOR_BUILD $CPPFLAGS_FOR_BUILD' -ac_build_compile='$CC_FOR_BUILD -c $CFLAGS_FOR_BUILD $CPPFLAGS_FOR_BUILD conftest.$ac_ext >&5' -ac_build_link='$CC_FOR_BUILD -o conftest$ac_build_exeext $CFLAGS_FOR_BUILD $CPPFLAGS_FOR_BUILD $LDFLAGS_FOR_BUILD conftest.$ac_ext $LIBS >&5' -ac_compiler_gnu=$ac_cv_c_compiler_gnu -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether $CC_FOR_BUILD understands -c and -o together" >&5 -printf %s "checking whether $CC_FOR_BUILD understands -c and -o together... " >&6; } -if test ${am_cv_prog_cc_c_o+y} -then : - printf %s "(cached) " >&6 -else $as_nop - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - -int -main (void) -{ - - ; - return 0; -} -_ACEOF - # Make sure it works both with $CC and with simple cc. - # Following AC_PROG_CC_C_O, we do the test twice because some - # compilers refuse to overwrite an existing .o file with -o, - # though they will create one. - am_cv_prog_cc_c_o=yes - for am_i in 1 2; do - if { echo "$as_me:$LINENO: $CC_FOR_BUILD -c conftest.$ac_ext -o conftest2.$ac_build_objext" >&5 - ($CC_FOR_BUILD -c conftest.$ac_ext -o conftest2.$ac_build_objext) >&5 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } \ - && test -f conftest2.$ac_build_objext; then - : OK - else - am_cv_prog_cc_c_o=no - break - fi - done - rm -f core conftest* - unset am_i -fi -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $am_cv_prog_cc_c_o" >&5 -printf "%s\n" "$am_cv_prog_cc_c_o" >&6; } -if test "$am_cv_prog_cc_c_o" != yes; then - # Losing compiler, so override with the script. - # FIXME: It is wrong to rewrite CC. - # But if we don't then we get into trouble of one sort or another. - # A longer-term fix would be to have automake use am__CC in this case, - # and then we could set am__CC="\$(top_srcdir)/compile \$(CC)" - CC_FOR_BUILD="$am_aux_dir/compile $CC_FOR_BUILD" -fi -ac_ext=c -ac_build_cpp='$CPP_FOR_BUILD $CPPFLAGS_FOR_BUILD' -ac_build_compile='$CC_FOR_BUILD -c $CFLAGS_FOR_BUILD $CPPFLAGS_FOR_BUILD conftest.$ac_ext >&5' -ac_build_link='$CC_FOR_BUILD -o conftest$ac_build_exeext $CFLAGS_FOR_BUILD $CPPFLAGS_FOR_BUILD $LDFLAGS_FOR_BUILD conftest.$ac_ext $LIBS >&5' -ac_compiler_gnu=$ac_cv_c_compiler_gnu - - -depcc="$CC_FOR_BUILD" am_compiler_list= - -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking dependency style of $depcc" >&5 -printf %s "checking dependency style of $depcc... " >&6; } -if test ${am_cv_CC_dependencies_compiler_type+y} -then : - printf %s "(cached) " >&6 -else $as_nop - if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then - # We make a subdir and do the tests there. Otherwise we can end up - # making bogus files that we don't know about and never remove. For - # instance it was reported that on HP-UX the gcc test will end up - # making a dummy file named 'D' -- because '-MD' means "put the output - # in D". - rm -rf conftest.dir - mkdir conftest.dir - # Copy depcomp to subdir because otherwise we won't find it if we're - # using a relative directory. - cp "$am_depcomp" conftest.dir - cd conftest.dir - # We will build objects and dependencies in a subdirectory because - # it helps to detect inapplicable dependency modes. For instance - # both Tru64's cc and ICC support -MD to output dependencies as a - # side effect of compilation, but ICC will put the dependencies in - # the current directory while Tru64 will put them in the object - # directory. - mkdir sub - - am_cv_CC_dependencies_compiler_type=none - if test "$am_compiler_list" = ""; then - am_compiler_list=`sed -n 's/^#*\([a-zA-Z0-9]*\))$/\1/p' < ./depcomp` - fi - am__universal=false - case " $depcc " in #( - *\ -arch\ *\ -arch\ *) am__universal=true ;; - esac - - for depmode in $am_compiler_list; do - # Setup a source with many dependencies, because some compilers - # like to wrap large dependency lists on column 80 (with \), and - # we should not choose a depcomp mode which is confused by this. - # - # We need to recreate these files for each test, as the compiler may - # overwrite some of them when testing with obscure command lines. - # This happens at least with the AIX C compiler. - : > sub/conftest.c - for i in 1 2 3 4 5 6; do - echo '#include "conftst'$i'.h"' >> sub/conftest.c - # Using ": > sub/conftst$i.h" creates only sub/conftst1.h with - # Solaris 10 /bin/sh. - echo '/* dummy */' > sub/conftst$i.h - done - echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf - - # We check with '-c' and '-o' for the sake of the "dashmstdout" - # mode. It turns out that the SunPro C++ compiler does not properly - # handle '-M -o', and we need to detect this. Also, some Intel - # versions had trouble with output in subdirs. - am__obj=sub/conftest.${OBJEXT-o} - am__minus_obj="-o $am__obj" - case $depmode in - gcc) - # This depmode causes a compiler race in universal mode. - test "$am__universal" = false || continue - ;; - nosideeffect) - # After this tag, mechanisms are not by side-effect, so they'll - # only be used when explicitly requested. - if test "x$enable_dependency_tracking" = xyes; then - continue - else - break - fi - ;; - msvc7 | msvc7msys | msvisualcpp | msvcmsys) - # This compiler won't grok '-c -o', but also, the minuso test has - # not run yet. These depmodes are late enough in the game, and - # so weak that their functioning should not be impacted. - am__obj=conftest.${OBJEXT-o} - am__minus_obj= - ;; - none) break ;; - esac - if depmode=$depmode \ - source=sub/conftest.c object=$am__obj \ - depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \ - $SHELL ./depcomp $depcc -c $am__minus_obj sub/conftest.c \ - >/dev/null 2>conftest.err && - grep sub/conftst1.h sub/conftest.Po > /dev/null 2>&1 && - grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 && - grep $am__obj sub/conftest.Po > /dev/null 2>&1 && - ${MAKE-make} -s -f confmf > /dev/null 2>&1; then - # icc doesn't choke on unknown options, it will just issue warnings - # or remarks (even with -Werror). So we grep stderr for any message - # that says an option was ignored or not supported. - # When given -MP, icc 7.0 and 7.1 complain thusly: - # icc: Command line warning: ignoring option '-M'; no argument required - # The diagnosis changed in icc 8.0: - # icc: Command line remark: option '-MP' not supported - if (grep 'ignoring option' conftest.err || - grep 'not supported' conftest.err) >/dev/null 2>&1; then :; else - am_cv_CC_dependencies_compiler_type=$depmode - break - fi - fi - done - - cd .. - rm -rf conftest.dir -else - am_cv_CC_dependencies_compiler_type=none -fi - -fi -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $am_cv_CC_dependencies_compiler_type" >&5 -printf "%s\n" "$am_cv_CC_dependencies_compiler_type" >&6; } -CCDEPMODE=depmode=$am_cv_CC_dependencies_compiler_type - - if - test "x$enable_dependency_tracking" != xno \ - && test "$am_cv_CC_dependencies_compiler_type" = gcc3; then - am__fastdepCC_TRUE= - am__fastdepCC_FALSE='#' -else - am__fastdepCC_TRUE='#' - am__fastdepCC_FALSE= -fi - - -ac_ext=c -ac_build_cpp='$CPP_FOR_BUILD $CPPFLAGS_FOR_BUILD' -ac_build_compile='$CC_FOR_BUILD -c $CFLAGS_FOR_BUILD $CPPFLAGS_FOR_BUILD conftest.$ac_ext >&5' -ac_build_link='$CC_FOR_BUILD -o conftest$ac_build_exeext $CFLAGS_FOR_BUILD $CPPFLAGS_FOR_BUILD $LDFLAGS_FOR_BUILD conftest.$ac_ext $LIBS >&5' -ac_compiler_gnu=$ac_cv_c_compiler_gnu -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking how to run the C preprocessor" >&5 -printf %s "checking how to run the C preprocessor... " >&6; } -# On Suns, sometimes $CPP names a directory. -if test -n "$CPP_FOR_BUILD" && test -d "$CPP_FOR_BUILD"; then - CPP_FOR_BUILD= -fi -if test -z "$CPP_FOR_BUILD"; then - if test ${ac_cv_build_prog_CPP+y} -then : - printf %s "(cached) " >&6 -else $as_nop - # Double quotes because $CC needs to be expanded - for CPP_FOR_BUILD in "$CC_FOR_BUILD -E" "$CC_FOR_BUILD -E -traditional-cpp" cpp /lib/cpp - do - ac_preproc_ok=false -for ac_c_preproc_warn_flag in '' yes -do - # Use a header file that comes with gcc, so configuring glibc - # with a fresh cross-compiler works. - # On the NeXT, cc -E runs the code through the compiler's parser, - # not just through cpp. "Syntax error" is here to catch this case. - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -#include - Syntax error -_ACEOF -if ac_fn_c_try_cpp "$LINENO" -then : - -else $as_nop - # Broken: fails on valid input. -continue -fi -rm -f conftest.err conftest.i conftest.$ac_ext - - # OK, works on sane cases. Now check whether nonexistent headers - # can be detected and how. - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -#include -_ACEOF -if ac_fn_c_try_cpp "$LINENO" -then : - # Broken: success on invalid input. -continue -else $as_nop - # Passes both tests. -ac_preproc_ok=: -break -fi -rm -f conftest.err conftest.i conftest.$ac_ext - -done -# Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped. -rm -f conftest.i conftest.err conftest.$ac_ext -if $ac_preproc_ok -then : - break -fi - - done - ac_cv_build_prog_CPP=$CPP_FOR_BUILD - -fi - CPP_FOR_BUILD=$ac_cv_build_prog_CPP -else - ac_cv_build_prog_CPP=$CPP_FOR_BUILD -fi -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $CPP_FOR_BUILD" >&5 -printf "%s\n" "$CPP_FOR_BUILD" >&6; } -ac_preproc_ok=false -for ac_c_preproc_warn_flag in '' yes -do - # Use a header file that comes with gcc, so configuring glibc - # with a fresh cross-compiler works. - # On the NeXT, cc -E runs the code through the compiler's parser, - # not just through cpp. "Syntax error" is here to catch this case. - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -#include - Syntax error -_ACEOF -if ac_fn_c_try_cpp "$LINENO" -then : - -else $as_nop - # Broken: fails on valid input. -continue -fi -rm -f conftest.err conftest.i conftest.$ac_ext - - # OK, works on sane cases. Now check whether nonexistent headers - # can be detected and how. - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -#include -_ACEOF -if ac_fn_c_try_cpp "$LINENO" -then : - # Broken: success on invalid input. -continue -else $as_nop - # Passes both tests. -ac_preproc_ok=: -break -fi -rm -f conftest.err conftest.i conftest.$ac_ext - -done -# Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped. -rm -f conftest.i conftest.err conftest.$ac_ext -if $ac_preproc_ok -then : - -else $as_nop - { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 -printf "%s\n" "$as_me: error: in \`$ac_pwd':" >&2;} -as_fn_error $? "C preprocessor \"$CPP_FOR_BUILD\" fails sanity check -See \`config.log' for more details" "$LINENO" 5; } -fi - -ac_ext=c -ac_build_cpp='$CPP_FOR_BUILD $CPPFLAGS_FOR_BUILD' -ac_build_compile='$CC_FOR_BUILD -c $CFLAGS_FOR_BUILD $CPPFLAGS_FOR_BUILD conftest.$ac_ext >&5' -ac_build_link='$CC_FOR_BUILD -o conftest$ac_build_exeext $CFLAGS_FOR_BUILD $CPPFLAGS_FOR_BUILD $LDFLAGS_FOR_BUILD conftest.$ac_ext $LIBS >&5' -ac_compiler_gnu=$ac_cv_c_compiler_gnu - - - -ac_tool_prefix=$save_ac_tool_prefix -cross_compiling=$save_cross_compiling - - -BUILD_EXEEXT=$ac_build_exeext -BUILD_OBJEXT=$ac_build_objext - -ac_ext=cpp -ac_cpp='$CXXCPP $CPPFLAGS' -ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' -ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' -ac_compiler_gnu=$ac_cv_cxx_compiler_gnu -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking how to run the C++ preprocessor" >&5 -printf %s "checking how to run the C++ preprocessor... " >&6; } -if test -z "$CXXCPP"; then - if test ${ac_cv_prog_CXXCPP+y} -then : - printf %s "(cached) " >&6 -else $as_nop - # Double quotes because $CXX needs to be expanded - for CXXCPP in "$CXX -E" cpp /lib/cpp - do - ac_preproc_ok=false -for ac_cxx_preproc_warn_flag in '' yes -do - # Use a header file that comes with gcc, so configuring glibc - # with a fresh cross-compiler works. - # On the NeXT, cc -E runs the code through the compiler's parser, - # not just through cpp. "Syntax error" is here to catch this case. - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -#include - Syntax error -_ACEOF -if ac_fn_cxx_try_cpp "$LINENO" -then : - -else $as_nop - # Broken: fails on valid input. -continue -fi -rm -f conftest.err conftest.i conftest.$ac_ext - - # OK, works on sane cases. Now check whether nonexistent headers - # can be detected and how. - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -#include -_ACEOF -if ac_fn_cxx_try_cpp "$LINENO" -then : - # Broken: success on invalid input. -continue -else $as_nop - # Passes both tests. -ac_preproc_ok=: -break -fi -rm -f conftest.err conftest.i conftest.$ac_ext - -done -# Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped. -rm -f conftest.i conftest.err conftest.$ac_ext -if $ac_preproc_ok -then : - break -fi - - done - ac_cv_prog_CXXCPP=$CXXCPP - -fi - CXXCPP=$ac_cv_prog_CXXCPP -else - ac_cv_prog_CXXCPP=$CXXCPP -fi -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $CXXCPP" >&5 -printf "%s\n" "$CXXCPP" >&6; } -ac_preproc_ok=false -for ac_cxx_preproc_warn_flag in '' yes -do - # Use a header file that comes with gcc, so configuring glibc - # with a fresh cross-compiler works. - # On the NeXT, cc -E runs the code through the compiler's parser, - # not just through cpp. "Syntax error" is here to catch this case. - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -#include - Syntax error -_ACEOF -if ac_fn_cxx_try_cpp "$LINENO" -then : - -else $as_nop - # Broken: fails on valid input. -continue -fi -rm -f conftest.err conftest.i conftest.$ac_ext - - # OK, works on sane cases. Now check whether nonexistent headers - # can be detected and how. - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -#include -_ACEOF -if ac_fn_cxx_try_cpp "$LINENO" -then : - # Broken: success on invalid input. -continue -else $as_nop - # Passes both tests. -ac_preproc_ok=: -break -fi -rm -f conftest.err conftest.i conftest.$ac_ext - -done -# Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped. -rm -f conftest.i conftest.err conftest.$ac_ext -if $ac_preproc_ok -then : - -else $as_nop - { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 -printf "%s\n" "$as_me: error: in \`$ac_pwd':" >&2;} -as_fn_error $? "C++ preprocessor \"$CXXCPP\" fails sanity check -See \`config.log' for more details" "$LINENO" 5; } -fi - -ac_ext=c -ac_cpp='$CPP $CPPFLAGS' -ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' -ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' -ac_compiler_gnu=$ac_cv_c_compiler_gnu - - - -save_cross_compiling=$cross_compiling -save_ac_tool_prefix=$ac_tool_prefix -cross_compiling=no -ac_tool_prefix= - -ac_ext=cpp -ac_cpp='$CXXCPP_FOR_BUILD $CPPFLAGS_FOR_BUILD' -ac_build_compile='$CXX_FOR_BUILD -c $CXXFLAGS_FOR_BUILD $CPPFLAGS_FOR_BUILD conftest.$ac_ext >&5' -ac_build_link='$CXX_FOR_BUILD -o conftest$ac_exeext $CXXFLAGS_FOR_BUILD $CPPFLAGS_FOR_BUILD $LDFLAGS conftest.$ac_ext $LIBS >&5' -ac_compiler_gnu=$ac_cv_cxx_compiler_gnu -if test -z "$CXX_FOR_BUILD"; then - if test -n "$CCC"; then - CXX_FOR_BUILD=$CCC - else - if test -n "$ac_tool_prefix"; then - for ac_prog in g++ c++ gpp aCC CC cxx cc++ cl.exe FCC KCC RCC xlC_r xlC clang++ - do - # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args. -set dummy $ac_tool_prefix$ac_prog; ac_word=$2 -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -printf %s "checking for $ac_word... " >&6; } -if test ${ac_cv_prog_CXX_FOR_BUILD+y} -then : - printf %s "(cached) " >&6 -else $as_nop - if test -n "$CXX_FOR_BUILD"; then - ac_cv_prog_CXX_FOR_BUILD="$CXX_FOR_BUILD" # Let the user override the test. -else -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - case $as_dir in #((( - '') as_dir=./ ;; - */) ;; - *) as_dir=$as_dir/ ;; - esac - for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then - ac_cv_prog_CXX_FOR_BUILD="$ac_tool_prefix$ac_prog" - printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 - break 2 - fi -done - done -IFS=$as_save_IFS - -fi -fi -CXX_FOR_BUILD=$ac_cv_prog_CXX_FOR_BUILD -if test -n "$CXX_FOR_BUILD"; then - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $CXX_FOR_BUILD" >&5 -printf "%s\n" "$CXX_FOR_BUILD" >&6; } -else - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 -printf "%s\n" "no" >&6; } -fi - - - test -n "$CXX_FOR_BUILD" && break - done -fi -if test -z "$CXX_FOR_BUILD"; then - ac_ct_CXX_FOR_BUILD=$CXX_FOR_BUILD - for ac_prog in g++ c++ gpp aCC CC cxx cc++ cl.exe FCC KCC RCC xlC_r xlC clang++ -do - # Extract the first word of "$ac_prog", so it can be a program name with args. -set dummy $ac_prog; ac_word=$2 -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -printf %s "checking for $ac_word... " >&6; } -if test ${ac_cv_prog_ac_ct_CXX_FOR_BUILD+y} -then : - printf %s "(cached) " >&6 -else $as_nop - if test -n "$ac_ct_CXX_FOR_BUILD"; then - ac_cv_prog_ac_ct_CXX_FOR_BUILD="$ac_ct_CXX_FOR_BUILD" # Let the user override the test. -else -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - case $as_dir in #((( - '') as_dir=./ ;; - */) ;; - *) as_dir=$as_dir/ ;; - esac - for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then - ac_cv_prog_ac_ct_CXX_FOR_BUILD="$ac_prog" - printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 - break 2 - fi -done - done -IFS=$as_save_IFS - -fi -fi -ac_ct_CXX_FOR_BUILD=$ac_cv_prog_ac_ct_CXX_FOR_BUILD -if test -n "$ac_ct_CXX_FOR_BUILD"; then - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CXX_FOR_BUILD" >&5 -printf "%s\n" "$ac_ct_CXX_FOR_BUILD" >&6; } -else - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 -printf "%s\n" "no" >&6; } -fi - - - test -n "$ac_ct_CXX_FOR_BUILD" && break -done - - if test "x$ac_ct_CXX_FOR_BUILD" = x; then - CXX_FOR_BUILD="g++" - else - case $cross_compiling:$ac_tool_warned in -yes:) -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with build triplet" >&5 -printf "%s\n" "$as_me: WARNING: using cross tools not prefixed with build triplet" >&2;} -ac_tool_warned=yes ;; -esac - CXX_FOR_BUILD=$ac_ct_CXX_FOR_BUILD - fi -fi - - fi -fi -# Provide some information about the compiler. -printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for C++ compiler version" >&5 -set X $ac_build_compile -ac_compiler=$2 -for ac_option in --version -v -V -qversion; do - { { ac_try="$ac_compiler $ac_option >&5" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" -printf "%s\n" "$ac_try_echo"; } >&5 - (eval "$ac_compiler $ac_option >&5") 2>conftest.err - ac_status=$? - if test -s conftest.err; then - sed '10a\ -... rest of stderr output deleted ... - 10q' conftest.err >conftest.er1 - cat conftest.er1 >&5 - fi - rm -f conftest.er1 conftest.err - printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 - test $ac_status = 0; } -done - -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether the compiler supports GNU C++" >&5 -printf %s "checking whether the compiler supports GNU C++... " >&6; } -if test ${ac_cv_cxx_compiler_gnu+y} -then : - printf %s "(cached) " >&6 -else $as_nop - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - -int -main (void) -{ -#ifndef __GNUC__ - choke me -#endif - - ; - return 0; -} -_ACEOF -if ac_fn_cxx_try_compile "$LINENO" -then : - ac_compiler_gnu=yes -else $as_nop - ac_compiler_gnu=no -fi -rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext -ac_cv_cxx_compiler_gnu=$ac_compiler_gnu - -fi -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_cxx_compiler_gnu" >&5 -printf "%s\n" "$ac_cv_cxx_compiler_gnu" >&6; } -ac_compiler_gnu=$ac_cv_cxx_compiler_gnu - -if test $ac_compiler_gnu = yes; then - GXX=yes -else - GXX= -fi -ac_test_CXXFLAGS=${CXXFLAGS_FOR_BUILD+y} -ac_save_CXXFLAGS=$CXXFLAGS_FOR_BUILD -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether $CXX_FOR_BUILD accepts -g" >&5 -printf %s "checking whether $CXX_FOR_BUILD accepts -g... " >&6; } -if test ${ac_cv_build_prog_cxx_g+y} -then : - printf %s "(cached) " >&6 -else $as_nop - ac_save_cxx_werror_flag=$ac_cxx_werror_flag - ac_cxx_werror_flag=yes - ac_cv_build_prog_cxx_g=no - CXXFLAGS_FOR_BUILD="-g" - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - -int -main (void) -{ - - ; - return 0; -} -_ACEOF -if ac_fn_cxx_try_compile "$LINENO" -then : - ac_cv_build_prog_cxx_g=yes -else $as_nop - CXXFLAGS_FOR_BUILD="" - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - -int -main (void) -{ - - ; - return 0; -} -_ACEOF -if ac_fn_cxx_try_compile "$LINENO" -then : - -else $as_nop - ac_cxx_werror_flag=$ac_save_cxx_werror_flag - CXXFLAGS_FOR_BUILD="-g" - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - -int -main (void) -{ - - ; - return 0; -} -_ACEOF -if ac_fn_cxx_try_compile "$LINENO" -then : - ac_cv_build_prog_cxx_g=yes -fi -rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext -fi -rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext -fi -rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext - ac_cxx_werror_flag=$ac_save_cxx_werror_flag -fi -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_build_prog_cxx_g" >&5 -printf "%s\n" "$ac_cv_build_prog_cxx_g" >&6; } -if test $ac_test_CXXFLAGS; then - CXXFLAGS_FOR_BUILD=$ac_save_CXXFLAGS -elif test $ac_cv_build_prog_cxx_g = yes; then - if test "$GXX" = yes; then - CXXFLAGS_FOR_BUILD="-g -O2" - else - CXXFLAGS_FOR_BUILD="-g" - fi -else - if test "$GXX" = yes; then - CXXFLAGS_FOR_BUILD="-O2" - else - CXXFLAGS_FOR_BUILD= - fi -fi -ac_prog_cxx_stdcxx=no -if test x$ac_prog_cxx_stdcxx = xno -then : - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $CXX_FOR_BUILD option to enable C++11 features" >&5 -printf %s "checking for $CXX_FOR_BUILD option to enable C++11 features... " >&6; } -if test ${ac_cv_prog_cxx_11+y} -then : - printf %s "(cached) " >&6 -else $as_nop - ac_cv_prog_cxx_11=no -ac_save_CXX=$CXX_FOR_BUILD -cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -$ac_cxx_conftest_cxx11_program -_ACEOF -for ac_arg in '' -std=gnu++11 -std=gnu++0x -std=c++11 -std=c++0x -qlanglvl=extended0x -AA -do - CXX_FOR_BUILD="$ac_save_CXX $ac_arg" - if ac_fn_cxx_try_compile "$LINENO" -then : - ac_cv_prog_cxx_cxx11=$ac_arg -fi -rm -f core conftest.err conftest.$ac_objext conftest.beam - test "x$ac_cv_prog_cxx_cxx11" != "xno" && break -done -rm -f conftest.$ac_ext -CXX_FOR_BUILD=$ac_save_CXX -fi - -if test "x$ac_cv_prog_cxx_cxx11" = xno -then : - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: unsupported" >&5 -printf "%s\n" "unsupported" >&6; } -else $as_nop - if test "x$ac_cv_prog_cxx_cxx11" = x -then : - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: none needed" >&5 -printf "%s\n" "none needed" >&6; } -else $as_nop - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cxx_cxx11" >&5 -printf "%s\n" "$ac_cv_prog_cxx_cxx11" >&6; } - CXX_FOR_BUILD="$CXX_FOR_BUILD $ac_cv_prog_cxx_cxx11" -fi - ac_cv_prog_cxx_stdcxx=$ac_cv_prog_cxx_cxx11 - ac_prog_cxx_stdcxx=cxx11 -fi -fi -if test x$ac_prog_cxx_stdcxx = xno -then : - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $CXX_FOR_BUILD option to enable C++98 features" >&5 -printf %s "checking for $CXX_FOR_BUILD option to enable C++98 features... " >&6; } -if test ${ac_cv_prog_cxx_98+y} -then : - printf %s "(cached) " >&6 -else $as_nop - ac_cv_prog_cxx_98=no -ac_save_CXX=$CXX_FOR_BUILD -cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -$ac_cxx_conftest_cxx98_program -_ACEOF -for ac_arg in '' -std=gnu++98 -std=c++98 -qlanglvl=extended -AA -do - CXX_FOR_BUILD="$ac_save_CXX $ac_arg" - if ac_fn_cxx_try_compile "$LINENO" -then : - ac_cv_prog_cxx_cxx98=$ac_arg -fi -rm -f core conftest.err conftest.$ac_objext conftest.beam - test "x$ac_cv_prog_cxx_cxx98" != "xno" && break -done -rm -f conftest.$ac_ext -CXX_FOR_BUILD=$ac_save_CXX -fi - -if test "x$ac_cv_prog_cxx_cxx98" = xno -then : - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: unsupported" >&5 -printf "%s\n" "unsupported" >&6; } -else $as_nop - if test "x$ac_cv_prog_cxx_cxx98" = x -then : - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: none needed" >&5 -printf "%s\n" "none needed" >&6; } -else $as_nop - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cxx_cxx98" >&5 -printf "%s\n" "$ac_cv_prog_cxx_cxx98" >&6; } - CXX_FOR_BUILD="$CXX_FOR_BUILD $ac_cv_prog_cxx_cxx98" -fi - ac_cv_prog_cxx_stdcxx=$ac_cv_prog_cxx_cxx98 - ac_prog_cxx_stdcxx=cxx98 -fi -fi - -ac_ext=c -ac_cpp='$CPP $CPPFLAGS_FOR_BUILD' -ac_build_compile='$CC -c $CFLAGS $CPPFLAGS_FOR_BUILD conftest.$ac_ext >&5' -ac_build_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS_FOR_BUILD $LDFLAGS conftest.$ac_ext $LIBS >&5' -ac_compiler_gnu=$ac_cv_c_compiler_gnu - -depcc="$CXX_FOR_BUILD" am_compiler_list= - -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking dependency style of $depcc" >&5 -printf %s "checking dependency style of $depcc... " >&6; } -if test ${am_cv_CXX_dependencies_compiler_type+y} -then : - printf %s "(cached) " >&6 -else $as_nop - if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then - # We make a subdir and do the tests there. Otherwise we can end up - # making bogus files that we don't know about and never remove. For - # instance it was reported that on HP-UX the gcc test will end up - # making a dummy file named 'D' -- because '-MD' means "put the output - # in D". - rm -rf conftest.dir - mkdir conftest.dir - # Copy depcomp to subdir because otherwise we won't find it if we're - # using a relative directory. - cp "$am_depcomp" conftest.dir - cd conftest.dir - # We will build objects and dependencies in a subdirectory because - # it helps to detect inapplicable dependency modes. For instance - # both Tru64's cc and ICC support -MD to output dependencies as a - # side effect of compilation, but ICC will put the dependencies in - # the current directory while Tru64 will put them in the object - # directory. - mkdir sub - - am_cv_CXX_dependencies_compiler_type=none - if test "$am_compiler_list" = ""; then - am_compiler_list=`sed -n 's/^#*\([a-zA-Z0-9]*\))$/\1/p' < ./depcomp` - fi - am__universal=false - case " $depcc " in #( - *\ -arch\ *\ -arch\ *) am__universal=true ;; - esac - - for depmode in $am_compiler_list; do - # Setup a source with many dependencies, because some compilers - # like to wrap large dependency lists on column 80 (with \), and - # we should not choose a depcomp mode which is confused by this. - # - # We need to recreate these files for each test, as the compiler may - # overwrite some of them when testing with obscure command lines. - # This happens at least with the AIX C compiler. - : > sub/conftest.c - for i in 1 2 3 4 5 6; do - echo '#include "conftst'$i'.h"' >> sub/conftest.c - # Using ": > sub/conftst$i.h" creates only sub/conftst1.h with - # Solaris 10 /bin/sh. - echo '/* dummy */' > sub/conftst$i.h - done - echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf - - # We check with '-c' and '-o' for the sake of the "dashmstdout" - # mode. It turns out that the SunPro C++ compiler does not properly - # handle '-M -o', and we need to detect this. Also, some Intel - # versions had trouble with output in subdirs. - am__obj=sub/conftest.${OBJEXT-o} - am__minus_obj="-o $am__obj" - case $depmode in - gcc) - # This depmode causes a compiler race in universal mode. - test "$am__universal" = false || continue - ;; - nosideeffect) - # After this tag, mechanisms are not by side-effect, so they'll - # only be used when explicitly requested. - if test "x$enable_dependency_tracking" = xyes; then - continue - else - break - fi - ;; - msvc7 | msvc7msys | msvisualcpp | msvcmsys) - # This compiler won't grok '-c -o', but also, the minuso test has - # not run yet. These depmodes are late enough in the game, and - # so weak that their functioning should not be impacted. - am__obj=conftest.${OBJEXT-o} - am__minus_obj= - ;; - none) break ;; - esac - if depmode=$depmode \ - source=sub/conftest.c object=$am__obj \ - depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \ - $SHELL ./depcomp $depcc -c $am__minus_obj sub/conftest.c \ - >/dev/null 2>conftest.err && - grep sub/conftst1.h sub/conftest.Po > /dev/null 2>&1 && - grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 && - grep $am__obj sub/conftest.Po > /dev/null 2>&1 && - ${MAKE-make} -s -f confmf > /dev/null 2>&1; then - # icc doesn't choke on unknown options, it will just issue warnings - # or remarks (even with -Werror). So we grep stderr for any message - # that says an option was ignored or not supported. - # When given -MP, icc 7.0 and 7.1 complain thusly: - # icc: Command line warning: ignoring option '-M'; no argument required - # The diagnosis changed in icc 8.0: - # icc: Command line remark: option '-MP' not supported - if (grep 'ignoring option' conftest.err || - grep 'not supported' conftest.err) >/dev/null 2>&1; then :; else - am_cv_CXX_dependencies_compiler_type=$depmode - break - fi - fi - done - - cd .. - rm -rf conftest.dir -else - am_cv_CXX_dependencies_compiler_type=none -fi - -fi -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $am_cv_CXX_dependencies_compiler_type" >&5 -printf "%s\n" "$am_cv_CXX_dependencies_compiler_type" >&6; } -CXXDEPMODE=depmode=$am_cv_CXX_dependencies_compiler_type - - if - test "x$enable_dependency_tracking" != xno \ - && test "$am_cv_CXX_dependencies_compiler_type" = gcc3; then - am__fastdepCXX_TRUE= - am__fastdepCXX_FALSE='#' -else - am__fastdepCXX_TRUE='#' - am__fastdepCXX_FALSE= -fi - - -ac_ext=cpp -ac_cpp='$CXXCPP_FOR_BUILD $CPPFLAGS_FOR_BUILD' -ac_build_compile='$CXX_FOR_BUILD -c $CXXFLAGS_FOR_BUILD $CPPFLAGS_FOR_BUILD conftest.$ac_ext >&5' -ac_build_link='$CXX_FOR_BUILD -o conftest$ac_exeext $CXXFLAGS_FOR_BUILD $CPPFLAGS_FOR_BUILD $LDFLAGS conftest.$ac_ext $LIBS >&5' -ac_compiler_gnu=$ac_cv_cxx_compiler_gnu -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking how to run the C++ preprocessor" >&5 -printf %s "checking how to run the C++ preprocessor... " >&6; } -if test -z "$CXXCPP_FOR_BUILD"; then - if test ${ac_cv_build_prog_CXXCPP+y} -then : - printf %s "(cached) " >&6 -else $as_nop - # Double quotes because $CXX needs to be expanded - for CXXCPP_FOR_BUILD in "$CXX_FOR_BUILD -E" cpp /lib/cpp - do - ac_preproc_ok=false -for ac_cxx_preproc_warn_flag in '' yes -do - # Use a header file that comes with gcc, so configuring glibc - # with a fresh cross-compiler works. - # On the NeXT, cc -E runs the code through the compiler's parser, - # not just through cpp. "Syntax error" is here to catch this case. - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -#include - Syntax error -_ACEOF -if ac_fn_cxx_try_cpp "$LINENO" -then : - -else $as_nop - # Broken: fails on valid input. -continue -fi -rm -f conftest.err conftest.i conftest.$ac_ext - - # OK, works on sane cases. Now check whether nonexistent headers - # can be detected and how. - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -#include -_ACEOF -if ac_fn_cxx_try_cpp "$LINENO" -then : - # Broken: success on invalid input. -continue -else $as_nop - # Passes both tests. -ac_preproc_ok=: -break -fi -rm -f conftest.err conftest.i conftest.$ac_ext - -done -# Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped. -rm -f conftest.i conftest.err conftest.$ac_ext -if $ac_preproc_ok -then : - break -fi - - done - ac_cv_build_prog_CXXCPP=$CXXCPP_FOR_BUILD - -fi - CXXCPP_FOR_BUILD=$ac_cv_build_prog_CXXCPP -else - ac_cv_build_prog_CXXCPP=$CXXCPP_FOR_BUILD -fi -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $CXXCPP_FOR_BUILD" >&5 -printf "%s\n" "$CXXCPP_FOR_BUILD" >&6; } -ac_preproc_ok=false -for ac_cxx_preproc_warn_flag in '' yes -do - # Use a header file that comes with gcc, so configuring glibc - # with a fresh cross-compiler works. - # On the NeXT, cc -E runs the code through the compiler's parser, - # not just through cpp. "Syntax error" is here to catch this case. - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -#include - Syntax error -_ACEOF -if ac_fn_cxx_try_cpp "$LINENO" -then : - -else $as_nop - # Broken: fails on valid input. -continue -fi -rm -f conftest.err conftest.i conftest.$ac_ext - - # OK, works on sane cases. Now check whether nonexistent headers - # can be detected and how. - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -#include -_ACEOF -if ac_fn_cxx_try_cpp "$LINENO" -then : - # Broken: success on invalid input. -continue -else $as_nop - # Passes both tests. -ac_preproc_ok=: -break -fi -rm -f conftest.err conftest.i conftest.$ac_ext - -done -# Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped. -rm -f conftest.i conftest.err conftest.$ac_ext -if $ac_preproc_ok -then : - -else $as_nop - { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 -printf "%s\n" "$as_me: error: in \`$ac_pwd':" >&2;} -as_fn_error $? "C++ preprocessor \"$CXXCPP_FOR_BUILD\" fails sanity check -See \`config.log' for more details" "$LINENO" 5; } -fi - -ac_ext=c -ac_cpp='$CPP $CPPFLAGS_FOR_BUILD' -ac_build_compile='$CC -c $CFLAGS $CPPFLAGS_FOR_BUILD conftest.$ac_ext >&5' -ac_build_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS_FOR_BUILD $LDFLAGS conftest.$ac_ext $LIBS >&5' -ac_compiler_gnu=$ac_cv_c_compiler_gnu - - -ac_tool_prefix=$save_ac_tool_prefix -cross_compiling=$save_cross_compiling - - - -ac_ext=cpp -ac_cpp='$CXXCPP $CPPFLAGS' -ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' -ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' -ac_compiler_gnu=$ac_cv_cxx_compiler_gnu - - -ac_header= ac_cache= -for ac_item in $ac_header_cxx_list -do - if test $ac_cache; then - ac_fn_cxx_check_header_compile "$LINENO" $ac_header ac_cv_header_$ac_cache "$ac_includes_default" - if eval test \"x\$ac_cv_header_$ac_cache\" = xyes; then - printf "%s\n" "#define $ac_item 1" >> confdefs.h - fi - ac_header= ac_cache= - elif test $ac_header; then - ac_cache=$ac_item - else - ac_header=$ac_item - fi -done - - - - - - - - -if test $ac_cv_header_stdlib_h = yes && test $ac_cv_header_string_h = yes -then : - -printf "%s\n" "#define STDC_HEADERS 1" >>confdefs.h - -fi - - - - - - - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether it is safe to define __EXTENSIONS__" >&5 -printf %s "checking whether it is safe to define __EXTENSIONS__... " >&6; } -if test ${ac_cv_safe_to_define___extensions__+y} -then : - printf %s "(cached) " >&6 -else $as_nop - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - -# define __EXTENSIONS__ 1 - $ac_includes_default -int -main (void) -{ - - ; - return 0; -} -_ACEOF -if ac_fn_cxx_try_compile "$LINENO" -then : - ac_cv_safe_to_define___extensions__=yes -else $as_nop - ac_cv_safe_to_define___extensions__=no -fi -rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext -fi -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_safe_to_define___extensions__" >&5 -printf "%s\n" "$ac_cv_safe_to_define___extensions__" >&6; } - - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether _XOPEN_SOURCE should be defined" >&5 -printf %s "checking whether _XOPEN_SOURCE should be defined... " >&6; } -if test ${ac_cv_should_define__xopen_source+y} -then : - printf %s "(cached) " >&6 -else $as_nop - ac_cv_should_define__xopen_source=no - if test $ac_cv_header_wchar_h = yes -then : - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - - #include - mbstate_t x; -int -main (void) -{ - - ; - return 0; -} -_ACEOF -if ac_fn_cxx_try_compile "$LINENO" -then : - -else $as_nop - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - - #define _XOPEN_SOURCE 500 - #include - mbstate_t x; -int -main (void) -{ - - ; - return 0; -} -_ACEOF -if ac_fn_cxx_try_compile "$LINENO" -then : - ac_cv_should_define__xopen_source=yes -fi -rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext -fi -rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext -fi -fi -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_should_define__xopen_source" >&5 -printf "%s\n" "$ac_cv_should_define__xopen_source" >&6; } - - printf "%s\n" "#define _ALL_SOURCE 1" >>confdefs.h - - printf "%s\n" "#define _DARWIN_C_SOURCE 1" >>confdefs.h - - printf "%s\n" "#define _GNU_SOURCE 1" >>confdefs.h - - printf "%s\n" "#define _HPUX_ALT_XOPEN_SOCKET_API 1" >>confdefs.h - - printf "%s\n" "#define _NETBSD_SOURCE 1" >>confdefs.h - - printf "%s\n" "#define _OPENBSD_SOURCE 1" >>confdefs.h - - printf "%s\n" "#define _POSIX_PTHREAD_SEMANTICS 1" >>confdefs.h - - printf "%s\n" "#define __STDC_WANT_IEC_60559_ATTRIBS_EXT__ 1" >>confdefs.h - - printf "%s\n" "#define __STDC_WANT_IEC_60559_BFP_EXT__ 1" >>confdefs.h - - printf "%s\n" "#define __STDC_WANT_IEC_60559_DFP_EXT__ 1" >>confdefs.h - - printf "%s\n" "#define __STDC_WANT_IEC_60559_FUNCS_EXT__ 1" >>confdefs.h - - printf "%s\n" "#define __STDC_WANT_IEC_60559_TYPES_EXT__ 1" >>confdefs.h - - printf "%s\n" "#define __STDC_WANT_LIB_EXT2__ 1" >>confdefs.h - - printf "%s\n" "#define __STDC_WANT_MATH_SPEC_FUNCS__ 1" >>confdefs.h - - printf "%s\n" "#define _TANDEM_SOURCE 1" >>confdefs.h - - if test $ac_cv_header_minix_config_h = yes -then : - MINIX=yes - printf "%s\n" "#define _MINIX 1" >>confdefs.h - - printf "%s\n" "#define _POSIX_SOURCE 1" >>confdefs.h - - printf "%s\n" "#define _POSIX_1_SOURCE 2" >>confdefs.h - -else $as_nop - MINIX= -fi - if test $ac_cv_safe_to_define___extensions__ = yes -then : - printf "%s\n" "#define __EXTENSIONS__ 1" >>confdefs.h - -fi - if test $ac_cv_should_define__xopen_source = yes -then : - printf "%s\n" "#define _XOPEN_SOURCE 500" >>confdefs.h - -fi - - - - - - - - - if test -n "$ac_tool_prefix"; then - for ac_prog in ar lib "link -lib" - do - # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args. -set dummy $ac_tool_prefix$ac_prog; ac_word=$2 -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -printf %s "checking for $ac_word... " >&6; } -if test ${ac_cv_prog_AR+y} -then : - printf %s "(cached) " >&6 -else $as_nop - if test -n "$AR"; then - ac_cv_prog_AR="$AR" # Let the user override the test. -else -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - case $as_dir in #((( - '') as_dir=./ ;; - */) ;; - *) as_dir=$as_dir/ ;; - esac - for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then - ac_cv_prog_AR="$ac_tool_prefix$ac_prog" - printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 - break 2 - fi -done - done -IFS=$as_save_IFS - -fi -fi -AR=$ac_cv_prog_AR -if test -n "$AR"; then - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $AR" >&5 -printf "%s\n" "$AR" >&6; } -else - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 -printf "%s\n" "no" >&6; } -fi - - - test -n "$AR" && break - done -fi -if test -z "$AR"; then - ac_ct_AR=$AR - for ac_prog in ar lib "link -lib" -do - # Extract the first word of "$ac_prog", so it can be a program name with args. -set dummy $ac_prog; ac_word=$2 -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -printf %s "checking for $ac_word... " >&6; } -if test ${ac_cv_prog_ac_ct_AR+y} -then : - printf %s "(cached) " >&6 -else $as_nop - if test -n "$ac_ct_AR"; then - ac_cv_prog_ac_ct_AR="$ac_ct_AR" # Let the user override the test. -else -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - case $as_dir in #((( - '') as_dir=./ ;; - */) ;; - *) as_dir=$as_dir/ ;; - esac - for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then - ac_cv_prog_ac_ct_AR="$ac_prog" - printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 - break 2 - fi -done - done -IFS=$as_save_IFS - -fi -fi -ac_ct_AR=$ac_cv_prog_ac_ct_AR -if test -n "$ac_ct_AR"; then - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_ct_AR" >&5 -printf "%s\n" "$ac_ct_AR" >&6; } -else - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 -printf "%s\n" "no" >&6; } -fi - - - test -n "$ac_ct_AR" && break -done - - if test "x$ac_ct_AR" = x; then - AR="false" - else - case $cross_compiling:$ac_tool_warned in -yes:) -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 -printf "%s\n" "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} -ac_tool_warned=yes ;; -esac - AR=$ac_ct_AR - fi -fi - -: ${AR=ar} - -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking the archiver ($AR) interface" >&5 -printf %s "checking the archiver ($AR) interface... " >&6; } -if test ${am_cv_ar_interface+y} -then : - printf %s "(cached) " >&6 -else $as_nop - ac_ext=c -ac_cpp='$CPP $CPPFLAGS' -ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' -ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' -ac_compiler_gnu=$ac_cv_c_compiler_gnu - - am_cv_ar_interface=ar - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -int some_variable = 0; -_ACEOF -if ac_fn_c_try_compile "$LINENO" -then : - am_ar_try='$AR cru libconftest.a conftest.$ac_objext >&5' - { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$am_ar_try\""; } >&5 - (eval $am_ar_try) 2>&5 - ac_status=$? - printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 - test $ac_status = 0; } - if test "$ac_status" -eq 0; then - am_cv_ar_interface=ar - else - am_ar_try='$AR -NOLOGO -OUT:conftest.lib conftest.$ac_objext >&5' - { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$am_ar_try\""; } >&5 - (eval $am_ar_try) 2>&5 - ac_status=$? - printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 - test $ac_status = 0; } - if test "$ac_status" -eq 0; then - am_cv_ar_interface=lib - else - am_cv_ar_interface=unknown - fi - fi - rm -f conftest.lib libconftest.a - -fi -rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext - ac_ext=cpp -ac_cpp='$CXXCPP $CPPFLAGS' -ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' -ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' -ac_compiler_gnu=$ac_cv_cxx_compiler_gnu - -fi -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $am_cv_ar_interface" >&5 -printf "%s\n" "$am_cv_ar_interface" >&6; } - -case $am_cv_ar_interface in -ar) - ;; -lib) - # Microsoft lib, so override with the ar-lib wrapper script. - # FIXME: It is wrong to rewrite AR. - # But if we don't then we get into trouble of one sort or another. - # A longer-term fix would be to have automake use am__AR in this case, - # and then we could set am__AR="$am_aux_dir/ar-lib \$(AR)" or something - # similar. - AR="$am_aux_dir/ar-lib $AR" - ;; -unknown) - as_fn_error $? "could not determine $AR interface" "$LINENO" 5 - ;; -esac - - if test "$GCC" = yes; then - GCC_TRUE= - GCC_FALSE='#' -else - GCC_TRUE='#' - GCC_FALSE= -fi - # let the Makefile know if we're gcc -ac_ext=m -ac_cpp='$OBJCPP $CPPFLAGS' -ac_compile='$OBJC -c $OBJCFLAGS $CPPFLAGS conftest.$ac_ext >&5' -ac_link='$OBJC -o conftest$ac_exeext $OBJCFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' -ac_compiler_gnu=$ac_cv_objc_compiler_gnu -if test -n "$ac_tool_prefix"; then - for ac_prog in gcc objcc objc cc CC clang - do - # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args. -set dummy $ac_tool_prefix$ac_prog; ac_word=$2 -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -printf %s "checking for $ac_word... " >&6; } -if test ${ac_cv_prog_OBJC+y} -then : - printf %s "(cached) " >&6 -else $as_nop - if test -n "$OBJC"; then - ac_cv_prog_OBJC="$OBJC" # Let the user override the test. -else -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - case $as_dir in #((( - '') as_dir=./ ;; - */) ;; - *) as_dir=$as_dir/ ;; - esac - for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then - ac_cv_prog_OBJC="$ac_tool_prefix$ac_prog" - printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 - break 2 - fi -done - done -IFS=$as_save_IFS - -fi -fi -OBJC=$ac_cv_prog_OBJC -if test -n "$OBJC"; then - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $OBJC" >&5 -printf "%s\n" "$OBJC" >&6; } -else - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 -printf "%s\n" "no" >&6; } -fi - - - test -n "$OBJC" && break - done -fi -if test -z "$OBJC"; then - ac_ct_OBJC=$OBJC - for ac_prog in gcc objcc objc cc CC clang -do - # Extract the first word of "$ac_prog", so it can be a program name with args. -set dummy $ac_prog; ac_word=$2 -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -printf %s "checking for $ac_word... " >&6; } -if test ${ac_cv_prog_ac_ct_OBJC+y} -then : - printf %s "(cached) " >&6 -else $as_nop - if test -n "$ac_ct_OBJC"; then - ac_cv_prog_ac_ct_OBJC="$ac_ct_OBJC" # Let the user override the test. -else -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - case $as_dir in #((( - '') as_dir=./ ;; - */) ;; - *) as_dir=$as_dir/ ;; - esac - for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then - ac_cv_prog_ac_ct_OBJC="$ac_prog" - printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 - break 2 - fi -done - done -IFS=$as_save_IFS - -fi -fi -ac_ct_OBJC=$ac_cv_prog_ac_ct_OBJC -if test -n "$ac_ct_OBJC"; then - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_ct_OBJC" >&5 -printf "%s\n" "$ac_ct_OBJC" >&6; } -else - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 -printf "%s\n" "no" >&6; } -fi - - - test -n "$ac_ct_OBJC" && break -done - - if test "x$ac_ct_OBJC" = x; then - OBJC="gcc" - else - case $cross_compiling:$ac_tool_warned in -yes:) -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 -printf "%s\n" "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} -ac_tool_warned=yes ;; -esac - OBJC=$ac_ct_OBJC - fi -fi - -# Provide some information about the compiler. -printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for Objective C compiler version" >&5 -set X $ac_compile -ac_compiler=$2 -for ac_option in --version -v -V -qversion; do - { { ac_try="$ac_compiler $ac_option >&5" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" -printf "%s\n" "$ac_try_echo"; } >&5 - (eval "$ac_compiler $ac_option >&5") 2>conftest.err - ac_status=$? - if test -s conftest.err; then - sed '10a\ -... rest of stderr output deleted ... - 10q' conftest.err >conftest.er1 - cat conftest.er1 >&5 - fi - rm -f conftest.er1 conftest.err - printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 - test $ac_status = 0; } -done - -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether the compiler supports GNU Objective C" >&5 -printf %s "checking whether the compiler supports GNU Objective C... " >&6; } -if test ${ac_cv_objc_compiler_gnu+y} -then : - printf %s "(cached) " >&6 -else $as_nop - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - -int -main (void) -{ -#ifndef __GNUC__ - choke me -#endif - - ; - return 0; -} -_ACEOF -if ac_fn_objc_try_compile "$LINENO" -then : - ac_compiler_gnu=yes -else $as_nop - ac_compiler_gnu=no -fi -rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext -ac_cv_objc_compiler_gnu=$ac_compiler_gnu - -fi -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_objc_compiler_gnu" >&5 -printf "%s\n" "$ac_cv_objc_compiler_gnu" >&6; } -ac_compiler_gnu=$ac_cv_objc_compiler_gnu - -if test $ac_compiler_gnu = yes; then - GOBJC=yes -else - GOBJC= -fi -ac_test_OBJCFLAGS=${OBJCFLAGS+y} -ac_save_OBJCFLAGS=$OBJCFLAGS -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether $OBJC accepts -g" >&5 -printf %s "checking whether $OBJC accepts -g... " >&6; } -if test ${ac_cv_prog_objc_g+y} -then : - printf %s "(cached) " >&6 -else $as_nop - ac_save_objc_werror_flag=$ac_objc_werror_flag - ac_objc_werror_flag=yes - ac_cv_prog_objc_g=no - OBJCFLAGS="-g" - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - -int -main (void) -{ - - ; - return 0; -} -_ACEOF -if ac_fn_objc_try_compile "$LINENO" -then : - ac_cv_prog_objc_g=yes -else $as_nop - OBJCFLAGS="" - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - -int -main (void) -{ - - ; - return 0; -} -_ACEOF -if ac_fn_objc_try_compile "$LINENO" -then : - -else $as_nop - ac_objc_werror_flag=$ac_save_objc_werror_flag - OBJCFLAGS="-g" - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - -int -main (void) -{ - - ; - return 0; -} -_ACEOF -if ac_fn_objc_try_compile "$LINENO" -then : - ac_cv_prog_objc_g=yes -fi -rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext -fi -rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext -fi -rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext - ac_objc_werror_flag=$ac_save_objc_werror_flag -fi -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_objc_g" >&5 -printf "%s\n" "$ac_cv_prog_objc_g" >&6; } -if test $ac_test_OBJCFLAGS; then - OBJCFLAGS=$ac_save_OBJCFLAGS -elif test $ac_cv_prog_objc_g = yes; then - if test "$GOBJC" = yes; then - OBJCFLAGS="-g -O2" - else - OBJCFLAGS="-g" - fi -else - if test "$GOBJC" = yes; then - OBJCFLAGS="-O2" - else - OBJCFLAGS= - fi -fi -ac_ext=cpp -ac_cpp='$CXXCPP $CPPFLAGS' -ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' -ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' -ac_compiler_gnu=$ac_cv_cxx_compiler_gnu - -depcc="$OBJC" am_compiler_list='gcc3 gcc' - -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking dependency style of $depcc" >&5 -printf %s "checking dependency style of $depcc... " >&6; } -if test ${am_cv_OBJC_dependencies_compiler_type+y} -then : - printf %s "(cached) " >&6 -else $as_nop - if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then - # We make a subdir and do the tests there. Otherwise we can end up - # making bogus files that we don't know about and never remove. For - # instance it was reported that on HP-UX the gcc test will end up - # making a dummy file named 'D' -- because '-MD' means "put the output - # in D". - rm -rf conftest.dir - mkdir conftest.dir - # Copy depcomp to subdir because otherwise we won't find it if we're - # using a relative directory. - cp "$am_depcomp" conftest.dir - cd conftest.dir - # We will build objects and dependencies in a subdirectory because - # it helps to detect inapplicable dependency modes. For instance - # both Tru64's cc and ICC support -MD to output dependencies as a - # side effect of compilation, but ICC will put the dependencies in - # the current directory while Tru64 will put them in the object - # directory. - mkdir sub - - am_cv_OBJC_dependencies_compiler_type=none - if test "$am_compiler_list" = ""; then - am_compiler_list=`sed -n 's/^#*\([a-zA-Z0-9]*\))$/\1/p' < ./depcomp` - fi - am__universal=false - - - for depmode in $am_compiler_list; do - # Setup a source with many dependencies, because some compilers - # like to wrap large dependency lists on column 80 (with \), and - # we should not choose a depcomp mode which is confused by this. - # - # We need to recreate these files for each test, as the compiler may - # overwrite some of them when testing with obscure command lines. - # This happens at least with the AIX C compiler. - : > sub/conftest.c - for i in 1 2 3 4 5 6; do - echo '#include "conftst'$i'.h"' >> sub/conftest.c - # Using ": > sub/conftst$i.h" creates only sub/conftst1.h with - # Solaris 10 /bin/sh. - echo '/* dummy */' > sub/conftst$i.h - done - echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf - - # We check with '-c' and '-o' for the sake of the "dashmstdout" - # mode. It turns out that the SunPro C++ compiler does not properly - # handle '-M -o', and we need to detect this. Also, some Intel - # versions had trouble with output in subdirs. - am__obj=sub/conftest.${OBJEXT-o} - am__minus_obj="-o $am__obj" - case $depmode in - gcc) - # This depmode causes a compiler race in universal mode. - test "$am__universal" = false || continue - ;; - nosideeffect) - # After this tag, mechanisms are not by side-effect, so they'll - # only be used when explicitly requested. - if test "x$enable_dependency_tracking" = xyes; then - continue - else - break - fi - ;; - msvc7 | msvc7msys | msvisualcpp | msvcmsys) - # This compiler won't grok '-c -o', but also, the minuso test has - # not run yet. These depmodes are late enough in the game, and - # so weak that their functioning should not be impacted. - am__obj=conftest.${OBJEXT-o} - am__minus_obj= - ;; - none) break ;; - esac - if depmode=$depmode \ - source=sub/conftest.c object=$am__obj \ - depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \ - $SHELL ./depcomp $depcc -c $am__minus_obj sub/conftest.c \ - >/dev/null 2>conftest.err && - grep sub/conftst1.h sub/conftest.Po > /dev/null 2>&1 && - grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 && - grep $am__obj sub/conftest.Po > /dev/null 2>&1 && - ${MAKE-make} -s -f confmf > /dev/null 2>&1; then - # icc doesn't choke on unknown options, it will just issue warnings - # or remarks (even with -Werror). So we grep stderr for any message - # that says an option was ignored or not supported. - # When given -MP, icc 7.0 and 7.1 complain thusly: - # icc: Command line warning: ignoring option '-M'; no argument required - # The diagnosis changed in icc 8.0: - # icc: Command line remark: option '-MP' not supported - if (grep 'ignoring option' conftest.err || - grep 'not supported' conftest.err) >/dev/null 2>&1; then :; else - am_cv_OBJC_dependencies_compiler_type=$depmode - break - fi - fi - done - - cd .. - rm -rf conftest.dir -else - am_cv_OBJC_dependencies_compiler_type=none -fi - -fi -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $am_cv_OBJC_dependencies_compiler_type" >&5 -printf "%s\n" "$am_cv_OBJC_dependencies_compiler_type" >&6; } -OBJCDEPMODE=depmode=$am_cv_OBJC_dependencies_compiler_type - - if - test "x$enable_dependency_tracking" != xno \ - && test "$am_cv_OBJC_dependencies_compiler_type" = gcc3; then - am__fastdepOBJC_TRUE= - am__fastdepOBJC_FALSE='#' -else - am__fastdepOBJC_TRUE='#' - am__fastdepOBJC_FALSE= -fi - - - -# test_util.cc takes forever to compile with GCC and optimization turned on. -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking C++ compiler flags..." >&5 -printf %s "checking C++ compiler flags...... " >&6; } -if test "x${ac_cv_env_CXXFLAGS_set}" = "x" -then : - - if test "$GCC" = "yes" -then : - - PROTOBUF_OPT_FLAG="-O2" - CXXFLAGS="${CXXFLAGS} -g" - -fi - - # Protocol Buffers contains several checks that are intended to be used only - # for debugging and which might hurt performance. Most users are probably - # end users who don't want these checks, so add -DNDEBUG by default. - CXXFLAGS="$CXXFLAGS -std=c++11 -DNDEBUG" - - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: use default: $PROTOBUF_OPT_FLAG $CXXFLAGS" >&5 -printf "%s\n" "use default: $PROTOBUF_OPT_FLAG $CXXFLAGS" >&6; } - -else $as_nop - - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: use user-supplied: $CXXFLAGS" >&5 -printf "%s\n" "use user-supplied: $CXXFLAGS" >&6; } - -fi - - - -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $CXX options needed to detect all undeclared functions" >&5 -printf %s "checking for $CXX options needed to detect all undeclared functions... " >&6; } -if test ${ac_cv_cxx_undeclared_builtin_options+y} -then : - printf %s "(cached) " >&6 -else $as_nop - ac_save_CFLAGS=$CFLAGS - ac_cv_cxx_undeclared_builtin_options='cannot detect' - for ac_arg in '' -fno-builtin; do - CFLAGS="$ac_save_CFLAGS $ac_arg" - # This test program should *not* compile successfully. - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - -int -main (void) -{ -(void) strchr; - ; - return 0; -} -_ACEOF -if ac_fn_cxx_try_compile "$LINENO" -then : - -else $as_nop - # This test program should compile successfully. - # No library function is consistently available on - # freestanding implementations, so test against a dummy - # declaration. Include always-available headers on the - # off chance that they somehow elicit warnings. - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -#include -#include -#include -#include -extern void ac_decl (int, char *); - -int -main (void) -{ -(void) ac_decl (0, (char *) 0); - (void) ac_decl; - - ; - return 0; -} -_ACEOF -if ac_fn_cxx_try_compile "$LINENO" -then : - if test x"$ac_arg" = x -then : - ac_cv_cxx_undeclared_builtin_options='none needed' -else $as_nop - ac_cv_cxx_undeclared_builtin_options=$ac_arg -fi - break -fi -rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext -fi -rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext - done - CFLAGS=$ac_save_CFLAGS - -fi -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_cxx_undeclared_builtin_options" >&5 -printf "%s\n" "$ac_cv_cxx_undeclared_builtin_options" >&6; } - case $ac_cv_cxx_undeclared_builtin_options in #( - 'cannot detect') : - { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 -printf "%s\n" "$as_me: error: in \`$ac_pwd':" >&2;} -as_fn_error $? "cannot make $CXX report undeclared builtins -See \`config.log' for more details" "$LINENO" 5; } ;; #( - 'none needed') : - ac_cxx_undeclared_builtin_options='' ;; #( - *) : - ac_cxx_undeclared_builtin_options=$ac_cv_cxx_undeclared_builtin_options ;; -esac - - - - ac_ext=cpp -ac_cpp='$CXXCPP $CPPFLAGS' -ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' -ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' -ac_compiler_gnu=$ac_cv_cxx_compiler_gnu - - ac_fn_check_decl "$LINENO" "__SUNPRO_CC" "ac_cv_have_decl___SUNPRO_CC" "$ac_includes_default" "$ac_cxx_undeclared_builtin_options" "CXXFLAGS" -if test "x$ac_cv_have_decl___SUNPRO_CC" = xyes -then : - SUNCC="yes" -else $as_nop - SUNCC="no" -fi - ac_ext=cpp -ac_cpp='$CXXCPP $CPPFLAGS' -ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' -ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' -ac_compiler_gnu=$ac_cv_cxx_compiler_gnu - - - - # Check whether --enable-64bit-solaris was given. -if test ${enable_64bit_solaris+y} -then : - enableval=$enable_64bit_solaris; ac_enable_64bit="$enableval" -else $as_nop - ac_enable_64bit="yes" -fi - - - if test "$SUNCC" = "yes" -a "x${ac_cv_env_CXXFLAGS_set}" = "x" -then : - - CXXFLAGS="-g0 -xO3 -xlibmil -xdepend -xbuiltin -mt -template=no%extdef ${CXXFLAGS}" - -fi - - case $host_os in - *solaris*) - for ac_prog in isainfo -do - # Extract the first word of "$ac_prog", so it can be a program name with args. -set dummy $ac_prog; ac_word=$2 -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -printf %s "checking for $ac_word... " >&6; } -if test ${ac_cv_prog_ISAINFO+y} -then : - printf %s "(cached) " >&6 -else $as_nop - if test -n "$ISAINFO"; then - ac_cv_prog_ISAINFO="$ISAINFO" # Let the user override the test. -else -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - case $as_dir in #((( - '') as_dir=./ ;; - */) ;; - *) as_dir=$as_dir/ ;; - esac - for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then - ac_cv_prog_ISAINFO="$ac_prog" - printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 - break 2 - fi -done - done -IFS=$as_save_IFS - -fi -fi -ISAINFO=$ac_cv_prog_ISAINFO -if test -n "$ISAINFO"; then - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ISAINFO" >&5 -printf "%s\n" "$ISAINFO" >&6; } -else - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 -printf "%s\n" "no" >&6; } -fi - - - test -n "$ISAINFO" && break -done -test -n "$ISAINFO" || ISAINFO="no" - - if test "x$ISAINFO" != "xno" -then : - isainfo_b=`${ISAINFO} -b` -else $as_nop - isainfo_b="x" -fi - - if test "$isainfo_b" != "x" -then : - - - isainfo_k=`${ISAINFO} -k` - - if test "x$ac_enable_64bit" = "xyes" -then : - - - if test "x$libdir" = "x\${exec_prefix}/lib" -then : - - libdir="${libdir}/${isainfo_k}" - -fi - - CXXFLAGS="${CXXFLAGS} -m64" - ac_cv_env_CXXFLAGS_set=set - ac_cv_env_CXXFLAGS_value='-m64' - - CFLAGS="${CFLAGS} -m64" - ac_cv_env_CFLAGS_set=set - ac_cv_env_CFLAGS_value='-m64' - - if test "$target_cpu" = "sparc" -a "x$SUNCC" = "xyes" -then : - - CXXFLAGS="-xmemalign=8s ${CXXFLAGS}" - -fi - -fi - -fi - ;; - esac - - if test "$target_cpu" = "sparc" -a "x$SUNCC" = "xyes" -then : - - CXXFLAGS="-xregs=no%appl ${CXXFLAGS}" - -fi - - -# Have to do libtool after SUNCC, other wise it "helpfully" adds Crun Cstd -# to the link -case `pwd` in - *\ * | *\ *) - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: Libtool does not cope well with whitespace in \`pwd\`" >&5 -printf "%s\n" "$as_me: WARNING: Libtool does not cope well with whitespace in \`pwd\`" >&2;} ;; -esac - - - -macro_version='2.4.6' -macro_revision='2.4.6' - - - - - - - - - - - - - - -ltmain=$ac_aux_dir/ltmain.sh - -# Backslashify metacharacters that are still active within -# double-quoted strings. -sed_quote_subst='s/\(["`$\\]\)/\\\1/g' - -# Same as above, but do not quote variable references. -double_quote_subst='s/\(["`\\]\)/\\\1/g' - -# Sed substitution to delay expansion of an escaped shell variable in a -# double_quote_subst'ed string. -delay_variable_subst='s/\\\\\\\\\\\$/\\\\\\$/g' - -# Sed substitution to delay expansion of an escaped single quote. -delay_single_quote_subst='s/'\''/'\'\\\\\\\'\''/g' - -# Sed substitution to avoid accidental globbing in evaled expressions -no_glob_subst='s/\*/\\\*/g' - -ECHO='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\' -ECHO=$ECHO$ECHO$ECHO$ECHO$ECHO -ECHO=$ECHO$ECHO$ECHO$ECHO$ECHO$ECHO - -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking how to print strings" >&5 -printf %s "checking how to print strings... " >&6; } -# Test print first, because it will be a builtin if present. -if test "X`( print -r -- -n ) 2>/dev/null`" = X-n && \ - test "X`print -r -- $ECHO 2>/dev/null`" = "X$ECHO"; then - ECHO='print -r --' -elif test "X`printf %s $ECHO 2>/dev/null`" = "X$ECHO"; then - ECHO='printf %s\n' -else - # Use this function as a fallback that always works. - func_fallback_echo () - { - eval 'cat <<_LTECHO_EOF -$1 -_LTECHO_EOF' - } - ECHO='func_fallback_echo' -fi - -# func_echo_all arg... -# Invoke $ECHO with all args, space-separated. -func_echo_all () -{ - $ECHO "" -} - -case $ECHO in - printf*) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: printf" >&5 -printf "%s\n" "printf" >&6; } ;; - print*) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: print -r" >&5 -printf "%s\n" "print -r" >&6; } ;; - *) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: cat" >&5 -printf "%s\n" "cat" >&6; } ;; -esac - - - - - - - - - - - - - - -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for a sed that does not truncate output" >&5 -printf %s "checking for a sed that does not truncate output... " >&6; } -if test ${ac_cv_path_SED+y} -then : - printf %s "(cached) " >&6 -else $as_nop - ac_script=s/aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb/ - for ac_i in 1 2 3 4 5 6 7; do - ac_script="$ac_script$as_nl$ac_script" - done - echo "$ac_script" 2>/dev/null | sed 99q >conftest.sed - { ac_script=; unset ac_script;} - if test -z "$SED"; then - ac_path_SED_found=false - # Loop through the user's path and test for each of PROGNAME-LIST - as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - case $as_dir in #((( - '') as_dir=./ ;; - */) ;; - *) as_dir=$as_dir/ ;; - esac - for ac_prog in sed gsed - do - for ac_exec_ext in '' $ac_executable_extensions; do - ac_path_SED="$as_dir$ac_prog$ac_exec_ext" - as_fn_executable_p "$ac_path_SED" || continue -# Check for GNU ac_path_SED and select it if it is found. - # Check for GNU $ac_path_SED -case `"$ac_path_SED" --version 2>&1` in -*GNU*) - ac_cv_path_SED="$ac_path_SED" ac_path_SED_found=:;; -*) - ac_count=0 - printf %s 0123456789 >"conftest.in" - while : - do - cat "conftest.in" "conftest.in" >"conftest.tmp" - mv "conftest.tmp" "conftest.in" - cp "conftest.in" "conftest.nl" - printf "%s\n" '' >> "conftest.nl" - "$ac_path_SED" -f conftest.sed < "conftest.nl" >"conftest.out" 2>/dev/null || break - diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break - as_fn_arith $ac_count + 1 && ac_count=$as_val - if test $ac_count -gt ${ac_path_SED_max-0}; then - # Best one so far, save it but keep looking for a better one - ac_cv_path_SED="$ac_path_SED" - ac_path_SED_max=$ac_count - fi - # 10*(2^10) chars as input seems more than enough - test $ac_count -gt 10 && break - done - rm -f conftest.in conftest.tmp conftest.nl conftest.out;; -esac - - $ac_path_SED_found && break 3 - done - done - done -IFS=$as_save_IFS - if test -z "$ac_cv_path_SED"; then - as_fn_error $? "no acceptable sed could be found in \$PATH" "$LINENO" 5 - fi -else - ac_cv_path_SED=$SED -fi - -fi -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_SED" >&5 -printf "%s\n" "$ac_cv_path_SED" >&6; } - SED="$ac_cv_path_SED" - rm -f conftest.sed - -test -z "$SED" && SED=sed -Xsed="$SED -e 1s/^X//" - - - - - - - - - - - -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for grep that handles long lines and -e" >&5 -printf %s "checking for grep that handles long lines and -e... " >&6; } -if test ${ac_cv_path_GREP+y} -then : - printf %s "(cached) " >&6 -else $as_nop - if test -z "$GREP"; then - ac_path_GREP_found=false - # Loop through the user's path and test for each of PROGNAME-LIST - as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin -do - IFS=$as_save_IFS - case $as_dir in #((( - '') as_dir=./ ;; - */) ;; - *) as_dir=$as_dir/ ;; - esac - for ac_prog in grep ggrep - do - for ac_exec_ext in '' $ac_executable_extensions; do - ac_path_GREP="$as_dir$ac_prog$ac_exec_ext" - as_fn_executable_p "$ac_path_GREP" || continue -# Check for GNU ac_path_GREP and select it if it is found. - # Check for GNU $ac_path_GREP -case `"$ac_path_GREP" --version 2>&1` in -*GNU*) - ac_cv_path_GREP="$ac_path_GREP" ac_path_GREP_found=:;; -*) - ac_count=0 - printf %s 0123456789 >"conftest.in" - while : - do - cat "conftest.in" "conftest.in" >"conftest.tmp" - mv "conftest.tmp" "conftest.in" - cp "conftest.in" "conftest.nl" - printf "%s\n" 'GREP' >> "conftest.nl" - "$ac_path_GREP" -e 'GREP$' -e '-(cannot match)-' < "conftest.nl" >"conftest.out" 2>/dev/null || break - diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break - as_fn_arith $ac_count + 1 && ac_count=$as_val - if test $ac_count -gt ${ac_path_GREP_max-0}; then - # Best one so far, save it but keep looking for a better one - ac_cv_path_GREP="$ac_path_GREP" - ac_path_GREP_max=$ac_count - fi - # 10*(2^10) chars as input seems more than enough - test $ac_count -gt 10 && break - done - rm -f conftest.in conftest.tmp conftest.nl conftest.out;; -esac - - $ac_path_GREP_found && break 3 - done - done - done -IFS=$as_save_IFS - if test -z "$ac_cv_path_GREP"; then - as_fn_error $? "no acceptable grep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" "$LINENO" 5 - fi -else - ac_cv_path_GREP=$GREP -fi - -fi -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_GREP" >&5 -printf "%s\n" "$ac_cv_path_GREP" >&6; } - GREP="$ac_cv_path_GREP" - - -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for egrep" >&5 -printf %s "checking for egrep... " >&6; } -if test ${ac_cv_path_EGREP+y} -then : - printf %s "(cached) " >&6 -else $as_nop - if echo a | $GREP -E '(a|b)' >/dev/null 2>&1 - then ac_cv_path_EGREP="$GREP -E" - else - if test -z "$EGREP"; then - ac_path_EGREP_found=false - # Loop through the user's path and test for each of PROGNAME-LIST - as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin -do - IFS=$as_save_IFS - case $as_dir in #((( - '') as_dir=./ ;; - */) ;; - *) as_dir=$as_dir/ ;; - esac - for ac_prog in egrep - do - for ac_exec_ext in '' $ac_executable_extensions; do - ac_path_EGREP="$as_dir$ac_prog$ac_exec_ext" - as_fn_executable_p "$ac_path_EGREP" || continue -# Check for GNU ac_path_EGREP and select it if it is found. - # Check for GNU $ac_path_EGREP -case `"$ac_path_EGREP" --version 2>&1` in -*GNU*) - ac_cv_path_EGREP="$ac_path_EGREP" ac_path_EGREP_found=:;; -*) - ac_count=0 - printf %s 0123456789 >"conftest.in" - while : - do - cat "conftest.in" "conftest.in" >"conftest.tmp" - mv "conftest.tmp" "conftest.in" - cp "conftest.in" "conftest.nl" - printf "%s\n" 'EGREP' >> "conftest.nl" - "$ac_path_EGREP" 'EGREP$' < "conftest.nl" >"conftest.out" 2>/dev/null || break - diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break - as_fn_arith $ac_count + 1 && ac_count=$as_val - if test $ac_count -gt ${ac_path_EGREP_max-0}; then - # Best one so far, save it but keep looking for a better one - ac_cv_path_EGREP="$ac_path_EGREP" - ac_path_EGREP_max=$ac_count - fi - # 10*(2^10) chars as input seems more than enough - test $ac_count -gt 10 && break - done - rm -f conftest.in conftest.tmp conftest.nl conftest.out;; -esac - - $ac_path_EGREP_found && break 3 - done - done - done -IFS=$as_save_IFS - if test -z "$ac_cv_path_EGREP"; then - as_fn_error $? "no acceptable egrep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" "$LINENO" 5 - fi -else - ac_cv_path_EGREP=$EGREP -fi - - fi -fi -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_EGREP" >&5 -printf "%s\n" "$ac_cv_path_EGREP" >&6; } - EGREP="$ac_cv_path_EGREP" - - -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for fgrep" >&5 -printf %s "checking for fgrep... " >&6; } -if test ${ac_cv_path_FGREP+y} -then : - printf %s "(cached) " >&6 -else $as_nop - if echo 'ab*c' | $GREP -F 'ab*c' >/dev/null 2>&1 - then ac_cv_path_FGREP="$GREP -F" - else - if test -z "$FGREP"; then - ac_path_FGREP_found=false - # Loop through the user's path and test for each of PROGNAME-LIST - as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin -do - IFS=$as_save_IFS - case $as_dir in #((( - '') as_dir=./ ;; - */) ;; - *) as_dir=$as_dir/ ;; - esac - for ac_prog in fgrep - do - for ac_exec_ext in '' $ac_executable_extensions; do - ac_path_FGREP="$as_dir$ac_prog$ac_exec_ext" - as_fn_executable_p "$ac_path_FGREP" || continue -# Check for GNU ac_path_FGREP and select it if it is found. - # Check for GNU $ac_path_FGREP -case `"$ac_path_FGREP" --version 2>&1` in -*GNU*) - ac_cv_path_FGREP="$ac_path_FGREP" ac_path_FGREP_found=:;; -*) - ac_count=0 - printf %s 0123456789 >"conftest.in" - while : - do - cat "conftest.in" "conftest.in" >"conftest.tmp" - mv "conftest.tmp" "conftest.in" - cp "conftest.in" "conftest.nl" - printf "%s\n" 'FGREP' >> "conftest.nl" - "$ac_path_FGREP" FGREP < "conftest.nl" >"conftest.out" 2>/dev/null || break - diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break - as_fn_arith $ac_count + 1 && ac_count=$as_val - if test $ac_count -gt ${ac_path_FGREP_max-0}; then - # Best one so far, save it but keep looking for a better one - ac_cv_path_FGREP="$ac_path_FGREP" - ac_path_FGREP_max=$ac_count - fi - # 10*(2^10) chars as input seems more than enough - test $ac_count -gt 10 && break - done - rm -f conftest.in conftest.tmp conftest.nl conftest.out;; -esac - - $ac_path_FGREP_found && break 3 - done - done - done -IFS=$as_save_IFS - if test -z "$ac_cv_path_FGREP"; then - as_fn_error $? "no acceptable fgrep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" "$LINENO" 5 - fi -else - ac_cv_path_FGREP=$FGREP -fi - - fi -fi -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_FGREP" >&5 -printf "%s\n" "$ac_cv_path_FGREP" >&6; } - FGREP="$ac_cv_path_FGREP" - - -test -z "$GREP" && GREP=grep - - - - - - - - - - - - - - - - - - - -# Check whether --with-gnu-ld was given. -if test ${with_gnu_ld+y} -then : - withval=$with_gnu_ld; test no = "$withval" || with_gnu_ld=yes -else $as_nop - with_gnu_ld=no -fi - -ac_prog=ld -if test yes = "$GCC"; then - # Check if gcc -print-prog-name=ld gives a path. - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for ld used by $CC" >&5 -printf %s "checking for ld used by $CC... " >&6; } - case $host in - *-*-mingw*) - # gcc leaves a trailing carriage return, which upsets mingw - ac_prog=`($CC -print-prog-name=ld) 2>&5 | tr -d '\015'` ;; - *) - ac_prog=`($CC -print-prog-name=ld) 2>&5` ;; - esac - case $ac_prog in - # Accept absolute paths. - [\\/]* | ?:[\\/]*) - re_direlt='/[^/][^/]*/\.\./' - # Canonicalize the pathname of ld - ac_prog=`$ECHO "$ac_prog"| $SED 's%\\\\%/%g'` - while $ECHO "$ac_prog" | $GREP "$re_direlt" > /dev/null 2>&1; do - ac_prog=`$ECHO $ac_prog| $SED "s%$re_direlt%/%"` - done - test -z "$LD" && LD=$ac_prog - ;; - "") - # If it fails, then pretend we aren't using GCC. - ac_prog=ld - ;; - *) - # If it is relative, then search for the first ld in PATH. - with_gnu_ld=unknown - ;; - esac -elif test yes = "$with_gnu_ld"; then - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for GNU ld" >&5 -printf %s "checking for GNU ld... " >&6; } -else - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for non-GNU ld" >&5 -printf %s "checking for non-GNU ld... " >&6; } -fi -if test ${lt_cv_path_LD+y} -then : - printf %s "(cached) " >&6 -else $as_nop - if test -z "$LD"; then - lt_save_ifs=$IFS; IFS=$PATH_SEPARATOR - for ac_dir in $PATH; do - IFS=$lt_save_ifs - test -z "$ac_dir" && ac_dir=. - if test -f "$ac_dir/$ac_prog" || test -f "$ac_dir/$ac_prog$ac_exeext"; then - lt_cv_path_LD=$ac_dir/$ac_prog - # Check to see if the program is GNU ld. I'd rather use --version, - # but apparently some variants of GNU ld only accept -v. - # Break only if it was the GNU/non-GNU ld that we prefer. - case `"$lt_cv_path_LD" -v 2>&1 &5 -printf "%s\n" "$LD" >&6; } -else - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 -printf "%s\n" "no" >&6; } -fi -test -z "$LD" && as_fn_error $? "no acceptable ld found in \$PATH" "$LINENO" 5 -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking if the linker ($LD) is GNU ld" >&5 -printf %s "checking if the linker ($LD) is GNU ld... " >&6; } -if test ${lt_cv_prog_gnu_ld+y} -then : - printf %s "(cached) " >&6 -else $as_nop - # I'd rather use --version here, but apparently some GNU lds only accept -v. -case `$LD -v 2>&1 &5 -printf "%s\n" "$lt_cv_prog_gnu_ld" >&6; } -with_gnu_ld=$lt_cv_prog_gnu_ld - - - - - - - - - -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for BSD- or MS-compatible name lister (nm)" >&5 -printf %s "checking for BSD- or MS-compatible name lister (nm)... " >&6; } -if test ${lt_cv_path_NM+y} -then : - printf %s "(cached) " >&6 -else $as_nop - if test -n "$NM"; then - # Let the user override the test. - lt_cv_path_NM=$NM -else - lt_nm_to_check=${ac_tool_prefix}nm - if test -n "$ac_tool_prefix" && test "$build" = "$host"; then - lt_nm_to_check="$lt_nm_to_check nm" - fi - for lt_tmp_nm in $lt_nm_to_check; do - lt_save_ifs=$IFS; IFS=$PATH_SEPARATOR - for ac_dir in $PATH /usr/ccs/bin/elf /usr/ccs/bin /usr/ucb /bin; do - IFS=$lt_save_ifs - test -z "$ac_dir" && ac_dir=. - tmp_nm=$ac_dir/$lt_tmp_nm - if test -f "$tmp_nm" || test -f "$tmp_nm$ac_exeext"; then - # Check to see if the nm accepts a BSD-compat flag. - # Adding the 'sed 1q' prevents false positives on HP-UX, which says: - # nm: unknown option "B" ignored - # Tru64's nm complains that /dev/null is an invalid object file - # MSYS converts /dev/null to NUL, MinGW nm treats NUL as empty - case $build_os in - mingw*) lt_bad_file=conftest.nm/nofile ;; - *) lt_bad_file=/dev/null ;; - esac - case `"$tmp_nm" -B $lt_bad_file 2>&1 | sed '1q'` in - *$lt_bad_file* | *'Invalid file or object type'*) - lt_cv_path_NM="$tmp_nm -B" - break 2 - ;; - *) - case `"$tmp_nm" -p /dev/null 2>&1 | sed '1q'` in - */dev/null*) - lt_cv_path_NM="$tmp_nm -p" - break 2 - ;; - *) - lt_cv_path_NM=${lt_cv_path_NM="$tmp_nm"} # keep the first match, but - continue # so that we can try to find one that supports BSD flags - ;; - esac - ;; - esac - fi - done - IFS=$lt_save_ifs - done - : ${lt_cv_path_NM=no} -fi -fi -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $lt_cv_path_NM" >&5 -printf "%s\n" "$lt_cv_path_NM" >&6; } -if test no != "$lt_cv_path_NM"; then - NM=$lt_cv_path_NM -else - # Didn't find any BSD compatible name lister, look for dumpbin. - if test -n "$DUMPBIN"; then : - # Let the user override the test. - else - if test -n "$ac_tool_prefix"; then - for ac_prog in dumpbin "link -dump" - do - # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args. -set dummy $ac_tool_prefix$ac_prog; ac_word=$2 -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -printf %s "checking for $ac_word... " >&6; } -if test ${ac_cv_prog_DUMPBIN+y} -then : - printf %s "(cached) " >&6 -else $as_nop - if test -n "$DUMPBIN"; then - ac_cv_prog_DUMPBIN="$DUMPBIN" # Let the user override the test. -else -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - case $as_dir in #((( - '') as_dir=./ ;; - */) ;; - *) as_dir=$as_dir/ ;; - esac - for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then - ac_cv_prog_DUMPBIN="$ac_tool_prefix$ac_prog" - printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 - break 2 - fi -done - done -IFS=$as_save_IFS - -fi -fi -DUMPBIN=$ac_cv_prog_DUMPBIN -if test -n "$DUMPBIN"; then - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $DUMPBIN" >&5 -printf "%s\n" "$DUMPBIN" >&6; } -else - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 -printf "%s\n" "no" >&6; } -fi - - - test -n "$DUMPBIN" && break - done -fi -if test -z "$DUMPBIN"; then - ac_ct_DUMPBIN=$DUMPBIN - for ac_prog in dumpbin "link -dump" -do - # Extract the first word of "$ac_prog", so it can be a program name with args. -set dummy $ac_prog; ac_word=$2 -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -printf %s "checking for $ac_word... " >&6; } -if test ${ac_cv_prog_ac_ct_DUMPBIN+y} -then : - printf %s "(cached) " >&6 -else $as_nop - if test -n "$ac_ct_DUMPBIN"; then - ac_cv_prog_ac_ct_DUMPBIN="$ac_ct_DUMPBIN" # Let the user override the test. -else -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - case $as_dir in #((( - '') as_dir=./ ;; - */) ;; - *) as_dir=$as_dir/ ;; - esac - for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then - ac_cv_prog_ac_ct_DUMPBIN="$ac_prog" - printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 - break 2 - fi -done - done -IFS=$as_save_IFS - -fi -fi -ac_ct_DUMPBIN=$ac_cv_prog_ac_ct_DUMPBIN -if test -n "$ac_ct_DUMPBIN"; then - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_ct_DUMPBIN" >&5 -printf "%s\n" "$ac_ct_DUMPBIN" >&6; } -else - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 -printf "%s\n" "no" >&6; } -fi - - - test -n "$ac_ct_DUMPBIN" && break -done - - if test "x$ac_ct_DUMPBIN" = x; then - DUMPBIN=":" - else - case $cross_compiling:$ac_tool_warned in -yes:) -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 -printf "%s\n" "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} -ac_tool_warned=yes ;; -esac - DUMPBIN=$ac_ct_DUMPBIN - fi -fi - - case `$DUMPBIN -symbols -headers /dev/null 2>&1 | sed '1q'` in - *COFF*) - DUMPBIN="$DUMPBIN -symbols -headers" - ;; - *) - DUMPBIN=: - ;; - esac - fi - - if test : != "$DUMPBIN"; then - NM=$DUMPBIN - fi -fi -test -z "$NM" && NM=nm - - - - - - -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking the name lister ($NM) interface" >&5 -printf %s "checking the name lister ($NM) interface... " >&6; } -if test ${lt_cv_nm_interface+y} -then : - printf %s "(cached) " >&6 -else $as_nop - lt_cv_nm_interface="BSD nm" - echo "int some_variable = 0;" > conftest.$ac_ext - (eval echo "\"\$as_me:$LINENO: $ac_compile\"" >&5) - (eval "$ac_compile" 2>conftest.err) - cat conftest.err >&5 - (eval echo "\"\$as_me:$LINENO: $NM \\\"conftest.$ac_objext\\\"\"" >&5) - (eval "$NM \"conftest.$ac_objext\"" 2>conftest.err > conftest.out) - cat conftest.err >&5 - (eval echo "\"\$as_me:$LINENO: output\"" >&5) - cat conftest.out >&5 - if $GREP 'External.*some_variable' conftest.out > /dev/null; then - lt_cv_nm_interface="MS dumpbin" - fi - rm -f conftest* -fi -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $lt_cv_nm_interface" >&5 -printf "%s\n" "$lt_cv_nm_interface" >&6; } - -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether ln -s works" >&5 -printf %s "checking whether ln -s works... " >&6; } -LN_S=$as_ln_s -if test "$LN_S" = "ln -s"; then - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -printf "%s\n" "yes" >&6; } -else - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no, using $LN_S" >&5 -printf "%s\n" "no, using $LN_S" >&6; } -fi - -# find the maximum length of command line arguments -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking the maximum length of command line arguments" >&5 -printf %s "checking the maximum length of command line arguments... " >&6; } -if test ${lt_cv_sys_max_cmd_len+y} -then : - printf %s "(cached) " >&6 -else $as_nop - i=0 - teststring=ABCD - - case $build_os in - msdosdjgpp*) - # On DJGPP, this test can blow up pretty badly due to problems in libc - # (any single argument exceeding 2000 bytes causes a buffer overrun - # during glob expansion). Even if it were fixed, the result of this - # check would be larger than it should be. - lt_cv_sys_max_cmd_len=12288; # 12K is about right - ;; - - gnu*) - # Under GNU Hurd, this test is not required because there is - # no limit to the length of command line arguments. - # Libtool will interpret -1 as no limit whatsoever - lt_cv_sys_max_cmd_len=-1; - ;; - - cygwin* | mingw* | cegcc*) - # On Win9x/ME, this test blows up -- it succeeds, but takes - # about 5 minutes as the teststring grows exponentially. - # Worse, since 9x/ME are not pre-emptively multitasking, - # you end up with a "frozen" computer, even though with patience - # the test eventually succeeds (with a max line length of 256k). - # Instead, let's just punt: use the minimum linelength reported by - # all of the supported platforms: 8192 (on NT/2K/XP). - lt_cv_sys_max_cmd_len=8192; - ;; - - mint*) - # On MiNT this can take a long time and run out of memory. - lt_cv_sys_max_cmd_len=8192; - ;; - - amigaos*) - # On AmigaOS with pdksh, this test takes hours, literally. - # So we just punt and use a minimum line length of 8192. - lt_cv_sys_max_cmd_len=8192; - ;; - - bitrig* | darwin* | dragonfly* | freebsd* | netbsd* | openbsd*) - # This has been around since 386BSD, at least. Likely further. - if test -x /sbin/sysctl; then - lt_cv_sys_max_cmd_len=`/sbin/sysctl -n kern.argmax` - elif test -x /usr/sbin/sysctl; then - lt_cv_sys_max_cmd_len=`/usr/sbin/sysctl -n kern.argmax` - else - lt_cv_sys_max_cmd_len=65536 # usable default for all BSDs - fi - # And add a safety zone - lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 4` - lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \* 3` - ;; - - interix*) - # We know the value 262144 and hardcode it with a safety zone (like BSD) - lt_cv_sys_max_cmd_len=196608 - ;; - - os2*) - # The test takes a long time on OS/2. - lt_cv_sys_max_cmd_len=8192 - ;; - - osf*) - # Dr. Hans Ekkehard Plesser reports seeing a kernel panic running configure - # due to this test when exec_disable_arg_limit is 1 on Tru64. It is not - # nice to cause kernel panics so lets avoid the loop below. - # First set a reasonable default. - lt_cv_sys_max_cmd_len=16384 - # - if test -x /sbin/sysconfig; then - case `/sbin/sysconfig -q proc exec_disable_arg_limit` in - *1*) lt_cv_sys_max_cmd_len=-1 ;; - esac - fi - ;; - sco3.2v5*) - lt_cv_sys_max_cmd_len=102400 - ;; - sysv5* | sco5v6* | sysv4.2uw2*) - kargmax=`grep ARG_MAX /etc/conf/cf.d/stune 2>/dev/null` - if test -n "$kargmax"; then - lt_cv_sys_max_cmd_len=`echo $kargmax | sed 's/.*[ ]//'` - else - lt_cv_sys_max_cmd_len=32768 - fi - ;; - *) - lt_cv_sys_max_cmd_len=`(getconf ARG_MAX) 2> /dev/null` - if test -n "$lt_cv_sys_max_cmd_len" && \ - test undefined != "$lt_cv_sys_max_cmd_len"; then - lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 4` - lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \* 3` - else - # Make teststring a little bigger before we do anything with it. - # a 1K string should be a reasonable start. - for i in 1 2 3 4 5 6 7 8; do - teststring=$teststring$teststring - done - SHELL=${SHELL-${CONFIG_SHELL-/bin/sh}} - # If test is not a shell built-in, we'll probably end up computing a - # maximum length that is only half of the actual maximum length, but - # we can't tell. - while { test X`env echo "$teststring$teststring" 2>/dev/null` \ - = "X$teststring$teststring"; } >/dev/null 2>&1 && - test 17 != "$i" # 1/2 MB should be enough - do - i=`expr $i + 1` - teststring=$teststring$teststring - done - # Only check the string length outside the loop. - lt_cv_sys_max_cmd_len=`expr "X$teststring" : ".*" 2>&1` - teststring= - # Add a significant safety factor because C++ compilers can tack on - # massive amounts of additional arguments before passing them to the - # linker. It appears as though 1/2 is a usable value. - lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 2` - fi - ;; - esac - -fi - -if test -n "$lt_cv_sys_max_cmd_len"; then - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $lt_cv_sys_max_cmd_len" >&5 -printf "%s\n" "$lt_cv_sys_max_cmd_len" >&6; } -else - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: none" >&5 -printf "%s\n" "none" >&6; } -fi -max_cmd_len=$lt_cv_sys_max_cmd_len - - - - - - -: ${CP="cp -f"} -: ${MV="mv -f"} -: ${RM="rm -f"} - -if ( (MAIL=60; unset MAIL) || exit) >/dev/null 2>&1; then - lt_unset=unset -else - lt_unset=false -fi - - - - - -# test EBCDIC or ASCII -case `echo X|tr X '\101'` in - A) # ASCII based system - # \n is not interpreted correctly by Solaris 8 /usr/ucb/tr - lt_SP2NL='tr \040 \012' - lt_NL2SP='tr \015\012 \040\040' - ;; - *) # EBCDIC based system - lt_SP2NL='tr \100 \n' - lt_NL2SP='tr \r\n \100\100' - ;; -esac - - - - - - - - - -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking how to convert $build file names to $host format" >&5 -printf %s "checking how to convert $build file names to $host format... " >&6; } -if test ${lt_cv_to_host_file_cmd+y} -then : - printf %s "(cached) " >&6 -else $as_nop - case $host in - *-*-mingw* ) - case $build in - *-*-mingw* ) # actually msys - lt_cv_to_host_file_cmd=func_convert_file_msys_to_w32 - ;; - *-*-cygwin* ) - lt_cv_to_host_file_cmd=func_convert_file_cygwin_to_w32 - ;; - * ) # otherwise, assume *nix - lt_cv_to_host_file_cmd=func_convert_file_nix_to_w32 - ;; - esac - ;; - *-*-cygwin* ) - case $build in - *-*-mingw* ) # actually msys - lt_cv_to_host_file_cmd=func_convert_file_msys_to_cygwin - ;; - *-*-cygwin* ) - lt_cv_to_host_file_cmd=func_convert_file_noop - ;; - * ) # otherwise, assume *nix - lt_cv_to_host_file_cmd=func_convert_file_nix_to_cygwin - ;; - esac - ;; - * ) # unhandled hosts (and "normal" native builds) - lt_cv_to_host_file_cmd=func_convert_file_noop - ;; -esac - -fi - -to_host_file_cmd=$lt_cv_to_host_file_cmd -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $lt_cv_to_host_file_cmd" >&5 -printf "%s\n" "$lt_cv_to_host_file_cmd" >&6; } - - - - - -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking how to convert $build file names to toolchain format" >&5 -printf %s "checking how to convert $build file names to toolchain format... " >&6; } -if test ${lt_cv_to_tool_file_cmd+y} -then : - printf %s "(cached) " >&6 -else $as_nop - #assume ordinary cross tools, or native build. -lt_cv_to_tool_file_cmd=func_convert_file_noop -case $host in - *-*-mingw* ) - case $build in - *-*-mingw* ) # actually msys - lt_cv_to_tool_file_cmd=func_convert_file_msys_to_w32 - ;; - esac - ;; -esac - -fi - -to_tool_file_cmd=$lt_cv_to_tool_file_cmd -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $lt_cv_to_tool_file_cmd" >&5 -printf "%s\n" "$lt_cv_to_tool_file_cmd" >&6; } - - - - - -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $LD option to reload object files" >&5 -printf %s "checking for $LD option to reload object files... " >&6; } -if test ${lt_cv_ld_reload_flag+y} -then : - printf %s "(cached) " >&6 -else $as_nop - lt_cv_ld_reload_flag='-r' -fi -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $lt_cv_ld_reload_flag" >&5 -printf "%s\n" "$lt_cv_ld_reload_flag" >&6; } -reload_flag=$lt_cv_ld_reload_flag -case $reload_flag in -"" | " "*) ;; -*) reload_flag=" $reload_flag" ;; -esac -reload_cmds='$LD$reload_flag -o $output$reload_objs' -case $host_os in - cygwin* | mingw* | pw32* | cegcc*) - if test yes != "$GCC"; then - reload_cmds=false - fi - ;; - darwin*) - if test yes = "$GCC"; then - reload_cmds='$LTCC $LTCFLAGS -nostdlib $wl-r -o $output$reload_objs' - else - reload_cmds='$LD$reload_flag -o $output$reload_objs' - fi - ;; -esac - - - - - - - - - -if test -n "$ac_tool_prefix"; then - # Extract the first word of "${ac_tool_prefix}objdump", so it can be a program name with args. -set dummy ${ac_tool_prefix}objdump; ac_word=$2 -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -printf %s "checking for $ac_word... " >&6; } -if test ${ac_cv_prog_OBJDUMP+y} -then : - printf %s "(cached) " >&6 -else $as_nop - if test -n "$OBJDUMP"; then - ac_cv_prog_OBJDUMP="$OBJDUMP" # Let the user override the test. -else -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - case $as_dir in #((( - '') as_dir=./ ;; - */) ;; - *) as_dir=$as_dir/ ;; - esac - for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then - ac_cv_prog_OBJDUMP="${ac_tool_prefix}objdump" - printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 - break 2 - fi -done - done -IFS=$as_save_IFS - -fi -fi -OBJDUMP=$ac_cv_prog_OBJDUMP -if test -n "$OBJDUMP"; then - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $OBJDUMP" >&5 -printf "%s\n" "$OBJDUMP" >&6; } -else - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 -printf "%s\n" "no" >&6; } -fi - - -fi -if test -z "$ac_cv_prog_OBJDUMP"; then - ac_ct_OBJDUMP=$OBJDUMP - # Extract the first word of "objdump", so it can be a program name with args. -set dummy objdump; ac_word=$2 -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -printf %s "checking for $ac_word... " >&6; } -if test ${ac_cv_prog_ac_ct_OBJDUMP+y} -then : - printf %s "(cached) " >&6 -else $as_nop - if test -n "$ac_ct_OBJDUMP"; then - ac_cv_prog_ac_ct_OBJDUMP="$ac_ct_OBJDUMP" # Let the user override the test. -else -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - case $as_dir in #((( - '') as_dir=./ ;; - */) ;; - *) as_dir=$as_dir/ ;; - esac - for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then - ac_cv_prog_ac_ct_OBJDUMP="objdump" - printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 - break 2 - fi -done - done -IFS=$as_save_IFS - -fi -fi -ac_ct_OBJDUMP=$ac_cv_prog_ac_ct_OBJDUMP -if test -n "$ac_ct_OBJDUMP"; then - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_ct_OBJDUMP" >&5 -printf "%s\n" "$ac_ct_OBJDUMP" >&6; } -else - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 -printf "%s\n" "no" >&6; } -fi - - if test "x$ac_ct_OBJDUMP" = x; then - OBJDUMP="false" - else - case $cross_compiling:$ac_tool_warned in -yes:) -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 -printf "%s\n" "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} -ac_tool_warned=yes ;; -esac - OBJDUMP=$ac_ct_OBJDUMP - fi -else - OBJDUMP="$ac_cv_prog_OBJDUMP" -fi - -test -z "$OBJDUMP" && OBJDUMP=objdump - - - - - - - - - -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking how to recognize dependent libraries" >&5 -printf %s "checking how to recognize dependent libraries... " >&6; } -if test ${lt_cv_deplibs_check_method+y} -then : - printf %s "(cached) " >&6 -else $as_nop - lt_cv_file_magic_cmd='$MAGIC_CMD' -lt_cv_file_magic_test_file= -lt_cv_deplibs_check_method='unknown' -# Need to set the preceding variable on all platforms that support -# interlibrary dependencies. -# 'none' -- dependencies not supported. -# 'unknown' -- same as none, but documents that we really don't know. -# 'pass_all' -- all dependencies passed with no checks. -# 'test_compile' -- check by making test program. -# 'file_magic [[regex]]' -- check by looking for files in library path -# that responds to the $file_magic_cmd with a given extended regex. -# If you have 'file' or equivalent on your system and you're not sure -# whether 'pass_all' will *always* work, you probably want this one. - -case $host_os in -aix[4-9]*) - lt_cv_deplibs_check_method=pass_all - ;; - -beos*) - lt_cv_deplibs_check_method=pass_all - ;; - -bsdi[45]*) - lt_cv_deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [ML]SB (shared object|dynamic lib)' - lt_cv_file_magic_cmd='/usr/bin/file -L' - lt_cv_file_magic_test_file=/shlib/libc.so - ;; - -cygwin*) - # func_win32_libid is a shell function defined in ltmain.sh - lt_cv_deplibs_check_method='file_magic ^x86 archive import|^x86 DLL' - lt_cv_file_magic_cmd='func_win32_libid' - ;; - -mingw* | pw32*) - # Base MSYS/MinGW do not provide the 'file' command needed by - # func_win32_libid shell function, so use a weaker test based on 'objdump', - # unless we find 'file', for example because we are cross-compiling. - if ( file / ) >/dev/null 2>&1; then - lt_cv_deplibs_check_method='file_magic ^x86 archive import|^x86 DLL' - lt_cv_file_magic_cmd='func_win32_libid' - else - # Keep this pattern in sync with the one in func_win32_libid. - lt_cv_deplibs_check_method='file_magic file format (pei*-i386(.*architecture: i386)?|pe-arm-wince|pe-x86-64)' - lt_cv_file_magic_cmd='$OBJDUMP -f' - fi - ;; - -cegcc*) - # use the weaker test based on 'objdump'. See mingw*. - lt_cv_deplibs_check_method='file_magic file format pe-arm-.*little(.*architecture: arm)?' - lt_cv_file_magic_cmd='$OBJDUMP -f' - ;; - -darwin* | rhapsody*) - lt_cv_deplibs_check_method=pass_all - ;; - -freebsd* | dragonfly*) - if echo __ELF__ | $CC -E - | $GREP __ELF__ > /dev/null; then - case $host_cpu in - i*86 ) - # Not sure whether the presence of OpenBSD here was a mistake. - # Let's accept both of them until this is cleared up. - lt_cv_deplibs_check_method='file_magic (FreeBSD|OpenBSD|DragonFly)/i[3-9]86 (compact )?demand paged shared library' - lt_cv_file_magic_cmd=/usr/bin/file - lt_cv_file_magic_test_file=`echo /usr/lib/libc.so.*` - ;; - esac - else - lt_cv_deplibs_check_method=pass_all - fi - ;; - -haiku*) - lt_cv_deplibs_check_method=pass_all - ;; - -hpux10.20* | hpux11*) - lt_cv_file_magic_cmd=/usr/bin/file - case $host_cpu in - ia64*) - lt_cv_deplibs_check_method='file_magic (s[0-9][0-9][0-9]|ELF-[0-9][0-9]) shared object file - IA64' - lt_cv_file_magic_test_file=/usr/lib/hpux32/libc.so - ;; - hppa*64*) - lt_cv_deplibs_check_method='file_magic (s[0-9][0-9][0-9]|ELF[ -][0-9][0-9])(-bit)?( [LM]SB)? shared object( file)?[, -]* PA-RISC [0-9]\.[0-9]' - lt_cv_file_magic_test_file=/usr/lib/pa20_64/libc.sl - ;; - *) - lt_cv_deplibs_check_method='file_magic (s[0-9][0-9][0-9]|PA-RISC[0-9]\.[0-9]) shared library' - lt_cv_file_magic_test_file=/usr/lib/libc.sl - ;; - esac - ;; - -interix[3-9]*) - # PIC code is broken on Interix 3.x, that's why |\.a not |_pic\.a here - lt_cv_deplibs_check_method='match_pattern /lib[^/]+(\.so|\.a)$' - ;; - -irix5* | irix6* | nonstopux*) - case $LD in - *-32|*"-32 ") libmagic=32-bit;; - *-n32|*"-n32 ") libmagic=N32;; - *-64|*"-64 ") libmagic=64-bit;; - *) libmagic=never-match;; - esac - lt_cv_deplibs_check_method=pass_all - ;; - -# This must be glibc/ELF. -linux* | k*bsd*-gnu | kopensolaris*-gnu | gnu*) - lt_cv_deplibs_check_method=pass_all - ;; - -netbsd* | netbsdelf*-gnu) - if echo __ELF__ | $CC -E - | $GREP __ELF__ > /dev/null; then - lt_cv_deplibs_check_method='match_pattern /lib[^/]+(\.so\.[0-9]+\.[0-9]+|_pic\.a)$' - else - lt_cv_deplibs_check_method='match_pattern /lib[^/]+(\.so|_pic\.a)$' - fi - ;; - -newos6*) - lt_cv_deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [ML]SB (executable|dynamic lib)' - lt_cv_file_magic_cmd=/usr/bin/file - lt_cv_file_magic_test_file=/usr/lib/libnls.so - ;; - -*nto* | *qnx*) - lt_cv_deplibs_check_method=pass_all - ;; - -openbsd* | bitrig*) - if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`"; then - lt_cv_deplibs_check_method='match_pattern /lib[^/]+(\.so\.[0-9]+\.[0-9]+|\.so|_pic\.a)$' - else - lt_cv_deplibs_check_method='match_pattern /lib[^/]+(\.so\.[0-9]+\.[0-9]+|_pic\.a)$' - fi - ;; - -osf3* | osf4* | osf5*) - lt_cv_deplibs_check_method=pass_all - ;; - -rdos*) - lt_cv_deplibs_check_method=pass_all - ;; - -solaris*) - lt_cv_deplibs_check_method=pass_all - ;; - -sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*) - lt_cv_deplibs_check_method=pass_all - ;; - -sysv4 | sysv4.3*) - case $host_vendor in - motorola) - lt_cv_deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [ML]SB (shared object|dynamic lib) M[0-9][0-9]* Version [0-9]' - lt_cv_file_magic_test_file=`echo /usr/lib/libc.so*` - ;; - ncr) - lt_cv_deplibs_check_method=pass_all - ;; - sequent) - lt_cv_file_magic_cmd='/bin/file' - lt_cv_deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [LM]SB (shared object|dynamic lib )' - ;; - sni) - lt_cv_file_magic_cmd='/bin/file' - lt_cv_deplibs_check_method="file_magic ELF [0-9][0-9]*-bit [LM]SB dynamic lib" - lt_cv_file_magic_test_file=/lib/libc.so - ;; - siemens) - lt_cv_deplibs_check_method=pass_all - ;; - pc) - lt_cv_deplibs_check_method=pass_all - ;; - esac - ;; - -tpf*) - lt_cv_deplibs_check_method=pass_all - ;; -os2*) - lt_cv_deplibs_check_method=pass_all - ;; -esac - -fi -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $lt_cv_deplibs_check_method" >&5 -printf "%s\n" "$lt_cv_deplibs_check_method" >&6; } - -file_magic_glob= -want_nocaseglob=no -if test "$build" = "$host"; then - case $host_os in - mingw* | pw32*) - if ( shopt | grep nocaseglob ) >/dev/null 2>&1; then - want_nocaseglob=yes - else - file_magic_glob=`echo aAbBcCdDeEfFgGhHiIjJkKlLmMnNoOpPqQrRsStTuUvVwWxXyYzZ | $SED -e "s/\(..\)/s\/[\1]\/[\1]\/g;/g"` - fi - ;; - esac -fi - -file_magic_cmd=$lt_cv_file_magic_cmd -deplibs_check_method=$lt_cv_deplibs_check_method -test -z "$deplibs_check_method" && deplibs_check_method=unknown - - - - - - - - - - - - - - - - - - - - - - -if test -n "$ac_tool_prefix"; then - # Extract the first word of "${ac_tool_prefix}dlltool", so it can be a program name with args. -set dummy ${ac_tool_prefix}dlltool; ac_word=$2 -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -printf %s "checking for $ac_word... " >&6; } -if test ${ac_cv_prog_DLLTOOL+y} -then : - printf %s "(cached) " >&6 -else $as_nop - if test -n "$DLLTOOL"; then - ac_cv_prog_DLLTOOL="$DLLTOOL" # Let the user override the test. -else -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - case $as_dir in #((( - '') as_dir=./ ;; - */) ;; - *) as_dir=$as_dir/ ;; - esac - for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then - ac_cv_prog_DLLTOOL="${ac_tool_prefix}dlltool" - printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 - break 2 - fi -done - done -IFS=$as_save_IFS - -fi -fi -DLLTOOL=$ac_cv_prog_DLLTOOL -if test -n "$DLLTOOL"; then - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $DLLTOOL" >&5 -printf "%s\n" "$DLLTOOL" >&6; } -else - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 -printf "%s\n" "no" >&6; } -fi - - -fi -if test -z "$ac_cv_prog_DLLTOOL"; then - ac_ct_DLLTOOL=$DLLTOOL - # Extract the first word of "dlltool", so it can be a program name with args. -set dummy dlltool; ac_word=$2 -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -printf %s "checking for $ac_word... " >&6; } -if test ${ac_cv_prog_ac_ct_DLLTOOL+y} -then : - printf %s "(cached) " >&6 -else $as_nop - if test -n "$ac_ct_DLLTOOL"; then - ac_cv_prog_ac_ct_DLLTOOL="$ac_ct_DLLTOOL" # Let the user override the test. -else -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - case $as_dir in #((( - '') as_dir=./ ;; - */) ;; - *) as_dir=$as_dir/ ;; - esac - for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then - ac_cv_prog_ac_ct_DLLTOOL="dlltool" - printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 - break 2 - fi -done - done -IFS=$as_save_IFS - -fi -fi -ac_ct_DLLTOOL=$ac_cv_prog_ac_ct_DLLTOOL -if test -n "$ac_ct_DLLTOOL"; then - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_ct_DLLTOOL" >&5 -printf "%s\n" "$ac_ct_DLLTOOL" >&6; } -else - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 -printf "%s\n" "no" >&6; } -fi - - if test "x$ac_ct_DLLTOOL" = x; then - DLLTOOL="false" - else - case $cross_compiling:$ac_tool_warned in -yes:) -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 -printf "%s\n" "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} -ac_tool_warned=yes ;; -esac - DLLTOOL=$ac_ct_DLLTOOL - fi -else - DLLTOOL="$ac_cv_prog_DLLTOOL" -fi - -test -z "$DLLTOOL" && DLLTOOL=dlltool - - - - - - - - - - -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking how to associate runtime and link libraries" >&5 -printf %s "checking how to associate runtime and link libraries... " >&6; } -if test ${lt_cv_sharedlib_from_linklib_cmd+y} -then : - printf %s "(cached) " >&6 -else $as_nop - lt_cv_sharedlib_from_linklib_cmd='unknown' - -case $host_os in -cygwin* | mingw* | pw32* | cegcc*) - # two different shell functions defined in ltmain.sh; - # decide which one to use based on capabilities of $DLLTOOL - case `$DLLTOOL --help 2>&1` in - *--identify-strict*) - lt_cv_sharedlib_from_linklib_cmd=func_cygming_dll_for_implib - ;; - *) - lt_cv_sharedlib_from_linklib_cmd=func_cygming_dll_for_implib_fallback - ;; - esac - ;; -*) - # fallback: assume linklib IS sharedlib - lt_cv_sharedlib_from_linklib_cmd=$ECHO - ;; -esac - -fi -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $lt_cv_sharedlib_from_linklib_cmd" >&5 -printf "%s\n" "$lt_cv_sharedlib_from_linklib_cmd" >&6; } -sharedlib_from_linklib_cmd=$lt_cv_sharedlib_from_linklib_cmd -test -z "$sharedlib_from_linklib_cmd" && sharedlib_from_linklib_cmd=$ECHO - - - - - - - -if test -n "$ac_tool_prefix"; then - for ac_prog in ar - do - # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args. -set dummy $ac_tool_prefix$ac_prog; ac_word=$2 -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -printf %s "checking for $ac_word... " >&6; } -if test ${ac_cv_prog_AR+y} -then : - printf %s "(cached) " >&6 -else $as_nop - if test -n "$AR"; then - ac_cv_prog_AR="$AR" # Let the user override the test. -else -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - case $as_dir in #((( - '') as_dir=./ ;; - */) ;; - *) as_dir=$as_dir/ ;; - esac - for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then - ac_cv_prog_AR="$ac_tool_prefix$ac_prog" - printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 - break 2 - fi -done - done -IFS=$as_save_IFS - -fi -fi -AR=$ac_cv_prog_AR -if test -n "$AR"; then - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $AR" >&5 -printf "%s\n" "$AR" >&6; } -else - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 -printf "%s\n" "no" >&6; } -fi - - - test -n "$AR" && break - done -fi -if test -z "$AR"; then - ac_ct_AR=$AR - for ac_prog in ar -do - # Extract the first word of "$ac_prog", so it can be a program name with args. -set dummy $ac_prog; ac_word=$2 -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -printf %s "checking for $ac_word... " >&6; } -if test ${ac_cv_prog_ac_ct_AR+y} -then : - printf %s "(cached) " >&6 -else $as_nop - if test -n "$ac_ct_AR"; then - ac_cv_prog_ac_ct_AR="$ac_ct_AR" # Let the user override the test. -else -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - case $as_dir in #((( - '') as_dir=./ ;; - */) ;; - *) as_dir=$as_dir/ ;; - esac - for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then - ac_cv_prog_ac_ct_AR="$ac_prog" - printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 - break 2 - fi -done - done -IFS=$as_save_IFS - -fi -fi -ac_ct_AR=$ac_cv_prog_ac_ct_AR -if test -n "$ac_ct_AR"; then - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_ct_AR" >&5 -printf "%s\n" "$ac_ct_AR" >&6; } -else - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 -printf "%s\n" "no" >&6; } -fi - - - test -n "$ac_ct_AR" && break -done - - if test "x$ac_ct_AR" = x; then - AR="false" - else - case $cross_compiling:$ac_tool_warned in -yes:) -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 -printf "%s\n" "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} -ac_tool_warned=yes ;; -esac - AR=$ac_ct_AR - fi -fi - -: ${AR=ar} -: ${AR_FLAGS=cr} - - - - - - - - - - - -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for archiver @FILE support" >&5 -printf %s "checking for archiver @FILE support... " >&6; } -if test ${lt_cv_ar_at_file+y} -then : - printf %s "(cached) " >&6 -else $as_nop - lt_cv_ar_at_file=no - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - -int -main (void) -{ - - ; - return 0; -} -_ACEOF -if ac_fn_cxx_try_compile "$LINENO" -then : - echo conftest.$ac_objext > conftest.lst - lt_ar_try='$AR $AR_FLAGS libconftest.a @conftest.lst >&5' - { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$lt_ar_try\""; } >&5 - (eval $lt_ar_try) 2>&5 - ac_status=$? - printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 - test $ac_status = 0; } - if test 0 -eq "$ac_status"; then - # Ensure the archiver fails upon bogus file names. - rm -f conftest.$ac_objext libconftest.a - { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$lt_ar_try\""; } >&5 - (eval $lt_ar_try) 2>&5 - ac_status=$? - printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 - test $ac_status = 0; } - if test 0 -ne "$ac_status"; then - lt_cv_ar_at_file=@ - fi - fi - rm -f conftest.* libconftest.a - -fi -rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext - -fi -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $lt_cv_ar_at_file" >&5 -printf "%s\n" "$lt_cv_ar_at_file" >&6; } - -if test no = "$lt_cv_ar_at_file"; then - archiver_list_spec= -else - archiver_list_spec=$lt_cv_ar_at_file -fi - - - - - - - -if test -n "$ac_tool_prefix"; then - # Extract the first word of "${ac_tool_prefix}strip", so it can be a program name with args. -set dummy ${ac_tool_prefix}strip; ac_word=$2 -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -printf %s "checking for $ac_word... " >&6; } -if test ${ac_cv_prog_STRIP+y} -then : - printf %s "(cached) " >&6 -else $as_nop - if test -n "$STRIP"; then - ac_cv_prog_STRIP="$STRIP" # Let the user override the test. -else -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - case $as_dir in #((( - '') as_dir=./ ;; - */) ;; - *) as_dir=$as_dir/ ;; - esac - for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then - ac_cv_prog_STRIP="${ac_tool_prefix}strip" - printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 - break 2 - fi -done - done -IFS=$as_save_IFS - -fi -fi -STRIP=$ac_cv_prog_STRIP -if test -n "$STRIP"; then - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $STRIP" >&5 -printf "%s\n" "$STRIP" >&6; } -else - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 -printf "%s\n" "no" >&6; } -fi - - -fi -if test -z "$ac_cv_prog_STRIP"; then - ac_ct_STRIP=$STRIP - # Extract the first word of "strip", so it can be a program name with args. -set dummy strip; ac_word=$2 -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -printf %s "checking for $ac_word... " >&6; } -if test ${ac_cv_prog_ac_ct_STRIP+y} -then : - printf %s "(cached) " >&6 -else $as_nop - if test -n "$ac_ct_STRIP"; then - ac_cv_prog_ac_ct_STRIP="$ac_ct_STRIP" # Let the user override the test. -else -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - case $as_dir in #((( - '') as_dir=./ ;; - */) ;; - *) as_dir=$as_dir/ ;; - esac - for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then - ac_cv_prog_ac_ct_STRIP="strip" - printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 - break 2 - fi -done - done -IFS=$as_save_IFS - -fi -fi -ac_ct_STRIP=$ac_cv_prog_ac_ct_STRIP -if test -n "$ac_ct_STRIP"; then - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_ct_STRIP" >&5 -printf "%s\n" "$ac_ct_STRIP" >&6; } -else - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 -printf "%s\n" "no" >&6; } -fi - - if test "x$ac_ct_STRIP" = x; then - STRIP=":" - else - case $cross_compiling:$ac_tool_warned in -yes:) -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 -printf "%s\n" "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} -ac_tool_warned=yes ;; -esac - STRIP=$ac_ct_STRIP - fi -else - STRIP="$ac_cv_prog_STRIP" -fi - -test -z "$STRIP" && STRIP=: - - - - - - -if test -n "$ac_tool_prefix"; then - # Extract the first word of "${ac_tool_prefix}ranlib", so it can be a program name with args. -set dummy ${ac_tool_prefix}ranlib; ac_word=$2 -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -printf %s "checking for $ac_word... " >&6; } -if test ${ac_cv_prog_RANLIB+y} -then : - printf %s "(cached) " >&6 -else $as_nop - if test -n "$RANLIB"; then - ac_cv_prog_RANLIB="$RANLIB" # Let the user override the test. -else -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - case $as_dir in #((( - '') as_dir=./ ;; - */) ;; - *) as_dir=$as_dir/ ;; - esac - for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then - ac_cv_prog_RANLIB="${ac_tool_prefix}ranlib" - printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 - break 2 - fi -done - done -IFS=$as_save_IFS - -fi -fi -RANLIB=$ac_cv_prog_RANLIB -if test -n "$RANLIB"; then - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $RANLIB" >&5 -printf "%s\n" "$RANLIB" >&6; } -else - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 -printf "%s\n" "no" >&6; } -fi - - -fi -if test -z "$ac_cv_prog_RANLIB"; then - ac_ct_RANLIB=$RANLIB - # Extract the first word of "ranlib", so it can be a program name with args. -set dummy ranlib; ac_word=$2 -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -printf %s "checking for $ac_word... " >&6; } -if test ${ac_cv_prog_ac_ct_RANLIB+y} -then : - printf %s "(cached) " >&6 -else $as_nop - if test -n "$ac_ct_RANLIB"; then - ac_cv_prog_ac_ct_RANLIB="$ac_ct_RANLIB" # Let the user override the test. -else -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - case $as_dir in #((( - '') as_dir=./ ;; - */) ;; - *) as_dir=$as_dir/ ;; - esac - for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then - ac_cv_prog_ac_ct_RANLIB="ranlib" - printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 - break 2 - fi -done - done -IFS=$as_save_IFS - -fi -fi -ac_ct_RANLIB=$ac_cv_prog_ac_ct_RANLIB -if test -n "$ac_ct_RANLIB"; then - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_ct_RANLIB" >&5 -printf "%s\n" "$ac_ct_RANLIB" >&6; } -else - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 -printf "%s\n" "no" >&6; } -fi - - if test "x$ac_ct_RANLIB" = x; then - RANLIB=":" - else - case $cross_compiling:$ac_tool_warned in -yes:) -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 -printf "%s\n" "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} -ac_tool_warned=yes ;; -esac - RANLIB=$ac_ct_RANLIB - fi -else - RANLIB="$ac_cv_prog_RANLIB" -fi - -test -z "$RANLIB" && RANLIB=: - - - - - - -# Determine commands to create old-style static archives. -old_archive_cmds='$AR $AR_FLAGS $oldlib$oldobjs' -old_postinstall_cmds='chmod 644 $oldlib' -old_postuninstall_cmds= - -if test -n "$RANLIB"; then - case $host_os in - bitrig* | openbsd*) - old_postinstall_cmds="$old_postinstall_cmds~\$RANLIB -t \$tool_oldlib" - ;; - *) - old_postinstall_cmds="$old_postinstall_cmds~\$RANLIB \$tool_oldlib" - ;; - esac - old_archive_cmds="$old_archive_cmds~\$RANLIB \$tool_oldlib" -fi - -case $host_os in - darwin*) - lock_old_archive_extraction=yes ;; - *) - lock_old_archive_extraction=no ;; -esac - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -# If no C compiler was specified, use CC. -LTCC=${LTCC-"$CC"} - -# If no C compiler flags were specified, use CFLAGS. -LTCFLAGS=${LTCFLAGS-"$CFLAGS"} - -# Allow CC to be a program name with arguments. -compiler=$CC - - -# Check for command to grab the raw symbol name followed by C symbol from nm. -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking command to parse $NM output from $compiler object" >&5 -printf %s "checking command to parse $NM output from $compiler object... " >&6; } -if test ${lt_cv_sys_global_symbol_pipe+y} -then : - printf %s "(cached) " >&6 -else $as_nop - -# These are sane defaults that work on at least a few old systems. -# [They come from Ultrix. What could be older than Ultrix?!! ;)] - -# Character class describing NM global symbol codes. -symcode='[BCDEGRST]' - -# Regexp to match symbols that can be accessed directly from C. -sympat='\([_A-Za-z][_A-Za-z0-9]*\)' - -# Define system-specific variables. -case $host_os in -aix*) - symcode='[BCDT]' - ;; -cygwin* | mingw* | pw32* | cegcc*) - symcode='[ABCDGISTW]' - ;; -hpux*) - if test ia64 = "$host_cpu"; then - symcode='[ABCDEGRST]' - fi - ;; -irix* | nonstopux*) - symcode='[BCDEGRST]' - ;; -osf*) - symcode='[BCDEGQRST]' - ;; -solaris*) - symcode='[BDRT]' - ;; -sco3.2v5*) - symcode='[DT]' - ;; -sysv4.2uw2*) - symcode='[DT]' - ;; -sysv5* | sco5v6* | unixware* | OpenUNIX*) - symcode='[ABDT]' - ;; -sysv4) - symcode='[DFNSTU]' - ;; -esac - -# If we're using GNU nm, then use its standard symbol codes. -case `$NM -V 2>&1` in -*GNU* | *'with BFD'*) - symcode='[ABCDGIRSTW]' ;; -esac - -if test "$lt_cv_nm_interface" = "MS dumpbin"; then - # Gets list of data symbols to import. - lt_cv_sys_global_symbol_to_import="sed -n -e 's/^I .* \(.*\)$/\1/p'" - # Adjust the below global symbol transforms to fixup imported variables. - lt_cdecl_hook=" -e 's/^I .* \(.*\)$/extern __declspec(dllimport) char \1;/p'" - lt_c_name_hook=" -e 's/^I .* \(.*\)$/ {\"\1\", (void *) 0},/p'" - lt_c_name_lib_hook="\ - -e 's/^I .* \(lib.*\)$/ {\"\1\", (void *) 0},/p'\ - -e 's/^I .* \(.*\)$/ {\"lib\1\", (void *) 0},/p'" -else - # Disable hooks by default. - lt_cv_sys_global_symbol_to_import= - lt_cdecl_hook= - lt_c_name_hook= - lt_c_name_lib_hook= -fi - -# Transform an extracted symbol line into a proper C declaration. -# Some systems (esp. on ia64) link data and code symbols differently, -# so use this general approach. -lt_cv_sys_global_symbol_to_cdecl="sed -n"\ -$lt_cdecl_hook\ -" -e 's/^T .* \(.*\)$/extern int \1();/p'"\ -" -e 's/^$symcode$symcode* .* \(.*\)$/extern char \1;/p'" - -# Transform an extracted symbol line into symbol name and symbol address -lt_cv_sys_global_symbol_to_c_name_address="sed -n"\ -$lt_c_name_hook\ -" -e 's/^: \(.*\) .*$/ {\"\1\", (void *) 0},/p'"\ -" -e 's/^$symcode$symcode* .* \(.*\)$/ {\"\1\", (void *) \&\1},/p'" - -# Transform an extracted symbol line into symbol name with lib prefix and -# symbol address. -lt_cv_sys_global_symbol_to_c_name_address_lib_prefix="sed -n"\ -$lt_c_name_lib_hook\ -" -e 's/^: \(.*\) .*$/ {\"\1\", (void *) 0},/p'"\ -" -e 's/^$symcode$symcode* .* \(lib.*\)$/ {\"\1\", (void *) \&\1},/p'"\ -" -e 's/^$symcode$symcode* .* \(.*\)$/ {\"lib\1\", (void *) \&\1},/p'" - -# Handle CRLF in mingw tool chain -opt_cr= -case $build_os in -mingw*) - opt_cr=`$ECHO 'x\{0,1\}' | tr x '\015'` # option cr in regexp - ;; -esac - -# Try without a prefix underscore, then with it. -for ac_symprfx in "" "_"; do - - # Transform symcode, sympat, and symprfx into a raw symbol and a C symbol. - symxfrm="\\1 $ac_symprfx\\2 \\2" - - # Write the raw and C identifiers. - if test "$lt_cv_nm_interface" = "MS dumpbin"; then - # Fake it for dumpbin and say T for any non-static function, - # D for any global variable and I for any imported variable. - # Also find C++ and __fastcall symbols from MSVC++, - # which start with @ or ?. - lt_cv_sys_global_symbol_pipe="$AWK '"\ -" {last_section=section; section=\$ 3};"\ -" /^COFF SYMBOL TABLE/{for(i in hide) delete hide[i]};"\ -" /Section length .*#relocs.*(pick any)/{hide[last_section]=1};"\ -" /^ *Symbol name *: /{split(\$ 0,sn,\":\"); si=substr(sn[2],2)};"\ -" /^ *Type *: code/{print \"T\",si,substr(si,length(prfx))};"\ -" /^ *Type *: data/{print \"I\",si,substr(si,length(prfx))};"\ -" \$ 0!~/External *\|/{next};"\ -" / 0+ UNDEF /{next}; / UNDEF \([^|]\)*()/{next};"\ -" {if(hide[section]) next};"\ -" {f=\"D\"}; \$ 0~/\(\).*\|/{f=\"T\"};"\ -" {split(\$ 0,a,/\||\r/); split(a[2],s)};"\ -" s[1]~/^[@?]/{print f,s[1],s[1]; next};"\ -" s[1]~prfx {split(s[1],t,\"@\"); print f,t[1],substr(t[1],length(prfx))}"\ -" ' prfx=^$ac_symprfx" - else - lt_cv_sys_global_symbol_pipe="sed -n -e 's/^.*[ ]\($symcode$symcode*\)[ ][ ]*$ac_symprfx$sympat$opt_cr$/$symxfrm/p'" - fi - lt_cv_sys_global_symbol_pipe="$lt_cv_sys_global_symbol_pipe | sed '/ __gnu_lto/d'" - - # Check to see that the pipe works correctly. - pipe_works=no - - rm -f conftest* - cat > conftest.$ac_ext <<_LT_EOF -#ifdef __cplusplus -extern "C" { -#endif -char nm_test_var; -void nm_test_func(void); -void nm_test_func(void){} -#ifdef __cplusplus -} -#endif -int main(){nm_test_var='a';nm_test_func();return(0);} -_LT_EOF - - if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5 - (eval $ac_compile) 2>&5 - ac_status=$? - printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 - test $ac_status = 0; }; then - # Now try to grab the symbols. - nlist=conftest.nm - $ECHO "$as_me:$LINENO: $NM conftest.$ac_objext | $lt_cv_sys_global_symbol_pipe > $nlist" >&5 - if eval "$NM" conftest.$ac_objext \| "$lt_cv_sys_global_symbol_pipe" \> $nlist 2>&5 && test -s "$nlist"; then - # Try sorting and uniquifying the output. - if sort "$nlist" | uniq > "$nlist"T; then - mv -f "$nlist"T "$nlist" - else - rm -f "$nlist"T - fi - - # Make sure that we snagged all the symbols we need. - if $GREP ' nm_test_var$' "$nlist" >/dev/null; then - if $GREP ' nm_test_func$' "$nlist" >/dev/null; then - cat <<_LT_EOF > conftest.$ac_ext -/* Keep this code in sync between libtool.m4, ltmain, lt_system.h, and tests. */ -#if defined _WIN32 || defined __CYGWIN__ || defined _WIN32_WCE -/* DATA imports from DLLs on WIN32 can't be const, because runtime - relocations are performed -- see ld's documentation on pseudo-relocs. */ -# define LT_DLSYM_CONST -#elif defined __osf__ -/* This system does not cope well with relocations in const data. */ -# define LT_DLSYM_CONST -#else -# define LT_DLSYM_CONST const -#endif - -#ifdef __cplusplus -extern "C" { -#endif - -_LT_EOF - # Now generate the symbol file. - eval "$lt_cv_sys_global_symbol_to_cdecl"' < "$nlist" | $GREP -v main >> conftest.$ac_ext' - - cat <<_LT_EOF >> conftest.$ac_ext - -/* The mapping between symbol names and symbols. */ -LT_DLSYM_CONST struct { - const char *name; - void *address; -} -lt__PROGRAM__LTX_preloaded_symbols[] = -{ - { "@PROGRAM@", (void *) 0 }, -_LT_EOF - $SED "s/^$symcode$symcode* .* \(.*\)$/ {\"\1\", (void *) \&\1},/" < "$nlist" | $GREP -v main >> conftest.$ac_ext - cat <<\_LT_EOF >> conftest.$ac_ext - {0, (void *) 0} -}; - -/* This works around a problem in FreeBSD linker */ -#ifdef FREEBSD_WORKAROUND -static const void *lt_preloaded_setup() { - return lt__PROGRAM__LTX_preloaded_symbols; -} -#endif - -#ifdef __cplusplus -} -#endif -_LT_EOF - # Now try linking the two files. - mv conftest.$ac_objext conftstm.$ac_objext - lt_globsym_save_LIBS=$LIBS - lt_globsym_save_CFLAGS=$CFLAGS - LIBS=conftstm.$ac_objext - CFLAGS="$CFLAGS$lt_prog_compiler_no_builtin_flag" - if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_link\""; } >&5 - (eval $ac_link) 2>&5 - ac_status=$? - printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 - test $ac_status = 0; } && test -s conftest$ac_exeext; then - pipe_works=yes - fi - LIBS=$lt_globsym_save_LIBS - CFLAGS=$lt_globsym_save_CFLAGS - else - echo "cannot find nm_test_func in $nlist" >&5 - fi - else - echo "cannot find nm_test_var in $nlist" >&5 - fi - else - echo "cannot run $lt_cv_sys_global_symbol_pipe" >&5 - fi - else - echo "$progname: failed program was:" >&5 - cat conftest.$ac_ext >&5 - fi - rm -rf conftest* conftst* - - # Do not use the global_symbol_pipe unless it works. - if test yes = "$pipe_works"; then - break - else - lt_cv_sys_global_symbol_pipe= - fi -done - -fi - -if test -z "$lt_cv_sys_global_symbol_pipe"; then - lt_cv_sys_global_symbol_to_cdecl= -fi -if test -z "$lt_cv_sys_global_symbol_pipe$lt_cv_sys_global_symbol_to_cdecl"; then - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: failed" >&5 -printf "%s\n" "failed" >&6; } -else - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: ok" >&5 -printf "%s\n" "ok" >&6; } -fi - -# Response file support. -if test "$lt_cv_nm_interface" = "MS dumpbin"; then - nm_file_list_spec='@' -elif $NM --help 2>/dev/null | grep '[@]FILE' >/dev/null; then - nm_file_list_spec='@' -fi - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for sysroot" >&5 -printf %s "checking for sysroot... " >&6; } - -# Check whether --with-sysroot was given. -if test ${with_sysroot+y} -then : - withval=$with_sysroot; -else $as_nop - with_sysroot=no -fi - - -lt_sysroot= -case $with_sysroot in #( - yes) - if test yes = "$GCC"; then - lt_sysroot=`$CC --print-sysroot 2>/dev/null` - fi - ;; #( - /*) - lt_sysroot=`echo "$with_sysroot" | sed -e "$sed_quote_subst"` - ;; #( - no|'') - ;; #( - *) - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $with_sysroot" >&5 -printf "%s\n" "$with_sysroot" >&6; } - as_fn_error $? "The sysroot must be an absolute path." "$LINENO" 5 - ;; -esac - - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: ${lt_sysroot:-no}" >&5 -printf "%s\n" "${lt_sysroot:-no}" >&6; } - - - - - -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for a working dd" >&5 -printf %s "checking for a working dd... " >&6; } -if test ${ac_cv_path_lt_DD+y} -then : - printf %s "(cached) " >&6 -else $as_nop - printf 0123456789abcdef0123456789abcdef >conftest.i -cat conftest.i conftest.i >conftest2.i -: ${lt_DD:=$DD} -if test -z "$lt_DD"; then - ac_path_lt_DD_found=false - # Loop through the user's path and test for each of PROGNAME-LIST - as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - case $as_dir in #((( - '') as_dir=./ ;; - */) ;; - *) as_dir=$as_dir/ ;; - esac - for ac_prog in dd - do - for ac_exec_ext in '' $ac_executable_extensions; do - ac_path_lt_DD="$as_dir$ac_prog$ac_exec_ext" - as_fn_executable_p "$ac_path_lt_DD" || continue -if "$ac_path_lt_DD" bs=32 count=1 conftest.out 2>/dev/null; then - cmp -s conftest.i conftest.out \ - && ac_cv_path_lt_DD="$ac_path_lt_DD" ac_path_lt_DD_found=: -fi - $ac_path_lt_DD_found && break 3 - done - done - done -IFS=$as_save_IFS - if test -z "$ac_cv_path_lt_DD"; then - : - fi -else - ac_cv_path_lt_DD=$lt_DD -fi - -rm -f conftest.i conftest2.i conftest.out -fi -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_lt_DD" >&5 -printf "%s\n" "$ac_cv_path_lt_DD" >&6; } - - -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking how to truncate binary pipes" >&5 -printf %s "checking how to truncate binary pipes... " >&6; } -if test ${lt_cv_truncate_bin+y} -then : - printf %s "(cached) " >&6 -else $as_nop - printf 0123456789abcdef0123456789abcdef >conftest.i -cat conftest.i conftest.i >conftest2.i -lt_cv_truncate_bin= -if "$ac_cv_path_lt_DD" bs=32 count=1 conftest.out 2>/dev/null; then - cmp -s conftest.i conftest.out \ - && lt_cv_truncate_bin="$ac_cv_path_lt_DD bs=4096 count=1" -fi -rm -f conftest.i conftest2.i conftest.out -test -z "$lt_cv_truncate_bin" && lt_cv_truncate_bin="$SED -e 4q" -fi -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $lt_cv_truncate_bin" >&5 -printf "%s\n" "$lt_cv_truncate_bin" >&6; } - - - - - - - -# Calculate cc_basename. Skip known compiler wrappers and cross-prefix. -func_cc_basename () -{ - for cc_temp in $*""; do - case $cc_temp in - compile | *[\\/]compile | ccache | *[\\/]ccache ) ;; - distcc | *[\\/]distcc | purify | *[\\/]purify ) ;; - \-*) ;; - *) break;; - esac - done - func_cc_basename_result=`$ECHO "$cc_temp" | $SED "s%.*/%%; s%^$host_alias-%%"` -} - -# Check whether --enable-libtool-lock was given. -if test ${enable_libtool_lock+y} -then : - enableval=$enable_libtool_lock; -fi - -test no = "$enable_libtool_lock" || enable_libtool_lock=yes - -# Some flags need to be propagated to the compiler or linker for good -# libtool support. -case $host in -ia64-*-hpux*) - # Find out what ABI is being produced by ac_compile, and set mode - # options accordingly. - echo 'int i;' > conftest.$ac_ext - if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5 - (eval $ac_compile) 2>&5 - ac_status=$? - printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 - test $ac_status = 0; }; then - case `/usr/bin/file conftest.$ac_objext` in - *ELF-32*) - HPUX_IA64_MODE=32 - ;; - *ELF-64*) - HPUX_IA64_MODE=64 - ;; - esac - fi - rm -rf conftest* - ;; -*-*-irix6*) - # Find out what ABI is being produced by ac_compile, and set linker - # options accordingly. - echo '#line '$LINENO' "configure"' > conftest.$ac_ext - if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5 - (eval $ac_compile) 2>&5 - ac_status=$? - printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 - test $ac_status = 0; }; then - if test yes = "$lt_cv_prog_gnu_ld"; then - case `/usr/bin/file conftest.$ac_objext` in - *32-bit*) - LD="${LD-ld} -melf32bsmip" - ;; - *N32*) - LD="${LD-ld} -melf32bmipn32" - ;; - *64-bit*) - LD="${LD-ld} -melf64bmip" - ;; - esac - else - case `/usr/bin/file conftest.$ac_objext` in - *32-bit*) - LD="${LD-ld} -32" - ;; - *N32*) - LD="${LD-ld} -n32" - ;; - *64-bit*) - LD="${LD-ld} -64" - ;; - esac - fi - fi - rm -rf conftest* - ;; - -mips64*-*linux*) - # Find out what ABI is being produced by ac_compile, and set linker - # options accordingly. - echo '#line '$LINENO' "configure"' > conftest.$ac_ext - if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5 - (eval $ac_compile) 2>&5 - ac_status=$? - printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 - test $ac_status = 0; }; then - emul=elf - case `/usr/bin/file conftest.$ac_objext` in - *32-bit*) - emul="${emul}32" - ;; - *64-bit*) - emul="${emul}64" - ;; - esac - case `/usr/bin/file conftest.$ac_objext` in - *MSB*) - emul="${emul}btsmip" - ;; - *LSB*) - emul="${emul}ltsmip" - ;; - esac - case `/usr/bin/file conftest.$ac_objext` in - *N32*) - emul="${emul}n32" - ;; - esac - LD="${LD-ld} -m $emul" - fi - rm -rf conftest* - ;; - -x86_64-*kfreebsd*-gnu|x86_64-*linux*|powerpc*-*linux*| \ -s390*-*linux*|s390*-*tpf*|sparc*-*linux*) - # Find out what ABI is being produced by ac_compile, and set linker - # options accordingly. Note that the listed cases only cover the - # situations where additional linker options are needed (such as when - # doing 32-bit compilation for a host where ld defaults to 64-bit, or - # vice versa); the common cases where no linker options are needed do - # not appear in the list. - echo 'int i;' > conftest.$ac_ext - if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5 - (eval $ac_compile) 2>&5 - ac_status=$? - printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 - test $ac_status = 0; }; then - case `/usr/bin/file conftest.o` in - *32-bit*) - case $host in - x86_64-*kfreebsd*-gnu) - LD="${LD-ld} -m elf_i386_fbsd" - ;; - x86_64-*linux*) - case `/usr/bin/file conftest.o` in - *x86-64*) - LD="${LD-ld} -m elf32_x86_64" - ;; - *) - LD="${LD-ld} -m elf_i386" - ;; - esac - ;; - powerpc64le-*linux*) - LD="${LD-ld} -m elf32lppclinux" - ;; - powerpc64-*linux*) - LD="${LD-ld} -m elf32ppclinux" - ;; - s390x-*linux*) - LD="${LD-ld} -m elf_s390" - ;; - sparc64-*linux*) - LD="${LD-ld} -m elf32_sparc" - ;; - esac - ;; - *64-bit*) - case $host in - x86_64-*kfreebsd*-gnu) - LD="${LD-ld} -m elf_x86_64_fbsd" - ;; - x86_64-*linux*) - LD="${LD-ld} -m elf_x86_64" - ;; - powerpcle-*linux*) - LD="${LD-ld} -m elf64lppc" - ;; - powerpc-*linux*) - LD="${LD-ld} -m elf64ppc" - ;; - s390*-*linux*|s390*-*tpf*) - LD="${LD-ld} -m elf64_s390" - ;; - sparc*-*linux*) - LD="${LD-ld} -m elf64_sparc" - ;; - esac - ;; - esac - fi - rm -rf conftest* - ;; - -*-*-sco3.2v5*) - # On SCO OpenServer 5, we need -belf to get full-featured binaries. - SAVE_CFLAGS=$CFLAGS - CFLAGS="$CFLAGS -belf" - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether the C compiler needs -belf" >&5 -printf %s "checking whether the C compiler needs -belf... " >&6; } -if test ${lt_cv_cc_needs_belf+y} -then : - printf %s "(cached) " >&6 -else $as_nop - ac_ext=c -ac_cpp='$CPP $CPPFLAGS' -ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' -ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' -ac_compiler_gnu=$ac_cv_c_compiler_gnu - - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - -int -main (void) -{ - - ; - return 0; -} -_ACEOF -if ac_fn_c_try_link "$LINENO" -then : - lt_cv_cc_needs_belf=yes -else $as_nop - lt_cv_cc_needs_belf=no -fi -rm -f core conftest.err conftest.$ac_objext conftest.beam \ - conftest$ac_exeext conftest.$ac_ext - ac_ext=c -ac_cpp='$CPP $CPPFLAGS' -ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' -ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' -ac_compiler_gnu=$ac_cv_c_compiler_gnu - -fi -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $lt_cv_cc_needs_belf" >&5 -printf "%s\n" "$lt_cv_cc_needs_belf" >&6; } - if test yes != "$lt_cv_cc_needs_belf"; then - # this is probably gcc 2.8.0, egcs 1.0 or newer; no need for -belf - CFLAGS=$SAVE_CFLAGS - fi - ;; -*-*solaris*) - # Find out what ABI is being produced by ac_compile, and set linker - # options accordingly. - echo 'int i;' > conftest.$ac_ext - if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5 - (eval $ac_compile) 2>&5 - ac_status=$? - printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 - test $ac_status = 0; }; then - case `/usr/bin/file conftest.o` in - *64-bit*) - case $lt_cv_prog_gnu_ld in - yes*) - case $host in - i?86-*-solaris*|x86_64-*-solaris*) - LD="${LD-ld} -m elf_x86_64" - ;; - sparc*-*-solaris*) - LD="${LD-ld} -m elf64_sparc" - ;; - esac - # GNU ld 2.21 introduced _sol2 emulations. Use them if available. - if ${LD-ld} -V | grep _sol2 >/dev/null 2>&1; then - LD=${LD-ld}_sol2 - fi - ;; - *) - if ${LD-ld} -64 -r -o conftest2.o conftest.o >/dev/null 2>&1; then - LD="${LD-ld} -64" - fi - ;; - esac - ;; - esac - fi - rm -rf conftest* - ;; -esac - -need_locks=$enable_libtool_lock - -if test -n "$ac_tool_prefix"; then - # Extract the first word of "${ac_tool_prefix}mt", so it can be a program name with args. -set dummy ${ac_tool_prefix}mt; ac_word=$2 -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -printf %s "checking for $ac_word... " >&6; } -if test ${ac_cv_prog_MANIFEST_TOOL+y} -then : - printf %s "(cached) " >&6 -else $as_nop - if test -n "$MANIFEST_TOOL"; then - ac_cv_prog_MANIFEST_TOOL="$MANIFEST_TOOL" # Let the user override the test. -else -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - case $as_dir in #((( - '') as_dir=./ ;; - */) ;; - *) as_dir=$as_dir/ ;; - esac - for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then - ac_cv_prog_MANIFEST_TOOL="${ac_tool_prefix}mt" - printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 - break 2 - fi -done - done -IFS=$as_save_IFS - -fi -fi -MANIFEST_TOOL=$ac_cv_prog_MANIFEST_TOOL -if test -n "$MANIFEST_TOOL"; then - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $MANIFEST_TOOL" >&5 -printf "%s\n" "$MANIFEST_TOOL" >&6; } -else - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 -printf "%s\n" "no" >&6; } -fi - - -fi -if test -z "$ac_cv_prog_MANIFEST_TOOL"; then - ac_ct_MANIFEST_TOOL=$MANIFEST_TOOL - # Extract the first word of "mt", so it can be a program name with args. -set dummy mt; ac_word=$2 -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -printf %s "checking for $ac_word... " >&6; } -if test ${ac_cv_prog_ac_ct_MANIFEST_TOOL+y} -then : - printf %s "(cached) " >&6 -else $as_nop - if test -n "$ac_ct_MANIFEST_TOOL"; then - ac_cv_prog_ac_ct_MANIFEST_TOOL="$ac_ct_MANIFEST_TOOL" # Let the user override the test. -else -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - case $as_dir in #((( - '') as_dir=./ ;; - */) ;; - *) as_dir=$as_dir/ ;; - esac - for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then - ac_cv_prog_ac_ct_MANIFEST_TOOL="mt" - printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 - break 2 - fi -done - done -IFS=$as_save_IFS - -fi -fi -ac_ct_MANIFEST_TOOL=$ac_cv_prog_ac_ct_MANIFEST_TOOL -if test -n "$ac_ct_MANIFEST_TOOL"; then - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_ct_MANIFEST_TOOL" >&5 -printf "%s\n" "$ac_ct_MANIFEST_TOOL" >&6; } -else - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 -printf "%s\n" "no" >&6; } -fi - - if test "x$ac_ct_MANIFEST_TOOL" = x; then - MANIFEST_TOOL=":" - else - case $cross_compiling:$ac_tool_warned in -yes:) -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 -printf "%s\n" "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} -ac_tool_warned=yes ;; -esac - MANIFEST_TOOL=$ac_ct_MANIFEST_TOOL - fi -else - MANIFEST_TOOL="$ac_cv_prog_MANIFEST_TOOL" -fi - -test -z "$MANIFEST_TOOL" && MANIFEST_TOOL=mt -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking if $MANIFEST_TOOL is a manifest tool" >&5 -printf %s "checking if $MANIFEST_TOOL is a manifest tool... " >&6; } -if test ${lt_cv_path_mainfest_tool+y} -then : - printf %s "(cached) " >&6 -else $as_nop - lt_cv_path_mainfest_tool=no - echo "$as_me:$LINENO: $MANIFEST_TOOL '-?'" >&5 - $MANIFEST_TOOL '-?' 2>conftest.err > conftest.out - cat conftest.err >&5 - if $GREP 'Manifest Tool' conftest.out > /dev/null; then - lt_cv_path_mainfest_tool=yes - fi - rm -f conftest* -fi -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $lt_cv_path_mainfest_tool" >&5 -printf "%s\n" "$lt_cv_path_mainfest_tool" >&6; } -if test yes != "$lt_cv_path_mainfest_tool"; then - MANIFEST_TOOL=: -fi - - - - - - - case $host_os in - rhapsody* | darwin*) - if test -n "$ac_tool_prefix"; then - # Extract the first word of "${ac_tool_prefix}dsymutil", so it can be a program name with args. -set dummy ${ac_tool_prefix}dsymutil; ac_word=$2 -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -printf %s "checking for $ac_word... " >&6; } -if test ${ac_cv_prog_DSYMUTIL+y} -then : - printf %s "(cached) " >&6 -else $as_nop - if test -n "$DSYMUTIL"; then - ac_cv_prog_DSYMUTIL="$DSYMUTIL" # Let the user override the test. -else -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - case $as_dir in #((( - '') as_dir=./ ;; - */) ;; - *) as_dir=$as_dir/ ;; - esac - for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then - ac_cv_prog_DSYMUTIL="${ac_tool_prefix}dsymutil" - printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 - break 2 - fi -done - done -IFS=$as_save_IFS - -fi -fi -DSYMUTIL=$ac_cv_prog_DSYMUTIL -if test -n "$DSYMUTIL"; then - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $DSYMUTIL" >&5 -printf "%s\n" "$DSYMUTIL" >&6; } -else - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 -printf "%s\n" "no" >&6; } -fi - - -fi -if test -z "$ac_cv_prog_DSYMUTIL"; then - ac_ct_DSYMUTIL=$DSYMUTIL - # Extract the first word of "dsymutil", so it can be a program name with args. -set dummy dsymutil; ac_word=$2 -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -printf %s "checking for $ac_word... " >&6; } -if test ${ac_cv_prog_ac_ct_DSYMUTIL+y} -then : - printf %s "(cached) " >&6 -else $as_nop - if test -n "$ac_ct_DSYMUTIL"; then - ac_cv_prog_ac_ct_DSYMUTIL="$ac_ct_DSYMUTIL" # Let the user override the test. -else -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - case $as_dir in #((( - '') as_dir=./ ;; - */) ;; - *) as_dir=$as_dir/ ;; - esac - for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then - ac_cv_prog_ac_ct_DSYMUTIL="dsymutil" - printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 - break 2 - fi -done - done -IFS=$as_save_IFS - -fi -fi -ac_ct_DSYMUTIL=$ac_cv_prog_ac_ct_DSYMUTIL -if test -n "$ac_ct_DSYMUTIL"; then - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_ct_DSYMUTIL" >&5 -printf "%s\n" "$ac_ct_DSYMUTIL" >&6; } -else - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 -printf "%s\n" "no" >&6; } -fi - - if test "x$ac_ct_DSYMUTIL" = x; then - DSYMUTIL=":" - else - case $cross_compiling:$ac_tool_warned in -yes:) -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 -printf "%s\n" "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} -ac_tool_warned=yes ;; -esac - DSYMUTIL=$ac_ct_DSYMUTIL - fi -else - DSYMUTIL="$ac_cv_prog_DSYMUTIL" -fi - - if test -n "$ac_tool_prefix"; then - # Extract the first word of "${ac_tool_prefix}nmedit", so it can be a program name with args. -set dummy ${ac_tool_prefix}nmedit; ac_word=$2 -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -printf %s "checking for $ac_word... " >&6; } -if test ${ac_cv_prog_NMEDIT+y} -then : - printf %s "(cached) " >&6 -else $as_nop - if test -n "$NMEDIT"; then - ac_cv_prog_NMEDIT="$NMEDIT" # Let the user override the test. -else -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - case $as_dir in #((( - '') as_dir=./ ;; - */) ;; - *) as_dir=$as_dir/ ;; - esac - for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then - ac_cv_prog_NMEDIT="${ac_tool_prefix}nmedit" - printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 - break 2 - fi -done - done -IFS=$as_save_IFS - -fi -fi -NMEDIT=$ac_cv_prog_NMEDIT -if test -n "$NMEDIT"; then - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $NMEDIT" >&5 -printf "%s\n" "$NMEDIT" >&6; } -else - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 -printf "%s\n" "no" >&6; } -fi - - -fi -if test -z "$ac_cv_prog_NMEDIT"; then - ac_ct_NMEDIT=$NMEDIT - # Extract the first word of "nmedit", so it can be a program name with args. -set dummy nmedit; ac_word=$2 -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -printf %s "checking for $ac_word... " >&6; } -if test ${ac_cv_prog_ac_ct_NMEDIT+y} -then : - printf %s "(cached) " >&6 -else $as_nop - if test -n "$ac_ct_NMEDIT"; then - ac_cv_prog_ac_ct_NMEDIT="$ac_ct_NMEDIT" # Let the user override the test. -else -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - case $as_dir in #((( - '') as_dir=./ ;; - */) ;; - *) as_dir=$as_dir/ ;; - esac - for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then - ac_cv_prog_ac_ct_NMEDIT="nmedit" - printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 - break 2 - fi -done - done -IFS=$as_save_IFS - -fi -fi -ac_ct_NMEDIT=$ac_cv_prog_ac_ct_NMEDIT -if test -n "$ac_ct_NMEDIT"; then - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_ct_NMEDIT" >&5 -printf "%s\n" "$ac_ct_NMEDIT" >&6; } -else - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 -printf "%s\n" "no" >&6; } -fi - - if test "x$ac_ct_NMEDIT" = x; then - NMEDIT=":" - else - case $cross_compiling:$ac_tool_warned in -yes:) -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 -printf "%s\n" "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} -ac_tool_warned=yes ;; -esac - NMEDIT=$ac_ct_NMEDIT - fi -else - NMEDIT="$ac_cv_prog_NMEDIT" -fi - - if test -n "$ac_tool_prefix"; then - # Extract the first word of "${ac_tool_prefix}lipo", so it can be a program name with args. -set dummy ${ac_tool_prefix}lipo; ac_word=$2 -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -printf %s "checking for $ac_word... " >&6; } -if test ${ac_cv_prog_LIPO+y} -then : - printf %s "(cached) " >&6 -else $as_nop - if test -n "$LIPO"; then - ac_cv_prog_LIPO="$LIPO" # Let the user override the test. -else -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - case $as_dir in #((( - '') as_dir=./ ;; - */) ;; - *) as_dir=$as_dir/ ;; - esac - for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then - ac_cv_prog_LIPO="${ac_tool_prefix}lipo" - printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 - break 2 - fi -done - done -IFS=$as_save_IFS - -fi -fi -LIPO=$ac_cv_prog_LIPO -if test -n "$LIPO"; then - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $LIPO" >&5 -printf "%s\n" "$LIPO" >&6; } -else - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 -printf "%s\n" "no" >&6; } -fi - - -fi -if test -z "$ac_cv_prog_LIPO"; then - ac_ct_LIPO=$LIPO - # Extract the first word of "lipo", so it can be a program name with args. -set dummy lipo; ac_word=$2 -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -printf %s "checking for $ac_word... " >&6; } -if test ${ac_cv_prog_ac_ct_LIPO+y} -then : - printf %s "(cached) " >&6 -else $as_nop - if test -n "$ac_ct_LIPO"; then - ac_cv_prog_ac_ct_LIPO="$ac_ct_LIPO" # Let the user override the test. -else -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - case $as_dir in #((( - '') as_dir=./ ;; - */) ;; - *) as_dir=$as_dir/ ;; - esac - for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then - ac_cv_prog_ac_ct_LIPO="lipo" - printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 - break 2 - fi -done - done -IFS=$as_save_IFS - -fi -fi -ac_ct_LIPO=$ac_cv_prog_ac_ct_LIPO -if test -n "$ac_ct_LIPO"; then - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_ct_LIPO" >&5 -printf "%s\n" "$ac_ct_LIPO" >&6; } -else - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 -printf "%s\n" "no" >&6; } -fi - - if test "x$ac_ct_LIPO" = x; then - LIPO=":" - else - case $cross_compiling:$ac_tool_warned in -yes:) -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 -printf "%s\n" "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} -ac_tool_warned=yes ;; -esac - LIPO=$ac_ct_LIPO - fi -else - LIPO="$ac_cv_prog_LIPO" -fi - - if test -n "$ac_tool_prefix"; then - # Extract the first word of "${ac_tool_prefix}otool", so it can be a program name with args. -set dummy ${ac_tool_prefix}otool; ac_word=$2 -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -printf %s "checking for $ac_word... " >&6; } -if test ${ac_cv_prog_OTOOL+y} -then : - printf %s "(cached) " >&6 -else $as_nop - if test -n "$OTOOL"; then - ac_cv_prog_OTOOL="$OTOOL" # Let the user override the test. -else -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - case $as_dir in #((( - '') as_dir=./ ;; - */) ;; - *) as_dir=$as_dir/ ;; - esac - for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then - ac_cv_prog_OTOOL="${ac_tool_prefix}otool" - printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 - break 2 - fi -done - done -IFS=$as_save_IFS - -fi -fi -OTOOL=$ac_cv_prog_OTOOL -if test -n "$OTOOL"; then - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $OTOOL" >&5 -printf "%s\n" "$OTOOL" >&6; } -else - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 -printf "%s\n" "no" >&6; } -fi - - -fi -if test -z "$ac_cv_prog_OTOOL"; then - ac_ct_OTOOL=$OTOOL - # Extract the first word of "otool", so it can be a program name with args. -set dummy otool; ac_word=$2 -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -printf %s "checking for $ac_word... " >&6; } -if test ${ac_cv_prog_ac_ct_OTOOL+y} -then : - printf %s "(cached) " >&6 -else $as_nop - if test -n "$ac_ct_OTOOL"; then - ac_cv_prog_ac_ct_OTOOL="$ac_ct_OTOOL" # Let the user override the test. -else -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - case $as_dir in #((( - '') as_dir=./ ;; - */) ;; - *) as_dir=$as_dir/ ;; - esac - for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then - ac_cv_prog_ac_ct_OTOOL="otool" - printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 - break 2 - fi -done - done -IFS=$as_save_IFS - -fi -fi -ac_ct_OTOOL=$ac_cv_prog_ac_ct_OTOOL -if test -n "$ac_ct_OTOOL"; then - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_ct_OTOOL" >&5 -printf "%s\n" "$ac_ct_OTOOL" >&6; } -else - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 -printf "%s\n" "no" >&6; } -fi - - if test "x$ac_ct_OTOOL" = x; then - OTOOL=":" - else - case $cross_compiling:$ac_tool_warned in -yes:) -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 -printf "%s\n" "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} -ac_tool_warned=yes ;; -esac - OTOOL=$ac_ct_OTOOL - fi -else - OTOOL="$ac_cv_prog_OTOOL" -fi - - if test -n "$ac_tool_prefix"; then - # Extract the first word of "${ac_tool_prefix}otool64", so it can be a program name with args. -set dummy ${ac_tool_prefix}otool64; ac_word=$2 -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -printf %s "checking for $ac_word... " >&6; } -if test ${ac_cv_prog_OTOOL64+y} -then : - printf %s "(cached) " >&6 -else $as_nop - if test -n "$OTOOL64"; then - ac_cv_prog_OTOOL64="$OTOOL64" # Let the user override the test. -else -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - case $as_dir in #((( - '') as_dir=./ ;; - */) ;; - *) as_dir=$as_dir/ ;; - esac - for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then - ac_cv_prog_OTOOL64="${ac_tool_prefix}otool64" - printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 - break 2 - fi -done - done -IFS=$as_save_IFS - -fi -fi -OTOOL64=$ac_cv_prog_OTOOL64 -if test -n "$OTOOL64"; then - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $OTOOL64" >&5 -printf "%s\n" "$OTOOL64" >&6; } -else - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 -printf "%s\n" "no" >&6; } -fi - - -fi -if test -z "$ac_cv_prog_OTOOL64"; then - ac_ct_OTOOL64=$OTOOL64 - # Extract the first word of "otool64", so it can be a program name with args. -set dummy otool64; ac_word=$2 -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -printf %s "checking for $ac_word... " >&6; } -if test ${ac_cv_prog_ac_ct_OTOOL64+y} -then : - printf %s "(cached) " >&6 -else $as_nop - if test -n "$ac_ct_OTOOL64"; then - ac_cv_prog_ac_ct_OTOOL64="$ac_ct_OTOOL64" # Let the user override the test. -else -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - case $as_dir in #((( - '') as_dir=./ ;; - */) ;; - *) as_dir=$as_dir/ ;; - esac - for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then - ac_cv_prog_ac_ct_OTOOL64="otool64" - printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 - break 2 - fi -done - done -IFS=$as_save_IFS - -fi -fi -ac_ct_OTOOL64=$ac_cv_prog_ac_ct_OTOOL64 -if test -n "$ac_ct_OTOOL64"; then - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_ct_OTOOL64" >&5 -printf "%s\n" "$ac_ct_OTOOL64" >&6; } -else - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 -printf "%s\n" "no" >&6; } -fi - - if test "x$ac_ct_OTOOL64" = x; then - OTOOL64=":" - else - case $cross_compiling:$ac_tool_warned in -yes:) -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 -printf "%s\n" "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} -ac_tool_warned=yes ;; -esac - OTOOL64=$ac_ct_OTOOL64 - fi -else - OTOOL64="$ac_cv_prog_OTOOL64" -fi - - - - - - - - - - - - - - - - - - - - - - - - - - - - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for -single_module linker flag" >&5 -printf %s "checking for -single_module linker flag... " >&6; } -if test ${lt_cv_apple_cc_single_mod+y} -then : - printf %s "(cached) " >&6 -else $as_nop - lt_cv_apple_cc_single_mod=no - if test -z "$LT_MULTI_MODULE"; then - # By default we will add the -single_module flag. You can override - # by either setting the environment variable LT_MULTI_MODULE - # non-empty at configure time, or by adding -multi_module to the - # link flags. - rm -rf libconftest.dylib* - echo "int foo(void){return 1;}" > conftest.c - echo "$LTCC $LTCFLAGS $LDFLAGS -o libconftest.dylib \ --dynamiclib -Wl,-single_module conftest.c" >&5 - $LTCC $LTCFLAGS $LDFLAGS -o libconftest.dylib \ - -dynamiclib -Wl,-single_module conftest.c 2>conftest.err - _lt_result=$? - # If there is a non-empty error log, and "single_module" - # appears in it, assume the flag caused a linker warning - if test -s conftest.err && $GREP single_module conftest.err; then - cat conftest.err >&5 - # Otherwise, if the output was created with a 0 exit code from - # the compiler, it worked. - elif test -f libconftest.dylib && test 0 = "$_lt_result"; then - lt_cv_apple_cc_single_mod=yes - else - cat conftest.err >&5 - fi - rm -rf libconftest.dylib* - rm -f conftest.* - fi -fi -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $lt_cv_apple_cc_single_mod" >&5 -printf "%s\n" "$lt_cv_apple_cc_single_mod" >&6; } - - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for -exported_symbols_list linker flag" >&5 -printf %s "checking for -exported_symbols_list linker flag... " >&6; } -if test ${lt_cv_ld_exported_symbols_list+y} -then : - printf %s "(cached) " >&6 -else $as_nop - lt_cv_ld_exported_symbols_list=no - save_LDFLAGS=$LDFLAGS - echo "_main" > conftest.sym - LDFLAGS="$LDFLAGS -Wl,-exported_symbols_list,conftest.sym" - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - -int -main (void) -{ - - ; - return 0; -} -_ACEOF -if ac_fn_c_try_link "$LINENO" -then : - lt_cv_ld_exported_symbols_list=yes -else $as_nop - lt_cv_ld_exported_symbols_list=no -fi -rm -f core conftest.err conftest.$ac_objext conftest.beam \ - conftest$ac_exeext conftest.$ac_ext - LDFLAGS=$save_LDFLAGS - -fi -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $lt_cv_ld_exported_symbols_list" >&5 -printf "%s\n" "$lt_cv_ld_exported_symbols_list" >&6; } - - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for -force_load linker flag" >&5 -printf %s "checking for -force_load linker flag... " >&6; } -if test ${lt_cv_ld_force_load+y} -then : - printf %s "(cached) " >&6 -else $as_nop - lt_cv_ld_force_load=no - cat > conftest.c << _LT_EOF -int forced_loaded() { return 2;} -_LT_EOF - echo "$LTCC $LTCFLAGS -c -o conftest.o conftest.c" >&5 - $LTCC $LTCFLAGS -c -o conftest.o conftest.c 2>&5 - echo "$AR cr libconftest.a conftest.o" >&5 - $AR cr libconftest.a conftest.o 2>&5 - echo "$RANLIB libconftest.a" >&5 - $RANLIB libconftest.a 2>&5 - cat > conftest.c << _LT_EOF -int main() { return 0;} -_LT_EOF - echo "$LTCC $LTCFLAGS $LDFLAGS -o conftest conftest.c -Wl,-force_load,./libconftest.a" >&5 - $LTCC $LTCFLAGS $LDFLAGS -o conftest conftest.c -Wl,-force_load,./libconftest.a 2>conftest.err - _lt_result=$? - if test -s conftest.err && $GREP force_load conftest.err; then - cat conftest.err >&5 - elif test -f conftest && test 0 = "$_lt_result" && $GREP forced_load conftest >/dev/null 2>&1; then - lt_cv_ld_force_load=yes - else - cat conftest.err >&5 - fi - rm -f conftest.err libconftest.a conftest conftest.c - rm -rf conftest.dSYM - -fi -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $lt_cv_ld_force_load" >&5 -printf "%s\n" "$lt_cv_ld_force_load" >&6; } - case $host_os in - rhapsody* | darwin1.[012]) - _lt_dar_allow_undefined='$wl-undefined ${wl}suppress' ;; - darwin1.*) - _lt_dar_allow_undefined='$wl-flat_namespace $wl-undefined ${wl}suppress' ;; - darwin*) # darwin 5.x on - # if running on 10.5 or later, the deployment target defaults - # to the OS version, if on x86, and 10.4, the deployment - # target defaults to 10.4. Don't you love it? - case ${MACOSX_DEPLOYMENT_TARGET-10.0},$host in - 10.0,*86*-darwin8*|10.0,*-darwin[912]*) - _lt_dar_allow_undefined='$wl-undefined ${wl}dynamic_lookup' ;; - 10.[012][,.]*) - _lt_dar_allow_undefined='$wl-flat_namespace $wl-undefined ${wl}suppress' ;; - 10.*|11.*) - _lt_dar_allow_undefined='$wl-undefined ${wl}dynamic_lookup' ;; - esac - ;; - esac - if test yes = "$lt_cv_apple_cc_single_mod"; then - _lt_dar_single_mod='$single_module' - fi - if test yes = "$lt_cv_ld_exported_symbols_list"; then - _lt_dar_export_syms=' $wl-exported_symbols_list,$output_objdir/$libname-symbols.expsym' - else - _lt_dar_export_syms='~$NMEDIT -s $output_objdir/$libname-symbols.expsym $lib' - fi - if test : != "$DSYMUTIL" && test no = "$lt_cv_ld_force_load"; then - _lt_dsymutil='~$DSYMUTIL $lib || :' - else - _lt_dsymutil= - fi - ;; - esac - -# func_munge_path_list VARIABLE PATH -# ----------------------------------- -# VARIABLE is name of variable containing _space_ separated list of -# directories to be munged by the contents of PATH, which is string -# having a format: -# "DIR[:DIR]:" -# string "DIR[ DIR]" will be prepended to VARIABLE -# ":DIR[:DIR]" -# string "DIR[ DIR]" will be appended to VARIABLE -# "DIRP[:DIRP]::[DIRA:]DIRA" -# string "DIRP[ DIRP]" will be prepended to VARIABLE and string -# "DIRA[ DIRA]" will be appended to VARIABLE -# "DIR[:DIR]" -# VARIABLE will be replaced by "DIR[ DIR]" -func_munge_path_list () -{ - case x$2 in - x) - ;; - *:) - eval $1=\"`$ECHO $2 | $SED 's/:/ /g'` \$$1\" - ;; - x:*) - eval $1=\"\$$1 `$ECHO $2 | $SED 's/:/ /g'`\" - ;; - *::*) - eval $1=\"\$$1\ `$ECHO $2 | $SED -e 's/.*:://' -e 's/:/ /g'`\" - eval $1=\"`$ECHO $2 | $SED -e 's/::.*//' -e 's/:/ /g'`\ \$$1\" - ;; - *) - eval $1=\"`$ECHO $2 | $SED 's/:/ /g'`\" - ;; - esac -} - -ac_fn_c_check_header_compile "$LINENO" "dlfcn.h" "ac_cv_header_dlfcn_h" "$ac_includes_default -" -if test "x$ac_cv_header_dlfcn_h" = xyes -then : - printf "%s\n" "#define HAVE_DLFCN_H 1" >>confdefs.h - -fi - - - -func_stripname_cnf () -{ - case $2 in - .*) func_stripname_result=`$ECHO "$3" | $SED "s%^$1%%; s%\\\\$2\$%%"`;; - *) func_stripname_result=`$ECHO "$3" | $SED "s%^$1%%; s%$2\$%%"`;; - esac -} # func_stripname_cnf - - - - - -# Set options - - - - enable_dlopen=no - - - enable_win32_dll=no - - - # Check whether --enable-shared was given. -if test ${enable_shared+y} -then : - enableval=$enable_shared; p=${PACKAGE-default} - case $enableval in - yes) enable_shared=yes ;; - no) enable_shared=no ;; - *) - enable_shared=no - # Look at the argument we got. We use all the common list separators. - lt_save_ifs=$IFS; IFS=$IFS$PATH_SEPARATOR, - for pkg in $enableval; do - IFS=$lt_save_ifs - if test "X$pkg" = "X$p"; then - enable_shared=yes - fi - done - IFS=$lt_save_ifs - ;; - esac -else $as_nop - enable_shared=yes -fi - - - - - - - - - - # Check whether --enable-static was given. -if test ${enable_static+y} -then : - enableval=$enable_static; p=${PACKAGE-default} - case $enableval in - yes) enable_static=yes ;; - no) enable_static=no ;; - *) - enable_static=no - # Look at the argument we got. We use all the common list separators. - lt_save_ifs=$IFS; IFS=$IFS$PATH_SEPARATOR, - for pkg in $enableval; do - IFS=$lt_save_ifs - if test "X$pkg" = "X$p"; then - enable_static=yes - fi - done - IFS=$lt_save_ifs - ;; - esac -else $as_nop - enable_static=yes -fi - - - - - - - - - - -# Check whether --with-pic was given. -if test ${with_pic+y} -then : - withval=$with_pic; lt_p=${PACKAGE-default} - case $withval in - yes|no) pic_mode=$withval ;; - *) - pic_mode=default - # Look at the argument we got. We use all the common list separators. - lt_save_ifs=$IFS; IFS=$IFS$PATH_SEPARATOR, - for lt_pkg in $withval; do - IFS=$lt_save_ifs - if test "X$lt_pkg" = "X$lt_p"; then - pic_mode=yes - fi - done - IFS=$lt_save_ifs - ;; - esac -else $as_nop - pic_mode=default -fi - - - - - - - - - # Check whether --enable-fast-install was given. -if test ${enable_fast_install+y} -then : - enableval=$enable_fast_install; p=${PACKAGE-default} - case $enableval in - yes) enable_fast_install=yes ;; - no) enable_fast_install=no ;; - *) - enable_fast_install=no - # Look at the argument we got. We use all the common list separators. - lt_save_ifs=$IFS; IFS=$IFS$PATH_SEPARATOR, - for pkg in $enableval; do - IFS=$lt_save_ifs - if test "X$pkg" = "X$p"; then - enable_fast_install=yes - fi - done - IFS=$lt_save_ifs - ;; - esac -else $as_nop - enable_fast_install=yes -fi - - - - - - - - - shared_archive_member_spec= -case $host,$enable_shared in -power*-*-aix[5-9]*,yes) - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking which variant of shared library versioning to provide" >&5 -printf %s "checking which variant of shared library versioning to provide... " >&6; } - -# Check whether --with-aix-soname was given. -if test ${with_aix_soname+y} -then : - withval=$with_aix_soname; case $withval in - aix|svr4|both) - ;; - *) - as_fn_error $? "Unknown argument to --with-aix-soname" "$LINENO" 5 - ;; - esac - lt_cv_with_aix_soname=$with_aix_soname -else $as_nop - if test ${lt_cv_with_aix_soname+y} -then : - printf %s "(cached) " >&6 -else $as_nop - lt_cv_with_aix_soname=aix -fi - - with_aix_soname=$lt_cv_with_aix_soname -fi - - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $with_aix_soname" >&5 -printf "%s\n" "$with_aix_soname" >&6; } - if test aix != "$with_aix_soname"; then - # For the AIX way of multilib, we name the shared archive member - # based on the bitwidth used, traditionally 'shr.o' or 'shr_64.o', - # and 'shr.imp' or 'shr_64.imp', respectively, for the Import File. - # Even when GNU compilers ignore OBJECT_MODE but need '-maix64' flag, - # the AIX toolchain works better with OBJECT_MODE set (default 32). - if test 64 = "${OBJECT_MODE-32}"; then - shared_archive_member_spec=shr_64 - else - shared_archive_member_spec=shr - fi - fi - ;; -*) - with_aix_soname=aix - ;; -esac - - - - - - - - - - -# This can be used to rebuild libtool when needed -LIBTOOL_DEPS=$ltmain - -# Always use our own libtool. -LIBTOOL='$(SHELL) $(top_builddir)/libtool' - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -test -z "$LN_S" && LN_S="ln -s" - - - - - - - - - - - - - - -if test -n "${ZSH_VERSION+set}"; then - setopt NO_GLOB_SUBST -fi - -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for objdir" >&5 -printf %s "checking for objdir... " >&6; } -if test ${lt_cv_objdir+y} -then : - printf %s "(cached) " >&6 -else $as_nop - rm -f .libs 2>/dev/null -mkdir .libs 2>/dev/null -if test -d .libs; then - lt_cv_objdir=.libs -else - # MS-DOS does not allow filenames that begin with a dot. - lt_cv_objdir=_libs -fi -rmdir .libs 2>/dev/null -fi -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $lt_cv_objdir" >&5 -printf "%s\n" "$lt_cv_objdir" >&6; } -objdir=$lt_cv_objdir - - - - - -printf "%s\n" "#define LT_OBJDIR \"$lt_cv_objdir/\"" >>confdefs.h - - - - -case $host_os in -aix3*) - # AIX sometimes has problems with the GCC collect2 program. For some - # reason, if we set the COLLECT_NAMES environment variable, the problems - # vanish in a puff of smoke. - if test set != "${COLLECT_NAMES+set}"; then - COLLECT_NAMES= - export COLLECT_NAMES - fi - ;; -esac - -# Global variables: -ofile=libtool -can_build_shared=yes - -# All known linkers require a '.a' archive for static linking (except MSVC, -# which needs '.lib'). -libext=a - -with_gnu_ld=$lt_cv_prog_gnu_ld - -old_CC=$CC -old_CFLAGS=$CFLAGS - -# Set sane defaults for various variables -test -z "$CC" && CC=cc -test -z "$LTCC" && LTCC=$CC -test -z "$LTCFLAGS" && LTCFLAGS=$CFLAGS -test -z "$LD" && LD=ld -test -z "$ac_objext" && ac_objext=o - -func_cc_basename $compiler -cc_basename=$func_cc_basename_result - - -# Only perform the check for file, if the check method requires it -test -z "$MAGIC_CMD" && MAGIC_CMD=file -case $deplibs_check_method in -file_magic*) - if test "$file_magic_cmd" = '$MAGIC_CMD'; then - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for ${ac_tool_prefix}file" >&5 -printf %s "checking for ${ac_tool_prefix}file... " >&6; } -if test ${lt_cv_path_MAGIC_CMD+y} -then : - printf %s "(cached) " >&6 -else $as_nop - case $MAGIC_CMD in -[\\/*] | ?:[\\/]*) - lt_cv_path_MAGIC_CMD=$MAGIC_CMD # Let the user override the test with a path. - ;; -*) - lt_save_MAGIC_CMD=$MAGIC_CMD - lt_save_ifs=$IFS; IFS=$PATH_SEPARATOR - ac_dummy="/usr/bin$PATH_SEPARATOR$PATH" - for ac_dir in $ac_dummy; do - IFS=$lt_save_ifs - test -z "$ac_dir" && ac_dir=. - if test -f "$ac_dir/${ac_tool_prefix}file"; then - lt_cv_path_MAGIC_CMD=$ac_dir/"${ac_tool_prefix}file" - if test -n "$file_magic_test_file"; then - case $deplibs_check_method in - "file_magic "*) - file_magic_regex=`expr "$deplibs_check_method" : "file_magic \(.*\)"` - MAGIC_CMD=$lt_cv_path_MAGIC_CMD - if eval $file_magic_cmd \$file_magic_test_file 2> /dev/null | - $EGREP "$file_magic_regex" > /dev/null; then - : - else - cat <<_LT_EOF 1>&2 - -*** Warning: the command libtool uses to detect shared libraries, -*** $file_magic_cmd, produces output that libtool cannot recognize. -*** The result is that libtool may fail to recognize shared libraries -*** as such. This will affect the creation of libtool libraries that -*** depend on shared libraries, but programs linked with such libtool -*** libraries will work regardless of this problem. Nevertheless, you -*** may want to report the problem to your system manager and/or to -*** bug-libtool@gnu.org - -_LT_EOF - fi ;; - esac - fi - break - fi - done - IFS=$lt_save_ifs - MAGIC_CMD=$lt_save_MAGIC_CMD - ;; -esac -fi - -MAGIC_CMD=$lt_cv_path_MAGIC_CMD -if test -n "$MAGIC_CMD"; then - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $MAGIC_CMD" >&5 -printf "%s\n" "$MAGIC_CMD" >&6; } -else - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 -printf "%s\n" "no" >&6; } -fi - - - - - -if test -z "$lt_cv_path_MAGIC_CMD"; then - if test -n "$ac_tool_prefix"; then - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for file" >&5 -printf %s "checking for file... " >&6; } -if test ${lt_cv_path_MAGIC_CMD+y} -then : - printf %s "(cached) " >&6 -else $as_nop - case $MAGIC_CMD in -[\\/*] | ?:[\\/]*) - lt_cv_path_MAGIC_CMD=$MAGIC_CMD # Let the user override the test with a path. - ;; -*) - lt_save_MAGIC_CMD=$MAGIC_CMD - lt_save_ifs=$IFS; IFS=$PATH_SEPARATOR - ac_dummy="/usr/bin$PATH_SEPARATOR$PATH" - for ac_dir in $ac_dummy; do - IFS=$lt_save_ifs - test -z "$ac_dir" && ac_dir=. - if test -f "$ac_dir/file"; then - lt_cv_path_MAGIC_CMD=$ac_dir/"file" - if test -n "$file_magic_test_file"; then - case $deplibs_check_method in - "file_magic "*) - file_magic_regex=`expr "$deplibs_check_method" : "file_magic \(.*\)"` - MAGIC_CMD=$lt_cv_path_MAGIC_CMD - if eval $file_magic_cmd \$file_magic_test_file 2> /dev/null | - $EGREP "$file_magic_regex" > /dev/null; then - : - else - cat <<_LT_EOF 1>&2 - -*** Warning: the command libtool uses to detect shared libraries, -*** $file_magic_cmd, produces output that libtool cannot recognize. -*** The result is that libtool may fail to recognize shared libraries -*** as such. This will affect the creation of libtool libraries that -*** depend on shared libraries, but programs linked with such libtool -*** libraries will work regardless of this problem. Nevertheless, you -*** may want to report the problem to your system manager and/or to -*** bug-libtool@gnu.org - -_LT_EOF - fi ;; - esac - fi - break - fi - done - IFS=$lt_save_ifs - MAGIC_CMD=$lt_save_MAGIC_CMD - ;; -esac -fi - -MAGIC_CMD=$lt_cv_path_MAGIC_CMD -if test -n "$MAGIC_CMD"; then - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $MAGIC_CMD" >&5 -printf "%s\n" "$MAGIC_CMD" >&6; } -else - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 -printf "%s\n" "no" >&6; } -fi - - - else - MAGIC_CMD=: - fi -fi - - fi - ;; -esac - -# Use C for the default configuration in the libtool script - -lt_save_CC=$CC -ac_ext=c -ac_cpp='$CPP $CPPFLAGS' -ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' -ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' -ac_compiler_gnu=$ac_cv_c_compiler_gnu - - -# Source file extension for C test sources. -ac_ext=c - -# Object file extension for compiled C test sources. -objext=o -objext=$objext - -# Code to be used in simple compile tests -lt_simple_compile_test_code="int some_variable = 0;" - -# Code to be used in simple link tests -lt_simple_link_test_code='int main(){return(0);}' - - - - - - - -# If no C compiler was specified, use CC. -LTCC=${LTCC-"$CC"} - -# If no C compiler flags were specified, use CFLAGS. -LTCFLAGS=${LTCFLAGS-"$CFLAGS"} - -# Allow CC to be a program name with arguments. -compiler=$CC - -# Save the default compiler, since it gets overwritten when the other -# tags are being tested, and _LT_TAGVAR(compiler, []) is a NOP. -compiler_DEFAULT=$CC - -# save warnings/boilerplate of simple test code -ac_outfile=conftest.$ac_objext -echo "$lt_simple_compile_test_code" >conftest.$ac_ext -eval "$ac_compile" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err -_lt_compiler_boilerplate=`cat conftest.err` -$RM conftest* - -ac_outfile=conftest.$ac_objext -echo "$lt_simple_link_test_code" >conftest.$ac_ext -eval "$ac_link" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err -_lt_linker_boilerplate=`cat conftest.err` -$RM -r conftest* - - -## CAVEAT EMPTOR: -## There is no encapsulation within the following macros, do not change -## the running order or otherwise move them around unless you know exactly -## what you are doing... -if test -n "$compiler"; then - -lt_prog_compiler_no_builtin_flag= - -if test yes = "$GCC"; then - case $cc_basename in - nvcc*) - lt_prog_compiler_no_builtin_flag=' -Xcompiler -fno-builtin' ;; - *) - lt_prog_compiler_no_builtin_flag=' -fno-builtin' ;; - esac - - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking if $compiler supports -fno-rtti -fno-exceptions" >&5 -printf %s "checking if $compiler supports -fno-rtti -fno-exceptions... " >&6; } -if test ${lt_cv_prog_compiler_rtti_exceptions+y} -then : - printf %s "(cached) " >&6 -else $as_nop - lt_cv_prog_compiler_rtti_exceptions=no - ac_outfile=conftest.$ac_objext - echo "$lt_simple_compile_test_code" > conftest.$ac_ext - lt_compiler_flag="-fno-rtti -fno-exceptions" ## exclude from sc_useless_quotes_in_assignment - # Insert the option either (1) after the last *FLAGS variable, or - # (2) before a word containing "conftest.", or (3) at the end. - # Note that $ac_compile itself does not contain backslashes and begins - # with a dollar sign (not a hyphen), so the echo should work correctly. - # The option is referenced via a variable to avoid confusing sed. - lt_compile=`echo "$ac_compile" | $SED \ - -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ - -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ - -e 's:$: $lt_compiler_flag:'` - (eval echo "\"\$as_me:$LINENO: $lt_compile\"" >&5) - (eval "$lt_compile" 2>conftest.err) - ac_status=$? - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - if (exit $ac_status) && test -s "$ac_outfile"; then - # The compiler can only warn and ignore the option if not recognized - # So say no if there are warnings other than the usual output. - $ECHO "$_lt_compiler_boilerplate" | $SED '/^$/d' >conftest.exp - $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2 - if test ! -s conftest.er2 || diff conftest.exp conftest.er2 >/dev/null; then - lt_cv_prog_compiler_rtti_exceptions=yes - fi - fi - $RM conftest* - -fi -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_rtti_exceptions" >&5 -printf "%s\n" "$lt_cv_prog_compiler_rtti_exceptions" >&6; } - -if test yes = "$lt_cv_prog_compiler_rtti_exceptions"; then - lt_prog_compiler_no_builtin_flag="$lt_prog_compiler_no_builtin_flag -fno-rtti -fno-exceptions" -else - : -fi - -fi - - - - - - - lt_prog_compiler_wl= -lt_prog_compiler_pic= -lt_prog_compiler_static= - - - if test yes = "$GCC"; then - lt_prog_compiler_wl='-Wl,' - lt_prog_compiler_static='-static' - - case $host_os in - aix*) - # All AIX code is PIC. - if test ia64 = "$host_cpu"; then - # AIX 5 now supports IA64 processor - lt_prog_compiler_static='-Bstatic' - fi - lt_prog_compiler_pic='-fPIC' - ;; - - amigaos*) - case $host_cpu in - powerpc) - # see comment about AmigaOS4 .so support - lt_prog_compiler_pic='-fPIC' - ;; - m68k) - # FIXME: we need at least 68020 code to build shared libraries, but - # adding the '-m68020' flag to GCC prevents building anything better, - # like '-m68040'. - lt_prog_compiler_pic='-m68020 -resident32 -malways-restore-a4' - ;; - esac - ;; - - beos* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*) - # PIC is the default for these OSes. - ;; - - mingw* | cygwin* | pw32* | os2* | cegcc*) - # This hack is so that the source file can tell whether it is being - # built for inclusion in a dll (and should export symbols for example). - # Although the cygwin gcc ignores -fPIC, still need this for old-style - # (--disable-auto-import) libraries - lt_prog_compiler_pic='-DDLL_EXPORT' - case $host_os in - os2*) - lt_prog_compiler_static='$wl-static' - ;; - esac - ;; - - darwin* | rhapsody*) - # PIC is the default on this platform - # Common symbols not allowed in MH_DYLIB files - lt_prog_compiler_pic='-fno-common' - ;; - - haiku*) - # PIC is the default for Haiku. - # The "-static" flag exists, but is broken. - lt_prog_compiler_static= - ;; - - hpux*) - # PIC is the default for 64-bit PA HP-UX, but not for 32-bit - # PA HP-UX. On IA64 HP-UX, PIC is the default but the pic flag - # sets the default TLS model and affects inlining. - case $host_cpu in - hppa*64*) - # +Z the default - ;; - *) - lt_prog_compiler_pic='-fPIC' - ;; - esac - ;; - - interix[3-9]*) - # Interix 3.x gcc -fpic/-fPIC options generate broken code. - # Instead, we relocate shared libraries at runtime. - ;; - - msdosdjgpp*) - # Just because we use GCC doesn't mean we suddenly get shared libraries - # on systems that don't support them. - lt_prog_compiler_can_build_shared=no - enable_shared=no - ;; - - *nto* | *qnx*) - # QNX uses GNU C++, but need to define -shared option too, otherwise - # it will coredump. - lt_prog_compiler_pic='-fPIC -shared' - ;; - - sysv4*MP*) - if test -d /usr/nec; then - lt_prog_compiler_pic=-Kconform_pic - fi - ;; - - *) - lt_prog_compiler_pic='-fPIC' - ;; - esac - - case $cc_basename in - nvcc*) # Cuda Compiler Driver 2.2 - lt_prog_compiler_wl='-Xlinker ' - if test -n "$lt_prog_compiler_pic"; then - lt_prog_compiler_pic="-Xcompiler $lt_prog_compiler_pic" - fi - ;; - esac - else - # PORTME Check for flag to pass linker flags through the system compiler. - case $host_os in - aix*) - lt_prog_compiler_wl='-Wl,' - if test ia64 = "$host_cpu"; then - # AIX 5 now supports IA64 processor - lt_prog_compiler_static='-Bstatic' - else - lt_prog_compiler_static='-bnso -bI:/lib/syscalls.exp' - fi - ;; - - darwin* | rhapsody*) - # PIC is the default on this platform - # Common symbols not allowed in MH_DYLIB files - lt_prog_compiler_pic='-fno-common' - case $cc_basename in - nagfor*) - # NAG Fortran compiler - lt_prog_compiler_wl='-Wl,-Wl,,' - lt_prog_compiler_pic='-PIC' - lt_prog_compiler_static='-Bstatic' - ;; - esac - ;; - - mingw* | cygwin* | pw32* | os2* | cegcc*) - # This hack is so that the source file can tell whether it is being - # built for inclusion in a dll (and should export symbols for example). - lt_prog_compiler_pic='-DDLL_EXPORT' - case $host_os in - os2*) - lt_prog_compiler_static='$wl-static' - ;; - esac - ;; - - hpux9* | hpux10* | hpux11*) - lt_prog_compiler_wl='-Wl,' - # PIC is the default for IA64 HP-UX and 64-bit HP-UX, but - # not for PA HP-UX. - case $host_cpu in - hppa*64*|ia64*) - # +Z the default - ;; - *) - lt_prog_compiler_pic='+Z' - ;; - esac - # Is there a better lt_prog_compiler_static that works with the bundled CC? - lt_prog_compiler_static='$wl-a ${wl}archive' - ;; - - irix5* | irix6* | nonstopux*) - lt_prog_compiler_wl='-Wl,' - # PIC (with -KPIC) is the default. - lt_prog_compiler_static='-non_shared' - ;; - - linux* | k*bsd*-gnu | kopensolaris*-gnu | gnu*) - case $cc_basename in - # old Intel for x86_64, which still supported -KPIC. - ecc*) - lt_prog_compiler_wl='-Wl,' - lt_prog_compiler_pic='-KPIC' - lt_prog_compiler_static='-static' - ;; - # flang / f18. f95 an alias for gfortran or flang on Debian - flang* | f18* | f95*) - lt_prog_compiler_wl='-Wl,' - lt_prog_compiler_pic='-fPIC' - lt_prog_compiler_static='-static' - ;; - # icc used to be incompatible with GCC. - # ICC 10 doesn't accept -KPIC any more. - icc* | ifort*) - lt_prog_compiler_wl='-Wl,' - lt_prog_compiler_pic='-fPIC' - lt_prog_compiler_static='-static' - ;; - # Lahey Fortran 8.1. - lf95*) - lt_prog_compiler_wl='-Wl,' - lt_prog_compiler_pic='--shared' - lt_prog_compiler_static='--static' - ;; - nagfor*) - # NAG Fortran compiler - lt_prog_compiler_wl='-Wl,-Wl,,' - lt_prog_compiler_pic='-PIC' - lt_prog_compiler_static='-Bstatic' - ;; - tcc*) - # Fabrice Bellard et al's Tiny C Compiler - lt_prog_compiler_wl='-Wl,' - lt_prog_compiler_pic='-fPIC' - lt_prog_compiler_static='-static' - ;; - pgcc* | pgf77* | pgf90* | pgf95* | pgfortran*) - # Portland Group compilers (*not* the Pentium gcc compiler, - # which looks to be a dead project) - lt_prog_compiler_wl='-Wl,' - lt_prog_compiler_pic='-fpic' - lt_prog_compiler_static='-Bstatic' - ;; - ccc*) - lt_prog_compiler_wl='-Wl,' - # All Alpha code is PIC. - lt_prog_compiler_static='-non_shared' - ;; - xl* | bgxl* | bgf* | mpixl*) - # IBM XL C 8.0/Fortran 10.1, 11.1 on PPC and BlueGene - lt_prog_compiler_wl='-Wl,' - lt_prog_compiler_pic='-qpic' - lt_prog_compiler_static='-qstaticlink' - ;; - *) - case `$CC -V 2>&1 | sed 5q` in - *Sun\ Ceres\ Fortran* | *Sun*Fortran*\ [1-7].* | *Sun*Fortran*\ 8.[0-3]*) - # Sun Fortran 8.3 passes all unrecognized flags to the linker - lt_prog_compiler_pic='-KPIC' - lt_prog_compiler_static='-Bstatic' - lt_prog_compiler_wl='' - ;; - *Sun\ F* | *Sun*Fortran*) - lt_prog_compiler_pic='-KPIC' - lt_prog_compiler_static='-Bstatic' - lt_prog_compiler_wl='-Qoption ld ' - ;; - *Sun\ C*) - # Sun C 5.9 - lt_prog_compiler_pic='-KPIC' - lt_prog_compiler_static='-Bstatic' - lt_prog_compiler_wl='-Wl,' - ;; - *Intel*\ [CF]*Compiler*) - lt_prog_compiler_wl='-Wl,' - lt_prog_compiler_pic='-fPIC' - lt_prog_compiler_static='-static' - ;; - *Portland\ Group*) - lt_prog_compiler_wl='-Wl,' - lt_prog_compiler_pic='-fpic' - lt_prog_compiler_static='-Bstatic' - ;; - esac - ;; - esac - ;; - - newsos6) - lt_prog_compiler_pic='-KPIC' - lt_prog_compiler_static='-Bstatic' - ;; - - *nto* | *qnx*) - # QNX uses GNU C++, but need to define -shared option too, otherwise - # it will coredump. - lt_prog_compiler_pic='-fPIC -shared' - ;; - - osf3* | osf4* | osf5*) - lt_prog_compiler_wl='-Wl,' - # All OSF/1 code is PIC. - lt_prog_compiler_static='-non_shared' - ;; - - rdos*) - lt_prog_compiler_static='-non_shared' - ;; - - solaris*) - lt_prog_compiler_pic='-KPIC' - lt_prog_compiler_static='-Bstatic' - case $cc_basename in - f77* | f90* | f95* | sunf77* | sunf90* | sunf95*) - lt_prog_compiler_wl='-Qoption ld ';; - *) - lt_prog_compiler_wl='-Wl,';; - esac - ;; - - sunos4*) - lt_prog_compiler_wl='-Qoption ld ' - lt_prog_compiler_pic='-PIC' - lt_prog_compiler_static='-Bstatic' - ;; - - sysv4 | sysv4.2uw2* | sysv4.3*) - lt_prog_compiler_wl='-Wl,' - lt_prog_compiler_pic='-KPIC' - lt_prog_compiler_static='-Bstatic' - ;; - - sysv4*MP*) - if test -d /usr/nec; then - lt_prog_compiler_pic='-Kconform_pic' - lt_prog_compiler_static='-Bstatic' - fi - ;; - - sysv5* | unixware* | sco3.2v5* | sco5v6* | OpenUNIX*) - lt_prog_compiler_wl='-Wl,' - lt_prog_compiler_pic='-KPIC' - lt_prog_compiler_static='-Bstatic' - ;; - - unicos*) - lt_prog_compiler_wl='-Wl,' - lt_prog_compiler_can_build_shared=no - ;; - - uts4*) - lt_prog_compiler_pic='-pic' - lt_prog_compiler_static='-Bstatic' - ;; - - *) - lt_prog_compiler_can_build_shared=no - ;; - esac - fi - -case $host_os in - # For platforms that do not support PIC, -DPIC is meaningless: - *djgpp*) - lt_prog_compiler_pic= - ;; - *) - lt_prog_compiler_pic="$lt_prog_compiler_pic -DPIC" - ;; -esac - -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $compiler option to produce PIC" >&5 -printf %s "checking for $compiler option to produce PIC... " >&6; } -if test ${lt_cv_prog_compiler_pic+y} -then : - printf %s "(cached) " >&6 -else $as_nop - lt_cv_prog_compiler_pic=$lt_prog_compiler_pic -fi -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_pic" >&5 -printf "%s\n" "$lt_cv_prog_compiler_pic" >&6; } -lt_prog_compiler_pic=$lt_cv_prog_compiler_pic - -# -# Check to make sure the PIC flag actually works. -# -if test -n "$lt_prog_compiler_pic"; then - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking if $compiler PIC flag $lt_prog_compiler_pic works" >&5 -printf %s "checking if $compiler PIC flag $lt_prog_compiler_pic works... " >&6; } -if test ${lt_cv_prog_compiler_pic_works+y} -then : - printf %s "(cached) " >&6 -else $as_nop - lt_cv_prog_compiler_pic_works=no - ac_outfile=conftest.$ac_objext - echo "$lt_simple_compile_test_code" > conftest.$ac_ext - lt_compiler_flag="$lt_prog_compiler_pic -DPIC" ## exclude from sc_useless_quotes_in_assignment - # Insert the option either (1) after the last *FLAGS variable, or - # (2) before a word containing "conftest.", or (3) at the end. - # Note that $ac_compile itself does not contain backslashes and begins - # with a dollar sign (not a hyphen), so the echo should work correctly. - # The option is referenced via a variable to avoid confusing sed. - lt_compile=`echo "$ac_compile" | $SED \ - -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ - -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ - -e 's:$: $lt_compiler_flag:'` - (eval echo "\"\$as_me:$LINENO: $lt_compile\"" >&5) - (eval "$lt_compile" 2>conftest.err) - ac_status=$? - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - if (exit $ac_status) && test -s "$ac_outfile"; then - # The compiler can only warn and ignore the option if not recognized - # So say no if there are warnings other than the usual output. - $ECHO "$_lt_compiler_boilerplate" | $SED '/^$/d' >conftest.exp - $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2 - if test ! -s conftest.er2 || diff conftest.exp conftest.er2 >/dev/null; then - lt_cv_prog_compiler_pic_works=yes - fi - fi - $RM conftest* - -fi -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_pic_works" >&5 -printf "%s\n" "$lt_cv_prog_compiler_pic_works" >&6; } - -if test yes = "$lt_cv_prog_compiler_pic_works"; then - case $lt_prog_compiler_pic in - "" | " "*) ;; - *) lt_prog_compiler_pic=" $lt_prog_compiler_pic" ;; - esac -else - lt_prog_compiler_pic= - lt_prog_compiler_can_build_shared=no -fi - -fi - - - - - - - - - - - -# -# Check to make sure the static flag actually works. -# -wl=$lt_prog_compiler_wl eval lt_tmp_static_flag=\"$lt_prog_compiler_static\" -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking if $compiler static flag $lt_tmp_static_flag works" >&5 -printf %s "checking if $compiler static flag $lt_tmp_static_flag works... " >&6; } -if test ${lt_cv_prog_compiler_static_works+y} -then : - printf %s "(cached) " >&6 -else $as_nop - lt_cv_prog_compiler_static_works=no - save_LDFLAGS=$LDFLAGS - LDFLAGS="$LDFLAGS $lt_tmp_static_flag" - echo "$lt_simple_link_test_code" > conftest.$ac_ext - if (eval $ac_link 2>conftest.err) && test -s conftest$ac_exeext; then - # The linker can only warn and ignore the option if not recognized - # So say no if there are warnings - if test -s conftest.err; then - # Append any errors to the config.log. - cat conftest.err 1>&5 - $ECHO "$_lt_linker_boilerplate" | $SED '/^$/d' > conftest.exp - $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2 - if diff conftest.exp conftest.er2 >/dev/null; then - lt_cv_prog_compiler_static_works=yes - fi - else - lt_cv_prog_compiler_static_works=yes - fi - fi - $RM -r conftest* - LDFLAGS=$save_LDFLAGS - -fi -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_static_works" >&5 -printf "%s\n" "$lt_cv_prog_compiler_static_works" >&6; } - -if test yes = "$lt_cv_prog_compiler_static_works"; then - : -else - lt_prog_compiler_static= -fi - - - - - - - - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking if $compiler supports -c -o file.$ac_objext" >&5 -printf %s "checking if $compiler supports -c -o file.$ac_objext... " >&6; } -if test ${lt_cv_prog_compiler_c_o+y} -then : - printf %s "(cached) " >&6 -else $as_nop - lt_cv_prog_compiler_c_o=no - $RM -r conftest 2>/dev/null - mkdir conftest - cd conftest - mkdir out - echo "$lt_simple_compile_test_code" > conftest.$ac_ext - - lt_compiler_flag="-o out/conftest2.$ac_objext" - # Insert the option either (1) after the last *FLAGS variable, or - # (2) before a word containing "conftest.", or (3) at the end. - # Note that $ac_compile itself does not contain backslashes and begins - # with a dollar sign (not a hyphen), so the echo should work correctly. - lt_compile=`echo "$ac_compile" | $SED \ - -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ - -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ - -e 's:$: $lt_compiler_flag:'` - (eval echo "\"\$as_me:$LINENO: $lt_compile\"" >&5) - (eval "$lt_compile" 2>out/conftest.err) - ac_status=$? - cat out/conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - if (exit $ac_status) && test -s out/conftest2.$ac_objext - then - # The compiler can only warn and ignore the option if not recognized - # So say no if there are warnings - $ECHO "$_lt_compiler_boilerplate" | $SED '/^$/d' > out/conftest.exp - $SED '/^$/d; /^ *+/d' out/conftest.err >out/conftest.er2 - if test ! -s out/conftest.er2 || diff out/conftest.exp out/conftest.er2 >/dev/null; then - lt_cv_prog_compiler_c_o=yes - fi - fi - chmod u+w . 2>&5 - $RM conftest* - # SGI C++ compiler will create directory out/ii_files/ for - # template instantiation - test -d out/ii_files && $RM out/ii_files/* && rmdir out/ii_files - $RM out/* && rmdir out - cd .. - $RM -r conftest - $RM conftest* - -fi -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_c_o" >&5 -printf "%s\n" "$lt_cv_prog_compiler_c_o" >&6; } - - - - - - - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking if $compiler supports -c -o file.$ac_objext" >&5 -printf %s "checking if $compiler supports -c -o file.$ac_objext... " >&6; } -if test ${lt_cv_prog_compiler_c_o+y} -then : - printf %s "(cached) " >&6 -else $as_nop - lt_cv_prog_compiler_c_o=no - $RM -r conftest 2>/dev/null - mkdir conftest - cd conftest - mkdir out - echo "$lt_simple_compile_test_code" > conftest.$ac_ext - - lt_compiler_flag="-o out/conftest2.$ac_objext" - # Insert the option either (1) after the last *FLAGS variable, or - # (2) before a word containing "conftest.", or (3) at the end. - # Note that $ac_compile itself does not contain backslashes and begins - # with a dollar sign (not a hyphen), so the echo should work correctly. - lt_compile=`echo "$ac_compile" | $SED \ - -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ - -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ - -e 's:$: $lt_compiler_flag:'` - (eval echo "\"\$as_me:$LINENO: $lt_compile\"" >&5) - (eval "$lt_compile" 2>out/conftest.err) - ac_status=$? - cat out/conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - if (exit $ac_status) && test -s out/conftest2.$ac_objext - then - # The compiler can only warn and ignore the option if not recognized - # So say no if there are warnings - $ECHO "$_lt_compiler_boilerplate" | $SED '/^$/d' > out/conftest.exp - $SED '/^$/d; /^ *+/d' out/conftest.err >out/conftest.er2 - if test ! -s out/conftest.er2 || diff out/conftest.exp out/conftest.er2 >/dev/null; then - lt_cv_prog_compiler_c_o=yes - fi - fi - chmod u+w . 2>&5 - $RM conftest* - # SGI C++ compiler will create directory out/ii_files/ for - # template instantiation - test -d out/ii_files && $RM out/ii_files/* && rmdir out/ii_files - $RM out/* && rmdir out - cd .. - $RM -r conftest - $RM conftest* - -fi -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_c_o" >&5 -printf "%s\n" "$lt_cv_prog_compiler_c_o" >&6; } - - - - -hard_links=nottested -if test no = "$lt_cv_prog_compiler_c_o" && test no != "$need_locks"; then - # do not overwrite the value of need_locks provided by the user - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking if we can lock with hard links" >&5 -printf %s "checking if we can lock with hard links... " >&6; } - hard_links=yes - $RM conftest* - ln conftest.a conftest.b 2>/dev/null && hard_links=no - touch conftest.a - ln conftest.a conftest.b 2>&5 || hard_links=no - ln conftest.a conftest.b 2>/dev/null && hard_links=no - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $hard_links" >&5 -printf "%s\n" "$hard_links" >&6; } - if test no = "$hard_links"; then - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: '$CC' does not support '-c -o', so 'make -j' may be unsafe" >&5 -printf "%s\n" "$as_me: WARNING: '$CC' does not support '-c -o', so 'make -j' may be unsafe" >&2;} - need_locks=warn - fi -else - need_locks=no -fi - - - - - - - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether the $compiler linker ($LD) supports shared libraries" >&5 -printf %s "checking whether the $compiler linker ($LD) supports shared libraries... " >&6; } - - runpath_var= - allow_undefined_flag= - always_export_symbols=no - archive_cmds= - archive_expsym_cmds= - compiler_needs_object=no - enable_shared_with_static_runtimes=no - export_dynamic_flag_spec= - export_symbols_cmds='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols' - hardcode_automatic=no - hardcode_direct=no - hardcode_direct_absolute=no - hardcode_libdir_flag_spec= - hardcode_libdir_separator= - hardcode_minus_L=no - hardcode_shlibpath_var=unsupported - inherit_rpath=no - link_all_deplibs=unknown - module_cmds= - module_expsym_cmds= - old_archive_from_new_cmds= - old_archive_from_expsyms_cmds= - thread_safe_flag_spec= - whole_archive_flag_spec= - # include_expsyms should be a list of space-separated symbols to be *always* - # included in the symbol list - include_expsyms= - # exclude_expsyms can be an extended regexp of symbols to exclude - # it will be wrapped by ' (' and ')$', so one must not match beginning or - # end of line. Example: 'a|bc|.*d.*' will exclude the symbols 'a' and 'bc', - # as well as any symbol that contains 'd'. - exclude_expsyms='_GLOBAL_OFFSET_TABLE_|_GLOBAL__F[ID]_.*' - # Although _GLOBAL_OFFSET_TABLE_ is a valid symbol C name, most a.out - # platforms (ab)use it in PIC code, but their linkers get confused if - # the symbol is explicitly referenced. Since portable code cannot - # rely on this symbol name, it's probably fine to never include it in - # preloaded symbol tables. - # Exclude shared library initialization/finalization symbols. - extract_expsyms_cmds= - - case $host_os in - cygwin* | mingw* | pw32* | cegcc*) - # FIXME: the MSVC++ port hasn't been tested in a loooong time - # When not using gcc, we currently assume that we are using - # Microsoft Visual C++. - if test yes != "$GCC"; then - with_gnu_ld=no - fi - ;; - interix*) - # we just hope/assume this is gcc and not c89 (= MSVC++) - with_gnu_ld=yes - ;; - openbsd* | bitrig*) - with_gnu_ld=no - ;; - linux* | k*bsd*-gnu | gnu*) - link_all_deplibs=no - ;; - esac - - ld_shlibs=yes - - # On some targets, GNU ld is compatible enough with the native linker - # that we're better off using the native interface for both. - lt_use_gnu_ld_interface=no - if test yes = "$with_gnu_ld"; then - case $host_os in - aix*) - # The AIX port of GNU ld has always aspired to compatibility - # with the native linker. However, as the warning in the GNU ld - # block says, versions before 2.19.5* couldn't really create working - # shared libraries, regardless of the interface used. - case `$LD -v 2>&1` in - *\ \(GNU\ Binutils\)\ 2.19.5*) ;; - *\ \(GNU\ Binutils\)\ 2.[2-9]*) ;; - *\ \(GNU\ Binutils\)\ [3-9]*) ;; - *) - lt_use_gnu_ld_interface=yes - ;; - esac - ;; - *) - lt_use_gnu_ld_interface=yes - ;; - esac - fi - - if test yes = "$lt_use_gnu_ld_interface"; then - # If archive_cmds runs LD, not CC, wlarc should be empty - wlarc='$wl' - - # Set some defaults for GNU ld with shared library support. These - # are reset later if shared libraries are not supported. Putting them - # here allows them to be overridden if necessary. - runpath_var=LD_RUN_PATH - hardcode_libdir_flag_spec='$wl-rpath $wl$libdir' - export_dynamic_flag_spec='$wl--export-dynamic' - # ancient GNU ld didn't support --whole-archive et. al. - if $LD --help 2>&1 | $GREP 'no-whole-archive' > /dev/null; then - whole_archive_flag_spec=$wlarc'--whole-archive$convenience '$wlarc'--no-whole-archive' - else - whole_archive_flag_spec= - fi - supports_anon_versioning=no - case `$LD -v | $SED -e 's/(^)\+)\s\+//' 2>&1` in - *GNU\ gold*) supports_anon_versioning=yes ;; - *\ [01].* | *\ 2.[0-9].* | *\ 2.10.*) ;; # catch versions < 2.11 - *\ 2.11.93.0.2\ *) supports_anon_versioning=yes ;; # RH7.3 ... - *\ 2.11.92.0.12\ *) supports_anon_versioning=yes ;; # Mandrake 8.2 ... - *\ 2.11.*) ;; # other 2.11 versions - *) supports_anon_versioning=yes ;; - esac - - # See if GNU ld supports shared libraries. - case $host_os in - aix[3-9]*) - # On AIX/PPC, the GNU linker is very broken - if test ia64 != "$host_cpu"; then - ld_shlibs=no - cat <<_LT_EOF 1>&2 - -*** Warning: the GNU linker, at least up to release 2.19, is reported -*** to be unable to reliably create shared libraries on AIX. -*** Therefore, libtool is disabling shared libraries support. If you -*** really care for shared libraries, you may want to install binutils -*** 2.20 or above, or modify your PATH so that a non-GNU linker is found. -*** You will then need to restart the configuration process. - -_LT_EOF - fi - ;; - - amigaos*) - case $host_cpu in - powerpc) - # see comment about AmigaOS4 .so support - archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib' - archive_expsym_cmds='' - ;; - m68k) - archive_cmds='$RM $output_objdir/a2ixlibrary.data~$ECHO "#define NAME $libname" > $output_objdir/a2ixlibrary.data~$ECHO "#define LIBRARY_ID 1" >> $output_objdir/a2ixlibrary.data~$ECHO "#define VERSION $major" >> $output_objdir/a2ixlibrary.data~$ECHO "#define REVISION $revision" >> $output_objdir/a2ixlibrary.data~$AR $AR_FLAGS $lib $libobjs~$RANLIB $lib~(cd $output_objdir && a2ixlibrary -32)' - hardcode_libdir_flag_spec='-L$libdir' - hardcode_minus_L=yes - ;; - esac - ;; - - beos*) - if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then - allow_undefined_flag=unsupported - # Joseph Beckenbach says some releases of gcc - # support --undefined. This deserves some investigation. FIXME - archive_cmds='$CC -nostart $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib' - else - ld_shlibs=no - fi - ;; - - cygwin* | mingw* | pw32* | cegcc*) - # _LT_TAGVAR(hardcode_libdir_flag_spec, ) is actually meaningless, - # as there is no search path for DLLs. - hardcode_libdir_flag_spec='-L$libdir' - export_dynamic_flag_spec='$wl--export-all-symbols' - allow_undefined_flag=unsupported - always_export_symbols=no - enable_shared_with_static_runtimes=yes - export_symbols_cmds='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[BCDGRS][ ]/s/.*[ ]\([^ ]*\)/\1 DATA/;s/^.*[ ]__nm__\([^ ]*\)[ ][^ ]*/\1 DATA/;/^I[ ]/d;/^[AITW][ ]/s/.* //'\'' | sort | uniq > $export_symbols' - exclude_expsyms='[_]+GLOBAL_OFFSET_TABLE_|[_]+GLOBAL__[FID]_.*|[_]+head_[A-Za-z0-9_]+_dll|[A-Za-z0-9_]+_dll_iname' - - if $LD --help 2>&1 | $GREP 'auto-import' > /dev/null; then - archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags -o $output_objdir/$soname $wl--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib' - # If the export-symbols file already is a .def file, use it as - # is; otherwise, prepend EXPORTS... - archive_expsym_cmds='if test DEF = "`$SED -n -e '\''s/^[ ]*//'\'' -e '\''/^\(;.*\)*$/d'\'' -e '\''s/^\(EXPORTS\|LIBRARY\)\([ ].*\)*$/DEF/p'\'' -e q $export_symbols`" ; then - cp $export_symbols $output_objdir/$soname.def; - else - echo EXPORTS > $output_objdir/$soname.def; - cat $export_symbols >> $output_objdir/$soname.def; - fi~ - $CC -shared $output_objdir/$soname.def $libobjs $deplibs $compiler_flags -o $output_objdir/$soname $wl--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib' - else - ld_shlibs=no - fi - ;; - - haiku*) - archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib' - link_all_deplibs=yes - ;; - - os2*) - hardcode_libdir_flag_spec='-L$libdir' - hardcode_minus_L=yes - allow_undefined_flag=unsupported - shrext_cmds=.dll - archive_cmds='$ECHO "LIBRARY ${soname%$shared_ext} INITINSTANCE TERMINSTANCE" > $output_objdir/$libname.def~ - $ECHO "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~ - $ECHO "DATA MULTIPLE NONSHARED" >> $output_objdir/$libname.def~ - $ECHO EXPORTS >> $output_objdir/$libname.def~ - emxexp $libobjs | $SED /"_DLL_InitTerm"/d >> $output_objdir/$libname.def~ - $CC -Zdll -Zcrtdll -o $output_objdir/$soname $libobjs $deplibs $compiler_flags $output_objdir/$libname.def~ - emximp -o $lib $output_objdir/$libname.def' - archive_expsym_cmds='$ECHO "LIBRARY ${soname%$shared_ext} INITINSTANCE TERMINSTANCE" > $output_objdir/$libname.def~ - $ECHO "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~ - $ECHO "DATA MULTIPLE NONSHARED" >> $output_objdir/$libname.def~ - $ECHO EXPORTS >> $output_objdir/$libname.def~ - prefix_cmds="$SED"~ - if test EXPORTS = "`$SED 1q $export_symbols`"; then - prefix_cmds="$prefix_cmds -e 1d"; - fi~ - prefix_cmds="$prefix_cmds -e \"s/^\(.*\)$/_\1/g\""~ - cat $export_symbols | $prefix_cmds >> $output_objdir/$libname.def~ - $CC -Zdll -Zcrtdll -o $output_objdir/$soname $libobjs $deplibs $compiler_flags $output_objdir/$libname.def~ - emximp -o $lib $output_objdir/$libname.def' - old_archive_From_new_cmds='emximp -o $output_objdir/${libname}_dll.a $output_objdir/$libname.def' - enable_shared_with_static_runtimes=yes - ;; - - interix[3-9]*) - hardcode_direct=no - hardcode_shlibpath_var=no - hardcode_libdir_flag_spec='$wl-rpath,$libdir' - export_dynamic_flag_spec='$wl-E' - # Hack: On Interix 3.x, we cannot compile PIC because of a broken gcc. - # Instead, shared libraries are loaded at an image base (0x10000000 by - # default) and relocated if they conflict, which is a slow very memory - # consuming and fragmenting process. To avoid this, we pick a random, - # 256 KiB-aligned image base between 0x50000000 and 0x6FFC0000 at link - # time. Moving up from 0x10000000 also allows more sbrk(2) space. - archive_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-h,$soname $wl--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib' - archive_expsym_cmds='sed "s|^|_|" $export_symbols >$output_objdir/$soname.expsym~$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-h,$soname $wl--retain-symbols-file,$output_objdir/$soname.expsym $wl--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib' - ;; - - gnu* | linux* | tpf* | k*bsd*-gnu | kopensolaris*-gnu) - tmp_diet=no - if test linux-dietlibc = "$host_os"; then - case $cc_basename in - diet\ *) tmp_diet=yes;; # linux-dietlibc with static linking (!diet-dyn) - esac - fi - if $LD --help 2>&1 | $EGREP ': supported targets:.* elf' > /dev/null \ - && test no = "$tmp_diet" - then - tmp_addflag=' $pic_flag' - tmp_sharedflag='-shared' - case $cc_basename,$host_cpu in - pgcc*) # Portland Group C compiler - whole_archive_flag_spec='$wl--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` $wl--no-whole-archive' - tmp_addflag=' $pic_flag' - ;; - pgf77* | pgf90* | pgf95* | pgfortran*) - # Portland Group f77 and f90 compilers - whole_archive_flag_spec='$wl--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` $wl--no-whole-archive' - tmp_addflag=' $pic_flag -Mnomain' ;; - ecc*,ia64* | icc*,ia64*) # Intel C compiler on ia64 - tmp_addflag=' -i_dynamic' ;; - efc*,ia64* | ifort*,ia64*) # Intel Fortran compiler on ia64 - tmp_addflag=' -i_dynamic -nofor_main' ;; - ifc* | ifort*) # Intel Fortran compiler - tmp_addflag=' -nofor_main' ;; - lf95*) # Lahey Fortran 8.1 - whole_archive_flag_spec= - tmp_sharedflag='--shared' ;; - nagfor*) # NAGFOR 5.3 - tmp_sharedflag='-Wl,-shared' ;; - xl[cC]* | bgxl[cC]* | mpixl[cC]*) # IBM XL C 8.0 on PPC (deal with xlf below) - tmp_sharedflag='-qmkshrobj' - tmp_addflag= ;; - nvcc*) # Cuda Compiler Driver 2.2 - whole_archive_flag_spec='$wl--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` $wl--no-whole-archive' - compiler_needs_object=yes - ;; - esac - case `$CC -V 2>&1 | sed 5q` in - *Sun\ C*) # Sun C 5.9 - whole_archive_flag_spec='$wl--whole-archive`new_convenience=; for conv in $convenience\"\"; do test -z \"$conv\" || new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` $wl--no-whole-archive' - compiler_needs_object=yes - tmp_sharedflag='-G' ;; - *Sun\ F*) # Sun Fortran 8.3 - tmp_sharedflag='-G' ;; - esac - archive_cmds='$CC '"$tmp_sharedflag""$tmp_addflag"' $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib' - - if test yes = "$supports_anon_versioning"; then - archive_expsym_cmds='echo "{ global:" > $output_objdir/$libname.ver~ - cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~ - echo "local: *; };" >> $output_objdir/$libname.ver~ - $CC '"$tmp_sharedflag""$tmp_addflag"' $libobjs $deplibs $compiler_flags $wl-soname $wl$soname $wl-version-script $wl$output_objdir/$libname.ver -o $lib' - fi - - case $cc_basename in - tcc*) - export_dynamic_flag_spec='-rdynamic' - ;; - xlf* | bgf* | bgxlf* | mpixlf*) - # IBM XL Fortran 10.1 on PPC cannot create shared libs itself - whole_archive_flag_spec='--whole-archive$convenience --no-whole-archive' - hardcode_libdir_flag_spec='$wl-rpath $wl$libdir' - archive_cmds='$LD -shared $libobjs $deplibs $linker_flags -soname $soname -o $lib' - if test yes = "$supports_anon_versioning"; then - archive_expsym_cmds='echo "{ global:" > $output_objdir/$libname.ver~ - cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~ - echo "local: *; };" >> $output_objdir/$libname.ver~ - $LD -shared $libobjs $deplibs $linker_flags -soname $soname -version-script $output_objdir/$libname.ver -o $lib' - fi - ;; - esac - else - ld_shlibs=no - fi - ;; - - netbsd* | netbsdelf*-gnu) - if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then - archive_cmds='$LD -Bshareable $libobjs $deplibs $linker_flags -o $lib' - wlarc= - else - archive_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib' - archive_expsym_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname $wl-retain-symbols-file $wl$export_symbols -o $lib' - fi - ;; - - solaris*) - if $LD -v 2>&1 | $GREP 'BFD 2\.8' > /dev/null; then - ld_shlibs=no - cat <<_LT_EOF 1>&2 - -*** Warning: The releases 2.8.* of the GNU linker cannot reliably -*** create shared libraries on Solaris systems. Therefore, libtool -*** is disabling shared libraries support. We urge you to upgrade GNU -*** binutils to release 2.9.1 or newer. Another option is to modify -*** your PATH or compiler configuration so that the native linker is -*** used, and then restart. - -_LT_EOF - elif $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then - archive_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib' - archive_expsym_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname $wl-retain-symbols-file $wl$export_symbols -o $lib' - else - ld_shlibs=no - fi - ;; - - sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX*) - case `$LD -v 2>&1` in - *\ [01].* | *\ 2.[0-9].* | *\ 2.1[0-5].*) - ld_shlibs=no - cat <<_LT_EOF 1>&2 - -*** Warning: Releases of the GNU linker prior to 2.16.91.0.3 cannot -*** reliably create shared libraries on SCO systems. Therefore, libtool -*** is disabling shared libraries support. We urge you to upgrade GNU -*** binutils to release 2.16.91.0.3 or newer. Another option is to modify -*** your PATH or compiler configuration so that the native linker is -*** used, and then restart. - -_LT_EOF - ;; - *) - # For security reasons, it is highly recommended that you always - # use absolute paths for naming shared libraries, and exclude the - # DT_RUNPATH tag from executables and libraries. But doing so - # requires that you compile everything twice, which is a pain. - if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then - hardcode_libdir_flag_spec='$wl-rpath $wl$libdir' - archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib' - archive_expsym_cmds='$CC -shared $libobjs $deplibs $compiler_flags $wl-soname $wl$soname $wl-retain-symbols-file $wl$export_symbols -o $lib' - else - ld_shlibs=no - fi - ;; - esac - ;; - - sunos4*) - archive_cmds='$LD -assert pure-text -Bshareable -o $lib $libobjs $deplibs $linker_flags' - wlarc= - hardcode_direct=yes - hardcode_shlibpath_var=no - ;; - - *) - if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then - archive_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib' - archive_expsym_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname $wl-retain-symbols-file $wl$export_symbols -o $lib' - else - ld_shlibs=no - fi - ;; - esac - - if test no = "$ld_shlibs"; then - runpath_var= - hardcode_libdir_flag_spec= - export_dynamic_flag_spec= - whole_archive_flag_spec= - fi - else - # PORTME fill in a description of your system's linker (not GNU ld) - case $host_os in - aix3*) - allow_undefined_flag=unsupported - always_export_symbols=yes - archive_expsym_cmds='$LD -o $output_objdir/$soname $libobjs $deplibs $linker_flags -bE:$export_symbols -T512 -H512 -bM:SRE~$AR $AR_FLAGS $lib $output_objdir/$soname' - # Note: this linker hardcodes the directories in LIBPATH if there - # are no directories specified by -L. - hardcode_minus_L=yes - if test yes = "$GCC" && test -z "$lt_prog_compiler_static"; then - # Neither direct hardcoding nor static linking is supported with a - # broken collect2. - hardcode_direct=unsupported - fi - ;; - - aix[4-9]*) - if test ia64 = "$host_cpu"; then - # On IA64, the linker does run time linking by default, so we don't - # have to do anything special. - aix_use_runtimelinking=no - exp_sym_flag='-Bexport' - no_entry_flag= - else - # If we're using GNU nm, then we don't want the "-C" option. - # -C means demangle to GNU nm, but means don't demangle to AIX nm. - # Without the "-l" option, or with the "-B" option, AIX nm treats - # weak defined symbols like other global defined symbols, whereas - # GNU nm marks them as "W". - # While the 'weak' keyword is ignored in the Export File, we need - # it in the Import File for the 'aix-soname' feature, so we have - # to replace the "-B" option with "-P" for AIX nm. - if $NM -V 2>&1 | $GREP 'GNU' > /dev/null; then - export_symbols_cmds='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B") || (\$ 2 == "W")) && (substr(\$ 3,1,1) != ".")) { if (\$ 2 == "W") { print \$ 3 " weak" } else { print \$ 3 } } }'\'' | sort -u > $export_symbols' - else - export_symbols_cmds='`func_echo_all $NM | $SED -e '\''s/B\([^B]*\)$/P\1/'\''` -PCpgl $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B") || (\$ 2 == "W") || (\$ 2 == "V") || (\$ 2 == "Z")) && (substr(\$ 1,1,1) != ".")) { if ((\$ 2 == "W") || (\$ 2 == "V") || (\$ 2 == "Z")) { print \$ 1 " weak" } else { print \$ 1 } } }'\'' | sort -u > $export_symbols' - fi - aix_use_runtimelinking=no - - # Test if we are trying to use run time linking or normal - # AIX style linking. If -brtl is somewhere in LDFLAGS, we - # have runtime linking enabled, and use it for executables. - # For shared libraries, we enable/disable runtime linking - # depending on the kind of the shared library created - - # when "with_aix_soname,aix_use_runtimelinking" is: - # "aix,no" lib.a(lib.so.V) shared, rtl:no, for executables - # "aix,yes" lib.so shared, rtl:yes, for executables - # lib.a static archive - # "both,no" lib.so.V(shr.o) shared, rtl:yes - # lib.a(lib.so.V) shared, rtl:no, for executables - # "both,yes" lib.so.V(shr.o) shared, rtl:yes, for executables - # lib.a(lib.so.V) shared, rtl:no - # "svr4,*" lib.so.V(shr.o) shared, rtl:yes, for executables - # lib.a static archive - case $host_os in aix4.[23]|aix4.[23].*|aix[5-9]*) - for ld_flag in $LDFLAGS; do - if (test x-brtl = "x$ld_flag" || test x-Wl,-brtl = "x$ld_flag"); then - aix_use_runtimelinking=yes - break - fi - done - if test svr4,no = "$with_aix_soname,$aix_use_runtimelinking"; then - # With aix-soname=svr4, we create the lib.so.V shared archives only, - # so we don't have lib.a shared libs to link our executables. - # We have to force runtime linking in this case. - aix_use_runtimelinking=yes - LDFLAGS="$LDFLAGS -Wl,-brtl" - fi - ;; - esac - - exp_sym_flag='-bexport' - no_entry_flag='-bnoentry' - fi - - # When large executables or shared objects are built, AIX ld can - # have problems creating the table of contents. If linking a library - # or program results in "error TOC overflow" add -mminimal-toc to - # CXXFLAGS/CFLAGS for g++/gcc. In the cases where that is not - # enough to fix the problem, add -Wl,-bbigtoc to LDFLAGS. - - archive_cmds='' - hardcode_direct=yes - hardcode_direct_absolute=yes - hardcode_libdir_separator=':' - link_all_deplibs=yes - file_list_spec='$wl-f,' - case $with_aix_soname,$aix_use_runtimelinking in - aix,*) ;; # traditional, no import file - svr4,* | *,yes) # use import file - # The Import File defines what to hardcode. - hardcode_direct=no - hardcode_direct_absolute=no - ;; - esac - - if test yes = "$GCC"; then - case $host_os in aix4.[012]|aix4.[012].*) - # We only want to do this on AIX 4.2 and lower, the check - # below for broken collect2 doesn't work under 4.3+ - collect2name=`$CC -print-prog-name=collect2` - if test -f "$collect2name" && - strings "$collect2name" | $GREP resolve_lib_name >/dev/null - then - # We have reworked collect2 - : - else - # We have old collect2 - hardcode_direct=unsupported - # It fails to find uninstalled libraries when the uninstalled - # path is not listed in the libpath. Setting hardcode_minus_L - # to unsupported forces relinking - hardcode_minus_L=yes - hardcode_libdir_flag_spec='-L$libdir' - hardcode_libdir_separator= - fi - ;; - esac - shared_flag='-shared' - if test yes = "$aix_use_runtimelinking"; then - shared_flag="$shared_flag "'$wl-G' - fi - # Need to ensure runtime linking is disabled for the traditional - # shared library, or the linker may eventually find shared libraries - # /with/ Import File - we do not want to mix them. - shared_flag_aix='-shared' - shared_flag_svr4='-shared $wl-G' - else - # not using gcc - if test ia64 = "$host_cpu"; then - # VisualAge C++, Version 5.5 for AIX 5L for IA-64, Beta 3 Release - # chokes on -Wl,-G. The following line is correct: - shared_flag='-G' - else - if test yes = "$aix_use_runtimelinking"; then - shared_flag='$wl-G' - else - shared_flag='$wl-bM:SRE' - fi - shared_flag_aix='$wl-bM:SRE' - shared_flag_svr4='$wl-G' - fi - fi - - export_dynamic_flag_spec='$wl-bexpall' - # It seems that -bexpall does not export symbols beginning with - # underscore (_), so it is better to generate a list of symbols to export. - always_export_symbols=yes - if test aix,yes = "$with_aix_soname,$aix_use_runtimelinking"; then - # Warning - without using the other runtime loading flags (-brtl), - # -berok will link without error, but may produce a broken library. - allow_undefined_flag='-berok' - # Determine the default libpath from the value encoded in an - # empty executable. - if test set = "${lt_cv_aix_libpath+set}"; then - aix_libpath=$lt_cv_aix_libpath -else - if test ${lt_cv_aix_libpath_+y} -then : - printf %s "(cached) " >&6 -else $as_nop - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - -int -main (void) -{ - - ; - return 0; -} -_ACEOF -if ac_fn_c_try_link "$LINENO" -then : - - lt_aix_libpath_sed=' - /Import File Strings/,/^$/ { - /^0/ { - s/^0 *\([^ ]*\) *$/\1/ - p - } - }' - lt_cv_aix_libpath_=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` - # Check for a 64-bit object if we didn't find anything. - if test -z "$lt_cv_aix_libpath_"; then - lt_cv_aix_libpath_=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` - fi -fi -rm -f core conftest.err conftest.$ac_objext conftest.beam \ - conftest$ac_exeext conftest.$ac_ext - if test -z "$lt_cv_aix_libpath_"; then - lt_cv_aix_libpath_=/usr/lib:/lib - fi - -fi - - aix_libpath=$lt_cv_aix_libpath_ -fi - - hardcode_libdir_flag_spec='$wl-blibpath:$libdir:'"$aix_libpath" - archive_expsym_cmds='$CC -o $output_objdir/$soname $libobjs $deplibs $wl'$no_entry_flag' $compiler_flags `if test -n "$allow_undefined_flag"; then func_echo_all "$wl$allow_undefined_flag"; else :; fi` $wl'$exp_sym_flag:\$export_symbols' '$shared_flag - else - if test ia64 = "$host_cpu"; then - hardcode_libdir_flag_spec='$wl-R $libdir:/usr/lib:/lib' - allow_undefined_flag="-z nodefs" - archive_expsym_cmds="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs '"\$wl$no_entry_flag"' $compiler_flags $wl$allow_undefined_flag '"\$wl$exp_sym_flag:\$export_symbols" - else - # Determine the default libpath from the value encoded in an - # empty executable. - if test set = "${lt_cv_aix_libpath+set}"; then - aix_libpath=$lt_cv_aix_libpath -else - if test ${lt_cv_aix_libpath_+y} -then : - printf %s "(cached) " >&6 -else $as_nop - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - -int -main (void) -{ - - ; - return 0; -} -_ACEOF -if ac_fn_c_try_link "$LINENO" -then : - - lt_aix_libpath_sed=' - /Import File Strings/,/^$/ { - /^0/ { - s/^0 *\([^ ]*\) *$/\1/ - p - } - }' - lt_cv_aix_libpath_=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` - # Check for a 64-bit object if we didn't find anything. - if test -z "$lt_cv_aix_libpath_"; then - lt_cv_aix_libpath_=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` - fi -fi -rm -f core conftest.err conftest.$ac_objext conftest.beam \ - conftest$ac_exeext conftest.$ac_ext - if test -z "$lt_cv_aix_libpath_"; then - lt_cv_aix_libpath_=/usr/lib:/lib - fi - -fi - - aix_libpath=$lt_cv_aix_libpath_ -fi - - hardcode_libdir_flag_spec='$wl-blibpath:$libdir:'"$aix_libpath" - # Warning - without using the other run time loading flags, - # -berok will link without error, but may produce a broken library. - no_undefined_flag=' $wl-bernotok' - allow_undefined_flag=' $wl-berok' - if test yes = "$with_gnu_ld"; then - # We only use this code for GNU lds that support --whole-archive. - whole_archive_flag_spec='$wl--whole-archive$convenience $wl--no-whole-archive' - else - # Exported symbols can be pulled into shared objects from archives - whole_archive_flag_spec='$convenience' - fi - archive_cmds_need_lc=yes - archive_expsym_cmds='$RM -r $output_objdir/$realname.d~$MKDIR $output_objdir/$realname.d' - # -brtl affects multiple linker settings, -berok does not and is overridden later - compiler_flags_filtered='`func_echo_all "$compiler_flags " | $SED -e "s%-brtl\\([, ]\\)%-berok\\1%g"`' - if test svr4 != "$with_aix_soname"; then - # This is similar to how AIX traditionally builds its shared libraries. - archive_expsym_cmds="$archive_expsym_cmds"'~$CC '$shared_flag_aix' -o $output_objdir/$realname.d/$soname $libobjs $deplibs $wl-bnoentry '$compiler_flags_filtered'$wl-bE:$export_symbols$allow_undefined_flag~$AR $AR_FLAGS $output_objdir/$libname$release.a $output_objdir/$realname.d/$soname' - fi - if test aix != "$with_aix_soname"; then - archive_expsym_cmds="$archive_expsym_cmds"'~$CC '$shared_flag_svr4' -o $output_objdir/$realname.d/$shared_archive_member_spec.o $libobjs $deplibs $wl-bnoentry '$compiler_flags_filtered'$wl-bE:$export_symbols$allow_undefined_flag~$STRIP -e $output_objdir/$realname.d/$shared_archive_member_spec.o~( func_echo_all "#! $soname($shared_archive_member_spec.o)"; if test shr_64 = "$shared_archive_member_spec"; then func_echo_all "# 64"; else func_echo_all "# 32"; fi; cat $export_symbols ) > $output_objdir/$realname.d/$shared_archive_member_spec.imp~$AR $AR_FLAGS $output_objdir/$soname $output_objdir/$realname.d/$shared_archive_member_spec.o $output_objdir/$realname.d/$shared_archive_member_spec.imp' - else - # used by -dlpreopen to get the symbols - archive_expsym_cmds="$archive_expsym_cmds"'~$MV $output_objdir/$realname.d/$soname $output_objdir' - fi - archive_expsym_cmds="$archive_expsym_cmds"'~$RM -r $output_objdir/$realname.d' - fi - fi - ;; - - amigaos*) - case $host_cpu in - powerpc) - # see comment about AmigaOS4 .so support - archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib' - archive_expsym_cmds='' - ;; - m68k) - archive_cmds='$RM $output_objdir/a2ixlibrary.data~$ECHO "#define NAME $libname" > $output_objdir/a2ixlibrary.data~$ECHO "#define LIBRARY_ID 1" >> $output_objdir/a2ixlibrary.data~$ECHO "#define VERSION $major" >> $output_objdir/a2ixlibrary.data~$ECHO "#define REVISION $revision" >> $output_objdir/a2ixlibrary.data~$AR $AR_FLAGS $lib $libobjs~$RANLIB $lib~(cd $output_objdir && a2ixlibrary -32)' - hardcode_libdir_flag_spec='-L$libdir' - hardcode_minus_L=yes - ;; - esac - ;; - - bsdi[45]*) - export_dynamic_flag_spec=-rdynamic - ;; - - cygwin* | mingw* | pw32* | cegcc*) - # When not using gcc, we currently assume that we are using - # Microsoft Visual C++. - # hardcode_libdir_flag_spec is actually meaningless, as there is - # no search path for DLLs. - case $cc_basename in - cl*) - # Native MSVC - hardcode_libdir_flag_spec=' ' - allow_undefined_flag=unsupported - always_export_symbols=yes - file_list_spec='@' - # Tell ltmain to make .lib files, not .a files. - libext=lib - # Tell ltmain to make .dll files, not .so files. - shrext_cmds=.dll - # FIXME: Setting linknames here is a bad hack. - archive_cmds='$CC -o $output_objdir/$soname $libobjs $compiler_flags $deplibs -Wl,-DLL,-IMPLIB:"$tool_output_objdir$libname.dll.lib"~linknames=' - archive_expsym_cmds='if test DEF = "`$SED -n -e '\''s/^[ ]*//'\'' -e '\''/^\(;.*\)*$/d'\'' -e '\''s/^\(EXPORTS\|LIBRARY\)\([ ].*\)*$/DEF/p'\'' -e q $export_symbols`" ; then - cp "$export_symbols" "$output_objdir/$soname.def"; - echo "$tool_output_objdir$soname.def" > "$output_objdir/$soname.exp"; - else - $SED -e '\''s/^/-link -EXPORT:/'\'' < $export_symbols > $output_objdir/$soname.exp; - fi~ - $CC -o $tool_output_objdir$soname $libobjs $compiler_flags $deplibs "@$tool_output_objdir$soname.exp" -Wl,-DLL,-IMPLIB:"$tool_output_objdir$libname.dll.lib"~ - linknames=' - # The linker will not automatically build a static lib if we build a DLL. - # _LT_TAGVAR(old_archive_from_new_cmds, )='true' - enable_shared_with_static_runtimes=yes - exclude_expsyms='_NULL_IMPORT_DESCRIPTOR|_IMPORT_DESCRIPTOR_.*' - export_symbols_cmds='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[BCDGRS][ ]/s/.*[ ]\([^ ]*\)/\1,DATA/'\'' | $SED -e '\''/^[AITW][ ]/s/.*[ ]//'\'' | sort | uniq > $export_symbols' - # Don't use ranlib - old_postinstall_cmds='chmod 644 $oldlib' - postlink_cmds='lt_outputfile="@OUTPUT@"~ - lt_tool_outputfile="@TOOL_OUTPUT@"~ - case $lt_outputfile in - *.exe|*.EXE) ;; - *) - lt_outputfile=$lt_outputfile.exe - lt_tool_outputfile=$lt_tool_outputfile.exe - ;; - esac~ - if test : != "$MANIFEST_TOOL" && test -f "$lt_outputfile.manifest"; then - $MANIFEST_TOOL -manifest "$lt_tool_outputfile.manifest" -outputresource:"$lt_tool_outputfile" || exit 1; - $RM "$lt_outputfile.manifest"; - fi' - ;; - *) - # Assume MSVC wrapper - hardcode_libdir_flag_spec=' ' - allow_undefined_flag=unsupported - # Tell ltmain to make .lib files, not .a files. - libext=lib - # Tell ltmain to make .dll files, not .so files. - shrext_cmds=.dll - # FIXME: Setting linknames here is a bad hack. - archive_cmds='$CC -o $lib $libobjs $compiler_flags `func_echo_all "$deplibs" | $SED '\''s/ -lc$//'\''` -link -dll~linknames=' - # The linker will automatically build a .lib file if we build a DLL. - old_archive_from_new_cmds='true' - # FIXME: Should let the user specify the lib program. - old_archive_cmds='lib -OUT:$oldlib$oldobjs$old_deplibs' - enable_shared_with_static_runtimes=yes - ;; - esac - ;; - - darwin* | rhapsody*) - - - archive_cmds_need_lc=no - hardcode_direct=no - hardcode_automatic=yes - hardcode_shlibpath_var=unsupported - if test yes = "$lt_cv_ld_force_load"; then - whole_archive_flag_spec='`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience $wl-force_load,$conv\"; done; func_echo_all \"$new_convenience\"`' - - else - whole_archive_flag_spec='' - fi - link_all_deplibs=yes - allow_undefined_flag=$_lt_dar_allow_undefined - case $cc_basename in - ifort*|nagfor*) _lt_dar_can_shared=yes ;; - *) _lt_dar_can_shared=$GCC ;; - esac - if test yes = "$_lt_dar_can_shared"; then - output_verbose_link_cmd=func_echo_all - archive_cmds="\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring $_lt_dar_single_mod$_lt_dsymutil" - module_cmds="\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags$_lt_dsymutil" - archive_expsym_cmds="sed 's|^|_|' < \$export_symbols > \$output_objdir/\$libname-symbols.expsym~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring $_lt_dar_single_mod$_lt_dar_export_syms$_lt_dsymutil" - module_expsym_cmds="sed -e 's|^|_|' < \$export_symbols > \$output_objdir/\$libname-symbols.expsym~\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags$_lt_dar_export_syms$_lt_dsymutil" - - else - ld_shlibs=no - fi - - ;; - - dgux*) - archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' - hardcode_libdir_flag_spec='-L$libdir' - hardcode_shlibpath_var=no - ;; - - # FreeBSD 2.2.[012] allows us to include c++rt0.o to get C++ constructor - # support. Future versions do this automatically, but an explicit c++rt0.o - # does not break anything, and helps significantly (at the cost of a little - # extra space). - freebsd2.2*) - archive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags /usr/lib/c++rt0.o' - hardcode_libdir_flag_spec='-R$libdir' - hardcode_direct=yes - hardcode_shlibpath_var=no - ;; - - # Unfortunately, older versions of FreeBSD 2 do not have this feature. - freebsd2.*) - archive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' - hardcode_direct=yes - hardcode_minus_L=yes - hardcode_shlibpath_var=no - ;; - - # FreeBSD 3 and greater uses gcc -shared to do shared libraries. - freebsd* | dragonfly*) - archive_cmds='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags' - hardcode_libdir_flag_spec='-R$libdir' - hardcode_direct=yes - hardcode_shlibpath_var=no - ;; - - hpux9*) - if test yes = "$GCC"; then - archive_cmds='$RM $output_objdir/$soname~$CC -shared $pic_flag $wl+b $wl$install_libdir -o $output_objdir/$soname $libobjs $deplibs $compiler_flags~test "x$output_objdir/$soname" = "x$lib" || mv $output_objdir/$soname $lib' - else - archive_cmds='$RM $output_objdir/$soname~$LD -b +b $install_libdir -o $output_objdir/$soname $libobjs $deplibs $linker_flags~test "x$output_objdir/$soname" = "x$lib" || mv $output_objdir/$soname $lib' - fi - hardcode_libdir_flag_spec='$wl+b $wl$libdir' - hardcode_libdir_separator=: - hardcode_direct=yes - - # hardcode_minus_L: Not really in the search PATH, - # but as the default location of the library. - hardcode_minus_L=yes - export_dynamic_flag_spec='$wl-E' - ;; - - hpux10*) - if test yes,no = "$GCC,$with_gnu_ld"; then - archive_cmds='$CC -shared $pic_flag $wl+h $wl$soname $wl+b $wl$install_libdir -o $lib $libobjs $deplibs $compiler_flags' - else - archive_cmds='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_flags' - fi - if test no = "$with_gnu_ld"; then - hardcode_libdir_flag_spec='$wl+b $wl$libdir' - hardcode_libdir_separator=: - hardcode_direct=yes - hardcode_direct_absolute=yes - export_dynamic_flag_spec='$wl-E' - # hardcode_minus_L: Not really in the search PATH, - # but as the default location of the library. - hardcode_minus_L=yes - fi - ;; - - hpux11*) - if test yes,no = "$GCC,$with_gnu_ld"; then - case $host_cpu in - hppa*64*) - archive_cmds='$CC -shared $wl+h $wl$soname -o $lib $libobjs $deplibs $compiler_flags' - ;; - ia64*) - archive_cmds='$CC -shared $pic_flag $wl+h $wl$soname $wl+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags' - ;; - *) - archive_cmds='$CC -shared $pic_flag $wl+h $wl$soname $wl+b $wl$install_libdir -o $lib $libobjs $deplibs $compiler_flags' - ;; - esac - else - case $host_cpu in - hppa*64*) - archive_cmds='$CC -b $wl+h $wl$soname -o $lib $libobjs $deplibs $compiler_flags' - ;; - ia64*) - archive_cmds='$CC -b $wl+h $wl$soname $wl+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags' - ;; - *) - - # Older versions of the 11.00 compiler do not understand -b yet - # (HP92453-01 A.11.01.20 doesn't, HP92453-01 B.11.X.35175-35176.GP does) - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking if $CC understands -b" >&5 -printf %s "checking if $CC understands -b... " >&6; } -if test ${lt_cv_prog_compiler__b+y} -then : - printf %s "(cached) " >&6 -else $as_nop - lt_cv_prog_compiler__b=no - save_LDFLAGS=$LDFLAGS - LDFLAGS="$LDFLAGS -b" - echo "$lt_simple_link_test_code" > conftest.$ac_ext - if (eval $ac_link 2>conftest.err) && test -s conftest$ac_exeext; then - # The linker can only warn and ignore the option if not recognized - # So say no if there are warnings - if test -s conftest.err; then - # Append any errors to the config.log. - cat conftest.err 1>&5 - $ECHO "$_lt_linker_boilerplate" | $SED '/^$/d' > conftest.exp - $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2 - if diff conftest.exp conftest.er2 >/dev/null; then - lt_cv_prog_compiler__b=yes - fi - else - lt_cv_prog_compiler__b=yes - fi - fi - $RM -r conftest* - LDFLAGS=$save_LDFLAGS - -fi -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler__b" >&5 -printf "%s\n" "$lt_cv_prog_compiler__b" >&6; } - -if test yes = "$lt_cv_prog_compiler__b"; then - archive_cmds='$CC -b $wl+h $wl$soname $wl+b $wl$install_libdir -o $lib $libobjs $deplibs $compiler_flags' -else - archive_cmds='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_flags' -fi - - ;; - esac - fi - if test no = "$with_gnu_ld"; then - hardcode_libdir_flag_spec='$wl+b $wl$libdir' - hardcode_libdir_separator=: - - case $host_cpu in - hppa*64*|ia64*) - hardcode_direct=no - hardcode_shlibpath_var=no - ;; - *) - hardcode_direct=yes - hardcode_direct_absolute=yes - export_dynamic_flag_spec='$wl-E' - - # hardcode_minus_L: Not really in the search PATH, - # but as the default location of the library. - hardcode_minus_L=yes - ;; - esac - fi - ;; - - irix5* | irix6* | nonstopux*) - if test yes = "$GCC"; then - archive_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname `test -n "$verstring" && func_echo_all "$wl-set_version $wl$verstring"` $wl-update_registry $wl$output_objdir/so_locations -o $lib' - # Try to use the -exported_symbol ld option, if it does not - # work, assume that -exports_file does not work either and - # implicitly export all symbols. - # This should be the same for all languages, so no per-tag cache variable. - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether the $host_os linker accepts -exported_symbol" >&5 -printf %s "checking whether the $host_os linker accepts -exported_symbol... " >&6; } -if test ${lt_cv_irix_exported_symbol+y} -then : - printf %s "(cached) " >&6 -else $as_nop - save_LDFLAGS=$LDFLAGS - LDFLAGS="$LDFLAGS -shared $wl-exported_symbol ${wl}foo $wl-update_registry $wl/dev/null" - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -int foo (void) { return 0; } -_ACEOF -if ac_fn_c_try_link "$LINENO" -then : - lt_cv_irix_exported_symbol=yes -else $as_nop - lt_cv_irix_exported_symbol=no -fi -rm -f core conftest.err conftest.$ac_objext conftest.beam \ - conftest$ac_exeext conftest.$ac_ext - LDFLAGS=$save_LDFLAGS -fi -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $lt_cv_irix_exported_symbol" >&5 -printf "%s\n" "$lt_cv_irix_exported_symbol" >&6; } - if test yes = "$lt_cv_irix_exported_symbol"; then - archive_expsym_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname `test -n "$verstring" && func_echo_all "$wl-set_version $wl$verstring"` $wl-update_registry $wl$output_objdir/so_locations $wl-exports_file $wl$export_symbols -o $lib' - fi - link_all_deplibs=no - else - archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry $output_objdir/so_locations -o $lib' - archive_expsym_cmds='$CC -shared $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry $output_objdir/so_locations -exports_file $export_symbols -o $lib' - fi - archive_cmds_need_lc='no' - hardcode_libdir_flag_spec='$wl-rpath $wl$libdir' - hardcode_libdir_separator=: - inherit_rpath=yes - link_all_deplibs=yes - ;; - - linux*) - case $cc_basename in - tcc*) - # Fabrice Bellard et al's Tiny C Compiler - ld_shlibs=yes - archive_cmds='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags' - ;; - esac - ;; - - netbsd* | netbsdelf*-gnu) - if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then - archive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' # a.out - else - archive_cmds='$LD -shared -o $lib $libobjs $deplibs $linker_flags' # ELF - fi - hardcode_libdir_flag_spec='-R$libdir' - hardcode_direct=yes - hardcode_shlibpath_var=no - ;; - - newsos6) - archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' - hardcode_direct=yes - hardcode_libdir_flag_spec='$wl-rpath $wl$libdir' - hardcode_libdir_separator=: - hardcode_shlibpath_var=no - ;; - - *nto* | *qnx*) - ;; - - openbsd* | bitrig*) - if test -f /usr/libexec/ld.so; then - hardcode_direct=yes - hardcode_shlibpath_var=no - hardcode_direct_absolute=yes - if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`"; then - archive_cmds='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags' - archive_expsym_cmds='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags $wl-retain-symbols-file,$export_symbols' - hardcode_libdir_flag_spec='$wl-rpath,$libdir' - export_dynamic_flag_spec='$wl-E' - else - archive_cmds='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags' - hardcode_libdir_flag_spec='$wl-rpath,$libdir' - fi - else - ld_shlibs=no - fi - ;; - - os2*) - hardcode_libdir_flag_spec='-L$libdir' - hardcode_minus_L=yes - allow_undefined_flag=unsupported - shrext_cmds=.dll - archive_cmds='$ECHO "LIBRARY ${soname%$shared_ext} INITINSTANCE TERMINSTANCE" > $output_objdir/$libname.def~ - $ECHO "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~ - $ECHO "DATA MULTIPLE NONSHARED" >> $output_objdir/$libname.def~ - $ECHO EXPORTS >> $output_objdir/$libname.def~ - emxexp $libobjs | $SED /"_DLL_InitTerm"/d >> $output_objdir/$libname.def~ - $CC -Zdll -Zcrtdll -o $output_objdir/$soname $libobjs $deplibs $compiler_flags $output_objdir/$libname.def~ - emximp -o $lib $output_objdir/$libname.def' - archive_expsym_cmds='$ECHO "LIBRARY ${soname%$shared_ext} INITINSTANCE TERMINSTANCE" > $output_objdir/$libname.def~ - $ECHO "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~ - $ECHO "DATA MULTIPLE NONSHARED" >> $output_objdir/$libname.def~ - $ECHO EXPORTS >> $output_objdir/$libname.def~ - prefix_cmds="$SED"~ - if test EXPORTS = "`$SED 1q $export_symbols`"; then - prefix_cmds="$prefix_cmds -e 1d"; - fi~ - prefix_cmds="$prefix_cmds -e \"s/^\(.*\)$/_\1/g\""~ - cat $export_symbols | $prefix_cmds >> $output_objdir/$libname.def~ - $CC -Zdll -Zcrtdll -o $output_objdir/$soname $libobjs $deplibs $compiler_flags $output_objdir/$libname.def~ - emximp -o $lib $output_objdir/$libname.def' - old_archive_From_new_cmds='emximp -o $output_objdir/${libname}_dll.a $output_objdir/$libname.def' - enable_shared_with_static_runtimes=yes - ;; - - osf3*) - if test yes = "$GCC"; then - allow_undefined_flag=' $wl-expect_unresolved $wl\*' - archive_cmds='$CC -shared$allow_undefined_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname `test -n "$verstring" && func_echo_all "$wl-set_version $wl$verstring"` $wl-update_registry $wl$output_objdir/so_locations -o $lib' - else - allow_undefined_flag=' -expect_unresolved \*' - archive_cmds='$CC -shared$allow_undefined_flag $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry $output_objdir/so_locations -o $lib' - fi - archive_cmds_need_lc='no' - hardcode_libdir_flag_spec='$wl-rpath $wl$libdir' - hardcode_libdir_separator=: - ;; - - osf4* | osf5*) # as osf3* with the addition of -msym flag - if test yes = "$GCC"; then - allow_undefined_flag=' $wl-expect_unresolved $wl\*' - archive_cmds='$CC -shared$allow_undefined_flag $pic_flag $libobjs $deplibs $compiler_flags $wl-msym $wl-soname $wl$soname `test -n "$verstring" && func_echo_all "$wl-set_version $wl$verstring"` $wl-update_registry $wl$output_objdir/so_locations -o $lib' - hardcode_libdir_flag_spec='$wl-rpath $wl$libdir' - else - allow_undefined_flag=' -expect_unresolved \*' - archive_cmds='$CC -shared$allow_undefined_flag $libobjs $deplibs $compiler_flags -msym -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry $output_objdir/so_locations -o $lib' - archive_expsym_cmds='for i in `cat $export_symbols`; do printf "%s %s\\n" -exported_symbol "\$i" >> $lib.exp; done; printf "%s\\n" "-hidden">> $lib.exp~ - $CC -shared$allow_undefined_flag $wl-input $wl$lib.exp $compiler_flags $libobjs $deplibs -soname $soname `test -n "$verstring" && $ECHO "-set_version $verstring"` -update_registry $output_objdir/so_locations -o $lib~$RM $lib.exp' - - # Both c and cxx compiler support -rpath directly - hardcode_libdir_flag_spec='-rpath $libdir' - fi - archive_cmds_need_lc='no' - hardcode_libdir_separator=: - ;; - - solaris*) - no_undefined_flag=' -z defs' - if test yes = "$GCC"; then - wlarc='$wl' - archive_cmds='$CC -shared $pic_flag $wl-z ${wl}text $wl-h $wl$soname -o $lib $libobjs $deplibs $compiler_flags' - archive_expsym_cmds='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~ - $CC -shared $pic_flag $wl-z ${wl}text $wl-M $wl$lib.exp $wl-h $wl$soname -o $lib $libobjs $deplibs $compiler_flags~$RM $lib.exp' - else - case `$CC -V 2>&1` in - *"Compilers 5.0"*) - wlarc='' - archive_cmds='$LD -G$allow_undefined_flag -h $soname -o $lib $libobjs $deplibs $linker_flags' - archive_expsym_cmds='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~ - $LD -G$allow_undefined_flag -M $lib.exp -h $soname -o $lib $libobjs $deplibs $linker_flags~$RM $lib.exp' - ;; - *) - wlarc='$wl' - archive_cmds='$CC -G$allow_undefined_flag -h $soname -o $lib $libobjs $deplibs $compiler_flags' - archive_expsym_cmds='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~ - $CC -G$allow_undefined_flag -M $lib.exp -h $soname -o $lib $libobjs $deplibs $compiler_flags~$RM $lib.exp' - ;; - esac - fi - hardcode_libdir_flag_spec='-R$libdir' - hardcode_shlibpath_var=no - case $host_os in - solaris2.[0-5] | solaris2.[0-5].*) ;; - *) - # The compiler driver will combine and reorder linker options, - # but understands '-z linker_flag'. GCC discards it without '$wl', - # but is careful enough not to reorder. - # Supported since Solaris 2.6 (maybe 2.5.1?) - if test yes = "$GCC"; then - whole_archive_flag_spec='$wl-z ${wl}allextract$convenience $wl-z ${wl}defaultextract' - else - whole_archive_flag_spec='-z allextract$convenience -z defaultextract' - fi - ;; - esac - link_all_deplibs=yes - ;; - - sunos4*) - if test sequent = "$host_vendor"; then - # Use $CC to link under sequent, because it throws in some extra .o - # files that make .init and .fini sections work. - archive_cmds='$CC -G $wl-h $soname -o $lib $libobjs $deplibs $compiler_flags' - else - archive_cmds='$LD -assert pure-text -Bstatic -o $lib $libobjs $deplibs $linker_flags' - fi - hardcode_libdir_flag_spec='-L$libdir' - hardcode_direct=yes - hardcode_minus_L=yes - hardcode_shlibpath_var=no - ;; - - sysv4) - case $host_vendor in - sni) - archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' - hardcode_direct=yes # is this really true??? - ;; - siemens) - ## LD is ld it makes a PLAMLIB - ## CC just makes a GrossModule. - archive_cmds='$LD -G -o $lib $libobjs $deplibs $linker_flags' - reload_cmds='$CC -r -o $output$reload_objs' - hardcode_direct=no - ;; - motorola) - archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' - hardcode_direct=no #Motorola manual says yes, but my tests say they lie - ;; - esac - runpath_var='LD_RUN_PATH' - hardcode_shlibpath_var=no - ;; - - sysv4.3*) - archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' - hardcode_shlibpath_var=no - export_dynamic_flag_spec='-Bexport' - ;; - - sysv4*MP*) - if test -d /usr/nec; then - archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' - hardcode_shlibpath_var=no - runpath_var=LD_RUN_PATH - hardcode_runpath_var=yes - ld_shlibs=yes - fi - ;; - - sysv4*uw2* | sysv5OpenUNIX* | sysv5UnixWare7.[01].[10]* | unixware7* | sco3.2v5.0.[024]*) - no_undefined_flag='$wl-z,text' - archive_cmds_need_lc=no - hardcode_shlibpath_var=no - runpath_var='LD_RUN_PATH' - - if test yes = "$GCC"; then - archive_cmds='$CC -shared $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags' - archive_expsym_cmds='$CC -shared $wl-Bexport:$export_symbols $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags' - else - archive_cmds='$CC -G $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags' - archive_expsym_cmds='$CC -G $wl-Bexport:$export_symbols $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags' - fi - ;; - - sysv5* | sco3.2v5* | sco5v6*) - # Note: We CANNOT use -z defs as we might desire, because we do not - # link with -lc, and that would cause any symbols used from libc to - # always be unresolved, which means just about no library would - # ever link correctly. If we're not using GNU ld we use -z text - # though, which does catch some bad symbols but isn't as heavy-handed - # as -z defs. - no_undefined_flag='$wl-z,text' - allow_undefined_flag='$wl-z,nodefs' - archive_cmds_need_lc=no - hardcode_shlibpath_var=no - hardcode_libdir_flag_spec='$wl-R,$libdir' - hardcode_libdir_separator=':' - link_all_deplibs=yes - export_dynamic_flag_spec='$wl-Bexport' - runpath_var='LD_RUN_PATH' - - if test yes = "$GCC"; then - archive_cmds='$CC -shared $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags' - archive_expsym_cmds='$CC -shared $wl-Bexport:$export_symbols $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags' - else - archive_cmds='$CC -G $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags' - archive_expsym_cmds='$CC -G $wl-Bexport:$export_symbols $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags' - fi - ;; - - uts4*) - archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' - hardcode_libdir_flag_spec='-L$libdir' - hardcode_shlibpath_var=no - ;; - - *) - ld_shlibs=no - ;; - esac - - if test sni = "$host_vendor"; then - case $host in - sysv4 | sysv4.2uw2* | sysv4.3* | sysv5*) - export_dynamic_flag_spec='$wl-Blargedynsym' - ;; - esac - fi - fi - -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ld_shlibs" >&5 -printf "%s\n" "$ld_shlibs" >&6; } -test no = "$ld_shlibs" && can_build_shared=no - -with_gnu_ld=$with_gnu_ld - - - - - - - - - - - - - - - -# -# Do we need to explicitly link libc? -# -case "x$archive_cmds_need_lc" in -x|xyes) - # Assume -lc should be added - archive_cmds_need_lc=yes - - if test yes,yes = "$GCC,$enable_shared"; then - case $archive_cmds in - *'~'*) - # FIXME: we may have to deal with multi-command sequences. - ;; - '$CC '*) - # Test whether the compiler implicitly links with -lc since on some - # systems, -lgcc has to come before -lc. If gcc already passes -lc - # to ld, don't add -lc before -lgcc. - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether -lc should be explicitly linked in" >&5 -printf %s "checking whether -lc should be explicitly linked in... " >&6; } -if test ${lt_cv_archive_cmds_need_lc+y} -then : - printf %s "(cached) " >&6 -else $as_nop - $RM conftest* - echo "$lt_simple_compile_test_code" > conftest.$ac_ext - - if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5 - (eval $ac_compile) 2>&5 - ac_status=$? - printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 - test $ac_status = 0; } 2>conftest.err; then - soname=conftest - lib=conftest - libobjs=conftest.$ac_objext - deplibs= - wl=$lt_prog_compiler_wl - pic_flag=$lt_prog_compiler_pic - compiler_flags=-v - linker_flags=-v - verstring= - output_objdir=. - libname=conftest - lt_save_allow_undefined_flag=$allow_undefined_flag - allow_undefined_flag= - if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$archive_cmds 2\>\&1 \| $GREP \" -lc \" \>/dev/null 2\>\&1\""; } >&5 - (eval $archive_cmds 2\>\&1 \| $GREP \" -lc \" \>/dev/null 2\>\&1) 2>&5 - ac_status=$? - printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 - test $ac_status = 0; } - then - lt_cv_archive_cmds_need_lc=no - else - lt_cv_archive_cmds_need_lc=yes - fi - allow_undefined_flag=$lt_save_allow_undefined_flag - else - cat conftest.err 1>&5 - fi - $RM conftest* - -fi -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $lt_cv_archive_cmds_need_lc" >&5 -printf "%s\n" "$lt_cv_archive_cmds_need_lc" >&6; } - archive_cmds_need_lc=$lt_cv_archive_cmds_need_lc - ;; - esac - fi - ;; -esac - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking dynamic linker characteristics" >&5 -printf %s "checking dynamic linker characteristics... " >&6; } - -if test yes = "$GCC"; then - case $host_os in - darwin*) lt_awk_arg='/^libraries:/,/LR/' ;; - *) lt_awk_arg='/^libraries:/' ;; - esac - case $host_os in - mingw* | cegcc*) lt_sed_strip_eq='s|=\([A-Za-z]:\)|\1|g' ;; - *) lt_sed_strip_eq='s|=/|/|g' ;; - esac - lt_search_path_spec=`$CC -print-search-dirs | awk $lt_awk_arg | $SED -e "s/^libraries://" -e $lt_sed_strip_eq` - case $lt_search_path_spec in - *\;*) - # if the path contains ";" then we assume it to be the separator - # otherwise default to the standard path separator (i.e. ":") - it is - # assumed that no part of a normal pathname contains ";" but that should - # okay in the real world where ";" in dirpaths is itself problematic. - lt_search_path_spec=`$ECHO "$lt_search_path_spec" | $SED 's/;/ /g'` - ;; - *) - lt_search_path_spec=`$ECHO "$lt_search_path_spec" | $SED "s/$PATH_SEPARATOR/ /g"` - ;; - esac - # Ok, now we have the path, separated by spaces, we can step through it - # and add multilib dir if necessary... - lt_tmp_lt_search_path_spec= - lt_multi_os_dir=/`$CC $CPPFLAGS $CFLAGS $LDFLAGS -print-multi-os-directory 2>/dev/null` - # ...but if some path component already ends with the multilib dir we assume - # that all is fine and trust -print-search-dirs as is (GCC 4.2? or newer). - case "$lt_multi_os_dir; $lt_search_path_spec " in - "/; "* | "/.; "* | "/./; "* | *"$lt_multi_os_dir "* | *"$lt_multi_os_dir/ "*) - lt_multi_os_dir= - ;; - esac - for lt_sys_path in $lt_search_path_spec; do - if test -d "$lt_sys_path$lt_multi_os_dir"; then - lt_tmp_lt_search_path_spec="$lt_tmp_lt_search_path_spec $lt_sys_path$lt_multi_os_dir" - elif test -n "$lt_multi_os_dir"; then - test -d "$lt_sys_path" && \ - lt_tmp_lt_search_path_spec="$lt_tmp_lt_search_path_spec $lt_sys_path" - fi - done - lt_search_path_spec=`$ECHO "$lt_tmp_lt_search_path_spec" | awk ' -BEGIN {RS = " "; FS = "/|\n";} { - lt_foo = ""; - lt_count = 0; - for (lt_i = NF; lt_i > 0; lt_i--) { - if ($lt_i != "" && $lt_i != ".") { - if ($lt_i == "..") { - lt_count++; - } else { - if (lt_count == 0) { - lt_foo = "/" $lt_i lt_foo; - } else { - lt_count--; - } - } - } - } - if (lt_foo != "") { lt_freq[lt_foo]++; } - if (lt_freq[lt_foo] == 1) { print lt_foo; } -}'` - # AWK program above erroneously prepends '/' to C:/dos/paths - # for these hosts. - case $host_os in - mingw* | cegcc*) lt_search_path_spec=`$ECHO "$lt_search_path_spec" |\ - $SED 's|/\([A-Za-z]:\)|\1|g'` ;; - esac - sys_lib_search_path_spec=`$ECHO "$lt_search_path_spec" | $lt_NL2SP` -else - sys_lib_search_path_spec="/lib /usr/lib /usr/local/lib" -fi -library_names_spec= -libname_spec='lib$name' -soname_spec= -shrext_cmds=.so -postinstall_cmds= -postuninstall_cmds= -finish_cmds= -finish_eval= -shlibpath_var= -shlibpath_overrides_runpath=unknown -version_type=none -dynamic_linker="$host_os ld.so" -sys_lib_dlsearch_path_spec="/lib /usr/lib" -need_lib_prefix=unknown -hardcode_into_libs=no - -# when you set need_version to no, make sure it does not cause -set_version -# flags to be left without arguments -need_version=unknown - - - -case $host_os in -aix3*) - version_type=linux # correct to gnu/linux during the next big refactor - library_names_spec='$libname$release$shared_ext$versuffix $libname.a' - shlibpath_var=LIBPATH - - # AIX 3 has no versioning support, so we append a major version to the name. - soname_spec='$libname$release$shared_ext$major' - ;; - -aix[4-9]*) - version_type=linux # correct to gnu/linux during the next big refactor - need_lib_prefix=no - need_version=no - hardcode_into_libs=yes - if test ia64 = "$host_cpu"; then - # AIX 5 supports IA64 - library_names_spec='$libname$release$shared_ext$major $libname$release$shared_ext$versuffix $libname$shared_ext' - shlibpath_var=LD_LIBRARY_PATH - else - # With GCC up to 2.95.x, collect2 would create an import file - # for dependence libraries. The import file would start with - # the line '#! .'. This would cause the generated library to - # depend on '.', always an invalid library. This was fixed in - # development snapshots of GCC prior to 3.0. - case $host_os in - aix4 | aix4.[01] | aix4.[01].*) - if { echo '#if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 97)' - echo ' yes ' - echo '#endif'; } | $CC -E - | $GREP yes > /dev/null; then - : - else - can_build_shared=no - fi - ;; - esac - # Using Import Files as archive members, it is possible to support - # filename-based versioning of shared library archives on AIX. While - # this would work for both with and without runtime linking, it will - # prevent static linking of such archives. So we do filename-based - # shared library versioning with .so extension only, which is used - # when both runtime linking and shared linking is enabled. - # Unfortunately, runtime linking may impact performance, so we do - # not want this to be the default eventually. Also, we use the - # versioned .so libs for executables only if there is the -brtl - # linker flag in LDFLAGS as well, or --with-aix-soname=svr4 only. - # To allow for filename-based versioning support, we need to create - # libNAME.so.V as an archive file, containing: - # *) an Import File, referring to the versioned filename of the - # archive as well as the shared archive member, telling the - # bitwidth (32 or 64) of that shared object, and providing the - # list of exported symbols of that shared object, eventually - # decorated with the 'weak' keyword - # *) the shared object with the F_LOADONLY flag set, to really avoid - # it being seen by the linker. - # At run time we better use the real file rather than another symlink, - # but for link time we create the symlink libNAME.so -> libNAME.so.V - - case $with_aix_soname,$aix_use_runtimelinking in - # AIX (on Power*) has no versioning support, so currently we cannot hardcode correct - # soname into executable. Probably we can add versioning support to - # collect2, so additional links can be useful in future. - aix,yes) # traditional libtool - dynamic_linker='AIX unversionable lib.so' - # If using run time linking (on AIX 4.2 or later) use lib.so - # instead of lib.a to let people know that these are not - # typical AIX shared libraries. - library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' - ;; - aix,no) # traditional AIX only - dynamic_linker='AIX lib.a(lib.so.V)' - # We preserve .a as extension for shared libraries through AIX4.2 - # and later when we are not doing run time linking. - library_names_spec='$libname$release.a $libname.a' - soname_spec='$libname$release$shared_ext$major' - ;; - svr4,*) # full svr4 only - dynamic_linker="AIX lib.so.V($shared_archive_member_spec.o)" - library_names_spec='$libname$release$shared_ext$major $libname$shared_ext' - # We do not specify a path in Import Files, so LIBPATH fires. - shlibpath_overrides_runpath=yes - ;; - *,yes) # both, prefer svr4 - dynamic_linker="AIX lib.so.V($shared_archive_member_spec.o), lib.a(lib.so.V)" - library_names_spec='$libname$release$shared_ext$major $libname$shared_ext' - # unpreferred sharedlib libNAME.a needs extra handling - postinstall_cmds='test -n "$linkname" || linkname="$realname"~func_stripname "" ".so" "$linkname"~$install_shared_prog "$dir/$func_stripname_result.$libext" "$destdir/$func_stripname_result.$libext"~test -z "$tstripme" || test -z "$striplib" || $striplib "$destdir/$func_stripname_result.$libext"' - postuninstall_cmds='for n in $library_names $old_library; do :; done~func_stripname "" ".so" "$n"~test "$func_stripname_result" = "$n" || func_append rmfiles " $odir/$func_stripname_result.$libext"' - # We do not specify a path in Import Files, so LIBPATH fires. - shlibpath_overrides_runpath=yes - ;; - *,no) # both, prefer aix - dynamic_linker="AIX lib.a(lib.so.V), lib.so.V($shared_archive_member_spec.o)" - library_names_spec='$libname$release.a $libname.a' - soname_spec='$libname$release$shared_ext$major' - # unpreferred sharedlib libNAME.so.V and symlink libNAME.so need extra handling - postinstall_cmds='test -z "$dlname" || $install_shared_prog $dir/$dlname $destdir/$dlname~test -z "$tstripme" || test -z "$striplib" || $striplib $destdir/$dlname~test -n "$linkname" || linkname=$realname~func_stripname "" ".a" "$linkname"~(cd "$destdir" && $LN_S -f $dlname $func_stripname_result.so)' - postuninstall_cmds='test -z "$dlname" || func_append rmfiles " $odir/$dlname"~for n in $old_library $library_names; do :; done~func_stripname "" ".a" "$n"~func_append rmfiles " $odir/$func_stripname_result.so"' - ;; - esac - shlibpath_var=LIBPATH - fi - ;; - -amigaos*) - case $host_cpu in - powerpc) - # Since July 2007 AmigaOS4 officially supports .so libraries. - # When compiling the executable, add -use-dynld -Lsobjs: to the compileline. - library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' - ;; - m68k) - library_names_spec='$libname.ixlibrary $libname.a' - # Create ${libname}_ixlibrary.a entries in /sys/libs. - finish_eval='for lib in `ls $libdir/*.ixlibrary 2>/dev/null`; do libname=`func_echo_all "$lib" | $SED '\''s%^.*/\([^/]*\)\.ixlibrary$%\1%'\''`; $RM /sys/libs/${libname}_ixlibrary.a; $show "cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a"; cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a || exit 1; done' - ;; - esac - ;; - -beos*) - library_names_spec='$libname$shared_ext' - dynamic_linker="$host_os ld.so" - shlibpath_var=LIBRARY_PATH - ;; - -bsdi[45]*) - version_type=linux # correct to gnu/linux during the next big refactor - need_version=no - library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' - soname_spec='$libname$release$shared_ext$major' - finish_cmds='PATH="\$PATH:/sbin" ldconfig $libdir' - shlibpath_var=LD_LIBRARY_PATH - sys_lib_search_path_spec="/shlib /usr/lib /usr/X11/lib /usr/contrib/lib /lib /usr/local/lib" - sys_lib_dlsearch_path_spec="/shlib /usr/lib /usr/local/lib" - # the default ld.so.conf also contains /usr/contrib/lib and - # /usr/X11R6/lib (/usr/X11 is a link to /usr/X11R6), but let us allow - # libtool to hard-code these into programs - ;; - -cygwin* | mingw* | pw32* | cegcc*) - version_type=windows - shrext_cmds=.dll - need_version=no - need_lib_prefix=no - - case $GCC,$cc_basename in - yes,*) - # gcc - library_names_spec='$libname.dll.a' - # DLL is installed to $(libdir)/../bin by postinstall_cmds - postinstall_cmds='base_file=`basename \$file`~ - dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\$base_file'\''i; echo \$dlname'\''`~ - dldir=$destdir/`dirname \$dlpath`~ - test -d \$dldir || mkdir -p \$dldir~ - $install_prog $dir/$dlname \$dldir/$dlname~ - chmod a+x \$dldir/$dlname~ - if test -n '\''$stripme'\'' && test -n '\''$striplib'\''; then - eval '\''$striplib \$dldir/$dlname'\'' || exit \$?; - fi' - postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; echo \$dlname'\''`~ - dlpath=$dir/\$dldll~ - $RM \$dlpath' - shlibpath_overrides_runpath=yes - - case $host_os in - cygwin*) - # Cygwin DLLs use 'cyg' prefix rather than 'lib' - soname_spec='`echo $libname | sed -e 's/^lib/cyg/'``echo $release | $SED -e 's/[.]/-/g'`$versuffix$shared_ext' - - sys_lib_search_path_spec="$sys_lib_search_path_spec /usr/lib/w32api" - ;; - mingw* | cegcc*) - # MinGW DLLs use traditional 'lib' prefix - soname_spec='$libname`echo $release | $SED -e 's/[.]/-/g'`$versuffix$shared_ext' - ;; - pw32*) - # pw32 DLLs use 'pw' prefix rather than 'lib' - library_names_spec='`echo $libname | sed -e 's/^lib/pw/'``echo $release | $SED -e 's/[.]/-/g'`$versuffix$shared_ext' - ;; - esac - dynamic_linker='Win32 ld.exe' - ;; - - *,cl*) - # Native MSVC - libname_spec='$name' - soname_spec='$libname`echo $release | $SED -e 's/[.]/-/g'`$versuffix$shared_ext' - library_names_spec='$libname.dll.lib' - - case $build_os in - mingw*) - sys_lib_search_path_spec= - lt_save_ifs=$IFS - IFS=';' - for lt_path in $LIB - do - IFS=$lt_save_ifs - # Let DOS variable expansion print the short 8.3 style file name. - lt_path=`cd "$lt_path" 2>/dev/null && cmd //C "for %i in (".") do @echo %~si"` - sys_lib_search_path_spec="$sys_lib_search_path_spec $lt_path" - done - IFS=$lt_save_ifs - # Convert to MSYS style. - sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | sed -e 's|\\\\|/|g' -e 's| \\([a-zA-Z]\\):| /\\1|g' -e 's|^ ||'` - ;; - cygwin*) - # Convert to unix form, then to dos form, then back to unix form - # but this time dos style (no spaces!) so that the unix form looks - # like /cygdrive/c/PROGRA~1:/cygdr... - sys_lib_search_path_spec=`cygpath --path --unix "$LIB"` - sys_lib_search_path_spec=`cygpath --path --dos "$sys_lib_search_path_spec" 2>/dev/null` - sys_lib_search_path_spec=`cygpath --path --unix "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"` - ;; - *) - sys_lib_search_path_spec=$LIB - if $ECHO "$sys_lib_search_path_spec" | $GREP ';[c-zC-Z]:/' >/dev/null; then - # It is most probably a Windows format PATH. - sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | $SED -e 's/;/ /g'` - else - sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"` - fi - # FIXME: find the short name or the path components, as spaces are - # common. (e.g. "Program Files" -> "PROGRA~1") - ;; - esac - - # DLL is installed to $(libdir)/../bin by postinstall_cmds - postinstall_cmds='base_file=`basename \$file`~ - dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\$base_file'\''i; echo \$dlname'\''`~ - dldir=$destdir/`dirname \$dlpath`~ - test -d \$dldir || mkdir -p \$dldir~ - $install_prog $dir/$dlname \$dldir/$dlname' - postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; echo \$dlname'\''`~ - dlpath=$dir/\$dldll~ - $RM \$dlpath' - shlibpath_overrides_runpath=yes - dynamic_linker='Win32 link.exe' - ;; - - *) - # Assume MSVC wrapper - library_names_spec='$libname`echo $release | $SED -e 's/[.]/-/g'`$versuffix$shared_ext $libname.lib' - dynamic_linker='Win32 ld.exe' - ;; - esac - # FIXME: first we should search . and the directory the executable is in - shlibpath_var=PATH - ;; - -darwin* | rhapsody*) - dynamic_linker="$host_os dyld" - version_type=darwin - need_lib_prefix=no - need_version=no - library_names_spec='$libname$release$major$shared_ext $libname$shared_ext' - soname_spec='$libname$release$major$shared_ext' - shlibpath_overrides_runpath=yes - shlibpath_var=DYLD_LIBRARY_PATH - shrext_cmds='`test .$module = .yes && echo .so || echo .dylib`' - - sys_lib_search_path_spec="$sys_lib_search_path_spec /usr/local/lib" - sys_lib_dlsearch_path_spec='/usr/local/lib /lib /usr/lib' - ;; - -dgux*) - version_type=linux # correct to gnu/linux during the next big refactor - need_lib_prefix=no - need_version=no - library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' - soname_spec='$libname$release$shared_ext$major' - shlibpath_var=LD_LIBRARY_PATH - ;; - -freebsd* | dragonfly*) - # DragonFly does not have aout. When/if they implement a new - # versioning mechanism, adjust this. - if test -x /usr/bin/objformat; then - objformat=`/usr/bin/objformat` - else - case $host_os in - freebsd[23].*) objformat=aout ;; - *) objformat=elf ;; - esac - fi - version_type=freebsd-$objformat - case $version_type in - freebsd-elf*) - library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' - soname_spec='$libname$release$shared_ext$major' - need_version=no - need_lib_prefix=no - ;; - freebsd-*) - library_names_spec='$libname$release$shared_ext$versuffix $libname$shared_ext$versuffix' - need_version=yes - ;; - esac - shlibpath_var=LD_LIBRARY_PATH - case $host_os in - freebsd2.*) - shlibpath_overrides_runpath=yes - ;; - freebsd3.[01]* | freebsdelf3.[01]*) - shlibpath_overrides_runpath=yes - hardcode_into_libs=yes - ;; - freebsd3.[2-9]* | freebsdelf3.[2-9]* | \ - freebsd4.[0-5] | freebsdelf4.[0-5] | freebsd4.1.1 | freebsdelf4.1.1) - shlibpath_overrides_runpath=no - hardcode_into_libs=yes - ;; - *) # from 4.6 on, and DragonFly - shlibpath_overrides_runpath=yes - hardcode_into_libs=yes - ;; - esac - ;; - -haiku*) - version_type=linux # correct to gnu/linux during the next big refactor - need_lib_prefix=no - need_version=no - dynamic_linker="$host_os runtime_loader" - library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' - soname_spec='$libname$release$shared_ext$major' - shlibpath_var=LIBRARY_PATH - shlibpath_overrides_runpath=no - sys_lib_dlsearch_path_spec='/boot/home/config/lib /boot/common/lib /boot/system/lib' - hardcode_into_libs=yes - ;; - -hpux9* | hpux10* | hpux11*) - # Give a soname corresponding to the major version so that dld.sl refuses to - # link against other versions. - version_type=sunos - need_lib_prefix=no - need_version=no - case $host_cpu in - ia64*) - shrext_cmds='.so' - hardcode_into_libs=yes - dynamic_linker="$host_os dld.so" - shlibpath_var=LD_LIBRARY_PATH - shlibpath_overrides_runpath=yes # Unless +noenvvar is specified. - library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' - soname_spec='$libname$release$shared_ext$major' - if test 32 = "$HPUX_IA64_MODE"; then - sys_lib_search_path_spec="/usr/lib/hpux32 /usr/local/lib/hpux32 /usr/local/lib" - sys_lib_dlsearch_path_spec=/usr/lib/hpux32 - else - sys_lib_search_path_spec="/usr/lib/hpux64 /usr/local/lib/hpux64" - sys_lib_dlsearch_path_spec=/usr/lib/hpux64 - fi - ;; - hppa*64*) - shrext_cmds='.sl' - hardcode_into_libs=yes - dynamic_linker="$host_os dld.sl" - shlibpath_var=LD_LIBRARY_PATH # How should we handle SHLIB_PATH - shlibpath_overrides_runpath=yes # Unless +noenvvar is specified. - library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' - soname_spec='$libname$release$shared_ext$major' - sys_lib_search_path_spec="/usr/lib/pa20_64 /usr/ccs/lib/pa20_64" - sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec - ;; - *) - shrext_cmds='.sl' - dynamic_linker="$host_os dld.sl" - shlibpath_var=SHLIB_PATH - shlibpath_overrides_runpath=no # +s is required to enable SHLIB_PATH - library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' - soname_spec='$libname$release$shared_ext$major' - ;; - esac - # HP-UX runs *really* slowly unless shared libraries are mode 555, ... - postinstall_cmds='chmod 555 $lib' - # or fails outright, so override atomically: - install_override_mode=555 - ;; - -interix[3-9]*) - version_type=linux # correct to gnu/linux during the next big refactor - need_lib_prefix=no - need_version=no - library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' - soname_spec='$libname$release$shared_ext$major' - dynamic_linker='Interix 3.x ld.so.1 (PE, like ELF)' - shlibpath_var=LD_LIBRARY_PATH - shlibpath_overrides_runpath=no - hardcode_into_libs=yes - ;; - -irix5* | irix6* | nonstopux*) - case $host_os in - nonstopux*) version_type=nonstopux ;; - *) - if test yes = "$lt_cv_prog_gnu_ld"; then - version_type=linux # correct to gnu/linux during the next big refactor - else - version_type=irix - fi ;; - esac - need_lib_prefix=no - need_version=no - soname_spec='$libname$release$shared_ext$major' - library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$release$shared_ext $libname$shared_ext' - case $host_os in - irix5* | nonstopux*) - libsuff= shlibsuff= - ;; - *) - case $LD in # libtool.m4 will add one of these switches to LD - *-32|*"-32 "|*-melf32bsmip|*"-melf32bsmip ") - libsuff= shlibsuff= libmagic=32-bit;; - *-n32|*"-n32 "|*-melf32bmipn32|*"-melf32bmipn32 ") - libsuff=32 shlibsuff=N32 libmagic=N32;; - *-64|*"-64 "|*-melf64bmip|*"-melf64bmip ") - libsuff=64 shlibsuff=64 libmagic=64-bit;; - *) libsuff= shlibsuff= libmagic=never-match;; - esac - ;; - esac - shlibpath_var=LD_LIBRARY${shlibsuff}_PATH - shlibpath_overrides_runpath=no - sys_lib_search_path_spec="/usr/lib$libsuff /lib$libsuff /usr/local/lib$libsuff" - sys_lib_dlsearch_path_spec="/usr/lib$libsuff /lib$libsuff" - hardcode_into_libs=yes - ;; - -# No shared lib support for Linux oldld, aout, or coff. -linux*oldld* | linux*aout* | linux*coff*) - dynamic_linker=no - ;; - -linux*android*) - version_type=none # Android doesn't support versioned libraries. - need_lib_prefix=no - need_version=no - library_names_spec='$libname$release$shared_ext' - soname_spec='$libname$release$shared_ext' - finish_cmds= - shlibpath_var=LD_LIBRARY_PATH - shlibpath_overrides_runpath=yes - - # This implies no fast_install, which is unacceptable. - # Some rework will be needed to allow for fast_install - # before this can be enabled. - hardcode_into_libs=yes - - dynamic_linker='Android linker' - # Don't embed -rpath directories since the linker doesn't support them. - hardcode_libdir_flag_spec='-L$libdir' - ;; - -# This must be glibc/ELF. -linux* | k*bsd*-gnu | kopensolaris*-gnu | gnu*) - version_type=linux # correct to gnu/linux during the next big refactor - need_lib_prefix=no - need_version=no - library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' - soname_spec='$libname$release$shared_ext$major' - finish_cmds='PATH="\$PATH:/sbin" ldconfig -n $libdir' - shlibpath_var=LD_LIBRARY_PATH - shlibpath_overrides_runpath=no - - # Some binutils ld are patched to set DT_RUNPATH - if test ${lt_cv_shlibpath_overrides_runpath+y} -then : - printf %s "(cached) " >&6 -else $as_nop - lt_cv_shlibpath_overrides_runpath=no - save_LDFLAGS=$LDFLAGS - save_libdir=$libdir - eval "libdir=/foo; wl=\"$lt_prog_compiler_wl\"; \ - LDFLAGS=\"\$LDFLAGS $hardcode_libdir_flag_spec\"" - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - -int -main (void) -{ - - ; - return 0; -} -_ACEOF -if ac_fn_c_try_link "$LINENO" -then : - if ($OBJDUMP -p conftest$ac_exeext) 2>/dev/null | grep "RUNPATH.*$libdir" >/dev/null -then : - lt_cv_shlibpath_overrides_runpath=yes -fi -fi -rm -f core conftest.err conftest.$ac_objext conftest.beam \ - conftest$ac_exeext conftest.$ac_ext - LDFLAGS=$save_LDFLAGS - libdir=$save_libdir - -fi - - shlibpath_overrides_runpath=$lt_cv_shlibpath_overrides_runpath - - # This implies no fast_install, which is unacceptable. - # Some rework will be needed to allow for fast_install - # before this can be enabled. - hardcode_into_libs=yes - - # Ideally, we could use ldconfig to report *all* directores which are - # searched for libraries, however this is still not possible. Aside from not - # being certain /sbin/ldconfig is available, command - # 'ldconfig -N -X -v | grep ^/' on 64bit Fedora does not report /usr/lib64, - # even though it is searched at run-time. Try to do the best guess by - # appending ld.so.conf contents (and includes) to the search path. - if test -f /etc/ld.so.conf; then - lt_ld_extra=`awk '/^include / { system(sprintf("cd /etc; cat %s 2>/dev/null", \$2)); skip = 1; } { if (!skip) print \$0; skip = 0; }' < /etc/ld.so.conf | $SED -e 's/#.*//;/^[ ]*hwcap[ ]/d;s/[:, ]/ /g;s/=[^=]*$//;s/=[^= ]* / /g;s/"//g;/^$/d' | tr '\n' ' '` - sys_lib_dlsearch_path_spec="/lib /usr/lib $lt_ld_extra" - fi - - # We used to test for /lib/ld.so.1 and disable shared libraries on - # powerpc, because MkLinux only supported shared libraries with the - # GNU dynamic linker. Since this was broken with cross compilers, - # most powerpc-linux boxes support dynamic linking these days and - # people can always --disable-shared, the test was removed, and we - # assume the GNU/Linux dynamic linker is in use. - dynamic_linker='GNU/Linux ld.so' - ;; - -netbsdelf*-gnu) - version_type=linux - need_lib_prefix=no - need_version=no - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}' - soname_spec='${libname}${release}${shared_ext}$major' - shlibpath_var=LD_LIBRARY_PATH - shlibpath_overrides_runpath=no - hardcode_into_libs=yes - dynamic_linker='NetBSD ld.elf_so' - ;; - -netbsd*) - version_type=sunos - need_lib_prefix=no - need_version=no - if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then - library_names_spec='$libname$release$shared_ext$versuffix $libname$shared_ext$versuffix' - finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir' - dynamic_linker='NetBSD (a.out) ld.so' - else - library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' - soname_spec='$libname$release$shared_ext$major' - dynamic_linker='NetBSD ld.elf_so' - fi - shlibpath_var=LD_LIBRARY_PATH - shlibpath_overrides_runpath=yes - hardcode_into_libs=yes - ;; - -newsos6) - version_type=linux # correct to gnu/linux during the next big refactor - library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' - shlibpath_var=LD_LIBRARY_PATH - shlibpath_overrides_runpath=yes - ;; - -*nto* | *qnx*) - version_type=qnx - need_lib_prefix=no - need_version=no - library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' - soname_spec='$libname$release$shared_ext$major' - shlibpath_var=LD_LIBRARY_PATH - shlibpath_overrides_runpath=no - hardcode_into_libs=yes - dynamic_linker='ldqnx.so' - ;; - -openbsd* | bitrig*) - version_type=sunos - sys_lib_dlsearch_path_spec=/usr/lib - need_lib_prefix=no - if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`"; then - need_version=no - else - need_version=yes - fi - library_names_spec='$libname$release$shared_ext$versuffix $libname$shared_ext$versuffix' - finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir' - shlibpath_var=LD_LIBRARY_PATH - shlibpath_overrides_runpath=yes - ;; - -os2*) - libname_spec='$name' - version_type=windows - shrext_cmds=.dll - need_version=no - need_lib_prefix=no - # OS/2 can only load a DLL with a base name of 8 characters or less. - soname_spec='`test -n "$os2dllname" && libname="$os2dllname"; - v=$($ECHO $release$versuffix | tr -d .-); - n=$($ECHO $libname | cut -b -$((8 - ${#v})) | tr . _); - $ECHO $n$v`$shared_ext' - library_names_spec='${libname}_dll.$libext' - dynamic_linker='OS/2 ld.exe' - shlibpath_var=BEGINLIBPATH - sys_lib_search_path_spec="/lib /usr/lib /usr/local/lib" - sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec - postinstall_cmds='base_file=`basename \$file`~ - dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\$base_file'\''i; $ECHO \$dlname'\''`~ - dldir=$destdir/`dirname \$dlpath`~ - test -d \$dldir || mkdir -p \$dldir~ - $install_prog $dir/$dlname \$dldir/$dlname~ - chmod a+x \$dldir/$dlname~ - if test -n '\''$stripme'\'' && test -n '\''$striplib'\''; then - eval '\''$striplib \$dldir/$dlname'\'' || exit \$?; - fi' - postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; $ECHO \$dlname'\''`~ - dlpath=$dir/\$dldll~ - $RM \$dlpath' - ;; - -osf3* | osf4* | osf5*) - version_type=osf - need_lib_prefix=no - need_version=no - soname_spec='$libname$release$shared_ext$major' - library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' - shlibpath_var=LD_LIBRARY_PATH - sys_lib_search_path_spec="/usr/shlib /usr/ccs/lib /usr/lib/cmplrs/cc /usr/lib /usr/local/lib /var/shlib" - sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec - ;; - -rdos*) - dynamic_linker=no - ;; - -solaris*) - version_type=linux # correct to gnu/linux during the next big refactor - need_lib_prefix=no - need_version=no - library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' - soname_spec='$libname$release$shared_ext$major' - shlibpath_var=LD_LIBRARY_PATH - shlibpath_overrides_runpath=yes - hardcode_into_libs=yes - # ldd complains unless libraries are executable - postinstall_cmds='chmod +x $lib' - ;; - -sunos4*) - version_type=sunos - library_names_spec='$libname$release$shared_ext$versuffix $libname$shared_ext$versuffix' - finish_cmds='PATH="\$PATH:/usr/etc" ldconfig $libdir' - shlibpath_var=LD_LIBRARY_PATH - shlibpath_overrides_runpath=yes - if test yes = "$with_gnu_ld"; then - need_lib_prefix=no - fi - need_version=yes - ;; - -sysv4 | sysv4.3*) - version_type=linux # correct to gnu/linux during the next big refactor - library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' - soname_spec='$libname$release$shared_ext$major' - shlibpath_var=LD_LIBRARY_PATH - case $host_vendor in - sni) - shlibpath_overrides_runpath=no - need_lib_prefix=no - runpath_var=LD_RUN_PATH - ;; - siemens) - need_lib_prefix=no - ;; - motorola) - need_lib_prefix=no - need_version=no - shlibpath_overrides_runpath=no - sys_lib_search_path_spec='/lib /usr/lib /usr/ccs/lib' - ;; - esac - ;; - -sysv4*MP*) - if test -d /usr/nec; then - version_type=linux # correct to gnu/linux during the next big refactor - library_names_spec='$libname$shared_ext.$versuffix $libname$shared_ext.$major $libname$shared_ext' - soname_spec='$libname$shared_ext.$major' - shlibpath_var=LD_LIBRARY_PATH - fi - ;; - -sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*) - version_type=sco - need_lib_prefix=no - need_version=no - library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext $libname$shared_ext' - soname_spec='$libname$release$shared_ext$major' - shlibpath_var=LD_LIBRARY_PATH - shlibpath_overrides_runpath=yes - hardcode_into_libs=yes - if test yes = "$with_gnu_ld"; then - sys_lib_search_path_spec='/usr/local/lib /usr/gnu/lib /usr/ccs/lib /usr/lib /lib' - else - sys_lib_search_path_spec='/usr/ccs/lib /usr/lib' - case $host_os in - sco3.2v5*) - sys_lib_search_path_spec="$sys_lib_search_path_spec /lib" - ;; - esac - fi - sys_lib_dlsearch_path_spec='/usr/lib' - ;; - -tpf*) - # TPF is a cross-target only. Preferred cross-host = GNU/Linux. - version_type=linux # correct to gnu/linux during the next big refactor - need_lib_prefix=no - need_version=no - library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' - shlibpath_var=LD_LIBRARY_PATH - shlibpath_overrides_runpath=no - hardcode_into_libs=yes - ;; - -uts4*) - version_type=linux # correct to gnu/linux during the next big refactor - library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' - soname_spec='$libname$release$shared_ext$major' - shlibpath_var=LD_LIBRARY_PATH - ;; - -*) - dynamic_linker=no - ;; -esac -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $dynamic_linker" >&5 -printf "%s\n" "$dynamic_linker" >&6; } -test no = "$dynamic_linker" && can_build_shared=no - -variables_saved_for_relink="PATH $shlibpath_var $runpath_var" -if test yes = "$GCC"; then - variables_saved_for_relink="$variables_saved_for_relink GCC_EXEC_PREFIX COMPILER_PATH LIBRARY_PATH" -fi - -if test set = "${lt_cv_sys_lib_search_path_spec+set}"; then - sys_lib_search_path_spec=$lt_cv_sys_lib_search_path_spec -fi - -if test set = "${lt_cv_sys_lib_dlsearch_path_spec+set}"; then - sys_lib_dlsearch_path_spec=$lt_cv_sys_lib_dlsearch_path_spec -fi - -# remember unaugmented sys_lib_dlsearch_path content for libtool script decls... -configure_time_dlsearch_path=$sys_lib_dlsearch_path_spec - -# ... but it needs LT_SYS_LIBRARY_PATH munging for other configure-time code -func_munge_path_list sys_lib_dlsearch_path_spec "$LT_SYS_LIBRARY_PATH" - -# to be used as default LT_SYS_LIBRARY_PATH value in generated libtool -configure_time_lt_sys_library_path=$LT_SYS_LIBRARY_PATH - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking how to hardcode library paths into programs" >&5 -printf %s "checking how to hardcode library paths into programs... " >&6; } -hardcode_action= -if test -n "$hardcode_libdir_flag_spec" || - test -n "$runpath_var" || - test yes = "$hardcode_automatic"; then - - # We can hardcode non-existent directories. - if test no != "$hardcode_direct" && - # If the only mechanism to avoid hardcoding is shlibpath_var, we - # have to relink, otherwise we might link with an installed library - # when we should be linking with a yet-to-be-installed one - ## test no != "$_LT_TAGVAR(hardcode_shlibpath_var, )" && - test no != "$hardcode_minus_L"; then - # Linking always hardcodes the temporary library directory. - hardcode_action=relink - else - # We can link without hardcoding, and we can hardcode nonexisting dirs. - hardcode_action=immediate - fi -else - # We cannot hardcode anything, or else we can only hardcode existing - # directories. - hardcode_action=unsupported -fi -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $hardcode_action" >&5 -printf "%s\n" "$hardcode_action" >&6; } - -if test relink = "$hardcode_action" || - test yes = "$inherit_rpath"; then - # Fast installation is not supported - enable_fast_install=no -elif test yes = "$shlibpath_overrides_runpath" || - test no = "$enable_shared"; then - # Fast installation is not necessary - enable_fast_install=needless -fi - - - - - - - if test yes != "$enable_dlopen"; then - enable_dlopen=unknown - enable_dlopen_self=unknown - enable_dlopen_self_static=unknown -else - lt_cv_dlopen=no - lt_cv_dlopen_libs= - - case $host_os in - beos*) - lt_cv_dlopen=load_add_on - lt_cv_dlopen_libs= - lt_cv_dlopen_self=yes - ;; - - mingw* | pw32* | cegcc*) - lt_cv_dlopen=LoadLibrary - lt_cv_dlopen_libs= - ;; - - cygwin*) - lt_cv_dlopen=dlopen - lt_cv_dlopen_libs= - ;; - - darwin*) - # if libdl is installed we need to link against it - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for dlopen in -ldl" >&5 -printf %s "checking for dlopen in -ldl... " >&6; } -if test ${ac_cv_lib_dl_dlopen+y} -then : - printf %s "(cached) " >&6 -else $as_nop - ac_check_lib_save_LIBS=$LIBS -LIBS="-ldl $LIBS" -cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - -/* Override any GCC internal prototype to avoid an error. - Use char because int might match the return type of a GCC - builtin and then its argument prototype would still apply. */ -char dlopen (); -int -main (void) -{ -return dlopen (); - ; - return 0; -} -_ACEOF -if ac_fn_c_try_link "$LINENO" -then : - ac_cv_lib_dl_dlopen=yes -else $as_nop - ac_cv_lib_dl_dlopen=no -fi -rm -f core conftest.err conftest.$ac_objext conftest.beam \ - conftest$ac_exeext conftest.$ac_ext -LIBS=$ac_check_lib_save_LIBS -fi -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_dl_dlopen" >&5 -printf "%s\n" "$ac_cv_lib_dl_dlopen" >&6; } -if test "x$ac_cv_lib_dl_dlopen" = xyes -then : - lt_cv_dlopen=dlopen lt_cv_dlopen_libs=-ldl -else $as_nop - - lt_cv_dlopen=dyld - lt_cv_dlopen_libs= - lt_cv_dlopen_self=yes - -fi - - ;; - - tpf*) - # Don't try to run any link tests for TPF. We know it's impossible - # because TPF is a cross-compiler, and we know how we open DSOs. - lt_cv_dlopen=dlopen - lt_cv_dlopen_libs= - lt_cv_dlopen_self=no - ;; - - *) - ac_fn_c_check_func "$LINENO" "shl_load" "ac_cv_func_shl_load" -if test "x$ac_cv_func_shl_load" = xyes -then : - lt_cv_dlopen=shl_load -else $as_nop - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for shl_load in -ldld" >&5 -printf %s "checking for shl_load in -ldld... " >&6; } -if test ${ac_cv_lib_dld_shl_load+y} -then : - printf %s "(cached) " >&6 -else $as_nop - ac_check_lib_save_LIBS=$LIBS -LIBS="-ldld $LIBS" -cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - -/* Override any GCC internal prototype to avoid an error. - Use char because int might match the return type of a GCC - builtin and then its argument prototype would still apply. */ -char shl_load (); -int -main (void) -{ -return shl_load (); - ; - return 0; -} -_ACEOF -if ac_fn_c_try_link "$LINENO" -then : - ac_cv_lib_dld_shl_load=yes -else $as_nop - ac_cv_lib_dld_shl_load=no -fi -rm -f core conftest.err conftest.$ac_objext conftest.beam \ - conftest$ac_exeext conftest.$ac_ext -LIBS=$ac_check_lib_save_LIBS -fi -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_dld_shl_load" >&5 -printf "%s\n" "$ac_cv_lib_dld_shl_load" >&6; } -if test "x$ac_cv_lib_dld_shl_load" = xyes -then : - lt_cv_dlopen=shl_load lt_cv_dlopen_libs=-ldld -else $as_nop - ac_fn_c_check_func "$LINENO" "dlopen" "ac_cv_func_dlopen" -if test "x$ac_cv_func_dlopen" = xyes -then : - lt_cv_dlopen=dlopen -else $as_nop - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for dlopen in -ldl" >&5 -printf %s "checking for dlopen in -ldl... " >&6; } -if test ${ac_cv_lib_dl_dlopen+y} -then : - printf %s "(cached) " >&6 -else $as_nop - ac_check_lib_save_LIBS=$LIBS -LIBS="-ldl $LIBS" -cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - -/* Override any GCC internal prototype to avoid an error. - Use char because int might match the return type of a GCC - builtin and then its argument prototype would still apply. */ -char dlopen (); -int -main (void) -{ -return dlopen (); - ; - return 0; -} -_ACEOF -if ac_fn_c_try_link "$LINENO" -then : - ac_cv_lib_dl_dlopen=yes -else $as_nop - ac_cv_lib_dl_dlopen=no -fi -rm -f core conftest.err conftest.$ac_objext conftest.beam \ - conftest$ac_exeext conftest.$ac_ext -LIBS=$ac_check_lib_save_LIBS -fi -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_dl_dlopen" >&5 -printf "%s\n" "$ac_cv_lib_dl_dlopen" >&6; } -if test "x$ac_cv_lib_dl_dlopen" = xyes -then : - lt_cv_dlopen=dlopen lt_cv_dlopen_libs=-ldl -else $as_nop - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for dlopen in -lsvld" >&5 -printf %s "checking for dlopen in -lsvld... " >&6; } -if test ${ac_cv_lib_svld_dlopen+y} -then : - printf %s "(cached) " >&6 -else $as_nop - ac_check_lib_save_LIBS=$LIBS -LIBS="-lsvld $LIBS" -cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - -/* Override any GCC internal prototype to avoid an error. - Use char because int might match the return type of a GCC - builtin and then its argument prototype would still apply. */ -char dlopen (); -int -main (void) -{ -return dlopen (); - ; - return 0; -} -_ACEOF -if ac_fn_c_try_link "$LINENO" -then : - ac_cv_lib_svld_dlopen=yes -else $as_nop - ac_cv_lib_svld_dlopen=no -fi -rm -f core conftest.err conftest.$ac_objext conftest.beam \ - conftest$ac_exeext conftest.$ac_ext -LIBS=$ac_check_lib_save_LIBS -fi -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_svld_dlopen" >&5 -printf "%s\n" "$ac_cv_lib_svld_dlopen" >&6; } -if test "x$ac_cv_lib_svld_dlopen" = xyes -then : - lt_cv_dlopen=dlopen lt_cv_dlopen_libs=-lsvld -else $as_nop - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for dld_link in -ldld" >&5 -printf %s "checking for dld_link in -ldld... " >&6; } -if test ${ac_cv_lib_dld_dld_link+y} -then : - printf %s "(cached) " >&6 -else $as_nop - ac_check_lib_save_LIBS=$LIBS -LIBS="-ldld $LIBS" -cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - -/* Override any GCC internal prototype to avoid an error. - Use char because int might match the return type of a GCC - builtin and then its argument prototype would still apply. */ -char dld_link (); -int -main (void) -{ -return dld_link (); - ; - return 0; -} -_ACEOF -if ac_fn_c_try_link "$LINENO" -then : - ac_cv_lib_dld_dld_link=yes -else $as_nop - ac_cv_lib_dld_dld_link=no -fi -rm -f core conftest.err conftest.$ac_objext conftest.beam \ - conftest$ac_exeext conftest.$ac_ext -LIBS=$ac_check_lib_save_LIBS -fi -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_dld_dld_link" >&5 -printf "%s\n" "$ac_cv_lib_dld_dld_link" >&6; } -if test "x$ac_cv_lib_dld_dld_link" = xyes -then : - lt_cv_dlopen=dld_link lt_cv_dlopen_libs=-ldld -fi - - -fi - - -fi - - -fi - - -fi - - -fi - - ;; - esac - - if test no = "$lt_cv_dlopen"; then - enable_dlopen=no - else - enable_dlopen=yes - fi - - case $lt_cv_dlopen in - dlopen) - save_CPPFLAGS=$CPPFLAGS - test yes = "$ac_cv_header_dlfcn_h" && CPPFLAGS="$CPPFLAGS -DHAVE_DLFCN_H" - - save_LDFLAGS=$LDFLAGS - wl=$lt_prog_compiler_wl eval LDFLAGS=\"\$LDFLAGS $export_dynamic_flag_spec\" - - save_LIBS=$LIBS - LIBS="$lt_cv_dlopen_libs $LIBS" - - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether a program can dlopen itself" >&5 -printf %s "checking whether a program can dlopen itself... " >&6; } -if test ${lt_cv_dlopen_self+y} -then : - printf %s "(cached) " >&6 -else $as_nop - if test yes = "$cross_compiling"; then : - lt_cv_dlopen_self=cross -else - lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 - lt_status=$lt_dlunknown - cat > conftest.$ac_ext <<_LT_EOF -#line $LINENO "configure" -#include "confdefs.h" - -#if HAVE_DLFCN_H -#include -#endif - -#include - -#ifdef RTLD_GLOBAL -# define LT_DLGLOBAL RTLD_GLOBAL -#else -# ifdef DL_GLOBAL -# define LT_DLGLOBAL DL_GLOBAL -# else -# define LT_DLGLOBAL 0 -# endif -#endif - -/* We may have to define LT_DLLAZY_OR_NOW in the command line if we - find out it does not work in some platform. */ -#ifndef LT_DLLAZY_OR_NOW -# ifdef RTLD_LAZY -# define LT_DLLAZY_OR_NOW RTLD_LAZY -# else -# ifdef DL_LAZY -# define LT_DLLAZY_OR_NOW DL_LAZY -# else -# ifdef RTLD_NOW -# define LT_DLLAZY_OR_NOW RTLD_NOW -# else -# ifdef DL_NOW -# define LT_DLLAZY_OR_NOW DL_NOW -# else -# define LT_DLLAZY_OR_NOW 0 -# endif -# endif -# endif -# endif -#endif - -/* When -fvisibility=hidden is used, assume the code has been annotated - correspondingly for the symbols needed. */ -#if defined __GNUC__ && (((__GNUC__ == 3) && (__GNUC_MINOR__ >= 3)) || (__GNUC__ > 3)) -int fnord () __attribute__((visibility("default"))); -#endif - -int fnord () { return 42; } -int main () -{ - void *self = dlopen (0, LT_DLGLOBAL|LT_DLLAZY_OR_NOW); - int status = $lt_dlunknown; - - if (self) - { - if (dlsym (self,"fnord")) status = $lt_dlno_uscore; - else - { - if (dlsym( self,"_fnord")) status = $lt_dlneed_uscore; - else puts (dlerror ()); - } - /* dlclose (self); */ - } - else - puts (dlerror ()); - - return status; -} -_LT_EOF - if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_link\""; } >&5 - (eval $ac_link) 2>&5 - ac_status=$? - printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 - test $ac_status = 0; } && test -s "conftest$ac_exeext" 2>/dev/null; then - (./conftest; exit; ) >&5 2>/dev/null - lt_status=$? - case x$lt_status in - x$lt_dlno_uscore) lt_cv_dlopen_self=yes ;; - x$lt_dlneed_uscore) lt_cv_dlopen_self=yes ;; - x$lt_dlunknown|x*) lt_cv_dlopen_self=no ;; - esac - else : - # compilation failed - lt_cv_dlopen_self=no - fi -fi -rm -fr conftest* - - -fi -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $lt_cv_dlopen_self" >&5 -printf "%s\n" "$lt_cv_dlopen_self" >&6; } - - if test yes = "$lt_cv_dlopen_self"; then - wl=$lt_prog_compiler_wl eval LDFLAGS=\"\$LDFLAGS $lt_prog_compiler_static\" - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether a statically linked program can dlopen itself" >&5 -printf %s "checking whether a statically linked program can dlopen itself... " >&6; } -if test ${lt_cv_dlopen_self_static+y} -then : - printf %s "(cached) " >&6 -else $as_nop - if test yes = "$cross_compiling"; then : - lt_cv_dlopen_self_static=cross -else - lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 - lt_status=$lt_dlunknown - cat > conftest.$ac_ext <<_LT_EOF -#line $LINENO "configure" -#include "confdefs.h" - -#if HAVE_DLFCN_H -#include -#endif - -#include - -#ifdef RTLD_GLOBAL -# define LT_DLGLOBAL RTLD_GLOBAL -#else -# ifdef DL_GLOBAL -# define LT_DLGLOBAL DL_GLOBAL -# else -# define LT_DLGLOBAL 0 -# endif -#endif - -/* We may have to define LT_DLLAZY_OR_NOW in the command line if we - find out it does not work in some platform. */ -#ifndef LT_DLLAZY_OR_NOW -# ifdef RTLD_LAZY -# define LT_DLLAZY_OR_NOW RTLD_LAZY -# else -# ifdef DL_LAZY -# define LT_DLLAZY_OR_NOW DL_LAZY -# else -# ifdef RTLD_NOW -# define LT_DLLAZY_OR_NOW RTLD_NOW -# else -# ifdef DL_NOW -# define LT_DLLAZY_OR_NOW DL_NOW -# else -# define LT_DLLAZY_OR_NOW 0 -# endif -# endif -# endif -# endif -#endif - -/* When -fvisibility=hidden is used, assume the code has been annotated - correspondingly for the symbols needed. */ -#if defined __GNUC__ && (((__GNUC__ == 3) && (__GNUC_MINOR__ >= 3)) || (__GNUC__ > 3)) -int fnord () __attribute__((visibility("default"))); -#endif - -int fnord () { return 42; } -int main () -{ - void *self = dlopen (0, LT_DLGLOBAL|LT_DLLAZY_OR_NOW); - int status = $lt_dlunknown; - - if (self) - { - if (dlsym (self,"fnord")) status = $lt_dlno_uscore; - else - { - if (dlsym( self,"_fnord")) status = $lt_dlneed_uscore; - else puts (dlerror ()); - } - /* dlclose (self); */ - } - else - puts (dlerror ()); - - return status; -} -_LT_EOF - if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_link\""; } >&5 - (eval $ac_link) 2>&5 - ac_status=$? - printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 - test $ac_status = 0; } && test -s "conftest$ac_exeext" 2>/dev/null; then - (./conftest; exit; ) >&5 2>/dev/null - lt_status=$? - case x$lt_status in - x$lt_dlno_uscore) lt_cv_dlopen_self_static=yes ;; - x$lt_dlneed_uscore) lt_cv_dlopen_self_static=yes ;; - x$lt_dlunknown|x*) lt_cv_dlopen_self_static=no ;; - esac - else : - # compilation failed - lt_cv_dlopen_self_static=no - fi -fi -rm -fr conftest* - - -fi -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $lt_cv_dlopen_self_static" >&5 -printf "%s\n" "$lt_cv_dlopen_self_static" >&6; } - fi - - CPPFLAGS=$save_CPPFLAGS - LDFLAGS=$save_LDFLAGS - LIBS=$save_LIBS - ;; - esac - - case $lt_cv_dlopen_self in - yes|no) enable_dlopen_self=$lt_cv_dlopen_self ;; - *) enable_dlopen_self=unknown ;; - esac - - case $lt_cv_dlopen_self_static in - yes|no) enable_dlopen_self_static=$lt_cv_dlopen_self_static ;; - *) enable_dlopen_self_static=unknown ;; - esac -fi - - - - - - - - - - - - - - - - - -striplib= -old_striplib= -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether stripping libraries is possible" >&5 -printf %s "checking whether stripping libraries is possible... " >&6; } -if test -n "$STRIP" && $STRIP -V 2>&1 | $GREP "GNU strip" >/dev/null; then - test -z "$old_striplib" && old_striplib="$STRIP --strip-debug" - test -z "$striplib" && striplib="$STRIP --strip-unneeded" - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -printf "%s\n" "yes" >&6; } -else -# FIXME - insert some real tests, host_os isn't really good enough - case $host_os in - darwin*) - if test -n "$STRIP"; then - striplib="$STRIP -x" - old_striplib="$STRIP -S" - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -printf "%s\n" "yes" >&6; } - else - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 -printf "%s\n" "no" >&6; } - fi - ;; - *) - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 -printf "%s\n" "no" >&6; } - ;; - esac -fi - - - - - - - - - - - - - # Report what library types will actually be built - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking if libtool supports shared libraries" >&5 -printf %s "checking if libtool supports shared libraries... " >&6; } - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $can_build_shared" >&5 -printf "%s\n" "$can_build_shared" >&6; } - - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether to build shared libraries" >&5 -printf %s "checking whether to build shared libraries... " >&6; } - test no = "$can_build_shared" && enable_shared=no - - # On AIX, shared libraries and static libraries use the same namespace, and - # are all built from PIC. - case $host_os in - aix3*) - test yes = "$enable_shared" && enable_static=no - if test -n "$RANLIB"; then - archive_cmds="$archive_cmds~\$RANLIB \$lib" - postinstall_cmds='$RANLIB $lib' - fi - ;; - - aix[4-9]*) - if test ia64 != "$host_cpu"; then - case $enable_shared,$with_aix_soname,$aix_use_runtimelinking in - yes,aix,yes) ;; # shared object as lib.so file only - yes,svr4,*) ;; # shared object as lib.so archive member only - yes,*) enable_static=no ;; # shared object in lib.a archive as well - esac - fi - ;; - esac - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $enable_shared" >&5 -printf "%s\n" "$enable_shared" >&6; } - - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether to build static libraries" >&5 -printf %s "checking whether to build static libraries... " >&6; } - # Make sure either enable_shared or enable_static is yes. - test yes = "$enable_shared" || enable_static=yes - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $enable_static" >&5 -printf "%s\n" "$enable_static" >&6; } - - - - -fi -ac_ext=cpp -ac_cpp='$CXXCPP $CPPFLAGS' -ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' -ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' -ac_compiler_gnu=$ac_cv_cxx_compiler_gnu - -CC=$lt_save_CC - - if test -n "$CXX" && ( test no != "$CXX" && - ( (test g++ = "$CXX" && `g++ -v >/dev/null 2>&1` ) || - (test g++ != "$CXX"))); then - ac_ext=cpp -ac_cpp='$CXXCPP $CPPFLAGS' -ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' -ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' -ac_compiler_gnu=$ac_cv_cxx_compiler_gnu -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking how to run the C++ preprocessor" >&5 -printf %s "checking how to run the C++ preprocessor... " >&6; } -if test -z "$CXXCPP"; then - if test ${ac_cv_prog_CXXCPP+y} -then : - printf %s "(cached) " >&6 -else $as_nop - # Double quotes because $CXX needs to be expanded - for CXXCPP in "$CXX -E" cpp /lib/cpp - do - ac_preproc_ok=false -for ac_cxx_preproc_warn_flag in '' yes -do - # Use a header file that comes with gcc, so configuring glibc - # with a fresh cross-compiler works. - # On the NeXT, cc -E runs the code through the compiler's parser, - # not just through cpp. "Syntax error" is here to catch this case. - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -#include - Syntax error -_ACEOF -if ac_fn_cxx_try_cpp "$LINENO" -then : - -else $as_nop - # Broken: fails on valid input. -continue -fi -rm -f conftest.err conftest.i conftest.$ac_ext - - # OK, works on sane cases. Now check whether nonexistent headers - # can be detected and how. - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -#include -_ACEOF -if ac_fn_cxx_try_cpp "$LINENO" -then : - # Broken: success on invalid input. -continue -else $as_nop - # Passes both tests. -ac_preproc_ok=: -break -fi -rm -f conftest.err conftest.i conftest.$ac_ext - -done -# Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped. -rm -f conftest.i conftest.err conftest.$ac_ext -if $ac_preproc_ok -then : - break -fi - - done - ac_cv_prog_CXXCPP=$CXXCPP - -fi - CXXCPP=$ac_cv_prog_CXXCPP -else - ac_cv_prog_CXXCPP=$CXXCPP -fi -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $CXXCPP" >&5 -printf "%s\n" "$CXXCPP" >&6; } -ac_preproc_ok=false -for ac_cxx_preproc_warn_flag in '' yes -do - # Use a header file that comes with gcc, so configuring glibc - # with a fresh cross-compiler works. - # On the NeXT, cc -E runs the code through the compiler's parser, - # not just through cpp. "Syntax error" is here to catch this case. - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -#include - Syntax error -_ACEOF -if ac_fn_cxx_try_cpp "$LINENO" -then : - -else $as_nop - # Broken: fails on valid input. -continue -fi -rm -f conftest.err conftest.i conftest.$ac_ext - - # OK, works on sane cases. Now check whether nonexistent headers - # can be detected and how. - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -#include -_ACEOF -if ac_fn_cxx_try_cpp "$LINENO" -then : - # Broken: success on invalid input. -continue -else $as_nop - # Passes both tests. -ac_preproc_ok=: -break -fi -rm -f conftest.err conftest.i conftest.$ac_ext - -done -# Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped. -rm -f conftest.i conftest.err conftest.$ac_ext -if $ac_preproc_ok -then : - -else $as_nop - { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 -printf "%s\n" "$as_me: error: in \`$ac_pwd':" >&2;} -as_fn_error $? "C++ preprocessor \"$CXXCPP\" fails sanity check -See \`config.log' for more details" "$LINENO" 5; } -fi - -ac_ext=cpp -ac_cpp='$CXXCPP $CPPFLAGS' -ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' -ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' -ac_compiler_gnu=$ac_cv_cxx_compiler_gnu - -else - _lt_caught_CXX_error=yes -fi - -ac_ext=cpp -ac_cpp='$CXXCPP $CPPFLAGS' -ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' -ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' -ac_compiler_gnu=$ac_cv_cxx_compiler_gnu - -archive_cmds_need_lc_CXX=no -allow_undefined_flag_CXX= -always_export_symbols_CXX=no -archive_expsym_cmds_CXX= -compiler_needs_object_CXX=no -export_dynamic_flag_spec_CXX= -hardcode_direct_CXX=no -hardcode_direct_absolute_CXX=no -hardcode_libdir_flag_spec_CXX= -hardcode_libdir_separator_CXX= -hardcode_minus_L_CXX=no -hardcode_shlibpath_var_CXX=unsupported -hardcode_automatic_CXX=no -inherit_rpath_CXX=no -module_cmds_CXX= -module_expsym_cmds_CXX= -link_all_deplibs_CXX=unknown -old_archive_cmds_CXX=$old_archive_cmds -reload_flag_CXX=$reload_flag -reload_cmds_CXX=$reload_cmds -no_undefined_flag_CXX= -whole_archive_flag_spec_CXX= -enable_shared_with_static_runtimes_CXX=no - -# Source file extension for C++ test sources. -ac_ext=cpp - -# Object file extension for compiled C++ test sources. -objext=o -objext_CXX=$objext - -# No sense in running all these tests if we already determined that -# the CXX compiler isn't working. Some variables (like enable_shared) -# are currently assumed to apply to all compilers on this platform, -# and will be corrupted by setting them based on a non-working compiler. -if test yes != "$_lt_caught_CXX_error"; then - # Code to be used in simple compile tests - lt_simple_compile_test_code="int some_variable = 0;" - - # Code to be used in simple link tests - lt_simple_link_test_code='int main(int, char *[]) { return(0); }' - - # ltmain only uses $CC for tagged configurations so make sure $CC is set. - - - - - - -# If no C compiler was specified, use CC. -LTCC=${LTCC-"$CC"} - -# If no C compiler flags were specified, use CFLAGS. -LTCFLAGS=${LTCFLAGS-"$CFLAGS"} - -# Allow CC to be a program name with arguments. -compiler=$CC - - - # save warnings/boilerplate of simple test code - ac_outfile=conftest.$ac_objext -echo "$lt_simple_compile_test_code" >conftest.$ac_ext -eval "$ac_compile" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err -_lt_compiler_boilerplate=`cat conftest.err` -$RM conftest* - - ac_outfile=conftest.$ac_objext -echo "$lt_simple_link_test_code" >conftest.$ac_ext -eval "$ac_link" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err -_lt_linker_boilerplate=`cat conftest.err` -$RM -r conftest* - - - # Allow CC to be a program name with arguments. - lt_save_CC=$CC - lt_save_CFLAGS=$CFLAGS - lt_save_LD=$LD - lt_save_GCC=$GCC - GCC=$GXX - lt_save_with_gnu_ld=$with_gnu_ld - lt_save_path_LD=$lt_cv_path_LD - if test -n "${lt_cv_prog_gnu_ldcxx+set}"; then - lt_cv_prog_gnu_ld=$lt_cv_prog_gnu_ldcxx - else - $as_unset lt_cv_prog_gnu_ld - fi - if test -n "${lt_cv_path_LDCXX+set}"; then - lt_cv_path_LD=$lt_cv_path_LDCXX - else - $as_unset lt_cv_path_LD - fi - test -z "${LDCXX+set}" || LD=$LDCXX - CC=${CXX-"c++"} - CFLAGS=$CXXFLAGS - compiler=$CC - compiler_CXX=$CC - func_cc_basename $compiler -cc_basename=$func_cc_basename_result - - - if test -n "$compiler"; then - # We don't want -fno-exception when compiling C++ code, so set the - # no_builtin_flag separately - if test yes = "$GXX"; then - lt_prog_compiler_no_builtin_flag_CXX=' -fno-builtin' - else - lt_prog_compiler_no_builtin_flag_CXX= - fi - - if test yes = "$GXX"; then - # Set up default GNU C++ configuration - - - -# Check whether --with-gnu-ld was given. -if test ${with_gnu_ld+y} -then : - withval=$with_gnu_ld; test no = "$withval" || with_gnu_ld=yes -else $as_nop - with_gnu_ld=no -fi - -ac_prog=ld -if test yes = "$GCC"; then - # Check if gcc -print-prog-name=ld gives a path. - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for ld used by $CC" >&5 -printf %s "checking for ld used by $CC... " >&6; } - case $host in - *-*-mingw*) - # gcc leaves a trailing carriage return, which upsets mingw - ac_prog=`($CC -print-prog-name=ld) 2>&5 | tr -d '\015'` ;; - *) - ac_prog=`($CC -print-prog-name=ld) 2>&5` ;; - esac - case $ac_prog in - # Accept absolute paths. - [\\/]* | ?:[\\/]*) - re_direlt='/[^/][^/]*/\.\./' - # Canonicalize the pathname of ld - ac_prog=`$ECHO "$ac_prog"| $SED 's%\\\\%/%g'` - while $ECHO "$ac_prog" | $GREP "$re_direlt" > /dev/null 2>&1; do - ac_prog=`$ECHO $ac_prog| $SED "s%$re_direlt%/%"` - done - test -z "$LD" && LD=$ac_prog - ;; - "") - # If it fails, then pretend we aren't using GCC. - ac_prog=ld - ;; - *) - # If it is relative, then search for the first ld in PATH. - with_gnu_ld=unknown - ;; - esac -elif test yes = "$with_gnu_ld"; then - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for GNU ld" >&5 -printf %s "checking for GNU ld... " >&6; } -else - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for non-GNU ld" >&5 -printf %s "checking for non-GNU ld... " >&6; } -fi -if test ${lt_cv_path_LD+y} -then : - printf %s "(cached) " >&6 -else $as_nop - if test -z "$LD"; then - lt_save_ifs=$IFS; IFS=$PATH_SEPARATOR - for ac_dir in $PATH; do - IFS=$lt_save_ifs - test -z "$ac_dir" && ac_dir=. - if test -f "$ac_dir/$ac_prog" || test -f "$ac_dir/$ac_prog$ac_exeext"; then - lt_cv_path_LD=$ac_dir/$ac_prog - # Check to see if the program is GNU ld. I'd rather use --version, - # but apparently some variants of GNU ld only accept -v. - # Break only if it was the GNU/non-GNU ld that we prefer. - case `"$lt_cv_path_LD" -v 2>&1 &5 -printf "%s\n" "$LD" >&6; } -else - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 -printf "%s\n" "no" >&6; } -fi -test -z "$LD" && as_fn_error $? "no acceptable ld found in \$PATH" "$LINENO" 5 -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking if the linker ($LD) is GNU ld" >&5 -printf %s "checking if the linker ($LD) is GNU ld... " >&6; } -if test ${lt_cv_prog_gnu_ld+y} -then : - printf %s "(cached) " >&6 -else $as_nop - # I'd rather use --version here, but apparently some GNU lds only accept -v. -case `$LD -v 2>&1 &5 -printf "%s\n" "$lt_cv_prog_gnu_ld" >&6; } -with_gnu_ld=$lt_cv_prog_gnu_ld - - - - - - - - # Check if GNU C++ uses GNU ld as the underlying linker, since the - # archiving commands below assume that GNU ld is being used. - if test yes = "$with_gnu_ld"; then - archive_cmds_CXX='$CC $pic_flag -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-soname $wl$soname -o $lib' - archive_expsym_cmds_CXX='$CC $pic_flag -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-soname $wl$soname $wl-retain-symbols-file $wl$export_symbols -o $lib' - - hardcode_libdir_flag_spec_CXX='$wl-rpath $wl$libdir' - export_dynamic_flag_spec_CXX='$wl--export-dynamic' - - # If archive_cmds runs LD, not CC, wlarc should be empty - # XXX I think wlarc can be eliminated in ltcf-cxx, but I need to - # investigate it a little bit more. (MM) - wlarc='$wl' - - # ancient GNU ld didn't support --whole-archive et. al. - if eval "`$CC -print-prog-name=ld` --help 2>&1" | - $GREP 'no-whole-archive' > /dev/null; then - whole_archive_flag_spec_CXX=$wlarc'--whole-archive$convenience '$wlarc'--no-whole-archive' - else - whole_archive_flag_spec_CXX= - fi - else - with_gnu_ld=no - wlarc= - - # A generic and very simple default shared library creation - # command for GNU C++ for the case where it uses the native - # linker, instead of GNU ld. If possible, this setting should - # overridden to take advantage of the native linker features on - # the platform it is being used on. - archive_cmds_CXX='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $lib' - fi - - # Commands to make compiler produce verbose output that lists - # what "hidden" libraries, object files and flags are used when - # linking a shared library. - output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP -v "^Configured with:" | $GREP " \-L"' - - else - GXX=no - with_gnu_ld=no - wlarc= - fi - - # PORTME: fill in a description of your system's C++ link characteristics - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether the $compiler linker ($LD) supports shared libraries" >&5 -printf %s "checking whether the $compiler linker ($LD) supports shared libraries... " >&6; } - ld_shlibs_CXX=yes - case $host_os in - aix3*) - # FIXME: insert proper C++ library support - ld_shlibs_CXX=no - ;; - aix[4-9]*) - if test ia64 = "$host_cpu"; then - # On IA64, the linker does run time linking by default, so we don't - # have to do anything special. - aix_use_runtimelinking=no - exp_sym_flag='-Bexport' - no_entry_flag= - else - aix_use_runtimelinking=no - - # Test if we are trying to use run time linking or normal - # AIX style linking. If -brtl is somewhere in LDFLAGS, we - # have runtime linking enabled, and use it for executables. - # For shared libraries, we enable/disable runtime linking - # depending on the kind of the shared library created - - # when "with_aix_soname,aix_use_runtimelinking" is: - # "aix,no" lib.a(lib.so.V) shared, rtl:no, for executables - # "aix,yes" lib.so shared, rtl:yes, for executables - # lib.a static archive - # "both,no" lib.so.V(shr.o) shared, rtl:yes - # lib.a(lib.so.V) shared, rtl:no, for executables - # "both,yes" lib.so.V(shr.o) shared, rtl:yes, for executables - # lib.a(lib.so.V) shared, rtl:no - # "svr4,*" lib.so.V(shr.o) shared, rtl:yes, for executables - # lib.a static archive - case $host_os in aix4.[23]|aix4.[23].*|aix[5-9]*) - for ld_flag in $LDFLAGS; do - case $ld_flag in - *-brtl*) - aix_use_runtimelinking=yes - break - ;; - esac - done - if test svr4,no = "$with_aix_soname,$aix_use_runtimelinking"; then - # With aix-soname=svr4, we create the lib.so.V shared archives only, - # so we don't have lib.a shared libs to link our executables. - # We have to force runtime linking in this case. - aix_use_runtimelinking=yes - LDFLAGS="$LDFLAGS -Wl,-brtl" - fi - ;; - esac - - exp_sym_flag='-bexport' - no_entry_flag='-bnoentry' - fi - - # When large executables or shared objects are built, AIX ld can - # have problems creating the table of contents. If linking a library - # or program results in "error TOC overflow" add -mminimal-toc to - # CXXFLAGS/CFLAGS for g++/gcc. In the cases where that is not - # enough to fix the problem, add -Wl,-bbigtoc to LDFLAGS. - - archive_cmds_CXX='' - hardcode_direct_CXX=yes - hardcode_direct_absolute_CXX=yes - hardcode_libdir_separator_CXX=':' - link_all_deplibs_CXX=yes - file_list_spec_CXX='$wl-f,' - case $with_aix_soname,$aix_use_runtimelinking in - aix,*) ;; # no import file - svr4,* | *,yes) # use import file - # The Import File defines what to hardcode. - hardcode_direct_CXX=no - hardcode_direct_absolute_CXX=no - ;; - esac - - if test yes = "$GXX"; then - case $host_os in aix4.[012]|aix4.[012].*) - # We only want to do this on AIX 4.2 and lower, the check - # below for broken collect2 doesn't work under 4.3+ - collect2name=`$CC -print-prog-name=collect2` - if test -f "$collect2name" && - strings "$collect2name" | $GREP resolve_lib_name >/dev/null - then - # We have reworked collect2 - : - else - # We have old collect2 - hardcode_direct_CXX=unsupported - # It fails to find uninstalled libraries when the uninstalled - # path is not listed in the libpath. Setting hardcode_minus_L - # to unsupported forces relinking - hardcode_minus_L_CXX=yes - hardcode_libdir_flag_spec_CXX='-L$libdir' - hardcode_libdir_separator_CXX= - fi - esac - shared_flag='-shared' - if test yes = "$aix_use_runtimelinking"; then - shared_flag=$shared_flag' $wl-G' - fi - # Need to ensure runtime linking is disabled for the traditional - # shared library, or the linker may eventually find shared libraries - # /with/ Import File - we do not want to mix them. - shared_flag_aix='-shared' - shared_flag_svr4='-shared $wl-G' - else - # not using gcc - if test ia64 = "$host_cpu"; then - # VisualAge C++, Version 5.5 for AIX 5L for IA-64, Beta 3 Release - # chokes on -Wl,-G. The following line is correct: - shared_flag='-G' - else - if test yes = "$aix_use_runtimelinking"; then - shared_flag='$wl-G' - else - shared_flag='$wl-bM:SRE' - fi - shared_flag_aix='$wl-bM:SRE' - shared_flag_svr4='$wl-G' - fi - fi - - export_dynamic_flag_spec_CXX='$wl-bexpall' - # It seems that -bexpall does not export symbols beginning with - # underscore (_), so it is better to generate a list of symbols to - # export. - always_export_symbols_CXX=yes - if test aix,yes = "$with_aix_soname,$aix_use_runtimelinking"; then - # Warning - without using the other runtime loading flags (-brtl), - # -berok will link without error, but may produce a broken library. - # The "-G" linker flag allows undefined symbols. - no_undefined_flag_CXX='-bernotok' - # Determine the default libpath from the value encoded in an empty - # executable. - if test set = "${lt_cv_aix_libpath+set}"; then - aix_libpath=$lt_cv_aix_libpath -else - if test ${lt_cv_aix_libpath__CXX+y} -then : - printf %s "(cached) " >&6 -else $as_nop - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - -int -main (void) -{ - - ; - return 0; -} -_ACEOF -if ac_fn_cxx_try_link "$LINENO" -then : - - lt_aix_libpath_sed=' - /Import File Strings/,/^$/ { - /^0/ { - s/^0 *\([^ ]*\) *$/\1/ - p - } - }' - lt_cv_aix_libpath__CXX=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` - # Check for a 64-bit object if we didn't find anything. - if test -z "$lt_cv_aix_libpath__CXX"; then - lt_cv_aix_libpath__CXX=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` - fi -fi -rm -f core conftest.err conftest.$ac_objext conftest.beam \ - conftest$ac_exeext conftest.$ac_ext - if test -z "$lt_cv_aix_libpath__CXX"; then - lt_cv_aix_libpath__CXX=/usr/lib:/lib - fi - -fi - - aix_libpath=$lt_cv_aix_libpath__CXX -fi - - hardcode_libdir_flag_spec_CXX='$wl-blibpath:$libdir:'"$aix_libpath" - - archive_expsym_cmds_CXX='$CC -o $output_objdir/$soname $libobjs $deplibs $wl'$no_entry_flag' $compiler_flags `if test -n "$allow_undefined_flag"; then func_echo_all "$wl$allow_undefined_flag"; else :; fi` $wl'$exp_sym_flag:\$export_symbols' '$shared_flag - else - if test ia64 = "$host_cpu"; then - hardcode_libdir_flag_spec_CXX='$wl-R $libdir:/usr/lib:/lib' - allow_undefined_flag_CXX="-z nodefs" - archive_expsym_cmds_CXX="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs '"\$wl$no_entry_flag"' $compiler_flags $wl$allow_undefined_flag '"\$wl$exp_sym_flag:\$export_symbols" - else - # Determine the default libpath from the value encoded in an - # empty executable. - if test set = "${lt_cv_aix_libpath+set}"; then - aix_libpath=$lt_cv_aix_libpath -else - if test ${lt_cv_aix_libpath__CXX+y} -then : - printf %s "(cached) " >&6 -else $as_nop - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - -int -main (void) -{ - - ; - return 0; -} -_ACEOF -if ac_fn_cxx_try_link "$LINENO" -then : - - lt_aix_libpath_sed=' - /Import File Strings/,/^$/ { - /^0/ { - s/^0 *\([^ ]*\) *$/\1/ - p - } - }' - lt_cv_aix_libpath__CXX=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` - # Check for a 64-bit object if we didn't find anything. - if test -z "$lt_cv_aix_libpath__CXX"; then - lt_cv_aix_libpath__CXX=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` - fi -fi -rm -f core conftest.err conftest.$ac_objext conftest.beam \ - conftest$ac_exeext conftest.$ac_ext - if test -z "$lt_cv_aix_libpath__CXX"; then - lt_cv_aix_libpath__CXX=/usr/lib:/lib - fi - -fi - - aix_libpath=$lt_cv_aix_libpath__CXX -fi - - hardcode_libdir_flag_spec_CXX='$wl-blibpath:$libdir:'"$aix_libpath" - # Warning - without using the other run time loading flags, - # -berok will link without error, but may produce a broken library. - no_undefined_flag_CXX=' $wl-bernotok' - allow_undefined_flag_CXX=' $wl-berok' - if test yes = "$with_gnu_ld"; then - # We only use this code for GNU lds that support --whole-archive. - whole_archive_flag_spec_CXX='$wl--whole-archive$convenience $wl--no-whole-archive' - else - # Exported symbols can be pulled into shared objects from archives - whole_archive_flag_spec_CXX='$convenience' - fi - archive_cmds_need_lc_CXX=yes - archive_expsym_cmds_CXX='$RM -r $output_objdir/$realname.d~$MKDIR $output_objdir/$realname.d' - # -brtl affects multiple linker settings, -berok does not and is overridden later - compiler_flags_filtered='`func_echo_all "$compiler_flags " | $SED -e "s%-brtl\\([, ]\\)%-berok\\1%g"`' - if test svr4 != "$with_aix_soname"; then - # This is similar to how AIX traditionally builds its shared - # libraries. Need -bnortl late, we may have -brtl in LDFLAGS. - archive_expsym_cmds_CXX="$archive_expsym_cmds_CXX"'~$CC '$shared_flag_aix' -o $output_objdir/$realname.d/$soname $libobjs $deplibs $wl-bnoentry '$compiler_flags_filtered'$wl-bE:$export_symbols$allow_undefined_flag~$AR $AR_FLAGS $output_objdir/$libname$release.a $output_objdir/$realname.d/$soname' - fi - if test aix != "$with_aix_soname"; then - archive_expsym_cmds_CXX="$archive_expsym_cmds_CXX"'~$CC '$shared_flag_svr4' -o $output_objdir/$realname.d/$shared_archive_member_spec.o $libobjs $deplibs $wl-bnoentry '$compiler_flags_filtered'$wl-bE:$export_symbols$allow_undefined_flag~$STRIP -e $output_objdir/$realname.d/$shared_archive_member_spec.o~( func_echo_all "#! $soname($shared_archive_member_spec.o)"; if test shr_64 = "$shared_archive_member_spec"; then func_echo_all "# 64"; else func_echo_all "# 32"; fi; cat $export_symbols ) > $output_objdir/$realname.d/$shared_archive_member_spec.imp~$AR $AR_FLAGS $output_objdir/$soname $output_objdir/$realname.d/$shared_archive_member_spec.o $output_objdir/$realname.d/$shared_archive_member_spec.imp' - else - # used by -dlpreopen to get the symbols - archive_expsym_cmds_CXX="$archive_expsym_cmds_CXX"'~$MV $output_objdir/$realname.d/$soname $output_objdir' - fi - archive_expsym_cmds_CXX="$archive_expsym_cmds_CXX"'~$RM -r $output_objdir/$realname.d' - fi - fi - ;; - - beos*) - if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then - allow_undefined_flag_CXX=unsupported - # Joseph Beckenbach says some releases of gcc - # support --undefined. This deserves some investigation. FIXME - archive_cmds_CXX='$CC -nostart $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib' - else - ld_shlibs_CXX=no - fi - ;; - - chorus*) - case $cc_basename in - *) - # FIXME: insert proper C++ library support - ld_shlibs_CXX=no - ;; - esac - ;; - - cygwin* | mingw* | pw32* | cegcc*) - case $GXX,$cc_basename in - ,cl* | no,cl*) - # Native MSVC - # hardcode_libdir_flag_spec is actually meaningless, as there is - # no search path for DLLs. - hardcode_libdir_flag_spec_CXX=' ' - allow_undefined_flag_CXX=unsupported - always_export_symbols_CXX=yes - file_list_spec_CXX='@' - # Tell ltmain to make .lib files, not .a files. - libext=lib - # Tell ltmain to make .dll files, not .so files. - shrext_cmds=.dll - # FIXME: Setting linknames here is a bad hack. - archive_cmds_CXX='$CC -o $output_objdir/$soname $libobjs $compiler_flags $deplibs -Wl,-DLL,-IMPLIB:"$tool_output_objdir$libname.dll.lib"~linknames=' - archive_expsym_cmds_CXX='if test DEF = "`$SED -n -e '\''s/^[ ]*//'\'' -e '\''/^\(;.*\)*$/d'\'' -e '\''s/^\(EXPORTS\|LIBRARY\)\([ ].*\)*$/DEF/p'\'' -e q $export_symbols`" ; then - cp "$export_symbols" "$output_objdir/$soname.def"; - echo "$tool_output_objdir$soname.def" > "$output_objdir/$soname.exp"; - else - $SED -e '\''s/^/-link -EXPORT:/'\'' < $export_symbols > $output_objdir/$soname.exp; - fi~ - $CC -o $tool_output_objdir$soname $libobjs $compiler_flags $deplibs "@$tool_output_objdir$soname.exp" -Wl,-DLL,-IMPLIB:"$tool_output_objdir$libname.dll.lib"~ - linknames=' - # The linker will not automatically build a static lib if we build a DLL. - # _LT_TAGVAR(old_archive_from_new_cmds, CXX)='true' - enable_shared_with_static_runtimes_CXX=yes - # Don't use ranlib - old_postinstall_cmds_CXX='chmod 644 $oldlib' - postlink_cmds_CXX='lt_outputfile="@OUTPUT@"~ - lt_tool_outputfile="@TOOL_OUTPUT@"~ - case $lt_outputfile in - *.exe|*.EXE) ;; - *) - lt_outputfile=$lt_outputfile.exe - lt_tool_outputfile=$lt_tool_outputfile.exe - ;; - esac~ - func_to_tool_file "$lt_outputfile"~ - if test : != "$MANIFEST_TOOL" && test -f "$lt_outputfile.manifest"; then - $MANIFEST_TOOL -manifest "$lt_tool_outputfile.manifest" -outputresource:"$lt_tool_outputfile" || exit 1; - $RM "$lt_outputfile.manifest"; - fi' - ;; - *) - # g++ - # _LT_TAGVAR(hardcode_libdir_flag_spec, CXX) is actually meaningless, - # as there is no search path for DLLs. - hardcode_libdir_flag_spec_CXX='-L$libdir' - export_dynamic_flag_spec_CXX='$wl--export-all-symbols' - allow_undefined_flag_CXX=unsupported - always_export_symbols_CXX=no - enable_shared_with_static_runtimes_CXX=yes - - if $LD --help 2>&1 | $GREP 'auto-import' > /dev/null; then - archive_cmds_CXX='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $output_objdir/$soname $wl--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib' - # If the export-symbols file already is a .def file, use it as - # is; otherwise, prepend EXPORTS... - archive_expsym_cmds_CXX='if test DEF = "`$SED -n -e '\''s/^[ ]*//'\'' -e '\''/^\(;.*\)*$/d'\'' -e '\''s/^\(EXPORTS\|LIBRARY\)\([ ].*\)*$/DEF/p'\'' -e q $export_symbols`" ; then - cp $export_symbols $output_objdir/$soname.def; - else - echo EXPORTS > $output_objdir/$soname.def; - cat $export_symbols >> $output_objdir/$soname.def; - fi~ - $CC -shared -nostdlib $output_objdir/$soname.def $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $output_objdir/$soname $wl--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib' - else - ld_shlibs_CXX=no - fi - ;; - esac - ;; - darwin* | rhapsody*) - - - archive_cmds_need_lc_CXX=no - hardcode_direct_CXX=no - hardcode_automatic_CXX=yes - hardcode_shlibpath_var_CXX=unsupported - if test yes = "$lt_cv_ld_force_load"; then - whole_archive_flag_spec_CXX='`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience $wl-force_load,$conv\"; done; func_echo_all \"$new_convenience\"`' - - else - whole_archive_flag_spec_CXX='' - fi - link_all_deplibs_CXX=yes - allow_undefined_flag_CXX=$_lt_dar_allow_undefined - case $cc_basename in - ifort*|nagfor*) _lt_dar_can_shared=yes ;; - *) _lt_dar_can_shared=$GCC ;; - esac - if test yes = "$_lt_dar_can_shared"; then - output_verbose_link_cmd=func_echo_all - archive_cmds_CXX="\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring $_lt_dar_single_mod$_lt_dsymutil" - module_cmds_CXX="\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags$_lt_dsymutil" - archive_expsym_cmds_CXX="sed 's|^|_|' < \$export_symbols > \$output_objdir/\$libname-symbols.expsym~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring $_lt_dar_single_mod$_lt_dar_export_syms$_lt_dsymutil" - module_expsym_cmds_CXX="sed -e 's|^|_|' < \$export_symbols > \$output_objdir/\$libname-symbols.expsym~\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags$_lt_dar_export_syms$_lt_dsymutil" - if test yes != "$lt_cv_apple_cc_single_mod"; then - archive_cmds_CXX="\$CC -r -keep_private_externs -nostdlib -o \$lib-master.o \$libobjs~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$lib-master.o \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring$_lt_dsymutil" - archive_expsym_cmds_CXX="sed 's|^|_|' < \$export_symbols > \$output_objdir/\$libname-symbols.expsym~\$CC -r -keep_private_externs -nostdlib -o \$lib-master.o \$libobjs~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$lib-master.o \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring$_lt_dar_export_syms$_lt_dsymutil" - fi - - else - ld_shlibs_CXX=no - fi - - ;; - - os2*) - hardcode_libdir_flag_spec_CXX='-L$libdir' - hardcode_minus_L_CXX=yes - allow_undefined_flag_CXX=unsupported - shrext_cmds=.dll - archive_cmds_CXX='$ECHO "LIBRARY ${soname%$shared_ext} INITINSTANCE TERMINSTANCE" > $output_objdir/$libname.def~ - $ECHO "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~ - $ECHO "DATA MULTIPLE NONSHARED" >> $output_objdir/$libname.def~ - $ECHO EXPORTS >> $output_objdir/$libname.def~ - emxexp $libobjs | $SED /"_DLL_InitTerm"/d >> $output_objdir/$libname.def~ - $CC -Zdll -Zcrtdll -o $output_objdir/$soname $libobjs $deplibs $compiler_flags $output_objdir/$libname.def~ - emximp -o $lib $output_objdir/$libname.def' - archive_expsym_cmds_CXX='$ECHO "LIBRARY ${soname%$shared_ext} INITINSTANCE TERMINSTANCE" > $output_objdir/$libname.def~ - $ECHO "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~ - $ECHO "DATA MULTIPLE NONSHARED" >> $output_objdir/$libname.def~ - $ECHO EXPORTS >> $output_objdir/$libname.def~ - prefix_cmds="$SED"~ - if test EXPORTS = "`$SED 1q $export_symbols`"; then - prefix_cmds="$prefix_cmds -e 1d"; - fi~ - prefix_cmds="$prefix_cmds -e \"s/^\(.*\)$/_\1/g\""~ - cat $export_symbols | $prefix_cmds >> $output_objdir/$libname.def~ - $CC -Zdll -Zcrtdll -o $output_objdir/$soname $libobjs $deplibs $compiler_flags $output_objdir/$libname.def~ - emximp -o $lib $output_objdir/$libname.def' - old_archive_From_new_cmds_CXX='emximp -o $output_objdir/${libname}_dll.a $output_objdir/$libname.def' - enable_shared_with_static_runtimes_CXX=yes - ;; - - dgux*) - case $cc_basename in - ec++*) - # FIXME: insert proper C++ library support - ld_shlibs_CXX=no - ;; - ghcx*) - # Green Hills C++ Compiler - # FIXME: insert proper C++ library support - ld_shlibs_CXX=no - ;; - *) - # FIXME: insert proper C++ library support - ld_shlibs_CXX=no - ;; - esac - ;; - - freebsd2.*) - # C++ shared libraries reported to be fairly broken before - # switch to ELF - ld_shlibs_CXX=no - ;; - - freebsd-elf*) - archive_cmds_need_lc_CXX=no - ;; - - freebsd* | dragonfly*) - # FreeBSD 3 and later use GNU C++ and GNU ld with standard ELF - # conventions - ld_shlibs_CXX=yes - ;; - - haiku*) - archive_cmds_CXX='$CC -shared $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib' - link_all_deplibs_CXX=yes - ;; - - hpux9*) - hardcode_libdir_flag_spec_CXX='$wl+b $wl$libdir' - hardcode_libdir_separator_CXX=: - export_dynamic_flag_spec_CXX='$wl-E' - hardcode_direct_CXX=yes - hardcode_minus_L_CXX=yes # Not in the search PATH, - # but as the default - # location of the library. - - case $cc_basename in - CC*) - # FIXME: insert proper C++ library support - ld_shlibs_CXX=no - ;; - aCC*) - archive_cmds_CXX='$RM $output_objdir/$soname~$CC -b $wl+b $wl$install_libdir -o $output_objdir/$soname $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~test "x$output_objdir/$soname" = "x$lib" || mv $output_objdir/$soname $lib' - # Commands to make compiler produce verbose output that lists - # what "hidden" libraries, object files and flags are used when - # linking a shared library. - # - # There doesn't appear to be a way to prevent this compiler from - # explicitly linking system object files so we need to strip them - # from the output so that they don't get included in the library - # dependencies. - output_verbose_link_cmd='templist=`($CC -b $CFLAGS -v conftest.$objext 2>&1) | $EGREP " \-L"`; list= ; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; func_echo_all "$list"' - ;; - *) - if test yes = "$GXX"; then - archive_cmds_CXX='$RM $output_objdir/$soname~$CC -shared -nostdlib $pic_flag $wl+b $wl$install_libdir -o $output_objdir/$soname $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~test "x$output_objdir/$soname" = "x$lib" || mv $output_objdir/$soname $lib' - else - # FIXME: insert proper C++ library support - ld_shlibs_CXX=no - fi - ;; - esac - ;; - - hpux10*|hpux11*) - if test no = "$with_gnu_ld"; then - hardcode_libdir_flag_spec_CXX='$wl+b $wl$libdir' - hardcode_libdir_separator_CXX=: - - case $host_cpu in - hppa*64*|ia64*) - ;; - *) - export_dynamic_flag_spec_CXX='$wl-E' - ;; - esac - fi - case $host_cpu in - hppa*64*|ia64*) - hardcode_direct_CXX=no - hardcode_shlibpath_var_CXX=no - ;; - *) - hardcode_direct_CXX=yes - hardcode_direct_absolute_CXX=yes - hardcode_minus_L_CXX=yes # Not in the search PATH, - # but as the default - # location of the library. - ;; - esac - - case $cc_basename in - CC*) - # FIXME: insert proper C++ library support - ld_shlibs_CXX=no - ;; - aCC*) - case $host_cpu in - hppa*64*) - archive_cmds_CXX='$CC -b $wl+h $wl$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' - ;; - ia64*) - archive_cmds_CXX='$CC -b $wl+h $wl$soname $wl+nodefaultrpath -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' - ;; - *) - archive_cmds_CXX='$CC -b $wl+h $wl$soname $wl+b $wl$install_libdir -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' - ;; - esac - # Commands to make compiler produce verbose output that lists - # what "hidden" libraries, object files and flags are used when - # linking a shared library. - # - # There doesn't appear to be a way to prevent this compiler from - # explicitly linking system object files so we need to strip them - # from the output so that they don't get included in the library - # dependencies. - output_verbose_link_cmd='templist=`($CC -b $CFLAGS -v conftest.$objext 2>&1) | $GREP " \-L"`; list= ; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; func_echo_all "$list"' - ;; - *) - if test yes = "$GXX"; then - if test no = "$with_gnu_ld"; then - case $host_cpu in - hppa*64*) - archive_cmds_CXX='$CC -shared -nostdlib -fPIC $wl+h $wl$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' - ;; - ia64*) - archive_cmds_CXX='$CC -shared -nostdlib $pic_flag $wl+h $wl$soname $wl+nodefaultrpath -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' - ;; - *) - archive_cmds_CXX='$CC -shared -nostdlib $pic_flag $wl+h $wl$soname $wl+b $wl$install_libdir -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' - ;; - esac - fi - else - # FIXME: insert proper C++ library support - ld_shlibs_CXX=no - fi - ;; - esac - ;; - - interix[3-9]*) - hardcode_direct_CXX=no - hardcode_shlibpath_var_CXX=no - hardcode_libdir_flag_spec_CXX='$wl-rpath,$libdir' - export_dynamic_flag_spec_CXX='$wl-E' - # Hack: On Interix 3.x, we cannot compile PIC because of a broken gcc. - # Instead, shared libraries are loaded at an image base (0x10000000 by - # default) and relocated if they conflict, which is a slow very memory - # consuming and fragmenting process. To avoid this, we pick a random, - # 256 KiB-aligned image base between 0x50000000 and 0x6FFC0000 at link - # time. Moving up from 0x10000000 also allows more sbrk(2) space. - archive_cmds_CXX='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-h,$soname $wl--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib' - archive_expsym_cmds_CXX='sed "s|^|_|" $export_symbols >$output_objdir/$soname.expsym~$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-h,$soname $wl--retain-symbols-file,$output_objdir/$soname.expsym $wl--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib' - ;; - irix5* | irix6*) - case $cc_basename in - CC*) - # SGI C++ - archive_cmds_CXX='$CC -shared -all -multigot $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry $output_objdir/so_locations -o $lib' - - # Archives containing C++ object files must be created using - # "CC -ar", where "CC" is the IRIX C++ compiler. This is - # necessary to make sure instantiated templates are included - # in the archive. - old_archive_cmds_CXX='$CC -ar -WR,-u -o $oldlib $oldobjs' - ;; - *) - if test yes = "$GXX"; then - if test no = "$with_gnu_ld"; then - archive_cmds_CXX='$CC -shared $pic_flag -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-soname $wl$soname `test -n "$verstring" && func_echo_all "$wl-set_version $wl$verstring"` $wl-update_registry $wl$output_objdir/so_locations -o $lib' - else - archive_cmds_CXX='$CC -shared $pic_flag -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-soname $wl$soname `test -n "$verstring" && func_echo_all "$wl-set_version $wl$verstring"` -o $lib' - fi - fi - link_all_deplibs_CXX=yes - ;; - esac - hardcode_libdir_flag_spec_CXX='$wl-rpath $wl$libdir' - hardcode_libdir_separator_CXX=: - inherit_rpath_CXX=yes - ;; - - linux* | k*bsd*-gnu | kopensolaris*-gnu | gnu*) - case $cc_basename in - KCC*) - # Kuck and Associates, Inc. (KAI) C++ Compiler - - # KCC will only create a shared library if the output file - # ends with ".so" (or ".sl" for HP-UX), so rename the library - # to its proper name (with version) after linking. - archive_cmds_CXX='tempext=`echo $shared_ext | $SED -e '\''s/\([^()0-9A-Za-z{}]\)/\\\\\1/g'\''`; templib=`echo $lib | $SED -e "s/\$tempext\..*/.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib; mv \$templib $lib' - archive_expsym_cmds_CXX='tempext=`echo $shared_ext | $SED -e '\''s/\([^()0-9A-Za-z{}]\)/\\\\\1/g'\''`; templib=`echo $lib | $SED -e "s/\$tempext\..*/.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib $wl-retain-symbols-file,$export_symbols; mv \$templib $lib' - # Commands to make compiler produce verbose output that lists - # what "hidden" libraries, object files and flags are used when - # linking a shared library. - # - # There doesn't appear to be a way to prevent this compiler from - # explicitly linking system object files so we need to strip them - # from the output so that they don't get included in the library - # dependencies. - output_verbose_link_cmd='templist=`$CC $CFLAGS -v conftest.$objext -o libconftest$shared_ext 2>&1 | $GREP "ld"`; rm -f libconftest$shared_ext; list= ; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; func_echo_all "$list"' - - hardcode_libdir_flag_spec_CXX='$wl-rpath,$libdir' - export_dynamic_flag_spec_CXX='$wl--export-dynamic' - - # Archives containing C++ object files must be created using - # "CC -Bstatic", where "CC" is the KAI C++ compiler. - old_archive_cmds_CXX='$CC -Bstatic -o $oldlib $oldobjs' - ;; - icpc* | ecpc* ) - # Intel C++ - with_gnu_ld=yes - # version 8.0 and above of icpc choke on multiply defined symbols - # if we add $predep_objects and $postdep_objects, however 7.1 and - # earlier do not add the objects themselves. - case `$CC -V 2>&1` in - *"Version 7."*) - archive_cmds_CXX='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-soname $wl$soname -o $lib' - archive_expsym_cmds_CXX='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-soname $wl$soname $wl-retain-symbols-file $wl$export_symbols -o $lib' - ;; - *) # Version 8.0 or newer - tmp_idyn= - case $host_cpu in - ia64*) tmp_idyn=' -i_dynamic';; - esac - archive_cmds_CXX='$CC -shared'"$tmp_idyn"' $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib' - archive_expsym_cmds_CXX='$CC -shared'"$tmp_idyn"' $libobjs $deplibs $compiler_flags $wl-soname $wl$soname $wl-retain-symbols-file $wl$export_symbols -o $lib' - ;; - esac - archive_cmds_need_lc_CXX=no - hardcode_libdir_flag_spec_CXX='$wl-rpath,$libdir' - export_dynamic_flag_spec_CXX='$wl--export-dynamic' - whole_archive_flag_spec_CXX='$wl--whole-archive$convenience $wl--no-whole-archive' - ;; - pgCC* | pgcpp*) - # Portland Group C++ compiler - case `$CC -V` in - *pgCC\ [1-5].* | *pgcpp\ [1-5].*) - prelink_cmds_CXX='tpldir=Template.dir~ - rm -rf $tpldir~ - $CC --prelink_objects --instantiation_dir $tpldir $objs $libobjs $compile_deplibs~ - compile_command="$compile_command `find $tpldir -name \*.o | sort | $NL2SP`"' - old_archive_cmds_CXX='tpldir=Template.dir~ - rm -rf $tpldir~ - $CC --prelink_objects --instantiation_dir $tpldir $oldobjs$old_deplibs~ - $AR $AR_FLAGS $oldlib$oldobjs$old_deplibs `find $tpldir -name \*.o | sort | $NL2SP`~ - $RANLIB $oldlib' - archive_cmds_CXX='tpldir=Template.dir~ - rm -rf $tpldir~ - $CC --prelink_objects --instantiation_dir $tpldir $predep_objects $libobjs $deplibs $convenience $postdep_objects~ - $CC -shared $pic_flag $predep_objects $libobjs $deplibs `find $tpldir -name \*.o | sort | $NL2SP` $postdep_objects $compiler_flags $wl-soname $wl$soname -o $lib' - archive_expsym_cmds_CXX='tpldir=Template.dir~ - rm -rf $tpldir~ - $CC --prelink_objects --instantiation_dir $tpldir $predep_objects $libobjs $deplibs $convenience $postdep_objects~ - $CC -shared $pic_flag $predep_objects $libobjs $deplibs `find $tpldir -name \*.o | sort | $NL2SP` $postdep_objects $compiler_flags $wl-soname $wl$soname $wl-retain-symbols-file $wl$export_symbols -o $lib' - ;; - *) # Version 6 and above use weak symbols - archive_cmds_CXX='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-soname $wl$soname -o $lib' - archive_expsym_cmds_CXX='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-soname $wl$soname $wl-retain-symbols-file $wl$export_symbols -o $lib' - ;; - esac - - hardcode_libdir_flag_spec_CXX='$wl--rpath $wl$libdir' - export_dynamic_flag_spec_CXX='$wl--export-dynamic' - whole_archive_flag_spec_CXX='$wl--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` $wl--no-whole-archive' - ;; - cxx*) - # Compaq C++ - archive_cmds_CXX='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-soname $wl$soname -o $lib' - archive_expsym_cmds_CXX='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-soname $wl$soname -o $lib $wl-retain-symbols-file $wl$export_symbols' - - runpath_var=LD_RUN_PATH - hardcode_libdir_flag_spec_CXX='-rpath $libdir' - hardcode_libdir_separator_CXX=: - - # Commands to make compiler produce verbose output that lists - # what "hidden" libraries, object files and flags are used when - # linking a shared library. - # - # There doesn't appear to be a way to prevent this compiler from - # explicitly linking system object files so we need to strip them - # from the output so that they don't get included in the library - # dependencies. - output_verbose_link_cmd='templist=`$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP "ld"`; templist=`func_echo_all "$templist" | $SED "s/\(^.*ld.*\)\( .*ld .*$\)/\1/"`; list= ; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; func_echo_all "X$list" | $Xsed' - ;; - xl* | mpixl* | bgxl*) - # IBM XL 8.0 on PPC, with GNU ld - hardcode_libdir_flag_spec_CXX='$wl-rpath $wl$libdir' - export_dynamic_flag_spec_CXX='$wl--export-dynamic' - archive_cmds_CXX='$CC -qmkshrobj $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib' - if test yes = "$supports_anon_versioning"; then - archive_expsym_cmds_CXX='echo "{ global:" > $output_objdir/$libname.ver~ - cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~ - echo "local: *; };" >> $output_objdir/$libname.ver~ - $CC -qmkshrobj $libobjs $deplibs $compiler_flags $wl-soname $wl$soname $wl-version-script $wl$output_objdir/$libname.ver -o $lib' - fi - ;; - *) - case `$CC -V 2>&1 | sed 5q` in - *Sun\ C*) - # Sun C++ 5.9 - no_undefined_flag_CXX=' -zdefs' - archive_cmds_CXX='$CC -G$allow_undefined_flag -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' - archive_expsym_cmds_CXX='$CC -G$allow_undefined_flag -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-retain-symbols-file $wl$export_symbols' - hardcode_libdir_flag_spec_CXX='-R$libdir' - whole_archive_flag_spec_CXX='$wl--whole-archive`new_convenience=; for conv in $convenience\"\"; do test -z \"$conv\" || new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` $wl--no-whole-archive' - compiler_needs_object_CXX=yes - - # Not sure whether something based on - # $CC $CFLAGS -v conftest.$objext -o libconftest$shared_ext 2>&1 - # would be better. - output_verbose_link_cmd='func_echo_all' - - # Archives containing C++ object files must be created using - # "CC -xar", where "CC" is the Sun C++ compiler. This is - # necessary to make sure instantiated templates are included - # in the archive. - old_archive_cmds_CXX='$CC -xar -o $oldlib $oldobjs' - ;; - esac - ;; - esac - ;; - - lynxos*) - # FIXME: insert proper C++ library support - ld_shlibs_CXX=no - ;; - - m88k*) - # FIXME: insert proper C++ library support - ld_shlibs_CXX=no - ;; - - mvs*) - case $cc_basename in - cxx*) - # FIXME: insert proper C++ library support - ld_shlibs_CXX=no - ;; - *) - # FIXME: insert proper C++ library support - ld_shlibs_CXX=no - ;; - esac - ;; - - netbsd*) - if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then - archive_cmds_CXX='$LD -Bshareable -o $lib $predep_objects $libobjs $deplibs $postdep_objects $linker_flags' - wlarc= - hardcode_libdir_flag_spec_CXX='-R$libdir' - hardcode_direct_CXX=yes - hardcode_shlibpath_var_CXX=no - fi - # Workaround some broken pre-1.5 toolchains - output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP conftest.$objext | $SED -e "s:-lgcc -lc -lgcc::"' - ;; - - *nto* | *qnx*) - ld_shlibs_CXX=yes - ;; - - openbsd* | bitrig*) - if test -f /usr/libexec/ld.so; then - hardcode_direct_CXX=yes - hardcode_shlibpath_var_CXX=no - hardcode_direct_absolute_CXX=yes - archive_cmds_CXX='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $lib' - hardcode_libdir_flag_spec_CXX='$wl-rpath,$libdir' - if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`"; then - archive_expsym_cmds_CXX='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-retain-symbols-file,$export_symbols -o $lib' - export_dynamic_flag_spec_CXX='$wl-E' - whole_archive_flag_spec_CXX=$wlarc'--whole-archive$convenience '$wlarc'--no-whole-archive' - fi - output_verbose_link_cmd=func_echo_all - else - ld_shlibs_CXX=no - fi - ;; - - osf3* | osf4* | osf5*) - case $cc_basename in - KCC*) - # Kuck and Associates, Inc. (KAI) C++ Compiler - - # KCC will only create a shared library if the output file - # ends with ".so" (or ".sl" for HP-UX), so rename the library - # to its proper name (with version) after linking. - archive_cmds_CXX='tempext=`echo $shared_ext | $SED -e '\''s/\([^()0-9A-Za-z{}]\)/\\\\\1/g'\''`; templib=`echo "$lib" | $SED -e "s/\$tempext\..*/.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib; mv \$templib $lib' - - hardcode_libdir_flag_spec_CXX='$wl-rpath,$libdir' - hardcode_libdir_separator_CXX=: - - # Archives containing C++ object files must be created using - # the KAI C++ compiler. - case $host in - osf3*) old_archive_cmds_CXX='$CC -Bstatic -o $oldlib $oldobjs' ;; - *) old_archive_cmds_CXX='$CC -o $oldlib $oldobjs' ;; - esac - ;; - RCC*) - # Rational C++ 2.4.1 - # FIXME: insert proper C++ library support - ld_shlibs_CXX=no - ;; - cxx*) - case $host in - osf3*) - allow_undefined_flag_CXX=' $wl-expect_unresolved $wl\*' - archive_cmds_CXX='$CC -shared$allow_undefined_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-soname $soname `test -n "$verstring" && func_echo_all "$wl-set_version $verstring"` -update_registry $output_objdir/so_locations -o $lib' - hardcode_libdir_flag_spec_CXX='$wl-rpath $wl$libdir' - ;; - *) - allow_undefined_flag_CXX=' -expect_unresolved \*' - archive_cmds_CXX='$CC -shared$allow_undefined_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -msym -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry $output_objdir/so_locations -o $lib' - archive_expsym_cmds_CXX='for i in `cat $export_symbols`; do printf "%s %s\\n" -exported_symbol "\$i" >> $lib.exp; done~ - echo "-hidden">> $lib.exp~ - $CC -shared$allow_undefined_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -msym -soname $soname $wl-input $wl$lib.exp `test -n "$verstring" && $ECHO "-set_version $verstring"` -update_registry $output_objdir/so_locations -o $lib~ - $RM $lib.exp' - hardcode_libdir_flag_spec_CXX='-rpath $libdir' - ;; - esac - - hardcode_libdir_separator_CXX=: - - # Commands to make compiler produce verbose output that lists - # what "hidden" libraries, object files and flags are used when - # linking a shared library. - # - # There doesn't appear to be a way to prevent this compiler from - # explicitly linking system object files so we need to strip them - # from the output so that they don't get included in the library - # dependencies. - output_verbose_link_cmd='templist=`$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP "ld" | $GREP -v "ld:"`; templist=`func_echo_all "$templist" | $SED "s/\(^.*ld.*\)\( .*ld.*$\)/\1/"`; list= ; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; func_echo_all "$list"' - ;; - *) - if test yes,no = "$GXX,$with_gnu_ld"; then - allow_undefined_flag_CXX=' $wl-expect_unresolved $wl\*' - case $host in - osf3*) - archive_cmds_CXX='$CC -shared -nostdlib $allow_undefined_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-soname $wl$soname `test -n "$verstring" && func_echo_all "$wl-set_version $wl$verstring"` $wl-update_registry $wl$output_objdir/so_locations -o $lib' - ;; - *) - archive_cmds_CXX='$CC -shared $pic_flag -nostdlib $allow_undefined_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-msym $wl-soname $wl$soname `test -n "$verstring" && func_echo_all "$wl-set_version $wl$verstring"` $wl-update_registry $wl$output_objdir/so_locations -o $lib' - ;; - esac - - hardcode_libdir_flag_spec_CXX='$wl-rpath $wl$libdir' - hardcode_libdir_separator_CXX=: - - # Commands to make compiler produce verbose output that lists - # what "hidden" libraries, object files and flags are used when - # linking a shared library. - output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP -v "^Configured with:" | $GREP " \-L"' - - else - # FIXME: insert proper C++ library support - ld_shlibs_CXX=no - fi - ;; - esac - ;; - - psos*) - # FIXME: insert proper C++ library support - ld_shlibs_CXX=no - ;; - - sunos4*) - case $cc_basename in - CC*) - # Sun C++ 4.x - # FIXME: insert proper C++ library support - ld_shlibs_CXX=no - ;; - lcc*) - # Lucid - # FIXME: insert proper C++ library support - ld_shlibs_CXX=no - ;; - *) - # FIXME: insert proper C++ library support - ld_shlibs_CXX=no - ;; - esac - ;; - - solaris*) - case $cc_basename in - CC* | sunCC*) - # Sun C++ 4.2, 5.x and Centerline C++ - archive_cmds_need_lc_CXX=yes - no_undefined_flag_CXX=' -zdefs' - archive_cmds_CXX='$CC -G$allow_undefined_flag -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' - archive_expsym_cmds_CXX='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~ - $CC -G$allow_undefined_flag $wl-M $wl$lib.exp -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$RM $lib.exp' - - hardcode_libdir_flag_spec_CXX='-R$libdir' - hardcode_shlibpath_var_CXX=no - case $host_os in - solaris2.[0-5] | solaris2.[0-5].*) ;; - *) - # The compiler driver will combine and reorder linker options, - # but understands '-z linker_flag'. - # Supported since Solaris 2.6 (maybe 2.5.1?) - whole_archive_flag_spec_CXX='-z allextract$convenience -z defaultextract' - ;; - esac - link_all_deplibs_CXX=yes - - output_verbose_link_cmd='func_echo_all' - - # Archives containing C++ object files must be created using - # "CC -xar", where "CC" is the Sun C++ compiler. This is - # necessary to make sure instantiated templates are included - # in the archive. - old_archive_cmds_CXX='$CC -xar -o $oldlib $oldobjs' - ;; - gcx*) - # Green Hills C++ Compiler - archive_cmds_CXX='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-h $wl$soname -o $lib' - - # The C++ compiler must be used to create the archive. - old_archive_cmds_CXX='$CC $LDFLAGS -archive -o $oldlib $oldobjs' - ;; - *) - # GNU C++ compiler with Solaris linker - if test yes,no = "$GXX,$with_gnu_ld"; then - no_undefined_flag_CXX=' $wl-z ${wl}defs' - if $CC --version | $GREP -v '^2\.7' > /dev/null; then - archive_cmds_CXX='$CC -shared $pic_flag -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-h $wl$soname -o $lib' - archive_expsym_cmds_CXX='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~ - $CC -shared $pic_flag -nostdlib $wl-M $wl$lib.exp $wl-h $wl$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$RM $lib.exp' - - # Commands to make compiler produce verbose output that lists - # what "hidden" libraries, object files and flags are used when - # linking a shared library. - output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP -v "^Configured with:" | $GREP " \-L"' - else - # g++ 2.7 appears to require '-G' NOT '-shared' on this - # platform. - archive_cmds_CXX='$CC -G -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-h $wl$soname -o $lib' - archive_expsym_cmds_CXX='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~ - $CC -G -nostdlib $wl-M $wl$lib.exp $wl-h $wl$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$RM $lib.exp' - - # Commands to make compiler produce verbose output that lists - # what "hidden" libraries, object files and flags are used when - # linking a shared library. - output_verbose_link_cmd='$CC -G $CFLAGS -v conftest.$objext 2>&1 | $GREP -v "^Configured with:" | $GREP " \-L"' - fi - - hardcode_libdir_flag_spec_CXX='$wl-R $wl$libdir' - case $host_os in - solaris2.[0-5] | solaris2.[0-5].*) ;; - *) - whole_archive_flag_spec_CXX='$wl-z ${wl}allextract$convenience $wl-z ${wl}defaultextract' - ;; - esac - fi - ;; - esac - ;; - - sysv4*uw2* | sysv5OpenUNIX* | sysv5UnixWare7.[01].[10]* | unixware7* | sco3.2v5.0.[024]*) - no_undefined_flag_CXX='$wl-z,text' - archive_cmds_need_lc_CXX=no - hardcode_shlibpath_var_CXX=no - runpath_var='LD_RUN_PATH' - - case $cc_basename in - CC*) - archive_cmds_CXX='$CC -G $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags' - archive_expsym_cmds_CXX='$CC -G $wl-Bexport:$export_symbols $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags' - ;; - *) - archive_cmds_CXX='$CC -shared $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags' - archive_expsym_cmds_CXX='$CC -shared $wl-Bexport:$export_symbols $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags' - ;; - esac - ;; - - sysv5* | sco3.2v5* | sco5v6*) - # Note: We CANNOT use -z defs as we might desire, because we do not - # link with -lc, and that would cause any symbols used from libc to - # always be unresolved, which means just about no library would - # ever link correctly. If we're not using GNU ld we use -z text - # though, which does catch some bad symbols but isn't as heavy-handed - # as -z defs. - no_undefined_flag_CXX='$wl-z,text' - allow_undefined_flag_CXX='$wl-z,nodefs' - archive_cmds_need_lc_CXX=no - hardcode_shlibpath_var_CXX=no - hardcode_libdir_flag_spec_CXX='$wl-R,$libdir' - hardcode_libdir_separator_CXX=':' - link_all_deplibs_CXX=yes - export_dynamic_flag_spec_CXX='$wl-Bexport' - runpath_var='LD_RUN_PATH' - - case $cc_basename in - CC*) - archive_cmds_CXX='$CC -G $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags' - archive_expsym_cmds_CXX='$CC -G $wl-Bexport:$export_symbols $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags' - old_archive_cmds_CXX='$CC -Tprelink_objects $oldobjs~ - '"$old_archive_cmds_CXX" - reload_cmds_CXX='$CC -Tprelink_objects $reload_objs~ - '"$reload_cmds_CXX" - ;; - *) - archive_cmds_CXX='$CC -shared $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags' - archive_expsym_cmds_CXX='$CC -shared $wl-Bexport:$export_symbols $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags' - ;; - esac - ;; - - tandem*) - case $cc_basename in - NCC*) - # NonStop-UX NCC 3.20 - # FIXME: insert proper C++ library support - ld_shlibs_CXX=no - ;; - *) - # FIXME: insert proper C++ library support - ld_shlibs_CXX=no - ;; - esac - ;; - - vxworks*) - # FIXME: insert proper C++ library support - ld_shlibs_CXX=no - ;; - - *) - # FIXME: insert proper C++ library support - ld_shlibs_CXX=no - ;; - esac - - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ld_shlibs_CXX" >&5 -printf "%s\n" "$ld_shlibs_CXX" >&6; } - test no = "$ld_shlibs_CXX" && can_build_shared=no - - GCC_CXX=$GXX - LD_CXX=$LD - - ## CAVEAT EMPTOR: - ## There is no encapsulation within the following macros, do not change - ## the running order or otherwise move them around unless you know exactly - ## what you are doing... - # Dependencies to place before and after the object being linked: -predep_objects_CXX= -postdep_objects_CXX= -predeps_CXX= -postdeps_CXX= -compiler_lib_search_path_CXX= - -cat > conftest.$ac_ext <<_LT_EOF -class Foo -{ -public: - Foo (void) { a = 0; } -private: - int a; -}; -_LT_EOF - - -_lt_libdeps_save_CFLAGS=$CFLAGS -case "$CC $CFLAGS " in #( -*\ -flto*\ *) CFLAGS="$CFLAGS -fno-lto" ;; -*\ -fwhopr*\ *) CFLAGS="$CFLAGS -fno-whopr" ;; -*\ -fuse-linker-plugin*\ *) CFLAGS="$CFLAGS -fno-use-linker-plugin" ;; -esac - -if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5 - (eval $ac_compile) 2>&5 - ac_status=$? - printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 - test $ac_status = 0; }; then - # Parse the compiler output and extract the necessary - # objects, libraries and library flags. - - # Sentinel used to keep track of whether or not we are before - # the conftest object file. - pre_test_object_deps_done=no - - for p in `eval "$output_verbose_link_cmd"`; do - case $prev$p in - - -L* | -R* | -l*) - # Some compilers place space between "-{L,R}" and the path. - # Remove the space. - if test x-L = "$p" || - test x-R = "$p"; then - prev=$p - continue - fi - - # Expand the sysroot to ease extracting the directories later. - if test -z "$prev"; then - case $p in - -L*) func_stripname_cnf '-L' '' "$p"; prev=-L; p=$func_stripname_result ;; - -R*) func_stripname_cnf '-R' '' "$p"; prev=-R; p=$func_stripname_result ;; - -l*) func_stripname_cnf '-l' '' "$p"; prev=-l; p=$func_stripname_result ;; - esac - fi - case $p in - =*) func_stripname_cnf '=' '' "$p"; p=$lt_sysroot$func_stripname_result ;; - esac - if test no = "$pre_test_object_deps_done"; then - case $prev in - -L | -R) - # Internal compiler library paths should come after those - # provided the user. The postdeps already come after the - # user supplied libs so there is no need to process them. - if test -z "$compiler_lib_search_path_CXX"; then - compiler_lib_search_path_CXX=$prev$p - else - compiler_lib_search_path_CXX="${compiler_lib_search_path_CXX} $prev$p" - fi - ;; - # The "-l" case would never come before the object being - # linked, so don't bother handling this case. - esac - else - if test -z "$postdeps_CXX"; then - postdeps_CXX=$prev$p - else - postdeps_CXX="${postdeps_CXX} $prev$p" - fi - fi - prev= - ;; - - *.lto.$objext) ;; # Ignore GCC LTO objects - *.$objext) - # This assumes that the test object file only shows up - # once in the compiler output. - if test "$p" = "conftest.$objext"; then - pre_test_object_deps_done=yes - continue - fi - - if test no = "$pre_test_object_deps_done"; then - if test -z "$predep_objects_CXX"; then - predep_objects_CXX=$p - else - predep_objects_CXX="$predep_objects_CXX $p" - fi - else - if test -z "$postdep_objects_CXX"; then - postdep_objects_CXX=$p - else - postdep_objects_CXX="$postdep_objects_CXX $p" - fi - fi - ;; - - *) ;; # Ignore the rest. - - esac - done - - # Clean up. - rm -f a.out a.exe -else - echo "libtool.m4: error: problem compiling CXX test program" -fi - -$RM -f confest.$objext -CFLAGS=$_lt_libdeps_save_CFLAGS - -# PORTME: override above test on systems where it is broken -case $host_os in -interix[3-9]*) - # Interix 3.5 installs completely hosed .la files for C++, so rather than - # hack all around it, let's just trust "g++" to DTRT. - predep_objects_CXX= - postdep_objects_CXX= - postdeps_CXX= - ;; -esac - - -case " $postdeps_CXX " in -*" -lc "*) archive_cmds_need_lc_CXX=no ;; -esac - compiler_lib_search_dirs_CXX= -if test -n "${compiler_lib_search_path_CXX}"; then - compiler_lib_search_dirs_CXX=`echo " ${compiler_lib_search_path_CXX}" | $SED -e 's! -L! !g' -e 's!^ !!'` -fi - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - lt_prog_compiler_wl_CXX= -lt_prog_compiler_pic_CXX= -lt_prog_compiler_static_CXX= - - - # C++ specific cases for pic, static, wl, etc. - if test yes = "$GXX"; then - lt_prog_compiler_wl_CXX='-Wl,' - lt_prog_compiler_static_CXX='-static' - - case $host_os in - aix*) - # All AIX code is PIC. - if test ia64 = "$host_cpu"; then - # AIX 5 now supports IA64 processor - lt_prog_compiler_static_CXX='-Bstatic' - fi - lt_prog_compiler_pic_CXX='-fPIC' - ;; - - amigaos*) - case $host_cpu in - powerpc) - # see comment about AmigaOS4 .so support - lt_prog_compiler_pic_CXX='-fPIC' - ;; - m68k) - # FIXME: we need at least 68020 code to build shared libraries, but - # adding the '-m68020' flag to GCC prevents building anything better, - # like '-m68040'. - lt_prog_compiler_pic_CXX='-m68020 -resident32 -malways-restore-a4' - ;; - esac - ;; - - beos* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*) - # PIC is the default for these OSes. - ;; - mingw* | cygwin* | os2* | pw32* | cegcc*) - # This hack is so that the source file can tell whether it is being - # built for inclusion in a dll (and should export symbols for example). - # Although the cygwin gcc ignores -fPIC, still need this for old-style - # (--disable-auto-import) libraries - lt_prog_compiler_pic_CXX='-DDLL_EXPORT' - case $host_os in - os2*) - lt_prog_compiler_static_CXX='$wl-static' - ;; - esac - ;; - darwin* | rhapsody*) - # PIC is the default on this platform - # Common symbols not allowed in MH_DYLIB files - lt_prog_compiler_pic_CXX='-fno-common' - ;; - *djgpp*) - # DJGPP does not support shared libraries at all - lt_prog_compiler_pic_CXX= - ;; - haiku*) - # PIC is the default for Haiku. - # The "-static" flag exists, but is broken. - lt_prog_compiler_static_CXX= - ;; - interix[3-9]*) - # Interix 3.x gcc -fpic/-fPIC options generate broken code. - # Instead, we relocate shared libraries at runtime. - ;; - sysv4*MP*) - if test -d /usr/nec; then - lt_prog_compiler_pic_CXX=-Kconform_pic - fi - ;; - hpux*) - # PIC is the default for 64-bit PA HP-UX, but not for 32-bit - # PA HP-UX. On IA64 HP-UX, PIC is the default but the pic flag - # sets the default TLS model and affects inlining. - case $host_cpu in - hppa*64*) - ;; - *) - lt_prog_compiler_pic_CXX='-fPIC' - ;; - esac - ;; - *qnx* | *nto*) - # QNX uses GNU C++, but need to define -shared option too, otherwise - # it will coredump. - lt_prog_compiler_pic_CXX='-fPIC -shared' - ;; - *) - lt_prog_compiler_pic_CXX='-fPIC' - ;; - esac - else - case $host_os in - aix[4-9]*) - # All AIX code is PIC. - if test ia64 = "$host_cpu"; then - # AIX 5 now supports IA64 processor - lt_prog_compiler_static_CXX='-Bstatic' - else - lt_prog_compiler_static_CXX='-bnso -bI:/lib/syscalls.exp' - fi - ;; - chorus*) - case $cc_basename in - cxch68*) - # Green Hills C++ Compiler - # _LT_TAGVAR(lt_prog_compiler_static, CXX)="--no_auto_instantiation -u __main -u __premain -u _abort -r $COOL_DIR/lib/libOrb.a $MVME_DIR/lib/CC/libC.a $MVME_DIR/lib/classix/libcx.s.a" - ;; - esac - ;; - mingw* | cygwin* | os2* | pw32* | cegcc*) - # This hack is so that the source file can tell whether it is being - # built for inclusion in a dll (and should export symbols for example). - lt_prog_compiler_pic_CXX='-DDLL_EXPORT' - ;; - dgux*) - case $cc_basename in - ec++*) - lt_prog_compiler_pic_CXX='-KPIC' - ;; - ghcx*) - # Green Hills C++ Compiler - lt_prog_compiler_pic_CXX='-pic' - ;; - *) - ;; - esac - ;; - freebsd* | dragonfly*) - # FreeBSD uses GNU C++ - ;; - hpux9* | hpux10* | hpux11*) - case $cc_basename in - CC*) - lt_prog_compiler_wl_CXX='-Wl,' - lt_prog_compiler_static_CXX='$wl-a ${wl}archive' - if test ia64 != "$host_cpu"; then - lt_prog_compiler_pic_CXX='+Z' - fi - ;; - aCC*) - lt_prog_compiler_wl_CXX='-Wl,' - lt_prog_compiler_static_CXX='$wl-a ${wl}archive' - case $host_cpu in - hppa*64*|ia64*) - # +Z the default - ;; - *) - lt_prog_compiler_pic_CXX='+Z' - ;; - esac - ;; - *) - ;; - esac - ;; - interix*) - # This is c89, which is MS Visual C++ (no shared libs) - # Anyone wants to do a port? - ;; - irix5* | irix6* | nonstopux*) - case $cc_basename in - CC*) - lt_prog_compiler_wl_CXX='-Wl,' - lt_prog_compiler_static_CXX='-non_shared' - # CC pic flag -KPIC is the default. - ;; - *) - ;; - esac - ;; - linux* | k*bsd*-gnu | kopensolaris*-gnu | gnu*) - case $cc_basename in - KCC*) - # KAI C++ Compiler - lt_prog_compiler_wl_CXX='--backend -Wl,' - lt_prog_compiler_pic_CXX='-fPIC' - ;; - ecpc* ) - # old Intel C++ for x86_64, which still supported -KPIC. - lt_prog_compiler_wl_CXX='-Wl,' - lt_prog_compiler_pic_CXX='-KPIC' - lt_prog_compiler_static_CXX='-static' - ;; - icpc* ) - # Intel C++, used to be incompatible with GCC. - # ICC 10 doesn't accept -KPIC any more. - lt_prog_compiler_wl_CXX='-Wl,' - lt_prog_compiler_pic_CXX='-fPIC' - lt_prog_compiler_static_CXX='-static' - ;; - pgCC* | pgcpp*) - # Portland Group C++ compiler - lt_prog_compiler_wl_CXX='-Wl,' - lt_prog_compiler_pic_CXX='-fpic' - lt_prog_compiler_static_CXX='-Bstatic' - ;; - cxx*) - # Compaq C++ - # Make sure the PIC flag is empty. It appears that all Alpha - # Linux and Compaq Tru64 Unix objects are PIC. - lt_prog_compiler_pic_CXX= - lt_prog_compiler_static_CXX='-non_shared' - ;; - xlc* | xlC* | bgxl[cC]* | mpixl[cC]*) - # IBM XL 8.0, 9.0 on PPC and BlueGene - lt_prog_compiler_wl_CXX='-Wl,' - lt_prog_compiler_pic_CXX='-qpic' - lt_prog_compiler_static_CXX='-qstaticlink' - ;; - *) - case `$CC -V 2>&1 | sed 5q` in - *Sun\ C*) - # Sun C++ 5.9 - lt_prog_compiler_pic_CXX='-KPIC' - lt_prog_compiler_static_CXX='-Bstatic' - lt_prog_compiler_wl_CXX='-Qoption ld ' - ;; - esac - ;; - esac - ;; - lynxos*) - ;; - m88k*) - ;; - mvs*) - case $cc_basename in - cxx*) - lt_prog_compiler_pic_CXX='-W c,exportall' - ;; - *) - ;; - esac - ;; - netbsd* | netbsdelf*-gnu) - ;; - *qnx* | *nto*) - # QNX uses GNU C++, but need to define -shared option too, otherwise - # it will coredump. - lt_prog_compiler_pic_CXX='-fPIC -shared' - ;; - osf3* | osf4* | osf5*) - case $cc_basename in - KCC*) - lt_prog_compiler_wl_CXX='--backend -Wl,' - ;; - RCC*) - # Rational C++ 2.4.1 - lt_prog_compiler_pic_CXX='-pic' - ;; - cxx*) - # Digital/Compaq C++ - lt_prog_compiler_wl_CXX='-Wl,' - # Make sure the PIC flag is empty. It appears that all Alpha - # Linux and Compaq Tru64 Unix objects are PIC. - lt_prog_compiler_pic_CXX= - lt_prog_compiler_static_CXX='-non_shared' - ;; - *) - ;; - esac - ;; - psos*) - ;; - solaris*) - case $cc_basename in - CC* | sunCC*) - # Sun C++ 4.2, 5.x and Centerline C++ - lt_prog_compiler_pic_CXX='-KPIC' - lt_prog_compiler_static_CXX='-Bstatic' - lt_prog_compiler_wl_CXX='-Qoption ld ' - ;; - gcx*) - # Green Hills C++ Compiler - lt_prog_compiler_pic_CXX='-PIC' - ;; - *) - ;; - esac - ;; - sunos4*) - case $cc_basename in - CC*) - # Sun C++ 4.x - lt_prog_compiler_pic_CXX='-pic' - lt_prog_compiler_static_CXX='-Bstatic' - ;; - lcc*) - # Lucid - lt_prog_compiler_pic_CXX='-pic' - ;; - *) - ;; - esac - ;; - sysv5* | unixware* | sco3.2v5* | sco5v6* | OpenUNIX*) - case $cc_basename in - CC*) - lt_prog_compiler_wl_CXX='-Wl,' - lt_prog_compiler_pic_CXX='-KPIC' - lt_prog_compiler_static_CXX='-Bstatic' - ;; - esac - ;; - tandem*) - case $cc_basename in - NCC*) - # NonStop-UX NCC 3.20 - lt_prog_compiler_pic_CXX='-KPIC' - ;; - *) - ;; - esac - ;; - vxworks*) - ;; - *) - lt_prog_compiler_can_build_shared_CXX=no - ;; - esac - fi - -case $host_os in - # For platforms that do not support PIC, -DPIC is meaningless: - *djgpp*) - lt_prog_compiler_pic_CXX= - ;; - *) - lt_prog_compiler_pic_CXX="$lt_prog_compiler_pic_CXX -DPIC" - ;; -esac - -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $compiler option to produce PIC" >&5 -printf %s "checking for $compiler option to produce PIC... " >&6; } -if test ${lt_cv_prog_compiler_pic_CXX+y} -then : - printf %s "(cached) " >&6 -else $as_nop - lt_cv_prog_compiler_pic_CXX=$lt_prog_compiler_pic_CXX -fi -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_pic_CXX" >&5 -printf "%s\n" "$lt_cv_prog_compiler_pic_CXX" >&6; } -lt_prog_compiler_pic_CXX=$lt_cv_prog_compiler_pic_CXX - -# -# Check to make sure the PIC flag actually works. -# -if test -n "$lt_prog_compiler_pic_CXX"; then - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking if $compiler PIC flag $lt_prog_compiler_pic_CXX works" >&5 -printf %s "checking if $compiler PIC flag $lt_prog_compiler_pic_CXX works... " >&6; } -if test ${lt_cv_prog_compiler_pic_works_CXX+y} -then : - printf %s "(cached) " >&6 -else $as_nop - lt_cv_prog_compiler_pic_works_CXX=no - ac_outfile=conftest.$ac_objext - echo "$lt_simple_compile_test_code" > conftest.$ac_ext - lt_compiler_flag="$lt_prog_compiler_pic_CXX -DPIC" ## exclude from sc_useless_quotes_in_assignment - # Insert the option either (1) after the last *FLAGS variable, or - # (2) before a word containing "conftest.", or (3) at the end. - # Note that $ac_compile itself does not contain backslashes and begins - # with a dollar sign (not a hyphen), so the echo should work correctly. - # The option is referenced via a variable to avoid confusing sed. - lt_compile=`echo "$ac_compile" | $SED \ - -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ - -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ - -e 's:$: $lt_compiler_flag:'` - (eval echo "\"\$as_me:$LINENO: $lt_compile\"" >&5) - (eval "$lt_compile" 2>conftest.err) - ac_status=$? - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - if (exit $ac_status) && test -s "$ac_outfile"; then - # The compiler can only warn and ignore the option if not recognized - # So say no if there are warnings other than the usual output. - $ECHO "$_lt_compiler_boilerplate" | $SED '/^$/d' >conftest.exp - $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2 - if test ! -s conftest.er2 || diff conftest.exp conftest.er2 >/dev/null; then - lt_cv_prog_compiler_pic_works_CXX=yes - fi - fi - $RM conftest* - -fi -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_pic_works_CXX" >&5 -printf "%s\n" "$lt_cv_prog_compiler_pic_works_CXX" >&6; } - -if test yes = "$lt_cv_prog_compiler_pic_works_CXX"; then - case $lt_prog_compiler_pic_CXX in - "" | " "*) ;; - *) lt_prog_compiler_pic_CXX=" $lt_prog_compiler_pic_CXX" ;; - esac -else - lt_prog_compiler_pic_CXX= - lt_prog_compiler_can_build_shared_CXX=no -fi - -fi - - - - - -# -# Check to make sure the static flag actually works. -# -wl=$lt_prog_compiler_wl_CXX eval lt_tmp_static_flag=\"$lt_prog_compiler_static_CXX\" -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking if $compiler static flag $lt_tmp_static_flag works" >&5 -printf %s "checking if $compiler static flag $lt_tmp_static_flag works... " >&6; } -if test ${lt_cv_prog_compiler_static_works_CXX+y} -then : - printf %s "(cached) " >&6 -else $as_nop - lt_cv_prog_compiler_static_works_CXX=no - save_LDFLAGS=$LDFLAGS - LDFLAGS="$LDFLAGS $lt_tmp_static_flag" - echo "$lt_simple_link_test_code" > conftest.$ac_ext - if (eval $ac_link 2>conftest.err) && test -s conftest$ac_exeext; then - # The linker can only warn and ignore the option if not recognized - # So say no if there are warnings - if test -s conftest.err; then - # Append any errors to the config.log. - cat conftest.err 1>&5 - $ECHO "$_lt_linker_boilerplate" | $SED '/^$/d' > conftest.exp - $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2 - if diff conftest.exp conftest.er2 >/dev/null; then - lt_cv_prog_compiler_static_works_CXX=yes - fi - else - lt_cv_prog_compiler_static_works_CXX=yes - fi - fi - $RM -r conftest* - LDFLAGS=$save_LDFLAGS - -fi -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_static_works_CXX" >&5 -printf "%s\n" "$lt_cv_prog_compiler_static_works_CXX" >&6; } - -if test yes = "$lt_cv_prog_compiler_static_works_CXX"; then - : -else - lt_prog_compiler_static_CXX= -fi - - - - - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking if $compiler supports -c -o file.$ac_objext" >&5 -printf %s "checking if $compiler supports -c -o file.$ac_objext... " >&6; } -if test ${lt_cv_prog_compiler_c_o_CXX+y} -then : - printf %s "(cached) " >&6 -else $as_nop - lt_cv_prog_compiler_c_o_CXX=no - $RM -r conftest 2>/dev/null - mkdir conftest - cd conftest - mkdir out - echo "$lt_simple_compile_test_code" > conftest.$ac_ext - - lt_compiler_flag="-o out/conftest2.$ac_objext" - # Insert the option either (1) after the last *FLAGS variable, or - # (2) before a word containing "conftest.", or (3) at the end. - # Note that $ac_compile itself does not contain backslashes and begins - # with a dollar sign (not a hyphen), so the echo should work correctly. - lt_compile=`echo "$ac_compile" | $SED \ - -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ - -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ - -e 's:$: $lt_compiler_flag:'` - (eval echo "\"\$as_me:$LINENO: $lt_compile\"" >&5) - (eval "$lt_compile" 2>out/conftest.err) - ac_status=$? - cat out/conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - if (exit $ac_status) && test -s out/conftest2.$ac_objext - then - # The compiler can only warn and ignore the option if not recognized - # So say no if there are warnings - $ECHO "$_lt_compiler_boilerplate" | $SED '/^$/d' > out/conftest.exp - $SED '/^$/d; /^ *+/d' out/conftest.err >out/conftest.er2 - if test ! -s out/conftest.er2 || diff out/conftest.exp out/conftest.er2 >/dev/null; then - lt_cv_prog_compiler_c_o_CXX=yes - fi - fi - chmod u+w . 2>&5 - $RM conftest* - # SGI C++ compiler will create directory out/ii_files/ for - # template instantiation - test -d out/ii_files && $RM out/ii_files/* && rmdir out/ii_files - $RM out/* && rmdir out - cd .. - $RM -r conftest - $RM conftest* - -fi -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_c_o_CXX" >&5 -printf "%s\n" "$lt_cv_prog_compiler_c_o_CXX" >&6; } - - - - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking if $compiler supports -c -o file.$ac_objext" >&5 -printf %s "checking if $compiler supports -c -o file.$ac_objext... " >&6; } -if test ${lt_cv_prog_compiler_c_o_CXX+y} -then : - printf %s "(cached) " >&6 -else $as_nop - lt_cv_prog_compiler_c_o_CXX=no - $RM -r conftest 2>/dev/null - mkdir conftest - cd conftest - mkdir out - echo "$lt_simple_compile_test_code" > conftest.$ac_ext - - lt_compiler_flag="-o out/conftest2.$ac_objext" - # Insert the option either (1) after the last *FLAGS variable, or - # (2) before a word containing "conftest.", or (3) at the end. - # Note that $ac_compile itself does not contain backslashes and begins - # with a dollar sign (not a hyphen), so the echo should work correctly. - lt_compile=`echo "$ac_compile" | $SED \ - -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ - -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ - -e 's:$: $lt_compiler_flag:'` - (eval echo "\"\$as_me:$LINENO: $lt_compile\"" >&5) - (eval "$lt_compile" 2>out/conftest.err) - ac_status=$? - cat out/conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - if (exit $ac_status) && test -s out/conftest2.$ac_objext - then - # The compiler can only warn and ignore the option if not recognized - # So say no if there are warnings - $ECHO "$_lt_compiler_boilerplate" | $SED '/^$/d' > out/conftest.exp - $SED '/^$/d; /^ *+/d' out/conftest.err >out/conftest.er2 - if test ! -s out/conftest.er2 || diff out/conftest.exp out/conftest.er2 >/dev/null; then - lt_cv_prog_compiler_c_o_CXX=yes - fi - fi - chmod u+w . 2>&5 - $RM conftest* - # SGI C++ compiler will create directory out/ii_files/ for - # template instantiation - test -d out/ii_files && $RM out/ii_files/* && rmdir out/ii_files - $RM out/* && rmdir out - cd .. - $RM -r conftest - $RM conftest* - -fi -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_c_o_CXX" >&5 -printf "%s\n" "$lt_cv_prog_compiler_c_o_CXX" >&6; } - - - - -hard_links=nottested -if test no = "$lt_cv_prog_compiler_c_o_CXX" && test no != "$need_locks"; then - # do not overwrite the value of need_locks provided by the user - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking if we can lock with hard links" >&5 -printf %s "checking if we can lock with hard links... " >&6; } - hard_links=yes - $RM conftest* - ln conftest.a conftest.b 2>/dev/null && hard_links=no - touch conftest.a - ln conftest.a conftest.b 2>&5 || hard_links=no - ln conftest.a conftest.b 2>/dev/null && hard_links=no - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $hard_links" >&5 -printf "%s\n" "$hard_links" >&6; } - if test no = "$hard_links"; then - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: '$CC' does not support '-c -o', so 'make -j' may be unsafe" >&5 -printf "%s\n" "$as_me: WARNING: '$CC' does not support '-c -o', so 'make -j' may be unsafe" >&2;} - need_locks=warn - fi -else - need_locks=no -fi - - - - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether the $compiler linker ($LD) supports shared libraries" >&5 -printf %s "checking whether the $compiler linker ($LD) supports shared libraries... " >&6; } - - export_symbols_cmds_CXX='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols' - exclude_expsyms_CXX='_GLOBAL_OFFSET_TABLE_|_GLOBAL__F[ID]_.*' - case $host_os in - aix[4-9]*) - # If we're using GNU nm, then we don't want the "-C" option. - # -C means demangle to GNU nm, but means don't demangle to AIX nm. - # Without the "-l" option, or with the "-B" option, AIX nm treats - # weak defined symbols like other global defined symbols, whereas - # GNU nm marks them as "W". - # While the 'weak' keyword is ignored in the Export File, we need - # it in the Import File for the 'aix-soname' feature, so we have - # to replace the "-B" option with "-P" for AIX nm. - if $NM -V 2>&1 | $GREP 'GNU' > /dev/null; then - export_symbols_cmds_CXX='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B") || (\$ 2 == "W")) && (substr(\$ 3,1,1) != ".")) { if (\$ 2 == "W") { print \$ 3 " weak" } else { print \$ 3 } } }'\'' | sort -u > $export_symbols' - else - export_symbols_cmds_CXX='`func_echo_all $NM | $SED -e '\''s/B\([^B]*\)$/P\1/'\''` -PCpgl $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B") || (\$ 2 == "W") || (\$ 2 == "V") || (\$ 2 == "Z")) && (substr(\$ 1,1,1) != ".")) { if ((\$ 2 == "W") || (\$ 2 == "V") || (\$ 2 == "Z")) { print \$ 1 " weak" } else { print \$ 1 } } }'\'' | sort -u > $export_symbols' - fi - ;; - pw32*) - export_symbols_cmds_CXX=$ltdll_cmds - ;; - cygwin* | mingw* | cegcc*) - case $cc_basename in - cl*) - exclude_expsyms_CXX='_NULL_IMPORT_DESCRIPTOR|_IMPORT_DESCRIPTOR_.*' - ;; - *) - export_symbols_cmds_CXX='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[BCDGRS][ ]/s/.*[ ]\([^ ]*\)/\1 DATA/;s/^.*[ ]__nm__\([^ ]*\)[ ][^ ]*/\1 DATA/;/^I[ ]/d;/^[AITW][ ]/s/.* //'\'' | sort | uniq > $export_symbols' - exclude_expsyms_CXX='[_]+GLOBAL_OFFSET_TABLE_|[_]+GLOBAL__[FID]_.*|[_]+head_[A-Za-z0-9_]+_dll|[A-Za-z0-9_]+_dll_iname' - ;; - esac - ;; - linux* | k*bsd*-gnu | gnu*) - link_all_deplibs_CXX=no - ;; - *) - export_symbols_cmds_CXX='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols' - ;; - esac - -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ld_shlibs_CXX" >&5 -printf "%s\n" "$ld_shlibs_CXX" >&6; } -test no = "$ld_shlibs_CXX" && can_build_shared=no - -with_gnu_ld_CXX=$with_gnu_ld - - - - - - -# -# Do we need to explicitly link libc? -# -case "x$archive_cmds_need_lc_CXX" in -x|xyes) - # Assume -lc should be added - archive_cmds_need_lc_CXX=yes - - if test yes,yes = "$GCC,$enable_shared"; then - case $archive_cmds_CXX in - *'~'*) - # FIXME: we may have to deal with multi-command sequences. - ;; - '$CC '*) - # Test whether the compiler implicitly links with -lc since on some - # systems, -lgcc has to come before -lc. If gcc already passes -lc - # to ld, don't add -lc before -lgcc. - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether -lc should be explicitly linked in" >&5 -printf %s "checking whether -lc should be explicitly linked in... " >&6; } -if test ${lt_cv_archive_cmds_need_lc_CXX+y} -then : - printf %s "(cached) " >&6 -else $as_nop - $RM conftest* - echo "$lt_simple_compile_test_code" > conftest.$ac_ext - - if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5 - (eval $ac_compile) 2>&5 - ac_status=$? - printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 - test $ac_status = 0; } 2>conftest.err; then - soname=conftest - lib=conftest - libobjs=conftest.$ac_objext - deplibs= - wl=$lt_prog_compiler_wl_CXX - pic_flag=$lt_prog_compiler_pic_CXX - compiler_flags=-v - linker_flags=-v - verstring= - output_objdir=. - libname=conftest - lt_save_allow_undefined_flag=$allow_undefined_flag_CXX - allow_undefined_flag_CXX= - if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$archive_cmds_CXX 2\>\&1 \| $GREP \" -lc \" \>/dev/null 2\>\&1\""; } >&5 - (eval $archive_cmds_CXX 2\>\&1 \| $GREP \" -lc \" \>/dev/null 2\>\&1) 2>&5 - ac_status=$? - printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 - test $ac_status = 0; } - then - lt_cv_archive_cmds_need_lc_CXX=no - else - lt_cv_archive_cmds_need_lc_CXX=yes - fi - allow_undefined_flag_CXX=$lt_save_allow_undefined_flag - else - cat conftest.err 1>&5 - fi - $RM conftest* - -fi -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $lt_cv_archive_cmds_need_lc_CXX" >&5 -printf "%s\n" "$lt_cv_archive_cmds_need_lc_CXX" >&6; } - archive_cmds_need_lc_CXX=$lt_cv_archive_cmds_need_lc_CXX - ;; - esac - fi - ;; -esac - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking dynamic linker characteristics" >&5 -printf %s "checking dynamic linker characteristics... " >&6; } - -library_names_spec= -libname_spec='lib$name' -soname_spec= -shrext_cmds=.so -postinstall_cmds= -postuninstall_cmds= -finish_cmds= -finish_eval= -shlibpath_var= -shlibpath_overrides_runpath=unknown -version_type=none -dynamic_linker="$host_os ld.so" -sys_lib_dlsearch_path_spec="/lib /usr/lib" -need_lib_prefix=unknown -hardcode_into_libs=no - -# when you set need_version to no, make sure it does not cause -set_version -# flags to be left without arguments -need_version=unknown - - - -case $host_os in -aix3*) - version_type=linux # correct to gnu/linux during the next big refactor - library_names_spec='$libname$release$shared_ext$versuffix $libname.a' - shlibpath_var=LIBPATH - - # AIX 3 has no versioning support, so we append a major version to the name. - soname_spec='$libname$release$shared_ext$major' - ;; - -aix[4-9]*) - version_type=linux # correct to gnu/linux during the next big refactor - need_lib_prefix=no - need_version=no - hardcode_into_libs=yes - if test ia64 = "$host_cpu"; then - # AIX 5 supports IA64 - library_names_spec='$libname$release$shared_ext$major $libname$release$shared_ext$versuffix $libname$shared_ext' - shlibpath_var=LD_LIBRARY_PATH - else - # With GCC up to 2.95.x, collect2 would create an import file - # for dependence libraries. The import file would start with - # the line '#! .'. This would cause the generated library to - # depend on '.', always an invalid library. This was fixed in - # development snapshots of GCC prior to 3.0. - case $host_os in - aix4 | aix4.[01] | aix4.[01].*) - if { echo '#if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 97)' - echo ' yes ' - echo '#endif'; } | $CC -E - | $GREP yes > /dev/null; then - : - else - can_build_shared=no - fi - ;; - esac - # Using Import Files as archive members, it is possible to support - # filename-based versioning of shared library archives on AIX. While - # this would work for both with and without runtime linking, it will - # prevent static linking of such archives. So we do filename-based - # shared library versioning with .so extension only, which is used - # when both runtime linking and shared linking is enabled. - # Unfortunately, runtime linking may impact performance, so we do - # not want this to be the default eventually. Also, we use the - # versioned .so libs for executables only if there is the -brtl - # linker flag in LDFLAGS as well, or --with-aix-soname=svr4 only. - # To allow for filename-based versioning support, we need to create - # libNAME.so.V as an archive file, containing: - # *) an Import File, referring to the versioned filename of the - # archive as well as the shared archive member, telling the - # bitwidth (32 or 64) of that shared object, and providing the - # list of exported symbols of that shared object, eventually - # decorated with the 'weak' keyword - # *) the shared object with the F_LOADONLY flag set, to really avoid - # it being seen by the linker. - # At run time we better use the real file rather than another symlink, - # but for link time we create the symlink libNAME.so -> libNAME.so.V - - case $with_aix_soname,$aix_use_runtimelinking in - # AIX (on Power*) has no versioning support, so currently we cannot hardcode correct - # soname into executable. Probably we can add versioning support to - # collect2, so additional links can be useful in future. - aix,yes) # traditional libtool - dynamic_linker='AIX unversionable lib.so' - # If using run time linking (on AIX 4.2 or later) use lib.so - # instead of lib.a to let people know that these are not - # typical AIX shared libraries. - library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' - ;; - aix,no) # traditional AIX only - dynamic_linker='AIX lib.a(lib.so.V)' - # We preserve .a as extension for shared libraries through AIX4.2 - # and later when we are not doing run time linking. - library_names_spec='$libname$release.a $libname.a' - soname_spec='$libname$release$shared_ext$major' - ;; - svr4,*) # full svr4 only - dynamic_linker="AIX lib.so.V($shared_archive_member_spec.o)" - library_names_spec='$libname$release$shared_ext$major $libname$shared_ext' - # We do not specify a path in Import Files, so LIBPATH fires. - shlibpath_overrides_runpath=yes - ;; - *,yes) # both, prefer svr4 - dynamic_linker="AIX lib.so.V($shared_archive_member_spec.o), lib.a(lib.so.V)" - library_names_spec='$libname$release$shared_ext$major $libname$shared_ext' - # unpreferred sharedlib libNAME.a needs extra handling - postinstall_cmds='test -n "$linkname" || linkname="$realname"~func_stripname "" ".so" "$linkname"~$install_shared_prog "$dir/$func_stripname_result.$libext" "$destdir/$func_stripname_result.$libext"~test -z "$tstripme" || test -z "$striplib" || $striplib "$destdir/$func_stripname_result.$libext"' - postuninstall_cmds='for n in $library_names $old_library; do :; done~func_stripname "" ".so" "$n"~test "$func_stripname_result" = "$n" || func_append rmfiles " $odir/$func_stripname_result.$libext"' - # We do not specify a path in Import Files, so LIBPATH fires. - shlibpath_overrides_runpath=yes - ;; - *,no) # both, prefer aix - dynamic_linker="AIX lib.a(lib.so.V), lib.so.V($shared_archive_member_spec.o)" - library_names_spec='$libname$release.a $libname.a' - soname_spec='$libname$release$shared_ext$major' - # unpreferred sharedlib libNAME.so.V and symlink libNAME.so need extra handling - postinstall_cmds='test -z "$dlname" || $install_shared_prog $dir/$dlname $destdir/$dlname~test -z "$tstripme" || test -z "$striplib" || $striplib $destdir/$dlname~test -n "$linkname" || linkname=$realname~func_stripname "" ".a" "$linkname"~(cd "$destdir" && $LN_S -f $dlname $func_stripname_result.so)' - postuninstall_cmds='test -z "$dlname" || func_append rmfiles " $odir/$dlname"~for n in $old_library $library_names; do :; done~func_stripname "" ".a" "$n"~func_append rmfiles " $odir/$func_stripname_result.so"' - ;; - esac - shlibpath_var=LIBPATH - fi - ;; - -amigaos*) - case $host_cpu in - powerpc) - # Since July 2007 AmigaOS4 officially supports .so libraries. - # When compiling the executable, add -use-dynld -Lsobjs: to the compileline. - library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' - ;; - m68k) - library_names_spec='$libname.ixlibrary $libname.a' - # Create ${libname}_ixlibrary.a entries in /sys/libs. - finish_eval='for lib in `ls $libdir/*.ixlibrary 2>/dev/null`; do libname=`func_echo_all "$lib" | $SED '\''s%^.*/\([^/]*\)\.ixlibrary$%\1%'\''`; $RM /sys/libs/${libname}_ixlibrary.a; $show "cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a"; cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a || exit 1; done' - ;; - esac - ;; - -beos*) - library_names_spec='$libname$shared_ext' - dynamic_linker="$host_os ld.so" - shlibpath_var=LIBRARY_PATH - ;; - -bsdi[45]*) - version_type=linux # correct to gnu/linux during the next big refactor - need_version=no - library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' - soname_spec='$libname$release$shared_ext$major' - finish_cmds='PATH="\$PATH:/sbin" ldconfig $libdir' - shlibpath_var=LD_LIBRARY_PATH - sys_lib_search_path_spec="/shlib /usr/lib /usr/X11/lib /usr/contrib/lib /lib /usr/local/lib" - sys_lib_dlsearch_path_spec="/shlib /usr/lib /usr/local/lib" - # the default ld.so.conf also contains /usr/contrib/lib and - # /usr/X11R6/lib (/usr/X11 is a link to /usr/X11R6), but let us allow - # libtool to hard-code these into programs - ;; - -cygwin* | mingw* | pw32* | cegcc*) - version_type=windows - shrext_cmds=.dll - need_version=no - need_lib_prefix=no - - case $GCC,$cc_basename in - yes,*) - # gcc - library_names_spec='$libname.dll.a' - # DLL is installed to $(libdir)/../bin by postinstall_cmds - postinstall_cmds='base_file=`basename \$file`~ - dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\$base_file'\''i; echo \$dlname'\''`~ - dldir=$destdir/`dirname \$dlpath`~ - test -d \$dldir || mkdir -p \$dldir~ - $install_prog $dir/$dlname \$dldir/$dlname~ - chmod a+x \$dldir/$dlname~ - if test -n '\''$stripme'\'' && test -n '\''$striplib'\''; then - eval '\''$striplib \$dldir/$dlname'\'' || exit \$?; - fi' - postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; echo \$dlname'\''`~ - dlpath=$dir/\$dldll~ - $RM \$dlpath' - shlibpath_overrides_runpath=yes - - case $host_os in - cygwin*) - # Cygwin DLLs use 'cyg' prefix rather than 'lib' - soname_spec='`echo $libname | sed -e 's/^lib/cyg/'``echo $release | $SED -e 's/[.]/-/g'`$versuffix$shared_ext' - - ;; - mingw* | cegcc*) - # MinGW DLLs use traditional 'lib' prefix - soname_spec='$libname`echo $release | $SED -e 's/[.]/-/g'`$versuffix$shared_ext' - ;; - pw32*) - # pw32 DLLs use 'pw' prefix rather than 'lib' - library_names_spec='`echo $libname | sed -e 's/^lib/pw/'``echo $release | $SED -e 's/[.]/-/g'`$versuffix$shared_ext' - ;; - esac - dynamic_linker='Win32 ld.exe' - ;; - - *,cl*) - # Native MSVC - libname_spec='$name' - soname_spec='$libname`echo $release | $SED -e 's/[.]/-/g'`$versuffix$shared_ext' - library_names_spec='$libname.dll.lib' - - case $build_os in - mingw*) - sys_lib_search_path_spec= - lt_save_ifs=$IFS - IFS=';' - for lt_path in $LIB - do - IFS=$lt_save_ifs - # Let DOS variable expansion print the short 8.3 style file name. - lt_path=`cd "$lt_path" 2>/dev/null && cmd //C "for %i in (".") do @echo %~si"` - sys_lib_search_path_spec="$sys_lib_search_path_spec $lt_path" - done - IFS=$lt_save_ifs - # Convert to MSYS style. - sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | sed -e 's|\\\\|/|g' -e 's| \\([a-zA-Z]\\):| /\\1|g' -e 's|^ ||'` - ;; - cygwin*) - # Convert to unix form, then to dos form, then back to unix form - # but this time dos style (no spaces!) so that the unix form looks - # like /cygdrive/c/PROGRA~1:/cygdr... - sys_lib_search_path_spec=`cygpath --path --unix "$LIB"` - sys_lib_search_path_spec=`cygpath --path --dos "$sys_lib_search_path_spec" 2>/dev/null` - sys_lib_search_path_spec=`cygpath --path --unix "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"` - ;; - *) - sys_lib_search_path_spec=$LIB - if $ECHO "$sys_lib_search_path_spec" | $GREP ';[c-zC-Z]:/' >/dev/null; then - # It is most probably a Windows format PATH. - sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | $SED -e 's/;/ /g'` - else - sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"` - fi - # FIXME: find the short name or the path components, as spaces are - # common. (e.g. "Program Files" -> "PROGRA~1") - ;; - esac - - # DLL is installed to $(libdir)/../bin by postinstall_cmds - postinstall_cmds='base_file=`basename \$file`~ - dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\$base_file'\''i; echo \$dlname'\''`~ - dldir=$destdir/`dirname \$dlpath`~ - test -d \$dldir || mkdir -p \$dldir~ - $install_prog $dir/$dlname \$dldir/$dlname' - postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; echo \$dlname'\''`~ - dlpath=$dir/\$dldll~ - $RM \$dlpath' - shlibpath_overrides_runpath=yes - dynamic_linker='Win32 link.exe' - ;; - - *) - # Assume MSVC wrapper - library_names_spec='$libname`echo $release | $SED -e 's/[.]/-/g'`$versuffix$shared_ext $libname.lib' - dynamic_linker='Win32 ld.exe' - ;; - esac - # FIXME: first we should search . and the directory the executable is in - shlibpath_var=PATH - ;; - -darwin* | rhapsody*) - dynamic_linker="$host_os dyld" - version_type=darwin - need_lib_prefix=no - need_version=no - library_names_spec='$libname$release$major$shared_ext $libname$shared_ext' - soname_spec='$libname$release$major$shared_ext' - shlibpath_overrides_runpath=yes - shlibpath_var=DYLD_LIBRARY_PATH - shrext_cmds='`test .$module = .yes && echo .so || echo .dylib`' - - sys_lib_dlsearch_path_spec='/usr/local/lib /lib /usr/lib' - ;; - -dgux*) - version_type=linux # correct to gnu/linux during the next big refactor - need_lib_prefix=no - need_version=no - library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' - soname_spec='$libname$release$shared_ext$major' - shlibpath_var=LD_LIBRARY_PATH - ;; - -freebsd* | dragonfly*) - # DragonFly does not have aout. When/if they implement a new - # versioning mechanism, adjust this. - if test -x /usr/bin/objformat; then - objformat=`/usr/bin/objformat` - else - case $host_os in - freebsd[23].*) objformat=aout ;; - *) objformat=elf ;; - esac - fi - version_type=freebsd-$objformat - case $version_type in - freebsd-elf*) - library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' - soname_spec='$libname$release$shared_ext$major' - need_version=no - need_lib_prefix=no - ;; - freebsd-*) - library_names_spec='$libname$release$shared_ext$versuffix $libname$shared_ext$versuffix' - need_version=yes - ;; - esac - shlibpath_var=LD_LIBRARY_PATH - case $host_os in - freebsd2.*) - shlibpath_overrides_runpath=yes - ;; - freebsd3.[01]* | freebsdelf3.[01]*) - shlibpath_overrides_runpath=yes - hardcode_into_libs=yes - ;; - freebsd3.[2-9]* | freebsdelf3.[2-9]* | \ - freebsd4.[0-5] | freebsdelf4.[0-5] | freebsd4.1.1 | freebsdelf4.1.1) - shlibpath_overrides_runpath=no - hardcode_into_libs=yes - ;; - *) # from 4.6 on, and DragonFly - shlibpath_overrides_runpath=yes - hardcode_into_libs=yes - ;; - esac - ;; - -haiku*) - version_type=linux # correct to gnu/linux during the next big refactor - need_lib_prefix=no - need_version=no - dynamic_linker="$host_os runtime_loader" - library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' - soname_spec='$libname$release$shared_ext$major' - shlibpath_var=LIBRARY_PATH - shlibpath_overrides_runpath=no - sys_lib_dlsearch_path_spec='/boot/home/config/lib /boot/common/lib /boot/system/lib' - hardcode_into_libs=yes - ;; - -hpux9* | hpux10* | hpux11*) - # Give a soname corresponding to the major version so that dld.sl refuses to - # link against other versions. - version_type=sunos - need_lib_prefix=no - need_version=no - case $host_cpu in - ia64*) - shrext_cmds='.so' - hardcode_into_libs=yes - dynamic_linker="$host_os dld.so" - shlibpath_var=LD_LIBRARY_PATH - shlibpath_overrides_runpath=yes # Unless +noenvvar is specified. - library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' - soname_spec='$libname$release$shared_ext$major' - if test 32 = "$HPUX_IA64_MODE"; then - sys_lib_search_path_spec="/usr/lib/hpux32 /usr/local/lib/hpux32 /usr/local/lib" - sys_lib_dlsearch_path_spec=/usr/lib/hpux32 - else - sys_lib_search_path_spec="/usr/lib/hpux64 /usr/local/lib/hpux64" - sys_lib_dlsearch_path_spec=/usr/lib/hpux64 - fi - ;; - hppa*64*) - shrext_cmds='.sl' - hardcode_into_libs=yes - dynamic_linker="$host_os dld.sl" - shlibpath_var=LD_LIBRARY_PATH # How should we handle SHLIB_PATH - shlibpath_overrides_runpath=yes # Unless +noenvvar is specified. - library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' - soname_spec='$libname$release$shared_ext$major' - sys_lib_search_path_spec="/usr/lib/pa20_64 /usr/ccs/lib/pa20_64" - sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec - ;; - *) - shrext_cmds='.sl' - dynamic_linker="$host_os dld.sl" - shlibpath_var=SHLIB_PATH - shlibpath_overrides_runpath=no # +s is required to enable SHLIB_PATH - library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' - soname_spec='$libname$release$shared_ext$major' - ;; - esac - # HP-UX runs *really* slowly unless shared libraries are mode 555, ... - postinstall_cmds='chmod 555 $lib' - # or fails outright, so override atomically: - install_override_mode=555 - ;; - -interix[3-9]*) - version_type=linux # correct to gnu/linux during the next big refactor - need_lib_prefix=no - need_version=no - library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' - soname_spec='$libname$release$shared_ext$major' - dynamic_linker='Interix 3.x ld.so.1 (PE, like ELF)' - shlibpath_var=LD_LIBRARY_PATH - shlibpath_overrides_runpath=no - hardcode_into_libs=yes - ;; - -irix5* | irix6* | nonstopux*) - case $host_os in - nonstopux*) version_type=nonstopux ;; - *) - if test yes = "$lt_cv_prog_gnu_ld"; then - version_type=linux # correct to gnu/linux during the next big refactor - else - version_type=irix - fi ;; - esac - need_lib_prefix=no - need_version=no - soname_spec='$libname$release$shared_ext$major' - library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$release$shared_ext $libname$shared_ext' - case $host_os in - irix5* | nonstopux*) - libsuff= shlibsuff= - ;; - *) - case $LD in # libtool.m4 will add one of these switches to LD - *-32|*"-32 "|*-melf32bsmip|*"-melf32bsmip ") - libsuff= shlibsuff= libmagic=32-bit;; - *-n32|*"-n32 "|*-melf32bmipn32|*"-melf32bmipn32 ") - libsuff=32 shlibsuff=N32 libmagic=N32;; - *-64|*"-64 "|*-melf64bmip|*"-melf64bmip ") - libsuff=64 shlibsuff=64 libmagic=64-bit;; - *) libsuff= shlibsuff= libmagic=never-match;; - esac - ;; - esac - shlibpath_var=LD_LIBRARY${shlibsuff}_PATH - shlibpath_overrides_runpath=no - sys_lib_search_path_spec="/usr/lib$libsuff /lib$libsuff /usr/local/lib$libsuff" - sys_lib_dlsearch_path_spec="/usr/lib$libsuff /lib$libsuff" - hardcode_into_libs=yes - ;; - -# No shared lib support for Linux oldld, aout, or coff. -linux*oldld* | linux*aout* | linux*coff*) - dynamic_linker=no - ;; - -linux*android*) - version_type=none # Android doesn't support versioned libraries. - need_lib_prefix=no - need_version=no - library_names_spec='$libname$release$shared_ext' - soname_spec='$libname$release$shared_ext' - finish_cmds= - shlibpath_var=LD_LIBRARY_PATH - shlibpath_overrides_runpath=yes - - # This implies no fast_install, which is unacceptable. - # Some rework will be needed to allow for fast_install - # before this can be enabled. - hardcode_into_libs=yes - - dynamic_linker='Android linker' - # Don't embed -rpath directories since the linker doesn't support them. - hardcode_libdir_flag_spec_CXX='-L$libdir' - ;; - -# This must be glibc/ELF. -linux* | k*bsd*-gnu | kopensolaris*-gnu | gnu*) - version_type=linux # correct to gnu/linux during the next big refactor - need_lib_prefix=no - need_version=no - library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' - soname_spec='$libname$release$shared_ext$major' - finish_cmds='PATH="\$PATH:/sbin" ldconfig -n $libdir' - shlibpath_var=LD_LIBRARY_PATH - shlibpath_overrides_runpath=no - - # Some binutils ld are patched to set DT_RUNPATH - if test ${lt_cv_shlibpath_overrides_runpath+y} -then : - printf %s "(cached) " >&6 -else $as_nop - lt_cv_shlibpath_overrides_runpath=no - save_LDFLAGS=$LDFLAGS - save_libdir=$libdir - eval "libdir=/foo; wl=\"$lt_prog_compiler_wl_CXX\"; \ - LDFLAGS=\"\$LDFLAGS $hardcode_libdir_flag_spec_CXX\"" - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - -int -main (void) -{ - - ; - return 0; -} -_ACEOF -if ac_fn_cxx_try_link "$LINENO" -then : - if ($OBJDUMP -p conftest$ac_exeext) 2>/dev/null | grep "RUNPATH.*$libdir" >/dev/null -then : - lt_cv_shlibpath_overrides_runpath=yes -fi -fi -rm -f core conftest.err conftest.$ac_objext conftest.beam \ - conftest$ac_exeext conftest.$ac_ext - LDFLAGS=$save_LDFLAGS - libdir=$save_libdir - -fi - - shlibpath_overrides_runpath=$lt_cv_shlibpath_overrides_runpath - - # This implies no fast_install, which is unacceptable. - # Some rework will be needed to allow for fast_install - # before this can be enabled. - hardcode_into_libs=yes - - # Ideally, we could use ldconfig to report *all* directores which are - # searched for libraries, however this is still not possible. Aside from not - # being certain /sbin/ldconfig is available, command - # 'ldconfig -N -X -v | grep ^/' on 64bit Fedora does not report /usr/lib64, - # even though it is searched at run-time. Try to do the best guess by - # appending ld.so.conf contents (and includes) to the search path. - if test -f /etc/ld.so.conf; then - lt_ld_extra=`awk '/^include / { system(sprintf("cd /etc; cat %s 2>/dev/null", \$2)); skip = 1; } { if (!skip) print \$0; skip = 0; }' < /etc/ld.so.conf | $SED -e 's/#.*//;/^[ ]*hwcap[ ]/d;s/[:, ]/ /g;s/=[^=]*$//;s/=[^= ]* / /g;s/"//g;/^$/d' | tr '\n' ' '` - sys_lib_dlsearch_path_spec="/lib /usr/lib $lt_ld_extra" - fi - - # We used to test for /lib/ld.so.1 and disable shared libraries on - # powerpc, because MkLinux only supported shared libraries with the - # GNU dynamic linker. Since this was broken with cross compilers, - # most powerpc-linux boxes support dynamic linking these days and - # people can always --disable-shared, the test was removed, and we - # assume the GNU/Linux dynamic linker is in use. - dynamic_linker='GNU/Linux ld.so' - ;; - -netbsdelf*-gnu) - version_type=linux - need_lib_prefix=no - need_version=no - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}' - soname_spec='${libname}${release}${shared_ext}$major' - shlibpath_var=LD_LIBRARY_PATH - shlibpath_overrides_runpath=no - hardcode_into_libs=yes - dynamic_linker='NetBSD ld.elf_so' - ;; - -netbsd*) - version_type=sunos - need_lib_prefix=no - need_version=no - if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then - library_names_spec='$libname$release$shared_ext$versuffix $libname$shared_ext$versuffix' - finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir' - dynamic_linker='NetBSD (a.out) ld.so' - else - library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' - soname_spec='$libname$release$shared_ext$major' - dynamic_linker='NetBSD ld.elf_so' - fi - shlibpath_var=LD_LIBRARY_PATH - shlibpath_overrides_runpath=yes - hardcode_into_libs=yes - ;; - -newsos6) - version_type=linux # correct to gnu/linux during the next big refactor - library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' - shlibpath_var=LD_LIBRARY_PATH - shlibpath_overrides_runpath=yes - ;; - -*nto* | *qnx*) - version_type=qnx - need_lib_prefix=no - need_version=no - library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' - soname_spec='$libname$release$shared_ext$major' - shlibpath_var=LD_LIBRARY_PATH - shlibpath_overrides_runpath=no - hardcode_into_libs=yes - dynamic_linker='ldqnx.so' - ;; - -openbsd* | bitrig*) - version_type=sunos - sys_lib_dlsearch_path_spec=/usr/lib - need_lib_prefix=no - if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`"; then - need_version=no - else - need_version=yes - fi - library_names_spec='$libname$release$shared_ext$versuffix $libname$shared_ext$versuffix' - finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir' - shlibpath_var=LD_LIBRARY_PATH - shlibpath_overrides_runpath=yes - ;; - -os2*) - libname_spec='$name' - version_type=windows - shrext_cmds=.dll - need_version=no - need_lib_prefix=no - # OS/2 can only load a DLL with a base name of 8 characters or less. - soname_spec='`test -n "$os2dllname" && libname="$os2dllname"; - v=$($ECHO $release$versuffix | tr -d .-); - n=$($ECHO $libname | cut -b -$((8 - ${#v})) | tr . _); - $ECHO $n$v`$shared_ext' - library_names_spec='${libname}_dll.$libext' - dynamic_linker='OS/2 ld.exe' - shlibpath_var=BEGINLIBPATH - sys_lib_search_path_spec="/lib /usr/lib /usr/local/lib" - sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec - postinstall_cmds='base_file=`basename \$file`~ - dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\$base_file'\''i; $ECHO \$dlname'\''`~ - dldir=$destdir/`dirname \$dlpath`~ - test -d \$dldir || mkdir -p \$dldir~ - $install_prog $dir/$dlname \$dldir/$dlname~ - chmod a+x \$dldir/$dlname~ - if test -n '\''$stripme'\'' && test -n '\''$striplib'\''; then - eval '\''$striplib \$dldir/$dlname'\'' || exit \$?; - fi' - postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; $ECHO \$dlname'\''`~ - dlpath=$dir/\$dldll~ - $RM \$dlpath' - ;; - -osf3* | osf4* | osf5*) - version_type=osf - need_lib_prefix=no - need_version=no - soname_spec='$libname$release$shared_ext$major' - library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' - shlibpath_var=LD_LIBRARY_PATH - sys_lib_search_path_spec="/usr/shlib /usr/ccs/lib /usr/lib/cmplrs/cc /usr/lib /usr/local/lib /var/shlib" - sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec - ;; - -rdos*) - dynamic_linker=no - ;; - -solaris*) - version_type=linux # correct to gnu/linux during the next big refactor - need_lib_prefix=no - need_version=no - library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' - soname_spec='$libname$release$shared_ext$major' - shlibpath_var=LD_LIBRARY_PATH - shlibpath_overrides_runpath=yes - hardcode_into_libs=yes - # ldd complains unless libraries are executable - postinstall_cmds='chmod +x $lib' - ;; - -sunos4*) - version_type=sunos - library_names_spec='$libname$release$shared_ext$versuffix $libname$shared_ext$versuffix' - finish_cmds='PATH="\$PATH:/usr/etc" ldconfig $libdir' - shlibpath_var=LD_LIBRARY_PATH - shlibpath_overrides_runpath=yes - if test yes = "$with_gnu_ld"; then - need_lib_prefix=no - fi - need_version=yes - ;; - -sysv4 | sysv4.3*) - version_type=linux # correct to gnu/linux during the next big refactor - library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' - soname_spec='$libname$release$shared_ext$major' - shlibpath_var=LD_LIBRARY_PATH - case $host_vendor in - sni) - shlibpath_overrides_runpath=no - need_lib_prefix=no - runpath_var=LD_RUN_PATH - ;; - siemens) - need_lib_prefix=no - ;; - motorola) - need_lib_prefix=no - need_version=no - shlibpath_overrides_runpath=no - sys_lib_search_path_spec='/lib /usr/lib /usr/ccs/lib' - ;; - esac - ;; - -sysv4*MP*) - if test -d /usr/nec; then - version_type=linux # correct to gnu/linux during the next big refactor - library_names_spec='$libname$shared_ext.$versuffix $libname$shared_ext.$major $libname$shared_ext' - soname_spec='$libname$shared_ext.$major' - shlibpath_var=LD_LIBRARY_PATH - fi - ;; - -sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*) - version_type=sco - need_lib_prefix=no - need_version=no - library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext $libname$shared_ext' - soname_spec='$libname$release$shared_ext$major' - shlibpath_var=LD_LIBRARY_PATH - shlibpath_overrides_runpath=yes - hardcode_into_libs=yes - if test yes = "$with_gnu_ld"; then - sys_lib_search_path_spec='/usr/local/lib /usr/gnu/lib /usr/ccs/lib /usr/lib /lib' - else - sys_lib_search_path_spec='/usr/ccs/lib /usr/lib' - case $host_os in - sco3.2v5*) - sys_lib_search_path_spec="$sys_lib_search_path_spec /lib" - ;; - esac - fi - sys_lib_dlsearch_path_spec='/usr/lib' - ;; - -tpf*) - # TPF is a cross-target only. Preferred cross-host = GNU/Linux. - version_type=linux # correct to gnu/linux during the next big refactor - need_lib_prefix=no - need_version=no - library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' - shlibpath_var=LD_LIBRARY_PATH - shlibpath_overrides_runpath=no - hardcode_into_libs=yes - ;; - -uts4*) - version_type=linux # correct to gnu/linux during the next big refactor - library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' - soname_spec='$libname$release$shared_ext$major' - shlibpath_var=LD_LIBRARY_PATH - ;; - -*) - dynamic_linker=no - ;; -esac -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $dynamic_linker" >&5 -printf "%s\n" "$dynamic_linker" >&6; } -test no = "$dynamic_linker" && can_build_shared=no - -variables_saved_for_relink="PATH $shlibpath_var $runpath_var" -if test yes = "$GCC"; then - variables_saved_for_relink="$variables_saved_for_relink GCC_EXEC_PREFIX COMPILER_PATH LIBRARY_PATH" -fi - -if test set = "${lt_cv_sys_lib_search_path_spec+set}"; then - sys_lib_search_path_spec=$lt_cv_sys_lib_search_path_spec -fi - -if test set = "${lt_cv_sys_lib_dlsearch_path_spec+set}"; then - sys_lib_dlsearch_path_spec=$lt_cv_sys_lib_dlsearch_path_spec -fi - -# remember unaugmented sys_lib_dlsearch_path content for libtool script decls... -configure_time_dlsearch_path=$sys_lib_dlsearch_path_spec - -# ... but it needs LT_SYS_LIBRARY_PATH munging for other configure-time code -func_munge_path_list sys_lib_dlsearch_path_spec "$LT_SYS_LIBRARY_PATH" - -# to be used as default LT_SYS_LIBRARY_PATH value in generated libtool -configure_time_lt_sys_library_path=$LT_SYS_LIBRARY_PATH - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking how to hardcode library paths into programs" >&5 -printf %s "checking how to hardcode library paths into programs... " >&6; } -hardcode_action_CXX= -if test -n "$hardcode_libdir_flag_spec_CXX" || - test -n "$runpath_var_CXX" || - test yes = "$hardcode_automatic_CXX"; then - - # We can hardcode non-existent directories. - if test no != "$hardcode_direct_CXX" && - # If the only mechanism to avoid hardcoding is shlibpath_var, we - # have to relink, otherwise we might link with an installed library - # when we should be linking with a yet-to-be-installed one - ## test no != "$_LT_TAGVAR(hardcode_shlibpath_var, CXX)" && - test no != "$hardcode_minus_L_CXX"; then - # Linking always hardcodes the temporary library directory. - hardcode_action_CXX=relink - else - # We can link without hardcoding, and we can hardcode nonexisting dirs. - hardcode_action_CXX=immediate - fi -else - # We cannot hardcode anything, or else we can only hardcode existing - # directories. - hardcode_action_CXX=unsupported -fi -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $hardcode_action_CXX" >&5 -printf "%s\n" "$hardcode_action_CXX" >&6; } - -if test relink = "$hardcode_action_CXX" || - test yes = "$inherit_rpath_CXX"; then - # Fast installation is not supported - enable_fast_install=no -elif test yes = "$shlibpath_overrides_runpath" || - test no = "$enable_shared"; then - # Fast installation is not necessary - enable_fast_install=needless -fi - - - - - - - - fi # test -n "$compiler" - - CC=$lt_save_CC - CFLAGS=$lt_save_CFLAGS - LDCXX=$LD - LD=$lt_save_LD - GCC=$lt_save_GCC - with_gnu_ld=$lt_save_with_gnu_ld - lt_cv_path_LDCXX=$lt_cv_path_LD - lt_cv_path_LD=$lt_save_path_LD - lt_cv_prog_gnu_ldcxx=$lt_cv_prog_gnu_ld - lt_cv_prog_gnu_ld=$lt_save_with_gnu_ld -fi # test yes != "$_lt_caught_CXX_error" - -ac_ext=cpp -ac_cpp='$CXXCPP $CPPFLAGS' -ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' -ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' -ac_compiler_gnu=$ac_cv_cxx_compiler_gnu - - - - - - - - - - - - - - - - ac_config_commands="$ac_config_commands libtool" - - - - -# Only expand once: - - - -# Check whether the linker supports version scripts -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether the linker supports version scripts" >&5 -printf %s "checking whether the linker supports version scripts... " >&6; } -save_LDFLAGS=$LDFLAGS -LDFLAGS="$LDFLAGS -Wl,--version-script=conftest.map" -cat > conftest.map <conftest.$ac_ext -/* end confdefs.h. */ -int main() { return 0; } -_ACEOF -if ac_fn_cxx_try_link "$LINENO" -then : - have_ld_version_script=yes; { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -printf "%s\n" "yes" >&6; } -else $as_nop - have_ld_version_script=no; { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 -printf "%s\n" "no" >&6; } -fi -rm -f core conftest.err conftest.$ac_objext conftest.beam \ - conftest$ac_exeext conftest.$ac_ext -LDFLAGS=$save_LDFLAGS - if test "$have_ld_version_script" = "yes"; then - HAVE_LD_VERSION_SCRIPT_TRUE= - HAVE_LD_VERSION_SCRIPT_FALSE='#' -else - HAVE_LD_VERSION_SCRIPT_TRUE='#' - HAVE_LD_VERSION_SCRIPT_FALSE= -fi - - -# Checks for header files. -# Autoupdate added the next two lines to ensure that your configure -# script's behavior did not change. They are probably safe to remove. - -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for egrep" >&5 -printf %s "checking for egrep... " >&6; } -if test ${ac_cv_path_EGREP+y} -then : - printf %s "(cached) " >&6 -else $as_nop - if echo a | $GREP -E '(a|b)' >/dev/null 2>&1 - then ac_cv_path_EGREP="$GREP -E" - else - if test -z "$EGREP"; then - ac_path_EGREP_found=false - # Loop through the user's path and test for each of PROGNAME-LIST - as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin -do - IFS=$as_save_IFS - case $as_dir in #((( - '') as_dir=./ ;; - */) ;; - *) as_dir=$as_dir/ ;; - esac - for ac_prog in egrep - do - for ac_exec_ext in '' $ac_executable_extensions; do - ac_path_EGREP="$as_dir$ac_prog$ac_exec_ext" - as_fn_executable_p "$ac_path_EGREP" || continue -# Check for GNU ac_path_EGREP and select it if it is found. - # Check for GNU $ac_path_EGREP -case `"$ac_path_EGREP" --version 2>&1` in -*GNU*) - ac_cv_path_EGREP="$ac_path_EGREP" ac_path_EGREP_found=:;; -*) - ac_count=0 - printf %s 0123456789 >"conftest.in" - while : - do - cat "conftest.in" "conftest.in" >"conftest.tmp" - mv "conftest.tmp" "conftest.in" - cp "conftest.in" "conftest.nl" - printf "%s\n" 'EGREP' >> "conftest.nl" - "$ac_path_EGREP" 'EGREP$' < "conftest.nl" >"conftest.out" 2>/dev/null || break - diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break - as_fn_arith $ac_count + 1 && ac_count=$as_val - if test $ac_count -gt ${ac_path_EGREP_max-0}; then - # Best one so far, save it but keep looking for a better one - ac_cv_path_EGREP="$ac_path_EGREP" - ac_path_EGREP_max=$ac_count - fi - # 10*(2^10) chars as input seems more than enough - test $ac_count -gt 10 && break - done - rm -f conftest.in conftest.tmp conftest.nl conftest.out;; -esac - - $ac_path_EGREP_found && break 3 - done - done - done -IFS=$as_save_IFS - if test -z "$ac_cv_path_EGREP"; then - as_fn_error $? "no acceptable egrep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" "$LINENO" 5 - fi -else - ac_cv_path_EGREP=$EGREP -fi - - fi -fi -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_EGREP" >&5 -printf "%s\n" "$ac_cv_path_EGREP" >&6; } - EGREP="$ac_cv_path_EGREP" - - - -ac_fn_cxx_check_header_compile "$LINENO" "fcntl.h" "ac_cv_header_fcntl_h" "$ac_includes_default" -if test "x$ac_cv_header_fcntl_h" = xyes -then : - printf "%s\n" "#define HAVE_FCNTL_H 1" >>confdefs.h - -fi -ac_fn_cxx_check_header_compile "$LINENO" "inttypes.h" "ac_cv_header_inttypes_h" "$ac_includes_default" -if test "x$ac_cv_header_inttypes_h" = xyes -then : - printf "%s\n" "#define HAVE_INTTYPES_H 1" >>confdefs.h - -fi -ac_fn_cxx_check_header_compile "$LINENO" "limits.h" "ac_cv_header_limits_h" "$ac_includes_default" -if test "x$ac_cv_header_limits_h" = xyes -then : - printf "%s\n" "#define HAVE_LIMITS_H 1" >>confdefs.h - -fi -ac_fn_cxx_check_header_compile "$LINENO" "stdlib.h" "ac_cv_header_stdlib_h" "$ac_includes_default" -if test "x$ac_cv_header_stdlib_h" = xyes -then : - printf "%s\n" "#define HAVE_STDLIB_H 1" >>confdefs.h - -fi -ac_fn_cxx_check_header_compile "$LINENO" "unistd.h" "ac_cv_header_unistd_h" "$ac_includes_default" -if test "x$ac_cv_header_unistd_h" = xyes -then : - printf "%s\n" "#define HAVE_UNISTD_H 1" >>confdefs.h - -fi - - -# Checks for library functions. -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for working memcmp" >&5 -printf %s "checking for working memcmp... " >&6; } -if test ${ac_cv_func_memcmp_working+y} -then : - printf %s "(cached) " >&6 -else $as_nop - if test "$cross_compiling" = yes -then : - ac_cv_func_memcmp_working=no -else $as_nop - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -$ac_includes_default -int -main (void) -{ - - /* Some versions of memcmp are not 8-bit clean. */ - char c0 = '\100', c1 = '\200', c2 = '\201'; - if (memcmp(&c0, &c2, 1) >= 0 || memcmp(&c1, &c2, 1) >= 0) - return 1; - - /* The Next x86 OpenStep bug shows up only when comparing 16 bytes - or more and with at least one buffer not starting on a 4-byte boundary. - William Lewis provided this test program. */ - { - char foo[21]; - char bar[21]; - int i; - for (i = 0; i < 4; i++) - { - char *a = foo + i; - char *b = bar + i; - strcpy (a, "--------01111111"); - strcpy (b, "--------10000000"); - if (memcmp (a, b, 16) >= 0) - return 1; - } - return 0; - } - - ; - return 0; -} -_ACEOF -if ac_fn_cxx_try_run "$LINENO" -then : - ac_cv_func_memcmp_working=yes -else $as_nop - ac_cv_func_memcmp_working=no -fi -rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ - conftest.$ac_objext conftest.beam conftest.$ac_ext -fi - -fi -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_func_memcmp_working" >&5 -printf "%s\n" "$ac_cv_func_memcmp_working" >&6; } -test $ac_cv_func_memcmp_working = no && case " $LIBOBJS " in - *" memcmp.$ac_objext "* ) ;; - *) LIBOBJS="$LIBOBJS memcmp.$ac_objext" - ;; -esac - - -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for working strtod" >&5 -printf %s "checking for working strtod... " >&6; } -if test ${ac_cv_func_strtod+y} -then : - printf %s "(cached) " >&6 -else $as_nop - if test "$cross_compiling" = yes -then : - ac_cv_func_strtod=no -else $as_nop - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - -$ac_includes_default -#ifndef strtod -double strtod (); -#endif -int -main (void) -{ - { - /* Some versions of Linux strtod mis-parse strings with leading '+'. */ - char *string = " +69"; - char *term; - double value; - value = strtod (string, &term); - if (value != 69 || term != (string + 4)) - return 1; - } - - { - /* Under Solaris 2.4, strtod returns the wrong value for the - terminating character under some conditions. */ - char *string = "NaN"; - char *term; - strtod (string, &term); - if (term != string && *(term - 1) == 0) - return 1; - } - return 0; -} - -_ACEOF -if ac_fn_cxx_try_run "$LINENO" -then : - ac_cv_func_strtod=yes -else $as_nop - ac_cv_func_strtod=no -fi -rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ - conftest.$ac_objext conftest.beam conftest.$ac_ext -fi - -fi -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_func_strtod" >&5 -printf "%s\n" "$ac_cv_func_strtod" >&6; } -if test $ac_cv_func_strtod = no; then - case " $LIBOBJS " in - *" strtod.$ac_objext "* ) ;; - *) LIBOBJS="$LIBOBJS strtod.$ac_objext" - ;; -esac - -ac_fn_cxx_check_func "$LINENO" "pow" "ac_cv_func_pow" -if test "x$ac_cv_func_pow" = xyes -then : - -fi - -if test $ac_cv_func_pow = no; then - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for pow in -lm" >&5 -printf %s "checking for pow in -lm... " >&6; } -if test ${ac_cv_lib_m_pow+y} -then : - printf %s "(cached) " >&6 -else $as_nop - ac_check_lib_save_LIBS=$LIBS -LIBS="-lm $LIBS" -cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - -namespace conftest { - extern "C" int pow (); -} -int -main (void) -{ -return conftest::pow (); - ; - return 0; -} -_ACEOF -if ac_fn_cxx_try_link "$LINENO" -then : - ac_cv_lib_m_pow=yes -else $as_nop - ac_cv_lib_m_pow=no -fi -rm -f core conftest.err conftest.$ac_objext conftest.beam \ - conftest$ac_exeext conftest.$ac_ext -LIBS=$ac_check_lib_save_LIBS -fi -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_m_pow" >&5 -printf "%s\n" "$ac_cv_lib_m_pow" >&6; } -if test "x$ac_cv_lib_m_pow" = xyes -then : - POW_LIB=-lm -else $as_nop - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: cannot find library containing definition of pow" >&5 -printf "%s\n" "$as_me: WARNING: cannot find library containing definition of pow" >&2;} -fi - -fi - -fi - -ac_fn_cxx_check_func "$LINENO" "ftruncate" "ac_cv_func_ftruncate" -if test "x$ac_cv_func_ftruncate" = xyes -then : - printf "%s\n" "#define HAVE_FTRUNCATE 1" >>confdefs.h - -fi -ac_fn_cxx_check_func "$LINENO" "memset" "ac_cv_func_memset" -if test "x$ac_cv_func_memset" = xyes -then : - printf "%s\n" "#define HAVE_MEMSET 1" >>confdefs.h - -fi -ac_fn_cxx_check_func "$LINENO" "mkdir" "ac_cv_func_mkdir" -if test "x$ac_cv_func_mkdir" = xyes -then : - printf "%s\n" "#define HAVE_MKDIR 1" >>confdefs.h - -fi -ac_fn_cxx_check_func "$LINENO" "strchr" "ac_cv_func_strchr" -if test "x$ac_cv_func_strchr" = xyes -then : - printf "%s\n" "#define HAVE_STRCHR 1" >>confdefs.h - -fi -ac_fn_cxx_check_func "$LINENO" "strerror" "ac_cv_func_strerror" -if test "x$ac_cv_func_strerror" = xyes -then : - printf "%s\n" "#define HAVE_STRERROR 1" >>confdefs.h - -fi -ac_fn_cxx_check_func "$LINENO" "strtol" "ac_cv_func_strtol" -if test "x$ac_cv_func_strtol" = xyes -then : - printf "%s\n" "#define HAVE_STRTOL 1" >>confdefs.h - -fi - - -# Check for zlib. -HAVE_ZLIB=0 -if test "$with_zlib" != no -then : - - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking zlib version" >&5 -printf %s "checking zlib version... " >&6; } - - # First check the zlib header version. - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - - #include - #if !defined(ZLIB_VERNUM) || (ZLIB_VERNUM < 0x1204) - # error zlib version too old - #endif - -int -main (void) -{ - - ; - return 0; -} -_ACEOF -if ac_fn_cxx_try_compile "$LINENO" -then : - - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: ok (1.2.0.4 or later)" >&5 -printf "%s\n" "ok (1.2.0.4 or later)" >&6; } - - # Also need to add -lz to the linker flags and make sure this succeeds. - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for library containing zlibVersion" >&5 -printf %s "checking for library containing zlibVersion... " >&6; } -if test ${ac_cv_search_zlibVersion+y} -then : - printf %s "(cached) " >&6 -else $as_nop - ac_func_search_save_LIBS=$LIBS -cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - -namespace conftest { - extern "C" int zlibVersion (); -} -int -main (void) -{ -return conftest::zlibVersion (); - ; - return 0; -} -_ACEOF -for ac_lib in '' z -do - if test -z "$ac_lib"; then - ac_res="none required" - else - ac_res=-l$ac_lib - LIBS="-l$ac_lib $ac_func_search_save_LIBS" - fi - if ac_fn_cxx_try_link "$LINENO" -then : - ac_cv_search_zlibVersion=$ac_res -fi -rm -f core conftest.err conftest.$ac_objext conftest.beam \ - conftest$ac_exeext - if test ${ac_cv_search_zlibVersion+y} -then : - break -fi -done -if test ${ac_cv_search_zlibVersion+y} -then : - -else $as_nop - ac_cv_search_zlibVersion=no -fi -rm conftest.$ac_ext -LIBS=$ac_func_search_save_LIBS -fi -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_search_zlibVersion" >&5 -printf "%s\n" "$ac_cv_search_zlibVersion" >&6; } -ac_res=$ac_cv_search_zlibVersion -if test "$ac_res" != no -then : - test "$ac_res" = "none required" || LIBS="$ac_res $LIBS" - - -printf "%s\n" "#define HAVE_ZLIB 1" >>confdefs.h - - HAVE_ZLIB=1 - -else $as_nop - - if test "$with_zlib" != check -then : - - { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 -printf "%s\n" "$as_me: error: in \`$ac_pwd':" >&2;} -as_fn_error $? "--with-zlib was given, but no working zlib library was found -See \`config.log' for more details" "$LINENO" 5; } - -fi - -fi - - -else $as_nop - - if test "$with_zlib" = check -then : - - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: headers missing or too old (requires 1.2.0.4)" >&5 -printf "%s\n" "headers missing or too old (requires 1.2.0.4)" >&6; } - -else $as_nop - - { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 -printf "%s\n" "$as_me: error: in \`$ac_pwd':" >&2;} -as_fn_error $? "--with-zlib was given, but zlib headers were not present or were too old (requires 1.2.0.4) -See \`config.log' for more details" "$LINENO" 5; } - -fi - -fi -rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext - -fi - if test $HAVE_ZLIB = 1; then - HAVE_ZLIB_TRUE= - HAVE_ZLIB_FALSE='#' -else - HAVE_ZLIB_TRUE='#' - HAVE_ZLIB_FALSE= -fi - - -# Add -std=c++11 if necesssary. It is important for us to do this before the -# libatomic check below, since that also depends on C++11. - ax_cxx_compile_alternatives="11 0x" ax_cxx_compile_cxx11_required=true - ac_ext=cpp -ac_cpp='$CXXCPP $CPPFLAGS' -ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' -ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' -ac_compiler_gnu=$ac_cv_cxx_compiler_gnu - ac_success=no - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether $CXX supports C++11 features by default" >&5 -printf %s "checking whether $CXX supports C++11 features by default... " >&6; } -if test ${ax_cv_cxx_compile_cxx11+y} -then : - printf %s "(cached) " >&6 -else $as_nop - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - - -// If the compiler admits that it is not ready for C++11, why torture it? -// Hopefully, this will speed up the test. - -#ifndef __cplusplus - -#error "This is not a C++ compiler" - -#elif __cplusplus < 201103L - -#error "This is not a C++11 compiler" - -#else - -#include - -namespace cxx11 -{ - - namespace test_static_assert - { - - template - struct check - { - static_assert(sizeof(int) <= sizeof(T), "not big enough"); - }; - - } - - namespace test_final_override - { - - struct Base - { - virtual void f() {} - }; - - struct Derived : public Base - { - virtual void f() override {} - }; - - } - - namespace test_double_right_angle_brackets - { - - template < typename T > - struct check {}; - - typedef check single_type; - typedef check> double_type; - typedef check>> triple_type; - typedef check>>> quadruple_type; - - } - - namespace test_decltype - { - - int - f() - { - int a = 1; - decltype(a) b = 2; - return a + b; - } - - } - - namespace test_type_deduction - { - - template < typename T1, typename T2 > - struct is_same - { - static const bool value = false; - }; - - template < typename T > - struct is_same - { - static const bool value = true; - }; - - template < typename T1, typename T2 > - auto - add(T1 a1, T2 a2) -> decltype(a1 + a2) - { - return a1 + a2; - } - - int - test(const int c, volatile int v) - { - static_assert(is_same::value == true, ""); - static_assert(is_same::value == false, ""); - static_assert(is_same::value == false, ""); - auto ac = c; - auto av = v; - auto sumi = ac + av + 'x'; - auto sumf = ac + av + 1.0; - static_assert(is_same::value == true, ""); - static_assert(is_same::value == true, ""); - static_assert(is_same::value == true, ""); - static_assert(is_same::value == false, ""); - static_assert(is_same::value == true, ""); - return (sumf > 0.0) ? sumi : add(c, v); - } - - } - - namespace test_noexcept - { - - int f() { return 0; } - int g() noexcept { return 0; } - - static_assert(noexcept(f()) == false, ""); - static_assert(noexcept(g()) == true, ""); - - } - - namespace test_constexpr - { - - template < typename CharT > - unsigned long constexpr - strlen_c_r(const CharT *const s, const unsigned long acc) noexcept - { - return *s ? strlen_c_r(s + 1, acc + 1) : acc; - } - - template < typename CharT > - unsigned long constexpr - strlen_c(const CharT *const s) noexcept - { - return strlen_c_r(s, 0UL); - } - - static_assert(strlen_c("") == 0UL, ""); - static_assert(strlen_c("1") == 1UL, ""); - static_assert(strlen_c("example") == 7UL, ""); - static_assert(strlen_c("another\0example") == 7UL, ""); - - } - - namespace test_rvalue_references - { - - template < int N > - struct answer - { - static constexpr int value = N; - }; - - answer<1> f(int&) { return answer<1>(); } - answer<2> f(const int&) { return answer<2>(); } - answer<3> f(int&&) { return answer<3>(); } - - void - test() - { - int i = 0; - const int c = 0; - static_assert(decltype(f(i))::value == 1, ""); - static_assert(decltype(f(c))::value == 2, ""); - static_assert(decltype(f(0))::value == 3, ""); - } - - } - - namespace test_uniform_initialization - { - - struct test - { - static const int zero {}; - static const int one {1}; - }; - - static_assert(test::zero == 0, ""); - static_assert(test::one == 1, ""); - - } - - namespace test_lambdas - { - - void - test1() - { - auto lambda1 = [](){}; - auto lambda2 = lambda1; - lambda1(); - lambda2(); - } - - int - test2() - { - auto a = [](int i, int j){ return i + j; }(1, 2); - auto b = []() -> int { return '0'; }(); - auto c = [=](){ return a + b; }(); - auto d = [&](){ return c; }(); - auto e = [a, &b](int x) mutable { - const auto identity = [](int y){ return y; }; - for (auto i = 0; i < a; ++i) - a += b--; - return x + identity(a + b); - }(0); - return a + b + c + d + e; - } - - int - test3() - { - const auto nullary = [](){ return 0; }; - const auto unary = [](int x){ return x; }; - using nullary_t = decltype(nullary); - using unary_t = decltype(unary); - const auto higher1st = [](nullary_t f){ return f(); }; - const auto higher2nd = [unary](nullary_t f1){ - return [unary, f1](unary_t f2){ return f2(unary(f1())); }; - }; - return higher1st(nullary) + higher2nd(nullary)(unary); - } - - } - - namespace test_variadic_templates - { - - template - struct sum; - - template - struct sum - { - static constexpr auto value = N0 + sum::value; - }; - - template <> - struct sum<> - { - static constexpr auto value = 0; - }; - - static_assert(sum<>::value == 0, ""); - static_assert(sum<1>::value == 1, ""); - static_assert(sum<23>::value == 23, ""); - static_assert(sum<1, 2>::value == 3, ""); - static_assert(sum<5, 5, 11>::value == 21, ""); - static_assert(sum<2, 3, 5, 7, 11, 13>::value == 41, ""); - - } - - // http://stackoverflow.com/questions/13728184/template-aliases-and-sfinae - // Clang 3.1 fails with headers of libstd++ 4.8.3 when using std::function - // because of this. - namespace test_template_alias_sfinae - { - - struct foo {}; - - template - using member = typename T::member_type; - - template - void func(...) {} - - template - void func(member*) {} - - void test(); - - void test() { func(0); } - - } - - namespace test_std_move_and_forward - { - struct message {}; - char foo(message&) { return '\0'; } - int foo(message&&) { return 0; } - - template - void check(Arg&& arg, RT rt) { - static_assert(sizeof(rt) == sizeof(foo(std::forward(arg))), ""); - } - void test() { - message a; - check(a, char()); - check(std::move(a), int()); - } - } - -} // namespace cxx11 - -#endif // __cplusplus >= 201103L - - - -_ACEOF -if ac_fn_cxx_try_compile "$LINENO" -then : - ax_cv_cxx_compile_cxx11=yes -else $as_nop - ax_cv_cxx_compile_cxx11=no -fi -rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext -fi -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ax_cv_cxx_compile_cxx11" >&5 -printf "%s\n" "$ax_cv_cxx_compile_cxx11" >&6; } - if test x$ax_cv_cxx_compile_cxx11 = xyes; then - ac_success=yes - fi - - - - if test x$ac_success = xno; then - for alternative in ${ax_cxx_compile_alternatives}; do - for switch in -std=c++${alternative} +std=c++${alternative} "-h std=c++${alternative}"; do - cachevar=`printf "%s\n" "ax_cv_cxx_compile_cxx11_$switch" | $as_tr_sh` - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether $CXX supports C++11 features with $switch" >&5 -printf %s "checking whether $CXX supports C++11 features with $switch... " >&6; } -if eval test \${$cachevar+y} -then : - printf %s "(cached) " >&6 -else $as_nop - ac_save_CXX="$CXX" - CXX="$CXX $switch" - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - - -// If the compiler admits that it is not ready for C++11, why torture it? -// Hopefully, this will speed up the test. - -#ifndef __cplusplus - -#error "This is not a C++ compiler" - -#elif __cplusplus < 201103L - -#error "This is not a C++11 compiler" - -#else - -#include - -namespace cxx11 -{ - - namespace test_static_assert - { - - template - struct check - { - static_assert(sizeof(int) <= sizeof(T), "not big enough"); - }; - - } - - namespace test_final_override - { - - struct Base - { - virtual void f() {} - }; - - struct Derived : public Base - { - virtual void f() override {} - }; - - } - - namespace test_double_right_angle_brackets - { - - template < typename T > - struct check {}; - - typedef check single_type; - typedef check> double_type; - typedef check>> triple_type; - typedef check>>> quadruple_type; - - } - - namespace test_decltype - { - - int - f() - { - int a = 1; - decltype(a) b = 2; - return a + b; - } - - } - - namespace test_type_deduction - { - - template < typename T1, typename T2 > - struct is_same - { - static const bool value = false; - }; - - template < typename T > - struct is_same - { - static const bool value = true; - }; - - template < typename T1, typename T2 > - auto - add(T1 a1, T2 a2) -> decltype(a1 + a2) - { - return a1 + a2; - } - - int - test(const int c, volatile int v) - { - static_assert(is_same::value == true, ""); - static_assert(is_same::value == false, ""); - static_assert(is_same::value == false, ""); - auto ac = c; - auto av = v; - auto sumi = ac + av + 'x'; - auto sumf = ac + av + 1.0; - static_assert(is_same::value == true, ""); - static_assert(is_same::value == true, ""); - static_assert(is_same::value == true, ""); - static_assert(is_same::value == false, ""); - static_assert(is_same::value == true, ""); - return (sumf > 0.0) ? sumi : add(c, v); - } - - } - - namespace test_noexcept - { - - int f() { return 0; } - int g() noexcept { return 0; } - - static_assert(noexcept(f()) == false, ""); - static_assert(noexcept(g()) == true, ""); - - } - - namespace test_constexpr - { - - template < typename CharT > - unsigned long constexpr - strlen_c_r(const CharT *const s, const unsigned long acc) noexcept - { - return *s ? strlen_c_r(s + 1, acc + 1) : acc; - } - - template < typename CharT > - unsigned long constexpr - strlen_c(const CharT *const s) noexcept - { - return strlen_c_r(s, 0UL); - } - - static_assert(strlen_c("") == 0UL, ""); - static_assert(strlen_c("1") == 1UL, ""); - static_assert(strlen_c("example") == 7UL, ""); - static_assert(strlen_c("another\0example") == 7UL, ""); - - } - - namespace test_rvalue_references - { - - template < int N > - struct answer - { - static constexpr int value = N; - }; - - answer<1> f(int&) { return answer<1>(); } - answer<2> f(const int&) { return answer<2>(); } - answer<3> f(int&&) { return answer<3>(); } - - void - test() - { - int i = 0; - const int c = 0; - static_assert(decltype(f(i))::value == 1, ""); - static_assert(decltype(f(c))::value == 2, ""); - static_assert(decltype(f(0))::value == 3, ""); - } - - } - - namespace test_uniform_initialization - { - - struct test - { - static const int zero {}; - static const int one {1}; - }; - - static_assert(test::zero == 0, ""); - static_assert(test::one == 1, ""); - - } - - namespace test_lambdas - { - - void - test1() - { - auto lambda1 = [](){}; - auto lambda2 = lambda1; - lambda1(); - lambda2(); - } - - int - test2() - { - auto a = [](int i, int j){ return i + j; }(1, 2); - auto b = []() -> int { return '0'; }(); - auto c = [=](){ return a + b; }(); - auto d = [&](){ return c; }(); - auto e = [a, &b](int x) mutable { - const auto identity = [](int y){ return y; }; - for (auto i = 0; i < a; ++i) - a += b--; - return x + identity(a + b); - }(0); - return a + b + c + d + e; - } - - int - test3() - { - const auto nullary = [](){ return 0; }; - const auto unary = [](int x){ return x; }; - using nullary_t = decltype(nullary); - using unary_t = decltype(unary); - const auto higher1st = [](nullary_t f){ return f(); }; - const auto higher2nd = [unary](nullary_t f1){ - return [unary, f1](unary_t f2){ return f2(unary(f1())); }; - }; - return higher1st(nullary) + higher2nd(nullary)(unary); - } - - } - - namespace test_variadic_templates - { - - template - struct sum; - - template - struct sum - { - static constexpr auto value = N0 + sum::value; - }; - - template <> - struct sum<> - { - static constexpr auto value = 0; - }; - - static_assert(sum<>::value == 0, ""); - static_assert(sum<1>::value == 1, ""); - static_assert(sum<23>::value == 23, ""); - static_assert(sum<1, 2>::value == 3, ""); - static_assert(sum<5, 5, 11>::value == 21, ""); - static_assert(sum<2, 3, 5, 7, 11, 13>::value == 41, ""); - - } - - // http://stackoverflow.com/questions/13728184/template-aliases-and-sfinae - // Clang 3.1 fails with headers of libstd++ 4.8.3 when using std::function - // because of this. - namespace test_template_alias_sfinae - { - - struct foo {}; - - template - using member = typename T::member_type; - - template - void func(...) {} - - template - void func(member*) {} - - void test(); - - void test() { func(0); } - - } - - namespace test_std_move_and_forward - { - struct message {}; - char foo(message&) { return '\0'; } - int foo(message&&) { return 0; } - - template - void check(Arg&& arg, RT rt) { - static_assert(sizeof(rt) == sizeof(foo(std::forward(arg))), ""); - } - void test() { - message a; - check(a, char()); - check(std::move(a), int()); - } - } - -} // namespace cxx11 - -#endif // __cplusplus >= 201103L - - - -_ACEOF -if ac_fn_cxx_try_compile "$LINENO" -then : - eval $cachevar=yes -else $as_nop - eval $cachevar=no -fi -rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext - CXX="$ac_save_CXX" -fi -eval ac_res=\$$cachevar - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 -printf "%s\n" "$ac_res" >&6; } - if eval test x\$$cachevar = xyes; then - CXX="$CXX $switch" - if test -n "$CXXCPP" ; then - CXXCPP="$CXXCPP $switch" - fi - ac_success=yes - break - fi - done - if test x$ac_success = xyes; then - break - fi - done - fi - ac_ext=cpp -ac_cpp='$CXXCPP $CPPFLAGS' -ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' -ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' -ac_compiler_gnu=$ac_cv_cxx_compiler_gnu - - if test x$ax_cxx_compile_cxx11_required = xtrue; then - if test x$ac_success = xno; then - as_fn_error $? "*** A compiler with support for C++11 language features is required." "$LINENO" 5 - fi - fi - if test x$ac_success = xno; then - HAVE_CXX11=0 - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: No compiler with C++11 support was found" >&5 -printf "%s\n" "$as_me: No compiler with C++11 support was found" >&6;} - else - HAVE_CXX11=1 - -printf "%s\n" "#define HAVE_CXX11 1" >>confdefs.h - - fi - - - - -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether -latomic is needed" >&5 -printf %s "checking whether -latomic is needed... " >&6; } -cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - - #include - #include - std::atomic v; - int main() { - return v; - } - -_ACEOF -if ac_fn_cxx_try_link "$LINENO" -then : - STD_ATOMIC_NEED_LIBATOMIC=no -else $as_nop - STD_ATOMIC_NEED_LIBATOMIC=yes -fi -rm -f core conftest.err conftest.$ac_objext conftest.beam \ - conftest$ac_exeext conftest.$ac_ext -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $STD_ATOMIC_NEED_LIBATOMIC" >&5 -printf "%s\n" "$STD_ATOMIC_NEED_LIBATOMIC" >&6; } -if test "x$STD_ATOMIC_NEED_LIBATOMIC" = xyes; then - LIBATOMIC_LIBS="-latomic" -fi - - -if test "$with_protoc" != "no" -then : - - PROTOC=$with_protoc - if test "$with_protoc" = "yes" -then : - - # No argument given. Use system protoc. - PROTOC=protoc - -fi - if echo "$PROTOC" | grep -q '^[^/].*/' -then : - - # Does not start with a slash, but contains a slash. So, it's a relative - # path (as opposed to an absolute path or an executable in $PATH). - # Since it will actually be executed from the src directory, prefix with - # the current directory. We also insert $ac_top_build_prefix in case this - # is a nested package and --with-protoc was actually given on the outer - # package's configure script. - PROTOC=`pwd`/${ac_top_build_prefix}$PROTOC - -fi - - -fi - if test "$with_protoc" != "no"; then - USE_EXTERNAL_PROTOC_TRUE= - USE_EXTERNAL_PROTOC_FALSE='#' -else - USE_EXTERNAL_PROTOC_TRUE='#' - USE_EXTERNAL_PROTOC_FALSE= -fi - - - - - - - -ac_ext=c -ac_cpp='$CPP $CPPFLAGS' -ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' -ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' -ac_compiler_gnu=$ac_cv_c_compiler_gnu - -ax_pthread_ok=no - -# We used to check for pthread.h first, but this fails if pthread.h -# requires special compiler flags (e.g. on Tru64 or Sequent). -# It gets checked for in the link test anyway. - -# First of all, check if the user has set any of the PTHREAD_LIBS, -# etcetera environment variables, and if threads linking works using -# them: -if test "x$PTHREAD_CFLAGS$PTHREAD_LIBS" != "x"; then - ax_pthread_save_CC="$CC" - ax_pthread_save_CFLAGS="$CFLAGS" - ax_pthread_save_LIBS="$LIBS" - if test "x$PTHREAD_CC" != "x" -then : - CC="$PTHREAD_CC" -fi - CFLAGS="$CFLAGS $PTHREAD_CFLAGS" - LIBS="$PTHREAD_LIBS $LIBS" - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for pthread_join using $CC $PTHREAD_CFLAGS $PTHREAD_LIBS" >&5 -printf %s "checking for pthread_join using $CC $PTHREAD_CFLAGS $PTHREAD_LIBS... " >&6; } - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - -/* Override any GCC internal prototype to avoid an error. - Use char because int might match the return type of a GCC - builtin and then its argument prototype would still apply. */ -char pthread_join (); -int -main (void) -{ -return pthread_join (); - ; - return 0; -} -_ACEOF -if ac_fn_c_try_link "$LINENO" -then : - ax_pthread_ok=yes -fi -rm -f core conftest.err conftest.$ac_objext conftest.beam \ - conftest$ac_exeext conftest.$ac_ext - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ax_pthread_ok" >&5 -printf "%s\n" "$ax_pthread_ok" >&6; } - if test "x$ax_pthread_ok" = "xno"; then - PTHREAD_LIBS="" - PTHREAD_CFLAGS="" - fi - CC="$ax_pthread_save_CC" - CFLAGS="$ax_pthread_save_CFLAGS" - LIBS="$ax_pthread_save_LIBS" -fi - -# We must check for the threads library under a number of different -# names; the ordering is very important because some systems -# (e.g. DEC) have both -lpthread and -lpthreads, where one of the -# libraries is broken (non-POSIX). - -# Create a list of thread flags to try. Items with a "," contain both -# C compiler flags (before ",") and linker flags (after ","). Other items -# starting with a "-" are C compiler flags, and remaining items are -# library names, except for "none" which indicates that we try without -# any flags at all, and "pthread-config" which is a program returning -# the flags for the Pth emulation library. - -ax_pthread_flags="pthreads none -Kthread -pthread -pthreads -mthreads pthread --thread-safe -mt pthread-config" - -# The ordering *is* (sometimes) important. Some notes on the -# individual items follow: - -# pthreads: AIX (must check this before -lpthread) -# none: in case threads are in libc; should be tried before -Kthread and -# other compiler flags to prevent continual compiler warnings -# -Kthread: Sequent (threads in libc, but -Kthread needed for pthread.h) -# -pthread: Linux/gcc (kernel threads), BSD/gcc (userland threads), Tru64 -# (Note: HP C rejects this with "bad form for `-t' option") -# -pthreads: Solaris/gcc (Note: HP C also rejects) -# -mt: Sun Workshop C (may only link SunOS threads [-lthread], but it -# doesn't hurt to check since this sometimes defines pthreads and -# -D_REENTRANT too), HP C (must be checked before -lpthread, which -# is present but should not be used directly; and before -mthreads, -# because the compiler interprets this as "-mt" + "-hreads") -# -mthreads: Mingw32/gcc, Lynx/gcc -# pthread: Linux, etcetera -# --thread-safe: KAI C++ -# pthread-config: use pthread-config program (for GNU Pth library) - -case $host_os in - - freebsd*) - - # -kthread: FreeBSD kernel threads (preferred to -pthread since SMP-able) - # lthread: LinuxThreads port on FreeBSD (also preferred to -pthread) - - ax_pthread_flags="-kthread lthread $ax_pthread_flags" - ;; - - hpux*) - - # From the cc(1) man page: "[-mt] Sets various -D flags to enable - # multi-threading and also sets -lpthread." - - ax_pthread_flags="-mt -pthread pthread $ax_pthread_flags" - ;; - - openedition*) - - # IBM z/OS requires a feature-test macro to be defined in order to - # enable POSIX threads at all, so give the user a hint if this is - # not set. (We don't define these ourselves, as they can affect - # other portions of the system API in unpredictable ways.) - - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - -# if !defined(_OPEN_THREADS) && !defined(_UNIX03_THREADS) - AX_PTHREAD_ZOS_MISSING -# endif - -_ACEOF -if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | - $EGREP "AX_PTHREAD_ZOS_MISSING" >/dev/null 2>&1 -then : - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: IBM z/OS requires -D_OPEN_THREADS or -D_UNIX03_THREADS to enable pthreads support." >&5 -printf "%s\n" "$as_me: WARNING: IBM z/OS requires -D_OPEN_THREADS or -D_UNIX03_THREADS to enable pthreads support." >&2;} -fi -rm -rf conftest* - - ;; - - solaris*) - - # On Solaris (at least, for some versions), libc contains stubbed - # (non-functional) versions of the pthreads routines, so link-based - # tests will erroneously succeed. (N.B.: The stubs are missing - # pthread_cleanup_push, or rather a function called by this macro, - # so we could check for that, but who knows whether they'll stub - # that too in a future libc.) So we'll check first for the - # standard Solaris way of linking pthreads (-mt -lpthread). - - ax_pthread_flags="-mt,-lpthread pthread $ax_pthread_flags" - ;; -esac - -# Are we compiling with Clang? - -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether $CC is Clang" >&5 -printf %s "checking whether $CC is Clang... " >&6; } -if test ${ax_cv_PTHREAD_CLANG+y} -then : - printf %s "(cached) " >&6 -else $as_nop - ax_cv_PTHREAD_CLANG=no - # Note that Autoconf sets GCC=yes for Clang as well as GCC - if test "x$GCC" = "xyes"; then - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -/* Note: Clang 2.7 lacks __clang_[a-z]+__ */ -# if defined(__clang__) && defined(__llvm__) - AX_PTHREAD_CC_IS_CLANG -# endif - -_ACEOF -if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | - $EGREP "AX_PTHREAD_CC_IS_CLANG" >/dev/null 2>&1 -then : - ax_cv_PTHREAD_CLANG=yes -fi -rm -rf conftest* - - fi - -fi -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ax_cv_PTHREAD_CLANG" >&5 -printf "%s\n" "$ax_cv_PTHREAD_CLANG" >&6; } -ax_pthread_clang="$ax_cv_PTHREAD_CLANG" - - -# GCC generally uses -pthread, or -pthreads on some platforms (e.g. SPARC) - -# Note that for GCC and Clang -pthread generally implies -lpthread, -# except when -nostdlib is passed. -# This is problematic using libtool to build C++ shared libraries with pthread: -# [1] https://gcc.gnu.org/bugzilla/show_bug.cgi?id=25460 -# [2] https://bugzilla.redhat.com/show_bug.cgi?id=661333 -# [3] https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=468555 -# To solve this, first try -pthread together with -lpthread for GCC - -if test "x$GCC" = "xyes" -then : - ax_pthread_flags="-pthread,-lpthread -pthread -pthreads $ax_pthread_flags" -fi - -# Clang takes -pthread (never supported any other flag), but we'll try with -lpthread first - -if test "x$ax_pthread_clang" = "xyes" -then : - ax_pthread_flags="-pthread,-lpthread -pthread" -fi - - -# The presence of a feature test macro requesting re-entrant function -# definitions is, on some systems, a strong hint that pthreads support is -# correctly enabled - -case $host_os in - darwin* | hpux* | linux* | osf* | solaris*) - ax_pthread_check_macro="_REENTRANT" - ;; - - aix*) - ax_pthread_check_macro="_THREAD_SAFE" - ;; - - *) - ax_pthread_check_macro="--" - ;; -esac -if test "x$ax_pthread_check_macro" = "x--" -then : - ax_pthread_check_cond=0 -else $as_nop - ax_pthread_check_cond="!defined($ax_pthread_check_macro)" -fi - - -if test "x$ax_pthread_ok" = "xno"; then -for ax_pthread_try_flag in $ax_pthread_flags; do - - case $ax_pthread_try_flag in - none) - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether pthreads work without any flags" >&5 -printf %s "checking whether pthreads work without any flags... " >&6; } - ;; - - *,*) - PTHREAD_CFLAGS=`echo $ax_pthread_try_flag | sed "s/^\(.*\),\(.*\)$/\1/"` - PTHREAD_LIBS=`echo $ax_pthread_try_flag | sed "s/^\(.*\),\(.*\)$/\2/"` - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether pthreads work with \"$PTHREAD_CFLAGS\" and \"$PTHREAD_LIBS\"" >&5 -printf %s "checking whether pthreads work with \"$PTHREAD_CFLAGS\" and \"$PTHREAD_LIBS\"... " >&6; } - ;; - - -*) - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether pthreads work with $ax_pthread_try_flag" >&5 -printf %s "checking whether pthreads work with $ax_pthread_try_flag... " >&6; } - PTHREAD_CFLAGS="$ax_pthread_try_flag" - ;; - - pthread-config) - # Extract the first word of "pthread-config", so it can be a program name with args. -set dummy pthread-config; ac_word=$2 -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -printf %s "checking for $ac_word... " >&6; } -if test ${ac_cv_prog_ax_pthread_config+y} -then : - printf %s "(cached) " >&6 -else $as_nop - if test -n "$ax_pthread_config"; then - ac_cv_prog_ax_pthread_config="$ax_pthread_config" # Let the user override the test. -else -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - case $as_dir in #((( - '') as_dir=./ ;; - */) ;; - *) as_dir=$as_dir/ ;; - esac - for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then - ac_cv_prog_ax_pthread_config="yes" - printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 - break 2 - fi -done - done -IFS=$as_save_IFS - - test -z "$ac_cv_prog_ax_pthread_config" && ac_cv_prog_ax_pthread_config="no" -fi -fi -ax_pthread_config=$ac_cv_prog_ax_pthread_config -if test -n "$ax_pthread_config"; then - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ax_pthread_config" >&5 -printf "%s\n" "$ax_pthread_config" >&6; } -else - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 -printf "%s\n" "no" >&6; } -fi - - - if test "x$ax_pthread_config" = "xno" -then : - continue -fi - PTHREAD_CFLAGS="`pthread-config --cflags`" - PTHREAD_LIBS="`pthread-config --ldflags` `pthread-config --libs`" - ;; - - *) - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for the pthreads library -l$ax_pthread_try_flag" >&5 -printf %s "checking for the pthreads library -l$ax_pthread_try_flag... " >&6; } - PTHREAD_LIBS="-l$ax_pthread_try_flag" - ;; - esac - - ax_pthread_save_CFLAGS="$CFLAGS" - ax_pthread_save_LIBS="$LIBS" - CFLAGS="$CFLAGS $PTHREAD_CFLAGS" - LIBS="$PTHREAD_LIBS $LIBS" - - # Check for various functions. We must include pthread.h, - # since some functions may be macros. (On the Sequent, we - # need a special flag -Kthread to make this header compile.) - # We check for pthread_join because it is in -lpthread on IRIX - # while pthread_create is in libc. We check for pthread_attr_init - # due to DEC craziness with -lpthreads. We check for - # pthread_cleanup_push because it is one of the few pthread - # functions on Solaris that doesn't have a non-functional libc stub. - # We try pthread_create on general principles. - - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -#include -# if $ax_pthread_check_cond -# error "$ax_pthread_check_macro must be defined" -# endif - static void *some_global = NULL; - static void routine(void *a) - { - /* To avoid any unused-parameter or - unused-but-set-parameter warning. */ - some_global = a; - } - static void *start_routine(void *a) { return a; } -int -main (void) -{ -pthread_t th; pthread_attr_t attr; - pthread_create(&th, 0, start_routine, 0); - pthread_join(th, 0); - pthread_attr_init(&attr); - pthread_cleanup_push(routine, 0); - pthread_cleanup_pop(0) /* ; */ - ; - return 0; -} -_ACEOF -if ac_fn_c_try_link "$LINENO" -then : - ax_pthread_ok=yes -fi -rm -f core conftest.err conftest.$ac_objext conftest.beam \ - conftest$ac_exeext conftest.$ac_ext - - CFLAGS="$ax_pthread_save_CFLAGS" - LIBS="$ax_pthread_save_LIBS" - - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ax_pthread_ok" >&5 -printf "%s\n" "$ax_pthread_ok" >&6; } - if test "x$ax_pthread_ok" = "xyes" -then : - break -fi - - PTHREAD_LIBS="" - PTHREAD_CFLAGS="" -done -fi - - -# Clang needs special handling, because older versions handle the -pthread -# option in a rather... idiosyncratic way - -if test "x$ax_pthread_clang" = "xyes"; then - - # Clang takes -pthread; it has never supported any other flag - - # (Note 1: This will need to be revisited if a system that Clang - # supports has POSIX threads in a separate library. This tends not - # to be the way of modern systems, but it's conceivable.) - - # (Note 2: On some systems, notably Darwin, -pthread is not needed - # to get POSIX threads support; the API is always present and - # active. We could reasonably leave PTHREAD_CFLAGS empty. But - # -pthread does define _REENTRANT, and while the Darwin headers - # ignore this macro, third-party headers might not.) - - # However, older versions of Clang make a point of warning the user - # that, in an invocation where only linking and no compilation is - # taking place, the -pthread option has no effect ("argument unused - # during compilation"). They expect -pthread to be passed in only - # when source code is being compiled. - # - # Problem is, this is at odds with the way Automake and most other - # C build frameworks function, which is that the same flags used in - # compilation (CFLAGS) are also used in linking. Many systems - # supported by AX_PTHREAD require exactly this for POSIX threads - # support, and in fact it is often not straightforward to specify a - # flag that is used only in the compilation phase and not in - # linking. Such a scenario is extremely rare in practice. - # - # Even though use of the -pthread flag in linking would only print - # a warning, this can be a nuisance for well-run software projects - # that build with -Werror. So if the active version of Clang has - # this misfeature, we search for an option to squash it. - - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether Clang needs flag to prevent \"argument unused\" warning when linking with -pthread" >&5 -printf %s "checking whether Clang needs flag to prevent \"argument unused\" warning when linking with -pthread... " >&6; } -if test ${ax_cv_PTHREAD_CLANG_NO_WARN_FLAG+y} -then : - printf %s "(cached) " >&6 -else $as_nop - ax_cv_PTHREAD_CLANG_NO_WARN_FLAG=unknown - # Create an alternate version of $ac_link that compiles and - # links in two steps (.c -> .o, .o -> exe) instead of one - # (.c -> exe), because the warning occurs only in the second - # step - ax_pthread_save_ac_link="$ac_link" - ax_pthread_sed='s/conftest\.\$ac_ext/conftest.$ac_objext/g' - ax_pthread_link_step=`$as_echo "$ac_link" | sed "$ax_pthread_sed"` - ax_pthread_2step_ac_link="($ac_compile) && (echo ==== >&5) && ($ax_pthread_link_step)" - ax_pthread_save_CFLAGS="$CFLAGS" - for ax_pthread_try in '' -Qunused-arguments -Wno-unused-command-line-argument unknown; do - if test "x$ax_pthread_try" = "xunknown" -then : - break -fi - CFLAGS="-Werror -Wunknown-warning-option $ax_pthread_try -pthread $ax_pthread_save_CFLAGS" - ac_link="$ax_pthread_save_ac_link" - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -int main(void){return 0;} -_ACEOF -if ac_fn_c_try_link "$LINENO" -then : - ac_link="$ax_pthread_2step_ac_link" - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -int main(void){return 0;} -_ACEOF -if ac_fn_c_try_link "$LINENO" -then : - break -fi -rm -f core conftest.err conftest.$ac_objext conftest.beam \ - conftest$ac_exeext conftest.$ac_ext - -fi -rm -f core conftest.err conftest.$ac_objext conftest.beam \ - conftest$ac_exeext conftest.$ac_ext - done - ac_link="$ax_pthread_save_ac_link" - CFLAGS="$ax_pthread_save_CFLAGS" - if test "x$ax_pthread_try" = "x" -then : - ax_pthread_try=no -fi - ax_cv_PTHREAD_CLANG_NO_WARN_FLAG="$ax_pthread_try" - -fi -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ax_cv_PTHREAD_CLANG_NO_WARN_FLAG" >&5 -printf "%s\n" "$ax_cv_PTHREAD_CLANG_NO_WARN_FLAG" >&6; } - - case "$ax_cv_PTHREAD_CLANG_NO_WARN_FLAG" in - no | unknown) ;; - *) PTHREAD_CFLAGS="$ax_cv_PTHREAD_CLANG_NO_WARN_FLAG $PTHREAD_CFLAGS" ;; - esac - -fi # $ax_pthread_clang = yes - - - -# Various other checks: -if test "x$ax_pthread_ok" = "xyes"; then - ax_pthread_save_CFLAGS="$CFLAGS" - ax_pthread_save_LIBS="$LIBS" - CFLAGS="$CFLAGS $PTHREAD_CFLAGS" - LIBS="$PTHREAD_LIBS $LIBS" - - # Detect AIX lossage: JOINABLE attribute is called UNDETACHED. - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for joinable pthread attribute" >&5 -printf %s "checking for joinable pthread attribute... " >&6; } -if test ${ax_cv_PTHREAD_JOINABLE_ATTR+y} -then : - printf %s "(cached) " >&6 -else $as_nop - ax_cv_PTHREAD_JOINABLE_ATTR=unknown - for ax_pthread_attr in PTHREAD_CREATE_JOINABLE PTHREAD_CREATE_UNDETACHED; do - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -#include -int -main (void) -{ -int attr = $ax_pthread_attr; return attr /* ; */ - ; - return 0; -} -_ACEOF -if ac_fn_c_try_link "$LINENO" -then : - ax_cv_PTHREAD_JOINABLE_ATTR=$ax_pthread_attr; break -fi -rm -f core conftest.err conftest.$ac_objext conftest.beam \ - conftest$ac_exeext conftest.$ac_ext - done - -fi -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ax_cv_PTHREAD_JOINABLE_ATTR" >&5 -printf "%s\n" "$ax_cv_PTHREAD_JOINABLE_ATTR" >&6; } - if test "x$ax_cv_PTHREAD_JOINABLE_ATTR" != "xunknown" && \ - test "x$ax_cv_PTHREAD_JOINABLE_ATTR" != "xPTHREAD_CREATE_JOINABLE" && \ - test "x$ax_pthread_joinable_attr_defined" != "xyes" -then : - -printf "%s\n" "#define PTHREAD_CREATE_JOINABLE $ax_cv_PTHREAD_JOINABLE_ATTR" >>confdefs.h - - ax_pthread_joinable_attr_defined=yes - -fi - - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether more special flags are required for pthreads" >&5 -printf %s "checking whether more special flags are required for pthreads... " >&6; } -if test ${ax_cv_PTHREAD_SPECIAL_FLAGS+y} -then : - printf %s "(cached) " >&6 -else $as_nop - ax_cv_PTHREAD_SPECIAL_FLAGS=no - case $host_os in - solaris*) - ax_cv_PTHREAD_SPECIAL_FLAGS="-D_POSIX_PTHREAD_SEMANTICS" - ;; - esac - -fi -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ax_cv_PTHREAD_SPECIAL_FLAGS" >&5 -printf "%s\n" "$ax_cv_PTHREAD_SPECIAL_FLAGS" >&6; } - if test "x$ax_cv_PTHREAD_SPECIAL_FLAGS" != "xno" && \ - test "x$ax_pthread_special_flags_added" != "xyes" -then : - PTHREAD_CFLAGS="$ax_cv_PTHREAD_SPECIAL_FLAGS $PTHREAD_CFLAGS" - ax_pthread_special_flags_added=yes -fi - - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for PTHREAD_PRIO_INHERIT" >&5 -printf %s "checking for PTHREAD_PRIO_INHERIT... " >&6; } -if test ${ax_cv_PTHREAD_PRIO_INHERIT+y} -then : - printf %s "(cached) " >&6 -else $as_nop - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -#include -int -main (void) -{ -int i = PTHREAD_PRIO_INHERIT; - return i; - ; - return 0; -} -_ACEOF -if ac_fn_c_try_link "$LINENO" -then : - ax_cv_PTHREAD_PRIO_INHERIT=yes -else $as_nop - ax_cv_PTHREAD_PRIO_INHERIT=no -fi -rm -f core conftest.err conftest.$ac_objext conftest.beam \ - conftest$ac_exeext conftest.$ac_ext - -fi -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ax_cv_PTHREAD_PRIO_INHERIT" >&5 -printf "%s\n" "$ax_cv_PTHREAD_PRIO_INHERIT" >&6; } - if test "x$ax_cv_PTHREAD_PRIO_INHERIT" = "xyes" && \ - test "x$ax_pthread_prio_inherit_defined" != "xyes" -then : - -printf "%s\n" "#define HAVE_PTHREAD_PRIO_INHERIT 1" >>confdefs.h - - ax_pthread_prio_inherit_defined=yes - -fi - - CFLAGS="$ax_pthread_save_CFLAGS" - LIBS="$ax_pthread_save_LIBS" - - # More AIX lossage: compile with *_r variant - if test "x$GCC" != "xyes"; then - case $host_os in - aix*) - case "x/$CC" in #( - x*/c89|x*/c89_128|x*/c99|x*/c99_128|x*/cc|x*/cc128|x*/xlc|x*/xlc_v6|x*/xlc128|x*/xlc128_v6) : - #handle absolute path differently from PATH based program lookup - case "x$CC" in #( - x/*) : - if as_fn_executable_p ${CC}_r -then : - PTHREAD_CC="${CC}_r" -fi ;; #( - *) : - for ac_prog in ${CC}_r -do - # Extract the first word of "$ac_prog", so it can be a program name with args. -set dummy $ac_prog; ac_word=$2 -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -printf %s "checking for $ac_word... " >&6; } -if test ${ac_cv_prog_PTHREAD_CC+y} -then : - printf %s "(cached) " >&6 -else $as_nop - if test -n "$PTHREAD_CC"; then - ac_cv_prog_PTHREAD_CC="$PTHREAD_CC" # Let the user override the test. -else -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - case $as_dir in #((( - '') as_dir=./ ;; - */) ;; - *) as_dir=$as_dir/ ;; - esac - for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then - ac_cv_prog_PTHREAD_CC="$ac_prog" - printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 - break 2 - fi -done - done -IFS=$as_save_IFS - -fi -fi -PTHREAD_CC=$ac_cv_prog_PTHREAD_CC -if test -n "$PTHREAD_CC"; then - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $PTHREAD_CC" >&5 -printf "%s\n" "$PTHREAD_CC" >&6; } -else - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 -printf "%s\n" "no" >&6; } -fi - - - test -n "$PTHREAD_CC" && break -done -test -n "$PTHREAD_CC" || PTHREAD_CC="$CC" - ;; -esac ;; #( - *) : - ;; -esac - ;; - esac - fi -fi - -test -n "$PTHREAD_CC" || PTHREAD_CC="$CC" - - - - - -# Finally, execute ACTION-IF-FOUND/ACTION-IF-NOT-FOUND: -if test "x$ax_pthread_ok" = "xyes"; then - -printf "%s\n" "#define HAVE_PTHREAD 1" >>confdefs.h - - : -else - ax_pthread_ok=no - -fi -ac_ext=cpp -ac_cpp='$CXXCPP $CPPFLAGS' -ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' -ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' -ac_compiler_gnu=$ac_cv_cxx_compiler_gnu - - - if test "x$ax_pthread_ok" = "xyes"; then - HAVE_PTHREAD_TRUE= - HAVE_PTHREAD_FALSE='#' -else - HAVE_PTHREAD_TRUE='#' - HAVE_PTHREAD_FALSE= -fi - -# We still keep this for improving pbconfig.h for unsupported platforms. - - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking the location of hash_map" >&5 -printf %s "checking the location of hash_map... " >&6; } - - ac_ext=cpp -ac_cpp='$CXXCPP $CPPFLAGS' -ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' -ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' -ac_compiler_gnu=$ac_cv_cxx_compiler_gnu - - ac_cv_cxx_hash_map="" - # First try unordered_map, but not on gcc's before 4.2 -- I've - # seen unexplainable unordered_map bugs with -O2 on older gcc's. - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -#if defined(__GNUC__) && (__GNUC__ < 4 || (__GNUC__ == 4 && __GNUC_MINOR__ < 2)) - # error GCC too old for unordered_map - #endif - -int -main (void) -{ -/* no program body necessary */ - ; - return 0; -} -_ACEOF -if ac_fn_cxx_try_compile "$LINENO" -then : - stl_hash_old_gcc=no -else $as_nop - stl_hash_old_gcc=yes -fi -rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext - for location in unordered_map tr1/unordered_map; do - for namespace in std std::tr1; do - if test -z "$ac_cv_cxx_hash_map" -a "$stl_hash_old_gcc" != yes; then - # Some older gcc's have a buggy tr1, so test a bit of code. - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -#include <$location> -int -main (void) -{ -const ${namespace}::unordered_map t; - return t.find(5) == t.end(); - ; - return 0; -} -_ACEOF -if ac_fn_cxx_try_compile "$LINENO" -then : - ac_cv_cxx_hash_map="<$location>"; - ac_cv_cxx_hash_namespace="$namespace"; - ac_cv_cxx_hash_map_class="unordered_map"; -fi -rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext - fi - done - done - # Now try hash_map - for location in ext/hash_map hash_map; do - for namespace in __gnu_cxx "" std stdext; do - if test -z "$ac_cv_cxx_hash_map"; then - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -#include <$location> -int -main (void) -{ -${namespace}::hash_map t - ; - return 0; -} -_ACEOF -if ac_fn_cxx_try_compile "$LINENO" -then : - ac_cv_cxx_hash_map="<$location>"; - ac_cv_cxx_hash_namespace="$namespace"; - ac_cv_cxx_hash_map_class="hash_map"; -fi -rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext - fi - done - done - ac_cv_cxx_hash_set=`echo "$ac_cv_cxx_hash_map" | sed s/map/set/`; - ac_cv_cxx_hash_set_class=`echo "$ac_cv_cxx_hash_map_class" | sed s/map/set/`; - if test -n "$ac_cv_cxx_hash_map"; then - -printf "%s\n" "#define HAVE_HASH_MAP 1" >>confdefs.h - - -printf "%s\n" "#define HAVE_HASH_SET 1" >>confdefs.h - - -printf "%s\n" "#define HASH_MAP_H $ac_cv_cxx_hash_map" >>confdefs.h - - -printf "%s\n" "#define HASH_SET_H $ac_cv_cxx_hash_set" >>confdefs.h - - -printf "%s\n" "#define HASH_NAMESPACE $ac_cv_cxx_hash_namespace" >>confdefs.h - - -printf "%s\n" "#define HASH_MAP_CLASS $ac_cv_cxx_hash_map_class" >>confdefs.h - - -printf "%s\n" "#define HASH_SET_CLASS $ac_cv_cxx_hash_set_class" >>confdefs.h - - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_cxx_hash_map" >&5 -printf "%s\n" "$ac_cv_cxx_hash_map" >&6; } - else - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: " >&5 -printf "%s\n" "" >&6; } - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: could not find an STL hash_map" >&5 -printf "%s\n" "$as_me: WARNING: could not find an STL hash_map" >&2;} - fi - - -# Enable ObjC support for conformance directory on OS X. -OBJC_CONFORMANCE_TEST=0 -case "$target_os" in - darwin*) - OBJC_CONFORMANCE_TEST=1 - ;; -esac - if test $OBJC_CONFORMANCE_TEST = 1; then - OBJC_CONFORMANCE_TEST_TRUE= - OBJC_CONFORMANCE_TEST_FALSE='#' -else - OBJC_CONFORMANCE_TEST_TRUE='#' - OBJC_CONFORMANCE_TEST_FALSE= -fi - - -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether -llog is needed" >&5 -printf %s "checking whether -llog is needed... " >&6; } -ANDROID_TEST=no -case "$target_os" in - *android*) - ANDROID_TEST=yes - ;; -esac -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ANDROID_TEST" >&5 -printf "%s\n" "$ANDROID_TEST" >&6; } -if test "x$ANDROID_TEST" = xyes; then - LIBLOG_LIBS="-llog" -fi - - -# HACK: Make gmock's configure script pick up our copy of CFLAGS and CXXFLAGS, -# since the flags added by ACX_CHECK_SUNCC must be used when compiling gmock -# too. -export CFLAGS -export CXXFLAGS - - -subdirs="$subdirs third_party/googletest" - - -ac_config_files="$ac_config_files Makefile src/Makefile benchmarks/Makefile conformance/Makefile protobuf.pc protobuf-lite.pc" - -cat >confcache <<\_ACEOF -# This file is a shell script that caches the results of configure -# tests run on this system so they can be shared between configure -# scripts and configure runs, see configure's option --config-cache. -# It is not useful on other systems. If it contains results you don't -# want to keep, you may remove or edit it. -# -# config.status only pays attention to the cache file if you give it -# the --recheck option to rerun configure. -# -# `ac_cv_env_foo' variables (set or unset) will be overridden when -# loading this file, other *unset* `ac_cv_foo' will be assigned the -# following values. - -_ACEOF - -# The following way of writing the cache mishandles newlines in values, -# but we know of no workaround that is simple, portable, and efficient. -# So, we kill variables containing newlines. -# Ultrix sh set writes to stderr and can't be redirected directly, -# and sets the high bit in the cache file unless we assign to the vars. -( - for ac_var in `(set) 2>&1 | sed -n 's/^\([a-zA-Z_][a-zA-Z0-9_]*\)=.*/\1/p'`; do - eval ac_val=\$$ac_var - case $ac_val in #( - *${as_nl}*) - case $ac_var in #( - *_cv_*) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: cache variable $ac_var contains a newline" >&5 -printf "%s\n" "$as_me: WARNING: cache variable $ac_var contains a newline" >&2;} ;; - esac - case $ac_var in #( - _ | IFS | as_nl) ;; #( - BASH_ARGV | BASH_SOURCE) eval $ac_var= ;; #( - *) { eval $ac_var=; unset $ac_var;} ;; - esac ;; - esac - done - - (set) 2>&1 | - case $as_nl`(ac_space=' '; set) 2>&1` in #( - *${as_nl}ac_space=\ *) - # `set' does not quote correctly, so add quotes: double-quote - # substitution turns \\\\ into \\, and sed turns \\ into \. - sed -n \ - "s/'/'\\\\''/g; - s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\\2'/p" - ;; #( - *) - # `set' quotes correctly as required by POSIX, so do not add quotes. - sed -n "/^[_$as_cr_alnum]*_cv_[_$as_cr_alnum]*=/p" - ;; - esac | - sort -) | - sed ' - /^ac_cv_env_/b end - t clear - :clear - s/^\([^=]*\)=\(.*[{}].*\)$/test ${\1+y} || &/ - t end - s/^\([^=]*\)=\(.*\)$/\1=${\1=\2}/ - :end' >>confcache -if diff "$cache_file" confcache >/dev/null 2>&1; then :; else - if test -w "$cache_file"; then - if test "x$cache_file" != "x/dev/null"; then - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: updating cache $cache_file" >&5 -printf "%s\n" "$as_me: updating cache $cache_file" >&6;} - if test ! -f "$cache_file" || test -h "$cache_file"; then - cat confcache >"$cache_file" - else - case $cache_file in #( - */* | ?:*) - mv -f confcache "$cache_file"$$ && - mv -f "$cache_file"$$ "$cache_file" ;; #( - *) - mv -f confcache "$cache_file" ;; - esac - fi - fi - else - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: not updating unwritable cache $cache_file" >&5 -printf "%s\n" "$as_me: not updating unwritable cache $cache_file" >&6;} - fi -fi -rm -f confcache - -test "x$prefix" = xNONE && prefix=$ac_default_prefix -# Let make expand exec_prefix. -test "x$exec_prefix" = xNONE && exec_prefix='${prefix}' - -DEFS=-DHAVE_CONFIG_H - -ac_libobjs= -ac_ltlibobjs= -U= -for ac_i in : $LIBOBJS; do test "x$ac_i" = x: && continue - # 1. Remove the extension, and $U if already installed. - ac_script='s/\$U\././;s/\.o$//;s/\.obj$//' - ac_i=`printf "%s\n" "$ac_i" | sed "$ac_script"` - # 2. Prepend LIBOBJDIR. When used with automake>=1.10 LIBOBJDIR - # will be set to the directory where LIBOBJS objects are built. - as_fn_append ac_libobjs " \${LIBOBJDIR}$ac_i\$U.$ac_objext" - as_fn_append ac_ltlibobjs " \${LIBOBJDIR}$ac_i"'$U.lo' -done -LIBOBJS=$ac_libobjs - -LTLIBOBJS=$ac_ltlibobjs - - -if test -z "${MAINTAINER_MODE_TRUE}" && test -z "${MAINTAINER_MODE_FALSE}"; then - as_fn_error $? "conditional \"MAINTAINER_MODE\" was never defined. -Usually this means the macro was only invoked conditionally." "$LINENO" 5 -fi -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking that generated files are newer than configure" >&5 -printf %s "checking that generated files are newer than configure... " >&6; } - if test -n "$am_sleep_pid"; then - # Hide warnings about reused PIDs. - wait $am_sleep_pid 2>/dev/null - fi - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: done" >&5 -printf "%s\n" "done" >&6; } - if test -n "$EXEEXT"; then - am__EXEEXT_TRUE= - am__EXEEXT_FALSE='#' -else - am__EXEEXT_TRUE='#' - am__EXEEXT_FALSE= -fi - -if test -z "${AMDEP_TRUE}" && test -z "${AMDEP_FALSE}"; then - as_fn_error $? "conditional \"AMDEP\" was never defined. -Usually this means the macro was only invoked conditionally." "$LINENO" 5 -fi -if test -z "${am__fastdepCC_TRUE}" && test -z "${am__fastdepCC_FALSE}"; then - as_fn_error $? "conditional \"am__fastdepCC\" was never defined. -Usually this means the macro was only invoked conditionally." "$LINENO" 5 -fi -if test -z "${am__fastdepCXX_TRUE}" && test -z "${am__fastdepCXX_FALSE}"; then - as_fn_error $? "conditional \"am__fastdepCXX\" was never defined. -Usually this means the macro was only invoked conditionally." "$LINENO" 5 -fi -if test -z "${am__fastdepCC_TRUE}" && test -z "${am__fastdepCC_FALSE}"; then - as_fn_error $? "conditional \"am__fastdepCC\" was never defined. -Usually this means the macro was only invoked conditionally." "$LINENO" 5 -fi -if test -z "${am__fastdepCXX_TRUE}" && test -z "${am__fastdepCXX_FALSE}"; then - as_fn_error $? "conditional \"am__fastdepCXX\" was never defined. -Usually this means the macro was only invoked conditionally." "$LINENO" 5 -fi -if test -z "${GCC_TRUE}" && test -z "${GCC_FALSE}"; then - as_fn_error $? "conditional \"GCC\" was never defined. -Usually this means the macro was only invoked conditionally." "$LINENO" 5 -fi -if test -z "${am__fastdepOBJC_TRUE}" && test -z "${am__fastdepOBJC_FALSE}"; then - as_fn_error $? "conditional \"am__fastdepOBJC\" was never defined. -Usually this means the macro was only invoked conditionally." "$LINENO" 5 -fi -if test -z "${HAVE_LD_VERSION_SCRIPT_TRUE}" && test -z "${HAVE_LD_VERSION_SCRIPT_FALSE}"; then - as_fn_error $? "conditional \"HAVE_LD_VERSION_SCRIPT\" was never defined. -Usually this means the macro was only invoked conditionally." "$LINENO" 5 -fi -if test -z "${HAVE_ZLIB_TRUE}" && test -z "${HAVE_ZLIB_FALSE}"; then - as_fn_error $? "conditional \"HAVE_ZLIB\" was never defined. -Usually this means the macro was only invoked conditionally." "$LINENO" 5 -fi -if test -z "${USE_EXTERNAL_PROTOC_TRUE}" && test -z "${USE_EXTERNAL_PROTOC_FALSE}"; then - as_fn_error $? "conditional \"USE_EXTERNAL_PROTOC\" was never defined. -Usually this means the macro was only invoked conditionally." "$LINENO" 5 -fi -if test -z "${HAVE_PTHREAD_TRUE}" && test -z "${HAVE_PTHREAD_FALSE}"; then - as_fn_error $? "conditional \"HAVE_PTHREAD\" was never defined. -Usually this means the macro was only invoked conditionally." "$LINENO" 5 -fi -if test -z "${OBJC_CONFORMANCE_TEST_TRUE}" && test -z "${OBJC_CONFORMANCE_TEST_FALSE}"; then - as_fn_error $? "conditional \"OBJC_CONFORMANCE_TEST\" was never defined. -Usually this means the macro was only invoked conditionally." "$LINENO" 5 -fi - -: "${CONFIG_STATUS=./config.status}" -ac_write_fail=0 -ac_clean_files_save=$ac_clean_files -ac_clean_files="$ac_clean_files $CONFIG_STATUS" -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: creating $CONFIG_STATUS" >&5 -printf "%s\n" "$as_me: creating $CONFIG_STATUS" >&6;} -as_write_fail=0 -cat >$CONFIG_STATUS <<_ASEOF || as_write_fail=1 -#! $SHELL -# Generated by $as_me. -# Run this file to recreate the current configuration. -# Compiler output produced by configure, useful for debugging -# configure, is in config.log if it exists. - -debug=false -ac_cs_recheck=false -ac_cs_silent=false - -SHELL=\${CONFIG_SHELL-$SHELL} -export SHELL -_ASEOF -cat >>$CONFIG_STATUS <<\_ASEOF || as_write_fail=1 -## -------------------- ## -## M4sh Initialization. ## -## -------------------- ## - -# Be more Bourne compatible -DUALCASE=1; export DUALCASE # for MKS sh -as_nop=: -if test ${ZSH_VERSION+y} && (emulate sh) >/dev/null 2>&1 -then : - emulate sh - NULLCMD=: - # Pre-4.2 versions of Zsh do word splitting on ${1+"$@"}, which - # is contrary to our usage. Disable this feature. - alias -g '${1+"$@"}'='"$@"' - setopt NO_GLOB_SUBST -else $as_nop - case `(set -o) 2>/dev/null` in #( - *posix*) : - set -o posix ;; #( - *) : - ;; -esac -fi - - - -# Reset variables that may have inherited troublesome values from -# the environment. - -# IFS needs to be set, to space, tab, and newline, in precisely that order. -# (If _AS_PATH_WALK were called with IFS unset, it would have the -# side effect of setting IFS to empty, thus disabling word splitting.) -# Quoting is to prevent editors from complaining about space-tab. -as_nl=' -' -export as_nl -IFS=" "" $as_nl" - -PS1='$ ' -PS2='> ' -PS4='+ ' - -# Ensure predictable behavior from utilities with locale-dependent output. -LC_ALL=C -export LC_ALL -LANGUAGE=C -export LANGUAGE - -# We cannot yet rely on "unset" to work, but we need these variables -# to be unset--not just set to an empty or harmless value--now, to -# avoid bugs in old shells (e.g. pre-3.0 UWIN ksh). This construct -# also avoids known problems related to "unset" and subshell syntax -# in other old shells (e.g. bash 2.01 and pdksh 5.2.14). -for as_var in BASH_ENV ENV MAIL MAILPATH CDPATH -do eval test \${$as_var+y} \ - && ( (unset $as_var) || exit 1) >/dev/null 2>&1 && unset $as_var || : -done - -# Ensure that fds 0, 1, and 2 are open. -if (exec 3>&0) 2>/dev/null; then :; else exec 0&1) 2>/dev/null; then :; else exec 1>/dev/null; fi -if (exec 3>&2) ; then :; else exec 2>/dev/null; fi - -# The user is always right. -if ${PATH_SEPARATOR+false} :; then - PATH_SEPARATOR=: - (PATH='/bin;/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 && { - (PATH='/bin:/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 || - PATH_SEPARATOR=';' - } -fi - - -# Find who we are. Look in the path if we contain no directory separator. -as_myself= -case $0 in #(( - *[\\/]* ) as_myself=$0 ;; - *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - case $as_dir in #((( - '') as_dir=./ ;; - */) ;; - *) as_dir=$as_dir/ ;; - esac - test -r "$as_dir$0" && as_myself=$as_dir$0 && break - done -IFS=$as_save_IFS - - ;; -esac -# We did not find ourselves, most probably we were run as `sh COMMAND' -# in which case we are not to be found in the path. -if test "x$as_myself" = x; then - as_myself=$0 -fi -if test ! -f "$as_myself"; then - printf "%s\n" "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2 - exit 1 -fi - - - -# as_fn_error STATUS ERROR [LINENO LOG_FD] -# ---------------------------------------- -# Output "`basename $0`: error: ERROR" to stderr. If LINENO and LOG_FD are -# provided, also output the error to LOG_FD, referencing LINENO. Then exit the -# script with STATUS, using 1 if that was 0. -as_fn_error () -{ - as_status=$1; test $as_status -eq 0 && as_status=1 - if test "$4"; then - as_lineno=${as_lineno-"$3"} as_lineno_stack=as_lineno_stack=$as_lineno_stack - printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: $2" >&$4 - fi - printf "%s\n" "$as_me: error: $2" >&2 - as_fn_exit $as_status -} # as_fn_error - - - -# as_fn_set_status STATUS -# ----------------------- -# Set $? to STATUS, without forking. -as_fn_set_status () -{ - return $1 -} # as_fn_set_status - -# as_fn_exit STATUS -# ----------------- -# Exit the shell with STATUS, even in a "trap 0" or "set -e" context. -as_fn_exit () -{ - set +e - as_fn_set_status $1 - exit $1 -} # as_fn_exit - -# as_fn_unset VAR -# --------------- -# Portably unset VAR. -as_fn_unset () -{ - { eval $1=; unset $1;} -} -as_unset=as_fn_unset - -# as_fn_append VAR VALUE -# ---------------------- -# Append the text in VALUE to the end of the definition contained in VAR. Take -# advantage of any shell optimizations that allow amortized linear growth over -# repeated appends, instead of the typical quadratic growth present in naive -# implementations. -if (eval "as_var=1; as_var+=2; test x\$as_var = x12") 2>/dev/null -then : - eval 'as_fn_append () - { - eval $1+=\$2 - }' -else $as_nop - as_fn_append () - { - eval $1=\$$1\$2 - } -fi # as_fn_append - -# as_fn_arith ARG... -# ------------------ -# Perform arithmetic evaluation on the ARGs, and store the result in the -# global $as_val. Take advantage of shells that can avoid forks. The arguments -# must be portable across $(()) and expr. -if (eval "test \$(( 1 + 1 )) = 2") 2>/dev/null -then : - eval 'as_fn_arith () - { - as_val=$(( $* )) - }' -else $as_nop - as_fn_arith () - { - as_val=`expr "$@" || test $? -eq 1` - } -fi # as_fn_arith - - -if expr a : '\(a\)' >/dev/null 2>&1 && - test "X`expr 00001 : '.*\(...\)'`" = X001; then - as_expr=expr -else - as_expr=false -fi - -if (basename -- /) >/dev/null 2>&1 && test "X`basename -- / 2>&1`" = "X/"; then - as_basename=basename -else - as_basename=false -fi - -if (as_dir=`dirname -- /` && test "X$as_dir" = X/) >/dev/null 2>&1; then - as_dirname=dirname -else - as_dirname=false -fi - -as_me=`$as_basename -- "$0" || -$as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \ - X"$0" : 'X\(//\)$' \| \ - X"$0" : 'X\(/\)' \| . 2>/dev/null || -printf "%s\n" X/"$0" | - sed '/^.*\/\([^/][^/]*\)\/*$/{ - s//\1/ - q - } - /^X\/\(\/\/\)$/{ - s//\1/ - q - } - /^X\/\(\/\).*/{ - s//\1/ - q - } - s/.*/./; q'` - -# Avoid depending upon Character Ranges. -as_cr_letters='abcdefghijklmnopqrstuvwxyz' -as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ' -as_cr_Letters=$as_cr_letters$as_cr_LETTERS -as_cr_digits='0123456789' -as_cr_alnum=$as_cr_Letters$as_cr_digits - - -# Determine whether it's possible to make 'echo' print without a newline. -# These variables are no longer used directly by Autoconf, but are AC_SUBSTed -# for compatibility with existing Makefiles. -ECHO_C= ECHO_N= ECHO_T= -case `echo -n x` in #((((( --n*) - case `echo 'xy\c'` in - *c*) ECHO_T=' ';; # ECHO_T is single tab character. - xy) ECHO_C='\c';; - *) echo `echo ksh88 bug on AIX 6.1` > /dev/null - ECHO_T=' ';; - esac;; -*) - ECHO_N='-n';; -esac - -# For backward compatibility with old third-party macros, we provide -# the shell variables $as_echo and $as_echo_n. New code should use -# AS_ECHO(["message"]) and AS_ECHO_N(["message"]), respectively. -as_echo='printf %s\n' -as_echo_n='printf %s' - -rm -f conf$$ conf$$.exe conf$$.file -if test -d conf$$.dir; then - rm -f conf$$.dir/conf$$.file -else - rm -f conf$$.dir - mkdir conf$$.dir 2>/dev/null -fi -if (echo >conf$$.file) 2>/dev/null; then - if ln -s conf$$.file conf$$ 2>/dev/null; then - as_ln_s='ln -s' - # ... but there are two gotchas: - # 1) On MSYS, both `ln -s file dir' and `ln file dir' fail. - # 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable. - # In both cases, we have to default to `cp -pR'. - ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe || - as_ln_s='cp -pR' - elif ln conf$$.file conf$$ 2>/dev/null; then - as_ln_s=ln - else - as_ln_s='cp -pR' - fi -else - as_ln_s='cp -pR' -fi -rm -f conf$$ conf$$.exe conf$$.dir/conf$$.file conf$$.file -rmdir conf$$.dir 2>/dev/null - - -# as_fn_mkdir_p -# ------------- -# Create "$as_dir" as a directory, including parents if necessary. -as_fn_mkdir_p () -{ - - case $as_dir in #( - -*) as_dir=./$as_dir;; - esac - test -d "$as_dir" || eval $as_mkdir_p || { - as_dirs= - while :; do - case $as_dir in #( - *\'*) as_qdir=`printf "%s\n" "$as_dir" | sed "s/'/'\\\\\\\\''/g"`;; #'( - *) as_qdir=$as_dir;; - esac - as_dirs="'$as_qdir' $as_dirs" - as_dir=`$as_dirname -- "$as_dir" || -$as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ - X"$as_dir" : 'X\(//\)[^/]' \| \ - X"$as_dir" : 'X\(//\)$' \| \ - X"$as_dir" : 'X\(/\)' \| . 2>/dev/null || -printf "%s\n" X"$as_dir" | - sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ - s//\1/ - q - } - /^X\(\/\/\)[^/].*/{ - s//\1/ - q - } - /^X\(\/\/\)$/{ - s//\1/ - q - } - /^X\(\/\).*/{ - s//\1/ - q - } - s/.*/./; q'` - test -d "$as_dir" && break - done - test -z "$as_dirs" || eval "mkdir $as_dirs" - } || test -d "$as_dir" || as_fn_error $? "cannot create directory $as_dir" - - -} # as_fn_mkdir_p -if mkdir -p . 2>/dev/null; then - as_mkdir_p='mkdir -p "$as_dir"' -else - test -d ./-p && rmdir ./-p - as_mkdir_p=false -fi - - -# as_fn_executable_p FILE -# ----------------------- -# Test if FILE is an executable regular file. -as_fn_executable_p () -{ - test -f "$1" && test -x "$1" -} # as_fn_executable_p -as_test_x='test -x' -as_executable_p=as_fn_executable_p - -# Sed expression to map a string onto a valid CPP name. -as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'" - -# Sed expression to map a string onto a valid variable name. -as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'" - - -exec 6>&1 -## ----------------------------------- ## -## Main body of $CONFIG_STATUS script. ## -## ----------------------------------- ## -_ASEOF -test $as_write_fail = 0 && chmod +x $CONFIG_STATUS || ac_write_fail=1 - -cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 -# Save the log message, to keep $0 and so on meaningful, and to -# report actual input values of CONFIG_FILES etc. instead of their -# values after options handling. -ac_log=" -This file was extended by Protocol Buffers $as_me 3.19.4, which was -generated by GNU Autoconf 2.71. Invocation command line was - - CONFIG_FILES = $CONFIG_FILES - CONFIG_HEADERS = $CONFIG_HEADERS - CONFIG_LINKS = $CONFIG_LINKS - CONFIG_COMMANDS = $CONFIG_COMMANDS - $ $0 $@ - -on `(hostname || uname -n) 2>/dev/null | sed 1q` -" - -_ACEOF - -case $ac_config_files in *" -"*) set x $ac_config_files; shift; ac_config_files=$*;; -esac - -case $ac_config_headers in *" -"*) set x $ac_config_headers; shift; ac_config_headers=$*;; -esac - - -cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 -# Files that config.status was made for. -config_files="$ac_config_files" -config_headers="$ac_config_headers" -config_commands="$ac_config_commands" - -_ACEOF - -cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 -ac_cs_usage="\ -\`$as_me' instantiates files and other configuration actions -from templates according to the current configuration. Unless the files -and actions are specified as TAGs, all are instantiated by default. - -Usage: $0 [OPTION]... [TAG]... - - -h, --help print this help, then exit - -V, --version print version number and configuration settings, then exit - --config print configuration, then exit - -q, --quiet, --silent - do not print progress messages - -d, --debug don't remove temporary files - --recheck update $as_me by reconfiguring in the same conditions - --file=FILE[:TEMPLATE] - instantiate the configuration file FILE - --header=FILE[:TEMPLATE] - instantiate the configuration header FILE - -Configuration files: -$config_files - -Configuration headers: -$config_headers - -Configuration commands: -$config_commands - -Report bugs to ." - -_ACEOF -ac_cs_config=`printf "%s\n" "$ac_configure_args" | sed "$ac_safe_unquote"` -ac_cs_config_escaped=`printf "%s\n" "$ac_cs_config" | sed "s/^ //; s/'/'\\\\\\\\''/g"` -cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 -ac_cs_config='$ac_cs_config_escaped' -ac_cs_version="\\ -Protocol Buffers config.status 3.19.4 -configured by $0, generated by GNU Autoconf 2.71, - with options \\"\$ac_cs_config\\" - -Copyright (C) 2021 Free Software Foundation, Inc. -This config.status script is free software; the Free Software Foundation -gives unlimited permission to copy, distribute and modify it." - -ac_pwd='$ac_pwd' -srcdir='$srcdir' -INSTALL='$INSTALL' -MKDIR_P='$MKDIR_P' -AWK='$AWK' -test -n "\$AWK" || AWK=awk -_ACEOF - -cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 -# The default lists apply if the user does not specify any file. -ac_need_defaults=: -while test $# != 0 -do - case $1 in - --*=?*) - ac_option=`expr "X$1" : 'X\([^=]*\)='` - ac_optarg=`expr "X$1" : 'X[^=]*=\(.*\)'` - ac_shift=: - ;; - --*=) - ac_option=`expr "X$1" : 'X\([^=]*\)='` - ac_optarg= - ac_shift=: - ;; - *) - ac_option=$1 - ac_optarg=$2 - ac_shift=shift - ;; - esac - - case $ac_option in - # Handling of the options. - -recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r) - ac_cs_recheck=: ;; - --version | --versio | --versi | --vers | --ver | --ve | --v | -V ) - printf "%s\n" "$ac_cs_version"; exit ;; - --config | --confi | --conf | --con | --co | --c ) - printf "%s\n" "$ac_cs_config"; exit ;; - --debug | --debu | --deb | --de | --d | -d ) - debug=: ;; - --file | --fil | --fi | --f ) - $ac_shift - case $ac_optarg in - *\'*) ac_optarg=`printf "%s\n" "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"` ;; - '') as_fn_error $? "missing file argument" ;; - esac - as_fn_append CONFIG_FILES " '$ac_optarg'" - ac_need_defaults=false;; - --header | --heade | --head | --hea ) - $ac_shift - case $ac_optarg in - *\'*) ac_optarg=`printf "%s\n" "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"` ;; - esac - as_fn_append CONFIG_HEADERS " '$ac_optarg'" - ac_need_defaults=false;; - --he | --h) - # Conflict between --help and --header - as_fn_error $? "ambiguous option: \`$1' -Try \`$0 --help' for more information.";; - --help | --hel | -h ) - printf "%s\n" "$ac_cs_usage"; exit ;; - -q | -quiet | --quiet | --quie | --qui | --qu | --q \ - | -silent | --silent | --silen | --sile | --sil | --si | --s) - ac_cs_silent=: ;; - - # This is an error. - -*) as_fn_error $? "unrecognized option: \`$1' -Try \`$0 --help' for more information." ;; - - *) as_fn_append ac_config_targets " $1" - ac_need_defaults=false ;; - - esac - shift -done - -ac_configure_extra_args= - -if $ac_cs_silent; then - exec 6>/dev/null - ac_configure_extra_args="$ac_configure_extra_args --silent" -fi - -_ACEOF -cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 -if \$ac_cs_recheck; then - set X $SHELL '$0' $ac_configure_args \$ac_configure_extra_args --no-create --no-recursion - shift - \printf "%s\n" "running CONFIG_SHELL=$SHELL \$*" >&6 - CONFIG_SHELL='$SHELL' - export CONFIG_SHELL - exec "\$@" -fi - -_ACEOF -cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 -exec 5>>config.log -{ - echo - sed 'h;s/./-/g;s/^.../## /;s/...$/ ##/;p;x;p;x' <<_ASBOX -## Running $as_me. ## -_ASBOX - printf "%s\n" "$ac_log" -} >&5 - -_ACEOF -cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 -# -# INIT-COMMANDS -# -AMDEP_TRUE="$AMDEP_TRUE" MAKE="${MAKE-make}" - - -# The HP-UX ksh and POSIX shell print the target directory to stdout -# if CDPATH is set. -(unset CDPATH) >/dev/null 2>&1 && unset CDPATH - -sed_quote_subst='$sed_quote_subst' -double_quote_subst='$double_quote_subst' -delay_variable_subst='$delay_variable_subst' -macro_version='`$ECHO "$macro_version" | $SED "$delay_single_quote_subst"`' -macro_revision='`$ECHO "$macro_revision" | $SED "$delay_single_quote_subst"`' -enable_shared='`$ECHO "$enable_shared" | $SED "$delay_single_quote_subst"`' -enable_static='`$ECHO "$enable_static" | $SED "$delay_single_quote_subst"`' -pic_mode='`$ECHO "$pic_mode" | $SED "$delay_single_quote_subst"`' -enable_fast_install='`$ECHO "$enable_fast_install" | $SED "$delay_single_quote_subst"`' -shared_archive_member_spec='`$ECHO "$shared_archive_member_spec" | $SED "$delay_single_quote_subst"`' -SHELL='`$ECHO "$SHELL" | $SED "$delay_single_quote_subst"`' -ECHO='`$ECHO "$ECHO" | $SED "$delay_single_quote_subst"`' -PATH_SEPARATOR='`$ECHO "$PATH_SEPARATOR" | $SED "$delay_single_quote_subst"`' -host_alias='`$ECHO "$host_alias" | $SED "$delay_single_quote_subst"`' -host='`$ECHO "$host" | $SED "$delay_single_quote_subst"`' -host_os='`$ECHO "$host_os" | $SED "$delay_single_quote_subst"`' -build_alias='`$ECHO "$build_alias" | $SED "$delay_single_quote_subst"`' -build='`$ECHO "$build" | $SED "$delay_single_quote_subst"`' -build_os='`$ECHO "$build_os" | $SED "$delay_single_quote_subst"`' -SED='`$ECHO "$SED" | $SED "$delay_single_quote_subst"`' -Xsed='`$ECHO "$Xsed" | $SED "$delay_single_quote_subst"`' -GREP='`$ECHO "$GREP" | $SED "$delay_single_quote_subst"`' -EGREP='`$ECHO "$EGREP" | $SED "$delay_single_quote_subst"`' -FGREP='`$ECHO "$FGREP" | $SED "$delay_single_quote_subst"`' -LD='`$ECHO "$LD" | $SED "$delay_single_quote_subst"`' -NM='`$ECHO "$NM" | $SED "$delay_single_quote_subst"`' -LN_S='`$ECHO "$LN_S" | $SED "$delay_single_quote_subst"`' -max_cmd_len='`$ECHO "$max_cmd_len" | $SED "$delay_single_quote_subst"`' -ac_objext='`$ECHO "$ac_objext" | $SED "$delay_single_quote_subst"`' -exeext='`$ECHO "$exeext" | $SED "$delay_single_quote_subst"`' -lt_unset='`$ECHO "$lt_unset" | $SED "$delay_single_quote_subst"`' -lt_SP2NL='`$ECHO "$lt_SP2NL" | $SED "$delay_single_quote_subst"`' -lt_NL2SP='`$ECHO "$lt_NL2SP" | $SED "$delay_single_quote_subst"`' -lt_cv_to_host_file_cmd='`$ECHO "$lt_cv_to_host_file_cmd" | $SED "$delay_single_quote_subst"`' -lt_cv_to_tool_file_cmd='`$ECHO "$lt_cv_to_tool_file_cmd" | $SED "$delay_single_quote_subst"`' -reload_flag='`$ECHO "$reload_flag" | $SED "$delay_single_quote_subst"`' -reload_cmds='`$ECHO "$reload_cmds" | $SED "$delay_single_quote_subst"`' -OBJDUMP='`$ECHO "$OBJDUMP" | $SED "$delay_single_quote_subst"`' -deplibs_check_method='`$ECHO "$deplibs_check_method" | $SED "$delay_single_quote_subst"`' -file_magic_cmd='`$ECHO "$file_magic_cmd" | $SED "$delay_single_quote_subst"`' -file_magic_glob='`$ECHO "$file_magic_glob" | $SED "$delay_single_quote_subst"`' -want_nocaseglob='`$ECHO "$want_nocaseglob" | $SED "$delay_single_quote_subst"`' -DLLTOOL='`$ECHO "$DLLTOOL" | $SED "$delay_single_quote_subst"`' -sharedlib_from_linklib_cmd='`$ECHO "$sharedlib_from_linklib_cmd" | $SED "$delay_single_quote_subst"`' -AR='`$ECHO "$AR" | $SED "$delay_single_quote_subst"`' -AR_FLAGS='`$ECHO "$AR_FLAGS" | $SED "$delay_single_quote_subst"`' -archiver_list_spec='`$ECHO "$archiver_list_spec" | $SED "$delay_single_quote_subst"`' -STRIP='`$ECHO "$STRIP" | $SED "$delay_single_quote_subst"`' -RANLIB='`$ECHO "$RANLIB" | $SED "$delay_single_quote_subst"`' -old_postinstall_cmds='`$ECHO "$old_postinstall_cmds" | $SED "$delay_single_quote_subst"`' -old_postuninstall_cmds='`$ECHO "$old_postuninstall_cmds" | $SED "$delay_single_quote_subst"`' -old_archive_cmds='`$ECHO "$old_archive_cmds" | $SED "$delay_single_quote_subst"`' -lock_old_archive_extraction='`$ECHO "$lock_old_archive_extraction" | $SED "$delay_single_quote_subst"`' -CC='`$ECHO "$CC" | $SED "$delay_single_quote_subst"`' -CFLAGS='`$ECHO "$CFLAGS" | $SED "$delay_single_quote_subst"`' -compiler='`$ECHO "$compiler" | $SED "$delay_single_quote_subst"`' -GCC='`$ECHO "$GCC" | $SED "$delay_single_quote_subst"`' -lt_cv_sys_global_symbol_pipe='`$ECHO "$lt_cv_sys_global_symbol_pipe" | $SED "$delay_single_quote_subst"`' -lt_cv_sys_global_symbol_to_cdecl='`$ECHO "$lt_cv_sys_global_symbol_to_cdecl" | $SED "$delay_single_quote_subst"`' -lt_cv_sys_global_symbol_to_import='`$ECHO "$lt_cv_sys_global_symbol_to_import" | $SED "$delay_single_quote_subst"`' -lt_cv_sys_global_symbol_to_c_name_address='`$ECHO "$lt_cv_sys_global_symbol_to_c_name_address" | $SED "$delay_single_quote_subst"`' -lt_cv_sys_global_symbol_to_c_name_address_lib_prefix='`$ECHO "$lt_cv_sys_global_symbol_to_c_name_address_lib_prefix" | $SED "$delay_single_quote_subst"`' -lt_cv_nm_interface='`$ECHO "$lt_cv_nm_interface" | $SED "$delay_single_quote_subst"`' -nm_file_list_spec='`$ECHO "$nm_file_list_spec" | $SED "$delay_single_quote_subst"`' -lt_sysroot='`$ECHO "$lt_sysroot" | $SED "$delay_single_quote_subst"`' -lt_cv_truncate_bin='`$ECHO "$lt_cv_truncate_bin" | $SED "$delay_single_quote_subst"`' -objdir='`$ECHO "$objdir" | $SED "$delay_single_quote_subst"`' -MAGIC_CMD='`$ECHO "$MAGIC_CMD" | $SED "$delay_single_quote_subst"`' -lt_prog_compiler_no_builtin_flag='`$ECHO "$lt_prog_compiler_no_builtin_flag" | $SED "$delay_single_quote_subst"`' -lt_prog_compiler_pic='`$ECHO "$lt_prog_compiler_pic" | $SED "$delay_single_quote_subst"`' -lt_prog_compiler_wl='`$ECHO "$lt_prog_compiler_wl" | $SED "$delay_single_quote_subst"`' -lt_prog_compiler_static='`$ECHO "$lt_prog_compiler_static" | $SED "$delay_single_quote_subst"`' -lt_cv_prog_compiler_c_o='`$ECHO "$lt_cv_prog_compiler_c_o" | $SED "$delay_single_quote_subst"`' -need_locks='`$ECHO "$need_locks" | $SED "$delay_single_quote_subst"`' -MANIFEST_TOOL='`$ECHO "$MANIFEST_TOOL" | $SED "$delay_single_quote_subst"`' -DSYMUTIL='`$ECHO "$DSYMUTIL" | $SED "$delay_single_quote_subst"`' -NMEDIT='`$ECHO "$NMEDIT" | $SED "$delay_single_quote_subst"`' -LIPO='`$ECHO "$LIPO" | $SED "$delay_single_quote_subst"`' -OTOOL='`$ECHO "$OTOOL" | $SED "$delay_single_quote_subst"`' -OTOOL64='`$ECHO "$OTOOL64" | $SED "$delay_single_quote_subst"`' -libext='`$ECHO "$libext" | $SED "$delay_single_quote_subst"`' -shrext_cmds='`$ECHO "$shrext_cmds" | $SED "$delay_single_quote_subst"`' -extract_expsyms_cmds='`$ECHO "$extract_expsyms_cmds" | $SED "$delay_single_quote_subst"`' -archive_cmds_need_lc='`$ECHO "$archive_cmds_need_lc" | $SED "$delay_single_quote_subst"`' -enable_shared_with_static_runtimes='`$ECHO "$enable_shared_with_static_runtimes" | $SED "$delay_single_quote_subst"`' -export_dynamic_flag_spec='`$ECHO "$export_dynamic_flag_spec" | $SED "$delay_single_quote_subst"`' -whole_archive_flag_spec='`$ECHO "$whole_archive_flag_spec" | $SED "$delay_single_quote_subst"`' -compiler_needs_object='`$ECHO "$compiler_needs_object" | $SED "$delay_single_quote_subst"`' -old_archive_from_new_cmds='`$ECHO "$old_archive_from_new_cmds" | $SED "$delay_single_quote_subst"`' -old_archive_from_expsyms_cmds='`$ECHO "$old_archive_from_expsyms_cmds" | $SED "$delay_single_quote_subst"`' -archive_cmds='`$ECHO "$archive_cmds" | $SED "$delay_single_quote_subst"`' -archive_expsym_cmds='`$ECHO "$archive_expsym_cmds" | $SED "$delay_single_quote_subst"`' -module_cmds='`$ECHO "$module_cmds" | $SED "$delay_single_quote_subst"`' -module_expsym_cmds='`$ECHO "$module_expsym_cmds" | $SED "$delay_single_quote_subst"`' -with_gnu_ld='`$ECHO "$with_gnu_ld" | $SED "$delay_single_quote_subst"`' -allow_undefined_flag='`$ECHO "$allow_undefined_flag" | $SED "$delay_single_quote_subst"`' -no_undefined_flag='`$ECHO "$no_undefined_flag" | $SED "$delay_single_quote_subst"`' -hardcode_libdir_flag_spec='`$ECHO "$hardcode_libdir_flag_spec" | $SED "$delay_single_quote_subst"`' -hardcode_libdir_separator='`$ECHO "$hardcode_libdir_separator" | $SED "$delay_single_quote_subst"`' -hardcode_direct='`$ECHO "$hardcode_direct" | $SED "$delay_single_quote_subst"`' -hardcode_direct_absolute='`$ECHO "$hardcode_direct_absolute" | $SED "$delay_single_quote_subst"`' -hardcode_minus_L='`$ECHO "$hardcode_minus_L" | $SED "$delay_single_quote_subst"`' -hardcode_shlibpath_var='`$ECHO "$hardcode_shlibpath_var" | $SED "$delay_single_quote_subst"`' -hardcode_automatic='`$ECHO "$hardcode_automatic" | $SED "$delay_single_quote_subst"`' -inherit_rpath='`$ECHO "$inherit_rpath" | $SED "$delay_single_quote_subst"`' -link_all_deplibs='`$ECHO "$link_all_deplibs" | $SED "$delay_single_quote_subst"`' -always_export_symbols='`$ECHO "$always_export_symbols" | $SED "$delay_single_quote_subst"`' -export_symbols_cmds='`$ECHO "$export_symbols_cmds" | $SED "$delay_single_quote_subst"`' -exclude_expsyms='`$ECHO "$exclude_expsyms" | $SED "$delay_single_quote_subst"`' -include_expsyms='`$ECHO "$include_expsyms" | $SED "$delay_single_quote_subst"`' -prelink_cmds='`$ECHO "$prelink_cmds" | $SED "$delay_single_quote_subst"`' -postlink_cmds='`$ECHO "$postlink_cmds" | $SED "$delay_single_quote_subst"`' -file_list_spec='`$ECHO "$file_list_spec" | $SED "$delay_single_quote_subst"`' -variables_saved_for_relink='`$ECHO "$variables_saved_for_relink" | $SED "$delay_single_quote_subst"`' -need_lib_prefix='`$ECHO "$need_lib_prefix" | $SED "$delay_single_quote_subst"`' -need_version='`$ECHO "$need_version" | $SED "$delay_single_quote_subst"`' -version_type='`$ECHO "$version_type" | $SED "$delay_single_quote_subst"`' -runpath_var='`$ECHO "$runpath_var" | $SED "$delay_single_quote_subst"`' -shlibpath_var='`$ECHO "$shlibpath_var" | $SED "$delay_single_quote_subst"`' -shlibpath_overrides_runpath='`$ECHO "$shlibpath_overrides_runpath" | $SED "$delay_single_quote_subst"`' -libname_spec='`$ECHO "$libname_spec" | $SED "$delay_single_quote_subst"`' -library_names_spec='`$ECHO "$library_names_spec" | $SED "$delay_single_quote_subst"`' -soname_spec='`$ECHO "$soname_spec" | $SED "$delay_single_quote_subst"`' -install_override_mode='`$ECHO "$install_override_mode" | $SED "$delay_single_quote_subst"`' -postinstall_cmds='`$ECHO "$postinstall_cmds" | $SED "$delay_single_quote_subst"`' -postuninstall_cmds='`$ECHO "$postuninstall_cmds" | $SED "$delay_single_quote_subst"`' -finish_cmds='`$ECHO "$finish_cmds" | $SED "$delay_single_quote_subst"`' -finish_eval='`$ECHO "$finish_eval" | $SED "$delay_single_quote_subst"`' -hardcode_into_libs='`$ECHO "$hardcode_into_libs" | $SED "$delay_single_quote_subst"`' -sys_lib_search_path_spec='`$ECHO "$sys_lib_search_path_spec" | $SED "$delay_single_quote_subst"`' -configure_time_dlsearch_path='`$ECHO "$configure_time_dlsearch_path" | $SED "$delay_single_quote_subst"`' -configure_time_lt_sys_library_path='`$ECHO "$configure_time_lt_sys_library_path" | $SED "$delay_single_quote_subst"`' -hardcode_action='`$ECHO "$hardcode_action" | $SED "$delay_single_quote_subst"`' -enable_dlopen='`$ECHO "$enable_dlopen" | $SED "$delay_single_quote_subst"`' -enable_dlopen_self='`$ECHO "$enable_dlopen_self" | $SED "$delay_single_quote_subst"`' -enable_dlopen_self_static='`$ECHO "$enable_dlopen_self_static" | $SED "$delay_single_quote_subst"`' -old_striplib='`$ECHO "$old_striplib" | $SED "$delay_single_quote_subst"`' -striplib='`$ECHO "$striplib" | $SED "$delay_single_quote_subst"`' -compiler_lib_search_dirs='`$ECHO "$compiler_lib_search_dirs" | $SED "$delay_single_quote_subst"`' -predep_objects='`$ECHO "$predep_objects" | $SED "$delay_single_quote_subst"`' -postdep_objects='`$ECHO "$postdep_objects" | $SED "$delay_single_quote_subst"`' -predeps='`$ECHO "$predeps" | $SED "$delay_single_quote_subst"`' -postdeps='`$ECHO "$postdeps" | $SED "$delay_single_quote_subst"`' -compiler_lib_search_path='`$ECHO "$compiler_lib_search_path" | $SED "$delay_single_quote_subst"`' -LD_CXX='`$ECHO "$LD_CXX" | $SED "$delay_single_quote_subst"`' -reload_flag_CXX='`$ECHO "$reload_flag_CXX" | $SED "$delay_single_quote_subst"`' -reload_cmds_CXX='`$ECHO "$reload_cmds_CXX" | $SED "$delay_single_quote_subst"`' -old_archive_cmds_CXX='`$ECHO "$old_archive_cmds_CXX" | $SED "$delay_single_quote_subst"`' -compiler_CXX='`$ECHO "$compiler_CXX" | $SED "$delay_single_quote_subst"`' -GCC_CXX='`$ECHO "$GCC_CXX" | $SED "$delay_single_quote_subst"`' -lt_prog_compiler_no_builtin_flag_CXX='`$ECHO "$lt_prog_compiler_no_builtin_flag_CXX" | $SED "$delay_single_quote_subst"`' -lt_prog_compiler_pic_CXX='`$ECHO "$lt_prog_compiler_pic_CXX" | $SED "$delay_single_quote_subst"`' -lt_prog_compiler_wl_CXX='`$ECHO "$lt_prog_compiler_wl_CXX" | $SED "$delay_single_quote_subst"`' -lt_prog_compiler_static_CXX='`$ECHO "$lt_prog_compiler_static_CXX" | $SED "$delay_single_quote_subst"`' -lt_cv_prog_compiler_c_o_CXX='`$ECHO "$lt_cv_prog_compiler_c_o_CXX" | $SED "$delay_single_quote_subst"`' -archive_cmds_need_lc_CXX='`$ECHO "$archive_cmds_need_lc_CXX" | $SED "$delay_single_quote_subst"`' -enable_shared_with_static_runtimes_CXX='`$ECHO "$enable_shared_with_static_runtimes_CXX" | $SED "$delay_single_quote_subst"`' -export_dynamic_flag_spec_CXX='`$ECHO "$export_dynamic_flag_spec_CXX" | $SED "$delay_single_quote_subst"`' -whole_archive_flag_spec_CXX='`$ECHO "$whole_archive_flag_spec_CXX" | $SED "$delay_single_quote_subst"`' -compiler_needs_object_CXX='`$ECHO "$compiler_needs_object_CXX" | $SED "$delay_single_quote_subst"`' -old_archive_from_new_cmds_CXX='`$ECHO "$old_archive_from_new_cmds_CXX" | $SED "$delay_single_quote_subst"`' -old_archive_from_expsyms_cmds_CXX='`$ECHO "$old_archive_from_expsyms_cmds_CXX" | $SED "$delay_single_quote_subst"`' -archive_cmds_CXX='`$ECHO "$archive_cmds_CXX" | $SED "$delay_single_quote_subst"`' -archive_expsym_cmds_CXX='`$ECHO "$archive_expsym_cmds_CXX" | $SED "$delay_single_quote_subst"`' -module_cmds_CXX='`$ECHO "$module_cmds_CXX" | $SED "$delay_single_quote_subst"`' -module_expsym_cmds_CXX='`$ECHO "$module_expsym_cmds_CXX" | $SED "$delay_single_quote_subst"`' -with_gnu_ld_CXX='`$ECHO "$with_gnu_ld_CXX" | $SED "$delay_single_quote_subst"`' -allow_undefined_flag_CXX='`$ECHO "$allow_undefined_flag_CXX" | $SED "$delay_single_quote_subst"`' -no_undefined_flag_CXX='`$ECHO "$no_undefined_flag_CXX" | $SED "$delay_single_quote_subst"`' -hardcode_libdir_flag_spec_CXX='`$ECHO "$hardcode_libdir_flag_spec_CXX" | $SED "$delay_single_quote_subst"`' -hardcode_libdir_separator_CXX='`$ECHO "$hardcode_libdir_separator_CXX" | $SED "$delay_single_quote_subst"`' -hardcode_direct_CXX='`$ECHO "$hardcode_direct_CXX" | $SED "$delay_single_quote_subst"`' -hardcode_direct_absolute_CXX='`$ECHO "$hardcode_direct_absolute_CXX" | $SED "$delay_single_quote_subst"`' -hardcode_minus_L_CXX='`$ECHO "$hardcode_minus_L_CXX" | $SED "$delay_single_quote_subst"`' -hardcode_shlibpath_var_CXX='`$ECHO "$hardcode_shlibpath_var_CXX" | $SED "$delay_single_quote_subst"`' -hardcode_automatic_CXX='`$ECHO "$hardcode_automatic_CXX" | $SED "$delay_single_quote_subst"`' -inherit_rpath_CXX='`$ECHO "$inherit_rpath_CXX" | $SED "$delay_single_quote_subst"`' -link_all_deplibs_CXX='`$ECHO "$link_all_deplibs_CXX" | $SED "$delay_single_quote_subst"`' -always_export_symbols_CXX='`$ECHO "$always_export_symbols_CXX" | $SED "$delay_single_quote_subst"`' -export_symbols_cmds_CXX='`$ECHO "$export_symbols_cmds_CXX" | $SED "$delay_single_quote_subst"`' -exclude_expsyms_CXX='`$ECHO "$exclude_expsyms_CXX" | $SED "$delay_single_quote_subst"`' -include_expsyms_CXX='`$ECHO "$include_expsyms_CXX" | $SED "$delay_single_quote_subst"`' -prelink_cmds_CXX='`$ECHO "$prelink_cmds_CXX" | $SED "$delay_single_quote_subst"`' -postlink_cmds_CXX='`$ECHO "$postlink_cmds_CXX" | $SED "$delay_single_quote_subst"`' -file_list_spec_CXX='`$ECHO "$file_list_spec_CXX" | $SED "$delay_single_quote_subst"`' -hardcode_action_CXX='`$ECHO "$hardcode_action_CXX" | $SED "$delay_single_quote_subst"`' -compiler_lib_search_dirs_CXX='`$ECHO "$compiler_lib_search_dirs_CXX" | $SED "$delay_single_quote_subst"`' -predep_objects_CXX='`$ECHO "$predep_objects_CXX" | $SED "$delay_single_quote_subst"`' -postdep_objects_CXX='`$ECHO "$postdep_objects_CXX" | $SED "$delay_single_quote_subst"`' -predeps_CXX='`$ECHO "$predeps_CXX" | $SED "$delay_single_quote_subst"`' -postdeps_CXX='`$ECHO "$postdeps_CXX" | $SED "$delay_single_quote_subst"`' -compiler_lib_search_path_CXX='`$ECHO "$compiler_lib_search_path_CXX" | $SED "$delay_single_quote_subst"`' - -LTCC='$LTCC' -LTCFLAGS='$LTCFLAGS' -compiler='$compiler_DEFAULT' - -# A function that is used when there is no print builtin or printf. -func_fallback_echo () -{ - eval 'cat <<_LTECHO_EOF -\$1 -_LTECHO_EOF' -} - -# Quote evaled strings. -for var in SHELL \ -ECHO \ -PATH_SEPARATOR \ -SED \ -GREP \ -EGREP \ -FGREP \ -LD \ -NM \ -LN_S \ -lt_SP2NL \ -lt_NL2SP \ -reload_flag \ -OBJDUMP \ -deplibs_check_method \ -file_magic_cmd \ -file_magic_glob \ -want_nocaseglob \ -DLLTOOL \ -sharedlib_from_linklib_cmd \ -AR \ -AR_FLAGS \ -archiver_list_spec \ -STRIP \ -RANLIB \ -CC \ -CFLAGS \ -compiler \ -lt_cv_sys_global_symbol_pipe \ -lt_cv_sys_global_symbol_to_cdecl \ -lt_cv_sys_global_symbol_to_import \ -lt_cv_sys_global_symbol_to_c_name_address \ -lt_cv_sys_global_symbol_to_c_name_address_lib_prefix \ -lt_cv_nm_interface \ -nm_file_list_spec \ -lt_cv_truncate_bin \ -lt_prog_compiler_no_builtin_flag \ -lt_prog_compiler_pic \ -lt_prog_compiler_wl \ -lt_prog_compiler_static \ -lt_cv_prog_compiler_c_o \ -need_locks \ -MANIFEST_TOOL \ -DSYMUTIL \ -NMEDIT \ -LIPO \ -OTOOL \ -OTOOL64 \ -shrext_cmds \ -export_dynamic_flag_spec \ -whole_archive_flag_spec \ -compiler_needs_object \ -with_gnu_ld \ -allow_undefined_flag \ -no_undefined_flag \ -hardcode_libdir_flag_spec \ -hardcode_libdir_separator \ -exclude_expsyms \ -include_expsyms \ -file_list_spec \ -variables_saved_for_relink \ -libname_spec \ -library_names_spec \ -soname_spec \ -install_override_mode \ -finish_eval \ -old_striplib \ -striplib \ -compiler_lib_search_dirs \ -predep_objects \ -postdep_objects \ -predeps \ -postdeps \ -compiler_lib_search_path \ -LD_CXX \ -reload_flag_CXX \ -compiler_CXX \ -lt_prog_compiler_no_builtin_flag_CXX \ -lt_prog_compiler_pic_CXX \ -lt_prog_compiler_wl_CXX \ -lt_prog_compiler_static_CXX \ -lt_cv_prog_compiler_c_o_CXX \ -export_dynamic_flag_spec_CXX \ -whole_archive_flag_spec_CXX \ -compiler_needs_object_CXX \ -with_gnu_ld_CXX \ -allow_undefined_flag_CXX \ -no_undefined_flag_CXX \ -hardcode_libdir_flag_spec_CXX \ -hardcode_libdir_separator_CXX \ -exclude_expsyms_CXX \ -include_expsyms_CXX \ -file_list_spec_CXX \ -compiler_lib_search_dirs_CXX \ -predep_objects_CXX \ -postdep_objects_CXX \ -predeps_CXX \ -postdeps_CXX \ -compiler_lib_search_path_CXX; do - case \`eval \\\\\$ECHO \\\\""\\\\\$\$var"\\\\"\` in - *[\\\\\\\`\\"\\\$]*) - eval "lt_\$var=\\\\\\"\\\`\\\$ECHO \\"\\\$\$var\\" | \\\$SED \\"\\\$sed_quote_subst\\"\\\`\\\\\\"" ## exclude from sc_prohibit_nested_quotes - ;; - *) - eval "lt_\$var=\\\\\\"\\\$\$var\\\\\\"" - ;; - esac -done - -# Double-quote double-evaled strings. -for var in reload_cmds \ -old_postinstall_cmds \ -old_postuninstall_cmds \ -old_archive_cmds \ -extract_expsyms_cmds \ -old_archive_from_new_cmds \ -old_archive_from_expsyms_cmds \ -archive_cmds \ -archive_expsym_cmds \ -module_cmds \ -module_expsym_cmds \ -export_symbols_cmds \ -prelink_cmds \ -postlink_cmds \ -postinstall_cmds \ -postuninstall_cmds \ -finish_cmds \ -sys_lib_search_path_spec \ -configure_time_dlsearch_path \ -configure_time_lt_sys_library_path \ -reload_cmds_CXX \ -old_archive_cmds_CXX \ -old_archive_from_new_cmds_CXX \ -old_archive_from_expsyms_cmds_CXX \ -archive_cmds_CXX \ -archive_expsym_cmds_CXX \ -module_cmds_CXX \ -module_expsym_cmds_CXX \ -export_symbols_cmds_CXX \ -prelink_cmds_CXX \ -postlink_cmds_CXX; do - case \`eval \\\\\$ECHO \\\\""\\\\\$\$var"\\\\"\` in - *[\\\\\\\`\\"\\\$]*) - eval "lt_\$var=\\\\\\"\\\`\\\$ECHO \\"\\\$\$var\\" | \\\$SED -e \\"\\\$double_quote_subst\\" -e \\"\\\$sed_quote_subst\\" -e \\"\\\$delay_variable_subst\\"\\\`\\\\\\"" ## exclude from sc_prohibit_nested_quotes - ;; - *) - eval "lt_\$var=\\\\\\"\\\$\$var\\\\\\"" - ;; - esac -done - -ac_aux_dir='$ac_aux_dir' - -# See if we are running on zsh, and set the options that allow our -# commands through without removal of \ escapes INIT. -if test -n "\${ZSH_VERSION+set}"; then - setopt NO_GLOB_SUBST -fi - - - PACKAGE='$PACKAGE' - VERSION='$VERSION' - RM='$RM' - ofile='$ofile' - - - - - - -_ACEOF - -cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 - -# Handling of arguments. -for ac_config_target in $ac_config_targets -do - case $ac_config_target in - "config.h") CONFIG_HEADERS="$CONFIG_HEADERS config.h" ;; - "depfiles") CONFIG_COMMANDS="$CONFIG_COMMANDS depfiles" ;; - "libtool") CONFIG_COMMANDS="$CONFIG_COMMANDS libtool" ;; - "Makefile") CONFIG_FILES="$CONFIG_FILES Makefile" ;; - "src/Makefile") CONFIG_FILES="$CONFIG_FILES src/Makefile" ;; - "benchmarks/Makefile") CONFIG_FILES="$CONFIG_FILES benchmarks/Makefile" ;; - "conformance/Makefile") CONFIG_FILES="$CONFIG_FILES conformance/Makefile" ;; - "protobuf.pc") CONFIG_FILES="$CONFIG_FILES protobuf.pc" ;; - "protobuf-lite.pc") CONFIG_FILES="$CONFIG_FILES protobuf-lite.pc" ;; - - *) as_fn_error $? "invalid argument: \`$ac_config_target'" "$LINENO" 5;; - esac -done - - -# If the user did not use the arguments to specify the items to instantiate, -# then the envvar interface is used. Set only those that are not. -# We use the long form for the default assignment because of an extremely -# bizarre bug on SunOS 4.1.3. -if $ac_need_defaults; then - test ${CONFIG_FILES+y} || CONFIG_FILES=$config_files - test ${CONFIG_HEADERS+y} || CONFIG_HEADERS=$config_headers - test ${CONFIG_COMMANDS+y} || CONFIG_COMMANDS=$config_commands -fi - -# Have a temporary directory for convenience. Make it in the build tree -# simply because there is no reason against having it here, and in addition, -# creating and moving files from /tmp can sometimes cause problems. -# Hook for its removal unless debugging. -# Note that there is a small window in which the directory will not be cleaned: -# after its creation but before its name has been assigned to `$tmp'. -$debug || -{ - tmp= ac_tmp= - trap 'exit_status=$? - : "${ac_tmp:=$tmp}" - { test ! -d "$ac_tmp" || rm -fr "$ac_tmp"; } && exit $exit_status -' 0 - trap 'as_fn_exit 1' 1 2 13 15 -} -# Create a (secure) tmp directory for tmp files. - -{ - tmp=`(umask 077 && mktemp -d "./confXXXXXX") 2>/dev/null` && - test -d "$tmp" -} || -{ - tmp=./conf$$-$RANDOM - (umask 077 && mkdir "$tmp") -} || as_fn_error $? "cannot create a temporary directory in ." "$LINENO" 5 -ac_tmp=$tmp - -# Set up the scripts for CONFIG_FILES section. -# No need to generate them if there are no CONFIG_FILES. -# This happens for instance with `./config.status config.h'. -if test -n "$CONFIG_FILES"; then - - -ac_cr=`echo X | tr X '\015'` -# On cygwin, bash can eat \r inside `` if the user requested igncr. -# But we know of no other shell where ac_cr would be empty at this -# point, so we can use a bashism as a fallback. -if test "x$ac_cr" = x; then - eval ac_cr=\$\'\\r\' -fi -ac_cs_awk_cr=`$AWK 'BEGIN { print "a\rb" }' /dev/null` -if test "$ac_cs_awk_cr" = "a${ac_cr}b"; then - ac_cs_awk_cr='\\r' -else - ac_cs_awk_cr=$ac_cr -fi - -echo 'BEGIN {' >"$ac_tmp/subs1.awk" && -_ACEOF - - -{ - echo "cat >conf$$subs.awk <<_ACEOF" && - echo "$ac_subst_vars" | sed 's/.*/&!$&$ac_delim/' && - echo "_ACEOF" -} >conf$$subs.sh || - as_fn_error $? "could not make $CONFIG_STATUS" "$LINENO" 5 -ac_delim_num=`echo "$ac_subst_vars" | grep -c '^'` -ac_delim='%!_!# ' -for ac_last_try in false false false false false :; do - . ./conf$$subs.sh || - as_fn_error $? "could not make $CONFIG_STATUS" "$LINENO" 5 - - ac_delim_n=`sed -n "s/.*$ac_delim\$/X/p" conf$$subs.awk | grep -c X` - if test $ac_delim_n = $ac_delim_num; then - break - elif $ac_last_try; then - as_fn_error $? "could not make $CONFIG_STATUS" "$LINENO" 5 - else - ac_delim="$ac_delim!$ac_delim _$ac_delim!! " - fi -done -rm -f conf$$subs.sh - -cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 -cat >>"\$ac_tmp/subs1.awk" <<\\_ACAWK && -_ACEOF -sed -n ' -h -s/^/S["/; s/!.*/"]=/ -p -g -s/^[^!]*!// -:repl -t repl -s/'"$ac_delim"'$// -t delim -:nl -h -s/\(.\{148\}\)..*/\1/ -t more1 -s/["\\]/\\&/g; s/^/"/; s/$/\\n"\\/ -p -n -b repl -:more1 -s/["\\]/\\&/g; s/^/"/; s/$/"\\/ -p -g -s/.\{148\}// -t nl -:delim -h -s/\(.\{148\}\)..*/\1/ -t more2 -s/["\\]/\\&/g; s/^/"/; s/$/"/ -p -b -:more2 -s/["\\]/\\&/g; s/^/"/; s/$/"\\/ -p -g -s/.\{148\}// -t delim -' >$CONFIG_STATUS || ac_write_fail=1 -rm -f conf$$subs.awk -cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 -_ACAWK -cat >>"\$ac_tmp/subs1.awk" <<_ACAWK && - for (key in S) S_is_set[key] = 1 - FS = "" - -} -{ - line = $ 0 - nfields = split(line, field, "@") - substed = 0 - len = length(field[1]) - for (i = 2; i < nfields; i++) { - key = field[i] - keylen = length(key) - if (S_is_set[key]) { - value = S[key] - line = substr(line, 1, len) "" value "" substr(line, len + keylen + 3) - len += length(value) + length(field[++i]) - substed = 1 - } else - len += 1 + keylen - } - - print line -} - -_ACAWK -_ACEOF -cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 -if sed "s/$ac_cr//" < /dev/null > /dev/null 2>&1; then - sed "s/$ac_cr\$//; s/$ac_cr/$ac_cs_awk_cr/g" -else - cat -fi < "$ac_tmp/subs1.awk" > "$ac_tmp/subs.awk" \ - || as_fn_error $? "could not setup config files machinery" "$LINENO" 5 -_ACEOF - -# VPATH may cause trouble with some makes, so we remove sole $(srcdir), -# ${srcdir} and @srcdir@ entries from VPATH if srcdir is ".", strip leading and -# trailing colons and then remove the whole line if VPATH becomes empty -# (actually we leave an empty line to preserve line numbers). -if test "x$srcdir" = x.; then - ac_vpsub='/^[ ]*VPATH[ ]*=[ ]*/{ -h -s/// -s/^/:/ -s/[ ]*$/:/ -s/:\$(srcdir):/:/g -s/:\${srcdir}:/:/g -s/:@srcdir@:/:/g -s/^:*// -s/:*$// -x -s/\(=[ ]*\).*/\1/ -G -s/\n// -s/^[^=]*=[ ]*$// -}' -fi - -cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 -fi # test -n "$CONFIG_FILES" - -# Set up the scripts for CONFIG_HEADERS section. -# No need to generate them if there are no CONFIG_HEADERS. -# This happens for instance with `./config.status Makefile'. -if test -n "$CONFIG_HEADERS"; then -cat >"$ac_tmp/defines.awk" <<\_ACAWK || -BEGIN { -_ACEOF - -# Transform confdefs.h into an awk script `defines.awk', embedded as -# here-document in config.status, that substitutes the proper values into -# config.h.in to produce config.h. - -# Create a delimiter string that does not exist in confdefs.h, to ease -# handling of long lines. -ac_delim='%!_!# ' -for ac_last_try in false false :; do - ac_tt=`sed -n "/$ac_delim/p" confdefs.h` - if test -z "$ac_tt"; then - break - elif $ac_last_try; then - as_fn_error $? "could not make $CONFIG_HEADERS" "$LINENO" 5 - else - ac_delim="$ac_delim!$ac_delim _$ac_delim!! " - fi -done - -# For the awk script, D is an array of macro values keyed by name, -# likewise P contains macro parameters if any. Preserve backslash -# newline sequences. - -ac_word_re=[_$as_cr_Letters][_$as_cr_alnum]* -sed -n ' -s/.\{148\}/&'"$ac_delim"'/g -t rset -:rset -s/^[ ]*#[ ]*define[ ][ ]*/ / -t def -d -:def -s/\\$// -t bsnl -s/["\\]/\\&/g -s/^ \('"$ac_word_re"'\)\(([^()]*)\)[ ]*\(.*\)/P["\1"]="\2"\ -D["\1"]=" \3"/p -s/^ \('"$ac_word_re"'\)[ ]*\(.*\)/D["\1"]=" \2"/p -d -:bsnl -s/["\\]/\\&/g -s/^ \('"$ac_word_re"'\)\(([^()]*)\)[ ]*\(.*\)/P["\1"]="\2"\ -D["\1"]=" \3\\\\\\n"\\/p -t cont -s/^ \('"$ac_word_re"'\)[ ]*\(.*\)/D["\1"]=" \2\\\\\\n"\\/p -t cont -d -:cont -n -s/.\{148\}/&'"$ac_delim"'/g -t clear -:clear -s/\\$// -t bsnlc -s/["\\]/\\&/g; s/^/"/; s/$/"/p -d -:bsnlc -s/["\\]/\\&/g; s/^/"/; s/$/\\\\\\n"\\/p -b cont -' >$CONFIG_STATUS || ac_write_fail=1 - -cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 - for (key in D) D_is_set[key] = 1 - FS = "" -} -/^[\t ]*#[\t ]*(define|undef)[\t ]+$ac_word_re([\t (]|\$)/ { - line = \$ 0 - split(line, arg, " ") - if (arg[1] == "#") { - defundef = arg[2] - mac1 = arg[3] - } else { - defundef = substr(arg[1], 2) - mac1 = arg[2] - } - split(mac1, mac2, "(") #) - macro = mac2[1] - prefix = substr(line, 1, index(line, defundef) - 1) - if (D_is_set[macro]) { - # Preserve the white space surrounding the "#". - print prefix "define", macro P[macro] D[macro] - next - } else { - # Replace #undef with comments. This is necessary, for example, - # in the case of _POSIX_SOURCE, which is predefined and required - # on some systems where configure will not decide to define it. - if (defundef == "undef") { - print "/*", prefix defundef, macro, "*/" - next - } - } -} -{ print } -_ACAWK -_ACEOF -cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 - as_fn_error $? "could not setup config headers machinery" "$LINENO" 5 -fi # test -n "$CONFIG_HEADERS" - - -eval set X " :F $CONFIG_FILES :H $CONFIG_HEADERS :C $CONFIG_COMMANDS" -shift -for ac_tag -do - case $ac_tag in - :[FHLC]) ac_mode=$ac_tag; continue;; - esac - case $ac_mode$ac_tag in - :[FHL]*:*);; - :L* | :C*:*) as_fn_error $? "invalid tag \`$ac_tag'" "$LINENO" 5;; - :[FH]-) ac_tag=-:-;; - :[FH]*) ac_tag=$ac_tag:$ac_tag.in;; - esac - ac_save_IFS=$IFS - IFS=: - set x $ac_tag - IFS=$ac_save_IFS - shift - ac_file=$1 - shift - - case $ac_mode in - :L) ac_source=$1;; - :[FH]) - ac_file_inputs= - for ac_f - do - case $ac_f in - -) ac_f="$ac_tmp/stdin";; - *) # Look for the file first in the build tree, then in the source tree - # (if the path is not absolute). The absolute path cannot be DOS-style, - # because $ac_f cannot contain `:'. - test -f "$ac_f" || - case $ac_f in - [\\/$]*) false;; - *) test -f "$srcdir/$ac_f" && ac_f="$srcdir/$ac_f";; - esac || - as_fn_error 1 "cannot find input file: \`$ac_f'" "$LINENO" 5;; - esac - case $ac_f in *\'*) ac_f=`printf "%s\n" "$ac_f" | sed "s/'/'\\\\\\\\''/g"`;; esac - as_fn_append ac_file_inputs " '$ac_f'" - done - - # Let's still pretend it is `configure' which instantiates (i.e., don't - # use $as_me), people would be surprised to read: - # /* config.h. Generated by config.status. */ - configure_input='Generated from '` - printf "%s\n" "$*" | sed 's|^[^:]*/||;s|:[^:]*/|, |g' - `' by configure.' - if test x"$ac_file" != x-; then - configure_input="$ac_file. $configure_input" - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: creating $ac_file" >&5 -printf "%s\n" "$as_me: creating $ac_file" >&6;} - fi - # Neutralize special characters interpreted by sed in replacement strings. - case $configure_input in #( - *\&* | *\|* | *\\* ) - ac_sed_conf_input=`printf "%s\n" "$configure_input" | - sed 's/[\\\\&|]/\\\\&/g'`;; #( - *) ac_sed_conf_input=$configure_input;; - esac - - case $ac_tag in - *:-:* | *:-) cat >"$ac_tmp/stdin" \ - || as_fn_error $? "could not create $ac_file" "$LINENO" 5 ;; - esac - ;; - esac - - ac_dir=`$as_dirname -- "$ac_file" || -$as_expr X"$ac_file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ - X"$ac_file" : 'X\(//\)[^/]' \| \ - X"$ac_file" : 'X\(//\)$' \| \ - X"$ac_file" : 'X\(/\)' \| . 2>/dev/null || -printf "%s\n" X"$ac_file" | - sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ - s//\1/ - q - } - /^X\(\/\/\)[^/].*/{ - s//\1/ - q - } - /^X\(\/\/\)$/{ - s//\1/ - q - } - /^X\(\/\).*/{ - s//\1/ - q - } - s/.*/./; q'` - as_dir="$ac_dir"; as_fn_mkdir_p - ac_builddir=. - -case "$ac_dir" in -.) ac_dir_suffix= ac_top_builddir_sub=. ac_top_build_prefix= ;; -*) - ac_dir_suffix=/`printf "%s\n" "$ac_dir" | sed 's|^\.[\\/]||'` - # A ".." for each directory in $ac_dir_suffix. - ac_top_builddir_sub=`printf "%s\n" "$ac_dir_suffix" | sed 's|/[^\\/]*|/..|g;s|/||'` - case $ac_top_builddir_sub in - "") ac_top_builddir_sub=. ac_top_build_prefix= ;; - *) ac_top_build_prefix=$ac_top_builddir_sub/ ;; - esac ;; -esac -ac_abs_top_builddir=$ac_pwd -ac_abs_builddir=$ac_pwd$ac_dir_suffix -# for backward compatibility: -ac_top_builddir=$ac_top_build_prefix - -case $srcdir in - .) # We are building in place. - ac_srcdir=. - ac_top_srcdir=$ac_top_builddir_sub - ac_abs_top_srcdir=$ac_pwd ;; - [\\/]* | ?:[\\/]* ) # Absolute name. - ac_srcdir=$srcdir$ac_dir_suffix; - ac_top_srcdir=$srcdir - ac_abs_top_srcdir=$srcdir ;; - *) # Relative name. - ac_srcdir=$ac_top_build_prefix$srcdir$ac_dir_suffix - ac_top_srcdir=$ac_top_build_prefix$srcdir - ac_abs_top_srcdir=$ac_pwd/$srcdir ;; -esac -ac_abs_srcdir=$ac_abs_top_srcdir$ac_dir_suffix - - - case $ac_mode in - :F) - # - # CONFIG_FILE - # - - case $INSTALL in - [\\/$]* | ?:[\\/]* ) ac_INSTALL=$INSTALL ;; - *) ac_INSTALL=$ac_top_build_prefix$INSTALL ;; - esac - ac_MKDIR_P=$MKDIR_P - case $MKDIR_P in - [\\/$]* | ?:[\\/]* ) ;; - */*) ac_MKDIR_P=$ac_top_build_prefix$MKDIR_P ;; - esac -_ACEOF - -cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 -# If the template does not know about datarootdir, expand it. -# FIXME: This hack should be removed a few years after 2.60. -ac_datarootdir_hack=; ac_datarootdir_seen= -ac_sed_dataroot=' -/datarootdir/ { - p - q -} -/@datadir@/p -/@docdir@/p -/@infodir@/p -/@localedir@/p -/@mandir@/p' -case `eval "sed -n \"\$ac_sed_dataroot\" $ac_file_inputs"` in -*datarootdir*) ac_datarootdir_seen=yes;; -*@datadir@*|*@docdir@*|*@infodir@*|*@localedir@*|*@mandir@*) - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&5 -printf "%s\n" "$as_me: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&2;} -_ACEOF -cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 - ac_datarootdir_hack=' - s&@datadir@&$datadir&g - s&@docdir@&$docdir&g - s&@infodir@&$infodir&g - s&@localedir@&$localedir&g - s&@mandir@&$mandir&g - s&\\\${datarootdir}&$datarootdir&g' ;; -esac -_ACEOF - -# Neutralize VPATH when `$srcdir' = `.'. -# Shell code in configure.ac might set extrasub. -# FIXME: do we really want to maintain this feature? -cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 -ac_sed_extra="$ac_vpsub -$extrasub -_ACEOF -cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 -:t -/@[a-zA-Z_][a-zA-Z_0-9]*@/!b -s|@configure_input@|$ac_sed_conf_input|;t t -s&@top_builddir@&$ac_top_builddir_sub&;t t -s&@top_build_prefix@&$ac_top_build_prefix&;t t -s&@srcdir@&$ac_srcdir&;t t -s&@abs_srcdir@&$ac_abs_srcdir&;t t -s&@top_srcdir@&$ac_top_srcdir&;t t -s&@abs_top_srcdir@&$ac_abs_top_srcdir&;t t -s&@builddir@&$ac_builddir&;t t -s&@abs_builddir@&$ac_abs_builddir&;t t -s&@abs_top_builddir@&$ac_abs_top_builddir&;t t -s&@INSTALL@&$ac_INSTALL&;t t -s&@MKDIR_P@&$ac_MKDIR_P&;t t -$ac_datarootdir_hack -" -eval sed \"\$ac_sed_extra\" "$ac_file_inputs" | $AWK -f "$ac_tmp/subs.awk" \ - >$ac_tmp/out || as_fn_error $? "could not create $ac_file" "$LINENO" 5 - -test -z "$ac_datarootdir_hack$ac_datarootdir_seen" && - { ac_out=`sed -n '/\${datarootdir}/p' "$ac_tmp/out"`; test -n "$ac_out"; } && - { ac_out=`sed -n '/^[ ]*datarootdir[ ]*:*=/p' \ - "$ac_tmp/out"`; test -z "$ac_out"; } && - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: $ac_file contains a reference to the variable \`datarootdir' -which seems to be undefined. Please make sure it is defined" >&5 -printf "%s\n" "$as_me: WARNING: $ac_file contains a reference to the variable \`datarootdir' -which seems to be undefined. Please make sure it is defined" >&2;} - - rm -f "$ac_tmp/stdin" - case $ac_file in - -) cat "$ac_tmp/out" && rm -f "$ac_tmp/out";; - *) rm -f "$ac_file" && mv "$ac_tmp/out" "$ac_file";; - esac \ - || as_fn_error $? "could not create $ac_file" "$LINENO" 5 - ;; - :H) - # - # CONFIG_HEADER - # - if test x"$ac_file" != x-; then - { - printf "%s\n" "/* $configure_input */" >&1 \ - && eval '$AWK -f "$ac_tmp/defines.awk"' "$ac_file_inputs" - } >"$ac_tmp/config.h" \ - || as_fn_error $? "could not create $ac_file" "$LINENO" 5 - if diff "$ac_file" "$ac_tmp/config.h" >/dev/null 2>&1; then - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: $ac_file is unchanged" >&5 -printf "%s\n" "$as_me: $ac_file is unchanged" >&6;} - else - rm -f "$ac_file" - mv "$ac_tmp/config.h" "$ac_file" \ - || as_fn_error $? "could not create $ac_file" "$LINENO" 5 - fi - else - printf "%s\n" "/* $configure_input */" >&1 \ - && eval '$AWK -f "$ac_tmp/defines.awk"' "$ac_file_inputs" \ - || as_fn_error $? "could not create -" "$LINENO" 5 - fi -# Compute "$ac_file"'s index in $config_headers. -_am_arg="$ac_file" -_am_stamp_count=1 -for _am_header in $config_headers :; do - case $_am_header in - $_am_arg | $_am_arg:* ) - break ;; - * ) - _am_stamp_count=`expr $_am_stamp_count + 1` ;; - esac -done -echo "timestamp for $_am_arg" >`$as_dirname -- "$_am_arg" || -$as_expr X"$_am_arg" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ - X"$_am_arg" : 'X\(//\)[^/]' \| \ - X"$_am_arg" : 'X\(//\)$' \| \ - X"$_am_arg" : 'X\(/\)' \| . 2>/dev/null || -printf "%s\n" X"$_am_arg" | - sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ - s//\1/ - q - } - /^X\(\/\/\)[^/].*/{ - s//\1/ - q - } - /^X\(\/\/\)$/{ - s//\1/ - q - } - /^X\(\/\).*/{ - s//\1/ - q - } - s/.*/./; q'`/stamp-h$_am_stamp_count - ;; - - :C) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: executing $ac_file commands" >&5 -printf "%s\n" "$as_me: executing $ac_file commands" >&6;} - ;; - esac - - - case $ac_file$ac_mode in - "depfiles":C) test x"$AMDEP_TRUE" != x"" || { - # Older Autoconf quotes --file arguments for eval, but not when files - # are listed without --file. Let's play safe and only enable the eval - # if we detect the quoting. - # TODO: see whether this extra hack can be removed once we start - # requiring Autoconf 2.70 or later. - case $CONFIG_FILES in #( - *\'*) : - eval set x "$CONFIG_FILES" ;; #( - *) : - set x $CONFIG_FILES ;; #( - *) : - ;; -esac - shift - # Used to flag and report bootstrapping failures. - am_rc=0 - for am_mf - do - # Strip MF so we end up with the name of the file. - am_mf=`printf "%s\n" "$am_mf" | sed -e 's/:.*$//'` - # Check whether this is an Automake generated Makefile which includes - # dependency-tracking related rules and includes. - # Grep'ing the whole file directly is not great: AIX grep has a line - # limit of 2048, but all sed's we know have understand at least 4000. - sed -n 's,^am--depfiles:.*,X,p' "$am_mf" | grep X >/dev/null 2>&1 \ - || continue - am_dirpart=`$as_dirname -- "$am_mf" || -$as_expr X"$am_mf" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ - X"$am_mf" : 'X\(//\)[^/]' \| \ - X"$am_mf" : 'X\(//\)$' \| \ - X"$am_mf" : 'X\(/\)' \| . 2>/dev/null || -printf "%s\n" X"$am_mf" | - sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ - s//\1/ - q - } - /^X\(\/\/\)[^/].*/{ - s//\1/ - q - } - /^X\(\/\/\)$/{ - s//\1/ - q - } - /^X\(\/\).*/{ - s//\1/ - q - } - s/.*/./; q'` - am_filepart=`$as_basename -- "$am_mf" || -$as_expr X/"$am_mf" : '.*/\([^/][^/]*\)/*$' \| \ - X"$am_mf" : 'X\(//\)$' \| \ - X"$am_mf" : 'X\(/\)' \| . 2>/dev/null || -printf "%s\n" X/"$am_mf" | - sed '/^.*\/\([^/][^/]*\)\/*$/{ - s//\1/ - q - } - /^X\/\(\/\/\)$/{ - s//\1/ - q - } - /^X\/\(\/\).*/{ - s//\1/ - q - } - s/.*/./; q'` - { echo "$as_me:$LINENO: cd "$am_dirpart" \ - && sed -e '/# am--include-marker/d' "$am_filepart" \ - | $MAKE -f - am--depfiles" >&5 - (cd "$am_dirpart" \ - && sed -e '/# am--include-marker/d' "$am_filepart" \ - | $MAKE -f - am--depfiles) >&5 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } || am_rc=$? - done - if test $am_rc -ne 0; then - { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 -printf "%s\n" "$as_me: error: in \`$ac_pwd':" >&2;} -as_fn_error $? "Something went wrong bootstrapping makefile fragments - for automatic dependency tracking. If GNU make was not used, consider - re-running the configure script with MAKE=\"gmake\" (or whatever is - necessary). You can also try re-running configure with the - '--disable-dependency-tracking' option to at least be able to build - the package (albeit without support for automatic dependency tracking). -See \`config.log' for more details" "$LINENO" 5; } - fi - { am_dirpart=; unset am_dirpart;} - { am_filepart=; unset am_filepart;} - { am_mf=; unset am_mf;} - { am_rc=; unset am_rc;} - rm -f conftest-deps.mk -} - ;; - "libtool":C) - - # See if we are running on zsh, and set the options that allow our - # commands through without removal of \ escapes. - if test -n "${ZSH_VERSION+set}"; then - setopt NO_GLOB_SUBST - fi - - cfgfile=${ofile}T - trap "$RM \"$cfgfile\"; exit 1" 1 2 15 - $RM "$cfgfile" - - cat <<_LT_EOF >> "$cfgfile" -#! $SHELL -# Generated automatically by $as_me ($PACKAGE) $VERSION -# NOTE: Changes made to this file will be lost: look at ltmain.sh. - -# Provide generalized library-building support services. -# Written by Gordon Matzigkeit, 1996 - -# Copyright (C) 2014 Free Software Foundation, Inc. -# This is free software; see the source for copying conditions. There is NO -# warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. - -# GNU Libtool is free software; you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation; either version 2 of of the License, or -# (at your option) any later version. -# -# As a special exception to the GNU General Public License, if you -# distribute this file as part of a program or library that is built -# using GNU Libtool, you may include this file under the same -# distribution terms that you use for the rest of that program. -# -# GNU Libtool is distributed in the hope that it will be useful, but -# WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with this program. If not, see . - - -# The names of the tagged configurations supported by this script. -available_tags='CXX ' - -# Configured defaults for sys_lib_dlsearch_path munging. -: \${LT_SYS_LIBRARY_PATH="$configure_time_lt_sys_library_path"} - -# ### BEGIN LIBTOOL CONFIG - -# Which release of libtool.m4 was used? -macro_version=$macro_version -macro_revision=$macro_revision - -# Whether or not to build shared libraries. -build_libtool_libs=$enable_shared - -# Whether or not to build static libraries. -build_old_libs=$enable_static - -# What type of objects to build. -pic_mode=$pic_mode - -# Whether or not to optimize for fast installation. -fast_install=$enable_fast_install - -# Shared archive member basename,for filename based shared library versioning on AIX. -shared_archive_member_spec=$shared_archive_member_spec - -# Shell to use when invoking shell scripts. -SHELL=$lt_SHELL - -# An echo program that protects backslashes. -ECHO=$lt_ECHO - -# The PATH separator for the build system. -PATH_SEPARATOR=$lt_PATH_SEPARATOR - -# The host system. -host_alias=$host_alias -host=$host -host_os=$host_os - -# The build system. -build_alias=$build_alias -build=$build -build_os=$build_os - -# A sed program that does not truncate output. -SED=$lt_SED - -# Sed that helps us avoid accidentally triggering echo(1) options like -n. -Xsed="\$SED -e 1s/^X//" - -# A grep program that handles long lines. -GREP=$lt_GREP - -# An ERE matcher. -EGREP=$lt_EGREP - -# A literal string matcher. -FGREP=$lt_FGREP - -# A BSD- or MS-compatible name lister. -NM=$lt_NM - -# Whether we need soft or hard links. -LN_S=$lt_LN_S - -# What is the maximum length of a command? -max_cmd_len=$max_cmd_len - -# Object file suffix (normally "o"). -objext=$ac_objext - -# Executable file suffix (normally ""). -exeext=$exeext - -# whether the shell understands "unset". -lt_unset=$lt_unset - -# turn spaces into newlines. -SP2NL=$lt_lt_SP2NL - -# turn newlines into spaces. -NL2SP=$lt_lt_NL2SP - -# convert \$build file names to \$host format. -to_host_file_cmd=$lt_cv_to_host_file_cmd - -# convert \$build files to toolchain format. -to_tool_file_cmd=$lt_cv_to_tool_file_cmd - -# An object symbol dumper. -OBJDUMP=$lt_OBJDUMP - -# Method to check whether dependent libraries are shared objects. -deplibs_check_method=$lt_deplibs_check_method - -# Command to use when deplibs_check_method = "file_magic". -file_magic_cmd=$lt_file_magic_cmd - -# How to find potential files when deplibs_check_method = "file_magic". -file_magic_glob=$lt_file_magic_glob - -# Find potential files using nocaseglob when deplibs_check_method = "file_magic". -want_nocaseglob=$lt_want_nocaseglob - -# DLL creation program. -DLLTOOL=$lt_DLLTOOL - -# Command to associate shared and link libraries. -sharedlib_from_linklib_cmd=$lt_sharedlib_from_linklib_cmd - -# The archiver. -AR=$lt_AR - -# Flags to create an archive. -AR_FLAGS=$lt_AR_FLAGS - -# How to feed a file listing to the archiver. -archiver_list_spec=$lt_archiver_list_spec - -# A symbol stripping program. -STRIP=$lt_STRIP - -# Commands used to install an old-style archive. -RANLIB=$lt_RANLIB -old_postinstall_cmds=$lt_old_postinstall_cmds -old_postuninstall_cmds=$lt_old_postuninstall_cmds - -# Whether to use a lock for old archive extraction. -lock_old_archive_extraction=$lock_old_archive_extraction - -# A C compiler. -LTCC=$lt_CC - -# LTCC compiler flags. -LTCFLAGS=$lt_CFLAGS - -# Take the output of nm and produce a listing of raw symbols and C names. -global_symbol_pipe=$lt_lt_cv_sys_global_symbol_pipe - -# Transform the output of nm in a proper C declaration. -global_symbol_to_cdecl=$lt_lt_cv_sys_global_symbol_to_cdecl - -# Transform the output of nm into a list of symbols to manually relocate. -global_symbol_to_import=$lt_lt_cv_sys_global_symbol_to_import - -# Transform the output of nm in a C name address pair. -global_symbol_to_c_name_address=$lt_lt_cv_sys_global_symbol_to_c_name_address - -# Transform the output of nm in a C name address pair when lib prefix is needed. -global_symbol_to_c_name_address_lib_prefix=$lt_lt_cv_sys_global_symbol_to_c_name_address_lib_prefix - -# The name lister interface. -nm_interface=$lt_lt_cv_nm_interface - -# Specify filename containing input files for \$NM. -nm_file_list_spec=$lt_nm_file_list_spec - -# The root where to search for dependent libraries,and where our libraries should be installed. -lt_sysroot=$lt_sysroot - -# Command to truncate a binary pipe. -lt_truncate_bin=$lt_lt_cv_truncate_bin - -# The name of the directory that contains temporary libtool files. -objdir=$objdir - -# Used to examine libraries when file_magic_cmd begins with "file". -MAGIC_CMD=$MAGIC_CMD - -# Must we lock files when doing compilation? -need_locks=$lt_need_locks - -# Manifest tool. -MANIFEST_TOOL=$lt_MANIFEST_TOOL - -# Tool to manipulate archived DWARF debug symbol files on Mac OS X. -DSYMUTIL=$lt_DSYMUTIL - -# Tool to change global to local symbols on Mac OS X. -NMEDIT=$lt_NMEDIT - -# Tool to manipulate fat objects and archives on Mac OS X. -LIPO=$lt_LIPO - -# ldd/readelf like tool for Mach-O binaries on Mac OS X. -OTOOL=$lt_OTOOL - -# ldd/readelf like tool for 64 bit Mach-O binaries on Mac OS X 10.4. -OTOOL64=$lt_OTOOL64 - -# Old archive suffix (normally "a"). -libext=$libext - -# Shared library suffix (normally ".so"). -shrext_cmds=$lt_shrext_cmds - -# The commands to extract the exported symbol list from a shared archive. -extract_expsyms_cmds=$lt_extract_expsyms_cmds - -# Variables whose values should be saved in libtool wrapper scripts and -# restored at link time. -variables_saved_for_relink=$lt_variables_saved_for_relink - -# Do we need the "lib" prefix for modules? -need_lib_prefix=$need_lib_prefix - -# Do we need a version for libraries? -need_version=$need_version - -# Library versioning type. -version_type=$version_type - -# Shared library runtime path variable. -runpath_var=$runpath_var - -# Shared library path variable. -shlibpath_var=$shlibpath_var - -# Is shlibpath searched before the hard-coded library search path? -shlibpath_overrides_runpath=$shlibpath_overrides_runpath - -# Format of library name prefix. -libname_spec=$lt_libname_spec - -# List of archive names. First name is the real one, the rest are links. -# The last name is the one that the linker finds with -lNAME -library_names_spec=$lt_library_names_spec - -# The coded name of the library, if different from the real name. -soname_spec=$lt_soname_spec - -# Permission mode override for installation of shared libraries. -install_override_mode=$lt_install_override_mode - -# Command to use after installation of a shared archive. -postinstall_cmds=$lt_postinstall_cmds - -# Command to use after uninstallation of a shared archive. -postuninstall_cmds=$lt_postuninstall_cmds - -# Commands used to finish a libtool library installation in a directory. -finish_cmds=$lt_finish_cmds - -# As "finish_cmds", except a single script fragment to be evaled but -# not shown. -finish_eval=$lt_finish_eval - -# Whether we should hardcode library paths into libraries. -hardcode_into_libs=$hardcode_into_libs - -# Compile-time system search path for libraries. -sys_lib_search_path_spec=$lt_sys_lib_search_path_spec - -# Detected run-time system search path for libraries. -sys_lib_dlsearch_path_spec=$lt_configure_time_dlsearch_path - -# Explicit LT_SYS_LIBRARY_PATH set during ./configure time. -configure_time_lt_sys_library_path=$lt_configure_time_lt_sys_library_path - -# Whether dlopen is supported. -dlopen_support=$enable_dlopen - -# Whether dlopen of programs is supported. -dlopen_self=$enable_dlopen_self - -# Whether dlopen of statically linked programs is supported. -dlopen_self_static=$enable_dlopen_self_static - -# Commands to strip libraries. -old_striplib=$lt_old_striplib -striplib=$lt_striplib - - -# The linker used to build libraries. -LD=$lt_LD - -# How to create reloadable object files. -reload_flag=$lt_reload_flag -reload_cmds=$lt_reload_cmds - -# Commands used to build an old-style archive. -old_archive_cmds=$lt_old_archive_cmds - -# A language specific compiler. -CC=$lt_compiler - -# Is the compiler the GNU compiler? -with_gcc=$GCC - -# Compiler flag to turn off builtin functions. -no_builtin_flag=$lt_lt_prog_compiler_no_builtin_flag - -# Additional compiler flags for building library objects. -pic_flag=$lt_lt_prog_compiler_pic - -# How to pass a linker flag through the compiler. -wl=$lt_lt_prog_compiler_wl - -# Compiler flag to prevent dynamic linking. -link_static_flag=$lt_lt_prog_compiler_static - -# Does compiler simultaneously support -c and -o options? -compiler_c_o=$lt_lt_cv_prog_compiler_c_o - -# Whether or not to add -lc for building shared libraries. -build_libtool_need_lc=$archive_cmds_need_lc - -# Whether or not to disallow shared libs when runtime libs are static. -allow_libtool_libs_with_static_runtimes=$enable_shared_with_static_runtimes - -# Compiler flag to allow reflexive dlopens. -export_dynamic_flag_spec=$lt_export_dynamic_flag_spec - -# Compiler flag to generate shared objects directly from archives. -whole_archive_flag_spec=$lt_whole_archive_flag_spec - -# Whether the compiler copes with passing no objects directly. -compiler_needs_object=$lt_compiler_needs_object - -# Create an old-style archive from a shared archive. -old_archive_from_new_cmds=$lt_old_archive_from_new_cmds - -# Create a temporary old-style archive to link instead of a shared archive. -old_archive_from_expsyms_cmds=$lt_old_archive_from_expsyms_cmds - -# Commands used to build a shared archive. -archive_cmds=$lt_archive_cmds -archive_expsym_cmds=$lt_archive_expsym_cmds - -# Commands used to build a loadable module if different from building -# a shared archive. -module_cmds=$lt_module_cmds -module_expsym_cmds=$lt_module_expsym_cmds - -# Whether we are building with GNU ld or not. -with_gnu_ld=$lt_with_gnu_ld - -# Flag that allows shared libraries with undefined symbols to be built. -allow_undefined_flag=$lt_allow_undefined_flag - -# Flag that enforces no undefined symbols. -no_undefined_flag=$lt_no_undefined_flag - -# Flag to hardcode \$libdir into a binary during linking. -# This must work even if \$libdir does not exist -hardcode_libdir_flag_spec=$lt_hardcode_libdir_flag_spec - -# Whether we need a single "-rpath" flag with a separated argument. -hardcode_libdir_separator=$lt_hardcode_libdir_separator - -# Set to "yes" if using DIR/libNAME\$shared_ext during linking hardcodes -# DIR into the resulting binary. -hardcode_direct=$hardcode_direct - -# Set to "yes" if using DIR/libNAME\$shared_ext during linking hardcodes -# DIR into the resulting binary and the resulting library dependency is -# "absolute",i.e impossible to change by setting \$shlibpath_var if the -# library is relocated. -hardcode_direct_absolute=$hardcode_direct_absolute - -# Set to "yes" if using the -LDIR flag during linking hardcodes DIR -# into the resulting binary. -hardcode_minus_L=$hardcode_minus_L - -# Set to "yes" if using SHLIBPATH_VAR=DIR during linking hardcodes DIR -# into the resulting binary. -hardcode_shlibpath_var=$hardcode_shlibpath_var - -# Set to "yes" if building a shared library automatically hardcodes DIR -# into the library and all subsequent libraries and executables linked -# against it. -hardcode_automatic=$hardcode_automatic - -# Set to yes if linker adds runtime paths of dependent libraries -# to runtime path list. -inherit_rpath=$inherit_rpath - -# Whether libtool must link a program against all its dependency libraries. -link_all_deplibs=$link_all_deplibs - -# Set to "yes" if exported symbols are required. -always_export_symbols=$always_export_symbols - -# The commands to list exported symbols. -export_symbols_cmds=$lt_export_symbols_cmds - -# Symbols that should not be listed in the preloaded symbols. -exclude_expsyms=$lt_exclude_expsyms - -# Symbols that must always be exported. -include_expsyms=$lt_include_expsyms - -# Commands necessary for linking programs (against libraries) with templates. -prelink_cmds=$lt_prelink_cmds - -# Commands necessary for finishing linking programs. -postlink_cmds=$lt_postlink_cmds - -# Specify filename containing input files. -file_list_spec=$lt_file_list_spec - -# How to hardcode a shared library path into an executable. -hardcode_action=$hardcode_action - -# The directories searched by this compiler when creating a shared library. -compiler_lib_search_dirs=$lt_compiler_lib_search_dirs - -# Dependencies to place before and after the objects being linked to -# create a shared library. -predep_objects=$lt_predep_objects -postdep_objects=$lt_postdep_objects -predeps=$lt_predeps -postdeps=$lt_postdeps - -# The library search path used internally by the compiler when linking -# a shared library. -compiler_lib_search_path=$lt_compiler_lib_search_path - -# ### END LIBTOOL CONFIG - -_LT_EOF - - cat <<'_LT_EOF' >> "$cfgfile" - -# ### BEGIN FUNCTIONS SHARED WITH CONFIGURE - -# func_munge_path_list VARIABLE PATH -# ----------------------------------- -# VARIABLE is name of variable containing _space_ separated list of -# directories to be munged by the contents of PATH, which is string -# having a format: -# "DIR[:DIR]:" -# string "DIR[ DIR]" will be prepended to VARIABLE -# ":DIR[:DIR]" -# string "DIR[ DIR]" will be appended to VARIABLE -# "DIRP[:DIRP]::[DIRA:]DIRA" -# string "DIRP[ DIRP]" will be prepended to VARIABLE and string -# "DIRA[ DIRA]" will be appended to VARIABLE -# "DIR[:DIR]" -# VARIABLE will be replaced by "DIR[ DIR]" -func_munge_path_list () -{ - case x$2 in - x) - ;; - *:) - eval $1=\"`$ECHO $2 | $SED 's/:/ /g'` \$$1\" - ;; - x:*) - eval $1=\"\$$1 `$ECHO $2 | $SED 's/:/ /g'`\" - ;; - *::*) - eval $1=\"\$$1\ `$ECHO $2 | $SED -e 's/.*:://' -e 's/:/ /g'`\" - eval $1=\"`$ECHO $2 | $SED -e 's/::.*//' -e 's/:/ /g'`\ \$$1\" - ;; - *) - eval $1=\"`$ECHO $2 | $SED 's/:/ /g'`\" - ;; - esac -} - - -# Calculate cc_basename. Skip known compiler wrappers and cross-prefix. -func_cc_basename () -{ - for cc_temp in $*""; do - case $cc_temp in - compile | *[\\/]compile | ccache | *[\\/]ccache ) ;; - distcc | *[\\/]distcc | purify | *[\\/]purify ) ;; - \-*) ;; - *) break;; - esac - done - func_cc_basename_result=`$ECHO "$cc_temp" | $SED "s%.*/%%; s%^$host_alias-%%"` -} - - -# ### END FUNCTIONS SHARED WITH CONFIGURE - -_LT_EOF - - case $host_os in - aix3*) - cat <<\_LT_EOF >> "$cfgfile" -# AIX sometimes has problems with the GCC collect2 program. For some -# reason, if we set the COLLECT_NAMES environment variable, the problems -# vanish in a puff of smoke. -if test set != "${COLLECT_NAMES+set}"; then - COLLECT_NAMES= - export COLLECT_NAMES -fi -_LT_EOF - ;; - esac - - - -ltmain=$ac_aux_dir/ltmain.sh - - - # We use sed instead of cat because bash on DJGPP gets confused if - # if finds mixed CR/LF and LF-only lines. Since sed operates in - # text mode, it properly converts lines to CR/LF. This bash problem - # is reportedly fixed, but why not run on old versions too? - sed '$q' "$ltmain" >> "$cfgfile" \ - || (rm -f "$cfgfile"; exit 1) - - mv -f "$cfgfile" "$ofile" || - (rm -f "$ofile" && cp "$cfgfile" "$ofile" && rm -f "$cfgfile") - chmod +x "$ofile" - - - cat <<_LT_EOF >> "$ofile" - -# ### BEGIN LIBTOOL TAG CONFIG: CXX - -# The linker used to build libraries. -LD=$lt_LD_CXX - -# How to create reloadable object files. -reload_flag=$lt_reload_flag_CXX -reload_cmds=$lt_reload_cmds_CXX - -# Commands used to build an old-style archive. -old_archive_cmds=$lt_old_archive_cmds_CXX - -# A language specific compiler. -CC=$lt_compiler_CXX - -# Is the compiler the GNU compiler? -with_gcc=$GCC_CXX - -# Compiler flag to turn off builtin functions. -no_builtin_flag=$lt_lt_prog_compiler_no_builtin_flag_CXX - -# Additional compiler flags for building library objects. -pic_flag=$lt_lt_prog_compiler_pic_CXX - -# How to pass a linker flag through the compiler. -wl=$lt_lt_prog_compiler_wl_CXX - -# Compiler flag to prevent dynamic linking. -link_static_flag=$lt_lt_prog_compiler_static_CXX - -# Does compiler simultaneously support -c and -o options? -compiler_c_o=$lt_lt_cv_prog_compiler_c_o_CXX - -# Whether or not to add -lc for building shared libraries. -build_libtool_need_lc=$archive_cmds_need_lc_CXX - -# Whether or not to disallow shared libs when runtime libs are static. -allow_libtool_libs_with_static_runtimes=$enable_shared_with_static_runtimes_CXX - -# Compiler flag to allow reflexive dlopens. -export_dynamic_flag_spec=$lt_export_dynamic_flag_spec_CXX - -# Compiler flag to generate shared objects directly from archives. -whole_archive_flag_spec=$lt_whole_archive_flag_spec_CXX - -# Whether the compiler copes with passing no objects directly. -compiler_needs_object=$lt_compiler_needs_object_CXX - -# Create an old-style archive from a shared archive. -old_archive_from_new_cmds=$lt_old_archive_from_new_cmds_CXX - -# Create a temporary old-style archive to link instead of a shared archive. -old_archive_from_expsyms_cmds=$lt_old_archive_from_expsyms_cmds_CXX - -# Commands used to build a shared archive. -archive_cmds=$lt_archive_cmds_CXX -archive_expsym_cmds=$lt_archive_expsym_cmds_CXX - -# Commands used to build a loadable module if different from building -# a shared archive. -module_cmds=$lt_module_cmds_CXX -module_expsym_cmds=$lt_module_expsym_cmds_CXX - -# Whether we are building with GNU ld or not. -with_gnu_ld=$lt_with_gnu_ld_CXX - -# Flag that allows shared libraries with undefined symbols to be built. -allow_undefined_flag=$lt_allow_undefined_flag_CXX - -# Flag that enforces no undefined symbols. -no_undefined_flag=$lt_no_undefined_flag_CXX - -# Flag to hardcode \$libdir into a binary during linking. -# This must work even if \$libdir does not exist -hardcode_libdir_flag_spec=$lt_hardcode_libdir_flag_spec_CXX - -# Whether we need a single "-rpath" flag with a separated argument. -hardcode_libdir_separator=$lt_hardcode_libdir_separator_CXX - -# Set to "yes" if using DIR/libNAME\$shared_ext during linking hardcodes -# DIR into the resulting binary. -hardcode_direct=$hardcode_direct_CXX - -# Set to "yes" if using DIR/libNAME\$shared_ext during linking hardcodes -# DIR into the resulting binary and the resulting library dependency is -# "absolute",i.e impossible to change by setting \$shlibpath_var if the -# library is relocated. -hardcode_direct_absolute=$hardcode_direct_absolute_CXX - -# Set to "yes" if using the -LDIR flag during linking hardcodes DIR -# into the resulting binary. -hardcode_minus_L=$hardcode_minus_L_CXX - -# Set to "yes" if using SHLIBPATH_VAR=DIR during linking hardcodes DIR -# into the resulting binary. -hardcode_shlibpath_var=$hardcode_shlibpath_var_CXX - -# Set to "yes" if building a shared library automatically hardcodes DIR -# into the library and all subsequent libraries and executables linked -# against it. -hardcode_automatic=$hardcode_automatic_CXX - -# Set to yes if linker adds runtime paths of dependent libraries -# to runtime path list. -inherit_rpath=$inherit_rpath_CXX - -# Whether libtool must link a program against all its dependency libraries. -link_all_deplibs=$link_all_deplibs_CXX - -# Set to "yes" if exported symbols are required. -always_export_symbols=$always_export_symbols_CXX - -# The commands to list exported symbols. -export_symbols_cmds=$lt_export_symbols_cmds_CXX - -# Symbols that should not be listed in the preloaded symbols. -exclude_expsyms=$lt_exclude_expsyms_CXX - -# Symbols that must always be exported. -include_expsyms=$lt_include_expsyms_CXX - -# Commands necessary for linking programs (against libraries) with templates. -prelink_cmds=$lt_prelink_cmds_CXX - -# Commands necessary for finishing linking programs. -postlink_cmds=$lt_postlink_cmds_CXX - -# Specify filename containing input files. -file_list_spec=$lt_file_list_spec_CXX - -# How to hardcode a shared library path into an executable. -hardcode_action=$hardcode_action_CXX - -# The directories searched by this compiler when creating a shared library. -compiler_lib_search_dirs=$lt_compiler_lib_search_dirs_CXX - -# Dependencies to place before and after the objects being linked to -# create a shared library. -predep_objects=$lt_predep_objects_CXX -postdep_objects=$lt_postdep_objects_CXX -predeps=$lt_predeps_CXX -postdeps=$lt_postdeps_CXX - -# The library search path used internally by the compiler when linking -# a shared library. -compiler_lib_search_path=$lt_compiler_lib_search_path_CXX - -# ### END LIBTOOL TAG CONFIG: CXX -_LT_EOF - - ;; - - esac -done # for ac_tag - - -as_fn_exit 0 -_ACEOF -ac_clean_files=$ac_clean_files_save - -test $ac_write_fail = 0 || - as_fn_error $? "write failure creating $CONFIG_STATUS" "$LINENO" 5 - - -# configure is writing to config.log, and then calls config.status. -# config.status does its own redirection, appending to config.log. -# Unfortunately, on DOS this fails, as config.log is still kept open -# by configure, so config.status won't be able to write to it; its -# output is simply discarded. So we exec the FD to /dev/null, -# effectively closing config.log, so it can be properly (re)opened and -# appended to by config.status. When coming back to configure, we -# need to make the FD available again. -if test "$no_create" != yes; then - ac_cs_success=: - ac_config_status_args= - test "$silent" = yes && - ac_config_status_args="$ac_config_status_args --quiet" - exec 5>/dev/null - $SHELL $CONFIG_STATUS $ac_config_status_args || ac_cs_success=false - exec 5>>config.log - # Use ||, not &&, to avoid exiting from the if with $? = 1, which - # would make configure fail if this is the last instruction. - $ac_cs_success || as_fn_exit 1 -fi - -# -# CONFIG_SUBDIRS section. -# -if test "$no_recursion" != yes; then - - # Remove --cache-file, --srcdir, and --disable-option-checking arguments - # so they do not pile up. - ac_sub_configure_args= - ac_prev= - eval "set x $ac_configure_args" - shift - for ac_arg - do - if test -n "$ac_prev"; then - ac_prev= - continue - fi - case $ac_arg in - -cache-file | --cache-file | --cache-fil | --cache-fi \ - | --cache-f | --cache- | --cache | --cach | --cac | --ca | --c) - ac_prev=cache_file ;; - -cache-file=* | --cache-file=* | --cache-fil=* | --cache-fi=* \ - | --cache-f=* | --cache-=* | --cache=* | --cach=* | --cac=* | --ca=* \ - | --c=*) - ;; - --config-cache | -C) - ;; - -srcdir | --srcdir | --srcdi | --srcd | --src | --sr) - ac_prev=srcdir ;; - -srcdir=* | --srcdir=* | --srcdi=* | --srcd=* | --src=* | --sr=*) - ;; - -prefix | --prefix | --prefi | --pref | --pre | --pr | --p) - ac_prev=prefix ;; - -prefix=* | --prefix=* | --prefi=* | --pref=* | --pre=* | --pr=* | --p=*) - ;; - --disable-option-checking) - ;; - *) - case $ac_arg in - *\'*) ac_arg=`printf "%s\n" "$ac_arg" | sed "s/'/'\\\\\\\\''/g"` ;; - esac - as_fn_append ac_sub_configure_args " '$ac_arg'" ;; - esac - done - - # Always prepend --prefix to ensure using the same prefix - # in subdir configurations. - ac_arg="--prefix=$prefix" - case $ac_arg in - *\'*) ac_arg=`printf "%s\n" "$ac_arg" | sed "s/'/'\\\\\\\\''/g"` ;; - esac - ac_sub_configure_args="'$ac_arg' $ac_sub_configure_args" - - # Pass --silent - if test "$silent" = yes; then - ac_sub_configure_args="--silent $ac_sub_configure_args" - fi - - # Always prepend --disable-option-checking to silence warnings, since - # different subdirs can have different --enable and --with options. - ac_sub_configure_args="--disable-option-checking $ac_sub_configure_args" - - ac_popdir=`pwd` - for ac_dir in : $subdirs; do test "x$ac_dir" = x: && continue - - # Do not complain, so a configure script can configure whichever - # parts of a large source tree are present. - test -d "$srcdir/$ac_dir" || continue - - ac_msg="=== configuring in $ac_dir (`pwd`/$ac_dir)" - printf "%s\n" "$as_me:${as_lineno-$LINENO}: $ac_msg" >&5 - printf "%s\n" "$ac_msg" >&6 - as_dir="$ac_dir"; as_fn_mkdir_p - ac_builddir=. - -case "$ac_dir" in -.) ac_dir_suffix= ac_top_builddir_sub=. ac_top_build_prefix= ;; -*) - ac_dir_suffix=/`printf "%s\n" "$ac_dir" | sed 's|^\.[\\/]||'` - # A ".." for each directory in $ac_dir_suffix. - ac_top_builddir_sub=`printf "%s\n" "$ac_dir_suffix" | sed 's|/[^\\/]*|/..|g;s|/||'` - case $ac_top_builddir_sub in - "") ac_top_builddir_sub=. ac_top_build_prefix= ;; - *) ac_top_build_prefix=$ac_top_builddir_sub/ ;; - esac ;; -esac -ac_abs_top_builddir=$ac_pwd -ac_abs_builddir=$ac_pwd$ac_dir_suffix -# for backward compatibility: -ac_top_builddir=$ac_top_build_prefix - -case $srcdir in - .) # We are building in place. - ac_srcdir=. - ac_top_srcdir=$ac_top_builddir_sub - ac_abs_top_srcdir=$ac_pwd ;; - [\\/]* | ?:[\\/]* ) # Absolute name. - ac_srcdir=$srcdir$ac_dir_suffix; - ac_top_srcdir=$srcdir - ac_abs_top_srcdir=$srcdir ;; - *) # Relative name. - ac_srcdir=$ac_top_build_prefix$srcdir$ac_dir_suffix - ac_top_srcdir=$ac_top_build_prefix$srcdir - ac_abs_top_srcdir=$ac_pwd/$srcdir ;; -esac -ac_abs_srcdir=$ac_abs_top_srcdir$ac_dir_suffix - - - cd "$ac_dir" - - # Check for configure.gnu first; this name is used for a wrapper for - # Metaconfig's "Configure" on case-insensitive file systems. - if test -f "$ac_srcdir/configure.gnu"; then - ac_sub_configure=$ac_srcdir/configure.gnu - elif test -f "$ac_srcdir/configure"; then - ac_sub_configure=$ac_srcdir/configure - else - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: no configuration information is in $ac_dir" >&5 -printf "%s\n" "$as_me: WARNING: no configuration information is in $ac_dir" >&2;} - ac_sub_configure= - fi - - # The recursion is here. - if test -n "$ac_sub_configure"; then - # Make the cache file name correct relative to the subdirectory. - case $cache_file in - [\\/]* | ?:[\\/]* ) ac_sub_cache_file=$cache_file ;; - *) # Relative name. - ac_sub_cache_file=$ac_top_build_prefix$cache_file ;; - esac - - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: running $SHELL $ac_sub_configure $ac_sub_configure_args --cache-file=$ac_sub_cache_file --srcdir=$ac_srcdir" >&5 -printf "%s\n" "$as_me: running $SHELL $ac_sub_configure $ac_sub_configure_args --cache-file=$ac_sub_cache_file --srcdir=$ac_srcdir" >&6;} - # The eval makes quoting arguments work. - eval "\$SHELL \"\$ac_sub_configure\" $ac_sub_configure_args \ - --cache-file=\"\$ac_sub_cache_file\" --srcdir=\"\$ac_srcdir\"" || - as_fn_error $? "$ac_sub_configure failed for $ac_dir" "$LINENO" 5 - fi - - cd "$ac_popdir" - done -fi -if test -n "$ac_unrecognized_opts" && test "$enable_option_checking" != no; then - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: unrecognized options: $ac_unrecognized_opts" >&5 -printf "%s\n" "$as_me: WARNING: unrecognized options: $ac_unrecognized_opts" >&2;} -fi - - diff --git a/extra/protobuf/protobuf-3.19.4/configure.ac b/extra/protobuf/protobuf-3.19.4/configure.ac deleted file mode 100644 index 4c774b0beab3..000000000000 --- a/extra/protobuf/protobuf-3.19.4/configure.ac +++ /dev/null @@ -1,247 +0,0 @@ -## Process this file with autoconf to produce configure. -## In general, the safest way to proceed is to run ./autogen.sh - -AC_PREREQ(2.59) - -# Note: If you change the version, you must also update it in: -# * Protobuf.podspec -# * csharp/Google.Protobuf.Tools.nuspec -# * csharp/src/*/AssemblyInfo.cs -# * csharp/src/Google.Protobuf/Google.Protobuf.nuspec -# * java/*/pom.xml -# * python/google/protobuf/__init__.py -# * protoc-artifacts/pom.xml -# * src/google/protobuf/stubs/common.h -# * src/Makefile.am (Update -version-info for LDFLAGS if needed) -# -# In the SVN trunk, the version should always be the next anticipated release -# version with the "-pre" suffix. (We used to use "-SNAPSHOT" but this pushed -# the size of one file name in the dist tarfile over the 99-char limit.) -AC_INIT([Protocol Buffers],[3.19.4],[protobuf@googlegroups.com],[protobuf]) - -AM_MAINTAINER_MODE([enable]) - -AC_CONFIG_SRCDIR(src/google/protobuf/message.cc) -# The config file is generated but not used by the source code, since we only -# need very few of them, e.g. HAVE_PTHREAD and HAVE_ZLIB. Those macros are -# passed down in CXXFLAGS manually in src/Makefile.am -AC_CONFIG_HEADERS([config.h]) -AC_CONFIG_MACRO_DIR([m4]) - -AC_ARG_VAR(DIST_LANG, [language to include in the distribution package (i.e., make dist)]) -case "$DIST_LANG" in - "") DIST_LANG=all ;; - all | cpp | csharp | java | python | javanano | objectivec | ruby | js | php) ;; - *) AC_MSG_FAILURE([unknown language: $DIST_LANG]) ;; -esac -AC_SUBST(DIST_LANG) - -# autoconf's default CXXFLAGS are usually "-g -O2". These aren't necessarily -# the best choice for libprotobuf. -AS_IF([test "x${ac_cv_env_CFLAGS_set}" = "x"], - [CFLAGS=""]) -AS_IF([test "x${ac_cv_env_CXXFLAGS_set}" = "x"], - [CXXFLAGS=""]) - -AC_CANONICAL_TARGET - -AM_INIT_AUTOMAKE([1.9 tar-ustar subdir-objects]) - -# Silent rules enabled: the output is minimal but informative. -# In particular, the warnings from the compiler stick out very clearly. -# To see all logs, use the --disable-silent-rules on configure or via make V=1 -AM_SILENT_RULES([yes]) - -AC_ARG_WITH([zlib], - [AS_HELP_STRING([--with-zlib], - [include classes for streaming compressed data in and out @<:@default=check@:>@])], - [],[with_zlib=check]) - -AC_ARG_WITH([zlib-include], - [AS_HELP_STRING([--with-zlib-include=PATH], - [zlib include directory])], - [CPPFLAGS="-I$withval $CPPFLAGS"]) - -AC_ARG_WITH([zlib-lib], - [AS_HELP_STRING([--with-zlib-lib=PATH], - [zlib lib directory])], - [LDFLAGS="-L$withval $LDFLAGS"]) - -AC_ARG_WITH([protoc], - [AS_HELP_STRING([--with-protoc=COMMAND], - [use the given protoc command instead of building a new one when building tests (useful for cross-compiling)])], - [],[with_protoc=no]) - -# Checks for programs. -AC_PROG_CC -AC_PROG_CXX -AC_PROG_CXX_FOR_BUILD -AC_LANG([C++]) -ACX_USE_SYSTEM_EXTENSIONS -m4_ifdef([AM_PROG_AR], [AM_PROG_AR]) -AM_CONDITIONAL(GCC, test "$GCC" = yes) # let the Makefile know if we're gcc -AC_PROG_OBJC - -# test_util.cc takes forever to compile with GCC and optimization turned on. -AC_MSG_CHECKING([C++ compiler flags...]) -AS_IF([test "x${ac_cv_env_CXXFLAGS_set}" = "x"],[ - AS_IF([test "$GCC" = "yes"],[ - PROTOBUF_OPT_FLAG="-O2" - CXXFLAGS="${CXXFLAGS} -g" - ]) - - # Protocol Buffers contains several checks that are intended to be used only - # for debugging and which might hurt performance. Most users are probably - # end users who don't want these checks, so add -DNDEBUG by default. - CXXFLAGS="$CXXFLAGS -std=c++11 -DNDEBUG" - - AC_MSG_RESULT([use default: $PROTOBUF_OPT_FLAG $CXXFLAGS]) -],[ - AC_MSG_RESULT([use user-supplied: $CXXFLAGS]) -]) - -AC_SUBST(PROTOBUF_OPT_FLAG) - -ACX_CHECK_SUNCC - -# Have to do libtool after SUNCC, other wise it "helpfully" adds Crun Cstd -# to the link -AC_PROG_LIBTOOL - -# Check whether the linker supports version scripts -AC_MSG_CHECKING([whether the linker supports version scripts]) -save_LDFLAGS=$LDFLAGS -LDFLAGS="$LDFLAGS -Wl,--version-script=conftest.map" -cat > conftest.map < - #if !defined(ZLIB_VERNUM) || (ZLIB_VERNUM < 0x1204) - # error zlib version too old - #endif - ]], [])], [ - AC_MSG_RESULT([ok (1.2.0.4 or later)]) - - # Also need to add -lz to the linker flags and make sure this succeeds. - AC_SEARCH_LIBS([zlibVersion], [z], [ - AC_DEFINE([HAVE_ZLIB], [1], [Enable classes using zlib compression.]) - HAVE_ZLIB=1 - ], [ - AS_IF([test "$with_zlib" != check], [ - AC_MSG_FAILURE([--with-zlib was given, but no working zlib library was found]) - ]) - ]) - ], [ - AS_IF([test "$with_zlib" = check], [ - AC_MSG_RESULT([headers missing or too old (requires 1.2.0.4)]) - ], [ - AC_MSG_FAILURE([--with-zlib was given, but zlib headers were not present or were too old (requires 1.2.0.4)]) - ]) - ]) -]) -AM_CONDITIONAL([HAVE_ZLIB], [test $HAVE_ZLIB = 1]) - -# Add -std=c++11 if necesssary. It is important for us to do this before the -# libatomic check below, since that also depends on C++11. -AX_CXX_COMPILE_STDCXX([11], [noext], [mandatory]) - -dnl On some platforms, std::atomic needs a helper library -AC_MSG_CHECKING(whether -latomic is needed) -AC_LINK_IFELSE([AC_LANG_SOURCE([[ - #include - #include - std::atomic v; - int main() { - return v; - } -]])], STD_ATOMIC_NEED_LIBATOMIC=no, STD_ATOMIC_NEED_LIBATOMIC=yes) -AC_MSG_RESULT($STD_ATOMIC_NEED_LIBATOMIC) -if test "x$STD_ATOMIC_NEED_LIBATOMIC" = xyes; then - LIBATOMIC_LIBS="-latomic" -fi -AC_SUBST([LIBATOMIC_LIBS]) - -AS_IF([test "$with_protoc" != "no"], [ - PROTOC=$with_protoc - AS_IF([test "$with_protoc" = "yes"], [ - # No argument given. Use system protoc. - PROTOC=protoc - ]) - AS_IF([echo "$PROTOC" | grep -q '^@<:@^/@:>@.*/'], [ - # Does not start with a slash, but contains a slash. So, it's a relative - # path (as opposed to an absolute path or an executable in $PATH). - # Since it will actually be executed from the src directory, prefix with - # the current directory. We also insert $ac_top_build_prefix in case this - # is a nested package and --with-protoc was actually given on the outer - # package's configure script. - PROTOC=`pwd`/${ac_top_build_prefix}$PROTOC - ]) - AC_SUBST([PROTOC]) -]) -AM_CONDITIONAL([USE_EXTERNAL_PROTOC], [test "$with_protoc" != "no"]) - -AX_PTHREAD -AM_CONDITIONAL([HAVE_PTHREAD], [test "x$ax_pthread_ok" = "xyes"]) -# We still keep this for improving pbconfig.h for unsupported platforms. -AC_CXX_STL_HASH - -# Enable ObjC support for conformance directory on OS X. -OBJC_CONFORMANCE_TEST=0 -case "$target_os" in - darwin*) - OBJC_CONFORMANCE_TEST=1 - ;; -esac -AM_CONDITIONAL([OBJC_CONFORMANCE_TEST], [test $OBJC_CONFORMANCE_TEST = 1]) - -AC_MSG_CHECKING(whether -llog is needed) -ANDROID_TEST=no -case "$target_os" in - *android*) - ANDROID_TEST=yes - ;; -esac -AC_MSG_RESULT($ANDROID_TEST) -if test "x$ANDROID_TEST" = xyes; then - LIBLOG_LIBS="-llog" -fi -AC_SUBST([LIBLOG_LIBS]) - -# HACK: Make gmock's configure script pick up our copy of CFLAGS and CXXFLAGS, -# since the flags added by ACX_CHECK_SUNCC must be used when compiling gmock -# too. -export CFLAGS -export CXXFLAGS -AC_CONFIG_SUBDIRS([third_party/googletest]) - -AC_CONFIG_FILES([Makefile src/Makefile benchmarks/Makefile conformance/Makefile protobuf.pc protobuf-lite.pc]) -AC_OUTPUT diff --git a/extra/protobuf/protobuf-3.19.4/depcomp b/extra/protobuf/protobuf-3.19.4/depcomp deleted file mode 100755 index 715e34311ed2..000000000000 --- a/extra/protobuf/protobuf-3.19.4/depcomp +++ /dev/null @@ -1,791 +0,0 @@ -#! /bin/sh -# depcomp - compile a program generating dependencies as side-effects - -scriptversion=2018-03-07.03; # UTC - -# Copyright (C) 1999-2021 Free Software Foundation, Inc. - -# This program is free software; you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation; either version 2, or (at your option) -# any later version. - -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. - -# You should have received a copy of the GNU General Public License -# along with this program. If not, see . - -# As a special exception to the GNU General Public License, if you -# distribute this file as part of a program that contains a -# configuration script generated by Autoconf, you may include it under -# the same distribution terms that you use for the rest of that program. - -# Originally written by Alexandre Oliva . - -case $1 in - '') - echo "$0: No command. Try '$0 --help' for more information." 1>&2 - exit 1; - ;; - -h | --h*) - cat <<\EOF -Usage: depcomp [--help] [--version] PROGRAM [ARGS] - -Run PROGRAMS ARGS to compile a file, generating dependencies -as side-effects. - -Environment variables: - depmode Dependency tracking mode. - source Source file read by 'PROGRAMS ARGS'. - object Object file output by 'PROGRAMS ARGS'. - DEPDIR directory where to store dependencies. - depfile Dependency file to output. - tmpdepfile Temporary file to use when outputting dependencies. - libtool Whether libtool is used (yes/no). - -Report bugs to . -EOF - exit $? - ;; - -v | --v*) - echo "depcomp $scriptversion" - exit $? - ;; -esac - -# Get the directory component of the given path, and save it in the -# global variables '$dir'. Note that this directory component will -# be either empty or ending with a '/' character. This is deliberate. -set_dir_from () -{ - case $1 in - */*) dir=`echo "$1" | sed -e 's|/[^/]*$|/|'`;; - *) dir=;; - esac -} - -# Get the suffix-stripped basename of the given path, and save it the -# global variable '$base'. -set_base_from () -{ - base=`echo "$1" | sed -e 's|^.*/||' -e 's/\.[^.]*$//'` -} - -# If no dependency file was actually created by the compiler invocation, -# we still have to create a dummy depfile, to avoid errors with the -# Makefile "include basename.Plo" scheme. -make_dummy_depfile () -{ - echo "#dummy" > "$depfile" -} - -# Factor out some common post-processing of the generated depfile. -# Requires the auxiliary global variable '$tmpdepfile' to be set. -aix_post_process_depfile () -{ - # If the compiler actually managed to produce a dependency file, - # post-process it. - if test -f "$tmpdepfile"; then - # Each line is of the form 'foo.o: dependency.h'. - # Do two passes, one to just change these to - # $object: dependency.h - # and one to simply output - # dependency.h: - # which is needed to avoid the deleted-header problem. - { sed -e "s,^.*\.[$lower]*:,$object:," < "$tmpdepfile" - sed -e "s,^.*\.[$lower]*:[$tab ]*,," -e 's,$,:,' < "$tmpdepfile" - } > "$depfile" - rm -f "$tmpdepfile" - else - make_dummy_depfile - fi -} - -# A tabulation character. -tab=' ' -# A newline character. -nl=' -' -# Character ranges might be problematic outside the C locale. -# These definitions help. -upper=ABCDEFGHIJKLMNOPQRSTUVWXYZ -lower=abcdefghijklmnopqrstuvwxyz -digits=0123456789 -alpha=${upper}${lower} - -if test -z "$depmode" || test -z "$source" || test -z "$object"; then - echo "depcomp: Variables source, object and depmode must be set" 1>&2 - exit 1 -fi - -# Dependencies for sub/bar.o or sub/bar.obj go into sub/.deps/bar.Po. -depfile=${depfile-`echo "$object" | - sed 's|[^\\/]*$|'${DEPDIR-.deps}'/&|;s|\.\([^.]*\)$|.P\1|;s|Pobj$|Po|'`} -tmpdepfile=${tmpdepfile-`echo "$depfile" | sed 's/\.\([^.]*\)$/.T\1/'`} - -rm -f "$tmpdepfile" - -# Avoid interferences from the environment. -gccflag= dashmflag= - -# Some modes work just like other modes, but use different flags. We -# parameterize here, but still list the modes in the big case below, -# to make depend.m4 easier to write. Note that we *cannot* use a case -# here, because this file can only contain one case statement. -if test "$depmode" = hp; then - # HP compiler uses -M and no extra arg. - gccflag=-M - depmode=gcc -fi - -if test "$depmode" = dashXmstdout; then - # This is just like dashmstdout with a different argument. - dashmflag=-xM - depmode=dashmstdout -fi - -cygpath_u="cygpath -u -f -" -if test "$depmode" = msvcmsys; then - # This is just like msvisualcpp but w/o cygpath translation. - # Just convert the backslash-escaped backslashes to single forward - # slashes to satisfy depend.m4 - cygpath_u='sed s,\\\\,/,g' - depmode=msvisualcpp -fi - -if test "$depmode" = msvc7msys; then - # This is just like msvc7 but w/o cygpath translation. - # Just convert the backslash-escaped backslashes to single forward - # slashes to satisfy depend.m4 - cygpath_u='sed s,\\\\,/,g' - depmode=msvc7 -fi - -if test "$depmode" = xlc; then - # IBM C/C++ Compilers xlc/xlC can output gcc-like dependency information. - gccflag=-qmakedep=gcc,-MF - depmode=gcc -fi - -case "$depmode" in -gcc3) -## gcc 3 implements dependency tracking that does exactly what -## we want. Yay! Note: for some reason libtool 1.4 doesn't like -## it if -MD -MP comes after the -MF stuff. Hmm. -## Unfortunately, FreeBSD c89 acceptance of flags depends upon -## the command line argument order; so add the flags where they -## appear in depend2.am. Note that the slowdown incurred here -## affects only configure: in makefiles, %FASTDEP% shortcuts this. - for arg - do - case $arg in - -c) set fnord "$@" -MT "$object" -MD -MP -MF "$tmpdepfile" "$arg" ;; - *) set fnord "$@" "$arg" ;; - esac - shift # fnord - shift # $arg - done - "$@" - stat=$? - if test $stat -ne 0; then - rm -f "$tmpdepfile" - exit $stat - fi - mv "$tmpdepfile" "$depfile" - ;; - -gcc) -## Note that this doesn't just cater to obsosete pre-3.x GCC compilers. -## but also to in-use compilers like IMB xlc/xlC and the HP C compiler. -## (see the conditional assignment to $gccflag above). -## There are various ways to get dependency output from gcc. Here's -## why we pick this rather obscure method: -## - Don't want to use -MD because we'd like the dependencies to end -## up in a subdir. Having to rename by hand is ugly. -## (We might end up doing this anyway to support other compilers.) -## - The DEPENDENCIES_OUTPUT environment variable makes gcc act like -## -MM, not -M (despite what the docs say). Also, it might not be -## supported by the other compilers which use the 'gcc' depmode. -## - Using -M directly means running the compiler twice (even worse -## than renaming). - if test -z "$gccflag"; then - gccflag=-MD, - fi - "$@" -Wp,"$gccflag$tmpdepfile" - stat=$? - if test $stat -ne 0; then - rm -f "$tmpdepfile" - exit $stat - fi - rm -f "$depfile" - echo "$object : \\" > "$depfile" - # The second -e expression handles DOS-style file names with drive - # letters. - sed -e 's/^[^:]*: / /' \ - -e 's/^['$alpha']:\/[^:]*: / /' < "$tmpdepfile" >> "$depfile" -## This next piece of magic avoids the "deleted header file" problem. -## The problem is that when a header file which appears in a .P file -## is deleted, the dependency causes make to die (because there is -## typically no way to rebuild the header). We avoid this by adding -## dummy dependencies for each header file. Too bad gcc doesn't do -## this for us directly. -## Some versions of gcc put a space before the ':'. On the theory -## that the space means something, we add a space to the output as -## well. hp depmode also adds that space, but also prefixes the VPATH -## to the object. Take care to not repeat it in the output. -## Some versions of the HPUX 10.20 sed can't process this invocation -## correctly. Breaking it into two sed invocations is a workaround. - tr ' ' "$nl" < "$tmpdepfile" \ - | sed -e 's/^\\$//' -e '/^$/d' -e "s|.*$object$||" -e '/:$/d' \ - | sed -e 's/$/ :/' >> "$depfile" - rm -f "$tmpdepfile" - ;; - -hp) - # This case exists only to let depend.m4 do its work. It works by - # looking at the text of this script. This case will never be run, - # since it is checked for above. - exit 1 - ;; - -sgi) - if test "$libtool" = yes; then - "$@" "-Wp,-MDupdate,$tmpdepfile" - else - "$@" -MDupdate "$tmpdepfile" - fi - stat=$? - if test $stat -ne 0; then - rm -f "$tmpdepfile" - exit $stat - fi - rm -f "$depfile" - - if test -f "$tmpdepfile"; then # yes, the sourcefile depend on other files - echo "$object : \\" > "$depfile" - # Clip off the initial element (the dependent). Don't try to be - # clever and replace this with sed code, as IRIX sed won't handle - # lines with more than a fixed number of characters (4096 in - # IRIX 6.2 sed, 8192 in IRIX 6.5). We also remove comment lines; - # the IRIX cc adds comments like '#:fec' to the end of the - # dependency line. - tr ' ' "$nl" < "$tmpdepfile" \ - | sed -e 's/^.*\.o://' -e 's/#.*$//' -e '/^$/ d' \ - | tr "$nl" ' ' >> "$depfile" - echo >> "$depfile" - # The second pass generates a dummy entry for each header file. - tr ' ' "$nl" < "$tmpdepfile" \ - | sed -e 's/^.*\.o://' -e 's/#.*$//' -e '/^$/ d' -e 's/$/:/' \ - >> "$depfile" - else - make_dummy_depfile - fi - rm -f "$tmpdepfile" - ;; - -xlc) - # This case exists only to let depend.m4 do its work. It works by - # looking at the text of this script. This case will never be run, - # since it is checked for above. - exit 1 - ;; - -aix) - # The C for AIX Compiler uses -M and outputs the dependencies - # in a .u file. In older versions, this file always lives in the - # current directory. Also, the AIX compiler puts '$object:' at the - # start of each line; $object doesn't have directory information. - # Version 6 uses the directory in both cases. - set_dir_from "$object" - set_base_from "$object" - if test "$libtool" = yes; then - tmpdepfile1=$dir$base.u - tmpdepfile2=$base.u - tmpdepfile3=$dir.libs/$base.u - "$@" -Wc,-M - else - tmpdepfile1=$dir$base.u - tmpdepfile2=$dir$base.u - tmpdepfile3=$dir$base.u - "$@" -M - fi - stat=$? - if test $stat -ne 0; then - rm -f "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3" - exit $stat - fi - - for tmpdepfile in "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3" - do - test -f "$tmpdepfile" && break - done - aix_post_process_depfile - ;; - -tcc) - # tcc (Tiny C Compiler) understand '-MD -MF file' since version 0.9.26 - # FIXME: That version still under development at the moment of writing. - # Make that this statement remains true also for stable, released - # versions. - # It will wrap lines (doesn't matter whether long or short) with a - # trailing '\', as in: - # - # foo.o : \ - # foo.c \ - # foo.h \ - # - # It will put a trailing '\' even on the last line, and will use leading - # spaces rather than leading tabs (at least since its commit 0394caf7 - # "Emit spaces for -MD"). - "$@" -MD -MF "$tmpdepfile" - stat=$? - if test $stat -ne 0; then - rm -f "$tmpdepfile" - exit $stat - fi - rm -f "$depfile" - # Each non-empty line is of the form 'foo.o : \' or ' dep.h \'. - # We have to change lines of the first kind to '$object: \'. - sed -e "s|.*:|$object :|" < "$tmpdepfile" > "$depfile" - # And for each line of the second kind, we have to emit a 'dep.h:' - # dummy dependency, to avoid the deleted-header problem. - sed -n -e 's|^ *\(.*\) *\\$|\1:|p' < "$tmpdepfile" >> "$depfile" - rm -f "$tmpdepfile" - ;; - -## The order of this option in the case statement is important, since the -## shell code in configure will try each of these formats in the order -## listed in this file. A plain '-MD' option would be understood by many -## compilers, so we must ensure this comes after the gcc and icc options. -pgcc) - # Portland's C compiler understands '-MD'. - # Will always output deps to 'file.d' where file is the root name of the - # source file under compilation, even if file resides in a subdirectory. - # The object file name does not affect the name of the '.d' file. - # pgcc 10.2 will output - # foo.o: sub/foo.c sub/foo.h - # and will wrap long lines using '\' : - # foo.o: sub/foo.c ... \ - # sub/foo.h ... \ - # ... - set_dir_from "$object" - # Use the source, not the object, to determine the base name, since - # that's sadly what pgcc will do too. - set_base_from "$source" - tmpdepfile=$base.d - - # For projects that build the same source file twice into different object - # files, the pgcc approach of using the *source* file root name can cause - # problems in parallel builds. Use a locking strategy to avoid stomping on - # the same $tmpdepfile. - lockdir=$base.d-lock - trap " - echo '$0: caught signal, cleaning up...' >&2 - rmdir '$lockdir' - exit 1 - " 1 2 13 15 - numtries=100 - i=$numtries - while test $i -gt 0; do - # mkdir is a portable test-and-set. - if mkdir "$lockdir" 2>/dev/null; then - # This process acquired the lock. - "$@" -MD - stat=$? - # Release the lock. - rmdir "$lockdir" - break - else - # If the lock is being held by a different process, wait - # until the winning process is done or we timeout. - while test -d "$lockdir" && test $i -gt 0; do - sleep 1 - i=`expr $i - 1` - done - fi - i=`expr $i - 1` - done - trap - 1 2 13 15 - if test $i -le 0; then - echo "$0: failed to acquire lock after $numtries attempts" >&2 - echo "$0: check lockdir '$lockdir'" >&2 - exit 1 - fi - - if test $stat -ne 0; then - rm -f "$tmpdepfile" - exit $stat - fi - rm -f "$depfile" - # Each line is of the form `foo.o: dependent.h', - # or `foo.o: dep1.h dep2.h \', or ` dep3.h dep4.h \'. - # Do two passes, one to just change these to - # `$object: dependent.h' and one to simply `dependent.h:'. - sed "s,^[^:]*:,$object :," < "$tmpdepfile" > "$depfile" - # Some versions of the HPUX 10.20 sed can't process this invocation - # correctly. Breaking it into two sed invocations is a workaround. - sed 's,^[^:]*: \(.*\)$,\1,;s/^\\$//;/^$/d;/:$/d' < "$tmpdepfile" \ - | sed -e 's/$/ :/' >> "$depfile" - rm -f "$tmpdepfile" - ;; - -hp2) - # The "hp" stanza above does not work with aCC (C++) and HP's ia64 - # compilers, which have integrated preprocessors. The correct option - # to use with these is +Maked; it writes dependencies to a file named - # 'foo.d', which lands next to the object file, wherever that - # happens to be. - # Much of this is similar to the tru64 case; see comments there. - set_dir_from "$object" - set_base_from "$object" - if test "$libtool" = yes; then - tmpdepfile1=$dir$base.d - tmpdepfile2=$dir.libs/$base.d - "$@" -Wc,+Maked - else - tmpdepfile1=$dir$base.d - tmpdepfile2=$dir$base.d - "$@" +Maked - fi - stat=$? - if test $stat -ne 0; then - rm -f "$tmpdepfile1" "$tmpdepfile2" - exit $stat - fi - - for tmpdepfile in "$tmpdepfile1" "$tmpdepfile2" - do - test -f "$tmpdepfile" && break - done - if test -f "$tmpdepfile"; then - sed -e "s,^.*\.[$lower]*:,$object:," "$tmpdepfile" > "$depfile" - # Add 'dependent.h:' lines. - sed -ne '2,${ - s/^ *// - s/ \\*$// - s/$/:/ - p - }' "$tmpdepfile" >> "$depfile" - else - make_dummy_depfile - fi - rm -f "$tmpdepfile" "$tmpdepfile2" - ;; - -tru64) - # The Tru64 compiler uses -MD to generate dependencies as a side - # effect. 'cc -MD -o foo.o ...' puts the dependencies into 'foo.o.d'. - # At least on Alpha/Redhat 6.1, Compaq CCC V6.2-504 seems to put - # dependencies in 'foo.d' instead, so we check for that too. - # Subdirectories are respected. - set_dir_from "$object" - set_base_from "$object" - - if test "$libtool" = yes; then - # Libtool generates 2 separate objects for the 2 libraries. These - # two compilations output dependencies in $dir.libs/$base.o.d and - # in $dir$base.o.d. We have to check for both files, because - # one of the two compilations can be disabled. We should prefer - # $dir$base.o.d over $dir.libs/$base.o.d because the latter is - # automatically cleaned when .libs/ is deleted, while ignoring - # the former would cause a distcleancheck panic. - tmpdepfile1=$dir$base.o.d # libtool 1.5 - tmpdepfile2=$dir.libs/$base.o.d # Likewise. - tmpdepfile3=$dir.libs/$base.d # Compaq CCC V6.2-504 - "$@" -Wc,-MD - else - tmpdepfile1=$dir$base.d - tmpdepfile2=$dir$base.d - tmpdepfile3=$dir$base.d - "$@" -MD - fi - - stat=$? - if test $stat -ne 0; then - rm -f "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3" - exit $stat - fi - - for tmpdepfile in "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3" - do - test -f "$tmpdepfile" && break - done - # Same post-processing that is required for AIX mode. - aix_post_process_depfile - ;; - -msvc7) - if test "$libtool" = yes; then - showIncludes=-Wc,-showIncludes - else - showIncludes=-showIncludes - fi - "$@" $showIncludes > "$tmpdepfile" - stat=$? - grep -v '^Note: including file: ' "$tmpdepfile" - if test $stat -ne 0; then - rm -f "$tmpdepfile" - exit $stat - fi - rm -f "$depfile" - echo "$object : \\" > "$depfile" - # The first sed program below extracts the file names and escapes - # backslashes for cygpath. The second sed program outputs the file - # name when reading, but also accumulates all include files in the - # hold buffer in order to output them again at the end. This only - # works with sed implementations that can handle large buffers. - sed < "$tmpdepfile" -n ' -/^Note: including file: *\(.*\)/ { - s//\1/ - s/\\/\\\\/g - p -}' | $cygpath_u | sort -u | sed -n ' -s/ /\\ /g -s/\(.*\)/'"$tab"'\1 \\/p -s/.\(.*\) \\/\1:/ -H -$ { - s/.*/'"$tab"'/ - G - p -}' >> "$depfile" - echo >> "$depfile" # make sure the fragment doesn't end with a backslash - rm -f "$tmpdepfile" - ;; - -msvc7msys) - # This case exists only to let depend.m4 do its work. It works by - # looking at the text of this script. This case will never be run, - # since it is checked for above. - exit 1 - ;; - -#nosideeffect) - # This comment above is used by automake to tell side-effect - # dependency tracking mechanisms from slower ones. - -dashmstdout) - # Important note: in order to support this mode, a compiler *must* - # always write the preprocessed file to stdout, regardless of -o. - "$@" || exit $? - - # Remove the call to Libtool. - if test "$libtool" = yes; then - while test "X$1" != 'X--mode=compile'; do - shift - done - shift - fi - - # Remove '-o $object'. - IFS=" " - for arg - do - case $arg in - -o) - shift - ;; - $object) - shift - ;; - *) - set fnord "$@" "$arg" - shift # fnord - shift # $arg - ;; - esac - done - - test -z "$dashmflag" && dashmflag=-M - # Require at least two characters before searching for ':' - # in the target name. This is to cope with DOS-style filenames: - # a dependency such as 'c:/foo/bar' could be seen as target 'c' otherwise. - "$@" $dashmflag | - sed "s|^[$tab ]*[^:$tab ][^:][^:]*:[$tab ]*|$object: |" > "$tmpdepfile" - rm -f "$depfile" - cat < "$tmpdepfile" > "$depfile" - # Some versions of the HPUX 10.20 sed can't process this sed invocation - # correctly. Breaking it into two sed invocations is a workaround. - tr ' ' "$nl" < "$tmpdepfile" \ - | sed -e 's/^\\$//' -e '/^$/d' -e '/:$/d' \ - | sed -e 's/$/ :/' >> "$depfile" - rm -f "$tmpdepfile" - ;; - -dashXmstdout) - # This case only exists to satisfy depend.m4. It is never actually - # run, as this mode is specially recognized in the preamble. - exit 1 - ;; - -makedepend) - "$@" || exit $? - # Remove any Libtool call - if test "$libtool" = yes; then - while test "X$1" != 'X--mode=compile'; do - shift - done - shift - fi - # X makedepend - shift - cleared=no eat=no - for arg - do - case $cleared in - no) - set ""; shift - cleared=yes ;; - esac - if test $eat = yes; then - eat=no - continue - fi - case "$arg" in - -D*|-I*) - set fnord "$@" "$arg"; shift ;; - # Strip any option that makedepend may not understand. Remove - # the object too, otherwise makedepend will parse it as a source file. - -arch) - eat=yes ;; - -*|$object) - ;; - *) - set fnord "$@" "$arg"; shift ;; - esac - done - obj_suffix=`echo "$object" | sed 's/^.*\././'` - touch "$tmpdepfile" - ${MAKEDEPEND-makedepend} -o"$obj_suffix" -f"$tmpdepfile" "$@" - rm -f "$depfile" - # makedepend may prepend the VPATH from the source file name to the object. - # No need to regex-escape $object, excess matching of '.' is harmless. - sed "s|^.*\($object *:\)|\1|" "$tmpdepfile" > "$depfile" - # Some versions of the HPUX 10.20 sed can't process the last invocation - # correctly. Breaking it into two sed invocations is a workaround. - sed '1,2d' "$tmpdepfile" \ - | tr ' ' "$nl" \ - | sed -e 's/^\\$//' -e '/^$/d' -e '/:$/d' \ - | sed -e 's/$/ :/' >> "$depfile" - rm -f "$tmpdepfile" "$tmpdepfile".bak - ;; - -cpp) - # Important note: in order to support this mode, a compiler *must* - # always write the preprocessed file to stdout. - "$@" || exit $? - - # Remove the call to Libtool. - if test "$libtool" = yes; then - while test "X$1" != 'X--mode=compile'; do - shift - done - shift - fi - - # Remove '-o $object'. - IFS=" " - for arg - do - case $arg in - -o) - shift - ;; - $object) - shift - ;; - *) - set fnord "$@" "$arg" - shift # fnord - shift # $arg - ;; - esac - done - - "$@" -E \ - | sed -n -e '/^# [0-9][0-9]* "\([^"]*\)".*/ s:: \1 \\:p' \ - -e '/^#line [0-9][0-9]* "\([^"]*\)".*/ s:: \1 \\:p' \ - | sed '$ s: \\$::' > "$tmpdepfile" - rm -f "$depfile" - echo "$object : \\" > "$depfile" - cat < "$tmpdepfile" >> "$depfile" - sed < "$tmpdepfile" '/^$/d;s/^ //;s/ \\$//;s/$/ :/' >> "$depfile" - rm -f "$tmpdepfile" - ;; - -msvisualcpp) - # Important note: in order to support this mode, a compiler *must* - # always write the preprocessed file to stdout. - "$@" || exit $? - - # Remove the call to Libtool. - if test "$libtool" = yes; then - while test "X$1" != 'X--mode=compile'; do - shift - done - shift - fi - - IFS=" " - for arg - do - case "$arg" in - -o) - shift - ;; - $object) - shift - ;; - "-Gm"|"/Gm"|"-Gi"|"/Gi"|"-ZI"|"/ZI") - set fnord "$@" - shift - shift - ;; - *) - set fnord "$@" "$arg" - shift - shift - ;; - esac - done - "$@" -E 2>/dev/null | - sed -n '/^#line [0-9][0-9]* "\([^"]*\)"/ s::\1:p' | $cygpath_u | sort -u > "$tmpdepfile" - rm -f "$depfile" - echo "$object : \\" > "$depfile" - sed < "$tmpdepfile" -n -e 's% %\\ %g' -e '/^\(.*\)$/ s::'"$tab"'\1 \\:p' >> "$depfile" - echo "$tab" >> "$depfile" - sed < "$tmpdepfile" -n -e 's% %\\ %g' -e '/^\(.*\)$/ s::\1\::p' >> "$depfile" - rm -f "$tmpdepfile" - ;; - -msvcmsys) - # This case exists only to let depend.m4 do its work. It works by - # looking at the text of this script. This case will never be run, - # since it is checked for above. - exit 1 - ;; - -none) - exec "$@" - ;; - -*) - echo "Unknown depmode $depmode" 1>&2 - exit 1 - ;; -esac - -exit 0 - -# Local Variables: -# mode: shell-script -# sh-indentation: 2 -# eval: (add-hook 'before-save-hook 'time-stamp) -# time-stamp-start: "scriptversion=" -# time-stamp-format: "%:y-%02m-%02d.%02H" -# time-stamp-time-zone: "UTC0" -# time-stamp-end: "; # UTC" -# End: diff --git a/extra/protobuf/protobuf-3.19.4/editors/README.txt b/extra/protobuf/protobuf-3.19.4/editors/README.txt deleted file mode 100644 index 3e9fc79e9cd7..000000000000 --- a/extra/protobuf/protobuf-3.19.4/editors/README.txt +++ /dev/null @@ -1,5 +0,0 @@ -This directory contains syntax highlighting and configuration files for editors -to properly display Protocol Buffer files. - -See each file's header comment for directions on how to use it with the -appropriate editor. diff --git a/extra/protobuf/protobuf-3.19.4/editors/proto.vim b/extra/protobuf/protobuf-3.19.4/editors/proto.vim deleted file mode 100644 index bdc60ce7f8ee..000000000000 --- a/extra/protobuf/protobuf-3.19.4/editors/proto.vim +++ /dev/null @@ -1,105 +0,0 @@ -" Protocol Buffers - Google's data interchange format -" Copyright 2008 Google Inc. All rights reserved. -" https://developers.google.com/protocol-buffers/ -" -" Redistribution and use in source and binary forms, with or without -" modification, are permitted provided that the following conditions are -" met: -" -" * Redistributions of source code must retain the above copyright -" notice, this list of conditions and the following disclaimer. -" * Redistributions in binary form must reproduce the above -" copyright notice, this list of conditions and the following disclaimer -" in the documentation and/or other materials provided with the -" distribution. -" * Neither the name of Google Inc. nor the names of its -" contributors may be used to endorse or promote products derived from -" this software without specific prior written permission. -" -" THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -" "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -" LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -" A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -" OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -" SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -" LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -" DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -" THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -" (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -" OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -" This is the Vim syntax file for Google Protocol Buffers. -" -" Usage: -" -" 1. cp proto.vim ~/.vim/syntax/ -" 2. Add the following to ~/.vimrc: -" -" augroup filetype -" au! BufRead,BufNewFile *.proto setfiletype proto -" augroup end -" -" Or just create a new file called ~/.vim/ftdetect/proto.vim with the -" previous lines on it. - -if version < 600 - syntax clear -elseif exists("b:current_syntax") - finish -endif - -syn case match - -syn keyword pbTodo contained TODO FIXME XXX -syn cluster pbCommentGrp contains=pbTodo - -syn keyword pbSyntax syntax import option -syn keyword pbStructure package message group oneof -syn keyword pbRepeat optional required repeated -syn keyword pbDefault default -syn keyword pbExtend extend extensions to max reserved -syn keyword pbRPC service rpc returns - -syn keyword pbType int32 int64 uint32 uint64 sint32 sint64 -syn keyword pbType fixed32 fixed64 sfixed32 sfixed64 -syn keyword pbType float double bool string bytes -syn keyword pbTypedef enum -syn keyword pbBool true false - -syn match pbInt /-\?\<\d\+\>/ -syn match pbInt /\<0[xX]\x+\>/ -syn match pbFloat /\<-\?\d*\(\.\d*\)\?/ -syn region pbComment start="\/\*" end="\*\/" contains=@pbCommentGrp,@Spell -syn region pbComment start="//" skip="\\$" end="$" keepend contains=@pbCommentGrp,@Spell -syn region pbString start=/"/ skip=/\\./ end=/"/ contains=@Spell -syn region pbString start=/'/ skip=/\\./ end=/'/ contains=@Spell - -if version >= 508 || !exists("did_proto_syn_inits") - if version < 508 - let did_proto_syn_inits = 1 - command -nargs=+ HiLink hi link - else - command -nargs=+ HiLink hi def link - endif - - HiLink pbTodo Todo - - HiLink pbSyntax Include - HiLink pbStructure Structure - HiLink pbRepeat Repeat - HiLink pbDefault Keyword - HiLink pbExtend Keyword - HiLink pbRPC Keyword - HiLink pbType Type - HiLink pbTypedef Typedef - HiLink pbBool Boolean - - HiLink pbInt Number - HiLink pbFloat Float - HiLink pbComment Comment - HiLink pbString String - - delcommand HiLink -endif - -let b:current_syntax = "proto" diff --git a/extra/protobuf/protobuf-3.19.4/editors/protobuf-mode.el b/extra/protobuf/protobuf-3.19.4/editors/protobuf-mode.el deleted file mode 100644 index bbb82b7f4bda..000000000000 --- a/extra/protobuf/protobuf-3.19.4/editors/protobuf-mode.el +++ /dev/null @@ -1,227 +0,0 @@ -;;; protobuf-mode.el --- major mode for editing protocol buffers. -*- lexical-binding: t; -*- - -;; Author: Alexandre Vassalotti -;; Created: 23-Apr-2009 -;; Version: 0.3 -;; Keywords: google protobuf languages - -;; Redistribution and use in source and binary forms, with or without -;; modification, are permitted provided that the following conditions are -;; met: -;; -;; * Redistributions of source code must retain the above copyright -;; notice, this list of conditions and the following disclaimer. -;; * Redistributions in binary form must reproduce the above -;; copyright notice, this list of conditions and the following disclaimer -;; in the documentation and/or other materials provided with the -;; distribution. -;; * Neither the name of Google Inc. nor the names of its -;; contributors may be used to endorse or promote products derived from -;; this software without specific prior written permission. -;; -;; THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -;; "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -;; LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -;; A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -;; OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -;; SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -;; LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -;; DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -;; THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -;; (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -;; OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -;;; Commentary: - -;; Installation: -;; - Put `protobuf-mode.el' in your Emacs load-path. -;; - Add this line to your .emacs file: -;; (require 'protobuf-mode) -;; -;; You can customize this mode just like any mode derived from CC Mode. If -;; you want to add customizations specific to protobuf-mode, you can use the -;; `protobuf-mode-hook'. For example, the following would make protocol-mode -;; use 2-space indentation: -;; -;; (defconst my-protobuf-style -;; '((c-basic-offset . 2) -;; (indent-tabs-mode . nil))) -;; -;; (add-hook 'protobuf-mode-hook -;; (lambda () (c-add-style "my-style" my-protobuf-style t))) -;; -;; Refer to the documentation of CC Mode for more information about -;; customization details and how to use this mode. -;; -;; TODO: -;; - Make highlighting for enum values work properly. -;; - Fix the parser to recognize extensions as identifiers and not -;; as casts. -;; - Improve the parsing of option assignment lists. For example: -;; optional int32 foo = 1 [(my_field_option) = 4.5]; -;; - Add support for fully-qualified identifiers (e.g., with a leading "."). - -;;; Code: - -(require 'cc-mode) - -(eval-when-compile - (and (= emacs-major-version 24) - (>= emacs-minor-version 4) - (require 'cl-lib)) - (require 'cc-langs) - (require 'cc-fonts)) - -;; This mode does not inherit properties from other modes. So, we do not use -;; the usual `c-add-language' function. -(eval-and-compile - (put 'protobuf-mode 'c-mode-prefix "protobuf-")) - -;; The following code uses of the `c-lang-defconst' macro define syntactic -;; features of protocol buffer language. Refer to the documentation in the -;; cc-langs.el file for information about the meaning of the -kwds variables. - -(c-lang-defconst c-primitive-type-kwds - protobuf '("double" "float" "int32" "int64" "uint32" "uint64" "sint32" - "sint64" "fixed32" "fixed64" "sfixed32" "sfixed64" "bool" - "string" "bytes" "group")) - -(c-lang-defconst c-modifier-kwds - protobuf '("required" "optional" "repeated")) - -(c-lang-defconst c-class-decl-kwds - protobuf '("message" "enum" "service")) - -(c-lang-defconst c-constant-kwds - protobuf '("true" "false")) - -(c-lang-defconst c-other-decl-kwds - protobuf '("package" "import")) - -(c-lang-defconst c-other-kwds - protobuf '("default" "max")) - -(c-lang-defconst c-identifier-ops - ;; Handle extended identifiers like google.protobuf.MessageOptions - protobuf '((left-assoc "."))) - -;; The following keywords do not fit well in keyword classes defined by -;; cc-mode. So, we approximate as best we can. - -(c-lang-defconst c-type-list-kwds - protobuf '("extensions" "to" "reserved")) - -(c-lang-defconst c-typeless-decl-kwds - protobuf '("extend" "rpc" "option" "returns")) - - -;; Here we remove default syntax for loops, if-statements and other C -;; syntactic features that are not supported by the protocol buffer language. - -(c-lang-defconst c-brace-list-decl-kwds - ;; Remove syntax for C-style enumerations. - protobuf nil) - -(c-lang-defconst c-block-stmt-1-kwds - ;; Remove syntax for "do" and "else" keywords. - protobuf nil) - -(c-lang-defconst c-block-stmt-2-kwds - ;; Remove syntax for "for", "if", "switch" and "while" keywords. - protobuf nil) - -(c-lang-defconst c-simple-stmt-kwds - ;; Remove syntax for "break", "continue", "goto" and "return" keywords. - protobuf nil) - -(c-lang-defconst c-paren-stmt-kwds - ;; Remove special case for the "(;;)" in for-loops. - protobuf nil) - -(c-lang-defconst c-label-kwds - ;; Remove case label syntax for the "case" and "default" keywords. - protobuf nil) - -(c-lang-defconst c-before-label-kwds - ;; Remove special case for the label in a goto statement. - protobuf nil) - -(c-lang-defconst c-cpp-matchers - ;; Disable all the C preprocessor syntax. - protobuf nil) - -(c-lang-defconst c-decl-prefix-re - ;; Same as for C, except it does not match "(". This is needed for disabling - ;; the syntax for casts. - protobuf "\\([\{\};,]+\\)") - - -;; Add support for variable levels of syntax highlighting. - -(defconst protobuf-font-lock-keywords-1 (c-lang-const c-matchers-1 protobuf) - "Minimal highlighting for protobuf-mode.") - -(defconst protobuf-font-lock-keywords-2 (c-lang-const c-matchers-2 protobuf) - "Fast normal highlighting for protobuf-mode.") - -(defconst protobuf-font-lock-keywords-3 (c-lang-const c-matchers-3 protobuf) - "Accurate normal highlighting for protobuf-mode.") - -(defvar protobuf-font-lock-keywords protobuf-font-lock-keywords-3 - "Default expressions to highlight in protobuf-mode.") - -;; Our syntax table is auto-generated from the keyword classes we defined -;; previously with the `c-lang-const' macro. -(defvar protobuf-mode-syntax-table nil - "Syntax table used in protobuf-mode buffers.") -(or protobuf-mode-syntax-table - (setq protobuf-mode-syntax-table - (funcall (c-lang-const c-make-mode-syntax-table protobuf)))) - -(defvar protobuf-mode-abbrev-table nil - "Abbreviation table used in protobuf-mode buffers.") - -(defvar protobuf-mode-map nil - "Keymap used in protobuf-mode buffers.") -(or protobuf-mode-map - (setq protobuf-mode-map (c-make-inherited-keymap))) - -(easy-menu-define protobuf-menu protobuf-mode-map - "Protocol Buffers Mode Commands" - (cons "Protocol Buffers" (c-lang-const c-mode-menu protobuf))) - -;;;###autoload (add-to-list 'auto-mode-alist '("\\.proto\\'" . protobuf-mode)) - -;;;###autoload -(define-derived-mode protobuf-mode prog-mode "Protobuf" - "Major mode for editing Protocol Buffers description language. - -The hook `c-mode-common-hook' is run with no argument at mode -initialization, then `protobuf-mode-hook'. - -Key bindings: -\\{protobuf-mode-map}" - (interactive) - (kill-all-local-variables) - (set-syntax-table protobuf-mode-syntax-table) - (setq major-mode 'protobuf-mode - mode-name "Protocol-Buffers" - local-abbrev-table protobuf-mode-abbrev-table - abbrev-mode t) - (use-local-map protobuf-mode-map) - (c-initialize-cc-mode t) - (if (fboundp 'c-make-emacs-variables-local) - (c-make-emacs-variables-local)) - (c-init-language-vars protobuf-mode) - (c-common-init 'protobuf-mode) - (easy-menu-add protobuf-menu) - (c-run-mode-hooks 'c-mode-common-hook 'protobuf-mode-hook) - (c-update-modeline) - (setq imenu-generic-expression - '(("Message" "^[[:space:]]*message[[:space:]]+\\([[:alnum:]]+\\)" 1) - ("Enum" "^[[:space:]]*enum[[:space:]]+\\([[:alnum:]]+\\)" 1) - ("Service" "^[[:space:]]*service[[:space:]]+\\([[:alnum:]]+\\)" 1)))) - -(provide 'protobuf-mode) - -;;; protobuf-mode.el ends here diff --git a/extra/protobuf/protobuf-3.19.4/generate_descriptor_proto.sh b/extra/protobuf/protobuf-3.19.4/generate_descriptor_proto.sh deleted file mode 100755 index dc03fee019d1..000000000000 --- a/extra/protobuf/protobuf-3.19.4/generate_descriptor_proto.sh +++ /dev/null @@ -1,115 +0,0 @@ -#!/usr/bin/env bash - -# Run this script to regenerate descriptor.pb.{h,cc} after the protocol -# compiler changes. Since these files are compiled into the protocol compiler -# itself, they cannot be generated automatically by a make rule. "make check" -# will fail if these files do not match what the protocol compiler would -# generate. -# -# HINT: Flags passed to generate_descriptor_proto.sh will be passed directly -# to make when building protoc. This is particularly useful for passing -# -j4 to run 4 jobs simultaneously. - -if test ! -e src/google/protobuf/stubs/common.h; then - cat >&2 << __EOF__ -Could not find source code. Make sure you are running this script from the -root of the distribution tree. -__EOF__ - exit 1 -fi - -cd src - -declare -a RUNTIME_PROTO_FILES=(\ - google/protobuf/any.proto \ - google/protobuf/api.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) - -declare -a COMPILER_PROTO_FILES=(\ - google/protobuf/compiler/plugin.proto) - -CORE_PROTO_IS_CORRECT=0 -PROCESS_ROUND=1 -BOOTSTRAP_PROTOC="" -while [ $# -gt 0 ]; do - case $1 in - --bootstrap_protoc) - BOOTSTRAP_PROTOC=$2 - shift 2 - ;; - *) - break - ;; - esac - shift -done -TMP=$(mktemp -d) -echo "Updating descriptor protos..." -while [ $CORE_PROTO_IS_CORRECT -ne 1 ] -do - echo "Round $PROCESS_ROUND" - CORE_PROTO_IS_CORRECT=1 - - if [ "$BOOTSTRAP_PROTOC" != "" ]; then - PROTOC=$BOOTSTRAP_PROTOC - BOOTSTRAP_PROTOC="" - else - make -j$(nproc) $@ protoc - if test $? -ne 0; then - echo "Failed to build protoc." - exit 1 - fi - PROTOC="./protoc" - fi - - $PROTOC --cpp_out=dllexport_decl=PROTOBUF_EXPORT:$TMP ${RUNTIME_PROTO_FILES[@]} && \ - $PROTOC --cpp_out=dllexport_decl=PROTOC_EXPORT:$TMP ${COMPILER_PROTO_FILES[@]} - - for PROTO_FILE in ${RUNTIME_PROTO_FILES[@]} ${COMPILER_PROTO_FILES[@]}; do - BASE_NAME=${PROTO_FILE%.*} - diff ${BASE_NAME}.pb.h $TMP/${BASE_NAME}.pb.h > /dev/null - if test $? -ne 0; then - CORE_PROTO_IS_CORRECT=0 - fi - diff ${BASE_NAME}.pb.cc $TMP/${BASE_NAME}.pb.cc > /dev/null - if test $? -ne 0; then - CORE_PROTO_IS_CORRECT=0 - fi - done - - # Only override the output if the files are different to avoid re-compilation - # of the protoc. - if [ $CORE_PROTO_IS_CORRECT -ne 1 ]; then - for PROTO_FILE in ${RUNTIME_PROTO_FILES[@]} ${COMPILER_PROTO_FILES[@]}; do - BASE_NAME=${PROTO_FILE%.*} - mv $TMP/${BASE_NAME}.pb.h ${BASE_NAME}.pb.h - mv $TMP/${BASE_NAME}.pb.cc ${BASE_NAME}.pb.cc - done - fi - - PROCESS_ROUND=$((PROCESS_ROUND + 1)) -done -cd .. - -if test -x objectivec/generate_well_known_types.sh; then - echo "Generating messages for objc." - objectivec/generate_well_known_types.sh $@ -fi - -if test -x csharp/generate_protos.sh; then - echo "Generating messages for C#." - csharp/generate_protos.sh $@ -fi - -if test -x php/generate_descriptor_protos.sh; then - echo "Generating messages for PHP." - php/generate_descriptor_protos.sh $@ -fi diff --git a/extra/protobuf/protobuf-3.19.4/install-sh b/extra/protobuf/protobuf-3.19.4/install-sh deleted file mode 100755 index ec298b537402..000000000000 --- a/extra/protobuf/protobuf-3.19.4/install-sh +++ /dev/null @@ -1,541 +0,0 @@ -#!/bin/sh -# install - install a program, script, or datafile - -scriptversion=2020-11-14.01; # UTC - -# This originates from X11R5 (mit/util/scripts/install.sh), which was -# later released in X11R6 (xc/config/util/install.sh) with the -# following copyright and license. -# -# Copyright (C) 1994 X Consortium -# -# Permission is hereby granted, free of charge, to any person obtaining a copy -# of this software and associated documentation files (the "Software"), to -# deal in the Software without restriction, including without limitation the -# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or -# sell copies of the Software, and to permit persons to whom the Software is -# furnished to do so, subject to the following conditions: -# -# The above copyright notice and this permission notice shall be included in -# all copies or substantial portions of the Software. -# -# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -# X CONSORTIUM BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN -# AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNEC- -# TION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -# -# Except as contained in this notice, the name of the X Consortium shall not -# be used in advertising or otherwise to promote the sale, use or other deal- -# ings in this Software without prior written authorization from the X Consor- -# tium. -# -# -# FSF changes to this file are in the public domain. -# -# Calling this script install-sh is preferred over install.sh, to prevent -# 'make' implicit rules from creating a file called install from it -# when there is no Makefile. -# -# This script is compatible with the BSD install script, but was written -# from scratch. - -tab=' ' -nl=' -' -IFS=" $tab$nl" - -# Set DOITPROG to "echo" to test this script. - -doit=${DOITPROG-} -doit_exec=${doit:-exec} - -# Put in absolute file names if you don't have them in your path; -# or use environment vars. - -chgrpprog=${CHGRPPROG-chgrp} -chmodprog=${CHMODPROG-chmod} -chownprog=${CHOWNPROG-chown} -cmpprog=${CMPPROG-cmp} -cpprog=${CPPROG-cp} -mkdirprog=${MKDIRPROG-mkdir} -mvprog=${MVPROG-mv} -rmprog=${RMPROG-rm} -stripprog=${STRIPPROG-strip} - -posix_mkdir= - -# Desired mode of installed file. -mode=0755 - -# Create dirs (including intermediate dirs) using mode 755. -# This is like GNU 'install' as of coreutils 8.32 (2020). -mkdir_umask=22 - -backupsuffix= -chgrpcmd= -chmodcmd=$chmodprog -chowncmd= -mvcmd=$mvprog -rmcmd="$rmprog -f" -stripcmd= - -src= -dst= -dir_arg= -dst_arg= - -copy_on_change=false -is_target_a_directory=possibly - -usage="\ -Usage: $0 [OPTION]... [-T] SRCFILE DSTFILE - or: $0 [OPTION]... SRCFILES... DIRECTORY - or: $0 [OPTION]... -t DIRECTORY SRCFILES... - or: $0 [OPTION]... -d DIRECTORIES... - -In the 1st form, copy SRCFILE to DSTFILE. -In the 2nd and 3rd, copy all SRCFILES to DIRECTORY. -In the 4th, create DIRECTORIES. - -Options: - --help display this help and exit. - --version display version info and exit. - - -c (ignored) - -C install only if different (preserve data modification time) - -d create directories instead of installing files. - -g GROUP $chgrpprog installed files to GROUP. - -m MODE $chmodprog installed files to MODE. - -o USER $chownprog installed files to USER. - -p pass -p to $cpprog. - -s $stripprog installed files. - -S SUFFIX attempt to back up existing files, with suffix SUFFIX. - -t DIRECTORY install into DIRECTORY. - -T report an error if DSTFILE is a directory. - -Environment variables override the default commands: - CHGRPPROG CHMODPROG CHOWNPROG CMPPROG CPPROG MKDIRPROG MVPROG - RMPROG STRIPPROG - -By default, rm is invoked with -f; when overridden with RMPROG, -it's up to you to specify -f if you want it. - -If -S is not specified, no backups are attempted. - -Email bug reports to bug-automake@gnu.org. -Automake home page: https://www.gnu.org/software/automake/ -" - -while test $# -ne 0; do - case $1 in - -c) ;; - - -C) copy_on_change=true;; - - -d) dir_arg=true;; - - -g) chgrpcmd="$chgrpprog $2" - shift;; - - --help) echo "$usage"; exit $?;; - - -m) mode=$2 - case $mode in - *' '* | *"$tab"* | *"$nl"* | *'*'* | *'?'* | *'['*) - echo "$0: invalid mode: $mode" >&2 - exit 1;; - esac - shift;; - - -o) chowncmd="$chownprog $2" - shift;; - - -p) cpprog="$cpprog -p";; - - -s) stripcmd=$stripprog;; - - -S) backupsuffix="$2" - shift;; - - -t) - is_target_a_directory=always - dst_arg=$2 - # Protect names problematic for 'test' and other utilities. - case $dst_arg in - -* | [=\(\)!]) dst_arg=./$dst_arg;; - esac - shift;; - - -T) is_target_a_directory=never;; - - --version) echo "$0 $scriptversion"; exit $?;; - - --) shift - break;; - - -*) echo "$0: invalid option: $1" >&2 - exit 1;; - - *) break;; - esac - shift -done - -# We allow the use of options -d and -T together, by making -d -# take the precedence; this is for compatibility with GNU install. - -if test -n "$dir_arg"; then - if test -n "$dst_arg"; then - echo "$0: target directory not allowed when installing a directory." >&2 - exit 1 - fi -fi - -if test $# -ne 0 && test -z "$dir_arg$dst_arg"; then - # When -d is used, all remaining arguments are directories to create. - # When -t is used, the destination is already specified. - # Otherwise, the last argument is the destination. Remove it from $@. - for arg - do - if test -n "$dst_arg"; then - # $@ is not empty: it contains at least $arg. - set fnord "$@" "$dst_arg" - shift # fnord - fi - shift # arg - dst_arg=$arg - # Protect names problematic for 'test' and other utilities. - case $dst_arg in - -* | [=\(\)!]) dst_arg=./$dst_arg;; - esac - done -fi - -if test $# -eq 0; then - if test -z "$dir_arg"; then - echo "$0: no input file specified." >&2 - exit 1 - fi - # It's OK to call 'install-sh -d' without argument. - # This can happen when creating conditional directories. - exit 0 -fi - -if test -z "$dir_arg"; then - if test $# -gt 1 || test "$is_target_a_directory" = always; then - if test ! -d "$dst_arg"; then - echo "$0: $dst_arg: Is not a directory." >&2 - exit 1 - fi - fi -fi - -if test -z "$dir_arg"; then - do_exit='(exit $ret); exit $ret' - trap "ret=129; $do_exit" 1 - trap "ret=130; $do_exit" 2 - trap "ret=141; $do_exit" 13 - trap "ret=143; $do_exit" 15 - - # Set umask so as not to create temps with too-generous modes. - # However, 'strip' requires both read and write access to temps. - case $mode in - # Optimize common cases. - *644) cp_umask=133;; - *755) cp_umask=22;; - - *[0-7]) - if test -z "$stripcmd"; then - u_plus_rw= - else - u_plus_rw='% 200' - fi - cp_umask=`expr '(' 777 - $mode % 1000 ')' $u_plus_rw`;; - *) - if test -z "$stripcmd"; then - u_plus_rw= - else - u_plus_rw=,u+rw - fi - cp_umask=$mode$u_plus_rw;; - esac -fi - -for src -do - # Protect names problematic for 'test' and other utilities. - case $src in - -* | [=\(\)!]) src=./$src;; - esac - - if test -n "$dir_arg"; then - dst=$src - dstdir=$dst - test -d "$dstdir" - dstdir_status=$? - # Don't chown directories that already exist. - if test $dstdir_status = 0; then - chowncmd="" - fi - else - - # Waiting for this to be detected by the "$cpprog $src $dsttmp" command - # might cause directories to be created, which would be especially bad - # if $src (and thus $dsttmp) contains '*'. - if test ! -f "$src" && test ! -d "$src"; then - echo "$0: $src does not exist." >&2 - exit 1 - fi - - if test -z "$dst_arg"; then - echo "$0: no destination specified." >&2 - exit 1 - fi - dst=$dst_arg - - # If destination is a directory, append the input filename. - if test -d "$dst"; then - if test "$is_target_a_directory" = never; then - echo "$0: $dst_arg: Is a directory" >&2 - exit 1 - fi - dstdir=$dst - dstbase=`basename "$src"` - case $dst in - */) dst=$dst$dstbase;; - *) dst=$dst/$dstbase;; - esac - dstdir_status=0 - else - dstdir=`dirname "$dst"` - test -d "$dstdir" - dstdir_status=$? - fi - fi - - case $dstdir in - */) dstdirslash=$dstdir;; - *) dstdirslash=$dstdir/;; - esac - - obsolete_mkdir_used=false - - if test $dstdir_status != 0; then - case $posix_mkdir in - '') - # With -d, create the new directory with the user-specified mode. - # Otherwise, rely on $mkdir_umask. - if test -n "$dir_arg"; then - mkdir_mode=-m$mode - else - mkdir_mode= - fi - - posix_mkdir=false - # The $RANDOM variable is not portable (e.g., dash). Use it - # here however when possible just to lower collision chance. - tmpdir=${TMPDIR-/tmp}/ins$RANDOM-$$ - - trap ' - ret=$? - rmdir "$tmpdir/a/b" "$tmpdir/a" "$tmpdir" 2>/dev/null - exit $ret - ' 0 - - # Because "mkdir -p" follows existing symlinks and we likely work - # directly in world-writeable /tmp, make sure that the '$tmpdir' - # directory is successfully created first before we actually test - # 'mkdir -p'. - if (umask $mkdir_umask && - $mkdirprog $mkdir_mode "$tmpdir" && - exec $mkdirprog $mkdir_mode -p -- "$tmpdir/a/b") >/dev/null 2>&1 - then - if test -z "$dir_arg" || { - # Check for POSIX incompatibilities with -m. - # HP-UX 11.23 and IRIX 6.5 mkdir -m -p sets group- or - # other-writable bit of parent directory when it shouldn't. - # FreeBSD 6.1 mkdir -m -p sets mode of existing directory. - test_tmpdir="$tmpdir/a" - ls_ld_tmpdir=`ls -ld "$test_tmpdir"` - case $ls_ld_tmpdir in - d????-?r-*) different_mode=700;; - d????-?--*) different_mode=755;; - *) false;; - esac && - $mkdirprog -m$different_mode -p -- "$test_tmpdir" && { - ls_ld_tmpdir_1=`ls -ld "$test_tmpdir"` - test "$ls_ld_tmpdir" = "$ls_ld_tmpdir_1" - } - } - then posix_mkdir=: - fi - rmdir "$tmpdir/a/b" "$tmpdir/a" "$tmpdir" - else - # Remove any dirs left behind by ancient mkdir implementations. - rmdir ./$mkdir_mode ./-p ./-- "$tmpdir" 2>/dev/null - fi - trap '' 0;; - esac - - if - $posix_mkdir && ( - umask $mkdir_umask && - $doit_exec $mkdirprog $mkdir_mode -p -- "$dstdir" - ) - then : - else - - # mkdir does not conform to POSIX, - # or it failed possibly due to a race condition. Create the - # directory the slow way, step by step, checking for races as we go. - - case $dstdir in - /*) prefix='/';; - [-=\(\)!]*) prefix='./';; - *) prefix='';; - esac - - oIFS=$IFS - IFS=/ - set -f - set fnord $dstdir - shift - set +f - IFS=$oIFS - - prefixes= - - for d - do - test X"$d" = X && continue - - prefix=$prefix$d - if test -d "$prefix"; then - prefixes= - else - if $posix_mkdir; then - (umask $mkdir_umask && - $doit_exec $mkdirprog $mkdir_mode -p -- "$dstdir") && break - # Don't fail if two instances are running concurrently. - test -d "$prefix" || exit 1 - else - case $prefix in - *\'*) qprefix=`echo "$prefix" | sed "s/'/'\\\\\\\\''/g"`;; - *) qprefix=$prefix;; - esac - prefixes="$prefixes '$qprefix'" - fi - fi - prefix=$prefix/ - done - - if test -n "$prefixes"; then - # Don't fail if two instances are running concurrently. - (umask $mkdir_umask && - eval "\$doit_exec \$mkdirprog $prefixes") || - test -d "$dstdir" || exit 1 - obsolete_mkdir_used=true - fi - fi - fi - - if test -n "$dir_arg"; then - { test -z "$chowncmd" || $doit $chowncmd "$dst"; } && - { test -z "$chgrpcmd" || $doit $chgrpcmd "$dst"; } && - { test "$obsolete_mkdir_used$chowncmd$chgrpcmd" = false || - test -z "$chmodcmd" || $doit $chmodcmd $mode "$dst"; } || exit 1 - else - - # Make a couple of temp file names in the proper directory. - dsttmp=${dstdirslash}_inst.$$_ - rmtmp=${dstdirslash}_rm.$$_ - - # Trap to clean up those temp files at exit. - trap 'ret=$?; rm -f "$dsttmp" "$rmtmp" && exit $ret' 0 - - # Copy the file name to the temp name. - (umask $cp_umask && - { test -z "$stripcmd" || { - # Create $dsttmp read-write so that cp doesn't create it read-only, - # which would cause strip to fail. - if test -z "$doit"; then - : >"$dsttmp" # No need to fork-exec 'touch'. - else - $doit touch "$dsttmp" - fi - } - } && - $doit_exec $cpprog "$src" "$dsttmp") && - - # and set any options; do chmod last to preserve setuid bits. - # - # If any of these fail, we abort the whole thing. If we want to - # ignore errors from any of these, just make sure not to ignore - # errors from the above "$doit $cpprog $src $dsttmp" command. - # - { test -z "$chowncmd" || $doit $chowncmd "$dsttmp"; } && - { test -z "$chgrpcmd" || $doit $chgrpcmd "$dsttmp"; } && - { test -z "$stripcmd" || $doit $stripcmd "$dsttmp"; } && - { test -z "$chmodcmd" || $doit $chmodcmd $mode "$dsttmp"; } && - - # If -C, don't bother to copy if it wouldn't change the file. - if $copy_on_change && - old=`LC_ALL=C ls -dlL "$dst" 2>/dev/null` && - new=`LC_ALL=C ls -dlL "$dsttmp" 2>/dev/null` && - set -f && - set X $old && old=:$2:$4:$5:$6 && - set X $new && new=:$2:$4:$5:$6 && - set +f && - test "$old" = "$new" && - $cmpprog "$dst" "$dsttmp" >/dev/null 2>&1 - then - rm -f "$dsttmp" - else - # If $backupsuffix is set, and the file being installed - # already exists, attempt a backup. Don't worry if it fails, - # e.g., if mv doesn't support -f. - if test -n "$backupsuffix" && test -f "$dst"; then - $doit $mvcmd -f "$dst" "$dst$backupsuffix" 2>/dev/null - fi - - # Rename the file to the real destination. - $doit $mvcmd -f "$dsttmp" "$dst" 2>/dev/null || - - # The rename failed, perhaps because mv can't rename something else - # to itself, or perhaps because mv is so ancient that it does not - # support -f. - { - # Now remove or move aside any old file at destination location. - # We try this two ways since rm can't unlink itself on some - # systems and the destination file might be busy for other - # reasons. In this case, the final cleanup might fail but the new - # file should still install successfully. - { - test ! -f "$dst" || - $doit $rmcmd "$dst" 2>/dev/null || - { $doit $mvcmd -f "$dst" "$rmtmp" 2>/dev/null && - { $doit $rmcmd "$rmtmp" 2>/dev/null; :; } - } || - { echo "$0: cannot unlink or rename $dst" >&2 - (exit 1); exit 1 - } - } && - - # Now rename the file to the real destination. - $doit $mvcmd "$dsttmp" "$dst" - } - fi || exit 1 - - trap '' 0 - fi -done - -# Local variables: -# eval: (add-hook 'before-save-hook 'time-stamp) -# time-stamp-start: "scriptversion=" -# time-stamp-format: "%:y-%02m-%02d.%02H" -# time-stamp-time-zone: "UTC0" -# time-stamp-end: "; # UTC" -# End: diff --git a/extra/protobuf/protobuf-3.19.4/internal.bzl b/extra/protobuf/protobuf-3.19.4/internal.bzl deleted file mode 100644 index a281418c9bba..000000000000 --- a/extra/protobuf/protobuf-3.19.4/internal.bzl +++ /dev/null @@ -1,29 +0,0 @@ -# PLEASE DO NOT DEPEND ON THE CONTENTS OF THIS FILE, IT IS UNSTABLE. - -def conformance_test(name, testee, failure_list = None, text_format_failure_list = None): - args = ["--testee %s" % _strip_bazel(testee)] - failure_lists = [] - if failure_list: - args = args + ["--failure_list %s" % _strip_bazel(failure_list)] - failure_lists = failure_lists + [failure_list] - if text_format_failure_list: - args = args + ["--text_format_failure_list %s" % _strip_bazel(text_format_failure_list)] - failure_lists = failure_lists + [text_format_failure_list] - - native.sh_test( - name = name, - srcs = ["//:conformance/conformance_test_runner.sh"], - data = [testee] + failure_lists + [ - "//:conformance_test_runner", - ], - args = args, - deps = [ - "@bazel_tools//tools/bash/runfiles", - ], - ) - - -def _strip_bazel(testee): - if testee.startswith("//"): - testee = testee.replace("//", "com_google_protobuf") - return testee.replace(":", "/") diff --git a/extra/protobuf/protobuf-3.19.4/ltmain.sh b/extra/protobuf/protobuf-3.19.4/ltmain.sh deleted file mode 100755 index 21e5e0784726..000000000000 --- a/extra/protobuf/protobuf-3.19.4/ltmain.sh +++ /dev/null @@ -1,11251 +0,0 @@ -#! /bin/sh -## DO NOT EDIT - This file generated from ./build-aux/ltmain.in -## by inline-source v2014-01-03.01 - -# libtool (GNU libtool) 2.4.6 -# Provide generalized library-building support services. -# Written by Gordon Matzigkeit , 1996 - -# Copyright (C) 1996-2015 Free Software Foundation, Inc. -# This is free software; see the source for copying conditions. There is NO -# warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. - -# GNU Libtool is free software; you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation; either version 2 of the License, or -# (at your option) any later version. -# -# As a special exception to the GNU General Public License, -# if you distribute this file as part of a program or library that -# is built using GNU Libtool, you may include this file under the -# same distribution terms that you use for the rest of that program. -# -# GNU Libtool is distributed in the hope that it will be useful, but -# WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -# General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with this program. If not, see . - - -PROGRAM=libtool -PACKAGE=libtool -VERSION="2.4.6 Debian-2.4.6-15" -package_revision=2.4.6 - - -## ------ ## -## Usage. ## -## ------ ## - -# Run './libtool --help' for help with using this script from the -# command line. - - -## ------------------------------- ## -## User overridable command paths. ## -## ------------------------------- ## - -# After configure completes, it has a better idea of some of the -# shell tools we need than the defaults used by the functions shared -# with bootstrap, so set those here where they can still be over- -# ridden by the user, but otherwise take precedence. - -: ${AUTOCONF="autoconf"} -: ${AUTOMAKE="automake"} - - -## -------------------------- ## -## Source external libraries. ## -## -------------------------- ## - -# Much of our low-level functionality needs to be sourced from external -# libraries, which are installed to $pkgauxdir. - -# Set a version string for this script. -scriptversion=2015-01-20.17; # UTC - -# General shell script boiler plate, and helper functions. -# Written by Gary V. Vaughan, 2004 - -# Copyright (C) 2004-2015 Free Software Foundation, Inc. -# This is free software; see the source for copying conditions. There is NO -# warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. - -# This program is free software; you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation; either version 3 of the License, or -# (at your option) any later version. - -# As a special exception to the GNU General Public License, if you distribute -# this file as part of a program or library that is built using GNU Libtool, -# you may include this file under the same distribution terms that you use -# for the rest of that program. - -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNES FOR A PARTICULAR PURPOSE. See the GNU -# General Public License for more details. - -# You should have received a copy of the GNU General Public License -# along with this program. If not, see . - -# Please report bugs or propose patches to gary@gnu.org. - - -## ------ ## -## Usage. ## -## ------ ## - -# Evaluate this file near the top of your script to gain access to -# the functions and variables defined here: -# -# . `echo "$0" | ${SED-sed} 's|[^/]*$||'`/build-aux/funclib.sh -# -# If you need to override any of the default environment variable -# settings, do that before evaluating this file. - - -## -------------------- ## -## Shell normalisation. ## -## -------------------- ## - -# Some shells need a little help to be as Bourne compatible as possible. -# Before doing anything else, make sure all that help has been provided! - -DUALCASE=1; export DUALCASE # for MKS sh -if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then : - emulate sh - NULLCMD=: - # Pre-4.2 versions of Zsh do word splitting on ${1+"$@"}, which - # is contrary to our usage. Disable this feature. - alias -g '${1+"$@"}'='"$@"' - setopt NO_GLOB_SUBST -else - case `(set -o) 2>/dev/null` in *posix*) set -o posix ;; esac -fi - -# NLS nuisances: We save the old values in case they are required later. -_G_user_locale= -_G_safe_locale= -for _G_var in LANG LANGUAGE LC_ALL LC_CTYPE LC_COLLATE LC_MESSAGES -do - eval "if test set = \"\${$_G_var+set}\"; then - save_$_G_var=\$$_G_var - $_G_var=C - export $_G_var - _G_user_locale=\"$_G_var=\\\$save_\$_G_var; \$_G_user_locale\" - _G_safe_locale=\"$_G_var=C; \$_G_safe_locale\" - fi" -done - -# CDPATH. -(unset CDPATH) >/dev/null 2>&1 && unset CDPATH - -# Make sure IFS has a sensible default -sp=' ' -nl=' -' -IFS="$sp $nl" - -# There are apparently some retarded systems that use ';' as a PATH separator! -if test "${PATH_SEPARATOR+set}" != set; then - PATH_SEPARATOR=: - (PATH='/bin;/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 && { - (PATH='/bin:/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 || - PATH_SEPARATOR=';' - } -fi - - - -## ------------------------- ## -## Locate command utilities. ## -## ------------------------- ## - - -# func_executable_p FILE -# ---------------------- -# Check that FILE is an executable regular file. -func_executable_p () -{ - test -f "$1" && test -x "$1" -} - - -# func_path_progs PROGS_LIST CHECK_FUNC [PATH] -# -------------------------------------------- -# Search for either a program that responds to --version with output -# containing "GNU", or else returned by CHECK_FUNC otherwise, by -# trying all the directories in PATH with each of the elements of -# PROGS_LIST. -# -# CHECK_FUNC should accept the path to a candidate program, and -# set $func_check_prog_result if it truncates its output less than -# $_G_path_prog_max characters. -func_path_progs () -{ - _G_progs_list=$1 - _G_check_func=$2 - _G_PATH=${3-"$PATH"} - - _G_path_prog_max=0 - _G_path_prog_found=false - _G_save_IFS=$IFS; IFS=${PATH_SEPARATOR-:} - for _G_dir in $_G_PATH; do - IFS=$_G_save_IFS - test -z "$_G_dir" && _G_dir=. - for _G_prog_name in $_G_progs_list; do - for _exeext in '' .EXE; do - _G_path_prog=$_G_dir/$_G_prog_name$_exeext - func_executable_p "$_G_path_prog" || continue - case `"$_G_path_prog" --version 2>&1` in - *GNU*) func_path_progs_result=$_G_path_prog _G_path_prog_found=: ;; - *) $_G_check_func $_G_path_prog - func_path_progs_result=$func_check_prog_result - ;; - esac - $_G_path_prog_found && break 3 - done - done - done - IFS=$_G_save_IFS - test -z "$func_path_progs_result" && { - echo "no acceptable sed could be found in \$PATH" >&2 - exit 1 - } -} - - -# We want to be able to use the functions in this file before configure -# has figured out where the best binaries are kept, which means we have -# to search for them ourselves - except when the results are already set -# where we skip the searches. - -# Unless the user overrides by setting SED, search the path for either GNU -# sed, or the sed that truncates its output the least. -test -z "$SED" && { - _G_sed_script=s/aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb/ - for _G_i in 1 2 3 4 5 6 7; do - _G_sed_script=$_G_sed_script$nl$_G_sed_script - done - echo "$_G_sed_script" 2>/dev/null | sed 99q >conftest.sed - _G_sed_script= - - func_check_prog_sed () - { - _G_path_prog=$1 - - _G_count=0 - printf 0123456789 >conftest.in - while : - do - cat conftest.in conftest.in >conftest.tmp - mv conftest.tmp conftest.in - cp conftest.in conftest.nl - echo '' >> conftest.nl - "$_G_path_prog" -f conftest.sed conftest.out 2>/dev/null || break - diff conftest.out conftest.nl >/dev/null 2>&1 || break - _G_count=`expr $_G_count + 1` - if test "$_G_count" -gt "$_G_path_prog_max"; then - # Best one so far, save it but keep looking for a better one - func_check_prog_result=$_G_path_prog - _G_path_prog_max=$_G_count - fi - # 10*(2^10) chars as input seems more than enough - test 10 -lt "$_G_count" && break - done - rm -f conftest.in conftest.tmp conftest.nl conftest.out - } - - func_path_progs "sed gsed" func_check_prog_sed $PATH:/usr/xpg4/bin - rm -f conftest.sed - SED=$func_path_progs_result -} - - -# Unless the user overrides by setting GREP, search the path for either GNU -# grep, or the grep that truncates its output the least. -test -z "$GREP" && { - func_check_prog_grep () - { - _G_path_prog=$1 - - _G_count=0 - _G_path_prog_max=0 - printf 0123456789 >conftest.in - while : - do - cat conftest.in conftest.in >conftest.tmp - mv conftest.tmp conftest.in - cp conftest.in conftest.nl - echo 'GREP' >> conftest.nl - "$_G_path_prog" -e 'GREP$' -e '-(cannot match)-' conftest.out 2>/dev/null || break - diff conftest.out conftest.nl >/dev/null 2>&1 || break - _G_count=`expr $_G_count + 1` - if test "$_G_count" -gt "$_G_path_prog_max"; then - # Best one so far, save it but keep looking for a better one - func_check_prog_result=$_G_path_prog - _G_path_prog_max=$_G_count - fi - # 10*(2^10) chars as input seems more than enough - test 10 -lt "$_G_count" && break - done - rm -f conftest.in conftest.tmp conftest.nl conftest.out - } - - func_path_progs "grep ggrep" func_check_prog_grep $PATH:/usr/xpg4/bin - GREP=$func_path_progs_result -} - - -## ------------------------------- ## -## User overridable command paths. ## -## ------------------------------- ## - -# All uppercase variable names are used for environment variables. These -# variables can be overridden by the user before calling a script that -# uses them if a suitable command of that name is not already available -# in the command search PATH. - -: ${CP="cp -f"} -: ${ECHO="printf %s\n"} -: ${EGREP="$GREP -E"} -: ${FGREP="$GREP -F"} -: ${LN_S="ln -s"} -: ${MAKE="make"} -: ${MKDIR="mkdir"} -: ${MV="mv -f"} -: ${RM="rm -f"} -: ${SHELL="${CONFIG_SHELL-/bin/sh}"} - - -## -------------------- ## -## Useful sed snippets. ## -## -------------------- ## - -sed_dirname='s|/[^/]*$||' -sed_basename='s|^.*/||' - -# Sed substitution that helps us do robust quoting. It backslashifies -# metacharacters that are still active within double-quoted strings. -sed_quote_subst='s|\([`"$\\]\)|\\\1|g' - -# Same as above, but do not quote variable references. -sed_double_quote_subst='s/\(["`\\]\)/\\\1/g' - -# Sed substitution that turns a string into a regex matching for the -# string literally. -sed_make_literal_regex='s|[].[^$\\*\/]|\\&|g' - -# Sed substitution that converts a w32 file name or path -# that contains forward slashes, into one that contains -# (escaped) backslashes. A very naive implementation. -sed_naive_backslashify='s|\\\\*|\\|g;s|/|\\|g;s|\\|\\\\|g' - -# Re-'\' parameter expansions in output of sed_double_quote_subst that -# were '\'-ed in input to the same. If an odd number of '\' preceded a -# '$' in input to sed_double_quote_subst, that '$' was protected from -# expansion. Since each input '\' is now two '\'s, look for any number -# of runs of four '\'s followed by two '\'s and then a '$'. '\' that '$'. -_G_bs='\\' -_G_bs2='\\\\' -_G_bs4='\\\\\\\\' -_G_dollar='\$' -sed_double_backslash="\ - s/$_G_bs4/&\\ -/g - s/^$_G_bs2$_G_dollar/$_G_bs&/ - s/\\([^$_G_bs]\\)$_G_bs2$_G_dollar/\\1$_G_bs2$_G_bs$_G_dollar/g - s/\n//g" - - -## ----------------- ## -## Global variables. ## -## ----------------- ## - -# Except for the global variables explicitly listed below, the following -# functions in the '^func_' namespace, and the '^require_' namespace -# variables initialised in the 'Resource management' section, sourcing -# this file will not pollute your global namespace with anything -# else. There's no portable way to scope variables in Bourne shell -# though, so actually running these functions will sometimes place -# results into a variable named after the function, and often use -# temporary variables in the '^_G_' namespace. If you are careful to -# avoid using those namespaces casually in your sourcing script, things -# should continue to work as you expect. And, of course, you can freely -# overwrite any of the functions or variables defined here before -# calling anything to customize them. - -EXIT_SUCCESS=0 -EXIT_FAILURE=1 -EXIT_MISMATCH=63 # $? = 63 is used to indicate version mismatch to missing. -EXIT_SKIP=77 # $? = 77 is used to indicate a skipped test to automake. - -# Allow overriding, eg assuming that you follow the convention of -# putting '$debug_cmd' at the start of all your functions, you can get -# bash to show function call trace with: -# -# debug_cmd='echo "${FUNCNAME[0]} $*" >&2' bash your-script-name -debug_cmd=${debug_cmd-":"} -exit_cmd=: - -# By convention, finish your script with: -# -# exit $exit_status -# -# so that you can set exit_status to non-zero if you want to indicate -# something went wrong during execution without actually bailing out at -# the point of failure. -exit_status=$EXIT_SUCCESS - -# Work around backward compatibility issue on IRIX 6.5. On IRIX 6.4+, sh -# is ksh but when the shell is invoked as "sh" and the current value of -# the _XPG environment variable is not equal to 1 (one), the special -# positional parameter $0, within a function call, is the name of the -# function. -progpath=$0 - -# The name of this program. -progname=`$ECHO "$progpath" |$SED "$sed_basename"` - -# Make sure we have an absolute progpath for reexecution: -case $progpath in - [\\/]*|[A-Za-z]:\\*) ;; - *[\\/]*) - progdir=`$ECHO "$progpath" |$SED "$sed_dirname"` - progdir=`cd "$progdir" && pwd` - progpath=$progdir/$progname - ;; - *) - _G_IFS=$IFS - IFS=${PATH_SEPARATOR-:} - for progdir in $PATH; do - IFS=$_G_IFS - test -x "$progdir/$progname" && break - done - IFS=$_G_IFS - test -n "$progdir" || progdir=`pwd` - progpath=$progdir/$progname - ;; -esac - - -## ----------------- ## -## Standard options. ## -## ----------------- ## - -# The following options affect the operation of the functions defined -# below, and should be set appropriately depending on run-time para- -# meters passed on the command line. - -opt_dry_run=false -opt_quiet=false -opt_verbose=false - -# Categories 'all' and 'none' are always available. Append any others -# you will pass as the first argument to func_warning from your own -# code. -warning_categories= - -# By default, display warnings according to 'opt_warning_types'. Set -# 'warning_func' to ':' to elide all warnings, or func_fatal_error to -# treat the next displayed warning as a fatal error. -warning_func=func_warn_and_continue - -# Set to 'all' to display all warnings, 'none' to suppress all -# warnings, or a space delimited list of some subset of -# 'warning_categories' to display only the listed warnings. -opt_warning_types=all - - -## -------------------- ## -## Resource management. ## -## -------------------- ## - -# This section contains definitions for functions that each ensure a -# particular resource (a file, or a non-empty configuration variable for -# example) is available, and if appropriate to extract default values -# from pertinent package files. Call them using their associated -# 'require_*' variable to ensure that they are executed, at most, once. -# -# It's entirely deliberate that calling these functions can set -# variables that don't obey the namespace limitations obeyed by the rest -# of this file, in order that that they be as useful as possible to -# callers. - - -# require_term_colors -# ------------------- -# Allow display of bold text on terminals that support it. -require_term_colors=func_require_term_colors -func_require_term_colors () -{ - $debug_cmd - - test -t 1 && { - # COLORTERM and USE_ANSI_COLORS environment variables take - # precedence, because most terminfo databases neglect to describe - # whether color sequences are supported. - test -n "${COLORTERM+set}" && : ${USE_ANSI_COLORS="1"} - - if test 1 = "$USE_ANSI_COLORS"; then - # Standard ANSI escape sequences - tc_reset='' - tc_bold=''; tc_standout='' - tc_red=''; tc_green='' - tc_blue=''; tc_cyan='' - else - # Otherwise trust the terminfo database after all. - test -n "`tput sgr0 2>/dev/null`" && { - tc_reset=`tput sgr0` - test -n "`tput bold 2>/dev/null`" && tc_bold=`tput bold` - tc_standout=$tc_bold - test -n "`tput smso 2>/dev/null`" && tc_standout=`tput smso` - test -n "`tput setaf 1 2>/dev/null`" && tc_red=`tput setaf 1` - test -n "`tput setaf 2 2>/dev/null`" && tc_green=`tput setaf 2` - test -n "`tput setaf 4 2>/dev/null`" && tc_blue=`tput setaf 4` - test -n "`tput setaf 5 2>/dev/null`" && tc_cyan=`tput setaf 5` - } - fi - } - - require_term_colors=: -} - - -## ----------------- ## -## Function library. ## -## ----------------- ## - -# This section contains a variety of useful functions to call in your -# scripts. Take note of the portable wrappers for features provided by -# some modern shells, which will fall back to slower equivalents on -# less featureful shells. - - -# func_append VAR VALUE -# --------------------- -# Append VALUE onto the existing contents of VAR. - - # We should try to minimise forks, especially on Windows where they are - # unreasonably slow, so skip the feature probes when bash or zsh are - # being used: - if test set = "${BASH_VERSION+set}${ZSH_VERSION+set}"; then - : ${_G_HAVE_ARITH_OP="yes"} - : ${_G_HAVE_XSI_OPS="yes"} - # The += operator was introduced in bash 3.1 - case $BASH_VERSION in - [12].* | 3.0 | 3.0*) ;; - *) - : ${_G_HAVE_PLUSEQ_OP="yes"} - ;; - esac - fi - - # _G_HAVE_PLUSEQ_OP - # Can be empty, in which case the shell is probed, "yes" if += is - # useable or anything else if it does not work. - test -z "$_G_HAVE_PLUSEQ_OP" \ - && (eval 'x=a; x+=" b"; test "a b" = "$x"') 2>/dev/null \ - && _G_HAVE_PLUSEQ_OP=yes - -if test yes = "$_G_HAVE_PLUSEQ_OP" -then - # This is an XSI compatible shell, allowing a faster implementation... - eval 'func_append () - { - $debug_cmd - - eval "$1+=\$2" - }' -else - # ...otherwise fall back to using expr, which is often a shell builtin. - func_append () - { - $debug_cmd - - eval "$1=\$$1\$2" - } -fi - - -# func_append_quoted VAR VALUE -# ---------------------------- -# Quote VALUE and append to the end of shell variable VAR, separated -# by a space. -if test yes = "$_G_HAVE_PLUSEQ_OP"; then - eval 'func_append_quoted () - { - $debug_cmd - - func_quote_for_eval "$2" - eval "$1+=\\ \$func_quote_for_eval_result" - }' -else - func_append_quoted () - { - $debug_cmd - - func_quote_for_eval "$2" - eval "$1=\$$1\\ \$func_quote_for_eval_result" - } -fi - - -# func_append_uniq VAR VALUE -# -------------------------- -# Append unique VALUE onto the existing contents of VAR, assuming -# entries are delimited by the first character of VALUE. For example: -# -# func_append_uniq options " --another-option option-argument" -# -# will only append to $options if " --another-option option-argument " -# is not already present somewhere in $options already (note spaces at -# each end implied by leading space in second argument). -func_append_uniq () -{ - $debug_cmd - - eval _G_current_value='`$ECHO $'$1'`' - _G_delim=`expr "$2" : '\(.\)'` - - case $_G_delim$_G_current_value$_G_delim in - *"$2$_G_delim"*) ;; - *) func_append "$@" ;; - esac -} - - -# func_arith TERM... -# ------------------ -# Set func_arith_result to the result of evaluating TERMs. - test -z "$_G_HAVE_ARITH_OP" \ - && (eval 'test 2 = $(( 1 + 1 ))') 2>/dev/null \ - && _G_HAVE_ARITH_OP=yes - -if test yes = "$_G_HAVE_ARITH_OP"; then - eval 'func_arith () - { - $debug_cmd - - func_arith_result=$(( $* )) - }' -else - func_arith () - { - $debug_cmd - - func_arith_result=`expr "$@"` - } -fi - - -# func_basename FILE -# ------------------ -# Set func_basename_result to FILE with everything up to and including -# the last / stripped. -if test yes = "$_G_HAVE_XSI_OPS"; then - # If this shell supports suffix pattern removal, then use it to avoid - # forking. Hide the definitions single quotes in case the shell chokes - # on unsupported syntax... - _b='func_basename_result=${1##*/}' - _d='case $1 in - */*) func_dirname_result=${1%/*}$2 ;; - * ) func_dirname_result=$3 ;; - esac' - -else - # ...otherwise fall back to using sed. - _b='func_basename_result=`$ECHO "$1" |$SED "$sed_basename"`' - _d='func_dirname_result=`$ECHO "$1" |$SED "$sed_dirname"` - if test "X$func_dirname_result" = "X$1"; then - func_dirname_result=$3 - else - func_append func_dirname_result "$2" - fi' -fi - -eval 'func_basename () -{ - $debug_cmd - - '"$_b"' -}' - - -# func_dirname FILE APPEND NONDIR_REPLACEMENT -# ------------------------------------------- -# Compute the dirname of FILE. If nonempty, add APPEND to the result, -# otherwise set result to NONDIR_REPLACEMENT. -eval 'func_dirname () -{ - $debug_cmd - - '"$_d"' -}' - - -# func_dirname_and_basename FILE APPEND NONDIR_REPLACEMENT -# -------------------------------------------------------- -# Perform func_basename and func_dirname in a single function -# call: -# dirname: Compute the dirname of FILE. If nonempty, -# add APPEND to the result, otherwise set result -# to NONDIR_REPLACEMENT. -# value returned in "$func_dirname_result" -# basename: Compute filename of FILE. -# value retuned in "$func_basename_result" -# For efficiency, we do not delegate to the functions above but instead -# duplicate the functionality here. -eval 'func_dirname_and_basename () -{ - $debug_cmd - - '"$_b"' - '"$_d"' -}' - - -# func_echo ARG... -# ---------------- -# Echo program name prefixed message. -func_echo () -{ - $debug_cmd - - _G_message=$* - - func_echo_IFS=$IFS - IFS=$nl - for _G_line in $_G_message; do - IFS=$func_echo_IFS - $ECHO "$progname: $_G_line" - done - IFS=$func_echo_IFS -} - - -# func_echo_all ARG... -# -------------------- -# Invoke $ECHO with all args, space-separated. -func_echo_all () -{ - $ECHO "$*" -} - - -# func_echo_infix_1 INFIX ARG... -# ------------------------------ -# Echo program name, followed by INFIX on the first line, with any -# additional lines not showing INFIX. -func_echo_infix_1 () -{ - $debug_cmd - - $require_term_colors - - _G_infix=$1; shift - _G_indent=$_G_infix - _G_prefix="$progname: $_G_infix: " - _G_message=$* - - # Strip color escape sequences before counting printable length - for _G_tc in "$tc_reset" "$tc_bold" "$tc_standout" "$tc_red" "$tc_green" "$tc_blue" "$tc_cyan" - do - test -n "$_G_tc" && { - _G_esc_tc=`$ECHO "$_G_tc" | $SED "$sed_make_literal_regex"` - _G_indent=`$ECHO "$_G_indent" | $SED "s|$_G_esc_tc||g"` - } - done - _G_indent="$progname: "`echo "$_G_indent" | $SED 's|.| |g'`" " ## exclude from sc_prohibit_nested_quotes - - func_echo_infix_1_IFS=$IFS - IFS=$nl - for _G_line in $_G_message; do - IFS=$func_echo_infix_1_IFS - $ECHO "$_G_prefix$tc_bold$_G_line$tc_reset" >&2 - _G_prefix=$_G_indent - done - IFS=$func_echo_infix_1_IFS -} - - -# func_error ARG... -# ----------------- -# Echo program name prefixed message to standard error. -func_error () -{ - $debug_cmd - - $require_term_colors - - func_echo_infix_1 " $tc_standout${tc_red}error$tc_reset" "$*" >&2 -} - - -# func_fatal_error ARG... -# ----------------------- -# Echo program name prefixed message to standard error, and exit. -func_fatal_error () -{ - $debug_cmd - - func_error "$*" - exit $EXIT_FAILURE -} - - -# func_grep EXPRESSION FILENAME -# ----------------------------- -# Check whether EXPRESSION matches any line of FILENAME, without output. -func_grep () -{ - $debug_cmd - - $GREP "$1" "$2" >/dev/null 2>&1 -} - - -# func_len STRING -# --------------- -# Set func_len_result to the length of STRING. STRING may not -# start with a hyphen. - test -z "$_G_HAVE_XSI_OPS" \ - && (eval 'x=a/b/c; - test 5aa/bb/cc = "${#x}${x%%/*}${x%/*}${x#*/}${x##*/}"') 2>/dev/null \ - && _G_HAVE_XSI_OPS=yes - -if test yes = "$_G_HAVE_XSI_OPS"; then - eval 'func_len () - { - $debug_cmd - - func_len_result=${#1} - }' -else - func_len () - { - $debug_cmd - - func_len_result=`expr "$1" : ".*" 2>/dev/null || echo $max_cmd_len` - } -fi - - -# func_mkdir_p DIRECTORY-PATH -# --------------------------- -# Make sure the entire path to DIRECTORY-PATH is available. -func_mkdir_p () -{ - $debug_cmd - - _G_directory_path=$1 - _G_dir_list= - - if test -n "$_G_directory_path" && test : != "$opt_dry_run"; then - - # Protect directory names starting with '-' - case $_G_directory_path in - -*) _G_directory_path=./$_G_directory_path ;; - esac - - # While some portion of DIR does not yet exist... - while test ! -d "$_G_directory_path"; do - # ...make a list in topmost first order. Use a colon delimited - # list incase some portion of path contains whitespace. - _G_dir_list=$_G_directory_path:$_G_dir_list - - # If the last portion added has no slash in it, the list is done - case $_G_directory_path in */*) ;; *) break ;; esac - - # ...otherwise throw away the child directory and loop - _G_directory_path=`$ECHO "$_G_directory_path" | $SED -e "$sed_dirname"` - done - _G_dir_list=`$ECHO "$_G_dir_list" | $SED 's|:*$||'` - - func_mkdir_p_IFS=$IFS; IFS=: - for _G_dir in $_G_dir_list; do - IFS=$func_mkdir_p_IFS - # mkdir can fail with a 'File exist' error if two processes - # try to create one of the directories concurrently. Don't - # stop in that case! - $MKDIR "$_G_dir" 2>/dev/null || : - done - IFS=$func_mkdir_p_IFS - - # Bail out if we (or some other process) failed to create a directory. - test -d "$_G_directory_path" || \ - func_fatal_error "Failed to create '$1'" - fi -} - - -# func_mktempdir [BASENAME] -# ------------------------- -# Make a temporary directory that won't clash with other running -# libtool processes, and avoids race conditions if possible. If -# given, BASENAME is the basename for that directory. -func_mktempdir () -{ - $debug_cmd - - _G_template=${TMPDIR-/tmp}/${1-$progname} - - if test : = "$opt_dry_run"; then - # Return a directory name, but don't create it in dry-run mode - _G_tmpdir=$_G_template-$$ - else - - # If mktemp works, use that first and foremost - _G_tmpdir=`mktemp -d "$_G_template-XXXXXXXX" 2>/dev/null` - - if test ! -d "$_G_tmpdir"; then - # Failing that, at least try and use $RANDOM to avoid a race - _G_tmpdir=$_G_template-${RANDOM-0}$$ - - func_mktempdir_umask=`umask` - umask 0077 - $MKDIR "$_G_tmpdir" - umask $func_mktempdir_umask - fi - - # If we're not in dry-run mode, bomb out on failure - test -d "$_G_tmpdir" || \ - func_fatal_error "cannot create temporary directory '$_G_tmpdir'" - fi - - $ECHO "$_G_tmpdir" -} - - -# func_normal_abspath PATH -# ------------------------ -# Remove doubled-up and trailing slashes, "." path components, -# and cancel out any ".." path components in PATH after making -# it an absolute path. -func_normal_abspath () -{ - $debug_cmd - - # These SED scripts presuppose an absolute path with a trailing slash. - _G_pathcar='s|^/\([^/]*\).*$|\1|' - _G_pathcdr='s|^/[^/]*||' - _G_removedotparts=':dotsl - s|/\./|/|g - t dotsl - s|/\.$|/|' - _G_collapseslashes='s|/\{1,\}|/|g' - _G_finalslash='s|/*$|/|' - - # Start from root dir and reassemble the path. - func_normal_abspath_result= - func_normal_abspath_tpath=$1 - func_normal_abspath_altnamespace= - case $func_normal_abspath_tpath in - "") - # Empty path, that just means $cwd. - func_stripname '' '/' "`pwd`" - func_normal_abspath_result=$func_stripname_result - return - ;; - # The next three entries are used to spot a run of precisely - # two leading slashes without using negated character classes; - # we take advantage of case's first-match behaviour. - ///*) - # Unusual form of absolute path, do nothing. - ;; - //*) - # Not necessarily an ordinary path; POSIX reserves leading '//' - # and for example Cygwin uses it to access remote file shares - # over CIFS/SMB, so we conserve a leading double slash if found. - func_normal_abspath_altnamespace=/ - ;; - /*) - # Absolute path, do nothing. - ;; - *) - # Relative path, prepend $cwd. - func_normal_abspath_tpath=`pwd`/$func_normal_abspath_tpath - ;; - esac - - # Cancel out all the simple stuff to save iterations. We also want - # the path to end with a slash for ease of parsing, so make sure - # there is one (and only one) here. - func_normal_abspath_tpath=`$ECHO "$func_normal_abspath_tpath" | $SED \ - -e "$_G_removedotparts" -e "$_G_collapseslashes" -e "$_G_finalslash"` - while :; do - # Processed it all yet? - if test / = "$func_normal_abspath_tpath"; then - # If we ascended to the root using ".." the result may be empty now. - if test -z "$func_normal_abspath_result"; then - func_normal_abspath_result=/ - fi - break - fi - func_normal_abspath_tcomponent=`$ECHO "$func_normal_abspath_tpath" | $SED \ - -e "$_G_pathcar"` - func_normal_abspath_tpath=`$ECHO "$func_normal_abspath_tpath" | $SED \ - -e "$_G_pathcdr"` - # Figure out what to do with it - case $func_normal_abspath_tcomponent in - "") - # Trailing empty path component, ignore it. - ;; - ..) - # Parent dir; strip last assembled component from result. - func_dirname "$func_normal_abspath_result" - func_normal_abspath_result=$func_dirname_result - ;; - *) - # Actual path component, append it. - func_append func_normal_abspath_result "/$func_normal_abspath_tcomponent" - ;; - esac - done - # Restore leading double-slash if one was found on entry. - func_normal_abspath_result=$func_normal_abspath_altnamespace$func_normal_abspath_result -} - - -# func_notquiet ARG... -# -------------------- -# Echo program name prefixed message only when not in quiet mode. -func_notquiet () -{ - $debug_cmd - - $opt_quiet || func_echo ${1+"$@"} - - # A bug in bash halts the script if the last line of a function - # fails when set -e is in force, so we need another command to - # work around that: - : -} - - -# func_relative_path SRCDIR DSTDIR -# -------------------------------- -# Set func_relative_path_result to the relative path from SRCDIR to DSTDIR. -func_relative_path () -{ - $debug_cmd - - func_relative_path_result= - func_normal_abspath "$1" - func_relative_path_tlibdir=$func_normal_abspath_result - func_normal_abspath "$2" - func_relative_path_tbindir=$func_normal_abspath_result - - # Ascend the tree starting from libdir - while :; do - # check if we have found a prefix of bindir - case $func_relative_path_tbindir in - $func_relative_path_tlibdir) - # found an exact match - func_relative_path_tcancelled= - break - ;; - $func_relative_path_tlibdir*) - # found a matching prefix - func_stripname "$func_relative_path_tlibdir" '' "$func_relative_path_tbindir" - func_relative_path_tcancelled=$func_stripname_result - if test -z "$func_relative_path_result"; then - func_relative_path_result=. - fi - break - ;; - *) - func_dirname $func_relative_path_tlibdir - func_relative_path_tlibdir=$func_dirname_result - if test -z "$func_relative_path_tlibdir"; then - # Have to descend all the way to the root! - func_relative_path_result=../$func_relative_path_result - func_relative_path_tcancelled=$func_relative_path_tbindir - break - fi - func_relative_path_result=../$func_relative_path_result - ;; - esac - done - - # Now calculate path; take care to avoid doubling-up slashes. - func_stripname '' '/' "$func_relative_path_result" - func_relative_path_result=$func_stripname_result - func_stripname '/' '/' "$func_relative_path_tcancelled" - if test -n "$func_stripname_result"; then - func_append func_relative_path_result "/$func_stripname_result" - fi - - # Normalisation. If bindir is libdir, return '.' else relative path. - if test -n "$func_relative_path_result"; then - func_stripname './' '' "$func_relative_path_result" - func_relative_path_result=$func_stripname_result - fi - - test -n "$func_relative_path_result" || func_relative_path_result=. - - : -} - - -# func_quote_for_eval ARG... -# -------------------------- -# Aesthetically quote ARGs to be evaled later. -# This function returns two values: -# i) func_quote_for_eval_result -# double-quoted, suitable for a subsequent eval -# ii) func_quote_for_eval_unquoted_result -# has all characters that are still active within double -# quotes backslashified. -func_quote_for_eval () -{ - $debug_cmd - - func_quote_for_eval_unquoted_result= - func_quote_for_eval_result= - while test 0 -lt $#; do - case $1 in - *[\\\`\"\$]*) - _G_unquoted_arg=`printf '%s\n' "$1" |$SED "$sed_quote_subst"` ;; - *) - _G_unquoted_arg=$1 ;; - esac - if test -n "$func_quote_for_eval_unquoted_result"; then - func_append func_quote_for_eval_unquoted_result " $_G_unquoted_arg" - else - func_append func_quote_for_eval_unquoted_result "$_G_unquoted_arg" - fi - - case $_G_unquoted_arg in - # Double-quote args containing shell metacharacters to delay - # word splitting, command substitution and variable expansion - # for a subsequent eval. - # Many Bourne shells cannot handle close brackets correctly - # in scan sets, so we specify it separately. - *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"") - _G_quoted_arg=\"$_G_unquoted_arg\" - ;; - *) - _G_quoted_arg=$_G_unquoted_arg - ;; - esac - - if test -n "$func_quote_for_eval_result"; then - func_append func_quote_for_eval_result " $_G_quoted_arg" - else - func_append func_quote_for_eval_result "$_G_quoted_arg" - fi - shift - done -} - - -# func_quote_for_expand ARG -# ------------------------- -# Aesthetically quote ARG to be evaled later; same as above, -# but do not quote variable references. -func_quote_for_expand () -{ - $debug_cmd - - case $1 in - *[\\\`\"]*) - _G_arg=`$ECHO "$1" | $SED \ - -e "$sed_double_quote_subst" -e "$sed_double_backslash"` ;; - *) - _G_arg=$1 ;; - esac - - case $_G_arg in - # Double-quote args containing shell metacharacters to delay - # word splitting and command substitution for a subsequent eval. - # Many Bourne shells cannot handle close brackets correctly - # in scan sets, so we specify it separately. - *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"") - _G_arg=\"$_G_arg\" - ;; - esac - - func_quote_for_expand_result=$_G_arg -} - - -# func_stripname PREFIX SUFFIX NAME -# --------------------------------- -# strip PREFIX and SUFFIX from NAME, and store in func_stripname_result. -# PREFIX and SUFFIX must not contain globbing or regex special -# characters, hashes, percent signs, but SUFFIX may contain a leading -# dot (in which case that matches only a dot). -if test yes = "$_G_HAVE_XSI_OPS"; then - eval 'func_stripname () - { - $debug_cmd - - # pdksh 5.2.14 does not do ${X%$Y} correctly if both X and Y are - # positional parameters, so assign one to ordinary variable first. - func_stripname_result=$3 - func_stripname_result=${func_stripname_result#"$1"} - func_stripname_result=${func_stripname_result%"$2"} - }' -else - func_stripname () - { - $debug_cmd - - case $2 in - .*) func_stripname_result=`$ECHO "$3" | $SED -e "s%^$1%%" -e "s%\\\\$2\$%%"`;; - *) func_stripname_result=`$ECHO "$3" | $SED -e "s%^$1%%" -e "s%$2\$%%"`;; - esac - } -fi - - -# func_show_eval CMD [FAIL_EXP] -# ----------------------------- -# Unless opt_quiet is true, then output CMD. Then, if opt_dryrun is -# not true, evaluate CMD. If the evaluation of CMD fails, and FAIL_EXP -# is given, then evaluate it. -func_show_eval () -{ - $debug_cmd - - _G_cmd=$1 - _G_fail_exp=${2-':'} - - func_quote_for_expand "$_G_cmd" - eval "func_notquiet $func_quote_for_expand_result" - - $opt_dry_run || { - eval "$_G_cmd" - _G_status=$? - if test 0 -ne "$_G_status"; then - eval "(exit $_G_status); $_G_fail_exp" - fi - } -} - - -# func_show_eval_locale CMD [FAIL_EXP] -# ------------------------------------ -# Unless opt_quiet is true, then output CMD. Then, if opt_dryrun is -# not true, evaluate CMD. If the evaluation of CMD fails, and FAIL_EXP -# is given, then evaluate it. Use the saved locale for evaluation. -func_show_eval_locale () -{ - $debug_cmd - - _G_cmd=$1 - _G_fail_exp=${2-':'} - - $opt_quiet || { - func_quote_for_expand "$_G_cmd" - eval "func_echo $func_quote_for_expand_result" - } - - $opt_dry_run || { - eval "$_G_user_locale - $_G_cmd" - _G_status=$? - eval "$_G_safe_locale" - if test 0 -ne "$_G_status"; then - eval "(exit $_G_status); $_G_fail_exp" - fi - } -} - - -# func_tr_sh -# ---------- -# Turn $1 into a string suitable for a shell variable name. -# Result is stored in $func_tr_sh_result. All characters -# not in the set a-zA-Z0-9_ are replaced with '_'. Further, -# if $1 begins with a digit, a '_' is prepended as well. -func_tr_sh () -{ - $debug_cmd - - case $1 in - [0-9]* | *[!a-zA-Z0-9_]*) - func_tr_sh_result=`$ECHO "$1" | $SED -e 's/^\([0-9]\)/_\1/' -e 's/[^a-zA-Z0-9_]/_/g'` - ;; - * ) - func_tr_sh_result=$1 - ;; - esac -} - - -# func_verbose ARG... -# ------------------- -# Echo program name prefixed message in verbose mode only. -func_verbose () -{ - $debug_cmd - - $opt_verbose && func_echo "$*" - - : -} - - -# func_warn_and_continue ARG... -# ----------------------------- -# Echo program name prefixed warning message to standard error. -func_warn_and_continue () -{ - $debug_cmd - - $require_term_colors - - func_echo_infix_1 "${tc_red}warning$tc_reset" "$*" >&2 -} - - -# func_warning CATEGORY ARG... -# ---------------------------- -# Echo program name prefixed warning message to standard error. Warning -# messages can be filtered according to CATEGORY, where this function -# elides messages where CATEGORY is not listed in the global variable -# 'opt_warning_types'. -func_warning () -{ - $debug_cmd - - # CATEGORY must be in the warning_categories list! - case " $warning_categories " in - *" $1 "*) ;; - *) func_internal_error "invalid warning category '$1'" ;; - esac - - _G_category=$1 - shift - - case " $opt_warning_types " in - *" $_G_category "*) $warning_func ${1+"$@"} ;; - esac -} - - -# func_sort_ver VER1 VER2 -# ----------------------- -# 'sort -V' is not generally available. -# Note this deviates from the version comparison in automake -# in that it treats 1.5 < 1.5.0, and treats 1.4.4a < 1.4-p3a -# but this should suffice as we won't be specifying old -# version formats or redundant trailing .0 in bootstrap.conf. -# If we did want full compatibility then we should probably -# use m4_version_compare from autoconf. -func_sort_ver () -{ - $debug_cmd - - printf '%s\n%s\n' "$1" "$2" \ - | sort -t. -k 1,1n -k 2,2n -k 3,3n -k 4,4n -k 5,5n -k 6,6n -k 7,7n -k 8,8n -k 9,9n -} - -# func_lt_ver PREV CURR -# --------------------- -# Return true if PREV and CURR are in the correct order according to -# func_sort_ver, otherwise false. Use it like this: -# -# func_lt_ver "$prev_ver" "$proposed_ver" || func_fatal_error "..." -func_lt_ver () -{ - $debug_cmd - - test "x$1" = x`func_sort_ver "$1" "$2" | $SED 1q` -} - - -# Local variables: -# mode: shell-script -# sh-indentation: 2 -# eval: (add-hook 'before-save-hook 'time-stamp) -# time-stamp-pattern: "10/scriptversion=%:y-%02m-%02d.%02H; # UTC" -# time-stamp-time-zone: "UTC" -# End: -#! /bin/sh - -# Set a version string for this script. -scriptversion=2015-10-07.11; # UTC - -# A portable, pluggable option parser for Bourne shell. -# Written by Gary V. Vaughan, 2010 - -# Copyright (C) 2010-2015 Free Software Foundation, Inc. -# This is free software; see the source for copying conditions. There is NO -# warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. - -# This program is free software: you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation, either version 3 of the License, or -# (at your option) any later version. - -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. - -# You should have received a copy of the GNU General Public License -# along with this program. If not, see . - -# Please report bugs or propose patches to gary@gnu.org. - - -## ------ ## -## Usage. ## -## ------ ## - -# This file is a library for parsing options in your shell scripts along -# with assorted other useful supporting features that you can make use -# of too. -# -# For the simplest scripts you might need only: -# -# #!/bin/sh -# . relative/path/to/funclib.sh -# . relative/path/to/options-parser -# scriptversion=1.0 -# func_options ${1+"$@"} -# eval set dummy "$func_options_result"; shift -# ...rest of your script... -# -# In order for the '--version' option to work, you will need to have a -# suitably formatted comment like the one at the top of this file -# starting with '# Written by ' and ending with '# warranty; '. -# -# For '-h' and '--help' to work, you will also need a one line -# description of your script's purpose in a comment directly above the -# '# Written by ' line, like the one at the top of this file. -# -# The default options also support '--debug', which will turn on shell -# execution tracing (see the comment above debug_cmd below for another -# use), and '--verbose' and the func_verbose function to allow your script -# to display verbose messages only when your user has specified -# '--verbose'. -# -# After sourcing this file, you can plug processing for additional -# options by amending the variables from the 'Configuration' section -# below, and following the instructions in the 'Option parsing' -# section further down. - -## -------------- ## -## Configuration. ## -## -------------- ## - -# You should override these variables in your script after sourcing this -# file so that they reflect the customisations you have added to the -# option parser. - -# The usage line for option parsing errors and the start of '-h' and -# '--help' output messages. You can embed shell variables for delayed -# expansion at the time the message is displayed, but you will need to -# quote other shell meta-characters carefully to prevent them being -# expanded when the contents are evaled. -usage='$progpath [OPTION]...' - -# Short help message in response to '-h' and '--help'. Add to this or -# override it after sourcing this library to reflect the full set of -# options your script accepts. -usage_message="\ - --debug enable verbose shell tracing - -W, --warnings=CATEGORY - report the warnings falling in CATEGORY [all] - -v, --verbose verbosely report processing - --version print version information and exit - -h, --help print short or long help message and exit -" - -# Additional text appended to 'usage_message' in response to '--help'. -long_help_message=" -Warning categories include: - 'all' show all warnings - 'none' turn off all the warnings - 'error' warnings are treated as fatal errors" - -# Help message printed before fatal option parsing errors. -fatal_help="Try '\$progname --help' for more information." - - - -## ------------------------- ## -## Hook function management. ## -## ------------------------- ## - -# This section contains functions for adding, removing, and running hooks -# to the main code. A hook is just a named list of of function, that can -# be run in order later on. - -# func_hookable FUNC_NAME -# ----------------------- -# Declare that FUNC_NAME will run hooks added with -# 'func_add_hook FUNC_NAME ...'. -func_hookable () -{ - $debug_cmd - - func_append hookable_fns " $1" -} - - -# func_add_hook FUNC_NAME HOOK_FUNC -# --------------------------------- -# Request that FUNC_NAME call HOOK_FUNC before it returns. FUNC_NAME must -# first have been declared "hookable" by a call to 'func_hookable'. -func_add_hook () -{ - $debug_cmd - - case " $hookable_fns " in - *" $1 "*) ;; - *) func_fatal_error "'$1' does not accept hook functions." ;; - esac - - eval func_append ${1}_hooks '" $2"' -} - - -# func_remove_hook FUNC_NAME HOOK_FUNC -# ------------------------------------ -# Remove HOOK_FUNC from the list of functions called by FUNC_NAME. -func_remove_hook () -{ - $debug_cmd - - eval ${1}_hooks='`$ECHO "\$'$1'_hooks" |$SED "s| '$2'||"`' -} - - -# func_run_hooks FUNC_NAME [ARG]... -# --------------------------------- -# Run all hook functions registered to FUNC_NAME. -# It is assumed that the list of hook functions contains nothing more -# than a whitespace-delimited list of legal shell function names, and -# no effort is wasted trying to catch shell meta-characters or preserve -# whitespace. -func_run_hooks () -{ - $debug_cmd - - _G_rc_run_hooks=false - - case " $hookable_fns " in - *" $1 "*) ;; - *) func_fatal_error "'$1' does not support hook funcions.n" ;; - esac - - eval _G_hook_fns=\$$1_hooks; shift - - for _G_hook in $_G_hook_fns; do - if eval $_G_hook '"$@"'; then - # store returned options list back into positional - # parameters for next 'cmd' execution. - eval _G_hook_result=\$${_G_hook}_result - eval set dummy "$_G_hook_result"; shift - _G_rc_run_hooks=: - fi - done - - $_G_rc_run_hooks && func_run_hooks_result=$_G_hook_result -} - - - -## --------------- ## -## Option parsing. ## -## --------------- ## - -# In order to add your own option parsing hooks, you must accept the -# full positional parameter list in your hook function, you may remove/edit -# any options that you action, and then pass back the remaining unprocessed -# options in '_result', escaped suitably for -# 'eval'. In this case you also must return $EXIT_SUCCESS to let the -# hook's caller know that it should pay attention to -# '_result'. Returning $EXIT_FAILURE signalizes that -# arguments are left untouched by the hook and therefore caller will ignore the -# result variable. -# -# Like this: -# -# my_options_prep () -# { -# $debug_cmd -# -# # Extend the existing usage message. -# usage_message=$usage_message' -# -s, --silent don'\''t print informational messages -# ' -# # No change in '$@' (ignored completely by this hook). There is -# # no need to do the equivalent (but slower) action: -# # func_quote_for_eval ${1+"$@"} -# # my_options_prep_result=$func_quote_for_eval_result -# false -# } -# func_add_hook func_options_prep my_options_prep -# -# -# my_silent_option () -# { -# $debug_cmd -# -# args_changed=false -# -# # Note that for efficiency, we parse as many options as we can -# # recognise in a loop before passing the remainder back to the -# # caller on the first unrecognised argument we encounter. -# while test $# -gt 0; do -# opt=$1; shift -# case $opt in -# --silent|-s) opt_silent=: -# args_changed=: -# ;; -# # Separate non-argument short options: -# -s*) func_split_short_opt "$_G_opt" -# set dummy "$func_split_short_opt_name" \ -# "-$func_split_short_opt_arg" ${1+"$@"} -# shift -# args_changed=: -# ;; -# *) # Make sure the first unrecognised option "$_G_opt" -# # is added back to "$@", we could need that later -# # if $args_changed is true. -# set dummy "$_G_opt" ${1+"$@"}; shift; break ;; -# esac -# done -# -# if $args_changed; then -# func_quote_for_eval ${1+"$@"} -# my_silent_option_result=$func_quote_for_eval_result -# fi -# -# $args_changed -# } -# func_add_hook func_parse_options my_silent_option -# -# -# my_option_validation () -# { -# $debug_cmd -# -# $opt_silent && $opt_verbose && func_fatal_help "\ -# '--silent' and '--verbose' options are mutually exclusive." -# -# false -# } -# func_add_hook func_validate_options my_option_validation -# -# You'll also need to manually amend $usage_message to reflect the extra -# options you parse. It's preferable to append if you can, so that -# multiple option parsing hooks can be added safely. - - -# func_options_finish [ARG]... -# ---------------------------- -# Finishing the option parse loop (call 'func_options' hooks ATM). -func_options_finish () -{ - $debug_cmd - - _G_func_options_finish_exit=false - if func_run_hooks func_options ${1+"$@"}; then - func_options_finish_result=$func_run_hooks_result - _G_func_options_finish_exit=: - fi - - $_G_func_options_finish_exit -} - - -# func_options [ARG]... -# --------------------- -# All the functions called inside func_options are hookable. See the -# individual implementations for details. -func_hookable func_options -func_options () -{ - $debug_cmd - - _G_rc_options=false - - for my_func in options_prep parse_options validate_options options_finish - do - if eval func_$my_func '${1+"$@"}'; then - eval _G_res_var='$'"func_${my_func}_result" - eval set dummy "$_G_res_var" ; shift - _G_rc_options=: - fi - done - - # Save modified positional parameters for caller. As a top-level - # options-parser function we always need to set the 'func_options_result' - # variable (regardless the $_G_rc_options value). - if $_G_rc_options; then - func_options_result=$_G_res_var - else - func_quote_for_eval ${1+"$@"} - func_options_result=$func_quote_for_eval_result - fi - - $_G_rc_options -} - - -# func_options_prep [ARG]... -# -------------------------- -# All initialisations required before starting the option parse loop. -# Note that when calling hook functions, we pass through the list of -# positional parameters. If a hook function modifies that list, and -# needs to propagate that back to rest of this script, then the complete -# modified list must be put in 'func_run_hooks_result' before -# returning $EXIT_SUCCESS (otherwise $EXIT_FAILURE is returned). -func_hookable func_options_prep -func_options_prep () -{ - $debug_cmd - - # Option defaults: - opt_verbose=false - opt_warning_types= - - _G_rc_options_prep=false - if func_run_hooks func_options_prep ${1+"$@"}; then - _G_rc_options_prep=: - # save modified positional parameters for caller - func_options_prep_result=$func_run_hooks_result - fi - - $_G_rc_options_prep -} - - -# func_parse_options [ARG]... -# --------------------------- -# The main option parsing loop. -func_hookable func_parse_options -func_parse_options () -{ - $debug_cmd - - func_parse_options_result= - - _G_rc_parse_options=false - # this just eases exit handling - while test $# -gt 0; do - # Defer to hook functions for initial option parsing, so they - # get priority in the event of reusing an option name. - if func_run_hooks func_parse_options ${1+"$@"}; then - eval set dummy "$func_run_hooks_result"; shift - _G_rc_parse_options=: - fi - - # Break out of the loop if we already parsed every option. - test $# -gt 0 || break - - _G_match_parse_options=: - _G_opt=$1 - shift - case $_G_opt in - --debug|-x) debug_cmd='set -x' - func_echo "enabling shell trace mode" - $debug_cmd - ;; - - --no-warnings|--no-warning|--no-warn) - set dummy --warnings none ${1+"$@"} - shift - ;; - - --warnings|--warning|-W) - if test $# = 0 && func_missing_arg $_G_opt; then - _G_rc_parse_options=: - break - fi - case " $warning_categories $1" in - *" $1 "*) - # trailing space prevents matching last $1 above - func_append_uniq opt_warning_types " $1" - ;; - *all) - opt_warning_types=$warning_categories - ;; - *none) - opt_warning_types=none - warning_func=: - ;; - *error) - opt_warning_types=$warning_categories - warning_func=func_fatal_error - ;; - *) - func_fatal_error \ - "unsupported warning category: '$1'" - ;; - esac - shift - ;; - - --verbose|-v) opt_verbose=: ;; - --version) func_version ;; - -\?|-h) func_usage ;; - --help) func_help ;; - - # Separate optargs to long options (plugins may need this): - --*=*) func_split_equals "$_G_opt" - set dummy "$func_split_equals_lhs" \ - "$func_split_equals_rhs" ${1+"$@"} - shift - ;; - - # Separate optargs to short options: - -W*) - func_split_short_opt "$_G_opt" - set dummy "$func_split_short_opt_name" \ - "$func_split_short_opt_arg" ${1+"$@"} - shift - ;; - - # Separate non-argument short options: - -\?*|-h*|-v*|-x*) - func_split_short_opt "$_G_opt" - set dummy "$func_split_short_opt_name" \ - "-$func_split_short_opt_arg" ${1+"$@"} - shift - ;; - - --) _G_rc_parse_options=: ; break ;; - -*) func_fatal_help "unrecognised option: '$_G_opt'" ;; - *) set dummy "$_G_opt" ${1+"$@"}; shift - _G_match_parse_options=false - break - ;; - esac - - $_G_match_parse_options && _G_rc_parse_options=: - done - - - if $_G_rc_parse_options; then - # save modified positional parameters for caller - func_quote_for_eval ${1+"$@"} - func_parse_options_result=$func_quote_for_eval_result - fi - - $_G_rc_parse_options -} - - -# func_validate_options [ARG]... -# ------------------------------ -# Perform any sanity checks on option settings and/or unconsumed -# arguments. -func_hookable func_validate_options -func_validate_options () -{ - $debug_cmd - - _G_rc_validate_options=false - - # Display all warnings if -W was not given. - test -n "$opt_warning_types" || opt_warning_types=" $warning_categories" - - if func_run_hooks func_validate_options ${1+"$@"}; then - # save modified positional parameters for caller - func_validate_options_result=$func_run_hooks_result - _G_rc_validate_options=: - fi - - # Bail if the options were screwed! - $exit_cmd $EXIT_FAILURE - - $_G_rc_validate_options -} - - - -## ----------------- ## -## Helper functions. ## -## ----------------- ## - -# This section contains the helper functions used by the rest of the -# hookable option parser framework in ascii-betical order. - - -# func_fatal_help ARG... -# ---------------------- -# Echo program name prefixed message to standard error, followed by -# a help hint, and exit. -func_fatal_help () -{ - $debug_cmd - - eval \$ECHO \""Usage: $usage"\" - eval \$ECHO \""$fatal_help"\" - func_error ${1+"$@"} - exit $EXIT_FAILURE -} - - -# func_help -# --------- -# Echo long help message to standard output and exit. -func_help () -{ - $debug_cmd - - func_usage_message - $ECHO "$long_help_message" - exit 0 -} - - -# func_missing_arg ARGNAME -# ------------------------ -# Echo program name prefixed message to standard error and set global -# exit_cmd. -func_missing_arg () -{ - $debug_cmd - - func_error "Missing argument for '$1'." - exit_cmd=exit -} - - -# func_split_equals STRING -# ------------------------ -# Set func_split_equals_lhs and func_split_equals_rhs shell variables after -# splitting STRING at the '=' sign. -test -z "$_G_HAVE_XSI_OPS" \ - && (eval 'x=a/b/c; - test 5aa/bb/cc = "${#x}${x%%/*}${x%/*}${x#*/}${x##*/}"') 2>/dev/null \ - && _G_HAVE_XSI_OPS=yes - -if test yes = "$_G_HAVE_XSI_OPS" -then - # This is an XSI compatible shell, allowing a faster implementation... - eval 'func_split_equals () - { - $debug_cmd - - func_split_equals_lhs=${1%%=*} - func_split_equals_rhs=${1#*=} - test "x$func_split_equals_lhs" = "x$1" \ - && func_split_equals_rhs= - }' -else - # ...otherwise fall back to using expr, which is often a shell builtin. - func_split_equals () - { - $debug_cmd - - func_split_equals_lhs=`expr "x$1" : 'x\([^=]*\)'` - func_split_equals_rhs= - test "x$func_split_equals_lhs" = "x$1" \ - || func_split_equals_rhs=`expr "x$1" : 'x[^=]*=\(.*\)$'` - } -fi #func_split_equals - - -# func_split_short_opt SHORTOPT -# ----------------------------- -# Set func_split_short_opt_name and func_split_short_opt_arg shell -# variables after splitting SHORTOPT after the 2nd character. -if test yes = "$_G_HAVE_XSI_OPS" -then - # This is an XSI compatible shell, allowing a faster implementation... - eval 'func_split_short_opt () - { - $debug_cmd - - func_split_short_opt_arg=${1#??} - func_split_short_opt_name=${1%"$func_split_short_opt_arg"} - }' -else - # ...otherwise fall back to using expr, which is often a shell builtin. - func_split_short_opt () - { - $debug_cmd - - func_split_short_opt_name=`expr "x$1" : 'x-\(.\)'` - func_split_short_opt_arg=`expr "x$1" : 'x-.\(.*\)$'` - } -fi #func_split_short_opt - - -# func_usage -# ---------- -# Echo short help message to standard output and exit. -func_usage () -{ - $debug_cmd - - func_usage_message - $ECHO "Run '$progname --help |${PAGER-more}' for full usage" - exit 0 -} - - -# func_usage_message -# ------------------ -# Echo short help message to standard output. -func_usage_message () -{ - $debug_cmd - - eval \$ECHO \""Usage: $usage"\" - echo - $SED -n 's|^# || - /^Written by/{ - x;p;x - } - h - /^Written by/q' < "$progpath" - echo - eval \$ECHO \""$usage_message"\" -} - - -# func_version -# ------------ -# Echo version message to standard output and exit. -func_version () -{ - $debug_cmd - - printf '%s\n' "$progname $scriptversion" - $SED -n ' - /(C)/!b go - :more - /\./!{ - N - s|\n# | | - b more - } - :go - /^# Written by /,/# warranty; / { - s|^# || - s|^# *$|| - s|\((C)\)[ 0-9,-]*[ ,-]\([1-9][0-9]* \)|\1 \2| - p - } - /^# Written by / { - s|^# || - p - } - /^warranty; /q' < "$progpath" - - exit $? -} - - -# Local variables: -# mode: shell-script -# sh-indentation: 2 -# eval: (add-hook 'before-save-hook 'time-stamp) -# time-stamp-pattern: "10/scriptversion=%:y-%02m-%02d.%02H; # UTC" -# time-stamp-time-zone: "UTC" -# End: - -# Set a version string. -scriptversion='(GNU libtool) 2.4.6' - - -# func_echo ARG... -# ---------------- -# Libtool also displays the current mode in messages, so override -# funclib.sh func_echo with this custom definition. -func_echo () -{ - $debug_cmd - - _G_message=$* - - func_echo_IFS=$IFS - IFS=$nl - for _G_line in $_G_message; do - IFS=$func_echo_IFS - $ECHO "$progname${opt_mode+: $opt_mode}: $_G_line" - done - IFS=$func_echo_IFS -} - - -# func_warning ARG... -# ------------------- -# Libtool warnings are not categorized, so override funclib.sh -# func_warning with this simpler definition. -func_warning () -{ - $debug_cmd - - $warning_func ${1+"$@"} -} - - -## ---------------- ## -## Options parsing. ## -## ---------------- ## - -# Hook in the functions to make sure our own options are parsed during -# the option parsing loop. - -usage='$progpath [OPTION]... [MODE-ARG]...' - -# Short help message in response to '-h'. -usage_message="Options: - --config show all configuration variables - --debug enable verbose shell tracing - -n, --dry-run display commands without modifying any files - --features display basic configuration information and exit - --mode=MODE use operation mode MODE - --no-warnings equivalent to '-Wnone' - --preserve-dup-deps don't remove duplicate dependency libraries - --quiet, --silent don't print informational messages - --tag=TAG use configuration variables from tag TAG - -v, --verbose print more informational messages than default - --version print version information - -W, --warnings=CATEGORY report the warnings falling in CATEGORY [all] - -h, --help, --help-all print short, long, or detailed help message -" - -# Additional text appended to 'usage_message' in response to '--help'. -func_help () -{ - $debug_cmd - - func_usage_message - $ECHO "$long_help_message - -MODE must be one of the following: - - clean remove files from the build directory - compile compile a source file into a libtool object - execute automatically set library path, then run a program - finish complete the installation of libtool libraries - install install libraries or executables - link create a library or an executable - uninstall remove libraries from an installed directory - -MODE-ARGS vary depending on the MODE. When passed as first option, -'--mode=MODE' may be abbreviated as 'MODE' or a unique abbreviation of that. -Try '$progname --help --mode=MODE' for a more detailed description of MODE. - -When reporting a bug, please describe a test case to reproduce it and -include the following information: - - host-triplet: $host - shell: $SHELL - compiler: $LTCC - compiler flags: $LTCFLAGS - linker: $LD (gnu? $with_gnu_ld) - version: $progname $scriptversion Debian-2.4.6-15 - automake: `($AUTOMAKE --version) 2>/dev/null |$SED 1q` - autoconf: `($AUTOCONF --version) 2>/dev/null |$SED 1q` - -Report bugs to . -GNU libtool home page: . -General help using GNU software: ." - exit 0 -} - - -# func_lo2o OBJECT-NAME -# --------------------- -# Transform OBJECT-NAME from a '.lo' suffix to the platform specific -# object suffix. - -lo2o=s/\\.lo\$/.$objext/ -o2lo=s/\\.$objext\$/.lo/ - -if test yes = "$_G_HAVE_XSI_OPS"; then - eval 'func_lo2o () - { - case $1 in - *.lo) func_lo2o_result=${1%.lo}.$objext ;; - * ) func_lo2o_result=$1 ;; - esac - }' - - # func_xform LIBOBJ-OR-SOURCE - # --------------------------- - # Transform LIBOBJ-OR-SOURCE from a '.o' or '.c' (or otherwise) - # suffix to a '.lo' libtool-object suffix. - eval 'func_xform () - { - func_xform_result=${1%.*}.lo - }' -else - # ...otherwise fall back to using sed. - func_lo2o () - { - func_lo2o_result=`$ECHO "$1" | $SED "$lo2o"` - } - - func_xform () - { - func_xform_result=`$ECHO "$1" | $SED 's|\.[^.]*$|.lo|'` - } -fi - - -# func_fatal_configuration ARG... -# ------------------------------- -# Echo program name prefixed message to standard error, followed by -# a configuration failure hint, and exit. -func_fatal_configuration () -{ - func__fatal_error ${1+"$@"} \ - "See the $PACKAGE documentation for more information." \ - "Fatal configuration error." -} - - -# func_config -# ----------- -# Display the configuration for all the tags in this script. -func_config () -{ - re_begincf='^# ### BEGIN LIBTOOL' - re_endcf='^# ### END LIBTOOL' - - # Default configuration. - $SED "1,/$re_begincf CONFIG/d;/$re_endcf CONFIG/,\$d" < "$progpath" - - # Now print the configurations for the tags. - for tagname in $taglist; do - $SED -n "/$re_begincf TAG CONFIG: $tagname\$/,/$re_endcf TAG CONFIG: $tagname\$/p" < "$progpath" - done - - exit $? -} - - -# func_features -# ------------- -# Display the features supported by this script. -func_features () -{ - echo "host: $host" - if test yes = "$build_libtool_libs"; then - echo "enable shared libraries" - else - echo "disable shared libraries" - fi - if test yes = "$build_old_libs"; then - echo "enable static libraries" - else - echo "disable static libraries" - fi - - exit $? -} - - -# func_enable_tag TAGNAME -# ----------------------- -# Verify that TAGNAME is valid, and either flag an error and exit, or -# enable the TAGNAME tag. We also add TAGNAME to the global $taglist -# variable here. -func_enable_tag () -{ - # Global variable: - tagname=$1 - - re_begincf="^# ### BEGIN LIBTOOL TAG CONFIG: $tagname\$" - re_endcf="^# ### END LIBTOOL TAG CONFIG: $tagname\$" - sed_extractcf=/$re_begincf/,/$re_endcf/p - - # Validate tagname. - case $tagname in - *[!-_A-Za-z0-9,/]*) - func_fatal_error "invalid tag name: $tagname" - ;; - esac - - # Don't test for the "default" C tag, as we know it's - # there but not specially marked. - case $tagname in - CC) ;; - *) - if $GREP "$re_begincf" "$progpath" >/dev/null 2>&1; then - taglist="$taglist $tagname" - - # Evaluate the configuration. Be careful to quote the path - # and the sed script, to avoid splitting on whitespace, but - # also don't use non-portable quotes within backquotes within - # quotes we have to do it in 2 steps: - extractedcf=`$SED -n -e "$sed_extractcf" < "$progpath"` - eval "$extractedcf" - else - func_error "ignoring unknown tag $tagname" - fi - ;; - esac -} - - -# func_check_version_match -# ------------------------ -# Ensure that we are using m4 macros, and libtool script from the same -# release of libtool. -func_check_version_match () -{ - if test "$package_revision" != "$macro_revision"; then - if test "$VERSION" != "$macro_version"; then - if test -z "$macro_version"; then - cat >&2 <<_LT_EOF -$progname: Version mismatch error. This is $PACKAGE $VERSION, but the -$progname: definition of this LT_INIT comes from an older release. -$progname: You should recreate aclocal.m4 with macros from $PACKAGE $VERSION -$progname: and run autoconf again. -_LT_EOF - else - cat >&2 <<_LT_EOF -$progname: Version mismatch error. This is $PACKAGE $VERSION, but the -$progname: definition of this LT_INIT comes from $PACKAGE $macro_version. -$progname: You should recreate aclocal.m4 with macros from $PACKAGE $VERSION -$progname: and run autoconf again. -_LT_EOF - fi - else - cat >&2 <<_LT_EOF -$progname: Version mismatch error. This is $PACKAGE $VERSION, revision $package_revision, -$progname: but the definition of this LT_INIT comes from revision $macro_revision. -$progname: You should recreate aclocal.m4 with macros from revision $package_revision -$progname: of $PACKAGE $VERSION and run autoconf again. -_LT_EOF - fi - - exit $EXIT_MISMATCH - fi -} - - -# libtool_options_prep [ARG]... -# ----------------------------- -# Preparation for options parsed by libtool. -libtool_options_prep () -{ - $debug_mode - - # Option defaults: - opt_config=false - opt_dlopen= - opt_dry_run=false - opt_help=false - opt_mode= - opt_preserve_dup_deps=false - opt_quiet=false - - nonopt= - preserve_args= - - _G_rc_lt_options_prep=: - - # Shorthand for --mode=foo, only valid as the first argument - case $1 in - clean|clea|cle|cl) - shift; set dummy --mode clean ${1+"$@"}; shift - ;; - compile|compil|compi|comp|com|co|c) - shift; set dummy --mode compile ${1+"$@"}; shift - ;; - execute|execut|execu|exec|exe|ex|e) - shift; set dummy --mode execute ${1+"$@"}; shift - ;; - finish|finis|fini|fin|fi|f) - shift; set dummy --mode finish ${1+"$@"}; shift - ;; - install|instal|insta|inst|ins|in|i) - shift; set dummy --mode install ${1+"$@"}; shift - ;; - link|lin|li|l) - shift; set dummy --mode link ${1+"$@"}; shift - ;; - uninstall|uninstal|uninsta|uninst|unins|unin|uni|un|u) - shift; set dummy --mode uninstall ${1+"$@"}; shift - ;; - *) - _G_rc_lt_options_prep=false - ;; - esac - - if $_G_rc_lt_options_prep; then - # Pass back the list of options. - func_quote_for_eval ${1+"$@"} - libtool_options_prep_result=$func_quote_for_eval_result - fi - - $_G_rc_lt_options_prep -} -func_add_hook func_options_prep libtool_options_prep - - -# libtool_parse_options [ARG]... -# --------------------------------- -# Provide handling for libtool specific options. -libtool_parse_options () -{ - $debug_cmd - - _G_rc_lt_parse_options=false - - # Perform our own loop to consume as many options as possible in - # each iteration. - while test $# -gt 0; do - _G_match_lt_parse_options=: - _G_opt=$1 - shift - case $_G_opt in - --dry-run|--dryrun|-n) - opt_dry_run=: - ;; - - --config) func_config ;; - - --dlopen|-dlopen) - opt_dlopen="${opt_dlopen+$opt_dlopen -}$1" - shift - ;; - - --preserve-dup-deps) - opt_preserve_dup_deps=: ;; - - --features) func_features ;; - - --finish) set dummy --mode finish ${1+"$@"}; shift ;; - - --help) opt_help=: ;; - - --help-all) opt_help=': help-all' ;; - - --mode) test $# = 0 && func_missing_arg $_G_opt && break - opt_mode=$1 - case $1 in - # Valid mode arguments: - clean|compile|execute|finish|install|link|relink|uninstall) ;; - - # Catch anything else as an error - *) func_error "invalid argument for $_G_opt" - exit_cmd=exit - break - ;; - esac - shift - ;; - - --no-silent|--no-quiet) - opt_quiet=false - func_append preserve_args " $_G_opt" - ;; - - --no-warnings|--no-warning|--no-warn) - opt_warning=false - func_append preserve_args " $_G_opt" - ;; - - --no-verbose) - opt_verbose=false - func_append preserve_args " $_G_opt" - ;; - - --silent|--quiet) - opt_quiet=: - opt_verbose=false - func_append preserve_args " $_G_opt" - ;; - - --tag) test $# = 0 && func_missing_arg $_G_opt && break - opt_tag=$1 - func_append preserve_args " $_G_opt $1" - func_enable_tag "$1" - shift - ;; - - --verbose|-v) opt_quiet=false - opt_verbose=: - func_append preserve_args " $_G_opt" - ;; - - # An option not handled by this hook function: - *) set dummy "$_G_opt" ${1+"$@"} ; shift - _G_match_lt_parse_options=false - break - ;; - esac - $_G_match_lt_parse_options && _G_rc_lt_parse_options=: - done - - if $_G_rc_lt_parse_options; then - # save modified positional parameters for caller - func_quote_for_eval ${1+"$@"} - libtool_parse_options_result=$func_quote_for_eval_result - fi - - $_G_rc_lt_parse_options -} -func_add_hook func_parse_options libtool_parse_options - - - -# libtool_validate_options [ARG]... -# --------------------------------- -# Perform any sanity checks on option settings and/or unconsumed -# arguments. -libtool_validate_options () -{ - # save first non-option argument - if test 0 -lt $#; then - nonopt=$1 - shift - fi - - # preserve --debug - test : = "$debug_cmd" || func_append preserve_args " --debug" - - case $host in - # Solaris2 added to fix http://debbugs.gnu.org/cgi/bugreport.cgi?bug=16452 - # see also: http://gcc.gnu.org/bugzilla/show_bug.cgi?id=59788 - *cygwin* | *mingw* | *pw32* | *cegcc* | *solaris2* | *os2*) - # don't eliminate duplications in $postdeps and $predeps - opt_duplicate_compiler_generated_deps=: - ;; - *) - opt_duplicate_compiler_generated_deps=$opt_preserve_dup_deps - ;; - esac - - $opt_help || { - # Sanity checks first: - func_check_version_match - - test yes != "$build_libtool_libs" \ - && test yes != "$build_old_libs" \ - && func_fatal_configuration "not configured to build any kind of library" - - # Darwin sucks - eval std_shrext=\"$shrext_cmds\" - - # Only execute mode is allowed to have -dlopen flags. - if test -n "$opt_dlopen" && test execute != "$opt_mode"; then - func_error "unrecognized option '-dlopen'" - $ECHO "$help" 1>&2 - exit $EXIT_FAILURE - fi - - # Change the help message to a mode-specific one. - generic_help=$help - help="Try '$progname --help --mode=$opt_mode' for more information." - } - - # Pass back the unparsed argument list - func_quote_for_eval ${1+"$@"} - libtool_validate_options_result=$func_quote_for_eval_result -} -func_add_hook func_validate_options libtool_validate_options - - -# Process options as early as possible so that --help and --version -# can return quickly. -func_options ${1+"$@"} -eval set dummy "$func_options_result"; shift - - - -## ----------- ## -## Main. ## -## ----------- ## - -magic='%%%MAGIC variable%%%' -magic_exe='%%%MAGIC EXE variable%%%' - -# Global variables. -extracted_archives= -extracted_serial=0 - -# If this variable is set in any of the actions, the command in it -# will be execed at the end. This prevents here-documents from being -# left over by shells. -exec_cmd= - - -# A function that is used when there is no print builtin or printf. -func_fallback_echo () -{ - eval 'cat <<_LTECHO_EOF -$1 -_LTECHO_EOF' -} - -# func_generated_by_libtool -# True iff stdin has been generated by Libtool. This function is only -# a basic sanity check; it will hardly flush out determined imposters. -func_generated_by_libtool_p () -{ - $GREP "^# Generated by .*$PACKAGE" > /dev/null 2>&1 -} - -# func_lalib_p file -# True iff FILE is a libtool '.la' library or '.lo' object file. -# This function is only a basic sanity check; it will hardly flush out -# determined imposters. -func_lalib_p () -{ - test -f "$1" && - $SED -e 4q "$1" 2>/dev/null | func_generated_by_libtool_p -} - -# func_lalib_unsafe_p file -# True iff FILE is a libtool '.la' library or '.lo' object file. -# This function implements the same check as func_lalib_p without -# resorting to external programs. To this end, it redirects stdin and -# closes it afterwards, without saving the original file descriptor. -# As a safety measure, use it only where a negative result would be -# fatal anyway. Works if 'file' does not exist. -func_lalib_unsafe_p () -{ - lalib_p=no - if test -f "$1" && test -r "$1" && exec 5<&0 <"$1"; then - for lalib_p_l in 1 2 3 4 - do - read lalib_p_line - case $lalib_p_line in - \#\ Generated\ by\ *$PACKAGE* ) lalib_p=yes; break;; - esac - done - exec 0<&5 5<&- - fi - test yes = "$lalib_p" -} - -# func_ltwrapper_script_p file -# True iff FILE is a libtool wrapper script -# This function is only a basic sanity check; it will hardly flush out -# determined imposters. -func_ltwrapper_script_p () -{ - test -f "$1" && - $lt_truncate_bin < "$1" 2>/dev/null | func_generated_by_libtool_p -} - -# func_ltwrapper_executable_p file -# True iff FILE is a libtool wrapper executable -# This function is only a basic sanity check; it will hardly flush out -# determined imposters. -func_ltwrapper_executable_p () -{ - func_ltwrapper_exec_suffix= - case $1 in - *.exe) ;; - *) func_ltwrapper_exec_suffix=.exe ;; - esac - $GREP "$magic_exe" "$1$func_ltwrapper_exec_suffix" >/dev/null 2>&1 -} - -# func_ltwrapper_scriptname file -# Assumes file is an ltwrapper_executable -# uses $file to determine the appropriate filename for a -# temporary ltwrapper_script. -func_ltwrapper_scriptname () -{ - func_dirname_and_basename "$1" "" "." - func_stripname '' '.exe' "$func_basename_result" - func_ltwrapper_scriptname_result=$func_dirname_result/$objdir/${func_stripname_result}_ltshwrapper -} - -# func_ltwrapper_p file -# True iff FILE is a libtool wrapper script or wrapper executable -# This function is only a basic sanity check; it will hardly flush out -# determined imposters. -func_ltwrapper_p () -{ - func_ltwrapper_script_p "$1" || func_ltwrapper_executable_p "$1" -} - - -# func_execute_cmds commands fail_cmd -# Execute tilde-delimited COMMANDS. -# If FAIL_CMD is given, eval that upon failure. -# FAIL_CMD may read-access the current command in variable CMD! -func_execute_cmds () -{ - $debug_cmd - - save_ifs=$IFS; IFS='~' - for cmd in $1; do - IFS=$sp$nl - eval cmd=\"$cmd\" - IFS=$save_ifs - func_show_eval "$cmd" "${2-:}" - done - IFS=$save_ifs -} - - -# func_source file -# Source FILE, adding directory component if necessary. -# Note that it is not necessary on cygwin/mingw to append a dot to -# FILE even if both FILE and FILE.exe exist: automatic-append-.exe -# behavior happens only for exec(3), not for open(2)! Also, sourcing -# 'FILE.' does not work on cygwin managed mounts. -func_source () -{ - $debug_cmd - - case $1 in - */* | *\\*) . "$1" ;; - *) . "./$1" ;; - esac -} - - -# func_resolve_sysroot PATH -# Replace a leading = in PATH with a sysroot. Store the result into -# func_resolve_sysroot_result -func_resolve_sysroot () -{ - func_resolve_sysroot_result=$1 - case $func_resolve_sysroot_result in - =*) - func_stripname '=' '' "$func_resolve_sysroot_result" - func_resolve_sysroot_result=$lt_sysroot$func_stripname_result - ;; - esac -} - -# func_replace_sysroot PATH -# If PATH begins with the sysroot, replace it with = and -# store the result into func_replace_sysroot_result. -func_replace_sysroot () -{ - case $lt_sysroot:$1 in - ?*:"$lt_sysroot"*) - func_stripname "$lt_sysroot" '' "$1" - func_replace_sysroot_result='='$func_stripname_result - ;; - *) - # Including no sysroot. - func_replace_sysroot_result=$1 - ;; - esac -} - -# func_infer_tag arg -# Infer tagged configuration to use if any are available and -# if one wasn't chosen via the "--tag" command line option. -# Only attempt this if the compiler in the base compile -# command doesn't match the default compiler. -# arg is usually of the form 'gcc ...' -func_infer_tag () -{ - $debug_cmd - - if test -n "$available_tags" && test -z "$tagname"; then - CC_quoted= - for arg in $CC; do - func_append_quoted CC_quoted "$arg" - done - CC_expanded=`func_echo_all $CC` - CC_quoted_expanded=`func_echo_all $CC_quoted` - case $@ in - # Blanks in the command may have been stripped by the calling shell, - # but not from the CC environment variable when configure was run. - " $CC "* | "$CC "* | " $CC_expanded "* | "$CC_expanded "* | \ - " $CC_quoted"* | "$CC_quoted "* | " $CC_quoted_expanded "* | "$CC_quoted_expanded "*) ;; - # Blanks at the start of $base_compile will cause this to fail - # if we don't check for them as well. - *) - for z in $available_tags; do - if $GREP "^# ### BEGIN LIBTOOL TAG CONFIG: $z$" < "$progpath" > /dev/null; then - # Evaluate the configuration. - eval "`$SED -n -e '/^# ### BEGIN LIBTOOL TAG CONFIG: '$z'$/,/^# ### END LIBTOOL TAG CONFIG: '$z'$/p' < $progpath`" - CC_quoted= - for arg in $CC; do - # Double-quote args containing other shell metacharacters. - func_append_quoted CC_quoted "$arg" - done - CC_expanded=`func_echo_all $CC` - CC_quoted_expanded=`func_echo_all $CC_quoted` - case "$@ " in - " $CC "* | "$CC "* | " $CC_expanded "* | "$CC_expanded "* | \ - " $CC_quoted"* | "$CC_quoted "* | " $CC_quoted_expanded "* | "$CC_quoted_expanded "*) - # The compiler in the base compile command matches - # the one in the tagged configuration. - # Assume this is the tagged configuration we want. - tagname=$z - break - ;; - esac - fi - done - # If $tagname still isn't set, then no tagged configuration - # was found and let the user know that the "--tag" command - # line option must be used. - if test -z "$tagname"; then - func_echo "unable to infer tagged configuration" - func_fatal_error "specify a tag with '--tag'" -# else -# func_verbose "using $tagname tagged configuration" - fi - ;; - esac - fi -} - - - -# func_write_libtool_object output_name pic_name nonpic_name -# Create a libtool object file (analogous to a ".la" file), -# but don't create it if we're doing a dry run. -func_write_libtool_object () -{ - write_libobj=$1 - if test yes = "$build_libtool_libs"; then - write_lobj=\'$2\' - else - write_lobj=none - fi - - if test yes = "$build_old_libs"; then - write_oldobj=\'$3\' - else - write_oldobj=none - fi - - $opt_dry_run || { - cat >${write_libobj}T </dev/null` - if test "$?" -eq 0 && test -n "$func_convert_core_file_wine_to_w32_tmp"; then - func_convert_core_file_wine_to_w32_result=`$ECHO "$func_convert_core_file_wine_to_w32_tmp" | - $SED -e "$sed_naive_backslashify"` - else - func_convert_core_file_wine_to_w32_result= - fi - fi -} -# end: func_convert_core_file_wine_to_w32 - - -# func_convert_core_path_wine_to_w32 ARG -# Helper function used by path conversion functions when $build is *nix, and -# $host is mingw, cygwin, or some other w32 environment. Relies on a correctly -# configured wine environment available, with the winepath program in $build's -# $PATH. Assumes ARG has no leading or trailing path separator characters. -# -# ARG is path to be converted from $build format to win32. -# Result is available in $func_convert_core_path_wine_to_w32_result. -# Unconvertible file (directory) names in ARG are skipped; if no directory names -# are convertible, then the result may be empty. -func_convert_core_path_wine_to_w32 () -{ - $debug_cmd - - # unfortunately, winepath doesn't convert paths, only file names - func_convert_core_path_wine_to_w32_result= - if test -n "$1"; then - oldIFS=$IFS - IFS=: - for func_convert_core_path_wine_to_w32_f in $1; do - IFS=$oldIFS - func_convert_core_file_wine_to_w32 "$func_convert_core_path_wine_to_w32_f" - if test -n "$func_convert_core_file_wine_to_w32_result"; then - if test -z "$func_convert_core_path_wine_to_w32_result"; then - func_convert_core_path_wine_to_w32_result=$func_convert_core_file_wine_to_w32_result - else - func_append func_convert_core_path_wine_to_w32_result ";$func_convert_core_file_wine_to_w32_result" - fi - fi - done - IFS=$oldIFS - fi -} -# end: func_convert_core_path_wine_to_w32 - - -# func_cygpath ARGS... -# Wrapper around calling the cygpath program via LT_CYGPATH. This is used when -# when (1) $build is *nix and Cygwin is hosted via a wine environment; or (2) -# $build is MSYS and $host is Cygwin, or (3) $build is Cygwin. In case (1) or -# (2), returns the Cygwin file name or path in func_cygpath_result (input -# file name or path is assumed to be in w32 format, as previously converted -# from $build's *nix or MSYS format). In case (3), returns the w32 file name -# or path in func_cygpath_result (input file name or path is assumed to be in -# Cygwin format). Returns an empty string on error. -# -# ARGS are passed to cygpath, with the last one being the file name or path to -# be converted. -# -# Specify the absolute *nix (or w32) name to cygpath in the LT_CYGPATH -# environment variable; do not put it in $PATH. -func_cygpath () -{ - $debug_cmd - - if test -n "$LT_CYGPATH" && test -f "$LT_CYGPATH"; then - func_cygpath_result=`$LT_CYGPATH "$@" 2>/dev/null` - if test "$?" -ne 0; then - # on failure, ensure result is empty - func_cygpath_result= - fi - else - func_cygpath_result= - func_error "LT_CYGPATH is empty or specifies non-existent file: '$LT_CYGPATH'" - fi -} -#end: func_cygpath - - -# func_convert_core_msys_to_w32 ARG -# Convert file name or path ARG from MSYS format to w32 format. Return -# result in func_convert_core_msys_to_w32_result. -func_convert_core_msys_to_w32 () -{ - $debug_cmd - - # awkward: cmd appends spaces to result - func_convert_core_msys_to_w32_result=`( cmd //c echo "$1" ) 2>/dev/null | - $SED -e 's/[ ]*$//' -e "$sed_naive_backslashify"` -} -#end: func_convert_core_msys_to_w32 - - -# func_convert_file_check ARG1 ARG2 -# Verify that ARG1 (a file name in $build format) was converted to $host -# format in ARG2. Otherwise, emit an error message, but continue (resetting -# func_to_host_file_result to ARG1). -func_convert_file_check () -{ - $debug_cmd - - if test -z "$2" && test -n "$1"; then - func_error "Could not determine host file name corresponding to" - func_error " '$1'" - func_error "Continuing, but uninstalled executables may not work." - # Fallback: - func_to_host_file_result=$1 - fi -} -# end func_convert_file_check - - -# func_convert_path_check FROM_PATHSEP TO_PATHSEP FROM_PATH TO_PATH -# Verify that FROM_PATH (a path in $build format) was converted to $host -# format in TO_PATH. Otherwise, emit an error message, but continue, resetting -# func_to_host_file_result to a simplistic fallback value (see below). -func_convert_path_check () -{ - $debug_cmd - - if test -z "$4" && test -n "$3"; then - func_error "Could not determine the host path corresponding to" - func_error " '$3'" - func_error "Continuing, but uninstalled executables may not work." - # Fallback. This is a deliberately simplistic "conversion" and - # should not be "improved". See libtool.info. - if test "x$1" != "x$2"; then - lt_replace_pathsep_chars="s|$1|$2|g" - func_to_host_path_result=`echo "$3" | - $SED -e "$lt_replace_pathsep_chars"` - else - func_to_host_path_result=$3 - fi - fi -} -# end func_convert_path_check - - -# func_convert_path_front_back_pathsep FRONTPAT BACKPAT REPL ORIG -# Modifies func_to_host_path_result by prepending REPL if ORIG matches FRONTPAT -# and appending REPL if ORIG matches BACKPAT. -func_convert_path_front_back_pathsep () -{ - $debug_cmd - - case $4 in - $1 ) func_to_host_path_result=$3$func_to_host_path_result - ;; - esac - case $4 in - $2 ) func_append func_to_host_path_result "$3" - ;; - esac -} -# end func_convert_path_front_back_pathsep - - -################################################## -# $build to $host FILE NAME CONVERSION FUNCTIONS # -################################################## -# invoked via '$to_host_file_cmd ARG' -# -# In each case, ARG is the path to be converted from $build to $host format. -# Result will be available in $func_to_host_file_result. - - -# func_to_host_file ARG -# Converts the file name ARG from $build format to $host format. Return result -# in func_to_host_file_result. -func_to_host_file () -{ - $debug_cmd - - $to_host_file_cmd "$1" -} -# end func_to_host_file - - -# func_to_tool_file ARG LAZY -# converts the file name ARG from $build format to toolchain format. Return -# result in func_to_tool_file_result. If the conversion in use is listed -# in (the comma separated) LAZY, no conversion takes place. -func_to_tool_file () -{ - $debug_cmd - - case ,$2, in - *,"$to_tool_file_cmd",*) - func_to_tool_file_result=$1 - ;; - *) - $to_tool_file_cmd "$1" - func_to_tool_file_result=$func_to_host_file_result - ;; - esac -} -# end func_to_tool_file - - -# func_convert_file_noop ARG -# Copy ARG to func_to_host_file_result. -func_convert_file_noop () -{ - func_to_host_file_result=$1 -} -# end func_convert_file_noop - - -# func_convert_file_msys_to_w32 ARG -# Convert file name ARG from (mingw) MSYS to (mingw) w32 format; automatic -# conversion to w32 is not available inside the cwrapper. Returns result in -# func_to_host_file_result. -func_convert_file_msys_to_w32 () -{ - $debug_cmd - - func_to_host_file_result=$1 - if test -n "$1"; then - func_convert_core_msys_to_w32 "$1" - func_to_host_file_result=$func_convert_core_msys_to_w32_result - fi - func_convert_file_check "$1" "$func_to_host_file_result" -} -# end func_convert_file_msys_to_w32 - - -# func_convert_file_cygwin_to_w32 ARG -# Convert file name ARG from Cygwin to w32 format. Returns result in -# func_to_host_file_result. -func_convert_file_cygwin_to_w32 () -{ - $debug_cmd - - func_to_host_file_result=$1 - if test -n "$1"; then - # because $build is cygwin, we call "the" cygpath in $PATH; no need to use - # LT_CYGPATH in this case. - func_to_host_file_result=`cygpath -m "$1"` - fi - func_convert_file_check "$1" "$func_to_host_file_result" -} -# end func_convert_file_cygwin_to_w32 - - -# func_convert_file_nix_to_w32 ARG -# Convert file name ARG from *nix to w32 format. Requires a wine environment -# and a working winepath. Returns result in func_to_host_file_result. -func_convert_file_nix_to_w32 () -{ - $debug_cmd - - func_to_host_file_result=$1 - if test -n "$1"; then - func_convert_core_file_wine_to_w32 "$1" - func_to_host_file_result=$func_convert_core_file_wine_to_w32_result - fi - func_convert_file_check "$1" "$func_to_host_file_result" -} -# end func_convert_file_nix_to_w32 - - -# func_convert_file_msys_to_cygwin ARG -# Convert file name ARG from MSYS to Cygwin format. Requires LT_CYGPATH set. -# Returns result in func_to_host_file_result. -func_convert_file_msys_to_cygwin () -{ - $debug_cmd - - func_to_host_file_result=$1 - if test -n "$1"; then - func_convert_core_msys_to_w32 "$1" - func_cygpath -u "$func_convert_core_msys_to_w32_result" - func_to_host_file_result=$func_cygpath_result - fi - func_convert_file_check "$1" "$func_to_host_file_result" -} -# end func_convert_file_msys_to_cygwin - - -# func_convert_file_nix_to_cygwin ARG -# Convert file name ARG from *nix to Cygwin format. Requires Cygwin installed -# in a wine environment, working winepath, and LT_CYGPATH set. Returns result -# in func_to_host_file_result. -func_convert_file_nix_to_cygwin () -{ - $debug_cmd - - func_to_host_file_result=$1 - if test -n "$1"; then - # convert from *nix to w32, then use cygpath to convert from w32 to cygwin. - func_convert_core_file_wine_to_w32 "$1" - func_cygpath -u "$func_convert_core_file_wine_to_w32_result" - func_to_host_file_result=$func_cygpath_result - fi - func_convert_file_check "$1" "$func_to_host_file_result" -} -# end func_convert_file_nix_to_cygwin - - -############################################# -# $build to $host PATH CONVERSION FUNCTIONS # -############################################# -# invoked via '$to_host_path_cmd ARG' -# -# In each case, ARG is the path to be converted from $build to $host format. -# The result will be available in $func_to_host_path_result. -# -# Path separators are also converted from $build format to $host format. If -# ARG begins or ends with a path separator character, it is preserved (but -# converted to $host format) on output. -# -# All path conversion functions are named using the following convention: -# file name conversion function : func_convert_file_X_to_Y () -# path conversion function : func_convert_path_X_to_Y () -# where, for any given $build/$host combination the 'X_to_Y' value is the -# same. If conversion functions are added for new $build/$host combinations, -# the two new functions must follow this pattern, or func_init_to_host_path_cmd -# will break. - - -# func_init_to_host_path_cmd -# Ensures that function "pointer" variable $to_host_path_cmd is set to the -# appropriate value, based on the value of $to_host_file_cmd. -to_host_path_cmd= -func_init_to_host_path_cmd () -{ - $debug_cmd - - if test -z "$to_host_path_cmd"; then - func_stripname 'func_convert_file_' '' "$to_host_file_cmd" - to_host_path_cmd=func_convert_path_$func_stripname_result - fi -} - - -# func_to_host_path ARG -# Converts the path ARG from $build format to $host format. Return result -# in func_to_host_path_result. -func_to_host_path () -{ - $debug_cmd - - func_init_to_host_path_cmd - $to_host_path_cmd "$1" -} -# end func_to_host_path - - -# func_convert_path_noop ARG -# Copy ARG to func_to_host_path_result. -func_convert_path_noop () -{ - func_to_host_path_result=$1 -} -# end func_convert_path_noop - - -# func_convert_path_msys_to_w32 ARG -# Convert path ARG from (mingw) MSYS to (mingw) w32 format; automatic -# conversion to w32 is not available inside the cwrapper. Returns result in -# func_to_host_path_result. -func_convert_path_msys_to_w32 () -{ - $debug_cmd - - func_to_host_path_result=$1 - if test -n "$1"; then - # Remove leading and trailing path separator characters from ARG. MSYS - # behavior is inconsistent here; cygpath turns them into '.;' and ';.'; - # and winepath ignores them completely. - func_stripname : : "$1" - func_to_host_path_tmp1=$func_stripname_result - func_convert_core_msys_to_w32 "$func_to_host_path_tmp1" - func_to_host_path_result=$func_convert_core_msys_to_w32_result - func_convert_path_check : ";" \ - "$func_to_host_path_tmp1" "$func_to_host_path_result" - func_convert_path_front_back_pathsep ":*" "*:" ";" "$1" - fi -} -# end func_convert_path_msys_to_w32 - - -# func_convert_path_cygwin_to_w32 ARG -# Convert path ARG from Cygwin to w32 format. Returns result in -# func_to_host_file_result. -func_convert_path_cygwin_to_w32 () -{ - $debug_cmd - - func_to_host_path_result=$1 - if test -n "$1"; then - # See func_convert_path_msys_to_w32: - func_stripname : : "$1" - func_to_host_path_tmp1=$func_stripname_result - func_to_host_path_result=`cygpath -m -p "$func_to_host_path_tmp1"` - func_convert_path_check : ";" \ - "$func_to_host_path_tmp1" "$func_to_host_path_result" - func_convert_path_front_back_pathsep ":*" "*:" ";" "$1" - fi -} -# end func_convert_path_cygwin_to_w32 - - -# func_convert_path_nix_to_w32 ARG -# Convert path ARG from *nix to w32 format. Requires a wine environment and -# a working winepath. Returns result in func_to_host_file_result. -func_convert_path_nix_to_w32 () -{ - $debug_cmd - - func_to_host_path_result=$1 - if test -n "$1"; then - # See func_convert_path_msys_to_w32: - func_stripname : : "$1" - func_to_host_path_tmp1=$func_stripname_result - func_convert_core_path_wine_to_w32 "$func_to_host_path_tmp1" - func_to_host_path_result=$func_convert_core_path_wine_to_w32_result - func_convert_path_check : ";" \ - "$func_to_host_path_tmp1" "$func_to_host_path_result" - func_convert_path_front_back_pathsep ":*" "*:" ";" "$1" - fi -} -# end func_convert_path_nix_to_w32 - - -# func_convert_path_msys_to_cygwin ARG -# Convert path ARG from MSYS to Cygwin format. Requires LT_CYGPATH set. -# Returns result in func_to_host_file_result. -func_convert_path_msys_to_cygwin () -{ - $debug_cmd - - func_to_host_path_result=$1 - if test -n "$1"; then - # See func_convert_path_msys_to_w32: - func_stripname : : "$1" - func_to_host_path_tmp1=$func_stripname_result - func_convert_core_msys_to_w32 "$func_to_host_path_tmp1" - func_cygpath -u -p "$func_convert_core_msys_to_w32_result" - func_to_host_path_result=$func_cygpath_result - func_convert_path_check : : \ - "$func_to_host_path_tmp1" "$func_to_host_path_result" - func_convert_path_front_back_pathsep ":*" "*:" : "$1" - fi -} -# end func_convert_path_msys_to_cygwin - - -# func_convert_path_nix_to_cygwin ARG -# Convert path ARG from *nix to Cygwin format. Requires Cygwin installed in a -# a wine environment, working winepath, and LT_CYGPATH set. Returns result in -# func_to_host_file_result. -func_convert_path_nix_to_cygwin () -{ - $debug_cmd - - func_to_host_path_result=$1 - if test -n "$1"; then - # Remove leading and trailing path separator characters from - # ARG. msys behavior is inconsistent here, cygpath turns them - # into '.;' and ';.', and winepath ignores them completely. - func_stripname : : "$1" - func_to_host_path_tmp1=$func_stripname_result - func_convert_core_path_wine_to_w32 "$func_to_host_path_tmp1" - func_cygpath -u -p "$func_convert_core_path_wine_to_w32_result" - func_to_host_path_result=$func_cygpath_result - func_convert_path_check : : \ - "$func_to_host_path_tmp1" "$func_to_host_path_result" - func_convert_path_front_back_pathsep ":*" "*:" : "$1" - fi -} -# end func_convert_path_nix_to_cygwin - - -# func_dll_def_p FILE -# True iff FILE is a Windows DLL '.def' file. -# Keep in sync with _LT_DLL_DEF_P in libtool.m4 -func_dll_def_p () -{ - $debug_cmd - - func_dll_def_p_tmp=`$SED -n \ - -e 's/^[ ]*//' \ - -e '/^\(;.*\)*$/d' \ - -e 's/^\(EXPORTS\|LIBRARY\)\([ ].*\)*$/DEF/p' \ - -e q \ - "$1"` - test DEF = "$func_dll_def_p_tmp" -} - - -# func_mode_compile arg... -func_mode_compile () -{ - $debug_cmd - - # Get the compilation command and the source file. - base_compile= - srcfile=$nonopt # always keep a non-empty value in "srcfile" - suppress_opt=yes - suppress_output= - arg_mode=normal - libobj= - later= - pie_flag= - - for arg - do - case $arg_mode in - arg ) - # do not "continue". Instead, add this to base_compile - lastarg=$arg - arg_mode=normal - ;; - - target ) - libobj=$arg - arg_mode=normal - continue - ;; - - normal ) - # Accept any command-line options. - case $arg in - -o) - test -n "$libobj" && \ - func_fatal_error "you cannot specify '-o' more than once" - arg_mode=target - continue - ;; - - -pie | -fpie | -fPIE) - func_append pie_flag " $arg" - continue - ;; - - -shared | -static | -prefer-pic | -prefer-non-pic) - func_append later " $arg" - continue - ;; - - -no-suppress) - suppress_opt=no - continue - ;; - - -Xcompiler) - arg_mode=arg # the next one goes into the "base_compile" arg list - continue # The current "srcfile" will either be retained or - ;; # replaced later. I would guess that would be a bug. - - -Wc,*) - func_stripname '-Wc,' '' "$arg" - args=$func_stripname_result - lastarg= - save_ifs=$IFS; IFS=, - for arg in $args; do - IFS=$save_ifs - func_append_quoted lastarg "$arg" - done - IFS=$save_ifs - func_stripname ' ' '' "$lastarg" - lastarg=$func_stripname_result - - # Add the arguments to base_compile. - func_append base_compile " $lastarg" - continue - ;; - - *) - # Accept the current argument as the source file. - # The previous "srcfile" becomes the current argument. - # - lastarg=$srcfile - srcfile=$arg - ;; - esac # case $arg - ;; - esac # case $arg_mode - - # Aesthetically quote the previous argument. - func_append_quoted base_compile "$lastarg" - done # for arg - - case $arg_mode in - arg) - func_fatal_error "you must specify an argument for -Xcompile" - ;; - target) - func_fatal_error "you must specify a target with '-o'" - ;; - *) - # Get the name of the library object. - test -z "$libobj" && { - func_basename "$srcfile" - libobj=$func_basename_result - } - ;; - esac - - # Recognize several different file suffixes. - # If the user specifies -o file.o, it is replaced with file.lo - case $libobj in - *.[cCFSifmso] | \ - *.ada | *.adb | *.ads | *.asm | \ - *.c++ | *.cc | *.ii | *.class | *.cpp | *.cxx | \ - *.[fF][09]? | *.for | *.java | *.go | *.obj | *.sx | *.cu | *.cup) - func_xform "$libobj" - libobj=$func_xform_result - ;; - esac - - case $libobj in - *.lo) func_lo2o "$libobj"; obj=$func_lo2o_result ;; - *) - func_fatal_error "cannot determine name of library object from '$libobj'" - ;; - esac - - func_infer_tag $base_compile - - for arg in $later; do - case $arg in - -shared) - test yes = "$build_libtool_libs" \ - || func_fatal_configuration "cannot build a shared library" - build_old_libs=no - continue - ;; - - -static) - build_libtool_libs=no - build_old_libs=yes - continue - ;; - - -prefer-pic) - pic_mode=yes - continue - ;; - - -prefer-non-pic) - pic_mode=no - continue - ;; - esac - done - - func_quote_for_eval "$libobj" - test "X$libobj" != "X$func_quote_for_eval_result" \ - && $ECHO "X$libobj" | $GREP '[]~#^*{};<>?"'"'"' &()|`$[]' \ - && func_warning "libobj name '$libobj' may not contain shell special characters." - func_dirname_and_basename "$obj" "/" "" - objname=$func_basename_result - xdir=$func_dirname_result - lobj=$xdir$objdir/$objname - - test -z "$base_compile" && \ - func_fatal_help "you must specify a compilation command" - - # Delete any leftover library objects. - if test yes = "$build_old_libs"; then - removelist="$obj $lobj $libobj ${libobj}T" - else - removelist="$lobj $libobj ${libobj}T" - fi - - # On Cygwin there's no "real" PIC flag so we must build both object types - case $host_os in - cygwin* | mingw* | pw32* | os2* | cegcc*) - pic_mode=default - ;; - esac - if test no = "$pic_mode" && test pass_all != "$deplibs_check_method"; then - # non-PIC code in shared libraries is not supported - pic_mode=default - fi - - # Calculate the filename of the output object if compiler does - # not support -o with -c - if test no = "$compiler_c_o"; then - output_obj=`$ECHO "$srcfile" | $SED 's%^.*/%%; s%\.[^.]*$%%'`.$objext - lockfile=$output_obj.lock - else - output_obj= - need_locks=no - lockfile= - fi - - # Lock this critical section if it is needed - # We use this script file to make the link, it avoids creating a new file - if test yes = "$need_locks"; then - until $opt_dry_run || ln "$progpath" "$lockfile" 2>/dev/null; do - func_echo "Waiting for $lockfile to be removed" - sleep 2 - done - elif test warn = "$need_locks"; then - if test -f "$lockfile"; then - $ECHO "\ -*** ERROR, $lockfile exists and contains: -`cat $lockfile 2>/dev/null` - -This indicates that another process is trying to use the same -temporary object file, and libtool could not work around it because -your compiler does not support '-c' and '-o' together. If you -repeat this compilation, it may succeed, by chance, but you had better -avoid parallel builds (make -j) in this platform, or get a better -compiler." - - $opt_dry_run || $RM $removelist - exit $EXIT_FAILURE - fi - func_append removelist " $output_obj" - $ECHO "$srcfile" > "$lockfile" - fi - - $opt_dry_run || $RM $removelist - func_append removelist " $lockfile" - trap '$opt_dry_run || $RM $removelist; exit $EXIT_FAILURE' 1 2 15 - - func_to_tool_file "$srcfile" func_convert_file_msys_to_w32 - srcfile=$func_to_tool_file_result - func_quote_for_eval "$srcfile" - qsrcfile=$func_quote_for_eval_result - - # Only build a PIC object if we are building libtool libraries. - if test yes = "$build_libtool_libs"; then - # Without this assignment, base_compile gets emptied. - fbsd_hideous_sh_bug=$base_compile - - if test no != "$pic_mode"; then - command="$base_compile $qsrcfile $pic_flag" - else - # Don't build PIC code - command="$base_compile $qsrcfile" - fi - - func_mkdir_p "$xdir$objdir" - - if test -z "$output_obj"; then - # Place PIC objects in $objdir - func_append command " -o $lobj" - fi - - func_show_eval_locale "$command" \ - 'test -n "$output_obj" && $RM $removelist; exit $EXIT_FAILURE' - - if test warn = "$need_locks" && - test "X`cat $lockfile 2>/dev/null`" != "X$srcfile"; then - $ECHO "\ -*** ERROR, $lockfile contains: -`cat $lockfile 2>/dev/null` - -but it should contain: -$srcfile - -This indicates that another process is trying to use the same -temporary object file, and libtool could not work around it because -your compiler does not support '-c' and '-o' together. If you -repeat this compilation, it may succeed, by chance, but you had better -avoid parallel builds (make -j) in this platform, or get a better -compiler." - - $opt_dry_run || $RM $removelist - exit $EXIT_FAILURE - fi - - # Just move the object if needed, then go on to compile the next one - if test -n "$output_obj" && test "X$output_obj" != "X$lobj"; then - func_show_eval '$MV "$output_obj" "$lobj"' \ - 'error=$?; $opt_dry_run || $RM $removelist; exit $error' - fi - - # Allow error messages only from the first compilation. - if test yes = "$suppress_opt"; then - suppress_output=' >/dev/null 2>&1' - fi - fi - - # Only build a position-dependent object if we build old libraries. - if test yes = "$build_old_libs"; then - if test yes != "$pic_mode"; then - # Don't build PIC code - command="$base_compile $qsrcfile$pie_flag" - else - command="$base_compile $qsrcfile $pic_flag" - fi - if test yes = "$compiler_c_o"; then - func_append command " -o $obj" - fi - - # Suppress compiler output if we already did a PIC compilation. - func_append command "$suppress_output" - func_show_eval_locale "$command" \ - '$opt_dry_run || $RM $removelist; exit $EXIT_FAILURE' - - if test warn = "$need_locks" && - test "X`cat $lockfile 2>/dev/null`" != "X$srcfile"; then - $ECHO "\ -*** ERROR, $lockfile contains: -`cat $lockfile 2>/dev/null` - -but it should contain: -$srcfile - -This indicates that another process is trying to use the same -temporary object file, and libtool could not work around it because -your compiler does not support '-c' and '-o' together. If you -repeat this compilation, it may succeed, by chance, but you had better -avoid parallel builds (make -j) in this platform, or get a better -compiler." - - $opt_dry_run || $RM $removelist - exit $EXIT_FAILURE - fi - - # Just move the object if needed - if test -n "$output_obj" && test "X$output_obj" != "X$obj"; then - func_show_eval '$MV "$output_obj" "$obj"' \ - 'error=$?; $opt_dry_run || $RM $removelist; exit $error' - fi - fi - - $opt_dry_run || { - func_write_libtool_object "$libobj" "$objdir/$objname" "$objname" - - # Unlock the critical section if it was locked - if test no != "$need_locks"; then - removelist=$lockfile - $RM "$lockfile" - fi - } - - exit $EXIT_SUCCESS -} - -$opt_help || { - test compile = "$opt_mode" && func_mode_compile ${1+"$@"} -} - -func_mode_help () -{ - # We need to display help for each of the modes. - case $opt_mode in - "") - # Generic help is extracted from the usage comments - # at the start of this file. - func_help - ;; - - clean) - $ECHO \ -"Usage: $progname [OPTION]... --mode=clean RM [RM-OPTION]... FILE... - -Remove files from the build directory. - -RM is the name of the program to use to delete files associated with each FILE -(typically '/bin/rm'). RM-OPTIONS are options (such as '-f') to be passed -to RM. - -If FILE is a libtool library, object or program, all the files associated -with it are deleted. Otherwise, only FILE itself is deleted using RM." - ;; - - compile) - $ECHO \ -"Usage: $progname [OPTION]... --mode=compile COMPILE-COMMAND... SOURCEFILE - -Compile a source file into a libtool library object. - -This mode accepts the following additional options: - - -o OUTPUT-FILE set the output file name to OUTPUT-FILE - -no-suppress do not suppress compiler output for multiple passes - -prefer-pic try to build PIC objects only - -prefer-non-pic try to build non-PIC objects only - -shared do not build a '.o' file suitable for static linking - -static only build a '.o' file suitable for static linking - -Wc,FLAG pass FLAG directly to the compiler - -COMPILE-COMMAND is a command to be used in creating a 'standard' object file -from the given SOURCEFILE. - -The output file name is determined by removing the directory component from -SOURCEFILE, then substituting the C source code suffix '.c' with the -library object suffix, '.lo'." - ;; - - execute) - $ECHO \ -"Usage: $progname [OPTION]... --mode=execute COMMAND [ARGS]... - -Automatically set library path, then run a program. - -This mode accepts the following additional options: - - -dlopen FILE add the directory containing FILE to the library path - -This mode sets the library path environment variable according to '-dlopen' -flags. - -If any of the ARGS are libtool executable wrappers, then they are translated -into their corresponding uninstalled binary, and any of their required library -directories are added to the library path. - -Then, COMMAND is executed, with ARGS as arguments." - ;; - - finish) - $ECHO \ -"Usage: $progname [OPTION]... --mode=finish [LIBDIR]... - -Complete the installation of libtool libraries. - -Each LIBDIR is a directory that contains libtool libraries. - -The commands that this mode executes may require superuser privileges. Use -the '--dry-run' option if you just want to see what would be executed." - ;; - - install) - $ECHO \ -"Usage: $progname [OPTION]... --mode=install INSTALL-COMMAND... - -Install executables or libraries. - -INSTALL-COMMAND is the installation command. The first component should be -either the 'install' or 'cp' program. - -The following components of INSTALL-COMMAND are treated specially: - - -inst-prefix-dir PREFIX-DIR Use PREFIX-DIR as a staging area for installation - -The rest of the components are interpreted as arguments to that command (only -BSD-compatible install options are recognized)." - ;; - - link) - $ECHO \ -"Usage: $progname [OPTION]... --mode=link LINK-COMMAND... - -Link object files or libraries together to form another library, or to -create an executable program. - -LINK-COMMAND is a command using the C compiler that you would use to create -a program from several object files. - -The following components of LINK-COMMAND are treated specially: - - -all-static do not do any dynamic linking at all - -avoid-version do not add a version suffix if possible - -bindir BINDIR specify path to binaries directory (for systems where - libraries must be found in the PATH setting at runtime) - -dlopen FILE '-dlpreopen' FILE if it cannot be dlopened at runtime - -dlpreopen FILE link in FILE and add its symbols to lt_preloaded_symbols - -export-dynamic allow symbols from OUTPUT-FILE to be resolved with dlsym(3) - -export-symbols SYMFILE - try to export only the symbols listed in SYMFILE - -export-symbols-regex REGEX - try to export only the symbols matching REGEX - -LLIBDIR search LIBDIR for required installed libraries - -lNAME OUTPUT-FILE requires the installed library libNAME - -module build a library that can dlopened - -no-fast-install disable the fast-install mode - -no-install link a not-installable executable - -no-undefined declare that a library does not refer to external symbols - -o OUTPUT-FILE create OUTPUT-FILE from the specified objects - -objectlist FILE use a list of object files found in FILE to specify objects - -os2dllname NAME force a short DLL name on OS/2 (no effect on other OSes) - -precious-files-regex REGEX - don't remove output files matching REGEX - -release RELEASE specify package release information - -rpath LIBDIR the created library will eventually be installed in LIBDIR - -R[ ]LIBDIR add LIBDIR to the runtime path of programs and libraries - -shared only do dynamic linking of libtool libraries - -shrext SUFFIX override the standard shared library file extension - -static do not do any dynamic linking of uninstalled libtool libraries - -static-libtool-libs - do not do any dynamic linking of libtool libraries - -version-info CURRENT[:REVISION[:AGE]] - specify library version info [each variable defaults to 0] - -weak LIBNAME declare that the target provides the LIBNAME interface - -Wc,FLAG - -Xcompiler FLAG pass linker-specific FLAG directly to the compiler - -Wl,FLAG - -Xlinker FLAG pass linker-specific FLAG directly to the linker - -XCClinker FLAG pass link-specific FLAG to the compiler driver (CC) - -All other options (arguments beginning with '-') are ignored. - -Every other argument is treated as a filename. Files ending in '.la' are -treated as uninstalled libtool libraries, other files are standard or library -object files. - -If the OUTPUT-FILE ends in '.la', then a libtool library is created, -only library objects ('.lo' files) may be specified, and '-rpath' is -required, except when creating a convenience library. - -If OUTPUT-FILE ends in '.a' or '.lib', then a standard library is created -using 'ar' and 'ranlib', or on Windows using 'lib'. - -If OUTPUT-FILE ends in '.lo' or '.$objext', then a reloadable object file -is created, otherwise an executable program is created." - ;; - - uninstall) - $ECHO \ -"Usage: $progname [OPTION]... --mode=uninstall RM [RM-OPTION]... FILE... - -Remove libraries from an installation directory. - -RM is the name of the program to use to delete files associated with each FILE -(typically '/bin/rm'). RM-OPTIONS are options (such as '-f') to be passed -to RM. - -If FILE is a libtool library, all the files associated with it are deleted. -Otherwise, only FILE itself is deleted using RM." - ;; - - *) - func_fatal_help "invalid operation mode '$opt_mode'" - ;; - esac - - echo - $ECHO "Try '$progname --help' for more information about other modes." -} - -# Now that we've collected a possible --mode arg, show help if necessary -if $opt_help; then - if test : = "$opt_help"; then - func_mode_help - else - { - func_help noexit - for opt_mode in compile link execute install finish uninstall clean; do - func_mode_help - done - } | $SED -n '1p; 2,$s/^Usage:/ or: /p' - { - func_help noexit - for opt_mode in compile link execute install finish uninstall clean; do - echo - func_mode_help - done - } | - $SED '1d - /^When reporting/,/^Report/{ - H - d - } - $x - /information about other modes/d - /more detailed .*MODE/d - s/^Usage:.*--mode=\([^ ]*\) .*/Description of \1 mode:/' - fi - exit $? -fi - - -# func_mode_execute arg... -func_mode_execute () -{ - $debug_cmd - - # The first argument is the command name. - cmd=$nonopt - test -z "$cmd" && \ - func_fatal_help "you must specify a COMMAND" - - # Handle -dlopen flags immediately. - for file in $opt_dlopen; do - test -f "$file" \ - || func_fatal_help "'$file' is not a file" - - dir= - case $file in - *.la) - func_resolve_sysroot "$file" - file=$func_resolve_sysroot_result - - # Check to see that this really is a libtool archive. - func_lalib_unsafe_p "$file" \ - || func_fatal_help "'$lib' is not a valid libtool archive" - - # Read the libtool library. - dlname= - library_names= - func_source "$file" - - # Skip this library if it cannot be dlopened. - if test -z "$dlname"; then - # Warn if it was a shared library. - test -n "$library_names" && \ - func_warning "'$file' was not linked with '-export-dynamic'" - continue - fi - - func_dirname "$file" "" "." - dir=$func_dirname_result - - if test -f "$dir/$objdir/$dlname"; then - func_append dir "/$objdir" - else - if test ! -f "$dir/$dlname"; then - func_fatal_error "cannot find '$dlname' in '$dir' or '$dir/$objdir'" - fi - fi - ;; - - *.lo) - # Just add the directory containing the .lo file. - func_dirname "$file" "" "." - dir=$func_dirname_result - ;; - - *) - func_warning "'-dlopen' is ignored for non-libtool libraries and objects" - continue - ;; - esac - - # Get the absolute pathname. - absdir=`cd "$dir" && pwd` - test -n "$absdir" && dir=$absdir - - # Now add the directory to shlibpath_var. - if eval "test -z \"\$$shlibpath_var\""; then - eval "$shlibpath_var=\"\$dir\"" - else - eval "$shlibpath_var=\"\$dir:\$$shlibpath_var\"" - fi - done - - # This variable tells wrapper scripts just to set shlibpath_var - # rather than running their programs. - libtool_execute_magic=$magic - - # Check if any of the arguments is a wrapper script. - args= - for file - do - case $file in - -* | *.la | *.lo ) ;; - *) - # Do a test to see if this is really a libtool program. - if func_ltwrapper_script_p "$file"; then - func_source "$file" - # Transform arg to wrapped name. - file=$progdir/$program - elif func_ltwrapper_executable_p "$file"; then - func_ltwrapper_scriptname "$file" - func_source "$func_ltwrapper_scriptname_result" - # Transform arg to wrapped name. - file=$progdir/$program - fi - ;; - esac - # Quote arguments (to preserve shell metacharacters). - func_append_quoted args "$file" - done - - if $opt_dry_run; then - # Display what would be done. - if test -n "$shlibpath_var"; then - eval "\$ECHO \"\$shlibpath_var=\$$shlibpath_var\"" - echo "export $shlibpath_var" - fi - $ECHO "$cmd$args" - exit $EXIT_SUCCESS - else - if test -n "$shlibpath_var"; then - # Export the shlibpath_var. - eval "export $shlibpath_var" - fi - - # Restore saved environment variables - for lt_var in LANG LANGUAGE LC_ALL LC_CTYPE LC_COLLATE LC_MESSAGES - do - eval "if test \"\${save_$lt_var+set}\" = set; then - $lt_var=\$save_$lt_var; export $lt_var - else - $lt_unset $lt_var - fi" - done - - # Now prepare to actually exec the command. - exec_cmd=\$cmd$args - fi -} - -test execute = "$opt_mode" && func_mode_execute ${1+"$@"} - - -# func_mode_finish arg... -func_mode_finish () -{ - $debug_cmd - - libs= - libdirs= - admincmds= - - for opt in "$nonopt" ${1+"$@"} - do - if test -d "$opt"; then - func_append libdirs " $opt" - - elif test -f "$opt"; then - if func_lalib_unsafe_p "$opt"; then - func_append libs " $opt" - else - func_warning "'$opt' is not a valid libtool archive" - fi - - else - func_fatal_error "invalid argument '$opt'" - fi - done - - if test -n "$libs"; then - if test -n "$lt_sysroot"; then - sysroot_regex=`$ECHO "$lt_sysroot" | $SED "$sed_make_literal_regex"` - sysroot_cmd="s/\([ ']\)$sysroot_regex/\1/g;" - else - sysroot_cmd= - fi - - # Remove sysroot references - if $opt_dry_run; then - for lib in $libs; do - echo "removing references to $lt_sysroot and '=' prefixes from $lib" - done - else - tmpdir=`func_mktempdir` - for lib in $libs; do - $SED -e "$sysroot_cmd s/\([ ']-[LR]\)=/\1/g; s/\([ ']\)=/\1/g" $lib \ - > $tmpdir/tmp-la - mv -f $tmpdir/tmp-la $lib - done - ${RM}r "$tmpdir" - fi - fi - - if test -n "$finish_cmds$finish_eval" && test -n "$libdirs"; then - for libdir in $libdirs; do - if test -n "$finish_cmds"; then - # Do each command in the finish commands. - func_execute_cmds "$finish_cmds" 'admincmds="$admincmds -'"$cmd"'"' - fi - if test -n "$finish_eval"; then - # Do the single finish_eval. - eval cmds=\"$finish_eval\" - $opt_dry_run || eval "$cmds" || func_append admincmds " - $cmds" - fi - done - fi - - # Exit here if they wanted silent mode. - $opt_quiet && exit $EXIT_SUCCESS - - if test -n "$finish_cmds$finish_eval" && test -n "$libdirs"; then - echo "----------------------------------------------------------------------" - echo "Libraries have been installed in:" - for libdir in $libdirs; do - $ECHO " $libdir" - done - echo - echo "If you ever happen to want to link against installed libraries" - echo "in a given directory, LIBDIR, you must either use libtool, and" - echo "specify the full pathname of the library, or use the '-LLIBDIR'" - echo "flag during linking and do at least one of the following:" - if test -n "$shlibpath_var"; then - echo " - add LIBDIR to the '$shlibpath_var' environment variable" - echo " during execution" - fi - if test -n "$runpath_var"; then - echo " - add LIBDIR to the '$runpath_var' environment variable" - echo " during linking" - fi - if test -n "$hardcode_libdir_flag_spec"; then - libdir=LIBDIR - eval flag=\"$hardcode_libdir_flag_spec\" - - $ECHO " - use the '$flag' linker flag" - fi - if test -n "$admincmds"; then - $ECHO " - have your system administrator run these commands:$admincmds" - fi - if test -f /etc/ld.so.conf; then - echo " - have your system administrator add LIBDIR to '/etc/ld.so.conf'" - fi - echo - - echo "See any operating system documentation about shared libraries for" - case $host in - solaris2.[6789]|solaris2.1[0-9]) - echo "more information, such as the ld(1), crle(1) and ld.so(8) manual" - echo "pages." - ;; - *) - echo "more information, such as the ld(1) and ld.so(8) manual pages." - ;; - esac - echo "----------------------------------------------------------------------" - fi - exit $EXIT_SUCCESS -} - -test finish = "$opt_mode" && func_mode_finish ${1+"$@"} - - -# func_mode_install arg... -func_mode_install () -{ - $debug_cmd - - # There may be an optional sh(1) argument at the beginning of - # install_prog (especially on Windows NT). - if test "$SHELL" = "$nonopt" || test /bin/sh = "$nonopt" || - # Allow the use of GNU shtool's install command. - case $nonopt in *shtool*) :;; *) false;; esac - then - # Aesthetically quote it. - func_quote_for_eval "$nonopt" - install_prog="$func_quote_for_eval_result " - arg=$1 - shift - else - install_prog= - arg=$nonopt - fi - - # The real first argument should be the name of the installation program. - # Aesthetically quote it. - func_quote_for_eval "$arg" - func_append install_prog "$func_quote_for_eval_result" - install_shared_prog=$install_prog - case " $install_prog " in - *[\\\ /]cp\ *) install_cp=: ;; - *) install_cp=false ;; - esac - - # We need to accept at least all the BSD install flags. - dest= - files= - opts= - prev= - install_type= - isdir=false - stripme= - no_mode=: - for arg - do - arg2= - if test -n "$dest"; then - func_append files " $dest" - dest=$arg - continue - fi - - case $arg in - -d) isdir=: ;; - -f) - if $install_cp; then :; else - prev=$arg - fi - ;; - -g | -m | -o) - prev=$arg - ;; - -s) - stripme=" -s" - continue - ;; - -*) - ;; - *) - # If the previous option needed an argument, then skip it. - if test -n "$prev"; then - if test X-m = "X$prev" && test -n "$install_override_mode"; then - arg2=$install_override_mode - no_mode=false - fi - prev= - else - dest=$arg - continue - fi - ;; - esac - - # Aesthetically quote the argument. - func_quote_for_eval "$arg" - func_append install_prog " $func_quote_for_eval_result" - if test -n "$arg2"; then - func_quote_for_eval "$arg2" - fi - func_append install_shared_prog " $func_quote_for_eval_result" - done - - test -z "$install_prog" && \ - func_fatal_help "you must specify an install program" - - test -n "$prev" && \ - func_fatal_help "the '$prev' option requires an argument" - - if test -n "$install_override_mode" && $no_mode; then - if $install_cp; then :; else - func_quote_for_eval "$install_override_mode" - func_append install_shared_prog " -m $func_quote_for_eval_result" - fi - fi - - if test -z "$files"; then - if test -z "$dest"; then - func_fatal_help "no file or destination specified" - else - func_fatal_help "you must specify a destination" - fi - fi - - # Strip any trailing slash from the destination. - func_stripname '' '/' "$dest" - dest=$func_stripname_result - - # Check to see that the destination is a directory. - test -d "$dest" && isdir=: - if $isdir; then - destdir=$dest - destname= - else - func_dirname_and_basename "$dest" "" "." - destdir=$func_dirname_result - destname=$func_basename_result - - # Not a directory, so check to see that there is only one file specified. - set dummy $files; shift - test "$#" -gt 1 && \ - func_fatal_help "'$dest' is not a directory" - fi - case $destdir in - [\\/]* | [A-Za-z]:[\\/]*) ;; - *) - for file in $files; do - case $file in - *.lo) ;; - *) - func_fatal_help "'$destdir' must be an absolute directory name" - ;; - esac - done - ;; - esac - - # This variable tells wrapper scripts just to set variables rather - # than running their programs. - libtool_install_magic=$magic - - staticlibs= - future_libdirs= - current_libdirs= - for file in $files; do - - # Do each installation. - case $file in - *.$libext) - # Do the static libraries later. - func_append staticlibs " $file" - ;; - - *.la) - func_resolve_sysroot "$file" - file=$func_resolve_sysroot_result - - # Check to see that this really is a libtool archive. - func_lalib_unsafe_p "$file" \ - || func_fatal_help "'$file' is not a valid libtool archive" - - library_names= - old_library= - relink_command= - func_source "$file" - - # Add the libdir to current_libdirs if it is the destination. - if test "X$destdir" = "X$libdir"; then - case "$current_libdirs " in - *" $libdir "*) ;; - *) func_append current_libdirs " $libdir" ;; - esac - else - # Note the libdir as a future libdir. - case "$future_libdirs " in - *" $libdir "*) ;; - *) func_append future_libdirs " $libdir" ;; - esac - fi - - func_dirname "$file" "/" "" - dir=$func_dirname_result - func_append dir "$objdir" - - if test -n "$relink_command"; then - # Determine the prefix the user has applied to our future dir. - inst_prefix_dir=`$ECHO "$destdir" | $SED -e "s%$libdir\$%%"` - - # Don't allow the user to place us outside of our expected - # location b/c this prevents finding dependent libraries that - # are installed to the same prefix. - # At present, this check doesn't affect windows .dll's that - # are installed into $libdir/../bin (currently, that works fine) - # but it's something to keep an eye on. - test "$inst_prefix_dir" = "$destdir" && \ - func_fatal_error "error: cannot install '$file' to a directory not ending in $libdir" - - if test -n "$inst_prefix_dir"; then - # Stick the inst_prefix_dir data into the link command. - relink_command=`$ECHO "$relink_command" | $SED "s%@inst_prefix_dir@%-inst-prefix-dir $inst_prefix_dir%"` - else - relink_command=`$ECHO "$relink_command" | $SED "s%@inst_prefix_dir@%%"` - fi - - func_warning "relinking '$file'" - func_show_eval "$relink_command" \ - 'func_fatal_error "error: relink '\''$file'\'' with the above command before installing it"' - fi - - # See the names of the shared library. - set dummy $library_names; shift - if test -n "$1"; then - realname=$1 - shift - - srcname=$realname - test -n "$relink_command" && srcname=${realname}T - - # Install the shared library and build the symlinks. - func_show_eval "$install_shared_prog $dir/$srcname $destdir/$realname" \ - 'exit $?' - tstripme=$stripme - case $host_os in - cygwin* | mingw* | pw32* | cegcc*) - case $realname in - *.dll.a) - tstripme= - ;; - esac - ;; - os2*) - case $realname in - *_dll.a) - tstripme= - ;; - esac - ;; - esac - if test -n "$tstripme" && test -n "$striplib"; then - func_show_eval "$striplib $destdir/$realname" 'exit $?' - fi - - if test "$#" -gt 0; then - # Delete the old symlinks, and create new ones. - # Try 'ln -sf' first, because the 'ln' binary might depend on - # the symlink we replace! Solaris /bin/ln does not understand -f, - # so we also need to try rm && ln -s. - for linkname - do - test "$linkname" != "$realname" \ - && func_show_eval "(cd $destdir && { $LN_S -f $realname $linkname || { $RM $linkname && $LN_S $realname $linkname; }; })" - done - fi - - # Do each command in the postinstall commands. - lib=$destdir/$realname - func_execute_cmds "$postinstall_cmds" 'exit $?' - fi - - # Install the pseudo-library for information purposes. - func_basename "$file" - name=$func_basename_result - instname=$dir/${name}i - func_show_eval "$install_prog $instname $destdir/$name" 'exit $?' - - # Maybe install the static library, too. - test -n "$old_library" && func_append staticlibs " $dir/$old_library" - ;; - - *.lo) - # Install (i.e. copy) a libtool object. - - # Figure out destination file name, if it wasn't already specified. - if test -n "$destname"; then - destfile=$destdir/$destname - else - func_basename "$file" - destfile=$func_basename_result - destfile=$destdir/$destfile - fi - - # Deduce the name of the destination old-style object file. - case $destfile in - *.lo) - func_lo2o "$destfile" - staticdest=$func_lo2o_result - ;; - *.$objext) - staticdest=$destfile - destfile= - ;; - *) - func_fatal_help "cannot copy a libtool object to '$destfile'" - ;; - esac - - # Install the libtool object if requested. - test -n "$destfile" && \ - func_show_eval "$install_prog $file $destfile" 'exit $?' - - # Install the old object if enabled. - if test yes = "$build_old_libs"; then - # Deduce the name of the old-style object file. - func_lo2o "$file" - staticobj=$func_lo2o_result - func_show_eval "$install_prog \$staticobj \$staticdest" 'exit $?' - fi - exit $EXIT_SUCCESS - ;; - - *) - # Figure out destination file name, if it wasn't already specified. - if test -n "$destname"; then - destfile=$destdir/$destname - else - func_basename "$file" - destfile=$func_basename_result - destfile=$destdir/$destfile - fi - - # If the file is missing, and there is a .exe on the end, strip it - # because it is most likely a libtool script we actually want to - # install - stripped_ext= - case $file in - *.exe) - if test ! -f "$file"; then - func_stripname '' '.exe' "$file" - file=$func_stripname_result - stripped_ext=.exe - fi - ;; - esac - - # Do a test to see if this is really a libtool program. - case $host in - *cygwin* | *mingw*) - if func_ltwrapper_executable_p "$file"; then - func_ltwrapper_scriptname "$file" - wrapper=$func_ltwrapper_scriptname_result - else - func_stripname '' '.exe' "$file" - wrapper=$func_stripname_result - fi - ;; - *) - wrapper=$file - ;; - esac - if func_ltwrapper_script_p "$wrapper"; then - notinst_deplibs= - relink_command= - - func_source "$wrapper" - - # Check the variables that should have been set. - test -z "$generated_by_libtool_version" && \ - func_fatal_error "invalid libtool wrapper script '$wrapper'" - - finalize=: - for lib in $notinst_deplibs; do - # Check to see that each library is installed. - libdir= - if test -f "$lib"; then - func_source "$lib" - fi - libfile=$libdir/`$ECHO "$lib" | $SED 's%^.*/%%g'` - if test -n "$libdir" && test ! -f "$libfile"; then - func_warning "'$lib' has not been installed in '$libdir'" - finalize=false - fi - done - - relink_command= - func_source "$wrapper" - - outputname= - if test no = "$fast_install" && test -n "$relink_command"; then - $opt_dry_run || { - if $finalize; then - tmpdir=`func_mktempdir` - func_basename "$file$stripped_ext" - file=$func_basename_result - outputname=$tmpdir/$file - # Replace the output file specification. - relink_command=`$ECHO "$relink_command" | $SED 's%@OUTPUT@%'"$outputname"'%g'` - - $opt_quiet || { - func_quote_for_expand "$relink_command" - eval "func_echo $func_quote_for_expand_result" - } - if eval "$relink_command"; then : - else - func_error "error: relink '$file' with the above command before installing it" - $opt_dry_run || ${RM}r "$tmpdir" - continue - fi - file=$outputname - else - func_warning "cannot relink '$file'" - fi - } - else - # Install the binary that we compiled earlier. - file=`$ECHO "$file$stripped_ext" | $SED "s%\([^/]*\)$%$objdir/\1%"` - fi - fi - - # remove .exe since cygwin /usr/bin/install will append another - # one anyway - case $install_prog,$host in - */usr/bin/install*,*cygwin*) - case $file:$destfile in - *.exe:*.exe) - # this is ok - ;; - *.exe:*) - destfile=$destfile.exe - ;; - *:*.exe) - func_stripname '' '.exe' "$destfile" - destfile=$func_stripname_result - ;; - esac - ;; - esac - func_show_eval "$install_prog\$stripme \$file \$destfile" 'exit $?' - $opt_dry_run || if test -n "$outputname"; then - ${RM}r "$tmpdir" - fi - ;; - esac - done - - for file in $staticlibs; do - func_basename "$file" - name=$func_basename_result - - # Set up the ranlib parameters. - oldlib=$destdir/$name - func_to_tool_file "$oldlib" func_convert_file_msys_to_w32 - tool_oldlib=$func_to_tool_file_result - - func_show_eval "$install_prog \$file \$oldlib" 'exit $?' - - if test -n "$stripme" && test -n "$old_striplib"; then - func_show_eval "$old_striplib $tool_oldlib" 'exit $?' - fi - - # Do each command in the postinstall commands. - func_execute_cmds "$old_postinstall_cmds" 'exit $?' - done - - test -n "$future_libdirs" && \ - func_warning "remember to run '$progname --finish$future_libdirs'" - - if test -n "$current_libdirs"; then - # Maybe just do a dry run. - $opt_dry_run && current_libdirs=" -n$current_libdirs" - exec_cmd='$SHELL "$progpath" $preserve_args --finish$current_libdirs' - else - exit $EXIT_SUCCESS - fi -} - -test install = "$opt_mode" && func_mode_install ${1+"$@"} - - -# func_generate_dlsyms outputname originator pic_p -# Extract symbols from dlprefiles and create ${outputname}S.o with -# a dlpreopen symbol table. -func_generate_dlsyms () -{ - $debug_cmd - - my_outputname=$1 - my_originator=$2 - my_pic_p=${3-false} - my_prefix=`$ECHO "$my_originator" | $SED 's%[^a-zA-Z0-9]%_%g'` - my_dlsyms= - - if test -n "$dlfiles$dlprefiles" || test no != "$dlself"; then - if test -n "$NM" && test -n "$global_symbol_pipe"; then - my_dlsyms=${my_outputname}S.c - else - func_error "not configured to extract global symbols from dlpreopened files" - fi - fi - - if test -n "$my_dlsyms"; then - case $my_dlsyms in - "") ;; - *.c) - # Discover the nlist of each of the dlfiles. - nlist=$output_objdir/$my_outputname.nm - - func_show_eval "$RM $nlist ${nlist}S ${nlist}T" - - # Parse the name list into a source file. - func_verbose "creating $output_objdir/$my_dlsyms" - - $opt_dry_run || $ECHO > "$output_objdir/$my_dlsyms" "\ -/* $my_dlsyms - symbol resolution table for '$my_outputname' dlsym emulation. */ -/* Generated by $PROGRAM (GNU $PACKAGE) $VERSION */ - -#ifdef __cplusplus -extern \"C\" { -#endif - -#if defined __GNUC__ && (((__GNUC__ == 4) && (__GNUC_MINOR__ >= 4)) || (__GNUC__ > 4)) -#pragma GCC diagnostic ignored \"-Wstrict-prototypes\" -#endif - -/* Keep this code in sync between libtool.m4, ltmain, lt_system.h, and tests. */ -#if defined _WIN32 || defined __CYGWIN__ || defined _WIN32_WCE -/* DATA imports from DLLs on WIN32 can't be const, because runtime - relocations are performed -- see ld's documentation on pseudo-relocs. */ -# define LT_DLSYM_CONST -#elif defined __osf__ -/* This system does not cope well with relocations in const data. */ -# define LT_DLSYM_CONST -#else -# define LT_DLSYM_CONST const -#endif - -#define STREQ(s1, s2) (strcmp ((s1), (s2)) == 0) - -/* External symbol declarations for the compiler. */\ -" - - if test yes = "$dlself"; then - func_verbose "generating symbol list for '$output'" - - $opt_dry_run || echo ': @PROGRAM@ ' > "$nlist" - - # Add our own program objects to the symbol list. - progfiles=`$ECHO "$objs$old_deplibs" | $SP2NL | $SED "$lo2o" | $NL2SP` - for progfile in $progfiles; do - func_to_tool_file "$progfile" func_convert_file_msys_to_w32 - func_verbose "extracting global C symbols from '$func_to_tool_file_result'" - $opt_dry_run || eval "$NM $func_to_tool_file_result | $global_symbol_pipe >> '$nlist'" - done - - if test -n "$exclude_expsyms"; then - $opt_dry_run || { - eval '$EGREP -v " ($exclude_expsyms)$" "$nlist" > "$nlist"T' - eval '$MV "$nlist"T "$nlist"' - } - fi - - if test -n "$export_symbols_regex"; then - $opt_dry_run || { - eval '$EGREP -e "$export_symbols_regex" "$nlist" > "$nlist"T' - eval '$MV "$nlist"T "$nlist"' - } - fi - - # Prepare the list of exported symbols - if test -z "$export_symbols"; then - export_symbols=$output_objdir/$outputname.exp - $opt_dry_run || { - $RM $export_symbols - eval "$SED -n -e '/^: @PROGRAM@ $/d' -e 's/^.* \(.*\)$/\1/p' "'< "$nlist" > "$export_symbols"' - case $host in - *cygwin* | *mingw* | *cegcc* ) - eval "echo EXPORTS "'> "$output_objdir/$outputname.def"' - eval 'cat "$export_symbols" >> "$output_objdir/$outputname.def"' - ;; - esac - } - else - $opt_dry_run || { - eval "$SED -e 's/\([].[*^$]\)/\\\\\1/g' -e 's/^/ /' -e 's/$/$/'"' < "$export_symbols" > "$output_objdir/$outputname.exp"' - eval '$GREP -f "$output_objdir/$outputname.exp" < "$nlist" > "$nlist"T' - eval '$MV "$nlist"T "$nlist"' - case $host in - *cygwin* | *mingw* | *cegcc* ) - eval "echo EXPORTS "'> "$output_objdir/$outputname.def"' - eval 'cat "$nlist" >> "$output_objdir/$outputname.def"' - ;; - esac - } - fi - fi - - for dlprefile in $dlprefiles; do - func_verbose "extracting global C symbols from '$dlprefile'" - func_basename "$dlprefile" - name=$func_basename_result - case $host in - *cygwin* | *mingw* | *cegcc* ) - # if an import library, we need to obtain dlname - if func_win32_import_lib_p "$dlprefile"; then - func_tr_sh "$dlprefile" - eval "curr_lafile=\$libfile_$func_tr_sh_result" - dlprefile_dlbasename= - if test -n "$curr_lafile" && func_lalib_p "$curr_lafile"; then - # Use subshell, to avoid clobbering current variable values - dlprefile_dlname=`source "$curr_lafile" && echo "$dlname"` - if test -n "$dlprefile_dlname"; then - func_basename "$dlprefile_dlname" - dlprefile_dlbasename=$func_basename_result - else - # no lafile. user explicitly requested -dlpreopen . - $sharedlib_from_linklib_cmd "$dlprefile" - dlprefile_dlbasename=$sharedlib_from_linklib_result - fi - fi - $opt_dry_run || { - if test -n "$dlprefile_dlbasename"; then - eval '$ECHO ": $dlprefile_dlbasename" >> "$nlist"' - else - func_warning "Could not compute DLL name from $name" - eval '$ECHO ": $name " >> "$nlist"' - fi - func_to_tool_file "$dlprefile" func_convert_file_msys_to_w32 - eval "$NM \"$func_to_tool_file_result\" 2>/dev/null | $global_symbol_pipe | - $SED -e '/I __imp/d' -e 's/I __nm_/D /;s/_nm__//' >> '$nlist'" - } - else # not an import lib - $opt_dry_run || { - eval '$ECHO ": $name " >> "$nlist"' - func_to_tool_file "$dlprefile" func_convert_file_msys_to_w32 - eval "$NM \"$func_to_tool_file_result\" 2>/dev/null | $global_symbol_pipe >> '$nlist'" - } - fi - ;; - *) - $opt_dry_run || { - eval '$ECHO ": $name " >> "$nlist"' - func_to_tool_file "$dlprefile" func_convert_file_msys_to_w32 - eval "$NM \"$func_to_tool_file_result\" 2>/dev/null | $global_symbol_pipe >> '$nlist'" - } - ;; - esac - done - - $opt_dry_run || { - # Make sure we have at least an empty file. - test -f "$nlist" || : > "$nlist" - - if test -n "$exclude_expsyms"; then - $EGREP -v " ($exclude_expsyms)$" "$nlist" > "$nlist"T - $MV "$nlist"T "$nlist" - fi - - # Try sorting and uniquifying the output. - if $GREP -v "^: " < "$nlist" | - if sort -k 3 /dev/null 2>&1; then - sort -k 3 - else - sort +2 - fi | - uniq > "$nlist"S; then - : - else - $GREP -v "^: " < "$nlist" > "$nlist"S - fi - - if test -f "$nlist"S; then - eval "$global_symbol_to_cdecl"' < "$nlist"S >> "$output_objdir/$my_dlsyms"' - else - echo '/* NONE */' >> "$output_objdir/$my_dlsyms" - fi - - func_show_eval '$RM "${nlist}I"' - if test -n "$global_symbol_to_import"; then - eval "$global_symbol_to_import"' < "$nlist"S > "$nlist"I' - fi - - echo >> "$output_objdir/$my_dlsyms" "\ - -/* The mapping between symbol names and symbols. */ -typedef struct { - const char *name; - void *address; -} lt_dlsymlist; -extern LT_DLSYM_CONST lt_dlsymlist -lt_${my_prefix}_LTX_preloaded_symbols[];\ -" - - if test -s "$nlist"I; then - echo >> "$output_objdir/$my_dlsyms" "\ -static void lt_syminit(void) -{ - LT_DLSYM_CONST lt_dlsymlist *symbol = lt_${my_prefix}_LTX_preloaded_symbols; - for (; symbol->name; ++symbol) - {" - $SED 's/.*/ if (STREQ (symbol->name, \"&\")) symbol->address = (void *) \&&;/' < "$nlist"I >> "$output_objdir/$my_dlsyms" - echo >> "$output_objdir/$my_dlsyms" "\ - } -}" - fi - echo >> "$output_objdir/$my_dlsyms" "\ -LT_DLSYM_CONST lt_dlsymlist -lt_${my_prefix}_LTX_preloaded_symbols[] = -{ {\"$my_originator\", (void *) 0}," - - if test -s "$nlist"I; then - echo >> "$output_objdir/$my_dlsyms" "\ - {\"@INIT@\", (void *) <_syminit}," - fi - - case $need_lib_prefix in - no) - eval "$global_symbol_to_c_name_address" < "$nlist" >> "$output_objdir/$my_dlsyms" - ;; - *) - eval "$global_symbol_to_c_name_address_lib_prefix" < "$nlist" >> "$output_objdir/$my_dlsyms" - ;; - esac - echo >> "$output_objdir/$my_dlsyms" "\ - {0, (void *) 0} -}; - -/* This works around a problem in FreeBSD linker */ -#ifdef FREEBSD_WORKAROUND -static const void *lt_preloaded_setup() { - return lt_${my_prefix}_LTX_preloaded_symbols; -} -#endif - -#ifdef __cplusplus -} -#endif\ -" - } # !$opt_dry_run - - pic_flag_for_symtable= - case "$compile_command " in - *" -static "*) ;; - *) - case $host in - # compiling the symbol table file with pic_flag works around - # a FreeBSD bug that causes programs to crash when -lm is - # linked before any other PIC object. But we must not use - # pic_flag when linking with -static. The problem exists in - # FreeBSD 2.2.6 and is fixed in FreeBSD 3.1. - *-*-freebsd2.*|*-*-freebsd3.0*|*-*-freebsdelf3.0*) - pic_flag_for_symtable=" $pic_flag -DFREEBSD_WORKAROUND" ;; - *-*-hpux*) - pic_flag_for_symtable=" $pic_flag" ;; - *) - $my_pic_p && pic_flag_for_symtable=" $pic_flag" - ;; - esac - ;; - esac - symtab_cflags= - for arg in $LTCFLAGS; do - case $arg in - -pie | -fpie | -fPIE) ;; - *) func_append symtab_cflags " $arg" ;; - esac - done - - # Now compile the dynamic symbol file. - func_show_eval '(cd $output_objdir && $LTCC$symtab_cflags -c$no_builtin_flag$pic_flag_for_symtable "$my_dlsyms")' 'exit $?' - - # Clean up the generated files. - func_show_eval '$RM "$output_objdir/$my_dlsyms" "$nlist" "${nlist}S" "${nlist}T" "${nlist}I"' - - # Transform the symbol file into the correct name. - symfileobj=$output_objdir/${my_outputname}S.$objext - case $host in - *cygwin* | *mingw* | *cegcc* ) - if test -f "$output_objdir/$my_outputname.def"; then - compile_command=`$ECHO "$compile_command" | $SED "s%@SYMFILE@%$output_objdir/$my_outputname.def $symfileobj%"` - finalize_command=`$ECHO "$finalize_command" | $SED "s%@SYMFILE@%$output_objdir/$my_outputname.def $symfileobj%"` - else - compile_command=`$ECHO "$compile_command" | $SED "s%@SYMFILE@%$symfileobj%"` - finalize_command=`$ECHO "$finalize_command" | $SED "s%@SYMFILE@%$symfileobj%"` - fi - ;; - *) - compile_command=`$ECHO "$compile_command" | $SED "s%@SYMFILE@%$symfileobj%"` - finalize_command=`$ECHO "$finalize_command" | $SED "s%@SYMFILE@%$symfileobj%"` - ;; - esac - ;; - *) - func_fatal_error "unknown suffix for '$my_dlsyms'" - ;; - esac - else - # We keep going just in case the user didn't refer to - # lt_preloaded_symbols. The linker will fail if global_symbol_pipe - # really was required. - - # Nullify the symbol file. - compile_command=`$ECHO "$compile_command" | $SED "s% @SYMFILE@%%"` - finalize_command=`$ECHO "$finalize_command" | $SED "s% @SYMFILE@%%"` - fi -} - -# func_cygming_gnu_implib_p ARG -# This predicate returns with zero status (TRUE) if -# ARG is a GNU/binutils-style import library. Returns -# with nonzero status (FALSE) otherwise. -func_cygming_gnu_implib_p () -{ - $debug_cmd - - func_to_tool_file "$1" func_convert_file_msys_to_w32 - func_cygming_gnu_implib_tmp=`$NM "$func_to_tool_file_result" | eval "$global_symbol_pipe" | $EGREP ' (_head_[A-Za-z0-9_]+_[ad]l*|[A-Za-z0-9_]+_[ad]l*_iname)$'` - test -n "$func_cygming_gnu_implib_tmp" -} - -# func_cygming_ms_implib_p ARG -# This predicate returns with zero status (TRUE) if -# ARG is an MS-style import library. Returns -# with nonzero status (FALSE) otherwise. -func_cygming_ms_implib_p () -{ - $debug_cmd - - func_to_tool_file "$1" func_convert_file_msys_to_w32 - func_cygming_ms_implib_tmp=`$NM "$func_to_tool_file_result" | eval "$global_symbol_pipe" | $GREP '_NULL_IMPORT_DESCRIPTOR'` - test -n "$func_cygming_ms_implib_tmp" -} - -# func_win32_libid arg -# return the library type of file 'arg' -# -# Need a lot of goo to handle *both* DLLs and import libs -# Has to be a shell function in order to 'eat' the argument -# that is supplied when $file_magic_command is called. -# Despite the name, also deal with 64 bit binaries. -func_win32_libid () -{ - $debug_cmd - - win32_libid_type=unknown - win32_fileres=`file -L $1 2>/dev/null` - case $win32_fileres in - *ar\ archive\ import\ library*) # definitely import - win32_libid_type="x86 archive import" - ;; - *ar\ archive*) # could be an import, or static - # Keep the egrep pattern in sync with the one in _LT_CHECK_MAGIC_METHOD. - if eval $OBJDUMP -f $1 | $SED -e '10q' 2>/dev/null | - $EGREP 'file format (pei*-i386(.*architecture: i386)?|pe-arm-wince|pe-x86-64)' >/dev/null; then - case $nm_interface in - "MS dumpbin") - if func_cygming_ms_implib_p "$1" || - func_cygming_gnu_implib_p "$1" - then - win32_nmres=import - else - win32_nmres= - fi - ;; - *) - func_to_tool_file "$1" func_convert_file_msys_to_w32 - win32_nmres=`eval $NM -f posix -A \"$func_to_tool_file_result\" | - $SED -n -e ' - 1,100{ - / I /{ - s|.*|import| - p - q - } - }'` - ;; - esac - case $win32_nmres in - import*) win32_libid_type="x86 archive import";; - *) win32_libid_type="x86 archive static";; - esac - fi - ;; - *DLL*) - win32_libid_type="x86 DLL" - ;; - *executable*) # but shell scripts are "executable" too... - case $win32_fileres in - *MS\ Windows\ PE\ Intel*) - win32_libid_type="x86 DLL" - ;; - esac - ;; - esac - $ECHO "$win32_libid_type" -} - -# func_cygming_dll_for_implib ARG -# -# Platform-specific function to extract the -# name of the DLL associated with the specified -# import library ARG. -# Invoked by eval'ing the libtool variable -# $sharedlib_from_linklib_cmd -# Result is available in the variable -# $sharedlib_from_linklib_result -func_cygming_dll_for_implib () -{ - $debug_cmd - - sharedlib_from_linklib_result=`$DLLTOOL --identify-strict --identify "$1"` -} - -# func_cygming_dll_for_implib_fallback_core SECTION_NAME LIBNAMEs -# -# The is the core of a fallback implementation of a -# platform-specific function to extract the name of the -# DLL associated with the specified import library LIBNAME. -# -# SECTION_NAME is either .idata$6 or .idata$7, depending -# on the platform and compiler that created the implib. -# -# Echos the name of the DLL associated with the -# specified import library. -func_cygming_dll_for_implib_fallback_core () -{ - $debug_cmd - - match_literal=`$ECHO "$1" | $SED "$sed_make_literal_regex"` - $OBJDUMP -s --section "$1" "$2" 2>/dev/null | - $SED '/^Contents of section '"$match_literal"':/{ - # Place marker at beginning of archive member dllname section - s/.*/====MARK====/ - p - d - } - # These lines can sometimes be longer than 43 characters, but - # are always uninteresting - /:[ ]*file format pe[i]\{,1\}-/d - /^In archive [^:]*:/d - # Ensure marker is printed - /^====MARK====/p - # Remove all lines with less than 43 characters - /^.\{43\}/!d - # From remaining lines, remove first 43 characters - s/^.\{43\}//' | - $SED -n ' - # Join marker and all lines until next marker into a single line - /^====MARK====/ b para - H - $ b para - b - :para - x - s/\n//g - # Remove the marker - s/^====MARK====// - # Remove trailing dots and whitespace - s/[\. \t]*$// - # Print - /./p' | - # we now have a list, one entry per line, of the stringified - # contents of the appropriate section of all members of the - # archive that possess that section. Heuristic: eliminate - # all those that have a first or second character that is - # a '.' (that is, objdump's representation of an unprintable - # character.) This should work for all archives with less than - # 0x302f exports -- but will fail for DLLs whose name actually - # begins with a literal '.' or a single character followed by - # a '.'. - # - # Of those that remain, print the first one. - $SED -e '/^\./d;/^.\./d;q' -} - -# func_cygming_dll_for_implib_fallback ARG -# Platform-specific function to extract the -# name of the DLL associated with the specified -# import library ARG. -# -# This fallback implementation is for use when $DLLTOOL -# does not support the --identify-strict option. -# Invoked by eval'ing the libtool variable -# $sharedlib_from_linklib_cmd -# Result is available in the variable -# $sharedlib_from_linklib_result -func_cygming_dll_for_implib_fallback () -{ - $debug_cmd - - if func_cygming_gnu_implib_p "$1"; then - # binutils import library - sharedlib_from_linklib_result=`func_cygming_dll_for_implib_fallback_core '.idata$7' "$1"` - elif func_cygming_ms_implib_p "$1"; then - # ms-generated import library - sharedlib_from_linklib_result=`func_cygming_dll_for_implib_fallback_core '.idata$6' "$1"` - else - # unknown - sharedlib_from_linklib_result= - fi -} - - -# func_extract_an_archive dir oldlib -func_extract_an_archive () -{ - $debug_cmd - - f_ex_an_ar_dir=$1; shift - f_ex_an_ar_oldlib=$1 - if test yes = "$lock_old_archive_extraction"; then - lockfile=$f_ex_an_ar_oldlib.lock - until $opt_dry_run || ln "$progpath" "$lockfile" 2>/dev/null; do - func_echo "Waiting for $lockfile to be removed" - sleep 2 - done - fi - func_show_eval "(cd \$f_ex_an_ar_dir && $AR x \"\$f_ex_an_ar_oldlib\")" \ - 'stat=$?; rm -f "$lockfile"; exit $stat' - if test yes = "$lock_old_archive_extraction"; then - $opt_dry_run || rm -f "$lockfile" - fi - if ($AR t "$f_ex_an_ar_oldlib" | sort | sort -uc >/dev/null 2>&1); then - : - else - func_fatal_error "object name conflicts in archive: $f_ex_an_ar_dir/$f_ex_an_ar_oldlib" - fi -} - - -# func_extract_archives gentop oldlib ... -func_extract_archives () -{ - $debug_cmd - - my_gentop=$1; shift - my_oldlibs=${1+"$@"} - my_oldobjs= - my_xlib= - my_xabs= - my_xdir= - - for my_xlib in $my_oldlibs; do - # Extract the objects. - case $my_xlib in - [\\/]* | [A-Za-z]:[\\/]*) my_xabs=$my_xlib ;; - *) my_xabs=`pwd`"/$my_xlib" ;; - esac - func_basename "$my_xlib" - my_xlib=$func_basename_result - my_xlib_u=$my_xlib - while :; do - case " $extracted_archives " in - *" $my_xlib_u "*) - func_arith $extracted_serial + 1 - extracted_serial=$func_arith_result - my_xlib_u=lt$extracted_serial-$my_xlib ;; - *) break ;; - esac - done - extracted_archives="$extracted_archives $my_xlib_u" - my_xdir=$my_gentop/$my_xlib_u - - func_mkdir_p "$my_xdir" - - case $host in - *-darwin*) - func_verbose "Extracting $my_xabs" - # Do not bother doing anything if just a dry run - $opt_dry_run || { - darwin_orig_dir=`pwd` - cd $my_xdir || exit $? - darwin_archive=$my_xabs - darwin_curdir=`pwd` - func_basename "$darwin_archive" - darwin_base_archive=$func_basename_result - darwin_arches=`$LIPO -info "$darwin_archive" 2>/dev/null | $GREP Architectures 2>/dev/null || true` - if test -n "$darwin_arches"; then - darwin_arches=`$ECHO "$darwin_arches" | $SED -e 's/.*are://'` - darwin_arch= - func_verbose "$darwin_base_archive has multiple architectures $darwin_arches" - for darwin_arch in $darwin_arches; do - func_mkdir_p "unfat-$$/$darwin_base_archive-$darwin_arch" - $LIPO -thin $darwin_arch -output "unfat-$$/$darwin_base_archive-$darwin_arch/$darwin_base_archive" "$darwin_archive" - cd "unfat-$$/$darwin_base_archive-$darwin_arch" - func_extract_an_archive "`pwd`" "$darwin_base_archive" - cd "$darwin_curdir" - $RM "unfat-$$/$darwin_base_archive-$darwin_arch/$darwin_base_archive" - done # $darwin_arches - ## Okay now we've a bunch of thin objects, gotta fatten them up :) - darwin_filelist=`find unfat-$$ -type f -name \*.o -print -o -name \*.lo -print | $SED -e "$sed_basename" | sort -u` - darwin_file= - darwin_files= - for darwin_file in $darwin_filelist; do - darwin_files=`find unfat-$$ -name $darwin_file -print | sort | $NL2SP` - $LIPO -create -output "$darwin_file" $darwin_files - done # $darwin_filelist - $RM -rf unfat-$$ - cd "$darwin_orig_dir" - else - cd $darwin_orig_dir - func_extract_an_archive "$my_xdir" "$my_xabs" - fi # $darwin_arches - } # !$opt_dry_run - ;; - *) - func_extract_an_archive "$my_xdir" "$my_xabs" - ;; - esac - my_oldobjs="$my_oldobjs "`find $my_xdir -name \*.$objext -print -o -name \*.lo -print | sort | $NL2SP` - done - - func_extract_archives_result=$my_oldobjs -} - - -# func_emit_wrapper [arg=no] -# -# Emit a libtool wrapper script on stdout. -# Don't directly open a file because we may want to -# incorporate the script contents within a cygwin/mingw -# wrapper executable. Must ONLY be called from within -# func_mode_link because it depends on a number of variables -# set therein. -# -# ARG is the value that the WRAPPER_SCRIPT_BELONGS_IN_OBJDIR -# variable will take. If 'yes', then the emitted script -# will assume that the directory where it is stored is -# the $objdir directory. This is a cygwin/mingw-specific -# behavior. -func_emit_wrapper () -{ - func_emit_wrapper_arg1=${1-no} - - $ECHO "\ -#! $SHELL - -# $output - temporary wrapper script for $objdir/$outputname -# Generated by $PROGRAM (GNU $PACKAGE) $VERSION -# -# The $output program cannot be directly executed until all the libtool -# libraries that it depends on are installed. -# -# This wrapper script should never be moved out of the build directory. -# If it is, it will not operate correctly. - -# Sed substitution that helps us do robust quoting. It backslashifies -# metacharacters that are still active within double-quoted strings. -sed_quote_subst='$sed_quote_subst' - -# Be Bourne compatible -if test -n \"\${ZSH_VERSION+set}\" && (emulate sh) >/dev/null 2>&1; then - emulate sh - NULLCMD=: - # Zsh 3.x and 4.x performs word splitting on \${1+\"\$@\"}, which - # is contrary to our usage. Disable this feature. - alias -g '\${1+\"\$@\"}'='\"\$@\"' - setopt NO_GLOB_SUBST -else - case \`(set -o) 2>/dev/null\` in *posix*) set -o posix;; esac -fi -BIN_SH=xpg4; export BIN_SH # for Tru64 -DUALCASE=1; export DUALCASE # for MKS sh - -# The HP-UX ksh and POSIX shell print the target directory to stdout -# if CDPATH is set. -(unset CDPATH) >/dev/null 2>&1 && unset CDPATH - -relink_command=\"$relink_command\" - -# This environment variable determines our operation mode. -if test \"\$libtool_install_magic\" = \"$magic\"; then - # install mode needs the following variables: - generated_by_libtool_version='$macro_version' - notinst_deplibs='$notinst_deplibs' -else - # When we are sourced in execute mode, \$file and \$ECHO are already set. - if test \"\$libtool_execute_magic\" != \"$magic\"; then - file=\"\$0\"" - - qECHO=`$ECHO "$ECHO" | $SED "$sed_quote_subst"` - $ECHO "\ - -# A function that is used when there is no print builtin or printf. -func_fallback_echo () -{ - eval 'cat <<_LTECHO_EOF -\$1 -_LTECHO_EOF' -} - ECHO=\"$qECHO\" - fi - -# Very basic option parsing. These options are (a) specific to -# the libtool wrapper, (b) are identical between the wrapper -# /script/ and the wrapper /executable/ that is used only on -# windows platforms, and (c) all begin with the string "--lt-" -# (application programs are unlikely to have options that match -# this pattern). -# -# There are only two supported options: --lt-debug and -# --lt-dump-script. There is, deliberately, no --lt-help. -# -# The first argument to this parsing function should be the -# script's $0 value, followed by "$@". -lt_option_debug= -func_parse_lt_options () -{ - lt_script_arg0=\$0 - shift - for lt_opt - do - case \"\$lt_opt\" in - --lt-debug) lt_option_debug=1 ;; - --lt-dump-script) - lt_dump_D=\`\$ECHO \"X\$lt_script_arg0\" | $SED -e 's/^X//' -e 's%/[^/]*$%%'\` - test \"X\$lt_dump_D\" = \"X\$lt_script_arg0\" && lt_dump_D=. - lt_dump_F=\`\$ECHO \"X\$lt_script_arg0\" | $SED -e 's/^X//' -e 's%^.*/%%'\` - cat \"\$lt_dump_D/\$lt_dump_F\" - exit 0 - ;; - --lt-*) - \$ECHO \"Unrecognized --lt- option: '\$lt_opt'\" 1>&2 - exit 1 - ;; - esac - done - - # Print the debug banner immediately: - if test -n \"\$lt_option_debug\"; then - echo \"$outputname:$output:\$LINENO: libtool wrapper (GNU $PACKAGE) $VERSION\" 1>&2 - fi -} - -# Used when --lt-debug. Prints its arguments to stdout -# (redirection is the responsibility of the caller) -func_lt_dump_args () -{ - lt_dump_args_N=1; - for lt_arg - do - \$ECHO \"$outputname:$output:\$LINENO: newargv[\$lt_dump_args_N]: \$lt_arg\" - lt_dump_args_N=\`expr \$lt_dump_args_N + 1\` - done -} - -# Core function for launching the target application -func_exec_program_core () -{ -" - case $host in - # Backslashes separate directories on plain windows - *-*-mingw | *-*-os2* | *-cegcc*) - $ECHO "\ - if test -n \"\$lt_option_debug\"; then - \$ECHO \"$outputname:$output:\$LINENO: newargv[0]: \$progdir\\\\\$program\" 1>&2 - func_lt_dump_args \${1+\"\$@\"} 1>&2 - fi - exec \"\$progdir\\\\\$program\" \${1+\"\$@\"} -" - ;; - - *) - $ECHO "\ - if test -n \"\$lt_option_debug\"; then - \$ECHO \"$outputname:$output:\$LINENO: newargv[0]: \$progdir/\$program\" 1>&2 - func_lt_dump_args \${1+\"\$@\"} 1>&2 - fi - exec \"\$progdir/\$program\" \${1+\"\$@\"} -" - ;; - esac - $ECHO "\ - \$ECHO \"\$0: cannot exec \$program \$*\" 1>&2 - exit 1 -} - -# A function to encapsulate launching the target application -# Strips options in the --lt-* namespace from \$@ and -# launches target application with the remaining arguments. -func_exec_program () -{ - case \" \$* \" in - *\\ --lt-*) - for lt_wr_arg - do - case \$lt_wr_arg in - --lt-*) ;; - *) set x \"\$@\" \"\$lt_wr_arg\"; shift;; - esac - shift - done ;; - esac - func_exec_program_core \${1+\"\$@\"} -} - - # Parse options - func_parse_lt_options \"\$0\" \${1+\"\$@\"} - - # Find the directory that this script lives in. - thisdir=\`\$ECHO \"\$file\" | $SED 's%/[^/]*$%%'\` - test \"x\$thisdir\" = \"x\$file\" && thisdir=. - - # Follow symbolic links until we get to the real thisdir. - file=\`ls -ld \"\$file\" | $SED -n 's/.*-> //p'\` - while test -n \"\$file\"; do - destdir=\`\$ECHO \"\$file\" | $SED 's%/[^/]*\$%%'\` - - # If there was a directory component, then change thisdir. - if test \"x\$destdir\" != \"x\$file\"; then - case \"\$destdir\" in - [\\\\/]* | [A-Za-z]:[\\\\/]*) thisdir=\"\$destdir\" ;; - *) thisdir=\"\$thisdir/\$destdir\" ;; - esac - fi - - file=\`\$ECHO \"\$file\" | $SED 's%^.*/%%'\` - file=\`ls -ld \"\$thisdir/\$file\" | $SED -n 's/.*-> //p'\` - done - - # Usually 'no', except on cygwin/mingw when embedded into - # the cwrapper. - WRAPPER_SCRIPT_BELONGS_IN_OBJDIR=$func_emit_wrapper_arg1 - if test \"\$WRAPPER_SCRIPT_BELONGS_IN_OBJDIR\" = \"yes\"; then - # special case for '.' - if test \"\$thisdir\" = \".\"; then - thisdir=\`pwd\` - fi - # remove .libs from thisdir - case \"\$thisdir\" in - *[\\\\/]$objdir ) thisdir=\`\$ECHO \"\$thisdir\" | $SED 's%[\\\\/][^\\\\/]*$%%'\` ;; - $objdir ) thisdir=. ;; - esac - fi - - # Try to get the absolute directory name. - absdir=\`cd \"\$thisdir\" && pwd\` - test -n \"\$absdir\" && thisdir=\"\$absdir\" -" - - if test yes = "$fast_install"; then - $ECHO "\ - program=lt-'$outputname'$exeext - progdir=\"\$thisdir/$objdir\" - - if test ! -f \"\$progdir/\$program\" || - { file=\`ls -1dt \"\$progdir/\$program\" \"\$progdir/../\$program\" 2>/dev/null | $SED 1q\`; \\ - test \"X\$file\" != \"X\$progdir/\$program\"; }; then - - file=\"\$\$-\$program\" - - if test ! -d \"\$progdir\"; then - $MKDIR \"\$progdir\" - else - $RM \"\$progdir/\$file\" - fi" - - $ECHO "\ - - # relink executable if necessary - if test -n \"\$relink_command\"; then - if relink_command_output=\`eval \$relink_command 2>&1\`; then : - else - \$ECHO \"\$relink_command_output\" >&2 - $RM \"\$progdir/\$file\" - exit 1 - fi - fi - - $MV \"\$progdir/\$file\" \"\$progdir/\$program\" 2>/dev/null || - { $RM \"\$progdir/\$program\"; - $MV \"\$progdir/\$file\" \"\$progdir/\$program\"; } - $RM \"\$progdir/\$file\" - fi" - else - $ECHO "\ - program='$outputname' - progdir=\"\$thisdir/$objdir\" -" - fi - - $ECHO "\ - - if test -f \"\$progdir/\$program\"; then" - - # fixup the dll searchpath if we need to. - # - # Fix the DLL searchpath if we need to. Do this before prepending - # to shlibpath, because on Windows, both are PATH and uninstalled - # libraries must come first. - if test -n "$dllsearchpath"; then - $ECHO "\ - # Add the dll search path components to the executable PATH - PATH=$dllsearchpath:\$PATH -" - fi - - # Export our shlibpath_var if we have one. - if test yes = "$shlibpath_overrides_runpath" && test -n "$shlibpath_var" && test -n "$temp_rpath"; then - $ECHO "\ - # Add our own library path to $shlibpath_var - $shlibpath_var=\"$temp_rpath\$$shlibpath_var\" - - # Some systems cannot cope with colon-terminated $shlibpath_var - # The second colon is a workaround for a bug in BeOS R4 sed - $shlibpath_var=\`\$ECHO \"\$$shlibpath_var\" | $SED 's/::*\$//'\` - - export $shlibpath_var -" - fi - - $ECHO "\ - if test \"\$libtool_execute_magic\" != \"$magic\"; then - # Run the actual program with our arguments. - func_exec_program \${1+\"\$@\"} - fi - else - # The program doesn't exist. - \$ECHO \"\$0: error: '\$progdir/\$program' does not exist\" 1>&2 - \$ECHO \"This script is just a wrapper for \$program.\" 1>&2 - \$ECHO \"See the $PACKAGE documentation for more information.\" 1>&2 - exit 1 - fi -fi\ -" -} - - -# func_emit_cwrapperexe_src -# emit the source code for a wrapper executable on stdout -# Must ONLY be called from within func_mode_link because -# it depends on a number of variable set therein. -func_emit_cwrapperexe_src () -{ - cat < -#include -#ifdef _MSC_VER -# include -# include -# include -#else -# include -# include -# ifdef __CYGWIN__ -# include -# endif -#endif -#include -#include -#include -#include -#include -#include -#include -#include - -#define STREQ(s1, s2) (strcmp ((s1), (s2)) == 0) - -/* declarations of non-ANSI functions */ -#if defined __MINGW32__ -# ifdef __STRICT_ANSI__ -int _putenv (const char *); -# endif -#elif defined __CYGWIN__ -# ifdef __STRICT_ANSI__ -char *realpath (const char *, char *); -int putenv (char *); -int setenv (const char *, const char *, int); -# endif -/* #elif defined other_platform || defined ... */ -#endif - -/* portability defines, excluding path handling macros */ -#if defined _MSC_VER -# define setmode _setmode -# define stat _stat -# define chmod _chmod -# define getcwd _getcwd -# define putenv _putenv -# define S_IXUSR _S_IEXEC -#elif defined __MINGW32__ -# define setmode _setmode -# define stat _stat -# define chmod _chmod -# define getcwd _getcwd -# define putenv _putenv -#elif defined __CYGWIN__ -# define HAVE_SETENV -# define FOPEN_WB "wb" -/* #elif defined other platforms ... */ -#endif - -#if defined PATH_MAX -# define LT_PATHMAX PATH_MAX -#elif defined MAXPATHLEN -# define LT_PATHMAX MAXPATHLEN -#else -# define LT_PATHMAX 1024 -#endif - -#ifndef S_IXOTH -# define S_IXOTH 0 -#endif -#ifndef S_IXGRP -# define S_IXGRP 0 -#endif - -/* path handling portability macros */ -#ifndef DIR_SEPARATOR -# define DIR_SEPARATOR '/' -# define PATH_SEPARATOR ':' -#endif - -#if defined _WIN32 || defined __MSDOS__ || defined __DJGPP__ || \ - defined __OS2__ -# define HAVE_DOS_BASED_FILE_SYSTEM -# define FOPEN_WB "wb" -# ifndef DIR_SEPARATOR_2 -# define DIR_SEPARATOR_2 '\\' -# endif -# ifndef PATH_SEPARATOR_2 -# define PATH_SEPARATOR_2 ';' -# endif -#endif - -#ifndef DIR_SEPARATOR_2 -# define IS_DIR_SEPARATOR(ch) ((ch) == DIR_SEPARATOR) -#else /* DIR_SEPARATOR_2 */ -# define IS_DIR_SEPARATOR(ch) \ - (((ch) == DIR_SEPARATOR) || ((ch) == DIR_SEPARATOR_2)) -#endif /* DIR_SEPARATOR_2 */ - -#ifndef PATH_SEPARATOR_2 -# define IS_PATH_SEPARATOR(ch) ((ch) == PATH_SEPARATOR) -#else /* PATH_SEPARATOR_2 */ -# define IS_PATH_SEPARATOR(ch) ((ch) == PATH_SEPARATOR_2) -#endif /* PATH_SEPARATOR_2 */ - -#ifndef FOPEN_WB -# define FOPEN_WB "w" -#endif -#ifndef _O_BINARY -# define _O_BINARY 0 -#endif - -#define XMALLOC(type, num) ((type *) xmalloc ((num) * sizeof(type))) -#define XFREE(stale) do { \ - if (stale) { free (stale); stale = 0; } \ -} while (0) - -#if defined LT_DEBUGWRAPPER -static int lt_debug = 1; -#else -static int lt_debug = 0; -#endif - -const char *program_name = "libtool-wrapper"; /* in case xstrdup fails */ - -void *xmalloc (size_t num); -char *xstrdup (const char *string); -const char *base_name (const char *name); -char *find_executable (const char *wrapper); -char *chase_symlinks (const char *pathspec); -int make_executable (const char *path); -int check_executable (const char *path); -char *strendzap (char *str, const char *pat); -void lt_debugprintf (const char *file, int line, const char *fmt, ...); -void lt_fatal (const char *file, int line, const char *message, ...); -static const char *nonnull (const char *s); -static const char *nonempty (const char *s); -void lt_setenv (const char *name, const char *value); -char *lt_extend_str (const char *orig_value, const char *add, int to_end); -void lt_update_exe_path (const char *name, const char *value); -void lt_update_lib_path (const char *name, const char *value); -char **prepare_spawn (char **argv); -void lt_dump_script (FILE *f); -EOF - - cat <= 0) - && (st.st_mode & (S_IXUSR | S_IXGRP | S_IXOTH))) - return 1; - else - return 0; -} - -int -make_executable (const char *path) -{ - int rval = 0; - struct stat st; - - lt_debugprintf (__FILE__, __LINE__, "(make_executable): %s\n", - nonempty (path)); - if ((!path) || (!*path)) - return 0; - - if (stat (path, &st) >= 0) - { - rval = chmod (path, st.st_mode | S_IXOTH | S_IXGRP | S_IXUSR); - } - return rval; -} - -/* Searches for the full path of the wrapper. Returns - newly allocated full path name if found, NULL otherwise - Does not chase symlinks, even on platforms that support them. -*/ -char * -find_executable (const char *wrapper) -{ - int has_slash = 0; - const char *p; - const char *p_next; - /* static buffer for getcwd */ - char tmp[LT_PATHMAX + 1]; - size_t tmp_len; - char *concat_name; - - lt_debugprintf (__FILE__, __LINE__, "(find_executable): %s\n", - nonempty (wrapper)); - - if ((wrapper == NULL) || (*wrapper == '\0')) - return NULL; - - /* Absolute path? */ -#if defined HAVE_DOS_BASED_FILE_SYSTEM - if (isalpha ((unsigned char) wrapper[0]) && wrapper[1] == ':') - { - concat_name = xstrdup (wrapper); - if (check_executable (concat_name)) - return concat_name; - XFREE (concat_name); - } - else - { -#endif - if (IS_DIR_SEPARATOR (wrapper[0])) - { - concat_name = xstrdup (wrapper); - if (check_executable (concat_name)) - return concat_name; - XFREE (concat_name); - } -#if defined HAVE_DOS_BASED_FILE_SYSTEM - } -#endif - - for (p = wrapper; *p; p++) - if (*p == '/') - { - has_slash = 1; - break; - } - if (!has_slash) - { - /* no slashes; search PATH */ - const char *path = getenv ("PATH"); - if (path != NULL) - { - for (p = path; *p; p = p_next) - { - const char *q; - size_t p_len; - for (q = p; *q; q++) - if (IS_PATH_SEPARATOR (*q)) - break; - p_len = (size_t) (q - p); - p_next = (*q == '\0' ? q : q + 1); - if (p_len == 0) - { - /* empty path: current directory */ - if (getcwd (tmp, LT_PATHMAX) == NULL) - lt_fatal (__FILE__, __LINE__, "getcwd failed: %s", - nonnull (strerror (errno))); - tmp_len = strlen (tmp); - concat_name = - XMALLOC (char, tmp_len + 1 + strlen (wrapper) + 1); - memcpy (concat_name, tmp, tmp_len); - concat_name[tmp_len] = '/'; - strcpy (concat_name + tmp_len + 1, wrapper); - } - else - { - concat_name = - XMALLOC (char, p_len + 1 + strlen (wrapper) + 1); - memcpy (concat_name, p, p_len); - concat_name[p_len] = '/'; - strcpy (concat_name + p_len + 1, wrapper); - } - if (check_executable (concat_name)) - return concat_name; - XFREE (concat_name); - } - } - /* not found in PATH; assume curdir */ - } - /* Relative path | not found in path: prepend cwd */ - if (getcwd (tmp, LT_PATHMAX) == NULL) - lt_fatal (__FILE__, __LINE__, "getcwd failed: %s", - nonnull (strerror (errno))); - tmp_len = strlen (tmp); - concat_name = XMALLOC (char, tmp_len + 1 + strlen (wrapper) + 1); - memcpy (concat_name, tmp, tmp_len); - concat_name[tmp_len] = '/'; - strcpy (concat_name + tmp_len + 1, wrapper); - - if (check_executable (concat_name)) - return concat_name; - XFREE (concat_name); - return NULL; -} - -char * -chase_symlinks (const char *pathspec) -{ -#ifndef S_ISLNK - return xstrdup (pathspec); -#else - char buf[LT_PATHMAX]; - struct stat s; - char *tmp_pathspec = xstrdup (pathspec); - char *p; - int has_symlinks = 0; - while (strlen (tmp_pathspec) && !has_symlinks) - { - lt_debugprintf (__FILE__, __LINE__, - "checking path component for symlinks: %s\n", - tmp_pathspec); - if (lstat (tmp_pathspec, &s) == 0) - { - if (S_ISLNK (s.st_mode) != 0) - { - has_symlinks = 1; - break; - } - - /* search backwards for last DIR_SEPARATOR */ - p = tmp_pathspec + strlen (tmp_pathspec) - 1; - while ((p > tmp_pathspec) && (!IS_DIR_SEPARATOR (*p))) - p--; - if ((p == tmp_pathspec) && (!IS_DIR_SEPARATOR (*p))) - { - /* no more DIR_SEPARATORS left */ - break; - } - *p = '\0'; - } - else - { - lt_fatal (__FILE__, __LINE__, - "error accessing file \"%s\": %s", - tmp_pathspec, nonnull (strerror (errno))); - } - } - XFREE (tmp_pathspec); - - if (!has_symlinks) - { - return xstrdup (pathspec); - } - - tmp_pathspec = realpath (pathspec, buf); - if (tmp_pathspec == 0) - { - lt_fatal (__FILE__, __LINE__, - "could not follow symlinks for %s", pathspec); - } - return xstrdup (tmp_pathspec); -#endif -} - -char * -strendzap (char *str, const char *pat) -{ - size_t len, patlen; - - assert (str != NULL); - assert (pat != NULL); - - len = strlen (str); - patlen = strlen (pat); - - if (patlen <= len) - { - str += len - patlen; - if (STREQ (str, pat)) - *str = '\0'; - } - return str; -} - -void -lt_debugprintf (const char *file, int line, const char *fmt, ...) -{ - va_list args; - if (lt_debug) - { - (void) fprintf (stderr, "%s:%s:%d: ", program_name, file, line); - va_start (args, fmt); - (void) vfprintf (stderr, fmt, args); - va_end (args); - } -} - -static void -lt_error_core (int exit_status, const char *file, - int line, const char *mode, - const char *message, va_list ap) -{ - fprintf (stderr, "%s:%s:%d: %s: ", program_name, file, line, mode); - vfprintf (stderr, message, ap); - fprintf (stderr, ".\n"); - - if (exit_status >= 0) - exit (exit_status); -} - -void -lt_fatal (const char *file, int line, const char *message, ...) -{ - va_list ap; - va_start (ap, message); - lt_error_core (EXIT_FAILURE, file, line, "FATAL", message, ap); - va_end (ap); -} - -static const char * -nonnull (const char *s) -{ - return s ? s : "(null)"; -} - -static const char * -nonempty (const char *s) -{ - return (s && !*s) ? "(empty)" : nonnull (s); -} - -void -lt_setenv (const char *name, const char *value) -{ - lt_debugprintf (__FILE__, __LINE__, - "(lt_setenv) setting '%s' to '%s'\n", - nonnull (name), nonnull (value)); - { -#ifdef HAVE_SETENV - /* always make a copy, for consistency with !HAVE_SETENV */ - char *str = xstrdup (value); - setenv (name, str, 1); -#else - size_t len = strlen (name) + 1 + strlen (value) + 1; - char *str = XMALLOC (char, len); - sprintf (str, "%s=%s", name, value); - if (putenv (str) != EXIT_SUCCESS) - { - XFREE (str); - } -#endif - } -} - -char * -lt_extend_str (const char *orig_value, const char *add, int to_end) -{ - char *new_value; - if (orig_value && *orig_value) - { - size_t orig_value_len = strlen (orig_value); - size_t add_len = strlen (add); - new_value = XMALLOC (char, add_len + orig_value_len + 1); - if (to_end) - { - strcpy (new_value, orig_value); - strcpy (new_value + orig_value_len, add); - } - else - { - strcpy (new_value, add); - strcpy (new_value + add_len, orig_value); - } - } - else - { - new_value = xstrdup (add); - } - return new_value; -} - -void -lt_update_exe_path (const char *name, const char *value) -{ - lt_debugprintf (__FILE__, __LINE__, - "(lt_update_exe_path) modifying '%s' by prepending '%s'\n", - nonnull (name), nonnull (value)); - - if (name && *name && value && *value) - { - char *new_value = lt_extend_str (getenv (name), value, 0); - /* some systems can't cope with a ':'-terminated path #' */ - size_t len = strlen (new_value); - while ((len > 0) && IS_PATH_SEPARATOR (new_value[len-1])) - { - new_value[--len] = '\0'; - } - lt_setenv (name, new_value); - XFREE (new_value); - } -} - -void -lt_update_lib_path (const char *name, const char *value) -{ - lt_debugprintf (__FILE__, __LINE__, - "(lt_update_lib_path) modifying '%s' by prepending '%s'\n", - nonnull (name), nonnull (value)); - - if (name && *name && value && *value) - { - char *new_value = lt_extend_str (getenv (name), value, 0); - lt_setenv (name, new_value); - XFREE (new_value); - } -} - -EOF - case $host_os in - mingw*) - cat <<"EOF" - -/* Prepares an argument vector before calling spawn(). - Note that spawn() does not by itself call the command interpreter - (getenv ("COMSPEC") != NULL ? getenv ("COMSPEC") : - ({ OSVERSIONINFO v; v.dwOSVersionInfoSize = sizeof(OSVERSIONINFO); - GetVersionEx(&v); - v.dwPlatformId == VER_PLATFORM_WIN32_NT; - }) ? "cmd.exe" : "command.com"). - Instead it simply concatenates the arguments, separated by ' ', and calls - CreateProcess(). We must quote the arguments since Win32 CreateProcess() - interprets characters like ' ', '\t', '\\', '"' (but not '<' and '>') in a - special way: - - Space and tab are interpreted as delimiters. They are not treated as - delimiters if they are surrounded by double quotes: "...". - - Unescaped double quotes are removed from the input. Their only effect is - that within double quotes, space and tab are treated like normal - characters. - - Backslashes not followed by double quotes are not special. - - But 2*n+1 backslashes followed by a double quote become - n backslashes followed by a double quote (n >= 0): - \" -> " - \\\" -> \" - \\\\\" -> \\" - */ -#define SHELL_SPECIAL_CHARS "\"\\ \001\002\003\004\005\006\007\010\011\012\013\014\015\016\017\020\021\022\023\024\025\026\027\030\031\032\033\034\035\036\037" -#define SHELL_SPACE_CHARS " \001\002\003\004\005\006\007\010\011\012\013\014\015\016\017\020\021\022\023\024\025\026\027\030\031\032\033\034\035\036\037" -char ** -prepare_spawn (char **argv) -{ - size_t argc; - char **new_argv; - size_t i; - - /* Count number of arguments. */ - for (argc = 0; argv[argc] != NULL; argc++) - ; - - /* Allocate new argument vector. */ - new_argv = XMALLOC (char *, argc + 1); - - /* Put quoted arguments into the new argument vector. */ - for (i = 0; i < argc; i++) - { - const char *string = argv[i]; - - if (string[0] == '\0') - new_argv[i] = xstrdup ("\"\""); - else if (strpbrk (string, SHELL_SPECIAL_CHARS) != NULL) - { - int quote_around = (strpbrk (string, SHELL_SPACE_CHARS) != NULL); - size_t length; - unsigned int backslashes; - const char *s; - char *quoted_string; - char *p; - - length = 0; - backslashes = 0; - if (quote_around) - length++; - for (s = string; *s != '\0'; s++) - { - char c = *s; - if (c == '"') - length += backslashes + 1; - length++; - if (c == '\\') - backslashes++; - else - backslashes = 0; - } - if (quote_around) - length += backslashes + 1; - - quoted_string = XMALLOC (char, length + 1); - - p = quoted_string; - backslashes = 0; - if (quote_around) - *p++ = '"'; - for (s = string; *s != '\0'; s++) - { - char c = *s; - if (c == '"') - { - unsigned int j; - for (j = backslashes + 1; j > 0; j--) - *p++ = '\\'; - } - *p++ = c; - if (c == '\\') - backslashes++; - else - backslashes = 0; - } - if (quote_around) - { - unsigned int j; - for (j = backslashes; j > 0; j--) - *p++ = '\\'; - *p++ = '"'; - } - *p = '\0'; - - new_argv[i] = quoted_string; - } - else - new_argv[i] = (char *) string; - } - new_argv[argc] = NULL; - - return new_argv; -} -EOF - ;; - esac - - cat <<"EOF" -void lt_dump_script (FILE* f) -{ -EOF - func_emit_wrapper yes | - $SED -n -e ' -s/^\(.\{79\}\)\(..*\)/\1\ -\2/ -h -s/\([\\"]\)/\\\1/g -s/$/\\n/ -s/\([^\n]*\).*/ fputs ("\1", f);/p -g -D' - cat <<"EOF" -} -EOF -} -# end: func_emit_cwrapperexe_src - -# func_win32_import_lib_p ARG -# True if ARG is an import lib, as indicated by $file_magic_cmd -func_win32_import_lib_p () -{ - $debug_cmd - - case `eval $file_magic_cmd \"\$1\" 2>/dev/null | $SED -e 10q` in - *import*) : ;; - *) false ;; - esac -} - -# func_suncc_cstd_abi -# !!ONLY CALL THIS FOR SUN CC AFTER $compile_command IS FULLY EXPANDED!! -# Several compiler flags select an ABI that is incompatible with the -# Cstd library. Avoid specifying it if any are in CXXFLAGS. -func_suncc_cstd_abi () -{ - $debug_cmd - - case " $compile_command " in - *" -compat=g "*|*\ -std=c++[0-9][0-9]\ *|*" -library=stdcxx4 "*|*" -library=stlport4 "*) - suncc_use_cstd_abi=no - ;; - *) - suncc_use_cstd_abi=yes - ;; - esac -} - -# func_mode_link arg... -func_mode_link () -{ - $debug_cmd - - case $host in - *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-cegcc*) - # It is impossible to link a dll without this setting, and - # we shouldn't force the makefile maintainer to figure out - # what system we are compiling for in order to pass an extra - # flag for every libtool invocation. - # allow_undefined=no - - # FIXME: Unfortunately, there are problems with the above when trying - # to make a dll that has undefined symbols, in which case not - # even a static library is built. For now, we need to specify - # -no-undefined on the libtool link line when we can be certain - # that all symbols are satisfied, otherwise we get a static library. - allow_undefined=yes - ;; - *) - allow_undefined=yes - ;; - esac - libtool_args=$nonopt - base_compile="$nonopt $@" - compile_command=$nonopt - finalize_command=$nonopt - - compile_rpath= - finalize_rpath= - compile_shlibpath= - finalize_shlibpath= - convenience= - old_convenience= - deplibs= - old_deplibs= - compiler_flags= - linker_flags= - dllsearchpath= - lib_search_path=`pwd` - inst_prefix_dir= - new_inherited_linker_flags= - - avoid_version=no - bindir= - dlfiles= - dlprefiles= - dlself=no - export_dynamic=no - export_symbols= - export_symbols_regex= - generated= - libobjs= - ltlibs= - module=no - no_install=no - objs= - os2dllname= - non_pic_objects= - precious_files_regex= - prefer_static_libs=no - preload=false - prev= - prevarg= - release= - rpath= - xrpath= - perm_rpath= - temp_rpath= - thread_safe=no - vinfo= - vinfo_number=no - weak_libs= - single_module=$wl-single_module - func_infer_tag $base_compile - - # We need to know -static, to get the right output filenames. - for arg - do - case $arg in - -shared) - test yes != "$build_libtool_libs" \ - && func_fatal_configuration "cannot build a shared library" - build_old_libs=no - break - ;; - -all-static | -static | -static-libtool-libs) - case $arg in - -all-static) - if test yes = "$build_libtool_libs" && test -z "$link_static_flag"; then - func_warning "complete static linking is impossible in this configuration" - fi - if test -n "$link_static_flag"; then - dlopen_self=$dlopen_self_static - fi - prefer_static_libs=yes - ;; - -static) - if test -z "$pic_flag" && test -n "$link_static_flag"; then - dlopen_self=$dlopen_self_static - fi - prefer_static_libs=built - ;; - -static-libtool-libs) - if test -z "$pic_flag" && test -n "$link_static_flag"; then - dlopen_self=$dlopen_self_static - fi - prefer_static_libs=yes - ;; - esac - build_libtool_libs=no - build_old_libs=yes - break - ;; - esac - done - - # See if our shared archives depend on static archives. - test -n "$old_archive_from_new_cmds" && build_old_libs=yes - - # Go through the arguments, transforming them on the way. - while test "$#" -gt 0; do - arg=$1 - shift - func_quote_for_eval "$arg" - qarg=$func_quote_for_eval_unquoted_result - func_append libtool_args " $func_quote_for_eval_result" - - # If the previous option needs an argument, assign it. - if test -n "$prev"; then - case $prev in - output) - func_append compile_command " @OUTPUT@" - func_append finalize_command " @OUTPUT@" - ;; - esac - - case $prev in - bindir) - bindir=$arg - prev= - continue - ;; - dlfiles|dlprefiles) - $preload || { - # Add the symbol object into the linking commands. - func_append compile_command " @SYMFILE@" - func_append finalize_command " @SYMFILE@" - preload=: - } - case $arg in - *.la | *.lo) ;; # We handle these cases below. - force) - if test no = "$dlself"; then - dlself=needless - export_dynamic=yes - fi - prev= - continue - ;; - self) - if test dlprefiles = "$prev"; then - dlself=yes - elif test dlfiles = "$prev" && test yes != "$dlopen_self"; then - dlself=yes - else - dlself=needless - export_dynamic=yes - fi - prev= - continue - ;; - *) - if test dlfiles = "$prev"; then - func_append dlfiles " $arg" - else - func_append dlprefiles " $arg" - fi - prev= - continue - ;; - esac - ;; - expsyms) - export_symbols=$arg - test -f "$arg" \ - || func_fatal_error "symbol file '$arg' does not exist" - prev= - continue - ;; - expsyms_regex) - export_symbols_regex=$arg - prev= - continue - ;; - framework) - case $host in - *-*-darwin*) - case "$deplibs " in - *" $qarg.ltframework "*) ;; - *) func_append deplibs " $qarg.ltframework" # this is fixed later - ;; - esac - ;; - esac - prev= - continue - ;; - inst_prefix) - inst_prefix_dir=$arg - prev= - continue - ;; - mllvm) - # Clang does not use LLVM to link, so we can simply discard any - # '-mllvm $arg' options when doing the link step. - prev= - continue - ;; - objectlist) - if test -f "$arg"; then - save_arg=$arg - moreargs= - for fil in `cat "$save_arg"` - do -# func_append moreargs " $fil" - arg=$fil - # A libtool-controlled object. - - # Check to see that this really is a libtool object. - if func_lalib_unsafe_p "$arg"; then - pic_object= - non_pic_object= - - # Read the .lo file - func_source "$arg" - - if test -z "$pic_object" || - test -z "$non_pic_object" || - test none = "$pic_object" && - test none = "$non_pic_object"; then - func_fatal_error "cannot find name of object for '$arg'" - fi - - # Extract subdirectory from the argument. - func_dirname "$arg" "/" "" - xdir=$func_dirname_result - - if test none != "$pic_object"; then - # Prepend the subdirectory the object is found in. - pic_object=$xdir$pic_object - - if test dlfiles = "$prev"; then - if test yes = "$build_libtool_libs" && test yes = "$dlopen_support"; then - func_append dlfiles " $pic_object" - prev= - continue - else - # If libtool objects are unsupported, then we need to preload. - prev=dlprefiles - fi - fi - - # CHECK ME: I think I busted this. -Ossama - if test dlprefiles = "$prev"; then - # Preload the old-style object. - func_append dlprefiles " $pic_object" - prev= - fi - - # A PIC object. - func_append libobjs " $pic_object" - arg=$pic_object - fi - - # Non-PIC object. - if test none != "$non_pic_object"; then - # Prepend the subdirectory the object is found in. - non_pic_object=$xdir$non_pic_object - - # A standard non-PIC object - func_append non_pic_objects " $non_pic_object" - if test -z "$pic_object" || test none = "$pic_object"; then - arg=$non_pic_object - fi - else - # If the PIC object exists, use it instead. - # $xdir was prepended to $pic_object above. - non_pic_object=$pic_object - func_append non_pic_objects " $non_pic_object" - fi - else - # Only an error if not doing a dry-run. - if $opt_dry_run; then - # Extract subdirectory from the argument. - func_dirname "$arg" "/" "" - xdir=$func_dirname_result - - func_lo2o "$arg" - pic_object=$xdir$objdir/$func_lo2o_result - non_pic_object=$xdir$func_lo2o_result - func_append libobjs " $pic_object" - func_append non_pic_objects " $non_pic_object" - else - func_fatal_error "'$arg' is not a valid libtool object" - fi - fi - done - else - func_fatal_error "link input file '$arg' does not exist" - fi - arg=$save_arg - prev= - continue - ;; - os2dllname) - os2dllname=$arg - prev= - continue - ;; - precious_regex) - precious_files_regex=$arg - prev= - continue - ;; - release) - release=-$arg - prev= - continue - ;; - rpath | xrpath) - # We need an absolute path. - case $arg in - [\\/]* | [A-Za-z]:[\\/]*) ;; - *) - func_fatal_error "only absolute run-paths are allowed" - ;; - esac - if test rpath = "$prev"; then - case "$rpath " in - *" $arg "*) ;; - *) func_append rpath " $arg" ;; - esac - else - case "$xrpath " in - *" $arg "*) ;; - *) func_append xrpath " $arg" ;; - esac - fi - prev= - continue - ;; - shrext) - shrext_cmds=$arg - prev= - continue - ;; - weak) - func_append weak_libs " $arg" - prev= - continue - ;; - xcclinker) - func_append linker_flags " $qarg" - func_append compiler_flags " $qarg" - prev= - func_append compile_command " $qarg" - func_append finalize_command " $qarg" - continue - ;; - xcompiler) - func_append compiler_flags " $qarg" - prev= - func_append compile_command " $qarg" - func_append finalize_command " $qarg" - continue - ;; - xlinker) - func_append linker_flags " $qarg" - func_append compiler_flags " $wl$qarg" - prev= - func_append compile_command " $wl$qarg" - func_append finalize_command " $wl$qarg" - continue - ;; - *) - eval "$prev=\"\$arg\"" - prev= - continue - ;; - esac - fi # test -n "$prev" - - prevarg=$arg - - case $arg in - -all-static) - if test -n "$link_static_flag"; then - # See comment for -static flag below, for more details. - func_append compile_command " $link_static_flag" - func_append finalize_command " $link_static_flag" - fi - continue - ;; - - -allow-undefined) - # FIXME: remove this flag sometime in the future. - func_fatal_error "'-allow-undefined' must not be used because it is the default" - ;; - - -avoid-version) - avoid_version=yes - continue - ;; - - -bindir) - prev=bindir - continue - ;; - - -dlopen) - prev=dlfiles - continue - ;; - - -dlpreopen) - prev=dlprefiles - continue - ;; - - -export-dynamic) - export_dynamic=yes - continue - ;; - - -export-symbols | -export-symbols-regex) - if test -n "$export_symbols" || test -n "$export_symbols_regex"; then - func_fatal_error "more than one -exported-symbols argument is not allowed" - fi - if test X-export-symbols = "X$arg"; then - prev=expsyms - else - prev=expsyms_regex - fi - continue - ;; - - -framework) - prev=framework - continue - ;; - - -inst-prefix-dir) - prev=inst_prefix - continue - ;; - - # The native IRIX linker understands -LANG:*, -LIST:* and -LNO:* - # so, if we see these flags be careful not to treat them like -L - -L[A-Z][A-Z]*:*) - case $with_gcc/$host in - no/*-*-irix* | /*-*-irix*) - func_append compile_command " $arg" - func_append finalize_command " $arg" - ;; - esac - continue - ;; - - -L*) - func_stripname "-L" '' "$arg" - if test -z "$func_stripname_result"; then - if test "$#" -gt 0; then - func_fatal_error "require no space between '-L' and '$1'" - else - func_fatal_error "need path for '-L' option" - fi - fi - func_resolve_sysroot "$func_stripname_result" - dir=$func_resolve_sysroot_result - # We need an absolute path. - case $dir in - [\\/]* | [A-Za-z]:[\\/]*) ;; - *) - absdir=`cd "$dir" && pwd` - test -z "$absdir" && \ - func_fatal_error "cannot determine absolute directory name of '$dir'" - dir=$absdir - ;; - esac - case "$deplibs " in - *" -L$dir "* | *" $arg "*) - # Will only happen for absolute or sysroot arguments - ;; - *) - # Preserve sysroot, but never include relative directories - case $dir in - [\\/]* | [A-Za-z]:[\\/]* | =*) func_append deplibs " $arg" ;; - *) func_append deplibs " -L$dir" ;; - esac - func_append lib_search_path " $dir" - ;; - esac - case $host in - *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-cegcc*) - testbindir=`$ECHO "$dir" | $SED 's*/lib$*/bin*'` - case :$dllsearchpath: in - *":$dir:"*) ;; - ::) dllsearchpath=$dir;; - *) func_append dllsearchpath ":$dir";; - esac - case :$dllsearchpath: in - *":$testbindir:"*) ;; - ::) dllsearchpath=$testbindir;; - *) func_append dllsearchpath ":$testbindir";; - esac - ;; - esac - continue - ;; - - -l*) - if test X-lc = "X$arg" || test X-lm = "X$arg"; then - case $host in - *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-beos* | *-cegcc* | *-*-haiku*) - # These systems don't actually have a C or math library (as such) - continue - ;; - *-*-os2*) - # These systems don't actually have a C library (as such) - test X-lc = "X$arg" && continue - ;; - *-*-openbsd* | *-*-freebsd* | *-*-dragonfly* | *-*-bitrig*) - # Do not include libc due to us having libc/libc_r. - test X-lc = "X$arg" && continue - ;; - *-*-rhapsody* | *-*-darwin1.[012]) - # Rhapsody C and math libraries are in the System framework - func_append deplibs " System.ltframework" - continue - ;; - *-*-sco3.2v5* | *-*-sco5v6*) - # Causes problems with __ctype - test X-lc = "X$arg" && continue - ;; - *-*-sysv4.2uw2* | *-*-sysv5* | *-*-unixware* | *-*-OpenUNIX*) - # Compiler inserts libc in the correct place for threads to work - test X-lc = "X$arg" && continue - ;; - esac - elif test X-lc_r = "X$arg"; then - case $host in - *-*-openbsd* | *-*-freebsd* | *-*-dragonfly* | *-*-bitrig*) - # Do not include libc_r directly, use -pthread flag. - continue - ;; - esac - fi - func_append deplibs " $arg" - continue - ;; - - -mllvm) - prev=mllvm - continue - ;; - - -module) - module=yes - continue - ;; - - # Tru64 UNIX uses -model [arg] to determine the layout of C++ - # classes, name mangling, and exception handling. - # Darwin uses the -arch flag to determine output architecture. - -model|-arch|-isysroot|--sysroot) - func_append compiler_flags " $arg" - func_append compile_command " $arg" - func_append finalize_command " $arg" - prev=xcompiler - continue - ;; - - -mt|-mthreads|-kthread|-Kthread|-pthread|-pthreads|--thread-safe \ - |-threads|-fopenmp|-openmp|-mp|-xopenmp|-omp|-qsmp=*) - func_append compiler_flags " $arg" - func_append compile_command " $arg" - func_append finalize_command " $arg" - case "$new_inherited_linker_flags " in - *" $arg "*) ;; - * ) func_append new_inherited_linker_flags " $arg" ;; - esac - continue - ;; - - -multi_module) - single_module=$wl-multi_module - continue - ;; - - -no-fast-install) - fast_install=no - continue - ;; - - -no-install) - case $host in - *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-*-darwin* | *-cegcc*) - # The PATH hackery in wrapper scripts is required on Windows - # and Darwin in order for the loader to find any dlls it needs. - func_warning "'-no-install' is ignored for $host" - func_warning "assuming '-no-fast-install' instead" - fast_install=no - ;; - *) no_install=yes ;; - esac - continue - ;; - - -no-undefined) - allow_undefined=no - continue - ;; - - -objectlist) - prev=objectlist - continue - ;; - - -os2dllname) - prev=os2dllname - continue - ;; - - -o) prev=output ;; - - -precious-files-regex) - prev=precious_regex - continue - ;; - - -release) - prev=release - continue - ;; - - -rpath) - prev=rpath - continue - ;; - - -R) - prev=xrpath - continue - ;; - - -R*) - func_stripname '-R' '' "$arg" - dir=$func_stripname_result - # We need an absolute path. - case $dir in - [\\/]* | [A-Za-z]:[\\/]*) ;; - =*) - func_stripname '=' '' "$dir" - dir=$lt_sysroot$func_stripname_result - ;; - *) - func_fatal_error "only absolute run-paths are allowed" - ;; - esac - case "$xrpath " in - *" $dir "*) ;; - *) func_append xrpath " $dir" ;; - esac - continue - ;; - - -shared) - # The effects of -shared are defined in a previous loop. - continue - ;; - - -shrext) - prev=shrext - continue - ;; - - -static | -static-libtool-libs) - # The effects of -static are defined in a previous loop. - # We used to do the same as -all-static on platforms that - # didn't have a PIC flag, but the assumption that the effects - # would be equivalent was wrong. It would break on at least - # Digital Unix and AIX. - continue - ;; - - -thread-safe) - thread_safe=yes - continue - ;; - - -version-info) - prev=vinfo - continue - ;; - - -version-number) - prev=vinfo - vinfo_number=yes - continue - ;; - - -weak) - prev=weak - continue - ;; - - -Wc,*) - func_stripname '-Wc,' '' "$arg" - args=$func_stripname_result - arg= - save_ifs=$IFS; IFS=, - for flag in $args; do - IFS=$save_ifs - func_quote_for_eval "$flag" - func_append arg " $func_quote_for_eval_result" - func_append compiler_flags " $func_quote_for_eval_result" - done - IFS=$save_ifs - func_stripname ' ' '' "$arg" - arg=$func_stripname_result - ;; - - -Wl,*) - func_stripname '-Wl,' '' "$arg" - args=$func_stripname_result - arg= - save_ifs=$IFS; IFS=, - for flag in $args; do - IFS=$save_ifs - func_quote_for_eval "$flag" - func_append arg " $wl$func_quote_for_eval_result" - func_append compiler_flags " $wl$func_quote_for_eval_result" - func_append linker_flags " $func_quote_for_eval_result" - done - IFS=$save_ifs - func_stripname ' ' '' "$arg" - arg=$func_stripname_result - ;; - - -Xcompiler) - prev=xcompiler - continue - ;; - - -Xlinker) - prev=xlinker - continue - ;; - - -XCClinker) - prev=xcclinker - continue - ;; - - # -msg_* for osf cc - -msg_*) - func_quote_for_eval "$arg" - arg=$func_quote_for_eval_result - ;; - - # Flags to be passed through unchanged, with rationale: - # -64, -mips[0-9] enable 64-bit mode for the SGI compiler - # -r[0-9][0-9]* specify processor for the SGI compiler - # -xarch=*, -xtarget=* enable 64-bit mode for the Sun compiler - # +DA*, +DD* enable 64-bit mode for the HP compiler - # -q* compiler args for the IBM compiler - # -m*, -t[45]*, -txscale* architecture-specific flags for GCC - # -F/path path to uninstalled frameworks, gcc on darwin - # -p, -pg, --coverage, -fprofile-* profiling flags for GCC - # -fstack-protector* stack protector flags for GCC - # @file GCC response files - # -tp=* Portland pgcc target processor selection - # --sysroot=* for sysroot support - # -O*, -g*, -flto*, -fwhopr*, -fuse-linker-plugin GCC link-time optimization - # -specs=* GCC specs files - # -stdlib=* select c++ std lib with clang - # -fsanitize=* Clang/GCC memory and address sanitizer - # -fuse-ld=* Linker select flags for GCC - # -static-* direct GCC to link specific libraries statically - # -fcilkplus Cilk Plus language extension features for C/C++ - -64|-mips[0-9]|-r[0-9][0-9]*|-xarch=*|-xtarget=*|+DA*|+DD*|-q*|-m*| \ - -t[45]*|-txscale*|-p|-pg|--coverage|-fprofile-*|-F*|@*|-tp=*|--sysroot=*| \ - -O*|-g*|-flto*|-fwhopr*|-fuse-linker-plugin|-fstack-protector*|-stdlib=*| \ - -specs=*|-fsanitize=*|-fuse-ld=*|-static-*|-fcilkplus) - func_quote_for_eval "$arg" - arg=$func_quote_for_eval_result - func_append compile_command " $arg" - func_append finalize_command " $arg" - func_append compiler_flags " $arg" - continue - ;; - - -Z*) - if test os2 = "`expr $host : '.*\(os2\)'`"; then - # OS/2 uses -Zxxx to specify OS/2-specific options - compiler_flags="$compiler_flags $arg" - func_append compile_command " $arg" - func_append finalize_command " $arg" - case $arg in - -Zlinker | -Zstack) - prev=xcompiler - ;; - esac - continue - else - # Otherwise treat like 'Some other compiler flag' below - func_quote_for_eval "$arg" - arg=$func_quote_for_eval_result - fi - ;; - - # Some other compiler flag. - -* | +*) - func_quote_for_eval "$arg" - arg=$func_quote_for_eval_result - ;; - - *.$objext) - # A standard object. - func_append objs " $arg" - ;; - - *.lo) - # A libtool-controlled object. - - # Check to see that this really is a libtool object. - if func_lalib_unsafe_p "$arg"; then - pic_object= - non_pic_object= - - # Read the .lo file - func_source "$arg" - - if test -z "$pic_object" || - test -z "$non_pic_object" || - test none = "$pic_object" && - test none = "$non_pic_object"; then - func_fatal_error "cannot find name of object for '$arg'" - fi - - # Extract subdirectory from the argument. - func_dirname "$arg" "/" "" - xdir=$func_dirname_result - - test none = "$pic_object" || { - # Prepend the subdirectory the object is found in. - pic_object=$xdir$pic_object - - if test dlfiles = "$prev"; then - if test yes = "$build_libtool_libs" && test yes = "$dlopen_support"; then - func_append dlfiles " $pic_object" - prev= - continue - else - # If libtool objects are unsupported, then we need to preload. - prev=dlprefiles - fi - fi - - # CHECK ME: I think I busted this. -Ossama - if test dlprefiles = "$prev"; then - # Preload the old-style object. - func_append dlprefiles " $pic_object" - prev= - fi - - # A PIC object. - func_append libobjs " $pic_object" - arg=$pic_object - } - - # Non-PIC object. - if test none != "$non_pic_object"; then - # Prepend the subdirectory the object is found in. - non_pic_object=$xdir$non_pic_object - - # A standard non-PIC object - func_append non_pic_objects " $non_pic_object" - if test -z "$pic_object" || test none = "$pic_object"; then - arg=$non_pic_object - fi - else - # If the PIC object exists, use it instead. - # $xdir was prepended to $pic_object above. - non_pic_object=$pic_object - func_append non_pic_objects " $non_pic_object" - fi - else - # Only an error if not doing a dry-run. - if $opt_dry_run; then - # Extract subdirectory from the argument. - func_dirname "$arg" "/" "" - xdir=$func_dirname_result - - func_lo2o "$arg" - pic_object=$xdir$objdir/$func_lo2o_result - non_pic_object=$xdir$func_lo2o_result - func_append libobjs " $pic_object" - func_append non_pic_objects " $non_pic_object" - else - func_fatal_error "'$arg' is not a valid libtool object" - fi - fi - ;; - - *.$libext) - # An archive. - func_append deplibs " $arg" - func_append old_deplibs " $arg" - continue - ;; - - *.la) - # A libtool-controlled library. - - func_resolve_sysroot "$arg" - if test dlfiles = "$prev"; then - # This library was specified with -dlopen. - func_append dlfiles " $func_resolve_sysroot_result" - prev= - elif test dlprefiles = "$prev"; then - # The library was specified with -dlpreopen. - func_append dlprefiles " $func_resolve_sysroot_result" - prev= - else - func_append deplibs " $func_resolve_sysroot_result" - fi - continue - ;; - - # Some other compiler argument. - *) - # Unknown arguments in both finalize_command and compile_command need - # to be aesthetically quoted because they are evaled later. - func_quote_for_eval "$arg" - arg=$func_quote_for_eval_result - ;; - esac # arg - - # Now actually substitute the argument into the commands. - if test -n "$arg"; then - func_append compile_command " $arg" - func_append finalize_command " $arg" - fi - done # argument parsing loop - - test -n "$prev" && \ - func_fatal_help "the '$prevarg' option requires an argument" - - if test yes = "$export_dynamic" && test -n "$export_dynamic_flag_spec"; then - eval arg=\"$export_dynamic_flag_spec\" - func_append compile_command " $arg" - func_append finalize_command " $arg" - fi - - oldlibs= - # calculate the name of the file, without its directory - func_basename "$output" - outputname=$func_basename_result - libobjs_save=$libobjs - - if test -n "$shlibpath_var"; then - # get the directories listed in $shlibpath_var - eval shlib_search_path=\`\$ECHO \"\$$shlibpath_var\" \| \$SED \'s/:/ /g\'\` - else - shlib_search_path= - fi - eval sys_lib_search_path=\"$sys_lib_search_path_spec\" - eval sys_lib_dlsearch_path=\"$sys_lib_dlsearch_path_spec\" - - # Definition is injected by LT_CONFIG during libtool generation. - func_munge_path_list sys_lib_dlsearch_path "$LT_SYS_LIBRARY_PATH" - - func_dirname "$output" "/" "" - output_objdir=$func_dirname_result$objdir - func_to_tool_file "$output_objdir/" - tool_output_objdir=$func_to_tool_file_result - # Create the object directory. - func_mkdir_p "$output_objdir" - - # Determine the type of output - case $output in - "") - func_fatal_help "you must specify an output file" - ;; - *.$libext) linkmode=oldlib ;; - *.lo | *.$objext) linkmode=obj ;; - *.la) linkmode=lib ;; - *) linkmode=prog ;; # Anything else should be a program. - esac - - specialdeplibs= - - libs= - # Find all interdependent deplibs by searching for libraries - # that are linked more than once (e.g. -la -lb -la) - for deplib in $deplibs; do - if $opt_preserve_dup_deps; then - case "$libs " in - *" $deplib "*) func_append specialdeplibs " $deplib" ;; - esac - fi - func_append libs " $deplib" - done - - if test lib = "$linkmode"; then - libs="$predeps $libs $compiler_lib_search_path $postdeps" - - # Compute libraries that are listed more than once in $predeps - # $postdeps and mark them as special (i.e., whose duplicates are - # not to be eliminated). - pre_post_deps= - if $opt_duplicate_compiler_generated_deps; then - for pre_post_dep in $predeps $postdeps; do - case "$pre_post_deps " in - *" $pre_post_dep "*) func_append specialdeplibs " $pre_post_deps" ;; - esac - func_append pre_post_deps " $pre_post_dep" - done - fi - pre_post_deps= - fi - - deplibs= - newdependency_libs= - newlib_search_path= - need_relink=no # whether we're linking any uninstalled libtool libraries - notinst_deplibs= # not-installed libtool libraries - notinst_path= # paths that contain not-installed libtool libraries - - case $linkmode in - lib) - passes="conv dlpreopen link" - for file in $dlfiles $dlprefiles; do - case $file in - *.la) ;; - *) - func_fatal_help "libraries can '-dlopen' only libtool libraries: $file" - ;; - esac - done - ;; - prog) - compile_deplibs= - finalize_deplibs= - alldeplibs=false - newdlfiles= - newdlprefiles= - passes="conv scan dlopen dlpreopen link" - ;; - *) passes="conv" - ;; - esac - - for pass in $passes; do - # The preopen pass in lib mode reverses $deplibs; put it back here - # so that -L comes before libs that need it for instance... - if test lib,link = "$linkmode,$pass"; then - ## FIXME: Find the place where the list is rebuilt in the wrong - ## order, and fix it there properly - tmp_deplibs= - for deplib in $deplibs; do - tmp_deplibs="$deplib $tmp_deplibs" - done - deplibs=$tmp_deplibs - fi - - if test lib,link = "$linkmode,$pass" || - test prog,scan = "$linkmode,$pass"; then - libs=$deplibs - deplibs= - fi - if test prog = "$linkmode"; then - case $pass in - dlopen) libs=$dlfiles ;; - dlpreopen) libs=$dlprefiles ;; - link) - libs="$deplibs %DEPLIBS%" - test "X$link_all_deplibs" != Xno && libs="$libs $dependency_libs" - ;; - esac - fi - if test lib,dlpreopen = "$linkmode,$pass"; then - # Collect and forward deplibs of preopened libtool libs - for lib in $dlprefiles; do - # Ignore non-libtool-libs - dependency_libs= - func_resolve_sysroot "$lib" - case $lib in - *.la) func_source "$func_resolve_sysroot_result" ;; - esac - - # Collect preopened libtool deplibs, except any this library - # has declared as weak libs - for deplib in $dependency_libs; do - func_basename "$deplib" - deplib_base=$func_basename_result - case " $weak_libs " in - *" $deplib_base "*) ;; - *) func_append deplibs " $deplib" ;; - esac - done - done - libs=$dlprefiles - fi - if test dlopen = "$pass"; then - # Collect dlpreopened libraries - save_deplibs=$deplibs - deplibs= - fi - - for deplib in $libs; do - lib= - found=false - case $deplib in - -mt|-mthreads|-kthread|-Kthread|-pthread|-pthreads|--thread-safe \ - |-threads|-fopenmp|-openmp|-mp|-xopenmp|-omp|-qsmp=*) - if test prog,link = "$linkmode,$pass"; then - compile_deplibs="$deplib $compile_deplibs" - finalize_deplibs="$deplib $finalize_deplibs" - else - func_append compiler_flags " $deplib" - if test lib = "$linkmode"; then - case "$new_inherited_linker_flags " in - *" $deplib "*) ;; - * ) func_append new_inherited_linker_flags " $deplib" ;; - esac - fi - fi - continue - ;; - -l*) - if test lib != "$linkmode" && test prog != "$linkmode"; then - func_warning "'-l' is ignored for archives/objects" - continue - fi - func_stripname '-l' '' "$deplib" - name=$func_stripname_result - if test lib = "$linkmode"; then - searchdirs="$newlib_search_path $lib_search_path $compiler_lib_search_dirs $sys_lib_search_path $shlib_search_path" - else - searchdirs="$newlib_search_path $lib_search_path $sys_lib_search_path $shlib_search_path" - fi - for searchdir in $searchdirs; do - for search_ext in .la $std_shrext .so .a; do - # Search the libtool library - lib=$searchdir/lib$name$search_ext - if test -f "$lib"; then - if test .la = "$search_ext"; then - found=: - else - found=false - fi - break 2 - fi - done - done - if $found; then - # deplib is a libtool library - # If $allow_libtool_libs_with_static_runtimes && $deplib is a stdlib, - # We need to do some special things here, and not later. - if test yes = "$allow_libtool_libs_with_static_runtimes"; then - case " $predeps $postdeps " in - *" $deplib "*) - if func_lalib_p "$lib"; then - library_names= - old_library= - func_source "$lib" - for l in $old_library $library_names; do - ll=$l - done - if test "X$ll" = "X$old_library"; then # only static version available - found=false - func_dirname "$lib" "" "." - ladir=$func_dirname_result - lib=$ladir/$old_library - if test prog,link = "$linkmode,$pass"; then - compile_deplibs="$deplib $compile_deplibs" - finalize_deplibs="$deplib $finalize_deplibs" - else - deplibs="$deplib $deplibs" - test lib = "$linkmode" && newdependency_libs="$deplib $newdependency_libs" - fi - continue - fi - fi - ;; - *) ;; - esac - fi - else - # deplib doesn't seem to be a libtool library - if test prog,link = "$linkmode,$pass"; then - compile_deplibs="$deplib $compile_deplibs" - finalize_deplibs="$deplib $finalize_deplibs" - else - deplibs="$deplib $deplibs" - test lib = "$linkmode" && newdependency_libs="$deplib $newdependency_libs" - fi - continue - fi - ;; # -l - *.ltframework) - if test prog,link = "$linkmode,$pass"; then - compile_deplibs="$deplib $compile_deplibs" - finalize_deplibs="$deplib $finalize_deplibs" - else - deplibs="$deplib $deplibs" - if test lib = "$linkmode"; then - case "$new_inherited_linker_flags " in - *" $deplib "*) ;; - * ) func_append new_inherited_linker_flags " $deplib" ;; - esac - fi - fi - continue - ;; - -L*) - case $linkmode in - lib) - deplibs="$deplib $deplibs" - test conv = "$pass" && continue - newdependency_libs="$deplib $newdependency_libs" - func_stripname '-L' '' "$deplib" - func_resolve_sysroot "$func_stripname_result" - func_append newlib_search_path " $func_resolve_sysroot_result" - ;; - prog) - if test conv = "$pass"; then - deplibs="$deplib $deplibs" - continue - fi - if test scan = "$pass"; then - deplibs="$deplib $deplibs" - else - compile_deplibs="$deplib $compile_deplibs" - finalize_deplibs="$deplib $finalize_deplibs" - fi - func_stripname '-L' '' "$deplib" - func_resolve_sysroot "$func_stripname_result" - func_append newlib_search_path " $func_resolve_sysroot_result" - ;; - *) - func_warning "'-L' is ignored for archives/objects" - ;; - esac # linkmode - continue - ;; # -L - -R*) - if test link = "$pass"; then - func_stripname '-R' '' "$deplib" - func_resolve_sysroot "$func_stripname_result" - dir=$func_resolve_sysroot_result - # Make sure the xrpath contains only unique directories. - case "$xrpath " in - *" $dir "*) ;; - *) func_append xrpath " $dir" ;; - esac - fi - deplibs="$deplib $deplibs" - continue - ;; - *.la) - func_resolve_sysroot "$deplib" - lib=$func_resolve_sysroot_result - ;; - *.$libext) - if test conv = "$pass"; then - deplibs="$deplib $deplibs" - continue - fi - case $linkmode in - lib) - # Linking convenience modules into shared libraries is allowed, - # but linking other static libraries is non-portable. - case " $dlpreconveniencelibs " in - *" $deplib "*) ;; - *) - valid_a_lib=false - case $deplibs_check_method in - match_pattern*) - set dummy $deplibs_check_method; shift - match_pattern_regex=`expr "$deplibs_check_method" : "$1 \(.*\)"` - if eval "\$ECHO \"$deplib\"" 2>/dev/null | $SED 10q \ - | $EGREP "$match_pattern_regex" > /dev/null; then - valid_a_lib=: - fi - ;; - pass_all) - valid_a_lib=: - ;; - esac - if $valid_a_lib; then - echo - $ECHO "*** Warning: Linking the shared library $output against the" - $ECHO "*** static library $deplib is not portable!" - deplibs="$deplib $deplibs" - else - echo - $ECHO "*** Warning: Trying to link with static lib archive $deplib." - echo "*** I have the capability to make that library automatically link in when" - echo "*** you link to this library. But I can only do this if you have a" - echo "*** shared version of the library, which you do not appear to have" - echo "*** because the file extensions .$libext of this argument makes me believe" - echo "*** that it is just a static archive that I should not use here." - fi - ;; - esac - continue - ;; - prog) - if test link != "$pass"; then - deplibs="$deplib $deplibs" - else - compile_deplibs="$deplib $compile_deplibs" - finalize_deplibs="$deplib $finalize_deplibs" - fi - continue - ;; - esac # linkmode - ;; # *.$libext - *.lo | *.$objext) - if test conv = "$pass"; then - deplibs="$deplib $deplibs" - elif test prog = "$linkmode"; then - if test dlpreopen = "$pass" || test yes != "$dlopen_support" || test no = "$build_libtool_libs"; then - # If there is no dlopen support or we're linking statically, - # we need to preload. - func_append newdlprefiles " $deplib" - compile_deplibs="$deplib $compile_deplibs" - finalize_deplibs="$deplib $finalize_deplibs" - else - func_append newdlfiles " $deplib" - fi - fi - continue - ;; - %DEPLIBS%) - alldeplibs=: - continue - ;; - esac # case $deplib - - $found || test -f "$lib" \ - || func_fatal_error "cannot find the library '$lib' or unhandled argument '$deplib'" - - # Check to see that this really is a libtool archive. - func_lalib_unsafe_p "$lib" \ - || func_fatal_error "'$lib' is not a valid libtool archive" - - func_dirname "$lib" "" "." - ladir=$func_dirname_result - - dlname= - dlopen= - dlpreopen= - libdir= - library_names= - old_library= - inherited_linker_flags= - # If the library was installed with an old release of libtool, - # it will not redefine variables installed, or shouldnotlink - installed=yes - shouldnotlink=no - avoidtemprpath= - - - # Read the .la file - func_source "$lib" - - # Convert "-framework foo" to "foo.ltframework" - if test -n "$inherited_linker_flags"; then - tmp_inherited_linker_flags=`$ECHO "$inherited_linker_flags" | $SED 's/-framework \([^ $]*\)/\1.ltframework/g'` - for tmp_inherited_linker_flag in $tmp_inherited_linker_flags; do - case " $new_inherited_linker_flags " in - *" $tmp_inherited_linker_flag "*) ;; - *) func_append new_inherited_linker_flags " $tmp_inherited_linker_flag";; - esac - done - fi - dependency_libs=`$ECHO " $dependency_libs" | $SED 's% \([^ $]*\).ltframework% -framework \1%g'` - if test lib,link = "$linkmode,$pass" || - test prog,scan = "$linkmode,$pass" || - { test prog != "$linkmode" && test lib != "$linkmode"; }; then - test -n "$dlopen" && func_append dlfiles " $dlopen" - test -n "$dlpreopen" && func_append dlprefiles " $dlpreopen" - fi - - if test conv = "$pass"; then - # Only check for convenience libraries - deplibs="$lib $deplibs" - if test -z "$libdir"; then - if test -z "$old_library"; then - func_fatal_error "cannot find name of link library for '$lib'" - fi - # It is a libtool convenience library, so add in its objects. - func_append convenience " $ladir/$objdir/$old_library" - func_append old_convenience " $ladir/$objdir/$old_library" - tmp_libs= - for deplib in $dependency_libs; do - deplibs="$deplib $deplibs" - if $opt_preserve_dup_deps; then - case "$tmp_libs " in - *" $deplib "*) func_append specialdeplibs " $deplib" ;; - esac - fi - func_append tmp_libs " $deplib" - done - elif test prog != "$linkmode" && test lib != "$linkmode"; then - func_fatal_error "'$lib' is not a convenience library" - fi - continue - fi # $pass = conv - - - # Get the name of the library we link against. - linklib= - if test -n "$old_library" && - { test yes = "$prefer_static_libs" || - test built,no = "$prefer_static_libs,$installed"; }; then - linklib=$old_library - else - for l in $old_library $library_names; do - linklib=$l - done - fi - if test -z "$linklib"; then - func_fatal_error "cannot find name of link library for '$lib'" - fi - - # This library was specified with -dlopen. - if test dlopen = "$pass"; then - test -z "$libdir" \ - && func_fatal_error "cannot -dlopen a convenience library: '$lib'" - if test -z "$dlname" || - test yes != "$dlopen_support" || - test no = "$build_libtool_libs" - then - # If there is no dlname, no dlopen support or we're linking - # statically, we need to preload. We also need to preload any - # dependent libraries so libltdl's deplib preloader doesn't - # bomb out in the load deplibs phase. - func_append dlprefiles " $lib $dependency_libs" - else - func_append newdlfiles " $lib" - fi - continue - fi # $pass = dlopen - - # We need an absolute path. - case $ladir in - [\\/]* | [A-Za-z]:[\\/]*) abs_ladir=$ladir ;; - *) - abs_ladir=`cd "$ladir" && pwd` - if test -z "$abs_ladir"; then - func_warning "cannot determine absolute directory name of '$ladir'" - func_warning "passing it literally to the linker, although it might fail" - abs_ladir=$ladir - fi - ;; - esac - func_basename "$lib" - laname=$func_basename_result - - # Find the relevant object directory and library name. - if test yes = "$installed"; then - if test ! -f "$lt_sysroot$libdir/$linklib" && test -f "$abs_ladir/$linklib"; then - func_warning "library '$lib' was moved." - dir=$ladir - absdir=$abs_ladir - libdir=$abs_ladir - else - dir=$lt_sysroot$libdir - absdir=$lt_sysroot$libdir - fi - test yes = "$hardcode_automatic" && avoidtemprpath=yes - else - if test ! -f "$ladir/$objdir/$linklib" && test -f "$abs_ladir/$linklib"; then - dir=$ladir - absdir=$abs_ladir - # Remove this search path later - func_append notinst_path " $abs_ladir" - else - dir=$ladir/$objdir - absdir=$abs_ladir/$objdir - # Remove this search path later - func_append notinst_path " $abs_ladir" - fi - fi # $installed = yes - func_stripname 'lib' '.la' "$laname" - name=$func_stripname_result - - # This library was specified with -dlpreopen. - if test dlpreopen = "$pass"; then - if test -z "$libdir" && test prog = "$linkmode"; then - func_fatal_error "only libraries may -dlpreopen a convenience library: '$lib'" - fi - case $host in - # special handling for platforms with PE-DLLs. - *cygwin* | *mingw* | *cegcc* ) - # Linker will automatically link against shared library if both - # static and shared are present. Therefore, ensure we extract - # symbols from the import library if a shared library is present - # (otherwise, the dlopen module name will be incorrect). We do - # this by putting the import library name into $newdlprefiles. - # We recover the dlopen module name by 'saving' the la file - # name in a special purpose variable, and (later) extracting the - # dlname from the la file. - if test -n "$dlname"; then - func_tr_sh "$dir/$linklib" - eval "libfile_$func_tr_sh_result=\$abs_ladir/\$laname" - func_append newdlprefiles " $dir/$linklib" - else - func_append newdlprefiles " $dir/$old_library" - # Keep a list of preopened convenience libraries to check - # that they are being used correctly in the link pass. - test -z "$libdir" && \ - func_append dlpreconveniencelibs " $dir/$old_library" - fi - ;; - * ) - # Prefer using a static library (so that no silly _DYNAMIC symbols - # are required to link). - if test -n "$old_library"; then - func_append newdlprefiles " $dir/$old_library" - # Keep a list of preopened convenience libraries to check - # that they are being used correctly in the link pass. - test -z "$libdir" && \ - func_append dlpreconveniencelibs " $dir/$old_library" - # Otherwise, use the dlname, so that lt_dlopen finds it. - elif test -n "$dlname"; then - func_append newdlprefiles " $dir/$dlname" - else - func_append newdlprefiles " $dir/$linklib" - fi - ;; - esac - fi # $pass = dlpreopen - - if test -z "$libdir"; then - # Link the convenience library - if test lib = "$linkmode"; then - deplibs="$dir/$old_library $deplibs" - elif test prog,link = "$linkmode,$pass"; then - compile_deplibs="$dir/$old_library $compile_deplibs" - finalize_deplibs="$dir/$old_library $finalize_deplibs" - else - deplibs="$lib $deplibs" # used for prog,scan pass - fi - continue - fi - - - if test prog = "$linkmode" && test link != "$pass"; then - func_append newlib_search_path " $ladir" - deplibs="$lib $deplibs" - - linkalldeplibs=false - if test no != "$link_all_deplibs" || test -z "$library_names" || - test no = "$build_libtool_libs"; then - linkalldeplibs=: - fi - - tmp_libs= - for deplib in $dependency_libs; do - case $deplib in - -L*) func_stripname '-L' '' "$deplib" - func_resolve_sysroot "$func_stripname_result" - func_append newlib_search_path " $func_resolve_sysroot_result" - ;; - esac - # Need to link against all dependency_libs? - if $linkalldeplibs; then - deplibs="$deplib $deplibs" - else - # Need to hardcode shared library paths - # or/and link against static libraries - newdependency_libs="$deplib $newdependency_libs" - fi - if $opt_preserve_dup_deps; then - case "$tmp_libs " in - *" $deplib "*) func_append specialdeplibs " $deplib" ;; - esac - fi - func_append tmp_libs " $deplib" - done # for deplib - continue - fi # $linkmode = prog... - - if test prog,link = "$linkmode,$pass"; then - if test -n "$library_names" && - { { test no = "$prefer_static_libs" || - test built,yes = "$prefer_static_libs,$installed"; } || - test -z "$old_library"; }; then - # We need to hardcode the library path - if test -n "$shlibpath_var" && test -z "$avoidtemprpath"; then - # Make sure the rpath contains only unique directories. - case $temp_rpath: in - *"$absdir:"*) ;; - *) func_append temp_rpath "$absdir:" ;; - esac - fi - - # Hardcode the library path. - # Skip directories that are in the system default run-time - # search path. - case " $sys_lib_dlsearch_path " in - *" $absdir "*) ;; - *) - case "$compile_rpath " in - *" $absdir "*) ;; - *) func_append compile_rpath " $absdir" ;; - esac - ;; - esac - case " $sys_lib_dlsearch_path " in - *" $libdir "*) ;; - *) - case "$finalize_rpath " in - *" $libdir "*) ;; - *) func_append finalize_rpath " $libdir" ;; - esac - ;; - esac - fi # $linkmode,$pass = prog,link... - - if $alldeplibs && - { test pass_all = "$deplibs_check_method" || - { test yes = "$build_libtool_libs" && - test -n "$library_names"; }; }; then - # We only need to search for static libraries - continue - fi - fi - - link_static=no # Whether the deplib will be linked statically - use_static_libs=$prefer_static_libs - if test built = "$use_static_libs" && test yes = "$installed"; then - use_static_libs=no - fi - if test -n "$library_names" && - { test no = "$use_static_libs" || test -z "$old_library"; }; then - case $host in - *cygwin* | *mingw* | *cegcc* | *os2*) - # No point in relinking DLLs because paths are not encoded - func_append notinst_deplibs " $lib" - need_relink=no - ;; - *) - if test no = "$installed"; then - func_append notinst_deplibs " $lib" - need_relink=yes - fi - ;; - esac - # This is a shared library - - # Warn about portability, can't link against -module's on some - # systems (darwin). Don't bleat about dlopened modules though! - dlopenmodule= - for dlpremoduletest in $dlprefiles; do - if test "X$dlpremoduletest" = "X$lib"; then - dlopenmodule=$dlpremoduletest - break - fi - done - if test -z "$dlopenmodule" && test yes = "$shouldnotlink" && test link = "$pass"; then - echo - if test prog = "$linkmode"; then - $ECHO "*** Warning: Linking the executable $output against the loadable module" - else - $ECHO "*** Warning: Linking the shared library $output against the loadable module" - fi - $ECHO "*** $linklib is not portable!" - fi - if test lib = "$linkmode" && - test yes = "$hardcode_into_libs"; then - # Hardcode the library path. - # Skip directories that are in the system default run-time - # search path. - case " $sys_lib_dlsearch_path " in - *" $absdir "*) ;; - *) - case "$compile_rpath " in - *" $absdir "*) ;; - *) func_append compile_rpath " $absdir" ;; - esac - ;; - esac - case " $sys_lib_dlsearch_path " in - *" $libdir "*) ;; - *) - case "$finalize_rpath " in - *" $libdir "*) ;; - *) func_append finalize_rpath " $libdir" ;; - esac - ;; - esac - fi - - if test -n "$old_archive_from_expsyms_cmds"; then - # figure out the soname - set dummy $library_names - shift - realname=$1 - shift - libname=`eval "\\$ECHO \"$libname_spec\""` - # use dlname if we got it. it's perfectly good, no? - if test -n "$dlname"; then - soname=$dlname - elif test -n "$soname_spec"; then - # bleh windows - case $host in - *cygwin* | mingw* | *cegcc* | *os2*) - func_arith $current - $age - major=$func_arith_result - versuffix=-$major - ;; - esac - eval soname=\"$soname_spec\" - else - soname=$realname - fi - - # Make a new name for the extract_expsyms_cmds to use - soroot=$soname - func_basename "$soroot" - soname=$func_basename_result - func_stripname 'lib' '.dll' "$soname" - newlib=libimp-$func_stripname_result.a - - # If the library has no export list, then create one now - if test -f "$output_objdir/$soname-def"; then : - else - func_verbose "extracting exported symbol list from '$soname'" - func_execute_cmds "$extract_expsyms_cmds" 'exit $?' - fi - - # Create $newlib - if test -f "$output_objdir/$newlib"; then :; else - func_verbose "generating import library for '$soname'" - func_execute_cmds "$old_archive_from_expsyms_cmds" 'exit $?' - fi - # make sure the library variables are pointing to the new library - dir=$output_objdir - linklib=$newlib - fi # test -n "$old_archive_from_expsyms_cmds" - - if test prog = "$linkmode" || test relink != "$opt_mode"; then - add_shlibpath= - add_dir= - add= - lib_linked=yes - case $hardcode_action in - immediate | unsupported) - if test no = "$hardcode_direct"; then - add=$dir/$linklib - case $host in - *-*-sco3.2v5.0.[024]*) add_dir=-L$dir ;; - *-*-sysv4*uw2*) add_dir=-L$dir ;; - *-*-sysv5OpenUNIX* | *-*-sysv5UnixWare7.[01].[10]* | \ - *-*-unixware7*) add_dir=-L$dir ;; - *-*-darwin* ) - # if the lib is a (non-dlopened) module then we cannot - # link against it, someone is ignoring the earlier warnings - if /usr/bin/file -L $add 2> /dev/null | - $GREP ": [^:]* bundle" >/dev/null; then - if test "X$dlopenmodule" != "X$lib"; then - $ECHO "*** Warning: lib $linklib is a module, not a shared library" - if test -z "$old_library"; then - echo - echo "*** And there doesn't seem to be a static archive available" - echo "*** The link will probably fail, sorry" - else - add=$dir/$old_library - fi - elif test -n "$old_library"; then - add=$dir/$old_library - fi - fi - esac - elif test no = "$hardcode_minus_L"; then - case $host in - *-*-sunos*) add_shlibpath=$dir ;; - esac - add_dir=-L$dir - add=-l$name - elif test no = "$hardcode_shlibpath_var"; then - add_shlibpath=$dir - add=-l$name - else - lib_linked=no - fi - ;; - relink) - if test yes = "$hardcode_direct" && - test no = "$hardcode_direct_absolute"; then - add=$dir/$linklib - elif test yes = "$hardcode_minus_L"; then - add_dir=-L$absdir - # Try looking first in the location we're being installed to. - if test -n "$inst_prefix_dir"; then - case $libdir in - [\\/]*) - func_append add_dir " -L$inst_prefix_dir$libdir" - ;; - esac - fi - add=-l$name - elif test yes = "$hardcode_shlibpath_var"; then - add_shlibpath=$dir - add=-l$name - else - lib_linked=no - fi - ;; - *) lib_linked=no ;; - esac - - if test yes != "$lib_linked"; then - func_fatal_configuration "unsupported hardcode properties" - fi - - if test -n "$add_shlibpath"; then - case :$compile_shlibpath: in - *":$add_shlibpath:"*) ;; - *) func_append compile_shlibpath "$add_shlibpath:" ;; - esac - fi - if test prog = "$linkmode"; then - test -n "$add_dir" && compile_deplibs="$add_dir $compile_deplibs" - test -n "$add" && compile_deplibs="$add $compile_deplibs" - else - test -n "$add_dir" && deplibs="$add_dir $deplibs" - test -n "$add" && deplibs="$add $deplibs" - if test yes != "$hardcode_direct" && - test yes != "$hardcode_minus_L" && - test yes = "$hardcode_shlibpath_var"; then - case :$finalize_shlibpath: in - *":$libdir:"*) ;; - *) func_append finalize_shlibpath "$libdir:" ;; - esac - fi - fi - fi - - if test prog = "$linkmode" || test relink = "$opt_mode"; then - add_shlibpath= - add_dir= - add= - # Finalize command for both is simple: just hardcode it. - if test yes = "$hardcode_direct" && - test no = "$hardcode_direct_absolute"; then - add=$libdir/$linklib - elif test yes = "$hardcode_minus_L"; then - add_dir=-L$libdir - add=-l$name - elif test yes = "$hardcode_shlibpath_var"; then - case :$finalize_shlibpath: in - *":$libdir:"*) ;; - *) func_append finalize_shlibpath "$libdir:" ;; - esac - add=-l$name - elif test yes = "$hardcode_automatic"; then - if test -n "$inst_prefix_dir" && - test -f "$inst_prefix_dir$libdir/$linklib"; then - add=$inst_prefix_dir$libdir/$linklib - else - add=$libdir/$linklib - fi - else - # We cannot seem to hardcode it, guess we'll fake it. - add_dir=-L$libdir - # Try looking first in the location we're being installed to. - if test -n "$inst_prefix_dir"; then - case $libdir in - [\\/]*) - func_append add_dir " -L$inst_prefix_dir$libdir" - ;; - esac - fi - add=-l$name - fi - - if test prog = "$linkmode"; then - test -n "$add_dir" && finalize_deplibs="$add_dir $finalize_deplibs" - test -n "$add" && finalize_deplibs="$add $finalize_deplibs" - else - test -n "$add_dir" && deplibs="$add_dir $deplibs" - test -n "$add" && deplibs="$add $deplibs" - fi - fi - elif test prog = "$linkmode"; then - # Here we assume that one of hardcode_direct or hardcode_minus_L - # is not unsupported. This is valid on all known static and - # shared platforms. - if test unsupported != "$hardcode_direct"; then - test -n "$old_library" && linklib=$old_library - compile_deplibs="$dir/$linklib $compile_deplibs" - finalize_deplibs="$dir/$linklib $finalize_deplibs" - else - compile_deplibs="-l$name -L$dir $compile_deplibs" - finalize_deplibs="-l$name -L$dir $finalize_deplibs" - fi - elif test yes = "$build_libtool_libs"; then - # Not a shared library - if test pass_all != "$deplibs_check_method"; then - # We're trying link a shared library against a static one - # but the system doesn't support it. - - # Just print a warning and add the library to dependency_libs so - # that the program can be linked against the static library. - echo - $ECHO "*** Warning: This system cannot link to static lib archive $lib." - echo "*** I have the capability to make that library automatically link in when" - echo "*** you link to this library. But I can only do this if you have a" - echo "*** shared version of the library, which you do not appear to have." - if test yes = "$module"; then - echo "*** But as you try to build a module library, libtool will still create " - echo "*** a static module, that should work as long as the dlopening application" - echo "*** is linked with the -dlopen flag to resolve symbols at runtime." - if test -z "$global_symbol_pipe"; then - echo - echo "*** However, this would only work if libtool was able to extract symbol" - echo "*** lists from a program, using 'nm' or equivalent, but libtool could" - echo "*** not find such a program. So, this module is probably useless." - echo "*** 'nm' from GNU binutils and a full rebuild may help." - fi - if test no = "$build_old_libs"; then - build_libtool_libs=module - build_old_libs=yes - else - build_libtool_libs=no - fi - fi - else - deplibs="$dir/$old_library $deplibs" - link_static=yes - fi - fi # link shared/static library? - - if test lib = "$linkmode"; then - if test -n "$dependency_libs" && - { test yes != "$hardcode_into_libs" || - test yes = "$build_old_libs" || - test yes = "$link_static"; }; then - # Extract -R from dependency_libs - temp_deplibs= - for libdir in $dependency_libs; do - case $libdir in - -R*) func_stripname '-R' '' "$libdir" - temp_xrpath=$func_stripname_result - case " $xrpath " in - *" $temp_xrpath "*) ;; - *) func_append xrpath " $temp_xrpath";; - esac;; - *) func_append temp_deplibs " $libdir";; - esac - done - dependency_libs=$temp_deplibs - fi - - func_append newlib_search_path " $absdir" - # Link against this library - test no = "$link_static" && newdependency_libs="$abs_ladir/$laname $newdependency_libs" - # ... and its dependency_libs - tmp_libs= - for deplib in $dependency_libs; do - newdependency_libs="$deplib $newdependency_libs" - case $deplib in - -L*) func_stripname '-L' '' "$deplib" - func_resolve_sysroot "$func_stripname_result";; - *) func_resolve_sysroot "$deplib" ;; - esac - if $opt_preserve_dup_deps; then - case "$tmp_libs " in - *" $func_resolve_sysroot_result "*) - func_append specialdeplibs " $func_resolve_sysroot_result" ;; - esac - fi - func_append tmp_libs " $func_resolve_sysroot_result" - done - - if test no != "$link_all_deplibs"; then - # Add the search paths of all dependency libraries - for deplib in $dependency_libs; do - path= - case $deplib in - -L*) path=$deplib ;; - *.la) - func_resolve_sysroot "$deplib" - deplib=$func_resolve_sysroot_result - func_dirname "$deplib" "" "." - dir=$func_dirname_result - # We need an absolute path. - case $dir in - [\\/]* | [A-Za-z]:[\\/]*) absdir=$dir ;; - *) - absdir=`cd "$dir" && pwd` - if test -z "$absdir"; then - func_warning "cannot determine absolute directory name of '$dir'" - absdir=$dir - fi - ;; - esac - if $GREP "^installed=no" $deplib > /dev/null; then - case $host in - *-*-darwin*) - depdepl= - eval deplibrary_names=`$SED -n -e 's/^library_names=\(.*\)$/\1/p' $deplib` - if test -n "$deplibrary_names"; then - for tmp in $deplibrary_names; do - depdepl=$tmp - done - if test -f "$absdir/$objdir/$depdepl"; then - depdepl=$absdir/$objdir/$depdepl - darwin_install_name=`$OTOOL -L $depdepl | awk '{if (NR == 2) {print $1;exit}}'` - if test -z "$darwin_install_name"; then - darwin_install_name=`$OTOOL64 -L $depdepl | awk '{if (NR == 2) {print $1;exit}}'` - fi - func_append compiler_flags " $wl-dylib_file $wl$darwin_install_name:$depdepl" - func_append linker_flags " -dylib_file $darwin_install_name:$depdepl" - path= - fi - fi - ;; - *) - path=-L$absdir/$objdir - ;; - esac - else - eval libdir=`$SED -n -e 's/^libdir=\(.*\)$/\1/p' $deplib` - test -z "$libdir" && \ - func_fatal_error "'$deplib' is not a valid libtool archive" - test "$absdir" != "$libdir" && \ - func_warning "'$deplib' seems to be moved" - - path=-L$absdir - fi - ;; - esac - case " $deplibs " in - *" $path "*) ;; - *) deplibs="$path $deplibs" ;; - esac - done - fi # link_all_deplibs != no - fi # linkmode = lib - done # for deplib in $libs - if test link = "$pass"; then - if test prog = "$linkmode"; then - compile_deplibs="$new_inherited_linker_flags $compile_deplibs" - finalize_deplibs="$new_inherited_linker_flags $finalize_deplibs" - else - compiler_flags="$compiler_flags "`$ECHO " $new_inherited_linker_flags" | $SED 's% \([^ $]*\).ltframework% -framework \1%g'` - fi - fi - dependency_libs=$newdependency_libs - if test dlpreopen = "$pass"; then - # Link the dlpreopened libraries before other libraries - for deplib in $save_deplibs; do - deplibs="$deplib $deplibs" - done - fi - if test dlopen != "$pass"; then - test conv = "$pass" || { - # Make sure lib_search_path contains only unique directories. - lib_search_path= - for dir in $newlib_search_path; do - case "$lib_search_path " in - *" $dir "*) ;; - *) func_append lib_search_path " $dir" ;; - esac - done - newlib_search_path= - } - - if test prog,link = "$linkmode,$pass"; then - vars="compile_deplibs finalize_deplibs" - else - vars=deplibs - fi - for var in $vars dependency_libs; do - # Add libraries to $var in reverse order - eval tmp_libs=\"\$$var\" - new_libs= - for deplib in $tmp_libs; do - # FIXME: Pedantically, this is the right thing to do, so - # that some nasty dependency loop isn't accidentally - # broken: - #new_libs="$deplib $new_libs" - # Pragmatically, this seems to cause very few problems in - # practice: - case $deplib in - -L*) new_libs="$deplib $new_libs" ;; - -R*) ;; - *) - # And here is the reason: when a library appears more - # than once as an explicit dependence of a library, or - # is implicitly linked in more than once by the - # compiler, it is considered special, and multiple - # occurrences thereof are not removed. Compare this - # with having the same library being listed as a - # dependency of multiple other libraries: in this case, - # we know (pedantically, we assume) the library does not - # need to be listed more than once, so we keep only the - # last copy. This is not always right, but it is rare - # enough that we require users that really mean to play - # such unportable linking tricks to link the library - # using -Wl,-lname, so that libtool does not consider it - # for duplicate removal. - case " $specialdeplibs " in - *" $deplib "*) new_libs="$deplib $new_libs" ;; - *) - case " $new_libs " in - *" $deplib "*) ;; - *) new_libs="$deplib $new_libs" ;; - esac - ;; - esac - ;; - esac - done - tmp_libs= - for deplib in $new_libs; do - case $deplib in - -L*) - case " $tmp_libs " in - *" $deplib "*) ;; - *) func_append tmp_libs " $deplib" ;; - esac - ;; - *) func_append tmp_libs " $deplib" ;; - esac - done - eval $var=\"$tmp_libs\" - done # for var - fi - - # Add Sun CC postdeps if required: - test CXX = "$tagname" && { - case $host_os in - linux*) - case `$CC -V 2>&1 | sed 5q` in - *Sun\ C*) # Sun C++ 5.9 - func_suncc_cstd_abi - - if test no != "$suncc_use_cstd_abi"; then - func_append postdeps ' -library=Cstd -library=Crun' - fi - ;; - esac - ;; - - solaris*) - func_cc_basename "$CC" - case $func_cc_basename_result in - CC* | sunCC*) - func_suncc_cstd_abi - - if test no != "$suncc_use_cstd_abi"; then - func_append postdeps ' -library=Cstd -library=Crun' - fi - ;; - esac - ;; - esac - } - - # Last step: remove runtime libs from dependency_libs - # (they stay in deplibs) - tmp_libs= - for i in $dependency_libs; do - case " $predeps $postdeps $compiler_lib_search_path " in - *" $i "*) - i= - ;; - esac - if test -n "$i"; then - func_append tmp_libs " $i" - fi - done - dependency_libs=$tmp_libs - done # for pass - if test prog = "$linkmode"; then - dlfiles=$newdlfiles - fi - if test prog = "$linkmode" || test lib = "$linkmode"; then - dlprefiles=$newdlprefiles - fi - - case $linkmode in - oldlib) - if test -n "$dlfiles$dlprefiles" || test no != "$dlself"; then - func_warning "'-dlopen' is ignored for archives" - fi - - case " $deplibs" in - *\ -l* | *\ -L*) - func_warning "'-l' and '-L' are ignored for archives" ;; - esac - - test -n "$rpath" && \ - func_warning "'-rpath' is ignored for archives" - - test -n "$xrpath" && \ - func_warning "'-R' is ignored for archives" - - test -n "$vinfo" && \ - func_warning "'-version-info/-version-number' is ignored for archives" - - test -n "$release" && \ - func_warning "'-release' is ignored for archives" - - test -n "$export_symbols$export_symbols_regex" && \ - func_warning "'-export-symbols' is ignored for archives" - - # Now set the variables for building old libraries. - build_libtool_libs=no - oldlibs=$output - func_append objs "$old_deplibs" - ;; - - lib) - # Make sure we only generate libraries of the form 'libNAME.la'. - case $outputname in - lib*) - func_stripname 'lib' '.la' "$outputname" - name=$func_stripname_result - eval shared_ext=\"$shrext_cmds\" - eval libname=\"$libname_spec\" - ;; - *) - test no = "$module" \ - && func_fatal_help "libtool library '$output' must begin with 'lib'" - - if test no != "$need_lib_prefix"; then - # Add the "lib" prefix for modules if required - func_stripname '' '.la' "$outputname" - name=$func_stripname_result - eval shared_ext=\"$shrext_cmds\" - eval libname=\"$libname_spec\" - else - func_stripname '' '.la' "$outputname" - libname=$func_stripname_result - fi - ;; - esac - - if test -n "$objs"; then - if test pass_all != "$deplibs_check_method"; then - func_fatal_error "cannot build libtool library '$output' from non-libtool objects on this host:$objs" - else - echo - $ECHO "*** Warning: Linking the shared library $output against the non-libtool" - $ECHO "*** objects $objs is not portable!" - func_append libobjs " $objs" - fi - fi - - test no = "$dlself" \ - || func_warning "'-dlopen self' is ignored for libtool libraries" - - set dummy $rpath - shift - test 1 -lt "$#" \ - && func_warning "ignoring multiple '-rpath's for a libtool library" - - install_libdir=$1 - - oldlibs= - if test -z "$rpath"; then - if test yes = "$build_libtool_libs"; then - # Building a libtool convenience library. - # Some compilers have problems with a '.al' extension so - # convenience libraries should have the same extension an - # archive normally would. - oldlibs="$output_objdir/$libname.$libext $oldlibs" - build_libtool_libs=convenience - build_old_libs=yes - fi - - test -n "$vinfo" && \ - func_warning "'-version-info/-version-number' is ignored for convenience libraries" - - test -n "$release" && \ - func_warning "'-release' is ignored for convenience libraries" - else - - # Parse the version information argument. - save_ifs=$IFS; IFS=: - set dummy $vinfo 0 0 0 - shift - IFS=$save_ifs - - test -n "$7" && \ - func_fatal_help "too many parameters to '-version-info'" - - # convert absolute version numbers to libtool ages - # this retains compatibility with .la files and attempts - # to make the code below a bit more comprehensible - - case $vinfo_number in - yes) - number_major=$1 - number_minor=$2 - number_revision=$3 - # - # There are really only two kinds -- those that - # use the current revision as the major version - # and those that subtract age and use age as - # a minor version. But, then there is irix - # that has an extra 1 added just for fun - # - case $version_type in - # correct linux to gnu/linux during the next big refactor - darwin|freebsd-elf|linux|osf|windows|none) - func_arith $number_major + $number_minor - current=$func_arith_result - age=$number_minor - revision=$number_revision - ;; - freebsd-aout|qnx|sunos) - current=$number_major - revision=$number_minor - age=0 - ;; - irix|nonstopux) - func_arith $number_major + $number_minor - current=$func_arith_result - age=$number_minor - revision=$number_minor - lt_irix_increment=no - ;; - *) - func_fatal_configuration "$modename: unknown library version type '$version_type'" - ;; - esac - ;; - no) - current=$1 - revision=$2 - age=$3 - ;; - esac - - # Check that each of the things are valid numbers. - case $current in - 0|[1-9]|[1-9][0-9]|[1-9][0-9][0-9]|[1-9][0-9][0-9][0-9]|[1-9][0-9][0-9][0-9][0-9]) ;; - *) - func_error "CURRENT '$current' must be a nonnegative integer" - func_fatal_error "'$vinfo' is not valid version information" - ;; - esac - - case $revision in - 0|[1-9]|[1-9][0-9]|[1-9][0-9][0-9]|[1-9][0-9][0-9][0-9]|[1-9][0-9][0-9][0-9][0-9]) ;; - *) - func_error "REVISION '$revision' must be a nonnegative integer" - func_fatal_error "'$vinfo' is not valid version information" - ;; - esac - - case $age in - 0|[1-9]|[1-9][0-9]|[1-9][0-9][0-9]|[1-9][0-9][0-9][0-9]|[1-9][0-9][0-9][0-9][0-9]) ;; - *) - func_error "AGE '$age' must be a nonnegative integer" - func_fatal_error "'$vinfo' is not valid version information" - ;; - esac - - if test "$age" -gt "$current"; then - func_error "AGE '$age' is greater than the current interface number '$current'" - func_fatal_error "'$vinfo' is not valid version information" - fi - - # Calculate the version variables. - major= - versuffix= - verstring= - case $version_type in - none) ;; - - darwin) - # Like Linux, but with the current version available in - # verstring for coding it into the library header - func_arith $current - $age - major=.$func_arith_result - versuffix=$major.$age.$revision - # Darwin ld doesn't like 0 for these options... - func_arith $current + 1 - minor_current=$func_arith_result - xlcverstring="$wl-compatibility_version $wl$minor_current $wl-current_version $wl$minor_current.$revision" - verstring="-compatibility_version $minor_current -current_version $minor_current.$revision" - # On Darwin other compilers - case $CC in - nagfor*) - verstring="$wl-compatibility_version $wl$minor_current $wl-current_version $wl$minor_current.$revision" - ;; - *) - verstring="-compatibility_version $minor_current -current_version $minor_current.$revision" - ;; - esac - ;; - - freebsd-aout) - major=.$current - versuffix=.$current.$revision - ;; - - freebsd-elf) - func_arith $current - $age - major=.$func_arith_result - versuffix=$major.$age.$revision - ;; - - irix | nonstopux) - if test no = "$lt_irix_increment"; then - func_arith $current - $age - else - func_arith $current - $age + 1 - fi - major=$func_arith_result - - case $version_type in - nonstopux) verstring_prefix=nonstopux ;; - *) verstring_prefix=sgi ;; - esac - verstring=$verstring_prefix$major.$revision - - # Add in all the interfaces that we are compatible with. - loop=$revision - while test 0 -ne "$loop"; do - func_arith $revision - $loop - iface=$func_arith_result - func_arith $loop - 1 - loop=$func_arith_result - verstring=$verstring_prefix$major.$iface:$verstring - done - - # Before this point, $major must not contain '.'. - major=.$major - versuffix=$major.$revision - ;; - - linux) # correct to gnu/linux during the next big refactor - func_arith $current - $age - major=.$func_arith_result - versuffix=$major.$age.$revision - ;; - - osf) - func_arith $current - $age - major=.$func_arith_result - versuffix=.$current.$age.$revision - verstring=$current.$age.$revision - - # Add in all the interfaces that we are compatible with. - loop=$age - while test 0 -ne "$loop"; do - func_arith $current - $loop - iface=$func_arith_result - func_arith $loop - 1 - loop=$func_arith_result - verstring=$verstring:$iface.0 - done - - # Make executables depend on our current version. - func_append verstring ":$current.0" - ;; - - qnx) - major=.$current - versuffix=.$current - ;; - - sco) - major=.$current - versuffix=.$current - ;; - - sunos) - major=.$current - versuffix=.$current.$revision - ;; - - windows) - # Use '-' rather than '.', since we only want one - # extension on DOS 8.3 file systems. - func_arith $current - $age - major=$func_arith_result - versuffix=-$major - ;; - - *) - func_fatal_configuration "unknown library version type '$version_type'" - ;; - esac - - # Clear the version info if we defaulted, and they specified a release. - if test -z "$vinfo" && test -n "$release"; then - major= - case $version_type in - darwin) - # we can't check for "0.0" in archive_cmds due to quoting - # problems, so we reset it completely - verstring= - ;; - *) - verstring=0.0 - ;; - esac - if test no = "$need_version"; then - versuffix= - else - versuffix=.0.0 - fi - fi - - # Remove version info from name if versioning should be avoided - if test yes,no = "$avoid_version,$need_version"; then - major= - versuffix= - verstring= - fi - - # Check to see if the archive will have undefined symbols. - if test yes = "$allow_undefined"; then - if test unsupported = "$allow_undefined_flag"; then - if test yes = "$build_old_libs"; then - func_warning "undefined symbols not allowed in $host shared libraries; building static only" - build_libtool_libs=no - else - func_fatal_error "can't build $host shared library unless -no-undefined is specified" - fi - fi - else - # Don't allow undefined symbols. - allow_undefined_flag=$no_undefined_flag - fi - - fi - - func_generate_dlsyms "$libname" "$libname" : - func_append libobjs " $symfileobj" - test " " = "$libobjs" && libobjs= - - if test relink != "$opt_mode"; then - # Remove our outputs, but don't remove object files since they - # may have been created when compiling PIC objects. - removelist= - tempremovelist=`$ECHO "$output_objdir/*"` - for p in $tempremovelist; do - case $p in - *.$objext | *.gcno) - ;; - $output_objdir/$outputname | $output_objdir/$libname.* | $output_objdir/$libname$release.*) - if test -n "$precious_files_regex"; then - if $ECHO "$p" | $EGREP -e "$precious_files_regex" >/dev/null 2>&1 - then - continue - fi - fi - func_append removelist " $p" - ;; - *) ;; - esac - done - test -n "$removelist" && \ - func_show_eval "${RM}r \$removelist" - fi - - # Now set the variables for building old libraries. - if test yes = "$build_old_libs" && test convenience != "$build_libtool_libs"; then - func_append oldlibs " $output_objdir/$libname.$libext" - - # Transform .lo files to .o files. - oldobjs="$objs "`$ECHO "$libobjs" | $SP2NL | $SED "/\.$libext$/d; $lo2o" | $NL2SP` - fi - - # Eliminate all temporary directories. - #for path in $notinst_path; do - # lib_search_path=`$ECHO "$lib_search_path " | $SED "s% $path % %g"` - # deplibs=`$ECHO "$deplibs " | $SED "s% -L$path % %g"` - # dependency_libs=`$ECHO "$dependency_libs " | $SED "s% -L$path % %g"` - #done - - if test -n "$xrpath"; then - # If the user specified any rpath flags, then add them. - temp_xrpath= - for libdir in $xrpath; do - func_replace_sysroot "$libdir" - func_append temp_xrpath " -R$func_replace_sysroot_result" - case "$finalize_rpath " in - *" $libdir "*) ;; - *) func_append finalize_rpath " $libdir" ;; - esac - done - if test yes != "$hardcode_into_libs" || test yes = "$build_old_libs"; then - dependency_libs="$temp_xrpath $dependency_libs" - fi - fi - - # Make sure dlfiles contains only unique files that won't be dlpreopened - old_dlfiles=$dlfiles - dlfiles= - for lib in $old_dlfiles; do - case " $dlprefiles $dlfiles " in - *" $lib "*) ;; - *) func_append dlfiles " $lib" ;; - esac - done - - # Make sure dlprefiles contains only unique files - old_dlprefiles=$dlprefiles - dlprefiles= - for lib in $old_dlprefiles; do - case "$dlprefiles " in - *" $lib "*) ;; - *) func_append dlprefiles " $lib" ;; - esac - done - - if test yes = "$build_libtool_libs"; then - if test -n "$rpath"; then - case $host in - *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-*-beos* | *-cegcc* | *-*-haiku*) - # these systems don't actually have a c library (as such)! - ;; - *-*-rhapsody* | *-*-darwin1.[012]) - # Rhapsody C library is in the System framework - func_append deplibs " System.ltframework" - ;; - *-*-netbsd*) - # Don't link with libc until the a.out ld.so is fixed. - ;; - *-*-openbsd* | *-*-freebsd* | *-*-dragonfly*) - # Do not include libc due to us having libc/libc_r. - ;; - *-*-sco3.2v5* | *-*-sco5v6*) - # Causes problems with __ctype - ;; - *-*-sysv4.2uw2* | *-*-sysv5* | *-*-unixware* | *-*-OpenUNIX*) - # Compiler inserts libc in the correct place for threads to work - ;; - *) - # Add libc to deplibs on all other systems if necessary. - if test yes = "$build_libtool_need_lc"; then - func_append deplibs " -lc" - fi - ;; - esac - fi - - # Transform deplibs into only deplibs that can be linked in shared. - name_save=$name - libname_save=$libname - release_save=$release - versuffix_save=$versuffix - major_save=$major - # I'm not sure if I'm treating the release correctly. I think - # release should show up in the -l (ie -lgmp5) so we don't want to - # add it in twice. Is that correct? - release= - versuffix= - major= - newdeplibs= - droppeddeps=no - case $deplibs_check_method in - pass_all) - # Don't check for shared/static. Everything works. - # This might be a little naive. We might want to check - # whether the library exists or not. But this is on - # osf3 & osf4 and I'm not really sure... Just - # implementing what was already the behavior. - newdeplibs=$deplibs - ;; - test_compile) - # This code stresses the "libraries are programs" paradigm to its - # limits. Maybe even breaks it. We compile a program, linking it - # against the deplibs as a proxy for the library. Then we can check - # whether they linked in statically or dynamically with ldd. - $opt_dry_run || $RM conftest.c - cat > conftest.c </dev/null` - $nocaseglob - else - potential_libs=`ls $i/$libnameglob[.-]* 2>/dev/null` - fi - for potent_lib in $potential_libs; do - # Follow soft links. - if ls -lLd "$potent_lib" 2>/dev/null | - $GREP " -> " >/dev/null; then - continue - fi - # The statement above tries to avoid entering an - # endless loop below, in case of cyclic links. - # We might still enter an endless loop, since a link - # loop can be closed while we follow links, - # but so what? - potlib=$potent_lib - while test -h "$potlib" 2>/dev/null; do - potliblink=`ls -ld $potlib | $SED 's/.* -> //'` - case $potliblink in - [\\/]* | [A-Za-z]:[\\/]*) potlib=$potliblink;; - *) potlib=`$ECHO "$potlib" | $SED 's|[^/]*$||'`"$potliblink";; - esac - done - if eval $file_magic_cmd \"\$potlib\" 2>/dev/null | - $SED -e 10q | - $EGREP "$file_magic_regex" > /dev/null; then - func_append newdeplibs " $a_deplib" - a_deplib= - break 2 - fi - done - done - fi - if test -n "$a_deplib"; then - droppeddeps=yes - echo - $ECHO "*** Warning: linker path does not have real file for library $a_deplib." - echo "*** I have the capability to make that library automatically link in when" - echo "*** you link to this library. But I can only do this if you have a" - echo "*** shared version of the library, which you do not appear to have" - echo "*** because I did check the linker path looking for a file starting" - if test -z "$potlib"; then - $ECHO "*** with $libname but no candidates were found. (...for file magic test)" - else - $ECHO "*** with $libname and none of the candidates passed a file format test" - $ECHO "*** using a file magic. Last file checked: $potlib" - fi - fi - ;; - *) - # Add a -L argument. - func_append newdeplibs " $a_deplib" - ;; - esac - done # Gone through all deplibs. - ;; - match_pattern*) - set dummy $deplibs_check_method; shift - match_pattern_regex=`expr "$deplibs_check_method" : "$1 \(.*\)"` - for a_deplib in $deplibs; do - case $a_deplib in - -l*) - func_stripname -l '' "$a_deplib" - name=$func_stripname_result - if test yes = "$allow_libtool_libs_with_static_runtimes"; then - case " $predeps $postdeps " in - *" $a_deplib "*) - func_append newdeplibs " $a_deplib" - a_deplib= - ;; - esac - fi - if test -n "$a_deplib"; then - libname=`eval "\\$ECHO \"$libname_spec\""` - for i in $lib_search_path $sys_lib_search_path $shlib_search_path; do - potential_libs=`ls $i/$libname[.-]* 2>/dev/null` - for potent_lib in $potential_libs; do - potlib=$potent_lib # see symlink-check above in file_magic test - if eval "\$ECHO \"$potent_lib\"" 2>/dev/null | $SED 10q | \ - $EGREP "$match_pattern_regex" > /dev/null; then - func_append newdeplibs " $a_deplib" - a_deplib= - break 2 - fi - done - done - fi - if test -n "$a_deplib"; then - droppeddeps=yes - echo - $ECHO "*** Warning: linker path does not have real file for library $a_deplib." - echo "*** I have the capability to make that library automatically link in when" - echo "*** you link to this library. But I can only do this if you have a" - echo "*** shared version of the library, which you do not appear to have" - echo "*** because I did check the linker path looking for a file starting" - if test -z "$potlib"; then - $ECHO "*** with $libname but no candidates were found. (...for regex pattern test)" - else - $ECHO "*** with $libname and none of the candidates passed a file format test" - $ECHO "*** using a regex pattern. Last file checked: $potlib" - fi - fi - ;; - *) - # Add a -L argument. - func_append newdeplibs " $a_deplib" - ;; - esac - done # Gone through all deplibs. - ;; - none | unknown | *) - newdeplibs= - tmp_deplibs=`$ECHO " $deplibs" | $SED 's/ -lc$//; s/ -[LR][^ ]*//g'` - if test yes = "$allow_libtool_libs_with_static_runtimes"; then - for i in $predeps $postdeps; do - # can't use Xsed below, because $i might contain '/' - tmp_deplibs=`$ECHO " $tmp_deplibs" | $SED "s|$i||"` - done - fi - case $tmp_deplibs in - *[!\ \ ]*) - echo - if test none = "$deplibs_check_method"; then - echo "*** Warning: inter-library dependencies are not supported in this platform." - else - echo "*** Warning: inter-library dependencies are not known to be supported." - fi - echo "*** All declared inter-library dependencies are being dropped." - droppeddeps=yes - ;; - esac - ;; - esac - versuffix=$versuffix_save - major=$major_save - release=$release_save - libname=$libname_save - name=$name_save - - case $host in - *-*-rhapsody* | *-*-darwin1.[012]) - # On Rhapsody replace the C library with the System framework - newdeplibs=`$ECHO " $newdeplibs" | $SED 's/ -lc / System.ltframework /'` - ;; - esac - - if test yes = "$droppeddeps"; then - if test yes = "$module"; then - echo - echo "*** Warning: libtool could not satisfy all declared inter-library" - $ECHO "*** dependencies of module $libname. Therefore, libtool will create" - echo "*** a static module, that should work as long as the dlopening" - echo "*** application is linked with the -dlopen flag." - if test -z "$global_symbol_pipe"; then - echo - echo "*** However, this would only work if libtool was able to extract symbol" - echo "*** lists from a program, using 'nm' or equivalent, but libtool could" - echo "*** not find such a program. So, this module is probably useless." - echo "*** 'nm' from GNU binutils and a full rebuild may help." - fi - if test no = "$build_old_libs"; then - oldlibs=$output_objdir/$libname.$libext - build_libtool_libs=module - build_old_libs=yes - else - build_libtool_libs=no - fi - else - echo "*** The inter-library dependencies that have been dropped here will be" - echo "*** automatically added whenever a program is linked with this library" - echo "*** or is declared to -dlopen it." - - if test no = "$allow_undefined"; then - echo - echo "*** Since this library must not contain undefined symbols," - echo "*** because either the platform does not support them or" - echo "*** it was explicitly requested with -no-undefined," - echo "*** libtool will only create a static version of it." - if test no = "$build_old_libs"; then - oldlibs=$output_objdir/$libname.$libext - build_libtool_libs=module - build_old_libs=yes - else - build_libtool_libs=no - fi - fi - fi - fi - # Done checking deplibs! - deplibs=$newdeplibs - fi - # Time to change all our "foo.ltframework" stuff back to "-framework foo" - case $host in - *-*-darwin*) - newdeplibs=`$ECHO " $newdeplibs" | $SED 's% \([^ $]*\).ltframework% -framework \1%g'` - new_inherited_linker_flags=`$ECHO " $new_inherited_linker_flags" | $SED 's% \([^ $]*\).ltframework% -framework \1%g'` - deplibs=`$ECHO " $deplibs" | $SED 's% \([^ $]*\).ltframework% -framework \1%g'` - ;; - esac - - # move library search paths that coincide with paths to not yet - # installed libraries to the beginning of the library search list - new_libs= - for path in $notinst_path; do - case " $new_libs " in - *" -L$path/$objdir "*) ;; - *) - case " $deplibs " in - *" -L$path/$objdir "*) - func_append new_libs " -L$path/$objdir" ;; - esac - ;; - esac - done - for deplib in $deplibs; do - case $deplib in - -L*) - case " $new_libs " in - *" $deplib "*) ;; - *) func_append new_libs " $deplib" ;; - esac - ;; - *) func_append new_libs " $deplib" ;; - esac - done - deplibs=$new_libs - - # All the library-specific variables (install_libdir is set above). - library_names= - old_library= - dlname= - - # Test again, we may have decided not to build it any more - if test yes = "$build_libtool_libs"; then - # Remove $wl instances when linking with ld. - # FIXME: should test the right _cmds variable. - case $archive_cmds in - *\$LD\ *) wl= ;; - esac - if test yes = "$hardcode_into_libs"; then - # Hardcode the library paths - hardcode_libdirs= - dep_rpath= - rpath=$finalize_rpath - test relink = "$opt_mode" || rpath=$compile_rpath$rpath - for libdir in $rpath; do - if test -n "$hardcode_libdir_flag_spec"; then - if test -n "$hardcode_libdir_separator"; then - func_replace_sysroot "$libdir" - libdir=$func_replace_sysroot_result - if test -z "$hardcode_libdirs"; then - hardcode_libdirs=$libdir - else - # Just accumulate the unique libdirs. - case $hardcode_libdir_separator$hardcode_libdirs$hardcode_libdir_separator in - *"$hardcode_libdir_separator$libdir$hardcode_libdir_separator"*) - ;; - *) - func_append hardcode_libdirs "$hardcode_libdir_separator$libdir" - ;; - esac - fi - else - eval flag=\"$hardcode_libdir_flag_spec\" - func_append dep_rpath " $flag" - fi - elif test -n "$runpath_var"; then - case "$perm_rpath " in - *" $libdir "*) ;; - *) func_append perm_rpath " $libdir" ;; - esac - fi - done - # Substitute the hardcoded libdirs into the rpath. - if test -n "$hardcode_libdir_separator" && - test -n "$hardcode_libdirs"; then - libdir=$hardcode_libdirs - eval "dep_rpath=\"$hardcode_libdir_flag_spec\"" - fi - if test -n "$runpath_var" && test -n "$perm_rpath"; then - # We should set the runpath_var. - rpath= - for dir in $perm_rpath; do - func_append rpath "$dir:" - done - eval "$runpath_var='$rpath\$$runpath_var'; export $runpath_var" - fi - test -n "$dep_rpath" && deplibs="$dep_rpath $deplibs" - fi - - shlibpath=$finalize_shlibpath - test relink = "$opt_mode" || shlibpath=$compile_shlibpath$shlibpath - if test -n "$shlibpath"; then - eval "$shlibpath_var='$shlibpath\$$shlibpath_var'; export $shlibpath_var" - fi - - # Get the real and link names of the library. - eval shared_ext=\"$shrext_cmds\" - eval library_names=\"$library_names_spec\" - set dummy $library_names - shift - realname=$1 - shift - - if test -n "$soname_spec"; then - eval soname=\"$soname_spec\" - else - soname=$realname - fi - if test -z "$dlname"; then - dlname=$soname - fi - - lib=$output_objdir/$realname - linknames= - for link - do - func_append linknames " $link" - done - - # Use standard objects if they are pic - test -z "$pic_flag" && libobjs=`$ECHO "$libobjs" | $SP2NL | $SED "$lo2o" | $NL2SP` - test "X$libobjs" = "X " && libobjs= - - delfiles= - if test -n "$export_symbols" && test -n "$include_expsyms"; then - $opt_dry_run || cp "$export_symbols" "$output_objdir/$libname.uexp" - export_symbols=$output_objdir/$libname.uexp - func_append delfiles " $export_symbols" - fi - - orig_export_symbols= - case $host_os in - cygwin* | mingw* | cegcc*) - if test -n "$export_symbols" && test -z "$export_symbols_regex"; then - # exporting using user supplied symfile - func_dll_def_p "$export_symbols" || { - # and it's NOT already a .def file. Must figure out - # which of the given symbols are data symbols and tag - # them as such. So, trigger use of export_symbols_cmds. - # export_symbols gets reassigned inside the "prepare - # the list of exported symbols" if statement, so the - # include_expsyms logic still works. - orig_export_symbols=$export_symbols - export_symbols= - always_export_symbols=yes - } - fi - ;; - esac - - # Prepare the list of exported symbols - if test -z "$export_symbols"; then - if test yes = "$always_export_symbols" || test -n "$export_symbols_regex"; then - func_verbose "generating symbol list for '$libname.la'" - export_symbols=$output_objdir/$libname.exp - $opt_dry_run || $RM $export_symbols - cmds=$export_symbols_cmds - save_ifs=$IFS; IFS='~' - for cmd1 in $cmds; do - IFS=$save_ifs - # Take the normal branch if the nm_file_list_spec branch - # doesn't work or if tool conversion is not needed. - case $nm_file_list_spec~$to_tool_file_cmd in - *~func_convert_file_noop | *~func_convert_file_msys_to_w32 | ~*) - try_normal_branch=yes - eval cmd=\"$cmd1\" - func_len " $cmd" - len=$func_len_result - ;; - *) - try_normal_branch=no - ;; - esac - if test yes = "$try_normal_branch" \ - && { test "$len" -lt "$max_cmd_len" \ - || test "$max_cmd_len" -le -1; } - then - func_show_eval "$cmd" 'exit $?' - skipped_export=false - elif test -n "$nm_file_list_spec"; then - func_basename "$output" - output_la=$func_basename_result - save_libobjs=$libobjs - save_output=$output - output=$output_objdir/$output_la.nm - func_to_tool_file "$output" - libobjs=$nm_file_list_spec$func_to_tool_file_result - func_append delfiles " $output" - func_verbose "creating $NM input file list: $output" - for obj in $save_libobjs; do - func_to_tool_file "$obj" - $ECHO "$func_to_tool_file_result" - done > "$output" - eval cmd=\"$cmd1\" - func_show_eval "$cmd" 'exit $?' - output=$save_output - libobjs=$save_libobjs - skipped_export=false - else - # The command line is too long to execute in one step. - func_verbose "using reloadable object file for export list..." - skipped_export=: - # Break out early, otherwise skipped_export may be - # set to false by a later but shorter cmd. - break - fi - done - IFS=$save_ifs - if test -n "$export_symbols_regex" && test : != "$skipped_export"; then - func_show_eval '$EGREP -e "$export_symbols_regex" "$export_symbols" > "${export_symbols}T"' - func_show_eval '$MV "${export_symbols}T" "$export_symbols"' - fi - fi - fi - - if test -n "$export_symbols" && test -n "$include_expsyms"; then - tmp_export_symbols=$export_symbols - test -n "$orig_export_symbols" && tmp_export_symbols=$orig_export_symbols - $opt_dry_run || eval '$ECHO "$include_expsyms" | $SP2NL >> "$tmp_export_symbols"' - fi - - if test : != "$skipped_export" && test -n "$orig_export_symbols"; then - # The given exports_symbols file has to be filtered, so filter it. - func_verbose "filter symbol list for '$libname.la' to tag DATA exports" - # FIXME: $output_objdir/$libname.filter potentially contains lots of - # 's' commands, which not all seds can handle. GNU sed should be fine - # though. Also, the filter scales superlinearly with the number of - # global variables. join(1) would be nice here, but unfortunately - # isn't a blessed tool. - $opt_dry_run || $SED -e '/[ ,]DATA/!d;s,\(.*\)\([ \,].*\),s|^\1$|\1\2|,' < $export_symbols > $output_objdir/$libname.filter - func_append delfiles " $export_symbols $output_objdir/$libname.filter" - export_symbols=$output_objdir/$libname.def - $opt_dry_run || $SED -f $output_objdir/$libname.filter < $orig_export_symbols > $export_symbols - fi - - tmp_deplibs= - for test_deplib in $deplibs; do - case " $convenience " in - *" $test_deplib "*) ;; - *) - func_append tmp_deplibs " $test_deplib" - ;; - esac - done - deplibs=$tmp_deplibs - - if test -n "$convenience"; then - if test -n "$whole_archive_flag_spec" && - test yes = "$compiler_needs_object" && - test -z "$libobjs"; then - # extract the archives, so we have objects to list. - # TODO: could optimize this to just extract one archive. - whole_archive_flag_spec= - fi - if test -n "$whole_archive_flag_spec"; then - save_libobjs=$libobjs - eval libobjs=\"\$libobjs $whole_archive_flag_spec\" - test "X$libobjs" = "X " && libobjs= - else - gentop=$output_objdir/${outputname}x - func_append generated " $gentop" - - func_extract_archives $gentop $convenience - func_append libobjs " $func_extract_archives_result" - test "X$libobjs" = "X " && libobjs= - fi - fi - - if test yes = "$thread_safe" && test -n "$thread_safe_flag_spec"; then - eval flag=\"$thread_safe_flag_spec\" - func_append linker_flags " $flag" - fi - - # Make a backup of the uninstalled library when relinking - if test relink = "$opt_mode"; then - $opt_dry_run || eval '(cd $output_objdir && $RM ${realname}U && $MV $realname ${realname}U)' || exit $? - fi - - # Do each of the archive commands. - if test yes = "$module" && test -n "$module_cmds"; then - if test -n "$export_symbols" && test -n "$module_expsym_cmds"; then - eval test_cmds=\"$module_expsym_cmds\" - cmds=$module_expsym_cmds - else - eval test_cmds=\"$module_cmds\" - cmds=$module_cmds - fi - else - if test -n "$export_symbols" && test -n "$archive_expsym_cmds"; then - eval test_cmds=\"$archive_expsym_cmds\" - cmds=$archive_expsym_cmds - else - eval test_cmds=\"$archive_cmds\" - cmds=$archive_cmds - fi - fi - - if test : != "$skipped_export" && - func_len " $test_cmds" && - len=$func_len_result && - test "$len" -lt "$max_cmd_len" || test "$max_cmd_len" -le -1; then - : - else - # The command line is too long to link in one step, link piecewise - # or, if using GNU ld and skipped_export is not :, use a linker - # script. - - # Save the value of $output and $libobjs because we want to - # use them later. If we have whole_archive_flag_spec, we - # want to use save_libobjs as it was before - # whole_archive_flag_spec was expanded, because we can't - # assume the linker understands whole_archive_flag_spec. - # This may have to be revisited, in case too many - # convenience libraries get linked in and end up exceeding - # the spec. - if test -z "$convenience" || test -z "$whole_archive_flag_spec"; then - save_libobjs=$libobjs - fi - save_output=$output - func_basename "$output" - output_la=$func_basename_result - - # Clear the reloadable object creation command queue and - # initialize k to one. - test_cmds= - concat_cmds= - objlist= - last_robj= - k=1 - - if test -n "$save_libobjs" && test : != "$skipped_export" && test yes = "$with_gnu_ld"; then - output=$output_objdir/$output_la.lnkscript - func_verbose "creating GNU ld script: $output" - echo 'INPUT (' > $output - for obj in $save_libobjs - do - func_to_tool_file "$obj" - $ECHO "$func_to_tool_file_result" >> $output - done - echo ')' >> $output - func_append delfiles " $output" - func_to_tool_file "$output" - output=$func_to_tool_file_result - elif test -n "$save_libobjs" && test : != "$skipped_export" && test -n "$file_list_spec"; then - output=$output_objdir/$output_la.lnk - func_verbose "creating linker input file list: $output" - : > $output - set x $save_libobjs - shift - firstobj= - if test yes = "$compiler_needs_object"; then - firstobj="$1 " - shift - fi - for obj - do - func_to_tool_file "$obj" - $ECHO "$func_to_tool_file_result" >> $output - done - func_append delfiles " $output" - func_to_tool_file "$output" - output=$firstobj\"$file_list_spec$func_to_tool_file_result\" - else - if test -n "$save_libobjs"; then - func_verbose "creating reloadable object files..." - output=$output_objdir/$output_la-$k.$objext - eval test_cmds=\"$reload_cmds\" - func_len " $test_cmds" - len0=$func_len_result - len=$len0 - - # Loop over the list of objects to be linked. - for obj in $save_libobjs - do - func_len " $obj" - func_arith $len + $func_len_result - len=$func_arith_result - if test -z "$objlist" || - test "$len" -lt "$max_cmd_len"; then - func_append objlist " $obj" - else - # The command $test_cmds is almost too long, add a - # command to the queue. - if test 1 -eq "$k"; then - # The first file doesn't have a previous command to add. - reload_objs=$objlist - eval concat_cmds=\"$reload_cmds\" - else - # All subsequent reloadable object files will link in - # the last one created. - reload_objs="$objlist $last_robj" - eval concat_cmds=\"\$concat_cmds~$reload_cmds~\$RM $last_robj\" - fi - last_robj=$output_objdir/$output_la-$k.$objext - func_arith $k + 1 - k=$func_arith_result - output=$output_objdir/$output_la-$k.$objext - objlist=" $obj" - func_len " $last_robj" - func_arith $len0 + $func_len_result - len=$func_arith_result - fi - done - # Handle the remaining objects by creating one last - # reloadable object file. All subsequent reloadable object - # files will link in the last one created. - test -z "$concat_cmds" || concat_cmds=$concat_cmds~ - reload_objs="$objlist $last_robj" - eval concat_cmds=\"\$concat_cmds$reload_cmds\" - if test -n "$last_robj"; then - eval concat_cmds=\"\$concat_cmds~\$RM $last_robj\" - fi - func_append delfiles " $output" - - else - output= - fi - - ${skipped_export-false} && { - func_verbose "generating symbol list for '$libname.la'" - export_symbols=$output_objdir/$libname.exp - $opt_dry_run || $RM $export_symbols - libobjs=$output - # Append the command to create the export file. - test -z "$concat_cmds" || concat_cmds=$concat_cmds~ - eval concat_cmds=\"\$concat_cmds$export_symbols_cmds\" - if test -n "$last_robj"; then - eval concat_cmds=\"\$concat_cmds~\$RM $last_robj\" - fi - } - - test -n "$save_libobjs" && - func_verbose "creating a temporary reloadable object file: $output" - - # Loop through the commands generated above and execute them. - save_ifs=$IFS; IFS='~' - for cmd in $concat_cmds; do - IFS=$save_ifs - $opt_quiet || { - func_quote_for_expand "$cmd" - eval "func_echo $func_quote_for_expand_result" - } - $opt_dry_run || eval "$cmd" || { - lt_exit=$? - - # Restore the uninstalled library and exit - if test relink = "$opt_mode"; then - ( cd "$output_objdir" && \ - $RM "${realname}T" && \ - $MV "${realname}U" "$realname" ) - fi - - exit $lt_exit - } - done - IFS=$save_ifs - - if test -n "$export_symbols_regex" && ${skipped_export-false}; then - func_show_eval '$EGREP -e "$export_symbols_regex" "$export_symbols" > "${export_symbols}T"' - func_show_eval '$MV "${export_symbols}T" "$export_symbols"' - fi - fi - - ${skipped_export-false} && { - if test -n "$export_symbols" && test -n "$include_expsyms"; then - tmp_export_symbols=$export_symbols - test -n "$orig_export_symbols" && tmp_export_symbols=$orig_export_symbols - $opt_dry_run || eval '$ECHO "$include_expsyms" | $SP2NL >> "$tmp_export_symbols"' - fi - - if test -n "$orig_export_symbols"; then - # The given exports_symbols file has to be filtered, so filter it. - func_verbose "filter symbol list for '$libname.la' to tag DATA exports" - # FIXME: $output_objdir/$libname.filter potentially contains lots of - # 's' commands, which not all seds can handle. GNU sed should be fine - # though. Also, the filter scales superlinearly with the number of - # global variables. join(1) would be nice here, but unfortunately - # isn't a blessed tool. - $opt_dry_run || $SED -e '/[ ,]DATA/!d;s,\(.*\)\([ \,].*\),s|^\1$|\1\2|,' < $export_symbols > $output_objdir/$libname.filter - func_append delfiles " $export_symbols $output_objdir/$libname.filter" - export_symbols=$output_objdir/$libname.def - $opt_dry_run || $SED -f $output_objdir/$libname.filter < $orig_export_symbols > $export_symbols - fi - } - - libobjs=$output - # Restore the value of output. - output=$save_output - - if test -n "$convenience" && test -n "$whole_archive_flag_spec"; then - eval libobjs=\"\$libobjs $whole_archive_flag_spec\" - test "X$libobjs" = "X " && libobjs= - fi - # Expand the library linking commands again to reset the - # value of $libobjs for piecewise linking. - - # Do each of the archive commands. - if test yes = "$module" && test -n "$module_cmds"; then - if test -n "$export_symbols" && test -n "$module_expsym_cmds"; then - cmds=$module_expsym_cmds - else - cmds=$module_cmds - fi - else - if test -n "$export_symbols" && test -n "$archive_expsym_cmds"; then - cmds=$archive_expsym_cmds - else - cmds=$archive_cmds - fi - fi - fi - - if test -n "$delfiles"; then - # Append the command to remove temporary files to $cmds. - eval cmds=\"\$cmds~\$RM $delfiles\" - fi - - # Add any objects from preloaded convenience libraries - if test -n "$dlprefiles"; then - gentop=$output_objdir/${outputname}x - func_append generated " $gentop" - - func_extract_archives $gentop $dlprefiles - func_append libobjs " $func_extract_archives_result" - test "X$libobjs" = "X " && libobjs= - fi - - save_ifs=$IFS; IFS='~' - for cmd in $cmds; do - IFS=$sp$nl - eval cmd=\"$cmd\" - IFS=$save_ifs - $opt_quiet || { - func_quote_for_expand "$cmd" - eval "func_echo $func_quote_for_expand_result" - } - $opt_dry_run || eval "$cmd" || { - lt_exit=$? - - # Restore the uninstalled library and exit - if test relink = "$opt_mode"; then - ( cd "$output_objdir" && \ - $RM "${realname}T" && \ - $MV "${realname}U" "$realname" ) - fi - - exit $lt_exit - } - done - IFS=$save_ifs - - # Restore the uninstalled library and exit - if test relink = "$opt_mode"; then - $opt_dry_run || eval '(cd $output_objdir && $RM ${realname}T && $MV $realname ${realname}T && $MV ${realname}U $realname)' || exit $? - - if test -n "$convenience"; then - if test -z "$whole_archive_flag_spec"; then - func_show_eval '${RM}r "$gentop"' - fi - fi - - exit $EXIT_SUCCESS - fi - - # Create links to the real library. - for linkname in $linknames; do - if test "$realname" != "$linkname"; then - func_show_eval '(cd "$output_objdir" && $RM "$linkname" && $LN_S "$realname" "$linkname")' 'exit $?' - fi - done - - # If -module or -export-dynamic was specified, set the dlname. - if test yes = "$module" || test yes = "$export_dynamic"; then - # On all known operating systems, these are identical. - dlname=$soname - fi - fi - ;; - - obj) - if test -n "$dlfiles$dlprefiles" || test no != "$dlself"; then - func_warning "'-dlopen' is ignored for objects" - fi - - case " $deplibs" in - *\ -l* | *\ -L*) - func_warning "'-l' and '-L' are ignored for objects" ;; - esac - - test -n "$rpath" && \ - func_warning "'-rpath' is ignored for objects" - - test -n "$xrpath" && \ - func_warning "'-R' is ignored for objects" - - test -n "$vinfo" && \ - func_warning "'-version-info' is ignored for objects" - - test -n "$release" && \ - func_warning "'-release' is ignored for objects" - - case $output in - *.lo) - test -n "$objs$old_deplibs" && \ - func_fatal_error "cannot build library object '$output' from non-libtool objects" - - libobj=$output - func_lo2o "$libobj" - obj=$func_lo2o_result - ;; - *) - libobj= - obj=$output - ;; - esac - - # Delete the old objects. - $opt_dry_run || $RM $obj $libobj - - # Objects from convenience libraries. This assumes - # single-version convenience libraries. Whenever we create - # different ones for PIC/non-PIC, this we'll have to duplicate - # the extraction. - reload_conv_objs= - gentop= - # if reload_cmds runs $LD directly, get rid of -Wl from - # whole_archive_flag_spec and hope we can get by with turning comma - # into space. - case $reload_cmds in - *\$LD[\ \$]*) wl= ;; - esac - if test -n "$convenience"; then - if test -n "$whole_archive_flag_spec"; then - eval tmp_whole_archive_flags=\"$whole_archive_flag_spec\" - test -n "$wl" || tmp_whole_archive_flags=`$ECHO "$tmp_whole_archive_flags" | $SED 's|,| |g'` - reload_conv_objs=$reload_objs\ $tmp_whole_archive_flags - else - gentop=$output_objdir/${obj}x - func_append generated " $gentop" - - func_extract_archives $gentop $convenience - reload_conv_objs="$reload_objs $func_extract_archives_result" - fi - fi - - # If we're not building shared, we need to use non_pic_objs - test yes = "$build_libtool_libs" || libobjs=$non_pic_objects - - # Create the old-style object. - reload_objs=$objs$old_deplibs' '`$ECHO "$libobjs" | $SP2NL | $SED "/\.$libext$/d; /\.lib$/d; $lo2o" | $NL2SP`' '$reload_conv_objs - - output=$obj - func_execute_cmds "$reload_cmds" 'exit $?' - - # Exit if we aren't doing a library object file. - if test -z "$libobj"; then - if test -n "$gentop"; then - func_show_eval '${RM}r "$gentop"' - fi - - exit $EXIT_SUCCESS - fi - - test yes = "$build_libtool_libs" || { - if test -n "$gentop"; then - func_show_eval '${RM}r "$gentop"' - fi - - # Create an invalid libtool object if no PIC, so that we don't - # accidentally link it into a program. - # $show "echo timestamp > $libobj" - # $opt_dry_run || eval "echo timestamp > $libobj" || exit $? - exit $EXIT_SUCCESS - } - - if test -n "$pic_flag" || test default != "$pic_mode"; then - # Only do commands if we really have different PIC objects. - reload_objs="$libobjs $reload_conv_objs" - output=$libobj - func_execute_cmds "$reload_cmds" 'exit $?' - fi - - if test -n "$gentop"; then - func_show_eval '${RM}r "$gentop"' - fi - - exit $EXIT_SUCCESS - ;; - - prog) - case $host in - *cygwin*) func_stripname '' '.exe' "$output" - output=$func_stripname_result.exe;; - esac - test -n "$vinfo" && \ - func_warning "'-version-info' is ignored for programs" - - test -n "$release" && \ - func_warning "'-release' is ignored for programs" - - $preload \ - && test unknown,unknown,unknown = "$dlopen_support,$dlopen_self,$dlopen_self_static" \ - && func_warning "'LT_INIT([dlopen])' not used. Assuming no dlopen support." - - case $host in - *-*-rhapsody* | *-*-darwin1.[012]) - # On Rhapsody replace the C library is the System framework - compile_deplibs=`$ECHO " $compile_deplibs" | $SED 's/ -lc / System.ltframework /'` - finalize_deplibs=`$ECHO " $finalize_deplibs" | $SED 's/ -lc / System.ltframework /'` - ;; - esac - - case $host in - *-*-darwin*) - # Don't allow lazy linking, it breaks C++ global constructors - # But is supposedly fixed on 10.4 or later (yay!). - if test CXX = "$tagname"; then - case ${MACOSX_DEPLOYMENT_TARGET-10.0} in - 10.[0123]) - func_append compile_command " $wl-bind_at_load" - func_append finalize_command " $wl-bind_at_load" - ;; - esac - fi - # Time to change all our "foo.ltframework" stuff back to "-framework foo" - compile_deplibs=`$ECHO " $compile_deplibs" | $SED 's% \([^ $]*\).ltframework% -framework \1%g'` - finalize_deplibs=`$ECHO " $finalize_deplibs" | $SED 's% \([^ $]*\).ltframework% -framework \1%g'` - ;; - esac - - - # move library search paths that coincide with paths to not yet - # installed libraries to the beginning of the library search list - new_libs= - for path in $notinst_path; do - case " $new_libs " in - *" -L$path/$objdir "*) ;; - *) - case " $compile_deplibs " in - *" -L$path/$objdir "*) - func_append new_libs " -L$path/$objdir" ;; - esac - ;; - esac - done - for deplib in $compile_deplibs; do - case $deplib in - -L*) - case " $new_libs " in - *" $deplib "*) ;; - *) func_append new_libs " $deplib" ;; - esac - ;; - *) func_append new_libs " $deplib" ;; - esac - done - compile_deplibs=$new_libs - - - func_append compile_command " $compile_deplibs" - func_append finalize_command " $finalize_deplibs" - - if test -n "$rpath$xrpath"; then - # If the user specified any rpath flags, then add them. - for libdir in $rpath $xrpath; do - # This is the magic to use -rpath. - case "$finalize_rpath " in - *" $libdir "*) ;; - *) func_append finalize_rpath " $libdir" ;; - esac - done - fi - - # Now hardcode the library paths - rpath= - hardcode_libdirs= - for libdir in $compile_rpath $finalize_rpath; do - if test -n "$hardcode_libdir_flag_spec"; then - if test -n "$hardcode_libdir_separator"; then - if test -z "$hardcode_libdirs"; then - hardcode_libdirs=$libdir - else - # Just accumulate the unique libdirs. - case $hardcode_libdir_separator$hardcode_libdirs$hardcode_libdir_separator in - *"$hardcode_libdir_separator$libdir$hardcode_libdir_separator"*) - ;; - *) - func_append hardcode_libdirs "$hardcode_libdir_separator$libdir" - ;; - esac - fi - else - eval flag=\"$hardcode_libdir_flag_spec\" - func_append rpath " $flag" - fi - elif test -n "$runpath_var"; then - case "$perm_rpath " in - *" $libdir "*) ;; - *) func_append perm_rpath " $libdir" ;; - esac - fi - case $host in - *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-cegcc*) - testbindir=`$ECHO "$libdir" | $SED -e 's*/lib$*/bin*'` - case :$dllsearchpath: in - *":$libdir:"*) ;; - ::) dllsearchpath=$libdir;; - *) func_append dllsearchpath ":$libdir";; - esac - case :$dllsearchpath: in - *":$testbindir:"*) ;; - ::) dllsearchpath=$testbindir;; - *) func_append dllsearchpath ":$testbindir";; - esac - ;; - esac - done - # Substitute the hardcoded libdirs into the rpath. - if test -n "$hardcode_libdir_separator" && - test -n "$hardcode_libdirs"; then - libdir=$hardcode_libdirs - eval rpath=\" $hardcode_libdir_flag_spec\" - fi - compile_rpath=$rpath - - rpath= - hardcode_libdirs= - for libdir in $finalize_rpath; do - if test -n "$hardcode_libdir_flag_spec"; then - if test -n "$hardcode_libdir_separator"; then - if test -z "$hardcode_libdirs"; then - hardcode_libdirs=$libdir - else - # Just accumulate the unique libdirs. - case $hardcode_libdir_separator$hardcode_libdirs$hardcode_libdir_separator in - *"$hardcode_libdir_separator$libdir$hardcode_libdir_separator"*) - ;; - *) - func_append hardcode_libdirs "$hardcode_libdir_separator$libdir" - ;; - esac - fi - else - eval flag=\"$hardcode_libdir_flag_spec\" - func_append rpath " $flag" - fi - elif test -n "$runpath_var"; then - case "$finalize_perm_rpath " in - *" $libdir "*) ;; - *) func_append finalize_perm_rpath " $libdir" ;; - esac - fi - done - # Substitute the hardcoded libdirs into the rpath. - if test -n "$hardcode_libdir_separator" && - test -n "$hardcode_libdirs"; then - libdir=$hardcode_libdirs - eval rpath=\" $hardcode_libdir_flag_spec\" - fi - finalize_rpath=$rpath - - if test -n "$libobjs" && test yes = "$build_old_libs"; then - # Transform all the library objects into standard objects. - compile_command=`$ECHO "$compile_command" | $SP2NL | $SED "$lo2o" | $NL2SP` - finalize_command=`$ECHO "$finalize_command" | $SP2NL | $SED "$lo2o" | $NL2SP` - fi - - func_generate_dlsyms "$outputname" "@PROGRAM@" false - - # template prelinking step - if test -n "$prelink_cmds"; then - func_execute_cmds "$prelink_cmds" 'exit $?' - fi - - wrappers_required=: - case $host in - *cegcc* | *mingw32ce*) - # Disable wrappers for cegcc and mingw32ce hosts, we are cross compiling anyway. - wrappers_required=false - ;; - *cygwin* | *mingw* ) - test yes = "$build_libtool_libs" || wrappers_required=false - ;; - *) - if test no = "$need_relink" || test yes != "$build_libtool_libs"; then - wrappers_required=false - fi - ;; - esac - $wrappers_required || { - # Replace the output file specification. - compile_command=`$ECHO "$compile_command" | $SED 's%@OUTPUT@%'"$output"'%g'` - link_command=$compile_command$compile_rpath - - # We have no uninstalled library dependencies, so finalize right now. - exit_status=0 - func_show_eval "$link_command" 'exit_status=$?' - - if test -n "$postlink_cmds"; then - func_to_tool_file "$output" - postlink_cmds=`func_echo_all "$postlink_cmds" | $SED -e 's%@OUTPUT@%'"$output"'%g' -e 's%@TOOL_OUTPUT@%'"$func_to_tool_file_result"'%g'` - func_execute_cmds "$postlink_cmds" 'exit $?' - fi - - # Delete the generated files. - if test -f "$output_objdir/${outputname}S.$objext"; then - func_show_eval '$RM "$output_objdir/${outputname}S.$objext"' - fi - - exit $exit_status - } - - if test -n "$compile_shlibpath$finalize_shlibpath"; then - compile_command="$shlibpath_var=\"$compile_shlibpath$finalize_shlibpath\$$shlibpath_var\" $compile_command" - fi - if test -n "$finalize_shlibpath"; then - finalize_command="$shlibpath_var=\"$finalize_shlibpath\$$shlibpath_var\" $finalize_command" - fi - - compile_var= - finalize_var= - if test -n "$runpath_var"; then - if test -n "$perm_rpath"; then - # We should set the runpath_var. - rpath= - for dir in $perm_rpath; do - func_append rpath "$dir:" - done - compile_var="$runpath_var=\"$rpath\$$runpath_var\" " - fi - if test -n "$finalize_perm_rpath"; then - # We should set the runpath_var. - rpath= - for dir in $finalize_perm_rpath; do - func_append rpath "$dir:" - done - finalize_var="$runpath_var=\"$rpath\$$runpath_var\" " - fi - fi - - if test yes = "$no_install"; then - # We don't need to create a wrapper script. - link_command=$compile_var$compile_command$compile_rpath - # Replace the output file specification. - link_command=`$ECHO "$link_command" | $SED 's%@OUTPUT@%'"$output"'%g'` - # Delete the old output file. - $opt_dry_run || $RM $output - # Link the executable and exit - func_show_eval "$link_command" 'exit $?' - - if test -n "$postlink_cmds"; then - func_to_tool_file "$output" - postlink_cmds=`func_echo_all "$postlink_cmds" | $SED -e 's%@OUTPUT@%'"$output"'%g' -e 's%@TOOL_OUTPUT@%'"$func_to_tool_file_result"'%g'` - func_execute_cmds "$postlink_cmds" 'exit $?' - fi - - exit $EXIT_SUCCESS - fi - - case $hardcode_action,$fast_install in - relink,*) - # Fast installation is not supported - link_command=$compile_var$compile_command$compile_rpath - relink_command=$finalize_var$finalize_command$finalize_rpath - - func_warning "this platform does not like uninstalled shared libraries" - func_warning "'$output' will be relinked during installation" - ;; - *,yes) - link_command=$finalize_var$compile_command$finalize_rpath - relink_command=`$ECHO "$compile_var$compile_command$compile_rpath" | $SED 's%@OUTPUT@%\$progdir/\$file%g'` - ;; - *,no) - link_command=$compile_var$compile_command$compile_rpath - relink_command=$finalize_var$finalize_command$finalize_rpath - ;; - *,needless) - link_command=$finalize_var$compile_command$finalize_rpath - relink_command= - ;; - esac - - # Replace the output file specification. - link_command=`$ECHO "$link_command" | $SED 's%@OUTPUT@%'"$output_objdir/$outputname"'%g'` - - # Delete the old output files. - $opt_dry_run || $RM $output $output_objdir/$outputname $output_objdir/lt-$outputname - - func_show_eval "$link_command" 'exit $?' - - if test -n "$postlink_cmds"; then - func_to_tool_file "$output_objdir/$outputname" - postlink_cmds=`func_echo_all "$postlink_cmds" | $SED -e 's%@OUTPUT@%'"$output_objdir/$outputname"'%g' -e 's%@TOOL_OUTPUT@%'"$func_to_tool_file_result"'%g'` - func_execute_cmds "$postlink_cmds" 'exit $?' - fi - - # Now create the wrapper script. - func_verbose "creating $output" - - # Quote the relink command for shipping. - if test -n "$relink_command"; then - # Preserve any variables that may affect compiler behavior - for var in $variables_saved_for_relink; do - if eval test -z \"\${$var+set}\"; then - relink_command="{ test -z \"\${$var+set}\" || $lt_unset $var || { $var=; export $var; }; }; $relink_command" - elif eval var_value=\$$var; test -z "$var_value"; then - relink_command="$var=; export $var; $relink_command" - else - func_quote_for_eval "$var_value" - relink_command="$var=$func_quote_for_eval_result; export $var; $relink_command" - fi - done - relink_command="(cd `pwd`; $relink_command)" - relink_command=`$ECHO "$relink_command" | $SED "$sed_quote_subst"` - fi - - # Only actually do things if not in dry run mode. - $opt_dry_run || { - # win32 will think the script is a binary if it has - # a .exe suffix, so we strip it off here. - case $output in - *.exe) func_stripname '' '.exe' "$output" - output=$func_stripname_result ;; - esac - # test for cygwin because mv fails w/o .exe extensions - case $host in - *cygwin*) - exeext=.exe - func_stripname '' '.exe' "$outputname" - outputname=$func_stripname_result ;; - *) exeext= ;; - esac - case $host in - *cygwin* | *mingw* ) - func_dirname_and_basename "$output" "" "." - output_name=$func_basename_result - output_path=$func_dirname_result - cwrappersource=$output_path/$objdir/lt-$output_name.c - cwrapper=$output_path/$output_name.exe - $RM $cwrappersource $cwrapper - trap "$RM $cwrappersource $cwrapper; exit $EXIT_FAILURE" 1 2 15 - - func_emit_cwrapperexe_src > $cwrappersource - - # The wrapper executable is built using the $host compiler, - # because it contains $host paths and files. If cross- - # compiling, it, like the target executable, must be - # executed on the $host or under an emulation environment. - $opt_dry_run || { - $LTCC $LTCFLAGS -o $cwrapper $cwrappersource - $STRIP $cwrapper - } - - # Now, create the wrapper script for func_source use: - func_ltwrapper_scriptname $cwrapper - $RM $func_ltwrapper_scriptname_result - trap "$RM $func_ltwrapper_scriptname_result; exit $EXIT_FAILURE" 1 2 15 - $opt_dry_run || { - # note: this script will not be executed, so do not chmod. - if test "x$build" = "x$host"; then - $cwrapper --lt-dump-script > $func_ltwrapper_scriptname_result - else - func_emit_wrapper no > $func_ltwrapper_scriptname_result - fi - } - ;; - * ) - $RM $output - trap "$RM $output; exit $EXIT_FAILURE" 1 2 15 - - func_emit_wrapper no > $output - chmod +x $output - ;; - esac - } - exit $EXIT_SUCCESS - ;; - esac - - # See if we need to build an old-fashioned archive. - for oldlib in $oldlibs; do - - case $build_libtool_libs in - convenience) - oldobjs="$libobjs_save $symfileobj" - addlibs=$convenience - build_libtool_libs=no - ;; - module) - oldobjs=$libobjs_save - addlibs=$old_convenience - build_libtool_libs=no - ;; - *) - oldobjs="$old_deplibs $non_pic_objects" - $preload && test -f "$symfileobj" \ - && func_append oldobjs " $symfileobj" - addlibs=$old_convenience - ;; - esac - - if test -n "$addlibs"; then - gentop=$output_objdir/${outputname}x - func_append generated " $gentop" - - func_extract_archives $gentop $addlibs - func_append oldobjs " $func_extract_archives_result" - fi - - # Do each command in the archive commands. - if test -n "$old_archive_from_new_cmds" && test yes = "$build_libtool_libs"; then - cmds=$old_archive_from_new_cmds - else - - # Add any objects from preloaded convenience libraries - if test -n "$dlprefiles"; then - gentop=$output_objdir/${outputname}x - func_append generated " $gentop" - - func_extract_archives $gentop $dlprefiles - func_append oldobjs " $func_extract_archives_result" - fi - - # POSIX demands no paths to be encoded in archives. We have - # to avoid creating archives with duplicate basenames if we - # might have to extract them afterwards, e.g., when creating a - # static archive out of a convenience library, or when linking - # the entirety of a libtool archive into another (currently - # not supported by libtool). - if (for obj in $oldobjs - do - func_basename "$obj" - $ECHO "$func_basename_result" - done | sort | sort -uc >/dev/null 2>&1); then - : - else - echo "copying selected object files to avoid basename conflicts..." - gentop=$output_objdir/${outputname}x - func_append generated " $gentop" - func_mkdir_p "$gentop" - save_oldobjs=$oldobjs - oldobjs= - counter=1 - for obj in $save_oldobjs - do - func_basename "$obj" - objbase=$func_basename_result - case " $oldobjs " in - " ") oldobjs=$obj ;; - *[\ /]"$objbase "*) - while :; do - # Make sure we don't pick an alternate name that also - # overlaps. - newobj=lt$counter-$objbase - func_arith $counter + 1 - counter=$func_arith_result - case " $oldobjs " in - *[\ /]"$newobj "*) ;; - *) if test ! -f "$gentop/$newobj"; then break; fi ;; - esac - done - func_show_eval "ln $obj $gentop/$newobj || cp $obj $gentop/$newobj" - func_append oldobjs " $gentop/$newobj" - ;; - *) func_append oldobjs " $obj" ;; - esac - done - fi - func_to_tool_file "$oldlib" func_convert_file_msys_to_w32 - tool_oldlib=$func_to_tool_file_result - eval cmds=\"$old_archive_cmds\" - - func_len " $cmds" - len=$func_len_result - if test "$len" -lt "$max_cmd_len" || test "$max_cmd_len" -le -1; then - cmds=$old_archive_cmds - elif test -n "$archiver_list_spec"; then - func_verbose "using command file archive linking..." - for obj in $oldobjs - do - func_to_tool_file "$obj" - $ECHO "$func_to_tool_file_result" - done > $output_objdir/$libname.libcmd - func_to_tool_file "$output_objdir/$libname.libcmd" - oldobjs=" $archiver_list_spec$func_to_tool_file_result" - cmds=$old_archive_cmds - else - # the command line is too long to link in one step, link in parts - func_verbose "using piecewise archive linking..." - save_RANLIB=$RANLIB - RANLIB=: - objlist= - concat_cmds= - save_oldobjs=$oldobjs - oldobjs= - # Is there a better way of finding the last object in the list? - for obj in $save_oldobjs - do - last_oldobj=$obj - done - eval test_cmds=\"$old_archive_cmds\" - func_len " $test_cmds" - len0=$func_len_result - len=$len0 - for obj in $save_oldobjs - do - func_len " $obj" - func_arith $len + $func_len_result - len=$func_arith_result - func_append objlist " $obj" - if test "$len" -lt "$max_cmd_len"; then - : - else - # the above command should be used before it gets too long - oldobjs=$objlist - if test "$obj" = "$last_oldobj"; then - RANLIB=$save_RANLIB - fi - test -z "$concat_cmds" || concat_cmds=$concat_cmds~ - eval concat_cmds=\"\$concat_cmds$old_archive_cmds\" - objlist= - len=$len0 - fi - done - RANLIB=$save_RANLIB - oldobjs=$objlist - if test -z "$oldobjs"; then - eval cmds=\"\$concat_cmds\" - else - eval cmds=\"\$concat_cmds~\$old_archive_cmds\" - fi - fi - fi - func_execute_cmds "$cmds" 'exit $?' - done - - test -n "$generated" && \ - func_show_eval "${RM}r$generated" - - # Now create the libtool archive. - case $output in - *.la) - old_library= - test yes = "$build_old_libs" && old_library=$libname.$libext - func_verbose "creating $output" - - # Preserve any variables that may affect compiler behavior - for var in $variables_saved_for_relink; do - if eval test -z \"\${$var+set}\"; then - relink_command="{ test -z \"\${$var+set}\" || $lt_unset $var || { $var=; export $var; }; }; $relink_command" - elif eval var_value=\$$var; test -z "$var_value"; then - relink_command="$var=; export $var; $relink_command" - else - func_quote_for_eval "$var_value" - relink_command="$var=$func_quote_for_eval_result; export $var; $relink_command" - fi - done - # Quote the link command for shipping. - relink_command="(cd `pwd`; $SHELL \"$progpath\" $preserve_args --mode=relink $libtool_args @inst_prefix_dir@)" - relink_command=`$ECHO "$relink_command" | $SED "$sed_quote_subst"` - if test yes = "$hardcode_automatic"; then - relink_command= - fi - - # Only create the output if not a dry run. - $opt_dry_run || { - for installed in no yes; do - if test yes = "$installed"; then - if test -z "$install_libdir"; then - break - fi - output=$output_objdir/${outputname}i - # Replace all uninstalled libtool libraries with the installed ones - newdependency_libs= - for deplib in $dependency_libs; do - case $deplib in - *.la) - func_basename "$deplib" - name=$func_basename_result - func_resolve_sysroot "$deplib" - eval libdir=`$SED -n -e 's/^libdir=\(.*\)$/\1/p' $func_resolve_sysroot_result` - test -z "$libdir" && \ - func_fatal_error "'$deplib' is not a valid libtool archive" - func_append newdependency_libs " ${lt_sysroot:+=}$libdir/$name" - ;; - -L*) - func_stripname -L '' "$deplib" - func_replace_sysroot "$func_stripname_result" - func_append newdependency_libs " -L$func_replace_sysroot_result" - ;; - -R*) - func_stripname -R '' "$deplib" - func_replace_sysroot "$func_stripname_result" - func_append newdependency_libs " -R$func_replace_sysroot_result" - ;; - *) func_append newdependency_libs " $deplib" ;; - esac - done - dependency_libs=$newdependency_libs - newdlfiles= - - for lib in $dlfiles; do - case $lib in - *.la) - func_basename "$lib" - name=$func_basename_result - eval libdir=`$SED -n -e 's/^libdir=\(.*\)$/\1/p' $lib` - test -z "$libdir" && \ - func_fatal_error "'$lib' is not a valid libtool archive" - func_append newdlfiles " ${lt_sysroot:+=}$libdir/$name" - ;; - *) func_append newdlfiles " $lib" ;; - esac - done - dlfiles=$newdlfiles - newdlprefiles= - for lib in $dlprefiles; do - case $lib in - *.la) - # Only pass preopened files to the pseudo-archive (for - # eventual linking with the app. that links it) if we - # didn't already link the preopened objects directly into - # the library: - func_basename "$lib" - name=$func_basename_result - eval libdir=`$SED -n -e 's/^libdir=\(.*\)$/\1/p' $lib` - test -z "$libdir" && \ - func_fatal_error "'$lib' is not a valid libtool archive" - func_append newdlprefiles " ${lt_sysroot:+=}$libdir/$name" - ;; - esac - done - dlprefiles=$newdlprefiles - else - newdlfiles= - for lib in $dlfiles; do - case $lib in - [\\/]* | [A-Za-z]:[\\/]*) abs=$lib ;; - *) abs=`pwd`"/$lib" ;; - esac - func_append newdlfiles " $abs" - done - dlfiles=$newdlfiles - newdlprefiles= - for lib in $dlprefiles; do - case $lib in - [\\/]* | [A-Za-z]:[\\/]*) abs=$lib ;; - *) abs=`pwd`"/$lib" ;; - esac - func_append newdlprefiles " $abs" - done - dlprefiles=$newdlprefiles - fi - $RM $output - # place dlname in correct position for cygwin - # In fact, it would be nice if we could use this code for all target - # systems that can't hard-code library paths into their executables - # and that have no shared library path variable independent of PATH, - # but it turns out we can't easily determine that from inspecting - # libtool variables, so we have to hard-code the OSs to which it - # applies here; at the moment, that means platforms that use the PE - # object format with DLL files. See the long comment at the top of - # tests/bindir.at for full details. - tdlname=$dlname - case $host,$output,$installed,$module,$dlname in - *cygwin*,*lai,yes,no,*.dll | *mingw*,*lai,yes,no,*.dll | *cegcc*,*lai,yes,no,*.dll) - # If a -bindir argument was supplied, place the dll there. - if test -n "$bindir"; then - func_relative_path "$install_libdir" "$bindir" - tdlname=$func_relative_path_result/$dlname - else - # Otherwise fall back on heuristic. - tdlname=../bin/$dlname - fi - ;; - esac - $ECHO > $output "\ -# $outputname - a libtool library file -# Generated by $PROGRAM (GNU $PACKAGE) $VERSION -# -# Please DO NOT delete this file! -# It is necessary for linking the library. - -# The name that we can dlopen(3). -dlname='$tdlname' - -# Names of this library. -library_names='$library_names' - -# The name of the static archive. -old_library='$old_library' - -# Linker flags that cannot go in dependency_libs. -inherited_linker_flags='$new_inherited_linker_flags' - -# Libraries that this one depends upon. -dependency_libs='$dependency_libs' - -# Names of additional weak libraries provided by this library -weak_library_names='$weak_libs' - -# Version information for $libname. -current=$current -age=$age -revision=$revision - -# Is this an already installed library? -installed=$installed - -# Should we warn about portability when linking against -modules? -shouldnotlink=$module - -# Files to dlopen/dlpreopen -dlopen='$dlfiles' -dlpreopen='$dlprefiles' - -# Directory that this library needs to be installed in: -libdir='$install_libdir'" - if test no,yes = "$installed,$need_relink"; then - $ECHO >> $output "\ -relink_command=\"$relink_command\"" - fi - done - } - - # Do a symbolic link so that the libtool archive can be found in - # LD_LIBRARY_PATH before the program is installed. - func_show_eval '( cd "$output_objdir" && $RM "$outputname" && $LN_S "../$outputname" "$outputname" )' 'exit $?' - ;; - esac - exit $EXIT_SUCCESS -} - -if test link = "$opt_mode" || test relink = "$opt_mode"; then - func_mode_link ${1+"$@"} -fi - - -# func_mode_uninstall arg... -func_mode_uninstall () -{ - $debug_cmd - - RM=$nonopt - files= - rmforce=false - exit_status=0 - - # This variable tells wrapper scripts just to set variables rather - # than running their programs. - libtool_install_magic=$magic - - for arg - do - case $arg in - -f) func_append RM " $arg"; rmforce=: ;; - -*) func_append RM " $arg" ;; - *) func_append files " $arg" ;; - esac - done - - test -z "$RM" && \ - func_fatal_help "you must specify an RM program" - - rmdirs= - - for file in $files; do - func_dirname "$file" "" "." - dir=$func_dirname_result - if test . = "$dir"; then - odir=$objdir - else - odir=$dir/$objdir - fi - func_basename "$file" - name=$func_basename_result - test uninstall = "$opt_mode" && odir=$dir - - # Remember odir for removal later, being careful to avoid duplicates - if test clean = "$opt_mode"; then - case " $rmdirs " in - *" $odir "*) ;; - *) func_append rmdirs " $odir" ;; - esac - fi - - # Don't error if the file doesn't exist and rm -f was used. - if { test -L "$file"; } >/dev/null 2>&1 || - { test -h "$file"; } >/dev/null 2>&1 || - test -f "$file"; then - : - elif test -d "$file"; then - exit_status=1 - continue - elif $rmforce; then - continue - fi - - rmfiles=$file - - case $name in - *.la) - # Possibly a libtool archive, so verify it. - if func_lalib_p "$file"; then - func_source $dir/$name - - # Delete the libtool libraries and symlinks. - for n in $library_names; do - func_append rmfiles " $odir/$n" - done - test -n "$old_library" && func_append rmfiles " $odir/$old_library" - - case $opt_mode in - clean) - case " $library_names " in - *" $dlname "*) ;; - *) test -n "$dlname" && func_append rmfiles " $odir/$dlname" ;; - esac - test -n "$libdir" && func_append rmfiles " $odir/$name $odir/${name}i" - ;; - uninstall) - if test -n "$library_names"; then - # Do each command in the postuninstall commands. - func_execute_cmds "$postuninstall_cmds" '$rmforce || exit_status=1' - fi - - if test -n "$old_library"; then - # Do each command in the old_postuninstall commands. - func_execute_cmds "$old_postuninstall_cmds" '$rmforce || exit_status=1' - fi - # FIXME: should reinstall the best remaining shared library. - ;; - esac - fi - ;; - - *.lo) - # Possibly a libtool object, so verify it. - if func_lalib_p "$file"; then - - # Read the .lo file - func_source $dir/$name - - # Add PIC object to the list of files to remove. - if test -n "$pic_object" && test none != "$pic_object"; then - func_append rmfiles " $dir/$pic_object" - fi - - # Add non-PIC object to the list of files to remove. - if test -n "$non_pic_object" && test none != "$non_pic_object"; then - func_append rmfiles " $dir/$non_pic_object" - fi - fi - ;; - - *) - if test clean = "$opt_mode"; then - noexename=$name - case $file in - *.exe) - func_stripname '' '.exe' "$file" - file=$func_stripname_result - func_stripname '' '.exe' "$name" - noexename=$func_stripname_result - # $file with .exe has already been added to rmfiles, - # add $file without .exe - func_append rmfiles " $file" - ;; - esac - # Do a test to see if this is a libtool program. - if func_ltwrapper_p "$file"; then - if func_ltwrapper_executable_p "$file"; then - func_ltwrapper_scriptname "$file" - relink_command= - func_source $func_ltwrapper_scriptname_result - func_append rmfiles " $func_ltwrapper_scriptname_result" - else - relink_command= - func_source $dir/$noexename - fi - - # note $name still contains .exe if it was in $file originally - # as does the version of $file that was added into $rmfiles - func_append rmfiles " $odir/$name $odir/${name}S.$objext" - if test yes = "$fast_install" && test -n "$relink_command"; then - func_append rmfiles " $odir/lt-$name" - fi - if test "X$noexename" != "X$name"; then - func_append rmfiles " $odir/lt-$noexename.c" - fi - fi - fi - ;; - esac - func_show_eval "$RM $rmfiles" 'exit_status=1' - done - - # Try to remove the $objdir's in the directories where we deleted files - for dir in $rmdirs; do - if test -d "$dir"; then - func_show_eval "rmdir $dir >/dev/null 2>&1" - fi - done - - exit $exit_status -} - -if test uninstall = "$opt_mode" || test clean = "$opt_mode"; then - func_mode_uninstall ${1+"$@"} -fi - -test -z "$opt_mode" && { - help=$generic_help - func_fatal_help "you must specify a MODE" -} - -test -z "$exec_cmd" && \ - func_fatal_help "invalid operation mode '$opt_mode'" - -if test -n "$exec_cmd"; then - eval exec "$exec_cmd" - exit $EXIT_FAILURE -fi - -exit $exit_status - - -# The TAGs below are defined such that we never get into a situation -# where we disable both kinds of libraries. Given conflicting -# choices, we go for a static library, that is the most portable, -# since we can't tell whether shared libraries were disabled because -# the user asked for that or because the platform doesn't support -# them. This is particularly important on AIX, because we don't -# support having both static and shared libraries enabled at the same -# time on that platform, so we default to a shared-only configuration. -# If a disable-shared tag is given, we'll fallback to a static-only -# configuration. But we'll never go from static-only to shared-only. - -# ### BEGIN LIBTOOL TAG CONFIG: disable-shared -build_libtool_libs=no -build_old_libs=yes -# ### END LIBTOOL TAG CONFIG: disable-shared - -# ### BEGIN LIBTOOL TAG CONFIG: disable-static -build_old_libs=`case $build_libtool_libs in yes) echo no;; *) echo yes;; esac` -# ### END LIBTOOL TAG CONFIG: disable-static - -# Local Variables: -# mode:shell-script -# sh-indentation:2 -# End: diff --git a/extra/protobuf/protobuf-3.19.4/maven_install.json b/extra/protobuf/protobuf-3.19.4/maven_install.json deleted file mode 100644 index 6168aa4af246..000000000000 --- a/extra/protobuf/protobuf-3.19.4/maven_install.json +++ /dev/null @@ -1,245 +0,0 @@ -{ - "dependency_tree": { - "__AUTOGENERATED_FILE_DO_NOT_MODIFY_THIS_FILE_MANUALLY": "THERE_IS_NO_DATA_ONLY_ZUUL", - "__INPUT_ARTIFACTS_HASH": 1907885757, - "__RESOLVED_ARTIFACTS_HASH": 375457873, - "conflict_resolution": { - "com.google.errorprone:error_prone_annotations:2.3.2": "com.google.errorprone:error_prone_annotations:2.5.1", - "junit:junit:4.12": "junit:junit:4.13.1" - }, - "dependencies": [ - { - "coord": "cglib:cglib-nodep:2.2.2", - "dependencies": [], - "directDependencies": [], - "file": "v1/https/repo1.maven.org/maven2/cglib/cglib-nodep/2.2.2/cglib-nodep-2.2.2.jar", - "mirror_urls": [ - "https://repo1.maven.org/maven2/cglib/cglib-nodep/2.2.2/cglib-nodep-2.2.2.jar", - "https://repo.maven.apache.org/maven2/cglib/cglib-nodep/2.2.2/cglib-nodep-2.2.2.jar" - ], - "sha256": "e78c7792e59554ed8a23d18a12e3a0d2f7a244217ecf89621477f63aec074f15", - "url": "https://repo1.maven.org/maven2/cglib/cglib-nodep/2.2.2/cglib-nodep-2.2.2.jar" - }, - { - "coord": "com.google.auto.value:auto-value-annotations:1.7.4", - "dependencies": [], - "directDependencies": [], - "file": "v1/https/repo1.maven.org/maven2/com/google/auto/value/auto-value-annotations/1.7.4/auto-value-annotations-1.7.4.jar", - "mirror_urls": [ - "https://repo1.maven.org/maven2/com/google/auto/value/auto-value-annotations/1.7.4/auto-value-annotations-1.7.4.jar", - "https://repo.maven.apache.org/maven2/com/google/auto/value/auto-value-annotations/1.7.4/auto-value-annotations-1.7.4.jar" - ], - "sha256": "fedd59b0b4986c342f6ab2d182f2a4ee9fceb2c7e2d5bdc4dc764c92394a23d3", - "url": "https://repo1.maven.org/maven2/com/google/auto/value/auto-value-annotations/1.7.4/auto-value-annotations-1.7.4.jar" - }, - { - "coord": "com.google.code.findbugs:jsr305:3.0.2", - "dependencies": [], - "directDependencies": [], - "file": "v1/https/repo1.maven.org/maven2/com/google/code/findbugs/jsr305/3.0.2/jsr305-3.0.2.jar", - "mirror_urls": [ - "https://repo1.maven.org/maven2/com/google/code/findbugs/jsr305/3.0.2/jsr305-3.0.2.jar", - "https://repo.maven.apache.org/maven2/com/google/code/findbugs/jsr305/3.0.2/jsr305-3.0.2.jar" - ], - "sha256": "766ad2a0783f2687962c8ad74ceecc38a28b9f72a2d085ee438b7813e928d0c7", - "url": "https://repo1.maven.org/maven2/com/google/code/findbugs/jsr305/3.0.2/jsr305-3.0.2.jar" - }, - { - "coord": "com.google.code.gson:gson:2.8.6", - "dependencies": [], - "directDependencies": [], - "file": "v1/https/repo1.maven.org/maven2/com/google/code/gson/gson/2.8.6/gson-2.8.6.jar", - "mirror_urls": [ - "https://repo1.maven.org/maven2/com/google/code/gson/gson/2.8.6/gson-2.8.6.jar", - "https://repo.maven.apache.org/maven2/com/google/code/gson/gson/2.8.6/gson-2.8.6.jar" - ], - "sha256": "c8fb4839054d280b3033f800d1f5a97de2f028eb8ba2eb458ad287e536f3f25f", - "url": "https://repo1.maven.org/maven2/com/google/code/gson/gson/2.8.6/gson-2.8.6.jar" - }, - { - "coord": "com.google.errorprone:error_prone_annotations:2.5.1", - "dependencies": [], - "directDependencies": [], - "file": "v1/https/repo1.maven.org/maven2/com/google/errorprone/error_prone_annotations/2.5.1/error_prone_annotations-2.5.1.jar", - "mirror_urls": [ - "https://repo1.maven.org/maven2/com/google/errorprone/error_prone_annotations/2.5.1/error_prone_annotations-2.5.1.jar", - "https://repo.maven.apache.org/maven2/com/google/errorprone/error_prone_annotations/2.5.1/error_prone_annotations-2.5.1.jar" - ], - "sha256": "ff80626baaf12a09342befd4e84cba9d50662f5fcd7f7a9b3490a6b7cf87e66c", - "url": "https://repo1.maven.org/maven2/com/google/errorprone/error_prone_annotations/2.5.1/error_prone_annotations-2.5.1.jar" - }, - { - "coord": "com.google.guava:failureaccess:1.0.1", - "dependencies": [], - "directDependencies": [], - "file": "v1/https/repo1.maven.org/maven2/com/google/guava/failureaccess/1.0.1/failureaccess-1.0.1.jar", - "mirror_urls": [ - "https://repo1.maven.org/maven2/com/google/guava/failureaccess/1.0.1/failureaccess-1.0.1.jar", - "https://repo.maven.apache.org/maven2/com/google/guava/failureaccess/1.0.1/failureaccess-1.0.1.jar" - ], - "sha256": "a171ee4c734dd2da837e4b16be9df4661afab72a41adaf31eb84dfdaf936ca26", - "url": "https://repo1.maven.org/maven2/com/google/guava/failureaccess/1.0.1/failureaccess-1.0.1.jar" - }, - { - "coord": "com.google.guava:guava:30.1.1-jre", - "dependencies": [ - "com.google.guava:listenablefuture:9999.0-empty-to-avoid-conflict-with-guava", - "com.google.j2objc:j2objc-annotations:1.3", - "com.google.code.findbugs:jsr305:3.0.2", - "com.google.guava:failureaccess:1.0.1", - "com.google.errorprone:error_prone_annotations:2.5.1", - "org.checkerframework:checker-qual:3.9.1" - ], - "directDependencies": [ - "com.google.guava:listenablefuture:9999.0-empty-to-avoid-conflict-with-guava", - "com.google.j2objc:j2objc-annotations:1.3", - "com.google.code.findbugs:jsr305:3.0.2", - "com.google.guava:failureaccess:1.0.1", - "com.google.errorprone:error_prone_annotations:2.5.1", - "org.checkerframework:checker-qual:3.9.1" - ], - "file": "v1/https/repo1.maven.org/maven2/com/google/guava/guava/30.1.1-jre/guava-30.1.1-jre.jar", - "mirror_urls": [ - "https://repo1.maven.org/maven2/com/google/guava/guava/30.1.1-jre/guava-30.1.1-jre.jar", - "https://repo.maven.apache.org/maven2/com/google/guava/guava/30.1.1-jre/guava-30.1.1-jre.jar" - ], - "sha256": "44ce229ce26d880bf3afc362bbfcec34d7e6903d195bbb1db9f3b6e0d9834f06", - "url": "https://repo1.maven.org/maven2/com/google/guava/guava/30.1.1-jre/guava-30.1.1-jre.jar" - }, - { - "coord": "com.google.guava:listenablefuture:9999.0-empty-to-avoid-conflict-with-guava", - "dependencies": [], - "directDependencies": [], - "file": "v1/https/repo1.maven.org/maven2/com/google/guava/listenablefuture/9999.0-empty-to-avoid-conflict-with-guava/listenablefuture-9999.0-empty-to-avoid-conflict-with-guava.jar", - "mirror_urls": [ - "https://repo1.maven.org/maven2/com/google/guava/listenablefuture/9999.0-empty-to-avoid-conflict-with-guava/listenablefuture-9999.0-empty-to-avoid-conflict-with-guava.jar", - "https://repo.maven.apache.org/maven2/com/google/guava/listenablefuture/9999.0-empty-to-avoid-conflict-with-guava/listenablefuture-9999.0-empty-to-avoid-conflict-with-guava.jar" - ], - "sha256": "b372a037d4230aa57fbeffdef30fd6123f9c0c2db85d0aced00c91b974f33f99", - "url": "https://repo1.maven.org/maven2/com/google/guava/listenablefuture/9999.0-empty-to-avoid-conflict-with-guava/listenablefuture-9999.0-empty-to-avoid-conflict-with-guava.jar" - }, - { - "coord": "com.google.j2objc:j2objc-annotations:1.3", - "dependencies": [], - "directDependencies": [], - "file": "v1/https/repo1.maven.org/maven2/com/google/j2objc/j2objc-annotations/1.3/j2objc-annotations-1.3.jar", - "mirror_urls": [ - "https://repo1.maven.org/maven2/com/google/j2objc/j2objc-annotations/1.3/j2objc-annotations-1.3.jar", - "https://repo.maven.apache.org/maven2/com/google/j2objc/j2objc-annotations/1.3/j2objc-annotations-1.3.jar" - ], - "sha256": "21af30c92267bd6122c0e0b4d20cccb6641a37eaf956c6540ec471d584e64a7b", - "url": "https://repo1.maven.org/maven2/com/google/j2objc/j2objc-annotations/1.3/j2objc-annotations-1.3.jar" - }, - { - "coord": "com.google.truth:truth:1.1.2", - "dependencies": [ - "org.ow2.asm:asm:9.0", - "org.hamcrest:hamcrest-core:1.3", - "com.google.auto.value:auto-value-annotations:1.7.4", - "junit:junit:4.13.1", - "com.google.guava:guava:30.1.1-jre", - "com.google.errorprone:error_prone_annotations:2.5.1", - "org.checkerframework:checker-qual:3.9.1" - ], - "directDependencies": [ - "org.ow2.asm:asm:9.0", - "com.google.auto.value:auto-value-annotations:1.7.4", - "junit:junit:4.13.1", - "com.google.guava:guava:30.1.1-jre", - "com.google.errorprone:error_prone_annotations:2.5.1", - "org.checkerframework:checker-qual:3.9.1" - ], - "file": "v1/https/repo1.maven.org/maven2/com/google/truth/truth/1.1.2/truth-1.1.2.jar", - "mirror_urls": [ - "https://repo1.maven.org/maven2/com/google/truth/truth/1.1.2/truth-1.1.2.jar", - "https://repo.maven.apache.org/maven2/com/google/truth/truth/1.1.2/truth-1.1.2.jar" - ], - "sha256": "a85e03b8b6ae8780f060cfded9500a3d1b5f52808f99a2ea6da9c683313c7518", - "url": "https://repo1.maven.org/maven2/com/google/truth/truth/1.1.2/truth-1.1.2.jar" - }, - { - "coord": "junit:junit:4.13.1", - "dependencies": [ - "org.hamcrest:hamcrest-core:1.3" - ], - "directDependencies": [ - "org.hamcrest:hamcrest-core:1.3" - ], - "file": "v1/https/repo1.maven.org/maven2/junit/junit/4.13.1/junit-4.13.1.jar", - "mirror_urls": [ - "https://repo1.maven.org/maven2/junit/junit/4.13.1/junit-4.13.1.jar", - "https://repo.maven.apache.org/maven2/junit/junit/4.13.1/junit-4.13.1.jar" - ], - "sha256": "c30719db974d6452793fe191b3638a5777005485bae145924044530ffa5f6122", - "url": "https://repo1.maven.org/maven2/junit/junit/4.13.1/junit-4.13.1.jar" - }, - { - "coord": "org.checkerframework:checker-qual:3.9.1", - "dependencies": [], - "directDependencies": [], - "file": "v1/https/repo1.maven.org/maven2/org/checkerframework/checker-qual/3.9.1/checker-qual-3.9.1.jar", - "mirror_urls": [ - "https://repo1.maven.org/maven2/org/checkerframework/checker-qual/3.9.1/checker-qual-3.9.1.jar", - "https://repo.maven.apache.org/maven2/org/checkerframework/checker-qual/3.9.1/checker-qual-3.9.1.jar" - ], - "sha256": "ab0468b1ba35bb2ae45f61a60dc4960bd887660ab8f05113a662a7e675eae776", - "url": "https://repo1.maven.org/maven2/org/checkerframework/checker-qual/3.9.1/checker-qual-3.9.1.jar" - }, - { - "coord": "org.easymock:easymock:3.2", - "dependencies": [ - "cglib:cglib-nodep:2.2.2", - "org.objenesis:objenesis:1.3" - ], - "directDependencies": [ - "cglib:cglib-nodep:2.2.2", - "org.objenesis:objenesis:1.3" - ], - "file": "v1/https/repo1.maven.org/maven2/org/easymock/easymock/3.2/easymock-3.2.jar", - "mirror_urls": [ - "https://repo1.maven.org/maven2/org/easymock/easymock/3.2/easymock-3.2.jar", - "https://repo.maven.apache.org/maven2/org/easymock/easymock/3.2/easymock-3.2.jar" - ], - "sha256": "b3dd1cf5019f942d8cc2afad0aa6aef4b21532446fe90a6b68d567e3389763dd", - "url": "https://repo1.maven.org/maven2/org/easymock/easymock/3.2/easymock-3.2.jar" - }, - { - "coord": "org.hamcrest:hamcrest-core:1.3", - "dependencies": [], - "directDependencies": [], - "file": "v1/https/repo1.maven.org/maven2/org/hamcrest/hamcrest-core/1.3/hamcrest-core-1.3.jar", - "mirror_urls": [ - "https://repo1.maven.org/maven2/org/hamcrest/hamcrest-core/1.3/hamcrest-core-1.3.jar", - "https://repo.maven.apache.org/maven2/org/hamcrest/hamcrest-core/1.3/hamcrest-core-1.3.jar" - ], - "sha256": "66fdef91e9739348df7a096aa384a5685f4e875584cce89386a7a47251c4d8e9", - "url": "https://repo1.maven.org/maven2/org/hamcrest/hamcrest-core/1.3/hamcrest-core-1.3.jar" - }, - { - "coord": "org.objenesis:objenesis:1.3", - "dependencies": [], - "directDependencies": [], - "file": "v1/https/repo1.maven.org/maven2/org/objenesis/objenesis/1.3/objenesis-1.3.jar", - "mirror_urls": [ - "https://repo1.maven.org/maven2/org/objenesis/objenesis/1.3/objenesis-1.3.jar", - "https://repo.maven.apache.org/maven2/org/objenesis/objenesis/1.3/objenesis-1.3.jar" - ], - "sha256": "dd4ef3d3091063a4fec578cbb2bbe6c1f921c00091ba2993dcd9afd25ff9444a", - "url": "https://repo1.maven.org/maven2/org/objenesis/objenesis/1.3/objenesis-1.3.jar" - }, - { - "coord": "org.ow2.asm:asm:9.0", - "dependencies": [], - "directDependencies": [], - "file": "v1/https/repo1.maven.org/maven2/org/ow2/asm/asm/9.0/asm-9.0.jar", - "mirror_urls": [ - "https://repo1.maven.org/maven2/org/ow2/asm/asm/9.0/asm-9.0.jar", - "https://repo.maven.apache.org/maven2/org/ow2/asm/asm/9.0/asm-9.0.jar" - ], - "sha256": "0df97574914aee92fd349d0cb4e00f3345d45b2c239e0bb50f0a90ead47888e0", - "url": "https://repo1.maven.org/maven2/org/ow2/asm/asm/9.0/asm-9.0.jar" - } - ], - "version": "0.1.0" - } -} diff --git a/extra/protobuf/protobuf-3.19.4/missing b/extra/protobuf/protobuf-3.19.4/missing deleted file mode 100755 index 1fe1611f1851..000000000000 --- a/extra/protobuf/protobuf-3.19.4/missing +++ /dev/null @@ -1,215 +0,0 @@ -#! /bin/sh -# Common wrapper for a few potentially missing GNU programs. - -scriptversion=2018-03-07.03; # UTC - -# Copyright (C) 1996-2021 Free Software Foundation, Inc. -# Originally written by Fran,cois Pinard , 1996. - -# This program is free software; you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation; either version 2, or (at your option) -# any later version. - -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. - -# You should have received a copy of the GNU General Public License -# along with this program. If not, see . - -# As a special exception to the GNU General Public License, if you -# distribute this file as part of a program that contains a -# configuration script generated by Autoconf, you may include it under -# the same distribution terms that you use for the rest of that program. - -if test $# -eq 0; then - echo 1>&2 "Try '$0 --help' for more information" - exit 1 -fi - -case $1 in - - --is-lightweight) - # Used by our autoconf macros to check whether the available missing - # script is modern enough. - exit 0 - ;; - - --run) - # Back-compat with the calling convention used by older automake. - shift - ;; - - -h|--h|--he|--hel|--help) - echo "\ -$0 [OPTION]... PROGRAM [ARGUMENT]... - -Run 'PROGRAM [ARGUMENT]...', returning a proper advice when this fails due -to PROGRAM being missing or too old. - -Options: - -h, --help display this help and exit - -v, --version output version information and exit - -Supported PROGRAM values: - aclocal autoconf autoheader autom4te automake makeinfo - bison yacc flex lex help2man - -Version suffixes to PROGRAM as well as the prefixes 'gnu-', 'gnu', and -'g' are ignored when checking the name. - -Send bug reports to ." - exit $? - ;; - - -v|--v|--ve|--ver|--vers|--versi|--versio|--version) - echo "missing $scriptversion (GNU Automake)" - exit $? - ;; - - -*) - echo 1>&2 "$0: unknown '$1' option" - echo 1>&2 "Try '$0 --help' for more information" - exit 1 - ;; - -esac - -# Run the given program, remember its exit status. -"$@"; st=$? - -# If it succeeded, we are done. -test $st -eq 0 && exit 0 - -# Also exit now if we it failed (or wasn't found), and '--version' was -# passed; such an option is passed most likely to detect whether the -# program is present and works. -case $2 in --version|--help) exit $st;; esac - -# Exit code 63 means version mismatch. This often happens when the user -# tries to use an ancient version of a tool on a file that requires a -# minimum version. -if test $st -eq 63; then - msg="probably too old" -elif test $st -eq 127; then - # Program was missing. - msg="missing on your system" -else - # Program was found and executed, but failed. Give up. - exit $st -fi - -perl_URL=https://www.perl.org/ -flex_URL=https://github.com/westes/flex -gnu_software_URL=https://www.gnu.org/software - -program_details () -{ - case $1 in - aclocal|automake) - echo "The '$1' program is part of the GNU Automake package:" - echo "<$gnu_software_URL/automake>" - echo "It also requires GNU Autoconf, GNU m4 and Perl in order to run:" - echo "<$gnu_software_URL/autoconf>" - echo "<$gnu_software_URL/m4/>" - echo "<$perl_URL>" - ;; - autoconf|autom4te|autoheader) - echo "The '$1' program is part of the GNU Autoconf package:" - echo "<$gnu_software_URL/autoconf/>" - echo "It also requires GNU m4 and Perl in order to run:" - echo "<$gnu_software_URL/m4/>" - echo "<$perl_URL>" - ;; - esac -} - -give_advice () -{ - # Normalize program name to check for. - normalized_program=`echo "$1" | sed ' - s/^gnu-//; t - s/^gnu//; t - s/^g//; t'` - - printf '%s\n' "'$1' is $msg." - - configure_deps="'configure.ac' or m4 files included by 'configure.ac'" - case $normalized_program in - autoconf*) - echo "You should only need it if you modified 'configure.ac'," - echo "or m4 files included by it." - program_details 'autoconf' - ;; - autoheader*) - echo "You should only need it if you modified 'acconfig.h' or" - echo "$configure_deps." - program_details 'autoheader' - ;; - automake*) - echo "You should only need it if you modified 'Makefile.am' or" - echo "$configure_deps." - program_details 'automake' - ;; - aclocal*) - echo "You should only need it if you modified 'acinclude.m4' or" - echo "$configure_deps." - program_details 'aclocal' - ;; - autom4te*) - echo "You might have modified some maintainer files that require" - echo "the 'autom4te' program to be rebuilt." - program_details 'autom4te' - ;; - bison*|yacc*) - echo "You should only need it if you modified a '.y' file." - echo "You may want to install the GNU Bison package:" - echo "<$gnu_software_URL/bison/>" - ;; - lex*|flex*) - echo "You should only need it if you modified a '.l' file." - echo "You may want to install the Fast Lexical Analyzer package:" - echo "<$flex_URL>" - ;; - help2man*) - echo "You should only need it if you modified a dependency" \ - "of a man page." - echo "You may want to install the GNU Help2man package:" - echo "<$gnu_software_URL/help2man/>" - ;; - makeinfo*) - echo "You should only need it if you modified a '.texi' file, or" - echo "any other file indirectly affecting the aspect of the manual." - echo "You might want to install the Texinfo package:" - echo "<$gnu_software_URL/texinfo/>" - echo "The spurious makeinfo call might also be the consequence of" - echo "using a buggy 'make' (AIX, DU, IRIX), in which case you might" - echo "want to install GNU make:" - echo "<$gnu_software_URL/make/>" - ;; - *) - echo "You might have modified some files without having the proper" - echo "tools for further handling them. Check the 'README' file, it" - echo "often tells you about the needed prerequisites for installing" - echo "this package. You may also peek at any GNU archive site, in" - echo "case some other package contains this missing '$1' program." - ;; - esac -} - -give_advice "$1" | sed -e '1s/^/WARNING: /' \ - -e '2,$s/^/ /' >&2 - -# Propagate the correct exit status (expected to be 127 for a program -# not found, 63 for a program that failed due to version mismatch). -exit $st - -# Local variables: -# eval: (add-hook 'before-save-hook 'time-stamp) -# time-stamp-start: "scriptversion=" -# time-stamp-format: "%:y-%02m-%02d.%02H" -# time-stamp-time-zone: "UTC0" -# time-stamp-end: "; # UTC" -# End: diff --git a/extra/protobuf/protobuf-3.19.4/protobuf-lite.pc.in b/extra/protobuf/protobuf-3.19.4/protobuf-lite.pc.in deleted file mode 100644 index f92e4ad9d7c8..000000000000 --- a/extra/protobuf/protobuf-3.19.4/protobuf-lite.pc.in +++ /dev/null @@ -1,11 +0,0 @@ -prefix=@prefix@ -exec_prefix=@exec_prefix@ -libdir=@libdir@ -includedir=@includedir@ - -Name: Protocol Buffers -Description: Google's Data Interchange Format -Version: @VERSION@ -Libs: -L${libdir} -lprotobuf-lite -Cflags: -I${includedir} -Conflicts: protobuf diff --git a/extra/protobuf/protobuf-3.19.4/protobuf.bzl b/extra/protobuf/protobuf-3.19.4/protobuf.bzl deleted file mode 100644 index 971612812157..000000000000 --- a/extra/protobuf/protobuf-3.19.4/protobuf.bzl +++ /dev/null @@ -1,516 +0,0 @@ -load("@bazel_skylib//lib:versions.bzl", "versions") -load("@rules_cc//cc:defs.bzl", "cc_library") -load("@rules_proto//proto:defs.bzl", "ProtoInfo") -load("@rules_python//python:defs.bzl", "py_library", "py_test") - -def _GetPath(ctx, path): - if ctx.label.workspace_root: - return ctx.label.workspace_root + "/" + path - else: - return path - -def _IsNewExternal(ctx): - # Bazel 0.4.4 and older have genfiles paths that look like: - # bazel-out/local-fastbuild/genfiles/external/repo/foo - # After the exec root rearrangement, they look like: - # ../repo/bazel-out/local-fastbuild/genfiles/foo - return ctx.label.workspace_root.startswith("../") - -def _GenDir(ctx): - if _IsNewExternal(ctx): - # We are using the fact that Bazel 0.4.4+ provides repository-relative paths - # for ctx.genfiles_dir. - return ctx.genfiles_dir.path + ( - "/" + ctx.attr.includes[0] if ctx.attr.includes and ctx.attr.includes[0] else "" - ) - - # This means that we're either in the old version OR the new version in the local repo. - # Either way, appending the source path to the genfiles dir works. - return ctx.var["GENDIR"] + "/" + _SourceDir(ctx) - -def _SourceDir(ctx): - if not ctx.attr.includes: - return ctx.label.workspace_root - if not ctx.attr.includes[0]: - return _GetPath(ctx, ctx.label.package) - if not ctx.label.package: - return _GetPath(ctx, ctx.attr.includes[0]) - return _GetPath(ctx, ctx.label.package + "/" + ctx.attr.includes[0]) - -def _CcHdrs(srcs, use_grpc_plugin = False): - ret = [s[:-len(".proto")] + ".pb.h" for s in srcs] - if use_grpc_plugin: - ret += [s[:-len(".proto")] + ".grpc.pb.h" for s in srcs] - return ret - -def _CcSrcs(srcs, use_grpc_plugin = False): - ret = [s[:-len(".proto")] + ".pb.cc" for s in srcs] - if use_grpc_plugin: - ret += [s[:-len(".proto")] + ".grpc.pb.cc" for s in srcs] - return ret - -def _CcOuts(srcs, use_grpc_plugin = False): - return _CcHdrs(srcs, use_grpc_plugin) + _CcSrcs(srcs, use_grpc_plugin) - -def _PyOuts(srcs, use_grpc_plugin = False): - ret = [s[:-len(".proto")] + "_pb2.py" for s in srcs] - if use_grpc_plugin: - ret += [s[:-len(".proto")] + "_pb2_grpc.py" for s in srcs] - return ret - -def _RelativeOutputPath(path, include, dest = ""): - if include == None: - return path - - if not path.startswith(include): - fail("Include path %s isn't part of the path %s." % (include, path)) - - if include and include[-1] != "/": - include = include + "/" - if dest and dest[-1] != "/": - dest = dest + "/" - - path = path[len(include):] - return dest + path - -def _proto_gen_impl(ctx): - """General implementation for generating protos""" - srcs = ctx.files.srcs - deps = depset(direct=ctx.files.srcs) - source_dir = _SourceDir(ctx) - gen_dir = _GenDir(ctx).rstrip("/") - if source_dir: - import_flags = depset(direct=["-I" + source_dir, "-I" + gen_dir]) - else: - import_flags = depset(direct=["-I."]) - - for dep in ctx.attr.deps: - if type(dep.proto.import_flags) == "list": - import_flags = depset(transitive=[import_flags], direct=dep.proto.import_flags) - else: - import_flags = depset(transitive=[import_flags, dep.proto.import_flags]) - if type(dep.proto.deps) == "list": - deps = depset(transitive=[deps], direct=dep.proto.deps) - else: - deps = depset(transitive=[deps, dep.proto.deps]) - - if not ctx.attr.gen_cc and not ctx.attr.gen_py and not ctx.executable.plugin: - return struct( - proto = struct( - srcs = srcs, - import_flags = import_flags, - deps = deps, - ), - ) - - for src in srcs: - args = [] - - in_gen_dir = src.root.path == gen_dir - if in_gen_dir: - import_flags_real = [] - for f in import_flags.to_list(): - path = f.replace("-I", "") - import_flags_real.append("-I$(realpath -s %s)" % path) - - outs = [] - use_grpc_plugin = (ctx.attr.plugin_language == "grpc" and ctx.attr.plugin) - path_tpl = "$(realpath %s)" if in_gen_dir else "%s" - if ctx.attr.gen_cc: - args += [("--cpp_out=" + path_tpl) % gen_dir] - outs.extend(_CcOuts([src.basename], use_grpc_plugin = use_grpc_plugin)) - if ctx.attr.gen_py: - args += [("--python_out=" + path_tpl) % gen_dir] - outs.extend(_PyOuts([src.basename], use_grpc_plugin = use_grpc_plugin)) - - outs = [ctx.actions.declare_file(out, sibling = src) for out in outs] - inputs = [src] + deps.to_list() - tools = [ctx.executable.protoc] - if ctx.executable.plugin: - plugin = ctx.executable.plugin - lang = ctx.attr.plugin_language - if not lang and plugin.basename.startswith("protoc-gen-"): - lang = plugin.basename[len("protoc-gen-"):] - if not lang: - fail("cannot infer the target language of plugin", "plugin_language") - - outdir = "." if in_gen_dir else gen_dir - - if ctx.attr.plugin_options: - outdir = ",".join(ctx.attr.plugin_options) + ":" + outdir - args += [("--plugin=protoc-gen-%s=" + path_tpl) % (lang, plugin.path)] - args += ["--%s_out=%s" % (lang, outdir)] - tools.append(plugin) - - if not in_gen_dir: - ctx.actions.run( - inputs = inputs, - tools = tools, - outputs = outs, - arguments = args + import_flags.to_list() + [src.path], - executable = ctx.executable.protoc, - mnemonic = "ProtoCompile", - use_default_shell_env = True, - ) - else: - for out in outs: - orig_command = " ".join( - ["$(realpath %s)" % ctx.executable.protoc.path] + args + - import_flags_real + ["-I.", src.basename], - ) - command = ";".join([ - 'CMD="%s"' % orig_command, - "cd %s" % src.dirname, - "${CMD}", - "cd -", - ]) - generated_out = "/".join([gen_dir, out.basename]) - if generated_out != out.path: - command += ";mv %s %s" % (generated_out, out.path) - ctx.actions.run_shell( - inputs = inputs, - outputs = [out], - command = command, - mnemonic = "ProtoCompile", - tools = tools, - use_default_shell_env = True, - ) - - return struct( - proto = struct( - srcs = srcs, - import_flags = import_flags, - deps = deps, - ), - ) - -proto_gen = rule( - attrs = { - "srcs": attr.label_list(allow_files = True), - "deps": attr.label_list(providers = ["proto"]), - "includes": attr.string_list(), - "protoc": attr.label( - cfg = "exec", - executable = True, - allow_single_file = True, - mandatory = True, - ), - "plugin": attr.label( - cfg = "exec", - allow_files = True, - executable = True, - ), - "plugin_language": attr.string(), - "plugin_options": attr.string_list(), - "gen_cc": attr.bool(), - "gen_py": attr.bool(), - "outs": attr.output_list(), - }, - output_to_genfiles = True, - implementation = _proto_gen_impl, -) -"""Generates codes from Protocol Buffers definitions. - -This rule helps you to implement Skylark macros specific to the target -language. You should prefer more specific `cc_proto_library `, -`py_proto_library` and others unless you are adding such wrapper macros. - -Args: - srcs: Protocol Buffers definition files (.proto) to run the protocol compiler - against. - deps: a list of dependency labels; must be other proto libraries. - includes: a list of include paths to .proto files. - protoc: the label of the protocol compiler to generate the sources. - plugin: the label of the protocol compiler plugin to be passed to the protocol - compiler. - plugin_language: the language of the generated sources - plugin_options: a list of options to be passed to the plugin - gen_cc: generates C++ sources in addition to the ones from the plugin. - gen_py: generates Python sources in addition to the ones from the plugin. - outs: a list of labels of the expected outputs from the protocol compiler. -""" - -def _adapt_proto_library_impl(ctx): - deps = [dep[ProtoInfo] for dep in ctx.attr.deps] - - srcs = [src for dep in deps for src in dep.direct_sources] - return struct( - proto = struct( - srcs = srcs, - import_flags = ["-I{}".format(path) for dep in deps for path in dep.transitive_proto_path.to_list()], - deps = srcs, - ), - ) - -adapt_proto_library = rule( - implementation = _adapt_proto_library_impl, - attrs = { - "deps": attr.label_list( - mandatory = True, - providers = [ProtoInfo], - ), - }, - doc = "Adapts `proto_library` from `@rules_proto` to be used with `{cc,py}_proto_library` from this file.", -) - -def cc_proto_library( - name, - srcs = [], - deps = [], - cc_libs = [], - include = None, - protoc = "@com_google_protobuf//:protoc", - use_grpc_plugin = False, - default_runtime = "@com_google_protobuf//:protobuf", - **kargs): - """Bazel rule to create a C++ protobuf library from proto source files - - NOTE: the rule is only an internal workaround to generate protos. The - interface may change and the rule may be removed when bazel has introduced - the native rule. - - Args: - name: the name of the cc_proto_library. - srcs: the .proto files of the cc_proto_library. - deps: a list of dependency labels; must be cc_proto_library. - cc_libs: a list of other cc_library targets depended by the generated - cc_library. - include: a string indicating the include path of the .proto files. - protoc: the label of the protocol compiler to generate the sources. - use_grpc_plugin: a flag to indicate whether to call the grpc C++ plugin - when processing the proto files. - default_runtime: the implicitly default runtime which will be depended on by - the generated cc_library target. - **kargs: other keyword arguments that are passed to cc_library. - """ - - includes = [] - if include != None: - includes = [include] - - grpc_cpp_plugin = None - if use_grpc_plugin: - grpc_cpp_plugin = "//external:grpc_cpp_plugin" - - gen_srcs = _CcSrcs(srcs, use_grpc_plugin) - gen_hdrs = _CcHdrs(srcs, use_grpc_plugin) - outs = gen_srcs + gen_hdrs - - proto_gen( - name = name + "_genproto", - srcs = srcs, - deps = [s + "_genproto" for s in deps], - includes = includes, - protoc = protoc, - plugin = grpc_cpp_plugin, - plugin_language = "grpc", - gen_cc = 1, - outs = outs, - visibility = ["//visibility:public"], - ) - - if default_runtime and not default_runtime in cc_libs: - cc_libs = cc_libs + [default_runtime] - if use_grpc_plugin: - cc_libs = cc_libs + ["//external:grpc_lib"] - cc_library( - name = name, - srcs = gen_srcs, - hdrs = gen_hdrs, - deps = cc_libs + deps, - includes = includes, - **kargs - ) - -def _internal_gen_well_known_protos_java_impl(ctx): - args = ctx.actions.args() - - deps = [d[ProtoInfo] for d in ctx.attr.deps] - - srcjar = ctx.actions.declare_file("{}.srcjar".format(ctx.attr.name)) - if ctx.attr.javalite: - java_out = "lite:%s" % srcjar.path - else: - java_out = srcjar - - args.add("--java_out", java_out) - - descriptors = depset( - transitive = [dep.transitive_descriptor_sets for dep in deps], - ) - args.add_joined( - "--descriptor_set_in", - descriptors, - join_with = ctx.configuration.host_path_separator, - ) - - for dep in deps: - if "." == dep.proto_source_root: - args.add_all([src.path for src in dep.direct_sources]) - else: - source_root = dep.proto_source_root - offset = len(source_root) + 1 # + '/'. - args.add_all([src.path[offset:] for src in dep.direct_sources]) - - ctx.actions.run( - executable = ctx.executable._protoc, - inputs = descriptors, - outputs = [srcjar], - arguments = [args], - use_default_shell_env = True, - ) - - return [ - DefaultInfo( - files = depset([srcjar]), - ), - ] - -internal_gen_well_known_protos_java = rule( - implementation = _internal_gen_well_known_protos_java_impl, - attrs = { - "deps": attr.label_list( - mandatory = True, - providers = [ProtoInfo], - ), - "javalite": attr.bool( - default = False, - ), - "_protoc": attr.label( - executable = True, - cfg = "exec", - default = "@com_google_protobuf//:protoc", - ), - }, -) - -def internal_copied_filegroup(name, srcs, strip_prefix, dest, **kwargs): - """Macro to copy files to a different directory and then create a filegroup. - - This is used by the //:protobuf_python py_proto_library target to work around - an issue caused by Python source files that are part of the same Python - package being in separate directories. - - Args: - srcs: The source files to copy and add to the filegroup. - strip_prefix: Path to the root of the files to copy. - dest: The directory to copy the source files into. - **kwargs: extra arguments that will be passesd to the filegroup. - """ - outs = [_RelativeOutputPath(s, strip_prefix, dest) for s in srcs] - - native.genrule( - name = name + "_genrule", - srcs = srcs, - outs = outs, - cmd = " && ".join( - ["cp $(location %s) $(location %s)" % - (s, _RelativeOutputPath(s, strip_prefix, dest)) for s in srcs], - ), - ) - - native.filegroup( - name = name, - srcs = outs, - **kwargs - ) - -def py_proto_library( - name, - srcs = [], - deps = [], - py_libs = [], - py_extra_srcs = [], - include = None, - default_runtime = "@com_google_protobuf//:protobuf_python", - protoc = "@com_google_protobuf//:protoc", - use_grpc_plugin = False, - **kargs): - """Bazel rule to create a Python protobuf library from proto source files - - NOTE: the rule is only an internal workaround to generate protos. The - interface may change and the rule may be removed when bazel has introduced - the native rule. - - Args: - name: the name of the py_proto_library. - srcs: the .proto files of the py_proto_library. - deps: a list of dependency labels; must be py_proto_library. - py_libs: a list of other py_library targets depended by the generated - py_library. - py_extra_srcs: extra source files that will be added to the output - py_library. This attribute is used for internal bootstrapping. - include: a string indicating the include path of the .proto files. - default_runtime: the implicitly default runtime which will be depended on by - the generated py_library target. - protoc: the label of the protocol compiler to generate the sources. - use_grpc_plugin: a flag to indicate whether to call the Python C++ plugin - when processing the proto files. - **kargs: other keyword arguments that are passed to py_library. - - """ - outs = _PyOuts(srcs, use_grpc_plugin) - - includes = [] - if include != None: - includes = [include] - - grpc_python_plugin = None - if use_grpc_plugin: - grpc_python_plugin = "//external:grpc_python_plugin" - # Note: Generated grpc code depends on Python grpc module. This dependency - # is not explicitly listed in py_libs. Instead, host system is assumed to - # have grpc installed. - - proto_gen( - name = name + "_genproto", - srcs = srcs, - deps = [s + "_genproto" for s in deps], - includes = includes, - protoc = protoc, - gen_py = 1, - outs = outs, - visibility = ["//visibility:public"], - plugin = grpc_python_plugin, - plugin_language = "grpc", - ) - - if default_runtime and not default_runtime in py_libs + deps: - py_libs = py_libs + [default_runtime] - py_library( - name = name, - srcs = outs + py_extra_srcs, - deps = py_libs + deps, - imports = includes, - **kargs - ) - -def internal_protobuf_py_tests( - name, - modules = [], - **kargs): - """Bazel rules to create batch tests for protobuf internal. - - Args: - name: the name of the rule. - modules: a list of modules for tests. The macro will create a py_test for - each of the parameter with the source "google/protobuf/%s.py" - kargs: extra parameters that will be passed into the py_test. - - """ - for m in modules: - s = "python/google/protobuf/internal/%s.py" % m - py_test( - name = "py_%s" % m, - srcs = [s], - main = s, - **kargs - ) - -def check_protobuf_required_bazel_version(): - """For WORKSPACE files, to check the installed version of bazel. - - This ensures bazel supports our approach to proto_library() depending on a - copied filegroup. (Fixed in bazel 0.5.4) - """ - versions.check(minimum_bazel_version = "0.5.4") diff --git a/extra/protobuf/protobuf-3.19.4/protobuf.pc.in b/extra/protobuf/protobuf-3.19.4/protobuf.pc.in deleted file mode 100644 index e9bef5d0fe4a..000000000000 --- a/extra/protobuf/protobuf-3.19.4/protobuf.pc.in +++ /dev/null @@ -1,13 +0,0 @@ -prefix=@prefix@ -exec_prefix=@exec_prefix@ -libdir=@libdir@ -includedir=@includedir@ - -Name: Protocol Buffers -Description: Google's Data Interchange Format -Version: @VERSION@ -Libs: -L${libdir} -lprotobuf -Libs.private: @LIBS@ - -Cflags: -I${includedir} -Conflicts: protobuf-lite diff --git a/extra/protobuf/protobuf-3.19.4/protobuf_deps.bzl b/extra/protobuf/protobuf-3.19.4/protobuf_deps.bzl deleted file mode 100644 index 32f38ebb6ea0..000000000000 --- a/extra/protobuf/protobuf-3.19.4/protobuf_deps.bzl +++ /dev/null @@ -1,75 +0,0 @@ -"""Load dependencies needed to compile the protobuf library as a 3rd-party consumer.""" - -load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive") - -PROTOBUF_MAVEN_ARTIFACTS = [ - "com.google.code.findbugs:jsr305:3.0.2", - "com.google.code.gson:gson:2.8.6", - "com.google.errorprone:error_prone_annotations:2.3.2", - "com.google.j2objc:j2objc-annotations:1.3", - "com.google.guava:guava:30.1.1-jre", - "com.google.truth:truth:1.1.2", - "junit:junit:4.12", - "org.easymock:easymock:3.2", -] - -def protobuf_deps(): - """Loads common dependencies needed to compile the protobuf library.""" - - if not native.existing_rule("bazel_skylib"): - http_archive( - name = "bazel_skylib", - sha256 = "97e70364e9249702246c0e9444bccdc4b847bed1eb03c5a3ece4f83dfe6abc44", - urls = [ - "https://mirror.bazel.build/github.com/bazelbuild/bazel-skylib/releases/download/1.0.2/bazel-skylib-1.0.2.tar.gz", - "https://github.com/bazelbuild/bazel-skylib/releases/download/1.0.2/bazel-skylib-1.0.2.tar.gz", - ], - ) - - if not native.existing_rule("zlib"): - http_archive( - name = "zlib", - build_file = "@com_google_protobuf//:third_party/zlib.BUILD", - sha256 = "629380c90a77b964d896ed37163f5c3a34f6e6d897311f1df2a7016355c45eff", - strip_prefix = "zlib-1.2.11", - urls = ["https://github.com/madler/zlib/archive/v1.2.11.tar.gz"], - ) - - if not native.existing_rule("rules_cc"): - http_archive( - name = "rules_cc", - sha256 = "9d48151ea71b3e225adfb6867e6d2c7d0dce46cbdc8710d9a9a628574dfd40a0", - strip_prefix = "rules_cc-818289e5613731ae410efb54218a4077fb9dbb03", - urls = ["https://github.com/bazelbuild/rules_cc/archive/818289e5613731ae410efb54218a4077fb9dbb03.tar.gz"], - ) - - if not native.existing_rule("rules_java"): - http_archive( - name = "rules_java", - sha256 = "f5a3e477e579231fca27bf202bb0e8fbe4fc6339d63b38ccb87c2760b533d1c3", - strip_prefix = "rules_java-981f06c3d2bd10225e85209904090eb7b5fb26bd", - urls = ["https://github.com/bazelbuild/rules_java/archive/981f06c3d2bd10225e85209904090eb7b5fb26bd.tar.gz"], - ) - - if not native.existing_rule("rules_proto"): - http_archive( - name = "rules_proto", - sha256 = "a4382f78723af788f0bc19fd4c8411f44ffe0a72723670a34692ffad56ada3ac", - strip_prefix = "rules_proto-f7a30f6f80006b591fa7c437fe5a951eb10bcbcf", - urls = ["https://github.com/bazelbuild/rules_proto/archive/f7a30f6f80006b591fa7c437fe5a951eb10bcbcf.zip"], - ) - - if not native.existing_rule("rules_python"): - http_archive( - name = "rules_python", - sha256 = "b6d46438523a3ec0f3cead544190ee13223a52f6a6765a29eae7b7cc24cc83a0", - urls = ["https://github.com/bazelbuild/rules_python/releases/download/0.1.0/rules_python-0.1.0.tar.gz"], - ) - - if not native.existing_rule("rules_jvm_external"): - http_archive( - name = "rules_jvm_external", - sha256 = "f36441aa876c4f6427bfb2d1f2d723b48e9d930b62662bf723ddfb8fc80f0140", - strip_prefix = "rules_jvm_external-4.1", - urls = ["https://github.com/bazelbuild/rules_jvm_external/archive/4.1.zip"], - ) diff --git a/extra/protobuf/protobuf-3.19.4/protobuf_version.bzl b/extra/protobuf/protobuf-3.19.4/protobuf_version.bzl deleted file mode 100644 index 9ae134074173..000000000000 --- a/extra/protobuf/protobuf-3.19.4/protobuf_version.bzl +++ /dev/null @@ -1 +0,0 @@ -PROTOBUF_VERSION = '3.19.4' diff --git a/extra/protobuf/protobuf-3.19.4/src/Makefile.am b/extra/protobuf/protobuf-3.19.4/src/Makefile.am deleted file mode 100644 index 225061a313e2..000000000000 --- a/extra/protobuf/protobuf-3.19.4/src/Makefile.am +++ /dev/null @@ -1,914 +0,0 @@ -## Process this file with automake to produce Makefile.in - -if HAVE_ZLIB -GZCHECKPROGRAMS = zcgzip zcgunzip -GZHEADERS = google/protobuf/io/gzip_stream.h -GZTESTS = google/protobuf/io/gzip_stream_unittest.sh -ZLIB_DEF = -DHAVE_ZLIB=1 -else -GZCHECKPROGRAMS = -GZHEADERS = -GZTESTS = -ZLIB_DEF = -endif - -if HAVE_PTHREAD -PTHREAD_DEF = -DHAVE_PTHREAD=1 -else -PTHREAD_DEF = -endif - -PROTOBUF_VERSION = 30:4:0 - -if GCC -# Turn on all warnings except for sign comparison (we ignore sign comparison -# in Google so our code base have tons of such warnings). -NO_OPT_CXXFLAGS = $(PTHREAD_CFLAGS) $(PTHREAD_DEF) $(ZLIB_DEF) -Wall -Wno-sign-compare -else -NO_OPT_CXXFLAGS = $(PTHREAD_CFLAGS) $(PTHREAD_DEF) $(ZLIB_DEF) -endif - -AM_CXXFLAGS = $(NO_OPT_CXXFLAGS) $(PROTOBUF_OPT_FLAG) - -AM_LDFLAGS = $(PTHREAD_CFLAGS) ${LIBLOG_LIBS} - -# If I say "dist_include_DATA", automake complains that $(includedir) is not -# a "legitimate" directory for DATA. Screw you, automake. -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/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: - rm -f *.loT - -CLEANFILES = $(protoc_outputs) unittest_proto_middleman \ - testzip.jar testzip.list testzip.proto testzip.zip \ - no_warning_test.cc - -MAINTAINERCLEANFILES = \ - Makefile.in - -nobase_include_HEADERS = \ - google/protobuf/any.h \ - google/protobuf/any.pb.h \ - google/protobuf/api.pb.h \ - google/protobuf/arena.h \ - google/protobuf/arena_impl.h \ - google/protobuf/arenastring.h \ - google/protobuf/compiler/code_generator.h \ - google/protobuf/compiler/command_line_interface.h \ - google/protobuf/compiler/cpp/cpp_file.h \ - google/protobuf/compiler/cpp/cpp_generator.h \ - google/protobuf/compiler/cpp/cpp_helpers.h \ - google/protobuf/compiler/cpp/cpp_names.h \ - google/protobuf/compiler/csharp/csharp_doc_comment.h \ - google/protobuf/compiler/csharp/csharp_generator.h \ - google/protobuf/compiler/csharp/csharp_names.h \ - google/protobuf/compiler/csharp/csharp_options.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/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 \ - google/protobuf/explicitly_constructed.h \ - google/protobuf/extension_set.h \ - google/protobuf/extension_set_inl.h \ - google/protobuf/field_access_listener.h \ - 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_table_driven_lite.h \ - google/protobuf/generated_message_tctable_decl.h \ - google/protobuf/generated_message_tctable_impl.h \ - google/protobuf/generated_message_tctable_impl.inc \ - google/protobuf/generated_message_util.h \ - google/protobuf/has_bits.h \ - google/protobuf/implicit_weak_message.h \ - google/protobuf/inlined_string_field.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_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/reflection.h \ - google/protobuf/reflection_ops.h \ - google/protobuf/repeated_field.h \ - google/protobuf/repeated_ptr_field.h \ - google/protobuf/service.h \ - google/protobuf/source_context.pb.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/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/wire_format.h \ - google/protobuf/wire_format_lite.h \ - google/protobuf/wrappers.pb.h - -lib_LTLIBRARIES = libprotobuf-lite.la libprotobuf.la libprotoc.la - -libprotobuf_lite_la_LIBADD = $(PTHREAD_LIBS) $(LIBATOMIC_LIBS) -libprotobuf_lite_la_LDFLAGS = -version-info $(PROTOBUF_VERSION) -export-dynamic -no-undefined -if HAVE_LD_VERSION_SCRIPT -libprotobuf_lite_la_LDFLAGS += -Wl,--version-script=$(srcdir)/libprotobuf-lite.map -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_tctable_lite.cc \ - 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/repeated_ptr_field.cc \ - google/protobuf/string_member_robber.h \ - google/protobuf/stubs/bytestream.cc \ - google/protobuf/stubs/common.cc \ - google/protobuf/stubs/int128.cc \ - google/protobuf/stubs/int128.h \ - google/protobuf/stubs/mathutil.h \ - google/protobuf/stubs/status.cc \ - google/protobuf/stubs/status_macros.h \ - google/protobuf/stubs/statusor.cc \ - google/protobuf/stubs/statusor.h \ - google/protobuf/stubs/stringpiece.cc \ - google/protobuf/stubs/stringprintf.cc \ - google/protobuf/stubs/stringprintf.h \ - google/protobuf/stubs/structurally_valid.cc \ - google/protobuf/stubs/strutil.cc \ - google/protobuf/stubs/time.cc \ - google/protobuf/stubs/time.h \ - google/protobuf/wire_format_lite.cc - -libprotobuf_la_LIBADD = $(PTHREAD_LIBS) $(LIBATOMIC_LIBS) -libprotobuf_la_LDFLAGS = -version-info $(PROTOBUF_VERSION) -export-dynamic -no-undefined -if HAVE_LD_VERSION_SCRIPT -libprotobuf_la_LDFLAGS += -Wl,--version-script=$(srcdir)/libprotobuf.map -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/compiler/importer.cc \ - google/protobuf/compiler/parser.cc \ - google/protobuf/descriptor.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_mask.pb.cc \ - google/protobuf/generated_message_bases.cc \ - google/protobuf/generated_message_reflection.cc \ - google/protobuf/generated_message_table_driven.cc \ - google/protobuf/generated_message_tctable_full.cc \ - 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 \ - google/protobuf/reflection_ops.cc \ - google/protobuf/service.cc \ - google/protobuf/source_context.pb.cc \ - google/protobuf/struct.pb.cc \ - google/protobuf/stubs/substitute.cc \ - google/protobuf/stubs/substitute.h \ - google/protobuf/text_format.cc \ - google/protobuf/timestamp.pb.cc \ - google/protobuf/type.pb.cc \ - google/protobuf/unknown_field_set.cc \ - google/protobuf/util/delimited_message_util.cc \ - google/protobuf/util/field_comparator.cc \ - google/protobuf/util/field_mask_util.cc \ - google/protobuf/util/internal/constants.h \ - google/protobuf/util/internal/datapiece.cc \ - google/protobuf/util/internal/datapiece.h \ - google/protobuf/util/internal/default_value_objectwriter.cc \ - google/protobuf/util/internal/default_value_objectwriter.h \ - google/protobuf/util/internal/error_listener.cc \ - google/protobuf/util/internal/error_listener.h \ - google/protobuf/util/internal/expecting_objectwriter.h \ - google/protobuf/util/internal/field_mask_utility.cc \ - google/protobuf/util/internal/field_mask_utility.h \ - google/protobuf/util/internal/json_escaping.cc \ - google/protobuf/util/internal/json_escaping.h \ - google/protobuf/util/internal/json_objectwriter.cc \ - google/protobuf/util/internal/json_objectwriter.h \ - google/protobuf/util/internal/json_stream_parser.cc \ - google/protobuf/util/internal/json_stream_parser.h \ - google/protobuf/util/internal/location_tracker.h \ - google/protobuf/util/internal/mock_error_listener.h \ - google/protobuf/util/internal/object_location_tracker.h \ - 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/structured_objectwriter.h \ - google/protobuf/util/internal/type_info.cc \ - google/protobuf/util/internal/type_info.h \ - google/protobuf/util/internal/type_info_test_helper.h \ - google/protobuf/util/internal/utility.cc \ - google/protobuf/util/internal/utility.h \ - 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/wire_format.cc \ - google/protobuf/wrappers.pb.cc - -nodist_libprotobuf_la_SOURCES = $(nodist_libprotobuf_lite_la_SOURCES) - -libprotoc_la_LIBADD = $(PTHREAD_LIBS) libprotobuf.la -libprotoc_la_LDFLAGS = -version-info $(PROTOBUF_VERSION) -export-dynamic -no-undefined -if HAVE_LD_VERSION_SCRIPT -libprotoc_la_LDFLAGS += -Wl,--version-script=$(srcdir)/libprotoc.map -EXTRA_libprotoc_la_DEPENDENCIES = libprotoc.map -endif -libprotoc_la_SOURCES = \ - google/protobuf/compiler/code_generator.cc \ - google/protobuf/compiler/command_line_interface.cc \ - google/protobuf/compiler/cpp/cpp_enum.cc \ - google/protobuf/compiler/cpp/cpp_enum.h \ - google/protobuf/compiler/cpp/cpp_enum_field.cc \ - google/protobuf/compiler/cpp/cpp_enum_field.h \ - google/protobuf/compiler/cpp/cpp_extension.cc \ - google/protobuf/compiler/cpp/cpp_extension.h \ - google/protobuf/compiler/cpp/cpp_field.cc \ - google/protobuf/compiler/cpp/cpp_field.h \ - google/protobuf/compiler/cpp/cpp_file.cc \ - google/protobuf/compiler/cpp/cpp_generator.cc \ - google/protobuf/compiler/cpp/cpp_helpers.cc \ - google/protobuf/compiler/cpp/cpp_map_field.cc \ - google/protobuf/compiler/cpp/cpp_map_field.h \ - google/protobuf/compiler/cpp/cpp_message.cc \ - google/protobuf/compiler/cpp/cpp_message.h \ - google/protobuf/compiler/cpp/cpp_message_field.cc \ - google/protobuf/compiler/cpp/cpp_message_field.h \ - google/protobuf/compiler/cpp/cpp_message_layout_helper.h \ - google/protobuf/compiler/cpp/cpp_options.h \ - google/protobuf/compiler/cpp/cpp_padding_optimizer.cc \ - google/protobuf/compiler/cpp/cpp_padding_optimizer.h \ - google/protobuf/compiler/cpp/cpp_parse_function_generator.cc \ - google/protobuf/compiler/cpp/cpp_parse_function_generator.h \ - google/protobuf/compiler/cpp/cpp_primitive_field.cc \ - google/protobuf/compiler/cpp/cpp_primitive_field.h \ - google/protobuf/compiler/cpp/cpp_service.cc \ - 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_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_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.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_lite.cc \ - google/protobuf/compiler/java/java_enum_lite.h \ - google/protobuf/compiler/java/java_extension.cc \ - google/protobuf/compiler/java/java_extension.h \ - google/protobuf/compiler/java/java_extension_lite.cc \ - google/protobuf/compiler/java/java_extension_lite.h \ - google/protobuf/compiler/java/java_field.cc \ - google/protobuf/compiler/java/java_field.h \ - google/protobuf/compiler/java/java_file.cc \ - google/protobuf/compiler/java/java_file.h \ - google/protobuf/compiler/java/java_generator.cc \ - google/protobuf/compiler/java/java_generator_factory.cc \ - google/protobuf/compiler/java/java_generator_factory.h \ - google/protobuf/compiler/java/java_helpers.cc \ - google/protobuf/compiler/java/java_helpers.h \ - google/protobuf/compiler/java/java_kotlin_generator.cc \ - google/protobuf/compiler/java/java_map_field.cc \ - google/protobuf/compiler/java/java_map_field.h \ - 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.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_lite.cc \ - google/protobuf/compiler/java/java_message_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 \ - google/protobuf/compiler/java/java_primitive_field.cc \ - 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_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/js/js_generator.cc \ - google/protobuf/compiler/js/well_known_types_embed.cc \ - google/protobuf/compiler/js/well_known_types_embed.h \ - google/protobuf/compiler/objectivec/objectivec_enum.cc \ - google/protobuf/compiler/objectivec/objectivec_enum.h \ - google/protobuf/compiler/objectivec/objectivec_enum_field.cc \ - google/protobuf/compiler/objectivec/objectivec_enum_field.h \ - google/protobuf/compiler/objectivec/objectivec_extension.cc \ - google/protobuf/compiler/objectivec/objectivec_extension.h \ - google/protobuf/compiler/objectivec/objectivec_field.cc \ - google/protobuf/compiler/objectivec/objectivec_field.h \ - google/protobuf/compiler/objectivec/objectivec_file.cc \ - google/protobuf/compiler/objectivec/objectivec_file.h \ - google/protobuf/compiler/objectivec/objectivec_generator.cc \ - google/protobuf/compiler/objectivec/objectivec_helpers.cc \ - google/protobuf/compiler/objectivec/objectivec_map_field.cc \ - google/protobuf/compiler/objectivec/objectivec_map_field.h \ - google/protobuf/compiler/objectivec/objectivec_message.cc \ - 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_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/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 -protoc_SOURCES = google/protobuf/compiler/main.cc - -# Tests ============================================================== - -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.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.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_enum.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 \ - google/protobuf/unittest_proto3_lite.proto \ - google/protobuf/unittest_proto3_optional.proto \ - google/protobuf/unittest_well_known_types.proto \ - google/protobuf/util/internal/testdata/anys.proto \ - google/protobuf/util/internal/testdata/books.proto \ - google/protobuf/util/internal/testdata/default_value.proto \ - google/protobuf/util/internal/testdata/default_value_test.proto \ - google/protobuf/util/internal/testdata/field_mask.proto \ - google/protobuf/util/internal/testdata/maps.proto \ - google/protobuf/util/internal/testdata/oneofs.proto \ - google/protobuf/util/internal/testdata/proto3.proto \ - google/protobuf/util/internal/testdata/struct.proto \ - google/protobuf/util/internal/testdata/timestamp_duration.proto \ - 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 - -EXTRA_DIST = \ - $(protoc_inputs) \ - README.md \ - 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_import.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/map_test_data.txt \ - google/protobuf/testdata/text_format_unittest_data.txt \ - google/protobuf/testdata/text_format_unittest_data_oneof_implemented.txt \ - google/protobuf/testdata/text_format_unittest_data_pointy.txt \ - 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/util/package_info.h \ - libprotobuf-lite.map \ - libprotobuf.map \ - libprotoc.map \ - solaris/libstdc++.la - -protoc_lite_outputs = \ - google/protobuf/map_lite_unittest.pb.cc \ - google/protobuf/map_lite_unittest.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_lite.pb.cc \ - google/protobuf/unittest_lite.pb.h - -protoc_outputs = \ - $(protoc_lite_outputs) \ - google/protobuf/any_test.pb.cc \ - google/protobuf/any_test.pb.h \ - google/protobuf/compiler/cpp/cpp_test_bad_identifiers.pb.cc \ - google/protobuf/compiler/cpp/cpp_test_bad_identifiers.pb.h \ - google/protobuf/compiler/cpp/cpp_test_large_enum_value.pb.cc \ - google/protobuf/compiler/cpp/cpp_test_large_enum_value.pb.h \ - google/protobuf/map_proto2_unittest.pb.cc \ - 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 \ - google/protobuf/unittest_custom_options.pb.h \ - google/protobuf/unittest_drop_unknown_fields.pb.cc \ - google/protobuf/unittest_drop_unknown_fields.pb.h \ - google/protobuf/unittest_embed_optimize_for.pb.cc \ - google/protobuf/unittest_embed_optimize_for.pb.h \ - google/protobuf/unittest_empty.pb.cc \ - google/protobuf/unittest_empty.pb.h \ - google/protobuf/unittest_enormous_descriptor.pb.cc \ - google/protobuf/unittest_enormous_descriptor.pb.h \ - google/protobuf/unittest_import.pb.cc \ - google/protobuf/unittest_import.pb.h \ - google/protobuf/unittest_import_public.pb.cc \ - google/protobuf/unittest_import_public.pb.h \ - google/protobuf/unittest_lazy_dependencies.pb.cc \ - google/protobuf/unittest_lazy_dependencies.pb.h \ - google/protobuf/unittest_lazy_dependencies_custom_option.pb.cc \ - google/protobuf/unittest_lazy_dependencies_custom_option.pb.h \ - google/protobuf/unittest_lazy_dependencies_enum.pb.cc \ - google/protobuf/unittest_lazy_dependencies_enum.pb.h \ - google/protobuf/unittest_lite_imports_nonlite.pb.cc \ - google/protobuf/unittest_lite_imports_nonlite.pb.h \ - google/protobuf/unittest_mset.pb.cc \ - google/protobuf/unittest_mset.pb.h \ - google/protobuf/unittest_mset_wire_format.pb.cc \ - google/protobuf/unittest_mset_wire_format.pb.h \ - google/protobuf/unittest_no_field_presence.pb.cc \ - google/protobuf/unittest_no_field_presence.pb.h \ - google/protobuf/unittest_no_generic_services.pb.cc \ - 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_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 \ - google/protobuf/unittest_proto3_arena.pb.h \ - google/protobuf/unittest_proto3_arena_lite.pb.cc \ - google/protobuf/unittest_proto3_arena_lite.pb.h \ - google/protobuf/unittest_proto3_lite.pb.cc \ - google/protobuf/unittest_proto3_lite.pb.h \ - google/protobuf/unittest_proto3_optional.pb.cc \ - google/protobuf/unittest_proto3_optional.pb.h \ - google/protobuf/unittest_well_known_types.pb.cc \ - google/protobuf/unittest_well_known_types.pb.h \ - google/protobuf/util/internal/testdata/anys.pb.cc \ - google/protobuf/util/internal/testdata/anys.pb.h \ - google/protobuf/util/internal/testdata/books.pb.cc \ - google/protobuf/util/internal/testdata/books.pb.h \ - google/protobuf/util/internal/testdata/default_value.pb.cc \ - google/protobuf/util/internal/testdata/default_value.pb.h \ - google/protobuf/util/internal/testdata/default_value_test.pb.cc \ - google/protobuf/util/internal/testdata/default_value_test.pb.h \ - google/protobuf/util/internal/testdata/field_mask.pb.cc \ - google/protobuf/util/internal/testdata/field_mask.pb.h \ - google/protobuf/util/internal/testdata/maps.pb.cc \ - google/protobuf/util/internal/testdata/maps.pb.h \ - google/protobuf/util/internal/testdata/oneofs.pb.cc \ - google/protobuf/util/internal/testdata/oneofs.pb.h \ - google/protobuf/util/internal/testdata/proto3.pb.cc \ - google/protobuf/util/internal/testdata/proto3.pb.h \ - google/protobuf/util/internal/testdata/struct.pb.cc \ - google/protobuf/util/internal/testdata/struct.pb.h \ - google/protobuf/util/internal/testdata/timestamp_duration.pb.cc \ - google/protobuf/util/internal/testdata/timestamp_duration.pb.h \ - google/protobuf/util/internal/testdata/wrappers.pb.cc \ - google/protobuf/util/internal/testdata/wrappers.pb.h \ - google/protobuf/util/json_format.pb.cc \ - google/protobuf/util/json_format.pb.h \ - google/protobuf/util/json_format_proto3.pb.cc \ - google/protobuf/util/json_format_proto3.pb.h \ - google/protobuf/util/message_differencer_unittest.pb.cc \ - google/protobuf/util/message_differencer_unittest.pb.h - -if USE_EXTERNAL_PROTOC - -unittest_proto_middleman: $(protoc_inputs) - $(PROTOC) -I$(srcdir) --cpp_out=. $^ - touch unittest_proto_middleman - -else - -# We have to cd to $(srcdir) before executing protoc because $(protoc_inputs) is -# relative to srcdir, which may not be the same as the current directory when -# building out-of-tree. -unittest_proto_middleman: protoc$(EXEEXT) $(protoc_inputs) - oldpwd=`pwd` && ( cd $(srcdir) && $$oldpwd/protoc$(EXEEXT) -I. --cpp_out=$$oldpwd $(protoc_inputs) --experimental_allow_proto3_optional ) - touch unittest_proto_middleman - -endif - -$(protoc_outputs): unittest_proto_middleman - -COMMON_TEST_SOURCES = \ - $(COMMON_LITE_TEST_SOURCES) \ - google/protobuf/compiler/cpp/cpp_unittest.h \ - google/protobuf/map_test_util.h \ - google/protobuf/map_test_util.inc \ - google/protobuf/reflection_tester.cc \ - google/protobuf/reflection_tester.h \ - google/protobuf/test_util.cc \ - google/protobuf/test_util.h \ - google/protobuf/test_util.inc \ - google/protobuf/test_util2.h \ - google/protobuf/testing/file.cc \ - 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 -GOOGLETEST_SRC_DIR=$(srcdir)/../third_party/googletest/googletest -GOOGLEMOCK_SRC_DIR=$(srcdir)/../third_party/googletest/googlemock -check_PROGRAMS = protoc protobuf-test protobuf-lazy-descriptor-test \ - protobuf-lite-test test_plugin protobuf-lite-arena-test \ - no-warning-test $(GZCHECKPROGRAMS) -protobuf_test_LDADD = $(PTHREAD_LIBS) libprotobuf.la libprotoc.la \ - $(GOOGLETEST_BUILD_DIR)/lib/libgtest.la \ - $(GOOGLEMOCK_BUILD_DIR)/lib/libgmock.la \ - $(GOOGLEMOCK_BUILD_DIR)/lib/libgmock_main.la -protobuf_test_CPPFLAGS = -I$(GOOGLETEST_SRC_DIR)/include \ - -I$(GOOGLEMOCK_SRC_DIR)/include -# Disable optimization for tests unless the user explicitly asked for it, -# since test_util.cc takes forever to compile with optimization (with GCC). -# See configure.ac for more info. -protobuf_test_CXXFLAGS = $(NO_OPT_CXXFLAGS) -protobuf_test_SOURCES = \ - $(COMMON_TEST_SOURCES) \ - google/protobuf/any_test.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.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 \ - google/protobuf/dynamic_message_unittest.cc \ - 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 \ - google/protobuf/message_unittest.cc \ - google/protobuf/message_unittest.inc \ - google/protobuf/no_field_presence_test.cc \ - google/protobuf/preserve_unknown_enum_test.cc \ - google/protobuf/proto3_arena_lite_unittest.cc \ - google/protobuf/proto3_arena_unittest.cc \ - google/protobuf/proto3_lite_unittest.cc \ - google/protobuf/proto3_lite_unittest.inc \ - 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/util/delimited_message_util_test.cc \ - google/protobuf/util/field_comparator_test.cc \ - google/protobuf/util/field_mask_util_test.cc \ - google/protobuf/util/internal/default_value_objectwriter_test.cc \ - google/protobuf/util/internal/json_objectwriter_test.cc \ - google/protobuf/util/internal/json_stream_parser_test.cc \ - google/protobuf/util/internal/protostream_objectsource_test.cc \ - google/protobuf/util/internal/protostream_objectwriter_test.cc \ - google/protobuf/util/internal/type_info_test_helper.cc \ - google/protobuf/util/json_util_test.cc \ - google/protobuf/util/message_differencer_unittest.cc \ - google/protobuf/util/time_util_test.cc \ - google/protobuf/util/type_resolver_util_test.cc \ - google/protobuf/well_known_types_unittest.cc \ - google/protobuf/wire_format_unittest.cc \ - google/protobuf/wire_format_unittest.inc - -nodist_protobuf_test_SOURCES = $(protoc_outputs) -$(am_protobuf_test_OBJECTS): unittest_proto_middleman - -# Run cpp_unittest again with PROTOBUF_TEST_NO_DESCRIPTORS defined. -protobuf_lazy_descriptor_test_LDADD = $(PTHREAD_LIBS) libprotobuf.la \ - libprotoc.la \ - $(GOOGLETEST_BUILD_DIR)/lib/libgtest.la \ - $(GOOGLEMOCK_BUILD_DIR)/lib/libgmock.la \ - $(GOOGLEMOCK_BUILD_DIR)/lib/libgmock_main.la -protobuf_lazy_descriptor_test_CPPFLAGS = -I$(GOOGLEMOCK_SRC_DIR)/include \ - -I$(GOOGLETEST_SRC_DIR)/include \ - -DPROTOBUF_TEST_NO_DESCRIPTORS -protobuf_lazy_descriptor_test_CXXFLAGS = $(NO_OPT_CXXFLAGS) -protobuf_lazy_descriptor_test_SOURCES = \ - google/protobuf/compiler/cpp/cpp_unittest.cc \ - $(COMMON_TEST_SOURCES) -nodist_protobuf_lazy_descriptor_test_SOURCES = $(protoc_outputs) -$(am_protobuf_lazy_descriptor_test_OBJECTS): unittest_proto_middleman - -COMMON_LITE_TEST_SOURCES = \ - google/protobuf/arena_test_util.cc \ - google/protobuf/arena_test_util.h \ - google/protobuf/map_lite_test_util.cc \ - google/protobuf/map_lite_test_util.h \ - google/protobuf/map_test_util_impl.h \ - google/protobuf/test_util_lite.cc \ - google/protobuf/test_util_lite.h - -# Build lite_unittest separately, since it doesn't use gtest. It can't -# depend on gtest because our internal version of gtest depend on proto -# full runtime and we want to make sure this test builds without full -# runtime. -protobuf_lite_test_LDADD = $(PTHREAD_LIBS) libprotobuf-lite.la \ - $(GOOGLETEST_BUILD_DIR)/lib/libgtest.la \ - $(GOOGLEMOCK_BUILD_DIR)/lib/libgmock.la \ - $(GOOGLEMOCK_BUILD_DIR)/lib/libgmock_main.la -protobuf_lite_test_CPPFLAGS= -I$(GOOGLEMOCK_SRC_DIR)/include \ - -I$(GOOGLETEST_SRC_DIR)/include -protobuf_lite_test_CXXFLAGS = $(NO_OPT_CXXFLAGS) -protobuf_lite_test_SOURCES = \ - google/protobuf/lite_unittest.cc \ - $(COMMON_LITE_TEST_SOURCES) -nodist_protobuf_lite_test_SOURCES = $(protoc_lite_outputs) -$(am_protobuf_lite_test_OBJECTS): unittest_proto_middleman - -# lite_arena_unittest depends on gtest because teboring@ found that without -# gtest when building the test internally our memory sanitizer doesn't detect -# memory leaks (don't know why). -protobuf_lite_arena_test_LDADD = $(PTHREAD_LIBS) libprotobuf-lite.la \ - $(GOOGLETEST_BUILD_DIR)/lib/libgtest.la \ - $(GOOGLEMOCK_BUILD_DIR)/lib/libgmock.la \ - $(GOOGLEMOCK_BUILD_DIR)/lib/libgmock_main.la -protobuf_lite_arena_test_CPPFLAGS = -I$(GOOGLEMOCK_SRC_DIR)/include \ - -I$(GOOGLETEST_SRC_DIR)/include -protobuf_lite_arena_test_CXXFLAGS = $(NO_OPT_CXXFLAGS) -protobuf_lite_arena_test_SOURCES = \ - google/protobuf/lite_arena_unittest.cc \ - $(COMMON_LITE_TEST_SOURCES) -nodist_protobuf_lite_arena_test_SOURCES = $(protoc_lite_outputs) -$(am_protobuf_lite_arena_test_OBJECTS): unittest_proto_middleman - -# Test plugin binary. -test_plugin_LDADD = $(PTHREAD_LIBS) libprotobuf.la libprotoc.la \ - $(GOOGLETEST_BUILD_DIR)/lib/libgtest.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 - -if HAVE_ZLIB -zcgzip_LDADD = $(PTHREAD_LIBS) libprotobuf.la -zcgzip_SOURCES = google/protobuf/testing/zcgzip.cc - -zcgunzip_LDADD = $(PTHREAD_LIBS) libprotobuf.la -zcgunzip_SOURCES = google/protobuf/testing/zcgunzip.cc -endif - -# This test target is to ensure all our public header files and generated -# code is free from warnings. We have to be more pedantic about these -# files because they are compiled by users with different compiler flags. -no_warning_test.cc: - echo "// Generated from Makefile.am" > no_warning_test.cc - for FILE in $(nobase_include_HEADERS); do \ - 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 - -no_warning_test_LDADD = $(PTHREAD_LIBS) libprotobuf.la libprotoc.la -no_warning_test_CXXFLAGS = $(PTHREAD_CFLAGS) $(PTHREAD_DEF) $(ZLIB_DEF) \ - -Wall -Wextra -Werror -Wno-unused-parameter -nodist_no_warning_test_SOURCES = no_warning_test.cc $(protoc_outputs) - -TESTS = protobuf-test protobuf-lazy-descriptor-test protobuf-lite-test \ - google/protobuf/compiler/zip_output_unittest.sh $(GZTESTS) \ - protobuf-lite-arena-test no-warning-test diff --git a/extra/protobuf/protobuf-3.19.4/src/Makefile.in b/extra/protobuf/protobuf-3.19.4/src/Makefile.in deleted file mode 100644 index 3ee930f8c423..000000000000 --- a/extra/protobuf/protobuf-3.19.4/src/Makefile.in +++ /dev/null @@ -1,9468 +0,0 @@ -# Makefile.in generated by automake 1.16.5 from Makefile.am. -# @configure_input@ - -# Copyright (C) 1994-2021 Free Software Foundation, Inc. - -# This Makefile.in is free software; the Free Software Foundation -# gives unlimited permission to copy and/or distribute it, -# with or without modifications, as long as this notice is preserved. - -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY, to the extent permitted by law; without -# even the implied warranty of MERCHANTABILITY or FITNESS FOR A -# PARTICULAR PURPOSE. - -@SET_MAKE@ - - - - -VPATH = @srcdir@ -am__is_gnu_make = { \ - if test -z '$(MAKELEVEL)'; then \ - false; \ - elif test -n '$(MAKE_HOST)'; then \ - true; \ - elif test -n '$(MAKE_VERSION)' && test -n '$(CURDIR)'; then \ - true; \ - else \ - false; \ - fi; \ -} -am__make_running_with_option = \ - case $${target_option-} in \ - ?) ;; \ - *) echo "am__make_running_with_option: internal error: invalid" \ - "target option '$${target_option-}' specified" >&2; \ - exit 1;; \ - esac; \ - has_opt=no; \ - sane_makeflags=$$MAKEFLAGS; \ - if $(am__is_gnu_make); then \ - sane_makeflags=$$MFLAGS; \ - else \ - case $$MAKEFLAGS in \ - *\\[\ \ ]*) \ - bs=\\; \ - sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \ - | sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \ - esac; \ - fi; \ - skip_next=no; \ - strip_trailopt () \ - { \ - flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \ - }; \ - for flg in $$sane_makeflags; do \ - test $$skip_next = yes && { skip_next=no; continue; }; \ - case $$flg in \ - *=*|--*) continue;; \ - -*I) strip_trailopt 'I'; skip_next=yes;; \ - -*I?*) strip_trailopt 'I';; \ - -*O) strip_trailopt 'O'; skip_next=yes;; \ - -*O?*) strip_trailopt 'O';; \ - -*l) strip_trailopt 'l'; skip_next=yes;; \ - -*l?*) strip_trailopt 'l';; \ - -[dEDm]) skip_next=yes;; \ - -[JT]) skip_next=yes;; \ - esac; \ - case $$flg in \ - *$$target_option*) has_opt=yes; break;; \ - esac; \ - done; \ - test $$has_opt = yes -am__make_dryrun = (target_option=n; $(am__make_running_with_option)) -am__make_keepgoing = (target_option=k; $(am__make_running_with_option)) -pkgdatadir = $(datadir)/@PACKAGE@ -pkgincludedir = $(includedir)/@PACKAGE@ -pkglibdir = $(libdir)/@PACKAGE@ -pkglibexecdir = $(libexecdir)/@PACKAGE@ -am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd -install_sh_DATA = $(install_sh) -c -m 644 -install_sh_PROGRAM = $(install_sh) -c -install_sh_SCRIPT = $(install_sh) -c -INSTALL_HEADER = $(INSTALL_DATA) -transform = $(program_transform_name) -NORMAL_INSTALL = : -PRE_INSTALL = : -POST_INSTALL = : -NORMAL_UNINSTALL = : -PRE_UNINSTALL = : -POST_UNINSTALL = : -build_triplet = @build@ -host_triplet = @host@ -target_triplet = @target@ -@HAVE_LD_VERSION_SCRIPT_TRUE@am__append_1 = -Wl,--version-script=$(srcdir)/libprotobuf-lite.map -@HAVE_LD_VERSION_SCRIPT_TRUE@am__append_2 = -Wl,--version-script=$(srcdir)/libprotobuf.map -@HAVE_LD_VERSION_SCRIPT_TRUE@am__append_3 = -Wl,--version-script=$(srcdir)/libprotoc.map -bin_PROGRAMS = protoc$(EXEEXT) -check_PROGRAMS = protoc$(EXEEXT) protobuf-test$(EXEEXT) \ - protobuf-lazy-descriptor-test$(EXEEXT) \ - protobuf-lite-test$(EXEEXT) test_plugin$(EXEEXT) \ - protobuf-lite-arena-test$(EXEEXT) no-warning-test$(EXEEXT) \ - $(am__EXEEXT_1) -TESTS = protobuf-test$(EXEEXT) protobuf-lazy-descriptor-test$(EXEEXT) \ - protobuf-lite-test$(EXEEXT) \ - google/protobuf/compiler/zip_output_unittest.sh \ - $(am__EXEEXT_2) protobuf-lite-arena-test$(EXEEXT) \ - no-warning-test$(EXEEXT) -subdir = src -ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 -am__aclocal_m4_deps = $(top_srcdir)/m4/ac_system_extensions.m4 \ - $(top_srcdir)/m4/acx_check_suncc.m4 \ - $(top_srcdir)/m4/ax_cxx_compile_stdcxx.m4 \ - $(top_srcdir)/m4/ax_prog_cc_for_build.m4 \ - $(top_srcdir)/m4/ax_prog_cxx_for_build.m4 \ - $(top_srcdir)/m4/ax_pthread.m4 $(top_srcdir)/m4/libtool.m4 \ - $(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \ - $(top_srcdir)/m4/ltversion.m4 $(top_srcdir)/m4/lt~obsolete.m4 \ - $(top_srcdir)/m4/stl_hash.m4 $(top_srcdir)/configure.ac -am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ - $(ACLOCAL_M4) -DIST_COMMON = $(srcdir)/Makefile.am $(nobase_dist_proto_DATA) \ - $(am__nobase_include_HEADERS_DIST) $(am__DIST_COMMON) -mkinstalldirs = $(install_sh) -d -CONFIG_HEADER = $(top_builddir)/config.h -CONFIG_CLEAN_FILES = -CONFIG_CLEAN_VPATH_FILES = -am__installdirs = "$(DESTDIR)$(bindir)" "$(DESTDIR)$(libdir)" \ - "$(DESTDIR)$(protodir)" "$(DESTDIR)$(includedir)" -@HAVE_ZLIB_TRUE@am__EXEEXT_1 = zcgzip$(EXEEXT) zcgunzip$(EXEEXT) -PROGRAMS = $(bin_PROGRAMS) -am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; -am__vpath_adj = case $$p in \ - $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \ - *) f=$$p;; \ - esac; -am__strip_dir = f=`echo $$p | sed -e 's|^.*/||'`; -am__install_max = 40 -am__nobase_strip_setup = \ - srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'` -am__nobase_strip = \ - for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||" -am__nobase_list = $(am__nobase_strip_setup); \ - for p in $$list; do echo "$$p $$p"; done | \ - sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \ - $(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \ - if (++n[$$2] == $(am__install_max)) \ - { print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \ - END { for (dir in files) print dir, files[dir] }' -am__base_list = \ - sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \ - sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g' -am__uninstall_files_from_dir = { \ - test -z "$$files" \ - || { test ! -d "$$dir" && test ! -f "$$dir" && test ! -r "$$dir"; } \ - || { echo " ( cd '$$dir' && rm -f" $$files ")"; \ - $(am__cd) "$$dir" && rm -f $$files; }; \ - } -LTLIBRARIES = $(lib_LTLIBRARIES) -am__DEPENDENCIES_1 = -libprotobuf_lite_la_DEPENDENCIES = $(am__DEPENDENCIES_1) \ - $(am__DEPENDENCIES_1) -am__dirstamp = $(am__leading_dot)dirstamp -am_libprotobuf_lite_la_OBJECTS = google/protobuf/any_lite.lo \ - google/protobuf/arena.lo google/protobuf/arenastring.lo \ - google/protobuf/extension_set.lo \ - google/protobuf/generated_enum_util.lo \ - google/protobuf/generated_message_table_driven_lite.lo \ - google/protobuf/generated_message_tctable_lite.lo \ - google/protobuf/generated_message_util.lo \ - google/protobuf/implicit_weak_message.lo \ - google/protobuf/inlined_string_field.lo \ - google/protobuf/io/coded_stream.lo \ - google/protobuf/io/io_win32.lo google/protobuf/io/strtod.lo \ - google/protobuf/io/zero_copy_stream.lo \ - google/protobuf/io/zero_copy_stream_impl.lo \ - google/protobuf/io/zero_copy_stream_impl_lite.lo \ - google/protobuf/map.lo google/protobuf/message_lite.lo \ - google/protobuf/parse_context.lo \ - google/protobuf/repeated_field.lo \ - google/protobuf/repeated_ptr_field.lo \ - google/protobuf/stubs/bytestream.lo \ - google/protobuf/stubs/common.lo \ - google/protobuf/stubs/int128.lo \ - google/protobuf/stubs/status.lo \ - google/protobuf/stubs/statusor.lo \ - google/protobuf/stubs/stringpiece.lo \ - google/protobuf/stubs/stringprintf.lo \ - google/protobuf/stubs/structurally_valid.lo \ - google/protobuf/stubs/strutil.lo google/protobuf/stubs/time.lo \ - google/protobuf/wire_format_lite.lo -libprotobuf_lite_la_OBJECTS = $(am_libprotobuf_lite_la_OBJECTS) -AM_V_lt = $(am__v_lt_@AM_V@) -am__v_lt_ = $(am__v_lt_@AM_DEFAULT_V@) -am__v_lt_0 = --silent -am__v_lt_1 = -libprotobuf_lite_la_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CXX \ - $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=link $(CXXLD) \ - $(AM_CXXFLAGS) $(CXXFLAGS) $(libprotobuf_lite_la_LDFLAGS) \ - $(LDFLAGS) -o $@ -libprotobuf_la_DEPENDENCIES = $(am__DEPENDENCIES_1) \ - $(am__DEPENDENCIES_1) -am__objects_1 = google/protobuf/any_lite.lo google/protobuf/arena.lo \ - google/protobuf/arenastring.lo \ - google/protobuf/extension_set.lo \ - google/protobuf/generated_enum_util.lo \ - google/protobuf/generated_message_table_driven_lite.lo \ - google/protobuf/generated_message_tctable_lite.lo \ - google/protobuf/generated_message_util.lo \ - google/protobuf/implicit_weak_message.lo \ - google/protobuf/inlined_string_field.lo \ - google/protobuf/io/coded_stream.lo \ - google/protobuf/io/io_win32.lo google/protobuf/io/strtod.lo \ - google/protobuf/io/zero_copy_stream.lo \ - google/protobuf/io/zero_copy_stream_impl.lo \ - google/protobuf/io/zero_copy_stream_impl_lite.lo \ - google/protobuf/map.lo google/protobuf/message_lite.lo \ - google/protobuf/parse_context.lo \ - google/protobuf/repeated_field.lo \ - google/protobuf/repeated_ptr_field.lo \ - google/protobuf/stubs/bytestream.lo \ - google/protobuf/stubs/common.lo \ - google/protobuf/stubs/int128.lo \ - google/protobuf/stubs/status.lo \ - google/protobuf/stubs/statusor.lo \ - google/protobuf/stubs/stringpiece.lo \ - google/protobuf/stubs/stringprintf.lo \ - google/protobuf/stubs/structurally_valid.lo \ - google/protobuf/stubs/strutil.lo google/protobuf/stubs/time.lo \ - google/protobuf/wire_format_lite.lo -am_libprotobuf_la_OBJECTS = $(am__objects_1) google/protobuf/any.lo \ - google/protobuf/any.pb.lo google/protobuf/api.pb.lo \ - google/protobuf/compiler/importer.lo \ - google/protobuf/compiler/parser.lo \ - google/protobuf/descriptor.lo google/protobuf/descriptor.pb.lo \ - google/protobuf/descriptor_database.lo \ - google/protobuf/duration.pb.lo \ - google/protobuf/dynamic_message.lo google/protobuf/empty.pb.lo \ - google/protobuf/extension_set_heavy.lo \ - google/protobuf/field_mask.pb.lo \ - google/protobuf/generated_message_bases.lo \ - google/protobuf/generated_message_reflection.lo \ - google/protobuf/generated_message_table_driven.lo \ - google/protobuf/generated_message_tctable_full.lo \ - google/protobuf/io/gzip_stream.lo \ - google/protobuf/io/printer.lo google/protobuf/io/tokenizer.lo \ - google/protobuf/map_field.lo google/protobuf/message.lo \ - google/protobuf/reflection_ops.lo google/protobuf/service.lo \ - google/protobuf/source_context.pb.lo \ - google/protobuf/struct.pb.lo \ - google/protobuf/stubs/substitute.lo \ - google/protobuf/text_format.lo google/protobuf/timestamp.pb.lo \ - google/protobuf/type.pb.lo \ - google/protobuf/unknown_field_set.lo \ - google/protobuf/util/delimited_message_util.lo \ - google/protobuf/util/field_comparator.lo \ - google/protobuf/util/field_mask_util.lo \ - google/protobuf/util/internal/datapiece.lo \ - google/protobuf/util/internal/default_value_objectwriter.lo \ - google/protobuf/util/internal/error_listener.lo \ - google/protobuf/util/internal/field_mask_utility.lo \ - google/protobuf/util/internal/json_escaping.lo \ - google/protobuf/util/internal/json_objectwriter.lo \ - google/protobuf/util/internal/json_stream_parser.lo \ - google/protobuf/util/internal/object_writer.lo \ - google/protobuf/util/internal/proto_writer.lo \ - google/protobuf/util/internal/protostream_objectsource.lo \ - google/protobuf/util/internal/protostream_objectwriter.lo \ - google/protobuf/util/internal/type_info.lo \ - google/protobuf/util/internal/utility.lo \ - google/protobuf/util/json_util.lo \ - google/protobuf/util/message_differencer.lo \ - google/protobuf/util/time_util.lo \ - google/protobuf/util/type_resolver_util.lo \ - google/protobuf/wire_format.lo google/protobuf/wrappers.pb.lo -nodist_libprotobuf_la_OBJECTS = -libprotobuf_la_OBJECTS = $(am_libprotobuf_la_OBJECTS) \ - $(nodist_libprotobuf_la_OBJECTS) -libprotobuf_la_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CXX \ - $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=link $(CXXLD) \ - $(AM_CXXFLAGS) $(CXXFLAGS) $(libprotobuf_la_LDFLAGS) \ - $(LDFLAGS) -o $@ -libprotoc_la_DEPENDENCIES = $(am__DEPENDENCIES_1) libprotobuf.la -am_libprotoc_la_OBJECTS = google/protobuf/compiler/code_generator.lo \ - google/protobuf/compiler/command_line_interface.lo \ - google/protobuf/compiler/cpp/cpp_enum.lo \ - google/protobuf/compiler/cpp/cpp_enum_field.lo \ - google/protobuf/compiler/cpp/cpp_extension.lo \ - google/protobuf/compiler/cpp/cpp_field.lo \ - google/protobuf/compiler/cpp/cpp_file.lo \ - google/protobuf/compiler/cpp/cpp_generator.lo \ - google/protobuf/compiler/cpp/cpp_helpers.lo \ - google/protobuf/compiler/cpp/cpp_map_field.lo \ - google/protobuf/compiler/cpp/cpp_message.lo \ - google/protobuf/compiler/cpp/cpp_message_field.lo \ - google/protobuf/compiler/cpp/cpp_padding_optimizer.lo \ - google/protobuf/compiler/cpp/cpp_parse_function_generator.lo \ - google/protobuf/compiler/cpp/cpp_primitive_field.lo \ - google/protobuf/compiler/cpp/cpp_service.lo \ - google/protobuf/compiler/cpp/cpp_string_field.lo \ - google/protobuf/compiler/csharp/csharp_doc_comment.lo \ - google/protobuf/compiler/csharp/csharp_enum.lo \ - google/protobuf/compiler/csharp/csharp_enum_field.lo \ - google/protobuf/compiler/csharp/csharp_field_base.lo \ - google/protobuf/compiler/csharp/csharp_generator.lo \ - google/protobuf/compiler/csharp/csharp_helpers.lo \ - google/protobuf/compiler/csharp/csharp_map_field.lo \ - google/protobuf/compiler/csharp/csharp_message.lo \ - google/protobuf/compiler/csharp/csharp_message_field.lo \ - google/protobuf/compiler/csharp/csharp_primitive_field.lo \ - google/protobuf/compiler/csharp/csharp_reflection_class.lo \ - google/protobuf/compiler/csharp/csharp_repeated_enum_field.lo \ - google/protobuf/compiler/csharp/csharp_repeated_message_field.lo \ - google/protobuf/compiler/csharp/csharp_repeated_primitive_field.lo \ - google/protobuf/compiler/csharp/csharp_source_generator_base.lo \ - google/protobuf/compiler/csharp/csharp_wrapper_field.lo \ - google/protobuf/compiler/java/java_context.lo \ - google/protobuf/compiler/java/java_doc_comment.lo \ - google/protobuf/compiler/java/java_enum.lo \ - google/protobuf/compiler/java/java_enum_field.lo \ - google/protobuf/compiler/java/java_enum_field_lite.lo \ - google/protobuf/compiler/java/java_enum_lite.lo \ - google/protobuf/compiler/java/java_extension.lo \ - google/protobuf/compiler/java/java_extension_lite.lo \ - google/protobuf/compiler/java/java_field.lo \ - google/protobuf/compiler/java/java_file.lo \ - google/protobuf/compiler/java/java_generator.lo \ - google/protobuf/compiler/java/java_generator_factory.lo \ - google/protobuf/compiler/java/java_helpers.lo \ - google/protobuf/compiler/java/java_kotlin_generator.lo \ - google/protobuf/compiler/java/java_map_field.lo \ - google/protobuf/compiler/java/java_map_field_lite.lo \ - google/protobuf/compiler/java/java_message.lo \ - google/protobuf/compiler/java/java_message_builder.lo \ - google/protobuf/compiler/java/java_message_builder_lite.lo \ - google/protobuf/compiler/java/java_message_field.lo \ - google/protobuf/compiler/java/java_message_field_lite.lo \ - google/protobuf/compiler/java/java_message_lite.lo \ - google/protobuf/compiler/java/java_name_resolver.lo \ - google/protobuf/compiler/java/java_primitive_field.lo \ - google/protobuf/compiler/java/java_primitive_field_lite.lo \ - google/protobuf/compiler/java/java_service.lo \ - google/protobuf/compiler/java/java_shared_code_generator.lo \ - google/protobuf/compiler/java/java_string_field.lo \ - google/protobuf/compiler/java/java_string_field_lite.lo \ - google/protobuf/compiler/js/js_generator.lo \ - google/protobuf/compiler/js/well_known_types_embed.lo \ - google/protobuf/compiler/objectivec/objectivec_enum.lo \ - google/protobuf/compiler/objectivec/objectivec_enum_field.lo \ - google/protobuf/compiler/objectivec/objectivec_extension.lo \ - google/protobuf/compiler/objectivec/objectivec_field.lo \ - google/protobuf/compiler/objectivec/objectivec_file.lo \ - google/protobuf/compiler/objectivec/objectivec_generator.lo \ - google/protobuf/compiler/objectivec/objectivec_helpers.lo \ - google/protobuf/compiler/objectivec/objectivec_map_field.lo \ - google/protobuf/compiler/objectivec/objectivec_message.lo \ - google/protobuf/compiler/objectivec/objectivec_message_field.lo \ - google/protobuf/compiler/objectivec/objectivec_oneof.lo \ - google/protobuf/compiler/objectivec/objectivec_primitive_field.lo \ - google/protobuf/compiler/php/php_generator.lo \ - google/protobuf/compiler/plugin.lo \ - google/protobuf/compiler/plugin.pb.lo \ - google/protobuf/compiler/python/python_generator.lo \ - google/protobuf/compiler/ruby/ruby_generator.lo \ - google/protobuf/compiler/subprocess.lo \ - google/protobuf/compiler/zip_writer.lo -libprotoc_la_OBJECTS = $(am_libprotoc_la_OBJECTS) -libprotoc_la_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) \ - $(LIBTOOLFLAGS) --mode=link $(CXXLD) $(AM_CXXFLAGS) \ - $(CXXFLAGS) $(libprotoc_la_LDFLAGS) $(LDFLAGS) -o $@ -am__objects_2 = google/protobuf/no_warning_test-map_lite_unittest.pb.$(OBJEXT) \ - google/protobuf/no_warning_test-unittest_import_lite.pb.$(OBJEXT) \ - google/protobuf/no_warning_test-unittest_import_public_lite.pb.$(OBJEXT) \ - google/protobuf/no_warning_test-unittest_lite.pb.$(OBJEXT) -am__objects_3 = $(am__objects_2) \ - google/protobuf/no_warning_test-any_test.pb.$(OBJEXT) \ - google/protobuf/compiler/cpp/no_warning_test-cpp_test_bad_identifiers.pb.$(OBJEXT) \ - google/protobuf/compiler/cpp/no_warning_test-cpp_test_large_enum_value.pb.$(OBJEXT) \ - google/protobuf/no_warning_test-map_proto2_unittest.pb.$(OBJEXT) \ - google/protobuf/no_warning_test-map_unittest.pb.$(OBJEXT) \ - google/protobuf/no_warning_test-unittest.pb.$(OBJEXT) \ - google/protobuf/no_warning_test-unittest_arena.pb.$(OBJEXT) \ - google/protobuf/no_warning_test-unittest_custom_options.pb.$(OBJEXT) \ - google/protobuf/no_warning_test-unittest_drop_unknown_fields.pb.$(OBJEXT) \ - google/protobuf/no_warning_test-unittest_embed_optimize_for.pb.$(OBJEXT) \ - google/protobuf/no_warning_test-unittest_empty.pb.$(OBJEXT) \ - google/protobuf/no_warning_test-unittest_enormous_descriptor.pb.$(OBJEXT) \ - google/protobuf/no_warning_test-unittest_import.pb.$(OBJEXT) \ - google/protobuf/no_warning_test-unittest_import_public.pb.$(OBJEXT) \ - google/protobuf/no_warning_test-unittest_lazy_dependencies.pb.$(OBJEXT) \ - google/protobuf/no_warning_test-unittest_lazy_dependencies_custom_option.pb.$(OBJEXT) \ - google/protobuf/no_warning_test-unittest_lazy_dependencies_enum.pb.$(OBJEXT) \ - google/protobuf/no_warning_test-unittest_lite_imports_nonlite.pb.$(OBJEXT) \ - google/protobuf/no_warning_test-unittest_mset.pb.$(OBJEXT) \ - google/protobuf/no_warning_test-unittest_mset_wire_format.pb.$(OBJEXT) \ - google/protobuf/no_warning_test-unittest_no_field_presence.pb.$(OBJEXT) \ - google/protobuf/no_warning_test-unittest_no_generic_services.pb.$(OBJEXT) \ - google/protobuf/no_warning_test-unittest_optimize_for.pb.$(OBJEXT) \ - google/protobuf/no_warning_test-unittest_preserve_unknown_enum.pb.$(OBJEXT) \ - google/protobuf/no_warning_test-unittest_preserve_unknown_enum2.pb.$(OBJEXT) \ - google/protobuf/no_warning_test-unittest_proto3.pb.$(OBJEXT) \ - google/protobuf/no_warning_test-unittest_proto3_arena.pb.$(OBJEXT) \ - google/protobuf/no_warning_test-unittest_proto3_arena_lite.pb.$(OBJEXT) \ - google/protobuf/no_warning_test-unittest_proto3_lite.pb.$(OBJEXT) \ - google/protobuf/no_warning_test-unittest_proto3_optional.pb.$(OBJEXT) \ - google/protobuf/no_warning_test-unittest_well_known_types.pb.$(OBJEXT) \ - google/protobuf/util/internal/testdata/no_warning_test-anys.pb.$(OBJEXT) \ - google/protobuf/util/internal/testdata/no_warning_test-books.pb.$(OBJEXT) \ - google/protobuf/util/internal/testdata/no_warning_test-default_value.pb.$(OBJEXT) \ - google/protobuf/util/internal/testdata/no_warning_test-default_value_test.pb.$(OBJEXT) \ - google/protobuf/util/internal/testdata/no_warning_test-field_mask.pb.$(OBJEXT) \ - google/protobuf/util/internal/testdata/no_warning_test-maps.pb.$(OBJEXT) \ - google/protobuf/util/internal/testdata/no_warning_test-oneofs.pb.$(OBJEXT) \ - google/protobuf/util/internal/testdata/no_warning_test-proto3.pb.$(OBJEXT) \ - google/protobuf/util/internal/testdata/no_warning_test-struct.pb.$(OBJEXT) \ - google/protobuf/util/internal/testdata/no_warning_test-timestamp_duration.pb.$(OBJEXT) \ - google/protobuf/util/internal/testdata/no_warning_test-wrappers.pb.$(OBJEXT) \ - google/protobuf/util/no_warning_test-json_format.pb.$(OBJEXT) \ - google/protobuf/util/no_warning_test-json_format_proto3.pb.$(OBJEXT) \ - google/protobuf/util/no_warning_test-message_differencer_unittest.pb.$(OBJEXT) -nodist_no_warning_test_OBJECTS = \ - no_warning_test-no_warning_test.$(OBJEXT) $(am__objects_3) -no_warning_test_OBJECTS = $(nodist_no_warning_test_OBJECTS) -no_warning_test_DEPENDENCIES = $(am__DEPENDENCIES_1) libprotobuf.la \ - libprotoc.la -no_warning_test_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CXX \ - $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=link $(CXXLD) \ - $(no_warning_test_CXXFLAGS) $(CXXFLAGS) $(AM_LDFLAGS) \ - $(LDFLAGS) -o $@ -am__objects_4 = google/protobuf/protobuf_lazy_descriptor_test-arena_test_util.$(OBJEXT) \ - google/protobuf/protobuf_lazy_descriptor_test-map_lite_test_util.$(OBJEXT) \ - google/protobuf/protobuf_lazy_descriptor_test-test_util_lite.$(OBJEXT) -am__objects_5 = $(am__objects_4) \ - google/protobuf/protobuf_lazy_descriptor_test-reflection_tester.$(OBJEXT) \ - google/protobuf/protobuf_lazy_descriptor_test-test_util.$(OBJEXT) \ - google/protobuf/testing/protobuf_lazy_descriptor_test-file.$(OBJEXT) \ - google/protobuf/testing/protobuf_lazy_descriptor_test-googletest.$(OBJEXT) -am_protobuf_lazy_descriptor_test_OBJECTS = google/protobuf/compiler/cpp/protobuf_lazy_descriptor_test-cpp_unittest.$(OBJEXT) \ - $(am__objects_5) -am__objects_6 = google/protobuf/protobuf_lazy_descriptor_test-map_lite_unittest.pb.$(OBJEXT) \ - google/protobuf/protobuf_lazy_descriptor_test-unittest_import_lite.pb.$(OBJEXT) \ - google/protobuf/protobuf_lazy_descriptor_test-unittest_import_public_lite.pb.$(OBJEXT) \ - google/protobuf/protobuf_lazy_descriptor_test-unittest_lite.pb.$(OBJEXT) -am__objects_7 = $(am__objects_6) \ - google/protobuf/protobuf_lazy_descriptor_test-any_test.pb.$(OBJEXT) \ - google/protobuf/compiler/cpp/protobuf_lazy_descriptor_test-cpp_test_bad_identifiers.pb.$(OBJEXT) \ - google/protobuf/compiler/cpp/protobuf_lazy_descriptor_test-cpp_test_large_enum_value.pb.$(OBJEXT) \ - google/protobuf/protobuf_lazy_descriptor_test-map_proto2_unittest.pb.$(OBJEXT) \ - google/protobuf/protobuf_lazy_descriptor_test-map_unittest.pb.$(OBJEXT) \ - google/protobuf/protobuf_lazy_descriptor_test-unittest.pb.$(OBJEXT) \ - google/protobuf/protobuf_lazy_descriptor_test-unittest_arena.pb.$(OBJEXT) \ - google/protobuf/protobuf_lazy_descriptor_test-unittest_custom_options.pb.$(OBJEXT) \ - google/protobuf/protobuf_lazy_descriptor_test-unittest_drop_unknown_fields.pb.$(OBJEXT) \ - google/protobuf/protobuf_lazy_descriptor_test-unittest_embed_optimize_for.pb.$(OBJEXT) \ - google/protobuf/protobuf_lazy_descriptor_test-unittest_empty.pb.$(OBJEXT) \ - google/protobuf/protobuf_lazy_descriptor_test-unittest_enormous_descriptor.pb.$(OBJEXT) \ - google/protobuf/protobuf_lazy_descriptor_test-unittest_import.pb.$(OBJEXT) \ - google/protobuf/protobuf_lazy_descriptor_test-unittest_import_public.pb.$(OBJEXT) \ - google/protobuf/protobuf_lazy_descriptor_test-unittest_lazy_dependencies.pb.$(OBJEXT) \ - google/protobuf/protobuf_lazy_descriptor_test-unittest_lazy_dependencies_custom_option.pb.$(OBJEXT) \ - google/protobuf/protobuf_lazy_descriptor_test-unittest_lazy_dependencies_enum.pb.$(OBJEXT) \ - google/protobuf/protobuf_lazy_descriptor_test-unittest_lite_imports_nonlite.pb.$(OBJEXT) \ - google/protobuf/protobuf_lazy_descriptor_test-unittest_mset.pb.$(OBJEXT) \ - google/protobuf/protobuf_lazy_descriptor_test-unittest_mset_wire_format.pb.$(OBJEXT) \ - google/protobuf/protobuf_lazy_descriptor_test-unittest_no_field_presence.pb.$(OBJEXT) \ - google/protobuf/protobuf_lazy_descriptor_test-unittest_no_generic_services.pb.$(OBJEXT) \ - google/protobuf/protobuf_lazy_descriptor_test-unittest_optimize_for.pb.$(OBJEXT) \ - google/protobuf/protobuf_lazy_descriptor_test-unittest_preserve_unknown_enum.pb.$(OBJEXT) \ - google/protobuf/protobuf_lazy_descriptor_test-unittest_preserve_unknown_enum2.pb.$(OBJEXT) \ - google/protobuf/protobuf_lazy_descriptor_test-unittest_proto3.pb.$(OBJEXT) \ - google/protobuf/protobuf_lazy_descriptor_test-unittest_proto3_arena.pb.$(OBJEXT) \ - google/protobuf/protobuf_lazy_descriptor_test-unittest_proto3_arena_lite.pb.$(OBJEXT) \ - google/protobuf/protobuf_lazy_descriptor_test-unittest_proto3_lite.pb.$(OBJEXT) \ - google/protobuf/protobuf_lazy_descriptor_test-unittest_proto3_optional.pb.$(OBJEXT) \ - google/protobuf/protobuf_lazy_descriptor_test-unittest_well_known_types.pb.$(OBJEXT) \ - google/protobuf/util/internal/testdata/protobuf_lazy_descriptor_test-anys.pb.$(OBJEXT) \ - google/protobuf/util/internal/testdata/protobuf_lazy_descriptor_test-books.pb.$(OBJEXT) \ - google/protobuf/util/internal/testdata/protobuf_lazy_descriptor_test-default_value.pb.$(OBJEXT) \ - google/protobuf/util/internal/testdata/protobuf_lazy_descriptor_test-default_value_test.pb.$(OBJEXT) \ - google/protobuf/util/internal/testdata/protobuf_lazy_descriptor_test-field_mask.pb.$(OBJEXT) \ - google/protobuf/util/internal/testdata/protobuf_lazy_descriptor_test-maps.pb.$(OBJEXT) \ - google/protobuf/util/internal/testdata/protobuf_lazy_descriptor_test-oneofs.pb.$(OBJEXT) \ - google/protobuf/util/internal/testdata/protobuf_lazy_descriptor_test-proto3.pb.$(OBJEXT) \ - google/protobuf/util/internal/testdata/protobuf_lazy_descriptor_test-struct.pb.$(OBJEXT) \ - google/protobuf/util/internal/testdata/protobuf_lazy_descriptor_test-timestamp_duration.pb.$(OBJEXT) \ - google/protobuf/util/internal/testdata/protobuf_lazy_descriptor_test-wrappers.pb.$(OBJEXT) \ - google/protobuf/util/protobuf_lazy_descriptor_test-json_format.pb.$(OBJEXT) \ - google/protobuf/util/protobuf_lazy_descriptor_test-json_format_proto3.pb.$(OBJEXT) \ - google/protobuf/util/protobuf_lazy_descriptor_test-message_differencer_unittest.pb.$(OBJEXT) -nodist_protobuf_lazy_descriptor_test_OBJECTS = $(am__objects_7) -protobuf_lazy_descriptor_test_OBJECTS = \ - $(am_protobuf_lazy_descriptor_test_OBJECTS) \ - $(nodist_protobuf_lazy_descriptor_test_OBJECTS) -protobuf_lazy_descriptor_test_DEPENDENCIES = $(am__DEPENDENCIES_1) \ - libprotobuf.la libprotoc.la \ - $(GOOGLETEST_BUILD_DIR)/lib/libgtest.la \ - $(GOOGLEMOCK_BUILD_DIR)/lib/libgmock.la \ - $(GOOGLEMOCK_BUILD_DIR)/lib/libgmock_main.la -protobuf_lazy_descriptor_test_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CXX \ - $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=link $(CXXLD) \ - $(protobuf_lazy_descriptor_test_CXXFLAGS) $(CXXFLAGS) \ - $(AM_LDFLAGS) $(LDFLAGS) -o $@ -am__objects_8 = google/protobuf/protobuf_lite_arena_test-arena_test_util.$(OBJEXT) \ - google/protobuf/protobuf_lite_arena_test-map_lite_test_util.$(OBJEXT) \ - google/protobuf/protobuf_lite_arena_test-test_util_lite.$(OBJEXT) -am_protobuf_lite_arena_test_OBJECTS = google/protobuf/protobuf_lite_arena_test-lite_arena_unittest.$(OBJEXT) \ - $(am__objects_8) -am__objects_9 = google/protobuf/protobuf_lite_arena_test-map_lite_unittest.pb.$(OBJEXT) \ - google/protobuf/protobuf_lite_arena_test-unittest_import_lite.pb.$(OBJEXT) \ - google/protobuf/protobuf_lite_arena_test-unittest_import_public_lite.pb.$(OBJEXT) \ - google/protobuf/protobuf_lite_arena_test-unittest_lite.pb.$(OBJEXT) -nodist_protobuf_lite_arena_test_OBJECTS = $(am__objects_9) -protobuf_lite_arena_test_OBJECTS = \ - $(am_protobuf_lite_arena_test_OBJECTS) \ - $(nodist_protobuf_lite_arena_test_OBJECTS) -protobuf_lite_arena_test_DEPENDENCIES = $(am__DEPENDENCIES_1) \ - libprotobuf-lite.la $(GOOGLETEST_BUILD_DIR)/lib/libgtest.la \ - $(GOOGLEMOCK_BUILD_DIR)/lib/libgmock.la \ - $(GOOGLEMOCK_BUILD_DIR)/lib/libgmock_main.la -protobuf_lite_arena_test_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CXX \ - $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=link $(CXXLD) \ - $(protobuf_lite_arena_test_CXXFLAGS) $(CXXFLAGS) $(AM_LDFLAGS) \ - $(LDFLAGS) -o $@ -am__objects_10 = \ - google/protobuf/protobuf_lite_test-arena_test_util.$(OBJEXT) \ - google/protobuf/protobuf_lite_test-map_lite_test_util.$(OBJEXT) \ - google/protobuf/protobuf_lite_test-test_util_lite.$(OBJEXT) -am_protobuf_lite_test_OBJECTS = \ - google/protobuf/protobuf_lite_test-lite_unittest.$(OBJEXT) \ - $(am__objects_10) -am__objects_11 = google/protobuf/protobuf_lite_test-map_lite_unittest.pb.$(OBJEXT) \ - google/protobuf/protobuf_lite_test-unittest_import_lite.pb.$(OBJEXT) \ - google/protobuf/protobuf_lite_test-unittest_import_public_lite.pb.$(OBJEXT) \ - google/protobuf/protobuf_lite_test-unittest_lite.pb.$(OBJEXT) -nodist_protobuf_lite_test_OBJECTS = $(am__objects_11) -protobuf_lite_test_OBJECTS = $(am_protobuf_lite_test_OBJECTS) \ - $(nodist_protobuf_lite_test_OBJECTS) -protobuf_lite_test_DEPENDENCIES = $(am__DEPENDENCIES_1) \ - libprotobuf-lite.la $(GOOGLETEST_BUILD_DIR)/lib/libgtest.la \ - $(GOOGLEMOCK_BUILD_DIR)/lib/libgmock.la \ - $(GOOGLEMOCK_BUILD_DIR)/lib/libgmock_main.la -protobuf_lite_test_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CXX \ - $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=link $(CXXLD) \ - $(protobuf_lite_test_CXXFLAGS) $(CXXFLAGS) $(AM_LDFLAGS) \ - $(LDFLAGS) -o $@ -am__objects_12 = \ - google/protobuf/protobuf_test-arena_test_util.$(OBJEXT) \ - google/protobuf/protobuf_test-map_lite_test_util.$(OBJEXT) \ - google/protobuf/protobuf_test-test_util_lite.$(OBJEXT) -am__objects_13 = $(am__objects_12) \ - google/protobuf/protobuf_test-reflection_tester.$(OBJEXT) \ - google/protobuf/protobuf_test-test_util.$(OBJEXT) \ - google/protobuf/testing/protobuf_test-file.$(OBJEXT) \ - google/protobuf/testing/protobuf_test-googletest.$(OBJEXT) -am_protobuf_test_OBJECTS = $(am__objects_13) \ - google/protobuf/protobuf_test-any_test.$(OBJEXT) \ - google/protobuf/protobuf_test-arena_unittest.$(OBJEXT) \ - google/protobuf/protobuf_test-arenastring_unittest.$(OBJEXT) \ - google/protobuf/compiler/protobuf_test-annotation_test_util.$(OBJEXT) \ - google/protobuf/compiler/protobuf_test-command_line_interface_unittest.$(OBJEXT) \ - google/protobuf/compiler/cpp/protobuf_test-cpp_bootstrap_unittest.$(OBJEXT) \ - google/protobuf/compiler/cpp/protobuf_test-cpp_move_unittest.$(OBJEXT) \ - google/protobuf/compiler/cpp/protobuf_test-cpp_plugin_unittest.$(OBJEXT) \ - google/protobuf/compiler/cpp/protobuf_test-cpp_unittest.$(OBJEXT) \ - google/protobuf/compiler/cpp/protobuf_test-metadata_test.$(OBJEXT) \ - google/protobuf/compiler/csharp/protobuf_test-csharp_bootstrap_unittest.$(OBJEXT) \ - google/protobuf/compiler/csharp/protobuf_test-csharp_generator_unittest.$(OBJEXT) \ - google/protobuf/compiler/protobuf_test-importer_unittest.$(OBJEXT) \ - google/protobuf/compiler/java/protobuf_test-java_doc_comment_unittest.$(OBJEXT) \ - google/protobuf/compiler/java/protobuf_test-java_plugin_unittest.$(OBJEXT) \ - google/protobuf/compiler/protobuf_test-mock_code_generator.$(OBJEXT) \ - google/protobuf/compiler/objectivec/protobuf_test-objectivec_helpers_unittest.$(OBJEXT) \ - google/protobuf/compiler/protobuf_test-parser_unittest.$(OBJEXT) \ - google/protobuf/compiler/python/protobuf_test-python_plugin_unittest.$(OBJEXT) \ - google/protobuf/compiler/ruby/protobuf_test-ruby_generator_unittest.$(OBJEXT) \ - google/protobuf/protobuf_test-descriptor_database_unittest.$(OBJEXT) \ - google/protobuf/protobuf_test-descriptor_unittest.$(OBJEXT) \ - google/protobuf/protobuf_test-drop_unknown_fields_test.$(OBJEXT) \ - google/protobuf/protobuf_test-dynamic_message_unittest.$(OBJEXT) \ - google/protobuf/protobuf_test-extension_set_unittest.$(OBJEXT) \ - google/protobuf/protobuf_test-generated_message_reflection_unittest.$(OBJEXT) \ - google/protobuf/protobuf_test-inlined_string_field_unittest.$(OBJEXT) \ - google/protobuf/io/protobuf_test-coded_stream_unittest.$(OBJEXT) \ - google/protobuf/io/protobuf_test-io_win32_unittest.$(OBJEXT) \ - google/protobuf/io/protobuf_test-printer_unittest.$(OBJEXT) \ - google/protobuf/io/protobuf_test-tokenizer_unittest.$(OBJEXT) \ - google/protobuf/io/protobuf_test-zero_copy_stream_unittest.$(OBJEXT) \ - google/protobuf/protobuf_test-map_field_test.$(OBJEXT) \ - google/protobuf/protobuf_test-map_test.$(OBJEXT) \ - google/protobuf/protobuf_test-message_unittest.$(OBJEXT) \ - google/protobuf/protobuf_test-no_field_presence_test.$(OBJEXT) \ - google/protobuf/protobuf_test-preserve_unknown_enum_test.$(OBJEXT) \ - google/protobuf/protobuf_test-proto3_arena_lite_unittest.$(OBJEXT) \ - google/protobuf/protobuf_test-proto3_arena_unittest.$(OBJEXT) \ - google/protobuf/protobuf_test-proto3_lite_unittest.$(OBJEXT) \ - google/protobuf/protobuf_test-reflection_ops_unittest.$(OBJEXT) \ - google/protobuf/protobuf_test-repeated_field_reflection_unittest.$(OBJEXT) \ - google/protobuf/protobuf_test-repeated_field_unittest.$(OBJEXT) \ - google/protobuf/stubs/protobuf_test-bytestream_unittest.$(OBJEXT) \ - google/protobuf/stubs/protobuf_test-common_unittest.$(OBJEXT) \ - google/protobuf/stubs/protobuf_test-int128_unittest.$(OBJEXT) \ - google/protobuf/stubs/protobuf_test-status_test.$(OBJEXT) \ - google/protobuf/stubs/protobuf_test-statusor_test.$(OBJEXT) \ - google/protobuf/stubs/protobuf_test-stringpiece_unittest.$(OBJEXT) \ - google/protobuf/stubs/protobuf_test-stringprintf_unittest.$(OBJEXT) \ - google/protobuf/stubs/protobuf_test-structurally_valid_unittest.$(OBJEXT) \ - google/protobuf/stubs/protobuf_test-strutil_unittest.$(OBJEXT) \ - google/protobuf/stubs/protobuf_test-template_util_unittest.$(OBJEXT) \ - google/protobuf/stubs/protobuf_test-time_test.$(OBJEXT) \ - google/protobuf/protobuf_test-text_format_unittest.$(OBJEXT) \ - google/protobuf/protobuf_test-unknown_field_set_unittest.$(OBJEXT) \ - google/protobuf/util/protobuf_test-delimited_message_util_test.$(OBJEXT) \ - google/protobuf/util/protobuf_test-field_comparator_test.$(OBJEXT) \ - google/protobuf/util/protobuf_test-field_mask_util_test.$(OBJEXT) \ - google/protobuf/util/internal/protobuf_test-default_value_objectwriter_test.$(OBJEXT) \ - google/protobuf/util/internal/protobuf_test-json_objectwriter_test.$(OBJEXT) \ - google/protobuf/util/internal/protobuf_test-json_stream_parser_test.$(OBJEXT) \ - google/protobuf/util/internal/protobuf_test-protostream_objectsource_test.$(OBJEXT) \ - google/protobuf/util/internal/protobuf_test-protostream_objectwriter_test.$(OBJEXT) \ - google/protobuf/util/internal/protobuf_test-type_info_test_helper.$(OBJEXT) \ - google/protobuf/util/protobuf_test-json_util_test.$(OBJEXT) \ - google/protobuf/util/protobuf_test-message_differencer_unittest.$(OBJEXT) \ - google/protobuf/util/protobuf_test-time_util_test.$(OBJEXT) \ - google/protobuf/util/protobuf_test-type_resolver_util_test.$(OBJEXT) \ - google/protobuf/protobuf_test-well_known_types_unittest.$(OBJEXT) \ - google/protobuf/protobuf_test-wire_format_unittest.$(OBJEXT) -am__objects_14 = \ - google/protobuf/protobuf_test-map_lite_unittest.pb.$(OBJEXT) \ - google/protobuf/protobuf_test-unittest_import_lite.pb.$(OBJEXT) \ - google/protobuf/protobuf_test-unittest_import_public_lite.pb.$(OBJEXT) \ - google/protobuf/protobuf_test-unittest_lite.pb.$(OBJEXT) -am__objects_15 = $(am__objects_14) \ - google/protobuf/protobuf_test-any_test.pb.$(OBJEXT) \ - google/protobuf/compiler/cpp/protobuf_test-cpp_test_bad_identifiers.pb.$(OBJEXT) \ - google/protobuf/compiler/cpp/protobuf_test-cpp_test_large_enum_value.pb.$(OBJEXT) \ - google/protobuf/protobuf_test-map_proto2_unittest.pb.$(OBJEXT) \ - google/protobuf/protobuf_test-map_unittest.pb.$(OBJEXT) \ - google/protobuf/protobuf_test-unittest.pb.$(OBJEXT) \ - google/protobuf/protobuf_test-unittest_arena.pb.$(OBJEXT) \ - google/protobuf/protobuf_test-unittest_custom_options.pb.$(OBJEXT) \ - google/protobuf/protobuf_test-unittest_drop_unknown_fields.pb.$(OBJEXT) \ - google/protobuf/protobuf_test-unittest_embed_optimize_for.pb.$(OBJEXT) \ - google/protobuf/protobuf_test-unittest_empty.pb.$(OBJEXT) \ - google/protobuf/protobuf_test-unittest_enormous_descriptor.pb.$(OBJEXT) \ - google/protobuf/protobuf_test-unittest_import.pb.$(OBJEXT) \ - google/protobuf/protobuf_test-unittest_import_public.pb.$(OBJEXT) \ - google/protobuf/protobuf_test-unittest_lazy_dependencies.pb.$(OBJEXT) \ - google/protobuf/protobuf_test-unittest_lazy_dependencies_custom_option.pb.$(OBJEXT) \ - google/protobuf/protobuf_test-unittest_lazy_dependencies_enum.pb.$(OBJEXT) \ - google/protobuf/protobuf_test-unittest_lite_imports_nonlite.pb.$(OBJEXT) \ - google/protobuf/protobuf_test-unittest_mset.pb.$(OBJEXT) \ - google/protobuf/protobuf_test-unittest_mset_wire_format.pb.$(OBJEXT) \ - google/protobuf/protobuf_test-unittest_no_field_presence.pb.$(OBJEXT) \ - google/protobuf/protobuf_test-unittest_no_generic_services.pb.$(OBJEXT) \ - google/protobuf/protobuf_test-unittest_optimize_for.pb.$(OBJEXT) \ - google/protobuf/protobuf_test-unittest_preserve_unknown_enum.pb.$(OBJEXT) \ - google/protobuf/protobuf_test-unittest_preserve_unknown_enum2.pb.$(OBJEXT) \ - google/protobuf/protobuf_test-unittest_proto3.pb.$(OBJEXT) \ - google/protobuf/protobuf_test-unittest_proto3_arena.pb.$(OBJEXT) \ - google/protobuf/protobuf_test-unittest_proto3_arena_lite.pb.$(OBJEXT) \ - google/protobuf/protobuf_test-unittest_proto3_lite.pb.$(OBJEXT) \ - google/protobuf/protobuf_test-unittest_proto3_optional.pb.$(OBJEXT) \ - google/protobuf/protobuf_test-unittest_well_known_types.pb.$(OBJEXT) \ - google/protobuf/util/internal/testdata/protobuf_test-anys.pb.$(OBJEXT) \ - google/protobuf/util/internal/testdata/protobuf_test-books.pb.$(OBJEXT) \ - google/protobuf/util/internal/testdata/protobuf_test-default_value.pb.$(OBJEXT) \ - google/protobuf/util/internal/testdata/protobuf_test-default_value_test.pb.$(OBJEXT) \ - google/protobuf/util/internal/testdata/protobuf_test-field_mask.pb.$(OBJEXT) \ - google/protobuf/util/internal/testdata/protobuf_test-maps.pb.$(OBJEXT) \ - google/protobuf/util/internal/testdata/protobuf_test-oneofs.pb.$(OBJEXT) \ - google/protobuf/util/internal/testdata/protobuf_test-proto3.pb.$(OBJEXT) \ - google/protobuf/util/internal/testdata/protobuf_test-struct.pb.$(OBJEXT) \ - google/protobuf/util/internal/testdata/protobuf_test-timestamp_duration.pb.$(OBJEXT) \ - google/protobuf/util/internal/testdata/protobuf_test-wrappers.pb.$(OBJEXT) \ - google/protobuf/util/protobuf_test-json_format.pb.$(OBJEXT) \ - google/protobuf/util/protobuf_test-json_format_proto3.pb.$(OBJEXT) \ - google/protobuf/util/protobuf_test-message_differencer_unittest.pb.$(OBJEXT) -nodist_protobuf_test_OBJECTS = $(am__objects_15) -protobuf_test_OBJECTS = $(am_protobuf_test_OBJECTS) \ - $(nodist_protobuf_test_OBJECTS) -protobuf_test_DEPENDENCIES = $(am__DEPENDENCIES_1) libprotobuf.la \ - libprotoc.la $(GOOGLETEST_BUILD_DIR)/lib/libgtest.la \ - $(GOOGLEMOCK_BUILD_DIR)/lib/libgmock.la \ - $(GOOGLEMOCK_BUILD_DIR)/lib/libgmock_main.la -protobuf_test_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CXX \ - $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=link $(CXXLD) \ - $(protobuf_test_CXXFLAGS) $(CXXFLAGS) $(AM_LDFLAGS) $(LDFLAGS) \ - -o $@ -am_protoc_OBJECTS = google/protobuf/compiler/main.$(OBJEXT) -protoc_OBJECTS = $(am_protoc_OBJECTS) -protoc_DEPENDENCIES = $(am__DEPENDENCIES_1) libprotobuf.la \ - libprotoc.la -am_test_plugin_OBJECTS = google/protobuf/compiler/test_plugin-mock_code_generator.$(OBJEXT) \ - google/protobuf/compiler/test_plugin-test_plugin.$(OBJEXT) \ - google/protobuf/testing/test_plugin-file.$(OBJEXT) -test_plugin_OBJECTS = $(am_test_plugin_OBJECTS) -test_plugin_DEPENDENCIES = $(am__DEPENDENCIES_1) libprotobuf.la \ - libprotoc.la $(GOOGLETEST_BUILD_DIR)/lib/libgtest.la -am__zcgunzip_SOURCES_DIST = google/protobuf/testing/zcgunzip.cc -@HAVE_ZLIB_TRUE@am_zcgunzip_OBJECTS = \ -@HAVE_ZLIB_TRUE@ google/protobuf/testing/zcgunzip.$(OBJEXT) -zcgunzip_OBJECTS = $(am_zcgunzip_OBJECTS) -@HAVE_ZLIB_TRUE@zcgunzip_DEPENDENCIES = $(am__DEPENDENCIES_1) \ -@HAVE_ZLIB_TRUE@ libprotobuf.la -am__zcgzip_SOURCES_DIST = google/protobuf/testing/zcgzip.cc -@HAVE_ZLIB_TRUE@am_zcgzip_OBJECTS = \ -@HAVE_ZLIB_TRUE@ google/protobuf/testing/zcgzip.$(OBJEXT) -zcgzip_OBJECTS = $(am_zcgzip_OBJECTS) -@HAVE_ZLIB_TRUE@zcgzip_DEPENDENCIES = $(am__DEPENDENCIES_1) \ -@HAVE_ZLIB_TRUE@ libprotobuf.la -AM_V_P = $(am__v_P_@AM_V@) -am__v_P_ = $(am__v_P_@AM_DEFAULT_V@) -am__v_P_0 = false -am__v_P_1 = : -AM_V_GEN = $(am__v_GEN_@AM_V@) -am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@) -am__v_GEN_0 = @echo " GEN " $@; -am__v_GEN_1 = -AM_V_at = $(am__v_at_@AM_V@) -am__v_at_ = $(am__v_at_@AM_DEFAULT_V@) -am__v_at_0 = @ -am__v_at_1 = -DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir) -depcomp = $(SHELL) $(top_srcdir)/depcomp -am__maybe_remake_depfiles = depfiles -am__depfiles_remade = ./$(DEPDIR)/no_warning_test-no_warning_test.Po \ - google/protobuf/$(DEPDIR)/any.Plo \ - google/protobuf/$(DEPDIR)/any.pb.Plo \ - google/protobuf/$(DEPDIR)/any_lite.Plo \ - google/protobuf/$(DEPDIR)/api.pb.Plo \ - google/protobuf/$(DEPDIR)/arena.Plo \ - google/protobuf/$(DEPDIR)/arenastring.Plo \ - google/protobuf/$(DEPDIR)/descriptor.Plo \ - google/protobuf/$(DEPDIR)/descriptor.pb.Plo \ - google/protobuf/$(DEPDIR)/descriptor_database.Plo \ - google/protobuf/$(DEPDIR)/duration.pb.Plo \ - google/protobuf/$(DEPDIR)/dynamic_message.Plo \ - google/protobuf/$(DEPDIR)/empty.pb.Plo \ - google/protobuf/$(DEPDIR)/extension_set.Plo \ - google/protobuf/$(DEPDIR)/extension_set_heavy.Plo \ - google/protobuf/$(DEPDIR)/field_mask.pb.Plo \ - google/protobuf/$(DEPDIR)/generated_enum_util.Plo \ - google/protobuf/$(DEPDIR)/generated_message_bases.Plo \ - google/protobuf/$(DEPDIR)/generated_message_reflection.Plo \ - google/protobuf/$(DEPDIR)/generated_message_table_driven.Plo \ - google/protobuf/$(DEPDIR)/generated_message_table_driven_lite.Plo \ - google/protobuf/$(DEPDIR)/generated_message_tctable_full.Plo \ - google/protobuf/$(DEPDIR)/generated_message_tctable_lite.Plo \ - google/protobuf/$(DEPDIR)/generated_message_util.Plo \ - google/protobuf/$(DEPDIR)/implicit_weak_message.Plo \ - google/protobuf/$(DEPDIR)/inlined_string_field.Plo \ - google/protobuf/$(DEPDIR)/map.Plo \ - google/protobuf/$(DEPDIR)/map_field.Plo \ - google/protobuf/$(DEPDIR)/message.Plo \ - google/protobuf/$(DEPDIR)/message_lite.Plo \ - google/protobuf/$(DEPDIR)/no_warning_test-any_test.pb.Po \ - google/protobuf/$(DEPDIR)/no_warning_test-map_lite_unittest.pb.Po \ - google/protobuf/$(DEPDIR)/no_warning_test-map_proto2_unittest.pb.Po \ - google/protobuf/$(DEPDIR)/no_warning_test-map_unittest.pb.Po \ - google/protobuf/$(DEPDIR)/no_warning_test-unittest.pb.Po \ - google/protobuf/$(DEPDIR)/no_warning_test-unittest_arena.pb.Po \ - google/protobuf/$(DEPDIR)/no_warning_test-unittest_custom_options.pb.Po \ - google/protobuf/$(DEPDIR)/no_warning_test-unittest_drop_unknown_fields.pb.Po \ - google/protobuf/$(DEPDIR)/no_warning_test-unittest_embed_optimize_for.pb.Po \ - google/protobuf/$(DEPDIR)/no_warning_test-unittest_empty.pb.Po \ - google/protobuf/$(DEPDIR)/no_warning_test-unittest_enormous_descriptor.pb.Po \ - google/protobuf/$(DEPDIR)/no_warning_test-unittest_import.pb.Po \ - google/protobuf/$(DEPDIR)/no_warning_test-unittest_import_lite.pb.Po \ - google/protobuf/$(DEPDIR)/no_warning_test-unittest_import_public.pb.Po \ - google/protobuf/$(DEPDIR)/no_warning_test-unittest_import_public_lite.pb.Po \ - google/protobuf/$(DEPDIR)/no_warning_test-unittest_lazy_dependencies.pb.Po \ - google/protobuf/$(DEPDIR)/no_warning_test-unittest_lazy_dependencies_custom_option.pb.Po \ - google/protobuf/$(DEPDIR)/no_warning_test-unittest_lazy_dependencies_enum.pb.Po \ - google/protobuf/$(DEPDIR)/no_warning_test-unittest_lite.pb.Po \ - google/protobuf/$(DEPDIR)/no_warning_test-unittest_lite_imports_nonlite.pb.Po \ - google/protobuf/$(DEPDIR)/no_warning_test-unittest_mset.pb.Po \ - google/protobuf/$(DEPDIR)/no_warning_test-unittest_mset_wire_format.pb.Po \ - google/protobuf/$(DEPDIR)/no_warning_test-unittest_no_field_presence.pb.Po \ - google/protobuf/$(DEPDIR)/no_warning_test-unittest_no_generic_services.pb.Po \ - google/protobuf/$(DEPDIR)/no_warning_test-unittest_optimize_for.pb.Po \ - google/protobuf/$(DEPDIR)/no_warning_test-unittest_preserve_unknown_enum.pb.Po \ - google/protobuf/$(DEPDIR)/no_warning_test-unittest_preserve_unknown_enum2.pb.Po \ - google/protobuf/$(DEPDIR)/no_warning_test-unittest_proto3.pb.Po \ - google/protobuf/$(DEPDIR)/no_warning_test-unittest_proto3_arena.pb.Po \ - google/protobuf/$(DEPDIR)/no_warning_test-unittest_proto3_arena_lite.pb.Po \ - google/protobuf/$(DEPDIR)/no_warning_test-unittest_proto3_lite.pb.Po \ - google/protobuf/$(DEPDIR)/no_warning_test-unittest_proto3_optional.pb.Po \ - google/protobuf/$(DEPDIR)/no_warning_test-unittest_well_known_types.pb.Po \ - google/protobuf/$(DEPDIR)/parse_context.Plo \ - google/protobuf/$(DEPDIR)/protobuf_lazy_descriptor_test-any_test.pb.Po \ - google/protobuf/$(DEPDIR)/protobuf_lazy_descriptor_test-arena_test_util.Po \ - google/protobuf/$(DEPDIR)/protobuf_lazy_descriptor_test-map_lite_test_util.Po \ - google/protobuf/$(DEPDIR)/protobuf_lazy_descriptor_test-map_lite_unittest.pb.Po \ - google/protobuf/$(DEPDIR)/protobuf_lazy_descriptor_test-map_proto2_unittest.pb.Po \ - google/protobuf/$(DEPDIR)/protobuf_lazy_descriptor_test-map_unittest.pb.Po \ - google/protobuf/$(DEPDIR)/protobuf_lazy_descriptor_test-reflection_tester.Po \ - google/protobuf/$(DEPDIR)/protobuf_lazy_descriptor_test-test_util.Po \ - google/protobuf/$(DEPDIR)/protobuf_lazy_descriptor_test-test_util_lite.Po \ - google/protobuf/$(DEPDIR)/protobuf_lazy_descriptor_test-unittest.pb.Po \ - google/protobuf/$(DEPDIR)/protobuf_lazy_descriptor_test-unittest_arena.pb.Po \ - google/protobuf/$(DEPDIR)/protobuf_lazy_descriptor_test-unittest_custom_options.pb.Po \ - google/protobuf/$(DEPDIR)/protobuf_lazy_descriptor_test-unittest_drop_unknown_fields.pb.Po \ - google/protobuf/$(DEPDIR)/protobuf_lazy_descriptor_test-unittest_embed_optimize_for.pb.Po \ - google/protobuf/$(DEPDIR)/protobuf_lazy_descriptor_test-unittest_empty.pb.Po \ - google/protobuf/$(DEPDIR)/protobuf_lazy_descriptor_test-unittest_enormous_descriptor.pb.Po \ - google/protobuf/$(DEPDIR)/protobuf_lazy_descriptor_test-unittest_import.pb.Po \ - google/protobuf/$(DEPDIR)/protobuf_lazy_descriptor_test-unittest_import_lite.pb.Po \ - google/protobuf/$(DEPDIR)/protobuf_lazy_descriptor_test-unittest_import_public.pb.Po \ - google/protobuf/$(DEPDIR)/protobuf_lazy_descriptor_test-unittest_import_public_lite.pb.Po \ - google/protobuf/$(DEPDIR)/protobuf_lazy_descriptor_test-unittest_lazy_dependencies.pb.Po \ - google/protobuf/$(DEPDIR)/protobuf_lazy_descriptor_test-unittest_lazy_dependencies_custom_option.pb.Po \ - google/protobuf/$(DEPDIR)/protobuf_lazy_descriptor_test-unittest_lazy_dependencies_enum.pb.Po \ - google/protobuf/$(DEPDIR)/protobuf_lazy_descriptor_test-unittest_lite.pb.Po \ - google/protobuf/$(DEPDIR)/protobuf_lazy_descriptor_test-unittest_lite_imports_nonlite.pb.Po \ - google/protobuf/$(DEPDIR)/protobuf_lazy_descriptor_test-unittest_mset.pb.Po \ - google/protobuf/$(DEPDIR)/protobuf_lazy_descriptor_test-unittest_mset_wire_format.pb.Po \ - google/protobuf/$(DEPDIR)/protobuf_lazy_descriptor_test-unittest_no_field_presence.pb.Po \ - google/protobuf/$(DEPDIR)/protobuf_lazy_descriptor_test-unittest_no_generic_services.pb.Po \ - google/protobuf/$(DEPDIR)/protobuf_lazy_descriptor_test-unittest_optimize_for.pb.Po \ - google/protobuf/$(DEPDIR)/protobuf_lazy_descriptor_test-unittest_preserve_unknown_enum.pb.Po \ - google/protobuf/$(DEPDIR)/protobuf_lazy_descriptor_test-unittest_preserve_unknown_enum2.pb.Po \ - google/protobuf/$(DEPDIR)/protobuf_lazy_descriptor_test-unittest_proto3.pb.Po \ - google/protobuf/$(DEPDIR)/protobuf_lazy_descriptor_test-unittest_proto3_arena.pb.Po \ - google/protobuf/$(DEPDIR)/protobuf_lazy_descriptor_test-unittest_proto3_arena_lite.pb.Po \ - google/protobuf/$(DEPDIR)/protobuf_lazy_descriptor_test-unittest_proto3_lite.pb.Po \ - google/protobuf/$(DEPDIR)/protobuf_lazy_descriptor_test-unittest_proto3_optional.pb.Po \ - google/protobuf/$(DEPDIR)/protobuf_lazy_descriptor_test-unittest_well_known_types.pb.Po \ - google/protobuf/$(DEPDIR)/protobuf_lite_arena_test-arena_test_util.Po \ - google/protobuf/$(DEPDIR)/protobuf_lite_arena_test-lite_arena_unittest.Po \ - google/protobuf/$(DEPDIR)/protobuf_lite_arena_test-map_lite_test_util.Po \ - google/protobuf/$(DEPDIR)/protobuf_lite_arena_test-map_lite_unittest.pb.Po \ - google/protobuf/$(DEPDIR)/protobuf_lite_arena_test-test_util_lite.Po \ - google/protobuf/$(DEPDIR)/protobuf_lite_arena_test-unittest_import_lite.pb.Po \ - google/protobuf/$(DEPDIR)/protobuf_lite_arena_test-unittest_import_public_lite.pb.Po \ - google/protobuf/$(DEPDIR)/protobuf_lite_arena_test-unittest_lite.pb.Po \ - google/protobuf/$(DEPDIR)/protobuf_lite_test-arena_test_util.Po \ - google/protobuf/$(DEPDIR)/protobuf_lite_test-lite_unittest.Po \ - google/protobuf/$(DEPDIR)/protobuf_lite_test-map_lite_test_util.Po \ - google/protobuf/$(DEPDIR)/protobuf_lite_test-map_lite_unittest.pb.Po \ - google/protobuf/$(DEPDIR)/protobuf_lite_test-test_util_lite.Po \ - google/protobuf/$(DEPDIR)/protobuf_lite_test-unittest_import_lite.pb.Po \ - google/protobuf/$(DEPDIR)/protobuf_lite_test-unittest_import_public_lite.pb.Po \ - google/protobuf/$(DEPDIR)/protobuf_lite_test-unittest_lite.pb.Po \ - google/protobuf/$(DEPDIR)/protobuf_test-any_test.Po \ - google/protobuf/$(DEPDIR)/protobuf_test-any_test.pb.Po \ - google/protobuf/$(DEPDIR)/protobuf_test-arena_test_util.Po \ - google/protobuf/$(DEPDIR)/protobuf_test-arena_unittest.Po \ - google/protobuf/$(DEPDIR)/protobuf_test-arenastring_unittest.Po \ - google/protobuf/$(DEPDIR)/protobuf_test-descriptor_database_unittest.Po \ - google/protobuf/$(DEPDIR)/protobuf_test-descriptor_unittest.Po \ - google/protobuf/$(DEPDIR)/protobuf_test-drop_unknown_fields_test.Po \ - google/protobuf/$(DEPDIR)/protobuf_test-dynamic_message_unittest.Po \ - google/protobuf/$(DEPDIR)/protobuf_test-extension_set_unittest.Po \ - google/protobuf/$(DEPDIR)/protobuf_test-generated_message_reflection_unittest.Po \ - google/protobuf/$(DEPDIR)/protobuf_test-inlined_string_field_unittest.Po \ - google/protobuf/$(DEPDIR)/protobuf_test-map_field_test.Po \ - google/protobuf/$(DEPDIR)/protobuf_test-map_lite_test_util.Po \ - google/protobuf/$(DEPDIR)/protobuf_test-map_lite_unittest.pb.Po \ - google/protobuf/$(DEPDIR)/protobuf_test-map_proto2_unittest.pb.Po \ - google/protobuf/$(DEPDIR)/protobuf_test-map_test.Po \ - google/protobuf/$(DEPDIR)/protobuf_test-map_unittest.pb.Po \ - google/protobuf/$(DEPDIR)/protobuf_test-message_unittest.Po \ - google/protobuf/$(DEPDIR)/protobuf_test-no_field_presence_test.Po \ - google/protobuf/$(DEPDIR)/protobuf_test-preserve_unknown_enum_test.Po \ - google/protobuf/$(DEPDIR)/protobuf_test-proto3_arena_lite_unittest.Po \ - google/protobuf/$(DEPDIR)/protobuf_test-proto3_arena_unittest.Po \ - google/protobuf/$(DEPDIR)/protobuf_test-proto3_lite_unittest.Po \ - google/protobuf/$(DEPDIR)/protobuf_test-reflection_ops_unittest.Po \ - google/protobuf/$(DEPDIR)/protobuf_test-reflection_tester.Po \ - google/protobuf/$(DEPDIR)/protobuf_test-repeated_field_reflection_unittest.Po \ - google/protobuf/$(DEPDIR)/protobuf_test-repeated_field_unittest.Po \ - google/protobuf/$(DEPDIR)/protobuf_test-test_util.Po \ - google/protobuf/$(DEPDIR)/protobuf_test-test_util_lite.Po \ - google/protobuf/$(DEPDIR)/protobuf_test-text_format_unittest.Po \ - google/protobuf/$(DEPDIR)/protobuf_test-unittest.pb.Po \ - google/protobuf/$(DEPDIR)/protobuf_test-unittest_arena.pb.Po \ - google/protobuf/$(DEPDIR)/protobuf_test-unittest_custom_options.pb.Po \ - google/protobuf/$(DEPDIR)/protobuf_test-unittest_drop_unknown_fields.pb.Po \ - google/protobuf/$(DEPDIR)/protobuf_test-unittest_embed_optimize_for.pb.Po \ - google/protobuf/$(DEPDIR)/protobuf_test-unittest_empty.pb.Po \ - google/protobuf/$(DEPDIR)/protobuf_test-unittest_enormous_descriptor.pb.Po \ - google/protobuf/$(DEPDIR)/protobuf_test-unittest_import.pb.Po \ - google/protobuf/$(DEPDIR)/protobuf_test-unittest_import_lite.pb.Po \ - google/protobuf/$(DEPDIR)/protobuf_test-unittest_import_public.pb.Po \ - google/protobuf/$(DEPDIR)/protobuf_test-unittest_import_public_lite.pb.Po \ - google/protobuf/$(DEPDIR)/protobuf_test-unittest_lazy_dependencies.pb.Po \ - google/protobuf/$(DEPDIR)/protobuf_test-unittest_lazy_dependencies_custom_option.pb.Po \ - google/protobuf/$(DEPDIR)/protobuf_test-unittest_lazy_dependencies_enum.pb.Po \ - google/protobuf/$(DEPDIR)/protobuf_test-unittest_lite.pb.Po \ - google/protobuf/$(DEPDIR)/protobuf_test-unittest_lite_imports_nonlite.pb.Po \ - google/protobuf/$(DEPDIR)/protobuf_test-unittest_mset.pb.Po \ - google/protobuf/$(DEPDIR)/protobuf_test-unittest_mset_wire_format.pb.Po \ - google/protobuf/$(DEPDIR)/protobuf_test-unittest_no_field_presence.pb.Po \ - google/protobuf/$(DEPDIR)/protobuf_test-unittest_no_generic_services.pb.Po \ - google/protobuf/$(DEPDIR)/protobuf_test-unittest_optimize_for.pb.Po \ - google/protobuf/$(DEPDIR)/protobuf_test-unittest_preserve_unknown_enum.pb.Po \ - google/protobuf/$(DEPDIR)/protobuf_test-unittest_preserve_unknown_enum2.pb.Po \ - google/protobuf/$(DEPDIR)/protobuf_test-unittest_proto3.pb.Po \ - google/protobuf/$(DEPDIR)/protobuf_test-unittest_proto3_arena.pb.Po \ - google/protobuf/$(DEPDIR)/protobuf_test-unittest_proto3_arena_lite.pb.Po \ - google/protobuf/$(DEPDIR)/protobuf_test-unittest_proto3_lite.pb.Po \ - google/protobuf/$(DEPDIR)/protobuf_test-unittest_proto3_optional.pb.Po \ - google/protobuf/$(DEPDIR)/protobuf_test-unittest_well_known_types.pb.Po \ - google/protobuf/$(DEPDIR)/protobuf_test-unknown_field_set_unittest.Po \ - google/protobuf/$(DEPDIR)/protobuf_test-well_known_types_unittest.Po \ - google/protobuf/$(DEPDIR)/protobuf_test-wire_format_unittest.Po \ - google/protobuf/$(DEPDIR)/reflection_ops.Plo \ - google/protobuf/$(DEPDIR)/repeated_field.Plo \ - google/protobuf/$(DEPDIR)/repeated_ptr_field.Plo \ - google/protobuf/$(DEPDIR)/service.Plo \ - google/protobuf/$(DEPDIR)/source_context.pb.Plo \ - google/protobuf/$(DEPDIR)/struct.pb.Plo \ - google/protobuf/$(DEPDIR)/text_format.Plo \ - google/protobuf/$(DEPDIR)/timestamp.pb.Plo \ - google/protobuf/$(DEPDIR)/type.pb.Plo \ - google/protobuf/$(DEPDIR)/unknown_field_set.Plo \ - google/protobuf/$(DEPDIR)/wire_format.Plo \ - google/protobuf/$(DEPDIR)/wire_format_lite.Plo \ - google/protobuf/$(DEPDIR)/wrappers.pb.Plo \ - google/protobuf/compiler/$(DEPDIR)/code_generator.Plo \ - google/protobuf/compiler/$(DEPDIR)/command_line_interface.Plo \ - google/protobuf/compiler/$(DEPDIR)/importer.Plo \ - google/protobuf/compiler/$(DEPDIR)/main.Po \ - google/protobuf/compiler/$(DEPDIR)/parser.Plo \ - google/protobuf/compiler/$(DEPDIR)/plugin.Plo \ - google/protobuf/compiler/$(DEPDIR)/plugin.pb.Plo \ - google/protobuf/compiler/$(DEPDIR)/protobuf_test-annotation_test_util.Po \ - google/protobuf/compiler/$(DEPDIR)/protobuf_test-command_line_interface_unittest.Po \ - google/protobuf/compiler/$(DEPDIR)/protobuf_test-importer_unittest.Po \ - google/protobuf/compiler/$(DEPDIR)/protobuf_test-mock_code_generator.Po \ - google/protobuf/compiler/$(DEPDIR)/protobuf_test-parser_unittest.Po \ - google/protobuf/compiler/$(DEPDIR)/subprocess.Plo \ - google/protobuf/compiler/$(DEPDIR)/test_plugin-mock_code_generator.Po \ - google/protobuf/compiler/$(DEPDIR)/test_plugin-test_plugin.Po \ - google/protobuf/compiler/$(DEPDIR)/zip_writer.Plo \ - google/protobuf/compiler/cpp/$(DEPDIR)/cpp_enum.Plo \ - google/protobuf/compiler/cpp/$(DEPDIR)/cpp_enum_field.Plo \ - google/protobuf/compiler/cpp/$(DEPDIR)/cpp_extension.Plo \ - google/protobuf/compiler/cpp/$(DEPDIR)/cpp_field.Plo \ - google/protobuf/compiler/cpp/$(DEPDIR)/cpp_file.Plo \ - google/protobuf/compiler/cpp/$(DEPDIR)/cpp_generator.Plo \ - google/protobuf/compiler/cpp/$(DEPDIR)/cpp_helpers.Plo \ - google/protobuf/compiler/cpp/$(DEPDIR)/cpp_map_field.Plo \ - google/protobuf/compiler/cpp/$(DEPDIR)/cpp_message.Plo \ - google/protobuf/compiler/cpp/$(DEPDIR)/cpp_message_field.Plo \ - google/protobuf/compiler/cpp/$(DEPDIR)/cpp_padding_optimizer.Plo \ - google/protobuf/compiler/cpp/$(DEPDIR)/cpp_parse_function_generator.Plo \ - google/protobuf/compiler/cpp/$(DEPDIR)/cpp_primitive_field.Plo \ - google/protobuf/compiler/cpp/$(DEPDIR)/cpp_service.Plo \ - google/protobuf/compiler/cpp/$(DEPDIR)/cpp_string_field.Plo \ - google/protobuf/compiler/cpp/$(DEPDIR)/no_warning_test-cpp_test_bad_identifiers.pb.Po \ - google/protobuf/compiler/cpp/$(DEPDIR)/no_warning_test-cpp_test_large_enum_value.pb.Po \ - google/protobuf/compiler/cpp/$(DEPDIR)/protobuf_lazy_descriptor_test-cpp_test_bad_identifiers.pb.Po \ - google/protobuf/compiler/cpp/$(DEPDIR)/protobuf_lazy_descriptor_test-cpp_test_large_enum_value.pb.Po \ - google/protobuf/compiler/cpp/$(DEPDIR)/protobuf_lazy_descriptor_test-cpp_unittest.Po \ - google/protobuf/compiler/cpp/$(DEPDIR)/protobuf_test-cpp_bootstrap_unittest.Po \ - google/protobuf/compiler/cpp/$(DEPDIR)/protobuf_test-cpp_move_unittest.Po \ - google/protobuf/compiler/cpp/$(DEPDIR)/protobuf_test-cpp_plugin_unittest.Po \ - google/protobuf/compiler/cpp/$(DEPDIR)/protobuf_test-cpp_test_bad_identifiers.pb.Po \ - google/protobuf/compiler/cpp/$(DEPDIR)/protobuf_test-cpp_test_large_enum_value.pb.Po \ - google/protobuf/compiler/cpp/$(DEPDIR)/protobuf_test-cpp_unittest.Po \ - google/protobuf/compiler/cpp/$(DEPDIR)/protobuf_test-metadata_test.Po \ - google/protobuf/compiler/csharp/$(DEPDIR)/csharp_doc_comment.Plo \ - google/protobuf/compiler/csharp/$(DEPDIR)/csharp_enum.Plo \ - google/protobuf/compiler/csharp/$(DEPDIR)/csharp_enum_field.Plo \ - google/protobuf/compiler/csharp/$(DEPDIR)/csharp_field_base.Plo \ - google/protobuf/compiler/csharp/$(DEPDIR)/csharp_generator.Plo \ - google/protobuf/compiler/csharp/$(DEPDIR)/csharp_helpers.Plo \ - google/protobuf/compiler/csharp/$(DEPDIR)/csharp_map_field.Plo \ - google/protobuf/compiler/csharp/$(DEPDIR)/csharp_message.Plo \ - google/protobuf/compiler/csharp/$(DEPDIR)/csharp_message_field.Plo \ - google/protobuf/compiler/csharp/$(DEPDIR)/csharp_primitive_field.Plo \ - google/protobuf/compiler/csharp/$(DEPDIR)/csharp_reflection_class.Plo \ - google/protobuf/compiler/csharp/$(DEPDIR)/csharp_repeated_enum_field.Plo \ - google/protobuf/compiler/csharp/$(DEPDIR)/csharp_repeated_message_field.Plo \ - google/protobuf/compiler/csharp/$(DEPDIR)/csharp_repeated_primitive_field.Plo \ - google/protobuf/compiler/csharp/$(DEPDIR)/csharp_source_generator_base.Plo \ - google/protobuf/compiler/csharp/$(DEPDIR)/csharp_wrapper_field.Plo \ - google/protobuf/compiler/csharp/$(DEPDIR)/protobuf_test-csharp_bootstrap_unittest.Po \ - google/protobuf/compiler/csharp/$(DEPDIR)/protobuf_test-csharp_generator_unittest.Po \ - google/protobuf/compiler/java/$(DEPDIR)/java_context.Plo \ - google/protobuf/compiler/java/$(DEPDIR)/java_doc_comment.Plo \ - google/protobuf/compiler/java/$(DEPDIR)/java_enum.Plo \ - google/protobuf/compiler/java/$(DEPDIR)/java_enum_field.Plo \ - google/protobuf/compiler/java/$(DEPDIR)/java_enum_field_lite.Plo \ - google/protobuf/compiler/java/$(DEPDIR)/java_enum_lite.Plo \ - google/protobuf/compiler/java/$(DEPDIR)/java_extension.Plo \ - google/protobuf/compiler/java/$(DEPDIR)/java_extension_lite.Plo \ - google/protobuf/compiler/java/$(DEPDIR)/java_field.Plo \ - google/protobuf/compiler/java/$(DEPDIR)/java_file.Plo \ - google/protobuf/compiler/java/$(DEPDIR)/java_generator.Plo \ - google/protobuf/compiler/java/$(DEPDIR)/java_generator_factory.Plo \ - google/protobuf/compiler/java/$(DEPDIR)/java_helpers.Plo \ - google/protobuf/compiler/java/$(DEPDIR)/java_kotlin_generator.Plo \ - google/protobuf/compiler/java/$(DEPDIR)/java_map_field.Plo \ - google/protobuf/compiler/java/$(DEPDIR)/java_map_field_lite.Plo \ - google/protobuf/compiler/java/$(DEPDIR)/java_message.Plo \ - google/protobuf/compiler/java/$(DEPDIR)/java_message_builder.Plo \ - google/protobuf/compiler/java/$(DEPDIR)/java_message_builder_lite.Plo \ - google/protobuf/compiler/java/$(DEPDIR)/java_message_field.Plo \ - google/protobuf/compiler/java/$(DEPDIR)/java_message_field_lite.Plo \ - google/protobuf/compiler/java/$(DEPDIR)/java_message_lite.Plo \ - google/protobuf/compiler/java/$(DEPDIR)/java_name_resolver.Plo \ - google/protobuf/compiler/java/$(DEPDIR)/java_primitive_field.Plo \ - google/protobuf/compiler/java/$(DEPDIR)/java_primitive_field_lite.Plo \ - google/protobuf/compiler/java/$(DEPDIR)/java_service.Plo \ - google/protobuf/compiler/java/$(DEPDIR)/java_shared_code_generator.Plo \ - google/protobuf/compiler/java/$(DEPDIR)/java_string_field.Plo \ - google/protobuf/compiler/java/$(DEPDIR)/java_string_field_lite.Plo \ - google/protobuf/compiler/java/$(DEPDIR)/protobuf_test-java_doc_comment_unittest.Po \ - google/protobuf/compiler/java/$(DEPDIR)/protobuf_test-java_plugin_unittest.Po \ - google/protobuf/compiler/js/$(DEPDIR)/js_generator.Plo \ - google/protobuf/compiler/js/$(DEPDIR)/well_known_types_embed.Plo \ - google/protobuf/compiler/objectivec/$(DEPDIR)/objectivec_enum.Plo \ - google/protobuf/compiler/objectivec/$(DEPDIR)/objectivec_enum_field.Plo \ - google/protobuf/compiler/objectivec/$(DEPDIR)/objectivec_extension.Plo \ - google/protobuf/compiler/objectivec/$(DEPDIR)/objectivec_field.Plo \ - google/protobuf/compiler/objectivec/$(DEPDIR)/objectivec_file.Plo \ - google/protobuf/compiler/objectivec/$(DEPDIR)/objectivec_generator.Plo \ - google/protobuf/compiler/objectivec/$(DEPDIR)/objectivec_helpers.Plo \ - google/protobuf/compiler/objectivec/$(DEPDIR)/objectivec_map_field.Plo \ - google/protobuf/compiler/objectivec/$(DEPDIR)/objectivec_message.Plo \ - google/protobuf/compiler/objectivec/$(DEPDIR)/objectivec_message_field.Plo \ - google/protobuf/compiler/objectivec/$(DEPDIR)/objectivec_oneof.Plo \ - google/protobuf/compiler/objectivec/$(DEPDIR)/objectivec_primitive_field.Plo \ - google/protobuf/compiler/objectivec/$(DEPDIR)/protobuf_test-objectivec_helpers_unittest.Po \ - google/protobuf/compiler/php/$(DEPDIR)/php_generator.Plo \ - google/protobuf/compiler/python/$(DEPDIR)/protobuf_test-python_plugin_unittest.Po \ - google/protobuf/compiler/python/$(DEPDIR)/python_generator.Plo \ - google/protobuf/compiler/ruby/$(DEPDIR)/protobuf_test-ruby_generator_unittest.Po \ - google/protobuf/compiler/ruby/$(DEPDIR)/ruby_generator.Plo \ - google/protobuf/io/$(DEPDIR)/coded_stream.Plo \ - google/protobuf/io/$(DEPDIR)/gzip_stream.Plo \ - google/protobuf/io/$(DEPDIR)/io_win32.Plo \ - google/protobuf/io/$(DEPDIR)/printer.Plo \ - google/protobuf/io/$(DEPDIR)/protobuf_test-coded_stream_unittest.Po \ - google/protobuf/io/$(DEPDIR)/protobuf_test-io_win32_unittest.Po \ - google/protobuf/io/$(DEPDIR)/protobuf_test-printer_unittest.Po \ - google/protobuf/io/$(DEPDIR)/protobuf_test-tokenizer_unittest.Po \ - google/protobuf/io/$(DEPDIR)/protobuf_test-zero_copy_stream_unittest.Po \ - google/protobuf/io/$(DEPDIR)/strtod.Plo \ - google/protobuf/io/$(DEPDIR)/tokenizer.Plo \ - google/protobuf/io/$(DEPDIR)/zero_copy_stream.Plo \ - google/protobuf/io/$(DEPDIR)/zero_copy_stream_impl.Plo \ - google/protobuf/io/$(DEPDIR)/zero_copy_stream_impl_lite.Plo \ - google/protobuf/stubs/$(DEPDIR)/bytestream.Plo \ - google/protobuf/stubs/$(DEPDIR)/common.Plo \ - google/protobuf/stubs/$(DEPDIR)/int128.Plo \ - google/protobuf/stubs/$(DEPDIR)/protobuf_test-bytestream_unittest.Po \ - google/protobuf/stubs/$(DEPDIR)/protobuf_test-common_unittest.Po \ - google/protobuf/stubs/$(DEPDIR)/protobuf_test-int128_unittest.Po \ - google/protobuf/stubs/$(DEPDIR)/protobuf_test-status_test.Po \ - google/protobuf/stubs/$(DEPDIR)/protobuf_test-statusor_test.Po \ - google/protobuf/stubs/$(DEPDIR)/protobuf_test-stringpiece_unittest.Po \ - google/protobuf/stubs/$(DEPDIR)/protobuf_test-stringprintf_unittest.Po \ - google/protobuf/stubs/$(DEPDIR)/protobuf_test-structurally_valid_unittest.Po \ - google/protobuf/stubs/$(DEPDIR)/protobuf_test-strutil_unittest.Po \ - google/protobuf/stubs/$(DEPDIR)/protobuf_test-template_util_unittest.Po \ - google/protobuf/stubs/$(DEPDIR)/protobuf_test-time_test.Po \ - google/protobuf/stubs/$(DEPDIR)/status.Plo \ - google/protobuf/stubs/$(DEPDIR)/statusor.Plo \ - google/protobuf/stubs/$(DEPDIR)/stringpiece.Plo \ - google/protobuf/stubs/$(DEPDIR)/stringprintf.Plo \ - google/protobuf/stubs/$(DEPDIR)/structurally_valid.Plo \ - google/protobuf/stubs/$(DEPDIR)/strutil.Plo \ - google/protobuf/stubs/$(DEPDIR)/substitute.Plo \ - google/protobuf/stubs/$(DEPDIR)/time.Plo \ - google/protobuf/testing/$(DEPDIR)/protobuf_lazy_descriptor_test-file.Po \ - google/protobuf/testing/$(DEPDIR)/protobuf_lazy_descriptor_test-googletest.Po \ - google/protobuf/testing/$(DEPDIR)/protobuf_test-file.Po \ - google/protobuf/testing/$(DEPDIR)/protobuf_test-googletest.Po \ - google/protobuf/testing/$(DEPDIR)/test_plugin-file.Po \ - google/protobuf/testing/$(DEPDIR)/zcgunzip.Po \ - google/protobuf/testing/$(DEPDIR)/zcgzip.Po \ - google/protobuf/util/$(DEPDIR)/delimited_message_util.Plo \ - google/protobuf/util/$(DEPDIR)/field_comparator.Plo \ - google/protobuf/util/$(DEPDIR)/field_mask_util.Plo \ - google/protobuf/util/$(DEPDIR)/json_util.Plo \ - google/protobuf/util/$(DEPDIR)/message_differencer.Plo \ - google/protobuf/util/$(DEPDIR)/no_warning_test-json_format.pb.Po \ - google/protobuf/util/$(DEPDIR)/no_warning_test-json_format_proto3.pb.Po \ - google/protobuf/util/$(DEPDIR)/no_warning_test-message_differencer_unittest.pb.Po \ - google/protobuf/util/$(DEPDIR)/protobuf_lazy_descriptor_test-json_format.pb.Po \ - google/protobuf/util/$(DEPDIR)/protobuf_lazy_descriptor_test-json_format_proto3.pb.Po \ - google/protobuf/util/$(DEPDIR)/protobuf_lazy_descriptor_test-message_differencer_unittest.pb.Po \ - google/protobuf/util/$(DEPDIR)/protobuf_test-delimited_message_util_test.Po \ - google/protobuf/util/$(DEPDIR)/protobuf_test-field_comparator_test.Po \ - google/protobuf/util/$(DEPDIR)/protobuf_test-field_mask_util_test.Po \ - google/protobuf/util/$(DEPDIR)/protobuf_test-json_format.pb.Po \ - google/protobuf/util/$(DEPDIR)/protobuf_test-json_format_proto3.pb.Po \ - google/protobuf/util/$(DEPDIR)/protobuf_test-json_util_test.Po \ - google/protobuf/util/$(DEPDIR)/protobuf_test-message_differencer_unittest.Po \ - google/protobuf/util/$(DEPDIR)/protobuf_test-message_differencer_unittest.pb.Po \ - google/protobuf/util/$(DEPDIR)/protobuf_test-time_util_test.Po \ - google/protobuf/util/$(DEPDIR)/protobuf_test-type_resolver_util_test.Po \ - google/protobuf/util/$(DEPDIR)/time_util.Plo \ - google/protobuf/util/$(DEPDIR)/type_resolver_util.Plo \ - google/protobuf/util/internal/$(DEPDIR)/datapiece.Plo \ - google/protobuf/util/internal/$(DEPDIR)/default_value_objectwriter.Plo \ - google/protobuf/util/internal/$(DEPDIR)/error_listener.Plo \ - google/protobuf/util/internal/$(DEPDIR)/field_mask_utility.Plo \ - google/protobuf/util/internal/$(DEPDIR)/json_escaping.Plo \ - google/protobuf/util/internal/$(DEPDIR)/json_objectwriter.Plo \ - google/protobuf/util/internal/$(DEPDIR)/json_stream_parser.Plo \ - google/protobuf/util/internal/$(DEPDIR)/object_writer.Plo \ - google/protobuf/util/internal/$(DEPDIR)/proto_writer.Plo \ - google/protobuf/util/internal/$(DEPDIR)/protobuf_test-default_value_objectwriter_test.Po \ - google/protobuf/util/internal/$(DEPDIR)/protobuf_test-json_objectwriter_test.Po \ - google/protobuf/util/internal/$(DEPDIR)/protobuf_test-json_stream_parser_test.Po \ - google/protobuf/util/internal/$(DEPDIR)/protobuf_test-protostream_objectsource_test.Po \ - google/protobuf/util/internal/$(DEPDIR)/protobuf_test-protostream_objectwriter_test.Po \ - google/protobuf/util/internal/$(DEPDIR)/protobuf_test-type_info_test_helper.Po \ - google/protobuf/util/internal/$(DEPDIR)/protostream_objectsource.Plo \ - google/protobuf/util/internal/$(DEPDIR)/protostream_objectwriter.Plo \ - google/protobuf/util/internal/$(DEPDIR)/type_info.Plo \ - google/protobuf/util/internal/$(DEPDIR)/utility.Plo \ - google/protobuf/util/internal/testdata/$(DEPDIR)/no_warning_test-anys.pb.Po \ - google/protobuf/util/internal/testdata/$(DEPDIR)/no_warning_test-books.pb.Po \ - google/protobuf/util/internal/testdata/$(DEPDIR)/no_warning_test-default_value.pb.Po \ - google/protobuf/util/internal/testdata/$(DEPDIR)/no_warning_test-default_value_test.pb.Po \ - google/protobuf/util/internal/testdata/$(DEPDIR)/no_warning_test-field_mask.pb.Po \ - google/protobuf/util/internal/testdata/$(DEPDIR)/no_warning_test-maps.pb.Po \ - google/protobuf/util/internal/testdata/$(DEPDIR)/no_warning_test-oneofs.pb.Po \ - google/protobuf/util/internal/testdata/$(DEPDIR)/no_warning_test-proto3.pb.Po \ - google/protobuf/util/internal/testdata/$(DEPDIR)/no_warning_test-struct.pb.Po \ - google/protobuf/util/internal/testdata/$(DEPDIR)/no_warning_test-timestamp_duration.pb.Po \ - google/protobuf/util/internal/testdata/$(DEPDIR)/no_warning_test-wrappers.pb.Po \ - google/protobuf/util/internal/testdata/$(DEPDIR)/protobuf_lazy_descriptor_test-anys.pb.Po \ - google/protobuf/util/internal/testdata/$(DEPDIR)/protobuf_lazy_descriptor_test-books.pb.Po \ - google/protobuf/util/internal/testdata/$(DEPDIR)/protobuf_lazy_descriptor_test-default_value.pb.Po \ - google/protobuf/util/internal/testdata/$(DEPDIR)/protobuf_lazy_descriptor_test-default_value_test.pb.Po \ - google/protobuf/util/internal/testdata/$(DEPDIR)/protobuf_lazy_descriptor_test-field_mask.pb.Po \ - google/protobuf/util/internal/testdata/$(DEPDIR)/protobuf_lazy_descriptor_test-maps.pb.Po \ - google/protobuf/util/internal/testdata/$(DEPDIR)/protobuf_lazy_descriptor_test-oneofs.pb.Po \ - google/protobuf/util/internal/testdata/$(DEPDIR)/protobuf_lazy_descriptor_test-proto3.pb.Po \ - google/protobuf/util/internal/testdata/$(DEPDIR)/protobuf_lazy_descriptor_test-struct.pb.Po \ - google/protobuf/util/internal/testdata/$(DEPDIR)/protobuf_lazy_descriptor_test-timestamp_duration.pb.Po \ - google/protobuf/util/internal/testdata/$(DEPDIR)/protobuf_lazy_descriptor_test-wrappers.pb.Po \ - google/protobuf/util/internal/testdata/$(DEPDIR)/protobuf_test-anys.pb.Po \ - google/protobuf/util/internal/testdata/$(DEPDIR)/protobuf_test-books.pb.Po \ - google/protobuf/util/internal/testdata/$(DEPDIR)/protobuf_test-default_value.pb.Po \ - google/protobuf/util/internal/testdata/$(DEPDIR)/protobuf_test-default_value_test.pb.Po \ - google/protobuf/util/internal/testdata/$(DEPDIR)/protobuf_test-field_mask.pb.Po \ - google/protobuf/util/internal/testdata/$(DEPDIR)/protobuf_test-maps.pb.Po \ - google/protobuf/util/internal/testdata/$(DEPDIR)/protobuf_test-oneofs.pb.Po \ - google/protobuf/util/internal/testdata/$(DEPDIR)/protobuf_test-proto3.pb.Po \ - google/protobuf/util/internal/testdata/$(DEPDIR)/protobuf_test-struct.pb.Po \ - google/protobuf/util/internal/testdata/$(DEPDIR)/protobuf_test-timestamp_duration.pb.Po \ - google/protobuf/util/internal/testdata/$(DEPDIR)/protobuf_test-wrappers.pb.Po -am__mv = mv -f -CXXCOMPILE = $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \ - $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -LTCXXCOMPILE = $(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) \ - $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) \ - $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \ - $(AM_CXXFLAGS) $(CXXFLAGS) -AM_V_CXX = $(am__v_CXX_@AM_V@) -am__v_CXX_ = $(am__v_CXX_@AM_DEFAULT_V@) -am__v_CXX_0 = @echo " CXX " $@; -am__v_CXX_1 = -CXXLD = $(CXX) -CXXLINK = $(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) \ - $(LIBTOOLFLAGS) --mode=link $(CXXLD) $(AM_CXXFLAGS) \ - $(CXXFLAGS) $(AM_LDFLAGS) $(LDFLAGS) -o $@ -AM_V_CXXLD = $(am__v_CXXLD_@AM_V@) -am__v_CXXLD_ = $(am__v_CXXLD_@AM_DEFAULT_V@) -am__v_CXXLD_0 = @echo " CXXLD " $@; -am__v_CXXLD_1 = -COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ - $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -LTCOMPILE = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ - $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) \ - $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \ - $(AM_CFLAGS) $(CFLAGS) -AM_V_CC = $(am__v_CC_@AM_V@) -am__v_CC_ = $(am__v_CC_@AM_DEFAULT_V@) -am__v_CC_0 = @echo " CC " $@; -am__v_CC_1 = -CCLD = $(CC) -LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ - $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ - $(AM_LDFLAGS) $(LDFLAGS) -o $@ -AM_V_CCLD = $(am__v_CCLD_@AM_V@) -am__v_CCLD_ = $(am__v_CCLD_@AM_DEFAULT_V@) -am__v_CCLD_0 = @echo " CCLD " $@; -am__v_CCLD_1 = -SOURCES = $(libprotobuf_lite_la_SOURCES) $(libprotobuf_la_SOURCES) \ - $(nodist_libprotobuf_la_SOURCES) $(libprotoc_la_SOURCES) \ - $(nodist_no_warning_test_SOURCES) \ - $(protobuf_lazy_descriptor_test_SOURCES) \ - $(nodist_protobuf_lazy_descriptor_test_SOURCES) \ - $(protobuf_lite_arena_test_SOURCES) \ - $(nodist_protobuf_lite_arena_test_SOURCES) \ - $(protobuf_lite_test_SOURCES) \ - $(nodist_protobuf_lite_test_SOURCES) $(protobuf_test_SOURCES) \ - $(nodist_protobuf_test_SOURCES) $(protoc_SOURCES) \ - $(test_plugin_SOURCES) $(zcgunzip_SOURCES) $(zcgzip_SOURCES) -DIST_SOURCES = $(libprotobuf_lite_la_SOURCES) \ - $(libprotobuf_la_SOURCES) $(libprotoc_la_SOURCES) \ - $(protobuf_lazy_descriptor_test_SOURCES) \ - $(protobuf_lite_arena_test_SOURCES) \ - $(protobuf_lite_test_SOURCES) $(protobuf_test_SOURCES) \ - $(protoc_SOURCES) $(test_plugin_SOURCES) \ - $(am__zcgunzip_SOURCES_DIST) $(am__zcgzip_SOURCES_DIST) -am__can_run_installinfo = \ - case $$AM_UPDATE_INFO_DIR in \ - n|no|NO) false;; \ - *) (install-info --version) >/dev/null 2>&1;; \ - esac -DATA = $(nobase_dist_proto_DATA) -am__nobase_include_HEADERS_DIST = google/protobuf/any.h \ - google/protobuf/any.pb.h google/protobuf/api.pb.h \ - google/protobuf/arena.h google/protobuf/arena_impl.h \ - google/protobuf/arenastring.h \ - google/protobuf/compiler/code_generator.h \ - google/protobuf/compiler/command_line_interface.h \ - google/protobuf/compiler/cpp/cpp_file.h \ - google/protobuf/compiler/cpp/cpp_generator.h \ - google/protobuf/compiler/cpp/cpp_helpers.h \ - google/protobuf/compiler/cpp/cpp_names.h \ - google/protobuf/compiler/csharp/csharp_doc_comment.h \ - google/protobuf/compiler/csharp/csharp_generator.h \ - google/protobuf/compiler/csharp/csharp_names.h \ - google/protobuf/compiler/csharp/csharp_options.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/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 \ - google/protobuf/explicitly_constructed.h \ - google/protobuf/extension_set.h \ - google/protobuf/extension_set_inl.h \ - google/protobuf/field_access_listener.h \ - 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_table_driven_lite.h \ - google/protobuf/generated_message_tctable_decl.h \ - google/protobuf/generated_message_tctable_impl.h \ - google/protobuf/generated_message_tctable_impl.inc \ - google/protobuf/generated_message_util.h \ - google/protobuf/has_bits.h \ - google/protobuf/implicit_weak_message.h \ - google/protobuf/inlined_string_field.h \ - google/protobuf/io/coded_stream.h \ - google/protobuf/io/gzip_stream.h 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_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/reflection.h google/protobuf/reflection_ops.h \ - google/protobuf/repeated_field.h \ - google/protobuf/repeated_ptr_field.h google/protobuf/service.h \ - google/protobuf/source_context.pb.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/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/wire_format.h \ - google/protobuf/wire_format_lite.h \ - google/protobuf/wrappers.pb.h -HEADERS = $(nobase_include_HEADERS) -am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP) -# Read a list of newline-separated strings from the standard input, -# and print each of them once, without duplicates. Input order is -# *not* preserved. -am__uniquify_input = $(AWK) '\ - BEGIN { nonempty = 0; } \ - { items[$$0] = 1; nonempty = 1; } \ - END { if (nonempty) { for (i in items) print i; }; } \ -' -# Make sure the list of sources is unique. This is necessary because, -# e.g., the same source file might be shared among _SOURCES variables -# for different programs/libraries. -am__define_uniq_tagged_files = \ - list='$(am__tagged_files)'; \ - unique=`for i in $$list; do \ - if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ - done | $(am__uniquify_input)` -am__tty_colors_dummy = \ - mgn= red= grn= lgn= blu= brg= std=; \ - am__color_tests=no -am__tty_colors = { \ - $(am__tty_colors_dummy); \ - if test "X$(AM_COLOR_TESTS)" = Xno; then \ - am__color_tests=no; \ - elif test "X$(AM_COLOR_TESTS)" = Xalways; then \ - am__color_tests=yes; \ - elif test "X$$TERM" != Xdumb && { test -t 1; } 2>/dev/null; then \ - am__color_tests=yes; \ - fi; \ - if test $$am__color_tests = yes; then \ - red=''; \ - grn=''; \ - lgn=''; \ - blu=''; \ - mgn=''; \ - brg=''; \ - std=''; \ - fi; \ -} -am__recheck_rx = ^[ ]*:recheck:[ ]* -am__global_test_result_rx = ^[ ]*:global-test-result:[ ]* -am__copy_in_global_log_rx = ^[ ]*:copy-in-global-log:[ ]* -# A command that, given a newline-separated list of test names on the -# standard input, print the name of the tests that are to be re-run -# upon "make recheck". -am__list_recheck_tests = $(AWK) '{ \ - recheck = 1; \ - while ((rc = (getline line < ($$0 ".trs"))) != 0) \ - { \ - if (rc < 0) \ - { \ - if ((getline line2 < ($$0 ".log")) < 0) \ - recheck = 0; \ - break; \ - } \ - else if (line ~ /$(am__recheck_rx)[nN][Oo]/) \ - { \ - recheck = 0; \ - break; \ - } \ - else if (line ~ /$(am__recheck_rx)[yY][eE][sS]/) \ - { \ - break; \ - } \ - }; \ - if (recheck) \ - print $$0; \ - close ($$0 ".trs"); \ - close ($$0 ".log"); \ -}' -# A command that, given a newline-separated list of test names on the -# standard input, create the global log from their .trs and .log files. -am__create_global_log = $(AWK) ' \ -function fatal(msg) \ -{ \ - print "fatal: making $@: " msg | "cat >&2"; \ - exit 1; \ -} \ -function rst_section(header) \ -{ \ - print header; \ - len = length(header); \ - for (i = 1; i <= len; i = i + 1) \ - printf "="; \ - printf "\n\n"; \ -} \ -{ \ - copy_in_global_log = 1; \ - global_test_result = "RUN"; \ - while ((rc = (getline line < ($$0 ".trs"))) != 0) \ - { \ - if (rc < 0) \ - fatal("failed to read from " $$0 ".trs"); \ - if (line ~ /$(am__global_test_result_rx)/) \ - { \ - sub("$(am__global_test_result_rx)", "", line); \ - sub("[ ]*$$", "", line); \ - global_test_result = line; \ - } \ - else if (line ~ /$(am__copy_in_global_log_rx)[nN][oO]/) \ - copy_in_global_log = 0; \ - }; \ - if (copy_in_global_log) \ - { \ - rst_section(global_test_result ": " $$0); \ - while ((rc = (getline line < ($$0 ".log"))) != 0) \ - { \ - if (rc < 0) \ - fatal("failed to read from " $$0 ".log"); \ - print line; \ - }; \ - printf "\n"; \ - }; \ - close ($$0 ".trs"); \ - close ($$0 ".log"); \ -}' -# Restructured Text title. -am__rst_title = { sed 's/.*/ & /;h;s/./=/g;p;x;s/ *$$//;p;g' && echo; } -# Solaris 10 'make', and several other traditional 'make' implementations, -# pass "-e" to $(SHELL), and POSIX 2008 even requires this. Work around it -# by disabling -e (using the XSI extension "set +e") if it's set. -am__sh_e_setup = case $$- in *e*) set +e;; esac -# Default flags passed to test drivers. -am__common_driver_flags = \ - --color-tests "$$am__color_tests" \ - --enable-hard-errors "$$am__enable_hard_errors" \ - --expect-failure "$$am__expect_failure" -# To be inserted before the command running the test. Creates the -# directory for the log if needed. Stores in $dir the directory -# containing $f, in $tst the test, in $log the log. Executes the -# developer- defined test setup AM_TESTS_ENVIRONMENT (if any), and -# passes TESTS_ENVIRONMENT. Set up options for the wrapper that -# will run the test scripts (or their associated LOG_COMPILER, if -# thy have one). -am__check_pre = \ -$(am__sh_e_setup); \ -$(am__vpath_adj_setup) $(am__vpath_adj) \ -$(am__tty_colors); \ -srcdir=$(srcdir); export srcdir; \ -case "$@" in \ - */*) am__odir=`echo "./$@" | sed 's|/[^/]*$$||'`;; \ - *) am__odir=.;; \ -esac; \ -test "x$$am__odir" = x"." || test -d "$$am__odir" \ - || $(MKDIR_P) "$$am__odir" || exit $$?; \ -if test -f "./$$f"; then dir=./; \ -elif test -f "$$f"; then dir=; \ -else dir="$(srcdir)/"; fi; \ -tst=$$dir$$f; log='$@'; \ -if test -n '$(DISABLE_HARD_ERRORS)'; then \ - am__enable_hard_errors=no; \ -else \ - am__enable_hard_errors=yes; \ -fi; \ -case " $(XFAIL_TESTS) " in \ - *[\ \ ]$$f[\ \ ]* | *[\ \ ]$$dir$$f[\ \ ]*) \ - am__expect_failure=yes;; \ - *) \ - am__expect_failure=no;; \ -esac; \ -$(AM_TESTS_ENVIRONMENT) $(TESTS_ENVIRONMENT) -# A shell command to get the names of the tests scripts with any registered -# extension removed (i.e., equivalently, the names of the test logs, with -# the '.log' extension removed). The result is saved in the shell variable -# '$bases'. This honors runtime overriding of TESTS and TEST_LOGS. Sadly, -# we cannot use something simpler, involving e.g., "$(TEST_LOGS:.log=)", -# since that might cause problem with VPATH rewrites for suffix-less tests. -# See also 'test-harness-vpath-rewrite.sh' and 'test-trs-basic.sh'. -am__set_TESTS_bases = \ - bases='$(TEST_LOGS)'; \ - bases=`for i in $$bases; do echo $$i; done | sed 's/\.log$$//'`; \ - bases=`echo $$bases` -AM_TESTSUITE_SUMMARY_HEADER = ' for $(PACKAGE_STRING)' -RECHECK_LOGS = $(TEST_LOGS) -AM_RECURSIVE_TARGETS = check recheck -@HAVE_ZLIB_TRUE@am__EXEEXT_2 = \ -@HAVE_ZLIB_TRUE@ google/protobuf/io/gzip_stream_unittest.sh -TEST_SUITE_LOG = test-suite.log -TEST_EXTENSIONS = @EXEEXT@ .test -LOG_DRIVER = $(SHELL) $(top_srcdir)/test-driver -LOG_COMPILE = $(LOG_COMPILER) $(AM_LOG_FLAGS) $(LOG_FLAGS) -am__set_b = \ - case '$@' in \ - */*) \ - case '$*' in \ - */*) b='$*';; \ - *) b=`echo '$@' | sed 's/\.log$$//'`; \ - esac;; \ - *) \ - b='$*';; \ - esac -am__test_logs1 = $(TESTS:=.log) -am__test_logs2 = $(am__test_logs1:@EXEEXT@.log=.log) -TEST_LOGS = $(am__test_logs2:.test.log=.log) -TEST_LOG_DRIVER = $(SHELL) $(top_srcdir)/test-driver -TEST_LOG_COMPILE = $(TEST_LOG_COMPILER) $(AM_TEST_LOG_FLAGS) \ - $(TEST_LOG_FLAGS) -am__DIST_COMMON = $(srcdir)/Makefile.in $(top_srcdir)/depcomp \ - $(top_srcdir)/test-driver README.md -DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) -ACLOCAL = @ACLOCAL@ -AMTAR = @AMTAR@ -AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ -AR = @AR@ -AUTOCONF = @AUTOCONF@ -AUTOHEADER = @AUTOHEADER@ -AUTOMAKE = @AUTOMAKE@ -AWK = @AWK@ -BUILD_EXEEXT = @BUILD_EXEEXT@ -BUILD_OBJEXT = @BUILD_OBJEXT@ -CC = @CC@ -CCDEPMODE = @CCDEPMODE@ -CC_FOR_BUILD = @CC_FOR_BUILD@ -CFLAGS = @CFLAGS@ -CFLAGS_FOR_BUILD = @CFLAGS_FOR_BUILD@ -CPP = @CPP@ -CPPFLAGS = @CPPFLAGS@ -CPPFLAGS_FOR_BUILD = @CPPFLAGS_FOR_BUILD@ -CPP_FOR_BUILD = @CPP_FOR_BUILD@ -CSCOPE = @CSCOPE@ -CTAGS = @CTAGS@ -CXX = @CXX@ -CXXCPP = @CXXCPP@ -CXXCPPFLAGS_FOR_BUILD = @CXXCPPFLAGS_FOR_BUILD@ -CXXCPP_FOR_BUILD = @CXXCPP_FOR_BUILD@ -CXXDEPMODE = @CXXDEPMODE@ -CXXFLAGS = @CXXFLAGS@ -CXXFLAGS_FOR_BUILD = @CXXFLAGS_FOR_BUILD@ -CXX_FOR_BUILD = @CXX_FOR_BUILD@ -CYGPATH_W = @CYGPATH_W@ -DEFS = @DEFS@ -DEPDIR = @DEPDIR@ -DIST_LANG = @DIST_LANG@ -DLLTOOL = @DLLTOOL@ -DSYMUTIL = @DSYMUTIL@ -DUMPBIN = @DUMPBIN@ -ECHO_C = @ECHO_C@ -ECHO_N = @ECHO_N@ -ECHO_T = @ECHO_T@ -EGREP = @EGREP@ -ETAGS = @ETAGS@ -EXEEXT = @EXEEXT@ -FGREP = @FGREP@ -GREP = @GREP@ -HAVE_CXX11 = @HAVE_CXX11@ -INSTALL = @INSTALL@ -INSTALL_DATA = @INSTALL_DATA@ -INSTALL_PROGRAM = @INSTALL_PROGRAM@ -INSTALL_SCRIPT = @INSTALL_SCRIPT@ -INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ -ISAINFO = @ISAINFO@ -LD = @LD@ -LDFLAGS = @LDFLAGS@ -LDFLAGS_FOR_BUILD = @LDFLAGS_FOR_BUILD@ -LIBATOMIC_LIBS = @LIBATOMIC_LIBS@ -LIBLOG_LIBS = @LIBLOG_LIBS@ -LIBOBJS = @LIBOBJS@ -LIBS = @LIBS@ -LIBTOOL = @LIBTOOL@ -LIPO = @LIPO@ -LN_S = @LN_S@ -LTLIBOBJS = @LTLIBOBJS@ -LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@ -MAINT = @MAINT@ -MAKEINFO = @MAKEINFO@ -MANIFEST_TOOL = @MANIFEST_TOOL@ -MKDIR_P = @MKDIR_P@ -NM = @NM@ -NMEDIT = @NMEDIT@ -OBJC = @OBJC@ -OBJCDEPMODE = @OBJCDEPMODE@ -OBJCFLAGS = @OBJCFLAGS@ -OBJDUMP = @OBJDUMP@ -OBJEXT = @OBJEXT@ -OTOOL = @OTOOL@ -OTOOL64 = @OTOOL64@ -PACKAGE = @PACKAGE@ -PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ -PACKAGE_NAME = @PACKAGE_NAME@ -PACKAGE_STRING = @PACKAGE_STRING@ -PACKAGE_TARNAME = @PACKAGE_TARNAME@ -PACKAGE_URL = @PACKAGE_URL@ -PACKAGE_VERSION = @PACKAGE_VERSION@ -PATH_SEPARATOR = @PATH_SEPARATOR@ -POW_LIB = @POW_LIB@ -PROTOBUF_OPT_FLAG = @PROTOBUF_OPT_FLAG@ -PROTOC = @PROTOC@ -PTHREAD_CC = @PTHREAD_CC@ -PTHREAD_CFLAGS = @PTHREAD_CFLAGS@ -PTHREAD_LIBS = @PTHREAD_LIBS@ -RANLIB = @RANLIB@ -SED = @SED@ -SET_MAKE = @SET_MAKE@ -SHELL = @SHELL@ -STRIP = @STRIP@ -VERSION = @VERSION@ -abs_builddir = @abs_builddir@ -abs_srcdir = @abs_srcdir@ -abs_top_builddir = @abs_top_builddir@ -abs_top_srcdir = @abs_top_srcdir@ -ac_ct_AR = @ac_ct_AR@ -ac_ct_CC = @ac_ct_CC@ -ac_ct_CC_FOR_BUILD = @ac_ct_CC_FOR_BUILD@ -ac_ct_CXX = @ac_ct_CXX@ -ac_ct_CXX_FOR_BUILD = @ac_ct_CXX_FOR_BUILD@ -ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ -ac_ct_OBJC = @ac_ct_OBJC@ -am__include = @am__include@ -am__leading_dot = @am__leading_dot@ -am__quote = @am__quote@ -am__tar = @am__tar@ -am__untar = @am__untar@ -ax_pthread_config = @ax_pthread_config@ -bindir = @bindir@ -build = @build@ -build_alias = @build_alias@ -build_cpu = @build_cpu@ -build_os = @build_os@ -build_vendor = @build_vendor@ -builddir = @builddir@ -datadir = @datadir@ -datarootdir = @datarootdir@ -docdir = @docdir@ -dvidir = @dvidir@ -exec_prefix = @exec_prefix@ -host = @host@ -host_alias = @host_alias@ -host_cpu = @host_cpu@ -host_os = @host_os@ -host_vendor = @host_vendor@ -htmldir = @htmldir@ -includedir = @includedir@ -infodir = @infodir@ -install_sh = @install_sh@ -libdir = @libdir@ -libexecdir = @libexecdir@ -localedir = @localedir@ -localstatedir = @localstatedir@ -mandir = @mandir@ -mkdir_p = @mkdir_p@ -oldincludedir = @oldincludedir@ -pdfdir = @pdfdir@ -prefix = @prefix@ -program_transform_name = @program_transform_name@ -psdir = @psdir@ -runstatedir = @runstatedir@ -sbindir = @sbindir@ -sharedstatedir = @sharedstatedir@ -srcdir = @srcdir@ -subdirs = @subdirs@ -sysconfdir = @sysconfdir@ -target = @target@ -target_alias = @target_alias@ -target_cpu = @target_cpu@ -target_os = @target_os@ -target_vendor = @target_vendor@ -top_build_prefix = @top_build_prefix@ -top_builddir = @top_builddir@ -top_srcdir = @top_srcdir@ -@HAVE_ZLIB_FALSE@GZCHECKPROGRAMS = -@HAVE_ZLIB_TRUE@GZCHECKPROGRAMS = zcgzip zcgunzip -@HAVE_ZLIB_FALSE@GZHEADERS = -@HAVE_ZLIB_TRUE@GZHEADERS = google/protobuf/io/gzip_stream.h -@HAVE_ZLIB_FALSE@GZTESTS = -@HAVE_ZLIB_TRUE@GZTESTS = google/protobuf/io/gzip_stream_unittest.sh -@HAVE_ZLIB_FALSE@ZLIB_DEF = -@HAVE_ZLIB_TRUE@ZLIB_DEF = -DHAVE_ZLIB=1 -@HAVE_PTHREAD_FALSE@PTHREAD_DEF = -@HAVE_PTHREAD_TRUE@PTHREAD_DEF = -DHAVE_PTHREAD=1 -PROTOBUF_VERSION = 30:4:0 -@GCC_FALSE@NO_OPT_CXXFLAGS = $(PTHREAD_CFLAGS) $(PTHREAD_DEF) $(ZLIB_DEF) - -# Turn on all warnings except for sign comparison (we ignore sign comparison -# in Google so our code base have tons of such warnings). -@GCC_TRUE@NO_OPT_CXXFLAGS = $(PTHREAD_CFLAGS) $(PTHREAD_DEF) $(ZLIB_DEF) -Wall -Wno-sign-compare -AM_CXXFLAGS = $(NO_OPT_CXXFLAGS) $(PROTOBUF_OPT_FLAG) -AM_LDFLAGS = $(PTHREAD_CFLAGS) ${LIBLOG_LIBS} - -# If I say "dist_include_DATA", automake complains that $(includedir) is not -# a "legitimate" directory for DATA. Screw you, automake. -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/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 - -CLEANFILES = $(protoc_outputs) unittest_proto_middleman \ - testzip.jar testzip.list testzip.proto testzip.zip \ - no_warning_test.cc - -MAINTAINERCLEANFILES = \ - Makefile.in - -nobase_include_HEADERS = \ - google/protobuf/any.h \ - google/protobuf/any.pb.h \ - google/protobuf/api.pb.h \ - google/protobuf/arena.h \ - google/protobuf/arena_impl.h \ - google/protobuf/arenastring.h \ - google/protobuf/compiler/code_generator.h \ - google/protobuf/compiler/command_line_interface.h \ - google/protobuf/compiler/cpp/cpp_file.h \ - google/protobuf/compiler/cpp/cpp_generator.h \ - google/protobuf/compiler/cpp/cpp_helpers.h \ - google/protobuf/compiler/cpp/cpp_names.h \ - google/protobuf/compiler/csharp/csharp_doc_comment.h \ - google/protobuf/compiler/csharp/csharp_generator.h \ - google/protobuf/compiler/csharp/csharp_names.h \ - google/protobuf/compiler/csharp/csharp_options.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/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 \ - google/protobuf/explicitly_constructed.h \ - google/protobuf/extension_set.h \ - google/protobuf/extension_set_inl.h \ - google/protobuf/field_access_listener.h \ - 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_table_driven_lite.h \ - google/protobuf/generated_message_tctable_decl.h \ - google/protobuf/generated_message_tctable_impl.h \ - google/protobuf/generated_message_tctable_impl.inc \ - google/protobuf/generated_message_util.h \ - google/protobuf/has_bits.h \ - google/protobuf/implicit_weak_message.h \ - google/protobuf/inlined_string_field.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_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/reflection.h \ - google/protobuf/reflection_ops.h \ - google/protobuf/repeated_field.h \ - google/protobuf/repeated_ptr_field.h \ - google/protobuf/service.h \ - google/protobuf/source_context.pb.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/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/wire_format.h \ - google/protobuf/wire_format_lite.h \ - google/protobuf/wrappers.pb.h - -lib_LTLIBRARIES = libprotobuf-lite.la libprotobuf.la libprotoc.la -libprotobuf_lite_la_LIBADD = $(PTHREAD_LIBS) $(LIBATOMIC_LIBS) -libprotobuf_lite_la_LDFLAGS = -version-info $(PROTOBUF_VERSION) \ - -export-dynamic -no-undefined $(am__append_1) -@HAVE_LD_VERSION_SCRIPT_TRUE@EXTRA_libprotobuf_lite_la_DEPENDENCIES = libprotobuf-lite.map -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_tctable_lite.cc \ - 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/repeated_ptr_field.cc \ - google/protobuf/string_member_robber.h \ - google/protobuf/stubs/bytestream.cc \ - google/protobuf/stubs/common.cc \ - google/protobuf/stubs/int128.cc \ - google/protobuf/stubs/int128.h \ - google/protobuf/stubs/mathutil.h \ - google/protobuf/stubs/status.cc \ - google/protobuf/stubs/status_macros.h \ - google/protobuf/stubs/statusor.cc \ - google/protobuf/stubs/statusor.h \ - google/protobuf/stubs/stringpiece.cc \ - google/protobuf/stubs/stringprintf.cc \ - google/protobuf/stubs/stringprintf.h \ - google/protobuf/stubs/structurally_valid.cc \ - google/protobuf/stubs/strutil.cc \ - google/protobuf/stubs/time.cc \ - google/protobuf/stubs/time.h \ - google/protobuf/wire_format_lite.cc - -libprotobuf_la_LIBADD = $(PTHREAD_LIBS) $(LIBATOMIC_LIBS) -libprotobuf_la_LDFLAGS = -version-info $(PROTOBUF_VERSION) \ - -export-dynamic -no-undefined $(am__append_2) -@HAVE_LD_VERSION_SCRIPT_TRUE@EXTRA_libprotobuf_la_DEPENDENCIES = libprotobuf.map -libprotobuf_la_SOURCES = \ - $(libprotobuf_lite_la_SOURCES) \ - google/protobuf/any.cc \ - google/protobuf/any.pb.cc \ - google/protobuf/api.pb.cc \ - google/protobuf/compiler/importer.cc \ - google/protobuf/compiler/parser.cc \ - google/protobuf/descriptor.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_mask.pb.cc \ - google/protobuf/generated_message_bases.cc \ - google/protobuf/generated_message_reflection.cc \ - google/protobuf/generated_message_table_driven.cc \ - google/protobuf/generated_message_tctable_full.cc \ - 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 \ - google/protobuf/reflection_ops.cc \ - google/protobuf/service.cc \ - google/protobuf/source_context.pb.cc \ - google/protobuf/struct.pb.cc \ - google/protobuf/stubs/substitute.cc \ - google/protobuf/stubs/substitute.h \ - google/protobuf/text_format.cc \ - google/protobuf/timestamp.pb.cc \ - google/protobuf/type.pb.cc \ - google/protobuf/unknown_field_set.cc \ - google/protobuf/util/delimited_message_util.cc \ - google/protobuf/util/field_comparator.cc \ - google/protobuf/util/field_mask_util.cc \ - google/protobuf/util/internal/constants.h \ - google/protobuf/util/internal/datapiece.cc \ - google/protobuf/util/internal/datapiece.h \ - google/protobuf/util/internal/default_value_objectwriter.cc \ - google/protobuf/util/internal/default_value_objectwriter.h \ - google/protobuf/util/internal/error_listener.cc \ - google/protobuf/util/internal/error_listener.h \ - google/protobuf/util/internal/expecting_objectwriter.h \ - google/protobuf/util/internal/field_mask_utility.cc \ - google/protobuf/util/internal/field_mask_utility.h \ - google/protobuf/util/internal/json_escaping.cc \ - google/protobuf/util/internal/json_escaping.h \ - google/protobuf/util/internal/json_objectwriter.cc \ - google/protobuf/util/internal/json_objectwriter.h \ - google/protobuf/util/internal/json_stream_parser.cc \ - google/protobuf/util/internal/json_stream_parser.h \ - google/protobuf/util/internal/location_tracker.h \ - google/protobuf/util/internal/mock_error_listener.h \ - google/protobuf/util/internal/object_location_tracker.h \ - 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/structured_objectwriter.h \ - google/protobuf/util/internal/type_info.cc \ - google/protobuf/util/internal/type_info.h \ - google/protobuf/util/internal/type_info_test_helper.h \ - google/protobuf/util/internal/utility.cc \ - google/protobuf/util/internal/utility.h \ - 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/wire_format.cc \ - google/protobuf/wrappers.pb.cc - -nodist_libprotobuf_la_SOURCES = $(nodist_libprotobuf_lite_la_SOURCES) -libprotoc_la_LIBADD = $(PTHREAD_LIBS) libprotobuf.la -libprotoc_la_LDFLAGS = -version-info $(PROTOBUF_VERSION) \ - -export-dynamic -no-undefined $(am__append_3) -@HAVE_LD_VERSION_SCRIPT_TRUE@EXTRA_libprotoc_la_DEPENDENCIES = libprotoc.map -libprotoc_la_SOURCES = \ - google/protobuf/compiler/code_generator.cc \ - google/protobuf/compiler/command_line_interface.cc \ - google/protobuf/compiler/cpp/cpp_enum.cc \ - google/protobuf/compiler/cpp/cpp_enum.h \ - google/protobuf/compiler/cpp/cpp_enum_field.cc \ - google/protobuf/compiler/cpp/cpp_enum_field.h \ - google/protobuf/compiler/cpp/cpp_extension.cc \ - google/protobuf/compiler/cpp/cpp_extension.h \ - google/protobuf/compiler/cpp/cpp_field.cc \ - google/protobuf/compiler/cpp/cpp_field.h \ - google/protobuf/compiler/cpp/cpp_file.cc \ - google/protobuf/compiler/cpp/cpp_generator.cc \ - google/protobuf/compiler/cpp/cpp_helpers.cc \ - google/protobuf/compiler/cpp/cpp_map_field.cc \ - google/protobuf/compiler/cpp/cpp_map_field.h \ - google/protobuf/compiler/cpp/cpp_message.cc \ - google/protobuf/compiler/cpp/cpp_message.h \ - google/protobuf/compiler/cpp/cpp_message_field.cc \ - google/protobuf/compiler/cpp/cpp_message_field.h \ - google/protobuf/compiler/cpp/cpp_message_layout_helper.h \ - google/protobuf/compiler/cpp/cpp_options.h \ - google/protobuf/compiler/cpp/cpp_padding_optimizer.cc \ - google/protobuf/compiler/cpp/cpp_padding_optimizer.h \ - google/protobuf/compiler/cpp/cpp_parse_function_generator.cc \ - google/protobuf/compiler/cpp/cpp_parse_function_generator.h \ - google/protobuf/compiler/cpp/cpp_primitive_field.cc \ - google/protobuf/compiler/cpp/cpp_primitive_field.h \ - google/protobuf/compiler/cpp/cpp_service.cc \ - 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_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_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.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_lite.cc \ - google/protobuf/compiler/java/java_enum_lite.h \ - google/protobuf/compiler/java/java_extension.cc \ - google/protobuf/compiler/java/java_extension.h \ - google/protobuf/compiler/java/java_extension_lite.cc \ - google/protobuf/compiler/java/java_extension_lite.h \ - google/protobuf/compiler/java/java_field.cc \ - google/protobuf/compiler/java/java_field.h \ - google/protobuf/compiler/java/java_file.cc \ - google/protobuf/compiler/java/java_file.h \ - google/protobuf/compiler/java/java_generator.cc \ - google/protobuf/compiler/java/java_generator_factory.cc \ - google/protobuf/compiler/java/java_generator_factory.h \ - google/protobuf/compiler/java/java_helpers.cc \ - google/protobuf/compiler/java/java_helpers.h \ - google/protobuf/compiler/java/java_kotlin_generator.cc \ - google/protobuf/compiler/java/java_map_field.cc \ - google/protobuf/compiler/java/java_map_field.h \ - 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.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_lite.cc \ - google/protobuf/compiler/java/java_message_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 \ - google/protobuf/compiler/java/java_primitive_field.cc \ - 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_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/js/js_generator.cc \ - google/protobuf/compiler/js/well_known_types_embed.cc \ - google/protobuf/compiler/js/well_known_types_embed.h \ - google/protobuf/compiler/objectivec/objectivec_enum.cc \ - google/protobuf/compiler/objectivec/objectivec_enum.h \ - google/protobuf/compiler/objectivec/objectivec_enum_field.cc \ - google/protobuf/compiler/objectivec/objectivec_enum_field.h \ - google/protobuf/compiler/objectivec/objectivec_extension.cc \ - google/protobuf/compiler/objectivec/objectivec_extension.h \ - google/protobuf/compiler/objectivec/objectivec_field.cc \ - google/protobuf/compiler/objectivec/objectivec_field.h \ - google/protobuf/compiler/objectivec/objectivec_file.cc \ - google/protobuf/compiler/objectivec/objectivec_file.h \ - google/protobuf/compiler/objectivec/objectivec_generator.cc \ - google/protobuf/compiler/objectivec/objectivec_helpers.cc \ - google/protobuf/compiler/objectivec/objectivec_map_field.cc \ - google/protobuf/compiler/objectivec/objectivec_map_field.h \ - google/protobuf/compiler/objectivec/objectivec_message.cc \ - 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_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/scc.h \ - google/protobuf/compiler/subprocess.cc \ - google/protobuf/compiler/subprocess.h \ - google/protobuf/compiler/zip_writer.cc \ - google/protobuf/compiler/zip_writer.h - -protoc_LDADD = $(PTHREAD_LIBS) libprotobuf.la libprotoc.la -protoc_SOURCES = google/protobuf/compiler/main.cc - -# Tests ============================================================== -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.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.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_enum.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 \ - google/protobuf/unittest_proto3_lite.proto \ - google/protobuf/unittest_proto3_optional.proto \ - google/protobuf/unittest_well_known_types.proto \ - google/protobuf/util/internal/testdata/anys.proto \ - google/protobuf/util/internal/testdata/books.proto \ - google/protobuf/util/internal/testdata/default_value.proto \ - google/protobuf/util/internal/testdata/default_value_test.proto \ - google/protobuf/util/internal/testdata/field_mask.proto \ - google/protobuf/util/internal/testdata/maps.proto \ - google/protobuf/util/internal/testdata/oneofs.proto \ - google/protobuf/util/internal/testdata/proto3.proto \ - google/protobuf/util/internal/testdata/struct.proto \ - google/protobuf/util/internal/testdata/timestamp_duration.proto \ - 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 - -EXTRA_DIST = \ - $(protoc_inputs) \ - README.md \ - 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_import.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/map_test_data.txt \ - google/protobuf/testdata/text_format_unittest_data.txt \ - google/protobuf/testdata/text_format_unittest_data_oneof_implemented.txt \ - google/protobuf/testdata/text_format_unittest_data_pointy.txt \ - 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/util/package_info.h \ - libprotobuf-lite.map \ - libprotobuf.map \ - libprotoc.map \ - solaris/libstdc++.la - -protoc_lite_outputs = \ - google/protobuf/map_lite_unittest.pb.cc \ - google/protobuf/map_lite_unittest.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_lite.pb.cc \ - google/protobuf/unittest_lite.pb.h - -protoc_outputs = \ - $(protoc_lite_outputs) \ - google/protobuf/any_test.pb.cc \ - google/protobuf/any_test.pb.h \ - google/protobuf/compiler/cpp/cpp_test_bad_identifiers.pb.cc \ - google/protobuf/compiler/cpp/cpp_test_bad_identifiers.pb.h \ - google/protobuf/compiler/cpp/cpp_test_large_enum_value.pb.cc \ - google/protobuf/compiler/cpp/cpp_test_large_enum_value.pb.h \ - google/protobuf/map_proto2_unittest.pb.cc \ - 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 \ - google/protobuf/unittest_custom_options.pb.h \ - google/protobuf/unittest_drop_unknown_fields.pb.cc \ - google/protobuf/unittest_drop_unknown_fields.pb.h \ - google/protobuf/unittest_embed_optimize_for.pb.cc \ - google/protobuf/unittest_embed_optimize_for.pb.h \ - google/protobuf/unittest_empty.pb.cc \ - google/protobuf/unittest_empty.pb.h \ - google/protobuf/unittest_enormous_descriptor.pb.cc \ - google/protobuf/unittest_enormous_descriptor.pb.h \ - google/protobuf/unittest_import.pb.cc \ - google/protobuf/unittest_import.pb.h \ - google/protobuf/unittest_import_public.pb.cc \ - google/protobuf/unittest_import_public.pb.h \ - google/protobuf/unittest_lazy_dependencies.pb.cc \ - google/protobuf/unittest_lazy_dependencies.pb.h \ - google/protobuf/unittest_lazy_dependencies_custom_option.pb.cc \ - google/protobuf/unittest_lazy_dependencies_custom_option.pb.h \ - google/protobuf/unittest_lazy_dependencies_enum.pb.cc \ - google/protobuf/unittest_lazy_dependencies_enum.pb.h \ - google/protobuf/unittest_lite_imports_nonlite.pb.cc \ - google/protobuf/unittest_lite_imports_nonlite.pb.h \ - google/protobuf/unittest_mset.pb.cc \ - google/protobuf/unittest_mset.pb.h \ - google/protobuf/unittest_mset_wire_format.pb.cc \ - google/protobuf/unittest_mset_wire_format.pb.h \ - google/protobuf/unittest_no_field_presence.pb.cc \ - google/protobuf/unittest_no_field_presence.pb.h \ - google/protobuf/unittest_no_generic_services.pb.cc \ - 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_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 \ - google/protobuf/unittest_proto3_arena.pb.h \ - google/protobuf/unittest_proto3_arena_lite.pb.cc \ - google/protobuf/unittest_proto3_arena_lite.pb.h \ - google/protobuf/unittest_proto3_lite.pb.cc \ - google/protobuf/unittest_proto3_lite.pb.h \ - google/protobuf/unittest_proto3_optional.pb.cc \ - google/protobuf/unittest_proto3_optional.pb.h \ - google/protobuf/unittest_well_known_types.pb.cc \ - google/protobuf/unittest_well_known_types.pb.h \ - google/protobuf/util/internal/testdata/anys.pb.cc \ - google/protobuf/util/internal/testdata/anys.pb.h \ - google/protobuf/util/internal/testdata/books.pb.cc \ - google/protobuf/util/internal/testdata/books.pb.h \ - google/protobuf/util/internal/testdata/default_value.pb.cc \ - google/protobuf/util/internal/testdata/default_value.pb.h \ - google/protobuf/util/internal/testdata/default_value_test.pb.cc \ - google/protobuf/util/internal/testdata/default_value_test.pb.h \ - google/protobuf/util/internal/testdata/field_mask.pb.cc \ - google/protobuf/util/internal/testdata/field_mask.pb.h \ - google/protobuf/util/internal/testdata/maps.pb.cc \ - google/protobuf/util/internal/testdata/maps.pb.h \ - google/protobuf/util/internal/testdata/oneofs.pb.cc \ - google/protobuf/util/internal/testdata/oneofs.pb.h \ - google/protobuf/util/internal/testdata/proto3.pb.cc \ - google/protobuf/util/internal/testdata/proto3.pb.h \ - google/protobuf/util/internal/testdata/struct.pb.cc \ - google/protobuf/util/internal/testdata/struct.pb.h \ - google/protobuf/util/internal/testdata/timestamp_duration.pb.cc \ - google/protobuf/util/internal/testdata/timestamp_duration.pb.h \ - google/protobuf/util/internal/testdata/wrappers.pb.cc \ - google/protobuf/util/internal/testdata/wrappers.pb.h \ - google/protobuf/util/json_format.pb.cc \ - google/protobuf/util/json_format.pb.h \ - google/protobuf/util/json_format_proto3.pb.cc \ - google/protobuf/util/json_format_proto3.pb.h \ - google/protobuf/util/message_differencer_unittest.pb.cc \ - google/protobuf/util/message_differencer_unittest.pb.h - -COMMON_TEST_SOURCES = \ - $(COMMON_LITE_TEST_SOURCES) \ - google/protobuf/compiler/cpp/cpp_unittest.h \ - google/protobuf/map_test_util.h \ - google/protobuf/map_test_util.inc \ - google/protobuf/reflection_tester.cc \ - google/protobuf/reflection_tester.h \ - google/protobuf/test_util.cc \ - google/protobuf/test_util.h \ - google/protobuf/test_util.inc \ - google/protobuf/test_util2.h \ - google/protobuf/testing/file.cc \ - 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 -GOOGLETEST_SRC_DIR = $(srcdir)/../third_party/googletest/googletest -GOOGLEMOCK_SRC_DIR = $(srcdir)/../third_party/googletest/googlemock -protobuf_test_LDADD = $(PTHREAD_LIBS) libprotobuf.la libprotoc.la \ - $(GOOGLETEST_BUILD_DIR)/lib/libgtest.la \ - $(GOOGLEMOCK_BUILD_DIR)/lib/libgmock.la \ - $(GOOGLEMOCK_BUILD_DIR)/lib/libgmock_main.la - -protobuf_test_CPPFLAGS = -I$(GOOGLETEST_SRC_DIR)/include \ - -I$(GOOGLEMOCK_SRC_DIR)/include - -# Disable optimization for tests unless the user explicitly asked for it, -# since test_util.cc takes forever to compile with optimization (with GCC). -# See configure.ac for more info. -protobuf_test_CXXFLAGS = $(NO_OPT_CXXFLAGS) -protobuf_test_SOURCES = \ - $(COMMON_TEST_SOURCES) \ - google/protobuf/any_test.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.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 \ - google/protobuf/dynamic_message_unittest.cc \ - 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 \ - google/protobuf/message_unittest.cc \ - google/protobuf/message_unittest.inc \ - google/protobuf/no_field_presence_test.cc \ - google/protobuf/preserve_unknown_enum_test.cc \ - google/protobuf/proto3_arena_lite_unittest.cc \ - google/protobuf/proto3_arena_unittest.cc \ - google/protobuf/proto3_lite_unittest.cc \ - google/protobuf/proto3_lite_unittest.inc \ - 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/util/delimited_message_util_test.cc \ - google/protobuf/util/field_comparator_test.cc \ - google/protobuf/util/field_mask_util_test.cc \ - google/protobuf/util/internal/default_value_objectwriter_test.cc \ - google/protobuf/util/internal/json_objectwriter_test.cc \ - google/protobuf/util/internal/json_stream_parser_test.cc \ - google/protobuf/util/internal/protostream_objectsource_test.cc \ - google/protobuf/util/internal/protostream_objectwriter_test.cc \ - google/protobuf/util/internal/type_info_test_helper.cc \ - google/protobuf/util/json_util_test.cc \ - google/protobuf/util/message_differencer_unittest.cc \ - google/protobuf/util/time_util_test.cc \ - google/protobuf/util/type_resolver_util_test.cc \ - google/protobuf/well_known_types_unittest.cc \ - google/protobuf/wire_format_unittest.cc \ - google/protobuf/wire_format_unittest.inc - -nodist_protobuf_test_SOURCES = $(protoc_outputs) - -# Run cpp_unittest again with PROTOBUF_TEST_NO_DESCRIPTORS defined. -protobuf_lazy_descriptor_test_LDADD = $(PTHREAD_LIBS) libprotobuf.la \ - libprotoc.la \ - $(GOOGLETEST_BUILD_DIR)/lib/libgtest.la \ - $(GOOGLEMOCK_BUILD_DIR)/lib/libgmock.la \ - $(GOOGLEMOCK_BUILD_DIR)/lib/libgmock_main.la - -protobuf_lazy_descriptor_test_CPPFLAGS = -I$(GOOGLEMOCK_SRC_DIR)/include \ - -I$(GOOGLETEST_SRC_DIR)/include \ - -DPROTOBUF_TEST_NO_DESCRIPTORS - -protobuf_lazy_descriptor_test_CXXFLAGS = $(NO_OPT_CXXFLAGS) -protobuf_lazy_descriptor_test_SOURCES = \ - google/protobuf/compiler/cpp/cpp_unittest.cc \ - $(COMMON_TEST_SOURCES) - -nodist_protobuf_lazy_descriptor_test_SOURCES = $(protoc_outputs) -COMMON_LITE_TEST_SOURCES = \ - google/protobuf/arena_test_util.cc \ - google/protobuf/arena_test_util.h \ - google/protobuf/map_lite_test_util.cc \ - google/protobuf/map_lite_test_util.h \ - google/protobuf/map_test_util_impl.h \ - google/protobuf/test_util_lite.cc \ - google/protobuf/test_util_lite.h - - -# Build lite_unittest separately, since it doesn't use gtest. It can't -# depend on gtest because our internal version of gtest depend on proto -# full runtime and we want to make sure this test builds without full -# runtime. -protobuf_lite_test_LDADD = $(PTHREAD_LIBS) libprotobuf-lite.la \ - $(GOOGLETEST_BUILD_DIR)/lib/libgtest.la \ - $(GOOGLEMOCK_BUILD_DIR)/lib/libgmock.la \ - $(GOOGLEMOCK_BUILD_DIR)/lib/libgmock_main.la - -protobuf_lite_test_CPPFLAGS = -I$(GOOGLEMOCK_SRC_DIR)/include \ - -I$(GOOGLETEST_SRC_DIR)/include - -protobuf_lite_test_CXXFLAGS = $(NO_OPT_CXXFLAGS) -protobuf_lite_test_SOURCES = \ - google/protobuf/lite_unittest.cc \ - $(COMMON_LITE_TEST_SOURCES) - -nodist_protobuf_lite_test_SOURCES = $(protoc_lite_outputs) - -# lite_arena_unittest depends on gtest because teboring@ found that without -# gtest when building the test internally our memory sanitizer doesn't detect -# memory leaks (don't know why). -protobuf_lite_arena_test_LDADD = $(PTHREAD_LIBS) libprotobuf-lite.la \ - $(GOOGLETEST_BUILD_DIR)/lib/libgtest.la \ - $(GOOGLEMOCK_BUILD_DIR)/lib/libgmock.la \ - $(GOOGLEMOCK_BUILD_DIR)/lib/libgmock_main.la - -protobuf_lite_arena_test_CPPFLAGS = -I$(GOOGLEMOCK_SRC_DIR)/include \ - -I$(GOOGLETEST_SRC_DIR)/include - -protobuf_lite_arena_test_CXXFLAGS = $(NO_OPT_CXXFLAGS) -protobuf_lite_arena_test_SOURCES = \ - google/protobuf/lite_arena_unittest.cc \ - $(COMMON_LITE_TEST_SOURCES) - -nodist_protobuf_lite_arena_test_SOURCES = $(protoc_lite_outputs) - -# Test plugin binary. -test_plugin_LDADD = $(PTHREAD_LIBS) libprotobuf.la libprotoc.la \ - $(GOOGLETEST_BUILD_DIR)/lib/libgtest.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 - -@HAVE_ZLIB_TRUE@zcgzip_LDADD = $(PTHREAD_LIBS) libprotobuf.la -@HAVE_ZLIB_TRUE@zcgzip_SOURCES = google/protobuf/testing/zcgzip.cc -@HAVE_ZLIB_TRUE@zcgunzip_LDADD = $(PTHREAD_LIBS) libprotobuf.la -@HAVE_ZLIB_TRUE@zcgunzip_SOURCES = google/protobuf/testing/zcgunzip.cc -no_warning_test_LDADD = $(PTHREAD_LIBS) libprotobuf.la libprotoc.la -no_warning_test_CXXFLAGS = $(PTHREAD_CFLAGS) $(PTHREAD_DEF) $(ZLIB_DEF) \ - -Wall -Wextra -Werror -Wno-unused-parameter - -nodist_no_warning_test_SOURCES = no_warning_test.cc $(protoc_outputs) -all: all-am - -.SUFFIXES: -.SUFFIXES: .cc .lo .log .o .obj .test .test$(EXEEXT) .trs -$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__configure_deps) - @for dep in $?; do \ - case '$(am__configure_deps)' in \ - *$$dep*) \ - ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ - && { if test -f $@; then exit 0; else break; fi; }; \ - exit 1;; \ - esac; \ - done; \ - echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu src/Makefile'; \ - $(am__cd) $(top_srcdir) && \ - $(AUTOMAKE) --gnu src/Makefile -Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status - @case '$?' in \ - *config.status*) \ - cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ - *) \ - echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles)'; \ - cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles);; \ - esac; - -$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) - cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh - -$(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps) - cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh -$(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps) - cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh -$(am__aclocal_m4_deps): -install-binPROGRAMS: $(bin_PROGRAMS) - @$(NORMAL_INSTALL) - @list='$(bin_PROGRAMS)'; test -n "$(bindir)" || list=; \ - if test -n "$$list"; then \ - echo " $(MKDIR_P) '$(DESTDIR)$(bindir)'"; \ - $(MKDIR_P) "$(DESTDIR)$(bindir)" || exit 1; \ - fi; \ - for p in $$list; do echo "$$p $$p"; done | \ - sed 's/$(EXEEXT)$$//' | \ - while read p p1; do if test -f $$p \ - || test -f $$p1 \ - ; then echo "$$p"; echo "$$p"; else :; fi; \ - done | \ - sed -e 'p;s,.*/,,;n;h' \ - -e 's|.*|.|' \ - -e 'p;x;s,.*/,,;s/$(EXEEXT)$$//;$(transform);s/$$/$(EXEEXT)/' | \ - sed 'N;N;N;s,\n, ,g' | \ - $(AWK) 'BEGIN { files["."] = ""; dirs["."] = 1 } \ - { d=$$3; if (dirs[d] != 1) { print "d", d; dirs[d] = 1 } \ - if ($$2 == $$4) files[d] = files[d] " " $$1; \ - else { print "f", $$3 "/" $$4, $$1; } } \ - END { for (d in files) print "f", d, files[d] }' | \ - while read type dir files; do \ - if test "$$dir" = .; then dir=; else dir=/$$dir; fi; \ - test -z "$$files" || { \ - echo " $(INSTALL_PROGRAM_ENV) $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL_PROGRAM) $$files '$(DESTDIR)$(bindir)$$dir'"; \ - $(INSTALL_PROGRAM_ENV) $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL_PROGRAM) $$files "$(DESTDIR)$(bindir)$$dir" || exit $$?; \ - } \ - ; done - -uninstall-binPROGRAMS: - @$(NORMAL_UNINSTALL) - @list='$(bin_PROGRAMS)'; test -n "$(bindir)" || list=; \ - files=`for p in $$list; do echo "$$p"; done | \ - sed -e 'h;s,^.*/,,;s/$(EXEEXT)$$//;$(transform)' \ - -e 's/$$/$(EXEEXT)/' \ - `; \ - test -n "$$list" || exit 0; \ - echo " ( cd '$(DESTDIR)$(bindir)' && rm -f" $$files ")"; \ - cd "$(DESTDIR)$(bindir)" && rm -f $$files - -clean-binPROGRAMS: - @list='$(bin_PROGRAMS)'; test -n "$$list" || exit 0; \ - echo " rm -f" $$list; \ - rm -f $$list || exit $$?; \ - test -n "$(EXEEXT)" || exit 0; \ - list=`for p in $$list; do echo "$$p"; done | sed 's/$(EXEEXT)$$//'`; \ - echo " rm -f" $$list; \ - rm -f $$list - -clean-checkPROGRAMS: - @list='$(check_PROGRAMS)'; test -n "$$list" || exit 0; \ - echo " rm -f" $$list; \ - rm -f $$list || exit $$?; \ - test -n "$(EXEEXT)" || exit 0; \ - list=`for p in $$list; do echo "$$p"; done | sed 's/$(EXEEXT)$$//'`; \ - echo " rm -f" $$list; \ - rm -f $$list - -install-libLTLIBRARIES: $(lib_LTLIBRARIES) - @$(NORMAL_INSTALL) - @list='$(lib_LTLIBRARIES)'; test -n "$(libdir)" || list=; \ - list2=; for p in $$list; do \ - if test -f $$p; then \ - list2="$$list2 $$p"; \ - else :; fi; \ - done; \ - test -z "$$list2" || { \ - echo " $(MKDIR_P) '$(DESTDIR)$(libdir)'"; \ - $(MKDIR_P) "$(DESTDIR)$(libdir)" || exit 1; \ - echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$list2 '$(DESTDIR)$(libdir)'"; \ - $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$list2 "$(DESTDIR)$(libdir)"; \ - } - -uninstall-libLTLIBRARIES: - @$(NORMAL_UNINSTALL) - @list='$(lib_LTLIBRARIES)'; test -n "$(libdir)" || list=; \ - for p in $$list; do \ - $(am__strip_dir) \ - echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f '$(DESTDIR)$(libdir)/$$f'"; \ - $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f "$(DESTDIR)$(libdir)/$$f"; \ - done - -clean-libLTLIBRARIES: - -test -z "$(lib_LTLIBRARIES)" || rm -f $(lib_LTLIBRARIES) - @list='$(lib_LTLIBRARIES)'; \ - locs=`for p in $$list; do echo $$p; done | \ - sed 's|^[^/]*$$|.|; s|/[^/]*$$||; s|$$|/so_locations|' | \ - sort -u`; \ - test -z "$$locs" || { \ - echo rm -f $${locs}; \ - rm -f $${locs}; \ - } -google/protobuf/$(am__dirstamp): - @$(MKDIR_P) google/protobuf - @: > google/protobuf/$(am__dirstamp) -google/protobuf/$(DEPDIR)/$(am__dirstamp): - @$(MKDIR_P) google/protobuf/$(DEPDIR) - @: > google/protobuf/$(DEPDIR)/$(am__dirstamp) -google/protobuf/any_lite.lo: google/protobuf/$(am__dirstamp) \ - google/protobuf/$(DEPDIR)/$(am__dirstamp) -google/protobuf/arena.lo: google/protobuf/$(am__dirstamp) \ - google/protobuf/$(DEPDIR)/$(am__dirstamp) -google/protobuf/arenastring.lo: google/protobuf/$(am__dirstamp) \ - google/protobuf/$(DEPDIR)/$(am__dirstamp) -google/protobuf/extension_set.lo: google/protobuf/$(am__dirstamp) \ - google/protobuf/$(DEPDIR)/$(am__dirstamp) -google/protobuf/generated_enum_util.lo: \ - google/protobuf/$(am__dirstamp) \ - google/protobuf/$(DEPDIR)/$(am__dirstamp) -google/protobuf/generated_message_table_driven_lite.lo: \ - google/protobuf/$(am__dirstamp) \ - google/protobuf/$(DEPDIR)/$(am__dirstamp) -google/protobuf/generated_message_tctable_lite.lo: \ - google/protobuf/$(am__dirstamp) \ - google/protobuf/$(DEPDIR)/$(am__dirstamp) -google/protobuf/generated_message_util.lo: \ - google/protobuf/$(am__dirstamp) \ - google/protobuf/$(DEPDIR)/$(am__dirstamp) -google/protobuf/implicit_weak_message.lo: \ - google/protobuf/$(am__dirstamp) \ - google/protobuf/$(DEPDIR)/$(am__dirstamp) -google/protobuf/inlined_string_field.lo: \ - google/protobuf/$(am__dirstamp) \ - google/protobuf/$(DEPDIR)/$(am__dirstamp) -google/protobuf/io/$(am__dirstamp): - @$(MKDIR_P) google/protobuf/io - @: > google/protobuf/io/$(am__dirstamp) -google/protobuf/io/$(DEPDIR)/$(am__dirstamp): - @$(MKDIR_P) google/protobuf/io/$(DEPDIR) - @: > google/protobuf/io/$(DEPDIR)/$(am__dirstamp) -google/protobuf/io/coded_stream.lo: \ - google/protobuf/io/$(am__dirstamp) \ - google/protobuf/io/$(DEPDIR)/$(am__dirstamp) -google/protobuf/io/io_win32.lo: google/protobuf/io/$(am__dirstamp) \ - google/protobuf/io/$(DEPDIR)/$(am__dirstamp) -google/protobuf/io/strtod.lo: google/protobuf/io/$(am__dirstamp) \ - google/protobuf/io/$(DEPDIR)/$(am__dirstamp) -google/protobuf/io/zero_copy_stream.lo: \ - google/protobuf/io/$(am__dirstamp) \ - google/protobuf/io/$(DEPDIR)/$(am__dirstamp) -google/protobuf/io/zero_copy_stream_impl.lo: \ - google/protobuf/io/$(am__dirstamp) \ - google/protobuf/io/$(DEPDIR)/$(am__dirstamp) -google/protobuf/io/zero_copy_stream_impl_lite.lo: \ - google/protobuf/io/$(am__dirstamp) \ - google/protobuf/io/$(DEPDIR)/$(am__dirstamp) -google/protobuf/map.lo: google/protobuf/$(am__dirstamp) \ - google/protobuf/$(DEPDIR)/$(am__dirstamp) -google/protobuf/message_lite.lo: google/protobuf/$(am__dirstamp) \ - google/protobuf/$(DEPDIR)/$(am__dirstamp) -google/protobuf/parse_context.lo: google/protobuf/$(am__dirstamp) \ - google/protobuf/$(DEPDIR)/$(am__dirstamp) -google/protobuf/repeated_field.lo: google/protobuf/$(am__dirstamp) \ - google/protobuf/$(DEPDIR)/$(am__dirstamp) -google/protobuf/repeated_ptr_field.lo: \ - google/protobuf/$(am__dirstamp) \ - google/protobuf/$(DEPDIR)/$(am__dirstamp) -google/protobuf/stubs/$(am__dirstamp): - @$(MKDIR_P) google/protobuf/stubs - @: > google/protobuf/stubs/$(am__dirstamp) -google/protobuf/stubs/$(DEPDIR)/$(am__dirstamp): - @$(MKDIR_P) google/protobuf/stubs/$(DEPDIR) - @: > google/protobuf/stubs/$(DEPDIR)/$(am__dirstamp) -google/protobuf/stubs/bytestream.lo: \ - google/protobuf/stubs/$(am__dirstamp) \ - google/protobuf/stubs/$(DEPDIR)/$(am__dirstamp) -google/protobuf/stubs/common.lo: \ - google/protobuf/stubs/$(am__dirstamp) \ - google/protobuf/stubs/$(DEPDIR)/$(am__dirstamp) -google/protobuf/stubs/int128.lo: \ - google/protobuf/stubs/$(am__dirstamp) \ - google/protobuf/stubs/$(DEPDIR)/$(am__dirstamp) -google/protobuf/stubs/status.lo: \ - google/protobuf/stubs/$(am__dirstamp) \ - google/protobuf/stubs/$(DEPDIR)/$(am__dirstamp) -google/protobuf/stubs/statusor.lo: \ - google/protobuf/stubs/$(am__dirstamp) \ - google/protobuf/stubs/$(DEPDIR)/$(am__dirstamp) -google/protobuf/stubs/stringpiece.lo: \ - google/protobuf/stubs/$(am__dirstamp) \ - google/protobuf/stubs/$(DEPDIR)/$(am__dirstamp) -google/protobuf/stubs/stringprintf.lo: \ - google/protobuf/stubs/$(am__dirstamp) \ - google/protobuf/stubs/$(DEPDIR)/$(am__dirstamp) -google/protobuf/stubs/structurally_valid.lo: \ - google/protobuf/stubs/$(am__dirstamp) \ - google/protobuf/stubs/$(DEPDIR)/$(am__dirstamp) -google/protobuf/stubs/strutil.lo: \ - google/protobuf/stubs/$(am__dirstamp) \ - google/protobuf/stubs/$(DEPDIR)/$(am__dirstamp) -google/protobuf/stubs/time.lo: google/protobuf/stubs/$(am__dirstamp) \ - google/protobuf/stubs/$(DEPDIR)/$(am__dirstamp) -google/protobuf/wire_format_lite.lo: google/protobuf/$(am__dirstamp) \ - google/protobuf/$(DEPDIR)/$(am__dirstamp) - -libprotobuf-lite.la: $(libprotobuf_lite_la_OBJECTS) $(libprotobuf_lite_la_DEPENDENCIES) $(EXTRA_libprotobuf_lite_la_DEPENDENCIES) - $(AM_V_CXXLD)$(libprotobuf_lite_la_LINK) -rpath $(libdir) $(libprotobuf_lite_la_OBJECTS) $(libprotobuf_lite_la_LIBADD) $(LIBS) -google/protobuf/any.lo: google/protobuf/$(am__dirstamp) \ - google/protobuf/$(DEPDIR)/$(am__dirstamp) -google/protobuf/any.pb.lo: google/protobuf/$(am__dirstamp) \ - google/protobuf/$(DEPDIR)/$(am__dirstamp) -google/protobuf/api.pb.lo: google/protobuf/$(am__dirstamp) \ - google/protobuf/$(DEPDIR)/$(am__dirstamp) -google/protobuf/compiler/$(am__dirstamp): - @$(MKDIR_P) google/protobuf/compiler - @: > google/protobuf/compiler/$(am__dirstamp) -google/protobuf/compiler/$(DEPDIR)/$(am__dirstamp): - @$(MKDIR_P) google/protobuf/compiler/$(DEPDIR) - @: > google/protobuf/compiler/$(DEPDIR)/$(am__dirstamp) -google/protobuf/compiler/importer.lo: \ - google/protobuf/compiler/$(am__dirstamp) \ - google/protobuf/compiler/$(DEPDIR)/$(am__dirstamp) -google/protobuf/compiler/parser.lo: \ - google/protobuf/compiler/$(am__dirstamp) \ - google/protobuf/compiler/$(DEPDIR)/$(am__dirstamp) -google/protobuf/descriptor.lo: google/protobuf/$(am__dirstamp) \ - google/protobuf/$(DEPDIR)/$(am__dirstamp) -google/protobuf/descriptor.pb.lo: google/protobuf/$(am__dirstamp) \ - google/protobuf/$(DEPDIR)/$(am__dirstamp) -google/protobuf/descriptor_database.lo: \ - google/protobuf/$(am__dirstamp) \ - google/protobuf/$(DEPDIR)/$(am__dirstamp) -google/protobuf/duration.pb.lo: google/protobuf/$(am__dirstamp) \ - google/protobuf/$(DEPDIR)/$(am__dirstamp) -google/protobuf/dynamic_message.lo: google/protobuf/$(am__dirstamp) \ - google/protobuf/$(DEPDIR)/$(am__dirstamp) -google/protobuf/empty.pb.lo: google/protobuf/$(am__dirstamp) \ - google/protobuf/$(DEPDIR)/$(am__dirstamp) -google/protobuf/extension_set_heavy.lo: \ - google/protobuf/$(am__dirstamp) \ - google/protobuf/$(DEPDIR)/$(am__dirstamp) -google/protobuf/field_mask.pb.lo: google/protobuf/$(am__dirstamp) \ - google/protobuf/$(DEPDIR)/$(am__dirstamp) -google/protobuf/generated_message_bases.lo: \ - google/protobuf/$(am__dirstamp) \ - google/protobuf/$(DEPDIR)/$(am__dirstamp) -google/protobuf/generated_message_reflection.lo: \ - google/protobuf/$(am__dirstamp) \ - google/protobuf/$(DEPDIR)/$(am__dirstamp) -google/protobuf/generated_message_table_driven.lo: \ - google/protobuf/$(am__dirstamp) \ - google/protobuf/$(DEPDIR)/$(am__dirstamp) -google/protobuf/generated_message_tctable_full.lo: \ - google/protobuf/$(am__dirstamp) \ - google/protobuf/$(DEPDIR)/$(am__dirstamp) -google/protobuf/io/gzip_stream.lo: google/protobuf/io/$(am__dirstamp) \ - google/protobuf/io/$(DEPDIR)/$(am__dirstamp) -google/protobuf/io/printer.lo: google/protobuf/io/$(am__dirstamp) \ - google/protobuf/io/$(DEPDIR)/$(am__dirstamp) -google/protobuf/io/tokenizer.lo: google/protobuf/io/$(am__dirstamp) \ - google/protobuf/io/$(DEPDIR)/$(am__dirstamp) -google/protobuf/map_field.lo: google/protobuf/$(am__dirstamp) \ - google/protobuf/$(DEPDIR)/$(am__dirstamp) -google/protobuf/message.lo: google/protobuf/$(am__dirstamp) \ - google/protobuf/$(DEPDIR)/$(am__dirstamp) -google/protobuf/reflection_ops.lo: google/protobuf/$(am__dirstamp) \ - google/protobuf/$(DEPDIR)/$(am__dirstamp) -google/protobuf/service.lo: google/protobuf/$(am__dirstamp) \ - google/protobuf/$(DEPDIR)/$(am__dirstamp) -google/protobuf/source_context.pb.lo: google/protobuf/$(am__dirstamp) \ - google/protobuf/$(DEPDIR)/$(am__dirstamp) -google/protobuf/struct.pb.lo: google/protobuf/$(am__dirstamp) \ - google/protobuf/$(DEPDIR)/$(am__dirstamp) -google/protobuf/stubs/substitute.lo: \ - google/protobuf/stubs/$(am__dirstamp) \ - google/protobuf/stubs/$(DEPDIR)/$(am__dirstamp) -google/protobuf/text_format.lo: google/protobuf/$(am__dirstamp) \ - google/protobuf/$(DEPDIR)/$(am__dirstamp) -google/protobuf/timestamp.pb.lo: google/protobuf/$(am__dirstamp) \ - google/protobuf/$(DEPDIR)/$(am__dirstamp) -google/protobuf/type.pb.lo: google/protobuf/$(am__dirstamp) \ - google/protobuf/$(DEPDIR)/$(am__dirstamp) -google/protobuf/unknown_field_set.lo: google/protobuf/$(am__dirstamp) \ - google/protobuf/$(DEPDIR)/$(am__dirstamp) -google/protobuf/util/$(am__dirstamp): - @$(MKDIR_P) google/protobuf/util - @: > google/protobuf/util/$(am__dirstamp) -google/protobuf/util/$(DEPDIR)/$(am__dirstamp): - @$(MKDIR_P) google/protobuf/util/$(DEPDIR) - @: > google/protobuf/util/$(DEPDIR)/$(am__dirstamp) -google/protobuf/util/delimited_message_util.lo: \ - google/protobuf/util/$(am__dirstamp) \ - google/protobuf/util/$(DEPDIR)/$(am__dirstamp) -google/protobuf/util/field_comparator.lo: \ - google/protobuf/util/$(am__dirstamp) \ - google/protobuf/util/$(DEPDIR)/$(am__dirstamp) -google/protobuf/util/field_mask_util.lo: \ - google/protobuf/util/$(am__dirstamp) \ - google/protobuf/util/$(DEPDIR)/$(am__dirstamp) -google/protobuf/util/internal/$(am__dirstamp): - @$(MKDIR_P) google/protobuf/util/internal - @: > google/protobuf/util/internal/$(am__dirstamp) -google/protobuf/util/internal/$(DEPDIR)/$(am__dirstamp): - @$(MKDIR_P) google/protobuf/util/internal/$(DEPDIR) - @: > google/protobuf/util/internal/$(DEPDIR)/$(am__dirstamp) -google/protobuf/util/internal/datapiece.lo: \ - google/protobuf/util/internal/$(am__dirstamp) \ - google/protobuf/util/internal/$(DEPDIR)/$(am__dirstamp) -google/protobuf/util/internal/default_value_objectwriter.lo: \ - google/protobuf/util/internal/$(am__dirstamp) \ - google/protobuf/util/internal/$(DEPDIR)/$(am__dirstamp) -google/protobuf/util/internal/error_listener.lo: \ - google/protobuf/util/internal/$(am__dirstamp) \ - google/protobuf/util/internal/$(DEPDIR)/$(am__dirstamp) -google/protobuf/util/internal/field_mask_utility.lo: \ - google/protobuf/util/internal/$(am__dirstamp) \ - google/protobuf/util/internal/$(DEPDIR)/$(am__dirstamp) -google/protobuf/util/internal/json_escaping.lo: \ - google/protobuf/util/internal/$(am__dirstamp) \ - google/protobuf/util/internal/$(DEPDIR)/$(am__dirstamp) -google/protobuf/util/internal/json_objectwriter.lo: \ - google/protobuf/util/internal/$(am__dirstamp) \ - google/protobuf/util/internal/$(DEPDIR)/$(am__dirstamp) -google/protobuf/util/internal/json_stream_parser.lo: \ - google/protobuf/util/internal/$(am__dirstamp) \ - google/protobuf/util/internal/$(DEPDIR)/$(am__dirstamp) -google/protobuf/util/internal/object_writer.lo: \ - google/protobuf/util/internal/$(am__dirstamp) \ - google/protobuf/util/internal/$(DEPDIR)/$(am__dirstamp) -google/protobuf/util/internal/proto_writer.lo: \ - google/protobuf/util/internal/$(am__dirstamp) \ - google/protobuf/util/internal/$(DEPDIR)/$(am__dirstamp) -google/protobuf/util/internal/protostream_objectsource.lo: \ - google/protobuf/util/internal/$(am__dirstamp) \ - google/protobuf/util/internal/$(DEPDIR)/$(am__dirstamp) -google/protobuf/util/internal/protostream_objectwriter.lo: \ - google/protobuf/util/internal/$(am__dirstamp) \ - google/protobuf/util/internal/$(DEPDIR)/$(am__dirstamp) -google/protobuf/util/internal/type_info.lo: \ - google/protobuf/util/internal/$(am__dirstamp) \ - google/protobuf/util/internal/$(DEPDIR)/$(am__dirstamp) -google/protobuf/util/internal/utility.lo: \ - google/protobuf/util/internal/$(am__dirstamp) \ - google/protobuf/util/internal/$(DEPDIR)/$(am__dirstamp) -google/protobuf/util/json_util.lo: \ - google/protobuf/util/$(am__dirstamp) \ - google/protobuf/util/$(DEPDIR)/$(am__dirstamp) -google/protobuf/util/message_differencer.lo: \ - google/protobuf/util/$(am__dirstamp) \ - google/protobuf/util/$(DEPDIR)/$(am__dirstamp) -google/protobuf/util/time_util.lo: \ - google/protobuf/util/$(am__dirstamp) \ - google/protobuf/util/$(DEPDIR)/$(am__dirstamp) -google/protobuf/util/type_resolver_util.lo: \ - google/protobuf/util/$(am__dirstamp) \ - google/protobuf/util/$(DEPDIR)/$(am__dirstamp) -google/protobuf/wire_format.lo: google/protobuf/$(am__dirstamp) \ - google/protobuf/$(DEPDIR)/$(am__dirstamp) -google/protobuf/wrappers.pb.lo: google/protobuf/$(am__dirstamp) \ - google/protobuf/$(DEPDIR)/$(am__dirstamp) - -libprotobuf.la: $(libprotobuf_la_OBJECTS) $(libprotobuf_la_DEPENDENCIES) $(EXTRA_libprotobuf_la_DEPENDENCIES) - $(AM_V_CXXLD)$(libprotobuf_la_LINK) -rpath $(libdir) $(libprotobuf_la_OBJECTS) $(libprotobuf_la_LIBADD) $(LIBS) -google/protobuf/compiler/code_generator.lo: \ - google/protobuf/compiler/$(am__dirstamp) \ - google/protobuf/compiler/$(DEPDIR)/$(am__dirstamp) -google/protobuf/compiler/command_line_interface.lo: \ - google/protobuf/compiler/$(am__dirstamp) \ - google/protobuf/compiler/$(DEPDIR)/$(am__dirstamp) -google/protobuf/compiler/cpp/$(am__dirstamp): - @$(MKDIR_P) google/protobuf/compiler/cpp - @: > google/protobuf/compiler/cpp/$(am__dirstamp) -google/protobuf/compiler/cpp/$(DEPDIR)/$(am__dirstamp): - @$(MKDIR_P) google/protobuf/compiler/cpp/$(DEPDIR) - @: > google/protobuf/compiler/cpp/$(DEPDIR)/$(am__dirstamp) -google/protobuf/compiler/cpp/cpp_enum.lo: \ - google/protobuf/compiler/cpp/$(am__dirstamp) \ - google/protobuf/compiler/cpp/$(DEPDIR)/$(am__dirstamp) -google/protobuf/compiler/cpp/cpp_enum_field.lo: \ - google/protobuf/compiler/cpp/$(am__dirstamp) \ - google/protobuf/compiler/cpp/$(DEPDIR)/$(am__dirstamp) -google/protobuf/compiler/cpp/cpp_extension.lo: \ - google/protobuf/compiler/cpp/$(am__dirstamp) \ - google/protobuf/compiler/cpp/$(DEPDIR)/$(am__dirstamp) -google/protobuf/compiler/cpp/cpp_field.lo: \ - google/protobuf/compiler/cpp/$(am__dirstamp) \ - google/protobuf/compiler/cpp/$(DEPDIR)/$(am__dirstamp) -google/protobuf/compiler/cpp/cpp_file.lo: \ - google/protobuf/compiler/cpp/$(am__dirstamp) \ - google/protobuf/compiler/cpp/$(DEPDIR)/$(am__dirstamp) -google/protobuf/compiler/cpp/cpp_generator.lo: \ - google/protobuf/compiler/cpp/$(am__dirstamp) \ - google/protobuf/compiler/cpp/$(DEPDIR)/$(am__dirstamp) -google/protobuf/compiler/cpp/cpp_helpers.lo: \ - google/protobuf/compiler/cpp/$(am__dirstamp) \ - google/protobuf/compiler/cpp/$(DEPDIR)/$(am__dirstamp) -google/protobuf/compiler/cpp/cpp_map_field.lo: \ - google/protobuf/compiler/cpp/$(am__dirstamp) \ - google/protobuf/compiler/cpp/$(DEPDIR)/$(am__dirstamp) -google/protobuf/compiler/cpp/cpp_message.lo: \ - google/protobuf/compiler/cpp/$(am__dirstamp) \ - google/protobuf/compiler/cpp/$(DEPDIR)/$(am__dirstamp) -google/protobuf/compiler/cpp/cpp_message_field.lo: \ - google/protobuf/compiler/cpp/$(am__dirstamp) \ - google/protobuf/compiler/cpp/$(DEPDIR)/$(am__dirstamp) -google/protobuf/compiler/cpp/cpp_padding_optimizer.lo: \ - google/protobuf/compiler/cpp/$(am__dirstamp) \ - google/protobuf/compiler/cpp/$(DEPDIR)/$(am__dirstamp) -google/protobuf/compiler/cpp/cpp_parse_function_generator.lo: \ - google/protobuf/compiler/cpp/$(am__dirstamp) \ - google/protobuf/compiler/cpp/$(DEPDIR)/$(am__dirstamp) -google/protobuf/compiler/cpp/cpp_primitive_field.lo: \ - google/protobuf/compiler/cpp/$(am__dirstamp) \ - google/protobuf/compiler/cpp/$(DEPDIR)/$(am__dirstamp) -google/protobuf/compiler/cpp/cpp_service.lo: \ - google/protobuf/compiler/cpp/$(am__dirstamp) \ - google/protobuf/compiler/cpp/$(DEPDIR)/$(am__dirstamp) -google/protobuf/compiler/cpp/cpp_string_field.lo: \ - google/protobuf/compiler/cpp/$(am__dirstamp) \ - google/protobuf/compiler/cpp/$(DEPDIR)/$(am__dirstamp) -google/protobuf/compiler/csharp/$(am__dirstamp): - @$(MKDIR_P) google/protobuf/compiler/csharp - @: > google/protobuf/compiler/csharp/$(am__dirstamp) -google/protobuf/compiler/csharp/$(DEPDIR)/$(am__dirstamp): - @$(MKDIR_P) google/protobuf/compiler/csharp/$(DEPDIR) - @: > google/protobuf/compiler/csharp/$(DEPDIR)/$(am__dirstamp) -google/protobuf/compiler/csharp/csharp_doc_comment.lo: \ - google/protobuf/compiler/csharp/$(am__dirstamp) \ - google/protobuf/compiler/csharp/$(DEPDIR)/$(am__dirstamp) -google/protobuf/compiler/csharp/csharp_enum.lo: \ - google/protobuf/compiler/csharp/$(am__dirstamp) \ - google/protobuf/compiler/csharp/$(DEPDIR)/$(am__dirstamp) -google/protobuf/compiler/csharp/csharp_enum_field.lo: \ - google/protobuf/compiler/csharp/$(am__dirstamp) \ - google/protobuf/compiler/csharp/$(DEPDIR)/$(am__dirstamp) -google/protobuf/compiler/csharp/csharp_field_base.lo: \ - google/protobuf/compiler/csharp/$(am__dirstamp) \ - google/protobuf/compiler/csharp/$(DEPDIR)/$(am__dirstamp) -google/protobuf/compiler/csharp/csharp_generator.lo: \ - google/protobuf/compiler/csharp/$(am__dirstamp) \ - google/protobuf/compiler/csharp/$(DEPDIR)/$(am__dirstamp) -google/protobuf/compiler/csharp/csharp_helpers.lo: \ - google/protobuf/compiler/csharp/$(am__dirstamp) \ - google/protobuf/compiler/csharp/$(DEPDIR)/$(am__dirstamp) -google/protobuf/compiler/csharp/csharp_map_field.lo: \ - google/protobuf/compiler/csharp/$(am__dirstamp) \ - google/protobuf/compiler/csharp/$(DEPDIR)/$(am__dirstamp) -google/protobuf/compiler/csharp/csharp_message.lo: \ - google/protobuf/compiler/csharp/$(am__dirstamp) \ - google/protobuf/compiler/csharp/$(DEPDIR)/$(am__dirstamp) -google/protobuf/compiler/csharp/csharp_message_field.lo: \ - google/protobuf/compiler/csharp/$(am__dirstamp) \ - google/protobuf/compiler/csharp/$(DEPDIR)/$(am__dirstamp) -google/protobuf/compiler/csharp/csharp_primitive_field.lo: \ - google/protobuf/compiler/csharp/$(am__dirstamp) \ - google/protobuf/compiler/csharp/$(DEPDIR)/$(am__dirstamp) -google/protobuf/compiler/csharp/csharp_reflection_class.lo: \ - google/protobuf/compiler/csharp/$(am__dirstamp) \ - google/protobuf/compiler/csharp/$(DEPDIR)/$(am__dirstamp) -google/protobuf/compiler/csharp/csharp_repeated_enum_field.lo: \ - google/protobuf/compiler/csharp/$(am__dirstamp) \ - google/protobuf/compiler/csharp/$(DEPDIR)/$(am__dirstamp) -google/protobuf/compiler/csharp/csharp_repeated_message_field.lo: \ - google/protobuf/compiler/csharp/$(am__dirstamp) \ - google/protobuf/compiler/csharp/$(DEPDIR)/$(am__dirstamp) -google/protobuf/compiler/csharp/csharp_repeated_primitive_field.lo: \ - google/protobuf/compiler/csharp/$(am__dirstamp) \ - google/protobuf/compiler/csharp/$(DEPDIR)/$(am__dirstamp) -google/protobuf/compiler/csharp/csharp_source_generator_base.lo: \ - google/protobuf/compiler/csharp/$(am__dirstamp) \ - google/protobuf/compiler/csharp/$(DEPDIR)/$(am__dirstamp) -google/protobuf/compiler/csharp/csharp_wrapper_field.lo: \ - google/protobuf/compiler/csharp/$(am__dirstamp) \ - google/protobuf/compiler/csharp/$(DEPDIR)/$(am__dirstamp) -google/protobuf/compiler/java/$(am__dirstamp): - @$(MKDIR_P) google/protobuf/compiler/java - @: > google/protobuf/compiler/java/$(am__dirstamp) -google/protobuf/compiler/java/$(DEPDIR)/$(am__dirstamp): - @$(MKDIR_P) google/protobuf/compiler/java/$(DEPDIR) - @: > google/protobuf/compiler/java/$(DEPDIR)/$(am__dirstamp) -google/protobuf/compiler/java/java_context.lo: \ - google/protobuf/compiler/java/$(am__dirstamp) \ - google/protobuf/compiler/java/$(DEPDIR)/$(am__dirstamp) -google/protobuf/compiler/java/java_doc_comment.lo: \ - google/protobuf/compiler/java/$(am__dirstamp) \ - google/protobuf/compiler/java/$(DEPDIR)/$(am__dirstamp) -google/protobuf/compiler/java/java_enum.lo: \ - google/protobuf/compiler/java/$(am__dirstamp) \ - google/protobuf/compiler/java/$(DEPDIR)/$(am__dirstamp) -google/protobuf/compiler/java/java_enum_field.lo: \ - google/protobuf/compiler/java/$(am__dirstamp) \ - google/protobuf/compiler/java/$(DEPDIR)/$(am__dirstamp) -google/protobuf/compiler/java/java_enum_field_lite.lo: \ - google/protobuf/compiler/java/$(am__dirstamp) \ - google/protobuf/compiler/java/$(DEPDIR)/$(am__dirstamp) -google/protobuf/compiler/java/java_enum_lite.lo: \ - google/protobuf/compiler/java/$(am__dirstamp) \ - google/protobuf/compiler/java/$(DEPDIR)/$(am__dirstamp) -google/protobuf/compiler/java/java_extension.lo: \ - google/protobuf/compiler/java/$(am__dirstamp) \ - google/protobuf/compiler/java/$(DEPDIR)/$(am__dirstamp) -google/protobuf/compiler/java/java_extension_lite.lo: \ - google/protobuf/compiler/java/$(am__dirstamp) \ - google/protobuf/compiler/java/$(DEPDIR)/$(am__dirstamp) -google/protobuf/compiler/java/java_field.lo: \ - google/protobuf/compiler/java/$(am__dirstamp) \ - google/protobuf/compiler/java/$(DEPDIR)/$(am__dirstamp) -google/protobuf/compiler/java/java_file.lo: \ - google/protobuf/compiler/java/$(am__dirstamp) \ - google/protobuf/compiler/java/$(DEPDIR)/$(am__dirstamp) -google/protobuf/compiler/java/java_generator.lo: \ - google/protobuf/compiler/java/$(am__dirstamp) \ - google/protobuf/compiler/java/$(DEPDIR)/$(am__dirstamp) -google/protobuf/compiler/java/java_generator_factory.lo: \ - google/protobuf/compiler/java/$(am__dirstamp) \ - google/protobuf/compiler/java/$(DEPDIR)/$(am__dirstamp) -google/protobuf/compiler/java/java_helpers.lo: \ - google/protobuf/compiler/java/$(am__dirstamp) \ - google/protobuf/compiler/java/$(DEPDIR)/$(am__dirstamp) -google/protobuf/compiler/java/java_kotlin_generator.lo: \ - google/protobuf/compiler/java/$(am__dirstamp) \ - google/protobuf/compiler/java/$(DEPDIR)/$(am__dirstamp) -google/protobuf/compiler/java/java_map_field.lo: \ - google/protobuf/compiler/java/$(am__dirstamp) \ - google/protobuf/compiler/java/$(DEPDIR)/$(am__dirstamp) -google/protobuf/compiler/java/java_map_field_lite.lo: \ - google/protobuf/compiler/java/$(am__dirstamp) \ - google/protobuf/compiler/java/$(DEPDIR)/$(am__dirstamp) -google/protobuf/compiler/java/java_message.lo: \ - google/protobuf/compiler/java/$(am__dirstamp) \ - google/protobuf/compiler/java/$(DEPDIR)/$(am__dirstamp) -google/protobuf/compiler/java/java_message_builder.lo: \ - google/protobuf/compiler/java/$(am__dirstamp) \ - google/protobuf/compiler/java/$(DEPDIR)/$(am__dirstamp) -google/protobuf/compiler/java/java_message_builder_lite.lo: \ - google/protobuf/compiler/java/$(am__dirstamp) \ - google/protobuf/compiler/java/$(DEPDIR)/$(am__dirstamp) -google/protobuf/compiler/java/java_message_field.lo: \ - google/protobuf/compiler/java/$(am__dirstamp) \ - google/protobuf/compiler/java/$(DEPDIR)/$(am__dirstamp) -google/protobuf/compiler/java/java_message_field_lite.lo: \ - google/protobuf/compiler/java/$(am__dirstamp) \ - google/protobuf/compiler/java/$(DEPDIR)/$(am__dirstamp) -google/protobuf/compiler/java/java_message_lite.lo: \ - google/protobuf/compiler/java/$(am__dirstamp) \ - google/protobuf/compiler/java/$(DEPDIR)/$(am__dirstamp) -google/protobuf/compiler/java/java_name_resolver.lo: \ - google/protobuf/compiler/java/$(am__dirstamp) \ - google/protobuf/compiler/java/$(DEPDIR)/$(am__dirstamp) -google/protobuf/compiler/java/java_primitive_field.lo: \ - google/protobuf/compiler/java/$(am__dirstamp) \ - google/protobuf/compiler/java/$(DEPDIR)/$(am__dirstamp) -google/protobuf/compiler/java/java_primitive_field_lite.lo: \ - google/protobuf/compiler/java/$(am__dirstamp) \ - google/protobuf/compiler/java/$(DEPDIR)/$(am__dirstamp) -google/protobuf/compiler/java/java_service.lo: \ - google/protobuf/compiler/java/$(am__dirstamp) \ - google/protobuf/compiler/java/$(DEPDIR)/$(am__dirstamp) -google/protobuf/compiler/java/java_shared_code_generator.lo: \ - google/protobuf/compiler/java/$(am__dirstamp) \ - google/protobuf/compiler/java/$(DEPDIR)/$(am__dirstamp) -google/protobuf/compiler/java/java_string_field.lo: \ - google/protobuf/compiler/java/$(am__dirstamp) \ - google/protobuf/compiler/java/$(DEPDIR)/$(am__dirstamp) -google/protobuf/compiler/java/java_string_field_lite.lo: \ - google/protobuf/compiler/java/$(am__dirstamp) \ - google/protobuf/compiler/java/$(DEPDIR)/$(am__dirstamp) -google/protobuf/compiler/js/$(am__dirstamp): - @$(MKDIR_P) google/protobuf/compiler/js - @: > google/protobuf/compiler/js/$(am__dirstamp) -google/protobuf/compiler/js/$(DEPDIR)/$(am__dirstamp): - @$(MKDIR_P) google/protobuf/compiler/js/$(DEPDIR) - @: > google/protobuf/compiler/js/$(DEPDIR)/$(am__dirstamp) -google/protobuf/compiler/js/js_generator.lo: \ - google/protobuf/compiler/js/$(am__dirstamp) \ - google/protobuf/compiler/js/$(DEPDIR)/$(am__dirstamp) -google/protobuf/compiler/js/well_known_types_embed.lo: \ - google/protobuf/compiler/js/$(am__dirstamp) \ - google/protobuf/compiler/js/$(DEPDIR)/$(am__dirstamp) -google/protobuf/compiler/objectivec/$(am__dirstamp): - @$(MKDIR_P) google/protobuf/compiler/objectivec - @: > google/protobuf/compiler/objectivec/$(am__dirstamp) -google/protobuf/compiler/objectivec/$(DEPDIR)/$(am__dirstamp): - @$(MKDIR_P) google/protobuf/compiler/objectivec/$(DEPDIR) - @: > google/protobuf/compiler/objectivec/$(DEPDIR)/$(am__dirstamp) -google/protobuf/compiler/objectivec/objectivec_enum.lo: \ - google/protobuf/compiler/objectivec/$(am__dirstamp) \ - google/protobuf/compiler/objectivec/$(DEPDIR)/$(am__dirstamp) -google/protobuf/compiler/objectivec/objectivec_enum_field.lo: \ - google/protobuf/compiler/objectivec/$(am__dirstamp) \ - google/protobuf/compiler/objectivec/$(DEPDIR)/$(am__dirstamp) -google/protobuf/compiler/objectivec/objectivec_extension.lo: \ - google/protobuf/compiler/objectivec/$(am__dirstamp) \ - google/protobuf/compiler/objectivec/$(DEPDIR)/$(am__dirstamp) -google/protobuf/compiler/objectivec/objectivec_field.lo: \ - google/protobuf/compiler/objectivec/$(am__dirstamp) \ - google/protobuf/compiler/objectivec/$(DEPDIR)/$(am__dirstamp) -google/protobuf/compiler/objectivec/objectivec_file.lo: \ - google/protobuf/compiler/objectivec/$(am__dirstamp) \ - google/protobuf/compiler/objectivec/$(DEPDIR)/$(am__dirstamp) -google/protobuf/compiler/objectivec/objectivec_generator.lo: \ - google/protobuf/compiler/objectivec/$(am__dirstamp) \ - google/protobuf/compiler/objectivec/$(DEPDIR)/$(am__dirstamp) -google/protobuf/compiler/objectivec/objectivec_helpers.lo: \ - google/protobuf/compiler/objectivec/$(am__dirstamp) \ - google/protobuf/compiler/objectivec/$(DEPDIR)/$(am__dirstamp) -google/protobuf/compiler/objectivec/objectivec_map_field.lo: \ - google/protobuf/compiler/objectivec/$(am__dirstamp) \ - google/protobuf/compiler/objectivec/$(DEPDIR)/$(am__dirstamp) -google/protobuf/compiler/objectivec/objectivec_message.lo: \ - google/protobuf/compiler/objectivec/$(am__dirstamp) \ - google/protobuf/compiler/objectivec/$(DEPDIR)/$(am__dirstamp) -google/protobuf/compiler/objectivec/objectivec_message_field.lo: \ - google/protobuf/compiler/objectivec/$(am__dirstamp) \ - google/protobuf/compiler/objectivec/$(DEPDIR)/$(am__dirstamp) -google/protobuf/compiler/objectivec/objectivec_oneof.lo: \ - google/protobuf/compiler/objectivec/$(am__dirstamp) \ - google/protobuf/compiler/objectivec/$(DEPDIR)/$(am__dirstamp) -google/protobuf/compiler/objectivec/objectivec_primitive_field.lo: \ - google/protobuf/compiler/objectivec/$(am__dirstamp) \ - google/protobuf/compiler/objectivec/$(DEPDIR)/$(am__dirstamp) -google/protobuf/compiler/php/$(am__dirstamp): - @$(MKDIR_P) google/protobuf/compiler/php - @: > google/protobuf/compiler/php/$(am__dirstamp) -google/protobuf/compiler/php/$(DEPDIR)/$(am__dirstamp): - @$(MKDIR_P) google/protobuf/compiler/php/$(DEPDIR) - @: > google/protobuf/compiler/php/$(DEPDIR)/$(am__dirstamp) -google/protobuf/compiler/php/php_generator.lo: \ - google/protobuf/compiler/php/$(am__dirstamp) \ - google/protobuf/compiler/php/$(DEPDIR)/$(am__dirstamp) -google/protobuf/compiler/plugin.lo: \ - google/protobuf/compiler/$(am__dirstamp) \ - google/protobuf/compiler/$(DEPDIR)/$(am__dirstamp) -google/protobuf/compiler/plugin.pb.lo: \ - google/protobuf/compiler/$(am__dirstamp) \ - google/protobuf/compiler/$(DEPDIR)/$(am__dirstamp) -google/protobuf/compiler/python/$(am__dirstamp): - @$(MKDIR_P) google/protobuf/compiler/python - @: > google/protobuf/compiler/python/$(am__dirstamp) -google/protobuf/compiler/python/$(DEPDIR)/$(am__dirstamp): - @$(MKDIR_P) google/protobuf/compiler/python/$(DEPDIR) - @: > google/protobuf/compiler/python/$(DEPDIR)/$(am__dirstamp) -google/protobuf/compiler/python/python_generator.lo: \ - google/protobuf/compiler/python/$(am__dirstamp) \ - google/protobuf/compiler/python/$(DEPDIR)/$(am__dirstamp) -google/protobuf/compiler/ruby/$(am__dirstamp): - @$(MKDIR_P) google/protobuf/compiler/ruby - @: > google/protobuf/compiler/ruby/$(am__dirstamp) -google/protobuf/compiler/ruby/$(DEPDIR)/$(am__dirstamp): - @$(MKDIR_P) google/protobuf/compiler/ruby/$(DEPDIR) - @: > google/protobuf/compiler/ruby/$(DEPDIR)/$(am__dirstamp) -google/protobuf/compiler/ruby/ruby_generator.lo: \ - google/protobuf/compiler/ruby/$(am__dirstamp) \ - google/protobuf/compiler/ruby/$(DEPDIR)/$(am__dirstamp) -google/protobuf/compiler/subprocess.lo: \ - google/protobuf/compiler/$(am__dirstamp) \ - google/protobuf/compiler/$(DEPDIR)/$(am__dirstamp) -google/protobuf/compiler/zip_writer.lo: \ - google/protobuf/compiler/$(am__dirstamp) \ - google/protobuf/compiler/$(DEPDIR)/$(am__dirstamp) - -libprotoc.la: $(libprotoc_la_OBJECTS) $(libprotoc_la_DEPENDENCIES) $(EXTRA_libprotoc_la_DEPENDENCIES) - $(AM_V_CXXLD)$(libprotoc_la_LINK) -rpath $(libdir) $(libprotoc_la_OBJECTS) $(libprotoc_la_LIBADD) $(LIBS) -google/protobuf/no_warning_test-map_lite_unittest.pb.$(OBJEXT): \ - google/protobuf/$(am__dirstamp) \ - google/protobuf/$(DEPDIR)/$(am__dirstamp) -google/protobuf/no_warning_test-unittest_import_lite.pb.$(OBJEXT): \ - google/protobuf/$(am__dirstamp) \ - google/protobuf/$(DEPDIR)/$(am__dirstamp) -google/protobuf/no_warning_test-unittest_import_public_lite.pb.$(OBJEXT): \ - google/protobuf/$(am__dirstamp) \ - google/protobuf/$(DEPDIR)/$(am__dirstamp) -google/protobuf/no_warning_test-unittest_lite.pb.$(OBJEXT): \ - google/protobuf/$(am__dirstamp) \ - google/protobuf/$(DEPDIR)/$(am__dirstamp) -google/protobuf/no_warning_test-any_test.pb.$(OBJEXT): \ - google/protobuf/$(am__dirstamp) \ - google/protobuf/$(DEPDIR)/$(am__dirstamp) -google/protobuf/compiler/cpp/no_warning_test-cpp_test_bad_identifiers.pb.$(OBJEXT): \ - google/protobuf/compiler/cpp/$(am__dirstamp) \ - google/protobuf/compiler/cpp/$(DEPDIR)/$(am__dirstamp) -google/protobuf/compiler/cpp/no_warning_test-cpp_test_large_enum_value.pb.$(OBJEXT): \ - google/protobuf/compiler/cpp/$(am__dirstamp) \ - google/protobuf/compiler/cpp/$(DEPDIR)/$(am__dirstamp) -google/protobuf/no_warning_test-map_proto2_unittest.pb.$(OBJEXT): \ - google/protobuf/$(am__dirstamp) \ - google/protobuf/$(DEPDIR)/$(am__dirstamp) -google/protobuf/no_warning_test-map_unittest.pb.$(OBJEXT): \ - google/protobuf/$(am__dirstamp) \ - google/protobuf/$(DEPDIR)/$(am__dirstamp) -google/protobuf/no_warning_test-unittest.pb.$(OBJEXT): \ - google/protobuf/$(am__dirstamp) \ - google/protobuf/$(DEPDIR)/$(am__dirstamp) -google/protobuf/no_warning_test-unittest_arena.pb.$(OBJEXT): \ - google/protobuf/$(am__dirstamp) \ - google/protobuf/$(DEPDIR)/$(am__dirstamp) -google/protobuf/no_warning_test-unittest_custom_options.pb.$(OBJEXT): \ - google/protobuf/$(am__dirstamp) \ - google/protobuf/$(DEPDIR)/$(am__dirstamp) -google/protobuf/no_warning_test-unittest_drop_unknown_fields.pb.$(OBJEXT): \ - google/protobuf/$(am__dirstamp) \ - google/protobuf/$(DEPDIR)/$(am__dirstamp) -google/protobuf/no_warning_test-unittest_embed_optimize_for.pb.$(OBJEXT): \ - google/protobuf/$(am__dirstamp) \ - google/protobuf/$(DEPDIR)/$(am__dirstamp) -google/protobuf/no_warning_test-unittest_empty.pb.$(OBJEXT): \ - google/protobuf/$(am__dirstamp) \ - google/protobuf/$(DEPDIR)/$(am__dirstamp) -google/protobuf/no_warning_test-unittest_enormous_descriptor.pb.$(OBJEXT): \ - google/protobuf/$(am__dirstamp) \ - google/protobuf/$(DEPDIR)/$(am__dirstamp) -google/protobuf/no_warning_test-unittest_import.pb.$(OBJEXT): \ - google/protobuf/$(am__dirstamp) \ - google/protobuf/$(DEPDIR)/$(am__dirstamp) -google/protobuf/no_warning_test-unittest_import_public.pb.$(OBJEXT): \ - google/protobuf/$(am__dirstamp) \ - google/protobuf/$(DEPDIR)/$(am__dirstamp) -google/protobuf/no_warning_test-unittest_lazy_dependencies.pb.$(OBJEXT): \ - google/protobuf/$(am__dirstamp) \ - google/protobuf/$(DEPDIR)/$(am__dirstamp) -google/protobuf/no_warning_test-unittest_lazy_dependencies_custom_option.pb.$(OBJEXT): \ - google/protobuf/$(am__dirstamp) \ - google/protobuf/$(DEPDIR)/$(am__dirstamp) -google/protobuf/no_warning_test-unittest_lazy_dependencies_enum.pb.$(OBJEXT): \ - google/protobuf/$(am__dirstamp) \ - google/protobuf/$(DEPDIR)/$(am__dirstamp) -google/protobuf/no_warning_test-unittest_lite_imports_nonlite.pb.$(OBJEXT): \ - google/protobuf/$(am__dirstamp) \ - google/protobuf/$(DEPDIR)/$(am__dirstamp) -google/protobuf/no_warning_test-unittest_mset.pb.$(OBJEXT): \ - google/protobuf/$(am__dirstamp) \ - google/protobuf/$(DEPDIR)/$(am__dirstamp) -google/protobuf/no_warning_test-unittest_mset_wire_format.pb.$(OBJEXT): \ - google/protobuf/$(am__dirstamp) \ - google/protobuf/$(DEPDIR)/$(am__dirstamp) -google/protobuf/no_warning_test-unittest_no_field_presence.pb.$(OBJEXT): \ - google/protobuf/$(am__dirstamp) \ - google/protobuf/$(DEPDIR)/$(am__dirstamp) -google/protobuf/no_warning_test-unittest_no_generic_services.pb.$(OBJEXT): \ - google/protobuf/$(am__dirstamp) \ - google/protobuf/$(DEPDIR)/$(am__dirstamp) -google/protobuf/no_warning_test-unittest_optimize_for.pb.$(OBJEXT): \ - google/protobuf/$(am__dirstamp) \ - google/protobuf/$(DEPDIR)/$(am__dirstamp) -google/protobuf/no_warning_test-unittest_preserve_unknown_enum.pb.$(OBJEXT): \ - google/protobuf/$(am__dirstamp) \ - google/protobuf/$(DEPDIR)/$(am__dirstamp) -google/protobuf/no_warning_test-unittest_preserve_unknown_enum2.pb.$(OBJEXT): \ - google/protobuf/$(am__dirstamp) \ - google/protobuf/$(DEPDIR)/$(am__dirstamp) -google/protobuf/no_warning_test-unittest_proto3.pb.$(OBJEXT): \ - google/protobuf/$(am__dirstamp) \ - google/protobuf/$(DEPDIR)/$(am__dirstamp) -google/protobuf/no_warning_test-unittest_proto3_arena.pb.$(OBJEXT): \ - google/protobuf/$(am__dirstamp) \ - google/protobuf/$(DEPDIR)/$(am__dirstamp) -google/protobuf/no_warning_test-unittest_proto3_arena_lite.pb.$(OBJEXT): \ - google/protobuf/$(am__dirstamp) \ - google/protobuf/$(DEPDIR)/$(am__dirstamp) -google/protobuf/no_warning_test-unittest_proto3_lite.pb.$(OBJEXT): \ - google/protobuf/$(am__dirstamp) \ - google/protobuf/$(DEPDIR)/$(am__dirstamp) -google/protobuf/no_warning_test-unittest_proto3_optional.pb.$(OBJEXT): \ - google/protobuf/$(am__dirstamp) \ - google/protobuf/$(DEPDIR)/$(am__dirstamp) -google/protobuf/no_warning_test-unittest_well_known_types.pb.$(OBJEXT): \ - google/protobuf/$(am__dirstamp) \ - google/protobuf/$(DEPDIR)/$(am__dirstamp) -google/protobuf/util/internal/testdata/$(am__dirstamp): - @$(MKDIR_P) google/protobuf/util/internal/testdata - @: > google/protobuf/util/internal/testdata/$(am__dirstamp) -google/protobuf/util/internal/testdata/$(DEPDIR)/$(am__dirstamp): - @$(MKDIR_P) google/protobuf/util/internal/testdata/$(DEPDIR) - @: > google/protobuf/util/internal/testdata/$(DEPDIR)/$(am__dirstamp) -google/protobuf/util/internal/testdata/no_warning_test-anys.pb.$(OBJEXT): \ - google/protobuf/util/internal/testdata/$(am__dirstamp) \ - google/protobuf/util/internal/testdata/$(DEPDIR)/$(am__dirstamp) -google/protobuf/util/internal/testdata/no_warning_test-books.pb.$(OBJEXT): \ - google/protobuf/util/internal/testdata/$(am__dirstamp) \ - google/protobuf/util/internal/testdata/$(DEPDIR)/$(am__dirstamp) -google/protobuf/util/internal/testdata/no_warning_test-default_value.pb.$(OBJEXT): \ - google/protobuf/util/internal/testdata/$(am__dirstamp) \ - google/protobuf/util/internal/testdata/$(DEPDIR)/$(am__dirstamp) -google/protobuf/util/internal/testdata/no_warning_test-default_value_test.pb.$(OBJEXT): \ - google/protobuf/util/internal/testdata/$(am__dirstamp) \ - google/protobuf/util/internal/testdata/$(DEPDIR)/$(am__dirstamp) -google/protobuf/util/internal/testdata/no_warning_test-field_mask.pb.$(OBJEXT): \ - google/protobuf/util/internal/testdata/$(am__dirstamp) \ - google/protobuf/util/internal/testdata/$(DEPDIR)/$(am__dirstamp) -google/protobuf/util/internal/testdata/no_warning_test-maps.pb.$(OBJEXT): \ - google/protobuf/util/internal/testdata/$(am__dirstamp) \ - google/protobuf/util/internal/testdata/$(DEPDIR)/$(am__dirstamp) -google/protobuf/util/internal/testdata/no_warning_test-oneofs.pb.$(OBJEXT): \ - google/protobuf/util/internal/testdata/$(am__dirstamp) \ - google/protobuf/util/internal/testdata/$(DEPDIR)/$(am__dirstamp) -google/protobuf/util/internal/testdata/no_warning_test-proto3.pb.$(OBJEXT): \ - google/protobuf/util/internal/testdata/$(am__dirstamp) \ - google/protobuf/util/internal/testdata/$(DEPDIR)/$(am__dirstamp) -google/protobuf/util/internal/testdata/no_warning_test-struct.pb.$(OBJEXT): \ - google/protobuf/util/internal/testdata/$(am__dirstamp) \ - google/protobuf/util/internal/testdata/$(DEPDIR)/$(am__dirstamp) -google/protobuf/util/internal/testdata/no_warning_test-timestamp_duration.pb.$(OBJEXT): \ - google/protobuf/util/internal/testdata/$(am__dirstamp) \ - google/protobuf/util/internal/testdata/$(DEPDIR)/$(am__dirstamp) -google/protobuf/util/internal/testdata/no_warning_test-wrappers.pb.$(OBJEXT): \ - google/protobuf/util/internal/testdata/$(am__dirstamp) \ - google/protobuf/util/internal/testdata/$(DEPDIR)/$(am__dirstamp) -google/protobuf/util/no_warning_test-json_format.pb.$(OBJEXT): \ - google/protobuf/util/$(am__dirstamp) \ - google/protobuf/util/$(DEPDIR)/$(am__dirstamp) -google/protobuf/util/no_warning_test-json_format_proto3.pb.$(OBJEXT): \ - google/protobuf/util/$(am__dirstamp) \ - google/protobuf/util/$(DEPDIR)/$(am__dirstamp) -google/protobuf/util/no_warning_test-message_differencer_unittest.pb.$(OBJEXT): \ - google/protobuf/util/$(am__dirstamp) \ - google/protobuf/util/$(DEPDIR)/$(am__dirstamp) - -no-warning-test$(EXEEXT): $(no_warning_test_OBJECTS) $(no_warning_test_DEPENDENCIES) $(EXTRA_no_warning_test_DEPENDENCIES) - @rm -f no-warning-test$(EXEEXT) - $(AM_V_CXXLD)$(no_warning_test_LINK) $(no_warning_test_OBJECTS) $(no_warning_test_LDADD) $(LIBS) -google/protobuf/compiler/cpp/protobuf_lazy_descriptor_test-cpp_unittest.$(OBJEXT): \ - google/protobuf/compiler/cpp/$(am__dirstamp) \ - google/protobuf/compiler/cpp/$(DEPDIR)/$(am__dirstamp) -google/protobuf/protobuf_lazy_descriptor_test-arena_test_util.$(OBJEXT): \ - google/protobuf/$(am__dirstamp) \ - google/protobuf/$(DEPDIR)/$(am__dirstamp) -google/protobuf/protobuf_lazy_descriptor_test-map_lite_test_util.$(OBJEXT): \ - google/protobuf/$(am__dirstamp) \ - google/protobuf/$(DEPDIR)/$(am__dirstamp) -google/protobuf/protobuf_lazy_descriptor_test-test_util_lite.$(OBJEXT): \ - google/protobuf/$(am__dirstamp) \ - google/protobuf/$(DEPDIR)/$(am__dirstamp) -google/protobuf/protobuf_lazy_descriptor_test-reflection_tester.$(OBJEXT): \ - google/protobuf/$(am__dirstamp) \ - google/protobuf/$(DEPDIR)/$(am__dirstamp) -google/protobuf/protobuf_lazy_descriptor_test-test_util.$(OBJEXT): \ - google/protobuf/$(am__dirstamp) \ - google/protobuf/$(DEPDIR)/$(am__dirstamp) -google/protobuf/testing/$(am__dirstamp): - @$(MKDIR_P) google/protobuf/testing - @: > google/protobuf/testing/$(am__dirstamp) -google/protobuf/testing/$(DEPDIR)/$(am__dirstamp): - @$(MKDIR_P) google/protobuf/testing/$(DEPDIR) - @: > google/protobuf/testing/$(DEPDIR)/$(am__dirstamp) -google/protobuf/testing/protobuf_lazy_descriptor_test-file.$(OBJEXT): \ - google/protobuf/testing/$(am__dirstamp) \ - google/protobuf/testing/$(DEPDIR)/$(am__dirstamp) -google/protobuf/testing/protobuf_lazy_descriptor_test-googletest.$(OBJEXT): \ - google/protobuf/testing/$(am__dirstamp) \ - google/protobuf/testing/$(DEPDIR)/$(am__dirstamp) -google/protobuf/protobuf_lazy_descriptor_test-map_lite_unittest.pb.$(OBJEXT): \ - google/protobuf/$(am__dirstamp) \ - google/protobuf/$(DEPDIR)/$(am__dirstamp) -google/protobuf/protobuf_lazy_descriptor_test-unittest_import_lite.pb.$(OBJEXT): \ - google/protobuf/$(am__dirstamp) \ - google/protobuf/$(DEPDIR)/$(am__dirstamp) -google/protobuf/protobuf_lazy_descriptor_test-unittest_import_public_lite.pb.$(OBJEXT): \ - google/protobuf/$(am__dirstamp) \ - google/protobuf/$(DEPDIR)/$(am__dirstamp) -google/protobuf/protobuf_lazy_descriptor_test-unittest_lite.pb.$(OBJEXT): \ - google/protobuf/$(am__dirstamp) \ - google/protobuf/$(DEPDIR)/$(am__dirstamp) -google/protobuf/protobuf_lazy_descriptor_test-any_test.pb.$(OBJEXT): \ - google/protobuf/$(am__dirstamp) \ - google/protobuf/$(DEPDIR)/$(am__dirstamp) -google/protobuf/compiler/cpp/protobuf_lazy_descriptor_test-cpp_test_bad_identifiers.pb.$(OBJEXT): \ - google/protobuf/compiler/cpp/$(am__dirstamp) \ - google/protobuf/compiler/cpp/$(DEPDIR)/$(am__dirstamp) -google/protobuf/compiler/cpp/protobuf_lazy_descriptor_test-cpp_test_large_enum_value.pb.$(OBJEXT): \ - google/protobuf/compiler/cpp/$(am__dirstamp) \ - google/protobuf/compiler/cpp/$(DEPDIR)/$(am__dirstamp) -google/protobuf/protobuf_lazy_descriptor_test-map_proto2_unittest.pb.$(OBJEXT): \ - google/protobuf/$(am__dirstamp) \ - google/protobuf/$(DEPDIR)/$(am__dirstamp) -google/protobuf/protobuf_lazy_descriptor_test-map_unittest.pb.$(OBJEXT): \ - google/protobuf/$(am__dirstamp) \ - google/protobuf/$(DEPDIR)/$(am__dirstamp) -google/protobuf/protobuf_lazy_descriptor_test-unittest.pb.$(OBJEXT): \ - google/protobuf/$(am__dirstamp) \ - google/protobuf/$(DEPDIR)/$(am__dirstamp) -google/protobuf/protobuf_lazy_descriptor_test-unittest_arena.pb.$(OBJEXT): \ - google/protobuf/$(am__dirstamp) \ - google/protobuf/$(DEPDIR)/$(am__dirstamp) -google/protobuf/protobuf_lazy_descriptor_test-unittest_custom_options.pb.$(OBJEXT): \ - google/protobuf/$(am__dirstamp) \ - google/protobuf/$(DEPDIR)/$(am__dirstamp) -google/protobuf/protobuf_lazy_descriptor_test-unittest_drop_unknown_fields.pb.$(OBJEXT): \ - google/protobuf/$(am__dirstamp) \ - google/protobuf/$(DEPDIR)/$(am__dirstamp) -google/protobuf/protobuf_lazy_descriptor_test-unittest_embed_optimize_for.pb.$(OBJEXT): \ - google/protobuf/$(am__dirstamp) \ - google/protobuf/$(DEPDIR)/$(am__dirstamp) -google/protobuf/protobuf_lazy_descriptor_test-unittest_empty.pb.$(OBJEXT): \ - google/protobuf/$(am__dirstamp) \ - google/protobuf/$(DEPDIR)/$(am__dirstamp) -google/protobuf/protobuf_lazy_descriptor_test-unittest_enormous_descriptor.pb.$(OBJEXT): \ - google/protobuf/$(am__dirstamp) \ - google/protobuf/$(DEPDIR)/$(am__dirstamp) -google/protobuf/protobuf_lazy_descriptor_test-unittest_import.pb.$(OBJEXT): \ - google/protobuf/$(am__dirstamp) \ - google/protobuf/$(DEPDIR)/$(am__dirstamp) -google/protobuf/protobuf_lazy_descriptor_test-unittest_import_public.pb.$(OBJEXT): \ - google/protobuf/$(am__dirstamp) \ - google/protobuf/$(DEPDIR)/$(am__dirstamp) -google/protobuf/protobuf_lazy_descriptor_test-unittest_lazy_dependencies.pb.$(OBJEXT): \ - google/protobuf/$(am__dirstamp) \ - google/protobuf/$(DEPDIR)/$(am__dirstamp) -google/protobuf/protobuf_lazy_descriptor_test-unittest_lazy_dependencies_custom_option.pb.$(OBJEXT): \ - google/protobuf/$(am__dirstamp) \ - google/protobuf/$(DEPDIR)/$(am__dirstamp) -google/protobuf/protobuf_lazy_descriptor_test-unittest_lazy_dependencies_enum.pb.$(OBJEXT): \ - google/protobuf/$(am__dirstamp) \ - google/protobuf/$(DEPDIR)/$(am__dirstamp) -google/protobuf/protobuf_lazy_descriptor_test-unittest_lite_imports_nonlite.pb.$(OBJEXT): \ - google/protobuf/$(am__dirstamp) \ - google/protobuf/$(DEPDIR)/$(am__dirstamp) -google/protobuf/protobuf_lazy_descriptor_test-unittest_mset.pb.$(OBJEXT): \ - google/protobuf/$(am__dirstamp) \ - google/protobuf/$(DEPDIR)/$(am__dirstamp) -google/protobuf/protobuf_lazy_descriptor_test-unittest_mset_wire_format.pb.$(OBJEXT): \ - google/protobuf/$(am__dirstamp) \ - google/protobuf/$(DEPDIR)/$(am__dirstamp) -google/protobuf/protobuf_lazy_descriptor_test-unittest_no_field_presence.pb.$(OBJEXT): \ - google/protobuf/$(am__dirstamp) \ - google/protobuf/$(DEPDIR)/$(am__dirstamp) -google/protobuf/protobuf_lazy_descriptor_test-unittest_no_generic_services.pb.$(OBJEXT): \ - google/protobuf/$(am__dirstamp) \ - google/protobuf/$(DEPDIR)/$(am__dirstamp) -google/protobuf/protobuf_lazy_descriptor_test-unittest_optimize_for.pb.$(OBJEXT): \ - google/protobuf/$(am__dirstamp) \ - google/protobuf/$(DEPDIR)/$(am__dirstamp) -google/protobuf/protobuf_lazy_descriptor_test-unittest_preserve_unknown_enum.pb.$(OBJEXT): \ - google/protobuf/$(am__dirstamp) \ - google/protobuf/$(DEPDIR)/$(am__dirstamp) -google/protobuf/protobuf_lazy_descriptor_test-unittest_preserve_unknown_enum2.pb.$(OBJEXT): \ - google/protobuf/$(am__dirstamp) \ - google/protobuf/$(DEPDIR)/$(am__dirstamp) -google/protobuf/protobuf_lazy_descriptor_test-unittest_proto3.pb.$(OBJEXT): \ - google/protobuf/$(am__dirstamp) \ - google/protobuf/$(DEPDIR)/$(am__dirstamp) -google/protobuf/protobuf_lazy_descriptor_test-unittest_proto3_arena.pb.$(OBJEXT): \ - google/protobuf/$(am__dirstamp) \ - google/protobuf/$(DEPDIR)/$(am__dirstamp) -google/protobuf/protobuf_lazy_descriptor_test-unittest_proto3_arena_lite.pb.$(OBJEXT): \ - google/protobuf/$(am__dirstamp) \ - google/protobuf/$(DEPDIR)/$(am__dirstamp) -google/protobuf/protobuf_lazy_descriptor_test-unittest_proto3_lite.pb.$(OBJEXT): \ - google/protobuf/$(am__dirstamp) \ - google/protobuf/$(DEPDIR)/$(am__dirstamp) -google/protobuf/protobuf_lazy_descriptor_test-unittest_proto3_optional.pb.$(OBJEXT): \ - google/protobuf/$(am__dirstamp) \ - google/protobuf/$(DEPDIR)/$(am__dirstamp) -google/protobuf/protobuf_lazy_descriptor_test-unittest_well_known_types.pb.$(OBJEXT): \ - google/protobuf/$(am__dirstamp) \ - google/protobuf/$(DEPDIR)/$(am__dirstamp) -google/protobuf/util/internal/testdata/protobuf_lazy_descriptor_test-anys.pb.$(OBJEXT): \ - google/protobuf/util/internal/testdata/$(am__dirstamp) \ - google/protobuf/util/internal/testdata/$(DEPDIR)/$(am__dirstamp) -google/protobuf/util/internal/testdata/protobuf_lazy_descriptor_test-books.pb.$(OBJEXT): \ - google/protobuf/util/internal/testdata/$(am__dirstamp) \ - google/protobuf/util/internal/testdata/$(DEPDIR)/$(am__dirstamp) -google/protobuf/util/internal/testdata/protobuf_lazy_descriptor_test-default_value.pb.$(OBJEXT): \ - google/protobuf/util/internal/testdata/$(am__dirstamp) \ - google/protobuf/util/internal/testdata/$(DEPDIR)/$(am__dirstamp) -google/protobuf/util/internal/testdata/protobuf_lazy_descriptor_test-default_value_test.pb.$(OBJEXT): \ - google/protobuf/util/internal/testdata/$(am__dirstamp) \ - google/protobuf/util/internal/testdata/$(DEPDIR)/$(am__dirstamp) -google/protobuf/util/internal/testdata/protobuf_lazy_descriptor_test-field_mask.pb.$(OBJEXT): \ - google/protobuf/util/internal/testdata/$(am__dirstamp) \ - google/protobuf/util/internal/testdata/$(DEPDIR)/$(am__dirstamp) -google/protobuf/util/internal/testdata/protobuf_lazy_descriptor_test-maps.pb.$(OBJEXT): \ - google/protobuf/util/internal/testdata/$(am__dirstamp) \ - google/protobuf/util/internal/testdata/$(DEPDIR)/$(am__dirstamp) -google/protobuf/util/internal/testdata/protobuf_lazy_descriptor_test-oneofs.pb.$(OBJEXT): \ - google/protobuf/util/internal/testdata/$(am__dirstamp) \ - google/protobuf/util/internal/testdata/$(DEPDIR)/$(am__dirstamp) -google/protobuf/util/internal/testdata/protobuf_lazy_descriptor_test-proto3.pb.$(OBJEXT): \ - google/protobuf/util/internal/testdata/$(am__dirstamp) \ - google/protobuf/util/internal/testdata/$(DEPDIR)/$(am__dirstamp) -google/protobuf/util/internal/testdata/protobuf_lazy_descriptor_test-struct.pb.$(OBJEXT): \ - google/protobuf/util/internal/testdata/$(am__dirstamp) \ - google/protobuf/util/internal/testdata/$(DEPDIR)/$(am__dirstamp) -google/protobuf/util/internal/testdata/protobuf_lazy_descriptor_test-timestamp_duration.pb.$(OBJEXT): \ - google/protobuf/util/internal/testdata/$(am__dirstamp) \ - google/protobuf/util/internal/testdata/$(DEPDIR)/$(am__dirstamp) -google/protobuf/util/internal/testdata/protobuf_lazy_descriptor_test-wrappers.pb.$(OBJEXT): \ - google/protobuf/util/internal/testdata/$(am__dirstamp) \ - google/protobuf/util/internal/testdata/$(DEPDIR)/$(am__dirstamp) -google/protobuf/util/protobuf_lazy_descriptor_test-json_format.pb.$(OBJEXT): \ - google/protobuf/util/$(am__dirstamp) \ - google/protobuf/util/$(DEPDIR)/$(am__dirstamp) -google/protobuf/util/protobuf_lazy_descriptor_test-json_format_proto3.pb.$(OBJEXT): \ - google/protobuf/util/$(am__dirstamp) \ - google/protobuf/util/$(DEPDIR)/$(am__dirstamp) -google/protobuf/util/protobuf_lazy_descriptor_test-message_differencer_unittest.pb.$(OBJEXT): \ - google/protobuf/util/$(am__dirstamp) \ - google/protobuf/util/$(DEPDIR)/$(am__dirstamp) - -protobuf-lazy-descriptor-test$(EXEEXT): $(protobuf_lazy_descriptor_test_OBJECTS) $(protobuf_lazy_descriptor_test_DEPENDENCIES) $(EXTRA_protobuf_lazy_descriptor_test_DEPENDENCIES) - @rm -f protobuf-lazy-descriptor-test$(EXEEXT) - $(AM_V_CXXLD)$(protobuf_lazy_descriptor_test_LINK) $(protobuf_lazy_descriptor_test_OBJECTS) $(protobuf_lazy_descriptor_test_LDADD) $(LIBS) -google/protobuf/protobuf_lite_arena_test-lite_arena_unittest.$(OBJEXT): \ - google/protobuf/$(am__dirstamp) \ - google/protobuf/$(DEPDIR)/$(am__dirstamp) -google/protobuf/protobuf_lite_arena_test-arena_test_util.$(OBJEXT): \ - google/protobuf/$(am__dirstamp) \ - google/protobuf/$(DEPDIR)/$(am__dirstamp) -google/protobuf/protobuf_lite_arena_test-map_lite_test_util.$(OBJEXT): \ - google/protobuf/$(am__dirstamp) \ - google/protobuf/$(DEPDIR)/$(am__dirstamp) -google/protobuf/protobuf_lite_arena_test-test_util_lite.$(OBJEXT): \ - google/protobuf/$(am__dirstamp) \ - google/protobuf/$(DEPDIR)/$(am__dirstamp) -google/protobuf/protobuf_lite_arena_test-map_lite_unittest.pb.$(OBJEXT): \ - google/protobuf/$(am__dirstamp) \ - google/protobuf/$(DEPDIR)/$(am__dirstamp) -google/protobuf/protobuf_lite_arena_test-unittest_import_lite.pb.$(OBJEXT): \ - google/protobuf/$(am__dirstamp) \ - google/protobuf/$(DEPDIR)/$(am__dirstamp) -google/protobuf/protobuf_lite_arena_test-unittest_import_public_lite.pb.$(OBJEXT): \ - google/protobuf/$(am__dirstamp) \ - google/protobuf/$(DEPDIR)/$(am__dirstamp) -google/protobuf/protobuf_lite_arena_test-unittest_lite.pb.$(OBJEXT): \ - google/protobuf/$(am__dirstamp) \ - google/protobuf/$(DEPDIR)/$(am__dirstamp) - -protobuf-lite-arena-test$(EXEEXT): $(protobuf_lite_arena_test_OBJECTS) $(protobuf_lite_arena_test_DEPENDENCIES) $(EXTRA_protobuf_lite_arena_test_DEPENDENCIES) - @rm -f protobuf-lite-arena-test$(EXEEXT) - $(AM_V_CXXLD)$(protobuf_lite_arena_test_LINK) $(protobuf_lite_arena_test_OBJECTS) $(protobuf_lite_arena_test_LDADD) $(LIBS) -google/protobuf/protobuf_lite_test-lite_unittest.$(OBJEXT): \ - google/protobuf/$(am__dirstamp) \ - google/protobuf/$(DEPDIR)/$(am__dirstamp) -google/protobuf/protobuf_lite_test-arena_test_util.$(OBJEXT): \ - google/protobuf/$(am__dirstamp) \ - google/protobuf/$(DEPDIR)/$(am__dirstamp) -google/protobuf/protobuf_lite_test-map_lite_test_util.$(OBJEXT): \ - google/protobuf/$(am__dirstamp) \ - google/protobuf/$(DEPDIR)/$(am__dirstamp) -google/protobuf/protobuf_lite_test-test_util_lite.$(OBJEXT): \ - google/protobuf/$(am__dirstamp) \ - google/protobuf/$(DEPDIR)/$(am__dirstamp) -google/protobuf/protobuf_lite_test-map_lite_unittest.pb.$(OBJEXT): \ - google/protobuf/$(am__dirstamp) \ - google/protobuf/$(DEPDIR)/$(am__dirstamp) -google/protobuf/protobuf_lite_test-unittest_import_lite.pb.$(OBJEXT): \ - google/protobuf/$(am__dirstamp) \ - google/protobuf/$(DEPDIR)/$(am__dirstamp) -google/protobuf/protobuf_lite_test-unittest_import_public_lite.pb.$(OBJEXT): \ - google/protobuf/$(am__dirstamp) \ - google/protobuf/$(DEPDIR)/$(am__dirstamp) -google/protobuf/protobuf_lite_test-unittest_lite.pb.$(OBJEXT): \ - google/protobuf/$(am__dirstamp) \ - google/protobuf/$(DEPDIR)/$(am__dirstamp) - -protobuf-lite-test$(EXEEXT): $(protobuf_lite_test_OBJECTS) $(protobuf_lite_test_DEPENDENCIES) $(EXTRA_protobuf_lite_test_DEPENDENCIES) - @rm -f protobuf-lite-test$(EXEEXT) - $(AM_V_CXXLD)$(protobuf_lite_test_LINK) $(protobuf_lite_test_OBJECTS) $(protobuf_lite_test_LDADD) $(LIBS) -google/protobuf/protobuf_test-arena_test_util.$(OBJEXT): \ - google/protobuf/$(am__dirstamp) \ - google/protobuf/$(DEPDIR)/$(am__dirstamp) -google/protobuf/protobuf_test-map_lite_test_util.$(OBJEXT): \ - google/protobuf/$(am__dirstamp) \ - google/protobuf/$(DEPDIR)/$(am__dirstamp) -google/protobuf/protobuf_test-test_util_lite.$(OBJEXT): \ - google/protobuf/$(am__dirstamp) \ - google/protobuf/$(DEPDIR)/$(am__dirstamp) -google/protobuf/protobuf_test-reflection_tester.$(OBJEXT): \ - google/protobuf/$(am__dirstamp) \ - google/protobuf/$(DEPDIR)/$(am__dirstamp) -google/protobuf/protobuf_test-test_util.$(OBJEXT): \ - google/protobuf/$(am__dirstamp) \ - google/protobuf/$(DEPDIR)/$(am__dirstamp) -google/protobuf/testing/protobuf_test-file.$(OBJEXT): \ - google/protobuf/testing/$(am__dirstamp) \ - google/protobuf/testing/$(DEPDIR)/$(am__dirstamp) -google/protobuf/testing/protobuf_test-googletest.$(OBJEXT): \ - google/protobuf/testing/$(am__dirstamp) \ - google/protobuf/testing/$(DEPDIR)/$(am__dirstamp) -google/protobuf/protobuf_test-any_test.$(OBJEXT): \ - google/protobuf/$(am__dirstamp) \ - google/protobuf/$(DEPDIR)/$(am__dirstamp) -google/protobuf/protobuf_test-arena_unittest.$(OBJEXT): \ - google/protobuf/$(am__dirstamp) \ - google/protobuf/$(DEPDIR)/$(am__dirstamp) -google/protobuf/protobuf_test-arenastring_unittest.$(OBJEXT): \ - google/protobuf/$(am__dirstamp) \ - google/protobuf/$(DEPDIR)/$(am__dirstamp) -google/protobuf/compiler/protobuf_test-annotation_test_util.$(OBJEXT): \ - google/protobuf/compiler/$(am__dirstamp) \ - google/protobuf/compiler/$(DEPDIR)/$(am__dirstamp) -google/protobuf/compiler/protobuf_test-command_line_interface_unittest.$(OBJEXT): \ - google/protobuf/compiler/$(am__dirstamp) \ - google/protobuf/compiler/$(DEPDIR)/$(am__dirstamp) -google/protobuf/compiler/cpp/protobuf_test-cpp_bootstrap_unittest.$(OBJEXT): \ - google/protobuf/compiler/cpp/$(am__dirstamp) \ - google/protobuf/compiler/cpp/$(DEPDIR)/$(am__dirstamp) -google/protobuf/compiler/cpp/protobuf_test-cpp_move_unittest.$(OBJEXT): \ - google/protobuf/compiler/cpp/$(am__dirstamp) \ - google/protobuf/compiler/cpp/$(DEPDIR)/$(am__dirstamp) -google/protobuf/compiler/cpp/protobuf_test-cpp_plugin_unittest.$(OBJEXT): \ - google/protobuf/compiler/cpp/$(am__dirstamp) \ - google/protobuf/compiler/cpp/$(DEPDIR)/$(am__dirstamp) -google/protobuf/compiler/cpp/protobuf_test-cpp_unittest.$(OBJEXT): \ - google/protobuf/compiler/cpp/$(am__dirstamp) \ - google/protobuf/compiler/cpp/$(DEPDIR)/$(am__dirstamp) -google/protobuf/compiler/cpp/protobuf_test-metadata_test.$(OBJEXT): \ - google/protobuf/compiler/cpp/$(am__dirstamp) \ - google/protobuf/compiler/cpp/$(DEPDIR)/$(am__dirstamp) -google/protobuf/compiler/csharp/protobuf_test-csharp_bootstrap_unittest.$(OBJEXT): \ - google/protobuf/compiler/csharp/$(am__dirstamp) \ - google/protobuf/compiler/csharp/$(DEPDIR)/$(am__dirstamp) -google/protobuf/compiler/csharp/protobuf_test-csharp_generator_unittest.$(OBJEXT): \ - google/protobuf/compiler/csharp/$(am__dirstamp) \ - google/protobuf/compiler/csharp/$(DEPDIR)/$(am__dirstamp) -google/protobuf/compiler/protobuf_test-importer_unittest.$(OBJEXT): \ - google/protobuf/compiler/$(am__dirstamp) \ - google/protobuf/compiler/$(DEPDIR)/$(am__dirstamp) -google/protobuf/compiler/java/protobuf_test-java_doc_comment_unittest.$(OBJEXT): \ - google/protobuf/compiler/java/$(am__dirstamp) \ - google/protobuf/compiler/java/$(DEPDIR)/$(am__dirstamp) -google/protobuf/compiler/java/protobuf_test-java_plugin_unittest.$(OBJEXT): \ - google/protobuf/compiler/java/$(am__dirstamp) \ - google/protobuf/compiler/java/$(DEPDIR)/$(am__dirstamp) -google/protobuf/compiler/protobuf_test-mock_code_generator.$(OBJEXT): \ - google/protobuf/compiler/$(am__dirstamp) \ - google/protobuf/compiler/$(DEPDIR)/$(am__dirstamp) -google/protobuf/compiler/objectivec/protobuf_test-objectivec_helpers_unittest.$(OBJEXT): \ - google/protobuf/compiler/objectivec/$(am__dirstamp) \ - google/protobuf/compiler/objectivec/$(DEPDIR)/$(am__dirstamp) -google/protobuf/compiler/protobuf_test-parser_unittest.$(OBJEXT): \ - google/protobuf/compiler/$(am__dirstamp) \ - google/protobuf/compiler/$(DEPDIR)/$(am__dirstamp) -google/protobuf/compiler/python/protobuf_test-python_plugin_unittest.$(OBJEXT): \ - google/protobuf/compiler/python/$(am__dirstamp) \ - google/protobuf/compiler/python/$(DEPDIR)/$(am__dirstamp) -google/protobuf/compiler/ruby/protobuf_test-ruby_generator_unittest.$(OBJEXT): \ - google/protobuf/compiler/ruby/$(am__dirstamp) \ - google/protobuf/compiler/ruby/$(DEPDIR)/$(am__dirstamp) -google/protobuf/protobuf_test-descriptor_database_unittest.$(OBJEXT): \ - google/protobuf/$(am__dirstamp) \ - google/protobuf/$(DEPDIR)/$(am__dirstamp) -google/protobuf/protobuf_test-descriptor_unittest.$(OBJEXT): \ - google/protobuf/$(am__dirstamp) \ - google/protobuf/$(DEPDIR)/$(am__dirstamp) -google/protobuf/protobuf_test-drop_unknown_fields_test.$(OBJEXT): \ - google/protobuf/$(am__dirstamp) \ - google/protobuf/$(DEPDIR)/$(am__dirstamp) -google/protobuf/protobuf_test-dynamic_message_unittest.$(OBJEXT): \ - google/protobuf/$(am__dirstamp) \ - google/protobuf/$(DEPDIR)/$(am__dirstamp) -google/protobuf/protobuf_test-extension_set_unittest.$(OBJEXT): \ - google/protobuf/$(am__dirstamp) \ - google/protobuf/$(DEPDIR)/$(am__dirstamp) -google/protobuf/protobuf_test-generated_message_reflection_unittest.$(OBJEXT): \ - google/protobuf/$(am__dirstamp) \ - google/protobuf/$(DEPDIR)/$(am__dirstamp) -google/protobuf/protobuf_test-inlined_string_field_unittest.$(OBJEXT): \ - google/protobuf/$(am__dirstamp) \ - google/protobuf/$(DEPDIR)/$(am__dirstamp) -google/protobuf/io/protobuf_test-coded_stream_unittest.$(OBJEXT): \ - google/protobuf/io/$(am__dirstamp) \ - google/protobuf/io/$(DEPDIR)/$(am__dirstamp) -google/protobuf/io/protobuf_test-io_win32_unittest.$(OBJEXT): \ - google/protobuf/io/$(am__dirstamp) \ - google/protobuf/io/$(DEPDIR)/$(am__dirstamp) -google/protobuf/io/protobuf_test-printer_unittest.$(OBJEXT): \ - google/protobuf/io/$(am__dirstamp) \ - google/protobuf/io/$(DEPDIR)/$(am__dirstamp) -google/protobuf/io/protobuf_test-tokenizer_unittest.$(OBJEXT): \ - google/protobuf/io/$(am__dirstamp) \ - google/protobuf/io/$(DEPDIR)/$(am__dirstamp) -google/protobuf/io/protobuf_test-zero_copy_stream_unittest.$(OBJEXT): \ - google/protobuf/io/$(am__dirstamp) \ - google/protobuf/io/$(DEPDIR)/$(am__dirstamp) -google/protobuf/protobuf_test-map_field_test.$(OBJEXT): \ - google/protobuf/$(am__dirstamp) \ - google/protobuf/$(DEPDIR)/$(am__dirstamp) -google/protobuf/protobuf_test-map_test.$(OBJEXT): \ - google/protobuf/$(am__dirstamp) \ - google/protobuf/$(DEPDIR)/$(am__dirstamp) -google/protobuf/protobuf_test-message_unittest.$(OBJEXT): \ - google/protobuf/$(am__dirstamp) \ - google/protobuf/$(DEPDIR)/$(am__dirstamp) -google/protobuf/protobuf_test-no_field_presence_test.$(OBJEXT): \ - google/protobuf/$(am__dirstamp) \ - google/protobuf/$(DEPDIR)/$(am__dirstamp) -google/protobuf/protobuf_test-preserve_unknown_enum_test.$(OBJEXT): \ - google/protobuf/$(am__dirstamp) \ - google/protobuf/$(DEPDIR)/$(am__dirstamp) -google/protobuf/protobuf_test-proto3_arena_lite_unittest.$(OBJEXT): \ - google/protobuf/$(am__dirstamp) \ - google/protobuf/$(DEPDIR)/$(am__dirstamp) -google/protobuf/protobuf_test-proto3_arena_unittest.$(OBJEXT): \ - google/protobuf/$(am__dirstamp) \ - google/protobuf/$(DEPDIR)/$(am__dirstamp) -google/protobuf/protobuf_test-proto3_lite_unittest.$(OBJEXT): \ - google/protobuf/$(am__dirstamp) \ - google/protobuf/$(DEPDIR)/$(am__dirstamp) -google/protobuf/protobuf_test-reflection_ops_unittest.$(OBJEXT): \ - google/protobuf/$(am__dirstamp) \ - google/protobuf/$(DEPDIR)/$(am__dirstamp) -google/protobuf/protobuf_test-repeated_field_reflection_unittest.$(OBJEXT): \ - google/protobuf/$(am__dirstamp) \ - google/protobuf/$(DEPDIR)/$(am__dirstamp) -google/protobuf/protobuf_test-repeated_field_unittest.$(OBJEXT): \ - google/protobuf/$(am__dirstamp) \ - google/protobuf/$(DEPDIR)/$(am__dirstamp) -google/protobuf/stubs/protobuf_test-bytestream_unittest.$(OBJEXT): \ - google/protobuf/stubs/$(am__dirstamp) \ - google/protobuf/stubs/$(DEPDIR)/$(am__dirstamp) -google/protobuf/stubs/protobuf_test-common_unittest.$(OBJEXT): \ - google/protobuf/stubs/$(am__dirstamp) \ - google/protobuf/stubs/$(DEPDIR)/$(am__dirstamp) -google/protobuf/stubs/protobuf_test-int128_unittest.$(OBJEXT): \ - google/protobuf/stubs/$(am__dirstamp) \ - google/protobuf/stubs/$(DEPDIR)/$(am__dirstamp) -google/protobuf/stubs/protobuf_test-status_test.$(OBJEXT): \ - google/protobuf/stubs/$(am__dirstamp) \ - google/protobuf/stubs/$(DEPDIR)/$(am__dirstamp) -google/protobuf/stubs/protobuf_test-statusor_test.$(OBJEXT): \ - google/protobuf/stubs/$(am__dirstamp) \ - google/protobuf/stubs/$(DEPDIR)/$(am__dirstamp) -google/protobuf/stubs/protobuf_test-stringpiece_unittest.$(OBJEXT): \ - google/protobuf/stubs/$(am__dirstamp) \ - google/protobuf/stubs/$(DEPDIR)/$(am__dirstamp) -google/protobuf/stubs/protobuf_test-stringprintf_unittest.$(OBJEXT): \ - google/protobuf/stubs/$(am__dirstamp) \ - google/protobuf/stubs/$(DEPDIR)/$(am__dirstamp) -google/protobuf/stubs/protobuf_test-structurally_valid_unittest.$(OBJEXT): \ - google/protobuf/stubs/$(am__dirstamp) \ - google/protobuf/stubs/$(DEPDIR)/$(am__dirstamp) -google/protobuf/stubs/protobuf_test-strutil_unittest.$(OBJEXT): \ - google/protobuf/stubs/$(am__dirstamp) \ - google/protobuf/stubs/$(DEPDIR)/$(am__dirstamp) -google/protobuf/stubs/protobuf_test-template_util_unittest.$(OBJEXT): \ - google/protobuf/stubs/$(am__dirstamp) \ - google/protobuf/stubs/$(DEPDIR)/$(am__dirstamp) -google/protobuf/stubs/protobuf_test-time_test.$(OBJEXT): \ - google/protobuf/stubs/$(am__dirstamp) \ - google/protobuf/stubs/$(DEPDIR)/$(am__dirstamp) -google/protobuf/protobuf_test-text_format_unittest.$(OBJEXT): \ - google/protobuf/$(am__dirstamp) \ - google/protobuf/$(DEPDIR)/$(am__dirstamp) -google/protobuf/protobuf_test-unknown_field_set_unittest.$(OBJEXT): \ - google/protobuf/$(am__dirstamp) \ - google/protobuf/$(DEPDIR)/$(am__dirstamp) -google/protobuf/util/protobuf_test-delimited_message_util_test.$(OBJEXT): \ - google/protobuf/util/$(am__dirstamp) \ - google/protobuf/util/$(DEPDIR)/$(am__dirstamp) -google/protobuf/util/protobuf_test-field_comparator_test.$(OBJEXT): \ - google/protobuf/util/$(am__dirstamp) \ - google/protobuf/util/$(DEPDIR)/$(am__dirstamp) -google/protobuf/util/protobuf_test-field_mask_util_test.$(OBJEXT): \ - google/protobuf/util/$(am__dirstamp) \ - google/protobuf/util/$(DEPDIR)/$(am__dirstamp) -google/protobuf/util/internal/protobuf_test-default_value_objectwriter_test.$(OBJEXT): \ - google/protobuf/util/internal/$(am__dirstamp) \ - google/protobuf/util/internal/$(DEPDIR)/$(am__dirstamp) -google/protobuf/util/internal/protobuf_test-json_objectwriter_test.$(OBJEXT): \ - google/protobuf/util/internal/$(am__dirstamp) \ - google/protobuf/util/internal/$(DEPDIR)/$(am__dirstamp) -google/protobuf/util/internal/protobuf_test-json_stream_parser_test.$(OBJEXT): \ - google/protobuf/util/internal/$(am__dirstamp) \ - google/protobuf/util/internal/$(DEPDIR)/$(am__dirstamp) -google/protobuf/util/internal/protobuf_test-protostream_objectsource_test.$(OBJEXT): \ - google/protobuf/util/internal/$(am__dirstamp) \ - google/protobuf/util/internal/$(DEPDIR)/$(am__dirstamp) -google/protobuf/util/internal/protobuf_test-protostream_objectwriter_test.$(OBJEXT): \ - google/protobuf/util/internal/$(am__dirstamp) \ - google/protobuf/util/internal/$(DEPDIR)/$(am__dirstamp) -google/protobuf/util/internal/protobuf_test-type_info_test_helper.$(OBJEXT): \ - google/protobuf/util/internal/$(am__dirstamp) \ - google/protobuf/util/internal/$(DEPDIR)/$(am__dirstamp) -google/protobuf/util/protobuf_test-json_util_test.$(OBJEXT): \ - google/protobuf/util/$(am__dirstamp) \ - google/protobuf/util/$(DEPDIR)/$(am__dirstamp) -google/protobuf/util/protobuf_test-message_differencer_unittest.$(OBJEXT): \ - google/protobuf/util/$(am__dirstamp) \ - google/protobuf/util/$(DEPDIR)/$(am__dirstamp) -google/protobuf/util/protobuf_test-time_util_test.$(OBJEXT): \ - google/protobuf/util/$(am__dirstamp) \ - google/protobuf/util/$(DEPDIR)/$(am__dirstamp) -google/protobuf/util/protobuf_test-type_resolver_util_test.$(OBJEXT): \ - google/protobuf/util/$(am__dirstamp) \ - google/protobuf/util/$(DEPDIR)/$(am__dirstamp) -google/protobuf/protobuf_test-well_known_types_unittest.$(OBJEXT): \ - google/protobuf/$(am__dirstamp) \ - google/protobuf/$(DEPDIR)/$(am__dirstamp) -google/protobuf/protobuf_test-wire_format_unittest.$(OBJEXT): \ - google/protobuf/$(am__dirstamp) \ - google/protobuf/$(DEPDIR)/$(am__dirstamp) -google/protobuf/protobuf_test-map_lite_unittest.pb.$(OBJEXT): \ - google/protobuf/$(am__dirstamp) \ - google/protobuf/$(DEPDIR)/$(am__dirstamp) -google/protobuf/protobuf_test-unittest_import_lite.pb.$(OBJEXT): \ - google/protobuf/$(am__dirstamp) \ - google/protobuf/$(DEPDIR)/$(am__dirstamp) -google/protobuf/protobuf_test-unittest_import_public_lite.pb.$(OBJEXT): \ - google/protobuf/$(am__dirstamp) \ - google/protobuf/$(DEPDIR)/$(am__dirstamp) -google/protobuf/protobuf_test-unittest_lite.pb.$(OBJEXT): \ - google/protobuf/$(am__dirstamp) \ - google/protobuf/$(DEPDIR)/$(am__dirstamp) -google/protobuf/protobuf_test-any_test.pb.$(OBJEXT): \ - google/protobuf/$(am__dirstamp) \ - google/protobuf/$(DEPDIR)/$(am__dirstamp) -google/protobuf/compiler/cpp/protobuf_test-cpp_test_bad_identifiers.pb.$(OBJEXT): \ - google/protobuf/compiler/cpp/$(am__dirstamp) \ - google/protobuf/compiler/cpp/$(DEPDIR)/$(am__dirstamp) -google/protobuf/compiler/cpp/protobuf_test-cpp_test_large_enum_value.pb.$(OBJEXT): \ - google/protobuf/compiler/cpp/$(am__dirstamp) \ - google/protobuf/compiler/cpp/$(DEPDIR)/$(am__dirstamp) -google/protobuf/protobuf_test-map_proto2_unittest.pb.$(OBJEXT): \ - google/protobuf/$(am__dirstamp) \ - google/protobuf/$(DEPDIR)/$(am__dirstamp) -google/protobuf/protobuf_test-map_unittest.pb.$(OBJEXT): \ - google/protobuf/$(am__dirstamp) \ - google/protobuf/$(DEPDIR)/$(am__dirstamp) -google/protobuf/protobuf_test-unittest.pb.$(OBJEXT): \ - google/protobuf/$(am__dirstamp) \ - google/protobuf/$(DEPDIR)/$(am__dirstamp) -google/protobuf/protobuf_test-unittest_arena.pb.$(OBJEXT): \ - google/protobuf/$(am__dirstamp) \ - google/protobuf/$(DEPDIR)/$(am__dirstamp) -google/protobuf/protobuf_test-unittest_custom_options.pb.$(OBJEXT): \ - google/protobuf/$(am__dirstamp) \ - google/protobuf/$(DEPDIR)/$(am__dirstamp) -google/protobuf/protobuf_test-unittest_drop_unknown_fields.pb.$(OBJEXT): \ - google/protobuf/$(am__dirstamp) \ - google/protobuf/$(DEPDIR)/$(am__dirstamp) -google/protobuf/protobuf_test-unittest_embed_optimize_for.pb.$(OBJEXT): \ - google/protobuf/$(am__dirstamp) \ - google/protobuf/$(DEPDIR)/$(am__dirstamp) -google/protobuf/protobuf_test-unittest_empty.pb.$(OBJEXT): \ - google/protobuf/$(am__dirstamp) \ - google/protobuf/$(DEPDIR)/$(am__dirstamp) -google/protobuf/protobuf_test-unittest_enormous_descriptor.pb.$(OBJEXT): \ - google/protobuf/$(am__dirstamp) \ - google/protobuf/$(DEPDIR)/$(am__dirstamp) -google/protobuf/protobuf_test-unittest_import.pb.$(OBJEXT): \ - google/protobuf/$(am__dirstamp) \ - google/protobuf/$(DEPDIR)/$(am__dirstamp) -google/protobuf/protobuf_test-unittest_import_public.pb.$(OBJEXT): \ - google/protobuf/$(am__dirstamp) \ - google/protobuf/$(DEPDIR)/$(am__dirstamp) -google/protobuf/protobuf_test-unittest_lazy_dependencies.pb.$(OBJEXT): \ - google/protobuf/$(am__dirstamp) \ - google/protobuf/$(DEPDIR)/$(am__dirstamp) -google/protobuf/protobuf_test-unittest_lazy_dependencies_custom_option.pb.$(OBJEXT): \ - google/protobuf/$(am__dirstamp) \ - google/protobuf/$(DEPDIR)/$(am__dirstamp) -google/protobuf/protobuf_test-unittest_lazy_dependencies_enum.pb.$(OBJEXT): \ - google/protobuf/$(am__dirstamp) \ - google/protobuf/$(DEPDIR)/$(am__dirstamp) -google/protobuf/protobuf_test-unittest_lite_imports_nonlite.pb.$(OBJEXT): \ - google/protobuf/$(am__dirstamp) \ - google/protobuf/$(DEPDIR)/$(am__dirstamp) -google/protobuf/protobuf_test-unittest_mset.pb.$(OBJEXT): \ - google/protobuf/$(am__dirstamp) \ - google/protobuf/$(DEPDIR)/$(am__dirstamp) -google/protobuf/protobuf_test-unittest_mset_wire_format.pb.$(OBJEXT): \ - google/protobuf/$(am__dirstamp) \ - google/protobuf/$(DEPDIR)/$(am__dirstamp) -google/protobuf/protobuf_test-unittest_no_field_presence.pb.$(OBJEXT): \ - google/protobuf/$(am__dirstamp) \ - google/protobuf/$(DEPDIR)/$(am__dirstamp) -google/protobuf/protobuf_test-unittest_no_generic_services.pb.$(OBJEXT): \ - google/protobuf/$(am__dirstamp) \ - google/protobuf/$(DEPDIR)/$(am__dirstamp) -google/protobuf/protobuf_test-unittest_optimize_for.pb.$(OBJEXT): \ - google/protobuf/$(am__dirstamp) \ - google/protobuf/$(DEPDIR)/$(am__dirstamp) -google/protobuf/protobuf_test-unittest_preserve_unknown_enum.pb.$(OBJEXT): \ - google/protobuf/$(am__dirstamp) \ - google/protobuf/$(DEPDIR)/$(am__dirstamp) -google/protobuf/protobuf_test-unittest_preserve_unknown_enum2.pb.$(OBJEXT): \ - google/protobuf/$(am__dirstamp) \ - google/protobuf/$(DEPDIR)/$(am__dirstamp) -google/protobuf/protobuf_test-unittest_proto3.pb.$(OBJEXT): \ - google/protobuf/$(am__dirstamp) \ - google/protobuf/$(DEPDIR)/$(am__dirstamp) -google/protobuf/protobuf_test-unittest_proto3_arena.pb.$(OBJEXT): \ - google/protobuf/$(am__dirstamp) \ - google/protobuf/$(DEPDIR)/$(am__dirstamp) -google/protobuf/protobuf_test-unittest_proto3_arena_lite.pb.$(OBJEXT): \ - google/protobuf/$(am__dirstamp) \ - google/protobuf/$(DEPDIR)/$(am__dirstamp) -google/protobuf/protobuf_test-unittest_proto3_lite.pb.$(OBJEXT): \ - google/protobuf/$(am__dirstamp) \ - google/protobuf/$(DEPDIR)/$(am__dirstamp) -google/protobuf/protobuf_test-unittest_proto3_optional.pb.$(OBJEXT): \ - google/protobuf/$(am__dirstamp) \ - google/protobuf/$(DEPDIR)/$(am__dirstamp) -google/protobuf/protobuf_test-unittest_well_known_types.pb.$(OBJEXT): \ - google/protobuf/$(am__dirstamp) \ - google/protobuf/$(DEPDIR)/$(am__dirstamp) -google/protobuf/util/internal/testdata/protobuf_test-anys.pb.$(OBJEXT): \ - google/protobuf/util/internal/testdata/$(am__dirstamp) \ - google/protobuf/util/internal/testdata/$(DEPDIR)/$(am__dirstamp) -google/protobuf/util/internal/testdata/protobuf_test-books.pb.$(OBJEXT): \ - google/protobuf/util/internal/testdata/$(am__dirstamp) \ - google/protobuf/util/internal/testdata/$(DEPDIR)/$(am__dirstamp) -google/protobuf/util/internal/testdata/protobuf_test-default_value.pb.$(OBJEXT): \ - google/protobuf/util/internal/testdata/$(am__dirstamp) \ - google/protobuf/util/internal/testdata/$(DEPDIR)/$(am__dirstamp) -google/protobuf/util/internal/testdata/protobuf_test-default_value_test.pb.$(OBJEXT): \ - google/protobuf/util/internal/testdata/$(am__dirstamp) \ - google/protobuf/util/internal/testdata/$(DEPDIR)/$(am__dirstamp) -google/protobuf/util/internal/testdata/protobuf_test-field_mask.pb.$(OBJEXT): \ - google/protobuf/util/internal/testdata/$(am__dirstamp) \ - google/protobuf/util/internal/testdata/$(DEPDIR)/$(am__dirstamp) -google/protobuf/util/internal/testdata/protobuf_test-maps.pb.$(OBJEXT): \ - google/protobuf/util/internal/testdata/$(am__dirstamp) \ - google/protobuf/util/internal/testdata/$(DEPDIR)/$(am__dirstamp) -google/protobuf/util/internal/testdata/protobuf_test-oneofs.pb.$(OBJEXT): \ - google/protobuf/util/internal/testdata/$(am__dirstamp) \ - google/protobuf/util/internal/testdata/$(DEPDIR)/$(am__dirstamp) -google/protobuf/util/internal/testdata/protobuf_test-proto3.pb.$(OBJEXT): \ - google/protobuf/util/internal/testdata/$(am__dirstamp) \ - google/protobuf/util/internal/testdata/$(DEPDIR)/$(am__dirstamp) -google/protobuf/util/internal/testdata/protobuf_test-struct.pb.$(OBJEXT): \ - google/protobuf/util/internal/testdata/$(am__dirstamp) \ - google/protobuf/util/internal/testdata/$(DEPDIR)/$(am__dirstamp) -google/protobuf/util/internal/testdata/protobuf_test-timestamp_duration.pb.$(OBJEXT): \ - google/protobuf/util/internal/testdata/$(am__dirstamp) \ - google/protobuf/util/internal/testdata/$(DEPDIR)/$(am__dirstamp) -google/protobuf/util/internal/testdata/protobuf_test-wrappers.pb.$(OBJEXT): \ - google/protobuf/util/internal/testdata/$(am__dirstamp) \ - google/protobuf/util/internal/testdata/$(DEPDIR)/$(am__dirstamp) -google/protobuf/util/protobuf_test-json_format.pb.$(OBJEXT): \ - google/protobuf/util/$(am__dirstamp) \ - google/protobuf/util/$(DEPDIR)/$(am__dirstamp) -google/protobuf/util/protobuf_test-json_format_proto3.pb.$(OBJEXT): \ - google/protobuf/util/$(am__dirstamp) \ - google/protobuf/util/$(DEPDIR)/$(am__dirstamp) -google/protobuf/util/protobuf_test-message_differencer_unittest.pb.$(OBJEXT): \ - google/protobuf/util/$(am__dirstamp) \ - google/protobuf/util/$(DEPDIR)/$(am__dirstamp) - -protobuf-test$(EXEEXT): $(protobuf_test_OBJECTS) $(protobuf_test_DEPENDENCIES) $(EXTRA_protobuf_test_DEPENDENCIES) - @rm -f protobuf-test$(EXEEXT) - $(AM_V_CXXLD)$(protobuf_test_LINK) $(protobuf_test_OBJECTS) $(protobuf_test_LDADD) $(LIBS) -google/protobuf/compiler/main.$(OBJEXT): \ - google/protobuf/compiler/$(am__dirstamp) \ - google/protobuf/compiler/$(DEPDIR)/$(am__dirstamp) - -protoc$(EXEEXT): $(protoc_OBJECTS) $(protoc_DEPENDENCIES) $(EXTRA_protoc_DEPENDENCIES) - @rm -f protoc$(EXEEXT) - $(AM_V_CXXLD)$(CXXLINK) $(protoc_OBJECTS) $(protoc_LDADD) $(LIBS) -google/protobuf/compiler/test_plugin-mock_code_generator.$(OBJEXT): \ - google/protobuf/compiler/$(am__dirstamp) \ - google/protobuf/compiler/$(DEPDIR)/$(am__dirstamp) -google/protobuf/compiler/test_plugin-test_plugin.$(OBJEXT): \ - google/protobuf/compiler/$(am__dirstamp) \ - google/protobuf/compiler/$(DEPDIR)/$(am__dirstamp) -google/protobuf/testing/test_plugin-file.$(OBJEXT): \ - google/protobuf/testing/$(am__dirstamp) \ - google/protobuf/testing/$(DEPDIR)/$(am__dirstamp) - -test_plugin$(EXEEXT): $(test_plugin_OBJECTS) $(test_plugin_DEPENDENCIES) $(EXTRA_test_plugin_DEPENDENCIES) - @rm -f test_plugin$(EXEEXT) - $(AM_V_CXXLD)$(CXXLINK) $(test_plugin_OBJECTS) $(test_plugin_LDADD) $(LIBS) -google/protobuf/testing/zcgunzip.$(OBJEXT): \ - google/protobuf/testing/$(am__dirstamp) \ - google/protobuf/testing/$(DEPDIR)/$(am__dirstamp) - -zcgunzip$(EXEEXT): $(zcgunzip_OBJECTS) $(zcgunzip_DEPENDENCIES) $(EXTRA_zcgunzip_DEPENDENCIES) - @rm -f zcgunzip$(EXEEXT) - $(AM_V_CXXLD)$(CXXLINK) $(zcgunzip_OBJECTS) $(zcgunzip_LDADD) $(LIBS) -google/protobuf/testing/zcgzip.$(OBJEXT): \ - google/protobuf/testing/$(am__dirstamp) \ - google/protobuf/testing/$(DEPDIR)/$(am__dirstamp) - -zcgzip$(EXEEXT): $(zcgzip_OBJECTS) $(zcgzip_DEPENDENCIES) $(EXTRA_zcgzip_DEPENDENCIES) - @rm -f zcgzip$(EXEEXT) - $(AM_V_CXXLD)$(CXXLINK) $(zcgzip_OBJECTS) $(zcgzip_LDADD) $(LIBS) - -mostlyclean-compile: - -rm -f *.$(OBJEXT) - -rm -f google/protobuf/*.$(OBJEXT) - -rm -f google/protobuf/*.lo - -rm -f google/protobuf/compiler/*.$(OBJEXT) - -rm -f google/protobuf/compiler/*.lo - -rm -f google/protobuf/compiler/cpp/*.$(OBJEXT) - -rm -f google/protobuf/compiler/cpp/*.lo - -rm -f google/protobuf/compiler/csharp/*.$(OBJEXT) - -rm -f google/protobuf/compiler/csharp/*.lo - -rm -f google/protobuf/compiler/java/*.$(OBJEXT) - -rm -f google/protobuf/compiler/java/*.lo - -rm -f google/protobuf/compiler/js/*.$(OBJEXT) - -rm -f google/protobuf/compiler/js/*.lo - -rm -f google/protobuf/compiler/objectivec/*.$(OBJEXT) - -rm -f google/protobuf/compiler/objectivec/*.lo - -rm -f google/protobuf/compiler/php/*.$(OBJEXT) - -rm -f google/protobuf/compiler/php/*.lo - -rm -f google/protobuf/compiler/python/*.$(OBJEXT) - -rm -f google/protobuf/compiler/python/*.lo - -rm -f google/protobuf/compiler/ruby/*.$(OBJEXT) - -rm -f google/protobuf/compiler/ruby/*.lo - -rm -f google/protobuf/io/*.$(OBJEXT) - -rm -f google/protobuf/io/*.lo - -rm -f google/protobuf/stubs/*.$(OBJEXT) - -rm -f google/protobuf/stubs/*.lo - -rm -f google/protobuf/testing/*.$(OBJEXT) - -rm -f google/protobuf/util/*.$(OBJEXT) - -rm -f google/protobuf/util/*.lo - -rm -f google/protobuf/util/internal/*.$(OBJEXT) - -rm -f google/protobuf/util/internal/*.lo - -rm -f google/protobuf/util/internal/testdata/*.$(OBJEXT) - -distclean-compile: - -rm -f *.tab.c - -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/no_warning_test-no_warning_test.Po@am__quote@ # am--include-marker -@AMDEP_TRUE@@am__include@ @am__quote@google/protobuf/$(DEPDIR)/any.Plo@am__quote@ # am--include-marker -@AMDEP_TRUE@@am__include@ @am__quote@google/protobuf/$(DEPDIR)/any.pb.Plo@am__quote@ # am--include-marker -@AMDEP_TRUE@@am__include@ @am__quote@google/protobuf/$(DEPDIR)/any_lite.Plo@am__quote@ # am--include-marker -@AMDEP_TRUE@@am__include@ @am__quote@google/protobuf/$(DEPDIR)/api.pb.Plo@am__quote@ # am--include-marker -@AMDEP_TRUE@@am__include@ @am__quote@google/protobuf/$(DEPDIR)/arena.Plo@am__quote@ # am--include-marker -@AMDEP_TRUE@@am__include@ @am__quote@google/protobuf/$(DEPDIR)/arenastring.Plo@am__quote@ # am--include-marker -@AMDEP_TRUE@@am__include@ @am__quote@google/protobuf/$(DEPDIR)/descriptor.Plo@am__quote@ # am--include-marker -@AMDEP_TRUE@@am__include@ @am__quote@google/protobuf/$(DEPDIR)/descriptor.pb.Plo@am__quote@ # am--include-marker -@AMDEP_TRUE@@am__include@ @am__quote@google/protobuf/$(DEPDIR)/descriptor_database.Plo@am__quote@ # am--include-marker -@AMDEP_TRUE@@am__include@ @am__quote@google/protobuf/$(DEPDIR)/duration.pb.Plo@am__quote@ # am--include-marker -@AMDEP_TRUE@@am__include@ @am__quote@google/protobuf/$(DEPDIR)/dynamic_message.Plo@am__quote@ # am--include-marker -@AMDEP_TRUE@@am__include@ @am__quote@google/protobuf/$(DEPDIR)/empty.pb.Plo@am__quote@ # am--include-marker -@AMDEP_TRUE@@am__include@ @am__quote@google/protobuf/$(DEPDIR)/extension_set.Plo@am__quote@ # am--include-marker -@AMDEP_TRUE@@am__include@ @am__quote@google/protobuf/$(DEPDIR)/extension_set_heavy.Plo@am__quote@ # am--include-marker -@AMDEP_TRUE@@am__include@ @am__quote@google/protobuf/$(DEPDIR)/field_mask.pb.Plo@am__quote@ # am--include-marker -@AMDEP_TRUE@@am__include@ @am__quote@google/protobuf/$(DEPDIR)/generated_enum_util.Plo@am__quote@ # am--include-marker -@AMDEP_TRUE@@am__include@ @am__quote@google/protobuf/$(DEPDIR)/generated_message_bases.Plo@am__quote@ # am--include-marker -@AMDEP_TRUE@@am__include@ @am__quote@google/protobuf/$(DEPDIR)/generated_message_reflection.Plo@am__quote@ # am--include-marker -@AMDEP_TRUE@@am__include@ @am__quote@google/protobuf/$(DEPDIR)/generated_message_table_driven.Plo@am__quote@ # am--include-marker -@AMDEP_TRUE@@am__include@ @am__quote@google/protobuf/$(DEPDIR)/generated_message_table_driven_lite.Plo@am__quote@ # am--include-marker -@AMDEP_TRUE@@am__include@ @am__quote@google/protobuf/$(DEPDIR)/generated_message_tctable_full.Plo@am__quote@ # am--include-marker -@AMDEP_TRUE@@am__include@ @am__quote@google/protobuf/$(DEPDIR)/generated_message_tctable_lite.Plo@am__quote@ # am--include-marker -@AMDEP_TRUE@@am__include@ @am__quote@google/protobuf/$(DEPDIR)/generated_message_util.Plo@am__quote@ # am--include-marker -@AMDEP_TRUE@@am__include@ @am__quote@google/protobuf/$(DEPDIR)/implicit_weak_message.Plo@am__quote@ # am--include-marker -@AMDEP_TRUE@@am__include@ @am__quote@google/protobuf/$(DEPDIR)/inlined_string_field.Plo@am__quote@ # am--include-marker -@AMDEP_TRUE@@am__include@ @am__quote@google/protobuf/$(DEPDIR)/map.Plo@am__quote@ # am--include-marker -@AMDEP_TRUE@@am__include@ @am__quote@google/protobuf/$(DEPDIR)/map_field.Plo@am__quote@ # am--include-marker -@AMDEP_TRUE@@am__include@ @am__quote@google/protobuf/$(DEPDIR)/message.Plo@am__quote@ # am--include-marker -@AMDEP_TRUE@@am__include@ @am__quote@google/protobuf/$(DEPDIR)/message_lite.Plo@am__quote@ # am--include-marker -@AMDEP_TRUE@@am__include@ @am__quote@google/protobuf/$(DEPDIR)/no_warning_test-any_test.pb.Po@am__quote@ # am--include-marker -@AMDEP_TRUE@@am__include@ @am__quote@google/protobuf/$(DEPDIR)/no_warning_test-map_lite_unittest.pb.Po@am__quote@ # am--include-marker -@AMDEP_TRUE@@am__include@ @am__quote@google/protobuf/$(DEPDIR)/no_warning_test-map_proto2_unittest.pb.Po@am__quote@ # am--include-marker -@AMDEP_TRUE@@am__include@ @am__quote@google/protobuf/$(DEPDIR)/no_warning_test-map_unittest.pb.Po@am__quote@ # am--include-marker -@AMDEP_TRUE@@am__include@ @am__quote@google/protobuf/$(DEPDIR)/no_warning_test-unittest.pb.Po@am__quote@ # am--include-marker -@AMDEP_TRUE@@am__include@ @am__quote@google/protobuf/$(DEPDIR)/no_warning_test-unittest_arena.pb.Po@am__quote@ # am--include-marker -@AMDEP_TRUE@@am__include@ @am__quote@google/protobuf/$(DEPDIR)/no_warning_test-unittest_custom_options.pb.Po@am__quote@ # am--include-marker -@AMDEP_TRUE@@am__include@ @am__quote@google/protobuf/$(DEPDIR)/no_warning_test-unittest_drop_unknown_fields.pb.Po@am__quote@ # am--include-marker -@AMDEP_TRUE@@am__include@ @am__quote@google/protobuf/$(DEPDIR)/no_warning_test-unittest_embed_optimize_for.pb.Po@am__quote@ # am--include-marker -@AMDEP_TRUE@@am__include@ @am__quote@google/protobuf/$(DEPDIR)/no_warning_test-unittest_empty.pb.Po@am__quote@ # am--include-marker -@AMDEP_TRUE@@am__include@ @am__quote@google/protobuf/$(DEPDIR)/no_warning_test-unittest_enormous_descriptor.pb.Po@am__quote@ # am--include-marker -@AMDEP_TRUE@@am__include@ @am__quote@google/protobuf/$(DEPDIR)/no_warning_test-unittest_import.pb.Po@am__quote@ # am--include-marker -@AMDEP_TRUE@@am__include@ @am__quote@google/protobuf/$(DEPDIR)/no_warning_test-unittest_import_lite.pb.Po@am__quote@ # am--include-marker -@AMDEP_TRUE@@am__include@ @am__quote@google/protobuf/$(DEPDIR)/no_warning_test-unittest_import_public.pb.Po@am__quote@ # am--include-marker -@AMDEP_TRUE@@am__include@ @am__quote@google/protobuf/$(DEPDIR)/no_warning_test-unittest_import_public_lite.pb.Po@am__quote@ # am--include-marker -@AMDEP_TRUE@@am__include@ @am__quote@google/protobuf/$(DEPDIR)/no_warning_test-unittest_lazy_dependencies.pb.Po@am__quote@ # am--include-marker -@AMDEP_TRUE@@am__include@ @am__quote@google/protobuf/$(DEPDIR)/no_warning_test-unittest_lazy_dependencies_custom_option.pb.Po@am__quote@ # am--include-marker -@AMDEP_TRUE@@am__include@ @am__quote@google/protobuf/$(DEPDIR)/no_warning_test-unittest_lazy_dependencies_enum.pb.Po@am__quote@ # am--include-marker -@AMDEP_TRUE@@am__include@ @am__quote@google/protobuf/$(DEPDIR)/no_warning_test-unittest_lite.pb.Po@am__quote@ # am--include-marker -@AMDEP_TRUE@@am__include@ @am__quote@google/protobuf/$(DEPDIR)/no_warning_test-unittest_lite_imports_nonlite.pb.Po@am__quote@ # am--include-marker -@AMDEP_TRUE@@am__include@ @am__quote@google/protobuf/$(DEPDIR)/no_warning_test-unittest_mset.pb.Po@am__quote@ # am--include-marker -@AMDEP_TRUE@@am__include@ @am__quote@google/protobuf/$(DEPDIR)/no_warning_test-unittest_mset_wire_format.pb.Po@am__quote@ # am--include-marker -@AMDEP_TRUE@@am__include@ @am__quote@google/protobuf/$(DEPDIR)/no_warning_test-unittest_no_field_presence.pb.Po@am__quote@ # am--include-marker -@AMDEP_TRUE@@am__include@ @am__quote@google/protobuf/$(DEPDIR)/no_warning_test-unittest_no_generic_services.pb.Po@am__quote@ # am--include-marker -@AMDEP_TRUE@@am__include@ @am__quote@google/protobuf/$(DEPDIR)/no_warning_test-unittest_optimize_for.pb.Po@am__quote@ # am--include-marker -@AMDEP_TRUE@@am__include@ @am__quote@google/protobuf/$(DEPDIR)/no_warning_test-unittest_preserve_unknown_enum.pb.Po@am__quote@ # am--include-marker -@AMDEP_TRUE@@am__include@ @am__quote@google/protobuf/$(DEPDIR)/no_warning_test-unittest_preserve_unknown_enum2.pb.Po@am__quote@ # am--include-marker -@AMDEP_TRUE@@am__include@ @am__quote@google/protobuf/$(DEPDIR)/no_warning_test-unittest_proto3.pb.Po@am__quote@ # am--include-marker -@AMDEP_TRUE@@am__include@ @am__quote@google/protobuf/$(DEPDIR)/no_warning_test-unittest_proto3_arena.pb.Po@am__quote@ # am--include-marker -@AMDEP_TRUE@@am__include@ @am__quote@google/protobuf/$(DEPDIR)/no_warning_test-unittest_proto3_arena_lite.pb.Po@am__quote@ # am--include-marker -@AMDEP_TRUE@@am__include@ @am__quote@google/protobuf/$(DEPDIR)/no_warning_test-unittest_proto3_lite.pb.Po@am__quote@ # am--include-marker -@AMDEP_TRUE@@am__include@ @am__quote@google/protobuf/$(DEPDIR)/no_warning_test-unittest_proto3_optional.pb.Po@am__quote@ # am--include-marker -@AMDEP_TRUE@@am__include@ @am__quote@google/protobuf/$(DEPDIR)/no_warning_test-unittest_well_known_types.pb.Po@am__quote@ # am--include-marker -@AMDEP_TRUE@@am__include@ @am__quote@google/protobuf/$(DEPDIR)/parse_context.Plo@am__quote@ # am--include-marker -@AMDEP_TRUE@@am__include@ @am__quote@google/protobuf/$(DEPDIR)/protobuf_lazy_descriptor_test-any_test.pb.Po@am__quote@ # am--include-marker -@AMDEP_TRUE@@am__include@ @am__quote@google/protobuf/$(DEPDIR)/protobuf_lazy_descriptor_test-arena_test_util.Po@am__quote@ # am--include-marker -@AMDEP_TRUE@@am__include@ @am__quote@google/protobuf/$(DEPDIR)/protobuf_lazy_descriptor_test-map_lite_test_util.Po@am__quote@ # am--include-marker -@AMDEP_TRUE@@am__include@ @am__quote@google/protobuf/$(DEPDIR)/protobuf_lazy_descriptor_test-map_lite_unittest.pb.Po@am__quote@ # am--include-marker -@AMDEP_TRUE@@am__include@ @am__quote@google/protobuf/$(DEPDIR)/protobuf_lazy_descriptor_test-map_proto2_unittest.pb.Po@am__quote@ # am--include-marker -@AMDEP_TRUE@@am__include@ @am__quote@google/protobuf/$(DEPDIR)/protobuf_lazy_descriptor_test-map_unittest.pb.Po@am__quote@ # am--include-marker -@AMDEP_TRUE@@am__include@ @am__quote@google/protobuf/$(DEPDIR)/protobuf_lazy_descriptor_test-reflection_tester.Po@am__quote@ # am--include-marker -@AMDEP_TRUE@@am__include@ @am__quote@google/protobuf/$(DEPDIR)/protobuf_lazy_descriptor_test-test_util.Po@am__quote@ # am--include-marker -@AMDEP_TRUE@@am__include@ @am__quote@google/protobuf/$(DEPDIR)/protobuf_lazy_descriptor_test-test_util_lite.Po@am__quote@ # am--include-marker -@AMDEP_TRUE@@am__include@ @am__quote@google/protobuf/$(DEPDIR)/protobuf_lazy_descriptor_test-unittest.pb.Po@am__quote@ # am--include-marker -@AMDEP_TRUE@@am__include@ @am__quote@google/protobuf/$(DEPDIR)/protobuf_lazy_descriptor_test-unittest_arena.pb.Po@am__quote@ # am--include-marker -@AMDEP_TRUE@@am__include@ @am__quote@google/protobuf/$(DEPDIR)/protobuf_lazy_descriptor_test-unittest_custom_options.pb.Po@am__quote@ # am--include-marker -@AMDEP_TRUE@@am__include@ @am__quote@google/protobuf/$(DEPDIR)/protobuf_lazy_descriptor_test-unittest_drop_unknown_fields.pb.Po@am__quote@ # am--include-marker -@AMDEP_TRUE@@am__include@ @am__quote@google/protobuf/$(DEPDIR)/protobuf_lazy_descriptor_test-unittest_embed_optimize_for.pb.Po@am__quote@ # am--include-marker -@AMDEP_TRUE@@am__include@ @am__quote@google/protobuf/$(DEPDIR)/protobuf_lazy_descriptor_test-unittest_empty.pb.Po@am__quote@ # am--include-marker -@AMDEP_TRUE@@am__include@ @am__quote@google/protobuf/$(DEPDIR)/protobuf_lazy_descriptor_test-unittest_enormous_descriptor.pb.Po@am__quote@ # am--include-marker -@AMDEP_TRUE@@am__include@ @am__quote@google/protobuf/$(DEPDIR)/protobuf_lazy_descriptor_test-unittest_import.pb.Po@am__quote@ # am--include-marker -@AMDEP_TRUE@@am__include@ @am__quote@google/protobuf/$(DEPDIR)/protobuf_lazy_descriptor_test-unittest_import_lite.pb.Po@am__quote@ # am--include-marker -@AMDEP_TRUE@@am__include@ @am__quote@google/protobuf/$(DEPDIR)/protobuf_lazy_descriptor_test-unittest_import_public.pb.Po@am__quote@ # am--include-marker -@AMDEP_TRUE@@am__include@ @am__quote@google/protobuf/$(DEPDIR)/protobuf_lazy_descriptor_test-unittest_import_public_lite.pb.Po@am__quote@ # am--include-marker -@AMDEP_TRUE@@am__include@ @am__quote@google/protobuf/$(DEPDIR)/protobuf_lazy_descriptor_test-unittest_lazy_dependencies.pb.Po@am__quote@ # am--include-marker -@AMDEP_TRUE@@am__include@ @am__quote@google/protobuf/$(DEPDIR)/protobuf_lazy_descriptor_test-unittest_lazy_dependencies_custom_option.pb.Po@am__quote@ # am--include-marker -@AMDEP_TRUE@@am__include@ @am__quote@google/protobuf/$(DEPDIR)/protobuf_lazy_descriptor_test-unittest_lazy_dependencies_enum.pb.Po@am__quote@ # am--include-marker -@AMDEP_TRUE@@am__include@ @am__quote@google/protobuf/$(DEPDIR)/protobuf_lazy_descriptor_test-unittest_lite.pb.Po@am__quote@ # am--include-marker -@AMDEP_TRUE@@am__include@ @am__quote@google/protobuf/$(DEPDIR)/protobuf_lazy_descriptor_test-unittest_lite_imports_nonlite.pb.Po@am__quote@ # am--include-marker -@AMDEP_TRUE@@am__include@ @am__quote@google/protobuf/$(DEPDIR)/protobuf_lazy_descriptor_test-unittest_mset.pb.Po@am__quote@ # am--include-marker -@AMDEP_TRUE@@am__include@ @am__quote@google/protobuf/$(DEPDIR)/protobuf_lazy_descriptor_test-unittest_mset_wire_format.pb.Po@am__quote@ # am--include-marker -@AMDEP_TRUE@@am__include@ @am__quote@google/protobuf/$(DEPDIR)/protobuf_lazy_descriptor_test-unittest_no_field_presence.pb.Po@am__quote@ # am--include-marker -@AMDEP_TRUE@@am__include@ @am__quote@google/protobuf/$(DEPDIR)/protobuf_lazy_descriptor_test-unittest_no_generic_services.pb.Po@am__quote@ # am--include-marker -@AMDEP_TRUE@@am__include@ @am__quote@google/protobuf/$(DEPDIR)/protobuf_lazy_descriptor_test-unittest_optimize_for.pb.Po@am__quote@ # am--include-marker -@AMDEP_TRUE@@am__include@ @am__quote@google/protobuf/$(DEPDIR)/protobuf_lazy_descriptor_test-unittest_preserve_unknown_enum.pb.Po@am__quote@ # am--include-marker -@AMDEP_TRUE@@am__include@ @am__quote@google/protobuf/$(DEPDIR)/protobuf_lazy_descriptor_test-unittest_preserve_unknown_enum2.pb.Po@am__quote@ # am--include-marker -@AMDEP_TRUE@@am__include@ @am__quote@google/protobuf/$(DEPDIR)/protobuf_lazy_descriptor_test-unittest_proto3.pb.Po@am__quote@ # am--include-marker -@AMDEP_TRUE@@am__include@ @am__quote@google/protobuf/$(DEPDIR)/protobuf_lazy_descriptor_test-unittest_proto3_arena.pb.Po@am__quote@ # am--include-marker -@AMDEP_TRUE@@am__include@ @am__quote@google/protobuf/$(DEPDIR)/protobuf_lazy_descriptor_test-unittest_proto3_arena_lite.pb.Po@am__quote@ # am--include-marker -@AMDEP_TRUE@@am__include@ @am__quote@google/protobuf/$(DEPDIR)/protobuf_lazy_descriptor_test-unittest_proto3_lite.pb.Po@am__quote@ # am--include-marker -@AMDEP_TRUE@@am__include@ @am__quote@google/protobuf/$(DEPDIR)/protobuf_lazy_descriptor_test-unittest_proto3_optional.pb.Po@am__quote@ # am--include-marker -@AMDEP_TRUE@@am__include@ @am__quote@google/protobuf/$(DEPDIR)/protobuf_lazy_descriptor_test-unittest_well_known_types.pb.Po@am__quote@ # am--include-marker -@AMDEP_TRUE@@am__include@ @am__quote@google/protobuf/$(DEPDIR)/protobuf_lite_arena_test-arena_test_util.Po@am__quote@ # am--include-marker -@AMDEP_TRUE@@am__include@ @am__quote@google/protobuf/$(DEPDIR)/protobuf_lite_arena_test-lite_arena_unittest.Po@am__quote@ # am--include-marker -@AMDEP_TRUE@@am__include@ @am__quote@google/protobuf/$(DEPDIR)/protobuf_lite_arena_test-map_lite_test_util.Po@am__quote@ # am--include-marker -@AMDEP_TRUE@@am__include@ @am__quote@google/protobuf/$(DEPDIR)/protobuf_lite_arena_test-map_lite_unittest.pb.Po@am__quote@ # am--include-marker -@AMDEP_TRUE@@am__include@ @am__quote@google/protobuf/$(DEPDIR)/protobuf_lite_arena_test-test_util_lite.Po@am__quote@ # am--include-marker -@AMDEP_TRUE@@am__include@ @am__quote@google/protobuf/$(DEPDIR)/protobuf_lite_arena_test-unittest_import_lite.pb.Po@am__quote@ # am--include-marker -@AMDEP_TRUE@@am__include@ @am__quote@google/protobuf/$(DEPDIR)/protobuf_lite_arena_test-unittest_import_public_lite.pb.Po@am__quote@ # am--include-marker -@AMDEP_TRUE@@am__include@ @am__quote@google/protobuf/$(DEPDIR)/protobuf_lite_arena_test-unittest_lite.pb.Po@am__quote@ # am--include-marker -@AMDEP_TRUE@@am__include@ @am__quote@google/protobuf/$(DEPDIR)/protobuf_lite_test-arena_test_util.Po@am__quote@ # am--include-marker -@AMDEP_TRUE@@am__include@ @am__quote@google/protobuf/$(DEPDIR)/protobuf_lite_test-lite_unittest.Po@am__quote@ # am--include-marker -@AMDEP_TRUE@@am__include@ @am__quote@google/protobuf/$(DEPDIR)/protobuf_lite_test-map_lite_test_util.Po@am__quote@ # am--include-marker -@AMDEP_TRUE@@am__include@ @am__quote@google/protobuf/$(DEPDIR)/protobuf_lite_test-map_lite_unittest.pb.Po@am__quote@ # am--include-marker -@AMDEP_TRUE@@am__include@ @am__quote@google/protobuf/$(DEPDIR)/protobuf_lite_test-test_util_lite.Po@am__quote@ # am--include-marker -@AMDEP_TRUE@@am__include@ @am__quote@google/protobuf/$(DEPDIR)/protobuf_lite_test-unittest_import_lite.pb.Po@am__quote@ # am--include-marker -@AMDEP_TRUE@@am__include@ @am__quote@google/protobuf/$(DEPDIR)/protobuf_lite_test-unittest_import_public_lite.pb.Po@am__quote@ # am--include-marker -@AMDEP_TRUE@@am__include@ @am__quote@google/protobuf/$(DEPDIR)/protobuf_lite_test-unittest_lite.pb.Po@am__quote@ # am--include-marker -@AMDEP_TRUE@@am__include@ @am__quote@google/protobuf/$(DEPDIR)/protobuf_test-any_test.Po@am__quote@ # am--include-marker -@AMDEP_TRUE@@am__include@ @am__quote@google/protobuf/$(DEPDIR)/protobuf_test-any_test.pb.Po@am__quote@ # am--include-marker -@AMDEP_TRUE@@am__include@ @am__quote@google/protobuf/$(DEPDIR)/protobuf_test-arena_test_util.Po@am__quote@ # am--include-marker -@AMDEP_TRUE@@am__include@ @am__quote@google/protobuf/$(DEPDIR)/protobuf_test-arena_unittest.Po@am__quote@ # am--include-marker -@AMDEP_TRUE@@am__include@ @am__quote@google/protobuf/$(DEPDIR)/protobuf_test-arenastring_unittest.Po@am__quote@ # am--include-marker -@AMDEP_TRUE@@am__include@ @am__quote@google/protobuf/$(DEPDIR)/protobuf_test-descriptor_database_unittest.Po@am__quote@ # am--include-marker -@AMDEP_TRUE@@am__include@ @am__quote@google/protobuf/$(DEPDIR)/protobuf_test-descriptor_unittest.Po@am__quote@ # am--include-marker -@AMDEP_TRUE@@am__include@ @am__quote@google/protobuf/$(DEPDIR)/protobuf_test-drop_unknown_fields_test.Po@am__quote@ # am--include-marker -@AMDEP_TRUE@@am__include@ @am__quote@google/protobuf/$(DEPDIR)/protobuf_test-dynamic_message_unittest.Po@am__quote@ # am--include-marker -@AMDEP_TRUE@@am__include@ @am__quote@google/protobuf/$(DEPDIR)/protobuf_test-extension_set_unittest.Po@am__quote@ # am--include-marker -@AMDEP_TRUE@@am__include@ @am__quote@google/protobuf/$(DEPDIR)/protobuf_test-generated_message_reflection_unittest.Po@am__quote@ # am--include-marker -@AMDEP_TRUE@@am__include@ @am__quote@google/protobuf/$(DEPDIR)/protobuf_test-inlined_string_field_unittest.Po@am__quote@ # am--include-marker -@AMDEP_TRUE@@am__include@ @am__quote@google/protobuf/$(DEPDIR)/protobuf_test-map_field_test.Po@am__quote@ # am--include-marker -@AMDEP_TRUE@@am__include@ @am__quote@google/protobuf/$(DEPDIR)/protobuf_test-map_lite_test_util.Po@am__quote@ # am--include-marker -@AMDEP_TRUE@@am__include@ @am__quote@google/protobuf/$(DEPDIR)/protobuf_test-map_lite_unittest.pb.Po@am__quote@ # am--include-marker -@AMDEP_TRUE@@am__include@ @am__quote@google/protobuf/$(DEPDIR)/protobuf_test-map_proto2_unittest.pb.Po@am__quote@ # am--include-marker -@AMDEP_TRUE@@am__include@ @am__quote@google/protobuf/$(DEPDIR)/protobuf_test-map_test.Po@am__quote@ # am--include-marker -@AMDEP_TRUE@@am__include@ @am__quote@google/protobuf/$(DEPDIR)/protobuf_test-map_unittest.pb.Po@am__quote@ # am--include-marker -@AMDEP_TRUE@@am__include@ @am__quote@google/protobuf/$(DEPDIR)/protobuf_test-message_unittest.Po@am__quote@ # am--include-marker -@AMDEP_TRUE@@am__include@ @am__quote@google/protobuf/$(DEPDIR)/protobuf_test-no_field_presence_test.Po@am__quote@ # am--include-marker -@AMDEP_TRUE@@am__include@ @am__quote@google/protobuf/$(DEPDIR)/protobuf_test-preserve_unknown_enum_test.Po@am__quote@ # am--include-marker -@AMDEP_TRUE@@am__include@ @am__quote@google/protobuf/$(DEPDIR)/protobuf_test-proto3_arena_lite_unittest.Po@am__quote@ # am--include-marker -@AMDEP_TRUE@@am__include@ @am__quote@google/protobuf/$(DEPDIR)/protobuf_test-proto3_arena_unittest.Po@am__quote@ # am--include-marker -@AMDEP_TRUE@@am__include@ @am__quote@google/protobuf/$(DEPDIR)/protobuf_test-proto3_lite_unittest.Po@am__quote@ # am--include-marker -@AMDEP_TRUE@@am__include@ @am__quote@google/protobuf/$(DEPDIR)/protobuf_test-reflection_ops_unittest.Po@am__quote@ # am--include-marker -@AMDEP_TRUE@@am__include@ @am__quote@google/protobuf/$(DEPDIR)/protobuf_test-reflection_tester.Po@am__quote@ # am--include-marker -@AMDEP_TRUE@@am__include@ @am__quote@google/protobuf/$(DEPDIR)/protobuf_test-repeated_field_reflection_unittest.Po@am__quote@ # am--include-marker -@AMDEP_TRUE@@am__include@ @am__quote@google/protobuf/$(DEPDIR)/protobuf_test-repeated_field_unittest.Po@am__quote@ # am--include-marker -@AMDEP_TRUE@@am__include@ @am__quote@google/protobuf/$(DEPDIR)/protobuf_test-test_util.Po@am__quote@ # am--include-marker -@AMDEP_TRUE@@am__include@ @am__quote@google/protobuf/$(DEPDIR)/protobuf_test-test_util_lite.Po@am__quote@ # am--include-marker -@AMDEP_TRUE@@am__include@ @am__quote@google/protobuf/$(DEPDIR)/protobuf_test-text_format_unittest.Po@am__quote@ # am--include-marker -@AMDEP_TRUE@@am__include@ @am__quote@google/protobuf/$(DEPDIR)/protobuf_test-unittest.pb.Po@am__quote@ # am--include-marker -@AMDEP_TRUE@@am__include@ @am__quote@google/protobuf/$(DEPDIR)/protobuf_test-unittest_arena.pb.Po@am__quote@ # am--include-marker -@AMDEP_TRUE@@am__include@ @am__quote@google/protobuf/$(DEPDIR)/protobuf_test-unittest_custom_options.pb.Po@am__quote@ # am--include-marker -@AMDEP_TRUE@@am__include@ @am__quote@google/protobuf/$(DEPDIR)/protobuf_test-unittest_drop_unknown_fields.pb.Po@am__quote@ # am--include-marker -@AMDEP_TRUE@@am__include@ @am__quote@google/protobuf/$(DEPDIR)/protobuf_test-unittest_embed_optimize_for.pb.Po@am__quote@ # am--include-marker -@AMDEP_TRUE@@am__include@ @am__quote@google/protobuf/$(DEPDIR)/protobuf_test-unittest_empty.pb.Po@am__quote@ # am--include-marker -@AMDEP_TRUE@@am__include@ @am__quote@google/protobuf/$(DEPDIR)/protobuf_test-unittest_enormous_descriptor.pb.Po@am__quote@ # am--include-marker -@AMDEP_TRUE@@am__include@ @am__quote@google/protobuf/$(DEPDIR)/protobuf_test-unittest_import.pb.Po@am__quote@ # am--include-marker -@AMDEP_TRUE@@am__include@ @am__quote@google/protobuf/$(DEPDIR)/protobuf_test-unittest_import_lite.pb.Po@am__quote@ # am--include-marker -@AMDEP_TRUE@@am__include@ @am__quote@google/protobuf/$(DEPDIR)/protobuf_test-unittest_import_public.pb.Po@am__quote@ # am--include-marker -@AMDEP_TRUE@@am__include@ @am__quote@google/protobuf/$(DEPDIR)/protobuf_test-unittest_import_public_lite.pb.Po@am__quote@ # am--include-marker -@AMDEP_TRUE@@am__include@ @am__quote@google/protobuf/$(DEPDIR)/protobuf_test-unittest_lazy_dependencies.pb.Po@am__quote@ # am--include-marker -@AMDEP_TRUE@@am__include@ @am__quote@google/protobuf/$(DEPDIR)/protobuf_test-unittest_lazy_dependencies_custom_option.pb.Po@am__quote@ # am--include-marker -@AMDEP_TRUE@@am__include@ @am__quote@google/protobuf/$(DEPDIR)/protobuf_test-unittest_lazy_dependencies_enum.pb.Po@am__quote@ # am--include-marker -@AMDEP_TRUE@@am__include@ @am__quote@google/protobuf/$(DEPDIR)/protobuf_test-unittest_lite.pb.Po@am__quote@ # am--include-marker -@AMDEP_TRUE@@am__include@ @am__quote@google/protobuf/$(DEPDIR)/protobuf_test-unittest_lite_imports_nonlite.pb.Po@am__quote@ # am--include-marker -@AMDEP_TRUE@@am__include@ @am__quote@google/protobuf/$(DEPDIR)/protobuf_test-unittest_mset.pb.Po@am__quote@ # am--include-marker -@AMDEP_TRUE@@am__include@ @am__quote@google/protobuf/$(DEPDIR)/protobuf_test-unittest_mset_wire_format.pb.Po@am__quote@ # am--include-marker -@AMDEP_TRUE@@am__include@ @am__quote@google/protobuf/$(DEPDIR)/protobuf_test-unittest_no_field_presence.pb.Po@am__quote@ # am--include-marker -@AMDEP_TRUE@@am__include@ @am__quote@google/protobuf/$(DEPDIR)/protobuf_test-unittest_no_generic_services.pb.Po@am__quote@ # am--include-marker -@AMDEP_TRUE@@am__include@ @am__quote@google/protobuf/$(DEPDIR)/protobuf_test-unittest_optimize_for.pb.Po@am__quote@ # am--include-marker -@AMDEP_TRUE@@am__include@ @am__quote@google/protobuf/$(DEPDIR)/protobuf_test-unittest_preserve_unknown_enum.pb.Po@am__quote@ # am--include-marker -@AMDEP_TRUE@@am__include@ @am__quote@google/protobuf/$(DEPDIR)/protobuf_test-unittest_preserve_unknown_enum2.pb.Po@am__quote@ # am--include-marker -@AMDEP_TRUE@@am__include@ @am__quote@google/protobuf/$(DEPDIR)/protobuf_test-unittest_proto3.pb.Po@am__quote@ # am--include-marker -@AMDEP_TRUE@@am__include@ @am__quote@google/protobuf/$(DEPDIR)/protobuf_test-unittest_proto3_arena.pb.Po@am__quote@ # am--include-marker -@AMDEP_TRUE@@am__include@ @am__quote@google/protobuf/$(DEPDIR)/protobuf_test-unittest_proto3_arena_lite.pb.Po@am__quote@ # am--include-marker -@AMDEP_TRUE@@am__include@ @am__quote@google/protobuf/$(DEPDIR)/protobuf_test-unittest_proto3_lite.pb.Po@am__quote@ # am--include-marker -@AMDEP_TRUE@@am__include@ @am__quote@google/protobuf/$(DEPDIR)/protobuf_test-unittest_proto3_optional.pb.Po@am__quote@ # am--include-marker -@AMDEP_TRUE@@am__include@ @am__quote@google/protobuf/$(DEPDIR)/protobuf_test-unittest_well_known_types.pb.Po@am__quote@ # am--include-marker -@AMDEP_TRUE@@am__include@ @am__quote@google/protobuf/$(DEPDIR)/protobuf_test-unknown_field_set_unittest.Po@am__quote@ # am--include-marker -@AMDEP_TRUE@@am__include@ @am__quote@google/protobuf/$(DEPDIR)/protobuf_test-well_known_types_unittest.Po@am__quote@ # am--include-marker -@AMDEP_TRUE@@am__include@ @am__quote@google/protobuf/$(DEPDIR)/protobuf_test-wire_format_unittest.Po@am__quote@ # am--include-marker -@AMDEP_TRUE@@am__include@ @am__quote@google/protobuf/$(DEPDIR)/reflection_ops.Plo@am__quote@ # am--include-marker -@AMDEP_TRUE@@am__include@ @am__quote@google/protobuf/$(DEPDIR)/repeated_field.Plo@am__quote@ # am--include-marker -@AMDEP_TRUE@@am__include@ @am__quote@google/protobuf/$(DEPDIR)/repeated_ptr_field.Plo@am__quote@ # am--include-marker -@AMDEP_TRUE@@am__include@ @am__quote@google/protobuf/$(DEPDIR)/service.Plo@am__quote@ # am--include-marker -@AMDEP_TRUE@@am__include@ @am__quote@google/protobuf/$(DEPDIR)/source_context.pb.Plo@am__quote@ # am--include-marker -@AMDEP_TRUE@@am__include@ @am__quote@google/protobuf/$(DEPDIR)/struct.pb.Plo@am__quote@ # am--include-marker -@AMDEP_TRUE@@am__include@ @am__quote@google/protobuf/$(DEPDIR)/text_format.Plo@am__quote@ # am--include-marker -@AMDEP_TRUE@@am__include@ @am__quote@google/protobuf/$(DEPDIR)/timestamp.pb.Plo@am__quote@ # am--include-marker -@AMDEP_TRUE@@am__include@ @am__quote@google/protobuf/$(DEPDIR)/type.pb.Plo@am__quote@ # am--include-marker -@AMDEP_TRUE@@am__include@ @am__quote@google/protobuf/$(DEPDIR)/unknown_field_set.Plo@am__quote@ # am--include-marker -@AMDEP_TRUE@@am__include@ @am__quote@google/protobuf/$(DEPDIR)/wire_format.Plo@am__quote@ # am--include-marker -@AMDEP_TRUE@@am__include@ @am__quote@google/protobuf/$(DEPDIR)/wire_format_lite.Plo@am__quote@ # am--include-marker -@AMDEP_TRUE@@am__include@ @am__quote@google/protobuf/$(DEPDIR)/wrappers.pb.Plo@am__quote@ # am--include-marker -@AMDEP_TRUE@@am__include@ @am__quote@google/protobuf/compiler/$(DEPDIR)/code_generator.Plo@am__quote@ # am--include-marker -@AMDEP_TRUE@@am__include@ @am__quote@google/protobuf/compiler/$(DEPDIR)/command_line_interface.Plo@am__quote@ # am--include-marker -@AMDEP_TRUE@@am__include@ @am__quote@google/protobuf/compiler/$(DEPDIR)/importer.Plo@am__quote@ # am--include-marker -@AMDEP_TRUE@@am__include@ @am__quote@google/protobuf/compiler/$(DEPDIR)/main.Po@am__quote@ # am--include-marker -@AMDEP_TRUE@@am__include@ @am__quote@google/protobuf/compiler/$(DEPDIR)/parser.Plo@am__quote@ # am--include-marker -@AMDEP_TRUE@@am__include@ @am__quote@google/protobuf/compiler/$(DEPDIR)/plugin.Plo@am__quote@ # am--include-marker -@AMDEP_TRUE@@am__include@ @am__quote@google/protobuf/compiler/$(DEPDIR)/plugin.pb.Plo@am__quote@ # am--include-marker -@AMDEP_TRUE@@am__include@ @am__quote@google/protobuf/compiler/$(DEPDIR)/protobuf_test-annotation_test_util.Po@am__quote@ # am--include-marker -@AMDEP_TRUE@@am__include@ @am__quote@google/protobuf/compiler/$(DEPDIR)/protobuf_test-command_line_interface_unittest.Po@am__quote@ # am--include-marker -@AMDEP_TRUE@@am__include@ @am__quote@google/protobuf/compiler/$(DEPDIR)/protobuf_test-importer_unittest.Po@am__quote@ # am--include-marker -@AMDEP_TRUE@@am__include@ @am__quote@google/protobuf/compiler/$(DEPDIR)/protobuf_test-mock_code_generator.Po@am__quote@ # am--include-marker -@AMDEP_TRUE@@am__include@ @am__quote@google/protobuf/compiler/$(DEPDIR)/protobuf_test-parser_unittest.Po@am__quote@ # am--include-marker -@AMDEP_TRUE@@am__include@ @am__quote@google/protobuf/compiler/$(DEPDIR)/subprocess.Plo@am__quote@ # am--include-marker -@AMDEP_TRUE@@am__include@ @am__quote@google/protobuf/compiler/$(DEPDIR)/test_plugin-mock_code_generator.Po@am__quote@ # am--include-marker -@AMDEP_TRUE@@am__include@ @am__quote@google/protobuf/compiler/$(DEPDIR)/test_plugin-test_plugin.Po@am__quote@ # am--include-marker -@AMDEP_TRUE@@am__include@ @am__quote@google/protobuf/compiler/$(DEPDIR)/zip_writer.Plo@am__quote@ # am--include-marker -@AMDEP_TRUE@@am__include@ @am__quote@google/protobuf/compiler/cpp/$(DEPDIR)/cpp_enum.Plo@am__quote@ # am--include-marker -@AMDEP_TRUE@@am__include@ @am__quote@google/protobuf/compiler/cpp/$(DEPDIR)/cpp_enum_field.Plo@am__quote@ # am--include-marker -@AMDEP_TRUE@@am__include@ @am__quote@google/protobuf/compiler/cpp/$(DEPDIR)/cpp_extension.Plo@am__quote@ # am--include-marker -@AMDEP_TRUE@@am__include@ @am__quote@google/protobuf/compiler/cpp/$(DEPDIR)/cpp_field.Plo@am__quote@ # am--include-marker -@AMDEP_TRUE@@am__include@ @am__quote@google/protobuf/compiler/cpp/$(DEPDIR)/cpp_file.Plo@am__quote@ # am--include-marker -@AMDEP_TRUE@@am__include@ @am__quote@google/protobuf/compiler/cpp/$(DEPDIR)/cpp_generator.Plo@am__quote@ # am--include-marker -@AMDEP_TRUE@@am__include@ @am__quote@google/protobuf/compiler/cpp/$(DEPDIR)/cpp_helpers.Plo@am__quote@ # am--include-marker -@AMDEP_TRUE@@am__include@ @am__quote@google/protobuf/compiler/cpp/$(DEPDIR)/cpp_map_field.Plo@am__quote@ # am--include-marker -@AMDEP_TRUE@@am__include@ @am__quote@google/protobuf/compiler/cpp/$(DEPDIR)/cpp_message.Plo@am__quote@ # am--include-marker -@AMDEP_TRUE@@am__include@ @am__quote@google/protobuf/compiler/cpp/$(DEPDIR)/cpp_message_field.Plo@am__quote@ # am--include-marker -@AMDEP_TRUE@@am__include@ @am__quote@google/protobuf/compiler/cpp/$(DEPDIR)/cpp_padding_optimizer.Plo@am__quote@ # am--include-marker -@AMDEP_TRUE@@am__include@ @am__quote@google/protobuf/compiler/cpp/$(DEPDIR)/cpp_parse_function_generator.Plo@am__quote@ # am--include-marker -@AMDEP_TRUE@@am__include@ @am__quote@google/protobuf/compiler/cpp/$(DEPDIR)/cpp_primitive_field.Plo@am__quote@ # am--include-marker -@AMDEP_TRUE@@am__include@ @am__quote@google/protobuf/compiler/cpp/$(DEPDIR)/cpp_service.Plo@am__quote@ # am--include-marker -@AMDEP_TRUE@@am__include@ @am__quote@google/protobuf/compiler/cpp/$(DEPDIR)/cpp_string_field.Plo@am__quote@ # am--include-marker -@AMDEP_TRUE@@am__include@ @am__quote@google/protobuf/compiler/cpp/$(DEPDIR)/no_warning_test-cpp_test_bad_identifiers.pb.Po@am__quote@ # am--include-marker -@AMDEP_TRUE@@am__include@ @am__quote@google/protobuf/compiler/cpp/$(DEPDIR)/no_warning_test-cpp_test_large_enum_value.pb.Po@am__quote@ # am--include-marker -@AMDEP_TRUE@@am__include@ @am__quote@google/protobuf/compiler/cpp/$(DEPDIR)/protobuf_lazy_descriptor_test-cpp_test_bad_identifiers.pb.Po@am__quote@ # am--include-marker -@AMDEP_TRUE@@am__include@ @am__quote@google/protobuf/compiler/cpp/$(DEPDIR)/protobuf_lazy_descriptor_test-cpp_test_large_enum_value.pb.Po@am__quote@ # am--include-marker -@AMDEP_TRUE@@am__include@ @am__quote@google/protobuf/compiler/cpp/$(DEPDIR)/protobuf_lazy_descriptor_test-cpp_unittest.Po@am__quote@ # am--include-marker -@AMDEP_TRUE@@am__include@ @am__quote@google/protobuf/compiler/cpp/$(DEPDIR)/protobuf_test-cpp_bootstrap_unittest.Po@am__quote@ # am--include-marker -@AMDEP_TRUE@@am__include@ @am__quote@google/protobuf/compiler/cpp/$(DEPDIR)/protobuf_test-cpp_move_unittest.Po@am__quote@ # am--include-marker -@AMDEP_TRUE@@am__include@ @am__quote@google/protobuf/compiler/cpp/$(DEPDIR)/protobuf_test-cpp_plugin_unittest.Po@am__quote@ # am--include-marker -@AMDEP_TRUE@@am__include@ @am__quote@google/protobuf/compiler/cpp/$(DEPDIR)/protobuf_test-cpp_test_bad_identifiers.pb.Po@am__quote@ # am--include-marker -@AMDEP_TRUE@@am__include@ @am__quote@google/protobuf/compiler/cpp/$(DEPDIR)/protobuf_test-cpp_test_large_enum_value.pb.Po@am__quote@ # am--include-marker -@AMDEP_TRUE@@am__include@ @am__quote@google/protobuf/compiler/cpp/$(DEPDIR)/protobuf_test-cpp_unittest.Po@am__quote@ # am--include-marker -@AMDEP_TRUE@@am__include@ @am__quote@google/protobuf/compiler/cpp/$(DEPDIR)/protobuf_test-metadata_test.Po@am__quote@ # am--include-marker -@AMDEP_TRUE@@am__include@ @am__quote@google/protobuf/compiler/csharp/$(DEPDIR)/csharp_doc_comment.Plo@am__quote@ # am--include-marker -@AMDEP_TRUE@@am__include@ @am__quote@google/protobuf/compiler/csharp/$(DEPDIR)/csharp_enum.Plo@am__quote@ # am--include-marker -@AMDEP_TRUE@@am__include@ @am__quote@google/protobuf/compiler/csharp/$(DEPDIR)/csharp_enum_field.Plo@am__quote@ # am--include-marker -@AMDEP_TRUE@@am__include@ @am__quote@google/protobuf/compiler/csharp/$(DEPDIR)/csharp_field_base.Plo@am__quote@ # am--include-marker -@AMDEP_TRUE@@am__include@ @am__quote@google/protobuf/compiler/csharp/$(DEPDIR)/csharp_generator.Plo@am__quote@ # am--include-marker -@AMDEP_TRUE@@am__include@ @am__quote@google/protobuf/compiler/csharp/$(DEPDIR)/csharp_helpers.Plo@am__quote@ # am--include-marker -@AMDEP_TRUE@@am__include@ @am__quote@google/protobuf/compiler/csharp/$(DEPDIR)/csharp_map_field.Plo@am__quote@ # am--include-marker -@AMDEP_TRUE@@am__include@ @am__quote@google/protobuf/compiler/csharp/$(DEPDIR)/csharp_message.Plo@am__quote@ # am--include-marker -@AMDEP_TRUE@@am__include@ @am__quote@google/protobuf/compiler/csharp/$(DEPDIR)/csharp_message_field.Plo@am__quote@ # am--include-marker -@AMDEP_TRUE@@am__include@ @am__quote@google/protobuf/compiler/csharp/$(DEPDIR)/csharp_primitive_field.Plo@am__quote@ # am--include-marker -@AMDEP_TRUE@@am__include@ @am__quote@google/protobuf/compiler/csharp/$(DEPDIR)/csharp_reflection_class.Plo@am__quote@ # am--include-marker -@AMDEP_TRUE@@am__include@ @am__quote@google/protobuf/compiler/csharp/$(DEPDIR)/csharp_repeated_enum_field.Plo@am__quote@ # am--include-marker -@AMDEP_TRUE@@am__include@ @am__quote@google/protobuf/compiler/csharp/$(DEPDIR)/csharp_repeated_message_field.Plo@am__quote@ # am--include-marker -@AMDEP_TRUE@@am__include@ @am__quote@google/protobuf/compiler/csharp/$(DEPDIR)/csharp_repeated_primitive_field.Plo@am__quote@ # am--include-marker -@AMDEP_TRUE@@am__include@ @am__quote@google/protobuf/compiler/csharp/$(DEPDIR)/csharp_source_generator_base.Plo@am__quote@ # am--include-marker -@AMDEP_TRUE@@am__include@ @am__quote@google/protobuf/compiler/csharp/$(DEPDIR)/csharp_wrapper_field.Plo@am__quote@ # am--include-marker -@AMDEP_TRUE@@am__include@ @am__quote@google/protobuf/compiler/csharp/$(DEPDIR)/protobuf_test-csharp_bootstrap_unittest.Po@am__quote@ # am--include-marker -@AMDEP_TRUE@@am__include@ @am__quote@google/protobuf/compiler/csharp/$(DEPDIR)/protobuf_test-csharp_generator_unittest.Po@am__quote@ # am--include-marker -@AMDEP_TRUE@@am__include@ @am__quote@google/protobuf/compiler/java/$(DEPDIR)/java_context.Plo@am__quote@ # am--include-marker -@AMDEP_TRUE@@am__include@ @am__quote@google/protobuf/compiler/java/$(DEPDIR)/java_doc_comment.Plo@am__quote@ # am--include-marker -@AMDEP_TRUE@@am__include@ @am__quote@google/protobuf/compiler/java/$(DEPDIR)/java_enum.Plo@am__quote@ # am--include-marker -@AMDEP_TRUE@@am__include@ @am__quote@google/protobuf/compiler/java/$(DEPDIR)/java_enum_field.Plo@am__quote@ # am--include-marker -@AMDEP_TRUE@@am__include@ @am__quote@google/protobuf/compiler/java/$(DEPDIR)/java_enum_field_lite.Plo@am__quote@ # am--include-marker -@AMDEP_TRUE@@am__include@ @am__quote@google/protobuf/compiler/java/$(DEPDIR)/java_enum_lite.Plo@am__quote@ # am--include-marker -@AMDEP_TRUE@@am__include@ @am__quote@google/protobuf/compiler/java/$(DEPDIR)/java_extension.Plo@am__quote@ # am--include-marker -@AMDEP_TRUE@@am__include@ @am__quote@google/protobuf/compiler/java/$(DEPDIR)/java_extension_lite.Plo@am__quote@ # am--include-marker -@AMDEP_TRUE@@am__include@ @am__quote@google/protobuf/compiler/java/$(DEPDIR)/java_field.Plo@am__quote@ # am--include-marker -@AMDEP_TRUE@@am__include@ @am__quote@google/protobuf/compiler/java/$(DEPDIR)/java_file.Plo@am__quote@ # am--include-marker -@AMDEP_TRUE@@am__include@ @am__quote@google/protobuf/compiler/java/$(DEPDIR)/java_generator.Plo@am__quote@ # am--include-marker -@AMDEP_TRUE@@am__include@ @am__quote@google/protobuf/compiler/java/$(DEPDIR)/java_generator_factory.Plo@am__quote@ # am--include-marker -@AMDEP_TRUE@@am__include@ @am__quote@google/protobuf/compiler/java/$(DEPDIR)/java_helpers.Plo@am__quote@ # am--include-marker -@AMDEP_TRUE@@am__include@ @am__quote@google/protobuf/compiler/java/$(DEPDIR)/java_kotlin_generator.Plo@am__quote@ # am--include-marker -@AMDEP_TRUE@@am__include@ @am__quote@google/protobuf/compiler/java/$(DEPDIR)/java_map_field.Plo@am__quote@ # am--include-marker -@AMDEP_TRUE@@am__include@ @am__quote@google/protobuf/compiler/java/$(DEPDIR)/java_map_field_lite.Plo@am__quote@ # am--include-marker -@AMDEP_TRUE@@am__include@ @am__quote@google/protobuf/compiler/java/$(DEPDIR)/java_message.Plo@am__quote@ # am--include-marker -@AMDEP_TRUE@@am__include@ @am__quote@google/protobuf/compiler/java/$(DEPDIR)/java_message_builder.Plo@am__quote@ # am--include-marker -@AMDEP_TRUE@@am__include@ @am__quote@google/protobuf/compiler/java/$(DEPDIR)/java_message_builder_lite.Plo@am__quote@ # am--include-marker -@AMDEP_TRUE@@am__include@ @am__quote@google/protobuf/compiler/java/$(DEPDIR)/java_message_field.Plo@am__quote@ # am--include-marker -@AMDEP_TRUE@@am__include@ @am__quote@google/protobuf/compiler/java/$(DEPDIR)/java_message_field_lite.Plo@am__quote@ # am--include-marker -@AMDEP_TRUE@@am__include@ @am__quote@google/protobuf/compiler/java/$(DEPDIR)/java_message_lite.Plo@am__quote@ # am--include-marker -@AMDEP_TRUE@@am__include@ @am__quote@google/protobuf/compiler/java/$(DEPDIR)/java_name_resolver.Plo@am__quote@ # am--include-marker -@AMDEP_TRUE@@am__include@ @am__quote@google/protobuf/compiler/java/$(DEPDIR)/java_primitive_field.Plo@am__quote@ # am--include-marker -@AMDEP_TRUE@@am__include@ @am__quote@google/protobuf/compiler/java/$(DEPDIR)/java_primitive_field_lite.Plo@am__quote@ # am--include-marker -@AMDEP_TRUE@@am__include@ @am__quote@google/protobuf/compiler/java/$(DEPDIR)/java_service.Plo@am__quote@ # am--include-marker -@AMDEP_TRUE@@am__include@ @am__quote@google/protobuf/compiler/java/$(DEPDIR)/java_shared_code_generator.Plo@am__quote@ # am--include-marker -@AMDEP_TRUE@@am__include@ @am__quote@google/protobuf/compiler/java/$(DEPDIR)/java_string_field.Plo@am__quote@ # am--include-marker -@AMDEP_TRUE@@am__include@ @am__quote@google/protobuf/compiler/java/$(DEPDIR)/java_string_field_lite.Plo@am__quote@ # am--include-marker -@AMDEP_TRUE@@am__include@ @am__quote@google/protobuf/compiler/java/$(DEPDIR)/protobuf_test-java_doc_comment_unittest.Po@am__quote@ # am--include-marker -@AMDEP_TRUE@@am__include@ @am__quote@google/protobuf/compiler/java/$(DEPDIR)/protobuf_test-java_plugin_unittest.Po@am__quote@ # am--include-marker -@AMDEP_TRUE@@am__include@ @am__quote@google/protobuf/compiler/js/$(DEPDIR)/js_generator.Plo@am__quote@ # am--include-marker -@AMDEP_TRUE@@am__include@ @am__quote@google/protobuf/compiler/js/$(DEPDIR)/well_known_types_embed.Plo@am__quote@ # am--include-marker -@AMDEP_TRUE@@am__include@ @am__quote@google/protobuf/compiler/objectivec/$(DEPDIR)/objectivec_enum.Plo@am__quote@ # am--include-marker -@AMDEP_TRUE@@am__include@ @am__quote@google/protobuf/compiler/objectivec/$(DEPDIR)/objectivec_enum_field.Plo@am__quote@ # am--include-marker -@AMDEP_TRUE@@am__include@ @am__quote@google/protobuf/compiler/objectivec/$(DEPDIR)/objectivec_extension.Plo@am__quote@ # am--include-marker -@AMDEP_TRUE@@am__include@ @am__quote@google/protobuf/compiler/objectivec/$(DEPDIR)/objectivec_field.Plo@am__quote@ # am--include-marker -@AMDEP_TRUE@@am__include@ @am__quote@google/protobuf/compiler/objectivec/$(DEPDIR)/objectivec_file.Plo@am__quote@ # am--include-marker -@AMDEP_TRUE@@am__include@ @am__quote@google/protobuf/compiler/objectivec/$(DEPDIR)/objectivec_generator.Plo@am__quote@ # am--include-marker -@AMDEP_TRUE@@am__include@ @am__quote@google/protobuf/compiler/objectivec/$(DEPDIR)/objectivec_helpers.Plo@am__quote@ # am--include-marker -@AMDEP_TRUE@@am__include@ @am__quote@google/protobuf/compiler/objectivec/$(DEPDIR)/objectivec_map_field.Plo@am__quote@ # am--include-marker -@AMDEP_TRUE@@am__include@ @am__quote@google/protobuf/compiler/objectivec/$(DEPDIR)/objectivec_message.Plo@am__quote@ # am--include-marker -@AMDEP_TRUE@@am__include@ @am__quote@google/protobuf/compiler/objectivec/$(DEPDIR)/objectivec_message_field.Plo@am__quote@ # am--include-marker -@AMDEP_TRUE@@am__include@ @am__quote@google/protobuf/compiler/objectivec/$(DEPDIR)/objectivec_oneof.Plo@am__quote@ # am--include-marker -@AMDEP_TRUE@@am__include@ @am__quote@google/protobuf/compiler/objectivec/$(DEPDIR)/objectivec_primitive_field.Plo@am__quote@ # am--include-marker -@AMDEP_TRUE@@am__include@ @am__quote@google/protobuf/compiler/objectivec/$(DEPDIR)/protobuf_test-objectivec_helpers_unittest.Po@am__quote@ # am--include-marker -@AMDEP_TRUE@@am__include@ @am__quote@google/protobuf/compiler/php/$(DEPDIR)/php_generator.Plo@am__quote@ # am--include-marker -@AMDEP_TRUE@@am__include@ @am__quote@google/protobuf/compiler/python/$(DEPDIR)/protobuf_test-python_plugin_unittest.Po@am__quote@ # am--include-marker -@AMDEP_TRUE@@am__include@ @am__quote@google/protobuf/compiler/python/$(DEPDIR)/python_generator.Plo@am__quote@ # am--include-marker -@AMDEP_TRUE@@am__include@ @am__quote@google/protobuf/compiler/ruby/$(DEPDIR)/protobuf_test-ruby_generator_unittest.Po@am__quote@ # am--include-marker -@AMDEP_TRUE@@am__include@ @am__quote@google/protobuf/compiler/ruby/$(DEPDIR)/ruby_generator.Plo@am__quote@ # am--include-marker -@AMDEP_TRUE@@am__include@ @am__quote@google/protobuf/io/$(DEPDIR)/coded_stream.Plo@am__quote@ # am--include-marker -@AMDEP_TRUE@@am__include@ @am__quote@google/protobuf/io/$(DEPDIR)/gzip_stream.Plo@am__quote@ # am--include-marker -@AMDEP_TRUE@@am__include@ @am__quote@google/protobuf/io/$(DEPDIR)/io_win32.Plo@am__quote@ # am--include-marker -@AMDEP_TRUE@@am__include@ @am__quote@google/protobuf/io/$(DEPDIR)/printer.Plo@am__quote@ # am--include-marker -@AMDEP_TRUE@@am__include@ @am__quote@google/protobuf/io/$(DEPDIR)/protobuf_test-coded_stream_unittest.Po@am__quote@ # am--include-marker -@AMDEP_TRUE@@am__include@ @am__quote@google/protobuf/io/$(DEPDIR)/protobuf_test-io_win32_unittest.Po@am__quote@ # am--include-marker -@AMDEP_TRUE@@am__include@ @am__quote@google/protobuf/io/$(DEPDIR)/protobuf_test-printer_unittest.Po@am__quote@ # am--include-marker -@AMDEP_TRUE@@am__include@ @am__quote@google/protobuf/io/$(DEPDIR)/protobuf_test-tokenizer_unittest.Po@am__quote@ # am--include-marker -@AMDEP_TRUE@@am__include@ @am__quote@google/protobuf/io/$(DEPDIR)/protobuf_test-zero_copy_stream_unittest.Po@am__quote@ # am--include-marker -@AMDEP_TRUE@@am__include@ @am__quote@google/protobuf/io/$(DEPDIR)/strtod.Plo@am__quote@ # am--include-marker -@AMDEP_TRUE@@am__include@ @am__quote@google/protobuf/io/$(DEPDIR)/tokenizer.Plo@am__quote@ # am--include-marker -@AMDEP_TRUE@@am__include@ @am__quote@google/protobuf/io/$(DEPDIR)/zero_copy_stream.Plo@am__quote@ # am--include-marker -@AMDEP_TRUE@@am__include@ @am__quote@google/protobuf/io/$(DEPDIR)/zero_copy_stream_impl.Plo@am__quote@ # am--include-marker -@AMDEP_TRUE@@am__include@ @am__quote@google/protobuf/io/$(DEPDIR)/zero_copy_stream_impl_lite.Plo@am__quote@ # am--include-marker -@AMDEP_TRUE@@am__include@ @am__quote@google/protobuf/stubs/$(DEPDIR)/bytestream.Plo@am__quote@ # am--include-marker -@AMDEP_TRUE@@am__include@ @am__quote@google/protobuf/stubs/$(DEPDIR)/common.Plo@am__quote@ # am--include-marker -@AMDEP_TRUE@@am__include@ @am__quote@google/protobuf/stubs/$(DEPDIR)/int128.Plo@am__quote@ # am--include-marker -@AMDEP_TRUE@@am__include@ @am__quote@google/protobuf/stubs/$(DEPDIR)/protobuf_test-bytestream_unittest.Po@am__quote@ # am--include-marker -@AMDEP_TRUE@@am__include@ @am__quote@google/protobuf/stubs/$(DEPDIR)/protobuf_test-common_unittest.Po@am__quote@ # am--include-marker -@AMDEP_TRUE@@am__include@ @am__quote@google/protobuf/stubs/$(DEPDIR)/protobuf_test-int128_unittest.Po@am__quote@ # am--include-marker -@AMDEP_TRUE@@am__include@ @am__quote@google/protobuf/stubs/$(DEPDIR)/protobuf_test-status_test.Po@am__quote@ # am--include-marker -@AMDEP_TRUE@@am__include@ @am__quote@google/protobuf/stubs/$(DEPDIR)/protobuf_test-statusor_test.Po@am__quote@ # am--include-marker -@AMDEP_TRUE@@am__include@ @am__quote@google/protobuf/stubs/$(DEPDIR)/protobuf_test-stringpiece_unittest.Po@am__quote@ # am--include-marker -@AMDEP_TRUE@@am__include@ @am__quote@google/protobuf/stubs/$(DEPDIR)/protobuf_test-stringprintf_unittest.Po@am__quote@ # am--include-marker -@AMDEP_TRUE@@am__include@ @am__quote@google/protobuf/stubs/$(DEPDIR)/protobuf_test-structurally_valid_unittest.Po@am__quote@ # am--include-marker -@AMDEP_TRUE@@am__include@ @am__quote@google/protobuf/stubs/$(DEPDIR)/protobuf_test-strutil_unittest.Po@am__quote@ # am--include-marker -@AMDEP_TRUE@@am__include@ @am__quote@google/protobuf/stubs/$(DEPDIR)/protobuf_test-template_util_unittest.Po@am__quote@ # am--include-marker -@AMDEP_TRUE@@am__include@ @am__quote@google/protobuf/stubs/$(DEPDIR)/protobuf_test-time_test.Po@am__quote@ # am--include-marker -@AMDEP_TRUE@@am__include@ @am__quote@google/protobuf/stubs/$(DEPDIR)/status.Plo@am__quote@ # am--include-marker -@AMDEP_TRUE@@am__include@ @am__quote@google/protobuf/stubs/$(DEPDIR)/statusor.Plo@am__quote@ # am--include-marker -@AMDEP_TRUE@@am__include@ @am__quote@google/protobuf/stubs/$(DEPDIR)/stringpiece.Plo@am__quote@ # am--include-marker -@AMDEP_TRUE@@am__include@ @am__quote@google/protobuf/stubs/$(DEPDIR)/stringprintf.Plo@am__quote@ # am--include-marker -@AMDEP_TRUE@@am__include@ @am__quote@google/protobuf/stubs/$(DEPDIR)/structurally_valid.Plo@am__quote@ # am--include-marker -@AMDEP_TRUE@@am__include@ @am__quote@google/protobuf/stubs/$(DEPDIR)/strutil.Plo@am__quote@ # am--include-marker -@AMDEP_TRUE@@am__include@ @am__quote@google/protobuf/stubs/$(DEPDIR)/substitute.Plo@am__quote@ # am--include-marker -@AMDEP_TRUE@@am__include@ @am__quote@google/protobuf/stubs/$(DEPDIR)/time.Plo@am__quote@ # am--include-marker -@AMDEP_TRUE@@am__include@ @am__quote@google/protobuf/testing/$(DEPDIR)/protobuf_lazy_descriptor_test-file.Po@am__quote@ # am--include-marker -@AMDEP_TRUE@@am__include@ @am__quote@google/protobuf/testing/$(DEPDIR)/protobuf_lazy_descriptor_test-googletest.Po@am__quote@ # am--include-marker -@AMDEP_TRUE@@am__include@ @am__quote@google/protobuf/testing/$(DEPDIR)/protobuf_test-file.Po@am__quote@ # am--include-marker -@AMDEP_TRUE@@am__include@ @am__quote@google/protobuf/testing/$(DEPDIR)/protobuf_test-googletest.Po@am__quote@ # am--include-marker -@AMDEP_TRUE@@am__include@ @am__quote@google/protobuf/testing/$(DEPDIR)/test_plugin-file.Po@am__quote@ # am--include-marker -@AMDEP_TRUE@@am__include@ @am__quote@google/protobuf/testing/$(DEPDIR)/zcgunzip.Po@am__quote@ # am--include-marker -@AMDEP_TRUE@@am__include@ @am__quote@google/protobuf/testing/$(DEPDIR)/zcgzip.Po@am__quote@ # am--include-marker -@AMDEP_TRUE@@am__include@ @am__quote@google/protobuf/util/$(DEPDIR)/delimited_message_util.Plo@am__quote@ # am--include-marker -@AMDEP_TRUE@@am__include@ @am__quote@google/protobuf/util/$(DEPDIR)/field_comparator.Plo@am__quote@ # am--include-marker -@AMDEP_TRUE@@am__include@ @am__quote@google/protobuf/util/$(DEPDIR)/field_mask_util.Plo@am__quote@ # am--include-marker -@AMDEP_TRUE@@am__include@ @am__quote@google/protobuf/util/$(DEPDIR)/json_util.Plo@am__quote@ # am--include-marker -@AMDEP_TRUE@@am__include@ @am__quote@google/protobuf/util/$(DEPDIR)/message_differencer.Plo@am__quote@ # am--include-marker -@AMDEP_TRUE@@am__include@ @am__quote@google/protobuf/util/$(DEPDIR)/no_warning_test-json_format.pb.Po@am__quote@ # am--include-marker -@AMDEP_TRUE@@am__include@ @am__quote@google/protobuf/util/$(DEPDIR)/no_warning_test-json_format_proto3.pb.Po@am__quote@ # am--include-marker -@AMDEP_TRUE@@am__include@ @am__quote@google/protobuf/util/$(DEPDIR)/no_warning_test-message_differencer_unittest.pb.Po@am__quote@ # am--include-marker -@AMDEP_TRUE@@am__include@ @am__quote@google/protobuf/util/$(DEPDIR)/protobuf_lazy_descriptor_test-json_format.pb.Po@am__quote@ # am--include-marker -@AMDEP_TRUE@@am__include@ @am__quote@google/protobuf/util/$(DEPDIR)/protobuf_lazy_descriptor_test-json_format_proto3.pb.Po@am__quote@ # am--include-marker -@AMDEP_TRUE@@am__include@ @am__quote@google/protobuf/util/$(DEPDIR)/protobuf_lazy_descriptor_test-message_differencer_unittest.pb.Po@am__quote@ # am--include-marker -@AMDEP_TRUE@@am__include@ @am__quote@google/protobuf/util/$(DEPDIR)/protobuf_test-delimited_message_util_test.Po@am__quote@ # am--include-marker -@AMDEP_TRUE@@am__include@ @am__quote@google/protobuf/util/$(DEPDIR)/protobuf_test-field_comparator_test.Po@am__quote@ # am--include-marker -@AMDEP_TRUE@@am__include@ @am__quote@google/protobuf/util/$(DEPDIR)/protobuf_test-field_mask_util_test.Po@am__quote@ # am--include-marker -@AMDEP_TRUE@@am__include@ @am__quote@google/protobuf/util/$(DEPDIR)/protobuf_test-json_format.pb.Po@am__quote@ # am--include-marker -@AMDEP_TRUE@@am__include@ @am__quote@google/protobuf/util/$(DEPDIR)/protobuf_test-json_format_proto3.pb.Po@am__quote@ # am--include-marker -@AMDEP_TRUE@@am__include@ @am__quote@google/protobuf/util/$(DEPDIR)/protobuf_test-json_util_test.Po@am__quote@ # am--include-marker -@AMDEP_TRUE@@am__include@ @am__quote@google/protobuf/util/$(DEPDIR)/protobuf_test-message_differencer_unittest.Po@am__quote@ # am--include-marker -@AMDEP_TRUE@@am__include@ @am__quote@google/protobuf/util/$(DEPDIR)/protobuf_test-message_differencer_unittest.pb.Po@am__quote@ # am--include-marker -@AMDEP_TRUE@@am__include@ @am__quote@google/protobuf/util/$(DEPDIR)/protobuf_test-time_util_test.Po@am__quote@ # am--include-marker -@AMDEP_TRUE@@am__include@ @am__quote@google/protobuf/util/$(DEPDIR)/protobuf_test-type_resolver_util_test.Po@am__quote@ # am--include-marker -@AMDEP_TRUE@@am__include@ @am__quote@google/protobuf/util/$(DEPDIR)/time_util.Plo@am__quote@ # am--include-marker -@AMDEP_TRUE@@am__include@ @am__quote@google/protobuf/util/$(DEPDIR)/type_resolver_util.Plo@am__quote@ # am--include-marker -@AMDEP_TRUE@@am__include@ @am__quote@google/protobuf/util/internal/$(DEPDIR)/datapiece.Plo@am__quote@ # am--include-marker -@AMDEP_TRUE@@am__include@ @am__quote@google/protobuf/util/internal/$(DEPDIR)/default_value_objectwriter.Plo@am__quote@ # am--include-marker -@AMDEP_TRUE@@am__include@ @am__quote@google/protobuf/util/internal/$(DEPDIR)/error_listener.Plo@am__quote@ # am--include-marker -@AMDEP_TRUE@@am__include@ @am__quote@google/protobuf/util/internal/$(DEPDIR)/field_mask_utility.Plo@am__quote@ # am--include-marker -@AMDEP_TRUE@@am__include@ @am__quote@google/protobuf/util/internal/$(DEPDIR)/json_escaping.Plo@am__quote@ # am--include-marker -@AMDEP_TRUE@@am__include@ @am__quote@google/protobuf/util/internal/$(DEPDIR)/json_objectwriter.Plo@am__quote@ # am--include-marker -@AMDEP_TRUE@@am__include@ @am__quote@google/protobuf/util/internal/$(DEPDIR)/json_stream_parser.Plo@am__quote@ # am--include-marker -@AMDEP_TRUE@@am__include@ @am__quote@google/protobuf/util/internal/$(DEPDIR)/object_writer.Plo@am__quote@ # am--include-marker -@AMDEP_TRUE@@am__include@ @am__quote@google/protobuf/util/internal/$(DEPDIR)/proto_writer.Plo@am__quote@ # am--include-marker -@AMDEP_TRUE@@am__include@ @am__quote@google/protobuf/util/internal/$(DEPDIR)/protobuf_test-default_value_objectwriter_test.Po@am__quote@ # am--include-marker -@AMDEP_TRUE@@am__include@ @am__quote@google/protobuf/util/internal/$(DEPDIR)/protobuf_test-json_objectwriter_test.Po@am__quote@ # am--include-marker -@AMDEP_TRUE@@am__include@ @am__quote@google/protobuf/util/internal/$(DEPDIR)/protobuf_test-json_stream_parser_test.Po@am__quote@ # am--include-marker -@AMDEP_TRUE@@am__include@ @am__quote@google/protobuf/util/internal/$(DEPDIR)/protobuf_test-protostream_objectsource_test.Po@am__quote@ # am--include-marker -@AMDEP_TRUE@@am__include@ @am__quote@google/protobuf/util/internal/$(DEPDIR)/protobuf_test-protostream_objectwriter_test.Po@am__quote@ # am--include-marker -@AMDEP_TRUE@@am__include@ @am__quote@google/protobuf/util/internal/$(DEPDIR)/protobuf_test-type_info_test_helper.Po@am__quote@ # am--include-marker -@AMDEP_TRUE@@am__include@ @am__quote@google/protobuf/util/internal/$(DEPDIR)/protostream_objectsource.Plo@am__quote@ # am--include-marker -@AMDEP_TRUE@@am__include@ @am__quote@google/protobuf/util/internal/$(DEPDIR)/protostream_objectwriter.Plo@am__quote@ # am--include-marker -@AMDEP_TRUE@@am__include@ @am__quote@google/protobuf/util/internal/$(DEPDIR)/type_info.Plo@am__quote@ # am--include-marker -@AMDEP_TRUE@@am__include@ @am__quote@google/protobuf/util/internal/$(DEPDIR)/utility.Plo@am__quote@ # am--include-marker -@AMDEP_TRUE@@am__include@ @am__quote@google/protobuf/util/internal/testdata/$(DEPDIR)/no_warning_test-anys.pb.Po@am__quote@ # am--include-marker -@AMDEP_TRUE@@am__include@ @am__quote@google/protobuf/util/internal/testdata/$(DEPDIR)/no_warning_test-books.pb.Po@am__quote@ # am--include-marker -@AMDEP_TRUE@@am__include@ @am__quote@google/protobuf/util/internal/testdata/$(DEPDIR)/no_warning_test-default_value.pb.Po@am__quote@ # am--include-marker -@AMDEP_TRUE@@am__include@ @am__quote@google/protobuf/util/internal/testdata/$(DEPDIR)/no_warning_test-default_value_test.pb.Po@am__quote@ # am--include-marker -@AMDEP_TRUE@@am__include@ @am__quote@google/protobuf/util/internal/testdata/$(DEPDIR)/no_warning_test-field_mask.pb.Po@am__quote@ # am--include-marker -@AMDEP_TRUE@@am__include@ @am__quote@google/protobuf/util/internal/testdata/$(DEPDIR)/no_warning_test-maps.pb.Po@am__quote@ # am--include-marker -@AMDEP_TRUE@@am__include@ @am__quote@google/protobuf/util/internal/testdata/$(DEPDIR)/no_warning_test-oneofs.pb.Po@am__quote@ # am--include-marker -@AMDEP_TRUE@@am__include@ @am__quote@google/protobuf/util/internal/testdata/$(DEPDIR)/no_warning_test-proto3.pb.Po@am__quote@ # am--include-marker -@AMDEP_TRUE@@am__include@ @am__quote@google/protobuf/util/internal/testdata/$(DEPDIR)/no_warning_test-struct.pb.Po@am__quote@ # am--include-marker -@AMDEP_TRUE@@am__include@ @am__quote@google/protobuf/util/internal/testdata/$(DEPDIR)/no_warning_test-timestamp_duration.pb.Po@am__quote@ # am--include-marker -@AMDEP_TRUE@@am__include@ @am__quote@google/protobuf/util/internal/testdata/$(DEPDIR)/no_warning_test-wrappers.pb.Po@am__quote@ # am--include-marker -@AMDEP_TRUE@@am__include@ @am__quote@google/protobuf/util/internal/testdata/$(DEPDIR)/protobuf_lazy_descriptor_test-anys.pb.Po@am__quote@ # am--include-marker -@AMDEP_TRUE@@am__include@ @am__quote@google/protobuf/util/internal/testdata/$(DEPDIR)/protobuf_lazy_descriptor_test-books.pb.Po@am__quote@ # am--include-marker -@AMDEP_TRUE@@am__include@ @am__quote@google/protobuf/util/internal/testdata/$(DEPDIR)/protobuf_lazy_descriptor_test-default_value.pb.Po@am__quote@ # am--include-marker -@AMDEP_TRUE@@am__include@ @am__quote@google/protobuf/util/internal/testdata/$(DEPDIR)/protobuf_lazy_descriptor_test-default_value_test.pb.Po@am__quote@ # am--include-marker -@AMDEP_TRUE@@am__include@ @am__quote@google/protobuf/util/internal/testdata/$(DEPDIR)/protobuf_lazy_descriptor_test-field_mask.pb.Po@am__quote@ # am--include-marker -@AMDEP_TRUE@@am__include@ @am__quote@google/protobuf/util/internal/testdata/$(DEPDIR)/protobuf_lazy_descriptor_test-maps.pb.Po@am__quote@ # am--include-marker -@AMDEP_TRUE@@am__include@ @am__quote@google/protobuf/util/internal/testdata/$(DEPDIR)/protobuf_lazy_descriptor_test-oneofs.pb.Po@am__quote@ # am--include-marker -@AMDEP_TRUE@@am__include@ @am__quote@google/protobuf/util/internal/testdata/$(DEPDIR)/protobuf_lazy_descriptor_test-proto3.pb.Po@am__quote@ # am--include-marker -@AMDEP_TRUE@@am__include@ @am__quote@google/protobuf/util/internal/testdata/$(DEPDIR)/protobuf_lazy_descriptor_test-struct.pb.Po@am__quote@ # am--include-marker -@AMDEP_TRUE@@am__include@ @am__quote@google/protobuf/util/internal/testdata/$(DEPDIR)/protobuf_lazy_descriptor_test-timestamp_duration.pb.Po@am__quote@ # am--include-marker -@AMDEP_TRUE@@am__include@ @am__quote@google/protobuf/util/internal/testdata/$(DEPDIR)/protobuf_lazy_descriptor_test-wrappers.pb.Po@am__quote@ # am--include-marker -@AMDEP_TRUE@@am__include@ @am__quote@google/protobuf/util/internal/testdata/$(DEPDIR)/protobuf_test-anys.pb.Po@am__quote@ # am--include-marker -@AMDEP_TRUE@@am__include@ @am__quote@google/protobuf/util/internal/testdata/$(DEPDIR)/protobuf_test-books.pb.Po@am__quote@ # am--include-marker -@AMDEP_TRUE@@am__include@ @am__quote@google/protobuf/util/internal/testdata/$(DEPDIR)/protobuf_test-default_value.pb.Po@am__quote@ # am--include-marker -@AMDEP_TRUE@@am__include@ @am__quote@google/protobuf/util/internal/testdata/$(DEPDIR)/protobuf_test-default_value_test.pb.Po@am__quote@ # am--include-marker -@AMDEP_TRUE@@am__include@ @am__quote@google/protobuf/util/internal/testdata/$(DEPDIR)/protobuf_test-field_mask.pb.Po@am__quote@ # am--include-marker -@AMDEP_TRUE@@am__include@ @am__quote@google/protobuf/util/internal/testdata/$(DEPDIR)/protobuf_test-maps.pb.Po@am__quote@ # am--include-marker -@AMDEP_TRUE@@am__include@ @am__quote@google/protobuf/util/internal/testdata/$(DEPDIR)/protobuf_test-oneofs.pb.Po@am__quote@ # am--include-marker -@AMDEP_TRUE@@am__include@ @am__quote@google/protobuf/util/internal/testdata/$(DEPDIR)/protobuf_test-proto3.pb.Po@am__quote@ # am--include-marker -@AMDEP_TRUE@@am__include@ @am__quote@google/protobuf/util/internal/testdata/$(DEPDIR)/protobuf_test-struct.pb.Po@am__quote@ # am--include-marker -@AMDEP_TRUE@@am__include@ @am__quote@google/protobuf/util/internal/testdata/$(DEPDIR)/protobuf_test-timestamp_duration.pb.Po@am__quote@ # am--include-marker -@AMDEP_TRUE@@am__include@ @am__quote@google/protobuf/util/internal/testdata/$(DEPDIR)/protobuf_test-wrappers.pb.Po@am__quote@ # am--include-marker - -$(am__depfiles_remade): - @$(MKDIR_P) $(@D) - @echo '# dummy' >$@-t && $(am__mv) $@-t $@ - -am--depfiles: $(am__depfiles_remade) - -.cc.o: -@am__fastdepCXX_TRUE@ $(AM_V_CXX)depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.o$$||'`;\ -@am__fastdepCXX_TRUE@ $(CXXCOMPILE) -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ $< &&\ -@am__fastdepCXX_TRUE@ $(am__mv) $$depbase.Tpo $$depbase.Po -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXXCOMPILE) -c -o $@ $< - -.cc.obj: -@am__fastdepCXX_TRUE@ $(AM_V_CXX)depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.obj$$||'`;\ -@am__fastdepCXX_TRUE@ $(CXXCOMPILE) -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ `$(CYGPATH_W) '$<'` &&\ -@am__fastdepCXX_TRUE@ $(am__mv) $$depbase.Tpo $$depbase.Po -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXXCOMPILE) -c -o $@ `$(CYGPATH_W) '$<'` - -.cc.lo: -@am__fastdepCXX_TRUE@ $(AM_V_CXX)depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.lo$$||'`;\ -@am__fastdepCXX_TRUE@ $(LTCXXCOMPILE) -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ $< &&\ -@am__fastdepCXX_TRUE@ $(am__mv) $$depbase.Tpo $$depbase.Plo -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(LTCXXCOMPILE) -c -o $@ $< - -no_warning_test-no_warning_test.o: no_warning_test.cc -@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(no_warning_test_CXXFLAGS) $(CXXFLAGS) -MT no_warning_test-no_warning_test.o -MD -MP -MF $(DEPDIR)/no_warning_test-no_warning_test.Tpo -c -o no_warning_test-no_warning_test.o `test -f 'no_warning_test.cc' || echo '$(srcdir)/'`no_warning_test.cc -@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/no_warning_test-no_warning_test.Tpo $(DEPDIR)/no_warning_test-no_warning_test.Po -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='no_warning_test.cc' object='no_warning_test-no_warning_test.o' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(no_warning_test_CXXFLAGS) $(CXXFLAGS) -c -o no_warning_test-no_warning_test.o `test -f 'no_warning_test.cc' || echo '$(srcdir)/'`no_warning_test.cc - -no_warning_test-no_warning_test.obj: no_warning_test.cc -@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(no_warning_test_CXXFLAGS) $(CXXFLAGS) -MT no_warning_test-no_warning_test.obj -MD -MP -MF $(DEPDIR)/no_warning_test-no_warning_test.Tpo -c -o no_warning_test-no_warning_test.obj `if test -f 'no_warning_test.cc'; then $(CYGPATH_W) 'no_warning_test.cc'; else $(CYGPATH_W) '$(srcdir)/no_warning_test.cc'; fi` -@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/no_warning_test-no_warning_test.Tpo $(DEPDIR)/no_warning_test-no_warning_test.Po -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='no_warning_test.cc' object='no_warning_test-no_warning_test.obj' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(no_warning_test_CXXFLAGS) $(CXXFLAGS) -c -o no_warning_test-no_warning_test.obj `if test -f 'no_warning_test.cc'; then $(CYGPATH_W) 'no_warning_test.cc'; else $(CYGPATH_W) '$(srcdir)/no_warning_test.cc'; fi` - -google/protobuf/no_warning_test-map_lite_unittest.pb.o: google/protobuf/map_lite_unittest.pb.cc -@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(no_warning_test_CXXFLAGS) $(CXXFLAGS) -MT google/protobuf/no_warning_test-map_lite_unittest.pb.o -MD -MP -MF google/protobuf/$(DEPDIR)/no_warning_test-map_lite_unittest.pb.Tpo -c -o google/protobuf/no_warning_test-map_lite_unittest.pb.o `test -f 'google/protobuf/map_lite_unittest.pb.cc' || echo '$(srcdir)/'`google/protobuf/map_lite_unittest.pb.cc -@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) google/protobuf/$(DEPDIR)/no_warning_test-map_lite_unittest.pb.Tpo google/protobuf/$(DEPDIR)/no_warning_test-map_lite_unittest.pb.Po -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='google/protobuf/map_lite_unittest.pb.cc' object='google/protobuf/no_warning_test-map_lite_unittest.pb.o' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(no_warning_test_CXXFLAGS) $(CXXFLAGS) -c -o google/protobuf/no_warning_test-map_lite_unittest.pb.o `test -f 'google/protobuf/map_lite_unittest.pb.cc' || echo '$(srcdir)/'`google/protobuf/map_lite_unittest.pb.cc - -google/protobuf/no_warning_test-map_lite_unittest.pb.obj: google/protobuf/map_lite_unittest.pb.cc -@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(no_warning_test_CXXFLAGS) $(CXXFLAGS) -MT google/protobuf/no_warning_test-map_lite_unittest.pb.obj -MD -MP -MF google/protobuf/$(DEPDIR)/no_warning_test-map_lite_unittest.pb.Tpo -c -o google/protobuf/no_warning_test-map_lite_unittest.pb.obj `if test -f 'google/protobuf/map_lite_unittest.pb.cc'; then $(CYGPATH_W) 'google/protobuf/map_lite_unittest.pb.cc'; else $(CYGPATH_W) '$(srcdir)/google/protobuf/map_lite_unittest.pb.cc'; fi` -@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) google/protobuf/$(DEPDIR)/no_warning_test-map_lite_unittest.pb.Tpo google/protobuf/$(DEPDIR)/no_warning_test-map_lite_unittest.pb.Po -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='google/protobuf/map_lite_unittest.pb.cc' object='google/protobuf/no_warning_test-map_lite_unittest.pb.obj' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(no_warning_test_CXXFLAGS) $(CXXFLAGS) -c -o google/protobuf/no_warning_test-map_lite_unittest.pb.obj `if test -f 'google/protobuf/map_lite_unittest.pb.cc'; then $(CYGPATH_W) 'google/protobuf/map_lite_unittest.pb.cc'; else $(CYGPATH_W) '$(srcdir)/google/protobuf/map_lite_unittest.pb.cc'; fi` - -google/protobuf/no_warning_test-unittest_import_lite.pb.o: google/protobuf/unittest_import_lite.pb.cc -@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(no_warning_test_CXXFLAGS) $(CXXFLAGS) -MT google/protobuf/no_warning_test-unittest_import_lite.pb.o -MD -MP -MF google/protobuf/$(DEPDIR)/no_warning_test-unittest_import_lite.pb.Tpo -c -o google/protobuf/no_warning_test-unittest_import_lite.pb.o `test -f 'google/protobuf/unittest_import_lite.pb.cc' || echo '$(srcdir)/'`google/protobuf/unittest_import_lite.pb.cc -@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) google/protobuf/$(DEPDIR)/no_warning_test-unittest_import_lite.pb.Tpo google/protobuf/$(DEPDIR)/no_warning_test-unittest_import_lite.pb.Po -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='google/protobuf/unittest_import_lite.pb.cc' object='google/protobuf/no_warning_test-unittest_import_lite.pb.o' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(no_warning_test_CXXFLAGS) $(CXXFLAGS) -c -o google/protobuf/no_warning_test-unittest_import_lite.pb.o `test -f 'google/protobuf/unittest_import_lite.pb.cc' || echo '$(srcdir)/'`google/protobuf/unittest_import_lite.pb.cc - -google/protobuf/no_warning_test-unittest_import_lite.pb.obj: google/protobuf/unittest_import_lite.pb.cc -@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(no_warning_test_CXXFLAGS) $(CXXFLAGS) -MT google/protobuf/no_warning_test-unittest_import_lite.pb.obj -MD -MP -MF google/protobuf/$(DEPDIR)/no_warning_test-unittest_import_lite.pb.Tpo -c -o google/protobuf/no_warning_test-unittest_import_lite.pb.obj `if test -f 'google/protobuf/unittest_import_lite.pb.cc'; then $(CYGPATH_W) 'google/protobuf/unittest_import_lite.pb.cc'; else $(CYGPATH_W) '$(srcdir)/google/protobuf/unittest_import_lite.pb.cc'; fi` -@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) google/protobuf/$(DEPDIR)/no_warning_test-unittest_import_lite.pb.Tpo google/protobuf/$(DEPDIR)/no_warning_test-unittest_import_lite.pb.Po -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='google/protobuf/unittest_import_lite.pb.cc' object='google/protobuf/no_warning_test-unittest_import_lite.pb.obj' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(no_warning_test_CXXFLAGS) $(CXXFLAGS) -c -o google/protobuf/no_warning_test-unittest_import_lite.pb.obj `if test -f 'google/protobuf/unittest_import_lite.pb.cc'; then $(CYGPATH_W) 'google/protobuf/unittest_import_lite.pb.cc'; else $(CYGPATH_W) '$(srcdir)/google/protobuf/unittest_import_lite.pb.cc'; fi` - -google/protobuf/no_warning_test-unittest_import_public_lite.pb.o: google/protobuf/unittest_import_public_lite.pb.cc -@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(no_warning_test_CXXFLAGS) $(CXXFLAGS) -MT google/protobuf/no_warning_test-unittest_import_public_lite.pb.o -MD -MP -MF google/protobuf/$(DEPDIR)/no_warning_test-unittest_import_public_lite.pb.Tpo -c -o google/protobuf/no_warning_test-unittest_import_public_lite.pb.o `test -f 'google/protobuf/unittest_import_public_lite.pb.cc' || echo '$(srcdir)/'`google/protobuf/unittest_import_public_lite.pb.cc -@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) google/protobuf/$(DEPDIR)/no_warning_test-unittest_import_public_lite.pb.Tpo google/protobuf/$(DEPDIR)/no_warning_test-unittest_import_public_lite.pb.Po -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='google/protobuf/unittest_import_public_lite.pb.cc' object='google/protobuf/no_warning_test-unittest_import_public_lite.pb.o' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(no_warning_test_CXXFLAGS) $(CXXFLAGS) -c -o google/protobuf/no_warning_test-unittest_import_public_lite.pb.o `test -f 'google/protobuf/unittest_import_public_lite.pb.cc' || echo '$(srcdir)/'`google/protobuf/unittest_import_public_lite.pb.cc - -google/protobuf/no_warning_test-unittest_import_public_lite.pb.obj: google/protobuf/unittest_import_public_lite.pb.cc -@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(no_warning_test_CXXFLAGS) $(CXXFLAGS) -MT google/protobuf/no_warning_test-unittest_import_public_lite.pb.obj -MD -MP -MF google/protobuf/$(DEPDIR)/no_warning_test-unittest_import_public_lite.pb.Tpo -c -o google/protobuf/no_warning_test-unittest_import_public_lite.pb.obj `if test -f 'google/protobuf/unittest_import_public_lite.pb.cc'; then $(CYGPATH_W) 'google/protobuf/unittest_import_public_lite.pb.cc'; else $(CYGPATH_W) '$(srcdir)/google/protobuf/unittest_import_public_lite.pb.cc'; fi` -@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) google/protobuf/$(DEPDIR)/no_warning_test-unittest_import_public_lite.pb.Tpo google/protobuf/$(DEPDIR)/no_warning_test-unittest_import_public_lite.pb.Po -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='google/protobuf/unittest_import_public_lite.pb.cc' object='google/protobuf/no_warning_test-unittest_import_public_lite.pb.obj' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(no_warning_test_CXXFLAGS) $(CXXFLAGS) -c -o google/protobuf/no_warning_test-unittest_import_public_lite.pb.obj `if test -f 'google/protobuf/unittest_import_public_lite.pb.cc'; then $(CYGPATH_W) 'google/protobuf/unittest_import_public_lite.pb.cc'; else $(CYGPATH_W) '$(srcdir)/google/protobuf/unittest_import_public_lite.pb.cc'; fi` - -google/protobuf/no_warning_test-unittest_lite.pb.o: google/protobuf/unittest_lite.pb.cc -@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(no_warning_test_CXXFLAGS) $(CXXFLAGS) -MT google/protobuf/no_warning_test-unittest_lite.pb.o -MD -MP -MF google/protobuf/$(DEPDIR)/no_warning_test-unittest_lite.pb.Tpo -c -o google/protobuf/no_warning_test-unittest_lite.pb.o `test -f 'google/protobuf/unittest_lite.pb.cc' || echo '$(srcdir)/'`google/protobuf/unittest_lite.pb.cc -@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) google/protobuf/$(DEPDIR)/no_warning_test-unittest_lite.pb.Tpo google/protobuf/$(DEPDIR)/no_warning_test-unittest_lite.pb.Po -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='google/protobuf/unittest_lite.pb.cc' object='google/protobuf/no_warning_test-unittest_lite.pb.o' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(no_warning_test_CXXFLAGS) $(CXXFLAGS) -c -o google/protobuf/no_warning_test-unittest_lite.pb.o `test -f 'google/protobuf/unittest_lite.pb.cc' || echo '$(srcdir)/'`google/protobuf/unittest_lite.pb.cc - -google/protobuf/no_warning_test-unittest_lite.pb.obj: google/protobuf/unittest_lite.pb.cc -@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(no_warning_test_CXXFLAGS) $(CXXFLAGS) -MT google/protobuf/no_warning_test-unittest_lite.pb.obj -MD -MP -MF google/protobuf/$(DEPDIR)/no_warning_test-unittest_lite.pb.Tpo -c -o google/protobuf/no_warning_test-unittest_lite.pb.obj `if test -f 'google/protobuf/unittest_lite.pb.cc'; then $(CYGPATH_W) 'google/protobuf/unittest_lite.pb.cc'; else $(CYGPATH_W) '$(srcdir)/google/protobuf/unittest_lite.pb.cc'; fi` -@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) google/protobuf/$(DEPDIR)/no_warning_test-unittest_lite.pb.Tpo google/protobuf/$(DEPDIR)/no_warning_test-unittest_lite.pb.Po -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='google/protobuf/unittest_lite.pb.cc' object='google/protobuf/no_warning_test-unittest_lite.pb.obj' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(no_warning_test_CXXFLAGS) $(CXXFLAGS) -c -o google/protobuf/no_warning_test-unittest_lite.pb.obj `if test -f 'google/protobuf/unittest_lite.pb.cc'; then $(CYGPATH_W) 'google/protobuf/unittest_lite.pb.cc'; else $(CYGPATH_W) '$(srcdir)/google/protobuf/unittest_lite.pb.cc'; fi` - -google/protobuf/no_warning_test-any_test.pb.o: google/protobuf/any_test.pb.cc -@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(no_warning_test_CXXFLAGS) $(CXXFLAGS) -MT google/protobuf/no_warning_test-any_test.pb.o -MD -MP -MF google/protobuf/$(DEPDIR)/no_warning_test-any_test.pb.Tpo -c -o google/protobuf/no_warning_test-any_test.pb.o `test -f 'google/protobuf/any_test.pb.cc' || echo '$(srcdir)/'`google/protobuf/any_test.pb.cc -@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) google/protobuf/$(DEPDIR)/no_warning_test-any_test.pb.Tpo google/protobuf/$(DEPDIR)/no_warning_test-any_test.pb.Po -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='google/protobuf/any_test.pb.cc' object='google/protobuf/no_warning_test-any_test.pb.o' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(no_warning_test_CXXFLAGS) $(CXXFLAGS) -c -o google/protobuf/no_warning_test-any_test.pb.o `test -f 'google/protobuf/any_test.pb.cc' || echo '$(srcdir)/'`google/protobuf/any_test.pb.cc - -google/protobuf/no_warning_test-any_test.pb.obj: google/protobuf/any_test.pb.cc -@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(no_warning_test_CXXFLAGS) $(CXXFLAGS) -MT google/protobuf/no_warning_test-any_test.pb.obj -MD -MP -MF google/protobuf/$(DEPDIR)/no_warning_test-any_test.pb.Tpo -c -o google/protobuf/no_warning_test-any_test.pb.obj `if test -f 'google/protobuf/any_test.pb.cc'; then $(CYGPATH_W) 'google/protobuf/any_test.pb.cc'; else $(CYGPATH_W) '$(srcdir)/google/protobuf/any_test.pb.cc'; fi` -@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) google/protobuf/$(DEPDIR)/no_warning_test-any_test.pb.Tpo google/protobuf/$(DEPDIR)/no_warning_test-any_test.pb.Po -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='google/protobuf/any_test.pb.cc' object='google/protobuf/no_warning_test-any_test.pb.obj' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(no_warning_test_CXXFLAGS) $(CXXFLAGS) -c -o google/protobuf/no_warning_test-any_test.pb.obj `if test -f 'google/protobuf/any_test.pb.cc'; then $(CYGPATH_W) 'google/protobuf/any_test.pb.cc'; else $(CYGPATH_W) '$(srcdir)/google/protobuf/any_test.pb.cc'; fi` - -google/protobuf/compiler/cpp/no_warning_test-cpp_test_bad_identifiers.pb.o: google/protobuf/compiler/cpp/cpp_test_bad_identifiers.pb.cc -@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(no_warning_test_CXXFLAGS) $(CXXFLAGS) -MT google/protobuf/compiler/cpp/no_warning_test-cpp_test_bad_identifiers.pb.o -MD -MP -MF google/protobuf/compiler/cpp/$(DEPDIR)/no_warning_test-cpp_test_bad_identifiers.pb.Tpo -c -o google/protobuf/compiler/cpp/no_warning_test-cpp_test_bad_identifiers.pb.o `test -f 'google/protobuf/compiler/cpp/cpp_test_bad_identifiers.pb.cc' || echo '$(srcdir)/'`google/protobuf/compiler/cpp/cpp_test_bad_identifiers.pb.cc -@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) google/protobuf/compiler/cpp/$(DEPDIR)/no_warning_test-cpp_test_bad_identifiers.pb.Tpo google/protobuf/compiler/cpp/$(DEPDIR)/no_warning_test-cpp_test_bad_identifiers.pb.Po -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='google/protobuf/compiler/cpp/cpp_test_bad_identifiers.pb.cc' object='google/protobuf/compiler/cpp/no_warning_test-cpp_test_bad_identifiers.pb.o' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(no_warning_test_CXXFLAGS) $(CXXFLAGS) -c -o google/protobuf/compiler/cpp/no_warning_test-cpp_test_bad_identifiers.pb.o `test -f 'google/protobuf/compiler/cpp/cpp_test_bad_identifiers.pb.cc' || echo '$(srcdir)/'`google/protobuf/compiler/cpp/cpp_test_bad_identifiers.pb.cc - -google/protobuf/compiler/cpp/no_warning_test-cpp_test_bad_identifiers.pb.obj: google/protobuf/compiler/cpp/cpp_test_bad_identifiers.pb.cc -@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(no_warning_test_CXXFLAGS) $(CXXFLAGS) -MT google/protobuf/compiler/cpp/no_warning_test-cpp_test_bad_identifiers.pb.obj -MD -MP -MF google/protobuf/compiler/cpp/$(DEPDIR)/no_warning_test-cpp_test_bad_identifiers.pb.Tpo -c -o google/protobuf/compiler/cpp/no_warning_test-cpp_test_bad_identifiers.pb.obj `if test -f 'google/protobuf/compiler/cpp/cpp_test_bad_identifiers.pb.cc'; then $(CYGPATH_W) 'google/protobuf/compiler/cpp/cpp_test_bad_identifiers.pb.cc'; else $(CYGPATH_W) '$(srcdir)/google/protobuf/compiler/cpp/cpp_test_bad_identifiers.pb.cc'; fi` -@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) google/protobuf/compiler/cpp/$(DEPDIR)/no_warning_test-cpp_test_bad_identifiers.pb.Tpo google/protobuf/compiler/cpp/$(DEPDIR)/no_warning_test-cpp_test_bad_identifiers.pb.Po -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='google/protobuf/compiler/cpp/cpp_test_bad_identifiers.pb.cc' object='google/protobuf/compiler/cpp/no_warning_test-cpp_test_bad_identifiers.pb.obj' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(no_warning_test_CXXFLAGS) $(CXXFLAGS) -c -o google/protobuf/compiler/cpp/no_warning_test-cpp_test_bad_identifiers.pb.obj `if test -f 'google/protobuf/compiler/cpp/cpp_test_bad_identifiers.pb.cc'; then $(CYGPATH_W) 'google/protobuf/compiler/cpp/cpp_test_bad_identifiers.pb.cc'; else $(CYGPATH_W) '$(srcdir)/google/protobuf/compiler/cpp/cpp_test_bad_identifiers.pb.cc'; fi` - -google/protobuf/compiler/cpp/no_warning_test-cpp_test_large_enum_value.pb.o: google/protobuf/compiler/cpp/cpp_test_large_enum_value.pb.cc -@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(no_warning_test_CXXFLAGS) $(CXXFLAGS) -MT google/protobuf/compiler/cpp/no_warning_test-cpp_test_large_enum_value.pb.o -MD -MP -MF google/protobuf/compiler/cpp/$(DEPDIR)/no_warning_test-cpp_test_large_enum_value.pb.Tpo -c -o google/protobuf/compiler/cpp/no_warning_test-cpp_test_large_enum_value.pb.o `test -f 'google/protobuf/compiler/cpp/cpp_test_large_enum_value.pb.cc' || echo '$(srcdir)/'`google/protobuf/compiler/cpp/cpp_test_large_enum_value.pb.cc -@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) google/protobuf/compiler/cpp/$(DEPDIR)/no_warning_test-cpp_test_large_enum_value.pb.Tpo google/protobuf/compiler/cpp/$(DEPDIR)/no_warning_test-cpp_test_large_enum_value.pb.Po -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='google/protobuf/compiler/cpp/cpp_test_large_enum_value.pb.cc' object='google/protobuf/compiler/cpp/no_warning_test-cpp_test_large_enum_value.pb.o' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(no_warning_test_CXXFLAGS) $(CXXFLAGS) -c -o google/protobuf/compiler/cpp/no_warning_test-cpp_test_large_enum_value.pb.o `test -f 'google/protobuf/compiler/cpp/cpp_test_large_enum_value.pb.cc' || echo '$(srcdir)/'`google/protobuf/compiler/cpp/cpp_test_large_enum_value.pb.cc - -google/protobuf/compiler/cpp/no_warning_test-cpp_test_large_enum_value.pb.obj: google/protobuf/compiler/cpp/cpp_test_large_enum_value.pb.cc -@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(no_warning_test_CXXFLAGS) $(CXXFLAGS) -MT google/protobuf/compiler/cpp/no_warning_test-cpp_test_large_enum_value.pb.obj -MD -MP -MF google/protobuf/compiler/cpp/$(DEPDIR)/no_warning_test-cpp_test_large_enum_value.pb.Tpo -c -o google/protobuf/compiler/cpp/no_warning_test-cpp_test_large_enum_value.pb.obj `if test -f 'google/protobuf/compiler/cpp/cpp_test_large_enum_value.pb.cc'; then $(CYGPATH_W) 'google/protobuf/compiler/cpp/cpp_test_large_enum_value.pb.cc'; else $(CYGPATH_W) '$(srcdir)/google/protobuf/compiler/cpp/cpp_test_large_enum_value.pb.cc'; fi` -@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) google/protobuf/compiler/cpp/$(DEPDIR)/no_warning_test-cpp_test_large_enum_value.pb.Tpo google/protobuf/compiler/cpp/$(DEPDIR)/no_warning_test-cpp_test_large_enum_value.pb.Po -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='google/protobuf/compiler/cpp/cpp_test_large_enum_value.pb.cc' object='google/protobuf/compiler/cpp/no_warning_test-cpp_test_large_enum_value.pb.obj' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(no_warning_test_CXXFLAGS) $(CXXFLAGS) -c -o google/protobuf/compiler/cpp/no_warning_test-cpp_test_large_enum_value.pb.obj `if test -f 'google/protobuf/compiler/cpp/cpp_test_large_enum_value.pb.cc'; then $(CYGPATH_W) 'google/protobuf/compiler/cpp/cpp_test_large_enum_value.pb.cc'; else $(CYGPATH_W) '$(srcdir)/google/protobuf/compiler/cpp/cpp_test_large_enum_value.pb.cc'; fi` - -google/protobuf/no_warning_test-map_proto2_unittest.pb.o: google/protobuf/map_proto2_unittest.pb.cc -@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(no_warning_test_CXXFLAGS) $(CXXFLAGS) -MT google/protobuf/no_warning_test-map_proto2_unittest.pb.o -MD -MP -MF google/protobuf/$(DEPDIR)/no_warning_test-map_proto2_unittest.pb.Tpo -c -o google/protobuf/no_warning_test-map_proto2_unittest.pb.o `test -f 'google/protobuf/map_proto2_unittest.pb.cc' || echo '$(srcdir)/'`google/protobuf/map_proto2_unittest.pb.cc -@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) google/protobuf/$(DEPDIR)/no_warning_test-map_proto2_unittest.pb.Tpo google/protobuf/$(DEPDIR)/no_warning_test-map_proto2_unittest.pb.Po -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='google/protobuf/map_proto2_unittest.pb.cc' object='google/protobuf/no_warning_test-map_proto2_unittest.pb.o' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(no_warning_test_CXXFLAGS) $(CXXFLAGS) -c -o google/protobuf/no_warning_test-map_proto2_unittest.pb.o `test -f 'google/protobuf/map_proto2_unittest.pb.cc' || echo '$(srcdir)/'`google/protobuf/map_proto2_unittest.pb.cc - -google/protobuf/no_warning_test-map_proto2_unittest.pb.obj: google/protobuf/map_proto2_unittest.pb.cc -@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(no_warning_test_CXXFLAGS) $(CXXFLAGS) -MT google/protobuf/no_warning_test-map_proto2_unittest.pb.obj -MD -MP -MF google/protobuf/$(DEPDIR)/no_warning_test-map_proto2_unittest.pb.Tpo -c -o google/protobuf/no_warning_test-map_proto2_unittest.pb.obj `if test -f 'google/protobuf/map_proto2_unittest.pb.cc'; then $(CYGPATH_W) 'google/protobuf/map_proto2_unittest.pb.cc'; else $(CYGPATH_W) '$(srcdir)/google/protobuf/map_proto2_unittest.pb.cc'; fi` -@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) google/protobuf/$(DEPDIR)/no_warning_test-map_proto2_unittest.pb.Tpo google/protobuf/$(DEPDIR)/no_warning_test-map_proto2_unittest.pb.Po -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='google/protobuf/map_proto2_unittest.pb.cc' object='google/protobuf/no_warning_test-map_proto2_unittest.pb.obj' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(no_warning_test_CXXFLAGS) $(CXXFLAGS) -c -o google/protobuf/no_warning_test-map_proto2_unittest.pb.obj `if test -f 'google/protobuf/map_proto2_unittest.pb.cc'; then $(CYGPATH_W) 'google/protobuf/map_proto2_unittest.pb.cc'; else $(CYGPATH_W) '$(srcdir)/google/protobuf/map_proto2_unittest.pb.cc'; fi` - -google/protobuf/no_warning_test-map_unittest.pb.o: google/protobuf/map_unittest.pb.cc -@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(no_warning_test_CXXFLAGS) $(CXXFLAGS) -MT google/protobuf/no_warning_test-map_unittest.pb.o -MD -MP -MF google/protobuf/$(DEPDIR)/no_warning_test-map_unittest.pb.Tpo -c -o google/protobuf/no_warning_test-map_unittest.pb.o `test -f 'google/protobuf/map_unittest.pb.cc' || echo '$(srcdir)/'`google/protobuf/map_unittest.pb.cc -@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) google/protobuf/$(DEPDIR)/no_warning_test-map_unittest.pb.Tpo google/protobuf/$(DEPDIR)/no_warning_test-map_unittest.pb.Po -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='google/protobuf/map_unittest.pb.cc' object='google/protobuf/no_warning_test-map_unittest.pb.o' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(no_warning_test_CXXFLAGS) $(CXXFLAGS) -c -o google/protobuf/no_warning_test-map_unittest.pb.o `test -f 'google/protobuf/map_unittest.pb.cc' || echo '$(srcdir)/'`google/protobuf/map_unittest.pb.cc - -google/protobuf/no_warning_test-map_unittest.pb.obj: google/protobuf/map_unittest.pb.cc -@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(no_warning_test_CXXFLAGS) $(CXXFLAGS) -MT google/protobuf/no_warning_test-map_unittest.pb.obj -MD -MP -MF google/protobuf/$(DEPDIR)/no_warning_test-map_unittest.pb.Tpo -c -o google/protobuf/no_warning_test-map_unittest.pb.obj `if test -f 'google/protobuf/map_unittest.pb.cc'; then $(CYGPATH_W) 'google/protobuf/map_unittest.pb.cc'; else $(CYGPATH_W) '$(srcdir)/google/protobuf/map_unittest.pb.cc'; fi` -@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) google/protobuf/$(DEPDIR)/no_warning_test-map_unittest.pb.Tpo google/protobuf/$(DEPDIR)/no_warning_test-map_unittest.pb.Po -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='google/protobuf/map_unittest.pb.cc' object='google/protobuf/no_warning_test-map_unittest.pb.obj' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(no_warning_test_CXXFLAGS) $(CXXFLAGS) -c -o google/protobuf/no_warning_test-map_unittest.pb.obj `if test -f 'google/protobuf/map_unittest.pb.cc'; then $(CYGPATH_W) 'google/protobuf/map_unittest.pb.cc'; else $(CYGPATH_W) '$(srcdir)/google/protobuf/map_unittest.pb.cc'; fi` - -google/protobuf/no_warning_test-unittest.pb.o: google/protobuf/unittest.pb.cc -@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(no_warning_test_CXXFLAGS) $(CXXFLAGS) -MT google/protobuf/no_warning_test-unittest.pb.o -MD -MP -MF google/protobuf/$(DEPDIR)/no_warning_test-unittest.pb.Tpo -c -o google/protobuf/no_warning_test-unittest.pb.o `test -f 'google/protobuf/unittest.pb.cc' || echo '$(srcdir)/'`google/protobuf/unittest.pb.cc -@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) google/protobuf/$(DEPDIR)/no_warning_test-unittest.pb.Tpo google/protobuf/$(DEPDIR)/no_warning_test-unittest.pb.Po -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='google/protobuf/unittest.pb.cc' object='google/protobuf/no_warning_test-unittest.pb.o' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(no_warning_test_CXXFLAGS) $(CXXFLAGS) -c -o google/protobuf/no_warning_test-unittest.pb.o `test -f 'google/protobuf/unittest.pb.cc' || echo '$(srcdir)/'`google/protobuf/unittest.pb.cc - -google/protobuf/no_warning_test-unittest.pb.obj: google/protobuf/unittest.pb.cc -@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(no_warning_test_CXXFLAGS) $(CXXFLAGS) -MT google/protobuf/no_warning_test-unittest.pb.obj -MD -MP -MF google/protobuf/$(DEPDIR)/no_warning_test-unittest.pb.Tpo -c -o google/protobuf/no_warning_test-unittest.pb.obj `if test -f 'google/protobuf/unittest.pb.cc'; then $(CYGPATH_W) 'google/protobuf/unittest.pb.cc'; else $(CYGPATH_W) '$(srcdir)/google/protobuf/unittest.pb.cc'; fi` -@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) google/protobuf/$(DEPDIR)/no_warning_test-unittest.pb.Tpo google/protobuf/$(DEPDIR)/no_warning_test-unittest.pb.Po -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='google/protobuf/unittest.pb.cc' object='google/protobuf/no_warning_test-unittest.pb.obj' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(no_warning_test_CXXFLAGS) $(CXXFLAGS) -c -o google/protobuf/no_warning_test-unittest.pb.obj `if test -f 'google/protobuf/unittest.pb.cc'; then $(CYGPATH_W) 'google/protobuf/unittest.pb.cc'; else $(CYGPATH_W) '$(srcdir)/google/protobuf/unittest.pb.cc'; fi` - -google/protobuf/no_warning_test-unittest_arena.pb.o: google/protobuf/unittest_arena.pb.cc -@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(no_warning_test_CXXFLAGS) $(CXXFLAGS) -MT google/protobuf/no_warning_test-unittest_arena.pb.o -MD -MP -MF google/protobuf/$(DEPDIR)/no_warning_test-unittest_arena.pb.Tpo -c -o google/protobuf/no_warning_test-unittest_arena.pb.o `test -f 'google/protobuf/unittest_arena.pb.cc' || echo '$(srcdir)/'`google/protobuf/unittest_arena.pb.cc -@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) google/protobuf/$(DEPDIR)/no_warning_test-unittest_arena.pb.Tpo google/protobuf/$(DEPDIR)/no_warning_test-unittest_arena.pb.Po -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='google/protobuf/unittest_arena.pb.cc' object='google/protobuf/no_warning_test-unittest_arena.pb.o' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(no_warning_test_CXXFLAGS) $(CXXFLAGS) -c -o google/protobuf/no_warning_test-unittest_arena.pb.o `test -f 'google/protobuf/unittest_arena.pb.cc' || echo '$(srcdir)/'`google/protobuf/unittest_arena.pb.cc - -google/protobuf/no_warning_test-unittest_arena.pb.obj: google/protobuf/unittest_arena.pb.cc -@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(no_warning_test_CXXFLAGS) $(CXXFLAGS) -MT google/protobuf/no_warning_test-unittest_arena.pb.obj -MD -MP -MF google/protobuf/$(DEPDIR)/no_warning_test-unittest_arena.pb.Tpo -c -o google/protobuf/no_warning_test-unittest_arena.pb.obj `if test -f 'google/protobuf/unittest_arena.pb.cc'; then $(CYGPATH_W) 'google/protobuf/unittest_arena.pb.cc'; else $(CYGPATH_W) '$(srcdir)/google/protobuf/unittest_arena.pb.cc'; fi` -@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) google/protobuf/$(DEPDIR)/no_warning_test-unittest_arena.pb.Tpo google/protobuf/$(DEPDIR)/no_warning_test-unittest_arena.pb.Po -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='google/protobuf/unittest_arena.pb.cc' object='google/protobuf/no_warning_test-unittest_arena.pb.obj' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(no_warning_test_CXXFLAGS) $(CXXFLAGS) -c -o google/protobuf/no_warning_test-unittest_arena.pb.obj `if test -f 'google/protobuf/unittest_arena.pb.cc'; then $(CYGPATH_W) 'google/protobuf/unittest_arena.pb.cc'; else $(CYGPATH_W) '$(srcdir)/google/protobuf/unittest_arena.pb.cc'; fi` - -google/protobuf/no_warning_test-unittest_custom_options.pb.o: google/protobuf/unittest_custom_options.pb.cc -@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(no_warning_test_CXXFLAGS) $(CXXFLAGS) -MT google/protobuf/no_warning_test-unittest_custom_options.pb.o -MD -MP -MF google/protobuf/$(DEPDIR)/no_warning_test-unittest_custom_options.pb.Tpo -c -o google/protobuf/no_warning_test-unittest_custom_options.pb.o `test -f 'google/protobuf/unittest_custom_options.pb.cc' || echo '$(srcdir)/'`google/protobuf/unittest_custom_options.pb.cc -@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) google/protobuf/$(DEPDIR)/no_warning_test-unittest_custom_options.pb.Tpo google/protobuf/$(DEPDIR)/no_warning_test-unittest_custom_options.pb.Po -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='google/protobuf/unittest_custom_options.pb.cc' object='google/protobuf/no_warning_test-unittest_custom_options.pb.o' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(no_warning_test_CXXFLAGS) $(CXXFLAGS) -c -o google/protobuf/no_warning_test-unittest_custom_options.pb.o `test -f 'google/protobuf/unittest_custom_options.pb.cc' || echo '$(srcdir)/'`google/protobuf/unittest_custom_options.pb.cc - -google/protobuf/no_warning_test-unittest_custom_options.pb.obj: google/protobuf/unittest_custom_options.pb.cc -@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(no_warning_test_CXXFLAGS) $(CXXFLAGS) -MT google/protobuf/no_warning_test-unittest_custom_options.pb.obj -MD -MP -MF google/protobuf/$(DEPDIR)/no_warning_test-unittest_custom_options.pb.Tpo -c -o google/protobuf/no_warning_test-unittest_custom_options.pb.obj `if test -f 'google/protobuf/unittest_custom_options.pb.cc'; then $(CYGPATH_W) 'google/protobuf/unittest_custom_options.pb.cc'; else $(CYGPATH_W) '$(srcdir)/google/protobuf/unittest_custom_options.pb.cc'; fi` -@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) google/protobuf/$(DEPDIR)/no_warning_test-unittest_custom_options.pb.Tpo google/protobuf/$(DEPDIR)/no_warning_test-unittest_custom_options.pb.Po -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='google/protobuf/unittest_custom_options.pb.cc' object='google/protobuf/no_warning_test-unittest_custom_options.pb.obj' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(no_warning_test_CXXFLAGS) $(CXXFLAGS) -c -o google/protobuf/no_warning_test-unittest_custom_options.pb.obj `if test -f 'google/protobuf/unittest_custom_options.pb.cc'; then $(CYGPATH_W) 'google/protobuf/unittest_custom_options.pb.cc'; else $(CYGPATH_W) '$(srcdir)/google/protobuf/unittest_custom_options.pb.cc'; fi` - -google/protobuf/no_warning_test-unittest_drop_unknown_fields.pb.o: google/protobuf/unittest_drop_unknown_fields.pb.cc -@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(no_warning_test_CXXFLAGS) $(CXXFLAGS) -MT google/protobuf/no_warning_test-unittest_drop_unknown_fields.pb.o -MD -MP -MF google/protobuf/$(DEPDIR)/no_warning_test-unittest_drop_unknown_fields.pb.Tpo -c -o google/protobuf/no_warning_test-unittest_drop_unknown_fields.pb.o `test -f 'google/protobuf/unittest_drop_unknown_fields.pb.cc' || echo '$(srcdir)/'`google/protobuf/unittest_drop_unknown_fields.pb.cc -@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) google/protobuf/$(DEPDIR)/no_warning_test-unittest_drop_unknown_fields.pb.Tpo google/protobuf/$(DEPDIR)/no_warning_test-unittest_drop_unknown_fields.pb.Po -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='google/protobuf/unittest_drop_unknown_fields.pb.cc' object='google/protobuf/no_warning_test-unittest_drop_unknown_fields.pb.o' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(no_warning_test_CXXFLAGS) $(CXXFLAGS) -c -o google/protobuf/no_warning_test-unittest_drop_unknown_fields.pb.o `test -f 'google/protobuf/unittest_drop_unknown_fields.pb.cc' || echo '$(srcdir)/'`google/protobuf/unittest_drop_unknown_fields.pb.cc - -google/protobuf/no_warning_test-unittest_drop_unknown_fields.pb.obj: google/protobuf/unittest_drop_unknown_fields.pb.cc -@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(no_warning_test_CXXFLAGS) $(CXXFLAGS) -MT google/protobuf/no_warning_test-unittest_drop_unknown_fields.pb.obj -MD -MP -MF google/protobuf/$(DEPDIR)/no_warning_test-unittest_drop_unknown_fields.pb.Tpo -c -o google/protobuf/no_warning_test-unittest_drop_unknown_fields.pb.obj `if test -f 'google/protobuf/unittest_drop_unknown_fields.pb.cc'; then $(CYGPATH_W) 'google/protobuf/unittest_drop_unknown_fields.pb.cc'; else $(CYGPATH_W) '$(srcdir)/google/protobuf/unittest_drop_unknown_fields.pb.cc'; fi` -@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) google/protobuf/$(DEPDIR)/no_warning_test-unittest_drop_unknown_fields.pb.Tpo google/protobuf/$(DEPDIR)/no_warning_test-unittest_drop_unknown_fields.pb.Po -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='google/protobuf/unittest_drop_unknown_fields.pb.cc' object='google/protobuf/no_warning_test-unittest_drop_unknown_fields.pb.obj' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(no_warning_test_CXXFLAGS) $(CXXFLAGS) -c -o google/protobuf/no_warning_test-unittest_drop_unknown_fields.pb.obj `if test -f 'google/protobuf/unittest_drop_unknown_fields.pb.cc'; then $(CYGPATH_W) 'google/protobuf/unittest_drop_unknown_fields.pb.cc'; else $(CYGPATH_W) '$(srcdir)/google/protobuf/unittest_drop_unknown_fields.pb.cc'; fi` - -google/protobuf/no_warning_test-unittest_embed_optimize_for.pb.o: google/protobuf/unittest_embed_optimize_for.pb.cc -@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(no_warning_test_CXXFLAGS) $(CXXFLAGS) -MT google/protobuf/no_warning_test-unittest_embed_optimize_for.pb.o -MD -MP -MF google/protobuf/$(DEPDIR)/no_warning_test-unittest_embed_optimize_for.pb.Tpo -c -o google/protobuf/no_warning_test-unittest_embed_optimize_for.pb.o `test -f 'google/protobuf/unittest_embed_optimize_for.pb.cc' || echo '$(srcdir)/'`google/protobuf/unittest_embed_optimize_for.pb.cc -@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) google/protobuf/$(DEPDIR)/no_warning_test-unittest_embed_optimize_for.pb.Tpo google/protobuf/$(DEPDIR)/no_warning_test-unittest_embed_optimize_for.pb.Po -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='google/protobuf/unittest_embed_optimize_for.pb.cc' object='google/protobuf/no_warning_test-unittest_embed_optimize_for.pb.o' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(no_warning_test_CXXFLAGS) $(CXXFLAGS) -c -o google/protobuf/no_warning_test-unittest_embed_optimize_for.pb.o `test -f 'google/protobuf/unittest_embed_optimize_for.pb.cc' || echo '$(srcdir)/'`google/protobuf/unittest_embed_optimize_for.pb.cc - -google/protobuf/no_warning_test-unittest_embed_optimize_for.pb.obj: google/protobuf/unittest_embed_optimize_for.pb.cc -@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(no_warning_test_CXXFLAGS) $(CXXFLAGS) -MT google/protobuf/no_warning_test-unittest_embed_optimize_for.pb.obj -MD -MP -MF google/protobuf/$(DEPDIR)/no_warning_test-unittest_embed_optimize_for.pb.Tpo -c -o google/protobuf/no_warning_test-unittest_embed_optimize_for.pb.obj `if test -f 'google/protobuf/unittest_embed_optimize_for.pb.cc'; then $(CYGPATH_W) 'google/protobuf/unittest_embed_optimize_for.pb.cc'; else $(CYGPATH_W) '$(srcdir)/google/protobuf/unittest_embed_optimize_for.pb.cc'; fi` -@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) google/protobuf/$(DEPDIR)/no_warning_test-unittest_embed_optimize_for.pb.Tpo google/protobuf/$(DEPDIR)/no_warning_test-unittest_embed_optimize_for.pb.Po -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='google/protobuf/unittest_embed_optimize_for.pb.cc' object='google/protobuf/no_warning_test-unittest_embed_optimize_for.pb.obj' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(no_warning_test_CXXFLAGS) $(CXXFLAGS) -c -o google/protobuf/no_warning_test-unittest_embed_optimize_for.pb.obj `if test -f 'google/protobuf/unittest_embed_optimize_for.pb.cc'; then $(CYGPATH_W) 'google/protobuf/unittest_embed_optimize_for.pb.cc'; else $(CYGPATH_W) '$(srcdir)/google/protobuf/unittest_embed_optimize_for.pb.cc'; fi` - -google/protobuf/no_warning_test-unittest_empty.pb.o: google/protobuf/unittest_empty.pb.cc -@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(no_warning_test_CXXFLAGS) $(CXXFLAGS) -MT google/protobuf/no_warning_test-unittest_empty.pb.o -MD -MP -MF google/protobuf/$(DEPDIR)/no_warning_test-unittest_empty.pb.Tpo -c -o google/protobuf/no_warning_test-unittest_empty.pb.o `test -f 'google/protobuf/unittest_empty.pb.cc' || echo '$(srcdir)/'`google/protobuf/unittest_empty.pb.cc -@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) google/protobuf/$(DEPDIR)/no_warning_test-unittest_empty.pb.Tpo google/protobuf/$(DEPDIR)/no_warning_test-unittest_empty.pb.Po -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='google/protobuf/unittest_empty.pb.cc' object='google/protobuf/no_warning_test-unittest_empty.pb.o' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(no_warning_test_CXXFLAGS) $(CXXFLAGS) -c -o google/protobuf/no_warning_test-unittest_empty.pb.o `test -f 'google/protobuf/unittest_empty.pb.cc' || echo '$(srcdir)/'`google/protobuf/unittest_empty.pb.cc - -google/protobuf/no_warning_test-unittest_empty.pb.obj: google/protobuf/unittest_empty.pb.cc -@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(no_warning_test_CXXFLAGS) $(CXXFLAGS) -MT google/protobuf/no_warning_test-unittest_empty.pb.obj -MD -MP -MF google/protobuf/$(DEPDIR)/no_warning_test-unittest_empty.pb.Tpo -c -o google/protobuf/no_warning_test-unittest_empty.pb.obj `if test -f 'google/protobuf/unittest_empty.pb.cc'; then $(CYGPATH_W) 'google/protobuf/unittest_empty.pb.cc'; else $(CYGPATH_W) '$(srcdir)/google/protobuf/unittest_empty.pb.cc'; fi` -@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) google/protobuf/$(DEPDIR)/no_warning_test-unittest_empty.pb.Tpo google/protobuf/$(DEPDIR)/no_warning_test-unittest_empty.pb.Po -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='google/protobuf/unittest_empty.pb.cc' object='google/protobuf/no_warning_test-unittest_empty.pb.obj' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(no_warning_test_CXXFLAGS) $(CXXFLAGS) -c -o google/protobuf/no_warning_test-unittest_empty.pb.obj `if test -f 'google/protobuf/unittest_empty.pb.cc'; then $(CYGPATH_W) 'google/protobuf/unittest_empty.pb.cc'; else $(CYGPATH_W) '$(srcdir)/google/protobuf/unittest_empty.pb.cc'; fi` - -google/protobuf/no_warning_test-unittest_enormous_descriptor.pb.o: google/protobuf/unittest_enormous_descriptor.pb.cc -@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(no_warning_test_CXXFLAGS) $(CXXFLAGS) -MT google/protobuf/no_warning_test-unittest_enormous_descriptor.pb.o -MD -MP -MF google/protobuf/$(DEPDIR)/no_warning_test-unittest_enormous_descriptor.pb.Tpo -c -o google/protobuf/no_warning_test-unittest_enormous_descriptor.pb.o `test -f 'google/protobuf/unittest_enormous_descriptor.pb.cc' || echo '$(srcdir)/'`google/protobuf/unittest_enormous_descriptor.pb.cc -@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) google/protobuf/$(DEPDIR)/no_warning_test-unittest_enormous_descriptor.pb.Tpo google/protobuf/$(DEPDIR)/no_warning_test-unittest_enormous_descriptor.pb.Po -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='google/protobuf/unittest_enormous_descriptor.pb.cc' object='google/protobuf/no_warning_test-unittest_enormous_descriptor.pb.o' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(no_warning_test_CXXFLAGS) $(CXXFLAGS) -c -o google/protobuf/no_warning_test-unittest_enormous_descriptor.pb.o `test -f 'google/protobuf/unittest_enormous_descriptor.pb.cc' || echo '$(srcdir)/'`google/protobuf/unittest_enormous_descriptor.pb.cc - -google/protobuf/no_warning_test-unittest_enormous_descriptor.pb.obj: google/protobuf/unittest_enormous_descriptor.pb.cc -@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(no_warning_test_CXXFLAGS) $(CXXFLAGS) -MT google/protobuf/no_warning_test-unittest_enormous_descriptor.pb.obj -MD -MP -MF google/protobuf/$(DEPDIR)/no_warning_test-unittest_enormous_descriptor.pb.Tpo -c -o google/protobuf/no_warning_test-unittest_enormous_descriptor.pb.obj `if test -f 'google/protobuf/unittest_enormous_descriptor.pb.cc'; then $(CYGPATH_W) 'google/protobuf/unittest_enormous_descriptor.pb.cc'; else $(CYGPATH_W) '$(srcdir)/google/protobuf/unittest_enormous_descriptor.pb.cc'; fi` -@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) google/protobuf/$(DEPDIR)/no_warning_test-unittest_enormous_descriptor.pb.Tpo google/protobuf/$(DEPDIR)/no_warning_test-unittest_enormous_descriptor.pb.Po -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='google/protobuf/unittest_enormous_descriptor.pb.cc' object='google/protobuf/no_warning_test-unittest_enormous_descriptor.pb.obj' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(no_warning_test_CXXFLAGS) $(CXXFLAGS) -c -o google/protobuf/no_warning_test-unittest_enormous_descriptor.pb.obj `if test -f 'google/protobuf/unittest_enormous_descriptor.pb.cc'; then $(CYGPATH_W) 'google/protobuf/unittest_enormous_descriptor.pb.cc'; else $(CYGPATH_W) '$(srcdir)/google/protobuf/unittest_enormous_descriptor.pb.cc'; fi` - -google/protobuf/no_warning_test-unittest_import.pb.o: google/protobuf/unittest_import.pb.cc -@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(no_warning_test_CXXFLAGS) $(CXXFLAGS) -MT google/protobuf/no_warning_test-unittest_import.pb.o -MD -MP -MF google/protobuf/$(DEPDIR)/no_warning_test-unittest_import.pb.Tpo -c -o google/protobuf/no_warning_test-unittest_import.pb.o `test -f 'google/protobuf/unittest_import.pb.cc' || echo '$(srcdir)/'`google/protobuf/unittest_import.pb.cc -@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) google/protobuf/$(DEPDIR)/no_warning_test-unittest_import.pb.Tpo google/protobuf/$(DEPDIR)/no_warning_test-unittest_import.pb.Po -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='google/protobuf/unittest_import.pb.cc' object='google/protobuf/no_warning_test-unittest_import.pb.o' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(no_warning_test_CXXFLAGS) $(CXXFLAGS) -c -o google/protobuf/no_warning_test-unittest_import.pb.o `test -f 'google/protobuf/unittest_import.pb.cc' || echo '$(srcdir)/'`google/protobuf/unittest_import.pb.cc - -google/protobuf/no_warning_test-unittest_import.pb.obj: google/protobuf/unittest_import.pb.cc -@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(no_warning_test_CXXFLAGS) $(CXXFLAGS) -MT google/protobuf/no_warning_test-unittest_import.pb.obj -MD -MP -MF google/protobuf/$(DEPDIR)/no_warning_test-unittest_import.pb.Tpo -c -o google/protobuf/no_warning_test-unittest_import.pb.obj `if test -f 'google/protobuf/unittest_import.pb.cc'; then $(CYGPATH_W) 'google/protobuf/unittest_import.pb.cc'; else $(CYGPATH_W) '$(srcdir)/google/protobuf/unittest_import.pb.cc'; fi` -@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) google/protobuf/$(DEPDIR)/no_warning_test-unittest_import.pb.Tpo google/protobuf/$(DEPDIR)/no_warning_test-unittest_import.pb.Po -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='google/protobuf/unittest_import.pb.cc' object='google/protobuf/no_warning_test-unittest_import.pb.obj' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(no_warning_test_CXXFLAGS) $(CXXFLAGS) -c -o google/protobuf/no_warning_test-unittest_import.pb.obj `if test -f 'google/protobuf/unittest_import.pb.cc'; then $(CYGPATH_W) 'google/protobuf/unittest_import.pb.cc'; else $(CYGPATH_W) '$(srcdir)/google/protobuf/unittest_import.pb.cc'; fi` - -google/protobuf/no_warning_test-unittest_import_public.pb.o: google/protobuf/unittest_import_public.pb.cc -@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(no_warning_test_CXXFLAGS) $(CXXFLAGS) -MT google/protobuf/no_warning_test-unittest_import_public.pb.o -MD -MP -MF google/protobuf/$(DEPDIR)/no_warning_test-unittest_import_public.pb.Tpo -c -o google/protobuf/no_warning_test-unittest_import_public.pb.o `test -f 'google/protobuf/unittest_import_public.pb.cc' || echo '$(srcdir)/'`google/protobuf/unittest_import_public.pb.cc -@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) google/protobuf/$(DEPDIR)/no_warning_test-unittest_import_public.pb.Tpo google/protobuf/$(DEPDIR)/no_warning_test-unittest_import_public.pb.Po -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='google/protobuf/unittest_import_public.pb.cc' object='google/protobuf/no_warning_test-unittest_import_public.pb.o' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(no_warning_test_CXXFLAGS) $(CXXFLAGS) -c -o google/protobuf/no_warning_test-unittest_import_public.pb.o `test -f 'google/protobuf/unittest_import_public.pb.cc' || echo '$(srcdir)/'`google/protobuf/unittest_import_public.pb.cc - -google/protobuf/no_warning_test-unittest_import_public.pb.obj: google/protobuf/unittest_import_public.pb.cc -@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(no_warning_test_CXXFLAGS) $(CXXFLAGS) -MT google/protobuf/no_warning_test-unittest_import_public.pb.obj -MD -MP -MF google/protobuf/$(DEPDIR)/no_warning_test-unittest_import_public.pb.Tpo -c -o google/protobuf/no_warning_test-unittest_import_public.pb.obj `if test -f 'google/protobuf/unittest_import_public.pb.cc'; then $(CYGPATH_W) 'google/protobuf/unittest_import_public.pb.cc'; else $(CYGPATH_W) '$(srcdir)/google/protobuf/unittest_import_public.pb.cc'; fi` -@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) google/protobuf/$(DEPDIR)/no_warning_test-unittest_import_public.pb.Tpo google/protobuf/$(DEPDIR)/no_warning_test-unittest_import_public.pb.Po -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='google/protobuf/unittest_import_public.pb.cc' object='google/protobuf/no_warning_test-unittest_import_public.pb.obj' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(no_warning_test_CXXFLAGS) $(CXXFLAGS) -c -o google/protobuf/no_warning_test-unittest_import_public.pb.obj `if test -f 'google/protobuf/unittest_import_public.pb.cc'; then $(CYGPATH_W) 'google/protobuf/unittest_import_public.pb.cc'; else $(CYGPATH_W) '$(srcdir)/google/protobuf/unittest_import_public.pb.cc'; fi` - -google/protobuf/no_warning_test-unittest_lazy_dependencies.pb.o: google/protobuf/unittest_lazy_dependencies.pb.cc -@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(no_warning_test_CXXFLAGS) $(CXXFLAGS) -MT google/protobuf/no_warning_test-unittest_lazy_dependencies.pb.o -MD -MP -MF google/protobuf/$(DEPDIR)/no_warning_test-unittest_lazy_dependencies.pb.Tpo -c -o google/protobuf/no_warning_test-unittest_lazy_dependencies.pb.o `test -f 'google/protobuf/unittest_lazy_dependencies.pb.cc' || echo '$(srcdir)/'`google/protobuf/unittest_lazy_dependencies.pb.cc -@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) google/protobuf/$(DEPDIR)/no_warning_test-unittest_lazy_dependencies.pb.Tpo google/protobuf/$(DEPDIR)/no_warning_test-unittest_lazy_dependencies.pb.Po -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='google/protobuf/unittest_lazy_dependencies.pb.cc' object='google/protobuf/no_warning_test-unittest_lazy_dependencies.pb.o' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(no_warning_test_CXXFLAGS) $(CXXFLAGS) -c -o google/protobuf/no_warning_test-unittest_lazy_dependencies.pb.o `test -f 'google/protobuf/unittest_lazy_dependencies.pb.cc' || echo '$(srcdir)/'`google/protobuf/unittest_lazy_dependencies.pb.cc - -google/protobuf/no_warning_test-unittest_lazy_dependencies.pb.obj: google/protobuf/unittest_lazy_dependencies.pb.cc -@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(no_warning_test_CXXFLAGS) $(CXXFLAGS) -MT google/protobuf/no_warning_test-unittest_lazy_dependencies.pb.obj -MD -MP -MF google/protobuf/$(DEPDIR)/no_warning_test-unittest_lazy_dependencies.pb.Tpo -c -o google/protobuf/no_warning_test-unittest_lazy_dependencies.pb.obj `if test -f 'google/protobuf/unittest_lazy_dependencies.pb.cc'; then $(CYGPATH_W) 'google/protobuf/unittest_lazy_dependencies.pb.cc'; else $(CYGPATH_W) '$(srcdir)/google/protobuf/unittest_lazy_dependencies.pb.cc'; fi` -@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) google/protobuf/$(DEPDIR)/no_warning_test-unittest_lazy_dependencies.pb.Tpo google/protobuf/$(DEPDIR)/no_warning_test-unittest_lazy_dependencies.pb.Po -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='google/protobuf/unittest_lazy_dependencies.pb.cc' object='google/protobuf/no_warning_test-unittest_lazy_dependencies.pb.obj' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(no_warning_test_CXXFLAGS) $(CXXFLAGS) -c -o google/protobuf/no_warning_test-unittest_lazy_dependencies.pb.obj `if test -f 'google/protobuf/unittest_lazy_dependencies.pb.cc'; then $(CYGPATH_W) 'google/protobuf/unittest_lazy_dependencies.pb.cc'; else $(CYGPATH_W) '$(srcdir)/google/protobuf/unittest_lazy_dependencies.pb.cc'; fi` - -google/protobuf/no_warning_test-unittest_lazy_dependencies_custom_option.pb.o: google/protobuf/unittest_lazy_dependencies_custom_option.pb.cc -@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(no_warning_test_CXXFLAGS) $(CXXFLAGS) -MT google/protobuf/no_warning_test-unittest_lazy_dependencies_custom_option.pb.o -MD -MP -MF google/protobuf/$(DEPDIR)/no_warning_test-unittest_lazy_dependencies_custom_option.pb.Tpo -c -o google/protobuf/no_warning_test-unittest_lazy_dependencies_custom_option.pb.o `test -f 'google/protobuf/unittest_lazy_dependencies_custom_option.pb.cc' || echo '$(srcdir)/'`google/protobuf/unittest_lazy_dependencies_custom_option.pb.cc -@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) google/protobuf/$(DEPDIR)/no_warning_test-unittest_lazy_dependencies_custom_option.pb.Tpo google/protobuf/$(DEPDIR)/no_warning_test-unittest_lazy_dependencies_custom_option.pb.Po -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='google/protobuf/unittest_lazy_dependencies_custom_option.pb.cc' object='google/protobuf/no_warning_test-unittest_lazy_dependencies_custom_option.pb.o' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(no_warning_test_CXXFLAGS) $(CXXFLAGS) -c -o google/protobuf/no_warning_test-unittest_lazy_dependencies_custom_option.pb.o `test -f 'google/protobuf/unittest_lazy_dependencies_custom_option.pb.cc' || echo '$(srcdir)/'`google/protobuf/unittest_lazy_dependencies_custom_option.pb.cc - -google/protobuf/no_warning_test-unittest_lazy_dependencies_custom_option.pb.obj: google/protobuf/unittest_lazy_dependencies_custom_option.pb.cc -@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(no_warning_test_CXXFLAGS) $(CXXFLAGS) -MT google/protobuf/no_warning_test-unittest_lazy_dependencies_custom_option.pb.obj -MD -MP -MF google/protobuf/$(DEPDIR)/no_warning_test-unittest_lazy_dependencies_custom_option.pb.Tpo -c -o google/protobuf/no_warning_test-unittest_lazy_dependencies_custom_option.pb.obj `if test -f 'google/protobuf/unittest_lazy_dependencies_custom_option.pb.cc'; then $(CYGPATH_W) 'google/protobuf/unittest_lazy_dependencies_custom_option.pb.cc'; else $(CYGPATH_W) '$(srcdir)/google/protobuf/unittest_lazy_dependencies_custom_option.pb.cc'; fi` -@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) google/protobuf/$(DEPDIR)/no_warning_test-unittest_lazy_dependencies_custom_option.pb.Tpo google/protobuf/$(DEPDIR)/no_warning_test-unittest_lazy_dependencies_custom_option.pb.Po -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='google/protobuf/unittest_lazy_dependencies_custom_option.pb.cc' object='google/protobuf/no_warning_test-unittest_lazy_dependencies_custom_option.pb.obj' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(no_warning_test_CXXFLAGS) $(CXXFLAGS) -c -o google/protobuf/no_warning_test-unittest_lazy_dependencies_custom_option.pb.obj `if test -f 'google/protobuf/unittest_lazy_dependencies_custom_option.pb.cc'; then $(CYGPATH_W) 'google/protobuf/unittest_lazy_dependencies_custom_option.pb.cc'; else $(CYGPATH_W) '$(srcdir)/google/protobuf/unittest_lazy_dependencies_custom_option.pb.cc'; fi` - -google/protobuf/no_warning_test-unittest_lazy_dependencies_enum.pb.o: google/protobuf/unittest_lazy_dependencies_enum.pb.cc -@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(no_warning_test_CXXFLAGS) $(CXXFLAGS) -MT google/protobuf/no_warning_test-unittest_lazy_dependencies_enum.pb.o -MD -MP -MF google/protobuf/$(DEPDIR)/no_warning_test-unittest_lazy_dependencies_enum.pb.Tpo -c -o google/protobuf/no_warning_test-unittest_lazy_dependencies_enum.pb.o `test -f 'google/protobuf/unittest_lazy_dependencies_enum.pb.cc' || echo '$(srcdir)/'`google/protobuf/unittest_lazy_dependencies_enum.pb.cc -@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) google/protobuf/$(DEPDIR)/no_warning_test-unittest_lazy_dependencies_enum.pb.Tpo google/protobuf/$(DEPDIR)/no_warning_test-unittest_lazy_dependencies_enum.pb.Po -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='google/protobuf/unittest_lazy_dependencies_enum.pb.cc' object='google/protobuf/no_warning_test-unittest_lazy_dependencies_enum.pb.o' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(no_warning_test_CXXFLAGS) $(CXXFLAGS) -c -o google/protobuf/no_warning_test-unittest_lazy_dependencies_enum.pb.o `test -f 'google/protobuf/unittest_lazy_dependencies_enum.pb.cc' || echo '$(srcdir)/'`google/protobuf/unittest_lazy_dependencies_enum.pb.cc - -google/protobuf/no_warning_test-unittest_lazy_dependencies_enum.pb.obj: google/protobuf/unittest_lazy_dependencies_enum.pb.cc -@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(no_warning_test_CXXFLAGS) $(CXXFLAGS) -MT google/protobuf/no_warning_test-unittest_lazy_dependencies_enum.pb.obj -MD -MP -MF google/protobuf/$(DEPDIR)/no_warning_test-unittest_lazy_dependencies_enum.pb.Tpo -c -o google/protobuf/no_warning_test-unittest_lazy_dependencies_enum.pb.obj `if test -f 'google/protobuf/unittest_lazy_dependencies_enum.pb.cc'; then $(CYGPATH_W) 'google/protobuf/unittest_lazy_dependencies_enum.pb.cc'; else $(CYGPATH_W) '$(srcdir)/google/protobuf/unittest_lazy_dependencies_enum.pb.cc'; fi` -@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) google/protobuf/$(DEPDIR)/no_warning_test-unittest_lazy_dependencies_enum.pb.Tpo google/protobuf/$(DEPDIR)/no_warning_test-unittest_lazy_dependencies_enum.pb.Po -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='google/protobuf/unittest_lazy_dependencies_enum.pb.cc' object='google/protobuf/no_warning_test-unittest_lazy_dependencies_enum.pb.obj' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(no_warning_test_CXXFLAGS) $(CXXFLAGS) -c -o google/protobuf/no_warning_test-unittest_lazy_dependencies_enum.pb.obj `if test -f 'google/protobuf/unittest_lazy_dependencies_enum.pb.cc'; then $(CYGPATH_W) 'google/protobuf/unittest_lazy_dependencies_enum.pb.cc'; else $(CYGPATH_W) '$(srcdir)/google/protobuf/unittest_lazy_dependencies_enum.pb.cc'; fi` - -google/protobuf/no_warning_test-unittest_lite_imports_nonlite.pb.o: google/protobuf/unittest_lite_imports_nonlite.pb.cc -@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(no_warning_test_CXXFLAGS) $(CXXFLAGS) -MT google/protobuf/no_warning_test-unittest_lite_imports_nonlite.pb.o -MD -MP -MF google/protobuf/$(DEPDIR)/no_warning_test-unittest_lite_imports_nonlite.pb.Tpo -c -o google/protobuf/no_warning_test-unittest_lite_imports_nonlite.pb.o `test -f 'google/protobuf/unittest_lite_imports_nonlite.pb.cc' || echo '$(srcdir)/'`google/protobuf/unittest_lite_imports_nonlite.pb.cc -@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) google/protobuf/$(DEPDIR)/no_warning_test-unittest_lite_imports_nonlite.pb.Tpo google/protobuf/$(DEPDIR)/no_warning_test-unittest_lite_imports_nonlite.pb.Po -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='google/protobuf/unittest_lite_imports_nonlite.pb.cc' object='google/protobuf/no_warning_test-unittest_lite_imports_nonlite.pb.o' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(no_warning_test_CXXFLAGS) $(CXXFLAGS) -c -o google/protobuf/no_warning_test-unittest_lite_imports_nonlite.pb.o `test -f 'google/protobuf/unittest_lite_imports_nonlite.pb.cc' || echo '$(srcdir)/'`google/protobuf/unittest_lite_imports_nonlite.pb.cc - -google/protobuf/no_warning_test-unittest_lite_imports_nonlite.pb.obj: google/protobuf/unittest_lite_imports_nonlite.pb.cc -@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(no_warning_test_CXXFLAGS) $(CXXFLAGS) -MT google/protobuf/no_warning_test-unittest_lite_imports_nonlite.pb.obj -MD -MP -MF google/protobuf/$(DEPDIR)/no_warning_test-unittest_lite_imports_nonlite.pb.Tpo -c -o google/protobuf/no_warning_test-unittest_lite_imports_nonlite.pb.obj `if test -f 'google/protobuf/unittest_lite_imports_nonlite.pb.cc'; then $(CYGPATH_W) 'google/protobuf/unittest_lite_imports_nonlite.pb.cc'; else $(CYGPATH_W) '$(srcdir)/google/protobuf/unittest_lite_imports_nonlite.pb.cc'; fi` -@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) google/protobuf/$(DEPDIR)/no_warning_test-unittest_lite_imports_nonlite.pb.Tpo google/protobuf/$(DEPDIR)/no_warning_test-unittest_lite_imports_nonlite.pb.Po -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='google/protobuf/unittest_lite_imports_nonlite.pb.cc' object='google/protobuf/no_warning_test-unittest_lite_imports_nonlite.pb.obj' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(no_warning_test_CXXFLAGS) $(CXXFLAGS) -c -o google/protobuf/no_warning_test-unittest_lite_imports_nonlite.pb.obj `if test -f 'google/protobuf/unittest_lite_imports_nonlite.pb.cc'; then $(CYGPATH_W) 'google/protobuf/unittest_lite_imports_nonlite.pb.cc'; else $(CYGPATH_W) '$(srcdir)/google/protobuf/unittest_lite_imports_nonlite.pb.cc'; fi` - -google/protobuf/no_warning_test-unittest_mset.pb.o: google/protobuf/unittest_mset.pb.cc -@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(no_warning_test_CXXFLAGS) $(CXXFLAGS) -MT google/protobuf/no_warning_test-unittest_mset.pb.o -MD -MP -MF google/protobuf/$(DEPDIR)/no_warning_test-unittest_mset.pb.Tpo -c -o google/protobuf/no_warning_test-unittest_mset.pb.o `test -f 'google/protobuf/unittest_mset.pb.cc' || echo '$(srcdir)/'`google/protobuf/unittest_mset.pb.cc -@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) google/protobuf/$(DEPDIR)/no_warning_test-unittest_mset.pb.Tpo google/protobuf/$(DEPDIR)/no_warning_test-unittest_mset.pb.Po -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='google/protobuf/unittest_mset.pb.cc' object='google/protobuf/no_warning_test-unittest_mset.pb.o' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(no_warning_test_CXXFLAGS) $(CXXFLAGS) -c -o google/protobuf/no_warning_test-unittest_mset.pb.o `test -f 'google/protobuf/unittest_mset.pb.cc' || echo '$(srcdir)/'`google/protobuf/unittest_mset.pb.cc - -google/protobuf/no_warning_test-unittest_mset.pb.obj: google/protobuf/unittest_mset.pb.cc -@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(no_warning_test_CXXFLAGS) $(CXXFLAGS) -MT google/protobuf/no_warning_test-unittest_mset.pb.obj -MD -MP -MF google/protobuf/$(DEPDIR)/no_warning_test-unittest_mset.pb.Tpo -c -o google/protobuf/no_warning_test-unittest_mset.pb.obj `if test -f 'google/protobuf/unittest_mset.pb.cc'; then $(CYGPATH_W) 'google/protobuf/unittest_mset.pb.cc'; else $(CYGPATH_W) '$(srcdir)/google/protobuf/unittest_mset.pb.cc'; fi` -@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) google/protobuf/$(DEPDIR)/no_warning_test-unittest_mset.pb.Tpo google/protobuf/$(DEPDIR)/no_warning_test-unittest_mset.pb.Po -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='google/protobuf/unittest_mset.pb.cc' object='google/protobuf/no_warning_test-unittest_mset.pb.obj' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(no_warning_test_CXXFLAGS) $(CXXFLAGS) -c -o google/protobuf/no_warning_test-unittest_mset.pb.obj `if test -f 'google/protobuf/unittest_mset.pb.cc'; then $(CYGPATH_W) 'google/protobuf/unittest_mset.pb.cc'; else $(CYGPATH_W) '$(srcdir)/google/protobuf/unittest_mset.pb.cc'; fi` - -google/protobuf/no_warning_test-unittest_mset_wire_format.pb.o: google/protobuf/unittest_mset_wire_format.pb.cc -@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(no_warning_test_CXXFLAGS) $(CXXFLAGS) -MT google/protobuf/no_warning_test-unittest_mset_wire_format.pb.o -MD -MP -MF google/protobuf/$(DEPDIR)/no_warning_test-unittest_mset_wire_format.pb.Tpo -c -o google/protobuf/no_warning_test-unittest_mset_wire_format.pb.o `test -f 'google/protobuf/unittest_mset_wire_format.pb.cc' || echo '$(srcdir)/'`google/protobuf/unittest_mset_wire_format.pb.cc -@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) google/protobuf/$(DEPDIR)/no_warning_test-unittest_mset_wire_format.pb.Tpo google/protobuf/$(DEPDIR)/no_warning_test-unittest_mset_wire_format.pb.Po -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='google/protobuf/unittest_mset_wire_format.pb.cc' object='google/protobuf/no_warning_test-unittest_mset_wire_format.pb.o' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(no_warning_test_CXXFLAGS) $(CXXFLAGS) -c -o google/protobuf/no_warning_test-unittest_mset_wire_format.pb.o `test -f 'google/protobuf/unittest_mset_wire_format.pb.cc' || echo '$(srcdir)/'`google/protobuf/unittest_mset_wire_format.pb.cc - -google/protobuf/no_warning_test-unittest_mset_wire_format.pb.obj: google/protobuf/unittest_mset_wire_format.pb.cc -@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(no_warning_test_CXXFLAGS) $(CXXFLAGS) -MT google/protobuf/no_warning_test-unittest_mset_wire_format.pb.obj -MD -MP -MF google/protobuf/$(DEPDIR)/no_warning_test-unittest_mset_wire_format.pb.Tpo -c -o google/protobuf/no_warning_test-unittest_mset_wire_format.pb.obj `if test -f 'google/protobuf/unittest_mset_wire_format.pb.cc'; then $(CYGPATH_W) 'google/protobuf/unittest_mset_wire_format.pb.cc'; else $(CYGPATH_W) '$(srcdir)/google/protobuf/unittest_mset_wire_format.pb.cc'; fi` -@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) google/protobuf/$(DEPDIR)/no_warning_test-unittest_mset_wire_format.pb.Tpo google/protobuf/$(DEPDIR)/no_warning_test-unittest_mset_wire_format.pb.Po -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='google/protobuf/unittest_mset_wire_format.pb.cc' object='google/protobuf/no_warning_test-unittest_mset_wire_format.pb.obj' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(no_warning_test_CXXFLAGS) $(CXXFLAGS) -c -o google/protobuf/no_warning_test-unittest_mset_wire_format.pb.obj `if test -f 'google/protobuf/unittest_mset_wire_format.pb.cc'; then $(CYGPATH_W) 'google/protobuf/unittest_mset_wire_format.pb.cc'; else $(CYGPATH_W) '$(srcdir)/google/protobuf/unittest_mset_wire_format.pb.cc'; fi` - -google/protobuf/no_warning_test-unittest_no_field_presence.pb.o: google/protobuf/unittest_no_field_presence.pb.cc -@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(no_warning_test_CXXFLAGS) $(CXXFLAGS) -MT google/protobuf/no_warning_test-unittest_no_field_presence.pb.o -MD -MP -MF google/protobuf/$(DEPDIR)/no_warning_test-unittest_no_field_presence.pb.Tpo -c -o google/protobuf/no_warning_test-unittest_no_field_presence.pb.o `test -f 'google/protobuf/unittest_no_field_presence.pb.cc' || echo '$(srcdir)/'`google/protobuf/unittest_no_field_presence.pb.cc -@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) google/protobuf/$(DEPDIR)/no_warning_test-unittest_no_field_presence.pb.Tpo google/protobuf/$(DEPDIR)/no_warning_test-unittest_no_field_presence.pb.Po -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='google/protobuf/unittest_no_field_presence.pb.cc' object='google/protobuf/no_warning_test-unittest_no_field_presence.pb.o' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(no_warning_test_CXXFLAGS) $(CXXFLAGS) -c -o google/protobuf/no_warning_test-unittest_no_field_presence.pb.o `test -f 'google/protobuf/unittest_no_field_presence.pb.cc' || echo '$(srcdir)/'`google/protobuf/unittest_no_field_presence.pb.cc - -google/protobuf/no_warning_test-unittest_no_field_presence.pb.obj: google/protobuf/unittest_no_field_presence.pb.cc -@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(no_warning_test_CXXFLAGS) $(CXXFLAGS) -MT google/protobuf/no_warning_test-unittest_no_field_presence.pb.obj -MD -MP -MF google/protobuf/$(DEPDIR)/no_warning_test-unittest_no_field_presence.pb.Tpo -c -o google/protobuf/no_warning_test-unittest_no_field_presence.pb.obj `if test -f 'google/protobuf/unittest_no_field_presence.pb.cc'; then $(CYGPATH_W) 'google/protobuf/unittest_no_field_presence.pb.cc'; else $(CYGPATH_W) '$(srcdir)/google/protobuf/unittest_no_field_presence.pb.cc'; fi` -@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) google/protobuf/$(DEPDIR)/no_warning_test-unittest_no_field_presence.pb.Tpo google/protobuf/$(DEPDIR)/no_warning_test-unittest_no_field_presence.pb.Po -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='google/protobuf/unittest_no_field_presence.pb.cc' object='google/protobuf/no_warning_test-unittest_no_field_presence.pb.obj' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(no_warning_test_CXXFLAGS) $(CXXFLAGS) -c -o google/protobuf/no_warning_test-unittest_no_field_presence.pb.obj `if test -f 'google/protobuf/unittest_no_field_presence.pb.cc'; then $(CYGPATH_W) 'google/protobuf/unittest_no_field_presence.pb.cc'; else $(CYGPATH_W) '$(srcdir)/google/protobuf/unittest_no_field_presence.pb.cc'; fi` - -google/protobuf/no_warning_test-unittest_no_generic_services.pb.o: google/protobuf/unittest_no_generic_services.pb.cc -@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(no_warning_test_CXXFLAGS) $(CXXFLAGS) -MT google/protobuf/no_warning_test-unittest_no_generic_services.pb.o -MD -MP -MF google/protobuf/$(DEPDIR)/no_warning_test-unittest_no_generic_services.pb.Tpo -c -o google/protobuf/no_warning_test-unittest_no_generic_services.pb.o `test -f 'google/protobuf/unittest_no_generic_services.pb.cc' || echo '$(srcdir)/'`google/protobuf/unittest_no_generic_services.pb.cc -@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) google/protobuf/$(DEPDIR)/no_warning_test-unittest_no_generic_services.pb.Tpo google/protobuf/$(DEPDIR)/no_warning_test-unittest_no_generic_services.pb.Po -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='google/protobuf/unittest_no_generic_services.pb.cc' object='google/protobuf/no_warning_test-unittest_no_generic_services.pb.o' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(no_warning_test_CXXFLAGS) $(CXXFLAGS) -c -o google/protobuf/no_warning_test-unittest_no_generic_services.pb.o `test -f 'google/protobuf/unittest_no_generic_services.pb.cc' || echo '$(srcdir)/'`google/protobuf/unittest_no_generic_services.pb.cc - -google/protobuf/no_warning_test-unittest_no_generic_services.pb.obj: google/protobuf/unittest_no_generic_services.pb.cc -@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(no_warning_test_CXXFLAGS) $(CXXFLAGS) -MT google/protobuf/no_warning_test-unittest_no_generic_services.pb.obj -MD -MP -MF google/protobuf/$(DEPDIR)/no_warning_test-unittest_no_generic_services.pb.Tpo -c -o google/protobuf/no_warning_test-unittest_no_generic_services.pb.obj `if test -f 'google/protobuf/unittest_no_generic_services.pb.cc'; then $(CYGPATH_W) 'google/protobuf/unittest_no_generic_services.pb.cc'; else $(CYGPATH_W) '$(srcdir)/google/protobuf/unittest_no_generic_services.pb.cc'; fi` -@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) google/protobuf/$(DEPDIR)/no_warning_test-unittest_no_generic_services.pb.Tpo google/protobuf/$(DEPDIR)/no_warning_test-unittest_no_generic_services.pb.Po -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='google/protobuf/unittest_no_generic_services.pb.cc' object='google/protobuf/no_warning_test-unittest_no_generic_services.pb.obj' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(no_warning_test_CXXFLAGS) $(CXXFLAGS) -c -o google/protobuf/no_warning_test-unittest_no_generic_services.pb.obj `if test -f 'google/protobuf/unittest_no_generic_services.pb.cc'; then $(CYGPATH_W) 'google/protobuf/unittest_no_generic_services.pb.cc'; else $(CYGPATH_W) '$(srcdir)/google/protobuf/unittest_no_generic_services.pb.cc'; fi` - -google/protobuf/no_warning_test-unittest_optimize_for.pb.o: google/protobuf/unittest_optimize_for.pb.cc -@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(no_warning_test_CXXFLAGS) $(CXXFLAGS) -MT google/protobuf/no_warning_test-unittest_optimize_for.pb.o -MD -MP -MF google/protobuf/$(DEPDIR)/no_warning_test-unittest_optimize_for.pb.Tpo -c -o google/protobuf/no_warning_test-unittest_optimize_for.pb.o `test -f 'google/protobuf/unittest_optimize_for.pb.cc' || echo '$(srcdir)/'`google/protobuf/unittest_optimize_for.pb.cc -@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) google/protobuf/$(DEPDIR)/no_warning_test-unittest_optimize_for.pb.Tpo google/protobuf/$(DEPDIR)/no_warning_test-unittest_optimize_for.pb.Po -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='google/protobuf/unittest_optimize_for.pb.cc' object='google/protobuf/no_warning_test-unittest_optimize_for.pb.o' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(no_warning_test_CXXFLAGS) $(CXXFLAGS) -c -o google/protobuf/no_warning_test-unittest_optimize_for.pb.o `test -f 'google/protobuf/unittest_optimize_for.pb.cc' || echo '$(srcdir)/'`google/protobuf/unittest_optimize_for.pb.cc - -google/protobuf/no_warning_test-unittest_optimize_for.pb.obj: google/protobuf/unittest_optimize_for.pb.cc -@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(no_warning_test_CXXFLAGS) $(CXXFLAGS) -MT google/protobuf/no_warning_test-unittest_optimize_for.pb.obj -MD -MP -MF google/protobuf/$(DEPDIR)/no_warning_test-unittest_optimize_for.pb.Tpo -c -o google/protobuf/no_warning_test-unittest_optimize_for.pb.obj `if test -f 'google/protobuf/unittest_optimize_for.pb.cc'; then $(CYGPATH_W) 'google/protobuf/unittest_optimize_for.pb.cc'; else $(CYGPATH_W) '$(srcdir)/google/protobuf/unittest_optimize_for.pb.cc'; fi` -@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) google/protobuf/$(DEPDIR)/no_warning_test-unittest_optimize_for.pb.Tpo google/protobuf/$(DEPDIR)/no_warning_test-unittest_optimize_for.pb.Po -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='google/protobuf/unittest_optimize_for.pb.cc' object='google/protobuf/no_warning_test-unittest_optimize_for.pb.obj' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(no_warning_test_CXXFLAGS) $(CXXFLAGS) -c -o google/protobuf/no_warning_test-unittest_optimize_for.pb.obj `if test -f 'google/protobuf/unittest_optimize_for.pb.cc'; then $(CYGPATH_W) 'google/protobuf/unittest_optimize_for.pb.cc'; else $(CYGPATH_W) '$(srcdir)/google/protobuf/unittest_optimize_for.pb.cc'; fi` - -google/protobuf/no_warning_test-unittest_preserve_unknown_enum.pb.o: google/protobuf/unittest_preserve_unknown_enum.pb.cc -@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(no_warning_test_CXXFLAGS) $(CXXFLAGS) -MT google/protobuf/no_warning_test-unittest_preserve_unknown_enum.pb.o -MD -MP -MF google/protobuf/$(DEPDIR)/no_warning_test-unittest_preserve_unknown_enum.pb.Tpo -c -o google/protobuf/no_warning_test-unittest_preserve_unknown_enum.pb.o `test -f 'google/protobuf/unittest_preserve_unknown_enum.pb.cc' || echo '$(srcdir)/'`google/protobuf/unittest_preserve_unknown_enum.pb.cc -@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) google/protobuf/$(DEPDIR)/no_warning_test-unittest_preserve_unknown_enum.pb.Tpo google/protobuf/$(DEPDIR)/no_warning_test-unittest_preserve_unknown_enum.pb.Po -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='google/protobuf/unittest_preserve_unknown_enum.pb.cc' object='google/protobuf/no_warning_test-unittest_preserve_unknown_enum.pb.o' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(no_warning_test_CXXFLAGS) $(CXXFLAGS) -c -o google/protobuf/no_warning_test-unittest_preserve_unknown_enum.pb.o `test -f 'google/protobuf/unittest_preserve_unknown_enum.pb.cc' || echo '$(srcdir)/'`google/protobuf/unittest_preserve_unknown_enum.pb.cc - -google/protobuf/no_warning_test-unittest_preserve_unknown_enum.pb.obj: google/protobuf/unittest_preserve_unknown_enum.pb.cc -@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(no_warning_test_CXXFLAGS) $(CXXFLAGS) -MT google/protobuf/no_warning_test-unittest_preserve_unknown_enum.pb.obj -MD -MP -MF google/protobuf/$(DEPDIR)/no_warning_test-unittest_preserve_unknown_enum.pb.Tpo -c -o google/protobuf/no_warning_test-unittest_preserve_unknown_enum.pb.obj `if test -f 'google/protobuf/unittest_preserve_unknown_enum.pb.cc'; then $(CYGPATH_W) 'google/protobuf/unittest_preserve_unknown_enum.pb.cc'; else $(CYGPATH_W) '$(srcdir)/google/protobuf/unittest_preserve_unknown_enum.pb.cc'; fi` -@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) google/protobuf/$(DEPDIR)/no_warning_test-unittest_preserve_unknown_enum.pb.Tpo google/protobuf/$(DEPDIR)/no_warning_test-unittest_preserve_unknown_enum.pb.Po -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='google/protobuf/unittest_preserve_unknown_enum.pb.cc' object='google/protobuf/no_warning_test-unittest_preserve_unknown_enum.pb.obj' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(no_warning_test_CXXFLAGS) $(CXXFLAGS) -c -o google/protobuf/no_warning_test-unittest_preserve_unknown_enum.pb.obj `if test -f 'google/protobuf/unittest_preserve_unknown_enum.pb.cc'; then $(CYGPATH_W) 'google/protobuf/unittest_preserve_unknown_enum.pb.cc'; else $(CYGPATH_W) '$(srcdir)/google/protobuf/unittest_preserve_unknown_enum.pb.cc'; fi` - -google/protobuf/no_warning_test-unittest_preserve_unknown_enum2.pb.o: google/protobuf/unittest_preserve_unknown_enum2.pb.cc -@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(no_warning_test_CXXFLAGS) $(CXXFLAGS) -MT google/protobuf/no_warning_test-unittest_preserve_unknown_enum2.pb.o -MD -MP -MF google/protobuf/$(DEPDIR)/no_warning_test-unittest_preserve_unknown_enum2.pb.Tpo -c -o google/protobuf/no_warning_test-unittest_preserve_unknown_enum2.pb.o `test -f 'google/protobuf/unittest_preserve_unknown_enum2.pb.cc' || echo '$(srcdir)/'`google/protobuf/unittest_preserve_unknown_enum2.pb.cc -@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) google/protobuf/$(DEPDIR)/no_warning_test-unittest_preserve_unknown_enum2.pb.Tpo google/protobuf/$(DEPDIR)/no_warning_test-unittest_preserve_unknown_enum2.pb.Po -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='google/protobuf/unittest_preserve_unknown_enum2.pb.cc' object='google/protobuf/no_warning_test-unittest_preserve_unknown_enum2.pb.o' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(no_warning_test_CXXFLAGS) $(CXXFLAGS) -c -o google/protobuf/no_warning_test-unittest_preserve_unknown_enum2.pb.o `test -f 'google/protobuf/unittest_preserve_unknown_enum2.pb.cc' || echo '$(srcdir)/'`google/protobuf/unittest_preserve_unknown_enum2.pb.cc - -google/protobuf/no_warning_test-unittest_preserve_unknown_enum2.pb.obj: google/protobuf/unittest_preserve_unknown_enum2.pb.cc -@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(no_warning_test_CXXFLAGS) $(CXXFLAGS) -MT google/protobuf/no_warning_test-unittest_preserve_unknown_enum2.pb.obj -MD -MP -MF google/protobuf/$(DEPDIR)/no_warning_test-unittest_preserve_unknown_enum2.pb.Tpo -c -o google/protobuf/no_warning_test-unittest_preserve_unknown_enum2.pb.obj `if test -f 'google/protobuf/unittest_preserve_unknown_enum2.pb.cc'; then $(CYGPATH_W) 'google/protobuf/unittest_preserve_unknown_enum2.pb.cc'; else $(CYGPATH_W) '$(srcdir)/google/protobuf/unittest_preserve_unknown_enum2.pb.cc'; fi` -@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) google/protobuf/$(DEPDIR)/no_warning_test-unittest_preserve_unknown_enum2.pb.Tpo google/protobuf/$(DEPDIR)/no_warning_test-unittest_preserve_unknown_enum2.pb.Po -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='google/protobuf/unittest_preserve_unknown_enum2.pb.cc' object='google/protobuf/no_warning_test-unittest_preserve_unknown_enum2.pb.obj' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(no_warning_test_CXXFLAGS) $(CXXFLAGS) -c -o google/protobuf/no_warning_test-unittest_preserve_unknown_enum2.pb.obj `if test -f 'google/protobuf/unittest_preserve_unknown_enum2.pb.cc'; then $(CYGPATH_W) 'google/protobuf/unittest_preserve_unknown_enum2.pb.cc'; else $(CYGPATH_W) '$(srcdir)/google/protobuf/unittest_preserve_unknown_enum2.pb.cc'; fi` - -google/protobuf/no_warning_test-unittest_proto3.pb.o: google/protobuf/unittest_proto3.pb.cc -@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(no_warning_test_CXXFLAGS) $(CXXFLAGS) -MT google/protobuf/no_warning_test-unittest_proto3.pb.o -MD -MP -MF google/protobuf/$(DEPDIR)/no_warning_test-unittest_proto3.pb.Tpo -c -o google/protobuf/no_warning_test-unittest_proto3.pb.o `test -f 'google/protobuf/unittest_proto3.pb.cc' || echo '$(srcdir)/'`google/protobuf/unittest_proto3.pb.cc -@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) google/protobuf/$(DEPDIR)/no_warning_test-unittest_proto3.pb.Tpo google/protobuf/$(DEPDIR)/no_warning_test-unittest_proto3.pb.Po -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='google/protobuf/unittest_proto3.pb.cc' object='google/protobuf/no_warning_test-unittest_proto3.pb.o' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(no_warning_test_CXXFLAGS) $(CXXFLAGS) -c -o google/protobuf/no_warning_test-unittest_proto3.pb.o `test -f 'google/protobuf/unittest_proto3.pb.cc' || echo '$(srcdir)/'`google/protobuf/unittest_proto3.pb.cc - -google/protobuf/no_warning_test-unittest_proto3.pb.obj: google/protobuf/unittest_proto3.pb.cc -@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(no_warning_test_CXXFLAGS) $(CXXFLAGS) -MT google/protobuf/no_warning_test-unittest_proto3.pb.obj -MD -MP -MF google/protobuf/$(DEPDIR)/no_warning_test-unittest_proto3.pb.Tpo -c -o google/protobuf/no_warning_test-unittest_proto3.pb.obj `if test -f 'google/protobuf/unittest_proto3.pb.cc'; then $(CYGPATH_W) 'google/protobuf/unittest_proto3.pb.cc'; else $(CYGPATH_W) '$(srcdir)/google/protobuf/unittest_proto3.pb.cc'; fi` -@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) google/protobuf/$(DEPDIR)/no_warning_test-unittest_proto3.pb.Tpo google/protobuf/$(DEPDIR)/no_warning_test-unittest_proto3.pb.Po -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='google/protobuf/unittest_proto3.pb.cc' object='google/protobuf/no_warning_test-unittest_proto3.pb.obj' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(no_warning_test_CXXFLAGS) $(CXXFLAGS) -c -o google/protobuf/no_warning_test-unittest_proto3.pb.obj `if test -f 'google/protobuf/unittest_proto3.pb.cc'; then $(CYGPATH_W) 'google/protobuf/unittest_proto3.pb.cc'; else $(CYGPATH_W) '$(srcdir)/google/protobuf/unittest_proto3.pb.cc'; fi` - -google/protobuf/no_warning_test-unittest_proto3_arena.pb.o: google/protobuf/unittest_proto3_arena.pb.cc -@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(no_warning_test_CXXFLAGS) $(CXXFLAGS) -MT google/protobuf/no_warning_test-unittest_proto3_arena.pb.o -MD -MP -MF google/protobuf/$(DEPDIR)/no_warning_test-unittest_proto3_arena.pb.Tpo -c -o google/protobuf/no_warning_test-unittest_proto3_arena.pb.o `test -f 'google/protobuf/unittest_proto3_arena.pb.cc' || echo '$(srcdir)/'`google/protobuf/unittest_proto3_arena.pb.cc -@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) google/protobuf/$(DEPDIR)/no_warning_test-unittest_proto3_arena.pb.Tpo google/protobuf/$(DEPDIR)/no_warning_test-unittest_proto3_arena.pb.Po -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='google/protobuf/unittest_proto3_arena.pb.cc' object='google/protobuf/no_warning_test-unittest_proto3_arena.pb.o' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(no_warning_test_CXXFLAGS) $(CXXFLAGS) -c -o google/protobuf/no_warning_test-unittest_proto3_arena.pb.o `test -f 'google/protobuf/unittest_proto3_arena.pb.cc' || echo '$(srcdir)/'`google/protobuf/unittest_proto3_arena.pb.cc - -google/protobuf/no_warning_test-unittest_proto3_arena.pb.obj: google/protobuf/unittest_proto3_arena.pb.cc -@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(no_warning_test_CXXFLAGS) $(CXXFLAGS) -MT google/protobuf/no_warning_test-unittest_proto3_arena.pb.obj -MD -MP -MF google/protobuf/$(DEPDIR)/no_warning_test-unittest_proto3_arena.pb.Tpo -c -o google/protobuf/no_warning_test-unittest_proto3_arena.pb.obj `if test -f 'google/protobuf/unittest_proto3_arena.pb.cc'; then $(CYGPATH_W) 'google/protobuf/unittest_proto3_arena.pb.cc'; else $(CYGPATH_W) '$(srcdir)/google/protobuf/unittest_proto3_arena.pb.cc'; fi` -@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) google/protobuf/$(DEPDIR)/no_warning_test-unittest_proto3_arena.pb.Tpo google/protobuf/$(DEPDIR)/no_warning_test-unittest_proto3_arena.pb.Po -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='google/protobuf/unittest_proto3_arena.pb.cc' object='google/protobuf/no_warning_test-unittest_proto3_arena.pb.obj' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(no_warning_test_CXXFLAGS) $(CXXFLAGS) -c -o google/protobuf/no_warning_test-unittest_proto3_arena.pb.obj `if test -f 'google/protobuf/unittest_proto3_arena.pb.cc'; then $(CYGPATH_W) 'google/protobuf/unittest_proto3_arena.pb.cc'; else $(CYGPATH_W) '$(srcdir)/google/protobuf/unittest_proto3_arena.pb.cc'; fi` - -google/protobuf/no_warning_test-unittest_proto3_arena_lite.pb.o: google/protobuf/unittest_proto3_arena_lite.pb.cc -@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(no_warning_test_CXXFLAGS) $(CXXFLAGS) -MT google/protobuf/no_warning_test-unittest_proto3_arena_lite.pb.o -MD -MP -MF google/protobuf/$(DEPDIR)/no_warning_test-unittest_proto3_arena_lite.pb.Tpo -c -o google/protobuf/no_warning_test-unittest_proto3_arena_lite.pb.o `test -f 'google/protobuf/unittest_proto3_arena_lite.pb.cc' || echo '$(srcdir)/'`google/protobuf/unittest_proto3_arena_lite.pb.cc -@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) google/protobuf/$(DEPDIR)/no_warning_test-unittest_proto3_arena_lite.pb.Tpo google/protobuf/$(DEPDIR)/no_warning_test-unittest_proto3_arena_lite.pb.Po -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='google/protobuf/unittest_proto3_arena_lite.pb.cc' object='google/protobuf/no_warning_test-unittest_proto3_arena_lite.pb.o' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(no_warning_test_CXXFLAGS) $(CXXFLAGS) -c -o google/protobuf/no_warning_test-unittest_proto3_arena_lite.pb.o `test -f 'google/protobuf/unittest_proto3_arena_lite.pb.cc' || echo '$(srcdir)/'`google/protobuf/unittest_proto3_arena_lite.pb.cc - -google/protobuf/no_warning_test-unittest_proto3_arena_lite.pb.obj: google/protobuf/unittest_proto3_arena_lite.pb.cc -@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(no_warning_test_CXXFLAGS) $(CXXFLAGS) -MT google/protobuf/no_warning_test-unittest_proto3_arena_lite.pb.obj -MD -MP -MF google/protobuf/$(DEPDIR)/no_warning_test-unittest_proto3_arena_lite.pb.Tpo -c -o google/protobuf/no_warning_test-unittest_proto3_arena_lite.pb.obj `if test -f 'google/protobuf/unittest_proto3_arena_lite.pb.cc'; then $(CYGPATH_W) 'google/protobuf/unittest_proto3_arena_lite.pb.cc'; else $(CYGPATH_W) '$(srcdir)/google/protobuf/unittest_proto3_arena_lite.pb.cc'; fi` -@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) google/protobuf/$(DEPDIR)/no_warning_test-unittest_proto3_arena_lite.pb.Tpo google/protobuf/$(DEPDIR)/no_warning_test-unittest_proto3_arena_lite.pb.Po -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='google/protobuf/unittest_proto3_arena_lite.pb.cc' object='google/protobuf/no_warning_test-unittest_proto3_arena_lite.pb.obj' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(no_warning_test_CXXFLAGS) $(CXXFLAGS) -c -o google/protobuf/no_warning_test-unittest_proto3_arena_lite.pb.obj `if test -f 'google/protobuf/unittest_proto3_arena_lite.pb.cc'; then $(CYGPATH_W) 'google/protobuf/unittest_proto3_arena_lite.pb.cc'; else $(CYGPATH_W) '$(srcdir)/google/protobuf/unittest_proto3_arena_lite.pb.cc'; fi` - -google/protobuf/no_warning_test-unittest_proto3_lite.pb.o: google/protobuf/unittest_proto3_lite.pb.cc -@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(no_warning_test_CXXFLAGS) $(CXXFLAGS) -MT google/protobuf/no_warning_test-unittest_proto3_lite.pb.o -MD -MP -MF google/protobuf/$(DEPDIR)/no_warning_test-unittest_proto3_lite.pb.Tpo -c -o google/protobuf/no_warning_test-unittest_proto3_lite.pb.o `test -f 'google/protobuf/unittest_proto3_lite.pb.cc' || echo '$(srcdir)/'`google/protobuf/unittest_proto3_lite.pb.cc -@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) google/protobuf/$(DEPDIR)/no_warning_test-unittest_proto3_lite.pb.Tpo google/protobuf/$(DEPDIR)/no_warning_test-unittest_proto3_lite.pb.Po -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='google/protobuf/unittest_proto3_lite.pb.cc' object='google/protobuf/no_warning_test-unittest_proto3_lite.pb.o' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(no_warning_test_CXXFLAGS) $(CXXFLAGS) -c -o google/protobuf/no_warning_test-unittest_proto3_lite.pb.o `test -f 'google/protobuf/unittest_proto3_lite.pb.cc' || echo '$(srcdir)/'`google/protobuf/unittest_proto3_lite.pb.cc - -google/protobuf/no_warning_test-unittest_proto3_lite.pb.obj: google/protobuf/unittest_proto3_lite.pb.cc -@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(no_warning_test_CXXFLAGS) $(CXXFLAGS) -MT google/protobuf/no_warning_test-unittest_proto3_lite.pb.obj -MD -MP -MF google/protobuf/$(DEPDIR)/no_warning_test-unittest_proto3_lite.pb.Tpo -c -o google/protobuf/no_warning_test-unittest_proto3_lite.pb.obj `if test -f 'google/protobuf/unittest_proto3_lite.pb.cc'; then $(CYGPATH_W) 'google/protobuf/unittest_proto3_lite.pb.cc'; else $(CYGPATH_W) '$(srcdir)/google/protobuf/unittest_proto3_lite.pb.cc'; fi` -@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) google/protobuf/$(DEPDIR)/no_warning_test-unittest_proto3_lite.pb.Tpo google/protobuf/$(DEPDIR)/no_warning_test-unittest_proto3_lite.pb.Po -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='google/protobuf/unittest_proto3_lite.pb.cc' object='google/protobuf/no_warning_test-unittest_proto3_lite.pb.obj' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(no_warning_test_CXXFLAGS) $(CXXFLAGS) -c -o google/protobuf/no_warning_test-unittest_proto3_lite.pb.obj `if test -f 'google/protobuf/unittest_proto3_lite.pb.cc'; then $(CYGPATH_W) 'google/protobuf/unittest_proto3_lite.pb.cc'; else $(CYGPATH_W) '$(srcdir)/google/protobuf/unittest_proto3_lite.pb.cc'; fi` - -google/protobuf/no_warning_test-unittest_proto3_optional.pb.o: google/protobuf/unittest_proto3_optional.pb.cc -@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(no_warning_test_CXXFLAGS) $(CXXFLAGS) -MT google/protobuf/no_warning_test-unittest_proto3_optional.pb.o -MD -MP -MF google/protobuf/$(DEPDIR)/no_warning_test-unittest_proto3_optional.pb.Tpo -c -o google/protobuf/no_warning_test-unittest_proto3_optional.pb.o `test -f 'google/protobuf/unittest_proto3_optional.pb.cc' || echo '$(srcdir)/'`google/protobuf/unittest_proto3_optional.pb.cc -@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) google/protobuf/$(DEPDIR)/no_warning_test-unittest_proto3_optional.pb.Tpo google/protobuf/$(DEPDIR)/no_warning_test-unittest_proto3_optional.pb.Po -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='google/protobuf/unittest_proto3_optional.pb.cc' object='google/protobuf/no_warning_test-unittest_proto3_optional.pb.o' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(no_warning_test_CXXFLAGS) $(CXXFLAGS) -c -o google/protobuf/no_warning_test-unittest_proto3_optional.pb.o `test -f 'google/protobuf/unittest_proto3_optional.pb.cc' || echo '$(srcdir)/'`google/protobuf/unittest_proto3_optional.pb.cc - -google/protobuf/no_warning_test-unittest_proto3_optional.pb.obj: google/protobuf/unittest_proto3_optional.pb.cc -@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(no_warning_test_CXXFLAGS) $(CXXFLAGS) -MT google/protobuf/no_warning_test-unittest_proto3_optional.pb.obj -MD -MP -MF google/protobuf/$(DEPDIR)/no_warning_test-unittest_proto3_optional.pb.Tpo -c -o google/protobuf/no_warning_test-unittest_proto3_optional.pb.obj `if test -f 'google/protobuf/unittest_proto3_optional.pb.cc'; then $(CYGPATH_W) 'google/protobuf/unittest_proto3_optional.pb.cc'; else $(CYGPATH_W) '$(srcdir)/google/protobuf/unittest_proto3_optional.pb.cc'; fi` -@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) google/protobuf/$(DEPDIR)/no_warning_test-unittest_proto3_optional.pb.Tpo google/protobuf/$(DEPDIR)/no_warning_test-unittest_proto3_optional.pb.Po -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='google/protobuf/unittest_proto3_optional.pb.cc' object='google/protobuf/no_warning_test-unittest_proto3_optional.pb.obj' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(no_warning_test_CXXFLAGS) $(CXXFLAGS) -c -o google/protobuf/no_warning_test-unittest_proto3_optional.pb.obj `if test -f 'google/protobuf/unittest_proto3_optional.pb.cc'; then $(CYGPATH_W) 'google/protobuf/unittest_proto3_optional.pb.cc'; else $(CYGPATH_W) '$(srcdir)/google/protobuf/unittest_proto3_optional.pb.cc'; fi` - -google/protobuf/no_warning_test-unittest_well_known_types.pb.o: google/protobuf/unittest_well_known_types.pb.cc -@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(no_warning_test_CXXFLAGS) $(CXXFLAGS) -MT google/protobuf/no_warning_test-unittest_well_known_types.pb.o -MD -MP -MF google/protobuf/$(DEPDIR)/no_warning_test-unittest_well_known_types.pb.Tpo -c -o google/protobuf/no_warning_test-unittest_well_known_types.pb.o `test -f 'google/protobuf/unittest_well_known_types.pb.cc' || echo '$(srcdir)/'`google/protobuf/unittest_well_known_types.pb.cc -@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) google/protobuf/$(DEPDIR)/no_warning_test-unittest_well_known_types.pb.Tpo google/protobuf/$(DEPDIR)/no_warning_test-unittest_well_known_types.pb.Po -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='google/protobuf/unittest_well_known_types.pb.cc' object='google/protobuf/no_warning_test-unittest_well_known_types.pb.o' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(no_warning_test_CXXFLAGS) $(CXXFLAGS) -c -o google/protobuf/no_warning_test-unittest_well_known_types.pb.o `test -f 'google/protobuf/unittest_well_known_types.pb.cc' || echo '$(srcdir)/'`google/protobuf/unittest_well_known_types.pb.cc - -google/protobuf/no_warning_test-unittest_well_known_types.pb.obj: google/protobuf/unittest_well_known_types.pb.cc -@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(no_warning_test_CXXFLAGS) $(CXXFLAGS) -MT google/protobuf/no_warning_test-unittest_well_known_types.pb.obj -MD -MP -MF google/protobuf/$(DEPDIR)/no_warning_test-unittest_well_known_types.pb.Tpo -c -o google/protobuf/no_warning_test-unittest_well_known_types.pb.obj `if test -f 'google/protobuf/unittest_well_known_types.pb.cc'; then $(CYGPATH_W) 'google/protobuf/unittest_well_known_types.pb.cc'; else $(CYGPATH_W) '$(srcdir)/google/protobuf/unittest_well_known_types.pb.cc'; fi` -@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) google/protobuf/$(DEPDIR)/no_warning_test-unittest_well_known_types.pb.Tpo google/protobuf/$(DEPDIR)/no_warning_test-unittest_well_known_types.pb.Po -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='google/protobuf/unittest_well_known_types.pb.cc' object='google/protobuf/no_warning_test-unittest_well_known_types.pb.obj' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(no_warning_test_CXXFLAGS) $(CXXFLAGS) -c -o google/protobuf/no_warning_test-unittest_well_known_types.pb.obj `if test -f 'google/protobuf/unittest_well_known_types.pb.cc'; then $(CYGPATH_W) 'google/protobuf/unittest_well_known_types.pb.cc'; else $(CYGPATH_W) '$(srcdir)/google/protobuf/unittest_well_known_types.pb.cc'; fi` - -google/protobuf/util/internal/testdata/no_warning_test-anys.pb.o: google/protobuf/util/internal/testdata/anys.pb.cc -@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(no_warning_test_CXXFLAGS) $(CXXFLAGS) -MT google/protobuf/util/internal/testdata/no_warning_test-anys.pb.o -MD -MP -MF google/protobuf/util/internal/testdata/$(DEPDIR)/no_warning_test-anys.pb.Tpo -c -o google/protobuf/util/internal/testdata/no_warning_test-anys.pb.o `test -f 'google/protobuf/util/internal/testdata/anys.pb.cc' || echo '$(srcdir)/'`google/protobuf/util/internal/testdata/anys.pb.cc -@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) google/protobuf/util/internal/testdata/$(DEPDIR)/no_warning_test-anys.pb.Tpo google/protobuf/util/internal/testdata/$(DEPDIR)/no_warning_test-anys.pb.Po -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='google/protobuf/util/internal/testdata/anys.pb.cc' object='google/protobuf/util/internal/testdata/no_warning_test-anys.pb.o' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(no_warning_test_CXXFLAGS) $(CXXFLAGS) -c -o google/protobuf/util/internal/testdata/no_warning_test-anys.pb.o `test -f 'google/protobuf/util/internal/testdata/anys.pb.cc' || echo '$(srcdir)/'`google/protobuf/util/internal/testdata/anys.pb.cc - -google/protobuf/util/internal/testdata/no_warning_test-anys.pb.obj: google/protobuf/util/internal/testdata/anys.pb.cc -@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(no_warning_test_CXXFLAGS) $(CXXFLAGS) -MT google/protobuf/util/internal/testdata/no_warning_test-anys.pb.obj -MD -MP -MF google/protobuf/util/internal/testdata/$(DEPDIR)/no_warning_test-anys.pb.Tpo -c -o google/protobuf/util/internal/testdata/no_warning_test-anys.pb.obj `if test -f 'google/protobuf/util/internal/testdata/anys.pb.cc'; then $(CYGPATH_W) 'google/protobuf/util/internal/testdata/anys.pb.cc'; else $(CYGPATH_W) '$(srcdir)/google/protobuf/util/internal/testdata/anys.pb.cc'; fi` -@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) google/protobuf/util/internal/testdata/$(DEPDIR)/no_warning_test-anys.pb.Tpo google/protobuf/util/internal/testdata/$(DEPDIR)/no_warning_test-anys.pb.Po -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='google/protobuf/util/internal/testdata/anys.pb.cc' object='google/protobuf/util/internal/testdata/no_warning_test-anys.pb.obj' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(no_warning_test_CXXFLAGS) $(CXXFLAGS) -c -o google/protobuf/util/internal/testdata/no_warning_test-anys.pb.obj `if test -f 'google/protobuf/util/internal/testdata/anys.pb.cc'; then $(CYGPATH_W) 'google/protobuf/util/internal/testdata/anys.pb.cc'; else $(CYGPATH_W) '$(srcdir)/google/protobuf/util/internal/testdata/anys.pb.cc'; fi` - -google/protobuf/util/internal/testdata/no_warning_test-books.pb.o: google/protobuf/util/internal/testdata/books.pb.cc -@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(no_warning_test_CXXFLAGS) $(CXXFLAGS) -MT google/protobuf/util/internal/testdata/no_warning_test-books.pb.o -MD -MP -MF google/protobuf/util/internal/testdata/$(DEPDIR)/no_warning_test-books.pb.Tpo -c -o google/protobuf/util/internal/testdata/no_warning_test-books.pb.o `test -f 'google/protobuf/util/internal/testdata/books.pb.cc' || echo '$(srcdir)/'`google/protobuf/util/internal/testdata/books.pb.cc -@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) google/protobuf/util/internal/testdata/$(DEPDIR)/no_warning_test-books.pb.Tpo google/protobuf/util/internal/testdata/$(DEPDIR)/no_warning_test-books.pb.Po -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='google/protobuf/util/internal/testdata/books.pb.cc' object='google/protobuf/util/internal/testdata/no_warning_test-books.pb.o' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(no_warning_test_CXXFLAGS) $(CXXFLAGS) -c -o google/protobuf/util/internal/testdata/no_warning_test-books.pb.o `test -f 'google/protobuf/util/internal/testdata/books.pb.cc' || echo '$(srcdir)/'`google/protobuf/util/internal/testdata/books.pb.cc - -google/protobuf/util/internal/testdata/no_warning_test-books.pb.obj: google/protobuf/util/internal/testdata/books.pb.cc -@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(no_warning_test_CXXFLAGS) $(CXXFLAGS) -MT google/protobuf/util/internal/testdata/no_warning_test-books.pb.obj -MD -MP -MF google/protobuf/util/internal/testdata/$(DEPDIR)/no_warning_test-books.pb.Tpo -c -o google/protobuf/util/internal/testdata/no_warning_test-books.pb.obj `if test -f 'google/protobuf/util/internal/testdata/books.pb.cc'; then $(CYGPATH_W) 'google/protobuf/util/internal/testdata/books.pb.cc'; else $(CYGPATH_W) '$(srcdir)/google/protobuf/util/internal/testdata/books.pb.cc'; fi` -@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) google/protobuf/util/internal/testdata/$(DEPDIR)/no_warning_test-books.pb.Tpo google/protobuf/util/internal/testdata/$(DEPDIR)/no_warning_test-books.pb.Po -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='google/protobuf/util/internal/testdata/books.pb.cc' object='google/protobuf/util/internal/testdata/no_warning_test-books.pb.obj' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(no_warning_test_CXXFLAGS) $(CXXFLAGS) -c -o google/protobuf/util/internal/testdata/no_warning_test-books.pb.obj `if test -f 'google/protobuf/util/internal/testdata/books.pb.cc'; then $(CYGPATH_W) 'google/protobuf/util/internal/testdata/books.pb.cc'; else $(CYGPATH_W) '$(srcdir)/google/protobuf/util/internal/testdata/books.pb.cc'; fi` - -google/protobuf/util/internal/testdata/no_warning_test-default_value.pb.o: google/protobuf/util/internal/testdata/default_value.pb.cc -@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(no_warning_test_CXXFLAGS) $(CXXFLAGS) -MT google/protobuf/util/internal/testdata/no_warning_test-default_value.pb.o -MD -MP -MF google/protobuf/util/internal/testdata/$(DEPDIR)/no_warning_test-default_value.pb.Tpo -c -o google/protobuf/util/internal/testdata/no_warning_test-default_value.pb.o `test -f 'google/protobuf/util/internal/testdata/default_value.pb.cc' || echo '$(srcdir)/'`google/protobuf/util/internal/testdata/default_value.pb.cc -@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) google/protobuf/util/internal/testdata/$(DEPDIR)/no_warning_test-default_value.pb.Tpo google/protobuf/util/internal/testdata/$(DEPDIR)/no_warning_test-default_value.pb.Po -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='google/protobuf/util/internal/testdata/default_value.pb.cc' object='google/protobuf/util/internal/testdata/no_warning_test-default_value.pb.o' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(no_warning_test_CXXFLAGS) $(CXXFLAGS) -c -o google/protobuf/util/internal/testdata/no_warning_test-default_value.pb.o `test -f 'google/protobuf/util/internal/testdata/default_value.pb.cc' || echo '$(srcdir)/'`google/protobuf/util/internal/testdata/default_value.pb.cc - -google/protobuf/util/internal/testdata/no_warning_test-default_value.pb.obj: google/protobuf/util/internal/testdata/default_value.pb.cc -@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(no_warning_test_CXXFLAGS) $(CXXFLAGS) -MT google/protobuf/util/internal/testdata/no_warning_test-default_value.pb.obj -MD -MP -MF google/protobuf/util/internal/testdata/$(DEPDIR)/no_warning_test-default_value.pb.Tpo -c -o google/protobuf/util/internal/testdata/no_warning_test-default_value.pb.obj `if test -f 'google/protobuf/util/internal/testdata/default_value.pb.cc'; then $(CYGPATH_W) 'google/protobuf/util/internal/testdata/default_value.pb.cc'; else $(CYGPATH_W) '$(srcdir)/google/protobuf/util/internal/testdata/default_value.pb.cc'; fi` -@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) google/protobuf/util/internal/testdata/$(DEPDIR)/no_warning_test-default_value.pb.Tpo google/protobuf/util/internal/testdata/$(DEPDIR)/no_warning_test-default_value.pb.Po -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='google/protobuf/util/internal/testdata/default_value.pb.cc' object='google/protobuf/util/internal/testdata/no_warning_test-default_value.pb.obj' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(no_warning_test_CXXFLAGS) $(CXXFLAGS) -c -o google/protobuf/util/internal/testdata/no_warning_test-default_value.pb.obj `if test -f 'google/protobuf/util/internal/testdata/default_value.pb.cc'; then $(CYGPATH_W) 'google/protobuf/util/internal/testdata/default_value.pb.cc'; else $(CYGPATH_W) '$(srcdir)/google/protobuf/util/internal/testdata/default_value.pb.cc'; fi` - -google/protobuf/util/internal/testdata/no_warning_test-default_value_test.pb.o: google/protobuf/util/internal/testdata/default_value_test.pb.cc -@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(no_warning_test_CXXFLAGS) $(CXXFLAGS) -MT google/protobuf/util/internal/testdata/no_warning_test-default_value_test.pb.o -MD -MP -MF google/protobuf/util/internal/testdata/$(DEPDIR)/no_warning_test-default_value_test.pb.Tpo -c -o google/protobuf/util/internal/testdata/no_warning_test-default_value_test.pb.o `test -f 'google/protobuf/util/internal/testdata/default_value_test.pb.cc' || echo '$(srcdir)/'`google/protobuf/util/internal/testdata/default_value_test.pb.cc -@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) google/protobuf/util/internal/testdata/$(DEPDIR)/no_warning_test-default_value_test.pb.Tpo google/protobuf/util/internal/testdata/$(DEPDIR)/no_warning_test-default_value_test.pb.Po -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='google/protobuf/util/internal/testdata/default_value_test.pb.cc' object='google/protobuf/util/internal/testdata/no_warning_test-default_value_test.pb.o' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(no_warning_test_CXXFLAGS) $(CXXFLAGS) -c -o google/protobuf/util/internal/testdata/no_warning_test-default_value_test.pb.o `test -f 'google/protobuf/util/internal/testdata/default_value_test.pb.cc' || echo '$(srcdir)/'`google/protobuf/util/internal/testdata/default_value_test.pb.cc - -google/protobuf/util/internal/testdata/no_warning_test-default_value_test.pb.obj: google/protobuf/util/internal/testdata/default_value_test.pb.cc -@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(no_warning_test_CXXFLAGS) $(CXXFLAGS) -MT google/protobuf/util/internal/testdata/no_warning_test-default_value_test.pb.obj -MD -MP -MF google/protobuf/util/internal/testdata/$(DEPDIR)/no_warning_test-default_value_test.pb.Tpo -c -o google/protobuf/util/internal/testdata/no_warning_test-default_value_test.pb.obj `if test -f 'google/protobuf/util/internal/testdata/default_value_test.pb.cc'; then $(CYGPATH_W) 'google/protobuf/util/internal/testdata/default_value_test.pb.cc'; else $(CYGPATH_W) '$(srcdir)/google/protobuf/util/internal/testdata/default_value_test.pb.cc'; fi` -@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) google/protobuf/util/internal/testdata/$(DEPDIR)/no_warning_test-default_value_test.pb.Tpo google/protobuf/util/internal/testdata/$(DEPDIR)/no_warning_test-default_value_test.pb.Po -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='google/protobuf/util/internal/testdata/default_value_test.pb.cc' object='google/protobuf/util/internal/testdata/no_warning_test-default_value_test.pb.obj' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(no_warning_test_CXXFLAGS) $(CXXFLAGS) -c -o google/protobuf/util/internal/testdata/no_warning_test-default_value_test.pb.obj `if test -f 'google/protobuf/util/internal/testdata/default_value_test.pb.cc'; then $(CYGPATH_W) 'google/protobuf/util/internal/testdata/default_value_test.pb.cc'; else $(CYGPATH_W) '$(srcdir)/google/protobuf/util/internal/testdata/default_value_test.pb.cc'; fi` - -google/protobuf/util/internal/testdata/no_warning_test-field_mask.pb.o: google/protobuf/util/internal/testdata/field_mask.pb.cc -@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(no_warning_test_CXXFLAGS) $(CXXFLAGS) -MT google/protobuf/util/internal/testdata/no_warning_test-field_mask.pb.o -MD -MP -MF google/protobuf/util/internal/testdata/$(DEPDIR)/no_warning_test-field_mask.pb.Tpo -c -o google/protobuf/util/internal/testdata/no_warning_test-field_mask.pb.o `test -f 'google/protobuf/util/internal/testdata/field_mask.pb.cc' || echo '$(srcdir)/'`google/protobuf/util/internal/testdata/field_mask.pb.cc -@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) google/protobuf/util/internal/testdata/$(DEPDIR)/no_warning_test-field_mask.pb.Tpo google/protobuf/util/internal/testdata/$(DEPDIR)/no_warning_test-field_mask.pb.Po -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='google/protobuf/util/internal/testdata/field_mask.pb.cc' object='google/protobuf/util/internal/testdata/no_warning_test-field_mask.pb.o' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(no_warning_test_CXXFLAGS) $(CXXFLAGS) -c -o google/protobuf/util/internal/testdata/no_warning_test-field_mask.pb.o `test -f 'google/protobuf/util/internal/testdata/field_mask.pb.cc' || echo '$(srcdir)/'`google/protobuf/util/internal/testdata/field_mask.pb.cc - -google/protobuf/util/internal/testdata/no_warning_test-field_mask.pb.obj: google/protobuf/util/internal/testdata/field_mask.pb.cc -@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(no_warning_test_CXXFLAGS) $(CXXFLAGS) -MT google/protobuf/util/internal/testdata/no_warning_test-field_mask.pb.obj -MD -MP -MF google/protobuf/util/internal/testdata/$(DEPDIR)/no_warning_test-field_mask.pb.Tpo -c -o google/protobuf/util/internal/testdata/no_warning_test-field_mask.pb.obj `if test -f 'google/protobuf/util/internal/testdata/field_mask.pb.cc'; then $(CYGPATH_W) 'google/protobuf/util/internal/testdata/field_mask.pb.cc'; else $(CYGPATH_W) '$(srcdir)/google/protobuf/util/internal/testdata/field_mask.pb.cc'; fi` -@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) google/protobuf/util/internal/testdata/$(DEPDIR)/no_warning_test-field_mask.pb.Tpo google/protobuf/util/internal/testdata/$(DEPDIR)/no_warning_test-field_mask.pb.Po -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='google/protobuf/util/internal/testdata/field_mask.pb.cc' object='google/protobuf/util/internal/testdata/no_warning_test-field_mask.pb.obj' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(no_warning_test_CXXFLAGS) $(CXXFLAGS) -c -o google/protobuf/util/internal/testdata/no_warning_test-field_mask.pb.obj `if test -f 'google/protobuf/util/internal/testdata/field_mask.pb.cc'; then $(CYGPATH_W) 'google/protobuf/util/internal/testdata/field_mask.pb.cc'; else $(CYGPATH_W) '$(srcdir)/google/protobuf/util/internal/testdata/field_mask.pb.cc'; fi` - -google/protobuf/util/internal/testdata/no_warning_test-maps.pb.o: google/protobuf/util/internal/testdata/maps.pb.cc -@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(no_warning_test_CXXFLAGS) $(CXXFLAGS) -MT google/protobuf/util/internal/testdata/no_warning_test-maps.pb.o -MD -MP -MF google/protobuf/util/internal/testdata/$(DEPDIR)/no_warning_test-maps.pb.Tpo -c -o google/protobuf/util/internal/testdata/no_warning_test-maps.pb.o `test -f 'google/protobuf/util/internal/testdata/maps.pb.cc' || echo '$(srcdir)/'`google/protobuf/util/internal/testdata/maps.pb.cc -@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) google/protobuf/util/internal/testdata/$(DEPDIR)/no_warning_test-maps.pb.Tpo google/protobuf/util/internal/testdata/$(DEPDIR)/no_warning_test-maps.pb.Po -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='google/protobuf/util/internal/testdata/maps.pb.cc' object='google/protobuf/util/internal/testdata/no_warning_test-maps.pb.o' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(no_warning_test_CXXFLAGS) $(CXXFLAGS) -c -o google/protobuf/util/internal/testdata/no_warning_test-maps.pb.o `test -f 'google/protobuf/util/internal/testdata/maps.pb.cc' || echo '$(srcdir)/'`google/protobuf/util/internal/testdata/maps.pb.cc - -google/protobuf/util/internal/testdata/no_warning_test-maps.pb.obj: google/protobuf/util/internal/testdata/maps.pb.cc -@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(no_warning_test_CXXFLAGS) $(CXXFLAGS) -MT google/protobuf/util/internal/testdata/no_warning_test-maps.pb.obj -MD -MP -MF google/protobuf/util/internal/testdata/$(DEPDIR)/no_warning_test-maps.pb.Tpo -c -o google/protobuf/util/internal/testdata/no_warning_test-maps.pb.obj `if test -f 'google/protobuf/util/internal/testdata/maps.pb.cc'; then $(CYGPATH_W) 'google/protobuf/util/internal/testdata/maps.pb.cc'; else $(CYGPATH_W) '$(srcdir)/google/protobuf/util/internal/testdata/maps.pb.cc'; fi` -@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) google/protobuf/util/internal/testdata/$(DEPDIR)/no_warning_test-maps.pb.Tpo google/protobuf/util/internal/testdata/$(DEPDIR)/no_warning_test-maps.pb.Po -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='google/protobuf/util/internal/testdata/maps.pb.cc' object='google/protobuf/util/internal/testdata/no_warning_test-maps.pb.obj' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(no_warning_test_CXXFLAGS) $(CXXFLAGS) -c -o google/protobuf/util/internal/testdata/no_warning_test-maps.pb.obj `if test -f 'google/protobuf/util/internal/testdata/maps.pb.cc'; then $(CYGPATH_W) 'google/protobuf/util/internal/testdata/maps.pb.cc'; else $(CYGPATH_W) '$(srcdir)/google/protobuf/util/internal/testdata/maps.pb.cc'; fi` - -google/protobuf/util/internal/testdata/no_warning_test-oneofs.pb.o: google/protobuf/util/internal/testdata/oneofs.pb.cc -@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(no_warning_test_CXXFLAGS) $(CXXFLAGS) -MT google/protobuf/util/internal/testdata/no_warning_test-oneofs.pb.o -MD -MP -MF google/protobuf/util/internal/testdata/$(DEPDIR)/no_warning_test-oneofs.pb.Tpo -c -o google/protobuf/util/internal/testdata/no_warning_test-oneofs.pb.o `test -f 'google/protobuf/util/internal/testdata/oneofs.pb.cc' || echo '$(srcdir)/'`google/protobuf/util/internal/testdata/oneofs.pb.cc -@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) google/protobuf/util/internal/testdata/$(DEPDIR)/no_warning_test-oneofs.pb.Tpo google/protobuf/util/internal/testdata/$(DEPDIR)/no_warning_test-oneofs.pb.Po -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='google/protobuf/util/internal/testdata/oneofs.pb.cc' object='google/protobuf/util/internal/testdata/no_warning_test-oneofs.pb.o' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(no_warning_test_CXXFLAGS) $(CXXFLAGS) -c -o google/protobuf/util/internal/testdata/no_warning_test-oneofs.pb.o `test -f 'google/protobuf/util/internal/testdata/oneofs.pb.cc' || echo '$(srcdir)/'`google/protobuf/util/internal/testdata/oneofs.pb.cc - -google/protobuf/util/internal/testdata/no_warning_test-oneofs.pb.obj: google/protobuf/util/internal/testdata/oneofs.pb.cc -@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(no_warning_test_CXXFLAGS) $(CXXFLAGS) -MT google/protobuf/util/internal/testdata/no_warning_test-oneofs.pb.obj -MD -MP -MF google/protobuf/util/internal/testdata/$(DEPDIR)/no_warning_test-oneofs.pb.Tpo -c -o google/protobuf/util/internal/testdata/no_warning_test-oneofs.pb.obj `if test -f 'google/protobuf/util/internal/testdata/oneofs.pb.cc'; then $(CYGPATH_W) 'google/protobuf/util/internal/testdata/oneofs.pb.cc'; else $(CYGPATH_W) '$(srcdir)/google/protobuf/util/internal/testdata/oneofs.pb.cc'; fi` -@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) google/protobuf/util/internal/testdata/$(DEPDIR)/no_warning_test-oneofs.pb.Tpo google/protobuf/util/internal/testdata/$(DEPDIR)/no_warning_test-oneofs.pb.Po -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='google/protobuf/util/internal/testdata/oneofs.pb.cc' object='google/protobuf/util/internal/testdata/no_warning_test-oneofs.pb.obj' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(no_warning_test_CXXFLAGS) $(CXXFLAGS) -c -o google/protobuf/util/internal/testdata/no_warning_test-oneofs.pb.obj `if test -f 'google/protobuf/util/internal/testdata/oneofs.pb.cc'; then $(CYGPATH_W) 'google/protobuf/util/internal/testdata/oneofs.pb.cc'; else $(CYGPATH_W) '$(srcdir)/google/protobuf/util/internal/testdata/oneofs.pb.cc'; fi` - -google/protobuf/util/internal/testdata/no_warning_test-proto3.pb.o: google/protobuf/util/internal/testdata/proto3.pb.cc -@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(no_warning_test_CXXFLAGS) $(CXXFLAGS) -MT google/protobuf/util/internal/testdata/no_warning_test-proto3.pb.o -MD -MP -MF google/protobuf/util/internal/testdata/$(DEPDIR)/no_warning_test-proto3.pb.Tpo -c -o google/protobuf/util/internal/testdata/no_warning_test-proto3.pb.o `test -f 'google/protobuf/util/internal/testdata/proto3.pb.cc' || echo '$(srcdir)/'`google/protobuf/util/internal/testdata/proto3.pb.cc -@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) google/protobuf/util/internal/testdata/$(DEPDIR)/no_warning_test-proto3.pb.Tpo google/protobuf/util/internal/testdata/$(DEPDIR)/no_warning_test-proto3.pb.Po -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='google/protobuf/util/internal/testdata/proto3.pb.cc' object='google/protobuf/util/internal/testdata/no_warning_test-proto3.pb.o' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(no_warning_test_CXXFLAGS) $(CXXFLAGS) -c -o google/protobuf/util/internal/testdata/no_warning_test-proto3.pb.o `test -f 'google/protobuf/util/internal/testdata/proto3.pb.cc' || echo '$(srcdir)/'`google/protobuf/util/internal/testdata/proto3.pb.cc - -google/protobuf/util/internal/testdata/no_warning_test-proto3.pb.obj: google/protobuf/util/internal/testdata/proto3.pb.cc -@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(no_warning_test_CXXFLAGS) $(CXXFLAGS) -MT google/protobuf/util/internal/testdata/no_warning_test-proto3.pb.obj -MD -MP -MF google/protobuf/util/internal/testdata/$(DEPDIR)/no_warning_test-proto3.pb.Tpo -c -o google/protobuf/util/internal/testdata/no_warning_test-proto3.pb.obj `if test -f 'google/protobuf/util/internal/testdata/proto3.pb.cc'; then $(CYGPATH_W) 'google/protobuf/util/internal/testdata/proto3.pb.cc'; else $(CYGPATH_W) '$(srcdir)/google/protobuf/util/internal/testdata/proto3.pb.cc'; fi` -@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) google/protobuf/util/internal/testdata/$(DEPDIR)/no_warning_test-proto3.pb.Tpo google/protobuf/util/internal/testdata/$(DEPDIR)/no_warning_test-proto3.pb.Po -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='google/protobuf/util/internal/testdata/proto3.pb.cc' object='google/protobuf/util/internal/testdata/no_warning_test-proto3.pb.obj' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(no_warning_test_CXXFLAGS) $(CXXFLAGS) -c -o google/protobuf/util/internal/testdata/no_warning_test-proto3.pb.obj `if test -f 'google/protobuf/util/internal/testdata/proto3.pb.cc'; then $(CYGPATH_W) 'google/protobuf/util/internal/testdata/proto3.pb.cc'; else $(CYGPATH_W) '$(srcdir)/google/protobuf/util/internal/testdata/proto3.pb.cc'; fi` - -google/protobuf/util/internal/testdata/no_warning_test-struct.pb.o: google/protobuf/util/internal/testdata/struct.pb.cc -@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(no_warning_test_CXXFLAGS) $(CXXFLAGS) -MT google/protobuf/util/internal/testdata/no_warning_test-struct.pb.o -MD -MP -MF google/protobuf/util/internal/testdata/$(DEPDIR)/no_warning_test-struct.pb.Tpo -c -o google/protobuf/util/internal/testdata/no_warning_test-struct.pb.o `test -f 'google/protobuf/util/internal/testdata/struct.pb.cc' || echo '$(srcdir)/'`google/protobuf/util/internal/testdata/struct.pb.cc -@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) google/protobuf/util/internal/testdata/$(DEPDIR)/no_warning_test-struct.pb.Tpo google/protobuf/util/internal/testdata/$(DEPDIR)/no_warning_test-struct.pb.Po -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='google/protobuf/util/internal/testdata/struct.pb.cc' object='google/protobuf/util/internal/testdata/no_warning_test-struct.pb.o' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(no_warning_test_CXXFLAGS) $(CXXFLAGS) -c -o google/protobuf/util/internal/testdata/no_warning_test-struct.pb.o `test -f 'google/protobuf/util/internal/testdata/struct.pb.cc' || echo '$(srcdir)/'`google/protobuf/util/internal/testdata/struct.pb.cc - -google/protobuf/util/internal/testdata/no_warning_test-struct.pb.obj: google/protobuf/util/internal/testdata/struct.pb.cc -@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(no_warning_test_CXXFLAGS) $(CXXFLAGS) -MT google/protobuf/util/internal/testdata/no_warning_test-struct.pb.obj -MD -MP -MF google/protobuf/util/internal/testdata/$(DEPDIR)/no_warning_test-struct.pb.Tpo -c -o google/protobuf/util/internal/testdata/no_warning_test-struct.pb.obj `if test -f 'google/protobuf/util/internal/testdata/struct.pb.cc'; then $(CYGPATH_W) 'google/protobuf/util/internal/testdata/struct.pb.cc'; else $(CYGPATH_W) '$(srcdir)/google/protobuf/util/internal/testdata/struct.pb.cc'; fi` -@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) google/protobuf/util/internal/testdata/$(DEPDIR)/no_warning_test-struct.pb.Tpo google/protobuf/util/internal/testdata/$(DEPDIR)/no_warning_test-struct.pb.Po -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='google/protobuf/util/internal/testdata/struct.pb.cc' object='google/protobuf/util/internal/testdata/no_warning_test-struct.pb.obj' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(no_warning_test_CXXFLAGS) $(CXXFLAGS) -c -o google/protobuf/util/internal/testdata/no_warning_test-struct.pb.obj `if test -f 'google/protobuf/util/internal/testdata/struct.pb.cc'; then $(CYGPATH_W) 'google/protobuf/util/internal/testdata/struct.pb.cc'; else $(CYGPATH_W) '$(srcdir)/google/protobuf/util/internal/testdata/struct.pb.cc'; fi` - -google/protobuf/util/internal/testdata/no_warning_test-timestamp_duration.pb.o: google/protobuf/util/internal/testdata/timestamp_duration.pb.cc -@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(no_warning_test_CXXFLAGS) $(CXXFLAGS) -MT google/protobuf/util/internal/testdata/no_warning_test-timestamp_duration.pb.o -MD -MP -MF google/protobuf/util/internal/testdata/$(DEPDIR)/no_warning_test-timestamp_duration.pb.Tpo -c -o google/protobuf/util/internal/testdata/no_warning_test-timestamp_duration.pb.o `test -f 'google/protobuf/util/internal/testdata/timestamp_duration.pb.cc' || echo '$(srcdir)/'`google/protobuf/util/internal/testdata/timestamp_duration.pb.cc -@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) google/protobuf/util/internal/testdata/$(DEPDIR)/no_warning_test-timestamp_duration.pb.Tpo google/protobuf/util/internal/testdata/$(DEPDIR)/no_warning_test-timestamp_duration.pb.Po -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='google/protobuf/util/internal/testdata/timestamp_duration.pb.cc' object='google/protobuf/util/internal/testdata/no_warning_test-timestamp_duration.pb.o' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(no_warning_test_CXXFLAGS) $(CXXFLAGS) -c -o google/protobuf/util/internal/testdata/no_warning_test-timestamp_duration.pb.o `test -f 'google/protobuf/util/internal/testdata/timestamp_duration.pb.cc' || echo '$(srcdir)/'`google/protobuf/util/internal/testdata/timestamp_duration.pb.cc - -google/protobuf/util/internal/testdata/no_warning_test-timestamp_duration.pb.obj: google/protobuf/util/internal/testdata/timestamp_duration.pb.cc -@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(no_warning_test_CXXFLAGS) $(CXXFLAGS) -MT google/protobuf/util/internal/testdata/no_warning_test-timestamp_duration.pb.obj -MD -MP -MF google/protobuf/util/internal/testdata/$(DEPDIR)/no_warning_test-timestamp_duration.pb.Tpo -c -o google/protobuf/util/internal/testdata/no_warning_test-timestamp_duration.pb.obj `if test -f 'google/protobuf/util/internal/testdata/timestamp_duration.pb.cc'; then $(CYGPATH_W) 'google/protobuf/util/internal/testdata/timestamp_duration.pb.cc'; else $(CYGPATH_W) '$(srcdir)/google/protobuf/util/internal/testdata/timestamp_duration.pb.cc'; fi` -@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) google/protobuf/util/internal/testdata/$(DEPDIR)/no_warning_test-timestamp_duration.pb.Tpo google/protobuf/util/internal/testdata/$(DEPDIR)/no_warning_test-timestamp_duration.pb.Po -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='google/protobuf/util/internal/testdata/timestamp_duration.pb.cc' object='google/protobuf/util/internal/testdata/no_warning_test-timestamp_duration.pb.obj' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(no_warning_test_CXXFLAGS) $(CXXFLAGS) -c -o google/protobuf/util/internal/testdata/no_warning_test-timestamp_duration.pb.obj `if test -f 'google/protobuf/util/internal/testdata/timestamp_duration.pb.cc'; then $(CYGPATH_W) 'google/protobuf/util/internal/testdata/timestamp_duration.pb.cc'; else $(CYGPATH_W) '$(srcdir)/google/protobuf/util/internal/testdata/timestamp_duration.pb.cc'; fi` - -google/protobuf/util/internal/testdata/no_warning_test-wrappers.pb.o: google/protobuf/util/internal/testdata/wrappers.pb.cc -@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(no_warning_test_CXXFLAGS) $(CXXFLAGS) -MT google/protobuf/util/internal/testdata/no_warning_test-wrappers.pb.o -MD -MP -MF google/protobuf/util/internal/testdata/$(DEPDIR)/no_warning_test-wrappers.pb.Tpo -c -o google/protobuf/util/internal/testdata/no_warning_test-wrappers.pb.o `test -f 'google/protobuf/util/internal/testdata/wrappers.pb.cc' || echo '$(srcdir)/'`google/protobuf/util/internal/testdata/wrappers.pb.cc -@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) google/protobuf/util/internal/testdata/$(DEPDIR)/no_warning_test-wrappers.pb.Tpo google/protobuf/util/internal/testdata/$(DEPDIR)/no_warning_test-wrappers.pb.Po -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='google/protobuf/util/internal/testdata/wrappers.pb.cc' object='google/protobuf/util/internal/testdata/no_warning_test-wrappers.pb.o' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(no_warning_test_CXXFLAGS) $(CXXFLAGS) -c -o google/protobuf/util/internal/testdata/no_warning_test-wrappers.pb.o `test -f 'google/protobuf/util/internal/testdata/wrappers.pb.cc' || echo '$(srcdir)/'`google/protobuf/util/internal/testdata/wrappers.pb.cc - -google/protobuf/util/internal/testdata/no_warning_test-wrappers.pb.obj: google/protobuf/util/internal/testdata/wrappers.pb.cc -@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(no_warning_test_CXXFLAGS) $(CXXFLAGS) -MT google/protobuf/util/internal/testdata/no_warning_test-wrappers.pb.obj -MD -MP -MF google/protobuf/util/internal/testdata/$(DEPDIR)/no_warning_test-wrappers.pb.Tpo -c -o google/protobuf/util/internal/testdata/no_warning_test-wrappers.pb.obj `if test -f 'google/protobuf/util/internal/testdata/wrappers.pb.cc'; then $(CYGPATH_W) 'google/protobuf/util/internal/testdata/wrappers.pb.cc'; else $(CYGPATH_W) '$(srcdir)/google/protobuf/util/internal/testdata/wrappers.pb.cc'; fi` -@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) google/protobuf/util/internal/testdata/$(DEPDIR)/no_warning_test-wrappers.pb.Tpo google/protobuf/util/internal/testdata/$(DEPDIR)/no_warning_test-wrappers.pb.Po -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='google/protobuf/util/internal/testdata/wrappers.pb.cc' object='google/protobuf/util/internal/testdata/no_warning_test-wrappers.pb.obj' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(no_warning_test_CXXFLAGS) $(CXXFLAGS) -c -o google/protobuf/util/internal/testdata/no_warning_test-wrappers.pb.obj `if test -f 'google/protobuf/util/internal/testdata/wrappers.pb.cc'; then $(CYGPATH_W) 'google/protobuf/util/internal/testdata/wrappers.pb.cc'; else $(CYGPATH_W) '$(srcdir)/google/protobuf/util/internal/testdata/wrappers.pb.cc'; fi` - -google/protobuf/util/no_warning_test-json_format.pb.o: google/protobuf/util/json_format.pb.cc -@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(no_warning_test_CXXFLAGS) $(CXXFLAGS) -MT google/protobuf/util/no_warning_test-json_format.pb.o -MD -MP -MF google/protobuf/util/$(DEPDIR)/no_warning_test-json_format.pb.Tpo -c -o google/protobuf/util/no_warning_test-json_format.pb.o `test -f 'google/protobuf/util/json_format.pb.cc' || echo '$(srcdir)/'`google/protobuf/util/json_format.pb.cc -@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) google/protobuf/util/$(DEPDIR)/no_warning_test-json_format.pb.Tpo google/protobuf/util/$(DEPDIR)/no_warning_test-json_format.pb.Po -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='google/protobuf/util/json_format.pb.cc' object='google/protobuf/util/no_warning_test-json_format.pb.o' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(no_warning_test_CXXFLAGS) $(CXXFLAGS) -c -o google/protobuf/util/no_warning_test-json_format.pb.o `test -f 'google/protobuf/util/json_format.pb.cc' || echo '$(srcdir)/'`google/protobuf/util/json_format.pb.cc - -google/protobuf/util/no_warning_test-json_format.pb.obj: google/protobuf/util/json_format.pb.cc -@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(no_warning_test_CXXFLAGS) $(CXXFLAGS) -MT google/protobuf/util/no_warning_test-json_format.pb.obj -MD -MP -MF google/protobuf/util/$(DEPDIR)/no_warning_test-json_format.pb.Tpo -c -o google/protobuf/util/no_warning_test-json_format.pb.obj `if test -f 'google/protobuf/util/json_format.pb.cc'; then $(CYGPATH_W) 'google/protobuf/util/json_format.pb.cc'; else $(CYGPATH_W) '$(srcdir)/google/protobuf/util/json_format.pb.cc'; fi` -@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) google/protobuf/util/$(DEPDIR)/no_warning_test-json_format.pb.Tpo google/protobuf/util/$(DEPDIR)/no_warning_test-json_format.pb.Po -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='google/protobuf/util/json_format.pb.cc' object='google/protobuf/util/no_warning_test-json_format.pb.obj' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(no_warning_test_CXXFLAGS) $(CXXFLAGS) -c -o google/protobuf/util/no_warning_test-json_format.pb.obj `if test -f 'google/protobuf/util/json_format.pb.cc'; then $(CYGPATH_W) 'google/protobuf/util/json_format.pb.cc'; else $(CYGPATH_W) '$(srcdir)/google/protobuf/util/json_format.pb.cc'; fi` - -google/protobuf/util/no_warning_test-json_format_proto3.pb.o: google/protobuf/util/json_format_proto3.pb.cc -@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(no_warning_test_CXXFLAGS) $(CXXFLAGS) -MT google/protobuf/util/no_warning_test-json_format_proto3.pb.o -MD -MP -MF google/protobuf/util/$(DEPDIR)/no_warning_test-json_format_proto3.pb.Tpo -c -o google/protobuf/util/no_warning_test-json_format_proto3.pb.o `test -f 'google/protobuf/util/json_format_proto3.pb.cc' || echo '$(srcdir)/'`google/protobuf/util/json_format_proto3.pb.cc -@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) google/protobuf/util/$(DEPDIR)/no_warning_test-json_format_proto3.pb.Tpo google/protobuf/util/$(DEPDIR)/no_warning_test-json_format_proto3.pb.Po -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='google/protobuf/util/json_format_proto3.pb.cc' object='google/protobuf/util/no_warning_test-json_format_proto3.pb.o' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(no_warning_test_CXXFLAGS) $(CXXFLAGS) -c -o google/protobuf/util/no_warning_test-json_format_proto3.pb.o `test -f 'google/protobuf/util/json_format_proto3.pb.cc' || echo '$(srcdir)/'`google/protobuf/util/json_format_proto3.pb.cc - -google/protobuf/util/no_warning_test-json_format_proto3.pb.obj: google/protobuf/util/json_format_proto3.pb.cc -@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(no_warning_test_CXXFLAGS) $(CXXFLAGS) -MT google/protobuf/util/no_warning_test-json_format_proto3.pb.obj -MD -MP -MF google/protobuf/util/$(DEPDIR)/no_warning_test-json_format_proto3.pb.Tpo -c -o google/protobuf/util/no_warning_test-json_format_proto3.pb.obj `if test -f 'google/protobuf/util/json_format_proto3.pb.cc'; then $(CYGPATH_W) 'google/protobuf/util/json_format_proto3.pb.cc'; else $(CYGPATH_W) '$(srcdir)/google/protobuf/util/json_format_proto3.pb.cc'; fi` -@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) google/protobuf/util/$(DEPDIR)/no_warning_test-json_format_proto3.pb.Tpo google/protobuf/util/$(DEPDIR)/no_warning_test-json_format_proto3.pb.Po -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='google/protobuf/util/json_format_proto3.pb.cc' object='google/protobuf/util/no_warning_test-json_format_proto3.pb.obj' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(no_warning_test_CXXFLAGS) $(CXXFLAGS) -c -o google/protobuf/util/no_warning_test-json_format_proto3.pb.obj `if test -f 'google/protobuf/util/json_format_proto3.pb.cc'; then $(CYGPATH_W) 'google/protobuf/util/json_format_proto3.pb.cc'; else $(CYGPATH_W) '$(srcdir)/google/protobuf/util/json_format_proto3.pb.cc'; fi` - -google/protobuf/util/no_warning_test-message_differencer_unittest.pb.o: google/protobuf/util/message_differencer_unittest.pb.cc -@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(no_warning_test_CXXFLAGS) $(CXXFLAGS) -MT google/protobuf/util/no_warning_test-message_differencer_unittest.pb.o -MD -MP -MF google/protobuf/util/$(DEPDIR)/no_warning_test-message_differencer_unittest.pb.Tpo -c -o google/protobuf/util/no_warning_test-message_differencer_unittest.pb.o `test -f 'google/protobuf/util/message_differencer_unittest.pb.cc' || echo '$(srcdir)/'`google/protobuf/util/message_differencer_unittest.pb.cc -@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) google/protobuf/util/$(DEPDIR)/no_warning_test-message_differencer_unittest.pb.Tpo google/protobuf/util/$(DEPDIR)/no_warning_test-message_differencer_unittest.pb.Po -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='google/protobuf/util/message_differencer_unittest.pb.cc' object='google/protobuf/util/no_warning_test-message_differencer_unittest.pb.o' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(no_warning_test_CXXFLAGS) $(CXXFLAGS) -c -o google/protobuf/util/no_warning_test-message_differencer_unittest.pb.o `test -f 'google/protobuf/util/message_differencer_unittest.pb.cc' || echo '$(srcdir)/'`google/protobuf/util/message_differencer_unittest.pb.cc - -google/protobuf/util/no_warning_test-message_differencer_unittest.pb.obj: google/protobuf/util/message_differencer_unittest.pb.cc -@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(no_warning_test_CXXFLAGS) $(CXXFLAGS) -MT google/protobuf/util/no_warning_test-message_differencer_unittest.pb.obj -MD -MP -MF google/protobuf/util/$(DEPDIR)/no_warning_test-message_differencer_unittest.pb.Tpo -c -o google/protobuf/util/no_warning_test-message_differencer_unittest.pb.obj `if test -f 'google/protobuf/util/message_differencer_unittest.pb.cc'; then $(CYGPATH_W) 'google/protobuf/util/message_differencer_unittest.pb.cc'; else $(CYGPATH_W) '$(srcdir)/google/protobuf/util/message_differencer_unittest.pb.cc'; fi` -@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) google/protobuf/util/$(DEPDIR)/no_warning_test-message_differencer_unittest.pb.Tpo google/protobuf/util/$(DEPDIR)/no_warning_test-message_differencer_unittest.pb.Po -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='google/protobuf/util/message_differencer_unittest.pb.cc' object='google/protobuf/util/no_warning_test-message_differencer_unittest.pb.obj' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(no_warning_test_CXXFLAGS) $(CXXFLAGS) -c -o google/protobuf/util/no_warning_test-message_differencer_unittest.pb.obj `if test -f 'google/protobuf/util/message_differencer_unittest.pb.cc'; then $(CYGPATH_W) 'google/protobuf/util/message_differencer_unittest.pb.cc'; else $(CYGPATH_W) '$(srcdir)/google/protobuf/util/message_differencer_unittest.pb.cc'; fi` - -google/protobuf/compiler/cpp/protobuf_lazy_descriptor_test-cpp_unittest.o: google/protobuf/compiler/cpp/cpp_unittest.cc -@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(protobuf_lazy_descriptor_test_CPPFLAGS) $(CPPFLAGS) $(protobuf_lazy_descriptor_test_CXXFLAGS) $(CXXFLAGS) -MT google/protobuf/compiler/cpp/protobuf_lazy_descriptor_test-cpp_unittest.o -MD -MP -MF google/protobuf/compiler/cpp/$(DEPDIR)/protobuf_lazy_descriptor_test-cpp_unittest.Tpo -c -o google/protobuf/compiler/cpp/protobuf_lazy_descriptor_test-cpp_unittest.o `test -f 'google/protobuf/compiler/cpp/cpp_unittest.cc' || echo '$(srcdir)/'`google/protobuf/compiler/cpp/cpp_unittest.cc -@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) google/protobuf/compiler/cpp/$(DEPDIR)/protobuf_lazy_descriptor_test-cpp_unittest.Tpo google/protobuf/compiler/cpp/$(DEPDIR)/protobuf_lazy_descriptor_test-cpp_unittest.Po -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='google/protobuf/compiler/cpp/cpp_unittest.cc' object='google/protobuf/compiler/cpp/protobuf_lazy_descriptor_test-cpp_unittest.o' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(protobuf_lazy_descriptor_test_CPPFLAGS) $(CPPFLAGS) $(protobuf_lazy_descriptor_test_CXXFLAGS) $(CXXFLAGS) -c -o google/protobuf/compiler/cpp/protobuf_lazy_descriptor_test-cpp_unittest.o `test -f 'google/protobuf/compiler/cpp/cpp_unittest.cc' || echo '$(srcdir)/'`google/protobuf/compiler/cpp/cpp_unittest.cc - -google/protobuf/compiler/cpp/protobuf_lazy_descriptor_test-cpp_unittest.obj: google/protobuf/compiler/cpp/cpp_unittest.cc -@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(protobuf_lazy_descriptor_test_CPPFLAGS) $(CPPFLAGS) $(protobuf_lazy_descriptor_test_CXXFLAGS) $(CXXFLAGS) -MT google/protobuf/compiler/cpp/protobuf_lazy_descriptor_test-cpp_unittest.obj -MD -MP -MF google/protobuf/compiler/cpp/$(DEPDIR)/protobuf_lazy_descriptor_test-cpp_unittest.Tpo -c -o google/protobuf/compiler/cpp/protobuf_lazy_descriptor_test-cpp_unittest.obj `if test -f 'google/protobuf/compiler/cpp/cpp_unittest.cc'; then $(CYGPATH_W) 'google/protobuf/compiler/cpp/cpp_unittest.cc'; else $(CYGPATH_W) '$(srcdir)/google/protobuf/compiler/cpp/cpp_unittest.cc'; fi` -@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) google/protobuf/compiler/cpp/$(DEPDIR)/protobuf_lazy_descriptor_test-cpp_unittest.Tpo google/protobuf/compiler/cpp/$(DEPDIR)/protobuf_lazy_descriptor_test-cpp_unittest.Po -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='google/protobuf/compiler/cpp/cpp_unittest.cc' object='google/protobuf/compiler/cpp/protobuf_lazy_descriptor_test-cpp_unittest.obj' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(protobuf_lazy_descriptor_test_CPPFLAGS) $(CPPFLAGS) $(protobuf_lazy_descriptor_test_CXXFLAGS) $(CXXFLAGS) -c -o google/protobuf/compiler/cpp/protobuf_lazy_descriptor_test-cpp_unittest.obj `if test -f 'google/protobuf/compiler/cpp/cpp_unittest.cc'; then $(CYGPATH_W) 'google/protobuf/compiler/cpp/cpp_unittest.cc'; else $(CYGPATH_W) '$(srcdir)/google/protobuf/compiler/cpp/cpp_unittest.cc'; fi` - -google/protobuf/protobuf_lazy_descriptor_test-arena_test_util.o: google/protobuf/arena_test_util.cc -@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(protobuf_lazy_descriptor_test_CPPFLAGS) $(CPPFLAGS) $(protobuf_lazy_descriptor_test_CXXFLAGS) $(CXXFLAGS) -MT google/protobuf/protobuf_lazy_descriptor_test-arena_test_util.o -MD -MP -MF google/protobuf/$(DEPDIR)/protobuf_lazy_descriptor_test-arena_test_util.Tpo -c -o google/protobuf/protobuf_lazy_descriptor_test-arena_test_util.o `test -f 'google/protobuf/arena_test_util.cc' || echo '$(srcdir)/'`google/protobuf/arena_test_util.cc -@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) google/protobuf/$(DEPDIR)/protobuf_lazy_descriptor_test-arena_test_util.Tpo google/protobuf/$(DEPDIR)/protobuf_lazy_descriptor_test-arena_test_util.Po -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='google/protobuf/arena_test_util.cc' object='google/protobuf/protobuf_lazy_descriptor_test-arena_test_util.o' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(protobuf_lazy_descriptor_test_CPPFLAGS) $(CPPFLAGS) $(protobuf_lazy_descriptor_test_CXXFLAGS) $(CXXFLAGS) -c -o google/protobuf/protobuf_lazy_descriptor_test-arena_test_util.o `test -f 'google/protobuf/arena_test_util.cc' || echo '$(srcdir)/'`google/protobuf/arena_test_util.cc - -google/protobuf/protobuf_lazy_descriptor_test-arena_test_util.obj: google/protobuf/arena_test_util.cc -@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(protobuf_lazy_descriptor_test_CPPFLAGS) $(CPPFLAGS) $(protobuf_lazy_descriptor_test_CXXFLAGS) $(CXXFLAGS) -MT google/protobuf/protobuf_lazy_descriptor_test-arena_test_util.obj -MD -MP -MF google/protobuf/$(DEPDIR)/protobuf_lazy_descriptor_test-arena_test_util.Tpo -c -o google/protobuf/protobuf_lazy_descriptor_test-arena_test_util.obj `if test -f 'google/protobuf/arena_test_util.cc'; then $(CYGPATH_W) 'google/protobuf/arena_test_util.cc'; else $(CYGPATH_W) '$(srcdir)/google/protobuf/arena_test_util.cc'; fi` -@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) google/protobuf/$(DEPDIR)/protobuf_lazy_descriptor_test-arena_test_util.Tpo google/protobuf/$(DEPDIR)/protobuf_lazy_descriptor_test-arena_test_util.Po -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='google/protobuf/arena_test_util.cc' object='google/protobuf/protobuf_lazy_descriptor_test-arena_test_util.obj' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(protobuf_lazy_descriptor_test_CPPFLAGS) $(CPPFLAGS) $(protobuf_lazy_descriptor_test_CXXFLAGS) $(CXXFLAGS) -c -o google/protobuf/protobuf_lazy_descriptor_test-arena_test_util.obj `if test -f 'google/protobuf/arena_test_util.cc'; then $(CYGPATH_W) 'google/protobuf/arena_test_util.cc'; else $(CYGPATH_W) '$(srcdir)/google/protobuf/arena_test_util.cc'; fi` - -google/protobuf/protobuf_lazy_descriptor_test-map_lite_test_util.o: google/protobuf/map_lite_test_util.cc -@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(protobuf_lazy_descriptor_test_CPPFLAGS) $(CPPFLAGS) $(protobuf_lazy_descriptor_test_CXXFLAGS) $(CXXFLAGS) -MT google/protobuf/protobuf_lazy_descriptor_test-map_lite_test_util.o -MD -MP -MF google/protobuf/$(DEPDIR)/protobuf_lazy_descriptor_test-map_lite_test_util.Tpo -c -o google/protobuf/protobuf_lazy_descriptor_test-map_lite_test_util.o `test -f 'google/protobuf/map_lite_test_util.cc' || echo '$(srcdir)/'`google/protobuf/map_lite_test_util.cc -@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) google/protobuf/$(DEPDIR)/protobuf_lazy_descriptor_test-map_lite_test_util.Tpo google/protobuf/$(DEPDIR)/protobuf_lazy_descriptor_test-map_lite_test_util.Po -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='google/protobuf/map_lite_test_util.cc' object='google/protobuf/protobuf_lazy_descriptor_test-map_lite_test_util.o' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(protobuf_lazy_descriptor_test_CPPFLAGS) $(CPPFLAGS) $(protobuf_lazy_descriptor_test_CXXFLAGS) $(CXXFLAGS) -c -o google/protobuf/protobuf_lazy_descriptor_test-map_lite_test_util.o `test -f 'google/protobuf/map_lite_test_util.cc' || echo '$(srcdir)/'`google/protobuf/map_lite_test_util.cc - -google/protobuf/protobuf_lazy_descriptor_test-map_lite_test_util.obj: google/protobuf/map_lite_test_util.cc -@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(protobuf_lazy_descriptor_test_CPPFLAGS) $(CPPFLAGS) $(protobuf_lazy_descriptor_test_CXXFLAGS) $(CXXFLAGS) -MT google/protobuf/protobuf_lazy_descriptor_test-map_lite_test_util.obj -MD -MP -MF google/protobuf/$(DEPDIR)/protobuf_lazy_descriptor_test-map_lite_test_util.Tpo -c -o google/protobuf/protobuf_lazy_descriptor_test-map_lite_test_util.obj `if test -f 'google/protobuf/map_lite_test_util.cc'; then $(CYGPATH_W) 'google/protobuf/map_lite_test_util.cc'; else $(CYGPATH_W) '$(srcdir)/google/protobuf/map_lite_test_util.cc'; fi` -@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) google/protobuf/$(DEPDIR)/protobuf_lazy_descriptor_test-map_lite_test_util.Tpo google/protobuf/$(DEPDIR)/protobuf_lazy_descriptor_test-map_lite_test_util.Po -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='google/protobuf/map_lite_test_util.cc' object='google/protobuf/protobuf_lazy_descriptor_test-map_lite_test_util.obj' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(protobuf_lazy_descriptor_test_CPPFLAGS) $(CPPFLAGS) $(protobuf_lazy_descriptor_test_CXXFLAGS) $(CXXFLAGS) -c -o google/protobuf/protobuf_lazy_descriptor_test-map_lite_test_util.obj `if test -f 'google/protobuf/map_lite_test_util.cc'; then $(CYGPATH_W) 'google/protobuf/map_lite_test_util.cc'; else $(CYGPATH_W) '$(srcdir)/google/protobuf/map_lite_test_util.cc'; fi` - -google/protobuf/protobuf_lazy_descriptor_test-test_util_lite.o: google/protobuf/test_util_lite.cc -@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(protobuf_lazy_descriptor_test_CPPFLAGS) $(CPPFLAGS) $(protobuf_lazy_descriptor_test_CXXFLAGS) $(CXXFLAGS) -MT google/protobuf/protobuf_lazy_descriptor_test-test_util_lite.o -MD -MP -MF google/protobuf/$(DEPDIR)/protobuf_lazy_descriptor_test-test_util_lite.Tpo -c -o google/protobuf/protobuf_lazy_descriptor_test-test_util_lite.o `test -f 'google/protobuf/test_util_lite.cc' || echo '$(srcdir)/'`google/protobuf/test_util_lite.cc -@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) google/protobuf/$(DEPDIR)/protobuf_lazy_descriptor_test-test_util_lite.Tpo google/protobuf/$(DEPDIR)/protobuf_lazy_descriptor_test-test_util_lite.Po -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='google/protobuf/test_util_lite.cc' object='google/protobuf/protobuf_lazy_descriptor_test-test_util_lite.o' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(protobuf_lazy_descriptor_test_CPPFLAGS) $(CPPFLAGS) $(protobuf_lazy_descriptor_test_CXXFLAGS) $(CXXFLAGS) -c -o google/protobuf/protobuf_lazy_descriptor_test-test_util_lite.o `test -f 'google/protobuf/test_util_lite.cc' || echo '$(srcdir)/'`google/protobuf/test_util_lite.cc - -google/protobuf/protobuf_lazy_descriptor_test-test_util_lite.obj: google/protobuf/test_util_lite.cc -@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(protobuf_lazy_descriptor_test_CPPFLAGS) $(CPPFLAGS) $(protobuf_lazy_descriptor_test_CXXFLAGS) $(CXXFLAGS) -MT google/protobuf/protobuf_lazy_descriptor_test-test_util_lite.obj -MD -MP -MF google/protobuf/$(DEPDIR)/protobuf_lazy_descriptor_test-test_util_lite.Tpo -c -o google/protobuf/protobuf_lazy_descriptor_test-test_util_lite.obj `if test -f 'google/protobuf/test_util_lite.cc'; then $(CYGPATH_W) 'google/protobuf/test_util_lite.cc'; else $(CYGPATH_W) '$(srcdir)/google/protobuf/test_util_lite.cc'; fi` -@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) google/protobuf/$(DEPDIR)/protobuf_lazy_descriptor_test-test_util_lite.Tpo google/protobuf/$(DEPDIR)/protobuf_lazy_descriptor_test-test_util_lite.Po -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='google/protobuf/test_util_lite.cc' object='google/protobuf/protobuf_lazy_descriptor_test-test_util_lite.obj' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(protobuf_lazy_descriptor_test_CPPFLAGS) $(CPPFLAGS) $(protobuf_lazy_descriptor_test_CXXFLAGS) $(CXXFLAGS) -c -o google/protobuf/protobuf_lazy_descriptor_test-test_util_lite.obj `if test -f 'google/protobuf/test_util_lite.cc'; then $(CYGPATH_W) 'google/protobuf/test_util_lite.cc'; else $(CYGPATH_W) '$(srcdir)/google/protobuf/test_util_lite.cc'; fi` - -google/protobuf/protobuf_lazy_descriptor_test-reflection_tester.o: google/protobuf/reflection_tester.cc -@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(protobuf_lazy_descriptor_test_CPPFLAGS) $(CPPFLAGS) $(protobuf_lazy_descriptor_test_CXXFLAGS) $(CXXFLAGS) -MT google/protobuf/protobuf_lazy_descriptor_test-reflection_tester.o -MD -MP -MF google/protobuf/$(DEPDIR)/protobuf_lazy_descriptor_test-reflection_tester.Tpo -c -o google/protobuf/protobuf_lazy_descriptor_test-reflection_tester.o `test -f 'google/protobuf/reflection_tester.cc' || echo '$(srcdir)/'`google/protobuf/reflection_tester.cc -@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) google/protobuf/$(DEPDIR)/protobuf_lazy_descriptor_test-reflection_tester.Tpo google/protobuf/$(DEPDIR)/protobuf_lazy_descriptor_test-reflection_tester.Po -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='google/protobuf/reflection_tester.cc' object='google/protobuf/protobuf_lazy_descriptor_test-reflection_tester.o' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(protobuf_lazy_descriptor_test_CPPFLAGS) $(CPPFLAGS) $(protobuf_lazy_descriptor_test_CXXFLAGS) $(CXXFLAGS) -c -o google/protobuf/protobuf_lazy_descriptor_test-reflection_tester.o `test -f 'google/protobuf/reflection_tester.cc' || echo '$(srcdir)/'`google/protobuf/reflection_tester.cc - -google/protobuf/protobuf_lazy_descriptor_test-reflection_tester.obj: google/protobuf/reflection_tester.cc -@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(protobuf_lazy_descriptor_test_CPPFLAGS) $(CPPFLAGS) $(protobuf_lazy_descriptor_test_CXXFLAGS) $(CXXFLAGS) -MT google/protobuf/protobuf_lazy_descriptor_test-reflection_tester.obj -MD -MP -MF google/protobuf/$(DEPDIR)/protobuf_lazy_descriptor_test-reflection_tester.Tpo -c -o google/protobuf/protobuf_lazy_descriptor_test-reflection_tester.obj `if test -f 'google/protobuf/reflection_tester.cc'; then $(CYGPATH_W) 'google/protobuf/reflection_tester.cc'; else $(CYGPATH_W) '$(srcdir)/google/protobuf/reflection_tester.cc'; fi` -@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) google/protobuf/$(DEPDIR)/protobuf_lazy_descriptor_test-reflection_tester.Tpo google/protobuf/$(DEPDIR)/protobuf_lazy_descriptor_test-reflection_tester.Po -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='google/protobuf/reflection_tester.cc' object='google/protobuf/protobuf_lazy_descriptor_test-reflection_tester.obj' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(protobuf_lazy_descriptor_test_CPPFLAGS) $(CPPFLAGS) $(protobuf_lazy_descriptor_test_CXXFLAGS) $(CXXFLAGS) -c -o google/protobuf/protobuf_lazy_descriptor_test-reflection_tester.obj `if test -f 'google/protobuf/reflection_tester.cc'; then $(CYGPATH_W) 'google/protobuf/reflection_tester.cc'; else $(CYGPATH_W) '$(srcdir)/google/protobuf/reflection_tester.cc'; fi` - -google/protobuf/protobuf_lazy_descriptor_test-test_util.o: google/protobuf/test_util.cc -@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(protobuf_lazy_descriptor_test_CPPFLAGS) $(CPPFLAGS) $(protobuf_lazy_descriptor_test_CXXFLAGS) $(CXXFLAGS) -MT google/protobuf/protobuf_lazy_descriptor_test-test_util.o -MD -MP -MF google/protobuf/$(DEPDIR)/protobuf_lazy_descriptor_test-test_util.Tpo -c -o google/protobuf/protobuf_lazy_descriptor_test-test_util.o `test -f 'google/protobuf/test_util.cc' || echo '$(srcdir)/'`google/protobuf/test_util.cc -@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) google/protobuf/$(DEPDIR)/protobuf_lazy_descriptor_test-test_util.Tpo google/protobuf/$(DEPDIR)/protobuf_lazy_descriptor_test-test_util.Po -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='google/protobuf/test_util.cc' object='google/protobuf/protobuf_lazy_descriptor_test-test_util.o' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(protobuf_lazy_descriptor_test_CPPFLAGS) $(CPPFLAGS) $(protobuf_lazy_descriptor_test_CXXFLAGS) $(CXXFLAGS) -c -o google/protobuf/protobuf_lazy_descriptor_test-test_util.o `test -f 'google/protobuf/test_util.cc' || echo '$(srcdir)/'`google/protobuf/test_util.cc - -google/protobuf/protobuf_lazy_descriptor_test-test_util.obj: google/protobuf/test_util.cc -@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(protobuf_lazy_descriptor_test_CPPFLAGS) $(CPPFLAGS) $(protobuf_lazy_descriptor_test_CXXFLAGS) $(CXXFLAGS) -MT google/protobuf/protobuf_lazy_descriptor_test-test_util.obj -MD -MP -MF google/protobuf/$(DEPDIR)/protobuf_lazy_descriptor_test-test_util.Tpo -c -o google/protobuf/protobuf_lazy_descriptor_test-test_util.obj `if test -f 'google/protobuf/test_util.cc'; then $(CYGPATH_W) 'google/protobuf/test_util.cc'; else $(CYGPATH_W) '$(srcdir)/google/protobuf/test_util.cc'; fi` -@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) google/protobuf/$(DEPDIR)/protobuf_lazy_descriptor_test-test_util.Tpo google/protobuf/$(DEPDIR)/protobuf_lazy_descriptor_test-test_util.Po -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='google/protobuf/test_util.cc' object='google/protobuf/protobuf_lazy_descriptor_test-test_util.obj' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(protobuf_lazy_descriptor_test_CPPFLAGS) $(CPPFLAGS) $(protobuf_lazy_descriptor_test_CXXFLAGS) $(CXXFLAGS) -c -o google/protobuf/protobuf_lazy_descriptor_test-test_util.obj `if test -f 'google/protobuf/test_util.cc'; then $(CYGPATH_W) 'google/protobuf/test_util.cc'; else $(CYGPATH_W) '$(srcdir)/google/protobuf/test_util.cc'; fi` - -google/protobuf/testing/protobuf_lazy_descriptor_test-file.o: google/protobuf/testing/file.cc -@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(protobuf_lazy_descriptor_test_CPPFLAGS) $(CPPFLAGS) $(protobuf_lazy_descriptor_test_CXXFLAGS) $(CXXFLAGS) -MT google/protobuf/testing/protobuf_lazy_descriptor_test-file.o -MD -MP -MF google/protobuf/testing/$(DEPDIR)/protobuf_lazy_descriptor_test-file.Tpo -c -o google/protobuf/testing/protobuf_lazy_descriptor_test-file.o `test -f 'google/protobuf/testing/file.cc' || echo '$(srcdir)/'`google/protobuf/testing/file.cc -@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) google/protobuf/testing/$(DEPDIR)/protobuf_lazy_descriptor_test-file.Tpo google/protobuf/testing/$(DEPDIR)/protobuf_lazy_descriptor_test-file.Po -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='google/protobuf/testing/file.cc' object='google/protobuf/testing/protobuf_lazy_descriptor_test-file.o' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(protobuf_lazy_descriptor_test_CPPFLAGS) $(CPPFLAGS) $(protobuf_lazy_descriptor_test_CXXFLAGS) $(CXXFLAGS) -c -o google/protobuf/testing/protobuf_lazy_descriptor_test-file.o `test -f 'google/protobuf/testing/file.cc' || echo '$(srcdir)/'`google/protobuf/testing/file.cc - -google/protobuf/testing/protobuf_lazy_descriptor_test-file.obj: google/protobuf/testing/file.cc -@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(protobuf_lazy_descriptor_test_CPPFLAGS) $(CPPFLAGS) $(protobuf_lazy_descriptor_test_CXXFLAGS) $(CXXFLAGS) -MT google/protobuf/testing/protobuf_lazy_descriptor_test-file.obj -MD -MP -MF google/protobuf/testing/$(DEPDIR)/protobuf_lazy_descriptor_test-file.Tpo -c -o google/protobuf/testing/protobuf_lazy_descriptor_test-file.obj `if test -f 'google/protobuf/testing/file.cc'; then $(CYGPATH_W) 'google/protobuf/testing/file.cc'; else $(CYGPATH_W) '$(srcdir)/google/protobuf/testing/file.cc'; fi` -@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) google/protobuf/testing/$(DEPDIR)/protobuf_lazy_descriptor_test-file.Tpo google/protobuf/testing/$(DEPDIR)/protobuf_lazy_descriptor_test-file.Po -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='google/protobuf/testing/file.cc' object='google/protobuf/testing/protobuf_lazy_descriptor_test-file.obj' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(protobuf_lazy_descriptor_test_CPPFLAGS) $(CPPFLAGS) $(protobuf_lazy_descriptor_test_CXXFLAGS) $(CXXFLAGS) -c -o google/protobuf/testing/protobuf_lazy_descriptor_test-file.obj `if test -f 'google/protobuf/testing/file.cc'; then $(CYGPATH_W) 'google/protobuf/testing/file.cc'; else $(CYGPATH_W) '$(srcdir)/google/protobuf/testing/file.cc'; fi` - -google/protobuf/testing/protobuf_lazy_descriptor_test-googletest.o: google/protobuf/testing/googletest.cc -@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(protobuf_lazy_descriptor_test_CPPFLAGS) $(CPPFLAGS) $(protobuf_lazy_descriptor_test_CXXFLAGS) $(CXXFLAGS) -MT google/protobuf/testing/protobuf_lazy_descriptor_test-googletest.o -MD -MP -MF google/protobuf/testing/$(DEPDIR)/protobuf_lazy_descriptor_test-googletest.Tpo -c -o google/protobuf/testing/protobuf_lazy_descriptor_test-googletest.o `test -f 'google/protobuf/testing/googletest.cc' || echo '$(srcdir)/'`google/protobuf/testing/googletest.cc -@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) google/protobuf/testing/$(DEPDIR)/protobuf_lazy_descriptor_test-googletest.Tpo google/protobuf/testing/$(DEPDIR)/protobuf_lazy_descriptor_test-googletest.Po -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='google/protobuf/testing/googletest.cc' object='google/protobuf/testing/protobuf_lazy_descriptor_test-googletest.o' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(protobuf_lazy_descriptor_test_CPPFLAGS) $(CPPFLAGS) $(protobuf_lazy_descriptor_test_CXXFLAGS) $(CXXFLAGS) -c -o google/protobuf/testing/protobuf_lazy_descriptor_test-googletest.o `test -f 'google/protobuf/testing/googletest.cc' || echo '$(srcdir)/'`google/protobuf/testing/googletest.cc - -google/protobuf/testing/protobuf_lazy_descriptor_test-googletest.obj: google/protobuf/testing/googletest.cc -@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(protobuf_lazy_descriptor_test_CPPFLAGS) $(CPPFLAGS) $(protobuf_lazy_descriptor_test_CXXFLAGS) $(CXXFLAGS) -MT google/protobuf/testing/protobuf_lazy_descriptor_test-googletest.obj -MD -MP -MF google/protobuf/testing/$(DEPDIR)/protobuf_lazy_descriptor_test-googletest.Tpo -c -o google/protobuf/testing/protobuf_lazy_descriptor_test-googletest.obj `if test -f 'google/protobuf/testing/googletest.cc'; then $(CYGPATH_W) 'google/protobuf/testing/googletest.cc'; else $(CYGPATH_W) '$(srcdir)/google/protobuf/testing/googletest.cc'; fi` -@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) google/protobuf/testing/$(DEPDIR)/protobuf_lazy_descriptor_test-googletest.Tpo google/protobuf/testing/$(DEPDIR)/protobuf_lazy_descriptor_test-googletest.Po -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='google/protobuf/testing/googletest.cc' object='google/protobuf/testing/protobuf_lazy_descriptor_test-googletest.obj' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(protobuf_lazy_descriptor_test_CPPFLAGS) $(CPPFLAGS) $(protobuf_lazy_descriptor_test_CXXFLAGS) $(CXXFLAGS) -c -o google/protobuf/testing/protobuf_lazy_descriptor_test-googletest.obj `if test -f 'google/protobuf/testing/googletest.cc'; then $(CYGPATH_W) 'google/protobuf/testing/googletest.cc'; else $(CYGPATH_W) '$(srcdir)/google/protobuf/testing/googletest.cc'; fi` - -google/protobuf/protobuf_lazy_descriptor_test-map_lite_unittest.pb.o: google/protobuf/map_lite_unittest.pb.cc -@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(protobuf_lazy_descriptor_test_CPPFLAGS) $(CPPFLAGS) $(protobuf_lazy_descriptor_test_CXXFLAGS) $(CXXFLAGS) -MT google/protobuf/protobuf_lazy_descriptor_test-map_lite_unittest.pb.o -MD -MP -MF google/protobuf/$(DEPDIR)/protobuf_lazy_descriptor_test-map_lite_unittest.pb.Tpo -c -o google/protobuf/protobuf_lazy_descriptor_test-map_lite_unittest.pb.o `test -f 'google/protobuf/map_lite_unittest.pb.cc' || echo '$(srcdir)/'`google/protobuf/map_lite_unittest.pb.cc -@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) google/protobuf/$(DEPDIR)/protobuf_lazy_descriptor_test-map_lite_unittest.pb.Tpo google/protobuf/$(DEPDIR)/protobuf_lazy_descriptor_test-map_lite_unittest.pb.Po -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='google/protobuf/map_lite_unittest.pb.cc' object='google/protobuf/protobuf_lazy_descriptor_test-map_lite_unittest.pb.o' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(protobuf_lazy_descriptor_test_CPPFLAGS) $(CPPFLAGS) $(protobuf_lazy_descriptor_test_CXXFLAGS) $(CXXFLAGS) -c -o google/protobuf/protobuf_lazy_descriptor_test-map_lite_unittest.pb.o `test -f 'google/protobuf/map_lite_unittest.pb.cc' || echo '$(srcdir)/'`google/protobuf/map_lite_unittest.pb.cc - -google/protobuf/protobuf_lazy_descriptor_test-map_lite_unittest.pb.obj: google/protobuf/map_lite_unittest.pb.cc -@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(protobuf_lazy_descriptor_test_CPPFLAGS) $(CPPFLAGS) $(protobuf_lazy_descriptor_test_CXXFLAGS) $(CXXFLAGS) -MT google/protobuf/protobuf_lazy_descriptor_test-map_lite_unittest.pb.obj -MD -MP -MF google/protobuf/$(DEPDIR)/protobuf_lazy_descriptor_test-map_lite_unittest.pb.Tpo -c -o google/protobuf/protobuf_lazy_descriptor_test-map_lite_unittest.pb.obj `if test -f 'google/protobuf/map_lite_unittest.pb.cc'; then $(CYGPATH_W) 'google/protobuf/map_lite_unittest.pb.cc'; else $(CYGPATH_W) '$(srcdir)/google/protobuf/map_lite_unittest.pb.cc'; fi` -@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) google/protobuf/$(DEPDIR)/protobuf_lazy_descriptor_test-map_lite_unittest.pb.Tpo google/protobuf/$(DEPDIR)/protobuf_lazy_descriptor_test-map_lite_unittest.pb.Po -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='google/protobuf/map_lite_unittest.pb.cc' object='google/protobuf/protobuf_lazy_descriptor_test-map_lite_unittest.pb.obj' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(protobuf_lazy_descriptor_test_CPPFLAGS) $(CPPFLAGS) $(protobuf_lazy_descriptor_test_CXXFLAGS) $(CXXFLAGS) -c -o google/protobuf/protobuf_lazy_descriptor_test-map_lite_unittest.pb.obj `if test -f 'google/protobuf/map_lite_unittest.pb.cc'; then $(CYGPATH_W) 'google/protobuf/map_lite_unittest.pb.cc'; else $(CYGPATH_W) '$(srcdir)/google/protobuf/map_lite_unittest.pb.cc'; fi` - -google/protobuf/protobuf_lazy_descriptor_test-unittest_import_lite.pb.o: google/protobuf/unittest_import_lite.pb.cc -@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(protobuf_lazy_descriptor_test_CPPFLAGS) $(CPPFLAGS) $(protobuf_lazy_descriptor_test_CXXFLAGS) $(CXXFLAGS) -MT google/protobuf/protobuf_lazy_descriptor_test-unittest_import_lite.pb.o -MD -MP -MF google/protobuf/$(DEPDIR)/protobuf_lazy_descriptor_test-unittest_import_lite.pb.Tpo -c -o google/protobuf/protobuf_lazy_descriptor_test-unittest_import_lite.pb.o `test -f 'google/protobuf/unittest_import_lite.pb.cc' || echo '$(srcdir)/'`google/protobuf/unittest_import_lite.pb.cc -@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) google/protobuf/$(DEPDIR)/protobuf_lazy_descriptor_test-unittest_import_lite.pb.Tpo google/protobuf/$(DEPDIR)/protobuf_lazy_descriptor_test-unittest_import_lite.pb.Po -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='google/protobuf/unittest_import_lite.pb.cc' object='google/protobuf/protobuf_lazy_descriptor_test-unittest_import_lite.pb.o' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(protobuf_lazy_descriptor_test_CPPFLAGS) $(CPPFLAGS) $(protobuf_lazy_descriptor_test_CXXFLAGS) $(CXXFLAGS) -c -o google/protobuf/protobuf_lazy_descriptor_test-unittest_import_lite.pb.o `test -f 'google/protobuf/unittest_import_lite.pb.cc' || echo '$(srcdir)/'`google/protobuf/unittest_import_lite.pb.cc - -google/protobuf/protobuf_lazy_descriptor_test-unittest_import_lite.pb.obj: google/protobuf/unittest_import_lite.pb.cc -@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(protobuf_lazy_descriptor_test_CPPFLAGS) $(CPPFLAGS) $(protobuf_lazy_descriptor_test_CXXFLAGS) $(CXXFLAGS) -MT google/protobuf/protobuf_lazy_descriptor_test-unittest_import_lite.pb.obj -MD -MP -MF google/protobuf/$(DEPDIR)/protobuf_lazy_descriptor_test-unittest_import_lite.pb.Tpo -c -o google/protobuf/protobuf_lazy_descriptor_test-unittest_import_lite.pb.obj `if test -f 'google/protobuf/unittest_import_lite.pb.cc'; then $(CYGPATH_W) 'google/protobuf/unittest_import_lite.pb.cc'; else $(CYGPATH_W) '$(srcdir)/google/protobuf/unittest_import_lite.pb.cc'; fi` -@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) google/protobuf/$(DEPDIR)/protobuf_lazy_descriptor_test-unittest_import_lite.pb.Tpo google/protobuf/$(DEPDIR)/protobuf_lazy_descriptor_test-unittest_import_lite.pb.Po -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='google/protobuf/unittest_import_lite.pb.cc' object='google/protobuf/protobuf_lazy_descriptor_test-unittest_import_lite.pb.obj' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(protobuf_lazy_descriptor_test_CPPFLAGS) $(CPPFLAGS) $(protobuf_lazy_descriptor_test_CXXFLAGS) $(CXXFLAGS) -c -o google/protobuf/protobuf_lazy_descriptor_test-unittest_import_lite.pb.obj `if test -f 'google/protobuf/unittest_import_lite.pb.cc'; then $(CYGPATH_W) 'google/protobuf/unittest_import_lite.pb.cc'; else $(CYGPATH_W) '$(srcdir)/google/protobuf/unittest_import_lite.pb.cc'; fi` - -google/protobuf/protobuf_lazy_descriptor_test-unittest_import_public_lite.pb.o: google/protobuf/unittest_import_public_lite.pb.cc -@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(protobuf_lazy_descriptor_test_CPPFLAGS) $(CPPFLAGS) $(protobuf_lazy_descriptor_test_CXXFLAGS) $(CXXFLAGS) -MT google/protobuf/protobuf_lazy_descriptor_test-unittest_import_public_lite.pb.o -MD -MP -MF google/protobuf/$(DEPDIR)/protobuf_lazy_descriptor_test-unittest_import_public_lite.pb.Tpo -c -o google/protobuf/protobuf_lazy_descriptor_test-unittest_import_public_lite.pb.o `test -f 'google/protobuf/unittest_import_public_lite.pb.cc' || echo '$(srcdir)/'`google/protobuf/unittest_import_public_lite.pb.cc -@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) google/protobuf/$(DEPDIR)/protobuf_lazy_descriptor_test-unittest_import_public_lite.pb.Tpo google/protobuf/$(DEPDIR)/protobuf_lazy_descriptor_test-unittest_import_public_lite.pb.Po -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='google/protobuf/unittest_import_public_lite.pb.cc' object='google/protobuf/protobuf_lazy_descriptor_test-unittest_import_public_lite.pb.o' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(protobuf_lazy_descriptor_test_CPPFLAGS) $(CPPFLAGS) $(protobuf_lazy_descriptor_test_CXXFLAGS) $(CXXFLAGS) -c -o google/protobuf/protobuf_lazy_descriptor_test-unittest_import_public_lite.pb.o `test -f 'google/protobuf/unittest_import_public_lite.pb.cc' || echo '$(srcdir)/'`google/protobuf/unittest_import_public_lite.pb.cc - -google/protobuf/protobuf_lazy_descriptor_test-unittest_import_public_lite.pb.obj: google/protobuf/unittest_import_public_lite.pb.cc -@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(protobuf_lazy_descriptor_test_CPPFLAGS) $(CPPFLAGS) $(protobuf_lazy_descriptor_test_CXXFLAGS) $(CXXFLAGS) -MT google/protobuf/protobuf_lazy_descriptor_test-unittest_import_public_lite.pb.obj -MD -MP -MF google/protobuf/$(DEPDIR)/protobuf_lazy_descriptor_test-unittest_import_public_lite.pb.Tpo -c -o google/protobuf/protobuf_lazy_descriptor_test-unittest_import_public_lite.pb.obj `if test -f 'google/protobuf/unittest_import_public_lite.pb.cc'; then $(CYGPATH_W) 'google/protobuf/unittest_import_public_lite.pb.cc'; else $(CYGPATH_W) '$(srcdir)/google/protobuf/unittest_import_public_lite.pb.cc'; fi` -@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) google/protobuf/$(DEPDIR)/protobuf_lazy_descriptor_test-unittest_import_public_lite.pb.Tpo google/protobuf/$(DEPDIR)/protobuf_lazy_descriptor_test-unittest_import_public_lite.pb.Po -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='google/protobuf/unittest_import_public_lite.pb.cc' object='google/protobuf/protobuf_lazy_descriptor_test-unittest_import_public_lite.pb.obj' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(protobuf_lazy_descriptor_test_CPPFLAGS) $(CPPFLAGS) $(protobuf_lazy_descriptor_test_CXXFLAGS) $(CXXFLAGS) -c -o google/protobuf/protobuf_lazy_descriptor_test-unittest_import_public_lite.pb.obj `if test -f 'google/protobuf/unittest_import_public_lite.pb.cc'; then $(CYGPATH_W) 'google/protobuf/unittest_import_public_lite.pb.cc'; else $(CYGPATH_W) '$(srcdir)/google/protobuf/unittest_import_public_lite.pb.cc'; fi` - -google/protobuf/protobuf_lazy_descriptor_test-unittest_lite.pb.o: google/protobuf/unittest_lite.pb.cc -@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(protobuf_lazy_descriptor_test_CPPFLAGS) $(CPPFLAGS) $(protobuf_lazy_descriptor_test_CXXFLAGS) $(CXXFLAGS) -MT google/protobuf/protobuf_lazy_descriptor_test-unittest_lite.pb.o -MD -MP -MF google/protobuf/$(DEPDIR)/protobuf_lazy_descriptor_test-unittest_lite.pb.Tpo -c -o google/protobuf/protobuf_lazy_descriptor_test-unittest_lite.pb.o `test -f 'google/protobuf/unittest_lite.pb.cc' || echo '$(srcdir)/'`google/protobuf/unittest_lite.pb.cc -@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) google/protobuf/$(DEPDIR)/protobuf_lazy_descriptor_test-unittest_lite.pb.Tpo google/protobuf/$(DEPDIR)/protobuf_lazy_descriptor_test-unittest_lite.pb.Po -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='google/protobuf/unittest_lite.pb.cc' object='google/protobuf/protobuf_lazy_descriptor_test-unittest_lite.pb.o' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(protobuf_lazy_descriptor_test_CPPFLAGS) $(CPPFLAGS) $(protobuf_lazy_descriptor_test_CXXFLAGS) $(CXXFLAGS) -c -o google/protobuf/protobuf_lazy_descriptor_test-unittest_lite.pb.o `test -f 'google/protobuf/unittest_lite.pb.cc' || echo '$(srcdir)/'`google/protobuf/unittest_lite.pb.cc - -google/protobuf/protobuf_lazy_descriptor_test-unittest_lite.pb.obj: google/protobuf/unittest_lite.pb.cc -@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(protobuf_lazy_descriptor_test_CPPFLAGS) $(CPPFLAGS) $(protobuf_lazy_descriptor_test_CXXFLAGS) $(CXXFLAGS) -MT google/protobuf/protobuf_lazy_descriptor_test-unittest_lite.pb.obj -MD -MP -MF google/protobuf/$(DEPDIR)/protobuf_lazy_descriptor_test-unittest_lite.pb.Tpo -c -o google/protobuf/protobuf_lazy_descriptor_test-unittest_lite.pb.obj `if test -f 'google/protobuf/unittest_lite.pb.cc'; then $(CYGPATH_W) 'google/protobuf/unittest_lite.pb.cc'; else $(CYGPATH_W) '$(srcdir)/google/protobuf/unittest_lite.pb.cc'; fi` -@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) google/protobuf/$(DEPDIR)/protobuf_lazy_descriptor_test-unittest_lite.pb.Tpo google/protobuf/$(DEPDIR)/protobuf_lazy_descriptor_test-unittest_lite.pb.Po -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='google/protobuf/unittest_lite.pb.cc' object='google/protobuf/protobuf_lazy_descriptor_test-unittest_lite.pb.obj' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(protobuf_lazy_descriptor_test_CPPFLAGS) $(CPPFLAGS) $(protobuf_lazy_descriptor_test_CXXFLAGS) $(CXXFLAGS) -c -o google/protobuf/protobuf_lazy_descriptor_test-unittest_lite.pb.obj `if test -f 'google/protobuf/unittest_lite.pb.cc'; then $(CYGPATH_W) 'google/protobuf/unittest_lite.pb.cc'; else $(CYGPATH_W) '$(srcdir)/google/protobuf/unittest_lite.pb.cc'; fi` - -google/protobuf/protobuf_lazy_descriptor_test-any_test.pb.o: google/protobuf/any_test.pb.cc -@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(protobuf_lazy_descriptor_test_CPPFLAGS) $(CPPFLAGS) $(protobuf_lazy_descriptor_test_CXXFLAGS) $(CXXFLAGS) -MT google/protobuf/protobuf_lazy_descriptor_test-any_test.pb.o -MD -MP -MF google/protobuf/$(DEPDIR)/protobuf_lazy_descriptor_test-any_test.pb.Tpo -c -o google/protobuf/protobuf_lazy_descriptor_test-any_test.pb.o `test -f 'google/protobuf/any_test.pb.cc' || echo '$(srcdir)/'`google/protobuf/any_test.pb.cc -@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) google/protobuf/$(DEPDIR)/protobuf_lazy_descriptor_test-any_test.pb.Tpo google/protobuf/$(DEPDIR)/protobuf_lazy_descriptor_test-any_test.pb.Po -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='google/protobuf/any_test.pb.cc' object='google/protobuf/protobuf_lazy_descriptor_test-any_test.pb.o' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(protobuf_lazy_descriptor_test_CPPFLAGS) $(CPPFLAGS) $(protobuf_lazy_descriptor_test_CXXFLAGS) $(CXXFLAGS) -c -o google/protobuf/protobuf_lazy_descriptor_test-any_test.pb.o `test -f 'google/protobuf/any_test.pb.cc' || echo '$(srcdir)/'`google/protobuf/any_test.pb.cc - -google/protobuf/protobuf_lazy_descriptor_test-any_test.pb.obj: google/protobuf/any_test.pb.cc -@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(protobuf_lazy_descriptor_test_CPPFLAGS) $(CPPFLAGS) $(protobuf_lazy_descriptor_test_CXXFLAGS) $(CXXFLAGS) -MT google/protobuf/protobuf_lazy_descriptor_test-any_test.pb.obj -MD -MP -MF google/protobuf/$(DEPDIR)/protobuf_lazy_descriptor_test-any_test.pb.Tpo -c -o google/protobuf/protobuf_lazy_descriptor_test-any_test.pb.obj `if test -f 'google/protobuf/any_test.pb.cc'; then $(CYGPATH_W) 'google/protobuf/any_test.pb.cc'; else $(CYGPATH_W) '$(srcdir)/google/protobuf/any_test.pb.cc'; fi` -@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) google/protobuf/$(DEPDIR)/protobuf_lazy_descriptor_test-any_test.pb.Tpo google/protobuf/$(DEPDIR)/protobuf_lazy_descriptor_test-any_test.pb.Po -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='google/protobuf/any_test.pb.cc' object='google/protobuf/protobuf_lazy_descriptor_test-any_test.pb.obj' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(protobuf_lazy_descriptor_test_CPPFLAGS) $(CPPFLAGS) $(protobuf_lazy_descriptor_test_CXXFLAGS) $(CXXFLAGS) -c -o google/protobuf/protobuf_lazy_descriptor_test-any_test.pb.obj `if test -f 'google/protobuf/any_test.pb.cc'; then $(CYGPATH_W) 'google/protobuf/any_test.pb.cc'; else $(CYGPATH_W) '$(srcdir)/google/protobuf/any_test.pb.cc'; fi` - -google/protobuf/compiler/cpp/protobuf_lazy_descriptor_test-cpp_test_bad_identifiers.pb.o: google/protobuf/compiler/cpp/cpp_test_bad_identifiers.pb.cc -@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(protobuf_lazy_descriptor_test_CPPFLAGS) $(CPPFLAGS) $(protobuf_lazy_descriptor_test_CXXFLAGS) $(CXXFLAGS) -MT google/protobuf/compiler/cpp/protobuf_lazy_descriptor_test-cpp_test_bad_identifiers.pb.o -MD -MP -MF google/protobuf/compiler/cpp/$(DEPDIR)/protobuf_lazy_descriptor_test-cpp_test_bad_identifiers.pb.Tpo -c -o google/protobuf/compiler/cpp/protobuf_lazy_descriptor_test-cpp_test_bad_identifiers.pb.o `test -f 'google/protobuf/compiler/cpp/cpp_test_bad_identifiers.pb.cc' || echo '$(srcdir)/'`google/protobuf/compiler/cpp/cpp_test_bad_identifiers.pb.cc -@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) google/protobuf/compiler/cpp/$(DEPDIR)/protobuf_lazy_descriptor_test-cpp_test_bad_identifiers.pb.Tpo google/protobuf/compiler/cpp/$(DEPDIR)/protobuf_lazy_descriptor_test-cpp_test_bad_identifiers.pb.Po -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='google/protobuf/compiler/cpp/cpp_test_bad_identifiers.pb.cc' object='google/protobuf/compiler/cpp/protobuf_lazy_descriptor_test-cpp_test_bad_identifiers.pb.o' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(protobuf_lazy_descriptor_test_CPPFLAGS) $(CPPFLAGS) $(protobuf_lazy_descriptor_test_CXXFLAGS) $(CXXFLAGS) -c -o google/protobuf/compiler/cpp/protobuf_lazy_descriptor_test-cpp_test_bad_identifiers.pb.o `test -f 'google/protobuf/compiler/cpp/cpp_test_bad_identifiers.pb.cc' || echo '$(srcdir)/'`google/protobuf/compiler/cpp/cpp_test_bad_identifiers.pb.cc - -google/protobuf/compiler/cpp/protobuf_lazy_descriptor_test-cpp_test_bad_identifiers.pb.obj: google/protobuf/compiler/cpp/cpp_test_bad_identifiers.pb.cc -@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(protobuf_lazy_descriptor_test_CPPFLAGS) $(CPPFLAGS) $(protobuf_lazy_descriptor_test_CXXFLAGS) $(CXXFLAGS) -MT google/protobuf/compiler/cpp/protobuf_lazy_descriptor_test-cpp_test_bad_identifiers.pb.obj -MD -MP -MF google/protobuf/compiler/cpp/$(DEPDIR)/protobuf_lazy_descriptor_test-cpp_test_bad_identifiers.pb.Tpo -c -o google/protobuf/compiler/cpp/protobuf_lazy_descriptor_test-cpp_test_bad_identifiers.pb.obj `if test -f 'google/protobuf/compiler/cpp/cpp_test_bad_identifiers.pb.cc'; then $(CYGPATH_W) 'google/protobuf/compiler/cpp/cpp_test_bad_identifiers.pb.cc'; else $(CYGPATH_W) '$(srcdir)/google/protobuf/compiler/cpp/cpp_test_bad_identifiers.pb.cc'; fi` -@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) google/protobuf/compiler/cpp/$(DEPDIR)/protobuf_lazy_descriptor_test-cpp_test_bad_identifiers.pb.Tpo google/protobuf/compiler/cpp/$(DEPDIR)/protobuf_lazy_descriptor_test-cpp_test_bad_identifiers.pb.Po -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='google/protobuf/compiler/cpp/cpp_test_bad_identifiers.pb.cc' object='google/protobuf/compiler/cpp/protobuf_lazy_descriptor_test-cpp_test_bad_identifiers.pb.obj' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(protobuf_lazy_descriptor_test_CPPFLAGS) $(CPPFLAGS) $(protobuf_lazy_descriptor_test_CXXFLAGS) $(CXXFLAGS) -c -o google/protobuf/compiler/cpp/protobuf_lazy_descriptor_test-cpp_test_bad_identifiers.pb.obj `if test -f 'google/protobuf/compiler/cpp/cpp_test_bad_identifiers.pb.cc'; then $(CYGPATH_W) 'google/protobuf/compiler/cpp/cpp_test_bad_identifiers.pb.cc'; else $(CYGPATH_W) '$(srcdir)/google/protobuf/compiler/cpp/cpp_test_bad_identifiers.pb.cc'; fi` - -google/protobuf/compiler/cpp/protobuf_lazy_descriptor_test-cpp_test_large_enum_value.pb.o: google/protobuf/compiler/cpp/cpp_test_large_enum_value.pb.cc -@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(protobuf_lazy_descriptor_test_CPPFLAGS) $(CPPFLAGS) $(protobuf_lazy_descriptor_test_CXXFLAGS) $(CXXFLAGS) -MT google/protobuf/compiler/cpp/protobuf_lazy_descriptor_test-cpp_test_large_enum_value.pb.o -MD -MP -MF google/protobuf/compiler/cpp/$(DEPDIR)/protobuf_lazy_descriptor_test-cpp_test_large_enum_value.pb.Tpo -c -o google/protobuf/compiler/cpp/protobuf_lazy_descriptor_test-cpp_test_large_enum_value.pb.o `test -f 'google/protobuf/compiler/cpp/cpp_test_large_enum_value.pb.cc' || echo '$(srcdir)/'`google/protobuf/compiler/cpp/cpp_test_large_enum_value.pb.cc -@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) google/protobuf/compiler/cpp/$(DEPDIR)/protobuf_lazy_descriptor_test-cpp_test_large_enum_value.pb.Tpo google/protobuf/compiler/cpp/$(DEPDIR)/protobuf_lazy_descriptor_test-cpp_test_large_enum_value.pb.Po -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='google/protobuf/compiler/cpp/cpp_test_large_enum_value.pb.cc' object='google/protobuf/compiler/cpp/protobuf_lazy_descriptor_test-cpp_test_large_enum_value.pb.o' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(protobuf_lazy_descriptor_test_CPPFLAGS) $(CPPFLAGS) $(protobuf_lazy_descriptor_test_CXXFLAGS) $(CXXFLAGS) -c -o google/protobuf/compiler/cpp/protobuf_lazy_descriptor_test-cpp_test_large_enum_value.pb.o `test -f 'google/protobuf/compiler/cpp/cpp_test_large_enum_value.pb.cc' || echo '$(srcdir)/'`google/protobuf/compiler/cpp/cpp_test_large_enum_value.pb.cc - -google/protobuf/compiler/cpp/protobuf_lazy_descriptor_test-cpp_test_large_enum_value.pb.obj: google/protobuf/compiler/cpp/cpp_test_large_enum_value.pb.cc -@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(protobuf_lazy_descriptor_test_CPPFLAGS) $(CPPFLAGS) $(protobuf_lazy_descriptor_test_CXXFLAGS) $(CXXFLAGS) -MT google/protobuf/compiler/cpp/protobuf_lazy_descriptor_test-cpp_test_large_enum_value.pb.obj -MD -MP -MF google/protobuf/compiler/cpp/$(DEPDIR)/protobuf_lazy_descriptor_test-cpp_test_large_enum_value.pb.Tpo -c -o google/protobuf/compiler/cpp/protobuf_lazy_descriptor_test-cpp_test_large_enum_value.pb.obj `if test -f 'google/protobuf/compiler/cpp/cpp_test_large_enum_value.pb.cc'; then $(CYGPATH_W) 'google/protobuf/compiler/cpp/cpp_test_large_enum_value.pb.cc'; else $(CYGPATH_W) '$(srcdir)/google/protobuf/compiler/cpp/cpp_test_large_enum_value.pb.cc'; fi` -@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) google/protobuf/compiler/cpp/$(DEPDIR)/protobuf_lazy_descriptor_test-cpp_test_large_enum_value.pb.Tpo google/protobuf/compiler/cpp/$(DEPDIR)/protobuf_lazy_descriptor_test-cpp_test_large_enum_value.pb.Po -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='google/protobuf/compiler/cpp/cpp_test_large_enum_value.pb.cc' object='google/protobuf/compiler/cpp/protobuf_lazy_descriptor_test-cpp_test_large_enum_value.pb.obj' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(protobuf_lazy_descriptor_test_CPPFLAGS) $(CPPFLAGS) $(protobuf_lazy_descriptor_test_CXXFLAGS) $(CXXFLAGS) -c -o google/protobuf/compiler/cpp/protobuf_lazy_descriptor_test-cpp_test_large_enum_value.pb.obj `if test -f 'google/protobuf/compiler/cpp/cpp_test_large_enum_value.pb.cc'; then $(CYGPATH_W) 'google/protobuf/compiler/cpp/cpp_test_large_enum_value.pb.cc'; else $(CYGPATH_W) '$(srcdir)/google/protobuf/compiler/cpp/cpp_test_large_enum_value.pb.cc'; fi` - -google/protobuf/protobuf_lazy_descriptor_test-map_proto2_unittest.pb.o: google/protobuf/map_proto2_unittest.pb.cc -@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(protobuf_lazy_descriptor_test_CPPFLAGS) $(CPPFLAGS) $(protobuf_lazy_descriptor_test_CXXFLAGS) $(CXXFLAGS) -MT google/protobuf/protobuf_lazy_descriptor_test-map_proto2_unittest.pb.o -MD -MP -MF google/protobuf/$(DEPDIR)/protobuf_lazy_descriptor_test-map_proto2_unittest.pb.Tpo -c -o google/protobuf/protobuf_lazy_descriptor_test-map_proto2_unittest.pb.o `test -f 'google/protobuf/map_proto2_unittest.pb.cc' || echo '$(srcdir)/'`google/protobuf/map_proto2_unittest.pb.cc -@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) google/protobuf/$(DEPDIR)/protobuf_lazy_descriptor_test-map_proto2_unittest.pb.Tpo google/protobuf/$(DEPDIR)/protobuf_lazy_descriptor_test-map_proto2_unittest.pb.Po -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='google/protobuf/map_proto2_unittest.pb.cc' object='google/protobuf/protobuf_lazy_descriptor_test-map_proto2_unittest.pb.o' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(protobuf_lazy_descriptor_test_CPPFLAGS) $(CPPFLAGS) $(protobuf_lazy_descriptor_test_CXXFLAGS) $(CXXFLAGS) -c -o google/protobuf/protobuf_lazy_descriptor_test-map_proto2_unittest.pb.o `test -f 'google/protobuf/map_proto2_unittest.pb.cc' || echo '$(srcdir)/'`google/protobuf/map_proto2_unittest.pb.cc - -google/protobuf/protobuf_lazy_descriptor_test-map_proto2_unittest.pb.obj: google/protobuf/map_proto2_unittest.pb.cc -@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(protobuf_lazy_descriptor_test_CPPFLAGS) $(CPPFLAGS) $(protobuf_lazy_descriptor_test_CXXFLAGS) $(CXXFLAGS) -MT google/protobuf/protobuf_lazy_descriptor_test-map_proto2_unittest.pb.obj -MD -MP -MF google/protobuf/$(DEPDIR)/protobuf_lazy_descriptor_test-map_proto2_unittest.pb.Tpo -c -o google/protobuf/protobuf_lazy_descriptor_test-map_proto2_unittest.pb.obj `if test -f 'google/protobuf/map_proto2_unittest.pb.cc'; then $(CYGPATH_W) 'google/protobuf/map_proto2_unittest.pb.cc'; else $(CYGPATH_W) '$(srcdir)/google/protobuf/map_proto2_unittest.pb.cc'; fi` -@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) google/protobuf/$(DEPDIR)/protobuf_lazy_descriptor_test-map_proto2_unittest.pb.Tpo google/protobuf/$(DEPDIR)/protobuf_lazy_descriptor_test-map_proto2_unittest.pb.Po -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='google/protobuf/map_proto2_unittest.pb.cc' object='google/protobuf/protobuf_lazy_descriptor_test-map_proto2_unittest.pb.obj' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(protobuf_lazy_descriptor_test_CPPFLAGS) $(CPPFLAGS) $(protobuf_lazy_descriptor_test_CXXFLAGS) $(CXXFLAGS) -c -o google/protobuf/protobuf_lazy_descriptor_test-map_proto2_unittest.pb.obj `if test -f 'google/protobuf/map_proto2_unittest.pb.cc'; then $(CYGPATH_W) 'google/protobuf/map_proto2_unittest.pb.cc'; else $(CYGPATH_W) '$(srcdir)/google/protobuf/map_proto2_unittest.pb.cc'; fi` - -google/protobuf/protobuf_lazy_descriptor_test-map_unittest.pb.o: google/protobuf/map_unittest.pb.cc -@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(protobuf_lazy_descriptor_test_CPPFLAGS) $(CPPFLAGS) $(protobuf_lazy_descriptor_test_CXXFLAGS) $(CXXFLAGS) -MT google/protobuf/protobuf_lazy_descriptor_test-map_unittest.pb.o -MD -MP -MF google/protobuf/$(DEPDIR)/protobuf_lazy_descriptor_test-map_unittest.pb.Tpo -c -o google/protobuf/protobuf_lazy_descriptor_test-map_unittest.pb.o `test -f 'google/protobuf/map_unittest.pb.cc' || echo '$(srcdir)/'`google/protobuf/map_unittest.pb.cc -@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) google/protobuf/$(DEPDIR)/protobuf_lazy_descriptor_test-map_unittest.pb.Tpo google/protobuf/$(DEPDIR)/protobuf_lazy_descriptor_test-map_unittest.pb.Po -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='google/protobuf/map_unittest.pb.cc' object='google/protobuf/protobuf_lazy_descriptor_test-map_unittest.pb.o' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(protobuf_lazy_descriptor_test_CPPFLAGS) $(CPPFLAGS) $(protobuf_lazy_descriptor_test_CXXFLAGS) $(CXXFLAGS) -c -o google/protobuf/protobuf_lazy_descriptor_test-map_unittest.pb.o `test -f 'google/protobuf/map_unittest.pb.cc' || echo '$(srcdir)/'`google/protobuf/map_unittest.pb.cc - -google/protobuf/protobuf_lazy_descriptor_test-map_unittest.pb.obj: google/protobuf/map_unittest.pb.cc -@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(protobuf_lazy_descriptor_test_CPPFLAGS) $(CPPFLAGS) $(protobuf_lazy_descriptor_test_CXXFLAGS) $(CXXFLAGS) -MT google/protobuf/protobuf_lazy_descriptor_test-map_unittest.pb.obj -MD -MP -MF google/protobuf/$(DEPDIR)/protobuf_lazy_descriptor_test-map_unittest.pb.Tpo -c -o google/protobuf/protobuf_lazy_descriptor_test-map_unittest.pb.obj `if test -f 'google/protobuf/map_unittest.pb.cc'; then $(CYGPATH_W) 'google/protobuf/map_unittest.pb.cc'; else $(CYGPATH_W) '$(srcdir)/google/protobuf/map_unittest.pb.cc'; fi` -@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) google/protobuf/$(DEPDIR)/protobuf_lazy_descriptor_test-map_unittest.pb.Tpo google/protobuf/$(DEPDIR)/protobuf_lazy_descriptor_test-map_unittest.pb.Po -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='google/protobuf/map_unittest.pb.cc' object='google/protobuf/protobuf_lazy_descriptor_test-map_unittest.pb.obj' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(protobuf_lazy_descriptor_test_CPPFLAGS) $(CPPFLAGS) $(protobuf_lazy_descriptor_test_CXXFLAGS) $(CXXFLAGS) -c -o google/protobuf/protobuf_lazy_descriptor_test-map_unittest.pb.obj `if test -f 'google/protobuf/map_unittest.pb.cc'; then $(CYGPATH_W) 'google/protobuf/map_unittest.pb.cc'; else $(CYGPATH_W) '$(srcdir)/google/protobuf/map_unittest.pb.cc'; fi` - -google/protobuf/protobuf_lazy_descriptor_test-unittest.pb.o: google/protobuf/unittest.pb.cc -@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(protobuf_lazy_descriptor_test_CPPFLAGS) $(CPPFLAGS) $(protobuf_lazy_descriptor_test_CXXFLAGS) $(CXXFLAGS) -MT google/protobuf/protobuf_lazy_descriptor_test-unittest.pb.o -MD -MP -MF google/protobuf/$(DEPDIR)/protobuf_lazy_descriptor_test-unittest.pb.Tpo -c -o google/protobuf/protobuf_lazy_descriptor_test-unittest.pb.o `test -f 'google/protobuf/unittest.pb.cc' || echo '$(srcdir)/'`google/protobuf/unittest.pb.cc -@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) google/protobuf/$(DEPDIR)/protobuf_lazy_descriptor_test-unittest.pb.Tpo google/protobuf/$(DEPDIR)/protobuf_lazy_descriptor_test-unittest.pb.Po -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='google/protobuf/unittest.pb.cc' object='google/protobuf/protobuf_lazy_descriptor_test-unittest.pb.o' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(protobuf_lazy_descriptor_test_CPPFLAGS) $(CPPFLAGS) $(protobuf_lazy_descriptor_test_CXXFLAGS) $(CXXFLAGS) -c -o google/protobuf/protobuf_lazy_descriptor_test-unittest.pb.o `test -f 'google/protobuf/unittest.pb.cc' || echo '$(srcdir)/'`google/protobuf/unittest.pb.cc - -google/protobuf/protobuf_lazy_descriptor_test-unittest.pb.obj: google/protobuf/unittest.pb.cc -@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(protobuf_lazy_descriptor_test_CPPFLAGS) $(CPPFLAGS) $(protobuf_lazy_descriptor_test_CXXFLAGS) $(CXXFLAGS) -MT google/protobuf/protobuf_lazy_descriptor_test-unittest.pb.obj -MD -MP -MF google/protobuf/$(DEPDIR)/protobuf_lazy_descriptor_test-unittest.pb.Tpo -c -o google/protobuf/protobuf_lazy_descriptor_test-unittest.pb.obj `if test -f 'google/protobuf/unittest.pb.cc'; then $(CYGPATH_W) 'google/protobuf/unittest.pb.cc'; else $(CYGPATH_W) '$(srcdir)/google/protobuf/unittest.pb.cc'; fi` -@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) google/protobuf/$(DEPDIR)/protobuf_lazy_descriptor_test-unittest.pb.Tpo google/protobuf/$(DEPDIR)/protobuf_lazy_descriptor_test-unittest.pb.Po -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='google/protobuf/unittest.pb.cc' object='google/protobuf/protobuf_lazy_descriptor_test-unittest.pb.obj' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(protobuf_lazy_descriptor_test_CPPFLAGS) $(CPPFLAGS) $(protobuf_lazy_descriptor_test_CXXFLAGS) $(CXXFLAGS) -c -o google/protobuf/protobuf_lazy_descriptor_test-unittest.pb.obj `if test -f 'google/protobuf/unittest.pb.cc'; then $(CYGPATH_W) 'google/protobuf/unittest.pb.cc'; else $(CYGPATH_W) '$(srcdir)/google/protobuf/unittest.pb.cc'; fi` - -google/protobuf/protobuf_lazy_descriptor_test-unittest_arena.pb.o: google/protobuf/unittest_arena.pb.cc -@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(protobuf_lazy_descriptor_test_CPPFLAGS) $(CPPFLAGS) $(protobuf_lazy_descriptor_test_CXXFLAGS) $(CXXFLAGS) -MT google/protobuf/protobuf_lazy_descriptor_test-unittest_arena.pb.o -MD -MP -MF google/protobuf/$(DEPDIR)/protobuf_lazy_descriptor_test-unittest_arena.pb.Tpo -c -o google/protobuf/protobuf_lazy_descriptor_test-unittest_arena.pb.o `test -f 'google/protobuf/unittest_arena.pb.cc' || echo '$(srcdir)/'`google/protobuf/unittest_arena.pb.cc -@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) google/protobuf/$(DEPDIR)/protobuf_lazy_descriptor_test-unittest_arena.pb.Tpo google/protobuf/$(DEPDIR)/protobuf_lazy_descriptor_test-unittest_arena.pb.Po -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='google/protobuf/unittest_arena.pb.cc' object='google/protobuf/protobuf_lazy_descriptor_test-unittest_arena.pb.o' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(protobuf_lazy_descriptor_test_CPPFLAGS) $(CPPFLAGS) $(protobuf_lazy_descriptor_test_CXXFLAGS) $(CXXFLAGS) -c -o google/protobuf/protobuf_lazy_descriptor_test-unittest_arena.pb.o `test -f 'google/protobuf/unittest_arena.pb.cc' || echo '$(srcdir)/'`google/protobuf/unittest_arena.pb.cc - -google/protobuf/protobuf_lazy_descriptor_test-unittest_arena.pb.obj: google/protobuf/unittest_arena.pb.cc -@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(protobuf_lazy_descriptor_test_CPPFLAGS) $(CPPFLAGS) $(protobuf_lazy_descriptor_test_CXXFLAGS) $(CXXFLAGS) -MT google/protobuf/protobuf_lazy_descriptor_test-unittest_arena.pb.obj -MD -MP -MF google/protobuf/$(DEPDIR)/protobuf_lazy_descriptor_test-unittest_arena.pb.Tpo -c -o google/protobuf/protobuf_lazy_descriptor_test-unittest_arena.pb.obj `if test -f 'google/protobuf/unittest_arena.pb.cc'; then $(CYGPATH_W) 'google/protobuf/unittest_arena.pb.cc'; else $(CYGPATH_W) '$(srcdir)/google/protobuf/unittest_arena.pb.cc'; fi` -@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) google/protobuf/$(DEPDIR)/protobuf_lazy_descriptor_test-unittest_arena.pb.Tpo google/protobuf/$(DEPDIR)/protobuf_lazy_descriptor_test-unittest_arena.pb.Po -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='google/protobuf/unittest_arena.pb.cc' object='google/protobuf/protobuf_lazy_descriptor_test-unittest_arena.pb.obj' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(protobuf_lazy_descriptor_test_CPPFLAGS) $(CPPFLAGS) $(protobuf_lazy_descriptor_test_CXXFLAGS) $(CXXFLAGS) -c -o google/protobuf/protobuf_lazy_descriptor_test-unittest_arena.pb.obj `if test -f 'google/protobuf/unittest_arena.pb.cc'; then $(CYGPATH_W) 'google/protobuf/unittest_arena.pb.cc'; else $(CYGPATH_W) '$(srcdir)/google/protobuf/unittest_arena.pb.cc'; fi` - -google/protobuf/protobuf_lazy_descriptor_test-unittest_custom_options.pb.o: google/protobuf/unittest_custom_options.pb.cc -@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(protobuf_lazy_descriptor_test_CPPFLAGS) $(CPPFLAGS) $(protobuf_lazy_descriptor_test_CXXFLAGS) $(CXXFLAGS) -MT google/protobuf/protobuf_lazy_descriptor_test-unittest_custom_options.pb.o -MD -MP -MF google/protobuf/$(DEPDIR)/protobuf_lazy_descriptor_test-unittest_custom_options.pb.Tpo -c -o google/protobuf/protobuf_lazy_descriptor_test-unittest_custom_options.pb.o `test -f 'google/protobuf/unittest_custom_options.pb.cc' || echo '$(srcdir)/'`google/protobuf/unittest_custom_options.pb.cc -@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) google/protobuf/$(DEPDIR)/protobuf_lazy_descriptor_test-unittest_custom_options.pb.Tpo google/protobuf/$(DEPDIR)/protobuf_lazy_descriptor_test-unittest_custom_options.pb.Po -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='google/protobuf/unittest_custom_options.pb.cc' object='google/protobuf/protobuf_lazy_descriptor_test-unittest_custom_options.pb.o' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(protobuf_lazy_descriptor_test_CPPFLAGS) $(CPPFLAGS) $(protobuf_lazy_descriptor_test_CXXFLAGS) $(CXXFLAGS) -c -o google/protobuf/protobuf_lazy_descriptor_test-unittest_custom_options.pb.o `test -f 'google/protobuf/unittest_custom_options.pb.cc' || echo '$(srcdir)/'`google/protobuf/unittest_custom_options.pb.cc - -google/protobuf/protobuf_lazy_descriptor_test-unittest_custom_options.pb.obj: google/protobuf/unittest_custom_options.pb.cc -@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(protobuf_lazy_descriptor_test_CPPFLAGS) $(CPPFLAGS) $(protobuf_lazy_descriptor_test_CXXFLAGS) $(CXXFLAGS) -MT google/protobuf/protobuf_lazy_descriptor_test-unittest_custom_options.pb.obj -MD -MP -MF google/protobuf/$(DEPDIR)/protobuf_lazy_descriptor_test-unittest_custom_options.pb.Tpo -c -o google/protobuf/protobuf_lazy_descriptor_test-unittest_custom_options.pb.obj `if test -f 'google/protobuf/unittest_custom_options.pb.cc'; then $(CYGPATH_W) 'google/protobuf/unittest_custom_options.pb.cc'; else $(CYGPATH_W) '$(srcdir)/google/protobuf/unittest_custom_options.pb.cc'; fi` -@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) google/protobuf/$(DEPDIR)/protobuf_lazy_descriptor_test-unittest_custom_options.pb.Tpo google/protobuf/$(DEPDIR)/protobuf_lazy_descriptor_test-unittest_custom_options.pb.Po -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='google/protobuf/unittest_custom_options.pb.cc' object='google/protobuf/protobuf_lazy_descriptor_test-unittest_custom_options.pb.obj' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(protobuf_lazy_descriptor_test_CPPFLAGS) $(CPPFLAGS) $(protobuf_lazy_descriptor_test_CXXFLAGS) $(CXXFLAGS) -c -o google/protobuf/protobuf_lazy_descriptor_test-unittest_custom_options.pb.obj `if test -f 'google/protobuf/unittest_custom_options.pb.cc'; then $(CYGPATH_W) 'google/protobuf/unittest_custom_options.pb.cc'; else $(CYGPATH_W) '$(srcdir)/google/protobuf/unittest_custom_options.pb.cc'; fi` - -google/protobuf/protobuf_lazy_descriptor_test-unittest_drop_unknown_fields.pb.o: google/protobuf/unittest_drop_unknown_fields.pb.cc -@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(protobuf_lazy_descriptor_test_CPPFLAGS) $(CPPFLAGS) $(protobuf_lazy_descriptor_test_CXXFLAGS) $(CXXFLAGS) -MT google/protobuf/protobuf_lazy_descriptor_test-unittest_drop_unknown_fields.pb.o -MD -MP -MF google/protobuf/$(DEPDIR)/protobuf_lazy_descriptor_test-unittest_drop_unknown_fields.pb.Tpo -c -o google/protobuf/protobuf_lazy_descriptor_test-unittest_drop_unknown_fields.pb.o `test -f 'google/protobuf/unittest_drop_unknown_fields.pb.cc' || echo '$(srcdir)/'`google/protobuf/unittest_drop_unknown_fields.pb.cc -@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) google/protobuf/$(DEPDIR)/protobuf_lazy_descriptor_test-unittest_drop_unknown_fields.pb.Tpo google/protobuf/$(DEPDIR)/protobuf_lazy_descriptor_test-unittest_drop_unknown_fields.pb.Po -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='google/protobuf/unittest_drop_unknown_fields.pb.cc' object='google/protobuf/protobuf_lazy_descriptor_test-unittest_drop_unknown_fields.pb.o' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(protobuf_lazy_descriptor_test_CPPFLAGS) $(CPPFLAGS) $(protobuf_lazy_descriptor_test_CXXFLAGS) $(CXXFLAGS) -c -o google/protobuf/protobuf_lazy_descriptor_test-unittest_drop_unknown_fields.pb.o `test -f 'google/protobuf/unittest_drop_unknown_fields.pb.cc' || echo '$(srcdir)/'`google/protobuf/unittest_drop_unknown_fields.pb.cc - -google/protobuf/protobuf_lazy_descriptor_test-unittest_drop_unknown_fields.pb.obj: google/protobuf/unittest_drop_unknown_fields.pb.cc -@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(protobuf_lazy_descriptor_test_CPPFLAGS) $(CPPFLAGS) $(protobuf_lazy_descriptor_test_CXXFLAGS) $(CXXFLAGS) -MT google/protobuf/protobuf_lazy_descriptor_test-unittest_drop_unknown_fields.pb.obj -MD -MP -MF google/protobuf/$(DEPDIR)/protobuf_lazy_descriptor_test-unittest_drop_unknown_fields.pb.Tpo -c -o google/protobuf/protobuf_lazy_descriptor_test-unittest_drop_unknown_fields.pb.obj `if test -f 'google/protobuf/unittest_drop_unknown_fields.pb.cc'; then $(CYGPATH_W) 'google/protobuf/unittest_drop_unknown_fields.pb.cc'; else $(CYGPATH_W) '$(srcdir)/google/protobuf/unittest_drop_unknown_fields.pb.cc'; fi` -@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) google/protobuf/$(DEPDIR)/protobuf_lazy_descriptor_test-unittest_drop_unknown_fields.pb.Tpo google/protobuf/$(DEPDIR)/protobuf_lazy_descriptor_test-unittest_drop_unknown_fields.pb.Po -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='google/protobuf/unittest_drop_unknown_fields.pb.cc' object='google/protobuf/protobuf_lazy_descriptor_test-unittest_drop_unknown_fields.pb.obj' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(protobuf_lazy_descriptor_test_CPPFLAGS) $(CPPFLAGS) $(protobuf_lazy_descriptor_test_CXXFLAGS) $(CXXFLAGS) -c -o google/protobuf/protobuf_lazy_descriptor_test-unittest_drop_unknown_fields.pb.obj `if test -f 'google/protobuf/unittest_drop_unknown_fields.pb.cc'; then $(CYGPATH_W) 'google/protobuf/unittest_drop_unknown_fields.pb.cc'; else $(CYGPATH_W) '$(srcdir)/google/protobuf/unittest_drop_unknown_fields.pb.cc'; fi` - -google/protobuf/protobuf_lazy_descriptor_test-unittest_embed_optimize_for.pb.o: google/protobuf/unittest_embed_optimize_for.pb.cc -@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(protobuf_lazy_descriptor_test_CPPFLAGS) $(CPPFLAGS) $(protobuf_lazy_descriptor_test_CXXFLAGS) $(CXXFLAGS) -MT google/protobuf/protobuf_lazy_descriptor_test-unittest_embed_optimize_for.pb.o -MD -MP -MF google/protobuf/$(DEPDIR)/protobuf_lazy_descriptor_test-unittest_embed_optimize_for.pb.Tpo -c -o google/protobuf/protobuf_lazy_descriptor_test-unittest_embed_optimize_for.pb.o `test -f 'google/protobuf/unittest_embed_optimize_for.pb.cc' || echo '$(srcdir)/'`google/protobuf/unittest_embed_optimize_for.pb.cc -@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) google/protobuf/$(DEPDIR)/protobuf_lazy_descriptor_test-unittest_embed_optimize_for.pb.Tpo google/protobuf/$(DEPDIR)/protobuf_lazy_descriptor_test-unittest_embed_optimize_for.pb.Po -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='google/protobuf/unittest_embed_optimize_for.pb.cc' object='google/protobuf/protobuf_lazy_descriptor_test-unittest_embed_optimize_for.pb.o' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(protobuf_lazy_descriptor_test_CPPFLAGS) $(CPPFLAGS) $(protobuf_lazy_descriptor_test_CXXFLAGS) $(CXXFLAGS) -c -o google/protobuf/protobuf_lazy_descriptor_test-unittest_embed_optimize_for.pb.o `test -f 'google/protobuf/unittest_embed_optimize_for.pb.cc' || echo '$(srcdir)/'`google/protobuf/unittest_embed_optimize_for.pb.cc - -google/protobuf/protobuf_lazy_descriptor_test-unittest_embed_optimize_for.pb.obj: google/protobuf/unittest_embed_optimize_for.pb.cc -@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(protobuf_lazy_descriptor_test_CPPFLAGS) $(CPPFLAGS) $(protobuf_lazy_descriptor_test_CXXFLAGS) $(CXXFLAGS) -MT google/protobuf/protobuf_lazy_descriptor_test-unittest_embed_optimize_for.pb.obj -MD -MP -MF google/protobuf/$(DEPDIR)/protobuf_lazy_descriptor_test-unittest_embed_optimize_for.pb.Tpo -c -o google/protobuf/protobuf_lazy_descriptor_test-unittest_embed_optimize_for.pb.obj `if test -f 'google/protobuf/unittest_embed_optimize_for.pb.cc'; then $(CYGPATH_W) 'google/protobuf/unittest_embed_optimize_for.pb.cc'; else $(CYGPATH_W) '$(srcdir)/google/protobuf/unittest_embed_optimize_for.pb.cc'; fi` -@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) google/protobuf/$(DEPDIR)/protobuf_lazy_descriptor_test-unittest_embed_optimize_for.pb.Tpo google/protobuf/$(DEPDIR)/protobuf_lazy_descriptor_test-unittest_embed_optimize_for.pb.Po -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='google/protobuf/unittest_embed_optimize_for.pb.cc' object='google/protobuf/protobuf_lazy_descriptor_test-unittest_embed_optimize_for.pb.obj' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(protobuf_lazy_descriptor_test_CPPFLAGS) $(CPPFLAGS) $(protobuf_lazy_descriptor_test_CXXFLAGS) $(CXXFLAGS) -c -o google/protobuf/protobuf_lazy_descriptor_test-unittest_embed_optimize_for.pb.obj `if test -f 'google/protobuf/unittest_embed_optimize_for.pb.cc'; then $(CYGPATH_W) 'google/protobuf/unittest_embed_optimize_for.pb.cc'; else $(CYGPATH_W) '$(srcdir)/google/protobuf/unittest_embed_optimize_for.pb.cc'; fi` - -google/protobuf/protobuf_lazy_descriptor_test-unittest_empty.pb.o: google/protobuf/unittest_empty.pb.cc -@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(protobuf_lazy_descriptor_test_CPPFLAGS) $(CPPFLAGS) $(protobuf_lazy_descriptor_test_CXXFLAGS) $(CXXFLAGS) -MT google/protobuf/protobuf_lazy_descriptor_test-unittest_empty.pb.o -MD -MP -MF google/protobuf/$(DEPDIR)/protobuf_lazy_descriptor_test-unittest_empty.pb.Tpo -c -o google/protobuf/protobuf_lazy_descriptor_test-unittest_empty.pb.o `test -f 'google/protobuf/unittest_empty.pb.cc' || echo '$(srcdir)/'`google/protobuf/unittest_empty.pb.cc -@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) google/protobuf/$(DEPDIR)/protobuf_lazy_descriptor_test-unittest_empty.pb.Tpo google/protobuf/$(DEPDIR)/protobuf_lazy_descriptor_test-unittest_empty.pb.Po -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='google/protobuf/unittest_empty.pb.cc' object='google/protobuf/protobuf_lazy_descriptor_test-unittest_empty.pb.o' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(protobuf_lazy_descriptor_test_CPPFLAGS) $(CPPFLAGS) $(protobuf_lazy_descriptor_test_CXXFLAGS) $(CXXFLAGS) -c -o google/protobuf/protobuf_lazy_descriptor_test-unittest_empty.pb.o `test -f 'google/protobuf/unittest_empty.pb.cc' || echo '$(srcdir)/'`google/protobuf/unittest_empty.pb.cc - -google/protobuf/protobuf_lazy_descriptor_test-unittest_empty.pb.obj: google/protobuf/unittest_empty.pb.cc -@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(protobuf_lazy_descriptor_test_CPPFLAGS) $(CPPFLAGS) $(protobuf_lazy_descriptor_test_CXXFLAGS) $(CXXFLAGS) -MT google/protobuf/protobuf_lazy_descriptor_test-unittest_empty.pb.obj -MD -MP -MF google/protobuf/$(DEPDIR)/protobuf_lazy_descriptor_test-unittest_empty.pb.Tpo -c -o google/protobuf/protobuf_lazy_descriptor_test-unittest_empty.pb.obj `if test -f 'google/protobuf/unittest_empty.pb.cc'; then $(CYGPATH_W) 'google/protobuf/unittest_empty.pb.cc'; else $(CYGPATH_W) '$(srcdir)/google/protobuf/unittest_empty.pb.cc'; fi` -@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) google/protobuf/$(DEPDIR)/protobuf_lazy_descriptor_test-unittest_empty.pb.Tpo google/protobuf/$(DEPDIR)/protobuf_lazy_descriptor_test-unittest_empty.pb.Po -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='google/protobuf/unittest_empty.pb.cc' object='google/protobuf/protobuf_lazy_descriptor_test-unittest_empty.pb.obj' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(protobuf_lazy_descriptor_test_CPPFLAGS) $(CPPFLAGS) $(protobuf_lazy_descriptor_test_CXXFLAGS) $(CXXFLAGS) -c -o google/protobuf/protobuf_lazy_descriptor_test-unittest_empty.pb.obj `if test -f 'google/protobuf/unittest_empty.pb.cc'; then $(CYGPATH_W) 'google/protobuf/unittest_empty.pb.cc'; else $(CYGPATH_W) '$(srcdir)/google/protobuf/unittest_empty.pb.cc'; fi` - -google/protobuf/protobuf_lazy_descriptor_test-unittest_enormous_descriptor.pb.o: google/protobuf/unittest_enormous_descriptor.pb.cc -@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(protobuf_lazy_descriptor_test_CPPFLAGS) $(CPPFLAGS) $(protobuf_lazy_descriptor_test_CXXFLAGS) $(CXXFLAGS) -MT google/protobuf/protobuf_lazy_descriptor_test-unittest_enormous_descriptor.pb.o -MD -MP -MF google/protobuf/$(DEPDIR)/protobuf_lazy_descriptor_test-unittest_enormous_descriptor.pb.Tpo -c -o google/protobuf/protobuf_lazy_descriptor_test-unittest_enormous_descriptor.pb.o `test -f 'google/protobuf/unittest_enormous_descriptor.pb.cc' || echo '$(srcdir)/'`google/protobuf/unittest_enormous_descriptor.pb.cc -@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) google/protobuf/$(DEPDIR)/protobuf_lazy_descriptor_test-unittest_enormous_descriptor.pb.Tpo google/protobuf/$(DEPDIR)/protobuf_lazy_descriptor_test-unittest_enormous_descriptor.pb.Po -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='google/protobuf/unittest_enormous_descriptor.pb.cc' object='google/protobuf/protobuf_lazy_descriptor_test-unittest_enormous_descriptor.pb.o' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(protobuf_lazy_descriptor_test_CPPFLAGS) $(CPPFLAGS) $(protobuf_lazy_descriptor_test_CXXFLAGS) $(CXXFLAGS) -c -o google/protobuf/protobuf_lazy_descriptor_test-unittest_enormous_descriptor.pb.o `test -f 'google/protobuf/unittest_enormous_descriptor.pb.cc' || echo '$(srcdir)/'`google/protobuf/unittest_enormous_descriptor.pb.cc - -google/protobuf/protobuf_lazy_descriptor_test-unittest_enormous_descriptor.pb.obj: google/protobuf/unittest_enormous_descriptor.pb.cc -@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(protobuf_lazy_descriptor_test_CPPFLAGS) $(CPPFLAGS) $(protobuf_lazy_descriptor_test_CXXFLAGS) $(CXXFLAGS) -MT google/protobuf/protobuf_lazy_descriptor_test-unittest_enormous_descriptor.pb.obj -MD -MP -MF google/protobuf/$(DEPDIR)/protobuf_lazy_descriptor_test-unittest_enormous_descriptor.pb.Tpo -c -o google/protobuf/protobuf_lazy_descriptor_test-unittest_enormous_descriptor.pb.obj `if test -f 'google/protobuf/unittest_enormous_descriptor.pb.cc'; then $(CYGPATH_W) 'google/protobuf/unittest_enormous_descriptor.pb.cc'; else $(CYGPATH_W) '$(srcdir)/google/protobuf/unittest_enormous_descriptor.pb.cc'; fi` -@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) google/protobuf/$(DEPDIR)/protobuf_lazy_descriptor_test-unittest_enormous_descriptor.pb.Tpo google/protobuf/$(DEPDIR)/protobuf_lazy_descriptor_test-unittest_enormous_descriptor.pb.Po -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='google/protobuf/unittest_enormous_descriptor.pb.cc' object='google/protobuf/protobuf_lazy_descriptor_test-unittest_enormous_descriptor.pb.obj' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(protobuf_lazy_descriptor_test_CPPFLAGS) $(CPPFLAGS) $(protobuf_lazy_descriptor_test_CXXFLAGS) $(CXXFLAGS) -c -o google/protobuf/protobuf_lazy_descriptor_test-unittest_enormous_descriptor.pb.obj `if test -f 'google/protobuf/unittest_enormous_descriptor.pb.cc'; then $(CYGPATH_W) 'google/protobuf/unittest_enormous_descriptor.pb.cc'; else $(CYGPATH_W) '$(srcdir)/google/protobuf/unittest_enormous_descriptor.pb.cc'; fi` - -google/protobuf/protobuf_lazy_descriptor_test-unittest_import.pb.o: google/protobuf/unittest_import.pb.cc -@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(protobuf_lazy_descriptor_test_CPPFLAGS) $(CPPFLAGS) $(protobuf_lazy_descriptor_test_CXXFLAGS) $(CXXFLAGS) -MT google/protobuf/protobuf_lazy_descriptor_test-unittest_import.pb.o -MD -MP -MF google/protobuf/$(DEPDIR)/protobuf_lazy_descriptor_test-unittest_import.pb.Tpo -c -o google/protobuf/protobuf_lazy_descriptor_test-unittest_import.pb.o `test -f 'google/protobuf/unittest_import.pb.cc' || echo '$(srcdir)/'`google/protobuf/unittest_import.pb.cc -@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) google/protobuf/$(DEPDIR)/protobuf_lazy_descriptor_test-unittest_import.pb.Tpo google/protobuf/$(DEPDIR)/protobuf_lazy_descriptor_test-unittest_import.pb.Po -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='google/protobuf/unittest_import.pb.cc' object='google/protobuf/protobuf_lazy_descriptor_test-unittest_import.pb.o' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(protobuf_lazy_descriptor_test_CPPFLAGS) $(CPPFLAGS) $(protobuf_lazy_descriptor_test_CXXFLAGS) $(CXXFLAGS) -c -o google/protobuf/protobuf_lazy_descriptor_test-unittest_import.pb.o `test -f 'google/protobuf/unittest_import.pb.cc' || echo '$(srcdir)/'`google/protobuf/unittest_import.pb.cc - -google/protobuf/protobuf_lazy_descriptor_test-unittest_import.pb.obj: google/protobuf/unittest_import.pb.cc -@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(protobuf_lazy_descriptor_test_CPPFLAGS) $(CPPFLAGS) $(protobuf_lazy_descriptor_test_CXXFLAGS) $(CXXFLAGS) -MT google/protobuf/protobuf_lazy_descriptor_test-unittest_import.pb.obj -MD -MP -MF google/protobuf/$(DEPDIR)/protobuf_lazy_descriptor_test-unittest_import.pb.Tpo -c -o google/protobuf/protobuf_lazy_descriptor_test-unittest_import.pb.obj `if test -f 'google/protobuf/unittest_import.pb.cc'; then $(CYGPATH_W) 'google/protobuf/unittest_import.pb.cc'; else $(CYGPATH_W) '$(srcdir)/google/protobuf/unittest_import.pb.cc'; fi` -@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) google/protobuf/$(DEPDIR)/protobuf_lazy_descriptor_test-unittest_import.pb.Tpo google/protobuf/$(DEPDIR)/protobuf_lazy_descriptor_test-unittest_import.pb.Po -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='google/protobuf/unittest_import.pb.cc' object='google/protobuf/protobuf_lazy_descriptor_test-unittest_import.pb.obj' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(protobuf_lazy_descriptor_test_CPPFLAGS) $(CPPFLAGS) $(protobuf_lazy_descriptor_test_CXXFLAGS) $(CXXFLAGS) -c -o google/protobuf/protobuf_lazy_descriptor_test-unittest_import.pb.obj `if test -f 'google/protobuf/unittest_import.pb.cc'; then $(CYGPATH_W) 'google/protobuf/unittest_import.pb.cc'; else $(CYGPATH_W) '$(srcdir)/google/protobuf/unittest_import.pb.cc'; fi` - -google/protobuf/protobuf_lazy_descriptor_test-unittest_import_public.pb.o: google/protobuf/unittest_import_public.pb.cc -@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(protobuf_lazy_descriptor_test_CPPFLAGS) $(CPPFLAGS) $(protobuf_lazy_descriptor_test_CXXFLAGS) $(CXXFLAGS) -MT google/protobuf/protobuf_lazy_descriptor_test-unittest_import_public.pb.o -MD -MP -MF google/protobuf/$(DEPDIR)/protobuf_lazy_descriptor_test-unittest_import_public.pb.Tpo -c -o google/protobuf/protobuf_lazy_descriptor_test-unittest_import_public.pb.o `test -f 'google/protobuf/unittest_import_public.pb.cc' || echo '$(srcdir)/'`google/protobuf/unittest_import_public.pb.cc -@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) google/protobuf/$(DEPDIR)/protobuf_lazy_descriptor_test-unittest_import_public.pb.Tpo google/protobuf/$(DEPDIR)/protobuf_lazy_descriptor_test-unittest_import_public.pb.Po -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='google/protobuf/unittest_import_public.pb.cc' object='google/protobuf/protobuf_lazy_descriptor_test-unittest_import_public.pb.o' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(protobuf_lazy_descriptor_test_CPPFLAGS) $(CPPFLAGS) $(protobuf_lazy_descriptor_test_CXXFLAGS) $(CXXFLAGS) -c -o google/protobuf/protobuf_lazy_descriptor_test-unittest_import_public.pb.o `test -f 'google/protobuf/unittest_import_public.pb.cc' || echo '$(srcdir)/'`google/protobuf/unittest_import_public.pb.cc - -google/protobuf/protobuf_lazy_descriptor_test-unittest_import_public.pb.obj: google/protobuf/unittest_import_public.pb.cc -@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(protobuf_lazy_descriptor_test_CPPFLAGS) $(CPPFLAGS) $(protobuf_lazy_descriptor_test_CXXFLAGS) $(CXXFLAGS) -MT google/protobuf/protobuf_lazy_descriptor_test-unittest_import_public.pb.obj -MD -MP -MF google/protobuf/$(DEPDIR)/protobuf_lazy_descriptor_test-unittest_import_public.pb.Tpo -c -o google/protobuf/protobuf_lazy_descriptor_test-unittest_import_public.pb.obj `if test -f 'google/protobuf/unittest_import_public.pb.cc'; then $(CYGPATH_W) 'google/protobuf/unittest_import_public.pb.cc'; else $(CYGPATH_W) '$(srcdir)/google/protobuf/unittest_import_public.pb.cc'; fi` -@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) google/protobuf/$(DEPDIR)/protobuf_lazy_descriptor_test-unittest_import_public.pb.Tpo google/protobuf/$(DEPDIR)/protobuf_lazy_descriptor_test-unittest_import_public.pb.Po -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='google/protobuf/unittest_import_public.pb.cc' object='google/protobuf/protobuf_lazy_descriptor_test-unittest_import_public.pb.obj' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(protobuf_lazy_descriptor_test_CPPFLAGS) $(CPPFLAGS) $(protobuf_lazy_descriptor_test_CXXFLAGS) $(CXXFLAGS) -c -o google/protobuf/protobuf_lazy_descriptor_test-unittest_import_public.pb.obj `if test -f 'google/protobuf/unittest_import_public.pb.cc'; then $(CYGPATH_W) 'google/protobuf/unittest_import_public.pb.cc'; else $(CYGPATH_W) '$(srcdir)/google/protobuf/unittest_import_public.pb.cc'; fi` - -google/protobuf/protobuf_lazy_descriptor_test-unittest_lazy_dependencies.pb.o: google/protobuf/unittest_lazy_dependencies.pb.cc -@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(protobuf_lazy_descriptor_test_CPPFLAGS) $(CPPFLAGS) $(protobuf_lazy_descriptor_test_CXXFLAGS) $(CXXFLAGS) -MT google/protobuf/protobuf_lazy_descriptor_test-unittest_lazy_dependencies.pb.o -MD -MP -MF google/protobuf/$(DEPDIR)/protobuf_lazy_descriptor_test-unittest_lazy_dependencies.pb.Tpo -c -o google/protobuf/protobuf_lazy_descriptor_test-unittest_lazy_dependencies.pb.o `test -f 'google/protobuf/unittest_lazy_dependencies.pb.cc' || echo '$(srcdir)/'`google/protobuf/unittest_lazy_dependencies.pb.cc -@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) google/protobuf/$(DEPDIR)/protobuf_lazy_descriptor_test-unittest_lazy_dependencies.pb.Tpo google/protobuf/$(DEPDIR)/protobuf_lazy_descriptor_test-unittest_lazy_dependencies.pb.Po -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='google/protobuf/unittest_lazy_dependencies.pb.cc' object='google/protobuf/protobuf_lazy_descriptor_test-unittest_lazy_dependencies.pb.o' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(protobuf_lazy_descriptor_test_CPPFLAGS) $(CPPFLAGS) $(protobuf_lazy_descriptor_test_CXXFLAGS) $(CXXFLAGS) -c -o google/protobuf/protobuf_lazy_descriptor_test-unittest_lazy_dependencies.pb.o `test -f 'google/protobuf/unittest_lazy_dependencies.pb.cc' || echo '$(srcdir)/'`google/protobuf/unittest_lazy_dependencies.pb.cc - -google/protobuf/protobuf_lazy_descriptor_test-unittest_lazy_dependencies.pb.obj: google/protobuf/unittest_lazy_dependencies.pb.cc -@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(protobuf_lazy_descriptor_test_CPPFLAGS) $(CPPFLAGS) $(protobuf_lazy_descriptor_test_CXXFLAGS) $(CXXFLAGS) -MT google/protobuf/protobuf_lazy_descriptor_test-unittest_lazy_dependencies.pb.obj -MD -MP -MF google/protobuf/$(DEPDIR)/protobuf_lazy_descriptor_test-unittest_lazy_dependencies.pb.Tpo -c -o google/protobuf/protobuf_lazy_descriptor_test-unittest_lazy_dependencies.pb.obj `if test -f 'google/protobuf/unittest_lazy_dependencies.pb.cc'; then $(CYGPATH_W) 'google/protobuf/unittest_lazy_dependencies.pb.cc'; else $(CYGPATH_W) '$(srcdir)/google/protobuf/unittest_lazy_dependencies.pb.cc'; fi` -@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) google/protobuf/$(DEPDIR)/protobuf_lazy_descriptor_test-unittest_lazy_dependencies.pb.Tpo google/protobuf/$(DEPDIR)/protobuf_lazy_descriptor_test-unittest_lazy_dependencies.pb.Po -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='google/protobuf/unittest_lazy_dependencies.pb.cc' object='google/protobuf/protobuf_lazy_descriptor_test-unittest_lazy_dependencies.pb.obj' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(protobuf_lazy_descriptor_test_CPPFLAGS) $(CPPFLAGS) $(protobuf_lazy_descriptor_test_CXXFLAGS) $(CXXFLAGS) -c -o google/protobuf/protobuf_lazy_descriptor_test-unittest_lazy_dependencies.pb.obj `if test -f 'google/protobuf/unittest_lazy_dependencies.pb.cc'; then $(CYGPATH_W) 'google/protobuf/unittest_lazy_dependencies.pb.cc'; else $(CYGPATH_W) '$(srcdir)/google/protobuf/unittest_lazy_dependencies.pb.cc'; fi` - -google/protobuf/protobuf_lazy_descriptor_test-unittest_lazy_dependencies_custom_option.pb.o: google/protobuf/unittest_lazy_dependencies_custom_option.pb.cc -@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(protobuf_lazy_descriptor_test_CPPFLAGS) $(CPPFLAGS) $(protobuf_lazy_descriptor_test_CXXFLAGS) $(CXXFLAGS) -MT google/protobuf/protobuf_lazy_descriptor_test-unittest_lazy_dependencies_custom_option.pb.o -MD -MP -MF google/protobuf/$(DEPDIR)/protobuf_lazy_descriptor_test-unittest_lazy_dependencies_custom_option.pb.Tpo -c -o google/protobuf/protobuf_lazy_descriptor_test-unittest_lazy_dependencies_custom_option.pb.o `test -f 'google/protobuf/unittest_lazy_dependencies_custom_option.pb.cc' || echo '$(srcdir)/'`google/protobuf/unittest_lazy_dependencies_custom_option.pb.cc -@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) google/protobuf/$(DEPDIR)/protobuf_lazy_descriptor_test-unittest_lazy_dependencies_custom_option.pb.Tpo google/protobuf/$(DEPDIR)/protobuf_lazy_descriptor_test-unittest_lazy_dependencies_custom_option.pb.Po -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='google/protobuf/unittest_lazy_dependencies_custom_option.pb.cc' object='google/protobuf/protobuf_lazy_descriptor_test-unittest_lazy_dependencies_custom_option.pb.o' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(protobuf_lazy_descriptor_test_CPPFLAGS) $(CPPFLAGS) $(protobuf_lazy_descriptor_test_CXXFLAGS) $(CXXFLAGS) -c -o google/protobuf/protobuf_lazy_descriptor_test-unittest_lazy_dependencies_custom_option.pb.o `test -f 'google/protobuf/unittest_lazy_dependencies_custom_option.pb.cc' || echo '$(srcdir)/'`google/protobuf/unittest_lazy_dependencies_custom_option.pb.cc - -google/protobuf/protobuf_lazy_descriptor_test-unittest_lazy_dependencies_custom_option.pb.obj: google/protobuf/unittest_lazy_dependencies_custom_option.pb.cc -@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(protobuf_lazy_descriptor_test_CPPFLAGS) $(CPPFLAGS) $(protobuf_lazy_descriptor_test_CXXFLAGS) $(CXXFLAGS) -MT google/protobuf/protobuf_lazy_descriptor_test-unittest_lazy_dependencies_custom_option.pb.obj -MD -MP -MF google/protobuf/$(DEPDIR)/protobuf_lazy_descriptor_test-unittest_lazy_dependencies_custom_option.pb.Tpo -c -o google/protobuf/protobuf_lazy_descriptor_test-unittest_lazy_dependencies_custom_option.pb.obj `if test -f 'google/protobuf/unittest_lazy_dependencies_custom_option.pb.cc'; then $(CYGPATH_W) 'google/protobuf/unittest_lazy_dependencies_custom_option.pb.cc'; else $(CYGPATH_W) '$(srcdir)/google/protobuf/unittest_lazy_dependencies_custom_option.pb.cc'; fi` -@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) google/protobuf/$(DEPDIR)/protobuf_lazy_descriptor_test-unittest_lazy_dependencies_custom_option.pb.Tpo google/protobuf/$(DEPDIR)/protobuf_lazy_descriptor_test-unittest_lazy_dependencies_custom_option.pb.Po -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='google/protobuf/unittest_lazy_dependencies_custom_option.pb.cc' object='google/protobuf/protobuf_lazy_descriptor_test-unittest_lazy_dependencies_custom_option.pb.obj' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(protobuf_lazy_descriptor_test_CPPFLAGS) $(CPPFLAGS) $(protobuf_lazy_descriptor_test_CXXFLAGS) $(CXXFLAGS) -c -o google/protobuf/protobuf_lazy_descriptor_test-unittest_lazy_dependencies_custom_option.pb.obj `if test -f 'google/protobuf/unittest_lazy_dependencies_custom_option.pb.cc'; then $(CYGPATH_W) 'google/protobuf/unittest_lazy_dependencies_custom_option.pb.cc'; else $(CYGPATH_W) '$(srcdir)/google/protobuf/unittest_lazy_dependencies_custom_option.pb.cc'; fi` - -google/protobuf/protobuf_lazy_descriptor_test-unittest_lazy_dependencies_enum.pb.o: google/protobuf/unittest_lazy_dependencies_enum.pb.cc -@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(protobuf_lazy_descriptor_test_CPPFLAGS) $(CPPFLAGS) $(protobuf_lazy_descriptor_test_CXXFLAGS) $(CXXFLAGS) -MT google/protobuf/protobuf_lazy_descriptor_test-unittest_lazy_dependencies_enum.pb.o -MD -MP -MF google/protobuf/$(DEPDIR)/protobuf_lazy_descriptor_test-unittest_lazy_dependencies_enum.pb.Tpo -c -o google/protobuf/protobuf_lazy_descriptor_test-unittest_lazy_dependencies_enum.pb.o `test -f 'google/protobuf/unittest_lazy_dependencies_enum.pb.cc' || echo '$(srcdir)/'`google/protobuf/unittest_lazy_dependencies_enum.pb.cc -@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) google/protobuf/$(DEPDIR)/protobuf_lazy_descriptor_test-unittest_lazy_dependencies_enum.pb.Tpo google/protobuf/$(DEPDIR)/protobuf_lazy_descriptor_test-unittest_lazy_dependencies_enum.pb.Po -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='google/protobuf/unittest_lazy_dependencies_enum.pb.cc' object='google/protobuf/protobuf_lazy_descriptor_test-unittest_lazy_dependencies_enum.pb.o' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(protobuf_lazy_descriptor_test_CPPFLAGS) $(CPPFLAGS) $(protobuf_lazy_descriptor_test_CXXFLAGS) $(CXXFLAGS) -c -o google/protobuf/protobuf_lazy_descriptor_test-unittest_lazy_dependencies_enum.pb.o `test -f 'google/protobuf/unittest_lazy_dependencies_enum.pb.cc' || echo '$(srcdir)/'`google/protobuf/unittest_lazy_dependencies_enum.pb.cc - -google/protobuf/protobuf_lazy_descriptor_test-unittest_lazy_dependencies_enum.pb.obj: google/protobuf/unittest_lazy_dependencies_enum.pb.cc -@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(protobuf_lazy_descriptor_test_CPPFLAGS) $(CPPFLAGS) $(protobuf_lazy_descriptor_test_CXXFLAGS) $(CXXFLAGS) -MT google/protobuf/protobuf_lazy_descriptor_test-unittest_lazy_dependencies_enum.pb.obj -MD -MP -MF google/protobuf/$(DEPDIR)/protobuf_lazy_descriptor_test-unittest_lazy_dependencies_enum.pb.Tpo -c -o google/protobuf/protobuf_lazy_descriptor_test-unittest_lazy_dependencies_enum.pb.obj `if test -f 'google/protobuf/unittest_lazy_dependencies_enum.pb.cc'; then $(CYGPATH_W) 'google/protobuf/unittest_lazy_dependencies_enum.pb.cc'; else $(CYGPATH_W) '$(srcdir)/google/protobuf/unittest_lazy_dependencies_enum.pb.cc'; fi` -@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) google/protobuf/$(DEPDIR)/protobuf_lazy_descriptor_test-unittest_lazy_dependencies_enum.pb.Tpo google/protobuf/$(DEPDIR)/protobuf_lazy_descriptor_test-unittest_lazy_dependencies_enum.pb.Po -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='google/protobuf/unittest_lazy_dependencies_enum.pb.cc' object='google/protobuf/protobuf_lazy_descriptor_test-unittest_lazy_dependencies_enum.pb.obj' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(protobuf_lazy_descriptor_test_CPPFLAGS) $(CPPFLAGS) $(protobuf_lazy_descriptor_test_CXXFLAGS) $(CXXFLAGS) -c -o google/protobuf/protobuf_lazy_descriptor_test-unittest_lazy_dependencies_enum.pb.obj `if test -f 'google/protobuf/unittest_lazy_dependencies_enum.pb.cc'; then $(CYGPATH_W) 'google/protobuf/unittest_lazy_dependencies_enum.pb.cc'; else $(CYGPATH_W) '$(srcdir)/google/protobuf/unittest_lazy_dependencies_enum.pb.cc'; fi` - -google/protobuf/protobuf_lazy_descriptor_test-unittest_lite_imports_nonlite.pb.o: google/protobuf/unittest_lite_imports_nonlite.pb.cc -@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(protobuf_lazy_descriptor_test_CPPFLAGS) $(CPPFLAGS) $(protobuf_lazy_descriptor_test_CXXFLAGS) $(CXXFLAGS) -MT google/protobuf/protobuf_lazy_descriptor_test-unittest_lite_imports_nonlite.pb.o -MD -MP -MF google/protobuf/$(DEPDIR)/protobuf_lazy_descriptor_test-unittest_lite_imports_nonlite.pb.Tpo -c -o google/protobuf/protobuf_lazy_descriptor_test-unittest_lite_imports_nonlite.pb.o `test -f 'google/protobuf/unittest_lite_imports_nonlite.pb.cc' || echo '$(srcdir)/'`google/protobuf/unittest_lite_imports_nonlite.pb.cc -@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) google/protobuf/$(DEPDIR)/protobuf_lazy_descriptor_test-unittest_lite_imports_nonlite.pb.Tpo google/protobuf/$(DEPDIR)/protobuf_lazy_descriptor_test-unittest_lite_imports_nonlite.pb.Po -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='google/protobuf/unittest_lite_imports_nonlite.pb.cc' object='google/protobuf/protobuf_lazy_descriptor_test-unittest_lite_imports_nonlite.pb.o' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(protobuf_lazy_descriptor_test_CPPFLAGS) $(CPPFLAGS) $(protobuf_lazy_descriptor_test_CXXFLAGS) $(CXXFLAGS) -c -o google/protobuf/protobuf_lazy_descriptor_test-unittest_lite_imports_nonlite.pb.o `test -f 'google/protobuf/unittest_lite_imports_nonlite.pb.cc' || echo '$(srcdir)/'`google/protobuf/unittest_lite_imports_nonlite.pb.cc - -google/protobuf/protobuf_lazy_descriptor_test-unittest_lite_imports_nonlite.pb.obj: google/protobuf/unittest_lite_imports_nonlite.pb.cc -@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(protobuf_lazy_descriptor_test_CPPFLAGS) $(CPPFLAGS) $(protobuf_lazy_descriptor_test_CXXFLAGS) $(CXXFLAGS) -MT google/protobuf/protobuf_lazy_descriptor_test-unittest_lite_imports_nonlite.pb.obj -MD -MP -MF google/protobuf/$(DEPDIR)/protobuf_lazy_descriptor_test-unittest_lite_imports_nonlite.pb.Tpo -c -o google/protobuf/protobuf_lazy_descriptor_test-unittest_lite_imports_nonlite.pb.obj `if test -f 'google/protobuf/unittest_lite_imports_nonlite.pb.cc'; then $(CYGPATH_W) 'google/protobuf/unittest_lite_imports_nonlite.pb.cc'; else $(CYGPATH_W) '$(srcdir)/google/protobuf/unittest_lite_imports_nonlite.pb.cc'; fi` -@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) google/protobuf/$(DEPDIR)/protobuf_lazy_descriptor_test-unittest_lite_imports_nonlite.pb.Tpo google/protobuf/$(DEPDIR)/protobuf_lazy_descriptor_test-unittest_lite_imports_nonlite.pb.Po -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='google/protobuf/unittest_lite_imports_nonlite.pb.cc' object='google/protobuf/protobuf_lazy_descriptor_test-unittest_lite_imports_nonlite.pb.obj' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(protobuf_lazy_descriptor_test_CPPFLAGS) $(CPPFLAGS) $(protobuf_lazy_descriptor_test_CXXFLAGS) $(CXXFLAGS) -c -o google/protobuf/protobuf_lazy_descriptor_test-unittest_lite_imports_nonlite.pb.obj `if test -f 'google/protobuf/unittest_lite_imports_nonlite.pb.cc'; then $(CYGPATH_W) 'google/protobuf/unittest_lite_imports_nonlite.pb.cc'; else $(CYGPATH_W) '$(srcdir)/google/protobuf/unittest_lite_imports_nonlite.pb.cc'; fi` - -google/protobuf/protobuf_lazy_descriptor_test-unittest_mset.pb.o: google/protobuf/unittest_mset.pb.cc -@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(protobuf_lazy_descriptor_test_CPPFLAGS) $(CPPFLAGS) $(protobuf_lazy_descriptor_test_CXXFLAGS) $(CXXFLAGS) -MT google/protobuf/protobuf_lazy_descriptor_test-unittest_mset.pb.o -MD -MP -MF google/protobuf/$(DEPDIR)/protobuf_lazy_descriptor_test-unittest_mset.pb.Tpo -c -o google/protobuf/protobuf_lazy_descriptor_test-unittest_mset.pb.o `test -f 'google/protobuf/unittest_mset.pb.cc' || echo '$(srcdir)/'`google/protobuf/unittest_mset.pb.cc -@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) google/protobuf/$(DEPDIR)/protobuf_lazy_descriptor_test-unittest_mset.pb.Tpo google/protobuf/$(DEPDIR)/protobuf_lazy_descriptor_test-unittest_mset.pb.Po -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='google/protobuf/unittest_mset.pb.cc' object='google/protobuf/protobuf_lazy_descriptor_test-unittest_mset.pb.o' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(protobuf_lazy_descriptor_test_CPPFLAGS) $(CPPFLAGS) $(protobuf_lazy_descriptor_test_CXXFLAGS) $(CXXFLAGS) -c -o google/protobuf/protobuf_lazy_descriptor_test-unittest_mset.pb.o `test -f 'google/protobuf/unittest_mset.pb.cc' || echo '$(srcdir)/'`google/protobuf/unittest_mset.pb.cc - -google/protobuf/protobuf_lazy_descriptor_test-unittest_mset.pb.obj: google/protobuf/unittest_mset.pb.cc -@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(protobuf_lazy_descriptor_test_CPPFLAGS) $(CPPFLAGS) $(protobuf_lazy_descriptor_test_CXXFLAGS) $(CXXFLAGS) -MT google/protobuf/protobuf_lazy_descriptor_test-unittest_mset.pb.obj -MD -MP -MF google/protobuf/$(DEPDIR)/protobuf_lazy_descriptor_test-unittest_mset.pb.Tpo -c -o google/protobuf/protobuf_lazy_descriptor_test-unittest_mset.pb.obj `if test -f 'google/protobuf/unittest_mset.pb.cc'; then $(CYGPATH_W) 'google/protobuf/unittest_mset.pb.cc'; else $(CYGPATH_W) '$(srcdir)/google/protobuf/unittest_mset.pb.cc'; fi` -@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) google/protobuf/$(DEPDIR)/protobuf_lazy_descriptor_test-unittest_mset.pb.Tpo google/protobuf/$(DEPDIR)/protobuf_lazy_descriptor_test-unittest_mset.pb.Po -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='google/protobuf/unittest_mset.pb.cc' object='google/protobuf/protobuf_lazy_descriptor_test-unittest_mset.pb.obj' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(protobuf_lazy_descriptor_test_CPPFLAGS) $(CPPFLAGS) $(protobuf_lazy_descriptor_test_CXXFLAGS) $(CXXFLAGS) -c -o google/protobuf/protobuf_lazy_descriptor_test-unittest_mset.pb.obj `if test -f 'google/protobuf/unittest_mset.pb.cc'; then $(CYGPATH_W) 'google/protobuf/unittest_mset.pb.cc'; else $(CYGPATH_W) '$(srcdir)/google/protobuf/unittest_mset.pb.cc'; fi` - -google/protobuf/protobuf_lazy_descriptor_test-unittest_mset_wire_format.pb.o: google/protobuf/unittest_mset_wire_format.pb.cc -@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(protobuf_lazy_descriptor_test_CPPFLAGS) $(CPPFLAGS) $(protobuf_lazy_descriptor_test_CXXFLAGS) $(CXXFLAGS) -MT google/protobuf/protobuf_lazy_descriptor_test-unittest_mset_wire_format.pb.o -MD -MP -MF google/protobuf/$(DEPDIR)/protobuf_lazy_descriptor_test-unittest_mset_wire_format.pb.Tpo -c -o google/protobuf/protobuf_lazy_descriptor_test-unittest_mset_wire_format.pb.o `test -f 'google/protobuf/unittest_mset_wire_format.pb.cc' || echo '$(srcdir)/'`google/protobuf/unittest_mset_wire_format.pb.cc -@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) google/protobuf/$(DEPDIR)/protobuf_lazy_descriptor_test-unittest_mset_wire_format.pb.Tpo google/protobuf/$(DEPDIR)/protobuf_lazy_descriptor_test-unittest_mset_wire_format.pb.Po -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='google/protobuf/unittest_mset_wire_format.pb.cc' object='google/protobuf/protobuf_lazy_descriptor_test-unittest_mset_wire_format.pb.o' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(protobuf_lazy_descriptor_test_CPPFLAGS) $(CPPFLAGS) $(protobuf_lazy_descriptor_test_CXXFLAGS) $(CXXFLAGS) -c -o google/protobuf/protobuf_lazy_descriptor_test-unittest_mset_wire_format.pb.o `test -f 'google/protobuf/unittest_mset_wire_format.pb.cc' || echo '$(srcdir)/'`google/protobuf/unittest_mset_wire_format.pb.cc - -google/protobuf/protobuf_lazy_descriptor_test-unittest_mset_wire_format.pb.obj: google/protobuf/unittest_mset_wire_format.pb.cc -@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(protobuf_lazy_descriptor_test_CPPFLAGS) $(CPPFLAGS) $(protobuf_lazy_descriptor_test_CXXFLAGS) $(CXXFLAGS) -MT google/protobuf/protobuf_lazy_descriptor_test-unittest_mset_wire_format.pb.obj -MD -MP -MF google/protobuf/$(DEPDIR)/protobuf_lazy_descriptor_test-unittest_mset_wire_format.pb.Tpo -c -o google/protobuf/protobuf_lazy_descriptor_test-unittest_mset_wire_format.pb.obj `if test -f 'google/protobuf/unittest_mset_wire_format.pb.cc'; then $(CYGPATH_W) 'google/protobuf/unittest_mset_wire_format.pb.cc'; else $(CYGPATH_W) '$(srcdir)/google/protobuf/unittest_mset_wire_format.pb.cc'; fi` -@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) google/protobuf/$(DEPDIR)/protobuf_lazy_descriptor_test-unittest_mset_wire_format.pb.Tpo google/protobuf/$(DEPDIR)/protobuf_lazy_descriptor_test-unittest_mset_wire_format.pb.Po -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='google/protobuf/unittest_mset_wire_format.pb.cc' object='google/protobuf/protobuf_lazy_descriptor_test-unittest_mset_wire_format.pb.obj' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(protobuf_lazy_descriptor_test_CPPFLAGS) $(CPPFLAGS) $(protobuf_lazy_descriptor_test_CXXFLAGS) $(CXXFLAGS) -c -o google/protobuf/protobuf_lazy_descriptor_test-unittest_mset_wire_format.pb.obj `if test -f 'google/protobuf/unittest_mset_wire_format.pb.cc'; then $(CYGPATH_W) 'google/protobuf/unittest_mset_wire_format.pb.cc'; else $(CYGPATH_W) '$(srcdir)/google/protobuf/unittest_mset_wire_format.pb.cc'; fi` - -google/protobuf/protobuf_lazy_descriptor_test-unittest_no_field_presence.pb.o: google/protobuf/unittest_no_field_presence.pb.cc -@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(protobuf_lazy_descriptor_test_CPPFLAGS) $(CPPFLAGS) $(protobuf_lazy_descriptor_test_CXXFLAGS) $(CXXFLAGS) -MT google/protobuf/protobuf_lazy_descriptor_test-unittest_no_field_presence.pb.o -MD -MP -MF google/protobuf/$(DEPDIR)/protobuf_lazy_descriptor_test-unittest_no_field_presence.pb.Tpo -c -o google/protobuf/protobuf_lazy_descriptor_test-unittest_no_field_presence.pb.o `test -f 'google/protobuf/unittest_no_field_presence.pb.cc' || echo '$(srcdir)/'`google/protobuf/unittest_no_field_presence.pb.cc -@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) google/protobuf/$(DEPDIR)/protobuf_lazy_descriptor_test-unittest_no_field_presence.pb.Tpo google/protobuf/$(DEPDIR)/protobuf_lazy_descriptor_test-unittest_no_field_presence.pb.Po -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='google/protobuf/unittest_no_field_presence.pb.cc' object='google/protobuf/protobuf_lazy_descriptor_test-unittest_no_field_presence.pb.o' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(protobuf_lazy_descriptor_test_CPPFLAGS) $(CPPFLAGS) $(protobuf_lazy_descriptor_test_CXXFLAGS) $(CXXFLAGS) -c -o google/protobuf/protobuf_lazy_descriptor_test-unittest_no_field_presence.pb.o `test -f 'google/protobuf/unittest_no_field_presence.pb.cc' || echo '$(srcdir)/'`google/protobuf/unittest_no_field_presence.pb.cc - -google/protobuf/protobuf_lazy_descriptor_test-unittest_no_field_presence.pb.obj: google/protobuf/unittest_no_field_presence.pb.cc -@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(protobuf_lazy_descriptor_test_CPPFLAGS) $(CPPFLAGS) $(protobuf_lazy_descriptor_test_CXXFLAGS) $(CXXFLAGS) -MT google/protobuf/protobuf_lazy_descriptor_test-unittest_no_field_presence.pb.obj -MD -MP -MF google/protobuf/$(DEPDIR)/protobuf_lazy_descriptor_test-unittest_no_field_presence.pb.Tpo -c -o google/protobuf/protobuf_lazy_descriptor_test-unittest_no_field_presence.pb.obj `if test -f 'google/protobuf/unittest_no_field_presence.pb.cc'; then $(CYGPATH_W) 'google/protobuf/unittest_no_field_presence.pb.cc'; else $(CYGPATH_W) '$(srcdir)/google/protobuf/unittest_no_field_presence.pb.cc'; fi` -@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) google/protobuf/$(DEPDIR)/protobuf_lazy_descriptor_test-unittest_no_field_presence.pb.Tpo google/protobuf/$(DEPDIR)/protobuf_lazy_descriptor_test-unittest_no_field_presence.pb.Po -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='google/protobuf/unittest_no_field_presence.pb.cc' object='google/protobuf/protobuf_lazy_descriptor_test-unittest_no_field_presence.pb.obj' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(protobuf_lazy_descriptor_test_CPPFLAGS) $(CPPFLAGS) $(protobuf_lazy_descriptor_test_CXXFLAGS) $(CXXFLAGS) -c -o google/protobuf/protobuf_lazy_descriptor_test-unittest_no_field_presence.pb.obj `if test -f 'google/protobuf/unittest_no_field_presence.pb.cc'; then $(CYGPATH_W) 'google/protobuf/unittest_no_field_presence.pb.cc'; else $(CYGPATH_W) '$(srcdir)/google/protobuf/unittest_no_field_presence.pb.cc'; fi` - -google/protobuf/protobuf_lazy_descriptor_test-unittest_no_generic_services.pb.o: google/protobuf/unittest_no_generic_services.pb.cc -@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(protobuf_lazy_descriptor_test_CPPFLAGS) $(CPPFLAGS) $(protobuf_lazy_descriptor_test_CXXFLAGS) $(CXXFLAGS) -MT google/protobuf/protobuf_lazy_descriptor_test-unittest_no_generic_services.pb.o -MD -MP -MF google/protobuf/$(DEPDIR)/protobuf_lazy_descriptor_test-unittest_no_generic_services.pb.Tpo -c -o google/protobuf/protobuf_lazy_descriptor_test-unittest_no_generic_services.pb.o `test -f 'google/protobuf/unittest_no_generic_services.pb.cc' || echo '$(srcdir)/'`google/protobuf/unittest_no_generic_services.pb.cc -@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) google/protobuf/$(DEPDIR)/protobuf_lazy_descriptor_test-unittest_no_generic_services.pb.Tpo google/protobuf/$(DEPDIR)/protobuf_lazy_descriptor_test-unittest_no_generic_services.pb.Po -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='google/protobuf/unittest_no_generic_services.pb.cc' object='google/protobuf/protobuf_lazy_descriptor_test-unittest_no_generic_services.pb.o' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(protobuf_lazy_descriptor_test_CPPFLAGS) $(CPPFLAGS) $(protobuf_lazy_descriptor_test_CXXFLAGS) $(CXXFLAGS) -c -o google/protobuf/protobuf_lazy_descriptor_test-unittest_no_generic_services.pb.o `test -f 'google/protobuf/unittest_no_generic_services.pb.cc' || echo '$(srcdir)/'`google/protobuf/unittest_no_generic_services.pb.cc - -google/protobuf/protobuf_lazy_descriptor_test-unittest_no_generic_services.pb.obj: google/protobuf/unittest_no_generic_services.pb.cc -@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(protobuf_lazy_descriptor_test_CPPFLAGS) $(CPPFLAGS) $(protobuf_lazy_descriptor_test_CXXFLAGS) $(CXXFLAGS) -MT google/protobuf/protobuf_lazy_descriptor_test-unittest_no_generic_services.pb.obj -MD -MP -MF google/protobuf/$(DEPDIR)/protobuf_lazy_descriptor_test-unittest_no_generic_services.pb.Tpo -c -o google/protobuf/protobuf_lazy_descriptor_test-unittest_no_generic_services.pb.obj `if test -f 'google/protobuf/unittest_no_generic_services.pb.cc'; then $(CYGPATH_W) 'google/protobuf/unittest_no_generic_services.pb.cc'; else $(CYGPATH_W) '$(srcdir)/google/protobuf/unittest_no_generic_services.pb.cc'; fi` -@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) google/protobuf/$(DEPDIR)/protobuf_lazy_descriptor_test-unittest_no_generic_services.pb.Tpo google/protobuf/$(DEPDIR)/protobuf_lazy_descriptor_test-unittest_no_generic_services.pb.Po -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='google/protobuf/unittest_no_generic_services.pb.cc' object='google/protobuf/protobuf_lazy_descriptor_test-unittest_no_generic_services.pb.obj' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(protobuf_lazy_descriptor_test_CPPFLAGS) $(CPPFLAGS) $(protobuf_lazy_descriptor_test_CXXFLAGS) $(CXXFLAGS) -c -o google/protobuf/protobuf_lazy_descriptor_test-unittest_no_generic_services.pb.obj `if test -f 'google/protobuf/unittest_no_generic_services.pb.cc'; then $(CYGPATH_W) 'google/protobuf/unittest_no_generic_services.pb.cc'; else $(CYGPATH_W) '$(srcdir)/google/protobuf/unittest_no_generic_services.pb.cc'; fi` - -google/protobuf/protobuf_lazy_descriptor_test-unittest_optimize_for.pb.o: google/protobuf/unittest_optimize_for.pb.cc -@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(protobuf_lazy_descriptor_test_CPPFLAGS) $(CPPFLAGS) $(protobuf_lazy_descriptor_test_CXXFLAGS) $(CXXFLAGS) -MT google/protobuf/protobuf_lazy_descriptor_test-unittest_optimize_for.pb.o -MD -MP -MF google/protobuf/$(DEPDIR)/protobuf_lazy_descriptor_test-unittest_optimize_for.pb.Tpo -c -o google/protobuf/protobuf_lazy_descriptor_test-unittest_optimize_for.pb.o `test -f 'google/protobuf/unittest_optimize_for.pb.cc' || echo '$(srcdir)/'`google/protobuf/unittest_optimize_for.pb.cc -@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) google/protobuf/$(DEPDIR)/protobuf_lazy_descriptor_test-unittest_optimize_for.pb.Tpo google/protobuf/$(DEPDIR)/protobuf_lazy_descriptor_test-unittest_optimize_for.pb.Po -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='google/protobuf/unittest_optimize_for.pb.cc' object='google/protobuf/protobuf_lazy_descriptor_test-unittest_optimize_for.pb.o' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(protobuf_lazy_descriptor_test_CPPFLAGS) $(CPPFLAGS) $(protobuf_lazy_descriptor_test_CXXFLAGS) $(CXXFLAGS) -c -o google/protobuf/protobuf_lazy_descriptor_test-unittest_optimize_for.pb.o `test -f 'google/protobuf/unittest_optimize_for.pb.cc' || echo '$(srcdir)/'`google/protobuf/unittest_optimize_for.pb.cc - -google/protobuf/protobuf_lazy_descriptor_test-unittest_optimize_for.pb.obj: google/protobuf/unittest_optimize_for.pb.cc -@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(protobuf_lazy_descriptor_test_CPPFLAGS) $(CPPFLAGS) $(protobuf_lazy_descriptor_test_CXXFLAGS) $(CXXFLAGS) -MT google/protobuf/protobuf_lazy_descriptor_test-unittest_optimize_for.pb.obj -MD -MP -MF google/protobuf/$(DEPDIR)/protobuf_lazy_descriptor_test-unittest_optimize_for.pb.Tpo -c -o google/protobuf/protobuf_lazy_descriptor_test-unittest_optimize_for.pb.obj `if test -f 'google/protobuf/unittest_optimize_for.pb.cc'; then $(CYGPATH_W) 'google/protobuf/unittest_optimize_for.pb.cc'; else $(CYGPATH_W) '$(srcdir)/google/protobuf/unittest_optimize_for.pb.cc'; fi` -@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) google/protobuf/$(DEPDIR)/protobuf_lazy_descriptor_test-unittest_optimize_for.pb.Tpo google/protobuf/$(DEPDIR)/protobuf_lazy_descriptor_test-unittest_optimize_for.pb.Po -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='google/protobuf/unittest_optimize_for.pb.cc' object='google/protobuf/protobuf_lazy_descriptor_test-unittest_optimize_for.pb.obj' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(protobuf_lazy_descriptor_test_CPPFLAGS) $(CPPFLAGS) $(protobuf_lazy_descriptor_test_CXXFLAGS) $(CXXFLAGS) -c -o google/protobuf/protobuf_lazy_descriptor_test-unittest_optimize_for.pb.obj `if test -f 'google/protobuf/unittest_optimize_for.pb.cc'; then $(CYGPATH_W) 'google/protobuf/unittest_optimize_for.pb.cc'; else $(CYGPATH_W) '$(srcdir)/google/protobuf/unittest_optimize_for.pb.cc'; fi` - -google/protobuf/protobuf_lazy_descriptor_test-unittest_preserve_unknown_enum.pb.o: google/protobuf/unittest_preserve_unknown_enum.pb.cc -@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(protobuf_lazy_descriptor_test_CPPFLAGS) $(CPPFLAGS) $(protobuf_lazy_descriptor_test_CXXFLAGS) $(CXXFLAGS) -MT google/protobuf/protobuf_lazy_descriptor_test-unittest_preserve_unknown_enum.pb.o -MD -MP -MF google/protobuf/$(DEPDIR)/protobuf_lazy_descriptor_test-unittest_preserve_unknown_enum.pb.Tpo -c -o google/protobuf/protobuf_lazy_descriptor_test-unittest_preserve_unknown_enum.pb.o `test -f 'google/protobuf/unittest_preserve_unknown_enum.pb.cc' || echo '$(srcdir)/'`google/protobuf/unittest_preserve_unknown_enum.pb.cc -@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) google/protobuf/$(DEPDIR)/protobuf_lazy_descriptor_test-unittest_preserve_unknown_enum.pb.Tpo google/protobuf/$(DEPDIR)/protobuf_lazy_descriptor_test-unittest_preserve_unknown_enum.pb.Po -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='google/protobuf/unittest_preserve_unknown_enum.pb.cc' object='google/protobuf/protobuf_lazy_descriptor_test-unittest_preserve_unknown_enum.pb.o' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(protobuf_lazy_descriptor_test_CPPFLAGS) $(CPPFLAGS) $(protobuf_lazy_descriptor_test_CXXFLAGS) $(CXXFLAGS) -c -o google/protobuf/protobuf_lazy_descriptor_test-unittest_preserve_unknown_enum.pb.o `test -f 'google/protobuf/unittest_preserve_unknown_enum.pb.cc' || echo '$(srcdir)/'`google/protobuf/unittest_preserve_unknown_enum.pb.cc - -google/protobuf/protobuf_lazy_descriptor_test-unittest_preserve_unknown_enum.pb.obj: google/protobuf/unittest_preserve_unknown_enum.pb.cc -@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(protobuf_lazy_descriptor_test_CPPFLAGS) $(CPPFLAGS) $(protobuf_lazy_descriptor_test_CXXFLAGS) $(CXXFLAGS) -MT google/protobuf/protobuf_lazy_descriptor_test-unittest_preserve_unknown_enum.pb.obj -MD -MP -MF google/protobuf/$(DEPDIR)/protobuf_lazy_descriptor_test-unittest_preserve_unknown_enum.pb.Tpo -c -o google/protobuf/protobuf_lazy_descriptor_test-unittest_preserve_unknown_enum.pb.obj `if test -f 'google/protobuf/unittest_preserve_unknown_enum.pb.cc'; then $(CYGPATH_W) 'google/protobuf/unittest_preserve_unknown_enum.pb.cc'; else $(CYGPATH_W) '$(srcdir)/google/protobuf/unittest_preserve_unknown_enum.pb.cc'; fi` -@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) google/protobuf/$(DEPDIR)/protobuf_lazy_descriptor_test-unittest_preserve_unknown_enum.pb.Tpo google/protobuf/$(DEPDIR)/protobuf_lazy_descriptor_test-unittest_preserve_unknown_enum.pb.Po -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='google/protobuf/unittest_preserve_unknown_enum.pb.cc' object='google/protobuf/protobuf_lazy_descriptor_test-unittest_preserve_unknown_enum.pb.obj' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(protobuf_lazy_descriptor_test_CPPFLAGS) $(CPPFLAGS) $(protobuf_lazy_descriptor_test_CXXFLAGS) $(CXXFLAGS) -c -o google/protobuf/protobuf_lazy_descriptor_test-unittest_preserve_unknown_enum.pb.obj `if test -f 'google/protobuf/unittest_preserve_unknown_enum.pb.cc'; then $(CYGPATH_W) 'google/protobuf/unittest_preserve_unknown_enum.pb.cc'; else $(CYGPATH_W) '$(srcdir)/google/protobuf/unittest_preserve_unknown_enum.pb.cc'; fi` - -google/protobuf/protobuf_lazy_descriptor_test-unittest_preserve_unknown_enum2.pb.o: google/protobuf/unittest_preserve_unknown_enum2.pb.cc -@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(protobuf_lazy_descriptor_test_CPPFLAGS) $(CPPFLAGS) $(protobuf_lazy_descriptor_test_CXXFLAGS) $(CXXFLAGS) -MT google/protobuf/protobuf_lazy_descriptor_test-unittest_preserve_unknown_enum2.pb.o -MD -MP -MF google/protobuf/$(DEPDIR)/protobuf_lazy_descriptor_test-unittest_preserve_unknown_enum2.pb.Tpo -c -o google/protobuf/protobuf_lazy_descriptor_test-unittest_preserve_unknown_enum2.pb.o `test -f 'google/protobuf/unittest_preserve_unknown_enum2.pb.cc' || echo '$(srcdir)/'`google/protobuf/unittest_preserve_unknown_enum2.pb.cc -@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) google/protobuf/$(DEPDIR)/protobuf_lazy_descriptor_test-unittest_preserve_unknown_enum2.pb.Tpo google/protobuf/$(DEPDIR)/protobuf_lazy_descriptor_test-unittest_preserve_unknown_enum2.pb.Po -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='google/protobuf/unittest_preserve_unknown_enum2.pb.cc' object='google/protobuf/protobuf_lazy_descriptor_test-unittest_preserve_unknown_enum2.pb.o' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(protobuf_lazy_descriptor_test_CPPFLAGS) $(CPPFLAGS) $(protobuf_lazy_descriptor_test_CXXFLAGS) $(CXXFLAGS) -c -o google/protobuf/protobuf_lazy_descriptor_test-unittest_preserve_unknown_enum2.pb.o `test -f 'google/protobuf/unittest_preserve_unknown_enum2.pb.cc' || echo '$(srcdir)/'`google/protobuf/unittest_preserve_unknown_enum2.pb.cc - -google/protobuf/protobuf_lazy_descriptor_test-unittest_preserve_unknown_enum2.pb.obj: google/protobuf/unittest_preserve_unknown_enum2.pb.cc -@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(protobuf_lazy_descriptor_test_CPPFLAGS) $(CPPFLAGS) $(protobuf_lazy_descriptor_test_CXXFLAGS) $(CXXFLAGS) -MT google/protobuf/protobuf_lazy_descriptor_test-unittest_preserve_unknown_enum2.pb.obj -MD -MP -MF google/protobuf/$(DEPDIR)/protobuf_lazy_descriptor_test-unittest_preserve_unknown_enum2.pb.Tpo -c -o google/protobuf/protobuf_lazy_descriptor_test-unittest_preserve_unknown_enum2.pb.obj `if test -f 'google/protobuf/unittest_preserve_unknown_enum2.pb.cc'; then $(CYGPATH_W) 'google/protobuf/unittest_preserve_unknown_enum2.pb.cc'; else $(CYGPATH_W) '$(srcdir)/google/protobuf/unittest_preserve_unknown_enum2.pb.cc'; fi` -@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) google/protobuf/$(DEPDIR)/protobuf_lazy_descriptor_test-unittest_preserve_unknown_enum2.pb.Tpo google/protobuf/$(DEPDIR)/protobuf_lazy_descriptor_test-unittest_preserve_unknown_enum2.pb.Po -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='google/protobuf/unittest_preserve_unknown_enum2.pb.cc' object='google/protobuf/protobuf_lazy_descriptor_test-unittest_preserve_unknown_enum2.pb.obj' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(protobuf_lazy_descriptor_test_CPPFLAGS) $(CPPFLAGS) $(protobuf_lazy_descriptor_test_CXXFLAGS) $(CXXFLAGS) -c -o google/protobuf/protobuf_lazy_descriptor_test-unittest_preserve_unknown_enum2.pb.obj `if test -f 'google/protobuf/unittest_preserve_unknown_enum2.pb.cc'; then $(CYGPATH_W) 'google/protobuf/unittest_preserve_unknown_enum2.pb.cc'; else $(CYGPATH_W) '$(srcdir)/google/protobuf/unittest_preserve_unknown_enum2.pb.cc'; fi` - -google/protobuf/protobuf_lazy_descriptor_test-unittest_proto3.pb.o: google/protobuf/unittest_proto3.pb.cc -@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(protobuf_lazy_descriptor_test_CPPFLAGS) $(CPPFLAGS) $(protobuf_lazy_descriptor_test_CXXFLAGS) $(CXXFLAGS) -MT google/protobuf/protobuf_lazy_descriptor_test-unittest_proto3.pb.o -MD -MP -MF google/protobuf/$(DEPDIR)/protobuf_lazy_descriptor_test-unittest_proto3.pb.Tpo -c -o google/protobuf/protobuf_lazy_descriptor_test-unittest_proto3.pb.o `test -f 'google/protobuf/unittest_proto3.pb.cc' || echo '$(srcdir)/'`google/protobuf/unittest_proto3.pb.cc -@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) google/protobuf/$(DEPDIR)/protobuf_lazy_descriptor_test-unittest_proto3.pb.Tpo google/protobuf/$(DEPDIR)/protobuf_lazy_descriptor_test-unittest_proto3.pb.Po -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='google/protobuf/unittest_proto3.pb.cc' object='google/protobuf/protobuf_lazy_descriptor_test-unittest_proto3.pb.o' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(protobuf_lazy_descriptor_test_CPPFLAGS) $(CPPFLAGS) $(protobuf_lazy_descriptor_test_CXXFLAGS) $(CXXFLAGS) -c -o google/protobuf/protobuf_lazy_descriptor_test-unittest_proto3.pb.o `test -f 'google/protobuf/unittest_proto3.pb.cc' || echo '$(srcdir)/'`google/protobuf/unittest_proto3.pb.cc - -google/protobuf/protobuf_lazy_descriptor_test-unittest_proto3.pb.obj: google/protobuf/unittest_proto3.pb.cc -@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(protobuf_lazy_descriptor_test_CPPFLAGS) $(CPPFLAGS) $(protobuf_lazy_descriptor_test_CXXFLAGS) $(CXXFLAGS) -MT google/protobuf/protobuf_lazy_descriptor_test-unittest_proto3.pb.obj -MD -MP -MF google/protobuf/$(DEPDIR)/protobuf_lazy_descriptor_test-unittest_proto3.pb.Tpo -c -o google/protobuf/protobuf_lazy_descriptor_test-unittest_proto3.pb.obj `if test -f 'google/protobuf/unittest_proto3.pb.cc'; then $(CYGPATH_W) 'google/protobuf/unittest_proto3.pb.cc'; else $(CYGPATH_W) '$(srcdir)/google/protobuf/unittest_proto3.pb.cc'; fi` -@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) google/protobuf/$(DEPDIR)/protobuf_lazy_descriptor_test-unittest_proto3.pb.Tpo google/protobuf/$(DEPDIR)/protobuf_lazy_descriptor_test-unittest_proto3.pb.Po -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='google/protobuf/unittest_proto3.pb.cc' object='google/protobuf/protobuf_lazy_descriptor_test-unittest_proto3.pb.obj' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(protobuf_lazy_descriptor_test_CPPFLAGS) $(CPPFLAGS) $(protobuf_lazy_descriptor_test_CXXFLAGS) $(CXXFLAGS) -c -o google/protobuf/protobuf_lazy_descriptor_test-unittest_proto3.pb.obj `if test -f 'google/protobuf/unittest_proto3.pb.cc'; then $(CYGPATH_W) 'google/protobuf/unittest_proto3.pb.cc'; else $(CYGPATH_W) '$(srcdir)/google/protobuf/unittest_proto3.pb.cc'; fi` - -google/protobuf/protobuf_lazy_descriptor_test-unittest_proto3_arena.pb.o: google/protobuf/unittest_proto3_arena.pb.cc -@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(protobuf_lazy_descriptor_test_CPPFLAGS) $(CPPFLAGS) $(protobuf_lazy_descriptor_test_CXXFLAGS) $(CXXFLAGS) -MT google/protobuf/protobuf_lazy_descriptor_test-unittest_proto3_arena.pb.o -MD -MP -MF google/protobuf/$(DEPDIR)/protobuf_lazy_descriptor_test-unittest_proto3_arena.pb.Tpo -c -o google/protobuf/protobuf_lazy_descriptor_test-unittest_proto3_arena.pb.o `test -f 'google/protobuf/unittest_proto3_arena.pb.cc' || echo '$(srcdir)/'`google/protobuf/unittest_proto3_arena.pb.cc -@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) google/protobuf/$(DEPDIR)/protobuf_lazy_descriptor_test-unittest_proto3_arena.pb.Tpo google/protobuf/$(DEPDIR)/protobuf_lazy_descriptor_test-unittest_proto3_arena.pb.Po -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='google/protobuf/unittest_proto3_arena.pb.cc' object='google/protobuf/protobuf_lazy_descriptor_test-unittest_proto3_arena.pb.o' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(protobuf_lazy_descriptor_test_CPPFLAGS) $(CPPFLAGS) $(protobuf_lazy_descriptor_test_CXXFLAGS) $(CXXFLAGS) -c -o google/protobuf/protobuf_lazy_descriptor_test-unittest_proto3_arena.pb.o `test -f 'google/protobuf/unittest_proto3_arena.pb.cc' || echo '$(srcdir)/'`google/protobuf/unittest_proto3_arena.pb.cc - -google/protobuf/protobuf_lazy_descriptor_test-unittest_proto3_arena.pb.obj: google/protobuf/unittest_proto3_arena.pb.cc -@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(protobuf_lazy_descriptor_test_CPPFLAGS) $(CPPFLAGS) $(protobuf_lazy_descriptor_test_CXXFLAGS) $(CXXFLAGS) -MT google/protobuf/protobuf_lazy_descriptor_test-unittest_proto3_arena.pb.obj -MD -MP -MF google/protobuf/$(DEPDIR)/protobuf_lazy_descriptor_test-unittest_proto3_arena.pb.Tpo -c -o google/protobuf/protobuf_lazy_descriptor_test-unittest_proto3_arena.pb.obj `if test -f 'google/protobuf/unittest_proto3_arena.pb.cc'; then $(CYGPATH_W) 'google/protobuf/unittest_proto3_arena.pb.cc'; else $(CYGPATH_W) '$(srcdir)/google/protobuf/unittest_proto3_arena.pb.cc'; fi` -@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) google/protobuf/$(DEPDIR)/protobuf_lazy_descriptor_test-unittest_proto3_arena.pb.Tpo google/protobuf/$(DEPDIR)/protobuf_lazy_descriptor_test-unittest_proto3_arena.pb.Po -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='google/protobuf/unittest_proto3_arena.pb.cc' object='google/protobuf/protobuf_lazy_descriptor_test-unittest_proto3_arena.pb.obj' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(protobuf_lazy_descriptor_test_CPPFLAGS) $(CPPFLAGS) $(protobuf_lazy_descriptor_test_CXXFLAGS) $(CXXFLAGS) -c -o google/protobuf/protobuf_lazy_descriptor_test-unittest_proto3_arena.pb.obj `if test -f 'google/protobuf/unittest_proto3_arena.pb.cc'; then $(CYGPATH_W) 'google/protobuf/unittest_proto3_arena.pb.cc'; else $(CYGPATH_W) '$(srcdir)/google/protobuf/unittest_proto3_arena.pb.cc'; fi` - -google/protobuf/protobuf_lazy_descriptor_test-unittest_proto3_arena_lite.pb.o: google/protobuf/unittest_proto3_arena_lite.pb.cc -@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(protobuf_lazy_descriptor_test_CPPFLAGS) $(CPPFLAGS) $(protobuf_lazy_descriptor_test_CXXFLAGS) $(CXXFLAGS) -MT google/protobuf/protobuf_lazy_descriptor_test-unittest_proto3_arena_lite.pb.o -MD -MP -MF google/protobuf/$(DEPDIR)/protobuf_lazy_descriptor_test-unittest_proto3_arena_lite.pb.Tpo -c -o google/protobuf/protobuf_lazy_descriptor_test-unittest_proto3_arena_lite.pb.o `test -f 'google/protobuf/unittest_proto3_arena_lite.pb.cc' || echo '$(srcdir)/'`google/protobuf/unittest_proto3_arena_lite.pb.cc -@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) google/protobuf/$(DEPDIR)/protobuf_lazy_descriptor_test-unittest_proto3_arena_lite.pb.Tpo google/protobuf/$(DEPDIR)/protobuf_lazy_descriptor_test-unittest_proto3_arena_lite.pb.Po -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='google/protobuf/unittest_proto3_arena_lite.pb.cc' object='google/protobuf/protobuf_lazy_descriptor_test-unittest_proto3_arena_lite.pb.o' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(protobuf_lazy_descriptor_test_CPPFLAGS) $(CPPFLAGS) $(protobuf_lazy_descriptor_test_CXXFLAGS) $(CXXFLAGS) -c -o google/protobuf/protobuf_lazy_descriptor_test-unittest_proto3_arena_lite.pb.o `test -f 'google/protobuf/unittest_proto3_arena_lite.pb.cc' || echo '$(srcdir)/'`google/protobuf/unittest_proto3_arena_lite.pb.cc - -google/protobuf/protobuf_lazy_descriptor_test-unittest_proto3_arena_lite.pb.obj: google/protobuf/unittest_proto3_arena_lite.pb.cc -@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(protobuf_lazy_descriptor_test_CPPFLAGS) $(CPPFLAGS) $(protobuf_lazy_descriptor_test_CXXFLAGS) $(CXXFLAGS) -MT google/protobuf/protobuf_lazy_descriptor_test-unittest_proto3_arena_lite.pb.obj -MD -MP -MF google/protobuf/$(DEPDIR)/protobuf_lazy_descriptor_test-unittest_proto3_arena_lite.pb.Tpo -c -o google/protobuf/protobuf_lazy_descriptor_test-unittest_proto3_arena_lite.pb.obj `if test -f 'google/protobuf/unittest_proto3_arena_lite.pb.cc'; then $(CYGPATH_W) 'google/protobuf/unittest_proto3_arena_lite.pb.cc'; else $(CYGPATH_W) '$(srcdir)/google/protobuf/unittest_proto3_arena_lite.pb.cc'; fi` -@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) google/protobuf/$(DEPDIR)/protobuf_lazy_descriptor_test-unittest_proto3_arena_lite.pb.Tpo google/protobuf/$(DEPDIR)/protobuf_lazy_descriptor_test-unittest_proto3_arena_lite.pb.Po -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='google/protobuf/unittest_proto3_arena_lite.pb.cc' object='google/protobuf/protobuf_lazy_descriptor_test-unittest_proto3_arena_lite.pb.obj' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(protobuf_lazy_descriptor_test_CPPFLAGS) $(CPPFLAGS) $(protobuf_lazy_descriptor_test_CXXFLAGS) $(CXXFLAGS) -c -o google/protobuf/protobuf_lazy_descriptor_test-unittest_proto3_arena_lite.pb.obj `if test -f 'google/protobuf/unittest_proto3_arena_lite.pb.cc'; then $(CYGPATH_W) 'google/protobuf/unittest_proto3_arena_lite.pb.cc'; else $(CYGPATH_W) '$(srcdir)/google/protobuf/unittest_proto3_arena_lite.pb.cc'; fi` - -google/protobuf/protobuf_lazy_descriptor_test-unittest_proto3_lite.pb.o: google/protobuf/unittest_proto3_lite.pb.cc -@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(protobuf_lazy_descriptor_test_CPPFLAGS) $(CPPFLAGS) $(protobuf_lazy_descriptor_test_CXXFLAGS) $(CXXFLAGS) -MT google/protobuf/protobuf_lazy_descriptor_test-unittest_proto3_lite.pb.o -MD -MP -MF google/protobuf/$(DEPDIR)/protobuf_lazy_descriptor_test-unittest_proto3_lite.pb.Tpo -c -o google/protobuf/protobuf_lazy_descriptor_test-unittest_proto3_lite.pb.o `test -f 'google/protobuf/unittest_proto3_lite.pb.cc' || echo '$(srcdir)/'`google/protobuf/unittest_proto3_lite.pb.cc -@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) google/protobuf/$(DEPDIR)/protobuf_lazy_descriptor_test-unittest_proto3_lite.pb.Tpo google/protobuf/$(DEPDIR)/protobuf_lazy_descriptor_test-unittest_proto3_lite.pb.Po -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='google/protobuf/unittest_proto3_lite.pb.cc' object='google/protobuf/protobuf_lazy_descriptor_test-unittest_proto3_lite.pb.o' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(protobuf_lazy_descriptor_test_CPPFLAGS) $(CPPFLAGS) $(protobuf_lazy_descriptor_test_CXXFLAGS) $(CXXFLAGS) -c -o google/protobuf/protobuf_lazy_descriptor_test-unittest_proto3_lite.pb.o `test -f 'google/protobuf/unittest_proto3_lite.pb.cc' || echo '$(srcdir)/'`google/protobuf/unittest_proto3_lite.pb.cc - -google/protobuf/protobuf_lazy_descriptor_test-unittest_proto3_lite.pb.obj: google/protobuf/unittest_proto3_lite.pb.cc -@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(protobuf_lazy_descriptor_test_CPPFLAGS) $(CPPFLAGS) $(protobuf_lazy_descriptor_test_CXXFLAGS) $(CXXFLAGS) -MT google/protobuf/protobuf_lazy_descriptor_test-unittest_proto3_lite.pb.obj -MD -MP -MF google/protobuf/$(DEPDIR)/protobuf_lazy_descriptor_test-unittest_proto3_lite.pb.Tpo -c -o google/protobuf/protobuf_lazy_descriptor_test-unittest_proto3_lite.pb.obj `if test -f 'google/protobuf/unittest_proto3_lite.pb.cc'; then $(CYGPATH_W) 'google/protobuf/unittest_proto3_lite.pb.cc'; else $(CYGPATH_W) '$(srcdir)/google/protobuf/unittest_proto3_lite.pb.cc'; fi` -@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) google/protobuf/$(DEPDIR)/protobuf_lazy_descriptor_test-unittest_proto3_lite.pb.Tpo google/protobuf/$(DEPDIR)/protobuf_lazy_descriptor_test-unittest_proto3_lite.pb.Po -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='google/protobuf/unittest_proto3_lite.pb.cc' object='google/protobuf/protobuf_lazy_descriptor_test-unittest_proto3_lite.pb.obj' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(protobuf_lazy_descriptor_test_CPPFLAGS) $(CPPFLAGS) $(protobuf_lazy_descriptor_test_CXXFLAGS) $(CXXFLAGS) -c -o google/protobuf/protobuf_lazy_descriptor_test-unittest_proto3_lite.pb.obj `if test -f 'google/protobuf/unittest_proto3_lite.pb.cc'; then $(CYGPATH_W) 'google/protobuf/unittest_proto3_lite.pb.cc'; else $(CYGPATH_W) '$(srcdir)/google/protobuf/unittest_proto3_lite.pb.cc'; fi` - -google/protobuf/protobuf_lazy_descriptor_test-unittest_proto3_optional.pb.o: google/protobuf/unittest_proto3_optional.pb.cc -@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(protobuf_lazy_descriptor_test_CPPFLAGS) $(CPPFLAGS) $(protobuf_lazy_descriptor_test_CXXFLAGS) $(CXXFLAGS) -MT google/protobuf/protobuf_lazy_descriptor_test-unittest_proto3_optional.pb.o -MD -MP -MF google/protobuf/$(DEPDIR)/protobuf_lazy_descriptor_test-unittest_proto3_optional.pb.Tpo -c -o google/protobuf/protobuf_lazy_descriptor_test-unittest_proto3_optional.pb.o `test -f 'google/protobuf/unittest_proto3_optional.pb.cc' || echo '$(srcdir)/'`google/protobuf/unittest_proto3_optional.pb.cc -@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) google/protobuf/$(DEPDIR)/protobuf_lazy_descriptor_test-unittest_proto3_optional.pb.Tpo google/protobuf/$(DEPDIR)/protobuf_lazy_descriptor_test-unittest_proto3_optional.pb.Po -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='google/protobuf/unittest_proto3_optional.pb.cc' object='google/protobuf/protobuf_lazy_descriptor_test-unittest_proto3_optional.pb.o' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(protobuf_lazy_descriptor_test_CPPFLAGS) $(CPPFLAGS) $(protobuf_lazy_descriptor_test_CXXFLAGS) $(CXXFLAGS) -c -o google/protobuf/protobuf_lazy_descriptor_test-unittest_proto3_optional.pb.o `test -f 'google/protobuf/unittest_proto3_optional.pb.cc' || echo '$(srcdir)/'`google/protobuf/unittest_proto3_optional.pb.cc - -google/protobuf/protobuf_lazy_descriptor_test-unittest_proto3_optional.pb.obj: google/protobuf/unittest_proto3_optional.pb.cc -@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(protobuf_lazy_descriptor_test_CPPFLAGS) $(CPPFLAGS) $(protobuf_lazy_descriptor_test_CXXFLAGS) $(CXXFLAGS) -MT google/protobuf/protobuf_lazy_descriptor_test-unittest_proto3_optional.pb.obj -MD -MP -MF google/protobuf/$(DEPDIR)/protobuf_lazy_descriptor_test-unittest_proto3_optional.pb.Tpo -c -o google/protobuf/protobuf_lazy_descriptor_test-unittest_proto3_optional.pb.obj `if test -f 'google/protobuf/unittest_proto3_optional.pb.cc'; then $(CYGPATH_W) 'google/protobuf/unittest_proto3_optional.pb.cc'; else $(CYGPATH_W) '$(srcdir)/google/protobuf/unittest_proto3_optional.pb.cc'; fi` -@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) google/protobuf/$(DEPDIR)/protobuf_lazy_descriptor_test-unittest_proto3_optional.pb.Tpo google/protobuf/$(DEPDIR)/protobuf_lazy_descriptor_test-unittest_proto3_optional.pb.Po -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='google/protobuf/unittest_proto3_optional.pb.cc' object='google/protobuf/protobuf_lazy_descriptor_test-unittest_proto3_optional.pb.obj' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(protobuf_lazy_descriptor_test_CPPFLAGS) $(CPPFLAGS) $(protobuf_lazy_descriptor_test_CXXFLAGS) $(CXXFLAGS) -c -o google/protobuf/protobuf_lazy_descriptor_test-unittest_proto3_optional.pb.obj `if test -f 'google/protobuf/unittest_proto3_optional.pb.cc'; then $(CYGPATH_W) 'google/protobuf/unittest_proto3_optional.pb.cc'; else $(CYGPATH_W) '$(srcdir)/google/protobuf/unittest_proto3_optional.pb.cc'; fi` - -google/protobuf/protobuf_lazy_descriptor_test-unittest_well_known_types.pb.o: google/protobuf/unittest_well_known_types.pb.cc -@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(protobuf_lazy_descriptor_test_CPPFLAGS) $(CPPFLAGS) $(protobuf_lazy_descriptor_test_CXXFLAGS) $(CXXFLAGS) -MT google/protobuf/protobuf_lazy_descriptor_test-unittest_well_known_types.pb.o -MD -MP -MF google/protobuf/$(DEPDIR)/protobuf_lazy_descriptor_test-unittest_well_known_types.pb.Tpo -c -o google/protobuf/protobuf_lazy_descriptor_test-unittest_well_known_types.pb.o `test -f 'google/protobuf/unittest_well_known_types.pb.cc' || echo '$(srcdir)/'`google/protobuf/unittest_well_known_types.pb.cc -@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) google/protobuf/$(DEPDIR)/protobuf_lazy_descriptor_test-unittest_well_known_types.pb.Tpo google/protobuf/$(DEPDIR)/protobuf_lazy_descriptor_test-unittest_well_known_types.pb.Po -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='google/protobuf/unittest_well_known_types.pb.cc' object='google/protobuf/protobuf_lazy_descriptor_test-unittest_well_known_types.pb.o' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(protobuf_lazy_descriptor_test_CPPFLAGS) $(CPPFLAGS) $(protobuf_lazy_descriptor_test_CXXFLAGS) $(CXXFLAGS) -c -o google/protobuf/protobuf_lazy_descriptor_test-unittest_well_known_types.pb.o `test -f 'google/protobuf/unittest_well_known_types.pb.cc' || echo '$(srcdir)/'`google/protobuf/unittest_well_known_types.pb.cc - -google/protobuf/protobuf_lazy_descriptor_test-unittest_well_known_types.pb.obj: google/protobuf/unittest_well_known_types.pb.cc -@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(protobuf_lazy_descriptor_test_CPPFLAGS) $(CPPFLAGS) $(protobuf_lazy_descriptor_test_CXXFLAGS) $(CXXFLAGS) -MT google/protobuf/protobuf_lazy_descriptor_test-unittest_well_known_types.pb.obj -MD -MP -MF google/protobuf/$(DEPDIR)/protobuf_lazy_descriptor_test-unittest_well_known_types.pb.Tpo -c -o google/protobuf/protobuf_lazy_descriptor_test-unittest_well_known_types.pb.obj `if test -f 'google/protobuf/unittest_well_known_types.pb.cc'; then $(CYGPATH_W) 'google/protobuf/unittest_well_known_types.pb.cc'; else $(CYGPATH_W) '$(srcdir)/google/protobuf/unittest_well_known_types.pb.cc'; fi` -@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) google/protobuf/$(DEPDIR)/protobuf_lazy_descriptor_test-unittest_well_known_types.pb.Tpo google/protobuf/$(DEPDIR)/protobuf_lazy_descriptor_test-unittest_well_known_types.pb.Po -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='google/protobuf/unittest_well_known_types.pb.cc' object='google/protobuf/protobuf_lazy_descriptor_test-unittest_well_known_types.pb.obj' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(protobuf_lazy_descriptor_test_CPPFLAGS) $(CPPFLAGS) $(protobuf_lazy_descriptor_test_CXXFLAGS) $(CXXFLAGS) -c -o google/protobuf/protobuf_lazy_descriptor_test-unittest_well_known_types.pb.obj `if test -f 'google/protobuf/unittest_well_known_types.pb.cc'; then $(CYGPATH_W) 'google/protobuf/unittest_well_known_types.pb.cc'; else $(CYGPATH_W) '$(srcdir)/google/protobuf/unittest_well_known_types.pb.cc'; fi` - -google/protobuf/util/internal/testdata/protobuf_lazy_descriptor_test-anys.pb.o: google/protobuf/util/internal/testdata/anys.pb.cc -@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(protobuf_lazy_descriptor_test_CPPFLAGS) $(CPPFLAGS) $(protobuf_lazy_descriptor_test_CXXFLAGS) $(CXXFLAGS) -MT google/protobuf/util/internal/testdata/protobuf_lazy_descriptor_test-anys.pb.o -MD -MP -MF google/protobuf/util/internal/testdata/$(DEPDIR)/protobuf_lazy_descriptor_test-anys.pb.Tpo -c -o google/protobuf/util/internal/testdata/protobuf_lazy_descriptor_test-anys.pb.o `test -f 'google/protobuf/util/internal/testdata/anys.pb.cc' || echo '$(srcdir)/'`google/protobuf/util/internal/testdata/anys.pb.cc -@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) google/protobuf/util/internal/testdata/$(DEPDIR)/protobuf_lazy_descriptor_test-anys.pb.Tpo google/protobuf/util/internal/testdata/$(DEPDIR)/protobuf_lazy_descriptor_test-anys.pb.Po -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='google/protobuf/util/internal/testdata/anys.pb.cc' object='google/protobuf/util/internal/testdata/protobuf_lazy_descriptor_test-anys.pb.o' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(protobuf_lazy_descriptor_test_CPPFLAGS) $(CPPFLAGS) $(protobuf_lazy_descriptor_test_CXXFLAGS) $(CXXFLAGS) -c -o google/protobuf/util/internal/testdata/protobuf_lazy_descriptor_test-anys.pb.o `test -f 'google/protobuf/util/internal/testdata/anys.pb.cc' || echo '$(srcdir)/'`google/protobuf/util/internal/testdata/anys.pb.cc - -google/protobuf/util/internal/testdata/protobuf_lazy_descriptor_test-anys.pb.obj: google/protobuf/util/internal/testdata/anys.pb.cc -@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(protobuf_lazy_descriptor_test_CPPFLAGS) $(CPPFLAGS) $(protobuf_lazy_descriptor_test_CXXFLAGS) $(CXXFLAGS) -MT google/protobuf/util/internal/testdata/protobuf_lazy_descriptor_test-anys.pb.obj -MD -MP -MF google/protobuf/util/internal/testdata/$(DEPDIR)/protobuf_lazy_descriptor_test-anys.pb.Tpo -c -o google/protobuf/util/internal/testdata/protobuf_lazy_descriptor_test-anys.pb.obj `if test -f 'google/protobuf/util/internal/testdata/anys.pb.cc'; then $(CYGPATH_W) 'google/protobuf/util/internal/testdata/anys.pb.cc'; else $(CYGPATH_W) '$(srcdir)/google/protobuf/util/internal/testdata/anys.pb.cc'; fi` -@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) google/protobuf/util/internal/testdata/$(DEPDIR)/protobuf_lazy_descriptor_test-anys.pb.Tpo google/protobuf/util/internal/testdata/$(DEPDIR)/protobuf_lazy_descriptor_test-anys.pb.Po -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='google/protobuf/util/internal/testdata/anys.pb.cc' object='google/protobuf/util/internal/testdata/protobuf_lazy_descriptor_test-anys.pb.obj' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(protobuf_lazy_descriptor_test_CPPFLAGS) $(CPPFLAGS) $(protobuf_lazy_descriptor_test_CXXFLAGS) $(CXXFLAGS) -c -o google/protobuf/util/internal/testdata/protobuf_lazy_descriptor_test-anys.pb.obj `if test -f 'google/protobuf/util/internal/testdata/anys.pb.cc'; then $(CYGPATH_W) 'google/protobuf/util/internal/testdata/anys.pb.cc'; else $(CYGPATH_W) '$(srcdir)/google/protobuf/util/internal/testdata/anys.pb.cc'; fi` - -google/protobuf/util/internal/testdata/protobuf_lazy_descriptor_test-books.pb.o: google/protobuf/util/internal/testdata/books.pb.cc -@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(protobuf_lazy_descriptor_test_CPPFLAGS) $(CPPFLAGS) $(protobuf_lazy_descriptor_test_CXXFLAGS) $(CXXFLAGS) -MT google/protobuf/util/internal/testdata/protobuf_lazy_descriptor_test-books.pb.o -MD -MP -MF google/protobuf/util/internal/testdata/$(DEPDIR)/protobuf_lazy_descriptor_test-books.pb.Tpo -c -o google/protobuf/util/internal/testdata/protobuf_lazy_descriptor_test-books.pb.o `test -f 'google/protobuf/util/internal/testdata/books.pb.cc' || echo '$(srcdir)/'`google/protobuf/util/internal/testdata/books.pb.cc -@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) google/protobuf/util/internal/testdata/$(DEPDIR)/protobuf_lazy_descriptor_test-books.pb.Tpo google/protobuf/util/internal/testdata/$(DEPDIR)/protobuf_lazy_descriptor_test-books.pb.Po -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='google/protobuf/util/internal/testdata/books.pb.cc' object='google/protobuf/util/internal/testdata/protobuf_lazy_descriptor_test-books.pb.o' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(protobuf_lazy_descriptor_test_CPPFLAGS) $(CPPFLAGS) $(protobuf_lazy_descriptor_test_CXXFLAGS) $(CXXFLAGS) -c -o google/protobuf/util/internal/testdata/protobuf_lazy_descriptor_test-books.pb.o `test -f 'google/protobuf/util/internal/testdata/books.pb.cc' || echo '$(srcdir)/'`google/protobuf/util/internal/testdata/books.pb.cc - -google/protobuf/util/internal/testdata/protobuf_lazy_descriptor_test-books.pb.obj: google/protobuf/util/internal/testdata/books.pb.cc -@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(protobuf_lazy_descriptor_test_CPPFLAGS) $(CPPFLAGS) $(protobuf_lazy_descriptor_test_CXXFLAGS) $(CXXFLAGS) -MT google/protobuf/util/internal/testdata/protobuf_lazy_descriptor_test-books.pb.obj -MD -MP -MF google/protobuf/util/internal/testdata/$(DEPDIR)/protobuf_lazy_descriptor_test-books.pb.Tpo -c -o google/protobuf/util/internal/testdata/protobuf_lazy_descriptor_test-books.pb.obj `if test -f 'google/protobuf/util/internal/testdata/books.pb.cc'; then $(CYGPATH_W) 'google/protobuf/util/internal/testdata/books.pb.cc'; else $(CYGPATH_W) '$(srcdir)/google/protobuf/util/internal/testdata/books.pb.cc'; fi` -@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) google/protobuf/util/internal/testdata/$(DEPDIR)/protobuf_lazy_descriptor_test-books.pb.Tpo google/protobuf/util/internal/testdata/$(DEPDIR)/protobuf_lazy_descriptor_test-books.pb.Po -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='google/protobuf/util/internal/testdata/books.pb.cc' object='google/protobuf/util/internal/testdata/protobuf_lazy_descriptor_test-books.pb.obj' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(protobuf_lazy_descriptor_test_CPPFLAGS) $(CPPFLAGS) $(protobuf_lazy_descriptor_test_CXXFLAGS) $(CXXFLAGS) -c -o google/protobuf/util/internal/testdata/protobuf_lazy_descriptor_test-books.pb.obj `if test -f 'google/protobuf/util/internal/testdata/books.pb.cc'; then $(CYGPATH_W) 'google/protobuf/util/internal/testdata/books.pb.cc'; else $(CYGPATH_W) '$(srcdir)/google/protobuf/util/internal/testdata/books.pb.cc'; fi` - -google/protobuf/util/internal/testdata/protobuf_lazy_descriptor_test-default_value.pb.o: google/protobuf/util/internal/testdata/default_value.pb.cc -@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(protobuf_lazy_descriptor_test_CPPFLAGS) $(CPPFLAGS) $(protobuf_lazy_descriptor_test_CXXFLAGS) $(CXXFLAGS) -MT google/protobuf/util/internal/testdata/protobuf_lazy_descriptor_test-default_value.pb.o -MD -MP -MF google/protobuf/util/internal/testdata/$(DEPDIR)/protobuf_lazy_descriptor_test-default_value.pb.Tpo -c -o google/protobuf/util/internal/testdata/protobuf_lazy_descriptor_test-default_value.pb.o `test -f 'google/protobuf/util/internal/testdata/default_value.pb.cc' || echo '$(srcdir)/'`google/protobuf/util/internal/testdata/default_value.pb.cc -@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) google/protobuf/util/internal/testdata/$(DEPDIR)/protobuf_lazy_descriptor_test-default_value.pb.Tpo google/protobuf/util/internal/testdata/$(DEPDIR)/protobuf_lazy_descriptor_test-default_value.pb.Po -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='google/protobuf/util/internal/testdata/default_value.pb.cc' object='google/protobuf/util/internal/testdata/protobuf_lazy_descriptor_test-default_value.pb.o' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(protobuf_lazy_descriptor_test_CPPFLAGS) $(CPPFLAGS) $(protobuf_lazy_descriptor_test_CXXFLAGS) $(CXXFLAGS) -c -o google/protobuf/util/internal/testdata/protobuf_lazy_descriptor_test-default_value.pb.o `test -f 'google/protobuf/util/internal/testdata/default_value.pb.cc' || echo '$(srcdir)/'`google/protobuf/util/internal/testdata/default_value.pb.cc - -google/protobuf/util/internal/testdata/protobuf_lazy_descriptor_test-default_value.pb.obj: google/protobuf/util/internal/testdata/default_value.pb.cc -@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(protobuf_lazy_descriptor_test_CPPFLAGS) $(CPPFLAGS) $(protobuf_lazy_descriptor_test_CXXFLAGS) $(CXXFLAGS) -MT google/protobuf/util/internal/testdata/protobuf_lazy_descriptor_test-default_value.pb.obj -MD -MP -MF google/protobuf/util/internal/testdata/$(DEPDIR)/protobuf_lazy_descriptor_test-default_value.pb.Tpo -c -o google/protobuf/util/internal/testdata/protobuf_lazy_descriptor_test-default_value.pb.obj `if test -f 'google/protobuf/util/internal/testdata/default_value.pb.cc'; then $(CYGPATH_W) 'google/protobuf/util/internal/testdata/default_value.pb.cc'; else $(CYGPATH_W) '$(srcdir)/google/protobuf/util/internal/testdata/default_value.pb.cc'; fi` -@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) google/protobuf/util/internal/testdata/$(DEPDIR)/protobuf_lazy_descriptor_test-default_value.pb.Tpo google/protobuf/util/internal/testdata/$(DEPDIR)/protobuf_lazy_descriptor_test-default_value.pb.Po -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='google/protobuf/util/internal/testdata/default_value.pb.cc' object='google/protobuf/util/internal/testdata/protobuf_lazy_descriptor_test-default_value.pb.obj' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(protobuf_lazy_descriptor_test_CPPFLAGS) $(CPPFLAGS) $(protobuf_lazy_descriptor_test_CXXFLAGS) $(CXXFLAGS) -c -o google/protobuf/util/internal/testdata/protobuf_lazy_descriptor_test-default_value.pb.obj `if test -f 'google/protobuf/util/internal/testdata/default_value.pb.cc'; then $(CYGPATH_W) 'google/protobuf/util/internal/testdata/default_value.pb.cc'; else $(CYGPATH_W) '$(srcdir)/google/protobuf/util/internal/testdata/default_value.pb.cc'; fi` - -google/protobuf/util/internal/testdata/protobuf_lazy_descriptor_test-default_value_test.pb.o: google/protobuf/util/internal/testdata/default_value_test.pb.cc -@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(protobuf_lazy_descriptor_test_CPPFLAGS) $(CPPFLAGS) $(protobuf_lazy_descriptor_test_CXXFLAGS) $(CXXFLAGS) -MT google/protobuf/util/internal/testdata/protobuf_lazy_descriptor_test-default_value_test.pb.o -MD -MP -MF google/protobuf/util/internal/testdata/$(DEPDIR)/protobuf_lazy_descriptor_test-default_value_test.pb.Tpo -c -o google/protobuf/util/internal/testdata/protobuf_lazy_descriptor_test-default_value_test.pb.o `test -f 'google/protobuf/util/internal/testdata/default_value_test.pb.cc' || echo '$(srcdir)/'`google/protobuf/util/internal/testdata/default_value_test.pb.cc -@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) google/protobuf/util/internal/testdata/$(DEPDIR)/protobuf_lazy_descriptor_test-default_value_test.pb.Tpo google/protobuf/util/internal/testdata/$(DEPDIR)/protobuf_lazy_descriptor_test-default_value_test.pb.Po -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='google/protobuf/util/internal/testdata/default_value_test.pb.cc' object='google/protobuf/util/internal/testdata/protobuf_lazy_descriptor_test-default_value_test.pb.o' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(protobuf_lazy_descriptor_test_CPPFLAGS) $(CPPFLAGS) $(protobuf_lazy_descriptor_test_CXXFLAGS) $(CXXFLAGS) -c -o google/protobuf/util/internal/testdata/protobuf_lazy_descriptor_test-default_value_test.pb.o `test -f 'google/protobuf/util/internal/testdata/default_value_test.pb.cc' || echo '$(srcdir)/'`google/protobuf/util/internal/testdata/default_value_test.pb.cc - -google/protobuf/util/internal/testdata/protobuf_lazy_descriptor_test-default_value_test.pb.obj: google/protobuf/util/internal/testdata/default_value_test.pb.cc -@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(protobuf_lazy_descriptor_test_CPPFLAGS) $(CPPFLAGS) $(protobuf_lazy_descriptor_test_CXXFLAGS) $(CXXFLAGS) -MT google/protobuf/util/internal/testdata/protobuf_lazy_descriptor_test-default_value_test.pb.obj -MD -MP -MF google/protobuf/util/internal/testdata/$(DEPDIR)/protobuf_lazy_descriptor_test-default_value_test.pb.Tpo -c -o google/protobuf/util/internal/testdata/protobuf_lazy_descriptor_test-default_value_test.pb.obj `if test -f 'google/protobuf/util/internal/testdata/default_value_test.pb.cc'; then $(CYGPATH_W) 'google/protobuf/util/internal/testdata/default_value_test.pb.cc'; else $(CYGPATH_W) '$(srcdir)/google/protobuf/util/internal/testdata/default_value_test.pb.cc'; fi` -@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) google/protobuf/util/internal/testdata/$(DEPDIR)/protobuf_lazy_descriptor_test-default_value_test.pb.Tpo google/protobuf/util/internal/testdata/$(DEPDIR)/protobuf_lazy_descriptor_test-default_value_test.pb.Po -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='google/protobuf/util/internal/testdata/default_value_test.pb.cc' object='google/protobuf/util/internal/testdata/protobuf_lazy_descriptor_test-default_value_test.pb.obj' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(protobuf_lazy_descriptor_test_CPPFLAGS) $(CPPFLAGS) $(protobuf_lazy_descriptor_test_CXXFLAGS) $(CXXFLAGS) -c -o google/protobuf/util/internal/testdata/protobuf_lazy_descriptor_test-default_value_test.pb.obj `if test -f 'google/protobuf/util/internal/testdata/default_value_test.pb.cc'; then $(CYGPATH_W) 'google/protobuf/util/internal/testdata/default_value_test.pb.cc'; else $(CYGPATH_W) '$(srcdir)/google/protobuf/util/internal/testdata/default_value_test.pb.cc'; fi` - -google/protobuf/util/internal/testdata/protobuf_lazy_descriptor_test-field_mask.pb.o: google/protobuf/util/internal/testdata/field_mask.pb.cc -@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(protobuf_lazy_descriptor_test_CPPFLAGS) $(CPPFLAGS) $(protobuf_lazy_descriptor_test_CXXFLAGS) $(CXXFLAGS) -MT google/protobuf/util/internal/testdata/protobuf_lazy_descriptor_test-field_mask.pb.o -MD -MP -MF google/protobuf/util/internal/testdata/$(DEPDIR)/protobuf_lazy_descriptor_test-field_mask.pb.Tpo -c -o google/protobuf/util/internal/testdata/protobuf_lazy_descriptor_test-field_mask.pb.o `test -f 'google/protobuf/util/internal/testdata/field_mask.pb.cc' || echo '$(srcdir)/'`google/protobuf/util/internal/testdata/field_mask.pb.cc -@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) google/protobuf/util/internal/testdata/$(DEPDIR)/protobuf_lazy_descriptor_test-field_mask.pb.Tpo google/protobuf/util/internal/testdata/$(DEPDIR)/protobuf_lazy_descriptor_test-field_mask.pb.Po -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='google/protobuf/util/internal/testdata/field_mask.pb.cc' object='google/protobuf/util/internal/testdata/protobuf_lazy_descriptor_test-field_mask.pb.o' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(protobuf_lazy_descriptor_test_CPPFLAGS) $(CPPFLAGS) $(protobuf_lazy_descriptor_test_CXXFLAGS) $(CXXFLAGS) -c -o google/protobuf/util/internal/testdata/protobuf_lazy_descriptor_test-field_mask.pb.o `test -f 'google/protobuf/util/internal/testdata/field_mask.pb.cc' || echo '$(srcdir)/'`google/protobuf/util/internal/testdata/field_mask.pb.cc - -google/protobuf/util/internal/testdata/protobuf_lazy_descriptor_test-field_mask.pb.obj: google/protobuf/util/internal/testdata/field_mask.pb.cc -@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(protobuf_lazy_descriptor_test_CPPFLAGS) $(CPPFLAGS) $(protobuf_lazy_descriptor_test_CXXFLAGS) $(CXXFLAGS) -MT google/protobuf/util/internal/testdata/protobuf_lazy_descriptor_test-field_mask.pb.obj -MD -MP -MF google/protobuf/util/internal/testdata/$(DEPDIR)/protobuf_lazy_descriptor_test-field_mask.pb.Tpo -c -o google/protobuf/util/internal/testdata/protobuf_lazy_descriptor_test-field_mask.pb.obj `if test -f 'google/protobuf/util/internal/testdata/field_mask.pb.cc'; then $(CYGPATH_W) 'google/protobuf/util/internal/testdata/field_mask.pb.cc'; else $(CYGPATH_W) '$(srcdir)/google/protobuf/util/internal/testdata/field_mask.pb.cc'; fi` -@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) google/protobuf/util/internal/testdata/$(DEPDIR)/protobuf_lazy_descriptor_test-field_mask.pb.Tpo google/protobuf/util/internal/testdata/$(DEPDIR)/protobuf_lazy_descriptor_test-field_mask.pb.Po -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='google/protobuf/util/internal/testdata/field_mask.pb.cc' object='google/protobuf/util/internal/testdata/protobuf_lazy_descriptor_test-field_mask.pb.obj' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(protobuf_lazy_descriptor_test_CPPFLAGS) $(CPPFLAGS) $(protobuf_lazy_descriptor_test_CXXFLAGS) $(CXXFLAGS) -c -o google/protobuf/util/internal/testdata/protobuf_lazy_descriptor_test-field_mask.pb.obj `if test -f 'google/protobuf/util/internal/testdata/field_mask.pb.cc'; then $(CYGPATH_W) 'google/protobuf/util/internal/testdata/field_mask.pb.cc'; else $(CYGPATH_W) '$(srcdir)/google/protobuf/util/internal/testdata/field_mask.pb.cc'; fi` - -google/protobuf/util/internal/testdata/protobuf_lazy_descriptor_test-maps.pb.o: google/protobuf/util/internal/testdata/maps.pb.cc -@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(protobuf_lazy_descriptor_test_CPPFLAGS) $(CPPFLAGS) $(protobuf_lazy_descriptor_test_CXXFLAGS) $(CXXFLAGS) -MT google/protobuf/util/internal/testdata/protobuf_lazy_descriptor_test-maps.pb.o -MD -MP -MF google/protobuf/util/internal/testdata/$(DEPDIR)/protobuf_lazy_descriptor_test-maps.pb.Tpo -c -o google/protobuf/util/internal/testdata/protobuf_lazy_descriptor_test-maps.pb.o `test -f 'google/protobuf/util/internal/testdata/maps.pb.cc' || echo '$(srcdir)/'`google/protobuf/util/internal/testdata/maps.pb.cc -@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) google/protobuf/util/internal/testdata/$(DEPDIR)/protobuf_lazy_descriptor_test-maps.pb.Tpo google/protobuf/util/internal/testdata/$(DEPDIR)/protobuf_lazy_descriptor_test-maps.pb.Po -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='google/protobuf/util/internal/testdata/maps.pb.cc' object='google/protobuf/util/internal/testdata/protobuf_lazy_descriptor_test-maps.pb.o' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(protobuf_lazy_descriptor_test_CPPFLAGS) $(CPPFLAGS) $(protobuf_lazy_descriptor_test_CXXFLAGS) $(CXXFLAGS) -c -o google/protobuf/util/internal/testdata/protobuf_lazy_descriptor_test-maps.pb.o `test -f 'google/protobuf/util/internal/testdata/maps.pb.cc' || echo '$(srcdir)/'`google/protobuf/util/internal/testdata/maps.pb.cc - -google/protobuf/util/internal/testdata/protobuf_lazy_descriptor_test-maps.pb.obj: google/protobuf/util/internal/testdata/maps.pb.cc -@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(protobuf_lazy_descriptor_test_CPPFLAGS) $(CPPFLAGS) $(protobuf_lazy_descriptor_test_CXXFLAGS) $(CXXFLAGS) -MT google/protobuf/util/internal/testdata/protobuf_lazy_descriptor_test-maps.pb.obj -MD -MP -MF google/protobuf/util/internal/testdata/$(DEPDIR)/protobuf_lazy_descriptor_test-maps.pb.Tpo -c -o google/protobuf/util/internal/testdata/protobuf_lazy_descriptor_test-maps.pb.obj `if test -f 'google/protobuf/util/internal/testdata/maps.pb.cc'; then $(CYGPATH_W) 'google/protobuf/util/internal/testdata/maps.pb.cc'; else $(CYGPATH_W) '$(srcdir)/google/protobuf/util/internal/testdata/maps.pb.cc'; fi` -@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) google/protobuf/util/internal/testdata/$(DEPDIR)/protobuf_lazy_descriptor_test-maps.pb.Tpo google/protobuf/util/internal/testdata/$(DEPDIR)/protobuf_lazy_descriptor_test-maps.pb.Po -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='google/protobuf/util/internal/testdata/maps.pb.cc' object='google/protobuf/util/internal/testdata/protobuf_lazy_descriptor_test-maps.pb.obj' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(protobuf_lazy_descriptor_test_CPPFLAGS) $(CPPFLAGS) $(protobuf_lazy_descriptor_test_CXXFLAGS) $(CXXFLAGS) -c -o google/protobuf/util/internal/testdata/protobuf_lazy_descriptor_test-maps.pb.obj `if test -f 'google/protobuf/util/internal/testdata/maps.pb.cc'; then $(CYGPATH_W) 'google/protobuf/util/internal/testdata/maps.pb.cc'; else $(CYGPATH_W) '$(srcdir)/google/protobuf/util/internal/testdata/maps.pb.cc'; fi` - -google/protobuf/util/internal/testdata/protobuf_lazy_descriptor_test-oneofs.pb.o: google/protobuf/util/internal/testdata/oneofs.pb.cc -@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(protobuf_lazy_descriptor_test_CPPFLAGS) $(CPPFLAGS) $(protobuf_lazy_descriptor_test_CXXFLAGS) $(CXXFLAGS) -MT google/protobuf/util/internal/testdata/protobuf_lazy_descriptor_test-oneofs.pb.o -MD -MP -MF google/protobuf/util/internal/testdata/$(DEPDIR)/protobuf_lazy_descriptor_test-oneofs.pb.Tpo -c -o google/protobuf/util/internal/testdata/protobuf_lazy_descriptor_test-oneofs.pb.o `test -f 'google/protobuf/util/internal/testdata/oneofs.pb.cc' || echo '$(srcdir)/'`google/protobuf/util/internal/testdata/oneofs.pb.cc -@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) google/protobuf/util/internal/testdata/$(DEPDIR)/protobuf_lazy_descriptor_test-oneofs.pb.Tpo google/protobuf/util/internal/testdata/$(DEPDIR)/protobuf_lazy_descriptor_test-oneofs.pb.Po -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='google/protobuf/util/internal/testdata/oneofs.pb.cc' object='google/protobuf/util/internal/testdata/protobuf_lazy_descriptor_test-oneofs.pb.o' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(protobuf_lazy_descriptor_test_CPPFLAGS) $(CPPFLAGS) $(protobuf_lazy_descriptor_test_CXXFLAGS) $(CXXFLAGS) -c -o google/protobuf/util/internal/testdata/protobuf_lazy_descriptor_test-oneofs.pb.o `test -f 'google/protobuf/util/internal/testdata/oneofs.pb.cc' || echo '$(srcdir)/'`google/protobuf/util/internal/testdata/oneofs.pb.cc - -google/protobuf/util/internal/testdata/protobuf_lazy_descriptor_test-oneofs.pb.obj: google/protobuf/util/internal/testdata/oneofs.pb.cc -@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(protobuf_lazy_descriptor_test_CPPFLAGS) $(CPPFLAGS) $(protobuf_lazy_descriptor_test_CXXFLAGS) $(CXXFLAGS) -MT google/protobuf/util/internal/testdata/protobuf_lazy_descriptor_test-oneofs.pb.obj -MD -MP -MF google/protobuf/util/internal/testdata/$(DEPDIR)/protobuf_lazy_descriptor_test-oneofs.pb.Tpo -c -o google/protobuf/util/internal/testdata/protobuf_lazy_descriptor_test-oneofs.pb.obj `if test -f 'google/protobuf/util/internal/testdata/oneofs.pb.cc'; then $(CYGPATH_W) 'google/protobuf/util/internal/testdata/oneofs.pb.cc'; else $(CYGPATH_W) '$(srcdir)/google/protobuf/util/internal/testdata/oneofs.pb.cc'; fi` -@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) google/protobuf/util/internal/testdata/$(DEPDIR)/protobuf_lazy_descriptor_test-oneofs.pb.Tpo google/protobuf/util/internal/testdata/$(DEPDIR)/protobuf_lazy_descriptor_test-oneofs.pb.Po -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='google/protobuf/util/internal/testdata/oneofs.pb.cc' object='google/protobuf/util/internal/testdata/protobuf_lazy_descriptor_test-oneofs.pb.obj' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(protobuf_lazy_descriptor_test_CPPFLAGS) $(CPPFLAGS) $(protobuf_lazy_descriptor_test_CXXFLAGS) $(CXXFLAGS) -c -o google/protobuf/util/internal/testdata/protobuf_lazy_descriptor_test-oneofs.pb.obj `if test -f 'google/protobuf/util/internal/testdata/oneofs.pb.cc'; then $(CYGPATH_W) 'google/protobuf/util/internal/testdata/oneofs.pb.cc'; else $(CYGPATH_W) '$(srcdir)/google/protobuf/util/internal/testdata/oneofs.pb.cc'; fi` - -google/protobuf/util/internal/testdata/protobuf_lazy_descriptor_test-proto3.pb.o: google/protobuf/util/internal/testdata/proto3.pb.cc -@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(protobuf_lazy_descriptor_test_CPPFLAGS) $(CPPFLAGS) $(protobuf_lazy_descriptor_test_CXXFLAGS) $(CXXFLAGS) -MT google/protobuf/util/internal/testdata/protobuf_lazy_descriptor_test-proto3.pb.o -MD -MP -MF google/protobuf/util/internal/testdata/$(DEPDIR)/protobuf_lazy_descriptor_test-proto3.pb.Tpo -c -o google/protobuf/util/internal/testdata/protobuf_lazy_descriptor_test-proto3.pb.o `test -f 'google/protobuf/util/internal/testdata/proto3.pb.cc' || echo '$(srcdir)/'`google/protobuf/util/internal/testdata/proto3.pb.cc -@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) google/protobuf/util/internal/testdata/$(DEPDIR)/protobuf_lazy_descriptor_test-proto3.pb.Tpo google/protobuf/util/internal/testdata/$(DEPDIR)/protobuf_lazy_descriptor_test-proto3.pb.Po -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='google/protobuf/util/internal/testdata/proto3.pb.cc' object='google/protobuf/util/internal/testdata/protobuf_lazy_descriptor_test-proto3.pb.o' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(protobuf_lazy_descriptor_test_CPPFLAGS) $(CPPFLAGS) $(protobuf_lazy_descriptor_test_CXXFLAGS) $(CXXFLAGS) -c -o google/protobuf/util/internal/testdata/protobuf_lazy_descriptor_test-proto3.pb.o `test -f 'google/protobuf/util/internal/testdata/proto3.pb.cc' || echo '$(srcdir)/'`google/protobuf/util/internal/testdata/proto3.pb.cc - -google/protobuf/util/internal/testdata/protobuf_lazy_descriptor_test-proto3.pb.obj: google/protobuf/util/internal/testdata/proto3.pb.cc -@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(protobuf_lazy_descriptor_test_CPPFLAGS) $(CPPFLAGS) $(protobuf_lazy_descriptor_test_CXXFLAGS) $(CXXFLAGS) -MT google/protobuf/util/internal/testdata/protobuf_lazy_descriptor_test-proto3.pb.obj -MD -MP -MF google/protobuf/util/internal/testdata/$(DEPDIR)/protobuf_lazy_descriptor_test-proto3.pb.Tpo -c -o google/protobuf/util/internal/testdata/protobuf_lazy_descriptor_test-proto3.pb.obj `if test -f 'google/protobuf/util/internal/testdata/proto3.pb.cc'; then $(CYGPATH_W) 'google/protobuf/util/internal/testdata/proto3.pb.cc'; else $(CYGPATH_W) '$(srcdir)/google/protobuf/util/internal/testdata/proto3.pb.cc'; fi` -@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) google/protobuf/util/internal/testdata/$(DEPDIR)/protobuf_lazy_descriptor_test-proto3.pb.Tpo google/protobuf/util/internal/testdata/$(DEPDIR)/protobuf_lazy_descriptor_test-proto3.pb.Po -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='google/protobuf/util/internal/testdata/proto3.pb.cc' object='google/protobuf/util/internal/testdata/protobuf_lazy_descriptor_test-proto3.pb.obj' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(protobuf_lazy_descriptor_test_CPPFLAGS) $(CPPFLAGS) $(protobuf_lazy_descriptor_test_CXXFLAGS) $(CXXFLAGS) -c -o google/protobuf/util/internal/testdata/protobuf_lazy_descriptor_test-proto3.pb.obj `if test -f 'google/protobuf/util/internal/testdata/proto3.pb.cc'; then $(CYGPATH_W) 'google/protobuf/util/internal/testdata/proto3.pb.cc'; else $(CYGPATH_W) '$(srcdir)/google/protobuf/util/internal/testdata/proto3.pb.cc'; fi` - -google/protobuf/util/internal/testdata/protobuf_lazy_descriptor_test-struct.pb.o: google/protobuf/util/internal/testdata/struct.pb.cc -@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(protobuf_lazy_descriptor_test_CPPFLAGS) $(CPPFLAGS) $(protobuf_lazy_descriptor_test_CXXFLAGS) $(CXXFLAGS) -MT google/protobuf/util/internal/testdata/protobuf_lazy_descriptor_test-struct.pb.o -MD -MP -MF google/protobuf/util/internal/testdata/$(DEPDIR)/protobuf_lazy_descriptor_test-struct.pb.Tpo -c -o google/protobuf/util/internal/testdata/protobuf_lazy_descriptor_test-struct.pb.o `test -f 'google/protobuf/util/internal/testdata/struct.pb.cc' || echo '$(srcdir)/'`google/protobuf/util/internal/testdata/struct.pb.cc -@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) google/protobuf/util/internal/testdata/$(DEPDIR)/protobuf_lazy_descriptor_test-struct.pb.Tpo google/protobuf/util/internal/testdata/$(DEPDIR)/protobuf_lazy_descriptor_test-struct.pb.Po -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='google/protobuf/util/internal/testdata/struct.pb.cc' object='google/protobuf/util/internal/testdata/protobuf_lazy_descriptor_test-struct.pb.o' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(protobuf_lazy_descriptor_test_CPPFLAGS) $(CPPFLAGS) $(protobuf_lazy_descriptor_test_CXXFLAGS) $(CXXFLAGS) -c -o google/protobuf/util/internal/testdata/protobuf_lazy_descriptor_test-struct.pb.o `test -f 'google/protobuf/util/internal/testdata/struct.pb.cc' || echo '$(srcdir)/'`google/protobuf/util/internal/testdata/struct.pb.cc - -google/protobuf/util/internal/testdata/protobuf_lazy_descriptor_test-struct.pb.obj: google/protobuf/util/internal/testdata/struct.pb.cc -@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(protobuf_lazy_descriptor_test_CPPFLAGS) $(CPPFLAGS) $(protobuf_lazy_descriptor_test_CXXFLAGS) $(CXXFLAGS) -MT google/protobuf/util/internal/testdata/protobuf_lazy_descriptor_test-struct.pb.obj -MD -MP -MF google/protobuf/util/internal/testdata/$(DEPDIR)/protobuf_lazy_descriptor_test-struct.pb.Tpo -c -o google/protobuf/util/internal/testdata/protobuf_lazy_descriptor_test-struct.pb.obj `if test -f 'google/protobuf/util/internal/testdata/struct.pb.cc'; then $(CYGPATH_W) 'google/protobuf/util/internal/testdata/struct.pb.cc'; else $(CYGPATH_W) '$(srcdir)/google/protobuf/util/internal/testdata/struct.pb.cc'; fi` -@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) google/protobuf/util/internal/testdata/$(DEPDIR)/protobuf_lazy_descriptor_test-struct.pb.Tpo google/protobuf/util/internal/testdata/$(DEPDIR)/protobuf_lazy_descriptor_test-struct.pb.Po -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='google/protobuf/util/internal/testdata/struct.pb.cc' object='google/protobuf/util/internal/testdata/protobuf_lazy_descriptor_test-struct.pb.obj' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(protobuf_lazy_descriptor_test_CPPFLAGS) $(CPPFLAGS) $(protobuf_lazy_descriptor_test_CXXFLAGS) $(CXXFLAGS) -c -o google/protobuf/util/internal/testdata/protobuf_lazy_descriptor_test-struct.pb.obj `if test -f 'google/protobuf/util/internal/testdata/struct.pb.cc'; then $(CYGPATH_W) 'google/protobuf/util/internal/testdata/struct.pb.cc'; else $(CYGPATH_W) '$(srcdir)/google/protobuf/util/internal/testdata/struct.pb.cc'; fi` - -google/protobuf/util/internal/testdata/protobuf_lazy_descriptor_test-timestamp_duration.pb.o: google/protobuf/util/internal/testdata/timestamp_duration.pb.cc -@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(protobuf_lazy_descriptor_test_CPPFLAGS) $(CPPFLAGS) $(protobuf_lazy_descriptor_test_CXXFLAGS) $(CXXFLAGS) -MT google/protobuf/util/internal/testdata/protobuf_lazy_descriptor_test-timestamp_duration.pb.o -MD -MP -MF google/protobuf/util/internal/testdata/$(DEPDIR)/protobuf_lazy_descriptor_test-timestamp_duration.pb.Tpo -c -o google/protobuf/util/internal/testdata/protobuf_lazy_descriptor_test-timestamp_duration.pb.o `test -f 'google/protobuf/util/internal/testdata/timestamp_duration.pb.cc' || echo '$(srcdir)/'`google/protobuf/util/internal/testdata/timestamp_duration.pb.cc -@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) google/protobuf/util/internal/testdata/$(DEPDIR)/protobuf_lazy_descriptor_test-timestamp_duration.pb.Tpo google/protobuf/util/internal/testdata/$(DEPDIR)/protobuf_lazy_descriptor_test-timestamp_duration.pb.Po -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='google/protobuf/util/internal/testdata/timestamp_duration.pb.cc' object='google/protobuf/util/internal/testdata/protobuf_lazy_descriptor_test-timestamp_duration.pb.o' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(protobuf_lazy_descriptor_test_CPPFLAGS) $(CPPFLAGS) $(protobuf_lazy_descriptor_test_CXXFLAGS) $(CXXFLAGS) -c -o google/protobuf/util/internal/testdata/protobuf_lazy_descriptor_test-timestamp_duration.pb.o `test -f 'google/protobuf/util/internal/testdata/timestamp_duration.pb.cc' || echo '$(srcdir)/'`google/protobuf/util/internal/testdata/timestamp_duration.pb.cc - -google/protobuf/util/internal/testdata/protobuf_lazy_descriptor_test-timestamp_duration.pb.obj: google/protobuf/util/internal/testdata/timestamp_duration.pb.cc -@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(protobuf_lazy_descriptor_test_CPPFLAGS) $(CPPFLAGS) $(protobuf_lazy_descriptor_test_CXXFLAGS) $(CXXFLAGS) -MT google/protobuf/util/internal/testdata/protobuf_lazy_descriptor_test-timestamp_duration.pb.obj -MD -MP -MF google/protobuf/util/internal/testdata/$(DEPDIR)/protobuf_lazy_descriptor_test-timestamp_duration.pb.Tpo -c -o google/protobuf/util/internal/testdata/protobuf_lazy_descriptor_test-timestamp_duration.pb.obj `if test -f 'google/protobuf/util/internal/testdata/timestamp_duration.pb.cc'; then $(CYGPATH_W) 'google/protobuf/util/internal/testdata/timestamp_duration.pb.cc'; else $(CYGPATH_W) '$(srcdir)/google/protobuf/util/internal/testdata/timestamp_duration.pb.cc'; fi` -@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) google/protobuf/util/internal/testdata/$(DEPDIR)/protobuf_lazy_descriptor_test-timestamp_duration.pb.Tpo google/protobuf/util/internal/testdata/$(DEPDIR)/protobuf_lazy_descriptor_test-timestamp_duration.pb.Po -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='google/protobuf/util/internal/testdata/timestamp_duration.pb.cc' object='google/protobuf/util/internal/testdata/protobuf_lazy_descriptor_test-timestamp_duration.pb.obj' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(protobuf_lazy_descriptor_test_CPPFLAGS) $(CPPFLAGS) $(protobuf_lazy_descriptor_test_CXXFLAGS) $(CXXFLAGS) -c -o google/protobuf/util/internal/testdata/protobuf_lazy_descriptor_test-timestamp_duration.pb.obj `if test -f 'google/protobuf/util/internal/testdata/timestamp_duration.pb.cc'; then $(CYGPATH_W) 'google/protobuf/util/internal/testdata/timestamp_duration.pb.cc'; else $(CYGPATH_W) '$(srcdir)/google/protobuf/util/internal/testdata/timestamp_duration.pb.cc'; fi` - -google/protobuf/util/internal/testdata/protobuf_lazy_descriptor_test-wrappers.pb.o: google/protobuf/util/internal/testdata/wrappers.pb.cc -@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(protobuf_lazy_descriptor_test_CPPFLAGS) $(CPPFLAGS) $(protobuf_lazy_descriptor_test_CXXFLAGS) $(CXXFLAGS) -MT google/protobuf/util/internal/testdata/protobuf_lazy_descriptor_test-wrappers.pb.o -MD -MP -MF google/protobuf/util/internal/testdata/$(DEPDIR)/protobuf_lazy_descriptor_test-wrappers.pb.Tpo -c -o google/protobuf/util/internal/testdata/protobuf_lazy_descriptor_test-wrappers.pb.o `test -f 'google/protobuf/util/internal/testdata/wrappers.pb.cc' || echo '$(srcdir)/'`google/protobuf/util/internal/testdata/wrappers.pb.cc -@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) google/protobuf/util/internal/testdata/$(DEPDIR)/protobuf_lazy_descriptor_test-wrappers.pb.Tpo google/protobuf/util/internal/testdata/$(DEPDIR)/protobuf_lazy_descriptor_test-wrappers.pb.Po -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='google/protobuf/util/internal/testdata/wrappers.pb.cc' object='google/protobuf/util/internal/testdata/protobuf_lazy_descriptor_test-wrappers.pb.o' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(protobuf_lazy_descriptor_test_CPPFLAGS) $(CPPFLAGS) $(protobuf_lazy_descriptor_test_CXXFLAGS) $(CXXFLAGS) -c -o google/protobuf/util/internal/testdata/protobuf_lazy_descriptor_test-wrappers.pb.o `test -f 'google/protobuf/util/internal/testdata/wrappers.pb.cc' || echo '$(srcdir)/'`google/protobuf/util/internal/testdata/wrappers.pb.cc - -google/protobuf/util/internal/testdata/protobuf_lazy_descriptor_test-wrappers.pb.obj: google/protobuf/util/internal/testdata/wrappers.pb.cc -@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(protobuf_lazy_descriptor_test_CPPFLAGS) $(CPPFLAGS) $(protobuf_lazy_descriptor_test_CXXFLAGS) $(CXXFLAGS) -MT google/protobuf/util/internal/testdata/protobuf_lazy_descriptor_test-wrappers.pb.obj -MD -MP -MF google/protobuf/util/internal/testdata/$(DEPDIR)/protobuf_lazy_descriptor_test-wrappers.pb.Tpo -c -o google/protobuf/util/internal/testdata/protobuf_lazy_descriptor_test-wrappers.pb.obj `if test -f 'google/protobuf/util/internal/testdata/wrappers.pb.cc'; then $(CYGPATH_W) 'google/protobuf/util/internal/testdata/wrappers.pb.cc'; else $(CYGPATH_W) '$(srcdir)/google/protobuf/util/internal/testdata/wrappers.pb.cc'; fi` -@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) google/protobuf/util/internal/testdata/$(DEPDIR)/protobuf_lazy_descriptor_test-wrappers.pb.Tpo google/protobuf/util/internal/testdata/$(DEPDIR)/protobuf_lazy_descriptor_test-wrappers.pb.Po -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='google/protobuf/util/internal/testdata/wrappers.pb.cc' object='google/protobuf/util/internal/testdata/protobuf_lazy_descriptor_test-wrappers.pb.obj' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(protobuf_lazy_descriptor_test_CPPFLAGS) $(CPPFLAGS) $(protobuf_lazy_descriptor_test_CXXFLAGS) $(CXXFLAGS) -c -o google/protobuf/util/internal/testdata/protobuf_lazy_descriptor_test-wrappers.pb.obj `if test -f 'google/protobuf/util/internal/testdata/wrappers.pb.cc'; then $(CYGPATH_W) 'google/protobuf/util/internal/testdata/wrappers.pb.cc'; else $(CYGPATH_W) '$(srcdir)/google/protobuf/util/internal/testdata/wrappers.pb.cc'; fi` - -google/protobuf/util/protobuf_lazy_descriptor_test-json_format.pb.o: google/protobuf/util/json_format.pb.cc -@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(protobuf_lazy_descriptor_test_CPPFLAGS) $(CPPFLAGS) $(protobuf_lazy_descriptor_test_CXXFLAGS) $(CXXFLAGS) -MT google/protobuf/util/protobuf_lazy_descriptor_test-json_format.pb.o -MD -MP -MF google/protobuf/util/$(DEPDIR)/protobuf_lazy_descriptor_test-json_format.pb.Tpo -c -o google/protobuf/util/protobuf_lazy_descriptor_test-json_format.pb.o `test -f 'google/protobuf/util/json_format.pb.cc' || echo '$(srcdir)/'`google/protobuf/util/json_format.pb.cc -@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) google/protobuf/util/$(DEPDIR)/protobuf_lazy_descriptor_test-json_format.pb.Tpo google/protobuf/util/$(DEPDIR)/protobuf_lazy_descriptor_test-json_format.pb.Po -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='google/protobuf/util/json_format.pb.cc' object='google/protobuf/util/protobuf_lazy_descriptor_test-json_format.pb.o' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(protobuf_lazy_descriptor_test_CPPFLAGS) $(CPPFLAGS) $(protobuf_lazy_descriptor_test_CXXFLAGS) $(CXXFLAGS) -c -o google/protobuf/util/protobuf_lazy_descriptor_test-json_format.pb.o `test -f 'google/protobuf/util/json_format.pb.cc' || echo '$(srcdir)/'`google/protobuf/util/json_format.pb.cc - -google/protobuf/util/protobuf_lazy_descriptor_test-json_format.pb.obj: google/protobuf/util/json_format.pb.cc -@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(protobuf_lazy_descriptor_test_CPPFLAGS) $(CPPFLAGS) $(protobuf_lazy_descriptor_test_CXXFLAGS) $(CXXFLAGS) -MT google/protobuf/util/protobuf_lazy_descriptor_test-json_format.pb.obj -MD -MP -MF google/protobuf/util/$(DEPDIR)/protobuf_lazy_descriptor_test-json_format.pb.Tpo -c -o google/protobuf/util/protobuf_lazy_descriptor_test-json_format.pb.obj `if test -f 'google/protobuf/util/json_format.pb.cc'; then $(CYGPATH_W) 'google/protobuf/util/json_format.pb.cc'; else $(CYGPATH_W) '$(srcdir)/google/protobuf/util/json_format.pb.cc'; fi` -@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) google/protobuf/util/$(DEPDIR)/protobuf_lazy_descriptor_test-json_format.pb.Tpo google/protobuf/util/$(DEPDIR)/protobuf_lazy_descriptor_test-json_format.pb.Po -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='google/protobuf/util/json_format.pb.cc' object='google/protobuf/util/protobuf_lazy_descriptor_test-json_format.pb.obj' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(protobuf_lazy_descriptor_test_CPPFLAGS) $(CPPFLAGS) $(protobuf_lazy_descriptor_test_CXXFLAGS) $(CXXFLAGS) -c -o google/protobuf/util/protobuf_lazy_descriptor_test-json_format.pb.obj `if test -f 'google/protobuf/util/json_format.pb.cc'; then $(CYGPATH_W) 'google/protobuf/util/json_format.pb.cc'; else $(CYGPATH_W) '$(srcdir)/google/protobuf/util/json_format.pb.cc'; fi` - -google/protobuf/util/protobuf_lazy_descriptor_test-json_format_proto3.pb.o: google/protobuf/util/json_format_proto3.pb.cc -@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(protobuf_lazy_descriptor_test_CPPFLAGS) $(CPPFLAGS) $(protobuf_lazy_descriptor_test_CXXFLAGS) $(CXXFLAGS) -MT google/protobuf/util/protobuf_lazy_descriptor_test-json_format_proto3.pb.o -MD -MP -MF google/protobuf/util/$(DEPDIR)/protobuf_lazy_descriptor_test-json_format_proto3.pb.Tpo -c -o google/protobuf/util/protobuf_lazy_descriptor_test-json_format_proto3.pb.o `test -f 'google/protobuf/util/json_format_proto3.pb.cc' || echo '$(srcdir)/'`google/protobuf/util/json_format_proto3.pb.cc -@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) google/protobuf/util/$(DEPDIR)/protobuf_lazy_descriptor_test-json_format_proto3.pb.Tpo google/protobuf/util/$(DEPDIR)/protobuf_lazy_descriptor_test-json_format_proto3.pb.Po -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='google/protobuf/util/json_format_proto3.pb.cc' object='google/protobuf/util/protobuf_lazy_descriptor_test-json_format_proto3.pb.o' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(protobuf_lazy_descriptor_test_CPPFLAGS) $(CPPFLAGS) $(protobuf_lazy_descriptor_test_CXXFLAGS) $(CXXFLAGS) -c -o google/protobuf/util/protobuf_lazy_descriptor_test-json_format_proto3.pb.o `test -f 'google/protobuf/util/json_format_proto3.pb.cc' || echo '$(srcdir)/'`google/protobuf/util/json_format_proto3.pb.cc - -google/protobuf/util/protobuf_lazy_descriptor_test-json_format_proto3.pb.obj: google/protobuf/util/json_format_proto3.pb.cc -@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(protobuf_lazy_descriptor_test_CPPFLAGS) $(CPPFLAGS) $(protobuf_lazy_descriptor_test_CXXFLAGS) $(CXXFLAGS) -MT google/protobuf/util/protobuf_lazy_descriptor_test-json_format_proto3.pb.obj -MD -MP -MF google/protobuf/util/$(DEPDIR)/protobuf_lazy_descriptor_test-json_format_proto3.pb.Tpo -c -o google/protobuf/util/protobuf_lazy_descriptor_test-json_format_proto3.pb.obj `if test -f 'google/protobuf/util/json_format_proto3.pb.cc'; then $(CYGPATH_W) 'google/protobuf/util/json_format_proto3.pb.cc'; else $(CYGPATH_W) '$(srcdir)/google/protobuf/util/json_format_proto3.pb.cc'; fi` -@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) google/protobuf/util/$(DEPDIR)/protobuf_lazy_descriptor_test-json_format_proto3.pb.Tpo google/protobuf/util/$(DEPDIR)/protobuf_lazy_descriptor_test-json_format_proto3.pb.Po -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='google/protobuf/util/json_format_proto3.pb.cc' object='google/protobuf/util/protobuf_lazy_descriptor_test-json_format_proto3.pb.obj' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(protobuf_lazy_descriptor_test_CPPFLAGS) $(CPPFLAGS) $(protobuf_lazy_descriptor_test_CXXFLAGS) $(CXXFLAGS) -c -o google/protobuf/util/protobuf_lazy_descriptor_test-json_format_proto3.pb.obj `if test -f 'google/protobuf/util/json_format_proto3.pb.cc'; then $(CYGPATH_W) 'google/protobuf/util/json_format_proto3.pb.cc'; else $(CYGPATH_W) '$(srcdir)/google/protobuf/util/json_format_proto3.pb.cc'; fi` - -google/protobuf/util/protobuf_lazy_descriptor_test-message_differencer_unittest.pb.o: google/protobuf/util/message_differencer_unittest.pb.cc -@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(protobuf_lazy_descriptor_test_CPPFLAGS) $(CPPFLAGS) $(protobuf_lazy_descriptor_test_CXXFLAGS) $(CXXFLAGS) -MT google/protobuf/util/protobuf_lazy_descriptor_test-message_differencer_unittest.pb.o -MD -MP -MF google/protobuf/util/$(DEPDIR)/protobuf_lazy_descriptor_test-message_differencer_unittest.pb.Tpo -c -o google/protobuf/util/protobuf_lazy_descriptor_test-message_differencer_unittest.pb.o `test -f 'google/protobuf/util/message_differencer_unittest.pb.cc' || echo '$(srcdir)/'`google/protobuf/util/message_differencer_unittest.pb.cc -@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) google/protobuf/util/$(DEPDIR)/protobuf_lazy_descriptor_test-message_differencer_unittest.pb.Tpo google/protobuf/util/$(DEPDIR)/protobuf_lazy_descriptor_test-message_differencer_unittest.pb.Po -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='google/protobuf/util/message_differencer_unittest.pb.cc' object='google/protobuf/util/protobuf_lazy_descriptor_test-message_differencer_unittest.pb.o' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(protobuf_lazy_descriptor_test_CPPFLAGS) $(CPPFLAGS) $(protobuf_lazy_descriptor_test_CXXFLAGS) $(CXXFLAGS) -c -o google/protobuf/util/protobuf_lazy_descriptor_test-message_differencer_unittest.pb.o `test -f 'google/protobuf/util/message_differencer_unittest.pb.cc' || echo '$(srcdir)/'`google/protobuf/util/message_differencer_unittest.pb.cc - -google/protobuf/util/protobuf_lazy_descriptor_test-message_differencer_unittest.pb.obj: google/protobuf/util/message_differencer_unittest.pb.cc -@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(protobuf_lazy_descriptor_test_CPPFLAGS) $(CPPFLAGS) $(protobuf_lazy_descriptor_test_CXXFLAGS) $(CXXFLAGS) -MT google/protobuf/util/protobuf_lazy_descriptor_test-message_differencer_unittest.pb.obj -MD -MP -MF google/protobuf/util/$(DEPDIR)/protobuf_lazy_descriptor_test-message_differencer_unittest.pb.Tpo -c -o google/protobuf/util/protobuf_lazy_descriptor_test-message_differencer_unittest.pb.obj `if test -f 'google/protobuf/util/message_differencer_unittest.pb.cc'; then $(CYGPATH_W) 'google/protobuf/util/message_differencer_unittest.pb.cc'; else $(CYGPATH_W) '$(srcdir)/google/protobuf/util/message_differencer_unittest.pb.cc'; fi` -@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) google/protobuf/util/$(DEPDIR)/protobuf_lazy_descriptor_test-message_differencer_unittest.pb.Tpo google/protobuf/util/$(DEPDIR)/protobuf_lazy_descriptor_test-message_differencer_unittest.pb.Po -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='google/protobuf/util/message_differencer_unittest.pb.cc' object='google/protobuf/util/protobuf_lazy_descriptor_test-message_differencer_unittest.pb.obj' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(protobuf_lazy_descriptor_test_CPPFLAGS) $(CPPFLAGS) $(protobuf_lazy_descriptor_test_CXXFLAGS) $(CXXFLAGS) -c -o google/protobuf/util/protobuf_lazy_descriptor_test-message_differencer_unittest.pb.obj `if test -f 'google/protobuf/util/message_differencer_unittest.pb.cc'; then $(CYGPATH_W) 'google/protobuf/util/message_differencer_unittest.pb.cc'; else $(CYGPATH_W) '$(srcdir)/google/protobuf/util/message_differencer_unittest.pb.cc'; fi` - -google/protobuf/protobuf_lite_arena_test-lite_arena_unittest.o: google/protobuf/lite_arena_unittest.cc -@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(protobuf_lite_arena_test_CPPFLAGS) $(CPPFLAGS) $(protobuf_lite_arena_test_CXXFLAGS) $(CXXFLAGS) -MT google/protobuf/protobuf_lite_arena_test-lite_arena_unittest.o -MD -MP -MF google/protobuf/$(DEPDIR)/protobuf_lite_arena_test-lite_arena_unittest.Tpo -c -o google/protobuf/protobuf_lite_arena_test-lite_arena_unittest.o `test -f 'google/protobuf/lite_arena_unittest.cc' || echo '$(srcdir)/'`google/protobuf/lite_arena_unittest.cc -@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) google/protobuf/$(DEPDIR)/protobuf_lite_arena_test-lite_arena_unittest.Tpo google/protobuf/$(DEPDIR)/protobuf_lite_arena_test-lite_arena_unittest.Po -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='google/protobuf/lite_arena_unittest.cc' object='google/protobuf/protobuf_lite_arena_test-lite_arena_unittest.o' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(protobuf_lite_arena_test_CPPFLAGS) $(CPPFLAGS) $(protobuf_lite_arena_test_CXXFLAGS) $(CXXFLAGS) -c -o google/protobuf/protobuf_lite_arena_test-lite_arena_unittest.o `test -f 'google/protobuf/lite_arena_unittest.cc' || echo '$(srcdir)/'`google/protobuf/lite_arena_unittest.cc - -google/protobuf/protobuf_lite_arena_test-lite_arena_unittest.obj: google/protobuf/lite_arena_unittest.cc -@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(protobuf_lite_arena_test_CPPFLAGS) $(CPPFLAGS) $(protobuf_lite_arena_test_CXXFLAGS) $(CXXFLAGS) -MT google/protobuf/protobuf_lite_arena_test-lite_arena_unittest.obj -MD -MP -MF google/protobuf/$(DEPDIR)/protobuf_lite_arena_test-lite_arena_unittest.Tpo -c -o google/protobuf/protobuf_lite_arena_test-lite_arena_unittest.obj `if test -f 'google/protobuf/lite_arena_unittest.cc'; then $(CYGPATH_W) 'google/protobuf/lite_arena_unittest.cc'; else $(CYGPATH_W) '$(srcdir)/google/protobuf/lite_arena_unittest.cc'; fi` -@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) google/protobuf/$(DEPDIR)/protobuf_lite_arena_test-lite_arena_unittest.Tpo google/protobuf/$(DEPDIR)/protobuf_lite_arena_test-lite_arena_unittest.Po -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='google/protobuf/lite_arena_unittest.cc' object='google/protobuf/protobuf_lite_arena_test-lite_arena_unittest.obj' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(protobuf_lite_arena_test_CPPFLAGS) $(CPPFLAGS) $(protobuf_lite_arena_test_CXXFLAGS) $(CXXFLAGS) -c -o google/protobuf/protobuf_lite_arena_test-lite_arena_unittest.obj `if test -f 'google/protobuf/lite_arena_unittest.cc'; then $(CYGPATH_W) 'google/protobuf/lite_arena_unittest.cc'; else $(CYGPATH_W) '$(srcdir)/google/protobuf/lite_arena_unittest.cc'; fi` - -google/protobuf/protobuf_lite_arena_test-arena_test_util.o: google/protobuf/arena_test_util.cc -@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(protobuf_lite_arena_test_CPPFLAGS) $(CPPFLAGS) $(protobuf_lite_arena_test_CXXFLAGS) $(CXXFLAGS) -MT google/protobuf/protobuf_lite_arena_test-arena_test_util.o -MD -MP -MF google/protobuf/$(DEPDIR)/protobuf_lite_arena_test-arena_test_util.Tpo -c -o google/protobuf/protobuf_lite_arena_test-arena_test_util.o `test -f 'google/protobuf/arena_test_util.cc' || echo '$(srcdir)/'`google/protobuf/arena_test_util.cc -@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) google/protobuf/$(DEPDIR)/protobuf_lite_arena_test-arena_test_util.Tpo google/protobuf/$(DEPDIR)/protobuf_lite_arena_test-arena_test_util.Po -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='google/protobuf/arena_test_util.cc' object='google/protobuf/protobuf_lite_arena_test-arena_test_util.o' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(protobuf_lite_arena_test_CPPFLAGS) $(CPPFLAGS) $(protobuf_lite_arena_test_CXXFLAGS) $(CXXFLAGS) -c -o google/protobuf/protobuf_lite_arena_test-arena_test_util.o `test -f 'google/protobuf/arena_test_util.cc' || echo '$(srcdir)/'`google/protobuf/arena_test_util.cc - -google/protobuf/protobuf_lite_arena_test-arena_test_util.obj: google/protobuf/arena_test_util.cc -@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(protobuf_lite_arena_test_CPPFLAGS) $(CPPFLAGS) $(protobuf_lite_arena_test_CXXFLAGS) $(CXXFLAGS) -MT google/protobuf/protobuf_lite_arena_test-arena_test_util.obj -MD -MP -MF google/protobuf/$(DEPDIR)/protobuf_lite_arena_test-arena_test_util.Tpo -c -o google/protobuf/protobuf_lite_arena_test-arena_test_util.obj `if test -f 'google/protobuf/arena_test_util.cc'; then $(CYGPATH_W) 'google/protobuf/arena_test_util.cc'; else $(CYGPATH_W) '$(srcdir)/google/protobuf/arena_test_util.cc'; fi` -@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) google/protobuf/$(DEPDIR)/protobuf_lite_arena_test-arena_test_util.Tpo google/protobuf/$(DEPDIR)/protobuf_lite_arena_test-arena_test_util.Po -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='google/protobuf/arena_test_util.cc' object='google/protobuf/protobuf_lite_arena_test-arena_test_util.obj' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(protobuf_lite_arena_test_CPPFLAGS) $(CPPFLAGS) $(protobuf_lite_arena_test_CXXFLAGS) $(CXXFLAGS) -c -o google/protobuf/protobuf_lite_arena_test-arena_test_util.obj `if test -f 'google/protobuf/arena_test_util.cc'; then $(CYGPATH_W) 'google/protobuf/arena_test_util.cc'; else $(CYGPATH_W) '$(srcdir)/google/protobuf/arena_test_util.cc'; fi` - -google/protobuf/protobuf_lite_arena_test-map_lite_test_util.o: google/protobuf/map_lite_test_util.cc -@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(protobuf_lite_arena_test_CPPFLAGS) $(CPPFLAGS) $(protobuf_lite_arena_test_CXXFLAGS) $(CXXFLAGS) -MT google/protobuf/protobuf_lite_arena_test-map_lite_test_util.o -MD -MP -MF google/protobuf/$(DEPDIR)/protobuf_lite_arena_test-map_lite_test_util.Tpo -c -o google/protobuf/protobuf_lite_arena_test-map_lite_test_util.o `test -f 'google/protobuf/map_lite_test_util.cc' || echo '$(srcdir)/'`google/protobuf/map_lite_test_util.cc -@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) google/protobuf/$(DEPDIR)/protobuf_lite_arena_test-map_lite_test_util.Tpo google/protobuf/$(DEPDIR)/protobuf_lite_arena_test-map_lite_test_util.Po -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='google/protobuf/map_lite_test_util.cc' object='google/protobuf/protobuf_lite_arena_test-map_lite_test_util.o' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(protobuf_lite_arena_test_CPPFLAGS) $(CPPFLAGS) $(protobuf_lite_arena_test_CXXFLAGS) $(CXXFLAGS) -c -o google/protobuf/protobuf_lite_arena_test-map_lite_test_util.o `test -f 'google/protobuf/map_lite_test_util.cc' || echo '$(srcdir)/'`google/protobuf/map_lite_test_util.cc - -google/protobuf/protobuf_lite_arena_test-map_lite_test_util.obj: google/protobuf/map_lite_test_util.cc -@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(protobuf_lite_arena_test_CPPFLAGS) $(CPPFLAGS) $(protobuf_lite_arena_test_CXXFLAGS) $(CXXFLAGS) -MT google/protobuf/protobuf_lite_arena_test-map_lite_test_util.obj -MD -MP -MF google/protobuf/$(DEPDIR)/protobuf_lite_arena_test-map_lite_test_util.Tpo -c -o google/protobuf/protobuf_lite_arena_test-map_lite_test_util.obj `if test -f 'google/protobuf/map_lite_test_util.cc'; then $(CYGPATH_W) 'google/protobuf/map_lite_test_util.cc'; else $(CYGPATH_W) '$(srcdir)/google/protobuf/map_lite_test_util.cc'; fi` -@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) google/protobuf/$(DEPDIR)/protobuf_lite_arena_test-map_lite_test_util.Tpo google/protobuf/$(DEPDIR)/protobuf_lite_arena_test-map_lite_test_util.Po -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='google/protobuf/map_lite_test_util.cc' object='google/protobuf/protobuf_lite_arena_test-map_lite_test_util.obj' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(protobuf_lite_arena_test_CPPFLAGS) $(CPPFLAGS) $(protobuf_lite_arena_test_CXXFLAGS) $(CXXFLAGS) -c -o google/protobuf/protobuf_lite_arena_test-map_lite_test_util.obj `if test -f 'google/protobuf/map_lite_test_util.cc'; then $(CYGPATH_W) 'google/protobuf/map_lite_test_util.cc'; else $(CYGPATH_W) '$(srcdir)/google/protobuf/map_lite_test_util.cc'; fi` - -google/protobuf/protobuf_lite_arena_test-test_util_lite.o: google/protobuf/test_util_lite.cc -@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(protobuf_lite_arena_test_CPPFLAGS) $(CPPFLAGS) $(protobuf_lite_arena_test_CXXFLAGS) $(CXXFLAGS) -MT google/protobuf/protobuf_lite_arena_test-test_util_lite.o -MD -MP -MF google/protobuf/$(DEPDIR)/protobuf_lite_arena_test-test_util_lite.Tpo -c -o google/protobuf/protobuf_lite_arena_test-test_util_lite.o `test -f 'google/protobuf/test_util_lite.cc' || echo '$(srcdir)/'`google/protobuf/test_util_lite.cc -@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) google/protobuf/$(DEPDIR)/protobuf_lite_arena_test-test_util_lite.Tpo google/protobuf/$(DEPDIR)/protobuf_lite_arena_test-test_util_lite.Po -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='google/protobuf/test_util_lite.cc' object='google/protobuf/protobuf_lite_arena_test-test_util_lite.o' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(protobuf_lite_arena_test_CPPFLAGS) $(CPPFLAGS) $(protobuf_lite_arena_test_CXXFLAGS) $(CXXFLAGS) -c -o google/protobuf/protobuf_lite_arena_test-test_util_lite.o `test -f 'google/protobuf/test_util_lite.cc' || echo '$(srcdir)/'`google/protobuf/test_util_lite.cc - -google/protobuf/protobuf_lite_arena_test-test_util_lite.obj: google/protobuf/test_util_lite.cc -@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(protobuf_lite_arena_test_CPPFLAGS) $(CPPFLAGS) $(protobuf_lite_arena_test_CXXFLAGS) $(CXXFLAGS) -MT google/protobuf/protobuf_lite_arena_test-test_util_lite.obj -MD -MP -MF google/protobuf/$(DEPDIR)/protobuf_lite_arena_test-test_util_lite.Tpo -c -o google/protobuf/protobuf_lite_arena_test-test_util_lite.obj `if test -f 'google/protobuf/test_util_lite.cc'; then $(CYGPATH_W) 'google/protobuf/test_util_lite.cc'; else $(CYGPATH_W) '$(srcdir)/google/protobuf/test_util_lite.cc'; fi` -@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) google/protobuf/$(DEPDIR)/protobuf_lite_arena_test-test_util_lite.Tpo google/protobuf/$(DEPDIR)/protobuf_lite_arena_test-test_util_lite.Po -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='google/protobuf/test_util_lite.cc' object='google/protobuf/protobuf_lite_arena_test-test_util_lite.obj' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(protobuf_lite_arena_test_CPPFLAGS) $(CPPFLAGS) $(protobuf_lite_arena_test_CXXFLAGS) $(CXXFLAGS) -c -o google/protobuf/protobuf_lite_arena_test-test_util_lite.obj `if test -f 'google/protobuf/test_util_lite.cc'; then $(CYGPATH_W) 'google/protobuf/test_util_lite.cc'; else $(CYGPATH_W) '$(srcdir)/google/protobuf/test_util_lite.cc'; fi` - -google/protobuf/protobuf_lite_arena_test-map_lite_unittest.pb.o: google/protobuf/map_lite_unittest.pb.cc -@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(protobuf_lite_arena_test_CPPFLAGS) $(CPPFLAGS) $(protobuf_lite_arena_test_CXXFLAGS) $(CXXFLAGS) -MT google/protobuf/protobuf_lite_arena_test-map_lite_unittest.pb.o -MD -MP -MF google/protobuf/$(DEPDIR)/protobuf_lite_arena_test-map_lite_unittest.pb.Tpo -c -o google/protobuf/protobuf_lite_arena_test-map_lite_unittest.pb.o `test -f 'google/protobuf/map_lite_unittest.pb.cc' || echo '$(srcdir)/'`google/protobuf/map_lite_unittest.pb.cc -@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) google/protobuf/$(DEPDIR)/protobuf_lite_arena_test-map_lite_unittest.pb.Tpo google/protobuf/$(DEPDIR)/protobuf_lite_arena_test-map_lite_unittest.pb.Po -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='google/protobuf/map_lite_unittest.pb.cc' object='google/protobuf/protobuf_lite_arena_test-map_lite_unittest.pb.o' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(protobuf_lite_arena_test_CPPFLAGS) $(CPPFLAGS) $(protobuf_lite_arena_test_CXXFLAGS) $(CXXFLAGS) -c -o google/protobuf/protobuf_lite_arena_test-map_lite_unittest.pb.o `test -f 'google/protobuf/map_lite_unittest.pb.cc' || echo '$(srcdir)/'`google/protobuf/map_lite_unittest.pb.cc - -google/protobuf/protobuf_lite_arena_test-map_lite_unittest.pb.obj: google/protobuf/map_lite_unittest.pb.cc -@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(protobuf_lite_arena_test_CPPFLAGS) $(CPPFLAGS) $(protobuf_lite_arena_test_CXXFLAGS) $(CXXFLAGS) -MT google/protobuf/protobuf_lite_arena_test-map_lite_unittest.pb.obj -MD -MP -MF google/protobuf/$(DEPDIR)/protobuf_lite_arena_test-map_lite_unittest.pb.Tpo -c -o google/protobuf/protobuf_lite_arena_test-map_lite_unittest.pb.obj `if test -f 'google/protobuf/map_lite_unittest.pb.cc'; then $(CYGPATH_W) 'google/protobuf/map_lite_unittest.pb.cc'; else $(CYGPATH_W) '$(srcdir)/google/protobuf/map_lite_unittest.pb.cc'; fi` -@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) google/protobuf/$(DEPDIR)/protobuf_lite_arena_test-map_lite_unittest.pb.Tpo google/protobuf/$(DEPDIR)/protobuf_lite_arena_test-map_lite_unittest.pb.Po -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='google/protobuf/map_lite_unittest.pb.cc' object='google/protobuf/protobuf_lite_arena_test-map_lite_unittest.pb.obj' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(protobuf_lite_arena_test_CPPFLAGS) $(CPPFLAGS) $(protobuf_lite_arena_test_CXXFLAGS) $(CXXFLAGS) -c -o google/protobuf/protobuf_lite_arena_test-map_lite_unittest.pb.obj `if test -f 'google/protobuf/map_lite_unittest.pb.cc'; then $(CYGPATH_W) 'google/protobuf/map_lite_unittest.pb.cc'; else $(CYGPATH_W) '$(srcdir)/google/protobuf/map_lite_unittest.pb.cc'; fi` - -google/protobuf/protobuf_lite_arena_test-unittest_import_lite.pb.o: google/protobuf/unittest_import_lite.pb.cc -@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(protobuf_lite_arena_test_CPPFLAGS) $(CPPFLAGS) $(protobuf_lite_arena_test_CXXFLAGS) $(CXXFLAGS) -MT google/protobuf/protobuf_lite_arena_test-unittest_import_lite.pb.o -MD -MP -MF google/protobuf/$(DEPDIR)/protobuf_lite_arena_test-unittest_import_lite.pb.Tpo -c -o google/protobuf/protobuf_lite_arena_test-unittest_import_lite.pb.o `test -f 'google/protobuf/unittest_import_lite.pb.cc' || echo '$(srcdir)/'`google/protobuf/unittest_import_lite.pb.cc -@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) google/protobuf/$(DEPDIR)/protobuf_lite_arena_test-unittest_import_lite.pb.Tpo google/protobuf/$(DEPDIR)/protobuf_lite_arena_test-unittest_import_lite.pb.Po -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='google/protobuf/unittest_import_lite.pb.cc' object='google/protobuf/protobuf_lite_arena_test-unittest_import_lite.pb.o' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(protobuf_lite_arena_test_CPPFLAGS) $(CPPFLAGS) $(protobuf_lite_arena_test_CXXFLAGS) $(CXXFLAGS) -c -o google/protobuf/protobuf_lite_arena_test-unittest_import_lite.pb.o `test -f 'google/protobuf/unittest_import_lite.pb.cc' || echo '$(srcdir)/'`google/protobuf/unittest_import_lite.pb.cc - -google/protobuf/protobuf_lite_arena_test-unittest_import_lite.pb.obj: google/protobuf/unittest_import_lite.pb.cc -@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(protobuf_lite_arena_test_CPPFLAGS) $(CPPFLAGS) $(protobuf_lite_arena_test_CXXFLAGS) $(CXXFLAGS) -MT google/protobuf/protobuf_lite_arena_test-unittest_import_lite.pb.obj -MD -MP -MF google/protobuf/$(DEPDIR)/protobuf_lite_arena_test-unittest_import_lite.pb.Tpo -c -o google/protobuf/protobuf_lite_arena_test-unittest_import_lite.pb.obj `if test -f 'google/protobuf/unittest_import_lite.pb.cc'; then $(CYGPATH_W) 'google/protobuf/unittest_import_lite.pb.cc'; else $(CYGPATH_W) '$(srcdir)/google/protobuf/unittest_import_lite.pb.cc'; fi` -@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) google/protobuf/$(DEPDIR)/protobuf_lite_arena_test-unittest_import_lite.pb.Tpo google/protobuf/$(DEPDIR)/protobuf_lite_arena_test-unittest_import_lite.pb.Po -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='google/protobuf/unittest_import_lite.pb.cc' object='google/protobuf/protobuf_lite_arena_test-unittest_import_lite.pb.obj' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(protobuf_lite_arena_test_CPPFLAGS) $(CPPFLAGS) $(protobuf_lite_arena_test_CXXFLAGS) $(CXXFLAGS) -c -o google/protobuf/protobuf_lite_arena_test-unittest_import_lite.pb.obj `if test -f 'google/protobuf/unittest_import_lite.pb.cc'; then $(CYGPATH_W) 'google/protobuf/unittest_import_lite.pb.cc'; else $(CYGPATH_W) '$(srcdir)/google/protobuf/unittest_import_lite.pb.cc'; fi` - -google/protobuf/protobuf_lite_arena_test-unittest_import_public_lite.pb.o: google/protobuf/unittest_import_public_lite.pb.cc -@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(protobuf_lite_arena_test_CPPFLAGS) $(CPPFLAGS) $(protobuf_lite_arena_test_CXXFLAGS) $(CXXFLAGS) -MT google/protobuf/protobuf_lite_arena_test-unittest_import_public_lite.pb.o -MD -MP -MF google/protobuf/$(DEPDIR)/protobuf_lite_arena_test-unittest_import_public_lite.pb.Tpo -c -o google/protobuf/protobuf_lite_arena_test-unittest_import_public_lite.pb.o `test -f 'google/protobuf/unittest_import_public_lite.pb.cc' || echo '$(srcdir)/'`google/protobuf/unittest_import_public_lite.pb.cc -@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) google/protobuf/$(DEPDIR)/protobuf_lite_arena_test-unittest_import_public_lite.pb.Tpo google/protobuf/$(DEPDIR)/protobuf_lite_arena_test-unittest_import_public_lite.pb.Po -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='google/protobuf/unittest_import_public_lite.pb.cc' object='google/protobuf/protobuf_lite_arena_test-unittest_import_public_lite.pb.o' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(protobuf_lite_arena_test_CPPFLAGS) $(CPPFLAGS) $(protobuf_lite_arena_test_CXXFLAGS) $(CXXFLAGS) -c -o google/protobuf/protobuf_lite_arena_test-unittest_import_public_lite.pb.o `test -f 'google/protobuf/unittest_import_public_lite.pb.cc' || echo '$(srcdir)/'`google/protobuf/unittest_import_public_lite.pb.cc - -google/protobuf/protobuf_lite_arena_test-unittest_import_public_lite.pb.obj: google/protobuf/unittest_import_public_lite.pb.cc -@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(protobuf_lite_arena_test_CPPFLAGS) $(CPPFLAGS) $(protobuf_lite_arena_test_CXXFLAGS) $(CXXFLAGS) -MT google/protobuf/protobuf_lite_arena_test-unittest_import_public_lite.pb.obj -MD -MP -MF google/protobuf/$(DEPDIR)/protobuf_lite_arena_test-unittest_import_public_lite.pb.Tpo -c -o google/protobuf/protobuf_lite_arena_test-unittest_import_public_lite.pb.obj `if test -f 'google/protobuf/unittest_import_public_lite.pb.cc'; then $(CYGPATH_W) 'google/protobuf/unittest_import_public_lite.pb.cc'; else $(CYGPATH_W) '$(srcdir)/google/protobuf/unittest_import_public_lite.pb.cc'; fi` -@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) google/protobuf/$(DEPDIR)/protobuf_lite_arena_test-unittest_import_public_lite.pb.Tpo google/protobuf/$(DEPDIR)/protobuf_lite_arena_test-unittest_import_public_lite.pb.Po -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='google/protobuf/unittest_import_public_lite.pb.cc' object='google/protobuf/protobuf_lite_arena_test-unittest_import_public_lite.pb.obj' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(protobuf_lite_arena_test_CPPFLAGS) $(CPPFLAGS) $(protobuf_lite_arena_test_CXXFLAGS) $(CXXFLAGS) -c -o google/protobuf/protobuf_lite_arena_test-unittest_import_public_lite.pb.obj `if test -f 'google/protobuf/unittest_import_public_lite.pb.cc'; then $(CYGPATH_W) 'google/protobuf/unittest_import_public_lite.pb.cc'; else $(CYGPATH_W) '$(srcdir)/google/protobuf/unittest_import_public_lite.pb.cc'; fi` - -google/protobuf/protobuf_lite_arena_test-unittest_lite.pb.o: google/protobuf/unittest_lite.pb.cc -@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(protobuf_lite_arena_test_CPPFLAGS) $(CPPFLAGS) $(protobuf_lite_arena_test_CXXFLAGS) $(CXXFLAGS) -MT google/protobuf/protobuf_lite_arena_test-unittest_lite.pb.o -MD -MP -MF google/protobuf/$(DEPDIR)/protobuf_lite_arena_test-unittest_lite.pb.Tpo -c -o google/protobuf/protobuf_lite_arena_test-unittest_lite.pb.o `test -f 'google/protobuf/unittest_lite.pb.cc' || echo '$(srcdir)/'`google/protobuf/unittest_lite.pb.cc -@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) google/protobuf/$(DEPDIR)/protobuf_lite_arena_test-unittest_lite.pb.Tpo google/protobuf/$(DEPDIR)/protobuf_lite_arena_test-unittest_lite.pb.Po -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='google/protobuf/unittest_lite.pb.cc' object='google/protobuf/protobuf_lite_arena_test-unittest_lite.pb.o' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(protobuf_lite_arena_test_CPPFLAGS) $(CPPFLAGS) $(protobuf_lite_arena_test_CXXFLAGS) $(CXXFLAGS) -c -o google/protobuf/protobuf_lite_arena_test-unittest_lite.pb.o `test -f 'google/protobuf/unittest_lite.pb.cc' || echo '$(srcdir)/'`google/protobuf/unittest_lite.pb.cc - -google/protobuf/protobuf_lite_arena_test-unittest_lite.pb.obj: google/protobuf/unittest_lite.pb.cc -@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(protobuf_lite_arena_test_CPPFLAGS) $(CPPFLAGS) $(protobuf_lite_arena_test_CXXFLAGS) $(CXXFLAGS) -MT google/protobuf/protobuf_lite_arena_test-unittest_lite.pb.obj -MD -MP -MF google/protobuf/$(DEPDIR)/protobuf_lite_arena_test-unittest_lite.pb.Tpo -c -o google/protobuf/protobuf_lite_arena_test-unittest_lite.pb.obj `if test -f 'google/protobuf/unittest_lite.pb.cc'; then $(CYGPATH_W) 'google/protobuf/unittest_lite.pb.cc'; else $(CYGPATH_W) '$(srcdir)/google/protobuf/unittest_lite.pb.cc'; fi` -@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) google/protobuf/$(DEPDIR)/protobuf_lite_arena_test-unittest_lite.pb.Tpo google/protobuf/$(DEPDIR)/protobuf_lite_arena_test-unittest_lite.pb.Po -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='google/protobuf/unittest_lite.pb.cc' object='google/protobuf/protobuf_lite_arena_test-unittest_lite.pb.obj' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(protobuf_lite_arena_test_CPPFLAGS) $(CPPFLAGS) $(protobuf_lite_arena_test_CXXFLAGS) $(CXXFLAGS) -c -o google/protobuf/protobuf_lite_arena_test-unittest_lite.pb.obj `if test -f 'google/protobuf/unittest_lite.pb.cc'; then $(CYGPATH_W) 'google/protobuf/unittest_lite.pb.cc'; else $(CYGPATH_W) '$(srcdir)/google/protobuf/unittest_lite.pb.cc'; fi` - -google/protobuf/protobuf_lite_test-lite_unittest.o: google/protobuf/lite_unittest.cc -@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(protobuf_lite_test_CPPFLAGS) $(CPPFLAGS) $(protobuf_lite_test_CXXFLAGS) $(CXXFLAGS) -MT google/protobuf/protobuf_lite_test-lite_unittest.o -MD -MP -MF google/protobuf/$(DEPDIR)/protobuf_lite_test-lite_unittest.Tpo -c -o google/protobuf/protobuf_lite_test-lite_unittest.o `test -f 'google/protobuf/lite_unittest.cc' || echo '$(srcdir)/'`google/protobuf/lite_unittest.cc -@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) google/protobuf/$(DEPDIR)/protobuf_lite_test-lite_unittest.Tpo google/protobuf/$(DEPDIR)/protobuf_lite_test-lite_unittest.Po -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='google/protobuf/lite_unittest.cc' object='google/protobuf/protobuf_lite_test-lite_unittest.o' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(protobuf_lite_test_CPPFLAGS) $(CPPFLAGS) $(protobuf_lite_test_CXXFLAGS) $(CXXFLAGS) -c -o google/protobuf/protobuf_lite_test-lite_unittest.o `test -f 'google/protobuf/lite_unittest.cc' || echo '$(srcdir)/'`google/protobuf/lite_unittest.cc - -google/protobuf/protobuf_lite_test-lite_unittest.obj: google/protobuf/lite_unittest.cc -@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(protobuf_lite_test_CPPFLAGS) $(CPPFLAGS) $(protobuf_lite_test_CXXFLAGS) $(CXXFLAGS) -MT google/protobuf/protobuf_lite_test-lite_unittest.obj -MD -MP -MF google/protobuf/$(DEPDIR)/protobuf_lite_test-lite_unittest.Tpo -c -o google/protobuf/protobuf_lite_test-lite_unittest.obj `if test -f 'google/protobuf/lite_unittest.cc'; then $(CYGPATH_W) 'google/protobuf/lite_unittest.cc'; else $(CYGPATH_W) '$(srcdir)/google/protobuf/lite_unittest.cc'; fi` -@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) google/protobuf/$(DEPDIR)/protobuf_lite_test-lite_unittest.Tpo google/protobuf/$(DEPDIR)/protobuf_lite_test-lite_unittest.Po -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='google/protobuf/lite_unittest.cc' object='google/protobuf/protobuf_lite_test-lite_unittest.obj' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(protobuf_lite_test_CPPFLAGS) $(CPPFLAGS) $(protobuf_lite_test_CXXFLAGS) $(CXXFLAGS) -c -o google/protobuf/protobuf_lite_test-lite_unittest.obj `if test -f 'google/protobuf/lite_unittest.cc'; then $(CYGPATH_W) 'google/protobuf/lite_unittest.cc'; else $(CYGPATH_W) '$(srcdir)/google/protobuf/lite_unittest.cc'; fi` - -google/protobuf/protobuf_lite_test-arena_test_util.o: google/protobuf/arena_test_util.cc -@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(protobuf_lite_test_CPPFLAGS) $(CPPFLAGS) $(protobuf_lite_test_CXXFLAGS) $(CXXFLAGS) -MT google/protobuf/protobuf_lite_test-arena_test_util.o -MD -MP -MF google/protobuf/$(DEPDIR)/protobuf_lite_test-arena_test_util.Tpo -c -o google/protobuf/protobuf_lite_test-arena_test_util.o `test -f 'google/protobuf/arena_test_util.cc' || echo '$(srcdir)/'`google/protobuf/arena_test_util.cc -@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) google/protobuf/$(DEPDIR)/protobuf_lite_test-arena_test_util.Tpo google/protobuf/$(DEPDIR)/protobuf_lite_test-arena_test_util.Po -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='google/protobuf/arena_test_util.cc' object='google/protobuf/protobuf_lite_test-arena_test_util.o' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(protobuf_lite_test_CPPFLAGS) $(CPPFLAGS) $(protobuf_lite_test_CXXFLAGS) $(CXXFLAGS) -c -o google/protobuf/protobuf_lite_test-arena_test_util.o `test -f 'google/protobuf/arena_test_util.cc' || echo '$(srcdir)/'`google/protobuf/arena_test_util.cc - -google/protobuf/protobuf_lite_test-arena_test_util.obj: google/protobuf/arena_test_util.cc -@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(protobuf_lite_test_CPPFLAGS) $(CPPFLAGS) $(protobuf_lite_test_CXXFLAGS) $(CXXFLAGS) -MT google/protobuf/protobuf_lite_test-arena_test_util.obj -MD -MP -MF google/protobuf/$(DEPDIR)/protobuf_lite_test-arena_test_util.Tpo -c -o google/protobuf/protobuf_lite_test-arena_test_util.obj `if test -f 'google/protobuf/arena_test_util.cc'; then $(CYGPATH_W) 'google/protobuf/arena_test_util.cc'; else $(CYGPATH_W) '$(srcdir)/google/protobuf/arena_test_util.cc'; fi` -@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) google/protobuf/$(DEPDIR)/protobuf_lite_test-arena_test_util.Tpo google/protobuf/$(DEPDIR)/protobuf_lite_test-arena_test_util.Po -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='google/protobuf/arena_test_util.cc' object='google/protobuf/protobuf_lite_test-arena_test_util.obj' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(protobuf_lite_test_CPPFLAGS) $(CPPFLAGS) $(protobuf_lite_test_CXXFLAGS) $(CXXFLAGS) -c -o google/protobuf/protobuf_lite_test-arena_test_util.obj `if test -f 'google/protobuf/arena_test_util.cc'; then $(CYGPATH_W) 'google/protobuf/arena_test_util.cc'; else $(CYGPATH_W) '$(srcdir)/google/protobuf/arena_test_util.cc'; fi` - -google/protobuf/protobuf_lite_test-map_lite_test_util.o: google/protobuf/map_lite_test_util.cc -@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(protobuf_lite_test_CPPFLAGS) $(CPPFLAGS) $(protobuf_lite_test_CXXFLAGS) $(CXXFLAGS) -MT google/protobuf/protobuf_lite_test-map_lite_test_util.o -MD -MP -MF google/protobuf/$(DEPDIR)/protobuf_lite_test-map_lite_test_util.Tpo -c -o google/protobuf/protobuf_lite_test-map_lite_test_util.o `test -f 'google/protobuf/map_lite_test_util.cc' || echo '$(srcdir)/'`google/protobuf/map_lite_test_util.cc -@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) google/protobuf/$(DEPDIR)/protobuf_lite_test-map_lite_test_util.Tpo google/protobuf/$(DEPDIR)/protobuf_lite_test-map_lite_test_util.Po -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='google/protobuf/map_lite_test_util.cc' object='google/protobuf/protobuf_lite_test-map_lite_test_util.o' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(protobuf_lite_test_CPPFLAGS) $(CPPFLAGS) $(protobuf_lite_test_CXXFLAGS) $(CXXFLAGS) -c -o google/protobuf/protobuf_lite_test-map_lite_test_util.o `test -f 'google/protobuf/map_lite_test_util.cc' || echo '$(srcdir)/'`google/protobuf/map_lite_test_util.cc - -google/protobuf/protobuf_lite_test-map_lite_test_util.obj: google/protobuf/map_lite_test_util.cc -@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(protobuf_lite_test_CPPFLAGS) $(CPPFLAGS) $(protobuf_lite_test_CXXFLAGS) $(CXXFLAGS) -MT google/protobuf/protobuf_lite_test-map_lite_test_util.obj -MD -MP -MF google/protobuf/$(DEPDIR)/protobuf_lite_test-map_lite_test_util.Tpo -c -o google/protobuf/protobuf_lite_test-map_lite_test_util.obj `if test -f 'google/protobuf/map_lite_test_util.cc'; then $(CYGPATH_W) 'google/protobuf/map_lite_test_util.cc'; else $(CYGPATH_W) '$(srcdir)/google/protobuf/map_lite_test_util.cc'; fi` -@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) google/protobuf/$(DEPDIR)/protobuf_lite_test-map_lite_test_util.Tpo google/protobuf/$(DEPDIR)/protobuf_lite_test-map_lite_test_util.Po -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='google/protobuf/map_lite_test_util.cc' object='google/protobuf/protobuf_lite_test-map_lite_test_util.obj' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(protobuf_lite_test_CPPFLAGS) $(CPPFLAGS) $(protobuf_lite_test_CXXFLAGS) $(CXXFLAGS) -c -o google/protobuf/protobuf_lite_test-map_lite_test_util.obj `if test -f 'google/protobuf/map_lite_test_util.cc'; then $(CYGPATH_W) 'google/protobuf/map_lite_test_util.cc'; else $(CYGPATH_W) '$(srcdir)/google/protobuf/map_lite_test_util.cc'; fi` - -google/protobuf/protobuf_lite_test-test_util_lite.o: google/protobuf/test_util_lite.cc -@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(protobuf_lite_test_CPPFLAGS) $(CPPFLAGS) $(protobuf_lite_test_CXXFLAGS) $(CXXFLAGS) -MT google/protobuf/protobuf_lite_test-test_util_lite.o -MD -MP -MF google/protobuf/$(DEPDIR)/protobuf_lite_test-test_util_lite.Tpo -c -o google/protobuf/protobuf_lite_test-test_util_lite.o `test -f 'google/protobuf/test_util_lite.cc' || echo '$(srcdir)/'`google/protobuf/test_util_lite.cc -@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) google/protobuf/$(DEPDIR)/protobuf_lite_test-test_util_lite.Tpo google/protobuf/$(DEPDIR)/protobuf_lite_test-test_util_lite.Po -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='google/protobuf/test_util_lite.cc' object='google/protobuf/protobuf_lite_test-test_util_lite.o' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(protobuf_lite_test_CPPFLAGS) $(CPPFLAGS) $(protobuf_lite_test_CXXFLAGS) $(CXXFLAGS) -c -o google/protobuf/protobuf_lite_test-test_util_lite.o `test -f 'google/protobuf/test_util_lite.cc' || echo '$(srcdir)/'`google/protobuf/test_util_lite.cc - -google/protobuf/protobuf_lite_test-test_util_lite.obj: google/protobuf/test_util_lite.cc -@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(protobuf_lite_test_CPPFLAGS) $(CPPFLAGS) $(protobuf_lite_test_CXXFLAGS) $(CXXFLAGS) -MT google/protobuf/protobuf_lite_test-test_util_lite.obj -MD -MP -MF google/protobuf/$(DEPDIR)/protobuf_lite_test-test_util_lite.Tpo -c -o google/protobuf/protobuf_lite_test-test_util_lite.obj `if test -f 'google/protobuf/test_util_lite.cc'; then $(CYGPATH_W) 'google/protobuf/test_util_lite.cc'; else $(CYGPATH_W) '$(srcdir)/google/protobuf/test_util_lite.cc'; fi` -@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) google/protobuf/$(DEPDIR)/protobuf_lite_test-test_util_lite.Tpo google/protobuf/$(DEPDIR)/protobuf_lite_test-test_util_lite.Po -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='google/protobuf/test_util_lite.cc' object='google/protobuf/protobuf_lite_test-test_util_lite.obj' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(protobuf_lite_test_CPPFLAGS) $(CPPFLAGS) $(protobuf_lite_test_CXXFLAGS) $(CXXFLAGS) -c -o google/protobuf/protobuf_lite_test-test_util_lite.obj `if test -f 'google/protobuf/test_util_lite.cc'; then $(CYGPATH_W) 'google/protobuf/test_util_lite.cc'; else $(CYGPATH_W) '$(srcdir)/google/protobuf/test_util_lite.cc'; fi` - -google/protobuf/protobuf_lite_test-map_lite_unittest.pb.o: google/protobuf/map_lite_unittest.pb.cc -@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(protobuf_lite_test_CPPFLAGS) $(CPPFLAGS) $(protobuf_lite_test_CXXFLAGS) $(CXXFLAGS) -MT google/protobuf/protobuf_lite_test-map_lite_unittest.pb.o -MD -MP -MF google/protobuf/$(DEPDIR)/protobuf_lite_test-map_lite_unittest.pb.Tpo -c -o google/protobuf/protobuf_lite_test-map_lite_unittest.pb.o `test -f 'google/protobuf/map_lite_unittest.pb.cc' || echo '$(srcdir)/'`google/protobuf/map_lite_unittest.pb.cc -@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) google/protobuf/$(DEPDIR)/protobuf_lite_test-map_lite_unittest.pb.Tpo google/protobuf/$(DEPDIR)/protobuf_lite_test-map_lite_unittest.pb.Po -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='google/protobuf/map_lite_unittest.pb.cc' object='google/protobuf/protobuf_lite_test-map_lite_unittest.pb.o' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(protobuf_lite_test_CPPFLAGS) $(CPPFLAGS) $(protobuf_lite_test_CXXFLAGS) $(CXXFLAGS) -c -o google/protobuf/protobuf_lite_test-map_lite_unittest.pb.o `test -f 'google/protobuf/map_lite_unittest.pb.cc' || echo '$(srcdir)/'`google/protobuf/map_lite_unittest.pb.cc - -google/protobuf/protobuf_lite_test-map_lite_unittest.pb.obj: google/protobuf/map_lite_unittest.pb.cc -@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(protobuf_lite_test_CPPFLAGS) $(CPPFLAGS) $(protobuf_lite_test_CXXFLAGS) $(CXXFLAGS) -MT google/protobuf/protobuf_lite_test-map_lite_unittest.pb.obj -MD -MP -MF google/protobuf/$(DEPDIR)/protobuf_lite_test-map_lite_unittest.pb.Tpo -c -o google/protobuf/protobuf_lite_test-map_lite_unittest.pb.obj `if test -f 'google/protobuf/map_lite_unittest.pb.cc'; then $(CYGPATH_W) 'google/protobuf/map_lite_unittest.pb.cc'; else $(CYGPATH_W) '$(srcdir)/google/protobuf/map_lite_unittest.pb.cc'; fi` -@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) google/protobuf/$(DEPDIR)/protobuf_lite_test-map_lite_unittest.pb.Tpo google/protobuf/$(DEPDIR)/protobuf_lite_test-map_lite_unittest.pb.Po -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='google/protobuf/map_lite_unittest.pb.cc' object='google/protobuf/protobuf_lite_test-map_lite_unittest.pb.obj' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(protobuf_lite_test_CPPFLAGS) $(CPPFLAGS) $(protobuf_lite_test_CXXFLAGS) $(CXXFLAGS) -c -o google/protobuf/protobuf_lite_test-map_lite_unittest.pb.obj `if test -f 'google/protobuf/map_lite_unittest.pb.cc'; then $(CYGPATH_W) 'google/protobuf/map_lite_unittest.pb.cc'; else $(CYGPATH_W) '$(srcdir)/google/protobuf/map_lite_unittest.pb.cc'; fi` - -google/protobuf/protobuf_lite_test-unittest_import_lite.pb.o: google/protobuf/unittest_import_lite.pb.cc -@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(protobuf_lite_test_CPPFLAGS) $(CPPFLAGS) $(protobuf_lite_test_CXXFLAGS) $(CXXFLAGS) -MT google/protobuf/protobuf_lite_test-unittest_import_lite.pb.o -MD -MP -MF google/protobuf/$(DEPDIR)/protobuf_lite_test-unittest_import_lite.pb.Tpo -c -o google/protobuf/protobuf_lite_test-unittest_import_lite.pb.o `test -f 'google/protobuf/unittest_import_lite.pb.cc' || echo '$(srcdir)/'`google/protobuf/unittest_import_lite.pb.cc -@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) google/protobuf/$(DEPDIR)/protobuf_lite_test-unittest_import_lite.pb.Tpo google/protobuf/$(DEPDIR)/protobuf_lite_test-unittest_import_lite.pb.Po -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='google/protobuf/unittest_import_lite.pb.cc' object='google/protobuf/protobuf_lite_test-unittest_import_lite.pb.o' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(protobuf_lite_test_CPPFLAGS) $(CPPFLAGS) $(protobuf_lite_test_CXXFLAGS) $(CXXFLAGS) -c -o google/protobuf/protobuf_lite_test-unittest_import_lite.pb.o `test -f 'google/protobuf/unittest_import_lite.pb.cc' || echo '$(srcdir)/'`google/protobuf/unittest_import_lite.pb.cc - -google/protobuf/protobuf_lite_test-unittest_import_lite.pb.obj: google/protobuf/unittest_import_lite.pb.cc -@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(protobuf_lite_test_CPPFLAGS) $(CPPFLAGS) $(protobuf_lite_test_CXXFLAGS) $(CXXFLAGS) -MT google/protobuf/protobuf_lite_test-unittest_import_lite.pb.obj -MD -MP -MF google/protobuf/$(DEPDIR)/protobuf_lite_test-unittest_import_lite.pb.Tpo -c -o google/protobuf/protobuf_lite_test-unittest_import_lite.pb.obj `if test -f 'google/protobuf/unittest_import_lite.pb.cc'; then $(CYGPATH_W) 'google/protobuf/unittest_import_lite.pb.cc'; else $(CYGPATH_W) '$(srcdir)/google/protobuf/unittest_import_lite.pb.cc'; fi` -@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) google/protobuf/$(DEPDIR)/protobuf_lite_test-unittest_import_lite.pb.Tpo google/protobuf/$(DEPDIR)/protobuf_lite_test-unittest_import_lite.pb.Po -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='google/protobuf/unittest_import_lite.pb.cc' object='google/protobuf/protobuf_lite_test-unittest_import_lite.pb.obj' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(protobuf_lite_test_CPPFLAGS) $(CPPFLAGS) $(protobuf_lite_test_CXXFLAGS) $(CXXFLAGS) -c -o google/protobuf/protobuf_lite_test-unittest_import_lite.pb.obj `if test -f 'google/protobuf/unittest_import_lite.pb.cc'; then $(CYGPATH_W) 'google/protobuf/unittest_import_lite.pb.cc'; else $(CYGPATH_W) '$(srcdir)/google/protobuf/unittest_import_lite.pb.cc'; fi` - -google/protobuf/protobuf_lite_test-unittest_import_public_lite.pb.o: google/protobuf/unittest_import_public_lite.pb.cc -@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(protobuf_lite_test_CPPFLAGS) $(CPPFLAGS) $(protobuf_lite_test_CXXFLAGS) $(CXXFLAGS) -MT google/protobuf/protobuf_lite_test-unittest_import_public_lite.pb.o -MD -MP -MF google/protobuf/$(DEPDIR)/protobuf_lite_test-unittest_import_public_lite.pb.Tpo -c -o google/protobuf/protobuf_lite_test-unittest_import_public_lite.pb.o `test -f 'google/protobuf/unittest_import_public_lite.pb.cc' || echo '$(srcdir)/'`google/protobuf/unittest_import_public_lite.pb.cc -@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) google/protobuf/$(DEPDIR)/protobuf_lite_test-unittest_import_public_lite.pb.Tpo google/protobuf/$(DEPDIR)/protobuf_lite_test-unittest_import_public_lite.pb.Po -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='google/protobuf/unittest_import_public_lite.pb.cc' object='google/protobuf/protobuf_lite_test-unittest_import_public_lite.pb.o' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(protobuf_lite_test_CPPFLAGS) $(CPPFLAGS) $(protobuf_lite_test_CXXFLAGS) $(CXXFLAGS) -c -o google/protobuf/protobuf_lite_test-unittest_import_public_lite.pb.o `test -f 'google/protobuf/unittest_import_public_lite.pb.cc' || echo '$(srcdir)/'`google/protobuf/unittest_import_public_lite.pb.cc - -google/protobuf/protobuf_lite_test-unittest_import_public_lite.pb.obj: google/protobuf/unittest_import_public_lite.pb.cc -@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(protobuf_lite_test_CPPFLAGS) $(CPPFLAGS) $(protobuf_lite_test_CXXFLAGS) $(CXXFLAGS) -MT google/protobuf/protobuf_lite_test-unittest_import_public_lite.pb.obj -MD -MP -MF google/protobuf/$(DEPDIR)/protobuf_lite_test-unittest_import_public_lite.pb.Tpo -c -o google/protobuf/protobuf_lite_test-unittest_import_public_lite.pb.obj `if test -f 'google/protobuf/unittest_import_public_lite.pb.cc'; then $(CYGPATH_W) 'google/protobuf/unittest_import_public_lite.pb.cc'; else $(CYGPATH_W) '$(srcdir)/google/protobuf/unittest_import_public_lite.pb.cc'; fi` -@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) google/protobuf/$(DEPDIR)/protobuf_lite_test-unittest_import_public_lite.pb.Tpo google/protobuf/$(DEPDIR)/protobuf_lite_test-unittest_import_public_lite.pb.Po -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='google/protobuf/unittest_import_public_lite.pb.cc' object='google/protobuf/protobuf_lite_test-unittest_import_public_lite.pb.obj' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(protobuf_lite_test_CPPFLAGS) $(CPPFLAGS) $(protobuf_lite_test_CXXFLAGS) $(CXXFLAGS) -c -o google/protobuf/protobuf_lite_test-unittest_import_public_lite.pb.obj `if test -f 'google/protobuf/unittest_import_public_lite.pb.cc'; then $(CYGPATH_W) 'google/protobuf/unittest_import_public_lite.pb.cc'; else $(CYGPATH_W) '$(srcdir)/google/protobuf/unittest_import_public_lite.pb.cc'; fi` - -google/protobuf/protobuf_lite_test-unittest_lite.pb.o: google/protobuf/unittest_lite.pb.cc -@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(protobuf_lite_test_CPPFLAGS) $(CPPFLAGS) $(protobuf_lite_test_CXXFLAGS) $(CXXFLAGS) -MT google/protobuf/protobuf_lite_test-unittest_lite.pb.o -MD -MP -MF google/protobuf/$(DEPDIR)/protobuf_lite_test-unittest_lite.pb.Tpo -c -o google/protobuf/protobuf_lite_test-unittest_lite.pb.o `test -f 'google/protobuf/unittest_lite.pb.cc' || echo '$(srcdir)/'`google/protobuf/unittest_lite.pb.cc -@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) google/protobuf/$(DEPDIR)/protobuf_lite_test-unittest_lite.pb.Tpo google/protobuf/$(DEPDIR)/protobuf_lite_test-unittest_lite.pb.Po -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='google/protobuf/unittest_lite.pb.cc' object='google/protobuf/protobuf_lite_test-unittest_lite.pb.o' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(protobuf_lite_test_CPPFLAGS) $(CPPFLAGS) $(protobuf_lite_test_CXXFLAGS) $(CXXFLAGS) -c -o google/protobuf/protobuf_lite_test-unittest_lite.pb.o `test -f 'google/protobuf/unittest_lite.pb.cc' || echo '$(srcdir)/'`google/protobuf/unittest_lite.pb.cc - -google/protobuf/protobuf_lite_test-unittest_lite.pb.obj: google/protobuf/unittest_lite.pb.cc -@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(protobuf_lite_test_CPPFLAGS) $(CPPFLAGS) $(protobuf_lite_test_CXXFLAGS) $(CXXFLAGS) -MT google/protobuf/protobuf_lite_test-unittest_lite.pb.obj -MD -MP -MF google/protobuf/$(DEPDIR)/protobuf_lite_test-unittest_lite.pb.Tpo -c -o google/protobuf/protobuf_lite_test-unittest_lite.pb.obj `if test -f 'google/protobuf/unittest_lite.pb.cc'; then $(CYGPATH_W) 'google/protobuf/unittest_lite.pb.cc'; else $(CYGPATH_W) '$(srcdir)/google/protobuf/unittest_lite.pb.cc'; fi` -@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) google/protobuf/$(DEPDIR)/protobuf_lite_test-unittest_lite.pb.Tpo google/protobuf/$(DEPDIR)/protobuf_lite_test-unittest_lite.pb.Po -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='google/protobuf/unittest_lite.pb.cc' object='google/protobuf/protobuf_lite_test-unittest_lite.pb.obj' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(protobuf_lite_test_CPPFLAGS) $(CPPFLAGS) $(protobuf_lite_test_CXXFLAGS) $(CXXFLAGS) -c -o google/protobuf/protobuf_lite_test-unittest_lite.pb.obj `if test -f 'google/protobuf/unittest_lite.pb.cc'; then $(CYGPATH_W) 'google/protobuf/unittest_lite.pb.cc'; else $(CYGPATH_W) '$(srcdir)/google/protobuf/unittest_lite.pb.cc'; fi` - -google/protobuf/protobuf_test-arena_test_util.o: google/protobuf/arena_test_util.cc -@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(protobuf_test_CPPFLAGS) $(CPPFLAGS) $(protobuf_test_CXXFLAGS) $(CXXFLAGS) -MT google/protobuf/protobuf_test-arena_test_util.o -MD -MP -MF google/protobuf/$(DEPDIR)/protobuf_test-arena_test_util.Tpo -c -o google/protobuf/protobuf_test-arena_test_util.o `test -f 'google/protobuf/arena_test_util.cc' || echo '$(srcdir)/'`google/protobuf/arena_test_util.cc -@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) google/protobuf/$(DEPDIR)/protobuf_test-arena_test_util.Tpo google/protobuf/$(DEPDIR)/protobuf_test-arena_test_util.Po -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='google/protobuf/arena_test_util.cc' object='google/protobuf/protobuf_test-arena_test_util.o' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(protobuf_test_CPPFLAGS) $(CPPFLAGS) $(protobuf_test_CXXFLAGS) $(CXXFLAGS) -c -o google/protobuf/protobuf_test-arena_test_util.o `test -f 'google/protobuf/arena_test_util.cc' || echo '$(srcdir)/'`google/protobuf/arena_test_util.cc - -google/protobuf/protobuf_test-arena_test_util.obj: google/protobuf/arena_test_util.cc -@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(protobuf_test_CPPFLAGS) $(CPPFLAGS) $(protobuf_test_CXXFLAGS) $(CXXFLAGS) -MT google/protobuf/protobuf_test-arena_test_util.obj -MD -MP -MF google/protobuf/$(DEPDIR)/protobuf_test-arena_test_util.Tpo -c -o google/protobuf/protobuf_test-arena_test_util.obj `if test -f 'google/protobuf/arena_test_util.cc'; then $(CYGPATH_W) 'google/protobuf/arena_test_util.cc'; else $(CYGPATH_W) '$(srcdir)/google/protobuf/arena_test_util.cc'; fi` -@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) google/protobuf/$(DEPDIR)/protobuf_test-arena_test_util.Tpo google/protobuf/$(DEPDIR)/protobuf_test-arena_test_util.Po -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='google/protobuf/arena_test_util.cc' object='google/protobuf/protobuf_test-arena_test_util.obj' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(protobuf_test_CPPFLAGS) $(CPPFLAGS) $(protobuf_test_CXXFLAGS) $(CXXFLAGS) -c -o google/protobuf/protobuf_test-arena_test_util.obj `if test -f 'google/protobuf/arena_test_util.cc'; then $(CYGPATH_W) 'google/protobuf/arena_test_util.cc'; else $(CYGPATH_W) '$(srcdir)/google/protobuf/arena_test_util.cc'; fi` - -google/protobuf/protobuf_test-map_lite_test_util.o: google/protobuf/map_lite_test_util.cc -@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(protobuf_test_CPPFLAGS) $(CPPFLAGS) $(protobuf_test_CXXFLAGS) $(CXXFLAGS) -MT google/protobuf/protobuf_test-map_lite_test_util.o -MD -MP -MF google/protobuf/$(DEPDIR)/protobuf_test-map_lite_test_util.Tpo -c -o google/protobuf/protobuf_test-map_lite_test_util.o `test -f 'google/protobuf/map_lite_test_util.cc' || echo '$(srcdir)/'`google/protobuf/map_lite_test_util.cc -@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) google/protobuf/$(DEPDIR)/protobuf_test-map_lite_test_util.Tpo google/protobuf/$(DEPDIR)/protobuf_test-map_lite_test_util.Po -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='google/protobuf/map_lite_test_util.cc' object='google/protobuf/protobuf_test-map_lite_test_util.o' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(protobuf_test_CPPFLAGS) $(CPPFLAGS) $(protobuf_test_CXXFLAGS) $(CXXFLAGS) -c -o google/protobuf/protobuf_test-map_lite_test_util.o `test -f 'google/protobuf/map_lite_test_util.cc' || echo '$(srcdir)/'`google/protobuf/map_lite_test_util.cc - -google/protobuf/protobuf_test-map_lite_test_util.obj: google/protobuf/map_lite_test_util.cc -@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(protobuf_test_CPPFLAGS) $(CPPFLAGS) $(protobuf_test_CXXFLAGS) $(CXXFLAGS) -MT google/protobuf/protobuf_test-map_lite_test_util.obj -MD -MP -MF google/protobuf/$(DEPDIR)/protobuf_test-map_lite_test_util.Tpo -c -o google/protobuf/protobuf_test-map_lite_test_util.obj `if test -f 'google/protobuf/map_lite_test_util.cc'; then $(CYGPATH_W) 'google/protobuf/map_lite_test_util.cc'; else $(CYGPATH_W) '$(srcdir)/google/protobuf/map_lite_test_util.cc'; fi` -@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) google/protobuf/$(DEPDIR)/protobuf_test-map_lite_test_util.Tpo google/protobuf/$(DEPDIR)/protobuf_test-map_lite_test_util.Po -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='google/protobuf/map_lite_test_util.cc' object='google/protobuf/protobuf_test-map_lite_test_util.obj' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(protobuf_test_CPPFLAGS) $(CPPFLAGS) $(protobuf_test_CXXFLAGS) $(CXXFLAGS) -c -o google/protobuf/protobuf_test-map_lite_test_util.obj `if test -f 'google/protobuf/map_lite_test_util.cc'; then $(CYGPATH_W) 'google/protobuf/map_lite_test_util.cc'; else $(CYGPATH_W) '$(srcdir)/google/protobuf/map_lite_test_util.cc'; fi` - -google/protobuf/protobuf_test-test_util_lite.o: google/protobuf/test_util_lite.cc -@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(protobuf_test_CPPFLAGS) $(CPPFLAGS) $(protobuf_test_CXXFLAGS) $(CXXFLAGS) -MT google/protobuf/protobuf_test-test_util_lite.o -MD -MP -MF google/protobuf/$(DEPDIR)/protobuf_test-test_util_lite.Tpo -c -o google/protobuf/protobuf_test-test_util_lite.o `test -f 'google/protobuf/test_util_lite.cc' || echo '$(srcdir)/'`google/protobuf/test_util_lite.cc -@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) google/protobuf/$(DEPDIR)/protobuf_test-test_util_lite.Tpo google/protobuf/$(DEPDIR)/protobuf_test-test_util_lite.Po -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='google/protobuf/test_util_lite.cc' object='google/protobuf/protobuf_test-test_util_lite.o' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(protobuf_test_CPPFLAGS) $(CPPFLAGS) $(protobuf_test_CXXFLAGS) $(CXXFLAGS) -c -o google/protobuf/protobuf_test-test_util_lite.o `test -f 'google/protobuf/test_util_lite.cc' || echo '$(srcdir)/'`google/protobuf/test_util_lite.cc - -google/protobuf/protobuf_test-test_util_lite.obj: google/protobuf/test_util_lite.cc -@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(protobuf_test_CPPFLAGS) $(CPPFLAGS) $(protobuf_test_CXXFLAGS) $(CXXFLAGS) -MT google/protobuf/protobuf_test-test_util_lite.obj -MD -MP -MF google/protobuf/$(DEPDIR)/protobuf_test-test_util_lite.Tpo -c -o google/protobuf/protobuf_test-test_util_lite.obj `if test -f 'google/protobuf/test_util_lite.cc'; then $(CYGPATH_W) 'google/protobuf/test_util_lite.cc'; else $(CYGPATH_W) '$(srcdir)/google/protobuf/test_util_lite.cc'; fi` -@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) google/protobuf/$(DEPDIR)/protobuf_test-test_util_lite.Tpo google/protobuf/$(DEPDIR)/protobuf_test-test_util_lite.Po -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='google/protobuf/test_util_lite.cc' object='google/protobuf/protobuf_test-test_util_lite.obj' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(protobuf_test_CPPFLAGS) $(CPPFLAGS) $(protobuf_test_CXXFLAGS) $(CXXFLAGS) -c -o google/protobuf/protobuf_test-test_util_lite.obj `if test -f 'google/protobuf/test_util_lite.cc'; then $(CYGPATH_W) 'google/protobuf/test_util_lite.cc'; else $(CYGPATH_W) '$(srcdir)/google/protobuf/test_util_lite.cc'; fi` - -google/protobuf/protobuf_test-reflection_tester.o: google/protobuf/reflection_tester.cc -@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(protobuf_test_CPPFLAGS) $(CPPFLAGS) $(protobuf_test_CXXFLAGS) $(CXXFLAGS) -MT google/protobuf/protobuf_test-reflection_tester.o -MD -MP -MF google/protobuf/$(DEPDIR)/protobuf_test-reflection_tester.Tpo -c -o google/protobuf/protobuf_test-reflection_tester.o `test -f 'google/protobuf/reflection_tester.cc' || echo '$(srcdir)/'`google/protobuf/reflection_tester.cc -@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) google/protobuf/$(DEPDIR)/protobuf_test-reflection_tester.Tpo google/protobuf/$(DEPDIR)/protobuf_test-reflection_tester.Po -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='google/protobuf/reflection_tester.cc' object='google/protobuf/protobuf_test-reflection_tester.o' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(protobuf_test_CPPFLAGS) $(CPPFLAGS) $(protobuf_test_CXXFLAGS) $(CXXFLAGS) -c -o google/protobuf/protobuf_test-reflection_tester.o `test -f 'google/protobuf/reflection_tester.cc' || echo '$(srcdir)/'`google/protobuf/reflection_tester.cc - -google/protobuf/protobuf_test-reflection_tester.obj: google/protobuf/reflection_tester.cc -@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(protobuf_test_CPPFLAGS) $(CPPFLAGS) $(protobuf_test_CXXFLAGS) $(CXXFLAGS) -MT google/protobuf/protobuf_test-reflection_tester.obj -MD -MP -MF google/protobuf/$(DEPDIR)/protobuf_test-reflection_tester.Tpo -c -o google/protobuf/protobuf_test-reflection_tester.obj `if test -f 'google/protobuf/reflection_tester.cc'; then $(CYGPATH_W) 'google/protobuf/reflection_tester.cc'; else $(CYGPATH_W) '$(srcdir)/google/protobuf/reflection_tester.cc'; fi` -@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) google/protobuf/$(DEPDIR)/protobuf_test-reflection_tester.Tpo google/protobuf/$(DEPDIR)/protobuf_test-reflection_tester.Po -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='google/protobuf/reflection_tester.cc' object='google/protobuf/protobuf_test-reflection_tester.obj' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(protobuf_test_CPPFLAGS) $(CPPFLAGS) $(protobuf_test_CXXFLAGS) $(CXXFLAGS) -c -o google/protobuf/protobuf_test-reflection_tester.obj `if test -f 'google/protobuf/reflection_tester.cc'; then $(CYGPATH_W) 'google/protobuf/reflection_tester.cc'; else $(CYGPATH_W) '$(srcdir)/google/protobuf/reflection_tester.cc'; fi` - -google/protobuf/protobuf_test-test_util.o: google/protobuf/test_util.cc -@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(protobuf_test_CPPFLAGS) $(CPPFLAGS) $(protobuf_test_CXXFLAGS) $(CXXFLAGS) -MT google/protobuf/protobuf_test-test_util.o -MD -MP -MF google/protobuf/$(DEPDIR)/protobuf_test-test_util.Tpo -c -o google/protobuf/protobuf_test-test_util.o `test -f 'google/protobuf/test_util.cc' || echo '$(srcdir)/'`google/protobuf/test_util.cc -@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) google/protobuf/$(DEPDIR)/protobuf_test-test_util.Tpo google/protobuf/$(DEPDIR)/protobuf_test-test_util.Po -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='google/protobuf/test_util.cc' object='google/protobuf/protobuf_test-test_util.o' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(protobuf_test_CPPFLAGS) $(CPPFLAGS) $(protobuf_test_CXXFLAGS) $(CXXFLAGS) -c -o google/protobuf/protobuf_test-test_util.o `test -f 'google/protobuf/test_util.cc' || echo '$(srcdir)/'`google/protobuf/test_util.cc - -google/protobuf/protobuf_test-test_util.obj: google/protobuf/test_util.cc -@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(protobuf_test_CPPFLAGS) $(CPPFLAGS) $(protobuf_test_CXXFLAGS) $(CXXFLAGS) -MT google/protobuf/protobuf_test-test_util.obj -MD -MP -MF google/protobuf/$(DEPDIR)/protobuf_test-test_util.Tpo -c -o google/protobuf/protobuf_test-test_util.obj `if test -f 'google/protobuf/test_util.cc'; then $(CYGPATH_W) 'google/protobuf/test_util.cc'; else $(CYGPATH_W) '$(srcdir)/google/protobuf/test_util.cc'; fi` -@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) google/protobuf/$(DEPDIR)/protobuf_test-test_util.Tpo google/protobuf/$(DEPDIR)/protobuf_test-test_util.Po -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='google/protobuf/test_util.cc' object='google/protobuf/protobuf_test-test_util.obj' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(protobuf_test_CPPFLAGS) $(CPPFLAGS) $(protobuf_test_CXXFLAGS) $(CXXFLAGS) -c -o google/protobuf/protobuf_test-test_util.obj `if test -f 'google/protobuf/test_util.cc'; then $(CYGPATH_W) 'google/protobuf/test_util.cc'; else $(CYGPATH_W) '$(srcdir)/google/protobuf/test_util.cc'; fi` - -google/protobuf/testing/protobuf_test-file.o: google/protobuf/testing/file.cc -@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(protobuf_test_CPPFLAGS) $(CPPFLAGS) $(protobuf_test_CXXFLAGS) $(CXXFLAGS) -MT google/protobuf/testing/protobuf_test-file.o -MD -MP -MF google/protobuf/testing/$(DEPDIR)/protobuf_test-file.Tpo -c -o google/protobuf/testing/protobuf_test-file.o `test -f 'google/protobuf/testing/file.cc' || echo '$(srcdir)/'`google/protobuf/testing/file.cc -@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) google/protobuf/testing/$(DEPDIR)/protobuf_test-file.Tpo google/protobuf/testing/$(DEPDIR)/protobuf_test-file.Po -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='google/protobuf/testing/file.cc' object='google/protobuf/testing/protobuf_test-file.o' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(protobuf_test_CPPFLAGS) $(CPPFLAGS) $(protobuf_test_CXXFLAGS) $(CXXFLAGS) -c -o google/protobuf/testing/protobuf_test-file.o `test -f 'google/protobuf/testing/file.cc' || echo '$(srcdir)/'`google/protobuf/testing/file.cc - -google/protobuf/testing/protobuf_test-file.obj: google/protobuf/testing/file.cc -@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(protobuf_test_CPPFLAGS) $(CPPFLAGS) $(protobuf_test_CXXFLAGS) $(CXXFLAGS) -MT google/protobuf/testing/protobuf_test-file.obj -MD -MP -MF google/protobuf/testing/$(DEPDIR)/protobuf_test-file.Tpo -c -o google/protobuf/testing/protobuf_test-file.obj `if test -f 'google/protobuf/testing/file.cc'; then $(CYGPATH_W) 'google/protobuf/testing/file.cc'; else $(CYGPATH_W) '$(srcdir)/google/protobuf/testing/file.cc'; fi` -@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) google/protobuf/testing/$(DEPDIR)/protobuf_test-file.Tpo google/protobuf/testing/$(DEPDIR)/protobuf_test-file.Po -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='google/protobuf/testing/file.cc' object='google/protobuf/testing/protobuf_test-file.obj' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(protobuf_test_CPPFLAGS) $(CPPFLAGS) $(protobuf_test_CXXFLAGS) $(CXXFLAGS) -c -o google/protobuf/testing/protobuf_test-file.obj `if test -f 'google/protobuf/testing/file.cc'; then $(CYGPATH_W) 'google/protobuf/testing/file.cc'; else $(CYGPATH_W) '$(srcdir)/google/protobuf/testing/file.cc'; fi` - -google/protobuf/testing/protobuf_test-googletest.o: google/protobuf/testing/googletest.cc -@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(protobuf_test_CPPFLAGS) $(CPPFLAGS) $(protobuf_test_CXXFLAGS) $(CXXFLAGS) -MT google/protobuf/testing/protobuf_test-googletest.o -MD -MP -MF google/protobuf/testing/$(DEPDIR)/protobuf_test-googletest.Tpo -c -o google/protobuf/testing/protobuf_test-googletest.o `test -f 'google/protobuf/testing/googletest.cc' || echo '$(srcdir)/'`google/protobuf/testing/googletest.cc -@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) google/protobuf/testing/$(DEPDIR)/protobuf_test-googletest.Tpo google/protobuf/testing/$(DEPDIR)/protobuf_test-googletest.Po -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='google/protobuf/testing/googletest.cc' object='google/protobuf/testing/protobuf_test-googletest.o' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(protobuf_test_CPPFLAGS) $(CPPFLAGS) $(protobuf_test_CXXFLAGS) $(CXXFLAGS) -c -o google/protobuf/testing/protobuf_test-googletest.o `test -f 'google/protobuf/testing/googletest.cc' || echo '$(srcdir)/'`google/protobuf/testing/googletest.cc - -google/protobuf/testing/protobuf_test-googletest.obj: google/protobuf/testing/googletest.cc -@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(protobuf_test_CPPFLAGS) $(CPPFLAGS) $(protobuf_test_CXXFLAGS) $(CXXFLAGS) -MT google/protobuf/testing/protobuf_test-googletest.obj -MD -MP -MF google/protobuf/testing/$(DEPDIR)/protobuf_test-googletest.Tpo -c -o google/protobuf/testing/protobuf_test-googletest.obj `if test -f 'google/protobuf/testing/googletest.cc'; then $(CYGPATH_W) 'google/protobuf/testing/googletest.cc'; else $(CYGPATH_W) '$(srcdir)/google/protobuf/testing/googletest.cc'; fi` -@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) google/protobuf/testing/$(DEPDIR)/protobuf_test-googletest.Tpo google/protobuf/testing/$(DEPDIR)/protobuf_test-googletest.Po -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='google/protobuf/testing/googletest.cc' object='google/protobuf/testing/protobuf_test-googletest.obj' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(protobuf_test_CPPFLAGS) $(CPPFLAGS) $(protobuf_test_CXXFLAGS) $(CXXFLAGS) -c -o google/protobuf/testing/protobuf_test-googletest.obj `if test -f 'google/protobuf/testing/googletest.cc'; then $(CYGPATH_W) 'google/protobuf/testing/googletest.cc'; else $(CYGPATH_W) '$(srcdir)/google/protobuf/testing/googletest.cc'; fi` - -google/protobuf/protobuf_test-any_test.o: google/protobuf/any_test.cc -@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(protobuf_test_CPPFLAGS) $(CPPFLAGS) $(protobuf_test_CXXFLAGS) $(CXXFLAGS) -MT google/protobuf/protobuf_test-any_test.o -MD -MP -MF google/protobuf/$(DEPDIR)/protobuf_test-any_test.Tpo -c -o google/protobuf/protobuf_test-any_test.o `test -f 'google/protobuf/any_test.cc' || echo '$(srcdir)/'`google/protobuf/any_test.cc -@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) google/protobuf/$(DEPDIR)/protobuf_test-any_test.Tpo google/protobuf/$(DEPDIR)/protobuf_test-any_test.Po -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='google/protobuf/any_test.cc' object='google/protobuf/protobuf_test-any_test.o' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(protobuf_test_CPPFLAGS) $(CPPFLAGS) $(protobuf_test_CXXFLAGS) $(CXXFLAGS) -c -o google/protobuf/protobuf_test-any_test.o `test -f 'google/protobuf/any_test.cc' || echo '$(srcdir)/'`google/protobuf/any_test.cc - -google/protobuf/protobuf_test-any_test.obj: google/protobuf/any_test.cc -@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(protobuf_test_CPPFLAGS) $(CPPFLAGS) $(protobuf_test_CXXFLAGS) $(CXXFLAGS) -MT google/protobuf/protobuf_test-any_test.obj -MD -MP -MF google/protobuf/$(DEPDIR)/protobuf_test-any_test.Tpo -c -o google/protobuf/protobuf_test-any_test.obj `if test -f 'google/protobuf/any_test.cc'; then $(CYGPATH_W) 'google/protobuf/any_test.cc'; else $(CYGPATH_W) '$(srcdir)/google/protobuf/any_test.cc'; fi` -@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) google/protobuf/$(DEPDIR)/protobuf_test-any_test.Tpo google/protobuf/$(DEPDIR)/protobuf_test-any_test.Po -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='google/protobuf/any_test.cc' object='google/protobuf/protobuf_test-any_test.obj' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(protobuf_test_CPPFLAGS) $(CPPFLAGS) $(protobuf_test_CXXFLAGS) $(CXXFLAGS) -c -o google/protobuf/protobuf_test-any_test.obj `if test -f 'google/protobuf/any_test.cc'; then $(CYGPATH_W) 'google/protobuf/any_test.cc'; else $(CYGPATH_W) '$(srcdir)/google/protobuf/any_test.cc'; fi` - -google/protobuf/protobuf_test-arena_unittest.o: google/protobuf/arena_unittest.cc -@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(protobuf_test_CPPFLAGS) $(CPPFLAGS) $(protobuf_test_CXXFLAGS) $(CXXFLAGS) -MT google/protobuf/protobuf_test-arena_unittest.o -MD -MP -MF google/protobuf/$(DEPDIR)/protobuf_test-arena_unittest.Tpo -c -o google/protobuf/protobuf_test-arena_unittest.o `test -f 'google/protobuf/arena_unittest.cc' || echo '$(srcdir)/'`google/protobuf/arena_unittest.cc -@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) google/protobuf/$(DEPDIR)/protobuf_test-arena_unittest.Tpo google/protobuf/$(DEPDIR)/protobuf_test-arena_unittest.Po -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='google/protobuf/arena_unittest.cc' object='google/protobuf/protobuf_test-arena_unittest.o' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(protobuf_test_CPPFLAGS) $(CPPFLAGS) $(protobuf_test_CXXFLAGS) $(CXXFLAGS) -c -o google/protobuf/protobuf_test-arena_unittest.o `test -f 'google/protobuf/arena_unittest.cc' || echo '$(srcdir)/'`google/protobuf/arena_unittest.cc - -google/protobuf/protobuf_test-arena_unittest.obj: google/protobuf/arena_unittest.cc -@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(protobuf_test_CPPFLAGS) $(CPPFLAGS) $(protobuf_test_CXXFLAGS) $(CXXFLAGS) -MT google/protobuf/protobuf_test-arena_unittest.obj -MD -MP -MF google/protobuf/$(DEPDIR)/protobuf_test-arena_unittest.Tpo -c -o google/protobuf/protobuf_test-arena_unittest.obj `if test -f 'google/protobuf/arena_unittest.cc'; then $(CYGPATH_W) 'google/protobuf/arena_unittest.cc'; else $(CYGPATH_W) '$(srcdir)/google/protobuf/arena_unittest.cc'; fi` -@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) google/protobuf/$(DEPDIR)/protobuf_test-arena_unittest.Tpo google/protobuf/$(DEPDIR)/protobuf_test-arena_unittest.Po -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='google/protobuf/arena_unittest.cc' object='google/protobuf/protobuf_test-arena_unittest.obj' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(protobuf_test_CPPFLAGS) $(CPPFLAGS) $(protobuf_test_CXXFLAGS) $(CXXFLAGS) -c -o google/protobuf/protobuf_test-arena_unittest.obj `if test -f 'google/protobuf/arena_unittest.cc'; then $(CYGPATH_W) 'google/protobuf/arena_unittest.cc'; else $(CYGPATH_W) '$(srcdir)/google/protobuf/arena_unittest.cc'; fi` - -google/protobuf/protobuf_test-arenastring_unittest.o: google/protobuf/arenastring_unittest.cc -@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(protobuf_test_CPPFLAGS) $(CPPFLAGS) $(protobuf_test_CXXFLAGS) $(CXXFLAGS) -MT google/protobuf/protobuf_test-arenastring_unittest.o -MD -MP -MF google/protobuf/$(DEPDIR)/protobuf_test-arenastring_unittest.Tpo -c -o google/protobuf/protobuf_test-arenastring_unittest.o `test -f 'google/protobuf/arenastring_unittest.cc' || echo '$(srcdir)/'`google/protobuf/arenastring_unittest.cc -@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) google/protobuf/$(DEPDIR)/protobuf_test-arenastring_unittest.Tpo google/protobuf/$(DEPDIR)/protobuf_test-arenastring_unittest.Po -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='google/protobuf/arenastring_unittest.cc' object='google/protobuf/protobuf_test-arenastring_unittest.o' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(protobuf_test_CPPFLAGS) $(CPPFLAGS) $(protobuf_test_CXXFLAGS) $(CXXFLAGS) -c -o google/protobuf/protobuf_test-arenastring_unittest.o `test -f 'google/protobuf/arenastring_unittest.cc' || echo '$(srcdir)/'`google/protobuf/arenastring_unittest.cc - -google/protobuf/protobuf_test-arenastring_unittest.obj: google/protobuf/arenastring_unittest.cc -@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(protobuf_test_CPPFLAGS) $(CPPFLAGS) $(protobuf_test_CXXFLAGS) $(CXXFLAGS) -MT google/protobuf/protobuf_test-arenastring_unittest.obj -MD -MP -MF google/protobuf/$(DEPDIR)/protobuf_test-arenastring_unittest.Tpo -c -o google/protobuf/protobuf_test-arenastring_unittest.obj `if test -f 'google/protobuf/arenastring_unittest.cc'; then $(CYGPATH_W) 'google/protobuf/arenastring_unittest.cc'; else $(CYGPATH_W) '$(srcdir)/google/protobuf/arenastring_unittest.cc'; fi` -@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) google/protobuf/$(DEPDIR)/protobuf_test-arenastring_unittest.Tpo google/protobuf/$(DEPDIR)/protobuf_test-arenastring_unittest.Po -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='google/protobuf/arenastring_unittest.cc' object='google/protobuf/protobuf_test-arenastring_unittest.obj' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(protobuf_test_CPPFLAGS) $(CPPFLAGS) $(protobuf_test_CXXFLAGS) $(CXXFLAGS) -c -o google/protobuf/protobuf_test-arenastring_unittest.obj `if test -f 'google/protobuf/arenastring_unittest.cc'; then $(CYGPATH_W) 'google/protobuf/arenastring_unittest.cc'; else $(CYGPATH_W) '$(srcdir)/google/protobuf/arenastring_unittest.cc'; fi` - -google/protobuf/compiler/protobuf_test-annotation_test_util.o: google/protobuf/compiler/annotation_test_util.cc -@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(protobuf_test_CPPFLAGS) $(CPPFLAGS) $(protobuf_test_CXXFLAGS) $(CXXFLAGS) -MT google/protobuf/compiler/protobuf_test-annotation_test_util.o -MD -MP -MF google/protobuf/compiler/$(DEPDIR)/protobuf_test-annotation_test_util.Tpo -c -o google/protobuf/compiler/protobuf_test-annotation_test_util.o `test -f 'google/protobuf/compiler/annotation_test_util.cc' || echo '$(srcdir)/'`google/protobuf/compiler/annotation_test_util.cc -@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) google/protobuf/compiler/$(DEPDIR)/protobuf_test-annotation_test_util.Tpo google/protobuf/compiler/$(DEPDIR)/protobuf_test-annotation_test_util.Po -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='google/protobuf/compiler/annotation_test_util.cc' object='google/protobuf/compiler/protobuf_test-annotation_test_util.o' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(protobuf_test_CPPFLAGS) $(CPPFLAGS) $(protobuf_test_CXXFLAGS) $(CXXFLAGS) -c -o google/protobuf/compiler/protobuf_test-annotation_test_util.o `test -f 'google/protobuf/compiler/annotation_test_util.cc' || echo '$(srcdir)/'`google/protobuf/compiler/annotation_test_util.cc - -google/protobuf/compiler/protobuf_test-annotation_test_util.obj: google/protobuf/compiler/annotation_test_util.cc -@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(protobuf_test_CPPFLAGS) $(CPPFLAGS) $(protobuf_test_CXXFLAGS) $(CXXFLAGS) -MT google/protobuf/compiler/protobuf_test-annotation_test_util.obj -MD -MP -MF google/protobuf/compiler/$(DEPDIR)/protobuf_test-annotation_test_util.Tpo -c -o google/protobuf/compiler/protobuf_test-annotation_test_util.obj `if test -f 'google/protobuf/compiler/annotation_test_util.cc'; then $(CYGPATH_W) 'google/protobuf/compiler/annotation_test_util.cc'; else $(CYGPATH_W) '$(srcdir)/google/protobuf/compiler/annotation_test_util.cc'; fi` -@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) google/protobuf/compiler/$(DEPDIR)/protobuf_test-annotation_test_util.Tpo google/protobuf/compiler/$(DEPDIR)/protobuf_test-annotation_test_util.Po -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='google/protobuf/compiler/annotation_test_util.cc' object='google/protobuf/compiler/protobuf_test-annotation_test_util.obj' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(protobuf_test_CPPFLAGS) $(CPPFLAGS) $(protobuf_test_CXXFLAGS) $(CXXFLAGS) -c -o google/protobuf/compiler/protobuf_test-annotation_test_util.obj `if test -f 'google/protobuf/compiler/annotation_test_util.cc'; then $(CYGPATH_W) 'google/protobuf/compiler/annotation_test_util.cc'; else $(CYGPATH_W) '$(srcdir)/google/protobuf/compiler/annotation_test_util.cc'; fi` - -google/protobuf/compiler/protobuf_test-command_line_interface_unittest.o: google/protobuf/compiler/command_line_interface_unittest.cc -@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(protobuf_test_CPPFLAGS) $(CPPFLAGS) $(protobuf_test_CXXFLAGS) $(CXXFLAGS) -MT google/protobuf/compiler/protobuf_test-command_line_interface_unittest.o -MD -MP -MF google/protobuf/compiler/$(DEPDIR)/protobuf_test-command_line_interface_unittest.Tpo -c -o google/protobuf/compiler/protobuf_test-command_line_interface_unittest.o `test -f 'google/protobuf/compiler/command_line_interface_unittest.cc' || echo '$(srcdir)/'`google/protobuf/compiler/command_line_interface_unittest.cc -@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) google/protobuf/compiler/$(DEPDIR)/protobuf_test-command_line_interface_unittest.Tpo google/protobuf/compiler/$(DEPDIR)/protobuf_test-command_line_interface_unittest.Po -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='google/protobuf/compiler/command_line_interface_unittest.cc' object='google/protobuf/compiler/protobuf_test-command_line_interface_unittest.o' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(protobuf_test_CPPFLAGS) $(CPPFLAGS) $(protobuf_test_CXXFLAGS) $(CXXFLAGS) -c -o google/protobuf/compiler/protobuf_test-command_line_interface_unittest.o `test -f 'google/protobuf/compiler/command_line_interface_unittest.cc' || echo '$(srcdir)/'`google/protobuf/compiler/command_line_interface_unittest.cc - -google/protobuf/compiler/protobuf_test-command_line_interface_unittest.obj: google/protobuf/compiler/command_line_interface_unittest.cc -@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(protobuf_test_CPPFLAGS) $(CPPFLAGS) $(protobuf_test_CXXFLAGS) $(CXXFLAGS) -MT google/protobuf/compiler/protobuf_test-command_line_interface_unittest.obj -MD -MP -MF google/protobuf/compiler/$(DEPDIR)/protobuf_test-command_line_interface_unittest.Tpo -c -o google/protobuf/compiler/protobuf_test-command_line_interface_unittest.obj `if test -f 'google/protobuf/compiler/command_line_interface_unittest.cc'; then $(CYGPATH_W) 'google/protobuf/compiler/command_line_interface_unittest.cc'; else $(CYGPATH_W) '$(srcdir)/google/protobuf/compiler/command_line_interface_unittest.cc'; fi` -@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) google/protobuf/compiler/$(DEPDIR)/protobuf_test-command_line_interface_unittest.Tpo google/protobuf/compiler/$(DEPDIR)/protobuf_test-command_line_interface_unittest.Po -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='google/protobuf/compiler/command_line_interface_unittest.cc' object='google/protobuf/compiler/protobuf_test-command_line_interface_unittest.obj' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(protobuf_test_CPPFLAGS) $(CPPFLAGS) $(protobuf_test_CXXFLAGS) $(CXXFLAGS) -c -o google/protobuf/compiler/protobuf_test-command_line_interface_unittest.obj `if test -f 'google/protobuf/compiler/command_line_interface_unittest.cc'; then $(CYGPATH_W) 'google/protobuf/compiler/command_line_interface_unittest.cc'; else $(CYGPATH_W) '$(srcdir)/google/protobuf/compiler/command_line_interface_unittest.cc'; fi` - -google/protobuf/compiler/cpp/protobuf_test-cpp_bootstrap_unittest.o: google/protobuf/compiler/cpp/cpp_bootstrap_unittest.cc -@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(protobuf_test_CPPFLAGS) $(CPPFLAGS) $(protobuf_test_CXXFLAGS) $(CXXFLAGS) -MT google/protobuf/compiler/cpp/protobuf_test-cpp_bootstrap_unittest.o -MD -MP -MF google/protobuf/compiler/cpp/$(DEPDIR)/protobuf_test-cpp_bootstrap_unittest.Tpo -c -o google/protobuf/compiler/cpp/protobuf_test-cpp_bootstrap_unittest.o `test -f 'google/protobuf/compiler/cpp/cpp_bootstrap_unittest.cc' || echo '$(srcdir)/'`google/protobuf/compiler/cpp/cpp_bootstrap_unittest.cc -@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) google/protobuf/compiler/cpp/$(DEPDIR)/protobuf_test-cpp_bootstrap_unittest.Tpo google/protobuf/compiler/cpp/$(DEPDIR)/protobuf_test-cpp_bootstrap_unittest.Po -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='google/protobuf/compiler/cpp/cpp_bootstrap_unittest.cc' object='google/protobuf/compiler/cpp/protobuf_test-cpp_bootstrap_unittest.o' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(protobuf_test_CPPFLAGS) $(CPPFLAGS) $(protobuf_test_CXXFLAGS) $(CXXFLAGS) -c -o google/protobuf/compiler/cpp/protobuf_test-cpp_bootstrap_unittest.o `test -f 'google/protobuf/compiler/cpp/cpp_bootstrap_unittest.cc' || echo '$(srcdir)/'`google/protobuf/compiler/cpp/cpp_bootstrap_unittest.cc - -google/protobuf/compiler/cpp/protobuf_test-cpp_bootstrap_unittest.obj: google/protobuf/compiler/cpp/cpp_bootstrap_unittest.cc -@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(protobuf_test_CPPFLAGS) $(CPPFLAGS) $(protobuf_test_CXXFLAGS) $(CXXFLAGS) -MT google/protobuf/compiler/cpp/protobuf_test-cpp_bootstrap_unittest.obj -MD -MP -MF google/protobuf/compiler/cpp/$(DEPDIR)/protobuf_test-cpp_bootstrap_unittest.Tpo -c -o google/protobuf/compiler/cpp/protobuf_test-cpp_bootstrap_unittest.obj `if test -f 'google/protobuf/compiler/cpp/cpp_bootstrap_unittest.cc'; then $(CYGPATH_W) 'google/protobuf/compiler/cpp/cpp_bootstrap_unittest.cc'; else $(CYGPATH_W) '$(srcdir)/google/protobuf/compiler/cpp/cpp_bootstrap_unittest.cc'; fi` -@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) google/protobuf/compiler/cpp/$(DEPDIR)/protobuf_test-cpp_bootstrap_unittest.Tpo google/protobuf/compiler/cpp/$(DEPDIR)/protobuf_test-cpp_bootstrap_unittest.Po -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='google/protobuf/compiler/cpp/cpp_bootstrap_unittest.cc' object='google/protobuf/compiler/cpp/protobuf_test-cpp_bootstrap_unittest.obj' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(protobuf_test_CPPFLAGS) $(CPPFLAGS) $(protobuf_test_CXXFLAGS) $(CXXFLAGS) -c -o google/protobuf/compiler/cpp/protobuf_test-cpp_bootstrap_unittest.obj `if test -f 'google/protobuf/compiler/cpp/cpp_bootstrap_unittest.cc'; then $(CYGPATH_W) 'google/protobuf/compiler/cpp/cpp_bootstrap_unittest.cc'; else $(CYGPATH_W) '$(srcdir)/google/protobuf/compiler/cpp/cpp_bootstrap_unittest.cc'; fi` - -google/protobuf/compiler/cpp/protobuf_test-cpp_move_unittest.o: google/protobuf/compiler/cpp/cpp_move_unittest.cc -@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(protobuf_test_CPPFLAGS) $(CPPFLAGS) $(protobuf_test_CXXFLAGS) $(CXXFLAGS) -MT google/protobuf/compiler/cpp/protobuf_test-cpp_move_unittest.o -MD -MP -MF google/protobuf/compiler/cpp/$(DEPDIR)/protobuf_test-cpp_move_unittest.Tpo -c -o google/protobuf/compiler/cpp/protobuf_test-cpp_move_unittest.o `test -f 'google/protobuf/compiler/cpp/cpp_move_unittest.cc' || echo '$(srcdir)/'`google/protobuf/compiler/cpp/cpp_move_unittest.cc -@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) google/protobuf/compiler/cpp/$(DEPDIR)/protobuf_test-cpp_move_unittest.Tpo google/protobuf/compiler/cpp/$(DEPDIR)/protobuf_test-cpp_move_unittest.Po -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='google/protobuf/compiler/cpp/cpp_move_unittest.cc' object='google/protobuf/compiler/cpp/protobuf_test-cpp_move_unittest.o' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(protobuf_test_CPPFLAGS) $(CPPFLAGS) $(protobuf_test_CXXFLAGS) $(CXXFLAGS) -c -o google/protobuf/compiler/cpp/protobuf_test-cpp_move_unittest.o `test -f 'google/protobuf/compiler/cpp/cpp_move_unittest.cc' || echo '$(srcdir)/'`google/protobuf/compiler/cpp/cpp_move_unittest.cc - -google/protobuf/compiler/cpp/protobuf_test-cpp_move_unittest.obj: google/protobuf/compiler/cpp/cpp_move_unittest.cc -@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(protobuf_test_CPPFLAGS) $(CPPFLAGS) $(protobuf_test_CXXFLAGS) $(CXXFLAGS) -MT google/protobuf/compiler/cpp/protobuf_test-cpp_move_unittest.obj -MD -MP -MF google/protobuf/compiler/cpp/$(DEPDIR)/protobuf_test-cpp_move_unittest.Tpo -c -o google/protobuf/compiler/cpp/protobuf_test-cpp_move_unittest.obj `if test -f 'google/protobuf/compiler/cpp/cpp_move_unittest.cc'; then $(CYGPATH_W) 'google/protobuf/compiler/cpp/cpp_move_unittest.cc'; else $(CYGPATH_W) '$(srcdir)/google/protobuf/compiler/cpp/cpp_move_unittest.cc'; fi` -@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) google/protobuf/compiler/cpp/$(DEPDIR)/protobuf_test-cpp_move_unittest.Tpo google/protobuf/compiler/cpp/$(DEPDIR)/protobuf_test-cpp_move_unittest.Po -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='google/protobuf/compiler/cpp/cpp_move_unittest.cc' object='google/protobuf/compiler/cpp/protobuf_test-cpp_move_unittest.obj' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(protobuf_test_CPPFLAGS) $(CPPFLAGS) $(protobuf_test_CXXFLAGS) $(CXXFLAGS) -c -o google/protobuf/compiler/cpp/protobuf_test-cpp_move_unittest.obj `if test -f 'google/protobuf/compiler/cpp/cpp_move_unittest.cc'; then $(CYGPATH_W) 'google/protobuf/compiler/cpp/cpp_move_unittest.cc'; else $(CYGPATH_W) '$(srcdir)/google/protobuf/compiler/cpp/cpp_move_unittest.cc'; fi` - -google/protobuf/compiler/cpp/protobuf_test-cpp_plugin_unittest.o: google/protobuf/compiler/cpp/cpp_plugin_unittest.cc -@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(protobuf_test_CPPFLAGS) $(CPPFLAGS) $(protobuf_test_CXXFLAGS) $(CXXFLAGS) -MT google/protobuf/compiler/cpp/protobuf_test-cpp_plugin_unittest.o -MD -MP -MF google/protobuf/compiler/cpp/$(DEPDIR)/protobuf_test-cpp_plugin_unittest.Tpo -c -o google/protobuf/compiler/cpp/protobuf_test-cpp_plugin_unittest.o `test -f 'google/protobuf/compiler/cpp/cpp_plugin_unittest.cc' || echo '$(srcdir)/'`google/protobuf/compiler/cpp/cpp_plugin_unittest.cc -@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) google/protobuf/compiler/cpp/$(DEPDIR)/protobuf_test-cpp_plugin_unittest.Tpo google/protobuf/compiler/cpp/$(DEPDIR)/protobuf_test-cpp_plugin_unittest.Po -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='google/protobuf/compiler/cpp/cpp_plugin_unittest.cc' object='google/protobuf/compiler/cpp/protobuf_test-cpp_plugin_unittest.o' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(protobuf_test_CPPFLAGS) $(CPPFLAGS) $(protobuf_test_CXXFLAGS) $(CXXFLAGS) -c -o google/protobuf/compiler/cpp/protobuf_test-cpp_plugin_unittest.o `test -f 'google/protobuf/compiler/cpp/cpp_plugin_unittest.cc' || echo '$(srcdir)/'`google/protobuf/compiler/cpp/cpp_plugin_unittest.cc - -google/protobuf/compiler/cpp/protobuf_test-cpp_plugin_unittest.obj: google/protobuf/compiler/cpp/cpp_plugin_unittest.cc -@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(protobuf_test_CPPFLAGS) $(CPPFLAGS) $(protobuf_test_CXXFLAGS) $(CXXFLAGS) -MT google/protobuf/compiler/cpp/protobuf_test-cpp_plugin_unittest.obj -MD -MP -MF google/protobuf/compiler/cpp/$(DEPDIR)/protobuf_test-cpp_plugin_unittest.Tpo -c -o google/protobuf/compiler/cpp/protobuf_test-cpp_plugin_unittest.obj `if test -f 'google/protobuf/compiler/cpp/cpp_plugin_unittest.cc'; then $(CYGPATH_W) 'google/protobuf/compiler/cpp/cpp_plugin_unittest.cc'; else $(CYGPATH_W) '$(srcdir)/google/protobuf/compiler/cpp/cpp_plugin_unittest.cc'; fi` -@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) google/protobuf/compiler/cpp/$(DEPDIR)/protobuf_test-cpp_plugin_unittest.Tpo google/protobuf/compiler/cpp/$(DEPDIR)/protobuf_test-cpp_plugin_unittest.Po -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='google/protobuf/compiler/cpp/cpp_plugin_unittest.cc' object='google/protobuf/compiler/cpp/protobuf_test-cpp_plugin_unittest.obj' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(protobuf_test_CPPFLAGS) $(CPPFLAGS) $(protobuf_test_CXXFLAGS) $(CXXFLAGS) -c -o google/protobuf/compiler/cpp/protobuf_test-cpp_plugin_unittest.obj `if test -f 'google/protobuf/compiler/cpp/cpp_plugin_unittest.cc'; then $(CYGPATH_W) 'google/protobuf/compiler/cpp/cpp_plugin_unittest.cc'; else $(CYGPATH_W) '$(srcdir)/google/protobuf/compiler/cpp/cpp_plugin_unittest.cc'; fi` - -google/protobuf/compiler/cpp/protobuf_test-cpp_unittest.o: google/protobuf/compiler/cpp/cpp_unittest.cc -@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(protobuf_test_CPPFLAGS) $(CPPFLAGS) $(protobuf_test_CXXFLAGS) $(CXXFLAGS) -MT google/protobuf/compiler/cpp/protobuf_test-cpp_unittest.o -MD -MP -MF google/protobuf/compiler/cpp/$(DEPDIR)/protobuf_test-cpp_unittest.Tpo -c -o google/protobuf/compiler/cpp/protobuf_test-cpp_unittest.o `test -f 'google/protobuf/compiler/cpp/cpp_unittest.cc' || echo '$(srcdir)/'`google/protobuf/compiler/cpp/cpp_unittest.cc -@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) google/protobuf/compiler/cpp/$(DEPDIR)/protobuf_test-cpp_unittest.Tpo google/protobuf/compiler/cpp/$(DEPDIR)/protobuf_test-cpp_unittest.Po -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='google/protobuf/compiler/cpp/cpp_unittest.cc' object='google/protobuf/compiler/cpp/protobuf_test-cpp_unittest.o' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(protobuf_test_CPPFLAGS) $(CPPFLAGS) $(protobuf_test_CXXFLAGS) $(CXXFLAGS) -c -o google/protobuf/compiler/cpp/protobuf_test-cpp_unittest.o `test -f 'google/protobuf/compiler/cpp/cpp_unittest.cc' || echo '$(srcdir)/'`google/protobuf/compiler/cpp/cpp_unittest.cc - -google/protobuf/compiler/cpp/protobuf_test-cpp_unittest.obj: google/protobuf/compiler/cpp/cpp_unittest.cc -@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(protobuf_test_CPPFLAGS) $(CPPFLAGS) $(protobuf_test_CXXFLAGS) $(CXXFLAGS) -MT google/protobuf/compiler/cpp/protobuf_test-cpp_unittest.obj -MD -MP -MF google/protobuf/compiler/cpp/$(DEPDIR)/protobuf_test-cpp_unittest.Tpo -c -o google/protobuf/compiler/cpp/protobuf_test-cpp_unittest.obj `if test -f 'google/protobuf/compiler/cpp/cpp_unittest.cc'; then $(CYGPATH_W) 'google/protobuf/compiler/cpp/cpp_unittest.cc'; else $(CYGPATH_W) '$(srcdir)/google/protobuf/compiler/cpp/cpp_unittest.cc'; fi` -@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) google/protobuf/compiler/cpp/$(DEPDIR)/protobuf_test-cpp_unittest.Tpo google/protobuf/compiler/cpp/$(DEPDIR)/protobuf_test-cpp_unittest.Po -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='google/protobuf/compiler/cpp/cpp_unittest.cc' object='google/protobuf/compiler/cpp/protobuf_test-cpp_unittest.obj' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(protobuf_test_CPPFLAGS) $(CPPFLAGS) $(protobuf_test_CXXFLAGS) $(CXXFLAGS) -c -o google/protobuf/compiler/cpp/protobuf_test-cpp_unittest.obj `if test -f 'google/protobuf/compiler/cpp/cpp_unittest.cc'; then $(CYGPATH_W) 'google/protobuf/compiler/cpp/cpp_unittest.cc'; else $(CYGPATH_W) '$(srcdir)/google/protobuf/compiler/cpp/cpp_unittest.cc'; fi` - -google/protobuf/compiler/cpp/protobuf_test-metadata_test.o: google/protobuf/compiler/cpp/metadata_test.cc -@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(protobuf_test_CPPFLAGS) $(CPPFLAGS) $(protobuf_test_CXXFLAGS) $(CXXFLAGS) -MT google/protobuf/compiler/cpp/protobuf_test-metadata_test.o -MD -MP -MF google/protobuf/compiler/cpp/$(DEPDIR)/protobuf_test-metadata_test.Tpo -c -o google/protobuf/compiler/cpp/protobuf_test-metadata_test.o `test -f 'google/protobuf/compiler/cpp/metadata_test.cc' || echo '$(srcdir)/'`google/protobuf/compiler/cpp/metadata_test.cc -@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) google/protobuf/compiler/cpp/$(DEPDIR)/protobuf_test-metadata_test.Tpo google/protobuf/compiler/cpp/$(DEPDIR)/protobuf_test-metadata_test.Po -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='google/protobuf/compiler/cpp/metadata_test.cc' object='google/protobuf/compiler/cpp/protobuf_test-metadata_test.o' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(protobuf_test_CPPFLAGS) $(CPPFLAGS) $(protobuf_test_CXXFLAGS) $(CXXFLAGS) -c -o google/protobuf/compiler/cpp/protobuf_test-metadata_test.o `test -f 'google/protobuf/compiler/cpp/metadata_test.cc' || echo '$(srcdir)/'`google/protobuf/compiler/cpp/metadata_test.cc - -google/protobuf/compiler/cpp/protobuf_test-metadata_test.obj: google/protobuf/compiler/cpp/metadata_test.cc -@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(protobuf_test_CPPFLAGS) $(CPPFLAGS) $(protobuf_test_CXXFLAGS) $(CXXFLAGS) -MT google/protobuf/compiler/cpp/protobuf_test-metadata_test.obj -MD -MP -MF google/protobuf/compiler/cpp/$(DEPDIR)/protobuf_test-metadata_test.Tpo -c -o google/protobuf/compiler/cpp/protobuf_test-metadata_test.obj `if test -f 'google/protobuf/compiler/cpp/metadata_test.cc'; then $(CYGPATH_W) 'google/protobuf/compiler/cpp/metadata_test.cc'; else $(CYGPATH_W) '$(srcdir)/google/protobuf/compiler/cpp/metadata_test.cc'; fi` -@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) google/protobuf/compiler/cpp/$(DEPDIR)/protobuf_test-metadata_test.Tpo google/protobuf/compiler/cpp/$(DEPDIR)/protobuf_test-metadata_test.Po -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='google/protobuf/compiler/cpp/metadata_test.cc' object='google/protobuf/compiler/cpp/protobuf_test-metadata_test.obj' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(protobuf_test_CPPFLAGS) $(CPPFLAGS) $(protobuf_test_CXXFLAGS) $(CXXFLAGS) -c -o google/protobuf/compiler/cpp/protobuf_test-metadata_test.obj `if test -f 'google/protobuf/compiler/cpp/metadata_test.cc'; then $(CYGPATH_W) 'google/protobuf/compiler/cpp/metadata_test.cc'; else $(CYGPATH_W) '$(srcdir)/google/protobuf/compiler/cpp/metadata_test.cc'; fi` - -google/protobuf/compiler/csharp/protobuf_test-csharp_bootstrap_unittest.o: google/protobuf/compiler/csharp/csharp_bootstrap_unittest.cc -@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(protobuf_test_CPPFLAGS) $(CPPFLAGS) $(protobuf_test_CXXFLAGS) $(CXXFLAGS) -MT google/protobuf/compiler/csharp/protobuf_test-csharp_bootstrap_unittest.o -MD -MP -MF google/protobuf/compiler/csharp/$(DEPDIR)/protobuf_test-csharp_bootstrap_unittest.Tpo -c -o google/protobuf/compiler/csharp/protobuf_test-csharp_bootstrap_unittest.o `test -f 'google/protobuf/compiler/csharp/csharp_bootstrap_unittest.cc' || echo '$(srcdir)/'`google/protobuf/compiler/csharp/csharp_bootstrap_unittest.cc -@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) google/protobuf/compiler/csharp/$(DEPDIR)/protobuf_test-csharp_bootstrap_unittest.Tpo google/protobuf/compiler/csharp/$(DEPDIR)/protobuf_test-csharp_bootstrap_unittest.Po -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='google/protobuf/compiler/csharp/csharp_bootstrap_unittest.cc' object='google/protobuf/compiler/csharp/protobuf_test-csharp_bootstrap_unittest.o' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(protobuf_test_CPPFLAGS) $(CPPFLAGS) $(protobuf_test_CXXFLAGS) $(CXXFLAGS) -c -o google/protobuf/compiler/csharp/protobuf_test-csharp_bootstrap_unittest.o `test -f 'google/protobuf/compiler/csharp/csharp_bootstrap_unittest.cc' || echo '$(srcdir)/'`google/protobuf/compiler/csharp/csharp_bootstrap_unittest.cc - -google/protobuf/compiler/csharp/protobuf_test-csharp_bootstrap_unittest.obj: google/protobuf/compiler/csharp/csharp_bootstrap_unittest.cc -@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(protobuf_test_CPPFLAGS) $(CPPFLAGS) $(protobuf_test_CXXFLAGS) $(CXXFLAGS) -MT google/protobuf/compiler/csharp/protobuf_test-csharp_bootstrap_unittest.obj -MD -MP -MF google/protobuf/compiler/csharp/$(DEPDIR)/protobuf_test-csharp_bootstrap_unittest.Tpo -c -o google/protobuf/compiler/csharp/protobuf_test-csharp_bootstrap_unittest.obj `if test -f 'google/protobuf/compiler/csharp/csharp_bootstrap_unittest.cc'; then $(CYGPATH_W) 'google/protobuf/compiler/csharp/csharp_bootstrap_unittest.cc'; else $(CYGPATH_W) '$(srcdir)/google/protobuf/compiler/csharp/csharp_bootstrap_unittest.cc'; fi` -@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) google/protobuf/compiler/csharp/$(DEPDIR)/protobuf_test-csharp_bootstrap_unittest.Tpo google/protobuf/compiler/csharp/$(DEPDIR)/protobuf_test-csharp_bootstrap_unittest.Po -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='google/protobuf/compiler/csharp/csharp_bootstrap_unittest.cc' object='google/protobuf/compiler/csharp/protobuf_test-csharp_bootstrap_unittest.obj' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(protobuf_test_CPPFLAGS) $(CPPFLAGS) $(protobuf_test_CXXFLAGS) $(CXXFLAGS) -c -o google/protobuf/compiler/csharp/protobuf_test-csharp_bootstrap_unittest.obj `if test -f 'google/protobuf/compiler/csharp/csharp_bootstrap_unittest.cc'; then $(CYGPATH_W) 'google/protobuf/compiler/csharp/csharp_bootstrap_unittest.cc'; else $(CYGPATH_W) '$(srcdir)/google/protobuf/compiler/csharp/csharp_bootstrap_unittest.cc'; fi` - -google/protobuf/compiler/csharp/protobuf_test-csharp_generator_unittest.o: google/protobuf/compiler/csharp/csharp_generator_unittest.cc -@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(protobuf_test_CPPFLAGS) $(CPPFLAGS) $(protobuf_test_CXXFLAGS) $(CXXFLAGS) -MT google/protobuf/compiler/csharp/protobuf_test-csharp_generator_unittest.o -MD -MP -MF google/protobuf/compiler/csharp/$(DEPDIR)/protobuf_test-csharp_generator_unittest.Tpo -c -o google/protobuf/compiler/csharp/protobuf_test-csharp_generator_unittest.o `test -f 'google/protobuf/compiler/csharp/csharp_generator_unittest.cc' || echo '$(srcdir)/'`google/protobuf/compiler/csharp/csharp_generator_unittest.cc -@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) google/protobuf/compiler/csharp/$(DEPDIR)/protobuf_test-csharp_generator_unittest.Tpo google/protobuf/compiler/csharp/$(DEPDIR)/protobuf_test-csharp_generator_unittest.Po -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='google/protobuf/compiler/csharp/csharp_generator_unittest.cc' object='google/protobuf/compiler/csharp/protobuf_test-csharp_generator_unittest.o' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(protobuf_test_CPPFLAGS) $(CPPFLAGS) $(protobuf_test_CXXFLAGS) $(CXXFLAGS) -c -o google/protobuf/compiler/csharp/protobuf_test-csharp_generator_unittest.o `test -f 'google/protobuf/compiler/csharp/csharp_generator_unittest.cc' || echo '$(srcdir)/'`google/protobuf/compiler/csharp/csharp_generator_unittest.cc - -google/protobuf/compiler/csharp/protobuf_test-csharp_generator_unittest.obj: google/protobuf/compiler/csharp/csharp_generator_unittest.cc -@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(protobuf_test_CPPFLAGS) $(CPPFLAGS) $(protobuf_test_CXXFLAGS) $(CXXFLAGS) -MT google/protobuf/compiler/csharp/protobuf_test-csharp_generator_unittest.obj -MD -MP -MF google/protobuf/compiler/csharp/$(DEPDIR)/protobuf_test-csharp_generator_unittest.Tpo -c -o google/protobuf/compiler/csharp/protobuf_test-csharp_generator_unittest.obj `if test -f 'google/protobuf/compiler/csharp/csharp_generator_unittest.cc'; then $(CYGPATH_W) 'google/protobuf/compiler/csharp/csharp_generator_unittest.cc'; else $(CYGPATH_W) '$(srcdir)/google/protobuf/compiler/csharp/csharp_generator_unittest.cc'; fi` -@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) google/protobuf/compiler/csharp/$(DEPDIR)/protobuf_test-csharp_generator_unittest.Tpo google/protobuf/compiler/csharp/$(DEPDIR)/protobuf_test-csharp_generator_unittest.Po -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='google/protobuf/compiler/csharp/csharp_generator_unittest.cc' object='google/protobuf/compiler/csharp/protobuf_test-csharp_generator_unittest.obj' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(protobuf_test_CPPFLAGS) $(CPPFLAGS) $(protobuf_test_CXXFLAGS) $(CXXFLAGS) -c -o google/protobuf/compiler/csharp/protobuf_test-csharp_generator_unittest.obj `if test -f 'google/protobuf/compiler/csharp/csharp_generator_unittest.cc'; then $(CYGPATH_W) 'google/protobuf/compiler/csharp/csharp_generator_unittest.cc'; else $(CYGPATH_W) '$(srcdir)/google/protobuf/compiler/csharp/csharp_generator_unittest.cc'; fi` - -google/protobuf/compiler/protobuf_test-importer_unittest.o: google/protobuf/compiler/importer_unittest.cc -@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(protobuf_test_CPPFLAGS) $(CPPFLAGS) $(protobuf_test_CXXFLAGS) $(CXXFLAGS) -MT google/protobuf/compiler/protobuf_test-importer_unittest.o -MD -MP -MF google/protobuf/compiler/$(DEPDIR)/protobuf_test-importer_unittest.Tpo -c -o google/protobuf/compiler/protobuf_test-importer_unittest.o `test -f 'google/protobuf/compiler/importer_unittest.cc' || echo '$(srcdir)/'`google/protobuf/compiler/importer_unittest.cc -@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) google/protobuf/compiler/$(DEPDIR)/protobuf_test-importer_unittest.Tpo google/protobuf/compiler/$(DEPDIR)/protobuf_test-importer_unittest.Po -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='google/protobuf/compiler/importer_unittest.cc' object='google/protobuf/compiler/protobuf_test-importer_unittest.o' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(protobuf_test_CPPFLAGS) $(CPPFLAGS) $(protobuf_test_CXXFLAGS) $(CXXFLAGS) -c -o google/protobuf/compiler/protobuf_test-importer_unittest.o `test -f 'google/protobuf/compiler/importer_unittest.cc' || echo '$(srcdir)/'`google/protobuf/compiler/importer_unittest.cc - -google/protobuf/compiler/protobuf_test-importer_unittest.obj: google/protobuf/compiler/importer_unittest.cc -@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(protobuf_test_CPPFLAGS) $(CPPFLAGS) $(protobuf_test_CXXFLAGS) $(CXXFLAGS) -MT google/protobuf/compiler/protobuf_test-importer_unittest.obj -MD -MP -MF google/protobuf/compiler/$(DEPDIR)/protobuf_test-importer_unittest.Tpo -c -o google/protobuf/compiler/protobuf_test-importer_unittest.obj `if test -f 'google/protobuf/compiler/importer_unittest.cc'; then $(CYGPATH_W) 'google/protobuf/compiler/importer_unittest.cc'; else $(CYGPATH_W) '$(srcdir)/google/protobuf/compiler/importer_unittest.cc'; fi` -@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) google/protobuf/compiler/$(DEPDIR)/protobuf_test-importer_unittest.Tpo google/protobuf/compiler/$(DEPDIR)/protobuf_test-importer_unittest.Po -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='google/protobuf/compiler/importer_unittest.cc' object='google/protobuf/compiler/protobuf_test-importer_unittest.obj' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(protobuf_test_CPPFLAGS) $(CPPFLAGS) $(protobuf_test_CXXFLAGS) $(CXXFLAGS) -c -o google/protobuf/compiler/protobuf_test-importer_unittest.obj `if test -f 'google/protobuf/compiler/importer_unittest.cc'; then $(CYGPATH_W) 'google/protobuf/compiler/importer_unittest.cc'; else $(CYGPATH_W) '$(srcdir)/google/protobuf/compiler/importer_unittest.cc'; fi` - -google/protobuf/compiler/java/protobuf_test-java_doc_comment_unittest.o: google/protobuf/compiler/java/java_doc_comment_unittest.cc -@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(protobuf_test_CPPFLAGS) $(CPPFLAGS) $(protobuf_test_CXXFLAGS) $(CXXFLAGS) -MT google/protobuf/compiler/java/protobuf_test-java_doc_comment_unittest.o -MD -MP -MF google/protobuf/compiler/java/$(DEPDIR)/protobuf_test-java_doc_comment_unittest.Tpo -c -o google/protobuf/compiler/java/protobuf_test-java_doc_comment_unittest.o `test -f 'google/protobuf/compiler/java/java_doc_comment_unittest.cc' || echo '$(srcdir)/'`google/protobuf/compiler/java/java_doc_comment_unittest.cc -@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) google/protobuf/compiler/java/$(DEPDIR)/protobuf_test-java_doc_comment_unittest.Tpo google/protobuf/compiler/java/$(DEPDIR)/protobuf_test-java_doc_comment_unittest.Po -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='google/protobuf/compiler/java/java_doc_comment_unittest.cc' object='google/protobuf/compiler/java/protobuf_test-java_doc_comment_unittest.o' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(protobuf_test_CPPFLAGS) $(CPPFLAGS) $(protobuf_test_CXXFLAGS) $(CXXFLAGS) -c -o google/protobuf/compiler/java/protobuf_test-java_doc_comment_unittest.o `test -f 'google/protobuf/compiler/java/java_doc_comment_unittest.cc' || echo '$(srcdir)/'`google/protobuf/compiler/java/java_doc_comment_unittest.cc - -google/protobuf/compiler/java/protobuf_test-java_doc_comment_unittest.obj: google/protobuf/compiler/java/java_doc_comment_unittest.cc -@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(protobuf_test_CPPFLAGS) $(CPPFLAGS) $(protobuf_test_CXXFLAGS) $(CXXFLAGS) -MT google/protobuf/compiler/java/protobuf_test-java_doc_comment_unittest.obj -MD -MP -MF google/protobuf/compiler/java/$(DEPDIR)/protobuf_test-java_doc_comment_unittest.Tpo -c -o google/protobuf/compiler/java/protobuf_test-java_doc_comment_unittest.obj `if test -f 'google/protobuf/compiler/java/java_doc_comment_unittest.cc'; then $(CYGPATH_W) 'google/protobuf/compiler/java/java_doc_comment_unittest.cc'; else $(CYGPATH_W) '$(srcdir)/google/protobuf/compiler/java/java_doc_comment_unittest.cc'; fi` -@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) google/protobuf/compiler/java/$(DEPDIR)/protobuf_test-java_doc_comment_unittest.Tpo google/protobuf/compiler/java/$(DEPDIR)/protobuf_test-java_doc_comment_unittest.Po -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='google/protobuf/compiler/java/java_doc_comment_unittest.cc' object='google/protobuf/compiler/java/protobuf_test-java_doc_comment_unittest.obj' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(protobuf_test_CPPFLAGS) $(CPPFLAGS) $(protobuf_test_CXXFLAGS) $(CXXFLAGS) -c -o google/protobuf/compiler/java/protobuf_test-java_doc_comment_unittest.obj `if test -f 'google/protobuf/compiler/java/java_doc_comment_unittest.cc'; then $(CYGPATH_W) 'google/protobuf/compiler/java/java_doc_comment_unittest.cc'; else $(CYGPATH_W) '$(srcdir)/google/protobuf/compiler/java/java_doc_comment_unittest.cc'; fi` - -google/protobuf/compiler/java/protobuf_test-java_plugin_unittest.o: google/protobuf/compiler/java/java_plugin_unittest.cc -@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(protobuf_test_CPPFLAGS) $(CPPFLAGS) $(protobuf_test_CXXFLAGS) $(CXXFLAGS) -MT google/protobuf/compiler/java/protobuf_test-java_plugin_unittest.o -MD -MP -MF google/protobuf/compiler/java/$(DEPDIR)/protobuf_test-java_plugin_unittest.Tpo -c -o google/protobuf/compiler/java/protobuf_test-java_plugin_unittest.o `test -f 'google/protobuf/compiler/java/java_plugin_unittest.cc' || echo '$(srcdir)/'`google/protobuf/compiler/java/java_plugin_unittest.cc -@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) google/protobuf/compiler/java/$(DEPDIR)/protobuf_test-java_plugin_unittest.Tpo google/protobuf/compiler/java/$(DEPDIR)/protobuf_test-java_plugin_unittest.Po -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='google/protobuf/compiler/java/java_plugin_unittest.cc' object='google/protobuf/compiler/java/protobuf_test-java_plugin_unittest.o' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(protobuf_test_CPPFLAGS) $(CPPFLAGS) $(protobuf_test_CXXFLAGS) $(CXXFLAGS) -c -o google/protobuf/compiler/java/protobuf_test-java_plugin_unittest.o `test -f 'google/protobuf/compiler/java/java_plugin_unittest.cc' || echo '$(srcdir)/'`google/protobuf/compiler/java/java_plugin_unittest.cc - -google/protobuf/compiler/java/protobuf_test-java_plugin_unittest.obj: google/protobuf/compiler/java/java_plugin_unittest.cc -@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(protobuf_test_CPPFLAGS) $(CPPFLAGS) $(protobuf_test_CXXFLAGS) $(CXXFLAGS) -MT google/protobuf/compiler/java/protobuf_test-java_plugin_unittest.obj -MD -MP -MF google/protobuf/compiler/java/$(DEPDIR)/protobuf_test-java_plugin_unittest.Tpo -c -o google/protobuf/compiler/java/protobuf_test-java_plugin_unittest.obj `if test -f 'google/protobuf/compiler/java/java_plugin_unittest.cc'; then $(CYGPATH_W) 'google/protobuf/compiler/java/java_plugin_unittest.cc'; else $(CYGPATH_W) '$(srcdir)/google/protobuf/compiler/java/java_plugin_unittest.cc'; fi` -@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) google/protobuf/compiler/java/$(DEPDIR)/protobuf_test-java_plugin_unittest.Tpo google/protobuf/compiler/java/$(DEPDIR)/protobuf_test-java_plugin_unittest.Po -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='google/protobuf/compiler/java/java_plugin_unittest.cc' object='google/protobuf/compiler/java/protobuf_test-java_plugin_unittest.obj' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(protobuf_test_CPPFLAGS) $(CPPFLAGS) $(protobuf_test_CXXFLAGS) $(CXXFLAGS) -c -o google/protobuf/compiler/java/protobuf_test-java_plugin_unittest.obj `if test -f 'google/protobuf/compiler/java/java_plugin_unittest.cc'; then $(CYGPATH_W) 'google/protobuf/compiler/java/java_plugin_unittest.cc'; else $(CYGPATH_W) '$(srcdir)/google/protobuf/compiler/java/java_plugin_unittest.cc'; fi` - -google/protobuf/compiler/protobuf_test-mock_code_generator.o: google/protobuf/compiler/mock_code_generator.cc -@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(protobuf_test_CPPFLAGS) $(CPPFLAGS) $(protobuf_test_CXXFLAGS) $(CXXFLAGS) -MT google/protobuf/compiler/protobuf_test-mock_code_generator.o -MD -MP -MF google/protobuf/compiler/$(DEPDIR)/protobuf_test-mock_code_generator.Tpo -c -o google/protobuf/compiler/protobuf_test-mock_code_generator.o `test -f 'google/protobuf/compiler/mock_code_generator.cc' || echo '$(srcdir)/'`google/protobuf/compiler/mock_code_generator.cc -@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) google/protobuf/compiler/$(DEPDIR)/protobuf_test-mock_code_generator.Tpo google/protobuf/compiler/$(DEPDIR)/protobuf_test-mock_code_generator.Po -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='google/protobuf/compiler/mock_code_generator.cc' object='google/protobuf/compiler/protobuf_test-mock_code_generator.o' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(protobuf_test_CPPFLAGS) $(CPPFLAGS) $(protobuf_test_CXXFLAGS) $(CXXFLAGS) -c -o google/protobuf/compiler/protobuf_test-mock_code_generator.o `test -f 'google/protobuf/compiler/mock_code_generator.cc' || echo '$(srcdir)/'`google/protobuf/compiler/mock_code_generator.cc - -google/protobuf/compiler/protobuf_test-mock_code_generator.obj: google/protobuf/compiler/mock_code_generator.cc -@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(protobuf_test_CPPFLAGS) $(CPPFLAGS) $(protobuf_test_CXXFLAGS) $(CXXFLAGS) -MT google/protobuf/compiler/protobuf_test-mock_code_generator.obj -MD -MP -MF google/protobuf/compiler/$(DEPDIR)/protobuf_test-mock_code_generator.Tpo -c -o google/protobuf/compiler/protobuf_test-mock_code_generator.obj `if test -f 'google/protobuf/compiler/mock_code_generator.cc'; then $(CYGPATH_W) 'google/protobuf/compiler/mock_code_generator.cc'; else $(CYGPATH_W) '$(srcdir)/google/protobuf/compiler/mock_code_generator.cc'; fi` -@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) google/protobuf/compiler/$(DEPDIR)/protobuf_test-mock_code_generator.Tpo google/protobuf/compiler/$(DEPDIR)/protobuf_test-mock_code_generator.Po -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='google/protobuf/compiler/mock_code_generator.cc' object='google/protobuf/compiler/protobuf_test-mock_code_generator.obj' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(protobuf_test_CPPFLAGS) $(CPPFLAGS) $(protobuf_test_CXXFLAGS) $(CXXFLAGS) -c -o google/protobuf/compiler/protobuf_test-mock_code_generator.obj `if test -f 'google/protobuf/compiler/mock_code_generator.cc'; then $(CYGPATH_W) 'google/protobuf/compiler/mock_code_generator.cc'; else $(CYGPATH_W) '$(srcdir)/google/protobuf/compiler/mock_code_generator.cc'; fi` - -google/protobuf/compiler/objectivec/protobuf_test-objectivec_helpers_unittest.o: google/protobuf/compiler/objectivec/objectivec_helpers_unittest.cc -@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(protobuf_test_CPPFLAGS) $(CPPFLAGS) $(protobuf_test_CXXFLAGS) $(CXXFLAGS) -MT google/protobuf/compiler/objectivec/protobuf_test-objectivec_helpers_unittest.o -MD -MP -MF google/protobuf/compiler/objectivec/$(DEPDIR)/protobuf_test-objectivec_helpers_unittest.Tpo -c -o google/protobuf/compiler/objectivec/protobuf_test-objectivec_helpers_unittest.o `test -f 'google/protobuf/compiler/objectivec/objectivec_helpers_unittest.cc' || echo '$(srcdir)/'`google/protobuf/compiler/objectivec/objectivec_helpers_unittest.cc -@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) google/protobuf/compiler/objectivec/$(DEPDIR)/protobuf_test-objectivec_helpers_unittest.Tpo google/protobuf/compiler/objectivec/$(DEPDIR)/protobuf_test-objectivec_helpers_unittest.Po -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='google/protobuf/compiler/objectivec/objectivec_helpers_unittest.cc' object='google/protobuf/compiler/objectivec/protobuf_test-objectivec_helpers_unittest.o' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(protobuf_test_CPPFLAGS) $(CPPFLAGS) $(protobuf_test_CXXFLAGS) $(CXXFLAGS) -c -o google/protobuf/compiler/objectivec/protobuf_test-objectivec_helpers_unittest.o `test -f 'google/protobuf/compiler/objectivec/objectivec_helpers_unittest.cc' || echo '$(srcdir)/'`google/protobuf/compiler/objectivec/objectivec_helpers_unittest.cc - -google/protobuf/compiler/objectivec/protobuf_test-objectivec_helpers_unittest.obj: google/protobuf/compiler/objectivec/objectivec_helpers_unittest.cc -@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(protobuf_test_CPPFLAGS) $(CPPFLAGS) $(protobuf_test_CXXFLAGS) $(CXXFLAGS) -MT google/protobuf/compiler/objectivec/protobuf_test-objectivec_helpers_unittest.obj -MD -MP -MF google/protobuf/compiler/objectivec/$(DEPDIR)/protobuf_test-objectivec_helpers_unittest.Tpo -c -o google/protobuf/compiler/objectivec/protobuf_test-objectivec_helpers_unittest.obj `if test -f 'google/protobuf/compiler/objectivec/objectivec_helpers_unittest.cc'; then $(CYGPATH_W) 'google/protobuf/compiler/objectivec/objectivec_helpers_unittest.cc'; else $(CYGPATH_W) '$(srcdir)/google/protobuf/compiler/objectivec/objectivec_helpers_unittest.cc'; fi` -@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) google/protobuf/compiler/objectivec/$(DEPDIR)/protobuf_test-objectivec_helpers_unittest.Tpo google/protobuf/compiler/objectivec/$(DEPDIR)/protobuf_test-objectivec_helpers_unittest.Po -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='google/protobuf/compiler/objectivec/objectivec_helpers_unittest.cc' object='google/protobuf/compiler/objectivec/protobuf_test-objectivec_helpers_unittest.obj' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(protobuf_test_CPPFLAGS) $(CPPFLAGS) $(protobuf_test_CXXFLAGS) $(CXXFLAGS) -c -o google/protobuf/compiler/objectivec/protobuf_test-objectivec_helpers_unittest.obj `if test -f 'google/protobuf/compiler/objectivec/objectivec_helpers_unittest.cc'; then $(CYGPATH_W) 'google/protobuf/compiler/objectivec/objectivec_helpers_unittest.cc'; else $(CYGPATH_W) '$(srcdir)/google/protobuf/compiler/objectivec/objectivec_helpers_unittest.cc'; fi` - -google/protobuf/compiler/protobuf_test-parser_unittest.o: google/protobuf/compiler/parser_unittest.cc -@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(protobuf_test_CPPFLAGS) $(CPPFLAGS) $(protobuf_test_CXXFLAGS) $(CXXFLAGS) -MT google/protobuf/compiler/protobuf_test-parser_unittest.o -MD -MP -MF google/protobuf/compiler/$(DEPDIR)/protobuf_test-parser_unittest.Tpo -c -o google/protobuf/compiler/protobuf_test-parser_unittest.o `test -f 'google/protobuf/compiler/parser_unittest.cc' || echo '$(srcdir)/'`google/protobuf/compiler/parser_unittest.cc -@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) google/protobuf/compiler/$(DEPDIR)/protobuf_test-parser_unittest.Tpo google/protobuf/compiler/$(DEPDIR)/protobuf_test-parser_unittest.Po -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='google/protobuf/compiler/parser_unittest.cc' object='google/protobuf/compiler/protobuf_test-parser_unittest.o' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(protobuf_test_CPPFLAGS) $(CPPFLAGS) $(protobuf_test_CXXFLAGS) $(CXXFLAGS) -c -o google/protobuf/compiler/protobuf_test-parser_unittest.o `test -f 'google/protobuf/compiler/parser_unittest.cc' || echo '$(srcdir)/'`google/protobuf/compiler/parser_unittest.cc - -google/protobuf/compiler/protobuf_test-parser_unittest.obj: google/protobuf/compiler/parser_unittest.cc -@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(protobuf_test_CPPFLAGS) $(CPPFLAGS) $(protobuf_test_CXXFLAGS) $(CXXFLAGS) -MT google/protobuf/compiler/protobuf_test-parser_unittest.obj -MD -MP -MF google/protobuf/compiler/$(DEPDIR)/protobuf_test-parser_unittest.Tpo -c -o google/protobuf/compiler/protobuf_test-parser_unittest.obj `if test -f 'google/protobuf/compiler/parser_unittest.cc'; then $(CYGPATH_W) 'google/protobuf/compiler/parser_unittest.cc'; else $(CYGPATH_W) '$(srcdir)/google/protobuf/compiler/parser_unittest.cc'; fi` -@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) google/protobuf/compiler/$(DEPDIR)/protobuf_test-parser_unittest.Tpo google/protobuf/compiler/$(DEPDIR)/protobuf_test-parser_unittest.Po -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='google/protobuf/compiler/parser_unittest.cc' object='google/protobuf/compiler/protobuf_test-parser_unittest.obj' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(protobuf_test_CPPFLAGS) $(CPPFLAGS) $(protobuf_test_CXXFLAGS) $(CXXFLAGS) -c -o google/protobuf/compiler/protobuf_test-parser_unittest.obj `if test -f 'google/protobuf/compiler/parser_unittest.cc'; then $(CYGPATH_W) 'google/protobuf/compiler/parser_unittest.cc'; else $(CYGPATH_W) '$(srcdir)/google/protobuf/compiler/parser_unittest.cc'; fi` - -google/protobuf/compiler/python/protobuf_test-python_plugin_unittest.o: google/protobuf/compiler/python/python_plugin_unittest.cc -@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(protobuf_test_CPPFLAGS) $(CPPFLAGS) $(protobuf_test_CXXFLAGS) $(CXXFLAGS) -MT google/protobuf/compiler/python/protobuf_test-python_plugin_unittest.o -MD -MP -MF google/protobuf/compiler/python/$(DEPDIR)/protobuf_test-python_plugin_unittest.Tpo -c -o google/protobuf/compiler/python/protobuf_test-python_plugin_unittest.o `test -f 'google/protobuf/compiler/python/python_plugin_unittest.cc' || echo '$(srcdir)/'`google/protobuf/compiler/python/python_plugin_unittest.cc -@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) google/protobuf/compiler/python/$(DEPDIR)/protobuf_test-python_plugin_unittest.Tpo google/protobuf/compiler/python/$(DEPDIR)/protobuf_test-python_plugin_unittest.Po -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='google/protobuf/compiler/python/python_plugin_unittest.cc' object='google/protobuf/compiler/python/protobuf_test-python_plugin_unittest.o' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(protobuf_test_CPPFLAGS) $(CPPFLAGS) $(protobuf_test_CXXFLAGS) $(CXXFLAGS) -c -o google/protobuf/compiler/python/protobuf_test-python_plugin_unittest.o `test -f 'google/protobuf/compiler/python/python_plugin_unittest.cc' || echo '$(srcdir)/'`google/protobuf/compiler/python/python_plugin_unittest.cc - -google/protobuf/compiler/python/protobuf_test-python_plugin_unittest.obj: google/protobuf/compiler/python/python_plugin_unittest.cc -@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(protobuf_test_CPPFLAGS) $(CPPFLAGS) $(protobuf_test_CXXFLAGS) $(CXXFLAGS) -MT google/protobuf/compiler/python/protobuf_test-python_plugin_unittest.obj -MD -MP -MF google/protobuf/compiler/python/$(DEPDIR)/protobuf_test-python_plugin_unittest.Tpo -c -o google/protobuf/compiler/python/protobuf_test-python_plugin_unittest.obj `if test -f 'google/protobuf/compiler/python/python_plugin_unittest.cc'; then $(CYGPATH_W) 'google/protobuf/compiler/python/python_plugin_unittest.cc'; else $(CYGPATH_W) '$(srcdir)/google/protobuf/compiler/python/python_plugin_unittest.cc'; fi` -@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) google/protobuf/compiler/python/$(DEPDIR)/protobuf_test-python_plugin_unittest.Tpo google/protobuf/compiler/python/$(DEPDIR)/protobuf_test-python_plugin_unittest.Po -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='google/protobuf/compiler/python/python_plugin_unittest.cc' object='google/protobuf/compiler/python/protobuf_test-python_plugin_unittest.obj' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(protobuf_test_CPPFLAGS) $(CPPFLAGS) $(protobuf_test_CXXFLAGS) $(CXXFLAGS) -c -o google/protobuf/compiler/python/protobuf_test-python_plugin_unittest.obj `if test -f 'google/protobuf/compiler/python/python_plugin_unittest.cc'; then $(CYGPATH_W) 'google/protobuf/compiler/python/python_plugin_unittest.cc'; else $(CYGPATH_W) '$(srcdir)/google/protobuf/compiler/python/python_plugin_unittest.cc'; fi` - -google/protobuf/compiler/ruby/protobuf_test-ruby_generator_unittest.o: google/protobuf/compiler/ruby/ruby_generator_unittest.cc -@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(protobuf_test_CPPFLAGS) $(CPPFLAGS) $(protobuf_test_CXXFLAGS) $(CXXFLAGS) -MT google/protobuf/compiler/ruby/protobuf_test-ruby_generator_unittest.o -MD -MP -MF google/protobuf/compiler/ruby/$(DEPDIR)/protobuf_test-ruby_generator_unittest.Tpo -c -o google/protobuf/compiler/ruby/protobuf_test-ruby_generator_unittest.o `test -f 'google/protobuf/compiler/ruby/ruby_generator_unittest.cc' || echo '$(srcdir)/'`google/protobuf/compiler/ruby/ruby_generator_unittest.cc -@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) google/protobuf/compiler/ruby/$(DEPDIR)/protobuf_test-ruby_generator_unittest.Tpo google/protobuf/compiler/ruby/$(DEPDIR)/protobuf_test-ruby_generator_unittest.Po -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='google/protobuf/compiler/ruby/ruby_generator_unittest.cc' object='google/protobuf/compiler/ruby/protobuf_test-ruby_generator_unittest.o' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(protobuf_test_CPPFLAGS) $(CPPFLAGS) $(protobuf_test_CXXFLAGS) $(CXXFLAGS) -c -o google/protobuf/compiler/ruby/protobuf_test-ruby_generator_unittest.o `test -f 'google/protobuf/compiler/ruby/ruby_generator_unittest.cc' || echo '$(srcdir)/'`google/protobuf/compiler/ruby/ruby_generator_unittest.cc - -google/protobuf/compiler/ruby/protobuf_test-ruby_generator_unittest.obj: google/protobuf/compiler/ruby/ruby_generator_unittest.cc -@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(protobuf_test_CPPFLAGS) $(CPPFLAGS) $(protobuf_test_CXXFLAGS) $(CXXFLAGS) -MT google/protobuf/compiler/ruby/protobuf_test-ruby_generator_unittest.obj -MD -MP -MF google/protobuf/compiler/ruby/$(DEPDIR)/protobuf_test-ruby_generator_unittest.Tpo -c -o google/protobuf/compiler/ruby/protobuf_test-ruby_generator_unittest.obj `if test -f 'google/protobuf/compiler/ruby/ruby_generator_unittest.cc'; then $(CYGPATH_W) 'google/protobuf/compiler/ruby/ruby_generator_unittest.cc'; else $(CYGPATH_W) '$(srcdir)/google/protobuf/compiler/ruby/ruby_generator_unittest.cc'; fi` -@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) google/protobuf/compiler/ruby/$(DEPDIR)/protobuf_test-ruby_generator_unittest.Tpo google/protobuf/compiler/ruby/$(DEPDIR)/protobuf_test-ruby_generator_unittest.Po -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='google/protobuf/compiler/ruby/ruby_generator_unittest.cc' object='google/protobuf/compiler/ruby/protobuf_test-ruby_generator_unittest.obj' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(protobuf_test_CPPFLAGS) $(CPPFLAGS) $(protobuf_test_CXXFLAGS) $(CXXFLAGS) -c -o google/protobuf/compiler/ruby/protobuf_test-ruby_generator_unittest.obj `if test -f 'google/protobuf/compiler/ruby/ruby_generator_unittest.cc'; then $(CYGPATH_W) 'google/protobuf/compiler/ruby/ruby_generator_unittest.cc'; else $(CYGPATH_W) '$(srcdir)/google/protobuf/compiler/ruby/ruby_generator_unittest.cc'; fi` - -google/protobuf/protobuf_test-descriptor_database_unittest.o: google/protobuf/descriptor_database_unittest.cc -@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(protobuf_test_CPPFLAGS) $(CPPFLAGS) $(protobuf_test_CXXFLAGS) $(CXXFLAGS) -MT google/protobuf/protobuf_test-descriptor_database_unittest.o -MD -MP -MF google/protobuf/$(DEPDIR)/protobuf_test-descriptor_database_unittest.Tpo -c -o google/protobuf/protobuf_test-descriptor_database_unittest.o `test -f 'google/protobuf/descriptor_database_unittest.cc' || echo '$(srcdir)/'`google/protobuf/descriptor_database_unittest.cc -@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) google/protobuf/$(DEPDIR)/protobuf_test-descriptor_database_unittest.Tpo google/protobuf/$(DEPDIR)/protobuf_test-descriptor_database_unittest.Po -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='google/protobuf/descriptor_database_unittest.cc' object='google/protobuf/protobuf_test-descriptor_database_unittest.o' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(protobuf_test_CPPFLAGS) $(CPPFLAGS) $(protobuf_test_CXXFLAGS) $(CXXFLAGS) -c -o google/protobuf/protobuf_test-descriptor_database_unittest.o `test -f 'google/protobuf/descriptor_database_unittest.cc' || echo '$(srcdir)/'`google/protobuf/descriptor_database_unittest.cc - -google/protobuf/protobuf_test-descriptor_database_unittest.obj: google/protobuf/descriptor_database_unittest.cc -@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(protobuf_test_CPPFLAGS) $(CPPFLAGS) $(protobuf_test_CXXFLAGS) $(CXXFLAGS) -MT google/protobuf/protobuf_test-descriptor_database_unittest.obj -MD -MP -MF google/protobuf/$(DEPDIR)/protobuf_test-descriptor_database_unittest.Tpo -c -o google/protobuf/protobuf_test-descriptor_database_unittest.obj `if test -f 'google/protobuf/descriptor_database_unittest.cc'; then $(CYGPATH_W) 'google/protobuf/descriptor_database_unittest.cc'; else $(CYGPATH_W) '$(srcdir)/google/protobuf/descriptor_database_unittest.cc'; fi` -@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) google/protobuf/$(DEPDIR)/protobuf_test-descriptor_database_unittest.Tpo google/protobuf/$(DEPDIR)/protobuf_test-descriptor_database_unittest.Po -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='google/protobuf/descriptor_database_unittest.cc' object='google/protobuf/protobuf_test-descriptor_database_unittest.obj' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(protobuf_test_CPPFLAGS) $(CPPFLAGS) $(protobuf_test_CXXFLAGS) $(CXXFLAGS) -c -o google/protobuf/protobuf_test-descriptor_database_unittest.obj `if test -f 'google/protobuf/descriptor_database_unittest.cc'; then $(CYGPATH_W) 'google/protobuf/descriptor_database_unittest.cc'; else $(CYGPATH_W) '$(srcdir)/google/protobuf/descriptor_database_unittest.cc'; fi` - -google/protobuf/protobuf_test-descriptor_unittest.o: google/protobuf/descriptor_unittest.cc -@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(protobuf_test_CPPFLAGS) $(CPPFLAGS) $(protobuf_test_CXXFLAGS) $(CXXFLAGS) -MT google/protobuf/protobuf_test-descriptor_unittest.o -MD -MP -MF google/protobuf/$(DEPDIR)/protobuf_test-descriptor_unittest.Tpo -c -o google/protobuf/protobuf_test-descriptor_unittest.o `test -f 'google/protobuf/descriptor_unittest.cc' || echo '$(srcdir)/'`google/protobuf/descriptor_unittest.cc -@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) google/protobuf/$(DEPDIR)/protobuf_test-descriptor_unittest.Tpo google/protobuf/$(DEPDIR)/protobuf_test-descriptor_unittest.Po -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='google/protobuf/descriptor_unittest.cc' object='google/protobuf/protobuf_test-descriptor_unittest.o' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(protobuf_test_CPPFLAGS) $(CPPFLAGS) $(protobuf_test_CXXFLAGS) $(CXXFLAGS) -c -o google/protobuf/protobuf_test-descriptor_unittest.o `test -f 'google/protobuf/descriptor_unittest.cc' || echo '$(srcdir)/'`google/protobuf/descriptor_unittest.cc - -google/protobuf/protobuf_test-descriptor_unittest.obj: google/protobuf/descriptor_unittest.cc -@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(protobuf_test_CPPFLAGS) $(CPPFLAGS) $(protobuf_test_CXXFLAGS) $(CXXFLAGS) -MT google/protobuf/protobuf_test-descriptor_unittest.obj -MD -MP -MF google/protobuf/$(DEPDIR)/protobuf_test-descriptor_unittest.Tpo -c -o google/protobuf/protobuf_test-descriptor_unittest.obj `if test -f 'google/protobuf/descriptor_unittest.cc'; then $(CYGPATH_W) 'google/protobuf/descriptor_unittest.cc'; else $(CYGPATH_W) '$(srcdir)/google/protobuf/descriptor_unittest.cc'; fi` -@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) google/protobuf/$(DEPDIR)/protobuf_test-descriptor_unittest.Tpo google/protobuf/$(DEPDIR)/protobuf_test-descriptor_unittest.Po -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='google/protobuf/descriptor_unittest.cc' object='google/protobuf/protobuf_test-descriptor_unittest.obj' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(protobuf_test_CPPFLAGS) $(CPPFLAGS) $(protobuf_test_CXXFLAGS) $(CXXFLAGS) -c -o google/protobuf/protobuf_test-descriptor_unittest.obj `if test -f 'google/protobuf/descriptor_unittest.cc'; then $(CYGPATH_W) 'google/protobuf/descriptor_unittest.cc'; else $(CYGPATH_W) '$(srcdir)/google/protobuf/descriptor_unittest.cc'; fi` - -google/protobuf/protobuf_test-drop_unknown_fields_test.o: google/protobuf/drop_unknown_fields_test.cc -@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(protobuf_test_CPPFLAGS) $(CPPFLAGS) $(protobuf_test_CXXFLAGS) $(CXXFLAGS) -MT google/protobuf/protobuf_test-drop_unknown_fields_test.o -MD -MP -MF google/protobuf/$(DEPDIR)/protobuf_test-drop_unknown_fields_test.Tpo -c -o google/protobuf/protobuf_test-drop_unknown_fields_test.o `test -f 'google/protobuf/drop_unknown_fields_test.cc' || echo '$(srcdir)/'`google/protobuf/drop_unknown_fields_test.cc -@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) google/protobuf/$(DEPDIR)/protobuf_test-drop_unknown_fields_test.Tpo google/protobuf/$(DEPDIR)/protobuf_test-drop_unknown_fields_test.Po -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='google/protobuf/drop_unknown_fields_test.cc' object='google/protobuf/protobuf_test-drop_unknown_fields_test.o' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(protobuf_test_CPPFLAGS) $(CPPFLAGS) $(protobuf_test_CXXFLAGS) $(CXXFLAGS) -c -o google/protobuf/protobuf_test-drop_unknown_fields_test.o `test -f 'google/protobuf/drop_unknown_fields_test.cc' || echo '$(srcdir)/'`google/protobuf/drop_unknown_fields_test.cc - -google/protobuf/protobuf_test-drop_unknown_fields_test.obj: google/protobuf/drop_unknown_fields_test.cc -@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(protobuf_test_CPPFLAGS) $(CPPFLAGS) $(protobuf_test_CXXFLAGS) $(CXXFLAGS) -MT google/protobuf/protobuf_test-drop_unknown_fields_test.obj -MD -MP -MF google/protobuf/$(DEPDIR)/protobuf_test-drop_unknown_fields_test.Tpo -c -o google/protobuf/protobuf_test-drop_unknown_fields_test.obj `if test -f 'google/protobuf/drop_unknown_fields_test.cc'; then $(CYGPATH_W) 'google/protobuf/drop_unknown_fields_test.cc'; else $(CYGPATH_W) '$(srcdir)/google/protobuf/drop_unknown_fields_test.cc'; fi` -@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) google/protobuf/$(DEPDIR)/protobuf_test-drop_unknown_fields_test.Tpo google/protobuf/$(DEPDIR)/protobuf_test-drop_unknown_fields_test.Po -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='google/protobuf/drop_unknown_fields_test.cc' object='google/protobuf/protobuf_test-drop_unknown_fields_test.obj' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(protobuf_test_CPPFLAGS) $(CPPFLAGS) $(protobuf_test_CXXFLAGS) $(CXXFLAGS) -c -o google/protobuf/protobuf_test-drop_unknown_fields_test.obj `if test -f 'google/protobuf/drop_unknown_fields_test.cc'; then $(CYGPATH_W) 'google/protobuf/drop_unknown_fields_test.cc'; else $(CYGPATH_W) '$(srcdir)/google/protobuf/drop_unknown_fields_test.cc'; fi` - -google/protobuf/protobuf_test-dynamic_message_unittest.o: google/protobuf/dynamic_message_unittest.cc -@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(protobuf_test_CPPFLAGS) $(CPPFLAGS) $(protobuf_test_CXXFLAGS) $(CXXFLAGS) -MT google/protobuf/protobuf_test-dynamic_message_unittest.o -MD -MP -MF google/protobuf/$(DEPDIR)/protobuf_test-dynamic_message_unittest.Tpo -c -o google/protobuf/protobuf_test-dynamic_message_unittest.o `test -f 'google/protobuf/dynamic_message_unittest.cc' || echo '$(srcdir)/'`google/protobuf/dynamic_message_unittest.cc -@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) google/protobuf/$(DEPDIR)/protobuf_test-dynamic_message_unittest.Tpo google/protobuf/$(DEPDIR)/protobuf_test-dynamic_message_unittest.Po -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='google/protobuf/dynamic_message_unittest.cc' object='google/protobuf/protobuf_test-dynamic_message_unittest.o' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(protobuf_test_CPPFLAGS) $(CPPFLAGS) $(protobuf_test_CXXFLAGS) $(CXXFLAGS) -c -o google/protobuf/protobuf_test-dynamic_message_unittest.o `test -f 'google/protobuf/dynamic_message_unittest.cc' || echo '$(srcdir)/'`google/protobuf/dynamic_message_unittest.cc - -google/protobuf/protobuf_test-dynamic_message_unittest.obj: google/protobuf/dynamic_message_unittest.cc -@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(protobuf_test_CPPFLAGS) $(CPPFLAGS) $(protobuf_test_CXXFLAGS) $(CXXFLAGS) -MT google/protobuf/protobuf_test-dynamic_message_unittest.obj -MD -MP -MF google/protobuf/$(DEPDIR)/protobuf_test-dynamic_message_unittest.Tpo -c -o google/protobuf/protobuf_test-dynamic_message_unittest.obj `if test -f 'google/protobuf/dynamic_message_unittest.cc'; then $(CYGPATH_W) 'google/protobuf/dynamic_message_unittest.cc'; else $(CYGPATH_W) '$(srcdir)/google/protobuf/dynamic_message_unittest.cc'; fi` -@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) google/protobuf/$(DEPDIR)/protobuf_test-dynamic_message_unittest.Tpo google/protobuf/$(DEPDIR)/protobuf_test-dynamic_message_unittest.Po -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='google/protobuf/dynamic_message_unittest.cc' object='google/protobuf/protobuf_test-dynamic_message_unittest.obj' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(protobuf_test_CPPFLAGS) $(CPPFLAGS) $(protobuf_test_CXXFLAGS) $(CXXFLAGS) -c -o google/protobuf/protobuf_test-dynamic_message_unittest.obj `if test -f 'google/protobuf/dynamic_message_unittest.cc'; then $(CYGPATH_W) 'google/protobuf/dynamic_message_unittest.cc'; else $(CYGPATH_W) '$(srcdir)/google/protobuf/dynamic_message_unittest.cc'; fi` - -google/protobuf/protobuf_test-extension_set_unittest.o: google/protobuf/extension_set_unittest.cc -@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(protobuf_test_CPPFLAGS) $(CPPFLAGS) $(protobuf_test_CXXFLAGS) $(CXXFLAGS) -MT google/protobuf/protobuf_test-extension_set_unittest.o -MD -MP -MF google/protobuf/$(DEPDIR)/protobuf_test-extension_set_unittest.Tpo -c -o google/protobuf/protobuf_test-extension_set_unittest.o `test -f 'google/protobuf/extension_set_unittest.cc' || echo '$(srcdir)/'`google/protobuf/extension_set_unittest.cc -@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) google/protobuf/$(DEPDIR)/protobuf_test-extension_set_unittest.Tpo google/protobuf/$(DEPDIR)/protobuf_test-extension_set_unittest.Po -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='google/protobuf/extension_set_unittest.cc' object='google/protobuf/protobuf_test-extension_set_unittest.o' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(protobuf_test_CPPFLAGS) $(CPPFLAGS) $(protobuf_test_CXXFLAGS) $(CXXFLAGS) -c -o google/protobuf/protobuf_test-extension_set_unittest.o `test -f 'google/protobuf/extension_set_unittest.cc' || echo '$(srcdir)/'`google/protobuf/extension_set_unittest.cc - -google/protobuf/protobuf_test-extension_set_unittest.obj: google/protobuf/extension_set_unittest.cc -@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(protobuf_test_CPPFLAGS) $(CPPFLAGS) $(protobuf_test_CXXFLAGS) $(CXXFLAGS) -MT google/protobuf/protobuf_test-extension_set_unittest.obj -MD -MP -MF google/protobuf/$(DEPDIR)/protobuf_test-extension_set_unittest.Tpo -c -o google/protobuf/protobuf_test-extension_set_unittest.obj `if test -f 'google/protobuf/extension_set_unittest.cc'; then $(CYGPATH_W) 'google/protobuf/extension_set_unittest.cc'; else $(CYGPATH_W) '$(srcdir)/google/protobuf/extension_set_unittest.cc'; fi` -@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) google/protobuf/$(DEPDIR)/protobuf_test-extension_set_unittest.Tpo google/protobuf/$(DEPDIR)/protobuf_test-extension_set_unittest.Po -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='google/protobuf/extension_set_unittest.cc' object='google/protobuf/protobuf_test-extension_set_unittest.obj' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(protobuf_test_CPPFLAGS) $(CPPFLAGS) $(protobuf_test_CXXFLAGS) $(CXXFLAGS) -c -o google/protobuf/protobuf_test-extension_set_unittest.obj `if test -f 'google/protobuf/extension_set_unittest.cc'; then $(CYGPATH_W) 'google/protobuf/extension_set_unittest.cc'; else $(CYGPATH_W) '$(srcdir)/google/protobuf/extension_set_unittest.cc'; fi` - -google/protobuf/protobuf_test-generated_message_reflection_unittest.o: google/protobuf/generated_message_reflection_unittest.cc -@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(protobuf_test_CPPFLAGS) $(CPPFLAGS) $(protobuf_test_CXXFLAGS) $(CXXFLAGS) -MT google/protobuf/protobuf_test-generated_message_reflection_unittest.o -MD -MP -MF google/protobuf/$(DEPDIR)/protobuf_test-generated_message_reflection_unittest.Tpo -c -o google/protobuf/protobuf_test-generated_message_reflection_unittest.o `test -f 'google/protobuf/generated_message_reflection_unittest.cc' || echo '$(srcdir)/'`google/protobuf/generated_message_reflection_unittest.cc -@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) google/protobuf/$(DEPDIR)/protobuf_test-generated_message_reflection_unittest.Tpo google/protobuf/$(DEPDIR)/protobuf_test-generated_message_reflection_unittest.Po -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='google/protobuf/generated_message_reflection_unittest.cc' object='google/protobuf/protobuf_test-generated_message_reflection_unittest.o' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(protobuf_test_CPPFLAGS) $(CPPFLAGS) $(protobuf_test_CXXFLAGS) $(CXXFLAGS) -c -o google/protobuf/protobuf_test-generated_message_reflection_unittest.o `test -f 'google/protobuf/generated_message_reflection_unittest.cc' || echo '$(srcdir)/'`google/protobuf/generated_message_reflection_unittest.cc - -google/protobuf/protobuf_test-generated_message_reflection_unittest.obj: google/protobuf/generated_message_reflection_unittest.cc -@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(protobuf_test_CPPFLAGS) $(CPPFLAGS) $(protobuf_test_CXXFLAGS) $(CXXFLAGS) -MT google/protobuf/protobuf_test-generated_message_reflection_unittest.obj -MD -MP -MF google/protobuf/$(DEPDIR)/protobuf_test-generated_message_reflection_unittest.Tpo -c -o google/protobuf/protobuf_test-generated_message_reflection_unittest.obj `if test -f 'google/protobuf/generated_message_reflection_unittest.cc'; then $(CYGPATH_W) 'google/protobuf/generated_message_reflection_unittest.cc'; else $(CYGPATH_W) '$(srcdir)/google/protobuf/generated_message_reflection_unittest.cc'; fi` -@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) google/protobuf/$(DEPDIR)/protobuf_test-generated_message_reflection_unittest.Tpo google/protobuf/$(DEPDIR)/protobuf_test-generated_message_reflection_unittest.Po -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='google/protobuf/generated_message_reflection_unittest.cc' object='google/protobuf/protobuf_test-generated_message_reflection_unittest.obj' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(protobuf_test_CPPFLAGS) $(CPPFLAGS) $(protobuf_test_CXXFLAGS) $(CXXFLAGS) -c -o google/protobuf/protobuf_test-generated_message_reflection_unittest.obj `if test -f 'google/protobuf/generated_message_reflection_unittest.cc'; then $(CYGPATH_W) 'google/protobuf/generated_message_reflection_unittest.cc'; else $(CYGPATH_W) '$(srcdir)/google/protobuf/generated_message_reflection_unittest.cc'; fi` - -google/protobuf/protobuf_test-inlined_string_field_unittest.o: google/protobuf/inlined_string_field_unittest.cc -@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(protobuf_test_CPPFLAGS) $(CPPFLAGS) $(protobuf_test_CXXFLAGS) $(CXXFLAGS) -MT google/protobuf/protobuf_test-inlined_string_field_unittest.o -MD -MP -MF google/protobuf/$(DEPDIR)/protobuf_test-inlined_string_field_unittest.Tpo -c -o google/protobuf/protobuf_test-inlined_string_field_unittest.o `test -f 'google/protobuf/inlined_string_field_unittest.cc' || echo '$(srcdir)/'`google/protobuf/inlined_string_field_unittest.cc -@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) google/protobuf/$(DEPDIR)/protobuf_test-inlined_string_field_unittest.Tpo google/protobuf/$(DEPDIR)/protobuf_test-inlined_string_field_unittest.Po -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='google/protobuf/inlined_string_field_unittest.cc' object='google/protobuf/protobuf_test-inlined_string_field_unittest.o' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(protobuf_test_CPPFLAGS) $(CPPFLAGS) $(protobuf_test_CXXFLAGS) $(CXXFLAGS) -c -o google/protobuf/protobuf_test-inlined_string_field_unittest.o `test -f 'google/protobuf/inlined_string_field_unittest.cc' || echo '$(srcdir)/'`google/protobuf/inlined_string_field_unittest.cc - -google/protobuf/protobuf_test-inlined_string_field_unittest.obj: google/protobuf/inlined_string_field_unittest.cc -@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(protobuf_test_CPPFLAGS) $(CPPFLAGS) $(protobuf_test_CXXFLAGS) $(CXXFLAGS) -MT google/protobuf/protobuf_test-inlined_string_field_unittest.obj -MD -MP -MF google/protobuf/$(DEPDIR)/protobuf_test-inlined_string_field_unittest.Tpo -c -o google/protobuf/protobuf_test-inlined_string_field_unittest.obj `if test -f 'google/protobuf/inlined_string_field_unittest.cc'; then $(CYGPATH_W) 'google/protobuf/inlined_string_field_unittest.cc'; else $(CYGPATH_W) '$(srcdir)/google/protobuf/inlined_string_field_unittest.cc'; fi` -@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) google/protobuf/$(DEPDIR)/protobuf_test-inlined_string_field_unittest.Tpo google/protobuf/$(DEPDIR)/protobuf_test-inlined_string_field_unittest.Po -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='google/protobuf/inlined_string_field_unittest.cc' object='google/protobuf/protobuf_test-inlined_string_field_unittest.obj' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(protobuf_test_CPPFLAGS) $(CPPFLAGS) $(protobuf_test_CXXFLAGS) $(CXXFLAGS) -c -o google/protobuf/protobuf_test-inlined_string_field_unittest.obj `if test -f 'google/protobuf/inlined_string_field_unittest.cc'; then $(CYGPATH_W) 'google/protobuf/inlined_string_field_unittest.cc'; else $(CYGPATH_W) '$(srcdir)/google/protobuf/inlined_string_field_unittest.cc'; fi` - -google/protobuf/io/protobuf_test-coded_stream_unittest.o: google/protobuf/io/coded_stream_unittest.cc -@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(protobuf_test_CPPFLAGS) $(CPPFLAGS) $(protobuf_test_CXXFLAGS) $(CXXFLAGS) -MT google/protobuf/io/protobuf_test-coded_stream_unittest.o -MD -MP -MF google/protobuf/io/$(DEPDIR)/protobuf_test-coded_stream_unittest.Tpo -c -o google/protobuf/io/protobuf_test-coded_stream_unittest.o `test -f 'google/protobuf/io/coded_stream_unittest.cc' || echo '$(srcdir)/'`google/protobuf/io/coded_stream_unittest.cc -@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) google/protobuf/io/$(DEPDIR)/protobuf_test-coded_stream_unittest.Tpo google/protobuf/io/$(DEPDIR)/protobuf_test-coded_stream_unittest.Po -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='google/protobuf/io/coded_stream_unittest.cc' object='google/protobuf/io/protobuf_test-coded_stream_unittest.o' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(protobuf_test_CPPFLAGS) $(CPPFLAGS) $(protobuf_test_CXXFLAGS) $(CXXFLAGS) -c -o google/protobuf/io/protobuf_test-coded_stream_unittest.o `test -f 'google/protobuf/io/coded_stream_unittest.cc' || echo '$(srcdir)/'`google/protobuf/io/coded_stream_unittest.cc - -google/protobuf/io/protobuf_test-coded_stream_unittest.obj: google/protobuf/io/coded_stream_unittest.cc -@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(protobuf_test_CPPFLAGS) $(CPPFLAGS) $(protobuf_test_CXXFLAGS) $(CXXFLAGS) -MT google/protobuf/io/protobuf_test-coded_stream_unittest.obj -MD -MP -MF google/protobuf/io/$(DEPDIR)/protobuf_test-coded_stream_unittest.Tpo -c -o google/protobuf/io/protobuf_test-coded_stream_unittest.obj `if test -f 'google/protobuf/io/coded_stream_unittest.cc'; then $(CYGPATH_W) 'google/protobuf/io/coded_stream_unittest.cc'; else $(CYGPATH_W) '$(srcdir)/google/protobuf/io/coded_stream_unittest.cc'; fi` -@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) google/protobuf/io/$(DEPDIR)/protobuf_test-coded_stream_unittest.Tpo google/protobuf/io/$(DEPDIR)/protobuf_test-coded_stream_unittest.Po -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='google/protobuf/io/coded_stream_unittest.cc' object='google/protobuf/io/protobuf_test-coded_stream_unittest.obj' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(protobuf_test_CPPFLAGS) $(CPPFLAGS) $(protobuf_test_CXXFLAGS) $(CXXFLAGS) -c -o google/protobuf/io/protobuf_test-coded_stream_unittest.obj `if test -f 'google/protobuf/io/coded_stream_unittest.cc'; then $(CYGPATH_W) 'google/protobuf/io/coded_stream_unittest.cc'; else $(CYGPATH_W) '$(srcdir)/google/protobuf/io/coded_stream_unittest.cc'; fi` - -google/protobuf/io/protobuf_test-io_win32_unittest.o: google/protobuf/io/io_win32_unittest.cc -@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(protobuf_test_CPPFLAGS) $(CPPFLAGS) $(protobuf_test_CXXFLAGS) $(CXXFLAGS) -MT google/protobuf/io/protobuf_test-io_win32_unittest.o -MD -MP -MF google/protobuf/io/$(DEPDIR)/protobuf_test-io_win32_unittest.Tpo -c -o google/protobuf/io/protobuf_test-io_win32_unittest.o `test -f 'google/protobuf/io/io_win32_unittest.cc' || echo '$(srcdir)/'`google/protobuf/io/io_win32_unittest.cc -@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) google/protobuf/io/$(DEPDIR)/protobuf_test-io_win32_unittest.Tpo google/protobuf/io/$(DEPDIR)/protobuf_test-io_win32_unittest.Po -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='google/protobuf/io/io_win32_unittest.cc' object='google/protobuf/io/protobuf_test-io_win32_unittest.o' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(protobuf_test_CPPFLAGS) $(CPPFLAGS) $(protobuf_test_CXXFLAGS) $(CXXFLAGS) -c -o google/protobuf/io/protobuf_test-io_win32_unittest.o `test -f 'google/protobuf/io/io_win32_unittest.cc' || echo '$(srcdir)/'`google/protobuf/io/io_win32_unittest.cc - -google/protobuf/io/protobuf_test-io_win32_unittest.obj: google/protobuf/io/io_win32_unittest.cc -@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(protobuf_test_CPPFLAGS) $(CPPFLAGS) $(protobuf_test_CXXFLAGS) $(CXXFLAGS) -MT google/protobuf/io/protobuf_test-io_win32_unittest.obj -MD -MP -MF google/protobuf/io/$(DEPDIR)/protobuf_test-io_win32_unittest.Tpo -c -o google/protobuf/io/protobuf_test-io_win32_unittest.obj `if test -f 'google/protobuf/io/io_win32_unittest.cc'; then $(CYGPATH_W) 'google/protobuf/io/io_win32_unittest.cc'; else $(CYGPATH_W) '$(srcdir)/google/protobuf/io/io_win32_unittest.cc'; fi` -@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) google/protobuf/io/$(DEPDIR)/protobuf_test-io_win32_unittest.Tpo google/protobuf/io/$(DEPDIR)/protobuf_test-io_win32_unittest.Po -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='google/protobuf/io/io_win32_unittest.cc' object='google/protobuf/io/protobuf_test-io_win32_unittest.obj' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(protobuf_test_CPPFLAGS) $(CPPFLAGS) $(protobuf_test_CXXFLAGS) $(CXXFLAGS) -c -o google/protobuf/io/protobuf_test-io_win32_unittest.obj `if test -f 'google/protobuf/io/io_win32_unittest.cc'; then $(CYGPATH_W) 'google/protobuf/io/io_win32_unittest.cc'; else $(CYGPATH_W) '$(srcdir)/google/protobuf/io/io_win32_unittest.cc'; fi` - -google/protobuf/io/protobuf_test-printer_unittest.o: google/protobuf/io/printer_unittest.cc -@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(protobuf_test_CPPFLAGS) $(CPPFLAGS) $(protobuf_test_CXXFLAGS) $(CXXFLAGS) -MT google/protobuf/io/protobuf_test-printer_unittest.o -MD -MP -MF google/protobuf/io/$(DEPDIR)/protobuf_test-printer_unittest.Tpo -c -o google/protobuf/io/protobuf_test-printer_unittest.o `test -f 'google/protobuf/io/printer_unittest.cc' || echo '$(srcdir)/'`google/protobuf/io/printer_unittest.cc -@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) google/protobuf/io/$(DEPDIR)/protobuf_test-printer_unittest.Tpo google/protobuf/io/$(DEPDIR)/protobuf_test-printer_unittest.Po -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='google/protobuf/io/printer_unittest.cc' object='google/protobuf/io/protobuf_test-printer_unittest.o' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(protobuf_test_CPPFLAGS) $(CPPFLAGS) $(protobuf_test_CXXFLAGS) $(CXXFLAGS) -c -o google/protobuf/io/protobuf_test-printer_unittest.o `test -f 'google/protobuf/io/printer_unittest.cc' || echo '$(srcdir)/'`google/protobuf/io/printer_unittest.cc - -google/protobuf/io/protobuf_test-printer_unittest.obj: google/protobuf/io/printer_unittest.cc -@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(protobuf_test_CPPFLAGS) $(CPPFLAGS) $(protobuf_test_CXXFLAGS) $(CXXFLAGS) -MT google/protobuf/io/protobuf_test-printer_unittest.obj -MD -MP -MF google/protobuf/io/$(DEPDIR)/protobuf_test-printer_unittest.Tpo -c -o google/protobuf/io/protobuf_test-printer_unittest.obj `if test -f 'google/protobuf/io/printer_unittest.cc'; then $(CYGPATH_W) 'google/protobuf/io/printer_unittest.cc'; else $(CYGPATH_W) '$(srcdir)/google/protobuf/io/printer_unittest.cc'; fi` -@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) google/protobuf/io/$(DEPDIR)/protobuf_test-printer_unittest.Tpo google/protobuf/io/$(DEPDIR)/protobuf_test-printer_unittest.Po -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='google/protobuf/io/printer_unittest.cc' object='google/protobuf/io/protobuf_test-printer_unittest.obj' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(protobuf_test_CPPFLAGS) $(CPPFLAGS) $(protobuf_test_CXXFLAGS) $(CXXFLAGS) -c -o google/protobuf/io/protobuf_test-printer_unittest.obj `if test -f 'google/protobuf/io/printer_unittest.cc'; then $(CYGPATH_W) 'google/protobuf/io/printer_unittest.cc'; else $(CYGPATH_W) '$(srcdir)/google/protobuf/io/printer_unittest.cc'; fi` - -google/protobuf/io/protobuf_test-tokenizer_unittest.o: google/protobuf/io/tokenizer_unittest.cc -@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(protobuf_test_CPPFLAGS) $(CPPFLAGS) $(protobuf_test_CXXFLAGS) $(CXXFLAGS) -MT google/protobuf/io/protobuf_test-tokenizer_unittest.o -MD -MP -MF google/protobuf/io/$(DEPDIR)/protobuf_test-tokenizer_unittest.Tpo -c -o google/protobuf/io/protobuf_test-tokenizer_unittest.o `test -f 'google/protobuf/io/tokenizer_unittest.cc' || echo '$(srcdir)/'`google/protobuf/io/tokenizer_unittest.cc -@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) google/protobuf/io/$(DEPDIR)/protobuf_test-tokenizer_unittest.Tpo google/protobuf/io/$(DEPDIR)/protobuf_test-tokenizer_unittest.Po -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='google/protobuf/io/tokenizer_unittest.cc' object='google/protobuf/io/protobuf_test-tokenizer_unittest.o' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(protobuf_test_CPPFLAGS) $(CPPFLAGS) $(protobuf_test_CXXFLAGS) $(CXXFLAGS) -c -o google/protobuf/io/protobuf_test-tokenizer_unittest.o `test -f 'google/protobuf/io/tokenizer_unittest.cc' || echo '$(srcdir)/'`google/protobuf/io/tokenizer_unittest.cc - -google/protobuf/io/protobuf_test-tokenizer_unittest.obj: google/protobuf/io/tokenizer_unittest.cc -@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(protobuf_test_CPPFLAGS) $(CPPFLAGS) $(protobuf_test_CXXFLAGS) $(CXXFLAGS) -MT google/protobuf/io/protobuf_test-tokenizer_unittest.obj -MD -MP -MF google/protobuf/io/$(DEPDIR)/protobuf_test-tokenizer_unittest.Tpo -c -o google/protobuf/io/protobuf_test-tokenizer_unittest.obj `if test -f 'google/protobuf/io/tokenizer_unittest.cc'; then $(CYGPATH_W) 'google/protobuf/io/tokenizer_unittest.cc'; else $(CYGPATH_W) '$(srcdir)/google/protobuf/io/tokenizer_unittest.cc'; fi` -@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) google/protobuf/io/$(DEPDIR)/protobuf_test-tokenizer_unittest.Tpo google/protobuf/io/$(DEPDIR)/protobuf_test-tokenizer_unittest.Po -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='google/protobuf/io/tokenizer_unittest.cc' object='google/protobuf/io/protobuf_test-tokenizer_unittest.obj' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(protobuf_test_CPPFLAGS) $(CPPFLAGS) $(protobuf_test_CXXFLAGS) $(CXXFLAGS) -c -o google/protobuf/io/protobuf_test-tokenizer_unittest.obj `if test -f 'google/protobuf/io/tokenizer_unittest.cc'; then $(CYGPATH_W) 'google/protobuf/io/tokenizer_unittest.cc'; else $(CYGPATH_W) '$(srcdir)/google/protobuf/io/tokenizer_unittest.cc'; fi` - -google/protobuf/io/protobuf_test-zero_copy_stream_unittest.o: google/protobuf/io/zero_copy_stream_unittest.cc -@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(protobuf_test_CPPFLAGS) $(CPPFLAGS) $(protobuf_test_CXXFLAGS) $(CXXFLAGS) -MT google/protobuf/io/protobuf_test-zero_copy_stream_unittest.o -MD -MP -MF google/protobuf/io/$(DEPDIR)/protobuf_test-zero_copy_stream_unittest.Tpo -c -o google/protobuf/io/protobuf_test-zero_copy_stream_unittest.o `test -f 'google/protobuf/io/zero_copy_stream_unittest.cc' || echo '$(srcdir)/'`google/protobuf/io/zero_copy_stream_unittest.cc -@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) google/protobuf/io/$(DEPDIR)/protobuf_test-zero_copy_stream_unittest.Tpo google/protobuf/io/$(DEPDIR)/protobuf_test-zero_copy_stream_unittest.Po -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='google/protobuf/io/zero_copy_stream_unittest.cc' object='google/protobuf/io/protobuf_test-zero_copy_stream_unittest.o' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(protobuf_test_CPPFLAGS) $(CPPFLAGS) $(protobuf_test_CXXFLAGS) $(CXXFLAGS) -c -o google/protobuf/io/protobuf_test-zero_copy_stream_unittest.o `test -f 'google/protobuf/io/zero_copy_stream_unittest.cc' || echo '$(srcdir)/'`google/protobuf/io/zero_copy_stream_unittest.cc - -google/protobuf/io/protobuf_test-zero_copy_stream_unittest.obj: google/protobuf/io/zero_copy_stream_unittest.cc -@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(protobuf_test_CPPFLAGS) $(CPPFLAGS) $(protobuf_test_CXXFLAGS) $(CXXFLAGS) -MT google/protobuf/io/protobuf_test-zero_copy_stream_unittest.obj -MD -MP -MF google/protobuf/io/$(DEPDIR)/protobuf_test-zero_copy_stream_unittest.Tpo -c -o google/protobuf/io/protobuf_test-zero_copy_stream_unittest.obj `if test -f 'google/protobuf/io/zero_copy_stream_unittest.cc'; then $(CYGPATH_W) 'google/protobuf/io/zero_copy_stream_unittest.cc'; else $(CYGPATH_W) '$(srcdir)/google/protobuf/io/zero_copy_stream_unittest.cc'; fi` -@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) google/protobuf/io/$(DEPDIR)/protobuf_test-zero_copy_stream_unittest.Tpo google/protobuf/io/$(DEPDIR)/protobuf_test-zero_copy_stream_unittest.Po -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='google/protobuf/io/zero_copy_stream_unittest.cc' object='google/protobuf/io/protobuf_test-zero_copy_stream_unittest.obj' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(protobuf_test_CPPFLAGS) $(CPPFLAGS) $(protobuf_test_CXXFLAGS) $(CXXFLAGS) -c -o google/protobuf/io/protobuf_test-zero_copy_stream_unittest.obj `if test -f 'google/protobuf/io/zero_copy_stream_unittest.cc'; then $(CYGPATH_W) 'google/protobuf/io/zero_copy_stream_unittest.cc'; else $(CYGPATH_W) '$(srcdir)/google/protobuf/io/zero_copy_stream_unittest.cc'; fi` - -google/protobuf/protobuf_test-map_field_test.o: google/protobuf/map_field_test.cc -@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(protobuf_test_CPPFLAGS) $(CPPFLAGS) $(protobuf_test_CXXFLAGS) $(CXXFLAGS) -MT google/protobuf/protobuf_test-map_field_test.o -MD -MP -MF google/protobuf/$(DEPDIR)/protobuf_test-map_field_test.Tpo -c -o google/protobuf/protobuf_test-map_field_test.o `test -f 'google/protobuf/map_field_test.cc' || echo '$(srcdir)/'`google/protobuf/map_field_test.cc -@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) google/protobuf/$(DEPDIR)/protobuf_test-map_field_test.Tpo google/protobuf/$(DEPDIR)/protobuf_test-map_field_test.Po -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='google/protobuf/map_field_test.cc' object='google/protobuf/protobuf_test-map_field_test.o' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(protobuf_test_CPPFLAGS) $(CPPFLAGS) $(protobuf_test_CXXFLAGS) $(CXXFLAGS) -c -o google/protobuf/protobuf_test-map_field_test.o `test -f 'google/protobuf/map_field_test.cc' || echo '$(srcdir)/'`google/protobuf/map_field_test.cc - -google/protobuf/protobuf_test-map_field_test.obj: google/protobuf/map_field_test.cc -@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(protobuf_test_CPPFLAGS) $(CPPFLAGS) $(protobuf_test_CXXFLAGS) $(CXXFLAGS) -MT google/protobuf/protobuf_test-map_field_test.obj -MD -MP -MF google/protobuf/$(DEPDIR)/protobuf_test-map_field_test.Tpo -c -o google/protobuf/protobuf_test-map_field_test.obj `if test -f 'google/protobuf/map_field_test.cc'; then $(CYGPATH_W) 'google/protobuf/map_field_test.cc'; else $(CYGPATH_W) '$(srcdir)/google/protobuf/map_field_test.cc'; fi` -@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) google/protobuf/$(DEPDIR)/protobuf_test-map_field_test.Tpo google/protobuf/$(DEPDIR)/protobuf_test-map_field_test.Po -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='google/protobuf/map_field_test.cc' object='google/protobuf/protobuf_test-map_field_test.obj' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(protobuf_test_CPPFLAGS) $(CPPFLAGS) $(protobuf_test_CXXFLAGS) $(CXXFLAGS) -c -o google/protobuf/protobuf_test-map_field_test.obj `if test -f 'google/protobuf/map_field_test.cc'; then $(CYGPATH_W) 'google/protobuf/map_field_test.cc'; else $(CYGPATH_W) '$(srcdir)/google/protobuf/map_field_test.cc'; fi` - -google/protobuf/protobuf_test-map_test.o: google/protobuf/map_test.cc -@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(protobuf_test_CPPFLAGS) $(CPPFLAGS) $(protobuf_test_CXXFLAGS) $(CXXFLAGS) -MT google/protobuf/protobuf_test-map_test.o -MD -MP -MF google/protobuf/$(DEPDIR)/protobuf_test-map_test.Tpo -c -o google/protobuf/protobuf_test-map_test.o `test -f 'google/protobuf/map_test.cc' || echo '$(srcdir)/'`google/protobuf/map_test.cc -@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) google/protobuf/$(DEPDIR)/protobuf_test-map_test.Tpo google/protobuf/$(DEPDIR)/protobuf_test-map_test.Po -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='google/protobuf/map_test.cc' object='google/protobuf/protobuf_test-map_test.o' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(protobuf_test_CPPFLAGS) $(CPPFLAGS) $(protobuf_test_CXXFLAGS) $(CXXFLAGS) -c -o google/protobuf/protobuf_test-map_test.o `test -f 'google/protobuf/map_test.cc' || echo '$(srcdir)/'`google/protobuf/map_test.cc - -google/protobuf/protobuf_test-map_test.obj: google/protobuf/map_test.cc -@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(protobuf_test_CPPFLAGS) $(CPPFLAGS) $(protobuf_test_CXXFLAGS) $(CXXFLAGS) -MT google/protobuf/protobuf_test-map_test.obj -MD -MP -MF google/protobuf/$(DEPDIR)/protobuf_test-map_test.Tpo -c -o google/protobuf/protobuf_test-map_test.obj `if test -f 'google/protobuf/map_test.cc'; then $(CYGPATH_W) 'google/protobuf/map_test.cc'; else $(CYGPATH_W) '$(srcdir)/google/protobuf/map_test.cc'; fi` -@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) google/protobuf/$(DEPDIR)/protobuf_test-map_test.Tpo google/protobuf/$(DEPDIR)/protobuf_test-map_test.Po -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='google/protobuf/map_test.cc' object='google/protobuf/protobuf_test-map_test.obj' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(protobuf_test_CPPFLAGS) $(CPPFLAGS) $(protobuf_test_CXXFLAGS) $(CXXFLAGS) -c -o google/protobuf/protobuf_test-map_test.obj `if test -f 'google/protobuf/map_test.cc'; then $(CYGPATH_W) 'google/protobuf/map_test.cc'; else $(CYGPATH_W) '$(srcdir)/google/protobuf/map_test.cc'; fi` - -google/protobuf/protobuf_test-message_unittest.o: google/protobuf/message_unittest.cc -@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(protobuf_test_CPPFLAGS) $(CPPFLAGS) $(protobuf_test_CXXFLAGS) $(CXXFLAGS) -MT google/protobuf/protobuf_test-message_unittest.o -MD -MP -MF google/protobuf/$(DEPDIR)/protobuf_test-message_unittest.Tpo -c -o google/protobuf/protobuf_test-message_unittest.o `test -f 'google/protobuf/message_unittest.cc' || echo '$(srcdir)/'`google/protobuf/message_unittest.cc -@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) google/protobuf/$(DEPDIR)/protobuf_test-message_unittest.Tpo google/protobuf/$(DEPDIR)/protobuf_test-message_unittest.Po -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='google/protobuf/message_unittest.cc' object='google/protobuf/protobuf_test-message_unittest.o' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(protobuf_test_CPPFLAGS) $(CPPFLAGS) $(protobuf_test_CXXFLAGS) $(CXXFLAGS) -c -o google/protobuf/protobuf_test-message_unittest.o `test -f 'google/protobuf/message_unittest.cc' || echo '$(srcdir)/'`google/protobuf/message_unittest.cc - -google/protobuf/protobuf_test-message_unittest.obj: google/protobuf/message_unittest.cc -@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(protobuf_test_CPPFLAGS) $(CPPFLAGS) $(protobuf_test_CXXFLAGS) $(CXXFLAGS) -MT google/protobuf/protobuf_test-message_unittest.obj -MD -MP -MF google/protobuf/$(DEPDIR)/protobuf_test-message_unittest.Tpo -c -o google/protobuf/protobuf_test-message_unittest.obj `if test -f 'google/protobuf/message_unittest.cc'; then $(CYGPATH_W) 'google/protobuf/message_unittest.cc'; else $(CYGPATH_W) '$(srcdir)/google/protobuf/message_unittest.cc'; fi` -@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) google/protobuf/$(DEPDIR)/protobuf_test-message_unittest.Tpo google/protobuf/$(DEPDIR)/protobuf_test-message_unittest.Po -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='google/protobuf/message_unittest.cc' object='google/protobuf/protobuf_test-message_unittest.obj' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(protobuf_test_CPPFLAGS) $(CPPFLAGS) $(protobuf_test_CXXFLAGS) $(CXXFLAGS) -c -o google/protobuf/protobuf_test-message_unittest.obj `if test -f 'google/protobuf/message_unittest.cc'; then $(CYGPATH_W) 'google/protobuf/message_unittest.cc'; else $(CYGPATH_W) '$(srcdir)/google/protobuf/message_unittest.cc'; fi` - -google/protobuf/protobuf_test-no_field_presence_test.o: google/protobuf/no_field_presence_test.cc -@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(protobuf_test_CPPFLAGS) $(CPPFLAGS) $(protobuf_test_CXXFLAGS) $(CXXFLAGS) -MT google/protobuf/protobuf_test-no_field_presence_test.o -MD -MP -MF google/protobuf/$(DEPDIR)/protobuf_test-no_field_presence_test.Tpo -c -o google/protobuf/protobuf_test-no_field_presence_test.o `test -f 'google/protobuf/no_field_presence_test.cc' || echo '$(srcdir)/'`google/protobuf/no_field_presence_test.cc -@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) google/protobuf/$(DEPDIR)/protobuf_test-no_field_presence_test.Tpo google/protobuf/$(DEPDIR)/protobuf_test-no_field_presence_test.Po -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='google/protobuf/no_field_presence_test.cc' object='google/protobuf/protobuf_test-no_field_presence_test.o' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(protobuf_test_CPPFLAGS) $(CPPFLAGS) $(protobuf_test_CXXFLAGS) $(CXXFLAGS) -c -o google/protobuf/protobuf_test-no_field_presence_test.o `test -f 'google/protobuf/no_field_presence_test.cc' || echo '$(srcdir)/'`google/protobuf/no_field_presence_test.cc - -google/protobuf/protobuf_test-no_field_presence_test.obj: google/protobuf/no_field_presence_test.cc -@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(protobuf_test_CPPFLAGS) $(CPPFLAGS) $(protobuf_test_CXXFLAGS) $(CXXFLAGS) -MT google/protobuf/protobuf_test-no_field_presence_test.obj -MD -MP -MF google/protobuf/$(DEPDIR)/protobuf_test-no_field_presence_test.Tpo -c -o google/protobuf/protobuf_test-no_field_presence_test.obj `if test -f 'google/protobuf/no_field_presence_test.cc'; then $(CYGPATH_W) 'google/protobuf/no_field_presence_test.cc'; else $(CYGPATH_W) '$(srcdir)/google/protobuf/no_field_presence_test.cc'; fi` -@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) google/protobuf/$(DEPDIR)/protobuf_test-no_field_presence_test.Tpo google/protobuf/$(DEPDIR)/protobuf_test-no_field_presence_test.Po -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='google/protobuf/no_field_presence_test.cc' object='google/protobuf/protobuf_test-no_field_presence_test.obj' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(protobuf_test_CPPFLAGS) $(CPPFLAGS) $(protobuf_test_CXXFLAGS) $(CXXFLAGS) -c -o google/protobuf/protobuf_test-no_field_presence_test.obj `if test -f 'google/protobuf/no_field_presence_test.cc'; then $(CYGPATH_W) 'google/protobuf/no_field_presence_test.cc'; else $(CYGPATH_W) '$(srcdir)/google/protobuf/no_field_presence_test.cc'; fi` - -google/protobuf/protobuf_test-preserve_unknown_enum_test.o: google/protobuf/preserve_unknown_enum_test.cc -@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(protobuf_test_CPPFLAGS) $(CPPFLAGS) $(protobuf_test_CXXFLAGS) $(CXXFLAGS) -MT google/protobuf/protobuf_test-preserve_unknown_enum_test.o -MD -MP -MF google/protobuf/$(DEPDIR)/protobuf_test-preserve_unknown_enum_test.Tpo -c -o google/protobuf/protobuf_test-preserve_unknown_enum_test.o `test -f 'google/protobuf/preserve_unknown_enum_test.cc' || echo '$(srcdir)/'`google/protobuf/preserve_unknown_enum_test.cc -@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) google/protobuf/$(DEPDIR)/protobuf_test-preserve_unknown_enum_test.Tpo google/protobuf/$(DEPDIR)/protobuf_test-preserve_unknown_enum_test.Po -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='google/protobuf/preserve_unknown_enum_test.cc' object='google/protobuf/protobuf_test-preserve_unknown_enum_test.o' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(protobuf_test_CPPFLAGS) $(CPPFLAGS) $(protobuf_test_CXXFLAGS) $(CXXFLAGS) -c -o google/protobuf/protobuf_test-preserve_unknown_enum_test.o `test -f 'google/protobuf/preserve_unknown_enum_test.cc' || echo '$(srcdir)/'`google/protobuf/preserve_unknown_enum_test.cc - -google/protobuf/protobuf_test-preserve_unknown_enum_test.obj: google/protobuf/preserve_unknown_enum_test.cc -@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(protobuf_test_CPPFLAGS) $(CPPFLAGS) $(protobuf_test_CXXFLAGS) $(CXXFLAGS) -MT google/protobuf/protobuf_test-preserve_unknown_enum_test.obj -MD -MP -MF google/protobuf/$(DEPDIR)/protobuf_test-preserve_unknown_enum_test.Tpo -c -o google/protobuf/protobuf_test-preserve_unknown_enum_test.obj `if test -f 'google/protobuf/preserve_unknown_enum_test.cc'; then $(CYGPATH_W) 'google/protobuf/preserve_unknown_enum_test.cc'; else $(CYGPATH_W) '$(srcdir)/google/protobuf/preserve_unknown_enum_test.cc'; fi` -@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) google/protobuf/$(DEPDIR)/protobuf_test-preserve_unknown_enum_test.Tpo google/protobuf/$(DEPDIR)/protobuf_test-preserve_unknown_enum_test.Po -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='google/protobuf/preserve_unknown_enum_test.cc' object='google/protobuf/protobuf_test-preserve_unknown_enum_test.obj' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(protobuf_test_CPPFLAGS) $(CPPFLAGS) $(protobuf_test_CXXFLAGS) $(CXXFLAGS) -c -o google/protobuf/protobuf_test-preserve_unknown_enum_test.obj `if test -f 'google/protobuf/preserve_unknown_enum_test.cc'; then $(CYGPATH_W) 'google/protobuf/preserve_unknown_enum_test.cc'; else $(CYGPATH_W) '$(srcdir)/google/protobuf/preserve_unknown_enum_test.cc'; fi` - -google/protobuf/protobuf_test-proto3_arena_lite_unittest.o: google/protobuf/proto3_arena_lite_unittest.cc -@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(protobuf_test_CPPFLAGS) $(CPPFLAGS) $(protobuf_test_CXXFLAGS) $(CXXFLAGS) -MT google/protobuf/protobuf_test-proto3_arena_lite_unittest.o -MD -MP -MF google/protobuf/$(DEPDIR)/protobuf_test-proto3_arena_lite_unittest.Tpo -c -o google/protobuf/protobuf_test-proto3_arena_lite_unittest.o `test -f 'google/protobuf/proto3_arena_lite_unittest.cc' || echo '$(srcdir)/'`google/protobuf/proto3_arena_lite_unittest.cc -@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) google/protobuf/$(DEPDIR)/protobuf_test-proto3_arena_lite_unittest.Tpo google/protobuf/$(DEPDIR)/protobuf_test-proto3_arena_lite_unittest.Po -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='google/protobuf/proto3_arena_lite_unittest.cc' object='google/protobuf/protobuf_test-proto3_arena_lite_unittest.o' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(protobuf_test_CPPFLAGS) $(CPPFLAGS) $(protobuf_test_CXXFLAGS) $(CXXFLAGS) -c -o google/protobuf/protobuf_test-proto3_arena_lite_unittest.o `test -f 'google/protobuf/proto3_arena_lite_unittest.cc' || echo '$(srcdir)/'`google/protobuf/proto3_arena_lite_unittest.cc - -google/protobuf/protobuf_test-proto3_arena_lite_unittest.obj: google/protobuf/proto3_arena_lite_unittest.cc -@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(protobuf_test_CPPFLAGS) $(CPPFLAGS) $(protobuf_test_CXXFLAGS) $(CXXFLAGS) -MT google/protobuf/protobuf_test-proto3_arena_lite_unittest.obj -MD -MP -MF google/protobuf/$(DEPDIR)/protobuf_test-proto3_arena_lite_unittest.Tpo -c -o google/protobuf/protobuf_test-proto3_arena_lite_unittest.obj `if test -f 'google/protobuf/proto3_arena_lite_unittest.cc'; then $(CYGPATH_W) 'google/protobuf/proto3_arena_lite_unittest.cc'; else $(CYGPATH_W) '$(srcdir)/google/protobuf/proto3_arena_lite_unittest.cc'; fi` -@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) google/protobuf/$(DEPDIR)/protobuf_test-proto3_arena_lite_unittest.Tpo google/protobuf/$(DEPDIR)/protobuf_test-proto3_arena_lite_unittest.Po -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='google/protobuf/proto3_arena_lite_unittest.cc' object='google/protobuf/protobuf_test-proto3_arena_lite_unittest.obj' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(protobuf_test_CPPFLAGS) $(CPPFLAGS) $(protobuf_test_CXXFLAGS) $(CXXFLAGS) -c -o google/protobuf/protobuf_test-proto3_arena_lite_unittest.obj `if test -f 'google/protobuf/proto3_arena_lite_unittest.cc'; then $(CYGPATH_W) 'google/protobuf/proto3_arena_lite_unittest.cc'; else $(CYGPATH_W) '$(srcdir)/google/protobuf/proto3_arena_lite_unittest.cc'; fi` - -google/protobuf/protobuf_test-proto3_arena_unittest.o: google/protobuf/proto3_arena_unittest.cc -@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(protobuf_test_CPPFLAGS) $(CPPFLAGS) $(protobuf_test_CXXFLAGS) $(CXXFLAGS) -MT google/protobuf/protobuf_test-proto3_arena_unittest.o -MD -MP -MF google/protobuf/$(DEPDIR)/protobuf_test-proto3_arena_unittest.Tpo -c -o google/protobuf/protobuf_test-proto3_arena_unittest.o `test -f 'google/protobuf/proto3_arena_unittest.cc' || echo '$(srcdir)/'`google/protobuf/proto3_arena_unittest.cc -@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) google/protobuf/$(DEPDIR)/protobuf_test-proto3_arena_unittest.Tpo google/protobuf/$(DEPDIR)/protobuf_test-proto3_arena_unittest.Po -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='google/protobuf/proto3_arena_unittest.cc' object='google/protobuf/protobuf_test-proto3_arena_unittest.o' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(protobuf_test_CPPFLAGS) $(CPPFLAGS) $(protobuf_test_CXXFLAGS) $(CXXFLAGS) -c -o google/protobuf/protobuf_test-proto3_arena_unittest.o `test -f 'google/protobuf/proto3_arena_unittest.cc' || echo '$(srcdir)/'`google/protobuf/proto3_arena_unittest.cc - -google/protobuf/protobuf_test-proto3_arena_unittest.obj: google/protobuf/proto3_arena_unittest.cc -@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(protobuf_test_CPPFLAGS) $(CPPFLAGS) $(protobuf_test_CXXFLAGS) $(CXXFLAGS) -MT google/protobuf/protobuf_test-proto3_arena_unittest.obj -MD -MP -MF google/protobuf/$(DEPDIR)/protobuf_test-proto3_arena_unittest.Tpo -c -o google/protobuf/protobuf_test-proto3_arena_unittest.obj `if test -f 'google/protobuf/proto3_arena_unittest.cc'; then $(CYGPATH_W) 'google/protobuf/proto3_arena_unittest.cc'; else $(CYGPATH_W) '$(srcdir)/google/protobuf/proto3_arena_unittest.cc'; fi` -@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) google/protobuf/$(DEPDIR)/protobuf_test-proto3_arena_unittest.Tpo google/protobuf/$(DEPDIR)/protobuf_test-proto3_arena_unittest.Po -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='google/protobuf/proto3_arena_unittest.cc' object='google/protobuf/protobuf_test-proto3_arena_unittest.obj' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(protobuf_test_CPPFLAGS) $(CPPFLAGS) $(protobuf_test_CXXFLAGS) $(CXXFLAGS) -c -o google/protobuf/protobuf_test-proto3_arena_unittest.obj `if test -f 'google/protobuf/proto3_arena_unittest.cc'; then $(CYGPATH_W) 'google/protobuf/proto3_arena_unittest.cc'; else $(CYGPATH_W) '$(srcdir)/google/protobuf/proto3_arena_unittest.cc'; fi` - -google/protobuf/protobuf_test-proto3_lite_unittest.o: google/protobuf/proto3_lite_unittest.cc -@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(protobuf_test_CPPFLAGS) $(CPPFLAGS) $(protobuf_test_CXXFLAGS) $(CXXFLAGS) -MT google/protobuf/protobuf_test-proto3_lite_unittest.o -MD -MP -MF google/protobuf/$(DEPDIR)/protobuf_test-proto3_lite_unittest.Tpo -c -o google/protobuf/protobuf_test-proto3_lite_unittest.o `test -f 'google/protobuf/proto3_lite_unittest.cc' || echo '$(srcdir)/'`google/protobuf/proto3_lite_unittest.cc -@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) google/protobuf/$(DEPDIR)/protobuf_test-proto3_lite_unittest.Tpo google/protobuf/$(DEPDIR)/protobuf_test-proto3_lite_unittest.Po -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='google/protobuf/proto3_lite_unittest.cc' object='google/protobuf/protobuf_test-proto3_lite_unittest.o' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(protobuf_test_CPPFLAGS) $(CPPFLAGS) $(protobuf_test_CXXFLAGS) $(CXXFLAGS) -c -o google/protobuf/protobuf_test-proto3_lite_unittest.o `test -f 'google/protobuf/proto3_lite_unittest.cc' || echo '$(srcdir)/'`google/protobuf/proto3_lite_unittest.cc - -google/protobuf/protobuf_test-proto3_lite_unittest.obj: google/protobuf/proto3_lite_unittest.cc -@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(protobuf_test_CPPFLAGS) $(CPPFLAGS) $(protobuf_test_CXXFLAGS) $(CXXFLAGS) -MT google/protobuf/protobuf_test-proto3_lite_unittest.obj -MD -MP -MF google/protobuf/$(DEPDIR)/protobuf_test-proto3_lite_unittest.Tpo -c -o google/protobuf/protobuf_test-proto3_lite_unittest.obj `if test -f 'google/protobuf/proto3_lite_unittest.cc'; then $(CYGPATH_W) 'google/protobuf/proto3_lite_unittest.cc'; else $(CYGPATH_W) '$(srcdir)/google/protobuf/proto3_lite_unittest.cc'; fi` -@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) google/protobuf/$(DEPDIR)/protobuf_test-proto3_lite_unittest.Tpo google/protobuf/$(DEPDIR)/protobuf_test-proto3_lite_unittest.Po -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='google/protobuf/proto3_lite_unittest.cc' object='google/protobuf/protobuf_test-proto3_lite_unittest.obj' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(protobuf_test_CPPFLAGS) $(CPPFLAGS) $(protobuf_test_CXXFLAGS) $(CXXFLAGS) -c -o google/protobuf/protobuf_test-proto3_lite_unittest.obj `if test -f 'google/protobuf/proto3_lite_unittest.cc'; then $(CYGPATH_W) 'google/protobuf/proto3_lite_unittest.cc'; else $(CYGPATH_W) '$(srcdir)/google/protobuf/proto3_lite_unittest.cc'; fi` - -google/protobuf/protobuf_test-reflection_ops_unittest.o: google/protobuf/reflection_ops_unittest.cc -@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(protobuf_test_CPPFLAGS) $(CPPFLAGS) $(protobuf_test_CXXFLAGS) $(CXXFLAGS) -MT google/protobuf/protobuf_test-reflection_ops_unittest.o -MD -MP -MF google/protobuf/$(DEPDIR)/protobuf_test-reflection_ops_unittest.Tpo -c -o google/protobuf/protobuf_test-reflection_ops_unittest.o `test -f 'google/protobuf/reflection_ops_unittest.cc' || echo '$(srcdir)/'`google/protobuf/reflection_ops_unittest.cc -@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) google/protobuf/$(DEPDIR)/protobuf_test-reflection_ops_unittest.Tpo google/protobuf/$(DEPDIR)/protobuf_test-reflection_ops_unittest.Po -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='google/protobuf/reflection_ops_unittest.cc' object='google/protobuf/protobuf_test-reflection_ops_unittest.o' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(protobuf_test_CPPFLAGS) $(CPPFLAGS) $(protobuf_test_CXXFLAGS) $(CXXFLAGS) -c -o google/protobuf/protobuf_test-reflection_ops_unittest.o `test -f 'google/protobuf/reflection_ops_unittest.cc' || echo '$(srcdir)/'`google/protobuf/reflection_ops_unittest.cc - -google/protobuf/protobuf_test-reflection_ops_unittest.obj: google/protobuf/reflection_ops_unittest.cc -@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(protobuf_test_CPPFLAGS) $(CPPFLAGS) $(protobuf_test_CXXFLAGS) $(CXXFLAGS) -MT google/protobuf/protobuf_test-reflection_ops_unittest.obj -MD -MP -MF google/protobuf/$(DEPDIR)/protobuf_test-reflection_ops_unittest.Tpo -c -o google/protobuf/protobuf_test-reflection_ops_unittest.obj `if test -f 'google/protobuf/reflection_ops_unittest.cc'; then $(CYGPATH_W) 'google/protobuf/reflection_ops_unittest.cc'; else $(CYGPATH_W) '$(srcdir)/google/protobuf/reflection_ops_unittest.cc'; fi` -@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) google/protobuf/$(DEPDIR)/protobuf_test-reflection_ops_unittest.Tpo google/protobuf/$(DEPDIR)/protobuf_test-reflection_ops_unittest.Po -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='google/protobuf/reflection_ops_unittest.cc' object='google/protobuf/protobuf_test-reflection_ops_unittest.obj' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(protobuf_test_CPPFLAGS) $(CPPFLAGS) $(protobuf_test_CXXFLAGS) $(CXXFLAGS) -c -o google/protobuf/protobuf_test-reflection_ops_unittest.obj `if test -f 'google/protobuf/reflection_ops_unittest.cc'; then $(CYGPATH_W) 'google/protobuf/reflection_ops_unittest.cc'; else $(CYGPATH_W) '$(srcdir)/google/protobuf/reflection_ops_unittest.cc'; fi` - -google/protobuf/protobuf_test-repeated_field_reflection_unittest.o: google/protobuf/repeated_field_reflection_unittest.cc -@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(protobuf_test_CPPFLAGS) $(CPPFLAGS) $(protobuf_test_CXXFLAGS) $(CXXFLAGS) -MT google/protobuf/protobuf_test-repeated_field_reflection_unittest.o -MD -MP -MF google/protobuf/$(DEPDIR)/protobuf_test-repeated_field_reflection_unittest.Tpo -c -o google/protobuf/protobuf_test-repeated_field_reflection_unittest.o `test -f 'google/protobuf/repeated_field_reflection_unittest.cc' || echo '$(srcdir)/'`google/protobuf/repeated_field_reflection_unittest.cc -@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) google/protobuf/$(DEPDIR)/protobuf_test-repeated_field_reflection_unittest.Tpo google/protobuf/$(DEPDIR)/protobuf_test-repeated_field_reflection_unittest.Po -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='google/protobuf/repeated_field_reflection_unittest.cc' object='google/protobuf/protobuf_test-repeated_field_reflection_unittest.o' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(protobuf_test_CPPFLAGS) $(CPPFLAGS) $(protobuf_test_CXXFLAGS) $(CXXFLAGS) -c -o google/protobuf/protobuf_test-repeated_field_reflection_unittest.o `test -f 'google/protobuf/repeated_field_reflection_unittest.cc' || echo '$(srcdir)/'`google/protobuf/repeated_field_reflection_unittest.cc - -google/protobuf/protobuf_test-repeated_field_reflection_unittest.obj: google/protobuf/repeated_field_reflection_unittest.cc -@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(protobuf_test_CPPFLAGS) $(CPPFLAGS) $(protobuf_test_CXXFLAGS) $(CXXFLAGS) -MT google/protobuf/protobuf_test-repeated_field_reflection_unittest.obj -MD -MP -MF google/protobuf/$(DEPDIR)/protobuf_test-repeated_field_reflection_unittest.Tpo -c -o google/protobuf/protobuf_test-repeated_field_reflection_unittest.obj `if test -f 'google/protobuf/repeated_field_reflection_unittest.cc'; then $(CYGPATH_W) 'google/protobuf/repeated_field_reflection_unittest.cc'; else $(CYGPATH_W) '$(srcdir)/google/protobuf/repeated_field_reflection_unittest.cc'; fi` -@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) google/protobuf/$(DEPDIR)/protobuf_test-repeated_field_reflection_unittest.Tpo google/protobuf/$(DEPDIR)/protobuf_test-repeated_field_reflection_unittest.Po -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='google/protobuf/repeated_field_reflection_unittest.cc' object='google/protobuf/protobuf_test-repeated_field_reflection_unittest.obj' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(protobuf_test_CPPFLAGS) $(CPPFLAGS) $(protobuf_test_CXXFLAGS) $(CXXFLAGS) -c -o google/protobuf/protobuf_test-repeated_field_reflection_unittest.obj `if test -f 'google/protobuf/repeated_field_reflection_unittest.cc'; then $(CYGPATH_W) 'google/protobuf/repeated_field_reflection_unittest.cc'; else $(CYGPATH_W) '$(srcdir)/google/protobuf/repeated_field_reflection_unittest.cc'; fi` - -google/protobuf/protobuf_test-repeated_field_unittest.o: google/protobuf/repeated_field_unittest.cc -@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(protobuf_test_CPPFLAGS) $(CPPFLAGS) $(protobuf_test_CXXFLAGS) $(CXXFLAGS) -MT google/protobuf/protobuf_test-repeated_field_unittest.o -MD -MP -MF google/protobuf/$(DEPDIR)/protobuf_test-repeated_field_unittest.Tpo -c -o google/protobuf/protobuf_test-repeated_field_unittest.o `test -f 'google/protobuf/repeated_field_unittest.cc' || echo '$(srcdir)/'`google/protobuf/repeated_field_unittest.cc -@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) google/protobuf/$(DEPDIR)/protobuf_test-repeated_field_unittest.Tpo google/protobuf/$(DEPDIR)/protobuf_test-repeated_field_unittest.Po -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='google/protobuf/repeated_field_unittest.cc' object='google/protobuf/protobuf_test-repeated_field_unittest.o' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(protobuf_test_CPPFLAGS) $(CPPFLAGS) $(protobuf_test_CXXFLAGS) $(CXXFLAGS) -c -o google/protobuf/protobuf_test-repeated_field_unittest.o `test -f 'google/protobuf/repeated_field_unittest.cc' || echo '$(srcdir)/'`google/protobuf/repeated_field_unittest.cc - -google/protobuf/protobuf_test-repeated_field_unittest.obj: google/protobuf/repeated_field_unittest.cc -@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(protobuf_test_CPPFLAGS) $(CPPFLAGS) $(protobuf_test_CXXFLAGS) $(CXXFLAGS) -MT google/protobuf/protobuf_test-repeated_field_unittest.obj -MD -MP -MF google/protobuf/$(DEPDIR)/protobuf_test-repeated_field_unittest.Tpo -c -o google/protobuf/protobuf_test-repeated_field_unittest.obj `if test -f 'google/protobuf/repeated_field_unittest.cc'; then $(CYGPATH_W) 'google/protobuf/repeated_field_unittest.cc'; else $(CYGPATH_W) '$(srcdir)/google/protobuf/repeated_field_unittest.cc'; fi` -@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) google/protobuf/$(DEPDIR)/protobuf_test-repeated_field_unittest.Tpo google/protobuf/$(DEPDIR)/protobuf_test-repeated_field_unittest.Po -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='google/protobuf/repeated_field_unittest.cc' object='google/protobuf/protobuf_test-repeated_field_unittest.obj' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(protobuf_test_CPPFLAGS) $(CPPFLAGS) $(protobuf_test_CXXFLAGS) $(CXXFLAGS) -c -o google/protobuf/protobuf_test-repeated_field_unittest.obj `if test -f 'google/protobuf/repeated_field_unittest.cc'; then $(CYGPATH_W) 'google/protobuf/repeated_field_unittest.cc'; else $(CYGPATH_W) '$(srcdir)/google/protobuf/repeated_field_unittest.cc'; fi` - -google/protobuf/stubs/protobuf_test-bytestream_unittest.o: google/protobuf/stubs/bytestream_unittest.cc -@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(protobuf_test_CPPFLAGS) $(CPPFLAGS) $(protobuf_test_CXXFLAGS) $(CXXFLAGS) -MT google/protobuf/stubs/protobuf_test-bytestream_unittest.o -MD -MP -MF google/protobuf/stubs/$(DEPDIR)/protobuf_test-bytestream_unittest.Tpo -c -o google/protobuf/stubs/protobuf_test-bytestream_unittest.o `test -f 'google/protobuf/stubs/bytestream_unittest.cc' || echo '$(srcdir)/'`google/protobuf/stubs/bytestream_unittest.cc -@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) google/protobuf/stubs/$(DEPDIR)/protobuf_test-bytestream_unittest.Tpo google/protobuf/stubs/$(DEPDIR)/protobuf_test-bytestream_unittest.Po -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='google/protobuf/stubs/bytestream_unittest.cc' object='google/protobuf/stubs/protobuf_test-bytestream_unittest.o' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(protobuf_test_CPPFLAGS) $(CPPFLAGS) $(protobuf_test_CXXFLAGS) $(CXXFLAGS) -c -o google/protobuf/stubs/protobuf_test-bytestream_unittest.o `test -f 'google/protobuf/stubs/bytestream_unittest.cc' || echo '$(srcdir)/'`google/protobuf/stubs/bytestream_unittest.cc - -google/protobuf/stubs/protobuf_test-bytestream_unittest.obj: google/protobuf/stubs/bytestream_unittest.cc -@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(protobuf_test_CPPFLAGS) $(CPPFLAGS) $(protobuf_test_CXXFLAGS) $(CXXFLAGS) -MT google/protobuf/stubs/protobuf_test-bytestream_unittest.obj -MD -MP -MF google/protobuf/stubs/$(DEPDIR)/protobuf_test-bytestream_unittest.Tpo -c -o google/protobuf/stubs/protobuf_test-bytestream_unittest.obj `if test -f 'google/protobuf/stubs/bytestream_unittest.cc'; then $(CYGPATH_W) 'google/protobuf/stubs/bytestream_unittest.cc'; else $(CYGPATH_W) '$(srcdir)/google/protobuf/stubs/bytestream_unittest.cc'; fi` -@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) google/protobuf/stubs/$(DEPDIR)/protobuf_test-bytestream_unittest.Tpo google/protobuf/stubs/$(DEPDIR)/protobuf_test-bytestream_unittest.Po -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='google/protobuf/stubs/bytestream_unittest.cc' object='google/protobuf/stubs/protobuf_test-bytestream_unittest.obj' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(protobuf_test_CPPFLAGS) $(CPPFLAGS) $(protobuf_test_CXXFLAGS) $(CXXFLAGS) -c -o google/protobuf/stubs/protobuf_test-bytestream_unittest.obj `if test -f 'google/protobuf/stubs/bytestream_unittest.cc'; then $(CYGPATH_W) 'google/protobuf/stubs/bytestream_unittest.cc'; else $(CYGPATH_W) '$(srcdir)/google/protobuf/stubs/bytestream_unittest.cc'; fi` - -google/protobuf/stubs/protobuf_test-common_unittest.o: google/protobuf/stubs/common_unittest.cc -@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(protobuf_test_CPPFLAGS) $(CPPFLAGS) $(protobuf_test_CXXFLAGS) $(CXXFLAGS) -MT google/protobuf/stubs/protobuf_test-common_unittest.o -MD -MP -MF google/protobuf/stubs/$(DEPDIR)/protobuf_test-common_unittest.Tpo -c -o google/protobuf/stubs/protobuf_test-common_unittest.o `test -f 'google/protobuf/stubs/common_unittest.cc' || echo '$(srcdir)/'`google/protobuf/stubs/common_unittest.cc -@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) google/protobuf/stubs/$(DEPDIR)/protobuf_test-common_unittest.Tpo google/protobuf/stubs/$(DEPDIR)/protobuf_test-common_unittest.Po -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='google/protobuf/stubs/common_unittest.cc' object='google/protobuf/stubs/protobuf_test-common_unittest.o' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(protobuf_test_CPPFLAGS) $(CPPFLAGS) $(protobuf_test_CXXFLAGS) $(CXXFLAGS) -c -o google/protobuf/stubs/protobuf_test-common_unittest.o `test -f 'google/protobuf/stubs/common_unittest.cc' || echo '$(srcdir)/'`google/protobuf/stubs/common_unittest.cc - -google/protobuf/stubs/protobuf_test-common_unittest.obj: google/protobuf/stubs/common_unittest.cc -@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(protobuf_test_CPPFLAGS) $(CPPFLAGS) $(protobuf_test_CXXFLAGS) $(CXXFLAGS) -MT google/protobuf/stubs/protobuf_test-common_unittest.obj -MD -MP -MF google/protobuf/stubs/$(DEPDIR)/protobuf_test-common_unittest.Tpo -c -o google/protobuf/stubs/protobuf_test-common_unittest.obj `if test -f 'google/protobuf/stubs/common_unittest.cc'; then $(CYGPATH_W) 'google/protobuf/stubs/common_unittest.cc'; else $(CYGPATH_W) '$(srcdir)/google/protobuf/stubs/common_unittest.cc'; fi` -@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) google/protobuf/stubs/$(DEPDIR)/protobuf_test-common_unittest.Tpo google/protobuf/stubs/$(DEPDIR)/protobuf_test-common_unittest.Po -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='google/protobuf/stubs/common_unittest.cc' object='google/protobuf/stubs/protobuf_test-common_unittest.obj' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(protobuf_test_CPPFLAGS) $(CPPFLAGS) $(protobuf_test_CXXFLAGS) $(CXXFLAGS) -c -o google/protobuf/stubs/protobuf_test-common_unittest.obj `if test -f 'google/protobuf/stubs/common_unittest.cc'; then $(CYGPATH_W) 'google/protobuf/stubs/common_unittest.cc'; else $(CYGPATH_W) '$(srcdir)/google/protobuf/stubs/common_unittest.cc'; fi` - -google/protobuf/stubs/protobuf_test-int128_unittest.o: google/protobuf/stubs/int128_unittest.cc -@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(protobuf_test_CPPFLAGS) $(CPPFLAGS) $(protobuf_test_CXXFLAGS) $(CXXFLAGS) -MT google/protobuf/stubs/protobuf_test-int128_unittest.o -MD -MP -MF google/protobuf/stubs/$(DEPDIR)/protobuf_test-int128_unittest.Tpo -c -o google/protobuf/stubs/protobuf_test-int128_unittest.o `test -f 'google/protobuf/stubs/int128_unittest.cc' || echo '$(srcdir)/'`google/protobuf/stubs/int128_unittest.cc -@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) google/protobuf/stubs/$(DEPDIR)/protobuf_test-int128_unittest.Tpo google/protobuf/stubs/$(DEPDIR)/protobuf_test-int128_unittest.Po -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='google/protobuf/stubs/int128_unittest.cc' object='google/protobuf/stubs/protobuf_test-int128_unittest.o' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(protobuf_test_CPPFLAGS) $(CPPFLAGS) $(protobuf_test_CXXFLAGS) $(CXXFLAGS) -c -o google/protobuf/stubs/protobuf_test-int128_unittest.o `test -f 'google/protobuf/stubs/int128_unittest.cc' || echo '$(srcdir)/'`google/protobuf/stubs/int128_unittest.cc - -google/protobuf/stubs/protobuf_test-int128_unittest.obj: google/protobuf/stubs/int128_unittest.cc -@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(protobuf_test_CPPFLAGS) $(CPPFLAGS) $(protobuf_test_CXXFLAGS) $(CXXFLAGS) -MT google/protobuf/stubs/protobuf_test-int128_unittest.obj -MD -MP -MF google/protobuf/stubs/$(DEPDIR)/protobuf_test-int128_unittest.Tpo -c -o google/protobuf/stubs/protobuf_test-int128_unittest.obj `if test -f 'google/protobuf/stubs/int128_unittest.cc'; then $(CYGPATH_W) 'google/protobuf/stubs/int128_unittest.cc'; else $(CYGPATH_W) '$(srcdir)/google/protobuf/stubs/int128_unittest.cc'; fi` -@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) google/protobuf/stubs/$(DEPDIR)/protobuf_test-int128_unittest.Tpo google/protobuf/stubs/$(DEPDIR)/protobuf_test-int128_unittest.Po -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='google/protobuf/stubs/int128_unittest.cc' object='google/protobuf/stubs/protobuf_test-int128_unittest.obj' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(protobuf_test_CPPFLAGS) $(CPPFLAGS) $(protobuf_test_CXXFLAGS) $(CXXFLAGS) -c -o google/protobuf/stubs/protobuf_test-int128_unittest.obj `if test -f 'google/protobuf/stubs/int128_unittest.cc'; then $(CYGPATH_W) 'google/protobuf/stubs/int128_unittest.cc'; else $(CYGPATH_W) '$(srcdir)/google/protobuf/stubs/int128_unittest.cc'; fi` - -google/protobuf/stubs/protobuf_test-status_test.o: google/protobuf/stubs/status_test.cc -@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(protobuf_test_CPPFLAGS) $(CPPFLAGS) $(protobuf_test_CXXFLAGS) $(CXXFLAGS) -MT google/protobuf/stubs/protobuf_test-status_test.o -MD -MP -MF google/protobuf/stubs/$(DEPDIR)/protobuf_test-status_test.Tpo -c -o google/protobuf/stubs/protobuf_test-status_test.o `test -f 'google/protobuf/stubs/status_test.cc' || echo '$(srcdir)/'`google/protobuf/stubs/status_test.cc -@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) google/protobuf/stubs/$(DEPDIR)/protobuf_test-status_test.Tpo google/protobuf/stubs/$(DEPDIR)/protobuf_test-status_test.Po -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='google/protobuf/stubs/status_test.cc' object='google/protobuf/stubs/protobuf_test-status_test.o' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(protobuf_test_CPPFLAGS) $(CPPFLAGS) $(protobuf_test_CXXFLAGS) $(CXXFLAGS) -c -o google/protobuf/stubs/protobuf_test-status_test.o `test -f 'google/protobuf/stubs/status_test.cc' || echo '$(srcdir)/'`google/protobuf/stubs/status_test.cc - -google/protobuf/stubs/protobuf_test-status_test.obj: google/protobuf/stubs/status_test.cc -@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(protobuf_test_CPPFLAGS) $(CPPFLAGS) $(protobuf_test_CXXFLAGS) $(CXXFLAGS) -MT google/protobuf/stubs/protobuf_test-status_test.obj -MD -MP -MF google/protobuf/stubs/$(DEPDIR)/protobuf_test-status_test.Tpo -c -o google/protobuf/stubs/protobuf_test-status_test.obj `if test -f 'google/protobuf/stubs/status_test.cc'; then $(CYGPATH_W) 'google/protobuf/stubs/status_test.cc'; else $(CYGPATH_W) '$(srcdir)/google/protobuf/stubs/status_test.cc'; fi` -@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) google/protobuf/stubs/$(DEPDIR)/protobuf_test-status_test.Tpo google/protobuf/stubs/$(DEPDIR)/protobuf_test-status_test.Po -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='google/protobuf/stubs/status_test.cc' object='google/protobuf/stubs/protobuf_test-status_test.obj' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(protobuf_test_CPPFLAGS) $(CPPFLAGS) $(protobuf_test_CXXFLAGS) $(CXXFLAGS) -c -o google/protobuf/stubs/protobuf_test-status_test.obj `if test -f 'google/protobuf/stubs/status_test.cc'; then $(CYGPATH_W) 'google/protobuf/stubs/status_test.cc'; else $(CYGPATH_W) '$(srcdir)/google/protobuf/stubs/status_test.cc'; fi` - -google/protobuf/stubs/protobuf_test-statusor_test.o: google/protobuf/stubs/statusor_test.cc -@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(protobuf_test_CPPFLAGS) $(CPPFLAGS) $(protobuf_test_CXXFLAGS) $(CXXFLAGS) -MT google/protobuf/stubs/protobuf_test-statusor_test.o -MD -MP -MF google/protobuf/stubs/$(DEPDIR)/protobuf_test-statusor_test.Tpo -c -o google/protobuf/stubs/protobuf_test-statusor_test.o `test -f 'google/protobuf/stubs/statusor_test.cc' || echo '$(srcdir)/'`google/protobuf/stubs/statusor_test.cc -@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) google/protobuf/stubs/$(DEPDIR)/protobuf_test-statusor_test.Tpo google/protobuf/stubs/$(DEPDIR)/protobuf_test-statusor_test.Po -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='google/protobuf/stubs/statusor_test.cc' object='google/protobuf/stubs/protobuf_test-statusor_test.o' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(protobuf_test_CPPFLAGS) $(CPPFLAGS) $(protobuf_test_CXXFLAGS) $(CXXFLAGS) -c -o google/protobuf/stubs/protobuf_test-statusor_test.o `test -f 'google/protobuf/stubs/statusor_test.cc' || echo '$(srcdir)/'`google/protobuf/stubs/statusor_test.cc - -google/protobuf/stubs/protobuf_test-statusor_test.obj: google/protobuf/stubs/statusor_test.cc -@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(protobuf_test_CPPFLAGS) $(CPPFLAGS) $(protobuf_test_CXXFLAGS) $(CXXFLAGS) -MT google/protobuf/stubs/protobuf_test-statusor_test.obj -MD -MP -MF google/protobuf/stubs/$(DEPDIR)/protobuf_test-statusor_test.Tpo -c -o google/protobuf/stubs/protobuf_test-statusor_test.obj `if test -f 'google/protobuf/stubs/statusor_test.cc'; then $(CYGPATH_W) 'google/protobuf/stubs/statusor_test.cc'; else $(CYGPATH_W) '$(srcdir)/google/protobuf/stubs/statusor_test.cc'; fi` -@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) google/protobuf/stubs/$(DEPDIR)/protobuf_test-statusor_test.Tpo google/protobuf/stubs/$(DEPDIR)/protobuf_test-statusor_test.Po -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='google/protobuf/stubs/statusor_test.cc' object='google/protobuf/stubs/protobuf_test-statusor_test.obj' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(protobuf_test_CPPFLAGS) $(CPPFLAGS) $(protobuf_test_CXXFLAGS) $(CXXFLAGS) -c -o google/protobuf/stubs/protobuf_test-statusor_test.obj `if test -f 'google/protobuf/stubs/statusor_test.cc'; then $(CYGPATH_W) 'google/protobuf/stubs/statusor_test.cc'; else $(CYGPATH_W) '$(srcdir)/google/protobuf/stubs/statusor_test.cc'; fi` - -google/protobuf/stubs/protobuf_test-stringpiece_unittest.o: google/protobuf/stubs/stringpiece_unittest.cc -@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(protobuf_test_CPPFLAGS) $(CPPFLAGS) $(protobuf_test_CXXFLAGS) $(CXXFLAGS) -MT google/protobuf/stubs/protobuf_test-stringpiece_unittest.o -MD -MP -MF google/protobuf/stubs/$(DEPDIR)/protobuf_test-stringpiece_unittest.Tpo -c -o google/protobuf/stubs/protobuf_test-stringpiece_unittest.o `test -f 'google/protobuf/stubs/stringpiece_unittest.cc' || echo '$(srcdir)/'`google/protobuf/stubs/stringpiece_unittest.cc -@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) google/protobuf/stubs/$(DEPDIR)/protobuf_test-stringpiece_unittest.Tpo google/protobuf/stubs/$(DEPDIR)/protobuf_test-stringpiece_unittest.Po -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='google/protobuf/stubs/stringpiece_unittest.cc' object='google/protobuf/stubs/protobuf_test-stringpiece_unittest.o' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(protobuf_test_CPPFLAGS) $(CPPFLAGS) $(protobuf_test_CXXFLAGS) $(CXXFLAGS) -c -o google/protobuf/stubs/protobuf_test-stringpiece_unittest.o `test -f 'google/protobuf/stubs/stringpiece_unittest.cc' || echo '$(srcdir)/'`google/protobuf/stubs/stringpiece_unittest.cc - -google/protobuf/stubs/protobuf_test-stringpiece_unittest.obj: google/protobuf/stubs/stringpiece_unittest.cc -@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(protobuf_test_CPPFLAGS) $(CPPFLAGS) $(protobuf_test_CXXFLAGS) $(CXXFLAGS) -MT google/protobuf/stubs/protobuf_test-stringpiece_unittest.obj -MD -MP -MF google/protobuf/stubs/$(DEPDIR)/protobuf_test-stringpiece_unittest.Tpo -c -o google/protobuf/stubs/protobuf_test-stringpiece_unittest.obj `if test -f 'google/protobuf/stubs/stringpiece_unittest.cc'; then $(CYGPATH_W) 'google/protobuf/stubs/stringpiece_unittest.cc'; else $(CYGPATH_W) '$(srcdir)/google/protobuf/stubs/stringpiece_unittest.cc'; fi` -@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) google/protobuf/stubs/$(DEPDIR)/protobuf_test-stringpiece_unittest.Tpo google/protobuf/stubs/$(DEPDIR)/protobuf_test-stringpiece_unittest.Po -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='google/protobuf/stubs/stringpiece_unittest.cc' object='google/protobuf/stubs/protobuf_test-stringpiece_unittest.obj' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(protobuf_test_CPPFLAGS) $(CPPFLAGS) $(protobuf_test_CXXFLAGS) $(CXXFLAGS) -c -o google/protobuf/stubs/protobuf_test-stringpiece_unittest.obj `if test -f 'google/protobuf/stubs/stringpiece_unittest.cc'; then $(CYGPATH_W) 'google/protobuf/stubs/stringpiece_unittest.cc'; else $(CYGPATH_W) '$(srcdir)/google/protobuf/stubs/stringpiece_unittest.cc'; fi` - -google/protobuf/stubs/protobuf_test-stringprintf_unittest.o: google/protobuf/stubs/stringprintf_unittest.cc -@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(protobuf_test_CPPFLAGS) $(CPPFLAGS) $(protobuf_test_CXXFLAGS) $(CXXFLAGS) -MT google/protobuf/stubs/protobuf_test-stringprintf_unittest.o -MD -MP -MF google/protobuf/stubs/$(DEPDIR)/protobuf_test-stringprintf_unittest.Tpo -c -o google/protobuf/stubs/protobuf_test-stringprintf_unittest.o `test -f 'google/protobuf/stubs/stringprintf_unittest.cc' || echo '$(srcdir)/'`google/protobuf/stubs/stringprintf_unittest.cc -@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) google/protobuf/stubs/$(DEPDIR)/protobuf_test-stringprintf_unittest.Tpo google/protobuf/stubs/$(DEPDIR)/protobuf_test-stringprintf_unittest.Po -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='google/protobuf/stubs/stringprintf_unittest.cc' object='google/protobuf/stubs/protobuf_test-stringprintf_unittest.o' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(protobuf_test_CPPFLAGS) $(CPPFLAGS) $(protobuf_test_CXXFLAGS) $(CXXFLAGS) -c -o google/protobuf/stubs/protobuf_test-stringprintf_unittest.o `test -f 'google/protobuf/stubs/stringprintf_unittest.cc' || echo '$(srcdir)/'`google/protobuf/stubs/stringprintf_unittest.cc - -google/protobuf/stubs/protobuf_test-stringprintf_unittest.obj: google/protobuf/stubs/stringprintf_unittest.cc -@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(protobuf_test_CPPFLAGS) $(CPPFLAGS) $(protobuf_test_CXXFLAGS) $(CXXFLAGS) -MT google/protobuf/stubs/protobuf_test-stringprintf_unittest.obj -MD -MP -MF google/protobuf/stubs/$(DEPDIR)/protobuf_test-stringprintf_unittest.Tpo -c -o google/protobuf/stubs/protobuf_test-stringprintf_unittest.obj `if test -f 'google/protobuf/stubs/stringprintf_unittest.cc'; then $(CYGPATH_W) 'google/protobuf/stubs/stringprintf_unittest.cc'; else $(CYGPATH_W) '$(srcdir)/google/protobuf/stubs/stringprintf_unittest.cc'; fi` -@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) google/protobuf/stubs/$(DEPDIR)/protobuf_test-stringprintf_unittest.Tpo google/protobuf/stubs/$(DEPDIR)/protobuf_test-stringprintf_unittest.Po -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='google/protobuf/stubs/stringprintf_unittest.cc' object='google/protobuf/stubs/protobuf_test-stringprintf_unittest.obj' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(protobuf_test_CPPFLAGS) $(CPPFLAGS) $(protobuf_test_CXXFLAGS) $(CXXFLAGS) -c -o google/protobuf/stubs/protobuf_test-stringprintf_unittest.obj `if test -f 'google/protobuf/stubs/stringprintf_unittest.cc'; then $(CYGPATH_W) 'google/protobuf/stubs/stringprintf_unittest.cc'; else $(CYGPATH_W) '$(srcdir)/google/protobuf/stubs/stringprintf_unittest.cc'; fi` - -google/protobuf/stubs/protobuf_test-structurally_valid_unittest.o: google/protobuf/stubs/structurally_valid_unittest.cc -@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(protobuf_test_CPPFLAGS) $(CPPFLAGS) $(protobuf_test_CXXFLAGS) $(CXXFLAGS) -MT google/protobuf/stubs/protobuf_test-structurally_valid_unittest.o -MD -MP -MF google/protobuf/stubs/$(DEPDIR)/protobuf_test-structurally_valid_unittest.Tpo -c -o google/protobuf/stubs/protobuf_test-structurally_valid_unittest.o `test -f 'google/protobuf/stubs/structurally_valid_unittest.cc' || echo '$(srcdir)/'`google/protobuf/stubs/structurally_valid_unittest.cc -@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) google/protobuf/stubs/$(DEPDIR)/protobuf_test-structurally_valid_unittest.Tpo google/protobuf/stubs/$(DEPDIR)/protobuf_test-structurally_valid_unittest.Po -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='google/protobuf/stubs/structurally_valid_unittest.cc' object='google/protobuf/stubs/protobuf_test-structurally_valid_unittest.o' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(protobuf_test_CPPFLAGS) $(CPPFLAGS) $(protobuf_test_CXXFLAGS) $(CXXFLAGS) -c -o google/protobuf/stubs/protobuf_test-structurally_valid_unittest.o `test -f 'google/protobuf/stubs/structurally_valid_unittest.cc' || echo '$(srcdir)/'`google/protobuf/stubs/structurally_valid_unittest.cc - -google/protobuf/stubs/protobuf_test-structurally_valid_unittest.obj: google/protobuf/stubs/structurally_valid_unittest.cc -@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(protobuf_test_CPPFLAGS) $(CPPFLAGS) $(protobuf_test_CXXFLAGS) $(CXXFLAGS) -MT google/protobuf/stubs/protobuf_test-structurally_valid_unittest.obj -MD -MP -MF google/protobuf/stubs/$(DEPDIR)/protobuf_test-structurally_valid_unittest.Tpo -c -o google/protobuf/stubs/protobuf_test-structurally_valid_unittest.obj `if test -f 'google/protobuf/stubs/structurally_valid_unittest.cc'; then $(CYGPATH_W) 'google/protobuf/stubs/structurally_valid_unittest.cc'; else $(CYGPATH_W) '$(srcdir)/google/protobuf/stubs/structurally_valid_unittest.cc'; fi` -@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) google/protobuf/stubs/$(DEPDIR)/protobuf_test-structurally_valid_unittest.Tpo google/protobuf/stubs/$(DEPDIR)/protobuf_test-structurally_valid_unittest.Po -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='google/protobuf/stubs/structurally_valid_unittest.cc' object='google/protobuf/stubs/protobuf_test-structurally_valid_unittest.obj' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(protobuf_test_CPPFLAGS) $(CPPFLAGS) $(protobuf_test_CXXFLAGS) $(CXXFLAGS) -c -o google/protobuf/stubs/protobuf_test-structurally_valid_unittest.obj `if test -f 'google/protobuf/stubs/structurally_valid_unittest.cc'; then $(CYGPATH_W) 'google/protobuf/stubs/structurally_valid_unittest.cc'; else $(CYGPATH_W) '$(srcdir)/google/protobuf/stubs/structurally_valid_unittest.cc'; fi` - -google/protobuf/stubs/protobuf_test-strutil_unittest.o: google/protobuf/stubs/strutil_unittest.cc -@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(protobuf_test_CPPFLAGS) $(CPPFLAGS) $(protobuf_test_CXXFLAGS) $(CXXFLAGS) -MT google/protobuf/stubs/protobuf_test-strutil_unittest.o -MD -MP -MF google/protobuf/stubs/$(DEPDIR)/protobuf_test-strutil_unittest.Tpo -c -o google/protobuf/stubs/protobuf_test-strutil_unittest.o `test -f 'google/protobuf/stubs/strutil_unittest.cc' || echo '$(srcdir)/'`google/protobuf/stubs/strutil_unittest.cc -@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) google/protobuf/stubs/$(DEPDIR)/protobuf_test-strutil_unittest.Tpo google/protobuf/stubs/$(DEPDIR)/protobuf_test-strutil_unittest.Po -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='google/protobuf/stubs/strutil_unittest.cc' object='google/protobuf/stubs/protobuf_test-strutil_unittest.o' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(protobuf_test_CPPFLAGS) $(CPPFLAGS) $(protobuf_test_CXXFLAGS) $(CXXFLAGS) -c -o google/protobuf/stubs/protobuf_test-strutil_unittest.o `test -f 'google/protobuf/stubs/strutil_unittest.cc' || echo '$(srcdir)/'`google/protobuf/stubs/strutil_unittest.cc - -google/protobuf/stubs/protobuf_test-strutil_unittest.obj: google/protobuf/stubs/strutil_unittest.cc -@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(protobuf_test_CPPFLAGS) $(CPPFLAGS) $(protobuf_test_CXXFLAGS) $(CXXFLAGS) -MT google/protobuf/stubs/protobuf_test-strutil_unittest.obj -MD -MP -MF google/protobuf/stubs/$(DEPDIR)/protobuf_test-strutil_unittest.Tpo -c -o google/protobuf/stubs/protobuf_test-strutil_unittest.obj `if test -f 'google/protobuf/stubs/strutil_unittest.cc'; then $(CYGPATH_W) 'google/protobuf/stubs/strutil_unittest.cc'; else $(CYGPATH_W) '$(srcdir)/google/protobuf/stubs/strutil_unittest.cc'; fi` -@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) google/protobuf/stubs/$(DEPDIR)/protobuf_test-strutil_unittest.Tpo google/protobuf/stubs/$(DEPDIR)/protobuf_test-strutil_unittest.Po -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='google/protobuf/stubs/strutil_unittest.cc' object='google/protobuf/stubs/protobuf_test-strutil_unittest.obj' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(protobuf_test_CPPFLAGS) $(CPPFLAGS) $(protobuf_test_CXXFLAGS) $(CXXFLAGS) -c -o google/protobuf/stubs/protobuf_test-strutil_unittest.obj `if test -f 'google/protobuf/stubs/strutil_unittest.cc'; then $(CYGPATH_W) 'google/protobuf/stubs/strutil_unittest.cc'; else $(CYGPATH_W) '$(srcdir)/google/protobuf/stubs/strutil_unittest.cc'; fi` - -google/protobuf/stubs/protobuf_test-template_util_unittest.o: google/protobuf/stubs/template_util_unittest.cc -@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(protobuf_test_CPPFLAGS) $(CPPFLAGS) $(protobuf_test_CXXFLAGS) $(CXXFLAGS) -MT google/protobuf/stubs/protobuf_test-template_util_unittest.o -MD -MP -MF google/protobuf/stubs/$(DEPDIR)/protobuf_test-template_util_unittest.Tpo -c -o google/protobuf/stubs/protobuf_test-template_util_unittest.o `test -f 'google/protobuf/stubs/template_util_unittest.cc' || echo '$(srcdir)/'`google/protobuf/stubs/template_util_unittest.cc -@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) google/protobuf/stubs/$(DEPDIR)/protobuf_test-template_util_unittest.Tpo google/protobuf/stubs/$(DEPDIR)/protobuf_test-template_util_unittest.Po -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='google/protobuf/stubs/template_util_unittest.cc' object='google/protobuf/stubs/protobuf_test-template_util_unittest.o' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(protobuf_test_CPPFLAGS) $(CPPFLAGS) $(protobuf_test_CXXFLAGS) $(CXXFLAGS) -c -o google/protobuf/stubs/protobuf_test-template_util_unittest.o `test -f 'google/protobuf/stubs/template_util_unittest.cc' || echo '$(srcdir)/'`google/protobuf/stubs/template_util_unittest.cc - -google/protobuf/stubs/protobuf_test-template_util_unittest.obj: google/protobuf/stubs/template_util_unittest.cc -@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(protobuf_test_CPPFLAGS) $(CPPFLAGS) $(protobuf_test_CXXFLAGS) $(CXXFLAGS) -MT google/protobuf/stubs/protobuf_test-template_util_unittest.obj -MD -MP -MF google/protobuf/stubs/$(DEPDIR)/protobuf_test-template_util_unittest.Tpo -c -o google/protobuf/stubs/protobuf_test-template_util_unittest.obj `if test -f 'google/protobuf/stubs/template_util_unittest.cc'; then $(CYGPATH_W) 'google/protobuf/stubs/template_util_unittest.cc'; else $(CYGPATH_W) '$(srcdir)/google/protobuf/stubs/template_util_unittest.cc'; fi` -@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) google/protobuf/stubs/$(DEPDIR)/protobuf_test-template_util_unittest.Tpo google/protobuf/stubs/$(DEPDIR)/protobuf_test-template_util_unittest.Po -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='google/protobuf/stubs/template_util_unittest.cc' object='google/protobuf/stubs/protobuf_test-template_util_unittest.obj' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(protobuf_test_CPPFLAGS) $(CPPFLAGS) $(protobuf_test_CXXFLAGS) $(CXXFLAGS) -c -o google/protobuf/stubs/protobuf_test-template_util_unittest.obj `if test -f 'google/protobuf/stubs/template_util_unittest.cc'; then $(CYGPATH_W) 'google/protobuf/stubs/template_util_unittest.cc'; else $(CYGPATH_W) '$(srcdir)/google/protobuf/stubs/template_util_unittest.cc'; fi` - -google/protobuf/stubs/protobuf_test-time_test.o: google/protobuf/stubs/time_test.cc -@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(protobuf_test_CPPFLAGS) $(CPPFLAGS) $(protobuf_test_CXXFLAGS) $(CXXFLAGS) -MT google/protobuf/stubs/protobuf_test-time_test.o -MD -MP -MF google/protobuf/stubs/$(DEPDIR)/protobuf_test-time_test.Tpo -c -o google/protobuf/stubs/protobuf_test-time_test.o `test -f 'google/protobuf/stubs/time_test.cc' || echo '$(srcdir)/'`google/protobuf/stubs/time_test.cc -@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) google/protobuf/stubs/$(DEPDIR)/protobuf_test-time_test.Tpo google/protobuf/stubs/$(DEPDIR)/protobuf_test-time_test.Po -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='google/protobuf/stubs/time_test.cc' object='google/protobuf/stubs/protobuf_test-time_test.o' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(protobuf_test_CPPFLAGS) $(CPPFLAGS) $(protobuf_test_CXXFLAGS) $(CXXFLAGS) -c -o google/protobuf/stubs/protobuf_test-time_test.o `test -f 'google/protobuf/stubs/time_test.cc' || echo '$(srcdir)/'`google/protobuf/stubs/time_test.cc - -google/protobuf/stubs/protobuf_test-time_test.obj: google/protobuf/stubs/time_test.cc -@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(protobuf_test_CPPFLAGS) $(CPPFLAGS) $(protobuf_test_CXXFLAGS) $(CXXFLAGS) -MT google/protobuf/stubs/protobuf_test-time_test.obj -MD -MP -MF google/protobuf/stubs/$(DEPDIR)/protobuf_test-time_test.Tpo -c -o google/protobuf/stubs/protobuf_test-time_test.obj `if test -f 'google/protobuf/stubs/time_test.cc'; then $(CYGPATH_W) 'google/protobuf/stubs/time_test.cc'; else $(CYGPATH_W) '$(srcdir)/google/protobuf/stubs/time_test.cc'; fi` -@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) google/protobuf/stubs/$(DEPDIR)/protobuf_test-time_test.Tpo google/protobuf/stubs/$(DEPDIR)/protobuf_test-time_test.Po -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='google/protobuf/stubs/time_test.cc' object='google/protobuf/stubs/protobuf_test-time_test.obj' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(protobuf_test_CPPFLAGS) $(CPPFLAGS) $(protobuf_test_CXXFLAGS) $(CXXFLAGS) -c -o google/protobuf/stubs/protobuf_test-time_test.obj `if test -f 'google/protobuf/stubs/time_test.cc'; then $(CYGPATH_W) 'google/protobuf/stubs/time_test.cc'; else $(CYGPATH_W) '$(srcdir)/google/protobuf/stubs/time_test.cc'; fi` - -google/protobuf/protobuf_test-text_format_unittest.o: google/protobuf/text_format_unittest.cc -@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(protobuf_test_CPPFLAGS) $(CPPFLAGS) $(protobuf_test_CXXFLAGS) $(CXXFLAGS) -MT google/protobuf/protobuf_test-text_format_unittest.o -MD -MP -MF google/protobuf/$(DEPDIR)/protobuf_test-text_format_unittest.Tpo -c -o google/protobuf/protobuf_test-text_format_unittest.o `test -f 'google/protobuf/text_format_unittest.cc' || echo '$(srcdir)/'`google/protobuf/text_format_unittest.cc -@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) google/protobuf/$(DEPDIR)/protobuf_test-text_format_unittest.Tpo google/protobuf/$(DEPDIR)/protobuf_test-text_format_unittest.Po -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='google/protobuf/text_format_unittest.cc' object='google/protobuf/protobuf_test-text_format_unittest.o' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(protobuf_test_CPPFLAGS) $(CPPFLAGS) $(protobuf_test_CXXFLAGS) $(CXXFLAGS) -c -o google/protobuf/protobuf_test-text_format_unittest.o `test -f 'google/protobuf/text_format_unittest.cc' || echo '$(srcdir)/'`google/protobuf/text_format_unittest.cc - -google/protobuf/protobuf_test-text_format_unittest.obj: google/protobuf/text_format_unittest.cc -@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(protobuf_test_CPPFLAGS) $(CPPFLAGS) $(protobuf_test_CXXFLAGS) $(CXXFLAGS) -MT google/protobuf/protobuf_test-text_format_unittest.obj -MD -MP -MF google/protobuf/$(DEPDIR)/protobuf_test-text_format_unittest.Tpo -c -o google/protobuf/protobuf_test-text_format_unittest.obj `if test -f 'google/protobuf/text_format_unittest.cc'; then $(CYGPATH_W) 'google/protobuf/text_format_unittest.cc'; else $(CYGPATH_W) '$(srcdir)/google/protobuf/text_format_unittest.cc'; fi` -@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) google/protobuf/$(DEPDIR)/protobuf_test-text_format_unittest.Tpo google/protobuf/$(DEPDIR)/protobuf_test-text_format_unittest.Po -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='google/protobuf/text_format_unittest.cc' object='google/protobuf/protobuf_test-text_format_unittest.obj' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(protobuf_test_CPPFLAGS) $(CPPFLAGS) $(protobuf_test_CXXFLAGS) $(CXXFLAGS) -c -o google/protobuf/protobuf_test-text_format_unittest.obj `if test -f 'google/protobuf/text_format_unittest.cc'; then $(CYGPATH_W) 'google/protobuf/text_format_unittest.cc'; else $(CYGPATH_W) '$(srcdir)/google/protobuf/text_format_unittest.cc'; fi` - -google/protobuf/protobuf_test-unknown_field_set_unittest.o: google/protobuf/unknown_field_set_unittest.cc -@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(protobuf_test_CPPFLAGS) $(CPPFLAGS) $(protobuf_test_CXXFLAGS) $(CXXFLAGS) -MT google/protobuf/protobuf_test-unknown_field_set_unittest.o -MD -MP -MF google/protobuf/$(DEPDIR)/protobuf_test-unknown_field_set_unittest.Tpo -c -o google/protobuf/protobuf_test-unknown_field_set_unittest.o `test -f 'google/protobuf/unknown_field_set_unittest.cc' || echo '$(srcdir)/'`google/protobuf/unknown_field_set_unittest.cc -@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) google/protobuf/$(DEPDIR)/protobuf_test-unknown_field_set_unittest.Tpo google/protobuf/$(DEPDIR)/protobuf_test-unknown_field_set_unittest.Po -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='google/protobuf/unknown_field_set_unittest.cc' object='google/protobuf/protobuf_test-unknown_field_set_unittest.o' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(protobuf_test_CPPFLAGS) $(CPPFLAGS) $(protobuf_test_CXXFLAGS) $(CXXFLAGS) -c -o google/protobuf/protobuf_test-unknown_field_set_unittest.o `test -f 'google/protobuf/unknown_field_set_unittest.cc' || echo '$(srcdir)/'`google/protobuf/unknown_field_set_unittest.cc - -google/protobuf/protobuf_test-unknown_field_set_unittest.obj: google/protobuf/unknown_field_set_unittest.cc -@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(protobuf_test_CPPFLAGS) $(CPPFLAGS) $(protobuf_test_CXXFLAGS) $(CXXFLAGS) -MT google/protobuf/protobuf_test-unknown_field_set_unittest.obj -MD -MP -MF google/protobuf/$(DEPDIR)/protobuf_test-unknown_field_set_unittest.Tpo -c -o google/protobuf/protobuf_test-unknown_field_set_unittest.obj `if test -f 'google/protobuf/unknown_field_set_unittest.cc'; then $(CYGPATH_W) 'google/protobuf/unknown_field_set_unittest.cc'; else $(CYGPATH_W) '$(srcdir)/google/protobuf/unknown_field_set_unittest.cc'; fi` -@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) google/protobuf/$(DEPDIR)/protobuf_test-unknown_field_set_unittest.Tpo google/protobuf/$(DEPDIR)/protobuf_test-unknown_field_set_unittest.Po -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='google/protobuf/unknown_field_set_unittest.cc' object='google/protobuf/protobuf_test-unknown_field_set_unittest.obj' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(protobuf_test_CPPFLAGS) $(CPPFLAGS) $(protobuf_test_CXXFLAGS) $(CXXFLAGS) -c -o google/protobuf/protobuf_test-unknown_field_set_unittest.obj `if test -f 'google/protobuf/unknown_field_set_unittest.cc'; then $(CYGPATH_W) 'google/protobuf/unknown_field_set_unittest.cc'; else $(CYGPATH_W) '$(srcdir)/google/protobuf/unknown_field_set_unittest.cc'; fi` - -google/protobuf/util/protobuf_test-delimited_message_util_test.o: google/protobuf/util/delimited_message_util_test.cc -@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(protobuf_test_CPPFLAGS) $(CPPFLAGS) $(protobuf_test_CXXFLAGS) $(CXXFLAGS) -MT google/protobuf/util/protobuf_test-delimited_message_util_test.o -MD -MP -MF google/protobuf/util/$(DEPDIR)/protobuf_test-delimited_message_util_test.Tpo -c -o google/protobuf/util/protobuf_test-delimited_message_util_test.o `test -f 'google/protobuf/util/delimited_message_util_test.cc' || echo '$(srcdir)/'`google/protobuf/util/delimited_message_util_test.cc -@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) google/protobuf/util/$(DEPDIR)/protobuf_test-delimited_message_util_test.Tpo google/protobuf/util/$(DEPDIR)/protobuf_test-delimited_message_util_test.Po -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='google/protobuf/util/delimited_message_util_test.cc' object='google/protobuf/util/protobuf_test-delimited_message_util_test.o' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(protobuf_test_CPPFLAGS) $(CPPFLAGS) $(protobuf_test_CXXFLAGS) $(CXXFLAGS) -c -o google/protobuf/util/protobuf_test-delimited_message_util_test.o `test -f 'google/protobuf/util/delimited_message_util_test.cc' || echo '$(srcdir)/'`google/protobuf/util/delimited_message_util_test.cc - -google/protobuf/util/protobuf_test-delimited_message_util_test.obj: google/protobuf/util/delimited_message_util_test.cc -@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(protobuf_test_CPPFLAGS) $(CPPFLAGS) $(protobuf_test_CXXFLAGS) $(CXXFLAGS) -MT google/protobuf/util/protobuf_test-delimited_message_util_test.obj -MD -MP -MF google/protobuf/util/$(DEPDIR)/protobuf_test-delimited_message_util_test.Tpo -c -o google/protobuf/util/protobuf_test-delimited_message_util_test.obj `if test -f 'google/protobuf/util/delimited_message_util_test.cc'; then $(CYGPATH_W) 'google/protobuf/util/delimited_message_util_test.cc'; else $(CYGPATH_W) '$(srcdir)/google/protobuf/util/delimited_message_util_test.cc'; fi` -@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) google/protobuf/util/$(DEPDIR)/protobuf_test-delimited_message_util_test.Tpo google/protobuf/util/$(DEPDIR)/protobuf_test-delimited_message_util_test.Po -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='google/protobuf/util/delimited_message_util_test.cc' object='google/protobuf/util/protobuf_test-delimited_message_util_test.obj' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(protobuf_test_CPPFLAGS) $(CPPFLAGS) $(protobuf_test_CXXFLAGS) $(CXXFLAGS) -c -o google/protobuf/util/protobuf_test-delimited_message_util_test.obj `if test -f 'google/protobuf/util/delimited_message_util_test.cc'; then $(CYGPATH_W) 'google/protobuf/util/delimited_message_util_test.cc'; else $(CYGPATH_W) '$(srcdir)/google/protobuf/util/delimited_message_util_test.cc'; fi` - -google/protobuf/util/protobuf_test-field_comparator_test.o: google/protobuf/util/field_comparator_test.cc -@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(protobuf_test_CPPFLAGS) $(CPPFLAGS) $(protobuf_test_CXXFLAGS) $(CXXFLAGS) -MT google/protobuf/util/protobuf_test-field_comparator_test.o -MD -MP -MF google/protobuf/util/$(DEPDIR)/protobuf_test-field_comparator_test.Tpo -c -o google/protobuf/util/protobuf_test-field_comparator_test.o `test -f 'google/protobuf/util/field_comparator_test.cc' || echo '$(srcdir)/'`google/protobuf/util/field_comparator_test.cc -@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) google/protobuf/util/$(DEPDIR)/protobuf_test-field_comparator_test.Tpo google/protobuf/util/$(DEPDIR)/protobuf_test-field_comparator_test.Po -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='google/protobuf/util/field_comparator_test.cc' object='google/protobuf/util/protobuf_test-field_comparator_test.o' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(protobuf_test_CPPFLAGS) $(CPPFLAGS) $(protobuf_test_CXXFLAGS) $(CXXFLAGS) -c -o google/protobuf/util/protobuf_test-field_comparator_test.o `test -f 'google/protobuf/util/field_comparator_test.cc' || echo '$(srcdir)/'`google/protobuf/util/field_comparator_test.cc - -google/protobuf/util/protobuf_test-field_comparator_test.obj: google/protobuf/util/field_comparator_test.cc -@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(protobuf_test_CPPFLAGS) $(CPPFLAGS) $(protobuf_test_CXXFLAGS) $(CXXFLAGS) -MT google/protobuf/util/protobuf_test-field_comparator_test.obj -MD -MP -MF google/protobuf/util/$(DEPDIR)/protobuf_test-field_comparator_test.Tpo -c -o google/protobuf/util/protobuf_test-field_comparator_test.obj `if test -f 'google/protobuf/util/field_comparator_test.cc'; then $(CYGPATH_W) 'google/protobuf/util/field_comparator_test.cc'; else $(CYGPATH_W) '$(srcdir)/google/protobuf/util/field_comparator_test.cc'; fi` -@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) google/protobuf/util/$(DEPDIR)/protobuf_test-field_comparator_test.Tpo google/protobuf/util/$(DEPDIR)/protobuf_test-field_comparator_test.Po -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='google/protobuf/util/field_comparator_test.cc' object='google/protobuf/util/protobuf_test-field_comparator_test.obj' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(protobuf_test_CPPFLAGS) $(CPPFLAGS) $(protobuf_test_CXXFLAGS) $(CXXFLAGS) -c -o google/protobuf/util/protobuf_test-field_comparator_test.obj `if test -f 'google/protobuf/util/field_comparator_test.cc'; then $(CYGPATH_W) 'google/protobuf/util/field_comparator_test.cc'; else $(CYGPATH_W) '$(srcdir)/google/protobuf/util/field_comparator_test.cc'; fi` - -google/protobuf/util/protobuf_test-field_mask_util_test.o: google/protobuf/util/field_mask_util_test.cc -@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(protobuf_test_CPPFLAGS) $(CPPFLAGS) $(protobuf_test_CXXFLAGS) $(CXXFLAGS) -MT google/protobuf/util/protobuf_test-field_mask_util_test.o -MD -MP -MF google/protobuf/util/$(DEPDIR)/protobuf_test-field_mask_util_test.Tpo -c -o google/protobuf/util/protobuf_test-field_mask_util_test.o `test -f 'google/protobuf/util/field_mask_util_test.cc' || echo '$(srcdir)/'`google/protobuf/util/field_mask_util_test.cc -@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) google/protobuf/util/$(DEPDIR)/protobuf_test-field_mask_util_test.Tpo google/protobuf/util/$(DEPDIR)/protobuf_test-field_mask_util_test.Po -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='google/protobuf/util/field_mask_util_test.cc' object='google/protobuf/util/protobuf_test-field_mask_util_test.o' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(protobuf_test_CPPFLAGS) $(CPPFLAGS) $(protobuf_test_CXXFLAGS) $(CXXFLAGS) -c -o google/protobuf/util/protobuf_test-field_mask_util_test.o `test -f 'google/protobuf/util/field_mask_util_test.cc' || echo '$(srcdir)/'`google/protobuf/util/field_mask_util_test.cc - -google/protobuf/util/protobuf_test-field_mask_util_test.obj: google/protobuf/util/field_mask_util_test.cc -@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(protobuf_test_CPPFLAGS) $(CPPFLAGS) $(protobuf_test_CXXFLAGS) $(CXXFLAGS) -MT google/protobuf/util/protobuf_test-field_mask_util_test.obj -MD -MP -MF google/protobuf/util/$(DEPDIR)/protobuf_test-field_mask_util_test.Tpo -c -o google/protobuf/util/protobuf_test-field_mask_util_test.obj `if test -f 'google/protobuf/util/field_mask_util_test.cc'; then $(CYGPATH_W) 'google/protobuf/util/field_mask_util_test.cc'; else $(CYGPATH_W) '$(srcdir)/google/protobuf/util/field_mask_util_test.cc'; fi` -@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) google/protobuf/util/$(DEPDIR)/protobuf_test-field_mask_util_test.Tpo google/protobuf/util/$(DEPDIR)/protobuf_test-field_mask_util_test.Po -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='google/protobuf/util/field_mask_util_test.cc' object='google/protobuf/util/protobuf_test-field_mask_util_test.obj' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(protobuf_test_CPPFLAGS) $(CPPFLAGS) $(protobuf_test_CXXFLAGS) $(CXXFLAGS) -c -o google/protobuf/util/protobuf_test-field_mask_util_test.obj `if test -f 'google/protobuf/util/field_mask_util_test.cc'; then $(CYGPATH_W) 'google/protobuf/util/field_mask_util_test.cc'; else $(CYGPATH_W) '$(srcdir)/google/protobuf/util/field_mask_util_test.cc'; fi` - -google/protobuf/util/internal/protobuf_test-default_value_objectwriter_test.o: google/protobuf/util/internal/default_value_objectwriter_test.cc -@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(protobuf_test_CPPFLAGS) $(CPPFLAGS) $(protobuf_test_CXXFLAGS) $(CXXFLAGS) -MT google/protobuf/util/internal/protobuf_test-default_value_objectwriter_test.o -MD -MP -MF google/protobuf/util/internal/$(DEPDIR)/protobuf_test-default_value_objectwriter_test.Tpo -c -o google/protobuf/util/internal/protobuf_test-default_value_objectwriter_test.o `test -f 'google/protobuf/util/internal/default_value_objectwriter_test.cc' || echo '$(srcdir)/'`google/protobuf/util/internal/default_value_objectwriter_test.cc -@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) google/protobuf/util/internal/$(DEPDIR)/protobuf_test-default_value_objectwriter_test.Tpo google/protobuf/util/internal/$(DEPDIR)/protobuf_test-default_value_objectwriter_test.Po -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='google/protobuf/util/internal/default_value_objectwriter_test.cc' object='google/protobuf/util/internal/protobuf_test-default_value_objectwriter_test.o' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(protobuf_test_CPPFLAGS) $(CPPFLAGS) $(protobuf_test_CXXFLAGS) $(CXXFLAGS) -c -o google/protobuf/util/internal/protobuf_test-default_value_objectwriter_test.o `test -f 'google/protobuf/util/internal/default_value_objectwriter_test.cc' || echo '$(srcdir)/'`google/protobuf/util/internal/default_value_objectwriter_test.cc - -google/protobuf/util/internal/protobuf_test-default_value_objectwriter_test.obj: google/protobuf/util/internal/default_value_objectwriter_test.cc -@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(protobuf_test_CPPFLAGS) $(CPPFLAGS) $(protobuf_test_CXXFLAGS) $(CXXFLAGS) -MT google/protobuf/util/internal/protobuf_test-default_value_objectwriter_test.obj -MD -MP -MF google/protobuf/util/internal/$(DEPDIR)/protobuf_test-default_value_objectwriter_test.Tpo -c -o google/protobuf/util/internal/protobuf_test-default_value_objectwriter_test.obj `if test -f 'google/protobuf/util/internal/default_value_objectwriter_test.cc'; then $(CYGPATH_W) 'google/protobuf/util/internal/default_value_objectwriter_test.cc'; else $(CYGPATH_W) '$(srcdir)/google/protobuf/util/internal/default_value_objectwriter_test.cc'; fi` -@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) google/protobuf/util/internal/$(DEPDIR)/protobuf_test-default_value_objectwriter_test.Tpo google/protobuf/util/internal/$(DEPDIR)/protobuf_test-default_value_objectwriter_test.Po -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='google/protobuf/util/internal/default_value_objectwriter_test.cc' object='google/protobuf/util/internal/protobuf_test-default_value_objectwriter_test.obj' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(protobuf_test_CPPFLAGS) $(CPPFLAGS) $(protobuf_test_CXXFLAGS) $(CXXFLAGS) -c -o google/protobuf/util/internal/protobuf_test-default_value_objectwriter_test.obj `if test -f 'google/protobuf/util/internal/default_value_objectwriter_test.cc'; then $(CYGPATH_W) 'google/protobuf/util/internal/default_value_objectwriter_test.cc'; else $(CYGPATH_W) '$(srcdir)/google/protobuf/util/internal/default_value_objectwriter_test.cc'; fi` - -google/protobuf/util/internal/protobuf_test-json_objectwriter_test.o: google/protobuf/util/internal/json_objectwriter_test.cc -@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(protobuf_test_CPPFLAGS) $(CPPFLAGS) $(protobuf_test_CXXFLAGS) $(CXXFLAGS) -MT google/protobuf/util/internal/protobuf_test-json_objectwriter_test.o -MD -MP -MF google/protobuf/util/internal/$(DEPDIR)/protobuf_test-json_objectwriter_test.Tpo -c -o google/protobuf/util/internal/protobuf_test-json_objectwriter_test.o `test -f 'google/protobuf/util/internal/json_objectwriter_test.cc' || echo '$(srcdir)/'`google/protobuf/util/internal/json_objectwriter_test.cc -@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) google/protobuf/util/internal/$(DEPDIR)/protobuf_test-json_objectwriter_test.Tpo google/protobuf/util/internal/$(DEPDIR)/protobuf_test-json_objectwriter_test.Po -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='google/protobuf/util/internal/json_objectwriter_test.cc' object='google/protobuf/util/internal/protobuf_test-json_objectwriter_test.o' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(protobuf_test_CPPFLAGS) $(CPPFLAGS) $(protobuf_test_CXXFLAGS) $(CXXFLAGS) -c -o google/protobuf/util/internal/protobuf_test-json_objectwriter_test.o `test -f 'google/protobuf/util/internal/json_objectwriter_test.cc' || echo '$(srcdir)/'`google/protobuf/util/internal/json_objectwriter_test.cc - -google/protobuf/util/internal/protobuf_test-json_objectwriter_test.obj: google/protobuf/util/internal/json_objectwriter_test.cc -@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(protobuf_test_CPPFLAGS) $(CPPFLAGS) $(protobuf_test_CXXFLAGS) $(CXXFLAGS) -MT google/protobuf/util/internal/protobuf_test-json_objectwriter_test.obj -MD -MP -MF google/protobuf/util/internal/$(DEPDIR)/protobuf_test-json_objectwriter_test.Tpo -c -o google/protobuf/util/internal/protobuf_test-json_objectwriter_test.obj `if test -f 'google/protobuf/util/internal/json_objectwriter_test.cc'; then $(CYGPATH_W) 'google/protobuf/util/internal/json_objectwriter_test.cc'; else $(CYGPATH_W) '$(srcdir)/google/protobuf/util/internal/json_objectwriter_test.cc'; fi` -@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) google/protobuf/util/internal/$(DEPDIR)/protobuf_test-json_objectwriter_test.Tpo google/protobuf/util/internal/$(DEPDIR)/protobuf_test-json_objectwriter_test.Po -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='google/protobuf/util/internal/json_objectwriter_test.cc' object='google/protobuf/util/internal/protobuf_test-json_objectwriter_test.obj' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(protobuf_test_CPPFLAGS) $(CPPFLAGS) $(protobuf_test_CXXFLAGS) $(CXXFLAGS) -c -o google/protobuf/util/internal/protobuf_test-json_objectwriter_test.obj `if test -f 'google/protobuf/util/internal/json_objectwriter_test.cc'; then $(CYGPATH_W) 'google/protobuf/util/internal/json_objectwriter_test.cc'; else $(CYGPATH_W) '$(srcdir)/google/protobuf/util/internal/json_objectwriter_test.cc'; fi` - -google/protobuf/util/internal/protobuf_test-json_stream_parser_test.o: google/protobuf/util/internal/json_stream_parser_test.cc -@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(protobuf_test_CPPFLAGS) $(CPPFLAGS) $(protobuf_test_CXXFLAGS) $(CXXFLAGS) -MT google/protobuf/util/internal/protobuf_test-json_stream_parser_test.o -MD -MP -MF google/protobuf/util/internal/$(DEPDIR)/protobuf_test-json_stream_parser_test.Tpo -c -o google/protobuf/util/internal/protobuf_test-json_stream_parser_test.o `test -f 'google/protobuf/util/internal/json_stream_parser_test.cc' || echo '$(srcdir)/'`google/protobuf/util/internal/json_stream_parser_test.cc -@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) google/protobuf/util/internal/$(DEPDIR)/protobuf_test-json_stream_parser_test.Tpo google/protobuf/util/internal/$(DEPDIR)/protobuf_test-json_stream_parser_test.Po -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='google/protobuf/util/internal/json_stream_parser_test.cc' object='google/protobuf/util/internal/protobuf_test-json_stream_parser_test.o' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(protobuf_test_CPPFLAGS) $(CPPFLAGS) $(protobuf_test_CXXFLAGS) $(CXXFLAGS) -c -o google/protobuf/util/internal/protobuf_test-json_stream_parser_test.o `test -f 'google/protobuf/util/internal/json_stream_parser_test.cc' || echo '$(srcdir)/'`google/protobuf/util/internal/json_stream_parser_test.cc - -google/protobuf/util/internal/protobuf_test-json_stream_parser_test.obj: google/protobuf/util/internal/json_stream_parser_test.cc -@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(protobuf_test_CPPFLAGS) $(CPPFLAGS) $(protobuf_test_CXXFLAGS) $(CXXFLAGS) -MT google/protobuf/util/internal/protobuf_test-json_stream_parser_test.obj -MD -MP -MF google/protobuf/util/internal/$(DEPDIR)/protobuf_test-json_stream_parser_test.Tpo -c -o google/protobuf/util/internal/protobuf_test-json_stream_parser_test.obj `if test -f 'google/protobuf/util/internal/json_stream_parser_test.cc'; then $(CYGPATH_W) 'google/protobuf/util/internal/json_stream_parser_test.cc'; else $(CYGPATH_W) '$(srcdir)/google/protobuf/util/internal/json_stream_parser_test.cc'; fi` -@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) google/protobuf/util/internal/$(DEPDIR)/protobuf_test-json_stream_parser_test.Tpo google/protobuf/util/internal/$(DEPDIR)/protobuf_test-json_stream_parser_test.Po -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='google/protobuf/util/internal/json_stream_parser_test.cc' object='google/protobuf/util/internal/protobuf_test-json_stream_parser_test.obj' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(protobuf_test_CPPFLAGS) $(CPPFLAGS) $(protobuf_test_CXXFLAGS) $(CXXFLAGS) -c -o google/protobuf/util/internal/protobuf_test-json_stream_parser_test.obj `if test -f 'google/protobuf/util/internal/json_stream_parser_test.cc'; then $(CYGPATH_W) 'google/protobuf/util/internal/json_stream_parser_test.cc'; else $(CYGPATH_W) '$(srcdir)/google/protobuf/util/internal/json_stream_parser_test.cc'; fi` - -google/protobuf/util/internal/protobuf_test-protostream_objectsource_test.o: google/protobuf/util/internal/protostream_objectsource_test.cc -@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(protobuf_test_CPPFLAGS) $(CPPFLAGS) $(protobuf_test_CXXFLAGS) $(CXXFLAGS) -MT google/protobuf/util/internal/protobuf_test-protostream_objectsource_test.o -MD -MP -MF google/protobuf/util/internal/$(DEPDIR)/protobuf_test-protostream_objectsource_test.Tpo -c -o google/protobuf/util/internal/protobuf_test-protostream_objectsource_test.o `test -f 'google/protobuf/util/internal/protostream_objectsource_test.cc' || echo '$(srcdir)/'`google/protobuf/util/internal/protostream_objectsource_test.cc -@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) google/protobuf/util/internal/$(DEPDIR)/protobuf_test-protostream_objectsource_test.Tpo google/protobuf/util/internal/$(DEPDIR)/protobuf_test-protostream_objectsource_test.Po -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='google/protobuf/util/internal/protostream_objectsource_test.cc' object='google/protobuf/util/internal/protobuf_test-protostream_objectsource_test.o' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(protobuf_test_CPPFLAGS) $(CPPFLAGS) $(protobuf_test_CXXFLAGS) $(CXXFLAGS) -c -o google/protobuf/util/internal/protobuf_test-protostream_objectsource_test.o `test -f 'google/protobuf/util/internal/protostream_objectsource_test.cc' || echo '$(srcdir)/'`google/protobuf/util/internal/protostream_objectsource_test.cc - -google/protobuf/util/internal/protobuf_test-protostream_objectsource_test.obj: google/protobuf/util/internal/protostream_objectsource_test.cc -@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(protobuf_test_CPPFLAGS) $(CPPFLAGS) $(protobuf_test_CXXFLAGS) $(CXXFLAGS) -MT google/protobuf/util/internal/protobuf_test-protostream_objectsource_test.obj -MD -MP -MF google/protobuf/util/internal/$(DEPDIR)/protobuf_test-protostream_objectsource_test.Tpo -c -o google/protobuf/util/internal/protobuf_test-protostream_objectsource_test.obj `if test -f 'google/protobuf/util/internal/protostream_objectsource_test.cc'; then $(CYGPATH_W) 'google/protobuf/util/internal/protostream_objectsource_test.cc'; else $(CYGPATH_W) '$(srcdir)/google/protobuf/util/internal/protostream_objectsource_test.cc'; fi` -@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) google/protobuf/util/internal/$(DEPDIR)/protobuf_test-protostream_objectsource_test.Tpo google/protobuf/util/internal/$(DEPDIR)/protobuf_test-protostream_objectsource_test.Po -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='google/protobuf/util/internal/protostream_objectsource_test.cc' object='google/protobuf/util/internal/protobuf_test-protostream_objectsource_test.obj' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(protobuf_test_CPPFLAGS) $(CPPFLAGS) $(protobuf_test_CXXFLAGS) $(CXXFLAGS) -c -o google/protobuf/util/internal/protobuf_test-protostream_objectsource_test.obj `if test -f 'google/protobuf/util/internal/protostream_objectsource_test.cc'; then $(CYGPATH_W) 'google/protobuf/util/internal/protostream_objectsource_test.cc'; else $(CYGPATH_W) '$(srcdir)/google/protobuf/util/internal/protostream_objectsource_test.cc'; fi` - -google/protobuf/util/internal/protobuf_test-protostream_objectwriter_test.o: google/protobuf/util/internal/protostream_objectwriter_test.cc -@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(protobuf_test_CPPFLAGS) $(CPPFLAGS) $(protobuf_test_CXXFLAGS) $(CXXFLAGS) -MT google/protobuf/util/internal/protobuf_test-protostream_objectwriter_test.o -MD -MP -MF google/protobuf/util/internal/$(DEPDIR)/protobuf_test-protostream_objectwriter_test.Tpo -c -o google/protobuf/util/internal/protobuf_test-protostream_objectwriter_test.o `test -f 'google/protobuf/util/internal/protostream_objectwriter_test.cc' || echo '$(srcdir)/'`google/protobuf/util/internal/protostream_objectwriter_test.cc -@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) google/protobuf/util/internal/$(DEPDIR)/protobuf_test-protostream_objectwriter_test.Tpo google/protobuf/util/internal/$(DEPDIR)/protobuf_test-protostream_objectwriter_test.Po -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='google/protobuf/util/internal/protostream_objectwriter_test.cc' object='google/protobuf/util/internal/protobuf_test-protostream_objectwriter_test.o' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(protobuf_test_CPPFLAGS) $(CPPFLAGS) $(protobuf_test_CXXFLAGS) $(CXXFLAGS) -c -o google/protobuf/util/internal/protobuf_test-protostream_objectwriter_test.o `test -f 'google/protobuf/util/internal/protostream_objectwriter_test.cc' || echo '$(srcdir)/'`google/protobuf/util/internal/protostream_objectwriter_test.cc - -google/protobuf/util/internal/protobuf_test-protostream_objectwriter_test.obj: google/protobuf/util/internal/protostream_objectwriter_test.cc -@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(protobuf_test_CPPFLAGS) $(CPPFLAGS) $(protobuf_test_CXXFLAGS) $(CXXFLAGS) -MT google/protobuf/util/internal/protobuf_test-protostream_objectwriter_test.obj -MD -MP -MF google/protobuf/util/internal/$(DEPDIR)/protobuf_test-protostream_objectwriter_test.Tpo -c -o google/protobuf/util/internal/protobuf_test-protostream_objectwriter_test.obj `if test -f 'google/protobuf/util/internal/protostream_objectwriter_test.cc'; then $(CYGPATH_W) 'google/protobuf/util/internal/protostream_objectwriter_test.cc'; else $(CYGPATH_W) '$(srcdir)/google/protobuf/util/internal/protostream_objectwriter_test.cc'; fi` -@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) google/protobuf/util/internal/$(DEPDIR)/protobuf_test-protostream_objectwriter_test.Tpo google/protobuf/util/internal/$(DEPDIR)/protobuf_test-protostream_objectwriter_test.Po -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='google/protobuf/util/internal/protostream_objectwriter_test.cc' object='google/protobuf/util/internal/protobuf_test-protostream_objectwriter_test.obj' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(protobuf_test_CPPFLAGS) $(CPPFLAGS) $(protobuf_test_CXXFLAGS) $(CXXFLAGS) -c -o google/protobuf/util/internal/protobuf_test-protostream_objectwriter_test.obj `if test -f 'google/protobuf/util/internal/protostream_objectwriter_test.cc'; then $(CYGPATH_W) 'google/protobuf/util/internal/protostream_objectwriter_test.cc'; else $(CYGPATH_W) '$(srcdir)/google/protobuf/util/internal/protostream_objectwriter_test.cc'; fi` - -google/protobuf/util/internal/protobuf_test-type_info_test_helper.o: google/protobuf/util/internal/type_info_test_helper.cc -@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(protobuf_test_CPPFLAGS) $(CPPFLAGS) $(protobuf_test_CXXFLAGS) $(CXXFLAGS) -MT google/protobuf/util/internal/protobuf_test-type_info_test_helper.o -MD -MP -MF google/protobuf/util/internal/$(DEPDIR)/protobuf_test-type_info_test_helper.Tpo -c -o google/protobuf/util/internal/protobuf_test-type_info_test_helper.o `test -f 'google/protobuf/util/internal/type_info_test_helper.cc' || echo '$(srcdir)/'`google/protobuf/util/internal/type_info_test_helper.cc -@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) google/protobuf/util/internal/$(DEPDIR)/protobuf_test-type_info_test_helper.Tpo google/protobuf/util/internal/$(DEPDIR)/protobuf_test-type_info_test_helper.Po -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='google/protobuf/util/internal/type_info_test_helper.cc' object='google/protobuf/util/internal/protobuf_test-type_info_test_helper.o' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(protobuf_test_CPPFLAGS) $(CPPFLAGS) $(protobuf_test_CXXFLAGS) $(CXXFLAGS) -c -o google/protobuf/util/internal/protobuf_test-type_info_test_helper.o `test -f 'google/protobuf/util/internal/type_info_test_helper.cc' || echo '$(srcdir)/'`google/protobuf/util/internal/type_info_test_helper.cc - -google/protobuf/util/internal/protobuf_test-type_info_test_helper.obj: google/protobuf/util/internal/type_info_test_helper.cc -@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(protobuf_test_CPPFLAGS) $(CPPFLAGS) $(protobuf_test_CXXFLAGS) $(CXXFLAGS) -MT google/protobuf/util/internal/protobuf_test-type_info_test_helper.obj -MD -MP -MF google/protobuf/util/internal/$(DEPDIR)/protobuf_test-type_info_test_helper.Tpo -c -o google/protobuf/util/internal/protobuf_test-type_info_test_helper.obj `if test -f 'google/protobuf/util/internal/type_info_test_helper.cc'; then $(CYGPATH_W) 'google/protobuf/util/internal/type_info_test_helper.cc'; else $(CYGPATH_W) '$(srcdir)/google/protobuf/util/internal/type_info_test_helper.cc'; fi` -@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) google/protobuf/util/internal/$(DEPDIR)/protobuf_test-type_info_test_helper.Tpo google/protobuf/util/internal/$(DEPDIR)/protobuf_test-type_info_test_helper.Po -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='google/protobuf/util/internal/type_info_test_helper.cc' object='google/protobuf/util/internal/protobuf_test-type_info_test_helper.obj' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(protobuf_test_CPPFLAGS) $(CPPFLAGS) $(protobuf_test_CXXFLAGS) $(CXXFLAGS) -c -o google/protobuf/util/internal/protobuf_test-type_info_test_helper.obj `if test -f 'google/protobuf/util/internal/type_info_test_helper.cc'; then $(CYGPATH_W) 'google/protobuf/util/internal/type_info_test_helper.cc'; else $(CYGPATH_W) '$(srcdir)/google/protobuf/util/internal/type_info_test_helper.cc'; fi` - -google/protobuf/util/protobuf_test-json_util_test.o: google/protobuf/util/json_util_test.cc -@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(protobuf_test_CPPFLAGS) $(CPPFLAGS) $(protobuf_test_CXXFLAGS) $(CXXFLAGS) -MT google/protobuf/util/protobuf_test-json_util_test.o -MD -MP -MF google/protobuf/util/$(DEPDIR)/protobuf_test-json_util_test.Tpo -c -o google/protobuf/util/protobuf_test-json_util_test.o `test -f 'google/protobuf/util/json_util_test.cc' || echo '$(srcdir)/'`google/protobuf/util/json_util_test.cc -@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) google/protobuf/util/$(DEPDIR)/protobuf_test-json_util_test.Tpo google/protobuf/util/$(DEPDIR)/protobuf_test-json_util_test.Po -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='google/protobuf/util/json_util_test.cc' object='google/protobuf/util/protobuf_test-json_util_test.o' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(protobuf_test_CPPFLAGS) $(CPPFLAGS) $(protobuf_test_CXXFLAGS) $(CXXFLAGS) -c -o google/protobuf/util/protobuf_test-json_util_test.o `test -f 'google/protobuf/util/json_util_test.cc' || echo '$(srcdir)/'`google/protobuf/util/json_util_test.cc - -google/protobuf/util/protobuf_test-json_util_test.obj: google/protobuf/util/json_util_test.cc -@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(protobuf_test_CPPFLAGS) $(CPPFLAGS) $(protobuf_test_CXXFLAGS) $(CXXFLAGS) -MT google/protobuf/util/protobuf_test-json_util_test.obj -MD -MP -MF google/protobuf/util/$(DEPDIR)/protobuf_test-json_util_test.Tpo -c -o google/protobuf/util/protobuf_test-json_util_test.obj `if test -f 'google/protobuf/util/json_util_test.cc'; then $(CYGPATH_W) 'google/protobuf/util/json_util_test.cc'; else $(CYGPATH_W) '$(srcdir)/google/protobuf/util/json_util_test.cc'; fi` -@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) google/protobuf/util/$(DEPDIR)/protobuf_test-json_util_test.Tpo google/protobuf/util/$(DEPDIR)/protobuf_test-json_util_test.Po -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='google/protobuf/util/json_util_test.cc' object='google/protobuf/util/protobuf_test-json_util_test.obj' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(protobuf_test_CPPFLAGS) $(CPPFLAGS) $(protobuf_test_CXXFLAGS) $(CXXFLAGS) -c -o google/protobuf/util/protobuf_test-json_util_test.obj `if test -f 'google/protobuf/util/json_util_test.cc'; then $(CYGPATH_W) 'google/protobuf/util/json_util_test.cc'; else $(CYGPATH_W) '$(srcdir)/google/protobuf/util/json_util_test.cc'; fi` - -google/protobuf/util/protobuf_test-message_differencer_unittest.o: google/protobuf/util/message_differencer_unittest.cc -@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(protobuf_test_CPPFLAGS) $(CPPFLAGS) $(protobuf_test_CXXFLAGS) $(CXXFLAGS) -MT google/protobuf/util/protobuf_test-message_differencer_unittest.o -MD -MP -MF google/protobuf/util/$(DEPDIR)/protobuf_test-message_differencer_unittest.Tpo -c -o google/protobuf/util/protobuf_test-message_differencer_unittest.o `test -f 'google/protobuf/util/message_differencer_unittest.cc' || echo '$(srcdir)/'`google/protobuf/util/message_differencer_unittest.cc -@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) google/protobuf/util/$(DEPDIR)/protobuf_test-message_differencer_unittest.Tpo google/protobuf/util/$(DEPDIR)/protobuf_test-message_differencer_unittest.Po -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='google/protobuf/util/message_differencer_unittest.cc' object='google/protobuf/util/protobuf_test-message_differencer_unittest.o' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(protobuf_test_CPPFLAGS) $(CPPFLAGS) $(protobuf_test_CXXFLAGS) $(CXXFLAGS) -c -o google/protobuf/util/protobuf_test-message_differencer_unittest.o `test -f 'google/protobuf/util/message_differencer_unittest.cc' || echo '$(srcdir)/'`google/protobuf/util/message_differencer_unittest.cc - -google/protobuf/util/protobuf_test-message_differencer_unittest.obj: google/protobuf/util/message_differencer_unittest.cc -@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(protobuf_test_CPPFLAGS) $(CPPFLAGS) $(protobuf_test_CXXFLAGS) $(CXXFLAGS) -MT google/protobuf/util/protobuf_test-message_differencer_unittest.obj -MD -MP -MF google/protobuf/util/$(DEPDIR)/protobuf_test-message_differencer_unittest.Tpo -c -o google/protobuf/util/protobuf_test-message_differencer_unittest.obj `if test -f 'google/protobuf/util/message_differencer_unittest.cc'; then $(CYGPATH_W) 'google/protobuf/util/message_differencer_unittest.cc'; else $(CYGPATH_W) '$(srcdir)/google/protobuf/util/message_differencer_unittest.cc'; fi` -@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) google/protobuf/util/$(DEPDIR)/protobuf_test-message_differencer_unittest.Tpo google/protobuf/util/$(DEPDIR)/protobuf_test-message_differencer_unittest.Po -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='google/protobuf/util/message_differencer_unittest.cc' object='google/protobuf/util/protobuf_test-message_differencer_unittest.obj' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(protobuf_test_CPPFLAGS) $(CPPFLAGS) $(protobuf_test_CXXFLAGS) $(CXXFLAGS) -c -o google/protobuf/util/protobuf_test-message_differencer_unittest.obj `if test -f 'google/protobuf/util/message_differencer_unittest.cc'; then $(CYGPATH_W) 'google/protobuf/util/message_differencer_unittest.cc'; else $(CYGPATH_W) '$(srcdir)/google/protobuf/util/message_differencer_unittest.cc'; fi` - -google/protobuf/util/protobuf_test-time_util_test.o: google/protobuf/util/time_util_test.cc -@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(protobuf_test_CPPFLAGS) $(CPPFLAGS) $(protobuf_test_CXXFLAGS) $(CXXFLAGS) -MT google/protobuf/util/protobuf_test-time_util_test.o -MD -MP -MF google/protobuf/util/$(DEPDIR)/protobuf_test-time_util_test.Tpo -c -o google/protobuf/util/protobuf_test-time_util_test.o `test -f 'google/protobuf/util/time_util_test.cc' || echo '$(srcdir)/'`google/protobuf/util/time_util_test.cc -@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) google/protobuf/util/$(DEPDIR)/protobuf_test-time_util_test.Tpo google/protobuf/util/$(DEPDIR)/protobuf_test-time_util_test.Po -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='google/protobuf/util/time_util_test.cc' object='google/protobuf/util/protobuf_test-time_util_test.o' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(protobuf_test_CPPFLAGS) $(CPPFLAGS) $(protobuf_test_CXXFLAGS) $(CXXFLAGS) -c -o google/protobuf/util/protobuf_test-time_util_test.o `test -f 'google/protobuf/util/time_util_test.cc' || echo '$(srcdir)/'`google/protobuf/util/time_util_test.cc - -google/protobuf/util/protobuf_test-time_util_test.obj: google/protobuf/util/time_util_test.cc -@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(protobuf_test_CPPFLAGS) $(CPPFLAGS) $(protobuf_test_CXXFLAGS) $(CXXFLAGS) -MT google/protobuf/util/protobuf_test-time_util_test.obj -MD -MP -MF google/protobuf/util/$(DEPDIR)/protobuf_test-time_util_test.Tpo -c -o google/protobuf/util/protobuf_test-time_util_test.obj `if test -f 'google/protobuf/util/time_util_test.cc'; then $(CYGPATH_W) 'google/protobuf/util/time_util_test.cc'; else $(CYGPATH_W) '$(srcdir)/google/protobuf/util/time_util_test.cc'; fi` -@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) google/protobuf/util/$(DEPDIR)/protobuf_test-time_util_test.Tpo google/protobuf/util/$(DEPDIR)/protobuf_test-time_util_test.Po -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='google/protobuf/util/time_util_test.cc' object='google/protobuf/util/protobuf_test-time_util_test.obj' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(protobuf_test_CPPFLAGS) $(CPPFLAGS) $(protobuf_test_CXXFLAGS) $(CXXFLAGS) -c -o google/protobuf/util/protobuf_test-time_util_test.obj `if test -f 'google/protobuf/util/time_util_test.cc'; then $(CYGPATH_W) 'google/protobuf/util/time_util_test.cc'; else $(CYGPATH_W) '$(srcdir)/google/protobuf/util/time_util_test.cc'; fi` - -google/protobuf/util/protobuf_test-type_resolver_util_test.o: google/protobuf/util/type_resolver_util_test.cc -@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(protobuf_test_CPPFLAGS) $(CPPFLAGS) $(protobuf_test_CXXFLAGS) $(CXXFLAGS) -MT google/protobuf/util/protobuf_test-type_resolver_util_test.o -MD -MP -MF google/protobuf/util/$(DEPDIR)/protobuf_test-type_resolver_util_test.Tpo -c -o google/protobuf/util/protobuf_test-type_resolver_util_test.o `test -f 'google/protobuf/util/type_resolver_util_test.cc' || echo '$(srcdir)/'`google/protobuf/util/type_resolver_util_test.cc -@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) google/protobuf/util/$(DEPDIR)/protobuf_test-type_resolver_util_test.Tpo google/protobuf/util/$(DEPDIR)/protobuf_test-type_resolver_util_test.Po -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='google/protobuf/util/type_resolver_util_test.cc' object='google/protobuf/util/protobuf_test-type_resolver_util_test.o' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(protobuf_test_CPPFLAGS) $(CPPFLAGS) $(protobuf_test_CXXFLAGS) $(CXXFLAGS) -c -o google/protobuf/util/protobuf_test-type_resolver_util_test.o `test -f 'google/protobuf/util/type_resolver_util_test.cc' || echo '$(srcdir)/'`google/protobuf/util/type_resolver_util_test.cc - -google/protobuf/util/protobuf_test-type_resolver_util_test.obj: google/protobuf/util/type_resolver_util_test.cc -@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(protobuf_test_CPPFLAGS) $(CPPFLAGS) $(protobuf_test_CXXFLAGS) $(CXXFLAGS) -MT google/protobuf/util/protobuf_test-type_resolver_util_test.obj -MD -MP -MF google/protobuf/util/$(DEPDIR)/protobuf_test-type_resolver_util_test.Tpo -c -o google/protobuf/util/protobuf_test-type_resolver_util_test.obj `if test -f 'google/protobuf/util/type_resolver_util_test.cc'; then $(CYGPATH_W) 'google/protobuf/util/type_resolver_util_test.cc'; else $(CYGPATH_W) '$(srcdir)/google/protobuf/util/type_resolver_util_test.cc'; fi` -@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) google/protobuf/util/$(DEPDIR)/protobuf_test-type_resolver_util_test.Tpo google/protobuf/util/$(DEPDIR)/protobuf_test-type_resolver_util_test.Po -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='google/protobuf/util/type_resolver_util_test.cc' object='google/protobuf/util/protobuf_test-type_resolver_util_test.obj' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(protobuf_test_CPPFLAGS) $(CPPFLAGS) $(protobuf_test_CXXFLAGS) $(CXXFLAGS) -c -o google/protobuf/util/protobuf_test-type_resolver_util_test.obj `if test -f 'google/protobuf/util/type_resolver_util_test.cc'; then $(CYGPATH_W) 'google/protobuf/util/type_resolver_util_test.cc'; else $(CYGPATH_W) '$(srcdir)/google/protobuf/util/type_resolver_util_test.cc'; fi` - -google/protobuf/protobuf_test-well_known_types_unittest.o: google/protobuf/well_known_types_unittest.cc -@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(protobuf_test_CPPFLAGS) $(CPPFLAGS) $(protobuf_test_CXXFLAGS) $(CXXFLAGS) -MT google/protobuf/protobuf_test-well_known_types_unittest.o -MD -MP -MF google/protobuf/$(DEPDIR)/protobuf_test-well_known_types_unittest.Tpo -c -o google/protobuf/protobuf_test-well_known_types_unittest.o `test -f 'google/protobuf/well_known_types_unittest.cc' || echo '$(srcdir)/'`google/protobuf/well_known_types_unittest.cc -@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) google/protobuf/$(DEPDIR)/protobuf_test-well_known_types_unittest.Tpo google/protobuf/$(DEPDIR)/protobuf_test-well_known_types_unittest.Po -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='google/protobuf/well_known_types_unittest.cc' object='google/protobuf/protobuf_test-well_known_types_unittest.o' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(protobuf_test_CPPFLAGS) $(CPPFLAGS) $(protobuf_test_CXXFLAGS) $(CXXFLAGS) -c -o google/protobuf/protobuf_test-well_known_types_unittest.o `test -f 'google/protobuf/well_known_types_unittest.cc' || echo '$(srcdir)/'`google/protobuf/well_known_types_unittest.cc - -google/protobuf/protobuf_test-well_known_types_unittest.obj: google/protobuf/well_known_types_unittest.cc -@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(protobuf_test_CPPFLAGS) $(CPPFLAGS) $(protobuf_test_CXXFLAGS) $(CXXFLAGS) -MT google/protobuf/protobuf_test-well_known_types_unittest.obj -MD -MP -MF google/protobuf/$(DEPDIR)/protobuf_test-well_known_types_unittest.Tpo -c -o google/protobuf/protobuf_test-well_known_types_unittest.obj `if test -f 'google/protobuf/well_known_types_unittest.cc'; then $(CYGPATH_W) 'google/protobuf/well_known_types_unittest.cc'; else $(CYGPATH_W) '$(srcdir)/google/protobuf/well_known_types_unittest.cc'; fi` -@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) google/protobuf/$(DEPDIR)/protobuf_test-well_known_types_unittest.Tpo google/protobuf/$(DEPDIR)/protobuf_test-well_known_types_unittest.Po -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='google/protobuf/well_known_types_unittest.cc' object='google/protobuf/protobuf_test-well_known_types_unittest.obj' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(protobuf_test_CPPFLAGS) $(CPPFLAGS) $(protobuf_test_CXXFLAGS) $(CXXFLAGS) -c -o google/protobuf/protobuf_test-well_known_types_unittest.obj `if test -f 'google/protobuf/well_known_types_unittest.cc'; then $(CYGPATH_W) 'google/protobuf/well_known_types_unittest.cc'; else $(CYGPATH_W) '$(srcdir)/google/protobuf/well_known_types_unittest.cc'; fi` - -google/protobuf/protobuf_test-wire_format_unittest.o: google/protobuf/wire_format_unittest.cc -@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(protobuf_test_CPPFLAGS) $(CPPFLAGS) $(protobuf_test_CXXFLAGS) $(CXXFLAGS) -MT google/protobuf/protobuf_test-wire_format_unittest.o -MD -MP -MF google/protobuf/$(DEPDIR)/protobuf_test-wire_format_unittest.Tpo -c -o google/protobuf/protobuf_test-wire_format_unittest.o `test -f 'google/protobuf/wire_format_unittest.cc' || echo '$(srcdir)/'`google/protobuf/wire_format_unittest.cc -@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) google/protobuf/$(DEPDIR)/protobuf_test-wire_format_unittest.Tpo google/protobuf/$(DEPDIR)/protobuf_test-wire_format_unittest.Po -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='google/protobuf/wire_format_unittest.cc' object='google/protobuf/protobuf_test-wire_format_unittest.o' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(protobuf_test_CPPFLAGS) $(CPPFLAGS) $(protobuf_test_CXXFLAGS) $(CXXFLAGS) -c -o google/protobuf/protobuf_test-wire_format_unittest.o `test -f 'google/protobuf/wire_format_unittest.cc' || echo '$(srcdir)/'`google/protobuf/wire_format_unittest.cc - -google/protobuf/protobuf_test-wire_format_unittest.obj: google/protobuf/wire_format_unittest.cc -@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(protobuf_test_CPPFLAGS) $(CPPFLAGS) $(protobuf_test_CXXFLAGS) $(CXXFLAGS) -MT google/protobuf/protobuf_test-wire_format_unittest.obj -MD -MP -MF google/protobuf/$(DEPDIR)/protobuf_test-wire_format_unittest.Tpo -c -o google/protobuf/protobuf_test-wire_format_unittest.obj `if test -f 'google/protobuf/wire_format_unittest.cc'; then $(CYGPATH_W) 'google/protobuf/wire_format_unittest.cc'; else $(CYGPATH_W) '$(srcdir)/google/protobuf/wire_format_unittest.cc'; fi` -@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) google/protobuf/$(DEPDIR)/protobuf_test-wire_format_unittest.Tpo google/protobuf/$(DEPDIR)/protobuf_test-wire_format_unittest.Po -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='google/protobuf/wire_format_unittest.cc' object='google/protobuf/protobuf_test-wire_format_unittest.obj' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(protobuf_test_CPPFLAGS) $(CPPFLAGS) $(protobuf_test_CXXFLAGS) $(CXXFLAGS) -c -o google/protobuf/protobuf_test-wire_format_unittest.obj `if test -f 'google/protobuf/wire_format_unittest.cc'; then $(CYGPATH_W) 'google/protobuf/wire_format_unittest.cc'; else $(CYGPATH_W) '$(srcdir)/google/protobuf/wire_format_unittest.cc'; fi` - -google/protobuf/protobuf_test-map_lite_unittest.pb.o: google/protobuf/map_lite_unittest.pb.cc -@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(protobuf_test_CPPFLAGS) $(CPPFLAGS) $(protobuf_test_CXXFLAGS) $(CXXFLAGS) -MT google/protobuf/protobuf_test-map_lite_unittest.pb.o -MD -MP -MF google/protobuf/$(DEPDIR)/protobuf_test-map_lite_unittest.pb.Tpo -c -o google/protobuf/protobuf_test-map_lite_unittest.pb.o `test -f 'google/protobuf/map_lite_unittest.pb.cc' || echo '$(srcdir)/'`google/protobuf/map_lite_unittest.pb.cc -@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) google/protobuf/$(DEPDIR)/protobuf_test-map_lite_unittest.pb.Tpo google/protobuf/$(DEPDIR)/protobuf_test-map_lite_unittest.pb.Po -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='google/protobuf/map_lite_unittest.pb.cc' object='google/protobuf/protobuf_test-map_lite_unittest.pb.o' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(protobuf_test_CPPFLAGS) $(CPPFLAGS) $(protobuf_test_CXXFLAGS) $(CXXFLAGS) -c -o google/protobuf/protobuf_test-map_lite_unittest.pb.o `test -f 'google/protobuf/map_lite_unittest.pb.cc' || echo '$(srcdir)/'`google/protobuf/map_lite_unittest.pb.cc - -google/protobuf/protobuf_test-map_lite_unittest.pb.obj: google/protobuf/map_lite_unittest.pb.cc -@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(protobuf_test_CPPFLAGS) $(CPPFLAGS) $(protobuf_test_CXXFLAGS) $(CXXFLAGS) -MT google/protobuf/protobuf_test-map_lite_unittest.pb.obj -MD -MP -MF google/protobuf/$(DEPDIR)/protobuf_test-map_lite_unittest.pb.Tpo -c -o google/protobuf/protobuf_test-map_lite_unittest.pb.obj `if test -f 'google/protobuf/map_lite_unittest.pb.cc'; then $(CYGPATH_W) 'google/protobuf/map_lite_unittest.pb.cc'; else $(CYGPATH_W) '$(srcdir)/google/protobuf/map_lite_unittest.pb.cc'; fi` -@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) google/protobuf/$(DEPDIR)/protobuf_test-map_lite_unittest.pb.Tpo google/protobuf/$(DEPDIR)/protobuf_test-map_lite_unittest.pb.Po -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='google/protobuf/map_lite_unittest.pb.cc' object='google/protobuf/protobuf_test-map_lite_unittest.pb.obj' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(protobuf_test_CPPFLAGS) $(CPPFLAGS) $(protobuf_test_CXXFLAGS) $(CXXFLAGS) -c -o google/protobuf/protobuf_test-map_lite_unittest.pb.obj `if test -f 'google/protobuf/map_lite_unittest.pb.cc'; then $(CYGPATH_W) 'google/protobuf/map_lite_unittest.pb.cc'; else $(CYGPATH_W) '$(srcdir)/google/protobuf/map_lite_unittest.pb.cc'; fi` - -google/protobuf/protobuf_test-unittest_import_lite.pb.o: google/protobuf/unittest_import_lite.pb.cc -@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(protobuf_test_CPPFLAGS) $(CPPFLAGS) $(protobuf_test_CXXFLAGS) $(CXXFLAGS) -MT google/protobuf/protobuf_test-unittest_import_lite.pb.o -MD -MP -MF google/protobuf/$(DEPDIR)/protobuf_test-unittest_import_lite.pb.Tpo -c -o google/protobuf/protobuf_test-unittest_import_lite.pb.o `test -f 'google/protobuf/unittest_import_lite.pb.cc' || echo '$(srcdir)/'`google/protobuf/unittest_import_lite.pb.cc -@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) google/protobuf/$(DEPDIR)/protobuf_test-unittest_import_lite.pb.Tpo google/protobuf/$(DEPDIR)/protobuf_test-unittest_import_lite.pb.Po -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='google/protobuf/unittest_import_lite.pb.cc' object='google/protobuf/protobuf_test-unittest_import_lite.pb.o' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(protobuf_test_CPPFLAGS) $(CPPFLAGS) $(protobuf_test_CXXFLAGS) $(CXXFLAGS) -c -o google/protobuf/protobuf_test-unittest_import_lite.pb.o `test -f 'google/protobuf/unittest_import_lite.pb.cc' || echo '$(srcdir)/'`google/protobuf/unittest_import_lite.pb.cc - -google/protobuf/protobuf_test-unittest_import_lite.pb.obj: google/protobuf/unittest_import_lite.pb.cc -@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(protobuf_test_CPPFLAGS) $(CPPFLAGS) $(protobuf_test_CXXFLAGS) $(CXXFLAGS) -MT google/protobuf/protobuf_test-unittest_import_lite.pb.obj -MD -MP -MF google/protobuf/$(DEPDIR)/protobuf_test-unittest_import_lite.pb.Tpo -c -o google/protobuf/protobuf_test-unittest_import_lite.pb.obj `if test -f 'google/protobuf/unittest_import_lite.pb.cc'; then $(CYGPATH_W) 'google/protobuf/unittest_import_lite.pb.cc'; else $(CYGPATH_W) '$(srcdir)/google/protobuf/unittest_import_lite.pb.cc'; fi` -@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) google/protobuf/$(DEPDIR)/protobuf_test-unittest_import_lite.pb.Tpo google/protobuf/$(DEPDIR)/protobuf_test-unittest_import_lite.pb.Po -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='google/protobuf/unittest_import_lite.pb.cc' object='google/protobuf/protobuf_test-unittest_import_lite.pb.obj' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(protobuf_test_CPPFLAGS) $(CPPFLAGS) $(protobuf_test_CXXFLAGS) $(CXXFLAGS) -c -o google/protobuf/protobuf_test-unittest_import_lite.pb.obj `if test -f 'google/protobuf/unittest_import_lite.pb.cc'; then $(CYGPATH_W) 'google/protobuf/unittest_import_lite.pb.cc'; else $(CYGPATH_W) '$(srcdir)/google/protobuf/unittest_import_lite.pb.cc'; fi` - -google/protobuf/protobuf_test-unittest_import_public_lite.pb.o: google/protobuf/unittest_import_public_lite.pb.cc -@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(protobuf_test_CPPFLAGS) $(CPPFLAGS) $(protobuf_test_CXXFLAGS) $(CXXFLAGS) -MT google/protobuf/protobuf_test-unittest_import_public_lite.pb.o -MD -MP -MF google/protobuf/$(DEPDIR)/protobuf_test-unittest_import_public_lite.pb.Tpo -c -o google/protobuf/protobuf_test-unittest_import_public_lite.pb.o `test -f 'google/protobuf/unittest_import_public_lite.pb.cc' || echo '$(srcdir)/'`google/protobuf/unittest_import_public_lite.pb.cc -@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) google/protobuf/$(DEPDIR)/protobuf_test-unittest_import_public_lite.pb.Tpo google/protobuf/$(DEPDIR)/protobuf_test-unittest_import_public_lite.pb.Po -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='google/protobuf/unittest_import_public_lite.pb.cc' object='google/protobuf/protobuf_test-unittest_import_public_lite.pb.o' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(protobuf_test_CPPFLAGS) $(CPPFLAGS) $(protobuf_test_CXXFLAGS) $(CXXFLAGS) -c -o google/protobuf/protobuf_test-unittest_import_public_lite.pb.o `test -f 'google/protobuf/unittest_import_public_lite.pb.cc' || echo '$(srcdir)/'`google/protobuf/unittest_import_public_lite.pb.cc - -google/protobuf/protobuf_test-unittest_import_public_lite.pb.obj: google/protobuf/unittest_import_public_lite.pb.cc -@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(protobuf_test_CPPFLAGS) $(CPPFLAGS) $(protobuf_test_CXXFLAGS) $(CXXFLAGS) -MT google/protobuf/protobuf_test-unittest_import_public_lite.pb.obj -MD -MP -MF google/protobuf/$(DEPDIR)/protobuf_test-unittest_import_public_lite.pb.Tpo -c -o google/protobuf/protobuf_test-unittest_import_public_lite.pb.obj `if test -f 'google/protobuf/unittest_import_public_lite.pb.cc'; then $(CYGPATH_W) 'google/protobuf/unittest_import_public_lite.pb.cc'; else $(CYGPATH_W) '$(srcdir)/google/protobuf/unittest_import_public_lite.pb.cc'; fi` -@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) google/protobuf/$(DEPDIR)/protobuf_test-unittest_import_public_lite.pb.Tpo google/protobuf/$(DEPDIR)/protobuf_test-unittest_import_public_lite.pb.Po -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='google/protobuf/unittest_import_public_lite.pb.cc' object='google/protobuf/protobuf_test-unittest_import_public_lite.pb.obj' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(protobuf_test_CPPFLAGS) $(CPPFLAGS) $(protobuf_test_CXXFLAGS) $(CXXFLAGS) -c -o google/protobuf/protobuf_test-unittest_import_public_lite.pb.obj `if test -f 'google/protobuf/unittest_import_public_lite.pb.cc'; then $(CYGPATH_W) 'google/protobuf/unittest_import_public_lite.pb.cc'; else $(CYGPATH_W) '$(srcdir)/google/protobuf/unittest_import_public_lite.pb.cc'; fi` - -google/protobuf/protobuf_test-unittest_lite.pb.o: google/protobuf/unittest_lite.pb.cc -@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(protobuf_test_CPPFLAGS) $(CPPFLAGS) $(protobuf_test_CXXFLAGS) $(CXXFLAGS) -MT google/protobuf/protobuf_test-unittest_lite.pb.o -MD -MP -MF google/protobuf/$(DEPDIR)/protobuf_test-unittest_lite.pb.Tpo -c -o google/protobuf/protobuf_test-unittest_lite.pb.o `test -f 'google/protobuf/unittest_lite.pb.cc' || echo '$(srcdir)/'`google/protobuf/unittest_lite.pb.cc -@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) google/protobuf/$(DEPDIR)/protobuf_test-unittest_lite.pb.Tpo google/protobuf/$(DEPDIR)/protobuf_test-unittest_lite.pb.Po -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='google/protobuf/unittest_lite.pb.cc' object='google/protobuf/protobuf_test-unittest_lite.pb.o' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(protobuf_test_CPPFLAGS) $(CPPFLAGS) $(protobuf_test_CXXFLAGS) $(CXXFLAGS) -c -o google/protobuf/protobuf_test-unittest_lite.pb.o `test -f 'google/protobuf/unittest_lite.pb.cc' || echo '$(srcdir)/'`google/protobuf/unittest_lite.pb.cc - -google/protobuf/protobuf_test-unittest_lite.pb.obj: google/protobuf/unittest_lite.pb.cc -@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(protobuf_test_CPPFLAGS) $(CPPFLAGS) $(protobuf_test_CXXFLAGS) $(CXXFLAGS) -MT google/protobuf/protobuf_test-unittest_lite.pb.obj -MD -MP -MF google/protobuf/$(DEPDIR)/protobuf_test-unittest_lite.pb.Tpo -c -o google/protobuf/protobuf_test-unittest_lite.pb.obj `if test -f 'google/protobuf/unittest_lite.pb.cc'; then $(CYGPATH_W) 'google/protobuf/unittest_lite.pb.cc'; else $(CYGPATH_W) '$(srcdir)/google/protobuf/unittest_lite.pb.cc'; fi` -@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) google/protobuf/$(DEPDIR)/protobuf_test-unittest_lite.pb.Tpo google/protobuf/$(DEPDIR)/protobuf_test-unittest_lite.pb.Po -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='google/protobuf/unittest_lite.pb.cc' object='google/protobuf/protobuf_test-unittest_lite.pb.obj' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(protobuf_test_CPPFLAGS) $(CPPFLAGS) $(protobuf_test_CXXFLAGS) $(CXXFLAGS) -c -o google/protobuf/protobuf_test-unittest_lite.pb.obj `if test -f 'google/protobuf/unittest_lite.pb.cc'; then $(CYGPATH_W) 'google/protobuf/unittest_lite.pb.cc'; else $(CYGPATH_W) '$(srcdir)/google/protobuf/unittest_lite.pb.cc'; fi` - -google/protobuf/protobuf_test-any_test.pb.o: google/protobuf/any_test.pb.cc -@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(protobuf_test_CPPFLAGS) $(CPPFLAGS) $(protobuf_test_CXXFLAGS) $(CXXFLAGS) -MT google/protobuf/protobuf_test-any_test.pb.o -MD -MP -MF google/protobuf/$(DEPDIR)/protobuf_test-any_test.pb.Tpo -c -o google/protobuf/protobuf_test-any_test.pb.o `test -f 'google/protobuf/any_test.pb.cc' || echo '$(srcdir)/'`google/protobuf/any_test.pb.cc -@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) google/protobuf/$(DEPDIR)/protobuf_test-any_test.pb.Tpo google/protobuf/$(DEPDIR)/protobuf_test-any_test.pb.Po -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='google/protobuf/any_test.pb.cc' object='google/protobuf/protobuf_test-any_test.pb.o' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(protobuf_test_CPPFLAGS) $(CPPFLAGS) $(protobuf_test_CXXFLAGS) $(CXXFLAGS) -c -o google/protobuf/protobuf_test-any_test.pb.o `test -f 'google/protobuf/any_test.pb.cc' || echo '$(srcdir)/'`google/protobuf/any_test.pb.cc - -google/protobuf/protobuf_test-any_test.pb.obj: google/protobuf/any_test.pb.cc -@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(protobuf_test_CPPFLAGS) $(CPPFLAGS) $(protobuf_test_CXXFLAGS) $(CXXFLAGS) -MT google/protobuf/protobuf_test-any_test.pb.obj -MD -MP -MF google/protobuf/$(DEPDIR)/protobuf_test-any_test.pb.Tpo -c -o google/protobuf/protobuf_test-any_test.pb.obj `if test -f 'google/protobuf/any_test.pb.cc'; then $(CYGPATH_W) 'google/protobuf/any_test.pb.cc'; else $(CYGPATH_W) '$(srcdir)/google/protobuf/any_test.pb.cc'; fi` -@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) google/protobuf/$(DEPDIR)/protobuf_test-any_test.pb.Tpo google/protobuf/$(DEPDIR)/protobuf_test-any_test.pb.Po -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='google/protobuf/any_test.pb.cc' object='google/protobuf/protobuf_test-any_test.pb.obj' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(protobuf_test_CPPFLAGS) $(CPPFLAGS) $(protobuf_test_CXXFLAGS) $(CXXFLAGS) -c -o google/protobuf/protobuf_test-any_test.pb.obj `if test -f 'google/protobuf/any_test.pb.cc'; then $(CYGPATH_W) 'google/protobuf/any_test.pb.cc'; else $(CYGPATH_W) '$(srcdir)/google/protobuf/any_test.pb.cc'; fi` - -google/protobuf/compiler/cpp/protobuf_test-cpp_test_bad_identifiers.pb.o: google/protobuf/compiler/cpp/cpp_test_bad_identifiers.pb.cc -@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(protobuf_test_CPPFLAGS) $(CPPFLAGS) $(protobuf_test_CXXFLAGS) $(CXXFLAGS) -MT google/protobuf/compiler/cpp/protobuf_test-cpp_test_bad_identifiers.pb.o -MD -MP -MF google/protobuf/compiler/cpp/$(DEPDIR)/protobuf_test-cpp_test_bad_identifiers.pb.Tpo -c -o google/protobuf/compiler/cpp/protobuf_test-cpp_test_bad_identifiers.pb.o `test -f 'google/protobuf/compiler/cpp/cpp_test_bad_identifiers.pb.cc' || echo '$(srcdir)/'`google/protobuf/compiler/cpp/cpp_test_bad_identifiers.pb.cc -@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) google/protobuf/compiler/cpp/$(DEPDIR)/protobuf_test-cpp_test_bad_identifiers.pb.Tpo google/protobuf/compiler/cpp/$(DEPDIR)/protobuf_test-cpp_test_bad_identifiers.pb.Po -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='google/protobuf/compiler/cpp/cpp_test_bad_identifiers.pb.cc' object='google/protobuf/compiler/cpp/protobuf_test-cpp_test_bad_identifiers.pb.o' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(protobuf_test_CPPFLAGS) $(CPPFLAGS) $(protobuf_test_CXXFLAGS) $(CXXFLAGS) -c -o google/protobuf/compiler/cpp/protobuf_test-cpp_test_bad_identifiers.pb.o `test -f 'google/protobuf/compiler/cpp/cpp_test_bad_identifiers.pb.cc' || echo '$(srcdir)/'`google/protobuf/compiler/cpp/cpp_test_bad_identifiers.pb.cc - -google/protobuf/compiler/cpp/protobuf_test-cpp_test_bad_identifiers.pb.obj: google/protobuf/compiler/cpp/cpp_test_bad_identifiers.pb.cc -@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(protobuf_test_CPPFLAGS) $(CPPFLAGS) $(protobuf_test_CXXFLAGS) $(CXXFLAGS) -MT google/protobuf/compiler/cpp/protobuf_test-cpp_test_bad_identifiers.pb.obj -MD -MP -MF google/protobuf/compiler/cpp/$(DEPDIR)/protobuf_test-cpp_test_bad_identifiers.pb.Tpo -c -o google/protobuf/compiler/cpp/protobuf_test-cpp_test_bad_identifiers.pb.obj `if test -f 'google/protobuf/compiler/cpp/cpp_test_bad_identifiers.pb.cc'; then $(CYGPATH_W) 'google/protobuf/compiler/cpp/cpp_test_bad_identifiers.pb.cc'; else $(CYGPATH_W) '$(srcdir)/google/protobuf/compiler/cpp/cpp_test_bad_identifiers.pb.cc'; fi` -@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) google/protobuf/compiler/cpp/$(DEPDIR)/protobuf_test-cpp_test_bad_identifiers.pb.Tpo google/protobuf/compiler/cpp/$(DEPDIR)/protobuf_test-cpp_test_bad_identifiers.pb.Po -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='google/protobuf/compiler/cpp/cpp_test_bad_identifiers.pb.cc' object='google/protobuf/compiler/cpp/protobuf_test-cpp_test_bad_identifiers.pb.obj' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(protobuf_test_CPPFLAGS) $(CPPFLAGS) $(protobuf_test_CXXFLAGS) $(CXXFLAGS) -c -o google/protobuf/compiler/cpp/protobuf_test-cpp_test_bad_identifiers.pb.obj `if test -f 'google/protobuf/compiler/cpp/cpp_test_bad_identifiers.pb.cc'; then $(CYGPATH_W) 'google/protobuf/compiler/cpp/cpp_test_bad_identifiers.pb.cc'; else $(CYGPATH_W) '$(srcdir)/google/protobuf/compiler/cpp/cpp_test_bad_identifiers.pb.cc'; fi` - -google/protobuf/compiler/cpp/protobuf_test-cpp_test_large_enum_value.pb.o: google/protobuf/compiler/cpp/cpp_test_large_enum_value.pb.cc -@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(protobuf_test_CPPFLAGS) $(CPPFLAGS) $(protobuf_test_CXXFLAGS) $(CXXFLAGS) -MT google/protobuf/compiler/cpp/protobuf_test-cpp_test_large_enum_value.pb.o -MD -MP -MF google/protobuf/compiler/cpp/$(DEPDIR)/protobuf_test-cpp_test_large_enum_value.pb.Tpo -c -o google/protobuf/compiler/cpp/protobuf_test-cpp_test_large_enum_value.pb.o `test -f 'google/protobuf/compiler/cpp/cpp_test_large_enum_value.pb.cc' || echo '$(srcdir)/'`google/protobuf/compiler/cpp/cpp_test_large_enum_value.pb.cc -@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) google/protobuf/compiler/cpp/$(DEPDIR)/protobuf_test-cpp_test_large_enum_value.pb.Tpo google/protobuf/compiler/cpp/$(DEPDIR)/protobuf_test-cpp_test_large_enum_value.pb.Po -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='google/protobuf/compiler/cpp/cpp_test_large_enum_value.pb.cc' object='google/protobuf/compiler/cpp/protobuf_test-cpp_test_large_enum_value.pb.o' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(protobuf_test_CPPFLAGS) $(CPPFLAGS) $(protobuf_test_CXXFLAGS) $(CXXFLAGS) -c -o google/protobuf/compiler/cpp/protobuf_test-cpp_test_large_enum_value.pb.o `test -f 'google/protobuf/compiler/cpp/cpp_test_large_enum_value.pb.cc' || echo '$(srcdir)/'`google/protobuf/compiler/cpp/cpp_test_large_enum_value.pb.cc - -google/protobuf/compiler/cpp/protobuf_test-cpp_test_large_enum_value.pb.obj: google/protobuf/compiler/cpp/cpp_test_large_enum_value.pb.cc -@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(protobuf_test_CPPFLAGS) $(CPPFLAGS) $(protobuf_test_CXXFLAGS) $(CXXFLAGS) -MT google/protobuf/compiler/cpp/protobuf_test-cpp_test_large_enum_value.pb.obj -MD -MP -MF google/protobuf/compiler/cpp/$(DEPDIR)/protobuf_test-cpp_test_large_enum_value.pb.Tpo -c -o google/protobuf/compiler/cpp/protobuf_test-cpp_test_large_enum_value.pb.obj `if test -f 'google/protobuf/compiler/cpp/cpp_test_large_enum_value.pb.cc'; then $(CYGPATH_W) 'google/protobuf/compiler/cpp/cpp_test_large_enum_value.pb.cc'; else $(CYGPATH_W) '$(srcdir)/google/protobuf/compiler/cpp/cpp_test_large_enum_value.pb.cc'; fi` -@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) google/protobuf/compiler/cpp/$(DEPDIR)/protobuf_test-cpp_test_large_enum_value.pb.Tpo google/protobuf/compiler/cpp/$(DEPDIR)/protobuf_test-cpp_test_large_enum_value.pb.Po -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='google/protobuf/compiler/cpp/cpp_test_large_enum_value.pb.cc' object='google/protobuf/compiler/cpp/protobuf_test-cpp_test_large_enum_value.pb.obj' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(protobuf_test_CPPFLAGS) $(CPPFLAGS) $(protobuf_test_CXXFLAGS) $(CXXFLAGS) -c -o google/protobuf/compiler/cpp/protobuf_test-cpp_test_large_enum_value.pb.obj `if test -f 'google/protobuf/compiler/cpp/cpp_test_large_enum_value.pb.cc'; then $(CYGPATH_W) 'google/protobuf/compiler/cpp/cpp_test_large_enum_value.pb.cc'; else $(CYGPATH_W) '$(srcdir)/google/protobuf/compiler/cpp/cpp_test_large_enum_value.pb.cc'; fi` - -google/protobuf/protobuf_test-map_proto2_unittest.pb.o: google/protobuf/map_proto2_unittest.pb.cc -@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(protobuf_test_CPPFLAGS) $(CPPFLAGS) $(protobuf_test_CXXFLAGS) $(CXXFLAGS) -MT google/protobuf/protobuf_test-map_proto2_unittest.pb.o -MD -MP -MF google/protobuf/$(DEPDIR)/protobuf_test-map_proto2_unittest.pb.Tpo -c -o google/protobuf/protobuf_test-map_proto2_unittest.pb.o `test -f 'google/protobuf/map_proto2_unittest.pb.cc' || echo '$(srcdir)/'`google/protobuf/map_proto2_unittest.pb.cc -@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) google/protobuf/$(DEPDIR)/protobuf_test-map_proto2_unittest.pb.Tpo google/protobuf/$(DEPDIR)/protobuf_test-map_proto2_unittest.pb.Po -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='google/protobuf/map_proto2_unittest.pb.cc' object='google/protobuf/protobuf_test-map_proto2_unittest.pb.o' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(protobuf_test_CPPFLAGS) $(CPPFLAGS) $(protobuf_test_CXXFLAGS) $(CXXFLAGS) -c -o google/protobuf/protobuf_test-map_proto2_unittest.pb.o `test -f 'google/protobuf/map_proto2_unittest.pb.cc' || echo '$(srcdir)/'`google/protobuf/map_proto2_unittest.pb.cc - -google/protobuf/protobuf_test-map_proto2_unittest.pb.obj: google/protobuf/map_proto2_unittest.pb.cc -@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(protobuf_test_CPPFLAGS) $(CPPFLAGS) $(protobuf_test_CXXFLAGS) $(CXXFLAGS) -MT google/protobuf/protobuf_test-map_proto2_unittest.pb.obj -MD -MP -MF google/protobuf/$(DEPDIR)/protobuf_test-map_proto2_unittest.pb.Tpo -c -o google/protobuf/protobuf_test-map_proto2_unittest.pb.obj `if test -f 'google/protobuf/map_proto2_unittest.pb.cc'; then $(CYGPATH_W) 'google/protobuf/map_proto2_unittest.pb.cc'; else $(CYGPATH_W) '$(srcdir)/google/protobuf/map_proto2_unittest.pb.cc'; fi` -@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) google/protobuf/$(DEPDIR)/protobuf_test-map_proto2_unittest.pb.Tpo google/protobuf/$(DEPDIR)/protobuf_test-map_proto2_unittest.pb.Po -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='google/protobuf/map_proto2_unittest.pb.cc' object='google/protobuf/protobuf_test-map_proto2_unittest.pb.obj' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(protobuf_test_CPPFLAGS) $(CPPFLAGS) $(protobuf_test_CXXFLAGS) $(CXXFLAGS) -c -o google/protobuf/protobuf_test-map_proto2_unittest.pb.obj `if test -f 'google/protobuf/map_proto2_unittest.pb.cc'; then $(CYGPATH_W) 'google/protobuf/map_proto2_unittest.pb.cc'; else $(CYGPATH_W) '$(srcdir)/google/protobuf/map_proto2_unittest.pb.cc'; fi` - -google/protobuf/protobuf_test-map_unittest.pb.o: google/protobuf/map_unittest.pb.cc -@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(protobuf_test_CPPFLAGS) $(CPPFLAGS) $(protobuf_test_CXXFLAGS) $(CXXFLAGS) -MT google/protobuf/protobuf_test-map_unittest.pb.o -MD -MP -MF google/protobuf/$(DEPDIR)/protobuf_test-map_unittest.pb.Tpo -c -o google/protobuf/protobuf_test-map_unittest.pb.o `test -f 'google/protobuf/map_unittest.pb.cc' || echo '$(srcdir)/'`google/protobuf/map_unittest.pb.cc -@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) google/protobuf/$(DEPDIR)/protobuf_test-map_unittest.pb.Tpo google/protobuf/$(DEPDIR)/protobuf_test-map_unittest.pb.Po -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='google/protobuf/map_unittest.pb.cc' object='google/protobuf/protobuf_test-map_unittest.pb.o' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(protobuf_test_CPPFLAGS) $(CPPFLAGS) $(protobuf_test_CXXFLAGS) $(CXXFLAGS) -c -o google/protobuf/protobuf_test-map_unittest.pb.o `test -f 'google/protobuf/map_unittest.pb.cc' || echo '$(srcdir)/'`google/protobuf/map_unittest.pb.cc - -google/protobuf/protobuf_test-map_unittest.pb.obj: google/protobuf/map_unittest.pb.cc -@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(protobuf_test_CPPFLAGS) $(CPPFLAGS) $(protobuf_test_CXXFLAGS) $(CXXFLAGS) -MT google/protobuf/protobuf_test-map_unittest.pb.obj -MD -MP -MF google/protobuf/$(DEPDIR)/protobuf_test-map_unittest.pb.Tpo -c -o google/protobuf/protobuf_test-map_unittest.pb.obj `if test -f 'google/protobuf/map_unittest.pb.cc'; then $(CYGPATH_W) 'google/protobuf/map_unittest.pb.cc'; else $(CYGPATH_W) '$(srcdir)/google/protobuf/map_unittest.pb.cc'; fi` -@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) google/protobuf/$(DEPDIR)/protobuf_test-map_unittest.pb.Tpo google/protobuf/$(DEPDIR)/protobuf_test-map_unittest.pb.Po -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='google/protobuf/map_unittest.pb.cc' object='google/protobuf/protobuf_test-map_unittest.pb.obj' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(protobuf_test_CPPFLAGS) $(CPPFLAGS) $(protobuf_test_CXXFLAGS) $(CXXFLAGS) -c -o google/protobuf/protobuf_test-map_unittest.pb.obj `if test -f 'google/protobuf/map_unittest.pb.cc'; then $(CYGPATH_W) 'google/protobuf/map_unittest.pb.cc'; else $(CYGPATH_W) '$(srcdir)/google/protobuf/map_unittest.pb.cc'; fi` - -google/protobuf/protobuf_test-unittest.pb.o: google/protobuf/unittest.pb.cc -@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(protobuf_test_CPPFLAGS) $(CPPFLAGS) $(protobuf_test_CXXFLAGS) $(CXXFLAGS) -MT google/protobuf/protobuf_test-unittest.pb.o -MD -MP -MF google/protobuf/$(DEPDIR)/protobuf_test-unittest.pb.Tpo -c -o google/protobuf/protobuf_test-unittest.pb.o `test -f 'google/protobuf/unittest.pb.cc' || echo '$(srcdir)/'`google/protobuf/unittest.pb.cc -@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) google/protobuf/$(DEPDIR)/protobuf_test-unittest.pb.Tpo google/protobuf/$(DEPDIR)/protobuf_test-unittest.pb.Po -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='google/protobuf/unittest.pb.cc' object='google/protobuf/protobuf_test-unittest.pb.o' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(protobuf_test_CPPFLAGS) $(CPPFLAGS) $(protobuf_test_CXXFLAGS) $(CXXFLAGS) -c -o google/protobuf/protobuf_test-unittest.pb.o `test -f 'google/protobuf/unittest.pb.cc' || echo '$(srcdir)/'`google/protobuf/unittest.pb.cc - -google/protobuf/protobuf_test-unittest.pb.obj: google/protobuf/unittest.pb.cc -@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(protobuf_test_CPPFLAGS) $(CPPFLAGS) $(protobuf_test_CXXFLAGS) $(CXXFLAGS) -MT google/protobuf/protobuf_test-unittest.pb.obj -MD -MP -MF google/protobuf/$(DEPDIR)/protobuf_test-unittest.pb.Tpo -c -o google/protobuf/protobuf_test-unittest.pb.obj `if test -f 'google/protobuf/unittest.pb.cc'; then $(CYGPATH_W) 'google/protobuf/unittest.pb.cc'; else $(CYGPATH_W) '$(srcdir)/google/protobuf/unittest.pb.cc'; fi` -@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) google/protobuf/$(DEPDIR)/protobuf_test-unittest.pb.Tpo google/protobuf/$(DEPDIR)/protobuf_test-unittest.pb.Po -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='google/protobuf/unittest.pb.cc' object='google/protobuf/protobuf_test-unittest.pb.obj' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(protobuf_test_CPPFLAGS) $(CPPFLAGS) $(protobuf_test_CXXFLAGS) $(CXXFLAGS) -c -o google/protobuf/protobuf_test-unittest.pb.obj `if test -f 'google/protobuf/unittest.pb.cc'; then $(CYGPATH_W) 'google/protobuf/unittest.pb.cc'; else $(CYGPATH_W) '$(srcdir)/google/protobuf/unittest.pb.cc'; fi` - -google/protobuf/protobuf_test-unittest_arena.pb.o: google/protobuf/unittest_arena.pb.cc -@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(protobuf_test_CPPFLAGS) $(CPPFLAGS) $(protobuf_test_CXXFLAGS) $(CXXFLAGS) -MT google/protobuf/protobuf_test-unittest_arena.pb.o -MD -MP -MF google/protobuf/$(DEPDIR)/protobuf_test-unittest_arena.pb.Tpo -c -o google/protobuf/protobuf_test-unittest_arena.pb.o `test -f 'google/protobuf/unittest_arena.pb.cc' || echo '$(srcdir)/'`google/protobuf/unittest_arena.pb.cc -@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) google/protobuf/$(DEPDIR)/protobuf_test-unittest_arena.pb.Tpo google/protobuf/$(DEPDIR)/protobuf_test-unittest_arena.pb.Po -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='google/protobuf/unittest_arena.pb.cc' object='google/protobuf/protobuf_test-unittest_arena.pb.o' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(protobuf_test_CPPFLAGS) $(CPPFLAGS) $(protobuf_test_CXXFLAGS) $(CXXFLAGS) -c -o google/protobuf/protobuf_test-unittest_arena.pb.o `test -f 'google/protobuf/unittest_arena.pb.cc' || echo '$(srcdir)/'`google/protobuf/unittest_arena.pb.cc - -google/protobuf/protobuf_test-unittest_arena.pb.obj: google/protobuf/unittest_arena.pb.cc -@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(protobuf_test_CPPFLAGS) $(CPPFLAGS) $(protobuf_test_CXXFLAGS) $(CXXFLAGS) -MT google/protobuf/protobuf_test-unittest_arena.pb.obj -MD -MP -MF google/protobuf/$(DEPDIR)/protobuf_test-unittest_arena.pb.Tpo -c -o google/protobuf/protobuf_test-unittest_arena.pb.obj `if test -f 'google/protobuf/unittest_arena.pb.cc'; then $(CYGPATH_W) 'google/protobuf/unittest_arena.pb.cc'; else $(CYGPATH_W) '$(srcdir)/google/protobuf/unittest_arena.pb.cc'; fi` -@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) google/protobuf/$(DEPDIR)/protobuf_test-unittest_arena.pb.Tpo google/protobuf/$(DEPDIR)/protobuf_test-unittest_arena.pb.Po -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='google/protobuf/unittest_arena.pb.cc' object='google/protobuf/protobuf_test-unittest_arena.pb.obj' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(protobuf_test_CPPFLAGS) $(CPPFLAGS) $(protobuf_test_CXXFLAGS) $(CXXFLAGS) -c -o google/protobuf/protobuf_test-unittest_arena.pb.obj `if test -f 'google/protobuf/unittest_arena.pb.cc'; then $(CYGPATH_W) 'google/protobuf/unittest_arena.pb.cc'; else $(CYGPATH_W) '$(srcdir)/google/protobuf/unittest_arena.pb.cc'; fi` - -google/protobuf/protobuf_test-unittest_custom_options.pb.o: google/protobuf/unittest_custom_options.pb.cc -@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(protobuf_test_CPPFLAGS) $(CPPFLAGS) $(protobuf_test_CXXFLAGS) $(CXXFLAGS) -MT google/protobuf/protobuf_test-unittest_custom_options.pb.o -MD -MP -MF google/protobuf/$(DEPDIR)/protobuf_test-unittest_custom_options.pb.Tpo -c -o google/protobuf/protobuf_test-unittest_custom_options.pb.o `test -f 'google/protobuf/unittest_custom_options.pb.cc' || echo '$(srcdir)/'`google/protobuf/unittest_custom_options.pb.cc -@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) google/protobuf/$(DEPDIR)/protobuf_test-unittest_custom_options.pb.Tpo google/protobuf/$(DEPDIR)/protobuf_test-unittest_custom_options.pb.Po -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='google/protobuf/unittest_custom_options.pb.cc' object='google/protobuf/protobuf_test-unittest_custom_options.pb.o' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(protobuf_test_CPPFLAGS) $(CPPFLAGS) $(protobuf_test_CXXFLAGS) $(CXXFLAGS) -c -o google/protobuf/protobuf_test-unittest_custom_options.pb.o `test -f 'google/protobuf/unittest_custom_options.pb.cc' || echo '$(srcdir)/'`google/protobuf/unittest_custom_options.pb.cc - -google/protobuf/protobuf_test-unittest_custom_options.pb.obj: google/protobuf/unittest_custom_options.pb.cc -@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(protobuf_test_CPPFLAGS) $(CPPFLAGS) $(protobuf_test_CXXFLAGS) $(CXXFLAGS) -MT google/protobuf/protobuf_test-unittest_custom_options.pb.obj -MD -MP -MF google/protobuf/$(DEPDIR)/protobuf_test-unittest_custom_options.pb.Tpo -c -o google/protobuf/protobuf_test-unittest_custom_options.pb.obj `if test -f 'google/protobuf/unittest_custom_options.pb.cc'; then $(CYGPATH_W) 'google/protobuf/unittest_custom_options.pb.cc'; else $(CYGPATH_W) '$(srcdir)/google/protobuf/unittest_custom_options.pb.cc'; fi` -@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) google/protobuf/$(DEPDIR)/protobuf_test-unittest_custom_options.pb.Tpo google/protobuf/$(DEPDIR)/protobuf_test-unittest_custom_options.pb.Po -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='google/protobuf/unittest_custom_options.pb.cc' object='google/protobuf/protobuf_test-unittest_custom_options.pb.obj' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(protobuf_test_CPPFLAGS) $(CPPFLAGS) $(protobuf_test_CXXFLAGS) $(CXXFLAGS) -c -o google/protobuf/protobuf_test-unittest_custom_options.pb.obj `if test -f 'google/protobuf/unittest_custom_options.pb.cc'; then $(CYGPATH_W) 'google/protobuf/unittest_custom_options.pb.cc'; else $(CYGPATH_W) '$(srcdir)/google/protobuf/unittest_custom_options.pb.cc'; fi` - -google/protobuf/protobuf_test-unittest_drop_unknown_fields.pb.o: google/protobuf/unittest_drop_unknown_fields.pb.cc -@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(protobuf_test_CPPFLAGS) $(CPPFLAGS) $(protobuf_test_CXXFLAGS) $(CXXFLAGS) -MT google/protobuf/protobuf_test-unittest_drop_unknown_fields.pb.o -MD -MP -MF google/protobuf/$(DEPDIR)/protobuf_test-unittest_drop_unknown_fields.pb.Tpo -c -o google/protobuf/protobuf_test-unittest_drop_unknown_fields.pb.o `test -f 'google/protobuf/unittest_drop_unknown_fields.pb.cc' || echo '$(srcdir)/'`google/protobuf/unittest_drop_unknown_fields.pb.cc -@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) google/protobuf/$(DEPDIR)/protobuf_test-unittest_drop_unknown_fields.pb.Tpo google/protobuf/$(DEPDIR)/protobuf_test-unittest_drop_unknown_fields.pb.Po -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='google/protobuf/unittest_drop_unknown_fields.pb.cc' object='google/protobuf/protobuf_test-unittest_drop_unknown_fields.pb.o' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(protobuf_test_CPPFLAGS) $(CPPFLAGS) $(protobuf_test_CXXFLAGS) $(CXXFLAGS) -c -o google/protobuf/protobuf_test-unittest_drop_unknown_fields.pb.o `test -f 'google/protobuf/unittest_drop_unknown_fields.pb.cc' || echo '$(srcdir)/'`google/protobuf/unittest_drop_unknown_fields.pb.cc - -google/protobuf/protobuf_test-unittest_drop_unknown_fields.pb.obj: google/protobuf/unittest_drop_unknown_fields.pb.cc -@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(protobuf_test_CPPFLAGS) $(CPPFLAGS) $(protobuf_test_CXXFLAGS) $(CXXFLAGS) -MT google/protobuf/protobuf_test-unittest_drop_unknown_fields.pb.obj -MD -MP -MF google/protobuf/$(DEPDIR)/protobuf_test-unittest_drop_unknown_fields.pb.Tpo -c -o google/protobuf/protobuf_test-unittest_drop_unknown_fields.pb.obj `if test -f 'google/protobuf/unittest_drop_unknown_fields.pb.cc'; then $(CYGPATH_W) 'google/protobuf/unittest_drop_unknown_fields.pb.cc'; else $(CYGPATH_W) '$(srcdir)/google/protobuf/unittest_drop_unknown_fields.pb.cc'; fi` -@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) google/protobuf/$(DEPDIR)/protobuf_test-unittest_drop_unknown_fields.pb.Tpo google/protobuf/$(DEPDIR)/protobuf_test-unittest_drop_unknown_fields.pb.Po -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='google/protobuf/unittest_drop_unknown_fields.pb.cc' object='google/protobuf/protobuf_test-unittest_drop_unknown_fields.pb.obj' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(protobuf_test_CPPFLAGS) $(CPPFLAGS) $(protobuf_test_CXXFLAGS) $(CXXFLAGS) -c -o google/protobuf/protobuf_test-unittest_drop_unknown_fields.pb.obj `if test -f 'google/protobuf/unittest_drop_unknown_fields.pb.cc'; then $(CYGPATH_W) 'google/protobuf/unittest_drop_unknown_fields.pb.cc'; else $(CYGPATH_W) '$(srcdir)/google/protobuf/unittest_drop_unknown_fields.pb.cc'; fi` - -google/protobuf/protobuf_test-unittest_embed_optimize_for.pb.o: google/protobuf/unittest_embed_optimize_for.pb.cc -@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(protobuf_test_CPPFLAGS) $(CPPFLAGS) $(protobuf_test_CXXFLAGS) $(CXXFLAGS) -MT google/protobuf/protobuf_test-unittest_embed_optimize_for.pb.o -MD -MP -MF google/protobuf/$(DEPDIR)/protobuf_test-unittest_embed_optimize_for.pb.Tpo -c -o google/protobuf/protobuf_test-unittest_embed_optimize_for.pb.o `test -f 'google/protobuf/unittest_embed_optimize_for.pb.cc' || echo '$(srcdir)/'`google/protobuf/unittest_embed_optimize_for.pb.cc -@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) google/protobuf/$(DEPDIR)/protobuf_test-unittest_embed_optimize_for.pb.Tpo google/protobuf/$(DEPDIR)/protobuf_test-unittest_embed_optimize_for.pb.Po -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='google/protobuf/unittest_embed_optimize_for.pb.cc' object='google/protobuf/protobuf_test-unittest_embed_optimize_for.pb.o' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(protobuf_test_CPPFLAGS) $(CPPFLAGS) $(protobuf_test_CXXFLAGS) $(CXXFLAGS) -c -o google/protobuf/protobuf_test-unittest_embed_optimize_for.pb.o `test -f 'google/protobuf/unittest_embed_optimize_for.pb.cc' || echo '$(srcdir)/'`google/protobuf/unittest_embed_optimize_for.pb.cc - -google/protobuf/protobuf_test-unittest_embed_optimize_for.pb.obj: google/protobuf/unittest_embed_optimize_for.pb.cc -@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(protobuf_test_CPPFLAGS) $(CPPFLAGS) $(protobuf_test_CXXFLAGS) $(CXXFLAGS) -MT google/protobuf/protobuf_test-unittest_embed_optimize_for.pb.obj -MD -MP -MF google/protobuf/$(DEPDIR)/protobuf_test-unittest_embed_optimize_for.pb.Tpo -c -o google/protobuf/protobuf_test-unittest_embed_optimize_for.pb.obj `if test -f 'google/protobuf/unittest_embed_optimize_for.pb.cc'; then $(CYGPATH_W) 'google/protobuf/unittest_embed_optimize_for.pb.cc'; else $(CYGPATH_W) '$(srcdir)/google/protobuf/unittest_embed_optimize_for.pb.cc'; fi` -@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) google/protobuf/$(DEPDIR)/protobuf_test-unittest_embed_optimize_for.pb.Tpo google/protobuf/$(DEPDIR)/protobuf_test-unittest_embed_optimize_for.pb.Po -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='google/protobuf/unittest_embed_optimize_for.pb.cc' object='google/protobuf/protobuf_test-unittest_embed_optimize_for.pb.obj' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(protobuf_test_CPPFLAGS) $(CPPFLAGS) $(protobuf_test_CXXFLAGS) $(CXXFLAGS) -c -o google/protobuf/protobuf_test-unittest_embed_optimize_for.pb.obj `if test -f 'google/protobuf/unittest_embed_optimize_for.pb.cc'; then $(CYGPATH_W) 'google/protobuf/unittest_embed_optimize_for.pb.cc'; else $(CYGPATH_W) '$(srcdir)/google/protobuf/unittest_embed_optimize_for.pb.cc'; fi` - -google/protobuf/protobuf_test-unittest_empty.pb.o: google/protobuf/unittest_empty.pb.cc -@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(protobuf_test_CPPFLAGS) $(CPPFLAGS) $(protobuf_test_CXXFLAGS) $(CXXFLAGS) -MT google/protobuf/protobuf_test-unittest_empty.pb.o -MD -MP -MF google/protobuf/$(DEPDIR)/protobuf_test-unittest_empty.pb.Tpo -c -o google/protobuf/protobuf_test-unittest_empty.pb.o `test -f 'google/protobuf/unittest_empty.pb.cc' || echo '$(srcdir)/'`google/protobuf/unittest_empty.pb.cc -@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) google/protobuf/$(DEPDIR)/protobuf_test-unittest_empty.pb.Tpo google/protobuf/$(DEPDIR)/protobuf_test-unittest_empty.pb.Po -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='google/protobuf/unittest_empty.pb.cc' object='google/protobuf/protobuf_test-unittest_empty.pb.o' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(protobuf_test_CPPFLAGS) $(CPPFLAGS) $(protobuf_test_CXXFLAGS) $(CXXFLAGS) -c -o google/protobuf/protobuf_test-unittest_empty.pb.o `test -f 'google/protobuf/unittest_empty.pb.cc' || echo '$(srcdir)/'`google/protobuf/unittest_empty.pb.cc - -google/protobuf/protobuf_test-unittest_empty.pb.obj: google/protobuf/unittest_empty.pb.cc -@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(protobuf_test_CPPFLAGS) $(CPPFLAGS) $(protobuf_test_CXXFLAGS) $(CXXFLAGS) -MT google/protobuf/protobuf_test-unittest_empty.pb.obj -MD -MP -MF google/protobuf/$(DEPDIR)/protobuf_test-unittest_empty.pb.Tpo -c -o google/protobuf/protobuf_test-unittest_empty.pb.obj `if test -f 'google/protobuf/unittest_empty.pb.cc'; then $(CYGPATH_W) 'google/protobuf/unittest_empty.pb.cc'; else $(CYGPATH_W) '$(srcdir)/google/protobuf/unittest_empty.pb.cc'; fi` -@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) google/protobuf/$(DEPDIR)/protobuf_test-unittest_empty.pb.Tpo google/protobuf/$(DEPDIR)/protobuf_test-unittest_empty.pb.Po -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='google/protobuf/unittest_empty.pb.cc' object='google/protobuf/protobuf_test-unittest_empty.pb.obj' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(protobuf_test_CPPFLAGS) $(CPPFLAGS) $(protobuf_test_CXXFLAGS) $(CXXFLAGS) -c -o google/protobuf/protobuf_test-unittest_empty.pb.obj `if test -f 'google/protobuf/unittest_empty.pb.cc'; then $(CYGPATH_W) 'google/protobuf/unittest_empty.pb.cc'; else $(CYGPATH_W) '$(srcdir)/google/protobuf/unittest_empty.pb.cc'; fi` - -google/protobuf/protobuf_test-unittest_enormous_descriptor.pb.o: google/protobuf/unittest_enormous_descriptor.pb.cc -@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(protobuf_test_CPPFLAGS) $(CPPFLAGS) $(protobuf_test_CXXFLAGS) $(CXXFLAGS) -MT google/protobuf/protobuf_test-unittest_enormous_descriptor.pb.o -MD -MP -MF google/protobuf/$(DEPDIR)/protobuf_test-unittest_enormous_descriptor.pb.Tpo -c -o google/protobuf/protobuf_test-unittest_enormous_descriptor.pb.o `test -f 'google/protobuf/unittest_enormous_descriptor.pb.cc' || echo '$(srcdir)/'`google/protobuf/unittest_enormous_descriptor.pb.cc -@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) google/protobuf/$(DEPDIR)/protobuf_test-unittest_enormous_descriptor.pb.Tpo google/protobuf/$(DEPDIR)/protobuf_test-unittest_enormous_descriptor.pb.Po -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='google/protobuf/unittest_enormous_descriptor.pb.cc' object='google/protobuf/protobuf_test-unittest_enormous_descriptor.pb.o' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(protobuf_test_CPPFLAGS) $(CPPFLAGS) $(protobuf_test_CXXFLAGS) $(CXXFLAGS) -c -o google/protobuf/protobuf_test-unittest_enormous_descriptor.pb.o `test -f 'google/protobuf/unittest_enormous_descriptor.pb.cc' || echo '$(srcdir)/'`google/protobuf/unittest_enormous_descriptor.pb.cc - -google/protobuf/protobuf_test-unittest_enormous_descriptor.pb.obj: google/protobuf/unittest_enormous_descriptor.pb.cc -@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(protobuf_test_CPPFLAGS) $(CPPFLAGS) $(protobuf_test_CXXFLAGS) $(CXXFLAGS) -MT google/protobuf/protobuf_test-unittest_enormous_descriptor.pb.obj -MD -MP -MF google/protobuf/$(DEPDIR)/protobuf_test-unittest_enormous_descriptor.pb.Tpo -c -o google/protobuf/protobuf_test-unittest_enormous_descriptor.pb.obj `if test -f 'google/protobuf/unittest_enormous_descriptor.pb.cc'; then $(CYGPATH_W) 'google/protobuf/unittest_enormous_descriptor.pb.cc'; else $(CYGPATH_W) '$(srcdir)/google/protobuf/unittest_enormous_descriptor.pb.cc'; fi` -@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) google/protobuf/$(DEPDIR)/protobuf_test-unittest_enormous_descriptor.pb.Tpo google/protobuf/$(DEPDIR)/protobuf_test-unittest_enormous_descriptor.pb.Po -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='google/protobuf/unittest_enormous_descriptor.pb.cc' object='google/protobuf/protobuf_test-unittest_enormous_descriptor.pb.obj' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(protobuf_test_CPPFLAGS) $(CPPFLAGS) $(protobuf_test_CXXFLAGS) $(CXXFLAGS) -c -o google/protobuf/protobuf_test-unittest_enormous_descriptor.pb.obj `if test -f 'google/protobuf/unittest_enormous_descriptor.pb.cc'; then $(CYGPATH_W) 'google/protobuf/unittest_enormous_descriptor.pb.cc'; else $(CYGPATH_W) '$(srcdir)/google/protobuf/unittest_enormous_descriptor.pb.cc'; fi` - -google/protobuf/protobuf_test-unittest_import.pb.o: google/protobuf/unittest_import.pb.cc -@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(protobuf_test_CPPFLAGS) $(CPPFLAGS) $(protobuf_test_CXXFLAGS) $(CXXFLAGS) -MT google/protobuf/protobuf_test-unittest_import.pb.o -MD -MP -MF google/protobuf/$(DEPDIR)/protobuf_test-unittest_import.pb.Tpo -c -o google/protobuf/protobuf_test-unittest_import.pb.o `test -f 'google/protobuf/unittest_import.pb.cc' || echo '$(srcdir)/'`google/protobuf/unittest_import.pb.cc -@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) google/protobuf/$(DEPDIR)/protobuf_test-unittest_import.pb.Tpo google/protobuf/$(DEPDIR)/protobuf_test-unittest_import.pb.Po -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='google/protobuf/unittest_import.pb.cc' object='google/protobuf/protobuf_test-unittest_import.pb.o' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(protobuf_test_CPPFLAGS) $(CPPFLAGS) $(protobuf_test_CXXFLAGS) $(CXXFLAGS) -c -o google/protobuf/protobuf_test-unittest_import.pb.o `test -f 'google/protobuf/unittest_import.pb.cc' || echo '$(srcdir)/'`google/protobuf/unittest_import.pb.cc - -google/protobuf/protobuf_test-unittest_import.pb.obj: google/protobuf/unittest_import.pb.cc -@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(protobuf_test_CPPFLAGS) $(CPPFLAGS) $(protobuf_test_CXXFLAGS) $(CXXFLAGS) -MT google/protobuf/protobuf_test-unittest_import.pb.obj -MD -MP -MF google/protobuf/$(DEPDIR)/protobuf_test-unittest_import.pb.Tpo -c -o google/protobuf/protobuf_test-unittest_import.pb.obj `if test -f 'google/protobuf/unittest_import.pb.cc'; then $(CYGPATH_W) 'google/protobuf/unittest_import.pb.cc'; else $(CYGPATH_W) '$(srcdir)/google/protobuf/unittest_import.pb.cc'; fi` -@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) google/protobuf/$(DEPDIR)/protobuf_test-unittest_import.pb.Tpo google/protobuf/$(DEPDIR)/protobuf_test-unittest_import.pb.Po -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='google/protobuf/unittest_import.pb.cc' object='google/protobuf/protobuf_test-unittest_import.pb.obj' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(protobuf_test_CPPFLAGS) $(CPPFLAGS) $(protobuf_test_CXXFLAGS) $(CXXFLAGS) -c -o google/protobuf/protobuf_test-unittest_import.pb.obj `if test -f 'google/protobuf/unittest_import.pb.cc'; then $(CYGPATH_W) 'google/protobuf/unittest_import.pb.cc'; else $(CYGPATH_W) '$(srcdir)/google/protobuf/unittest_import.pb.cc'; fi` - -google/protobuf/protobuf_test-unittest_import_public.pb.o: google/protobuf/unittest_import_public.pb.cc -@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(protobuf_test_CPPFLAGS) $(CPPFLAGS) $(protobuf_test_CXXFLAGS) $(CXXFLAGS) -MT google/protobuf/protobuf_test-unittest_import_public.pb.o -MD -MP -MF google/protobuf/$(DEPDIR)/protobuf_test-unittest_import_public.pb.Tpo -c -o google/protobuf/protobuf_test-unittest_import_public.pb.o `test -f 'google/protobuf/unittest_import_public.pb.cc' || echo '$(srcdir)/'`google/protobuf/unittest_import_public.pb.cc -@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) google/protobuf/$(DEPDIR)/protobuf_test-unittest_import_public.pb.Tpo google/protobuf/$(DEPDIR)/protobuf_test-unittest_import_public.pb.Po -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='google/protobuf/unittest_import_public.pb.cc' object='google/protobuf/protobuf_test-unittest_import_public.pb.o' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(protobuf_test_CPPFLAGS) $(CPPFLAGS) $(protobuf_test_CXXFLAGS) $(CXXFLAGS) -c -o google/protobuf/protobuf_test-unittest_import_public.pb.o `test -f 'google/protobuf/unittest_import_public.pb.cc' || echo '$(srcdir)/'`google/protobuf/unittest_import_public.pb.cc - -google/protobuf/protobuf_test-unittest_import_public.pb.obj: google/protobuf/unittest_import_public.pb.cc -@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(protobuf_test_CPPFLAGS) $(CPPFLAGS) $(protobuf_test_CXXFLAGS) $(CXXFLAGS) -MT google/protobuf/protobuf_test-unittest_import_public.pb.obj -MD -MP -MF google/protobuf/$(DEPDIR)/protobuf_test-unittest_import_public.pb.Tpo -c -o google/protobuf/protobuf_test-unittest_import_public.pb.obj `if test -f 'google/protobuf/unittest_import_public.pb.cc'; then $(CYGPATH_W) 'google/protobuf/unittest_import_public.pb.cc'; else $(CYGPATH_W) '$(srcdir)/google/protobuf/unittest_import_public.pb.cc'; fi` -@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) google/protobuf/$(DEPDIR)/protobuf_test-unittest_import_public.pb.Tpo google/protobuf/$(DEPDIR)/protobuf_test-unittest_import_public.pb.Po -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='google/protobuf/unittest_import_public.pb.cc' object='google/protobuf/protobuf_test-unittest_import_public.pb.obj' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(protobuf_test_CPPFLAGS) $(CPPFLAGS) $(protobuf_test_CXXFLAGS) $(CXXFLAGS) -c -o google/protobuf/protobuf_test-unittest_import_public.pb.obj `if test -f 'google/protobuf/unittest_import_public.pb.cc'; then $(CYGPATH_W) 'google/protobuf/unittest_import_public.pb.cc'; else $(CYGPATH_W) '$(srcdir)/google/protobuf/unittest_import_public.pb.cc'; fi` - -google/protobuf/protobuf_test-unittest_lazy_dependencies.pb.o: google/protobuf/unittest_lazy_dependencies.pb.cc -@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(protobuf_test_CPPFLAGS) $(CPPFLAGS) $(protobuf_test_CXXFLAGS) $(CXXFLAGS) -MT google/protobuf/protobuf_test-unittest_lazy_dependencies.pb.o -MD -MP -MF google/protobuf/$(DEPDIR)/protobuf_test-unittest_lazy_dependencies.pb.Tpo -c -o google/protobuf/protobuf_test-unittest_lazy_dependencies.pb.o `test -f 'google/protobuf/unittest_lazy_dependencies.pb.cc' || echo '$(srcdir)/'`google/protobuf/unittest_lazy_dependencies.pb.cc -@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) google/protobuf/$(DEPDIR)/protobuf_test-unittest_lazy_dependencies.pb.Tpo google/protobuf/$(DEPDIR)/protobuf_test-unittest_lazy_dependencies.pb.Po -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='google/protobuf/unittest_lazy_dependencies.pb.cc' object='google/protobuf/protobuf_test-unittest_lazy_dependencies.pb.o' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(protobuf_test_CPPFLAGS) $(CPPFLAGS) $(protobuf_test_CXXFLAGS) $(CXXFLAGS) -c -o google/protobuf/protobuf_test-unittest_lazy_dependencies.pb.o `test -f 'google/protobuf/unittest_lazy_dependencies.pb.cc' || echo '$(srcdir)/'`google/protobuf/unittest_lazy_dependencies.pb.cc - -google/protobuf/protobuf_test-unittest_lazy_dependencies.pb.obj: google/protobuf/unittest_lazy_dependencies.pb.cc -@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(protobuf_test_CPPFLAGS) $(CPPFLAGS) $(protobuf_test_CXXFLAGS) $(CXXFLAGS) -MT google/protobuf/protobuf_test-unittest_lazy_dependencies.pb.obj -MD -MP -MF google/protobuf/$(DEPDIR)/protobuf_test-unittest_lazy_dependencies.pb.Tpo -c -o google/protobuf/protobuf_test-unittest_lazy_dependencies.pb.obj `if test -f 'google/protobuf/unittest_lazy_dependencies.pb.cc'; then $(CYGPATH_W) 'google/protobuf/unittest_lazy_dependencies.pb.cc'; else $(CYGPATH_W) '$(srcdir)/google/protobuf/unittest_lazy_dependencies.pb.cc'; fi` -@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) google/protobuf/$(DEPDIR)/protobuf_test-unittest_lazy_dependencies.pb.Tpo google/protobuf/$(DEPDIR)/protobuf_test-unittest_lazy_dependencies.pb.Po -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='google/protobuf/unittest_lazy_dependencies.pb.cc' object='google/protobuf/protobuf_test-unittest_lazy_dependencies.pb.obj' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(protobuf_test_CPPFLAGS) $(CPPFLAGS) $(protobuf_test_CXXFLAGS) $(CXXFLAGS) -c -o google/protobuf/protobuf_test-unittest_lazy_dependencies.pb.obj `if test -f 'google/protobuf/unittest_lazy_dependencies.pb.cc'; then $(CYGPATH_W) 'google/protobuf/unittest_lazy_dependencies.pb.cc'; else $(CYGPATH_W) '$(srcdir)/google/protobuf/unittest_lazy_dependencies.pb.cc'; fi` - -google/protobuf/protobuf_test-unittest_lazy_dependencies_custom_option.pb.o: google/protobuf/unittest_lazy_dependencies_custom_option.pb.cc -@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(protobuf_test_CPPFLAGS) $(CPPFLAGS) $(protobuf_test_CXXFLAGS) $(CXXFLAGS) -MT google/protobuf/protobuf_test-unittest_lazy_dependencies_custom_option.pb.o -MD -MP -MF google/protobuf/$(DEPDIR)/protobuf_test-unittest_lazy_dependencies_custom_option.pb.Tpo -c -o google/protobuf/protobuf_test-unittest_lazy_dependencies_custom_option.pb.o `test -f 'google/protobuf/unittest_lazy_dependencies_custom_option.pb.cc' || echo '$(srcdir)/'`google/protobuf/unittest_lazy_dependencies_custom_option.pb.cc -@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) google/protobuf/$(DEPDIR)/protobuf_test-unittest_lazy_dependencies_custom_option.pb.Tpo google/protobuf/$(DEPDIR)/protobuf_test-unittest_lazy_dependencies_custom_option.pb.Po -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='google/protobuf/unittest_lazy_dependencies_custom_option.pb.cc' object='google/protobuf/protobuf_test-unittest_lazy_dependencies_custom_option.pb.o' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(protobuf_test_CPPFLAGS) $(CPPFLAGS) $(protobuf_test_CXXFLAGS) $(CXXFLAGS) -c -o google/protobuf/protobuf_test-unittest_lazy_dependencies_custom_option.pb.o `test -f 'google/protobuf/unittest_lazy_dependencies_custom_option.pb.cc' || echo '$(srcdir)/'`google/protobuf/unittest_lazy_dependencies_custom_option.pb.cc - -google/protobuf/protobuf_test-unittest_lazy_dependencies_custom_option.pb.obj: google/protobuf/unittest_lazy_dependencies_custom_option.pb.cc -@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(protobuf_test_CPPFLAGS) $(CPPFLAGS) $(protobuf_test_CXXFLAGS) $(CXXFLAGS) -MT google/protobuf/protobuf_test-unittest_lazy_dependencies_custom_option.pb.obj -MD -MP -MF google/protobuf/$(DEPDIR)/protobuf_test-unittest_lazy_dependencies_custom_option.pb.Tpo -c -o google/protobuf/protobuf_test-unittest_lazy_dependencies_custom_option.pb.obj `if test -f 'google/protobuf/unittest_lazy_dependencies_custom_option.pb.cc'; then $(CYGPATH_W) 'google/protobuf/unittest_lazy_dependencies_custom_option.pb.cc'; else $(CYGPATH_W) '$(srcdir)/google/protobuf/unittest_lazy_dependencies_custom_option.pb.cc'; fi` -@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) google/protobuf/$(DEPDIR)/protobuf_test-unittest_lazy_dependencies_custom_option.pb.Tpo google/protobuf/$(DEPDIR)/protobuf_test-unittest_lazy_dependencies_custom_option.pb.Po -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='google/protobuf/unittest_lazy_dependencies_custom_option.pb.cc' object='google/protobuf/protobuf_test-unittest_lazy_dependencies_custom_option.pb.obj' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(protobuf_test_CPPFLAGS) $(CPPFLAGS) $(protobuf_test_CXXFLAGS) $(CXXFLAGS) -c -o google/protobuf/protobuf_test-unittest_lazy_dependencies_custom_option.pb.obj `if test -f 'google/protobuf/unittest_lazy_dependencies_custom_option.pb.cc'; then $(CYGPATH_W) 'google/protobuf/unittest_lazy_dependencies_custom_option.pb.cc'; else $(CYGPATH_W) '$(srcdir)/google/protobuf/unittest_lazy_dependencies_custom_option.pb.cc'; fi` - -google/protobuf/protobuf_test-unittest_lazy_dependencies_enum.pb.o: google/protobuf/unittest_lazy_dependencies_enum.pb.cc -@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(protobuf_test_CPPFLAGS) $(CPPFLAGS) $(protobuf_test_CXXFLAGS) $(CXXFLAGS) -MT google/protobuf/protobuf_test-unittest_lazy_dependencies_enum.pb.o -MD -MP -MF google/protobuf/$(DEPDIR)/protobuf_test-unittest_lazy_dependencies_enum.pb.Tpo -c -o google/protobuf/protobuf_test-unittest_lazy_dependencies_enum.pb.o `test -f 'google/protobuf/unittest_lazy_dependencies_enum.pb.cc' || echo '$(srcdir)/'`google/protobuf/unittest_lazy_dependencies_enum.pb.cc -@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) google/protobuf/$(DEPDIR)/protobuf_test-unittest_lazy_dependencies_enum.pb.Tpo google/protobuf/$(DEPDIR)/protobuf_test-unittest_lazy_dependencies_enum.pb.Po -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='google/protobuf/unittest_lazy_dependencies_enum.pb.cc' object='google/protobuf/protobuf_test-unittest_lazy_dependencies_enum.pb.o' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(protobuf_test_CPPFLAGS) $(CPPFLAGS) $(protobuf_test_CXXFLAGS) $(CXXFLAGS) -c -o google/protobuf/protobuf_test-unittest_lazy_dependencies_enum.pb.o `test -f 'google/protobuf/unittest_lazy_dependencies_enum.pb.cc' || echo '$(srcdir)/'`google/protobuf/unittest_lazy_dependencies_enum.pb.cc - -google/protobuf/protobuf_test-unittest_lazy_dependencies_enum.pb.obj: google/protobuf/unittest_lazy_dependencies_enum.pb.cc -@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(protobuf_test_CPPFLAGS) $(CPPFLAGS) $(protobuf_test_CXXFLAGS) $(CXXFLAGS) -MT google/protobuf/protobuf_test-unittest_lazy_dependencies_enum.pb.obj -MD -MP -MF google/protobuf/$(DEPDIR)/protobuf_test-unittest_lazy_dependencies_enum.pb.Tpo -c -o google/protobuf/protobuf_test-unittest_lazy_dependencies_enum.pb.obj `if test -f 'google/protobuf/unittest_lazy_dependencies_enum.pb.cc'; then $(CYGPATH_W) 'google/protobuf/unittest_lazy_dependencies_enum.pb.cc'; else $(CYGPATH_W) '$(srcdir)/google/protobuf/unittest_lazy_dependencies_enum.pb.cc'; fi` -@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) google/protobuf/$(DEPDIR)/protobuf_test-unittest_lazy_dependencies_enum.pb.Tpo google/protobuf/$(DEPDIR)/protobuf_test-unittest_lazy_dependencies_enum.pb.Po -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='google/protobuf/unittest_lazy_dependencies_enum.pb.cc' object='google/protobuf/protobuf_test-unittest_lazy_dependencies_enum.pb.obj' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(protobuf_test_CPPFLAGS) $(CPPFLAGS) $(protobuf_test_CXXFLAGS) $(CXXFLAGS) -c -o google/protobuf/protobuf_test-unittest_lazy_dependencies_enum.pb.obj `if test -f 'google/protobuf/unittest_lazy_dependencies_enum.pb.cc'; then $(CYGPATH_W) 'google/protobuf/unittest_lazy_dependencies_enum.pb.cc'; else $(CYGPATH_W) '$(srcdir)/google/protobuf/unittest_lazy_dependencies_enum.pb.cc'; fi` - -google/protobuf/protobuf_test-unittest_lite_imports_nonlite.pb.o: google/protobuf/unittest_lite_imports_nonlite.pb.cc -@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(protobuf_test_CPPFLAGS) $(CPPFLAGS) $(protobuf_test_CXXFLAGS) $(CXXFLAGS) -MT google/protobuf/protobuf_test-unittest_lite_imports_nonlite.pb.o -MD -MP -MF google/protobuf/$(DEPDIR)/protobuf_test-unittest_lite_imports_nonlite.pb.Tpo -c -o google/protobuf/protobuf_test-unittest_lite_imports_nonlite.pb.o `test -f 'google/protobuf/unittest_lite_imports_nonlite.pb.cc' || echo '$(srcdir)/'`google/protobuf/unittest_lite_imports_nonlite.pb.cc -@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) google/protobuf/$(DEPDIR)/protobuf_test-unittest_lite_imports_nonlite.pb.Tpo google/protobuf/$(DEPDIR)/protobuf_test-unittest_lite_imports_nonlite.pb.Po -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='google/protobuf/unittest_lite_imports_nonlite.pb.cc' object='google/protobuf/protobuf_test-unittest_lite_imports_nonlite.pb.o' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(protobuf_test_CPPFLAGS) $(CPPFLAGS) $(protobuf_test_CXXFLAGS) $(CXXFLAGS) -c -o google/protobuf/protobuf_test-unittest_lite_imports_nonlite.pb.o `test -f 'google/protobuf/unittest_lite_imports_nonlite.pb.cc' || echo '$(srcdir)/'`google/protobuf/unittest_lite_imports_nonlite.pb.cc - -google/protobuf/protobuf_test-unittest_lite_imports_nonlite.pb.obj: google/protobuf/unittest_lite_imports_nonlite.pb.cc -@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(protobuf_test_CPPFLAGS) $(CPPFLAGS) $(protobuf_test_CXXFLAGS) $(CXXFLAGS) -MT google/protobuf/protobuf_test-unittest_lite_imports_nonlite.pb.obj -MD -MP -MF google/protobuf/$(DEPDIR)/protobuf_test-unittest_lite_imports_nonlite.pb.Tpo -c -o google/protobuf/protobuf_test-unittest_lite_imports_nonlite.pb.obj `if test -f 'google/protobuf/unittest_lite_imports_nonlite.pb.cc'; then $(CYGPATH_W) 'google/protobuf/unittest_lite_imports_nonlite.pb.cc'; else $(CYGPATH_W) '$(srcdir)/google/protobuf/unittest_lite_imports_nonlite.pb.cc'; fi` -@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) google/protobuf/$(DEPDIR)/protobuf_test-unittest_lite_imports_nonlite.pb.Tpo google/protobuf/$(DEPDIR)/protobuf_test-unittest_lite_imports_nonlite.pb.Po -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='google/protobuf/unittest_lite_imports_nonlite.pb.cc' object='google/protobuf/protobuf_test-unittest_lite_imports_nonlite.pb.obj' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(protobuf_test_CPPFLAGS) $(CPPFLAGS) $(protobuf_test_CXXFLAGS) $(CXXFLAGS) -c -o google/protobuf/protobuf_test-unittest_lite_imports_nonlite.pb.obj `if test -f 'google/protobuf/unittest_lite_imports_nonlite.pb.cc'; then $(CYGPATH_W) 'google/protobuf/unittest_lite_imports_nonlite.pb.cc'; else $(CYGPATH_W) '$(srcdir)/google/protobuf/unittest_lite_imports_nonlite.pb.cc'; fi` - -google/protobuf/protobuf_test-unittest_mset.pb.o: google/protobuf/unittest_mset.pb.cc -@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(protobuf_test_CPPFLAGS) $(CPPFLAGS) $(protobuf_test_CXXFLAGS) $(CXXFLAGS) -MT google/protobuf/protobuf_test-unittest_mset.pb.o -MD -MP -MF google/protobuf/$(DEPDIR)/protobuf_test-unittest_mset.pb.Tpo -c -o google/protobuf/protobuf_test-unittest_mset.pb.o `test -f 'google/protobuf/unittest_mset.pb.cc' || echo '$(srcdir)/'`google/protobuf/unittest_mset.pb.cc -@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) google/protobuf/$(DEPDIR)/protobuf_test-unittest_mset.pb.Tpo google/protobuf/$(DEPDIR)/protobuf_test-unittest_mset.pb.Po -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='google/protobuf/unittest_mset.pb.cc' object='google/protobuf/protobuf_test-unittest_mset.pb.o' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(protobuf_test_CPPFLAGS) $(CPPFLAGS) $(protobuf_test_CXXFLAGS) $(CXXFLAGS) -c -o google/protobuf/protobuf_test-unittest_mset.pb.o `test -f 'google/protobuf/unittest_mset.pb.cc' || echo '$(srcdir)/'`google/protobuf/unittest_mset.pb.cc - -google/protobuf/protobuf_test-unittest_mset.pb.obj: google/protobuf/unittest_mset.pb.cc -@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(protobuf_test_CPPFLAGS) $(CPPFLAGS) $(protobuf_test_CXXFLAGS) $(CXXFLAGS) -MT google/protobuf/protobuf_test-unittest_mset.pb.obj -MD -MP -MF google/protobuf/$(DEPDIR)/protobuf_test-unittest_mset.pb.Tpo -c -o google/protobuf/protobuf_test-unittest_mset.pb.obj `if test -f 'google/protobuf/unittest_mset.pb.cc'; then $(CYGPATH_W) 'google/protobuf/unittest_mset.pb.cc'; else $(CYGPATH_W) '$(srcdir)/google/protobuf/unittest_mset.pb.cc'; fi` -@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) google/protobuf/$(DEPDIR)/protobuf_test-unittest_mset.pb.Tpo google/protobuf/$(DEPDIR)/protobuf_test-unittest_mset.pb.Po -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='google/protobuf/unittest_mset.pb.cc' object='google/protobuf/protobuf_test-unittest_mset.pb.obj' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(protobuf_test_CPPFLAGS) $(CPPFLAGS) $(protobuf_test_CXXFLAGS) $(CXXFLAGS) -c -o google/protobuf/protobuf_test-unittest_mset.pb.obj `if test -f 'google/protobuf/unittest_mset.pb.cc'; then $(CYGPATH_W) 'google/protobuf/unittest_mset.pb.cc'; else $(CYGPATH_W) '$(srcdir)/google/protobuf/unittest_mset.pb.cc'; fi` - -google/protobuf/protobuf_test-unittest_mset_wire_format.pb.o: google/protobuf/unittest_mset_wire_format.pb.cc -@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(protobuf_test_CPPFLAGS) $(CPPFLAGS) $(protobuf_test_CXXFLAGS) $(CXXFLAGS) -MT google/protobuf/protobuf_test-unittest_mset_wire_format.pb.o -MD -MP -MF google/protobuf/$(DEPDIR)/protobuf_test-unittest_mset_wire_format.pb.Tpo -c -o google/protobuf/protobuf_test-unittest_mset_wire_format.pb.o `test -f 'google/protobuf/unittest_mset_wire_format.pb.cc' || echo '$(srcdir)/'`google/protobuf/unittest_mset_wire_format.pb.cc -@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) google/protobuf/$(DEPDIR)/protobuf_test-unittest_mset_wire_format.pb.Tpo google/protobuf/$(DEPDIR)/protobuf_test-unittest_mset_wire_format.pb.Po -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='google/protobuf/unittest_mset_wire_format.pb.cc' object='google/protobuf/protobuf_test-unittest_mset_wire_format.pb.o' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(protobuf_test_CPPFLAGS) $(CPPFLAGS) $(protobuf_test_CXXFLAGS) $(CXXFLAGS) -c -o google/protobuf/protobuf_test-unittest_mset_wire_format.pb.o `test -f 'google/protobuf/unittest_mset_wire_format.pb.cc' || echo '$(srcdir)/'`google/protobuf/unittest_mset_wire_format.pb.cc - -google/protobuf/protobuf_test-unittest_mset_wire_format.pb.obj: google/protobuf/unittest_mset_wire_format.pb.cc -@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(protobuf_test_CPPFLAGS) $(CPPFLAGS) $(protobuf_test_CXXFLAGS) $(CXXFLAGS) -MT google/protobuf/protobuf_test-unittest_mset_wire_format.pb.obj -MD -MP -MF google/protobuf/$(DEPDIR)/protobuf_test-unittest_mset_wire_format.pb.Tpo -c -o google/protobuf/protobuf_test-unittest_mset_wire_format.pb.obj `if test -f 'google/protobuf/unittest_mset_wire_format.pb.cc'; then $(CYGPATH_W) 'google/protobuf/unittest_mset_wire_format.pb.cc'; else $(CYGPATH_W) '$(srcdir)/google/protobuf/unittest_mset_wire_format.pb.cc'; fi` -@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) google/protobuf/$(DEPDIR)/protobuf_test-unittest_mset_wire_format.pb.Tpo google/protobuf/$(DEPDIR)/protobuf_test-unittest_mset_wire_format.pb.Po -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='google/protobuf/unittest_mset_wire_format.pb.cc' object='google/protobuf/protobuf_test-unittest_mset_wire_format.pb.obj' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(protobuf_test_CPPFLAGS) $(CPPFLAGS) $(protobuf_test_CXXFLAGS) $(CXXFLAGS) -c -o google/protobuf/protobuf_test-unittest_mset_wire_format.pb.obj `if test -f 'google/protobuf/unittest_mset_wire_format.pb.cc'; then $(CYGPATH_W) 'google/protobuf/unittest_mset_wire_format.pb.cc'; else $(CYGPATH_W) '$(srcdir)/google/protobuf/unittest_mset_wire_format.pb.cc'; fi` - -google/protobuf/protobuf_test-unittest_no_field_presence.pb.o: google/protobuf/unittest_no_field_presence.pb.cc -@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(protobuf_test_CPPFLAGS) $(CPPFLAGS) $(protobuf_test_CXXFLAGS) $(CXXFLAGS) -MT google/protobuf/protobuf_test-unittest_no_field_presence.pb.o -MD -MP -MF google/protobuf/$(DEPDIR)/protobuf_test-unittest_no_field_presence.pb.Tpo -c -o google/protobuf/protobuf_test-unittest_no_field_presence.pb.o `test -f 'google/protobuf/unittest_no_field_presence.pb.cc' || echo '$(srcdir)/'`google/protobuf/unittest_no_field_presence.pb.cc -@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) google/protobuf/$(DEPDIR)/protobuf_test-unittest_no_field_presence.pb.Tpo google/protobuf/$(DEPDIR)/protobuf_test-unittest_no_field_presence.pb.Po -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='google/protobuf/unittest_no_field_presence.pb.cc' object='google/protobuf/protobuf_test-unittest_no_field_presence.pb.o' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(protobuf_test_CPPFLAGS) $(CPPFLAGS) $(protobuf_test_CXXFLAGS) $(CXXFLAGS) -c -o google/protobuf/protobuf_test-unittest_no_field_presence.pb.o `test -f 'google/protobuf/unittest_no_field_presence.pb.cc' || echo '$(srcdir)/'`google/protobuf/unittest_no_field_presence.pb.cc - -google/protobuf/protobuf_test-unittest_no_field_presence.pb.obj: google/protobuf/unittest_no_field_presence.pb.cc -@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(protobuf_test_CPPFLAGS) $(CPPFLAGS) $(protobuf_test_CXXFLAGS) $(CXXFLAGS) -MT google/protobuf/protobuf_test-unittest_no_field_presence.pb.obj -MD -MP -MF google/protobuf/$(DEPDIR)/protobuf_test-unittest_no_field_presence.pb.Tpo -c -o google/protobuf/protobuf_test-unittest_no_field_presence.pb.obj `if test -f 'google/protobuf/unittest_no_field_presence.pb.cc'; then $(CYGPATH_W) 'google/protobuf/unittest_no_field_presence.pb.cc'; else $(CYGPATH_W) '$(srcdir)/google/protobuf/unittest_no_field_presence.pb.cc'; fi` -@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) google/protobuf/$(DEPDIR)/protobuf_test-unittest_no_field_presence.pb.Tpo google/protobuf/$(DEPDIR)/protobuf_test-unittest_no_field_presence.pb.Po -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='google/protobuf/unittest_no_field_presence.pb.cc' object='google/protobuf/protobuf_test-unittest_no_field_presence.pb.obj' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(protobuf_test_CPPFLAGS) $(CPPFLAGS) $(protobuf_test_CXXFLAGS) $(CXXFLAGS) -c -o google/protobuf/protobuf_test-unittest_no_field_presence.pb.obj `if test -f 'google/protobuf/unittest_no_field_presence.pb.cc'; then $(CYGPATH_W) 'google/protobuf/unittest_no_field_presence.pb.cc'; else $(CYGPATH_W) '$(srcdir)/google/protobuf/unittest_no_field_presence.pb.cc'; fi` - -google/protobuf/protobuf_test-unittest_no_generic_services.pb.o: google/protobuf/unittest_no_generic_services.pb.cc -@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(protobuf_test_CPPFLAGS) $(CPPFLAGS) $(protobuf_test_CXXFLAGS) $(CXXFLAGS) -MT google/protobuf/protobuf_test-unittest_no_generic_services.pb.o -MD -MP -MF google/protobuf/$(DEPDIR)/protobuf_test-unittest_no_generic_services.pb.Tpo -c -o google/protobuf/protobuf_test-unittest_no_generic_services.pb.o `test -f 'google/protobuf/unittest_no_generic_services.pb.cc' || echo '$(srcdir)/'`google/protobuf/unittest_no_generic_services.pb.cc -@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) google/protobuf/$(DEPDIR)/protobuf_test-unittest_no_generic_services.pb.Tpo google/protobuf/$(DEPDIR)/protobuf_test-unittest_no_generic_services.pb.Po -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='google/protobuf/unittest_no_generic_services.pb.cc' object='google/protobuf/protobuf_test-unittest_no_generic_services.pb.o' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(protobuf_test_CPPFLAGS) $(CPPFLAGS) $(protobuf_test_CXXFLAGS) $(CXXFLAGS) -c -o google/protobuf/protobuf_test-unittest_no_generic_services.pb.o `test -f 'google/protobuf/unittest_no_generic_services.pb.cc' || echo '$(srcdir)/'`google/protobuf/unittest_no_generic_services.pb.cc - -google/protobuf/protobuf_test-unittest_no_generic_services.pb.obj: google/protobuf/unittest_no_generic_services.pb.cc -@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(protobuf_test_CPPFLAGS) $(CPPFLAGS) $(protobuf_test_CXXFLAGS) $(CXXFLAGS) -MT google/protobuf/protobuf_test-unittest_no_generic_services.pb.obj -MD -MP -MF google/protobuf/$(DEPDIR)/protobuf_test-unittest_no_generic_services.pb.Tpo -c -o google/protobuf/protobuf_test-unittest_no_generic_services.pb.obj `if test -f 'google/protobuf/unittest_no_generic_services.pb.cc'; then $(CYGPATH_W) 'google/protobuf/unittest_no_generic_services.pb.cc'; else $(CYGPATH_W) '$(srcdir)/google/protobuf/unittest_no_generic_services.pb.cc'; fi` -@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) google/protobuf/$(DEPDIR)/protobuf_test-unittest_no_generic_services.pb.Tpo google/protobuf/$(DEPDIR)/protobuf_test-unittest_no_generic_services.pb.Po -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='google/protobuf/unittest_no_generic_services.pb.cc' object='google/protobuf/protobuf_test-unittest_no_generic_services.pb.obj' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(protobuf_test_CPPFLAGS) $(CPPFLAGS) $(protobuf_test_CXXFLAGS) $(CXXFLAGS) -c -o google/protobuf/protobuf_test-unittest_no_generic_services.pb.obj `if test -f 'google/protobuf/unittest_no_generic_services.pb.cc'; then $(CYGPATH_W) 'google/protobuf/unittest_no_generic_services.pb.cc'; else $(CYGPATH_W) '$(srcdir)/google/protobuf/unittest_no_generic_services.pb.cc'; fi` - -google/protobuf/protobuf_test-unittest_optimize_for.pb.o: google/protobuf/unittest_optimize_for.pb.cc -@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(protobuf_test_CPPFLAGS) $(CPPFLAGS) $(protobuf_test_CXXFLAGS) $(CXXFLAGS) -MT google/protobuf/protobuf_test-unittest_optimize_for.pb.o -MD -MP -MF google/protobuf/$(DEPDIR)/protobuf_test-unittest_optimize_for.pb.Tpo -c -o google/protobuf/protobuf_test-unittest_optimize_for.pb.o `test -f 'google/protobuf/unittest_optimize_for.pb.cc' || echo '$(srcdir)/'`google/protobuf/unittest_optimize_for.pb.cc -@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) google/protobuf/$(DEPDIR)/protobuf_test-unittest_optimize_for.pb.Tpo google/protobuf/$(DEPDIR)/protobuf_test-unittest_optimize_for.pb.Po -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='google/protobuf/unittest_optimize_for.pb.cc' object='google/protobuf/protobuf_test-unittest_optimize_for.pb.o' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(protobuf_test_CPPFLAGS) $(CPPFLAGS) $(protobuf_test_CXXFLAGS) $(CXXFLAGS) -c -o google/protobuf/protobuf_test-unittest_optimize_for.pb.o `test -f 'google/protobuf/unittest_optimize_for.pb.cc' || echo '$(srcdir)/'`google/protobuf/unittest_optimize_for.pb.cc - -google/protobuf/protobuf_test-unittest_optimize_for.pb.obj: google/protobuf/unittest_optimize_for.pb.cc -@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(protobuf_test_CPPFLAGS) $(CPPFLAGS) $(protobuf_test_CXXFLAGS) $(CXXFLAGS) -MT google/protobuf/protobuf_test-unittest_optimize_for.pb.obj -MD -MP -MF google/protobuf/$(DEPDIR)/protobuf_test-unittest_optimize_for.pb.Tpo -c -o google/protobuf/protobuf_test-unittest_optimize_for.pb.obj `if test -f 'google/protobuf/unittest_optimize_for.pb.cc'; then $(CYGPATH_W) 'google/protobuf/unittest_optimize_for.pb.cc'; else $(CYGPATH_W) '$(srcdir)/google/protobuf/unittest_optimize_for.pb.cc'; fi` -@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) google/protobuf/$(DEPDIR)/protobuf_test-unittest_optimize_for.pb.Tpo google/protobuf/$(DEPDIR)/protobuf_test-unittest_optimize_for.pb.Po -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='google/protobuf/unittest_optimize_for.pb.cc' object='google/protobuf/protobuf_test-unittest_optimize_for.pb.obj' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(protobuf_test_CPPFLAGS) $(CPPFLAGS) $(protobuf_test_CXXFLAGS) $(CXXFLAGS) -c -o google/protobuf/protobuf_test-unittest_optimize_for.pb.obj `if test -f 'google/protobuf/unittest_optimize_for.pb.cc'; then $(CYGPATH_W) 'google/protobuf/unittest_optimize_for.pb.cc'; else $(CYGPATH_W) '$(srcdir)/google/protobuf/unittest_optimize_for.pb.cc'; fi` - -google/protobuf/protobuf_test-unittest_preserve_unknown_enum.pb.o: google/protobuf/unittest_preserve_unknown_enum.pb.cc -@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(protobuf_test_CPPFLAGS) $(CPPFLAGS) $(protobuf_test_CXXFLAGS) $(CXXFLAGS) -MT google/protobuf/protobuf_test-unittest_preserve_unknown_enum.pb.o -MD -MP -MF google/protobuf/$(DEPDIR)/protobuf_test-unittest_preserve_unknown_enum.pb.Tpo -c -o google/protobuf/protobuf_test-unittest_preserve_unknown_enum.pb.o `test -f 'google/protobuf/unittest_preserve_unknown_enum.pb.cc' || echo '$(srcdir)/'`google/protobuf/unittest_preserve_unknown_enum.pb.cc -@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) google/protobuf/$(DEPDIR)/protobuf_test-unittest_preserve_unknown_enum.pb.Tpo google/protobuf/$(DEPDIR)/protobuf_test-unittest_preserve_unknown_enum.pb.Po -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='google/protobuf/unittest_preserve_unknown_enum.pb.cc' object='google/protobuf/protobuf_test-unittest_preserve_unknown_enum.pb.o' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(protobuf_test_CPPFLAGS) $(CPPFLAGS) $(protobuf_test_CXXFLAGS) $(CXXFLAGS) -c -o google/protobuf/protobuf_test-unittest_preserve_unknown_enum.pb.o `test -f 'google/protobuf/unittest_preserve_unknown_enum.pb.cc' || echo '$(srcdir)/'`google/protobuf/unittest_preserve_unknown_enum.pb.cc - -google/protobuf/protobuf_test-unittest_preserve_unknown_enum.pb.obj: google/protobuf/unittest_preserve_unknown_enum.pb.cc -@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(protobuf_test_CPPFLAGS) $(CPPFLAGS) $(protobuf_test_CXXFLAGS) $(CXXFLAGS) -MT google/protobuf/protobuf_test-unittest_preserve_unknown_enum.pb.obj -MD -MP -MF google/protobuf/$(DEPDIR)/protobuf_test-unittest_preserve_unknown_enum.pb.Tpo -c -o google/protobuf/protobuf_test-unittest_preserve_unknown_enum.pb.obj `if test -f 'google/protobuf/unittest_preserve_unknown_enum.pb.cc'; then $(CYGPATH_W) 'google/protobuf/unittest_preserve_unknown_enum.pb.cc'; else $(CYGPATH_W) '$(srcdir)/google/protobuf/unittest_preserve_unknown_enum.pb.cc'; fi` -@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) google/protobuf/$(DEPDIR)/protobuf_test-unittest_preserve_unknown_enum.pb.Tpo google/protobuf/$(DEPDIR)/protobuf_test-unittest_preserve_unknown_enum.pb.Po -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='google/protobuf/unittest_preserve_unknown_enum.pb.cc' object='google/protobuf/protobuf_test-unittest_preserve_unknown_enum.pb.obj' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(protobuf_test_CPPFLAGS) $(CPPFLAGS) $(protobuf_test_CXXFLAGS) $(CXXFLAGS) -c -o google/protobuf/protobuf_test-unittest_preserve_unknown_enum.pb.obj `if test -f 'google/protobuf/unittest_preserve_unknown_enum.pb.cc'; then $(CYGPATH_W) 'google/protobuf/unittest_preserve_unknown_enum.pb.cc'; else $(CYGPATH_W) '$(srcdir)/google/protobuf/unittest_preserve_unknown_enum.pb.cc'; fi` - -google/protobuf/protobuf_test-unittest_preserve_unknown_enum2.pb.o: google/protobuf/unittest_preserve_unknown_enum2.pb.cc -@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(protobuf_test_CPPFLAGS) $(CPPFLAGS) $(protobuf_test_CXXFLAGS) $(CXXFLAGS) -MT google/protobuf/protobuf_test-unittest_preserve_unknown_enum2.pb.o -MD -MP -MF google/protobuf/$(DEPDIR)/protobuf_test-unittest_preserve_unknown_enum2.pb.Tpo -c -o google/protobuf/protobuf_test-unittest_preserve_unknown_enum2.pb.o `test -f 'google/protobuf/unittest_preserve_unknown_enum2.pb.cc' || echo '$(srcdir)/'`google/protobuf/unittest_preserve_unknown_enum2.pb.cc -@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) google/protobuf/$(DEPDIR)/protobuf_test-unittest_preserve_unknown_enum2.pb.Tpo google/protobuf/$(DEPDIR)/protobuf_test-unittest_preserve_unknown_enum2.pb.Po -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='google/protobuf/unittest_preserve_unknown_enum2.pb.cc' object='google/protobuf/protobuf_test-unittest_preserve_unknown_enum2.pb.o' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(protobuf_test_CPPFLAGS) $(CPPFLAGS) $(protobuf_test_CXXFLAGS) $(CXXFLAGS) -c -o google/protobuf/protobuf_test-unittest_preserve_unknown_enum2.pb.o `test -f 'google/protobuf/unittest_preserve_unknown_enum2.pb.cc' || echo '$(srcdir)/'`google/protobuf/unittest_preserve_unknown_enum2.pb.cc - -google/protobuf/protobuf_test-unittest_preserve_unknown_enum2.pb.obj: google/protobuf/unittest_preserve_unknown_enum2.pb.cc -@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(protobuf_test_CPPFLAGS) $(CPPFLAGS) $(protobuf_test_CXXFLAGS) $(CXXFLAGS) -MT google/protobuf/protobuf_test-unittest_preserve_unknown_enum2.pb.obj -MD -MP -MF google/protobuf/$(DEPDIR)/protobuf_test-unittest_preserve_unknown_enum2.pb.Tpo -c -o google/protobuf/protobuf_test-unittest_preserve_unknown_enum2.pb.obj `if test -f 'google/protobuf/unittest_preserve_unknown_enum2.pb.cc'; then $(CYGPATH_W) 'google/protobuf/unittest_preserve_unknown_enum2.pb.cc'; else $(CYGPATH_W) '$(srcdir)/google/protobuf/unittest_preserve_unknown_enum2.pb.cc'; fi` -@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) google/protobuf/$(DEPDIR)/protobuf_test-unittest_preserve_unknown_enum2.pb.Tpo google/protobuf/$(DEPDIR)/protobuf_test-unittest_preserve_unknown_enum2.pb.Po -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='google/protobuf/unittest_preserve_unknown_enum2.pb.cc' object='google/protobuf/protobuf_test-unittest_preserve_unknown_enum2.pb.obj' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(protobuf_test_CPPFLAGS) $(CPPFLAGS) $(protobuf_test_CXXFLAGS) $(CXXFLAGS) -c -o google/protobuf/protobuf_test-unittest_preserve_unknown_enum2.pb.obj `if test -f 'google/protobuf/unittest_preserve_unknown_enum2.pb.cc'; then $(CYGPATH_W) 'google/protobuf/unittest_preserve_unknown_enum2.pb.cc'; else $(CYGPATH_W) '$(srcdir)/google/protobuf/unittest_preserve_unknown_enum2.pb.cc'; fi` - -google/protobuf/protobuf_test-unittest_proto3.pb.o: google/protobuf/unittest_proto3.pb.cc -@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(protobuf_test_CPPFLAGS) $(CPPFLAGS) $(protobuf_test_CXXFLAGS) $(CXXFLAGS) -MT google/protobuf/protobuf_test-unittest_proto3.pb.o -MD -MP -MF google/protobuf/$(DEPDIR)/protobuf_test-unittest_proto3.pb.Tpo -c -o google/protobuf/protobuf_test-unittest_proto3.pb.o `test -f 'google/protobuf/unittest_proto3.pb.cc' || echo '$(srcdir)/'`google/protobuf/unittest_proto3.pb.cc -@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) google/protobuf/$(DEPDIR)/protobuf_test-unittest_proto3.pb.Tpo google/protobuf/$(DEPDIR)/protobuf_test-unittest_proto3.pb.Po -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='google/protobuf/unittest_proto3.pb.cc' object='google/protobuf/protobuf_test-unittest_proto3.pb.o' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(protobuf_test_CPPFLAGS) $(CPPFLAGS) $(protobuf_test_CXXFLAGS) $(CXXFLAGS) -c -o google/protobuf/protobuf_test-unittest_proto3.pb.o `test -f 'google/protobuf/unittest_proto3.pb.cc' || echo '$(srcdir)/'`google/protobuf/unittest_proto3.pb.cc - -google/protobuf/protobuf_test-unittest_proto3.pb.obj: google/protobuf/unittest_proto3.pb.cc -@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(protobuf_test_CPPFLAGS) $(CPPFLAGS) $(protobuf_test_CXXFLAGS) $(CXXFLAGS) -MT google/protobuf/protobuf_test-unittest_proto3.pb.obj -MD -MP -MF google/protobuf/$(DEPDIR)/protobuf_test-unittest_proto3.pb.Tpo -c -o google/protobuf/protobuf_test-unittest_proto3.pb.obj `if test -f 'google/protobuf/unittest_proto3.pb.cc'; then $(CYGPATH_W) 'google/protobuf/unittest_proto3.pb.cc'; else $(CYGPATH_W) '$(srcdir)/google/protobuf/unittest_proto3.pb.cc'; fi` -@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) google/protobuf/$(DEPDIR)/protobuf_test-unittest_proto3.pb.Tpo google/protobuf/$(DEPDIR)/protobuf_test-unittest_proto3.pb.Po -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='google/protobuf/unittest_proto3.pb.cc' object='google/protobuf/protobuf_test-unittest_proto3.pb.obj' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(protobuf_test_CPPFLAGS) $(CPPFLAGS) $(protobuf_test_CXXFLAGS) $(CXXFLAGS) -c -o google/protobuf/protobuf_test-unittest_proto3.pb.obj `if test -f 'google/protobuf/unittest_proto3.pb.cc'; then $(CYGPATH_W) 'google/protobuf/unittest_proto3.pb.cc'; else $(CYGPATH_W) '$(srcdir)/google/protobuf/unittest_proto3.pb.cc'; fi` - -google/protobuf/protobuf_test-unittest_proto3_arena.pb.o: google/protobuf/unittest_proto3_arena.pb.cc -@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(protobuf_test_CPPFLAGS) $(CPPFLAGS) $(protobuf_test_CXXFLAGS) $(CXXFLAGS) -MT google/protobuf/protobuf_test-unittest_proto3_arena.pb.o -MD -MP -MF google/protobuf/$(DEPDIR)/protobuf_test-unittest_proto3_arena.pb.Tpo -c -o google/protobuf/protobuf_test-unittest_proto3_arena.pb.o `test -f 'google/protobuf/unittest_proto3_arena.pb.cc' || echo '$(srcdir)/'`google/protobuf/unittest_proto3_arena.pb.cc -@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) google/protobuf/$(DEPDIR)/protobuf_test-unittest_proto3_arena.pb.Tpo google/protobuf/$(DEPDIR)/protobuf_test-unittest_proto3_arena.pb.Po -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='google/protobuf/unittest_proto3_arena.pb.cc' object='google/protobuf/protobuf_test-unittest_proto3_arena.pb.o' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(protobuf_test_CPPFLAGS) $(CPPFLAGS) $(protobuf_test_CXXFLAGS) $(CXXFLAGS) -c -o google/protobuf/protobuf_test-unittest_proto3_arena.pb.o `test -f 'google/protobuf/unittest_proto3_arena.pb.cc' || echo '$(srcdir)/'`google/protobuf/unittest_proto3_arena.pb.cc - -google/protobuf/protobuf_test-unittest_proto3_arena.pb.obj: google/protobuf/unittest_proto3_arena.pb.cc -@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(protobuf_test_CPPFLAGS) $(CPPFLAGS) $(protobuf_test_CXXFLAGS) $(CXXFLAGS) -MT google/protobuf/protobuf_test-unittest_proto3_arena.pb.obj -MD -MP -MF google/protobuf/$(DEPDIR)/protobuf_test-unittest_proto3_arena.pb.Tpo -c -o google/protobuf/protobuf_test-unittest_proto3_arena.pb.obj `if test -f 'google/protobuf/unittest_proto3_arena.pb.cc'; then $(CYGPATH_W) 'google/protobuf/unittest_proto3_arena.pb.cc'; else $(CYGPATH_W) '$(srcdir)/google/protobuf/unittest_proto3_arena.pb.cc'; fi` -@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) google/protobuf/$(DEPDIR)/protobuf_test-unittest_proto3_arena.pb.Tpo google/protobuf/$(DEPDIR)/protobuf_test-unittest_proto3_arena.pb.Po -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='google/protobuf/unittest_proto3_arena.pb.cc' object='google/protobuf/protobuf_test-unittest_proto3_arena.pb.obj' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(protobuf_test_CPPFLAGS) $(CPPFLAGS) $(protobuf_test_CXXFLAGS) $(CXXFLAGS) -c -o google/protobuf/protobuf_test-unittest_proto3_arena.pb.obj `if test -f 'google/protobuf/unittest_proto3_arena.pb.cc'; then $(CYGPATH_W) 'google/protobuf/unittest_proto3_arena.pb.cc'; else $(CYGPATH_W) '$(srcdir)/google/protobuf/unittest_proto3_arena.pb.cc'; fi` - -google/protobuf/protobuf_test-unittest_proto3_arena_lite.pb.o: google/protobuf/unittest_proto3_arena_lite.pb.cc -@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(protobuf_test_CPPFLAGS) $(CPPFLAGS) $(protobuf_test_CXXFLAGS) $(CXXFLAGS) -MT google/protobuf/protobuf_test-unittest_proto3_arena_lite.pb.o -MD -MP -MF google/protobuf/$(DEPDIR)/protobuf_test-unittest_proto3_arena_lite.pb.Tpo -c -o google/protobuf/protobuf_test-unittest_proto3_arena_lite.pb.o `test -f 'google/protobuf/unittest_proto3_arena_lite.pb.cc' || echo '$(srcdir)/'`google/protobuf/unittest_proto3_arena_lite.pb.cc -@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) google/protobuf/$(DEPDIR)/protobuf_test-unittest_proto3_arena_lite.pb.Tpo google/protobuf/$(DEPDIR)/protobuf_test-unittest_proto3_arena_lite.pb.Po -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='google/protobuf/unittest_proto3_arena_lite.pb.cc' object='google/protobuf/protobuf_test-unittest_proto3_arena_lite.pb.o' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(protobuf_test_CPPFLAGS) $(CPPFLAGS) $(protobuf_test_CXXFLAGS) $(CXXFLAGS) -c -o google/protobuf/protobuf_test-unittest_proto3_arena_lite.pb.o `test -f 'google/protobuf/unittest_proto3_arena_lite.pb.cc' || echo '$(srcdir)/'`google/protobuf/unittest_proto3_arena_lite.pb.cc - -google/protobuf/protobuf_test-unittest_proto3_arena_lite.pb.obj: google/protobuf/unittest_proto3_arena_lite.pb.cc -@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(protobuf_test_CPPFLAGS) $(CPPFLAGS) $(protobuf_test_CXXFLAGS) $(CXXFLAGS) -MT google/protobuf/protobuf_test-unittest_proto3_arena_lite.pb.obj -MD -MP -MF google/protobuf/$(DEPDIR)/protobuf_test-unittest_proto3_arena_lite.pb.Tpo -c -o google/protobuf/protobuf_test-unittest_proto3_arena_lite.pb.obj `if test -f 'google/protobuf/unittest_proto3_arena_lite.pb.cc'; then $(CYGPATH_W) 'google/protobuf/unittest_proto3_arena_lite.pb.cc'; else $(CYGPATH_W) '$(srcdir)/google/protobuf/unittest_proto3_arena_lite.pb.cc'; fi` -@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) google/protobuf/$(DEPDIR)/protobuf_test-unittest_proto3_arena_lite.pb.Tpo google/protobuf/$(DEPDIR)/protobuf_test-unittest_proto3_arena_lite.pb.Po -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='google/protobuf/unittest_proto3_arena_lite.pb.cc' object='google/protobuf/protobuf_test-unittest_proto3_arena_lite.pb.obj' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(protobuf_test_CPPFLAGS) $(CPPFLAGS) $(protobuf_test_CXXFLAGS) $(CXXFLAGS) -c -o google/protobuf/protobuf_test-unittest_proto3_arena_lite.pb.obj `if test -f 'google/protobuf/unittest_proto3_arena_lite.pb.cc'; then $(CYGPATH_W) 'google/protobuf/unittest_proto3_arena_lite.pb.cc'; else $(CYGPATH_W) '$(srcdir)/google/protobuf/unittest_proto3_arena_lite.pb.cc'; fi` - -google/protobuf/protobuf_test-unittest_proto3_lite.pb.o: google/protobuf/unittest_proto3_lite.pb.cc -@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(protobuf_test_CPPFLAGS) $(CPPFLAGS) $(protobuf_test_CXXFLAGS) $(CXXFLAGS) -MT google/protobuf/protobuf_test-unittest_proto3_lite.pb.o -MD -MP -MF google/protobuf/$(DEPDIR)/protobuf_test-unittest_proto3_lite.pb.Tpo -c -o google/protobuf/protobuf_test-unittest_proto3_lite.pb.o `test -f 'google/protobuf/unittest_proto3_lite.pb.cc' || echo '$(srcdir)/'`google/protobuf/unittest_proto3_lite.pb.cc -@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) google/protobuf/$(DEPDIR)/protobuf_test-unittest_proto3_lite.pb.Tpo google/protobuf/$(DEPDIR)/protobuf_test-unittest_proto3_lite.pb.Po -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='google/protobuf/unittest_proto3_lite.pb.cc' object='google/protobuf/protobuf_test-unittest_proto3_lite.pb.o' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(protobuf_test_CPPFLAGS) $(CPPFLAGS) $(protobuf_test_CXXFLAGS) $(CXXFLAGS) -c -o google/protobuf/protobuf_test-unittest_proto3_lite.pb.o `test -f 'google/protobuf/unittest_proto3_lite.pb.cc' || echo '$(srcdir)/'`google/protobuf/unittest_proto3_lite.pb.cc - -google/protobuf/protobuf_test-unittest_proto3_lite.pb.obj: google/protobuf/unittest_proto3_lite.pb.cc -@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(protobuf_test_CPPFLAGS) $(CPPFLAGS) $(protobuf_test_CXXFLAGS) $(CXXFLAGS) -MT google/protobuf/protobuf_test-unittest_proto3_lite.pb.obj -MD -MP -MF google/protobuf/$(DEPDIR)/protobuf_test-unittest_proto3_lite.pb.Tpo -c -o google/protobuf/protobuf_test-unittest_proto3_lite.pb.obj `if test -f 'google/protobuf/unittest_proto3_lite.pb.cc'; then $(CYGPATH_W) 'google/protobuf/unittest_proto3_lite.pb.cc'; else $(CYGPATH_W) '$(srcdir)/google/protobuf/unittest_proto3_lite.pb.cc'; fi` -@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) google/protobuf/$(DEPDIR)/protobuf_test-unittest_proto3_lite.pb.Tpo google/protobuf/$(DEPDIR)/protobuf_test-unittest_proto3_lite.pb.Po -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='google/protobuf/unittest_proto3_lite.pb.cc' object='google/protobuf/protobuf_test-unittest_proto3_lite.pb.obj' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(protobuf_test_CPPFLAGS) $(CPPFLAGS) $(protobuf_test_CXXFLAGS) $(CXXFLAGS) -c -o google/protobuf/protobuf_test-unittest_proto3_lite.pb.obj `if test -f 'google/protobuf/unittest_proto3_lite.pb.cc'; then $(CYGPATH_W) 'google/protobuf/unittest_proto3_lite.pb.cc'; else $(CYGPATH_W) '$(srcdir)/google/protobuf/unittest_proto3_lite.pb.cc'; fi` - -google/protobuf/protobuf_test-unittest_proto3_optional.pb.o: google/protobuf/unittest_proto3_optional.pb.cc -@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(protobuf_test_CPPFLAGS) $(CPPFLAGS) $(protobuf_test_CXXFLAGS) $(CXXFLAGS) -MT google/protobuf/protobuf_test-unittest_proto3_optional.pb.o -MD -MP -MF google/protobuf/$(DEPDIR)/protobuf_test-unittest_proto3_optional.pb.Tpo -c -o google/protobuf/protobuf_test-unittest_proto3_optional.pb.o `test -f 'google/protobuf/unittest_proto3_optional.pb.cc' || echo '$(srcdir)/'`google/protobuf/unittest_proto3_optional.pb.cc -@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) google/protobuf/$(DEPDIR)/protobuf_test-unittest_proto3_optional.pb.Tpo google/protobuf/$(DEPDIR)/protobuf_test-unittest_proto3_optional.pb.Po -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='google/protobuf/unittest_proto3_optional.pb.cc' object='google/protobuf/protobuf_test-unittest_proto3_optional.pb.o' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(protobuf_test_CPPFLAGS) $(CPPFLAGS) $(protobuf_test_CXXFLAGS) $(CXXFLAGS) -c -o google/protobuf/protobuf_test-unittest_proto3_optional.pb.o `test -f 'google/protobuf/unittest_proto3_optional.pb.cc' || echo '$(srcdir)/'`google/protobuf/unittest_proto3_optional.pb.cc - -google/protobuf/protobuf_test-unittest_proto3_optional.pb.obj: google/protobuf/unittest_proto3_optional.pb.cc -@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(protobuf_test_CPPFLAGS) $(CPPFLAGS) $(protobuf_test_CXXFLAGS) $(CXXFLAGS) -MT google/protobuf/protobuf_test-unittest_proto3_optional.pb.obj -MD -MP -MF google/protobuf/$(DEPDIR)/protobuf_test-unittest_proto3_optional.pb.Tpo -c -o google/protobuf/protobuf_test-unittest_proto3_optional.pb.obj `if test -f 'google/protobuf/unittest_proto3_optional.pb.cc'; then $(CYGPATH_W) 'google/protobuf/unittest_proto3_optional.pb.cc'; else $(CYGPATH_W) '$(srcdir)/google/protobuf/unittest_proto3_optional.pb.cc'; fi` -@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) google/protobuf/$(DEPDIR)/protobuf_test-unittest_proto3_optional.pb.Tpo google/protobuf/$(DEPDIR)/protobuf_test-unittest_proto3_optional.pb.Po -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='google/protobuf/unittest_proto3_optional.pb.cc' object='google/protobuf/protobuf_test-unittest_proto3_optional.pb.obj' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(protobuf_test_CPPFLAGS) $(CPPFLAGS) $(protobuf_test_CXXFLAGS) $(CXXFLAGS) -c -o google/protobuf/protobuf_test-unittest_proto3_optional.pb.obj `if test -f 'google/protobuf/unittest_proto3_optional.pb.cc'; then $(CYGPATH_W) 'google/protobuf/unittest_proto3_optional.pb.cc'; else $(CYGPATH_W) '$(srcdir)/google/protobuf/unittest_proto3_optional.pb.cc'; fi` - -google/protobuf/protobuf_test-unittest_well_known_types.pb.o: google/protobuf/unittest_well_known_types.pb.cc -@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(protobuf_test_CPPFLAGS) $(CPPFLAGS) $(protobuf_test_CXXFLAGS) $(CXXFLAGS) -MT google/protobuf/protobuf_test-unittest_well_known_types.pb.o -MD -MP -MF google/protobuf/$(DEPDIR)/protobuf_test-unittest_well_known_types.pb.Tpo -c -o google/protobuf/protobuf_test-unittest_well_known_types.pb.o `test -f 'google/protobuf/unittest_well_known_types.pb.cc' || echo '$(srcdir)/'`google/protobuf/unittest_well_known_types.pb.cc -@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) google/protobuf/$(DEPDIR)/protobuf_test-unittest_well_known_types.pb.Tpo google/protobuf/$(DEPDIR)/protobuf_test-unittest_well_known_types.pb.Po -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='google/protobuf/unittest_well_known_types.pb.cc' object='google/protobuf/protobuf_test-unittest_well_known_types.pb.o' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(protobuf_test_CPPFLAGS) $(CPPFLAGS) $(protobuf_test_CXXFLAGS) $(CXXFLAGS) -c -o google/protobuf/protobuf_test-unittest_well_known_types.pb.o `test -f 'google/protobuf/unittest_well_known_types.pb.cc' || echo '$(srcdir)/'`google/protobuf/unittest_well_known_types.pb.cc - -google/protobuf/protobuf_test-unittest_well_known_types.pb.obj: google/protobuf/unittest_well_known_types.pb.cc -@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(protobuf_test_CPPFLAGS) $(CPPFLAGS) $(protobuf_test_CXXFLAGS) $(CXXFLAGS) -MT google/protobuf/protobuf_test-unittest_well_known_types.pb.obj -MD -MP -MF google/protobuf/$(DEPDIR)/protobuf_test-unittest_well_known_types.pb.Tpo -c -o google/protobuf/protobuf_test-unittest_well_known_types.pb.obj `if test -f 'google/protobuf/unittest_well_known_types.pb.cc'; then $(CYGPATH_W) 'google/protobuf/unittest_well_known_types.pb.cc'; else $(CYGPATH_W) '$(srcdir)/google/protobuf/unittest_well_known_types.pb.cc'; fi` -@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) google/protobuf/$(DEPDIR)/protobuf_test-unittest_well_known_types.pb.Tpo google/protobuf/$(DEPDIR)/protobuf_test-unittest_well_known_types.pb.Po -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='google/protobuf/unittest_well_known_types.pb.cc' object='google/protobuf/protobuf_test-unittest_well_known_types.pb.obj' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(protobuf_test_CPPFLAGS) $(CPPFLAGS) $(protobuf_test_CXXFLAGS) $(CXXFLAGS) -c -o google/protobuf/protobuf_test-unittest_well_known_types.pb.obj `if test -f 'google/protobuf/unittest_well_known_types.pb.cc'; then $(CYGPATH_W) 'google/protobuf/unittest_well_known_types.pb.cc'; else $(CYGPATH_W) '$(srcdir)/google/protobuf/unittest_well_known_types.pb.cc'; fi` - -google/protobuf/util/internal/testdata/protobuf_test-anys.pb.o: google/protobuf/util/internal/testdata/anys.pb.cc -@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(protobuf_test_CPPFLAGS) $(CPPFLAGS) $(protobuf_test_CXXFLAGS) $(CXXFLAGS) -MT google/protobuf/util/internal/testdata/protobuf_test-anys.pb.o -MD -MP -MF google/protobuf/util/internal/testdata/$(DEPDIR)/protobuf_test-anys.pb.Tpo -c -o google/protobuf/util/internal/testdata/protobuf_test-anys.pb.o `test -f 'google/protobuf/util/internal/testdata/anys.pb.cc' || echo '$(srcdir)/'`google/protobuf/util/internal/testdata/anys.pb.cc -@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) google/protobuf/util/internal/testdata/$(DEPDIR)/protobuf_test-anys.pb.Tpo google/protobuf/util/internal/testdata/$(DEPDIR)/protobuf_test-anys.pb.Po -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='google/protobuf/util/internal/testdata/anys.pb.cc' object='google/protobuf/util/internal/testdata/protobuf_test-anys.pb.o' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(protobuf_test_CPPFLAGS) $(CPPFLAGS) $(protobuf_test_CXXFLAGS) $(CXXFLAGS) -c -o google/protobuf/util/internal/testdata/protobuf_test-anys.pb.o `test -f 'google/protobuf/util/internal/testdata/anys.pb.cc' || echo '$(srcdir)/'`google/protobuf/util/internal/testdata/anys.pb.cc - -google/protobuf/util/internal/testdata/protobuf_test-anys.pb.obj: google/protobuf/util/internal/testdata/anys.pb.cc -@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(protobuf_test_CPPFLAGS) $(CPPFLAGS) $(protobuf_test_CXXFLAGS) $(CXXFLAGS) -MT google/protobuf/util/internal/testdata/protobuf_test-anys.pb.obj -MD -MP -MF google/protobuf/util/internal/testdata/$(DEPDIR)/protobuf_test-anys.pb.Tpo -c -o google/protobuf/util/internal/testdata/protobuf_test-anys.pb.obj `if test -f 'google/protobuf/util/internal/testdata/anys.pb.cc'; then $(CYGPATH_W) 'google/protobuf/util/internal/testdata/anys.pb.cc'; else $(CYGPATH_W) '$(srcdir)/google/protobuf/util/internal/testdata/anys.pb.cc'; fi` -@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) google/protobuf/util/internal/testdata/$(DEPDIR)/protobuf_test-anys.pb.Tpo google/protobuf/util/internal/testdata/$(DEPDIR)/protobuf_test-anys.pb.Po -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='google/protobuf/util/internal/testdata/anys.pb.cc' object='google/protobuf/util/internal/testdata/protobuf_test-anys.pb.obj' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(protobuf_test_CPPFLAGS) $(CPPFLAGS) $(protobuf_test_CXXFLAGS) $(CXXFLAGS) -c -o google/protobuf/util/internal/testdata/protobuf_test-anys.pb.obj `if test -f 'google/protobuf/util/internal/testdata/anys.pb.cc'; then $(CYGPATH_W) 'google/protobuf/util/internal/testdata/anys.pb.cc'; else $(CYGPATH_W) '$(srcdir)/google/protobuf/util/internal/testdata/anys.pb.cc'; fi` - -google/protobuf/util/internal/testdata/protobuf_test-books.pb.o: google/protobuf/util/internal/testdata/books.pb.cc -@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(protobuf_test_CPPFLAGS) $(CPPFLAGS) $(protobuf_test_CXXFLAGS) $(CXXFLAGS) -MT google/protobuf/util/internal/testdata/protobuf_test-books.pb.o -MD -MP -MF google/protobuf/util/internal/testdata/$(DEPDIR)/protobuf_test-books.pb.Tpo -c -o google/protobuf/util/internal/testdata/protobuf_test-books.pb.o `test -f 'google/protobuf/util/internal/testdata/books.pb.cc' || echo '$(srcdir)/'`google/protobuf/util/internal/testdata/books.pb.cc -@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) google/protobuf/util/internal/testdata/$(DEPDIR)/protobuf_test-books.pb.Tpo google/protobuf/util/internal/testdata/$(DEPDIR)/protobuf_test-books.pb.Po -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='google/protobuf/util/internal/testdata/books.pb.cc' object='google/protobuf/util/internal/testdata/protobuf_test-books.pb.o' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(protobuf_test_CPPFLAGS) $(CPPFLAGS) $(protobuf_test_CXXFLAGS) $(CXXFLAGS) -c -o google/protobuf/util/internal/testdata/protobuf_test-books.pb.o `test -f 'google/protobuf/util/internal/testdata/books.pb.cc' || echo '$(srcdir)/'`google/protobuf/util/internal/testdata/books.pb.cc - -google/protobuf/util/internal/testdata/protobuf_test-books.pb.obj: google/protobuf/util/internal/testdata/books.pb.cc -@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(protobuf_test_CPPFLAGS) $(CPPFLAGS) $(protobuf_test_CXXFLAGS) $(CXXFLAGS) -MT google/protobuf/util/internal/testdata/protobuf_test-books.pb.obj -MD -MP -MF google/protobuf/util/internal/testdata/$(DEPDIR)/protobuf_test-books.pb.Tpo -c -o google/protobuf/util/internal/testdata/protobuf_test-books.pb.obj `if test -f 'google/protobuf/util/internal/testdata/books.pb.cc'; then $(CYGPATH_W) 'google/protobuf/util/internal/testdata/books.pb.cc'; else $(CYGPATH_W) '$(srcdir)/google/protobuf/util/internal/testdata/books.pb.cc'; fi` -@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) google/protobuf/util/internal/testdata/$(DEPDIR)/protobuf_test-books.pb.Tpo google/protobuf/util/internal/testdata/$(DEPDIR)/protobuf_test-books.pb.Po -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='google/protobuf/util/internal/testdata/books.pb.cc' object='google/protobuf/util/internal/testdata/protobuf_test-books.pb.obj' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(protobuf_test_CPPFLAGS) $(CPPFLAGS) $(protobuf_test_CXXFLAGS) $(CXXFLAGS) -c -o google/protobuf/util/internal/testdata/protobuf_test-books.pb.obj `if test -f 'google/protobuf/util/internal/testdata/books.pb.cc'; then $(CYGPATH_W) 'google/protobuf/util/internal/testdata/books.pb.cc'; else $(CYGPATH_W) '$(srcdir)/google/protobuf/util/internal/testdata/books.pb.cc'; fi` - -google/protobuf/util/internal/testdata/protobuf_test-default_value.pb.o: google/protobuf/util/internal/testdata/default_value.pb.cc -@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(protobuf_test_CPPFLAGS) $(CPPFLAGS) $(protobuf_test_CXXFLAGS) $(CXXFLAGS) -MT google/protobuf/util/internal/testdata/protobuf_test-default_value.pb.o -MD -MP -MF google/protobuf/util/internal/testdata/$(DEPDIR)/protobuf_test-default_value.pb.Tpo -c -o google/protobuf/util/internal/testdata/protobuf_test-default_value.pb.o `test -f 'google/protobuf/util/internal/testdata/default_value.pb.cc' || echo '$(srcdir)/'`google/protobuf/util/internal/testdata/default_value.pb.cc -@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) google/protobuf/util/internal/testdata/$(DEPDIR)/protobuf_test-default_value.pb.Tpo google/protobuf/util/internal/testdata/$(DEPDIR)/protobuf_test-default_value.pb.Po -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='google/protobuf/util/internal/testdata/default_value.pb.cc' object='google/protobuf/util/internal/testdata/protobuf_test-default_value.pb.o' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(protobuf_test_CPPFLAGS) $(CPPFLAGS) $(protobuf_test_CXXFLAGS) $(CXXFLAGS) -c -o google/protobuf/util/internal/testdata/protobuf_test-default_value.pb.o `test -f 'google/protobuf/util/internal/testdata/default_value.pb.cc' || echo '$(srcdir)/'`google/protobuf/util/internal/testdata/default_value.pb.cc - -google/protobuf/util/internal/testdata/protobuf_test-default_value.pb.obj: google/protobuf/util/internal/testdata/default_value.pb.cc -@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(protobuf_test_CPPFLAGS) $(CPPFLAGS) $(protobuf_test_CXXFLAGS) $(CXXFLAGS) -MT google/protobuf/util/internal/testdata/protobuf_test-default_value.pb.obj -MD -MP -MF google/protobuf/util/internal/testdata/$(DEPDIR)/protobuf_test-default_value.pb.Tpo -c -o google/protobuf/util/internal/testdata/protobuf_test-default_value.pb.obj `if test -f 'google/protobuf/util/internal/testdata/default_value.pb.cc'; then $(CYGPATH_W) 'google/protobuf/util/internal/testdata/default_value.pb.cc'; else $(CYGPATH_W) '$(srcdir)/google/protobuf/util/internal/testdata/default_value.pb.cc'; fi` -@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) google/protobuf/util/internal/testdata/$(DEPDIR)/protobuf_test-default_value.pb.Tpo google/protobuf/util/internal/testdata/$(DEPDIR)/protobuf_test-default_value.pb.Po -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='google/protobuf/util/internal/testdata/default_value.pb.cc' object='google/protobuf/util/internal/testdata/protobuf_test-default_value.pb.obj' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(protobuf_test_CPPFLAGS) $(CPPFLAGS) $(protobuf_test_CXXFLAGS) $(CXXFLAGS) -c -o google/protobuf/util/internal/testdata/protobuf_test-default_value.pb.obj `if test -f 'google/protobuf/util/internal/testdata/default_value.pb.cc'; then $(CYGPATH_W) 'google/protobuf/util/internal/testdata/default_value.pb.cc'; else $(CYGPATH_W) '$(srcdir)/google/protobuf/util/internal/testdata/default_value.pb.cc'; fi` - -google/protobuf/util/internal/testdata/protobuf_test-default_value_test.pb.o: google/protobuf/util/internal/testdata/default_value_test.pb.cc -@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(protobuf_test_CPPFLAGS) $(CPPFLAGS) $(protobuf_test_CXXFLAGS) $(CXXFLAGS) -MT google/protobuf/util/internal/testdata/protobuf_test-default_value_test.pb.o -MD -MP -MF google/protobuf/util/internal/testdata/$(DEPDIR)/protobuf_test-default_value_test.pb.Tpo -c -o google/protobuf/util/internal/testdata/protobuf_test-default_value_test.pb.o `test -f 'google/protobuf/util/internal/testdata/default_value_test.pb.cc' || echo '$(srcdir)/'`google/protobuf/util/internal/testdata/default_value_test.pb.cc -@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) google/protobuf/util/internal/testdata/$(DEPDIR)/protobuf_test-default_value_test.pb.Tpo google/protobuf/util/internal/testdata/$(DEPDIR)/protobuf_test-default_value_test.pb.Po -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='google/protobuf/util/internal/testdata/default_value_test.pb.cc' object='google/protobuf/util/internal/testdata/protobuf_test-default_value_test.pb.o' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(protobuf_test_CPPFLAGS) $(CPPFLAGS) $(protobuf_test_CXXFLAGS) $(CXXFLAGS) -c -o google/protobuf/util/internal/testdata/protobuf_test-default_value_test.pb.o `test -f 'google/protobuf/util/internal/testdata/default_value_test.pb.cc' || echo '$(srcdir)/'`google/protobuf/util/internal/testdata/default_value_test.pb.cc - -google/protobuf/util/internal/testdata/protobuf_test-default_value_test.pb.obj: google/protobuf/util/internal/testdata/default_value_test.pb.cc -@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(protobuf_test_CPPFLAGS) $(CPPFLAGS) $(protobuf_test_CXXFLAGS) $(CXXFLAGS) -MT google/protobuf/util/internal/testdata/protobuf_test-default_value_test.pb.obj -MD -MP -MF google/protobuf/util/internal/testdata/$(DEPDIR)/protobuf_test-default_value_test.pb.Tpo -c -o google/protobuf/util/internal/testdata/protobuf_test-default_value_test.pb.obj `if test -f 'google/protobuf/util/internal/testdata/default_value_test.pb.cc'; then $(CYGPATH_W) 'google/protobuf/util/internal/testdata/default_value_test.pb.cc'; else $(CYGPATH_W) '$(srcdir)/google/protobuf/util/internal/testdata/default_value_test.pb.cc'; fi` -@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) google/protobuf/util/internal/testdata/$(DEPDIR)/protobuf_test-default_value_test.pb.Tpo google/protobuf/util/internal/testdata/$(DEPDIR)/protobuf_test-default_value_test.pb.Po -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='google/protobuf/util/internal/testdata/default_value_test.pb.cc' object='google/protobuf/util/internal/testdata/protobuf_test-default_value_test.pb.obj' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(protobuf_test_CPPFLAGS) $(CPPFLAGS) $(protobuf_test_CXXFLAGS) $(CXXFLAGS) -c -o google/protobuf/util/internal/testdata/protobuf_test-default_value_test.pb.obj `if test -f 'google/protobuf/util/internal/testdata/default_value_test.pb.cc'; then $(CYGPATH_W) 'google/protobuf/util/internal/testdata/default_value_test.pb.cc'; else $(CYGPATH_W) '$(srcdir)/google/protobuf/util/internal/testdata/default_value_test.pb.cc'; fi` - -google/protobuf/util/internal/testdata/protobuf_test-field_mask.pb.o: google/protobuf/util/internal/testdata/field_mask.pb.cc -@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(protobuf_test_CPPFLAGS) $(CPPFLAGS) $(protobuf_test_CXXFLAGS) $(CXXFLAGS) -MT google/protobuf/util/internal/testdata/protobuf_test-field_mask.pb.o -MD -MP -MF google/protobuf/util/internal/testdata/$(DEPDIR)/protobuf_test-field_mask.pb.Tpo -c -o google/protobuf/util/internal/testdata/protobuf_test-field_mask.pb.o `test -f 'google/protobuf/util/internal/testdata/field_mask.pb.cc' || echo '$(srcdir)/'`google/protobuf/util/internal/testdata/field_mask.pb.cc -@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) google/protobuf/util/internal/testdata/$(DEPDIR)/protobuf_test-field_mask.pb.Tpo google/protobuf/util/internal/testdata/$(DEPDIR)/protobuf_test-field_mask.pb.Po -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='google/protobuf/util/internal/testdata/field_mask.pb.cc' object='google/protobuf/util/internal/testdata/protobuf_test-field_mask.pb.o' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(protobuf_test_CPPFLAGS) $(CPPFLAGS) $(protobuf_test_CXXFLAGS) $(CXXFLAGS) -c -o google/protobuf/util/internal/testdata/protobuf_test-field_mask.pb.o `test -f 'google/protobuf/util/internal/testdata/field_mask.pb.cc' || echo '$(srcdir)/'`google/protobuf/util/internal/testdata/field_mask.pb.cc - -google/protobuf/util/internal/testdata/protobuf_test-field_mask.pb.obj: google/protobuf/util/internal/testdata/field_mask.pb.cc -@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(protobuf_test_CPPFLAGS) $(CPPFLAGS) $(protobuf_test_CXXFLAGS) $(CXXFLAGS) -MT google/protobuf/util/internal/testdata/protobuf_test-field_mask.pb.obj -MD -MP -MF google/protobuf/util/internal/testdata/$(DEPDIR)/protobuf_test-field_mask.pb.Tpo -c -o google/protobuf/util/internal/testdata/protobuf_test-field_mask.pb.obj `if test -f 'google/protobuf/util/internal/testdata/field_mask.pb.cc'; then $(CYGPATH_W) 'google/protobuf/util/internal/testdata/field_mask.pb.cc'; else $(CYGPATH_W) '$(srcdir)/google/protobuf/util/internal/testdata/field_mask.pb.cc'; fi` -@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) google/protobuf/util/internal/testdata/$(DEPDIR)/protobuf_test-field_mask.pb.Tpo google/protobuf/util/internal/testdata/$(DEPDIR)/protobuf_test-field_mask.pb.Po -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='google/protobuf/util/internal/testdata/field_mask.pb.cc' object='google/protobuf/util/internal/testdata/protobuf_test-field_mask.pb.obj' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(protobuf_test_CPPFLAGS) $(CPPFLAGS) $(protobuf_test_CXXFLAGS) $(CXXFLAGS) -c -o google/protobuf/util/internal/testdata/protobuf_test-field_mask.pb.obj `if test -f 'google/protobuf/util/internal/testdata/field_mask.pb.cc'; then $(CYGPATH_W) 'google/protobuf/util/internal/testdata/field_mask.pb.cc'; else $(CYGPATH_W) '$(srcdir)/google/protobuf/util/internal/testdata/field_mask.pb.cc'; fi` - -google/protobuf/util/internal/testdata/protobuf_test-maps.pb.o: google/protobuf/util/internal/testdata/maps.pb.cc -@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(protobuf_test_CPPFLAGS) $(CPPFLAGS) $(protobuf_test_CXXFLAGS) $(CXXFLAGS) -MT google/protobuf/util/internal/testdata/protobuf_test-maps.pb.o -MD -MP -MF google/protobuf/util/internal/testdata/$(DEPDIR)/protobuf_test-maps.pb.Tpo -c -o google/protobuf/util/internal/testdata/protobuf_test-maps.pb.o `test -f 'google/protobuf/util/internal/testdata/maps.pb.cc' || echo '$(srcdir)/'`google/protobuf/util/internal/testdata/maps.pb.cc -@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) google/protobuf/util/internal/testdata/$(DEPDIR)/protobuf_test-maps.pb.Tpo google/protobuf/util/internal/testdata/$(DEPDIR)/protobuf_test-maps.pb.Po -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='google/protobuf/util/internal/testdata/maps.pb.cc' object='google/protobuf/util/internal/testdata/protobuf_test-maps.pb.o' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(protobuf_test_CPPFLAGS) $(CPPFLAGS) $(protobuf_test_CXXFLAGS) $(CXXFLAGS) -c -o google/protobuf/util/internal/testdata/protobuf_test-maps.pb.o `test -f 'google/protobuf/util/internal/testdata/maps.pb.cc' || echo '$(srcdir)/'`google/protobuf/util/internal/testdata/maps.pb.cc - -google/protobuf/util/internal/testdata/protobuf_test-maps.pb.obj: google/protobuf/util/internal/testdata/maps.pb.cc -@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(protobuf_test_CPPFLAGS) $(CPPFLAGS) $(protobuf_test_CXXFLAGS) $(CXXFLAGS) -MT google/protobuf/util/internal/testdata/protobuf_test-maps.pb.obj -MD -MP -MF google/protobuf/util/internal/testdata/$(DEPDIR)/protobuf_test-maps.pb.Tpo -c -o google/protobuf/util/internal/testdata/protobuf_test-maps.pb.obj `if test -f 'google/protobuf/util/internal/testdata/maps.pb.cc'; then $(CYGPATH_W) 'google/protobuf/util/internal/testdata/maps.pb.cc'; else $(CYGPATH_W) '$(srcdir)/google/protobuf/util/internal/testdata/maps.pb.cc'; fi` -@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) google/protobuf/util/internal/testdata/$(DEPDIR)/protobuf_test-maps.pb.Tpo google/protobuf/util/internal/testdata/$(DEPDIR)/protobuf_test-maps.pb.Po -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='google/protobuf/util/internal/testdata/maps.pb.cc' object='google/protobuf/util/internal/testdata/protobuf_test-maps.pb.obj' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(protobuf_test_CPPFLAGS) $(CPPFLAGS) $(protobuf_test_CXXFLAGS) $(CXXFLAGS) -c -o google/protobuf/util/internal/testdata/protobuf_test-maps.pb.obj `if test -f 'google/protobuf/util/internal/testdata/maps.pb.cc'; then $(CYGPATH_W) 'google/protobuf/util/internal/testdata/maps.pb.cc'; else $(CYGPATH_W) '$(srcdir)/google/protobuf/util/internal/testdata/maps.pb.cc'; fi` - -google/protobuf/util/internal/testdata/protobuf_test-oneofs.pb.o: google/protobuf/util/internal/testdata/oneofs.pb.cc -@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(protobuf_test_CPPFLAGS) $(CPPFLAGS) $(protobuf_test_CXXFLAGS) $(CXXFLAGS) -MT google/protobuf/util/internal/testdata/protobuf_test-oneofs.pb.o -MD -MP -MF google/protobuf/util/internal/testdata/$(DEPDIR)/protobuf_test-oneofs.pb.Tpo -c -o google/protobuf/util/internal/testdata/protobuf_test-oneofs.pb.o `test -f 'google/protobuf/util/internal/testdata/oneofs.pb.cc' || echo '$(srcdir)/'`google/protobuf/util/internal/testdata/oneofs.pb.cc -@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) google/protobuf/util/internal/testdata/$(DEPDIR)/protobuf_test-oneofs.pb.Tpo google/protobuf/util/internal/testdata/$(DEPDIR)/protobuf_test-oneofs.pb.Po -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='google/protobuf/util/internal/testdata/oneofs.pb.cc' object='google/protobuf/util/internal/testdata/protobuf_test-oneofs.pb.o' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(protobuf_test_CPPFLAGS) $(CPPFLAGS) $(protobuf_test_CXXFLAGS) $(CXXFLAGS) -c -o google/protobuf/util/internal/testdata/protobuf_test-oneofs.pb.o `test -f 'google/protobuf/util/internal/testdata/oneofs.pb.cc' || echo '$(srcdir)/'`google/protobuf/util/internal/testdata/oneofs.pb.cc - -google/protobuf/util/internal/testdata/protobuf_test-oneofs.pb.obj: google/protobuf/util/internal/testdata/oneofs.pb.cc -@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(protobuf_test_CPPFLAGS) $(CPPFLAGS) $(protobuf_test_CXXFLAGS) $(CXXFLAGS) -MT google/protobuf/util/internal/testdata/protobuf_test-oneofs.pb.obj -MD -MP -MF google/protobuf/util/internal/testdata/$(DEPDIR)/protobuf_test-oneofs.pb.Tpo -c -o google/protobuf/util/internal/testdata/protobuf_test-oneofs.pb.obj `if test -f 'google/protobuf/util/internal/testdata/oneofs.pb.cc'; then $(CYGPATH_W) 'google/protobuf/util/internal/testdata/oneofs.pb.cc'; else $(CYGPATH_W) '$(srcdir)/google/protobuf/util/internal/testdata/oneofs.pb.cc'; fi` -@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) google/protobuf/util/internal/testdata/$(DEPDIR)/protobuf_test-oneofs.pb.Tpo google/protobuf/util/internal/testdata/$(DEPDIR)/protobuf_test-oneofs.pb.Po -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='google/protobuf/util/internal/testdata/oneofs.pb.cc' object='google/protobuf/util/internal/testdata/protobuf_test-oneofs.pb.obj' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(protobuf_test_CPPFLAGS) $(CPPFLAGS) $(protobuf_test_CXXFLAGS) $(CXXFLAGS) -c -o google/protobuf/util/internal/testdata/protobuf_test-oneofs.pb.obj `if test -f 'google/protobuf/util/internal/testdata/oneofs.pb.cc'; then $(CYGPATH_W) 'google/protobuf/util/internal/testdata/oneofs.pb.cc'; else $(CYGPATH_W) '$(srcdir)/google/protobuf/util/internal/testdata/oneofs.pb.cc'; fi` - -google/protobuf/util/internal/testdata/protobuf_test-proto3.pb.o: google/protobuf/util/internal/testdata/proto3.pb.cc -@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(protobuf_test_CPPFLAGS) $(CPPFLAGS) $(protobuf_test_CXXFLAGS) $(CXXFLAGS) -MT google/protobuf/util/internal/testdata/protobuf_test-proto3.pb.o -MD -MP -MF google/protobuf/util/internal/testdata/$(DEPDIR)/protobuf_test-proto3.pb.Tpo -c -o google/protobuf/util/internal/testdata/protobuf_test-proto3.pb.o `test -f 'google/protobuf/util/internal/testdata/proto3.pb.cc' || echo '$(srcdir)/'`google/protobuf/util/internal/testdata/proto3.pb.cc -@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) google/protobuf/util/internal/testdata/$(DEPDIR)/protobuf_test-proto3.pb.Tpo google/protobuf/util/internal/testdata/$(DEPDIR)/protobuf_test-proto3.pb.Po -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='google/protobuf/util/internal/testdata/proto3.pb.cc' object='google/protobuf/util/internal/testdata/protobuf_test-proto3.pb.o' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(protobuf_test_CPPFLAGS) $(CPPFLAGS) $(protobuf_test_CXXFLAGS) $(CXXFLAGS) -c -o google/protobuf/util/internal/testdata/protobuf_test-proto3.pb.o `test -f 'google/protobuf/util/internal/testdata/proto3.pb.cc' || echo '$(srcdir)/'`google/protobuf/util/internal/testdata/proto3.pb.cc - -google/protobuf/util/internal/testdata/protobuf_test-proto3.pb.obj: google/protobuf/util/internal/testdata/proto3.pb.cc -@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(protobuf_test_CPPFLAGS) $(CPPFLAGS) $(protobuf_test_CXXFLAGS) $(CXXFLAGS) -MT google/protobuf/util/internal/testdata/protobuf_test-proto3.pb.obj -MD -MP -MF google/protobuf/util/internal/testdata/$(DEPDIR)/protobuf_test-proto3.pb.Tpo -c -o google/protobuf/util/internal/testdata/protobuf_test-proto3.pb.obj `if test -f 'google/protobuf/util/internal/testdata/proto3.pb.cc'; then $(CYGPATH_W) 'google/protobuf/util/internal/testdata/proto3.pb.cc'; else $(CYGPATH_W) '$(srcdir)/google/protobuf/util/internal/testdata/proto3.pb.cc'; fi` -@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) google/protobuf/util/internal/testdata/$(DEPDIR)/protobuf_test-proto3.pb.Tpo google/protobuf/util/internal/testdata/$(DEPDIR)/protobuf_test-proto3.pb.Po -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='google/protobuf/util/internal/testdata/proto3.pb.cc' object='google/protobuf/util/internal/testdata/protobuf_test-proto3.pb.obj' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(protobuf_test_CPPFLAGS) $(CPPFLAGS) $(protobuf_test_CXXFLAGS) $(CXXFLAGS) -c -o google/protobuf/util/internal/testdata/protobuf_test-proto3.pb.obj `if test -f 'google/protobuf/util/internal/testdata/proto3.pb.cc'; then $(CYGPATH_W) 'google/protobuf/util/internal/testdata/proto3.pb.cc'; else $(CYGPATH_W) '$(srcdir)/google/protobuf/util/internal/testdata/proto3.pb.cc'; fi` - -google/protobuf/util/internal/testdata/protobuf_test-struct.pb.o: google/protobuf/util/internal/testdata/struct.pb.cc -@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(protobuf_test_CPPFLAGS) $(CPPFLAGS) $(protobuf_test_CXXFLAGS) $(CXXFLAGS) -MT google/protobuf/util/internal/testdata/protobuf_test-struct.pb.o -MD -MP -MF google/protobuf/util/internal/testdata/$(DEPDIR)/protobuf_test-struct.pb.Tpo -c -o google/protobuf/util/internal/testdata/protobuf_test-struct.pb.o `test -f 'google/protobuf/util/internal/testdata/struct.pb.cc' || echo '$(srcdir)/'`google/protobuf/util/internal/testdata/struct.pb.cc -@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) google/protobuf/util/internal/testdata/$(DEPDIR)/protobuf_test-struct.pb.Tpo google/protobuf/util/internal/testdata/$(DEPDIR)/protobuf_test-struct.pb.Po -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='google/protobuf/util/internal/testdata/struct.pb.cc' object='google/protobuf/util/internal/testdata/protobuf_test-struct.pb.o' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(protobuf_test_CPPFLAGS) $(CPPFLAGS) $(protobuf_test_CXXFLAGS) $(CXXFLAGS) -c -o google/protobuf/util/internal/testdata/protobuf_test-struct.pb.o `test -f 'google/protobuf/util/internal/testdata/struct.pb.cc' || echo '$(srcdir)/'`google/protobuf/util/internal/testdata/struct.pb.cc - -google/protobuf/util/internal/testdata/protobuf_test-struct.pb.obj: google/protobuf/util/internal/testdata/struct.pb.cc -@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(protobuf_test_CPPFLAGS) $(CPPFLAGS) $(protobuf_test_CXXFLAGS) $(CXXFLAGS) -MT google/protobuf/util/internal/testdata/protobuf_test-struct.pb.obj -MD -MP -MF google/protobuf/util/internal/testdata/$(DEPDIR)/protobuf_test-struct.pb.Tpo -c -o google/protobuf/util/internal/testdata/protobuf_test-struct.pb.obj `if test -f 'google/protobuf/util/internal/testdata/struct.pb.cc'; then $(CYGPATH_W) 'google/protobuf/util/internal/testdata/struct.pb.cc'; else $(CYGPATH_W) '$(srcdir)/google/protobuf/util/internal/testdata/struct.pb.cc'; fi` -@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) google/protobuf/util/internal/testdata/$(DEPDIR)/protobuf_test-struct.pb.Tpo google/protobuf/util/internal/testdata/$(DEPDIR)/protobuf_test-struct.pb.Po -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='google/protobuf/util/internal/testdata/struct.pb.cc' object='google/protobuf/util/internal/testdata/protobuf_test-struct.pb.obj' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(protobuf_test_CPPFLAGS) $(CPPFLAGS) $(protobuf_test_CXXFLAGS) $(CXXFLAGS) -c -o google/protobuf/util/internal/testdata/protobuf_test-struct.pb.obj `if test -f 'google/protobuf/util/internal/testdata/struct.pb.cc'; then $(CYGPATH_W) 'google/protobuf/util/internal/testdata/struct.pb.cc'; else $(CYGPATH_W) '$(srcdir)/google/protobuf/util/internal/testdata/struct.pb.cc'; fi` - -google/protobuf/util/internal/testdata/protobuf_test-timestamp_duration.pb.o: google/protobuf/util/internal/testdata/timestamp_duration.pb.cc -@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(protobuf_test_CPPFLAGS) $(CPPFLAGS) $(protobuf_test_CXXFLAGS) $(CXXFLAGS) -MT google/protobuf/util/internal/testdata/protobuf_test-timestamp_duration.pb.o -MD -MP -MF google/protobuf/util/internal/testdata/$(DEPDIR)/protobuf_test-timestamp_duration.pb.Tpo -c -o google/protobuf/util/internal/testdata/protobuf_test-timestamp_duration.pb.o `test -f 'google/protobuf/util/internal/testdata/timestamp_duration.pb.cc' || echo '$(srcdir)/'`google/protobuf/util/internal/testdata/timestamp_duration.pb.cc -@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) google/protobuf/util/internal/testdata/$(DEPDIR)/protobuf_test-timestamp_duration.pb.Tpo google/protobuf/util/internal/testdata/$(DEPDIR)/protobuf_test-timestamp_duration.pb.Po -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='google/protobuf/util/internal/testdata/timestamp_duration.pb.cc' object='google/protobuf/util/internal/testdata/protobuf_test-timestamp_duration.pb.o' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(protobuf_test_CPPFLAGS) $(CPPFLAGS) $(protobuf_test_CXXFLAGS) $(CXXFLAGS) -c -o google/protobuf/util/internal/testdata/protobuf_test-timestamp_duration.pb.o `test -f 'google/protobuf/util/internal/testdata/timestamp_duration.pb.cc' || echo '$(srcdir)/'`google/protobuf/util/internal/testdata/timestamp_duration.pb.cc - -google/protobuf/util/internal/testdata/protobuf_test-timestamp_duration.pb.obj: google/protobuf/util/internal/testdata/timestamp_duration.pb.cc -@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(protobuf_test_CPPFLAGS) $(CPPFLAGS) $(protobuf_test_CXXFLAGS) $(CXXFLAGS) -MT google/protobuf/util/internal/testdata/protobuf_test-timestamp_duration.pb.obj -MD -MP -MF google/protobuf/util/internal/testdata/$(DEPDIR)/protobuf_test-timestamp_duration.pb.Tpo -c -o google/protobuf/util/internal/testdata/protobuf_test-timestamp_duration.pb.obj `if test -f 'google/protobuf/util/internal/testdata/timestamp_duration.pb.cc'; then $(CYGPATH_W) 'google/protobuf/util/internal/testdata/timestamp_duration.pb.cc'; else $(CYGPATH_W) '$(srcdir)/google/protobuf/util/internal/testdata/timestamp_duration.pb.cc'; fi` -@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) google/protobuf/util/internal/testdata/$(DEPDIR)/protobuf_test-timestamp_duration.pb.Tpo google/protobuf/util/internal/testdata/$(DEPDIR)/protobuf_test-timestamp_duration.pb.Po -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='google/protobuf/util/internal/testdata/timestamp_duration.pb.cc' object='google/protobuf/util/internal/testdata/protobuf_test-timestamp_duration.pb.obj' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(protobuf_test_CPPFLAGS) $(CPPFLAGS) $(protobuf_test_CXXFLAGS) $(CXXFLAGS) -c -o google/protobuf/util/internal/testdata/protobuf_test-timestamp_duration.pb.obj `if test -f 'google/protobuf/util/internal/testdata/timestamp_duration.pb.cc'; then $(CYGPATH_W) 'google/protobuf/util/internal/testdata/timestamp_duration.pb.cc'; else $(CYGPATH_W) '$(srcdir)/google/protobuf/util/internal/testdata/timestamp_duration.pb.cc'; fi` - -google/protobuf/util/internal/testdata/protobuf_test-wrappers.pb.o: google/protobuf/util/internal/testdata/wrappers.pb.cc -@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(protobuf_test_CPPFLAGS) $(CPPFLAGS) $(protobuf_test_CXXFLAGS) $(CXXFLAGS) -MT google/protobuf/util/internal/testdata/protobuf_test-wrappers.pb.o -MD -MP -MF google/protobuf/util/internal/testdata/$(DEPDIR)/protobuf_test-wrappers.pb.Tpo -c -o google/protobuf/util/internal/testdata/protobuf_test-wrappers.pb.o `test -f 'google/protobuf/util/internal/testdata/wrappers.pb.cc' || echo '$(srcdir)/'`google/protobuf/util/internal/testdata/wrappers.pb.cc -@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) google/protobuf/util/internal/testdata/$(DEPDIR)/protobuf_test-wrappers.pb.Tpo google/protobuf/util/internal/testdata/$(DEPDIR)/protobuf_test-wrappers.pb.Po -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='google/protobuf/util/internal/testdata/wrappers.pb.cc' object='google/protobuf/util/internal/testdata/protobuf_test-wrappers.pb.o' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(protobuf_test_CPPFLAGS) $(CPPFLAGS) $(protobuf_test_CXXFLAGS) $(CXXFLAGS) -c -o google/protobuf/util/internal/testdata/protobuf_test-wrappers.pb.o `test -f 'google/protobuf/util/internal/testdata/wrappers.pb.cc' || echo '$(srcdir)/'`google/protobuf/util/internal/testdata/wrappers.pb.cc - -google/protobuf/util/internal/testdata/protobuf_test-wrappers.pb.obj: google/protobuf/util/internal/testdata/wrappers.pb.cc -@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(protobuf_test_CPPFLAGS) $(CPPFLAGS) $(protobuf_test_CXXFLAGS) $(CXXFLAGS) -MT google/protobuf/util/internal/testdata/protobuf_test-wrappers.pb.obj -MD -MP -MF google/protobuf/util/internal/testdata/$(DEPDIR)/protobuf_test-wrappers.pb.Tpo -c -o google/protobuf/util/internal/testdata/protobuf_test-wrappers.pb.obj `if test -f 'google/protobuf/util/internal/testdata/wrappers.pb.cc'; then $(CYGPATH_W) 'google/protobuf/util/internal/testdata/wrappers.pb.cc'; else $(CYGPATH_W) '$(srcdir)/google/protobuf/util/internal/testdata/wrappers.pb.cc'; fi` -@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) google/protobuf/util/internal/testdata/$(DEPDIR)/protobuf_test-wrappers.pb.Tpo google/protobuf/util/internal/testdata/$(DEPDIR)/protobuf_test-wrappers.pb.Po -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='google/protobuf/util/internal/testdata/wrappers.pb.cc' object='google/protobuf/util/internal/testdata/protobuf_test-wrappers.pb.obj' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(protobuf_test_CPPFLAGS) $(CPPFLAGS) $(protobuf_test_CXXFLAGS) $(CXXFLAGS) -c -o google/protobuf/util/internal/testdata/protobuf_test-wrappers.pb.obj `if test -f 'google/protobuf/util/internal/testdata/wrappers.pb.cc'; then $(CYGPATH_W) 'google/protobuf/util/internal/testdata/wrappers.pb.cc'; else $(CYGPATH_W) '$(srcdir)/google/protobuf/util/internal/testdata/wrappers.pb.cc'; fi` - -google/protobuf/util/protobuf_test-json_format.pb.o: google/protobuf/util/json_format.pb.cc -@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(protobuf_test_CPPFLAGS) $(CPPFLAGS) $(protobuf_test_CXXFLAGS) $(CXXFLAGS) -MT google/protobuf/util/protobuf_test-json_format.pb.o -MD -MP -MF google/protobuf/util/$(DEPDIR)/protobuf_test-json_format.pb.Tpo -c -o google/protobuf/util/protobuf_test-json_format.pb.o `test -f 'google/protobuf/util/json_format.pb.cc' || echo '$(srcdir)/'`google/protobuf/util/json_format.pb.cc -@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) google/protobuf/util/$(DEPDIR)/protobuf_test-json_format.pb.Tpo google/protobuf/util/$(DEPDIR)/protobuf_test-json_format.pb.Po -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='google/protobuf/util/json_format.pb.cc' object='google/protobuf/util/protobuf_test-json_format.pb.o' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(protobuf_test_CPPFLAGS) $(CPPFLAGS) $(protobuf_test_CXXFLAGS) $(CXXFLAGS) -c -o google/protobuf/util/protobuf_test-json_format.pb.o `test -f 'google/protobuf/util/json_format.pb.cc' || echo '$(srcdir)/'`google/protobuf/util/json_format.pb.cc - -google/protobuf/util/protobuf_test-json_format.pb.obj: google/protobuf/util/json_format.pb.cc -@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(protobuf_test_CPPFLAGS) $(CPPFLAGS) $(protobuf_test_CXXFLAGS) $(CXXFLAGS) -MT google/protobuf/util/protobuf_test-json_format.pb.obj -MD -MP -MF google/protobuf/util/$(DEPDIR)/protobuf_test-json_format.pb.Tpo -c -o google/protobuf/util/protobuf_test-json_format.pb.obj `if test -f 'google/protobuf/util/json_format.pb.cc'; then $(CYGPATH_W) 'google/protobuf/util/json_format.pb.cc'; else $(CYGPATH_W) '$(srcdir)/google/protobuf/util/json_format.pb.cc'; fi` -@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) google/protobuf/util/$(DEPDIR)/protobuf_test-json_format.pb.Tpo google/protobuf/util/$(DEPDIR)/protobuf_test-json_format.pb.Po -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='google/protobuf/util/json_format.pb.cc' object='google/protobuf/util/protobuf_test-json_format.pb.obj' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(protobuf_test_CPPFLAGS) $(CPPFLAGS) $(protobuf_test_CXXFLAGS) $(CXXFLAGS) -c -o google/protobuf/util/protobuf_test-json_format.pb.obj `if test -f 'google/protobuf/util/json_format.pb.cc'; then $(CYGPATH_W) 'google/protobuf/util/json_format.pb.cc'; else $(CYGPATH_W) '$(srcdir)/google/protobuf/util/json_format.pb.cc'; fi` - -google/protobuf/util/protobuf_test-json_format_proto3.pb.o: google/protobuf/util/json_format_proto3.pb.cc -@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(protobuf_test_CPPFLAGS) $(CPPFLAGS) $(protobuf_test_CXXFLAGS) $(CXXFLAGS) -MT google/protobuf/util/protobuf_test-json_format_proto3.pb.o -MD -MP -MF google/protobuf/util/$(DEPDIR)/protobuf_test-json_format_proto3.pb.Tpo -c -o google/protobuf/util/protobuf_test-json_format_proto3.pb.o `test -f 'google/protobuf/util/json_format_proto3.pb.cc' || echo '$(srcdir)/'`google/protobuf/util/json_format_proto3.pb.cc -@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) google/protobuf/util/$(DEPDIR)/protobuf_test-json_format_proto3.pb.Tpo google/protobuf/util/$(DEPDIR)/protobuf_test-json_format_proto3.pb.Po -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='google/protobuf/util/json_format_proto3.pb.cc' object='google/protobuf/util/protobuf_test-json_format_proto3.pb.o' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(protobuf_test_CPPFLAGS) $(CPPFLAGS) $(protobuf_test_CXXFLAGS) $(CXXFLAGS) -c -o google/protobuf/util/protobuf_test-json_format_proto3.pb.o `test -f 'google/protobuf/util/json_format_proto3.pb.cc' || echo '$(srcdir)/'`google/protobuf/util/json_format_proto3.pb.cc - -google/protobuf/util/protobuf_test-json_format_proto3.pb.obj: google/protobuf/util/json_format_proto3.pb.cc -@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(protobuf_test_CPPFLAGS) $(CPPFLAGS) $(protobuf_test_CXXFLAGS) $(CXXFLAGS) -MT google/protobuf/util/protobuf_test-json_format_proto3.pb.obj -MD -MP -MF google/protobuf/util/$(DEPDIR)/protobuf_test-json_format_proto3.pb.Tpo -c -o google/protobuf/util/protobuf_test-json_format_proto3.pb.obj `if test -f 'google/protobuf/util/json_format_proto3.pb.cc'; then $(CYGPATH_W) 'google/protobuf/util/json_format_proto3.pb.cc'; else $(CYGPATH_W) '$(srcdir)/google/protobuf/util/json_format_proto3.pb.cc'; fi` -@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) google/protobuf/util/$(DEPDIR)/protobuf_test-json_format_proto3.pb.Tpo google/protobuf/util/$(DEPDIR)/protobuf_test-json_format_proto3.pb.Po -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='google/protobuf/util/json_format_proto3.pb.cc' object='google/protobuf/util/protobuf_test-json_format_proto3.pb.obj' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(protobuf_test_CPPFLAGS) $(CPPFLAGS) $(protobuf_test_CXXFLAGS) $(CXXFLAGS) -c -o google/protobuf/util/protobuf_test-json_format_proto3.pb.obj `if test -f 'google/protobuf/util/json_format_proto3.pb.cc'; then $(CYGPATH_W) 'google/protobuf/util/json_format_proto3.pb.cc'; else $(CYGPATH_W) '$(srcdir)/google/protobuf/util/json_format_proto3.pb.cc'; fi` - -google/protobuf/util/protobuf_test-message_differencer_unittest.pb.o: google/protobuf/util/message_differencer_unittest.pb.cc -@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(protobuf_test_CPPFLAGS) $(CPPFLAGS) $(protobuf_test_CXXFLAGS) $(CXXFLAGS) -MT google/protobuf/util/protobuf_test-message_differencer_unittest.pb.o -MD -MP -MF google/protobuf/util/$(DEPDIR)/protobuf_test-message_differencer_unittest.pb.Tpo -c -o google/protobuf/util/protobuf_test-message_differencer_unittest.pb.o `test -f 'google/protobuf/util/message_differencer_unittest.pb.cc' || echo '$(srcdir)/'`google/protobuf/util/message_differencer_unittest.pb.cc -@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) google/protobuf/util/$(DEPDIR)/protobuf_test-message_differencer_unittest.pb.Tpo google/protobuf/util/$(DEPDIR)/protobuf_test-message_differencer_unittest.pb.Po -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='google/protobuf/util/message_differencer_unittest.pb.cc' object='google/protobuf/util/protobuf_test-message_differencer_unittest.pb.o' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(protobuf_test_CPPFLAGS) $(CPPFLAGS) $(protobuf_test_CXXFLAGS) $(CXXFLAGS) -c -o google/protobuf/util/protobuf_test-message_differencer_unittest.pb.o `test -f 'google/protobuf/util/message_differencer_unittest.pb.cc' || echo '$(srcdir)/'`google/protobuf/util/message_differencer_unittest.pb.cc - -google/protobuf/util/protobuf_test-message_differencer_unittest.pb.obj: google/protobuf/util/message_differencer_unittest.pb.cc -@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(protobuf_test_CPPFLAGS) $(CPPFLAGS) $(protobuf_test_CXXFLAGS) $(CXXFLAGS) -MT google/protobuf/util/protobuf_test-message_differencer_unittest.pb.obj -MD -MP -MF google/protobuf/util/$(DEPDIR)/protobuf_test-message_differencer_unittest.pb.Tpo -c -o google/protobuf/util/protobuf_test-message_differencer_unittest.pb.obj `if test -f 'google/protobuf/util/message_differencer_unittest.pb.cc'; then $(CYGPATH_W) 'google/protobuf/util/message_differencer_unittest.pb.cc'; else $(CYGPATH_W) '$(srcdir)/google/protobuf/util/message_differencer_unittest.pb.cc'; fi` -@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) google/protobuf/util/$(DEPDIR)/protobuf_test-message_differencer_unittest.pb.Tpo google/protobuf/util/$(DEPDIR)/protobuf_test-message_differencer_unittest.pb.Po -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='google/protobuf/util/message_differencer_unittest.pb.cc' object='google/protobuf/util/protobuf_test-message_differencer_unittest.pb.obj' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(protobuf_test_CPPFLAGS) $(CPPFLAGS) $(protobuf_test_CXXFLAGS) $(CXXFLAGS) -c -o google/protobuf/util/protobuf_test-message_differencer_unittest.pb.obj `if test -f 'google/protobuf/util/message_differencer_unittest.pb.cc'; then $(CYGPATH_W) 'google/protobuf/util/message_differencer_unittest.pb.cc'; else $(CYGPATH_W) '$(srcdir)/google/protobuf/util/message_differencer_unittest.pb.cc'; fi` - -google/protobuf/compiler/test_plugin-mock_code_generator.o: google/protobuf/compiler/mock_code_generator.cc -@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(test_plugin_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT google/protobuf/compiler/test_plugin-mock_code_generator.o -MD -MP -MF google/protobuf/compiler/$(DEPDIR)/test_plugin-mock_code_generator.Tpo -c -o google/protobuf/compiler/test_plugin-mock_code_generator.o `test -f 'google/protobuf/compiler/mock_code_generator.cc' || echo '$(srcdir)/'`google/protobuf/compiler/mock_code_generator.cc -@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) google/protobuf/compiler/$(DEPDIR)/test_plugin-mock_code_generator.Tpo google/protobuf/compiler/$(DEPDIR)/test_plugin-mock_code_generator.Po -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='google/protobuf/compiler/mock_code_generator.cc' object='google/protobuf/compiler/test_plugin-mock_code_generator.o' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(test_plugin_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o google/protobuf/compiler/test_plugin-mock_code_generator.o `test -f 'google/protobuf/compiler/mock_code_generator.cc' || echo '$(srcdir)/'`google/protobuf/compiler/mock_code_generator.cc - -google/protobuf/compiler/test_plugin-mock_code_generator.obj: google/protobuf/compiler/mock_code_generator.cc -@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(test_plugin_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT google/protobuf/compiler/test_plugin-mock_code_generator.obj -MD -MP -MF google/protobuf/compiler/$(DEPDIR)/test_plugin-mock_code_generator.Tpo -c -o google/protobuf/compiler/test_plugin-mock_code_generator.obj `if test -f 'google/protobuf/compiler/mock_code_generator.cc'; then $(CYGPATH_W) 'google/protobuf/compiler/mock_code_generator.cc'; else $(CYGPATH_W) '$(srcdir)/google/protobuf/compiler/mock_code_generator.cc'; fi` -@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) google/protobuf/compiler/$(DEPDIR)/test_plugin-mock_code_generator.Tpo google/protobuf/compiler/$(DEPDIR)/test_plugin-mock_code_generator.Po -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='google/protobuf/compiler/mock_code_generator.cc' object='google/protobuf/compiler/test_plugin-mock_code_generator.obj' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(test_plugin_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o google/protobuf/compiler/test_plugin-mock_code_generator.obj `if test -f 'google/protobuf/compiler/mock_code_generator.cc'; then $(CYGPATH_W) 'google/protobuf/compiler/mock_code_generator.cc'; else $(CYGPATH_W) '$(srcdir)/google/protobuf/compiler/mock_code_generator.cc'; fi` - -google/protobuf/compiler/test_plugin-test_plugin.o: google/protobuf/compiler/test_plugin.cc -@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(test_plugin_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT google/protobuf/compiler/test_plugin-test_plugin.o -MD -MP -MF google/protobuf/compiler/$(DEPDIR)/test_plugin-test_plugin.Tpo -c -o google/protobuf/compiler/test_plugin-test_plugin.o `test -f 'google/protobuf/compiler/test_plugin.cc' || echo '$(srcdir)/'`google/protobuf/compiler/test_plugin.cc -@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) google/protobuf/compiler/$(DEPDIR)/test_plugin-test_plugin.Tpo google/protobuf/compiler/$(DEPDIR)/test_plugin-test_plugin.Po -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='google/protobuf/compiler/test_plugin.cc' object='google/protobuf/compiler/test_plugin-test_plugin.o' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(test_plugin_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o google/protobuf/compiler/test_plugin-test_plugin.o `test -f 'google/protobuf/compiler/test_plugin.cc' || echo '$(srcdir)/'`google/protobuf/compiler/test_plugin.cc - -google/protobuf/compiler/test_plugin-test_plugin.obj: google/protobuf/compiler/test_plugin.cc -@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(test_plugin_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT google/protobuf/compiler/test_plugin-test_plugin.obj -MD -MP -MF google/protobuf/compiler/$(DEPDIR)/test_plugin-test_plugin.Tpo -c -o google/protobuf/compiler/test_plugin-test_plugin.obj `if test -f 'google/protobuf/compiler/test_plugin.cc'; then $(CYGPATH_W) 'google/protobuf/compiler/test_plugin.cc'; else $(CYGPATH_W) '$(srcdir)/google/protobuf/compiler/test_plugin.cc'; fi` -@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) google/protobuf/compiler/$(DEPDIR)/test_plugin-test_plugin.Tpo google/protobuf/compiler/$(DEPDIR)/test_plugin-test_plugin.Po -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='google/protobuf/compiler/test_plugin.cc' object='google/protobuf/compiler/test_plugin-test_plugin.obj' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(test_plugin_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o google/protobuf/compiler/test_plugin-test_plugin.obj `if test -f 'google/protobuf/compiler/test_plugin.cc'; then $(CYGPATH_W) 'google/protobuf/compiler/test_plugin.cc'; else $(CYGPATH_W) '$(srcdir)/google/protobuf/compiler/test_plugin.cc'; fi` - -google/protobuf/testing/test_plugin-file.o: google/protobuf/testing/file.cc -@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(test_plugin_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT google/protobuf/testing/test_plugin-file.o -MD -MP -MF google/protobuf/testing/$(DEPDIR)/test_plugin-file.Tpo -c -o google/protobuf/testing/test_plugin-file.o `test -f 'google/protobuf/testing/file.cc' || echo '$(srcdir)/'`google/protobuf/testing/file.cc -@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) google/protobuf/testing/$(DEPDIR)/test_plugin-file.Tpo google/protobuf/testing/$(DEPDIR)/test_plugin-file.Po -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='google/protobuf/testing/file.cc' object='google/protobuf/testing/test_plugin-file.o' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(test_plugin_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o google/protobuf/testing/test_plugin-file.o `test -f 'google/protobuf/testing/file.cc' || echo '$(srcdir)/'`google/protobuf/testing/file.cc - -google/protobuf/testing/test_plugin-file.obj: google/protobuf/testing/file.cc -@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(test_plugin_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT google/protobuf/testing/test_plugin-file.obj -MD -MP -MF google/protobuf/testing/$(DEPDIR)/test_plugin-file.Tpo -c -o google/protobuf/testing/test_plugin-file.obj `if test -f 'google/protobuf/testing/file.cc'; then $(CYGPATH_W) 'google/protobuf/testing/file.cc'; else $(CYGPATH_W) '$(srcdir)/google/protobuf/testing/file.cc'; fi` -@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) google/protobuf/testing/$(DEPDIR)/test_plugin-file.Tpo google/protobuf/testing/$(DEPDIR)/test_plugin-file.Po -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='google/protobuf/testing/file.cc' object='google/protobuf/testing/test_plugin-file.obj' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(test_plugin_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o google/protobuf/testing/test_plugin-file.obj `if test -f 'google/protobuf/testing/file.cc'; then $(CYGPATH_W) 'google/protobuf/testing/file.cc'; else $(CYGPATH_W) '$(srcdir)/google/protobuf/testing/file.cc'; fi` - -mostlyclean-libtool: - -rm -f *.lo - -clean-libtool: - -rm -rf .libs _libs - -rm -rf google/protobuf/.libs google/protobuf/_libs - -rm -rf google/protobuf/compiler/.libs google/protobuf/compiler/_libs - -rm -rf google/protobuf/compiler/cpp/.libs google/protobuf/compiler/cpp/_libs - -rm -rf google/protobuf/compiler/csharp/.libs google/protobuf/compiler/csharp/_libs - -rm -rf google/protobuf/compiler/java/.libs google/protobuf/compiler/java/_libs - -rm -rf google/protobuf/compiler/js/.libs google/protobuf/compiler/js/_libs - -rm -rf google/protobuf/compiler/objectivec/.libs google/protobuf/compiler/objectivec/_libs - -rm -rf google/protobuf/compiler/php/.libs google/protobuf/compiler/php/_libs - -rm -rf google/protobuf/compiler/python/.libs google/protobuf/compiler/python/_libs - -rm -rf google/protobuf/compiler/ruby/.libs google/protobuf/compiler/ruby/_libs - -rm -rf google/protobuf/io/.libs google/protobuf/io/_libs - -rm -rf google/protobuf/stubs/.libs google/protobuf/stubs/_libs - -rm -rf google/protobuf/util/.libs google/protobuf/util/_libs - -rm -rf google/protobuf/util/internal/.libs google/protobuf/util/internal/_libs -install-nobase_dist_protoDATA: $(nobase_dist_proto_DATA) - @$(NORMAL_INSTALL) - @list='$(nobase_dist_proto_DATA)'; test -n "$(protodir)" || list=; \ - if test -n "$$list"; then \ - echo " $(MKDIR_P) '$(DESTDIR)$(protodir)'"; \ - $(MKDIR_P) "$(DESTDIR)$(protodir)" || exit 1; \ - fi; \ - $(am__nobase_list) | while read dir files; do \ - xfiles=; for file in $$files; do \ - if test -f "$$file"; then xfiles="$$xfiles $$file"; \ - else xfiles="$$xfiles $(srcdir)/$$file"; fi; done; \ - test -z "$$xfiles" || { \ - test "x$$dir" = x. || { \ - echo " $(MKDIR_P) '$(DESTDIR)$(protodir)/$$dir'"; \ - $(MKDIR_P) "$(DESTDIR)$(protodir)/$$dir"; }; \ - echo " $(INSTALL_DATA) $$xfiles '$(DESTDIR)$(protodir)/$$dir'"; \ - $(INSTALL_DATA) $$xfiles "$(DESTDIR)$(protodir)/$$dir" || exit $$?; }; \ - done - -uninstall-nobase_dist_protoDATA: - @$(NORMAL_UNINSTALL) - @list='$(nobase_dist_proto_DATA)'; test -n "$(protodir)" || list=; \ - $(am__nobase_strip_setup); files=`$(am__nobase_strip)`; \ - dir='$(DESTDIR)$(protodir)'; $(am__uninstall_files_from_dir) -install-nobase_includeHEADERS: $(nobase_include_HEADERS) - @$(NORMAL_INSTALL) - @list='$(nobase_include_HEADERS)'; test -n "$(includedir)" || list=; \ - if test -n "$$list"; then \ - echo " $(MKDIR_P) '$(DESTDIR)$(includedir)'"; \ - $(MKDIR_P) "$(DESTDIR)$(includedir)" || exit 1; \ - fi; \ - $(am__nobase_list) | while read dir files; do \ - xfiles=; for file in $$files; do \ - if test -f "$$file"; then xfiles="$$xfiles $$file"; \ - else xfiles="$$xfiles $(srcdir)/$$file"; fi; done; \ - test -z "$$xfiles" || { \ - test "x$$dir" = x. || { \ - echo " $(MKDIR_P) '$(DESTDIR)$(includedir)/$$dir'"; \ - $(MKDIR_P) "$(DESTDIR)$(includedir)/$$dir"; }; \ - echo " $(INSTALL_HEADER) $$xfiles '$(DESTDIR)$(includedir)/$$dir'"; \ - $(INSTALL_HEADER) $$xfiles "$(DESTDIR)$(includedir)/$$dir" || exit $$?; }; \ - done - -uninstall-nobase_includeHEADERS: - @$(NORMAL_UNINSTALL) - @list='$(nobase_include_HEADERS)'; test -n "$(includedir)" || list=; \ - $(am__nobase_strip_setup); files=`$(am__nobase_strip)`; \ - dir='$(DESTDIR)$(includedir)'; $(am__uninstall_files_from_dir) - -ID: $(am__tagged_files) - $(am__define_uniq_tagged_files); mkid -fID $$unique -tags: tags-am -TAGS: tags - -tags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) - set x; \ - here=`pwd`; \ - $(am__define_uniq_tagged_files); \ - shift; \ - if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \ - test -n "$$unique" || unique=$$empty_fix; \ - if test $$# -gt 0; then \ - $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ - "$$@" $$unique; \ - else \ - $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ - $$unique; \ - fi; \ - fi -ctags: ctags-am - -CTAGS: ctags -ctags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) - $(am__define_uniq_tagged_files); \ - test -z "$(CTAGS_ARGS)$$unique" \ - || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ - $$unique - -GTAGS: - here=`$(am__cd) $(top_builddir) && pwd` \ - && $(am__cd) $(top_srcdir) \ - && gtags -i $(GTAGS_ARGS) "$$here" -cscopelist: cscopelist-am - -cscopelist-am: $(am__tagged_files) - list='$(am__tagged_files)'; \ - case "$(srcdir)" in \ - [\\/]* | ?:[\\/]*) sdir="$(srcdir)" ;; \ - *) sdir=$(subdir)/$(srcdir) ;; \ - esac; \ - for i in $$list; do \ - if test -f "$$i"; then \ - echo "$(subdir)/$$i"; \ - else \ - echo "$$sdir/$$i"; \ - fi; \ - done >> $(top_builddir)/cscope.files - -distclean-tags: - -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags - -# Recover from deleted '.trs' file; this should ensure that -# "rm -f foo.log; make foo.trs" re-run 'foo.test', and re-create -# both 'foo.log' and 'foo.trs'. Break the recipe in two subshells -# to avoid problems with "make -n". -.log.trs: - rm -f $< $@ - $(MAKE) $(AM_MAKEFLAGS) $< - -# Leading 'am--fnord' is there to ensure the list of targets does not -# expand to empty, as could happen e.g. with make check TESTS=''. -am--fnord $(TEST_LOGS) $(TEST_LOGS:.log=.trs): $(am__force_recheck) -am--force-recheck: - @: - -$(TEST_SUITE_LOG): $(TEST_LOGS) - @$(am__set_TESTS_bases); \ - am__f_ok () { test -f "$$1" && test -r "$$1"; }; \ - redo_bases=`for i in $$bases; do \ - am__f_ok $$i.trs && am__f_ok $$i.log || echo $$i; \ - done`; \ - if test -n "$$redo_bases"; then \ - redo_logs=`for i in $$redo_bases; do echo $$i.log; done`; \ - redo_results=`for i in $$redo_bases; do echo $$i.trs; done`; \ - if $(am__make_dryrun); then :; else \ - rm -f $$redo_logs && rm -f $$redo_results || exit 1; \ - fi; \ - fi; \ - if test -n "$$am__remaking_logs"; then \ - echo "fatal: making $(TEST_SUITE_LOG): possible infinite" \ - "recursion detected" >&2; \ - elif test -n "$$redo_logs"; then \ - am__remaking_logs=yes $(MAKE) $(AM_MAKEFLAGS) $$redo_logs; \ - fi; \ - if $(am__make_dryrun); then :; else \ - st=0; \ - errmsg="fatal: making $(TEST_SUITE_LOG): failed to create"; \ - for i in $$redo_bases; do \ - test -f $$i.trs && test -r $$i.trs \ - || { echo "$$errmsg $$i.trs" >&2; st=1; }; \ - test -f $$i.log && test -r $$i.log \ - || { echo "$$errmsg $$i.log" >&2; st=1; }; \ - done; \ - test $$st -eq 0 || exit 1; \ - fi - @$(am__sh_e_setup); $(am__tty_colors); $(am__set_TESTS_bases); \ - ws='[ ]'; \ - results=`for b in $$bases; do echo $$b.trs; done`; \ - test -n "$$results" || results=/dev/null; \ - all=` grep "^$$ws*:test-result:" $$results | wc -l`; \ - pass=` grep "^$$ws*:test-result:$$ws*PASS" $$results | wc -l`; \ - fail=` grep "^$$ws*:test-result:$$ws*FAIL" $$results | wc -l`; \ - skip=` grep "^$$ws*:test-result:$$ws*SKIP" $$results | wc -l`; \ - xfail=`grep "^$$ws*:test-result:$$ws*XFAIL" $$results | wc -l`; \ - xpass=`grep "^$$ws*:test-result:$$ws*XPASS" $$results | wc -l`; \ - error=`grep "^$$ws*:test-result:$$ws*ERROR" $$results | wc -l`; \ - if test `expr $$fail + $$xpass + $$error` -eq 0; then \ - success=true; \ - else \ - success=false; \ - fi; \ - br='==================='; br=$$br$$br$$br$$br; \ - result_count () \ - { \ - if test x"$$1" = x"--maybe-color"; then \ - maybe_colorize=yes; \ - elif test x"$$1" = x"--no-color"; then \ - maybe_colorize=no; \ - else \ - echo "$@: invalid 'result_count' usage" >&2; exit 4; \ - fi; \ - shift; \ - desc=$$1 count=$$2; \ - if test $$maybe_colorize = yes && test $$count -gt 0; then \ - color_start=$$3 color_end=$$std; \ - else \ - color_start= color_end=; \ - fi; \ - echo "$${color_start}# $$desc $$count$${color_end}"; \ - }; \ - create_testsuite_report () \ - { \ - result_count $$1 "TOTAL:" $$all "$$brg"; \ - result_count $$1 "PASS: " $$pass "$$grn"; \ - result_count $$1 "SKIP: " $$skip "$$blu"; \ - result_count $$1 "XFAIL:" $$xfail "$$lgn"; \ - result_count $$1 "FAIL: " $$fail "$$red"; \ - result_count $$1 "XPASS:" $$xpass "$$red"; \ - result_count $$1 "ERROR:" $$error "$$mgn"; \ - }; \ - { \ - echo "$(PACKAGE_STRING): $(subdir)/$(TEST_SUITE_LOG)" | \ - $(am__rst_title); \ - create_testsuite_report --no-color; \ - echo; \ - echo ".. contents:: :depth: 2"; \ - echo; \ - for b in $$bases; do echo $$b; done \ - | $(am__create_global_log); \ - } >$(TEST_SUITE_LOG).tmp || exit 1; \ - mv $(TEST_SUITE_LOG).tmp $(TEST_SUITE_LOG); \ - if $$success; then \ - col="$$grn"; \ - else \ - col="$$red"; \ - test x"$$VERBOSE" = x || cat $(TEST_SUITE_LOG); \ - fi; \ - echo "$${col}$$br$${std}"; \ - echo "$${col}Testsuite summary"$(AM_TESTSUITE_SUMMARY_HEADER)"$${std}"; \ - echo "$${col}$$br$${std}"; \ - create_testsuite_report --maybe-color; \ - echo "$$col$$br$$std"; \ - if $$success; then :; else \ - echo "$${col}See $(subdir)/$(TEST_SUITE_LOG)$${std}"; \ - if test -n "$(PACKAGE_BUGREPORT)"; then \ - echo "$${col}Please report to $(PACKAGE_BUGREPORT)$${std}"; \ - fi; \ - echo "$$col$$br$$std"; \ - fi; \ - $$success || exit 1 - -check-TESTS: $(check_PROGRAMS) - @list='$(RECHECK_LOGS)'; test -z "$$list" || rm -f $$list - @list='$(RECHECK_LOGS:.log=.trs)'; test -z "$$list" || rm -f $$list - @test -z "$(TEST_SUITE_LOG)" || rm -f $(TEST_SUITE_LOG) - @set +e; $(am__set_TESTS_bases); \ - log_list=`for i in $$bases; do echo $$i.log; done`; \ - trs_list=`for i in $$bases; do echo $$i.trs; done`; \ - log_list=`echo $$log_list`; trs_list=`echo $$trs_list`; \ - $(MAKE) $(AM_MAKEFLAGS) $(TEST_SUITE_LOG) TEST_LOGS="$$log_list"; \ - exit $$?; -recheck: all $(check_PROGRAMS) - @test -z "$(TEST_SUITE_LOG)" || rm -f $(TEST_SUITE_LOG) - @set +e; $(am__set_TESTS_bases); \ - bases=`for i in $$bases; do echo $$i; done \ - | $(am__list_recheck_tests)` || exit 1; \ - log_list=`for i in $$bases; do echo $$i.log; done`; \ - log_list=`echo $$log_list`; \ - $(MAKE) $(AM_MAKEFLAGS) $(TEST_SUITE_LOG) \ - am__force_recheck=am--force-recheck \ - TEST_LOGS="$$log_list"; \ - exit $$? -protobuf-test.log: protobuf-test$(EXEEXT) - @p='protobuf-test$(EXEEXT)'; \ - b='protobuf-test'; \ - $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \ - --log-file $$b.log --trs-file $$b.trs \ - $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \ - "$$tst" $(AM_TESTS_FD_REDIRECT) -protobuf-lazy-descriptor-test.log: protobuf-lazy-descriptor-test$(EXEEXT) - @p='protobuf-lazy-descriptor-test$(EXEEXT)'; \ - b='protobuf-lazy-descriptor-test'; \ - $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \ - --log-file $$b.log --trs-file $$b.trs \ - $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \ - "$$tst" $(AM_TESTS_FD_REDIRECT) -protobuf-lite-test.log: protobuf-lite-test$(EXEEXT) - @p='protobuf-lite-test$(EXEEXT)'; \ - b='protobuf-lite-test'; \ - $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \ - --log-file $$b.log --trs-file $$b.trs \ - $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \ - "$$tst" $(AM_TESTS_FD_REDIRECT) -google/protobuf/compiler/zip_output_unittest.sh.log: google/protobuf/compiler/zip_output_unittest.sh - @p='google/protobuf/compiler/zip_output_unittest.sh'; \ - b='google/protobuf/compiler/zip_output_unittest.sh'; \ - $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \ - --log-file $$b.log --trs-file $$b.trs \ - $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \ - "$$tst" $(AM_TESTS_FD_REDIRECT) -google/protobuf/io/gzip_stream_unittest.sh.log: google/protobuf/io/gzip_stream_unittest.sh - @p='google/protobuf/io/gzip_stream_unittest.sh'; \ - b='google/protobuf/io/gzip_stream_unittest.sh'; \ - $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \ - --log-file $$b.log --trs-file $$b.trs \ - $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \ - "$$tst" $(AM_TESTS_FD_REDIRECT) -protobuf-lite-arena-test.log: protobuf-lite-arena-test$(EXEEXT) - @p='protobuf-lite-arena-test$(EXEEXT)'; \ - b='protobuf-lite-arena-test'; \ - $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \ - --log-file $$b.log --trs-file $$b.trs \ - $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \ - "$$tst" $(AM_TESTS_FD_REDIRECT) -no-warning-test.log: no-warning-test$(EXEEXT) - @p='no-warning-test$(EXEEXT)'; \ - b='no-warning-test'; \ - $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \ - --log-file $$b.log --trs-file $$b.trs \ - $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \ - "$$tst" $(AM_TESTS_FD_REDIRECT) -.test.log: - @p='$<'; \ - $(am__set_b); \ - $(am__check_pre) $(TEST_LOG_DRIVER) --test-name "$$f" \ - --log-file $$b.log --trs-file $$b.trs \ - $(am__common_driver_flags) $(AM_TEST_LOG_DRIVER_FLAGS) $(TEST_LOG_DRIVER_FLAGS) -- $(TEST_LOG_COMPILE) \ - "$$tst" $(AM_TESTS_FD_REDIRECT) -@am__EXEEXT_TRUE@.test$(EXEEXT).log: -@am__EXEEXT_TRUE@ @p='$<'; \ -@am__EXEEXT_TRUE@ $(am__set_b); \ -@am__EXEEXT_TRUE@ $(am__check_pre) $(TEST_LOG_DRIVER) --test-name "$$f" \ -@am__EXEEXT_TRUE@ --log-file $$b.log --trs-file $$b.trs \ -@am__EXEEXT_TRUE@ $(am__common_driver_flags) $(AM_TEST_LOG_DRIVER_FLAGS) $(TEST_LOG_DRIVER_FLAGS) -- $(TEST_LOG_COMPILE) \ -@am__EXEEXT_TRUE@ "$$tst" $(AM_TESTS_FD_REDIRECT) -distdir: $(BUILT_SOURCES) - $(MAKE) $(AM_MAKEFLAGS) distdir-am - -distdir-am: $(DISTFILES) - @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ - topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ - list='$(DISTFILES)'; \ - dist_files=`for file in $$list; do echo $$file; done | \ - sed -e "s|^$$srcdirstrip/||;t" \ - -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ - case $$dist_files in \ - */*) $(MKDIR_P) `echo "$$dist_files" | \ - sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ - sort -u` ;; \ - esac; \ - for file in $$dist_files; do \ - if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ - if test -d $$d/$$file; then \ - dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ - if test -d "$(distdir)/$$file"; then \ - find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ - fi; \ - if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ - cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ - find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ - fi; \ - cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ - else \ - test -f "$(distdir)/$$file" \ - || cp -p $$d/$$file "$(distdir)/$$file" \ - || exit 1; \ - fi; \ - done -check-am: all-am - $(MAKE) $(AM_MAKEFLAGS) $(check_PROGRAMS) - $(MAKE) $(AM_MAKEFLAGS) check-TESTS -check: check-am -all-am: Makefile $(PROGRAMS) $(LTLIBRARIES) $(DATA) $(HEADERS) -install-binPROGRAMS: install-libLTLIBRARIES - -install-checkPROGRAMS: install-libLTLIBRARIES - -installdirs: - for dir in "$(DESTDIR)$(bindir)" "$(DESTDIR)$(libdir)" "$(DESTDIR)$(protodir)" "$(DESTDIR)$(includedir)"; do \ - test -z "$$dir" || $(MKDIR_P) "$$dir"; \ - done -install: install-am -install-exec: install-exec-am -install-data: install-data-am -uninstall: uninstall-am - -install-am: all-am - @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am - -installcheck: installcheck-am -install-strip: - if test -z '$(STRIP)'; then \ - $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ - install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ - install; \ - else \ - $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ - install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ - "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \ - fi -mostlyclean-generic: - -test -z "$(TEST_LOGS)" || rm -f $(TEST_LOGS) - -test -z "$(TEST_LOGS:.log=.trs)" || rm -f $(TEST_LOGS:.log=.trs) - -test -z "$(TEST_SUITE_LOG)" || rm -f $(TEST_SUITE_LOG) - -clean-generic: - -test -z "$(CLEANFILES)" || rm -f $(CLEANFILES) - -distclean-generic: - -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) - -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) - -rm -f google/protobuf/$(DEPDIR)/$(am__dirstamp) - -rm -f google/protobuf/$(am__dirstamp) - -rm -f google/protobuf/compiler/$(DEPDIR)/$(am__dirstamp) - -rm -f google/protobuf/compiler/$(am__dirstamp) - -rm -f google/protobuf/compiler/cpp/$(DEPDIR)/$(am__dirstamp) - -rm -f google/protobuf/compiler/cpp/$(am__dirstamp) - -rm -f google/protobuf/compiler/csharp/$(DEPDIR)/$(am__dirstamp) - -rm -f google/protobuf/compiler/csharp/$(am__dirstamp) - -rm -f google/protobuf/compiler/java/$(DEPDIR)/$(am__dirstamp) - -rm -f google/protobuf/compiler/java/$(am__dirstamp) - -rm -f google/protobuf/compiler/js/$(DEPDIR)/$(am__dirstamp) - -rm -f google/protobuf/compiler/js/$(am__dirstamp) - -rm -f google/protobuf/compiler/objectivec/$(DEPDIR)/$(am__dirstamp) - -rm -f google/protobuf/compiler/objectivec/$(am__dirstamp) - -rm -f google/protobuf/compiler/php/$(DEPDIR)/$(am__dirstamp) - -rm -f google/protobuf/compiler/php/$(am__dirstamp) - -rm -f google/protobuf/compiler/python/$(DEPDIR)/$(am__dirstamp) - -rm -f google/protobuf/compiler/python/$(am__dirstamp) - -rm -f google/protobuf/compiler/ruby/$(DEPDIR)/$(am__dirstamp) - -rm -f google/protobuf/compiler/ruby/$(am__dirstamp) - -rm -f google/protobuf/io/$(DEPDIR)/$(am__dirstamp) - -rm -f google/protobuf/io/$(am__dirstamp) - -rm -f google/protobuf/stubs/$(DEPDIR)/$(am__dirstamp) - -rm -f google/protobuf/stubs/$(am__dirstamp) - -rm -f google/protobuf/testing/$(DEPDIR)/$(am__dirstamp) - -rm -f google/protobuf/testing/$(am__dirstamp) - -rm -f google/protobuf/util/$(DEPDIR)/$(am__dirstamp) - -rm -f google/protobuf/util/$(am__dirstamp) - -rm -f google/protobuf/util/internal/$(DEPDIR)/$(am__dirstamp) - -rm -f google/protobuf/util/internal/$(am__dirstamp) - -rm -f google/protobuf/util/internal/testdata/$(DEPDIR)/$(am__dirstamp) - -rm -f google/protobuf/util/internal/testdata/$(am__dirstamp) - -maintainer-clean-generic: - @echo "This command is intended for maintainers to use" - @echo "it deletes files that may require special tools to rebuild." - -test -z "$(MAINTAINERCLEANFILES)" || rm -f $(MAINTAINERCLEANFILES) -clean: clean-am - -clean-am: clean-binPROGRAMS clean-checkPROGRAMS clean-generic \ - clean-libLTLIBRARIES clean-libtool clean-local mostlyclean-am - -distclean: distclean-am - -rm -f ./$(DEPDIR)/no_warning_test-no_warning_test.Po - -rm -f google/protobuf/$(DEPDIR)/any.Plo - -rm -f google/protobuf/$(DEPDIR)/any.pb.Plo - -rm -f google/protobuf/$(DEPDIR)/any_lite.Plo - -rm -f google/protobuf/$(DEPDIR)/api.pb.Plo - -rm -f google/protobuf/$(DEPDIR)/arena.Plo - -rm -f google/protobuf/$(DEPDIR)/arenastring.Plo - -rm -f google/protobuf/$(DEPDIR)/descriptor.Plo - -rm -f google/protobuf/$(DEPDIR)/descriptor.pb.Plo - -rm -f google/protobuf/$(DEPDIR)/descriptor_database.Plo - -rm -f google/protobuf/$(DEPDIR)/duration.pb.Plo - -rm -f google/protobuf/$(DEPDIR)/dynamic_message.Plo - -rm -f google/protobuf/$(DEPDIR)/empty.pb.Plo - -rm -f google/protobuf/$(DEPDIR)/extension_set.Plo - -rm -f google/protobuf/$(DEPDIR)/extension_set_heavy.Plo - -rm -f google/protobuf/$(DEPDIR)/field_mask.pb.Plo - -rm -f google/protobuf/$(DEPDIR)/generated_enum_util.Plo - -rm -f google/protobuf/$(DEPDIR)/generated_message_bases.Plo - -rm -f google/protobuf/$(DEPDIR)/generated_message_reflection.Plo - -rm -f google/protobuf/$(DEPDIR)/generated_message_table_driven.Plo - -rm -f google/protobuf/$(DEPDIR)/generated_message_table_driven_lite.Plo - -rm -f google/protobuf/$(DEPDIR)/generated_message_tctable_full.Plo - -rm -f google/protobuf/$(DEPDIR)/generated_message_tctable_lite.Plo - -rm -f google/protobuf/$(DEPDIR)/generated_message_util.Plo - -rm -f google/protobuf/$(DEPDIR)/implicit_weak_message.Plo - -rm -f google/protobuf/$(DEPDIR)/inlined_string_field.Plo - -rm -f google/protobuf/$(DEPDIR)/map.Plo - -rm -f google/protobuf/$(DEPDIR)/map_field.Plo - -rm -f google/protobuf/$(DEPDIR)/message.Plo - -rm -f google/protobuf/$(DEPDIR)/message_lite.Plo - -rm -f google/protobuf/$(DEPDIR)/no_warning_test-any_test.pb.Po - -rm -f google/protobuf/$(DEPDIR)/no_warning_test-map_lite_unittest.pb.Po - -rm -f google/protobuf/$(DEPDIR)/no_warning_test-map_proto2_unittest.pb.Po - -rm -f google/protobuf/$(DEPDIR)/no_warning_test-map_unittest.pb.Po - -rm -f google/protobuf/$(DEPDIR)/no_warning_test-unittest.pb.Po - -rm -f google/protobuf/$(DEPDIR)/no_warning_test-unittest_arena.pb.Po - -rm -f google/protobuf/$(DEPDIR)/no_warning_test-unittest_custom_options.pb.Po - -rm -f google/protobuf/$(DEPDIR)/no_warning_test-unittest_drop_unknown_fields.pb.Po - -rm -f google/protobuf/$(DEPDIR)/no_warning_test-unittest_embed_optimize_for.pb.Po - -rm -f google/protobuf/$(DEPDIR)/no_warning_test-unittest_empty.pb.Po - -rm -f google/protobuf/$(DEPDIR)/no_warning_test-unittest_enormous_descriptor.pb.Po - -rm -f google/protobuf/$(DEPDIR)/no_warning_test-unittest_import.pb.Po - -rm -f google/protobuf/$(DEPDIR)/no_warning_test-unittest_import_lite.pb.Po - -rm -f google/protobuf/$(DEPDIR)/no_warning_test-unittest_import_public.pb.Po - -rm -f google/protobuf/$(DEPDIR)/no_warning_test-unittest_import_public_lite.pb.Po - -rm -f google/protobuf/$(DEPDIR)/no_warning_test-unittest_lazy_dependencies.pb.Po - -rm -f google/protobuf/$(DEPDIR)/no_warning_test-unittest_lazy_dependencies_custom_option.pb.Po - -rm -f google/protobuf/$(DEPDIR)/no_warning_test-unittest_lazy_dependencies_enum.pb.Po - -rm -f google/protobuf/$(DEPDIR)/no_warning_test-unittest_lite.pb.Po - -rm -f google/protobuf/$(DEPDIR)/no_warning_test-unittest_lite_imports_nonlite.pb.Po - -rm -f google/protobuf/$(DEPDIR)/no_warning_test-unittest_mset.pb.Po - -rm -f google/protobuf/$(DEPDIR)/no_warning_test-unittest_mset_wire_format.pb.Po - -rm -f google/protobuf/$(DEPDIR)/no_warning_test-unittest_no_field_presence.pb.Po - -rm -f google/protobuf/$(DEPDIR)/no_warning_test-unittest_no_generic_services.pb.Po - -rm -f google/protobuf/$(DEPDIR)/no_warning_test-unittest_optimize_for.pb.Po - -rm -f google/protobuf/$(DEPDIR)/no_warning_test-unittest_preserve_unknown_enum.pb.Po - -rm -f google/protobuf/$(DEPDIR)/no_warning_test-unittest_preserve_unknown_enum2.pb.Po - -rm -f google/protobuf/$(DEPDIR)/no_warning_test-unittest_proto3.pb.Po - -rm -f google/protobuf/$(DEPDIR)/no_warning_test-unittest_proto3_arena.pb.Po - -rm -f google/protobuf/$(DEPDIR)/no_warning_test-unittest_proto3_arena_lite.pb.Po - -rm -f google/protobuf/$(DEPDIR)/no_warning_test-unittest_proto3_lite.pb.Po - -rm -f google/protobuf/$(DEPDIR)/no_warning_test-unittest_proto3_optional.pb.Po - -rm -f google/protobuf/$(DEPDIR)/no_warning_test-unittest_well_known_types.pb.Po - -rm -f google/protobuf/$(DEPDIR)/parse_context.Plo - -rm -f google/protobuf/$(DEPDIR)/protobuf_lazy_descriptor_test-any_test.pb.Po - -rm -f google/protobuf/$(DEPDIR)/protobuf_lazy_descriptor_test-arena_test_util.Po - -rm -f google/protobuf/$(DEPDIR)/protobuf_lazy_descriptor_test-map_lite_test_util.Po - -rm -f google/protobuf/$(DEPDIR)/protobuf_lazy_descriptor_test-map_lite_unittest.pb.Po - -rm -f google/protobuf/$(DEPDIR)/protobuf_lazy_descriptor_test-map_proto2_unittest.pb.Po - -rm -f google/protobuf/$(DEPDIR)/protobuf_lazy_descriptor_test-map_unittest.pb.Po - -rm -f google/protobuf/$(DEPDIR)/protobuf_lazy_descriptor_test-reflection_tester.Po - -rm -f google/protobuf/$(DEPDIR)/protobuf_lazy_descriptor_test-test_util.Po - -rm -f google/protobuf/$(DEPDIR)/protobuf_lazy_descriptor_test-test_util_lite.Po - -rm -f google/protobuf/$(DEPDIR)/protobuf_lazy_descriptor_test-unittest.pb.Po - -rm -f google/protobuf/$(DEPDIR)/protobuf_lazy_descriptor_test-unittest_arena.pb.Po - -rm -f google/protobuf/$(DEPDIR)/protobuf_lazy_descriptor_test-unittest_custom_options.pb.Po - -rm -f google/protobuf/$(DEPDIR)/protobuf_lazy_descriptor_test-unittest_drop_unknown_fields.pb.Po - -rm -f google/protobuf/$(DEPDIR)/protobuf_lazy_descriptor_test-unittest_embed_optimize_for.pb.Po - -rm -f google/protobuf/$(DEPDIR)/protobuf_lazy_descriptor_test-unittest_empty.pb.Po - -rm -f google/protobuf/$(DEPDIR)/protobuf_lazy_descriptor_test-unittest_enormous_descriptor.pb.Po - -rm -f google/protobuf/$(DEPDIR)/protobuf_lazy_descriptor_test-unittest_import.pb.Po - -rm -f google/protobuf/$(DEPDIR)/protobuf_lazy_descriptor_test-unittest_import_lite.pb.Po - -rm -f google/protobuf/$(DEPDIR)/protobuf_lazy_descriptor_test-unittest_import_public.pb.Po - -rm -f google/protobuf/$(DEPDIR)/protobuf_lazy_descriptor_test-unittest_import_public_lite.pb.Po - -rm -f google/protobuf/$(DEPDIR)/protobuf_lazy_descriptor_test-unittest_lazy_dependencies.pb.Po - -rm -f google/protobuf/$(DEPDIR)/protobuf_lazy_descriptor_test-unittest_lazy_dependencies_custom_option.pb.Po - -rm -f google/protobuf/$(DEPDIR)/protobuf_lazy_descriptor_test-unittest_lazy_dependencies_enum.pb.Po - -rm -f google/protobuf/$(DEPDIR)/protobuf_lazy_descriptor_test-unittest_lite.pb.Po - -rm -f google/protobuf/$(DEPDIR)/protobuf_lazy_descriptor_test-unittest_lite_imports_nonlite.pb.Po - -rm -f google/protobuf/$(DEPDIR)/protobuf_lazy_descriptor_test-unittest_mset.pb.Po - -rm -f google/protobuf/$(DEPDIR)/protobuf_lazy_descriptor_test-unittest_mset_wire_format.pb.Po - -rm -f google/protobuf/$(DEPDIR)/protobuf_lazy_descriptor_test-unittest_no_field_presence.pb.Po - -rm -f google/protobuf/$(DEPDIR)/protobuf_lazy_descriptor_test-unittest_no_generic_services.pb.Po - -rm -f google/protobuf/$(DEPDIR)/protobuf_lazy_descriptor_test-unittest_optimize_for.pb.Po - -rm -f google/protobuf/$(DEPDIR)/protobuf_lazy_descriptor_test-unittest_preserve_unknown_enum.pb.Po - -rm -f google/protobuf/$(DEPDIR)/protobuf_lazy_descriptor_test-unittest_preserve_unknown_enum2.pb.Po - -rm -f google/protobuf/$(DEPDIR)/protobuf_lazy_descriptor_test-unittest_proto3.pb.Po - -rm -f google/protobuf/$(DEPDIR)/protobuf_lazy_descriptor_test-unittest_proto3_arena.pb.Po - -rm -f google/protobuf/$(DEPDIR)/protobuf_lazy_descriptor_test-unittest_proto3_arena_lite.pb.Po - -rm -f google/protobuf/$(DEPDIR)/protobuf_lazy_descriptor_test-unittest_proto3_lite.pb.Po - -rm -f google/protobuf/$(DEPDIR)/protobuf_lazy_descriptor_test-unittest_proto3_optional.pb.Po - -rm -f google/protobuf/$(DEPDIR)/protobuf_lazy_descriptor_test-unittest_well_known_types.pb.Po - -rm -f google/protobuf/$(DEPDIR)/protobuf_lite_arena_test-arena_test_util.Po - -rm -f google/protobuf/$(DEPDIR)/protobuf_lite_arena_test-lite_arena_unittest.Po - -rm -f google/protobuf/$(DEPDIR)/protobuf_lite_arena_test-map_lite_test_util.Po - -rm -f google/protobuf/$(DEPDIR)/protobuf_lite_arena_test-map_lite_unittest.pb.Po - -rm -f google/protobuf/$(DEPDIR)/protobuf_lite_arena_test-test_util_lite.Po - -rm -f google/protobuf/$(DEPDIR)/protobuf_lite_arena_test-unittest_import_lite.pb.Po - -rm -f google/protobuf/$(DEPDIR)/protobuf_lite_arena_test-unittest_import_public_lite.pb.Po - -rm -f google/protobuf/$(DEPDIR)/protobuf_lite_arena_test-unittest_lite.pb.Po - -rm -f google/protobuf/$(DEPDIR)/protobuf_lite_test-arena_test_util.Po - -rm -f google/protobuf/$(DEPDIR)/protobuf_lite_test-lite_unittest.Po - -rm -f google/protobuf/$(DEPDIR)/protobuf_lite_test-map_lite_test_util.Po - -rm -f google/protobuf/$(DEPDIR)/protobuf_lite_test-map_lite_unittest.pb.Po - -rm -f google/protobuf/$(DEPDIR)/protobuf_lite_test-test_util_lite.Po - -rm -f google/protobuf/$(DEPDIR)/protobuf_lite_test-unittest_import_lite.pb.Po - -rm -f google/protobuf/$(DEPDIR)/protobuf_lite_test-unittest_import_public_lite.pb.Po - -rm -f google/protobuf/$(DEPDIR)/protobuf_lite_test-unittest_lite.pb.Po - -rm -f google/protobuf/$(DEPDIR)/protobuf_test-any_test.Po - -rm -f google/protobuf/$(DEPDIR)/protobuf_test-any_test.pb.Po - -rm -f google/protobuf/$(DEPDIR)/protobuf_test-arena_test_util.Po - -rm -f google/protobuf/$(DEPDIR)/protobuf_test-arena_unittest.Po - -rm -f google/protobuf/$(DEPDIR)/protobuf_test-arenastring_unittest.Po - -rm -f google/protobuf/$(DEPDIR)/protobuf_test-descriptor_database_unittest.Po - -rm -f google/protobuf/$(DEPDIR)/protobuf_test-descriptor_unittest.Po - -rm -f google/protobuf/$(DEPDIR)/protobuf_test-drop_unknown_fields_test.Po - -rm -f google/protobuf/$(DEPDIR)/protobuf_test-dynamic_message_unittest.Po - -rm -f google/protobuf/$(DEPDIR)/protobuf_test-extension_set_unittest.Po - -rm -f google/protobuf/$(DEPDIR)/protobuf_test-generated_message_reflection_unittest.Po - -rm -f google/protobuf/$(DEPDIR)/protobuf_test-inlined_string_field_unittest.Po - -rm -f google/protobuf/$(DEPDIR)/protobuf_test-map_field_test.Po - -rm -f google/protobuf/$(DEPDIR)/protobuf_test-map_lite_test_util.Po - -rm -f google/protobuf/$(DEPDIR)/protobuf_test-map_lite_unittest.pb.Po - -rm -f google/protobuf/$(DEPDIR)/protobuf_test-map_proto2_unittest.pb.Po - -rm -f google/protobuf/$(DEPDIR)/protobuf_test-map_test.Po - -rm -f google/protobuf/$(DEPDIR)/protobuf_test-map_unittest.pb.Po - -rm -f google/protobuf/$(DEPDIR)/protobuf_test-message_unittest.Po - -rm -f google/protobuf/$(DEPDIR)/protobuf_test-no_field_presence_test.Po - -rm -f google/protobuf/$(DEPDIR)/protobuf_test-preserve_unknown_enum_test.Po - -rm -f google/protobuf/$(DEPDIR)/protobuf_test-proto3_arena_lite_unittest.Po - -rm -f google/protobuf/$(DEPDIR)/protobuf_test-proto3_arena_unittest.Po - -rm -f google/protobuf/$(DEPDIR)/protobuf_test-proto3_lite_unittest.Po - -rm -f google/protobuf/$(DEPDIR)/protobuf_test-reflection_ops_unittest.Po - -rm -f google/protobuf/$(DEPDIR)/protobuf_test-reflection_tester.Po - -rm -f google/protobuf/$(DEPDIR)/protobuf_test-repeated_field_reflection_unittest.Po - -rm -f google/protobuf/$(DEPDIR)/protobuf_test-repeated_field_unittest.Po - -rm -f google/protobuf/$(DEPDIR)/protobuf_test-test_util.Po - -rm -f google/protobuf/$(DEPDIR)/protobuf_test-test_util_lite.Po - -rm -f google/protobuf/$(DEPDIR)/protobuf_test-text_format_unittest.Po - -rm -f google/protobuf/$(DEPDIR)/protobuf_test-unittest.pb.Po - -rm -f google/protobuf/$(DEPDIR)/protobuf_test-unittest_arena.pb.Po - -rm -f google/protobuf/$(DEPDIR)/protobuf_test-unittest_custom_options.pb.Po - -rm -f google/protobuf/$(DEPDIR)/protobuf_test-unittest_drop_unknown_fields.pb.Po - -rm -f google/protobuf/$(DEPDIR)/protobuf_test-unittest_embed_optimize_for.pb.Po - -rm -f google/protobuf/$(DEPDIR)/protobuf_test-unittest_empty.pb.Po - -rm -f google/protobuf/$(DEPDIR)/protobuf_test-unittest_enormous_descriptor.pb.Po - -rm -f google/protobuf/$(DEPDIR)/protobuf_test-unittest_import.pb.Po - -rm -f google/protobuf/$(DEPDIR)/protobuf_test-unittest_import_lite.pb.Po - -rm -f google/protobuf/$(DEPDIR)/protobuf_test-unittest_import_public.pb.Po - -rm -f google/protobuf/$(DEPDIR)/protobuf_test-unittest_import_public_lite.pb.Po - -rm -f google/protobuf/$(DEPDIR)/protobuf_test-unittest_lazy_dependencies.pb.Po - -rm -f google/protobuf/$(DEPDIR)/protobuf_test-unittest_lazy_dependencies_custom_option.pb.Po - -rm -f google/protobuf/$(DEPDIR)/protobuf_test-unittest_lazy_dependencies_enum.pb.Po - -rm -f google/protobuf/$(DEPDIR)/protobuf_test-unittest_lite.pb.Po - -rm -f google/protobuf/$(DEPDIR)/protobuf_test-unittest_lite_imports_nonlite.pb.Po - -rm -f google/protobuf/$(DEPDIR)/protobuf_test-unittest_mset.pb.Po - -rm -f google/protobuf/$(DEPDIR)/protobuf_test-unittest_mset_wire_format.pb.Po - -rm -f google/protobuf/$(DEPDIR)/protobuf_test-unittest_no_field_presence.pb.Po - -rm -f google/protobuf/$(DEPDIR)/protobuf_test-unittest_no_generic_services.pb.Po - -rm -f google/protobuf/$(DEPDIR)/protobuf_test-unittest_optimize_for.pb.Po - -rm -f google/protobuf/$(DEPDIR)/protobuf_test-unittest_preserve_unknown_enum.pb.Po - -rm -f google/protobuf/$(DEPDIR)/protobuf_test-unittest_preserve_unknown_enum2.pb.Po - -rm -f google/protobuf/$(DEPDIR)/protobuf_test-unittest_proto3.pb.Po - -rm -f google/protobuf/$(DEPDIR)/protobuf_test-unittest_proto3_arena.pb.Po - -rm -f google/protobuf/$(DEPDIR)/protobuf_test-unittest_proto3_arena_lite.pb.Po - -rm -f google/protobuf/$(DEPDIR)/protobuf_test-unittest_proto3_lite.pb.Po - -rm -f google/protobuf/$(DEPDIR)/protobuf_test-unittest_proto3_optional.pb.Po - -rm -f google/protobuf/$(DEPDIR)/protobuf_test-unittest_well_known_types.pb.Po - -rm -f google/protobuf/$(DEPDIR)/protobuf_test-unknown_field_set_unittest.Po - -rm -f google/protobuf/$(DEPDIR)/protobuf_test-well_known_types_unittest.Po - -rm -f google/protobuf/$(DEPDIR)/protobuf_test-wire_format_unittest.Po - -rm -f google/protobuf/$(DEPDIR)/reflection_ops.Plo - -rm -f google/protobuf/$(DEPDIR)/repeated_field.Plo - -rm -f google/protobuf/$(DEPDIR)/repeated_ptr_field.Plo - -rm -f google/protobuf/$(DEPDIR)/service.Plo - -rm -f google/protobuf/$(DEPDIR)/source_context.pb.Plo - -rm -f google/protobuf/$(DEPDIR)/struct.pb.Plo - -rm -f google/protobuf/$(DEPDIR)/text_format.Plo - -rm -f google/protobuf/$(DEPDIR)/timestamp.pb.Plo - -rm -f google/protobuf/$(DEPDIR)/type.pb.Plo - -rm -f google/protobuf/$(DEPDIR)/unknown_field_set.Plo - -rm -f google/protobuf/$(DEPDIR)/wire_format.Plo - -rm -f google/protobuf/$(DEPDIR)/wire_format_lite.Plo - -rm -f google/protobuf/$(DEPDIR)/wrappers.pb.Plo - -rm -f google/protobuf/compiler/$(DEPDIR)/code_generator.Plo - -rm -f google/protobuf/compiler/$(DEPDIR)/command_line_interface.Plo - -rm -f google/protobuf/compiler/$(DEPDIR)/importer.Plo - -rm -f google/protobuf/compiler/$(DEPDIR)/main.Po - -rm -f google/protobuf/compiler/$(DEPDIR)/parser.Plo - -rm -f google/protobuf/compiler/$(DEPDIR)/plugin.Plo - -rm -f google/protobuf/compiler/$(DEPDIR)/plugin.pb.Plo - -rm -f google/protobuf/compiler/$(DEPDIR)/protobuf_test-annotation_test_util.Po - -rm -f google/protobuf/compiler/$(DEPDIR)/protobuf_test-command_line_interface_unittest.Po - -rm -f google/protobuf/compiler/$(DEPDIR)/protobuf_test-importer_unittest.Po - -rm -f google/protobuf/compiler/$(DEPDIR)/protobuf_test-mock_code_generator.Po - -rm -f google/protobuf/compiler/$(DEPDIR)/protobuf_test-parser_unittest.Po - -rm -f google/protobuf/compiler/$(DEPDIR)/subprocess.Plo - -rm -f google/protobuf/compiler/$(DEPDIR)/test_plugin-mock_code_generator.Po - -rm -f google/protobuf/compiler/$(DEPDIR)/test_plugin-test_plugin.Po - -rm -f google/protobuf/compiler/$(DEPDIR)/zip_writer.Plo - -rm -f google/protobuf/compiler/cpp/$(DEPDIR)/cpp_enum.Plo - -rm -f google/protobuf/compiler/cpp/$(DEPDIR)/cpp_enum_field.Plo - -rm -f google/protobuf/compiler/cpp/$(DEPDIR)/cpp_extension.Plo - -rm -f google/protobuf/compiler/cpp/$(DEPDIR)/cpp_field.Plo - -rm -f google/protobuf/compiler/cpp/$(DEPDIR)/cpp_file.Plo - -rm -f google/protobuf/compiler/cpp/$(DEPDIR)/cpp_generator.Plo - -rm -f google/protobuf/compiler/cpp/$(DEPDIR)/cpp_helpers.Plo - -rm -f google/protobuf/compiler/cpp/$(DEPDIR)/cpp_map_field.Plo - -rm -f google/protobuf/compiler/cpp/$(DEPDIR)/cpp_message.Plo - -rm -f google/protobuf/compiler/cpp/$(DEPDIR)/cpp_message_field.Plo - -rm -f google/protobuf/compiler/cpp/$(DEPDIR)/cpp_padding_optimizer.Plo - -rm -f google/protobuf/compiler/cpp/$(DEPDIR)/cpp_parse_function_generator.Plo - -rm -f google/protobuf/compiler/cpp/$(DEPDIR)/cpp_primitive_field.Plo - -rm -f google/protobuf/compiler/cpp/$(DEPDIR)/cpp_service.Plo - -rm -f google/protobuf/compiler/cpp/$(DEPDIR)/cpp_string_field.Plo - -rm -f google/protobuf/compiler/cpp/$(DEPDIR)/no_warning_test-cpp_test_bad_identifiers.pb.Po - -rm -f google/protobuf/compiler/cpp/$(DEPDIR)/no_warning_test-cpp_test_large_enum_value.pb.Po - -rm -f google/protobuf/compiler/cpp/$(DEPDIR)/protobuf_lazy_descriptor_test-cpp_test_bad_identifiers.pb.Po - -rm -f google/protobuf/compiler/cpp/$(DEPDIR)/protobuf_lazy_descriptor_test-cpp_test_large_enum_value.pb.Po - -rm -f google/protobuf/compiler/cpp/$(DEPDIR)/protobuf_lazy_descriptor_test-cpp_unittest.Po - -rm -f google/protobuf/compiler/cpp/$(DEPDIR)/protobuf_test-cpp_bootstrap_unittest.Po - -rm -f google/protobuf/compiler/cpp/$(DEPDIR)/protobuf_test-cpp_move_unittest.Po - -rm -f google/protobuf/compiler/cpp/$(DEPDIR)/protobuf_test-cpp_plugin_unittest.Po - -rm -f google/protobuf/compiler/cpp/$(DEPDIR)/protobuf_test-cpp_test_bad_identifiers.pb.Po - -rm -f google/protobuf/compiler/cpp/$(DEPDIR)/protobuf_test-cpp_test_large_enum_value.pb.Po - -rm -f google/protobuf/compiler/cpp/$(DEPDIR)/protobuf_test-cpp_unittest.Po - -rm -f google/protobuf/compiler/cpp/$(DEPDIR)/protobuf_test-metadata_test.Po - -rm -f google/protobuf/compiler/csharp/$(DEPDIR)/csharp_doc_comment.Plo - -rm -f google/protobuf/compiler/csharp/$(DEPDIR)/csharp_enum.Plo - -rm -f google/protobuf/compiler/csharp/$(DEPDIR)/csharp_enum_field.Plo - -rm -f google/protobuf/compiler/csharp/$(DEPDIR)/csharp_field_base.Plo - -rm -f google/protobuf/compiler/csharp/$(DEPDIR)/csharp_generator.Plo - -rm -f google/protobuf/compiler/csharp/$(DEPDIR)/csharp_helpers.Plo - -rm -f google/protobuf/compiler/csharp/$(DEPDIR)/csharp_map_field.Plo - -rm -f google/protobuf/compiler/csharp/$(DEPDIR)/csharp_message.Plo - -rm -f google/protobuf/compiler/csharp/$(DEPDIR)/csharp_message_field.Plo - -rm -f google/protobuf/compiler/csharp/$(DEPDIR)/csharp_primitive_field.Plo - -rm -f google/protobuf/compiler/csharp/$(DEPDIR)/csharp_reflection_class.Plo - -rm -f google/protobuf/compiler/csharp/$(DEPDIR)/csharp_repeated_enum_field.Plo - -rm -f google/protobuf/compiler/csharp/$(DEPDIR)/csharp_repeated_message_field.Plo - -rm -f google/protobuf/compiler/csharp/$(DEPDIR)/csharp_repeated_primitive_field.Plo - -rm -f google/protobuf/compiler/csharp/$(DEPDIR)/csharp_source_generator_base.Plo - -rm -f google/protobuf/compiler/csharp/$(DEPDIR)/csharp_wrapper_field.Plo - -rm -f google/protobuf/compiler/csharp/$(DEPDIR)/protobuf_test-csharp_bootstrap_unittest.Po - -rm -f google/protobuf/compiler/csharp/$(DEPDIR)/protobuf_test-csharp_generator_unittest.Po - -rm -f google/protobuf/compiler/java/$(DEPDIR)/java_context.Plo - -rm -f google/protobuf/compiler/java/$(DEPDIR)/java_doc_comment.Plo - -rm -f google/protobuf/compiler/java/$(DEPDIR)/java_enum.Plo - -rm -f google/protobuf/compiler/java/$(DEPDIR)/java_enum_field.Plo - -rm -f google/protobuf/compiler/java/$(DEPDIR)/java_enum_field_lite.Plo - -rm -f google/protobuf/compiler/java/$(DEPDIR)/java_enum_lite.Plo - -rm -f google/protobuf/compiler/java/$(DEPDIR)/java_extension.Plo - -rm -f google/protobuf/compiler/java/$(DEPDIR)/java_extension_lite.Plo - -rm -f google/protobuf/compiler/java/$(DEPDIR)/java_field.Plo - -rm -f google/protobuf/compiler/java/$(DEPDIR)/java_file.Plo - -rm -f google/protobuf/compiler/java/$(DEPDIR)/java_generator.Plo - -rm -f google/protobuf/compiler/java/$(DEPDIR)/java_generator_factory.Plo - -rm -f google/protobuf/compiler/java/$(DEPDIR)/java_helpers.Plo - -rm -f google/protobuf/compiler/java/$(DEPDIR)/java_kotlin_generator.Plo - -rm -f google/protobuf/compiler/java/$(DEPDIR)/java_map_field.Plo - -rm -f google/protobuf/compiler/java/$(DEPDIR)/java_map_field_lite.Plo - -rm -f google/protobuf/compiler/java/$(DEPDIR)/java_message.Plo - -rm -f google/protobuf/compiler/java/$(DEPDIR)/java_message_builder.Plo - -rm -f google/protobuf/compiler/java/$(DEPDIR)/java_message_builder_lite.Plo - -rm -f google/protobuf/compiler/java/$(DEPDIR)/java_message_field.Plo - -rm -f google/protobuf/compiler/java/$(DEPDIR)/java_message_field_lite.Plo - -rm -f google/protobuf/compiler/java/$(DEPDIR)/java_message_lite.Plo - -rm -f google/protobuf/compiler/java/$(DEPDIR)/java_name_resolver.Plo - -rm -f google/protobuf/compiler/java/$(DEPDIR)/java_primitive_field.Plo - -rm -f google/protobuf/compiler/java/$(DEPDIR)/java_primitive_field_lite.Plo - -rm -f google/protobuf/compiler/java/$(DEPDIR)/java_service.Plo - -rm -f google/protobuf/compiler/java/$(DEPDIR)/java_shared_code_generator.Plo - -rm -f google/protobuf/compiler/java/$(DEPDIR)/java_string_field.Plo - -rm -f google/protobuf/compiler/java/$(DEPDIR)/java_string_field_lite.Plo - -rm -f google/protobuf/compiler/java/$(DEPDIR)/protobuf_test-java_doc_comment_unittest.Po - -rm -f google/protobuf/compiler/java/$(DEPDIR)/protobuf_test-java_plugin_unittest.Po - -rm -f google/protobuf/compiler/js/$(DEPDIR)/js_generator.Plo - -rm -f google/protobuf/compiler/js/$(DEPDIR)/well_known_types_embed.Plo - -rm -f google/protobuf/compiler/objectivec/$(DEPDIR)/objectivec_enum.Plo - -rm -f google/protobuf/compiler/objectivec/$(DEPDIR)/objectivec_enum_field.Plo - -rm -f google/protobuf/compiler/objectivec/$(DEPDIR)/objectivec_extension.Plo - -rm -f google/protobuf/compiler/objectivec/$(DEPDIR)/objectivec_field.Plo - -rm -f google/protobuf/compiler/objectivec/$(DEPDIR)/objectivec_file.Plo - -rm -f google/protobuf/compiler/objectivec/$(DEPDIR)/objectivec_generator.Plo - -rm -f google/protobuf/compiler/objectivec/$(DEPDIR)/objectivec_helpers.Plo - -rm -f google/protobuf/compiler/objectivec/$(DEPDIR)/objectivec_map_field.Plo - -rm -f google/protobuf/compiler/objectivec/$(DEPDIR)/objectivec_message.Plo - -rm -f google/protobuf/compiler/objectivec/$(DEPDIR)/objectivec_message_field.Plo - -rm -f google/protobuf/compiler/objectivec/$(DEPDIR)/objectivec_oneof.Plo - -rm -f google/protobuf/compiler/objectivec/$(DEPDIR)/objectivec_primitive_field.Plo - -rm -f google/protobuf/compiler/objectivec/$(DEPDIR)/protobuf_test-objectivec_helpers_unittest.Po - -rm -f google/protobuf/compiler/php/$(DEPDIR)/php_generator.Plo - -rm -f google/protobuf/compiler/python/$(DEPDIR)/protobuf_test-python_plugin_unittest.Po - -rm -f google/protobuf/compiler/python/$(DEPDIR)/python_generator.Plo - -rm -f google/protobuf/compiler/ruby/$(DEPDIR)/protobuf_test-ruby_generator_unittest.Po - -rm -f google/protobuf/compiler/ruby/$(DEPDIR)/ruby_generator.Plo - -rm -f google/protobuf/io/$(DEPDIR)/coded_stream.Plo - -rm -f google/protobuf/io/$(DEPDIR)/gzip_stream.Plo - -rm -f google/protobuf/io/$(DEPDIR)/io_win32.Plo - -rm -f google/protobuf/io/$(DEPDIR)/printer.Plo - -rm -f google/protobuf/io/$(DEPDIR)/protobuf_test-coded_stream_unittest.Po - -rm -f google/protobuf/io/$(DEPDIR)/protobuf_test-io_win32_unittest.Po - -rm -f google/protobuf/io/$(DEPDIR)/protobuf_test-printer_unittest.Po - -rm -f google/protobuf/io/$(DEPDIR)/protobuf_test-tokenizer_unittest.Po - -rm -f google/protobuf/io/$(DEPDIR)/protobuf_test-zero_copy_stream_unittest.Po - -rm -f google/protobuf/io/$(DEPDIR)/strtod.Plo - -rm -f google/protobuf/io/$(DEPDIR)/tokenizer.Plo - -rm -f google/protobuf/io/$(DEPDIR)/zero_copy_stream.Plo - -rm -f google/protobuf/io/$(DEPDIR)/zero_copy_stream_impl.Plo - -rm -f google/protobuf/io/$(DEPDIR)/zero_copy_stream_impl_lite.Plo - -rm -f google/protobuf/stubs/$(DEPDIR)/bytestream.Plo - -rm -f google/protobuf/stubs/$(DEPDIR)/common.Plo - -rm -f google/protobuf/stubs/$(DEPDIR)/int128.Plo - -rm -f google/protobuf/stubs/$(DEPDIR)/protobuf_test-bytestream_unittest.Po - -rm -f google/protobuf/stubs/$(DEPDIR)/protobuf_test-common_unittest.Po - -rm -f google/protobuf/stubs/$(DEPDIR)/protobuf_test-int128_unittest.Po - -rm -f google/protobuf/stubs/$(DEPDIR)/protobuf_test-status_test.Po - -rm -f google/protobuf/stubs/$(DEPDIR)/protobuf_test-statusor_test.Po - -rm -f google/protobuf/stubs/$(DEPDIR)/protobuf_test-stringpiece_unittest.Po - -rm -f google/protobuf/stubs/$(DEPDIR)/protobuf_test-stringprintf_unittest.Po - -rm -f google/protobuf/stubs/$(DEPDIR)/protobuf_test-structurally_valid_unittest.Po - -rm -f google/protobuf/stubs/$(DEPDIR)/protobuf_test-strutil_unittest.Po - -rm -f google/protobuf/stubs/$(DEPDIR)/protobuf_test-template_util_unittest.Po - -rm -f google/protobuf/stubs/$(DEPDIR)/protobuf_test-time_test.Po - -rm -f google/protobuf/stubs/$(DEPDIR)/status.Plo - -rm -f google/protobuf/stubs/$(DEPDIR)/statusor.Plo - -rm -f google/protobuf/stubs/$(DEPDIR)/stringpiece.Plo - -rm -f google/protobuf/stubs/$(DEPDIR)/stringprintf.Plo - -rm -f google/protobuf/stubs/$(DEPDIR)/structurally_valid.Plo - -rm -f google/protobuf/stubs/$(DEPDIR)/strutil.Plo - -rm -f google/protobuf/stubs/$(DEPDIR)/substitute.Plo - -rm -f google/protobuf/stubs/$(DEPDIR)/time.Plo - -rm -f google/protobuf/testing/$(DEPDIR)/protobuf_lazy_descriptor_test-file.Po - -rm -f google/protobuf/testing/$(DEPDIR)/protobuf_lazy_descriptor_test-googletest.Po - -rm -f google/protobuf/testing/$(DEPDIR)/protobuf_test-file.Po - -rm -f google/protobuf/testing/$(DEPDIR)/protobuf_test-googletest.Po - -rm -f google/protobuf/testing/$(DEPDIR)/test_plugin-file.Po - -rm -f google/protobuf/testing/$(DEPDIR)/zcgunzip.Po - -rm -f google/protobuf/testing/$(DEPDIR)/zcgzip.Po - -rm -f google/protobuf/util/$(DEPDIR)/delimited_message_util.Plo - -rm -f google/protobuf/util/$(DEPDIR)/field_comparator.Plo - -rm -f google/protobuf/util/$(DEPDIR)/field_mask_util.Plo - -rm -f google/protobuf/util/$(DEPDIR)/json_util.Plo - -rm -f google/protobuf/util/$(DEPDIR)/message_differencer.Plo - -rm -f google/protobuf/util/$(DEPDIR)/no_warning_test-json_format.pb.Po - -rm -f google/protobuf/util/$(DEPDIR)/no_warning_test-json_format_proto3.pb.Po - -rm -f google/protobuf/util/$(DEPDIR)/no_warning_test-message_differencer_unittest.pb.Po - -rm -f google/protobuf/util/$(DEPDIR)/protobuf_lazy_descriptor_test-json_format.pb.Po - -rm -f google/protobuf/util/$(DEPDIR)/protobuf_lazy_descriptor_test-json_format_proto3.pb.Po - -rm -f google/protobuf/util/$(DEPDIR)/protobuf_lazy_descriptor_test-message_differencer_unittest.pb.Po - -rm -f google/protobuf/util/$(DEPDIR)/protobuf_test-delimited_message_util_test.Po - -rm -f google/protobuf/util/$(DEPDIR)/protobuf_test-field_comparator_test.Po - -rm -f google/protobuf/util/$(DEPDIR)/protobuf_test-field_mask_util_test.Po - -rm -f google/protobuf/util/$(DEPDIR)/protobuf_test-json_format.pb.Po - -rm -f google/protobuf/util/$(DEPDIR)/protobuf_test-json_format_proto3.pb.Po - -rm -f google/protobuf/util/$(DEPDIR)/protobuf_test-json_util_test.Po - -rm -f google/protobuf/util/$(DEPDIR)/protobuf_test-message_differencer_unittest.Po - -rm -f google/protobuf/util/$(DEPDIR)/protobuf_test-message_differencer_unittest.pb.Po - -rm -f google/protobuf/util/$(DEPDIR)/protobuf_test-time_util_test.Po - -rm -f google/protobuf/util/$(DEPDIR)/protobuf_test-type_resolver_util_test.Po - -rm -f google/protobuf/util/$(DEPDIR)/time_util.Plo - -rm -f google/protobuf/util/$(DEPDIR)/type_resolver_util.Plo - -rm -f google/protobuf/util/internal/$(DEPDIR)/datapiece.Plo - -rm -f google/protobuf/util/internal/$(DEPDIR)/default_value_objectwriter.Plo - -rm -f google/protobuf/util/internal/$(DEPDIR)/error_listener.Plo - -rm -f google/protobuf/util/internal/$(DEPDIR)/field_mask_utility.Plo - -rm -f google/protobuf/util/internal/$(DEPDIR)/json_escaping.Plo - -rm -f google/protobuf/util/internal/$(DEPDIR)/json_objectwriter.Plo - -rm -f google/protobuf/util/internal/$(DEPDIR)/json_stream_parser.Plo - -rm -f google/protobuf/util/internal/$(DEPDIR)/object_writer.Plo - -rm -f google/protobuf/util/internal/$(DEPDIR)/proto_writer.Plo - -rm -f google/protobuf/util/internal/$(DEPDIR)/protobuf_test-default_value_objectwriter_test.Po - -rm -f google/protobuf/util/internal/$(DEPDIR)/protobuf_test-json_objectwriter_test.Po - -rm -f google/protobuf/util/internal/$(DEPDIR)/protobuf_test-json_stream_parser_test.Po - -rm -f google/protobuf/util/internal/$(DEPDIR)/protobuf_test-protostream_objectsource_test.Po - -rm -f google/protobuf/util/internal/$(DEPDIR)/protobuf_test-protostream_objectwriter_test.Po - -rm -f google/protobuf/util/internal/$(DEPDIR)/protobuf_test-type_info_test_helper.Po - -rm -f google/protobuf/util/internal/$(DEPDIR)/protostream_objectsource.Plo - -rm -f google/protobuf/util/internal/$(DEPDIR)/protostream_objectwriter.Plo - -rm -f google/protobuf/util/internal/$(DEPDIR)/type_info.Plo - -rm -f google/protobuf/util/internal/$(DEPDIR)/utility.Plo - -rm -f google/protobuf/util/internal/testdata/$(DEPDIR)/no_warning_test-anys.pb.Po - -rm -f google/protobuf/util/internal/testdata/$(DEPDIR)/no_warning_test-books.pb.Po - -rm -f google/protobuf/util/internal/testdata/$(DEPDIR)/no_warning_test-default_value.pb.Po - -rm -f google/protobuf/util/internal/testdata/$(DEPDIR)/no_warning_test-default_value_test.pb.Po - -rm -f google/protobuf/util/internal/testdata/$(DEPDIR)/no_warning_test-field_mask.pb.Po - -rm -f google/protobuf/util/internal/testdata/$(DEPDIR)/no_warning_test-maps.pb.Po - -rm -f google/protobuf/util/internal/testdata/$(DEPDIR)/no_warning_test-oneofs.pb.Po - -rm -f google/protobuf/util/internal/testdata/$(DEPDIR)/no_warning_test-proto3.pb.Po - -rm -f google/protobuf/util/internal/testdata/$(DEPDIR)/no_warning_test-struct.pb.Po - -rm -f google/protobuf/util/internal/testdata/$(DEPDIR)/no_warning_test-timestamp_duration.pb.Po - -rm -f google/protobuf/util/internal/testdata/$(DEPDIR)/no_warning_test-wrappers.pb.Po - -rm -f google/protobuf/util/internal/testdata/$(DEPDIR)/protobuf_lazy_descriptor_test-anys.pb.Po - -rm -f google/protobuf/util/internal/testdata/$(DEPDIR)/protobuf_lazy_descriptor_test-books.pb.Po - -rm -f google/protobuf/util/internal/testdata/$(DEPDIR)/protobuf_lazy_descriptor_test-default_value.pb.Po - -rm -f google/protobuf/util/internal/testdata/$(DEPDIR)/protobuf_lazy_descriptor_test-default_value_test.pb.Po - -rm -f google/protobuf/util/internal/testdata/$(DEPDIR)/protobuf_lazy_descriptor_test-field_mask.pb.Po - -rm -f google/protobuf/util/internal/testdata/$(DEPDIR)/protobuf_lazy_descriptor_test-maps.pb.Po - -rm -f google/protobuf/util/internal/testdata/$(DEPDIR)/protobuf_lazy_descriptor_test-oneofs.pb.Po - -rm -f google/protobuf/util/internal/testdata/$(DEPDIR)/protobuf_lazy_descriptor_test-proto3.pb.Po - -rm -f google/protobuf/util/internal/testdata/$(DEPDIR)/protobuf_lazy_descriptor_test-struct.pb.Po - -rm -f google/protobuf/util/internal/testdata/$(DEPDIR)/protobuf_lazy_descriptor_test-timestamp_duration.pb.Po - -rm -f google/protobuf/util/internal/testdata/$(DEPDIR)/protobuf_lazy_descriptor_test-wrappers.pb.Po - -rm -f google/protobuf/util/internal/testdata/$(DEPDIR)/protobuf_test-anys.pb.Po - -rm -f google/protobuf/util/internal/testdata/$(DEPDIR)/protobuf_test-books.pb.Po - -rm -f google/protobuf/util/internal/testdata/$(DEPDIR)/protobuf_test-default_value.pb.Po - -rm -f google/protobuf/util/internal/testdata/$(DEPDIR)/protobuf_test-default_value_test.pb.Po - -rm -f google/protobuf/util/internal/testdata/$(DEPDIR)/protobuf_test-field_mask.pb.Po - -rm -f google/protobuf/util/internal/testdata/$(DEPDIR)/protobuf_test-maps.pb.Po - -rm -f google/protobuf/util/internal/testdata/$(DEPDIR)/protobuf_test-oneofs.pb.Po - -rm -f google/protobuf/util/internal/testdata/$(DEPDIR)/protobuf_test-proto3.pb.Po - -rm -f google/protobuf/util/internal/testdata/$(DEPDIR)/protobuf_test-struct.pb.Po - -rm -f google/protobuf/util/internal/testdata/$(DEPDIR)/protobuf_test-timestamp_duration.pb.Po - -rm -f google/protobuf/util/internal/testdata/$(DEPDIR)/protobuf_test-wrappers.pb.Po - -rm -f Makefile -distclean-am: clean-am distclean-compile distclean-generic \ - distclean-tags - -dvi: dvi-am - -dvi-am: - -html: html-am - -html-am: - -info: info-am - -info-am: - -install-data-am: install-nobase_dist_protoDATA \ - install-nobase_includeHEADERS - -install-dvi: install-dvi-am - -install-dvi-am: - -install-exec-am: install-binPROGRAMS install-libLTLIBRARIES - -install-html: install-html-am - -install-html-am: - -install-info: install-info-am - -install-info-am: - -install-man: - -install-pdf: install-pdf-am - -install-pdf-am: - -install-ps: install-ps-am - -install-ps-am: - -installcheck-am: - -maintainer-clean: maintainer-clean-am - -rm -f ./$(DEPDIR)/no_warning_test-no_warning_test.Po - -rm -f google/protobuf/$(DEPDIR)/any.Plo - -rm -f google/protobuf/$(DEPDIR)/any.pb.Plo - -rm -f google/protobuf/$(DEPDIR)/any_lite.Plo - -rm -f google/protobuf/$(DEPDIR)/api.pb.Plo - -rm -f google/protobuf/$(DEPDIR)/arena.Plo - -rm -f google/protobuf/$(DEPDIR)/arenastring.Plo - -rm -f google/protobuf/$(DEPDIR)/descriptor.Plo - -rm -f google/protobuf/$(DEPDIR)/descriptor.pb.Plo - -rm -f google/protobuf/$(DEPDIR)/descriptor_database.Plo - -rm -f google/protobuf/$(DEPDIR)/duration.pb.Plo - -rm -f google/protobuf/$(DEPDIR)/dynamic_message.Plo - -rm -f google/protobuf/$(DEPDIR)/empty.pb.Plo - -rm -f google/protobuf/$(DEPDIR)/extension_set.Plo - -rm -f google/protobuf/$(DEPDIR)/extension_set_heavy.Plo - -rm -f google/protobuf/$(DEPDIR)/field_mask.pb.Plo - -rm -f google/protobuf/$(DEPDIR)/generated_enum_util.Plo - -rm -f google/protobuf/$(DEPDIR)/generated_message_bases.Plo - -rm -f google/protobuf/$(DEPDIR)/generated_message_reflection.Plo - -rm -f google/protobuf/$(DEPDIR)/generated_message_table_driven.Plo - -rm -f google/protobuf/$(DEPDIR)/generated_message_table_driven_lite.Plo - -rm -f google/protobuf/$(DEPDIR)/generated_message_tctable_full.Plo - -rm -f google/protobuf/$(DEPDIR)/generated_message_tctable_lite.Plo - -rm -f google/protobuf/$(DEPDIR)/generated_message_util.Plo - -rm -f google/protobuf/$(DEPDIR)/implicit_weak_message.Plo - -rm -f google/protobuf/$(DEPDIR)/inlined_string_field.Plo - -rm -f google/protobuf/$(DEPDIR)/map.Plo - -rm -f google/protobuf/$(DEPDIR)/map_field.Plo - -rm -f google/protobuf/$(DEPDIR)/message.Plo - -rm -f google/protobuf/$(DEPDIR)/message_lite.Plo - -rm -f google/protobuf/$(DEPDIR)/no_warning_test-any_test.pb.Po - -rm -f google/protobuf/$(DEPDIR)/no_warning_test-map_lite_unittest.pb.Po - -rm -f google/protobuf/$(DEPDIR)/no_warning_test-map_proto2_unittest.pb.Po - -rm -f google/protobuf/$(DEPDIR)/no_warning_test-map_unittest.pb.Po - -rm -f google/protobuf/$(DEPDIR)/no_warning_test-unittest.pb.Po - -rm -f google/protobuf/$(DEPDIR)/no_warning_test-unittest_arena.pb.Po - -rm -f google/protobuf/$(DEPDIR)/no_warning_test-unittest_custom_options.pb.Po - -rm -f google/protobuf/$(DEPDIR)/no_warning_test-unittest_drop_unknown_fields.pb.Po - -rm -f google/protobuf/$(DEPDIR)/no_warning_test-unittest_embed_optimize_for.pb.Po - -rm -f google/protobuf/$(DEPDIR)/no_warning_test-unittest_empty.pb.Po - -rm -f google/protobuf/$(DEPDIR)/no_warning_test-unittest_enormous_descriptor.pb.Po - -rm -f google/protobuf/$(DEPDIR)/no_warning_test-unittest_import.pb.Po - -rm -f google/protobuf/$(DEPDIR)/no_warning_test-unittest_import_lite.pb.Po - -rm -f google/protobuf/$(DEPDIR)/no_warning_test-unittest_import_public.pb.Po - -rm -f google/protobuf/$(DEPDIR)/no_warning_test-unittest_import_public_lite.pb.Po - -rm -f google/protobuf/$(DEPDIR)/no_warning_test-unittest_lazy_dependencies.pb.Po - -rm -f google/protobuf/$(DEPDIR)/no_warning_test-unittest_lazy_dependencies_custom_option.pb.Po - -rm -f google/protobuf/$(DEPDIR)/no_warning_test-unittest_lazy_dependencies_enum.pb.Po - -rm -f google/protobuf/$(DEPDIR)/no_warning_test-unittest_lite.pb.Po - -rm -f google/protobuf/$(DEPDIR)/no_warning_test-unittest_lite_imports_nonlite.pb.Po - -rm -f google/protobuf/$(DEPDIR)/no_warning_test-unittest_mset.pb.Po - -rm -f google/protobuf/$(DEPDIR)/no_warning_test-unittest_mset_wire_format.pb.Po - -rm -f google/protobuf/$(DEPDIR)/no_warning_test-unittest_no_field_presence.pb.Po - -rm -f google/protobuf/$(DEPDIR)/no_warning_test-unittest_no_generic_services.pb.Po - -rm -f google/protobuf/$(DEPDIR)/no_warning_test-unittest_optimize_for.pb.Po - -rm -f google/protobuf/$(DEPDIR)/no_warning_test-unittest_preserve_unknown_enum.pb.Po - -rm -f google/protobuf/$(DEPDIR)/no_warning_test-unittest_preserve_unknown_enum2.pb.Po - -rm -f google/protobuf/$(DEPDIR)/no_warning_test-unittest_proto3.pb.Po - -rm -f google/protobuf/$(DEPDIR)/no_warning_test-unittest_proto3_arena.pb.Po - -rm -f google/protobuf/$(DEPDIR)/no_warning_test-unittest_proto3_arena_lite.pb.Po - -rm -f google/protobuf/$(DEPDIR)/no_warning_test-unittest_proto3_lite.pb.Po - -rm -f google/protobuf/$(DEPDIR)/no_warning_test-unittest_proto3_optional.pb.Po - -rm -f google/protobuf/$(DEPDIR)/no_warning_test-unittest_well_known_types.pb.Po - -rm -f google/protobuf/$(DEPDIR)/parse_context.Plo - -rm -f google/protobuf/$(DEPDIR)/protobuf_lazy_descriptor_test-any_test.pb.Po - -rm -f google/protobuf/$(DEPDIR)/protobuf_lazy_descriptor_test-arena_test_util.Po - -rm -f google/protobuf/$(DEPDIR)/protobuf_lazy_descriptor_test-map_lite_test_util.Po - -rm -f google/protobuf/$(DEPDIR)/protobuf_lazy_descriptor_test-map_lite_unittest.pb.Po - -rm -f google/protobuf/$(DEPDIR)/protobuf_lazy_descriptor_test-map_proto2_unittest.pb.Po - -rm -f google/protobuf/$(DEPDIR)/protobuf_lazy_descriptor_test-map_unittest.pb.Po - -rm -f google/protobuf/$(DEPDIR)/protobuf_lazy_descriptor_test-reflection_tester.Po - -rm -f google/protobuf/$(DEPDIR)/protobuf_lazy_descriptor_test-test_util.Po - -rm -f google/protobuf/$(DEPDIR)/protobuf_lazy_descriptor_test-test_util_lite.Po - -rm -f google/protobuf/$(DEPDIR)/protobuf_lazy_descriptor_test-unittest.pb.Po - -rm -f google/protobuf/$(DEPDIR)/protobuf_lazy_descriptor_test-unittest_arena.pb.Po - -rm -f google/protobuf/$(DEPDIR)/protobuf_lazy_descriptor_test-unittest_custom_options.pb.Po - -rm -f google/protobuf/$(DEPDIR)/protobuf_lazy_descriptor_test-unittest_drop_unknown_fields.pb.Po - -rm -f google/protobuf/$(DEPDIR)/protobuf_lazy_descriptor_test-unittest_embed_optimize_for.pb.Po - -rm -f google/protobuf/$(DEPDIR)/protobuf_lazy_descriptor_test-unittest_empty.pb.Po - -rm -f google/protobuf/$(DEPDIR)/protobuf_lazy_descriptor_test-unittest_enormous_descriptor.pb.Po - -rm -f google/protobuf/$(DEPDIR)/protobuf_lazy_descriptor_test-unittest_import.pb.Po - -rm -f google/protobuf/$(DEPDIR)/protobuf_lazy_descriptor_test-unittest_import_lite.pb.Po - -rm -f google/protobuf/$(DEPDIR)/protobuf_lazy_descriptor_test-unittest_import_public.pb.Po - -rm -f google/protobuf/$(DEPDIR)/protobuf_lazy_descriptor_test-unittest_import_public_lite.pb.Po - -rm -f google/protobuf/$(DEPDIR)/protobuf_lazy_descriptor_test-unittest_lazy_dependencies.pb.Po - -rm -f google/protobuf/$(DEPDIR)/protobuf_lazy_descriptor_test-unittest_lazy_dependencies_custom_option.pb.Po - -rm -f google/protobuf/$(DEPDIR)/protobuf_lazy_descriptor_test-unittest_lazy_dependencies_enum.pb.Po - -rm -f google/protobuf/$(DEPDIR)/protobuf_lazy_descriptor_test-unittest_lite.pb.Po - -rm -f google/protobuf/$(DEPDIR)/protobuf_lazy_descriptor_test-unittest_lite_imports_nonlite.pb.Po - -rm -f google/protobuf/$(DEPDIR)/protobuf_lazy_descriptor_test-unittest_mset.pb.Po - -rm -f google/protobuf/$(DEPDIR)/protobuf_lazy_descriptor_test-unittest_mset_wire_format.pb.Po - -rm -f google/protobuf/$(DEPDIR)/protobuf_lazy_descriptor_test-unittest_no_field_presence.pb.Po - -rm -f google/protobuf/$(DEPDIR)/protobuf_lazy_descriptor_test-unittest_no_generic_services.pb.Po - -rm -f google/protobuf/$(DEPDIR)/protobuf_lazy_descriptor_test-unittest_optimize_for.pb.Po - -rm -f google/protobuf/$(DEPDIR)/protobuf_lazy_descriptor_test-unittest_preserve_unknown_enum.pb.Po - -rm -f google/protobuf/$(DEPDIR)/protobuf_lazy_descriptor_test-unittest_preserve_unknown_enum2.pb.Po - -rm -f google/protobuf/$(DEPDIR)/protobuf_lazy_descriptor_test-unittest_proto3.pb.Po - -rm -f google/protobuf/$(DEPDIR)/protobuf_lazy_descriptor_test-unittest_proto3_arena.pb.Po - -rm -f google/protobuf/$(DEPDIR)/protobuf_lazy_descriptor_test-unittest_proto3_arena_lite.pb.Po - -rm -f google/protobuf/$(DEPDIR)/protobuf_lazy_descriptor_test-unittest_proto3_lite.pb.Po - -rm -f google/protobuf/$(DEPDIR)/protobuf_lazy_descriptor_test-unittest_proto3_optional.pb.Po - -rm -f google/protobuf/$(DEPDIR)/protobuf_lazy_descriptor_test-unittest_well_known_types.pb.Po - -rm -f google/protobuf/$(DEPDIR)/protobuf_lite_arena_test-arena_test_util.Po - -rm -f google/protobuf/$(DEPDIR)/protobuf_lite_arena_test-lite_arena_unittest.Po - -rm -f google/protobuf/$(DEPDIR)/protobuf_lite_arena_test-map_lite_test_util.Po - -rm -f google/protobuf/$(DEPDIR)/protobuf_lite_arena_test-map_lite_unittest.pb.Po - -rm -f google/protobuf/$(DEPDIR)/protobuf_lite_arena_test-test_util_lite.Po - -rm -f google/protobuf/$(DEPDIR)/protobuf_lite_arena_test-unittest_import_lite.pb.Po - -rm -f google/protobuf/$(DEPDIR)/protobuf_lite_arena_test-unittest_import_public_lite.pb.Po - -rm -f google/protobuf/$(DEPDIR)/protobuf_lite_arena_test-unittest_lite.pb.Po - -rm -f google/protobuf/$(DEPDIR)/protobuf_lite_test-arena_test_util.Po - -rm -f google/protobuf/$(DEPDIR)/protobuf_lite_test-lite_unittest.Po - -rm -f google/protobuf/$(DEPDIR)/protobuf_lite_test-map_lite_test_util.Po - -rm -f google/protobuf/$(DEPDIR)/protobuf_lite_test-map_lite_unittest.pb.Po - -rm -f google/protobuf/$(DEPDIR)/protobuf_lite_test-test_util_lite.Po - -rm -f google/protobuf/$(DEPDIR)/protobuf_lite_test-unittest_import_lite.pb.Po - -rm -f google/protobuf/$(DEPDIR)/protobuf_lite_test-unittest_import_public_lite.pb.Po - -rm -f google/protobuf/$(DEPDIR)/protobuf_lite_test-unittest_lite.pb.Po - -rm -f google/protobuf/$(DEPDIR)/protobuf_test-any_test.Po - -rm -f google/protobuf/$(DEPDIR)/protobuf_test-any_test.pb.Po - -rm -f google/protobuf/$(DEPDIR)/protobuf_test-arena_test_util.Po - -rm -f google/protobuf/$(DEPDIR)/protobuf_test-arena_unittest.Po - -rm -f google/protobuf/$(DEPDIR)/protobuf_test-arenastring_unittest.Po - -rm -f google/protobuf/$(DEPDIR)/protobuf_test-descriptor_database_unittest.Po - -rm -f google/protobuf/$(DEPDIR)/protobuf_test-descriptor_unittest.Po - -rm -f google/protobuf/$(DEPDIR)/protobuf_test-drop_unknown_fields_test.Po - -rm -f google/protobuf/$(DEPDIR)/protobuf_test-dynamic_message_unittest.Po - -rm -f google/protobuf/$(DEPDIR)/protobuf_test-extension_set_unittest.Po - -rm -f google/protobuf/$(DEPDIR)/protobuf_test-generated_message_reflection_unittest.Po - -rm -f google/protobuf/$(DEPDIR)/protobuf_test-inlined_string_field_unittest.Po - -rm -f google/protobuf/$(DEPDIR)/protobuf_test-map_field_test.Po - -rm -f google/protobuf/$(DEPDIR)/protobuf_test-map_lite_test_util.Po - -rm -f google/protobuf/$(DEPDIR)/protobuf_test-map_lite_unittest.pb.Po - -rm -f google/protobuf/$(DEPDIR)/protobuf_test-map_proto2_unittest.pb.Po - -rm -f google/protobuf/$(DEPDIR)/protobuf_test-map_test.Po - -rm -f google/protobuf/$(DEPDIR)/protobuf_test-map_unittest.pb.Po - -rm -f google/protobuf/$(DEPDIR)/protobuf_test-message_unittest.Po - -rm -f google/protobuf/$(DEPDIR)/protobuf_test-no_field_presence_test.Po - -rm -f google/protobuf/$(DEPDIR)/protobuf_test-preserve_unknown_enum_test.Po - -rm -f google/protobuf/$(DEPDIR)/protobuf_test-proto3_arena_lite_unittest.Po - -rm -f google/protobuf/$(DEPDIR)/protobuf_test-proto3_arena_unittest.Po - -rm -f google/protobuf/$(DEPDIR)/protobuf_test-proto3_lite_unittest.Po - -rm -f google/protobuf/$(DEPDIR)/protobuf_test-reflection_ops_unittest.Po - -rm -f google/protobuf/$(DEPDIR)/protobuf_test-reflection_tester.Po - -rm -f google/protobuf/$(DEPDIR)/protobuf_test-repeated_field_reflection_unittest.Po - -rm -f google/protobuf/$(DEPDIR)/protobuf_test-repeated_field_unittest.Po - -rm -f google/protobuf/$(DEPDIR)/protobuf_test-test_util.Po - -rm -f google/protobuf/$(DEPDIR)/protobuf_test-test_util_lite.Po - -rm -f google/protobuf/$(DEPDIR)/protobuf_test-text_format_unittest.Po - -rm -f google/protobuf/$(DEPDIR)/protobuf_test-unittest.pb.Po - -rm -f google/protobuf/$(DEPDIR)/protobuf_test-unittest_arena.pb.Po - -rm -f google/protobuf/$(DEPDIR)/protobuf_test-unittest_custom_options.pb.Po - -rm -f google/protobuf/$(DEPDIR)/protobuf_test-unittest_drop_unknown_fields.pb.Po - -rm -f google/protobuf/$(DEPDIR)/protobuf_test-unittest_embed_optimize_for.pb.Po - -rm -f google/protobuf/$(DEPDIR)/protobuf_test-unittest_empty.pb.Po - -rm -f google/protobuf/$(DEPDIR)/protobuf_test-unittest_enormous_descriptor.pb.Po - -rm -f google/protobuf/$(DEPDIR)/protobuf_test-unittest_import.pb.Po - -rm -f google/protobuf/$(DEPDIR)/protobuf_test-unittest_import_lite.pb.Po - -rm -f google/protobuf/$(DEPDIR)/protobuf_test-unittest_import_public.pb.Po - -rm -f google/protobuf/$(DEPDIR)/protobuf_test-unittest_import_public_lite.pb.Po - -rm -f google/protobuf/$(DEPDIR)/protobuf_test-unittest_lazy_dependencies.pb.Po - -rm -f google/protobuf/$(DEPDIR)/protobuf_test-unittest_lazy_dependencies_custom_option.pb.Po - -rm -f google/protobuf/$(DEPDIR)/protobuf_test-unittest_lazy_dependencies_enum.pb.Po - -rm -f google/protobuf/$(DEPDIR)/protobuf_test-unittest_lite.pb.Po - -rm -f google/protobuf/$(DEPDIR)/protobuf_test-unittest_lite_imports_nonlite.pb.Po - -rm -f google/protobuf/$(DEPDIR)/protobuf_test-unittest_mset.pb.Po - -rm -f google/protobuf/$(DEPDIR)/protobuf_test-unittest_mset_wire_format.pb.Po - -rm -f google/protobuf/$(DEPDIR)/protobuf_test-unittest_no_field_presence.pb.Po - -rm -f google/protobuf/$(DEPDIR)/protobuf_test-unittest_no_generic_services.pb.Po - -rm -f google/protobuf/$(DEPDIR)/protobuf_test-unittest_optimize_for.pb.Po - -rm -f google/protobuf/$(DEPDIR)/protobuf_test-unittest_preserve_unknown_enum.pb.Po - -rm -f google/protobuf/$(DEPDIR)/protobuf_test-unittest_preserve_unknown_enum2.pb.Po - -rm -f google/protobuf/$(DEPDIR)/protobuf_test-unittest_proto3.pb.Po - -rm -f google/protobuf/$(DEPDIR)/protobuf_test-unittest_proto3_arena.pb.Po - -rm -f google/protobuf/$(DEPDIR)/protobuf_test-unittest_proto3_arena_lite.pb.Po - -rm -f google/protobuf/$(DEPDIR)/protobuf_test-unittest_proto3_lite.pb.Po - -rm -f google/protobuf/$(DEPDIR)/protobuf_test-unittest_proto3_optional.pb.Po - -rm -f google/protobuf/$(DEPDIR)/protobuf_test-unittest_well_known_types.pb.Po - -rm -f google/protobuf/$(DEPDIR)/protobuf_test-unknown_field_set_unittest.Po - -rm -f google/protobuf/$(DEPDIR)/protobuf_test-well_known_types_unittest.Po - -rm -f google/protobuf/$(DEPDIR)/protobuf_test-wire_format_unittest.Po - -rm -f google/protobuf/$(DEPDIR)/reflection_ops.Plo - -rm -f google/protobuf/$(DEPDIR)/repeated_field.Plo - -rm -f google/protobuf/$(DEPDIR)/repeated_ptr_field.Plo - -rm -f google/protobuf/$(DEPDIR)/service.Plo - -rm -f google/protobuf/$(DEPDIR)/source_context.pb.Plo - -rm -f google/protobuf/$(DEPDIR)/struct.pb.Plo - -rm -f google/protobuf/$(DEPDIR)/text_format.Plo - -rm -f google/protobuf/$(DEPDIR)/timestamp.pb.Plo - -rm -f google/protobuf/$(DEPDIR)/type.pb.Plo - -rm -f google/protobuf/$(DEPDIR)/unknown_field_set.Plo - -rm -f google/protobuf/$(DEPDIR)/wire_format.Plo - -rm -f google/protobuf/$(DEPDIR)/wire_format_lite.Plo - -rm -f google/protobuf/$(DEPDIR)/wrappers.pb.Plo - -rm -f google/protobuf/compiler/$(DEPDIR)/code_generator.Plo - -rm -f google/protobuf/compiler/$(DEPDIR)/command_line_interface.Plo - -rm -f google/protobuf/compiler/$(DEPDIR)/importer.Plo - -rm -f google/protobuf/compiler/$(DEPDIR)/main.Po - -rm -f google/protobuf/compiler/$(DEPDIR)/parser.Plo - -rm -f google/protobuf/compiler/$(DEPDIR)/plugin.Plo - -rm -f google/protobuf/compiler/$(DEPDIR)/plugin.pb.Plo - -rm -f google/protobuf/compiler/$(DEPDIR)/protobuf_test-annotation_test_util.Po - -rm -f google/protobuf/compiler/$(DEPDIR)/protobuf_test-command_line_interface_unittest.Po - -rm -f google/protobuf/compiler/$(DEPDIR)/protobuf_test-importer_unittest.Po - -rm -f google/protobuf/compiler/$(DEPDIR)/protobuf_test-mock_code_generator.Po - -rm -f google/protobuf/compiler/$(DEPDIR)/protobuf_test-parser_unittest.Po - -rm -f google/protobuf/compiler/$(DEPDIR)/subprocess.Plo - -rm -f google/protobuf/compiler/$(DEPDIR)/test_plugin-mock_code_generator.Po - -rm -f google/protobuf/compiler/$(DEPDIR)/test_plugin-test_plugin.Po - -rm -f google/protobuf/compiler/$(DEPDIR)/zip_writer.Plo - -rm -f google/protobuf/compiler/cpp/$(DEPDIR)/cpp_enum.Plo - -rm -f google/protobuf/compiler/cpp/$(DEPDIR)/cpp_enum_field.Plo - -rm -f google/protobuf/compiler/cpp/$(DEPDIR)/cpp_extension.Plo - -rm -f google/protobuf/compiler/cpp/$(DEPDIR)/cpp_field.Plo - -rm -f google/protobuf/compiler/cpp/$(DEPDIR)/cpp_file.Plo - -rm -f google/protobuf/compiler/cpp/$(DEPDIR)/cpp_generator.Plo - -rm -f google/protobuf/compiler/cpp/$(DEPDIR)/cpp_helpers.Plo - -rm -f google/protobuf/compiler/cpp/$(DEPDIR)/cpp_map_field.Plo - -rm -f google/protobuf/compiler/cpp/$(DEPDIR)/cpp_message.Plo - -rm -f google/protobuf/compiler/cpp/$(DEPDIR)/cpp_message_field.Plo - -rm -f google/protobuf/compiler/cpp/$(DEPDIR)/cpp_padding_optimizer.Plo - -rm -f google/protobuf/compiler/cpp/$(DEPDIR)/cpp_parse_function_generator.Plo - -rm -f google/protobuf/compiler/cpp/$(DEPDIR)/cpp_primitive_field.Plo - -rm -f google/protobuf/compiler/cpp/$(DEPDIR)/cpp_service.Plo - -rm -f google/protobuf/compiler/cpp/$(DEPDIR)/cpp_string_field.Plo - -rm -f google/protobuf/compiler/cpp/$(DEPDIR)/no_warning_test-cpp_test_bad_identifiers.pb.Po - -rm -f google/protobuf/compiler/cpp/$(DEPDIR)/no_warning_test-cpp_test_large_enum_value.pb.Po - -rm -f google/protobuf/compiler/cpp/$(DEPDIR)/protobuf_lazy_descriptor_test-cpp_test_bad_identifiers.pb.Po - -rm -f google/protobuf/compiler/cpp/$(DEPDIR)/protobuf_lazy_descriptor_test-cpp_test_large_enum_value.pb.Po - -rm -f google/protobuf/compiler/cpp/$(DEPDIR)/protobuf_lazy_descriptor_test-cpp_unittest.Po - -rm -f google/protobuf/compiler/cpp/$(DEPDIR)/protobuf_test-cpp_bootstrap_unittest.Po - -rm -f google/protobuf/compiler/cpp/$(DEPDIR)/protobuf_test-cpp_move_unittest.Po - -rm -f google/protobuf/compiler/cpp/$(DEPDIR)/protobuf_test-cpp_plugin_unittest.Po - -rm -f google/protobuf/compiler/cpp/$(DEPDIR)/protobuf_test-cpp_test_bad_identifiers.pb.Po - -rm -f google/protobuf/compiler/cpp/$(DEPDIR)/protobuf_test-cpp_test_large_enum_value.pb.Po - -rm -f google/protobuf/compiler/cpp/$(DEPDIR)/protobuf_test-cpp_unittest.Po - -rm -f google/protobuf/compiler/cpp/$(DEPDIR)/protobuf_test-metadata_test.Po - -rm -f google/protobuf/compiler/csharp/$(DEPDIR)/csharp_doc_comment.Plo - -rm -f google/protobuf/compiler/csharp/$(DEPDIR)/csharp_enum.Plo - -rm -f google/protobuf/compiler/csharp/$(DEPDIR)/csharp_enum_field.Plo - -rm -f google/protobuf/compiler/csharp/$(DEPDIR)/csharp_field_base.Plo - -rm -f google/protobuf/compiler/csharp/$(DEPDIR)/csharp_generator.Plo - -rm -f google/protobuf/compiler/csharp/$(DEPDIR)/csharp_helpers.Plo - -rm -f google/protobuf/compiler/csharp/$(DEPDIR)/csharp_map_field.Plo - -rm -f google/protobuf/compiler/csharp/$(DEPDIR)/csharp_message.Plo - -rm -f google/protobuf/compiler/csharp/$(DEPDIR)/csharp_message_field.Plo - -rm -f google/protobuf/compiler/csharp/$(DEPDIR)/csharp_primitive_field.Plo - -rm -f google/protobuf/compiler/csharp/$(DEPDIR)/csharp_reflection_class.Plo - -rm -f google/protobuf/compiler/csharp/$(DEPDIR)/csharp_repeated_enum_field.Plo - -rm -f google/protobuf/compiler/csharp/$(DEPDIR)/csharp_repeated_message_field.Plo - -rm -f google/protobuf/compiler/csharp/$(DEPDIR)/csharp_repeated_primitive_field.Plo - -rm -f google/protobuf/compiler/csharp/$(DEPDIR)/csharp_source_generator_base.Plo - -rm -f google/protobuf/compiler/csharp/$(DEPDIR)/csharp_wrapper_field.Plo - -rm -f google/protobuf/compiler/csharp/$(DEPDIR)/protobuf_test-csharp_bootstrap_unittest.Po - -rm -f google/protobuf/compiler/csharp/$(DEPDIR)/protobuf_test-csharp_generator_unittest.Po - -rm -f google/protobuf/compiler/java/$(DEPDIR)/java_context.Plo - -rm -f google/protobuf/compiler/java/$(DEPDIR)/java_doc_comment.Plo - -rm -f google/protobuf/compiler/java/$(DEPDIR)/java_enum.Plo - -rm -f google/protobuf/compiler/java/$(DEPDIR)/java_enum_field.Plo - -rm -f google/protobuf/compiler/java/$(DEPDIR)/java_enum_field_lite.Plo - -rm -f google/protobuf/compiler/java/$(DEPDIR)/java_enum_lite.Plo - -rm -f google/protobuf/compiler/java/$(DEPDIR)/java_extension.Plo - -rm -f google/protobuf/compiler/java/$(DEPDIR)/java_extension_lite.Plo - -rm -f google/protobuf/compiler/java/$(DEPDIR)/java_field.Plo - -rm -f google/protobuf/compiler/java/$(DEPDIR)/java_file.Plo - -rm -f google/protobuf/compiler/java/$(DEPDIR)/java_generator.Plo - -rm -f google/protobuf/compiler/java/$(DEPDIR)/java_generator_factory.Plo - -rm -f google/protobuf/compiler/java/$(DEPDIR)/java_helpers.Plo - -rm -f google/protobuf/compiler/java/$(DEPDIR)/java_kotlin_generator.Plo - -rm -f google/protobuf/compiler/java/$(DEPDIR)/java_map_field.Plo - -rm -f google/protobuf/compiler/java/$(DEPDIR)/java_map_field_lite.Plo - -rm -f google/protobuf/compiler/java/$(DEPDIR)/java_message.Plo - -rm -f google/protobuf/compiler/java/$(DEPDIR)/java_message_builder.Plo - -rm -f google/protobuf/compiler/java/$(DEPDIR)/java_message_builder_lite.Plo - -rm -f google/protobuf/compiler/java/$(DEPDIR)/java_message_field.Plo - -rm -f google/protobuf/compiler/java/$(DEPDIR)/java_message_field_lite.Plo - -rm -f google/protobuf/compiler/java/$(DEPDIR)/java_message_lite.Plo - -rm -f google/protobuf/compiler/java/$(DEPDIR)/java_name_resolver.Plo - -rm -f google/protobuf/compiler/java/$(DEPDIR)/java_primitive_field.Plo - -rm -f google/protobuf/compiler/java/$(DEPDIR)/java_primitive_field_lite.Plo - -rm -f google/protobuf/compiler/java/$(DEPDIR)/java_service.Plo - -rm -f google/protobuf/compiler/java/$(DEPDIR)/java_shared_code_generator.Plo - -rm -f google/protobuf/compiler/java/$(DEPDIR)/java_string_field.Plo - -rm -f google/protobuf/compiler/java/$(DEPDIR)/java_string_field_lite.Plo - -rm -f google/protobuf/compiler/java/$(DEPDIR)/protobuf_test-java_doc_comment_unittest.Po - -rm -f google/protobuf/compiler/java/$(DEPDIR)/protobuf_test-java_plugin_unittest.Po - -rm -f google/protobuf/compiler/js/$(DEPDIR)/js_generator.Plo - -rm -f google/protobuf/compiler/js/$(DEPDIR)/well_known_types_embed.Plo - -rm -f google/protobuf/compiler/objectivec/$(DEPDIR)/objectivec_enum.Plo - -rm -f google/protobuf/compiler/objectivec/$(DEPDIR)/objectivec_enum_field.Plo - -rm -f google/protobuf/compiler/objectivec/$(DEPDIR)/objectivec_extension.Plo - -rm -f google/protobuf/compiler/objectivec/$(DEPDIR)/objectivec_field.Plo - -rm -f google/protobuf/compiler/objectivec/$(DEPDIR)/objectivec_file.Plo - -rm -f google/protobuf/compiler/objectivec/$(DEPDIR)/objectivec_generator.Plo - -rm -f google/protobuf/compiler/objectivec/$(DEPDIR)/objectivec_helpers.Plo - -rm -f google/protobuf/compiler/objectivec/$(DEPDIR)/objectivec_map_field.Plo - -rm -f google/protobuf/compiler/objectivec/$(DEPDIR)/objectivec_message.Plo - -rm -f google/protobuf/compiler/objectivec/$(DEPDIR)/objectivec_message_field.Plo - -rm -f google/protobuf/compiler/objectivec/$(DEPDIR)/objectivec_oneof.Plo - -rm -f google/protobuf/compiler/objectivec/$(DEPDIR)/objectivec_primitive_field.Plo - -rm -f google/protobuf/compiler/objectivec/$(DEPDIR)/protobuf_test-objectivec_helpers_unittest.Po - -rm -f google/protobuf/compiler/php/$(DEPDIR)/php_generator.Plo - -rm -f google/protobuf/compiler/python/$(DEPDIR)/protobuf_test-python_plugin_unittest.Po - -rm -f google/protobuf/compiler/python/$(DEPDIR)/python_generator.Plo - -rm -f google/protobuf/compiler/ruby/$(DEPDIR)/protobuf_test-ruby_generator_unittest.Po - -rm -f google/protobuf/compiler/ruby/$(DEPDIR)/ruby_generator.Plo - -rm -f google/protobuf/io/$(DEPDIR)/coded_stream.Plo - -rm -f google/protobuf/io/$(DEPDIR)/gzip_stream.Plo - -rm -f google/protobuf/io/$(DEPDIR)/io_win32.Plo - -rm -f google/protobuf/io/$(DEPDIR)/printer.Plo - -rm -f google/protobuf/io/$(DEPDIR)/protobuf_test-coded_stream_unittest.Po - -rm -f google/protobuf/io/$(DEPDIR)/protobuf_test-io_win32_unittest.Po - -rm -f google/protobuf/io/$(DEPDIR)/protobuf_test-printer_unittest.Po - -rm -f google/protobuf/io/$(DEPDIR)/protobuf_test-tokenizer_unittest.Po - -rm -f google/protobuf/io/$(DEPDIR)/protobuf_test-zero_copy_stream_unittest.Po - -rm -f google/protobuf/io/$(DEPDIR)/strtod.Plo - -rm -f google/protobuf/io/$(DEPDIR)/tokenizer.Plo - -rm -f google/protobuf/io/$(DEPDIR)/zero_copy_stream.Plo - -rm -f google/protobuf/io/$(DEPDIR)/zero_copy_stream_impl.Plo - -rm -f google/protobuf/io/$(DEPDIR)/zero_copy_stream_impl_lite.Plo - -rm -f google/protobuf/stubs/$(DEPDIR)/bytestream.Plo - -rm -f google/protobuf/stubs/$(DEPDIR)/common.Plo - -rm -f google/protobuf/stubs/$(DEPDIR)/int128.Plo - -rm -f google/protobuf/stubs/$(DEPDIR)/protobuf_test-bytestream_unittest.Po - -rm -f google/protobuf/stubs/$(DEPDIR)/protobuf_test-common_unittest.Po - -rm -f google/protobuf/stubs/$(DEPDIR)/protobuf_test-int128_unittest.Po - -rm -f google/protobuf/stubs/$(DEPDIR)/protobuf_test-status_test.Po - -rm -f google/protobuf/stubs/$(DEPDIR)/protobuf_test-statusor_test.Po - -rm -f google/protobuf/stubs/$(DEPDIR)/protobuf_test-stringpiece_unittest.Po - -rm -f google/protobuf/stubs/$(DEPDIR)/protobuf_test-stringprintf_unittest.Po - -rm -f google/protobuf/stubs/$(DEPDIR)/protobuf_test-structurally_valid_unittest.Po - -rm -f google/protobuf/stubs/$(DEPDIR)/protobuf_test-strutil_unittest.Po - -rm -f google/protobuf/stubs/$(DEPDIR)/protobuf_test-template_util_unittest.Po - -rm -f google/protobuf/stubs/$(DEPDIR)/protobuf_test-time_test.Po - -rm -f google/protobuf/stubs/$(DEPDIR)/status.Plo - -rm -f google/protobuf/stubs/$(DEPDIR)/statusor.Plo - -rm -f google/protobuf/stubs/$(DEPDIR)/stringpiece.Plo - -rm -f google/protobuf/stubs/$(DEPDIR)/stringprintf.Plo - -rm -f google/protobuf/stubs/$(DEPDIR)/structurally_valid.Plo - -rm -f google/protobuf/stubs/$(DEPDIR)/strutil.Plo - -rm -f google/protobuf/stubs/$(DEPDIR)/substitute.Plo - -rm -f google/protobuf/stubs/$(DEPDIR)/time.Plo - -rm -f google/protobuf/testing/$(DEPDIR)/protobuf_lazy_descriptor_test-file.Po - -rm -f google/protobuf/testing/$(DEPDIR)/protobuf_lazy_descriptor_test-googletest.Po - -rm -f google/protobuf/testing/$(DEPDIR)/protobuf_test-file.Po - -rm -f google/protobuf/testing/$(DEPDIR)/protobuf_test-googletest.Po - -rm -f google/protobuf/testing/$(DEPDIR)/test_plugin-file.Po - -rm -f google/protobuf/testing/$(DEPDIR)/zcgunzip.Po - -rm -f google/protobuf/testing/$(DEPDIR)/zcgzip.Po - -rm -f google/protobuf/util/$(DEPDIR)/delimited_message_util.Plo - -rm -f google/protobuf/util/$(DEPDIR)/field_comparator.Plo - -rm -f google/protobuf/util/$(DEPDIR)/field_mask_util.Plo - -rm -f google/protobuf/util/$(DEPDIR)/json_util.Plo - -rm -f google/protobuf/util/$(DEPDIR)/message_differencer.Plo - -rm -f google/protobuf/util/$(DEPDIR)/no_warning_test-json_format.pb.Po - -rm -f google/protobuf/util/$(DEPDIR)/no_warning_test-json_format_proto3.pb.Po - -rm -f google/protobuf/util/$(DEPDIR)/no_warning_test-message_differencer_unittest.pb.Po - -rm -f google/protobuf/util/$(DEPDIR)/protobuf_lazy_descriptor_test-json_format.pb.Po - -rm -f google/protobuf/util/$(DEPDIR)/protobuf_lazy_descriptor_test-json_format_proto3.pb.Po - -rm -f google/protobuf/util/$(DEPDIR)/protobuf_lazy_descriptor_test-message_differencer_unittest.pb.Po - -rm -f google/protobuf/util/$(DEPDIR)/protobuf_test-delimited_message_util_test.Po - -rm -f google/protobuf/util/$(DEPDIR)/protobuf_test-field_comparator_test.Po - -rm -f google/protobuf/util/$(DEPDIR)/protobuf_test-field_mask_util_test.Po - -rm -f google/protobuf/util/$(DEPDIR)/protobuf_test-json_format.pb.Po - -rm -f google/protobuf/util/$(DEPDIR)/protobuf_test-json_format_proto3.pb.Po - -rm -f google/protobuf/util/$(DEPDIR)/protobuf_test-json_util_test.Po - -rm -f google/protobuf/util/$(DEPDIR)/protobuf_test-message_differencer_unittest.Po - -rm -f google/protobuf/util/$(DEPDIR)/protobuf_test-message_differencer_unittest.pb.Po - -rm -f google/protobuf/util/$(DEPDIR)/protobuf_test-time_util_test.Po - -rm -f google/protobuf/util/$(DEPDIR)/protobuf_test-type_resolver_util_test.Po - -rm -f google/protobuf/util/$(DEPDIR)/time_util.Plo - -rm -f google/protobuf/util/$(DEPDIR)/type_resolver_util.Plo - -rm -f google/protobuf/util/internal/$(DEPDIR)/datapiece.Plo - -rm -f google/protobuf/util/internal/$(DEPDIR)/default_value_objectwriter.Plo - -rm -f google/protobuf/util/internal/$(DEPDIR)/error_listener.Plo - -rm -f google/protobuf/util/internal/$(DEPDIR)/field_mask_utility.Plo - -rm -f google/protobuf/util/internal/$(DEPDIR)/json_escaping.Plo - -rm -f google/protobuf/util/internal/$(DEPDIR)/json_objectwriter.Plo - -rm -f google/protobuf/util/internal/$(DEPDIR)/json_stream_parser.Plo - -rm -f google/protobuf/util/internal/$(DEPDIR)/object_writer.Plo - -rm -f google/protobuf/util/internal/$(DEPDIR)/proto_writer.Plo - -rm -f google/protobuf/util/internal/$(DEPDIR)/protobuf_test-default_value_objectwriter_test.Po - -rm -f google/protobuf/util/internal/$(DEPDIR)/protobuf_test-json_objectwriter_test.Po - -rm -f google/protobuf/util/internal/$(DEPDIR)/protobuf_test-json_stream_parser_test.Po - -rm -f google/protobuf/util/internal/$(DEPDIR)/protobuf_test-protostream_objectsource_test.Po - -rm -f google/protobuf/util/internal/$(DEPDIR)/protobuf_test-protostream_objectwriter_test.Po - -rm -f google/protobuf/util/internal/$(DEPDIR)/protobuf_test-type_info_test_helper.Po - -rm -f google/protobuf/util/internal/$(DEPDIR)/protostream_objectsource.Plo - -rm -f google/protobuf/util/internal/$(DEPDIR)/protostream_objectwriter.Plo - -rm -f google/protobuf/util/internal/$(DEPDIR)/type_info.Plo - -rm -f google/protobuf/util/internal/$(DEPDIR)/utility.Plo - -rm -f google/protobuf/util/internal/testdata/$(DEPDIR)/no_warning_test-anys.pb.Po - -rm -f google/protobuf/util/internal/testdata/$(DEPDIR)/no_warning_test-books.pb.Po - -rm -f google/protobuf/util/internal/testdata/$(DEPDIR)/no_warning_test-default_value.pb.Po - -rm -f google/protobuf/util/internal/testdata/$(DEPDIR)/no_warning_test-default_value_test.pb.Po - -rm -f google/protobuf/util/internal/testdata/$(DEPDIR)/no_warning_test-field_mask.pb.Po - -rm -f google/protobuf/util/internal/testdata/$(DEPDIR)/no_warning_test-maps.pb.Po - -rm -f google/protobuf/util/internal/testdata/$(DEPDIR)/no_warning_test-oneofs.pb.Po - -rm -f google/protobuf/util/internal/testdata/$(DEPDIR)/no_warning_test-proto3.pb.Po - -rm -f google/protobuf/util/internal/testdata/$(DEPDIR)/no_warning_test-struct.pb.Po - -rm -f google/protobuf/util/internal/testdata/$(DEPDIR)/no_warning_test-timestamp_duration.pb.Po - -rm -f google/protobuf/util/internal/testdata/$(DEPDIR)/no_warning_test-wrappers.pb.Po - -rm -f google/protobuf/util/internal/testdata/$(DEPDIR)/protobuf_lazy_descriptor_test-anys.pb.Po - -rm -f google/protobuf/util/internal/testdata/$(DEPDIR)/protobuf_lazy_descriptor_test-books.pb.Po - -rm -f google/protobuf/util/internal/testdata/$(DEPDIR)/protobuf_lazy_descriptor_test-default_value.pb.Po - -rm -f google/protobuf/util/internal/testdata/$(DEPDIR)/protobuf_lazy_descriptor_test-default_value_test.pb.Po - -rm -f google/protobuf/util/internal/testdata/$(DEPDIR)/protobuf_lazy_descriptor_test-field_mask.pb.Po - -rm -f google/protobuf/util/internal/testdata/$(DEPDIR)/protobuf_lazy_descriptor_test-maps.pb.Po - -rm -f google/protobuf/util/internal/testdata/$(DEPDIR)/protobuf_lazy_descriptor_test-oneofs.pb.Po - -rm -f google/protobuf/util/internal/testdata/$(DEPDIR)/protobuf_lazy_descriptor_test-proto3.pb.Po - -rm -f google/protobuf/util/internal/testdata/$(DEPDIR)/protobuf_lazy_descriptor_test-struct.pb.Po - -rm -f google/protobuf/util/internal/testdata/$(DEPDIR)/protobuf_lazy_descriptor_test-timestamp_duration.pb.Po - -rm -f google/protobuf/util/internal/testdata/$(DEPDIR)/protobuf_lazy_descriptor_test-wrappers.pb.Po - -rm -f google/protobuf/util/internal/testdata/$(DEPDIR)/protobuf_test-anys.pb.Po - -rm -f google/protobuf/util/internal/testdata/$(DEPDIR)/protobuf_test-books.pb.Po - -rm -f google/protobuf/util/internal/testdata/$(DEPDIR)/protobuf_test-default_value.pb.Po - -rm -f google/protobuf/util/internal/testdata/$(DEPDIR)/protobuf_test-default_value_test.pb.Po - -rm -f google/protobuf/util/internal/testdata/$(DEPDIR)/protobuf_test-field_mask.pb.Po - -rm -f google/protobuf/util/internal/testdata/$(DEPDIR)/protobuf_test-maps.pb.Po - -rm -f google/protobuf/util/internal/testdata/$(DEPDIR)/protobuf_test-oneofs.pb.Po - -rm -f google/protobuf/util/internal/testdata/$(DEPDIR)/protobuf_test-proto3.pb.Po - -rm -f google/protobuf/util/internal/testdata/$(DEPDIR)/protobuf_test-struct.pb.Po - -rm -f google/protobuf/util/internal/testdata/$(DEPDIR)/protobuf_test-timestamp_duration.pb.Po - -rm -f google/protobuf/util/internal/testdata/$(DEPDIR)/protobuf_test-wrappers.pb.Po - -rm -f Makefile -maintainer-clean-am: distclean-am maintainer-clean-generic - -mostlyclean: mostlyclean-am - -mostlyclean-am: mostlyclean-compile mostlyclean-generic \ - mostlyclean-libtool - -pdf: pdf-am - -pdf-am: - -ps: ps-am - -ps-am: - -uninstall-am: uninstall-binPROGRAMS uninstall-libLTLIBRARIES \ - uninstall-nobase_dist_protoDATA \ - uninstall-nobase_includeHEADERS - -.MAKE: check-am install-am install-strip - -.PHONY: CTAGS GTAGS TAGS all all-am am--depfiles check check-TESTS \ - check-am clean clean-binPROGRAMS clean-checkPROGRAMS \ - clean-generic clean-libLTLIBRARIES clean-libtool clean-local \ - cscopelist-am ctags ctags-am distclean distclean-compile \ - distclean-generic distclean-libtool distclean-tags distdir dvi \ - dvi-am html html-am info info-am install install-am \ - install-binPROGRAMS install-data install-data-am install-dvi \ - install-dvi-am install-exec install-exec-am install-html \ - install-html-am install-info install-info-am \ - install-libLTLIBRARIES install-man \ - install-nobase_dist_protoDATA install-nobase_includeHEADERS \ - install-pdf install-pdf-am install-ps install-ps-am \ - install-strip installcheck installcheck-am installdirs \ - maintainer-clean maintainer-clean-generic mostlyclean \ - mostlyclean-compile mostlyclean-generic mostlyclean-libtool \ - pdf pdf-am ps ps-am recheck tags tags-am uninstall \ - uninstall-am uninstall-binPROGRAMS uninstall-libLTLIBRARIES \ - uninstall-nobase_dist_protoDATA \ - uninstall-nobase_includeHEADERS - -.PRECIOUS: Makefile - - -# Not sure why these don't get cleaned automatically. -clean-local: - rm -f *.loT - -@USE_EXTERNAL_PROTOC_TRUE@unittest_proto_middleman: $(protoc_inputs) -@USE_EXTERNAL_PROTOC_TRUE@ $(PROTOC) -I$(srcdir) --cpp_out=. $^ -@USE_EXTERNAL_PROTOC_TRUE@ touch unittest_proto_middleman - -# We have to cd to $(srcdir) before executing protoc because $(protoc_inputs) is -# relative to srcdir, which may not be the same as the current directory when -# building out-of-tree. -@USE_EXTERNAL_PROTOC_FALSE@unittest_proto_middleman: protoc$(EXEEXT) $(protoc_inputs) -@USE_EXTERNAL_PROTOC_FALSE@ oldpwd=`pwd` && ( cd $(srcdir) && $$oldpwd/protoc$(EXEEXT) -I. --cpp_out=$$oldpwd $(protoc_inputs) --experimental_allow_proto3_optional ) -@USE_EXTERNAL_PROTOC_FALSE@ touch unittest_proto_middleman - -$(protoc_outputs): unittest_proto_middleman -$(am_protobuf_test_OBJECTS): unittest_proto_middleman -$(am_protobuf_lazy_descriptor_test_OBJECTS): unittest_proto_middleman -$(am_protobuf_lite_test_OBJECTS): unittest_proto_middleman -$(am_protobuf_lite_arena_test_OBJECTS): unittest_proto_middleman - -# This test target is to ensure all our public header files and generated -# code is free from warnings. We have to be more pedantic about these -# files because they are compiled by users with different compiler flags. -no_warning_test.cc: - echo "// Generated from Makefile.am" > no_warning_test.cc - for FILE in $(nobase_include_HEADERS); do \ - 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 - -# Tell versions [3.59,3.63) of GNU make to not export all variables. -# Otherwise a system limit (for SysV at least) may be exceeded. -.NOEXPORT: diff --git a/extra/protobuf/protobuf-3.19.4/src/README.md b/extra/protobuf/protobuf-3.19.4/src/README.md deleted file mode 100644 index 9db40fdde467..000000000000 --- a/extra/protobuf/protobuf-3.19.4/src/README.md +++ /dev/null @@ -1,230 +0,0 @@ -Protocol Buffers - Google's data interchange format -=================================================== - -Copyright 2008 Google Inc. - -https://developers.google.com/protocol-buffers/ - -C++ Installation - Unix ------------------------ - -To build protobuf from source, the following tools are needed: - - * autoconf - * automake - * libtool - * make - * g++ - * unzip - -On Ubuntu/Debian, you can install them with: - - sudo apt-get install autoconf automake libtool curl make g++ unzip - -On other platforms, please use the corresponding package managing tool to -install them before proceeding. - -To get the source, download one of the release .tar.gz or .zip packages in the -release page: - - https://github.com/protocolbuffers/protobuf/releases/latest - -For example: if you only need C++, download `protobuf-cpp-[VERSION].tar.gz`; if -you need C++ and Java, download `protobuf-java-[VERSION].tar.gz` (every package -contains C++ source already); if you need C++ and multiple other languages, -download `protobuf-all-[VERSION].tar.gz`. - -You can also get the source by "git clone" our git repository. Make sure you -have also cloned the submodules and generated the configure script (skip this -if you are using a release .tar.gz or .zip package): - - git clone https://github.com/protocolbuffers/protobuf.git - cd protobuf - git submodule update --init --recursive - ./autogen.sh - -To build and install the C++ Protocol Buffer runtime and the Protocol -Buffer compiler (protoc) execute the following: - - - ./configure - make - make check - sudo make install - sudo ldconfig # refresh shared library cache. - -If "make check" fails, you can still install, but it is likely that -some features of this library will not work correctly on your system. -Proceed at your own risk. - -For advanced usage information on configure and make, please refer to the -autoconf documentation: - - http://www.gnu.org/software/autoconf/manual/autoconf.html#Running-configure-Scripts - -**Hint on install location** - -By default, the package will be installed to /usr/local. However, -on many platforms, /usr/local/lib is not part of LD_LIBRARY_PATH. -You can add it, but it may be easier to just install to /usr -instead. To do this, invoke configure as follows: - - ./configure --prefix=/usr - -If you already built the package with a different prefix, make sure -to run "make clean" before building again. - -**Compiling dependent packages** - -To compile a package that uses Protocol Buffers, you need to pass -various flags to your compiler and linker. As of version 2.2.0, -Protocol Buffers integrates with pkg-config to manage this. If you -have pkg-config installed, then you can invoke it to get a list of -flags like so: - - - pkg-config --cflags protobuf # print compiler flags - pkg-config --libs protobuf # print linker flags - pkg-config --cflags --libs protobuf # print both - - -For example: - - c++ my_program.cc my_proto.pb.cc `pkg-config --cflags --libs protobuf` - -Note that packages written prior to the 2.2.0 release of Protocol -Buffers may not yet integrate with pkg-config to get flags, and may -not pass the correct set of flags to correctly link against -libprotobuf. If the package in question uses autoconf, you can -often fix the problem by invoking its configure script like: - - - configure CXXFLAGS="$(pkg-config --cflags protobuf)" \ - LIBS="$(pkg-config --libs protobuf)" - -This will force it to use the correct flags. - -If you are writing an autoconf-based package that uses Protocol -Buffers, you should probably use the PKG_CHECK_MODULES macro in your -configure script like: - - PKG_CHECK_MODULES([protobuf], [protobuf]) - -See the pkg-config man page for more info. - -If you only want protobuf-lite, substitute "protobuf-lite" in place -of "protobuf" in these examples. - -**Note for Mac users** - -For a Mac system, Unix tools are not available by default. You will first need -to install Xcode from the Mac AppStore and then run the following command from -a terminal: - - sudo xcode-select --install - -To install Unix tools, you can install "port" following the instructions at -https://www.macports.org . This will reside in /opt/local/bin/port for most -Mac installations. - - sudo /opt/local/bin/port install autoconf automake libtool - -Then follow the Unix instructions above. - -**Note for cross-compiling** - -The makefiles normally invoke the protoc executable that they just -built in order to build tests. When cross-compiling, the protoc -executable may not be executable on the host machine. In this case, -you must build a copy of protoc for the host machine first, then use -the --with-protoc option to tell configure to use it instead. For -example: - - ./configure --with-protoc=protoc - -This will use the installed protoc (found in your $PATH) instead of -trying to execute the one built during the build process. You can -also use an executable that hasn't been installed. For example, if -you built the protobuf package for your host machine in ../host, -you might do: - - ./configure --with-protoc=../host/src/protoc - -Either way, you must make sure that the protoc executable you use -has the same version as the protobuf source code you are trying to -use it with. - -**Note for Solaris users** - -Solaris 10 x86 has a bug that will make linking fail, complaining -about libstdc++.la being invalid. We have included a work-around -in this package. To use the work-around, run configure as follows: - - ./configure LDFLAGS=-L$PWD/src/solaris - -See src/solaris/libstdc++.la for more info on this bug. - -**Note for HP C++ Tru64 users** - -To compile invoke configure as follows: - - ./configure CXXFLAGS="-O -std ansi -ieee -D__USE_STD_IOSTREAM" - -Also, you will need to use gmake instead of make. - -**Note for AIX users** - -Compile using the IBM xlC C++ compiler as follows: - - ./configure CXX=xlC - -Also, you will need to use GNU `make` (`gmake`) instead of AIX `make`. - -C++ Installation - Windows --------------------------- - -If you only need the protoc binary, you can download it from the release -page: - - https://github.com/protocolbuffers/protobuf/releases/latest - -In the downloads section, download the zip file protoc-$VERSION-win32.zip. -It contains the protoc binary as well as public proto files of protobuf -library. - -Protobuf and its dependencies can be installed directly by using `vcpkg`: - - >vcpkg install protobuf protobuf:x64-windows - -If zlib support is desired, you'll also need to install the zlib feature: - - >vcpkg install protobuf[zlib] protobuf[zlib]:x64-windows - -See https://github.com/Microsoft/vcpkg for more information. - -To build from source using Microsoft Visual C++, see [cmake/README.md](../cmake/README.md). - -To build from source using Cygwin or MinGW, follow the Unix installation -instructions, above. - -Binary Compatibility Warning ----------------------------- - -Due to the nature of C++, it is unlikely that any two versions of the -Protocol Buffers C++ runtime libraries will have compatible ABIs. -That is, if you linked an executable against an older version of -libprotobuf, it is unlikely to work with a newer version without -re-compiling. This problem, when it occurs, will normally be detected -immediately on startup of your app. Still, you may want to consider -using static linkage. You can configure this package to install -static libraries only using: - - ./configure --disable-shared - -Usage ------ - -The complete documentation for Protocol Buffers is available via the -web at: - -https://developers.google.com/protocol-buffers/ diff --git a/extra/protobuf/protobuf-3.19.4/src/google/protobuf/any.cc b/extra/protobuf/protobuf-3.19.4/src/google/protobuf/any.cc deleted file mode 100644 index 73c002f60409..000000000000 --- a/extra/protobuf/protobuf-3.19.4/src/google/protobuf/any.cc +++ /dev/null @@ -1,83 +0,0 @@ -// Protocol Buffers - Google's data interchange format -// Copyright 2008 Google Inc. All rights reserved. -// https://developers.google.com/protocol-buffers/ -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// * Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// * Redistributions in binary form must reproduce the above -// copyright notice, this list of conditions and the following disclaimer -// in the documentation and/or other materials provided with the -// distribution. -// * Neither the name of Google Inc. nor the names of its -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -#include - -#include -#include -#include -#include - -#include - -namespace google { -namespace protobuf { -namespace internal { - -bool AnyMetadata::PackFrom(Arena* arena, const Message& message) { - return PackFrom(arena, message, kTypeGoogleApisComPrefix); -} - -bool AnyMetadata::PackFrom(Arena* arena, const Message& message, - StringPiece type_url_prefix) { - type_url_->Set( - &::PROTOBUF_NAMESPACE_ID::internal::GetEmptyString(), - GetTypeUrl(message.GetDescriptor()->full_name(), type_url_prefix), arena); - return message.SerializeToString( - value_->Mutable(ArenaStringPtr::EmptyDefault{}, arena)); -} - -bool AnyMetadata::UnpackTo(Message* message) const { - if (!InternalIs(message->GetDescriptor()->full_name())) { - return false; - } - return message->ParseFromString(value_->Get()); -} - -bool GetAnyFieldDescriptors(const Message& message, - const FieldDescriptor** type_url_field, - const FieldDescriptor** value_field) { - const Descriptor* descriptor = message.GetDescriptor(); - if (descriptor->full_name() != kAnyFullTypeName) { - return false; - } - *type_url_field = descriptor->FindFieldByNumber(1); - *value_field = descriptor->FindFieldByNumber(2); - return (*type_url_field != nullptr && - (*type_url_field)->type() == FieldDescriptor::TYPE_STRING && - *value_field != nullptr && - (*value_field)->type() == FieldDescriptor::TYPE_BYTES); -} - -} // namespace internal -} // namespace protobuf -} // namespace google - -#include diff --git a/extra/protobuf/protobuf-3.19.4/src/google/protobuf/any.h b/extra/protobuf/protobuf-3.19.4/src/google/protobuf/any.h deleted file mode 100644 index e8336fa14a37..000000000000 --- a/extra/protobuf/protobuf-3.19.4/src/google/protobuf/any.h +++ /dev/null @@ -1,156 +0,0 @@ -// Protocol Buffers - Google's data interchange format -// Copyright 2008 Google Inc. All rights reserved. -// https://developers.google.com/protocol-buffers/ -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// * Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// * Redistributions in binary form must reproduce the above -// copyright notice, this list of conditions and the following disclaimer -// in the documentation and/or other materials provided with the -// distribution. -// * Neither the name of Google Inc. nor the names of its -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -#ifndef GOOGLE_PROTOBUF_ANY_H__ -#define GOOGLE_PROTOBUF_ANY_H__ - -#include - -#include -#include -#include - -#include - -namespace google { -namespace protobuf { - -class FieldDescriptor; -class Message; - -namespace internal { - -extern const char kAnyFullTypeName[]; // "google.protobuf.Any". -extern const char kTypeGoogleApisComPrefix[]; // "type.googleapis.com/". -extern const char kTypeGoogleProdComPrefix[]; // "type.googleprod.com/". - -std::string GetTypeUrl(StringPiece message_name, - StringPiece type_url_prefix); - -// Helper class used to implement google::protobuf::Any. -class PROTOBUF_EXPORT AnyMetadata { - typedef ArenaStringPtr UrlType; - typedef ArenaStringPtr ValueType; - public: - // AnyMetadata does not take ownership of "type_url" and "value". - constexpr AnyMetadata(UrlType* type_url, ValueType* value) - : type_url_(type_url), value_(value) {} - - // Packs a message using the default type URL prefix: "type.googleapis.com". - // The resulted type URL will be "type.googleapis.com/". - // Returns false if serializing the message failed. - template - bool PackFrom(Arena* arena, const T& message) { - return InternalPackFrom(arena, message, kTypeGoogleApisComPrefix, - T::FullMessageName()); - } - - bool PackFrom(Arena* arena, const Message& message); - - // Packs a message using the given type URL prefix. The type URL will be - // constructed by concatenating the message type's full name to the prefix - // with an optional "/" separator if the prefix doesn't already end with "/". - // For example, both PackFrom(message, "type.googleapis.com") and - // PackFrom(message, "type.googleapis.com/") yield the same result type - // URL: "type.googleapis.com/". - // Returns false if serializing the message failed. - template - bool PackFrom(Arena* arena, const T& message, - StringPiece type_url_prefix) { - return InternalPackFrom(arena, message, type_url_prefix, - T::FullMessageName()); - } - - bool PackFrom(Arena* arena, const Message& message, - StringPiece type_url_prefix); - - // Unpacks the payload into the given message. Returns false if the message's - // type doesn't match the type specified in the type URL (i.e., the full - // name after the last "/" of the type URL doesn't match the message's actual - // full name) or parsing the payload has failed. - template - bool UnpackTo(T* message) const { - return InternalUnpackTo(T::FullMessageName(), message); - } - - bool UnpackTo(Message* message) const; - - // Checks whether the type specified in the type URL matches the given type. - // A type is considered matching if its full name matches the full name after - // the last "/" in the type URL. - template - bool Is() const { - return InternalIs(T::FullMessageName()); - } - - private: - bool InternalPackFrom(Arena* arena, const MessageLite& message, - StringPiece type_url_prefix, - StringPiece type_name); - bool InternalUnpackTo(StringPiece type_name, - MessageLite* message) const; - bool InternalIs(StringPiece type_name) const; - - UrlType* type_url_; - ValueType* value_; - - GOOGLE_DISALLOW_EVIL_CONSTRUCTORS(AnyMetadata); -}; - -// Get the proto type name from Any::type_url value. For example, passing -// "type.googleapis.com/rpc.QueryOrigin" will return "rpc.QueryOrigin" in -// *full_type_name. Returns false if the type_url does not have a "/" -// in the type url separating the full type name. -// -// NOTE: this function is available publicly as: -// google::protobuf::Any() // static method on the generated message type. -bool ParseAnyTypeUrl(StringPiece type_url, std::string* full_type_name); - -// Get the proto type name and prefix from Any::type_url value. For example, -// passing "type.googleapis.com/rpc.QueryOrigin" will return -// "type.googleapis.com/" in *url_prefix and "rpc.QueryOrigin" in -// *full_type_name. Returns false if the type_url does not have a "/" in the -// type url separating the full type name. -bool ParseAnyTypeUrl(StringPiece type_url, std::string* url_prefix, - std::string* full_type_name); - -// See if message is of type google.protobuf.Any, if so, return the descriptors -// for "type_url" and "value" fields. -bool GetAnyFieldDescriptors(const Message& message, - const FieldDescriptor** type_url_field, - const FieldDescriptor** value_field); - -} // namespace internal -} // namespace protobuf -} // namespace google - -#include - -#endif // GOOGLE_PROTOBUF_ANY_H__ diff --git a/extra/protobuf/protobuf-3.19.4/src/google/protobuf/any.pb.cc b/extra/protobuf/protobuf-3.19.4/src/google/protobuf/any.pb.cc deleted file mode 100644 index 52c6ccca2f24..000000000000 --- a/extra/protobuf/protobuf-3.19.4/src/google/protobuf/any.pb.cc +++ /dev/null @@ -1,352 +0,0 @@ -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: google/protobuf/any.proto - -#include - -#include - -#include -#include -#include -#include -#include -#include -#include -// @@protoc_insertion_point(includes) -#include - -PROTOBUF_PRAGMA_INIT_SEG -PROTOBUF_NAMESPACE_OPEN -constexpr Any::Any( - ::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized) - : type_url_(&::PROTOBUF_NAMESPACE_ID::internal::fixed_address_empty_string) - , value_(&::PROTOBUF_NAMESPACE_ID::internal::fixed_address_empty_string) - , _any_metadata_(&type_url_, &value_){} -struct AnyDefaultTypeInternal { - constexpr AnyDefaultTypeInternal() - : _instance(::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized{}) {} - ~AnyDefaultTypeInternal() {} - union { - Any _instance; - }; -}; -PROTOBUF_ATTRIBUTE_NO_DESTROY PROTOBUF_CONSTINIT AnyDefaultTypeInternal _Any_default_instance_; -PROTOBUF_NAMESPACE_CLOSE -static ::PROTOBUF_NAMESPACE_ID::Metadata file_level_metadata_google_2fprotobuf_2fany_2eproto[1]; -static constexpr ::PROTOBUF_NAMESPACE_ID::EnumDescriptor const** file_level_enum_descriptors_google_2fprotobuf_2fany_2eproto = nullptr; -static constexpr ::PROTOBUF_NAMESPACE_ID::ServiceDescriptor const** file_level_service_descriptors_google_2fprotobuf_2fany_2eproto = nullptr; - -const uint32_t TableStruct_google_2fprotobuf_2fany_2eproto::offsets[] PROTOBUF_SECTION_VARIABLE(protodesc_cold) = { - ~0u, // no _has_bits_ - 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_), -}; -static const ::PROTOBUF_NAMESPACE_ID::internal::MigrationSchema schemas[] PROTOBUF_SECTION_VARIABLE(protodesc_cold) = { - { 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_), -}; - -const char descriptor_table_protodef_google_2fprotobuf_2fany_2eproto[] PROTOBUF_SECTION_VARIABLE(protodesc_cold) = - "\n\031google/protobuf/any.proto\022\017google.prot" - "obuf\"&\n\003Any\022\020\n\010type_url\030\001 \001(\t\022\r\n\005value\030\002" - " \001(\014Bv\n\023com.google.protobufB\010AnyProtoP\001Z" - ",google.golang.org/protobuf/types/known/" - "anypb\242\002\003GPB\252\002\036Google.Protobuf.WellKnownT" - "ypesb\006proto3" - ; -static ::PROTOBUF_NAMESPACE_ID::internal::once_flag descriptor_table_google_2fprotobuf_2fany_2eproto_once; -const ::PROTOBUF_NAMESPACE_ID::internal::DescriptorTable descriptor_table_google_2fprotobuf_2fany_2eproto = { - false, false, 212, descriptor_table_protodef_google_2fprotobuf_2fany_2eproto, "google/protobuf/any.proto", - &descriptor_table_google_2fprotobuf_2fany_2eproto_once, nullptr, 0, 1, - schemas, file_default_instances, TableStruct_google_2fprotobuf_2fany_2eproto::offsets, - file_level_metadata_google_2fprotobuf_2fany_2eproto, file_level_enum_descriptors_google_2fprotobuf_2fany_2eproto, file_level_service_descriptors_google_2fprotobuf_2fany_2eproto, -}; -PROTOBUF_ATTRIBUTE_WEAK const ::PROTOBUF_NAMESPACE_ID::internal::DescriptorTable* descriptor_table_google_2fprotobuf_2fany_2eproto_getter() { - return &descriptor_table_google_2fprotobuf_2fany_2eproto; -} - -// Force running AddDescriptors() at dynamic initialization time. -PROTOBUF_ATTRIBUTE_INIT_PRIORITY static ::PROTOBUF_NAMESPACE_ID::internal::AddDescriptorsRunner dynamic_init_dummy_google_2fprotobuf_2fany_2eproto(&descriptor_table_google_2fprotobuf_2fany_2eproto); -PROTOBUF_NAMESPACE_OPEN - -// =================================================================== - -bool Any::GetAnyFieldDescriptors( - const ::PROTOBUF_NAMESPACE_ID::Message& message, - const ::PROTOBUF_NAMESPACE_ID::FieldDescriptor** type_url_field, - const ::PROTOBUF_NAMESPACE_ID::FieldDescriptor** value_field) { - return ::PROTOBUF_NAMESPACE_ID::internal::GetAnyFieldDescriptors( - message, type_url_field, value_field); -} -bool Any::ParseAnyTypeUrl( - ::PROTOBUF_NAMESPACE_ID::ConstStringParam type_url, - std::string* full_type_name) { - return ::PROTOBUF_NAMESPACE_ID::internal::ParseAnyTypeUrl(type_url, - full_type_name); -} - -class Any::_Internal { - public: -}; - -Any::Any(::PROTOBUF_NAMESPACE_ID::Arena* arena, - bool is_message_owned) - : ::PROTOBUF_NAMESPACE_ID::Message(arena, is_message_owned), - _any_metadata_(&type_url_, &value_) { - SharedCtor(); - if (!is_message_owned) { - RegisterArenaDtor(arena); - } - // @@protoc_insertion_point(arena_constructor:google.protobuf.Any) -} -Any::Any(const Any& from) - : ::PROTOBUF_NAMESPACE_ID::Message(), - _any_metadata_(&type_url_, &value_) { - _internal_metadata_.MergeFrom<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(from._internal_metadata_); - type_url_.UnsafeSetDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited()); - #ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING - type_url_.Set(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), "", GetArenaForAllocation()); - #endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING - if (!from._internal_type_url().empty()) { - type_url_.Set(::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::EmptyDefault{}, from._internal_type_url(), - GetArenaForAllocation()); - } - value_.UnsafeSetDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited()); - #ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING - value_.Set(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), "", GetArenaForAllocation()); - #endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING - if (!from._internal_value().empty()) { - value_.Set(::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::EmptyDefault{}, from._internal_value(), - GetArenaForAllocation()); - } - // @@protoc_insertion_point(copy_constructor:google.protobuf.Any) -} - -inline void Any::SharedCtor() { -type_url_.UnsafeSetDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited()); -#ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING - type_url_.Set(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), "", GetArenaForAllocation()); -#endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING -value_.UnsafeSetDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited()); -#ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING - value_.Set(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), "", GetArenaForAllocation()); -#endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING -} - -Any::~Any() { - // @@protoc_insertion_point(destructor:google.protobuf.Any) - if (GetArenaForAllocation() != nullptr) return; - SharedDtor(); - _internal_metadata_.Delete<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(); -} - -inline void Any::SharedDtor() { - GOOGLE_DCHECK(GetArenaForAllocation() == nullptr); - type_url_.DestroyNoArena(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited()); - value_.DestroyNoArena(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited()); -} - -void Any::ArenaDtor(void* object) { - Any* _this = reinterpret_cast< Any* >(object); - (void)_this; -} -void Any::RegisterArenaDtor(::PROTOBUF_NAMESPACE_ID::Arena*) { -} -void Any::SetCachedSize(int size) const { - _cached_size_.Set(size); -} - -void Any::Clear() { -// @@protoc_insertion_point(message_clear_start:google.protobuf.Any) - uint32_t cached_has_bits = 0; - // Prevent compiler warnings about cached_has_bits being unused - (void) cached_has_bits; - - type_url_.ClearToEmpty(); - value_.ClearToEmpty(); - _internal_metadata_.Clear<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(); -} - -const char* Any::_InternalParse(const char* ptr, ::PROTOBUF_NAMESPACE_ID::internal::ParseContext* ctx) { -#define CHK_(x) if (PROTOBUF_PREDICT_FALSE(!(x))) goto failure - while (!ctx->Done(&ptr)) { - uint32_t tag; - ptr = ::PROTOBUF_NAMESPACE_ID::internal::ReadTag(ptr, &tag); - switch (tag >> 3) { - // string type_url = 1; - case 1: - if (PROTOBUF_PREDICT_TRUE(static_cast(tag) == 10)) { - auto str = _internal_mutable_type_url(); - ptr = ::PROTOBUF_NAMESPACE_ID::internal::InlineGreedyStringParser(str, ptr, ctx); - CHK_(::PROTOBUF_NAMESPACE_ID::internal::VerifyUTF8(str, "google.protobuf.Any.type_url")); - CHK_(ptr); - } else - goto handle_unusual; - continue; - // bytes value = 2; - case 2: - if (PROTOBUF_PREDICT_TRUE(static_cast(tag) == 18)) { - auto str = _internal_mutable_value(); - ptr = ::PROTOBUF_NAMESPACE_ID::internal::InlineGreedyStringParser(str, ptr, ctx); - CHK_(ptr); - } else - goto handle_unusual; - continue; - default: - goto handle_unusual; - } // switch - handle_unusual: - if ((tag == 0) || ((tag & 7) == 4)) { - CHK_(ptr); - ctx->SetLastTag(tag); - goto message_done; - } - ptr = UnknownFieldParse( - tag, - _internal_metadata_.mutable_unknown_fields<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(), - ptr, ctx); - CHK_(ptr != nullptr); - } // while -message_done: - return ptr; -failure: - ptr = nullptr; - goto message_done; -#undef CHK_ -} - -uint8_t* Any::_InternalSerialize( - uint8_t* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const { - // @@protoc_insertion_point(serialize_to_array_start:google.protobuf.Any) - uint32_t cached_has_bits = 0; - (void) cached_has_bits; - - // string type_url = 1; - if (!this->_internal_type_url().empty()) { - ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::VerifyUtf8String( - this->_internal_type_url().data(), static_cast(this->_internal_type_url().length()), - ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::SERIALIZE, - "google.protobuf.Any.type_url"); - target = stream->WriteStringMaybeAliased( - 1, this->_internal_type_url(), target); - } - - // bytes value = 2; - if (!this->_internal_value().empty()) { - target = stream->WriteBytesMaybeAliased( - 2, this->_internal_value(), target); - } - - if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) { - target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::InternalSerializeUnknownFieldsToArray( - _internal_metadata_.unknown_fields<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(::PROTOBUF_NAMESPACE_ID::UnknownFieldSet::default_instance), target, stream); - } - // @@protoc_insertion_point(serialize_to_array_end:google.protobuf.Any) - return target; -} - -size_t Any::ByteSizeLong() const { -// @@protoc_insertion_point(message_byte_size_start:google.protobuf.Any) - size_t total_size = 0; - - uint32_t cached_has_bits = 0; - // Prevent compiler warnings about cached_has_bits being unused - (void) cached_has_bits; - - // string type_url = 1; - if (!this->_internal_type_url().empty()) { - total_size += 1 + - ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::StringSize( - this->_internal_type_url()); - } - - // bytes value = 2; - if (!this->_internal_value().empty()) { - total_size += 1 + - ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::BytesSize( - this->_internal_value()); - } - - return MaybeComputeUnknownFieldsSize(total_size, &_cached_size_); -} - -const ::PROTOBUF_NAMESPACE_ID::Message::ClassData Any::_class_data_ = { - ::PROTOBUF_NAMESPACE_ID::Message::CopyWithSizeCheck, - Any::MergeImpl -}; -const ::PROTOBUF_NAMESPACE_ID::Message::ClassData*Any::GetClassData() const { return &_class_data_; } - -void Any::MergeImpl(::PROTOBUF_NAMESPACE_ID::Message* to, - const ::PROTOBUF_NAMESPACE_ID::Message& from) { - static_cast(to)->MergeFrom( - static_cast(from)); -} - - -void Any::MergeFrom(const Any& from) { -// @@protoc_insertion_point(class_specific_merge_from_start:google.protobuf.Any) - GOOGLE_DCHECK_NE(&from, this); - uint32_t cached_has_bits = 0; - (void) cached_has_bits; - - if (!from._internal_type_url().empty()) { - _internal_set_type_url(from._internal_type_url()); - } - if (!from._internal_value().empty()) { - _internal_set_value(from._internal_value()); - } - _internal_metadata_.MergeFrom<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(from._internal_metadata_); -} - -void Any::CopyFrom(const Any& from) { -// @@protoc_insertion_point(class_specific_copy_from_start:google.protobuf.Any) - if (&from == this) return; - Clear(); - MergeFrom(from); -} - -bool Any::IsInitialized() const { - return true; -} - -void Any::InternalSwap(Any* other) { - using std::swap; - auto* lhs_arena = GetArenaForAllocation(); - auto* rhs_arena = other->GetArenaForAllocation(); - _internal_metadata_.InternalSwap(&other->_internal_metadata_); - ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::InternalSwap( - &::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), - &type_url_, lhs_arena, - &other->type_url_, rhs_arena - ); - ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::InternalSwap( - &::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), - &value_, lhs_arena, - &other->value_, rhs_arena - ); -} - -::PROTOBUF_NAMESPACE_ID::Metadata Any::GetMetadata() const { - return ::PROTOBUF_NAMESPACE_ID::internal::AssignDescriptors( - &descriptor_table_google_2fprotobuf_2fany_2eproto_getter, &descriptor_table_google_2fprotobuf_2fany_2eproto_once, - file_level_metadata_google_2fprotobuf_2fany_2eproto[0]); -} - -// @@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); -} -PROTOBUF_NAMESPACE_CLOSE - -// @@protoc_insertion_point(global_scope) -#include diff --git a/extra/protobuf/protobuf-3.19.4/src/google/protobuf/any.pb.h b/extra/protobuf/protobuf-3.19.4/src/google/protobuf/any.pb.h deleted file mode 100644 index ff7ef9cfa023..000000000000 --- a/extra/protobuf/protobuf-3.19.4/src/google/protobuf/any.pb.h +++ /dev/null @@ -1,391 +0,0 @@ -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: google/protobuf/any.proto - -#ifndef GOOGLE_PROTOBUF_INCLUDED_google_2fprotobuf_2fany_2eproto -#define GOOGLE_PROTOBUF_INCLUDED_google_2fprotobuf_2fany_2eproto - -#include -#include - -#include -#if PROTOBUF_VERSION < 3019000 -#error This file was generated by a newer version of protoc which is -#error incompatible with your Protocol Buffer headers. Please update -#error your headers. -#endif -#if 3019004 < PROTOBUF_MIN_PROTOC_VERSION -#error This file was generated by an older version of protoc which is -#error incompatible with your Protocol Buffer headers. Please -#error regenerate this file with a newer version of protoc. -#endif - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include // IWYU pragma: export -#include // IWYU pragma: export -#include -// @@protoc_insertion_point(includes) -#include -#define PROTOBUF_INTERNAL_EXPORT_google_2fprotobuf_2fany_2eproto PROTOBUF_EXPORT -PROTOBUF_NAMESPACE_OPEN -namespace internal { -class AnyMetadata; -} // namespace internal -PROTOBUF_NAMESPACE_CLOSE - -// Internal implementation detail -- do not use these members. -struct PROTOBUF_EXPORT TableStruct_google_2fprotobuf_2fany_2eproto { - static const ::PROTOBUF_NAMESPACE_ID::internal::ParseTableField entries[] - PROTOBUF_SECTION_VARIABLE(protodesc_cold); - static const ::PROTOBUF_NAMESPACE_ID::internal::AuxiliaryParseTableField aux[] - PROTOBUF_SECTION_VARIABLE(protodesc_cold); - static const ::PROTOBUF_NAMESPACE_ID::internal::ParseTable schema[1] - PROTOBUF_SECTION_VARIABLE(protodesc_cold); - static const ::PROTOBUF_NAMESPACE_ID::internal::FieldMetadata field_metadata[]; - static const ::PROTOBUF_NAMESPACE_ID::internal::SerializationTable serialization_table[]; - static const uint32_t offsets[]; -}; -PROTOBUF_EXPORT extern const ::PROTOBUF_NAMESPACE_ID::internal::DescriptorTable descriptor_table_google_2fprotobuf_2fany_2eproto; -PROTOBUF_NAMESPACE_OPEN -class Any; -struct AnyDefaultTypeInternal; -PROTOBUF_EXPORT extern AnyDefaultTypeInternal _Any_default_instance_; -PROTOBUF_NAMESPACE_CLOSE -PROTOBUF_NAMESPACE_OPEN -template<> PROTOBUF_EXPORT ::PROTOBUF_NAMESPACE_ID::Any* Arena::CreateMaybeMessage<::PROTOBUF_NAMESPACE_ID::Any>(Arena*); -PROTOBUF_NAMESPACE_CLOSE -PROTOBUF_NAMESPACE_OPEN - -// =================================================================== - -class PROTOBUF_EXPORT Any final : - public ::PROTOBUF_NAMESPACE_ID::Message /* @@protoc_insertion_point(class_definition:google.protobuf.Any) */ { - public: - inline Any() : Any(nullptr) {} - ~Any() override; - explicit constexpr Any(::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized); - - Any(const Any& from); - Any(Any&& from) noexcept - : Any() { - *this = ::std::move(from); - } - - inline Any& operator=(const Any& from) { - CopyFrom(from); - return *this; - } - inline Any& operator=(Any&& from) noexcept { - if (this == &from) return *this; - if (GetOwningArena() == from.GetOwningArena() - #ifdef PROTOBUF_FORCE_COPY_IN_MOVE - && GetOwningArena() != nullptr - #endif // !PROTOBUF_FORCE_COPY_IN_MOVE - ) { - InternalSwap(&from); - } else { - CopyFrom(from); - } - return *this; - } - - static const ::PROTOBUF_NAMESPACE_ID::Descriptor* descriptor() { - return GetDescriptor(); - } - static const ::PROTOBUF_NAMESPACE_ID::Descriptor* GetDescriptor() { - return default_instance().GetMetadata().descriptor; - } - static const ::PROTOBUF_NAMESPACE_ID::Reflection* GetReflection() { - return default_instance().GetMetadata().reflection; - } - static const Any& default_instance() { - return *internal_default_instance(); - } - static inline const Any* internal_default_instance() { - return reinterpret_cast( - &_Any_default_instance_); - } - static constexpr int kIndexInFileMessages = - 0; - - // implements Any ----------------------------------------------- - - bool PackFrom(const ::PROTOBUF_NAMESPACE_ID::Message& message) { - return _any_metadata_.PackFrom(GetArena(), message); - } - bool PackFrom(const ::PROTOBUF_NAMESPACE_ID::Message& message, - ::PROTOBUF_NAMESPACE_ID::ConstStringParam type_url_prefix) { - return _any_metadata_.PackFrom(GetArena(), message, type_url_prefix); - } - bool UnpackTo(::PROTOBUF_NAMESPACE_ID::Message* message) const { - return _any_metadata_.UnpackTo(message); - } - static bool GetAnyFieldDescriptors( - const ::PROTOBUF_NAMESPACE_ID::Message& message, - const ::PROTOBUF_NAMESPACE_ID::FieldDescriptor** type_url_field, - const ::PROTOBUF_NAMESPACE_ID::FieldDescriptor** value_field); - template ::value>::type> - bool PackFrom(const T& message) { - return _any_metadata_.PackFrom(GetArena(), message); - } - template ::value>::type> - bool PackFrom(const T& message, - ::PROTOBUF_NAMESPACE_ID::ConstStringParam type_url_prefix) { - return _any_metadata_.PackFrom(GetArena(), message, type_url_prefix);} - template ::value>::type> - bool UnpackTo(T* message) const { - return _any_metadata_.UnpackTo(message); - } - template bool Is() const { - return _any_metadata_.Is(); - } - static bool ParseAnyTypeUrl(::PROTOBUF_NAMESPACE_ID::ConstStringParam type_url, - std::string* full_type_name); - friend void swap(Any& a, Any& b) { - a.Swap(&b); - } - inline void Swap(Any* other) { - if (other == this) return; - #ifdef PROTOBUF_FORCE_COPY_IN_SWAP - if (GetOwningArena() != nullptr && - GetOwningArena() == other->GetOwningArena()) { - #else // PROTOBUF_FORCE_COPY_IN_SWAP - if (GetOwningArena() == other->GetOwningArena()) { - #endif // !PROTOBUF_FORCE_COPY_IN_SWAP - InternalSwap(other); - } else { - ::PROTOBUF_NAMESPACE_ID::internal::GenericSwap(this, other); - } - } - void UnsafeArenaSwap(Any* other) { - if (other == this) return; - GOOGLE_DCHECK(GetOwningArena() == other->GetOwningArena()); - InternalSwap(other); - } - - // implements Message ---------------------------------------------- - - Any* New(::PROTOBUF_NAMESPACE_ID::Arena* arena = nullptr) const final { - return CreateMaybeMessage(arena); - } - using ::PROTOBUF_NAMESPACE_ID::Message::CopyFrom; - void CopyFrom(const Any& from); - using ::PROTOBUF_NAMESPACE_ID::Message::MergeFrom; - void MergeFrom(const Any& from); - private: - static void MergeImpl(::PROTOBUF_NAMESPACE_ID::Message* to, const ::PROTOBUF_NAMESPACE_ID::Message& from); - public: - PROTOBUF_ATTRIBUTE_REINITIALIZES void Clear() final; - bool IsInitialized() const final; - - size_t ByteSizeLong() const final; - const char* _InternalParse(const char* ptr, ::PROTOBUF_NAMESPACE_ID::internal::ParseContext* ctx) final; - uint8_t* _InternalSerialize( - uint8_t* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const final; - int GetCachedSize() const final { return _cached_size_.Get(); } - - private: - void SharedCtor(); - void SharedDtor(); - void SetCachedSize(int size) const final; - void InternalSwap(Any* other); - - private: - friend class ::PROTOBUF_NAMESPACE_ID::internal::AnyMetadata; - static ::PROTOBUF_NAMESPACE_ID::StringPiece FullMessageName() { - return "google.protobuf.Any"; - } - protected: - explicit Any(::PROTOBUF_NAMESPACE_ID::Arena* arena, - bool is_message_owned = false); - private: - static void ArenaDtor(void* object); - inline void RegisterArenaDtor(::PROTOBUF_NAMESPACE_ID::Arena* arena); - public: - - static const ClassData _class_data_; - const ::PROTOBUF_NAMESPACE_ID::Message::ClassData*GetClassData() const final; - - ::PROTOBUF_NAMESPACE_ID::Metadata GetMetadata() const final; - - // nested types ---------------------------------------------------- - - // accessors ------------------------------------------------------- - - enum : int { - kTypeUrlFieldNumber = 1, - kValueFieldNumber = 2, - }; - // string type_url = 1; - void clear_type_url(); - const std::string& type_url() const; - template - void set_type_url(ArgT0&& arg0, ArgT... args); - std::string* mutable_type_url(); - PROTOBUF_NODISCARD std::string* release_type_url(); - void set_allocated_type_url(std::string* type_url); - private: - const std::string& _internal_type_url() const; - inline PROTOBUF_ALWAYS_INLINE void _internal_set_type_url(const std::string& value); - std::string* _internal_mutable_type_url(); - public: - - // bytes value = 2; - void clear_value(); - const std::string& value() const; - template - void set_value(ArgT0&& arg0, ArgT... args); - std::string* mutable_value(); - PROTOBUF_NODISCARD std::string* release_value(); - void set_allocated_value(std::string* value); - private: - const std::string& _internal_value() const; - inline PROTOBUF_ALWAYS_INLINE void _internal_set_value(const std::string& value); - std::string* _internal_mutable_value(); - public: - - // @@protoc_insertion_point(class_scope:google.protobuf.Any) - private: - class _Internal; - - template friend class ::PROTOBUF_NAMESPACE_ID::Arena::InternalHelper; - typedef void InternalArenaConstructable_; - typedef void DestructorSkippable_; - ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr type_url_; - ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr value_; - mutable ::PROTOBUF_NAMESPACE_ID::internal::CachedSize _cached_size_; - ::PROTOBUF_NAMESPACE_ID::internal::AnyMetadata _any_metadata_; - friend struct ::TableStruct_google_2fprotobuf_2fany_2eproto; -}; -// =================================================================== - - -// =================================================================== - -#ifdef __GNUC__ - #pragma GCC diagnostic push - #pragma GCC diagnostic ignored "-Wstrict-aliasing" -#endif // __GNUC__ -// Any - -// string type_url = 1; -inline void Any::clear_type_url() { - type_url_.ClearToEmpty(); -} -inline const std::string& Any::type_url() const { - // @@protoc_insertion_point(field_get:google.protobuf.Any.type_url) - return _internal_type_url(); -} -template -inline PROTOBUF_ALWAYS_INLINE -void Any::set_type_url(ArgT0&& arg0, ArgT... args) { - - type_url_.Set(::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::EmptyDefault{}, static_cast(arg0), args..., GetArenaForAllocation()); - // @@protoc_insertion_point(field_set:google.protobuf.Any.type_url) -} -inline std::string* Any::mutable_type_url() { - std::string* _s = _internal_mutable_type_url(); - // @@protoc_insertion_point(field_mutable:google.protobuf.Any.type_url) - return _s; -} -inline const std::string& Any::_internal_type_url() const { - return type_url_.Get(); -} -inline void Any::_internal_set_type_url(const std::string& value) { - - type_url_.Set(::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::EmptyDefault{}, value, GetArenaForAllocation()); -} -inline std::string* Any::_internal_mutable_type_url() { - - return type_url_.Mutable(::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::EmptyDefault{}, GetArenaForAllocation()); -} -inline std::string* Any::release_type_url() { - // @@protoc_insertion_point(field_release:google.protobuf.Any.type_url) - return type_url_.Release(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), GetArenaForAllocation()); -} -inline void Any::set_allocated_type_url(std::string* type_url) { - if (type_url != nullptr) { - - } else { - - } - type_url_.SetAllocated(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), type_url, - GetArenaForAllocation()); -#ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING - if (type_url_.IsDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited())) { - type_url_.Set(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), "", GetArenaForAllocation()); - } -#endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING - // @@protoc_insertion_point(field_set_allocated:google.protobuf.Any.type_url) -} - -// bytes value = 2; -inline void Any::clear_value() { - value_.ClearToEmpty(); -} -inline const std::string& Any::value() const { - // @@protoc_insertion_point(field_get:google.protobuf.Any.value) - return _internal_value(); -} -template -inline PROTOBUF_ALWAYS_INLINE -void Any::set_value(ArgT0&& arg0, ArgT... args) { - - value_.SetBytes(::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::EmptyDefault{}, static_cast(arg0), args..., GetArenaForAllocation()); - // @@protoc_insertion_point(field_set:google.protobuf.Any.value) -} -inline std::string* Any::mutable_value() { - std::string* _s = _internal_mutable_value(); - // @@protoc_insertion_point(field_mutable:google.protobuf.Any.value) - return _s; -} -inline const std::string& Any::_internal_value() const { - return value_.Get(); -} -inline void Any::_internal_set_value(const std::string& value) { - - value_.Set(::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::EmptyDefault{}, value, GetArenaForAllocation()); -} -inline std::string* Any::_internal_mutable_value() { - - return value_.Mutable(::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::EmptyDefault{}, GetArenaForAllocation()); -} -inline std::string* Any::release_value() { - // @@protoc_insertion_point(field_release:google.protobuf.Any.value) - return value_.Release(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), GetArenaForAllocation()); -} -inline void Any::set_allocated_value(std::string* value) { - if (value != nullptr) { - - } else { - - } - value_.SetAllocated(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), value, - GetArenaForAllocation()); -#ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING - if (value_.IsDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited())) { - value_.Set(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), "", GetArenaForAllocation()); - } -#endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING - // @@protoc_insertion_point(field_set_allocated:google.protobuf.Any.value) -} - -#ifdef __GNUC__ - #pragma GCC diagnostic pop -#endif // __GNUC__ - -// @@protoc_insertion_point(namespace_scope) - -PROTOBUF_NAMESPACE_CLOSE - -// @@protoc_insertion_point(global_scope) - -#include -#endif // GOOGLE_PROTOBUF_INCLUDED_GOOGLE_PROTOBUF_INCLUDED_google_2fprotobuf_2fany_2eproto diff --git a/extra/protobuf/protobuf-3.19.4/src/google/protobuf/any.proto b/extra/protobuf/protobuf-3.19.4/src/google/protobuf/any.proto deleted file mode 100644 index 6ed8a23cf5a3..000000000000 --- a/extra/protobuf/protobuf-3.19.4/src/google/protobuf/any.proto +++ /dev/null @@ -1,158 +0,0 @@ -// Protocol Buffers - Google's data interchange format -// Copyright 2008 Google Inc. All rights reserved. -// https://developers.google.com/protocol-buffers/ -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// * Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// * Redistributions in binary form must reproduce the above -// copyright notice, this list of conditions and the following disclaimer -// in the documentation and/or other materials provided with the -// distribution. -// * Neither the name of Google Inc. nor the names of its -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -syntax = "proto3"; - -package google.protobuf; - -option csharp_namespace = "Google.Protobuf.WellKnownTypes"; -option go_package = "google.golang.org/protobuf/types/known/anypb"; -option java_package = "com.google.protobuf"; -option java_outer_classname = "AnyProto"; -option java_multiple_files = true; -option objc_class_prefix = "GPB"; - -// `Any` contains an arbitrary serialized protocol buffer message along with a -// URL that describes the type of the serialized message. -// -// Protobuf library provides support to pack/unpack Any values in the form -// of utility functions or additional generated methods of the Any type. -// -// Example 1: Pack and unpack a message in C++. -// -// Foo foo = ...; -// Any any; -// any.PackFrom(foo); -// ... -// if (any.UnpackTo(&foo)) { -// ... -// } -// -// Example 2: Pack and unpack a message in Java. -// -// Foo foo = ...; -// Any any = Any.pack(foo); -// ... -// if (any.is(Foo.class)) { -// foo = any.unpack(Foo.class); -// } -// -// Example 3: Pack and unpack a message in Python. -// -// foo = Foo(...) -// any = Any() -// any.Pack(foo) -// ... -// if any.Is(Foo.DESCRIPTOR): -// any.Unpack(foo) -// ... -// -// Example 4: Pack and unpack a message in Go -// -// foo := &pb.Foo{...} -// any, err := anypb.New(foo) -// if err != nil { -// ... -// } -// ... -// foo := &pb.Foo{} -// if err := any.UnmarshalTo(foo); err != nil { -// ... -// } -// -// The pack methods provided by protobuf library will by default use -// 'type.googleapis.com/full.type.name' as the type URL and the unpack -// methods only use the fully qualified type name after the last '/' -// in the type URL, for example "foo.bar.com/x/y.z" will yield type -// name "y.z". -// -// -// JSON -// ==== -// The JSON representation of an `Any` value uses the regular -// representation of the deserialized, embedded message, with an -// additional field `@type` which contains the type URL. Example: -// -// package google.profile; -// message Person { -// string first_name = 1; -// string last_name = 2; -// } -// -// { -// "@type": "type.googleapis.com/google.profile.Person", -// "firstName": , -// "lastName": -// } -// -// If the embedded message type is well-known and has a custom JSON -// representation, that representation will be embedded adding a field -// `value` which holds the custom JSON in addition to the `@type` -// field. Example (for message [google.protobuf.Duration][]): -// -// { -// "@type": "type.googleapis.com/google.protobuf.Duration", -// "value": "1.212s" -// } -// -message Any { - // A URL/resource name that uniquely identifies the type of the serialized - // protocol buffer message. This string must contain at least - // one "/" character. The last segment of the URL's path must represent - // the fully qualified name of the type (as in - // `path/google.protobuf.Duration`). The name should be in a canonical form - // (e.g., leading "." is not accepted). - // - // In practice, teams usually precompile into the binary all types that they - // expect it to use in the context of Any. However, for URLs which use the - // scheme `http`, `https`, or no scheme, one can optionally set up a type - // server that maps type URLs to message definitions as follows: - // - // * If no scheme is provided, `https` is assumed. - // * An HTTP GET on the URL must yield a [google.protobuf.Type][] - // value in binary format, or produce an error. - // * Applications are allowed to cache lookup results based on the - // URL, or have them precompiled into a binary to avoid any - // lookup. Therefore, binary compatibility needs to be preserved - // on changes to types. (Use versioned type names to manage - // breaking changes.) - // - // Note: this functionality is not currently available in the official - // protobuf release, and it is not used for type URLs beginning with - // type.googleapis.com. - // - // Schemes other than `http`, `https` (or the empty scheme) might be - // used with implementation specific semantics. - // - string type_url = 1; - - // Must be a valid serialized protocol buffer of the above specified type. - bytes value = 2; -} diff --git a/extra/protobuf/protobuf-3.19.4/src/google/protobuf/any_lite.cc b/extra/protobuf/protobuf-3.19.4/src/google/protobuf/any_lite.cc deleted file mode 100644 index a98559da140c..000000000000 --- a/extra/protobuf/protobuf-3.19.4/src/google/protobuf/any_lite.cc +++ /dev/null @@ -1,99 +0,0 @@ -// Protocol Buffers - Google's data interchange format -// Copyright 2008 Google Inc. All rights reserved. -// https://developers.google.com/protocol-buffers/ -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// * Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// * Redistributions in binary form must reproduce the above -// copyright notice, this list of conditions and the following disclaimer -// in the documentation and/or other materials provided with the -// distribution. -// * Neither the name of Google Inc. nor the names of its -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -#include - -#include -#include -#include -#include - -namespace google { -namespace protobuf { -namespace internal { - -std::string GetTypeUrl(StringPiece message_name, - StringPiece type_url_prefix) { - if (!type_url_prefix.empty() && - type_url_prefix[type_url_prefix.size() - 1] == '/') { - return StrCat(type_url_prefix, message_name); - } else { - return StrCat(type_url_prefix, "/", message_name); - } -} - -const char kAnyFullTypeName[] = "google.protobuf.Any"; -const char kTypeGoogleApisComPrefix[] = "type.googleapis.com/"; -const char kTypeGoogleProdComPrefix[] = "type.googleprod.com/"; - -bool AnyMetadata::InternalPackFrom(Arena* arena, const MessageLite& message, - StringPiece type_url_prefix, - StringPiece type_name) { - type_url_->Set(&::google::protobuf::internal::GetEmptyString(), - GetTypeUrl(type_name, type_url_prefix), arena); - return message.SerializeToString( - value_->Mutable(ArenaStringPtr::EmptyDefault{}, arena)); -} - -bool AnyMetadata::InternalUnpackTo(StringPiece type_name, - MessageLite* message) const { - if (!InternalIs(type_name)) { - return false; - } - return message->ParseFromString(value_->Get()); -} - -bool AnyMetadata::InternalIs(StringPiece type_name) const { - StringPiece type_url = type_url_->Get(); - return type_url.size() >= type_name.size() + 1 && - type_url[type_url.size() - type_name.size() - 1] == '/' && - HasSuffixString(type_url, type_name); -} - -bool ParseAnyTypeUrl(StringPiece type_url, std::string* url_prefix, - std::string* full_type_name) { - size_t pos = type_url.find_last_of('/'); - if (pos == std::string::npos || pos + 1 == type_url.size()) { - return false; - } - if (url_prefix) { - *url_prefix = std::string(type_url.substr(0, pos + 1)); - } - *full_type_name = std::string(type_url.substr(pos + 1)); - return true; -} - -bool ParseAnyTypeUrl(StringPiece type_url, std::string* full_type_name) { - return ParseAnyTypeUrl(type_url, nullptr, full_type_name); -} - -} // namespace internal -} // namespace protobuf -} // namespace google diff --git a/extra/protobuf/protobuf-3.19.4/src/google/protobuf/any_test.cc b/extra/protobuf/protobuf-3.19.4/src/google/protobuf/any_test.cc deleted file mode 100644 index 1d136aa5575a..000000000000 --- a/extra/protobuf/protobuf-3.19.4/src/google/protobuf/any_test.cc +++ /dev/null @@ -1,184 +0,0 @@ -// Protocol Buffers - Google's data interchange format -// Copyright 2008 Google Inc. All rights reserved. -// https://developers.google.com/protocol-buffers/ -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// * Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// * Redistributions in binary form must reproduce the above -// copyright notice, this list of conditions and the following disclaimer -// in the documentation and/or other materials provided with the -// distribution. -// * Neither the name of Google Inc. nor the names of its -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -#include -#include -#include - - -// Must be included last. -#include - -namespace google { -namespace protobuf { -namespace { - -TEST(AnyMetadataTest, ConstInit) { - PROTOBUF_CONSTINIT static internal::AnyMetadata metadata(nullptr, nullptr); - (void)metadata; -} - -TEST(AnyTest, TestPackAndUnpack) { - protobuf_unittest::TestAny submessage; - submessage.set_int32_value(12345); - protobuf_unittest::TestAny message; - ASSERT_TRUE(message.mutable_any_value()->PackFrom(submessage)); - - std::string data = message.SerializeAsString(); - - ASSERT_TRUE(message.ParseFromString(data)); - EXPECT_TRUE(message.has_any_value()); - submessage.Clear(); - ASSERT_TRUE(message.any_value().UnpackTo(&submessage)); - EXPECT_EQ(12345, submessage.int32_value()); -} - -TEST(AnyTest, TestPackFromSerializationExceedsSizeLimit) { - protobuf_unittest::TestAny submessage; - submessage.mutable_text()->resize(INT_MAX, 'a'); - protobuf_unittest::TestAny message; - EXPECT_FALSE(message.mutable_any_value()->PackFrom(submessage)); -} - -TEST(AnyTest, TestUnpackWithTypeMismatch) { - protobuf_unittest::TestAny payload; - payload.set_int32_value(13); - google::protobuf::Any any; - any.PackFrom(payload); - - // Attempt to unpack into the wrong type. - protobuf_unittest::TestAllTypes dest; - EXPECT_FALSE(any.UnpackTo(&dest)); -} - -TEST(AnyTest, TestPackAndUnpackAny) { - // We can pack a Any message inside another Any message. - protobuf_unittest::TestAny submessage; - submessage.set_int32_value(12345); - google::protobuf::Any any; - any.PackFrom(submessage); - protobuf_unittest::TestAny message; - message.mutable_any_value()->PackFrom(any); - - std::string data = message.SerializeAsString(); - - ASSERT_TRUE(message.ParseFromString(data)); - EXPECT_TRUE(message.has_any_value()); - any.Clear(); - submessage.Clear(); - ASSERT_TRUE(message.any_value().UnpackTo(&any)); - ASSERT_TRUE(any.UnpackTo(&submessage)); - EXPECT_EQ(12345, submessage.int32_value()); -} - -TEST(AnyTest, TestPackWithCustomTypeUrl) { - protobuf_unittest::TestAny submessage; - submessage.set_int32_value(12345); - google::protobuf::Any any; - // Pack with a custom type URL prefix. - any.PackFrom(submessage, "type.myservice.com"); - EXPECT_EQ("type.myservice.com/protobuf_unittest.TestAny", any.type_url()); - // Pack with a custom type URL prefix ending with '/'. - any.PackFrom(submessage, "type.myservice.com/"); - EXPECT_EQ("type.myservice.com/protobuf_unittest.TestAny", any.type_url()); - // Pack with an empty type URL prefix. - any.PackFrom(submessage, ""); - EXPECT_EQ("/protobuf_unittest.TestAny", any.type_url()); - - // Test unpacking the type. - submessage.Clear(); - EXPECT_TRUE(any.UnpackTo(&submessage)); - EXPECT_EQ(12345, submessage.int32_value()); -} - -TEST(AnyTest, TestIs) { - protobuf_unittest::TestAny submessage; - submessage.set_int32_value(12345); - google::protobuf::Any any; - any.PackFrom(submessage); - ASSERT_TRUE(any.ParseFromString(any.SerializeAsString())); - EXPECT_TRUE(any.Is()); - EXPECT_FALSE(any.Is()); - - protobuf_unittest::TestAny message; - message.mutable_any_value()->PackFrom(any); - ASSERT_TRUE(message.ParseFromString(message.SerializeAsString())); - EXPECT_FALSE(message.any_value().Is()); - EXPECT_TRUE(message.any_value().Is()); - - any.set_type_url("/protobuf_unittest.TestAny"); - EXPECT_TRUE(any.Is()); - // The type URL must contain at least one "/". - any.set_type_url("protobuf_unittest.TestAny"); - EXPECT_FALSE(any.Is()); - // The type name after the slash must be fully qualified. - any.set_type_url("/TestAny"); - EXPECT_FALSE(any.Is()); -} - -TEST(AnyTest, MoveConstructor) { - protobuf_unittest::TestAny payload; - payload.set_int32_value(12345); - - google::protobuf::Any src; - src.PackFrom(payload); - - const char* type_url = src.type_url().data(); - - google::protobuf::Any dst(std::move(src)); - EXPECT_EQ(type_url, dst.type_url().data()); - payload.Clear(); - ASSERT_TRUE(dst.UnpackTo(&payload)); - EXPECT_EQ(12345, payload.int32_value()); -} - -TEST(AnyTest, MoveAssignment) { - protobuf_unittest::TestAny payload; - payload.set_int32_value(12345); - - google::protobuf::Any src; - src.PackFrom(payload); - - const char* type_url = src.type_url().data(); - - google::protobuf::Any dst; - dst = std::move(src); - EXPECT_EQ(type_url, dst.type_url().data()); - payload.Clear(); - ASSERT_TRUE(dst.UnpackTo(&payload)); - EXPECT_EQ(12345, payload.int32_value()); -} - - -} // namespace -} // namespace protobuf -} // namespace google - -#include diff --git a/extra/protobuf/protobuf-3.19.4/src/google/protobuf/any_test.proto b/extra/protobuf/protobuf-3.19.4/src/google/protobuf/any_test.proto deleted file mode 100644 index 256035b4467d..000000000000 --- a/extra/protobuf/protobuf-3.19.4/src/google/protobuf/any_test.proto +++ /dev/null @@ -1,44 +0,0 @@ -// Protocol Buffers - Google's data interchange format -// Copyright 2008 Google Inc. All rights reserved. -// https://developers.google.com/protocol-buffers/ -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// * Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// * Redistributions in binary form must reproduce the above -// copyright notice, this list of conditions and the following disclaimer -// in the documentation and/or other materials provided with the -// distribution. -// * Neither the name of Google Inc. nor the names of its -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -syntax = "proto3"; - -package protobuf_unittest; - -import "google/protobuf/any.proto"; - -option java_outer_classname = "TestAnyProto"; - -message TestAny { - int32 int32_value = 1; - google.protobuf.Any any_value = 2; - repeated google.protobuf.Any repeated_any_value = 3; - string text = 4; -} diff --git a/extra/protobuf/protobuf-3.19.4/src/google/protobuf/api.pb.cc b/extra/protobuf/protobuf-3.19.4/src/google/protobuf/api.pb.cc deleted file mode 100644 index 72cc72e03c02..000000000000 --- a/extra/protobuf/protobuf-3.19.4/src/google/protobuf/api.pb.cc +++ /dev/null @@ -1,1291 +0,0 @@ -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: google/protobuf/api.proto - -#include - -#include - -#include -#include -#include -#include -#include -#include -#include -// @@protoc_insertion_point(includes) -#include - -PROTOBUF_PRAGMA_INIT_SEG -PROTOBUF_NAMESPACE_OPEN -constexpr Api::Api( - ::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized) - : methods_() - , options_() - , mixins_() - , name_(&::PROTOBUF_NAMESPACE_ID::internal::fixed_address_empty_string) - , version_(&::PROTOBUF_NAMESPACE_ID::internal::fixed_address_empty_string) - , source_context_(nullptr) - , syntax_(0) -{} -struct ApiDefaultTypeInternal { - constexpr ApiDefaultTypeInternal() - : _instance(::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized{}) {} - ~ApiDefaultTypeInternal() {} - union { - Api _instance; - }; -}; -PROTOBUF_ATTRIBUTE_NO_DESTROY PROTOBUF_CONSTINIT ApiDefaultTypeInternal _Api_default_instance_; -constexpr Method::Method( - ::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized) - : options_() - , name_(&::PROTOBUF_NAMESPACE_ID::internal::fixed_address_empty_string) - , request_type_url_(&::PROTOBUF_NAMESPACE_ID::internal::fixed_address_empty_string) - , response_type_url_(&::PROTOBUF_NAMESPACE_ID::internal::fixed_address_empty_string) - , request_streaming_(false) - , response_streaming_(false) - , syntax_(0) -{} -struct MethodDefaultTypeInternal { - constexpr MethodDefaultTypeInternal() - : _instance(::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized{}) {} - ~MethodDefaultTypeInternal() {} - union { - Method _instance; - }; -}; -PROTOBUF_ATTRIBUTE_NO_DESTROY PROTOBUF_CONSTINIT MethodDefaultTypeInternal _Method_default_instance_; -constexpr Mixin::Mixin( - ::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized) - : name_(&::PROTOBUF_NAMESPACE_ID::internal::fixed_address_empty_string) - , root_(&::PROTOBUF_NAMESPACE_ID::internal::fixed_address_empty_string){} -struct MixinDefaultTypeInternal { - constexpr MixinDefaultTypeInternal() - : _instance(::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized{}) {} - ~MixinDefaultTypeInternal() {} - union { - Mixin _instance; - }; -}; -PROTOBUF_ATTRIBUTE_NO_DESTROY PROTOBUF_CONSTINIT MixinDefaultTypeInternal _Mixin_default_instance_; -PROTOBUF_NAMESPACE_CLOSE -static ::PROTOBUF_NAMESPACE_ID::Metadata file_level_metadata_google_2fprotobuf_2fapi_2eproto[3]; -static constexpr ::PROTOBUF_NAMESPACE_ID::EnumDescriptor const** file_level_enum_descriptors_google_2fprotobuf_2fapi_2eproto = nullptr; -static constexpr ::PROTOBUF_NAMESPACE_ID::ServiceDescriptor const** file_level_service_descriptors_google_2fprotobuf_2fapi_2eproto = nullptr; - -const uint32_t TableStruct_google_2fprotobuf_2fapi_2eproto::offsets[] PROTOBUF_SECTION_VARIABLE(protodesc_cold) = { - ~0u, // no _has_bits_ - 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_), - ~0u, // no _has_bits_ - 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_), - ~0u, // no _has_bits_ - 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_), -}; -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)}, -}; - -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_), -}; - -const char descriptor_table_protodef_google_2fprotobuf_2fapi_2eproto[] PROTOBUF_SECTION_VARIABLE(protodesc_cold) = - "\n\031google/protobuf/api.proto\022\017google.prot" - "obuf\032$google/protobuf/source_context.pro" - "to\032\032google/protobuf/type.proto\"\201\002\n\003Api\022\014" - "\n\004name\030\001 \001(\t\022(\n\007methods\030\002 \003(\0132\027.google.p" - "rotobuf.Method\022(\n\007options\030\003 \003(\0132\027.google" - ".protobuf.Option\022\017\n\007version\030\004 \001(\t\0226\n\016sou" - "rce_context\030\005 \001(\0132\036.google.protobuf.Sour" - "ceContext\022&\n\006mixins\030\006 \003(\0132\026.google.proto" - "buf.Mixin\022\'\n\006syntax\030\007 \001(\0162\027.google.proto" - "buf.Syntax\"\325\001\n\006Method\022\014\n\004name\030\001 \001(\t\022\030\n\020r" - "equest_type_url\030\002 \001(\t\022\031\n\021request_streami" - "ng\030\003 \001(\010\022\031\n\021response_type_url\030\004 \001(\t\022\032\n\022r" - "esponse_streaming\030\005 \001(\010\022(\n\007options\030\006 \003(\013" - "2\027.google.protobuf.Option\022\'\n\006syntax\030\007 \001(" - "\0162\027.google.protobuf.Syntax\"#\n\005Mixin\022\014\n\004n" - "ame\030\001 \001(\t\022\014\n\004root\030\002 \001(\tBv\n\023com.google.pr" - "otobufB\010ApiProtoP\001Z,google.golang.org/pr" - "otobuf/types/known/apipb\242\002\003GPB\252\002\036Google." - "Protobuf.WellKnownTypesb\006proto3" - ; -static const ::PROTOBUF_NAMESPACE_ID::internal::DescriptorTable*const descriptor_table_google_2fprotobuf_2fapi_2eproto_deps[2] = { - &::descriptor_table_google_2fprotobuf_2fsource_5fcontext_2eproto, - &::descriptor_table_google_2fprotobuf_2ftype_2eproto, -}; -static ::PROTOBUF_NAMESPACE_ID::internal::once_flag descriptor_table_google_2fprotobuf_2fapi_2eproto_once; -const ::PROTOBUF_NAMESPACE_ID::internal::DescriptorTable descriptor_table_google_2fprotobuf_2fapi_2eproto = { - false, false, 751, descriptor_table_protodef_google_2fprotobuf_2fapi_2eproto, "google/protobuf/api.proto", - &descriptor_table_google_2fprotobuf_2fapi_2eproto_once, descriptor_table_google_2fprotobuf_2fapi_2eproto_deps, 2, 3, - schemas, file_default_instances, TableStruct_google_2fprotobuf_2fapi_2eproto::offsets, - file_level_metadata_google_2fprotobuf_2fapi_2eproto, file_level_enum_descriptors_google_2fprotobuf_2fapi_2eproto, file_level_service_descriptors_google_2fprotobuf_2fapi_2eproto, -}; -PROTOBUF_ATTRIBUTE_WEAK const ::PROTOBUF_NAMESPACE_ID::internal::DescriptorTable* descriptor_table_google_2fprotobuf_2fapi_2eproto_getter() { - return &descriptor_table_google_2fprotobuf_2fapi_2eproto; -} - -// Force running AddDescriptors() at dynamic initialization time. -PROTOBUF_ATTRIBUTE_INIT_PRIORITY static ::PROTOBUF_NAMESPACE_ID::internal::AddDescriptorsRunner dynamic_init_dummy_google_2fprotobuf_2fapi_2eproto(&descriptor_table_google_2fprotobuf_2fapi_2eproto); -PROTOBUF_NAMESPACE_OPEN - -// =================================================================== - -class Api::_Internal { - public: - static const ::PROTOBUF_NAMESPACE_ID::SourceContext& source_context(const Api* msg); -}; - -const ::PROTOBUF_NAMESPACE_ID::SourceContext& -Api::_Internal::source_context(const Api* msg) { - return *msg->source_context_; -} -void Api::clear_options() { - options_.Clear(); -} -void Api::clear_source_context() { - if (GetArenaForAllocation() == nullptr && source_context_ != nullptr) { - delete source_context_; - } - source_context_ = nullptr; -} -Api::Api(::PROTOBUF_NAMESPACE_ID::Arena* arena, - bool is_message_owned) - : ::PROTOBUF_NAMESPACE_ID::Message(arena, is_message_owned), - methods_(arena), - options_(arena), - mixins_(arena) { - SharedCtor(); - if (!is_message_owned) { - RegisterArenaDtor(arena); - } - // @@protoc_insertion_point(arena_constructor:google.protobuf.Api) -} -Api::Api(const Api& from) - : ::PROTOBUF_NAMESPACE_ID::Message(), - methods_(from.methods_), - options_(from.options_), - mixins_(from.mixins_) { - _internal_metadata_.MergeFrom<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(from._internal_metadata_); - name_.UnsafeSetDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited()); - #ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING - name_.Set(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), "", GetArenaForAllocation()); - #endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING - if (!from._internal_name().empty()) { - name_.Set(::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::EmptyDefault{}, from._internal_name(), - GetArenaForAllocation()); - } - version_.UnsafeSetDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited()); - #ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING - version_.Set(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), "", GetArenaForAllocation()); - #endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING - if (!from._internal_version().empty()) { - version_.Set(::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::EmptyDefault{}, from._internal_version(), - GetArenaForAllocation()); - } - if (from._internal_has_source_context()) { - source_context_ = new ::PROTOBUF_NAMESPACE_ID::SourceContext(*from.source_context_); - } else { - source_context_ = nullptr; - } - syntax_ = from.syntax_; - // @@protoc_insertion_point(copy_constructor:google.protobuf.Api) -} - -inline void Api::SharedCtor() { -name_.UnsafeSetDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited()); -#ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING - name_.Set(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), "", GetArenaForAllocation()); -#endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING -version_.UnsafeSetDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited()); -#ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING - version_.Set(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), "", GetArenaForAllocation()); -#endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING -::memset(reinterpret_cast(this) + static_cast( - reinterpret_cast(&source_context_) - reinterpret_cast(this)), - 0, static_cast(reinterpret_cast(&syntax_) - - reinterpret_cast(&source_context_)) + sizeof(syntax_)); -} - -Api::~Api() { - // @@protoc_insertion_point(destructor:google.protobuf.Api) - if (GetArenaForAllocation() != nullptr) return; - SharedDtor(); - _internal_metadata_.Delete<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(); -} - -inline void Api::SharedDtor() { - GOOGLE_DCHECK(GetArenaForAllocation() == nullptr); - name_.DestroyNoArena(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited()); - version_.DestroyNoArena(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited()); - if (this != internal_default_instance()) delete source_context_; -} - -void Api::ArenaDtor(void* object) { - Api* _this = reinterpret_cast< Api* >(object); - (void)_this; -} -void Api::RegisterArenaDtor(::PROTOBUF_NAMESPACE_ID::Arena*) { -} -void Api::SetCachedSize(int size) const { - _cached_size_.Set(size); -} - -void Api::Clear() { -// @@protoc_insertion_point(message_clear_start:google.protobuf.Api) - uint32_t cached_has_bits = 0; - // Prevent compiler warnings about cached_has_bits being unused - (void) cached_has_bits; - - methods_.Clear(); - options_.Clear(); - mixins_.Clear(); - name_.ClearToEmpty(); - version_.ClearToEmpty(); - if (GetArenaForAllocation() == nullptr && source_context_ != nullptr) { - delete source_context_; - } - source_context_ = nullptr; - syntax_ = 0; - _internal_metadata_.Clear<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(); -} - -const char* Api::_InternalParse(const char* ptr, ::PROTOBUF_NAMESPACE_ID::internal::ParseContext* ctx) { -#define CHK_(x) if (PROTOBUF_PREDICT_FALSE(!(x))) goto failure - while (!ctx->Done(&ptr)) { - uint32_t tag; - ptr = ::PROTOBUF_NAMESPACE_ID::internal::ReadTag(ptr, &tag); - switch (tag >> 3) { - // string name = 1; - case 1: - if (PROTOBUF_PREDICT_TRUE(static_cast(tag) == 10)) { - auto str = _internal_mutable_name(); - ptr = ::PROTOBUF_NAMESPACE_ID::internal::InlineGreedyStringParser(str, ptr, ctx); - CHK_(::PROTOBUF_NAMESPACE_ID::internal::VerifyUTF8(str, "google.protobuf.Api.name")); - CHK_(ptr); - } else - goto handle_unusual; - continue; - // repeated .google.protobuf.Method methods = 2; - case 2: - if (PROTOBUF_PREDICT_TRUE(static_cast(tag) == 18)) { - ptr -= 1; - do { - ptr += 1; - ptr = ctx->ParseMessage(_internal_add_methods(), ptr); - CHK_(ptr); - if (!ctx->DataAvailable(ptr)) break; - } while (::PROTOBUF_NAMESPACE_ID::internal::ExpectTag<18>(ptr)); - } else - goto handle_unusual; - continue; - // repeated .google.protobuf.Option options = 3; - case 3: - if (PROTOBUF_PREDICT_TRUE(static_cast(tag) == 26)) { - ptr -= 1; - do { - ptr += 1; - ptr = ctx->ParseMessage(_internal_add_options(), ptr); - CHK_(ptr); - if (!ctx->DataAvailable(ptr)) break; - } while (::PROTOBUF_NAMESPACE_ID::internal::ExpectTag<26>(ptr)); - } else - goto handle_unusual; - continue; - // string version = 4; - case 4: - if (PROTOBUF_PREDICT_TRUE(static_cast(tag) == 34)) { - auto str = _internal_mutable_version(); - ptr = ::PROTOBUF_NAMESPACE_ID::internal::InlineGreedyStringParser(str, ptr, ctx); - CHK_(::PROTOBUF_NAMESPACE_ID::internal::VerifyUTF8(str, "google.protobuf.Api.version")); - CHK_(ptr); - } else - goto handle_unusual; - continue; - // .google.protobuf.SourceContext source_context = 5; - case 5: - if (PROTOBUF_PREDICT_TRUE(static_cast(tag) == 42)) { - ptr = ctx->ParseMessage(_internal_mutable_source_context(), ptr); - CHK_(ptr); - } else - goto handle_unusual; - continue; - // repeated .google.protobuf.Mixin mixins = 6; - case 6: - if (PROTOBUF_PREDICT_TRUE(static_cast(tag) == 50)) { - ptr -= 1; - do { - ptr += 1; - ptr = ctx->ParseMessage(_internal_add_mixins(), ptr); - CHK_(ptr); - if (!ctx->DataAvailable(ptr)) break; - } while (::PROTOBUF_NAMESPACE_ID::internal::ExpectTag<50>(ptr)); - } else - goto handle_unusual; - continue; - // .google.protobuf.Syntax syntax = 7; - case 7: - if (PROTOBUF_PREDICT_TRUE(static_cast(tag) == 56)) { - uint64_t val = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr); - CHK_(ptr); - _internal_set_syntax(static_cast<::PROTOBUF_NAMESPACE_ID::Syntax>(val)); - } else - goto handle_unusual; - continue; - default: - goto handle_unusual; - } // switch - handle_unusual: - if ((tag == 0) || ((tag & 7) == 4)) { - CHK_(ptr); - ctx->SetLastTag(tag); - goto message_done; - } - ptr = UnknownFieldParse( - tag, - _internal_metadata_.mutable_unknown_fields<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(), - ptr, ctx); - CHK_(ptr != nullptr); - } // while -message_done: - return ptr; -failure: - ptr = nullptr; - goto message_done; -#undef CHK_ -} - -uint8_t* Api::_InternalSerialize( - uint8_t* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const { - // @@protoc_insertion_point(serialize_to_array_start:google.protobuf.Api) - uint32_t cached_has_bits = 0; - (void) cached_has_bits; - - // string name = 1; - if (!this->_internal_name().empty()) { - ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::VerifyUtf8String( - this->_internal_name().data(), static_cast(this->_internal_name().length()), - ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::SERIALIZE, - "google.protobuf.Api.name"); - target = stream->WriteStringMaybeAliased( - 1, this->_internal_name(), target); - } - - // repeated .google.protobuf.Method methods = 2; - for (unsigned int i = 0, - n = static_cast(this->_internal_methods_size()); i < n; i++) { - target = stream->EnsureSpace(target); - target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite:: - InternalWriteMessage(2, this->_internal_methods(i), target, stream); - } - - // repeated .google.protobuf.Option options = 3; - for (unsigned int i = 0, - n = static_cast(this->_internal_options_size()); i < n; i++) { - target = stream->EnsureSpace(target); - target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite:: - InternalWriteMessage(3, this->_internal_options(i), target, stream); - } - - // string version = 4; - if (!this->_internal_version().empty()) { - ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::VerifyUtf8String( - this->_internal_version().data(), static_cast(this->_internal_version().length()), - ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::SERIALIZE, - "google.protobuf.Api.version"); - target = stream->WriteStringMaybeAliased( - 4, this->_internal_version(), target); - } - - // .google.protobuf.SourceContext source_context = 5; - if (this->_internal_has_source_context()) { - target = stream->EnsureSpace(target); - target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite:: - InternalWriteMessage( - 5, _Internal::source_context(this), target, stream); - } - - // repeated .google.protobuf.Mixin mixins = 6; - for (unsigned int i = 0, - n = static_cast(this->_internal_mixins_size()); i < n; i++) { - target = stream->EnsureSpace(target); - target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite:: - InternalWriteMessage(6, this->_internal_mixins(i), target, stream); - } - - // .google.protobuf.Syntax syntax = 7; - if (this->_internal_syntax() != 0) { - target = stream->EnsureSpace(target); - target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteEnumToArray( - 7, this->_internal_syntax(), target); - } - - if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) { - target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::InternalSerializeUnknownFieldsToArray( - _internal_metadata_.unknown_fields<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(::PROTOBUF_NAMESPACE_ID::UnknownFieldSet::default_instance), target, stream); - } - // @@protoc_insertion_point(serialize_to_array_end:google.protobuf.Api) - return target; -} - -size_t Api::ByteSizeLong() const { -// @@protoc_insertion_point(message_byte_size_start:google.protobuf.Api) - size_t total_size = 0; - - uint32_t cached_has_bits = 0; - // Prevent compiler warnings about cached_has_bits being unused - (void) cached_has_bits; - - // repeated .google.protobuf.Method methods = 2; - total_size += 1UL * this->_internal_methods_size(); - for (const auto& msg : this->methods_) { - total_size += - ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::MessageSize(msg); - } - - // repeated .google.protobuf.Option options = 3; - total_size += 1UL * this->_internal_options_size(); - for (const auto& msg : this->options_) { - total_size += - ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::MessageSize(msg); - } - - // repeated .google.protobuf.Mixin mixins = 6; - total_size += 1UL * this->_internal_mixins_size(); - for (const auto& msg : this->mixins_) { - total_size += - ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::MessageSize(msg); - } - - // string name = 1; - if (!this->_internal_name().empty()) { - total_size += 1 + - ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::StringSize( - this->_internal_name()); - } - - // string version = 4; - if (!this->_internal_version().empty()) { - total_size += 1 + - ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::StringSize( - this->_internal_version()); - } - - // .google.protobuf.SourceContext source_context = 5; - if (this->_internal_has_source_context()) { - total_size += 1 + - ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::MessageSize( - *source_context_); - } - - // .google.protobuf.Syntax syntax = 7; - if (this->_internal_syntax() != 0) { - total_size += 1 + - ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::EnumSize(this->_internal_syntax()); - } - - return MaybeComputeUnknownFieldsSize(total_size, &_cached_size_); -} - -const ::PROTOBUF_NAMESPACE_ID::Message::ClassData Api::_class_data_ = { - ::PROTOBUF_NAMESPACE_ID::Message::CopyWithSizeCheck, - Api::MergeImpl -}; -const ::PROTOBUF_NAMESPACE_ID::Message::ClassData*Api::GetClassData() const { return &_class_data_; } - -void Api::MergeImpl(::PROTOBUF_NAMESPACE_ID::Message* to, - const ::PROTOBUF_NAMESPACE_ID::Message& from) { - static_cast(to)->MergeFrom( - static_cast(from)); -} - - -void Api::MergeFrom(const Api& from) { -// @@protoc_insertion_point(class_specific_merge_from_start:google.protobuf.Api) - GOOGLE_DCHECK_NE(&from, this); - uint32_t cached_has_bits = 0; - (void) cached_has_bits; - - methods_.MergeFrom(from.methods_); - options_.MergeFrom(from.options_); - mixins_.MergeFrom(from.mixins_); - if (!from._internal_name().empty()) { - _internal_set_name(from._internal_name()); - } - if (!from._internal_version().empty()) { - _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()); - } - if (from._internal_syntax() != 0) { - _internal_set_syntax(from._internal_syntax()); - } - _internal_metadata_.MergeFrom<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(from._internal_metadata_); -} - -void Api::CopyFrom(const Api& from) { -// @@protoc_insertion_point(class_specific_copy_from_start:google.protobuf.Api) - if (&from == this) return; - Clear(); - MergeFrom(from); -} - -bool Api::IsInitialized() const { - return true; -} - -void Api::InternalSwap(Api* other) { - using std::swap; - auto* lhs_arena = GetArenaForAllocation(); - auto* rhs_arena = other->GetArenaForAllocation(); - _internal_metadata_.InternalSwap(&other->_internal_metadata_); - methods_.InternalSwap(&other->methods_); - options_.InternalSwap(&other->options_); - mixins_.InternalSwap(&other->mixins_); - ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::InternalSwap( - &::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), - &name_, lhs_arena, - &other->name_, rhs_arena - ); - ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::InternalSwap( - &::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), - &version_, lhs_arena, - &other->version_, rhs_arena - ); - ::PROTOBUF_NAMESPACE_ID::internal::memswap< - PROTOBUF_FIELD_OFFSET(Api, syntax_) - + sizeof(Api::syntax_) - - PROTOBUF_FIELD_OFFSET(Api, source_context_)>( - reinterpret_cast(&source_context_), - reinterpret_cast(&other->source_context_)); -} - -::PROTOBUF_NAMESPACE_ID::Metadata Api::GetMetadata() const { - return ::PROTOBUF_NAMESPACE_ID::internal::AssignDescriptors( - &descriptor_table_google_2fprotobuf_2fapi_2eproto_getter, &descriptor_table_google_2fprotobuf_2fapi_2eproto_once, - file_level_metadata_google_2fprotobuf_2fapi_2eproto[0]); -} - -// =================================================================== - -class Method::_Internal { - public: -}; - -void Method::clear_options() { - options_.Clear(); -} -Method::Method(::PROTOBUF_NAMESPACE_ID::Arena* arena, - bool is_message_owned) - : ::PROTOBUF_NAMESPACE_ID::Message(arena, is_message_owned), - options_(arena) { - SharedCtor(); - if (!is_message_owned) { - RegisterArenaDtor(arena); - } - // @@protoc_insertion_point(arena_constructor:google.protobuf.Method) -} -Method::Method(const Method& from) - : ::PROTOBUF_NAMESPACE_ID::Message(), - options_(from.options_) { - _internal_metadata_.MergeFrom<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(from._internal_metadata_); - name_.UnsafeSetDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited()); - #ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING - name_.Set(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), "", GetArenaForAllocation()); - #endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING - if (!from._internal_name().empty()) { - name_.Set(::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::EmptyDefault{}, from._internal_name(), - GetArenaForAllocation()); - } - request_type_url_.UnsafeSetDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited()); - #ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING - request_type_url_.Set(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), "", GetArenaForAllocation()); - #endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING - if (!from._internal_request_type_url().empty()) { - request_type_url_.Set(::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::EmptyDefault{}, from._internal_request_type_url(), - GetArenaForAllocation()); - } - response_type_url_.UnsafeSetDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited()); - #ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING - response_type_url_.Set(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), "", GetArenaForAllocation()); - #endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING - if (!from._internal_response_type_url().empty()) { - response_type_url_.Set(::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::EmptyDefault{}, from._internal_response_type_url(), - GetArenaForAllocation()); - } - ::memcpy(&request_streaming_, &from.request_streaming_, - static_cast(reinterpret_cast(&syntax_) - - reinterpret_cast(&request_streaming_)) + sizeof(syntax_)); - // @@protoc_insertion_point(copy_constructor:google.protobuf.Method) -} - -inline void Method::SharedCtor() { -name_.UnsafeSetDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited()); -#ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING - name_.Set(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), "", GetArenaForAllocation()); -#endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING -request_type_url_.UnsafeSetDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited()); -#ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING - request_type_url_.Set(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), "", GetArenaForAllocation()); -#endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING -response_type_url_.UnsafeSetDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited()); -#ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING - response_type_url_.Set(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), "", GetArenaForAllocation()); -#endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING -::memset(reinterpret_cast(this) + static_cast( - reinterpret_cast(&request_streaming_) - reinterpret_cast(this)), - 0, static_cast(reinterpret_cast(&syntax_) - - reinterpret_cast(&request_streaming_)) + sizeof(syntax_)); -} - -Method::~Method() { - // @@protoc_insertion_point(destructor:google.protobuf.Method) - if (GetArenaForAllocation() != nullptr) return; - SharedDtor(); - _internal_metadata_.Delete<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(); -} - -inline void Method::SharedDtor() { - GOOGLE_DCHECK(GetArenaForAllocation() == nullptr); - name_.DestroyNoArena(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited()); - request_type_url_.DestroyNoArena(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited()); - response_type_url_.DestroyNoArena(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited()); -} - -void Method::ArenaDtor(void* object) { - Method* _this = reinterpret_cast< Method* >(object); - (void)_this; -} -void Method::RegisterArenaDtor(::PROTOBUF_NAMESPACE_ID::Arena*) { -} -void Method::SetCachedSize(int size) const { - _cached_size_.Set(size); -} - -void Method::Clear() { -// @@protoc_insertion_point(message_clear_start:google.protobuf.Method) - uint32_t cached_has_bits = 0; - // Prevent compiler warnings about cached_has_bits being unused - (void) cached_has_bits; - - options_.Clear(); - name_.ClearToEmpty(); - request_type_url_.ClearToEmpty(); - response_type_url_.ClearToEmpty(); - ::memset(&request_streaming_, 0, static_cast( - reinterpret_cast(&syntax_) - - reinterpret_cast(&request_streaming_)) + sizeof(syntax_)); - _internal_metadata_.Clear<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(); -} - -const char* Method::_InternalParse(const char* ptr, ::PROTOBUF_NAMESPACE_ID::internal::ParseContext* ctx) { -#define CHK_(x) if (PROTOBUF_PREDICT_FALSE(!(x))) goto failure - while (!ctx->Done(&ptr)) { - uint32_t tag; - ptr = ::PROTOBUF_NAMESPACE_ID::internal::ReadTag(ptr, &tag); - switch (tag >> 3) { - // string name = 1; - case 1: - if (PROTOBUF_PREDICT_TRUE(static_cast(tag) == 10)) { - auto str = _internal_mutable_name(); - ptr = ::PROTOBUF_NAMESPACE_ID::internal::InlineGreedyStringParser(str, ptr, ctx); - CHK_(::PROTOBUF_NAMESPACE_ID::internal::VerifyUTF8(str, "google.protobuf.Method.name")); - CHK_(ptr); - } else - goto handle_unusual; - continue; - // string request_type_url = 2; - case 2: - if (PROTOBUF_PREDICT_TRUE(static_cast(tag) == 18)) { - auto str = _internal_mutable_request_type_url(); - ptr = ::PROTOBUF_NAMESPACE_ID::internal::InlineGreedyStringParser(str, ptr, ctx); - CHK_(::PROTOBUF_NAMESPACE_ID::internal::VerifyUTF8(str, "google.protobuf.Method.request_type_url")); - CHK_(ptr); - } else - goto handle_unusual; - continue; - // bool request_streaming = 3; - case 3: - if (PROTOBUF_PREDICT_TRUE(static_cast(tag) == 24)) { - request_streaming_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr); - CHK_(ptr); - } else - goto handle_unusual; - continue; - // string response_type_url = 4; - case 4: - if (PROTOBUF_PREDICT_TRUE(static_cast(tag) == 34)) { - auto str = _internal_mutable_response_type_url(); - ptr = ::PROTOBUF_NAMESPACE_ID::internal::InlineGreedyStringParser(str, ptr, ctx); - CHK_(::PROTOBUF_NAMESPACE_ID::internal::VerifyUTF8(str, "google.protobuf.Method.response_type_url")); - CHK_(ptr); - } else - goto handle_unusual; - continue; - // bool response_streaming = 5; - case 5: - if (PROTOBUF_PREDICT_TRUE(static_cast(tag) == 40)) { - response_streaming_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr); - CHK_(ptr); - } else - goto handle_unusual; - continue; - // repeated .google.protobuf.Option options = 6; - case 6: - if (PROTOBUF_PREDICT_TRUE(static_cast(tag) == 50)) { - ptr -= 1; - do { - ptr += 1; - ptr = ctx->ParseMessage(_internal_add_options(), ptr); - CHK_(ptr); - if (!ctx->DataAvailable(ptr)) break; - } while (::PROTOBUF_NAMESPACE_ID::internal::ExpectTag<50>(ptr)); - } else - goto handle_unusual; - continue; - // .google.protobuf.Syntax syntax = 7; - case 7: - if (PROTOBUF_PREDICT_TRUE(static_cast(tag) == 56)) { - uint64_t val = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr); - CHK_(ptr); - _internal_set_syntax(static_cast<::PROTOBUF_NAMESPACE_ID::Syntax>(val)); - } else - goto handle_unusual; - continue; - default: - goto handle_unusual; - } // switch - handle_unusual: - if ((tag == 0) || ((tag & 7) == 4)) { - CHK_(ptr); - ctx->SetLastTag(tag); - goto message_done; - } - ptr = UnknownFieldParse( - tag, - _internal_metadata_.mutable_unknown_fields<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(), - ptr, ctx); - CHK_(ptr != nullptr); - } // while -message_done: - return ptr; -failure: - ptr = nullptr; - goto message_done; -#undef CHK_ -} - -uint8_t* Method::_InternalSerialize( - uint8_t* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const { - // @@protoc_insertion_point(serialize_to_array_start:google.protobuf.Method) - uint32_t cached_has_bits = 0; - (void) cached_has_bits; - - // string name = 1; - if (!this->_internal_name().empty()) { - ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::VerifyUtf8String( - this->_internal_name().data(), static_cast(this->_internal_name().length()), - ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::SERIALIZE, - "google.protobuf.Method.name"); - target = stream->WriteStringMaybeAliased( - 1, this->_internal_name(), target); - } - - // string request_type_url = 2; - if (!this->_internal_request_type_url().empty()) { - ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::VerifyUtf8String( - this->_internal_request_type_url().data(), static_cast(this->_internal_request_type_url().length()), - ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::SERIALIZE, - "google.protobuf.Method.request_type_url"); - target = stream->WriteStringMaybeAliased( - 2, this->_internal_request_type_url(), target); - } - - // bool request_streaming = 3; - if (this->_internal_request_streaming() != 0) { - target = stream->EnsureSpace(target); - target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteBoolToArray(3, this->_internal_request_streaming(), target); - } - - // string response_type_url = 4; - if (!this->_internal_response_type_url().empty()) { - ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::VerifyUtf8String( - this->_internal_response_type_url().data(), static_cast(this->_internal_response_type_url().length()), - ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::SERIALIZE, - "google.protobuf.Method.response_type_url"); - target = stream->WriteStringMaybeAliased( - 4, this->_internal_response_type_url(), target); - } - - // bool response_streaming = 5; - if (this->_internal_response_streaming() != 0) { - target = stream->EnsureSpace(target); - target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteBoolToArray(5, this->_internal_response_streaming(), target); - } - - // repeated .google.protobuf.Option options = 6; - for (unsigned int i = 0, - n = static_cast(this->_internal_options_size()); i < n; i++) { - target = stream->EnsureSpace(target); - target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite:: - InternalWriteMessage(6, this->_internal_options(i), target, stream); - } - - // .google.protobuf.Syntax syntax = 7; - if (this->_internal_syntax() != 0) { - target = stream->EnsureSpace(target); - target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteEnumToArray( - 7, this->_internal_syntax(), target); - } - - if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) { - target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::InternalSerializeUnknownFieldsToArray( - _internal_metadata_.unknown_fields<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(::PROTOBUF_NAMESPACE_ID::UnknownFieldSet::default_instance), target, stream); - } - // @@protoc_insertion_point(serialize_to_array_end:google.protobuf.Method) - return target; -} - -size_t Method::ByteSizeLong() const { -// @@protoc_insertion_point(message_byte_size_start:google.protobuf.Method) - size_t total_size = 0; - - uint32_t cached_has_bits = 0; - // Prevent compiler warnings about cached_has_bits being unused - (void) cached_has_bits; - - // repeated .google.protobuf.Option options = 6; - total_size += 1UL * this->_internal_options_size(); - for (const auto& msg : this->options_) { - total_size += - ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::MessageSize(msg); - } - - // string name = 1; - if (!this->_internal_name().empty()) { - total_size += 1 + - ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::StringSize( - this->_internal_name()); - } - - // string request_type_url = 2; - if (!this->_internal_request_type_url().empty()) { - total_size += 1 + - ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::StringSize( - this->_internal_request_type_url()); - } - - // string response_type_url = 4; - if (!this->_internal_response_type_url().empty()) { - total_size += 1 + - ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::StringSize( - this->_internal_response_type_url()); - } - - // bool request_streaming = 3; - if (this->_internal_request_streaming() != 0) { - total_size += 1 + 1; - } - - // bool response_streaming = 5; - if (this->_internal_response_streaming() != 0) { - total_size += 1 + 1; - } - - // .google.protobuf.Syntax syntax = 7; - if (this->_internal_syntax() != 0) { - total_size += 1 + - ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::EnumSize(this->_internal_syntax()); - } - - return MaybeComputeUnknownFieldsSize(total_size, &_cached_size_); -} - -const ::PROTOBUF_NAMESPACE_ID::Message::ClassData Method::_class_data_ = { - ::PROTOBUF_NAMESPACE_ID::Message::CopyWithSizeCheck, - Method::MergeImpl -}; -const ::PROTOBUF_NAMESPACE_ID::Message::ClassData*Method::GetClassData() const { return &_class_data_; } - -void Method::MergeImpl(::PROTOBUF_NAMESPACE_ID::Message* to, - const ::PROTOBUF_NAMESPACE_ID::Message& from) { - static_cast(to)->MergeFrom( - static_cast(from)); -} - - -void Method::MergeFrom(const Method& from) { -// @@protoc_insertion_point(class_specific_merge_from_start:google.protobuf.Method) - GOOGLE_DCHECK_NE(&from, this); - uint32_t cached_has_bits = 0; - (void) cached_has_bits; - - options_.MergeFrom(from.options_); - if (!from._internal_name().empty()) { - _internal_set_name(from._internal_name()); - } - if (!from._internal_request_type_url().empty()) { - _internal_set_request_type_url(from._internal_request_type_url()); - } - if (!from._internal_response_type_url().empty()) { - _internal_set_response_type_url(from._internal_response_type_url()); - } - if (from._internal_request_streaming() != 0) { - _internal_set_request_streaming(from._internal_request_streaming()); - } - if (from._internal_response_streaming() != 0) { - _internal_set_response_streaming(from._internal_response_streaming()); - } - if (from._internal_syntax() != 0) { - _internal_set_syntax(from._internal_syntax()); - } - _internal_metadata_.MergeFrom<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(from._internal_metadata_); -} - -void Method::CopyFrom(const Method& from) { -// @@protoc_insertion_point(class_specific_copy_from_start:google.protobuf.Method) - if (&from == this) return; - Clear(); - MergeFrom(from); -} - -bool Method::IsInitialized() const { - return true; -} - -void Method::InternalSwap(Method* other) { - using std::swap; - auto* lhs_arena = GetArenaForAllocation(); - auto* rhs_arena = other->GetArenaForAllocation(); - _internal_metadata_.InternalSwap(&other->_internal_metadata_); - options_.InternalSwap(&other->options_); - ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::InternalSwap( - &::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), - &name_, lhs_arena, - &other->name_, rhs_arena - ); - ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::InternalSwap( - &::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), - &request_type_url_, lhs_arena, - &other->request_type_url_, rhs_arena - ); - ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::InternalSwap( - &::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), - &response_type_url_, lhs_arena, - &other->response_type_url_, rhs_arena - ); - ::PROTOBUF_NAMESPACE_ID::internal::memswap< - PROTOBUF_FIELD_OFFSET(Method, syntax_) - + sizeof(Method::syntax_) - - PROTOBUF_FIELD_OFFSET(Method, request_streaming_)>( - reinterpret_cast(&request_streaming_), - reinterpret_cast(&other->request_streaming_)); -} - -::PROTOBUF_NAMESPACE_ID::Metadata Method::GetMetadata() const { - return ::PROTOBUF_NAMESPACE_ID::internal::AssignDescriptors( - &descriptor_table_google_2fprotobuf_2fapi_2eproto_getter, &descriptor_table_google_2fprotobuf_2fapi_2eproto_once, - file_level_metadata_google_2fprotobuf_2fapi_2eproto[1]); -} - -// =================================================================== - -class Mixin::_Internal { - public: -}; - -Mixin::Mixin(::PROTOBUF_NAMESPACE_ID::Arena* arena, - bool is_message_owned) - : ::PROTOBUF_NAMESPACE_ID::Message(arena, is_message_owned) { - SharedCtor(); - if (!is_message_owned) { - RegisterArenaDtor(arena); - } - // @@protoc_insertion_point(arena_constructor:google.protobuf.Mixin) -} -Mixin::Mixin(const Mixin& from) - : ::PROTOBUF_NAMESPACE_ID::Message() { - _internal_metadata_.MergeFrom<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(from._internal_metadata_); - name_.UnsafeSetDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited()); - #ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING - name_.Set(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), "", GetArenaForAllocation()); - #endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING - if (!from._internal_name().empty()) { - name_.Set(::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::EmptyDefault{}, from._internal_name(), - GetArenaForAllocation()); - } - root_.UnsafeSetDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited()); - #ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING - root_.Set(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), "", GetArenaForAllocation()); - #endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING - if (!from._internal_root().empty()) { - root_.Set(::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::EmptyDefault{}, from._internal_root(), - GetArenaForAllocation()); - } - // @@protoc_insertion_point(copy_constructor:google.protobuf.Mixin) -} - -inline void Mixin::SharedCtor() { -name_.UnsafeSetDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited()); -#ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING - name_.Set(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), "", GetArenaForAllocation()); -#endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING -root_.UnsafeSetDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited()); -#ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING - root_.Set(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), "", GetArenaForAllocation()); -#endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING -} - -Mixin::~Mixin() { - // @@protoc_insertion_point(destructor:google.protobuf.Mixin) - if (GetArenaForAllocation() != nullptr) return; - SharedDtor(); - _internal_metadata_.Delete<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(); -} - -inline void Mixin::SharedDtor() { - GOOGLE_DCHECK(GetArenaForAllocation() == nullptr); - name_.DestroyNoArena(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited()); - root_.DestroyNoArena(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited()); -} - -void Mixin::ArenaDtor(void* object) { - Mixin* _this = reinterpret_cast< Mixin* >(object); - (void)_this; -} -void Mixin::RegisterArenaDtor(::PROTOBUF_NAMESPACE_ID::Arena*) { -} -void Mixin::SetCachedSize(int size) const { - _cached_size_.Set(size); -} - -void Mixin::Clear() { -// @@protoc_insertion_point(message_clear_start:google.protobuf.Mixin) - uint32_t cached_has_bits = 0; - // Prevent compiler warnings about cached_has_bits being unused - (void) cached_has_bits; - - name_.ClearToEmpty(); - root_.ClearToEmpty(); - _internal_metadata_.Clear<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(); -} - -const char* Mixin::_InternalParse(const char* ptr, ::PROTOBUF_NAMESPACE_ID::internal::ParseContext* ctx) { -#define CHK_(x) if (PROTOBUF_PREDICT_FALSE(!(x))) goto failure - while (!ctx->Done(&ptr)) { - uint32_t tag; - ptr = ::PROTOBUF_NAMESPACE_ID::internal::ReadTag(ptr, &tag); - switch (tag >> 3) { - // string name = 1; - case 1: - if (PROTOBUF_PREDICT_TRUE(static_cast(tag) == 10)) { - auto str = _internal_mutable_name(); - ptr = ::PROTOBUF_NAMESPACE_ID::internal::InlineGreedyStringParser(str, ptr, ctx); - CHK_(::PROTOBUF_NAMESPACE_ID::internal::VerifyUTF8(str, "google.protobuf.Mixin.name")); - CHK_(ptr); - } else - goto handle_unusual; - continue; - // string root = 2; - case 2: - if (PROTOBUF_PREDICT_TRUE(static_cast(tag) == 18)) { - auto str = _internal_mutable_root(); - ptr = ::PROTOBUF_NAMESPACE_ID::internal::InlineGreedyStringParser(str, ptr, ctx); - CHK_(::PROTOBUF_NAMESPACE_ID::internal::VerifyUTF8(str, "google.protobuf.Mixin.root")); - CHK_(ptr); - } else - goto handle_unusual; - continue; - default: - goto handle_unusual; - } // switch - handle_unusual: - if ((tag == 0) || ((tag & 7) == 4)) { - CHK_(ptr); - ctx->SetLastTag(tag); - goto message_done; - } - ptr = UnknownFieldParse( - tag, - _internal_metadata_.mutable_unknown_fields<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(), - ptr, ctx); - CHK_(ptr != nullptr); - } // while -message_done: - return ptr; -failure: - ptr = nullptr; - goto message_done; -#undef CHK_ -} - -uint8_t* Mixin::_InternalSerialize( - uint8_t* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const { - // @@protoc_insertion_point(serialize_to_array_start:google.protobuf.Mixin) - uint32_t cached_has_bits = 0; - (void) cached_has_bits; - - // string name = 1; - if (!this->_internal_name().empty()) { - ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::VerifyUtf8String( - this->_internal_name().data(), static_cast(this->_internal_name().length()), - ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::SERIALIZE, - "google.protobuf.Mixin.name"); - target = stream->WriteStringMaybeAliased( - 1, this->_internal_name(), target); - } - - // string root = 2; - if (!this->_internal_root().empty()) { - ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::VerifyUtf8String( - this->_internal_root().data(), static_cast(this->_internal_root().length()), - ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::SERIALIZE, - "google.protobuf.Mixin.root"); - target = stream->WriteStringMaybeAliased( - 2, this->_internal_root(), target); - } - - if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) { - target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::InternalSerializeUnknownFieldsToArray( - _internal_metadata_.unknown_fields<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(::PROTOBUF_NAMESPACE_ID::UnknownFieldSet::default_instance), target, stream); - } - // @@protoc_insertion_point(serialize_to_array_end:google.protobuf.Mixin) - return target; -} - -size_t Mixin::ByteSizeLong() const { -// @@protoc_insertion_point(message_byte_size_start:google.protobuf.Mixin) - size_t total_size = 0; - - uint32_t cached_has_bits = 0; - // Prevent compiler warnings about cached_has_bits being unused - (void) cached_has_bits; - - // string name = 1; - if (!this->_internal_name().empty()) { - total_size += 1 + - ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::StringSize( - this->_internal_name()); - } - - // string root = 2; - if (!this->_internal_root().empty()) { - total_size += 1 + - ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::StringSize( - this->_internal_root()); - } - - return MaybeComputeUnknownFieldsSize(total_size, &_cached_size_); -} - -const ::PROTOBUF_NAMESPACE_ID::Message::ClassData Mixin::_class_data_ = { - ::PROTOBUF_NAMESPACE_ID::Message::CopyWithSizeCheck, - Mixin::MergeImpl -}; -const ::PROTOBUF_NAMESPACE_ID::Message::ClassData*Mixin::GetClassData() const { return &_class_data_; } - -void Mixin::MergeImpl(::PROTOBUF_NAMESPACE_ID::Message* to, - const ::PROTOBUF_NAMESPACE_ID::Message& from) { - static_cast(to)->MergeFrom( - static_cast(from)); -} - - -void Mixin::MergeFrom(const Mixin& from) { -// @@protoc_insertion_point(class_specific_merge_from_start:google.protobuf.Mixin) - GOOGLE_DCHECK_NE(&from, this); - uint32_t cached_has_bits = 0; - (void) cached_has_bits; - - if (!from._internal_name().empty()) { - _internal_set_name(from._internal_name()); - } - if (!from._internal_root().empty()) { - _internal_set_root(from._internal_root()); - } - _internal_metadata_.MergeFrom<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(from._internal_metadata_); -} - -void Mixin::CopyFrom(const Mixin& from) { -// @@protoc_insertion_point(class_specific_copy_from_start:google.protobuf.Mixin) - if (&from == this) return; - Clear(); - MergeFrom(from); -} - -bool Mixin::IsInitialized() const { - return true; -} - -void Mixin::InternalSwap(Mixin* other) { - using std::swap; - auto* lhs_arena = GetArenaForAllocation(); - auto* rhs_arena = other->GetArenaForAllocation(); - _internal_metadata_.InternalSwap(&other->_internal_metadata_); - ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::InternalSwap( - &::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), - &name_, lhs_arena, - &other->name_, rhs_arena - ); - ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::InternalSwap( - &::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), - &root_, lhs_arena, - &other->root_, rhs_arena - ); -} - -::PROTOBUF_NAMESPACE_ID::Metadata Mixin::GetMetadata() const { - return ::PROTOBUF_NAMESPACE_ID::internal::AssignDescriptors( - &descriptor_table_google_2fprotobuf_2fapi_2eproto_getter, &descriptor_table_google_2fprotobuf_2fapi_2eproto_once, - file_level_metadata_google_2fprotobuf_2fapi_2eproto[2]); -} - -// @@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::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); -} -PROTOBUF_NAMESPACE_CLOSE - -// @@protoc_insertion_point(global_scope) -#include diff --git a/extra/protobuf/protobuf-3.19.4/src/google/protobuf/api.pb.h b/extra/protobuf/protobuf-3.19.4/src/google/protobuf/api.pb.h deleted file mode 100644 index 093a02ef5135..000000000000 --- a/extra/protobuf/protobuf-3.19.4/src/google/protobuf/api.pb.h +++ /dev/null @@ -1,1448 +0,0 @@ -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: google/protobuf/api.proto - -#ifndef GOOGLE_PROTOBUF_INCLUDED_google_2fprotobuf_2fapi_2eproto -#define GOOGLE_PROTOBUF_INCLUDED_google_2fprotobuf_2fapi_2eproto - -#include -#include - -#include -#if PROTOBUF_VERSION < 3019000 -#error This file was generated by a newer version of protoc which is -#error incompatible with your Protocol Buffer headers. Please update -#error your headers. -#endif -#if 3019004 < PROTOBUF_MIN_PROTOC_VERSION -#error This file was generated by an older version of protoc which is -#error incompatible with your Protocol Buffer headers. Please -#error regenerate this file with a newer version of protoc. -#endif - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include // IWYU pragma: export -#include // IWYU pragma: export -#include -#include -#include -// @@protoc_insertion_point(includes) -#include -#define PROTOBUF_INTERNAL_EXPORT_google_2fprotobuf_2fapi_2eproto PROTOBUF_EXPORT -PROTOBUF_NAMESPACE_OPEN -namespace internal { -class AnyMetadata; -} // namespace internal -PROTOBUF_NAMESPACE_CLOSE - -// Internal implementation detail -- do not use these members. -struct PROTOBUF_EXPORT TableStruct_google_2fprotobuf_2fapi_2eproto { - static const ::PROTOBUF_NAMESPACE_ID::internal::ParseTableField entries[] - PROTOBUF_SECTION_VARIABLE(protodesc_cold); - static const ::PROTOBUF_NAMESPACE_ID::internal::AuxiliaryParseTableField aux[] - PROTOBUF_SECTION_VARIABLE(protodesc_cold); - static const ::PROTOBUF_NAMESPACE_ID::internal::ParseTable schema[3] - PROTOBUF_SECTION_VARIABLE(protodesc_cold); - static const ::PROTOBUF_NAMESPACE_ID::internal::FieldMetadata field_metadata[]; - static const ::PROTOBUF_NAMESPACE_ID::internal::SerializationTable serialization_table[]; - static const uint32_t offsets[]; -}; -PROTOBUF_EXPORT extern const ::PROTOBUF_NAMESPACE_ID::internal::DescriptorTable descriptor_table_google_2fprotobuf_2fapi_2eproto; -PROTOBUF_NAMESPACE_OPEN -class Api; -struct ApiDefaultTypeInternal; -PROTOBUF_EXPORT extern ApiDefaultTypeInternal _Api_default_instance_; -class Method; -struct MethodDefaultTypeInternal; -PROTOBUF_EXPORT extern MethodDefaultTypeInternal _Method_default_instance_; -class Mixin; -struct MixinDefaultTypeInternal; -PROTOBUF_EXPORT extern MixinDefaultTypeInternal _Mixin_default_instance_; -PROTOBUF_NAMESPACE_CLOSE -PROTOBUF_NAMESPACE_OPEN -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 - -// =================================================================== - -class PROTOBUF_EXPORT Api final : - public ::PROTOBUF_NAMESPACE_ID::Message /* @@protoc_insertion_point(class_definition:google.protobuf.Api) */ { - public: - inline Api() : Api(nullptr) {} - ~Api() override; - explicit constexpr Api(::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized); - - Api(const Api& from); - Api(Api&& from) noexcept - : Api() { - *this = ::std::move(from); - } - - inline Api& operator=(const Api& from) { - CopyFrom(from); - return *this; - } - inline Api& operator=(Api&& from) noexcept { - if (this == &from) return *this; - if (GetOwningArena() == from.GetOwningArena() - #ifdef PROTOBUF_FORCE_COPY_IN_MOVE - && GetOwningArena() != nullptr - #endif // !PROTOBUF_FORCE_COPY_IN_MOVE - ) { - InternalSwap(&from); - } else { - CopyFrom(from); - } - return *this; - } - - static const ::PROTOBUF_NAMESPACE_ID::Descriptor* descriptor() { - return GetDescriptor(); - } - static const ::PROTOBUF_NAMESPACE_ID::Descriptor* GetDescriptor() { - return default_instance().GetMetadata().descriptor; - } - static const ::PROTOBUF_NAMESPACE_ID::Reflection* GetReflection() { - return default_instance().GetMetadata().reflection; - } - static const Api& default_instance() { - return *internal_default_instance(); - } - static inline const Api* internal_default_instance() { - return reinterpret_cast( - &_Api_default_instance_); - } - static constexpr int kIndexInFileMessages = - 0; - - friend void swap(Api& a, Api& b) { - a.Swap(&b); - } - inline void Swap(Api* other) { - if (other == this) return; - #ifdef PROTOBUF_FORCE_COPY_IN_SWAP - if (GetOwningArena() != nullptr && - GetOwningArena() == other->GetOwningArena()) { - #else // PROTOBUF_FORCE_COPY_IN_SWAP - if (GetOwningArena() == other->GetOwningArena()) { - #endif // !PROTOBUF_FORCE_COPY_IN_SWAP - InternalSwap(other); - } else { - ::PROTOBUF_NAMESPACE_ID::internal::GenericSwap(this, other); - } - } - void UnsafeArenaSwap(Api* other) { - if (other == this) return; - GOOGLE_DCHECK(GetOwningArena() == other->GetOwningArena()); - InternalSwap(other); - } - - // implements Message ---------------------------------------------- - - Api* New(::PROTOBUF_NAMESPACE_ID::Arena* arena = nullptr) const final { - return CreateMaybeMessage(arena); - } - using ::PROTOBUF_NAMESPACE_ID::Message::CopyFrom; - void CopyFrom(const Api& from); - using ::PROTOBUF_NAMESPACE_ID::Message::MergeFrom; - void MergeFrom(const Api& from); - private: - static void MergeImpl(::PROTOBUF_NAMESPACE_ID::Message* to, const ::PROTOBUF_NAMESPACE_ID::Message& from); - public: - PROTOBUF_ATTRIBUTE_REINITIALIZES void Clear() final; - bool IsInitialized() const final; - - size_t ByteSizeLong() const final; - const char* _InternalParse(const char* ptr, ::PROTOBUF_NAMESPACE_ID::internal::ParseContext* ctx) final; - uint8_t* _InternalSerialize( - uint8_t* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const final; - int GetCachedSize() const final { return _cached_size_.Get(); } - - private: - void SharedCtor(); - void SharedDtor(); - void SetCachedSize(int size) const final; - void InternalSwap(Api* other); - - private: - friend class ::PROTOBUF_NAMESPACE_ID::internal::AnyMetadata; - static ::PROTOBUF_NAMESPACE_ID::StringPiece FullMessageName() { - return "google.protobuf.Api"; - } - protected: - explicit Api(::PROTOBUF_NAMESPACE_ID::Arena* arena, - bool is_message_owned = false); - private: - static void ArenaDtor(void* object); - inline void RegisterArenaDtor(::PROTOBUF_NAMESPACE_ID::Arena* arena); - public: - - static const ClassData _class_data_; - const ::PROTOBUF_NAMESPACE_ID::Message::ClassData*GetClassData() const final; - - ::PROTOBUF_NAMESPACE_ID::Metadata GetMetadata() const final; - - // nested types ---------------------------------------------------- - - // accessors ------------------------------------------------------- - - enum : int { - kMethodsFieldNumber = 2, - kOptionsFieldNumber = 3, - kMixinsFieldNumber = 6, - kNameFieldNumber = 1, - kVersionFieldNumber = 4, - kSourceContextFieldNumber = 5, - kSyntaxFieldNumber = 7, - }; - // repeated .google.protobuf.Method methods = 2; - int methods_size() const; - private: - 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 >* - mutable_methods(); - private: - 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 >& - methods() const; - - // repeated .google.protobuf.Option options = 3; - int options_size() const; - private: - 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 >* - mutable_options(); - private: - 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 >& - options() const; - - // repeated .google.protobuf.Mixin mixins = 6; - int mixins_size() const; - private: - 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 >* - mutable_mixins(); - private: - 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 >& - mixins() const; - - // string name = 1; - void clear_name(); - const std::string& name() const; - template - void set_name(ArgT0&& arg0, ArgT... args); - std::string* mutable_name(); - PROTOBUF_NODISCARD std::string* release_name(); - void set_allocated_name(std::string* name); - private: - const std::string& _internal_name() const; - inline PROTOBUF_ALWAYS_INLINE void _internal_set_name(const std::string& value); - std::string* _internal_mutable_name(); - public: - - // string version = 4; - void clear_version(); - const std::string& version() const; - template - void set_version(ArgT0&& arg0, ArgT... args); - std::string* mutable_version(); - PROTOBUF_NODISCARD std::string* release_version(); - void set_allocated_version(std::string* version); - private: - const std::string& _internal_version() const; - inline PROTOBUF_ALWAYS_INLINE void _internal_set_version(const std::string& value); - std::string* _internal_mutable_version(); - public: - - // .google.protobuf.SourceContext source_context = 5; - bool has_source_context() const; - private: - bool _internal_has_source_context() const; - public: - void clear_source_context(); - const ::PROTOBUF_NAMESPACE_ID::SourceContext& source_context() const; - PROTOBUF_NODISCARD ::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(); - public: - void unsafe_arena_set_allocated_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); - private: - ::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) - private: - class _Internal; - - 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::internal::ArenaStringPtr name_; - ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr version_; - ::PROTOBUF_NAMESPACE_ID::SourceContext* source_context_; - int syntax_; - mutable ::PROTOBUF_NAMESPACE_ID::internal::CachedSize _cached_size_; - friend struct ::TableStruct_google_2fprotobuf_2fapi_2eproto; -}; -// ------------------------------------------------------------------- - -class PROTOBUF_EXPORT Method final : - public ::PROTOBUF_NAMESPACE_ID::Message /* @@protoc_insertion_point(class_definition:google.protobuf.Method) */ { - public: - inline Method() : Method(nullptr) {} - ~Method() override; - explicit constexpr Method(::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized); - - Method(const Method& from); - Method(Method&& from) noexcept - : Method() { - *this = ::std::move(from); - } - - inline Method& operator=(const Method& from) { - CopyFrom(from); - return *this; - } - inline Method& operator=(Method&& from) noexcept { - if (this == &from) return *this; - if (GetOwningArena() == from.GetOwningArena() - #ifdef PROTOBUF_FORCE_COPY_IN_MOVE - && GetOwningArena() != nullptr - #endif // !PROTOBUF_FORCE_COPY_IN_MOVE - ) { - InternalSwap(&from); - } else { - CopyFrom(from); - } - return *this; - } - - static const ::PROTOBUF_NAMESPACE_ID::Descriptor* descriptor() { - return GetDescriptor(); - } - static const ::PROTOBUF_NAMESPACE_ID::Descriptor* GetDescriptor() { - return default_instance().GetMetadata().descriptor; - } - static const ::PROTOBUF_NAMESPACE_ID::Reflection* GetReflection() { - return default_instance().GetMetadata().reflection; - } - static const Method& default_instance() { - return *internal_default_instance(); - } - static inline const Method* internal_default_instance() { - return reinterpret_cast( - &_Method_default_instance_); - } - static constexpr int kIndexInFileMessages = - 1; - - friend void swap(Method& a, Method& b) { - a.Swap(&b); - } - inline void Swap(Method* other) { - if (other == this) return; - #ifdef PROTOBUF_FORCE_COPY_IN_SWAP - if (GetOwningArena() != nullptr && - GetOwningArena() == other->GetOwningArena()) { - #else // PROTOBUF_FORCE_COPY_IN_SWAP - if (GetOwningArena() == other->GetOwningArena()) { - #endif // !PROTOBUF_FORCE_COPY_IN_SWAP - InternalSwap(other); - } else { - ::PROTOBUF_NAMESPACE_ID::internal::GenericSwap(this, other); - } - } - void UnsafeArenaSwap(Method* other) { - if (other == this) return; - GOOGLE_DCHECK(GetOwningArena() == other->GetOwningArena()); - InternalSwap(other); - } - - // implements Message ---------------------------------------------- - - Method* New(::PROTOBUF_NAMESPACE_ID::Arena* arena = nullptr) const final { - return CreateMaybeMessage(arena); - } - using ::PROTOBUF_NAMESPACE_ID::Message::CopyFrom; - void CopyFrom(const Method& from); - using ::PROTOBUF_NAMESPACE_ID::Message::MergeFrom; - void MergeFrom(const Method& from); - private: - static void MergeImpl(::PROTOBUF_NAMESPACE_ID::Message* to, const ::PROTOBUF_NAMESPACE_ID::Message& from); - public: - PROTOBUF_ATTRIBUTE_REINITIALIZES void Clear() final; - bool IsInitialized() const final; - - size_t ByteSizeLong() const final; - const char* _InternalParse(const char* ptr, ::PROTOBUF_NAMESPACE_ID::internal::ParseContext* ctx) final; - uint8_t* _InternalSerialize( - uint8_t* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const final; - int GetCachedSize() const final { return _cached_size_.Get(); } - - private: - void SharedCtor(); - void SharedDtor(); - void SetCachedSize(int size) const final; - void InternalSwap(Method* other); - - private: - friend class ::PROTOBUF_NAMESPACE_ID::internal::AnyMetadata; - static ::PROTOBUF_NAMESPACE_ID::StringPiece FullMessageName() { - return "google.protobuf.Method"; - } - protected: - explicit Method(::PROTOBUF_NAMESPACE_ID::Arena* arena, - bool is_message_owned = false); - private: - static void ArenaDtor(void* object); - inline void RegisterArenaDtor(::PROTOBUF_NAMESPACE_ID::Arena* arena); - public: - - static const ClassData _class_data_; - const ::PROTOBUF_NAMESPACE_ID::Message::ClassData*GetClassData() const final; - - ::PROTOBUF_NAMESPACE_ID::Metadata GetMetadata() const final; - - // nested types ---------------------------------------------------- - - // accessors ------------------------------------------------------- - - enum : int { - kOptionsFieldNumber = 6, - kNameFieldNumber = 1, - kRequestTypeUrlFieldNumber = 2, - kResponseTypeUrlFieldNumber = 4, - kRequestStreamingFieldNumber = 3, - kResponseStreamingFieldNumber = 5, - kSyntaxFieldNumber = 7, - }; - // repeated .google.protobuf.Option options = 6; - int options_size() const; - private: - 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 >* - mutable_options(); - private: - 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 >& - options() const; - - // string name = 1; - void clear_name(); - const std::string& name() const; - template - void set_name(ArgT0&& arg0, ArgT... args); - std::string* mutable_name(); - PROTOBUF_NODISCARD std::string* release_name(); - void set_allocated_name(std::string* name); - private: - const std::string& _internal_name() const; - inline PROTOBUF_ALWAYS_INLINE void _internal_set_name(const std::string& value); - std::string* _internal_mutable_name(); - public: - - // string request_type_url = 2; - void clear_request_type_url(); - const std::string& request_type_url() const; - template - void set_request_type_url(ArgT0&& arg0, ArgT... args); - std::string* mutable_request_type_url(); - PROTOBUF_NODISCARD std::string* release_request_type_url(); - void set_allocated_request_type_url(std::string* request_type_url); - private: - const std::string& _internal_request_type_url() const; - inline PROTOBUF_ALWAYS_INLINE void _internal_set_request_type_url(const std::string& value); - std::string* _internal_mutable_request_type_url(); - public: - - // string response_type_url = 4; - void clear_response_type_url(); - const std::string& response_type_url() const; - template - void set_response_type_url(ArgT0&& arg0, ArgT... args); - std::string* mutable_response_type_url(); - PROTOBUF_NODISCARD std::string* release_response_type_url(); - void set_allocated_response_type_url(std::string* response_type_url); - private: - const std::string& _internal_response_type_url() const; - inline PROTOBUF_ALWAYS_INLINE void _internal_set_response_type_url(const std::string& value); - std::string* _internal_mutable_response_type_url(); - public: - - // bool request_streaming = 3; - void clear_request_streaming(); - bool request_streaming() const; - void set_request_streaming(bool value); - private: - bool _internal_request_streaming() const; - void _internal_set_request_streaming(bool value); - public: - - // bool response_streaming = 5; - void clear_response_streaming(); - bool response_streaming() const; - void set_response_streaming(bool value); - private: - bool _internal_response_streaming() const; - void _internal_set_response_streaming(bool value); - public: - - // .google.protobuf.Syntax syntax = 7; - void clear_syntax(); - ::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); - public: - - // @@protoc_insertion_point(class_scope:google.protobuf.Method) - private: - class _Internal; - - 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::internal::ArenaStringPtr name_; - ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr request_type_url_; - ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr response_type_url_; - bool request_streaming_; - bool response_streaming_; - int syntax_; - mutable ::PROTOBUF_NAMESPACE_ID::internal::CachedSize _cached_size_; - friend struct ::TableStruct_google_2fprotobuf_2fapi_2eproto; -}; -// ------------------------------------------------------------------- - -class PROTOBUF_EXPORT Mixin final : - public ::PROTOBUF_NAMESPACE_ID::Message /* @@protoc_insertion_point(class_definition:google.protobuf.Mixin) */ { - public: - inline Mixin() : Mixin(nullptr) {} - ~Mixin() override; - explicit constexpr Mixin(::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized); - - Mixin(const Mixin& from); - Mixin(Mixin&& from) noexcept - : Mixin() { - *this = ::std::move(from); - } - - inline Mixin& operator=(const Mixin& from) { - CopyFrom(from); - return *this; - } - inline Mixin& operator=(Mixin&& from) noexcept { - if (this == &from) return *this; - if (GetOwningArena() == from.GetOwningArena() - #ifdef PROTOBUF_FORCE_COPY_IN_MOVE - && GetOwningArena() != nullptr - #endif // !PROTOBUF_FORCE_COPY_IN_MOVE - ) { - InternalSwap(&from); - } else { - CopyFrom(from); - } - return *this; - } - - static const ::PROTOBUF_NAMESPACE_ID::Descriptor* descriptor() { - return GetDescriptor(); - } - static const ::PROTOBUF_NAMESPACE_ID::Descriptor* GetDescriptor() { - return default_instance().GetMetadata().descriptor; - } - static const ::PROTOBUF_NAMESPACE_ID::Reflection* GetReflection() { - return default_instance().GetMetadata().reflection; - } - static const Mixin& default_instance() { - return *internal_default_instance(); - } - static inline const Mixin* internal_default_instance() { - return reinterpret_cast( - &_Mixin_default_instance_); - } - static constexpr int kIndexInFileMessages = - 2; - - friend void swap(Mixin& a, Mixin& b) { - a.Swap(&b); - } - inline void Swap(Mixin* other) { - if (other == this) return; - #ifdef PROTOBUF_FORCE_COPY_IN_SWAP - if (GetOwningArena() != nullptr && - GetOwningArena() == other->GetOwningArena()) { - #else // PROTOBUF_FORCE_COPY_IN_SWAP - if (GetOwningArena() == other->GetOwningArena()) { - #endif // !PROTOBUF_FORCE_COPY_IN_SWAP - InternalSwap(other); - } else { - ::PROTOBUF_NAMESPACE_ID::internal::GenericSwap(this, other); - } - } - void UnsafeArenaSwap(Mixin* other) { - if (other == this) return; - GOOGLE_DCHECK(GetOwningArena() == other->GetOwningArena()); - InternalSwap(other); - } - - // implements Message ---------------------------------------------- - - Mixin* New(::PROTOBUF_NAMESPACE_ID::Arena* arena = nullptr) const final { - return CreateMaybeMessage(arena); - } - using ::PROTOBUF_NAMESPACE_ID::Message::CopyFrom; - void CopyFrom(const Mixin& from); - using ::PROTOBUF_NAMESPACE_ID::Message::MergeFrom; - void MergeFrom(const Mixin& from); - private: - static void MergeImpl(::PROTOBUF_NAMESPACE_ID::Message* to, const ::PROTOBUF_NAMESPACE_ID::Message& from); - public: - PROTOBUF_ATTRIBUTE_REINITIALIZES void Clear() final; - bool IsInitialized() const final; - - size_t ByteSizeLong() const final; - const char* _InternalParse(const char* ptr, ::PROTOBUF_NAMESPACE_ID::internal::ParseContext* ctx) final; - uint8_t* _InternalSerialize( - uint8_t* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const final; - int GetCachedSize() const final { return _cached_size_.Get(); } - - private: - void SharedCtor(); - void SharedDtor(); - void SetCachedSize(int size) const final; - void InternalSwap(Mixin* other); - - private: - friend class ::PROTOBUF_NAMESPACE_ID::internal::AnyMetadata; - static ::PROTOBUF_NAMESPACE_ID::StringPiece FullMessageName() { - return "google.protobuf.Mixin"; - } - protected: - explicit Mixin(::PROTOBUF_NAMESPACE_ID::Arena* arena, - bool is_message_owned = false); - private: - static void ArenaDtor(void* object); - inline void RegisterArenaDtor(::PROTOBUF_NAMESPACE_ID::Arena* arena); - public: - - static const ClassData _class_data_; - const ::PROTOBUF_NAMESPACE_ID::Message::ClassData*GetClassData() const final; - - ::PROTOBUF_NAMESPACE_ID::Metadata GetMetadata() const final; - - // nested types ---------------------------------------------------- - - // accessors ------------------------------------------------------- - - enum : int { - kNameFieldNumber = 1, - kRootFieldNumber = 2, - }; - // string name = 1; - void clear_name(); - const std::string& name() const; - template - void set_name(ArgT0&& arg0, ArgT... args); - std::string* mutable_name(); - PROTOBUF_NODISCARD std::string* release_name(); - void set_allocated_name(std::string* name); - private: - const std::string& _internal_name() const; - inline PROTOBUF_ALWAYS_INLINE void _internal_set_name(const std::string& value); - std::string* _internal_mutable_name(); - public: - - // string root = 2; - void clear_root(); - const std::string& root() const; - template - void set_root(ArgT0&& arg0, ArgT... args); - std::string* mutable_root(); - PROTOBUF_NODISCARD std::string* release_root(); - void set_allocated_root(std::string* root); - private: - const std::string& _internal_root() const; - inline PROTOBUF_ALWAYS_INLINE void _internal_set_root(const std::string& value); - std::string* _internal_mutable_root(); - public: - - // @@protoc_insertion_point(class_scope:google.protobuf.Mixin) - private: - class _Internal; - - template friend class ::PROTOBUF_NAMESPACE_ID::Arena::InternalHelper; - typedef void InternalArenaConstructable_; - typedef void DestructorSkippable_; - ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr name_; - ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr root_; - mutable ::PROTOBUF_NAMESPACE_ID::internal::CachedSize _cached_size_; - friend struct ::TableStruct_google_2fprotobuf_2fapi_2eproto; -}; -// =================================================================== - - -// =================================================================== - -#ifdef __GNUC__ - #pragma GCC diagnostic push - #pragma GCC diagnostic ignored "-Wstrict-aliasing" -#endif // __GNUC__ -// Api - -// string name = 1; -inline void Api::clear_name() { - name_.ClearToEmpty(); -} -inline const std::string& Api::name() const { - // @@protoc_insertion_point(field_get:google.protobuf.Api.name) - return _internal_name(); -} -template -inline PROTOBUF_ALWAYS_INLINE -void Api::set_name(ArgT0&& arg0, ArgT... args) { - - name_.Set(::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::EmptyDefault{}, static_cast(arg0), args..., GetArenaForAllocation()); - // @@protoc_insertion_point(field_set:google.protobuf.Api.name) -} -inline std::string* Api::mutable_name() { - std::string* _s = _internal_mutable_name(); - // @@protoc_insertion_point(field_mutable:google.protobuf.Api.name) - return _s; -} -inline const std::string& Api::_internal_name() const { - return name_.Get(); -} -inline void Api::_internal_set_name(const std::string& value) { - - name_.Set(::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::EmptyDefault{}, value, GetArenaForAllocation()); -} -inline std::string* Api::_internal_mutable_name() { - - return name_.Mutable(::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::EmptyDefault{}, GetArenaForAllocation()); -} -inline std::string* Api::release_name() { - // @@protoc_insertion_point(field_release:google.protobuf.Api.name) - return name_.Release(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), GetArenaForAllocation()); -} -inline void Api::set_allocated_name(std::string* name) { - if (name != nullptr) { - - } else { - - } - name_.SetAllocated(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), name, - GetArenaForAllocation()); -#ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING - if (name_.IsDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited())) { - name_.Set(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), "", GetArenaForAllocation()); - } -#endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING - // @@protoc_insertion_point(field_set_allocated:google.protobuf.Api.name) -} - -// repeated .google.protobuf.Method methods = 2; -inline int Api::_internal_methods_size() const { - return methods_.size(); -} -inline int Api::methods_size() const { - return _internal_methods_size(); -} -inline void Api::clear_methods() { - methods_.Clear(); -} -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 >* -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 { - return methods_.Get(index); -} -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() { - return methods_.Add(); -} -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 >& -Api::methods() const { - // @@protoc_insertion_point(field_list:google.protobuf.Api.methods) - return methods_; -} - -// repeated .google.protobuf.Option options = 3; -inline int Api::_internal_options_size() const { - return options_.size(); -} -inline int Api::options_size() const { - return _internal_options_size(); -} -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 >* -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 { - return options_.Get(index); -} -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() { - return options_.Add(); -} -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 >& -Api::options() const { - // @@protoc_insertion_point(field_list:google.protobuf.Api.options) - return options_; -} - -// string version = 4; -inline void Api::clear_version() { - version_.ClearToEmpty(); -} -inline const std::string& Api::version() const { - // @@protoc_insertion_point(field_get:google.protobuf.Api.version) - return _internal_version(); -} -template -inline PROTOBUF_ALWAYS_INLINE -void Api::set_version(ArgT0&& arg0, ArgT... args) { - - version_.Set(::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::EmptyDefault{}, static_cast(arg0), args..., GetArenaForAllocation()); - // @@protoc_insertion_point(field_set:google.protobuf.Api.version) -} -inline std::string* Api::mutable_version() { - std::string* _s = _internal_mutable_version(); - // @@protoc_insertion_point(field_mutable:google.protobuf.Api.version) - return _s; -} -inline const std::string& Api::_internal_version() const { - return version_.Get(); -} -inline void Api::_internal_set_version(const std::string& value) { - - version_.Set(::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::EmptyDefault{}, value, GetArenaForAllocation()); -} -inline std::string* Api::_internal_mutable_version() { - - return version_.Mutable(::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::EmptyDefault{}, GetArenaForAllocation()); -} -inline std::string* Api::release_version() { - // @@protoc_insertion_point(field_release:google.protobuf.Api.version) - return version_.Release(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), GetArenaForAllocation()); -} -inline void Api::set_allocated_version(std::string* version) { - if (version != nullptr) { - - } else { - - } - version_.SetAllocated(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), version, - GetArenaForAllocation()); -#ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING - if (version_.IsDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited())) { - version_.Set(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), "", GetArenaForAllocation()); - } -#endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING - // @@protoc_insertion_point(field_set_allocated:google.protobuf.Api.version) -} - -// .google.protobuf.SourceContext source_context = 5; -inline bool Api::_internal_has_source_context() const { - return this != internal_default_instance() && source_context_ != nullptr; -} -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::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) { - if (GetArenaForAllocation() == nullptr) { - delete reinterpret_cast<::PROTOBUF_NAMESPACE_ID::MessageLite*>(source_context_); - } - source_context_ = source_context; - if (source_context) { - - } else { - - } - // @@protoc_insertion_point(field_unsafe_arena_set_allocated:google.protobuf.Api.source_context) -} -inline ::PROTOBUF_NAMESPACE_ID::SourceContext* Api::release_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); - temp = ::PROTOBUF_NAMESPACE_ID::internal::DuplicateIfNonNull(temp); - if (GetArenaForAllocation() == nullptr) { delete old; } -#else // PROTOBUF_FORCE_COPY_IN_RELEASE - if (GetArenaForAllocation() != nullptr) { - temp = ::PROTOBUF_NAMESPACE_ID::internal::DuplicateIfNonNull(temp); - } -#endif // !PROTOBUF_FORCE_COPY_IN_RELEASE - return temp; -} -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_; - source_context_ = nullptr; - return temp; -} -inline ::PROTOBUF_NAMESPACE_ID::SourceContext* Api::_internal_mutable_source_context() { - - if (source_context_ == nullptr) { - 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(); - // @@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) { - ::PROTOBUF_NAMESPACE_ID::Arena* message_arena = GetArenaForAllocation(); - if (message_arena == nullptr) { - delete reinterpret_cast< ::PROTOBUF_NAMESPACE_ID::MessageLite*>(source_context_); - } - if (source_context) { - ::PROTOBUF_NAMESPACE_ID::Arena* submessage_arena = - ::PROTOBUF_NAMESPACE_ID::Arena::InternalHelper< - ::PROTOBUF_NAMESPACE_ID::MessageLite>::GetOwningArena( - reinterpret_cast<::PROTOBUF_NAMESPACE_ID::MessageLite*>(source_context)); - if (message_arena != submessage_arena) { - source_context = ::PROTOBUF_NAMESPACE_ID::internal::GetOwnedMessage( - message_arena, source_context, submessage_arena); - } - - } else { - - } - source_context_ = source_context; - // @@protoc_insertion_point(field_set_allocated:google.protobuf.Api.source_context) -} - -// repeated .google.protobuf.Mixin mixins = 6; -inline int Api::_internal_mixins_size() const { - return mixins_.size(); -} -inline int Api::mixins_size() const { - return _internal_mixins_size(); -} -inline void Api::clear_mixins() { - mixins_.Clear(); -} -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 >* -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 { - return mixins_.Get(index); -} -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() { - return mixins_.Add(); -} -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 >& -Api::mixins() const { - // @@protoc_insertion_point(field_list:google.protobuf.Api.mixins) - return mixins_; -} - -// .google.protobuf.Syntax syntax = 7; -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::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) { - - 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) -} - -// ------------------------------------------------------------------- - -// Method - -// string name = 1; -inline void Method::clear_name() { - name_.ClearToEmpty(); -} -inline const std::string& Method::name() const { - // @@protoc_insertion_point(field_get:google.protobuf.Method.name) - return _internal_name(); -} -template -inline PROTOBUF_ALWAYS_INLINE -void Method::set_name(ArgT0&& arg0, ArgT... args) { - - name_.Set(::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::EmptyDefault{}, static_cast(arg0), args..., GetArenaForAllocation()); - // @@protoc_insertion_point(field_set:google.protobuf.Method.name) -} -inline std::string* Method::mutable_name() { - std::string* _s = _internal_mutable_name(); - // @@protoc_insertion_point(field_mutable:google.protobuf.Method.name) - return _s; -} -inline const std::string& Method::_internal_name() const { - return name_.Get(); -} -inline void Method::_internal_set_name(const std::string& value) { - - name_.Set(::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::EmptyDefault{}, value, GetArenaForAllocation()); -} -inline std::string* Method::_internal_mutable_name() { - - return name_.Mutable(::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::EmptyDefault{}, GetArenaForAllocation()); -} -inline std::string* Method::release_name() { - // @@protoc_insertion_point(field_release:google.protobuf.Method.name) - return name_.Release(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), GetArenaForAllocation()); -} -inline void Method::set_allocated_name(std::string* name) { - if (name != nullptr) { - - } else { - - } - name_.SetAllocated(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), name, - GetArenaForAllocation()); -#ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING - if (name_.IsDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited())) { - name_.Set(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), "", GetArenaForAllocation()); - } -#endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING - // @@protoc_insertion_point(field_set_allocated:google.protobuf.Method.name) -} - -// string request_type_url = 2; -inline void Method::clear_request_type_url() { - request_type_url_.ClearToEmpty(); -} -inline const std::string& Method::request_type_url() const { - // @@protoc_insertion_point(field_get:google.protobuf.Method.request_type_url) - return _internal_request_type_url(); -} -template -inline PROTOBUF_ALWAYS_INLINE -void Method::set_request_type_url(ArgT0&& arg0, ArgT... args) { - - request_type_url_.Set(::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::EmptyDefault{}, static_cast(arg0), args..., GetArenaForAllocation()); - // @@protoc_insertion_point(field_set:google.protobuf.Method.request_type_url) -} -inline std::string* Method::mutable_request_type_url() { - std::string* _s = _internal_mutable_request_type_url(); - // @@protoc_insertion_point(field_mutable:google.protobuf.Method.request_type_url) - return _s; -} -inline const std::string& Method::_internal_request_type_url() const { - return request_type_url_.Get(); -} -inline void Method::_internal_set_request_type_url(const std::string& value) { - - request_type_url_.Set(::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::EmptyDefault{}, value, GetArenaForAllocation()); -} -inline std::string* Method::_internal_mutable_request_type_url() { - - return request_type_url_.Mutable(::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::EmptyDefault{}, GetArenaForAllocation()); -} -inline std::string* Method::release_request_type_url() { - // @@protoc_insertion_point(field_release:google.protobuf.Method.request_type_url) - return request_type_url_.Release(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), GetArenaForAllocation()); -} -inline void Method::set_allocated_request_type_url(std::string* request_type_url) { - if (request_type_url != nullptr) { - - } else { - - } - request_type_url_.SetAllocated(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), request_type_url, - GetArenaForAllocation()); -#ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING - if (request_type_url_.IsDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited())) { - request_type_url_.Set(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), "", GetArenaForAllocation()); - } -#endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING - // @@protoc_insertion_point(field_set_allocated:google.protobuf.Method.request_type_url) -} - -// bool request_streaming = 3; -inline void Method::clear_request_streaming() { - request_streaming_ = false; -} -inline bool Method::_internal_request_streaming() const { - return request_streaming_; -} -inline bool Method::request_streaming() const { - // @@protoc_insertion_point(field_get:google.protobuf.Method.request_streaming) - return _internal_request_streaming(); -} -inline void Method::_internal_set_request_streaming(bool value) { - - request_streaming_ = value; -} -inline void Method::set_request_streaming(bool value) { - _internal_set_request_streaming(value); - // @@protoc_insertion_point(field_set:google.protobuf.Method.request_streaming) -} - -// string response_type_url = 4; -inline void Method::clear_response_type_url() { - response_type_url_.ClearToEmpty(); -} -inline const std::string& Method::response_type_url() const { - // @@protoc_insertion_point(field_get:google.protobuf.Method.response_type_url) - return _internal_response_type_url(); -} -template -inline PROTOBUF_ALWAYS_INLINE -void Method::set_response_type_url(ArgT0&& arg0, ArgT... args) { - - response_type_url_.Set(::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::EmptyDefault{}, static_cast(arg0), args..., GetArenaForAllocation()); - // @@protoc_insertion_point(field_set:google.protobuf.Method.response_type_url) -} -inline std::string* Method::mutable_response_type_url() { - std::string* _s = _internal_mutable_response_type_url(); - // @@protoc_insertion_point(field_mutable:google.protobuf.Method.response_type_url) - return _s; -} -inline const std::string& Method::_internal_response_type_url() const { - return response_type_url_.Get(); -} -inline void Method::_internal_set_response_type_url(const std::string& value) { - - response_type_url_.Set(::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::EmptyDefault{}, value, GetArenaForAllocation()); -} -inline std::string* Method::_internal_mutable_response_type_url() { - - return response_type_url_.Mutable(::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::EmptyDefault{}, GetArenaForAllocation()); -} -inline std::string* Method::release_response_type_url() { - // @@protoc_insertion_point(field_release:google.protobuf.Method.response_type_url) - return response_type_url_.Release(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), GetArenaForAllocation()); -} -inline void Method::set_allocated_response_type_url(std::string* response_type_url) { - if (response_type_url != nullptr) { - - } else { - - } - response_type_url_.SetAllocated(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), response_type_url, - GetArenaForAllocation()); -#ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING - if (response_type_url_.IsDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited())) { - response_type_url_.Set(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), "", GetArenaForAllocation()); - } -#endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING - // @@protoc_insertion_point(field_set_allocated:google.protobuf.Method.response_type_url) -} - -// bool response_streaming = 5; -inline void Method::clear_response_streaming() { - response_streaming_ = false; -} -inline bool Method::_internal_response_streaming() const { - return response_streaming_; -} -inline bool Method::response_streaming() const { - // @@protoc_insertion_point(field_get:google.protobuf.Method.response_streaming) - return _internal_response_streaming(); -} -inline void Method::_internal_set_response_streaming(bool value) { - - response_streaming_ = value; -} -inline void Method::set_response_streaming(bool value) { - _internal_set_response_streaming(value); - // @@protoc_insertion_point(field_set:google.protobuf.Method.response_streaming) -} - -// repeated .google.protobuf.Option options = 6; -inline int Method::_internal_options_size() const { - return options_.size(); -} -inline int Method::options_size() const { - return _internal_options_size(); -} -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 >* -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 { - return options_.Get(index); -} -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() { - return options_.Add(); -} -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 >& -Method::options() const { - // @@protoc_insertion_point(field_list:google.protobuf.Method.options) - return options_; -} - -// .google.protobuf.Syntax syntax = 7; -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::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) { - - 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) -} - -// ------------------------------------------------------------------- - -// Mixin - -// string name = 1; -inline void Mixin::clear_name() { - name_.ClearToEmpty(); -} -inline const std::string& Mixin::name() const { - // @@protoc_insertion_point(field_get:google.protobuf.Mixin.name) - return _internal_name(); -} -template -inline PROTOBUF_ALWAYS_INLINE -void Mixin::set_name(ArgT0&& arg0, ArgT... args) { - - name_.Set(::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::EmptyDefault{}, static_cast(arg0), args..., GetArenaForAllocation()); - // @@protoc_insertion_point(field_set:google.protobuf.Mixin.name) -} -inline std::string* Mixin::mutable_name() { - std::string* _s = _internal_mutable_name(); - // @@protoc_insertion_point(field_mutable:google.protobuf.Mixin.name) - return _s; -} -inline const std::string& Mixin::_internal_name() const { - return name_.Get(); -} -inline void Mixin::_internal_set_name(const std::string& value) { - - name_.Set(::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::EmptyDefault{}, value, GetArenaForAllocation()); -} -inline std::string* Mixin::_internal_mutable_name() { - - return name_.Mutable(::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::EmptyDefault{}, GetArenaForAllocation()); -} -inline std::string* Mixin::release_name() { - // @@protoc_insertion_point(field_release:google.protobuf.Mixin.name) - return name_.Release(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), GetArenaForAllocation()); -} -inline void Mixin::set_allocated_name(std::string* name) { - if (name != nullptr) { - - } else { - - } - name_.SetAllocated(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), name, - GetArenaForAllocation()); -#ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING - if (name_.IsDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited())) { - name_.Set(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), "", GetArenaForAllocation()); - } -#endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING - // @@protoc_insertion_point(field_set_allocated:google.protobuf.Mixin.name) -} - -// string root = 2; -inline void Mixin::clear_root() { - root_.ClearToEmpty(); -} -inline const std::string& Mixin::root() const { - // @@protoc_insertion_point(field_get:google.protobuf.Mixin.root) - return _internal_root(); -} -template -inline PROTOBUF_ALWAYS_INLINE -void Mixin::set_root(ArgT0&& arg0, ArgT... args) { - - root_.Set(::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::EmptyDefault{}, static_cast(arg0), args..., GetArenaForAllocation()); - // @@protoc_insertion_point(field_set:google.protobuf.Mixin.root) -} -inline std::string* Mixin::mutable_root() { - std::string* _s = _internal_mutable_root(); - // @@protoc_insertion_point(field_mutable:google.protobuf.Mixin.root) - return _s; -} -inline const std::string& Mixin::_internal_root() const { - return root_.Get(); -} -inline void Mixin::_internal_set_root(const std::string& value) { - - root_.Set(::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::EmptyDefault{}, value, GetArenaForAllocation()); -} -inline std::string* Mixin::_internal_mutable_root() { - - return root_.Mutable(::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::EmptyDefault{}, GetArenaForAllocation()); -} -inline std::string* Mixin::release_root() { - // @@protoc_insertion_point(field_release:google.protobuf.Mixin.root) - return root_.Release(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), GetArenaForAllocation()); -} -inline void Mixin::set_allocated_root(std::string* root) { - if (root != nullptr) { - - } else { - - } - root_.SetAllocated(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), root, - GetArenaForAllocation()); -#ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING - if (root_.IsDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited())) { - root_.Set(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), "", GetArenaForAllocation()); - } -#endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING - // @@protoc_insertion_point(field_set_allocated:google.protobuf.Mixin.root) -} - -#ifdef __GNUC__ - #pragma GCC diagnostic pop -#endif // __GNUC__ -// ------------------------------------------------------------------- - -// ------------------------------------------------------------------- - - -// @@protoc_insertion_point(namespace_scope) - -PROTOBUF_NAMESPACE_CLOSE - -// @@protoc_insertion_point(global_scope) - -#include -#endif // GOOGLE_PROTOBUF_INCLUDED_GOOGLE_PROTOBUF_INCLUDED_google_2fprotobuf_2fapi_2eproto diff --git a/extra/protobuf/protobuf-3.19.4/src/google/protobuf/api.proto b/extra/protobuf/protobuf-3.19.4/src/google/protobuf/api.proto deleted file mode 100644 index 3d598fc8590e..000000000000 --- a/extra/protobuf/protobuf-3.19.4/src/google/protobuf/api.proto +++ /dev/null @@ -1,208 +0,0 @@ -// Protocol Buffers - Google's data interchange format -// Copyright 2008 Google Inc. All rights reserved. -// https://developers.google.com/protocol-buffers/ -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// * Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// * Redistributions in binary form must reproduce the above -// copyright notice, this list of conditions and the following disclaimer -// in the documentation and/or other materials provided with the -// distribution. -// * Neither the name of Google Inc. nor the names of its -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -syntax = "proto3"; - -package google.protobuf; - -import "google/protobuf/source_context.proto"; -import "google/protobuf/type.proto"; - -option csharp_namespace = "Google.Protobuf.WellKnownTypes"; -option java_package = "com.google.protobuf"; -option java_outer_classname = "ApiProto"; -option java_multiple_files = true; -option objc_class_prefix = "GPB"; -option go_package = "google.golang.org/protobuf/types/known/apipb"; - -// Api is a light-weight descriptor for an API Interface. -// -// Interfaces are also described as "protocol buffer services" in some contexts, -// such as by the "service" keyword in a .proto file, but they are different -// from API Services, which represent a concrete implementation of an interface -// as opposed to simply a description of methods and bindings. They are also -// sometimes simply referred to as "APIs" in other contexts, such as the name of -// this message itself. See https://cloud.google.com/apis/design/glossary for -// detailed terminology. -message Api { - // The fully qualified name of this interface, including package name - // followed by the interface's simple name. - string name = 1; - - // The methods of this interface, in unspecified order. - repeated Method methods = 2; - - // Any metadata attached to the interface. - repeated Option options = 3; - - // A version string for this interface. If specified, must have the form - // `major-version.minor-version`, as in `1.10`. If the minor version is - // omitted, it defaults to zero. If the entire version field is empty, the - // major version is derived from the package name, as outlined below. If the - // field is not empty, the version in the package name will be verified to be - // consistent with what is provided here. - // - // The versioning schema uses [semantic - // versioning](http://semver.org) where the major version number - // indicates a breaking change and the minor version an additive, - // non-breaking change. Both version numbers are signals to users - // what to expect from different versions, and should be carefully - // chosen based on the product plan. - // - // The major version is also reflected in the package name of the - // interface, which must end in `v`, as in - // `google.feature.v1`. For major versions 0 and 1, the suffix can - // be omitted. Zero major versions must only be used for - // experimental, non-GA interfaces. - // - // - string version = 4; - - // Source context for the protocol buffer service represented by this - // message. - SourceContext source_context = 5; - - // Included interfaces. See [Mixin][]. - repeated Mixin mixins = 6; - - // The source syntax of the service. - Syntax syntax = 7; -} - -// Method represents a method of an API interface. -message Method { - // The simple name of this method. - string name = 1; - - // A URL of the input message type. - string request_type_url = 2; - - // If true, the request is streamed. - bool request_streaming = 3; - - // The URL of the output message type. - string response_type_url = 4; - - // If true, the response is streamed. - bool response_streaming = 5; - - // Any metadata attached to the method. - repeated Option options = 6; - - // The source syntax of this method. - Syntax syntax = 7; -} - -// Declares an API Interface to be included in this interface. The including -// interface must redeclare all the methods from the included interface, but -// documentation and options are inherited as follows: -// -// - If after comment and whitespace stripping, the documentation -// string of the redeclared method is empty, it will be inherited -// from the original method. -// -// - Each annotation belonging to the service config (http, -// visibility) which is not set in the redeclared method will be -// inherited. -// -// - If an http annotation is inherited, the path pattern will be -// modified as follows. Any version prefix will be replaced by the -// version of the including interface plus the [root][] path if -// specified. -// -// Example of a simple mixin: -// -// package google.acl.v1; -// service AccessControl { -// // Get the underlying ACL object. -// rpc GetAcl(GetAclRequest) returns (Acl) { -// option (google.api.http).get = "/v1/{resource=**}:getAcl"; -// } -// } -// -// package google.storage.v2; -// service Storage { -// rpc GetAcl(GetAclRequest) returns (Acl); -// -// // Get a data record. -// rpc GetData(GetDataRequest) returns (Data) { -// option (google.api.http).get = "/v2/{resource=**}"; -// } -// } -// -// Example of a mixin configuration: -// -// apis: -// - name: google.storage.v2.Storage -// mixins: -// - name: google.acl.v1.AccessControl -// -// The mixin construct implies that all methods in `AccessControl` are -// also declared with same name and request/response types in -// `Storage`. A documentation generator or annotation processor will -// see the effective `Storage.GetAcl` method after inheriting -// documentation and annotations as follows: -// -// service Storage { -// // Get the underlying ACL object. -// rpc GetAcl(GetAclRequest) returns (Acl) { -// option (google.api.http).get = "/v2/{resource=**}:getAcl"; -// } -// ... -// } -// -// Note how the version in the path pattern changed from `v1` to `v2`. -// -// If the `root` field in the mixin is specified, it should be a -// relative path under which inherited HTTP paths are placed. Example: -// -// apis: -// - name: google.storage.v2.Storage -// mixins: -// - name: google.acl.v1.AccessControl -// root: acls -// -// This implies the following inherited HTTP annotation: -// -// service Storage { -// // Get the underlying ACL object. -// rpc GetAcl(GetAclRequest) returns (Acl) { -// option (google.api.http).get = "/v2/acls/{resource=**}:getAcl"; -// } -// ... -// } -message Mixin { - // The fully qualified name of the interface which is included. - string name = 1; - - // If non-empty specifies a path under which inherited HTTP paths - // are rooted. - string root = 2; -} diff --git a/extra/protobuf/protobuf-3.19.4/src/google/protobuf/arena.cc b/extra/protobuf/protobuf-3.19.4/src/google/protobuf/arena.cc deleted file mode 100644 index 7624e0b2f3fa..000000000000 --- a/extra/protobuf/protobuf-3.19.4/src/google/protobuf/arena.cc +++ /dev/null @@ -1,511 +0,0 @@ -// Protocol Buffers - Google's data interchange format -// Copyright 2008 Google Inc. All rights reserved. -// https://developers.google.com/protocol-buffers/ -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// * Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// * Redistributions in binary form must reproduce the above -// copyright notice, this list of conditions and the following disclaimer -// in the documentation and/or other materials provided with the -// distribution. -// * Neither the name of Google Inc. nor the names of its -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -#include - -#include -#include -#include -#include -#include -#include - -#include - -#include -#ifdef ADDRESS_SANITIZER -#include -#endif // ADDRESS_SANITIZER - -#include - -namespace google { -namespace protobuf { -namespace internal { - -static SerialArena::Memory AllocateMemory(const AllocationPolicy* policy_ptr, - size_t last_size, size_t min_bytes) { - AllocationPolicy policy; // default policy - if (policy_ptr) policy = *policy_ptr; - size_t size; - if (last_size != 0) { - // Double the current block size, up to a limit. - auto max_size = policy.max_block_size; - size = std::min(2 * last_size, max_size); - } else { - size = policy.start_block_size; - } - // Verify that min_bytes + kBlockHeaderSize won't overflow. - GOOGLE_CHECK_LE(min_bytes, - std::numeric_limits::max() - SerialArena::kBlockHeaderSize); - size = std::max(size, SerialArena::kBlockHeaderSize + min_bytes); - - void* mem; - if (policy.block_alloc == nullptr) { - mem = ::operator new(size); - } else { - mem = policy.block_alloc(size); - } - return {mem, size}; -} - -class GetDeallocator { - public: - GetDeallocator(const AllocationPolicy* policy, size_t* space_allocated) - : dealloc_(policy ? policy->block_dealloc : nullptr), - space_allocated_(space_allocated) {} - - void operator()(SerialArena::Memory mem) const { -#ifdef ADDRESS_SANITIZER - // This memory was provided by the underlying allocator as unpoisoned, - // so return it in an unpoisoned state. - ASAN_UNPOISON_MEMORY_REGION(mem.ptr, mem.size); -#endif // ADDRESS_SANITIZER - if (dealloc_) { - dealloc_(mem.ptr, mem.size); - } else { -#if defined(__GXX_DELETE_WITH_SIZE__) || defined(__cpp_sized_deallocation) - ::operator delete(mem.ptr, mem.size); -#else - ::operator delete(mem.ptr); -#endif - } - *space_allocated_ += mem.size; - } - - private: - void (*dealloc_)(void*, size_t); - size_t* space_allocated_; -}; - -SerialArena::SerialArena(Block* b, void* owner) : space_allocated_(b->size) { - owner_ = owner; - head_ = b; - ptr_ = b->Pointer(kBlockHeaderSize + ThreadSafeArena::kSerialArenaSize); - limit_ = b->Pointer(b->size & static_cast(-8)); -} - -SerialArena* SerialArena::New(Memory mem, void* owner) { - GOOGLE_DCHECK_LE(kBlockHeaderSize + ThreadSafeArena::kSerialArenaSize, mem.size); - - auto b = new (mem.ptr) Block{nullptr, mem.size}; - return new (b->Pointer(kBlockHeaderSize)) SerialArena(b, owner); -} - -template -SerialArena::Memory SerialArena::Free(Deallocator deallocator) { - Block* b = head_; - Memory mem = {b, b->size}; - while (b->next) { - b = b->next; // We must first advance before deleting this block - deallocator(mem); - mem = {b, b->size}; - } - return mem; -} - -PROTOBUF_NOINLINE -std::pair -SerialArena::AllocateAlignedWithCleanupFallback( - size_t n, const AllocationPolicy* policy) { - AllocateNewBlock(n + kCleanupSize, policy); - return AllocateFromExistingWithCleanupFallback(n); -} - -PROTOBUF_NOINLINE -void* SerialArena::AllocateAlignedFallback(size_t n, - const AllocationPolicy* policy) { - AllocateNewBlock(n, policy); - return AllocateFromExisting(n); -} - -void SerialArena::AllocateNewBlock(size_t n, const AllocationPolicy* policy) { - // Sync limit to block - head_->start = reinterpret_cast(limit_); - - // Record how much used in this block. - space_used_ += ptr_ - head_->Pointer(kBlockHeaderSize); - - auto mem = AllocateMemory(policy, head_->size, n); - // We don't want to emit an expensive RMW instruction that requires - // exclusive access to a cacheline. Hence we write it in terms of a - // regular add. - auto relaxed = std::memory_order_relaxed; - space_allocated_.store(space_allocated_.load(relaxed) + mem.size, relaxed); - head_ = new (mem.ptr) Block{head_, mem.size}; - ptr_ = head_->Pointer(kBlockHeaderSize); - limit_ = head_->Pointer(head_->size); - -#ifdef ADDRESS_SANITIZER - ASAN_POISON_MEMORY_REGION(ptr_, limit_ - ptr_); -#endif // ADDRESS_SANITIZER -} - -uint64_t SerialArena::SpaceUsed() const { - uint64_t space_used = ptr_ - head_->Pointer(kBlockHeaderSize); - space_used += space_used_; - // Remove the overhead of the SerialArena itself. - space_used -= ThreadSafeArena::kSerialArenaSize; - return space_used; -} - -void SerialArena::CleanupList() { - Block* b = head_; - b->start = reinterpret_cast(limit_); - do { - auto* limit = reinterpret_cast( - b->Pointer(b->size & static_cast(-8))); - auto it = b->start; - auto num = limit - it; - if (num > 0) { - for (; it < limit; it++) { - it->cleanup(it->elem); - } - } - b = b->next; - } while (b); -} - - -ThreadSafeArena::CacheAlignedLifecycleIdGenerator - ThreadSafeArena::lifecycle_id_generator_; -#if defined(GOOGLE_PROTOBUF_NO_THREADLOCAL) -ThreadSafeArena::ThreadCache& ThreadSafeArena::thread_cache() { - static internal::ThreadLocalStorage* thread_cache_ = - new internal::ThreadLocalStorage(); - return *thread_cache_->Get(); -} -#elif defined(PROTOBUF_USE_DLLS) -ThreadSafeArena::ThreadCache& ThreadSafeArena::thread_cache() { - static PROTOBUF_THREAD_LOCAL ThreadCache thread_cache_ = { - 0, static_cast(-1), nullptr}; - return thread_cache_; -} -#else -PROTOBUF_THREAD_LOCAL ThreadSafeArena::ThreadCache - ThreadSafeArena::thread_cache_ = {0, static_cast(-1), - nullptr}; -#endif - -void ThreadSafeArena::InitializeFrom(void* mem, size_t size) { - GOOGLE_DCHECK_EQ(reinterpret_cast(mem) & 7, 0u); - GOOGLE_DCHECK(!AllocPolicy()); // Reset should call InitializeWithPolicy instead. - Init(); - - // Ignore initial block if it is too small. - if (mem != nullptr && size >= kBlockHeaderSize + kSerialArenaSize) { - alloc_policy_.set_is_user_owned_initial_block(true); - SetInitialBlock(mem, size); - } -} - -void ThreadSafeArena::InitializeWithPolicy(void* mem, size_t size, - AllocationPolicy policy) { -#ifndef NDEBUG - const uint64_t old_alloc_policy = alloc_policy_.get_raw(); - // If there was a policy (e.g., in Reset()), make sure flags were preserved. -#define GOOGLE_DCHECK_POLICY_FLAGS_() \ - if (old_alloc_policy > 3) \ - GOOGLE_CHECK_EQ(old_alloc_policy & 3, alloc_policy_.get_raw() & 3) -#else -#define GOOGLE_DCHECK_POLICY_FLAGS_() -#endif // NDEBUG - - if (policy.IsDefault()) { - // Legacy code doesn't use the API above, but provides the initial block - // through ArenaOptions. I suspect most do not touch the allocation - // policy parameters. - InitializeFrom(mem, size); - GOOGLE_DCHECK_POLICY_FLAGS_(); - return; - } - GOOGLE_DCHECK_EQ(reinterpret_cast(mem) & 7, 0u); - Init(); - - // Ignore initial block if it is too small. We include an optional - // AllocationPolicy in this check, so that this can be allocated on the - // first block. - constexpr size_t kAPSize = internal::AlignUpTo8(sizeof(AllocationPolicy)); - constexpr size_t kMinimumSize = kBlockHeaderSize + kSerialArenaSize + kAPSize; - - // The value for alloc_policy_ stores whether or not allocations should be - // recorded. - alloc_policy_.set_should_record_allocs( - policy.metrics_collector != nullptr && - policy.metrics_collector->RecordAllocs()); - // Make sure we have an initial block to store the AllocationPolicy. - if (mem != nullptr && size >= kMinimumSize) { - alloc_policy_.set_is_user_owned_initial_block(true); - } else { - auto tmp = AllocateMemory(&policy, 0, kMinimumSize); - mem = tmp.ptr; - size = tmp.size; - } - SetInitialBlock(mem, size); - - auto sa = threads_.load(std::memory_order_relaxed); - // We ensured enough space so this cannot fail. - void* p; - if (!sa || !sa->MaybeAllocateAligned(kAPSize, &p)) { - GOOGLE_LOG(FATAL) << "MaybeAllocateAligned cannot fail here."; - return; - } - new (p) AllocationPolicy{policy}; - // Low bits store flags, so they mustn't be overwritten. - GOOGLE_DCHECK_EQ(0, reinterpret_cast(p) & 3); - alloc_policy_.set_policy(reinterpret_cast(p)); - GOOGLE_DCHECK_POLICY_FLAGS_(); - -#undef GOOGLE_DCHECK_POLICY_FLAGS_ -} - -void ThreadSafeArena::Init() { -#ifndef NDEBUG - const bool was_message_owned = IsMessageOwned(); -#endif // NDEBUG - ThreadCache& tc = thread_cache(); - auto id = tc.next_lifecycle_id; - // We increment lifecycle_id's by multiples of two so we can use bit 0 as - // a tag. - constexpr uint64_t kDelta = 2; - constexpr uint64_t kInc = ThreadCache::kPerThreadIds * kDelta; - if (PROTOBUF_PREDICT_FALSE((id & (kInc - 1)) == 0)) { - constexpr auto relaxed = std::memory_order_relaxed; - // On platforms that don't support uint64_t atomics we can certainly not - // afford to increment by large intervals and expect uniqueness due to - // wrapping, hence we only add by 1. - id = lifecycle_id_generator_.id.fetch_add(1, relaxed) * kInc; - } - tc.next_lifecycle_id = id + kDelta; - // Message ownership is stored in tag_and_id_, and is set in the constructor. - // This flag bit must be preserved, even across calls to Reset(). - tag_and_id_ = id | (tag_and_id_ & kMessageOwnedArena); - hint_.store(nullptr, std::memory_order_relaxed); - threads_.store(nullptr, std::memory_order_relaxed); -#ifndef NDEBUG - GOOGLE_CHECK_EQ(was_message_owned, IsMessageOwned()); -#endif // NDEBUG -} - -void ThreadSafeArena::SetInitialBlock(void* mem, size_t size) { - SerialArena* serial = SerialArena::New({mem, size}, &thread_cache()); - serial->set_next(NULL); - threads_.store(serial, std::memory_order_relaxed); - CacheSerialArena(serial); -} - -ThreadSafeArena::~ThreadSafeArena() { - // Have to do this in a first pass, because some of the destructors might - // refer to memory in other blocks. - CleanupList(); - - size_t space_allocated = 0; - auto mem = Free(&space_allocated); - - // Policy is about to get deleted. - auto* p = alloc_policy_.get(); - ArenaMetricsCollector* collector = p ? p->metrics_collector : nullptr; - - if (alloc_policy_.is_user_owned_initial_block()) { - space_allocated += mem.size; - } else { - GetDeallocator(alloc_policy_.get(), &space_allocated)(mem); - } - - if (collector) collector->OnDestroy(space_allocated); -} - -SerialArena::Memory ThreadSafeArena::Free(size_t* space_allocated) { - SerialArena::Memory mem = {nullptr, 0}; - auto deallocator = GetDeallocator(alloc_policy_.get(), space_allocated); - PerSerialArena([deallocator, &mem](SerialArena* a) { - if (mem.ptr) deallocator(mem); - mem = a->Free(deallocator); - }); - return mem; -} - -uint64_t ThreadSafeArena::Reset() { - // Have to do this in a first pass, because some of the destructors might - // refer to memory in other blocks. - CleanupList(); - - // Discard all blocks except the special block (if present). - size_t space_allocated = 0; - auto mem = Free(&space_allocated); - - AllocationPolicy* policy = alloc_policy_.get(); - if (policy) { - auto saved_policy = *policy; - if (alloc_policy_.is_user_owned_initial_block()) { - space_allocated += mem.size; - } else { - GetDeallocator(alloc_policy_.get(), &space_allocated)(mem); - mem.ptr = nullptr; - mem.size = 0; - } - ArenaMetricsCollector* collector = saved_policy.metrics_collector; - if (collector) collector->OnReset(space_allocated); - InitializeWithPolicy(mem.ptr, mem.size, saved_policy); - } else { - GOOGLE_DCHECK(!alloc_policy_.should_record_allocs()); - // Nullptr policy - if (alloc_policy_.is_user_owned_initial_block()) { - space_allocated += mem.size; - InitializeFrom(mem.ptr, mem.size); - } else { - GetDeallocator(alloc_policy_.get(), &space_allocated)(mem); - Init(); - } - } - - return space_allocated; -} - -std::pair -ThreadSafeArena::AllocateAlignedWithCleanup(size_t n, - const std::type_info* type) { - SerialArena* arena; - if (PROTOBUF_PREDICT_TRUE(!alloc_policy_.should_record_allocs() && - GetSerialArenaFast(&arena))) { - return arena->AllocateAlignedWithCleanup(n, alloc_policy_.get()); - } else { - return AllocateAlignedWithCleanupFallback(n, type); - } -} - -void ThreadSafeArena::AddCleanup(void* elem, void (*cleanup)(void*)) { - SerialArena* arena; - if (PROTOBUF_PREDICT_FALSE(!GetSerialArenaFast(&arena))) { - arena = GetSerialArenaFallback(&thread_cache()); - } - arena->AddCleanup(elem, cleanup, AllocPolicy()); -} - -PROTOBUF_NOINLINE -void* ThreadSafeArena::AllocateAlignedFallback(size_t n, - const std::type_info* type) { - if (alloc_policy_.should_record_allocs()) { - alloc_policy_.RecordAlloc(type, n); - SerialArena* arena; - if (PROTOBUF_PREDICT_TRUE(GetSerialArenaFast(&arena))) { - return arena->AllocateAligned(n, alloc_policy_.get()); - } - } - return GetSerialArenaFallback(&thread_cache()) - ->AllocateAligned(n, alloc_policy_.get()); -} - -PROTOBUF_NOINLINE -std::pair -ThreadSafeArena::AllocateAlignedWithCleanupFallback( - size_t n, const std::type_info* type) { - if (alloc_policy_.should_record_allocs()) { - alloc_policy_.RecordAlloc(type, n); - SerialArena* arena; - if (GetSerialArenaFast(&arena)) { - return arena->AllocateAlignedWithCleanup(n, alloc_policy_.get()); - } - } - return GetSerialArenaFallback(&thread_cache()) - ->AllocateAlignedWithCleanup(n, alloc_policy_.get()); -} - -uint64_t ThreadSafeArena::SpaceAllocated() const { - SerialArena* serial = threads_.load(std::memory_order_acquire); - uint64_t res = 0; - for (; serial; serial = serial->next()) { - res += serial->SpaceAllocated(); - } - return res; -} - -uint64_t ThreadSafeArena::SpaceUsed() const { - SerialArena* serial = threads_.load(std::memory_order_acquire); - uint64_t space_used = 0; - for (; serial; serial = serial->next()) { - space_used += serial->SpaceUsed(); - } - return space_used - (alloc_policy_.get() ? sizeof(AllocationPolicy) : 0); -} - -void ThreadSafeArena::CleanupList() { - PerSerialArena([](SerialArena* a) { a->CleanupList(); }); -} - -PROTOBUF_NOINLINE -SerialArena* ThreadSafeArena::GetSerialArenaFallback(void* me) { - // Look for this SerialArena in our linked list. - SerialArena* serial = threads_.load(std::memory_order_acquire); - for (; serial; serial = serial->next()) { - if (serial->owner() == me) { - break; - } - } - - if (!serial) { - // This thread doesn't have any SerialArena, which also means it doesn't - // have any blocks yet. So we'll allocate its first block now. - serial = SerialArena::New( - AllocateMemory(alloc_policy_.get(), 0, kSerialArenaSize), me); - - SerialArena* head = threads_.load(std::memory_order_relaxed); - do { - serial->set_next(head); - } while (!threads_.compare_exchange_weak( - head, serial, std::memory_order_release, std::memory_order_relaxed)); - } - - CacheSerialArena(serial); - return serial; -} - -} // namespace internal - -PROTOBUF_FUNC_ALIGN(32) -void* Arena::AllocateAlignedNoHook(size_t n) { - return impl_.AllocateAligned(n, nullptr); -} - -PROTOBUF_FUNC_ALIGN(32) -void* Arena::AllocateAlignedWithHook(size_t n, const std::type_info* type) { - return impl_.AllocateAligned(n, type); -} - -PROTOBUF_FUNC_ALIGN(32) -std::pair -Arena::AllocateAlignedWithCleanup(size_t n, const std::type_info* type) { - return impl_.AllocateAlignedWithCleanup(n, type); -} - -} // namespace protobuf -} // namespace google - -#include diff --git a/extra/protobuf/protobuf-3.19.4/src/google/protobuf/arena.h b/extra/protobuf/protobuf-3.19.4/src/google/protobuf/arena.h deleted file mode 100644 index 6dd6467f58bb..000000000000 --- a/extra/protobuf/protobuf-3.19.4/src/google/protobuf/arena.h +++ /dev/null @@ -1,821 +0,0 @@ -// Protocol Buffers - Google's data interchange format -// Copyright 2008 Google Inc. All rights reserved. -// https://developers.google.com/protocol-buffers/ -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// * Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// * Redistributions in binary form must reproduce the above -// copyright notice, this list of conditions and the following disclaimer -// in the documentation and/or other materials provided with the -// distribution. -// * Neither the name of Google Inc. nor the names of its -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -// This file defines an Arena allocator for better allocation performance. - -#ifndef GOOGLE_PROTOBUF_ARENA_H__ -#define GOOGLE_PROTOBUF_ARENA_H__ - - -#include -#include -#include -#ifdef max -#undef max // Visual Studio defines this macro -#endif -#if defined(_MSC_VER) && !defined(_LIBCPP_STD_VER) && !_HAS_EXCEPTIONS -// Work around bugs in MSVC header when _HAS_EXCEPTIONS=0. -#include -#include -namespace std { -using type_info = ::type_info; -} -#else -#include -#endif - -#include -#include -#include - -#include - -#ifdef SWIG -#error "You cannot SWIG proto headers" -#endif - -namespace google { -namespace protobuf { - -struct ArenaOptions; // defined below -class Arena; // defined below -class Message; // defined in message.h -class MessageLite; -template -class Map; - -namespace arena_metrics { - -void EnableArenaMetrics(ArenaOptions* options); - -} // namespace arena_metrics - -namespace TestUtil { -class ReflectionTester; // defined in test_util.h -} // namespace TestUtil - -namespace internal { - -struct ArenaStringPtr; // defined in arenastring.h -class InlinedStringField; // defined in inlined_string_field.h -class LazyField; // defined in lazy_field.h -class EpsCopyInputStream; // defined in parse_context.h - -template -class GenericTypeHandler; // defined in repeated_field.h - -inline PROTOBUF_ALWAYS_INLINE -void* AlignTo(void* ptr, size_t align) { - return reinterpret_cast( - (reinterpret_cast(ptr) + align - 1) & (~align + 1)); -} - -// Templated cleanup methods. -template -void arena_destruct_object(void* object) { - reinterpret_cast(object)->~T(); -} - -template -struct ObjectDestructor { - constexpr static void (*destructor)(void*) = &arena_destruct_object; -}; - -template -struct ObjectDestructor { - constexpr static void (*destructor)(void*) = nullptr; -}; - -template -void arena_delete_object(void* object) { - delete reinterpret_cast(object); -} -} // namespace internal - -// ArenaOptions provides optional additional parameters to arena construction -// that control its block-allocation behavior. -struct ArenaOptions { - // This defines the size of the first block requested from the system malloc. - // Subsequent block sizes will increase in a geometric series up to a maximum. - size_t start_block_size; - - // This defines the maximum block size requested from system malloc (unless an - // individual arena allocation request occurs with a size larger than this - // maximum). Requested block sizes increase up to this value, then remain - // here. - size_t max_block_size; - - // An initial block of memory for the arena to use, or NULL for none. If - // provided, the block must live at least as long as the arena itself. The - // creator of the Arena retains ownership of the block after the Arena is - // destroyed. - char* initial_block; - - // The size of the initial block, if provided. - size_t initial_block_size; - - // A function pointer to an alloc method that returns memory blocks of size - // requested. By default, it contains a ptr to the malloc function. - // - // NOTE: block_alloc and dealloc functions are expected to behave like - // malloc and free, including Asan poisoning. - void* (*block_alloc)(size_t); - // A function pointer to a dealloc method that takes ownership of the blocks - // from the arena. By default, it contains a ptr to a wrapper function that - // calls free. - void (*block_dealloc)(void*, size_t); - - ArenaOptions() - : start_block_size(internal::AllocationPolicy::kDefaultStartBlockSize), - max_block_size(internal::AllocationPolicy::kDefaultMaxBlockSize), - initial_block(NULL), - initial_block_size(0), - block_alloc(nullptr), - block_dealloc(nullptr), - make_metrics_collector(nullptr) {} - - private: - // If make_metrics_collector is not nullptr, it will be called at Arena init - // time. It may return a pointer to a collector instance that will be notified - // of interesting events related to the arena. - internal::ArenaMetricsCollector* (*make_metrics_collector)(); - - internal::ArenaMetricsCollector* MetricsCollector() const { - return make_metrics_collector ? (*make_metrics_collector)() : nullptr; - } - - internal::AllocationPolicy AllocationPolicy() const { - internal::AllocationPolicy res; - res.start_block_size = start_block_size; - res.max_block_size = max_block_size; - res.block_alloc = block_alloc; - res.block_dealloc = block_dealloc; - res.metrics_collector = MetricsCollector(); - return res; - } - - friend void arena_metrics::EnableArenaMetrics(ArenaOptions*); - - friend class Arena; - friend class ArenaOptionsTestFriend; -}; - -// Support for non-RTTI environments. (The metrics hooks API uses type -// information.) -#if PROTOBUF_RTTI -#define RTTI_TYPE_ID(type) (&typeid(type)) -#else -#define RTTI_TYPE_ID(type) (NULL) -#endif - -// Arena allocator. Arena allocation replaces ordinary (heap-based) allocation -// with new/delete, and improves performance by aggregating allocations into -// larger blocks and freeing allocations all at once. Protocol messages are -// allocated on an arena by using Arena::CreateMessage(Arena*), below, and -// are automatically freed when the arena is destroyed. -// -// This is a thread-safe implementation: multiple threads may allocate from the -// arena concurrently. Destruction is not thread-safe and the destructing -// thread must synchronize with users of the arena first. -// -// An arena provides two allocation interfaces: CreateMessage, which works -// for arena-enabled proto2 message types as well as other types that satisfy -// the appropriate protocol (described below), and Create, which works for -// any arbitrary type T. CreateMessage is better when the type T supports it, -// because this interface (i) passes the arena pointer to the created object so -// that its sub-objects and internal allocations can use the arena too, and (ii) -// elides the object's destructor call when possible. Create does not place -// any special requirements on the type T, and will invoke the object's -// destructor when the arena is destroyed. -// -// The arena message allocation protocol, required by -// CreateMessage(Arena* arena, Args&&... args), is as follows: -// -// - The type T must have (at least) two constructors: a constructor callable -// with `args` (without `arena`), called when a T is allocated on the heap; -// and a constructor callable with `Arena* arena, Args&&... args`, called when -// a T is allocated on an arena. If the second constructor is called with a -// NULL arena pointer, it must be equivalent to invoking the first -// (`args`-only) constructor. -// -// - The type T must have a particular type trait: a nested type -// |InternalArenaConstructable_|. This is usually a typedef to |void|. If no -// such type trait exists, then the instantiation CreateMessage will fail -// to compile. -// -// - The type T *may* have the type trait |DestructorSkippable_|. If this type -// trait is present in the type, then its destructor will not be called if and -// only if it was passed a non-NULL arena pointer. If this type trait is not -// present on the type, then its destructor is always called when the -// containing arena is destroyed. -// -// This protocol is implemented by all arena-enabled proto2 message classes as -// well as protobuf container types like RepeatedPtrField and Map. The protocol -// is internal to protobuf and is not guaranteed to be stable. Non-proto types -// should not rely on this protocol. -class PROTOBUF_EXPORT PROTOBUF_ALIGNAS(8) Arena final { - public: - // Default constructor with sensible default options, tuned for average - // use-cases. - inline Arena() : impl_() {} - - // Construct an arena with default options, except for the supplied - // initial block. It is more efficient to use this constructor - // instead of passing ArenaOptions if the only configuration needed - // by the caller is supplying an initial block. - inline Arena(char* initial_block, size_t initial_block_size) - : impl_(initial_block, initial_block_size) {} - - // Arena constructor taking custom options. See ArenaOptions above for - // descriptions of the options available. - explicit Arena(const ArenaOptions& options) - : impl_(options.initial_block, options.initial_block_size, - options.AllocationPolicy()) {} - - // Block overhead. Use this as a guide for how much to over-allocate the - // initial block if you want an allocation of size N to fit inside it. - // - // WARNING: if you allocate multiple objects, it is difficult to guarantee - // that a series of allocations will fit in the initial block, especially if - // Arena changes its alignment guarantees in the future! - static const size_t kBlockOverhead = - internal::ThreadSafeArena::kBlockHeaderSize + - internal::ThreadSafeArena::kSerialArenaSize; - - inline ~Arena() {} - - // TODO(protobuf-team): Fix callers to use constructor and delete this method. - void Init(const ArenaOptions&) {} - - // API to create proto2 message objects on the arena. If the arena passed in - // is NULL, then a heap allocated object is returned. Type T must be a message - // defined in a .proto file with cc_enable_arenas set to true, otherwise a - // compilation error will occur. - // - // RepeatedField and RepeatedPtrField may also be instantiated directly on an - // arena with this method. - // - // This function also accepts any type T that satisfies the arena message - // allocation protocol, documented above. - template - PROTOBUF_ALWAYS_INLINE static T* CreateMessage(Arena* arena, Args&&... args) { - static_assert( - InternalHelper::is_arena_constructable::value, - "CreateMessage can only construct types that are ArenaConstructable"); - // 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, static_cast(args)...); - } - - // API to create any objects on the arena. Note that only the object will - // be created on the arena; the underlying ptrs (in case of a proto2 message) - // will be still heap allocated. Proto messages should usually be allocated - // with CreateMessage() instead. - // - // Note that even if T satisfies the arena message construction protocol - // (InternalArenaConstructable_ trait and optional DestructorSkippable_ - // trait), as described above, this function does not follow the protocol; - // instead, it treats T as a black-box type, just as if it did not have these - // traits. Specifically, T's constructor arguments will always be only those - // passed to Create() -- no additional arena pointer is implicitly added. - // Furthermore, the destructor will always be called at arena destruction time - // (unless the destructor is trivial). Hence, from T's point of view, it is as - // if the object were allocated on the heap (except that the underlying memory - // is obtained from the arena). - template - PROTOBUF_NDEBUG_INLINE static T* Create(Arena* arena, Args&&... args) { - return CreateInternal(arena, std::is_convertible(), - static_cast(args)...); - } - - // Create an array of object type T on the arena *without* invoking the - // constructor of T. If `arena` is null, then the return value should be freed - // with `delete[] x;` (or `::operator delete[](x);`). - // To ensure safe uses, this function checks at compile time - // (when compiled as C++11) that T is trivially default-constructible and - // trivially destructible. - template - PROTOBUF_NDEBUG_INLINE static T* CreateArray(Arena* arena, - size_t num_elements) { - static_assert(std::is_trivial::value, - "CreateArray requires a trivially constructible type"); - static_assert(std::is_trivially_destructible::value, - "CreateArray requires a trivially destructible type"); - GOOGLE_CHECK_LE(num_elements, std::numeric_limits::max() / sizeof(T)) - << "Requested size is too large to fit into size_t."; - if (arena == NULL) { - return static_cast(::operator new[](num_elements * sizeof(T))); - } else { - return arena->CreateInternalRawArray(num_elements); - } - } - - // The following are routines are for monitoring. They will approximate the - // total sum allocated and used memory, but the exact value is an - // implementation deal. For instance allocated space depends on growth - // policies. Do not use these in unit tests. - // Returns the total space allocated by the arena, which is the sum of the - // sizes of the underlying blocks. - uint64_t SpaceAllocated() const { return impl_.SpaceAllocated(); } - // Returns the total space used by the arena. Similar to SpaceAllocated but - // does not include free space and block overhead. The total space returned - // may not include space used by other threads executing concurrently with - // the call to this method. - uint64_t SpaceUsed() const { return impl_.SpaceUsed(); } - - // Frees all storage allocated by this arena after calling destructors - // registered with OwnDestructor() and freeing objects registered with Own(). - // Any objects allocated on this arena are unusable after this call. It also - // returns the total space used by the arena which is the sums of the sizes - // of the allocated blocks. This method is not thread-safe. - uint64_t Reset() { return impl_.Reset(); } - - // Adds |object| to a list of heap-allocated objects to be freed with |delete| - // when the arena is destroyed or reset. - template - PROTOBUF_ALWAYS_INLINE void Own(T* object) { - OwnInternal(object, std::is_convertible()); - } - - // Adds |object| to a list of objects whose destructors will be manually - // called when the arena is destroyed or reset. This differs from Own() in - // that it does not free the underlying memory with |delete|; hence, it is - // normally only used for objects that are placement-newed into - // arena-allocated memory. - template - PROTOBUF_ALWAYS_INLINE void OwnDestructor(T* object) { - if (object != NULL) { - impl_.AddCleanup(object, &internal::arena_destruct_object); - } - } - - // Adds a custom member function on an object to the list of destructors that - // will be manually called when the arena is destroyed or reset. This differs - // from OwnDestructor() in that any member function may be specified, not only - // the class destructor. - PROTOBUF_ALWAYS_INLINE void OwnCustomDestructor(void* object, - void (*destruct)(void*)) { - impl_.AddCleanup(object, destruct); - } - - // Retrieves the arena associated with |value| if |value| is an arena-capable - // message, or NULL otherwise. If possible, the call resolves at compile time. - // Note that we can often devirtualize calls to `value->GetArena()` so usually - // calling this method is unnecessary. - template - PROTOBUF_ALWAYS_INLINE static Arena* GetArena(const T* value) { - return GetArenaInternal(value); - } - - template - class InternalHelper { - public: - // Provides access to protected GetOwningArena to generated messages. - static Arena* GetOwningArena(const T* p) { return p->GetOwningArena(); } - - // Provides access to protected GetArenaForAllocation to generated messages. - static Arena* GetArenaForAllocation(const T* p) { - return GetArenaForAllocationInternal( - p, std::is_convertible()); - } - - // Creates message-owned arena. - static Arena* CreateMessageOwnedArena() { - return new Arena(internal::MessageOwned{}); - } - - // Checks whether the given arena is message-owned. - static bool IsMessageOwnedArena(Arena* arena) { - return arena->IsMessageOwned(); - } - - private: - static Arena* GetArenaForAllocationInternal( - const T* p, std::true_type /*is_derived_from*/) { - return p->GetArenaForAllocation(); - } - - static Arena* GetArenaForAllocationInternal( - const T* p, std::false_type /*is_derived_from*/) { - return GetArenaForAllocationForNonMessage( - p, typename is_arena_constructable::type()); - } - - static Arena* GetArenaForAllocationForNonMessage( - const T* p, std::true_type /*is_arena_constructible*/) { - return p->GetArena(); - } - - static Arena* GetArenaForAllocationForNonMessage( - const T* p, std::false_type /*is_arena_constructible*/) { - return GetArenaForAllocationForNonMessageNonArenaConstructible( - p, typename has_get_arena::type()); - } - - static Arena* GetArenaForAllocationForNonMessageNonArenaConstructible( - const T* p, std::true_type /*has_get_arena*/) { - return p->GetArena(); - } - - static Arena* GetArenaForAllocationForNonMessageNonArenaConstructible( - const T* /* p */, std::false_type /*has_get_arena*/) { - return nullptr; - } - - template - static char DestructorSkippable(const typename U::DestructorSkippable_*); - template - static double DestructorSkippable(...); - - typedef std::integral_constant< - bool, sizeof(DestructorSkippable(static_cast(0))) == - sizeof(char) || - std::is_trivially_destructible::value> - is_destructor_skippable; - - template - static char ArenaConstructable( - const typename U::InternalArenaConstructable_*); - template - static double ArenaConstructable(...); - - typedef std::integral_constant( - static_cast(0))) == - sizeof(char)> - is_arena_constructable; - - template () - .GetArena())>::value, - int>::type = 0> - static char HasGetArena(decltype(&U::GetArena)); - template - static double HasGetArena(...); - - typedef std::integral_constant(nullptr)) == - sizeof(char)> - has_get_arena; - - template - static T* Construct(void* ptr, Args&&... args) { - return new (ptr) T(static_cast(args)...); - } - - static inline PROTOBUF_ALWAYS_INLINE T* New() { - return new T(nullptr); - } - - static Arena* GetArena(const T* p) { return p->GetArena(); } - - friend class Arena; - friend class TestUtil::ReflectionTester; - }; - - // Helper typetraits that indicates support for arenas in a type T at compile - // time. This is public only to allow construction of higher-level templated - // utilities. - // - // is_arena_constructable::value is true if the message type T has arena - // support enabled, and false otherwise. - // - // is_destructor_skippable::value is true if the message type T has told - // the arena that it is safe to skip the destructor, and false otherwise. - // - // This is inside Arena because only Arena has the friend relationships - // necessary to see the underlying generated code traits. - template - struct is_arena_constructable : InternalHelper::is_arena_constructable {}; - template - struct is_destructor_skippable : InternalHelper::is_destructor_skippable { - }; - - private: - internal::ThreadSafeArena impl_; - - template - struct has_get_arena : InternalHelper::has_get_arena {}; - - // Constructor solely used by message-owned arena. - inline Arena(internal::MessageOwned) : impl_(internal::MessageOwned{}) {} - - // Checks whether this arena is message-owned. - PROTOBUF_ALWAYS_INLINE bool IsMessageOwned() const { - return impl_.IsMessageOwned(); - } - - template - PROTOBUF_NDEBUG_INLINE static T* CreateMessageInternal(Arena* arena, - Args&&... args) { - static_assert( - InternalHelper::is_arena_constructable::value, - "CreateMessage can only construct types that are ArenaConstructable"); - if (arena == NULL) { - return new T(nullptr, static_cast(args)...); - } else { - return arena->DoCreateMessage(static_cast(args)...); - } - } - - // This specialization for no arguments is necessary, because its behavior is - // slightly different. When the arena pointer is nullptr, it calls T() - // instead of T(nullptr). - template - PROTOBUF_NDEBUG_INLINE static T* CreateMessageInternal(Arena* arena) { - static_assert( - InternalHelper::is_arena_constructable::value, - "CreateMessage can only construct types that are ArenaConstructable"); - if (arena == NULL) { - // Generated arena constructor T(Arena*) is protected. Call via - // InternalHelper. - return InternalHelper::New(); - } else { - return arena->DoCreateMessage(); - } - } - - // Allocate and also optionally call collector with the allocated type info - // when allocation recording is enabled. - PROTOBUF_NDEBUG_INLINE void* AllocateInternal(size_t size, size_t align, - void (*destructor)(void*), - const std::type_info* type) { - // Monitor allocation if needed. - if (destructor == nullptr) { - return AllocateAlignedWithHook(size, align, type); - } else { - if (align <= 8) { - auto res = AllocateAlignedWithCleanup(internal::AlignUpTo8(size), type); - res.second->elem = res.first; - res.second->cleanup = destructor; - return res.first; - } else { - auto res = AllocateAlignedWithCleanup(size + align - 8, type); - auto ptr = internal::AlignTo(res.first, align); - res.second->elem = ptr; - res.second->cleanup = destructor; - return ptr; - } - } - } - - // CreateMessage requires that T supports arenas, but this private method - // works whether or not T supports arenas. These are not exposed to user code - // as it can cause confusing API usages, and end up having double free in - // user code. These are used only internally from LazyField and Repeated - // fields, since they are designed to work in all mode combinations. - template - PROTOBUF_ALWAYS_INLINE static Msg* DoCreateMaybeMessage(Arena* arena, - std::true_type, - Args&&... args) { - return CreateMessageInternal(arena, std::forward(args)...); - } - - template - PROTOBUF_ALWAYS_INLINE static T* DoCreateMaybeMessage(Arena* arena, - std::false_type, - Args&&... args) { - return Create(arena, std::forward(args)...); - } - - template - PROTOBUF_ALWAYS_INLINE static T* CreateMaybeMessage(Arena* arena, - Args&&... args) { - return DoCreateMaybeMessage(arena, is_arena_constructable(), - std::forward(args)...); - } - - // Just allocate the required size for the given type assuming the - // type has a trivial constructor. - template - PROTOBUF_NDEBUG_INLINE T* CreateInternalRawArray(size_t num_elements) { - GOOGLE_CHECK_LE(num_elements, std::numeric_limits::max() / sizeof(T)) - << "Requested size is too large to fit into size_t."; - // We count on compiler to realize that if sizeof(T) is a multiple of - // 8 AlignUpTo can be elided. - const size_t n = sizeof(T) * num_elements; - return static_cast( - AllocateAlignedWithHook(n, alignof(T), RTTI_TYPE_ID(T))); - } - - template - PROTOBUF_NDEBUG_INLINE T* DoCreateMessage(Args&&... args) { - return InternalHelper::Construct( - AllocateInternal(sizeof(T), alignof(T), - internal::ObjectDestructor< - InternalHelper::is_destructor_skippable::value, - T>::destructor, - RTTI_TYPE_ID(T)), - this, std::forward(args)...); - } - - // CreateInArenaStorage is used to implement map field. Without it, - // Map need to call generated message's protected arena constructor, - // which needs to declare Map as friend of generated message. - template - static void CreateInArenaStorage(T* ptr, Arena* arena, Args&&... args) { - CreateInArenaStorageInternal(ptr, arena, - typename is_arena_constructable::type(), - std::forward(args)...); - if (arena != nullptr) { - RegisterDestructorInternal( - ptr, arena, - typename InternalHelper::is_destructor_skippable::type()); - } - } - - template - static void CreateInArenaStorageInternal(T* ptr, Arena* arena, - std::true_type, Args&&... args) { - InternalHelper::Construct(ptr, arena, std::forward(args)...); - } - template - static void CreateInArenaStorageInternal(T* ptr, Arena* /* arena */, - std::false_type, Args&&... args) { - new (ptr) T(std::forward(args)...); - } - - template - static void RegisterDestructorInternal(T* /* ptr */, Arena* /* arena */, - std::true_type) {} - template - static void RegisterDestructorInternal(T* ptr, Arena* arena, - std::false_type) { - arena->OwnDestructor(ptr); - } - - // These implement Create(). The second parameter has type 'true_type' if T is - // a subtype of Message and 'false_type' otherwise. - template - PROTOBUF_ALWAYS_INLINE static T* CreateInternal(Arena* arena, std::true_type, - Args&&... args) { - if (arena == nullptr) { - return new T(std::forward(args)...); - } else { - auto destructor = - internal::ObjectDestructor::value, - T>::destructor; - T* result = - new (arena->AllocateInternal(sizeof(T), alignof(T), destructor, - RTTI_TYPE_ID(T))) - T(std::forward(args)...); - return result; - } - } - template - PROTOBUF_ALWAYS_INLINE static T* CreateInternal(Arena* arena, std::false_type, - Args&&... args) { - if (arena == nullptr) { - return new T(std::forward(args)...); - } else { - auto destructor = - internal::ObjectDestructor::value, - T>::destructor; - return new (arena->AllocateInternal(sizeof(T), alignof(T), destructor, - RTTI_TYPE_ID(T))) - T(std::forward(args)...); - } - } - - // These implement Own(), which registers an object for deletion (destructor - // call and operator delete()). The second parameter has type 'true_type' if T - // is a subtype of Message and 'false_type' otherwise. Collapsing - // all template instantiations to one for generic Message reduces code size, - // using the virtual destructor instead. - template - PROTOBUF_ALWAYS_INLINE void OwnInternal(T* object, std::true_type) { - if (object != NULL) { - impl_.AddCleanup(object, &internal::arena_delete_object); - } - } - template - PROTOBUF_ALWAYS_INLINE void OwnInternal(T* object, std::false_type) { - if (object != NULL) { - impl_.AddCleanup(object, &internal::arena_delete_object); - } - } - - // Implementation for GetArena(). Only message objects with - // InternalArenaConstructable_ tags can be associated with an arena, and such - // objects must implement a GetArena() method. - template ::value, int>::type = 0> - PROTOBUF_ALWAYS_INLINE static Arena* GetArenaInternal(const T* value) { - return InternalHelper::GetArena(value); - } - template ::value && - has_get_arena::value, - int>::type = 0> - PROTOBUF_ALWAYS_INLINE static Arena* GetArenaInternal(const T* value) { - return value->GetArena(); - } - template ::value && - !has_get_arena::value, - int>::type = 0> - PROTOBUF_ALWAYS_INLINE static Arena* GetArenaInternal(const T* value) { - (void)value; - return nullptr; - } - - template - PROTOBUF_ALWAYS_INLINE static Arena* GetOwningArena(const T* value) { - return GetOwningArenaInternal( - value, std::is_convertible()); - } - - // Implementation for GetOwningArena(). All and only message objects have - // GetOwningArena() method. - template - PROTOBUF_ALWAYS_INLINE static Arena* GetOwningArenaInternal( - const T* value, std::true_type) { - return InternalHelper::GetOwningArena(value); - } - template - PROTOBUF_ALWAYS_INLINE static Arena* GetOwningArenaInternal( - const T* /* value */, std::false_type) { - return nullptr; - } - - // For friends of arena. - void* AllocateAligned(size_t n, size_t align = 8) { - if (align <= 8) { - return AllocateAlignedNoHook(internal::AlignUpTo8(n)); - } else { - // We are wasting space by over allocating align - 8 bytes. Compared - // to a dedicated function that takes current alignment in consideration. - // Such a scheme would only waste (align - 8)/2 bytes on average, but - // requires a dedicated function in the outline arena allocation - // functions. Possibly re-evaluate tradeoffs later. - return internal::AlignTo(AllocateAlignedNoHook(n + align - 8), align); - } - } - - void* AllocateAlignedWithHook(size_t n, size_t align, - const std::type_info* type) { - if (align <= 8) { - return AllocateAlignedWithHook(internal::AlignUpTo8(n), type); - } else { - // We are wasting space by over allocating align - 8 bytes. Compared - // to a dedicated function that takes current alignment in consideration. - // Such a schemee would only waste (align - 8)/2 bytes on average, but - // requires a dedicated function in the outline arena allocation - // functions. Possibly re-evaluate tradeoffs later. - return internal::AlignTo(AllocateAlignedWithHook(n + align - 8, type), - align); - } - } - - void* AllocateAlignedNoHook(size_t n); - void* AllocateAlignedWithHook(size_t n, const std::type_info* type); - std::pair - AllocateAlignedWithCleanup(size_t n, const std::type_info* type); - - template - friend class internal::GenericTypeHandler; - friend struct internal::ArenaStringPtr; // For AllocateAligned. - friend class internal::InlinedStringField; // For AllocateAligned. - friend class internal::LazyField; // For CreateMaybeMessage. - friend class internal::EpsCopyInputStream; // For parser performance - friend class MessageLite; - template - friend class Map; -}; - -// Defined above for supporting environments without RTTI. -#undef RTTI_TYPE_ID - -} // namespace protobuf -} // namespace google - -#include - -#endif // GOOGLE_PROTOBUF_ARENA_H__ diff --git a/extra/protobuf/protobuf-3.19.4/src/google/protobuf/arena_impl.h b/extra/protobuf/protobuf-3.19.4/src/google/protobuf/arena_impl.h deleted file mode 100644 index 2ffac319b411..000000000000 --- a/extra/protobuf/protobuf-3.19.4/src/google/protobuf/arena_impl.h +++ /dev/null @@ -1,562 +0,0 @@ -// Protocol Buffers - Google's data interchange format -// Copyright 2008 Google Inc. All rights reserved. -// https://developers.google.com/protocol-buffers/ -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// * Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// * Redistributions in binary form must reproduce the above -// copyright notice, this list of conditions and the following disclaimer -// in the documentation and/or other materials provided with the -// distribution. -// * Neither the name of Google Inc. nor the names of its -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -// This file defines an Arena allocator for better allocation performance. - -#ifndef GOOGLE_PROTOBUF_ARENA_IMPL_H__ -#define GOOGLE_PROTOBUF_ARENA_IMPL_H__ - -#include -#include -#include - -#include -#include - -#ifdef ADDRESS_SANITIZER -#include -#endif // ADDRESS_SANITIZER - -#include - - -namespace google { -namespace protobuf { -namespace internal { - -inline constexpr size_t AlignUpTo8(size_t n) { - // Align n to next multiple of 8 (from Hacker's Delight, Chapter 3.) - return (n + 7) & static_cast(-8); -} - -using LifecycleIdAtomic = uint64_t; - -// MetricsCollector collects stats for a particular arena. -class PROTOBUF_EXPORT ArenaMetricsCollector { - public: - ArenaMetricsCollector(bool record_allocs) : record_allocs_(record_allocs) {} - - // Invoked when the arena is about to be destroyed. This method will - // typically finalize any metric collection and delete the collector. - // space_allocated is the space used by the arena. - virtual void OnDestroy(uint64_t space_allocated) = 0; - - // OnReset() is called when the associated arena is reset. - // space_allocated is the space used by the arena just before the reset. - virtual void OnReset(uint64_t space_allocated) = 0; - - // OnAlloc is called when an allocation happens. - // type_info is promised to be static - its lifetime extends to - // match program's lifetime (It is given by typeid operator). - // Note: typeid(void) will be passed as allocated_type every time we - // intentionally want to avoid monitoring an allocation. (i.e. internal - // allocations for managing the arena) - virtual void OnAlloc(const std::type_info* allocated_type, - uint64_t alloc_size) = 0; - - // Does OnAlloc() need to be called? If false, metric collection overhead - // will be reduced since we will not do extra work per allocation. - bool RecordAllocs() { return record_allocs_; } - - protected: - // This class is destructed by the call to OnDestroy(). - ~ArenaMetricsCollector() = default; - const bool record_allocs_; -}; - -struct AllocationPolicy { - static constexpr size_t kDefaultStartBlockSize = 256; - static constexpr size_t kDefaultMaxBlockSize = 8192; - - size_t start_block_size = kDefaultStartBlockSize; - size_t max_block_size = kDefaultMaxBlockSize; - void* (*block_alloc)(size_t) = nullptr; - void (*block_dealloc)(void*, size_t) = nullptr; - ArenaMetricsCollector* metrics_collector = nullptr; - - bool IsDefault() const { - return start_block_size == kDefaultMaxBlockSize && - max_block_size == kDefaultMaxBlockSize && block_alloc == nullptr && - block_dealloc == nullptr && metrics_collector == nullptr; - } -}; - -// Tagged pointer to an AllocationPolicy. -class TaggedAllocationPolicyPtr { - public: - constexpr TaggedAllocationPolicyPtr() : policy_(0) {} - - explicit TaggedAllocationPolicyPtr(AllocationPolicy* policy) - : policy_(reinterpret_cast(policy)) {} - - void set_policy(AllocationPolicy* policy) { - auto bits = policy_ & kTagsMask; - policy_ = reinterpret_cast(policy) | bits; - } - - AllocationPolicy* get() { - return reinterpret_cast(policy_ & kPtrMask); - } - const AllocationPolicy* get() const { - return reinterpret_cast(policy_ & kPtrMask); - } - - AllocationPolicy& operator*() { return *get(); } - const AllocationPolicy& operator*() const { return *get(); } - - AllocationPolicy* operator->() { return get(); } - const AllocationPolicy* operator->() const { return get(); } - - bool is_user_owned_initial_block() const { - return static_cast(get_mask()); - } - void set_is_user_owned_initial_block(bool v) { - set_mask(v); - } - - bool should_record_allocs() const { - return static_cast(get_mask()); - } - void set_should_record_allocs(bool v) { set_mask(v); } - - uintptr_t get_raw() const { return policy_; } - - inline void RecordAlloc(const std::type_info* allocated_type, - size_t n) const { - get()->metrics_collector->OnAlloc(allocated_type, n); - } - - private: - enum : uintptr_t { - kUserOwnedInitialBlock = 1, - kRecordAllocs = 2, - }; - - static constexpr uintptr_t kTagsMask = 7; - static constexpr uintptr_t kPtrMask = ~kTagsMask; - - template - uintptr_t get_mask() const { - return policy_ & kMask; - } - template - void set_mask(bool v) { - if (v) { - policy_ |= kMask; - } else { - policy_ &= ~kMask; - } - } - uintptr_t policy_; -}; - -// A simple arena allocator. Calls to allocate functions must be properly -// serialized by the caller, hence this class cannot be used as a general -// purpose allocator in a multi-threaded program. It serves as a building block -// for ThreadSafeArena, which provides a thread-safe arena allocator. -// -// This class manages -// 1) Arena bump allocation + owning memory blocks. -// 2) Maintaining a cleanup list. -// It delagetes the actual memory allocation back to ThreadSafeArena, which -// contains the information on block growth policy and backing memory allocation -// used. -class PROTOBUF_EXPORT SerialArena { - public: - struct Memory { - void* ptr; - size_t size; - }; - - // Node contains the ptr of the object to be cleaned up and the associated - // cleanup function ptr. - struct CleanupNode { - void* elem; // Pointer to the object to be cleaned up. - void (*cleanup)(void*); // Function pointer to the destructor or deleter. - }; - - void CleanupList(); - uint64_t SpaceAllocated() const { - return space_allocated_.load(std::memory_order_relaxed); - } - uint64_t SpaceUsed() const; - - bool HasSpace(size_t n) { return n <= static_cast(limit_ - ptr_); } - - void* AllocateAligned(size_t n, const AllocationPolicy* policy) { - GOOGLE_DCHECK_EQ(internal::AlignUpTo8(n), n); // Must be already aligned. - GOOGLE_DCHECK_GE(limit_, ptr_); - if (PROTOBUF_PREDICT_FALSE(!HasSpace(n))) { - return AllocateAlignedFallback(n, policy); - } - return AllocateFromExisting(n); - } - - private: - void* AllocateFromExisting(size_t n) { - void* ret = ptr_; - ptr_ += n; -#ifdef ADDRESS_SANITIZER - ASAN_UNPOISON_MEMORY_REGION(ret, n); -#endif // ADDRESS_SANITIZER - return ret; - } - - public: - // Allocate space if the current region provides enough space. - bool MaybeAllocateAligned(size_t n, void** out) { - GOOGLE_DCHECK_EQ(internal::AlignUpTo8(n), n); // Must be already aligned. - GOOGLE_DCHECK_GE(limit_, ptr_); - if (PROTOBUF_PREDICT_FALSE(!HasSpace(n))) return false; - *out = AllocateFromExisting(n); - return true; - } - - std::pair AllocateAlignedWithCleanup( - size_t n, const AllocationPolicy* policy) { - GOOGLE_DCHECK_EQ(internal::AlignUpTo8(n), n); // Must be already aligned. - if (PROTOBUF_PREDICT_FALSE(!HasSpace(n + kCleanupSize))) { - return AllocateAlignedWithCleanupFallback(n, policy); - } - return AllocateFromExistingWithCleanupFallback(n); - } - - private: - std::pair AllocateFromExistingWithCleanupFallback( - size_t n) { - void* ret = ptr_; - ptr_ += n; - limit_ -= kCleanupSize; -#ifdef ADDRESS_SANITIZER - ASAN_UNPOISON_MEMORY_REGION(ret, n); - ASAN_UNPOISON_MEMORY_REGION(limit_, kCleanupSize); -#endif // ADDRESS_SANITIZER - return CreatePair(ret, reinterpret_cast(limit_)); - } - - public: - void AddCleanup(void* elem, void (*cleanup)(void*), - const AllocationPolicy* policy) { - auto res = AllocateAlignedWithCleanup(0, policy); - res.second->elem = elem; - res.second->cleanup = cleanup; - } - - void* owner() const { return owner_; } - SerialArena* next() const { return next_; } - void set_next(SerialArena* next) { next_ = next; } - - private: - friend class ThreadSafeArena; - friend class ArenaBenchmark; - - // Creates a new SerialArena inside mem using the remaining memory as for - // future allocations. - static SerialArena* New(SerialArena::Memory mem, void* owner); - // Free SerialArena returning the memory passed in to New - template - Memory Free(Deallocator deallocator); - - // Blocks are variable length malloc-ed objects. The following structure - // describes the common header for all blocks. - struct Block { - Block(Block* next, size_t size) : next(next), size(size), start(nullptr) {} - - char* Pointer(size_t n) { - GOOGLE_DCHECK(n <= size); - return reinterpret_cast(this) + n; - } - - Block* const next; - const size_t size; - CleanupNode* start; - // data follows - }; - - void* owner_; // &ThreadCache of this thread; - Block* head_; // Head of linked list of blocks. - SerialArena* next_; // Next SerialArena in this linked list. - size_t space_used_ = 0; // Necessary for metrics. - std::atomic space_allocated_; - - // Next pointer to allocate from. Always 8-byte aligned. Points inside - // head_ (and head_->pos will always be non-canonical). We keep these - // here to reduce indirection. - char* ptr_; - char* limit_; - - // Constructor is private as only New() should be used. - inline SerialArena(Block* b, void* owner); - void* AllocateAlignedFallback(size_t n, const AllocationPolicy* policy); - std::pair AllocateAlignedWithCleanupFallback( - size_t n, const AllocationPolicy* policy); - void AllocateNewBlock(size_t n, const AllocationPolicy* policy); - - std::pair CreatePair(void* ptr, CleanupNode* node) { - return {ptr, node}; - } - - public: - static constexpr size_t kBlockHeaderSize = AlignUpTo8(sizeof(Block)); - static constexpr size_t kCleanupSize = AlignUpTo8(sizeof(CleanupNode)); -}; - -// Tag type used to invoke the constructor of message-owned arena. -// Only message-owned arenas use this constructor for creation. -// Such constructors are internal implementation details of the library. -struct MessageOwned { - explicit MessageOwned() = default; -}; - -// This class provides the core Arena memory allocation library. Different -// implementations only need to implement the public interface below. -// Arena is not a template type as that would only be useful if all protos -// in turn would be templates, which will/cannot happen. However separating -// the memory allocation part from the cruft of the API users expect we can -// use #ifdef the select the best implementation based on hardware / OS. -class PROTOBUF_EXPORT ThreadSafeArena { - public: - ThreadSafeArena() { Init(); } - - // Constructor solely used by message-owned arena. - ThreadSafeArena(internal::MessageOwned) : tag_and_id_(kMessageOwnedArena) { - Init(); - } - - ThreadSafeArena(char* mem, size_t size) { InitializeFrom(mem, size); } - - explicit ThreadSafeArena(void* mem, size_t size, - const AllocationPolicy& policy) { - InitializeWithPolicy(mem, size, policy); - } - - // Destructor deletes all owned heap allocated objects, and destructs objects - // that have non-trivial destructors, except for proto2 message objects whose - // destructors can be skipped. Also, frees all blocks except the initial block - // if it was passed in. - ~ThreadSafeArena(); - - uint64_t Reset(); - - uint64_t SpaceAllocated() const; - uint64_t SpaceUsed() const; - - void* AllocateAligned(size_t n, const std::type_info* type) { - SerialArena* arena; - if (PROTOBUF_PREDICT_TRUE(!alloc_policy_.should_record_allocs() && - GetSerialArenaFast(&arena))) { - return arena->AllocateAligned(n, AllocPolicy()); - } else { - return AllocateAlignedFallback(n, type); - } - } - - // This function allocates n bytes if the common happy case is true and - // returns true. Otherwise does nothing and returns false. This strange - // semantics is necessary to allow callers to program functions that only - // have fallback function calls in tail position. This substantially improves - // code for the happy path. - PROTOBUF_NDEBUG_INLINE bool MaybeAllocateAligned(size_t n, void** out) { - SerialArena* a; - if (PROTOBUF_PREDICT_TRUE(!alloc_policy_.should_record_allocs() && - GetSerialArenaFromThreadCache(&a))) { - return a->MaybeAllocateAligned(n, out); - } - return false; - } - - std::pair AllocateAlignedWithCleanup( - size_t n, const std::type_info* type); - - // Add object pointer and cleanup function pointer to the list. - void AddCleanup(void* elem, void (*cleanup)(void*)); - - // Checks whether this arena is message-owned. - PROTOBUF_ALWAYS_INLINE bool IsMessageOwned() const { - return tag_and_id_ & kMessageOwnedArena; - } - - private: - // Unique for each arena. Changes on Reset(). - uint64_t tag_and_id_ = 0; - // The LSB of tag_and_id_ indicates if the arena is message-owned. - enum : uint64_t { kMessageOwnedArena = 1 }; - - TaggedAllocationPolicyPtr alloc_policy_; // Tagged pointer to AllocPolicy. - - // Pointer to a linked list of SerialArena. - std::atomic threads_; - std::atomic hint_; // Fast thread-local block access - - const AllocationPolicy* AllocPolicy() const { return alloc_policy_.get(); } - void InitializeFrom(void* mem, size_t size); - void InitializeWithPolicy(void* mem, size_t size, AllocationPolicy policy); - void* AllocateAlignedFallback(size_t n, const std::type_info* type); - std::pair - AllocateAlignedWithCleanupFallback(size_t n, const std::type_info* type); - - void Init(); - void SetInitialBlock(void* mem, size_t size); - - // Delete or Destruct all objects owned by the arena. - void CleanupList(); - - inline uint64_t LifeCycleId() const { - return tag_and_id_ & ~kMessageOwnedArena; - } - - inline void CacheSerialArena(SerialArena* serial) { - thread_cache().last_serial_arena = serial; - thread_cache().last_lifecycle_id_seen = tag_and_id_; - // TODO(haberman): evaluate whether we would gain efficiency by getting rid - // of hint_. It's the only write we do to ThreadSafeArena in the allocation - // path, which will dirty the cache line. - - hint_.store(serial, std::memory_order_release); - } - - PROTOBUF_NDEBUG_INLINE bool GetSerialArenaFast(SerialArena** arena) { - if (GetSerialArenaFromThreadCache(arena)) return true; - - // Check whether we own the last accessed SerialArena on this arena. This - // fast path optimizes the case where a single thread uses multiple arenas. - ThreadCache* tc = &thread_cache(); - SerialArena* serial = hint_.load(std::memory_order_acquire); - if (PROTOBUF_PREDICT_TRUE(serial != NULL && serial->owner() == tc)) { - *arena = serial; - return true; - } - return false; - } - - PROTOBUF_NDEBUG_INLINE bool GetSerialArenaFromThreadCache( - SerialArena** arena) { - // If this thread already owns a block in this arena then try to use that. - // This fast path optimizes the case where multiple threads allocate from - // the same arena. - ThreadCache* tc = &thread_cache(); - if (PROTOBUF_PREDICT_TRUE(tc->last_lifecycle_id_seen == tag_and_id_)) { - *arena = tc->last_serial_arena; - return true; - } - return false; - } - SerialArena* GetSerialArenaFallback(void* me); - - template - void PerSerialArena(Functor fn) { - // By omitting an Acquire barrier we ensure that any user code that doesn't - // properly synchronize Reset() or the destructor will throw a TSAN warning. - SerialArena* serial = threads_.load(std::memory_order_relaxed); - - for (; serial; serial = serial->next()) fn(serial); - } - - // Releases all memory except the first block which it returns. The first - // block might be owned by the user and thus need some extra checks before - // deleting. - SerialArena::Memory Free(size_t* space_allocated); - -#ifdef _MSC_VER -#pragma warning(disable : 4324) -#endif - struct alignas(64) ThreadCache { -#if defined(GOOGLE_PROTOBUF_NO_THREADLOCAL) - // If we are using the ThreadLocalStorage class to store the ThreadCache, - // then the ThreadCache's default constructor has to be responsible for - // initializing it. - ThreadCache() - : next_lifecycle_id(0), - last_lifecycle_id_seen(-1), - last_serial_arena(NULL) {} -#endif - - // Number of per-thread lifecycle IDs to reserve. Must be power of two. - // To reduce contention on a global atomic, each thread reserves a batch of - // IDs. The following number is calculated based on a stress test with - // ~6500 threads all frequently allocating a new arena. - static constexpr size_t kPerThreadIds = 256; - // Next lifecycle ID available to this thread. We need to reserve a new - // batch, if `next_lifecycle_id & (kPerThreadIds - 1) == 0`. - uint64_t next_lifecycle_id; - // The ThreadCache is considered valid as long as this matches the - // lifecycle_id of the arena being used. - uint64_t last_lifecycle_id_seen; - SerialArena* last_serial_arena; - }; - - // Lifecycle_id can be highly contended variable in a situation of lots of - // arena creation. Make sure that other global variables are not sharing the - // cacheline. -#ifdef _MSC_VER -#pragma warning(disable : 4324) -#endif - struct alignas(64) CacheAlignedLifecycleIdGenerator { - std::atomic id; - }; - static CacheAlignedLifecycleIdGenerator lifecycle_id_generator_; -#if defined(GOOGLE_PROTOBUF_NO_THREADLOCAL) - // iOS does not support __thread keyword so we use a custom thread local - // storage class we implemented. - static ThreadCache& thread_cache(); -#elif defined(PROTOBUF_USE_DLLS) - // Thread local variables cannot be exposed through DLL interface but we can - // wrap them in static functions. - static ThreadCache& thread_cache(); -#else - static PROTOBUF_THREAD_LOCAL ThreadCache thread_cache_; - static ThreadCache& thread_cache() { return thread_cache_; } -#endif - - GOOGLE_DISALLOW_EVIL_CONSTRUCTORS(ThreadSafeArena); - // All protos have pointers back to the arena hence Arena must have - // pointer stability. - ThreadSafeArena(ThreadSafeArena&&) = delete; - ThreadSafeArena& operator=(ThreadSafeArena&&) = delete; - - public: - // kBlockHeaderSize is sizeof(Block), aligned up to the nearest multiple of 8 - // to protect the invariant that pos is always at a multiple of 8. - static constexpr size_t kBlockHeaderSize = SerialArena::kBlockHeaderSize; - static constexpr size_t kSerialArenaSize = - (sizeof(SerialArena) + 7) & static_cast(-8); - static_assert(kBlockHeaderSize % 8 == 0, - "kBlockHeaderSize must be a multiple of 8."); - static_assert(kSerialArenaSize % 8 == 0, - "kSerialArenaSize must be a multiple of 8."); -}; - -} // namespace internal -} // namespace protobuf -} // namespace google - -#include - -#endif // GOOGLE_PROTOBUF_ARENA_IMPL_H__ diff --git a/extra/protobuf/protobuf-3.19.4/src/google/protobuf/arena_test_util.cc b/extra/protobuf/protobuf-3.19.4/src/google/protobuf/arena_test_util.cc deleted file mode 100644 index da32960ce131..000000000000 --- a/extra/protobuf/protobuf-3.19.4/src/google/protobuf/arena_test_util.cc +++ /dev/null @@ -1,50 +0,0 @@ -// Protocol Buffers - Google's data interchange format -// Copyright 2008 Google Inc. All rights reserved. -// https://developers.google.com/protocol-buffers/ -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// * Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// * Redistributions in binary form must reproduce the above -// copyright notice, this list of conditions and the following disclaimer -// in the documentation and/or other materials provided with the -// distribution. -// * Neither the name of Google Inc. nor the names of its -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -#include -#include -#include - - -#define EXPECT_EQ GOOGLE_CHECK_EQ - -namespace google { -namespace protobuf { -namespace internal { - -NoHeapChecker::~NoHeapChecker() { - capture_alloc.Unhook(); - EXPECT_EQ(0, capture_alloc.alloc_count()); - EXPECT_EQ(0, capture_alloc.free_count()); -} - -} // namespace internal -} // namespace protobuf -} // namespace google diff --git a/extra/protobuf/protobuf-3.19.4/src/google/protobuf/arena_test_util.h b/extra/protobuf/protobuf-3.19.4/src/google/protobuf/arena_test_util.h deleted file mode 100644 index 33f5cf419293..000000000000 --- a/extra/protobuf/protobuf-3.19.4/src/google/protobuf/arena_test_util.h +++ /dev/null @@ -1,126 +0,0 @@ -// Protocol Buffers - Google's data interchange format -// Copyright 2008 Google Inc. All rights reserved. -// https://developers.google.com/protocol-buffers/ -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// * Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// * Redistributions in binary form must reproduce the above -// copyright notice, this list of conditions and the following disclaimer -// in the documentation and/or other materials provided with the -// distribution. -// * Neither the name of Google Inc. nor the names of its -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -#ifndef GOOGLE_PROTOBUF_ARENA_TEST_UTIL_H__ -#define GOOGLE_PROTOBUF_ARENA_TEST_UTIL_H__ - -#include -#include -#include -#include -#include - -namespace google { -namespace protobuf { - -template -void TestParseCorruptedString(const T& message) { - int success_count = 0; - std::string s; - { - // Map order is not deterministic. To make the test deterministic we want - // to serialize the proto deterministically. - io::StringOutputStream output(&s); - io::CodedOutputStream out(&output); - out.SetSerializationDeterministic(true); - message.SerializePartialToCodedStream(&out); - } - const int kMaxIters = 900; - const int stride = s.size() <= kMaxIters ? 1 : s.size() / kMaxIters; - const int start = stride == 1 || use_arena ? 0 : (stride + 1) / 2; - for (int i = start; i < s.size(); i += stride) { - for (int c = 1 + (i % 17); c < 256; c += 2 * c + (i & 3)) { - s[i] ^= c; - Arena arena; - T* message = Arena::CreateMessage(use_arena ? &arena : nullptr); - if (message->ParseFromString(s)) { - ++success_count; - } - if (!use_arena) { - delete message; - } - s[i] ^= c; // Restore s to its original state. - } - } - // This next line is a low bar. But getting through the test without crashing - // due to use-after-free or other bugs is a big part of what we're checking. - GOOGLE_CHECK_GT(success_count, 0); -} - -namespace internal { - -class NoHeapChecker { - public: - NoHeapChecker() { capture_alloc.Hook(); } - ~NoHeapChecker(); - - private: - class NewDeleteCapture { - public: - // TODO(xiaofeng): Implement this for opensource protobuf. - void Hook() {} - void Unhook() {} - int alloc_count() { return 0; } - int free_count() { return 0; } - } capture_alloc; -}; - -// Owns the internal T only if it's not owned by an arena. -// T needs to be arena constructible and destructor skippable. -template -class ArenaHolder { - public: - explicit ArenaHolder(Arena* arena) - : field_(Arena::CreateMessage(arena)), - owned_by_arena_(arena != nullptr) { - GOOGLE_DCHECK(google::protobuf::Arena::is_arena_constructable::value); - GOOGLE_DCHECK(google::protobuf::Arena::is_destructor_skippable::value); - } - - ~ArenaHolder() { - if (!owned_by_arena_) { - delete field_; - } - } - - T* get() { return field_; } - T* operator->() { return field_; } - T& operator*() { return *field_; } - - private: - T* field_; - bool owned_by_arena_; -}; - -} // namespace internal -} // namespace protobuf -} // namespace google - -#endif // GOOGLE_PROTOBUF_ARENA_TEST_UTIL_H__ diff --git a/extra/protobuf/protobuf-3.19.4/src/google/protobuf/arena_unittest.cc b/extra/protobuf/protobuf-3.19.4/src/google/protobuf/arena_unittest.cc deleted file mode 100644 index 76d9126ac390..000000000000 --- a/extra/protobuf/protobuf-3.19.4/src/google/protobuf/arena_unittest.cc +++ /dev/null @@ -1,1557 +0,0 @@ -// Protocol Buffers - Google's data interchange format -// Copyright 2008 Google Inc. All rights reserved. -// https://developers.google.com/protocol-buffers/ -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// * Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// * Redistributions in binary form must reproduce the above -// copyright notice, this list of conditions and the following disclaimer -// in the documentation and/or other materials provided with the -// distribution. -// * Neither the name of Google Inc. nor the names of its -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -#include - -#include -#include -#include -#include -#include -#include -#include -#include - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - - -// Must be included last -#include - -using proto2_arena_unittest::ArenaMessage; -using protobuf_unittest::TestAllExtensions; -using protobuf_unittest::TestAllTypes; -using protobuf_unittest::TestEmptyMessage; -using protobuf_unittest::TestOneof2; - -namespace google { -namespace protobuf { - -class Notifier { - public: - Notifier() : count_(0) {} - void Notify() { count_++; } - int GetCount() { return count_; } - - private: - int count_; -}; - -class SimpleDataType { - public: - SimpleDataType() : notifier_(NULL) {} - void SetNotifier(Notifier* notifier) { notifier_ = notifier; } - virtual ~SimpleDataType() { - if (notifier_ != NULL) { - notifier_->Notify(); - } - }; - - private: - Notifier* notifier_; -}; - -// A simple class that does not allow copying and so cannot be used as a -// parameter type without "const &". -class PleaseDontCopyMe { - public: - explicit PleaseDontCopyMe(int value) : value_(value) {} - - int value() const { return value_; } - - private: - int value_; - GOOGLE_DISALLOW_EVIL_CONSTRUCTORS(PleaseDontCopyMe); -}; - -// A class that takes four different types as constructor arguments. -class MustBeConstructedWithOneThroughFour { - public: - MustBeConstructedWithOneThroughFour(int one, const char* two, - const std::string& three, - const PleaseDontCopyMe* four) - : one_(one), two_(two), three_(three), four_(four) {} - - int one_; - const char* const two_; - std::string three_; - const PleaseDontCopyMe* four_; - - private: - GOOGLE_DISALLOW_EVIL_CONSTRUCTORS(MustBeConstructedWithOneThroughFour); -}; - -// A class that takes eight different types as constructor arguments. -class MustBeConstructedWithOneThroughEight { - public: - MustBeConstructedWithOneThroughEight(int one, const char* two, - const std::string& three, - const PleaseDontCopyMe* four, int five, - const char* six, - const std::string& seven, - const std::string& eight) - : one_(one), - two_(two), - three_(three), - four_(four), - five_(five), - six_(six), - seven_(seven), - eight_(eight) {} - - int one_; - const char* const two_; - std::string three_; - const PleaseDontCopyMe* four_; - int five_; - const char* const six_; - std::string seven_; - std::string eight_; - - private: - GOOGLE_DISALLOW_EVIL_CONSTRUCTORS(MustBeConstructedWithOneThroughEight); -}; - -TEST(ArenaTest, ArenaConstructable) { - EXPECT_TRUE(Arena::is_arena_constructable::type::value); - EXPECT_TRUE(Arena::is_arena_constructable::type::value); - EXPECT_FALSE(Arena::is_arena_constructable::type::value); -} - -TEST(ArenaTest, DestructorSkippable) { - EXPECT_TRUE(Arena::is_destructor_skippable::type::value); - EXPECT_TRUE(Arena::is_destructor_skippable::type::value); - EXPECT_FALSE(Arena::is_destructor_skippable::type::value); -} - -TEST(ArenaTest, BasicCreate) { - Arena arena; - EXPECT_TRUE(Arena::Create(&arena) != NULL); - EXPECT_TRUE(Arena::Create(&arena) != NULL); - EXPECT_TRUE(Arena::Create(&arena) != NULL); - EXPECT_TRUE(Arena::Create(&arena) != NULL); - EXPECT_TRUE(Arena::Create(&arena) != NULL); - arena.Own(new int32_t); - arena.Own(new int64_t); - arena.Own(new float); - arena.Own(new double); - arena.Own(new std::string); - arena.Own(NULL); - Notifier notifier; - SimpleDataType* data = Arena::Create(&arena); - data->SetNotifier(¬ifier); - data = new SimpleDataType; - data->SetNotifier(¬ifier); - arena.Own(data); - arena.Reset(); - EXPECT_EQ(2, notifier.GetCount()); -} - -TEST(ArenaTest, CreateAndConstCopy) { - Arena arena; - const std::string s("foo"); - const std::string* s_copy = Arena::Create(&arena, s); - EXPECT_TRUE(s_copy != NULL); - EXPECT_EQ("foo", s); - EXPECT_EQ("foo", *s_copy); -} - -TEST(ArenaTest, CreateAndNonConstCopy) { - Arena arena; - std::string s("foo"); - const std::string* s_copy = Arena::Create(&arena, s); - EXPECT_TRUE(s_copy != NULL); - EXPECT_EQ("foo", s); - EXPECT_EQ("foo", *s_copy); -} - -TEST(ArenaTest, CreateAndMove) { - Arena arena; - std::string s("foo"); - const std::string* s_move = Arena::Create(&arena, std::move(s)); - EXPECT_TRUE(s_move != NULL); - EXPECT_TRUE(s.empty()); // NOLINT - EXPECT_EQ("foo", *s_move); -} - -TEST(ArenaTest, CreateWithFourConstructorArguments) { - Arena arena; - const std::string three("3"); - const PleaseDontCopyMe four(4); - const MustBeConstructedWithOneThroughFour* new_object = - Arena::Create(&arena, 1, "2", three, - &four); - EXPECT_TRUE(new_object != NULL); - ASSERT_EQ(1, new_object->one_); - ASSERT_STREQ("2", new_object->two_); - ASSERT_EQ("3", new_object->three_); - ASSERT_EQ(4, new_object->four_->value()); -} - -TEST(ArenaTest, CreateWithEightConstructorArguments) { - Arena arena; - const std::string three("3"); - const PleaseDontCopyMe four(4); - const std::string seven("7"); - const std::string eight("8"); - const MustBeConstructedWithOneThroughEight* new_object = - Arena::Create( - &arena, 1, "2", three, &four, 5, "6", seven, eight); - EXPECT_TRUE(new_object != NULL); - ASSERT_EQ(1, new_object->one_); - ASSERT_STREQ("2", new_object->two_); - ASSERT_EQ("3", new_object->three_); - ASSERT_EQ(4, new_object->four_->value()); - ASSERT_EQ(5, new_object->five_); - ASSERT_STREQ("6", new_object->six_); - ASSERT_EQ("7", new_object->seven_); - ASSERT_EQ("8", new_object->eight_); -} - -class PleaseMoveMe { - public: - explicit PleaseMoveMe(const std::string& value) : value_(value) {} - PleaseMoveMe(PleaseMoveMe&&) = default; - PleaseMoveMe(const PleaseMoveMe&) = delete; - - const std::string& value() const { return value_; } - - private: - std::string value_; -}; - -TEST(ArenaTest, CreateWithMoveArguments) { - Arena arena; - PleaseMoveMe one("1"); - const PleaseMoveMe* new_object = - Arena::Create(&arena, std::move(one)); - EXPECT_TRUE(new_object); - ASSERT_EQ("1", new_object->value()); -} - -TEST(ArenaTest, InitialBlockTooSmall) { - // Construct a small blocks of memory to be used by the arena allocator; then, - // allocate an object which will not fit in the initial block. - for (int size = 0; size <= Arena::kBlockOverhead + 32; size++) { - std::vector arena_block(size); - ArenaOptions options; - options.initial_block = arena_block.data(); - options.initial_block_size = arena_block.size(); - - // Try sometimes with non-default block sizes so that we exercise paths - // with and without ArenaImpl::Options. - if ((size % 2) != 0) { - options.start_block_size += 8; - } - - Arena arena(options); - - char* p = Arena::CreateArray(&arena, 96); - uintptr_t allocation = reinterpret_cast(p); - - // Ensure that the arena allocator did not return memory pointing into the - // initial block of memory. - uintptr_t arena_start = reinterpret_cast(arena_block.data()); - uintptr_t arena_end = arena_start + arena_block.size(); - EXPECT_FALSE(allocation >= arena_start && allocation < arena_end); - - // Write to the memory we allocated; this should (but is not guaranteed to) - // trigger a check for heap corruption if the object was allocated from the - // initially-provided block. - memset(p, '\0', 96); - } -} - -TEST(ArenaTest, Parsing) { - TestAllTypes original; - TestUtil::SetAllFields(&original); - - // Test memory leak. - Arena arena; - TestAllTypes* arena_message = Arena::CreateMessage(&arena); - arena_message->ParseFromString(original.SerializeAsString()); - TestUtil::ExpectAllFieldsSet(*arena_message); - - // Test that string fields have nul terminator bytes (earlier bug). - EXPECT_EQ(strlen(original.optional_string().c_str()), - strlen(arena_message->optional_string().c_str())); -} - -TEST(ArenaTest, UnknownFields) { - TestAllTypes original; - TestUtil::SetAllFields(&original); - - // Test basic parsing into (populating) and reading out of unknown fields on - // an arena. - Arena arena; - TestEmptyMessage* arena_message = - Arena::CreateMessage(&arena); - arena_message->ParseFromString(original.SerializeAsString()); - - TestAllTypes copied; - copied.ParseFromString(arena_message->SerializeAsString()); - TestUtil::ExpectAllFieldsSet(copied); - - // Exercise UFS manual manipulation (setters). - arena_message = Arena::CreateMessage(&arena); - arena_message->mutable_unknown_fields()->AddVarint( - TestAllTypes::kOptionalInt32FieldNumber, 42); - copied.Clear(); - copied.ParseFromString(arena_message->SerializeAsString()); - EXPECT_TRUE(copied.has_optional_int32()); - EXPECT_EQ(42, copied.optional_int32()); - - // Exercise UFS swap path. - TestEmptyMessage* arena_message_2 = - Arena::CreateMessage(&arena); - arena_message_2->Swap(arena_message); - copied.Clear(); - copied.ParseFromString(arena_message_2->SerializeAsString()); - EXPECT_TRUE(copied.has_optional_int32()); - EXPECT_EQ(42, copied.optional_int32()); - - // Test field manipulation. - TestEmptyMessage* arena_message_3 = - Arena::CreateMessage(&arena); - arena_message_3->mutable_unknown_fields()->AddVarint(1000, 42); - arena_message_3->mutable_unknown_fields()->AddFixed32(1001, 42); - arena_message_3->mutable_unknown_fields()->AddFixed64(1002, 42); - arena_message_3->mutable_unknown_fields()->AddLengthDelimited(1003); - arena_message_3->mutable_unknown_fields()->DeleteSubrange(0, 2); - arena_message_3->mutable_unknown_fields()->DeleteByNumber(1002); - arena_message_3->mutable_unknown_fields()->DeleteByNumber(1003); - EXPECT_TRUE(arena_message_3->unknown_fields().empty()); -} - -TEST(ArenaTest, Swap) { - Arena arena1; - Arena arena2; - TestAllTypes* arena1_message; - TestAllTypes* arena2_message; - - // Case 1: Swap(), no UFS on either message, both messages on different - // arenas. Arena pointers should remain the same after swap. - arena1_message = Arena::CreateMessage(&arena1); - arena2_message = Arena::CreateMessage(&arena2); - arena1_message->Swap(arena2_message); - EXPECT_EQ(&arena1, arena1_message->GetArena()); - EXPECT_EQ(&arena2, arena2_message->GetArena()); - - // Case 2: Swap(), UFS on one message, both messages on different arenas. - arena1_message = Arena::CreateMessage(&arena1); - arena2_message = Arena::CreateMessage(&arena2); - arena1_message->mutable_unknown_fields()->AddVarint(1, 42); - arena1_message->Swap(arena2_message); - EXPECT_EQ(&arena1, arena1_message->GetArena()); - EXPECT_EQ(&arena2, arena2_message->GetArena()); - EXPECT_EQ(0, arena1_message->unknown_fields().field_count()); - EXPECT_EQ(1, arena2_message->unknown_fields().field_count()); - EXPECT_EQ(42, arena2_message->unknown_fields().field(0).varint()); - - // Case 3: Swap(), UFS on both messages, both messages on different arenas. - arena1_message = Arena::CreateMessage(&arena1); - arena2_message = Arena::CreateMessage(&arena2); - arena1_message->mutable_unknown_fields()->AddVarint(1, 42); - arena2_message->mutable_unknown_fields()->AddVarint(2, 84); - arena1_message->Swap(arena2_message); - EXPECT_EQ(&arena1, arena1_message->GetArena()); - EXPECT_EQ(&arena2, arena2_message->GetArena()); - EXPECT_EQ(1, arena1_message->unknown_fields().field_count()); - EXPECT_EQ(1, arena2_message->unknown_fields().field_count()); - EXPECT_EQ(84, arena1_message->unknown_fields().field(0).varint()); - EXPECT_EQ(42, arena2_message->unknown_fields().field(0).varint()); -} - -TEST(ArenaTest, ReflectionSwapFields) { - Arena arena1; - Arena arena2; - TestAllTypes* arena1_message; - TestAllTypes* arena2_message; - - // Case 1: messages on different arenas, only one message is set. - arena1_message = Arena::CreateMessage(&arena1); - arena2_message = Arena::CreateMessage(&arena2); - TestUtil::SetAllFields(arena1_message); - const Reflection* reflection = arena1_message->GetReflection(); - std::vector fields; - reflection->ListFields(*arena1_message, &fields); - reflection->SwapFields(arena1_message, arena2_message, fields); - EXPECT_EQ(&arena1, arena1_message->GetArena()); - EXPECT_EQ(&arena2, arena2_message->GetArena()); - std::string output; - arena1_message->SerializeToString(&output); - EXPECT_EQ(0, output.size()); - TestUtil::ExpectAllFieldsSet(*arena2_message); - reflection->SwapFields(arena1_message, arena2_message, fields); - arena2_message->SerializeToString(&output); - EXPECT_EQ(0, output.size()); - TestUtil::ExpectAllFieldsSet(*arena1_message); - - // Case 2: messages on different arenas, both messages are set. - arena1_message = Arena::CreateMessage(&arena1); - arena2_message = Arena::CreateMessage(&arena2); - TestUtil::SetAllFields(arena1_message); - TestUtil::SetAllFields(arena2_message); - reflection->SwapFields(arena1_message, arena2_message, fields); - EXPECT_EQ(&arena1, arena1_message->GetArena()); - EXPECT_EQ(&arena2, arena2_message->GetArena()); - TestUtil::ExpectAllFieldsSet(*arena1_message); - TestUtil::ExpectAllFieldsSet(*arena2_message); - - // Case 3: messages on different arenas with different lifetimes. - arena1_message = Arena::CreateMessage(&arena1); - { - Arena arena3; - TestAllTypes* arena3_message = Arena::CreateMessage(&arena3); - TestUtil::SetAllFields(arena3_message); - reflection->SwapFields(arena1_message, arena3_message, fields); - } - TestUtil::ExpectAllFieldsSet(*arena1_message); - - // Case 4: one message on arena, the other on heap. - arena1_message = Arena::CreateMessage(&arena1); - TestAllTypes message; - TestUtil::SetAllFields(arena1_message); - reflection->SwapFields(arena1_message, &message, fields); - EXPECT_EQ(&arena1, arena1_message->GetArena()); - EXPECT_EQ(nullptr, message.GetArena()); - arena1_message->SerializeToString(&output); - EXPECT_EQ(0, output.size()); - TestUtil::ExpectAllFieldsSet(message); -} - -TEST(ArenaTest, SetAllocatedMessage) { - Arena arena; - TestAllTypes* arena_message = Arena::CreateMessage(&arena); - TestAllTypes::NestedMessage* nested = new TestAllTypes::NestedMessage; - nested->set_bb(118); - arena_message->set_allocated_optional_nested_message(nested); - EXPECT_EQ(118, arena_message->optional_nested_message().bb()); -} - -TEST(ArenaTest, ReleaseMessage) { - Arena arena; - TestAllTypes* arena_message = Arena::CreateMessage(&arena); - arena_message->mutable_optional_nested_message()->set_bb(118); - std::unique_ptr nested( - arena_message->release_optional_nested_message()); - EXPECT_EQ(118, nested->bb()); - - TestAllTypes::NestedMessage* released_null = - arena_message->release_optional_nested_message(); - EXPECT_EQ(NULL, released_null); -} - -TEST(ArenaTest, SetAllocatedString) { - Arena arena; - TestAllTypes* arena_message = Arena::CreateMessage(&arena); - std::string* allocated_str = new std::string("hello"); - arena_message->set_allocated_optional_string(allocated_str); - EXPECT_EQ("hello", arena_message->optional_string()); -} - -TEST(ArenaTest, ReleaseString) { - Arena arena; - TestAllTypes* arena_message = Arena::CreateMessage(&arena); - arena_message->set_optional_string("hello"); - std::unique_ptr released_str( - arena_message->release_optional_string()); - EXPECT_EQ("hello", *released_str); - - // Test default value. -} - - -TEST(ArenaTest, SwapBetweenArenasWithAllFieldsSet) { - Arena arena1; - TestAllTypes* arena1_message = Arena::CreateMessage(&arena1); - { - Arena arena2; - TestAllTypes* arena2_message = Arena::CreateMessage(&arena2); - TestUtil::SetAllFields(arena2_message); - arena2_message->Swap(arena1_message); - std::string output; - arena2_message->SerializeToString(&output); - EXPECT_EQ(0, output.size()); - } - TestUtil::ExpectAllFieldsSet(*arena1_message); -} - -TEST(ArenaTest, SwapBetweenArenaAndNonArenaWithAllFieldsSet) { - TestAllTypes non_arena_message; - TestUtil::SetAllFields(&non_arena_message); - { - Arena arena2; - TestAllTypes* arena2_message = Arena::CreateMessage(&arena2); - TestUtil::SetAllFields(arena2_message); - arena2_message->Swap(&non_arena_message); - TestUtil::ExpectAllFieldsSet(*arena2_message); - TestUtil::ExpectAllFieldsSet(non_arena_message); - } -} - -TEST(ArenaTest, UnsafeArenaSwap) { - Arena shared_arena; - TestAllTypes* message1 = Arena::CreateMessage(&shared_arena); - TestAllTypes* message2 = Arena::CreateMessage(&shared_arena); - TestUtil::SetAllFields(message1); - message1->UnsafeArenaSwap(message2); - TestUtil::ExpectAllFieldsSet(*message2); -} - -TEST(ArenaTest, SwapBetweenArenasUsingReflection) { - Arena arena1; - TestAllTypes* arena1_message = Arena::CreateMessage(&arena1); - { - Arena arena2; - TestAllTypes* arena2_message = Arena::CreateMessage(&arena2); - TestUtil::SetAllFields(arena2_message); - const Reflection* r = arena2_message->GetReflection(); - r->Swap(arena1_message, arena2_message); - std::string output; - arena2_message->SerializeToString(&output); - EXPECT_EQ(0, output.size()); - } - TestUtil::ExpectAllFieldsSet(*arena1_message); -} - -TEST(ArenaTest, SwapBetweenArenaAndNonArenaUsingReflection) { - TestAllTypes non_arena_message; - TestUtil::SetAllFields(&non_arena_message); - { - Arena arena2; - TestAllTypes* arena2_message = Arena::CreateMessage(&arena2); - TestUtil::SetAllFields(arena2_message); - const Reflection* r = arena2_message->GetReflection(); - r->Swap(&non_arena_message, arena2_message); - TestUtil::ExpectAllFieldsSet(*arena2_message); - TestUtil::ExpectAllFieldsSet(non_arena_message); - } -} - -TEST(ArenaTest, ReleaseFromArenaMessageMakesCopy) { - TestAllTypes::NestedMessage* nested_msg = NULL; - std::string* nested_string = NULL; - { - Arena arena; - TestAllTypes* arena_message = Arena::CreateMessage(&arena); - arena_message->mutable_optional_nested_message()->set_bb(42); - *arena_message->mutable_optional_string() = "Hello"; - nested_msg = arena_message->release_optional_nested_message(); - nested_string = arena_message->release_optional_string(); - } - EXPECT_EQ(42, nested_msg->bb()); - EXPECT_EQ("Hello", *nested_string); - delete nested_msg; - delete nested_string; -} - -#if PROTOBUF_RTTI -TEST(ArenaTest, ReleaseFromArenaMessageUsingReflectionMakesCopy) { - TestAllTypes::NestedMessage* nested_msg = NULL; - // Note: no string: reflection API only supports releasing submessages. - { - Arena arena; - TestAllTypes* arena_message = Arena::CreateMessage(&arena); - arena_message->mutable_optional_nested_message()->set_bb(42); - const Reflection* r = arena_message->GetReflection(); - const FieldDescriptor* f = arena_message->GetDescriptor()->FindFieldByName( - "optional_nested_message"); - nested_msg = static_cast( - r->ReleaseMessage(arena_message, f)); - } - EXPECT_EQ(42, nested_msg->bb()); - delete nested_msg; -} -#endif // PROTOBUF_RTTI - -TEST(ArenaTest, SetAllocatedAcrossArenas) { - Arena arena1; - TestAllTypes* arena1_message = Arena::CreateMessage(&arena1); - TestAllTypes::NestedMessage* heap_submessage = - new TestAllTypes::NestedMessage(); - heap_submessage->set_bb(42); - arena1_message->set_allocated_optional_nested_message(heap_submessage); - // Should keep same object and add to arena's Own()-list. - EXPECT_EQ(heap_submessage, arena1_message->mutable_optional_nested_message()); - { - Arena arena2; - TestAllTypes::NestedMessage* arena2_submessage = - Arena::CreateMessage(&arena2); - arena2_submessage->set_bb(42); -#ifdef PROTOBUF_HAS_DEATH_TEST - EXPECT_DEBUG_DEATH(arena1_message->set_allocated_optional_nested_message( - arena2_submessage), - "submessage_arena"); -#endif - EXPECT_NE(arena2_submessage, - arena1_message->mutable_optional_nested_message()); - } - - TestAllTypes::NestedMessage* arena1_submessage = - Arena::CreateMessage(&arena1); - arena1_submessage->set_bb(42); - TestAllTypes* heap_message = new TestAllTypes; -#ifdef PROTOBUF_HAS_DEATH_TEST - EXPECT_DEBUG_DEATH( - heap_message->set_allocated_optional_nested_message(arena1_submessage), - "submessage_arena"); -#endif - EXPECT_NE(arena1_submessage, heap_message->mutable_optional_nested_message()); - delete heap_message; -} - -TEST(ArenaTest, UnsafeArenaSetAllocatedAcrossArenas) { - Arena arena1; - TestAllTypes* arena1_message = Arena::CreateMessage(&arena1); - { - Arena arena2; - TestAllTypes::NestedMessage* arena2_submessage = - Arena::CreateMessage(&arena2); - arena2_submessage->set_bb(42); - arena1_message->unsafe_arena_set_allocated_optional_nested_message( - arena2_submessage); - EXPECT_EQ(arena2_submessage, - arena1_message->mutable_optional_nested_message()); - EXPECT_EQ(arena2_submessage, - arena1_message->unsafe_arena_release_optional_nested_message()); - } - - TestAllTypes::NestedMessage* arena1_submessage = - Arena::CreateMessage(&arena1); - arena1_submessage->set_bb(42); - TestAllTypes* heap_message = new TestAllTypes; - heap_message->unsafe_arena_set_allocated_optional_nested_message( - arena1_submessage); - EXPECT_EQ(arena1_submessage, heap_message->mutable_optional_nested_message()); - EXPECT_EQ(arena1_submessage, - heap_message->unsafe_arena_release_optional_nested_message()); - delete heap_message; -} - -TEST(ArenaTest, SetAllocatedAcrossArenasWithReflection) { - // Same as above, with reflection. - Arena arena1; - TestAllTypes* arena1_message = Arena::CreateMessage(&arena1); - const Reflection* r = arena1_message->GetReflection(); - const Descriptor* d = arena1_message->GetDescriptor(); - const FieldDescriptor* msg_field = - d->FindFieldByName("optional_nested_message"); - TestAllTypes::NestedMessage* heap_submessage = - new TestAllTypes::NestedMessage(); - heap_submessage->set_bb(42); - r->SetAllocatedMessage(arena1_message, heap_submessage, msg_field); - // Should keep same object and add to arena's Own()-list. - EXPECT_EQ(heap_submessage, arena1_message->mutable_optional_nested_message()); - { - Arena arena2; - TestAllTypes::NestedMessage* arena2_submessage = - Arena::CreateMessage(&arena2); - arena2_submessage->set_bb(42); -#ifdef PROTOBUF_HAS_DEATH_TEST - EXPECT_DEBUG_DEATH( - r->SetAllocatedMessage(arena1_message, arena2_submessage, msg_field), - "GetOwningArena"); -#endif - EXPECT_NE(arena2_submessage, - arena1_message->mutable_optional_nested_message()); - } - - TestAllTypes::NestedMessage* arena1_submessage = - Arena::CreateMessage(&arena1); - arena1_submessage->set_bb(42); - TestAllTypes* heap_message = new TestAllTypes; -#ifdef PROTOBUF_HAS_DEATH_TEST - EXPECT_DEBUG_DEATH( - r->SetAllocatedMessage(heap_message, arena1_submessage, msg_field), - "GetOwningArena"); -#endif - EXPECT_NE(arena1_submessage, heap_message->mutable_optional_nested_message()); - delete heap_message; -} - -TEST(ArenaTest, UnsafeArenaSetAllocatedAcrossArenasWithReflection) { - // Same as above, with reflection. - Arena arena1; - TestAllTypes* arena1_message = Arena::CreateMessage(&arena1); - const Reflection* r = arena1_message->GetReflection(); - const Descriptor* d = arena1_message->GetDescriptor(); - const FieldDescriptor* msg_field = - d->FindFieldByName("optional_nested_message"); - { - Arena arena2; - TestAllTypes::NestedMessage* arena2_submessage = - Arena::CreateMessage(&arena2); - arena2_submessage->set_bb(42); - r->UnsafeArenaSetAllocatedMessage(arena1_message, arena2_submessage, - msg_field); - EXPECT_EQ(arena2_submessage, - arena1_message->mutable_optional_nested_message()); - EXPECT_EQ(arena2_submessage, - arena1_message->unsafe_arena_release_optional_nested_message()); - } - - TestAllTypes::NestedMessage* arena1_submessage = - Arena::CreateMessage(&arena1); - arena1_submessage->set_bb(42); - TestAllTypes* heap_message = new TestAllTypes; - r->UnsafeArenaSetAllocatedMessage(heap_message, arena1_submessage, msg_field); - EXPECT_EQ(arena1_submessage, heap_message->mutable_optional_nested_message()); - EXPECT_EQ(arena1_submessage, - heap_message->unsafe_arena_release_optional_nested_message()); - delete heap_message; -} - -TEST(ArenaTest, AddAllocatedWithReflection) { - Arena arena1; - ArenaMessage* arena1_message = Arena::CreateMessage(&arena1); - const Reflection* r = arena1_message->GetReflection(); - const Descriptor* d = arena1_message->GetDescriptor(); - // Message with cc_enable_arenas = true; - const FieldDescriptor* fd = d->FindFieldByName("repeated_nested_message"); - r->AddMessage(arena1_message, fd); - r->AddMessage(arena1_message, fd); - r->AddMessage(arena1_message, fd); - EXPECT_EQ(3, r->FieldSize(*arena1_message, fd)); -} - -TEST(ArenaTest, RepeatedPtrFieldAddClearedTest) { -#ifndef PROTOBUF_FUTURE_BREAKING_CHANGES - { - RepeatedPtrField repeated_field; - EXPECT_TRUE(repeated_field.empty()); - EXPECT_EQ(0, repeated_field.size()); - // Ownership is passed to repeated_field. - TestAllTypes* cleared = new TestAllTypes(); - repeated_field.AddCleared(cleared); - EXPECT_TRUE(repeated_field.empty()); - EXPECT_EQ(0, repeated_field.size()); - } -#endif // !PROTOBUF_FUTURE_BREAKING_CHANGES - { - RepeatedPtrField repeated_field; - EXPECT_TRUE(repeated_field.empty()); - EXPECT_EQ(0, repeated_field.size()); - // Ownership is passed to repeated_field. - TestAllTypes* cleared = new TestAllTypes(); - repeated_field.AddAllocated(cleared); - EXPECT_FALSE(repeated_field.empty()); - EXPECT_EQ(1, repeated_field.size()); - } -} - -TEST(ArenaTest, AddAllocatedToRepeatedField) { - // Heap->arena case. - Arena arena1; - TestAllTypes* arena1_message = Arena::CreateMessage(&arena1); - for (int i = 0; i < 10; i++) { - TestAllTypes::NestedMessage* heap_submessage = - new TestAllTypes::NestedMessage(); - heap_submessage->set_bb(42); - arena1_message->mutable_repeated_nested_message()->AddAllocated( - heap_submessage); - // Should not copy object -- will use arena_->Own(). - EXPECT_EQ(heap_submessage, &arena1_message->repeated_nested_message(i)); - EXPECT_EQ(42, arena1_message->repeated_nested_message(i).bb()); - } - - // Arena1->Arena2 case. - arena1_message->Clear(); - for (int i = 0; i < 10; i++) { - Arena arena2; - TestAllTypes::NestedMessage* arena2_submessage = - Arena::CreateMessage(&arena2); - arena2_submessage->set_bb(42); -#ifdef PROTOBUF_HAS_DEATH_TEST - EXPECT_DEBUG_DEATH( - arena1_message->mutable_repeated_nested_message()->AddAllocated( - arena2_submessage), - "value_arena"); -#endif - // Should not receive object. - EXPECT_TRUE(arena1_message->repeated_nested_message().empty()); - } - - // Arena->heap case. - TestAllTypes* heap_message = new TestAllTypes; - for (int i = 0; i < 10; i++) { - Arena arena2; - TestAllTypes::NestedMessage* arena2_submessage = - Arena::CreateMessage(&arena2); - arena2_submessage->set_bb(42); -#ifdef PROTOBUF_HAS_DEATH_TEST - EXPECT_DEBUG_DEATH( - heap_message->mutable_repeated_nested_message()->AddAllocated( - arena2_submessage), - "value_arena"); -#endif - // Should not receive object. - EXPECT_TRUE(heap_message->repeated_nested_message().empty()); - } - delete heap_message; - - // Heap->arena case for strings (which are not arena-allocated). - arena1_message->Clear(); - for (int i = 0; i < 10; i++) { - std::string* s = new std::string("Test"); - arena1_message->mutable_repeated_string()->AddAllocated(s); - // Should not copy. - EXPECT_EQ(s, &arena1_message->repeated_string(i)); - EXPECT_EQ("Test", arena1_message->repeated_string(i)); - } -} - -TEST(ArenaTest, UnsafeArenaAddAllocatedToRepeatedField) { - // Heap->arena case. - Arena arena1; - TestAllTypes* arena1_message = Arena::CreateMessage(&arena1); - { - auto* heap_submessage = new TestAllTypes::NestedMessage; - arena1_message->mutable_repeated_nested_message()->UnsafeArenaAddAllocated( - heap_submessage); - // Should not copy object. - EXPECT_EQ(heap_submessage, &arena1_message->repeated_nested_message(0)); - EXPECT_EQ(heap_submessage, arena1_message->mutable_repeated_nested_message() - ->UnsafeArenaReleaseLast()); - delete heap_submessage; - } - - // Arena1->Arena2 case. - arena1_message->Clear(); - { - Arena arena2; - TestAllTypes::NestedMessage* arena2_submessage = - Arena::CreateMessage(&arena2); - arena2_submessage->set_bb(42); - arena1_message->mutable_repeated_nested_message()->UnsafeArenaAddAllocated( - arena2_submessage); - // Should own object. - EXPECT_EQ(arena2_submessage, &arena1_message->repeated_nested_message(0)); - EXPECT_EQ(arena2_submessage, - arena1_message->mutable_repeated_nested_message() - ->UnsafeArenaReleaseLast()); - } - - // Arena->heap case. - TestAllTypes* heap_message = new TestAllTypes; - { - Arena arena2; - TestAllTypes::NestedMessage* arena2_submessage = - Arena::CreateMessage(&arena2); - arena2_submessage->set_bb(42); - heap_message->mutable_repeated_nested_message()->UnsafeArenaAddAllocated( - arena2_submessage); - // Should own object. - EXPECT_EQ(arena2_submessage, &heap_message->repeated_nested_message(0)); - EXPECT_EQ(arena2_submessage, heap_message->mutable_repeated_nested_message() - ->UnsafeArenaReleaseLast()); - } - delete heap_message; - - // Heap->arena case for strings (which are not arena-allocated). - arena1_message->Clear(); - { - std::string* s = new std::string("Test"); - arena1_message->mutable_repeated_string()->UnsafeArenaAddAllocated(s); - // Should not copy. - EXPECT_EQ(s, &arena1_message->repeated_string(0)); - EXPECT_EQ("Test", arena1_message->repeated_string(0)); - delete arena1_message->mutable_repeated_string()->UnsafeArenaReleaseLast(); - } -} - -TEST(ArenaTest, AddAllocatedToRepeatedFieldViaReflection) { - // Heap->arena case. - Arena arena1; - TestAllTypes* arena1_message = Arena::CreateMessage(&arena1); - const Reflection* r = arena1_message->GetReflection(); - const Descriptor* d = arena1_message->GetDescriptor(); - const FieldDescriptor* fd = d->FindFieldByName("repeated_nested_message"); - for (int i = 0; i < 10; i++) { - TestAllTypes::NestedMessage* heap_submessage = - new TestAllTypes::NestedMessage; - heap_submessage->set_bb(42); - r->AddAllocatedMessage(arena1_message, fd, heap_submessage); - // Should not copy object -- will use arena_->Own(). - EXPECT_EQ(heap_submessage, &arena1_message->repeated_nested_message(i)); - EXPECT_EQ(42, arena1_message->repeated_nested_message(i).bb()); - } - - // Arena1->Arena2 case. - arena1_message->Clear(); - for (int i = 0; i < 10; i++) { - Arena arena2; - TestAllTypes::NestedMessage* arena2_submessage = - Arena::CreateMessage(&arena2); - arena2_submessage->set_bb(42); -#ifdef PROTOBUF_HAS_DEATH_TEST - EXPECT_DEBUG_DEATH( - r->AddAllocatedMessage(arena1_message, fd, arena2_submessage), - "value_arena"); -#endif - // Should not receive object. - EXPECT_TRUE(arena1_message->repeated_nested_message().empty()); - } - - // Arena->heap case. - TestAllTypes* heap_message = new TestAllTypes; - for (int i = 0; i < 10; i++) { - Arena arena2; - TestAllTypes::NestedMessage* arena2_submessage = - Arena::CreateMessage(&arena2); - arena2_submessage->set_bb(42); -#ifdef PROTOBUF_HAS_DEATH_TEST - EXPECT_DEBUG_DEATH( - r->AddAllocatedMessage(heap_message, fd, arena2_submessage), - "value_arena"); -#endif - // Should not receive object. - EXPECT_TRUE(heap_message->repeated_nested_message().empty()); - } - delete heap_message; -} - -TEST(ArenaTest, ReleaseLastRepeatedField) { - // Release from arena-allocated repeated field and ensure that returned object - // is heap-allocated. - Arena arena; - TestAllTypes* arena_message = Arena::CreateMessage(&arena); - for (int i = 0; i < 10; i++) { - TestAllTypes::NestedMessage* nested = - Arena::CreateMessage(&arena); - nested->set_bb(42); - arena_message->mutable_repeated_nested_message()->AddAllocated(nested); - } - - for (int i = 0; i < 10; i++) { - const TestAllTypes::NestedMessage* orig_submessage = - &arena_message->repeated_nested_message(10 - 1 - i); // last element - TestAllTypes::NestedMessage* released = - arena_message->mutable_repeated_nested_message()->ReleaseLast(); - EXPECT_NE(released, orig_submessage); - EXPECT_EQ(42, released->bb()); - delete released; - } - - // Test UnsafeArenaReleaseLast(). - for (int i = 0; i < 10; i++) { - TestAllTypes::NestedMessage* nested = - Arena::CreateMessage(&arena); - nested->set_bb(42); - arena_message->mutable_repeated_nested_message()->AddAllocated(nested); - } - - for (int i = 0; i < 10; i++) { - const TestAllTypes::NestedMessage* orig_submessage = - &arena_message->repeated_nested_message(10 - 1 - i); // last element - TestAllTypes::NestedMessage* released = - arena_message->mutable_repeated_nested_message() - ->UnsafeArenaReleaseLast(); - EXPECT_EQ(released, orig_submessage); - EXPECT_EQ(42, released->bb()); - // no delete -- |released| is on the arena. - } - - // Test string case as well. ReleaseLast() in this case must copy the - // string, even though it was originally heap-allocated and its pointer - // was simply appended to the repeated field's internal vector, because the - // string was placed on the arena's destructor list and cannot be removed - // from that list (so the arena permanently owns the original instance). - arena_message->Clear(); - for (int i = 0; i < 10; i++) { - std::string* s = new std::string("Test"); - arena_message->mutable_repeated_string()->AddAllocated(s); - } - for (int i = 0; i < 10; i++) { - const std::string* orig_element = - &arena_message->repeated_string(10 - 1 - i); - std::string* released = - arena_message->mutable_repeated_string()->ReleaseLast(); - EXPECT_NE(released, orig_element); - EXPECT_EQ("Test", *released); - delete released; - } -} - -TEST(ArenaTest, UnsafeArenaAddAllocated) { - Arena arena; - TestAllTypes* message = Arena::CreateMessage(&arena); - for (int i = 0; i < 10; i++) { - std::string* arena_string = Arena::Create(&arena); - message->mutable_repeated_string()->UnsafeArenaAddAllocated(arena_string); - EXPECT_EQ(arena_string, message->mutable_repeated_string(i)); - } -} - -TEST(ArenaTest, OneofMerge) { - Arena arena; - TestAllTypes* message0 = Arena::CreateMessage(&arena); - TestAllTypes* message1 = Arena::CreateMessage(&arena); - - message0->set_oneof_string("x"); - ASSERT_TRUE(message0->has_oneof_string()); - message1->set_oneof_string("y"); - ASSERT_TRUE(message1->has_oneof_string()); - EXPECT_EQ("x", message0->oneof_string()); - EXPECT_EQ("y", message1->oneof_string()); - message0->MergeFrom(*message1); - EXPECT_EQ("y", message0->oneof_string()); - EXPECT_EQ("y", message1->oneof_string()); -} - -TEST(ArenaTest, ArenaOneofReflection) { - Arena arena; - TestAllTypes* message = Arena::CreateMessage(&arena); - const Descriptor* desc = message->GetDescriptor(); - const Reflection* refl = message->GetReflection(); - - const FieldDescriptor* string_field = desc->FindFieldByName("oneof_string"); - const FieldDescriptor* msg_field = - desc->FindFieldByName("oneof_nested_message"); - const OneofDescriptor* oneof = desc->FindOneofByName("oneof_field"); - - refl->SetString(message, string_field, "Test value"); - EXPECT_TRUE(refl->HasOneof(*message, oneof)); - refl->ClearOneof(message, oneof); - EXPECT_FALSE(refl->HasOneof(*message, oneof)); - - Message* submsg = refl->MutableMessage(message, msg_field); - EXPECT_TRUE(refl->HasOneof(*message, oneof)); - refl->ClearOneof(message, oneof); - EXPECT_FALSE(refl->HasOneof(*message, oneof)); - refl->MutableMessage(message, msg_field); - EXPECT_TRUE(refl->HasOneof(*message, oneof)); - submsg = refl->ReleaseMessage(message, msg_field); - EXPECT_FALSE(refl->HasOneof(*message, oneof)); - EXPECT_TRUE(submsg->GetArena() == NULL); - delete submsg; -} - -void TestSwapRepeatedField(Arena* arena1, Arena* arena2) { - // Test "safe" (copying) semantics for direct Swap() on RepeatedPtrField - // between arenas. - RepeatedPtrField field1(arena1); - RepeatedPtrField field2(arena2); - for (int i = 0; i < 10; i++) { - TestAllTypes* t = Arena::CreateMessage(arena1); - t->set_optional_string("field1"); - t->set_optional_int32(i); - if (arena1 != NULL) { - field1.UnsafeArenaAddAllocated(t); - } else { - field1.AddAllocated(t); - } - } - for (int i = 0; i < 5; i++) { - TestAllTypes* t = Arena::CreateMessage(arena2); - t->set_optional_string("field2"); - t->set_optional_int32(i); - if (arena2 != NULL) { - field2.UnsafeArenaAddAllocated(t); - } else { - field2.AddAllocated(t); - } - } - field1.Swap(&field2); - EXPECT_EQ(5, field1.size()); - EXPECT_EQ(10, field2.size()); - EXPECT_TRUE(std::string("field1") == field2.Get(0).optional_string()); - EXPECT_TRUE(std::string("field2") == field1.Get(0).optional_string()); - // Ensure that fields retained their original order: - for (int i = 0; i < field1.size(); i++) { - EXPECT_EQ(i, field1.Get(i).optional_int32()); - } - for (int i = 0; i < field2.size(); i++) { - EXPECT_EQ(i, field2.Get(i).optional_int32()); - } -} - -TEST(ArenaTest, SwapRepeatedField) { - Arena arena; - TestSwapRepeatedField(&arena, &arena); -} - -TEST(ArenaTest, SwapRepeatedFieldWithDifferentArenas) { - Arena arena1; - Arena arena2; - TestSwapRepeatedField(&arena1, &arena2); -} - -TEST(ArenaTest, SwapRepeatedFieldWithNoArenaOnRightHandSide) { - Arena arena; - TestSwapRepeatedField(&arena, NULL); -} - -TEST(ArenaTest, SwapRepeatedFieldWithNoArenaOnLeftHandSide) { - Arena arena; - TestSwapRepeatedField(NULL, &arena); -} - -TEST(ArenaTest, ExtensionsOnArena) { - Arena arena; - // Ensure no leaks. - TestAllExtensions* message_ext = - Arena::CreateMessage(&arena); - message_ext->SetExtension(protobuf_unittest::optional_int32_extension, 42); - message_ext->SetExtension(protobuf_unittest::optional_string_extension, - std::string("test")); - message_ext - ->MutableExtension(protobuf_unittest::optional_nested_message_extension) - ->set_bb(42); -} - -TEST(ArenaTest, RepeatedFieldOnArena) { - // Preallocate an initial arena block to avoid mallocs during hooked region. - std::vector arena_block(1024 * 1024); - Arena arena(arena_block.data(), arena_block.size()); - - { - internal::NoHeapChecker no_heap; - - // Fill some repeated fields on the arena to test for leaks. Also verify no - // memory allocations. - RepeatedField repeated_int32(&arena); - RepeatedPtrField repeated_message(&arena); - for (int i = 0; i < 100; i++) { - repeated_int32.Add(42); - repeated_message.Add()->set_optional_int32(42); - EXPECT_EQ(&arena, repeated_message.Get(0).GetArena()); - const TestAllTypes* msg_in_repeated_field = &repeated_message.Get(0); - TestAllTypes* msg = repeated_message.UnsafeArenaReleaseLast(); - EXPECT_EQ(msg_in_repeated_field, msg); - } - - // UnsafeArenaExtractSubrange (i) should not leak and (ii) should return - // on-arena pointers. - for (int i = 0; i < 10; i++) { - repeated_message.Add()->set_optional_int32(42); - } - TestAllTypes* extracted_messages[5]; - repeated_message.UnsafeArenaExtractSubrange(0, 5, extracted_messages); - EXPECT_EQ(&arena, repeated_message.Get(0).GetArena()); - EXPECT_EQ(5, repeated_message.size()); - } - - // Now, outside the scope of the NoHeapChecker, test ExtractSubrange's copying - // semantics. - { - RepeatedPtrField repeated_message(&arena); - for (int i = 0; i < 100; i++) { - repeated_message.Add()->set_optional_int32(42); - } - - TestAllTypes* extracted_messages[5]; - // ExtractSubrange should copy to the heap. - repeated_message.ExtractSubrange(0, 5, extracted_messages); - EXPECT_EQ(NULL, extracted_messages[0]->GetArena()); - // We need to free the heap-allocated messages to prevent a leak. - for (int i = 0; i < 5; i++) { - delete extracted_messages[i]; - extracted_messages[i] = NULL; - } - } - - // Now check that we can create RepeatedFields/RepeatedPtrFields themselves on - // the arena. They have the necessary type traits so that they can behave like - // messages in this way. This is useful for higher-level generic templated - // code that may allocate messages or repeated fields of messages on an arena. - { - RepeatedPtrField* repeated_ptr_on_arena = - Arena::CreateMessage >(&arena); - for (int i = 0; i < 10; i++) { - // Add some elements and let the leak-checker ensure that everything is - // freed. - repeated_ptr_on_arena->Add(); - } - - RepeatedField* repeated_int_on_arena = - Arena::CreateMessage >(&arena); - for (int i = 0; i < 100; i++) { - repeated_int_on_arena->Add(i); - } - - } - - arena.Reset(); -} - - -#if PROTOBUF_RTTI -TEST(ArenaTest, MutableMessageReflection) { - Arena arena; - TestAllTypes* message = Arena::CreateMessage(&arena); - const Reflection* r = message->GetReflection(); - const Descriptor* d = message->GetDescriptor(); - const FieldDescriptor* field = d->FindFieldByName("optional_nested_message"); - TestAllTypes::NestedMessage* submessage = - static_cast( - r->MutableMessage(message, field)); - TestAllTypes::NestedMessage* submessage_expected = - message->mutable_optional_nested_message(); - - EXPECT_EQ(submessage_expected, submessage); - EXPECT_EQ(&arena, submessage->GetArena()); - - const FieldDescriptor* oneof_field = - d->FindFieldByName("oneof_nested_message"); - submessage = static_cast( - r->MutableMessage(message, oneof_field)); - submessage_expected = message->mutable_oneof_nested_message(); - - EXPECT_EQ(submessage_expected, submessage); - EXPECT_EQ(&arena, submessage->GetArena()); -} -#endif // PROTOBUF_RTTI - - -void FillArenaAwareFields(TestAllTypes* message) { - std::string test_string = "hello world"; - message->set_optional_int32(42); - message->set_optional_string(test_string); - message->set_optional_bytes(test_string); - message->mutable_optional_nested_message()->set_bb(42); - - message->set_oneof_uint32(42); - message->mutable_oneof_nested_message()->set_bb(42); - message->set_oneof_string(test_string); - message->set_oneof_bytes(test_string); - - message->add_repeated_int32(42); - // No repeated string: not yet arena-aware. - message->add_repeated_nested_message()->set_bb(42); - message->mutable_optional_lazy_message()->set_bb(42); -} - -// Test: no allocations occur on heap while touching all supported field types. -TEST(ArenaTest, NoHeapAllocationsTest) { - // Allocate a large initial block to avoid mallocs during hooked test. - std::vector arena_block(128 * 1024); - ArenaOptions options; - options.initial_block = &arena_block[0]; - options.initial_block_size = arena_block.size(); - Arena arena(options); - - { - - TestAllTypes* message = Arena::CreateMessage(&arena); - FillArenaAwareFields(message); - } - - arena.Reset(); -} - -TEST(ArenaTest, ParseCorruptedString) { - TestAllTypes message; - TestUtil::SetAllFields(&message); - TestParseCorruptedString(message); - TestParseCorruptedString(message); -} - -#if PROTOBUF_RTTI -// Test construction on an arena via generic MessageLite interface. We should be -// able to successfully deserialize on the arena without incurring heap -// allocations, i.e., everything should still be arena-allocation-aware. -TEST(ArenaTest, MessageLiteOnArena) { - std::vector arena_block(128 * 1024); - ArenaOptions options; - options.initial_block = &arena_block[0]; - options.initial_block_size = arena_block.size(); - Arena arena(options); - const MessageLite* prototype = &TestAllTypes::default_instance(); - - TestAllTypes initial_message; - FillArenaAwareFields(&initial_message); - std::string serialized; - initial_message.SerializeToString(&serialized); - - { - - MessageLite* generic_message = prototype->New(&arena); - EXPECT_TRUE(generic_message != NULL); - EXPECT_EQ(&arena, generic_message->GetArena()); - EXPECT_TRUE(generic_message->ParseFromString(serialized)); - TestAllTypes* deserialized = static_cast(generic_message); - EXPECT_EQ(42, deserialized->optional_int32()); - } - - arena.Reset(); -} -#endif // PROTOBUF_RTTI - -// RepeatedField should support non-POD types, and invoke constructors and -// destructors appropriately, because it's used this way by lots of other code -// (even if this was not its original intent). -TEST(ArenaTest, RepeatedFieldWithNonPODType) { - { - RepeatedField field_on_heap; - for (int i = 0; i < 100; i++) { - *field_on_heap.Add() = "test string long enough to exceed inline buffer"; - } - } - { - Arena arena; - RepeatedField field_on_arena(&arena); - for (int i = 0; i < 100; i++) { - *field_on_arena.Add() = "test string long enough to exceed inline buffer"; - } - } -} - -// Align n to next multiple of 8 -uint64_t Align8(uint64_t n) { return (n + 7) & -8; } - -TEST(ArenaTest, SpaceAllocated_and_Used) { - Arena arena_1; - EXPECT_EQ(0, arena_1.SpaceAllocated()); - EXPECT_EQ(0, arena_1.SpaceUsed()); - EXPECT_EQ(0, arena_1.Reset()); - Arena::CreateArray(&arena_1, 320); - // Arena will allocate slightly more than 320 for the block headers. - EXPECT_LE(320, arena_1.SpaceAllocated()); - EXPECT_EQ(Align8(320), arena_1.SpaceUsed()); - EXPECT_LE(320, arena_1.Reset()); - - // Test with initial block. - std::vector arena_block(1024); - ArenaOptions options; - options.start_block_size = 256; - options.max_block_size = 8192; - options.initial_block = &arena_block[0]; - options.initial_block_size = arena_block.size(); - Arena arena_2(options); - EXPECT_EQ(1024, arena_2.SpaceAllocated()); - EXPECT_EQ(0, arena_2.SpaceUsed()); - EXPECT_EQ(1024, arena_2.Reset()); - Arena::CreateArray(&arena_2, 55); - EXPECT_EQ(1024, arena_2.SpaceAllocated()); - EXPECT_EQ(Align8(55), arena_2.SpaceUsed()); - EXPECT_EQ(1024, arena_2.Reset()); -} - -TEST(ArenaTest, BlockSizeDoubling) { - Arena arena; - EXPECT_EQ(0, arena.SpaceUsed()); - EXPECT_EQ(0, arena.SpaceAllocated()); - - // Allocate something to get initial block size. - Arena::CreateArray(&arena, 1); - auto first_block_size = arena.SpaceAllocated(); - - // Keep allocating until space used increases. - while (arena.SpaceAllocated() == first_block_size) { - Arena::CreateArray(&arena, 1); - } - ASSERT_GT(arena.SpaceAllocated(), first_block_size); - auto second_block_size = (arena.SpaceAllocated() - first_block_size); - - EXPECT_EQ(second_block_size, 2*first_block_size); -} - -TEST(ArenaTest, Alignment) { - Arena arena; - for (int i = 0; i < 200; i++) { - void* p = Arena::CreateArray(&arena, i); - GOOGLE_CHECK_EQ(reinterpret_cast(p) % 8, 0) << i << ": " << p; - } -} - -TEST(ArenaTest, BlockSizeSmallerThanAllocation) { - for (size_t i = 0; i <= 8; ++i) { - ArenaOptions opt; - opt.start_block_size = opt.max_block_size = i; - Arena arena(opt); - - *Arena::Create(&arena) = 42; - EXPECT_GE(arena.SpaceAllocated(), 8); - EXPECT_EQ(8, arena.SpaceUsed()); - - *Arena::Create(&arena) = 42; - EXPECT_GE(arena.SpaceAllocated(), 16); - EXPECT_EQ(16, arena.SpaceUsed()); - } -} - -TEST(ArenaTest, GetArenaShouldReturnTheArenaForArenaAllocatedMessages) { - Arena arena; - ArenaMessage* message = Arena::CreateMessage(&arena); - const ArenaMessage* const_pointer_to_message = message; - EXPECT_EQ(&arena, Arena::GetArena(message)); - EXPECT_EQ(&arena, Arena::GetArena(const_pointer_to_message)); - - // Test that the Message* / MessageLite* specialization SFINAE works. - const Message* const_pointer_to_message_type = message; - EXPECT_EQ(&arena, Arena::GetArena(const_pointer_to_message_type)); - const MessageLite* const_pointer_to_message_lite_type = message; - EXPECT_EQ(&arena, Arena::GetArena(const_pointer_to_message_lite_type)); -} - -TEST(ArenaTest, GetArenaShouldReturnNullForNonArenaAllocatedMessages) { - ArenaMessage message; - const ArenaMessage* const_pointer_to_message = &message; - EXPECT_EQ(NULL, Arena::GetArena(&message)); - EXPECT_EQ(NULL, Arena::GetArena(const_pointer_to_message)); -} - -TEST(ArenaTest, GetArenaShouldReturnNullForNonArenaCompatibleTypes) { - // Test that GetArena returns nullptr for types that have a GetArena method - // that doesn't return Arena*. - struct { - int GetArena() const { return 0; } - } has_get_arena_method_wrong_return_type; - EXPECT_EQ(nullptr, Arena::GetArena(&has_get_arena_method_wrong_return_type)); - - // Test that GetArena returns nullptr for types that have a GetArena alias. - struct { - using GetArena = Arena*; - GetArena unused; - } has_get_arena_alias; - EXPECT_EQ(nullptr, Arena::GetArena(&has_get_arena_alias)); - - // Test that GetArena returns nullptr for types that have a GetArena data - // member. - struct { - Arena GetArena; - } has_get_arena_data_member; - EXPECT_EQ(nullptr, Arena::GetArena(&has_get_arena_data_member)); -} - -TEST(ArenaTest, AddCleanup) { - Arena arena; - for (int i = 0; i < 100; i++) { - arena.Own(new int); - } -} - -namespace { -uint32_t hooks_num_init = 0; -uint32_t hooks_num_allocations = 0; -uint32_t hooks_num_reset = 0; -uint32_t hooks_num_destruct = 0; - -void ClearHookCounts() { - hooks_num_init = 0; - hooks_num_allocations = 0; - hooks_num_reset = 0; - hooks_num_destruct = 0; -} -} // namespace - -// A helper utility class that handles arena callbacks. -class ArenaOptionsTestFriend final : public internal::ArenaMetricsCollector { - public: - static internal::ArenaMetricsCollector* NewWithAllocs() { - return new ArenaOptionsTestFriend(true); - } - - static internal::ArenaMetricsCollector* NewWithoutAllocs() { - return new ArenaOptionsTestFriend(false); - } - - static void Enable(ArenaOptions* options) { - ClearHookCounts(); - options->make_metrics_collector = &ArenaOptionsTestFriend::NewWithAllocs; - } - - static void EnableWithoutAllocs(ArenaOptions* options) { - ClearHookCounts(); - options->make_metrics_collector = &ArenaOptionsTestFriend::NewWithoutAllocs; - } - - explicit ArenaOptionsTestFriend(bool record_allocs) - : ArenaMetricsCollector(record_allocs) { - ++hooks_num_init; - } - void OnDestroy(uint64_t space_allocated) override { - ++hooks_num_destruct; - delete this; - } - void OnReset(uint64_t space_allocated) override { ++hooks_num_reset; } - void OnAlloc(const std::type_info* allocated_type, - uint64_t alloc_size) override { - ++hooks_num_allocations; - } -}; - -// Test the hooks are correctly called. -TEST(ArenaTest, ArenaHooksSanity) { - ArenaOptions options; - ArenaOptionsTestFriend::Enable(&options); - - // Scope for defining the arena - { - Arena arena(options); - EXPECT_EQ(1, hooks_num_init); - EXPECT_EQ(0, hooks_num_allocations); - Arena::Create(&arena); - if (std::is_trivially_destructible::value) { - EXPECT_EQ(1, hooks_num_allocations); - } else { - EXPECT_EQ(2, hooks_num_allocations); - } - arena.Reset(); - arena.Reset(); - EXPECT_EQ(2, hooks_num_reset); - } - EXPECT_EQ(2, hooks_num_reset); - EXPECT_EQ(1, hooks_num_destruct); -} - -// Test that allocation hooks are not called when we don't need them. -TEST(ArenaTest, ArenaHooksWhenAllocationsNotNeeded) { - ArenaOptions options; - ArenaOptionsTestFriend::EnableWithoutAllocs(&options); - - Arena arena(options); - EXPECT_EQ(0, hooks_num_allocations); - Arena::Create(&arena); - EXPECT_EQ(0, hooks_num_allocations); -} - - -} // namespace protobuf -} // namespace google - -#include diff --git a/extra/protobuf/protobuf-3.19.4/src/google/protobuf/arenastring.cc b/extra/protobuf/protobuf-3.19.4/src/google/protobuf/arenastring.cc deleted file mode 100644 index 169f52729d61..000000000000 --- a/extra/protobuf/protobuf-3.19.4/src/google/protobuf/arenastring.cc +++ /dev/null @@ -1,286 +0,0 @@ -// Protocol Buffers - Google's data interchange format -// Copyright 2008 Google Inc. All rights reserved. -// https://developers.google.com/protocol-buffers/ -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// * Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// * Redistributions in binary form must reproduce the above -// copyright notice, this list of conditions and the following disclaimer -// in the documentation and/or other materials provided with the -// distribution. -// * Neither the name of Google Inc. nor the names of its -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -#include - -#include -#include -#include -#include -#include -#include -#include -#include - -// clang-format off -#include -// clang-format on - -namespace google { -namespace protobuf { -namespace internal { - -const std::string& LazyString::Init() const { - static WrappedMutex mu{GOOGLE_PROTOBUF_LINKER_INITIALIZED}; - mu.Lock(); - const std::string* res = inited_.load(std::memory_order_acquire); - if (res == nullptr) { - auto init_value = init_value_; - res = ::new (static_cast(string_buf_)) - std::string(init_value.ptr, init_value.size); - inited_.store(res, std::memory_order_release); - } - mu.Unlock(); - return *res; -} - - -std::string* ArenaStringPtr::SetAndReturnNewString() { - std::string* new_string = new std::string(); - tagged_ptr_.Set(new_string); - return new_string; -} - -void ArenaStringPtr::DestroyNoArenaSlowPath() { delete UnsafeMutablePointer(); } - -void ArenaStringPtr::Set(const std::string* default_value, - ConstStringParam value, ::google::protobuf::Arena* arena) { - if (IsDefault(default_value)) { - tagged_ptr_.Set(Arena::Create(arena, value)); - } else { - UnsafeMutablePointer()->assign(value.data(), value.length()); - } -} - -void ArenaStringPtr::Set(const std::string* default_value, std::string&& value, - ::google::protobuf::Arena* arena) { - if (IsDefault(default_value)) { - if (arena == nullptr) { - tagged_ptr_.Set(new std::string(std::move(value))); - } else { - tagged_ptr_.Set(Arena::Create(arena, std::move(value))); - } - } else if (IsDonatedString()) { - std::string* current = tagged_ptr_.Get(); - auto* s = new (current) std::string(std::move(value)); - arena->OwnDestructor(s); - tagged_ptr_.Set(s); - } else /* !IsDonatedString() */ { - *UnsafeMutablePointer() = std::move(value); - } -} - -void ArenaStringPtr::Set(EmptyDefault, ConstStringParam value, - ::google::protobuf::Arena* arena) { - Set(&GetEmptyStringAlreadyInited(), value, arena); -} - -void ArenaStringPtr::Set(EmptyDefault, std::string&& value, - ::google::protobuf::Arena* arena) { - Set(&GetEmptyStringAlreadyInited(), std::move(value), arena); -} - -void ArenaStringPtr::Set(NonEmptyDefault, ConstStringParam value, - ::google::protobuf::Arena* arena) { - Set(nullptr, value, arena); -} - -void ArenaStringPtr::Set(NonEmptyDefault, std::string&& value, - ::google::protobuf::Arena* arena) { - Set(nullptr, std::move(value), arena); -} - -std::string* ArenaStringPtr::Mutable(EmptyDefault, ::google::protobuf::Arena* arena) { - if (!IsDonatedString() && !IsDefault(&GetEmptyStringAlreadyInited())) { - return UnsafeMutablePointer(); - } else { - return MutableSlow(arena); - } -} - -std::string* ArenaStringPtr::Mutable(const LazyString& default_value, - ::google::protobuf::Arena* arena) { - if (!IsDonatedString() && !IsDefault(nullptr)) { - return UnsafeMutablePointer(); - } else { - return MutableSlow(arena, default_value); - } -} - -std::string* ArenaStringPtr::MutableNoCopy(const std::string* default_value, - ::google::protobuf::Arena* arena) { - if (!IsDonatedString() && !IsDefault(default_value)) { - return UnsafeMutablePointer(); - } else { - GOOGLE_DCHECK(IsDefault(default_value)); - // Allocate empty. The contents are not relevant. - std::string* new_string = Arena::Create(arena); - tagged_ptr_.Set(new_string); - return new_string; - } -} - -template -std::string* ArenaStringPtr::MutableSlow(::google::protobuf::Arena* arena, - const Lazy&... lazy_default) { - const std::string* const default_value = - sizeof...(Lazy) == 0 ? &GetEmptyStringAlreadyInited() : nullptr; - GOOGLE_DCHECK(IsDefault(default_value)); - std::string* new_string = - Arena::Create(arena, lazy_default.get()...); - tagged_ptr_.Set(new_string); - return new_string; -} - -std::string* ArenaStringPtr::Release(const std::string* default_value, - ::google::protobuf::Arena* arena) { - if (IsDefault(default_value)) { - return nullptr; - } else { - return ReleaseNonDefault(default_value, arena); - } -} - -std::string* ArenaStringPtr::ReleaseNonDefault(const std::string* default_value, - ::google::protobuf::Arena* arena) { - GOOGLE_DCHECK(!IsDefault(default_value)); - - if (!IsDonatedString()) { - std::string* released; - if (arena != nullptr) { - released = new std::string; - released->swap(*UnsafeMutablePointer()); - } else { - released = UnsafeMutablePointer(); - } - tagged_ptr_.Set(const_cast(default_value)); - return released; - } else /* IsDonatedString() */ { - GOOGLE_DCHECK(arena != nullptr); - std::string* released = new std::string(Get()); - tagged_ptr_.Set(const_cast(default_value)); - return released; - } -} - -void ArenaStringPtr::SetAllocated(const std::string* default_value, - std::string* value, ::google::protobuf::Arena* arena) { - // Release what we have first. - if (arena == nullptr && !IsDefault(default_value)) { - delete UnsafeMutablePointer(); - } - if (value == nullptr) { - tagged_ptr_.Set(const_cast(default_value)); - } else { -#ifdef NDEBUG - tagged_ptr_.Set(value); - if (arena != nullptr) { - arena->Own(value); - } -#else - // On debug builds, copy the string so the address differs. delete will - // fail if value was a stack-allocated temporary/etc., which would have - // failed when arena ran its cleanup list. - std::string* new_value = Arena::Create(arena, *value); - delete value; - tagged_ptr_.Set(new_value); -#endif - } -} - -void ArenaStringPtr::Destroy(const std::string* default_value, - ::google::protobuf::Arena* arena) { - if (arena == nullptr) { - GOOGLE_DCHECK(!IsDonatedString()); - if (!IsDefault(default_value)) { - delete UnsafeMutablePointer(); - } - } -} - -void ArenaStringPtr::Destroy(EmptyDefault, ::google::protobuf::Arena* arena) { - Destroy(&GetEmptyStringAlreadyInited(), arena); -} - -void ArenaStringPtr::Destroy(NonEmptyDefault, ::google::protobuf::Arena* arena) { - Destroy(nullptr, arena); -} - -void ArenaStringPtr::ClearToEmpty() { - if (IsDefault(&GetEmptyStringAlreadyInited())) { - // Already set to default -- do nothing. - } else { - // Unconditionally mask away the tag. - // - // UpdateDonatedString uses assign when capacity is larger than the new - // value, which is trivially true in the donated string case. - // const_cast(PtrValue())->clear(); - tagged_ptr_.Get()->clear(); - } -} - -void ArenaStringPtr::ClearToDefault(const LazyString& default_value, - ::google::protobuf::Arena* arena) { - (void)arena; - if (IsDefault(nullptr)) { - // Already set to default -- do nothing. - } else if (!IsDonatedString()) { - UnsafeMutablePointer()->assign(default_value.get()); - } -} - -inline void SetStrWithHeapBuffer(std::string* str, ArenaStringPtr* s) { - TaggedPtr res; - res.Set(str); - s->UnsafeSetTaggedPointer(res); -} - -const char* EpsCopyInputStream::ReadArenaString(const char* ptr, - ArenaStringPtr* s, - Arena* arena) { - GOOGLE_DCHECK(arena != nullptr); - - int size = ReadSize(&ptr); - if (!ptr) return nullptr; - - auto* str = Arena::Create(arena); - ptr = ReadString(ptr, size, str); - GOOGLE_PROTOBUF_PARSER_ASSERT(ptr); - - SetStrWithHeapBuffer(str, s); - - return ptr; -} - -} // namespace internal -} // namespace protobuf -} // namespace google - -#include diff --git a/extra/protobuf/protobuf-3.19.4/src/google/protobuf/arenastring.h b/extra/protobuf/protobuf-3.19.4/src/google/protobuf/arenastring.h deleted file mode 100644 index 38c36378cd30..000000000000 --- a/extra/protobuf/protobuf-3.19.4/src/google/protobuf/arenastring.h +++ /dev/null @@ -1,420 +0,0 @@ -// Protocol Buffers - Google's data interchange format -// Copyright 2008 Google Inc. All rights reserved. -// https://developers.google.com/protocol-buffers/ -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// * Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// * Redistributions in binary form must reproduce the above -// copyright notice, this list of conditions and the following disclaimer -// in the documentation and/or other materials provided with the -// distribution. -// * Neither the name of Google Inc. nor the names of its -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -#ifndef GOOGLE_PROTOBUF_ARENASTRING_H__ -#define GOOGLE_PROTOBUF_ARENASTRING_H__ - -#include -#include -#include - -#include -#include -#include -#include - -#include - -#ifdef SWIG -#error "You cannot SWIG proto headers" -#endif - - -namespace google { -namespace protobuf { -namespace internal { - -template -class ExplicitlyConstructed; - -class SwapFieldHelper; - -// Lazy string instance to support string fields with non-empty default. -// These are initialized on the first call to .get(). -class PROTOBUF_EXPORT LazyString { - public: - // We explicitly make LazyString an aggregate so that MSVC can do constant - // initialization on it without marking it `constexpr`. - // We do not want to use `constexpr` because it makes it harder to have extern - // storage for it and causes library bloat. - struct InitValue { - const char* ptr; - size_t size; - }; - // We keep a union of the initialization value and the std::string to save on - // space. We don't need the string array after Init() is done. - union { - mutable InitValue init_value_; - alignas(std::string) mutable char string_buf_[sizeof(std::string)]; - }; - mutable std::atomic inited_; - - const std::string& get() const { - // This check generates less code than a call-once invocation. - auto* res = inited_.load(std::memory_order_acquire); - if (PROTOBUF_PREDICT_FALSE(res == nullptr)) return Init(); - return *res; - } - - private: - // Initialize the string in `string_buf_`, update `inited_` and return it. - // We return it here to avoid having to read it again in the inlined code. - const std::string& Init() const; -}; - -template -class TaggedPtr { - public: - TaggedPtr() = default; - explicit constexpr TaggedPtr(const ExplicitlyConstructed* ptr) - : ptr_(const_cast*>(ptr)) {} - - void SetTagged(T* p) { - Set(p); - ptr_ = reinterpret_cast(as_int() | 1); - } - void Set(T* p) { ptr_ = p; } - T* Get() const { return reinterpret_cast(as_int() & -2); } - bool IsTagged() const { return as_int() & 1; } - - // Returned value is only safe to dereference if IsTagged() == false. - // It is safe to compare. - T* UnsafeGet() const { return static_cast(ptr_); } - - bool IsNull() { return ptr_ == nullptr; } - - private: - uintptr_t as_int() const { return reinterpret_cast(ptr_); } - void* ptr_; -}; - -static_assert(std::is_trivial>::value, - "TaggedPtr must be trivial"); - -// This class encapsulates a pointer to a std::string with or without a donated -// buffer, tagged by bottom bit. It is a high-level wrapper that almost directly -// corresponds to the interface required by string fields in generated -// code. It replaces the old std::string* pointer in such cases. -// -// The object has different but similar code paths for when the default value is -// the empty string and when it is a non-empty string. -// The empty string is handled different throughout the library and there is a -// single global instance of it we can share. -// -// For fields with an empty string default value, there are three distinct -// states: -// -// - Pointer set to 'String' tag (LSB is 0), equal to -// &GetEmptyStringAlreadyInited(): field is set to its default value. Points -// to a true std::string*, but we do not own that std::string* (it's a -// globally shared instance). -// -// - Pointer set to 'String' tag (LSB is 0), but not equal to the global empty -// string: field points to a true std::string* instance that we own. This -// instance is either on the heap or on the arena (i.e. registered on -// free()/destructor-call list) as appropriate. -// -// - Pointer set to 'DonatedString' tag (LSB is 1): points to a std::string -// instance with a buffer on the arena (arena is never nullptr in this case). -// -// For fields with a non-empty string default value, there are three distinct -// states: -// -// - Pointer set to 'String' tag (LSB is 0), equal to `nullptr`: -// Field is in "default" mode and does not point to any actual instance. -// Methods that might need to create an instance of the object will pass a -// `const LazyString&` for it. -// -// - Pointer set to 'String' tag (LSB is 0), but not equal to `nullptr`: -// field points to a true std::string* instance that we own. This instance is -// either on the heap or on the arena (i.e. registered on -// free()/destructor-call list) as appropriate. -// -// - Pointer set to 'DonatedString' tag (LSB is 1): points to a std::string -// instance with a buffer on the arena (arena is never nullptr in this case). -// -// Generated code and reflection code both ensure that ptr_ is never null for -// fields with an empty default. -// Because ArenaStringPtr is used in oneof unions, its constructor is a NOP and -// so the field is always manually initialized via method calls. -// -// Side-note: why pass information about the default on every API call? Because -// we don't want to hold it in a member variable, or else this would go into -// every proto message instance. This would be a huge waste of space, since the -// default instance pointer is typically a global (static class field). We want -// the generated code to be as efficient as possible, and if we take -// the default value information as a parameter that's in practice taken from a -// static class field, and compare ptr_ to the default value, we end up with a -// single "cmp %reg, GLOBAL" in the resulting machine code. (Note that this also -// requires the String tag to be 0 so we can avoid the mask before comparing.) -struct PROTOBUF_EXPORT ArenaStringPtr { - ArenaStringPtr() = default; - explicit constexpr ArenaStringPtr( - const ExplicitlyConstructed* default_value) - : tagged_ptr_(default_value) {} - - // Some methods below are overloaded on a `default_value` and on tags. - // The tagged overloads help reduce code size in the callers in generated - // code, while the `default_value` overloads are useful from reflection. - // By-value empty struct arguments are elided in the ABI. - struct EmptyDefault {}; - struct NonEmptyDefault {}; - - void Set(const std::string* default_value, ConstStringParam value, - ::google::protobuf::Arena* arena); - void Set(const std::string* default_value, std::string&& value, - ::google::protobuf::Arena* arena); - void Set(EmptyDefault, ConstStringParam value, ::google::protobuf::Arena* arena); - void Set(EmptyDefault, std::string&& value, ::google::protobuf::Arena* arena); - void Set(NonEmptyDefault, ConstStringParam value, ::google::protobuf::Arena* arena); - void Set(NonEmptyDefault, std::string&& value, ::google::protobuf::Arena* arena); - template - void Set(FirstParam p1, const char* str, ::google::protobuf::Arena* arena) { - Set(p1, ConstStringParam(str), arena); - } - template - void Set(FirstParam p1, const char* str, size_t size, - ::google::protobuf::Arena* arena) { - ConstStringParam sp{str, size}; // for string_view and `const string &` - Set(p1, sp, arena); - } - template - void Set(FirstParam p1, - std::reference_wrapper const_string_ref, - ::google::protobuf::Arena* arena) { - Set(p1, const_string_ref.get(), arena); - } - - template - void SetBytes(FirstParam p1, SecondParam&& p2, ::google::protobuf::Arena* arena) { - Set(p1, static_cast(p2), arena); - } - template - void SetBytes(FirstParam p1, const void* str, size_t size, - ::google::protobuf::Arena* arena) { - // must work whether ConstStringParam is string_view or `const string &` - ConstStringParam sp{static_cast(str), size}; - Set(p1, sp, arena); - } - - // Basic accessors. - PROTOBUF_NDEBUG_INLINE const std::string& Get() const { - // Unconditionally mask away the tag. - return *tagged_ptr_.Get(); - } - PROTOBUF_NDEBUG_INLINE const std::string* GetPointer() const { - // Unconditionally mask away the tag. - return tagged_ptr_.Get(); - } - - // For fields with an empty default value. - std::string* Mutable(EmptyDefault, ::google::protobuf::Arena* arena); - // For fields with a non-empty default value. - std::string* Mutable(const LazyString& default_value, ::google::protobuf::Arena* arena); - - // Release returns a std::string* instance that is heap-allocated and is not - // Own()'d by any arena. If the field is not set, this returns nullptr. The - // caller retains ownership. Clears this field back to nullptr state. Used to - // implement release_() methods on generated classes. - PROTOBUF_NODISCARD std::string* Release(const std::string* default_value, - ::google::protobuf::Arena* arena); - PROTOBUF_NODISCARD std::string* ReleaseNonDefault( - const std::string* default_value, ::google::protobuf::Arena* arena); - - // Takes a std::string that is heap-allocated, and takes ownership. The - // std::string's destructor is registered with the arena. Used to implement - // set_allocated_ in generated classes. - void SetAllocated(const std::string* default_value, std::string* value, - ::google::protobuf::Arena* arena); - - // Swaps internal pointers. Arena-safety semantics: this is guarded by the - // logic in Swap()/UnsafeArenaSwap() at the message level, so this method is - // 'unsafe' if called directly. - inline PROTOBUF_NDEBUG_INLINE static void InternalSwap( - const std::string* default_value, ArenaStringPtr* rhs, Arena* rhs_arena, - ArenaStringPtr* lhs, Arena* lhs_arena); - - // Frees storage (if not on an arena). - void Destroy(const std::string* default_value, ::google::protobuf::Arena* arena); - void Destroy(EmptyDefault, ::google::protobuf::Arena* arena); - void Destroy(NonEmptyDefault, ::google::protobuf::Arena* arena); - - // Clears content, but keeps allocated std::string, to avoid the overhead of - // heap operations. After this returns, the content (as seen by the user) will - // always be the empty std::string. Assumes that |default_value| is an empty - // std::string. - void ClearToEmpty(); - - // Clears content, assuming that the current value is not the empty - // string default. - void ClearNonDefaultToEmpty(); - - // Clears content, but keeps allocated std::string if arena != nullptr, to - // avoid the overhead of heap operations. After this returns, the content - // (as seen by the user) will always be equal to |default_value|. - void ClearToDefault(const LazyString& default_value, ::google::protobuf::Arena* arena); - - // Called from generated code / reflection runtime only. Resets value to point - // to a default string pointer, with the semantics that this - // ArenaStringPtr does not own the pointed-to memory. Disregards initial value - // of ptr_ (so this is the *ONLY* safe method to call after construction or - // when reinitializing after becoming the active field in a oneof union). - inline void UnsafeSetDefault(const std::string* default_value); - - // Returns a mutable pointer, but doesn't initialize the string to the - // default value. - std::string* MutableNoArenaNoDefault(const std::string* default_value); - - // Get a mutable pointer with unspecified contents. - // Similar to `MutableNoArenaNoDefault`, but also handles the arena case. - // If the value was donated, the contents are discarded. - std::string* MutableNoCopy(const std::string* default_value, - ::google::protobuf::Arena* arena); - - // Destroy the string. Assumes `arena == nullptr`. - void DestroyNoArena(const std::string* default_value); - - // Internal setter used only at parse time to directly set a donated string - // value. - void UnsafeSetTaggedPointer(TaggedPtr value) { - tagged_ptr_ = value; - } - // Generated code only! An optimization, in certain cases the generated - // code is certain we can obtain a std::string with no default checks and - // tag tests. - std::string* UnsafeMutablePointer() PROTOBUF_RETURNS_NONNULL; - - inline bool IsDefault(const std::string* default_value) const { - // Relies on the fact that kPtrTagString == 0, so if IsString(), ptr_ is the - // actual std::string pointer (and if !IsString(), ptr_ will never be equal - // to any aligned |default_value| pointer). The key is that we want to avoid - // masking in the fastpath const-pointer Get() case for non-arena code. - return tagged_ptr_.UnsafeGet() == default_value; - } - - private: - TaggedPtr tagged_ptr_; - - bool IsDonatedString() const { return false; } - - // Swaps tagged pointer without debug hardening. This is to allow python - // protobuf to maintain pointer stability even in DEBUG builds. - inline PROTOBUF_NDEBUG_INLINE static void UnsafeShallowSwap( - ArenaStringPtr* rhs, ArenaStringPtr* lhs) { - std::swap(lhs->tagged_ptr_, rhs->tagged_ptr_); - } - - friend class ::google::protobuf::internal::SwapFieldHelper; - - // Slow paths. - - // MutableSlow requires that !IsString() || IsDefault - // Variadic to support 0 args for EmptyDefault and 1 arg for LazyString. - template - std::string* MutableSlow(::google::protobuf::Arena* arena, const Lazy&... lazy_default); - - // Sets value to a newly allocated string and returns it - std::string* SetAndReturnNewString(); - - // Destroys the non-default string value out-of-line - void DestroyNoArenaSlowPath(); - -}; - -inline void ArenaStringPtr::UnsafeSetDefault(const std::string* value) { - tagged_ptr_.Set(const_cast(value)); -} - -// Make sure rhs_arena allocated rhs, and lhs_arena allocated lhs. -inline PROTOBUF_NDEBUG_INLINE void ArenaStringPtr::InternalSwap( // - const std::string* default_value, // - ArenaStringPtr* rhs, Arena* rhs_arena, // - ArenaStringPtr* lhs, Arena* lhs_arena) { - // Silence unused variable warnings in release buildls. - (void)default_value; - (void)rhs_arena; - (void)lhs_arena; - std::swap(lhs->tagged_ptr_, rhs->tagged_ptr_); -#ifdef PROTOBUF_FORCE_COPY_IN_SWAP - auto force_realloc = [default_value](ArenaStringPtr* p, Arena* arena) { - if (p->IsDefault(default_value)) return; - std::string* old_value = p->tagged_ptr_.Get(); - std::string* new_value = - p->IsDonatedString() - ? Arena::Create(arena, *old_value) - : Arena::Create(arena, std::move(*old_value)); - if (arena == nullptr) delete old_value; - p->tagged_ptr_.Set(new_value); - }; - // Because, at this point, tagged_ptr_ has been swapped, arena should also be - // swapped. - force_realloc(lhs, rhs_arena); - force_realloc(rhs, lhs_arena); -#endif // PROTOBUF_FORCE_COPY_IN_SWAP -} - -inline void ArenaStringPtr::ClearNonDefaultToEmpty() { - // Unconditionally mask away the tag. - tagged_ptr_.Get()->clear(); -} - -inline std::string* ArenaStringPtr::MutableNoArenaNoDefault( - const std::string* default_value) { - // VERY IMPORTANT for performance and code size: this will reduce to a member - // variable load, a pointer check (against |default_value|, in practice a - // static global) and a branch to the slowpath (which calls operator new and - // the ctor). DO NOT add any tagged-pointer operations here. - if (IsDefault(default_value)) { - return SetAndReturnNewString(); - } else { - return UnsafeMutablePointer(); - } -} - -inline void ArenaStringPtr::DestroyNoArena(const std::string* default_value) { - if (!IsDefault(default_value)) { - DestroyNoArenaSlowPath(); - } -} - -inline std::string* ArenaStringPtr::UnsafeMutablePointer() { - GOOGLE_DCHECK(!tagged_ptr_.IsTagged()); - GOOGLE_DCHECK(tagged_ptr_.UnsafeGet() != nullptr); - return tagged_ptr_.UnsafeGet(); -} - - -} // namespace internal -} // namespace protobuf -} // namespace google - -#include - -#endif // GOOGLE_PROTOBUF_ARENASTRING_H__ diff --git a/extra/protobuf/protobuf-3.19.4/src/google/protobuf/arenastring_unittest.cc b/extra/protobuf/protobuf-3.19.4/src/google/protobuf/arenastring_unittest.cc deleted file mode 100644 index db988afb54df..000000000000 --- a/extra/protobuf/protobuf-3.19.4/src/google/protobuf/arenastring_unittest.cc +++ /dev/null @@ -1,157 +0,0 @@ -// Protocol Buffers - Google's data interchange format -// Copyright 2008 Google Inc. All rights reserved. -// https://developers.google.com/protocol-buffers/ -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// * Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// * Redistributions in binary form must reproduce the above -// copyright notice, this list of conditions and the following disclaimer -// in the documentation and/or other materials provided with the -// distribution. -// * Neither the name of Google Inc. nor the names of its -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -#include - -#include -#include -#include -#include -#include - -#include -#include -#include -#include -#include -#include -#include -#include - - -// Must be included last. -#include - -namespace google { -namespace protobuf { - -using internal::ArenaStringPtr; - -using EmptyDefault = ArenaStringPtr::EmptyDefault; - -const internal::LazyString nonempty_default{{{"default", 7}}, {nullptr}}; -const std::string* empty_default = &internal::GetEmptyString(); - -class SingleArena : public testing::TestWithParam { - public: - std::unique_ptr GetArena() { - if (this->GetParam()) return nullptr; - return std::unique_ptr(new Arena()); - } -}; - -INSTANTIATE_TEST_SUITE_P(ArenaString, SingleArena, testing::Bool()); - -TEST_P(SingleArena, GetSet) { - auto arena = GetArena(); - ArenaStringPtr field; - field.UnsafeSetDefault(empty_default); - EXPECT_EQ("", field.Get()); - field.Set(empty_default, "Test short", arena.get()); - EXPECT_EQ("Test short", field.Get()); - field.Set(empty_default, "Test long long long long value", arena.get()); - EXPECT_EQ("Test long long long long value", field.Get()); - field.Set(empty_default, "", arena.get()); - field.Destroy(empty_default, arena.get()); -} - -TEST_P(SingleArena, MutableAccessor) { - auto arena = GetArena(); - ArenaStringPtr field; - const std::string* empty_default = &internal::GetEmptyString(); - field.UnsafeSetDefault(empty_default); - - std::string* mut = field.Mutable(EmptyDefault{}, arena.get()); - EXPECT_EQ(mut, field.Mutable(EmptyDefault{}, arena.get())); - EXPECT_EQ(mut, &field.Get()); - EXPECT_NE(empty_default, mut); - EXPECT_EQ("", *mut); - *mut = "Test long long long long value"; // ensure string allocates storage - EXPECT_EQ("Test long long long long value", field.Get()); - field.Destroy(empty_default, arena.get()); -} - -TEST_P(SingleArena, NullDefault) { - auto arena = GetArena(); - - ArenaStringPtr field; - field.UnsafeSetDefault(nullptr); - std::string* mut = field.Mutable(nonempty_default, arena.get()); - EXPECT_EQ(mut, field.Mutable(nonempty_default, arena.get())); - EXPECT_EQ(mut, &field.Get()); - EXPECT_NE(nullptr, mut); - EXPECT_EQ("default", *mut); - *mut = "Test long long long long value"; // ensure string allocates storage - EXPECT_EQ("Test long long long long value", field.Get()); - field.Destroy(nullptr, arena.get()); -} - -class DualArena : public testing::TestWithParam> { - public: - std::unique_ptr GetLhsArena() { - if (std::get<0>(this->GetParam())) return nullptr; - return std::unique_ptr(new Arena()); - } - std::unique_ptr GetRhsArena() { - if (std::get<1>(this->GetParam())) return nullptr; - return std::unique_ptr(new Arena()); - } -}; - -INSTANTIATE_TEST_SUITE_P(ArenaString, DualArena, - testing::Combine(testing::Bool(), testing::Bool())); - -TEST_P(DualArena, Swap) { - auto lhs_arena = GetLhsArena(); - ArenaStringPtr lhs; - lhs.UnsafeSetDefault(empty_default); - ArenaStringPtr rhs; - rhs.UnsafeSetDefault(empty_default); - - { - auto rhs_arena = GetRhsArena(); - lhs.Set(empty_default, "lhs value that has some heft", lhs_arena.get()); - rhs.Set(empty_default, "rhs value that has some heft", rhs_arena.get()); - ArenaStringPtr::InternalSwap(empty_default, // - &lhs, lhs_arena.get(), // - &rhs, rhs_arena.get()); - EXPECT_EQ("rhs value that has some heft", lhs.Get()); - EXPECT_EQ("lhs value that has some heft", rhs.Get()); - lhs.Destroy(empty_default, rhs_arena.get()); - } - EXPECT_EQ("lhs value that has some heft", rhs.Get()); - rhs.Destroy(empty_default, lhs_arena.get()); -} - - -} // namespace protobuf -} // namespace google - -#include diff --git a/extra/protobuf/protobuf-3.19.4/src/google/protobuf/compiler/annotation_test_util.cc b/extra/protobuf/protobuf-3.19.4/src/google/protobuf/compiler/annotation_test_util.cc deleted file mode 100644 index 3c47aa42dbfd..000000000000 --- a/extra/protobuf/protobuf-3.19.4/src/google/protobuf/compiler/annotation_test_util.cc +++ /dev/null @@ -1,168 +0,0 @@ -// Protocol Buffers - Google's data interchange format -// Copyright 2008 Google Inc. All rights reserved. -// https://developers.google.com/protocol-buffers/ -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// * Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// * Redistributions in binary form must reproduce the above -// copyright notice, this list of conditions and the following disclaimer -// in the documentation and/or other materials provided with the -// distribution. -// * Neither the name of Google Inc. nor the names of its -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -#include - -#include -#include - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -namespace google { -namespace protobuf { -namespace compiler { -namespace annotation_test_util { -namespace { - -// A CodeGenerator that captures the FileDescriptor it's passed as a -// FileDescriptorProto. -class DescriptorCapturingGenerator : public CodeGenerator { - public: - // Does not own file; file must outlive the Generator. - explicit DescriptorCapturingGenerator(FileDescriptorProto* file) - : file_(file) {} - - virtual bool Generate(const FileDescriptor* file, - const std::string& parameter, GeneratorContext* context, - std::string* error) const { - file->CopyTo(file_); - return true; - } - - private: - FileDescriptorProto* file_; -}; -} // namespace - -void AddFile(const std::string& filename, const std::string& data) { - GOOGLE_CHECK_OK(File::SetContents(TestTempDir() + "/" + filename, data, - true)); -} - -bool RunProtoCompiler(const std::string& filename, - const std::string& plugin_specific_args, - CommandLineInterface* cli, FileDescriptorProto* file) { - cli->SetInputsAreProtoPathRelative(true); - - DescriptorCapturingGenerator capturing_generator(file); - cli->RegisterGenerator("--capture_out", &capturing_generator, ""); - - std::string proto_path = "-I" + TestTempDir(); - std::string capture_out = "--capture_out=" + TestTempDir(); - - const char* argv[] = {"protoc", proto_path.c_str(), - plugin_specific_args.c_str(), capture_out.c_str(), - filename.c_str()}; - - return cli->Run(5, argv) == 0; -} - -bool DecodeMetadata(const std::string& path, GeneratedCodeInfo* info) { - std::string data; - GOOGLE_CHECK_OK(File::GetContents(path, &data, true)); - io::ArrayInputStream input(data.data(), data.size()); - return info->ParseFromZeroCopyStream(&input); -} - -void FindAnnotationsOnPath( - const GeneratedCodeInfo& info, const std::string& source_file, - const std::vector& path, - std::vector* annotations) { - for (int i = 0; i < info.annotation_size(); ++i) { - const GeneratedCodeInfo::Annotation* annotation = &info.annotation(i); - if (annotation->source_file() != source_file || - annotation->path_size() != path.size()) { - continue; - } - int node = 0; - for (; node < path.size(); ++node) { - if (annotation->path(node) != path[node]) { - break; - } - } - if (node == path.size()) { - annotations->push_back(annotation); - } - } -} - -const GeneratedCodeInfo::Annotation* FindAnnotationOnPath( - const GeneratedCodeInfo& info, const std::string& source_file, - const std::vector& path) { - std::vector annotations; - FindAnnotationsOnPath(info, source_file, path, &annotations); - if (annotations.empty()) { - return NULL; - } - return annotations[0]; -} - -bool AtLeastOneAnnotationMatchesSubstring( - const std::string& file_content, - const std::vector& annotations, - const std::string& expected_text) { - for (std::vector::const_iterator - i = annotations.begin(), - e = annotations.end(); - i != e; ++i) { - const GeneratedCodeInfo::Annotation* annotation = *i; - uint32_t begin = annotation->begin(); - uint32_t end = annotation->end(); - if (end < begin || end > file_content.size()) { - return false; - } - if (file_content.substr(begin, end - begin) == expected_text) { - return true; - } - } - return false; -} - -bool AnnotationMatchesSubstring(const std::string& file_content, - const GeneratedCodeInfo::Annotation* annotation, - const std::string& expected_text) { - std::vector annotations; - annotations.push_back(annotation); - return AtLeastOneAnnotationMatchesSubstring(file_content, annotations, - expected_text); -} -} // namespace annotation_test_util -} // namespace compiler -} // namespace protobuf -} // namespace google diff --git a/extra/protobuf/protobuf-3.19.4/src/google/protobuf/compiler/annotation_test_util.h b/extra/protobuf/protobuf-3.19.4/src/google/protobuf/compiler/annotation_test_util.h deleted file mode 100644 index 551f2244c5db..000000000000 --- a/extra/protobuf/protobuf-3.19.4/src/google/protobuf/compiler/annotation_test_util.h +++ /dev/null @@ -1,115 +0,0 @@ -// Protocol Buffers - Google's data interchange format -// Copyright 2008 Google Inc. All rights reserved. -// https://developers.google.com/protocol-buffers/ -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// * Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// * Redistributions in binary form must reproduce the above -// copyright notice, this list of conditions and the following disclaimer -// in the documentation and/or other materials provided with the -// distribution. -// * Neither the name of Google Inc. nor the names of its -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -#ifndef GOOGLE_PROTOBUF_COMPILER_ANNOTATION_TEST_UTIL_H__ -#define GOOGLE_PROTOBUF_COMPILER_ANNOTATION_TEST_UTIL_H__ - -#include -#include -#include - -// Utilities that assist in writing tests for generator annotations. -// See java/internal/annotation_unittest.cc for an example. -namespace google { -namespace protobuf { -namespace compiler { -namespace annotation_test_util { - -// Struct that contains the file generated from a .proto file and its -// GeneratedCodeInfo. For example, the Java generator will fill this struct -// (for some 'foo.proto') with: -// file_path = "Foo.java" -// file_content = content of Foo.java -// file_info = parsed content of Foo.java.pb.meta -struct ExpectedOutput { - std::string file_path; - std::string file_content; - GeneratedCodeInfo file_info; - explicit ExpectedOutput(const std::string& file_path) - : file_path(file_path) {} -}; - -// Creates a file with name `filename` and content `data` in temp test -// directory. -void AddFile(const std::string& filename, const std::string& data); - -// Runs proto compiler. Captures proto file structure in FileDescriptorProto. -// Files will be generated in TestTempDir() folder. Callers of this -// function must read generated files themselves. -// -// filename: source .proto file used to generate code. -// plugin_specific_args: command line arguments specific to current generator. -// For Java, this value might be "--java_out=annotate_code:test_temp_dir" -// cli: instance of command line interface to run generator. See Java's -// annotation_unittest.cc for an example of how to initialize it. -// file: output parameter, will be set to the descriptor of the proto file -// specified in filename. -bool RunProtoCompiler(const std::string& filename, - const std::string& plugin_specific_args, - CommandLineInterface* cli, FileDescriptorProto* file); - -bool DecodeMetadata(const std::string& path, GeneratedCodeInfo* info); - -// Finds all of the Annotations for a given source file and path. -// See Location.path in https://github.com/protocolbuffers/protobuf/blob/master/src/google/protobuf/descriptor.proto for -// explanation of what path vector is. -void FindAnnotationsOnPath( - const GeneratedCodeInfo& info, const std::string& source_file, - const std::vector& path, - std::vector* annotations); - -// Finds the Annotation for a given source file and path (or returns null if it -// couldn't). If there are several annotations for given path, returns the first -// one. See Location.path in -// https://github.com/protocolbuffers/protobuf/blob/master/src/google/protobuf/descriptor.proto for explanation of what path -// vector is. -const GeneratedCodeInfo::Annotation* FindAnnotationOnPath( - const GeneratedCodeInfo& info, const std::string& source_file, - const std::vector& path); - -// Returns true if at least one of the provided annotations covers a given -// substring in file_content. -bool AtLeastOneAnnotationMatchesSubstring( - const std::string& file_content, - const std::vector& annotations, - const std::string& expected_text); - -// Returns true if the provided annotation covers a given substring in -// file_content. -bool AnnotationMatchesSubstring(const std::string& file_content, - const GeneratedCodeInfo::Annotation* annotation, - const std::string& expected_text); - -} // namespace annotation_test_util -} // namespace compiler -} // namespace protobuf -} // namespace google - -#endif // GOOGLE_PROTOBUF_COMPILER_ANNOTATION_TEST_UTIL_H__ diff --git a/extra/protobuf/protobuf-3.19.4/src/google/protobuf/compiler/code_generator.cc b/extra/protobuf/protobuf-3.19.4/src/google/protobuf/compiler/code_generator.cc deleted file mode 100644 index 4544f3e71057..000000000000 --- a/extra/protobuf/protobuf-3.19.4/src/google/protobuf/compiler/code_generator.cc +++ /dev/null @@ -1,137 +0,0 @@ -// Protocol Buffers - Google's data interchange format -// Copyright 2008 Google Inc. All rights reserved. -// https://developers.google.com/protocol-buffers/ -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// * Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// * Redistributions in binary form must reproduce the above -// copyright notice, this list of conditions and the following disclaimer -// in the documentation and/or other materials provided with the -// distribution. -// * Neither the name of Google Inc. nor the names of its -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -// Author: kenton@google.com (Kenton Varda) -// Based on original Protocol Buffers design by -// Sanjay Ghemawat, Jeff Dean, and others. - -#include - -#include -#include -#include -#include -#include - -namespace google { -namespace protobuf { -namespace compiler { - -CodeGenerator::~CodeGenerator() {} - -bool CodeGenerator::GenerateAll(const std::vector& files, - const std::string& parameter, - GeneratorContext* generator_context, - std::string* error) const { - // Default implementation is just to call the per file method, and prefix any - // error string with the file to provide context. - bool succeeded = true; - for (int i = 0; i < files.size(); i++) { - const FileDescriptor* file = files[i]; - succeeded = Generate(file, parameter, generator_context, error); - if (!succeeded && error && error->empty()) { - *error = - "Code generator returned false but provided no error " - "description."; - } - if (error && !error->empty()) { - *error = file->name() + ": " + *error; - break; - } - if (!succeeded) { - break; - } - } - return succeeded; -} - -GeneratorContext::~GeneratorContext() {} - -io::ZeroCopyOutputStream* GeneratorContext::OpenForAppend( - const std::string& filename) { - return NULL; -} - -io::ZeroCopyOutputStream* GeneratorContext::OpenForInsert( - const std::string& filename, const std::string& insertion_point) { - GOOGLE_LOG(FATAL) << "This GeneratorContext does not support insertion."; - return NULL; // make compiler happy -} - -io::ZeroCopyOutputStream* GeneratorContext::OpenForInsertWithGeneratedCodeInfo( - const std::string& filename, const std::string& insertion_point, - const google::protobuf::GeneratedCodeInfo& /*info*/) { - return OpenForInsert(filename, insertion_point); -} - -void GeneratorContext::ListParsedFiles( - std::vector* output) { - GOOGLE_LOG(FATAL) << "This GeneratorContext does not support ListParsedFiles"; -} - -void GeneratorContext::GetCompilerVersion(Version* version) const { - version->set_major(GOOGLE_PROTOBUF_VERSION / 1000000); - version->set_minor(GOOGLE_PROTOBUF_VERSION / 1000 % 1000); - version->set_patch(GOOGLE_PROTOBUF_VERSION % 1000); - version->set_suffix(GOOGLE_PROTOBUF_VERSION_SUFFIX); -} - -// Parses a set of comma-delimited name/value pairs. -void ParseGeneratorParameter( - const std::string& text, - std::vector >* output) { - std::vector parts = Split(text, ",", true); - - for (int i = 0; i < parts.size(); i++) { - std::string::size_type equals_pos = parts[i].find_first_of('='); - std::pair value; - if (equals_pos == std::string::npos) { - value.first = parts[i]; - value.second = ""; - } else { - value.first = parts[i].substr(0, equals_pos); - value.second = parts[i].substr(equals_pos + 1); - } - output->push_back(value); - } -} - -// Strips ".proto" or ".protodevel" from the end of a filename. -std::string StripProto(const std::string& filename) { - if (HasSuffixString(filename, ".protodevel")) { - return StripSuffixString(filename, ".protodevel"); - } else { - return StripSuffixString(filename, ".proto"); - } -} - -} // namespace compiler -} // namespace protobuf -} // namespace google diff --git a/extra/protobuf/protobuf-3.19.4/src/google/protobuf/compiler/code_generator.h b/extra/protobuf/protobuf-3.19.4/src/google/protobuf/compiler/code_generator.h deleted file mode 100644 index 2cbda270b491..000000000000 --- a/extra/protobuf/protobuf-3.19.4/src/google/protobuf/compiler/code_generator.h +++ /dev/null @@ -1,206 +0,0 @@ -// Protocol Buffers - Google's data interchange format -// Copyright 2008 Google Inc. All rights reserved. -// https://developers.google.com/protocol-buffers/ -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// * Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// * Redistributions in binary form must reproduce the above -// copyright notice, this list of conditions and the following disclaimer -// in the documentation and/or other materials provided with the -// distribution. -// * Neither the name of Google Inc. nor the names of its -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -// Author: kenton@google.com (Kenton Varda) -// Based on original Protocol Buffers design by -// Sanjay Ghemawat, Jeff Dean, and others. -// -// Defines the abstract interface implemented by each of the language-specific -// code generators. - -#ifndef GOOGLE_PROTOBUF_COMPILER_CODE_GENERATOR_H__ -#define GOOGLE_PROTOBUF_COMPILER_CODE_GENERATOR_H__ - -#include -#include -#include -#include - -#include - -namespace google { -namespace protobuf { - -namespace io { -class ZeroCopyOutputStream; -} -class FileDescriptor; -class GeneratedCodeInfo; - -namespace compiler { -class AccessInfoMap; - -class Version; - -// Defined in this file. -class CodeGenerator; -class GeneratorContext; - -// The abstract interface to a class which generates code implementing a -// particular proto file in a particular language. A number of these may -// be registered with CommandLineInterface to support various languages. -class PROTOC_EXPORT CodeGenerator { - public: - inline CodeGenerator() {} - virtual ~CodeGenerator(); - - // Generates code for the given proto file, generating one or more files in - // the given output directory. - // - // A parameter to be passed to the generator can be specified on the command - // line. This is intended to be used to pass generator specific parameters. - // It is empty if no parameter was given. ParseGeneratorParameter (below), - // can be used to accept multiple parameters within the single parameter - // command line flag. - // - // Returns true if successful. Otherwise, sets *error to a description of - // the problem (e.g. "invalid parameter") and returns false. - virtual bool Generate(const FileDescriptor* file, - const std::string& parameter, - GeneratorContext* generator_context, - std::string* error) const = 0; - - // Generates code for all given proto files. - // - // WARNING: The canonical code generator design produces one or two output - // files per input .proto file, and we do not wish to encourage alternate - // designs. - // - // A parameter is given as passed on the command line, as in |Generate()| - // above. - // - // Returns true if successful. Otherwise, sets *error to a description of - // the problem (e.g. "invalid parameter") and returns false. - virtual bool GenerateAll(const std::vector& files, - const std::string& parameter, - GeneratorContext* generator_context, - std::string* error) const; - - // This must be kept in sync with plugin.proto. See that file for - // documentation on each value. - enum Feature { - FEATURE_PROTO3_OPTIONAL = 1, - }; - - // Implement this to indicate what features this code generator supports. - // - // This must be a bitwise OR of values from the Feature enum above (or zero). - virtual uint64_t GetSupportedFeatures() const { return 0; } - - // This is no longer used, but this class is part of the opensource protobuf - // library, so it has to remain to keep vtables the same for the current - // version of the library. When protobufs does a api breaking change, the - // method can be removed. - virtual bool HasGenerateAll() const { return true; } - - private: - GOOGLE_DISALLOW_EVIL_CONSTRUCTORS(CodeGenerator); -}; - -// CodeGenerators generate one or more files in a given directory. This -// abstract interface represents the directory to which the CodeGenerator is -// to write and other information about the context in which the Generator -// runs. -class PROTOC_EXPORT GeneratorContext { - public: - inline GeneratorContext() { - } - virtual ~GeneratorContext(); - - // Opens the given file, truncating it if it exists, and returns a - // ZeroCopyOutputStream that writes to the file. The caller takes ownership - // of the returned object. This method never fails (a dummy stream will be - // returned instead). - // - // The filename given should be relative to the root of the source tree. - // E.g. the C++ generator, when generating code for "foo/bar.proto", will - // generate the files "foo/bar.pb.h" and "foo/bar.pb.cc"; note that - // "foo/" is included in these filenames. The filename is not allowed to - // contain "." or ".." components. - virtual io::ZeroCopyOutputStream* Open(const std::string& filename) = 0; - - // Similar to Open() but the output will be appended to the file if exists - virtual io::ZeroCopyOutputStream* OpenForAppend(const std::string& filename); - - // Creates a ZeroCopyOutputStream which will insert code into the given file - // at the given insertion point. See plugin.proto (plugin.pb.h) for more - // information on insertion points. The default implementation - // assert-fails -- it exists only for backwards-compatibility. - // - // WARNING: This feature is currently EXPERIMENTAL and is subject to change. - virtual io::ZeroCopyOutputStream* OpenForInsert( - const std::string& filename, const std::string& insertion_point); - - // Similar to OpenForInsert, but if `info` is non-empty, will open (or create) - // filename.pb.meta and insert info at the appropriate place with the - // necessary shifts. The default implementation ignores `info`. - // - // WARNING: This feature will be REMOVED in the near future. - virtual io::ZeroCopyOutputStream* OpenForInsertWithGeneratedCodeInfo( - const std::string& filename, const std::string& insertion_point, - const google::protobuf::GeneratedCodeInfo& info); - - // Returns a vector of FileDescriptors for all the files being compiled - // in this run. Useful for languages, such as Go, that treat files - // differently when compiled as a set rather than individually. - virtual void ListParsedFiles(std::vector* output); - - // Retrieves the version number of the protocol compiler associated with - // this GeneratorContext. - virtual void GetCompilerVersion(Version* version) const; - - - private: - GOOGLE_DISALLOW_EVIL_CONSTRUCTORS(GeneratorContext); -}; - -// The type GeneratorContext was once called OutputDirectory. This typedef -// provides backward compatibility. -typedef GeneratorContext OutputDirectory; - -// Several code generators treat the parameter argument as holding a -// list of options separated by commas. This helper function parses -// a set of comma-delimited name/value pairs: e.g., -// "foo=bar,baz,qux=corge" -// parses to the pairs: -// ("foo", "bar"), ("baz", ""), ("qux", "corge") -PROTOC_EXPORT void ParseGeneratorParameter( - const std::string&, std::vector >*); - -// Strips ".proto" or ".protodevel" from the end of a filename. -PROTOC_EXPORT std::string StripProto(const std::string& filename); - -} // namespace compiler -} // namespace protobuf -} // namespace google - -#include - -#endif // GOOGLE_PROTOBUF_COMPILER_CODE_GENERATOR_H__ diff --git a/extra/protobuf/protobuf-3.19.4/src/google/protobuf/compiler/command_line_interface.cc b/extra/protobuf/protobuf-3.19.4/src/google/protobuf/compiler/command_line_interface.cc deleted file mode 100644 index bfc6b0552de0..000000000000 --- a/extra/protobuf/protobuf-3.19.4/src/google/protobuf/compiler/command_line_interface.cc +++ /dev/null @@ -1,2616 +0,0 @@ -// Protocol Buffers - Google's data interchange format -// Copyright 2008 Google Inc. All rights reserved. -// https://developers.google.com/protocol-buffers/ -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// * Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// * Redistributions in binary form must reproduce the above -// copyright notice, this list of conditions and the following disclaimer -// in the documentation and/or other materials provided with the -// distribution. -// * Neither the name of Google Inc. nor the names of its -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -// Author: kenton@google.com (Kenton Varda) -// Based on original Protocol Buffers design by -// Sanjay Ghemawat, Jeff Dean, and others. - -#include - -#include - -#include - -#include -#include -#ifdef major -#undef major -#endif -#ifdef minor -#undef minor -#endif -#include -#include -#ifndef _MSC_VER -#include -#endif -#include -#include -#include -#include - -#include //For PATH_MAX - -#include - -#if defined(__APPLE__) -#include -#elif defined(__FreeBSD__) -#include -#endif - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - - -#include - -namespace google { -namespace protobuf { -namespace compiler { - -#ifndef O_BINARY -#ifdef _O_BINARY -#define O_BINARY _O_BINARY -#else -#define O_BINARY 0 // If this isn't defined, the platform doesn't need it. -#endif -#endif - -namespace { -#if defined(_WIN32) -// DO NOT include , instead create functions in io_win32.{h,cc} and import -// them like we do below. -using google::protobuf::io::win32::access; -using google::protobuf::io::win32::close; -using google::protobuf::io::win32::mkdir; -using google::protobuf::io::win32::open; -using google::protobuf::io::win32::setmode; -using google::protobuf::io::win32::write; -#endif - -static const char* kDefaultDirectDependenciesViolationMsg = - "File is imported but not declared in --direct_dependencies: %s"; - -// Returns true if the text looks like a Windows-style absolute path, starting -// with a drive letter. Example: "C:\foo". TODO(kenton): Share this with -// copy in importer.cc? -static bool IsWindowsAbsolutePath(const std::string& text) { -#if defined(_WIN32) || defined(__CYGWIN__) - return text.size() >= 3 && text[1] == ':' && isalpha(text[0]) && - (text[2] == '/' || text[2] == '\\') && text.find_last_of(':') == 1; -#else - return false; -#endif -} - -void SetFdToTextMode(int fd) { -#ifdef _WIN32 - if (setmode(fd, _O_TEXT) == -1) { - // This should never happen, I think. - GOOGLE_LOG(WARNING) << "setmode(" << fd << ", _O_TEXT): " << strerror(errno); - } -#endif - // (Text and binary are the same on non-Windows platforms.) -} - -void SetFdToBinaryMode(int fd) { -#ifdef _WIN32 - if (setmode(fd, _O_BINARY) == -1) { - // This should never happen, I think. - GOOGLE_LOG(WARNING) << "setmode(" << fd << ", _O_BINARY): " << strerror(errno); - } -#endif - // (Text and binary are the same on non-Windows platforms.) -} - -void AddTrailingSlash(std::string* path) { - if (!path->empty() && path->at(path->size() - 1) != '/') { - path->push_back('/'); - } -} - -bool VerifyDirectoryExists(const std::string& path) { - if (path.empty()) return true; - - if (access(path.c_str(), F_OK) == -1) { - std::cerr << path << ": " << strerror(errno) << std::endl; - return false; - } else { - return true; - } -} - -// Try to create the parent directory of the given file, creating the parent's -// parent if necessary, and so on. The full file name is actually -// (prefix + filename), but we assume |prefix| already exists and only create -// directories listed in |filename|. -bool TryCreateParentDirectory(const std::string& prefix, - const std::string& filename) { - // Recursively create parent directories to the output file. - // On Windows, both '/' and '\' are valid path separators. - std::vector parts = - Split(filename, "/\\", true); - std::string path_so_far = prefix; - for (int i = 0; i < parts.size() - 1; i++) { - path_so_far += parts[i]; - if (mkdir(path_so_far.c_str(), 0777) != 0) { - if (errno != EEXIST) { - std::cerr << filename << ": while trying to create directory " - << path_so_far << ": " << strerror(errno) << std::endl; - return false; - } - } - path_so_far += '/'; - } - - return true; -} - -// Get the absolute path of this protoc binary. -bool GetProtocAbsolutePath(std::string* path) { -#ifdef _WIN32 - char buffer[MAX_PATH]; - int len = GetModuleFileNameA(NULL, buffer, MAX_PATH); -#elif defined(__APPLE__) - char buffer[PATH_MAX]; - int len = 0; - - char dirtybuffer[PATH_MAX]; - uint32_t size = sizeof(dirtybuffer); - if (_NSGetExecutablePath(dirtybuffer, &size) == 0) { - realpath(dirtybuffer, buffer); - len = strlen(buffer); - } -#elif defined(__FreeBSD__) - char buffer[PATH_MAX]; - size_t len = PATH_MAX; - int mib[4] = {CTL_KERN, KERN_PROC, KERN_PROC_PATHNAME, -1}; - if (sysctl(mib, 4, &buffer, &len, NULL, 0) != 0) { - len = 0; - } -#else - char buffer[PATH_MAX]; - int len = readlink("/proc/self/exe", buffer, PATH_MAX); -#endif - if (len > 0) { - path->assign(buffer, len); - return true; - } else { - return false; - } -} - -// Whether a path is where google/protobuf/descriptor.proto and other well-known -// type protos are installed. -bool IsInstalledProtoPath(const std::string& path) { - // Checking the descriptor.proto file should be good enough. - std::string file_path = path + "/google/protobuf/descriptor.proto"; - return access(file_path.c_str(), F_OK) != -1; -} - -// Add the paths where google/protobuf/descriptor.proto and other well-known -// type protos are installed. -void AddDefaultProtoPaths( - std::vector>* paths) { - // TODO(xiaofeng): The code currently only checks relative paths of where - // the protoc binary is installed. We probably should make it handle more - // cases than that. - std::string path; - if (!GetProtocAbsolutePath(&path)) { - return; - } - // Strip the binary name. - size_t pos = path.find_last_of("/\\"); - if (pos == std::string::npos || pos == 0) { - return; - } - path = path.substr(0, pos); - // Check the binary's directory. - if (IsInstalledProtoPath(path)) { - paths->push_back(std::pair("", path)); - return; - } - // Check if there is an include subdirectory. - if (IsInstalledProtoPath(path + "/include")) { - paths->push_back( - std::pair("", path + "/include")); - return; - } - // Check if the upper level directory has an "include" subdirectory. - pos = path.find_last_of("/\\"); - if (pos == std::string::npos || pos == 0) { - return; - } - path = path.substr(0, pos); - if (IsInstalledProtoPath(path + "/include")) { - paths->push_back( - std::pair("", path + "/include")); - return; - } -} - -std::string PluginName(const std::string& plugin_prefix, - const std::string& directive) { - // Assuming the directive starts with "--" and ends with "_out" or "_opt", - // strip the "--" and "_out/_opt" and add the plugin prefix. - return plugin_prefix + "gen-" + directive.substr(2, directive.size() - 6); -} - -} // namespace - -// A MultiFileErrorCollector that prints errors to stderr. -class CommandLineInterface::ErrorPrinter - : public MultiFileErrorCollector, - public io::ErrorCollector, - public DescriptorPool::ErrorCollector { - public: - ErrorPrinter(ErrorFormat format, DiskSourceTree* tree = NULL) - : format_(format), - tree_(tree), - found_errors_(false), - found_warnings_(false) {} - ~ErrorPrinter() {} - - // implements MultiFileErrorCollector ------------------------------ - void AddError(const std::string& filename, int line, int column, - const std::string& message) override { - found_errors_ = true; - AddErrorOrWarning(filename, line, column, message, "error", std::cerr); - } - - void AddWarning(const std::string& filename, int line, int column, - const std::string& message) override { - found_warnings_ = true; - AddErrorOrWarning(filename, line, column, message, "warning", std::clog); - } - - // implements io::ErrorCollector ----------------------------------- - void AddError(int line, int column, const std::string& message) override { - AddError("input", line, column, message); - } - - void AddWarning(int line, int column, const std::string& message) override { - AddErrorOrWarning("input", line, column, message, "warning", std::clog); - } - - // implements DescriptorPool::ErrorCollector------------------------- - void AddError(const std::string& filename, const std::string& element_name, - const Message* descriptor, ErrorLocation location, - const std::string& message) override { - AddErrorOrWarning(filename, -1, -1, message, "error", std::cerr); - } - - void AddWarning(const std::string& filename, const std::string& element_name, - const Message* descriptor, ErrorLocation location, - const std::string& message) override { - AddErrorOrWarning(filename, -1, -1, message, "warning", std::clog); - } - - bool FoundErrors() const { return found_errors_; } - - bool FoundWarnings() const { return found_warnings_; } - - private: - void AddErrorOrWarning(const std::string& filename, int line, int column, - const std::string& message, const std::string& type, - std::ostream& out) { - // Print full path when running under MSVS - std::string dfile; - if (format_ == CommandLineInterface::ERROR_FORMAT_MSVS && tree_ != NULL && - tree_->VirtualFileToDiskFile(filename, &dfile)) { - out << dfile; - } else { - out << filename; - } - - // Users typically expect 1-based line/column numbers, so we add 1 - // to each here. - if (line != -1) { - // Allow for both GCC- and Visual-Studio-compatible output. - switch (format_) { - case CommandLineInterface::ERROR_FORMAT_GCC: - out << ":" << (line + 1) << ":" << (column + 1); - break; - case CommandLineInterface::ERROR_FORMAT_MSVS: - out << "(" << (line + 1) << ") : " << type - << " in column=" << (column + 1); - break; - } - } - - if (type == "warning") { - out << ": warning: " << message << std::endl; - } else { - out << ": " << message << std::endl; - } - } - - const ErrorFormat format_; - DiskSourceTree* tree_; - bool found_errors_; - bool found_warnings_; -}; - -// ------------------------------------------------------------------- - -// A GeneratorContext implementation that buffers files in memory, then dumps -// them all to disk on demand. -class CommandLineInterface::GeneratorContextImpl : public GeneratorContext { - public: - GeneratorContextImpl(const std::vector& parsed_files); - - // Write all files in the directory to disk at the given output location, - // which must end in a '/'. - bool WriteAllToDisk(const std::string& prefix); - - // Write the contents of this directory to a ZIP-format archive with the - // given name. - bool WriteAllToZip(const std::string& filename); - - // Add a boilerplate META-INF/MANIFEST.MF file as required by the Java JAR - // format, unless one has already been written. - void AddJarManifest(); - - // Get name of all output files. - void GetOutputFilenames(std::vector* output_filenames); - - // implements GeneratorContext -------------------------------------- - io::ZeroCopyOutputStream* Open(const std::string& filename) override; - io::ZeroCopyOutputStream* OpenForAppend(const std::string& filename) override; - io::ZeroCopyOutputStream* OpenForInsert( - const std::string& filename, const std::string& insertion_point) override; - io::ZeroCopyOutputStream* OpenForInsertWithGeneratedCodeInfo( - const std::string& filename, const std::string& insertion_point, - const google::protobuf::GeneratedCodeInfo& info) override; - void ListParsedFiles(std::vector* output) override { - *output = parsed_files_; - } - - private: - friend class MemoryOutputStream; - - // The files_ field maps from path keys to file content values. It's a map - // instead of an unordered_map so that files are written in order (good when - // writing zips). - std::map files_; - const std::vector& parsed_files_; - bool had_error_; -}; - -class CommandLineInterface::MemoryOutputStream - : public io::ZeroCopyOutputStream { - public: - MemoryOutputStream(GeneratorContextImpl* directory, - const std::string& filename, bool append_mode); - MemoryOutputStream(GeneratorContextImpl* directory, - const std::string& filename, - const std::string& insertion_point); - MemoryOutputStream(GeneratorContextImpl* directory, - const std::string& filename, - const std::string& insertion_point, - const google::protobuf::GeneratedCodeInfo& info); - virtual ~MemoryOutputStream(); - - // implements ZeroCopyOutputStream --------------------------------- - bool Next(void** data, int* size) override { - return inner_->Next(data, size); - } - void BackUp(int count) override { inner_->BackUp(count); } - int64_t ByteCount() const override { return inner_->ByteCount(); } - - private: - // Checks to see if "filename_.pb.meta" exists in directory_; if so, fixes the - // offsets in that GeneratedCodeInfo record to reflect bytes inserted in - // filename_ at original offset insertion_offset with length insertion_length. - // Also adds in the data from info_to_insert_ with updated offsets governed by - // insertion_offset and indent_length. We assume that insertions will not - // occur within any given annotated span of text. insertion_content must end - // with an endline. - void UpdateMetadata(const std::string& insertion_content, - size_t insertion_offset, size_t insertion_length, - size_t indent_length); - - // Inserts info_to_insert_ into target_info, assuming that the relevant - // insertion was made at insertion_offset in file_content with the given - // indent_length. insertion_content must end with an endline. - void InsertShiftedInfo(const std::string& insertion_content, - size_t insertion_offset, size_t indent_length, - google::protobuf::GeneratedCodeInfo& target_info); - - // Where to insert the string when it's done. - GeneratorContextImpl* directory_; - std::string filename_; - std::string insertion_point_; - - // The string we're building. - std::string data_; - - // Whether we should append the output stream to the existing file. - bool append_mode_; - - // StringOutputStream writing to data_. - std::unique_ptr inner_; - - // The GeneratedCodeInfo to insert at the insertion point. - google::protobuf::GeneratedCodeInfo info_to_insert_; -}; - -// ------------------------------------------------------------------- - -CommandLineInterface::GeneratorContextImpl::GeneratorContextImpl( - const std::vector& parsed_files) - : parsed_files_(parsed_files), had_error_(false) {} - -bool CommandLineInterface::GeneratorContextImpl::WriteAllToDisk( - const std::string& prefix) { - if (had_error_) { - return false; - } - - if (!VerifyDirectoryExists(prefix)) { - return false; - } - - for (const auto& pair : files_) { - const std::string& relative_filename = pair.first; - const char* data = pair.second.data(); - int size = pair.second.size(); - - if (!TryCreateParentDirectory(prefix, relative_filename)) { - return false; - } - std::string filename = prefix + relative_filename; - - // Create the output file. - int file_descriptor; - do { - file_descriptor = - open(filename.c_str(), O_WRONLY | O_CREAT | O_TRUNC | O_BINARY, 0666); - } while (file_descriptor < 0 && errno == EINTR); - - if (file_descriptor < 0) { - int error = errno; - std::cerr << filename << ": " << strerror(error); - return false; - } - - // Write the file. - while (size > 0) { - int write_result; - do { - write_result = write(file_descriptor, data, size); - } while (write_result < 0 && errno == EINTR); - - if (write_result <= 0) { - // Write error. - - // FIXME(kenton): According to the man page, if write() returns zero, - // there was no error; write() simply did not write anything. It's - // unclear under what circumstances this might happen, but presumably - // errno won't be set in this case. I am confused as to how such an - // event should be handled. For now I'm treating it as an error, - // since retrying seems like it could lead to an infinite loop. I - // suspect this never actually happens anyway. - - if (write_result < 0) { - int error = errno; - std::cerr << filename << ": write: " << strerror(error); - } else { - std::cerr << filename << ": write() returned zero?" << std::endl; - } - return false; - } - - data += write_result; - size -= write_result; - } - - if (close(file_descriptor) != 0) { - int error = errno; - std::cerr << filename << ": close: " << strerror(error); - return false; - } - } - - return true; -} - -bool CommandLineInterface::GeneratorContextImpl::WriteAllToZip( - const std::string& filename) { - if (had_error_) { - return false; - } - - // Create the output file. - int file_descriptor; - do { - file_descriptor = - open(filename.c_str(), O_WRONLY | O_CREAT | O_TRUNC | O_BINARY, 0666); - } while (file_descriptor < 0 && errno == EINTR); - - if (file_descriptor < 0) { - int error = errno; - std::cerr << filename << ": " << strerror(error); - return false; - } - - // Create the ZipWriter - io::FileOutputStream stream(file_descriptor); - ZipWriter zip_writer(&stream); - - for (const auto& pair : files_) { - zip_writer.Write(pair.first, pair.second); - } - - zip_writer.WriteDirectory(); - - if (stream.GetErrno() != 0) { - std::cerr << filename << ": " << strerror(stream.GetErrno()) << std::endl; - return false; - } - - if (!stream.Close()) { - std::cerr << filename << ": " << strerror(stream.GetErrno()) << std::endl; - return false; - } - - return true; -} - -void CommandLineInterface::GeneratorContextImpl::AddJarManifest() { - auto pair = files_.insert({"META-INF/MANIFEST.MF", ""}); - if (pair.second) { - pair.first->second = - "Manifest-Version: 1.0\n" - "Created-By: 1.6.0 (protoc)\n" - "\n"; - } -} - -void CommandLineInterface::GeneratorContextImpl::GetOutputFilenames( - std::vector* output_filenames) { - for (const auto& pair : files_) { - output_filenames->push_back(pair.first); - } -} - -io::ZeroCopyOutputStream* CommandLineInterface::GeneratorContextImpl::Open( - const std::string& filename) { - return new MemoryOutputStream(this, filename, false); -} - -io::ZeroCopyOutputStream* -CommandLineInterface::GeneratorContextImpl::OpenForAppend( - const std::string& filename) { - return new MemoryOutputStream(this, filename, true); -} - -io::ZeroCopyOutputStream* -CommandLineInterface::GeneratorContextImpl::OpenForInsert( - const std::string& filename, const std::string& insertion_point) { - return new MemoryOutputStream(this, filename, insertion_point); -} - -io::ZeroCopyOutputStream* -CommandLineInterface::GeneratorContextImpl::OpenForInsertWithGeneratedCodeInfo( - const std::string& filename, const std::string& insertion_point, - const google::protobuf::GeneratedCodeInfo& info) { - return new MemoryOutputStream(this, filename, insertion_point, info); -} - -// ------------------------------------------------------------------- - -CommandLineInterface::MemoryOutputStream::MemoryOutputStream( - GeneratorContextImpl* directory, const std::string& filename, - bool append_mode) - : directory_(directory), - filename_(filename), - append_mode_(append_mode), - inner_(new io::StringOutputStream(&data_)) {} - -CommandLineInterface::MemoryOutputStream::MemoryOutputStream( - GeneratorContextImpl* directory, const std::string& filename, - const std::string& insertion_point) - : directory_(directory), - filename_(filename), - insertion_point_(insertion_point), - inner_(new io::StringOutputStream(&data_)) {} - -CommandLineInterface::MemoryOutputStream::MemoryOutputStream( - GeneratorContextImpl* directory, const std::string& filename, - const std::string& insertion_point, const google::protobuf::GeneratedCodeInfo& info) - : directory_(directory), - filename_(filename), - insertion_point_(insertion_point), - inner_(new io::StringOutputStream(&data_)), - info_to_insert_(info) {} - -void CommandLineInterface::MemoryOutputStream::InsertShiftedInfo( - const std::string& insertion_content, size_t insertion_offset, - size_t indent_length, google::protobuf::GeneratedCodeInfo& target_info) { - // Keep track of how much extra data was added for indents before the - // current annotation being inserted. `pos` and `source_annotation.begin()` - // are offsets in `insertion_content`. `insertion_offset` is updated so that - // it can be added to an annotation's `begin` field to reflect that - // annotation's updated location after `insertion_content` was inserted into - // the target file. - size_t pos = 0; - insertion_offset += indent_length; - for (const auto& source_annotation : info_to_insert_.annotation()) { - GeneratedCodeInfo::Annotation* annotation = target_info.add_annotation(); - int inner_indent = 0; - // insertion_content is guaranteed to end in an endline. This last endline - // has no effect on indentation. - for (; pos < source_annotation.end() && pos < insertion_content.size() - 1; - ++pos) { - if (insertion_content[pos] == '\n') { - if (pos >= source_annotation.begin()) { - // The beginning of the annotation is at insertion_offset, but the end - // can still move further in the target file. - inner_indent += indent_length; - } else { - insertion_offset += indent_length; - } - } - } - *annotation = source_annotation; - annotation->set_begin(annotation->begin() + insertion_offset); - insertion_offset += inner_indent; - annotation->set_end(annotation->end() + insertion_offset); - } -} - -void CommandLineInterface::MemoryOutputStream::UpdateMetadata( - const std::string& insertion_content, size_t insertion_offset, - size_t insertion_length, size_t indent_length) { - auto it = directory_->files_.find(filename_ + ".pb.meta"); - if (it == directory_->files_.end() && info_to_insert_.annotation().empty()) { - // No metadata was recorded for this file. - return; - } - GeneratedCodeInfo metadata; - bool is_text_format = false; - std::string* encoded_data = nullptr; - if (it != directory_->files_.end()) { - encoded_data = &it->second; - // Try to decode a GeneratedCodeInfo proto from the .pb.meta file. It may be - // in wire or text format. Keep the same format when the data is written out - // later. - if (!metadata.ParseFromString(*encoded_data)) { - if (!TextFormat::ParseFromString(*encoded_data, &metadata)) { - // The metadata is invalid. - std::cerr - << filename_ - << ".pb.meta: Could not parse metadata as wire or text format." - << std::endl; - return; - } - // Generators that use the public plugin interface emit text-format - // metadata (because in the public plugin protocol, file content must be - // UTF8-encoded strings). - is_text_format = true; - } - } else { - // Create a new file to store the new metadata in info_to_insert_. - encoded_data = - &directory_->files_.insert({filename_ + ".pb.meta", ""}).first->second; - } - GeneratedCodeInfo new_metadata; - bool crossed_offset = false; - size_t to_add = 0; - for (const auto& source_annotation : metadata.annotation()) { - // The first time an annotation at or after the insertion point is found, - // insert the new metadata from info_to_insert_. Shift all annotations - // after the new metadata by the length of the text that was inserted - // (including any additional indent length). - if (source_annotation.begin() >= insertion_offset && !crossed_offset) { - crossed_offset = true; - InsertShiftedInfo(insertion_content, insertion_offset, indent_length, - new_metadata); - to_add += insertion_length; - } - GeneratedCodeInfo::Annotation* annotation = new_metadata.add_annotation(); - *annotation = source_annotation; - annotation->set_begin(annotation->begin() + to_add); - annotation->set_end(annotation->end() + to_add); - } - // If there were never any annotations at or after the insertion point, - // make sure to still insert the new metadata from info_to_insert_. - if (!crossed_offset) { - InsertShiftedInfo(insertion_content, insertion_offset, indent_length, - new_metadata); - } - if (is_text_format) { - TextFormat::PrintToString(new_metadata, encoded_data); - } else { - new_metadata.SerializeToString(encoded_data); - } -} - -CommandLineInterface::MemoryOutputStream::~MemoryOutputStream() { - // Make sure all data has been written. - inner_.reset(); - - // Insert into the directory. - auto pair = directory_->files_.insert({filename_, ""}); - auto it = pair.first; - bool already_present = !pair.second; - - if (insertion_point_.empty()) { - // This was just a regular Open(). - if (already_present) { - if (append_mode_) { - it->second.append(data_); - } else { - std::cerr << filename_ << ": Tried to write the same file twice." - << std::endl; - directory_->had_error_ = true; - } - return; - } - - it->second.swap(data_); - } else { - // This was an OpenForInsert(). - - // If the data doesn't end with a clean line break, add one. - if (!data_.empty() && data_[data_.size() - 1] != '\n') { - data_.push_back('\n'); - } - - // Find the file we are going to insert into. - if (!already_present) { - std::cerr << filename_ - << ": Tried to insert into file that doesn't exist." - << std::endl; - directory_->had_error_ = true; - return; - } - std::string* target = &it->second; - - // Find the insertion point. - std::string magic_string = - strings::Substitute("@@protoc_insertion_point($0)", insertion_point_); - std::string::size_type pos = target->find(magic_string); - - if (pos == std::string::npos) { - std::cerr << filename_ << ": insertion point \"" << insertion_point_ - << "\" not found." << std::endl; - directory_->had_error_ = true; - return; - } - - if ((pos > 3) && (target->substr(pos - 3, 2) == "/*")) { - // Support for inline "/* @@protoc_insertion_point() */" - pos = pos - 3; - } else { - // Seek backwards to the beginning of the line, which is where we will - // insert the data. Note that this has the effect of pushing the - // insertion point down, so the data is inserted before it. This is - // intentional because it means that multiple insertions at the same point - // will end up in the expected order in the final output. - pos = target->find_last_of('\n', pos); - if (pos == std::string::npos) { - // Insertion point is on the first line. - pos = 0; - } else { - // Advance to character after '\n'. - ++pos; - } - } - - // Extract indent. - std::string indent_(*target, pos, - target->find_first_not_of(" \t", pos) - pos); - - if (indent_.empty()) { - // No indent. This makes things easier. - target->insert(pos, data_); - UpdateMetadata(data_, pos, data_.size(), 0); - } else { - // Calculate how much space we need. - int indent_size = 0; - for (int i = 0; i < data_.size(); i++) { - if (data_[i] == '\n') indent_size += indent_.size(); - } - - // Make a hole for it. - target->insert(pos, data_.size() + indent_size, '\0'); - - // Now copy in the data. - std::string::size_type data_pos = 0; - char* target_ptr = ::google::protobuf::string_as_array(target) + pos; - while (data_pos < data_.size()) { - // Copy indent. - memcpy(target_ptr, indent_.data(), indent_.size()); - target_ptr += indent_.size(); - - // Copy line from data_. - // We already guaranteed that data_ ends with a newline (above), so this - // search can't fail. - std::string::size_type line_length = - data_.find_first_of('\n', data_pos) + 1 - data_pos; - memcpy(target_ptr, data_.data() + data_pos, line_length); - target_ptr += line_length; - data_pos += line_length; - } - UpdateMetadata(data_, pos, data_.size() + indent_size, indent_.size()); - - GOOGLE_CHECK_EQ(target_ptr, - ::google::protobuf::string_as_array(target) + pos + data_.size() + indent_size); - } - } -} - -// =================================================================== - -#if defined(_WIN32) && !defined(__CYGWIN__) -const char* const CommandLineInterface::kPathSeparator = ";"; -#else -const char* const CommandLineInterface::kPathSeparator = ":"; -#endif - -CommandLineInterface::CommandLineInterface() - : direct_dependencies_violation_msg_( - kDefaultDirectDependenciesViolationMsg) {} - -CommandLineInterface::~CommandLineInterface() {} - -void CommandLineInterface::RegisterGenerator(const std::string& flag_name, - CodeGenerator* generator, - const std::string& help_text) { - GeneratorInfo info; - info.flag_name = flag_name; - info.generator = generator; - info.help_text = help_text; - generators_by_flag_name_[flag_name] = info; -} - -void CommandLineInterface::RegisterGenerator( - const std::string& flag_name, const std::string& option_flag_name, - CodeGenerator* generator, const std::string& help_text) { - GeneratorInfo info; - info.flag_name = flag_name; - info.option_flag_name = option_flag_name; - info.generator = generator; - info.help_text = help_text; - generators_by_flag_name_[flag_name] = info; - generators_by_option_name_[option_flag_name] = info; -} - -void CommandLineInterface::AllowPlugins(const std::string& exe_name_prefix) { - plugin_prefix_ = exe_name_prefix; -} - -namespace { - -bool ContainsProto3Optional(const Descriptor* desc) { - for (int i = 0; i < desc->field_count(); i++) { - if (desc->field(i)->has_optional_keyword()) { - return true; - } - } - for (int i = 0; i < desc->nested_type_count(); i++) { - if (ContainsProto3Optional(desc->nested_type(i))) { - return true; - } - } - return false; -} - -bool ContainsProto3Optional(const FileDescriptor* file) { - if (file->syntax() == FileDescriptor::SYNTAX_PROTO3) { - for (int i = 0; i < file->message_type_count(); i++) { - if (ContainsProto3Optional(file->message_type(i))) { - return true; - } - } - } - return false; -} - -} // namespace - -namespace { -std::unique_ptr -PopulateSingleSimpleDescriptorDatabase(const std::string& descriptor_set_name); -} - -int CommandLineInterface::Run(int argc, const char* const argv[]) { - Clear(); - switch (ParseArguments(argc, argv)) { - case PARSE_ARGUMENT_DONE_AND_EXIT: - return 0; - case PARSE_ARGUMENT_FAIL: - return 1; - case PARSE_ARGUMENT_DONE_AND_CONTINUE: - break; - } - - std::vector parsed_files; - std::unique_ptr disk_source_tree; - std::unique_ptr error_collector; - std::unique_ptr descriptor_pool; - - // The SimpleDescriptorDatabases here are the constituents of the - // MergedDescriptorDatabase descriptor_set_in_database, so this vector is for - // managing their lifetimes. Its scope should match descriptor_set_in_database - std::vector> - databases_per_descriptor_set; - std::unique_ptr descriptor_set_in_database; - - std::unique_ptr source_tree_database; - - // Any --descriptor_set_in FileDescriptorSet objects will be used as a - // fallback to input_files on command line, so create that db first. - if (!descriptor_set_in_names_.empty()) { - for (const std::string& name : descriptor_set_in_names_) { - std::unique_ptr database_for_descriptor_set = - PopulateSingleSimpleDescriptorDatabase(name); - if (!database_for_descriptor_set) { - return EXIT_FAILURE; - } - databases_per_descriptor_set.push_back( - std::move(database_for_descriptor_set)); - } - - std::vector raw_databases_per_descriptor_set; - raw_databases_per_descriptor_set.reserve( - databases_per_descriptor_set.size()); - for (const std::unique_ptr& db : - databases_per_descriptor_set) { - raw_databases_per_descriptor_set.push_back(db.get()); - } - descriptor_set_in_database.reset( - new MergedDescriptorDatabase(raw_databases_per_descriptor_set)); - } - - if (proto_path_.empty()) { - // If there are no --proto_path flags, then just look in the specified - // --descriptor_set_in files. But first, verify that the input files are - // there. - if (!VerifyInputFilesInDescriptors(descriptor_set_in_database.get())) { - return 1; - } - - error_collector.reset(new ErrorPrinter(error_format_)); - descriptor_pool.reset(new DescriptorPool(descriptor_set_in_database.get(), - error_collector.get())); - } else { - disk_source_tree.reset(new DiskSourceTree()); - if (!InitializeDiskSourceTree(disk_source_tree.get(), - descriptor_set_in_database.get())) { - return 1; - } - - error_collector.reset( - new ErrorPrinter(error_format_, disk_source_tree.get())); - - source_tree_database.reset(new SourceTreeDescriptorDatabase( - disk_source_tree.get(), descriptor_set_in_database.get())); - source_tree_database->RecordErrorsTo(error_collector.get()); - - descriptor_pool.reset(new DescriptorPool( - source_tree_database.get(), - source_tree_database->GetValidationErrorCollector())); - } - - descriptor_pool->EnforceWeakDependencies(true); - if (!ParseInputFiles(descriptor_pool.get(), disk_source_tree.get(), - &parsed_files)) { - return 1; - } - - - // We construct a separate GeneratorContext for each output location. Note - // that two code generators may output to the same location, in which case - // they should share a single GeneratorContext so that OpenForInsert() works. - GeneratorContextMap output_directories; - - // Generate output. - if (mode_ == MODE_COMPILE) { - for (int i = 0; i < output_directives_.size(); i++) { - std::string output_location = output_directives_[i].output_location; - if (!HasSuffixString(output_location, ".zip") && - !HasSuffixString(output_location, ".jar") && - !HasSuffixString(output_location, ".srcjar")) { - AddTrailingSlash(&output_location); - } - - auto& generator = output_directories[output_location]; - - if (!generator) { - // First time we've seen this output location. - generator.reset(new GeneratorContextImpl(parsed_files)); - } - - if (!GenerateOutput(parsed_files, output_directives_[i], - generator.get())) { - return 1; - } - } - } - - // Write all output to disk. - for (const auto& pair : output_directories) { - const std::string& location = pair.first; - GeneratorContextImpl* directory = pair.second.get(); - if (HasSuffixString(location, "/")) { - if (!directory->WriteAllToDisk(location)) { - return 1; - } - } else { - if (HasSuffixString(location, ".jar")) { - directory->AddJarManifest(); - } - - if (!directory->WriteAllToZip(location)) { - return 1; - } - } - } - - if (!dependency_out_name_.empty()) { - GOOGLE_DCHECK(disk_source_tree.get()); - if (!GenerateDependencyManifestFile(parsed_files, output_directories, - disk_source_tree.get())) { - return 1; - } - } - - if (!descriptor_set_out_name_.empty()) { - if (!WriteDescriptorSet(parsed_files)) { - return 1; - } - } - - if (mode_ == MODE_ENCODE || mode_ == MODE_DECODE) { - if (codec_type_.empty()) { - // HACK: Define an EmptyMessage type to use for decoding. - DescriptorPool pool; - FileDescriptorProto file; - file.set_name("empty_message.proto"); - file.add_message_type()->set_name("EmptyMessage"); - GOOGLE_CHECK(pool.BuildFile(file) != NULL); - codec_type_ = "EmptyMessage"; - if (!EncodeOrDecode(&pool)) { - return 1; - } - } else { - if (!EncodeOrDecode(descriptor_pool.get())) { - return 1; - } - } - } - - if (error_collector->FoundErrors() || - (fatal_warnings_ && error_collector->FoundWarnings())) { - return 1; - } - - if (mode_ == MODE_PRINT) { - switch (print_mode_) { - case PRINT_FREE_FIELDS: - for (int i = 0; i < parsed_files.size(); ++i) { - const FileDescriptor* fd = parsed_files[i]; - for (int j = 0; j < fd->message_type_count(); ++j) { - PrintFreeFieldNumbers(fd->message_type(j)); - } - } - break; - case PRINT_NONE: - GOOGLE_LOG(ERROR) << "If the code reaches here, it usually means a bug of " - "flag parsing in the CommandLineInterface."; - return 1; - - // Do not add a default case. - } - } - - return 0; -} - -bool CommandLineInterface::InitializeDiskSourceTree( - DiskSourceTree* source_tree, DescriptorDatabase* fallback_database) { - AddDefaultProtoPaths(&proto_path_); - - // Set up the source tree. - for (int i = 0; i < proto_path_.size(); i++) { - source_tree->MapPath(proto_path_[i].first, proto_path_[i].second); - } - - // Map input files to virtual paths if possible. - if (!MakeInputsBeProtoPathRelative(source_tree, fallback_database)) { - return false; - } - - return true; -} - -namespace { -std::unique_ptr -PopulateSingleSimpleDescriptorDatabase(const std::string& descriptor_set_name) { - int fd; - do { - fd = open(descriptor_set_name.c_str(), O_RDONLY | O_BINARY); - } while (fd < 0 && errno == EINTR); - if (fd < 0) { - std::cerr << descriptor_set_name << ": " << strerror(ENOENT) << std::endl; - return nullptr; - } - - FileDescriptorSet file_descriptor_set; - bool parsed = file_descriptor_set.ParseFromFileDescriptor(fd); - if (close(fd) != 0) { - std::cerr << descriptor_set_name << ": close: " << strerror(errno) - << std::endl; - return nullptr; - } - - if (!parsed) { - std::cerr << descriptor_set_name << ": Unable to parse." << std::endl; - return nullptr; - } - - std::unique_ptr database{ - new SimpleDescriptorDatabase()}; - - for (int j = 0; j < file_descriptor_set.file_size(); j++) { - FileDescriptorProto previously_added_file_descriptor_proto; - if (database->FindFileByName(file_descriptor_set.file(j).name(), - &previously_added_file_descriptor_proto)) { - // already present - skip - continue; - } - if (!database->Add(file_descriptor_set.file(j))) { - return nullptr; - } - } - return database; -} - -} // namespace - - -bool CommandLineInterface::VerifyInputFilesInDescriptors( - DescriptorDatabase* database) { - for (const auto& input_file : input_files_) { - FileDescriptorProto file_descriptor; - if (!database->FindFileByName(input_file, &file_descriptor)) { - std::cerr << "Could not find file in descriptor database: " << input_file - << ": " << strerror(ENOENT) << std::endl; - return false; - } - - // Enforce --disallow_services. - if (disallow_services_ && file_descriptor.service_size() > 0) { - std::cerr << file_descriptor.name() - << ": This file contains services, but " - "--disallow_services was used." - << std::endl; - return false; - } - - } - return true; -} - -bool CommandLineInterface::ParseInputFiles( - DescriptorPool* descriptor_pool, DiskSourceTree* source_tree, - std::vector* parsed_files) { - - if (!proto_path_.empty()) { - // Track unused imports in all source files that were loaded from the - // filesystem. We do not track unused imports for files loaded from - // descriptor sets as they may be programmatically generated in which case - // exerting this level of rigor is less desirable. We're also making the - // assumption that the initial parse of the proto from the filesystem - // was rigorous in checking unused imports and that the descriptor set - // being parsed was produced then and that it was subsequent mutations - // of that descriptor set that left unused imports. - // - // Note that relying on proto_path exclusively is limited in that we may - // be loading descriptors from both the filesystem and descriptor sets - // depending on the invocation. At least for invocations that are - // exclusively reading from descriptor sets, we can eliminate this failure - // condition. - for (const auto& input_file : input_files_) { - descriptor_pool->AddUnusedImportTrackFile(input_file); - } - } - - bool result = true; - // Parse each file. - for (const auto& input_file : input_files_) { - // Import the file. - const FileDescriptor* parsed_file = - descriptor_pool->FindFileByName(input_file); - if (parsed_file == NULL) { - result = false; - break; - } - parsed_files->push_back(parsed_file); - - // Enforce --disallow_services. - if (disallow_services_ && parsed_file->service_count() > 0) { - std::cerr << parsed_file->name() - << ": This file contains services, but " - "--disallow_services was used." - << std::endl; - result = false; - break; - } - - - // Enforce --direct_dependencies - if (direct_dependencies_explicitly_set_) { - bool indirect_imports = false; - for (int i = 0; i < parsed_file->dependency_count(); i++) { - if (direct_dependencies_.find(parsed_file->dependency(i)->name()) == - direct_dependencies_.end()) { - indirect_imports = true; - std::cerr << parsed_file->name() << ": " - << StringReplace(direct_dependencies_violation_msg_, "%s", - parsed_file->dependency(i)->name(), - true /* replace_all */) - << std::endl; - } - } - if (indirect_imports) { - result = false; - break; - } - } - } - descriptor_pool->ClearUnusedImportTrackFiles(); - return result; -} - -void CommandLineInterface::Clear() { - // Clear all members that are set by Run(). Note that we must not clear - // members which are set by other methods before Run() is called. - executable_name_.clear(); - proto_path_.clear(); - input_files_.clear(); - direct_dependencies_.clear(); - direct_dependencies_violation_msg_ = kDefaultDirectDependenciesViolationMsg; - output_directives_.clear(); - codec_type_.clear(); - descriptor_set_in_names_.clear(); - descriptor_set_out_name_.clear(); - dependency_out_name_.clear(); - - - mode_ = MODE_COMPILE; - print_mode_ = PRINT_NONE; - imports_in_descriptor_set_ = false; - source_info_in_descriptor_set_ = false; - disallow_services_ = false; - direct_dependencies_explicitly_set_ = false; - deterministic_output_ = false; -} - -bool CommandLineInterface::MakeProtoProtoPathRelative( - DiskSourceTree* source_tree, std::string* proto, - DescriptorDatabase* fallback_database) { - // If it's in the fallback db, don't report non-existent file errors. - FileDescriptorProto fallback_file; - bool in_fallback_database = - fallback_database != nullptr && - fallback_database->FindFileByName(*proto, &fallback_file); - - // If the input file path is not a physical file path, it must be a virtual - // path. - if (access(proto->c_str(), F_OK) < 0) { - std::string disk_file; - if (source_tree->VirtualFileToDiskFile(*proto, &disk_file) || - in_fallback_database) { - return true; - } else { - std::cerr << "Could not make proto path relative: " << *proto << ": " - << strerror(ENOENT) << std::endl; - return false; - } - } - - std::string virtual_file, shadowing_disk_file; - switch (source_tree->DiskFileToVirtualFile(*proto, &virtual_file, - &shadowing_disk_file)) { - case DiskSourceTree::SUCCESS: - *proto = virtual_file; - break; - case DiskSourceTree::SHADOWED: - std::cerr << *proto << ": Input is shadowed in the --proto_path by \"" - << shadowing_disk_file - << "\". Either use the latter file as your input or reorder " - "the --proto_path so that the former file's location " - "comes first." - << std::endl; - return false; - case DiskSourceTree::CANNOT_OPEN: { - if (in_fallback_database) { - return true; - } - std::string error_str = source_tree->GetLastErrorMessage().empty() - ? strerror(errno) - : source_tree->GetLastErrorMessage(); - std::cerr << "Could not map to virtual file: " << *proto << ": " - << error_str << std::endl; - return false; - } - case DiskSourceTree::NO_MAPPING: { - // Try to interpret the path as a virtual path. - std::string disk_file; - if (source_tree->VirtualFileToDiskFile(*proto, &disk_file) || - in_fallback_database) { - return true; - } else { - // The input file path can't be mapped to any --proto_path and it also - // can't be interpreted as a virtual path. - std::cerr - << *proto - << ": File does not reside within any path " - "specified using --proto_path (or -I). You must specify a " - "--proto_path which encompasses this file. Note that the " - "proto_path must be an exact prefix of the .proto file " - "names -- protoc is too dumb to figure out when two paths " - "(e.g. absolute and relative) are equivalent (it's harder " - "than you think)." - << std::endl; - return false; - } - } - } - return true; -} - -bool CommandLineInterface::MakeInputsBeProtoPathRelative( - DiskSourceTree* source_tree, DescriptorDatabase* fallback_database) { - for (auto& input_file : input_files_) { - if (!MakeProtoProtoPathRelative(source_tree, &input_file, - fallback_database)) { - return false; - } - } - - return true; -} - - -bool CommandLineInterface::ExpandArgumentFile( - const std::string& file, std::vector* arguments) { - // The argument file is searched in the working directory only. We don't - // use the proto import path here. - std::ifstream file_stream(file.c_str()); - if (!file_stream.is_open()) { - return false; - } - std::string argument; - // We don't support any kind of shell expansion right now. - while (std::getline(file_stream, argument)) { - arguments->push_back(argument); - } - return true; -} - -CommandLineInterface::ParseArgumentStatus CommandLineInterface::ParseArguments( - int argc, const char* const argv[]) { - executable_name_ = argv[0]; - - std::vector arguments; - for (int i = 1; i < argc; ++i) { - if (argv[i][0] == '@') { - if (!ExpandArgumentFile(argv[i] + 1, &arguments)) { - std::cerr << "Failed to open argument file: " << (argv[i] + 1) - << std::endl; - return PARSE_ARGUMENT_FAIL; - } - continue; - } - arguments.push_back(argv[i]); - } - - // if no arguments are given, show help - if (arguments.empty()) { - PrintHelpText(); - return PARSE_ARGUMENT_DONE_AND_EXIT; // Exit without running compiler. - } - - // Iterate through all arguments and parse them. - for (int i = 0; i < arguments.size(); ++i) { - std::string name, value; - - if (ParseArgument(arguments[i].c_str(), &name, &value)) { - // Returned true => Use the next argument as the flag value. - if (i + 1 == arguments.size() || arguments[i + 1][0] == '-') { - std::cerr << "Missing value for flag: " << name << std::endl; - if (name == "--decode") { - std::cerr << "To decode an unknown message, use --decode_raw." - << std::endl; - } - return PARSE_ARGUMENT_FAIL; - } else { - ++i; - value = arguments[i]; - } - } - - ParseArgumentStatus status = InterpretArgument(name, value); - if (status != PARSE_ARGUMENT_DONE_AND_CONTINUE) return status; - } - - // Make sure each plugin option has a matching plugin output. - bool foundUnknownPluginOption = false; - for (std::map::const_iterator i = - plugin_parameters_.begin(); - i != plugin_parameters_.end(); ++i) { - if (plugins_.find(i->first) != plugins_.end()) { - continue; - } - bool foundImplicitPlugin = false; - for (std::vector::const_iterator j = - output_directives_.begin(); - j != output_directives_.end(); ++j) { - if (j->generator == NULL) { - std::string plugin_name = PluginName(plugin_prefix_, j->name); - if (plugin_name == i->first) { - foundImplicitPlugin = true; - break; - } - } - } - if (!foundImplicitPlugin) { - std::cerr << "Unknown flag: " - // strip prefix + "gen-" and add back "_opt" - << "--" + i->first.substr(plugin_prefix_.size() + 4) + "_opt" - << std::endl; - foundUnknownPluginOption = true; - } - } - if (foundUnknownPluginOption) { - return PARSE_ARGUMENT_FAIL; - } - - // The --proto_path & --descriptor_set_in flags both specify places to look - // for proto files. If neither were given, use the current working directory. - if (proto_path_.empty() && descriptor_set_in_names_.empty()) { - // Don't use make_pair as the old/default standard library on Solaris - // doesn't support it without explicit template parameters, which are - // incompatible with C++0x's make_pair. - proto_path_.push_back(std::pair("", ".")); - } - - // Check error cases that span multiple flag values. - bool missing_proto_definitions = false; - switch (mode_) { - case MODE_COMPILE: - missing_proto_definitions = input_files_.empty(); - break; - case MODE_DECODE: - // Handle --decode_raw separately, since it requires that no proto - // definitions are specified. - if (codec_type_.empty()) { - if (!input_files_.empty() || !descriptor_set_in_names_.empty()) { - std::cerr - << "When using --decode_raw, no input files should be given." - << std::endl; - return PARSE_ARGUMENT_FAIL; - } - missing_proto_definitions = false; - break; // only for --decode_raw - } - // --decode (not raw) is handled the same way as the rest of the modes. - PROTOBUF_FALLTHROUGH_INTENDED; - case MODE_ENCODE: - case MODE_PRINT: - missing_proto_definitions = - input_files_.empty() && descriptor_set_in_names_.empty(); - break; - default: - GOOGLE_LOG(FATAL) << "Unexpected mode: " << mode_; - } - if (missing_proto_definitions) { - std::cerr << "Missing input file." << std::endl; - return PARSE_ARGUMENT_FAIL; - } - if (mode_ == MODE_COMPILE && output_directives_.empty() && - descriptor_set_out_name_.empty()) { - std::cerr << "Missing output directives." << std::endl; - return PARSE_ARGUMENT_FAIL; - } - if (mode_ != MODE_COMPILE && !dependency_out_name_.empty()) { - std::cerr << "Can only use --dependency_out=FILE when generating code." - << std::endl; - return PARSE_ARGUMENT_FAIL; - } - if (mode_ != MODE_ENCODE && deterministic_output_) { - std::cerr << "Can only use --deterministic_output with --encode." - << std::endl; - return PARSE_ARGUMENT_FAIL; - } - if (!dependency_out_name_.empty() && input_files_.size() > 1) { - std::cerr - << "Can only process one input file when using --dependency_out=FILE." - << std::endl; - return PARSE_ARGUMENT_FAIL; - } - if (imports_in_descriptor_set_ && descriptor_set_out_name_.empty()) { - std::cerr << "--include_imports only makes sense when combined with " - "--descriptor_set_out." - << std::endl; - } - if (source_info_in_descriptor_set_ && descriptor_set_out_name_.empty()) { - std::cerr << "--include_source_info only makes sense when combined with " - "--descriptor_set_out." - << std::endl; - } - - return PARSE_ARGUMENT_DONE_AND_CONTINUE; -} - -bool CommandLineInterface::ParseArgument(const char* arg, std::string* name, - std::string* value) { - bool parsed_value = false; - - if (arg[0] != '-') { - // Not a flag. - name->clear(); - parsed_value = true; - *value = arg; - } else if (arg[1] == '-') { - // Two dashes: Multi-character name, with '=' separating name and - // value. - const char* equals_pos = strchr(arg, '='); - if (equals_pos != NULL) { - *name = std::string(arg, equals_pos - arg); - *value = equals_pos + 1; - parsed_value = true; - } else { - *name = arg; - } - } else { - // One dash: One-character name, all subsequent characters are the - // value. - if (arg[1] == '\0') { - // arg is just "-". We treat this as an input file, except that at - // present this will just lead to a "file not found" error. - name->clear(); - *value = arg; - parsed_value = true; - } else { - *name = std::string(arg, 2); - *value = arg + 2; - parsed_value = !value->empty(); - } - } - - // Need to return true iff the next arg should be used as the value for this - // one, false otherwise. - - if (parsed_value) { - // We already parsed a value for this flag. - return false; - } - - if (*name == "-h" || *name == "--help" || *name == "--disallow_services" || - *name == "--include_imports" || *name == "--include_source_info" || - *name == "--version" || *name == "--decode_raw" || - *name == "--print_free_field_numbers" || - *name == "--experimental_allow_proto3_optional" || - *name == "--deterministic_output" || *name == "--fatal_warnings") { - // HACK: These are the only flags that don't take a value. - // They probably should not be hard-coded like this but for now it's - // not worth doing better. - return false; - } - - // Next argument is the flag value. - return true; -} - -CommandLineInterface::ParseArgumentStatus -CommandLineInterface::InterpretArgument(const std::string& name, - const std::string& value) { - if (name.empty()) { - // Not a flag. Just a filename. - if (value.empty()) { - std::cerr - << "You seem to have passed an empty string as one of the " - "arguments to " - << executable_name_ - << ". This is actually " - "sort of hard to do. Congrats. Unfortunately it is not valid " - "input so the program is going to die now." - << std::endl; - return PARSE_ARGUMENT_FAIL; - } - -#if defined(_WIN32) - // On Windows, the shell (typically cmd.exe) does not expand wildcards in - // file names (e.g. foo\*.proto), so we do it ourselves. - switch (google::protobuf::io::win32::ExpandWildcards( - value, - [this](const string& path) { this->input_files_.push_back(path); })) { - case google::protobuf::io::win32::ExpandWildcardsResult::kSuccess: - break; - case google::protobuf::io::win32::ExpandWildcardsResult:: - kErrorNoMatchingFile: - // Path does not exist, is not a file, or it's longer than MAX_PATH and - // long path handling is disabled. - std::cerr << "Invalid file name pattern or missing input file \"" - << value << "\"" << std::endl; - return PARSE_ARGUMENT_FAIL; - default: - std::cerr << "Cannot convert path \"" << value - << "\" to or from Windows style" << std::endl; - return PARSE_ARGUMENT_FAIL; - } -#else // not _WIN32 - // On other platforms than Windows (e.g. Linux, Mac OS) the shell (typically - // Bash) expands wildcards. - input_files_.push_back(value); -#endif // _WIN32 - - } else if (name == "-I" || name == "--proto_path") { - // Java's -classpath (and some other languages) delimits path components - // with colons. Let's accept that syntax too just to make things more - // intuitive. - std::vector parts = Split( - value, CommandLineInterface::kPathSeparator, - true); - - for (int i = 0; i < parts.size(); i++) { - std::string virtual_path; - std::string disk_path; - - std::string::size_type equals_pos = parts[i].find_first_of('='); - if (equals_pos == std::string::npos) { - virtual_path = ""; - disk_path = parts[i]; - } else { - virtual_path = parts[i].substr(0, equals_pos); - disk_path = parts[i].substr(equals_pos + 1); - } - - if (disk_path.empty()) { - std::cerr - << "--proto_path passed empty directory name. (Use \".\" for " - "current directory.)" - << std::endl; - return PARSE_ARGUMENT_FAIL; - } - - // Make sure disk path exists, warn otherwise. - if (access(disk_path.c_str(), F_OK) < 0) { - // Try the original path; it may have just happened to have a '=' in it. - if (access(parts[i].c_str(), F_OK) < 0) { - std::cerr << disk_path << ": warning: directory does not exist." - << std::endl; - } else { - virtual_path = ""; - disk_path = parts[i]; - } - } - - // Don't use make_pair as the old/default standard library on Solaris - // doesn't support it without explicit template parameters, which are - // incompatible with C++0x's make_pair. - proto_path_.push_back( - std::pair(virtual_path, disk_path)); - } - - } else if (name == "--direct_dependencies") { - if (direct_dependencies_explicitly_set_) { - std::cerr << name - << " may only be passed once. To specify multiple " - "direct dependencies, pass them all as a single " - "parameter separated by ':'." - << std::endl; - return PARSE_ARGUMENT_FAIL; - } - - direct_dependencies_explicitly_set_ = true; - std::vector direct = - Split(value, ":", true); - GOOGLE_DCHECK(direct_dependencies_.empty()); - direct_dependencies_.insert(direct.begin(), direct.end()); - - } else if (name == "--direct_dependencies_violation_msg") { - direct_dependencies_violation_msg_ = value; - - } else if (name == "--descriptor_set_in") { - if (!descriptor_set_in_names_.empty()) { - std::cerr << name - << " may only be passed once. To specify multiple " - "descriptor sets, pass them all as a single " - "parameter separated by '" - << CommandLineInterface::kPathSeparator << "'." << std::endl; - return PARSE_ARGUMENT_FAIL; - } - if (value.empty()) { - std::cerr << name << " requires a non-empty value." << std::endl; - return PARSE_ARGUMENT_FAIL; - } - if (!dependency_out_name_.empty()) { - std::cerr << name << " cannot be used with --dependency_out." - << std::endl; - return PARSE_ARGUMENT_FAIL; - } - - descriptor_set_in_names_ = Split( - value, CommandLineInterface::kPathSeparator, - true); - - } else if (name == "-o" || name == "--descriptor_set_out") { - if (!descriptor_set_out_name_.empty()) { - std::cerr << name << " may only be passed once." << std::endl; - return PARSE_ARGUMENT_FAIL; - } - if (value.empty()) { - std::cerr << name << " requires a non-empty value." << std::endl; - return PARSE_ARGUMENT_FAIL; - } - if (mode_ != MODE_COMPILE) { - std::cerr - << "Cannot use --encode or --decode and generate descriptors at the " - "same time." - << std::endl; - return PARSE_ARGUMENT_FAIL; - } - descriptor_set_out_name_ = value; - - } else if (name == "--dependency_out") { - if (!dependency_out_name_.empty()) { - std::cerr << name << " may only be passed once." << std::endl; - return PARSE_ARGUMENT_FAIL; - } - if (value.empty()) { - std::cerr << name << " requires a non-empty value." << std::endl; - return PARSE_ARGUMENT_FAIL; - } - if (!descriptor_set_in_names_.empty()) { - std::cerr << name << " cannot be used with --descriptor_set_in." - << std::endl; - return PARSE_ARGUMENT_FAIL; - } - dependency_out_name_ = value; - - } else if (name == "--include_imports") { - if (imports_in_descriptor_set_) { - std::cerr << name << " may only be passed once." << std::endl; - return PARSE_ARGUMENT_FAIL; - } - imports_in_descriptor_set_ = true; - - } else if (name == "--include_source_info") { - if (source_info_in_descriptor_set_) { - std::cerr << name << " may only be passed once." << std::endl; - return PARSE_ARGUMENT_FAIL; - } - source_info_in_descriptor_set_ = true; - - } else if (name == "-h" || name == "--help") { - PrintHelpText(); - return PARSE_ARGUMENT_DONE_AND_EXIT; // Exit without running compiler. - - } else if (name == "--version") { - if (!version_info_.empty()) { - std::cout << version_info_ << std::endl; - } - std::cout << "libprotoc " << internal::VersionString(PROTOBUF_VERSION) - << PROTOBUF_VERSION_SUFFIX << std::endl; - return PARSE_ARGUMENT_DONE_AND_EXIT; // Exit without running compiler. - - } else if (name == "--disallow_services") { - disallow_services_ = true; - - - } else if (name == "--experimental_allow_proto3_optional") { - // Flag is no longer observed, but we allow it for backward compat. - } else if (name == "--encode" || name == "--decode" || - name == "--decode_raw") { - if (mode_ != MODE_COMPILE) { - std::cerr << "Only one of --encode and --decode can be specified." - << std::endl; - return PARSE_ARGUMENT_FAIL; - } - if (!output_directives_.empty() || !descriptor_set_out_name_.empty()) { - std::cerr << "Cannot use " << name - << " and generate code or descriptors at the same time." - << std::endl; - return PARSE_ARGUMENT_FAIL; - } - - mode_ = (name == "--encode") ? MODE_ENCODE : MODE_DECODE; - - if (value.empty() && name != "--decode_raw") { - std::cerr << "Type name for " << name << " cannot be blank." << std::endl; - if (name == "--decode") { - std::cerr << "To decode an unknown message, use --decode_raw." - << std::endl; - } - return PARSE_ARGUMENT_FAIL; - } else if (!value.empty() && name == "--decode_raw") { - std::cerr << "--decode_raw does not take a parameter." << std::endl; - return PARSE_ARGUMENT_FAIL; - } - - codec_type_ = value; - - } else if (name == "--deterministic_output") { - deterministic_output_ = true; - - } else if (name == "--error_format") { - if (value == "gcc") { - error_format_ = ERROR_FORMAT_GCC; - } else if (value == "msvs") { - error_format_ = ERROR_FORMAT_MSVS; - } else { - std::cerr << "Unknown error format: " << value << std::endl; - return PARSE_ARGUMENT_FAIL; - } - - } else if (name == "--fatal_warnings") { - if (fatal_warnings_) { - std::cerr << name << " may only be passed once." << std::endl; - return PARSE_ARGUMENT_FAIL; - } - fatal_warnings_ = true; - } else if (name == "--plugin") { - if (plugin_prefix_.empty()) { - std::cerr << "This compiler does not support plugins." << std::endl; - return PARSE_ARGUMENT_FAIL; - } - - std::string plugin_name; - std::string path; - - std::string::size_type equals_pos = value.find_first_of('='); - if (equals_pos == std::string::npos) { - // Use the basename of the file. - std::string::size_type slash_pos = value.find_last_of('/'); - if (slash_pos == std::string::npos) { - plugin_name = value; - } else { - plugin_name = value.substr(slash_pos + 1); - } - path = value; - } else { - plugin_name = value.substr(0, equals_pos); - path = value.substr(equals_pos + 1); - } - - plugins_[plugin_name] = path; - - } else if (name == "--print_free_field_numbers") { - if (mode_ != MODE_COMPILE) { - std::cerr << "Cannot use " << name - << " and use --encode, --decode or print " - << "other info at the same time." << std::endl; - return PARSE_ARGUMENT_FAIL; - } - if (!output_directives_.empty() || !descriptor_set_out_name_.empty()) { - std::cerr << "Cannot use " << name - << " and generate code or descriptors at the same time." - << std::endl; - return PARSE_ARGUMENT_FAIL; - } - mode_ = MODE_PRINT; - print_mode_ = PRINT_FREE_FIELDS; - } else { - // Some other flag. Look it up in the generators list. - const GeneratorInfo* generator_info = - FindOrNull(generators_by_flag_name_, name); - if (generator_info == NULL && - (plugin_prefix_.empty() || !HasSuffixString(name, "_out"))) { - // Check if it's a generator option flag. - generator_info = FindOrNull(generators_by_option_name_, name); - if (generator_info != NULL) { - std::string* parameters = - &generator_parameters_[generator_info->flag_name]; - if (!parameters->empty()) { - parameters->append(","); - } - parameters->append(value); - } else if (HasPrefixString(name, "--") && HasSuffixString(name, "_opt")) { - std::string* parameters = - &plugin_parameters_[PluginName(plugin_prefix_, name)]; - if (!parameters->empty()) { - parameters->append(","); - } - parameters->append(value); - } else { - std::cerr << "Unknown flag: " << name << std::endl; - return PARSE_ARGUMENT_FAIL; - } - } else { - // It's an output flag. Add it to the output directives. - if (mode_ != MODE_COMPILE) { - std::cerr << "Cannot use --encode, --decode or print .proto info and " - "generate code at the same time." - << std::endl; - return PARSE_ARGUMENT_FAIL; - } - - OutputDirective directive; - directive.name = name; - if (generator_info == NULL) { - directive.generator = NULL; - } else { - directive.generator = generator_info->generator; - } - - // Split value at ':' to separate the generator parameter from the - // filename. However, avoid doing this if the colon is part of a valid - // Windows-style absolute path. - std::string::size_type colon_pos = value.find_first_of(':'); - if (colon_pos == std::string::npos || IsWindowsAbsolutePath(value)) { - directive.output_location = value; - } else { - directive.parameter = value.substr(0, colon_pos); - directive.output_location = value.substr(colon_pos + 1); - } - - output_directives_.push_back(directive); - } - } - - return PARSE_ARGUMENT_DONE_AND_CONTINUE; -} - -void CommandLineInterface::PrintHelpText() { - // Sorry for indentation here; line wrapping would be uglier. - std::cout << "Usage: " << executable_name_ << " [OPTION] PROTO_FILES"; - std::cout << R"( -Parse PROTO_FILES and generate output based on the options given: - -IPATH, --proto_path=PATH Specify the directory in which to search for - imports. May be specified multiple times; - directories will be searched in order. If not - given, the current working directory is used. - If not found in any of the these directories, - the --descriptor_set_in descriptors will be - checked for required proto file. - --version Show version info and exit. - -h, --help Show this text and exit. - --encode=MESSAGE_TYPE Read a text-format message of the given type - from standard input and write it in binary - to standard output. The message type must - be defined in PROTO_FILES or their imports. - --deterministic_output When using --encode, ensure map fields are - deterministically ordered. Note that this order - is not canonical, and changes across builds or - releases of protoc. - --decode=MESSAGE_TYPE Read a binary message of the given type from - standard input and write it in text format - to standard output. The message type must - be defined in PROTO_FILES or their imports. - --decode_raw Read an arbitrary protocol message from - standard input and write the raw tag/value - pairs in text format to standard output. No - PROTO_FILES should be given when using this - flag. - --descriptor_set_in=FILES Specifies a delimited list of FILES - each containing a FileDescriptorSet (a - protocol buffer defined in descriptor.proto). - The FileDescriptor for each of the PROTO_FILES - provided will be loaded from these - FileDescriptorSets. If a FileDescriptor - appears multiple times, the first occurrence - will be used. - -oFILE, Writes a FileDescriptorSet (a protocol buffer, - --descriptor_set_out=FILE defined in descriptor.proto) containing all of - the input files to FILE. - --include_imports When using --descriptor_set_out, also include - all dependencies of the input files in the - set, so that the set is self-contained. - --include_source_info When using --descriptor_set_out, do not strip - SourceCodeInfo from the FileDescriptorProto. - This results in vastly larger descriptors that - include information about the original - location of each decl in the source file as - well as surrounding comments. - --dependency_out=FILE Write a dependency output file in the format - expected by make. This writes the transitive - set of input file paths to FILE - --error_format=FORMAT Set the format in which to print errors. - FORMAT may be 'gcc' (the default) or 'msvs' - (Microsoft Visual Studio format). - --fatal_warnings Make warnings be fatal (similar to -Werr in - gcc). This flag will make protoc return - with a non-zero exit code if any warnings - are generated. - --print_free_field_numbers Print the free field numbers of the messages - defined in the given proto files. Groups share - the same field number space with the parent - message. Extension ranges are counted as - occupied fields numbers.)"; - if (!plugin_prefix_.empty()) { - std::cout << R"( - --plugin=EXECUTABLE Specifies a plugin executable to use. - Normally, protoc searches the PATH for - plugins, but you may specify additional - executables not in the path using this flag. - Additionally, EXECUTABLE may be of the form - NAME=PATH, in which case the given plugin name - is mapped to the given executable even if - the executable's own name differs.)"; - } - - for (GeneratorMap::iterator iter = generators_by_flag_name_.begin(); - iter != generators_by_flag_name_.end(); ++iter) { - // FIXME(kenton): If the text is long enough it will wrap, which is ugly, - // but fixing this nicely (e.g. splitting on spaces) is probably more - // trouble than it's worth. - std::cout << std::endl - << " " << iter->first << "=OUT_DIR " - << std::string(19 - iter->first.size(), - ' ') // Spaces for alignment. - << iter->second.help_text; - } - std::cout << R"( - @ Read options and filenames from file. If a - relative file path is specified, the file - will be searched in the working directory. - The --proto_path option will not affect how - this argument file is searched. Content of - the file will be expanded in the position of - @ as in the argument list. Note - that shell expansion is not applied to the - content of the file (i.e., you cannot use - quotes, wildcards, escapes, commands, etc.). - Each line corresponds to a single argument, - even if it contains spaces.)"; - std::cout << std::endl; -} - -bool CommandLineInterface::EnforceProto3OptionalSupport( - const std::string& codegen_name, uint64_t supported_features, - const std::vector& parsed_files) const { - bool supports_proto3_optional = - supported_features & CodeGenerator::FEATURE_PROTO3_OPTIONAL; - if (!supports_proto3_optional) { - for (const auto fd : parsed_files) { - if (ContainsProto3Optional(fd)) { - std::cerr << fd->name() - << ": is a proto3 file that contains optional fields, but " - "code generator " - << codegen_name - << " hasn't been updated to support optional fields in " - "proto3. Please ask the owner of this code generator to " - "support proto3 optional."; - return false; - } - } - } - return true; -} - -bool CommandLineInterface::GenerateOutput( - const std::vector& parsed_files, - const OutputDirective& output_directive, - GeneratorContext* generator_context) { - // Call the generator. - std::string error; - if (output_directive.generator == NULL) { - // This is a plugin. - GOOGLE_CHECK(HasPrefixString(output_directive.name, "--") && - HasSuffixString(output_directive.name, "_out")) - << "Bad name for plugin generator: " << output_directive.name; - - std::string plugin_name = PluginName(plugin_prefix_, output_directive.name); - std::string parameters = output_directive.parameter; - if (!plugin_parameters_[plugin_name].empty()) { - if (!parameters.empty()) { - parameters.append(","); - } - parameters.append(plugin_parameters_[plugin_name]); - } - if (!GeneratePluginOutput(parsed_files, plugin_name, parameters, - generator_context, &error)) { - std::cerr << output_directive.name << ": " << error << std::endl; - return false; - } - } else { - // Regular generator. - std::string parameters = output_directive.parameter; - if (!generator_parameters_[output_directive.name].empty()) { - if (!parameters.empty()) { - parameters.append(","); - } - parameters.append(generator_parameters_[output_directive.name]); - } - if (!EnforceProto3OptionalSupport( - output_directive.name, - output_directive.generator->GetSupportedFeatures(), parsed_files)) { - return false; - } - - if (!output_directive.generator->GenerateAll(parsed_files, parameters, - generator_context, &error)) { - // Generator returned an error. - std::cerr << output_directive.name << ": " << error << std::endl; - return false; - } - } - - return true; -} - -bool CommandLineInterface::GenerateDependencyManifestFile( - const std::vector& parsed_files, - const GeneratorContextMap& output_directories, - DiskSourceTree* source_tree) { - FileDescriptorSet file_set; - - std::set already_seen; - for (int i = 0; i < parsed_files.size(); i++) { - GetTransitiveDependencies(parsed_files[i], false, false, &already_seen, - file_set.mutable_file()); - } - - std::vector output_filenames; - for (const auto& pair : output_directories) { - const std::string& location = pair.first; - GeneratorContextImpl* directory = pair.second.get(); - std::vector relative_output_filenames; - directory->GetOutputFilenames(&relative_output_filenames); - for (int i = 0; i < relative_output_filenames.size(); i++) { - std::string output_filename = location + relative_output_filenames[i]; - if (output_filename.compare(0, 2, "./") == 0) { - output_filename = output_filename.substr(2); - } - output_filenames.push_back(output_filename); - } - } - - int fd; - do { - fd = open(dependency_out_name_.c_str(), - O_WRONLY | O_CREAT | O_TRUNC | O_BINARY, 0666); - } while (fd < 0 && errno == EINTR); - - if (fd < 0) { - perror(dependency_out_name_.c_str()); - return false; - } - - io::FileOutputStream out(fd); - io::Printer printer(&out, '$'); - - for (int i = 0; i < output_filenames.size(); i++) { - printer.Print(output_filenames[i].c_str()); - if (i == output_filenames.size() - 1) { - printer.Print(":"); - } else { - printer.Print(" \\\n"); - } - } - - for (int i = 0; i < file_set.file_size(); i++) { - const FileDescriptorProto& file = file_set.file(i); - const std::string& virtual_file = file.name(); - std::string disk_file; - if (source_tree && - source_tree->VirtualFileToDiskFile(virtual_file, &disk_file)) { - printer.Print(" $disk_file$", "disk_file", disk_file); - if (i < file_set.file_size() - 1) printer.Print("\\\n"); - } else { - std::cerr << "Unable to identify path for file " << virtual_file - << std::endl; - return false; - } - } - - return true; -} - -bool CommandLineInterface::GeneratePluginOutput( - const std::vector& parsed_files, - const std::string& plugin_name, const std::string& parameter, - GeneratorContext* generator_context, std::string* error) { - CodeGeneratorRequest request; - CodeGeneratorResponse response; - std::string processed_parameter = parameter; - - - // Build the request. - if (!processed_parameter.empty()) { - request.set_parameter(processed_parameter); - } - - - std::set already_seen; - for (int i = 0; i < parsed_files.size(); i++) { - request.add_file_to_generate(parsed_files[i]->name()); - GetTransitiveDependencies(parsed_files[i], - true, // Include json_name for plugins. - true, // Include source code info. - &already_seen, request.mutable_proto_file()); - } - - google::protobuf::compiler::Version* version = - request.mutable_compiler_version(); - version->set_major(PROTOBUF_VERSION / 1000000); - version->set_minor(PROTOBUF_VERSION / 1000 % 1000); - version->set_patch(PROTOBUF_VERSION % 1000); - version->set_suffix(PROTOBUF_VERSION_SUFFIX); - - // Invoke the plugin. - Subprocess subprocess; - - if (plugins_.count(plugin_name) > 0) { - subprocess.Start(plugins_[plugin_name], Subprocess::EXACT_NAME); - } else { - subprocess.Start(plugin_name, Subprocess::SEARCH_PATH); - } - - std::string communicate_error; - if (!subprocess.Communicate(request, &response, &communicate_error)) { - *error = strings::Substitute("$0: $1", plugin_name, communicate_error); - return false; - } - - // Write the files. We do this even if there was a generator error in order - // to match the behavior of a compiled-in generator. - std::unique_ptr current_output; - for (int i = 0; i < response.file_size(); i++) { - const CodeGeneratorResponse::File& output_file = response.file(i); - - if (!output_file.insertion_point().empty()) { - std::string filename = output_file.name(); - // Open a file for insert. - // We reset current_output to NULL first so that the old file is closed - // before the new one is opened. - current_output.reset(); - current_output.reset( - generator_context->OpenForInsertWithGeneratedCodeInfo( - filename, output_file.insertion_point(), - output_file.generated_code_info())); - } else if (!output_file.name().empty()) { - // Starting a new file. Open it. - // We reset current_output to NULL first so that the old file is closed - // before the new one is opened. - current_output.reset(); - current_output.reset(generator_context->Open(output_file.name())); - } else if (current_output == NULL) { - *error = strings::Substitute( - "$0: First file chunk returned by plugin did not specify a file " - "name.", - plugin_name); - return false; - } - - // Use CodedOutputStream for convenience; otherwise we'd need to provide - // our own buffer-copying loop. - io::CodedOutputStream writer(current_output.get()); - writer.WriteString(output_file.content()); - } - - // Check for errors. - if (!response.error().empty()) { - // Generator returned an error. - *error = response.error(); - return false; - } else if (!EnforceProto3OptionalSupport( - plugin_name, response.supported_features(), parsed_files)) { - return false; - } - - return true; -} - -bool CommandLineInterface::EncodeOrDecode(const DescriptorPool* pool) { - // Look up the type. - const Descriptor* type = pool->FindMessageTypeByName(codec_type_); - if (type == NULL) { - std::cerr << "Type not defined: " << codec_type_ << std::endl; - return false; - } - - DynamicMessageFactory dynamic_factory(pool); - std::unique_ptr message(dynamic_factory.GetPrototype(type)->New()); - - if (mode_ == MODE_ENCODE) { - SetFdToTextMode(STDIN_FILENO); - SetFdToBinaryMode(STDOUT_FILENO); - } else { - SetFdToBinaryMode(STDIN_FILENO); - SetFdToTextMode(STDOUT_FILENO); - } - - io::FileInputStream in(STDIN_FILENO); - io::FileOutputStream out(STDOUT_FILENO); - - if (mode_ == MODE_ENCODE) { - // Input is text. - ErrorPrinter error_collector(error_format_); - TextFormat::Parser parser; - parser.RecordErrorsTo(&error_collector); - parser.AllowPartialMessage(true); - - if (!parser.Parse(&in, message.get())) { - std::cerr << "Failed to parse input." << std::endl; - return false; - } - } else { - // Input is binary. - if (!message->ParsePartialFromZeroCopyStream(&in)) { - std::cerr << "Failed to parse input." << std::endl; - return false; - } - } - - if (!message->IsInitialized()) { - std::cerr << "warning: Input message is missing required fields: " - << message->InitializationErrorString() << std::endl; - } - - if (mode_ == MODE_ENCODE) { - // Output is binary. - io::CodedOutputStream coded_out(&out); - coded_out.SetSerializationDeterministic(deterministic_output_); - if (!message->SerializePartialToCodedStream(&coded_out)) { - std::cerr << "output: I/O error." << std::endl; - return false; - } - } else { - // Output is text. - if (!TextFormat::Print(*message, &out)) { - std::cerr << "output: I/O error." << std::endl; - return false; - } - } - - return true; -} - -bool CommandLineInterface::WriteDescriptorSet( - const std::vector& parsed_files) { - FileDescriptorSet file_set; - - std::set already_seen; - if (!imports_in_descriptor_set_) { - // Since we don't want to output transitive dependencies, but we do want - // things to be in dependency order, add all dependencies that aren't in - // parsed_files to already_seen. This will short circuit the recursion - // in GetTransitiveDependencies. - std::set to_output; - to_output.insert(parsed_files.begin(), parsed_files.end()); - for (int i = 0; i < parsed_files.size(); i++) { - const FileDescriptor* file = parsed_files[i]; - for (int j = 0; j < file->dependency_count(); j++) { - const FileDescriptor* dependency = file->dependency(j); - // if the dependency isn't in parsed files, mark it as already seen - if (to_output.find(dependency) == to_output.end()) { - already_seen.insert(dependency); - } - } - } - } - for (int i = 0; i < parsed_files.size(); i++) { - GetTransitiveDependencies(parsed_files[i], - true, // Include json_name - source_info_in_descriptor_set_, &already_seen, - file_set.mutable_file()); - } - - int fd; - do { - fd = open(descriptor_set_out_name_.c_str(), - O_WRONLY | O_CREAT | O_TRUNC | O_BINARY, 0666); - } while (fd < 0 && errno == EINTR); - - if (fd < 0) { - perror(descriptor_set_out_name_.c_str()); - return false; - } - - io::FileOutputStream out(fd); - - { - io::CodedOutputStream coded_out(&out); - // Determinism is useful here because build outputs are sometimes checked - // into version control. - coded_out.SetSerializationDeterministic(true); - if (!file_set.SerializeToCodedStream(&coded_out)) { - std::cerr << descriptor_set_out_name_ << ": " << strerror(out.GetErrno()) - << std::endl; - out.Close(); - return false; - } - } - - if (!out.Close()) { - std::cerr << descriptor_set_out_name_ << ": " << strerror(out.GetErrno()) - << std::endl; - return false; - } - - return true; -} - -void CommandLineInterface::GetTransitiveDependencies( - const FileDescriptor* file, bool include_json_name, - bool include_source_code_info, - std::set* already_seen, - RepeatedPtrField* output) { - if (!already_seen->insert(file).second) { - // Already saw this file. Skip. - return; - } - - // Add all dependencies. - for (int i = 0; i < file->dependency_count(); i++) { - GetTransitiveDependencies(file->dependency(i), include_json_name, - include_source_code_info, already_seen, output); - } - - // Add this file. - FileDescriptorProto* new_descriptor = output->Add(); - file->CopyTo(new_descriptor); - if (include_json_name) { - file->CopyJsonNameTo(new_descriptor); - } - if (include_source_code_info) { - file->CopySourceCodeInfoTo(new_descriptor); - } -} - -namespace { - -// Utility function for PrintFreeFieldNumbers. -// Stores occupied ranges into the ranges parameter, and next level of sub -// message types into the nested_messages parameter. The FieldRange is left -// inclusive, right exclusive. i.e. [a, b). -// -// Nested Messages: -// Note that it only stores the nested message type, iff the nested type is -// either a direct child of the given descriptor, or the nested type is a -// descendant of the given descriptor and all the nodes between the -// nested type and the given descriptor are group types. e.g. -// -// message Foo { -// message Bar { -// message NestedBar {} -// } -// group Baz = 1 { -// group NestedBazGroup = 2 { -// message Quz { -// message NestedQuz {} -// } -// } -// message NestedBaz {} -// } -// } -// -// In this case, Bar, Quz and NestedBaz will be added into the nested types. -// Since free field numbers of group types will not be printed, this makes sure -// the nested message types in groups will not be dropped. The nested_messages -// parameter will contain the direct children (when groups are ignored in the -// tree) of the given descriptor for the caller to traverse. The declaration -// order of the nested messages is also preserved. -typedef std::pair FieldRange; -void GatherOccupiedFieldRanges( - const Descriptor* descriptor, std::set* ranges, - std::vector* nested_messages) { - std::set groups; - for (int i = 0; i < descriptor->field_count(); ++i) { - const FieldDescriptor* fd = descriptor->field(i); - ranges->insert(FieldRange(fd->number(), fd->number() + 1)); - if (fd->type() == FieldDescriptor::TYPE_GROUP) { - groups.insert(fd->message_type()); - } - } - for (int i = 0; i < descriptor->extension_range_count(); ++i) { - ranges->insert(FieldRange(descriptor->extension_range(i)->start, - descriptor->extension_range(i)->end)); - } - for (int i = 0; i < descriptor->reserved_range_count(); ++i) { - ranges->insert(FieldRange(descriptor->reserved_range(i)->start, - descriptor->reserved_range(i)->end)); - } - // Handle the nested messages/groups in declaration order to make it - // post-order strict. - for (int i = 0; i < descriptor->nested_type_count(); ++i) { - const Descriptor* nested_desc = descriptor->nested_type(i); - if (groups.find(nested_desc) != groups.end()) { - GatherOccupiedFieldRanges(nested_desc, ranges, nested_messages); - } else { - nested_messages->push_back(nested_desc); - } - } -} - -// Utility function for PrintFreeFieldNumbers. -// Actually prints the formatted free field numbers for given message name and -// occupied ranges. -void FormatFreeFieldNumbers(const std::string& name, - const std::set& ranges) { - std::string output; - StringAppendF(&output, "%-35s free:", name.c_str()); - int next_free_number = 1; - for (std::set::const_iterator i = ranges.begin(); - i != ranges.end(); ++i) { - // This happens when groups re-use parent field numbers, in which - // case we skip the FieldRange entirely. - if (next_free_number >= i->second) continue; - - if (next_free_number < i->first) { - if (next_free_number + 1 == i->first) { - // Singleton - StringAppendF(&output, " %d", next_free_number); - } else { - // Range - StringAppendF(&output, " %d-%d", next_free_number, i->first - 1); - } - } - next_free_number = i->second; - } - if (next_free_number <= FieldDescriptor::kMaxNumber) { - StringAppendF(&output, " %d-INF", next_free_number); - } - std::cout << output << std::endl; -} - -} // namespace - -void CommandLineInterface::PrintFreeFieldNumbers(const Descriptor* descriptor) { - std::set ranges; - std::vector nested_messages; - GatherOccupiedFieldRanges(descriptor, &ranges, &nested_messages); - - for (int i = 0; i < nested_messages.size(); ++i) { - PrintFreeFieldNumbers(nested_messages[i]); - } - FormatFreeFieldNumbers(descriptor->full_name(), ranges); -} - - -} // namespace compiler -} // namespace protobuf -} // namespace google diff --git a/extra/protobuf/protobuf-3.19.4/src/google/protobuf/compiler/command_line_interface.h b/extra/protobuf/protobuf-3.19.4/src/google/protobuf/compiler/command_line_interface.h deleted file mode 100644 index 27178b1beeca..000000000000 --- a/extra/protobuf/protobuf-3.19.4/src/google/protobuf/compiler/command_line_interface.h +++ /dev/null @@ -1,462 +0,0 @@ -// Protocol Buffers - Google's data interchange format -// Copyright 2008 Google Inc. All rights reserved. -// https://developers.google.com/protocol-buffers/ -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// * Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// * Redistributions in binary form must reproduce the above -// copyright notice, this list of conditions and the following disclaimer -// in the documentation and/or other materials provided with the -// distribution. -// * Neither the name of Google Inc. nor the names of its -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -// Author: kenton@google.com (Kenton Varda) -// Based on original Protocol Buffers design by -// Sanjay Ghemawat, Jeff Dean, and others. -// -// Implements the Protocol Compiler front-end such that it may be reused by -// custom compilers written to support other languages. - -#ifndef GOOGLE_PROTOBUF_COMPILER_COMMAND_LINE_INTERFACE_H__ -#define GOOGLE_PROTOBUF_COMPILER_COMMAND_LINE_INTERFACE_H__ - -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#include -#include - -namespace google { -namespace protobuf { - -class Descriptor; // descriptor.h -class DescriptorDatabase; // descriptor_database.h -class DescriptorPool; // descriptor.h -class FileDescriptor; // descriptor.h -class FileDescriptorSet; // descriptor.h -class FileDescriptorProto; // descriptor.pb.h -template -class RepeatedPtrField; // repeated_field.h -class SimpleDescriptorDatabase; // descriptor_database.h - -namespace compiler { - -class CodeGenerator; // code_generator.h -class GeneratorContext; // code_generator.h -class DiskSourceTree; // importer.h - -// This class implements the command-line interface to the protocol compiler. -// It is designed to make it very easy to create a custom protocol compiler -// supporting the languages of your choice. For example, if you wanted to -// create a custom protocol compiler binary which includes both the regular -// C++ support plus support for your own custom output "Foo", you would -// write a class "FooGenerator" which implements the CodeGenerator interface, -// then write a main() procedure like this: -// -// int main(int argc, char* argv[]) { -// google::protobuf::compiler::CommandLineInterface cli; -// -// // Support generation of C++ source and headers. -// google::protobuf::compiler::cpp::CppGenerator cpp_generator; -// cli.RegisterGenerator("--cpp_out", &cpp_generator, -// "Generate C++ source and header."); -// -// // Support generation of Foo code. -// FooGenerator foo_generator; -// cli.RegisterGenerator("--foo_out", &foo_generator, -// "Generate Foo file."); -// -// return cli.Run(argc, argv); -// } -// -// The compiler is invoked with syntax like: -// protoc --cpp_out=outdir --foo_out=outdir --proto_path=src src/foo.proto -// -// The .proto file to compile can be specified on the command line using either -// its physical file path, or a virtual path relative to a directory specified -// in --proto_path. For example, for src/foo.proto, the following two protoc -// invocations work the same way: -// 1. protoc --proto_path=src src/foo.proto (physical file path) -// 2. protoc --proto_path=src foo.proto (virtual path relative to src) -// -// If a file path can be interpreted both as a physical file path and as a -// relative virtual path, the physical file path takes precedence. -// -// For a full description of the command-line syntax, invoke it with --help. -class PROTOC_EXPORT CommandLineInterface { - public: - static const char* const kPathSeparator; - - CommandLineInterface(); - ~CommandLineInterface(); - - // Register a code generator for a language. - // - // Parameters: - // * flag_name: The command-line flag used to specify an output file of - // this type. The name must start with a '-'. If the name is longer - // than one letter, it must start with two '-'s. - // * generator: The CodeGenerator which will be called to generate files - // of this type. - // * help_text: Text describing this flag in the --help output. - // - // Some generators accept extra parameters. You can specify this parameter - // on the command-line by placing it before the output directory, separated - // by a colon: - // protoc --foo_out=enable_bar:outdir - // The text before the colon is passed to CodeGenerator::Generate() as the - // "parameter". - void RegisterGenerator(const std::string& flag_name, CodeGenerator* generator, - const std::string& help_text); - - // Register a code generator for a language. - // Besides flag_name you can specify another option_flag_name that could be - // used to pass extra parameters to the registered code generator. - // Suppose you have registered a generator by calling: - // command_line_interface.RegisterGenerator("--foo_out", "--foo_opt", ...) - // Then you could invoke the compiler with a command like: - // protoc --foo_out=enable_bar:outdir --foo_opt=enable_baz - // This will pass "enable_bar,enable_baz" as the parameter to the generator. - void RegisterGenerator(const std::string& flag_name, - const std::string& option_flag_name, - CodeGenerator* generator, - const std::string& help_text); - - // Enables "plugins". In this mode, if a command-line flag ends with "_out" - // but does not match any registered generator, the compiler will attempt to - // find a "plugin" to implement the generator. Plugins are just executables. - // They should live somewhere in the PATH. - // - // The compiler determines the executable name to search for by concatenating - // exe_name_prefix with the unrecognized flag name, removing "_out". So, for - // example, if exe_name_prefix is "protoc-" and you pass the flag --foo_out, - // the compiler will try to run the program "protoc-gen-foo". - // - // The plugin program should implement the following usage: - // plugin [--out=OUTDIR] [--parameter=PARAMETER] PROTO_FILES < DESCRIPTORS - // --out indicates the output directory (as passed to the --foo_out - // parameter); if omitted, the current directory should be used. --parameter - // gives the generator parameter, if any was provided (see below). The - // PROTO_FILES list the .proto files which were given on the compiler - // command-line; these are the files for which the plugin is expected to - // generate output code. Finally, DESCRIPTORS is an encoded FileDescriptorSet - // (as defined in descriptor.proto). This is piped to the plugin's stdin. - // The set will include descriptors for all the files listed in PROTO_FILES as - // well as all files that they import. The plugin MUST NOT attempt to read - // the PROTO_FILES directly -- it must use the FileDescriptorSet. - // - // The plugin should generate whatever files are necessary, as code generators - // normally do. It should write the names of all files it generates to - // stdout. The names should be relative to the output directory, NOT absolute - // names or relative to the current directory. If any errors occur, error - // messages should be written to stderr. If an error is fatal, the plugin - // should exit with a non-zero exit code. - // - // Plugins can have generator parameters similar to normal built-in - // generators. Extra generator parameters can be passed in via a matching - // "_opt" parameter. For example: - // protoc --plug_out=enable_bar:outdir --plug_opt=enable_baz - // This will pass "enable_bar,enable_baz" as the parameter to the plugin. - // - void AllowPlugins(const std::string& exe_name_prefix); - - // Run the Protocol Compiler with the given command-line parameters. - // Returns the error code which should be returned by main(). - // - // It may not be safe to call Run() in a multi-threaded environment because - // it calls strerror(). I'm not sure why you'd want to do this anyway. - int Run(int argc, const char* const argv[]); - - // DEPRECATED. Calling this method has no effect. Protocol compiler now - // always try to find the .proto file relative to the current directory - // first and if the file is not found, it will then treat the input path - // as a virtual path. - void SetInputsAreProtoPathRelative(bool /* enable */) {} - - // Provides some text which will be printed when the --version flag is - // used. The version of libprotoc will also be printed on the next line - // after this text. - void SetVersionInfo(const std::string& text) { version_info_ = text; } - - - private: - // ----------------------------------------------------------------- - - class ErrorPrinter; - class GeneratorContextImpl; - class MemoryOutputStream; - typedef std::unordered_map> - GeneratorContextMap; - - // Clear state from previous Run(). - void Clear(); - - // Remaps the proto file so that it is relative to one of the directories - // in proto_path_. Returns false if an error occurred. - bool MakeProtoProtoPathRelative(DiskSourceTree* source_tree, - std::string* proto, - DescriptorDatabase* fallback_database); - - // Remaps each file in input_files_ so that it is relative to one of the - // directories in proto_path_. Returns false if an error occurred. - bool MakeInputsBeProtoPathRelative(DiskSourceTree* source_tree, - DescriptorDatabase* fallback_database); - - // Fails if these files use proto3 optional and the code generator doesn't - // support it. This is a permanent check. - bool EnforceProto3OptionalSupport( - const std::string& codegen_name, uint64_t supported_features, - const std::vector& parsed_files) const; - - - // Return status for ParseArguments() and InterpretArgument(). - enum ParseArgumentStatus { - PARSE_ARGUMENT_DONE_AND_CONTINUE, - PARSE_ARGUMENT_DONE_AND_EXIT, - PARSE_ARGUMENT_FAIL - }; - - // Parse all command-line arguments. - ParseArgumentStatus ParseArguments(int argc, const char* const argv[]); - - // Read an argument file and append the file's content to the list of - // arguments. Return false if the file cannot be read. - bool ExpandArgumentFile(const std::string& file, - std::vector* arguments); - - // Parses a command-line argument into a name/value pair. Returns - // true if the next argument in the argv should be used as the value, - // false otherwise. - // - // Examples: - // "-Isrc/protos" -> - // name = "-I", value = "src/protos" - // "--cpp_out=src/foo.pb2.cc" -> - // name = "--cpp_out", value = "src/foo.pb2.cc" - // "foo.proto" -> - // name = "", value = "foo.proto" - bool ParseArgument(const char* arg, std::string* name, std::string* value); - - // Interprets arguments parsed with ParseArgument. - ParseArgumentStatus InterpretArgument(const std::string& name, - const std::string& value); - - // Print the --help text to stderr. - void PrintHelpText(); - - // Loads proto_path_ into the provided source_tree. - bool InitializeDiskSourceTree(DiskSourceTree* source_tree, - DescriptorDatabase* fallback_database); - - // Verify that all the input files exist in the given database. - bool VerifyInputFilesInDescriptors(DescriptorDatabase* fallback_database); - - // Parses input_files_ into parsed_files - bool ParseInputFiles(DescriptorPool* descriptor_pool, - DiskSourceTree* source_tree, - std::vector* parsed_files); - - // Generate the given output file from the given input. - struct OutputDirective; // see below - bool GenerateOutput(const std::vector& parsed_files, - const OutputDirective& output_directive, - GeneratorContext* generator_context); - bool GeneratePluginOutput( - const std::vector& parsed_files, - const std::string& plugin_name, const std::string& parameter, - GeneratorContext* generator_context, std::string* error); - - // Implements --encode and --decode. - bool EncodeOrDecode(const DescriptorPool* pool); - - // Implements the --descriptor_set_out option. - bool WriteDescriptorSet( - const std::vector& parsed_files); - - // Implements the --dependency_out option - bool GenerateDependencyManifestFile( - const std::vector& parsed_files, - const GeneratorContextMap& output_directories, - DiskSourceTree* source_tree); - - // Get all transitive dependencies of the given file (including the file - // itself), adding them to the given list of FileDescriptorProtos. The - // protos will be ordered such that every file is listed before any file that - // depends on it, so that you can call DescriptorPool::BuildFile() on them - // in order. Any files in *already_seen will not be added, and each file - // added will be inserted into *already_seen. If include_source_code_info is - // true then include the source code information in the FileDescriptorProtos. - // If include_json_name is true, populate the json_name field of - // FieldDescriptorProto for all fields. - static void GetTransitiveDependencies( - const FileDescriptor* file, bool include_json_name, - bool include_source_code_info, - std::set* already_seen, - RepeatedPtrField* output); - - // Implements the --print_free_field_numbers. This function prints free field - // numbers into stdout for the message and it's nested message types in - // post-order, i.e. nested types first. Printed range are left-right - // inclusive, i.e. [a, b]. - // - // Groups: - // For historical reasons, groups are considered to share the same - // field number space with the parent message, thus it will not print free - // field numbers for groups. The field numbers used in the groups are - // excluded in the free field numbers of the parent message. - // - // Extension Ranges: - // Extension ranges are considered ocuppied field numbers and they will not be - // listed as free numbers in the output. - void PrintFreeFieldNumbers(const Descriptor* descriptor); - - // ----------------------------------------------------------------- - - // The name of the executable as invoked (i.e. argv[0]). - std::string executable_name_; - - // Version info set with SetVersionInfo(). - std::string version_info_; - - // Registered generators. - struct GeneratorInfo { - std::string flag_name; - std::string option_flag_name; - CodeGenerator* generator; - std::string help_text; - }; - typedef std::map GeneratorMap; - GeneratorMap generators_by_flag_name_; - GeneratorMap generators_by_option_name_; - // A map from generator names to the parameters specified using the option - // flag. For example, if the user invokes the compiler with: - // protoc --foo_out=outputdir --foo_opt=enable_bar ... - // Then there will be an entry ("--foo_out", "enable_bar") in this map. - std::map generator_parameters_; - // Similar to generator_parameters_, but stores the parameters for plugins. - std::map plugin_parameters_; - - // See AllowPlugins(). If this is empty, plugins aren't allowed. - std::string plugin_prefix_; - - // Maps specific plugin names to files. When executing a plugin, this map - // is searched first to find the plugin executable. If not found here, the - // PATH (or other OS-specific search strategy) is searched. - std::map plugins_; - - // Stuff parsed from command line. - enum Mode { - MODE_COMPILE, // Normal mode: parse .proto files and compile them. - MODE_ENCODE, // --encode: read text from stdin, write binary to stdout. - MODE_DECODE, // --decode: read binary from stdin, write text to stdout. - MODE_PRINT, // Print mode: print info of the given .proto files and exit. - }; - - Mode mode_ = MODE_COMPILE; - - enum PrintMode { - PRINT_NONE, // Not in MODE_PRINT - PRINT_FREE_FIELDS, // --print_free_fields - }; - - PrintMode print_mode_ = PRINT_NONE; - - enum ErrorFormat { - ERROR_FORMAT_GCC, // GCC error output format (default). - ERROR_FORMAT_MSVS // Visual Studio output (--error_format=msvs). - }; - - ErrorFormat error_format_ = ERROR_FORMAT_GCC; - - // True if we should treat warnings as errors that fail the compilation. - bool fatal_warnings_ = false; - - std::vector > - proto_path_; // Search path for proto files. - std::vector input_files_; // Names of the input proto files. - - // Names of proto files which are allowed to be imported. Used by build - // systems to enforce depend-on-what-you-import. - std::set direct_dependencies_; - bool direct_dependencies_explicitly_set_ = false; - - // If there's a violation of depend-on-what-you-import, this string will be - // presented to the user. "%s" will be replaced with the violating import. - std::string direct_dependencies_violation_msg_; - - // output_directives_ lists all the files we are supposed to output and what - // generator to use for each. - struct OutputDirective { - std::string name; // E.g. "--foo_out" - CodeGenerator* generator; // NULL for plugins - std::string parameter; - std::string output_location; - }; - std::vector output_directives_; - - // When using --encode or --decode, this names the type we are encoding or - // decoding. (Empty string indicates --decode_raw.) - std::string codec_type_; - - // If --descriptor_set_in was given, these are filenames containing - // parsed FileDescriptorSets to be used for loading protos. Otherwise, empty. - std::vector descriptor_set_in_names_; - - // If --descriptor_set_out was given, this is the filename to which the - // FileDescriptorSet should be written. Otherwise, empty. - std::string descriptor_set_out_name_; - - // If --dependency_out was given, this is the path to the file where the - // dependency file will be written. Otherwise, empty. - std::string dependency_out_name_; - - // True if --include_imports was given, meaning that we should - // write all transitive dependencies to the DescriptorSet. Otherwise, only - // the .proto files listed on the command-line are added. - bool imports_in_descriptor_set_; - - // True if --include_source_info was given, meaning that we should not strip - // SourceCodeInfo from the DescriptorSet. - bool source_info_in_descriptor_set_ = false; - - // Was the --disallow_services flag used? - bool disallow_services_ = false; - - // When using --encode, this will be passed to SetSerializationDeterministic. - bool deterministic_output_ = false; - - GOOGLE_DISALLOW_EVIL_CONSTRUCTORS(CommandLineInterface); -}; - -} // namespace compiler -} // namespace protobuf -} // namespace google - -#include - -#endif // GOOGLE_PROTOBUF_COMPILER_COMMAND_LINE_INTERFACE_H__ diff --git a/extra/protobuf/protobuf-3.19.4/src/google/protobuf/compiler/command_line_interface_unittest.cc b/extra/protobuf/protobuf-3.19.4/src/google/protobuf/compiler/command_line_interface_unittest.cc deleted file mode 100644 index 9cc8cf98c7cb..000000000000 --- a/extra/protobuf/protobuf-3.19.4/src/google/protobuf/compiler/command_line_interface_unittest.cc +++ /dev/null @@ -1,2760 +0,0 @@ -// Protocol Buffers - Google's data interchange format -// Copyright 2008 Google Inc. All rights reserved. -// https://developers.google.com/protocol-buffers/ -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// * Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// * Redistributions in binary form must reproduce the above -// copyright notice, this list of conditions and the following disclaimer -// in the documentation and/or other materials provided with the -// distribution. -// * Neither the name of Google Inc. nor the names of its -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -// Author: kenton@google.com (Kenton Varda) -// Based on original Protocol Buffers design by -// Sanjay Ghemawat, Jeff Dean, and others. - -#include -#include -#include - -#include - -#ifndef _MSC_VER -#include -#endif -#include -#include -#include - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - - -namespace google { -namespace protobuf { -namespace compiler { - -#if defined(_WIN32) -// DO NOT include , instead create functions in io_win32.{h,cc} and import -// them like we do below. -using google::protobuf::io::win32::access; -using google::protobuf::io::win32::close; -using google::protobuf::io::win32::dup; -using google::protobuf::io::win32::dup2; -using google::protobuf::io::win32::open; -using google::protobuf::io::win32::write; -#endif - -// Disable the whole test when we use tcmalloc for "draconian" heap checks, in -// which case tcmalloc will print warnings that fail the plugin tests. -#if !GOOGLE_PROTOBUF_HEAP_CHECK_DRACONIAN - - -namespace { - -bool FileExists(const std::string& path) { - return File::Exists(path); -} - -class CommandLineInterfaceTest : public testing::Test { - protected: - virtual void SetUp(); - virtual void TearDown(); - - // Runs the CommandLineInterface with the given command line. The - // command is automatically split on spaces, and the string "$tmpdir" - // is replaced with TestTempDir(). - void Run(const std::string& command); - void RunWithArgs(std::vector args); - - // ----------------------------------------------------------------- - // Methods to set up the test (called before Run()). - - class NullCodeGenerator; - - // Normally plugins are allowed for all tests. Call this to explicitly - // disable them. - void DisallowPlugins() { disallow_plugins_ = true; } - - // Create a temp file within temp_directory_ with the given name. - // The containing directory is also created if necessary. - void CreateTempFile(const std::string& name, const std::string& contents); - - // Create a subdirectory within temp_directory_. - void CreateTempDir(const std::string& name); - -#ifdef PROTOBUF_OPENSOURCE - // Change working directory to temp directory. - void SwitchToTempDirectory() { - File::ChangeWorkingDirectory(temp_directory_); - } -#else // !PROTOBUF_OPENSOURCE - // TODO(teboring): Figure out how to change and get working directory in - // google3. -#endif // !PROTOBUF_OPENSOURCE - - // ----------------------------------------------------------------- - // Methods to check the test results (called after Run()). - - // Checks that no text was written to stderr during Run(), and Run() - // returned 0. - void ExpectNoErrors(); - - // Checks that Run() returned non-zero and the stderr output is exactly - // the text given. expected_test may contain references to "$tmpdir", - // which will be replaced by the temporary directory path. - void ExpectErrorText(const std::string& expected_text); - - // Checks that Run() returned non-zero and the stderr contains the given - // substring. - void ExpectErrorSubstring(const std::string& expected_substring); - - // Checks that Run() returned zero and the stderr contains the given - // substring. - void ExpectWarningSubstring(const std::string& expected_substring); - - // Checks that the captured stdout is the same as the expected_text. - void ExpectCapturedStdout(const std::string& expected_text); - - // Checks that Run() returned zero and the stdout contains the given - // substring. - void ExpectCapturedStdoutSubstringWithZeroReturnCode( - const std::string& expected_substring); - - // Checks that Run() returned zero and the stderr contains the given - // substring. - void ExpectCapturedStderrSubstringWithZeroReturnCode( - const std::string& expected_substring); - -#if defined(_WIN32) && !defined(__CYGWIN__) - // Returns true if ExpectErrorSubstring(expected_substring) would pass, but - // does not fail otherwise. - bool HasAlternateErrorSubstring(const std::string& expected_substring); -#endif // _WIN32 && !__CYGWIN__ - - // Checks that MockCodeGenerator::Generate() was called in the given - // context (or the generator in test_plugin.cc, which produces the same - // output). That is, this tests if the generator with the given name - // was called with the given parameter and proto file and produced the - // given output file. This is checked by reading the output file and - // checking that it contains the content that MockCodeGenerator would - // generate given these inputs. message_name is the name of the first - // message that appeared in the proto file; this is just to make extra - // sure that the correct file was parsed. - void ExpectGenerated(const std::string& generator_name, - const std::string& parameter, - const std::string& proto_name, - const std::string& message_name); - void ExpectGenerated(const std::string& generator_name, - const std::string& parameter, - const std::string& proto_name, - const std::string& message_name, - const std::string& output_directory); - void ExpectGeneratedWithMultipleInputs(const std::string& generator_name, - const std::string& all_proto_names, - const std::string& proto_name, - const std::string& message_name); - void ExpectGeneratedWithInsertions(const std::string& generator_name, - const std::string& parameter, - const std::string& insertions, - const std::string& proto_name, - const std::string& message_name); - void CheckGeneratedAnnotations(const std::string& name, - const std::string& file); - -#if defined(_WIN32) - void ExpectNullCodeGeneratorCalled(const std::string& parameter); -#endif // _WIN32 - - - void ReadDescriptorSet(const std::string& filename, - FileDescriptorSet* descriptor_set); - - void WriteDescriptorSet(const std::string& filename, - const FileDescriptorSet* descriptor_set); - - void ExpectFileContent(const std::string& filename, - const std::string& content); - - // The default code generators support all features. Use this to create a - // code generator that omits the given feature(s). - void CreateGeneratorWithMissingFeatures(const std::string& name, - const std::string& description, - uint64_t features) { - MockCodeGenerator* generator = new MockCodeGenerator(name); - generator->SuppressFeatures(features); - mock_generators_to_delete_.push_back(generator); - cli_.RegisterGenerator(name, generator, description); - } - - private: - // The object we are testing. - CommandLineInterface cli_; - - // Was DisallowPlugins() called? - bool disallow_plugins_; - - // We create a directory within TestTempDir() in order to add extra - // protection against accidentally deleting user files (since we recursively - // delete this directory during the test). This is the full path of that - // directory. - std::string temp_directory_; - - // The result of Run(). - int return_code_; - - // The captured stderr output. - std::string error_text_; - - // The captured stdout. - std::string captured_stdout_; - - // Pointers which need to be deleted later. - std::vector mock_generators_to_delete_; - - NullCodeGenerator* null_generator_; -}; - -class CommandLineInterfaceTest::NullCodeGenerator : public CodeGenerator { - public: - NullCodeGenerator() : called_(false) {} - ~NullCodeGenerator() {} - - mutable bool called_; - mutable std::string parameter_; - - // implements CodeGenerator ---------------------------------------- - bool Generate(const FileDescriptor* file, const std::string& parameter, - GeneratorContext* context, std::string* error) const { - called_ = true; - parameter_ = parameter; - return true; - } -}; - -// =================================================================== - -void CommandLineInterfaceTest::SetUp() { - temp_directory_ = TestTempDir() + "/proto2_cli_test_temp"; - - // If the temp directory already exists, it must be left over from a - // previous run. Delete it. - if (FileExists(temp_directory_)) { - File::DeleteRecursively(temp_directory_, NULL, NULL); - } - - // Create the temp directory. - GOOGLE_CHECK_OK(File::CreateDir(temp_directory_, 0777)); - - // Register generators. - CodeGenerator* generator = new MockCodeGenerator("test_generator"); - mock_generators_to_delete_.push_back(generator); - cli_.RegisterGenerator("--test_out", "--test_opt", generator, "Test output."); - cli_.RegisterGenerator("-t", generator, "Test output."); - - generator = new MockCodeGenerator("alt_generator"); - mock_generators_to_delete_.push_back(generator); - cli_.RegisterGenerator("--alt_out", generator, "Alt output."); - - generator = null_generator_ = new NullCodeGenerator(); - mock_generators_to_delete_.push_back(generator); - cli_.RegisterGenerator("--null_out", generator, "Null output."); - - - disallow_plugins_ = false; -} - -void CommandLineInterfaceTest::TearDown() { - // Delete the temp directory. - if (FileExists(temp_directory_)) { - File::DeleteRecursively(temp_directory_, NULL, NULL); - } - - // Delete all the MockCodeGenerators. - for (int i = 0; i < mock_generators_to_delete_.size(); i++) { - delete mock_generators_to_delete_[i]; - } - mock_generators_to_delete_.clear(); -} - -void CommandLineInterfaceTest::Run(const std::string& command) { - RunWithArgs(Split(command, " ", true)); -} - -void CommandLineInterfaceTest::RunWithArgs(std::vector args) { - if (!disallow_plugins_) { - cli_.AllowPlugins("prefix-"); - std::string plugin_path; -#ifdef GOOGLE_PROTOBUF_TEST_PLUGIN_PATH - plugin_path = GOOGLE_PROTOBUF_TEST_PLUGIN_PATH; -#else - const char* possible_paths[] = { - // When building with shared libraries, libtool hides the real - // executable - // in .libs and puts a fake wrapper in the current directory. - // Unfortunately, due to an apparent bug on Cygwin/MinGW, if one program - // wrapped in this way (e.g. protobuf-tests.exe) tries to execute - // another - // program wrapped in this way (e.g. test_plugin.exe), the latter fails - // with error code 127 and no explanation message. Presumably the - // problem - // is that the wrapper for protobuf-tests.exe set some environment - // variables that confuse the wrapper for test_plugin.exe. Luckily, it - // turns out that if we simply invoke the wrapped test_plugin.exe - // directly, it works -- I guess the environment variables set by the - // protobuf-tests.exe wrapper happen to be correct for it too. So we do - // that. - ".libs/test_plugin.exe", // Win32 w/autotool (Cygwin / MinGW) - "test_plugin.exe", // Other Win32 (MSVC) - "test_plugin", // Unix - }; - for (int i = 0; i < GOOGLE_ARRAYSIZE(possible_paths); i++) { - if (access(possible_paths[i], F_OK) == 0) { - plugin_path = possible_paths[i]; - break; - } - } -#endif - - if (plugin_path.empty()) { - GOOGLE_LOG(ERROR) - << "Plugin executable not found. Plugin tests are likely to fail."; - } else { - args.push_back("--plugin=prefix-gen-plug=" + plugin_path); - } - } - - std::unique_ptr argv(new const char*[args.size()]); - - for (int i = 0; i < args.size(); i++) { - args[i] = StringReplace(args[i], "$tmpdir", temp_directory_, true); - argv[i] = args[i].c_str(); - } - - // TODO(jieluo): Cygwin doesn't work well if we try to capture stderr and - // stdout at the same time. Need to figure out why and add this capture back - // for Cygwin. -#if !defined(__CYGWIN__) - CaptureTestStdout(); -#endif - CaptureTestStderr(); - - return_code_ = cli_.Run(args.size(), argv.get()); - - error_text_ = GetCapturedTestStderr(); -#if !defined(__CYGWIN__) - captured_stdout_ = GetCapturedTestStdout(); -#endif -} - -// ------------------------------------------------------------------- - -void CommandLineInterfaceTest::CreateTempFile(const std::string& name, - const std::string& contents) { - // Create parent directory, if necessary. - std::string::size_type slash_pos = name.find_last_of('/'); - if (slash_pos != std::string::npos) { - std::string dir = name.substr(0, slash_pos); - if (!FileExists(temp_directory_ + "/" + dir)) { - GOOGLE_CHECK_OK(File::RecursivelyCreateDir(temp_directory_ + "/" + dir, - 0777)); - } - } - - // Write file. - std::string full_name = temp_directory_ + "/" + name; - GOOGLE_CHECK_OK(File::SetContents( - full_name, StringReplace(contents, "$tmpdir", temp_directory_, true), - true)); -} - -void CommandLineInterfaceTest::CreateTempDir(const std::string& name) { - GOOGLE_CHECK_OK(File::RecursivelyCreateDir(temp_directory_ + "/" + name, - 0777)); -} - -// ------------------------------------------------------------------- - -void CommandLineInterfaceTest::ExpectNoErrors() { - EXPECT_EQ(0, return_code_); - EXPECT_EQ("", error_text_); -} - -void CommandLineInterfaceTest::ExpectErrorText( - const std::string& expected_text) { - EXPECT_NE(0, return_code_); - EXPECT_EQ(StringReplace(expected_text, "$tmpdir", temp_directory_, true), - error_text_); -} - -void CommandLineInterfaceTest::ExpectErrorSubstring( - const std::string& expected_substring) { - EXPECT_NE(0, return_code_); - EXPECT_PRED_FORMAT2(testing::IsSubstring, expected_substring, error_text_); -} - -void CommandLineInterfaceTest::ExpectWarningSubstring( - const std::string& expected_substring) { - EXPECT_PRED_FORMAT2(testing::IsSubstring, expected_substring, error_text_); - EXPECT_EQ(0, return_code_); -} - -#if defined(_WIN32) && !defined(__CYGWIN__) -bool CommandLineInterfaceTest::HasAlternateErrorSubstring( - const std::string& expected_substring) { - EXPECT_NE(0, return_code_); - return error_text_.find(expected_substring) != std::string::npos; -} -#endif // _WIN32 && !__CYGWIN__ - -void CommandLineInterfaceTest::ExpectGenerated( - const std::string& generator_name, const std::string& parameter, - const std::string& proto_name, const std::string& message_name) { - MockCodeGenerator::ExpectGenerated(generator_name, parameter, "", proto_name, - message_name, proto_name, temp_directory_); -} - -void CommandLineInterfaceTest::ExpectGenerated( - const std::string& generator_name, const std::string& parameter, - const std::string& proto_name, const std::string& message_name, - const std::string& output_directory) { - MockCodeGenerator::ExpectGenerated(generator_name, parameter, "", proto_name, - message_name, proto_name, - temp_directory_ + "/" + output_directory); -} - -void CommandLineInterfaceTest::ExpectGeneratedWithMultipleInputs( - const std::string& generator_name, const std::string& all_proto_names, - const std::string& proto_name, const std::string& message_name) { - MockCodeGenerator::ExpectGenerated(generator_name, "", "", proto_name, - message_name, all_proto_names, - temp_directory_); -} - -void CommandLineInterfaceTest::ExpectGeneratedWithInsertions( - const std::string& generator_name, const std::string& parameter, - const std::string& insertions, const std::string& proto_name, - const std::string& message_name) { - MockCodeGenerator::ExpectGenerated(generator_name, parameter, insertions, - proto_name, message_name, proto_name, - temp_directory_); -} - -void CommandLineInterfaceTest::CheckGeneratedAnnotations( - const std::string& name, const std::string& file) { - MockCodeGenerator::CheckGeneratedAnnotations(name, file, temp_directory_); -} - -#if defined(_WIN32) -void CommandLineInterfaceTest::ExpectNullCodeGeneratorCalled( - const std::string& parameter) { - EXPECT_TRUE(null_generator_->called_); - EXPECT_EQ(parameter, null_generator_->parameter_); -} -#endif // _WIN32 - - -void CommandLineInterfaceTest::ReadDescriptorSet( - const std::string& filename, FileDescriptorSet* descriptor_set) { - std::string path = temp_directory_ + "/" + filename; - std::string file_contents; - GOOGLE_CHECK_OK(File::GetContents(path, &file_contents, true)); - - if (!descriptor_set->ParseFromString(file_contents)) { - FAIL() << "Could not parse file contents: " << path; - } -} - -void CommandLineInterfaceTest::WriteDescriptorSet( - const std::string& filename, const FileDescriptorSet* descriptor_set) { - std::string binary_proto; - GOOGLE_CHECK(descriptor_set->SerializeToString(&binary_proto)); - CreateTempFile(filename, binary_proto); -} - -void CommandLineInterfaceTest::ExpectCapturedStdout( - const std::string& expected_text) { - EXPECT_EQ(expected_text, captured_stdout_); -} - -void CommandLineInterfaceTest::ExpectCapturedStdoutSubstringWithZeroReturnCode( - const std::string& expected_substring) { - EXPECT_EQ(0, return_code_); - EXPECT_PRED_FORMAT2(testing::IsSubstring, expected_substring, - captured_stdout_); -} - -void CommandLineInterfaceTest::ExpectCapturedStderrSubstringWithZeroReturnCode( - const std::string& expected_substring) { - EXPECT_EQ(0, return_code_); - EXPECT_PRED_FORMAT2(testing::IsSubstring, expected_substring, error_text_); -} - -void CommandLineInterfaceTest::ExpectFileContent(const std::string& filename, - const std::string& content) { - std::string path = temp_directory_ + "/" + filename; - std::string file_contents; - GOOGLE_CHECK_OK(File::GetContents(path, &file_contents, true)); - - EXPECT_EQ(StringReplace(content, "$tmpdir", temp_directory_, true), - file_contents); -} - -// =================================================================== - -TEST_F(CommandLineInterfaceTest, BasicOutput) { - // Test that the common case works. - - CreateTempFile("foo.proto", - "syntax = \"proto2\";\n" - "message Foo {}\n"); - - Run("protocol_compiler --test_out=$tmpdir " - "--proto_path=$tmpdir foo.proto"); - - ExpectNoErrors(); - ExpectGenerated("test_generator", "", "foo.proto", "Foo"); -} - -TEST_F(CommandLineInterfaceTest, BasicOutput_DescriptorSetIn) { - // Test that the common case works. - FileDescriptorSet file_descriptor_set; - FileDescriptorProto* file_descriptor_proto = file_descriptor_set.add_file(); - file_descriptor_proto->set_name("foo.proto"); - file_descriptor_proto->add_message_type()->set_name("Foo"); - - WriteDescriptorSet("foo.bin", &file_descriptor_set); - - Run("protocol_compiler --test_out=$tmpdir " - "--descriptor_set_in=$tmpdir/foo.bin foo.proto"); - - ExpectNoErrors(); - ExpectGenerated("test_generator", "", "foo.proto", "Foo"); -} - -TEST_F(CommandLineInterfaceTest, BasicPlugin) { - // Test that basic plugins work. - - CreateTempFile("foo.proto", - "syntax = \"proto2\";\n" - "message Foo {}\n"); - - Run("protocol_compiler --plug_out=$tmpdir " - "--proto_path=$tmpdir foo.proto"); - - ExpectNoErrors(); - ExpectGenerated("test_plugin", "", "foo.proto", "Foo"); -} - -TEST_F(CommandLineInterfaceTest, BasicPlugin_DescriptorSetIn) { - // Test that basic plugins work. - - FileDescriptorSet file_descriptor_set; - FileDescriptorProto* file_descriptor_proto = file_descriptor_set.add_file(); - file_descriptor_proto->set_name("foo.proto"); - file_descriptor_proto->add_message_type()->set_name("Foo"); - - WriteDescriptorSet("foo.bin", &file_descriptor_set); - - Run("protocol_compiler --plug_out=$tmpdir " - "--descriptor_set_in=$tmpdir/foo.bin foo.proto"); - - ExpectNoErrors(); - ExpectGenerated("test_plugin", "", "foo.proto", "Foo"); -} - -TEST_F(CommandLineInterfaceTest, GeneratorAndPlugin) { - // Invoke a generator and a plugin at the same time. - - CreateTempFile("foo.proto", - "syntax = \"proto2\";\n" - "message Foo {}\n"); - - Run("protocol_compiler --test_out=$tmpdir --plug_out=$tmpdir " - "--proto_path=$tmpdir foo.proto"); - - ExpectNoErrors(); - ExpectGenerated("test_generator", "", "foo.proto", "Foo"); - ExpectGenerated("test_plugin", "", "foo.proto", "Foo"); -} - -TEST_F(CommandLineInterfaceTest, GeneratorAndPlugin_DescriptorSetIn) { - // Invoke a generator and a plugin at the same time. - - FileDescriptorSet file_descriptor_set; - FileDescriptorProto* file_descriptor_proto = file_descriptor_set.add_file(); - file_descriptor_proto->set_name("foo.proto"); - file_descriptor_proto->add_message_type()->set_name("Foo"); - - WriteDescriptorSet("foo.bin", &file_descriptor_set); - - Run("protocol_compiler --test_out=$tmpdir --plug_out=$tmpdir " - "--descriptor_set_in=$tmpdir/foo.bin foo.proto"); - - ExpectNoErrors(); - ExpectGenerated("test_generator", "", "foo.proto", "Foo"); - ExpectGenerated("test_plugin", "", "foo.proto", "Foo"); -} - -TEST_F(CommandLineInterfaceTest, MultipleInputs) { - // Test parsing multiple input files. - - CreateTempFile("foo.proto", - "syntax = \"proto2\";\n" - "message Foo {}\n"); - CreateTempFile("bar.proto", - "syntax = \"proto2\";\n" - "message Bar {}\n"); - - Run("protocol_compiler --test_out=$tmpdir --plug_out=$tmpdir " - "--proto_path=$tmpdir foo.proto bar.proto"); - - ExpectNoErrors(); - ExpectGeneratedWithMultipleInputs("test_generator", "foo.proto,bar.proto", - "foo.proto", "Foo"); - ExpectGeneratedWithMultipleInputs("test_generator", "foo.proto,bar.proto", - "bar.proto", "Bar"); - ExpectGeneratedWithMultipleInputs("test_plugin", "foo.proto,bar.proto", - "foo.proto", "Foo"); - ExpectGeneratedWithMultipleInputs("test_plugin", "foo.proto,bar.proto", - "bar.proto", "Bar"); -} - -TEST_F(CommandLineInterfaceTest, MultipleInputs_DescriptorSetIn) { - // Test parsing multiple input files. - FileDescriptorSet file_descriptor_set; - - FileDescriptorProto* file_descriptor_proto = file_descriptor_set.add_file(); - file_descriptor_proto->set_name("foo.proto"); - file_descriptor_proto->add_message_type()->set_name("Foo"); - - file_descriptor_proto = file_descriptor_set.add_file(); - file_descriptor_proto->set_name("bar.proto"); - file_descriptor_proto->add_message_type()->set_name("Bar"); - - WriteDescriptorSet("foo.bin", &file_descriptor_set); - - Run("protocol_compiler --test_out=$tmpdir --plug_out=$tmpdir " - "--descriptor_set_in=$tmpdir/foo.bin foo.proto bar.proto"); - - ExpectNoErrors(); - ExpectGeneratedWithMultipleInputs("test_generator", "foo.proto,bar.proto", - "foo.proto", "Foo"); - ExpectGeneratedWithMultipleInputs("test_generator", "foo.proto,bar.proto", - "bar.proto", "Bar"); - ExpectGeneratedWithMultipleInputs("test_plugin", "foo.proto,bar.proto", - "foo.proto", "Foo"); - ExpectGeneratedWithMultipleInputs("test_plugin", "foo.proto,bar.proto", - "bar.proto", "Bar"); -} - -TEST_F(CommandLineInterfaceTest, MultipleInputs_UnusedImport_DescriptorSetIn) { - // Test unused import warning is not raised when descriptor_set_in is called - // and custom options are in unknown field instead of uninterpreted_options. - FileDescriptorSet file_descriptor_set; - - const FileDescriptor* descriptor_file = - FileDescriptorProto::descriptor()->file(); - descriptor_file->CopyTo(file_descriptor_set.add_file()); - - FileDescriptorProto& any_proto = *file_descriptor_set.add_file(); - google::protobuf::Any::descriptor()->file()->CopyTo(&any_proto); - - const FileDescriptor* custom_file = - protobuf_unittest::AggregateMessage::descriptor()->file(); - FileDescriptorProto* file_descriptor_proto = file_descriptor_set.add_file(); - custom_file->CopyTo(file_descriptor_proto); - file_descriptor_proto->set_name("custom_options.proto"); - // Add a custom message option. - FieldDescriptorProto* extension_option = - file_descriptor_proto->add_extension(); - extension_option->set_name("unknown_option"); - extension_option->set_extendee(".google.protobuf.MessageOptions"); - extension_option->set_number(1111); - extension_option->set_label(FieldDescriptorProto::LABEL_OPTIONAL); - extension_option->set_type(FieldDescriptorProto::TYPE_INT64); - - file_descriptor_proto = file_descriptor_set.add_file(); - file_descriptor_proto->set_name("import_custom_unknown_options.proto"); - file_descriptor_proto->add_dependency("custom_options.proto"); - // Add custom message option to unknown field. This custom option is - // not known in generated pool, thus option will be in unknown fields. - file_descriptor_proto->add_message_type()->set_name("Bar"); - file_descriptor_proto->mutable_message_type(0) - ->mutable_options() - ->mutable_unknown_fields() - ->AddVarint(1111, 2222); - - WriteDescriptorSet("foo.bin", &file_descriptor_set); - - Run("protocol_compiler --test_out=$tmpdir --plug_out=$tmpdir " - "--descriptor_set_in=$tmpdir/foo.bin " - "import_custom_unknown_options.proto"); - - // TODO(jieluo): Fix this test. This test case only happens when - // CommandLineInterface::Run() is used instead of invoke protoc combined - // with descriptor_set_in, and same custom options are defined in both - // generated pool and descriptor_set_in. There's no such uages for now but - // still need to be fixed. - /* - file_descriptor_proto = file_descriptor_set.add_file(); - file_descriptor_proto->set_name("import_custom_extension_options.proto"); - file_descriptor_proto->add_dependency("custom_options.proto"); - // Add custom message option to unknown field. This custom option is - // also defined in generated pool, thus option will be in extensions. - file_descriptor_proto->add_message_type()->set_name("Foo"); - file_descriptor_proto->mutable_message_type(0) - ->mutable_options() - ->mutable_unknown_fields() - ->AddVarint(protobuf_unittest::message_opt1.number(), 2222); - - WriteDescriptorSet("foo.bin", &file_descriptor_set); - - Run("protocol_compiler --test_out=$tmpdir --plug_out=$tmpdir " - "--descriptor_set_in=$tmpdir/foo.bin import_custom_unknown_options.proto " - "import_custom_extension_options.proto"); - */ - - ExpectNoErrors(); -} - -TEST_F(CommandLineInterfaceTest, MultipleInputsWithImport) { - // Test parsing multiple input files with an import of a separate file. - - CreateTempFile("foo.proto", - "syntax = \"proto2\";\n" - "message Foo {}\n"); - CreateTempFile("bar.proto", - "syntax = \"proto2\";\n" - "import \"baz.proto\";\n" - "message Bar {\n" - " optional Baz a = 1;\n" - "}\n"); - CreateTempFile("baz.proto", - "syntax = \"proto2\";\n" - "message Baz {}\n"); - - Run("protocol_compiler --test_out=$tmpdir --plug_out=$tmpdir " - "--proto_path=$tmpdir foo.proto bar.proto"); - - ExpectNoErrors(); - ExpectGeneratedWithMultipleInputs("test_generator", "foo.proto,bar.proto", - "foo.proto", "Foo"); - ExpectGeneratedWithMultipleInputs("test_generator", "foo.proto,bar.proto", - "bar.proto", "Bar"); - ExpectGeneratedWithMultipleInputs("test_plugin", "foo.proto,bar.proto", - "foo.proto", "Foo"); - ExpectGeneratedWithMultipleInputs("test_plugin", "foo.proto,bar.proto", - "bar.proto", "Bar"); -} - -TEST_F(CommandLineInterfaceTest, MultipleInputsWithImport_DescriptorSetIn) { - // Test parsing multiple input files with an import of a separate file. - FileDescriptorSet file_descriptor_set; - - FileDescriptorProto* file_descriptor_proto = file_descriptor_set.add_file(); - file_descriptor_proto->set_name("foo.proto"); - file_descriptor_proto->add_message_type()->set_name("Foo"); - - file_descriptor_proto = file_descriptor_set.add_file(); - file_descriptor_proto->set_name("bar.proto"); - file_descriptor_proto->add_dependency("baz.proto"); - DescriptorProto* message = file_descriptor_proto->add_message_type(); - message->set_name("Bar"); - FieldDescriptorProto* field = message->add_field(); - field->set_type_name("Baz"); - field->set_name("a"); - field->set_number(1); - - WriteDescriptorSet("foo_and_bar.bin", &file_descriptor_set); - - file_descriptor_set.clear_file(); - file_descriptor_proto = file_descriptor_set.add_file(); - file_descriptor_proto->set_name("baz.proto"); - file_descriptor_proto->add_message_type()->set_name("Baz"); - - file_descriptor_proto = file_descriptor_set.add_file(); - file_descriptor_proto->set_name("bat.proto"); - file_descriptor_proto->add_dependency("baz.proto"); - message = file_descriptor_proto->add_message_type(); - message->set_name("Bat"); - field = message->add_field(); - field->set_type_name("Baz"); - field->set_name("a"); - field->set_number(1); - - WriteDescriptorSet("baz_and_bat.bin", &file_descriptor_set); - Run(strings::Substitute( - "protocol_compiler --test_out=$$tmpdir --plug_out=$$tmpdir " - "--descriptor_set_in=$0 foo.proto bar.proto", - std::string("$tmpdir/foo_and_bar.bin") + - CommandLineInterface::kPathSeparator + "$tmpdir/baz_and_bat.bin")); - - ExpectNoErrors(); - ExpectGeneratedWithMultipleInputs("test_generator", "foo.proto,bar.proto", - "foo.proto", "Foo"); - ExpectGeneratedWithMultipleInputs("test_generator", "foo.proto,bar.proto", - "bar.proto", "Bar"); - ExpectGeneratedWithMultipleInputs("test_plugin", "foo.proto,bar.proto", - "foo.proto", "Foo"); - ExpectGeneratedWithMultipleInputs("test_plugin", "foo.proto,bar.proto", - "bar.proto", "Bar"); - - Run(strings::Substitute( - "protocol_compiler --test_out=$$tmpdir --plug_out=$$tmpdir " - "--descriptor_set_in=$0 baz.proto bat.proto", - std::string("$tmpdir/foo_and_bar.bin") + - CommandLineInterface::kPathSeparator + "$tmpdir/baz_and_bat.bin")); - - ExpectNoErrors(); - ExpectGeneratedWithMultipleInputs("test_generator", "baz.proto,bat.proto", - "baz.proto", "Baz"); - ExpectGeneratedWithMultipleInputs("test_generator", "baz.proto,bat.proto", - "bat.proto", "Bat"); - ExpectGeneratedWithMultipleInputs("test_plugin", "baz.proto,bat.proto", - "baz.proto", "Baz"); - ExpectGeneratedWithMultipleInputs("test_plugin", "baz.proto,bat.proto", - "bat.proto", "Bat"); -} - -TEST_F(CommandLineInterfaceTest, - MultipleInputsWithImport_DescriptorSetIn_DuplicateFileDescriptor) { - // Test parsing multiple input files with an import of a separate file. - FileDescriptorSet file_descriptor_set; - - FileDescriptorProto foo_file_descriptor_proto; - foo_file_descriptor_proto.set_name("foo.proto"); - foo_file_descriptor_proto.add_message_type()->set_name("Foo"); - - file_descriptor_set.add_file()->CopyFrom(foo_file_descriptor_proto); - - FileDescriptorProto* file_descriptor_proto = file_descriptor_set.add_file(); - file_descriptor_proto->set_name("bar.proto"); - file_descriptor_proto->add_dependency("baz.proto"); - file_descriptor_proto->add_dependency("foo.proto"); - DescriptorProto* message = file_descriptor_proto->add_message_type(); - message->set_name("Bar"); - FieldDescriptorProto* field = message->add_field(); - field->set_type_name("Baz"); - field->set_name("a"); - field->set_number(1); - field = message->add_field(); - field->set_type_name("Foo"); - field->set_name("f"); - field->set_number(2); - WriteDescriptorSet("foo_and_bar.bin", &file_descriptor_set); - - file_descriptor_set.clear_file(); - file_descriptor_set.add_file()->CopyFrom(foo_file_descriptor_proto); - - file_descriptor_proto = file_descriptor_set.add_file(); - file_descriptor_proto->set_name("baz.proto"); - file_descriptor_proto->add_dependency("foo.proto"); - message = file_descriptor_proto->add_message_type(); - message->set_name("Baz"); - field = message->add_field(); - field->set_type_name("Foo"); - field->set_name("f"); - field->set_number(1); - WriteDescriptorSet("foo_and_baz.bin", &file_descriptor_set); - - Run(strings::Substitute( - "protocol_compiler --test_out=$$tmpdir --plug_out=$$tmpdir " - "--descriptor_set_in=$0 bar.proto", - std::string("$tmpdir/foo_and_bar.bin") + - CommandLineInterface::kPathSeparator + "$tmpdir/foo_and_baz.bin")); - - ExpectNoErrors(); - ExpectGenerated("test_generator", "", "bar.proto", "Bar"); - ExpectGenerated("test_plugin", "", "bar.proto", "Bar"); -} - -TEST_F(CommandLineInterfaceTest, - MultipleInputsWithImport_DescriptorSetIn_MissingImport) { - // Test parsing multiple input files with an import of a separate file. - FileDescriptorSet file_descriptor_set; - - FileDescriptorProto* file_descriptor_proto = file_descriptor_set.add_file(); - file_descriptor_proto->set_name("foo.proto"); - file_descriptor_proto->add_message_type()->set_name("Foo"); - - file_descriptor_proto = file_descriptor_set.add_file(); - file_descriptor_proto->set_name("bar.proto"); - file_descriptor_proto->add_dependency("baz.proto"); - DescriptorProto* message = file_descriptor_proto->add_message_type(); - message->set_name("Bar"); - FieldDescriptorProto* field = message->add_field(); - field->set_type_name("Baz"); - field->set_name("a"); - field->set_number(1); - - WriteDescriptorSet("foo_and_bar.bin", &file_descriptor_set); - - file_descriptor_set.clear_file(); - file_descriptor_proto = file_descriptor_set.add_file(); - file_descriptor_proto->set_name("baz.proto"); - file_descriptor_proto->add_message_type()->set_name("Baz"); - - WriteDescriptorSet("baz.bin", &file_descriptor_set); - Run("protocol_compiler --test_out=$tmpdir --plug_out=$tmpdir " - "--descriptor_set_in=$tmpdir/foo_and_bar.bin " - "foo.proto bar.proto"); - ExpectErrorSubstring( - "bar.proto: Import \"baz.proto\" was not found or had errors."); - ExpectErrorSubstring("bar.proto: \"Baz\" is not defined."); -} - -TEST_F(CommandLineInterfaceTest, - InputsOnlyFromDescriptorSetIn_UnusedImportIsNotReported) { - FileDescriptorSet file_descriptor_set; - - FileDescriptorProto* file_descriptor_proto = file_descriptor_set.add_file(); - file_descriptor_proto->set_name("unused.proto"); - file_descriptor_proto->add_message_type()->set_name("Unused"); - - file_descriptor_proto = file_descriptor_set.add_file(); - file_descriptor_proto->set_name("bar.proto"); - file_descriptor_proto->add_dependency("unused.proto"); - file_descriptor_proto->add_message_type()->set_name("Bar"); - - WriteDescriptorSet("unused_and_bar.bin", &file_descriptor_set); - - Run("protocol_compiler --test_out=$tmpdir --plug_out=$tmpdir " - "--descriptor_set_in=$tmpdir/unused_and_bar.bin unused.proto bar.proto"); - ExpectNoErrors(); -} - -TEST_F(CommandLineInterfaceTest, - InputsFromDescriptorSetInAndFileSystem_UnusedImportIsReported) { - FileDescriptorSet file_descriptor_set; - - FileDescriptorProto* file_descriptor_proto = file_descriptor_set.add_file(); - file_descriptor_proto->set_name("unused.proto"); - file_descriptor_proto->add_message_type()->set_name("Unused"); - - file_descriptor_proto = file_descriptor_set.add_file(); - file_descriptor_proto->set_name("bar.proto"); - file_descriptor_proto->add_dependency("unused.proto"); - file_descriptor_proto->add_message_type()->set_name("Bar"); - - WriteDescriptorSet("unused_and_bar.bin", &file_descriptor_set); - - CreateTempFile("foo.proto", - "syntax = \"proto2\";\n" - "import \"bar.proto\";\n" - "message Foo {\n" - " optional Bar bar = 1;\n" - "}\n"); - - Run("protocol_compiler --test_out=$tmpdir --plug_out=$tmpdir " - "--descriptor_set_in=$tmpdir/unused_and_bar.bin " - "--proto_path=$tmpdir unused.proto bar.proto foo.proto"); - // Reporting unused imports here is unfair, since it's unactionable. Notice - // the lack of a line number. - // TODO(b/144853061): If the file with unused import is from the descriptor - // set and not from the file system, suppress the warning. - ExpectWarningSubstring("bar.proto: warning: Import unused.proto is unused."); -} - -TEST_F(CommandLineInterfaceTest, - OnlyReportsUnusedImportsForFilesBeingGenerated) { - CreateTempFile("unused.proto", - "syntax = \"proto2\";\n" - "message Unused {}\n"); - CreateTempFile("bar.proto", - "syntax = \"proto2\";\n" - "import \"unused.proto\";\n" - "message Bar {}\n"); - CreateTempFile("foo.proto", - "syntax = \"proto2\";\n" - "import \"bar.proto\";\n" - "message Foo {\n" - " optional Bar bar = 1;\n" - "}\n"); - - Run("protocol_compiler --test_out=$tmpdir " - "--proto_path=$tmpdir foo.proto"); - ExpectNoErrors(); -} - -TEST_F(CommandLineInterfaceTest, ReportsTransitiveMisingImports_LeafFirst) { - CreateTempFile("unused.proto", - "syntax = \"proto2\";\n" - "message Unused {}\n"); - CreateTempFile("bar.proto", - "syntax = \"proto2\";\n" - "import \"unused.proto\";\n" - "message Bar {}\n"); - CreateTempFile("foo.proto", - "syntax = \"proto2\";\n" - "import \"bar.proto\";\n" - "message Foo {\n" - " optional Bar bar = 1;\n" - "}\n"); - - Run("protocol_compiler --test_out=$tmpdir " - "--proto_path=$tmpdir bar.proto foo.proto"); - ExpectWarningSubstring( - "bar.proto:2:1: warning: Import unused.proto is unused."); -} - -TEST_F(CommandLineInterfaceTest, ReportsTransitiveMisingImports_LeafLast) { - CreateTempFile("unused.proto", - "syntax = \"proto2\";\n" - "message Unused {}\n"); - CreateTempFile("bar.proto", - "syntax = \"proto2\";\n" - "import \"unused.proto\";\n" - "message Bar {}\n"); - CreateTempFile("foo.proto", - "syntax = \"proto2\";\n" - "import \"bar.proto\";\n" - "message Foo {\n" - " optional Bar bar = 1;\n" - "}\n"); - - Run("protocol_compiler --test_out=$tmpdir " - "--proto_path=$tmpdir foo.proto bar.proto"); - ExpectWarningSubstring( - "bar.proto:2:1: warning: Import unused.proto is unused."); -} -TEST_F(CommandLineInterfaceTest, CreateDirectory) { - // Test that when we output to a sub-directory, it is created. - - CreateTempFile("bar/baz/foo.proto", - "syntax = \"proto2\";\n" - "message Foo {}\n"); - CreateTempDir("out"); - CreateTempDir("plugout"); - - Run("protocol_compiler --test_out=$tmpdir/out --plug_out=$tmpdir/plugout " - "--proto_path=$tmpdir bar/baz/foo.proto"); - - ExpectNoErrors(); - ExpectGenerated("test_generator", "", "bar/baz/foo.proto", "Foo", "out"); - ExpectGenerated("test_plugin", "", "bar/baz/foo.proto", "Foo", "plugout"); -} - -TEST_F(CommandLineInterfaceTest, GeneratorParameters) { - // Test that generator parameters are correctly parsed from the command line. - - CreateTempFile("foo.proto", - "syntax = \"proto2\";\n" - "message Foo {}\n"); - - Run("protocol_compiler --test_out=TestParameter:$tmpdir " - "--plug_out=TestPluginParameter:$tmpdir " - "--proto_path=$tmpdir foo.proto"); - - ExpectNoErrors(); - ExpectGenerated("test_generator", "TestParameter", "foo.proto", "Foo"); - ExpectGenerated("test_plugin", "TestPluginParameter", "foo.proto", "Foo"); -} - -TEST_F(CommandLineInterfaceTest, ExtraGeneratorParameters) { - // Test that generator parameters specified with the option flag are - // correctly passed to the code generator. - - CreateTempFile("foo.proto", - "syntax = \"proto2\";\n" - "message Foo {}\n"); - // Create the "a" and "b" sub-directories. - CreateTempDir("a"); - CreateTempDir("b"); - - Run("protocol_compiler " - "--test_opt=foo1 " - "--test_out=bar:$tmpdir/a " - "--test_opt=foo2 " - "--test_out=baz:$tmpdir/b " - "--test_opt=foo3 " - "--proto_path=$tmpdir foo.proto"); - - ExpectNoErrors(); - ExpectGenerated("test_generator", "bar,foo1,foo2,foo3", "foo.proto", "Foo", - "a"); - ExpectGenerated("test_generator", "baz,foo1,foo2,foo3", "foo.proto", "Foo", - "b"); -} - -TEST_F(CommandLineInterfaceTest, ExtraPluginParameters) { - // Test that generator parameters specified with the option flag are - // correctly passed to the code generator. - - CreateTempFile("foo.proto", - "syntax = \"proto2\";\n" - "message Foo {}\n"); - // Create the "a" and "b" sub-directories. - CreateTempDir("a"); - CreateTempDir("b"); - - Run("protocol_compiler " - "--plug_opt=foo1 " - "--plug_out=bar:$tmpdir/a " - "--plug_opt=foo2 " - "--plug_out=baz:$tmpdir/b " - "--plug_opt=foo3 " - "--proto_path=$tmpdir foo.proto"); - - ExpectNoErrors(); - ExpectGenerated("test_plugin", "bar,foo1,foo2,foo3", "foo.proto", "Foo", "a"); - ExpectGenerated("test_plugin", "baz,foo1,foo2,foo3", "foo.proto", "Foo", "b"); -} - -TEST_F(CommandLineInterfaceTest, UnrecognizedExtraParameters) { - CreateTempFile("foo.proto", - "syntax = \"proto2\";\n" - "message Foo {}\n"); - - Run("protocol_compiler --plug_out=TestParameter:$tmpdir " - "--unknown_plug_a_opt=Foo " - "--unknown_plug_b_opt=Bar " - "--proto_path=$tmpdir foo.proto"); - - ExpectErrorSubstring("Unknown flag: --unknown_plug_a_opt"); - ExpectErrorSubstring("Unknown flag: --unknown_plug_b_opt"); -} - -TEST_F(CommandLineInterfaceTest, ExtraPluginParametersForOutParameters) { - // This doesn't rely on the plugin having been registered and instead that - // the existence of --[name]_out is enough to make the --[name]_opt valid. - // However, running out of process plugins found via the search path (i.e. - - // not pre registered with --plugin) isn't support in this test suite, so we - // list the options pre/post the _out directive, and then include _opt that - // will be unknown, and confirm the failure output is about the expected - // unknown directive, which means the other were accepted. - // NOTE: UnrecognizedExtraParameters confirms that if two unknown _opt - // directives appear, they both are reported. - - CreateTempFile("foo.proto", - "syntax = \"proto2\";\n" - "message Foo {}\n"); - - Run("protocol_compiler --plug_out=TestParameter:$tmpdir " - "--xyz_opt=foo=bar --xyz_out=$tmpdir " - "--abc_out=$tmpdir --abc_opt=foo=bar " - "--unknown_plug_opt=Foo " - "--proto_path=$tmpdir foo.proto"); - - ExpectErrorText("Unknown flag: --unknown_plug_opt\n"); -} - -TEST_F(CommandLineInterfaceTest, Insert) { - // Test running a generator that inserts code into another's output. - - CreateTempFile("foo.proto", - "syntax = \"proto2\";\n" - "message Foo {}\n"); - - Run("protocol_compiler " - "--test_out=TestParameter:$tmpdir " - "--plug_out=TestPluginParameter:$tmpdir " - "--test_out=insert=test_generator,test_plugin:$tmpdir " - "--plug_out=insert=test_generator,test_plugin:$tmpdir " - "--proto_path=$tmpdir foo.proto"); - - ExpectNoErrors(); - ExpectGeneratedWithInsertions("test_generator", "TestParameter", - "test_generator,test_plugin", "foo.proto", - "Foo"); - ExpectGeneratedWithInsertions("test_plugin", "TestPluginParameter", - "test_generator,test_plugin", "foo.proto", - "Foo"); -} - -TEST_F(CommandLineInterfaceTest, InsertWithAnnotationFixup) { - // Check that annotation spans are updated after insertions. - - CreateTempFile("foo.proto", - "syntax = \"proto2\";\n" - "message MockCodeGenerator_Annotate {}\n"); - - Run("protocol_compiler " - "--test_out=TestParameter:$tmpdir " - "--plug_out=TestPluginParameter:$tmpdir " - "--test_out=insert_endlines=test_generator,test_plugin:$tmpdir " - "--plug_out=insert_endlines=test_generator,test_plugin:$tmpdir " - "--proto_path=$tmpdir foo.proto"); - - ExpectNoErrors(); - CheckGeneratedAnnotations("test_generator", "foo.proto"); - CheckGeneratedAnnotations("test_plugin", "foo.proto"); -} - -#if defined(_WIN32) - -TEST_F(CommandLineInterfaceTest, WindowsOutputPath) { - // Test that the output path can be a Windows-style path. - - CreateTempFile("foo.proto", "syntax = \"proto2\";\n"); - - Run("protocol_compiler --null_out=C:\\ " - "--proto_path=$tmpdir foo.proto"); - - ExpectNoErrors(); - ExpectNullCodeGeneratorCalled(""); -} - -TEST_F(CommandLineInterfaceTest, WindowsOutputPathAndParameter) { - // Test that we can have a windows-style output path and a parameter. - - CreateTempFile("foo.proto", "syntax = \"proto2\";\n"); - - Run("protocol_compiler --null_out=bar:C:\\ " - "--proto_path=$tmpdir foo.proto"); - - ExpectNoErrors(); - ExpectNullCodeGeneratorCalled("bar"); -} - -TEST_F(CommandLineInterfaceTest, TrailingBackslash) { - // Test that the directories can end in backslashes. Some users claim this - // doesn't work on their system. - - CreateTempFile("foo.proto", - "syntax = \"proto2\";\n" - "message Foo {}\n"); - - Run("protocol_compiler --test_out=$tmpdir\\ " - "--proto_path=$tmpdir\\ foo.proto"); - - ExpectNoErrors(); - ExpectGenerated("test_generator", "", "foo.proto", "Foo"); -} - -TEST_F(CommandLineInterfaceTest, Win32ErrorMessage) { - EXPECT_EQ("The system cannot find the file specified.\r\n", - Subprocess::Win32ErrorMessage(ERROR_FILE_NOT_FOUND)); -} - -#endif // defined(_WIN32) || defined(__CYGWIN__) - -TEST_F(CommandLineInterfaceTest, PathLookup) { - // Test that specifying multiple directories in the proto search path works. - - CreateTempFile("b/bar.proto", - "syntax = \"proto2\";\n" - "message Bar {}\n"); - CreateTempFile("a/foo.proto", - "syntax = \"proto2\";\n" - "import \"bar.proto\";\n" - "message Foo {\n" - " optional Bar a = 1;\n" - "}\n"); - CreateTempFile("b/foo.proto", "this should not be parsed\n"); - - Run("protocol_compiler --test_out=$tmpdir " - "--proto_path=$tmpdir/a --proto_path=$tmpdir/b foo.proto"); - - ExpectNoErrors(); - ExpectGenerated("test_generator", "", "foo.proto", "Foo"); -} - -TEST_F(CommandLineInterfaceTest, ColonDelimitedPath) { - // Same as PathLookup, but we provide the proto_path in a single flag. - - CreateTempFile("b/bar.proto", - "syntax = \"proto2\";\n" - "message Bar {}\n"); - CreateTempFile("a/foo.proto", - "syntax = \"proto2\";\n" - "import \"bar.proto\";\n" - "message Foo {\n" - " optional Bar a = 1;\n" - "}\n"); - CreateTempFile("b/foo.proto", "this should not be parsed\n"); - - Run(strings::Substitute( - "protocol_compiler --test_out=$$tmpdir --proto_path=$0 foo.proto", - std::string("$tmpdir/a") + CommandLineInterface::kPathSeparator + - "$tmpdir/b")); - - ExpectNoErrors(); - ExpectGenerated("test_generator", "", "foo.proto", "Foo"); -} - -TEST_F(CommandLineInterfaceTest, NonRootMapping) { - // Test setting up a search path mapping a directory to a non-root location. - - CreateTempFile("foo.proto", - "syntax = \"proto2\";\n" - "message Foo {}\n"); - - Run("protocol_compiler --test_out=$tmpdir " - "--proto_path=bar=$tmpdir bar/foo.proto"); - - ExpectNoErrors(); - ExpectGenerated("test_generator", "", "bar/foo.proto", "Foo"); -} - -TEST_F(CommandLineInterfaceTest, PathWithEqualsSign) { - // Test setting up a search path which happens to have '=' in it. - - CreateTempDir("with=sign"); - CreateTempFile("with=sign/foo.proto", - "syntax = \"proto2\";\n" - "message Foo {}\n"); - - Run("protocol_compiler --test_out=$tmpdir " - "--proto_path=$tmpdir/with=sign foo.proto"); - - ExpectNoErrors(); - ExpectGenerated("test_generator", "", "foo.proto", "Foo"); -} - -TEST_F(CommandLineInterfaceTest, MultipleGenerators) { - // Test that we can have multiple generators and use both in one invocation, - // each with a different output directory. - - CreateTempFile("foo.proto", - "syntax = \"proto2\";\n" - "message Foo {}\n"); - // Create the "a" and "b" sub-directories. - CreateTempDir("a"); - CreateTempDir("b"); - - Run("protocol_compiler " - "--test_out=$tmpdir/a " - "--alt_out=$tmpdir/b " - "--proto_path=$tmpdir foo.proto"); - - ExpectNoErrors(); - ExpectGenerated("test_generator", "", "foo.proto", "Foo", "a"); - ExpectGenerated("alt_generator", "", "foo.proto", "Foo", "b"); -} - -TEST_F(CommandLineInterfaceTest, DisallowServicesNoServices) { - // Test that --disallow_services doesn't cause a problem when there are no - // services. - - CreateTempFile("foo.proto", - "syntax = \"proto2\";\n" - "message Foo {}\n"); - - Run("protocol_compiler --disallow_services --test_out=$tmpdir " - "--proto_path=$tmpdir foo.proto"); - - ExpectNoErrors(); - ExpectGenerated("test_generator", "", "foo.proto", "Foo"); -} - -TEST_F(CommandLineInterfaceTest, DisallowServicesHasService) { - // Test that --disallow_services produces an error when there are services. - - CreateTempFile("foo.proto", - "syntax = \"proto2\";\n" - "message Foo {}\n" - "service Bar {}\n"); - - Run("protocol_compiler --disallow_services --test_out=$tmpdir " - "--proto_path=$tmpdir foo.proto"); - - ExpectErrorSubstring("foo.proto: This file contains services"); -} - -TEST_F(CommandLineInterfaceTest, AllowServicesHasService) { - // Test that services work fine as long as --disallow_services is not used. - - CreateTempFile("foo.proto", - "syntax = \"proto2\";\n" - "message Foo {}\n" - "service Bar {}\n"); - - Run("protocol_compiler --test_out=$tmpdir " - "--proto_path=$tmpdir foo.proto"); - - ExpectNoErrors(); - ExpectGenerated("test_generator", "", "foo.proto", "Foo"); -} - - -TEST_F(CommandLineInterfaceTest, DirectDependencies_Missing_EmptyList) { - CreateTempFile("foo.proto", - "syntax = \"proto2\";\n" - "import \"bar.proto\";\n" - "message Foo { optional Bar bar = 1; }"); - CreateTempFile("bar.proto", - "syntax = \"proto2\";\n" - "message Bar { optional string text = 1; }"); - - Run("protocol_compiler --test_out=$tmpdir --proto_path=$tmpdir " - "--direct_dependencies= foo.proto"); - - ExpectErrorText( - "foo.proto: File is imported but not declared in --direct_dependencies: " - "bar.proto\n"); -} - -TEST_F(CommandLineInterfaceTest, DirectDependencies_Missing) { - CreateTempFile("foo.proto", - "syntax = \"proto2\";\n" - "import \"bar.proto\";\n" - "import \"bla.proto\";\n" - "message Foo { optional Bar bar = 1; optional Bla bla = 2; }"); - CreateTempFile("bar.proto", - "syntax = \"proto2\";\n" - "message Bar { optional string text = 1; }"); - CreateTempFile("bla.proto", - "syntax = \"proto2\";\n" - "message Bla { optional int64 number = 1; }"); - - Run("protocol_compiler --test_out=$tmpdir --proto_path=$tmpdir " - "--direct_dependencies=bla.proto foo.proto"); - - ExpectErrorText( - "foo.proto: File is imported but not declared in --direct_dependencies: " - "bar.proto\n"); -} - -TEST_F(CommandLineInterfaceTest, DirectDependencies_NoViolation) { - CreateTempFile("foo.proto", - "syntax = \"proto2\";\n" - "import \"bar.proto\";\n" - "message Foo { optional Bar bar = 1; }"); - CreateTempFile("bar.proto", - "syntax = \"proto2\";\n" - "message Bar { optional string text = 1; }"); - - Run("protocol_compiler --test_out=$tmpdir --proto_path=$tmpdir " - "--direct_dependencies=bar.proto foo.proto"); - - ExpectNoErrors(); -} - -TEST_F(CommandLineInterfaceTest, DirectDependencies_NoViolation_MultiImports) { - CreateTempFile("foo.proto", - "syntax = \"proto2\";\n" - "import \"bar.proto\";\n" - "import \"bla.proto\";\n" - "message Foo { optional Bar bar = 1; optional Bla bla = 2; }"); - CreateTempFile("bar.proto", - "syntax = \"proto2\";\n" - "message Bar { optional string text = 1; }"); - CreateTempFile("bla.proto", - "syntax = \"proto2\";\n" - "message Bla { optional int64 number = 1; }"); - - Run("protocol_compiler --test_out=$tmpdir --proto_path=$tmpdir " - "--direct_dependencies=bar.proto:bla.proto foo.proto"); - - ExpectNoErrors(); -} - -TEST_F(CommandLineInterfaceTest, DirectDependencies_ProvidedMultipleTimes) { - CreateTempFile("foo.proto", "syntax = \"proto2\";\n"); - - Run("protocol_compiler --test_out=$tmpdir --proto_path=$tmpdir " - "--direct_dependencies=bar.proto --direct_dependencies=bla.proto " - "foo.proto"); - - ExpectErrorText( - "--direct_dependencies may only be passed once. To specify multiple " - "direct dependencies, pass them all as a single parameter separated by " - "':'.\n"); -} - -TEST_F(CommandLineInterfaceTest, DirectDependencies_CustomErrorMessage) { - CreateTempFile("foo.proto", - "syntax = \"proto2\";\n" - "import \"bar.proto\";\n" - "message Foo { optional Bar bar = 1; }"); - CreateTempFile("bar.proto", - "syntax = \"proto2\";\n" - "message Bar { optional string text = 1; }"); - - std::vector commands; - commands.push_back("protocol_compiler"); - commands.push_back("--test_out=$tmpdir"); - commands.push_back("--proto_path=$tmpdir"); - commands.push_back("--direct_dependencies="); - commands.push_back("--direct_dependencies_violation_msg=Bla \"%s\" Bla"); - commands.push_back("foo.proto"); - RunWithArgs(commands); - - ExpectErrorText("foo.proto: Bla \"bar.proto\" Bla\n"); -} - -TEST_F(CommandLineInterfaceTest, CwdRelativeInputs) { - // Test that we can accept working-directory-relative input files. - - CreateTempFile("foo.proto", - "syntax = \"proto2\";\n" - "message Foo {}\n"); - - Run("protocol_compiler --test_out=$tmpdir " - "--proto_path=$tmpdir $tmpdir/foo.proto"); - - ExpectNoErrors(); - ExpectGenerated("test_generator", "", "foo.proto", "Foo"); -} - -TEST_F(CommandLineInterfaceTest, WriteDescriptorSet) { - CreateTempFile("foo.proto", - "syntax = \"proto2\";\n" - "message Foo {}\n"); - CreateTempFile("bar.proto", - "syntax = \"proto2\";\n" - "import \"foo.proto\";\n" - "message Bar {\n" - " optional Foo foo = 1;\n" - "}\n"); - - Run("protocol_compiler --descriptor_set_out=$tmpdir/descriptor_set " - "--proto_path=$tmpdir bar.proto"); - - ExpectNoErrors(); - - FileDescriptorSet descriptor_set; - ReadDescriptorSet("descriptor_set", &descriptor_set); - if (HasFatalFailure()) return; - EXPECT_EQ(1, descriptor_set.file_size()); - EXPECT_EQ("bar.proto", descriptor_set.file(0).name()); - // Descriptor set should not have source code info. - EXPECT_FALSE(descriptor_set.file(0).has_source_code_info()); - // Descriptor set should have json_name. - EXPECT_EQ("Bar", descriptor_set.file(0).message_type(0).name()); - EXPECT_EQ("foo", descriptor_set.file(0).message_type(0).field(0).name()); - EXPECT_TRUE(descriptor_set.file(0).message_type(0).field(0).has_json_name()); -} - -TEST_F(CommandLineInterfaceTest, WriteDescriptorSetWithDuplicates) { - CreateTempFile("foo.proto", - "syntax = \"proto2\";\n" - "message Foo {}\n"); - CreateTempFile("bar.proto", - "syntax = \"proto2\";\n" - "import \"foo.proto\";\n" - "message Bar {\n" - " optional Foo foo = 1;\n" - "}\n"); - CreateTempFile("baz.proto", - "syntax = \"proto2\";\n" - "import \"foo.proto\";\n" - "message Baz {\n" - " optional Foo foo = 1;\n" - "}\n"); - - Run("protocol_compiler --descriptor_set_out=$tmpdir/descriptor_set " - "--proto_path=$tmpdir bar.proto foo.proto bar.proto baz.proto"); - - ExpectNoErrors(); - - FileDescriptorSet descriptor_set; - ReadDescriptorSet("descriptor_set", &descriptor_set); - if (HasFatalFailure()) return; - EXPECT_EQ(3, descriptor_set.file_size()); - // foo should come first since the output is in dependency order. - // since bar and baz are unordered, they should be in command line order. - EXPECT_EQ("foo.proto", descriptor_set.file(0).name()); - EXPECT_EQ("bar.proto", descriptor_set.file(1).name()); - EXPECT_EQ("baz.proto", descriptor_set.file(2).name()); - // Descriptor set should not have source code info. - EXPECT_FALSE(descriptor_set.file(0).has_source_code_info()); - // Descriptor set should have json_name. - EXPECT_EQ("Bar", descriptor_set.file(1).message_type(0).name()); - EXPECT_EQ("foo", descriptor_set.file(1).message_type(0).field(0).name()); - EXPECT_TRUE(descriptor_set.file(1).message_type(0).field(0).has_json_name()); -} - -TEST_F(CommandLineInterfaceTest, WriteDescriptorSetWithSourceInfo) { - CreateTempFile("foo.proto", - "syntax = \"proto2\";\n" - "message Foo {}\n"); - CreateTempFile("bar.proto", - "syntax = \"proto2\";\n" - "import \"foo.proto\";\n" - "message Bar {\n" - " optional Foo foo = 1;\n" - "}\n"); - - Run("protocol_compiler --descriptor_set_out=$tmpdir/descriptor_set " - "--include_source_info --proto_path=$tmpdir bar.proto"); - - ExpectNoErrors(); - - FileDescriptorSet descriptor_set; - ReadDescriptorSet("descriptor_set", &descriptor_set); - if (HasFatalFailure()) return; - EXPECT_EQ(1, descriptor_set.file_size()); - EXPECT_EQ("bar.proto", descriptor_set.file(0).name()); - // Source code info included. - EXPECT_TRUE(descriptor_set.file(0).has_source_code_info()); -} - -TEST_F(CommandLineInterfaceTest, WriteTransitiveDescriptorSet) { - CreateTempFile("foo.proto", - "syntax = \"proto2\";\n" - "message Foo {}\n"); - CreateTempFile("bar.proto", - "syntax = \"proto2\";\n" - "import \"foo.proto\";\n" - "message Bar {\n" - " optional Foo foo = 1;\n" - "}\n"); - - Run("protocol_compiler --descriptor_set_out=$tmpdir/descriptor_set " - "--include_imports --proto_path=$tmpdir bar.proto"); - - ExpectNoErrors(); - - FileDescriptorSet descriptor_set; - ReadDescriptorSet("descriptor_set", &descriptor_set); - if (HasFatalFailure()) return; - EXPECT_EQ(2, descriptor_set.file_size()); - if (descriptor_set.file(0).name() == "bar.proto") { - std::swap(descriptor_set.mutable_file()->mutable_data()[0], - descriptor_set.mutable_file()->mutable_data()[1]); - } - EXPECT_EQ("foo.proto", descriptor_set.file(0).name()); - EXPECT_EQ("bar.proto", descriptor_set.file(1).name()); - // Descriptor set should not have source code info. - EXPECT_FALSE(descriptor_set.file(0).has_source_code_info()); - EXPECT_FALSE(descriptor_set.file(1).has_source_code_info()); -} - -TEST_F(CommandLineInterfaceTest, WriteTransitiveDescriptorSetWithSourceInfo) { - CreateTempFile("foo.proto", - "syntax = \"proto2\";\n" - "message Foo {}\n"); - CreateTempFile("bar.proto", - "syntax = \"proto2\";\n" - "import \"foo.proto\";\n" - "message Bar {\n" - " optional Foo foo = 1;\n" - "}\n"); - - Run("protocol_compiler --descriptor_set_out=$tmpdir/descriptor_set " - "--include_imports --include_source_info --proto_path=$tmpdir bar.proto"); - - ExpectNoErrors(); - - FileDescriptorSet descriptor_set; - ReadDescriptorSet("descriptor_set", &descriptor_set); - if (HasFatalFailure()) return; - EXPECT_EQ(2, descriptor_set.file_size()); - if (descriptor_set.file(0).name() == "bar.proto") { - std::swap(descriptor_set.mutable_file()->mutable_data()[0], - descriptor_set.mutable_file()->mutable_data()[1]); - } - EXPECT_EQ("foo.proto", descriptor_set.file(0).name()); - EXPECT_EQ("bar.proto", descriptor_set.file(1).name()); - // Source code info included. - EXPECT_TRUE(descriptor_set.file(0).has_source_code_info()); - EXPECT_TRUE(descriptor_set.file(1).has_source_code_info()); -} - -#ifdef _WIN32 -// TODO(teboring): Figure out how to write test on windows. -#else -TEST_F(CommandLineInterfaceTest, WriteDependencyManifestFileGivenTwoInputs) { - CreateTempFile("foo.proto", - "syntax = \"proto2\";\n" - "message Foo {}\n"); - CreateTempFile("bar.proto", - "syntax = \"proto2\";\n" - "import \"foo.proto\";\n" - "message Bar {\n" - " optional Foo foo = 1;\n" - "}\n"); - - Run("protocol_compiler --dependency_out=$tmpdir/manifest " - "--test_out=$tmpdir --proto_path=$tmpdir bar.proto foo.proto"); - - ExpectErrorText( - "Can only process one input file when using --dependency_out=FILE.\n"); -} - -#ifdef PROTOBUF_OPENSOURCE -TEST_F(CommandLineInterfaceTest, WriteDependencyManifestFile) { - CreateTempFile("foo.proto", - "syntax = \"proto2\";\n" - "message Foo {}\n"); - CreateTempFile("bar.proto", - "syntax = \"proto2\";\n" - "import \"foo.proto\";\n" - "message Bar {\n" - " optional Foo foo = 1;\n" - "}\n"); - - std::string current_working_directory = getcwd(NULL, 0); - SwitchToTempDirectory(); - - Run("protocol_compiler --dependency_out=manifest --test_out=. " - "bar.proto"); - - ExpectNoErrors(); - - ExpectFileContent("manifest", - "bar.proto.MockCodeGenerator.test_generator: " - "foo.proto\\\n bar.proto"); - - File::ChangeWorkingDirectory(current_working_directory); -} -#else // !PROTOBUF_OPENSOURCE -// TODO(teboring): Figure out how to change and get working directory in -// google3. -#endif // !PROTOBUF_OPENSOURCE - -TEST_F(CommandLineInterfaceTest, WriteDependencyManifestFileForAbsolutePath) { - CreateTempFile("foo.proto", - "syntax = \"proto2\";\n" - "message Foo {}\n"); - CreateTempFile("bar.proto", - "syntax = \"proto2\";\n" - "import \"foo.proto\";\n" - "message Bar {\n" - " optional Foo foo = 1;\n" - "}\n"); - - Run("protocol_compiler --dependency_out=$tmpdir/manifest " - "--test_out=$tmpdir --proto_path=$tmpdir bar.proto"); - - ExpectNoErrors(); - - ExpectFileContent("manifest", - "$tmpdir/bar.proto.MockCodeGenerator.test_generator: " - "$tmpdir/foo.proto\\\n $tmpdir/bar.proto"); -} -#endif // !_WIN32 - -TEST_F(CommandLineInterfaceTest, TestArgumentFile) { - // Test parsing multiple input files using an argument file. - - CreateTempFile("foo.proto", - "syntax = \"proto2\";\n" - "message Foo {}\n"); - CreateTempFile("bar.proto", - "syntax = \"proto2\";\n" - "message Bar {}\n"); - CreateTempFile("arguments.txt", - "--test_out=$tmpdir\n" - "--plug_out=$tmpdir\n" - "--proto_path=$tmpdir\n" - "--direct_dependencies_violation_msg=%s is not imported\n" - "foo.proto\n" - "bar.proto"); - - Run("protocol_compiler @$tmpdir/arguments.txt"); - - ExpectNoErrors(); - ExpectGeneratedWithMultipleInputs("test_generator", "foo.proto,bar.proto", - "foo.proto", "Foo"); - ExpectGeneratedWithMultipleInputs("test_generator", "foo.proto,bar.proto", - "bar.proto", "Bar"); - ExpectGeneratedWithMultipleInputs("test_plugin", "foo.proto,bar.proto", - "foo.proto", "Foo"); - ExpectGeneratedWithMultipleInputs("test_plugin", "foo.proto,bar.proto", - "bar.proto", "Bar"); -} - - -// ------------------------------------------------------------------- - -TEST_F(CommandLineInterfaceTest, ParseErrors) { - // Test that parse errors are reported. - - CreateTempFile("foo.proto", - "syntax = \"proto2\";\n" - "badsyntax\n"); - - Run("protocol_compiler --test_out=$tmpdir " - "--proto_path=$tmpdir foo.proto"); - - ExpectErrorText( - "foo.proto:2:1: Expected top-level statement (e.g. \"message\").\n"); -} - -TEST_F(CommandLineInterfaceTest, ParseErrors_DescriptorSetIn) { - // Test that parse errors are reported. - CreateTempFile("foo.bin", "not a FileDescriptorSet"); - - Run("protocol_compiler --test_out=$tmpdir " - "--descriptor_set_in=$tmpdir/foo.bin foo.proto"); - - ExpectErrorText("$tmpdir/foo.bin: Unable to parse.\n"); -} - -TEST_F(CommandLineInterfaceTest, ParseErrorsMultipleFiles) { - // Test that parse errors are reported from multiple files. - - // We set up files such that foo.proto actually depends on bar.proto in - // two ways: Directly and through baz.proto. bar.proto's errors should - // only be reported once. - CreateTempFile("bar.proto", - "syntax = \"proto2\";\n" - "badsyntax\n"); - CreateTempFile("baz.proto", - "syntax = \"proto2\";\n" - "import \"bar.proto\";\n"); - CreateTempFile("foo.proto", - "syntax = \"proto2\";\n" - "import \"bar.proto\";\n" - "import \"baz.proto\";\n"); - - Run("protocol_compiler --test_out=$tmpdir " - "--proto_path=$tmpdir foo.proto"); - - ExpectErrorText( - "bar.proto:2:1: Expected top-level statement (e.g. \"message\").\n" - "baz.proto:2:1: Import \"bar.proto\" was not found or had errors.\n" - "foo.proto:2:1: Import \"bar.proto\" was not found or had errors.\n" - "foo.proto:3:1: Import \"baz.proto\" was not found or had errors.\n"); -} - -TEST_F(CommandLineInterfaceTest, RecursiveImportFails) { - // Create a proto file that imports itself. - CreateTempFile("foo.proto", - "syntax = \"proto2\";\n" - "import \"foo.proto\";\n"); - - Run("protocol_compiler --test_out=$tmpdir " - "--proto_path=$tmpdir foo.proto"); - - ExpectErrorSubstring( - "foo.proto:2:1: File recursively imports itself: " - "foo.proto -> foo.proto\n"); -} - -TEST_F(CommandLineInterfaceTest, InputNotFoundError) { - // Test what happens if the input file is not found. - - Run("protocol_compiler --test_out=$tmpdir " - "--proto_path=$tmpdir foo.proto"); - - ExpectErrorText( - "Could not make proto path relative: foo.proto: No such file or " - "directory\n"); -} - -TEST_F(CommandLineInterfaceTest, InputNotFoundError_DescriptorSetIn) { - // Test what happens if the input file is not found. - - Run("protocol_compiler --test_out=$tmpdir " - "--descriptor_set_in=$tmpdir/foo.bin foo.proto"); - - ExpectErrorText("$tmpdir/foo.bin: No such file or directory\n"); -} - -TEST_F(CommandLineInterfaceTest, CwdRelativeInputNotFoundError) { - // Test what happens when a working-directory-relative input file is not - // found. - - Run("protocol_compiler --test_out=$tmpdir " - "--proto_path=$tmpdir $tmpdir/foo.proto"); - - ExpectErrorText( - "Could not make proto path relative: $tmpdir/foo.proto: No such file or " - "directory\n"); -} - -TEST_F(CommandLineInterfaceTest, CwdRelativeInputNotMappedError) { - // Test what happens when a working-directory-relative input file is not - // mapped to a virtual path. - - CreateTempFile("foo.proto", - "syntax = \"proto2\";\n" - "message Foo {}\n"); - - // Create a directory called "bar" so that we can point --proto_path at it. - CreateTempFile("bar/dummy", ""); - - Run("protocol_compiler --test_out=$tmpdir " - "--proto_path=$tmpdir/bar $tmpdir/foo.proto"); - - ExpectErrorText( - "$tmpdir/foo.proto: File does not reside within any path " - "specified using --proto_path (or -I). You must specify a " - "--proto_path which encompasses this file. Note that the " - "proto_path must be an exact prefix of the .proto file " - "names -- protoc is too dumb to figure out when two paths " - "(e.g. absolute and relative) are equivalent (it's harder " - "than you think).\n"); -} - -TEST_F(CommandLineInterfaceTest, CwdRelativeInputNotFoundAndNotMappedError) { - // Check what happens if the input file is not found *and* is not mapped - // in the proto_path. - - // Create a directory called "bar" so that we can point --proto_path at it. - CreateTempFile("bar/dummy", ""); - - Run("protocol_compiler --test_out=$tmpdir " - "--proto_path=$tmpdir/bar $tmpdir/foo.proto"); - - ExpectErrorText( - "Could not make proto path relative: $tmpdir/foo.proto: No such file or " - "directory\n"); -} - -TEST_F(CommandLineInterfaceTest, CwdRelativeInputShadowedError) { - // Test what happens when a working-directory-relative input file is shadowed - // by another file in the virtual path. - - CreateTempFile("foo/foo.proto", - "syntax = \"proto2\";\n" - "message Foo {}\n"); - CreateTempFile("bar/foo.proto", - "syntax = \"proto2\";\n" - "message Bar {}\n"); - - Run("protocol_compiler --test_out=$tmpdir " - "--proto_path=$tmpdir/foo --proto_path=$tmpdir/bar " - "$tmpdir/bar/foo.proto"); - - ExpectErrorText( - "$tmpdir/bar/foo.proto: Input is shadowed in the --proto_path " - "by \"$tmpdir/foo/foo.proto\". Either use the latter " - "file as your input or reorder the --proto_path so that the " - "former file's location comes first.\n"); -} - -TEST_F(CommandLineInterfaceTest, ProtoPathNotFoundError) { - // Test what happens if the input file is not found. - - Run("protocol_compiler --test_out=$tmpdir " - "--proto_path=$tmpdir/foo foo.proto"); - - ExpectErrorText( - "$tmpdir/foo: warning: directory does not exist.\n" - "Could not make proto path relative: foo.proto: No such file or " - "directory\n"); -} - -TEST_F(CommandLineInterfaceTest, ProtoPathAndDescriptorSetIn) { - Run("protocol_compiler --test_out=$tmpdir " - "--proto_path=$tmpdir --descriptor_set_in=$tmpdir/foo.bin foo.proto"); - ExpectErrorText("$tmpdir/foo.bin: No such file or directory\n"); - - Run("protocol_compiler --test_out=$tmpdir " - "--descriptor_set_in=$tmpdir/foo.bin --proto_path=$tmpdir foo.proto"); - ExpectErrorText("$tmpdir/foo.bin: No such file or directory\n"); -} - -TEST_F(CommandLineInterfaceTest, ProtoPathAndDescriptorSetIn_CompileFiles) { - // Test what happens if a proto is in a --descriptor_set_in and also exists - // on disk. - FileDescriptorSet file_descriptor_set; - - // NOTE: This file desc SHOULD be different from the one created as a temp - // to make it easier to test that the file was output instead of the - // contents of the --descriptor_set_in file. - FileDescriptorProto* file_descriptor_proto = file_descriptor_set.add_file(); - file_descriptor_proto->set_name("foo.proto"); - file_descriptor_proto->add_message_type()->set_name("Foo"); - - WriteDescriptorSet("foo.bin", &file_descriptor_set); - - CreateTempFile("foo.proto", - "syntax = \"proto2\";\n" - "message FooBar { required string foo_message = 1; }\n"); - - Run("protocol_compiler --descriptor_set_out=$tmpdir/descriptor_set " - "--descriptor_set_in=$tmpdir/foo.bin " - "--include_source_info " - "--proto_path=$tmpdir foo.proto"); - - ExpectNoErrors(); - - FileDescriptorSet descriptor_set; - ReadDescriptorSet("descriptor_set", &descriptor_set); - - EXPECT_EQ(1, descriptor_set.file_size()); - EXPECT_EQ("foo.proto", descriptor_set.file(0).name()); - // Descriptor set SHOULD have source code info. - EXPECT_TRUE(descriptor_set.file(0).has_source_code_info()); - - EXPECT_EQ("FooBar", descriptor_set.file(0).message_type(0).name()); - EXPECT_EQ("foo_message", - descriptor_set.file(0).message_type(0).field(0).name()); -} - -TEST_F(CommandLineInterfaceTest, ProtoPathAndDependencyOut) { - Run("protocol_compiler --test_out=$tmpdir " - "--dependency_out=$tmpdir/manifest " - "--descriptor_set_in=$tmpdir/foo.bin foo.proto"); - ExpectErrorText( - "--descriptor_set_in cannot be used with --dependency_out.\n"); - - Run("protocol_compiler --test_out=$tmpdir " - "--descriptor_set_in=$tmpdir/foo.bin " - "--dependency_out=$tmpdir/manifest foo.proto"); - ExpectErrorText( - "--dependency_out cannot be used with --descriptor_set_in.\n"); -} - -TEST_F(CommandLineInterfaceTest, MissingInputError) { - // Test that we get an error if no inputs are given. - - Run("protocol_compiler --test_out=$tmpdir " - "--proto_path=$tmpdir"); - - ExpectErrorText("Missing input file.\n"); -} - -TEST_F(CommandLineInterfaceTest, MissingOutputError) { - CreateTempFile("foo.proto", - "syntax = \"proto2\";\n" - "message Foo {}\n"); - - Run("protocol_compiler --proto_path=$tmpdir foo.proto"); - - ExpectErrorText("Missing output directives.\n"); -} - -TEST_F(CommandLineInterfaceTest, OutputWriteError) { - CreateTempFile("foo.proto", - "syntax = \"proto2\";\n" - "message Foo {}\n"); - - std::string output_file = - MockCodeGenerator::GetOutputFileName("test_generator", "foo.proto"); - - // Create a directory blocking our output location. - CreateTempDir(output_file); - - Run("protocol_compiler --test_out=$tmpdir " - "--proto_path=$tmpdir foo.proto"); - - // MockCodeGenerator no longer detects an error because we actually write to - // an in-memory location first, then dump to disk at the end. This is no - // big deal. - // ExpectErrorSubstring("MockCodeGenerator detected write error."); - -#if defined(_WIN32) && !defined(__CYGWIN__) - // Windows with MSVCRT.dll produces EPERM instead of EISDIR. - if (HasAlternateErrorSubstring(output_file + ": Permission denied")) { - return; - } -#endif - - ExpectErrorSubstring(output_file + ": Is a directory"); -} - -TEST_F(CommandLineInterfaceTest, PluginOutputWriteError) { - CreateTempFile("foo.proto", - "syntax = \"proto2\";\n" - "message Foo {}\n"); - - std::string output_file = - MockCodeGenerator::GetOutputFileName("test_plugin", "foo.proto"); - - // Create a directory blocking our output location. - CreateTempDir(output_file); - - Run("protocol_compiler --plug_out=$tmpdir " - "--proto_path=$tmpdir foo.proto"); - -#if defined(_WIN32) && !defined(__CYGWIN__) - // Windows with MSVCRT.dll produces EPERM instead of EISDIR. - if (HasAlternateErrorSubstring(output_file + ": Permission denied")) { - return; - } -#endif - - ExpectErrorSubstring(output_file + ": Is a directory"); -} - -TEST_F(CommandLineInterfaceTest, OutputDirectoryNotFoundError) { - CreateTempFile("foo.proto", - "syntax = \"proto2\";\n" - "message Foo {}\n"); - - Run("protocol_compiler --test_out=$tmpdir/nosuchdir " - "--proto_path=$tmpdir foo.proto"); - - ExpectErrorSubstring("nosuchdir/: No such file or directory"); -} - -TEST_F(CommandLineInterfaceTest, PluginOutputDirectoryNotFoundError) { - CreateTempFile("foo.proto", - "syntax = \"proto2\";\n" - "message Foo {}\n"); - - Run("protocol_compiler --plug_out=$tmpdir/nosuchdir " - "--proto_path=$tmpdir foo.proto"); - - ExpectErrorSubstring("nosuchdir/: No such file or directory"); -} - -TEST_F(CommandLineInterfaceTest, OutputDirectoryIsFileError) { - CreateTempFile("foo.proto", - "syntax = \"proto2\";\n" - "message Foo {}\n"); - - Run("protocol_compiler --test_out=$tmpdir/foo.proto " - "--proto_path=$tmpdir foo.proto"); - -#if defined(_WIN32) && !defined(__CYGWIN__) - // Windows with MSVCRT.dll produces EINVAL instead of ENOTDIR. - if (HasAlternateErrorSubstring("foo.proto/: Invalid argument")) { - return; - } -#endif - - ExpectErrorSubstring("foo.proto/: Not a directory"); -} - -TEST_F(CommandLineInterfaceTest, GeneratorError) { - CreateTempFile("foo.proto", - "syntax = \"proto2\";\n" - "message MockCodeGenerator_Error {}\n"); - - Run("protocol_compiler --test_out=$tmpdir " - "--proto_path=$tmpdir foo.proto"); - - ExpectErrorSubstring( - "--test_out: foo.proto: Saw message type MockCodeGenerator_Error."); -} - -TEST_F(CommandLineInterfaceTest, GeneratorPluginError) { - // Test a generator plugin that returns an error. - - CreateTempFile("foo.proto", - "syntax = \"proto2\";\n" - "message MockCodeGenerator_Error {}\n"); - - Run("protocol_compiler --plug_out=TestParameter:$tmpdir " - "--proto_path=$tmpdir foo.proto"); - - ExpectErrorSubstring( - "--plug_out: foo.proto: Saw message type MockCodeGenerator_Error."); -} - -TEST_F(CommandLineInterfaceTest, GeneratorPluginFail) { - // Test a generator plugin that exits with an error code. - - CreateTempFile("foo.proto", - "syntax = \"proto2\";\n" - "message MockCodeGenerator_Exit {}\n"); - - Run("protocol_compiler --plug_out=TestParameter:$tmpdir " - "--proto_path=$tmpdir foo.proto"); - - ExpectErrorSubstring("Saw message type MockCodeGenerator_Exit."); - ExpectErrorSubstring( - "--plug_out: prefix-gen-plug: Plugin failed with status code 123."); -} - -TEST_F(CommandLineInterfaceTest, GeneratorPluginCrash) { - // Test a generator plugin that crashes. - - CreateTempFile("foo.proto", - "syntax = \"proto2\";\n" - "message MockCodeGenerator_Abort {}\n"); - - Run("protocol_compiler --plug_out=TestParameter:$tmpdir " - "--proto_path=$tmpdir foo.proto"); - - ExpectErrorSubstring("Saw message type MockCodeGenerator_Abort."); - -#ifdef _WIN32 - // Windows doesn't have signals. It looks like abort()ing causes the process - // to exit with status code 3, but let's not depend on the exact number here. - ExpectErrorSubstring( - "--plug_out: prefix-gen-plug: Plugin failed with status code"); -#else - // Don't depend on the exact signal number. - ExpectErrorSubstring("--plug_out: prefix-gen-plug: Plugin killed by signal"); -#endif -} - -TEST_F(CommandLineInterfaceTest, PluginReceivesSourceCodeInfo) { - CreateTempFile("foo.proto", - "syntax = \"proto2\";\n" - "message MockCodeGenerator_HasSourceCodeInfo {}\n"); - - Run("protocol_compiler --plug_out=$tmpdir --proto_path=$tmpdir foo.proto"); - - ExpectErrorSubstring( - "Saw message type MockCodeGenerator_HasSourceCodeInfo: 1."); -} - -TEST_F(CommandLineInterfaceTest, PluginReceivesJsonName) { - CreateTempFile("foo.proto", - "syntax = \"proto2\";\n" - "message MockCodeGenerator_HasJsonName {\n" - " optional int32 value = 1;\n" - "}\n"); - - Run("protocol_compiler --plug_out=$tmpdir --proto_path=$tmpdir foo.proto"); - - ExpectErrorSubstring("Saw json_name: 1"); -} - -TEST_F(CommandLineInterfaceTest, PluginReceivesCompilerVersion) { - CreateTempFile("foo.proto", - "syntax = \"proto2\";\n" - "message MockCodeGenerator_ShowVersionNumber {\n" - " optional int32 value = 1;\n" - "}\n"); - - Run("protocol_compiler --plug_out=$tmpdir --proto_path=$tmpdir foo.proto"); - - ExpectErrorSubstring(StringPrintf("Saw compiler_version: %d %s", - GOOGLE_PROTOBUF_VERSION, - GOOGLE_PROTOBUF_VERSION_SUFFIX)); -} - -TEST_F(CommandLineInterfaceTest, GeneratorPluginNotFound) { - // Test what happens if the plugin isn't found. - - CreateTempFile("error.proto", - "syntax = \"proto2\";\n" - "message Foo {}\n"); - - Run("protocol_compiler --badplug_out=TestParameter:$tmpdir " - "--plugin=prefix-gen-badplug=no_such_file " - "--proto_path=$tmpdir error.proto"); - -#ifdef _WIN32 - ExpectErrorSubstring("--badplug_out: prefix-gen-badplug: " + - Subprocess::Win32ErrorMessage(ERROR_FILE_NOT_FOUND)); -#else - // Error written to stdout by child process after exec() fails. - ExpectErrorSubstring("no_such_file: program not found or is not executable"); - - ExpectErrorSubstring( - "Please specify a program using absolute path or make sure " - "the program is available in your PATH system variable"); - - // Error written by parent process when child fails. - ExpectErrorSubstring( - "--badplug_out: prefix-gen-badplug: Plugin failed with status code 1."); -#endif -} - -TEST_F(CommandLineInterfaceTest, GeneratorPluginNotAllowed) { - // Test what happens if plugins aren't allowed. - - CreateTempFile("error.proto", - "syntax = \"proto2\";\n" - "message Foo {}\n"); - - DisallowPlugins(); - Run("protocol_compiler --plug_out=TestParameter:$tmpdir " - "--proto_path=$tmpdir error.proto"); - - ExpectErrorSubstring("Unknown flag: --plug_out"); -} - -TEST_F(CommandLineInterfaceTest, HelpText) { - Run("test_exec_name --help"); - - ExpectCapturedStdoutSubstringWithZeroReturnCode("Usage: test_exec_name "); - ExpectCapturedStdoutSubstringWithZeroReturnCode("--test_out=OUT_DIR"); - ExpectCapturedStdoutSubstringWithZeroReturnCode("Test output."); - ExpectCapturedStdoutSubstringWithZeroReturnCode("--alt_out=OUT_DIR"); - ExpectCapturedStdoutSubstringWithZeroReturnCode("Alt output."); -} - -TEST_F(CommandLineInterfaceTest, GccFormatErrors) { - // Test --error_format=gcc (which is the default, but we want to verify - // that it can be set explicitly). - - CreateTempFile("foo.proto", - "syntax = \"proto2\";\n" - "badsyntax\n"); - - Run("protocol_compiler --test_out=$tmpdir " - "--proto_path=$tmpdir --error_format=gcc foo.proto"); - - ExpectErrorText( - "foo.proto:2:1: Expected top-level statement (e.g. \"message\").\n"); -} - -TEST_F(CommandLineInterfaceTest, MsvsFormatErrors) { - // Test --error_format=msvs - - CreateTempFile("foo.proto", - "syntax = \"proto2\";\n" - "badsyntax\n"); - - Run("protocol_compiler --test_out=$tmpdir " - "--proto_path=$tmpdir --error_format=msvs foo.proto"); - - ExpectErrorText( - "$tmpdir/foo.proto(2) : error in column=1: Expected top-level statement " - "(e.g. \"message\").\n"); -} - -TEST_F(CommandLineInterfaceTest, InvalidErrorFormat) { - // Test invalid --error_format - - CreateTempFile("foo.proto", - "syntax = \"proto2\";\n" - "badsyntax\n"); - - Run("protocol_compiler --test_out=$tmpdir " - "--proto_path=$tmpdir --error_format=invalid foo.proto"); - - ExpectErrorText("Unknown error format: invalid\n"); -} - -TEST_F(CommandLineInterfaceTest, Warnings) { - // Test --fatal_warnings. - - CreateTempFile("foo.proto", - "syntax = \"proto2\";\n" - "import \"bar.proto\";\n"); - CreateTempFile("bar.proto", "syntax = \"proto2\";\n"); - - Run("protocol_compiler --test_out=$tmpdir " - "--proto_path=$tmpdir foo.proto"); - ExpectCapturedStderrSubstringWithZeroReturnCode( - "foo.proto:2:1: warning: Import bar.proto is unused."); - - Run("protocol_compiler --test_out=$tmpdir --fatal_warnings " - "--proto_path=$tmpdir foo.proto"); - ExpectErrorSubstring("foo.proto:2:1: warning: Import bar.proto is unused."); -} - -// ------------------------------------------------------------------- -// Flag parsing tests - -TEST_F(CommandLineInterfaceTest, ParseSingleCharacterFlag) { - // Test that a single-character flag works. - - CreateTempFile("foo.proto", - "syntax = \"proto2\";\n" - "message Foo {}\n"); - - Run("protocol_compiler -t$tmpdir " - "--proto_path=$tmpdir foo.proto"); - - ExpectNoErrors(); - ExpectGenerated("test_generator", "", "foo.proto", "Foo"); -} - -TEST_F(CommandLineInterfaceTest, ParseSpaceDelimitedValue) { - // Test that separating the flag value with a space works. - - CreateTempFile("foo.proto", - "syntax = \"proto2\";\n" - "message Foo {}\n"); - - Run("protocol_compiler --test_out $tmpdir " - "--proto_path=$tmpdir foo.proto"); - - ExpectNoErrors(); - ExpectGenerated("test_generator", "", "foo.proto", "Foo"); -} - -TEST_F(CommandLineInterfaceTest, ParseSingleCharacterSpaceDelimitedValue) { - // Test that separating the flag value with a space works for - // single-character flags. - - CreateTempFile("foo.proto", - "syntax = \"proto2\";\n" - "message Foo {}\n"); - - Run("protocol_compiler -t $tmpdir " - "--proto_path=$tmpdir foo.proto"); - - ExpectNoErrors(); - ExpectGenerated("test_generator", "", "foo.proto", "Foo"); -} - -TEST_F(CommandLineInterfaceTest, MissingValueError) { - // Test that we get an error if a flag is missing its value. - - Run("protocol_compiler --test_out --proto_path=$tmpdir foo.proto"); - - ExpectErrorText("Missing value for flag: --test_out\n"); -} - -TEST_F(CommandLineInterfaceTest, MissingValueAtEndError) { - // Test that we get an error if the last argument is a flag requiring a - // value. - - Run("protocol_compiler --test_out"); - - ExpectErrorText("Missing value for flag: --test_out\n"); -} - -TEST_F(CommandLineInterfaceTest, Proto3OptionalDisallowedNoCodegenSupport) { - CreateTempFile("google/foo.proto", - "syntax = \"proto3\";\n" - "message Foo {\n" - " optional int32 i = 1;\n" - "}\n"); - - CreateGeneratorWithMissingFeatures("--no_proto3_optional_out", - "Doesn't support proto3 optional", - CodeGenerator::FEATURE_PROTO3_OPTIONAL); - - Run("protocol_compiler --experimental_allow_proto3_optional " - "--proto_path=$tmpdir google/foo.proto --no_proto3_optional_out=$tmpdir"); - - ExpectErrorSubstring( - "code generator --no_proto3_optional_out hasn't been updated to support " - "optional fields in proto3"); -} - -TEST_F(CommandLineInterfaceTest, Proto3OptionalAllowWithFlag) { - CreateTempFile("google/foo.proto", - "syntax = \"proto3\";\n" - "message Foo {\n" - " optional int32 i = 1;\n" - "}\n"); - - Run("protocol_compiler --experimental_allow_proto3_optional " - "--proto_path=$tmpdir google/foo.proto --test_out=$tmpdir"); - ExpectNoErrors(); -} - -TEST_F(CommandLineInterfaceTest, PrintFreeFieldNumbers) { - CreateTempFile("foo.proto", - "syntax = \"proto2\";\n" - "package foo;\n" - "message Foo {\n" - " optional int32 a = 2;\n" - " optional string b = 4;\n" - " optional string c = 5;\n" - " optional int64 d = 8;\n" - " optional double e = 10;\n" - "}\n"); - CreateTempFile("bar.proto", - "syntax = \"proto2\";\n" - "message Bar {\n" - " optional int32 a = 2;\n" - " extensions 4 to 5;\n" - " optional int64 d = 8;\n" - " extensions 10;\n" - "}\n"); - CreateTempFile("baz.proto", - "syntax = \"proto2\";\n" - "message Baz {\n" - " optional int32 a = 2;\n" - " optional int64 d = 8;\n" - " extensions 15 to max;\n" // unordered. - " extensions 13;\n" - " extensions 10 to 12;\n" - " extensions 5;\n" - " extensions 4;\n" - "}\n"); - CreateTempFile( - "quz.proto", - "syntax = \"proto2\";\n" - "message Quz {\n" - " message Foo {}\n" // nested message - " optional int32 a = 2;\n" - " optional group C = 4 {\n" - " optional int32 d = 5;\n" - " }\n" - " extensions 8 to 10;\n" - " optional group E = 11 {\n" - " optional int32 f = 9;\n" // explicitly reuse extension range 8-10 - " optional group G = 15 {\n" // nested group - " message Foo {}\n" // nested message inside nested group - " }\n" - " }\n" - "}\n"); - - Run("protocol_compiler --print_free_field_numbers --proto_path=$tmpdir " - "foo.proto bar.proto baz.proto quz.proto"); - - ExpectNoErrors(); - - // TODO(jieluo): Cygwin doesn't work well if we try to capture stderr and - // stdout at the same time. Need to figure out why and add this test back - // for Cygwin. -#if !defined(__CYGWIN__) - ExpectCapturedStdout( - "foo.Foo free: 1 3 6-7 9 11-INF\n" - "Bar free: 1 3 6-7 9 11-INF\n" - "Baz free: 1 3 6-7 9 14\n" - "Quz.Foo free: 1-INF\n" - "Quz.E.G.Foo free: 1-INF\n" - "Quz free: 1 3 6-7 12-14 16-INF\n"); -#endif -} - -// =================================================================== - -// Test for --encode and --decode. Note that it would be easier to do this -// test as a shell script, but we'd like to be able to run the test on -// platforms that don't have a Bourne-compatible shell available (especially -// Windows/MSVC). - -enum EncodeDecodeTestMode { PROTO_PATH, DESCRIPTOR_SET_IN }; - -class EncodeDecodeTest : public testing::TestWithParam { - protected: - virtual void SetUp() { - WriteUnittestProtoDescriptorSet(); - duped_stdin_ = dup(STDIN_FILENO); - } - - virtual void TearDown() { - dup2(duped_stdin_, STDIN_FILENO); - close(duped_stdin_); - } - - void RedirectStdinFromText(const std::string& input) { - std::string filename = TestTempDir() + "/test_stdin"; - GOOGLE_CHECK_OK(File::SetContents(filename, input, true)); - GOOGLE_CHECK(RedirectStdinFromFile(filename)); - } - - bool RedirectStdinFromFile(const std::string& filename) { - int fd = open(filename.c_str(), O_RDONLY); - if (fd < 0) return false; - dup2(fd, STDIN_FILENO); - close(fd); - return true; - } - - // Remove '\r' characters from text. - std::string StripCR(const std::string& text) { - std::string result; - - for (int i = 0; i < text.size(); i++) { - if (text[i] != '\r') { - result.push_back(text[i]); - } - } - - return result; - } - - enum Type { TEXT, BINARY }; - enum ReturnCode { SUCCESS, ERROR }; - - bool Run(const std::string& command, bool specify_proto_files = true) { - std::vector args; - args.push_back("protoc"); - for (StringPiece split_piece : - Split(command, " ", true)) { - args.push_back(std::string(split_piece)); - } - if (specify_proto_files) { - switch (GetParam()) { - case PROTO_PATH: - args.push_back("--proto_path=" + TestUtil::TestSourceDir()); - break; - case DESCRIPTOR_SET_IN: - args.push_back(StrCat("--descriptor_set_in=", - unittest_proto_descriptor_set_filename_)); - break; - default: - ADD_FAILURE() << "unexpected EncodeDecodeTestMode: " << GetParam(); - } - } - - std::unique_ptr argv(new const char*[args.size()]); - for (int i = 0; i < args.size(); i++) { - argv[i] = args[i].c_str(); - } - - CommandLineInterface cli; - - CaptureTestStdout(); - CaptureTestStderr(); - - int result = cli.Run(args.size(), argv.get()); - - captured_stdout_ = GetCapturedTestStdout(); - captured_stderr_ = GetCapturedTestStderr(); - - return result == 0; - } - - void ExpectStdoutMatchesBinaryFile(const std::string& filename) { - std::string expected_output; - GOOGLE_CHECK_OK(File::GetContents(filename, &expected_output, true)); - - // Don't use EXPECT_EQ because we don't want to print raw binary data to - // stdout on failure. - EXPECT_TRUE(captured_stdout_ == expected_output); - } - - void ExpectStdoutMatchesTextFile(const std::string& filename) { - std::string expected_output; - GOOGLE_CHECK_OK(File::GetContents(filename, &expected_output, true)); - - ExpectStdoutMatchesText(expected_output); - } - - void ExpectStdoutMatchesText(const std::string& expected_text) { - EXPECT_EQ(StripCR(expected_text), StripCR(captured_stdout_)); - } - - void ExpectStderrMatchesText(const std::string& expected_text) { - EXPECT_EQ(StripCR(expected_text), StripCR(captured_stderr_)); - } - - void ExpectStderrContainsText(const std::string& expected_text) { - EXPECT_NE(StripCR(captured_stderr_).find(StripCR(expected_text)), - std::string::npos); - } - - private: - void WriteUnittestProtoDescriptorSet() { - unittest_proto_descriptor_set_filename_ = - TestTempDir() + "/unittest_proto_descriptor_set.bin"; - FileDescriptorSet file_descriptor_set; - protobuf_unittest::TestAllTypes test_all_types; - test_all_types.descriptor()->file()->CopyTo(file_descriptor_set.add_file()); - - protobuf_unittest_import::ImportMessage import_message; - import_message.descriptor()->file()->CopyTo(file_descriptor_set.add_file()); - - protobuf_unittest_import::PublicImportMessage public_import_message; - public_import_message.descriptor()->file()->CopyTo( - file_descriptor_set.add_file()); - GOOGLE_DCHECK(file_descriptor_set.IsInitialized()); - - std::string binary_proto; - GOOGLE_CHECK(file_descriptor_set.SerializeToString(&binary_proto)); - GOOGLE_CHECK_OK(File::SetContents(unittest_proto_descriptor_set_filename_, - binary_proto, true)); - } - - int duped_stdin_; - std::string captured_stdout_; - std::string captured_stderr_; - std::string unittest_proto_descriptor_set_filename_; -}; - -TEST_P(EncodeDecodeTest, Encode) { - RedirectStdinFromFile(TestUtil::GetTestDataPath( - "net/proto2/internal/" - "testdata/text_format_unittest_data_oneof_implemented.txt")); - std::string args; - if (GetParam() != DESCRIPTOR_SET_IN) { - args.append( - TestUtil::MaybeTranslatePath("net/proto2/internal/unittest.proto")); - } - EXPECT_TRUE(Run(args + " --encode=protobuf_unittest.TestAllTypes")); - ExpectStdoutMatchesBinaryFile(TestUtil::GetTestDataPath( - "net/proto2/internal/testdata/golden_message_oneof_implemented")); - ExpectStderrMatchesText(""); -} - -TEST_P(EncodeDecodeTest, Decode) { - RedirectStdinFromFile(TestUtil::GetTestDataPath( - "net/proto2/internal/testdata/golden_message_oneof_implemented")); - EXPECT_TRUE( - Run(TestUtil::MaybeTranslatePath("net/proto2/internal/unittest.proto") + - " --decode=protobuf_unittest.TestAllTypes")); - ExpectStdoutMatchesTextFile(TestUtil::GetTestDataPath( - "net/proto2/internal/" - "testdata/text_format_unittest_data_oneof_implemented.txt")); - ExpectStderrMatchesText(""); -} - -TEST_P(EncodeDecodeTest, Partial) { - RedirectStdinFromText(""); - EXPECT_TRUE( - Run(TestUtil::MaybeTranslatePath("net/proto2/internal/unittest.proto") + - " --encode=protobuf_unittest.TestRequired")); - ExpectStdoutMatchesText(""); - ExpectStderrMatchesText( - "warning: Input message is missing required fields: a, b, c\n"); -} - -TEST_P(EncodeDecodeTest, DecodeRaw) { - protobuf_unittest::TestAllTypes message; - message.set_optional_int32(123); - message.set_optional_string("foo"); - std::string data; - message.SerializeToString(&data); - - RedirectStdinFromText(data); - EXPECT_TRUE(Run("--decode_raw", /*specify_proto_files=*/false)); - ExpectStdoutMatchesText( - "1: 123\n" - "14: \"foo\"\n"); - ExpectStderrMatchesText(""); -} - -TEST_P(EncodeDecodeTest, UnknownType) { - EXPECT_FALSE( - Run(TestUtil::MaybeTranslatePath("net/proto2/internal/unittest.proto") + - " --encode=NoSuchType")); - ExpectStdoutMatchesText(""); - ExpectStderrMatchesText("Type not defined: NoSuchType\n"); -} - -TEST_P(EncodeDecodeTest, ProtoParseError) { - EXPECT_FALSE( - Run("net/proto2/internal/no_such_file.proto " - "--encode=NoSuchType")); - ExpectStdoutMatchesText(""); - ExpectStderrContainsText( - "net/proto2/internal/no_such_file.proto: No such file or directory\n"); -} - -TEST_P(EncodeDecodeTest, EncodeDeterministicOutput) { - RedirectStdinFromFile(TestUtil::GetTestDataPath( - "net/proto2/internal/" - "testdata/text_format_unittest_data_oneof_implemented.txt")); - std::string args; - if (GetParam() != DESCRIPTOR_SET_IN) { - args.append( - TestUtil::MaybeTranslatePath("net/proto2/internal/unittest.proto")); - } - EXPECT_TRUE(Run( - args + " --encode=protobuf_unittest.TestAllTypes --deterministic_output")); - ExpectStdoutMatchesBinaryFile(TestUtil::GetTestDataPath( - "net/proto2/internal/testdata/golden_message_oneof_implemented")); - ExpectStderrMatchesText(""); -} - -TEST_P(EncodeDecodeTest, DecodeDeterministicOutput) { - RedirectStdinFromFile(TestUtil::GetTestDataPath( - "net/proto2/internal/testdata/golden_message_oneof_implemented")); - EXPECT_FALSE( - Run(TestUtil::MaybeTranslatePath("net/proto2/internal/unittest.proto") + - " --decode=protobuf_unittest.TestAllTypes --deterministic_output")); - ExpectStderrMatchesText( - "Can only use --deterministic_output with --encode.\n"); -} - -INSTANTIATE_TEST_SUITE_P(FileDescriptorSetSource, EncodeDecodeTest, - testing::Values(PROTO_PATH, DESCRIPTOR_SET_IN)); -} // anonymous namespace - -#endif // !GOOGLE_PROTOBUF_HEAP_CHECK_DRACONIAN - -} // namespace compiler -} // namespace protobuf -} // namespace google diff --git a/extra/protobuf/protobuf-3.19.4/src/google/protobuf/compiler/cpp/cpp_bootstrap_unittest.cc b/extra/protobuf/protobuf-3.19.4/src/google/protobuf/compiler/cpp/cpp_bootstrap_unittest.cc deleted file mode 100644 index 60619f107648..000000000000 --- a/extra/protobuf/protobuf-3.19.4/src/google/protobuf/compiler/cpp/cpp_bootstrap_unittest.cc +++ /dev/null @@ -1,195 +0,0 @@ -// Protocol Buffers - Google's data interchange format -// Copyright 2008 Google Inc. All rights reserved. -// https://developers.google.com/protocol-buffers/ -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// * Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// * Redistributions in binary form must reproduce the above -// copyright notice, this list of conditions and the following disclaimer -// in the documentation and/or other materials provided with the -// distribution. -// * Neither the name of Google Inc. nor the names of its -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -// Author: kenton@google.com (Kenton Varda) -// Based on original Protocol Buffers design by -// Sanjay Ghemawat, Jeff Dean, and others. -// -// This test insures that net/proto2/proto/descriptor.pb.{h,cc} match exactly -// what would be generated by the protocol compiler. These files are not -// generated automatically at build time because they are compiled into the -// protocol compiler itself. So, if they were auto-generated, you'd have a -// chicken-and-egg problem. -// -// If this test fails, run the script -// "generate_descriptor_proto.sh" and add -// descriptor.pb.{h,cc} to your changelist. - -#include - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -namespace google { -namespace protobuf { -namespace compiler { -namespace cpp { - -namespace { - -class MockErrorCollector : public MultiFileErrorCollector { - public: - MockErrorCollector() {} - ~MockErrorCollector() {} - - std::string text_; - - // implements ErrorCollector --------------------------------------- - void AddError(const std::string& filename, int line, int column, - const std::string& message) { - strings::SubstituteAndAppend(&text_, "$0:$1:$2: $3\n", filename, line, column, - message); - } -}; - -class MockGeneratorContext : public GeneratorContext { - public: - void ExpectFileMatches(const std::string& virtual_filename, - const std::string& physical_filename) { - auto it = files_.find(virtual_filename); - ASSERT_TRUE(it != files_.end()) - << "Generator failed to generate file: " << virtual_filename; - - std::string expected_contents = *it->second; - std::string actual_contents; - GOOGLE_CHECK_OK( - File::GetContents(TestUtil::TestSourceDir() + "/" + physical_filename, - &actual_contents, true)) - << physical_filename; - CleanStringLineEndings(&actual_contents, false); - -#ifdef WRITE_FILES // Define to debug mismatched files. - GOOGLE_CHECK_OK(File::SetContents("/tmp/expected.cc", expected_contents, - true)); - GOOGLE_CHECK_OK( - File::SetContents("/tmp/actual.cc", actual_contents, true)); -#endif - - ASSERT_EQ(expected_contents, actual_contents) - << physical_filename - << " needs to be regenerated. Please run " - "generate_descriptor_proto.sh. " - "Then add this file to your CL."; - } - - // implements GeneratorContext -------------------------------------- - - virtual io::ZeroCopyOutputStream* Open(const std::string& filename) { - auto& map_slot = files_[filename]; - map_slot.reset(new std::string); - return new io::StringOutputStream(map_slot.get()); - } - - private: - std::map> files_; -}; - -const char kDescriptorParameter[] = "dllexport_decl=PROTOBUF_EXPORT"; -const char kPluginParameter[] = "dllexport_decl=PROTOC_EXPORT"; - - -const char* test_protos[][2] = { - {"google/protobuf/descriptor", kDescriptorParameter}, - {"google/protobuf/compiler/plugin", kPluginParameter}, -}; - -TEST(BootstrapTest, GeneratedFilesMatch) { - // We need a mapping from the actual file to virtual and actual path - // of the data to compare to. - std::map vpath_map; - std::map rpath_map; - rpath_map["third_party/protobuf/src/google/protobuf/test_messages_proto2"] = - "net/proto2/z_generated_example/test_messages_proto2"; - rpath_map["third_party/protobuf/src/google/protobuf/test_messages_proto3"] = - "net/proto2/z_generated_example/test_messages_proto3"; - rpath_map["net/proto2/internal/proto2_weak"] = - "net/proto2/z_generated_example/proto2_weak"; - - DiskSourceTree source_tree; - source_tree.MapPath("", TestUtil::TestSourceDir()); - - for (auto file_parameter : test_protos) { - MockErrorCollector error_collector; - Importer importer(&source_tree, &error_collector); - const FileDescriptor* file = - importer.Import(file_parameter[0] + std::string(".proto")); - ASSERT_TRUE(file != nullptr) - << "Can't import file " << file_parameter[0] + std::string(".proto") - << "\n"; - EXPECT_EQ("", error_collector.text_); - CppGenerator generator; - MockGeneratorContext context; -#ifdef GOOGLE_PROTOBUF_RUNTIME_INCLUDE_BASE - generator.set_opensource_runtime(true); - generator.set_runtime_include_base(GOOGLE_PROTOBUF_RUNTIME_INCLUDE_BASE); -#endif - std::string error; - ASSERT_TRUE(generator.Generate(file, file_parameter[1], &context, &error)); - - std::string vpath = - FindWithDefault(vpath_map, file_parameter[0], file_parameter[0]); - std::string rpath = - FindWithDefault(rpath_map, file_parameter[0], file_parameter[0]); - context.ExpectFileMatches(vpath + ".pb.cc", rpath + ".pb.cc"); - context.ExpectFileMatches(vpath + ".pb.h", rpath + ".pb.h"); - } -} - -// test Generate in cpp_generator.cc -TEST(BootstrapTest, OptionNotExist) { - cpp::CppGenerator generator; - DescriptorPool pool; - GeneratorContext* generator_context = nullptr; - std::string parameter = "aaa"; - std::string error; - ASSERT_FALSE(generator.Generate( - pool.FindFileByName("google/protobuf/descriptor.proto"), parameter, - generator_context, &error)); - EXPECT_EQ(error, "Unknown generator option: " + parameter); -} - -} // namespace - -} // namespace cpp -} // namespace compiler -} // namespace protobuf -} // namespace google diff --git a/extra/protobuf/protobuf-3.19.4/src/google/protobuf/compiler/cpp/cpp_enum.cc b/extra/protobuf/protobuf-3.19.4/src/google/protobuf/compiler/cpp/cpp_enum.cc deleted file mode 100644 index 6ae5cf42500a..000000000000 --- a/extra/protobuf/protobuf-3.19.4/src/google/protobuf/compiler/cpp/cpp_enum.cc +++ /dev/null @@ -1,438 +0,0 @@ -// Protocol Buffers - Google's data interchange format -// Copyright 2008 Google Inc. All rights reserved. -// https://developers.google.com/protocol-buffers/ -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// * Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// * Redistributions in binary form must reproduce the above -// copyright notice, this list of conditions and the following disclaimer -// in the documentation and/or other materials provided with the -// distribution. -// * Neither the name of Google Inc. nor the names of its -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -// Author: kenton@google.com (Kenton Varda) -// Based on original Protocol Buffers design by -// Sanjay Ghemawat, Jeff Dean, and others. - -#include - -#include -#include -#include - -#include -#include -#include -#include - -namespace google { -namespace protobuf { -namespace compiler { -namespace cpp { - -namespace { -// The GOOGLE_ARRAYSIZE constant is the max enum value plus 1. If the max enum value -// is kint32max, GOOGLE_ARRAYSIZE will overflow. In such cases we should omit the -// generation of the GOOGLE_ARRAYSIZE constant. -bool ShouldGenerateArraySize(const EnumDescriptor* descriptor) { - int32_t max_value = descriptor->value(0)->number(); - for (int i = 0; i < descriptor->value_count(); i++) { - if (descriptor->value(i)->number() > max_value) { - max_value = descriptor->value(i)->number(); - } - } - return max_value != std::numeric_limits::max(); -} - -// Returns the number of unique numeric enum values. This is less than -// descriptor->value_count() when there are aliased values. -int CountUniqueValues(const EnumDescriptor* descriptor) { - std::set values; - for (int i = 0; i < descriptor->value_count(); ++i) { - values.insert(descriptor->value(i)->number()); - } - return values.size(); -} - -} // namespace - -EnumGenerator::EnumGenerator(const EnumDescriptor* descriptor, - const std::map& vars, - const Options& options) - : descriptor_(descriptor), - classname_(ClassName(descriptor, false)), - options_(options), - generate_array_size_(ShouldGenerateArraySize(descriptor)), - variables_(vars) { - variables_["classname"] = classname_; - variables_["classtype"] = QualifiedClassName(descriptor_, options); - variables_["short_name"] = descriptor_->name(); - variables_["nested_name"] = descriptor_->name(); - variables_["resolved_name"] = ResolveKeyword(descriptor_->name()); - variables_["prefix"] = - (descriptor_->containing_type() == NULL) ? "" : classname_ + "_"; -} - -EnumGenerator::~EnumGenerator() {} - -void EnumGenerator::GenerateDefinition(io::Printer* printer) { - Formatter format(printer, variables_); - format("enum ${1$$classname$$}$ : int {\n", descriptor_); - format.Indent(); - - const EnumValueDescriptor* min_value = descriptor_->value(0); - const EnumValueDescriptor* max_value = descriptor_->value(0); - - for (int i = 0; i < descriptor_->value_count(); i++) { - auto format_value = format; - format_value.Set("name", EnumValueName(descriptor_->value(i))); - // In C++, an value of -2147483648 gets interpreted as the negative of - // 2147483648, and since 2147483648 can't fit in an integer, this produces a - // compiler warning. This works around that issue. - format_value.Set("number", Int32ToString(descriptor_->value(i)->number())); - format_value.Set("deprecation", - DeprecatedAttribute(options_, descriptor_->value(i))); - - if (i > 0) format_value(",\n"); - format_value("${1$$prefix$$name$$}$ $deprecation$= $number$", - descriptor_->value(i)); - - if (descriptor_->value(i)->number() < min_value->number()) { - min_value = descriptor_->value(i); - } - if (descriptor_->value(i)->number() > max_value->number()) { - max_value = descriptor_->value(i); - } - } - - if (descriptor_->file()->syntax() == FileDescriptor::SYNTAX_PROTO3) { - // For new enum semantics: generate min and max sentinel values equal to - // INT32_MIN and INT32_MAX - if (descriptor_->value_count() > 0) format(",\n"); - format( - "$classname$_$prefix$INT_MIN_SENTINEL_DO_NOT_USE_ = " - "std::numeric_limits<$int32$>::min(),\n" - "$classname$_$prefix$INT_MAX_SENTINEL_DO_NOT_USE_ = " - "std::numeric_limits<$int32$>::max()"); - } - - format.Outdent(); - format("\n};\n"); - - format( - "$dllexport_decl $bool $classname$_IsValid(int value);\n" - "constexpr $classname$ ${1$$prefix$$short_name$_MIN$}$ = " - "$prefix$$2$;\n" - "constexpr $classname$ ${1$$prefix$$short_name$_MAX$}$ = " - "$prefix$$3$;\n", - descriptor_, EnumValueName(min_value), EnumValueName(max_value)); - - if (generate_array_size_) { - format( - "constexpr int ${1$$prefix$$short_name$_ARRAYSIZE$}$ = " - "$prefix$$short_name$_MAX + 1;\n\n", - descriptor_); - } - - if (HasDescriptorMethods(descriptor_->file(), options_)) { - format( - "$dllexport_decl $const ::$proto_ns$::EnumDescriptor* " - "$classname$_descriptor();\n"); - } - - // The _Name and _Parse functions. The lite implementation is table-based, so - // we make sure to keep the tables hidden in the .cc file. - if (!HasDescriptorMethods(descriptor_->file(), options_)) { - format("const std::string& $classname$_Name($classname$ value);\n"); - } - // The _Name() function accepts the enum type itself but also any integral - // type. - format( - "template\n" - "inline const std::string& $classname$_Name(T enum_t_value) {\n" - " static_assert(::std::is_same::value ||\n" - " ::std::is_integral::value,\n" - " \"Incorrect type passed to function $classname$_Name.\");\n"); - if (HasDescriptorMethods(descriptor_->file(), options_)) { - format( - " return ::$proto_ns$::internal::NameOfEnum(\n" - " $classname$_descriptor(), enum_t_value);\n"); - } else { - format( - " return $classname$_Name(static_cast<$classname$>(enum_t_value));\n"); - } - format("}\n"); - - if (HasDescriptorMethods(descriptor_->file(), options_)) { - format( - "inline bool $classname$_Parse(\n" - " ::PROTOBUF_NAMESPACE_ID::ConstStringParam name, $classname$* " - "value) " - "{\n" - " return ::$proto_ns$::internal::ParseNamedEnum<$classname$>(\n" - " $classname$_descriptor(), name, value);\n" - "}\n"); - } else { - format( - "bool $classname$_Parse(\n" - " ::PROTOBUF_NAMESPACE_ID::ConstStringParam name, $classname$* " - "value);\n"); - } -} - -void EnumGenerator::GenerateGetEnumDescriptorSpecializations( - io::Printer* printer) { - Formatter format(printer, variables_); - format( - "template <> struct is_proto_enum< $classtype$> : ::std::true_type " - "{};\n"); - if (HasDescriptorMethods(descriptor_->file(), options_)) { - format( - "template <>\n" - "inline const EnumDescriptor* GetEnumDescriptor< $classtype$>() {\n" - " return $classtype$_descriptor();\n" - "}\n"); - } -} - -void EnumGenerator::GenerateSymbolImports(io::Printer* printer) const { - Formatter format(printer, variables_); - format("typedef $classname$ $resolved_name$;\n"); - - for (int j = 0; j < descriptor_->value_count(); j++) { - std::string deprecated_attr = - DeprecatedAttribute(options_, descriptor_->value(j)); - format( - "$1$static constexpr $resolved_name$ ${2$$3$$}$ =\n" - " $classname$_$3$;\n", - deprecated_attr, descriptor_->value(j), - EnumValueName(descriptor_->value(j))); - } - - format( - "static inline bool $nested_name$_IsValid(int value) {\n" - " return $classname$_IsValid(value);\n" - "}\n" - "static constexpr $resolved_name$ ${1$$nested_name$_MIN$}$ =\n" - " $classname$_$nested_name$_MIN;\n" - "static constexpr $resolved_name$ ${1$$nested_name$_MAX$}$ =\n" - " $classname$_$nested_name$_MAX;\n", - descriptor_); - if (generate_array_size_) { - format( - "static constexpr int ${1$$nested_name$_ARRAYSIZE$}$ =\n" - " $classname$_$nested_name$_ARRAYSIZE;\n", - descriptor_); - } - - if (HasDescriptorMethods(descriptor_->file(), options_)) { - format( - "static inline const ::$proto_ns$::EnumDescriptor*\n" - "$nested_name$_descriptor() {\n" - " return $classname$_descriptor();\n" - "}\n"); - } - - format( - "template\n" - "static inline const std::string& $nested_name$_Name(T enum_t_value) {\n" - " static_assert(::std::is_same::value ||\n" - " ::std::is_integral::value,\n" - " \"Incorrect type passed to function $nested_name$_Name.\");\n" - " return $classname$_Name(enum_t_value);\n" - "}\n"); - format( - "static inline bool " - "$nested_name$_Parse(::PROTOBUF_NAMESPACE_ID::ConstStringParam name,\n" - " $resolved_name$* value) {\n" - " return $classname$_Parse(name, value);\n" - "}\n"); -} - -void EnumGenerator::GenerateMethods(int idx, io::Printer* printer) { - Formatter format(printer, variables_); - if (HasDescriptorMethods(descriptor_->file(), options_)) { - format( - "const ::$proto_ns$::EnumDescriptor* $classname$_descriptor() {\n" - " ::$proto_ns$::internal::AssignDescriptors(&$desc_table$);\n" - " return $file_level_enum_descriptors$[$1$];\n" - "}\n", - idx); - } - - format( - "bool $classname$_IsValid(int value) {\n" - " switch (value) {\n"); - - // Multiple values may have the same number. Make sure we only cover - // each number once by first constructing a set containing all valid - // numbers, then printing a case statement for each element. - - std::set numbers; - for (int j = 0; j < descriptor_->value_count(); j++) { - const EnumValueDescriptor* value = descriptor_->value(j); - numbers.insert(value->number()); - } - - for (std::set::iterator iter = numbers.begin(); iter != numbers.end(); - ++iter) { - format(" case $1$:\n", Int32ToString(*iter)); - } - - format( - " return true;\n" - " default:\n" - " return false;\n" - " }\n" - "}\n" - "\n"); - - if (!HasDescriptorMethods(descriptor_->file(), options_)) { - // In lite mode (where descriptors are unavailable), we generate separate - // tables for mapping between enum names and numbers. The _entries table - // contains the bulk of the data and is sorted by name, while - // _entries_by_number is sorted by number and just contains pointers into - // _entries. The two tables allow mapping from name to number and number to - // name, both in time logarithmic in the number of enum entries. This could - // probably be made faster, but for now the tables are intended to be simple - // and compact. - // - // Enums with allow_alias = true support multiple entries with the same - // numerical value. In cases where there are multiple names for the same - // number, we treat the first name appearing in the .proto file as the - // canonical one. - std::map name_to_number; - std::map number_to_canonical_name; - for (int i = 0; i < descriptor_->value_count(); i++) { - const EnumValueDescriptor* value = descriptor_->value(i); - name_to_number.emplace(value->name(), value->number()); - // The same number may appear with multiple names, so we use emplace() to - // let the first name win. - number_to_canonical_name.emplace(value->number(), value->name()); - } - - format( - "static ::$proto_ns$::internal::ExplicitlyConstructed " - "$classname$_strings[$1$] = {};\n\n", - CountUniqueValues(descriptor_)); - - // We concatenate all the names for a given enum into one big string - // literal. If instead we store an array of string literals, the linker - // seems to put all enum strings for a given .proto file in the same - // section, which hinders its ability to strip out unused strings. - format("static const char $classname$_names[] ="); - for (const auto& p : name_to_number) { - format("\n \"$1$\"", p.first); - } - format(";\n\n"); - - format( - "static const ::$proto_ns$::internal::EnumEntry $classname$_entries[] " - "= {\n"); - int i = 0; - std::map number_to_index; - int data_index = 0; - for (const auto& p : name_to_number) { - format(" { {$classname$_names + $1$, $2$}, $3$ },\n", data_index, - p.first.size(), p.second); - if (number_to_canonical_name[p.second] == p.first) { - number_to_index.emplace(p.second, i); - } - ++i; - data_index += p.first.size(); - } - - format( - "};\n" - "\n" - "static const int $classname$_entries_by_number[] = {\n"); - for (const auto& p : number_to_index) { - format(" $1$, // $2$ -> $3$\n", p.second, p.first, - number_to_canonical_name[p.first]); - } - format( - "};\n" - "\n"); - - format( - "const std::string& $classname$_Name(\n" - " $classname$ value) {\n" - " static const bool dummy =\n" - " ::$proto_ns$::internal::InitializeEnumStrings(\n" - " $classname$_entries,\n" - " $classname$_entries_by_number,\n" - " $1$, $classname$_strings);\n" - " (void) dummy;\n" - " int idx = ::$proto_ns$::internal::LookUpEnumName(\n" - " $classname$_entries,\n" - " $classname$_entries_by_number,\n" - " $1$, value);\n" - " return idx == -1 ? ::$proto_ns$::internal::GetEmptyString() :\n" - " $classname$_strings[idx].get();\n" - "}\n", - CountUniqueValues(descriptor_)); - format( - "bool $classname$_Parse(\n" - " ::PROTOBUF_NAMESPACE_ID::ConstStringParam name, $classname$* " - "value) " - "{\n" - " int int_value;\n" - " bool success = ::$proto_ns$::internal::LookUpEnumValue(\n" - " $classname$_entries, $1$, name, &int_value);\n" - " if (success) {\n" - " *value = static_cast<$classname$>(int_value);\n" - " }\n" - " return success;\n" - "}\n", - descriptor_->value_count()); - } - - if (descriptor_->containing_type() != NULL) { - std::string parent = ClassName(descriptor_->containing_type(), false); - // Before C++17, we must define the static constants which were - // declared in the header, to give the linker a place to put them. - // But MSVC++ pre-2015 and post-2017 (version 15.5+) insists that we not. - format( - "#if (__cplusplus < 201703) && " - "(!defined(_MSC_VER) || (_MSC_VER >= 1900 && _MSC_VER < 1912))\n"); - - for (int i = 0; i < descriptor_->value_count(); i++) { - format("constexpr $classname$ $1$::$2$;\n", parent, - EnumValueName(descriptor_->value(i))); - } - format( - "constexpr $classname$ $1$::$nested_name$_MIN;\n" - "constexpr $classname$ $1$::$nested_name$_MAX;\n", - parent); - if (generate_array_size_) { - format("constexpr int $1$::$nested_name$_ARRAYSIZE;\n", parent); - } - - format( - "#endif // (__cplusplus < 201703) && " - "(!defined(_MSC_VER) || (_MSC_VER >= 1900 && _MSC_VER < 1912))\n"); - } -} - -} // namespace cpp -} // namespace compiler -} // namespace protobuf -} // namespace google diff --git a/extra/protobuf/protobuf-3.19.4/src/google/protobuf/compiler/cpp/cpp_enum.h b/extra/protobuf/protobuf-3.19.4/src/google/protobuf/compiler/cpp/cpp_enum.h deleted file mode 100644 index 3687f04c271f..000000000000 --- a/extra/protobuf/protobuf-3.19.4/src/google/protobuf/compiler/cpp/cpp_enum.h +++ /dev/null @@ -1,105 +0,0 @@ -// Protocol Buffers - Google's data interchange format -// Copyright 2008 Google Inc. All rights reserved. -// https://developers.google.com/protocol-buffers/ -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// * Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// * Redistributions in binary form must reproduce the above -// copyright notice, this list of conditions and the following disclaimer -// in the documentation and/or other materials provided with the -// distribution. -// * Neither the name of Google Inc. nor the names of its -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -// Author: kenton@google.com (Kenton Varda) -// Based on original Protocol Buffers design by -// Sanjay Ghemawat, Jeff Dean, and others. - -#ifndef GOOGLE_PROTOBUF_COMPILER_CPP_ENUM_H__ -#define GOOGLE_PROTOBUF_COMPILER_CPP_ENUM_H__ - -#include -#include -#include -#include -#include - -namespace google { -namespace protobuf { -namespace io { -class Printer; // printer.h -} -} // namespace protobuf -} // namespace google - -namespace google { -namespace protobuf { -namespace compiler { -namespace cpp { - -class EnumGenerator { - public: - // See generator.cc for the meaning of dllexport_decl. - EnumGenerator(const EnumDescriptor* descriptor, - const std::map& vars, - const Options& options); - ~EnumGenerator(); - - // Generate header code defining the enum. This code should be placed - // within the enum's package namespace, but NOT within any class, even for - // nested enums. - void GenerateDefinition(io::Printer* printer); - - // Generate specialization of GetEnumDescriptor(). - // Precondition: in ::google::protobuf namespace. - void GenerateGetEnumDescriptorSpecializations(io::Printer* printer); - - // For enums nested within a message, generate code to import all the enum's - // symbols (e.g. the enum type name, all its values, etc.) into the class's - // namespace. This should be placed inside the class definition in the - // header. - void GenerateSymbolImports(io::Printer* printer) const; - - // Source file stuff. - - // Generate non-inline methods related to the enum, such as IsValidValue(). - // Goes in the .cc file. EnumDescriptors are stored in an array, idx is - // the index in this array that corresponds with this enum. - void GenerateMethods(int idx, io::Printer* printer); - - private: - const EnumDescriptor* descriptor_; - const std::string classname_; - const Options& options_; - // whether to generate the *_ARRAYSIZE constant. - const bool generate_array_size_; - - std::map variables_; - - friend class FileGenerator; - GOOGLE_DISALLOW_EVIL_CONSTRUCTORS(EnumGenerator); -}; - -} // namespace cpp -} // namespace compiler -} // namespace protobuf -} // namespace google - -#endif // GOOGLE_PROTOBUF_COMPILER_CPP_ENUM_H__ diff --git a/extra/protobuf/protobuf-3.19.4/src/google/protobuf/compiler/cpp/cpp_enum_field.cc b/extra/protobuf/protobuf-3.19.4/src/google/protobuf/compiler/cpp/cpp_enum_field.cc deleted file mode 100644 index 70311dde40ed..000000000000 --- a/extra/protobuf/protobuf-3.19.4/src/google/protobuf/compiler/cpp/cpp_enum_field.cc +++ /dev/null @@ -1,406 +0,0 @@ -// Protocol Buffers - Google's data interchange format -// Copyright 2008 Google Inc. All rights reserved. -// https://developers.google.com/protocol-buffers/ -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// * Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// * Redistributions in binary form must reproduce the above -// copyright notice, this list of conditions and the following disclaimer -// in the documentation and/or other materials provided with the -// distribution. -// * Neither the name of Google Inc. nor the names of its -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -// Author: kenton@google.com (Kenton Varda) -// Based on original Protocol Buffers design by -// Sanjay Ghemawat, Jeff Dean, and others. - -#include -#include -#include -#include -#include - -namespace google { -namespace protobuf { -namespace compiler { -namespace cpp { - -namespace { - -void SetEnumVariables(const FieldDescriptor* descriptor, - std::map* variables, - const Options& options) { - SetCommonFieldVariables(descriptor, variables, options); - const EnumValueDescriptor* default_value = descriptor->default_value_enum(); - (*variables)["type"] = QualifiedClassName(descriptor->enum_type(), options); - (*variables)["default"] = Int32ToString(default_value->number()); - (*variables)["full_name"] = descriptor->full_name(); -} - -} // namespace - -// =================================================================== - -EnumFieldGenerator::EnumFieldGenerator(const FieldDescriptor* descriptor, - const Options& options) - : FieldGenerator(descriptor, options) { - SetEnumVariables(descriptor, &variables_, options); -} - -EnumFieldGenerator::~EnumFieldGenerator() {} - -void EnumFieldGenerator::GeneratePrivateMembers(io::Printer* printer) const { - Formatter format(printer, variables_); - format("int $name$_;\n"); -} - -void EnumFieldGenerator::GenerateAccessorDeclarations( - io::Printer* printer) const { - Formatter format(printer, variables_); - format( - "$deprecated_attr$$type$ ${1$$name$$}$() const;\n" - "$deprecated_attr$void ${1$set_$name$$}$($type$ value);\n" - "private:\n" - "$type$ ${1$_internal_$name$$}$() const;\n" - "void ${1$_internal_set_$name$$}$($type$ value);\n" - "public:\n", - descriptor_); -} - -void EnumFieldGenerator::GenerateInlineAccessorDefinitions( - io::Printer* printer) const { - Formatter format(printer, variables_); - format( - "inline $type$ $classname$::_internal_$name$() const {\n" - " return static_cast< $type$ >($name$_);\n" - "}\n" - "inline $type$ $classname$::$name$() const {\n" - "$annotate_get$" - " // @@protoc_insertion_point(field_get:$full_name$)\n" - " return _internal_$name$();\n" - "}\n" - "inline void $classname$::_internal_set_$name$($type$ value) {\n"); - if (!HasPreservingUnknownEnumSemantics(descriptor_)) { - format(" assert($type$_IsValid(value));\n"); - } - format( - " $set_hasbit$\n" - " $name$_ = value;\n" - "}\n" - "inline void $classname$::set_$name$($type$ value) {\n" - " _internal_set_$name$(value);\n" - "$annotate_set$" - " // @@protoc_insertion_point(field_set:$full_name$)\n" - "}\n"); -} - -void EnumFieldGenerator::GenerateClearingCode(io::Printer* printer) const { - Formatter format(printer, variables_); - format("$name$_ = $default$;\n"); -} - -void EnumFieldGenerator::GenerateMergingCode(io::Printer* printer) const { - Formatter format(printer, variables_); - format("_internal_set_$name$(from._internal_$name$());\n"); -} - -void EnumFieldGenerator::GenerateSwappingCode(io::Printer* printer) const { - Formatter format(printer, variables_); - format("swap($name$_, other->$name$_);\n"); -} - -void EnumFieldGenerator::GenerateConstructorCode(io::Printer* printer) const { - Formatter format(printer, variables_); - format("$name$_ = $default$;\n"); -} - -void EnumFieldGenerator::GenerateCopyConstructorCode( - io::Printer* printer) const { - Formatter format(printer, variables_); - format("$name$_ = from.$name$_;\n"); -} - -void EnumFieldGenerator::GenerateSerializeWithCachedSizesToArray( - io::Printer* printer) const { - Formatter format(printer, variables_); - format( - "target = stream->EnsureSpace(target);\n" - "target = ::$proto_ns$::internal::WireFormatLite::WriteEnumToArray(\n" - " $number$, this->_internal_$name$(), target);\n"); -} - -void EnumFieldGenerator::GenerateByteSize(io::Printer* printer) const { - Formatter format(printer, variables_); - format( - "total_size += $tag_size$ +\n" - " " - "::$proto_ns$::internal::WireFormatLite::EnumSize(this->_internal_$name$(" - "));\n"); -} - -void EnumFieldGenerator::GenerateConstinitInitializer( - io::Printer* printer) const { - Formatter format(printer, variables_); - format("$name$_($default$)\n"); -} - -// =================================================================== - -EnumOneofFieldGenerator::EnumOneofFieldGenerator( - const FieldDescriptor* descriptor, const Options& options) - : EnumFieldGenerator(descriptor, options) { - SetCommonOneofFieldVariables(descriptor, &variables_); -} - -EnumOneofFieldGenerator::~EnumOneofFieldGenerator() {} - -void EnumOneofFieldGenerator::GenerateInlineAccessorDefinitions( - io::Printer* printer) const { - Formatter format(printer, variables_); - format( - "inline $type$ $classname$::_internal_$name$() const {\n" - " if (_internal_has_$name$()) {\n" - " return static_cast< $type$ >($field_member$);\n" - " }\n" - " return static_cast< $type$ >($default$);\n" - "}\n" - "inline $type$ $classname$::$name$() const {\n" - "$annotate_get$" - " // @@protoc_insertion_point(field_get:$full_name$)\n" - " return _internal_$name$();\n" - "}\n" - "inline void $classname$::_internal_set_$name$($type$ value) {\n"); - if (!HasPreservingUnknownEnumSemantics(descriptor_)) { - format(" assert($type$_IsValid(value));\n"); - } - format( - " if (!_internal_has_$name$()) {\n" - " clear_$oneof_name$();\n" - " set_has_$name$();\n" - " }\n" - " $field_member$ = value;\n" - "}\n" - "inline void $classname$::set_$name$($type$ value) {\n" - " _internal_set_$name$(value);\n" - "$annotate_set$" - " // @@protoc_insertion_point(field_set:$full_name$)\n" - "}\n"); -} - -void EnumOneofFieldGenerator::GenerateClearingCode(io::Printer* printer) const { - Formatter format(printer, variables_); - format("$field_member$ = $default$;\n"); -} - -void EnumOneofFieldGenerator::GenerateSwappingCode(io::Printer* printer) const { - // Don't print any swapping code. Swapping the union will swap this field. -} - -void EnumOneofFieldGenerator::GenerateConstructorCode( - io::Printer* printer) const { - Formatter format(printer, variables_); - format("$ns$::_$classname$_default_instance_.$name$_ = $default$;\n"); -} - -// =================================================================== - -RepeatedEnumFieldGenerator::RepeatedEnumFieldGenerator( - const FieldDescriptor* descriptor, const Options& options) - : FieldGenerator(descriptor, options) { - SetEnumVariables(descriptor, &variables_, options); -} - -RepeatedEnumFieldGenerator::~RepeatedEnumFieldGenerator() {} - -void RepeatedEnumFieldGenerator::GeneratePrivateMembers( - io::Printer* printer) const { - Formatter format(printer, variables_); - format("::$proto_ns$::RepeatedField $name$_;\n"); - if (descriptor_->is_packed() && - HasGeneratedMethods(descriptor_->file(), options_)) { - format("mutable std::atomic _$name$_cached_byte_size_;\n"); - } -} - -void RepeatedEnumFieldGenerator::GenerateAccessorDeclarations( - io::Printer* printer) const { - Formatter format(printer, variables_); - format( - "private:\n" - "$type$ ${1$_internal_$name$$}$(int index) const;\n" - "void ${1$_internal_add_$name$$}$($type$ value);\n" - "::$proto_ns$::RepeatedField* " - "${1$_internal_mutable_$name$$}$();\n" - "public:\n" - "$deprecated_attr$$type$ ${1$$name$$}$(int index) const;\n" - "$deprecated_attr$void ${1$set_$name$$}$(int index, $type$ value);\n" - "$deprecated_attr$void ${1$add_$name$$}$($type$ value);\n" - "$deprecated_attr$const ::$proto_ns$::RepeatedField& " - "${1$$name$$}$() const;\n" - "$deprecated_attr$::$proto_ns$::RepeatedField* " - "${1$mutable_$name$$}$();\n", - descriptor_); -} - -void RepeatedEnumFieldGenerator::GenerateInlineAccessorDefinitions( - io::Printer* printer) const { - Formatter format(printer, variables_); - format( - "inline $type$ $classname$::_internal_$name$(int index) const {\n" - " return static_cast< $type$ >($name$_.Get(index));\n" - "}\n" - "inline $type$ $classname$::$name$(int index) const {\n" - "$annotate_get$" - " // @@protoc_insertion_point(field_get:$full_name$)\n" - " return _internal_$name$(index);\n" - "}\n" - "inline void $classname$::set_$name$(int index, $type$ value) {\n"); - if (!HasPreservingUnknownEnumSemantics(descriptor_)) { - format(" assert($type$_IsValid(value));\n"); - } - format( - " $name$_.Set(index, value);\n" - "$annotate_set$" - " // @@protoc_insertion_point(field_set:$full_name$)\n" - "}\n" - "inline void $classname$::_internal_add_$name$($type$ value) {\n"); - if (!HasPreservingUnknownEnumSemantics(descriptor_)) { - format(" assert($type$_IsValid(value));\n"); - } - format( - " $name$_.Add(value);\n" - "}\n" - "inline void $classname$::add_$name$($type$ value) {\n" - " _internal_add_$name$(value);\n" - "$annotate_add$" - " // @@protoc_insertion_point(field_add:$full_name$)\n" - "}\n" - "inline const ::$proto_ns$::RepeatedField&\n" - "$classname$::$name$() const {\n" - "$annotate_list$" - " // @@protoc_insertion_point(field_list:$full_name$)\n" - " return $name$_;\n" - "}\n" - "inline ::$proto_ns$::RepeatedField*\n" - "$classname$::_internal_mutable_$name$() {\n" - " return &$name$_;\n" - "}\n" - "inline ::$proto_ns$::RepeatedField*\n" - "$classname$::mutable_$name$() {\n" - "$annotate_mutable_list$" - " // @@protoc_insertion_point(field_mutable_list:$full_name$)\n" - " return _internal_mutable_$name$();\n" - "}\n"); -} - -void RepeatedEnumFieldGenerator::GenerateClearingCode( - io::Printer* printer) const { - Formatter format(printer, variables_); - format("$name$_.Clear();\n"); -} - -void RepeatedEnumFieldGenerator::GenerateMergingCode( - io::Printer* printer) const { - Formatter format(printer, variables_); - format("$name$_.MergeFrom(from.$name$_);\n"); -} - -void RepeatedEnumFieldGenerator::GenerateSwappingCode( - io::Printer* printer) const { - Formatter format(printer, variables_); - format("$name$_.InternalSwap(&other->$name$_);\n"); -} - -void RepeatedEnumFieldGenerator::GenerateConstructorCode( - io::Printer* printer) const { - // Not needed for repeated fields. -} - -void RepeatedEnumFieldGenerator::GenerateSerializeWithCachedSizesToArray( - io::Printer* printer) const { - Formatter format(printer, variables_); - if (descriptor_->is_packed()) { - // Write the tag and the size. - format( - "{\n" - " int byte_size = " - "_$name$_cached_byte_size_.load(std::memory_order_relaxed);\n" - " if (byte_size > 0) {\n" - " target = stream->WriteEnumPacked(\n" - " $number$, $name$_, byte_size, target);\n" - " }\n" - "}\n"); - } else { - format( - "for (int i = 0, n = this->_internal_$name$_size(); i < n; i++) {\n" - " target = stream->EnsureSpace(target);\n" - " target = ::$proto_ns$::internal::WireFormatLite::WriteEnumToArray(\n" - " $number$, this->_internal_$name$(i), target);\n" - "}\n"); - } -} - -void RepeatedEnumFieldGenerator::GenerateByteSize(io::Printer* printer) const { - Formatter format(printer, variables_); - format( - "{\n" - " size_t data_size = 0;\n" - " unsigned int count = static_cast(this->_internal_$name$_size());"); - format.Indent(); - format( - "for (unsigned int i = 0; i < count; i++) {\n" - " data_size += ::$proto_ns$::internal::WireFormatLite::EnumSize(\n" - " this->_internal_$name$(static_cast(i)));\n" - "}\n"); - - if (descriptor_->is_packed()) { - format( - "if (data_size > 0) {\n" - " total_size += $tag_size$ +\n" - " ::$proto_ns$::internal::WireFormatLite::Int32Size(\n" - " static_cast<$int32$>(data_size));\n" - "}\n" - "int cached_size = ::$proto_ns$::internal::ToCachedSize(data_size);\n" - "_$name$_cached_byte_size_.store(cached_size,\n" - " std::memory_order_relaxed);\n" - "total_size += data_size;\n"); - } else { - format("total_size += ($tag_size$UL * count) + data_size;\n"); - } - format.Outdent(); - format("}\n"); -} - -void RepeatedEnumFieldGenerator::GenerateConstinitInitializer( - io::Printer* printer) const { - Formatter format(printer, variables_); - format("$name$_()"); - if (descriptor_->is_packed() && - HasGeneratedMethods(descriptor_->file(), options_)) { - format("\n, _$name$_cached_byte_size_(0)"); - } -} - -} // namespace cpp -} // namespace compiler -} // namespace protobuf -} // namespace google diff --git a/extra/protobuf/protobuf-3.19.4/src/google/protobuf/compiler/cpp/cpp_enum_field.h b/extra/protobuf/protobuf-3.19.4/src/google/protobuf/compiler/cpp/cpp_enum_field.h deleted file mode 100644 index e65ec0f5c075..000000000000 --- a/extra/protobuf/protobuf-3.19.4/src/google/protobuf/compiler/cpp/cpp_enum_field.h +++ /dev/null @@ -1,115 +0,0 @@ -// Protocol Buffers - Google's data interchange format -// Copyright 2008 Google Inc. All rights reserved. -// https://developers.google.com/protocol-buffers/ -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// * Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// * Redistributions in binary form must reproduce the above -// copyright notice, this list of conditions and the following disclaimer -// in the documentation and/or other materials provided with the -// distribution. -// * Neither the name of Google Inc. nor the names of its -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -// Author: kenton@google.com (Kenton Varda) -// Based on original Protocol Buffers design by -// Sanjay Ghemawat, Jeff Dean, and others. - -#ifndef GOOGLE_PROTOBUF_COMPILER_CPP_ENUM_FIELD_H__ -#define GOOGLE_PROTOBUF_COMPILER_CPP_ENUM_FIELD_H__ - -#include -#include -#include - -namespace google { -namespace protobuf { -namespace compiler { -namespace cpp { - -class EnumFieldGenerator : public FieldGenerator { - public: - EnumFieldGenerator(const FieldDescriptor* descriptor, const Options& options); - ~EnumFieldGenerator(); - - // implements FieldGenerator --------------------------------------- - void GeneratePrivateMembers(io::Printer* printer) const override; - void GenerateAccessorDeclarations(io::Printer* printer) const override; - void GenerateInlineAccessorDefinitions(io::Printer* printer) const override; - void GenerateClearingCode(io::Printer* printer) const override; - void GenerateMergingCode(io::Printer* printer) const override; - void GenerateSwappingCode(io::Printer* printer) const override; - void GenerateConstructorCode(io::Printer* printer) const override; - void GenerateCopyConstructorCode(io::Printer* printer) const override; - void GenerateSerializeWithCachedSizesToArray( - io::Printer* printer) const override; - void GenerateByteSize(io::Printer* printer) const override; - void GenerateConstinitInitializer(io::Printer* printer) const override; - - private: - GOOGLE_DISALLOW_EVIL_CONSTRUCTORS(EnumFieldGenerator); -}; - -class EnumOneofFieldGenerator : public EnumFieldGenerator { - public: - EnumOneofFieldGenerator(const FieldDescriptor* descriptor, - const Options& options); - ~EnumOneofFieldGenerator(); - - // implements FieldGenerator --------------------------------------- - void GenerateInlineAccessorDefinitions(io::Printer* printer) const override; - void GenerateClearingCode(io::Printer* printer) const override; - void GenerateSwappingCode(io::Printer* printer) const override; - void GenerateConstructorCode(io::Printer* printer) const override; - - private: - GOOGLE_DISALLOW_EVIL_CONSTRUCTORS(EnumOneofFieldGenerator); -}; - -class RepeatedEnumFieldGenerator : public FieldGenerator { - public: - RepeatedEnumFieldGenerator(const FieldDescriptor* descriptor, - const Options& options); - ~RepeatedEnumFieldGenerator(); - - // implements FieldGenerator --------------------------------------- - void GeneratePrivateMembers(io::Printer* printer) const override; - void GenerateAccessorDeclarations(io::Printer* printer) const override; - void GenerateInlineAccessorDefinitions(io::Printer* printer) const override; - void GenerateClearingCode(io::Printer* printer) const override; - void GenerateMergingCode(io::Printer* printer) const override; - void GenerateSwappingCode(io::Printer* printer) const override; - void GenerateConstructorCode(io::Printer* printer) const override; - void GenerateCopyConstructorCode(io::Printer* printer) const override {} - void GenerateSerializeWithCachedSizesToArray( - io::Printer* printer) const override; - void GenerateByteSize(io::Printer* printer) const override; - void GenerateConstinitInitializer(io::Printer* printer) const override; - - private: - GOOGLE_DISALLOW_EVIL_CONSTRUCTORS(RepeatedEnumFieldGenerator); -}; - -} // namespace cpp -} // namespace compiler -} // namespace protobuf -} // namespace google - -#endif // GOOGLE_PROTOBUF_COMPILER_CPP_ENUM_FIELD_H__ diff --git a/extra/protobuf/protobuf-3.19.4/src/google/protobuf/compiler/cpp/cpp_extension.cc b/extra/protobuf/protobuf-3.19.4/src/google/protobuf/compiler/cpp/cpp_extension.cc deleted file mode 100644 index 8604da5f275f..000000000000 --- a/extra/protobuf/protobuf-3.19.4/src/google/protobuf/compiler/cpp/cpp_extension.cc +++ /dev/null @@ -1,189 +0,0 @@ -// Protocol Buffers - Google's data interchange format -// Copyright 2008 Google Inc. All rights reserved. -// https://developers.google.com/protocol-buffers/ -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// * Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// * Redistributions in binary form must reproduce the above -// copyright notice, this list of conditions and the following disclaimer -// in the documentation and/or other materials provided with the -// distribution. -// * Neither the name of Google Inc. nor the names of its -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -// Author: kenton@google.com (Kenton Varda) -// Based on original Protocol Buffers design by -// Sanjay Ghemawat, Jeff Dean, and others. - -#include -#include -#include -#include -#include -#include - -namespace google { -namespace protobuf { -namespace compiler { -namespace cpp { - -ExtensionGenerator::ExtensionGenerator(const FieldDescriptor* descriptor, - const Options& options, - MessageSCCAnalyzer* scc_analyzer) - : descriptor_(descriptor), options_(options), scc_analyzer_(scc_analyzer) { - // Construct type_traits_. - if (descriptor_->is_repeated()) { - type_traits_ = "Repeated"; - } - - switch (descriptor_->cpp_type()) { - case FieldDescriptor::CPPTYPE_ENUM: - type_traits_.append("EnumTypeTraits< "); - type_traits_.append(ClassName(descriptor_->enum_type(), true)); - type_traits_.append(", "); - type_traits_.append(ClassName(descriptor_->enum_type(), true)); - type_traits_.append("_IsValid>"); - break; - case FieldDescriptor::CPPTYPE_STRING: - type_traits_.append("StringTypeTraits"); - break; - case FieldDescriptor::CPPTYPE_MESSAGE: - type_traits_.append("MessageTypeTraits< "); - type_traits_.append(ClassName(descriptor_->message_type(), true)); - type_traits_.append(" >"); - break; - default: - type_traits_.append("PrimitiveTypeTraits< "); - type_traits_.append(PrimitiveTypeName(options_, descriptor_->cpp_type())); - type_traits_.append(" >"); - break; - } - SetCommonVars(options, &variables_); - variables_["extendee"] = - QualifiedClassName(descriptor_->containing_type(), options_); - variables_["type_traits"] = type_traits_; - std::string name = descriptor_->name(); - variables_["name"] = ResolveKeyword(name); - variables_["constant_name"] = FieldConstantName(descriptor_); - variables_["field_type"] = - StrCat(static_cast(descriptor_->type())); - variables_["packed"] = descriptor_->is_packed() ? "true" : "false"; - - std::string scope = - IsScoped() ? ClassName(descriptor_->extension_scope(), false) + "::" : ""; - variables_["scope"] = scope; - variables_["scoped_name"] = ExtensionName(descriptor_); - variables_["number"] = StrCat(descriptor_->number()); -} - -ExtensionGenerator::~ExtensionGenerator() {} - -bool ExtensionGenerator::IsScoped() const { - return descriptor_->extension_scope() != nullptr; -} - -void ExtensionGenerator::GenerateDeclaration(io::Printer* printer) const { - Formatter format(printer, variables_); - - // If this is a class member, it needs to be declared "static". Otherwise, - // it needs to be "extern". In the latter case, it also needs the DLL - // export/import specifier. - std::string qualifier; - if (!IsScoped()) { - qualifier = "extern"; - if (!options_.dllexport_decl.empty()) { - qualifier = options_.dllexport_decl + " " + qualifier; - } - } else { - qualifier = "static"; - } - - format( - "static const int $constant_name$ = $number$;\n" - "$1$ ::$proto_ns$::internal::ExtensionIdentifier< $extendee$,\n" - " ::$proto_ns$::internal::$type_traits$, $field_type$, $packed$ >\n" - " ${2$$name$$}$;\n", - qualifier, descriptor_); -} - -void ExtensionGenerator::GenerateDefinition(io::Printer* printer) { - // If we are building for lite with implicit weak fields, we want to skip over - // any custom options (i.e. extensions of messages from descriptor.proto). - // This prevents the creation of any unnecessary linker references to the - // descriptor messages. - if (options_.lite_implicit_weak_fields && - descriptor_->containing_type()->file()->name() == - "net/proto2/proto/descriptor.proto") { - return; - } - - Formatter format(printer, variables_); - std::string default_str; - // If this is a class member, it needs to be declared in its class scope. - if (descriptor_->cpp_type() == FieldDescriptor::CPPTYPE_STRING) { - // We need to declare a global string which will contain the default value. - // We cannot declare it at class scope because that would require exposing - // it in the header which would be annoying for other reasons. So we - // replace :: with _ in the name and declare it as a global. - default_str = - StringReplace(variables_["scoped_name"], "::", "_", true) + "_default"; - format("const std::string $1$($2$);\n", default_str, - DefaultValue(options_, descriptor_)); - } else if (descriptor_->message_type()) { - // We have to initialize the default instance for extensions at registration - // time. - default_str = - FieldMessageTypeName(descriptor_, options_) + "::default_instance()"; - } else { - default_str = DefaultValue(options_, descriptor_); - } - - // Likewise, class members need to declare the field constant variable. - if (IsScoped()) { - format( - "#if !defined(_MSC_VER) || (_MSC_VER >= 1900 && _MSC_VER < 1912)\n" - "const int $scope$$constant_name$;\n" - "#endif\n"); - } - - format( - "PROTOBUF_ATTRIBUTE_INIT_PRIORITY " - "::$proto_ns$::internal::ExtensionIdentifier< $extendee$,\n" - " ::$proto_ns$::internal::$type_traits$, $field_type$, $packed$ >\n" - " $scoped_name$($constant_name$, $1$);\n", - default_str); - - // Register extension verify function if needed. - if (descriptor_->cpp_type() == FieldDescriptor::CPPTYPE_MESSAGE && - ShouldVerify(descriptor_->message_type(), options_, scc_analyzer_) && - ShouldVerify(descriptor_->containing_type(), options_, scc_analyzer_)) { - format( - "PROTOBUF_ATTRIBUTE_INIT_PRIORITY " - "::$proto_ns$::internal::RegisterExtensionVerify< $extendee$,\n" - " $1$, $number$> $2$_$name$_register;\n", - ClassName(descriptor_->message_type(), true), - IsScoped() ? ClassName(descriptor_->extension_scope(), false) : ""); - } -} - -} // namespace cpp -} // namespace compiler -} // namespace protobuf -} // namespace google diff --git a/extra/protobuf/protobuf-3.19.4/src/google/protobuf/compiler/cpp/cpp_extension.h b/extra/protobuf/protobuf-3.19.4/src/google/protobuf/compiler/cpp/cpp_extension.h deleted file mode 100644 index bcc80186d27c..000000000000 --- a/extra/protobuf/protobuf-3.19.4/src/google/protobuf/compiler/cpp/cpp_extension.h +++ /dev/null @@ -1,95 +0,0 @@ -// Protocol Buffers - Google's data interchange format -// Copyright 2008 Google Inc. All rights reserved. -// https://developers.google.com/protocol-buffers/ -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// * Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// * Redistributions in binary form must reproduce the above -// copyright notice, this list of conditions and the following disclaimer -// in the documentation and/or other materials provided with the -// distribution. -// * Neither the name of Google Inc. nor the names of its -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -// Author: kenton@google.com (Kenton Varda) -// Based on original Protocol Buffers design by -// Sanjay Ghemawat, Jeff Dean, and others. - -#ifndef GOOGLE_PROTOBUF_COMPILER_CPP_EXTENSION_H__ -#define GOOGLE_PROTOBUF_COMPILER_CPP_EXTENSION_H__ - -#include -#include - -#include -#include - -namespace google { -namespace protobuf { -class FieldDescriptor; // descriptor.h -namespace io { -class Printer; // printer.h -} -} // namespace protobuf -} // namespace google - -namespace google { -namespace protobuf { -namespace compiler { -namespace cpp { - -class MessageSCCAnalyzer; - -// Generates code for an extension, which may be within the scope of some -// message or may be at file scope. This is much simpler than FieldGenerator -// since extensions are just simple identifiers with interesting types. -class ExtensionGenerator { - public: - // See generator.cc for the meaning of dllexport_decl. - explicit ExtensionGenerator(const FieldDescriptor* descriptor, - const Options& options, - MessageSCCAnalyzer* scc_analyzer); - ~ExtensionGenerator(); - - // Header stuff. - void GenerateDeclaration(io::Printer* printer) const; - - // Source file stuff. - void GenerateDefinition(io::Printer* printer); - - bool IsScoped() const; - - private: - const FieldDescriptor* descriptor_; - std::string type_traits_; - Options options_; - MessageSCCAnalyzer* scc_analyzer_; - - std::map variables_; - - GOOGLE_DISALLOW_EVIL_CONSTRUCTORS(ExtensionGenerator); -}; - -} // namespace cpp -} // namespace compiler -} // namespace protobuf -} // namespace google - -#endif // GOOGLE_PROTOBUF_COMPILER_CPP_MESSAGE_H__ diff --git a/extra/protobuf/protobuf-3.19.4/src/google/protobuf/compiler/cpp/cpp_field.cc b/extra/protobuf/protobuf-3.19.4/src/google/protobuf/compiler/cpp/cpp_field.cc deleted file mode 100644 index a95dd33e91b9..000000000000 --- a/extra/protobuf/protobuf-3.19.4/src/google/protobuf/compiler/cpp/cpp_field.cc +++ /dev/null @@ -1,391 +0,0 @@ -// Protocol Buffers - Google's data interchange format -// Copyright 2008 Google Inc. All rights reserved. -// https://developers.google.com/protocol-buffers/ -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// * Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// * Redistributions in binary form must reproduce the above -// copyright notice, this list of conditions and the following disclaimer -// in the documentation and/or other materials provided with the -// distribution. -// * Neither the name of Google Inc. nor the names of its -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -// Author: kenton@google.com (Kenton Varda) -// Based on original Protocol Buffers design by -// Sanjay Ghemawat, Jeff Dean, and others. - -#include - -#include -#include -#include - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -namespace google { -namespace protobuf { -namespace compiler { -namespace cpp { - -using internal::WireFormat; - -namespace { - -void MaySetAnnotationVariable(const Options& options, - StringPiece annotation_name, - StringPiece substitute_template_prefix, - StringPiece prepared_template, - int field_index, StringPiece access_type, - std::map* variables) { - if (options.field_listener_options.forbidden_field_listener_events.count( - std::string(annotation_name))) - return; - (*variables)[StrCat("annotate_", annotation_name)] = strings::Substitute( - StrCat(substitute_template_prefix, prepared_template, ");\n"), - field_index, access_type); -} - -std::string GenerateTemplateForOneofString(const FieldDescriptor* descriptor, - StringPiece proto_ns, - StringPiece field_member) { - std::string field_name = google::protobuf::compiler::cpp::FieldName(descriptor); - std::string field_pointer = - descriptor->options().ctype() == google::protobuf::FieldOptions::STRING - ? "$0.GetPointer()" - : "$0"; - - if (descriptor->default_value_string().empty()) { - return strings::Substitute(StrCat("_internal_has_", field_name, "() ? ", - field_pointer, ": nullptr"), - field_member); - } - - if (descriptor->options().ctype() == google::protobuf::FieldOptions::STRING_PIECE) { - return strings::Substitute(StrCat("_internal_has_", field_name, "() ? ", - field_pointer, ": nullptr"), - field_member); - } - - std::string default_value_pointer = - descriptor->options().ctype() == google::protobuf::FieldOptions::STRING - ? "&$1.get()" - : "&$1"; - return strings::Substitute( - StrCat("_internal_has_", field_name, "() ? ", field_pointer, " : ", - default_value_pointer), - field_member, MakeDefaultName(descriptor)); -} - -std::string GenerateTemplateForSingleString(const FieldDescriptor* descriptor, - StringPiece field_member) { - if (descriptor->default_value_string().empty()) { - return StrCat("&", field_member); - } - - if (descriptor->options().ctype() == google::protobuf::FieldOptions::STRING) { - return strings::Substitute( - "$0.IsDefault(nullptr) ? &$1.get() : $0.GetPointer()", field_member, - MakeDefaultName(descriptor)); - } - - return StrCat("&", field_member); -} - -} // namespace - -void AddAccessorAnnotations(const FieldDescriptor* descriptor, - const Options& options, - std::map* variables) { - // Can be expanded to include more specific calls, for example, for arena or - // clear calls. - static constexpr const char* kAccessorsAnnotations[] = { - "annotate_add", "annotate_get", "annotate_has", - "annotate_list", "annotate_mutable", "annotate_mutable_list", - "annotate_release", "annotate_set", "annotate_size", - "annotate_clear", "annotate_add_mutable", - }; - for (size_t i = 0; i < GOOGLE_ARRAYSIZE(kAccessorsAnnotations); ++i) { - (*variables)[kAccessorsAnnotations[i]] = ""; - } - if (options.annotate_accessor) { - for (size_t i = 0; i < GOOGLE_ARRAYSIZE(kAccessorsAnnotations); ++i) { - (*variables)[kAccessorsAnnotations[i]] = StrCat( - " ", FieldName(descriptor), "_AccessedNoStrip = true;\n"); - } - } - if (!options.field_listener_options.inject_field_listener_events) { - return; - } - if (descriptor->file()->options().optimize_for() == - google::protobuf::FileOptions::LITE_RUNTIME) { - return; - } - std::string field_member = (*variables)["field_member"]; - const google::protobuf::OneofDescriptor* oneof_member = - descriptor->real_containing_oneof(); - if (oneof_member) { - field_member = StrCat(oneof_member->name(), "_.", field_member); - } - const std::string proto_ns = (*variables)["proto_ns"]; - const std::string substitute_template_prefix = " _tracker_.$1<$0>(this, "; - std::string prepared_template; - - // Flat template is needed if the prepared one is introspecting the values - // inside the returned values, for example, for repeated fields and maps. - std::string prepared_flat_template; - std::string prepared_add_template; - // TODO(b/190614678): Support fields with type Message or Map. - if (descriptor->is_repeated() && !descriptor->is_map()) { - if (descriptor->type() != FieldDescriptor::TYPE_MESSAGE && - descriptor->type() != FieldDescriptor::TYPE_GROUP) { - prepared_template = strings::Substitute("&$0.Get(index)", field_member); - prepared_add_template = - strings::Substitute("&$0.Get($0.size() - 1)", field_member); - } else { - prepared_template = "nullptr"; - prepared_add_template = "nullptr"; - } - } else if (descriptor->is_map()) { - prepared_template = "nullptr"; - } else if (descriptor->type() == FieldDescriptor::TYPE_MESSAGE && - !descriptor->options().lazy()) { - prepared_template = "nullptr"; - } else if (descriptor->cpp_type() == FieldDescriptor::CPPTYPE_STRING) { - if (oneof_member) { - prepared_template = GenerateTemplateForOneofString( - descriptor, (*variables)["proto_ns"], field_member); - } else { - prepared_template = - GenerateTemplateForSingleString(descriptor, field_member); - } - } else { - prepared_template = StrCat("&", field_member); - } - if (descriptor->is_repeated() && !descriptor->is_map() && - descriptor->type() != FieldDescriptor::TYPE_MESSAGE && - descriptor->type() != FieldDescriptor::TYPE_GROUP) { - prepared_flat_template = StrCat("&", field_member); - } else { - prepared_flat_template = prepared_template; - } - - MaySetAnnotationVariable(options, "get", substitute_template_prefix, - prepared_template, descriptor->index(), "OnGet", - variables); - MaySetAnnotationVariable(options, "set", substitute_template_prefix, - prepared_template, descriptor->index(), "OnSet", - variables); - MaySetAnnotationVariable(options, "has", substitute_template_prefix, - prepared_template, descriptor->index(), "OnHas", - variables); - MaySetAnnotationVariable(options, "mutable", substitute_template_prefix, - prepared_template, descriptor->index(), "OnMutable", - variables); - MaySetAnnotationVariable(options, "release", substitute_template_prefix, - prepared_template, descriptor->index(), "OnRelease", - variables); - MaySetAnnotationVariable(options, "clear", substitute_template_prefix, - prepared_flat_template, descriptor->index(), - "OnClear", variables); - MaySetAnnotationVariable(options, "size", substitute_template_prefix, - prepared_flat_template, descriptor->index(), - "OnSize", variables); - MaySetAnnotationVariable(options, "list", substitute_template_prefix, - prepared_flat_template, descriptor->index(), - "OnList", variables); - MaySetAnnotationVariable(options, "mutable_list", substitute_template_prefix, - prepared_flat_template, descriptor->index(), - "OnMutableList", variables); - MaySetAnnotationVariable(options, "add", substitute_template_prefix, - prepared_add_template, descriptor->index(), "OnAdd", - variables); - MaySetAnnotationVariable(options, "add_mutable", substitute_template_prefix, - prepared_add_template, descriptor->index(), - "OnAddMutable", variables); -} - -void SetCommonFieldVariables(const FieldDescriptor* descriptor, - std::map* variables, - const Options& options) { - SetCommonVars(options, variables); - (*variables)["ns"] = Namespace(descriptor, options); - (*variables)["name"] = FieldName(descriptor); - (*variables)["index"] = StrCat(descriptor->index()); - (*variables)["number"] = StrCat(descriptor->number()); - (*variables)["classname"] = ClassName(FieldScope(descriptor), false); - (*variables)["declared_type"] = DeclaredTypeMethodName(descriptor->type()); - (*variables)["field_member"] = FieldName(descriptor) + "_"; - - (*variables)["tag_size"] = StrCat( - WireFormat::TagSize(descriptor->number(), descriptor->type())); - (*variables)["deprecated_attr"] = DeprecatedAttribute(options, descriptor); - - (*variables)["set_hasbit"] = ""; - (*variables)["clear_hasbit"] = ""; - if (HasHasbit(descriptor)) { - (*variables)["set_hasbit_io"] = - "_Internal::set_has_" + FieldName(descriptor) + "(&_has_bits_);"; - } else { - (*variables)["set_hasbit_io"] = ""; - } - - AddAccessorAnnotations(descriptor, options, variables); - - // These variables are placeholders to pick out the beginning and ends of - // identifiers for annotations (when doing so with existing variables would - // be ambiguous or impossible). They should never be set to anything but the - // empty string. - (*variables)["{"] = ""; - (*variables)["}"] = ""; -} - -void FieldGenerator::SetHasBitIndex(int32_t has_bit_index) { - if (!HasHasbit(descriptor_)) { - GOOGLE_CHECK_EQ(has_bit_index, -1); - return; - } - variables_["set_hasbit"] = StrCat( - "_has_bits_[", has_bit_index / 32, "] |= 0x", - strings::Hex(1u << (has_bit_index % 32), strings::ZERO_PAD_8), "u;"); - variables_["clear_hasbit"] = StrCat( - "_has_bits_[", has_bit_index / 32, "] &= ~0x", - strings::Hex(1u << (has_bit_index % 32), strings::ZERO_PAD_8), "u;"); -} - -void FieldGenerator::SetInlinedStringIndex(int32_t inlined_string_index) { - if (!IsStringInlined(descriptor_, options_)) { - GOOGLE_CHECK_EQ(inlined_string_index, -1); - return; - } - variables_["inlined_string_donated"] = StrCat( - "(_inlined_string_donated_[", inlined_string_index / 32, "] & 0x", - strings::Hex(1u << (inlined_string_index % 32), strings::ZERO_PAD_8), - "u) != 0;"); - variables_["donating_states_word"] = - StrCat("_inlined_string_donated_[", inlined_string_index / 32, "]"); - variables_["mask_for_undonate"] = StrCat( - "~0x", strings::Hex(1u << (inlined_string_index % 32), strings::ZERO_PAD_8), - "u"); -} - -void SetCommonOneofFieldVariables( - const FieldDescriptor* descriptor, - std::map* variables) { - const std::string prefix = descriptor->containing_oneof()->name() + "_."; - (*variables)["oneof_name"] = descriptor->containing_oneof()->name(); - (*variables)["field_member"] = - StrCat(prefix, (*variables)["name"], "_"); -} - -FieldGenerator::~FieldGenerator() {} - -FieldGeneratorMap::FieldGeneratorMap(const Descriptor* descriptor, - const Options& options, - MessageSCCAnalyzer* scc_analyzer) - : descriptor_(descriptor), field_generators_(descriptor->field_count()) { - // Construct all the FieldGenerators. - for (int i = 0; i < descriptor->field_count(); i++) { - field_generators_[i].reset( - MakeGenerator(descriptor->field(i), options, scc_analyzer)); - } -} - -FieldGenerator* FieldGeneratorMap::MakeGoogleInternalGenerator( - const FieldDescriptor* field, const Options& options, - MessageSCCAnalyzer* scc_analyzer) { - - return nullptr; -} - -FieldGenerator* FieldGeneratorMap::MakeGenerator( - const FieldDescriptor* field, const Options& options, - MessageSCCAnalyzer* scc_analyzer) { - FieldGenerator* generator = - MakeGoogleInternalGenerator(field, options, scc_analyzer); - if (generator) { - return generator; - } - - if (field->is_repeated()) { - switch (field->cpp_type()) { - case FieldDescriptor::CPPTYPE_MESSAGE: - if (field->is_map()) { - return new MapFieldGenerator(field, options, scc_analyzer); - } else { - return new RepeatedMessageFieldGenerator(field, options, - scc_analyzer); - } - case FieldDescriptor::CPPTYPE_STRING: - return new RepeatedStringFieldGenerator(field, options); - case FieldDescriptor::CPPTYPE_ENUM: - return new RepeatedEnumFieldGenerator(field, options); - default: - return new RepeatedPrimitiveFieldGenerator(field, options); - } - } else if (field->real_containing_oneof()) { - switch (field->cpp_type()) { - case FieldDescriptor::CPPTYPE_MESSAGE: - return new MessageOneofFieldGenerator(field, options, scc_analyzer); - case FieldDescriptor::CPPTYPE_STRING: - return new StringOneofFieldGenerator(field, options); - case FieldDescriptor::CPPTYPE_ENUM: - return new EnumOneofFieldGenerator(field, options); - default: - return new PrimitiveOneofFieldGenerator(field, options); - } - } else { - switch (field->cpp_type()) { - case FieldDescriptor::CPPTYPE_MESSAGE: - return new MessageFieldGenerator(field, options, scc_analyzer); - case FieldDescriptor::CPPTYPE_STRING: - return new StringFieldGenerator(field, options); - case FieldDescriptor::CPPTYPE_ENUM: - return new EnumFieldGenerator(field, options); - default: - return new PrimitiveFieldGenerator(field, options); - } - } -} - -FieldGeneratorMap::~FieldGeneratorMap() {} - -const FieldGenerator& FieldGeneratorMap::get( - const FieldDescriptor* field) const { - GOOGLE_CHECK_EQ(field->containing_type(), descriptor_); - return *field_generators_[field->index()]; -} - -} // namespace cpp -} // namespace compiler -} // namespace protobuf -} // namespace google diff --git a/extra/protobuf/protobuf-3.19.4/src/google/protobuf/compiler/cpp/cpp_field.h b/extra/protobuf/protobuf-3.19.4/src/google/protobuf/compiler/cpp/cpp_field.h deleted file mode 100644 index e0eb679b4c91..000000000000 --- a/extra/protobuf/protobuf-3.19.4/src/google/protobuf/compiler/cpp/cpp_field.h +++ /dev/null @@ -1,242 +0,0 @@ -// Protocol Buffers - Google's data interchange format -// Copyright 2008 Google Inc. All rights reserved. -// https://developers.google.com/protocol-buffers/ -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// * Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// * Redistributions in binary form must reproduce the above -// copyright notice, this list of conditions and the following disclaimer -// in the documentation and/or other materials provided with the -// distribution. -// * Neither the name of Google Inc. nor the names of its -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -// Author: kenton@google.com (Kenton Varda) -// Based on original Protocol Buffers design by -// Sanjay Ghemawat, Jeff Dean, and others. - -#ifndef GOOGLE_PROTOBUF_COMPILER_CPP_FIELD_H__ -#define GOOGLE_PROTOBUF_COMPILER_CPP_FIELD_H__ - -#include -#include -#include -#include - -#include -#include -#include - -namespace google { -namespace protobuf { -namespace io { -class Printer; // printer.h -} -} // namespace protobuf -} // namespace google - -namespace google { -namespace protobuf { -namespace compiler { -namespace cpp { - -// Helper function: set variables in the map that are the same for all -// field code generators. -// ['name', 'index', 'number', 'classname', 'declared_type', 'tag_size', -// 'deprecation']. -void SetCommonFieldVariables(const FieldDescriptor* descriptor, - std::map* variables, - const Options& options); - -void SetCommonOneofFieldVariables( - const FieldDescriptor* descriptor, - std::map* variables); - -class FieldGenerator { - public: - explicit FieldGenerator(const FieldDescriptor* descriptor, - const Options& options) - : descriptor_(descriptor), options_(options) {} - virtual ~FieldGenerator(); - virtual void GenerateSerializeWithCachedSizes( - io::Printer* printer) const final{}; - // Generate lines of code declaring members fields of the message class - // needed to represent this field. These are placed inside the message - // class. - virtual void GeneratePrivateMembers(io::Printer* printer) const = 0; - - // Generate static default variable for this field. These are placed inside - // the message class. Most field types don't need this, so the default - // implementation is empty. - virtual void GenerateStaticMembers(io::Printer* /*printer*/) const {} - - // Generate prototypes for all of the accessor functions related to this - // field. These are placed inside the class definition. - virtual void GenerateAccessorDeclarations(io::Printer* printer) const = 0; - - // Generate inline definitions of accessor functions for this field. - // These are placed inside the header after all class definitions. - virtual void GenerateInlineAccessorDefinitions( - io::Printer* printer) const = 0; - - // Generate definitions of accessors that aren't inlined. These are - // placed somewhere in the .cc file. - // Most field types don't need this, so the default implementation is empty. - virtual void GenerateNonInlineAccessorDefinitions( - io::Printer* /*printer*/) const {} - - // Generate declarations of accessors that are for internal purposes only. - // Most field types don't need this, so the default implementation is empty. - virtual void GenerateInternalAccessorDefinitions( - io::Printer* /*printer*/) const {} - - // Generate definitions of accessors that are for internal purposes only. - // Most field types don't need this, so the default implementation is empty. - virtual void GenerateInternalAccessorDeclarations( - io::Printer* /*printer*/) const {} - - // Generate lines of code (statements, not declarations) which clear the - // field. This is used to define the clear_$name$() method - virtual void GenerateClearingCode(io::Printer* printer) const = 0; - - // Generate lines of code (statements, not declarations) which clear the - // field as part of the Clear() method for the whole message. For message - // types which have field presence bits, MessageGenerator::GenerateClear - // will have already checked the presence bits. - // - // Since most field types can re-use GenerateClearingCode, this method is - // not pure virtual. - virtual void GenerateMessageClearingCode(io::Printer* printer) const { - GenerateClearingCode(printer); - } - - // Generate lines of code (statements, not declarations) which merges the - // contents of the field from the current message to the target message, - // which is stored in the generated code variable "from". - // This is used to fill in the MergeFrom method for the whole message. - // Details of this usage can be found in message.cc under the - // GenerateMergeFrom method. - virtual void GenerateMergingCode(io::Printer* printer) const = 0; - - // Generates a copy constructor - virtual void GenerateCopyConstructorCode(io::Printer* printer) const = 0; - - // Generate lines of code (statements, not declarations) which swaps - // this field and the corresponding field of another message, which - // is stored in the generated code variable "other". This is used to - // define the Swap method. Details of usage can be found in - // message.cc under the GenerateSwap method. - virtual void GenerateSwappingCode(io::Printer* printer) const = 0; - - // Generate initialization code for private members declared by - // GeneratePrivateMembers(). These go into the message class's SharedCtor() - // method, invoked by each of the generated constructors. - virtual void GenerateConstructorCode(io::Printer* printer) const = 0; - - // Generate any code that needs to go in the class's SharedDtor() method, - // invoked by the destructor. - // Most field types don't need this, so the default implementation is empty. - virtual void GenerateDestructorCode(io::Printer* /*printer*/) const {} - - // Generate a manual destructor invocation for use when the message is on an - // arena. The code that this method generates will be executed inside a - // shared-for-the-whole-message-class method registered with - // OwnDestructor(). The method should return |true| if it generated any code - // that requires a call; this allows the message generator to eliminate the - // OwnDestructor() registration if no fields require it. - virtual bool GenerateArenaDestructorCode(io::Printer* printer) const { - return false; - } - - // Generate initialization code for private members declared by - // GeneratePrivateMembers(), specifically for the constexpr constructor. - // These go into the constructor's initializer list and must follow that - // syntax (eg `field_(args)`). Does not include `:` or `,` separators. - virtual void GenerateConstinitInitializer(io::Printer* printer) const {} - - // Generate lines to serialize this field directly to the array "target", - // which are placed within the message's SerializeWithCachedSizesToArray() - // method. This must also advance "target" past the written bytes. - virtual void GenerateSerializeWithCachedSizesToArray( - io::Printer* printer) const = 0; - - // Generate lines to compute the serialized size of this field, which - // are placed in the message's ByteSize() method. - virtual void GenerateByteSize(io::Printer* printer) const = 0; - - // Generates lines to call IsInitialized() for eligible message fields. Non - // message fields won't need to override this function. - virtual void GenerateIsInitialized(io::Printer* printer) const {} - - virtual bool IsInlined() const { return false; } - - void SetHasBitIndex(int32_t has_bit_index); - void SetInlinedStringIndex(int32_t inlined_string_index); - - protected: - const FieldDescriptor* descriptor_; - const Options& options_; - std::map variables_; - - private: - GOOGLE_DISALLOW_EVIL_CONSTRUCTORS(FieldGenerator); -}; - -// Convenience class which constructs FieldGenerators for a Descriptor. -class FieldGeneratorMap { - public: - FieldGeneratorMap(const Descriptor* descriptor, const Options& options, - MessageSCCAnalyzer* scc_analyzer); - ~FieldGeneratorMap(); - - const FieldGenerator& get(const FieldDescriptor* field) const; - - void SetHasBitIndices(const std::vector& has_bit_indices_) { - for (int i = 0; i < descriptor_->field_count(); ++i) { - field_generators_[i]->SetHasBitIndex(has_bit_indices_[i]); - } - } - - void SetInlinedStringIndices(const std::vector& inlined_string_indices) { - for (int i = 0; i < descriptor_->field_count(); ++i) { - field_generators_[i]->SetInlinedStringIndex(inlined_string_indices[i]); - } - } - - private: - const Descriptor* descriptor_; - std::vector> field_generators_; - - static FieldGenerator* MakeGoogleInternalGenerator( - const FieldDescriptor* field, const Options& options, - MessageSCCAnalyzer* scc_analyzer); - static FieldGenerator* MakeGenerator(const FieldDescriptor* field, - const Options& options, - MessageSCCAnalyzer* scc_analyzer); - - GOOGLE_DISALLOW_EVIL_CONSTRUCTORS(FieldGeneratorMap); -}; - -} // namespace cpp -} // namespace compiler -} // namespace protobuf -} // namespace google - -#endif // GOOGLE_PROTOBUF_COMPILER_CPP_FIELD_H__ diff --git a/extra/protobuf/protobuf-3.19.4/src/google/protobuf/compiler/cpp/cpp_file.cc b/extra/protobuf/protobuf-3.19.4/src/google/protobuf/compiler/cpp/cpp_file.cc deleted file mode 100644 index c7816b546e93..000000000000 --- a/extra/protobuf/protobuf-3.19.4/src/google/protobuf/compiler/cpp/cpp_file.cc +++ /dev/null @@ -1,1419 +0,0 @@ -// Protocol Buffers - Google's data interchange format -// Copyright 2008 Google Inc. All rights reserved. -// https://developers.google.com/protocol-buffers/ -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// * Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// * Redistributions in binary form must reproduce the above -// copyright notice, this list of conditions and the following disclaimer -// in the documentation and/or other materials provided with the -// distribution. -// * Neither the name of Google Inc. nor the names of its -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -// Author: kenton@google.com (Kenton Varda) -// Based on original Protocol Buffers design by -// Sanjay Ghemawat, Jeff Dean, and others. - -#include - -#include -#include -#include -#include -#include -#include -#include - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -// Must be last. -#include - -namespace google { -namespace protobuf { -namespace compiler { -namespace cpp { - -namespace { - -// When we forward-declare things, we want to create a sorted order so our -// output is deterministic and minimizes namespace changes. -template -std::string GetSortKey(const T& val) { - return val.full_name(); -} - -template <> -std::string GetSortKey(const FileDescriptor& val) { - return val.name(); -} - -template -bool CompareSortKeys(const T* a, const T* b) { - return GetSortKey(*a) < GetSortKey(*b); -} - -template -std::vector Sorted(const std::unordered_set& vals) { - std::vector sorted(vals.begin(), vals.end()); - std::sort(sorted.begin(), sorted.end(), CompareSortKeys); - return sorted; -} - -} // namespace - -FileGenerator::FileGenerator(const FileDescriptor* file, const Options& options) - : file_(file), options_(options), scc_analyzer_(options) { - // These variables are the same on a file level - SetCommonVars(options, &variables_); - variables_["dllexport_decl"] = options.dllexport_decl; - variables_["tablename"] = UniqueName("TableStruct", file_, options_); - variables_["file_level_metadata"] = - UniqueName("file_level_metadata", file_, options_); - variables_["desc_table"] = DescriptorTableName(file_, options_); - variables_["file_level_enum_descriptors"] = - UniqueName("file_level_enum_descriptors", file_, options_); - variables_["file_level_service_descriptors"] = - UniqueName("file_level_service_descriptors", file_, options_); - variables_["filename"] = file_->name(); - variables_["package_ns"] = Namespace(file_, options); - - std::vector msgs = FlattenMessagesInFile(file); - for (int i = 0; i < msgs.size(); i++) { - // Deleted in destructor - MessageGenerator* msg_gen = - new MessageGenerator(msgs[i], variables_, i, options, &scc_analyzer_); - message_generators_.emplace_back(msg_gen); - msg_gen->AddGenerators(&enum_generators_, &extension_generators_); - } - - for (int i = 0; i < file->enum_type_count(); i++) { - enum_generators_.emplace_back( - new EnumGenerator(file->enum_type(i), variables_, options)); - } - - for (int i = 0; i < file->service_count(); i++) { - service_generators_.emplace_back( - new ServiceGenerator(file->service(i), variables_, options)); - } - if (HasGenericServices(file_, options_)) { - for (int i = 0; i < service_generators_.size(); i++) { - service_generators_[i]->index_in_metadata_ = i; - } - } - for (int i = 0; i < file->extension_count(); i++) { - extension_generators_.emplace_back( - new ExtensionGenerator(file->extension(i), options, &scc_analyzer_)); - } - for (int i = 0; i < file->weak_dependency_count(); ++i) { - weak_deps_.insert(file->weak_dependency(i)); - } -} - -FileGenerator::~FileGenerator() = default; - -void FileGenerator::GenerateMacroUndefs(io::Printer* printer) { - Formatter format(printer, variables_); - // Only do this for protobuf's own types. There are some google3 protos using - // macros as field names and the generated code compiles after the macro - // expansion. Undefing these macros actually breaks such code. - if (file_->name() != "net/proto2/compiler/proto/plugin.proto" && - file_->name() != "google/protobuf/compiler/plugin.proto") { - return; - } - std::vector names_to_undef; - std::vector fields; - ListAllFields(file_, &fields); - for (int i = 0; i < fields.size(); i++) { - const std::string& name = fields[i]->name(); - static const char* kMacroNames[] = {"major", "minor"}; - for (int j = 0; j < GOOGLE_ARRAYSIZE(kMacroNames); ++j) { - if (name == kMacroNames[j]) { - names_to_undef.push_back(name); - break; - } - } - } - for (int i = 0; i < names_to_undef.size(); ++i) { - format( - "#ifdef $1$\n" - "#undef $1$\n" - "#endif\n", - names_to_undef[i]); - } -} - -void FileGenerator::GenerateHeader(io::Printer* printer) { - Formatter format(printer, variables_); - - // port_def.inc must be included after all other includes. - IncludeFile("net/proto2/public/port_def.inc", printer); - format("#define $1$$ dllexport_decl$\n", FileDllExport(file_, options_)); - GenerateMacroUndefs(printer); - - // For Any support with lite protos, we need to friend AnyMetadata, so we - // forward-declare it here. - format( - "PROTOBUF_NAMESPACE_OPEN\n" - "namespace internal {\n" - "class AnyMetadata;\n" - "} // namespace internal\n" - "PROTOBUF_NAMESPACE_CLOSE\n"); - - GenerateGlobalStateFunctionDeclarations(printer); - - GenerateForwardDeclarations(printer); - - { - NamespaceOpener ns(Namespace(file_, options_), format); - - format("\n"); - - GenerateEnumDefinitions(printer); - - format(kThickSeparator); - format("\n"); - - GenerateMessageDefinitions(printer); - - format("\n"); - format(kThickSeparator); - format("\n"); - - GenerateServiceDefinitions(printer); - - GenerateExtensionIdentifiers(printer); - - format("\n"); - format(kThickSeparator); - format("\n"); - - GenerateInlineFunctionDefinitions(printer); - - format( - "\n" - "// @@protoc_insertion_point(namespace_scope)\n" - "\n"); - } - - // We need to specialize some templates in the ::google::protobuf namespace: - GenerateProto2NamespaceEnumSpecializations(printer); - - format( - "\n" - "// @@protoc_insertion_point(global_scope)\n" - "\n"); - IncludeFile("net/proto2/public/port_undef.inc", printer); -} - -void FileGenerator::GenerateProtoHeader(io::Printer* printer, - const std::string& info_path) { - Formatter format(printer, variables_); - if (!options_.proto_h) { - return; - } - - GenerateTopHeaderGuard(printer, false); - - if (!options_.opensource_runtime) { - format( - "#ifdef SWIG\n" - "#error \"Do not SWIG-wrap protobufs.\"\n" - "#endif // SWIG\n" - "\n"); - } - - if (IsBootstrapProto(options_, file_)) { - format("// IWYU pragma: private, include \"$1$.proto.h\"\n\n", - StripProto(file_->name())); - } - - GenerateLibraryIncludes(printer); - - for (int i = 0; i < file_->public_dependency_count(); i++) { - const FileDescriptor* dep = file_->public_dependency(i); - format("#include \"$1$.proto.h\"\n", StripProto(dep->name())); - } - - format("// @@protoc_insertion_point(includes)\n"); - - GenerateMetadataPragma(printer, info_path); - - GenerateHeader(printer); - - GenerateBottomHeaderGuard(printer, false); -} - -void FileGenerator::GeneratePBHeader(io::Printer* printer, - const std::string& info_path) { - Formatter format(printer, variables_); - GenerateTopHeaderGuard(printer, true); - - if (options_.proto_h) { - std::string target_basename = StripProto(file_->name()); - if (!options_.opensource_runtime) { - GetBootstrapBasename(options_, target_basename, &target_basename); - } - format("#include \"$1$.proto.h\" // IWYU pragma: export\n", - target_basename); - } else { - GenerateLibraryIncludes(printer); - } - - if (options_.transitive_pb_h) { - GenerateDependencyIncludes(printer); - } - - // This is unfortunately necessary for some plugins. I don't see why we - // need two of the same insertion points. - // TODO(gerbens) remove this. - format("// @@protoc_insertion_point(includes)\n"); - - GenerateMetadataPragma(printer, info_path); - - if (!options_.proto_h) { - GenerateHeader(printer); - } else { - { - NamespaceOpener ns(Namespace(file_, options_), format); - format( - "\n" - "// @@protoc_insertion_point(namespace_scope)\n"); - } - format( - "\n" - "// @@protoc_insertion_point(global_scope)\n" - "\n"); - } - - GenerateBottomHeaderGuard(printer, true); -} - -void FileGenerator::DoIncludeFile(const std::string& google3_name, - bool do_export, io::Printer* printer) { - Formatter format(printer, variables_); - const std::string prefix = "net/proto2/"; - GOOGLE_CHECK(google3_name.find(prefix) == 0) << google3_name; - - if (options_.opensource_runtime) { - std::string path = google3_name.substr(prefix.size()); - - path = StringReplace(path, "internal/", "", false); - path = StringReplace(path, "proto/", "", false); - path = StringReplace(path, "public/", "", false); - if (options_.runtime_include_base.empty()) { - format("#include ", path); - } else { - format("#include \"$1$google/protobuf/$2$\"", - options_.runtime_include_base, path); - } - } else { - format("#include \"$1$\"", google3_name); - } - - if (do_export) { - format(" // IWYU pragma: export"); - } - - format("\n"); -} - -std::string FileGenerator::CreateHeaderInclude(const std::string& basename, - const FileDescriptor* file) { - bool use_system_include = false; - std::string name = basename; - - if (options_.opensource_runtime) { - if (IsWellKnownMessage(file)) { - if (options_.runtime_include_base.empty()) { - use_system_include = true; - } else { - name = options_.runtime_include_base + basename; - } - } - } - - std::string left = "\""; - std::string right = "\""; - if (use_system_include) { - left = "<"; - right = ">"; - } - return left + name + right; -} - -void FileGenerator::GenerateSourceIncludes(io::Printer* printer) { - Formatter format(printer, variables_); - std::string target_basename = StripProto(file_->name()); - if (!options_.opensource_runtime) { - GetBootstrapBasename(options_, target_basename, &target_basename); - } - target_basename += options_.proto_h ? ".proto.h" : ".pb.h"; - format( - "// Generated by the protocol buffer compiler. DO NOT EDIT!\n" - "// source: $filename$\n" - "\n" - "#include $1$\n" - "\n" - "#include \n" // for swap() - "\n", - CreateHeaderInclude(target_basename, file_)); - - IncludeFile("net/proto2/io/public/coded_stream.h", printer); - // TODO(gerbens) This is to include parse_context.h, we need a better way - IncludeFile("net/proto2/public/extension_set.h", printer); - IncludeFile("net/proto2/public/wire_format_lite.h", printer); - - // Unknown fields implementation in lite mode uses StringOutputStream - if (!UseUnknownFieldSet(file_, options_) && !message_generators_.empty()) { - IncludeFile("net/proto2/io/public/zero_copy_stream_impl_lite.h", printer); - } - - if (HasDescriptorMethods(file_, options_)) { - IncludeFile("net/proto2/public/descriptor.h", printer); - IncludeFile("net/proto2/public/generated_message_reflection.h", printer); - IncludeFile("net/proto2/public/reflection_ops.h", printer); - IncludeFile("net/proto2/public/wire_format.h", printer); - } - - if (HasGeneratedMethods(file_, options_) && - options_.tctable_mode != Options::kTCTableNever) { - IncludeFile("net/proto2/public/generated_message_tctable_impl.h", printer); - } - - if (options_.proto_h) { - // Use the smaller .proto.h files. - for (int i = 0; i < file_->dependency_count(); i++) { - const FileDescriptor* dep = file_->dependency(i); - // Do not import weak deps. - if (!options_.opensource_runtime && IsDepWeak(dep)) continue; - std::string basename = StripProto(dep->name()); - if (IsBootstrapProto(options_, file_)) { - GetBootstrapBasename(options_, basename, &basename); - } - format("#include \"$1$.proto.h\"\n", basename); - } - } - if (HasCordFields(file_, options_)) { - format( - "#include \"third_party/absl/strings/internal/string_constant.h\"\n"); - } - - format("// @@protoc_insertion_point(includes)\n"); - IncludeFile("net/proto2/public/port_def.inc", printer); - - // For MSVC builds, we use #pragma init_seg to move the initialization of our - // libraries to happen before the user code. - // This worksaround the fact that MSVC does not do constant initializers when - // required by the standard. - format("\nPROTOBUF_PRAGMA_INIT_SEG\n"); -} - -void FileGenerator::GenerateSourceDefaultInstance(int idx, - io::Printer* printer) { - Formatter format(printer, variables_); - MessageGenerator* generator = message_generators_[idx].get(); - generator->GenerateConstexprConstructor(printer); - // Use a union to disable the destructor of the _instance member. - // We can constant initialize, but the object will still have a non-trivial - // destructor that we need to elide. - format( - "struct $1$ {\n" - " constexpr $1$()\n" - " : _instance(::$proto_ns$::internal::ConstantInitialized{}) {}\n" - " ~$1$() {}\n" - " union {\n" - " $2$ _instance;\n" - " };\n" - "};\n", - DefaultInstanceType(generator->descriptor_, options_), - generator->classname_); - // NO_DESTROY is not necessary for correctness. The empty destructor is - // enough. However, the empty destructor fails to be elided in some - // configurations (like non-opt or with certain sanitizers). NO_DESTROY is - // there just to improve performance and binary size in these builds. - format("PROTOBUF_ATTRIBUTE_NO_DESTROY PROTOBUF_CONSTINIT $1$ $2$;\n", - DefaultInstanceType(generator->descriptor_, options_), - DefaultInstanceName(generator->descriptor_, options_)); - - for (int i = 0; i < generator->descriptor_->field_count(); i++) { - const FieldDescriptor* field = generator->descriptor_->field(i); - if (IsStringInlined(field, options_)) { - // Force the initialization of the inlined string in the default instance. - format( - "PROTOBUF_ATTRIBUTE_INIT_PRIORITY std::true_type " - "$1$::_init_inline_$2$_ = " - "($3$._instance.$2$_.Init(), std::true_type{});\n", - ClassName(generator->descriptor_), FieldName(field), - DefaultInstanceName(generator->descriptor_, options_)); - } - } - - if (options_.lite_implicit_weak_fields) { - format("$1$* $2$ = &$3$;\n", - DefaultInstanceType(generator->descriptor_, options_), - DefaultInstancePtr(generator->descriptor_, options_), - DefaultInstanceName(generator->descriptor_, options_)); - } -} - -// A list of things defined in one .pb.cc file that we need to reference from -// another .pb.cc file. -struct FileGenerator::CrossFileReferences { - // Populated if we are referencing from messages or files. - std::unordered_set weak_default_instances; - - // Only if we are referencing from files. - std::unordered_set strong_reflection_files; - std::unordered_set weak_reflection_files; -}; - -void FileGenerator::GetCrossFileReferencesForField(const FieldDescriptor* field, - CrossFileReferences* refs) { - const Descriptor* msg = field->message_type(); - if (msg == nullptr) return; - - if (IsImplicitWeakField(field, options_, &scc_analyzer_) || - IsWeak(field, options_)) { - refs->weak_default_instances.insert(msg); - } -} - -void FileGenerator::GetCrossFileReferencesForFile(const FileDescriptor* file, - CrossFileReferences* refs) { - ForEachField(file, [this, refs](const FieldDescriptor* field) { - GetCrossFileReferencesForField(field, refs); - }); - - if (!HasDescriptorMethods(file, options_)) return; - - for (int i = 0; i < file->dependency_count(); i++) { - const FileDescriptor* dep = file->dependency(i); - if (IsDepWeak(dep)) { - refs->weak_reflection_files.insert(dep); - } else { - refs->strong_reflection_files.insert(dep); - } - } -} - -// Generates references to variables defined in other files. -void FileGenerator::GenerateInternalForwardDeclarations( - const CrossFileReferences& refs, io::Printer* printer) { - Formatter format(printer, variables_); - - { - NamespaceOpener ns(format); - for (auto instance : Sorted(refs.weak_default_instances)) { - ns.ChangeTo(Namespace(instance, options_)); - if (options_.lite_implicit_weak_fields) { - format("extern $1$ $2$;\n", DefaultInstanceType(instance, options_), - DefaultInstanceName(instance, options_)); - format("__attribute__((weak)) $1$* $2$ = nullptr;\n", - DefaultInstanceType(instance, options_), - DefaultInstancePtr(instance, options_)); - } else { - format("extern __attribute__((weak)) $1$ $2$;\n", - DefaultInstanceType(instance, options_), - DefaultInstanceName(instance, options_)); - } - } - } - - for (auto file : Sorted(refs.weak_reflection_files)) { - format( - "extern __attribute__((weak)) const " - "::$proto_ns$::internal::DescriptorTable $1$;\n", - DescriptorTableName(file, options_)); - } -} - -void FileGenerator::GenerateSourceForMessage(int idx, io::Printer* printer) { - Formatter format(printer, variables_); - GenerateSourceIncludes(printer); - - CrossFileReferences refs; - ForEachField(message_generators_[idx]->descriptor_, - [this, &refs](const FieldDescriptor* field) { - GetCrossFileReferencesForField(field, &refs); - }); - GenerateInternalForwardDeclarations(refs, printer); - - { // package namespace - NamespaceOpener ns(Namespace(file_, options_), format); - - // Define default instances - GenerateSourceDefaultInstance(idx, printer); - - // Generate classes. - format("\n"); - message_generators_[idx]->GenerateClassMethods(printer); - - format( - "\n" - "// @@protoc_insertion_point(namespace_scope)\n"); - } // end package namespace - - { - NamespaceOpener proto_ns(ProtobufNamespace(options_), format); - message_generators_[idx]->GenerateSourceInProto2Namespace(printer); - } - - format( - "\n" - "// @@protoc_insertion_point(global_scope)\n"); -} - -void FileGenerator::GenerateSourceForExtension(int idx, io::Printer* printer) { - Formatter format(printer, variables_); - GenerateSourceIncludes(printer); - NamespaceOpener ns(Namespace(file_, options_), format); - extension_generators_[idx]->GenerateDefinition(printer); -} - -void FileGenerator::GenerateGlobalSource(io::Printer* printer) { - Formatter format(printer, variables_); - GenerateSourceIncludes(printer); - - { - GenerateTables(printer); - - // Define the code to initialize reflection. This code uses a global - // constructor to register reflection data with the runtime pre-main. - if (HasDescriptorMethods(file_, options_)) { - GenerateReflectionInitializationCode(printer); - } - } - - NamespaceOpener ns(Namespace(file_, options_), format); - - // Generate enums. - for (int i = 0; i < enum_generators_.size(); i++) { - enum_generators_[i]->GenerateMethods(i, printer); - } -} - -void FileGenerator::GenerateSource(io::Printer* printer) { - Formatter format(printer, variables_); - GenerateSourceIncludes(printer); - CrossFileReferences refs; - GetCrossFileReferencesForFile(file_, &refs); - GenerateInternalForwardDeclarations(refs, printer); - - { - NamespaceOpener ns(Namespace(file_, options_), format); - - // Define default instances - for (int i = 0; i < message_generators_.size(); i++) { - GenerateSourceDefaultInstance(i, printer); - } - } - - { - GenerateTables(printer); - - if (HasDescriptorMethods(file_, options_)) { - // Define the code to initialize reflection. This code uses a global - // constructor to register reflection data with the runtime pre-main. - GenerateReflectionInitializationCode(printer); - } - } - - { - NamespaceOpener ns(Namespace(file_, options_), format); - - // Actually implement the protos - - // Generate enums. - for (int i = 0; i < enum_generators_.size(); i++) { - enum_generators_[i]->GenerateMethods(i, printer); - } - - // Generate classes. - for (int i = 0; i < message_generators_.size(); i++) { - format("\n"); - format(kThickSeparator); - format("\n"); - message_generators_[i]->GenerateClassMethods(printer); - } - - if (HasGenericServices(file_, options_)) { - // Generate services. - for (int i = 0; i < service_generators_.size(); i++) { - if (i == 0) format("\n"); - format(kThickSeparator); - format("\n"); - service_generators_[i]->GenerateImplementation(printer); - } - } - - // Define extensions. - for (int i = 0; i < extension_generators_.size(); i++) { - extension_generators_[i]->GenerateDefinition(printer); - } - - format( - "\n" - "// @@protoc_insertion_point(namespace_scope)\n"); - } - - { - NamespaceOpener proto_ns(ProtobufNamespace(options_), format); - for (int i = 0; i < message_generators_.size(); i++) { - message_generators_[i]->GenerateSourceInProto2Namespace(printer); - } - } - - format( - "\n" - "// @@protoc_insertion_point(global_scope)\n"); - - IncludeFile("net/proto2/public/port_undef.inc", printer); -} - -void FileGenerator::GenerateReflectionInitializationCode(io::Printer* printer) { - Formatter format(printer, variables_); - - if (!message_generators_.empty()) { - format("static ::$proto_ns$::Metadata $file_level_metadata$[$1$];\n", - message_generators_.size()); - } - if (!enum_generators_.empty()) { - format( - "static " - "const ::$proto_ns$::EnumDescriptor* " - "$file_level_enum_descriptors$[$1$];\n", - enum_generators_.size()); - } else { - format( - "static " - "constexpr ::$proto_ns$::EnumDescriptor const** " - "$file_level_enum_descriptors$ = nullptr;\n"); - } - if (HasGenericServices(file_, options_) && file_->service_count() > 0) { - format( - "static " - "const ::$proto_ns$::ServiceDescriptor* " - "$file_level_service_descriptors$[$1$];\n", - file_->service_count()); - } else { - format( - "static " - "constexpr ::$proto_ns$::ServiceDescriptor const** " - "$file_level_service_descriptors$ = nullptr;\n"); - } - - if (!message_generators_.empty()) { - format( - "\n" - "const $uint32$ $tablename$::offsets[] " - "PROTOBUF_SECTION_VARIABLE(protodesc_cold) = {\n"); - format.Indent(); - std::vector > pairs; - pairs.reserve(message_generators_.size()); - for (int i = 0; i < message_generators_.size(); i++) { - pairs.push_back(message_generators_[i]->GenerateOffsets(printer)); - } - format.Outdent(); - format( - "};\n" - "static const ::$proto_ns$::internal::MigrationSchema schemas[] " - "PROTOBUF_SECTION_VARIABLE(protodesc_cold) = {\n"); - format.Indent(); - { - int offset = 0; - for (int i = 0; i < message_generators_.size(); i++) { - message_generators_[i]->GenerateSchema(printer, offset, - pairs[i].second); - offset += pairs[i].first; - } - } - format.Outdent(); - format( - "};\n" - "\nstatic " - "::$proto_ns$::Message const * const file_default_instances[] = {\n"); - format.Indent(); - for (int i = 0; i < message_generators_.size(); i++) { - const Descriptor* descriptor = message_generators_[i]->descriptor_; - format( - "reinterpret_cast(&$1$::_$2$_default_instance_),\n", - Namespace(descriptor, options_), // 1 - ClassName(descriptor)); // 2 - } - format.Outdent(); - format( - "};\n" - "\n"); - } else { - // we still need these symbols to exist - format( - // MSVC doesn't like empty arrays, so we add a dummy. - "const $uint32$ $tablename$::offsets[1] = {};\n" - "static constexpr ::$proto_ns$::internal::MigrationSchema* schemas = " - "nullptr;" - "\n" - "static constexpr ::$proto_ns$::Message* const* " - "file_default_instances = nullptr;\n" - "\n"); - } - - // --------------------------------------------------------------- - - // Embed the descriptor. We simply serialize the entire - // FileDescriptorProto/ and embed it as a string literal, which is parsed and - // built into real descriptors at initialization time. - const std::string protodef_name = - UniqueName("descriptor_table_protodef", file_, options_); - format("const char $1$[] PROTOBUF_SECTION_VARIABLE(protodesc_cold) =\n", - protodef_name); - format.Indent(); - FileDescriptorProto file_proto; - file_->CopyTo(&file_proto); - std::string file_data; - file_proto.SerializeToString(&file_data); - - { - if (file_data.size() > 65535) { - // Workaround for MSVC: "Error C1091: compiler limit: string exceeds - // 65535 bytes in length". Declare a static array of chars rather than - // use a string literal. Only write 25 bytes per line. - static const int kBytesPerLine = 25; - format("{ "); - for (int i = 0; i < file_data.size();) { - for (int j = 0; j < kBytesPerLine && i < file_data.size(); ++i, ++j) { - format("'$1$', ", CEscape(file_data.substr(i, 1))); - } - format("\n"); - } - format("'\\0' }"); // null-terminate - } else { - // Only write 40 bytes per line. - static const int kBytesPerLine = 40; - for (int i = 0; i < file_data.size(); i += kBytesPerLine) { - format( - "\"$1$\"\n", - EscapeTrigraphs(CEscape(file_data.substr(i, kBytesPerLine)))); - } - } - format(";\n"); - } - format.Outdent(); - - CrossFileReferences refs; - GetCrossFileReferencesForFile(file_, &refs); - int num_deps = - refs.strong_reflection_files.size() + refs.weak_reflection_files.size(); - - // Build array of DescriptorTable deps. - if (num_deps > 0) { - format( - "static const ::$proto_ns$::internal::DescriptorTable*const " - "$desc_table$_deps[$1$] = {\n", - num_deps); - - for (auto dep : Sorted(refs.strong_reflection_files)) { - format(" &::$1$,\n", DescriptorTableName(dep, options_)); - } - for (auto dep : Sorted(refs.weak_reflection_files)) { - format(" &::$1$,\n", DescriptorTableName(dep, options_)); - } - - format("};\n"); - } - - // The DescriptorTable itself. - // Should be "bool eager = NeedsEagerDescriptorAssignment(file_, options_);" - // however this might cause a tsan failure in superroot b/148382879, - // so disable for now. - bool eager = false; - format( - "static ::$proto_ns$::internal::once_flag $desc_table$_once;\n" - "const ::$proto_ns$::internal::DescriptorTable $desc_table$ = {\n" - " false, $1$, $2$, $3$, \"$filename$\", \n" - " &$desc_table$_once, $4$, $5$, $6$,\n" - " schemas, file_default_instances, $tablename$::offsets,\n" - " $7$, $file_level_enum_descriptors$, " - "$file_level_service_descriptors$,\n" - "};\n" - // This function exists to be marked as weak. - // It can significantly speed up compilation by breaking up LLVM's SCC in - // the .pb.cc translation units. Large translation units see a reduction - // of more than 35% of walltime for optimized builds. - // Without the weak attribute all the messages in the file, including all - // the vtables and everything they use become part of the same SCC through - // a cycle like: - // GetMetadata -> descriptor table -> default instances -> - // vtables -> GetMetadata - // By adding a weak function here we break the connection from the - // individual vtables back into the descriptor table. - "PROTOBUF_ATTRIBUTE_WEAK const ::$proto_ns$::internal::DescriptorTable* " - "$desc_table$_getter() {\n" - " return &$desc_table$;\n" - "}\n" - "\n", - eager ? "true" : "false", file_data.size(), protodef_name, - num_deps == 0 ? "nullptr" : variables_["desc_table"] + "_deps", num_deps, - message_generators_.size(), - message_generators_.empty() ? "nullptr" - : variables_["file_level_metadata"]); - - // For descriptor.proto we want to avoid doing any dynamic initialization, - // because in some situations that would otherwise pull in a lot of - // unnecessary code that can't be stripped by --gc-sections. Descriptor - // initialization will still be performed lazily when it's needed. - if (file_->name() != "net/proto2/proto/descriptor.proto") { - format( - "// Force running AddDescriptors() at dynamic initialization time.\n" - "PROTOBUF_ATTRIBUTE_INIT_PRIORITY " - "static ::$proto_ns$::internal::AddDescriptorsRunner " - "$1$(&$desc_table$);\n", - UniqueName("dynamic_init_dummy", file_, options_)); - } -} - -void FileGenerator::GenerateTables(io::Printer* printer) { - Formatter format(printer, variables_); - if (options_.table_driven_parsing) { - // TODO(ckennelly): Gate this with the same options flag to enable - // table-driven parsing. - format( - "PROTOBUF_CONSTEXPR_VAR ::$proto_ns$::internal::ParseTableField\n" - " const $tablename$::entries[] " - "PROTOBUF_SECTION_VARIABLE(protodesc_cold) = {\n"); - format.Indent(); - - std::vector entries; - size_t count = 0; - for (int i = 0; i < message_generators_.size(); i++) { - size_t value = message_generators_[i]->GenerateParseOffsets(printer); - entries.push_back(value); - count += value; - } - - // We need these arrays to exist, and MSVC does not like empty arrays. - if (count == 0) { - format("{0, 0, 0, ::$proto_ns$::internal::kInvalidMask, 0, 0},\n"); - } - - format.Outdent(); - format( - "};\n" - "\n" - "PROTOBUF_CONSTEXPR_VAR " - "::$proto_ns$::internal::AuxiliaryParseTableField\n" - " const $tablename$::aux[] " - "PROTOBUF_SECTION_VARIABLE(protodesc_cold) = {\n"); - format.Indent(); - - std::vector aux_entries; - count = 0; - for (int i = 0; i < message_generators_.size(); i++) { - size_t value = message_generators_[i]->GenerateParseAuxTable(printer); - aux_entries.push_back(value); - count += value; - } - - if (count == 0) { - format("::$proto_ns$::internal::AuxiliaryParseTableField(),\n"); - } - - format.Outdent(); - format( - "};\n" - "PROTOBUF_CONSTEXPR_VAR ::$proto_ns$::internal::ParseTable const\n" - " $tablename$::schema[] " - "PROTOBUF_SECTION_VARIABLE(protodesc_cold) = {\n"); - format.Indent(); - - size_t offset = 0; - size_t aux_offset = 0; - for (int i = 0; i < message_generators_.size(); i++) { - message_generators_[i]->GenerateParseTable(printer, offset, aux_offset); - offset += entries[i]; - aux_offset += aux_entries[i]; - } - - if (message_generators_.empty()) { - format("{ nullptr, nullptr, 0, -1, -1, false },\n"); - } - - format.Outdent(); - format( - "};\n" - "\n"); - } - - if (!message_generators_.empty() && options_.table_driven_serialization) { - format( - "const ::$proto_ns$::internal::FieldMetadata " - "$tablename$::field_metadata[] " - "= {\n"); - format.Indent(); - std::vector field_metadata_offsets; - int idx = 0; - for (int i = 0; i < message_generators_.size(); i++) { - field_metadata_offsets.push_back(idx); - idx += message_generators_[i]->GenerateFieldMetadata(printer); - } - field_metadata_offsets.push_back(idx); - format.Outdent(); - format( - "};\n" - "const ::$proto_ns$::internal::SerializationTable " - "$tablename$::serialization_table[] = {\n"); - format.Indent(); - // We rely on the order we layout the tables to match the order we - // calculate them with FlattenMessagesInFile, so we check here that - // these match exactly. - std::vector calculated_order = - FlattenMessagesInFile(file_); - GOOGLE_CHECK_EQ(calculated_order.size(), message_generators_.size()); - for (int i = 0; i < message_generators_.size(); i++) { - GOOGLE_CHECK_EQ(calculated_order[i], message_generators_[i]->descriptor_); - format("{$1$, $tablename$::field_metadata + $2$},\n", - field_metadata_offsets[i + 1] - field_metadata_offsets[i], // 1 - field_metadata_offsets[i]); // 2 - } - format.Outdent(); - format( - "};\n" - "\n"); - } -} - -class FileGenerator::ForwardDeclarations { - public: - void AddMessage(const Descriptor* d) { classes_[ClassName(d)] = d; } - void AddEnum(const EnumDescriptor* d) { enums_[ClassName(d)] = d; } - - void Print(const Formatter& format, const Options& options) const { - for (const auto& p : enums_) { - const std::string& enumname = p.first; - const EnumDescriptor* enum_desc = p.second; - format( - "enum ${1$$2$$}$ : int;\n" - "bool $2$_IsValid(int value);\n", - enum_desc, enumname); - } - for (const auto& p : classes_) { - const std::string& classname = p.first; - const Descriptor* class_desc = p.second; - format( - "class ${1$$2$$}$;\n" - "struct $3$;\n" - "$dllexport_decl $extern $3$ $4$;\n", - class_desc, classname, DefaultInstanceType(class_desc, options), - DefaultInstanceName(class_desc, options)); - } - } - - void PrintTopLevelDecl(const Formatter& format, - const Options& options) const { - for (const auto& pair : classes_) { - format( - "template<> $dllexport_decl $" - "$1$* Arena::CreateMaybeMessage<$1$>(Arena*);\n", - QualifiedClassName(pair.second, options)); - } - } - - private: - std::map classes_; - std::map enums_; -}; - -static void PublicImportDFS(const FileDescriptor* fd, - std::unordered_set* fd_set) { - for (int i = 0; i < fd->public_dependency_count(); i++) { - const FileDescriptor* dep = fd->public_dependency(i); - if (fd_set->insert(dep).second) PublicImportDFS(dep, fd_set); - } -} - -void FileGenerator::GenerateForwardDeclarations(io::Printer* printer) { - Formatter format(printer, variables_); - std::vector classes; - std::vector enums; - - FlattenMessagesInFile(file_, &classes); // All messages need forward decls. - - if (options_.proto_h) { // proto.h needs extra forward declarations. - // All classes / enums referred to as field members - std::vector fields; - ListAllFields(file_, &fields); - for (int i = 0; i < fields.size(); i++) { - classes.push_back(fields[i]->containing_type()); - classes.push_back(fields[i]->message_type()); - enums.push_back(fields[i]->enum_type()); - } - ListAllTypesForServices(file_, &classes); - } - - // Calculate the set of files whose definitions we get through include. - // No need to forward declare types that are defined in these. - std::unordered_set public_set; - PublicImportDFS(file_, &public_set); - - std::map decls; - for (int i = 0; i < classes.size(); i++) { - const Descriptor* d = classes[i]; - if (d && !public_set.count(d->file())) - decls[Namespace(d, options_)].AddMessage(d); - } - for (int i = 0; i < enums.size(); i++) { - const EnumDescriptor* d = enums[i]; - if (d && !public_set.count(d->file())) - decls[Namespace(d, options_)].AddEnum(d); - } - - { - NamespaceOpener ns(format); - for (const auto& pair : decls) { - ns.ChangeTo(pair.first); - pair.second.Print(format, options_); - } - } - format("PROTOBUF_NAMESPACE_OPEN\n"); - for (const auto& pair : decls) { - pair.second.PrintTopLevelDecl(format, options_); - } - format("PROTOBUF_NAMESPACE_CLOSE\n"); -} - -void FileGenerator::GenerateTopHeaderGuard(io::Printer* printer, bool pb_h) { - Formatter format(printer, variables_); - // Generate top of header. - format( - "// Generated by the protocol buffer compiler. DO NOT EDIT!\n" - "// source: $filename$\n" - "\n" - "#ifndef $1$\n" - "#define $1$\n" - "\n" - "#include \n" - "#include \n", - IncludeGuard(file_, pb_h, options_)); - if (!options_.opensource_runtime && !enum_generators_.empty()) { - // Add header to provide std::is_integral for safe Enum_Name() function. - format("#include \n"); - } - format("\n"); -} - -void FileGenerator::GenerateBottomHeaderGuard(io::Printer* printer, bool pb_h) { - Formatter format(printer, variables_); - format("#endif // $GOOGLE_PROTOBUF$_INCLUDED_$1$\n", - IncludeGuard(file_, pb_h, options_)); -} - -void FileGenerator::GenerateLibraryIncludes(io::Printer* printer) { - Formatter format(printer, variables_); - if (UsingImplicitWeakFields(file_, options_)) { - IncludeFile("net/proto2/public/implicit_weak_message.h", printer); - } - if (HasWeakFields(file_, options_)) { - GOOGLE_CHECK(!options_.opensource_runtime); - IncludeFile("net/proto2/public/weak_field_map.h", printer); - } - if (HasLazyFields(file_, options_, &scc_analyzer_)) { - GOOGLE_CHECK(!options_.opensource_runtime); - IncludeFile("net/proto2/public/lazy_field.h", printer); - } - if (ShouldVerify(file_, options_, &scc_analyzer_)) { - IncludeFile("net/proto2/public/wire_format_verify.h", printer); - } - - if (options_.opensource_runtime) { - // Verify the protobuf library header version is compatible with the protoc - // version before going any further. - IncludeFile("net/proto2/public/port_def.inc", printer); - format( - "#if PROTOBUF_VERSION < $1$\n" - "#error This file was generated by a newer version of protoc which is\n" - "#error incompatible with your Protocol Buffer headers. Please update\n" - "#error your headers.\n" - "#endif\n" - "#if $2$ < PROTOBUF_MIN_PROTOC_VERSION\n" - "#error This file was generated by an older version of protoc which " - "is\n" - "#error incompatible with your Protocol Buffer headers. Please\n" - "#error regenerate this file with a newer version of protoc.\n" - "#endif\n" - "\n", - PROTOBUF_MIN_HEADER_VERSION_FOR_PROTOC, // 1 - PROTOBUF_VERSION); // 2 - IncludeFile("net/proto2/public/port_undef.inc", printer); - } - - // OK, it's now safe to #include other files. - IncludeFile("net/proto2/io/public/coded_stream.h", printer); - IncludeFile("net/proto2/public/arena.h", printer); - IncludeFile("net/proto2/public/arenastring.h", printer); - if ((options_.force_inline_string || options_.profile_driven_inline_string) && - !options_.opensource_runtime) { - 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) { - IncludeFile("net/proto2/public/generated_message_tctable_decl.h", printer); - } - IncludeFile("net/proto2/public/generated_message_util.h", printer); - IncludeFile("net/proto2/public/metadata_lite.h", printer); - - if (HasDescriptorMethods(file_, options_)) { - IncludeFile("net/proto2/public/generated_message_reflection.h", printer); - } - - if (!message_generators_.empty()) { - if (HasDescriptorMethods(file_, options_)) { - IncludeFile("net/proto2/public/message.h", printer); - } else { - IncludeFile("net/proto2/public/message_lite.h", printer); - } - } - if (options_.opensource_runtime) { - // Open-source relies on unconditional includes of these. - IncludeFileAndExport("net/proto2/public/repeated_field.h", printer); - IncludeFileAndExport("net/proto2/public/extension_set.h", printer); - } else { - // Google3 includes these files only when they are necessary. - if (HasExtensionsOrExtendableMessage(file_)) { - IncludeFileAndExport("net/proto2/public/extension_set.h", printer); - } - if (HasRepeatedFields(file_)) { - IncludeFileAndExport("net/proto2/public/repeated_field.h", printer); - } - if (HasStringPieceFields(file_, options_)) { - IncludeFile("net/proto2/public/string_piece_field_support.h", printer); - } - if (HasCordFields(file_, options_)) { - format("#include \"third_party/absl/strings/cord.h\"\n"); - } - } - if (HasMapFields(file_)) { - IncludeFileAndExport("net/proto2/public/map.h", printer); - if (HasDescriptorMethods(file_, options_)) { - IncludeFile("net/proto2/public/map_entry.h", printer); - IncludeFile("net/proto2/public/map_field_inl.h", printer); - } else { - IncludeFile("net/proto2/public/map_entry_lite.h", printer); - IncludeFile("net/proto2/public/map_field_lite.h", printer); - } - } - - if (HasEnumDefinitions(file_)) { - if (HasDescriptorMethods(file_, options_)) { - IncludeFile("net/proto2/public/generated_enum_reflection.h", printer); - } else { - IncludeFile("net/proto2/public/generated_enum_util.h", printer); - } - } - - if (HasGenericServices(file_, options_)) { - IncludeFile("net/proto2/public/service.h", printer); - } - - if (UseUnknownFieldSet(file_, options_) && !message_generators_.empty()) { - IncludeFile("net/proto2/public/unknown_field_set.h", printer); - } -} - -void FileGenerator::GenerateMetadataPragma(io::Printer* printer, - const std::string& info_path) { - Formatter format(printer, variables_); - if (!info_path.empty() && !options_.annotation_pragma_name.empty() && - !options_.annotation_guard_name.empty()) { - format.Set("guard", options_.annotation_guard_name); - format.Set("pragma", options_.annotation_pragma_name); - format.Set("info_path", info_path); - format( - "#ifdef $guard$\n" - "#pragma $pragma$ \"$info_path$\"\n" - "#endif // $guard$\n"); - } -} - -void FileGenerator::GenerateDependencyIncludes(io::Printer* printer) { - Formatter format(printer, variables_); - for (int i = 0; i < file_->dependency_count(); i++) { - std::string basename = StripProto(file_->dependency(i)->name()); - - // Do not import weak deps. - if (IsDepWeak(file_->dependency(i))) continue; - - if (IsBootstrapProto(options_, file_)) { - GetBootstrapBasename(options_, basename, &basename); - } - - format("#include $1$\n", - CreateHeaderInclude(basename + ".pb.h", file_->dependency(i))); - } -} - -void FileGenerator::GenerateGlobalStateFunctionDeclarations( - io::Printer* printer) { - Formatter format(printer, variables_); - // Forward-declare the DescriptorTable because this is referenced by .pb.cc - // files depending on this file. - // - // The TableStruct is also outputted in weak_message_field.cc, because the - // weak fields must refer to table struct but cannot include the header. - // Also it annotates extra weak attributes. - // TODO(gerbens) make sure this situation is handled better. - format( - "\n" - "// Internal implementation detail -- do not use these members.\n" - "struct $dllexport_decl $$tablename$ {\n" - // These tables describe how to serialize and parse messages. Used - // for table driven code. - " static const ::$proto_ns$::internal::ParseTableField entries[]\n" - " PROTOBUF_SECTION_VARIABLE(protodesc_cold);\n" - " static const ::$proto_ns$::internal::AuxiliaryParseTableField aux[]\n" - " PROTOBUF_SECTION_VARIABLE(protodesc_cold);\n" - " static const ::$proto_ns$::internal::ParseTable schema[$1$]\n" - " PROTOBUF_SECTION_VARIABLE(protodesc_cold);\n" - " static const ::$proto_ns$::internal::FieldMetadata field_metadata[];\n" - " static const ::$proto_ns$::internal::SerializationTable " - "serialization_table[];\n" - " static const $uint32$ offsets[];\n" - "};\n", - std::max(size_t(1), message_generators_.size())); - if (HasDescriptorMethods(file_, options_)) { - format( - "$dllexport_decl $extern const ::$proto_ns$::internal::DescriptorTable " - "$desc_table$;\n"); - } -} - -void FileGenerator::GenerateMessageDefinitions(io::Printer* printer) { - Formatter format(printer, variables_); - // Generate class definitions. - for (int i = 0; i < message_generators_.size(); i++) { - if (i > 0) { - format("\n"); - format(kThinSeparator); - format("\n"); - } - message_generators_[i]->GenerateClassDefinition(printer); - } -} - -void FileGenerator::GenerateEnumDefinitions(io::Printer* printer) { - // Generate enum definitions. - for (int i = 0; i < enum_generators_.size(); i++) { - enum_generators_[i]->GenerateDefinition(printer); - } -} - -void FileGenerator::GenerateServiceDefinitions(io::Printer* printer) { - Formatter format(printer, variables_); - if (HasGenericServices(file_, options_)) { - // Generate service definitions. - for (int i = 0; i < service_generators_.size(); i++) { - if (i > 0) { - format("\n"); - format(kThinSeparator); - format("\n"); - } - service_generators_[i]->GenerateDeclarations(printer); - } - - format("\n"); - format(kThickSeparator); - format("\n"); - } -} - -void FileGenerator::GenerateExtensionIdentifiers(io::Printer* printer) { - // Declare extension identifiers. These are in global scope and so only - // the global scope extensions. - for (auto& extension_generator : extension_generators_) { - if (extension_generator->IsScoped()) continue; - extension_generator->GenerateDeclaration(printer); - } -} - -void FileGenerator::GenerateInlineFunctionDefinitions(io::Printer* printer) { - Formatter format(printer, variables_); - // TODO(gerbens) remove pragmas when gcc is no longer used. Current version - // of gcc fires a bogus error when compiled with strict-aliasing. - format( - "#ifdef __GNUC__\n" - " #pragma GCC diagnostic push\n" - " #pragma GCC diagnostic ignored \"-Wstrict-aliasing\"\n" - "#endif // __GNUC__\n"); - // Generate class inline methods. - for (int i = 0; i < message_generators_.size(); i++) { - if (i > 0) { - format(kThinSeparator); - format("\n"); - } - message_generators_[i]->GenerateInlineMethods(printer); - } - format( - "#ifdef __GNUC__\n" - " #pragma GCC diagnostic pop\n" - "#endif // __GNUC__\n"); - - for (int i = 0; i < message_generators_.size(); i++) { - if (i > 0) { - format(kThinSeparator); - format("\n"); - } - } -} - -void FileGenerator::GenerateProto2NamespaceEnumSpecializations( - io::Printer* printer) { - Formatter format(printer, variables_); - // Emit GetEnumDescriptor specializations into google::protobuf namespace: - if (HasEnumDefinitions(file_)) { - format("\n"); - { - NamespaceOpener proto_ns(ProtobufNamespace(options_), format); - format("\n"); - for (int i = 0; i < enum_generators_.size(); i++) { - enum_generators_[i]->GenerateGetEnumDescriptorSpecializations(printer); - } - format("\n"); - } - } -} - -} // namespace cpp -} // namespace compiler -} // namespace protobuf -} // namespace google diff --git a/extra/protobuf/protobuf-3.19.4/src/google/protobuf/compiler/cpp/cpp_file.h b/extra/protobuf/protobuf-3.19.4/src/google/protobuf/compiler/cpp/cpp_file.h deleted file mode 100644 index e8816020dde3..000000000000 --- a/extra/protobuf/protobuf-3.19.4/src/google/protobuf/compiler/cpp/cpp_file.h +++ /dev/null @@ -1,208 +0,0 @@ -// Protocol Buffers - Google's data interchange format -// Copyright 2008 Google Inc. All rights reserved. -// https://developers.google.com/protocol-buffers/ -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// * Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// * Redistributions in binary form must reproduce the above -// copyright notice, this list of conditions and the following disclaimer -// in the documentation and/or other materials provided with the -// distribution. -// * Neither the name of Google Inc. nor the names of its -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -// Author: kenton@google.com (Kenton Varda) -// Based on original Protocol Buffers design by -// Sanjay Ghemawat, Jeff Dean, and others. - -#ifndef GOOGLE_PROTOBUF_COMPILER_CPP_FILE_H__ -#define GOOGLE_PROTOBUF_COMPILER_CPP_FILE_H__ - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -namespace google { -namespace protobuf { -class FileDescriptor; // descriptor.h -namespace io { -class Printer; // printer.h -} -} // namespace protobuf -} // namespace google - -namespace google { -namespace protobuf { -namespace compiler { -namespace cpp { - -class EnumGenerator; // enum.h -class MessageGenerator; // message.h -class ServiceGenerator; // service.h -class ExtensionGenerator; // extension.h - -class FileGenerator { - public: - // See generator.cc for the meaning of dllexport_decl. - FileGenerator(const FileDescriptor* file, const Options& options); - ~FileGenerator(); - - // Shared code between the two header generators below. - void GenerateHeader(io::Printer* printer); - - // info_path, if non-empty, should be the path (relative to printer's - // output) to the metadata file describing this proto header. - void GenerateProtoHeader(io::Printer* printer, const std::string& info_path); - // info_path, if non-empty, should be the path (relative to printer's - // output) to the metadata file describing this PB header. - void GeneratePBHeader(io::Printer* printer, const std::string& info_path); - void GenerateSource(io::Printer* printer); - - // The following member functions are used when the lite_implicit_weak_fields - // option is set. In this mode the code is organized a bit differently to - // promote better linker stripping of unused code. In particular, we generate - // one .cc file per message, one .cc file per extension, and a main pb.cc file - // containing everything else. - - int NumMessages() const { return message_generators_.size(); } - int NumExtensions() const { return extension_generators_.size(); } - // Generates the source file for one message. - void GenerateSourceForMessage(int idx, io::Printer* printer); - // Generates the source file for one extension. - void GenerateSourceForExtension(int idx, io::Printer* printer); - // Generates a source file containing everything except messages and - // extensions. - void GenerateGlobalSource(io::Printer* printer); - - private: - // Internal type used by GenerateForwardDeclarations (defined in file.cc). - class ForwardDeclarations; - struct CrossFileReferences; - - void IncludeFile(const std::string& google3_name, io::Printer* printer) { - DoIncludeFile(google3_name, false, printer); - } - void IncludeFileAndExport(const std::string& google3_name, - io::Printer* printer) { - DoIncludeFile(google3_name, true, printer); - } - void DoIncludeFile(const std::string& google3_name, bool do_export, - io::Printer* printer); - - std::string CreateHeaderInclude(const std::string& basename, - const FileDescriptor* file); - void GetCrossFileReferencesForField(const FieldDescriptor* field, - CrossFileReferences* refs); - void GetCrossFileReferencesForFile(const FileDescriptor* file, - CrossFileReferences* refs); - void GenerateInternalForwardDeclarations(const CrossFileReferences& refs, - io::Printer* printer); - void GenerateSourceIncludes(io::Printer* printer); - void GenerateSourceDefaultInstance(int idx, io::Printer* printer); - - void GenerateInitForSCC(const SCC* scc, const CrossFileReferences& refs, - io::Printer* printer); - void GenerateTables(io::Printer* printer); - void GenerateReflectionInitializationCode(io::Printer* printer); - - // For other imports, generates their forward-declarations. - void GenerateForwardDeclarations(io::Printer* printer); - - // Generates top or bottom of a header file. - void GenerateTopHeaderGuard(io::Printer* printer, bool pb_h); - void GenerateBottomHeaderGuard(io::Printer* printer, bool pb_h); - - // Generates #include directives. - void GenerateLibraryIncludes(io::Printer* printer); - void GenerateDependencyIncludes(io::Printer* printer); - - // Generate a pragma to pull in metadata using the given info_path (if - // non-empty). info_path should be relative to printer's output. - void GenerateMetadataPragma(io::Printer* printer, - const std::string& info_path); - - // Generates a couple of different pieces before definitions: - void GenerateGlobalStateFunctionDeclarations(io::Printer* printer); - - // Generates types for classes. - void GenerateMessageDefinitions(io::Printer* printer); - - void GenerateEnumDefinitions(io::Printer* printer); - - // Generates generic service definitions. - void GenerateServiceDefinitions(io::Printer* printer); - - // Generates extension identifiers. - void GenerateExtensionIdentifiers(io::Printer* printer); - - // Generates inline function definitions. - void GenerateInlineFunctionDefinitions(io::Printer* printer); - - void GenerateProto2NamespaceEnumSpecializations(io::Printer* printer); - - // Sometimes the names we use in a .proto file happen to be defined as - // macros on some platforms (e.g., macro/minor used in plugin.proto are - // defined as macros in sys/types.h on FreeBSD and a few other platforms). - // To make the generated code compile on these platforms, we either have to - // undef the macro for these few platforms, or rename the field name for all - // platforms. Since these names are part of protobuf public API, renaming is - // generally a breaking change so we prefer the #undef approach. - void GenerateMacroUndefs(io::Printer* printer); - - bool IsDepWeak(const FileDescriptor* dep) const { - if (weak_deps_.count(dep) != 0) { - GOOGLE_CHECK(!options_.opensource_runtime); - return true; - } - return false; - } - - std::set weak_deps_; - - const FileDescriptor* file_; - const Options options_; - - MessageSCCAnalyzer scc_analyzer_; - - std::map variables_; - - // Contains the post-order walk of all the messages (and child messages) in - // this file. If you need a pre-order walk just reverse iterate. - std::vector> message_generators_; - std::vector> enum_generators_; - std::vector> service_generators_; - std::vector> extension_generators_; - - GOOGLE_DISALLOW_EVIL_CONSTRUCTORS(FileGenerator); -}; - -} // namespace cpp -} // namespace compiler -} // namespace protobuf -} // namespace google - -#endif // GOOGLE_PROTOBUF_COMPILER_CPP_FILE_H__ diff --git a/extra/protobuf/protobuf-3.19.4/src/google/protobuf/compiler/cpp/cpp_generator.cc b/extra/protobuf/protobuf-3.19.4/src/google/protobuf/compiler/cpp/cpp_generator.cc deleted file mode 100644 index 085157102bb4..000000000000 --- a/extra/protobuf/protobuf-3.19.4/src/google/protobuf/compiler/cpp/cpp_generator.cc +++ /dev/null @@ -1,271 +0,0 @@ -// Protocol Buffers - Google's data interchange format -// Copyright 2008 Google Inc. All rights reserved. -// https://developers.google.com/protocol-buffers/ -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// * Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// * Redistributions in binary form must reproduce the above -// copyright notice, this list of conditions and the following disclaimer -// in the documentation and/or other materials provided with the -// distribution. -// * Neither the name of Google Inc. nor the names of its -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -// Author: kenton@google.com (Kenton Varda) -// Based on original Protocol Buffers design by -// Sanjay Ghemawat, Jeff Dean, and others. - -#include - -#include -#include -#include -#include - -#include -#include -#include -#include -#include -#include - -namespace google { -namespace protobuf { -namespace compiler { -namespace cpp { - -CppGenerator::CppGenerator() {} -CppGenerator::~CppGenerator() {} - -namespace { -std::string NumberedCcFileName(const std::string& basename, int number) { - return StrCat(basename, ".out/", number, ".cc"); -} -} // namespace - -bool CppGenerator::Generate(const FileDescriptor* file, - const std::string& parameter, - GeneratorContext* generator_context, - std::string* error) const { - std::vector > options; - ParseGeneratorParameter(parameter, &options); - - // ----------------------------------------------------------------- - // parse generator options - - // If the dllexport_decl option is passed to the compiler, we need to write - // it in front of every symbol that should be exported if this .proto is - // compiled into a Windows DLL. E.g., if the user invokes the protocol - // compiler as: - // protoc --cpp_out=dllexport_decl=FOO_EXPORT:outdir foo.proto - // then we'll define classes like this: - // class FOO_EXPORT Foo { - // ... - // } - // FOO_EXPORT is a macro which should expand to __declspec(dllexport) or - // __declspec(dllimport) depending on what is being compiled. - // - Options file_options; - - file_options.opensource_runtime = opensource_runtime_; - file_options.runtime_include_base = runtime_include_base_; - - for (int i = 0; i < options.size(); i++) { - if (options[i].first == "dllexport_decl") { - file_options.dllexport_decl = options[i].second; - } else if (options[i].first == "safe_boundary_check") { - file_options.safe_boundary_check = true; - } else if (options[i].first == "annotate_headers") { - file_options.annotate_headers = true; - } else if (options[i].first == "annotation_pragma_name") { - file_options.annotation_pragma_name = options[i].second; - } else if (options[i].first == "annotation_guard_name") { - file_options.annotation_guard_name = options[i].second; - } else if (options[i].first == "speed") { - file_options.enforce_mode = EnforceOptimizeMode::kSpeed; - } else if (options[i].first == "code_size") { - file_options.enforce_mode = EnforceOptimizeMode::kCodeSize; - } else if (options[i].first == "lite") { - file_options.enforce_mode = EnforceOptimizeMode::kLiteRuntime; - } else if (options[i].first == "lite_implicit_weak_fields") { - file_options.enforce_mode = EnforceOptimizeMode::kLiteRuntime; - file_options.lite_implicit_weak_fields = true; - if (!options[i].second.empty()) { - file_options.num_cc_files = - strto32(options[i].second.c_str(), NULL, 10); - } - } else if (options[i].first == "annotate_accessor") { - file_options.annotate_accessor = true; - } else if (options[i].first == "inject_field_listener_events") { - file_options.field_listener_options.inject_field_listener_events = true; - } else if (options[i].first == "forbidden_field_listener_events") { - std::size_t pos = 0; - do { - std::size_t next_pos = options[i].second.find_first_of("+", pos); - if (next_pos == std::string::npos) { - next_pos = options[i].second.size(); - } - if (next_pos > pos) - file_options.field_listener_options.forbidden_field_listener_events - .insert(options[i].second.substr(pos, next_pos - pos)); - pos = next_pos + 1; - } while (pos < options[i].second.size()); - } else if (options[i].first == "eagerly_verified_lazy") { - file_options.eagerly_verified_lazy = true; - } else if (options[i].first == "force_eagerly_verified_lazy") { - file_options.force_eagerly_verified_lazy = true; - } else if (options[i].first == "table_driven_parsing") { - file_options.table_driven_parsing = true; - } else if (options[i].first == "table_driven_serialization") { - file_options.table_driven_serialization = true; - } else if (options[i].first == "experimental_tail_call_table_mode") { - if (options[i].second == "never") { - file_options.tctable_mode = Options::kTCTableNever; - } else if (options[i].second == "guarded") { - file_options.tctable_mode = Options::kTCTableGuarded; - } else if (options[i].second == "always") { - file_options.tctable_mode = Options::kTCTableAlways; - } else { - *error = "Unknown value for experimental_tail_call_table_mode: " + - options[i].second; - return false; - } - } else { - *error = "Unknown generator option: " + options[i].first; - return false; - } - } - - // The safe_boundary_check option controls behavior for Google-internal - // protobuf APIs. - if (file_options.safe_boundary_check && file_options.opensource_runtime) { - *error = - "The safe_boundary_check option is not supported outside of Google."; - return false; - } - - // ----------------------------------------------------------------- - - - std::string basename = StripProto(file->name()); - - if (MaybeBootstrap(file_options, generator_context, file_options.bootstrap, - &basename)) { - return true; - } - - FileGenerator file_generator(file, file_options); - - // Generate header(s). - if (file_options.proto_h) { - std::unique_ptr output( - generator_context->Open(basename + ".proto.h")); - GeneratedCodeInfo annotations; - io::AnnotationProtoCollector annotation_collector( - &annotations); - std::string info_path = basename + ".proto.h.meta"; - io::Printer printer( - output.get(), '$', - file_options.annotate_headers ? &annotation_collector : NULL); - file_generator.GenerateProtoHeader( - &printer, file_options.annotate_headers ? info_path : ""); - if (file_options.annotate_headers) { - std::unique_ptr info_output( - generator_context->Open(info_path)); - annotations.SerializeToZeroCopyStream(info_output.get()); - } - } - - { - std::unique_ptr output( - generator_context->Open(basename + ".pb.h")); - GeneratedCodeInfo annotations; - io::AnnotationProtoCollector annotation_collector( - &annotations); - std::string info_path = basename + ".pb.h.meta"; - io::Printer printer( - output.get(), '$', - file_options.annotate_headers ? &annotation_collector : NULL); - file_generator.GeneratePBHeader( - &printer, file_options.annotate_headers ? info_path : ""); - if (file_options.annotate_headers) { - std::unique_ptr info_output( - generator_context->Open(info_path)); - annotations.SerializeToZeroCopyStream(info_output.get()); - } - } - - // Generate cc file(s). - if (UsingImplicitWeakFields(file, file_options)) { - { - // This is the global .cc file, containing - // enum/services/tables/reflection - std::unique_ptr output( - generator_context->Open(basename + ".pb.cc")); - io::Printer printer(output.get(), '$'); - file_generator.GenerateGlobalSource(&printer); - } - - int num_cc_files = - file_generator.NumMessages() + file_generator.NumExtensions(); - - // If we're using implicit weak fields then we allow the user to - // optionally specify how many files to generate, not counting the global - // pb.cc file. If we have more files than messages, then some files will - // be generated as empty placeholders. - if (file_options.num_cc_files > 0) { - GOOGLE_CHECK_LE(num_cc_files, file_options.num_cc_files) - << "There must be at least as many numbered .cc files as messages " - "and extensions."; - num_cc_files = file_options.num_cc_files; - } - int cc_file_number = 0; - for (int i = 0; i < file_generator.NumMessages(); i++) { - std::unique_ptr output(generator_context->Open( - NumberedCcFileName(basename, cc_file_number++))); - io::Printer printer(output.get(), '$'); - file_generator.GenerateSourceForMessage(i, &printer); - } - for (int i = 0; i < file_generator.NumExtensions(); i++) { - std::unique_ptr output(generator_context->Open( - NumberedCcFileName(basename, cc_file_number++))); - io::Printer printer(output.get(), '$'); - file_generator.GenerateSourceForExtension(i, &printer); - } - // Create empty placeholder files if necessary to match the expected number - // of files. - for (; cc_file_number < num_cc_files; ++cc_file_number) { - std::unique_ptr output(generator_context->Open( - NumberedCcFileName(basename, cc_file_number))); - } - } else { - std::unique_ptr output( - generator_context->Open(basename + ".pb.cc")); - io::Printer printer(output.get(), '$'); - file_generator.GenerateSource(&printer); - } - - return true; -} - -} // namespace cpp -} // namespace compiler -} // namespace protobuf -} // namespace google diff --git a/extra/protobuf/protobuf-3.19.4/src/google/protobuf/compiler/cpp/cpp_generator.h b/extra/protobuf/protobuf-3.19.4/src/google/protobuf/compiler/cpp/cpp_generator.h deleted file mode 100644 index 97e848dc4f50..000000000000 --- a/extra/protobuf/protobuf-3.19.4/src/google/protobuf/compiler/cpp/cpp_generator.h +++ /dev/null @@ -1,106 +0,0 @@ -// Protocol Buffers - Google's data interchange format -// Copyright 2008 Google Inc. All rights reserved. -// https://developers.google.com/protocol-buffers/ -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// * Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// * Redistributions in binary form must reproduce the above -// copyright notice, this list of conditions and the following disclaimer -// in the documentation and/or other materials provided with the -// distribution. -// * Neither the name of Google Inc. nor the names of its -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -// Author: kenton@google.com (Kenton Varda) -// Based on original Protocol Buffers design by -// Sanjay Ghemawat, Jeff Dean, and others. -// -// Generates C++ code for a given .proto file. - -#ifndef GOOGLE_PROTOBUF_COMPILER_CPP_GENERATOR_H__ -#define GOOGLE_PROTOBUF_COMPILER_CPP_GENERATOR_H__ - -#include -#include - -#include - -namespace google { -namespace protobuf { -namespace compiler { -namespace cpp { - -// CodeGenerator implementation which generates a C++ source file and -// header. If you create your own protocol compiler binary and you want -// it to support C++ output, you can do so by registering an instance of this -// CodeGenerator with the CommandLineInterface in your main() function. -class PROTOC_EXPORT CppGenerator : public CodeGenerator { - public: - CppGenerator(); - ~CppGenerator(); - - enum class Runtime { - kGoogle3, // Use the internal google3 runtime. - kOpensource, // Use the open-source runtime. - - // Use the open-source runtime with google3 #include paths. We make these - // absolute to avoid ambiguity, so the runtime will be #included like: - // #include "third_party/protobuf/.../google/protobuf/message.h" - kOpensourceGoogle3 - }; - - void set_opensource_runtime(bool opensource) { - opensource_runtime_ = opensource; - } - - // If set to a non-empty string, generated code will do: - // #include "/google/protobuf/message.h" - // instead of: - // #include - // This has no effect if opensource_runtime = false. - void set_runtime_include_base(const std::string& base) { - runtime_include_base_ = base; - } - - // implements CodeGenerator ---------------------------------------- - bool Generate(const FileDescriptor* file, const std::string& parameter, - GeneratorContext* generator_context, - std::string* error) const override; - - uint64_t GetSupportedFeatures() const override { - // We don't fully support this yet, but this is needed to unblock the tests, - // and we will have full support before the experimental flag is removed. - return FEATURE_PROTO3_OPTIONAL; - } - - private: - bool opensource_runtime_ = true; - std::string runtime_include_base_; - GOOGLE_DISALLOW_EVIL_CONSTRUCTORS(CppGenerator); -}; - -} // namespace cpp -} // namespace compiler -} // namespace protobuf -} // namespace google - -#include - -#endif // GOOGLE_PROTOBUF_COMPILER_CPP_GENERATOR_H__ diff --git a/extra/protobuf/protobuf-3.19.4/src/google/protobuf/compiler/cpp/cpp_helpers.cc b/extra/protobuf/protobuf-3.19.4/src/google/protobuf/compiler/cpp/cpp_helpers.cc deleted file mode 100644 index 9fe47bff5ff2..000000000000 --- a/extra/protobuf/protobuf-3.19.4/src/google/protobuf/compiler/cpp/cpp_helpers.cc +++ /dev/null @@ -1,1497 +0,0 @@ -// Protocol Buffers - Google's data interchange format -// Copyright 2008 Google Inc. All rights reserved. -// https://developers.google.com/protocol-buffers/ -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// * Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// * Redistributions in binary form must reproduce the above -// copyright notice, this list of conditions and the following disclaimer -// in the documentation and/or other materials provided with the -// distribution. -// * Neither the name of Google Inc. nor the names of its -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -// Author: kenton@google.com (Kenton Varda) -// Based on original Protocol Buffers design by -// Sanjay Ghemawat, Jeff Dean, and others. - -#include - -#include -#include -#include -#include -#include -#include -#include - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -// Must be last. -#include - -namespace google { -namespace protobuf { -namespace compiler { -namespace cpp { - -namespace { - -static const char kAnyMessageName[] = "Any"; -static const char kAnyProtoFile[] = "google/protobuf/any.proto"; - -std::string DotsToColons(const std::string& name) { - return StringReplace(name, ".", "::", true); -} - -static const char* const kKeywordList[] = { // - "NULL", - "alignas", - "alignof", - "and", - "and_eq", - "asm", - "auto", - "bitand", - "bitor", - "bool", - "break", - "case", - "catch", - "char", - "class", - "compl", - "const", - "constexpr", - "const_cast", - "continue", - "decltype", - "default", - "delete", - "do", - "double", - "dynamic_cast", - "else", - "enum", - "explicit", - "export", - "extern", - "false", - "float", - "for", - "friend", - "goto", - "if", - "inline", - "int", - "long", - "mutable", - "namespace", - "new", - "noexcept", - "not", - "not_eq", - "nullptr", - "operator", - "or", - "or_eq", - "private", - "protected", - "public", - "register", - "reinterpret_cast", - "return", - "short", - "signed", - "sizeof", - "static", - "static_assert", - "static_cast", - "struct", - "switch", - "template", - "this", - "thread_local", - "throw", - "true", - "try", - "typedef", - "typeid", - "typename", - "union", - "unsigned", - "using", - "virtual", - "void", - "volatile", - "wchar_t", - "while", - "xor", - "xor_eq"}; - -static std::unordered_set* MakeKeywordsMap() { - auto* result = new std::unordered_set(); - for (const auto keyword : kKeywordList) { - result->emplace(keyword); - } - return result; -} - -static std::unordered_set& kKeywords = *MakeKeywordsMap(); - -std::string IntTypeName(const Options& options, const std::string& type) { - return type + "_t"; -} - -void SetIntVar(const Options& options, const std::string& type, - std::map* variables) { - (*variables)[type] = IntTypeName(options, type); -} -bool IsEagerlyVerifiedLazyImpl(const FieldDescriptor* field, - const Options& options, - MessageSCCAnalyzer* scc_analyzer) { - return false; -} - -} // namespace - -bool IsLazy(const FieldDescriptor* field, const Options& options, - MessageSCCAnalyzer* scc_analyzer) { - return IsLazilyVerifiedLazy(field, options) || - IsEagerlyVerifiedLazyImpl(field, options, scc_analyzer); -} - -void SetCommonVars(const Options& options, - std::map* variables) { - (*variables)["proto_ns"] = ProtobufNamespace(options); - - // Warning: there is some clever naming/splitting here to avoid extract script - // rewrites. The names of these variables must not be things that the extract - // script will rewrite. That's why we use "CHK" (for example) instead of - // "GOOGLE_CHECK". - if (options.opensource_runtime) { - (*variables)["GOOGLE_PROTOBUF"] = "GOOGLE_PROTOBUF"; - (*variables)["CHK"] = "GOOGLE_CHECK"; - (*variables)["DCHK"] = "GOOGLE_DCHECK"; - } else { - // These values are things the extract script would rewrite if we did not - // split them. It might not strictly matter since we don't generate google3 - // code in open-source. But it's good to prevent surprising things from - // happening. - (*variables)["GOOGLE_PROTOBUF"] = - "GOOGLE3" - "_PROTOBUF"; - (*variables)["CHK"] = - "CH" - "ECK"; - (*variables)["DCHK"] = - "DCH" - "ECK"; - } - - SetIntVar(options, "int8", variables); - SetIntVar(options, "uint8", variables); - SetIntVar(options, "uint32", variables); - SetIntVar(options, "uint64", variables); - SetIntVar(options, "int32", variables); - SetIntVar(options, "int64", variables); - (*variables)["string"] = "std::string"; -} - -void SetUnknownFieldsVariable(const Descriptor* descriptor, - const Options& options, - std::map* variables) { - std::string proto_ns = ProtobufNamespace(options); - std::string unknown_fields_type; - if (UseUnknownFieldSet(descriptor->file(), options)) { - unknown_fields_type = "::" + proto_ns + "::UnknownFieldSet"; - (*variables)["unknown_fields"] = - "_internal_metadata_.unknown_fields<" + unknown_fields_type + ">(" + - unknown_fields_type + "::default_instance)"; - } else { - unknown_fields_type = - PrimitiveTypeName(options, FieldDescriptor::CPPTYPE_STRING); - (*variables)["unknown_fields"] = "_internal_metadata_.unknown_fields<" + - unknown_fields_type + ">(::" + proto_ns + - "::internal::GetEmptyString)"; - } - (*variables)["unknown_fields_type"] = unknown_fields_type; - (*variables)["have_unknown_fields"] = - "_internal_metadata_.have_unknown_fields()"; - (*variables)["mutable_unknown_fields"] = - "_internal_metadata_.mutable_unknown_fields<" + unknown_fields_type + - ">()"; -} - -std::string UnderscoresToCamelCase(const std::string& input, - bool cap_next_letter) { - std::string result; - // Note: I distrust ctype.h due to locales. - for (int i = 0; i < input.size(); i++) { - if ('a' <= input[i] && input[i] <= 'z') { - if (cap_next_letter) { - result += input[i] + ('A' - 'a'); - } else { - result += input[i]; - } - cap_next_letter = false; - } else if ('A' <= input[i] && input[i] <= 'Z') { - // Capital letters are left as-is. - result += input[i]; - cap_next_letter = false; - } else if ('0' <= input[i] && input[i] <= '9') { - result += input[i]; - cap_next_letter = true; - } else { - cap_next_letter = true; - } - } - return result; -} - -const char kThickSeparator[] = - "// ===================================================================\n"; -const char kThinSeparator[] = - "// -------------------------------------------------------------------\n"; - -bool CanInitializeByZeroing(const FieldDescriptor* field) { - if (field->is_repeated() || field->is_extension()) return false; - switch (field->cpp_type()) { - case FieldDescriptor::CPPTYPE_ENUM: - return field->default_value_enum()->number() == 0; - case FieldDescriptor::CPPTYPE_INT32: - return field->default_value_int32() == 0; - case FieldDescriptor::CPPTYPE_INT64: - return field->default_value_int64() == 0; - case FieldDescriptor::CPPTYPE_UINT32: - return field->default_value_uint32() == 0; - case FieldDescriptor::CPPTYPE_UINT64: - return field->default_value_uint64() == 0; - case FieldDescriptor::CPPTYPE_FLOAT: - return field->default_value_float() == 0; - case FieldDescriptor::CPPTYPE_DOUBLE: - return field->default_value_double() == 0; - case FieldDescriptor::CPPTYPE_BOOL: - return field->default_value_bool() == false; - default: - return false; - } -} - -std::string ClassName(const Descriptor* descriptor) { - const Descriptor* parent = descriptor->containing_type(); - std::string res; - if (parent) res += ClassName(parent) + "_"; - res += descriptor->name(); - if (IsMapEntryMessage(descriptor)) res += "_DoNotUse"; - return ResolveKeyword(res); -} - -std::string ClassName(const EnumDescriptor* enum_descriptor) { - if (enum_descriptor->containing_type() == nullptr) { - return ResolveKeyword(enum_descriptor->name()); - } else { - return ClassName(enum_descriptor->containing_type()) + "_" + - enum_descriptor->name(); - } -} - -std::string QualifiedClassName(const Descriptor* d, const Options& options) { - return QualifiedFileLevelSymbol(d->file(), ClassName(d), options); -} - -std::string QualifiedClassName(const EnumDescriptor* d, - const Options& options) { - return QualifiedFileLevelSymbol(d->file(), ClassName(d), options); -} - -std::string QualifiedClassName(const Descriptor* d) { - return QualifiedClassName(d, Options()); -} - -std::string QualifiedClassName(const EnumDescriptor* d) { - return QualifiedClassName(d, Options()); -} - -std::string ExtensionName(const FieldDescriptor* d) { - if (const Descriptor* scope = d->extension_scope()) - return StrCat(ClassName(scope), "::", ResolveKeyword(d->name())); - return ResolveKeyword(d->name()); -} - -std::string QualifiedExtensionName(const FieldDescriptor* d, - const Options& options) { - GOOGLE_DCHECK(d->is_extension()); - return QualifiedFileLevelSymbol(d->file(), ExtensionName(d), options); -} - -std::string QualifiedExtensionName(const FieldDescriptor* d) { - return QualifiedExtensionName(d, Options()); -} - -std::string Namespace(const std::string& package) { - if (package.empty()) return ""; - return "::" + DotsToColons(package); -} - -std::string Namespace(const FileDescriptor* d, const Options& options) { - std::string ret = Namespace(d->package()); - if (IsWellKnownMessage(d) && options.opensource_runtime) { - // Written with string concatenation to prevent rewriting of - // ::google::protobuf. - ret = StringReplace(ret, - "::google::" - "protobuf", - "::PROTOBUF_NAMESPACE_ID", false); - } - return ret; -} - -std::string Namespace(const Descriptor* d, const Options& options) { - return Namespace(d->file(), options); -} - -std::string Namespace(const FieldDescriptor* d, const Options& options) { - return Namespace(d->file(), options); -} - -std::string Namespace(const EnumDescriptor* d, const Options& options) { - return Namespace(d->file(), options); -} - -std::string DefaultInstanceType(const Descriptor* descriptor, - const Options& options) { - return ClassName(descriptor) + "DefaultTypeInternal"; -} - -std::string DefaultInstanceName(const Descriptor* descriptor, - const Options& options) { - return "_" + ClassName(descriptor, false) + "_default_instance_"; -} - -std::string DefaultInstancePtr(const Descriptor* descriptor, - const Options& options) { - return DefaultInstanceName(descriptor, options) + "ptr_"; -} - -std::string QualifiedDefaultInstanceName(const Descriptor* descriptor, - const Options& options) { - return QualifiedFileLevelSymbol( - descriptor->file(), DefaultInstanceName(descriptor, options), options); -} - -std::string QualifiedDefaultInstancePtr(const Descriptor* descriptor, - const Options& options) { - return QualifiedDefaultInstanceName(descriptor, options) + "ptr_"; -} - -std::string DescriptorTableName(const FileDescriptor* file, - const Options& options) { - return UniqueName("descriptor_table", file, options); -} - -std::string FileDllExport(const FileDescriptor* file, const Options& options) { - return UniqueName("PROTOBUF_INTERNAL_EXPORT", file, options); -} - -std::string SuperClassName(const Descriptor* descriptor, - const Options& options) { - if (!HasDescriptorMethods(descriptor->file(), options)) { - return "::" + ProtobufNamespace(options) + "::MessageLite"; - } - auto simple_base = SimpleBaseClass(descriptor, options); - if (simple_base.empty()) { - return "::" + ProtobufNamespace(options) + "::Message"; - } - return "::" + ProtobufNamespace(options) + "::internal::" + simple_base; -} - -std::string ResolveKeyword(const std::string& name) { - if (kKeywords.count(name) > 0) { - return name + "_"; - } - return name; -} - -std::string FieldName(const FieldDescriptor* field) { - std::string result = field->name(); - LowerString(&result); - if (kKeywords.count(result) > 0) { - result.append("_"); - } - return result; -} - -std::string OneofCaseConstantName(const FieldDescriptor* field) { - GOOGLE_DCHECK(field->containing_oneof()); - std::string field_name = UnderscoresToCamelCase(field->name(), true); - return "k" + field_name; -} - -std::string QualifiedOneofCaseConstantName(const FieldDescriptor* field) { - GOOGLE_DCHECK(field->containing_oneof()); - const std::string qualification = - QualifiedClassName(field->containing_type()); - return StrCat(qualification, "::", OneofCaseConstantName(field)); -} - -std::string EnumValueName(const EnumValueDescriptor* enum_value) { - std::string result = enum_value->name(); - if (kKeywords.count(result) > 0) { - result.append("_"); - } - return result; -} - -int EstimateAlignmentSize(const FieldDescriptor* field) { - if (field == nullptr) return 0; - if (field->is_repeated()) return 8; - switch (field->cpp_type()) { - case FieldDescriptor::CPPTYPE_BOOL: - return 1; - - case FieldDescriptor::CPPTYPE_INT32: - case FieldDescriptor::CPPTYPE_UINT32: - case FieldDescriptor::CPPTYPE_ENUM: - case FieldDescriptor::CPPTYPE_FLOAT: - return 4; - - case FieldDescriptor::CPPTYPE_INT64: - case FieldDescriptor::CPPTYPE_UINT64: - case FieldDescriptor::CPPTYPE_DOUBLE: - case FieldDescriptor::CPPTYPE_STRING: - case FieldDescriptor::CPPTYPE_MESSAGE: - return 8; - } - GOOGLE_LOG(FATAL) << "Can't get here."; - return -1; // Make compiler happy. -} - -std::string FieldConstantName(const FieldDescriptor* field) { - std::string field_name = UnderscoresToCamelCase(field->name(), true); - std::string result = "k" + field_name + "FieldNumber"; - - if (!field->is_extension() && - field->containing_type()->FindFieldByCamelcaseName( - field->camelcase_name()) != field) { - // This field's camelcase name is not unique. As a hack, add the field - // number to the constant name. This makes the constant rather useless, - // but what can we do? - result += "_" + StrCat(field->number()); - } - - return result; -} - -std::string FieldMessageTypeName(const FieldDescriptor* field, - const Options& options) { - // Note: The Google-internal version of Protocol Buffers uses this function - // as a hook point for hacks to support legacy code. - return QualifiedClassName(field->message_type(), options); -} - -std::string StripProto(const std::string& filename) { - /* - * TODO(github/georgthegreat) remove this proxy method - * once Google's internal codebase will become ready - */ - return compiler::StripProto(filename); -} - -const char* PrimitiveTypeName(FieldDescriptor::CppType type) { - switch (type) { - case FieldDescriptor::CPPTYPE_INT32: - return "int32_t"; - case FieldDescriptor::CPPTYPE_INT64: - return "int64_t"; - case FieldDescriptor::CPPTYPE_UINT32: - return "uint32_t"; - case FieldDescriptor::CPPTYPE_UINT64: - return "uint64_t"; - case FieldDescriptor::CPPTYPE_DOUBLE: - return "double"; - case FieldDescriptor::CPPTYPE_FLOAT: - return "float"; - case FieldDescriptor::CPPTYPE_BOOL: - return "bool"; - case FieldDescriptor::CPPTYPE_ENUM: - return "int"; - case FieldDescriptor::CPPTYPE_STRING: - return "std::string"; - case FieldDescriptor::CPPTYPE_MESSAGE: - return nullptr; - - // No default because we want the compiler to complain if any new - // CppTypes are added. - } - - GOOGLE_LOG(FATAL) << "Can't get here."; - return nullptr; -} - -std::string PrimitiveTypeName(const Options& options, - FieldDescriptor::CppType type) { - switch (type) { - case FieldDescriptor::CPPTYPE_INT32: - return IntTypeName(options, "int32"); - case FieldDescriptor::CPPTYPE_INT64: - return IntTypeName(options, "int64"); - case FieldDescriptor::CPPTYPE_UINT32: - return IntTypeName(options, "uint32"); - case FieldDescriptor::CPPTYPE_UINT64: - return IntTypeName(options, "uint64"); - case FieldDescriptor::CPPTYPE_DOUBLE: - return "double"; - case FieldDescriptor::CPPTYPE_FLOAT: - return "float"; - case FieldDescriptor::CPPTYPE_BOOL: - return "bool"; - case FieldDescriptor::CPPTYPE_ENUM: - return "int"; - case FieldDescriptor::CPPTYPE_STRING: - return "std::string"; - case FieldDescriptor::CPPTYPE_MESSAGE: - return ""; - - // No default because we want the compiler to complain if any new - // CppTypes are added. - } - - GOOGLE_LOG(FATAL) << "Can't get here."; - return ""; -} - -const char* DeclaredTypeMethodName(FieldDescriptor::Type type) { - switch (type) { - case FieldDescriptor::TYPE_INT32: - return "Int32"; - case FieldDescriptor::TYPE_INT64: - return "Int64"; - case FieldDescriptor::TYPE_UINT32: - return "UInt32"; - case FieldDescriptor::TYPE_UINT64: - return "UInt64"; - case FieldDescriptor::TYPE_SINT32: - return "SInt32"; - case FieldDescriptor::TYPE_SINT64: - return "SInt64"; - case FieldDescriptor::TYPE_FIXED32: - return "Fixed32"; - case FieldDescriptor::TYPE_FIXED64: - return "Fixed64"; - case FieldDescriptor::TYPE_SFIXED32: - return "SFixed32"; - case FieldDescriptor::TYPE_SFIXED64: - return "SFixed64"; - case FieldDescriptor::TYPE_FLOAT: - return "Float"; - case FieldDescriptor::TYPE_DOUBLE: - return "Double"; - - case FieldDescriptor::TYPE_BOOL: - return "Bool"; - case FieldDescriptor::TYPE_ENUM: - return "Enum"; - - case FieldDescriptor::TYPE_STRING: - return "String"; - case FieldDescriptor::TYPE_BYTES: - return "Bytes"; - case FieldDescriptor::TYPE_GROUP: - return "Group"; - case FieldDescriptor::TYPE_MESSAGE: - return "Message"; - - // No default because we want the compiler to complain if any new - // types are added. - } - GOOGLE_LOG(FATAL) << "Can't get here."; - return ""; -} - -std::string Int32ToString(int number) { - if (number == std::numeric_limits::min()) { - // This needs to be special-cased, see explanation here: - // https://gcc.gnu.org/bugzilla/show_bug.cgi?id=52661 - return StrCat(number + 1, " - 1"); - } else { - return StrCat(number); - } -} - -static std::string Int64ToString(int64_t number) { - if (number == std::numeric_limits::min()) { - // This needs to be special-cased, see explanation here: - // https://gcc.gnu.org/bugzilla/show_bug.cgi?id=52661 - return StrCat("int64_t{", number + 1, "} - 1"); - } - return StrCat("int64_t{", number, "}"); -} - -static std::string UInt64ToString(uint64_t number) { - return StrCat("uint64_t{", number, "u}"); -} - -std::string DefaultValue(const FieldDescriptor* field) { - return DefaultValue(Options(), field); -} - -std::string DefaultValue(const Options& options, const FieldDescriptor* field) { - switch (field->cpp_type()) { - case FieldDescriptor::CPPTYPE_INT32: - return Int32ToString(field->default_value_int32()); - case FieldDescriptor::CPPTYPE_UINT32: - return StrCat(field->default_value_uint32()) + "u"; - case FieldDescriptor::CPPTYPE_INT64: - return Int64ToString(field->default_value_int64()); - case FieldDescriptor::CPPTYPE_UINT64: - return UInt64ToString(field->default_value_uint64()); - case FieldDescriptor::CPPTYPE_DOUBLE: { - double value = field->default_value_double(); - if (value == std::numeric_limits::infinity()) { - return "std::numeric_limits::infinity()"; - } else if (value == -std::numeric_limits::infinity()) { - return "-std::numeric_limits::infinity()"; - } else if (value != value) { - return "std::numeric_limits::quiet_NaN()"; - } else { - return SimpleDtoa(value); - } - } - case FieldDescriptor::CPPTYPE_FLOAT: { - float value = field->default_value_float(); - if (value == std::numeric_limits::infinity()) { - return "std::numeric_limits::infinity()"; - } else if (value == -std::numeric_limits::infinity()) { - return "-std::numeric_limits::infinity()"; - } else if (value != value) { - return "std::numeric_limits::quiet_NaN()"; - } else { - std::string float_value = SimpleFtoa(value); - // If floating point value contains a period (.) or an exponent - // (either E or e), then append suffix 'f' to make it a float - // literal. - if (float_value.find_first_of(".eE") != std::string::npos) { - float_value.push_back('f'); - } - return float_value; - } - } - case FieldDescriptor::CPPTYPE_BOOL: - return field->default_value_bool() ? "true" : "false"; - case FieldDescriptor::CPPTYPE_ENUM: - // Lazy: Generate a static_cast because we don't have a helper function - // that constructs the full name of an enum value. - return strings::Substitute( - "static_cast< $0 >($1)", ClassName(field->enum_type(), true), - Int32ToString(field->default_value_enum()->number())); - case FieldDescriptor::CPPTYPE_STRING: - return "\"" + - EscapeTrigraphs(CEscape(field->default_value_string())) + - "\""; - case FieldDescriptor::CPPTYPE_MESSAGE: - return "*" + FieldMessageTypeName(field, options) + - "::internal_default_instance()"; - } - // Can't actually get here; make compiler happy. (We could add a default - // case above but then we wouldn't get the nice compiler warning when a - // new type is added.) - GOOGLE_LOG(FATAL) << "Can't get here."; - return ""; -} - -// Convert a file name into a valid identifier. -std::string FilenameIdentifier(const std::string& filename) { - std::string result; - for (int i = 0; i < filename.size(); i++) { - if (ascii_isalnum(filename[i])) { - result.push_back(filename[i]); - } else { - // Not alphanumeric. To avoid any possibility of name conflicts we - // use the hex code for the character. - StrAppend(&result, "_", - strings::Hex(static_cast(filename[i]))); - } - } - return result; -} - -std::string UniqueName(const std::string& name, const std::string& filename, - const Options& options) { - return name + "_" + FilenameIdentifier(filename); -} - -// Return the qualified C++ name for a file level symbol. -std::string QualifiedFileLevelSymbol(const FileDescriptor* file, - const std::string& name, - const Options& options) { - if (file->package().empty()) { - return StrCat("::", name); - } - return StrCat(Namespace(file, options), "::", name); -} - -// Escape C++ trigraphs by escaping question marks to \? -std::string EscapeTrigraphs(const std::string& to_escape) { - return StringReplace(to_escape, "?", "\\?", true); -} - -// Escaped function name to eliminate naming conflict. -std::string SafeFunctionName(const Descriptor* descriptor, - const FieldDescriptor* field, - const std::string& prefix) { - // Do not use FieldName() since it will escape keywords. - std::string name = field->name(); - LowerString(&name); - std::string function_name = prefix + name; - if (descriptor->FindFieldByName(function_name)) { - // Single underscore will also make it conflicting with the private data - // member. We use double underscore to escape function names. - function_name.append("__"); - } else if (kKeywords.count(name) > 0) { - // If the field name is a keyword, we append the underscore back to keep it - // consistent with other function names. - function_name.append("_"); - } - return function_name; -} - -bool IsStringInlined(const FieldDescriptor* descriptor, - const Options& options) { - (void)descriptor; - (void)options; - return false; -} - -static bool HasLazyFields(const Descriptor* descriptor, const Options& options, - MessageSCCAnalyzer* scc_analyzer) { - for (int field_idx = 0; field_idx < descriptor->field_count(); field_idx++) { - if (IsLazy(descriptor->field(field_idx), options, scc_analyzer)) { - return true; - } - } - for (int idx = 0; idx < descriptor->extension_count(); idx++) { - if (IsLazy(descriptor->extension(idx), options, scc_analyzer)) { - return true; - } - } - for (int idx = 0; idx < descriptor->nested_type_count(); idx++) { - if (HasLazyFields(descriptor->nested_type(idx), options, scc_analyzer)) { - return true; - } - } - return false; -} - -// Does the given FileDescriptor use lazy fields? -bool HasLazyFields(const FileDescriptor* file, const Options& options, - MessageSCCAnalyzer* scc_analyzer) { - for (int i = 0; i < file->message_type_count(); i++) { - const Descriptor* descriptor(file->message_type(i)); - if (HasLazyFields(descriptor, options, scc_analyzer)) { - return true; - } - } - for (int field_idx = 0; field_idx < file->extension_count(); field_idx++) { - if (IsLazy(file->extension(field_idx), options, scc_analyzer)) { - return true; - } - } - return false; -} - -static bool HasRepeatedFields(const Descriptor* descriptor) { - for (int i = 0; i < descriptor->field_count(); ++i) { - if (descriptor->field(i)->label() == FieldDescriptor::LABEL_REPEATED) { - return true; - } - } - for (int i = 0; i < descriptor->nested_type_count(); ++i) { - if (HasRepeatedFields(descriptor->nested_type(i))) return true; - } - return false; -} - -bool HasRepeatedFields(const FileDescriptor* file) { - for (int i = 0; i < file->message_type_count(); ++i) { - if (HasRepeatedFields(file->message_type(i))) return true; - } - return false; -} - -static bool IsStringPieceField(const FieldDescriptor* field, - const Options& options) { - return field->cpp_type() == FieldDescriptor::CPPTYPE_STRING && - EffectiveStringCType(field, options) == FieldOptions::STRING_PIECE; -} - -static bool HasStringPieceFields(const Descriptor* descriptor, - const Options& options) { - for (int i = 0; i < descriptor->field_count(); ++i) { - if (IsStringPieceField(descriptor->field(i), options)) return true; - } - for (int i = 0; i < descriptor->nested_type_count(); ++i) { - if (HasStringPieceFields(descriptor->nested_type(i), options)) return true; - } - return false; -} - -bool HasStringPieceFields(const FileDescriptor* file, const Options& options) { - for (int i = 0; i < file->message_type_count(); ++i) { - if (HasStringPieceFields(file->message_type(i), options)) return true; - } - return false; -} - -static bool IsCordField(const FieldDescriptor* field, const Options& options) { - return field->cpp_type() == FieldDescriptor::CPPTYPE_STRING && - EffectiveStringCType(field, options) == FieldOptions::CORD; -} - -static bool HasCordFields(const Descriptor* descriptor, - const Options& options) { - for (int i = 0; i < descriptor->field_count(); ++i) { - if (IsCordField(descriptor->field(i), options)) return true; - } - for (int i = 0; i < descriptor->nested_type_count(); ++i) { - if (HasCordFields(descriptor->nested_type(i), options)) return true; - } - return false; -} - -bool HasCordFields(const FileDescriptor* file, const Options& options) { - for (int i = 0; i < file->message_type_count(); ++i) { - if (HasCordFields(file->message_type(i), options)) return true; - } - return false; -} - -static bool HasExtensionsOrExtendableMessage(const Descriptor* descriptor) { - if (descriptor->extension_range_count() > 0) return true; - if (descriptor->extension_count() > 0) return true; - for (int i = 0; i < descriptor->nested_type_count(); ++i) { - if (HasExtensionsOrExtendableMessage(descriptor->nested_type(i))) { - return true; - } - } - return false; -} - -bool HasExtensionsOrExtendableMessage(const FileDescriptor* file) { - if (file->extension_count() > 0) return true; - for (int i = 0; i < file->message_type_count(); ++i) { - if (HasExtensionsOrExtendableMessage(file->message_type(i))) return true; - } - return false; -} - -static bool HasMapFields(const Descriptor* descriptor) { - for (int i = 0; i < descriptor->field_count(); ++i) { - if (descriptor->field(i)->is_map()) { - return true; - } - } - for (int i = 0; i < descriptor->nested_type_count(); ++i) { - if (HasMapFields(descriptor->nested_type(i))) return true; - } - return false; -} - -bool HasMapFields(const FileDescriptor* file) { - for (int i = 0; i < file->message_type_count(); ++i) { - if (HasMapFields(file->message_type(i))) return true; - } - return false; -} - -static bool HasEnumDefinitions(const Descriptor* message_type) { - if (message_type->enum_type_count() > 0) return true; - for (int i = 0; i < message_type->nested_type_count(); ++i) { - if (HasEnumDefinitions(message_type->nested_type(i))) return true; - } - return false; -} - -bool HasEnumDefinitions(const FileDescriptor* file) { - if (file->enum_type_count() > 0) return true; - for (int i = 0; i < file->message_type_count(); ++i) { - if (HasEnumDefinitions(file->message_type(i))) return true; - } - return false; -} - -bool ShouldVerify(const Descriptor* descriptor, const Options& options, - MessageSCCAnalyzer* scc_analyzer) { - (void)descriptor; - (void)options; - (void)scc_analyzer; - return false; -} - -bool ShouldVerify(const FileDescriptor* file, const Options& options, - MessageSCCAnalyzer* scc_analyzer) { - (void)file; - (void)options; - (void)scc_analyzer; - return false; -} - -bool IsStringOrMessage(const FieldDescriptor* field) { - switch (field->cpp_type()) { - case FieldDescriptor::CPPTYPE_INT32: - case FieldDescriptor::CPPTYPE_INT64: - case FieldDescriptor::CPPTYPE_UINT32: - case FieldDescriptor::CPPTYPE_UINT64: - case FieldDescriptor::CPPTYPE_DOUBLE: - case FieldDescriptor::CPPTYPE_FLOAT: - case FieldDescriptor::CPPTYPE_BOOL: - case FieldDescriptor::CPPTYPE_ENUM: - return false; - case FieldDescriptor::CPPTYPE_STRING: - case FieldDescriptor::CPPTYPE_MESSAGE: - return true; - } - - GOOGLE_LOG(FATAL) << "Can't get here."; - return false; -} - -FieldOptions::CType EffectiveStringCType(const FieldDescriptor* field, - const Options& options) { - GOOGLE_DCHECK(field->cpp_type() == FieldDescriptor::CPPTYPE_STRING); - if (options.opensource_runtime) { - // Open-source protobuf release only supports STRING ctype. - return FieldOptions::STRING; - } else { - // Google-internal supports all ctypes. - return field->options().ctype(); - } -} - -bool IsAnyMessage(const FileDescriptor* descriptor, const Options& options) { - return descriptor->name() == kAnyProtoFile; -} - -bool IsAnyMessage(const Descriptor* descriptor, const Options& options) { - return descriptor->name() == kAnyMessageName && - IsAnyMessage(descriptor->file(), options); -} - -bool IsWellKnownMessage(const FileDescriptor* file) { - static const std::unordered_set well_known_files{ - "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", - }; - return well_known_files.find(file->name()) != well_known_files.end(); -} - -static bool FieldEnforceUtf8(const FieldDescriptor* field, - const Options& options) { - return true; -} - -static bool FileUtf8Verification(const FileDescriptor* file, - const Options& options) { - return true; -} - -// Which level of UTF-8 enforcemant is placed on this file. -Utf8CheckMode GetUtf8CheckMode(const FieldDescriptor* field, - const Options& options) { - if (field->file()->syntax() == FileDescriptor::SYNTAX_PROTO3 && - FieldEnforceUtf8(field, options)) { - return Utf8CheckMode::kStrict; - } else if (GetOptimizeFor(field->file(), options) != - FileOptions::LITE_RUNTIME && - FileUtf8Verification(field->file(), options)) { - return Utf8CheckMode::kVerify; - } else { - return Utf8CheckMode::kNone; - } -} - -static void GenerateUtf8CheckCode(const FieldDescriptor* field, - const Options& options, bool for_parse, - const char* parameters, - const char* strict_function, - const char* verify_function, - const Formatter& format) { - switch (GetUtf8CheckMode(field, options)) { - case Utf8CheckMode::kStrict: { - if (for_parse) { - format("DO_("); - } - format("::$proto_ns$::internal::WireFormatLite::$1$(\n", strict_function); - format.Indent(); - format(parameters); - if (for_parse) { - format("::$proto_ns$::internal::WireFormatLite::PARSE,\n"); - } else { - format("::$proto_ns$::internal::WireFormatLite::SERIALIZE,\n"); - } - format("\"$1$\")", field->full_name()); - if (for_parse) { - format(")"); - } - format(";\n"); - format.Outdent(); - break; - } - case Utf8CheckMode::kVerify: { - format("::$proto_ns$::internal::WireFormat::$1$(\n", verify_function); - format.Indent(); - format(parameters); - if (for_parse) { - format("::$proto_ns$::internal::WireFormat::PARSE,\n"); - } else { - format("::$proto_ns$::internal::WireFormat::SERIALIZE,\n"); - } - format("\"$1$\");\n", field->full_name()); - format.Outdent(); - break; - } - case Utf8CheckMode::kNone: - break; - } -} - -void GenerateUtf8CheckCodeForString(const FieldDescriptor* field, - const Options& options, bool for_parse, - const char* parameters, - const Formatter& format) { - GenerateUtf8CheckCode(field, options, for_parse, parameters, - "VerifyUtf8String", "VerifyUTF8StringNamedField", - format); -} - -void GenerateUtf8CheckCodeForCord(const FieldDescriptor* field, - const Options& options, bool for_parse, - const char* parameters, - const Formatter& format) { - GenerateUtf8CheckCode(field, options, for_parse, parameters, "VerifyUtf8Cord", - "VerifyUTF8CordNamedField", format); -} - -void FlattenMessagesInFile(const FileDescriptor* file, - std::vector* result) { - for (int i = 0; i < file->message_type_count(); i++) { - ForEachMessage(file->message_type(i), [&](const Descriptor* descriptor) { - result->push_back(descriptor); - }); - } -} - -bool HasWeakFields(const Descriptor* descriptor, const Options& options) { - for (int i = 0; i < descriptor->field_count(); i++) { - if (IsWeak(descriptor->field(i), options)) return true; - } - return false; -} - -bool HasWeakFields(const FileDescriptor* file, const Options& options) { - for (int i = 0; i < file->message_type_count(); ++i) { - if (HasWeakFields(file->message_type(i), options)) return true; - } - return false; -} - -bool UsingImplicitWeakFields(const FileDescriptor* file, - const Options& options) { - return options.lite_implicit_weak_fields && - GetOptimizeFor(file, options) == FileOptions::LITE_RUNTIME; -} - -bool IsImplicitWeakField(const FieldDescriptor* field, const Options& options, - MessageSCCAnalyzer* scc_analyzer) { - return UsingImplicitWeakFields(field->file(), options) && - field->type() == FieldDescriptor::TYPE_MESSAGE && - !field->is_required() && !field->is_map() && !field->is_extension() && - !field->real_containing_oneof() && - !IsWellKnownMessage(field->message_type()->file()) && - field->message_type()->file()->name() != - "net/proto2/proto/descriptor.proto" && - // We do not support implicit weak fields between messages in the same - // strongly-connected component. - scc_analyzer->GetSCC(field->containing_type()) != - scc_analyzer->GetSCC(field->message_type()); -} - -MessageAnalysis MessageSCCAnalyzer::GetSCCAnalysis(const SCC* scc) { - if (analysis_cache_.count(scc)) return analysis_cache_[scc]; - MessageAnalysis result; - if (UsingImplicitWeakFields(scc->GetFile(), options_)) { - result.contains_weak = true; - } - for (int i = 0; i < scc->descriptors.size(); i++) { - const Descriptor* descriptor = scc->descriptors[i]; - if (descriptor->extension_range_count() > 0) { - result.contains_extension = true; - } - for (int j = 0; j < descriptor->field_count(); j++) { - const FieldDescriptor* field = descriptor->field(j); - if (field->is_required()) { - result.contains_required = true; - } - if (field->options().weak()) { - result.contains_weak = true; - } - switch (field->type()) { - case FieldDescriptor::TYPE_STRING: - case FieldDescriptor::TYPE_BYTES: { - if (field->options().ctype() == FieldOptions::CORD) { - result.contains_cord = true; - } - break; - } - case FieldDescriptor::TYPE_GROUP: - case FieldDescriptor::TYPE_MESSAGE: { - const SCC* child = analyzer_.GetSCC(field->message_type()); - if (child != scc) { - MessageAnalysis analysis = GetSCCAnalysis(child); - result.contains_cord |= analysis.contains_cord; - result.contains_extension |= analysis.contains_extension; - if (!ShouldIgnoreRequiredFieldCheck(field, options_)) { - result.contains_required |= analysis.contains_required; - } - result.contains_weak |= analysis.contains_weak; - } else { - // This field points back into the same SCC hence the messages - // in the SCC are recursive. Note if SCC contains more than two - // nodes it has to be recursive, however this test also works for - // a single node that is recursive. - result.is_recursive = true; - } - break; - } - default: - break; - } - } - } - // We deliberately only insert the result here. After we contracted the SCC - // in the graph, the graph should be a DAG. Hence we shouldn't need to mark - // nodes visited as we can never return to them. By inserting them here - // we will go in an infinite loop if the SCC is not correct. - return analysis_cache_[scc] = result; -} - -void ListAllFields(const Descriptor* d, - std::vector* fields) { - // Collect sub messages - for (int i = 0; i < d->nested_type_count(); i++) { - ListAllFields(d->nested_type(i), fields); - } - // Collect message level extensions. - for (int i = 0; i < d->extension_count(); i++) { - fields->push_back(d->extension(i)); - } - // Add types of fields necessary - for (int i = 0; i < d->field_count(); i++) { - fields->push_back(d->field(i)); - } -} - -void ListAllFields(const FileDescriptor* d, - std::vector* fields) { - // Collect file level message. - for (int i = 0; i < d->message_type_count(); i++) { - ListAllFields(d->message_type(i), fields); - } - // Collect message level extensions. - for (int i = 0; i < d->extension_count(); i++) { - fields->push_back(d->extension(i)); - } -} - -void ListAllTypesForServices(const FileDescriptor* fd, - std::vector* types) { - for (int i = 0; i < fd->service_count(); i++) { - const ServiceDescriptor* sd = fd->service(i); - for (int j = 0; j < sd->method_count(); j++) { - const MethodDescriptor* method = sd->method(j); - types->push_back(method->input_type()); - types->push_back(method->output_type()); - } - } -} - -bool GetBootstrapBasename(const Options& options, const std::string& basename, - std::string* bootstrap_basename) { - if (options.opensource_runtime) { - return false; - } - - std::unordered_map bootstrap_mapping{ - {"net/proto2/proto/descriptor", - "net/proto2/internal/descriptor"}, - {"net/proto2/compiler/proto/plugin", - "net/proto2/compiler/proto/plugin"}, - {"net/proto2/compiler/proto/profile", - "net/proto2/compiler/proto/profile_bootstrap"}, - }; - auto iter = bootstrap_mapping.find(basename); - if (iter == bootstrap_mapping.end()) { - *bootstrap_basename = basename; - return false; - } else { - *bootstrap_basename = iter->second; - return true; - } -} - -bool IsBootstrapProto(const Options& options, const FileDescriptor* file) { - std::string my_name = StripProto(file->name()); - return GetBootstrapBasename(options, my_name, &my_name); -} - -bool MaybeBootstrap(const Options& options, GeneratorContext* generator_context, - bool bootstrap_flag, std::string* basename) { - std::string bootstrap_basename; - if (!GetBootstrapBasename(options, *basename, &bootstrap_basename)) { - return false; - } - - if (bootstrap_flag) { - // Adjust basename, but don't abort code generation. - *basename = bootstrap_basename; - return false; - } else { - std::string forward_to_basename = bootstrap_basename; - - // Generate forwarding headers and empty .pb.cc. - { - std::unique_ptr output( - generator_context->Open(*basename + ".pb.h")); - io::Printer printer(output.get(), '$', nullptr); - printer.Print( - "#ifndef PROTOBUF_INCLUDED_$filename_identifier$_FORWARD_PB_H\n" - "#define PROTOBUF_INCLUDED_$filename_identifier$_FORWARD_PB_H\n" - "#include \"$forward_to_basename$.pb.h\" // IWYU pragma: export\n" - "#endif // PROTOBUF_INCLUDED_$filename_identifier$_FORWARD_PB_H\n", - "forward_to_basename", forward_to_basename, "filename_identifier", - FilenameIdentifier(*basename)); - - if (!options.opensource_runtime) { - // HACK HACK HACK, tech debt from the deeps of proto1 and SWIG - // protocoltype is SWIG'ed and we need to forward - if (*basename == "net/proto/protocoltype") { - printer.Print( - "#ifdef SWIG\n" - "%include \"$forward_to_basename$.pb.h\"\n" - "#endif // SWIG\n", - "forward_to_basename", forward_to_basename); - } - } - } - - { - std::unique_ptr output( - generator_context->Open(*basename + ".proto.h")); - io::Printer printer(output.get(), '$', nullptr); - printer.Print( - "#ifndef PROTOBUF_INCLUDED_$filename_identifier$_FORWARD_PROTO_H\n" - "#define PROTOBUF_INCLUDED_$filename_identifier$_FORWARD_PROTO_H\n" - "#include \"$forward_to_basename$.proto.h\" // IWYU pragma: " - "export\n" - "#endif // " - "PROTOBUF_INCLUDED_$filename_identifier$_FORWARD_PROTO_H\n", - "forward_to_basename", forward_to_basename, "filename_identifier", - FilenameIdentifier(*basename)); - } - - { - std::unique_ptr output( - generator_context->Open(*basename + ".pb.cc")); - io::Printer printer(output.get(), '$', nullptr); - printer.Print("\n"); - } - - { - std::unique_ptr output( - generator_context->Open(*basename + ".pb.h.meta")); - } - - { - std::unique_ptr output( - generator_context->Open(*basename + ".proto.h.meta")); - } - - // Abort code generation. - return true; - } -} - -static bool HasExtensionFromFile(const Message& msg, const FileDescriptor* file, - const Options& options, - bool* has_opt_codesize_extension) { - std::vector fields; - auto reflection = msg.GetReflection(); - reflection->ListFields(msg, &fields); - for (auto field : fields) { - const auto* field_msg = field->message_type(); - if (field_msg == nullptr) { - // It so happens that enums Is_Valid are still generated so enums work. - // Only messages have potential problems. - continue; - } - // If this option has an extension set AND that extension is defined in the - // same file we have bootstrap problem. - if (field->is_extension()) { - const auto* msg_extension_file = field->message_type()->file(); - if (msg_extension_file == file) return true; - if (has_opt_codesize_extension && - GetOptimizeFor(msg_extension_file, options) == - FileOptions::CODE_SIZE) { - *has_opt_codesize_extension = true; - } - } - // Recurse in this field to see if there is a problem in there - if (field->is_repeated()) { - for (int i = 0; i < reflection->FieldSize(msg, field); i++) { - if (HasExtensionFromFile(reflection->GetRepeatedMessage(msg, field, i), - file, options, has_opt_codesize_extension)) { - return true; - } - } - } else { - if (HasExtensionFromFile(reflection->GetMessage(msg, field), file, - options, has_opt_codesize_extension)) { - return true; - } - } - } - return false; -} - -static bool HasBootstrapProblem(const FileDescriptor* file, - const Options& options, - bool* has_opt_codesize_extension) { - static auto& cache = *new std::unordered_map; - auto it = cache.find(file); - if (it != cache.end()) return it->second; - // In order to build the data structures for the reflective parse, it needs - // to parse the serialized descriptor describing all the messages defined in - // this file. Obviously this presents a bootstrap problem for descriptor - // messages. - if (file->name() == "net/proto2/proto/descriptor.proto" || - file->name() == "google/protobuf/descriptor.proto") { - return true; - } - // Unfortunately we're not done yet. The descriptor option messages allow - // for extensions. So we need to be able to parse these extensions in order - // to parse the file descriptor for a file that has custom options. This is a - // problem when these custom options extensions are defined in the same file. - FileDescriptorProto linkedin_fd_proto; - const DescriptorPool* pool = file->pool(); - const Descriptor* fd_proto_descriptor = - pool->FindMessageTypeByName(linkedin_fd_proto.GetTypeName()); - // Not all pools have descriptor.proto in them. In these cases there for sure - // are no custom options. - if (fd_proto_descriptor == nullptr) return false; - - // It's easier to inspect file as a proto, because we can use reflection on - // the proto to iterate over all content. - file->CopyTo(&linkedin_fd_proto); - - // linkedin_fd_proto is a generated proto linked in the proto compiler. As - // such it doesn't know the extensions that are potentially present in the - // descriptor pool constructed from the protos that are being compiled. These - // custom options are therefore in the unknown fields. - // By building the corresponding FileDescriptorProto in the pool constructed - // by the protos that are being compiled, ie. file's pool, the unknown fields - // are converted to extensions. - DynamicMessageFactory factory(pool); - Message* fd_proto = factory.GetPrototype(fd_proto_descriptor)->New(); - fd_proto->ParseFromString(linkedin_fd_proto.SerializeAsString()); - - bool& res = cache[file]; - res = HasExtensionFromFile(*fd_proto, file, options, - has_opt_codesize_extension); - delete fd_proto; - return res; -} - -FileOptions_OptimizeMode GetOptimizeFor(const FileDescriptor* file, - const Options& options, - bool* has_opt_codesize_extension) { - if (has_opt_codesize_extension) *has_opt_codesize_extension = false; - switch (options.enforce_mode) { - case EnforceOptimizeMode::kSpeed: - return FileOptions::SPEED; - case EnforceOptimizeMode::kLiteRuntime: - return FileOptions::LITE_RUNTIME; - case EnforceOptimizeMode::kCodeSize: - if (file->options().optimize_for() == FileOptions::LITE_RUNTIME) { - return FileOptions::LITE_RUNTIME; - } - if (HasBootstrapProblem(file, options, has_opt_codesize_extension)) { - return FileOptions::SPEED; - } - return FileOptions::CODE_SIZE; - case EnforceOptimizeMode::kNoEnforcement: - if (file->options().optimize_for() == FileOptions::CODE_SIZE) { - if (HasBootstrapProblem(file, options, has_opt_codesize_extension)) { - GOOGLE_LOG(WARNING) << "Proto states optimize_for = CODE_SIZE, but we " - "cannot honor that because it contains custom option " - "extensions defined in the same proto."; - return FileOptions::SPEED; - } - } - return file->options().optimize_for(); - } - - GOOGLE_LOG(FATAL) << "Unknown optimization enforcement requested."; - // The phony return below serves to silence a warning from GCC 8. - return FileOptions::SPEED; -} - -bool EnableMessageOwnedArena(const Descriptor* desc) { - (void)desc; - return false; -} - -} // namespace cpp -} // namespace compiler -} // namespace protobuf -} // namespace google diff --git a/extra/protobuf/protobuf-3.19.4/src/google/protobuf/compiler/cpp/cpp_helpers.h b/extra/protobuf/protobuf-3.19.4/src/google/protobuf/compiler/cpp/cpp_helpers.h deleted file mode 100644 index bd4f48bc8ed1..000000000000 --- a/extra/protobuf/protobuf-3.19.4/src/google/protobuf/compiler/cpp/cpp_helpers.h +++ /dev/null @@ -1,971 +0,0 @@ -// Protocol Buffers - Google's data interchange format -// Copyright 2008 Google Inc. All rights reserved. -// https://developers.google.com/protocol-buffers/ -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// * Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// * Redistributions in binary form must reproduce the above -// copyright notice, this list of conditions and the following disclaimer -// in the documentation and/or other materials provided with the -// distribution. -// * Neither the name of Google Inc. nor the names of its -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -// Author: kenton@google.com (Kenton Varda) -// Based on original Protocol Buffers design by -// Sanjay Ghemawat, Jeff Dean, and others. - -#ifndef GOOGLE_PROTOBUF_COMPILER_CPP_HELPERS_H__ -#define GOOGLE_PROTOBUF_COMPILER_CPP_HELPERS_H__ - -#include -#include -#include -#include -#include - -#include -#include -#include -#include -#include -#include -#include -#include -#include - -// Must be included last. -#include - -namespace google { -namespace protobuf { -namespace compiler { -namespace cpp { - -inline std::string ProtobufNamespace(const Options& /* options */) { - return "PROTOBUF_NAMESPACE_ID"; -} - -inline std::string MacroPrefix(const Options& /* options */) { - return "GOOGLE_PROTOBUF"; -} - -inline std::string DeprecatedAttribute(const Options& /* options */, - const FieldDescriptor* d) { - return d->options().deprecated() ? "PROTOBUF_DEPRECATED " : ""; -} - -inline std::string DeprecatedAttribute(const Options& /* options */, - const EnumValueDescriptor* d) { - return d->options().deprecated() ? "PROTOBUF_DEPRECATED_ENUM " : ""; -} - -// Commonly-used separator comments. Thick is a line of '=', thin is a line -// of '-'. -extern const char kThickSeparator[]; -extern const char kThinSeparator[]; - -void SetCommonVars(const Options& options, - std::map* variables); - -void SetUnknownFieldsVariable(const Descriptor* descriptor, - const Options& options, - std::map* variables); - -bool GetBootstrapBasename(const Options& options, const std::string& basename, - std::string* bootstrap_basename); -bool MaybeBootstrap(const Options& options, GeneratorContext* generator_context, - bool bootstrap_flag, std::string* basename); -bool IsBootstrapProto(const Options& options, const FileDescriptor* file); - -// Name space of the proto file. This namespace is such that the string -// "::some_name" is the correct fully qualified namespace. -// This means if the package is empty the namespace is "", and otherwise -// the namespace is "::foo::bar::...::baz" without trailing semi-colons. -std::string Namespace(const FileDescriptor* d, const Options& options); -std::string Namespace(const Descriptor* d, const Options& options); -std::string Namespace(const FieldDescriptor* d, const Options& options); -std::string Namespace(const EnumDescriptor* d, const Options& options); - -// Returns true if it's safe to reset "field" to zero. -bool CanInitializeByZeroing(const FieldDescriptor* field); - -std::string ClassName(const Descriptor* descriptor); -std::string ClassName(const EnumDescriptor* enum_descriptor); - -std::string QualifiedClassName(const Descriptor* d, const Options& options); -std::string QualifiedClassName(const EnumDescriptor* d, const Options& options); - -std::string QualifiedClassName(const Descriptor* d); -std::string QualifiedClassName(const EnumDescriptor* d); - -// DEPRECATED just use ClassName or QualifiedClassName, a boolean is very -// unreadable at the callsite. -// Returns the non-nested type name for the given type. If "qualified" is -// true, prefix the type with the full namespace. For example, if you had: -// package foo.bar; -// message Baz { message Qux {} } -// Then the qualified ClassName for Qux would be: -// ::foo::bar::Baz_Qux -// While the non-qualified version would be: -// Baz_Qux -inline std::string ClassName(const Descriptor* descriptor, bool qualified) { - return qualified ? QualifiedClassName(descriptor, Options()) - : ClassName(descriptor); -} - -inline std::string ClassName(const EnumDescriptor* descriptor, bool qualified) { - return qualified ? QualifiedClassName(descriptor, Options()) - : ClassName(descriptor); -} - -// Returns the extension name prefixed with the class name if nested but without -// the package name. -std::string ExtensionName(const FieldDescriptor* d); - -std::string QualifiedExtensionName(const FieldDescriptor* d, - const Options& options); -std::string QualifiedExtensionName(const FieldDescriptor* d); - -// Type name of default instance. -std::string DefaultInstanceType(const Descriptor* descriptor, - const Options& options); - -// Non-qualified name of the default_instance of this message. -std::string DefaultInstanceName(const Descriptor* descriptor, - const Options& options); - -// Non-qualified name of the default instance pointer. This is used only for -// implicit weak fields, where we need an extra indirection. -std::string DefaultInstancePtr(const Descriptor* descriptor, - const Options& options); - -// Fully qualified name of the default_instance of this message. -std::string QualifiedDefaultInstanceName(const Descriptor* descriptor, - const Options& options); - -// Fully qualified name of the default instance pointer. -std::string QualifiedDefaultInstancePtr(const Descriptor* descriptor, - const Options& options); - -// DescriptorTable variable name. -std::string DescriptorTableName(const FileDescriptor* file, - const Options& options); - -// When declaring symbol externs from another file, this macro will supply the -// dllexport needed for the target file, if any. -std::string FileDllExport(const FileDescriptor* file, const Options& options); - -// Name of the base class: google::protobuf::Message or google::protobuf::MessageLite. -std::string SuperClassName(const Descriptor* descriptor, - const Options& options); - -// Adds an underscore if necessary to prevent conflicting with a keyword. -std::string ResolveKeyword(const std::string& name); - -// Get the (unqualified) name that should be used for this field in C++ code. -// The name is coerced to lower-case to emulate proto1 behavior. People -// should be using lowercase-with-underscores style for proto field names -// anyway, so normally this just returns field->name(). -std::string FieldName(const FieldDescriptor* field); - -// Returns an estimate of the compiler's alignment for the field. This -// can't guarantee to be correct because the generated code could be compiled on -// different systems with different alignment rules. The estimates below assume -// 64-bit pointers. -int EstimateAlignmentSize(const FieldDescriptor* field); - -// Get the unqualified name that should be used for a field's field -// number constant. -std::string FieldConstantName(const FieldDescriptor* field); - -// Returns the scope where the field was defined (for extensions, this is -// different from the message type to which the field applies). -inline const Descriptor* FieldScope(const FieldDescriptor* field) { - return field->is_extension() ? field->extension_scope() - : field->containing_type(); -} - -// Returns the fully-qualified type name field->message_type(). Usually this -// is just ClassName(field->message_type(), true); -std::string FieldMessageTypeName(const FieldDescriptor* field, - const Options& options); - -// Get the C++ type name for a primitive type (e.g. "double", "::google::protobuf::int32", etc.). -const char* PrimitiveTypeName(FieldDescriptor::CppType type); -std::string PrimitiveTypeName(const Options& options, - FieldDescriptor::CppType type); - -// Get the declared type name in CamelCase format, as is used e.g. for the -// methods of WireFormat. For example, TYPE_INT32 becomes "Int32". -const char* DeclaredTypeMethodName(FieldDescriptor::Type type); - -// Return the code that evaluates to the number when compiled. -std::string Int32ToString(int number); - -// Get code that evaluates to the field's default value. -std::string DefaultValue(const Options& options, const FieldDescriptor* field); - -// Compatibility function for callers outside proto2. -std::string DefaultValue(const FieldDescriptor* field); - -// Convert a file name into a valid identifier. -std::string FilenameIdentifier(const std::string& filename); - -// For each .proto file generates a unique name. To prevent collisions of -// symbols in the global namespace -std::string UniqueName(const std::string& name, const std::string& filename, - const Options& options); -inline std::string UniqueName(const std::string& name, const FileDescriptor* d, - const Options& options) { - return UniqueName(name, d->name(), options); -} -inline std::string UniqueName(const std::string& name, const Descriptor* d, - const Options& options) { - return UniqueName(name, d->file(), options); -} -inline std::string UniqueName(const std::string& name, const EnumDescriptor* d, - const Options& options) { - return UniqueName(name, d->file(), options); -} -inline std::string UniqueName(const std::string& name, - const ServiceDescriptor* d, - const Options& options) { - return UniqueName(name, d->file(), options); -} - -// Versions for call sites that only support the internal runtime (like proto1 -// support). -inline Options InternalRuntimeOptions() { - Options options; - options.opensource_runtime = false; - return options; -} -inline std::string UniqueName(const std::string& name, - const std::string& filename) { - return UniqueName(name, filename, InternalRuntimeOptions()); -} -inline std::string UniqueName(const std::string& name, - const FileDescriptor* d) { - return UniqueName(name, d->name(), InternalRuntimeOptions()); -} -inline std::string UniqueName(const std::string& name, const Descriptor* d) { - return UniqueName(name, d->file(), InternalRuntimeOptions()); -} -inline std::string UniqueName(const std::string& name, - const EnumDescriptor* d) { - return UniqueName(name, d->file(), InternalRuntimeOptions()); -} -inline std::string UniqueName(const std::string& name, - const ServiceDescriptor* d) { - return UniqueName(name, d->file(), InternalRuntimeOptions()); -} - -// Return the qualified C++ name for a file level symbol. -std::string QualifiedFileLevelSymbol(const FileDescriptor* file, - const std::string& name, - const Options& options); - -// Escape C++ trigraphs by escaping question marks to \? -std::string EscapeTrigraphs(const std::string& to_escape); - -// Escaped function name to eliminate naming conflict. -std::string SafeFunctionName(const Descriptor* descriptor, - const FieldDescriptor* field, - const std::string& prefix); - -// Returns true if generated messages have public unknown fields accessors -inline bool PublicUnknownFieldsAccessors(const Descriptor* message) { - return message->file()->syntax() != FileDescriptor::SYNTAX_PROTO3; -} - -// Returns the optimize mode for , respecting . -FileOptions_OptimizeMode GetOptimizeFor(const FileDescriptor* file, - const Options& options); - -// Determines whether unknown fields will be stored in an UnknownFieldSet or -// a string. -inline bool UseUnknownFieldSet(const FileDescriptor* file, - const Options& options) { - return GetOptimizeFor(file, options) != FileOptions::LITE_RUNTIME; -} - -inline bool IsWeak(const FieldDescriptor* field, const Options& options) { - if (field->options().weak()) { - GOOGLE_CHECK(!options.opensource_runtime); - return true; - } - return false; -} - -bool IsStringInlined(const FieldDescriptor* descriptor, const Options& options); - -// For a string field, returns the effective ctype. If the actual ctype is -// not supported, returns the default of STRING. -FieldOptions::CType EffectiveStringCType(const FieldDescriptor* field, - const Options& options); - -inline bool IsCord(const FieldDescriptor* field, const Options& options) { - return field->cpp_type() == FieldDescriptor::CPPTYPE_STRING && - EffectiveStringCType(field, options) == FieldOptions::CORD; -} - -inline bool IsString(const FieldDescriptor* field, const Options& options) { - return field->cpp_type() == FieldDescriptor::CPPTYPE_STRING && - EffectiveStringCType(field, options) == FieldOptions::STRING; -} - -inline bool IsStringPiece(const FieldDescriptor* field, - const Options& options) { - return field->cpp_type() == FieldDescriptor::CPPTYPE_STRING && - EffectiveStringCType(field, options) == FieldOptions::STRING_PIECE; -} - -class MessageSCCAnalyzer; - -// Does the given FileDescriptor use lazy fields? -bool HasLazyFields(const FileDescriptor* file, const Options& options, - MessageSCCAnalyzer* scc_analyzer); - -// Is the given field a supported lazy field? -bool IsLazy(const FieldDescriptor* field, const Options& options, - MessageSCCAnalyzer* scc_analyzer); - -inline bool IsLazilyVerifiedLazy(const FieldDescriptor* field, - const Options& options) { - return field->options().lazy() && !field->is_repeated() && - field->type() == FieldDescriptor::TYPE_MESSAGE && - GetOptimizeFor(field->file(), options) != FileOptions::LITE_RUNTIME && - !options.opensource_runtime; -} - -inline bool IsEagerlyVerifiedLazy(const FieldDescriptor* field, - const Options& options, - MessageSCCAnalyzer* scc_analyzer) { - return IsLazy(field, options, scc_analyzer) && !field->options().lazy(); -} - -inline bool IsFieldUsed(const FieldDescriptor* /* field */, - const Options& /* options */) { - return true; -} - -// Returns true if "field" is stripped. -inline bool IsFieldStripped(const FieldDescriptor* /*field*/, - const Options& /*options*/) { - return false; -} - -// Does the file contain any definitions that need extension_set.h? -bool HasExtensionsOrExtendableMessage(const FileDescriptor* file); - -// Does the file have any repeated fields, necessitating the file to include -// repeated_field.h? This does not include repeated extensions, since those are -// all stored internally in an ExtensionSet, not a separate RepeatedField*. -bool HasRepeatedFields(const FileDescriptor* file); - -// Does the file have any string/bytes fields with ctype=STRING_PIECE? This -// does not include extensions, since ctype is ignored for extensions. -bool HasStringPieceFields(const FileDescriptor* file, const Options& options); - -// Does the file have any string/bytes fields with ctype=CORD? This does not -// include extensions, since ctype is ignored for extensions. -bool HasCordFields(const FileDescriptor* file, const Options& options); - -// Does the file have any map fields, necessitating the file to include -// map_field_inl.h and map.h. -bool HasMapFields(const FileDescriptor* file); - -// Does this file have any enum type definitions? -bool HasEnumDefinitions(const FileDescriptor* file); - -// Does this file have generated parsing, serialization, and other -// standard methods for which reflection-based fallback implementations exist? -inline bool HasGeneratedMethods(const FileDescriptor* file, - const Options& options) { - return GetOptimizeFor(file, options) != FileOptions::CODE_SIZE; -} - -// Do message classes in this file have descriptor and reflection methods? -inline bool HasDescriptorMethods(const FileDescriptor* file, - const Options& options) { - return GetOptimizeFor(file, options) != FileOptions::LITE_RUNTIME; -} - -// Should we generate generic services for this file? -inline bool HasGenericServices(const FileDescriptor* file, - const Options& options) { - return file->service_count() > 0 && - GetOptimizeFor(file, options) != FileOptions::LITE_RUNTIME && - file->options().cc_generic_services(); -} - -inline bool IsProto2MessageSet(const Descriptor* descriptor, - const Options& options) { - return !options.opensource_runtime && - options.enforce_mode != EnforceOptimizeMode::kLiteRuntime && - !options.lite_implicit_weak_fields && - descriptor->options().message_set_wire_format() && - descriptor->full_name() == "google.protobuf.bridge.MessageSet"; -} - -inline bool IsMapEntryMessage(const Descriptor* descriptor) { - return descriptor->options().map_entry(); -} - -// Returns true if the field's CPPTYPE is string or message. -bool IsStringOrMessage(const FieldDescriptor* field); - -std::string UnderscoresToCamelCase(const std::string& input, - bool cap_next_letter); - -inline bool IsProto3(const FileDescriptor* file) { - return file->syntax() == FileDescriptor::SYNTAX_PROTO3; -} - -inline bool HasHasbit(const FieldDescriptor* field) { - // This predicate includes proto3 message fields only if they have "optional". - // Foo submsg1 = 1; // HasHasbit() == false - // optional Foo submsg2 = 2; // HasHasbit() == true - // This is slightly odd, as adding "optional" to a singular proto3 field does - // not change the semantics or API. However whenever any field in a message - // has a hasbit, it forces reflection to include hasbit offsets for *all* - // fields, even if almost all of them are set to -1 (no hasbit). So to avoid - // causing a sudden size regression for ~all proto3 messages, we give proto3 - // message fields a hasbit only if "optional" is present. If the user is - // explicitly writing "optional", it is likely they are writing it on - // primitive fields also. - return (field->has_optional_keyword() || field->is_required()) && - !field->options().weak(); -} - -// Returns true if 'enum' semantics are such that unknown values are preserved -// in the enum field itself, rather than going to the UnknownFieldSet. -inline bool HasPreservingUnknownEnumSemantics(const FieldDescriptor* field) { - return field->file()->syntax() == FileDescriptor::SYNTAX_PROTO3; -} - -inline bool IsCrossFileMessage(const FieldDescriptor* field) { - return field->type() == FieldDescriptor::TYPE_MESSAGE && - field->message_type()->file() != field->file(); -} - -inline std::string MakeDefaultName(const FieldDescriptor* field) { - return "_i_give_permission_to_break_this_code_default_" + FieldName(field) + - "_"; -} - -bool IsAnyMessage(const FileDescriptor* descriptor, const Options& options); -bool IsAnyMessage(const Descriptor* descriptor, const Options& options); - -bool IsWellKnownMessage(const FileDescriptor* descriptor); - -inline std::string IncludeGuard(const FileDescriptor* file, bool pb_h, - const Options& options) { - // If we are generating a .pb.h file and the proto_h option is enabled, then - // the .pb.h gets an extra suffix. - std::string filename_identifier = FilenameIdentifier( - file->name() + (pb_h && options.proto_h ? ".pb.h" : "")); - - if (IsWellKnownMessage(file)) { - // For well-known messages we need third_party/protobuf and net/proto2 to - // have distinct include guards, because some source files include both and - // both need to be defined (the third_party copies will be in the - // google::protobuf_opensource namespace). - return MacroPrefix(options) + "_INCLUDED_" + filename_identifier; - } else { - // Ideally this case would use distinct include guards for opensource and - // google3 protos also. (The behavior of "first #included wins" is not - // ideal). But unfortunately some legacy code includes both and depends on - // the identical include guards to avoid compile errors. - // - // We should clean this up so that this case can be removed. - return "GOOGLE_PROTOBUF_INCLUDED_" + filename_identifier; - } -} - -// Returns the OptimizeMode for this file, furthermore it updates a status -// bool if has_opt_codesize_extension is non-null. If this status bool is true -// it means this file contains an extension that itself is defined as -// optimized_for = CODE_SIZE. -FileOptions_OptimizeMode GetOptimizeFor(const FileDescriptor* file, - const Options& options, - bool* has_opt_codesize_extension); -inline FileOptions_OptimizeMode GetOptimizeFor(const FileDescriptor* file, - const Options& options) { - return GetOptimizeFor(file, options, nullptr); -} -inline bool NeedsEagerDescriptorAssignment(const FileDescriptor* file, - const Options& options) { - bool has_opt_codesize_extension; - if (GetOptimizeFor(file, options, &has_opt_codesize_extension) == - FileOptions::CODE_SIZE && - has_opt_codesize_extension) { - // If this filedescriptor contains an extension from another file which - // is optimized_for = CODE_SIZE. We need to be careful in the ordering so - // we eagerly build the descriptors in the dependencies before building - // the descriptors of this file. - return true; - } else { - // If we have a generated code based parser we never need eager - // initialization of descriptors of our deps. - return false; - } -} - -// This orders the messages in a .pb.cc as it's outputted by file.cc -void FlattenMessagesInFile(const FileDescriptor* file, - std::vector* result); -inline std::vector FlattenMessagesInFile( - const FileDescriptor* file) { - std::vector result; - FlattenMessagesInFile(file, &result); - return result; -} - -template -void ForEachMessage(const Descriptor* descriptor, F&& func) { - for (int i = 0; i < descriptor->nested_type_count(); i++) - ForEachMessage(descriptor->nested_type(i), std::forward(func)); - func(descriptor); -} - -template -void ForEachMessage(const FileDescriptor* descriptor, F&& func) { - for (int i = 0; i < descriptor->message_type_count(); i++) - ForEachMessage(descriptor->message_type(i), std::forward(func)); -} - -bool HasWeakFields(const Descriptor* desc, const Options& options); -bool HasWeakFields(const FileDescriptor* desc, const Options& options); - -// Returns true if the "required" restriction check should be ignored for the -// given field. -inline static bool ShouldIgnoreRequiredFieldCheck(const FieldDescriptor* field, - const Options& options) { - // Do not check "required" for lazily verified lazy fields. - return IsLazilyVerifiedLazy(field, options); -} - -struct MessageAnalysis { - bool is_recursive = false; - bool contains_cord = false; - bool contains_extension = false; - bool contains_required = false; - bool contains_weak = false; // Implicit weak as well. -}; - -// This class is used in FileGenerator, to ensure linear instead of -// quadratic performance, if we do this per message we would get O(V*(V+E)). -// Logically this is just only used in message.cc, but in the header for -// FileGenerator to help share it. -class PROTOC_EXPORT MessageSCCAnalyzer { - public: - explicit MessageSCCAnalyzer(const Options& options) : options_(options) {} - - MessageAnalysis GetSCCAnalysis(const SCC* scc); - - bool HasRequiredFields(const Descriptor* descriptor) { - MessageAnalysis result = GetSCCAnalysis(GetSCC(descriptor)); - return result.contains_required || result.contains_extension; - } - bool HasWeakField(const Descriptor* descriptor) { - MessageAnalysis result = GetSCCAnalysis(GetSCC(descriptor)); - return result.contains_weak; - } - const SCC* GetSCC(const Descriptor* descriptor) { - return analyzer_.GetSCC(descriptor); - } - - private: - struct DepsGenerator { - std::vector operator()(const Descriptor* desc) const { - std::vector deps; - for (int i = 0; i < desc->field_count(); i++) { - if (desc->field(i)->message_type()) { - deps.push_back(desc->field(i)->message_type()); - } - } - return deps; - } - }; - SCCAnalyzer analyzer_; - Options options_; - std::map analysis_cache_; -}; - -void ListAllFields(const Descriptor* d, - std::vector* fields); -void ListAllFields(const FileDescriptor* d, - std::vector* fields); - -template -void ForEachField(const Descriptor* d, T&& func) { - for (int i = 0; i < d->nested_type_count(); i++) { - ForEachField(d->nested_type(i), std::forward(func)); - } - for (int i = 0; i < d->extension_count(); i++) { - func(d->extension(i)); - } - for (int i = 0; i < d->field_count(); i++) { - func(d->field(i)); - } -} - -template -void ForEachField(const FileDescriptor* d, T&& func) { - for (int i = 0; i < d->message_type_count(); i++) { - ForEachField(d->message_type(i), std::forward(func)); - } - for (int i = 0; i < d->extension_count(); i++) { - func(d->extension(i)); - } -} - -void ListAllTypesForServices(const FileDescriptor* fd, - std::vector* types); - -// Indicates whether we should use implicit weak fields for this file. -bool UsingImplicitWeakFields(const FileDescriptor* file, - const Options& options); - -// Indicates whether to treat this field as implicitly weak. -bool IsImplicitWeakField(const FieldDescriptor* field, const Options& options, - MessageSCCAnalyzer* scc_analyzer); - -inline bool HasSimpleBaseClass(const Descriptor* desc, const Options& options) { - if (!HasDescriptorMethods(desc->file(), options)) return false; - if (desc->extension_range_count() != 0) return false; - if (desc->field_count() == 0) return true; - // TODO(jorg): Support additional common message types with only one - // or two fields - 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 ""; - if (desc->extension_range_count() != 0) return ""; - if (desc->field_count() == 0) { - return "ZeroFieldsBase"; - } - // TODO(jorg): Support additional common message types with only one - // or two fields - return ""; -} - -// Formatter is a functor class which acts as a closure around printer and -// the variable map. It's much like printer->Print except it supports both named -// variables that are substituted using a key value map and direct arguments. In -// the format string $1$, $2$, etc... are substituted for the first, second, ... -// direct argument respectively in the format call, it accepts both strings and -// integers. The implementation verifies all arguments are used and are "first" -// used in order of appearance in the argument list. For example, -// -// Format("return array[$1$];", 3) -> "return array[3];" -// Format("array[$2$] = $1$;", "Bla", 3) -> FATAL error (wrong order) -// Format("array[$1$] = $2$;", 3, "Bla") -> "array[3] = Bla;" -// -// The arguments can be used more than once like -// -// Format("array[$1$] = $2$; // Index = $1$", 3, "Bla") -> -// "array[3] = Bla; // Index = 3" -// -// If you use more arguments use the following style to help the reader, -// -// Format("int $1$() {\n" -// " array[$2$] = $3$;\n" -// " return $4$;" -// "}\n", -// funname, // 1 -// idx, // 2 -// varname, // 3 -// retval); // 4 -// -// but consider using named variables. Named variables like $foo$, with some -// identifier foo, are looked up in the map. One additional feature is that -// spaces are accepted between the '$' delimiters, $ foo$ will -// substiture to " bar" if foo stands for "bar", but in case it's empty -// will substitute to "". Hence, for example, -// -// Format(vars, "$dllexport $void fun();") -> "void fun();" -// "__declspec(export) void fun();" -// -// which is convenient to prevent double, leading or trailing spaces. -class PROTOC_EXPORT Formatter { - public: - explicit Formatter(io::Printer* printer) : printer_(printer) {} - Formatter(io::Printer* printer, - const std::map& vars) - : printer_(printer), vars_(vars) {} - - template - void Set(const std::string& key, const T& value) { - vars_[key] = ToString(value); - } - - void AddMap(const std::map& vars) { - for (const auto& keyval : vars) vars_[keyval.first] = keyval.second; - } - - template - void operator()(const char* format, const Args&... args) const { - printer_->FormatInternal({ToString(args)...}, vars_, format); - } - - void Indent() const { printer_->Indent(); } - void Outdent() const { printer_->Outdent(); } - io::Printer* printer() const { return printer_; } - - class PROTOC_EXPORT ScopedIndenter { - public: - explicit ScopedIndenter(Formatter* format) : format_(format) { - format_->Indent(); - } - ~ScopedIndenter() { format_->Outdent(); } - - private: - Formatter* format_; - }; - - PROTOBUF_NODISCARD ScopedIndenter ScopedIndent() { - return ScopedIndenter(this); - } - template - PROTOBUF_NODISCARD ScopedIndenter ScopedIndent(const char* format, - const Args&&... args) { - (*this)(format, static_cast(args)...); - return ScopedIndenter(this); - } - - class PROTOC_EXPORT SaveState { - public: - explicit SaveState(Formatter* format) - : format_(format), vars_(format->vars_) {} - ~SaveState() { format_->vars_.swap(vars_); } - - private: - Formatter* format_; - std::map vars_; - }; - - private: - io::Printer* printer_; - std::map vars_; - - // Convenience overloads to accept different types as arguments. - static std::string ToString(const std::string& s) { return s; } - template ::value>::type> - static std::string ToString(I x) { - return StrCat(x); - } - static std::string ToString(strings::Hex x) { return StrCat(x); } - static std::string ToString(const FieldDescriptor* d) { return Payload(d); } - static std::string ToString(const Descriptor* d) { return Payload(d); } - static std::string ToString(const EnumDescriptor* d) { return Payload(d); } - static std::string ToString(const EnumValueDescriptor* d) { - return Payload(d); - } - static std::string ToString(const OneofDescriptor* d) { return Payload(d); } - - template - static std::string Payload(const Descriptor* descriptor) { - std::vector path; - descriptor->GetLocationPath(&path); - GeneratedCodeInfo::Annotation annotation; - for (int index : path) { - annotation.add_path(index); - } - annotation.set_source_file(descriptor->file()->name()); - return annotation.SerializeAsString(); - } -}; - -template -void PrintFieldComment(const Formatter& format, const T* field) { - // Print the field's (or oneof's) proto-syntax definition as a comment. - // We don't want to print group bodies so we cut off after the first - // line. - DebugStringOptions options; - options.elide_group_body = true; - options.elide_oneof_body = true; - std::string def = field->DebugStringWithOptions(options); - format("// $1$\n", def.substr(0, def.find_first_of('\n'))); -} - -class PROTOC_EXPORT NamespaceOpener { - public: - explicit NamespaceOpener(const Formatter& format) - : printer_(format.printer()) {} - NamespaceOpener(const std::string& name, const Formatter& format) - : NamespaceOpener(format) { - ChangeTo(name); - } - ~NamespaceOpener() { ChangeTo(""); } - - void ChangeTo(const std::string& name) { - std::vector new_stack_ = - Split(name, "::", true); - size_t len = std::min(name_stack_.size(), new_stack_.size()); - size_t common_idx = 0; - while (common_idx < len) { - if (name_stack_[common_idx] != new_stack_[common_idx]) break; - common_idx++; - } - for (auto it = name_stack_.crbegin(); - it != name_stack_.crend() - common_idx; ++it) { - if (*it == "PROTOBUF_NAMESPACE_ID") { - printer_->Print("PROTOBUF_NAMESPACE_CLOSE\n"); - } else { - printer_->Print("} // namespace $ns$\n", "ns", *it); - } - } - name_stack_.swap(new_stack_); - for (size_t i = common_idx; i < name_stack_.size(); ++i) { - if (name_stack_[i] == "PROTOBUF_NAMESPACE_ID") { - printer_->Print("PROTOBUF_NAMESPACE_OPEN\n"); - } else { - printer_->Print("namespace $ns$ {\n", "ns", name_stack_[i]); - } - } - } - - private: - io::Printer* printer_; - std::vector name_stack_; -}; - -enum class Utf8CheckMode { - kStrict = 0, // Parsing will fail if non UTF-8 data is in string fields. - kVerify = 1, // Only log an error but parsing will succeed. - kNone = 2, // No UTF-8 check. -}; - -Utf8CheckMode GetUtf8CheckMode(const FieldDescriptor* field, - const Options& options); - -void GenerateUtf8CheckCodeForString(const FieldDescriptor* field, - const Options& options, bool for_parse, - const char* parameters, - const Formatter& format); - -void GenerateUtf8CheckCodeForCord(const FieldDescriptor* field, - const Options& options, bool for_parse, - const char* parameters, - const Formatter& format); - -template -struct FieldRangeImpl { - struct Iterator { - using iterator_category = std::forward_iterator_tag; - using value_type = const FieldDescriptor*; - using difference_type = int; - - value_type operator*() { return descriptor->field(idx); } - - friend bool operator==(const Iterator& a, const Iterator& b) { - GOOGLE_DCHECK(a.descriptor == b.descriptor); - return a.idx == b.idx; - } - friend bool operator!=(const Iterator& a, const Iterator& b) { - return !(a == b); - } - - Iterator& operator++() { - idx++; - return *this; - } - - int idx; - const T* descriptor; - }; - - Iterator begin() const { return {0, descriptor}; } - Iterator end() const { return {descriptor->field_count(), descriptor}; } - - const T* descriptor; -}; - -template -FieldRangeImpl FieldRange(const T* desc) { - return {desc}; -} - -struct OneOfRangeImpl { - struct Iterator { - using iterator_category = std::forward_iterator_tag; - using value_type = const OneofDescriptor*; - using difference_type = int; - - value_type operator*() { return descriptor->oneof_decl(idx); } - - friend bool operator==(const Iterator& a, const Iterator& b) { - GOOGLE_DCHECK(a.descriptor == b.descriptor); - return a.idx == b.idx; - } - friend bool operator!=(const Iterator& a, const Iterator& b) { - return !(a == b); - } - - Iterator& operator++() { - idx++; - return *this; - } - - int idx; - const Descriptor* descriptor; - }; - - Iterator begin() const { return {0, descriptor}; } - Iterator end() const { - return {descriptor->real_oneof_decl_count(), descriptor}; - } - - const Descriptor* descriptor; -}; - -inline OneOfRangeImpl OneOfRange(const Descriptor* desc) { return {desc}; } - -PROTOC_EXPORT std::string StripProto(const std::string& filename); - -bool EnableMessageOwnedArena(const Descriptor* desc); - -bool ShouldVerify(const Descriptor* descriptor, const Options& options, - MessageSCCAnalyzer* scc_analyzer); -bool ShouldVerify(const FileDescriptor* file, const Options& options, - MessageSCCAnalyzer* scc_analyzer); -} // namespace cpp -} // namespace compiler -} // namespace protobuf -} // namespace google - -#include - -#endif // GOOGLE_PROTOBUF_COMPILER_CPP_HELPERS_H__ diff --git a/extra/protobuf/protobuf-3.19.4/src/google/protobuf/compiler/cpp/cpp_map_field.cc b/extra/protobuf/protobuf-3.19.4/src/google/protobuf/compiler/cpp/cpp_map_field.cc deleted file mode 100644 index 130e90ebbe0a..000000000000 --- a/extra/protobuf/protobuf-3.19.4/src/google/protobuf/compiler/cpp/cpp_map_field.cc +++ /dev/null @@ -1,334 +0,0 @@ -// Protocol Buffers - Google's data interchange format -// Copyright 2008 Google Inc. All rights reserved. -// https://developers.google.com/protocol-buffers/ -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// * Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// * Redistributions in binary form must reproduce the above -// copyright notice, this list of conditions and the following disclaimer -// in the documentation and/or other materials provided with the -// distribution. -// * Neither the name of Google Inc. nor the names of its -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -#include - -#include -#include -#include -#include - - -namespace google { -namespace protobuf { -namespace compiler { -namespace cpp { - -bool IsProto3Field(const FieldDescriptor* field_descriptor) { - const FileDescriptor* file_descriptor = field_descriptor->file(); - return file_descriptor->syntax() == FileDescriptor::SYNTAX_PROTO3; -} - -void SetMessageVariables(const FieldDescriptor* descriptor, - std::map* variables, - const Options& options) { - SetCommonFieldVariables(descriptor, variables, options); - (*variables)["type"] = ClassName(descriptor->message_type(), false); - (*variables)["full_name"] = descriptor->full_name(); - - const FieldDescriptor* key = - descriptor->message_type()->FindFieldByName("key"); - const FieldDescriptor* val = - descriptor->message_type()->FindFieldByName("value"); - (*variables)["key_cpp"] = PrimitiveTypeName(options, key->cpp_type()); - switch (val->cpp_type()) { - case FieldDescriptor::CPPTYPE_MESSAGE: - (*variables)["val_cpp"] = FieldMessageTypeName(val, options); - break; - case FieldDescriptor::CPPTYPE_ENUM: - (*variables)["val_cpp"] = ClassName(val->enum_type(), true); - break; - default: - (*variables)["val_cpp"] = PrimitiveTypeName(options, val->cpp_type()); - } - (*variables)["key_wire_type"] = - "TYPE_" + ToUpper(DeclaredTypeMethodName(key->type())); - (*variables)["val_wire_type"] = - "TYPE_" + ToUpper(DeclaredTypeMethodName(val->type())); - (*variables)["map_classname"] = ClassName(descriptor->message_type(), false); - (*variables)["number"] = StrCat(descriptor->number()); - (*variables)["tag"] = StrCat(internal::WireFormat::MakeTag(descriptor)); - - if (HasDescriptorMethods(descriptor->file(), options)) { - (*variables)["lite"] = ""; - } else { - (*variables)["lite"] = "Lite"; - } -} - -MapFieldGenerator::MapFieldGenerator(const FieldDescriptor* descriptor, - const Options& options, - MessageSCCAnalyzer* scc_analyzer) - : FieldGenerator(descriptor, options), - has_required_fields_( - scc_analyzer->HasRequiredFields(descriptor->message_type())) { - SetMessageVariables(descriptor, &variables_, options); -} - -MapFieldGenerator::~MapFieldGenerator() {} - -void MapFieldGenerator::GeneratePrivateMembers(io::Printer* printer) const { - Formatter format(printer, variables_); - format( - "::$proto_ns$::internal::MapField$lite$<\n" - " $map_classname$,\n" - " $key_cpp$, $val_cpp$,\n" - " ::$proto_ns$::internal::WireFormatLite::$key_wire_type$,\n" - " ::$proto_ns$::internal::WireFormatLite::$val_wire_type$> " - "$name$_;\n"); -} - -void MapFieldGenerator::GenerateAccessorDeclarations( - io::Printer* printer) const { - Formatter format(printer, variables_); - format( - "private:\n" - "const ::$proto_ns$::Map< $key_cpp$, $val_cpp$ >&\n" - " ${1$_internal_$name$$}$() const;\n" - "::$proto_ns$::Map< $key_cpp$, $val_cpp$ >*\n" - " ${1$_internal_mutable_$name$$}$();\n" - "public:\n" - "$deprecated_attr$const ::$proto_ns$::Map< $key_cpp$, $val_cpp$ >&\n" - " ${1$$name$$}$() const;\n" - "$deprecated_attr$::$proto_ns$::Map< $key_cpp$, $val_cpp$ >*\n" - " ${1$mutable_$name$$}$();\n", - descriptor_); -} - -void MapFieldGenerator::GenerateInlineAccessorDefinitions( - io::Printer* printer) const { - Formatter format(printer, variables_); - format( - "inline const ::$proto_ns$::Map< $key_cpp$, $val_cpp$ >&\n" - "$classname$::_internal_$name$() const {\n" - " return $name$_.GetMap();\n" - "}\n" - "inline const ::$proto_ns$::Map< $key_cpp$, $val_cpp$ >&\n" - "$classname$::$name$() const {\n" - "$annotate_get$" - " // @@protoc_insertion_point(field_map:$full_name$)\n" - " return _internal_$name$();\n" - "}\n" - "inline ::$proto_ns$::Map< $key_cpp$, $val_cpp$ >*\n" - "$classname$::_internal_mutable_$name$() {\n" - " return $name$_.MutableMap();\n" - "}\n" - "inline ::$proto_ns$::Map< $key_cpp$, $val_cpp$ >*\n" - "$classname$::mutable_$name$() {\n" - "$annotate_mutable$" - " // @@protoc_insertion_point(field_mutable_map:$full_name$)\n" - " return _internal_mutable_$name$();\n" - "}\n"); -} - -void MapFieldGenerator::GenerateClearingCode(io::Printer* printer) const { - Formatter format(printer, variables_); - format("$name$_.Clear();\n"); -} - -void MapFieldGenerator::GenerateMergingCode(io::Printer* printer) const { - Formatter format(printer, variables_); - format("$name$_.MergeFrom(from.$name$_);\n"); -} - -void MapFieldGenerator::GenerateSwappingCode(io::Printer* printer) const { - Formatter format(printer, variables_); - format("$name$_.InternalSwap(&other->$name$_);\n"); -} - -void MapFieldGenerator::GenerateCopyConstructorCode( - io::Printer* printer) const { - GenerateConstructorCode(printer); - GenerateMergingCode(printer); -} - -static void GenerateSerializationLoop(const Formatter& format, bool string_key, - bool string_value, - bool is_deterministic) { - std::string ptr; - if (is_deterministic) { - format("for (size_type i = 0; i < n; i++) {\n"); - ptr = string_key ? "items[static_cast(i)]" - : "items[static_cast(i)].second"; - } else { - format( - "for (::$proto_ns$::Map< $key_cpp$, $val_cpp$ >::const_iterator\n" - " it = this->_internal_$name$().begin();\n" - " it != this->_internal_$name$().end(); ++it) {\n"); - ptr = "it"; - } - format.Indent(); - - format( - "target = $map_classname$::Funcs::InternalSerialize($number$, " - "$1$->first, $1$->second, target, stream);\n", - ptr); - - if (string_key || string_value) { - // ptr is either an actual pointer or an iterator, either way we can - // create a pointer by taking the address after de-referencing it. - format("Utf8Check::Check(&(*$1$));\n", ptr); - } - - format.Outdent(); - format("}\n"); -} - -void MapFieldGenerator::GenerateSerializeWithCachedSizesToArray( - io::Printer* printer) const { - Formatter format(printer, variables_); - format("if (!this->_internal_$name$().empty()) {\n"); - format.Indent(); - const FieldDescriptor* key_field = - descriptor_->message_type()->FindFieldByName("key"); - const FieldDescriptor* value_field = - descriptor_->message_type()->FindFieldByName("value"); - const bool string_key = key_field->type() == FieldDescriptor::TYPE_STRING; - const bool string_value = value_field->type() == FieldDescriptor::TYPE_STRING; - - format( - "typedef ::$proto_ns$::Map< $key_cpp$, $val_cpp$ >::const_pointer\n" - " ConstPtr;\n"); - if (string_key) { - format( - "typedef ConstPtr SortItem;\n" - "typedef ::$proto_ns$::internal::" - "CompareByDerefFirst Less;\n"); - } else { - format( - "typedef ::$proto_ns$::internal::SortItem< $key_cpp$, ConstPtr > " - "SortItem;\n" - "typedef ::$proto_ns$::internal::CompareByFirstField " - "Less;\n"); - } - bool utf8_check = string_key || string_value; - if (utf8_check) { - format( - "struct Utf8Check {\n" - " static void Check(ConstPtr p) {\n" - // p may be unused when GetUtf8CheckMode evaluates to kNone, - // thus disabling the validation. - " (void)p;\n"); - format.Indent(); - format.Indent(); - if (string_key) { - GenerateUtf8CheckCodeForString( - key_field, options_, false, - "p->first.data(), static_cast(p->first.length()),\n", format); - } - if (string_value) { - GenerateUtf8CheckCodeForString( - value_field, options_, false, - "p->second.data(), static_cast(p->second.length()),\n", format); - } - format.Outdent(); - format.Outdent(); - format( - " }\n" - "};\n"); - } - - format( - "\n" - "if (stream->IsSerializationDeterministic() &&\n" - " this->_internal_$name$().size() > 1) {\n" - " ::std::unique_ptr items(\n" - " new SortItem[this->_internal_$name$().size()]);\n" - " typedef ::$proto_ns$::Map< $key_cpp$, $val_cpp$ >::size_type " - "size_type;\n" - " size_type n = 0;\n" - " for (::$proto_ns$::Map< $key_cpp$, $val_cpp$ >::const_iterator\n" - " it = this->_internal_$name$().begin();\n" - " it != this->_internal_$name$().end(); ++it, ++n) {\n" - " items[static_cast(n)] = SortItem(&*it);\n" - " }\n" - " ::std::sort(&items[0], &items[static_cast(n)], Less());\n"); - format.Indent(); - GenerateSerializationLoop(format, string_key, string_value, true); - format.Outdent(); - format("} else {\n"); - format.Indent(); - GenerateSerializationLoop(format, string_key, string_value, false); - format.Outdent(); - format("}\n"); - format.Outdent(); - format("}\n"); -} - -void MapFieldGenerator::GenerateByteSize(io::Printer* printer) const { - Formatter format(printer, variables_); - format( - "total_size += $tag_size$ *\n" - " " - "::$proto_ns$::internal::FromIntSize(this->_internal_$name$_size());\n" - "for (::$proto_ns$::Map< $key_cpp$, $val_cpp$ >::const_iterator\n" - " it = this->_internal_$name$().begin();\n" - " it != this->_internal_$name$().end(); ++it) {\n" - " total_size += $map_classname$::Funcs::ByteSizeLong(it->first, " - "it->second);\n" - "}\n"); -} - -void MapFieldGenerator::GenerateIsInitialized(io::Printer* printer) const { - if (!has_required_fields_) return; - - Formatter format(printer, variables_); - format( - "if (!::$proto_ns$::internal::AllAreInitialized($name$_)) return " - "false;\n"); -} - -void MapFieldGenerator::GenerateConstinitInitializer( - io::Printer* printer) const { - Formatter format(printer, variables_); - if (HasDescriptorMethods(descriptor_->file(), options_)) { - format("$name$_(::$proto_ns$::internal::ConstantInitialized{})"); - } else { - format("$name$_()"); - } -} - -bool MapFieldGenerator::GenerateArenaDestructorCode( - io::Printer* printer) const { - Formatter format(printer, variables_); - if (HasDescriptorMethods(descriptor_->file(), options_)) { - // _this is the object being destructed (we are inside a static method - // here). - format("_this->$name$_. ~MapField();\n"); - return true; - } else { - return false; - } -} - -} // namespace cpp -} // namespace compiler -} // namespace protobuf -} // namespace google diff --git a/extra/protobuf/protobuf-3.19.4/src/google/protobuf/compiler/cpp/cpp_map_field.h b/extra/protobuf/protobuf-3.19.4/src/google/protobuf/compiler/cpp/cpp_map_field.h deleted file mode 100644 index c01ae498b1aa..000000000000 --- a/extra/protobuf/protobuf-3.19.4/src/google/protobuf/compiler/cpp/cpp_map_field.h +++ /dev/null @@ -1,78 +0,0 @@ -// Protocol Buffers - Google's data interchange format -// Copyright 2008 Google Inc. All rights reserved. -// https://developers.google.com/protocol-buffers/ -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// * Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// * Redistributions in binary form must reproduce the above -// copyright notice, this list of conditions and the following disclaimer -// in the documentation and/or other materials provided with the -// distribution. -// * Neither the name of Google Inc. nor the names of its -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -#ifndef GOOGLE_PROTOBUF_COMPILER_CPP_MAP_FIELD_H__ -#define GOOGLE_PROTOBUF_COMPILER_CPP_MAP_FIELD_H__ - -#include -#include - -#include -#include - -namespace google { -namespace protobuf { -namespace compiler { -namespace cpp { - -class MapFieldGenerator : public FieldGenerator { - public: - MapFieldGenerator(const FieldDescriptor* descriptor, const Options& options, - MessageSCCAnalyzer* scc_analyzer); - ~MapFieldGenerator() override; - - // implements FieldGenerator --------------------------------------- - void GeneratePrivateMembers(io::Printer* printer) const override; - void GenerateAccessorDeclarations(io::Printer* printer) const override; - void GenerateInlineAccessorDefinitions(io::Printer* printer) const override; - void GenerateClearingCode(io::Printer* printer) const override; - void GenerateMergingCode(io::Printer* printer) const override; - void GenerateSwappingCode(io::Printer* printer) const override; - void GenerateConstructorCode(io::Printer* printer) const override {} - void GenerateCopyConstructorCode(io::Printer* printer) const override; - void GenerateSerializeWithCachedSizesToArray( - io::Printer* printer) const override; - void GenerateByteSize(io::Printer* printer) const override; - void GenerateIsInitialized(io::Printer* printer) const override; - void GenerateConstinitInitializer(io::Printer* printer) const override; - bool GenerateArenaDestructorCode(io::Printer* printer) const override; - - private: - const bool has_required_fields_; - - GOOGLE_DISALLOW_EVIL_CONSTRUCTORS(MapFieldGenerator); -}; - -} // namespace cpp -} // namespace compiler -} // namespace protobuf -} // namespace google - -#endif // GOOGLE_PROTOBUF_COMPILER_CPP_MAP_FIELD_H__ diff --git a/extra/protobuf/protobuf-3.19.4/src/google/protobuf/compiler/cpp/cpp_message.cc b/extra/protobuf/protobuf-3.19.4/src/google/protobuf/compiler/cpp/cpp_message.cc deleted file mode 100644 index 70d8a57e3a9e..000000000000 --- a/extra/protobuf/protobuf-3.19.4/src/google/protobuf/compiler/cpp/cpp_message.cc +++ /dev/null @@ -1,4584 +0,0 @@ -// Protocol Buffers - Google's data interchange format -// Copyright 2008 Google Inc. All rights reserved. -// https://developers.google.com/protocol-buffers/ -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// * Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// * Redistributions in binary form must reproduce the above -// copyright notice, this list of conditions and the following disclaimer -// in the documentation and/or other materials provided with the -// distribution. -// * Neither the name of Google Inc. nor the names of its -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -// Author: kenton@google.com (Kenton Varda) -// Based on original Protocol Buffers design by -// Sanjay Ghemawat, Jeff Dean, and others. - -#include - -#include -#include -#include -#include -#include -#include -#include -#include - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - - -// Must be included last. -#include - -namespace google { -namespace protobuf { -namespace compiler { -namespace cpp { - -using internal::WireFormat; -using internal::WireFormatLite; - -namespace { - -static constexpr int kNoHasbit = -1; - -// Create an expression that evaluates to -// "for all i, (_has_bits_[i] & masks[i]) == masks[i]" -// masks is allowed to be shorter than _has_bits_, but at least one element of -// masks must be non-zero. -std::string ConditionalToCheckBitmasks( - const std::vector& masks, bool return_success = true, - StringPiece has_bits_var = "_has_bits_") { - std::vector parts; - for (int i = 0; i < masks.size(); i++) { - if (masks[i] == 0) continue; - std::string m = StrCat("0x", strings::Hex(masks[i], strings::ZERO_PAD_8)); - // Each xor evaluates to 0 if the expected bits are present. - parts.push_back( - StrCat("((", has_bits_var, "[", i, "] & ", m, ") ^ ", m, ")")); - } - GOOGLE_CHECK(!parts.empty()); - // If we have multiple parts, each expected to be 0, then bitwise-or them. - std::string result = - parts.size() == 1 - ? parts[0] - : StrCat("(", Join(parts, "\n | "), ")"); - return result + (return_success ? " == 0" : " != 0"); -} - -void PrintPresenceCheck(const Formatter& format, const FieldDescriptor* field, - const std::vector& has_bit_indices, - io::Printer* printer, int* cached_has_word_index) { - if (!field->options().weak()) { - int has_bit_index = has_bit_indices[field->index()]; - if (*cached_has_word_index != (has_bit_index / 32)) { - *cached_has_word_index = (has_bit_index / 32); - format("cached_has_bits = _has_bits_[$1$];\n", *cached_has_word_index); - } - const std::string mask = - StrCat(strings::Hex(1u << (has_bit_index % 32), strings::ZERO_PAD_8)); - format("if (cached_has_bits & 0x$1$u) {\n", mask); - } else { - format("if (has_$1$()) {\n", FieldName(field)); - } - format.Indent(); -} - -struct FieldOrderingByNumber { - inline bool operator()(const FieldDescriptor* a, - const FieldDescriptor* b) const { - return a->number() < b->number(); - } -}; - -// Sort the fields of the given Descriptor by number into a new[]'d array -// and return it. -std::vector SortFieldsByNumber( - const Descriptor* descriptor) { - std::vector fields(descriptor->field_count()); - for (int i = 0; i < descriptor->field_count(); i++) { - fields[i] = descriptor->field(i); - } - std::sort(fields.begin(), fields.end(), FieldOrderingByNumber()); - return fields; -} - -// Functor for sorting extension ranges by their "start" field number. -struct ExtensionRangeSorter { - bool operator()(const Descriptor::ExtensionRange* left, - const Descriptor::ExtensionRange* right) const { - return left->start < right->start; - } -}; - -bool IsPOD(const FieldDescriptor* field) { - if (field->is_repeated() || field->is_extension()) return false; - switch (field->cpp_type()) { - case FieldDescriptor::CPPTYPE_ENUM: - case FieldDescriptor::CPPTYPE_INT32: - case FieldDescriptor::CPPTYPE_INT64: - case FieldDescriptor::CPPTYPE_UINT32: - case FieldDescriptor::CPPTYPE_UINT64: - case FieldDescriptor::CPPTYPE_FLOAT: - case FieldDescriptor::CPPTYPE_DOUBLE: - case FieldDescriptor::CPPTYPE_BOOL: - return true; - case FieldDescriptor::CPPTYPE_STRING: - return false; - default: - return false; - } -} - -// Helper for the code that emits the SharedCtor() and InternalSwap() methods. -// Anything that is a POD or a "normal" message (represented by a pointer) can -// be manipulated as raw bytes. -bool CanBeManipulatedAsRawBytes(const FieldDescriptor* field, - const Options& options, - MessageSCCAnalyzer* scc_analyzer) { - bool ret = CanInitializeByZeroing(field); - - // Non-repeated, non-lazy message fields are simply raw pointers, so we can - // swap them or use memset to initialize these in SharedCtor. We cannot use - // this in Clear, as we need to potentially delete the existing value. - ret = - ret || (!field->is_repeated() && !IsLazy(field, options, scc_analyzer) && - field->cpp_type() == FieldDescriptor::CPPTYPE_MESSAGE); - return ret; -} - -bool StrContains(const std::string& haystack, const std::string& needle) { - return haystack.find(needle) != std::string::npos; -} - -// Finds runs of fields for which `predicate` is true. -// RunMap maps from fields that start each run to the number of fields in that -// run. This is optimized for the common case that there are very few runs in -// a message and that most of the eligible fields appear together. -using RunMap = std::unordered_map; -RunMap FindRuns(const std::vector& fields, - const std::function& predicate) { - RunMap runs; - const FieldDescriptor* last_start = nullptr; - - for (auto field : fields) { - if (predicate(field)) { - if (last_start == nullptr) { - last_start = field; - } - - runs[last_start]++; - } else { - last_start = nullptr; - } - } - return runs; -} - -// Emits an if-statement with a condition that evaluates to true if |field| is -// considered non-default (will be sent over the wire), for message types -// without true field presence. Should only be called if -// !HasHasbit(field). -bool EmitFieldNonDefaultCondition(io::Printer* printer, - const std::string& prefix, - const FieldDescriptor* field) { - GOOGLE_CHECK(!HasHasbit(field)); - Formatter format(printer); - format.Set("prefix", prefix); - format.Set("name", FieldName(field)); - // Merge and serialize semantics: primitive fields are merged/serialized only - // if non-zero (numeric) or non-empty (string). - if (!field->is_repeated() && !field->containing_oneof()) { - if (field->cpp_type() == FieldDescriptor::CPPTYPE_STRING) { - format("if (!$prefix$_internal_$name$().empty()) {\n"); - } else if (field->cpp_type() == FieldDescriptor::CPPTYPE_MESSAGE) { - // Message fields still have has_$name$() methods. - format("if ($prefix$_internal_has_$name$()) {\n"); - } else if (field->cpp_type() == FieldDescriptor::CPPTYPE_FLOAT) { - format( - "static_assert(sizeof(uint32_t) == sizeof(float), \"Code assumes " - "uint32_t and float are the same size.\");\n" - "float tmp_$name$ = $prefix$_internal_$name$();\n" - "uint32_t raw_$name$;\n" - "memcpy(&raw_$name$, &tmp_$name$, sizeof(tmp_$name$));\n" - "if (raw_$name$ != 0) {\n"); - } else if (field->cpp_type() == FieldDescriptor::CPPTYPE_DOUBLE) { - format( - "static_assert(sizeof(uint64_t) == sizeof(double), \"Code assumes " - "uint64_t and double are the same size.\");\n" - "double tmp_$name$ = $prefix$_internal_$name$();\n" - "uint64_t raw_$name$;\n" - "memcpy(&raw_$name$, &tmp_$name$, sizeof(tmp_$name$));\n" - "if (raw_$name$ != 0) {\n"); - } else { - format("if ($prefix$_internal_$name$() != 0) {\n"); - } - format.Indent(); - return true; - } else if (field->real_containing_oneof()) { - format("if (_internal_has_$name$()) {\n"); - format.Indent(); - return true; - } - return false; -} - -// Does the given field have a has_$name$() method? -bool HasHasMethod(const FieldDescriptor* field) { - if (!IsProto3(field->file())) { - // In proto1/proto2, every field has a has_$name$() method. - return true; - } - // For message types without true field presence, only fields with a message - // type or inside an one-of have a has_$name$() method. - return field->cpp_type() == FieldDescriptor::CPPTYPE_MESSAGE || - field->has_optional_keyword() || field->real_containing_oneof(); -} - -// Collects map entry message type information. -void CollectMapInfo(const Options& options, const Descriptor* descriptor, - std::map* variables) { - GOOGLE_CHECK(IsMapEntryMessage(descriptor)); - std::map& vars = *variables; - const FieldDescriptor* key = descriptor->FindFieldByName("key"); - const FieldDescriptor* val = descriptor->FindFieldByName("value"); - vars["key_cpp"] = PrimitiveTypeName(options, key->cpp_type()); - switch (val->cpp_type()) { - case FieldDescriptor::CPPTYPE_MESSAGE: - vars["val_cpp"] = FieldMessageTypeName(val, options); - break; - case FieldDescriptor::CPPTYPE_ENUM: - vars["val_cpp"] = ClassName(val->enum_type(), true); - break; - default: - vars["val_cpp"] = PrimitiveTypeName(options, val->cpp_type()); - } - vars["key_wire_type"] = - "TYPE_" + ToUpper(DeclaredTypeMethodName(key->type())); - vars["val_wire_type"] = - "TYPE_" + ToUpper(DeclaredTypeMethodName(val->type())); -} - -// Does the given field have a private (internal helper only) has_$name$() -// method? -bool HasPrivateHasMethod(const FieldDescriptor* field) { - // Only for oneofs in message types with no field presence. has_$name$(), - // based on the oneof case, is still useful internally for generated code. - return IsProto3(field->file()) && field->real_containing_oneof(); -} - -// TODO(ckennelly): Cull these exclusions if/when these protos do not have -// their methods overridden by subclasses. - -bool ShouldMarkClassAsFinal(const Descriptor* descriptor, - const Options& options) { - return true; -} - - -// Returns true to make the message serialize in order, decided by the following -// factors in the order of precedence. -// --options().message_set_wire_format() == true -// --the message is in the allowlist (true) -// --GOOGLE_PROTOBUF_SHUFFLE_SERIALIZE is defined (false) -// --a ranage of message names that are allowed to stay in order (true) -bool ShouldSerializeInOrder(const Descriptor* descriptor, - const Options& options) { - return true; -} - -bool TableDrivenParsingEnabled(const Descriptor* descriptor, - const Options& options, - MessageSCCAnalyzer* scc_analyzer) { - if (!options.table_driven_parsing) { - return false; - } - - // Consider table-driven parsing. We only do this if: - // - We have has_bits for fields. This avoids a check on every field we set - // when are present (the common case). - bool has_hasbit = false; - for (int i = 0; i < descriptor->field_count(); i++) { - if (HasHasbit(descriptor->field(i))) { - has_hasbit = true; - break; - } - } - - if (!has_hasbit) return false; - - const double table_sparseness = 0.5; - int max_field_number = 0; - for (auto field : FieldRange(descriptor)) { - if (max_field_number < field->number()) { - max_field_number = field->number(); - } - - // - There are no weak fields. - if (IsWeak(field, options)) { - return false; - } - - // - There are no lazy fields (they require the non-lite library). - if (IsLazy(field, options, scc_analyzer)) { - return false; - } - } - - // - There range of field numbers is "small" - if (max_field_number >= (2 << 14)) { - return false; - } - - // - Field numbers are relatively dense within the actual number of fields. - // We check for strictly greater than in the case where there are no fields - // (only extensions) so max_field_number == descriptor->field_count() == 0. - if (max_field_number * table_sparseness > descriptor->field_count()) { - return false; - } - - // - This is not a MapEntryMessage. - if (IsMapEntryMessage(descriptor)) { - return false; - } - - return true; -} - -bool IsCrossFileMapField(const FieldDescriptor* field) { - if (!field->is_map()) { - return false; - } - - const Descriptor* d = field->message_type(); - const FieldDescriptor* value = d->FindFieldByNumber(2); - - return IsCrossFileMessage(value); -} - -bool IsCrossFileMaybeMap(const FieldDescriptor* field) { - if (IsCrossFileMapField(field)) { - return true; - } - - return IsCrossFileMessage(field); -} - -bool IsRequired(const std::vector& v) { - return v.front()->is_required(); -} - -bool HasSingularString(const Descriptor* desc, const Options& options) { - for (const auto* field : FieldRange(desc)) { - if (IsString(field, options) && !IsStringInlined(field, options) && - !field->is_repeated() && !field->real_containing_oneof()) { - return true; - } - } - return false; -} - -// Collects neighboring fields based on a given criteria (equivalent predicate). -template -std::vector> CollectFields( - const std::vector& fields, - const Predicate& equivalent) { - std::vector> chunks; - for (auto field : fields) { - if (chunks.empty() || !equivalent(chunks.back().back(), field)) { - chunks.emplace_back(); - } - chunks.back().push_back(field); - } - return chunks; -} - -// Returns a bit mask based on has_bit index of "fields" that are typically on -// the same chunk. It is used in a group presence check where _has_bits_ is -// masked to tell if any thing in "fields" is present. -uint32_t GenChunkMask(const std::vector& fields, - const std::vector& has_bit_indices) { - GOOGLE_CHECK(!fields.empty()); - int first_index_offset = has_bit_indices[fields.front()->index()] / 32; - uint32_t chunk_mask = 0; - for (auto field : fields) { - // "index" defines where in the _has_bits_ the field appears. - int index = has_bit_indices[field->index()]; - GOOGLE_CHECK_EQ(first_index_offset, index / 32); - chunk_mask |= static_cast(1) << (index % 32); - } - GOOGLE_CHECK_NE(0, chunk_mask); - return chunk_mask; -} - -// Return the number of bits set in n, a non-negative integer. -static int popcnt(uint32_t n) { - int result = 0; - while (n != 0) { - result += (n & 1); - n = n / 2; - } - return result; -} - -// For a run of cold chunks, opens and closes an external if statement that -// checks multiple has_bits words to skip bulk of cold fields. -class ColdChunkSkipper { - public: - ColdChunkSkipper( - const Options& options, - const std::vector>& chunks, - const std::vector& has_bit_indices, const double cold_threshold) - : chunks_(chunks), - has_bit_indices_(has_bit_indices), - access_info_map_(options.access_info_map), - cold_threshold_(cold_threshold) { - SetCommonVars(options, &variables_); - } - - // May open an external if check for a batch of cold fields. "from" is the - // prefix to _has_bits_ to allow MergeFrom to use "from._has_bits_". - // Otherwise, it should be "". - void OnStartChunk(int chunk, int cached_has_word_index, - const std::string& from, io::Printer* printer); - bool OnEndChunk(int chunk, io::Printer* printer); - - private: - bool IsColdChunk(int chunk); - - int HasbitWord(int chunk, int offset) { - return has_bit_indices_[chunks_[chunk][offset]->index()] / 32; - } - - const std::vector>& chunks_; - const std::vector& has_bit_indices_; - const AccessInfoMap* access_info_map_; - const double cold_threshold_; - std::map variables_; - int limit_chunk_ = -1; -}; - -// Tuning parameters for ColdChunkSkipper. -const double kColdRatio = 0.005; - -bool ColdChunkSkipper::IsColdChunk(int chunk) { - // Mark this variable as used until it is actually used - (void)cold_threshold_; - return false; -} - - -void ColdChunkSkipper::OnStartChunk(int chunk, int cached_has_word_index, - const std::string& from, - io::Printer* printer) { - Formatter format(printer, variables_); - if (!access_info_map_) { - return; - } else if (chunk < limit_chunk_) { - // We are already inside a run of cold chunks. - return; - } else if (!IsColdChunk(chunk)) { - // We can't start a run of cold chunks. - return; - } - - // Find the end of consecutive cold chunks. - limit_chunk_ = chunk; - while (limit_chunk_ < chunks_.size() && IsColdChunk(limit_chunk_)) { - limit_chunk_++; - } - - if (limit_chunk_ <= chunk + 1) { - // Require at least two chunks to emit external has_bit checks. - limit_chunk_ = -1; - return; - } - - // Emit has_bit check for each has_bit_dword index. - format("if (PROTOBUF_PREDICT_FALSE("); - int first_word = HasbitWord(chunk, 0); - while (chunk < limit_chunk_) { - uint32_t mask = 0; - int this_word = HasbitWord(chunk, 0); - // Generate mask for chunks on the same word. - for (; chunk < limit_chunk_ && HasbitWord(chunk, 0) == this_word; chunk++) { - for (auto field : chunks_[chunk]) { - int hasbit_index = has_bit_indices_[field->index()]; - // Fields on a chunk must be in the same word. - GOOGLE_CHECK_EQ(this_word, hasbit_index / 32); - mask |= 1 << (hasbit_index % 32); - } - } - - if (this_word != first_word) { - format(" ||\n "); - } - format.Set("mask", strings::Hex(mask, strings::ZERO_PAD_8)); - if (this_word == cached_has_word_index) { - format("(cached_has_bits & 0x$mask$u) != 0"); - } else { - format("($1$_has_bits_[$2$] & 0x$mask$u) != 0", from, this_word); - } - } - format(")) {\n"); - format.Indent(); -} - -bool ColdChunkSkipper::OnEndChunk(int chunk, io::Printer* printer) { - Formatter format(printer, variables_); - if (chunk != limit_chunk_ - 1) { - return false; - } - format.Outdent(); - format("}\n"); - return true; -} - -void MaySetAnnotationVariable(const Options& options, - StringPiece annotation_name, - StringPiece injector_template_prefix, - StringPiece injector_template_suffix, - std::map* variables) { - if (options.field_listener_options.forbidden_field_listener_events.count( - std::string(annotation_name))) - return; - (*variables)[StrCat("annotate_", annotation_name)] = strings::Substitute( - StrCat(injector_template_prefix, injector_template_suffix), - (*variables)["classtype"]); -} - -void GenerateExtensionAnnotations( - const Descriptor* descriptor, const Options& options, - std::map* variables) { - const std::map accessor_annotations_to_hooks = { - {"annotate_extension_has", "OnHasExtension"}, - {"annotate_extension_clear", "OnClearExtension"}, - {"annotate_extension_repeated_size", "OnExtensionSize"}, - {"annotate_extension_get", "OnGetExtension"}, - {"annotate_extension_mutable", "OnMutableExtension"}, - {"annotate_extension_set", "OnSetExtension"}, - {"annotate_extension_release", "OnReleaseExtension"}, - {"annotate_repeated_extension_get", "OnGetExtension"}, - {"annotate_repeated_extension_mutable", "OnMutableExtension"}, - {"annotate_repeated_extension_set", "OnSetExtension"}, - {"annotate_repeated_extension_add", "OnAddExtension"}, - {"annotate_repeated_extension_add_mutable", "OnAddMutableExtension"}, - {"annotate_repeated_extension_list", "OnListExtension"}, - {"annotate_repeated_extension_list_mutable", "OnMutableListExtension"}, - }; - for (const auto& annotation : accessor_annotations_to_hooks) { - (*variables)[annotation.first] = ""; - } - if (!options.field_listener_options.inject_field_listener_events || - descriptor->file()->options().optimize_for() == - google::protobuf::FileOptions::LITE_RUNTIME) { - return; - } - for (const auto& annotation : accessor_annotations_to_hooks) { - const std::string& annotation_name = annotation.first; - const std::string& listener_call = annotation.second; - if (!StrContains(annotation_name, "repeated") && - !StrContains(annotation_name, "size") && - !StrContains(annotation_name, "clear")) { - // Primitive fields accessors. - // "Has" is here as users calling "has" on a repeated field is a mistake. - (*variables)[annotation_name] = StrCat( - " _tracker_.", listener_call, - "(this, id.number(), _proto_TypeTraits::GetPtr(id.number(), " - "_extensions_, id.default_value_ref()));"); - } else if (StrContains(annotation_name, "repeated") && - !StrContains(annotation_name, "list") && - !StrContains(annotation_name, "size")) { - // Repeated index accessors. - std::string str_index = "index"; - if (StrContains(annotation_name, "add")) { - str_index = "_extensions_.ExtensionSize(id.number()) - 1"; - } - (*variables)[annotation_name] = - StrCat(" _tracker_.", listener_call, - "(this, id.number(), " - "_proto_TypeTraits::GetPtr(id.number(), _extensions_, ", - str_index, "));"); - } else if (StrContains(annotation_name, "list") || - StrContains(annotation_name, "size")) { - // Repeated full accessors. - (*variables)[annotation_name] = StrCat( - " _tracker_.", listener_call, - "(this, id.number(), _proto_TypeTraits::GetRepeatedPtr(id.number(), " - "_extensions_));"); - } else { - // Generic accessors such as "clear". - // TODO(b/190614678): Generalize clear from both repeated and non repeated - // calls, currently their underlying memory interfaces are very different. - // Or think of removing clear callback as no usages are needed and no - // memory exist after calling clear(). - } - } -} - -} // anonymous namespace - -// =================================================================== - -MessageGenerator::MessageGenerator( - const Descriptor* descriptor, - const std::map& vars, int index_in_file_messages, - const Options& options, MessageSCCAnalyzer* scc_analyzer) - : descriptor_(descriptor), - index_in_file_messages_(index_in_file_messages), - classname_(ClassName(descriptor, false)), - options_(options), - field_generators_(descriptor, options, scc_analyzer), - max_has_bit_index_(0), - max_inlined_string_index_(0), - num_weak_fields_(0), - scc_analyzer_(scc_analyzer), - variables_(vars) { - if (!message_layout_helper_) { - message_layout_helper_.reset(new PaddingOptimizer()); - } - - // Variables that apply to this class - variables_["classname"] = classname_; - variables_["classtype"] = QualifiedClassName(descriptor_, options); - variables_["full_name"] = descriptor_->full_name(); - variables_["superclass"] = SuperClassName(descriptor_, options_); - variables_["annotate_serialize"] = ""; - variables_["annotate_deserialize"] = ""; - variables_["annotate_reflection"] = ""; - variables_["annotate_bytesize"] = ""; - variables_["annotate_mergefrom"] = ""; - - if (options.field_listener_options.inject_field_listener_events && - descriptor->file()->options().optimize_for() != - google::protobuf::FileOptions::LITE_RUNTIME) { - const std::string injector_template = " _tracker_."; - - MaySetAnnotationVariable(options, "serialize", injector_template, - "OnSerialize(this);\n", &variables_); - MaySetAnnotationVariable(options, "deserialize", injector_template, - "OnDeserialize(this);\n", &variables_); - // TODO(danilak): Ideally annotate_reflection should not exist and we need - // to annotate all reflective calls on our own, however, as this is a cause - // for side effects, i.e. reading values dynamically, we want the users know - // that dynamic access can happen. - MaySetAnnotationVariable(options, "reflection", injector_template, - "OnGetMetadata();\n", &variables_); - MaySetAnnotationVariable(options, "bytesize", injector_template, - "OnByteSize(this);\n", &variables_); - MaySetAnnotationVariable(options, "mergefrom", injector_template, - "OnMergeFrom(this, &from);\n", &variables_); - } - - GenerateExtensionAnnotations(descriptor_, options_, &variables_); - - SetUnknownFieldsVariable(descriptor_, options_, &variables_); - - // Compute optimized field order to be used for layout and initialization - // purposes. - for (auto field : FieldRange(descriptor_)) { - if (IsFieldStripped(field, options_)) { - continue; - } - - if (IsWeak(field, options_)) { - num_weak_fields_++; - } else if (!field->real_containing_oneof()) { - optimized_order_.push_back(field); - } - } - - message_layout_helper_->OptimizeLayout(&optimized_order_, options_, - scc_analyzer_); - - // This message has hasbits iff one or more fields need one. - for (auto field : optimized_order_) { - if (HasHasbit(field)) { - if (has_bit_indices_.empty()) { - has_bit_indices_.resize(descriptor_->field_count(), kNoHasbit); - } - has_bit_indices_[field->index()] = max_has_bit_index_++; - } - if (IsStringInlined(field, options_)) { - if (inlined_string_indices_.empty()) { - inlined_string_indices_.resize(descriptor_->field_count(), kNoHasbit); - } - inlined_string_indices_[field->index()] = max_inlined_string_index_++; - } - } - - if (!has_bit_indices_.empty()) { - field_generators_.SetHasBitIndices(has_bit_indices_); - } - - if (!inlined_string_indices_.empty()) { - field_generators_.SetInlinedStringIndices(inlined_string_indices_); - } - - num_required_fields_ = 0; - for (int i = 0; i < descriptor->field_count(); i++) { - if (descriptor->field(i)->is_required()) { - ++num_required_fields_; - } - } - - table_driven_ = - TableDrivenParsingEnabled(descriptor_, options_, scc_analyzer_); - parse_function_generator_.reset(new ParseFunctionGenerator( - descriptor_, max_has_bit_index_, has_bit_indices_, - inlined_string_indices_, options_, scc_analyzer_, variables_)); -} - -MessageGenerator::~MessageGenerator() = default; - -size_t MessageGenerator::HasBitsSize() const { - return (max_has_bit_index_ + 31) / 32; -} - -size_t MessageGenerator::InlinedStringDonatedSize() const { - return (max_inlined_string_index_ + 31) / 32; -} - -int MessageGenerator::HasBitIndex(const FieldDescriptor* field) const { - return has_bit_indices_.empty() ? kNoHasbit - : has_bit_indices_[field->index()]; -} - -int MessageGenerator::HasByteIndex(const FieldDescriptor* field) const { - int hasbit = HasBitIndex(field); - return hasbit == kNoHasbit ? kNoHasbit : hasbit / 8; -} - -int MessageGenerator::HasWordIndex(const FieldDescriptor* field) const { - int hasbit = HasBitIndex(field); - return hasbit == kNoHasbit ? kNoHasbit : hasbit / 32; -} - -void MessageGenerator::AddGenerators( - std::vector>* enum_generators, - std::vector>* extension_generators) { - for (int i = 0; i < descriptor_->enum_type_count(); i++) { - enum_generators->emplace_back( - new EnumGenerator(descriptor_->enum_type(i), variables_, options_)); - enum_generators_.push_back(enum_generators->back().get()); - } - for (int i = 0; i < descriptor_->extension_count(); i++) { - extension_generators->emplace_back(new ExtensionGenerator( - descriptor_->extension(i), options_, scc_analyzer_)); - extension_generators_.push_back(extension_generators->back().get()); - } -} - -void MessageGenerator::GenerateFieldAccessorDeclarations(io::Printer* printer) { - Formatter format(printer, variables_); - // optimized_fields_ does not contain fields where - // field->real_containing_oneof() - // so we need to iterate over those as well. - // - // We place the non-oneof fields in optimized_order_, as that controls the - // order of the _has_bits_ entries and we want GDB's pretty printers to be - // able to infer these indices from the k[FIELDNAME]FieldNumber order. - std::vector ordered_fields; - ordered_fields.reserve(descriptor_->field_count()); - - ordered_fields.insert(ordered_fields.begin(), optimized_order_.begin(), - optimized_order_.end()); - for (auto field : FieldRange(descriptor_)) { - if (!field->real_containing_oneof() && !field->options().weak() && - !IsFieldStripped(field, options_)) { - continue; - } - ordered_fields.push_back(field); - } - - if (!ordered_fields.empty()) { - format("enum : int {\n"); - for (auto field : ordered_fields) { - Formatter::SaveState save(&format); - - std::map vars; - SetCommonFieldVariables(field, &vars, options_); - format.AddMap(vars); - format(" ${1$$2$$}$ = $number$,\n", field, FieldConstantName(field)); - } - format("};\n"); - } - for (auto field : ordered_fields) { - PrintFieldComment(format, field); - - Formatter::SaveState save(&format); - - std::map vars; - SetCommonFieldVariables(field, &vars, options_); - format.AddMap(vars); - - if (field->is_repeated()) { - format("$deprecated_attr$int ${1$$name$_size$}$() const$2$\n", field, - !IsFieldStripped(field, options_) ? ";" : " {__builtin_trap();}"); - if (!IsFieldStripped(field, options_)) { - format( - "private:\n" - "int ${1$_internal_$name$_size$}$() const;\n" - "public:\n", - field); - } - } else if (HasHasMethod(field)) { - format("$deprecated_attr$bool ${1$has_$name$$}$() const$2$\n", field, - !IsFieldStripped(field, options_) ? ";" : " {__builtin_trap();}"); - if (!IsFieldStripped(field, options_)) { - format( - "private:\n" - "bool _internal_has_$name$() const;\n" - "public:\n"); - } - } else if (HasPrivateHasMethod(field)) { - if (!IsFieldStripped(field, options_)) { - format( - "private:\n" - "bool ${1$_internal_has_$name$$}$() const;\n" - "public:\n", - field); - } - } - format("$deprecated_attr$void ${1$clear_$name$$}$()$2$\n", field, - !IsFieldStripped(field, options_) ? ";" : "{__builtin_trap();}"); - - // Generate type-specific accessor declarations. - field_generators_.get(field).GenerateAccessorDeclarations(printer); - - format("\n"); - } - - if (descriptor_->extension_range_count() > 0) { - // Generate accessors for extensions. - // We use "_proto_TypeTraits" as a type name below because "TypeTraits" - // causes problems if the class has a nested message or enum type with that - // name and "_TypeTraits" is technically reserved for the C++ library since - // it starts with an underscore followed by a capital letter. - // - // For similar reason, we use "_field_type" and "_is_packed" as parameter - // names below, so that "field_type" and "is_packed" can be used as field - // names. - format(R"( -template -inline bool HasExtension( - const ::PROTOBUF_NAMESPACE_ID::internal::ExtensionIdentifier< - $classname$, _proto_TypeTraits, _field_type, _is_packed>& id) const { -$annotate_extension_has$ - return _extensions_.Has(id.number()); -} - -template -inline void ClearExtension( - const ::PROTOBUF_NAMESPACE_ID::internal::ExtensionIdentifier< - $classname$, _proto_TypeTraits, _field_type, _is_packed>& id) { - _extensions_.ClearExtension(id.number()); -$annotate_extension_clear$ -} - -template -inline int ExtensionSize( - const ::PROTOBUF_NAMESPACE_ID::internal::ExtensionIdentifier< - $classname$, _proto_TypeTraits, _field_type, _is_packed>& id) const { -$annotate_extension_repeated_size$ - return _extensions_.ExtensionSize(id.number()); -} - -template -inline typename _proto_TypeTraits::Singular::ConstType GetExtension( - const ::PROTOBUF_NAMESPACE_ID::internal::ExtensionIdentifier< - $classname$, _proto_TypeTraits, _field_type, _is_packed>& id) const { -$annotate_extension_get$ - return _proto_TypeTraits::Get(id.number(), _extensions_, - id.default_value()); -} - -template -inline typename _proto_TypeTraits::Singular::MutableType MutableExtension( - const ::PROTOBUF_NAMESPACE_ID::internal::ExtensionIdentifier< - $classname$, _proto_TypeTraits, _field_type, _is_packed>& id) { -$annotate_extension_mutable$ - return _proto_TypeTraits::Mutable(id.number(), _field_type, - &_extensions_); -} - -template -inline void SetExtension( - const ::PROTOBUF_NAMESPACE_ID::internal::ExtensionIdentifier< - $classname$, _proto_TypeTraits, _field_type, _is_packed>& id, - typename _proto_TypeTraits::Singular::ConstType value) { - _proto_TypeTraits::Set(id.number(), _field_type, value, &_extensions_); -$annotate_extension_set$ -} - -template -inline void SetAllocatedExtension( - const ::PROTOBUF_NAMESPACE_ID::internal::ExtensionIdentifier< - $classname$, _proto_TypeTraits, _field_type, _is_packed>& id, - typename _proto_TypeTraits::Singular::MutableType value) { - _proto_TypeTraits::SetAllocated(id.number(), _field_type, value, - &_extensions_); -$annotate_extension_set$ -} -template -inline void UnsafeArenaSetAllocatedExtension( - const ::PROTOBUF_NAMESPACE_ID::internal::ExtensionIdentifier< - $classname$, _proto_TypeTraits, _field_type, _is_packed>& id, - typename _proto_TypeTraits::Singular::MutableType value) { - _proto_TypeTraits::UnsafeArenaSetAllocated(id.number(), _field_type, - value, &_extensions_); -$annotate_extension_set$ -} -template -PROTOBUF_NODISCARD inline - typename _proto_TypeTraits::Singular::MutableType - ReleaseExtension( - const ::PROTOBUF_NAMESPACE_ID::internal::ExtensionIdentifier< - $classname$, _proto_TypeTraits, _field_type, _is_packed>& id) { -$annotate_extension_release$ - return _proto_TypeTraits::Release(id.number(), _field_type, - &_extensions_); -} -template -inline typename _proto_TypeTraits::Singular::MutableType -UnsafeArenaReleaseExtension( - const ::PROTOBUF_NAMESPACE_ID::internal::ExtensionIdentifier< - $classname$, _proto_TypeTraits, _field_type, _is_packed>& id) { -$annotate_extension_release$ - return _proto_TypeTraits::UnsafeArenaRelease(id.number(), _field_type, - &_extensions_); -} - -template -inline typename _proto_TypeTraits::Repeated::ConstType GetExtension( - const ::PROTOBUF_NAMESPACE_ID::internal::ExtensionIdentifier< - $classname$, _proto_TypeTraits, _field_type, _is_packed>& id, - int index) const { -$annotate_repeated_extension_get$ - return _proto_TypeTraits::Get(id.number(), _extensions_, index); -} - -template -inline typename _proto_TypeTraits::Repeated::MutableType MutableExtension( - const ::PROTOBUF_NAMESPACE_ID::internal::ExtensionIdentifier< - $classname$, _proto_TypeTraits, _field_type, _is_packed>& id, - int index) { -$annotate_repeated_extension_mutable$ - return _proto_TypeTraits::Mutable(id.number(), index, &_extensions_); -} - -template -inline void SetExtension( - const ::PROTOBUF_NAMESPACE_ID::internal::ExtensionIdentifier< - $classname$, _proto_TypeTraits, _field_type, _is_packed>& id, - int index, typename _proto_TypeTraits::Repeated::ConstType value) { - _proto_TypeTraits::Set(id.number(), index, value, &_extensions_); -$annotate_repeated_extension_set$ -} - -template -inline typename _proto_TypeTraits::Repeated::MutableType AddExtension( - const ::PROTOBUF_NAMESPACE_ID::internal::ExtensionIdentifier< - $classname$, _proto_TypeTraits, _field_type, _is_packed>& id) { - typename _proto_TypeTraits::Repeated::MutableType to_add = - _proto_TypeTraits::Add(id.number(), _field_type, &_extensions_); -$annotate_repeated_extension_add_mutable$ - return to_add; -} - -template -inline void AddExtension( - const ::PROTOBUF_NAMESPACE_ID::internal::ExtensionIdentifier< - $classname$, _proto_TypeTraits, _field_type, _is_packed>& id, - typename _proto_TypeTraits::Repeated::ConstType value) { - _proto_TypeTraits::Add(id.number(), _field_type, _is_packed, value, - &_extensions_); -$annotate_repeated_extension_add$ -} - -template -inline const typename _proto_TypeTraits::Repeated::RepeatedFieldType& -GetRepeatedExtension( - const ::PROTOBUF_NAMESPACE_ID::internal::ExtensionIdentifier< - $classname$, _proto_TypeTraits, _field_type, _is_packed>& id) const { -$annotate_repeated_extension_list$ - return _proto_TypeTraits::GetRepeated(id.number(), _extensions_); -} - -template -inline typename _proto_TypeTraits::Repeated::RepeatedFieldType* -MutableRepeatedExtension( - const ::PROTOBUF_NAMESPACE_ID::internal::ExtensionIdentifier< - $classname$, _proto_TypeTraits, _field_type, _is_packed>& id) { -$annotate_repeated_extension_list_mutable$ - return _proto_TypeTraits::MutableRepeated(id.number(), _field_type, - _is_packed, &_extensions_); -} - -)"); - // Generate MessageSet specific APIs for proto2 MessageSet. - // For testing purposes we don't check for bridge.MessageSet, so - // we don't use IsProto2MessageSet - if (descriptor_->options().message_set_wire_format() && - !options_.opensource_runtime && !options_.lite_implicit_weak_fields) { - // Special-case MessageSet - format("GOOGLE_PROTOBUF_EXTENSION_MESSAGE_SET_ACCESSORS($classname$)\n"); - } - } - - for (auto oneof : OneOfRange(descriptor_)) { - Formatter::SaveState saver(&format); - format.Set("oneof_name", oneof->name()); - format.Set("camel_oneof_name", UnderscoresToCamelCase(oneof->name(), true)); - format( - "void ${1$clear_$oneof_name$$}$();\n" - "$camel_oneof_name$Case $oneof_name$_case() const;\n", - oneof); - } -} - -void MessageGenerator::GenerateSingularFieldHasBits( - const FieldDescriptor* field, Formatter format) { - if (IsFieldStripped(field, options_)) { - format( - "inline bool $classname$::has_$name$() const { " - "__builtin_trap(); }\n"); - return; - } - if (field->options().weak()) { - format( - "inline bool $classname$::has_$name$() const {\n" - "$annotate_has$" - " return _weak_field_map_.Has($number$);\n" - "}\n"); - return; - } - if (HasHasbit(field)) { - int has_bit_index = HasBitIndex(field); - GOOGLE_CHECK_NE(has_bit_index, kNoHasbit); - - format.Set("has_array_index", has_bit_index / 32); - format.Set("has_mask", - strings::Hex(1u << (has_bit_index % 32), strings::ZERO_PAD_8)); - format( - "inline bool $classname$::_internal_has_$name$() const {\n" - " bool value = " - "(_has_bits_[$has_array_index$] & 0x$has_mask$u) != 0;\n"); - - if (field->cpp_type() == FieldDescriptor::CPPTYPE_MESSAGE && - !IsLazy(field, options_, scc_analyzer_)) { - // We maintain the invariant that for a submessage x, has_x() returning - // true implies that x_ is not null. By giving this information to the - // compiler, we allow it to eliminate unnecessary null checks later on. - format(" PROTOBUF_ASSUME(!value || $name$_ != nullptr);\n"); - } - - format( - " return value;\n" - "}\n" - "inline bool $classname$::has_$name$() const {\n" - "$annotate_has$" - " return _internal_has_$name$();\n" - "}\n"); - } else if (field->cpp_type() == FieldDescriptor::CPPTYPE_MESSAGE) { - // Message fields have a has_$name$() method. - if (IsLazy(field, options_, scc_analyzer_)) { - format( - "inline bool $classname$::_internal_has_$name$() const {\n" - " return !$name$_.IsCleared();\n" - "}\n"); - } else { - format( - "inline bool $classname$::_internal_has_$name$() const {\n" - " return this != internal_default_instance() " - "&& $name$_ != nullptr;\n" - "}\n"); - } - format( - "inline bool $classname$::has_$name$() const {\n" - "$annotate_has$" - " return _internal_has_$name$();\n" - "}\n"); - } -} - -void MessageGenerator::GenerateOneofHasBits(io::Printer* printer) { - Formatter format(printer, variables_); - for (auto oneof : OneOfRange(descriptor_)) { - format.Set("oneof_name", oneof->name()); - format.Set("oneof_index", oneof->index()); - format.Set("cap_oneof_name", ToUpper(oneof->name())); - format( - "inline bool $classname$::has_$oneof_name$() const {\n" - " return $oneof_name$_case() != $cap_oneof_name$_NOT_SET;\n" - "}\n" - "inline void $classname$::clear_has_$oneof_name$() {\n" - " _oneof_case_[$oneof_index$] = $cap_oneof_name$_NOT_SET;\n" - "}\n"); - } -} - -void MessageGenerator::GenerateOneofMemberHasBits(const FieldDescriptor* field, - const Formatter& format) { - if (IsFieldStripped(field, options_)) { - if (HasHasMethod(field)) { - format( - "inline bool $classname$::has_$name$() const { " - "__builtin_trap(); }\n"); - } - format( - "inline void $classname$::set_has_$name$() { __builtin_trap(); " - "}\n"); - return; - } - // Singular field in a oneof - // N.B.: Without field presence, we do not use has-bits or generate - // has_$name$() methods, but oneofs still have set_has_$name$(). - // Oneofs also have has_$name$() but only as a private helper - // method, so that generated code is slightly cleaner (vs. comparing - // _oneof_case_[index] against a constant everywhere). - // - // If has_$name$() is private, there is no need to add an internal accessor. - // Only annotate public accessors. - if (HasHasMethod(field)) { - format( - "inline bool $classname$::_internal_has_$name$() const {\n" - " return $oneof_name$_case() == k$field_name$;\n" - "}\n" - "inline bool $classname$::has_$name$() const {\n" - "$annotate_has$" - " return _internal_has_$name$();\n" - "}\n"); - } else if (HasPrivateHasMethod(field)) { - format( - "inline bool $classname$::_internal_has_$name$() const {\n" - " return $oneof_name$_case() == k$field_name$;\n" - "}\n"); - } - // set_has_$name$() for oneof fields is always private; hence should not be - // annotated. - format( - "inline void $classname$::set_has_$name$() {\n" - " _oneof_case_[$oneof_index$] = k$field_name$;\n" - "}\n"); -} - -void MessageGenerator::GenerateFieldClear(const FieldDescriptor* field, - bool is_inline, Formatter format) { - if (IsFieldStripped(field, options_)) { - format("void $classname$::clear_$name$() { __builtin_trap(); }\n"); - return; - } - - // Generate clear_$name$(). - if (is_inline) { - format("inline "); - } - format("void $classname$::clear_$name$() {\n"); - - format.Indent(); - - if (field->real_containing_oneof()) { - // Clear this field only if it is the active field in this oneof, - // otherwise ignore - format("if (_internal_has_$name$()) {\n"); - format.Indent(); - field_generators_.get(field).GenerateClearingCode(format.printer()); - format("clear_has_$oneof_name$();\n"); - format.Outdent(); - format("}\n"); - } else { - field_generators_.get(field).GenerateClearingCode(format.printer()); - if (HasHasbit(field)) { - int has_bit_index = HasBitIndex(field); - format.Set("has_array_index", has_bit_index / 32); - format.Set("has_mask", - strings::Hex(1u << (has_bit_index % 32), strings::ZERO_PAD_8)); - format("_has_bits_[$has_array_index$] &= ~0x$has_mask$u;\n"); - } - } - format("$annotate_clear$"); - format.Outdent(); - format("}\n"); -} - -void MessageGenerator::GenerateFieldAccessorDefinitions(io::Printer* printer) { - Formatter format(printer, variables_); - format("// $classname$\n\n"); - - for (auto field : FieldRange(descriptor_)) { - PrintFieldComment(format, field); - - if (IsFieldStripped(field, options_)) { - continue; - } - - std::map vars; - SetCommonFieldVariables(field, &vars, options_); - - Formatter::SaveState saver(&format); - format.AddMap(vars); - - // Generate has_$name$() or $name$_size(). - if (field->is_repeated()) { - if (IsFieldStripped(field, options_)) { - format( - "inline int $classname$::$name$_size() const { " - "__builtin_trap(); }\n"); - } else { - format( - "inline int $classname$::_internal_$name$_size() const {\n" - " return $name$_$1$.size();\n" - "}\n" - "inline int $classname$::$name$_size() const {\n" - "$annotate_size$" - " return _internal_$name$_size();\n" - "}\n", - IsImplicitWeakField(field, options_, scc_analyzer_) && - field->message_type() - ? ".weak" - : ""); - } - } else if (field->real_containing_oneof()) { - format.Set("field_name", UnderscoresToCamelCase(field->name(), true)); - format.Set("oneof_name", field->containing_oneof()->name()); - format.Set("oneof_index", - StrCat(field->containing_oneof()->index())); - GenerateOneofMemberHasBits(field, format); - } else { - // Singular field. - GenerateSingularFieldHasBits(field, format); - } - - if (!IsCrossFileMaybeMap(field)) { - GenerateFieldClear(field, true, format); - } - - // Generate type-specific accessors. - if (!IsFieldStripped(field, options_)) { - field_generators_.get(field).GenerateInlineAccessorDefinitions(printer); - } - - format("\n"); - } - - // Generate has_$name$() and clear_has_$name$() functions for oneofs. - GenerateOneofHasBits(printer); -} - -void MessageGenerator::GenerateClassDefinition(io::Printer* printer) { - Formatter format(printer, variables_); - format.Set("class_final", - ShouldMarkClassAsFinal(descriptor_, options_) ? "final" : ""); - - if (IsMapEntryMessage(descriptor_)) { - std::map vars; - CollectMapInfo(options_, descriptor_, &vars); - vars["lite"] = - HasDescriptorMethods(descriptor_->file(), options_) ? "" : "Lite"; - format.AddMap(vars); - format( - "class $classname$ : public " - "::$proto_ns$::internal::MapEntry$lite$<$classname$, \n" - " $key_cpp$, $val_cpp$,\n" - " ::$proto_ns$::internal::WireFormatLite::$key_wire_type$,\n" - " ::$proto_ns$::internal::WireFormatLite::$val_wire_type$> {\n" - "public:\n" - " typedef ::$proto_ns$::internal::MapEntry$lite$<$classname$, \n" - " $key_cpp$, $val_cpp$,\n" - " ::$proto_ns$::internal::WireFormatLite::$key_wire_type$,\n" - " ::$proto_ns$::internal::WireFormatLite::$val_wire_type$> " - "SuperType;\n" - " $classname$();\n" - " explicit constexpr $classname$(\n" - " ::$proto_ns$::internal::ConstantInitialized);\n" - " explicit $classname$(::$proto_ns$::Arena* arena);\n" - " void MergeFrom(const $classname$& other);\n" - " static const $classname$* internal_default_instance() { return " - "reinterpret_cast(&_$classname$_default_instance_); }\n"); - auto utf8_check = GetUtf8CheckMode(descriptor_->field(0), options_); - if (descriptor_->field(0)->type() == FieldDescriptor::TYPE_STRING && - utf8_check != Utf8CheckMode::kNone) { - if (utf8_check == Utf8CheckMode::kStrict) { - format( - " static bool ValidateKey(std::string* s) {\n" - " return ::$proto_ns$::internal::WireFormatLite::" - "VerifyUtf8String(s->data(), static_cast(s->size()), " - "::$proto_ns$::internal::WireFormatLite::PARSE, \"$1$\");\n" - " }\n", - descriptor_->field(0)->full_name()); - } else { - GOOGLE_CHECK(utf8_check == Utf8CheckMode::kVerify); - format( - " static bool ValidateKey(std::string* s) {\n" - "#ifndef NDEBUG\n" - " ::$proto_ns$::internal::WireFormatLite::VerifyUtf8String(\n" - " s->data(), static_cast(s->size()), " - "::$proto_ns$::internal::" - "WireFormatLite::PARSE, \"$1$\");\n" - "#else\n" - " (void) s;\n" - "#endif\n" - " return true;\n" - " }\n", - descriptor_->field(0)->full_name()); - } - } else { - format(" static bool ValidateKey(void*) { return true; }\n"); - } - if (descriptor_->field(1)->type() == FieldDescriptor::TYPE_STRING && - utf8_check != Utf8CheckMode::kNone) { - if (utf8_check == Utf8CheckMode::kStrict) { - format( - " static bool ValidateValue(std::string* s) {\n" - " return ::$proto_ns$::internal::WireFormatLite::" - "VerifyUtf8String(s->data(), static_cast(s->size()), " - "::$proto_ns$::internal::WireFormatLite::PARSE, \"$1$\");\n" - " }\n", - descriptor_->field(1)->full_name()); - } else { - GOOGLE_CHECK(utf8_check == Utf8CheckMode::kVerify); - format( - " static bool ValidateValue(std::string* s) {\n" - "#ifndef NDEBUG\n" - " ::$proto_ns$::internal::WireFormatLite::VerifyUtf8String(\n" - " s->data(), static_cast(s->size()), " - "::$proto_ns$::internal::" - "WireFormatLite::PARSE, \"$1$\");\n" - "#else\n" - " (void) s;\n" - "#endif\n" - " return true;\n" - " }\n", - descriptor_->field(1)->full_name()); - } - } else { - format(" static bool ValidateValue(void*) { return true; }\n"); - } - if (HasDescriptorMethods(descriptor_->file(), options_)) { - format( - " using ::$proto_ns$::Message::MergeFrom;\n" - "" - " ::$proto_ns$::Metadata GetMetadata() const final;\n"); - } - format("};\n"); - return; - } - - format( - "class $dllexport_decl $${1$$classname$$}$$ class_final$ :\n" - " public $superclass$ /* @@protoc_insertion_point(" - "class_definition:$full_name$) */ {\n", - descriptor_); - format(" public:\n"); - format.Indent(); - - if (EnableMessageOwnedArena(descriptor_)) { - format( - "inline $classname$() : $classname$(" - "::$proto_ns$::Arena::InternalHelper<$classname$>::\n" - " CreateMessageOwnedArena(), true) {}\n"); - } else { - format("inline $classname$() : $classname$(nullptr) {}\n"); - } - if (!HasSimpleBaseClass(descriptor_, options_)) { - format("~$classname$() override;\n"); - } - format( - "explicit constexpr " - "$classname$(::$proto_ns$::internal::ConstantInitialized);\n" - "\n" - "$classname$(const $classname$& from);\n" - "$classname$($classname$&& from) noexcept\n" - " : $classname$() {\n" - " *this = ::std::move(from);\n" - "}\n" - "\n" - "inline $classname$& operator=(const $classname$& from) {\n" - " CopyFrom(from);\n" - " return *this;\n" - "}\n" - "inline $classname$& operator=($classname$&& from) noexcept {\n" - " if (this == &from) return *this;\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" - " }\n" - " return *this;\n" - "}\n" - "\n"); - - if (options_.table_driven_serialization) { - format( - "private:\n" - "const void* InternalGetTable() const override;\n" - "public:\n" - "\n"); - } - - if (PublicUnknownFieldsAccessors(descriptor_)) { - format( - "inline const $unknown_fields_type$& unknown_fields() const {\n" - " return $unknown_fields$;\n" - "}\n" - "inline $unknown_fields_type$* mutable_unknown_fields() {\n" - " return $mutable_unknown_fields$;\n" - "}\n" - "\n"); - } - - // Only generate this member if it's not disabled. - if (HasDescriptorMethods(descriptor_->file(), options_) && - !descriptor_->options().no_standard_descriptor_accessor()) { - format( - "static const ::$proto_ns$::Descriptor* descriptor() {\n" - " return GetDescriptor();\n" - "}\n"); - } - - if (HasDescriptorMethods(descriptor_->file(), options_)) { - // These shadow non-static methods of the same names in Message. We - // redefine them here because calls directly on the generated class can be - // statically analyzed -- we know what descriptor types are being requested. - // It also avoids a vtable dispatch. - // - // We would eventually like to eliminate the methods in Message, and having - // this separate also lets us track calls to the base class methods - // separately. - format( - "static const ::$proto_ns$::Descriptor* GetDescriptor() {\n" - " return default_instance().GetMetadata().descriptor;\n" - "}\n" - "static const ::$proto_ns$::Reflection* GetReflection() {\n" - " return default_instance().GetMetadata().reflection;\n" - "}\n"); - } - - format( - "static const $classname$& default_instance() {\n" - " return *internal_default_instance();\n" - "}\n"); - - // Generate enum values for every field in oneofs. One list is generated for - // each oneof with an additional *_NOT_SET value. - for (auto oneof : OneOfRange(descriptor_)) { - format("enum $1$Case {\n", UnderscoresToCamelCase(oneof->name(), true)); - format.Indent(); - for (auto field : FieldRange(oneof)) { - format("$1$ = $2$,\n", OneofCaseConstantName(field), // 1 - field->number()); // 2 - } - format("$1$_NOT_SET = 0,\n", ToUpper(oneof->name())); - format.Outdent(); - format( - "};\n" - "\n"); - } - - // TODO(gerbens) make this private, while still granting other protos access. - format( - "static inline const $classname$* internal_default_instance() {\n" - " return reinterpret_cast(\n" - " &_$classname$_default_instance_);\n" - "}\n" - "static constexpr int kIndexInFileMessages =\n" - " $1$;\n" - "\n", - index_in_file_messages_); - - if (IsAnyMessage(descriptor_, options_)) { - format( - "// implements Any -----------------------------------------------\n" - "\n"); - if (HasDescriptorMethods(descriptor_->file(), options_)) { - format( - "bool PackFrom(const ::$proto_ns$::Message& message) {\n" - " return _any_metadata_.PackFrom(GetArena(), message);\n" - "}\n" - "bool PackFrom(const ::$proto_ns$::Message& message,\n" - " ::PROTOBUF_NAMESPACE_ID::ConstStringParam " - "type_url_prefix) {\n" - " return _any_metadata_.PackFrom(GetArena(), message, " - "type_url_prefix);\n" - "}\n" - "bool UnpackTo(::$proto_ns$::Message* message) const {\n" - " return _any_metadata_.UnpackTo(message);\n" - "}\n" - "static bool GetAnyFieldDescriptors(\n" - " const ::$proto_ns$::Message& message,\n" - " const ::$proto_ns$::FieldDescriptor** type_url_field,\n" - " const ::$proto_ns$::FieldDescriptor** value_field);\n" - "template " - "::value>::type>\n" - "bool PackFrom(const T& message) {\n" - " return _any_metadata_.PackFrom(GetArena(), message);\n" - "}\n" - "template " - "::value>::type>\n" - "bool PackFrom(const T& message,\n" - " ::PROTOBUF_NAMESPACE_ID::ConstStringParam " - "type_url_prefix) {\n" - " return _any_metadata_.PackFrom(GetArena(), message, " - "type_url_prefix);" - "}\n" - "template " - "::value>::type>\n" - "bool UnpackTo(T* message) const {\n" - " return _any_metadata_.UnpackTo(message);\n" - "}\n"); - } else { - format( - "template \n" - "bool PackFrom(const T& message) {\n" - " return _any_metadata_.PackFrom(GetArena(), message);\n" - "}\n" - "template \n" - "bool PackFrom(const T& message,\n" - " ::PROTOBUF_NAMESPACE_ID::ConstStringParam " - "type_url_prefix) {\n" - " return _any_metadata_.PackFrom(GetArena(), message, " - "type_url_prefix);\n" - "}\n" - "template \n" - "bool UnpackTo(T* message) const {\n" - " return _any_metadata_.UnpackTo(message);\n" - "}\n"); - } - format( - "template bool Is() const {\n" - " return _any_metadata_.Is();\n" - "}\n" - "static bool ParseAnyTypeUrl(::PROTOBUF_NAMESPACE_ID::ConstStringParam " - "type_url,\n" - " std::string* full_type_name);\n"); - } - - format( - "friend void swap($classname$& a, $classname$& b) {\n" - " a.Swap(&b);\n" - "}\n" - "inline void Swap($classname$* other) {\n" - " if (other == this) return;\n" - "#ifdef PROTOBUF_FORCE_COPY_IN_SWAP\n" - " if (GetOwningArena() != nullptr &&\n" - " GetOwningArena() == other->GetOwningArena()) {\n " - "#else // PROTOBUF_FORCE_COPY_IN_SWAP\n" - " if (GetOwningArena() == other->GetOwningArena()) {\n" - "#endif // !PROTOBUF_FORCE_COPY_IN_SWAP\n" - " InternalSwap(other);\n" - " } else {\n" - " ::PROTOBUF_NAMESPACE_ID::internal::GenericSwap(this, other);\n" - " }\n" - "}\n" - "void UnsafeArenaSwap($classname$* other) {\n" - " if (other == this) return;\n" - " $DCHK$(GetOwningArena() == other->GetOwningArena());\n" - " InternalSwap(other);\n" - "}\n"); - - format( - "\n" - "// implements Message ----------------------------------------------\n" - "\n" - "$classname$* New(::$proto_ns$::Arena* arena = nullptr) const final {\n" - " return CreateMaybeMessage<$classname$>(arena);\n" - "}\n"); - - // For instances that derive from Message (rather than MessageLite), some - // methods are virtual and should be marked as final. - format.Set("full_final", HasDescriptorMethods(descriptor_->file(), options_) - ? "final" - : ""); - - if (HasGeneratedMethods(descriptor_->file(), options_)) { - if (HasDescriptorMethods(descriptor_->file(), options_)) { - if (!HasSimpleBaseClass(descriptor_, options_)) { - format( - // Use Message's built-in MergeFrom and CopyFrom when the passed-in - // argument is a generic Message instance, and only define the - // custom MergeFrom and CopyFrom instances when the source of the - // merge/copy is known to be the same class as the destination. - // TODO(jorg): Define MergeFrom in terms of MergeImpl, rather than - // the other way around, to save even more code size. - "using $superclass$::CopyFrom;\n" - "void CopyFrom(const $classname$& from);\n" - "" - "using $superclass$::MergeFrom;\n" - "void MergeFrom(const $classname$& from);\n" - "private:\n" - "static void MergeImpl(::$proto_ns$::Message* to, const " - "::$proto_ns$::Message& from);\n" - "public:\n"); - } else { - format( - "using $superclass$::CopyFrom;\n" - "inline void CopyFrom(const $classname$& from) {\n" - " $superclass$::CopyImpl(this, from);\n" - "}\n" - "" - "using $superclass$::MergeFrom;\n" - "void MergeFrom(const $classname$& from) {\n" - " $superclass$::MergeImpl(this, from);\n" - "}\n" - "public:\n"); - } - } else { - format( - "void CheckTypeAndMergeFrom(const ::$proto_ns$::MessageLite& from)" - " final;\n" - "void CopyFrom(const $classname$& from);\n" - "void MergeFrom(const $classname$& from);\n"); - } - - if (!HasSimpleBaseClass(descriptor_, options_)) { - format( - "PROTOBUF_ATTRIBUTE_REINITIALIZES void Clear() final;\n" - "bool IsInitialized() const final;\n" - "\n" - "size_t ByteSizeLong() const final;\n"); - - parse_function_generator_->GenerateMethodDecls(printer); - - format( - "$uint8$* _InternalSerialize(\n" - " $uint8$* target, ::$proto_ns$::io::EpsCopyOutputStream* stream) " - "const final;\n"); - } - } - - if (options_.field_listener_options.inject_field_listener_events) { - format("static constexpr int _kInternalFieldNumber = $1$;\n", - descriptor_->field_count()); - } - - if (!HasSimpleBaseClass(descriptor_, options_)) { - format( - "int GetCachedSize() const final { return _cached_size_.Get(); }" - "\n\nprivate:\n" - "void SharedCtor();\n" - "void SharedDtor();\n" - "void SetCachedSize(int size) const$ full_final$;\n" - "void InternalSwap($classname$* other);\n"); - } - - format( - // Friend AnyMetadata so that it can call this FullMessageName() method. - "\nprivate:\n" - "friend class ::$proto_ns$::internal::AnyMetadata;\n" - "static $1$ FullMessageName() {\n" - " return \"$full_name$\";\n" - "}\n", - options_.opensource_runtime ? "::PROTOBUF_NAMESPACE_ID::StringPiece" - : "::StringPiece"); - - format( - // TODO(gerbens) Make this private! Currently people are deriving from - // protos to give access to this constructor, breaking the invariants - // we rely on. - "protected:\n" - "explicit $classname$(::$proto_ns$::Arena* arena,\n" - " bool is_message_owned = false);\n" - "private:\n"); - - if (!HasSimpleBaseClass(descriptor_, options_)) { - format( - "static void ArenaDtor(void* object);\n" - "inline void RegisterArenaDtor(::$proto_ns$::Arena* arena);\n"); - } - - format( - "public:\n" - "\n"); - - if (HasDescriptorMethods(descriptor_->file(), options_)) { - if (HasGeneratedMethods(descriptor_->file(), options_)) { - format( - "static const ClassData _class_data_;\n" - "const ::$proto_ns$::Message::ClassData*" - "GetClassData() const final;\n" - "\n"); - } - format( - "::$proto_ns$::Metadata GetMetadata() const final;\n" - "\n"); - } else { - format( - "std::string GetTypeName() const final;\n" - "\n"); - } - - format( - "// nested types ----------------------------------------------------\n" - "\n"); - - // Import all nested message classes into this class's scope with typedefs. - for (int i = 0; i < descriptor_->nested_type_count(); i++) { - const Descriptor* nested_type = descriptor_->nested_type(i); - if (!IsMapEntryMessage(nested_type)) { - format.Set("nested_full_name", ClassName(nested_type, false)); - format.Set("nested_name", ResolveKeyword(nested_type->name())); - format("typedef ${1$$nested_full_name$$}$ ${1$$nested_name$$}$;\n", - nested_type); - } - } - - if (descriptor_->nested_type_count() > 0) { - format("\n"); - } - - // Import all nested enums and their values into this class's scope with - // typedefs and constants. - for (int i = 0; i < descriptor_->enum_type_count(); i++) { - enum_generators_[i]->GenerateSymbolImports(printer); - format("\n"); - } - - format( - "// accessors -------------------------------------------------------\n" - "\n"); - - // Generate accessor methods for all fields. - GenerateFieldAccessorDeclarations(printer); - - // Declare extension identifiers. - for (int i = 0; i < descriptor_->extension_count(); i++) { - extension_generators_[i]->GenerateDeclaration(printer); - } - - - format("// @@protoc_insertion_point(class_scope:$full_name$)\n"); - - // Generate private members. - format.Outdent(); - format(" private:\n"); - format.Indent(); - // TODO(seongkim): Remove hack to track field access and remove this class. - format("class _Internal;\n"); - - for (auto field : FieldRange(descriptor_)) { - // set_has_***() generated in all oneofs. - if (!field->is_repeated() && !field->options().weak() && - field->real_containing_oneof()) { - format("void set_has_$1$();\n", FieldName(field)); - } - } - format("\n"); - - // Generate oneof function declarations - for (auto oneof : OneOfRange(descriptor_)) { - format( - "inline bool has_$1$() const;\n" - "inline void clear_has_$1$();\n\n", - oneof->name()); - } - - if (HasGeneratedMethods(descriptor_->file(), options_) && - !descriptor_->options().message_set_wire_format() && - num_required_fields_ > 1) { - format( - "// helper for ByteSizeLong()\n" - "size_t RequiredFieldsByteSizeFallback() const;\n\n"); - } - - if (HasGeneratedMethods(descriptor_->file(), options_)) { - parse_function_generator_->GenerateDataDecls(printer); - } - - // Prepare decls for _cached_size_ and _has_bits_. Their position in the - // output will be determined later. - - bool need_to_emit_cached_size = true; - const std::string cached_size_decl = - "mutable ::$proto_ns$::internal::CachedSize _cached_size_;\n"; - - const size_t sizeof_has_bits = HasBitsSize(); - const std::string has_bits_decl = - sizeof_has_bits == 0 ? "" - : StrCat("::$proto_ns$::internal::HasBits<", - sizeof_has_bits, "> _has_bits_;\n"); - - // To minimize padding, data members are divided into three sections: - // (1) members assumed to align to 8 bytes - // (2) members corresponding to message fields, re-ordered to optimize - // alignment. - // (3) members assumed to align to 4 bytes. - - // Members assumed to align to 8 bytes: - - if (descriptor_->extension_range_count() > 0) { - format( - "::$proto_ns$::internal::ExtensionSet _extensions_;\n" - "\n"); - } - - if (options_.field_listener_options.inject_field_listener_events && - descriptor_->file()->options().optimize_for() != - google::protobuf::FileOptions::LITE_RUNTIME) { - format("static ::$proto_ns$::AccessListener<$1$> _tracker_;\n", - ClassName(descriptor_)); - } - - // Generate _inlined_string_donated_ for inlined string type. - // TODO(congliu): To avoid affecting the locality of `_has_bits_`, should this - // be below or above `_has_bits_`? - if (!inlined_string_indices_.empty()) { - format("::$proto_ns$::internal::HasBits<$1$> _inlined_string_donated_;\n", - InlinedStringDonatedSize()); - } - - format( - "template friend class " - "::$proto_ns$::Arena::InternalHelper;\n" - "typedef void InternalArenaConstructable_;\n" - "typedef void DestructorSkippable_;\n"); - - if (!has_bit_indices_.empty()) { - // _has_bits_ is frequently accessed, so to reduce code size and improve - // speed, it should be close to the start of the object. Placing - // _cached_size_ together with _has_bits_ improves cache locality despite - // potential alignment padding. - format(has_bits_decl.c_str()); - format(cached_size_decl.c_str()); - need_to_emit_cached_size = false; - } - - // Field members: - - // Emit some private and static members - for (auto field : optimized_order_) { - const FieldGenerator& generator = field_generators_.get(field); - generator.GenerateStaticMembers(printer); - generator.GeneratePrivateMembers(printer); - } - - // For each oneof generate a union - for (auto oneof : OneOfRange(descriptor_)) { - std::string camel_oneof_name = UnderscoresToCamelCase(oneof->name(), true); - format("union $1$Union {\n", camel_oneof_name); - format.Indent(); - format( - // explicit empty constructor is needed when union contains - // ArenaStringPtr members for string fields. - "constexpr $1$Union() : _constinit_{} {}\n" - " ::$proto_ns$::internal::ConstantInitialized _constinit_;\n", - camel_oneof_name); - for (auto field : FieldRange(oneof)) { - if (!IsFieldStripped(field, options_)) { - field_generators_.get(field).GeneratePrivateMembers(printer); - } - } - format.Outdent(); - format("} $1$_;\n", oneof->name()); - for (auto field : FieldRange(oneof)) { - if (!IsFieldStripped(field, options_)) { - field_generators_.get(field).GenerateStaticMembers(printer); - } - } - } - - // Members assumed to align to 4 bytes: - - if (need_to_emit_cached_size) { - format(cached_size_decl.c_str()); - need_to_emit_cached_size = false; - } - - // Generate _oneof_case_. - if (descriptor_->real_oneof_decl_count() > 0) { - format( - "$uint32$ _oneof_case_[$1$];\n" - "\n", - descriptor_->real_oneof_decl_count()); - } - - if (num_weak_fields_) { - format("::$proto_ns$::internal::WeakFieldMap _weak_field_map_;\n"); - } - // Generate _any_metadata_ for the Any type. - if (IsAnyMessage(descriptor_, options_)) { - format("::$proto_ns$::internal::AnyMetadata _any_metadata_;\n"); - } - - // The TableStruct struct needs access to the private parts, in order to - // construct the offsets of all members. - format("friend struct ::$tablename$;\n"); - - format.Outdent(); - format("};"); - GOOGLE_DCHECK(!need_to_emit_cached_size); -} // NOLINT(readability/fn_size) - -void MessageGenerator::GenerateInlineMethods(io::Printer* printer) { - if (IsMapEntryMessage(descriptor_)) return; - GenerateFieldAccessorDefinitions(printer); - - // Generate oneof_case() functions. - for (auto oneof : OneOfRange(descriptor_)) { - Formatter format(printer, variables_); - format.Set("camel_oneof_name", UnderscoresToCamelCase(oneof->name(), true)); - format.Set("oneof_name", oneof->name()); - format.Set("oneof_index", oneof->index()); - format( - "inline $classname$::$camel_oneof_name$Case $classname$::" - "${1$$oneof_name$_case$}$() const {\n" - " return $classname$::$camel_oneof_name$Case(" - "_oneof_case_[$oneof_index$]);\n" - "}\n", - oneof); - } -} - -bool MessageGenerator::GenerateParseTable(io::Printer* printer, size_t offset, - size_t aux_offset) { - Formatter format(printer, variables_); - - if (!table_driven_) { - format("{ nullptr, nullptr, 0, -1, -1, -1, -1, nullptr, false },\n"); - return false; - } - - int max_field_number = 0; - for (auto field : FieldRange(descriptor_)) { - if (max_field_number < field->number()) { - max_field_number = field->number(); - } - } - - format("{\n"); - format.Indent(); - - format( - "$tablename$::entries + $1$,\n" - "$tablename$::aux + $2$,\n" - "$3$,\n", - offset, aux_offset, max_field_number); - - if (has_bit_indices_.empty()) { - // If no fields have hasbits, then _has_bits_ does not exist. - format("-1,\n"); - } else { - format("PROTOBUF_FIELD_OFFSET($classtype$, _has_bits_),\n"); - } - - if (descriptor_->real_oneof_decl_count() > 0) { - format("PROTOBUF_FIELD_OFFSET($classtype$, _oneof_case_),\n"); - } else { - format("-1, // no _oneof_case_\n"); - } - - if (descriptor_->extension_range_count() > 0) { - format("PROTOBUF_FIELD_OFFSET($classtype$, _extensions_),\n"); - } else { - format("-1, // no _extensions_\n"); - } - - // TODO(ckennelly): Consolidate this with the calculation for - // AuxiliaryParseTableField. - format( - "PROTOBUF_FIELD_OFFSET($classtype$, _internal_metadata_),\n" - "&$package_ns$::_$classname$_default_instance_,\n"); - - if (UseUnknownFieldSet(descriptor_->file(), options_)) { - format("true,\n"); - } else { - format("false,\n"); - } - - format.Outdent(); - format("},\n"); - return true; -} - -void MessageGenerator::GenerateSchema(io::Printer* printer, int offset, - int has_offset) { - Formatter format(printer, variables_); - has_offset = !has_bit_indices_.empty() || IsMapEntryMessage(descriptor_) - ? offset + has_offset - : -1; - int inlined_string_indices_offset; - if (inlined_string_indices_.empty()) { - inlined_string_indices_offset = -1; - } else { - GOOGLE_DCHECK_NE(has_offset, -1); - GOOGLE_DCHECK(!IsMapEntryMessage(descriptor_)); - inlined_string_indices_offset = has_offset + has_bit_indices_.size(); - } - - format("{ $1$, $2$, $3$, sizeof($classtype$)},\n", offset, has_offset, - inlined_string_indices_offset); -} - -namespace { - -// We need to calculate for each field what function the table driven code -// should use to serialize it. This returns the index in a lookup table. -uint32_t CalcFieldNum(const FieldGenerator& generator, - const FieldDescriptor* field, const Options& options) { - bool is_a_map = IsMapEntryMessage(field->containing_type()); - int type = field->type(); - if (type == FieldDescriptor::TYPE_STRING || - type == FieldDescriptor::TYPE_BYTES) { - // string field - if (generator.IsInlined()) { - type = internal::FieldMetadata::kInlinedType; - } else if (IsCord(field, options)) { - type = internal::FieldMetadata::kCordType; - } else if (IsStringPiece(field, options)) { - type = internal::FieldMetadata::kStringPieceType; - } - } - - if (field->real_containing_oneof()) { - return internal::FieldMetadata::CalculateType( - type, internal::FieldMetadata::kOneOf); - } else if (field->is_packed()) { - return internal::FieldMetadata::CalculateType( - type, internal::FieldMetadata::kPacked); - } else if (field->is_repeated()) { - return internal::FieldMetadata::CalculateType( - type, internal::FieldMetadata::kRepeated); - } else if (HasHasbit(field) || field->real_containing_oneof() || is_a_map) { - return internal::FieldMetadata::CalculateType( - type, internal::FieldMetadata::kPresence); - } else { - return internal::FieldMetadata::CalculateType( - type, internal::FieldMetadata::kNoPresence); - } -} - -int FindMessageIndexInFile(const Descriptor* descriptor) { - std::vector flatten = - FlattenMessagesInFile(descriptor->file()); - return std::find(flatten.begin(), flatten.end(), descriptor) - - flatten.begin(); -} - -} // namespace - -int MessageGenerator::GenerateFieldMetadata(io::Printer* printer) { - Formatter format(printer, variables_); - if (!options_.table_driven_serialization) { - return 0; - } - - std::vector sorted = SortFieldsByNumber(descriptor_); - if (IsMapEntryMessage(descriptor_)) { - for (int i = 0; i < 2; i++) { - const FieldDescriptor* field = sorted[i]; - const FieldGenerator& generator = field_generators_.get(field); - - uint32_t tag = internal::WireFormatLite::MakeTag( - field->number(), WireFormat::WireTypeForFieldType(field->type())); - - std::map vars; - vars["classtype"] = QualifiedClassName(descriptor_, options_); - vars["field_name"] = FieldName(field); - vars["tag"] = StrCat(tag); - vars["hasbit"] = StrCat(i); - vars["type"] = StrCat(CalcFieldNum(generator, field, options_)); - vars["ptr"] = "nullptr"; - if (field->cpp_type() == FieldDescriptor::CPPTYPE_MESSAGE) { - GOOGLE_CHECK(!IsMapEntryMessage(field->message_type())); - vars["ptr"] = - "::" + UniqueName("TableStruct", field->message_type(), options_) + - "::serialization_table + " + - StrCat(FindMessageIndexInFile(field->message_type())); - } - Formatter::SaveState saver(&format); - format.AddMap(vars); - format( - "{PROTOBUF_FIELD_OFFSET(" - "::$proto_ns$::internal::MapEntryHelper<$classtype$::" - "SuperType>, $field_name$_), $tag$," - "PROTOBUF_FIELD_OFFSET(" - "::$proto_ns$::internal::MapEntryHelper<$classtype$::" - "SuperType>, _has_bits_) * 8 + $hasbit$, $type$, " - "$ptr$},\n"); - } - return 2; - } - format( - "{PROTOBUF_FIELD_OFFSET($classtype$, _cached_size_)," - " 0, 0, 0, nullptr},\n"); - std::vector sorted_extensions; - sorted_extensions.reserve(descriptor_->extension_range_count()); - for (int i = 0; i < descriptor_->extension_range_count(); ++i) { - sorted_extensions.push_back(descriptor_->extension_range(i)); - } - std::sort(sorted_extensions.begin(), sorted_extensions.end(), - ExtensionRangeSorter()); - for (int i = 0, extension_idx = 0; /* no range */; i++) { - for (; extension_idx < sorted_extensions.size() && - (i == sorted.size() || - sorted_extensions[extension_idx]->start < sorted[i]->number()); - extension_idx++) { - const Descriptor::ExtensionRange* range = - sorted_extensions[extension_idx]; - format( - "{PROTOBUF_FIELD_OFFSET($classtype$, _extensions_), " - "$1$, $2$, ::$proto_ns$::internal::FieldMetadata::kSpecial, " - "reinterpret_cast(::$proto_ns$::internal::ExtensionSerializer)},\n", - range->start, range->end); - } - if (i == sorted.size()) break; - const FieldDescriptor* field = sorted[i]; - - uint32_t tag = internal::WireFormatLite::MakeTag( - field->number(), WireFormat::WireTypeForFieldType(field->type())); - if (field->is_packed()) { - tag = internal::WireFormatLite::MakeTag( - field->number(), WireFormatLite::WIRETYPE_LENGTH_DELIMITED); - } - - std::string classfieldname = FieldName(field); - if (field->real_containing_oneof()) { - classfieldname = field->containing_oneof()->name(); - } - format.Set("field_name", classfieldname); - std::string ptr = "nullptr"; - if (field->cpp_type() == FieldDescriptor::CPPTYPE_MESSAGE) { - if (IsMapEntryMessage(field->message_type())) { - format( - "{PROTOBUF_FIELD_OFFSET($classtype$, $field_name$_), $1$, $2$, " - "::$proto_ns$::internal::FieldMetadata::kSpecial, " - "reinterpret_cast(static_cast< " - "::$proto_ns$::internal::SpecialSerializer>(" - "::$proto_ns$::internal::MapFieldSerializer< " - "::$proto_ns$::internal::MapEntryToMapField<" - "$3$>::MapFieldType, " - "$tablename$::serialization_table>))},\n", - tag, FindMessageIndexInFile(field->message_type()), - QualifiedClassName(field->message_type(), options_)); - continue; - } else if (!field->message_type()->options().message_set_wire_format()) { - // message_set doesn't have the usual table and we need to - // dispatch to generated serializer, hence ptr stays zero. - ptr = - "::" + UniqueName("TableStruct", field->message_type(), options_) + - "::serialization_table + " + - StrCat(FindMessageIndexInFile(field->message_type())); - } - } - - const FieldGenerator& generator = field_generators_.get(field); - int type = CalcFieldNum(generator, field, options_); - - if (IsLazy(field, options_, scc_analyzer_)) { - type = internal::FieldMetadata::kSpecial; - ptr = "reinterpret_cast(::" + variables_["proto_ns"] + - "::internal::LazyFieldSerializer"; - if (field->real_containing_oneof()) { - ptr += "OneOf"; - } else if (!HasHasbit(field)) { - ptr += "NoPresence"; - } - ptr += ")"; - } - - if (field->options().weak()) { - // TODO(gerbens) merge weak fields into ranges - format( - "{PROTOBUF_FIELD_OFFSET(" - "$classtype$, _weak_field_map_), $1$, $1$, " - "::$proto_ns$::internal::FieldMetadata::kSpecial, " - "reinterpret_cast(::$proto_ns$::internal::WeakFieldSerializer)},\n", - tag); - } else if (field->real_containing_oneof()) { - format.Set("oneofoffset", - sizeof(uint32_t) * field->containing_oneof()->index()); - format( - "{PROTOBUF_FIELD_OFFSET($classtype$, $field_name$_), $1$," - " PROTOBUF_FIELD_OFFSET($classtype$, _oneof_case_) + " - "$oneofoffset$, $2$, $3$},\n", - tag, type, ptr); - } else if (HasHasbit(field)) { - format.Set("hasbitsoffset", has_bit_indices_[field->index()]); - format( - "{PROTOBUF_FIELD_OFFSET($classtype$, $field_name$_), " - "$1$, PROTOBUF_FIELD_OFFSET($classtype$, _has_bits_) * 8 + " - "$hasbitsoffset$, $2$, $3$},\n", - tag, type, ptr); - } else { - format( - "{PROTOBUF_FIELD_OFFSET($classtype$, $field_name$_), " - "$1$, ~0u, $2$, $3$},\n", - tag, type, ptr); - } - } - int num_field_metadata = 1 + sorted.size() + sorted_extensions.size(); - num_field_metadata++; - std::string serializer = UseUnknownFieldSet(descriptor_->file(), options_) - ? "UnknownFieldSetSerializer" - : "UnknownFieldSerializerLite"; - format( - "{PROTOBUF_FIELD_OFFSET($classtype$, _internal_metadata_), 0, ~0u, " - "::$proto_ns$::internal::FieldMetadata::kSpecial, reinterpret_cast(::$proto_ns$::internal::$1$)},\n", - serializer); - return num_field_metadata; -} - -void MessageGenerator::GenerateClassMethods(io::Printer* printer) { - Formatter format(printer, variables_); - if (IsMapEntryMessage(descriptor_)) { - format( - "$classname$::$classname$() {}\n" - "$classname$::$classname$(::$proto_ns$::Arena* arena)\n" - " : SuperType(arena) {}\n" - "void $classname$::MergeFrom(const $classname$& other) {\n" - " MergeFromInternal(other);\n" - "}\n"); - if (HasDescriptorMethods(descriptor_->file(), options_)) { - if (!descriptor_->options().map_entry()) { - format( - "::$proto_ns$::Metadata $classname$::GetMetadata() const {\n" - "$annotate_reflection$" - " return ::$proto_ns$::internal::AssignDescriptors(\n" - " &$desc_table$_getter, &$desc_table$_once,\n" - " $file_level_metadata$[$1$]);\n" - "}\n", - index_in_file_messages_); - } else { - format( - "::$proto_ns$::Metadata $classname$::GetMetadata() const {\n" - " return ::$proto_ns$::internal::AssignDescriptors(\n" - " &$desc_table$_getter, &$desc_table$_once,\n" - " $file_level_metadata$[$1$]);\n" - "}\n", - index_in_file_messages_); - } - } - return; - } - - if (IsAnyMessage(descriptor_, options_)) { - if (HasDescriptorMethods(descriptor_->file(), options_)) { - format( - "bool $classname$::GetAnyFieldDescriptors(\n" - " const ::$proto_ns$::Message& message,\n" - " const ::$proto_ns$::FieldDescriptor** type_url_field,\n" - " const ::$proto_ns$::FieldDescriptor** value_field) {\n" - " return ::$proto_ns$::internal::GetAnyFieldDescriptors(\n" - " message, type_url_field, value_field);\n" - "}\n"); - } - format( - "bool $classname$::ParseAnyTypeUrl(\n" - " ::PROTOBUF_NAMESPACE_ID::ConstStringParam type_url,\n" - " std::string* full_type_name) {\n" - " return ::$proto_ns$::internal::ParseAnyTypeUrl(type_url,\n" - " full_type_name);\n" - "}\n" - "\n"); - } - - format( - "class $classname$::_Internal {\n" - " public:\n"); - format.Indent(); - if (!has_bit_indices_.empty()) { - format( - "using HasBits = decltype(std::declval<$classname$>()._has_bits_);\n"); - } - for (auto field : FieldRange(descriptor_)) { - field_generators_.get(field).GenerateInternalAccessorDeclarations(printer); - if (IsFieldStripped(field, options_)) { - continue; - } - if (HasHasbit(field)) { - int has_bit_index = HasBitIndex(field); - GOOGLE_CHECK_NE(has_bit_index, kNoHasbit) << field->full_name(); - format( - "static void set_has_$1$(HasBits* has_bits) {\n" - " (*has_bits)[$2$] |= $3$u;\n" - "}\n", - FieldName(field), has_bit_index / 32, (1u << (has_bit_index % 32))); - } - } - if (num_required_fields_ > 0) { - const std::vector masks_for_has_bits = RequiredFieldsBitMask(); - format( - "static bool MissingRequiredFields(const HasBits& has_bits) " - "{\n" - " return $1$;\n" - "}\n", - ConditionalToCheckBitmasks(masks_for_has_bits, false, "has_bits")); - } - - format.Outdent(); - format("};\n\n"); - for (auto field : FieldRange(descriptor_)) { - if (!IsFieldStripped(field, options_)) { - field_generators_.get(field).GenerateInternalAccessorDefinitions(printer); - } - } - - // Generate non-inline field definitions. - for (auto field : FieldRange(descriptor_)) { - if (IsFieldStripped(field, options_)) { - continue; - } - field_generators_.get(field).GenerateNonInlineAccessorDefinitions(printer); - if (IsCrossFileMaybeMap(field)) { - Formatter::SaveState saver(&format); - std::map vars; - SetCommonFieldVariables(field, &vars, options_); - if (field->real_containing_oneof()) { - SetCommonOneofFieldVariables(field, &vars); - } - format.AddMap(vars); - GenerateFieldClear(field, false, format); - } - } - - GenerateStructors(printer); - format("\n"); - - if (descriptor_->real_oneof_decl_count() > 0) { - GenerateOneofClear(printer); - format("\n"); - } - - if (HasGeneratedMethods(descriptor_->file(), options_)) { - GenerateClear(printer); - format("\n"); - - if (!HasSimpleBaseClass(descriptor_, options_)) { - parse_function_generator_->GenerateMethodImpls(printer); - format("\n"); - - parse_function_generator_->GenerateDataDefinitions(printer); - } - - GenerateSerializeWithCachedSizesToArray(printer); - format("\n"); - - GenerateByteSize(printer); - format("\n"); - - GenerateMergeFrom(printer); - format("\n"); - - GenerateClassSpecificMergeFrom(printer); - format("\n"); - - GenerateCopyFrom(printer); - format("\n"); - - GenerateIsInitialized(printer); - format("\n"); - } - - GenerateVerify(printer); - - GenerateSwap(printer); - format("\n"); - - if (options_.table_driven_serialization) { - format( - "const void* $classname$::InternalGetTable() const {\n" - " return ::$tablename$::serialization_table + $1$;\n" - "}\n" - "\n", - index_in_file_messages_); - } - if (HasDescriptorMethods(descriptor_->file(), options_)) { - if (!descriptor_->options().map_entry()) { - format( - "::$proto_ns$::Metadata $classname$::GetMetadata() const {\n" - "$annotate_reflection$" - " return ::$proto_ns$::internal::AssignDescriptors(\n" - " &$desc_table$_getter, &$desc_table$_once,\n" - " $file_level_metadata$[$1$]);\n" - "}\n", - index_in_file_messages_); - } else { - format( - "::$proto_ns$::Metadata $classname$::GetMetadata() const {\n" - " return ::$proto_ns$::internal::AssignDescriptors(\n" - " &$desc_table$_getter, &$desc_table$_once,\n" - " $file_level_metadata$[$1$]);\n" - "}\n", - index_in_file_messages_); - } - } else { - format( - "std::string $classname$::GetTypeName() const {\n" - " return \"$full_name$\";\n" - "}\n" - "\n"); - } - - if (options_.field_listener_options.inject_field_listener_events && - descriptor_->file()->options().optimize_for() != - google::protobuf::FileOptions::LITE_RUNTIME) { - format( - "::$proto_ns$::AccessListener<$classtype$> " - "$1$::_tracker_(&FullMessageName);\n", - ClassName(descriptor_)); - } -} - -size_t MessageGenerator::GenerateParseOffsets(io::Printer* printer) { - Formatter format(printer, variables_); - - if (!table_driven_) { - return 0; - } - - // Field "0" is special: We use it in our switch statement of processing - // types to handle the successful end tag case. - format("{0, 0, 0, ::$proto_ns$::internal::kInvalidMask, 0, 0},\n"); - int last_field_number = 1; - - std::vector ordered_fields = - SortFieldsByNumber(descriptor_); - - for (auto field : ordered_fields) { - Formatter::SaveState saver(&format); - GOOGLE_CHECK_GE(field->number(), last_field_number); - - for (; last_field_number < field->number(); last_field_number++) { - format( - "{ 0, 0, ::$proto_ns$::internal::kInvalidMask,\n" - " ::$proto_ns$::internal::kInvalidMask, 0, 0 },\n"); - } - last_field_number++; - - unsigned char normal_wiretype, packed_wiretype, processing_type; - normal_wiretype = WireFormat::WireTypeForFieldType(field->type()); - - if (field->is_packable()) { - packed_wiretype = WireFormatLite::WIRETYPE_LENGTH_DELIMITED; - } else { - packed_wiretype = internal::kNotPackedMask; - } - - processing_type = static_cast(field->type()); - const FieldGenerator& generator = field_generators_.get(field); - if (field->type() == FieldDescriptor::TYPE_STRING) { - switch (EffectiveStringCType(field, options_)) { - case FieldOptions::STRING: - if (generator.IsInlined()) { - processing_type = internal::TYPE_STRING_INLINED; - } - break; - case FieldOptions::CORD: - processing_type = internal::TYPE_STRING_CORD; - break; - case FieldOptions::STRING_PIECE: - processing_type = internal::TYPE_STRING_STRING_PIECE; - break; - } - } else if (field->type() == FieldDescriptor::TYPE_BYTES) { - switch (EffectiveStringCType(field, options_)) { - case FieldOptions::STRING: - if (generator.IsInlined()) { - processing_type = internal::TYPE_BYTES_INLINED; - } - break; - case FieldOptions::CORD: - processing_type = internal::TYPE_BYTES_CORD; - break; - case FieldOptions::STRING_PIECE: - processing_type = internal::TYPE_BYTES_STRING_PIECE; - break; - } - } - - processing_type |= static_cast( - field->is_repeated() ? internal::kRepeatedMask : 0); - processing_type |= static_cast( - field->real_containing_oneof() ? internal::kOneofMask : 0); - - if (field->is_map()) { - processing_type = internal::TYPE_MAP; - } - - const unsigned char tag_size = - WireFormat::TagSize(field->number(), field->type()); - - std::map vars; - if (field->real_containing_oneof()) { - vars["name"] = field->containing_oneof()->name(); - vars["presence"] = StrCat(field->containing_oneof()->index()); - } else { - vars["name"] = FieldName(field); - vars["presence"] = StrCat(has_bit_indices_[field->index()]); - } - vars["nwtype"] = StrCat(normal_wiretype); - vars["pwtype"] = StrCat(packed_wiretype); - vars["ptype"] = StrCat(processing_type); - vars["tag_size"] = StrCat(tag_size); - - format.AddMap(vars); - - format( - "{\n" - " PROTOBUF_FIELD_OFFSET($classtype$, $name$_),\n" - " static_cast<$uint32$>($presence$),\n" - " $nwtype$, $pwtype$, $ptype$, $tag_size$\n" - "},\n"); - } - - return last_field_number; -} - -size_t MessageGenerator::GenerateParseAuxTable(io::Printer* printer) { - Formatter format(printer, variables_); - - if (!table_driven_) { - return 0; - } - - std::vector ordered_fields = - SortFieldsByNumber(descriptor_); - - format("::$proto_ns$::internal::AuxiliaryParseTableField(),\n"); - int last_field_number = 1; - for (auto field : ordered_fields) { - Formatter::SaveState saver(&format); - - GOOGLE_CHECK_GE(field->number(), last_field_number); - for (; last_field_number < field->number(); last_field_number++) { - format("::$proto_ns$::internal::AuxiliaryParseTableField(),\n"); - } - - std::map vars; - SetCommonFieldVariables(field, &vars, options_); - format.AddMap(vars); - - switch (field->cpp_type()) { - case FieldDescriptor::CPPTYPE_ENUM: - if (HasPreservingUnknownEnumSemantics(field)) { - format( - "{::$proto_ns$::internal::AuxiliaryParseTableField::enum_aux{" - "nullptr}},\n"); - } else { - format( - "{::$proto_ns$::internal::AuxiliaryParseTableField::enum_aux{" - "$1$_IsValid}},\n", - ClassName(field->enum_type(), true)); - } - last_field_number++; - break; - case FieldDescriptor::CPPTYPE_MESSAGE: { - if (field->is_map()) { - format( - "{::$proto_ns$::internal::AuxiliaryParseTableField::map_" - "aux{&::$proto_ns$::internal::ParseMap<$1$>}},\n", - QualifiedClassName(field->message_type(), options_)); - last_field_number++; - break; - } - format.Set("field_classname", ClassName(field->message_type(), false)); - format.Set("default_instance", QualifiedDefaultInstanceName( - field->message_type(), options_)); - - format( - "{::$proto_ns$::internal::AuxiliaryParseTableField::message_aux{\n" - " &$default_instance$}},\n"); - last_field_number++; - break; - } - case FieldDescriptor::CPPTYPE_STRING: { - std::string default_val; - switch (EffectiveStringCType(field, options_)) { - case FieldOptions::STRING: - default_val = field->default_value_string().empty() - ? "&::" + variables_["proto_ns"] + - "::internal::fixed_address_empty_string" - : "&" + - QualifiedClassName(descriptor_, options_) + - "::" + MakeDefaultName(field); - break; - case FieldOptions::CORD: - case FieldOptions::STRING_PIECE: - default_val = - "\"" + CEscape(field->default_value_string()) + "\""; - break; - } - format( - "{::$proto_ns$::internal::AuxiliaryParseTableField::string_aux{\n" - " $1$,\n" - " \"$2$\"\n" - "}},\n", - default_val, field->full_name()); - last_field_number++; - break; - } - default: - break; - } - } - - return last_field_number; -} - -std::pair MessageGenerator::GenerateOffsets( - io::Printer* printer) { - Formatter format(printer, variables_); - - if (!has_bit_indices_.empty() || IsMapEntryMessage(descriptor_)) { - format("PROTOBUF_FIELD_OFFSET($classtype$, _has_bits_),\n"); - } else { - format("~0u, // no _has_bits_\n"); - } - format("PROTOBUF_FIELD_OFFSET($classtype$, _internal_metadata_),\n"); - if (descriptor_->extension_range_count() > 0) { - format("PROTOBUF_FIELD_OFFSET($classtype$, _extensions_),\n"); - } else { - format("~0u, // no _extensions_\n"); - } - if (descriptor_->real_oneof_decl_count() > 0) { - format("PROTOBUF_FIELD_OFFSET($classtype$, _oneof_case_[0]),\n"); - } else { - format("~0u, // no _oneof_case_\n"); - } - if (num_weak_fields_ > 0) { - format("PROTOBUF_FIELD_OFFSET($classtype$, _weak_field_map_),\n"); - } else { - format("~0u, // no _weak_field_map_\n"); - } - if (!inlined_string_indices_.empty()) { - format("PROTOBUF_FIELD_OFFSET($classtype$, _inlined_string_donated_),\n"); - } else { - format("~0u, // no _inlined_string_donated_\n"); - } - const int kNumGenericOffsets = 6; // the number of fixed offsets above - const size_t offsets = kNumGenericOffsets + descriptor_->field_count() + - descriptor_->real_oneof_decl_count(); - size_t entries = offsets; - for (auto field : FieldRange(descriptor_)) { - if (IsFieldStripped(field, options_)) { - format("~0u, // stripped\n"); - continue; - } - // TODO(sbenza): We should not have an entry in the offset table for fields - // that do not use them. - if (field->options().weak() || field->real_containing_oneof()) { - // Mark the field to prevent unintentional access through reflection. - // Don't use the top bit because that is for unused fields. - format("::$proto_ns$::internal::kInvalidFieldOffsetTag"); - } else { - format("PROTOBUF_FIELD_OFFSET($classtype$, $1$_)", FieldName(field)); - } - - // Some information about a field is in the pdproto profile. The profile is - // only available at compile time. So we embed such information in the - // offset of the field, so that the information is available when - // reflectively accessing the field at run time. - // - // Embed whether the field is used to the MSB of the offset. - if (!IsFieldUsed(field, options_)) { - format(" | 0x80000000u // unused\n"); - } - - // Embed whether the field is eagerly verified lazy or inlined string to the - // LSB of the offset. - if (IsEagerlyVerifiedLazy(field, options_, scc_analyzer_)) { - format(" | 0x1u // eagerly verified lazy\n"); - } else if (IsStringInlined(field, options_)) { - format(" | 0x1u // inlined\n"); - } - format(",\n"); - } - - int count = 0; - for (auto oneof : OneOfRange(descriptor_)) { - format("PROTOBUF_FIELD_OFFSET($classtype$, $1$_),\n", oneof->name()); - count++; - } - GOOGLE_CHECK_EQ(count, descriptor_->real_oneof_decl_count()); - - if (IsMapEntryMessage(descriptor_)) { - entries += 2; - format( - "0,\n" - "1,\n"); - } else if (!has_bit_indices_.empty()) { - entries += has_bit_indices_.size(); - for (int i = 0; i < has_bit_indices_.size(); i++) { - const std::string index = - has_bit_indices_[i] >= 0 ? StrCat(has_bit_indices_[i]) : "~0u"; - format("$1$,\n", index); - } - } - if (!inlined_string_indices_.empty()) { - entries += inlined_string_indices_.size(); - for (int inlined_string_indice : inlined_string_indices_) { - const std::string index = inlined_string_indice >= 0 - ? StrCat(inlined_string_indice) - : "~0u"; - format("$1$,\n", index); - } - } - - return std::make_pair(entries, offsets); -} - -void MessageGenerator::GenerateSharedConstructorCode(io::Printer* printer) { - if (HasSimpleBaseClass(descriptor_, options_)) return; - Formatter format(printer, variables_); - - format("inline void $classname$::SharedCtor() {\n"); - - std::vector processed(optimized_order_.size(), false); - GenerateConstructorBody(printer, processed, false); - - for (auto oneof : OneOfRange(descriptor_)) { - format("clear_has_$1$();\n", oneof->name()); - } - - format("}\n\n"); -} - -void MessageGenerator::GenerateSharedDestructorCode(io::Printer* printer) { - if (HasSimpleBaseClass(descriptor_, options_)) return; - Formatter format(printer, variables_); - - format("inline void $classname$::SharedDtor() {\n"); - format.Indent(); - format("$DCHK$(GetArenaForAllocation() == nullptr);\n"); - // Write the destructors for each field except oneof members. - // optimized_order_ does not contain oneof fields. - for (auto field : optimized_order_) { - field_generators_.get(field).GenerateDestructorCode(printer); - } - - // Generate code to destruct oneofs. Clearing should do the work. - for (auto oneof : OneOfRange(descriptor_)) { - format( - "if (has_$1$()) {\n" - " clear_$1$();\n" - "}\n", - oneof->name()); - } - - if (num_weak_fields_) { - format("_weak_field_map_.ClearAll();\n"); - } - format.Outdent(); - format( - "}\n" - "\n"); -} - -void MessageGenerator::GenerateArenaDestructorCode(io::Printer* printer) { - if (HasSimpleBaseClass(descriptor_, options_)) return; - Formatter format(printer, variables_); - - // Generate the ArenaDtor() method. Track whether any fields actually produced - // code that needs to be called. - format("void $classname$::ArenaDtor(void* object) {\n"); - format.Indent(); - - // This code is placed inside a static method, rather than an ordinary one, - // since that simplifies Arena's destructor list (ordinary function pointers - // rather than member function pointers). _this is the object being - // destructed. - format( - "$classname$* _this = reinterpret_cast< $classname$* >(object);\n" - // avoid an "unused variable" warning in case no fields have dtor code. - "(void)_this;\n"); - - bool need_registration = false; - // Process non-oneof fields first. - for (auto field : optimized_order_) { - if (field_generators_.get(field).GenerateArenaDestructorCode(printer)) { - need_registration = true; - } - } - - // Process oneof fields. - // - // Note: As of 10/5/2016, GenerateArenaDestructorCode does not emit anything - // and returns false for oneof fields. - for (auto oneof : OneOfRange(descriptor_)) { - for (auto field : FieldRange(oneof)) { - if (!IsFieldStripped(field, options_) && - field_generators_.get(field).GenerateArenaDestructorCode(printer)) { - need_registration = true; - } - } - } - - format.Outdent(); - format("}\n"); - - if (need_registration) { - format( - "inline void $classname$::RegisterArenaDtor(::$proto_ns$::Arena* " - "arena) {\n" - " if (arena != nullptr) {\n" - " arena->OwnCustomDestructor(this, &$classname$::ArenaDtor);\n" - " }\n" - "}\n"); - } else { - format( - "void $classname$::RegisterArenaDtor(::$proto_ns$::Arena*) {\n" - "}\n"); - } -} - -void MessageGenerator::GenerateConstexprConstructor(io::Printer* printer) { - Formatter format(printer, variables_); - - format( - "constexpr $classname$::$classname$(\n" - " ::$proto_ns$::internal::ConstantInitialized)"); - format.Indent(); - const char* field_sep = ":"; - const auto put_sep = [&] { - format("\n$1$ ", field_sep); - field_sep = ","; - }; - - if (!IsMapEntryMessage(descriptor_)) { - // Process non-oneof fields first. - for (auto field : optimized_order_) { - auto& gen = field_generators_.get(field); - put_sep(); - gen.GenerateConstinitInitializer(printer); - } - - if (IsAnyMessage(descriptor_, options_)) { - put_sep(); - format("_any_metadata_(&type_url_, &value_)"); - } - - if (descriptor_->real_oneof_decl_count() != 0) { - put_sep(); - format("_oneof_case_{}"); - } - } - - format.Outdent(); - format("{}\n"); -} - -void MessageGenerator::GenerateConstructorBody(io::Printer* printer, - std::vector processed, - bool copy_constructor) const { - Formatter format(printer, variables_); - - const RunMap runs = FindRuns( - optimized_order_, [copy_constructor, this](const FieldDescriptor* field) { - return (copy_constructor && IsPOD(field)) || - (!copy_constructor && - CanBeManipulatedAsRawBytes(field, options_, scc_analyzer_)); - }); - - std::string pod_template; - if (copy_constructor) { - pod_template = - "::memcpy(&$first$_, &from.$first$_,\n" - " static_cast(reinterpret_cast(&$last$_) -\n" - " reinterpret_cast(&$first$_)) + sizeof($last$_));\n"; - } else { - pod_template = - "::memset(reinterpret_cast(this) + static_cast(\n" - " reinterpret_cast(&$first$_) - " - "reinterpret_cast(this)),\n" - " 0, static_cast(reinterpret_cast(&$last$_) -\n" - " reinterpret_cast(&$first$_)) + sizeof($last$_));\n"; - } - - for (int i = 0; i < optimized_order_.size(); ++i) { - if (processed[i]) { - continue; - } - - const FieldDescriptor* field = optimized_order_[i]; - const auto it = runs.find(field); - - // We only apply the memset technique to runs of more than one field, as - // assignment is better than memset for generated code clarity. - if (it != runs.end() && it->second > 1) { - // Use a memset, then skip run_length fields. - const size_t run_length = it->second; - const std::string first_field_name = FieldName(field); - const std::string last_field_name = - FieldName(optimized_order_[i + run_length - 1]); - - format.Set("first", first_field_name); - format.Set("last", last_field_name); - - format(pod_template.c_str()); - - i += run_length - 1; - // ++i at the top of the loop. - } else { - if (copy_constructor) { - field_generators_.get(field).GenerateCopyConstructorCode(printer); - } else { - field_generators_.get(field).GenerateConstructorCode(printer); - } - } - } -} - -void MessageGenerator::GenerateStructors(io::Printer* printer) { - Formatter format(printer, variables_); - - std::string superclass; - superclass = SuperClassName(descriptor_, options_); - std::string initializer_with_arena = superclass + "(arena, is_message_owned)"; - - if (descriptor_->extension_range_count() > 0) { - initializer_with_arena += ",\n _extensions_(arena)"; - } - - // Initialize member variables with arena constructor. - for (auto field : optimized_order_) { - GOOGLE_DCHECK(!IsFieldStripped(field, options_)); - bool has_arena_constructor = field->is_repeated(); - if (!field->real_containing_oneof() && - (IsLazy(field, options_, scc_analyzer_) || - IsStringPiece(field, options_) || - (IsString(field, options_) && IsStringInlined(field, options_)))) { - has_arena_constructor = true; - } - if (has_arena_constructor) { - initializer_with_arena += - std::string(",\n ") + FieldName(field) + std::string("_(arena)"); - } - } - - if (IsAnyMessage(descriptor_, options_)) { - initializer_with_arena += ",\n _any_metadata_(&type_url_, &value_)"; - } - if (num_weak_fields_ > 0) { - initializer_with_arena += ", _weak_field_map_(arena)"; - } - - std::string initializer_null = superclass + "()"; - if (IsAnyMessage(descriptor_, options_)) { - initializer_null += ", _any_metadata_(&type_url_, &value_)"; - } - if (num_weak_fields_ > 0) { - initializer_null += ", _weak_field_map_(nullptr)"; - } - - format( - "$classname$::$classname$(::$proto_ns$::Arena* arena,\n" - " bool is_message_owned)\n" - " : $1$ {\n", - initializer_with_arena); - - if (!inlined_string_indices_.empty()) { - // Donate inline string fields. - format(" if (arena != nullptr) {\n"); - for (size_t i = 0; i < InlinedStringDonatedSize(); ++i) { - format(" _inlined_string_donated_[$1$] = ~0u;\n", i); - } - format(" }\n"); - } - - if (!HasSimpleBaseClass(descriptor_, options_)) { - format( - " SharedCtor();\n" - " if (!is_message_owned) {\n" - " RegisterArenaDtor(arena);\n" - " }\n"); - } - format( - " // @@protoc_insertion_point(arena_constructor:$full_name$)\n" - "}\n"); - - std::map vars; - SetUnknownFieldsVariable(descriptor_, options_, &vars); - format.AddMap(vars); - - // Generate the copy constructor. - if (UsingImplicitWeakFields(descriptor_->file(), options_)) { - // If we are in lite mode and using implicit weak fields, we generate a - // one-liner copy constructor that delegates to MergeFrom. This saves some - // code size and also cuts down on the complexity of implicit weak fields. - // We might eventually want to do this for all lite protos. - format( - "$classname$::$classname$(const $classname$& from)\n" - " : $classname$() {\n" - " MergeFrom(from);\n" - "}\n"); - } else { - format( - "$classname$::$classname$(const $classname$& from)\n" - " : $superclass$()"); - format.Indent(); - format.Indent(); - format.Indent(); - - // Do not copy inlined_string_donated_, because this is not an arena - // constructor. - - if (!has_bit_indices_.empty()) { - format(",\n_has_bits_(from._has_bits_)"); - } - - std::vector processed(optimized_order_.size(), false); - for (int i = 0; i < optimized_order_.size(); i++) { - auto field = optimized_order_[i]; - if (!(field->is_repeated() && !(field->is_map())) && - !IsCord(field, options_)) { - continue; - } - - processed[i] = true; - format(",\n$1$_(from.$1$_)", FieldName(field)); - } - - if (IsAnyMessage(descriptor_, options_)) { - format(",\n_any_metadata_(&type_url_, &value_)"); - } - if (num_weak_fields_ > 0) { - format(",\n_weak_field_map_(from._weak_field_map_)"); - } - - format.Outdent(); - format.Outdent(); - format(" {\n"); - - format( - "_internal_metadata_.MergeFrom<$unknown_fields_type$>(from._internal_" - "metadata_);\n"); - - if (descriptor_->extension_range_count() > 0) { - format( - "_extensions_.MergeFrom(internal_default_instance(), " - "from._extensions_);\n"); - } - - GenerateConstructorBody(printer, processed, true); - - // Copy oneof fields. Oneof field requires oneof case check. - for (auto oneof : OneOfRange(descriptor_)) { - format( - "clear_has_$1$();\n" - "switch (from.$1$_case()) {\n", - oneof->name()); - format.Indent(); - for (auto field : FieldRange(oneof)) { - format("case k$1$: {\n", UnderscoresToCamelCase(field->name(), true)); - format.Indent(); - if (!IsFieldStripped(field, options_)) { - field_generators_.get(field).GenerateMergingCode(printer); - } - format("break;\n"); - format.Outdent(); - format("}\n"); - } - format( - "case $1$_NOT_SET: {\n" - " break;\n" - "}\n", - ToUpper(oneof->name())); - format.Outdent(); - format("}\n"); - } - - format.Outdent(); - format( - " // @@protoc_insertion_point(copy_constructor:$full_name$)\n" - "}\n" - "\n"); - } - - // Generate the shared constructor code. - GenerateSharedConstructorCode(printer); - - // Generate the destructor. - if (!HasSimpleBaseClass(descriptor_, options_)) { - format( - "$classname$::~$classname$() {\n" - " // @@protoc_insertion_point(destructor:$full_name$)\n" - " if (GetArenaForAllocation() != nullptr) return;\n" - " SharedDtor();\n" - " _internal_metadata_.Delete<$unknown_fields_type$>();\n" - "}\n" - "\n"); - } else { - // For messages using simple base classes, having no destructor - // allows our vtable to share the same destructor as every other - // message with a simple base class. This works only as long as - // we have no fields needing destruction, of course. (No strings - // or extensions) - } - - // Generate the shared destructor code. - GenerateSharedDestructorCode(printer); - - // Generate the arena-specific destructor code. - GenerateArenaDestructorCode(printer); - - if (!HasSimpleBaseClass(descriptor_, options_)) { - // Generate SetCachedSize. - format( - "void $classname$::SetCachedSize(int size) const {\n" - " _cached_size_.Set(size);\n" - "}\n"); - } -} - -void MessageGenerator::GenerateSourceInProto2Namespace(io::Printer* printer) { - Formatter format(printer, variables_); - format( - "template<> " - "PROTOBUF_NOINLINE " - "$classtype$* Arena::CreateMaybeMessage< $classtype$ >(Arena* arena) {\n" - " return Arena::CreateMessageInternal< $classtype$ >(arena);\n" - "}\n"); -} - -void MessageGenerator::GenerateClear(io::Printer* printer) { - if (HasSimpleBaseClass(descriptor_, options_)) return; - Formatter format(printer, variables_); - - // The maximum number of bytes we will memset to zero without checking their - // hasbit to see if a zero-init is necessary. - const int kMaxUnconditionalPrimitiveBytesClear = 4; - - format( - "void $classname$::Clear() {\n" - "// @@protoc_insertion_point(message_clear_start:$full_name$)\n"); - format.Indent(); - - format( - // TODO(jwb): It would be better to avoid emitting this if it is not used, - // rather than emitting a workaround for the resulting warning. - "$uint32$ cached_has_bits = 0;\n" - "// Prevent compiler warnings about cached_has_bits being unused\n" - "(void) cached_has_bits;\n\n"); - - if (descriptor_->extension_range_count() > 0) { - format("_extensions_.Clear();\n"); - } - - // Collect fields into chunks. Each chunk may have an if() condition that - // checks all hasbits in the chunk and skips it if none are set. - int zero_init_bytes = 0; - for (const auto& field : optimized_order_) { - if (CanInitializeByZeroing(field)) { - zero_init_bytes += EstimateAlignmentSize(field); - } - } - bool merge_zero_init = zero_init_bytes > kMaxUnconditionalPrimitiveBytesClear; - int chunk_count = 0; - - std::vector> chunks = CollectFields( - optimized_order_, - [&](const FieldDescriptor* a, const FieldDescriptor* b) -> bool { - chunk_count++; - // This predicate guarantees that there is only a single zero-init - // (memset) per chunk, and if present it will be at the beginning. - bool same = HasByteIndex(a) == HasByteIndex(b) && - a->is_repeated() == b->is_repeated() && - (CanInitializeByZeroing(a) == CanInitializeByZeroing(b) || - (CanInitializeByZeroing(a) && - (chunk_count == 1 || merge_zero_init))); - if (!same) chunk_count = 0; - return same; - }); - - ColdChunkSkipper cold_skipper(options_, chunks, has_bit_indices_, kColdRatio); - int cached_has_word_index = -1; - - for (int chunk_index = 0; chunk_index < chunks.size(); chunk_index++) { - std::vector& chunk = chunks[chunk_index]; - cold_skipper.OnStartChunk(chunk_index, cached_has_word_index, "", printer); - - const FieldDescriptor* memset_start = nullptr; - const FieldDescriptor* memset_end = nullptr; - bool saw_non_zero_init = false; - - for (const auto& field : chunk) { - if (CanInitializeByZeroing(field)) { - GOOGLE_CHECK(!saw_non_zero_init); - if (!memset_start) memset_start = field; - memset_end = field; - } else { - saw_non_zero_init = true; - } - } - - // Whether we wrap this chunk in: - // if (cached_has_bits & 1 && - (memset_end != chunk.back() || merge_zero_init); - - if (have_outer_if) { - // Emit an if() that will let us skip the whole chunk if none are set. - uint32_t chunk_mask = GenChunkMask(chunk, has_bit_indices_); - std::string chunk_mask_str = - StrCat(strings::Hex(chunk_mask, strings::ZERO_PAD_8)); - - // Check (up to) 8 has_bits at a time if we have more than one field in - // this chunk. Due to field layout ordering, we may check - // _has_bits_[last_chunk * 8 / 32] multiple times. - GOOGLE_DCHECK_LE(2, popcnt(chunk_mask)); - GOOGLE_DCHECK_GE(8, popcnt(chunk_mask)); - - if (cached_has_word_index != HasWordIndex(chunk.front())) { - cached_has_word_index = HasWordIndex(chunk.front()); - format("cached_has_bits = _has_bits_[$1$];\n", cached_has_word_index); - } - format("if (cached_has_bits & 0x$1$u) {\n", chunk_mask_str); - format.Indent(); - } - - if (memset_start) { - if (memset_start == memset_end) { - // For clarity, do not memset a single field. - field_generators_.get(memset_start) - .GenerateMessageClearingCode(printer); - } else { - format( - "::memset(&$1$_, 0, static_cast(\n" - " reinterpret_cast(&$2$_) -\n" - " reinterpret_cast(&$1$_)) + sizeof($2$_));\n", - FieldName(memset_start), FieldName(memset_end)); - } - } - - // Clear all non-zero-initializable fields in the chunk. - for (const auto& field : chunk) { - if (CanInitializeByZeroing(field)) continue; - // It's faster to just overwrite primitive types, but we should only - // clear strings and messages if they were set. - // - // TODO(kenton): Let the CppFieldGenerator decide this somehow. - bool have_enclosing_if = - HasBitIndex(field) != kNoHasbit && - (field->cpp_type() == FieldDescriptor::CPPTYPE_MESSAGE || - field->cpp_type() == FieldDescriptor::CPPTYPE_STRING); - - if (have_enclosing_if) { - PrintPresenceCheck(format, field, has_bit_indices_, printer, - &cached_has_word_index); - } - - field_generators_.get(field).GenerateMessageClearingCode(printer); - - if (have_enclosing_if) { - format.Outdent(); - format("}\n"); - } - } - - if (have_outer_if) { - format.Outdent(); - format("}\n"); - } - - if (cold_skipper.OnEndChunk(chunk_index, printer)) { - // Reset here as it may have been updated in just closed if statement. - cached_has_word_index = -1; - } - } - - // Step 4: Unions. - for (auto oneof : OneOfRange(descriptor_)) { - format("clear_$1$();\n", oneof->name()); - } - - if (num_weak_fields_) { - format("_weak_field_map_.ClearAll();\n"); - } - - // We don't clear donated status. - - if (!has_bit_indices_.empty()) { - // Step 5: Everything else. - format("_has_bits_.Clear();\n"); - } - - std::map vars; - SetUnknownFieldsVariable(descriptor_, options_, &vars); - format.AddMap(vars); - format("_internal_metadata_.Clear<$unknown_fields_type$>();\n"); - - format.Outdent(); - format("}\n"); -} - -void MessageGenerator::GenerateOneofClear(io::Printer* printer) { - // Generated function clears the active field and union case (e.g. foo_case_). - int i = 0; - for (auto oneof : OneOfRange(descriptor_)) { - Formatter format(printer, variables_); - format.Set("oneofname", oneof->name()); - - format( - "void $classname$::clear_$oneofname$() {\n" - "// @@protoc_insertion_point(one_of_clear_start:$full_name$)\n"); - format.Indent(); - format("switch ($oneofname$_case()) {\n"); - format.Indent(); - for (auto field : FieldRange(oneof)) { - format("case k$1$: {\n", UnderscoresToCamelCase(field->name(), true)); - format.Indent(); - // We clear only allocated objects in oneofs - if (!IsStringOrMessage(field) || IsFieldStripped(field, options_)) { - format("// No need to clear\n"); - } else { - field_generators_.get(field).GenerateClearingCode(printer); - } - format("break;\n"); - format.Outdent(); - format("}\n"); - } - format( - "case $1$_NOT_SET: {\n" - " break;\n" - "}\n", - ToUpper(oneof->name())); - format.Outdent(); - format( - "}\n" - "_oneof_case_[$1$] = $2$_NOT_SET;\n", - i, ToUpper(oneof->name())); - format.Outdent(); - format( - "}\n" - "\n"); - i++; - } -} - -void MessageGenerator::GenerateSwap(io::Printer* printer) { - if (HasSimpleBaseClass(descriptor_, options_)) return; - Formatter format(printer, variables_); - - format("void $classname$::InternalSwap($classname$* other) {\n"); - format.Indent(); - format("using std::swap;\n"); - - if (HasGeneratedMethods(descriptor_->file(), options_)) { - if (descriptor_->extension_range_count() > 0) { - format("_extensions_.InternalSwap(&other->_extensions_);\n"); - } - - std::map vars; - SetUnknownFieldsVariable(descriptor_, options_, &vars); - format.AddMap(vars); - if (HasSingularString(descriptor_, options_)) { - format( - "auto* lhs_arena = GetArenaForAllocation();\n" - "auto* rhs_arena = other->GetArenaForAllocation();\n"); - } - format("_internal_metadata_.InternalSwap(&other->_internal_metadata_);\n"); - - if (!has_bit_indices_.empty()) { - for (int i = 0; i < HasBitsSize(); ++i) { - format("swap(_has_bits_[$1$], other->_has_bits_[$1$]);\n", i); - } - } - - // If possible, we swap several fields at once, including padding. - const RunMap runs = - FindRuns(optimized_order_, [this](const FieldDescriptor* field) { - return CanBeManipulatedAsRawBytes(field, options_, scc_analyzer_); - }); - - for (int i = 0; i < optimized_order_.size(); ++i) { - const FieldDescriptor* field = optimized_order_[i]; - const auto it = runs.find(field); - - // We only apply the memswap technique to runs of more than one field, as - // `swap(field_, other.field_)` is better than - // `memswap<...>(&field_, &other.field_)` for generated code readability. - if (it != runs.end() && it->second > 1) { - // Use a memswap, then skip run_length fields. - const size_t run_length = it->second; - const std::string first_field_name = FieldName(field); - const std::string last_field_name = - FieldName(optimized_order_[i + run_length - 1]); - - format.Set("first", first_field_name); - format.Set("last", last_field_name); - - format( - "::PROTOBUF_NAMESPACE_ID::internal::memswap<\n" - " PROTOBUF_FIELD_OFFSET($classname$, $last$_)\n" - " + sizeof($classname$::$last$_)\n" - " - PROTOBUF_FIELD_OFFSET($classname$, $first$_)>(\n" - " reinterpret_cast(&$first$_),\n" - " reinterpret_cast(&other->$first$_));\n"); - - i += run_length - 1; - // ++i at the top of the loop. - } else { - field_generators_.get(field).GenerateSwappingCode(printer); - } - } - - for (auto oneof : OneOfRange(descriptor_)) { - format("swap($1$_, other->$1$_);\n", oneof->name()); - } - - for (int i = 0; i < descriptor_->real_oneof_decl_count(); i++) { - format("swap(_oneof_case_[$1$], other->_oneof_case_[$1$]);\n", i); - } - - if (num_weak_fields_) { - format("_weak_field_map_.UnsafeArenaSwap(&other->_weak_field_map_);\n"); - } - } else { - format("GetReflection()->Swap(this, other);"); - } - - format.Outdent(); - format("}\n"); -} - -void MessageGenerator::GenerateMergeFrom(io::Printer* printer) { - Formatter format(printer, variables_); - if (!HasSimpleBaseClass(descriptor_, options_)) { - if (HasDescriptorMethods(descriptor_->file(), options_)) { - // We don't override the generalized MergeFrom (aka that which - // takes in the Message base class as a parameter); instead we just - // let the base Message::MergeFrom take care of it. The base MergeFrom - // knows how to quickly confirm the types exactly match, and if so, will - // use GetClassData() to retrieve the address of MergeImpl, which calls - // the fast MergeFrom overload. Most callers avoid all this by passing - // a "from" message that is the same type as the message being merged - // into, rather than a generic Message. - - format( - "const ::$proto_ns$::Message::ClassData " - "$classname$::_class_data_ = {\n" - " ::$proto_ns$::Message::CopyWithSizeCheck,\n" - " $classname$::MergeImpl\n" - "};\n" - "const ::$proto_ns$::Message::ClassData*" - "$classname$::GetClassData() const { return &_class_data_; }\n" - "\n" - "void $classname$::MergeImpl(::$proto_ns$::Message* to,\n" - " const ::$proto_ns$::Message& from) {\n" - " static_cast<$classname$ *>(to)->MergeFrom(\n" - " static_cast(from));\n" - "}\n" - "\n"); - } else { - // Generate CheckTypeAndMergeFrom(). - format( - "void $classname$::CheckTypeAndMergeFrom(\n" - " const ::$proto_ns$::MessageLite& from) {\n" - " MergeFrom(*::$proto_ns$::internal::DownCast(\n" - " &from));\n" - "}\n"); - } - } else { - // In the simple case, we just define ClassData that vectors back to the - // simple implementation of Copy and Merge. - format( - "const ::$proto_ns$::Message::ClassData " - "$classname$::_class_data_ = {\n" - " $superclass$::CopyImpl,\n" - " $superclass$::MergeImpl,\n" - "};\n" - "const ::$proto_ns$::Message::ClassData*" - "$classname$::GetClassData() const { return &_class_data_; }\n" - "\n" - "\n"); - } -} - -void MessageGenerator::GenerateClassSpecificMergeFrom(io::Printer* printer) { - if (HasSimpleBaseClass(descriptor_, options_)) return; - // Generate the class-specific MergeFrom, which avoids the GOOGLE_CHECK and cast. - Formatter format(printer, variables_); - format( - "void $classname$::MergeFrom(const $classname$& from) {\n" - "$annotate_mergefrom$" - "// @@protoc_insertion_point(class_specific_merge_from_start:" - "$full_name$)\n" - " $DCHK$_NE(&from, this);\n"); - format.Indent(); - - format( - "$uint32$ cached_has_bits = 0;\n" - "(void) cached_has_bits;\n\n"); - - std::vector> chunks = CollectFields( - optimized_order_, - [&](const FieldDescriptor* a, const FieldDescriptor* b) -> bool { - return HasByteIndex(a) == HasByteIndex(b); - }); - - ColdChunkSkipper cold_skipper(options_, chunks, has_bit_indices_, kColdRatio); - - // cached_has_word_index maintains that: - // cached_has_bits = from._has_bits_[cached_has_word_index] - // for cached_has_word_index >= 0 - int cached_has_word_index = -1; - - for (int chunk_index = 0; chunk_index < chunks.size(); chunk_index++) { - const std::vector& chunk = chunks[chunk_index]; - bool have_outer_if = - chunk.size() > 1 && HasByteIndex(chunk.front()) != kNoHasbit; - cold_skipper.OnStartChunk(chunk_index, cached_has_word_index, "from.", - printer); - - if (have_outer_if) { - // Emit an if() that will let us skip the whole chunk if none are set. - uint32_t chunk_mask = GenChunkMask(chunk, has_bit_indices_); - std::string chunk_mask_str = - StrCat(strings::Hex(chunk_mask, strings::ZERO_PAD_8)); - - // Check (up to) 8 has_bits at a time if we have more than one field in - // this chunk. Due to field layout ordering, we may check - // _has_bits_[last_chunk * 8 / 32] multiple times. - GOOGLE_DCHECK_LE(2, popcnt(chunk_mask)); - GOOGLE_DCHECK_GE(8, popcnt(chunk_mask)); - - if (cached_has_word_index != HasWordIndex(chunk.front())) { - cached_has_word_index = HasWordIndex(chunk.front()); - format("cached_has_bits = from._has_bits_[$1$];\n", - cached_has_word_index); - } - - format("if (cached_has_bits & 0x$1$u) {\n", chunk_mask_str); - format.Indent(); - } - - // Go back and emit merging code for each of the fields we processed. - bool deferred_has_bit_changes = false; - for (const auto field : chunk) { - const FieldGenerator& generator = field_generators_.get(field); - - if (field->is_repeated()) { - generator.GenerateMergingCode(printer); - } else if (field->is_optional() && !HasHasbit(field)) { - // Merge semantics without true field presence: primitive fields are - // merged only if non-zero (numeric) or non-empty (string). - bool have_enclosing_if = - EmitFieldNonDefaultCondition(printer, "from.", field); - generator.GenerateMergingCode(printer); - if (have_enclosing_if) { - format.Outdent(); - format("}\n"); - } - } else if (field->options().weak() || - cached_has_word_index != HasWordIndex(field)) { - // Check hasbit, not using cached bits. - GOOGLE_CHECK(HasHasbit(field)); - format("if (from._internal_has_$1$()) {\n", FieldName(field)); - format.Indent(); - generator.GenerateMergingCode(printer); - format.Outdent(); - format("}\n"); - } else { - // Check hasbit, using cached bits. - GOOGLE_CHECK(HasHasbit(field)); - int has_bit_index = has_bit_indices_[field->index()]; - const std::string mask = StrCat( - strings::Hex(1u << (has_bit_index % 32), strings::ZERO_PAD_8)); - format("if (cached_has_bits & 0x$1$u) {\n", mask); - format.Indent(); - - if (have_outer_if && IsPOD(field)) { - // Defer hasbit modification until the end of chunk. - // This can reduce the number of loads/stores by up to 7 per 8 fields. - deferred_has_bit_changes = true; - generator.GenerateCopyConstructorCode(printer); - } else { - generator.GenerateMergingCode(printer); - } - - format.Outdent(); - format("}\n"); - } - } - - if (have_outer_if) { - if (deferred_has_bit_changes) { - // Flush the has bits for the primitives we deferred. - GOOGLE_CHECK_LE(0, cached_has_word_index); - format("_has_bits_[$1$] |= cached_has_bits;\n", cached_has_word_index); - } - - format.Outdent(); - format("}\n"); - } - - if (cold_skipper.OnEndChunk(chunk_index, printer)) { - // Reset here as it may have been updated in just closed if statement. - cached_has_word_index = -1; - } - } - - // Merge oneof fields. Oneof field requires oneof case check. - for (auto oneof : OneOfRange(descriptor_)) { - format("switch (from.$1$_case()) {\n", oneof->name()); - format.Indent(); - for (auto field : FieldRange(oneof)) { - format("case k$1$: {\n", UnderscoresToCamelCase(field->name(), true)); - format.Indent(); - if (!IsFieldStripped(field, options_)) { - field_generators_.get(field).GenerateMergingCode(printer); - } - format("break;\n"); - format.Outdent(); - format("}\n"); - } - format( - "case $1$_NOT_SET: {\n" - " break;\n" - "}\n", - ToUpper(oneof->name())); - format.Outdent(); - format("}\n"); - } - if (num_weak_fields_) { - format("_weak_field_map_.MergeFrom(from._weak_field_map_);\n"); - } - - // Merging of extensions and unknown fields is done last, to maximize - // the opportunity for tail calls. - if (descriptor_->extension_range_count() > 0) { - format( - "_extensions_.MergeFrom(internal_default_instance(), " - "from._extensions_);\n"); - } - - format( - "_internal_metadata_.MergeFrom<$unknown_fields_type$>(from._internal_" - "metadata_);\n"); - - format.Outdent(); - format("}\n"); -} - -void MessageGenerator::GenerateCopyFrom(io::Printer* printer) { - if (HasSimpleBaseClass(descriptor_, options_)) return; - Formatter format(printer, variables_); - if (HasDescriptorMethods(descriptor_->file(), options_)) { - // We don't override the generalized CopyFrom (aka that which - // takes in the Message base class as a parameter); instead we just - // let the base Message::CopyFrom take care of it. The base MergeFrom - // knows how to quickly confirm the types exactly match, and if so, will - // use GetClassData() to get the address of Message::CopyWithSizeCheck, - // which calls Clear() and then MergeFrom(), as well as making sure that - // clearing the destination message doesn't alter the size of the source, - // when in debug builds. - // Most callers avoid this by passing a "from" message that is the same - // type as the message being merged into, rather than a generic Message. - } - - // Generate the class-specific CopyFrom. - format( - "void $classname$::CopyFrom(const $classname$& from) {\n" - "// @@protoc_insertion_point(class_specific_copy_from_start:" - "$full_name$)\n"); - format.Indent(); - - format("if (&from == this) return;\n"); - - if (!options_.opensource_runtime) { - // This check is disabled in the opensource release because we're - // concerned that many users do not define NDEBUG in their release builds. - format( - "#ifndef NDEBUG\n" - "size_t from_size = from.ByteSizeLong();\n" - "#endif\n" - "Clear();\n" - "#ifndef NDEBUG\n" - "$CHK$_EQ(from_size, from.ByteSizeLong())\n" - " << \"Source of CopyFrom changed when clearing target. Either \"\n" - " \"source is a nested message in target (not allowed), or \"\n" - " \"another thread is modifying the source.\";\n" - "#endif\n"); - } else { - format("Clear();\n"); - } - format("MergeFrom(from);\n"); - - format.Outdent(); - format("}\n"); -} - -void MessageGenerator::GenerateVerify(io::Printer* printer) { -} - -void MessageGenerator::GenerateSerializeOneofFields( - io::Printer* printer, const std::vector& fields) { - Formatter format(printer, variables_); - GOOGLE_CHECK(!fields.empty()); - if (fields.size() == 1) { - GenerateSerializeOneField(printer, fields[0], -1); - return; - } - // We have multiple mutually exclusive choices. Emit a switch statement. - const OneofDescriptor* oneof = fields[0]->containing_oneof(); - format("switch ($1$_case()) {\n", oneof->name()); - format.Indent(); - for (auto field : fields) { - format("case k$1$: {\n", UnderscoresToCamelCase(field->name(), true)); - format.Indent(); - field_generators_.get(field).GenerateSerializeWithCachedSizesToArray( - printer); - format("break;\n"); - format.Outdent(); - format("}\n"); - } - format.Outdent(); - // Doing nothing is an option. - format( - " default: ;\n" - "}\n"); -} - -void MessageGenerator::GenerateSerializeOneField(io::Printer* printer, - const FieldDescriptor* field, - int cached_has_bits_index) { - Formatter format(printer, variables_); - if (!field->options().weak()) { - // For weakfields, PrintFieldComment is called during iteration. - PrintFieldComment(format, field); - } - - bool have_enclosing_if = false; - if (field->options().weak()) { - } else if (HasHasbit(field)) { - // Attempt to use the state of cached_has_bits, if possible. - int has_bit_index = HasBitIndex(field); - if (cached_has_bits_index == has_bit_index / 32) { - const std::string mask = - StrCat(strings::Hex(1u << (has_bit_index % 32), strings::ZERO_PAD_8)); - - format("if (cached_has_bits & 0x$1$u) {\n", mask); - } else { - format("if (_internal_has_$1$()) {\n", FieldName(field)); - } - - format.Indent(); - have_enclosing_if = true; - } else if (field->is_optional() && !HasHasbit(field)) { - have_enclosing_if = EmitFieldNonDefaultCondition(printer, "this->", field); - } - - field_generators_.get(field).GenerateSerializeWithCachedSizesToArray(printer); - - if (have_enclosing_if) { - format.Outdent(); - format("}\n"); - } - format("\n"); -} - -void MessageGenerator::GenerateSerializeOneExtensionRange( - io::Printer* printer, const Descriptor::ExtensionRange* range) { - std::map vars = variables_; - vars["start"] = StrCat(range->start); - vars["end"] = StrCat(range->end); - Formatter format(printer, vars); - format("// Extension range [$start$, $end$)\n"); - format( - "target = _extensions_._InternalSerialize(\n" - "internal_default_instance(), $start$, $end$, target, stream);\n\n"); -} - -void MessageGenerator::GenerateSerializeWithCachedSizesToArray( - io::Printer* printer) { - if (HasSimpleBaseClass(descriptor_, options_)) return; - Formatter format(printer, variables_); - if (descriptor_->options().message_set_wire_format()) { - // Special-case MessageSet. - format( - "$uint8$* $classname$::_InternalSerialize(\n" - " $uint8$* target, ::$proto_ns$::io::EpsCopyOutputStream* stream) " - "const {\n" - "$annotate_serialize$" - " target = _extensions_." - "InternalSerializeMessageSetWithCachedSizesToArray(\n" // - "internal_default_instance(), target, stream);\n"); - std::map vars; - SetUnknownFieldsVariable(descriptor_, options_, &vars); - format.AddMap(vars); - format( - " target = ::$proto_ns$::internal::" - "InternalSerializeUnknownMessageSetItemsToArray(\n" - " $unknown_fields$, target, stream);\n"); - format( - " return target;\n" - "}\n"); - return; - } - - format( - "$uint8$* $classname$::_InternalSerialize(\n" - " $uint8$* target, ::$proto_ns$::io::EpsCopyOutputStream* stream) " - "const {\n" - "$annotate_serialize$"); - format.Indent(); - - format("// @@protoc_insertion_point(serialize_to_array_start:$full_name$)\n"); - - if (!ShouldSerializeInOrder(descriptor_, options_)) { - format.Outdent(); - format("#ifdef NDEBUG\n"); - format.Indent(); - } - - GenerateSerializeWithCachedSizesBody(printer); - - if (!ShouldSerializeInOrder(descriptor_, options_)) { - format.Outdent(); - format("#else // NDEBUG\n"); - format.Indent(); - - GenerateSerializeWithCachedSizesBodyShuffled(printer); - - format.Outdent(); - format("#endif // !NDEBUG\n"); - format.Indent(); - } - - format("// @@protoc_insertion_point(serialize_to_array_end:$full_name$)\n"); - - format.Outdent(); - format( - " return target;\n" - "}\n"); -} - -void MessageGenerator::GenerateSerializeWithCachedSizesBody( - io::Printer* printer) { - if (HasSimpleBaseClass(descriptor_, options_)) return; - Formatter format(printer, variables_); - // If there are multiple fields in a row from the same oneof then we - // coalesce them and emit a switch statement. This is more efficient - // because it lets the C++ compiler know this is a "at most one can happen" - // situation. If we emitted "if (has_x()) ...; if (has_y()) ..." the C++ - // compiler's emitted code might check has_y() even when has_x() is true. - class LazySerializerEmitter { - public: - LazySerializerEmitter(MessageGenerator* mg, io::Printer* printer) - : mg_(mg), - format_(printer), - eager_(IsProto3(mg->descriptor_->file())), - cached_has_bit_index_(kNoHasbit) {} - - ~LazySerializerEmitter() { Flush(); } - - // If conditions allow, try to accumulate a run of fields from the same - // oneof, and handle them at the next Flush(). - void Emit(const FieldDescriptor* field) { - if (eager_ || MustFlush(field)) { - Flush(); - } - if (!field->real_containing_oneof()) { - // TODO(ckennelly): Defer non-oneof fields similarly to oneof fields. - - if (!field->options().weak() && !field->is_repeated() && !eager_) { - // We speculatively load the entire _has_bits_[index] contents, even - // if it is for only one field. Deferring non-oneof emitting would - // allow us to determine whether this is going to be useful. - int has_bit_index = mg_->has_bit_indices_[field->index()]; - if (cached_has_bit_index_ != has_bit_index / 32) { - // Reload. - int new_index = has_bit_index / 32; - - format_("cached_has_bits = _has_bits_[$1$];\n", new_index); - - cached_has_bit_index_ = new_index; - } - } - - mg_->GenerateSerializeOneField(format_.printer(), field, - cached_has_bit_index_); - } else { - v_.push_back(field); - } - } - - void EmitIfNotNull(const FieldDescriptor* field) { - if (field != nullptr) { - Emit(field); - } - } - - void Flush() { - if (!v_.empty()) { - mg_->GenerateSerializeOneofFields(format_.printer(), v_); - v_.clear(); - } - } - - private: - // If we have multiple fields in v_ then they all must be from the same - // oneof. Would adding field to v_ break that invariant? - bool MustFlush(const FieldDescriptor* field) { - return !v_.empty() && - v_[0]->containing_oneof() != field->containing_oneof(); - } - - MessageGenerator* mg_; - Formatter format_; - const bool eager_; - std::vector v_; - - // cached_has_bit_index_ maintains that: - // cached_has_bits = from._has_bits_[cached_has_bit_index_] - // for cached_has_bit_index_ >= 0 - int cached_has_bit_index_; - }; - - class LazyExtensionRangeEmitter { - public: - LazyExtensionRangeEmitter(MessageGenerator* mg, io::Printer* printer) - : mg_(mg), format_(printer) {} - - void AddToRange(const Descriptor::ExtensionRange* range) { - if (!has_current_range_) { - current_combined_range_ = *range; - has_current_range_ = true; - } else { - current_combined_range_.start = - std::min(current_combined_range_.start, range->start); - current_combined_range_.end = - std::max(current_combined_range_.end, range->end); - } - } - - void Flush() { - if (has_current_range_) { - mg_->GenerateSerializeOneExtensionRange(format_.printer(), - ¤t_combined_range_); - } - has_current_range_ = false; - } - - private: - MessageGenerator* mg_; - Formatter format_; - bool has_current_range_ = false; - Descriptor::ExtensionRange current_combined_range_; - }; - - // We need to track the largest weak field, because weak fields are serialized - // differently than normal fields. The WeakFieldMap::FieldWriter will - // serialize all weak fields that are ordinally between the last serialized - // weak field and the current field. In order to guarantee that all weak - // fields are serialized, we need to make sure to emit the code to serialize - // the largest weak field present at some point. - class LargestWeakFieldHolder { - public: - const FieldDescriptor* Release() { - const FieldDescriptor* result = field_; - field_ = nullptr; - return result; - } - void ReplaceIfLarger(const FieldDescriptor* field) { - if (field_ == nullptr || field_->number() < field->number()) { - field_ = field; - } - } - - private: - const FieldDescriptor* field_ = nullptr; - }; - - std::vector ordered_fields = - SortFieldsByNumber(descriptor_); - - std::vector sorted_extensions; - sorted_extensions.reserve(descriptor_->extension_range_count()); - for (int i = 0; i < descriptor_->extension_range_count(); ++i) { - sorted_extensions.push_back(descriptor_->extension_range(i)); - } - std::sort(sorted_extensions.begin(), sorted_extensions.end(), - ExtensionRangeSorter()); - if (num_weak_fields_) { - format( - "::$proto_ns$::internal::WeakFieldMap::FieldWriter field_writer(" - "_weak_field_map_);\n"); - } - - format( - "$uint32$ cached_has_bits = 0;\n" - "(void) cached_has_bits;\n\n"); - - // Merge the fields and the extension ranges, both sorted by field number. - { - LazySerializerEmitter e(this, printer); - LazyExtensionRangeEmitter re(this, printer); - LargestWeakFieldHolder largest_weak_field; - int i, j; - for (i = 0, j = 0; - i < ordered_fields.size() || j < sorted_extensions.size();) { - if ((j == sorted_extensions.size()) || - (i < descriptor_->field_count() && - ordered_fields[i]->number() < sorted_extensions[j]->start)) { - const FieldDescriptor* field = ordered_fields[i++]; - if (IsFieldStripped(field, options_)) { - continue; - } - re.Flush(); - if (field->options().weak()) { - largest_weak_field.ReplaceIfLarger(field); - PrintFieldComment(format, field); - } else { - e.EmitIfNotNull(largest_weak_field.Release()); - e.Emit(field); - } - } else { - e.EmitIfNotNull(largest_weak_field.Release()); - e.Flush(); - re.AddToRange(sorted_extensions[j++]); - } - } - re.Flush(); - e.EmitIfNotNull(largest_weak_field.Release()); - } - - std::map vars; - SetUnknownFieldsVariable(descriptor_, options_, &vars); - format.AddMap(vars); - format("if (PROTOBUF_PREDICT_FALSE($have_unknown_fields$)) {\n"); - format.Indent(); - if (UseUnknownFieldSet(descriptor_->file(), options_)) { - format( - "target = " - "::$proto_ns$::internal::WireFormat::" - "InternalSerializeUnknownFieldsToArray(\n" - " $unknown_fields$, target, stream);\n"); - } else { - format( - "target = stream->WriteRaw($unknown_fields$.data(),\n" - " static_cast($unknown_fields$.size()), target);\n"); - } - format.Outdent(); - format("}\n"); -} - -void MessageGenerator::GenerateSerializeWithCachedSizesBodyShuffled( - io::Printer* printer) { - Formatter format(printer, variables_); - - std::vector ordered_fields = - SortFieldsByNumber(descriptor_); - ordered_fields.erase( - std::remove_if(ordered_fields.begin(), ordered_fields.end(), - [this](const FieldDescriptor* f) { - return !IsFieldUsed(f, options_); - }), - ordered_fields.end()); - - std::vector sorted_extensions; - sorted_extensions.reserve(descriptor_->extension_range_count()); - for (int i = 0; i < descriptor_->extension_range_count(); ++i) { - sorted_extensions.push_back(descriptor_->extension_range(i)); - } - std::sort(sorted_extensions.begin(), sorted_extensions.end(), - ExtensionRangeSorter()); - - int num_fields = ordered_fields.size() + sorted_extensions.size(); - constexpr int kLargePrime = 1000003; - GOOGLE_CHECK_LT(num_fields, kLargePrime) - << "Prime offset must be greater than the number of fields to ensure " - "those are coprime."; - - if (num_weak_fields_) { - format( - "::$proto_ns$::internal::WeakFieldMap::FieldWriter field_writer(" - "_weak_field_map_);\n"); - } - - format("for (int i = $1$; i >= 0; i-- ) {\n", num_fields - 1); - - format.Indent(); - format("switch(i) {\n"); - format.Indent(); - - int index = 0; - for (const auto* f : ordered_fields) { - format("case $1$: {\n", index++); - format.Indent(); - - GenerateSerializeOneField(printer, f, -1); - - format("break;\n"); - format.Outdent(); - format("}\n"); - } - - for (const auto* r : sorted_extensions) { - format("case $1$: {\n", index++); - format.Indent(); - - GenerateSerializeOneExtensionRange(printer, r); - - format("break;\n"); - format.Outdent(); - format("}\n"); - } - - format( - "default: {\n" - " $DCHK$(false) << \"Unexpected index: \" << i;\n" - "}\n"); - format.Outdent(); - format("}\n"); - - format.Outdent(); - format("}\n"); - - std::map vars; - SetUnknownFieldsVariable(descriptor_, options_, &vars); - format.AddMap(vars); - format("if (PROTOBUF_PREDICT_FALSE($have_unknown_fields$)) {\n"); - format.Indent(); - if (UseUnknownFieldSet(descriptor_->file(), options_)) { - format( - "target = " - "::$proto_ns$::internal::WireFormat::" - "InternalSerializeUnknownFieldsToArray(\n" - " $unknown_fields$, target, stream);\n"); - } else { - format( - "target = stream->WriteRaw($unknown_fields$.data(),\n" - " static_cast($unknown_fields$.size()), target);\n"); - } - format.Outdent(); - format("}\n"); -} - -std::vector MessageGenerator::RequiredFieldsBitMask() const { - const int array_size = HasBitsSize(); - std::vector masks(array_size, 0); - - for (auto field : FieldRange(descriptor_)) { - if (!field->is_required()) { - continue; - } - - const int has_bit_index = has_bit_indices_[field->index()]; - masks[has_bit_index / 32] |= static_cast(1) - << (has_bit_index % 32); - } - return masks; -} - -void MessageGenerator::GenerateByteSize(io::Printer* printer) { - if (HasSimpleBaseClass(descriptor_, options_)) return; - Formatter format(printer, variables_); - - if (descriptor_->options().message_set_wire_format()) { - // Special-case MessageSet. - std::map vars; - SetUnknownFieldsVariable(descriptor_, options_, &vars); - format.AddMap(vars); - format( - "size_t $classname$::ByteSizeLong() const {\n" - "$annotate_bytesize$" - "// @@protoc_insertion_point(message_set_byte_size_start:$full_name$)\n" - " size_t total_size = _extensions_.MessageSetByteSize();\n" - " if ($have_unknown_fields$) {\n" - " total_size += ::$proto_ns$::internal::\n" - " ComputeUnknownMessageSetItemsSize($unknown_fields$);\n" - " }\n" - " int cached_size = " - "::$proto_ns$::internal::ToCachedSize(total_size);\n" - " SetCachedSize(cached_size);\n" - " return total_size;\n" - "}\n"); - return; - } - - if (num_required_fields_ > 1) { - // Emit a function (rarely used, we hope) that handles the required fields - // by checking for each one individually. - format( - "size_t $classname$::RequiredFieldsByteSizeFallback() const {\n" - "// @@protoc_insertion_point(required_fields_byte_size_fallback_start:" - "$full_name$)\n"); - format.Indent(); - format("size_t total_size = 0;\n"); - for (auto field : optimized_order_) { - if (field->is_required()) { - format( - "\n" - "if (_internal_has_$1$()) {\n", - FieldName(field)); - format.Indent(); - PrintFieldComment(format, field); - field_generators_.get(field).GenerateByteSize(printer); - format.Outdent(); - format("}\n"); - } - } - format( - "\n" - "return total_size;\n"); - format.Outdent(); - format("}\n"); - } - - format( - "size_t $classname$::ByteSizeLong() const {\n" - "$annotate_bytesize$" - "// @@protoc_insertion_point(message_byte_size_start:$full_name$)\n"); - format.Indent(); - format( - "size_t total_size = 0;\n" - "\n"); - - if (descriptor_->extension_range_count() > 0) { - format( - "total_size += _extensions_.ByteSize();\n" - "\n"); - } - - std::map vars; - SetUnknownFieldsVariable(descriptor_, options_, &vars); - format.AddMap(vars); - - // Handle required fields (if any). We expect all of them to be - // present, so emit one conditional that checks for that. If they are all - // present then the fast path executes; otherwise the slow path executes. - if (num_required_fields_ > 1) { - // The fast path works if all required fields are present. - const std::vector masks_for_has_bits = RequiredFieldsBitMask(); - format("if ($1$) { // All required fields are present.\n", - ConditionalToCheckBitmasks(masks_for_has_bits)); - format.Indent(); - // Oneof fields cannot be required, so optimized_order_ contains all of the - // fields that we need to potentially emit. - for (auto field : optimized_order_) { - if (!field->is_required()) continue; - PrintFieldComment(format, field); - field_generators_.get(field).GenerateByteSize(printer); - format("\n"); - } - format.Outdent(); - format( - "} else {\n" // the slow path - " total_size += RequiredFieldsByteSizeFallback();\n" - "}\n"); - } else { - // num_required_fields_ <= 1: no need to be tricky - for (auto field : optimized_order_) { - if (!field->is_required()) continue; - PrintFieldComment(format, field); - format("if (_internal_has_$1$()) {\n", FieldName(field)); - format.Indent(); - field_generators_.get(field).GenerateByteSize(printer); - format.Outdent(); - format("}\n"); - } - } - - std::vector> chunks = CollectFields( - optimized_order_, - [&](const FieldDescriptor* a, const FieldDescriptor* b) -> bool { - return a->label() == b->label() && HasByteIndex(a) == HasByteIndex(b); - }); - - // Remove chunks with required fields. - chunks.erase(std::remove_if(chunks.begin(), chunks.end(), IsRequired), - chunks.end()); - - ColdChunkSkipper cold_skipper(options_, chunks, has_bit_indices_, kColdRatio); - int cached_has_word_index = -1; - - format( - "$uint32$ cached_has_bits = 0;\n" - "// Prevent compiler warnings about cached_has_bits being unused\n" - "(void) cached_has_bits;\n\n"); - - for (int chunk_index = 0; chunk_index < chunks.size(); chunk_index++) { - const std::vector& chunk = chunks[chunk_index]; - const bool have_outer_if = - chunk.size() > 1 && HasWordIndex(chunk[0]) != kNoHasbit; - cold_skipper.OnStartChunk(chunk_index, cached_has_word_index, "", printer); - - if (have_outer_if) { - // Emit an if() that will let us skip the whole chunk if none are set. - uint32_t chunk_mask = GenChunkMask(chunk, has_bit_indices_); - std::string chunk_mask_str = - StrCat(strings::Hex(chunk_mask, strings::ZERO_PAD_8)); - - // Check (up to) 8 has_bits at a time if we have more than one field in - // this chunk. Due to field layout ordering, we may check - // _has_bits_[last_chunk * 8 / 32] multiple times. - GOOGLE_DCHECK_LE(2, popcnt(chunk_mask)); - GOOGLE_DCHECK_GE(8, popcnt(chunk_mask)); - - if (cached_has_word_index != HasWordIndex(chunk.front())) { - cached_has_word_index = HasWordIndex(chunk.front()); - format("cached_has_bits = _has_bits_[$1$];\n", cached_has_word_index); - } - format("if (cached_has_bits & 0x$1$u) {\n", chunk_mask_str); - format.Indent(); - } - - // Go back and emit checks for each of the fields we processed. - for (int j = 0; j < chunk.size(); j++) { - const FieldDescriptor* field = chunk[j]; - const FieldGenerator& generator = field_generators_.get(field); - bool have_enclosing_if = false; - bool need_extra_newline = false; - - PrintFieldComment(format, field); - - if (field->is_repeated()) { - // No presence check is required. - need_extra_newline = true; - } else if (HasHasbit(field)) { - PrintPresenceCheck(format, field, has_bit_indices_, printer, - &cached_has_word_index); - have_enclosing_if = true; - } else { - // Without field presence: field is serialized only if it has a - // non-default value. - have_enclosing_if = - EmitFieldNonDefaultCondition(printer, "this->", field); - } - - generator.GenerateByteSize(printer); - - if (have_enclosing_if) { - format.Outdent(); - format( - "}\n" - "\n"); - } - if (need_extra_newline) { - format("\n"); - } - } - - if (have_outer_if) { - format.Outdent(); - format("}\n"); - } - - if (cold_skipper.OnEndChunk(chunk_index, printer)) { - // Reset here as it may have been updated in just closed if statement. - cached_has_word_index = -1; - } - } - - // Fields inside a oneof don't use _has_bits_ so we count them in a separate - // pass. - for (auto oneof : OneOfRange(descriptor_)) { - format("switch ($1$_case()) {\n", oneof->name()); - format.Indent(); - for (auto field : FieldRange(oneof)) { - PrintFieldComment(format, field); - format("case k$1$: {\n", UnderscoresToCamelCase(field->name(), true)); - format.Indent(); - if (!IsFieldStripped(field, options_)) { - field_generators_.get(field).GenerateByteSize(printer); - } - format("break;\n"); - format.Outdent(); - format("}\n"); - } - format( - "case $1$_NOT_SET: {\n" - " break;\n" - "}\n", - ToUpper(oneof->name())); - format.Outdent(); - format("}\n"); - } - - if (num_weak_fields_) { - // TagSize + MessageSize - format("total_size += _weak_field_map_.ByteSizeLong();\n"); - } - - if (UseUnknownFieldSet(descriptor_->file(), options_)) { - // We go out of our way to put the computation of the uncommon path of - // unknown fields in tail position. This allows for better code generation - // of this function for simple protos. - format( - "return MaybeComputeUnknownFieldsSize(total_size, &_cached_size_);\n"); - } else { - format("if (PROTOBUF_PREDICT_FALSE($have_unknown_fields$)) {\n"); - format(" total_size += $unknown_fields$.size();\n"); - format("}\n"); - - // We update _cached_size_ even though this is a const method. Because - // const methods might be called concurrently this needs to be atomic - // operations or the program is undefined. In practice, since any - // concurrent writes will be writing the exact same value, normal writes - // will work on all common processors. We use a dedicated wrapper class to - // abstract away the underlying atomic. This makes it easier on platforms - // where even relaxed memory order might have perf impact to replace it with - // ordinary loads and stores. - format( - "int cached_size = ::$proto_ns$::internal::ToCachedSize(total_size);\n" - "SetCachedSize(cached_size);\n" - "return total_size;\n"); - } - - format.Outdent(); - format("}\n"); -} - -void MessageGenerator::GenerateIsInitialized(io::Printer* printer) { - if (HasSimpleBaseClass(descriptor_, options_)) return; - Formatter format(printer, variables_); - format("bool $classname$::IsInitialized() const {\n"); - format.Indent(); - - if (descriptor_->extension_range_count() > 0) { - format( - "if (!_extensions_.IsInitialized()) {\n" - " return false;\n" - "}\n\n"); - } - - if (num_required_fields_ > 0) { - format( - "if (_Internal::MissingRequiredFields(_has_bits_))" - " return false;\n"); - } - - // Now check that all non-oneof embedded messages are initialized. - for (auto field : optimized_order_) { - field_generators_.get(field).GenerateIsInitialized(printer); - } - if (num_weak_fields_) { - // For Weak fields. - format("if (!_weak_field_map_.IsInitialized()) return false;\n"); - } - // Go through the oneof fields, emitting a switch if any might have required - // fields. - for (auto oneof : OneOfRange(descriptor_)) { - bool has_required_fields = false; - for (auto field : FieldRange(oneof)) { - if (field->cpp_type() == FieldDescriptor::CPPTYPE_MESSAGE && - !ShouldIgnoreRequiredFieldCheck(field, options_) && - scc_analyzer_->HasRequiredFields(field->message_type())) { - has_required_fields = true; - break; - } - } - - if (!has_required_fields) { - continue; - } - - format("switch ($1$_case()) {\n", oneof->name()); - format.Indent(); - for (auto field : FieldRange(oneof)) { - format("case k$1$: {\n", UnderscoresToCamelCase(field->name(), true)); - format.Indent(); - if (!IsFieldStripped(field, options_)) { - field_generators_.get(field).GenerateIsInitialized(printer); - } - format("break;\n"); - format.Outdent(); - format("}\n"); - } - format( - "case $1$_NOT_SET: {\n" - " break;\n" - "}\n", - ToUpper(oneof->name())); - format.Outdent(); - format("}\n"); - } - - format.Outdent(); - format( - " return true;\n" - "}\n"); -} - -} // namespace cpp -} // namespace compiler -} // namespace protobuf -} // namespace google - -#include diff --git a/extra/protobuf/protobuf-3.19.4/src/google/protobuf/compiler/cpp/cpp_message.h b/extra/protobuf/protobuf-3.19.4/src/google/protobuf/compiler/cpp/cpp_message.h deleted file mode 100644 index 64af2bf89b52..000000000000 --- a/extra/protobuf/protobuf-3.19.4/src/google/protobuf/compiler/cpp/cpp_message.h +++ /dev/null @@ -1,231 +0,0 @@ -// Protocol Buffers - Google's data interchange format -// Copyright 2008 Google Inc. All rights reserved. -// https://developers.google.com/protocol-buffers/ -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// * Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// * Redistributions in binary form must reproduce the above -// copyright notice, this list of conditions and the following disclaimer -// in the documentation and/or other materials provided with the -// distribution. -// * Neither the name of Google Inc. nor the names of its -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -// Author: kenton@google.com (Kenton Varda) -// Based on original Protocol Buffers design by -// Sanjay Ghemawat, Jeff Dean, and others. - -#ifndef GOOGLE_PROTOBUF_COMPILER_CPP_MESSAGE_H__ -#define GOOGLE_PROTOBUF_COMPILER_CPP_MESSAGE_H__ - -#include -#include -#include -#include - -#include -#include -#include -#include -#include - -namespace google { -namespace protobuf { -namespace io { -class Printer; // printer.h -} -} // namespace protobuf -} // namespace google - -namespace google { -namespace protobuf { -namespace compiler { -namespace cpp { - -class EnumGenerator; // enum.h -class ExtensionGenerator; // extension.h - -class MessageGenerator { - public: - // See generator.cc for the meaning of dllexport_decl. - MessageGenerator(const Descriptor* descriptor, - const std::map& vars, - int index_in_file_messages, const Options& options, - MessageSCCAnalyzer* scc_analyzer); - ~MessageGenerator(); - - // Append the two types of nested generators to the corresponding vector. - void AddGenerators( - std::vector>* enum_generators, - std::vector>* extension_generators); - - // Generate definitions for this class and all its nested types. - void GenerateClassDefinition(io::Printer* printer); - - // Generate definitions of inline methods (placed at the end of the header - // file). - void GenerateInlineMethods(io::Printer* printer); - - // Source file stuff. - - // Generate all non-inline methods for this class. - void GenerateClassMethods(io::Printer* printer); - - // Generate source file code that should go outside any namespace. - void GenerateSourceInProto2Namespace(io::Printer* printer); - - private: - // Generate declarations and definitions of accessors for fields. - void GenerateFieldAccessorDeclarations(io::Printer* printer); - void GenerateFieldAccessorDefinitions(io::Printer* printer); - - // Generate the table-driven parsing array. Returns the number of entries - // generated. - size_t GenerateParseOffsets(io::Printer* printer); - size_t GenerateParseAuxTable(io::Printer* printer); - // Generates a ParseTable entry. Returns whether the proto uses - // table-driven parsing. - bool GenerateParseTable(io::Printer* printer, size_t offset, - size_t aux_offset); - - // Generate the field offsets array. Returns the a pair of the total number - // of entries generated and the index of the first has_bit entry. - std::pair GenerateOffsets(io::Printer* printer); - void GenerateSchema(io::Printer* printer, int offset, int has_offset); - // For each field generates a table entry describing the field for the - // table driven serializer. - int GenerateFieldMetadata(io::Printer* printer); - - // Generate constructors and destructor. - void GenerateStructors(io::Printer* printer); - - // The compiler typically generates multiple copies of each constructor and - // destructor: http://gcc.gnu.org/bugs.html#nonbugs_cxx - // Placing common code in a separate method reduces the generated code size. - // - // Generate the shared constructor code. - void GenerateSharedConstructorCode(io::Printer* printer); - // Generate the shared destructor code. - void GenerateSharedDestructorCode(io::Printer* printer); - // Generate the arena-specific destructor code. - void GenerateArenaDestructorCode(io::Printer* printer); - - // Generate the constexpr constructor for constant initialization of the - // default instance. - void GenerateConstexprConstructor(io::Printer* printer); - - // Generate standard Message methods. - void GenerateClear(io::Printer* printer); - void GenerateOneofClear(io::Printer* printer); - void GenerateVerify(io::Printer* printer); - void GenerateSerializeWithCachedSizes(io::Printer* printer); - void GenerateSerializeWithCachedSizesToArray(io::Printer* printer); - void GenerateSerializeWithCachedSizesBody(io::Printer* printer); - void GenerateSerializeWithCachedSizesBodyShuffled(io::Printer* printer); - void GenerateByteSize(io::Printer* printer); - void GenerateMergeFrom(io::Printer* printer); - void GenerateClassSpecificMergeFrom(io::Printer* printer); - void GenerateCopyFrom(io::Printer* printer); - void GenerateSwap(io::Printer* printer); - void GenerateIsInitialized(io::Printer* printer); - - // Helpers for GenerateSerializeWithCachedSizes(). - // - // cached_has_bit_index maintains that: - // cached_has_bits = _has_bits_[cached_has_bit_index] - // for cached_has_bit_index >= 0 - void GenerateSerializeOneField(io::Printer* printer, - const FieldDescriptor* field, - int cached_has_bits_index); - // Generate a switch statement to serialize 2+ fields from the same oneof. - // Or, if fields.size() == 1, just call GenerateSerializeOneField(). - void GenerateSerializeOneofFields( - io::Printer* printer, const std::vector& fields); - void GenerateSerializeOneExtensionRange( - io::Printer* printer, const Descriptor::ExtensionRange* range); - - // Generates has_foo() functions and variables for singular field has-bits. - void GenerateSingularFieldHasBits(const FieldDescriptor* field, - Formatter format); - // Generates has_foo() functions and variables for oneof field has-bits. - void GenerateOneofHasBits(io::Printer* printer); - // Generates has_foo_bar() functions for oneof members. - void GenerateOneofMemberHasBits(const FieldDescriptor* field, - const Formatter& format); - // Generates the clear_foo() method for a field. - void GenerateFieldClear(const FieldDescriptor* field, bool is_inline, - Formatter format); - - void GenerateConstructorBody(io::Printer* printer, - std::vector already_processed, - bool copy_constructor) const; - - size_t HasBitsSize() const; - size_t InlinedStringDonatedSize() const; - int HasBitIndex(const FieldDescriptor* a) const; - int HasByteIndex(const FieldDescriptor* a) const; - int HasWordIndex(const FieldDescriptor* a) const; - bool SameHasByte(const FieldDescriptor* a, const FieldDescriptor* b) const; - std::vector RequiredFieldsBitMask() const; - - const Descriptor* descriptor_; - int index_in_file_messages_; - std::string classname_; - Options options_; - FieldGeneratorMap field_generators_; - // optimized_order_ is the order we layout the message's fields in the - // class. This is reused to initialize the fields in-order for cache - // efficiency. - // - // optimized_order_ excludes oneof fields and weak fields. - std::vector optimized_order_; - std::vector has_bit_indices_; - int max_has_bit_index_; - - // A map from field index to inlined_string index. For non-inlined-string - // fields, the element is -1. - std::vector inlined_string_indices_; - // The count of inlined_string fields in the message. - int max_inlined_string_index_; - - std::vector enum_generators_; - std::vector extension_generators_; - int num_required_fields_; - int num_weak_fields_; - // table_driven_ indicates the generated message uses table-driven parsing. - bool table_driven_; - - std::unique_ptr message_layout_helper_; - std::unique_ptr parse_function_generator_; - - MessageSCCAnalyzer* scc_analyzer_; - - std::map variables_; - - friend class FileGenerator; - GOOGLE_DISALLOW_EVIL_CONSTRUCTORS(MessageGenerator); -}; - -} // namespace cpp -} // namespace compiler -} // namespace protobuf -} // namespace google - -#endif // GOOGLE_PROTOBUF_COMPILER_CPP_MESSAGE_H__ diff --git a/extra/protobuf/protobuf-3.19.4/src/google/protobuf/compiler/cpp/cpp_message_field.cc b/extra/protobuf/protobuf-3.19.4/src/google/protobuf/compiler/cpp/cpp_message_field.cc deleted file mode 100644 index 6199903371fb..000000000000 --- a/extra/protobuf/protobuf-3.19.4/src/google/protobuf/compiler/cpp/cpp_message_field.cc +++ /dev/null @@ -1,892 +0,0 @@ -// Protocol Buffers - Google's data interchange format -// Copyright 2008 Google Inc. All rights reserved. -// https://developers.google.com/protocol-buffers/ -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// * Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// * Redistributions in binary form must reproduce the above -// copyright notice, this list of conditions and the following disclaimer -// in the documentation and/or other materials provided with the -// distribution. -// * Neither the name of Google Inc. nor the names of its -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -// Author: kenton@google.com (Kenton Varda) -// Based on original Protocol Buffers design by -// Sanjay Ghemawat, Jeff Dean, and others. - -#include -#include -#include - -#include - -namespace google { -namespace protobuf { -namespace compiler { -namespace cpp { - -namespace { -std::string ReinterpretCast(const std::string& type, - const std::string& expression, - bool implicit_weak_field) { - if (implicit_weak_field) { - return "reinterpret_cast< " + type + " >(" + expression + ")"; - } else { - return expression; - } -} - -void SetMessageVariables(const FieldDescriptor* descriptor, - const Options& options, bool implicit_weak, - std::map* variables) { - SetCommonFieldVariables(descriptor, variables, options); - (*variables)["type"] = FieldMessageTypeName(descriptor, options); - (*variables)["casted_member"] = ReinterpretCast( - (*variables)["type"] + "*", (*variables)["name"] + "_", implicit_weak); - (*variables)["type_default_instance"] = - QualifiedDefaultInstanceName(descriptor->message_type(), options); - (*variables)["type_default_instance_ptr"] = - QualifiedDefaultInstancePtr(descriptor->message_type(), options); - (*variables)["type_reference_function"] = - implicit_weak ? (" ::" + (*variables)["proto_ns"] + - "::internal::StrongReference(reinterpret_cast(\n" + - (*variables)["type_default_instance"] + "));\n") - : ""; - // NOTE: Escaped here to unblock proto1->proto2 migration. - // TODO(liujisi): Extend this to apply for other conflicting methods. - (*variables)["release_name"] = - SafeFunctionName(descriptor->containing_type(), descriptor, "release_"); - (*variables)["full_name"] = descriptor->full_name(); -} - -} // namespace - -// =================================================================== - -MessageFieldGenerator::MessageFieldGenerator(const FieldDescriptor* descriptor, - const Options& options, - MessageSCCAnalyzer* scc_analyzer) - : FieldGenerator(descriptor, options), - implicit_weak_field_( - IsImplicitWeakField(descriptor, options, scc_analyzer)), - has_required_fields_( - scc_analyzer->HasRequiredFields(descriptor->message_type())) { - SetMessageVariables(descriptor, options, implicit_weak_field_, &variables_); -} - -MessageFieldGenerator::~MessageFieldGenerator() {} - -void MessageFieldGenerator::GeneratePrivateMembers(io::Printer* printer) const { - Formatter format(printer, variables_); - if (implicit_weak_field_) { - format("::$proto_ns$::MessageLite* $name$_;\n"); - } else { - format("$type$* $name$_;\n"); - } -} - -void MessageFieldGenerator::GenerateAccessorDeclarations( - io::Printer* printer) const { - Formatter format(printer, variables_); - if (IsFieldStripped(descriptor_, options_)) { - format( - "$deprecated_attr$const $type$& ${1$$name$$}$() const { " - "__builtin_trap(); }\n" - "PROTOBUF_NODISCARD $deprecated_attr$$type$* " - "${1$$release_name$$}$() { " - "__builtin_trap(); }\n" - "$deprecated_attr$$type$* ${1$mutable_$name$$}$() { " - "__builtin_trap(); }\n" - "$deprecated_attr$void ${1$set_allocated_$name$$}$" - "($type$* $name$) { __builtin_trap(); }\n" - "$deprecated_attr$void " - "${1$unsafe_arena_set_allocated_$name$$}$(\n" - " $type$* $name$) { __builtin_trap(); }\n" - "$deprecated_attr$$type$* ${1$unsafe_arena_release_$name$$}$() { " - "__builtin_trap(); }\n", - descriptor_); - return; - } - format( - "$deprecated_attr$const $type$& ${1$$name$$}$() const;\n" - "PROTOBUF_NODISCARD $deprecated_attr$$type$* " - "${1$$release_name$$}$();\n" - "$deprecated_attr$$type$* ${1$mutable_$name$$}$();\n" - "$deprecated_attr$void ${1$set_allocated_$name$$}$" - "($type$* $name$);\n", - descriptor_); - if (!IsFieldStripped(descriptor_, options_)) { - format( - "private:\n" - "const $type$& ${1$_internal_$name$$}$() const;\n" - "$type$* ${1$_internal_mutable_$name$$}$();\n" - "public:\n", - descriptor_); - } - format( - "$deprecated_attr$void " - "${1$unsafe_arena_set_allocated_$name$$}$(\n" - " $type$* $name$);\n" - "$deprecated_attr$$type$* ${1$unsafe_arena_release_$name$$}$();\n", - descriptor_); -} - -void MessageFieldGenerator::GenerateNonInlineAccessorDefinitions( - io::Printer* printer) const { -} - -void MessageFieldGenerator::GenerateInlineAccessorDefinitions( - io::Printer* printer) const { - Formatter format(printer, variables_); - format( - "inline const $type$& $classname$::_internal_$name$() const {\n" - "$type_reference_function$" - " const $type$* p = $casted_member$;\n" - " return p != nullptr ? *p : reinterpret_cast(\n" - " $type_default_instance$);\n" - "}\n" - "inline const $type$& $classname$::$name$() const {\n" - "$annotate_get$" - " // @@protoc_insertion_point(field_get:$full_name$)\n" - " return _internal_$name$();\n" - "}\n"); - - format( - "inline void $classname$::unsafe_arena_set_allocated_$name$(\n" - " $type$* $name$) {\n" - // If we're not on an arena, free whatever we were holding before. - // (If we are on arena, we can just forget the earlier pointer.) - " if (GetArenaForAllocation() == nullptr) {\n" - " delete reinterpret_cast<::$proto_ns$::MessageLite*>($name$_);\n" - " }\n"); - if (implicit_weak_field_) { - format( - " $name$_ = " - "reinterpret_cast<::$proto_ns$::MessageLite*>($name$);\n"); - } else { - format(" $name$_ = $name$;\n"); - } - format( - " if ($name$) {\n" - " $set_hasbit$\n" - " } else {\n" - " $clear_hasbit$\n" - " }\n" - "$annotate_set$" - " // @@protoc_insertion_point(field_unsafe_arena_set_allocated" - ":$full_name$)\n" - "}\n"); - format( - "inline $type$* $classname$::$release_name$() {\n" - "$type_reference_function$" - "$annotate_release$" - " $clear_hasbit$\n" - " $type$* temp = $casted_member$;\n" - " $name$_ = nullptr;\n" - "#ifdef PROTOBUF_FORCE_COPY_IN_RELEASE\n" - " auto* old = reinterpret_cast<::$proto_ns$::MessageLite*>(temp);\n" - " temp = ::$proto_ns$::internal::DuplicateIfNonNull(temp);\n" - " if (GetArenaForAllocation() == nullptr) { delete old; }\n" - "#else // PROTOBUF_FORCE_COPY_IN_RELEASE\n" - " if (GetArenaForAllocation() != nullptr) {\n" - " temp = ::$proto_ns$::internal::DuplicateIfNonNull(temp);\n" - " }\n" - "#endif // !PROTOBUF_FORCE_COPY_IN_RELEASE\n" - " return temp;\n" - "}\n" - "inline $type$* $classname$::unsafe_arena_release_$name$() {\n" - "$annotate_release$" - " // @@protoc_insertion_point(field_release:$full_name$)\n" - "$type_reference_function$" - " $clear_hasbit$\n" - " $type$* temp = $casted_member$;\n" - " $name$_ = nullptr;\n" - " return temp;\n" - "}\n"); - - format( - "inline $type$* $classname$::_internal_mutable_$name$() {\n" - "$type_reference_function$" - " $set_hasbit$\n" - " if ($name$_ == nullptr) {\n" - " auto* p = CreateMaybeMessage<$type$>(GetArenaForAllocation());\n"); - if (implicit_weak_field_) { - format(" $name$_ = reinterpret_cast<::$proto_ns$::MessageLite*>(p);\n"); - } else { - format(" $name$_ = p;\n"); - } - format( - " }\n" - " return $casted_member$;\n" - "}\n" - "inline $type$* $classname$::mutable_$name$() {\n" - " $type$* _msg = _internal_mutable_$name$();\n" - "$annotate_mutable$" - " // @@protoc_insertion_point(field_mutable:$full_name$)\n" - " return _msg;\n" - "}\n"); - - // We handle the most common case inline, and delegate less common cases to - // the slow fallback function. - format( - "inline void $classname$::set_allocated_$name$($type$* $name$) {\n" - " ::$proto_ns$::Arena* message_arena = GetArenaForAllocation();\n"); - format(" if (message_arena == nullptr) {\n"); - if (IsCrossFileMessage(descriptor_)) { - format( - " delete reinterpret_cast< ::$proto_ns$::MessageLite*>($name$_);\n"); - } else { - format(" delete $name$_;\n"); - } - format( - " }\n" - " if ($name$) {\n"); - if (IsCrossFileMessage(descriptor_)) { - // We have to read the arena through the virtual method, because the type - // isn't defined in this file. - format( - " ::$proto_ns$::Arena* submessage_arena =\n" - " ::$proto_ns$::Arena::InternalHelper<\n" - " ::$proto_ns$::MessageLite>::GetOwningArena(\n" - " reinterpret_cast<::$proto_ns$::MessageLite*>(" - "$name$));\n"); - } else { - format( - " ::$proto_ns$::Arena* submessage_arena =\n" - " ::$proto_ns$::Arena::InternalHelper<$type$>::GetOwningArena(" - "$name$);\n"); - } - format( - " if (message_arena != submessage_arena) {\n" - " $name$ = ::$proto_ns$::internal::GetOwnedMessage(\n" - " message_arena, $name$, submessage_arena);\n" - " }\n" - " $set_hasbit$\n" - " } else {\n" - " $clear_hasbit$\n" - " }\n"); - if (implicit_weak_field_) { - format(" $name$_ = reinterpret_cast($name$);\n"); - } else { - format(" $name$_ = $name$;\n"); - } - format( - "$annotate_set$" - " // @@protoc_insertion_point(field_set_allocated:$full_name$)\n" - "}\n"); -} - -void MessageFieldGenerator::GenerateInternalAccessorDeclarations( - io::Printer* printer) const { - Formatter format(printer, variables_); - if (implicit_weak_field_) { - format( - "static const ::$proto_ns$::MessageLite& $name$(" - "const $classname$* msg);\n" - "static ::$proto_ns$::MessageLite* mutable_$name$(" - "$classname$* msg);\n"); - } else { - format("static const $type$& $name$(const $classname$* msg);\n"); - } -} - -void MessageFieldGenerator::GenerateInternalAccessorDefinitions( - io::Printer* printer) const { - // In theory, these accessors could be inline in _Internal. However, in - // practice, the linker is then not able to throw them out making implicit - // weak dependencies not work at all. - Formatter format(printer, variables_); - if (implicit_weak_field_) { - // These private accessors are used by MergeFrom and - // MergePartialFromCodedStream, and their purpose is to provide access to - // the field without creating a strong dependency on the message type. - format( - "const ::$proto_ns$::MessageLite& $classname$::_Internal::$name$(\n" - " const $classname$* msg) {\n" - " if (msg->$name$_ != nullptr) {\n" - " return *msg->$name$_;\n" - " } else if ($type_default_instance_ptr$ != nullptr) {\n" - " return *reinterpret_cast(\n" - " $type_default_instance_ptr$);\n" - " } else {\n" - " return " - "*::$proto_ns$::internal::ImplicitWeakMessage::default_instance();\n" - " }\n" - "}\n"); - format( - "::$proto_ns$::MessageLite*\n" - "$classname$::_Internal::mutable_$name$($classname$* msg) {\n"); - if (HasHasbit(descriptor_)) { - format(" msg->$set_hasbit$\n"); - } - format( - " if (msg->$name$_ == nullptr) {\n" - " if ($type_default_instance_ptr$ == nullptr) {\n" - " msg->$name$_ = ::$proto_ns$::Arena::CreateMessage<\n" - " ::$proto_ns$::internal::ImplicitWeakMessage>(\n" - " msg->GetArenaForAllocation());\n" - " } else {\n" - " msg->$name$_ = \n" - " reinterpret_cast(\n" - " $type_default_instance_ptr$)->New(\n" - " msg->GetArenaForAllocation());\n" - " }\n" - " }\n" - " return msg->$name$_;\n" - "}\n"); - } else { - // This inline accessor directly returns member field and is used in - // Serialize such that AFDO profile correctly captures access information to - // message fields under serialize. - format( - "const $type$&\n" - "$classname$::_Internal::$name$(const $classname$* msg) {\n" - " return *msg->$field_member$;\n" - "}\n"); - } -} - -void MessageFieldGenerator::GenerateClearingCode(io::Printer* printer) const { - GOOGLE_CHECK(!IsFieldStripped(descriptor_, options_)); - - Formatter format(printer, variables_); - if (!HasHasbit(descriptor_)) { - // If we don't have has-bits, message presence is indicated only by ptr != - // NULL. Thus on clear, we need to delete the object. - format( - "if (GetArenaForAllocation() == nullptr && $name$_ != nullptr) {\n" - " delete $name$_;\n" - "}\n" - "$name$_ = nullptr;\n"); - } else { - format("if ($name$_ != nullptr) $name$_->Clear();\n"); - } -} - -void MessageFieldGenerator::GenerateMessageClearingCode( - io::Printer* printer) const { - GOOGLE_CHECK(!IsFieldStripped(descriptor_, options_)); - - Formatter format(printer, variables_); - if (!HasHasbit(descriptor_)) { - // If we don't have has-bits, message presence is indicated only by ptr != - // NULL. Thus on clear, we need to delete the object. - format( - "if (GetArenaForAllocation() == nullptr && $name$_ != nullptr) {\n" - " delete $name$_;\n" - "}\n" - "$name$_ = nullptr;\n"); - } else { - format( - "$DCHK$($name$_ != nullptr);\n" - "$name$_->Clear();\n"); - } -} - -void MessageFieldGenerator::GenerateMergingCode(io::Printer* printer) const { - GOOGLE_CHECK(!IsFieldStripped(descriptor_, options_)); - - Formatter format(printer, variables_); - if (implicit_weak_field_) { - format( - "_Internal::mutable_$name$(this)->CheckTypeAndMergeFrom(\n" - " _Internal::$name$(&from));\n"); - } else { - format( - "_internal_mutable_$name$()->$type$::MergeFrom(from._internal_$name$())" - ";\n"); - } -} - -void MessageFieldGenerator::GenerateSwappingCode(io::Printer* printer) const { - GOOGLE_CHECK(!IsFieldStripped(descriptor_, options_)); - - Formatter format(printer, variables_); - format("swap($name$_, other->$name$_);\n"); -} - -void MessageFieldGenerator::GenerateDestructorCode(io::Printer* printer) const { - GOOGLE_CHECK(!IsFieldStripped(descriptor_, options_)); - - Formatter format(printer, variables_); - if (options_.opensource_runtime) { - // TODO(gerbens) Remove this when we don't need to destruct default - // instances. In google3 a default instance will never get deleted so we - // don't need to worry about that but in opensource protobuf default - // instances are deleted in shutdown process and we need to take special - // care when handling them. - format("if (this != internal_default_instance()) "); - } - format("delete $name$_;\n"); -} - -void MessageFieldGenerator::GenerateConstructorCode( - io::Printer* printer) const { - GOOGLE_CHECK(!IsFieldStripped(descriptor_, options_)); - - Formatter format(printer, variables_); - format("$name$_ = nullptr;\n"); -} - -void MessageFieldGenerator::GenerateCopyConstructorCode( - io::Printer* printer) const { - GOOGLE_CHECK(!IsFieldStripped(descriptor_, options_)); - - Formatter format(printer, variables_); - format( - "if (from._internal_has_$name$()) {\n" - " $name$_ = new $type$(*from.$name$_);\n" - "} else {\n" - " $name$_ = nullptr;\n" - "}\n"); -} - -void MessageFieldGenerator::GenerateSerializeWithCachedSizesToArray( - io::Printer* printer) const { - GOOGLE_CHECK(!IsFieldStripped(descriptor_, options_)); - - Formatter format(printer, variables_); - format( - "target = stream->EnsureSpace(target);\n" - "target = ::$proto_ns$::internal::WireFormatLite::\n" - " InternalWrite$declared_type$(\n" - " $number$, _Internal::$name$(this), target, stream);\n"); -} - -void MessageFieldGenerator::GenerateByteSize(io::Printer* printer) const { - GOOGLE_CHECK(!IsFieldStripped(descriptor_, options_)); - - Formatter format(printer, variables_); - format( - "total_size += $tag_size$ +\n" - " ::$proto_ns$::internal::WireFormatLite::$declared_type$Size(\n" - " *$field_member$);\n"); -} - -void MessageFieldGenerator::GenerateIsInitialized(io::Printer* printer) const { - GOOGLE_CHECK(!IsFieldStripped(descriptor_, options_)); - - if (!has_required_fields_) return; - - Formatter format(printer, variables_); - format( - "if (_internal_has_$name$()) {\n" - " if (!$name$_->IsInitialized()) return false;\n" - "}\n"); -} - -void MessageFieldGenerator::GenerateConstinitInitializer( - io::Printer* printer) const { - Formatter format(printer, variables_); - format("$name$_(nullptr)"); -} - -// =================================================================== - -MessageOneofFieldGenerator::MessageOneofFieldGenerator( - const FieldDescriptor* descriptor, const Options& options, - MessageSCCAnalyzer* scc_analyzer) - : MessageFieldGenerator(descriptor, options, scc_analyzer) { - SetCommonOneofFieldVariables(descriptor, &variables_); -} - -MessageOneofFieldGenerator::~MessageOneofFieldGenerator() {} - -void MessageOneofFieldGenerator::GenerateNonInlineAccessorDefinitions( - io::Printer* printer) const { - Formatter format(printer, variables_); - format( - "void $classname$::set_allocated_$name$($type$* $name$) {\n" - " ::$proto_ns$::Arena* message_arena = GetArenaForAllocation();\n" - " clear_$oneof_name$();\n" - " if ($name$) {\n"); - if (descriptor_->file() != descriptor_->message_type()->file()) { - // We have to read the arena through the virtual method, because the type - // isn't defined in this file. - format( - " ::$proto_ns$::Arena* submessage_arena =\n" - " ::$proto_ns$::Arena::InternalHelper<\n" - " ::$proto_ns$::MessageLite>::GetOwningArena(\n" - " reinterpret_cast<::$proto_ns$::MessageLite*>(" - "$name$));\n"); - } else { - format( - " ::$proto_ns$::Arena* submessage_arena =\n" - " ::$proto_ns$::Arena::InternalHelper<" - "$type$>::GetOwningArena($name$);\n"); - } - format( - " if (message_arena != submessage_arena) {\n" - " $name$ = ::$proto_ns$::internal::GetOwnedMessage(\n" - " message_arena, $name$, submessage_arena);\n" - " }\n" - " set_has_$name$();\n" - " $field_member$ = $name$;\n" - " }\n" - "$annotate_set$" - " // @@protoc_insertion_point(field_set_allocated:$full_name$)\n" - "}\n"); -} - -void MessageOneofFieldGenerator::GenerateInlineAccessorDefinitions( - io::Printer* printer) const { - Formatter format(printer, variables_); - format( - "inline $type$* $classname$::$release_name$() {\n" - "$annotate_release$" - " // @@protoc_insertion_point(field_release:$full_name$)\n" - " if (_internal_has_$name$()) {\n" - " clear_has_$oneof_name$();\n" - " $type$* temp = $field_member$;\n" - " if (GetArenaForAllocation() != nullptr) {\n" - " temp = ::$proto_ns$::internal::DuplicateIfNonNull(temp);\n" - " }\n" - " $field_member$ = nullptr;\n" - " return temp;\n" - " } else {\n" - " return nullptr;\n" - " }\n" - "}\n"); - - format( - "inline const $type$& $classname$::_internal_$name$() const {\n" - " return _internal_has_$name$()\n" - " ? *$field_member$\n" - " : reinterpret_cast< $type$&>($type_default_instance$);\n" - "}\n" - "inline const $type$& $classname$::$name$() const {\n" - "$annotate_get$" - " // @@protoc_insertion_point(field_get:$full_name$)\n" - " return _internal_$name$();\n" - "}\n" - "inline $type$* $classname$::unsafe_arena_release_$name$() {\n" - "$annotate_release$" - " // @@protoc_insertion_point(field_unsafe_arena_release" - ":$full_name$)\n" - " if (_internal_has_$name$()) {\n" - " clear_has_$oneof_name$();\n" - " $type$* temp = $field_member$;\n" - " $field_member$ = nullptr;\n" - " return temp;\n" - " } else {\n" - " return nullptr;\n" - " }\n" - "}\n" - "inline void $classname$::unsafe_arena_set_allocated_$name$" - "($type$* $name$) {\n" - // We rely on the oneof clear method to free the earlier contents of - // this oneof. We can directly use the pointer we're given to set the - // new value. - " clear_$oneof_name$();\n" - " if ($name$) {\n" - " set_has_$name$();\n" - " $field_member$ = $name$;\n" - " }\n" - "$annotate_set$" - " // @@protoc_insertion_point(field_unsafe_arena_set_allocated:" - "$full_name$)\n" - "}\n" - "inline $type$* $classname$::_internal_mutable_$name$() {\n" - " if (!_internal_has_$name$()) {\n" - " clear_$oneof_name$();\n" - " set_has_$name$();\n" - " $field_member$ = CreateMaybeMessage< $type$ " - ">(GetArenaForAllocation());\n" - " }\n" - " return $field_member$;\n" - "}\n" - "inline $type$* $classname$::mutable_$name$() {\n" - " $type$* _msg = _internal_mutable_$name$();\n" - "$annotate_mutable$" - " // @@protoc_insertion_point(field_mutable:$full_name$)\n" - " return _msg;\n" - "}\n"); -} - -void MessageOneofFieldGenerator::GenerateClearingCode( - io::Printer* printer) const { - GOOGLE_CHECK(!IsFieldStripped(descriptor_, options_)); - - Formatter format(printer, variables_); - format( - "if (GetArenaForAllocation() == nullptr) {\n" - " delete $field_member$;\n" - "}\n"); -} - -void MessageOneofFieldGenerator::GenerateMessageClearingCode( - io::Printer* printer) const { - GenerateClearingCode(printer); -} - -void MessageOneofFieldGenerator::GenerateSwappingCode( - io::Printer* printer) const { - // Don't print any swapping code. Swapping the union will swap this field. -} - -void MessageOneofFieldGenerator::GenerateDestructorCode( - io::Printer* printer) const { - // We inherit from MessageFieldGenerator, so we need to override the default - // behavior. -} - -void MessageOneofFieldGenerator::GenerateConstructorCode( - io::Printer* printer) const { - // Don't print any constructor code. The field is in a union. We allocate - // space only when this field is used. -} - -void MessageOneofFieldGenerator::GenerateIsInitialized( - io::Printer* printer) const { - if (!has_required_fields_) return; - - Formatter format(printer, variables_); - format( - "if (_internal_has_$name$()) {\n" - " if (!$field_member$->IsInitialized()) return false;\n" - "}\n"); -} - -// =================================================================== - -RepeatedMessageFieldGenerator::RepeatedMessageFieldGenerator( - const FieldDescriptor* descriptor, const Options& options, - MessageSCCAnalyzer* scc_analyzer) - : FieldGenerator(descriptor, options), - implicit_weak_field_( - IsImplicitWeakField(descriptor, options, scc_analyzer)), - has_required_fields_( - scc_analyzer->HasRequiredFields(descriptor->message_type())) { - SetMessageVariables(descriptor, options, implicit_weak_field_, &variables_); -} - -RepeatedMessageFieldGenerator::~RepeatedMessageFieldGenerator() {} - -void RepeatedMessageFieldGenerator::GeneratePrivateMembers( - io::Printer* printer) const { - Formatter format(printer, variables_); - if (implicit_weak_field_) { - format("::$proto_ns$::WeakRepeatedPtrField< $type$ > $name$_;\n"); - } else { - format("::$proto_ns$::RepeatedPtrField< $type$ > $name$_;\n"); - } -} - -void RepeatedMessageFieldGenerator::GenerateAccessorDeclarations( - io::Printer* printer) const { - Formatter format(printer, variables_); - if (IsFieldStripped(descriptor_, options_)) { - format( - "$deprecated_attr$$type$* ${1$mutable_$name$$}$(int index) { " - "__builtin_trap(); }\n" - "$deprecated_attr$::$proto_ns$::RepeatedPtrField< $type$ >*\n" - " ${1$mutable_$name$$}$() { __builtin_trap(); }\n" - "$deprecated_attr$const $type$& ${1$$name$$}$(int index) const { " - "__builtin_trap(); }\n" - "$deprecated_attr$$type$* ${1$add_$name$$}$() { " - "__builtin_trap(); }\n" - "$deprecated_attr$const ::$proto_ns$::RepeatedPtrField< $type$ >&\n" - " ${1$$name$$}$() const { __builtin_trap(); }\n", - descriptor_); - return; - } - format( - "$deprecated_attr$$type$* ${1$mutable_$name$$}$(int index);\n" - "$deprecated_attr$::$proto_ns$::RepeatedPtrField< $type$ >*\n" - " ${1$mutable_$name$$}$();\n", - descriptor_); - if (!IsFieldStripped(descriptor_, options_)) { - format( - "private:\n" - "const $type$& ${1$_internal_$name$$}$(int index) const;\n" - "$type$* ${1$_internal_add_$name$$}$();\n" - "public:\n", - descriptor_); - } - format( - "$deprecated_attr$const $type$& ${1$$name$$}$(int index) const;\n" - "$deprecated_attr$$type$* ${1$add_$name$$}$();\n" - "$deprecated_attr$const ::$proto_ns$::RepeatedPtrField< $type$ >&\n" - " ${1$$name$$}$() const;\n", - descriptor_); -} - -void RepeatedMessageFieldGenerator::GenerateInlineAccessorDefinitions( - io::Printer* printer) const { - Formatter format(printer, variables_); - format.Set("weak", implicit_weak_field_ ? ".weak" : ""); - - format( - "inline $type$* $classname$::mutable_$name$(int index) {\n" - "$annotate_mutable$" - // TODO(dlj): move insertion points - " // @@protoc_insertion_point(field_mutable:$full_name$)\n" - "$type_reference_function$" - " return $name$_$weak$.Mutable(index);\n" - "}\n" - "inline ::$proto_ns$::RepeatedPtrField< $type$ >*\n" - "$classname$::mutable_$name$() {\n" - "$annotate_mutable_list$" - " // @@protoc_insertion_point(field_mutable_list:$full_name$)\n" - "$type_reference_function$" - " return &$name$_$weak$;\n" - "}\n"); - - if (options_.safe_boundary_check) { - format( - "inline const $type$& $classname$::_internal_$name$(int index) const " - "{\n" - " return $name$_$weak$.InternalCheckedGet(index,\n" - " reinterpret_cast($type_default_instance$));\n" - "}\n"); - } else { - format( - "inline const $type$& $classname$::_internal_$name$(int index) const " - "{\n" - "$type_reference_function$" - " return $name$_$weak$.Get(index);\n" - "}\n"); - } - - format( - "inline const $type$& $classname$::$name$(int index) const {\n" - "$annotate_get$" - " // @@protoc_insertion_point(field_get:$full_name$)\n" - " return _internal_$name$(index);\n" - "}\n" - "inline $type$* $classname$::_internal_add_$name$() {\n" - " return $name$_$weak$.Add();\n" - "}\n" - "inline $type$* $classname$::add_$name$() {\n" - " $type$* _add = _internal_add_$name$();\n" - "$annotate_add_mutable$" - " // @@protoc_insertion_point(field_add:$full_name$)\n" - " return _add;\n" - "}\n"); - - format( - "inline const ::$proto_ns$::RepeatedPtrField< $type$ >&\n" - "$classname$::$name$() const {\n" - "$annotate_list$" - " // @@protoc_insertion_point(field_list:$full_name$)\n" - "$type_reference_function$" - " return $name$_$weak$;\n" - "}\n"); -} - -void RepeatedMessageFieldGenerator::GenerateClearingCode( - io::Printer* printer) const { - GOOGLE_CHECK(!IsFieldStripped(descriptor_, options_)); - - Formatter format(printer, variables_); - format("$name$_.Clear();\n"); -} - -void RepeatedMessageFieldGenerator::GenerateMergingCode( - io::Printer* printer) const { - GOOGLE_CHECK(!IsFieldStripped(descriptor_, options_)); - - Formatter format(printer, variables_); - format("$name$_.MergeFrom(from.$name$_);\n"); -} - -void RepeatedMessageFieldGenerator::GenerateSwappingCode( - io::Printer* printer) const { - GOOGLE_CHECK(!IsFieldStripped(descriptor_, options_)); - - Formatter format(printer, variables_); - format("$name$_.InternalSwap(&other->$name$_);\n"); -} - -void RepeatedMessageFieldGenerator::GenerateConstructorCode( - io::Printer* printer) const { - // Not needed for repeated fields. -} - -void RepeatedMessageFieldGenerator::GenerateSerializeWithCachedSizesToArray( - io::Printer* printer) const { - GOOGLE_CHECK(!IsFieldStripped(descriptor_, options_)); - - Formatter format(printer, variables_); - if (implicit_weak_field_) { - format( - "for (auto it = this->$name$_.pointer_begin(),\n" - " end = this->$name$_.pointer_end(); it < end; ++it) {\n" - " target = stream->EnsureSpace(target);\n" - " target = ::$proto_ns$::internal::WireFormatLite::\n" - " InternalWrite$declared_type$($number$, **it, target, stream);\n" - "}\n"); - } else { - format( - "for (unsigned int i = 0,\n" - " n = static_cast(this->_internal_$name$_size()); i < " - "n; i++) " - "{\n" - " target = stream->EnsureSpace(target);\n" - " target = ::$proto_ns$::internal::WireFormatLite::\n" - " InternalWrite$declared_type$($number$, " - "this->_internal_$name$(i), target, stream);\n" - "}\n"); - } -} - -void RepeatedMessageFieldGenerator::GenerateByteSize( - io::Printer* printer) const { - GOOGLE_CHECK(!IsFieldStripped(descriptor_, options_)); - - Formatter format(printer, variables_); - format( - "total_size += $tag_size$UL * this->_internal_$name$_size();\n" - "for (const auto& msg : this->$name$_) {\n" - " total_size +=\n" - " ::$proto_ns$::internal::WireFormatLite::$declared_type$Size(msg);\n" - "}\n"); -} - -void RepeatedMessageFieldGenerator::GenerateIsInitialized( - io::Printer* printer) const { - GOOGLE_CHECK(!IsFieldStripped(descriptor_, options_)); - - if (!has_required_fields_) return; - - Formatter format(printer, variables_); - if (implicit_weak_field_) { - format( - "if (!::$proto_ns$::internal::AllAreInitializedWeak($name$_.weak))\n" - " return false;\n"); - } else { - format( - "if (!::$proto_ns$::internal::AllAreInitialized($name$_))\n" - " return false;\n"); - } -} - -void RepeatedMessageFieldGenerator::GenerateConstinitInitializer( - io::Printer* printer) const { - Formatter format(printer, variables_); - format("$name$_()"); -} - -} // namespace cpp -} // namespace compiler -} // namespace protobuf -} // namespace google diff --git a/extra/protobuf/protobuf-3.19.4/src/google/protobuf/compiler/cpp/cpp_message_field.h b/extra/protobuf/protobuf-3.19.4/src/google/protobuf/compiler/cpp/cpp_message_field.h deleted file mode 100644 index 2beac6253b9f..000000000000 --- a/extra/protobuf/protobuf-3.19.4/src/google/protobuf/compiler/cpp/cpp_message_field.h +++ /dev/null @@ -1,144 +0,0 @@ -// Protocol Buffers - Google's data interchange format -// Copyright 2008 Google Inc. All rights reserved. -// https://developers.google.com/protocol-buffers/ -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// * Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// * Redistributions in binary form must reproduce the above -// copyright notice, this list of conditions and the following disclaimer -// in the documentation and/or other materials provided with the -// distribution. -// * Neither the name of Google Inc. nor the names of its -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -// Author: kenton@google.com (Kenton Varda) -// Based on original Protocol Buffers design by -// Sanjay Ghemawat, Jeff Dean, and others. - -#ifndef GOOGLE_PROTOBUF_COMPILER_CPP_MESSAGE_FIELD_H__ -#define GOOGLE_PROTOBUF_COMPILER_CPP_MESSAGE_FIELD_H__ - -#include -#include -#include -#include - -namespace google { -namespace protobuf { -namespace compiler { -namespace cpp { - -class MessageFieldGenerator : public FieldGenerator { - public: - MessageFieldGenerator(const FieldDescriptor* descriptor, - const Options& options, - MessageSCCAnalyzer* scc_analyzer); - ~MessageFieldGenerator() override; - - // implements FieldGenerator --------------------------------------- - void GeneratePrivateMembers(io::Printer* printer) const override; - void GenerateAccessorDeclarations(io::Printer* printer) const override; - void GenerateInlineAccessorDefinitions(io::Printer* printer) const override; - void GenerateNonInlineAccessorDefinitions( - io::Printer* printer) const override; - void GenerateInternalAccessorDeclarations( - io::Printer* printer) const override; - void GenerateInternalAccessorDefinitions(io::Printer* printer) const override; - void GenerateClearingCode(io::Printer* printer) const override; - void GenerateMessageClearingCode(io::Printer* printer) const override; - void GenerateMergingCode(io::Printer* printer) const override; - void GenerateSwappingCode(io::Printer* printer) const override; - void GenerateDestructorCode(io::Printer* printer) const override; - void GenerateConstructorCode(io::Printer* printer) const override; - void GenerateCopyConstructorCode(io::Printer* printer) const override; - void GenerateSerializeWithCachedSizesToArray( - io::Printer* printer) const override; - void GenerateByteSize(io::Printer* printer) const override; - void GenerateIsInitialized(io::Printer* printer) const override; - void GenerateConstinitInitializer(io::Printer* printer) const override; - - protected: - const bool implicit_weak_field_; - const bool has_required_fields_; - - private: - GOOGLE_DISALLOW_EVIL_CONSTRUCTORS(MessageFieldGenerator); -}; - -class MessageOneofFieldGenerator : public MessageFieldGenerator { - public: - MessageOneofFieldGenerator(const FieldDescriptor* descriptor, - const Options& options, - MessageSCCAnalyzer* scc_analyzer); - ~MessageOneofFieldGenerator() override; - - // implements FieldGenerator --------------------------------------- - void GenerateInlineAccessorDefinitions(io::Printer* printer) const override; - void GenerateNonInlineAccessorDefinitions( - io::Printer* printer) const override; - void GenerateClearingCode(io::Printer* printer) const override; - - // MessageFieldGenerator, from which we inherit, overrides this so we need to - // override it as well. - void GenerateMessageClearingCode(io::Printer* printer) const override; - void GenerateSwappingCode(io::Printer* printer) const override; - void GenerateDestructorCode(io::Printer* printer) const override; - void GenerateConstructorCode(io::Printer* printer) const override; - void GenerateIsInitialized(io::Printer* printer) const override; - - private: - GOOGLE_DISALLOW_EVIL_CONSTRUCTORS(MessageOneofFieldGenerator); -}; - -class RepeatedMessageFieldGenerator : public FieldGenerator { - public: - RepeatedMessageFieldGenerator(const FieldDescriptor* descriptor, - const Options& options, - MessageSCCAnalyzer* scc_analyzer); - ~RepeatedMessageFieldGenerator() override; - - // implements FieldGenerator --------------------------------------- - void GeneratePrivateMembers(io::Printer* printer) const override; - void GenerateAccessorDeclarations(io::Printer* printer) const override; - void GenerateInlineAccessorDefinitions(io::Printer* printer) const override; - void GenerateClearingCode(io::Printer* printer) const override; - void GenerateMergingCode(io::Printer* printer) const override; - void GenerateSwappingCode(io::Printer* printer) const override; - void GenerateConstructorCode(io::Printer* printer) const override; - void GenerateCopyConstructorCode(io::Printer* printer) const override {} - void GenerateSerializeWithCachedSizesToArray( - io::Printer* printer) const override; - void GenerateByteSize(io::Printer* printer) const override; - void GenerateIsInitialized(io::Printer* printer) const override; - void GenerateConstinitInitializer(io::Printer* printer) const override; - - private: - const bool implicit_weak_field_; - const bool has_required_fields_; - - GOOGLE_DISALLOW_EVIL_CONSTRUCTORS(RepeatedMessageFieldGenerator); -}; - -} // namespace cpp -} // namespace compiler -} // namespace protobuf -} // namespace google - -#endif // GOOGLE_PROTOBUF_COMPILER_CPP_MESSAGE_FIELD_H__ diff --git a/extra/protobuf/protobuf-3.19.4/src/google/protobuf/compiler/cpp/cpp_message_layout_helper.h b/extra/protobuf/protobuf-3.19.4/src/google/protobuf/compiler/cpp/cpp_message_layout_helper.h deleted file mode 100644 index 9d8063d9cab3..000000000000 --- a/extra/protobuf/protobuf-3.19.4/src/google/protobuf/compiler/cpp/cpp_message_layout_helper.h +++ /dev/null @@ -1,64 +0,0 @@ -// Protocol Buffers - Google's data interchange format -// Copyright 2008 Google Inc. All rights reserved. -// https://developers.google.com/protocol-buffers/ -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// * Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// * Redistributions in binary form must reproduce the above -// copyright notice, this list of conditions and the following disclaimer -// in the documentation and/or other materials provided with the -// distribution. -// * Neither the name of Google Inc. nor the names of its -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -// Author: seongkim@google.com (Seong Beom Kim) -// Based on original Protocol Buffers design by -// Sanjay Ghemawat, Jeff Dean, and others. - -#ifndef GOOGLE_PROTOBUF_COMPILER_CPP_MESSAGE_LAYOUT_HELPER_H__ -#define GOOGLE_PROTOBUF_COMPILER_CPP_MESSAGE_LAYOUT_HELPER_H__ - -#include -#include - -namespace google { -namespace protobuf { -namespace compiler { -namespace cpp { - -class MessageSCCAnalyzer; - -// Provides an abstract interface to optimize message layout -// by rearranging the fields of a message. -class MessageLayoutHelper { - public: - virtual ~MessageLayoutHelper() {} - - virtual void OptimizeLayout(std::vector* fields, - const Options& options, - MessageSCCAnalyzer* scc_analyzer) = 0; -}; - -} // namespace cpp -} // namespace compiler -} // namespace protobuf -} // namespace google - -#endif // GOOGLE_PROTOBUF_COMPILER_CPP_MESSAGE_LAYOUT_HELPER_H__ diff --git a/extra/protobuf/protobuf-3.19.4/src/google/protobuf/compiler/cpp/cpp_move_unittest.cc b/extra/protobuf/protobuf-3.19.4/src/google/protobuf/compiler/cpp/cpp_move_unittest.cc deleted file mode 100644 index eb7cd1c775ff..000000000000 --- a/extra/protobuf/protobuf-3.19.4/src/google/protobuf/compiler/cpp/cpp_move_unittest.cc +++ /dev/null @@ -1,169 +0,0 @@ -// Protocol Buffers - Google's data interchange format -// Copyright 2008 Google Inc. All rights reserved. -// https://developers.google.com/protocol-buffers/ -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// * Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// * Redistributions in binary form must reproduce the above -// copyright notice, this list of conditions and the following disclaimer -// in the documentation and/or other materials provided with the -// distribution. -// * Neither the name of Google Inc. nor the names of its -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -#include -#include -#include -#include - -#if LANG_CXX11 -#include -#endif - -namespace google { -namespace protobuf { -namespace compiler { -namespace cpp { - -// Can't use an anonymous namespace here due to brokenness of Tru64 compiler. -namespace cpp_unittest { - -// Moves are enabled only when compiling with a C++11 compiler or newer. -#if LANG_CXX11 - -TEST(MovableMessageTest, MoveConstructor) { - protobuf_unittest::TestAllTypes message1; - TestUtil::SetAllFields(&message1); - const auto* nested = &message1.optional_nested_message(); - - protobuf_unittest::TestAllTypes message2(std::move(message1)); - TestUtil::ExpectAllFieldsSet(message2); - - // Check if the optional_nested_message was actually moved (and not just - // copied). - EXPECT_EQ(nested, &message2.optional_nested_message()); - EXPECT_NE(nested, &message1.optional_nested_message()); -} - -TEST(MovableMessageTest, MoveAssignmentOperator) { - protobuf_unittest::TestAllTypes message1; - TestUtil::SetAllFields(&message1); - const auto* nested = &message1.optional_nested_message(); - - protobuf_unittest::TestAllTypes message2; - message2 = std::move(message1); - TestUtil::ExpectAllFieldsSet(message2); - - // Check if the optional_nested_message was actually moved (and not just - // copied). - EXPECT_EQ(nested, &message2.optional_nested_message()); - EXPECT_NE(nested, &message1.optional_nested_message()); -} - -TEST(MovableMessageTest, SelfMoveAssignment) { - // The `self` reference is necessary to defeat -Wself-move. - protobuf_unittest::TestAllTypes message, &self = message; - TestUtil::SetAllFields(&message); - message = std::move(self); - TestUtil::ExpectAllFieldsSet(message); -} - -TEST(MovableMessageTest, MoveSameArena) { - Arena arena; - - auto* message1_on_arena = - Arena::CreateMessage(&arena); - TestUtil::SetAllFields(message1_on_arena); - const auto* nested = &message1_on_arena->optional_nested_message(); - - auto* message2_on_arena = - Arena::CreateMessage(&arena); - - // Moving messages on the same arena should lead to swapped pointers. - *message2_on_arena = std::move(*message1_on_arena); - EXPECT_EQ(nested, &message2_on_arena->optional_nested_message()); -} - -TEST(MovableMessageTest, MoveDifferentArenas) { - Arena arena1, arena2; - - auto* message1_on_arena = - Arena::CreateMessage(&arena1); - TestUtil::SetAllFields(message1_on_arena); - const auto* nested = &message1_on_arena->optional_nested_message(); - - auto* message2_on_arena = - Arena::CreateMessage(&arena2); - - // Moving messages on two different arenas should lead to a copy. - *message2_on_arena = std::move(*message1_on_arena); - EXPECT_NE(nested, &message2_on_arena->optional_nested_message()); - TestUtil::ExpectAllFieldsSet(*message1_on_arena); - TestUtil::ExpectAllFieldsSet(*message2_on_arena); -} - -TEST(MovableMessageTest, MoveFromArena) { - Arena arena; - - auto* message1_on_arena = - Arena::CreateMessage(&arena); - TestUtil::SetAllFields(message1_on_arena); - const auto* nested = &message1_on_arena->optional_nested_message(); - - protobuf_unittest::TestAllTypes message2; - - // Moving from a message on the arena should lead to a copy. - message2 = std::move(*message1_on_arena); - EXPECT_NE(nested, &message2.optional_nested_message()); - TestUtil::ExpectAllFieldsSet(*message1_on_arena); - TestUtil::ExpectAllFieldsSet(message2); -} - -TEST(MovableMessageTest, MoveToArena) { - Arena arena; - - protobuf_unittest::TestAllTypes message1; - TestUtil::SetAllFields(&message1); - const auto* nested = &message1.optional_nested_message(); - - auto* message2_on_arena = - Arena::CreateMessage(&arena); - - // Moving to a message on the arena should lead to a copy. - *message2_on_arena = std::move(message1); - EXPECT_NE(nested, &message2_on_arena->optional_nested_message()); - TestUtil::ExpectAllFieldsSet(message1); - TestUtil::ExpectAllFieldsSet(*message2_on_arena); -} - -TEST(MovableMessageTest, Noexcept) { - EXPECT_TRUE( - std::is_nothrow_move_constructible()); - EXPECT_TRUE(std::is_nothrow_move_assignable()); -} - -#endif // LANG_CXX11 - -} // namespace cpp_unittest - -} // namespace cpp -} // namespace compiler -} // namespace protobuf -} // namespace google diff --git a/extra/protobuf/protobuf-3.19.4/src/google/protobuf/compiler/cpp/cpp_names.h b/extra/protobuf/protobuf-3.19.4/src/google/protobuf/compiler/cpp/cpp_names.h deleted file mode 100644 index 6bcbff061681..000000000000 --- a/extra/protobuf/protobuf-3.19.4/src/google/protobuf/compiler/cpp/cpp_names.h +++ /dev/null @@ -1,96 +0,0 @@ -// Protocol Buffers - Google's data interchange format -// Copyright 2008 Google Inc. All rights reserved. -// https://developers.google.com/protocol-buffers/ -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// * Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// * Redistributions in binary form must reproduce the above -// copyright notice, this list of conditions and the following disclaimer -// in the documentation and/or other materials provided with the -// distribution. -// * Neither the name of Google Inc. nor the names of its -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -#ifndef GOOGLE_PROTOBUF_COMPILER_CPP_NAMES_H__ -#define GOOGLE_PROTOBUF_COMPILER_CPP_NAMES_H__ - -#include - -#include - -namespace google { -namespace protobuf { - -class Descriptor; -class EnumDescriptor; -class EnumValueDescriptor; -class FieldDescriptor; - -namespace compiler { -namespace cpp { - -// Returns the unqualified C++ name. -// -// For example, if you had: -// package foo.bar; -// message Baz { message Qux {} } -// Then the non-qualified version would be: -// Baz_Qux -std::string ClassName(const Descriptor* descriptor); -std::string ClassName(const EnumDescriptor* enum_descriptor); - -// Returns the fully qualified C++ name. -// -// For example, if you had: -// package foo.bar; -// message Baz { message Qux {} } -// Then the qualified ClassName for Qux would be: -// ::foo::bar::Baz_Qux -std::string QualifiedClassName(const Descriptor* d); -std::string QualifiedClassName(const EnumDescriptor* d); -std::string QualifiedExtensionName(const FieldDescriptor* d); - -// Get the (unqualified) name that should be used for this field in C++ code. -// The name is coerced to lower-case to emulate proto1 behavior. People -// should be using lowercase-with-underscores style for proto field names -// anyway, so normally this just returns field->name(). -std::string FieldName(const FieldDescriptor* field); - -// Requires that this field is in a oneof. Returns the (unqualified) case -// constant for this field. -std::string OneofCaseConstantName(const FieldDescriptor* field); -// Returns the quafilied case constant for this field. -std::string QualifiedOneofCaseConstantName(const FieldDescriptor* field); - -// Get the (unqualified) name that should be used for this enum value in C++ -// code. -std::string EnumValueName(const EnumValueDescriptor* enum_value); - -// Strips ".proto" or ".protodevel" from the end of a filename. -PROTOC_EXPORT std::string StripProto(const std::string& filename); - -} // namespace cpp -} // namespace compiler -} // namespace protobuf -} // namespace google - -#include - -#endif // GOOGLE_PROTOBUF_COMPILER_CPP_NAMES_H__ diff --git a/extra/protobuf/protobuf-3.19.4/src/google/protobuf/compiler/cpp/cpp_options.h b/extra/protobuf/protobuf-3.19.4/src/google/protobuf/compiler/cpp/cpp_options.h deleted file mode 100644 index d0f16d03479a..000000000000 --- a/extra/protobuf/protobuf-3.19.4/src/google/protobuf/compiler/cpp/cpp_options.h +++ /dev/null @@ -1,95 +0,0 @@ -// Protocol Buffers - Google's data interchange format -// Copyright 2008 Google Inc. All rights reserved. -// https://developers.google.com/protocol-buffers/ -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// * Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// * Redistributions in binary form must reproduce the above -// copyright notice, this list of conditions and the following disclaimer -// in the documentation and/or other materials provided with the -// distribution. -// * Neither the name of Google Inc. nor the names of its -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -// Author: rennie@google.com (Jeffrey Rennie) - -#ifndef GOOGLE_PROTOBUF_COMPILER_CPP_OPTIONS_H__ -#define GOOGLE_PROTOBUF_COMPILER_CPP_OPTIONS_H__ - -#include -#include - -namespace google { -namespace protobuf { -namespace compiler { -class AccessInfoMap; - -namespace cpp { - -enum class EnforceOptimizeMode { - kNoEnforcement, // Use the runtime specified by the file specific options. - kSpeed, // Full runtime with a generated code implementation. - kCodeSize, // Full runtime with a reflective implementation. - kLiteRuntime, -}; - -struct FieldListenerOptions { - bool inject_field_listener_events = false; - std::set forbidden_field_listener_events; -}; - -// Generator options (see generator.cc for a description of each): -struct Options { - std::string dllexport_decl; - bool safe_boundary_check = false; - bool proto_h = false; - bool transitive_pb_h = true; - bool annotate_headers = false; - EnforceOptimizeMode enforce_mode = EnforceOptimizeMode::kNoEnforcement; - bool table_driven_parsing = false; - bool table_driven_serialization = false; - bool lite_implicit_weak_fields = false; - bool bootstrap = false; - bool opensource_runtime = false; - bool annotate_accessor = false; - bool unused_field_stripping = false; - bool profile_driven_inline_string = true; - bool force_inline_string = false; - std::string runtime_include_base; - int num_cc_files = 0; - std::string annotation_pragma_name; - std::string annotation_guard_name; - const AccessInfoMap* access_info_map = nullptr; - enum { - kTCTableNever, - kTCTableGuarded, - kTCTableAlways - } tctable_mode = kTCTableNever; - FieldListenerOptions field_listener_options; - bool eagerly_verified_lazy = false; - bool force_eagerly_verified_lazy = false; -}; - -} // namespace cpp -} // namespace compiler -} // namespace protobuf -} // namespace google - -#endif // GOOGLE_PROTOBUF_COMPILER_CPP_OPTIONS_H__ diff --git a/extra/protobuf/protobuf-3.19.4/src/google/protobuf/compiler/cpp/cpp_padding_optimizer.cc b/extra/protobuf/protobuf-3.19.4/src/google/protobuf/compiler/cpp/cpp_padding_optimizer.cc deleted file mode 100644 index 0b660c75b7b3..000000000000 --- a/extra/protobuf/protobuf-3.19.4/src/google/protobuf/compiler/cpp/cpp_padding_optimizer.cc +++ /dev/null @@ -1,228 +0,0 @@ -// Protocol Buffers - Google's data interchange format -// Copyright 2008 Google Inc. All rights reserved. -// https://developers.google.com/protocol-buffers/ -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// * Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// * Redistributions in binary form must reproduce the above -// copyright notice, this list of conditions and the following disclaimer -// in the documentation and/or other materials provided with the -// distribution. -// * Neither the name of Google Inc. nor the names of its -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -#include - -#include - -namespace google { -namespace protobuf { -namespace compiler { -namespace cpp { - -namespace { - -// FieldGroup is just a helper for PaddingOptimizer below. It holds a vector of -// fields that are grouped together because they have compatible alignment, and -// a preferred location in the final field ordering. -class FieldGroup { - public: - FieldGroup() : preferred_location_(0) {} - - // A group with a single field. - FieldGroup(float preferred_location, const FieldDescriptor* field) - : preferred_location_(preferred_location), fields_(1, field) {} - - // Append the fields in 'other' to this group. - void Append(const FieldGroup& other) { - if (other.fields_.empty()) { - return; - } - // Preferred location is the average among all the fields, so we weight by - // the number of fields on each FieldGroup object. - preferred_location_ = (preferred_location_ * fields_.size() + - (other.preferred_location_ * other.fields_.size())) / - (fields_.size() + other.fields_.size()); - fields_.insert(fields_.end(), other.fields_.begin(), other.fields_.end()); - } - - void SetPreferredLocation(float location) { preferred_location_ = location; } - const std::vector& fields() const { return fields_; } - - // FieldGroup objects sort by their preferred location. - bool operator<(const FieldGroup& other) const { - return preferred_location_ < other.preferred_location_; - } - - private: - // "preferred_location_" is an estimate of where this group should go in the - // final list of fields. We compute this by taking the average index of each - // field in this group in the original ordering of fields. This is very - // approximate, but should put this group close to where its member fields - // originally went. - float preferred_location_; - std::vector fields_; - // We rely on the default copy constructor and operator= so this type can be - // used in a vector. -}; - -} // namespace - -// Reorder 'fields' so that if the fields are output into a c++ class in the new -// order, fields of similar family (see below) are together and within each -// family, alignment padding is minimized. -// -// We try to do this while keeping each field as close as possible to its field -// number order so that we don't reduce cache locality much for function that -// access each field in order. Originally, OptimizePadding used declaration -// order for its decisions, but generated code minus the serializer/parsers uses -// the output of OptimizePadding as well (stored in -// MessageGenerator::optimized_order_). Since the serializers use field number -// order, we use that as a tie-breaker. -// -// We classify each field into a particular "family" of fields, that we perform -// the same operation on in our generated functions. -// -// REPEATED is placed first, as the C++ compiler automatically initializes -// these fields in layout order. -// -// STRING is grouped next, as our Clear/SharedCtor/SharedDtor walks it and -// calls ArenaStringPtr::Destroy on each. -// -// LAZY_MESSAGE is grouped next, as it interferes with the ability to memset -// non-repeated fields otherwise. -// -// MESSAGE is grouped next, as our Clear/SharedDtor code walks it and calls -// delete on each. We initialize these fields with a NULL pointer (see -// MessageFieldGenerator::GenerateConstructorCode), which allows them to be -// memset. -// -// ZERO_INITIALIZABLE is memset in Clear/SharedCtor -// -// OTHER these fields are initialized one-by-one. -void PaddingOptimizer::OptimizeLayout( - std::vector* fields, const Options& options, - MessageSCCAnalyzer* scc_analyzer) { - // The sorted numeric order of Family determines the declaration order in the - // memory layout. - enum Family { - REPEATED = 0, - STRING = 1, - // Laying out LAZY_MESSAGE before MESSAGE allows a single memset to zero - // MESSAGE and ZERO_INITIALIZABLE fields together. - LAZY_MESSAGE = 2, - MESSAGE = 3, - ZERO_INITIALIZABLE = 4, - OTHER = 5, - kMaxFamily - }; - - // First divide fields into those that align to 1 byte, 4 bytes or 8 bytes. - std::vector aligned_to_1[kMaxFamily]; - std::vector aligned_to_4[kMaxFamily]; - std::vector aligned_to_8[kMaxFamily]; - for (int i = 0; i < fields->size(); ++i) { - const FieldDescriptor* field = (*fields)[i]; - - Family f = OTHER; - if (field->is_repeated()) { - f = REPEATED; - } else if (field->cpp_type() == FieldDescriptor::CPPTYPE_STRING) { - f = STRING; - } else if (field->cpp_type() == FieldDescriptor::CPPTYPE_MESSAGE) { - f = MESSAGE; - if (IsLazy(field, options, scc_analyzer)) { - f = LAZY_MESSAGE; - } - } else if (CanInitializeByZeroing(field)) { - f = ZERO_INITIALIZABLE; - } - - const int j = field->number(); - switch (EstimateAlignmentSize(field)) { - case 1: - aligned_to_1[f].push_back(FieldGroup(j, field)); - break; - case 4: - aligned_to_4[f].push_back(FieldGroup(j, field)); - break; - case 8: - aligned_to_8[f].push_back(FieldGroup(j, field)); - break; - default: - GOOGLE_LOG(FATAL) << "Unknown alignment size " << EstimateAlignmentSize(field) - << "for a field " << field->full_name() << "."; - } - } - - // For each family, group fields to optimize padding. - for (int f = 0; f < kMaxFamily; f++) { - // Now group fields aligned to 1 byte into sets of 4, and treat those like a - // single field aligned to 4 bytes. - for (int i = 0; i < aligned_to_1[f].size(); i += 4) { - FieldGroup field_group; - for (int j = i; j < aligned_to_1[f].size() && j < i + 4; ++j) { - field_group.Append(aligned_to_1[f][j]); - } - aligned_to_4[f].push_back(field_group); - } - // Sort by preferred location to keep fields as close to their field number - // order as possible. Using stable_sort ensures that the output is - // consistent across runs. - std::stable_sort(aligned_to_4[f].begin(), aligned_to_4[f].end()); - - // Now group fields aligned to 4 bytes (or the 4-field groups created above) - // into pairs, and treat those like a single field aligned to 8 bytes. - for (int i = 0; i < aligned_to_4[f].size(); i += 2) { - FieldGroup field_group; - for (int j = i; j < aligned_to_4[f].size() && j < i + 2; ++j) { - field_group.Append(aligned_to_4[f][j]); - } - if (i == aligned_to_4[f].size() - 1) { - if (f == OTHER) { - // Move incomplete 4-byte block to the beginning. This is done to - // pair with the (possible) leftover blocks from the - // ZERO_INITIALIZABLE family. - field_group.SetPreferredLocation(-1); - } else { - // Move incomplete 4-byte block to the end. - field_group.SetPreferredLocation(fields->size() + 1); - } - } - aligned_to_8[f].push_back(field_group); - } - // Sort by preferred location. - std::stable_sort(aligned_to_8[f].begin(), aligned_to_8[f].end()); - } - - // Now pull out all the FieldDescriptors in order. - fields->clear(); - for (int f = 0; f < kMaxFamily; ++f) { - for (int i = 0; i < aligned_to_8[f].size(); ++i) { - fields->insert(fields->end(), aligned_to_8[f][i].fields().begin(), - aligned_to_8[f][i].fields().end()); - } - } -} - -} // namespace cpp -} // namespace compiler -} // namespace protobuf -} // namespace google diff --git a/extra/protobuf/protobuf-3.19.4/src/google/protobuf/compiler/cpp/cpp_padding_optimizer.h b/extra/protobuf/protobuf-3.19.4/src/google/protobuf/compiler/cpp/cpp_padding_optimizer.h deleted file mode 100644 index ebdb17de61f5..000000000000 --- a/extra/protobuf/protobuf-3.19.4/src/google/protobuf/compiler/cpp/cpp_padding_optimizer.h +++ /dev/null @@ -1,65 +0,0 @@ -// Protocol Buffers - Google's data interchange format -// Copyright 2008 Google Inc. All rights reserved. -// https://developers.google.com/protocol-buffers/ -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// * Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// * Redistributions in binary form must reproduce the above -// copyright notice, this list of conditions and the following disclaimer -// in the documentation and/or other materials provided with the -// distribution. -// * Neither the name of Google Inc. nor the names of its -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -// Author: seongkim@google.com (Seong Beom Kim) -// Based on original Protocol Buffers design by -// Sanjay Ghemawat, Jeff Dean, and others. - -#ifndef GOOGLE_PROTOBUF_COMPILER_CPP_PADDING_OPTIMIZER_H__ -#define GOOGLE_PROTOBUF_COMPILER_CPP_PADDING_OPTIMIZER_H__ - -#include - -namespace google { -namespace protobuf { -namespace compiler { -namespace cpp { - -// Rearranges the fields of a message to minimize padding. -// Fields are grouped by the type and the size. -// For example, grouping four boolean fields and one int32 -// field results in zero padding overhead. See OptimizeLayout's -// comment for details. -class PaddingOptimizer : public MessageLayoutHelper { - public: - PaddingOptimizer() {} - ~PaddingOptimizer() override {} - - void OptimizeLayout(std::vector* fields, - const Options& options, - MessageSCCAnalyzer* scc_analyzer) override; -}; - -} // namespace cpp -} // namespace compiler -} // namespace protobuf -} // namespace google - -#endif // GOOGLE_PROTOBUF_COMPILER_CPP_PADDING_OPTIMIZER_H__ diff --git a/extra/protobuf/protobuf-3.19.4/src/google/protobuf/compiler/cpp/cpp_parse_function_generator.cc b/extra/protobuf/protobuf-3.19.4/src/google/protobuf/compiler/cpp/cpp_parse_function_generator.cc deleted file mode 100644 index 810f240a89a1..000000000000 --- a/extra/protobuf/protobuf-3.19.4/src/google/protobuf/compiler/cpp/cpp_parse_function_generator.cc +++ /dev/null @@ -1,1303 +0,0 @@ -// Protocol Buffers - Google's data interchange format -// Copyright 2008 Google Inc. All rights reserved. -// https://developers.google.com/protocol-buffers/ -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// * Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// * Redistributions in binary form must reproduce the above -// copyright notice, this list of conditions and the following disclaimer -// in the documentation and/or other materials provided with the -// distribution. -// * Neither the name of Google Inc. nor the names of its -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -#include - -#include -#include -#include - -#include -#include - -namespace google { -namespace protobuf { -namespace compiler { -namespace cpp { - -namespace { -using google::protobuf::internal::TcFieldData; -using google::protobuf::internal::WireFormat; -using google::protobuf::internal::WireFormatLite; - -std::vector GetOrderedFields( - const Descriptor* descriptor, const Options& options) { - std::vector ordered_fields; - for (auto field : FieldRange(descriptor)) { - if (!IsFieldStripped(field, options)) { - ordered_fields.push_back(field); - } - } - std::sort(ordered_fields.begin(), ordered_fields.end(), - [](const FieldDescriptor* a, const FieldDescriptor* b) { - return a->number() < b->number(); - }); - return ordered_fields; -} - -bool HasInternalAccessors(const FieldOptions::CType ctype) { - return ctype == FieldOptions::STRING || ctype == FieldOptions::CORD; -} - -int TagSize(uint32_t field_number) { - if (field_number < 16) return 1; - GOOGLE_CHECK_LT(field_number, (1 << 14)) - << "coded tag for " << field_number << " too big for uint16_t"; - return 2; -} - -const char* CodedTagType(int tag_size) { - return tag_size == 1 ? "uint8_t" : "uint16_t"; -} - -const char* TagType(const FieldDescriptor* field) { - return CodedTagType(TagSize(field->number())); -} - -std::string TcParserName(const Options& options) { - return StrCat("::", ProtobufNamespace(options), - "::internal::TcParser::"); -} - -std::string MessageTcParseFunctionName(const FieldDescriptor* field, - const Options& options) { - if (field->message_type()->field_count() == 0 || - !HasGeneratedMethods(field->message_type()->file(), options)) { - // For files with `option optimize_for = CODE_SIZE`, or which derive from - // `ZeroFieldsBase`, we need to call the `_InternalParse` function, because - // there is no generated tailcall function. For tailcall parsing, this is - // done by helpers in TcParser. - return StrCat(TcParserName(options), - (field->is_repeated() ? "Repeated" : "Singular"), - "ParseMessage<", - QualifiedClassName(field->message_type()), // - ", ", TagType(field), ">"); - } - // This matches macros in generated_message_tctable_impl.h: - return StrCat("PROTOBUF_TC_PARSE_", - (field->is_repeated() ? "REPEATED" : "SINGULAR"), - TagSize(field->number()), "(", - QualifiedClassName(field->message_type()), ")"); -} - -std::string FieldParseFunctionName(const FieldDescriptor* field, - const Options& options); - -} // namespace - -TailCallTableInfo::TailCallTableInfo(const Descriptor* descriptor, - const Options& options, - const std::vector& has_bit_indices, - MessageSCCAnalyzer* scc_analyzer) { - std::vector ordered_fields = - GetOrderedFields(descriptor, options); - - // The table size is rounded up to the nearest power of 2, clamping at 2^5. - // Note that this is a naive approach: a better approach should only consider - // table-eligible fields. We may also want to push rarely-encountered fields - // into the fallback, to make the table smaller. - table_size_log2 = ordered_fields.size() >= 16 ? 5 - : ordered_fields.size() >= 8 ? 4 - : ordered_fields.size() >= 4 ? 3 - : ordered_fields.size() >= 2 ? 2 - : 1; - const unsigned table_size = 1 << table_size_log2; - - // Construct info for each possible entry. Fields that do not use table-driven - // parsing will still have an entry that nominates the fallback function. - fast_path_fields.resize(table_size); - - for (const auto* field : ordered_fields) { - // Eagerly assume slow path. If we can handle this field on the fast path, - // we will pop its entry from `fallback_fields`. - fallback_fields.push_back(field); - - // Anything difficult slow path: - if (field->is_map()) continue; - if (field->real_containing_oneof()) continue; - if (field->options().weak()) continue; - if (IsImplicitWeakField(field, options, scc_analyzer)) continue; - if (IsLazy(field, options, scc_analyzer)) continue; - - // The largest tag that can be read by the tailcall parser is two bytes - // when varint-coded. This allows 14 bits for the numeric tag value: - // byte 0 byte 1 - // 1nnnnttt 0nnnnnnn - // ^^^^^^^ ^^^^^^^ - uint32_t tag = WireFormat::MakeTag(field); - if (tag >= 1 << 14) { - continue; - } else if (tag >= 1 << 7) { - tag = ((tag << 1) & 0x7F00) | 0x80 | (tag & 0x7F); - } - // The field index is determined by the low bits of the field number, where - // the table size determines the width of the mask. The largest table - // supported is 32 entries. The parse loop uses these bits directly, so that - // the dispatch does not require arithmetic: - // byte 0 byte 1 - // 1nnnnttt 0nnnnnnn - // ^^^^^ - // This means that any field number that does not fit in the lower 4 bits - // will always have the top bit of its table index asserted: - uint32_t idx = (tag >> 3) & (table_size - 1); - // If this entry in the table is already used, then this field will be - // handled by the generated fallback function. - if (!fast_path_fields[idx].func_name.empty()) continue; - - // Determine the hasbit mask for this field, if needed. (Note that fields - // without hasbits use different parse functions.) - int hasbit_idx; - if (HasHasbit(field)) { - hasbit_idx = has_bit_indices[field->index()]; - GOOGLE_CHECK_NE(-1, hasbit_idx) << field->DebugString(); - // The tailcall parser can only update the first 32 hasbits. If this - // field's has-bit is beyond that, then it will need to be handled by the - // fallback parse function. - if (hasbit_idx >= 32) continue; - } else { - // The tailcall parser only ever syncs 32 has-bits, so if there is no - // presence, set a bit that will not be used. - hasbit_idx = 63; - } - - // Determine the name of the fastpath parse function to use for this field. - std::string name; - - switch (field->type()) { - case FieldDescriptor::TYPE_MESSAGE: - name = MessageTcParseFunctionName(field, options); - break; - - case FieldDescriptor::TYPE_FIXED64: - case FieldDescriptor::TYPE_FIXED32: - case FieldDescriptor::TYPE_SFIXED64: - case FieldDescriptor::TYPE_SFIXED32: - case FieldDescriptor::TYPE_DOUBLE: - case FieldDescriptor::TYPE_FLOAT: - case FieldDescriptor::TYPE_INT64: - case FieldDescriptor::TYPE_INT32: - case FieldDescriptor::TYPE_UINT64: - case FieldDescriptor::TYPE_UINT32: - case FieldDescriptor::TYPE_SINT64: - case FieldDescriptor::TYPE_SINT32: - case FieldDescriptor::TYPE_BOOL: - name = FieldParseFunctionName(field, options); - break; - - case FieldDescriptor::TYPE_BYTES: - if (field->options().ctype() == FieldOptions::STRING && - field->default_value_string().empty() && - !IsStringInlined(field, options)) { - name = FieldParseFunctionName(field, options); - } - break; - - default: - break; - } - - if (name.empty()) { - continue; - } - // This field made it into the fast path, so remove it from the fallback - // fields and fill in the table entry. - fallback_fields.pop_back(); - fast_path_fields[idx].func_name = name; - fast_path_fields[idx].bits = TcFieldData(tag, hasbit_idx, 0); - fast_path_fields[idx].field = field; - } - - // If there are no fallback fields, and at most one extension range, the - // parser can use a generic fallback function. Otherwise, a message-specific - // fallback routine is needed. - use_generated_fallback = - !fallback_fields.empty() || descriptor->extension_range_count() > 1; -} - -ParseFunctionGenerator::ParseFunctionGenerator( - const Descriptor* descriptor, int max_has_bit_index, - const std::vector& has_bit_indices, - const std::vector& inlined_string_indices, const Options& options, - MessageSCCAnalyzer* scc_analyzer, - const std::map& vars) - : descriptor_(descriptor), - scc_analyzer_(scc_analyzer), - options_(options), - variables_(vars), - inlined_string_indices_(inlined_string_indices), - num_hasbits_(max_has_bit_index) { - if (should_generate_tctable()) { - tc_table_info_.reset(new TailCallTableInfo(descriptor_, options_, - has_bit_indices, scc_analyzer)); - } - SetCommonVars(options_, &variables_); - SetUnknownFieldsVariable(descriptor_, options_, &variables_); - variables_["classname"] = ClassName(descriptor, false); -} - -void ParseFunctionGenerator::GenerateMethodDecls(io::Printer* printer) { - Formatter format(printer, variables_); - if (should_generate_tctable()) { - auto declare_function = [&format](const char* name, - const std::string& guard) { - if (!guard.empty()) { - format.Outdent(); - format("#if $1$\n", guard); - format.Indent(); - } - format("static const char* $1$(PROTOBUF_TC_PARAM_DECL);\n", name); - if (!guard.empty()) { - format.Outdent(); - format("#endif // $1$\n", guard); - format.Indent(); - } - }; - if (should_generate_guarded_tctable()) { - format.Outdent(); - format("#ifdef PROTOBUF_TAIL_CALL_TABLE_PARSER_ENABLED\n"); - format.Indent(); - } - format("// The Tct_* functions are internal to the protobuf runtime:\n"); - // These guards are defined in port_def.inc: - declare_function("Tct_ParseS1", "PROTOBUF_TC_STATIC_PARSE_SINGULAR1"); - declare_function("Tct_ParseS2", "PROTOBUF_TC_STATIC_PARSE_SINGULAR2"); - declare_function("Tct_ParseR1", "PROTOBUF_TC_STATIC_PARSE_REPEATED1"); - declare_function("Tct_ParseR2", "PROTOBUF_TC_STATIC_PARSE_REPEATED2"); - if (tc_table_info_->use_generated_fallback) { - format.Outdent(); - format( - " private:\n" - " "); - declare_function("Tct_ParseFallback", ""); - format(" public:\n"); - format.Indent(); - } - if (should_generate_guarded_tctable()) { - format.Outdent(); - format("#endif\n"); - format.Indent(); - } - } - format( - "const char* _InternalParse(const char* ptr, " - "::$proto_ns$::internal::ParseContext* ctx) final;\n"); -} - -void ParseFunctionGenerator::GenerateMethodImpls(io::Printer* printer) { - Formatter format(printer, variables_); - bool need_parse_function = true; - if (descriptor_->options().message_set_wire_format()) { - // Special-case MessageSet. - need_parse_function = false; - format( - "const char* $classname$::_InternalParse(const char* ptr,\n" - " ::$proto_ns$::internal::ParseContext* ctx) {\n" - "$annotate_deserialize$" - " return _extensions_.ParseMessageSet(ptr, \n" - " internal_default_instance(), &_internal_metadata_, ctx);\n" - "}\n"); - } - if (!should_generate_tctable()) { - if (need_parse_function) { - GenerateLoopingParseFunction(format); - } - return; - } - if (should_generate_guarded_tctable()) { - format("#ifdef PROTOBUF_TAIL_CALL_TABLE_PARSER_ENABLED\n\n"); - } - if (need_parse_function) { - GenerateTailcallParseFunction(format); - } - if (tc_table_info_->use_generated_fallback) { - GenerateTailcallFallbackFunction(format); - } - GenerateTailcallFieldParseFunctions(format); - if (should_generate_guarded_tctable()) { - if (need_parse_function) { - format("\n#else // PROTOBUF_TAIL_CALL_TABLE_PARSER_ENABLED\n\n"); - GenerateLoopingParseFunction(format); - } - format("\n#endif // PROTOBUF_TAIL_CALL_TABLE_PARSER_ENABLED\n"); - } -} - -bool ParseFunctionGenerator::should_generate_tctable() const { - if (options_.tctable_mode == Options::kTCTableNever) { - return false; - } - return true; -} - -void ParseFunctionGenerator::GenerateTailcallParseFunction(Formatter& format) { - GOOGLE_CHECK(should_generate_tctable()); - - // Generate an `_InternalParse` that starts the tail-calling loop. - format( - "const char* $classname$::_InternalParse(\n" - " const char* ptr, ::$proto_ns$::internal::ParseContext* ctx) {\n" - "$annotate_deserialize$" - " ptr = ::$proto_ns$::internal::TcParser::ParseLoop(\n" - " this, ptr, ctx, &_table_.header);\n"); - format( - " return ptr;\n" - "}\n\n"); -} - -void ParseFunctionGenerator::GenerateTailcallFallbackFunction( - Formatter& format) { - GOOGLE_CHECK(should_generate_tctable()); - format( - "const char* $classname$::Tct_ParseFallback(PROTOBUF_TC_PARAM_DECL) {\n" - "#define CHK_(x) if (PROTOBUF_PREDICT_FALSE(!(x))) return nullptr\n"); - format.Indent(); - format("auto* typed_msg = static_cast<$classname$*>(msg);\n"); - - if (num_hasbits_ > 0) { - // Sync hasbits - format("typed_msg->_has_bits_[0] = hasbits;\n"); - } - - format.Set("msg", "typed_msg->"); - format.Set("this", "typed_msg"); - format.Set("has_bits", "typed_msg->_has_bits_"); - format.Set("next_tag", "goto next_tag"); - GenerateParseIterationBody(format, descriptor_, - tc_table_info_->fallback_fields); - - format.Outdent(); - format( - "next_tag:\n" - "message_done:\n" - " return ptr;\n" - "#undef CHK_\n" - "}\n"); -} - -void ParseFunctionGenerator::GenerateTailcallFieldParseFunctions( - Formatter& format) { - GOOGLE_CHECK(should_generate_tctable()); - // There are four cases where a tailcall target are needed for messages: - // {singular, repeated} x {1, 2}-byte tag - struct { - const char* type; - int size; - } const kTagLayouts[] = { - {"uint8_t", 1}, - {"uint16_t", 2}, - }; - // Singular: - for (const auto& layout : kTagLayouts) { - // Guard macros are defined in port_def.inc. - format( - "#if PROTOBUF_TC_STATIC_PARSE_SINGULAR$1$\n" - "const char* $classname$::Tct_ParseS$1$(PROTOBUF_TC_PARAM_DECL) {\n" - " if (PROTOBUF_PREDICT_FALSE(data.coded_tag<$2$>() != 0))\n" - " PROTOBUF_MUSTTAIL " - "return table->fallback(PROTOBUF_TC_PARAM_PASS);\n" - " ptr += $1$;\n" - " hasbits |= (uint64_t{1} << data.hasbit_idx());\n" - " ::$proto_ns$::internal::TcParser::SyncHasbits" - "(msg, hasbits, table);\n" - " auto& field = ::$proto_ns$::internal::TcParser::" - "RefAt<$classtype$*>(msg, data.offset());\n" - " if (field == nullptr)\n" - " field = CreateMaybeMessage<$classtype$>(ctx->data().arena);\n" - " return ctx->ParseMessage(field, ptr);\n" - "}\n" - "#endif // PROTOBUF_TC_STATIC_PARSE_SINGULAR$1$\n", - layout.size, layout.type); - } - // Repeated: - for (const auto& layout : kTagLayouts) { - // Guard macros are defined in port_def.inc. - format( - "#if PROTOBUF_TC_STATIC_PARSE_REPEATED$1$\n" - "const char* $classname$::Tct_ParseR$1$(PROTOBUF_TC_PARAM_DECL) {\n" - " if (PROTOBUF_PREDICT_FALSE(data.coded_tag<$2$>() != 0)) {\n" - " PROTOBUF_MUSTTAIL " - "return table->fallback(PROTOBUF_TC_PARAM_PASS);\n" - " }\n" - " ptr += $1$;\n" - " auto& field = ::$proto_ns$::internal::TcParser::RefAt<" - "::$proto_ns$::RepeatedPtrField<$classname$>>(msg, data.offset());\n" - " ::$proto_ns$::internal::TcParser::SyncHasbits" - "(msg, hasbits, table);\n" - " ptr = ctx->ParseMessage(field.Add(), ptr);\n" - " return ptr;\n" - "}\n" - "#endif // PROTOBUF_TC_STATIC_PARSE_REPEATED$1$\n", - layout.size, layout.type); - } -} - -void ParseFunctionGenerator::GenerateDataDecls(io::Printer* printer) { - if (!should_generate_tctable()) { - return; - } - Formatter format(printer, variables_); - if (should_generate_guarded_tctable()) { - format.Outdent(); - format("#ifdef PROTOBUF_TAIL_CALL_TABLE_PARSER_ENABLED\n"); - format.Indent(); - } - format( - "static const ::$proto_ns$::internal::TcParseTable<$1$>\n" - " _table_;\n", - tc_table_info_->table_size_log2); - if (should_generate_guarded_tctable()) { - format.Outdent(); - format("#endif // PROTOBUF_TAIL_CALL_TABLE_PARSER_ENABLED\n"); - format.Indent(); - } -} - -void ParseFunctionGenerator::GenerateDataDefinitions(io::Printer* printer) { - if (!should_generate_tctable()) { - return; - } - Formatter format(printer, variables_); - if (should_generate_guarded_tctable()) { - format("#ifdef PROTOBUF_TAIL_CALL_TABLE_PARSER_ENABLED\n"); - } - GenerateTailCallTable(format); - if (should_generate_guarded_tctable()) { - format("#endif // PROTOBUF_TAIL_CALL_TABLE_PARSER_ENABLED\n"); - } -} - -void ParseFunctionGenerator::GenerateLoopingParseFunction(Formatter& format) { - format( - "const char* $classname$::_InternalParse(const char* ptr, " - "::$proto_ns$::internal::ParseContext* ctx) {\n" - "$annotate_deserialize$" - "#define CHK_(x) if (PROTOBUF_PREDICT_FALSE(!(x))) goto failure\n"); - format.Indent(); - format.Set("msg", ""); - format.Set("this", "this"); - int hasbits_size = 0; - if (num_hasbits_ > 0) { - hasbits_size = (num_hasbits_ + 31) / 32; - } - // For now only optimize small hasbits. - if (hasbits_size != 1) hasbits_size = 0; - if (hasbits_size) { - format("_Internal::HasBits has_bits{};\n"); - format.Set("has_bits", "has_bits"); - } else { - format.Set("has_bits", "_has_bits_"); - } - format.Set("next_tag", "continue"); - format("while (!ctx->Done(&ptr)) {\n"); - format.Indent(); - - GenerateParseIterationBody(format, descriptor_, - GetOrderedFields(descriptor_, options_)); - - format.Outdent(); - format("} // while\n"); - - format.Outdent(); - format("message_done:\n"); - if (hasbits_size) format(" _has_bits_.Or(has_bits);\n"); - - format( - " return ptr;\n" - "failure:\n" - " ptr = nullptr;\n" - " goto message_done;\n" - "#undef CHK_\n" - "}\n"); -} - -void ParseFunctionGenerator::GenerateTailCallTable(Formatter& format) { - GOOGLE_CHECK(should_generate_tctable()); - // All entries without a fast-path parsing function need a fallback. - std::string fallback; - if (tc_table_info_->use_generated_fallback) { - fallback = ClassName(descriptor_) + "::Tct_ParseFallback"; - } else { - fallback = TcParserName(options_) + "GenericFallback"; - if (GetOptimizeFor(descriptor_->file(), options_) == - FileOptions::LITE_RUNTIME) { - fallback += "Lite"; - } - } - - // For simplicity and speed, the table is not covering all proto - // configurations. This model uses a fallback to cover all situations that - // the table can't accommodate, together with unknown fields or extensions. - // These are number of fields over 32, fields with 3 or more tag bytes, - // maps, weak fields, lazy, more than 1 extension range. In the cases - // the table is sufficient we can use a generic routine, that just handles - // unknown fields and potentially an extension range. - format( - "const ::$proto_ns$::internal::TcParseTable<$1$>\n" - " $classname$::_table_ = {\n", - tc_table_info_->table_size_log2); - { - auto table_scope = format.ScopedIndent(); - format("{\n"); - { - auto header_scope = format.ScopedIndent(); - if (num_hasbits_ > 0 || IsMapEntryMessage(descriptor_)) { - format("PROTOBUF_FIELD_OFFSET($classname$, _has_bits_),\n"); - } else { - format("0, // no _has_bits_\n"); - } - if (descriptor_->extension_range_count() == 1) { - format( - "PROTOBUF_FIELD_OFFSET($classname$, _extensions_),\n" - "$1$, $2$, // extension_range_{low,high}\n", - descriptor_->extension_range(0)->start, - descriptor_->extension_range(0)->end); - } else { - format("0, 0, 0, // no _extensions_\n"); - } - format( - "$1$, 0, $2$, // fast_idx_mask, reserved, num_fields\n" - "&$3$._instance,\n" - "$4$ // fallback\n", - (((1 << tc_table_info_->table_size_log2) - 1) << 3), - descriptor_->field_count(), - DefaultInstanceName(descriptor_, options_), fallback); - } - format("}, {\n"); - { - auto fast_scope = format.ScopedIndent(); - GenerateFastFieldEntries(format, fallback); - } - format("},\n"); // entries[] - } - format("};\n\n"); // _table_ -} - -void ParseFunctionGenerator::GenerateFastFieldEntries( - Formatter& format, const std::string& fallback) { - for (const auto& info : tc_table_info_->fast_path_fields) { - if (info.field != nullptr) { - PrintFieldComment(format, info.field); - } - format("{$1$, ", info.func_name.empty() ? fallback : info.func_name); - if (info.bits.data) { - GOOGLE_DCHECK_NE(nullptr, info.field); - format( - "{$1$, $2$, " - "static_cast(PROTOBUF_FIELD_OFFSET($classname$, $3$_))}", - info.bits.coded_tag(), info.bits.hasbit_idx(), FieldName(info.field)); - } else { - format("{}"); - } - format("},\n"); - } -} - -void ParseFunctionGenerator::GenerateArenaString(Formatter& format, - const FieldDescriptor* field) { - if (HasHasbit(field)) { - format("_Internal::set_has_$1$(&$has_bits$);\n", FieldName(field)); - } - std::string default_string = - field->default_value_string().empty() - ? "::" + ProtobufNamespace(options_) + - "::internal::GetEmptyStringAlreadyInited()" - : QualifiedClassName(field->containing_type(), options_) + - "::" + MakeDefaultName(field) + ".get()"; - format( - "if (arena != nullptr) {\n" - " ptr = ctx->ReadArenaString(ptr, &$msg$$name$_, arena"); - if (IsStringInlined(field, options_)) { - GOOGLE_DCHECK(!inlined_string_indices_.empty()); - int inlined_string_index = inlined_string_indices_[field->index()]; - GOOGLE_DCHECK_GE(inlined_string_index, 0); - format( - ", $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)); - } else { - GOOGLE_DCHECK(field->default_value_string().empty()); - } - format( - ");\n" - "} else {\n" - " ptr = ::$proto_ns$::internal::InlineGreedyStringParser(" - "$msg$$name$_.MutableNoArenaNoDefault(&$1$), ptr, ctx);\n" - "}\n" - "const std::string* str = &$msg$$name$_.Get(); (void)str;\n", - default_string); -} - -void ParseFunctionGenerator::GenerateStrings(Formatter& format, - const FieldDescriptor* field, - bool check_utf8) { - FieldOptions::CType ctype = FieldOptions::STRING; - if (!options_.opensource_runtime) { - // Open source doesn't support other ctypes; - ctype = field->options().ctype(); - } - if (!field->is_repeated() && !options_.opensource_runtime && - GetOptimizeFor(field->file(), options_) != FileOptions::LITE_RUNTIME && - // For now only use arena string for strings with empty defaults. - field->default_value_string().empty() && - !field->real_containing_oneof() && ctype == FieldOptions::STRING) { - GenerateArenaString(format, field); - } else { - std::string parser_name; - switch (ctype) { - case FieldOptions::STRING: - parser_name = "GreedyStringParser"; - break; - case FieldOptions::CORD: - parser_name = "CordParser"; - break; - case FieldOptions::STRING_PIECE: - parser_name = "StringPieceParser"; - break; - } - format( - "auto str = $msg$$1$$2$_$name$();\n" - "ptr = ::$proto_ns$::internal::Inline$3$(str, ptr, ctx);\n", - HasInternalAccessors(ctype) ? "_internal_" : "", - field->is_repeated() && !field->is_packable() ? "add" : "mutable", - parser_name); - } - if (!check_utf8) return; // return if this is a bytes field - auto level = GetUtf8CheckMode(field, options_); - switch (level) { - case Utf8CheckMode::kNone: - return; - case Utf8CheckMode::kVerify: - format("#ifndef NDEBUG\n"); - break; - case Utf8CheckMode::kStrict: - format("CHK_("); - break; - } - std::string field_name; - field_name = "nullptr"; - if (HasDescriptorMethods(field->file(), options_)) { - field_name = StrCat("\"", field->full_name(), "\""); - } - format("::$proto_ns$::internal::VerifyUTF8(str, $1$)", field_name); - switch (level) { - case Utf8CheckMode::kNone: - return; - case Utf8CheckMode::kVerify: - format( - ";\n" - "#endif // !NDEBUG\n"); - break; - case Utf8CheckMode::kStrict: - format(");\n"); - break; - } -} - -void ParseFunctionGenerator::GenerateLengthDelim(Formatter& format, - const FieldDescriptor* field) { - if (field->is_packable()) { - if (field->type() == FieldDescriptor::TYPE_ENUM && - !HasPreservingUnknownEnumSemantics(field)) { - std::string enum_type = QualifiedClassName(field->enum_type(), options_); - format( - "ptr = " - "::$proto_ns$::internal::Packed$1$Parser<$unknown_fields_type$>(" - "$msg$_internal_mutable_$name$(), ptr, ctx, $2$_IsValid, " - "&$msg$_internal_metadata_, $3$);\n", - DeclaredTypeMethodName(field->type()), enum_type, field->number()); - } else { - format( - "ptr = ::$proto_ns$::internal::Packed$1$Parser(" - "$msg$_internal_mutable_$name$(), ptr, ctx);\n", - DeclaredTypeMethodName(field->type())); - } - } else { - auto field_type = field->type(); - switch (field_type) { - case FieldDescriptor::TYPE_STRING: - GenerateStrings(format, field, true /* utf8 */); - break; - case FieldDescriptor::TYPE_BYTES: - GenerateStrings(format, field, false /* utf8 */); - break; - case FieldDescriptor::TYPE_MESSAGE: { - if (field->is_map()) { - const FieldDescriptor* val = - field->message_type()->FindFieldByName("value"); - GOOGLE_CHECK(val); - if (val->type() == FieldDescriptor::TYPE_ENUM && - !HasPreservingUnknownEnumSemantics(field)) { - format( - "auto object = " - "::$proto_ns$::internal::InitEnumParseWrapper<" - "$unknown_fields_type$>(&$msg$$name$_, $1$_IsValid, " - "$2$, &$msg$_internal_metadata_);\n" - "ptr = ctx->ParseMessage(&object, ptr);\n", - QualifiedClassName(val->enum_type(), options_), - field->number()); - } else { - format("ptr = ctx->ParseMessage(&$msg$$name$_, ptr);\n"); - } - } else if (IsLazy(field, options_, scc_analyzer_)) { - if (field->real_containing_oneof()) { - format( - "if (!$msg$_internal_has_$name$()) {\n" - " $msg$clear_$1$();\n" - " $msg$$1$_.$name$_ = ::$proto_ns$::Arena::CreateMessage<\n" - " ::$proto_ns$::internal::LazyField>(" - "$msg$GetArenaForAllocation());\n" - " $msg$set_has_$name$();\n" - "}\n" - "auto* lazy_field = $msg$$1$_.$name$_;\n", - field->containing_oneof()->name()); - } else if (HasHasbit(field)) { - format( - "_Internal::set_has_$name$(&$has_bits$);\n" - "auto* lazy_field = &$msg$$name$_;\n"); - } else { - format("auto* lazy_field = &$msg$$name$_;\n"); - } - format( - "::$proto_ns$::internal::LazyFieldParseHelper<\n" - " ::$proto_ns$::internal::LazyField> parse_helper(\n" - " $1$::default_instance(),\n" - " $msg$GetArenaForAllocation(), lazy_field);\n" - "ptr = ctx->ParseMessage(&parse_helper, ptr);\n", - FieldMessageTypeName(field, options_)); - } else if (IsImplicitWeakField(field, options_, scc_analyzer_)) { - if (!field->is_repeated()) { - format( - "ptr = ctx->ParseMessage(_Internal::mutable_$name$($this$), " - "ptr);\n"); - } else { - format( - "ptr = ctx->ParseMessage($msg$$name$_.AddWeak(" - "reinterpret_cast($1$ptr_)" - "), ptr);\n", - QualifiedDefaultInstanceName(field->message_type(), options_)); - } - } else if (IsWeak(field, options_)) { - format( - "{\n" - " auto* default_ = &reinterpret_cast($1$);\n" - " ptr = ctx->ParseMessage($msg$_weak_field_map_.MutableMessage(" - "$2$, default_), ptr);\n" - "}\n", - QualifiedDefaultInstanceName(field->message_type(), options_), - field->number()); - } else { - format( - "ptr = ctx->ParseMessage($msg$_internal_$mutable_field$(), " - "ptr);\n"); - } - break; - } - default: - GOOGLE_LOG(FATAL) << "Illegal combination for length delimited wiretype " - << " filed type is " << field->type(); - } - } -} - -static bool ShouldRepeat(const FieldDescriptor* descriptor, - WireFormatLite::WireType wiretype) { - constexpr int kMaxTwoByteFieldNumber = 16 * 128; - return descriptor->number() < kMaxTwoByteFieldNumber && - descriptor->is_repeated() && - (!descriptor->is_packable() || - wiretype != WireFormatLite::WIRETYPE_LENGTH_DELIMITED); -} - -void ParseFunctionGenerator::GenerateFieldBody( - Formatter& format, WireFormatLite::WireType wiretype, - const FieldDescriptor* field) { - Formatter::SaveState formatter_state(&format); - format.AddMap( - {{"name", FieldName(field)}, - {"primitive_type", PrimitiveTypeName(options_, field->cpp_type())}}); - if (field->is_repeated()) { - format.AddMap({{"put_field", StrCat("add_", FieldName(field))}, - {"mutable_field", StrCat("add_", FieldName(field))}}); - } else { - format.AddMap( - {{"put_field", StrCat("set_", FieldName(field))}, - {"mutable_field", StrCat("mutable_", FieldName(field))}}); - } - uint32_t tag = WireFormatLite::MakeTag(field->number(), wiretype); - switch (wiretype) { - case WireFormatLite::WIRETYPE_VARINT: { - std::string type = PrimitiveTypeName(options_, field->cpp_type()); - if (field->type() == FieldDescriptor::TYPE_ENUM) { - format.Set("enum_type", - QualifiedClassName(field->enum_type(), options_)); - format( - "$uint64$ val = ::$proto_ns$::internal::ReadVarint64(&ptr);\n" - "CHK_(ptr);\n"); - if (!HasPreservingUnknownEnumSemantics(field)) { - format("if (PROTOBUF_PREDICT_TRUE($enum_type$_IsValid(val))) {\n"); - format.Indent(); - } - format("$msg$_internal_$put_field$(static_cast<$enum_type$>(val));\n"); - if (!HasPreservingUnknownEnumSemantics(field)) { - format.Outdent(); - format( - "} else {\n" - " ::$proto_ns$::internal::WriteVarint(" - "$1$, val, $msg$mutable_unknown_fields());\n" - "}\n", - field->number()); - } - } else { - std::string size = (field->type() == FieldDescriptor::TYPE_INT32 || - field->type() == FieldDescriptor::TYPE_SINT32 || - field->type() == FieldDescriptor::TYPE_UINT32) - ? "32" - : "64"; - std::string zigzag; - if ((field->type() == FieldDescriptor::TYPE_SINT32 || - field->type() == FieldDescriptor::TYPE_SINT64)) { - zigzag = "ZigZag"; - } - if (field->is_repeated() || field->real_containing_oneof()) { - format( - "$msg$_internal_$put_field$(" - "::$proto_ns$::internal::ReadVarint$1$$2$(&ptr));\n" - "CHK_(ptr);\n", - zigzag, size); - } else { - if (HasHasbit(field)) { - format("_Internal::set_has_$name$(&$has_bits$);\n"); - } - format( - "$msg$$name$_ = ::$proto_ns$::internal::ReadVarint$1$$2$(&ptr);\n" - "CHK_(ptr);\n", - zigzag, size); - } - } - break; - } - case WireFormatLite::WIRETYPE_FIXED32: - case WireFormatLite::WIRETYPE_FIXED64: { - if (field->is_repeated() || field->real_containing_oneof()) { - format( - "$msg$_internal_$put_field$(" - "::$proto_ns$::internal::UnalignedLoad<$primitive_type$>(ptr));\n" - "ptr += sizeof($primitive_type$);\n"); - } else { - if (HasHasbit(field)) { - format("_Internal::set_has_$name$(&$has_bits$);\n"); - } - format( - "$msg$$name$_ = " - "::$proto_ns$::internal::UnalignedLoad<$primitive_type$>(ptr);\n" - "ptr += sizeof($primitive_type$);\n"); - } - break; - } - case WireFormatLite::WIRETYPE_LENGTH_DELIMITED: { - GenerateLengthDelim(format, field); - format("CHK_(ptr);\n"); - break; - } - case WireFormatLite::WIRETYPE_START_GROUP: { - format( - "ptr = ctx->ParseGroup($msg$_internal_$mutable_field$(), ptr, $1$);\n" - "CHK_(ptr);\n", - tag); - break; - } - case WireFormatLite::WIRETYPE_END_GROUP: { - GOOGLE_LOG(FATAL) << "Can't have end group field\n"; - break; - } - } // switch (wire_type) -} - -// Returns the tag for this field and in case of repeated packable fields, -// sets a fallback tag in fallback_tag_ptr. -static uint32_t ExpectedTag(const FieldDescriptor* field, - uint32_t* fallback_tag_ptr) { - uint32_t expected_tag; - if (field->is_packable()) { - auto expected_wiretype = WireFormat::WireTypeForFieldType(field->type()); - expected_tag = WireFormatLite::MakeTag(field->number(), expected_wiretype); - GOOGLE_CHECK(expected_wiretype != WireFormatLite::WIRETYPE_LENGTH_DELIMITED); - auto fallback_wiretype = WireFormatLite::WIRETYPE_LENGTH_DELIMITED; - uint32_t fallback_tag = - WireFormatLite::MakeTag(field->number(), fallback_wiretype); - - if (field->is_packed()) std::swap(expected_tag, fallback_tag); - *fallback_tag_ptr = fallback_tag; - } else { - auto expected_wiretype = WireFormat::WireTypeForField(field); - expected_tag = WireFormatLite::MakeTag(field->number(), expected_wiretype); - } - return expected_tag; -} - -// These variables are used by the generated parse iteration, and must already -// be defined in the generated code: -// - `const char* ptr`: the input buffer. -// - `ParseContext* ctx`: the associated context for `ptr`. -// - implicit `this`: i.e., we must be in a non-static member function. -// -// The macro `CHK_(x)` must be defined. It should return an error condition if -// the macro parameter is false. -// -// Whenever an END_GROUP tag was read, or tag 0 was read, the generated code -// branches to the label `message_done`. -// -// These formatter variables are used: -// - `next_tag`: a single statement to begin parsing the next tag. -// -// At the end of the generated code, the enclosing function should proceed to -// parse the next tag in the stream. -void ParseFunctionGenerator::GenerateParseIterationBody( - Formatter& format, const Descriptor* descriptor, - const std::vector& ordered_fields) { - format( - "$uint32$ tag;\n" - "ptr = ::$proto_ns$::internal::ReadTag(ptr, &tag);\n"); - - if (!ordered_fields.empty()) { - GenerateFieldSwitch(format, ordered_fields); - // Each field `case` only considers field number. Field numbers that are - // not defined in the message, or tags with an incompatible wire type, are - // considered "unusual" cases. They will be handled by the logic below. - format.Outdent(); - format("handle_unusual:\n"); - format.Indent(); - } - - // Unusual/extension/unknown case: - format( - "if ((tag == 0) || ((tag & 7) == 4)) {\n" - " CHK_(ptr);\n" - " ctx->SetLastTag(tag);\n" - " goto message_done;\n" - "}\n"); - if (IsMapEntryMessage(descriptor)) { - format("$next_tag$;\n"); - } else { - if (descriptor->extension_range_count() > 0) { - format("if ("); - for (int i = 0; i < descriptor->extension_range_count(); i++) { - const Descriptor::ExtensionRange* range = - descriptor->extension_range(i); - if (i > 0) format(" ||\n "); - - uint32_t start_tag = WireFormatLite::MakeTag( - range->start, static_cast(0)); - uint32_t end_tag = WireFormatLite::MakeTag( - range->end, static_cast(0)); - - if (range->end > FieldDescriptor::kMaxNumber) { - format("($1$u <= tag)", start_tag); - } else { - format("($1$u <= tag && tag < $2$u)", start_tag, end_tag); - } - } - format( - ") {\n" - " ptr = $msg$_extensions_.ParseField(tag, ptr, " - "internal_default_instance(), &$msg$_internal_metadata_, ctx);\n" - " CHK_(ptr != nullptr);\n" - " $next_tag$;\n" - "}\n"); - } - format( - "ptr = UnknownFieldParse(\n" - " tag,\n" - " $msg$_internal_metadata_.mutable_unknown_fields<" - "$unknown_fields_type$>(),\n" - " ptr, ctx);\n" - "CHK_(ptr != nullptr);\n"); - } -} - -void ParseFunctionGenerator::GenerateFieldSwitch( - Formatter& format, - const std::vector& ordered_fields) { - format("switch (tag >> 3) {\n"); - format.Indent(); - - for (const auto* field : ordered_fields) { - PrintFieldComment(format, field); - format("case $1$:\n", field->number()); - format.Indent(); - uint32_t fallback_tag = 0; - uint32_t expected_tag = ExpectedTag(field, &fallback_tag); - format("if (PROTOBUF_PREDICT_TRUE(static_cast<$uint8$>(tag) == $1$)) {\n", - expected_tag & 0xFF); - format.Indent(); - auto wiretype = WireFormatLite::GetTagWireType(expected_tag); - uint32_t tag = WireFormatLite::MakeTag(field->number(), wiretype); - int tag_size = io::CodedOutputStream::VarintSize32(tag); - bool is_repeat = ShouldRepeat(field, wiretype); - if (is_repeat) { - format( - "ptr -= $1$;\n" - "do {\n" - " ptr += $1$;\n", - tag_size); - format.Indent(); - } - GenerateFieldBody(format, wiretype, field); - if (is_repeat) { - format.Outdent(); - format( - " if (!ctx->DataAvailable(ptr)) break;\n" - "} while (::$proto_ns$::internal::ExpectTag<$1$>(ptr));\n", - tag); - } - format.Outdent(); - if (fallback_tag) { - format("} else if (static_cast<$uint8$>(tag) == $1$) {\n", - fallback_tag & 0xFF); - format.Indent(); - GenerateFieldBody(format, WireFormatLite::GetTagWireType(fallback_tag), - field); - format.Outdent(); - } - format( - "} else\n" - " goto handle_unusual;\n" - "$next_tag$;\n"); - format.Outdent(); - } // for loop over ordered fields - - format( - "default:\n" - " goto handle_unusual;\n"); - format.Outdent(); - format("} // switch\n"); -} - -namespace { - -std::string FieldParseFunctionName(const FieldDescriptor* field, - const Options& options) { - ParseCardinality card = // - field->is_packed() ? ParseCardinality::kPacked - : field->is_repeated() ? ParseCardinality::kRepeated - : field->real_containing_oneof() ? ParseCardinality::kOneof - : ParseCardinality::kSingular; - - TypeFormat type_format; - switch (field->type()) { - case FieldDescriptor::TYPE_FIXED64: - case FieldDescriptor::TYPE_SFIXED64: - case FieldDescriptor::TYPE_DOUBLE: - type_format = TypeFormat::kFixed64; - break; - - case FieldDescriptor::TYPE_FIXED32: - case FieldDescriptor::TYPE_SFIXED32: - case FieldDescriptor::TYPE_FLOAT: - type_format = TypeFormat::kFixed32; - break; - - case FieldDescriptor::TYPE_INT64: - case FieldDescriptor::TYPE_UINT64: - type_format = TypeFormat::kVar64; - break; - - case FieldDescriptor::TYPE_INT32: - case FieldDescriptor::TYPE_UINT32: - type_format = TypeFormat::kVar32; - break; - - case FieldDescriptor::TYPE_SINT64: - type_format = TypeFormat::kSInt64; - break; - - case FieldDescriptor::TYPE_SINT32: - type_format = TypeFormat::kSInt32; - break; - - case FieldDescriptor::TYPE_BOOL: - type_format = TypeFormat::kBool; - break; - - case FieldDescriptor::TYPE_BYTES: - type_format = TypeFormat::kBytes; - break; - - case FieldDescriptor::TYPE_STRING: - switch (GetUtf8CheckMode(field, options)) { - case Utf8CheckMode::kNone: - type_format = TypeFormat::kBytes; - break; - case Utf8CheckMode::kStrict: - type_format = TypeFormat::kString; - break; - case Utf8CheckMode::kVerify: - type_format = TypeFormat::kStringValidateOnly; - break; - default: - GOOGLE_LOG(DFATAL) << "Mode not handled: " - << static_cast(GetUtf8CheckMode(field, options)); - return ""; - } - break; - - default: - GOOGLE_LOG(DFATAL) << "Type not handled: " << field->DebugString(); - return ""; - } - - return "::" + ProtobufNamespace(options) + "::internal::TcParser::" + - GetTailCallFieldHandlerName(card, type_format, - TagSize(field->number()), options); -} - -} // namespace - -std::string GetTailCallFieldHandlerName(ParseCardinality card, - TypeFormat type_format, - int tag_length_bytes, - const Options& options) { - std::string name; - - // The field implementation functions are prefixed by cardinality: - // `Singular` for optional or implicit fields. - // `Repeated` for non-packed repeated. - // `Packed` for packed repeated. - switch (card) { - case ParseCardinality::kSingular: - name.append("Singular"); - break; - case ParseCardinality::kOneof: - name.append("Oneof"); - break; - case ParseCardinality::kRepeated: - name.append("Repeated"); - break; - case ParseCardinality::kPacked: - name.append("Packed"); - break; - } - - // Next in the function name is the TypeFormat-specific name. - switch (type_format) { - case TypeFormat::kFixed64: - case TypeFormat::kFixed32: - name.append("Fixed"); - break; - - case TypeFormat::kVar64: - case TypeFormat::kVar32: - case TypeFormat::kSInt64: - case TypeFormat::kSInt32: - case TypeFormat::kBool: - name.append("Varint"); - break; - - case TypeFormat::kBytes: - case TypeFormat::kString: - case TypeFormat::kStringValidateOnly: - name.append("String"); - break; - - default: - break; - } - - name.append("<"); - - // Determine the numeric layout type for the parser to use, independent of - // the specific parsing logic used. - switch (type_format) { - case TypeFormat::kVar64: - case TypeFormat::kFixed64: - name.append("uint64_t, "); - break; - - case TypeFormat::kSInt64: - name.append("int64_t, "); - break; - - case TypeFormat::kVar32: - case TypeFormat::kFixed32: - name.append("uint32_t, "); - break; - - case TypeFormat::kSInt32: - name.append("int32_t, "); - break; - - case TypeFormat::kBool: - name.append("bool, "); - break; - - default: - break; - } - - name.append(CodedTagType(tag_length_bytes)); - - switch (type_format) { - case TypeFormat::kVar64: - case TypeFormat::kVar32: - case TypeFormat::kBool: - StrAppend(&name, ", ", TcParserName(options), "kNoConversion"); - break; - - case TypeFormat::kSInt64: - case TypeFormat::kSInt32: - StrAppend(&name, ", ", TcParserName(options), "kZigZag"); - break; - - case TypeFormat::kBytes: - StrAppend(&name, ", ", TcParserName(options), "kNoUtf8"); - break; - - case TypeFormat::kString: - StrAppend(&name, ", ", TcParserName(options), "kUtf8"); - break; - - case TypeFormat::kStringValidateOnly: - StrAppend(&name, ", ", TcParserName(options), "kUtf8ValidateOnly"); - break; - - default: - break; - } - - name.append(">"); - return name; -} - -} // namespace cpp -} // namespace compiler -} // namespace protobuf -} // namespace google diff --git a/extra/protobuf/protobuf-3.19.4/src/google/protobuf/compiler/cpp/cpp_parse_function_generator.h b/extra/protobuf/protobuf-3.19.4/src/google/protobuf/compiler/cpp/cpp_parse_function_generator.h deleted file mode 100644 index b921067bd2c5..000000000000 --- a/extra/protobuf/protobuf-3.19.4/src/google/protobuf/compiler/cpp/cpp_parse_function_generator.h +++ /dev/null @@ -1,199 +0,0 @@ -// Protocol Buffers - Google's data interchange format -// Copyright 2008 Google Inc. All rights reserved. -// https://developers.google.com/protocol-buffers/ -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// * Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// * Redistributions in binary form must reproduce the above -// copyright notice, this list of conditions and the following disclaimer -// in the documentation and/or other materials provided with the -// distribution. -// * Neither the name of Google Inc. nor the names of its -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -#ifndef GOOGLE_PROTOBUF_COMPILER_CPP_PARSE_FUNCTION_GENERATOR_H__ -#define GOOGLE_PROTOBUF_COMPILER_CPP_PARSE_FUNCTION_GENERATOR_H__ - -#include -#include -#include - -#include -#include -#include -#include -#include -#include - -namespace google { -namespace protobuf { -namespace compiler { -namespace cpp { - -// Helper class for generating tailcall parsing functions. -struct TailCallTableInfo { - TailCallTableInfo(const Descriptor* descriptor, const Options& options, - const std::vector& has_bit_indices, - MessageSCCAnalyzer* scc_analyzer); - // Information to generate field entries. - struct FieldInfo { - const FieldDescriptor* field; - google::protobuf::internal::TcFieldData bits; - std::string func_name; - }; - // Fields parsed by the table fast-path. - std::vector fast_path_fields; - // Fields parsed by slow-path fallback. - std::vector fallback_fields; - // Table size. - int table_size_log2; - // Mask for has-bits of required fields. - uint32_t has_hasbits_required_mask; - // True if a generated fallback function is required instead of generic. - bool use_generated_fallback; -}; - -// ParseFunctionGenerator generates the _InternalParse function for a message -// (and any associated supporting members). -class ParseFunctionGenerator { - public: - ParseFunctionGenerator(const Descriptor* descriptor, int max_has_bit_index, - const std::vector& has_bit_indices, - const std::vector& inlined_string_indices, - const Options& options, - MessageSCCAnalyzer* scc_analyzer, - const std::map& vars); - - // Emits class-level method declarations to `printer`: - void GenerateMethodDecls(io::Printer* printer); - - // Emits out-of-class method implementation definitions to `printer`: - void GenerateMethodImpls(io::Printer* printer); - - // Emits class-level data member declarations to `printer`: - void GenerateDataDecls(io::Printer* printer); - - // Emits out-of-class data member definitions to `printer`: - void GenerateDataDefinitions(io::Printer* printer); - - private: - // Returns true if tailcall table code should be generated. - bool should_generate_tctable() const; - - // Returns true if tailcall table code should be generated, but inside an - // #ifdef guard. - bool should_generate_guarded_tctable() const { - return should_generate_tctable() && - options_.tctable_mode == Options::kTCTableGuarded; - } - - // Generates a tail-calling `_InternalParse` function. - void GenerateTailcallParseFunction(Formatter& format); - - // Generates a fallback function for tailcall table-based parsing. - void GenerateTailcallFallbackFunction(Formatter& format); - - // Generates functions for parsing this message as a field. - void GenerateTailcallFieldParseFunctions(Formatter& format); - - // Generates a looping `_InternalParse` function. - void GenerateLoopingParseFunction(Formatter& format); - - // Generates the tail-call table definition. - void GenerateTailCallTable(Formatter& format); - void GenerateFastFieldEntries(Formatter& format, const std::string& fallback); - - // Generates parsing code for an `ArenaString` field. - void GenerateArenaString(Formatter& format, const FieldDescriptor* field); - - // Generates parsing code for a string-typed field. - void GenerateStrings(Formatter& format, const FieldDescriptor* field, - bool check_utf8); - - // Generates parsing code for a length-delimited field (strings, messages, - // etc.). - void GenerateLengthDelim(Formatter& format, const FieldDescriptor* field); - - // Generates the parsing code for a known field. - void GenerateFieldBody(Formatter& format, - google::protobuf::internal::WireFormatLite::WireType wiretype, - const FieldDescriptor* field); - - // Generates code to parse the next field from the input stream. - void GenerateParseIterationBody( - Formatter& format, const Descriptor* descriptor, - const std::vector& ordered_fields); - - // Generates a `switch` statement to parse each of `ordered_fields`. - void GenerateFieldSwitch( - Formatter& format, - const std::vector& ordered_fields); - - const Descriptor* descriptor_; - MessageSCCAnalyzer* scc_analyzer_; - const Options& options_; - std::map variables_; - std::unique_ptr tc_table_info_; - std::vector inlined_string_indices_; - int num_hasbits_; -}; - -enum class ParseCardinality { - kSingular, - kOneof, - kRepeated, - kPacked, -}; - -// TypeFormat defines parsing types, which encapsulates the expected wire -// format, conversion or validation, and the in-memory layout. -enum class TypeFormat { - // Fixed types: - kFixed64, // fixed64, sfixed64, double - kFixed32, // fixed32, sfixed32, float - - // Varint types: - kVar64, // int64, uint64 - kVar32, // int32, uint32 - kSInt64, // sint64 - kSInt32, // sint32 - kBool, // bool - - // Length-delimited types: - kBytes, // bytes - kString, // string (proto3/UTF-8 strict) - kStringValidateOnly, // string (proto2/UTF-8 validate only) -}; - -// Returns the name of a field parser function. -// -// These are out-of-line functions generated by -// parse_function_inc_generator_main. -std::string GetTailCallFieldHandlerName(ParseCardinality card, - TypeFormat type_format, - int tag_length_bytes, - const Options& options); - -} // namespace cpp -} // namespace compiler -} // namespace protobuf -} // namespace google - -#endif // GOOGLE_PROTOBUF_COMPILER_CPP_PARSE_FUNCTION_GENERATOR_H__ diff --git a/extra/protobuf/protobuf-3.19.4/src/google/protobuf/compiler/cpp/cpp_plugin_unittest.cc b/extra/protobuf/protobuf-3.19.4/src/google/protobuf/compiler/cpp/cpp_plugin_unittest.cc deleted file mode 100644 index 373f38d80794..000000000000 --- a/extra/protobuf/protobuf-3.19.4/src/google/protobuf/compiler/cpp/cpp_plugin_unittest.cc +++ /dev/null @@ -1,236 +0,0 @@ -// Protocol Buffers - Google's data interchange format -// Copyright 2008 Google Inc. All rights reserved. -// https://developers.google.com/protocol-buffers/ -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// * Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// * Redistributions in binary form must reproduce the above -// copyright notice, this list of conditions and the following disclaimer -// in the documentation and/or other materials provided with the -// distribution. -// * Neither the name of Google Inc. nor the names of its -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -// Author: kenton@google.com (Kenton Varda) -// -// TODO(kenton): Share code with the versions of this test in other languages? -// It seemed like parameterizing it would add more complexity than it is -// worth. - -#include - -#include -#include -#include -#include -#include -#include -#include -#include - -namespace google { -namespace protobuf { -namespace compiler { -namespace cpp { -namespace { - -class TestGenerator : public CodeGenerator { - public: - TestGenerator() {} - ~TestGenerator() {} - - virtual bool Generate(const FileDescriptor* file, - const std::string& parameter, GeneratorContext* context, - std::string* error) const { - TryInsert("test.pb.h", "includes", context); - TryInsert("test.pb.h", "namespace_scope", context); - TryInsert("test.pb.h", "global_scope", context); - TryInsert("test.pb.h", "class_scope:foo.Bar", context); - TryInsert("test.pb.h", "class_scope:foo.Bar.Baz", context); - - TryInsert("test.pb.cc", "includes", context); - TryInsert("test.pb.cc", "namespace_scope", context); - TryInsert("test.pb.cc", "global_scope", context); - - // Check field accessors for an optional int32: - TryInsert("test.pb.h", "field_get:foo.Bar.optInt", context); - TryInsert("test.pb.h", "field_set:foo.Bar.optInt", context); - - // Check field accessors for a repeated int32: - TryInsert("test.pb.h", "field_get:foo.Bar.repeatedInt", context); - TryInsert("test.pb.h", "field_set:foo.Bar.repeatedInt", context); - - // Check field accessors for a required string: - TryInsert("test.pb.h", "field_get:foo.Bar.requiredString", context); - TryInsert("test.pb.h", "field_set:foo.Bar.requiredString", context); - TryInsert("test.pb.h", "field_mutable:foo.Bar.requiredString", context); - TryInsert("test.pb.h", "field_set_allocated:foo.Bar.requiredString", - context); - - // Check field accessors for a repeated string: - TryInsert("test.pb.h", "field_get:foo.Bar.repeatedString", context); - TryInsert("test.pb.h", "field_set:foo.Bar.repeatedString", context); - TryInsert("test.pb.h", "field_set_char:foo.Bar.repeatedString", context); - TryInsert("test.pb.h", "field_set_pointer:foo.Bar.repeatedString", context); - TryInsert("test.pb.h", "field_mutable:foo.Bar.repeatedString", context); - TryInsert("test.pb.h", "field_set_char:foo.Bar.repeatedString", context); - TryInsert("test.pb.h", "field_set_pointer:foo.Bar.repeatedString", context); - - // Check field accessors for an int inside oneof{}: - TryInsert("test.pb.h", "field_get:foo.Bar.oneOfInt", context); - TryInsert("test.pb.h", "field_set:foo.Bar.oneOfInt", context); - - // Check field accessors for a string inside oneof{}: - TryInsert("test.pb.h", "field_get:foo.Bar.oneOfString", context); - TryInsert("test.pb.h", "field_set:foo.Bar.oneOfString", context); - TryInsert("test.pb.h", "field_mutable:foo.Bar.oneOfString", context); - TryInsert("test.pb.h", "field_set_allocated:foo.Bar.oneOfString", context); - - // Check field accessors for an optional message: - TryInsert("test.pb.h", "field_get:foo.Bar.optMessage", context); - TryInsert("test.pb.h", "field_mutable:foo.Bar.optMessage", context); - TryInsert("test.pb.h", "field_set_allocated:foo.Bar.optMessage", context); - - // Check field accessors for a repeated message: - TryInsert("test.pb.h", "field_add:foo.Bar.repeatedMessage", context); - TryInsert("test.pb.h", "field_get:foo.Bar.repeatedMessage", context); - TryInsert("test.pb.h", "field_list:foo.Bar.repeatedMessage", context); - TryInsert("test.pb.h", "field_mutable:foo.Bar.repeatedMessage", context); - TryInsert("test.pb.h", "field_mutable_list:foo.Bar.repeatedMessage", - context); - - // Check field accessors for a message inside oneof{}: - TryInsert("test.pb.h", "field_get:foo.Bar.oneOfMessage", context); - TryInsert("test.pb.h", "field_mutable:foo.Bar.oneOfMessage", context); - TryInsert("test.pb.cc", "field_set_allocated:foo.Bar.oneOfMessage", - context); - - // Check field accessors for an optional enum: - TryInsert("test.pb.h", "field_get:foo.Bar.optEnum", context); - TryInsert("test.pb.h", "field_set:foo.Bar.optEnum", context); - - // Check field accessors for a repeated enum: - TryInsert("test.pb.h", "field_get:foo.Bar.repeatedEnum", context); - TryInsert("test.pb.h", "field_set:foo.Bar.repeatedEnum", context); - TryInsert("test.pb.h", "field_add:foo.Bar.repeatedEnum", context); - TryInsert("test.pb.h", "field_list:foo.Bar.repeatedEnum", context); - TryInsert("test.pb.h", "field_mutable_list:foo.Bar.repeatedEnum", context); - - // Check field accessors for an enum inside oneof{}: - TryInsert("test.pb.h", "field_get:foo.Bar.oneOfEnum", context); - TryInsert("test.pb.h", "field_set:foo.Bar.oneOfEnum", context); - - // Check field accessors for a required cord: - TryInsert("test.pb.h", "field_get:foo.Bar.requiredCord", context); - TryInsert("test.pb.h", "field_set:foo.Bar.requiredCord", context); - TryInsert("test.pb.h", "field_mutable:foo.Bar.requiredCord", context); - - // Check field accessors for a repeated cord: - TryInsert("test.pb.h", "field_get:foo.Bar.repeatedCord", context); - TryInsert("test.pb.h", "field_set:foo.Bar.repeatedCord", context); - TryInsert("test.pb.h", "field_add:foo.Bar.repeatedCord", context); - TryInsert("test.pb.h", "field_list:foo.Bar.repeatedCord", context); - TryInsert("test.pb.h", "field_mutable:foo.Bar.repeatedCord", context); - TryInsert("test.pb.h", "field_mutable_list:foo.Bar.repeatedCord", context); - - // Check field accessors for a cord inside oneof{}: - TryInsert("test.pb.h", "field_get:foo.Bar.oneOfCord", context); - TryInsert("test.pb.h", "field_set:foo.Bar.oneOfCord", context); - TryInsert("test.pb.h", "field_mutable:foo.Bar.oneOfCord", context); - - return true; - } - - void TryInsert(const std::string& filename, - const std::string& insertion_point, - GeneratorContext* context) const { - std::unique_ptr output( - context->OpenForInsert(filename, insertion_point)); - io::Printer printer(output.get(), '$'); - printer.Print("// inserted $name$\n", "name", insertion_point); - } -}; - -// This test verifies that all the expected insertion points exist. It does -// not verify that they are correctly-placed; that would require actually -// compiling the output which is a bit more than I care to do for this test. -TEST(CppPluginTest, PluginTest) { - GOOGLE_CHECK_OK(File::SetContents(TestTempDir() + "/test.proto", - "syntax = \"proto2\";\n" - "package foo;\n" - "\n" - "enum Thud { VALUE = 0; }\n" - "\n" - "message Bar {\n" - " message Baz {}\n" - " optional int32 optInt = 1;\n" - " repeated int32 repeatedInt = 2;\n" - "\n" - " required string requiredString = 3;\n" - " repeated string repeatedString = 4;\n" - "\n" - " optional Baz optMessage = 6;\n" - " repeated Baz repeatedMessage = 7;\n" - "\n" - " optional Thud optEnum = 8;\n" - " repeated Thud repeatedEnum = 9;\n" - "\n" - " required string requiredCord = 10 [\n" - " ctype = CORD\n" - " ];\n" - " repeated string repeatedCord = 11 [\n" - " ctype = CORD\n" - " ];\n" - "\n" - " oneof Qux {\n" - " int64 oneOfInt = 20;\n" - " string oneOfString = 21;\n" - " Baz oneOfMessage = 22;\n" - " Thud oneOfEnum = 23;" - " string oneOfCord = 24 [\n" - " ctype = CORD\n" - " ];\n" - " }\n" - "}\n", - true)); - - CommandLineInterface cli; - cli.SetInputsAreProtoPathRelative(true); - - CppGenerator cpp_generator; - TestGenerator test_generator; - cli.RegisterGenerator("--cpp_out", &cpp_generator, ""); - cli.RegisterGenerator("--test_out", &test_generator, ""); - - std::string proto_path = "-I" + TestTempDir(); - std::string cpp_out = "--cpp_out=" + TestTempDir(); - std::string test_out = "--test_out=" + TestTempDir(); - - const char* argv[] = {"protoc", proto_path.c_str(), cpp_out.c_str(), - test_out.c_str(), "test.proto"}; - - EXPECT_EQ(0, cli.Run(5, argv)); -} - -} // namespace -} // namespace cpp -} // namespace compiler -} // namespace protobuf -} // namespace google diff --git a/extra/protobuf/protobuf-3.19.4/src/google/protobuf/compiler/cpp/cpp_primitive_field.cc b/extra/protobuf/protobuf-3.19.4/src/google/protobuf/compiler/cpp/cpp_primitive_field.cc deleted file mode 100644 index ffccf08aae08..000000000000 --- a/extra/protobuf/protobuf-3.19.4/src/google/protobuf/compiler/cpp/cpp_primitive_field.cc +++ /dev/null @@ -1,505 +0,0 @@ -// Protocol Buffers - Google's data interchange format -// Copyright 2008 Google Inc. All rights reserved. -// https://developers.google.com/protocol-buffers/ -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// * Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// * Redistributions in binary form must reproduce the above -// copyright notice, this list of conditions and the following disclaimer -// in the documentation and/or other materials provided with the -// distribution. -// * Neither the name of Google Inc. nor the names of its -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -// Author: kenton@google.com (Kenton Varda) -// Based on original Protocol Buffers design by -// Sanjay Ghemawat, Jeff Dean, and others. - -#include - -#include -#include -#include -#include - -namespace google { -namespace protobuf { -namespace compiler { -namespace cpp { - -using internal::WireFormatLite; - -namespace { - -// For encodings with fixed sizes, returns that size in bytes. Otherwise -// returns -1. -int FixedSize(FieldDescriptor::Type type) { - switch (type) { - case FieldDescriptor::TYPE_INT32: - return -1; - case FieldDescriptor::TYPE_INT64: - return -1; - case FieldDescriptor::TYPE_UINT32: - return -1; - case FieldDescriptor::TYPE_UINT64: - return -1; - case FieldDescriptor::TYPE_SINT32: - return -1; - case FieldDescriptor::TYPE_SINT64: - return -1; - case FieldDescriptor::TYPE_FIXED32: - return WireFormatLite::kFixed32Size; - case FieldDescriptor::TYPE_FIXED64: - return WireFormatLite::kFixed64Size; - case FieldDescriptor::TYPE_SFIXED32: - return WireFormatLite::kSFixed32Size; - case FieldDescriptor::TYPE_SFIXED64: - return WireFormatLite::kSFixed64Size; - case FieldDescriptor::TYPE_FLOAT: - return WireFormatLite::kFloatSize; - case FieldDescriptor::TYPE_DOUBLE: - return WireFormatLite::kDoubleSize; - - case FieldDescriptor::TYPE_BOOL: - return WireFormatLite::kBoolSize; - case FieldDescriptor::TYPE_ENUM: - return -1; - - case FieldDescriptor::TYPE_STRING: - return -1; - case FieldDescriptor::TYPE_BYTES: - return -1; - case FieldDescriptor::TYPE_GROUP: - return -1; - case FieldDescriptor::TYPE_MESSAGE: - return -1; - - // No default because we want the compiler to complain if any new - // types are added. - } - GOOGLE_LOG(FATAL) << "Can't get here."; - return -1; -} - -void SetPrimitiveVariables(const FieldDescriptor* descriptor, - std::map* variables, - const Options& options) { - SetCommonFieldVariables(descriptor, variables, options); - (*variables)["type"] = PrimitiveTypeName(options, descriptor->cpp_type()); - (*variables)["default"] = DefaultValue(options, descriptor); - (*variables)["tag"] = StrCat(internal::WireFormat::MakeTag(descriptor)); - int fixed_size = FixedSize(descriptor->type()); - if (fixed_size != -1) { - (*variables)["fixed_size"] = StrCat(fixed_size); - } - (*variables)["wire_format_field_type"] = FieldDescriptorProto_Type_Name( - static_cast(descriptor->type())); - (*variables)["full_name"] = descriptor->full_name(); -} - -} // namespace - -// =================================================================== - -PrimitiveFieldGenerator::PrimitiveFieldGenerator( - const FieldDescriptor* descriptor, const Options& options) - : FieldGenerator(descriptor, options) { - SetPrimitiveVariables(descriptor, &variables_, options); -} - -PrimitiveFieldGenerator::~PrimitiveFieldGenerator() {} - -void PrimitiveFieldGenerator::GeneratePrivateMembers( - io::Printer* printer) const { - Formatter format(printer, variables_); - format("$type$ $name$_;\n"); -} - -void PrimitiveFieldGenerator::GenerateAccessorDeclarations( - io::Printer* printer) const { - Formatter format(printer, variables_); - format( - "$deprecated_attr$$type$ ${1$$name$$}$() const;\n" - "$deprecated_attr$void ${1$set_$name$$}$($type$ value);\n" - "private:\n" - "$type$ ${1$_internal_$name$$}$() const;\n" - "void ${1$_internal_set_$name$$}$($type$ value);\n" - "public:\n", - descriptor_); -} - -void PrimitiveFieldGenerator::GenerateInlineAccessorDefinitions( - io::Printer* printer) const { - Formatter format(printer, variables_); - format( - "inline $type$ $classname$::_internal_$name$() const {\n" - " return $name$_;\n" - "}\n" - "inline $type$ $classname$::$name$() const {\n" - "$annotate_get$" - " // @@protoc_insertion_point(field_get:$full_name$)\n" - " return _internal_$name$();\n" - "}\n" - "inline void $classname$::_internal_set_$name$($type$ value) {\n" - " $set_hasbit$\n" - " $name$_ = value;\n" - "}\n" - "inline void $classname$::set_$name$($type$ value) {\n" - " _internal_set_$name$(value);\n" - "$annotate_set$" - " // @@protoc_insertion_point(field_set:$full_name$)\n" - "}\n"); -} - -void PrimitiveFieldGenerator::GenerateClearingCode(io::Printer* printer) const { - Formatter format(printer, variables_); - format("$name$_ = $default$;\n"); -} - -void PrimitiveFieldGenerator::GenerateMergingCode(io::Printer* printer) const { - Formatter format(printer, variables_); - format("_internal_set_$name$(from._internal_$name$());\n"); -} - -void PrimitiveFieldGenerator::GenerateSwappingCode(io::Printer* printer) const { - Formatter format(printer, variables_); - format("swap($name$_, other->$name$_);\n"); -} - -void PrimitiveFieldGenerator::GenerateConstructorCode( - io::Printer* printer) const { - Formatter format(printer, variables_); - format("$name$_ = $default$;\n"); -} - -void PrimitiveFieldGenerator::GenerateCopyConstructorCode( - io::Printer* printer) const { - Formatter format(printer, variables_); - format("$name$_ = from.$name$_;\n"); -} - -void PrimitiveFieldGenerator::GenerateSerializeWithCachedSizesToArray( - io::Printer* printer) const { - Formatter format(printer, variables_); - format( - "target = stream->EnsureSpace(target);\n" - "target = " - "::$proto_ns$::internal::WireFormatLite::Write$declared_type$ToArray(" - "$number$, this->_internal_$name$(), target);\n"); -} - -void PrimitiveFieldGenerator::GenerateByteSize(io::Printer* printer) const { - Formatter format(printer, variables_); - int fixed_size = FixedSize(descriptor_->type()); - if (fixed_size == -1) { - if (internal::WireFormat::TagSize(descriptor_->number(), - descriptor_->type()) == 1) { - // Adding one is very common and it turns out it can be done for - // free inside of WireFormatLite, so we can save an instruction here. - format( - "total_size += ::$proto_ns$::internal::WireFormatLite::" - "$declared_type$SizePlusOne(this->_internal_$name$());\n"); - } else { - format( - "total_size += $tag_size$ +\n" - " ::$proto_ns$::internal::WireFormatLite::$declared_type$Size(\n" - " this->_internal_$name$());\n"); - } - } else { - format("total_size += $tag_size$ + $fixed_size$;\n"); - } -} - -void PrimitiveFieldGenerator::GenerateConstinitInitializer( - io::Printer* printer) const { - Formatter format(printer, variables_); - format("$name$_($default$)"); -} - -// =================================================================== - -PrimitiveOneofFieldGenerator::PrimitiveOneofFieldGenerator( - const FieldDescriptor* descriptor, const Options& options) - : PrimitiveFieldGenerator(descriptor, options) { - SetCommonOneofFieldVariables(descriptor, &variables_); -} - -PrimitiveOneofFieldGenerator::~PrimitiveOneofFieldGenerator() {} - -void PrimitiveOneofFieldGenerator::GenerateInlineAccessorDefinitions( - io::Printer* printer) const { - Formatter format(printer, variables_); - format( - "inline $type$ $classname$::_internal_$name$() const {\n" - " if (_internal_has_$name$()) {\n" - " return $field_member$;\n" - " }\n" - " return $default$;\n" - "}\n" - "inline void $classname$::_internal_set_$name$($type$ value) {\n" - " if (!_internal_has_$name$()) {\n" - " clear_$oneof_name$();\n" - " set_has_$name$();\n" - " }\n" - " $field_member$ = value;\n" - "}\n" - "inline $type$ $classname$::$name$() const {\n" - "$annotate_get$" - " // @@protoc_insertion_point(field_get:$full_name$)\n" - " return _internal_$name$();\n" - "}\n" - "inline void $classname$::set_$name$($type$ value) {\n" - " _internal_set_$name$(value);\n" - "$annotate_set$" - " // @@protoc_insertion_point(field_set:$full_name$)\n" - "}\n"); -} - -void PrimitiveOneofFieldGenerator::GenerateClearingCode( - io::Printer* printer) const { - Formatter format(printer, variables_); - format("$field_member$ = $default$;\n"); -} - -void PrimitiveOneofFieldGenerator::GenerateSwappingCode( - io::Printer* printer) const { - // Don't print any swapping code. Swapping the union will swap this field. -} - -void PrimitiveOneofFieldGenerator::GenerateConstructorCode( - io::Printer* printer) const { - Formatter format(printer, variables_); - format("$ns$::_$classname$_default_instance_.$name$_ = $default$;\n"); -} - -// =================================================================== - -RepeatedPrimitiveFieldGenerator::RepeatedPrimitiveFieldGenerator( - const FieldDescriptor* descriptor, const Options& options) - : FieldGenerator(descriptor, options) { - SetPrimitiveVariables(descriptor, &variables_, options); - - if (descriptor->is_packed()) { - variables_["packed_reader"] = "ReadPackedPrimitive"; - variables_["repeated_reader"] = "ReadRepeatedPrimitiveNoInline"; - } else { - variables_["packed_reader"] = "ReadPackedPrimitiveNoInline"; - variables_["repeated_reader"] = "ReadRepeatedPrimitive"; - } -} - -RepeatedPrimitiveFieldGenerator::~RepeatedPrimitiveFieldGenerator() {} - -void RepeatedPrimitiveFieldGenerator::GeneratePrivateMembers( - io::Printer* printer) const { - Formatter format(printer, variables_); - format("::$proto_ns$::RepeatedField< $type$ > $name$_;\n"); - if (descriptor_->is_packed() && FixedSize(descriptor_->type()) == -1 && - HasGeneratedMethods(descriptor_->file(), options_)) { - format("mutable std::atomic _$name$_cached_byte_size_;\n"); - } -} - -void RepeatedPrimitiveFieldGenerator::GenerateAccessorDeclarations( - io::Printer* printer) const { - Formatter format(printer, variables_); - format( - "private:\n" - "$type$ ${1$_internal_$name$$}$(int index) const;\n" - "const ::$proto_ns$::RepeatedField< $type$ >&\n" - " ${1$_internal_$name$$}$() const;\n" - "void ${1$_internal_add_$name$$}$($type$ value);\n" - "::$proto_ns$::RepeatedField< $type$ >*\n" - " ${1$_internal_mutable_$name$$}$();\n" - "public:\n" - "$deprecated_attr$$type$ ${1$$name$$}$(int index) const;\n" - "$deprecated_attr$void ${1$set_$name$$}$(int index, $type$ value);\n" - "$deprecated_attr$void ${1$add_$name$$}$($type$ value);\n" - "$deprecated_attr$const ::$proto_ns$::RepeatedField< $type$ >&\n" - " ${1$$name$$}$() const;\n" - "$deprecated_attr$::$proto_ns$::RepeatedField< $type$ >*\n" - " ${1$mutable_$name$$}$();\n", - descriptor_); -} - -void RepeatedPrimitiveFieldGenerator::GenerateInlineAccessorDefinitions( - io::Printer* printer) const { - Formatter format(printer, variables_); - format( - "inline $type$ $classname$::_internal_$name$(int index) const {\n" - " return $name$_.Get(index);\n" - "}\n" - "inline $type$ $classname$::$name$(int index) const {\n" - "$annotate_get$" - " // @@protoc_insertion_point(field_get:$full_name$)\n" - " return _internal_$name$(index);\n" - "}\n" - "inline void $classname$::set_$name$(int index, $type$ value) {\n" - "$annotate_set$" - " $name$_.Set(index, value);\n" - " // @@protoc_insertion_point(field_set:$full_name$)\n" - "}\n" - "inline void $classname$::_internal_add_$name$($type$ value) {\n" - " $name$_.Add(value);\n" - "}\n" - "inline void $classname$::add_$name$($type$ value) {\n" - " _internal_add_$name$(value);\n" - "$annotate_add$" - " // @@protoc_insertion_point(field_add:$full_name$)\n" - "}\n" - "inline const ::$proto_ns$::RepeatedField< $type$ >&\n" - "$classname$::_internal_$name$() const {\n" - " return $name$_;\n" - "}\n" - "inline const ::$proto_ns$::RepeatedField< $type$ >&\n" - "$classname$::$name$() const {\n" - "$annotate_list$" - " // @@protoc_insertion_point(field_list:$full_name$)\n" - " return _internal_$name$();\n" - "}\n" - "inline ::$proto_ns$::RepeatedField< $type$ >*\n" - "$classname$::_internal_mutable_$name$() {\n" - " return &$name$_;\n" - "}\n" - "inline ::$proto_ns$::RepeatedField< $type$ >*\n" - "$classname$::mutable_$name$() {\n" - "$annotate_mutable_list$" - " // @@protoc_insertion_point(field_mutable_list:$full_name$)\n" - " return _internal_mutable_$name$();\n" - "}\n"); -} - -void RepeatedPrimitiveFieldGenerator::GenerateClearingCode( - io::Printer* printer) const { - Formatter format(printer, variables_); - format("$name$_.Clear();\n"); -} - -void RepeatedPrimitiveFieldGenerator::GenerateMergingCode( - io::Printer* printer) const { - Formatter format(printer, variables_); - format("$name$_.MergeFrom(from.$name$_);\n"); -} - -void RepeatedPrimitiveFieldGenerator::GenerateSwappingCode( - io::Printer* printer) const { - Formatter format(printer, variables_); - format("$name$_.InternalSwap(&other->$name$_);\n"); -} - -void RepeatedPrimitiveFieldGenerator::GenerateConstructorCode( - io::Printer* printer) const { - // Not needed for repeated fields. -} - -void RepeatedPrimitiveFieldGenerator::GenerateCopyConstructorCode( - io::Printer* printer) const { - Formatter format(printer, variables_); - format("$name$_.CopyFrom(from.$name$_);\n"); -} - -void RepeatedPrimitiveFieldGenerator::GenerateSerializeWithCachedSizesToArray( - io::Printer* printer) const { - Formatter format(printer, variables_); - if (descriptor_->is_packed()) { - if (FixedSize(descriptor_->type()) == -1) { - format( - "{\n" - " int byte_size = " - "_$name$_cached_byte_size_.load(std::memory_order_relaxed);\n" - " if (byte_size > 0) {\n" - " target = stream->Write$declared_type$Packed(\n" - " $number$, _internal_$name$(), byte_size, target);\n" - " }\n" - "}\n"); - } else { - format( - "if (this->_internal_$name$_size() > 0) {\n" - " target = stream->WriteFixedPacked($number$, _internal_$name$(), " - "target);\n" - "}\n"); - } - } else { - format( - "for (int i = 0, n = this->_internal_$name$_size(); i < n; i++) {\n" - " target = stream->EnsureSpace(target);\n" - " target = ::$proto_ns$::internal::WireFormatLite::" - "Write$declared_type$ToArray($number$, this->_internal_$name$(i), " - "target);\n" - "}\n"); - } -} - -void RepeatedPrimitiveFieldGenerator::GenerateByteSize( - io::Printer* printer) const { - Formatter format(printer, variables_); - format("{\n"); - format.Indent(); - int fixed_size = FixedSize(descriptor_->type()); - if (fixed_size == -1) { - format( - "size_t data_size = ::$proto_ns$::internal::WireFormatLite::\n" - " $declared_type$Size(this->$name$_);\n"); - } else { - format( - "unsigned int count = static_cast(this->_internal_$name$_size());\n" - "size_t data_size = $fixed_size$UL * count;\n"); - } - - if (descriptor_->is_packed()) { - format( - "if (data_size > 0) {\n" - " total_size += $tag_size$ +\n" - " ::$proto_ns$::internal::WireFormatLite::Int32Size(\n" - " static_cast<$int32$>(data_size));\n" - "}\n"); - if (FixedSize(descriptor_->type()) == -1) { - format( - "int cached_size = ::$proto_ns$::internal::ToCachedSize(data_size);\n" - "_$name$_cached_byte_size_.store(cached_size,\n" - " std::memory_order_relaxed);\n"); - } - format("total_size += data_size;\n"); - } else { - format( - "total_size += $tag_size$ *\n" - " " - "::$proto_ns$::internal::FromIntSize(this->_internal_$name$_size());\n" - "total_size += data_size;\n"); - } - format.Outdent(); - format("}\n"); -} - -void RepeatedPrimitiveFieldGenerator::GenerateConstinitInitializer( - io::Printer* printer) const { - Formatter format(printer, variables_); - format("$name$_()"); - if (descriptor_->is_packed() && FixedSize(descriptor_->type()) == -1 && - HasGeneratedMethods(descriptor_->file(), options_)) { - format("\n, _$name$_cached_byte_size_(0)"); - } -} - -} // namespace cpp -} // namespace compiler -} // namespace protobuf -} // namespace google diff --git a/extra/protobuf/protobuf-3.19.4/src/google/protobuf/compiler/cpp/cpp_primitive_field.h b/extra/protobuf/protobuf-3.19.4/src/google/protobuf/compiler/cpp/cpp_primitive_field.h deleted file mode 100644 index ff7c208ff294..000000000000 --- a/extra/protobuf/protobuf-3.19.4/src/google/protobuf/compiler/cpp/cpp_primitive_field.h +++ /dev/null @@ -1,116 +0,0 @@ -// Protocol Buffers - Google's data interchange format -// Copyright 2008 Google Inc. All rights reserved. -// https://developers.google.com/protocol-buffers/ -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// * Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// * Redistributions in binary form must reproduce the above -// copyright notice, this list of conditions and the following disclaimer -// in the documentation and/or other materials provided with the -// distribution. -// * Neither the name of Google Inc. nor the names of its -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -// Author: kenton@google.com (Kenton Varda) -// Based on original Protocol Buffers design by -// Sanjay Ghemawat, Jeff Dean, and others. - -#ifndef GOOGLE_PROTOBUF_COMPILER_CPP_PRIMITIVE_FIELD_H__ -#define GOOGLE_PROTOBUF_COMPILER_CPP_PRIMITIVE_FIELD_H__ - -#include -#include -#include - -namespace google { -namespace protobuf { -namespace compiler { -namespace cpp { - -class PrimitiveFieldGenerator : public FieldGenerator { - public: - PrimitiveFieldGenerator(const FieldDescriptor* descriptor, - const Options& options); - ~PrimitiveFieldGenerator(); - - // implements FieldGenerator --------------------------------------- - void GeneratePrivateMembers(io::Printer* printer) const override; - void GenerateAccessorDeclarations(io::Printer* printer) const override; - void GenerateInlineAccessorDefinitions(io::Printer* printer) const override; - void GenerateClearingCode(io::Printer* printer) const override; - void GenerateMergingCode(io::Printer* printer) const override; - void GenerateSwappingCode(io::Printer* printer) const override; - void GenerateConstructorCode(io::Printer* printer) const override; - void GenerateCopyConstructorCode(io::Printer* printer) const override; - void GenerateSerializeWithCachedSizesToArray( - io::Printer* printer) const override; - void GenerateByteSize(io::Printer* printer) const override; - void GenerateConstinitInitializer(io::Printer* printer) const override; - - private: - GOOGLE_DISALLOW_EVIL_CONSTRUCTORS(PrimitiveFieldGenerator); -}; - -class PrimitiveOneofFieldGenerator : public PrimitiveFieldGenerator { - public: - PrimitiveOneofFieldGenerator(const FieldDescriptor* descriptor, - const Options& options); - ~PrimitiveOneofFieldGenerator(); - - // implements FieldGenerator --------------------------------------- - void GenerateInlineAccessorDefinitions(io::Printer* printer) const override; - void GenerateClearingCode(io::Printer* printer) const override; - void GenerateSwappingCode(io::Printer* printer) const override; - void GenerateConstructorCode(io::Printer* printer) const override; - - private: - GOOGLE_DISALLOW_EVIL_CONSTRUCTORS(PrimitiveOneofFieldGenerator); -}; - -class RepeatedPrimitiveFieldGenerator : public FieldGenerator { - public: - RepeatedPrimitiveFieldGenerator(const FieldDescriptor* descriptor, - const Options& options); - ~RepeatedPrimitiveFieldGenerator(); - - // implements FieldGenerator --------------------------------------- - void GeneratePrivateMembers(io::Printer* printer) const override; - void GenerateAccessorDeclarations(io::Printer* printer) const override; - void GenerateInlineAccessorDefinitions(io::Printer* printer) const override; - void GenerateClearingCode(io::Printer* printer) const override; - void GenerateMergingCode(io::Printer* printer) const override; - void GenerateSwappingCode(io::Printer* printer) const override; - void GenerateConstructorCode(io::Printer* printer) const override; - void GenerateCopyConstructorCode(io::Printer* printer) const override; - void GenerateSerializeWithCachedSizesToArray( - io::Printer* printer) const override; - void GenerateByteSize(io::Printer* printer) const override; - void GenerateConstinitInitializer(io::Printer* printer) const override; - - private: - GOOGLE_DISALLOW_EVIL_CONSTRUCTORS(RepeatedPrimitiveFieldGenerator); -}; - -} // namespace cpp -} // namespace compiler -} // namespace protobuf -} // namespace google - -#endif // GOOGLE_PROTOBUF_COMPILER_CPP_PRIMITIVE_FIELD_H__ diff --git a/extra/protobuf/protobuf-3.19.4/src/google/protobuf/compiler/cpp/cpp_service.cc b/extra/protobuf/protobuf-3.19.4/src/google/protobuf/compiler/cpp/cpp_service.cc deleted file mode 100644 index 6b1ca83eda7e..000000000000 --- a/extra/protobuf/protobuf-3.19.4/src/google/protobuf/compiler/cpp/cpp_service.cc +++ /dev/null @@ -1,327 +0,0 @@ -// Protocol Buffers - Google's data interchange format -// Copyright 2008 Google Inc. All rights reserved. -// https://developers.google.com/protocol-buffers/ -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// * Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// * Redistributions in binary form must reproduce the above -// copyright notice, this list of conditions and the following disclaimer -// in the documentation and/or other materials provided with the -// distribution. -// * Neither the name of Google Inc. nor the names of its -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -// Author: kenton@google.com (Kenton Varda) -// Based on original Protocol Buffers design by -// Sanjay Ghemawat, Jeff Dean, and others. - -#include -#include -#include -#include - -namespace google { -namespace protobuf { -namespace compiler { -namespace cpp { - -namespace { - -void InitMethodVariables(const MethodDescriptor* method, const Options& options, - Formatter* format) { - format->Set("name", method->name()); - format->Set("input_type", QualifiedClassName(method->input_type(), options)); - format->Set("output_type", - QualifiedClassName(method->output_type(), options)); -} - -} // namespace - -ServiceGenerator::ServiceGenerator( - const ServiceDescriptor* descriptor, - const std::map& vars, const Options& options) - : descriptor_(descriptor), vars_(vars), options_(options) { - vars_["classname"] = descriptor_->name(); - vars_["full_name"] = descriptor_->full_name(); -} - -ServiceGenerator::~ServiceGenerator() {} - -void ServiceGenerator::GenerateDeclarations(io::Printer* printer) { - Formatter format(printer, vars_); - // Forward-declare the stub type. - format( - "class $classname$_Stub;\n" - "\n"); - - GenerateInterface(printer); - GenerateStubDefinition(printer); -} - -void ServiceGenerator::GenerateInterface(io::Printer* printer) { - Formatter format(printer, vars_); - format( - "class $dllexport_decl $$classname$ : public ::$proto_ns$::Service {\n" - " protected:\n" - " // This class should be treated as an abstract interface.\n" - " inline $classname$() {};\n" - " public:\n" - " virtual ~$classname$();\n"); - printer->Indent(); - - format( - "\n" - "typedef $classname$_Stub Stub;\n" - "\n" - "static const ::$proto_ns$::ServiceDescriptor* descriptor();\n" - "\n"); - - GenerateMethodSignatures(VIRTUAL, printer); - - format( - "\n" - "// implements Service ----------------------------------------------\n" - "\n" - "const ::$proto_ns$::ServiceDescriptor* GetDescriptor();\n" - "void CallMethod(const ::$proto_ns$::MethodDescriptor* method,\n" - " ::$proto_ns$::RpcController* controller,\n" - " const ::$proto_ns$::Message* request,\n" - " ::$proto_ns$::Message* response,\n" - " ::google::protobuf::Closure* done);\n" - "const ::$proto_ns$::Message& GetRequestPrototype(\n" - " const ::$proto_ns$::MethodDescriptor* method) const;\n" - "const ::$proto_ns$::Message& GetResponsePrototype(\n" - " const ::$proto_ns$::MethodDescriptor* method) const;\n"); - - printer->Outdent(); - format( - "\n" - " private:\n" - " GOOGLE_DISALLOW_EVIL_CONSTRUCTORS($classname$);\n" - "};\n" - "\n"); -} - -void ServiceGenerator::GenerateStubDefinition(io::Printer* printer) { - Formatter format(printer, vars_); - format( - "class $dllexport_decl $$classname$_Stub : public $classname$ {\n" - " public:\n"); - - printer->Indent(); - - format( - "$classname$_Stub(::$proto_ns$::RpcChannel* channel);\n" - "$classname$_Stub(::$proto_ns$::RpcChannel* channel,\n" - " ::$proto_ns$::Service::ChannelOwnership ownership);\n" - "~$classname$_Stub();\n" - "\n" - "inline ::$proto_ns$::RpcChannel* channel() { return channel_; }\n" - "\n" - "// implements $classname$ ------------------------------------------\n" - "\n"); - - GenerateMethodSignatures(NON_VIRTUAL, printer); - - printer->Outdent(); - format( - " private:\n" - " ::$proto_ns$::RpcChannel* channel_;\n" - " bool owns_channel_;\n" - " GOOGLE_DISALLOW_EVIL_CONSTRUCTORS($classname$_Stub);\n" - "};\n" - "\n"); -} - -void ServiceGenerator::GenerateMethodSignatures(VirtualOrNon virtual_or_non, - io::Printer* printer) { - for (int i = 0; i < descriptor_->method_count(); i++) { - const MethodDescriptor* method = descriptor_->method(i); - Formatter format(printer, vars_); - InitMethodVariables(method, options_, &format); - format.Set("virtual", virtual_or_non == VIRTUAL ? "virtual " : ""); - format( - "$virtual$void $name$(::$proto_ns$::RpcController* controller,\n" - " const $input_type$* request,\n" - " $output_type$* response,\n" - " ::google::protobuf::Closure* done);\n"); - } -} - -// =================================================================== - -void ServiceGenerator::GenerateImplementation(io::Printer* printer) { - Formatter format(printer, vars_); - format( - "$classname$::~$classname$() {}\n" - "\n" - "const ::$proto_ns$::ServiceDescriptor* $classname$::descriptor() {\n" - " " - "::$proto_ns$::internal::AssignDescriptors(&$desc_table$);\n" - " return $file_level_service_descriptors$[$1$];\n" - "}\n" - "\n" - "const ::$proto_ns$::ServiceDescriptor* $classname$::GetDescriptor() {\n" - " return descriptor();\n" - "}\n" - "\n", - index_in_metadata_); - - // Generate methods of the interface. - GenerateNotImplementedMethods(printer); - GenerateCallMethod(printer); - GenerateGetPrototype(REQUEST, printer); - GenerateGetPrototype(RESPONSE, printer); - - // Generate stub implementation. - format( - "$classname$_Stub::$classname$_Stub(::$proto_ns$::RpcChannel* channel)\n" - " : channel_(channel), owns_channel_(false) {}\n" - "$classname$_Stub::$classname$_Stub(\n" - " ::$proto_ns$::RpcChannel* channel,\n" - " ::$proto_ns$::Service::ChannelOwnership ownership)\n" - " : channel_(channel),\n" - " owns_channel_(ownership == " - "::$proto_ns$::Service::STUB_OWNS_CHANNEL) " - "{}\n" - "$classname$_Stub::~$classname$_Stub() {\n" - " if (owns_channel_) delete channel_;\n" - "}\n" - "\n"); - - GenerateStubMethods(printer); -} - -void ServiceGenerator::GenerateNotImplementedMethods(io::Printer* printer) { - for (int i = 0; i < descriptor_->method_count(); i++) { - const MethodDescriptor* method = descriptor_->method(i); - Formatter format(printer, vars_); - InitMethodVariables(method, options_, &format); - format( - "void $classname$::$name$(::$proto_ns$::RpcController* controller,\n" - " const $input_type$*,\n" - " $output_type$*,\n" - " ::google::protobuf::Closure* done) {\n" - " controller->SetFailed(\"Method $name$() not implemented.\");\n" - " done->Run();\n" - "}\n" - "\n"); - } -} - -void ServiceGenerator::GenerateCallMethod(io::Printer* printer) { - Formatter format(printer, vars_); - format( - "void $classname$::CallMethod(const ::$proto_ns$::MethodDescriptor* " - "method,\n" - " ::$proto_ns$::RpcController* controller,\n" - " const ::$proto_ns$::Message* request,\n" - " ::$proto_ns$::Message* response,\n" - " ::google::protobuf::Closure* done) {\n" - " GOOGLE_DCHECK_EQ(method->service(), $file_level_service_descriptors$[$1$]);\n" - " switch(method->index()) {\n", - index_in_metadata_); - - for (int i = 0; i < descriptor_->method_count(); i++) { - const MethodDescriptor* method = descriptor_->method(i); - Formatter format_method(printer, vars_); - InitMethodVariables(method, options_, &format_method); - - // Note: down_cast does not work here because it only works on pointers, - // not references. - format_method( - " case $1$:\n" - " $name$(controller,\n" - " ::$proto_ns$::internal::DownCast(\n" - " request),\n" - " ::$proto_ns$::internal::DownCast<$output_type$*>(\n" - " response),\n" - " done);\n" - " break;\n", - i); - } - - format( - " default:\n" - " GOOGLE_LOG(FATAL) << \"Bad method index; this should never happen.\";\n" - " break;\n" - " }\n" - "}\n" - "\n"); -} - -void ServiceGenerator::GenerateGetPrototype(RequestOrResponse which, - io::Printer* printer) { - Formatter format(printer, vars_); - if (which == REQUEST) { - format("const ::$proto_ns$::Message& $classname$::GetRequestPrototype(\n"); - } else { - format("const ::$proto_ns$::Message& $classname$::GetResponsePrototype(\n"); - } - - format( - " const ::$proto_ns$::MethodDescriptor* method) const {\n" - " GOOGLE_DCHECK_EQ(method->service(), descriptor());\n" - " switch(method->index()) {\n"); - - for (int i = 0; i < descriptor_->method_count(); i++) { - const MethodDescriptor* method = descriptor_->method(i); - const Descriptor* type = - (which == REQUEST) ? method->input_type() : method->output_type(); - - format( - " case $1$:\n" - " return $2$::default_instance();\n", - i, QualifiedClassName(type, options_)); - } - - format( - " default:\n" - " GOOGLE_LOG(FATAL) << \"Bad method index; this should never happen.\";\n" - " return *::$proto_ns$::MessageFactory::generated_factory()\n" - " ->GetPrototype(method->$1$_type());\n" - " }\n" - "}\n" - "\n", - which == REQUEST ? "input" : "output"); -} - -void ServiceGenerator::GenerateStubMethods(io::Printer* printer) { - for (int i = 0; i < descriptor_->method_count(); i++) { - const MethodDescriptor* method = descriptor_->method(i); - Formatter format(printer, vars_); - InitMethodVariables(method, options_, &format); - format( - "void $classname$_Stub::$name$(::$proto_ns$::RpcController* " - "controller,\n" - " const $input_type$* request,\n" - " $output_type$* response,\n" - " ::google::protobuf::Closure* done) {\n" - " channel_->CallMethod(descriptor()->method($1$),\n" - " controller, request, response, done);\n" - "}\n", - i); - } -} - -} // namespace cpp -} // namespace compiler -} // namespace protobuf -} // namespace google diff --git a/extra/protobuf/protobuf-3.19.4/src/google/protobuf/compiler/cpp/cpp_service.h b/extra/protobuf/protobuf-3.19.4/src/google/protobuf/compiler/cpp/cpp_service.h deleted file mode 100644 index 63c7ca44f852..000000000000 --- a/extra/protobuf/protobuf-3.19.4/src/google/protobuf/compiler/cpp/cpp_service.h +++ /dev/null @@ -1,122 +0,0 @@ -// Protocol Buffers - Google's data interchange format -// Copyright 2008 Google Inc. All rights reserved. -// https://developers.google.com/protocol-buffers/ -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// * Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// * Redistributions in binary form must reproduce the above -// copyright notice, this list of conditions and the following disclaimer -// in the documentation and/or other materials provided with the -// distribution. -// * Neither the name of Google Inc. nor the names of its -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -// Author: kenton@google.com (Kenton Varda) -// Based on original Protocol Buffers design by -// Sanjay Ghemawat, Jeff Dean, and others. - -#ifndef GOOGLE_PROTOBUF_COMPILER_CPP_SERVICE_H__ -#define GOOGLE_PROTOBUF_COMPILER_CPP_SERVICE_H__ - -#include -#include -#include -#include - -namespace google { -namespace protobuf { -namespace io { -class Printer; // printer.h -} -} // namespace protobuf -} // namespace google - -namespace google { -namespace protobuf { -namespace compiler { -namespace cpp { - -class ServiceGenerator { - public: - // See generator.cc for the meaning of dllexport_decl. - explicit ServiceGenerator(const ServiceDescriptor* descriptor, - const std::map& vars, - const Options& options); - ~ServiceGenerator(); - - // Header stuff. - - // Generate the class definitions for the service's interface and the - // stub implementation. - void GenerateDeclarations(io::Printer* printer); - - // Source file stuff. - - // Generate implementations of everything declared by - // GenerateDeclarations(). - void GenerateImplementation(io::Printer* printer); - - private: - enum RequestOrResponse { REQUEST, RESPONSE }; - enum VirtualOrNon { VIRTUAL, NON_VIRTUAL }; - - // Header stuff. - - // Generate the service abstract interface. - void GenerateInterface(io::Printer* printer); - - // Generate the stub class definition. - void GenerateStubDefinition(io::Printer* printer); - - // Prints signatures for all methods in the - void GenerateMethodSignatures(VirtualOrNon virtual_or_non, - io::Printer* printer); - - // Source file stuff. - - // Generate the default implementations of the service methods, which - // produce a "not implemented" error. - void GenerateNotImplementedMethods(io::Printer* printer); - - // Generate the CallMethod() method of the service. - void GenerateCallMethod(io::Printer* printer); - - // Generate the Get{Request,Response}Prototype() methods. - void GenerateGetPrototype(RequestOrResponse which, io::Printer* printer); - - // Generate the stub's implementations of the service methods. - void GenerateStubMethods(io::Printer* printer); - - const ServiceDescriptor* descriptor_; - std::map vars_; - const Options& options_; - - int index_in_metadata_; - - friend class FileGenerator; - GOOGLE_DISALLOW_EVIL_CONSTRUCTORS(ServiceGenerator); -}; - -} // namespace cpp -} // namespace compiler -} // namespace protobuf -} // namespace google - -#endif // GOOGLE_PROTOBUF_COMPILER_CPP_SERVICE_H__ diff --git a/extra/protobuf/protobuf-3.19.4/src/google/protobuf/compiler/cpp/cpp_string_field.cc b/extra/protobuf/protobuf-3.19.4/src/google/protobuf/compiler/cpp/cpp_string_field.cc deleted file mode 100644 index 607e81500cc5..000000000000 --- a/extra/protobuf/protobuf-3.19.4/src/google/protobuf/compiler/cpp/cpp_string_field.cc +++ /dev/null @@ -1,915 +0,0 @@ -// Protocol Buffers - Google's data interchange format -// Copyright 2008 Google Inc. All rights reserved. -// https://developers.google.com/protocol-buffers/ -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// * Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// * Redistributions in binary form must reproduce the above -// copyright notice, this list of conditions and the following disclaimer -// in the documentation and/or other materials provided with the -// distribution. -// * Neither the name of Google Inc. nor the names of its -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -// Author: kenton@google.com (Kenton Varda) -// Based on original Protocol Buffers design by -// Sanjay Ghemawat, Jeff Dean, and others. - -#include -#include -#include -#include -#include - - -namespace google { -namespace protobuf { -namespace compiler { -namespace cpp { - -namespace { - -void SetStringVariables(const FieldDescriptor* descriptor, - std::map* variables, - const Options& options) { - SetCommonFieldVariables(descriptor, variables, options); - (*variables)["default"] = DefaultValue(options, descriptor); - (*variables)["default_length"] = - StrCat(descriptor->default_value_string().length()); - std::string default_variable_string = MakeDefaultName(descriptor); - (*variables)["default_variable_name"] = default_variable_string; - - if (!descriptor->default_value_string().empty()) { - (*variables)["lazy_variable"] = - QualifiedClassName(descriptor->containing_type(), options) + - "::" + default_variable_string; - } - - (*variables)["default_string"] = - descriptor->default_value_string().empty() - ? "::" + (*variables)["proto_ns"] + - "::internal::GetEmptyStringAlreadyInited()" - : (*variables)["lazy_variable"] + ".get()"; - (*variables)["init_value"] = - descriptor->default_value_string().empty() - ? "&::" + (*variables)["proto_ns"] + - "::internal::GetEmptyStringAlreadyInited()" - : "nullptr"; - (*variables)["default_value_tag"] = - "::" + (*variables)["proto_ns"] + "::internal::ArenaStringPtr::" + - (descriptor->default_value_string().empty() ? "Empty" : "NonEmpty") + - "Default{}"; - (*variables)["default_variable_or_tag"] = - (*variables)[descriptor->default_value_string().empty() - ? "default_value_tag" - : "lazy_variable"]; - (*variables)["pointer_type"] = - descriptor->type() == FieldDescriptor::TYPE_BYTES ? "void" : "char"; - (*variables)["setter"] = - descriptor->type() == FieldDescriptor::TYPE_BYTES ? "SetBytes" : "Set"; - (*variables)["null_check"] = (*variables)["DCHK"] + "(value != nullptr);\n"; - // NOTE: Escaped here to unblock proto1->proto2 migration. - // TODO(liujisi): Extend this to apply for other conflicting methods. - (*variables)["release_name"] = - SafeFunctionName(descriptor->containing_type(), descriptor, "release_"); - (*variables)["full_name"] = descriptor->full_name(); - - if (options.opensource_runtime) { - (*variables)["string_piece"] = "::std::string"; - } else { - (*variables)["string_piece"] = "::StringPiece"; - } -} - -} // namespace - -// =================================================================== - -StringFieldGenerator::StringFieldGenerator(const FieldDescriptor* descriptor, - const Options& options) - : FieldGenerator(descriptor, options), - inlined_(IsStringInlined(descriptor, options)) { - SetStringVariables(descriptor, &variables_, options); -} - -StringFieldGenerator::~StringFieldGenerator() {} - -void StringFieldGenerator::GeneratePrivateMembers(io::Printer* printer) const { - Formatter format(printer, variables_); - if (!inlined_) { - format("::$proto_ns$::internal::ArenaStringPtr $name$_;\n"); - } else { - // `_init_inline_xxx` is used for initializing default instances. - format( - "::$proto_ns$::internal::InlinedStringField $name$_;\n" - "static std::true_type _init_inline_$name$_;\n"); - } -} - -void StringFieldGenerator::GenerateStaticMembers(io::Printer* printer) const { - Formatter format(printer, variables_); - if (!descriptor_->default_value_string().empty()) { - format( - "static const ::$proto_ns$::internal::LazyString" - " $default_variable_name$;\n"); - } -} - -void StringFieldGenerator::GenerateAccessorDeclarations( - io::Printer* printer) const { - Formatter format(printer, variables_); - // If we're using StringFieldGenerator for a field with a ctype, it's - // because that ctype isn't actually implemented. In particular, this is - // true of ctype=CORD and ctype=STRING_PIECE in the open source release. - // We aren't releasing Cord because it has too many Google-specific - // dependencies and we aren't releasing StringPiece because it's hardly - // useful outside of Google and because it would get confusing to have - // multiple instances of the StringPiece class in different libraries (PCRE - // already includes it for their C++ bindings, which came from Google). - // - // In any case, we make all the accessors private while still actually - // using a string to represent the field internally. This way, we can - // guarantee that if we do ever implement the ctype, it won't break any - // existing users who might be -- for whatever reason -- already using .proto - // files that applied the ctype. The field can still be accessed via the - // reflection interface since the reflection interface is independent of - // the string's underlying representation. - - bool unknown_ctype = descriptor_->options().ctype() != - EffectiveStringCType(descriptor_, options_); - - if (unknown_ctype) { - format.Outdent(); - format( - " private:\n" - " // Hidden due to unknown ctype option.\n"); - format.Indent(); - } - - format( - "$deprecated_attr$const std::string& ${1$$name$$}$() const;\n" - "template \n" - "$deprecated_attr$void ${1$set_$name$$}$(ArgT0&& arg0, ArgT... args);\n", - descriptor_); - format( - "$deprecated_attr$std::string* ${1$mutable_$name$$}$();\n" - "PROTOBUF_NODISCARD $deprecated_attr$std::string* " - "${1$$release_name$$}$();\n" - "$deprecated_attr$void ${1$set_allocated_$name$$}$(std::string* " - "$name$);\n", - descriptor_); - format( - "private:\n" - "const std::string& _internal_$name$() const;\n" - "inline PROTOBUF_ALWAYS_INLINE void " - "_internal_set_$name$(const std::string& value);\n" - "std::string* _internal_mutable_$name$();\n"); - if (inlined_) { - format( - "inline PROTOBUF_ALWAYS_INLINE bool _internal_$name$_donated() " - "const;\n"); - } - format("public:\n"); - - if (unknown_ctype) { - format.Outdent(); - format(" public:\n"); - format.Indent(); - } -} - -void StringFieldGenerator::GenerateInlineAccessorDefinitions( - io::Printer* printer) const { - Formatter format(printer, variables_); - format( - "inline const std::string& $classname$::$name$() const {\n" - "$annotate_get$" - " // @@protoc_insertion_point(field_get:$full_name$)\n"); - if (!descriptor_->default_value_string().empty()) { - format( - " if ($name$_.IsDefault(nullptr)) return " - "$default_variable_name$.get();\n"); - } - format( - " return _internal_$name$();\n" - "}\n"); - if (!inlined_) { - format( - "template \n" - "inline PROTOBUF_ALWAYS_INLINE\n" - "void $classname$::set_$name$(ArgT0&& arg0, ArgT... args) {\n" - " $set_hasbit$\n" - " $name$_.$setter$($default_value_tag$, static_cast(arg0)," - " args..., GetArenaForAllocation());\n" - "$annotate_set$" - " // @@protoc_insertion_point(field_set:$full_name$)\n" - "}\n"); - } else { - format( - "template \n" - "inline PROTOBUF_ALWAYS_INLINE\n" - "void $classname$::set_$name$(ArgT0&& arg0, ArgT... args) {\n" - " $set_hasbit$\n" - " $name$_.$setter$(nullptr, static_cast(arg0)," - " args..., GetArenaForAllocation(), _internal_$name$_donated(), " - "&$donating_states_word$, $mask_for_undonate$);\n" - "$annotate_set$" - " // @@protoc_insertion_point(field_set:$full_name$)\n" - "}\n" - "inline bool $classname$::_internal_$name$_donated() const {\n" - " bool value = $inlined_string_donated$\n" - " return value;\n" - "}\n"); - } - format( - "inline std::string* $classname$::mutable_$name$() {\n" - " std::string* _s = _internal_mutable_$name$();\n" - "$annotate_mutable$" - " // @@protoc_insertion_point(field_mutable:$full_name$)\n" - " return _s;\n" - "}\n" - "inline const std::string& $classname$::_internal_$name$() const {\n" - " return $name$_.Get();\n" - "}\n" - "inline void $classname$::_internal_set_$name$(const std::string& " - "value) {\n" - " $set_hasbit$\n"); - if (!inlined_) { - format( - " $name$_.Set($default_value_tag$, value, GetArenaForAllocation());\n" - "}\n"); - } else { - format( - " $name$_.Set(nullptr, value, GetArenaForAllocation(),\n" - " _internal_$name$_donated(), &$donating_states_word$, " - "$mask_for_undonate$);\n" - "}\n"); - } - format( - "inline std::string* $classname$::_internal_mutable_$name$() {\n" - " $set_hasbit$\n"); - if (!inlined_) { - format( - " return $name$_.Mutable($default_variable_or_tag$, " - "GetArenaForAllocation());\n" - "}\n"); - } else { - format( - " return $name$_.Mutable($default_variable_or_tag$, " - "GetArenaForAllocation(), _internal_$name$_donated(), " - "&$donating_states_word$, $mask_for_undonate$);\n" - "}\n"); - } - format( - "inline std::string* $classname$::$release_name$() {\n" - "$annotate_release$" - " // @@protoc_insertion_point(field_release:$full_name$)\n"); - - if (HasHasbit(descriptor_)) { - format( - " if (!_internal_has_$name$()) {\n" - " return nullptr;\n" - " }\n" - " $clear_hasbit$\n"); - if (!inlined_) { - format( - " auto* p = $name$_.ReleaseNonDefault($init_value$, " - "GetArenaForAllocation());\n"); - if (descriptor_->default_value_string().empty()) { - format( - "#ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING\n" - " if ($name$_.IsDefault($init_value$)) {\n" - " $name$_.Set($init_value$, \"\", GetArenaForAllocation());\n" - " }\n" - "#endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING\n"); - } - format(" return p;\n"); - } else { - format( - " return $name$_.Release(nullptr, GetArenaForAllocation(), " - "_internal_$name$_donated());\n"); - } - } else { - format( - " return $name$_.Release($init_value$, GetArenaForAllocation());\n"); - } - - format( - "}\n" - "inline void $classname$::set_allocated_$name$(std::string* $name$) {\n" - " if ($name$ != nullptr) {\n" - " $set_hasbit$\n" - " } else {\n" - " $clear_hasbit$\n" - " }\n"); - if (!inlined_) { - format( - " $name$_.SetAllocated($init_value$, $name$,\n" - " GetArenaForAllocation());\n"); - if (descriptor_->default_value_string().empty()) { - format( - "#ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING\n" - " if ($name$_.IsDefault($init_value$)) {\n" - " $name$_.Set($init_value$, \"\", GetArenaForAllocation());\n" - " }\n" - "#endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING\n"); - } - } else { - // Currently, string fields with default value can't be inlined. - format( - " $name$_.SetAllocated(nullptr, $name$, GetArenaForAllocation(), " - "_internal_$name$_donated(), &$donating_states_word$, " - "$mask_for_undonate$);\n"); - } - format( - "$annotate_set$" - " // @@protoc_insertion_point(field_set_allocated:$full_name$)\n" - "}\n"); -} - -void StringFieldGenerator::GenerateNonInlineAccessorDefinitions( - io::Printer* printer) const { - Formatter format(printer, variables_); - if (!descriptor_->default_value_string().empty()) { - format( - "const ::$proto_ns$::internal::LazyString " - "$classname$::$default_variable_name$" - "{{{$default$, $default_length$}}, {nullptr}};\n"); - } -} - -void StringFieldGenerator::GenerateClearingCode(io::Printer* printer) const { - Formatter format(printer, variables_); - if (descriptor_->default_value_string().empty()) { - format("$name$_.ClearToEmpty();\n"); - } else { - GOOGLE_DCHECK(!inlined_); - format( - "$name$_.ClearToDefault($lazy_variable$, GetArenaForAllocation());\n"); - } -} - -void StringFieldGenerator::GenerateMessageClearingCode( - io::Printer* printer) const { - Formatter format(printer, variables_); - // Two-dimension specialization here: supporting arenas, field presence, or - // not, and default value is the empty string or not. Complexity here ensures - // the minimal number of branches / amount of extraneous code at runtime - // (given that the below methods are inlined one-liners)! - - // If we have a hasbit, then the Clear() method of the protocol buffer - // will have checked that this field is set. If so, we can avoid redundant - // checks against the default variable. - const bool must_be_present = HasHasbit(descriptor_); - - if (inlined_ && must_be_present) { - // Calling mutable_$name$() gives us a string reference and sets the has bit - // for $name$ (in proto2). We may get here when the string field is inlined - // but the string's contents have not been changed by the user, so we cannot - // make an assertion about the contents of the string and could never make - // an assertion about the string instance. - // - // For non-inlined strings, we distinguish from non-default by comparing - // instances, rather than contents. - format("$DCHK$(!$name$_.IsDefault(nullptr));\n"); - } - - if (descriptor_->default_value_string().empty()) { - if (must_be_present) { - format("$name$_.ClearNonDefaultToEmpty();\n"); - } else { - format("$name$_.ClearToEmpty();\n"); - } - } else { - // Clear to a non-empty default is more involved, as we try to use the - // Arena if one is present and may need to reallocate the string. - format( - "$name$_.ClearToDefault($lazy_variable$, GetArenaForAllocation());\n "); - } -} - -void StringFieldGenerator::GenerateMergingCode(io::Printer* printer) const { - Formatter format(printer, variables_); - // TODO(gpike): improve this - format("_internal_set_$name$(from._internal_$name$());\n"); -} - -void StringFieldGenerator::GenerateSwappingCode(io::Printer* printer) const { - Formatter format(printer, variables_); - if (!inlined_) { - format( - "::$proto_ns$::internal::ArenaStringPtr::InternalSwap(\n" - " $init_value$,\n" - " &$name$_, lhs_arena,\n" - " &other->$name$_, rhs_arena\n" - ");\n"); - } else { - // At this point, it's guaranteed that the two fields being swapped are on - // the same arena. - format( - "$name$_.Swap(&other->$name$_, nullptr, GetArenaForAllocation(), " - "_internal_$name$_donated(), other->_internal_$name$_donated(), " - "&$donating_states_word$, &(other->$donating_states_word$), " - "$mask_for_undonate$);\n"); - } -} - -void StringFieldGenerator::GenerateConstructorCode(io::Printer* printer) const { - Formatter format(printer, variables_); - if (inlined_ && descriptor_->default_value_string().empty()) { - // Automatic initialization will construct the string. - return; - } - GOOGLE_DCHECK(!inlined_); - format("$name$_.UnsafeSetDefault($init_value$);\n"); - if (IsString(descriptor_, options_) && - descriptor_->default_value_string().empty()) { - format( - "#ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING\n" - " $name$_.Set($init_value$, \"\", GetArenaForAllocation());\n" - "#endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING\n"); - } -} - -void StringFieldGenerator::GenerateCopyConstructorCode( - io::Printer* printer) const { - Formatter format(printer, variables_); - GenerateConstructorCode(printer); - - if (HasHasbit(descriptor_)) { - format("if (from._internal_has_$name$()) {\n"); - } else { - format("if (!from._internal_$name$().empty()) {\n"); - } - - format.Indent(); - - if (!inlined_) { - format( - "$name$_.Set($default_value_tag$, from._internal_$name$(), \n" - " GetArenaForAllocation());\n"); - } else { - format( - "$name$_.Set(nullptr, from._internal_$name$(),\n" - " GetArenaForAllocation(), _internal_$name$_donated(), " - "&$donating_states_word$, $mask_for_undonate$);\n"); - } - - format.Outdent(); - format("}\n"); -} - -void StringFieldGenerator::GenerateDestructorCode(io::Printer* printer) const { - Formatter format(printer, variables_); - if (inlined_) { - // The destructor is automatically invoked. - return; - } - - format("$name$_.DestroyNoArena($init_value$);\n"); -} - -void StringFieldGenerator::GenerateSerializeWithCachedSizesToArray( - io::Printer* printer) const { - Formatter format(printer, variables_); - if (descriptor_->type() == FieldDescriptor::TYPE_STRING) { - GenerateUtf8CheckCodeForString( - descriptor_, options_, false, - "this->_internal_$name$().data(), " - "static_cast(this->_internal_$name$().length()),\n", - format); - } - format( - "target = stream->Write$declared_type$MaybeAliased(\n" - " $number$, this->_internal_$name$(), target);\n"); -} - -void StringFieldGenerator::GenerateByteSize(io::Printer* printer) const { - Formatter format(printer, variables_); - format( - "total_size += $tag_size$ +\n" - " ::$proto_ns$::internal::WireFormatLite::$declared_type$Size(\n" - " this->_internal_$name$());\n"); -} - -void StringFieldGenerator::GenerateConstinitInitializer( - io::Printer* printer) const { - Formatter format(printer, variables_); - if (inlined_) { - format("$name$_(nullptr, false)"); - return; - } - if (descriptor_->default_value_string().empty()) { - format("$name$_(&::$proto_ns$::internal::fixed_address_empty_string)"); - } else { - format("$name$_(nullptr)"); - } -} - -// =================================================================== - -StringOneofFieldGenerator::StringOneofFieldGenerator( - const FieldDescriptor* descriptor, const Options& options) - : StringFieldGenerator(descriptor, options) { - SetCommonOneofFieldVariables(descriptor, &variables_); - variables_["field_name"] = UnderscoresToCamelCase(descriptor->name(), true); - variables_["oneof_index"] = - StrCat(descriptor->containing_oneof()->index()); -} - -StringOneofFieldGenerator::~StringOneofFieldGenerator() {} - -void StringOneofFieldGenerator::GenerateInlineAccessorDefinitions( - io::Printer* printer) const { - Formatter format(printer, variables_); - format( - "inline const std::string& $classname$::$name$() const {\n" - "$annotate_get$" - " // @@protoc_insertion_point(field_get:$full_name$)\n" - " return _internal_$name$();\n" - "}\n" - "template \n" - "inline void $classname$::set_$name$(ArgT0&& arg0, ArgT... args) {\n" - " if (!_internal_has_$name$()) {\n" - " clear_$oneof_name$();\n" - " set_has_$name$();\n" - " $field_member$.UnsafeSetDefault($init_value$);\n" - " }\n" - " $field_member$.$setter$($default_value_tag$," - " static_cast(arg0), args..., GetArenaForAllocation());\n" - "$annotate_set$" - " // @@protoc_insertion_point(field_set:$full_name$)\n" - "}\n" - "inline std::string* $classname$::mutable_$name$() {\n" - " std::string* _s = _internal_mutable_$name$();\n" - "$annotate_mutable$" - " // @@protoc_insertion_point(field_mutable:$full_name$)\n" - " return _s;\n" - "}\n" - "inline const std::string& $classname$::_internal_$name$() const {\n" - " if (_internal_has_$name$()) {\n" - " return $field_member$.Get();\n" - " }\n" - " return $default_string$;\n" - "}\n" - "inline void $classname$::_internal_set_$name$(const std::string& " - "value) {\n" - " if (!_internal_has_$name$()) {\n" - " clear_$oneof_name$();\n" - " set_has_$name$();\n" - " $field_member$.UnsafeSetDefault($init_value$);\n" - " }\n" - " $field_member$.Set($default_value_tag$, value, " - "GetArenaForAllocation());\n" - "}\n"); - format( - "inline std::string* $classname$::_internal_mutable_$name$() {\n" - " if (!_internal_has_$name$()) {\n" - " clear_$oneof_name$();\n" - " set_has_$name$();\n" - " $field_member$.UnsafeSetDefault($init_value$);\n" - " }\n" - " return $field_member$.Mutable(\n" - " $default_variable_or_tag$, GetArenaForAllocation());\n" - "}\n" - "inline std::string* $classname$::$release_name$() {\n" - "$annotate_release$" - " // @@protoc_insertion_point(field_release:$full_name$)\n" - " if (_internal_has_$name$()) {\n" - " clear_has_$oneof_name$();\n" - " return $field_member$.ReleaseNonDefault($init_value$, " - "GetArenaForAllocation());\n" - " } else {\n" - " return nullptr;\n" - " }\n" - "}\n" - "inline void $classname$::set_allocated_$name$(std::string* $name$) {\n" - " if (has_$oneof_name$()) {\n" - " clear_$oneof_name$();\n" - " }\n" - " if ($name$ != nullptr) {\n" - " set_has_$name$();\n" - " $field_member$.UnsafeSetDefault($name$);\n" - " ::$proto_ns$::Arena* arena = GetArenaForAllocation();\n" - " if (arena != nullptr) {\n" - " arena->Own($name$);\n" - " }\n" - " }\n" - "$annotate_set$" - " // @@protoc_insertion_point(field_set_allocated:$full_name$)\n" - "}\n"); -} - -void StringOneofFieldGenerator::GenerateClearingCode( - io::Printer* printer) const { - Formatter format(printer, variables_); - format( - "$field_member$.Destroy($default_value_tag$, " - "GetArenaForAllocation());\n"); -} - -void StringOneofFieldGenerator::GenerateMessageClearingCode( - io::Printer* printer) const { - return GenerateClearingCode(printer); -} - -void StringOneofFieldGenerator::GenerateSwappingCode( - io::Printer* printer) const { - // Don't print any swapping code. Swapping the union will swap this field. -} - -void StringOneofFieldGenerator::GenerateConstructorCode( - io::Printer* printer) const { - // Nothing required here. -} - -// =================================================================== - -RepeatedStringFieldGenerator::RepeatedStringFieldGenerator( - const FieldDescriptor* descriptor, const Options& options) - : FieldGenerator(descriptor, options) { - SetStringVariables(descriptor, &variables_, options); -} - -RepeatedStringFieldGenerator::~RepeatedStringFieldGenerator() {} - -void RepeatedStringFieldGenerator::GeneratePrivateMembers( - io::Printer* printer) const { - Formatter format(printer, variables_); - format("::$proto_ns$::RepeatedPtrField $name$_;\n"); -} - -void RepeatedStringFieldGenerator::GenerateAccessorDeclarations( - io::Printer* printer) const { - Formatter format(printer, variables_); - // See comment above about unknown ctypes. - bool unknown_ctype = descriptor_->options().ctype() != - EffectiveStringCType(descriptor_, options_); - - if (unknown_ctype) { - format.Outdent(); - format( - " private:\n" - " // Hidden due to unknown ctype option.\n"); - format.Indent(); - } - - format( - "$deprecated_attr$const std::string& ${1$$name$$}$(int index) const;\n" - "$deprecated_attr$std::string* ${1$mutable_$name$$}$(int index);\n" - "$deprecated_attr$void ${1$set_$name$$}$(int index, const " - "std::string& value);\n" - "$deprecated_attr$void ${1$set_$name$$}$(int index, std::string&& " - "value);\n" - "$deprecated_attr$void ${1$set_$name$$}$(int index, const " - "char* value);\n", - descriptor_); - if (!options_.opensource_runtime) { - format( - "$deprecated_attr$void ${1$set_$name$$}$(int index, " - "StringPiece value);\n", - descriptor_); - } - format( - "$deprecated_attr$void ${1$set_$name$$}$(" - "int index, const $pointer_type$* value, size_t size);\n" - "$deprecated_attr$std::string* ${1$add_$name$$}$();\n" - "$deprecated_attr$void ${1$add_$name$$}$(const std::string& value);\n" - "$deprecated_attr$void ${1$add_$name$$}$(std::string&& value);\n" - "$deprecated_attr$void ${1$add_$name$$}$(const char* value);\n", - descriptor_); - if (!options_.opensource_runtime) { - format( - "$deprecated_attr$void ${1$add_$name$$}$(StringPiece value);\n", - descriptor_); - } - format( - "$deprecated_attr$void ${1$add_$name$$}$(const $pointer_type$* " - "value, size_t size)" - ";\n" - "$deprecated_attr$const ::$proto_ns$::RepeatedPtrField& " - "${1$$name$$}$() " - "const;\n" - "$deprecated_attr$::$proto_ns$::RepeatedPtrField* " - "${1$mutable_$name$$}$()" - ";\n" - "private:\n" - "const std::string& ${1$_internal_$name$$}$(int index) const;\n" - "std::string* _internal_add_$name$();\n" - "public:\n", - descriptor_); - - if (unknown_ctype) { - format.Outdent(); - format(" public:\n"); - format.Indent(); - } -} - -void RepeatedStringFieldGenerator::GenerateInlineAccessorDefinitions( - io::Printer* printer) const { - Formatter format(printer, variables_); - format( - "inline std::string* $classname$::add_$name$() {\n" - " std::string* _s = _internal_add_$name$();\n" - "$annotate_add_mutable$" - " // @@protoc_insertion_point(field_add_mutable:$full_name$)\n" - " return _s;\n" - "}\n"); - if (options_.safe_boundary_check) { - format( - "inline const std::string& $classname$::_internal_$name$(int index) " - "const {\n" - " return $name$_.InternalCheckedGet(\n" - " index, ::$proto_ns$::internal::GetEmptyStringAlreadyInited());\n" - "}\n"); - } else { - format( - "inline const std::string& $classname$::_internal_$name$(int index) " - "const {\n" - " return $name$_.Get(index);\n" - "}\n"); - } - format( - "inline const std::string& $classname$::$name$(int index) const {\n" - "$annotate_get$" - " // @@protoc_insertion_point(field_get:$full_name$)\n" - " return _internal_$name$(index);\n" - "}\n" - "inline std::string* $classname$::mutable_$name$(int index) {\n" - "$annotate_mutable$" - " // @@protoc_insertion_point(field_mutable:$full_name$)\n" - " return $name$_.Mutable(index);\n" - "}\n" - "inline void $classname$::set_$name$(int index, const std::string& " - "value) " - "{\n" - " $name$_.Mutable(index)->assign(value);\n" - "$annotate_set$" - " // @@protoc_insertion_point(field_set:$full_name$)\n" - "}\n" - "inline void $classname$::set_$name$(int index, std::string&& value) {\n" - " $name$_.Mutable(index)->assign(std::move(value));\n" - "$annotate_set$" - " // @@protoc_insertion_point(field_set:$full_name$)\n" - "}\n" - "inline void $classname$::set_$name$(int index, const char* value) {\n" - " $null_check$" - " $name$_.Mutable(index)->assign(value);\n" - "$annotate_set$" - " // @@protoc_insertion_point(field_set_char:$full_name$)\n" - "}\n"); - if (!options_.opensource_runtime) { - format( - "inline void " - "$classname$::set_$name$(int index, StringPiece value) {\n" - " $name$_.Mutable(index)->assign(value.data(), value.size());\n" - "$annotate_set$" - " // @@protoc_insertion_point(field_set_string_piece:$full_name$)\n" - "}\n"); - } - format( - "inline void " - "$classname$::set_$name$" - "(int index, const $pointer_type$* value, size_t size) {\n" - " $name$_.Mutable(index)->assign(\n" - " reinterpret_cast(value), size);\n" - "$annotate_set$" - " // @@protoc_insertion_point(field_set_pointer:$full_name$)\n" - "}\n" - "inline std::string* $classname$::_internal_add_$name$() {\n" - " return $name$_.Add();\n" - "}\n" - "inline void $classname$::add_$name$(const std::string& value) {\n" - " $name$_.Add()->assign(value);\n" - "$annotate_add$" - " // @@protoc_insertion_point(field_add:$full_name$)\n" - "}\n" - "inline void $classname$::add_$name$(std::string&& value) {\n" - " $name$_.Add(std::move(value));\n" - "$annotate_add$" - " // @@protoc_insertion_point(field_add:$full_name$)\n" - "}\n" - "inline void $classname$::add_$name$(const char* value) {\n" - " $null_check$" - " $name$_.Add()->assign(value);\n" - "$annotate_add$" - " // @@protoc_insertion_point(field_add_char:$full_name$)\n" - "}\n"); - if (!options_.opensource_runtime) { - format( - "inline void $classname$::add_$name$(StringPiece value) {\n" - " $name$_.Add()->assign(value.data(), value.size());\n" - "$annotate_add$" - " // @@protoc_insertion_point(field_add_string_piece:$full_name$)\n" - "}\n"); - } - format( - "inline void " - "$classname$::add_$name$(const $pointer_type$* value, size_t size) {\n" - " $name$_.Add()->assign(reinterpret_cast(value), size);\n" - "$annotate_add$" - " // @@protoc_insertion_point(field_add_pointer:$full_name$)\n" - "}\n" - "inline const ::$proto_ns$::RepeatedPtrField&\n" - "$classname$::$name$() const {\n" - "$annotate_list$" - " // @@protoc_insertion_point(field_list:$full_name$)\n" - " return $name$_;\n" - "}\n" - "inline ::$proto_ns$::RepeatedPtrField*\n" - "$classname$::mutable_$name$() {\n" - "$annotate_mutable_list$" - " // @@protoc_insertion_point(field_mutable_list:$full_name$)\n" - " return &$name$_;\n" - "}\n"); -} - -void RepeatedStringFieldGenerator::GenerateClearingCode( - io::Printer* printer) const { - Formatter format(printer, variables_); - format("$name$_.Clear();\n"); -} - -void RepeatedStringFieldGenerator::GenerateMergingCode( - io::Printer* printer) const { - Formatter format(printer, variables_); - format("$name$_.MergeFrom(from.$name$_);\n"); -} - -void RepeatedStringFieldGenerator::GenerateSwappingCode( - io::Printer* printer) const { - Formatter format(printer, variables_); - format("$name$_.InternalSwap(&other->$name$_);\n"); -} - -void RepeatedStringFieldGenerator::GenerateConstructorCode( - io::Printer* printer) const { - // Not needed for repeated fields. -} - -void RepeatedStringFieldGenerator::GenerateCopyConstructorCode( - io::Printer* printer) const { - Formatter format(printer, variables_); - format("$name$_.CopyFrom(from.$name$_);"); -} - -void RepeatedStringFieldGenerator::GenerateSerializeWithCachedSizesToArray( - io::Printer* printer) const { - Formatter format(printer, variables_); - format( - "for (int i = 0, n = this->_internal_$name$_size(); i < n; i++) {\n" - " const auto& s = this->_internal_$name$(i);\n"); - // format("for (const std::string& s : this->$name$()) {\n"); - format.Indent(); - if (descriptor_->type() == FieldDescriptor::TYPE_STRING) { - GenerateUtf8CheckCodeForString(descriptor_, options_, false, - "s.data(), static_cast(s.length()),\n", - format); - } - format.Outdent(); - format( - " target = stream->Write$declared_type$($number$, s, target);\n" - "}\n"); -} - -void RepeatedStringFieldGenerator::GenerateByteSize( - io::Printer* printer) const { - Formatter format(printer, variables_); - format( - "total_size += $tag_size$ *\n" - " ::$proto_ns$::internal::FromIntSize($name$_.size());\n" - "for (int i = 0, n = $name$_.size(); i < n; i++) {\n" - " total_size += " - "::$proto_ns$::internal::WireFormatLite::$declared_type$Size(\n" - " $name$_.Get(i));\n" - "}\n"); -} - -void RepeatedStringFieldGenerator::GenerateConstinitInitializer( - io::Printer* printer) const { - Formatter format(printer, variables_); - format("$name$_()"); -} - -} // namespace cpp -} // namespace compiler -} // namespace protobuf -} // namespace google diff --git a/extra/protobuf/protobuf-3.19.4/src/google/protobuf/compiler/cpp/cpp_string_field.h b/extra/protobuf/protobuf-3.19.4/src/google/protobuf/compiler/cpp/cpp_string_field.h deleted file mode 100644 index 3f05443f5828..000000000000 --- a/extra/protobuf/protobuf-3.19.4/src/google/protobuf/compiler/cpp/cpp_string_field.h +++ /dev/null @@ -1,127 +0,0 @@ -// Protocol Buffers - Google's data interchange format -// Copyright 2008 Google Inc. All rights reserved. -// https://developers.google.com/protocol-buffers/ -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// * Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// * Redistributions in binary form must reproduce the above -// copyright notice, this list of conditions and the following disclaimer -// in the documentation and/or other materials provided with the -// distribution. -// * Neither the name of Google Inc. nor the names of its -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -// Author: kenton@google.com (Kenton Varda) -// Based on original Protocol Buffers design by -// Sanjay Ghemawat, Jeff Dean, and others. - -#ifndef GOOGLE_PROTOBUF_COMPILER_CPP_STRING_FIELD_H__ -#define GOOGLE_PROTOBUF_COMPILER_CPP_STRING_FIELD_H__ - -#include -#include -#include - -namespace google { -namespace protobuf { -namespace compiler { -namespace cpp { - -class StringFieldGenerator : public FieldGenerator { - public: - StringFieldGenerator(const FieldDescriptor* descriptor, - const Options& options); - ~StringFieldGenerator(); - - // implements FieldGenerator --------------------------------------- - void GeneratePrivateMembers(io::Printer* printer) const override; - void GenerateStaticMembers(io::Printer* printer) const override; - void GenerateAccessorDeclarations(io::Printer* printer) const override; - void GenerateInlineAccessorDefinitions(io::Printer* printer) const override; - void GenerateNonInlineAccessorDefinitions( - io::Printer* printer) const override; - void GenerateClearingCode(io::Printer* printer) const override; - void GenerateMessageClearingCode(io::Printer* printer) const override; - void GenerateMergingCode(io::Printer* printer) const override; - void GenerateSwappingCode(io::Printer* printer) const override; - void GenerateConstructorCode(io::Printer* printer) const override; - void GenerateCopyConstructorCode(io::Printer* printer) const override; - void GenerateDestructorCode(io::Printer* printer) const override; - void GenerateSerializeWithCachedSizesToArray( - io::Printer* printer) const override; - void GenerateByteSize(io::Printer* printer) const override; - void GenerateConstinitInitializer(io::Printer* printer) const override; - bool IsInlined() const override { return inlined_; } - - private: - bool inlined_; - GOOGLE_DISALLOW_EVIL_CONSTRUCTORS(StringFieldGenerator); -}; - -class StringOneofFieldGenerator : public StringFieldGenerator { - public: - StringOneofFieldGenerator(const FieldDescriptor* descriptor, - const Options& options); - ~StringOneofFieldGenerator(); - - // implements FieldGenerator --------------------------------------- - void GenerateInlineAccessorDefinitions(io::Printer* printer) const override; - void GenerateClearingCode(io::Printer* printer) const override; - - // StringFieldGenerator, from which we inherit, overrides this so we need to - // override it as well. - void GenerateMessageClearingCode(io::Printer* printer) const override; - void GenerateSwappingCode(io::Printer* printer) const override; - void GenerateConstructorCode(io::Printer* printer) const override; - - private: - GOOGLE_DISALLOW_EVIL_CONSTRUCTORS(StringOneofFieldGenerator); -}; - -class RepeatedStringFieldGenerator : public FieldGenerator { - public: - RepeatedStringFieldGenerator(const FieldDescriptor* descriptor, - const Options& options); - ~RepeatedStringFieldGenerator(); - - // implements FieldGenerator --------------------------------------- - void GeneratePrivateMembers(io::Printer* printer) const override; - void GenerateAccessorDeclarations(io::Printer* printer) const override; - void GenerateInlineAccessorDefinitions(io::Printer* printer) const override; - void GenerateClearingCode(io::Printer* printer) const override; - void GenerateMergingCode(io::Printer* printer) const override; - void GenerateSwappingCode(io::Printer* printer) const override; - void GenerateConstructorCode(io::Printer* printer) const override; - void GenerateCopyConstructorCode(io::Printer* printer) const override; - void GenerateSerializeWithCachedSizesToArray( - io::Printer* printer) const override; - void GenerateByteSize(io::Printer* printer) const override; - void GenerateConstinitInitializer(io::Printer* printer) const override; - - private: - GOOGLE_DISALLOW_EVIL_CONSTRUCTORS(RepeatedStringFieldGenerator); -}; - -} // namespace cpp -} // namespace compiler -} // namespace protobuf -} // namespace google - -#endif // GOOGLE_PROTOBUF_COMPILER_CPP_STRING_FIELD_H__ diff --git a/extra/protobuf/protobuf-3.19.4/src/google/protobuf/compiler/cpp/cpp_test_bad_identifiers.proto b/extra/protobuf/protobuf-3.19.4/src/google/protobuf/compiler/cpp/cpp_test_bad_identifiers.proto deleted file mode 100644 index 466a84194af0..000000000000 --- a/extra/protobuf/protobuf-3.19.4/src/google/protobuf/compiler/cpp/cpp_test_bad_identifiers.proto +++ /dev/null @@ -1,184 +0,0 @@ -// Protocol Buffers - Google's data interchange format -// Copyright 2008 Google Inc. All rights reserved. -// https://developers.google.com/protocol-buffers/ -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// * Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// * Redistributions in binary form must reproduce the above -// copyright notice, this list of conditions and the following disclaimer -// in the documentation and/or other materials provided with the -// distribution. -// * Neither the name of Google Inc. nor the names of its -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -// Author: kenton@google.com (Kenton Varda) -// Based on original Protocol Buffers design by -// Sanjay Ghemawat, Jeff Dean, and others. -// -// This file tests that various identifiers work as field and type names even -// though the same identifiers are used internally by the C++ code generator. - -// LINT: LEGACY_NAMES - -syntax = "proto2"; - -// Some generic_services option(s) added automatically. -// See: http://go/proto2-generic-services-default -option cc_generic_services = true; // auto-added - -// We don't put this in a package within proto2 because we need to make sure -// that the generated code doesn't depend on being in the proto2 namespace. -package protobuf_unittest; - -// Test that fields can have names like "input" and "i" which are also used -// internally by the code generator for local variables. -message TestConflictingSymbolNames { - message BuildDescriptors {} - message TypeTraits {} - - optional int32 input = 1; - optional int32 output = 2; - optional string length = 3; - repeated int32 i = 4; - repeated string new_element = 5 [ctype = STRING_PIECE]; - optional int32 total_size = 6; - optional int32 tag = 7; - - enum TestEnum { FOO = 0; } - message Data1 { - repeated int32 data = 1; - } - message Data2 { - repeated TestEnum data = 1; - } - message Data3 { - repeated string data = 1; - } - message Data4 { - repeated Data4 data = 1; - } - message Data5 { - repeated string data = 1 [ctype = STRING_PIECE]; - } - message Data6 { - repeated string data = 1 [ctype = CORD]; - } - - optional int32 source = 8; - optional int32 value = 9; - optional int32 file = 10; - optional int32 from = 11; - optional int32 handle_uninterpreted = 12; - repeated int32 index = 13; - optional int32 controller = 14; - optional int32 already_here = 15; - - optional uint32 uint32 = 16; - optional uint64 uint64 = 17; - optional string string = 18; - optional int32 memset = 19; - optional int32 int32 = 20; - optional int64 int64 = 21; - - optional uint32 cached_size = 22; - optional uint32 extensions = 23; - optional uint32 bit = 24; - optional uint32 bits = 25; - optional uint32 offsets = 26; - optional uint32 reflection = 27; - - message Cord {} - optional string some_cord = 28 [ctype = CORD]; - - message StringPiece {} - optional string some_string_piece = 29 [ctype = STRING_PIECE]; - - // Some keywords. - optional uint32 int = 30; - optional uint32 friend = 31; - optional uint32 class = 37; - optional uint32 typedecl = 39; - optional uint32 auto = 40; - - // The generator used to #define a macro called "DO" inside the .cc file. - message DO {} - optional DO do = 32; - - // Some template parameter names for extensions. - optional int32 field_type = 33; - optional bool is_packed = 34; - - // test conflicting release_$name$. "length" and "do" field in this message - // must remain string or message fields to make the test valid. - optional string release_length = 35; - // A more extreme case, the field name "do" here is a keyword, which will be - // escaped to "do_" already. Test there is no conflict even with escaped field - // names. - optional DO release_do = 36; - - // For clashing local variables in Serialize and ByteSize calculation. - optional string target = 38; - - extensions 1000 to max; // NO_PROTO3 -} - -message TestConflictingSymbolNamesExtension { // NO_PROTO3 - extend TestConflictingSymbolNames { // NO_PROTO3 - repeated int32 repeated_int32_ext = 20423638 [packed = true]; // NO_PROTO3 - } // NO_PROTO3 -} // NO_PROTO3 - -message TestConflictingEnumNames { // NO_PROTO3 - enum while { // NO_PROTO3 - default = 0; // NO_PROTO3 - and = 1; // NO_PROTO3 - class = 2; // NO_PROTO3 - int = 3; // NO_PROTO3 - typedef = 4; // NO_PROTO3 - XOR = 5; // NO_PROTO3 - } // NO_PROTO3 - - optional while conflicting_enum = 1; // NO_PROTO3 -} // NO_PROTO3 - -enum bool { // NO_PROTO3 - default = 0; // NO_PROTO3 - NOT_EQ = 1; // NO_PROTO3 - volatile = 2; // NO_PROTO3 - return = 3; // NO_PROTO3 -} // NO_PROTO3 - -message DummyMessage {} - -message NULL { - optional int32 int = 1; -} - -extend TestConflictingSymbolNames { // NO_PROTO3 - optional int32 void = 314253; // NO_PROTO3 -} // NO_PROTO3 - -// Message names that could conflict. -message Shutdown {} -message TableStruct {} - -service TestConflictingMethodNames { - rpc Closure(DummyMessage) returns (DummyMessage); -} diff --git a/extra/protobuf/protobuf-3.19.4/src/google/protobuf/compiler/cpp/cpp_test_large_enum_value.proto b/extra/protobuf/protobuf-3.19.4/src/google/protobuf/compiler/cpp/cpp_test_large_enum_value.proto deleted file mode 100644 index cb6ca1b1512b..000000000000 --- a/extra/protobuf/protobuf-3.19.4/src/google/protobuf/compiler/cpp/cpp_test_large_enum_value.proto +++ /dev/null @@ -1,43 +0,0 @@ -// Protocol Buffers - Google's data interchange format -// Copyright 2008 Google Inc. All rights reserved. -// https://developers.google.com/protocol-buffers/ -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// * Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// * Redistributions in binary form must reproduce the above -// copyright notice, this list of conditions and the following disclaimer -// in the documentation and/or other materials provided with the -// distribution. -// * Neither the name of Google Inc. nor the names of its -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -// Test that proto2 compiler can generate valid code when the enum value -// is INT_MAX. Note that this is a compile-only test and this proto is not -// referenced in any C++ code. -syntax = "proto2"; - -package protobuf_unittest; - -message TestLargeEnumValue { - enum EnumWithLargeValue { - VALUE_1 = 1; - VALUE_MAX = 0x7fffffff; - } -} diff --git a/extra/protobuf/protobuf-3.19.4/src/google/protobuf/compiler/cpp/cpp_unittest.cc b/extra/protobuf/protobuf-3.19.4/src/google/protobuf/compiler/cpp/cpp_unittest.cc deleted file mode 100644 index 74310a7fd720..000000000000 --- a/extra/protobuf/protobuf-3.19.4/src/google/protobuf/compiler/cpp/cpp_unittest.cc +++ /dev/null @@ -1,134 +0,0 @@ -// Protocol Buffers - Google's data interchange format -// Copyright 2008 Google Inc. All rights reserved. -// https://developers.google.com/protocol-buffers/ -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// * Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// * Redistributions in binary form must reproduce the above -// copyright notice, this list of conditions and the following disclaimer -// in the documentation and/or other materials provided with the -// distribution. -// * Neither the name of Google Inc. nor the names of its -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -// Author: kenton@google.com (Kenton Varda) -// Based on original Protocol Buffers design by -// Sanjay Ghemawat, Jeff Dean, and others. -// -// To test the code generator, we actually use it to generate code for -// net/proto2/internal/unittest.proto, then test that. This means that we -// are actually testing the parser and other parts of the system at the same -// time, and that problems in the generator may show up as compile-time errors -// rather than unittest failures, which may be surprising. However, testing -// the output of the C++ generator directly would be very hard. We can't very -// well just check it against golden files since those files would have to be -// updated for any small change; such a test would be very brittle and probably -// not very helpful. What we really want to test is that the code compiles -// correctly and produces the interfaces we expect, which is why this test -// is written this way. - -#include - -#include -#include -#include - -#include - -#define MESSAGE_TEST_NAME MessageTest -#define GENERATED_DESCRIPTOR_TEST_NAME GeneratedDescriptorTest -#define GENERATED_MESSAGE_TEST_NAME GeneratedMessageTest -#define GENERATED_ENUM_TEST_NAME GeneratedEnumTest -#define GENERATED_SERVICE_TEST_NAME GeneratedServiceTest -#define HELPERS_TEST_NAME HelpersTest -#define DESCRIPTOR_INIT_TEST_NAME DescriptorInitializationTest - -#define UNITTEST_PROTO_PATH "net/proto2/internal/unittest.proto" -#define UNITTEST ::protobuf_unittest -#define UNITTEST_IMPORT ::protobuf_unittest_import - -// Must include after the above macros. -#include - -namespace google { -namespace protobuf { -namespace compiler { -namespace cpp { - -// Can't use an anonymous namespace here due to brokenness of Tru64 compiler. -namespace cpp_unittest { - -namespace protobuf_unittest = ::protobuf_unittest; - -TEST(GENERATED_MESSAGE_TEST_NAME, TestConflictingSymbolNames) { - // test_bad_identifiers.proto successfully compiled, then it works. The - // following is just a token usage to insure that the code is, in fact, - // being compiled and linked. - - protobuf_unittest::TestConflictingSymbolNames message; - message.set_uint32(1); - EXPECT_EQ(3, message.ByteSizeLong()); - - message.set_friend_(5); - EXPECT_EQ(5, message.friend_()); - - message.set_class_(6); - EXPECT_EQ(6, message.class_()); - - // Instantiate extension template functions to test conflicting template - // parameter names. - typedef protobuf_unittest::TestConflictingSymbolNamesExtension ExtensionMessage; - message.AddExtension(ExtensionMessage::repeated_int32_ext, 123); - EXPECT_EQ(123, message.GetExtension(ExtensionMessage::repeated_int32_ext, 0)); -} - -TEST(GENERATED_MESSAGE_TEST_NAME, TestConflictingEnumNames) { - protobuf_unittest::TestConflictingEnumNames message; - message.set_conflicting_enum( - protobuf_unittest::TestConflictingEnumNames_while_and_); - EXPECT_EQ(1, message.conflicting_enum()); - message.set_conflicting_enum( - protobuf_unittest::TestConflictingEnumNames_while_XOR); - EXPECT_EQ(5, message.conflicting_enum()); - - protobuf_unittest::bool_ conflicting_enum; - conflicting_enum = protobuf_unittest::NOT_EQ; - EXPECT_EQ(1, conflicting_enum); - conflicting_enum = protobuf_unittest::return_; - EXPECT_EQ(3, conflicting_enum); -} - -TEST(GENERATED_MESSAGE_TEST_NAME, TestConflictingMessageNames) { - protobuf_unittest::NULL_ message; - message.set_int_(123); - EXPECT_EQ(message.int_(), 123); -} - -TEST(GENERATED_MESSAGE_TEST_NAME, TestConflictingExtension) { - protobuf_unittest::TestConflictingSymbolNames message; - message.SetExtension(protobuf_unittest::void_, 123); - EXPECT_EQ(123, message.GetExtension(protobuf_unittest::void_)); -} - -} // namespace cpp_unittest -} // namespace cpp -} // namespace compiler -} // namespace protobuf -} // namespace google diff --git a/extra/protobuf/protobuf-3.19.4/src/google/protobuf/compiler/cpp/cpp_unittest.h b/extra/protobuf/protobuf-3.19.4/src/google/protobuf/compiler/cpp/cpp_unittest.h deleted file mode 100644 index c5dc767ae5d2..000000000000 --- a/extra/protobuf/protobuf-3.19.4/src/google/protobuf/compiler/cpp/cpp_unittest.h +++ /dev/null @@ -1,51 +0,0 @@ -// Protocol Buffers - Google's data interchange format -// Copyright 2008 Google Inc. All rights reserved. -// https://developers.google.com/protocol-buffers/ -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// * Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// * Redistributions in binary form must reproduce the above -// copyright notice, this list of conditions and the following disclaimer -// in the documentation and/or other materials provided with the -// distribution. -// * Neither the name of Google Inc. nor the names of its -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -// This header declares the namespace google::protobuf::protobuf_unittest in order to expose -// any problems with the generated class names. We use this header to ensure -// unittest.cc will declare the namespace prior to other includes, while obeying -// normal include ordering. -// -// When generating a class name of "foo.Bar" we must ensure we prefix the class -// name with "::", in case the namespace google::protobuf::foo exists. We intentionally -// trigger that case here by declaring google::protobuf::protobuf_unittest. -// -// See ClassName in helpers.h for more details. - -#ifndef GOOGLE_PROTOBUF_COMPILER_CPP_UNITTEST_H__ -#define GOOGLE_PROTOBUF_COMPILER_CPP_UNITTEST_H__ - -namespace google { -namespace protobuf { -namespace protobuf_unittest {} -} // namespace protobuf -} // namespace google - -#endif // GOOGLE_PROTOBUF_COMPILER_CPP_UNITTEST_H__ diff --git a/extra/protobuf/protobuf-3.19.4/src/google/protobuf/compiler/cpp/cpp_unittest.inc b/extra/protobuf/protobuf-3.19.4/src/google/protobuf/compiler/cpp/cpp_unittest.inc deleted file mode 100644 index 782d2263beb5..000000000000 --- a/extra/protobuf/protobuf-3.19.4/src/google/protobuf/compiler/cpp/cpp_unittest.inc +++ /dev/null @@ -1,2234 +0,0 @@ -// Protocol Buffers - Google's data interchange format -// Copyright 2008 Google Inc. All rights reserved. -// https://developers.google.com/protocol-buffers/ -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// * Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// * Redistributions in binary form must reproduce the above -// copyright notice, this list of conditions and the following disclaimer -// in the documentation and/or other materials provided with the -// distribution. -// * Neither the name of Google Inc. nor the names of its -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -// Author: kenton@google.com (Kenton Varda) -// Based on original Protocol Buffers design by -// Sanjay Ghemawat, Jeff Dean, and others. -// -// To test the code generator, we actually use it to generate code for -// net/proto2/internal/unittest.proto, then test that. This means that we -// are actually testing the parser and other parts of the system at the same -// time, and that problems in the generator may show up as compile-time errors -// rather than unittest failures, which may be surprising. However, testing -// the output of the C++ generator directly would be very hard. We can't very -// well just check it against golden files since those files would have to be -// updated for any small change; such a test would be very brittle and probably -// not very helpful. What we really want to test is that the code compiles -// correctly and produces the interfaces we expect, which is why this test -// is written this way. - -#include -#include -#include -#include - -#include -#include -#if !defined(GOOGLE_PROTOBUF_CMAKE_BUILD) && !defined(_MSC_VER) -// We exclude this large proto from cmake build because it's too large for -// visual studio to compile (report internal errors). -#include -#endif -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#include -#include -#include -#include -#include -#include -#include -#include - -// Must be included last. -#include - -namespace google { -namespace protobuf { -namespace compiler { -namespace cpp { - -// Can't use an anonymous namespace here due to brokenness of Tru64 compiler. -namespace cpp_unittest { - - -void DoNothing() {} - -class MockErrorCollector : public MultiFileErrorCollector { - public: - MockErrorCollector() {} - ~MockErrorCollector() {} - - std::string text_; - - // implements ErrorCollector --------------------------------------- - void AddError(const std::string& filename, int line, int column, - const std::string& message) override { - strings::SubstituteAndAppend(&text_, "$0:$1:$2: $3\n", filename, line, column, - message); - } -}; - -#ifndef PROTOBUF_TEST_NO_DESCRIPTORS - -// Test that generated code has proper descriptors: -// Parse a descriptor directly (using google::protobuf::compiler::Importer) and -// compare it to the one that was produced by generated code. -TEST(GENERATED_DESCRIPTOR_TEST_NAME, IdenticalDescriptors) { - const FileDescriptor* generated_descriptor = - UNITTEST::TestAllTypes::descriptor()->file(); - - // Set up the Importer. - MockErrorCollector error_collector; - DiskSourceTree source_tree; - source_tree.MapPath("", TestUtil::TestSourceDir()); - Importer importer(&source_tree, &error_collector); - - // Import (parse) unittest.proto. - const FileDescriptor* parsed_descriptor = - importer.Import(TestUtil::MaybeTranslatePath(UNITTEST_PROTO_PATH)); - EXPECT_EQ("", error_collector.text_); - ASSERT_TRUE(parsed_descriptor != NULL); - - // Test that descriptors are generated correctly by converting them to - // FileDescriptorProtos and comparing. - FileDescriptorProto generated_descriptor_proto, parsed_descriptor_proto; - generated_descriptor->CopyTo(&generated_descriptor_proto); - parsed_descriptor->CopyTo(&parsed_descriptor_proto); - - EXPECT_EQ(parsed_descriptor_proto.DebugString(), - generated_descriptor_proto.DebugString()); -} - -#if !defined(GOOGLE_PROTOBUF_CMAKE_BUILD) && !defined(_MSC_VER) -// Test that generated code has proper descriptors: -// Touch a descriptor generated from an enormous message to validate special -// handling for descriptors exceeding the C++ standard's recommended minimum -// limit for string literal size -TEST(GENERATED_DESCRIPTOR_TEST_NAME, EnormousDescriptor) { - const Descriptor* generated_descriptor = - ::protobuf_unittest::TestEnormousDescriptor::descriptor(); - - EXPECT_TRUE(generated_descriptor != NULL); -} -#endif - -#endif // !PROTOBUF_TEST_NO_DESCRIPTORS - -// =================================================================== - -TEST(GENERATED_MESSAGE_TEST_NAME, Defaults) { - // Check that all default values are set correctly in the initial message. - UNITTEST::TestAllTypes message; - - TestUtil::ExpectClear(message); - - // Messages should return pointers to default instances until first use. - // (This is not checked by ExpectClear() since it is not actually true after - // the fields have been set and then cleared.) - EXPECT_EQ(&UNITTEST::TestAllTypes::OptionalGroup::default_instance(), - &message.optionalgroup()); - EXPECT_EQ(&UNITTEST::TestAllTypes::NestedMessage::default_instance(), - &message.optional_nested_message()); - EXPECT_EQ(&UNITTEST::ForeignMessage::default_instance(), - &message.optional_foreign_message()); - EXPECT_EQ(&UNITTEST_IMPORT::ImportMessage::default_instance(), - &message.optional_import_message()); -} - -TEST(GENERATED_MESSAGE_TEST_NAME, FloatingPointDefaults) { - const UNITTEST::TestExtremeDefaultValues& extreme_default = - UNITTEST::TestExtremeDefaultValues::default_instance(); - - EXPECT_EQ(0.0f, extreme_default.zero_float()); - EXPECT_EQ(1.0f, extreme_default.one_float()); - EXPECT_EQ(1.5f, extreme_default.small_float()); - EXPECT_EQ(-1.0f, extreme_default.negative_one_float()); - EXPECT_EQ(-1.5f, extreme_default.negative_float()); - EXPECT_EQ(2.0e8f, extreme_default.large_float()); - EXPECT_EQ(-8e-28f, extreme_default.small_negative_float()); - EXPECT_EQ(std::numeric_limits::infinity(), - extreme_default.inf_double()); - EXPECT_EQ(-std::numeric_limits::infinity(), - extreme_default.neg_inf_double()); - EXPECT_TRUE(extreme_default.nan_double() != extreme_default.nan_double()); - EXPECT_EQ(std::numeric_limits::infinity(), - extreme_default.inf_float()); - EXPECT_EQ(-std::numeric_limits::infinity(), - extreme_default.neg_inf_float()); - EXPECT_TRUE(extreme_default.nan_float() != extreme_default.nan_float()); -} - -TEST(GENERATED_MESSAGE_TEST_NAME, Trigraph) { - const UNITTEST::TestExtremeDefaultValues& extreme_default = - UNITTEST::TestExtremeDefaultValues::default_instance(); - - EXPECT_EQ("? ? ?? ?? ??? ?\?/ ?\?-", extreme_default.cpp_trigraph()); -} - -TEST(GENERATED_MESSAGE_TEST_NAME, ExtremeSmallIntegerDefault) { - const UNITTEST::TestExtremeDefaultValues& extreme_default = - UNITTEST::TestExtremeDefaultValues::default_instance(); - EXPECT_EQ(std::numeric_limits::min(), - extreme_default.really_small_int32()); - EXPECT_EQ(std::numeric_limits::min(), - extreme_default.really_small_int64()); -} - -TEST(GENERATED_MESSAGE_TEST_NAME, Accessors) { - // Set every field to a unique value then go back and check all those - // values. - UNITTEST::TestAllTypes message; - - TestUtil::SetAllFields(&message); - TestUtil::ExpectAllFieldsSet(message); - - TestUtil::ModifyRepeatedFields(&message); - TestUtil::ExpectRepeatedFieldsModified(message); -} - -TEST(GENERATED_MESSAGE_TEST_NAME, MutableStringDefault) { - // mutable_foo() for a string should return a string initialized to its - // default value. - UNITTEST::TestAllTypes message; - - EXPECT_EQ("hello", *message.mutable_default_string()); - - // Note that the first time we call mutable_foo(), we get a newly-allocated - // string, but if we clear it and call it again, we get the same object again. - // We should verify that it has its default value in both cases. - message.set_default_string("blah"); - message.Clear(); - - EXPECT_EQ("hello", *message.mutable_default_string()); -} - -TEST(GENERATED_MESSAGE_TEST_NAME, StringDefaults) { - UNITTEST::TestExtremeDefaultValues message; - // Check if '\000' can be used in default string value. - EXPECT_EQ(std::string("hel\000lo", 6), message.string_with_zero()); - EXPECT_EQ(std::string("wor\000ld", 6), message.bytes_with_zero()); -} - -TEST(GENERATED_MESSAGE_TEST_NAME, ReleaseString) { - // Check that release_foo() starts out NULL, and gives us a value - // that we can delete after it's been set. - UNITTEST::TestAllTypes message; - - EXPECT_EQ(NULL, message.release_default_string()); - EXPECT_FALSE(message.has_default_string()); - EXPECT_EQ("hello", message.default_string()); - - message.set_default_string("blah"); - EXPECT_TRUE(message.has_default_string()); - std::unique_ptr str(message.release_default_string()); - EXPECT_FALSE(message.has_default_string()); - ASSERT_TRUE(str != NULL); - EXPECT_EQ("blah", *str); - - EXPECT_EQ(NULL, message.release_default_string()); - EXPECT_FALSE(message.has_default_string()); - EXPECT_EQ("hello", message.default_string()); -} - -TEST(GENERATED_MESSAGE_TEST_NAME, ReleaseMessage) { - // Check that release_foo() starts out NULL, and gives us a value - // that we can delete after it's been set. - UNITTEST::TestAllTypes message; - - EXPECT_EQ(NULL, message.release_optional_nested_message()); - EXPECT_FALSE(message.has_optional_nested_message()); - - message.mutable_optional_nested_message()->set_bb(1); - std::unique_ptr nest( - message.release_optional_nested_message()); - EXPECT_FALSE(message.has_optional_nested_message()); - ASSERT_TRUE(nest != NULL); - EXPECT_EQ(1, nest->bb()); - - EXPECT_EQ(NULL, message.release_optional_nested_message()); - EXPECT_FALSE(message.has_optional_nested_message()); -} - -TEST(GENERATED_MESSAGE_TEST_NAME, SetAllocatedString) { - // Check that set_allocated_foo() works for strings. - UNITTEST::TestAllTypes message; - - EXPECT_FALSE(message.has_optional_string()); - const std::string kHello("hello"); - message.set_optional_string(kHello); - EXPECT_TRUE(message.has_optional_string()); - - message.set_allocated_optional_string(NULL); - EXPECT_FALSE(message.has_optional_string()); - EXPECT_EQ("", message.optional_string()); - - message.set_allocated_optional_string(new std::string(kHello)); - EXPECT_TRUE(message.has_optional_string()); - EXPECT_EQ(kHello, message.optional_string()); -} - -TEST(GENERATED_MESSAGE_TEST_NAME, SetAllocatedMessage) { - // Check that set_allocated_foo() can be called in all cases. - UNITTEST::TestAllTypes message; - - EXPECT_FALSE(message.has_optional_nested_message()); - - message.mutable_optional_nested_message()->set_bb(1); - EXPECT_TRUE(message.has_optional_nested_message()); - - message.set_allocated_optional_nested_message(NULL); - EXPECT_FALSE(message.has_optional_nested_message()); - EXPECT_EQ(&UNITTEST::TestAllTypes::NestedMessage::default_instance(), - &message.optional_nested_message()); - - message.mutable_optional_nested_message()->set_bb(1); - UNITTEST::TestAllTypes::NestedMessage* nest = - message.release_optional_nested_message(); - ASSERT_TRUE(nest != NULL); - EXPECT_FALSE(message.has_optional_nested_message()); - - message.set_allocated_optional_nested_message(nest); - EXPECT_TRUE(message.has_optional_nested_message()); - EXPECT_EQ(1, message.optional_nested_message().bb()); -} - -TEST(GENERATED_MESSAGE_TEST_NAME, Clear) { - // Set every field to a unique value, clear the message, then check that - // it is cleared. - UNITTEST::TestAllTypes message; - - TestUtil::SetAllFields(&message); - message.Clear(); - TestUtil::ExpectClear(message); - - // Unlike with the defaults test, we do NOT expect that requesting embedded - // messages will return a pointer to the default instance. Instead, they - // should return the objects that were created when mutable_blah() was - // called. - EXPECT_NE(&UNITTEST::TestAllTypes::OptionalGroup::default_instance(), - &message.optionalgroup()); - EXPECT_NE(&UNITTEST::TestAllTypes::NestedMessage::default_instance(), - &message.optional_nested_message()); - EXPECT_NE(&UNITTEST::ForeignMessage::default_instance(), - &message.optional_foreign_message()); - EXPECT_NE(&UNITTEST_IMPORT::ImportMessage::default_instance(), - &message.optional_import_message()); -} - -TEST(GENERATED_MESSAGE_TEST_NAME, EmbeddedNullsInBytesCharStar) { - UNITTEST::TestAllTypes message; - - const char* value = "\0lalala\0\0"; - message.set_optional_bytes(value, 9); - ASSERT_EQ(9, message.optional_bytes().size()); - EXPECT_EQ(0, memcmp(value, message.optional_bytes().data(), 9)); - - message.add_repeated_bytes(value, 9); - ASSERT_EQ(9, message.repeated_bytes(0).size()); - EXPECT_EQ(0, memcmp(value, message.repeated_bytes(0).data(), 9)); -} - -TEST(GENERATED_MESSAGE_TEST_NAME, ClearOneField) { - // Set every field to a unique value, then clear one value and insure that - // only that one value is cleared. - UNITTEST::TestAllTypes message; - - TestUtil::SetAllFields(&message); - int64_t original_value = message.optional_int64(); - - // Clear the field and make sure it shows up as cleared. - message.clear_optional_int64(); - EXPECT_FALSE(message.has_optional_int64()); - EXPECT_EQ(0, message.optional_int64()); - - // Other adjacent fields should not be cleared. - EXPECT_TRUE(message.has_optional_int32()); - EXPECT_TRUE(message.has_optional_uint32()); - - // Make sure if we set it again, then all fields are set. - message.set_optional_int64(original_value); - TestUtil::ExpectAllFieldsSet(message); -} - -TEST(GENERATED_MESSAGE_TEST_NAME, StringCharStarLength) { - // Verify that we can use a char*,length to set one of the string fields. - UNITTEST::TestAllTypes message; - message.set_optional_string("abcdef", 3); - EXPECT_EQ("abc", message.optional_string()); - - // Verify that we can use a char*,length to add to a repeated string field. - message.add_repeated_string("abcdef", 3); - EXPECT_EQ(1, message.repeated_string_size()); - EXPECT_EQ("abc", message.repeated_string(0)); - - // Verify that we can use a char*,length to set a repeated string field. - message.set_repeated_string(0, "wxyz", 2); - EXPECT_EQ("wx", message.repeated_string(0)); -} - - -TEST(GENERATED_MESSAGE_TEST_NAME, CopyFrom) { - UNITTEST::TestAllTypes message1, message2; - - TestUtil::SetAllFields(&message1); - message2.CopyFrom(message1); - TestUtil::ExpectAllFieldsSet(message2); - - // Copying from self should be a no-op. - message2.CopyFrom(message2); - TestUtil::ExpectAllFieldsSet(message2); -} - - -TEST(GENERATED_MESSAGE_TEST_NAME, SwapWithEmpty) { - UNITTEST::TestAllTypes message1, message2; - TestUtil::SetAllFields(&message1); - - TestUtil::ExpectAllFieldsSet(message1); - TestUtil::ExpectClear(message2); - message1.Swap(&message2); - TestUtil::ExpectAllFieldsSet(message2); - TestUtil::ExpectClear(message1); -} - -TEST(GENERATED_MESSAGE_TEST_NAME, SwapWithSelf) { - UNITTEST::TestAllTypes message; - TestUtil::SetAllFields(&message); - TestUtil::ExpectAllFieldsSet(message); - message.Swap(&message); - TestUtil::ExpectAllFieldsSet(message); -} - -TEST(GENERATED_MESSAGE_TEST_NAME, SwapWithOther) { - UNITTEST::TestAllTypes message1, message2; - - message1.set_optional_int32(123); - message1.set_optional_string("abc"); - message1.mutable_optional_nested_message()->set_bb(1); - message1.set_optional_nested_enum(UNITTEST::TestAllTypes::FOO); - message1.add_repeated_int32(1); - message1.add_repeated_int32(2); - message1.add_repeated_string("a"); - message1.add_repeated_string("b"); - message1.add_repeated_nested_message()->set_bb(7); - message1.add_repeated_nested_message()->set_bb(8); - message1.add_repeated_nested_enum(UNITTEST::TestAllTypes::FOO); - message1.add_repeated_nested_enum(UNITTEST::TestAllTypes::BAR); - - message2.set_optional_int32(456); - message2.set_optional_string("def"); - message2.mutable_optional_nested_message()->set_bb(2); - message2.set_optional_nested_enum(UNITTEST::TestAllTypes::BAR); - message2.add_repeated_int32(3); - message2.add_repeated_string("c"); - message2.add_repeated_nested_message()->set_bb(9); - message2.add_repeated_nested_enum(UNITTEST::TestAllTypes::BAZ); - - message1.Swap(&message2); - - EXPECT_EQ(456, message1.optional_int32()); - EXPECT_EQ("def", message1.optional_string()); - EXPECT_EQ(2, message1.optional_nested_message().bb()); - EXPECT_EQ(UNITTEST::TestAllTypes::BAR, message1.optional_nested_enum()); - ASSERT_EQ(1, message1.repeated_int32_size()); - EXPECT_EQ(3, message1.repeated_int32(0)); - ASSERT_EQ(1, message1.repeated_string_size()); - EXPECT_EQ("c", message1.repeated_string(0)); - ASSERT_EQ(1, message1.repeated_nested_message_size()); - EXPECT_EQ(9, message1.repeated_nested_message(0).bb()); - ASSERT_EQ(1, message1.repeated_nested_enum_size()); - EXPECT_EQ(UNITTEST::TestAllTypes::BAZ, message1.repeated_nested_enum(0)); - - EXPECT_EQ(123, message2.optional_int32()); - EXPECT_EQ("abc", message2.optional_string()); - EXPECT_EQ(1, message2.optional_nested_message().bb()); - EXPECT_EQ(UNITTEST::TestAllTypes::FOO, message2.optional_nested_enum()); - ASSERT_EQ(2, message2.repeated_int32_size()); - EXPECT_EQ(1, message2.repeated_int32(0)); - EXPECT_EQ(2, message2.repeated_int32(1)); - ASSERT_EQ(2, message2.repeated_string_size()); - EXPECT_EQ("a", message2.repeated_string(0)); - EXPECT_EQ("b", message2.repeated_string(1)); - ASSERT_EQ(2, message2.repeated_nested_message_size()); - EXPECT_EQ(7, message2.repeated_nested_message(0).bb()); - EXPECT_EQ(8, message2.repeated_nested_message(1).bb()); - ASSERT_EQ(2, message2.repeated_nested_enum_size()); - EXPECT_EQ(UNITTEST::TestAllTypes::FOO, message2.repeated_nested_enum(0)); - EXPECT_EQ(UNITTEST::TestAllTypes::BAR, message2.repeated_nested_enum(1)); -} - -TEST(GENERATED_MESSAGE_TEST_NAME, ADLSwap) { - UNITTEST::TestAllTypes message1, message2; - TestUtil::SetAllFields(&message1); - - // Note the address of one of the repeated fields, to verify it was swapped - // rather than copied. - const int32_t* addr = &message1.repeated_int32().Get(0); - - using std::swap; - swap(message1, message2); - - 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) { - // All set. - { - UNITTEST::TestAllTypes message1; - TestUtil::SetAllFields(&message1); - - UNITTEST::TestAllTypes message2(message1); - TestUtil::ExpectAllFieldsSet(message2); - } - - // None set. - { - UNITTEST::TestAllTypes message1; - UNITTEST::TestAllTypes message2(message1); - - EXPECT_FALSE(message1.has_optional_string()); - EXPECT_FALSE(message2.has_optional_string()); - EXPECT_EQ(message1.optional_string(), message2.optional_string()); - - EXPECT_FALSE(message1.has_optional_bytes()); - EXPECT_FALSE(message2.has_optional_bytes()); - EXPECT_EQ(message1.optional_bytes(), message2.optional_bytes()); - - EXPECT_FALSE(message1.has_optional_nested_message()); - EXPECT_FALSE(message2.has_optional_nested_message()); - EXPECT_EQ(&message1.optional_nested_message(), - &message2.optional_nested_message()); - - EXPECT_FALSE(message1.has_optional_foreign_message()); - EXPECT_FALSE(message2.has_optional_foreign_message()); - EXPECT_EQ(&message1.optional_foreign_message(), - &message2.optional_foreign_message()); - - EXPECT_FALSE(message1.has_optional_import_message()); - EXPECT_FALSE(message2.has_optional_import_message()); - EXPECT_EQ(&message1.optional_import_message(), - &message2.optional_import_message()); - - EXPECT_FALSE(message1.has_optional_public_import_message()); - EXPECT_FALSE(message2.has_optional_public_import_message()); - EXPECT_EQ(&message1.optional_public_import_message(), - &message2.optional_public_import_message()); - - EXPECT_FALSE(message1.has_optional_lazy_message()); - EXPECT_FALSE(message2.has_optional_lazy_message()); - EXPECT_EQ(&message1.optional_lazy_message(), - &message2.optional_lazy_message()); - } -} - -TEST(GENERATED_MESSAGE_TEST_NAME, CopyConstructorWithArenas) { - Arena arena; - UNITTEST::TestAllTypes* message1 = - Arena::CreateMessage(&arena); - TestUtil::SetAllFields(message1); - - UNITTEST::TestAllTypes message2_stack(*message1); - TestUtil::ExpectAllFieldsSet(message2_stack); - - std::unique_ptr message2_heap( - new UNITTEST::TestAllTypes(*message1)); - TestUtil::ExpectAllFieldsSet(*message2_heap); - - arena.Reset(); - - // Verify that the copies are still intact. - TestUtil::ExpectAllFieldsSet(message2_stack); - TestUtil::ExpectAllFieldsSet(*message2_heap); -} - -TEST(GENERATED_MESSAGE_TEST_NAME, CopyAssignmentOperator) { - UNITTEST::TestAllTypes message1; - TestUtil::SetAllFields(&message1); - - UNITTEST::TestAllTypes message2; - message2 = message1; - TestUtil::ExpectAllFieldsSet(message2); - - // Make sure that self-assignment does something sane. - message2.operator=(message2); - TestUtil::ExpectAllFieldsSet(message2); -} - -#if !defined(PROTOBUF_TEST_NO_DESCRIPTORS) || PROTOBUF_RTTI -TEST(GENERATED_MESSAGE_TEST_NAME, UpcastCopyFrom) { - // Test the CopyFrom method that takes in the generic const Message& - // parameter. - UNITTEST::TestAllTypes message1, message2; - - TestUtil::SetAllFields(&message1); - - const Message* source = implicit_cast(&message1); - message2.CopyFrom(*source); - - TestUtil::ExpectAllFieldsSet(message2); -} -#endif - -#ifndef PROTOBUF_TEST_NO_DESCRIPTORS - -TEST(GENERATED_MESSAGE_TEST_NAME, DynamicMessageCopyFrom) { - // Test copying from a DynamicMessage, which must fall back to using - // reflection. - UNITTEST::TestAllTypes message2; - - // Construct a new version of the dynamic message via the factory. - DynamicMessageFactory factory; - std::unique_ptr message1; - message1.reset(factory.GetPrototype( - UNITTEST::TestAllTypes::descriptor())->New()); - - TestUtil::ReflectionTester reflection_tester( - UNITTEST::TestAllTypes::descriptor()); - reflection_tester.SetAllFieldsViaReflection(message1.get()); - - message2.CopyFrom(*message1); - - TestUtil::ExpectAllFieldsSet(message2); -} - -#endif // !PROTOBUF_TEST_NO_DESCRIPTORS - -TEST(GENERATED_MESSAGE_TEST_NAME, NonEmptyMergeFrom) { - // Test merging with a non-empty message. Code is a modified form - // of that found in net/proto2/internal/reflection_ops_unittest.cc. - UNITTEST::TestAllTypes message1, message2; - - TestUtil::SetAllFields(&message1); - - // This field will test merging into an empty spot. - message2.set_optional_int32(message1.optional_int32()); - message1.clear_optional_int32(); - - // This tests overwriting. - message2.set_optional_string(message1.optional_string()); - message1.set_optional_string("something else"); - - // This tests concatenating. - message2.add_repeated_int32(message1.repeated_int32(1)); - int32_t i = message1.repeated_int32(0); - message1.clear_repeated_int32(); - message1.add_repeated_int32(i); - - message1.MergeFrom(message2); - - TestUtil::ExpectAllFieldsSet(message1); -} - - -// Test the generated SerializeWithCachedSizesToArray(), -TEST(GENERATED_MESSAGE_TEST_NAME, SerializationToArray) { - UNITTEST::TestAllTypes message1, message2; - std::string data; - TestUtil::SetAllFields(&message1); - int size = message1.ByteSizeLong(); - data.resize(size); - uint8_t* start = reinterpret_cast(::google::protobuf::string_as_array(&data)); - uint8_t* end = message1.SerializeWithCachedSizesToArray(start); - EXPECT_EQ(size, end - start); - EXPECT_TRUE(message2.ParseFromString(data)); - TestUtil::ExpectAllFieldsSet(message2); - -} - -TEST(GENERATED_MESSAGE_TEST_NAME, PackedFieldsSerializationToArray) { - UNITTEST::TestPackedTypes packed_message1, packed_message2; - std::string packed_data; - TestUtil::SetPackedFields(&packed_message1); - int packed_size = packed_message1.ByteSizeLong(); - packed_data.resize(packed_size); - uint8_t* start = - reinterpret_cast(::google::protobuf::string_as_array(&packed_data)); - uint8_t* end = packed_message1.SerializeWithCachedSizesToArray(start); - EXPECT_EQ(packed_size, end - start); - EXPECT_TRUE(packed_message2.ParseFromString(packed_data)); - TestUtil::ExpectPackedFieldsSet(packed_message2); -} - -// Test the generated SerializeWithCachedSizes() by forcing the buffer to write -// one byte at a time. -TEST(GENERATED_MESSAGE_TEST_NAME, SerializationToStream) { - UNITTEST::TestAllTypes message1, message2; - TestUtil::SetAllFields(&message1); - int size = message1.ByteSizeLong(); - std::string data; - data.resize(size); - { - // Allow the output stream to buffer only one byte at a time. - io::ArrayOutputStream array_stream(::google::protobuf::string_as_array(&data), size, 1); - io::CodedOutputStream output_stream(&array_stream); - message1.SerializeWithCachedSizes(&output_stream); - EXPECT_FALSE(output_stream.HadError()); - EXPECT_EQ(size, output_stream.ByteCount()); - } - EXPECT_TRUE(message2.ParseFromString(data)); - TestUtil::ExpectAllFieldsSet(message2); - -} - -TEST(GENERATED_MESSAGE_TEST_NAME, PackedFieldsSerializationToStream) { - UNITTEST::TestPackedTypes message1, message2; - TestUtil::SetPackedFields(&message1); - int size = message1.ByteSizeLong(); - std::string data; - data.resize(size); - { - // Allow the output stream to buffer only one byte at a time. - io::ArrayOutputStream array_stream(::google::protobuf::string_as_array(&data), size, 1); - io::CodedOutputStream output_stream(&array_stream); - message1.SerializeWithCachedSizes(&output_stream); - EXPECT_FALSE(output_stream.HadError()); - EXPECT_EQ(size, output_stream.ByteCount()); - } - EXPECT_TRUE(message2.ParseFromString(data)); - TestUtil::ExpectPackedFieldsSet(message2); -} - - -TEST(GENERATED_MESSAGE_TEST_NAME, Required) { - // Test that IsInitialized() returns false if required fields are missing. - UNITTEST::TestRequired message; - - EXPECT_FALSE(message.IsInitialized()); - message.set_a(1); - EXPECT_FALSE(message.IsInitialized()); - message.set_b(2); - EXPECT_FALSE(message.IsInitialized()); - message.set_c(3); - EXPECT_TRUE(message.IsInitialized()); -} - -TEST(GENERATED_MESSAGE_TEST_NAME, RequiredForeign) { - // Test that IsInitialized() returns false if required fields in nested - // messages are missing. - UNITTEST::TestRequiredForeign message; - - EXPECT_TRUE(message.IsInitialized()); - - message.mutable_optional_message(); - EXPECT_FALSE(message.IsInitialized()); - - message.mutable_optional_message()->set_a(1); - message.mutable_optional_message()->set_b(2); - message.mutable_optional_message()->set_c(3); - EXPECT_TRUE(message.IsInitialized()); - - message.add_repeated_message(); - EXPECT_FALSE(message.IsInitialized()); - - message.mutable_repeated_message(0)->set_a(1); - message.mutable_repeated_message(0)->set_b(2); - message.mutable_repeated_message(0)->set_c(3); - EXPECT_TRUE(message.IsInitialized()); -} - -TEST(GENERATED_MESSAGE_TEST_NAME, ForeignNested) { - // Test that TestAllTypes::NestedMessage can be embedded directly into - // another message. - UNITTEST::TestForeignNested message; - - // If this compiles and runs without crashing, it must work. We have - // nothing more to test. - UNITTEST::TestAllTypes::NestedMessage* nested = - message.mutable_foreign_nested(); - nested->set_bb(1); -} - -TEST(GENERATED_MESSAGE_TEST_NAME, ReallyLargeTagNumber) { - // Test that really large tag numbers don't break anything. - UNITTEST::TestReallyLargeTagNumber message1, message2; - std::string data; - - // For the most part, if this compiles and runs then we're probably good. - // (The most likely cause for failure would be if something were attempting - // to allocate a lookup table of some sort using tag numbers as the index.) - // We'll try serializing just for fun. - message1.set_a(1234); - message1.set_bb(5678); - message1.SerializeToString(&data); - EXPECT_TRUE(message2.ParseFromString(data)); - EXPECT_EQ(1234, message2.a()); - EXPECT_EQ(5678, message2.bb()); -} - -TEST(GENERATED_MESSAGE_TEST_NAME, MutualRecursion) { - // Test that mutually-recursive message types work. - UNITTEST::TestMutualRecursionA message; - UNITTEST::TestMutualRecursionA* nested = message.mutable_bb()->mutable_a(); - UNITTEST::TestMutualRecursionA* nested2 = nested->mutable_bb()->mutable_a(); - - // Again, if the above compiles and runs, that's all we really have to - // test, but just for run we'll check that the system didn't somehow come - // up with a pointer loop... - EXPECT_NE(&message, nested); - EXPECT_NE(&message, nested2); - EXPECT_NE(nested, nested2); -} - -TEST(GENERATED_MESSAGE_TEST_NAME, CamelCaseFieldNames) { - // This test is mainly checking that the following compiles, which verifies - // that the field names were coerced to lower-case. - // - // Protocol buffers standard style is to use lowercase-with-underscores for - // field names. Some old proto1 .protos unfortunately used camel-case field - // names. In proto1, these names were forced to lower-case. So, we do the - // same thing in proto2. - - UNITTEST::TestCamelCaseFieldNames message; - - message.set_primitivefield(2); - message.set_stringfield("foo"); - message.set_enumfield(UNITTEST::FOREIGN_FOO); - message.mutable_messagefield()->set_c(6); - - message.add_repeatedprimitivefield(8); - message.add_repeatedstringfield("qux"); - message.add_repeatedenumfield(UNITTEST::FOREIGN_BAR); - message.add_repeatedmessagefield()->set_c(15); - - EXPECT_EQ(2, message.primitivefield()); - EXPECT_EQ("foo", message.stringfield()); - EXPECT_EQ(UNITTEST::FOREIGN_FOO, message.enumfield()); - EXPECT_EQ(6, message.messagefield().c()); - - EXPECT_EQ(8, message.repeatedprimitivefield(0)); - EXPECT_EQ("qux", message.repeatedstringfield(0)); - EXPECT_EQ(UNITTEST::FOREIGN_BAR, message.repeatedenumfield(0)); - EXPECT_EQ(15, message.repeatedmessagefield(0).c()); -} - -#ifndef PROTOBUF_TEST_NO_DESCRIPTORS - -TEST(GENERATED_MESSAGE_TEST_NAME, TestOptimizedForSize) { - // We rely on the tests in reflection_ops_unittest and wire_format_unittest - // to really test that reflection-based methods work. Here we are mostly - // just making sure that TestOptimizedForSize actually builds and seems to - // function. - - UNITTEST::TestOptimizedForSize message, message2; - message.set_i(1); - message.mutable_msg()->set_c(2); - message2.CopyFrom(message); - EXPECT_EQ(1, message2.i()); - EXPECT_EQ(2, message2.msg().c()); -} - -TEST(GENERATED_MESSAGE_TEST_NAME, TestEmbedOptimizedForSize) { - // Verifies that something optimized for speed can contain something optimized - // for size. - - UNITTEST::TestEmbedOptimizedForSize message, message2; - message.mutable_optional_message()->set_i(1); - message.add_repeated_message()->mutable_msg()->set_c(2); - std::string data; - message.SerializeToString(&data); - ASSERT_TRUE(message2.ParseFromString(data)); - EXPECT_EQ(1, message2.optional_message().i()); - EXPECT_EQ(2, message2.repeated_message(0).msg().c()); -} - -TEST(GENERATED_MESSAGE_TEST_NAME, TestSpaceUsed) { - UNITTEST::TestAllTypes message1; - // sizeof provides a lower bound on SpaceUsedLong(). - EXPECT_LE(sizeof(UNITTEST::TestAllTypes), message1.SpaceUsedLong()); - const size_t empty_message_size = message1.SpaceUsedLong(); - - // Setting primitive types shouldn't affect the space used. - message1.set_optional_int32(123); - message1.set_optional_int64(12345); - message1.set_optional_uint32(123); - message1.set_optional_uint64(12345); - EXPECT_EQ(empty_message_size, message1.SpaceUsedLong()); - - // On some STL implementations, setting the string to a small value should - // only increase SpaceUsedLong() by the size of a string object, though this - // is not true everywhere. - message1.set_optional_string("abc"); - EXPECT_LE(empty_message_size + message1.optional_string().size(), - message1.SpaceUsedLong()); - - // Setting a string to a value larger than the string object itself should - // increase SpaceUsedLong(), because it cannot store the value internally. - message1.set_optional_string(std::string(sizeof(std::string) + 1, 'x')); - int min_expected_increase = message1.optional_string().capacity(); - EXPECT_LE(empty_message_size + min_expected_increase, - message1.SpaceUsedLong()); - - size_t previous_size = message1.SpaceUsedLong(); - // Adding an optional message should increase the size by the size of the - // nested message type. NestedMessage is simple enough (1 int field) that it - // is equal to sizeof(NestedMessage) - message1.mutable_optional_nested_message(); - ASSERT_EQ(sizeof(UNITTEST::TestAllTypes::NestedMessage), - message1.optional_nested_message().SpaceUsedLong()); - EXPECT_EQ(previous_size + - sizeof(UNITTEST::TestAllTypes::NestedMessage), - message1.SpaceUsedLong()); -} - -TEST(GENERATED_MESSAGE_TEST_NAME, TestOneofSpaceUsed) { - UNITTEST::TestOneof2 message1; - EXPECT_LE(sizeof(UNITTEST::TestOneof2), message1.SpaceUsedLong()); - - const size_t empty_message_size = message1.SpaceUsedLong(); - // Setting primitive types shouldn't affect the space used. - message1.set_foo_int(123); - message1.set_bar_int(12345); - EXPECT_EQ(empty_message_size, message1.SpaceUsedLong()); - - // Setting a string in oneof to a small value should only increase - // SpaceUsedLong() by the size of a string object. - message1.set_foo_string("abc"); - EXPECT_LE(empty_message_size + sizeof(std::string), message1.SpaceUsedLong()); - - // Setting a string in oneof to a value larger than the string object itself - // should increase SpaceUsedLong(), because it cannot store the value - // internally. - message1.set_foo_string(std::string(sizeof(std::string) + 1, 'x')); - int min_expected_increase = - message1.foo_string().capacity() + sizeof(std::string); - EXPECT_LE(empty_message_size + min_expected_increase, - message1.SpaceUsedLong()); - - // 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). 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_LE(empty_message_size + sizeof(UNITTEST::TestOneof2::NestedMessage), - message1.SpaceUsedLong()); -} - -#endif // !PROTOBUF_TEST_NO_DESCRIPTORS - - -TEST(GENERATED_MESSAGE_TEST_NAME, FieldConstantValues) { - UNITTEST::TestRequired message; - EXPECT_EQ(UNITTEST::TestAllTypes_NestedMessage::kBbFieldNumber, 1); - EXPECT_EQ(UNITTEST::TestAllTypes::kOptionalInt32FieldNumber, 1); - EXPECT_EQ(UNITTEST::TestAllTypes::kOptionalgroupFieldNumber, 16); - EXPECT_EQ(UNITTEST::TestAllTypes::kOptionalNestedMessageFieldNumber, 18); - EXPECT_EQ(UNITTEST::TestAllTypes::kOptionalNestedEnumFieldNumber, 21); - EXPECT_EQ(UNITTEST::TestAllTypes::kRepeatedInt32FieldNumber, 31); - EXPECT_EQ(UNITTEST::TestAllTypes::kRepeatedgroupFieldNumber, 46); - EXPECT_EQ(UNITTEST::TestAllTypes::kRepeatedNestedMessageFieldNumber, 48); - EXPECT_EQ(UNITTEST::TestAllTypes::kRepeatedNestedEnumFieldNumber, 51); -} - -TEST(GENERATED_MESSAGE_TEST_NAME, ExtensionConstantValues) { - EXPECT_EQ(UNITTEST::TestRequired::kSingleFieldNumber, 1000); - EXPECT_EQ(UNITTEST::TestRequired::kMultiFieldNumber, 1001); - EXPECT_EQ(UNITTEST::kOptionalInt32ExtensionFieldNumber, 1); - EXPECT_EQ(UNITTEST::kOptionalgroupExtensionFieldNumber, 16); - EXPECT_EQ(UNITTEST::kOptionalNestedMessageExtensionFieldNumber, 18); - EXPECT_EQ(UNITTEST::kOptionalNestedEnumExtensionFieldNumber, 21); - EXPECT_EQ(UNITTEST::kRepeatedInt32ExtensionFieldNumber, 31); - EXPECT_EQ(UNITTEST::kRepeatedgroupExtensionFieldNumber, 46); - EXPECT_EQ(UNITTEST::kRepeatedNestedMessageExtensionFieldNumber, 48); - EXPECT_EQ(UNITTEST::kRepeatedNestedEnumExtensionFieldNumber, 51); -} - -TEST(GENERATED_MESSAGE_TEST_NAME, ParseFromTruncated) { - const std::string long_string = std::string(128, 'q'); - FileDescriptorProto p; - p.add_extension()->set_name(long_string); - const std::string msg = p.SerializeAsString(); - int successful_count = 0; - for (int i = 0; i <= msg.size(); i++) { - if (p.ParseFromArray(msg.c_str(), i)) { - ++successful_count; - } - } - // We don't really care about how often we succeeded. - // As long as we didn't crash, we're happy. - EXPECT_GE(successful_count, 1); -} - -// =================================================================== - -TEST(GENERATED_ENUM_TEST_NAME, EnumValuesAsSwitchCases) { - // Test that our nested enum values can be used as switch cases. This test - // doesn't actually do anything, the proof that it works is that it - // compiles. - int i =0; - UNITTEST::TestAllTypes::NestedEnum a = UNITTEST::TestAllTypes::BAR; - switch (a) { - case UNITTEST::TestAllTypes::FOO: - i = 1; - break; - case UNITTEST::TestAllTypes::BAR: - i = 2; - break; - case UNITTEST::TestAllTypes::BAZ: - i = 3; - break; - case UNITTEST::TestAllTypes::NEG: - i = -1; - break; - // no default case: We want to make sure the compiler recognizes that - // all cases are covered. (GCC warns if you do not cover all cases of - // an enum in a switch.) - } - - // Token check just for fun. - EXPECT_EQ(2, i); -} - -TEST(GENERATED_ENUM_TEST_NAME, IsValidValue) { - // Test enum IsValidValue. - EXPECT_TRUE(UNITTEST::TestAllTypes::NestedEnum_IsValid(1)); - EXPECT_TRUE(UNITTEST::TestAllTypes::NestedEnum_IsValid(2)); - EXPECT_TRUE(UNITTEST::TestAllTypes::NestedEnum_IsValid(3)); - - EXPECT_FALSE(UNITTEST::TestAllTypes::NestedEnum_IsValid(0)); - EXPECT_FALSE(UNITTEST::TestAllTypes::NestedEnum_IsValid(4)); - - // Make sure it also works when there are dups. - EXPECT_TRUE(UNITTEST::TestEnumWithDupValue_IsValid(1)); - EXPECT_TRUE(UNITTEST::TestEnumWithDupValue_IsValid(2)); - EXPECT_TRUE(UNITTEST::TestEnumWithDupValue_IsValid(3)); - - EXPECT_FALSE(UNITTEST::TestEnumWithDupValue_IsValid(0)); - EXPECT_FALSE(UNITTEST::TestEnumWithDupValue_IsValid(4)); -} - -TEST(GENERATED_ENUM_TEST_NAME, MinAndMax) { - EXPECT_EQ(UNITTEST::TestAllTypes::NEG, - UNITTEST::TestAllTypes::NestedEnum_MIN); - EXPECT_EQ(UNITTEST::TestAllTypes::BAZ, - UNITTEST::TestAllTypes::NestedEnum_MAX); - EXPECT_EQ(4, UNITTEST::TestAllTypes::NestedEnum_ARRAYSIZE); - - EXPECT_EQ(UNITTEST::FOREIGN_FOO, UNITTEST::ForeignEnum_MIN); - EXPECT_EQ(UNITTEST::FOREIGN_BAZ, UNITTEST::ForeignEnum_MAX); - EXPECT_EQ(7, UNITTEST::ForeignEnum_ARRAYSIZE); - - EXPECT_EQ(1, UNITTEST::TestEnumWithDupValue_MIN); - EXPECT_EQ(3, UNITTEST::TestEnumWithDupValue_MAX); - EXPECT_EQ(4, UNITTEST::TestEnumWithDupValue_ARRAYSIZE); - - EXPECT_EQ(UNITTEST::SPARSE_E, UNITTEST::TestSparseEnum_MIN); - EXPECT_EQ(UNITTEST::SPARSE_C, UNITTEST::TestSparseEnum_MAX); - EXPECT_EQ(12589235, UNITTEST::TestSparseEnum_ARRAYSIZE); - - // Make sure we can take the address of _MIN, _MAX and _ARRAYSIZE. - void* null_pointer = 0; // NULL may be integer-type, not pointer-type. - EXPECT_NE(null_pointer, &UNITTEST::TestAllTypes::NestedEnum_MIN); - EXPECT_NE(null_pointer, &UNITTEST::TestAllTypes::NestedEnum_MAX); - EXPECT_NE(null_pointer, &UNITTEST::TestAllTypes::NestedEnum_ARRAYSIZE); - - EXPECT_NE(null_pointer, &UNITTEST::ForeignEnum_MIN); - EXPECT_NE(null_pointer, &UNITTEST::ForeignEnum_MAX); - EXPECT_NE(null_pointer, &UNITTEST::ForeignEnum_ARRAYSIZE); - - // Make sure we can use _MIN and _MAX as switch cases. - switch (UNITTEST::SPARSE_A) { - case UNITTEST::TestSparseEnum_MIN: - case UNITTEST::TestSparseEnum_MAX: - break; - default: - break; - } -} - -#ifndef PROTOBUF_TEST_NO_DESCRIPTORS - -TEST(GENERATED_ENUM_TEST_NAME, Name) { - // "Names" in the presence of dup values map to the first alias. - EXPECT_EQ("FOO1", UNITTEST::TestEnumWithDupValue_Name(UNITTEST::FOO1)); - EXPECT_EQ("FOO1", UNITTEST::TestEnumWithDupValue_Name(UNITTEST::FOO2)); - - EXPECT_EQ("SPARSE_A", UNITTEST::TestSparseEnum_Name(UNITTEST::SPARSE_A)); - EXPECT_EQ("SPARSE_B", UNITTEST::TestSparseEnum_Name(UNITTEST::SPARSE_B)); - EXPECT_EQ("SPARSE_C", UNITTEST::TestSparseEnum_Name(UNITTEST::SPARSE_C)); - EXPECT_EQ("SPARSE_D", UNITTEST::TestSparseEnum_Name(UNITTEST::SPARSE_D)); - EXPECT_EQ("SPARSE_E", UNITTEST::TestSparseEnum_Name(UNITTEST::SPARSE_E)); - EXPECT_EQ("SPARSE_F", UNITTEST::TestSparseEnum_Name(UNITTEST::SPARSE_F)); - EXPECT_EQ("SPARSE_G", UNITTEST::TestSparseEnum_Name(UNITTEST::SPARSE_G)); -} - -TEST(GENERATED_ENUM_TEST_NAME, Parse) { - UNITTEST::TestEnumWithDupValue dup_value = UNITTEST::FOO1; - EXPECT_TRUE(UNITTEST::TestEnumWithDupValue_Parse("FOO1", &dup_value)); - EXPECT_EQ(UNITTEST::FOO1, dup_value); - EXPECT_TRUE(UNITTEST::TestEnumWithDupValue_Parse("FOO2", &dup_value)); - EXPECT_EQ(UNITTEST::FOO2, dup_value); - EXPECT_FALSE(UNITTEST::TestEnumWithDupValue_Parse("FOO", &dup_value)); -} - -TEST(GENERATED_ENUM_TEST_NAME, GetEnumDescriptor) { - EXPECT_EQ(UNITTEST::TestAllTypes::NestedEnum_descriptor(), - GetEnumDescriptor()); - EXPECT_EQ(UNITTEST::ForeignEnum_descriptor(), - GetEnumDescriptor()); - EXPECT_EQ(UNITTEST::TestEnumWithDupValue_descriptor(), - GetEnumDescriptor()); - EXPECT_EQ(UNITTEST::TestSparseEnum_descriptor(), - GetEnumDescriptor()); -} - -enum NonProtoEnum { - kFoo = 1, -}; - -TEST(GENERATED_ENUM_TEST_NAME, IsProtoEnumTypeTrait) { - EXPECT_TRUE(is_proto_enum::value); - EXPECT_TRUE(is_proto_enum::value); - EXPECT_TRUE(is_proto_enum::value); - EXPECT_TRUE(is_proto_enum::value); - - EXPECT_FALSE(is_proto_enum::value); - EXPECT_FALSE(is_proto_enum::value); -} - -#endif // PROTOBUF_TEST_NO_DESCRIPTORS - -// =================================================================== - -#ifndef PROTOBUF_TEST_NO_DESCRIPTORS - -// Support code for testing services. -class GENERATED_SERVICE_TEST_NAME : public testing::Test { - protected: - class MockTestService : public UNITTEST::TestService { - public: - MockTestService() - : called_(false), - method_(""), - controller_(NULL), - request_(NULL), - response_(NULL), - done_(NULL) {} - - ~MockTestService() {} - - void Reset() { called_ = false; } - - // implements TestService ---------------------------------------- - - void Foo(RpcController* controller, const UNITTEST::FooRequest* request, - UNITTEST::FooResponse* response, Closure* done) override { - ASSERT_FALSE(called_); - called_ = true; - method_ = "Foo"; - controller_ = controller; - request_ = request; - response_ = response; - done_ = done; - } - - void Bar(RpcController* controller, const UNITTEST::BarRequest* request, - UNITTEST::BarResponse* response, Closure* done) override { - ASSERT_FALSE(called_); - called_ = true; - method_ = "Bar"; - controller_ = controller; - request_ = request; - response_ = response; - done_ = done; - } - - // --------------------------------------------------------------- - - bool called_; - std::string method_; - RpcController* controller_; - const Message* request_; - Message* response_; - Closure* done_; - }; - - class MockRpcChannel : public RpcChannel { - public: - MockRpcChannel() - : called_(false), - method_(NULL), - controller_(NULL), - request_(NULL), - response_(NULL), - done_(NULL), - destroyed_(NULL) {} - - ~MockRpcChannel() { - if (destroyed_ != NULL) *destroyed_ = true; - } - - void Reset() { called_ = false; } - - // implements TestService ---------------------------------------- - - void CallMethod(const MethodDescriptor* method, RpcController* controller, - const Message* request, Message* response, - Closure* done) override { - ASSERT_FALSE(called_); - called_ = true; - method_ = method; - controller_ = controller; - request_ = request; - response_ = response; - done_ = done; - } - - // --------------------------------------------------------------- - - bool called_; - const MethodDescriptor* method_; - RpcController* controller_; - const Message* request_; - Message* response_; - Closure* done_; - bool* destroyed_; - }; - - class MockController : public RpcController { - public: - void Reset() override { - ADD_FAILURE() << "Reset() not expected during this test."; - } - bool Failed() const override { - ADD_FAILURE() << "Failed() not expected during this test."; - return false; - } - std::string ErrorText() const override { - ADD_FAILURE() << "ErrorText() not expected during this test."; - return ""; - } - void StartCancel() override { - ADD_FAILURE() << "StartCancel() not expected during this test."; - } - void SetFailed(const std::string& reason) override { - ADD_FAILURE() << "SetFailed() not expected during this test."; - } - bool IsCanceled() const override { - ADD_FAILURE() << "IsCanceled() not expected during this test."; - return false; - } - void NotifyOnCancel(Closure* callback) override { - ADD_FAILURE() << "NotifyOnCancel() not expected during this test."; - } - }; - - GENERATED_SERVICE_TEST_NAME() - : descriptor_(UNITTEST::TestService::descriptor()), - foo_(descriptor_->FindMethodByName("Foo")), - bar_(descriptor_->FindMethodByName("Bar")), - stub_(&mock_channel_), - done_(::google::protobuf::NewPermanentCallback(&DoNothing)) {} - - void SetUp() override { - ASSERT_TRUE(foo_ != NULL); - ASSERT_TRUE(bar_ != NULL); - } - - const ServiceDescriptor* descriptor_; - const MethodDescriptor* foo_; - const MethodDescriptor* bar_; - - MockTestService mock_service_; - MockController mock_controller_; - - MockRpcChannel mock_channel_; - UNITTEST::TestService::Stub stub_; - - // Just so we don't have to re-define these with every test. - UNITTEST::FooRequest foo_request_; - UNITTEST::FooResponse foo_response_; - UNITTEST::BarRequest bar_request_; - UNITTEST::BarResponse bar_response_; - std::unique_ptr done_; -}; - -TEST_F(GENERATED_SERVICE_TEST_NAME, GetDescriptor) { - // Test that GetDescriptor() works. - - EXPECT_EQ(descriptor_, mock_service_.GetDescriptor()); -} - -TEST_F(GENERATED_SERVICE_TEST_NAME, GetChannel) { - EXPECT_EQ(&mock_channel_, stub_.channel()); -} - -TEST_F(GENERATED_SERVICE_TEST_NAME, OwnsChannel) { - MockRpcChannel* channel = new MockRpcChannel; - bool destroyed = false; - channel->destroyed_ = &destroyed; - - { - UNITTEST::TestService::Stub owning_stub(channel, - Service::STUB_OWNS_CHANNEL); - EXPECT_FALSE(destroyed); - } - - EXPECT_TRUE(destroyed); -} - -TEST_F(GENERATED_SERVICE_TEST_NAME, CallMethod) { - // Test that CallMethod() works. - - // Call Foo() via CallMethod(). - mock_service_.CallMethod(foo_, &mock_controller_, - &foo_request_, &foo_response_, done_.get()); - - ASSERT_TRUE(mock_service_.called_); - - EXPECT_EQ("Foo" , mock_service_.method_ ); - EXPECT_EQ(&mock_controller_, mock_service_.controller_); - EXPECT_EQ(&foo_request_ , mock_service_.request_ ); - EXPECT_EQ(&foo_response_ , mock_service_.response_ ); - EXPECT_EQ(done_.get() , mock_service_.done_ ); - - // Try again, but call Bar() instead. - mock_service_.Reset(); - mock_service_.CallMethod(bar_, &mock_controller_, - &bar_request_, &bar_response_, done_.get()); - - ASSERT_TRUE(mock_service_.called_); - EXPECT_EQ("Bar", mock_service_.method_); -} - -TEST_F(GENERATED_SERVICE_TEST_NAME, CallMethodTypeFailure) { - // Verify death if we call Foo() with Bar's message types. - -#ifdef PROTOBUF_HAS_DEATH_TEST // death tests do not work on Windows yet - EXPECT_DEBUG_DEATH( - mock_service_.CallMethod(foo_, &mock_controller_, - &foo_request_, &bar_response_, done_.get()), - "dynamic_cast"); - - mock_service_.Reset(); - EXPECT_DEBUG_DEATH( - mock_service_.CallMethod(foo_, &mock_controller_, - &bar_request_, &foo_response_, done_.get()), - "dynamic_cast"); -#endif // PROTOBUF_HAS_DEATH_TEST -} - -TEST_F(GENERATED_SERVICE_TEST_NAME, GetPrototypes) { - // Test Get{Request,Response}Prototype() methods. - - EXPECT_EQ(&UNITTEST::FooRequest::default_instance(), - &mock_service_.GetRequestPrototype(foo_)); - EXPECT_EQ(&UNITTEST::BarRequest::default_instance(), - &mock_service_.GetRequestPrototype(bar_)); - - EXPECT_EQ(&UNITTEST::FooResponse::default_instance(), - &mock_service_.GetResponsePrototype(foo_)); - EXPECT_EQ(&UNITTEST::BarResponse::default_instance(), - &mock_service_.GetResponsePrototype(bar_)); -} - -TEST_F(GENERATED_SERVICE_TEST_NAME, Stub) { - // Test that the stub class works. - - // Call Foo() via the stub. - stub_.Foo(&mock_controller_, &foo_request_, &foo_response_, done_.get()); - - ASSERT_TRUE(mock_channel_.called_); - - EXPECT_EQ(foo_ , mock_channel_.method_ ); - EXPECT_EQ(&mock_controller_, mock_channel_.controller_); - EXPECT_EQ(&foo_request_ , mock_channel_.request_ ); - EXPECT_EQ(&foo_response_ , mock_channel_.response_ ); - EXPECT_EQ(done_.get() , mock_channel_.done_ ); - - // Call Bar() via the stub. - mock_channel_.Reset(); - stub_.Bar(&mock_controller_, &bar_request_, &bar_response_, done_.get()); - - ASSERT_TRUE(mock_channel_.called_); - EXPECT_EQ(bar_, mock_channel_.method_); -} - -TEST_F(GENERATED_SERVICE_TEST_NAME, NotImplemented) { - // Test that failing to implement a method of a service causes it to fail - // with a "not implemented" error message. - - // A service which doesn't implement any methods. - class UnimplementedService : public UNITTEST::TestService { - public: - UnimplementedService() {} - }; - - UnimplementedService unimplemented_service; - - // And a controller which expects to get a "not implemented" error. - class ExpectUnimplementedController : public MockController { - public: - ExpectUnimplementedController() : called_(false) {} - - void SetFailed(const std::string& reason) override { - EXPECT_FALSE(called_); - called_ = true; - EXPECT_EQ("Method Foo() not implemented.", reason); - } - - bool called_; - }; - - ExpectUnimplementedController controller; - - // Call Foo. - unimplemented_service.Foo(&controller, &foo_request_, &foo_response_, - done_.get()); - - EXPECT_TRUE(controller.called_); -} - -// =================================================================== - -class OneofTest : public testing::Test { - protected: - void SetUp() override {} - - void ExpectEnumCasesWork(const UNITTEST::TestOneof2 &message) { - switch (message.foo_case()) { - case UNITTEST::TestOneof2::kFooInt: - EXPECT_TRUE(message.has_foo_int()); - break; - case UNITTEST::TestOneof2::kFooString: - EXPECT_TRUE(message.has_foo_string()); - break; - case UNITTEST::TestOneof2::kFooCord: - EXPECT_TRUE(message.has_foo_cord()); - break; - case UNITTEST::TestOneof2::kFooStringPiece: - EXPECT_TRUE(message.has_foo_string_piece()); - break; - case UNITTEST::TestOneof2::kFooBytes: - EXPECT_TRUE(message.has_foo_bytes()); - break; - case UNITTEST::TestOneof2::kFooEnum: - EXPECT_TRUE(message.has_foo_enum()); - break; - case UNITTEST::TestOneof2::kFooMessage: - EXPECT_TRUE(message.has_foo_message()); - break; - case UNITTEST::TestOneof2::kFoogroup: - EXPECT_TRUE(message.has_foogroup()); - break; - case UNITTEST::TestOneof2::kFooLazyMessage: - EXPECT_TRUE(message.has_foo_lazy_message()); - break; - case UNITTEST::TestOneof2::FOO_NOT_SET: - break; - } - } -}; - -TEST_F(OneofTest, SettingOneFieldClearsOthers) { - UNITTEST::TestOneof2 message; - - message.set_foo_int(123); - EXPECT_TRUE(message.has_foo_int()); - TestUtil::ExpectAtMostOneFieldSetInOneof(message); - - message.set_foo_string("foo"); - EXPECT_TRUE(message.has_foo_string()); - TestUtil::ExpectAtMostOneFieldSetInOneof(message); - - - message.set_foo_bytes("qux"); - EXPECT_TRUE(message.has_foo_bytes()); - TestUtil::ExpectAtMostOneFieldSetInOneof(message); - - message.set_foo_enum(UNITTEST::TestOneof2::FOO); - EXPECT_TRUE(message.has_foo_enum()); - TestUtil::ExpectAtMostOneFieldSetInOneof(message); - - message.mutable_foo_message()->set_qux_int(234); - EXPECT_TRUE(message.has_foo_message()); - TestUtil::ExpectAtMostOneFieldSetInOneof(message); - - message.mutable_foogroup()->set_a(345); - EXPECT_TRUE(message.has_foogroup()); - TestUtil::ExpectAtMostOneFieldSetInOneof(message); - - - // we repeat this because we didn't test if this properly clears other fields - // at the beginning. - message.set_foo_int(123); - EXPECT_TRUE(message.has_foo_int()); - TestUtil::ExpectAtMostOneFieldSetInOneof(message); -} - -TEST_F(OneofTest, EnumCases) { - UNITTEST::TestOneof2 message; - - message.set_foo_int(123); - ExpectEnumCasesWork(message); - message.set_foo_string("foo"); - ExpectEnumCasesWork(message); - message.set_foo_bytes("qux"); - ExpectEnumCasesWork(message); - message.set_foo_enum(UNITTEST::TestOneof2::FOO); - ExpectEnumCasesWork(message); - message.mutable_foo_message()->set_qux_int(234); - ExpectEnumCasesWork(message); - message.mutable_foogroup()->set_a(345); - ExpectEnumCasesWork(message); -} - -TEST_F(OneofTest, PrimitiveType) { - UNITTEST::TestOneof2 message; - // Unset field returns default value - EXPECT_EQ(message.foo_int(), 0); - - message.set_foo_int(123); - EXPECT_TRUE(message.has_foo_int()); - EXPECT_EQ(message.foo_int(), 123); - message.clear_foo_int(); - EXPECT_FALSE(message.has_foo_int()); -} - -TEST_F(OneofTest, EnumType) { - UNITTEST::TestOneof2 message; - // Unset field returns default value - EXPECT_EQ(message.foo_enum(), 1); - - message.set_foo_enum(UNITTEST::TestOneof2::FOO); - EXPECT_TRUE(message.has_foo_enum()); - EXPECT_EQ(message.foo_enum(), UNITTEST::TestOneof2::FOO); - message.clear_foo_enum(); - EXPECT_FALSE(message.has_foo_enum()); -} - -TEST_F(OneofTest, SetString) { - // Check that setting a string field in various ways works - UNITTEST::TestOneof2 message; - - // Unset field returns default value - EXPECT_EQ(message.foo_string(), ""); - - message.set_foo_string("foo"); - EXPECT_TRUE(message.has_foo_string()); - EXPECT_EQ(message.foo_string(), "foo"); - message.clear_foo_string(); - EXPECT_FALSE(message.has_foo_string()); - - message.set_foo_string(std::string("bar")); - EXPECT_TRUE(message.has_foo_string()); - EXPECT_EQ(message.foo_string(), "bar"); - message.clear_foo_string(); - EXPECT_FALSE(message.has_foo_string()); - - - message.set_foo_string("qux", 3); - EXPECT_TRUE(message.has_foo_string()); - EXPECT_EQ(message.foo_string(), "qux"); - message.clear_foo_string(); - EXPECT_FALSE(message.has_foo_string()); - - message.mutable_foo_string()->assign("quux"); - EXPECT_TRUE(message.has_foo_string()); - EXPECT_EQ(message.foo_string(), "quux"); - message.clear_foo_string(); - EXPECT_FALSE(message.has_foo_string()); - - message.set_foo_string("corge"); - EXPECT_TRUE(message.has_foo_string()); - EXPECT_EQ(message.foo_string(), "corge"); - message.clear_foo_string(); - EXPECT_FALSE(message.has_foo_string()); -} - -TEST_F(OneofTest, ReleaseString) { - // Check that release_foo() starts out NULL, and gives us a value - // that we can delete after it's been set. - UNITTEST::TestOneof2 message; - - EXPECT_EQ(NULL, message.release_foo_string()); - EXPECT_FALSE(message.has_foo_string()); - - message.set_foo_string("blah"); - EXPECT_TRUE(message.has_foo_string()); - std::unique_ptr str(message.release_foo_string()); - EXPECT_FALSE(message.has_foo_string()); - ASSERT_TRUE(str != NULL); - EXPECT_EQ("blah", *str); - - EXPECT_EQ(NULL, message.release_foo_string()); - EXPECT_FALSE(message.has_foo_string()); -} - -TEST_F(OneofTest, SetAllocatedString) { - // Check that set_allocated_foo() works for strings. - UNITTEST::TestOneof2 message; - - EXPECT_FALSE(message.has_foo_string()); - const std::string kHello("hello"); - message.set_foo_string(kHello); - EXPECT_TRUE(message.has_foo_string()); - - message.set_allocated_foo_string(NULL); - EXPECT_FALSE(message.has_foo_string()); - EXPECT_EQ("", message.foo_string()); - - message.set_allocated_foo_string(new std::string(kHello)); - EXPECT_TRUE(message.has_foo_string()); - EXPECT_EQ(kHello, message.foo_string()); -} - -TEST_F(OneofTest, ArenaSetAllocatedString) { - // Check that set_allocated_foo() works for strings. - Arena arena; - UNITTEST::TestOneof2* message = - Arena::CreateMessage(&arena); - - EXPECT_FALSE(message->has_foo_string()); - const std::string kHello("hello"); - message->set_foo_string(kHello); - EXPECT_TRUE(message->has_foo_string()); - - message->set_allocated_foo_string(NULL); - EXPECT_FALSE(message->has_foo_string()); - EXPECT_EQ("", message->foo_string()); - - message->set_allocated_foo_string(new std::string(kHello)); - EXPECT_TRUE(message->has_foo_string()); - EXPECT_EQ(kHello, message->foo_string()); -} - - -TEST_F(OneofTest, SetMessage) { - // Check that setting a message field works - UNITTEST::TestOneof2 message; - - // Unset field returns default instance - EXPECT_EQ(&message.foo_message(), - &UNITTEST::TestOneof2_NestedMessage::default_instance()); - EXPECT_EQ(message.foo_message().qux_int(), 0); - - message.mutable_foo_message()->set_qux_int(234); - EXPECT_TRUE(message.has_foo_message()); - EXPECT_EQ(message.foo_message().qux_int(), 234); - message.clear_foo_message(); - EXPECT_FALSE(message.has_foo_message()); -} - -TEST_F(OneofTest, ReleaseMessage) { - // Check that release_foo() starts out NULL, and gives us a value - // that we can delete after it's been set. - UNITTEST::TestOneof2 message; - - EXPECT_EQ(NULL, message.release_foo_message()); - EXPECT_FALSE(message.has_foo_message()); - - message.mutable_foo_message()->set_qux_int(1); - EXPECT_TRUE(message.has_foo_message()); - std::unique_ptr mes( - message.release_foo_message()); - EXPECT_FALSE(message.has_foo_message()); - ASSERT_TRUE(mes != NULL); - EXPECT_EQ(1, mes->qux_int()); - - EXPECT_EQ(NULL, message.release_foo_message()); - EXPECT_FALSE(message.has_foo_message()); -} - -TEST_F(OneofTest, SetAllocatedMessage) { - // Check that set_allocated_foo() works for messages. - UNITTEST::TestOneof2 message; - - EXPECT_FALSE(message.has_foo_message()); - - message.mutable_foo_message()->set_qux_int(1); - EXPECT_TRUE(message.has_foo_message()); - - message.set_allocated_foo_message(NULL); - EXPECT_FALSE(message.has_foo_message()); - EXPECT_EQ(&message.foo_message(), - &UNITTEST::TestOneof2_NestedMessage::default_instance()); - - message.mutable_foo_message()->set_qux_int(1); - UNITTEST::TestOneof2_NestedMessage* mes = message.release_foo_message(); - ASSERT_TRUE(mes != NULL); - EXPECT_FALSE(message.has_foo_message()); - - message.set_allocated_foo_message(mes); - EXPECT_TRUE(message.has_foo_message()); - EXPECT_EQ(1, message.foo_message().qux_int()); -} - - -TEST_F(OneofTest, Clear) { - UNITTEST::TestOneof2 message; - - message.set_foo_int(1); - EXPECT_TRUE(message.has_foo_int()); - message.clear_foo_int(); - EXPECT_FALSE(message.has_foo_int()); -} - -TEST_F(OneofTest, Defaults) { - UNITTEST::TestOneof2 message; - - EXPECT_FALSE(message.has_foo_int()); - EXPECT_EQ(message.foo_int(), 0); - - EXPECT_FALSE(message.has_foo_string()); - EXPECT_EQ(message.foo_string(), ""); - - - EXPECT_FALSE(message.has_foo_bytes()); - EXPECT_EQ(message.foo_bytes(), ""); - - EXPECT_FALSE(message.has_foo_enum()); - EXPECT_EQ(message.foo_enum(), 1); - - EXPECT_FALSE(message.has_foo_message()); - EXPECT_EQ(message.foo_message().qux_int(), 0); - - EXPECT_FALSE(message.has_foogroup()); - EXPECT_EQ(message.foogroup().a(), 0); - - - EXPECT_FALSE(message.has_bar_int()); - EXPECT_EQ(message.bar_int(), 5); - - EXPECT_FALSE(message.has_bar_string()); - EXPECT_EQ(message.bar_string(), "STRING"); - - - EXPECT_FALSE(message.has_bar_bytes()); - EXPECT_EQ(message.bar_bytes(), "BYTES"); - - EXPECT_FALSE(message.has_bar_enum()); - EXPECT_EQ(message.bar_enum(), 2); -} - -TEST_F(OneofTest, SwapWithEmpty) { - UNITTEST::TestOneof2 message1, message2; - message1.set_foo_string("FOO"); - EXPECT_TRUE(message1.has_foo_string()); - message1.Swap(&message2); - EXPECT_FALSE(message1.has_foo_string()); - EXPECT_TRUE(message2.has_foo_string()); - EXPECT_EQ(message2.foo_string(), "FOO"); -} - -TEST_F(OneofTest, SwapWithSelf) { - UNITTEST::TestOneof2 message; - message.set_foo_string("FOO"); - EXPECT_TRUE(message.has_foo_string()); - message.Swap(&message); - EXPECT_TRUE(message.has_foo_string()); - EXPECT_EQ(message.foo_string(), "FOO"); -} - -TEST_F(OneofTest, SwapBothHasFields) { - UNITTEST::TestOneof2 message1, message2; - - message1.set_foo_string("FOO"); - EXPECT_TRUE(message1.has_foo_string()); - message2.mutable_foo_message()->set_qux_int(1); - EXPECT_TRUE(message2.has_foo_message()); - - message1.Swap(&message2); - EXPECT_FALSE(message1.has_foo_string()); - EXPECT_FALSE(message2.has_foo_message()); - EXPECT_TRUE(message1.has_foo_message()); - EXPECT_EQ(message1.foo_message().qux_int(), 1); - EXPECT_TRUE(message2.has_foo_string()); - EXPECT_EQ(message2.foo_string(), "FOO"); -} - -TEST_F(OneofTest, CopyConstructor) { - UNITTEST::TestOneof2 message1; - message1.set_foo_bytes("FOO"); - - UNITTEST::TestOneof2 message2(message1); - EXPECT_TRUE(message2.has_foo_bytes()); - EXPECT_EQ(message2.foo_bytes(), "FOO"); -} - -TEST_F(OneofTest, CopyFrom) { - UNITTEST::TestOneof2 message1, message2; - message1.set_foo_enum(UNITTEST::TestOneof2::BAR); - EXPECT_TRUE(message1.has_foo_enum()); - - message2.CopyFrom(message1); - EXPECT_TRUE(message2.has_foo_enum()); - EXPECT_EQ(message2.foo_enum(), UNITTEST::TestOneof2::BAR); - - // Copying from self should be a no-op. - message2.CopyFrom(message2); - EXPECT_TRUE(message2.has_foo_enum()); - EXPECT_EQ(message2.foo_enum(), UNITTEST::TestOneof2::BAR); -} - -TEST_F(OneofTest, CopyAssignmentOperator) { - UNITTEST::TestOneof2 message1; - message1.mutable_foo_message()->set_qux_int(123); - EXPECT_TRUE(message1.has_foo_message()); - - UNITTEST::TestOneof2 message2; - message2 = message1; - EXPECT_EQ(message2.foo_message().qux_int(), 123); - - // Make sure that self-assignment does something sane. - message2 = *&message2; // Avoid -Wself-assign. - EXPECT_EQ(message2.foo_message().qux_int(), 123); -} - -TEST_F(OneofTest, UpcastCopyFrom) { - // Test the CopyFrom method that takes in the generic const Message& - // parameter. - UNITTEST::TestOneof2 message1, message2; - message1.mutable_foogroup()->set_a(123); - EXPECT_TRUE(message1.has_foogroup()); - - const Message* source = implicit_cast(&message1); - message2.CopyFrom(*source); - - EXPECT_TRUE(message2.has_foogroup()); - EXPECT_EQ(message2.foogroup().a(), 123); -} - -// Test the generated SerializeWithCachedSizesToArray(), -// This indirectly tests MergePartialFromCodedStream() -// We have to test each field type separately because we cannot set them at the -// same time -TEST_F(OneofTest, SerializationToArray) { - // Primitive type - { - UNITTEST::TestOneof2 message1, message2; -std::string data; -message1.set_foo_int(123); -int size = message1.ByteSizeLong(); -data.resize(size); -uint8_t* start = reinterpret_cast(::google::protobuf::string_as_array(&data)); -uint8_t* end = message1.SerializeWithCachedSizesToArray(start); -EXPECT_EQ(size, end - start); -EXPECT_TRUE(message2.ParseFromString(data)); -EXPECT_EQ(message2.foo_int(), 123); - } - - // String - { - UNITTEST::TestOneof2 message1, message2; - std::string data; - message1.set_foo_string("foo"); - int size = message1.ByteSizeLong(); - data.resize(size); - uint8_t* start = reinterpret_cast(::google::protobuf::string_as_array(&data)); - uint8_t* end = message1.SerializeWithCachedSizesToArray(start); - EXPECT_EQ(size, end - start); - EXPECT_TRUE(message2.ParseFromString(data)); - EXPECT_EQ(message2.foo_string(), "foo"); - } - - - // Bytes - { - UNITTEST::TestOneof2 message1, message2; - std::string data; - message1.set_foo_bytes("qux"); - int size = message1.ByteSizeLong(); - data.resize(size); - uint8_t* start = reinterpret_cast(::google::protobuf::string_as_array(&data)); - uint8_t* end = message1.SerializeWithCachedSizesToArray(start); - EXPECT_EQ(size, end - start); - EXPECT_TRUE(message2.ParseFromString(data)); - EXPECT_EQ(message2.foo_bytes(), "qux"); - } - - // Enum - { - UNITTEST::TestOneof2 message1, message2; - std::string data; - message1.set_foo_enum(UNITTEST::TestOneof2::FOO); - int size = message1.ByteSizeLong(); - data.resize(size); - uint8_t* start = reinterpret_cast(::google::protobuf::string_as_array(&data)); - uint8_t* end = message1.SerializeWithCachedSizesToArray(start); - EXPECT_EQ(size, end - start); - EXPECT_TRUE(message2.ParseFromString(data)); - EXPECT_EQ(message2.foo_enum(), UNITTEST::TestOneof2::FOO); - } - - // Message - { - UNITTEST::TestOneof2 message1, message2; - std::string data; - message1.mutable_foo_message()->set_qux_int(234); - int size = message1.ByteSizeLong(); - data.resize(size); - uint8_t* start = reinterpret_cast(::google::protobuf::string_as_array(&data)); - uint8_t* end = message1.SerializeWithCachedSizesToArray(start); - EXPECT_EQ(size, end - start); - EXPECT_TRUE(message2.ParseFromString(data)); - EXPECT_EQ(message2.foo_message().qux_int(), 234); - } - - // Group - { - UNITTEST::TestOneof2 message1, message2; - std::string data; - message1.mutable_foogroup()->set_a(345); - int size = message1.ByteSizeLong(); - data.resize(size); - uint8_t* start = reinterpret_cast(::google::protobuf::string_as_array(&data)); - uint8_t* end = message1.SerializeWithCachedSizesToArray(start); - EXPECT_EQ(size, end - start); - EXPECT_TRUE(message2.ParseFromString(data)); - EXPECT_EQ(message2.foogroup().a(), 345); - } - -} - -// Test the generated SerializeWithCachedSizes() by forcing the buffer to write -// one byte at a time. -// This indirectly tests MergePartialFromCodedStream() -// We have to test each field type separately because we cannot set them at the -// same time -TEST_F(OneofTest, SerializationToStream) { - // Primitive type - { - UNITTEST::TestOneof2 message1, message2; -std::string data; -message1.set_foo_int(123); -int size = message1.ByteSizeLong(); -data.resize(size); - -{ - // Allow the output stream to buffer only one byte at a time. - io::ArrayOutputStream array_stream(::google::protobuf::string_as_array(&data), size, 1); - io::CodedOutputStream output_stream(&array_stream); - message1.SerializeWithCachedSizes(&output_stream); - EXPECT_FALSE(output_stream.HadError()); - EXPECT_EQ(size, output_stream.ByteCount()); -} - - EXPECT_TRUE(message2.ParseFromString(data)); - EXPECT_EQ(message2.foo_int(), 123); - } - - // String - { - UNITTEST::TestOneof2 message1, message2; - std::string data; - message1.set_foo_string("foo"); - int size = message1.ByteSizeLong(); - data.resize(size); - - { - // Allow the output stream to buffer only one byte at a time. - io::ArrayOutputStream array_stream(::google::protobuf::string_as_array(&data), size, 1); - io::CodedOutputStream output_stream(&array_stream); - message1.SerializeWithCachedSizes(&output_stream); - EXPECT_FALSE(output_stream.HadError()); - EXPECT_EQ(size, output_stream.ByteCount()); - } - - EXPECT_TRUE(message2.ParseFromString(data)); - EXPECT_EQ(message2.foo_string(), "foo"); - } - - - // Bytes - { - UNITTEST::TestOneof2 message1, message2; - std::string data; - message1.set_foo_bytes("qux"); - int size = message1.ByteSizeLong(); - data.resize(size); - - { - // Allow the output stream to buffer only one byte at a time. - io::ArrayOutputStream array_stream(::google::protobuf::string_as_array(&data), size, 1); - io::CodedOutputStream output_stream(&array_stream); - message1.SerializeWithCachedSizes(&output_stream); - EXPECT_FALSE(output_stream.HadError()); - EXPECT_EQ(size, output_stream.ByteCount()); - } - - EXPECT_TRUE(message2.ParseFromString(data)); - EXPECT_EQ(message2.foo_bytes(), "qux"); - } - - // Enum - { - UNITTEST::TestOneof2 message1, message2; - std::string data; - message1.set_foo_enum(UNITTEST::TestOneof2::FOO); - int size = message1.ByteSizeLong(); - data.resize(size); - - { - // Allow the output stream to buffer only one byte at a time. - io::ArrayOutputStream array_stream(::google::protobuf::string_as_array(&data), size, 1); - io::CodedOutputStream output_stream(&array_stream); - message1.SerializeWithCachedSizes(&output_stream); - EXPECT_FALSE(output_stream.HadError()); - EXPECT_EQ(size, output_stream.ByteCount()); - } - - EXPECT_TRUE(message2.ParseFromString(data)); - EXPECT_EQ(message2.foo_enum(), UNITTEST::TestOneof2::FOO); - } - - // Message - { - UNITTEST::TestOneof2 message1, message2; - std::string data; - message1.mutable_foo_message()->set_qux_int(234); - int size = message1.ByteSizeLong(); - data.resize(size); - - { - // Allow the output stream to buffer only one byte at a time. - io::ArrayOutputStream array_stream(::google::protobuf::string_as_array(&data), size, 1); - io::CodedOutputStream output_stream(&array_stream); - message1.SerializeWithCachedSizes(&output_stream); - EXPECT_FALSE(output_stream.HadError()); - EXPECT_EQ(size, output_stream.ByteCount()); - } - - EXPECT_TRUE(message2.ParseFromString(data)); - EXPECT_EQ(message2.foo_message().qux_int(), 234); - } - - // Group - { - UNITTEST::TestOneof2 message1, message2; - std::string data; - message1.mutable_foogroup()->set_a(345); - int size = message1.ByteSizeLong(); - data.resize(size); - - { - // Allow the output stream to buffer only one byte at a time. - io::ArrayOutputStream array_stream(::google::protobuf::string_as_array(&data), size, 1); - io::CodedOutputStream output_stream(&array_stream); - message1.SerializeWithCachedSizes(&output_stream); - EXPECT_FALSE(output_stream.HadError()); - EXPECT_EQ(size, output_stream.ByteCount()); - } - - EXPECT_TRUE(message2.ParseFromString(data)); - EXPECT_EQ(message2.foogroup().a(), 345); - } - -} - -TEST_F(OneofTest, MergeFrom) { - UNITTEST::TestOneof2 message1, message2; - - message1.set_foo_int(123); - message2.MergeFrom(message1); - TestUtil::ExpectAtMostOneFieldSetInOneof(message2); - EXPECT_TRUE(message2.has_foo_int()); - EXPECT_EQ(message2.foo_int(), 123); - - message1.set_foo_string("foo"); - message2.MergeFrom(message1); - TestUtil::ExpectAtMostOneFieldSetInOneof(message2); - EXPECT_TRUE(message2.has_foo_string()); - EXPECT_EQ(message2.foo_string(), "foo"); - - - message1.set_foo_bytes("qux"); - message2.MergeFrom(message1); - TestUtil::ExpectAtMostOneFieldSetInOneof(message2); - EXPECT_TRUE(message2.has_foo_bytes()); - EXPECT_EQ(message2.foo_bytes(), "qux"); - - message1.set_foo_enum(UNITTEST::TestOneof2::FOO); - message2.MergeFrom(message1); - TestUtil::ExpectAtMostOneFieldSetInOneof(message2); - EXPECT_TRUE(message2.has_foo_enum()); - EXPECT_EQ(message2.foo_enum(), UNITTEST::TestOneof2::FOO); - - message1.mutable_foo_message()->set_qux_int(234); - message2.MergeFrom(message1); - TestUtil::ExpectAtMostOneFieldSetInOneof(message2); - EXPECT_TRUE(message2.has_foo_message()); - EXPECT_EQ(message2.foo_message().qux_int(), 234); - - message1.mutable_foogroup()->set_a(345); - message2.MergeFrom(message1); - TestUtil::ExpectAtMostOneFieldSetInOneof(message2); - EXPECT_TRUE(message2.has_foogroup()); - EXPECT_EQ(message2.foogroup().a(), 345); - -} - -TEST(HELPERS_TEST_NAME, TestSCC) { - UNITTEST::TestMutualRecursionA a; - MessageSCCAnalyzer scc_analyzer((Options())); - const SCC* scc = scc_analyzer.GetSCC(a.GetDescriptor()); - std::vector names; - names.reserve(scc->descriptors.size()); - for (int i = 0; i < scc->descriptors.size(); i++) { - names.push_back(scc->descriptors[i]->full_name()); - } - std::string package = a.GetDescriptor()->file()->package(); - ASSERT_EQ(names.size(), 4); - std::sort(names.begin(), names.end()); - EXPECT_EQ(names[0], package + ".TestMutualRecursionA"); - EXPECT_EQ(names[1], package + ".TestMutualRecursionA.SubGroup"); - EXPECT_EQ(names[2], package + ".TestMutualRecursionA.SubMessage"); - EXPECT_EQ(names[3], package + ".TestMutualRecursionB"); - - MessageAnalysis result = scc_analyzer.GetSCCAnalysis(scc); - EXPECT_EQ(result.is_recursive, true); - EXPECT_EQ(result.contains_required, false); - EXPECT_EQ(result.contains_cord, true); // TestAllTypes - EXPECT_EQ(result.contains_extension, false); // TestAllTypes -} - -TEST(HELPERS_TEST_NAME, TestSCCAnalysis) { - { - UNITTEST::TestRecursiveMessage msg; - MessageSCCAnalyzer scc_analyzer((Options())); - const SCC* scc = scc_analyzer.GetSCC(msg.GetDescriptor()); - MessageAnalysis result = scc_analyzer.GetSCCAnalysis(scc); - EXPECT_EQ(result.is_recursive, true); - EXPECT_EQ(result.contains_required, false); - EXPECT_EQ(result.contains_cord, false); - EXPECT_EQ(result.contains_extension, false); - } - { - UNITTEST::TestAllExtensions msg; - MessageSCCAnalyzer scc_analyzer((Options())); - const SCC* scc = scc_analyzer.GetSCC(msg.GetDescriptor()); - MessageAnalysis result = scc_analyzer.GetSCCAnalysis(scc); - EXPECT_EQ(result.is_recursive, false); - EXPECT_EQ(result.contains_required, false); - EXPECT_EQ(result.contains_cord, false); - EXPECT_EQ(result.contains_extension, true); - } - { - UNITTEST::TestRequired msg; - MessageSCCAnalyzer scc_analyzer((Options())); - const SCC* scc = scc_analyzer.GetSCC(msg.GetDescriptor()); - MessageAnalysis result = scc_analyzer.GetSCCAnalysis(scc); - EXPECT_EQ(result.is_recursive, false); - EXPECT_EQ(result.contains_required, true); - EXPECT_EQ(result.contains_cord, false); - EXPECT_EQ(result.contains_extension, false); - } -} - -} // namespace cpp_unittest -} // namespace cpp -} // namespace compiler - -namespace no_generic_services_test { - // Verify that no class called "TestService" was defined in - // unittest_no_generic_services.pb.h by defining a different type by the same - // name. If such a service was generated, this will not compile. - struct TestService { - int i; - }; -} - -namespace compiler { -namespace cpp { -namespace cpp_unittest { - -TEST_F(GENERATED_SERVICE_TEST_NAME, NoGenericServices) { - // Verify that non-services in unittest_no_generic_services.proto were - // generated. - ::protobuf_unittest::no_generic_services_test::TestMessage message; - message.set_a(1); - message.SetExtension( - ::protobuf_unittest::no_generic_services_test::test_extension, 123); - ::protobuf_unittest::no_generic_services_test::TestEnum e = - ::protobuf_unittest::no_generic_services_test::FOO; - EXPECT_EQ(e, 1); - - // Verify that a ServiceDescriptor is generated for the service even if the - // class itself is not. - const FileDescriptor* file = - ::google::protobuf::unittest::no_generic_services_test::TestMessage::descriptor() - ->file(); - - ASSERT_EQ(1, file->service_count()); - EXPECT_EQ("TestService", file->service(0)->name()); - ASSERT_EQ(1, file->service(0)->method_count()); - EXPECT_EQ("Foo", file->service(0)->method(0)->name()); -} - -#endif // !PROTOBUF_TEST_NO_DESCRIPTORS - -// =================================================================== - -// This test must run last. It verifies that descriptors were or were not -// initialized depending on whether PROTOBUF_TEST_NO_DESCRIPTORS was defined. -// When this is defined, we skip all tests which are expected to trigger -// descriptor initialization. This verifies that everything else still works -// if descriptors are not initialized. -TEST(DESCRIPTOR_INIT_TEST_NAME, Initialized) { -#ifdef PROTOBUF_TEST_NO_DESCRIPTORS - bool should_have_descriptors = false; -#else - bool should_have_descriptors = true; -#endif - - EXPECT_EQ(should_have_descriptors, - DescriptorPool::generated_pool()->InternalIsFileLoaded( - TestUtil::MaybeTranslatePath(UNITTEST_PROTO_PATH))); -} - -} // namespace cpp_unittest - -} // namespace cpp -} // namespace compiler -} // namespace protobuf -} // namespace google - -#include diff --git a/extra/protobuf/protobuf-3.19.4/src/google/protobuf/compiler/cpp/metadata_test.cc b/extra/protobuf/protobuf-3.19.4/src/google/protobuf/compiler/cpp/metadata_test.cc deleted file mode 100644 index b5cac8f42f7f..000000000000 --- a/extra/protobuf/protobuf-3.19.4/src/google/protobuf/compiler/cpp/metadata_test.cc +++ /dev/null @@ -1,161 +0,0 @@ -// Protocol Buffers - Google's data interchange format -// Copyright 2008 Google Inc. All rights reserved. -// https://developers.google.com/protocol-buffers/ -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// * Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// * Redistributions in binary form must reproduce the above -// copyright notice, this list of conditions and the following disclaimer -// in the documentation and/or other materials provided with the -// distribution. -// * Neither the name of Google Inc. nor the names of its -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -#include - -#include -#include -#include -#include -#include -#include -#include -#include -#include - -namespace google { -namespace protobuf { -namespace compiler { -namespace cpp { - -namespace atu = annotation_test_util; - -namespace { - -class CppMetadataTest : public ::testing::Test { - public: - // Tries to capture a FileDescriptorProto, GeneratedCodeInfo, and output - // code from the previously added file with name `filename`. Returns true on - // success. If pb_h is non-null, expects a .pb.h and a .pb.h.meta (copied to - // pb_h and pb_h_info respecfively); similarly for proto_h and proto_h_info. - bool CaptureMetadata(const std::string& filename, FileDescriptorProto* file, - std::string* pb_h, GeneratedCodeInfo* pb_h_info, - std::string* proto_h, GeneratedCodeInfo* proto_h_info, - std::string* pb_cc) { - CommandLineInterface cli; - CppGenerator cpp_generator; - cli.RegisterGenerator("--cpp_out", &cpp_generator, ""); - std::string cpp_out = - "--cpp_out=annotate_headers=true," - "annotation_pragma_name=pragma_name," - "annotation_guard_name=guard_name:" + - TestTempDir(); - - const bool result = atu::RunProtoCompiler(filename, cpp_out, &cli, file); - - if (!result) { - return result; - } - - std::string output_base = TestTempDir() + "/" + StripProto(filename); - - if (pb_cc != NULL) { - GOOGLE_CHECK_OK( - File::GetContents(output_base + ".pb.cc", pb_cc, true)); - } - - if (pb_h != NULL && pb_h_info != NULL) { - GOOGLE_CHECK_OK( - File::GetContents(output_base + ".pb.h", pb_h, true)); - if (!atu::DecodeMetadata(output_base + ".pb.h.meta", pb_h_info)) { - return false; - } - } - - if (proto_h != NULL && proto_h_info != NULL) { - GOOGLE_CHECK_OK(File::GetContents(output_base + ".proto.h", proto_h, - true)); - if (!atu::DecodeMetadata(output_base + ".proto.h.meta", proto_h_info)) { - return false; - } - } - - return true; - } -}; - -const char kSmallTestFile[] = - "syntax = \"proto2\";\n" - "package foo;\n" - "enum Enum { VALUE = 0; }\n" - "message Message { }\n"; - -TEST_F(CppMetadataTest, CapturesEnumNames) { - FileDescriptorProto file; - GeneratedCodeInfo info; - std::string pb_h; - atu::AddFile("test.proto", kSmallTestFile); - EXPECT_TRUE( - CaptureMetadata("test.proto", &file, &pb_h, &info, NULL, NULL, NULL)); - EXPECT_EQ("Enum", file.enum_type(0).name()); - std::vector enum_path; - enum_path.push_back(FileDescriptorProto::kEnumTypeFieldNumber); - enum_path.push_back(0); - const GeneratedCodeInfo::Annotation* enum_annotation = - atu::FindAnnotationOnPath(info, "test.proto", enum_path); - EXPECT_TRUE(NULL != enum_annotation); - EXPECT_TRUE(atu::AnnotationMatchesSubstring(pb_h, enum_annotation, "Enum")); -} - -TEST_F(CppMetadataTest, AddsPragma) { - FileDescriptorProto file; - GeneratedCodeInfo info; - std::string pb_h; - atu::AddFile("test.proto", kSmallTestFile); - EXPECT_TRUE( - CaptureMetadata("test.proto", &file, &pb_h, &info, NULL, NULL, NULL)); - EXPECT_TRUE(pb_h.find("#ifdef guard_name") != std::string::npos); - EXPECT_TRUE(pb_h.find("#pragma pragma_name \"test.pb.h.meta\"") != - std::string::npos); -} - -TEST_F(CppMetadataTest, CapturesMessageNames) { - FileDescriptorProto file; - GeneratedCodeInfo info; - std::string pb_h; - atu::AddFile("test.proto", kSmallTestFile); - EXPECT_TRUE( - CaptureMetadata("test.proto", &file, &pb_h, &info, NULL, NULL, NULL)); - EXPECT_EQ("Message", file.message_type(0).name()); - std::vector message_path; - message_path.push_back(FileDescriptorProto::kMessageTypeFieldNumber); - message_path.push_back(0); - const GeneratedCodeInfo::Annotation* message_annotation = - atu::FindAnnotationOnPath(info, "test.proto", message_path); - EXPECT_TRUE(NULL != message_annotation); - EXPECT_TRUE( - atu::AnnotationMatchesSubstring(pb_h, message_annotation, "Message")); -} - -} // namespace -} // namespace cpp -} // namespace compiler -} // namespace protobuf -} // namespace google diff --git a/extra/protobuf/protobuf-3.19.4/src/google/protobuf/compiler/csharp/csharp_bootstrap_unittest.cc b/extra/protobuf/protobuf-3.19.4/src/google/protobuf/compiler/csharp/csharp_bootstrap_unittest.cc deleted file mode 100644 index 86bacf8103bd..000000000000 --- a/extra/protobuf/protobuf-3.19.4/src/google/protobuf/compiler/csharp/csharp_bootstrap_unittest.cc +++ /dev/null @@ -1,194 +0,0 @@ -// Protocol Buffers - Google's data interchange format -// Copyright 2008 Google Inc. All rights reserved. -// https://developers.google.com/protocol-buffers/ -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// * Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// * Redistributions in binary form must reproduce the above -// copyright notice, this list of conditions and the following disclaimer -// in the documentation and/or other materials provided with the -// distribution. -// * Neither the name of Google Inc. nor the names of its -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -// This test insures that -// csharp/src/Google.Protobuf/Reflection/Descriptor.cs match exactly -// what would be generated by the protocol compiler. The file is not -// generated automatically at build time. -// -// If this test fails, run the script -// "generate_descriptor_proto.sh" and add the changed files under -// csharp/src/ to your changelist. - -#include - -#include -#include -#include -#include -#include -#include -#include -#include - -#include -#include -#include -#include - -namespace google { -namespace protobuf { -namespace compiler { -namespace csharp { - -namespace { - -class MockErrorCollector : public MultiFileErrorCollector { - public: - MockErrorCollector() {} - ~MockErrorCollector() {} - - std::string text_; - - // implements ErrorCollector --------------------------------------- - void AddError(const std::string& filename, int line, int column, - const std::string& message) { - strings::SubstituteAndAppend(&text_, "$0:$1:$2: $3\n", - filename, line, column, message); - } -}; - -class MockGeneratorContext : public GeneratorContext { - public: - void ExpectFileMatches(const std::string& virtual_filename, - const std::string& physical_filename) { - auto it = files_.find(virtual_filename); - ASSERT_TRUE(it != files_.end()) - << "Generator failed to generate file: " << virtual_filename; - std::string expected_contents = *it->second; - - std::string actual_contents; - GOOGLE_CHECK_OK( - File::GetContentsAsText(TestSourceDir() + "/" + physical_filename, - &actual_contents, true)) - << "Unable to get " << physical_filename; - EXPECT_TRUE(actual_contents == expected_contents) - << physical_filename << " needs to be regenerated. Please run " - "generate_descriptor_proto.sh. Then add this file " - "to your CL."; - } - - // implements GeneratorContext -------------------------------------- - - virtual io::ZeroCopyOutputStream* Open(const std::string& filename) { - auto& map_slot = files_[filename]; - map_slot.reset(new std::string); - return new io::StringOutputStream(map_slot.get()); - } - - private: - std::map> files_; -}; - -class GenerateAndTest { - public: - GenerateAndTest() {} - void Run(const FileDescriptor* proto_file, std::string file1, std::string file2) { - ASSERT_TRUE(proto_file != NULL) << TestSourceDir(); - ASSERT_TRUE(generator_.Generate(proto_file, parameter_, - &context_, &error_)); - context_.ExpectFileMatches(file1, file2); - } - void SetParameter(string parameter) { - parameter_ = parameter; - } - - private: - Generator generator_; - MockGeneratorContext context_; - std::string error_; - std::string parameter_; -}; - -TEST(CsharpBootstrapTest, GeneratedCsharpDescriptorMatches) { - // Skip this whole test if the csharp directory doesn't exist (i.e., a C++11 - // only distribution). - std::string descriptor_file_name = - "../csharp/src/Google.Protobuf/Reflection/Descriptor.cs"; - if (!File::Exists(TestSourceDir() + "/" + descriptor_file_name)) { - return; - } - - MockErrorCollector error_collector; - DiskSourceTree source_tree; - Importer importer(&source_tree, &error_collector); - GenerateAndTest generate_test; - - generate_test.SetParameter("base_namespace=Google.Protobuf"); - source_tree.MapPath("", TestSourceDir()); - generate_test.Run(importer.Import("google/protobuf/descriptor.proto"), - "Reflection/Descriptor.cs", - "../csharp/src/Google.Protobuf/Reflection/Descriptor.cs"); - generate_test.Run(importer.Import("google/protobuf/any.proto"), - "WellKnownTypes/Any.cs", - "../csharp/src/Google.Protobuf/WellKnownTypes/Any.cs"); - generate_test.Run(importer.Import("google/protobuf/api.proto"), - "WellKnownTypes/Api.cs", - "../csharp/src/Google.Protobuf/WellKnownTypes/Api.cs"); - generate_test.Run(importer.Import("google/protobuf/duration.proto"), - "WellKnownTypes/Duration.cs", - "../csharp/src/Google.Protobuf/WellKnownTypes/Duration.cs"); - generate_test.Run(importer.Import("google/protobuf/empty.proto"), - "WellKnownTypes/Empty.cs", - "../csharp/src/Google.Protobuf/WellKnownTypes/Empty.cs"); - generate_test.Run(importer.Import("google/protobuf/field_mask.proto"), - "WellKnownTypes/FieldMask.cs", - "../csharp/src/Google.Protobuf/WellKnownTypes/FieldMask.cs"); - generate_test.Run(importer.Import("google/protobuf/source_context.proto"), - "WellKnownTypes/SourceContext.cs", - "../csharp/src/Google.Protobuf/WellKnownTypes/SourceContext.cs"); - generate_test.Run(importer.Import("google/protobuf/struct.proto"), - "WellKnownTypes/Struct.cs", - "../csharp/src/Google.Protobuf/WellKnownTypes/Struct.cs"); - generate_test.Run(importer.Import("google/protobuf/timestamp.proto"), - "WellKnownTypes/Timestamp.cs", - "../csharp/src/Google.Protobuf/WellKnownTypes/Timestamp.cs"); - generate_test.Run(importer.Import("google/protobuf/type.proto"), - "WellKnownTypes/Type.cs", - "../csharp/src/Google.Protobuf/WellKnownTypes/Type.cs"); - generate_test.Run(importer.Import("google/protobuf/wrappers.proto"), - "WellKnownTypes/Wrappers.cs", - "../csharp/src/Google.Protobuf/WellKnownTypes/Wrappers.cs"); - - generate_test.SetParameter(""); - source_tree.MapPath("", TestSourceDir() + "/../conformance"); - generate_test.Run(importer.Import("conformance.proto"), - "Conformance.cs", - "../csharp/src/Google.Protobuf.Conformance/Conformance.cs"); - - EXPECT_EQ("", error_collector.text_); -} - -} // namespace - -} // namespace csharp -} // namespace compiler -} // namespace protobuf -} // namespace google diff --git a/extra/protobuf/protobuf-3.19.4/src/google/protobuf/compiler/csharp/csharp_doc_comment.cc b/extra/protobuf/protobuf-3.19.4/src/google/protobuf/compiler/csharp/csharp_doc_comment.cc deleted file mode 100644 index 225d6dc54ea1..000000000000 --- a/extra/protobuf/protobuf-3.19.4/src/google/protobuf/compiler/csharp/csharp_doc_comment.cc +++ /dev/null @@ -1,116 +0,0 @@ -// Protocol Buffers - Google's data interchange format -// Copyright 2008 Google Inc. All rights reserved. -// https://developers.google.com/protocol-buffers/ -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// * Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// * Redistributions in binary form must reproduce the above -// copyright notice, this list of conditions and the following disclaimer -// in the documentation and/or other materials provided with the -// distribution. -// * Neither the name of Google Inc. nor the names of its -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -// Author: kenton@google.com (Kenton Varda) -// Based on original Protocol Buffers design by -// Sanjay Ghemawat, Jeff Dean, and others. -#include -#include -#include -#include - -namespace google { -namespace protobuf { -namespace compiler { -namespace csharp { - -// Functions to create C# XML documentation comments. -// Currently this only includes documentation comments containing text specified as comments -// in the .proto file; documentation comments generated just from field/message/enum/proto names -// is inlined in the relevant code. If more control is required, that code can be moved here. - -void WriteDocCommentBodyImpl(io::Printer* printer, SourceLocation location) { - std::string comments = location.leading_comments.empty() ? - location.trailing_comments : location.leading_comments; - if (comments.empty()) { - return; - } - // XML escaping... no need for apostrophes etc as the whole text is going to be a child - // node of a summary element, not part of an attribute. - comments = StringReplace(comments, "&", "&", true); - comments = StringReplace(comments, "<", "<", true); - std::vector lines; - lines = Split(comments, "\n", false); - // TODO: We really should work out which part to put in the summary and which to put in the remarks... - // but that needs to be part of a bigger effort to understand the markdown better anyway. - printer->Print("/// \n"); - bool last_was_empty = false; - // We squash multiple blank lines down to one, and remove any trailing blank lines. We need - // to preserve the blank lines themselves, as this is relevant in the markdown. - // Note that we can't remove leading or trailing whitespace as *that's* relevant in markdown too. - // (We don't skip "just whitespace" lines, either.) - for (std::vector::iterator it = lines.begin(); - it != lines.end(); ++it) { - std::string line = *it; - if (line.empty()) { - last_was_empty = true; - } else { - if (last_was_empty) { - printer->Print("///\n"); - } - last_was_empty = false; - printer->Print("///$line$\n", "line", *it); - } - } - printer->Print("/// \n"); -} - -template -static void WriteDocCommentBody( - io::Printer* printer, const DescriptorType* descriptor) { - SourceLocation location; - if (descriptor->GetSourceLocation(&location)) { - WriteDocCommentBodyImpl(printer, location); - } -} - -void WriteMessageDocComment(io::Printer* printer, const Descriptor* message) { - WriteDocCommentBody(printer, message); -} - -void WritePropertyDocComment(io::Printer* printer, const FieldDescriptor* field) { - WriteDocCommentBody(printer, field); -} - -void WriteEnumDocComment(io::Printer* printer, const EnumDescriptor* enumDescriptor) { - WriteDocCommentBody(printer, enumDescriptor); -} -void WriteEnumValueDocComment(io::Printer* printer, const EnumValueDescriptor* value) { - WriteDocCommentBody(printer, value); -} - -void WriteMethodDocComment(io::Printer* printer, const MethodDescriptor* method) { - WriteDocCommentBody(printer, method); -} - -} // namespace csharp -} // namespace compiler -} // namespace protobuf -} // namespace google diff --git a/extra/protobuf/protobuf-3.19.4/src/google/protobuf/compiler/csharp/csharp_doc_comment.h b/extra/protobuf/protobuf-3.19.4/src/google/protobuf/compiler/csharp/csharp_doc_comment.h deleted file mode 100644 index 75eb0ea04d16..000000000000 --- a/extra/protobuf/protobuf-3.19.4/src/google/protobuf/compiler/csharp/csharp_doc_comment.h +++ /dev/null @@ -1,51 +0,0 @@ -// Protocol Buffers - Google's data interchange format -// Copyright 2008 Google Inc. All rights reserved. -// https://developers.google.com/protocol-buffers/ -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// * Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// * Redistributions in binary form must reproduce the above -// copyright notice, this list of conditions and the following disclaimer -// in the documentation and/or other materials provided with the -// distribution. -// * Neither the name of Google Inc. nor the names of its -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - - -#ifndef GOOGLE_PROTOBUF_COMPILER_CSHARP_DOC_COMMENT_H__ -#define GOOGLE_PROTOBUF_COMPILER_CSHARP_DOC_COMMENT_H__ - -#include -#include - -namespace google { -namespace protobuf { -namespace compiler { -namespace csharp { - void WriteMessageDocComment(io::Printer* printer, const Descriptor* message); - void WritePropertyDocComment(io::Printer* printer, const FieldDescriptor* field); - void WriteEnumDocComment(io::Printer* printer, const EnumDescriptor* enumDescriptor); - void WriteEnumValueDocComment(io::Printer* printer, const EnumValueDescriptor* value); - void WriteMethodDocComment(io::Printer* printer, const MethodDescriptor* method); -} // namespace csharp -} // namespace compiler -} // namespace protobuf -} // namespace google -#endif // GOOGLE_PROTOBUF_COMPILER_CSHARP_DOC_COMMENT_H__ diff --git a/extra/protobuf/protobuf-3.19.4/src/google/protobuf/compiler/csharp/csharp_enum.cc b/extra/protobuf/protobuf-3.19.4/src/google/protobuf/compiler/csharp/csharp_enum.cc deleted file mode 100644 index 73679caf3173..000000000000 --- a/extra/protobuf/protobuf-3.19.4/src/google/protobuf/compiler/csharp/csharp_enum.cc +++ /dev/null @@ -1,99 +0,0 @@ -// Protocol Buffers - Google's data interchange format -// Copyright 2008 Google Inc. All rights reserved. -// https://developers.google.com/protocol-buffers/ -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// * Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// * Redistributions in binary form must reproduce the above -// copyright notice, this list of conditions and the following disclaimer -// in the documentation and/or other materials provided with the -// distribution. -// * Neither the name of Google Inc. nor the names of its -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -#include - -#include -#include -#include -#include -#include -#include - -#include -#include -#include -#include - -namespace google { -namespace protobuf { -namespace compiler { -namespace csharp { - -EnumGenerator::EnumGenerator(const EnumDescriptor* descriptor, const Options* options) : - SourceGeneratorBase(options), - descriptor_(descriptor) { -} - -EnumGenerator::~EnumGenerator() { -} - -void EnumGenerator::Generate(io::Printer* printer) { - WriteEnumDocComment(printer, descriptor_); - printer->Print("$access_level$ enum $name$ {\n", - "access_level", class_access_level(), - "name", descriptor_->name()); - printer->Indent(); - std::set used_names; - std::set used_number; - for (int i = 0; i < descriptor_->value_count(); i++) { - WriteEnumValueDocComment(printer, descriptor_->value(i)); - std::string original_name = descriptor_->value(i)->name(); - std::string name = - GetEnumValueName(descriptor_->name(), descriptor_->value(i)->name()); - // Make sure we don't get any duplicate names due to prefix removal. - while (!used_names.insert(name).second) { - // It's possible we'll end up giving this warning multiple times, but that's better than not at all. - GOOGLE_LOG(WARNING) << "Duplicate enum value " << name << " (originally " << original_name - << ") in " << descriptor_->name() << "; adding underscore to distinguish"; - name += "_"; - } - int number = descriptor_->value(i)->number(); - if (!used_number.insert(number).second) { - printer->Print("[pbr::OriginalName(\"$original_name$\", PreferredAlias = false)] $name$ = $number$,\n", - "original_name", original_name, - "name", name, - "number", StrCat(number)); - } else { - printer->Print("[pbr::OriginalName(\"$original_name$\")] $name$ = $number$,\n", - "original_name", original_name, - "name", name, - "number", StrCat(number)); - } - } - printer->Outdent(); - printer->Print("}\n"); - printer->Print("\n"); -} - -} // namespace csharp -} // namespace compiler -} // namespace protobuf -} // namespace google diff --git a/extra/protobuf/protobuf-3.19.4/src/google/protobuf/compiler/csharp/csharp_enum.h b/extra/protobuf/protobuf-3.19.4/src/google/protobuf/compiler/csharp/csharp_enum.h deleted file mode 100644 index e409c2e4b261..000000000000 --- a/extra/protobuf/protobuf-3.19.4/src/google/protobuf/compiler/csharp/csharp_enum.h +++ /dev/null @@ -1,66 +0,0 @@ -// Protocol Buffers - Google's data interchange format -// Copyright 2008 Google Inc. All rights reserved. -// https://developers.google.com/protocol-buffers/ -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// * Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// * Redistributions in binary form must reproduce the above -// copyright notice, this list of conditions and the following disclaimer -// in the documentation and/or other materials provided with the -// distribution. -// * Neither the name of Google Inc. nor the names of its -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -#ifndef GOOGLE_PROTOBUF_COMPILER_CSHARP_ENUM_H__ -#define GOOGLE_PROTOBUF_COMPILER_CSHARP_ENUM_H__ - -#include - -#include -#include -#include -#include - -namespace google { -namespace protobuf { -namespace compiler { -namespace csharp { - -class EnumGenerator : public SourceGeneratorBase { - public: - EnumGenerator(const EnumDescriptor* descriptor, const Options* options); - ~EnumGenerator(); - - EnumGenerator(const EnumGenerator&) = delete; - EnumGenerator& operator=(const EnumGenerator&) = delete; - - void Generate(io::Printer* printer); - - private: - const EnumDescriptor* descriptor_; -}; - -} // namespace csharp -} // namespace compiler -} // namespace protobuf -} // namespace google - -#endif // GOOGLE_PROTOBUF_COMPILER_CSHARP_ENUM_H__ - diff --git a/extra/protobuf/protobuf-3.19.4/src/google/protobuf/compiler/csharp/csharp_enum_field.cc b/extra/protobuf/protobuf-3.19.4/src/google/protobuf/compiler/csharp/csharp_enum_field.cc deleted file mode 100644 index 186fa27e5b36..000000000000 --- a/extra/protobuf/protobuf-3.19.4/src/google/protobuf/compiler/csharp/csharp_enum_field.cc +++ /dev/null @@ -1,135 +0,0 @@ -// Protocol Buffers - Google's data interchange format -// Copyright 2008 Google Inc. All rights reserved. -// https://developers.google.com/protocol-buffers/ -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// * Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// * Redistributions in binary form must reproduce the above -// copyright notice, this list of conditions and the following disclaimer -// in the documentation and/or other materials provided with the -// distribution. -// * Neither the name of Google Inc. nor the names of its -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -#include - -#include -#include -#include -#include -#include - -#include -#include -#include -#include - -namespace google { -namespace protobuf { -namespace compiler { -namespace csharp { - -EnumFieldGenerator::EnumFieldGenerator(const FieldDescriptor* descriptor, - int presenceIndex, const Options *options) - : PrimitiveFieldGenerator(descriptor, presenceIndex, options) { -} - -EnumFieldGenerator::~EnumFieldGenerator() { -} - -void EnumFieldGenerator::GenerateParsingCode(io::Printer* printer) { - printer->Print(variables_, - "$property_name$ = ($type_name$) input.ReadEnum();\n"); -} - -void EnumFieldGenerator::GenerateSerializationCode(io::Printer* printer) { - printer->Print(variables_, - "if ($has_property_check$) {\n" - " output.WriteRawTag($tag_bytes$);\n" - " output.WriteEnum((int) $property_name$);\n" - "}\n"); -} - -void EnumFieldGenerator::GenerateSerializedSizeCode(io::Printer* printer) { - printer->Print( - variables_, - "if ($has_property_check$) {\n" - " size += $tag_size$ + pb::CodedOutputStream.ComputeEnumSize((int) $property_name$);\n" - "}\n"); -} - -void EnumFieldGenerator::GenerateCodecCode(io::Printer* printer) { - printer->Print( - variables_, - "pb::FieldCodec.ForEnum($tag$, x => (int) x, x => ($type_name$) x, $default_value$)"); -} - -void EnumFieldGenerator::GenerateExtensionCode(io::Printer* printer) { - WritePropertyDocComment(printer, descriptor_); - AddDeprecatedFlag(printer); - printer->Print( - variables_, - "$access_level$ static readonly pb::Extension<$extended_type$, $type_name$> $property_name$ =\n" - " new pb::Extension<$extended_type$, $type_name$>($number$, "); - GenerateCodecCode(printer); - printer->Print(");\n"); -} - -EnumOneofFieldGenerator::EnumOneofFieldGenerator( - const FieldDescriptor* descriptor, int presenceIndex, const Options *options) - : PrimitiveOneofFieldGenerator(descriptor, presenceIndex, options) { -} - -EnumOneofFieldGenerator::~EnumOneofFieldGenerator() { -} - -void EnumOneofFieldGenerator::GenerateMergingCode(io::Printer* printer) { - printer->Print(variables_, "$property_name$ = other.$property_name$;\n"); -} - -void EnumOneofFieldGenerator::GenerateParsingCode(io::Printer* printer) { - // TODO(jonskeet): What about if we read the default value? - printer->Print( - variables_, - "$oneof_name$_ = input.ReadEnum();\n" - "$oneof_name$Case_ = $oneof_property_name$OneofCase.$property_name$;\n"); -} - -void EnumOneofFieldGenerator::GenerateSerializationCode(io::Printer* printer) { - printer->Print( - variables_, - "if ($has_property_check$) {\n" - " output.WriteRawTag($tag_bytes$);\n" - " output.WriteEnum((int) $property_name$);\n" - "}\n"); -} - -void EnumOneofFieldGenerator::GenerateSerializedSizeCode(io::Printer* printer) { - printer->Print( - variables_, - "if ($has_property_check$) {\n" - " size += $tag_size$ + pb::CodedOutputStream.ComputeEnumSize((int) $property_name$);\n" - "}\n"); -} - -} // namespace csharp -} // namespace compiler -} // namespace protobuf -} // namespace google diff --git a/extra/protobuf/protobuf-3.19.4/src/google/protobuf/compiler/csharp/csharp_enum_field.h b/extra/protobuf/protobuf-3.19.4/src/google/protobuf/compiler/csharp/csharp_enum_field.h deleted file mode 100644 index e282d72390ea..000000000000 --- a/extra/protobuf/protobuf-3.19.4/src/google/protobuf/compiler/csharp/csharp_enum_field.h +++ /dev/null @@ -1,83 +0,0 @@ -// Protocol Buffers - Google's data interchange format -// Copyright 2008 Google Inc. All rights reserved. -// https://developers.google.com/protocol-buffers/ -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// * Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// * Redistributions in binary form must reproduce the above -// copyright notice, this list of conditions and the following disclaimer -// in the documentation and/or other materials provided with the -// distribution. -// * Neither the name of Google Inc. nor the names of its -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -#ifndef GOOGLE_PROTOBUF_COMPILER_CSHARP_ENUM_FIELD_H__ -#define GOOGLE_PROTOBUF_COMPILER_CSHARP_ENUM_FIELD_H__ - -#include - -#include -#include - -namespace google { -namespace protobuf { -namespace compiler { -namespace csharp { - -class EnumFieldGenerator : public PrimitiveFieldGenerator { - public: - EnumFieldGenerator(const FieldDescriptor* descriptor, - int presenceIndex, - const Options *options); - ~EnumFieldGenerator(); - - EnumFieldGenerator(const EnumFieldGenerator&) = delete; - EnumFieldGenerator& operator=(const EnumFieldGenerator&) = delete; - - virtual void GenerateCodecCode(io::Printer* printer) override; - virtual void GenerateParsingCode(io::Printer* printer) override; - virtual void GenerateSerializationCode(io::Printer* printer) override; - virtual void GenerateSerializedSizeCode(io::Printer* printer) override; - virtual void GenerateExtensionCode(io::Printer* printer) override; -}; - -class EnumOneofFieldGenerator : public PrimitiveOneofFieldGenerator { - public: - EnumOneofFieldGenerator(const FieldDescriptor* descriptor, - int presenceIndex, - const Options *options); - ~EnumOneofFieldGenerator(); - - EnumOneofFieldGenerator(const EnumOneofFieldGenerator&) = delete; - EnumOneofFieldGenerator& operator=(const EnumOneofFieldGenerator&) = delete; - - virtual void GenerateMergingCode(io::Printer* printer) override; - virtual void GenerateParsingCode(io::Printer* printer) override; - virtual void GenerateSerializationCode(io::Printer* printer) override; - virtual void GenerateSerializedSizeCode(io::Printer* printer) override; -}; - -} // namespace csharp -} // namespace compiler -} // namespace protobuf -} // namespace google - -#endif // GOOGLE_PROTOBUF_COMPILER_CSHARP_ENUM_FIELD_H__ - diff --git a/extra/protobuf/protobuf-3.19.4/src/google/protobuf/compiler/csharp/csharp_field_base.cc b/extra/protobuf/protobuf-3.19.4/src/google/protobuf/compiler/csharp/csharp_field_base.cc deleted file mode 100644 index 477b49e5f62c..000000000000 --- a/extra/protobuf/protobuf-3.19.4/src/google/protobuf/compiler/csharp/csharp_field_base.cc +++ /dev/null @@ -1,459 +0,0 @@ -// Protocol Buffers - Google's data interchange format -// Copyright 2008 Google Inc. All rights reserved. -// https://developers.google.com/protocol-buffers/ -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// * Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// * Redistributions in binary form must reproduce the above -// copyright notice, this list of conditions and the following disclaimer -// in the documentation and/or other materials provided with the -// distribution. -// * Neither the name of Google Inc. nor the names of its -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -#include -#include -#include - -#include -#include -#include -#include -#include -#include -#include -#include - -#include -#include -#include - -namespace google { -namespace protobuf { -namespace compiler { -namespace csharp { - -void FieldGeneratorBase::SetCommonFieldVariables( - std::map* variables) { - // Note: this will be valid even though the tag emitted for packed and unpacked versions of - // repeated fields varies by wire format. The wire format is encoded in the bottom 3 bits, which - // never effects the tag size. - int tag_size = internal::WireFormat::TagSize(descriptor_->number(), descriptor_->type()); - int part_tag_size = tag_size; - if (descriptor_->type() == FieldDescriptor::TYPE_GROUP) { - part_tag_size /= 2; - } - uint tag = internal::WireFormat::MakeTag(descriptor_); - uint8 tag_array[5]; - io::CodedOutputStream::WriteTagToArray(tag, tag_array); - std::string tag_bytes = StrCat(tag_array[0]); - for (int i = 1; i < part_tag_size; i++) { - tag_bytes += ", " + StrCat(tag_array[i]); - } - - (*variables)["tag"] = StrCat(tag); - (*variables)["tag_size"] = StrCat(tag_size); - (*variables)["tag_bytes"] = tag_bytes; - - if (descriptor_->type() == FieldDescriptor::Type::TYPE_GROUP) { - tag = internal::WireFormatLite::MakeTag( - descriptor_->number(), - internal::WireFormatLite::WIRETYPE_END_GROUP); - io::CodedOutputStream::WriteTagToArray(tag, tag_array); - tag_bytes = StrCat(tag_array[0]); - for (int i = 1; i < part_tag_size; i++) { - tag_bytes += ", " + StrCat(tag_array[i]); - } - - variables_["end_tag"] = StrCat(tag); - variables_["end_tag_bytes"] = tag_bytes; - } - - (*variables)["access_level"] = "public"; - - (*variables)["property_name"] = property_name(); - (*variables)["type_name"] = type_name(); - (*variables)["extended_type"] = GetClassName(descriptor_->containing_type()); - (*variables)["name"] = name(); - (*variables)["descriptor_name"] = descriptor_->name(); - (*variables)["default_value"] = default_value(); - (*variables)["capitalized_type_name"] = capitalized_type_name(); - (*variables)["number"] = number(); - if (has_default_value() && !SupportsPresenceApi(descriptor_)) { - (*variables)["name_def_message"] = - (*variables)["name"] + "_ = " + (*variables)["default_value"]; - } else { - (*variables)["name_def_message"] = (*variables)["name"] + "_"; - } - if (SupportsPresenceApi(descriptor_)) { - (*variables)["has_property_check"] = "Has" + (*variables)["property_name"]; - (*variables)["other_has_property_check"] = "other.Has" + (*variables)["property_name"]; - (*variables)["has_not_property_check"] = "!" + (*variables)["has_property_check"]; - (*variables)["other_has_not_property_check"] = "!" + (*variables)["other_has_property_check"]; - if (presenceIndex_ != -1) { - std::string hasBitsNumber = StrCat(presenceIndex_ / 32); - std::string hasBitsMask = StrCat(1 << (presenceIndex_ % 32)); - (*variables)["has_field_check"] = "(_hasBits" + hasBitsNumber + " & " + hasBitsMask + ") != 0"; - (*variables)["set_has_field"] = "_hasBits" + hasBitsNumber + " |= " + hasBitsMask; - (*variables)["clear_has_field"] = "_hasBits" + hasBitsNumber + " &= ~" + hasBitsMask; - } - } else { - (*variables)["has_property_check"] = - (*variables)["property_name"] + " != " + (*variables)["default_value"]; - (*variables)["other_has_property_check"] = "other." + - (*variables)["property_name"] + " != " + (*variables)["default_value"]; - } -} - -void FieldGeneratorBase::SetCommonOneofFieldVariables( - std::map* variables) { - (*variables)["oneof_name"] = oneof_name(); - if (SupportsPresenceApi(descriptor_)) { - (*variables)["has_property_check"] = "Has" + property_name(); - } else { - (*variables)["has_property_check"] = - oneof_name() + "Case_ == " + oneof_property_name() + - "OneofCase." + property_name(); - } - (*variables)["oneof_property_name"] = oneof_property_name(); -} - -FieldGeneratorBase::FieldGeneratorBase(const FieldDescriptor* descriptor, - int presenceIndex, const Options* options) - : SourceGeneratorBase(options), - descriptor_(descriptor), - presenceIndex_(presenceIndex) { - SetCommonFieldVariables(&variables_); -} - -FieldGeneratorBase::~FieldGeneratorBase() { -} - -void FieldGeneratorBase::GenerateFreezingCode(io::Printer* printer) { - // No-op: only message fields and repeated fields need - // special handling for freezing, so default to not generating any code. -} - -void FieldGeneratorBase::GenerateCodecCode(io::Printer* printer) { - // No-op: expect this to be overridden by appropriate types. - // Could fail if we get called here though... -} - -void FieldGeneratorBase::GenerateExtensionCode(io::Printer* printer) { - // No-op: only message fields, enum fields, primitives, - // and repeated fields need this default is to not generate any code -} - -void FieldGeneratorBase::GenerateParsingCode(io::Printer* printer, bool use_parse_context) { - // for some field types the value of "use_parse_context" doesn't matter, - // so we fallback to the default implementation. - GenerateParsingCode(printer); -} - -void FieldGeneratorBase::GenerateSerializationCode(io::Printer* printer, bool use_write_context) { - // for some field types the value of "use_write_context" doesn't matter, - // so we fallback to the default implementation. - GenerateSerializationCode(printer); -} - -void FieldGeneratorBase::AddDeprecatedFlag(io::Printer* printer) { - if (descriptor_->options().deprecated()) { - printer->Print("[global::System.ObsoleteAttribute]\n"); - } else if (descriptor_->type() == FieldDescriptor::TYPE_MESSAGE && - descriptor_->message_type()->options().deprecated()) { - printer->Print("[global::System.ObsoleteAttribute]\n"); - } -} - -void FieldGeneratorBase::AddPublicMemberAttributes(io::Printer* printer) { - AddDeprecatedFlag(printer); - WriteGeneratedCodeAttributes(printer); -} - -std::string FieldGeneratorBase::oneof_property_name() { - return UnderscoresToCamelCase(descriptor_->containing_oneof()->name(), true); -} - -std::string FieldGeneratorBase::oneof_name() { - return UnderscoresToCamelCase(descriptor_->containing_oneof()->name(), false); -} - -std::string FieldGeneratorBase::property_name() { - return GetPropertyName(descriptor_); -} - -std::string FieldGeneratorBase::name() { - return UnderscoresToCamelCase(GetFieldName(descriptor_), false); -} - -std::string FieldGeneratorBase::type_name() { - return type_name(descriptor_); -} - -std::string FieldGeneratorBase::type_name(const FieldDescriptor* descriptor) { - switch (descriptor->type()) { - case FieldDescriptor::TYPE_ENUM: - return GetClassName(descriptor->enum_type()); - case FieldDescriptor::TYPE_MESSAGE: - case FieldDescriptor::TYPE_GROUP: - if (IsWrapperType(descriptor)) { - const FieldDescriptor* wrapped_field = - descriptor->message_type()->field(0); - std::string wrapped_field_type_name = type_name(wrapped_field); - // String and ByteString go to the same type; other wrapped types - // go to the nullable equivalent. - if (wrapped_field->type() == FieldDescriptor::TYPE_STRING || - wrapped_field->type() == FieldDescriptor::TYPE_BYTES) { - return wrapped_field_type_name; - } else { - return wrapped_field_type_name + "?"; - } - } - return GetClassName(descriptor->message_type()); - case FieldDescriptor::TYPE_DOUBLE: - return "double"; - case FieldDescriptor::TYPE_FLOAT: - return "float"; - case FieldDescriptor::TYPE_INT64: - return "long"; - case FieldDescriptor::TYPE_UINT64: - return "ulong"; - case FieldDescriptor::TYPE_INT32: - return "int"; - case FieldDescriptor::TYPE_FIXED64: - return "ulong"; - case FieldDescriptor::TYPE_FIXED32: - return "uint"; - case FieldDescriptor::TYPE_BOOL: - return "bool"; - case FieldDescriptor::TYPE_STRING: - return "string"; - case FieldDescriptor::TYPE_BYTES: - return "pb::ByteString"; - case FieldDescriptor::TYPE_UINT32: - return "uint"; - case FieldDescriptor::TYPE_SFIXED32: - return "int"; - case FieldDescriptor::TYPE_SFIXED64: - return "long"; - case FieldDescriptor::TYPE_SINT32: - return "int"; - case FieldDescriptor::TYPE_SINT64: - return "long"; - default: - GOOGLE_LOG(FATAL)<< "Unknown field type."; - return ""; - } -} - -bool FieldGeneratorBase::has_default_value() { - switch (descriptor_->type()) { - case FieldDescriptor::TYPE_ENUM: - case FieldDescriptor::TYPE_MESSAGE: - case FieldDescriptor::TYPE_GROUP: - return true; - case FieldDescriptor::TYPE_DOUBLE: - return descriptor_->default_value_double() != 0.0; - case FieldDescriptor::TYPE_FLOAT: - return descriptor_->default_value_float() != 0.0; - case FieldDescriptor::TYPE_INT64: - return descriptor_->default_value_int64() != 0L; - case FieldDescriptor::TYPE_UINT64: - return descriptor_->default_value_uint64() != 0L; - case FieldDescriptor::TYPE_INT32: - return descriptor_->default_value_int32() != 0; - case FieldDescriptor::TYPE_FIXED64: - return descriptor_->default_value_uint64() != 0L; - case FieldDescriptor::TYPE_FIXED32: - return descriptor_->default_value_uint32() != 0; - case FieldDescriptor::TYPE_BOOL: - return descriptor_->default_value_bool(); - case FieldDescriptor::TYPE_STRING: - return true; - case FieldDescriptor::TYPE_BYTES: - return true; - case FieldDescriptor::TYPE_UINT32: - return descriptor_->default_value_uint32() != 0; - case FieldDescriptor::TYPE_SFIXED32: - return descriptor_->default_value_int32() != 0; - case FieldDescriptor::TYPE_SFIXED64: - return descriptor_->default_value_int64() != 0L; - case FieldDescriptor::TYPE_SINT32: - return descriptor_->default_value_int32() != 0; - case FieldDescriptor::TYPE_SINT64: - return descriptor_->default_value_int64() != 0L; - default: - GOOGLE_LOG(FATAL)<< "Unknown field type."; - return true; - } -} - -bool AllPrintableAscii(const std::string& text) { - for(int i = 0; i < text.size(); i++) { - if (text[i] < 0x20 || text[i] > 0x7e) { - return false; - } - } - return true; -} - -std::string FieldGeneratorBase::GetStringDefaultValueInternal(const FieldDescriptor* descriptor) { - if (descriptor->default_value_string().empty()) - return "\"\""; - else - return "global::System.Text.Encoding.UTF8.GetString(global::System." - "Convert.FromBase64String(\"" + - StringToBase64(descriptor->default_value_string()) + "\"), 0, " + StrCat(descriptor->default_value_string().length()) + ")"; -} - -std::string FieldGeneratorBase::GetBytesDefaultValueInternal(const FieldDescriptor* descriptor) { - if (descriptor->default_value_string().empty()) - return "pb::ByteString.Empty"; - else - return "pb::ByteString.FromBase64(\"" + StringToBase64(descriptor->default_value_string()) + "\")"; -} - -std::string FieldGeneratorBase::default_value() { - return default_value(descriptor_); -} - -std::string FieldGeneratorBase::default_value(const FieldDescriptor* descriptor) { - switch (descriptor->type()) { - case FieldDescriptor::TYPE_ENUM: - return GetClassName(descriptor->default_value_enum()->type()) + "." + - GetEnumValueName(descriptor->default_value_enum()->type()->name(), descriptor->default_value_enum()->name()); - case FieldDescriptor::TYPE_MESSAGE: - case FieldDescriptor::TYPE_GROUP: - if (IsWrapperType(descriptor)) { - const FieldDescriptor* wrapped_field = descriptor->message_type()->field(0); - return default_value(wrapped_field); - } else { - return "null"; - } - case FieldDescriptor::TYPE_DOUBLE: { - double value = descriptor->default_value_double(); - if (value == std::numeric_limits::infinity()) { - return "double.PositiveInfinity"; - } else if (value == -std::numeric_limits::infinity()) { - return "double.NegativeInfinity"; - } else if (std::isnan(value)) { - return "double.NaN"; - } - return StrCat(value) + "D"; - } - case FieldDescriptor::TYPE_FLOAT: { - float value = descriptor->default_value_float(); - if (value == std::numeric_limits::infinity()) { - return "float.PositiveInfinity"; - } else if (value == -std::numeric_limits::infinity()) { - return "float.NegativeInfinity"; - } else if (std::isnan(value)) { - return "float.NaN"; - } - return StrCat(value) + "F"; - } - case FieldDescriptor::TYPE_INT64: - return StrCat(descriptor->default_value_int64()) + "L"; - case FieldDescriptor::TYPE_UINT64: - return StrCat(descriptor->default_value_uint64()) + "UL"; - case FieldDescriptor::TYPE_INT32: - return StrCat(descriptor->default_value_int32()); - case FieldDescriptor::TYPE_FIXED64: - return StrCat(descriptor->default_value_uint64()) + "UL"; - case FieldDescriptor::TYPE_FIXED32: - return StrCat(descriptor->default_value_uint32()); - case FieldDescriptor::TYPE_BOOL: - if (descriptor->default_value_bool()) { - return "true"; - } else { - return "false"; - } - case FieldDescriptor::TYPE_STRING: - return GetStringDefaultValueInternal(descriptor); - case FieldDescriptor::TYPE_BYTES: - return GetBytesDefaultValueInternal(descriptor); - case FieldDescriptor::TYPE_UINT32: - return StrCat(descriptor->default_value_uint32()); - case FieldDescriptor::TYPE_SFIXED32: - return StrCat(descriptor->default_value_int32()); - case FieldDescriptor::TYPE_SFIXED64: - return StrCat(descriptor->default_value_int64()) + "L"; - case FieldDescriptor::TYPE_SINT32: - return StrCat(descriptor->default_value_int32()); - case FieldDescriptor::TYPE_SINT64: - return StrCat(descriptor->default_value_int64()) + "L"; - default: - GOOGLE_LOG(FATAL)<< "Unknown field type."; - return ""; - } -} - -std::string FieldGeneratorBase::number() { - return StrCat(descriptor_->number()); -} - -std::string FieldGeneratorBase::capitalized_type_name() { - switch (descriptor_->type()) { - case FieldDescriptor::TYPE_ENUM: - return "Enum"; - case FieldDescriptor::TYPE_MESSAGE: - return "Message"; - case FieldDescriptor::TYPE_GROUP: - return "Group"; - case FieldDescriptor::TYPE_DOUBLE: - return "Double"; - case FieldDescriptor::TYPE_FLOAT: - return "Float"; - case FieldDescriptor::TYPE_INT64: - return "Int64"; - case FieldDescriptor::TYPE_UINT64: - return "UInt64"; - case FieldDescriptor::TYPE_INT32: - return "Int32"; - case FieldDescriptor::TYPE_FIXED64: - return "Fixed64"; - case FieldDescriptor::TYPE_FIXED32: - return "Fixed32"; - case FieldDescriptor::TYPE_BOOL: - return "Bool"; - case FieldDescriptor::TYPE_STRING: - return "String"; - case FieldDescriptor::TYPE_BYTES: - return "Bytes"; - case FieldDescriptor::TYPE_UINT32: - return "UInt32"; - case FieldDescriptor::TYPE_SFIXED32: - return "SFixed32"; - case FieldDescriptor::TYPE_SFIXED64: - return "SFixed64"; - case FieldDescriptor::TYPE_SINT32: - return "SInt32"; - case FieldDescriptor::TYPE_SINT64: - return "SInt64"; - default: - GOOGLE_LOG(FATAL)<< "Unknown field type."; - return ""; - } -} - -} // namespace csharp -} // namespace compiler -} // namespace protobuf -} // namespace google diff --git a/extra/protobuf/protobuf-3.19.4/src/google/protobuf/compiler/csharp/csharp_field_base.h b/extra/protobuf/protobuf-3.19.4/src/google/protobuf/compiler/csharp/csharp_field_base.h deleted file mode 100644 index f875fa11ace4..000000000000 --- a/extra/protobuf/protobuf-3.19.4/src/google/protobuf/compiler/csharp/csharp_field_base.h +++ /dev/null @@ -1,111 +0,0 @@ -// Protocol Buffers - Google's data interchange format -// Copyright 2008 Google Inc. All rights reserved. -// https://developers.google.com/protocol-buffers/ -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// * Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// * Redistributions in binary form must reproduce the above -// copyright notice, this list of conditions and the following disclaimer -// in the documentation and/or other materials provided with the -// distribution. -// * Neither the name of Google Inc. nor the names of its -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -#ifndef GOOGLE_PROTOBUF_COMPILER_CSHARP_FIELD_BASE_H__ -#define GOOGLE_PROTOBUF_COMPILER_CSHARP_FIELD_BASE_H__ - -#include -#include - -#include -#include -#include -#include - -namespace google { -namespace protobuf { -namespace compiler { -namespace csharp { - -class FieldGeneratorBase : public SourceGeneratorBase { - public: - FieldGeneratorBase(const FieldDescriptor* descriptor, - int presenceIndex, - const Options* options); - ~FieldGeneratorBase(); - - FieldGeneratorBase(const FieldGeneratorBase&) = delete; - FieldGeneratorBase& operator=(const FieldGeneratorBase&) = delete; - - virtual void GenerateCloningCode(io::Printer* printer) = 0; - virtual void GenerateFreezingCode(io::Printer* printer); - virtual void GenerateCodecCode(io::Printer* printer); - virtual void GenerateExtensionCode(io::Printer* printer); - virtual void GenerateMembers(io::Printer* printer) = 0; - virtual void GenerateMergingCode(io::Printer* printer) = 0; - virtual void GenerateParsingCode(io::Printer* printer) = 0; - virtual void GenerateParsingCode(io::Printer* printer, bool use_parse_context); - virtual void GenerateSerializationCode(io::Printer* printer) = 0; - virtual void GenerateSerializationCode(io::Printer* printer, bool use_write_context); - virtual void GenerateSerializedSizeCode(io::Printer* printer) = 0; - - virtual void WriteHash(io::Printer* printer) = 0; - virtual void WriteEquals(io::Printer* printer) = 0; - // Currently unused, as we use reflection to generate JSON - virtual void WriteToString(io::Printer* printer) = 0; - - protected: - const FieldDescriptor* descriptor_; - const int presenceIndex_; - std::map variables_; - - void AddDeprecatedFlag(io::Printer* printer); - void AddNullCheck(io::Printer* printer); - void AddNullCheck(io::Printer* printer, const std::string& name); - - void AddPublicMemberAttributes(io::Printer* printer); - void SetCommonOneofFieldVariables( - std::map* variables); - - std::string oneof_property_name(); - std::string oneof_name(); - std::string property_name(); - std::string name(); - std::string type_name(); - std::string type_name(const FieldDescriptor* descriptor); - bool has_default_value(); - std::string default_value(); - std::string default_value(const FieldDescriptor* descriptor); - std::string number(); - std::string capitalized_type_name(); - - private: - void SetCommonFieldVariables(std::map* variables); - std::string GetStringDefaultValueInternal(const FieldDescriptor* descriptor); - std::string GetBytesDefaultValueInternal(const FieldDescriptor* descriptor); -}; - -} // namespace csharp -} // namespace compiler -} // namespace protobuf -} // namespace google - -#endif // GOOGLE_PROTOBUF_COMPILER_CSHARP_FIELD_BASE_H__ - diff --git a/extra/protobuf/protobuf-3.19.4/src/google/protobuf/compiler/csharp/csharp_generator.cc b/extra/protobuf/protobuf-3.19.4/src/google/protobuf/compiler/csharp/csharp_generator.cc deleted file mode 100644 index 5ce0651738b2..000000000000 --- a/extra/protobuf/protobuf-3.19.4/src/google/protobuf/compiler/csharp/csharp_generator.cc +++ /dev/null @@ -1,112 +0,0 @@ -// Protocol Buffers - Google's data interchange format -// Copyright 2008 Google Inc. All rights reserved. -// https://developers.google.com/protocol-buffers/ -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// * Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// * Redistributions in binary form must reproduce the above -// copyright notice, this list of conditions and the following disclaimer -// in the documentation and/or other materials provided with the -// distribution. -// * Neither the name of Google Inc. nor the names of its -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -#include - -#include -#include -#include -#include -#include -#include - -#include -#include -#include -#include -#include - -namespace google { -namespace protobuf { -namespace compiler { -namespace csharp { - -Generator::Generator() {} -Generator::~Generator() {} - -uint64_t Generator::GetSupportedFeatures() const { - return CodeGenerator::Feature::FEATURE_PROTO3_OPTIONAL; -} - -void GenerateFile(const FileDescriptor* file, io::Printer* printer, - const Options* options) { - ReflectionClassGenerator reflectionClassGenerator(file, options); - reflectionClassGenerator.Generate(printer); -} - -bool Generator::Generate(const FileDescriptor* file, - const std::string& parameter, - GeneratorContext* generator_context, - std::string* error) const { - std::vector > options; - ParseGeneratorParameter(parameter, &options); - - struct Options cli_options; - - for (int i = 0; i < options.size(); i++) { - if (options[i].first == "file_extension") { - cli_options.file_extension = options[i].second; - } else if (options[i].first == "base_namespace") { - cli_options.base_namespace = options[i].second; - cli_options.base_namespace_specified = true; - } else if (options[i].first == "internal_access") { - cli_options.internal_access = true; - } else if (options[i].first == "serializable") { - cli_options.serializable = true; - } else { - *error = "Unknown generator option: " + options[i].first; - return false; - } - } - - std::string filename_error = ""; - std::string filename = GetOutputFile(file, - cli_options.file_extension, - cli_options.base_namespace_specified, - cli_options.base_namespace, - &filename_error); - - if (filename.empty()) { - *error = filename_error; - return false; - } - std::unique_ptr output( - generator_context->Open(filename)); - io::Printer printer(output.get(), '$'); - - GenerateFile(file, &printer, &cli_options); - - return true; -} - -} // namespace csharp -} // namespace compiler -} // namespace protobuf -} // namespace google diff --git a/extra/protobuf/protobuf-3.19.4/src/google/protobuf/compiler/csharp/csharp_generator.h b/extra/protobuf/protobuf-3.19.4/src/google/protobuf/compiler/csharp/csharp_generator.h deleted file mode 100644 index f41f9b8358ad..000000000000 --- a/extra/protobuf/protobuf-3.19.4/src/google/protobuf/compiler/csharp/csharp_generator.h +++ /dev/null @@ -1,70 +0,0 @@ -// Protocol Buffers - Google's data interchange format -// Copyright 2008 Google Inc. All rights reserved. -// https://developers.google.com/protocol-buffers/ -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// * Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// * Redistributions in binary form must reproduce the above -// copyright notice, this list of conditions and the following disclaimer -// in the documentation and/or other materials provided with the -// distribution. -// * Neither the name of Google Inc. nor the names of its -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -// Generates C# code for a given .proto file. - -#ifndef GOOGLE_PROTOBUF_COMPILER_CSHARP_GENERATOR_H__ -#define GOOGLE_PROTOBUF_COMPILER_CSHARP_GENERATOR_H__ - -#include - -#include - -#include - -namespace google { -namespace protobuf { -namespace compiler { -namespace csharp { - -// CodeGenerator implementation which generates a C# source file and -// header. If you create your own protocol compiler binary and you want -// it to support C# output, you can do so by registering an instance of this -// CodeGenerator with the CommandLineInterface in your main() function. -class PROTOC_EXPORT Generator : public CodeGenerator { - public: - Generator(); - ~Generator(); - bool Generate( - const FileDescriptor* file, - const std::string& parameter, - GeneratorContext* generator_context, - std::string* error) const override; - uint64_t GetSupportedFeatures() const override; -}; - -} // namespace csharp -} // namespace compiler -} // namespace protobuf -} // namespace google - -#include - -#endif // GOOGLE_PROTOBUF_COMPILER_CSHARP_GENERATOR_H__ diff --git a/extra/protobuf/protobuf-3.19.4/src/google/protobuf/compiler/csharp/csharp_generator_unittest.cc b/extra/protobuf/protobuf-3.19.4/src/google/protobuf/compiler/csharp/csharp_generator_unittest.cc deleted file mode 100644 index 5755fee00b17..000000000000 --- a/extra/protobuf/protobuf-3.19.4/src/google/protobuf/compiler/csharp/csharp_generator_unittest.cc +++ /dev/null @@ -1,70 +0,0 @@ -// Protocol Buffers - Google's data interchange format -// Copyright 2014 Google Inc. All rights reserved. -// https://developers.google.com/protocol-buffers/ -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// * Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// * Redistributions in binary form must reproduce the above -// copyright notice, this list of conditions and the following disclaimer -// in the documentation and/or other materials provided with the -// distribution. -// * Neither the name of Google Inc. nor the names of its -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -#include - -#include -#include -#include -#include - -#include -#include -#include - -namespace google { -namespace protobuf { -namespace compiler { -namespace csharp { -namespace { - -TEST(CSharpEnumValue, PascalCasedPrefixStripping) { - EXPECT_EQ("Bar", GetEnumValueName("Foo", "BAR")); - EXPECT_EQ("BarBaz", GetEnumValueName("Foo", "BAR_BAZ")); - EXPECT_EQ("Bar", GetEnumValueName("Foo", "FOO_BAR")); - EXPECT_EQ("Bar", GetEnumValueName("Foo", "FOO__BAR")); - EXPECT_EQ("BarBaz", GetEnumValueName("Foo", "FOO_BAR_BAZ")); - EXPECT_EQ("BarBaz", GetEnumValueName("Foo", "Foo_BarBaz")); - EXPECT_EQ("Bar", GetEnumValueName("FO_O", "FOO_BAR")); - EXPECT_EQ("Bar", GetEnumValueName("FOO", "F_O_O_BAR")); - EXPECT_EQ("Bar", GetEnumValueName("Foo", "BAR")); - EXPECT_EQ("BarBaz", GetEnumValueName("Foo", "BAR_BAZ")); - EXPECT_EQ("Foo", GetEnumValueName("Foo", "FOO")); - EXPECT_EQ("Foo", GetEnumValueName("Foo", "FOO___")); - // Identifiers can't start with digits - EXPECT_EQ("_2Bar", GetEnumValueName("Foo", "FOO_2_BAR")); - EXPECT_EQ("_2", GetEnumValueName("Foo", "FOO___2")); -} - -} // namespace -} // namespace csharp -} // namespace compiler -} // namespace protobuf -} // namespace google diff --git a/extra/protobuf/protobuf-3.19.4/src/google/protobuf/compiler/csharp/csharp_helpers.cc b/extra/protobuf/protobuf-3.19.4/src/google/protobuf/compiler/csharp/csharp_helpers.cc deleted file mode 100644 index 32ef3994f16e..000000000000 --- a/extra/protobuf/protobuf-3.19.4/src/google/protobuf/compiler/csharp/csharp_helpers.cc +++ /dev/null @@ -1,592 +0,0 @@ -// Protocol Buffers - Google's data interchange format -// Copyright 2008 Google Inc. All rights reserved. -// https://developers.google.com/protocol-buffers/ -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// * Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// * Redistributions in binary form must reproduce the above -// copyright notice, this list of conditions and the following disclaimer -// in the documentation and/or other materials provided with the -// distribution. -// * Neither the name of Google Inc. nor the names of its -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -// Author: kenton@google.com (Kenton Varda) -// Based on original Protocol Buffers design by -// Sanjay Ghemawat, Jeff Dean, and others. - -#include -#include -#include -#include - -#include -#include -#include -#include -#include -#include - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -namespace google { -namespace protobuf { -namespace compiler { -namespace csharp { - -CSharpType GetCSharpType(FieldDescriptor::Type type) { - switch (type) { - case FieldDescriptor::TYPE_INT32: - return CSHARPTYPE_INT32; - case FieldDescriptor::TYPE_INT64: - return CSHARPTYPE_INT64; - case FieldDescriptor::TYPE_UINT32: - return CSHARPTYPE_UINT32; - case FieldDescriptor::TYPE_UINT64: - return CSHARPTYPE_UINT32; - case FieldDescriptor::TYPE_SINT32: - return CSHARPTYPE_INT32; - case FieldDescriptor::TYPE_SINT64: - return CSHARPTYPE_INT64; - case FieldDescriptor::TYPE_FIXED32: - return CSHARPTYPE_UINT32; - case FieldDescriptor::TYPE_FIXED64: - return CSHARPTYPE_UINT64; - case FieldDescriptor::TYPE_SFIXED32: - return CSHARPTYPE_INT32; - case FieldDescriptor::TYPE_SFIXED64: - return CSHARPTYPE_INT64; - case FieldDescriptor::TYPE_FLOAT: - return CSHARPTYPE_FLOAT; - case FieldDescriptor::TYPE_DOUBLE: - return CSHARPTYPE_DOUBLE; - case FieldDescriptor::TYPE_BOOL: - return CSHARPTYPE_BOOL; - case FieldDescriptor::TYPE_ENUM: - return CSHARPTYPE_ENUM; - case FieldDescriptor::TYPE_STRING: - return CSHARPTYPE_STRING; - case FieldDescriptor::TYPE_BYTES: - return CSHARPTYPE_BYTESTRING; - case FieldDescriptor::TYPE_GROUP: - return CSHARPTYPE_MESSAGE; - case FieldDescriptor::TYPE_MESSAGE: - return CSHARPTYPE_MESSAGE; - - // No default because we want the compiler to complain if any new - // types are added. - } - GOOGLE_LOG(FATAL)<< "Can't get here."; - return (CSharpType) -1; -} - -std::string StripDotProto(const std::string& proto_file) { - int lastindex = proto_file.find_last_of("."); - return proto_file.substr(0, lastindex); -} - -std::string GetFileNamespace(const FileDescriptor* descriptor) { - if (descriptor->options().has_csharp_namespace()) { - return descriptor->options().csharp_namespace(); - } - return UnderscoresToCamelCase(descriptor->package(), true, true); -} - -// Returns the Pascal-cased last part of the proto file. For example, -// input of "google/protobuf/foo_bar.proto" would result in "FooBar". -std::string GetFileNameBase(const FileDescriptor* descriptor) { - std::string proto_file = descriptor->name(); - int lastslash = proto_file.find_last_of("/"); - std::string base = proto_file.substr(lastslash + 1); - return UnderscoresToPascalCase(StripDotProto(base)); -} - -std::string GetReflectionClassUnqualifiedName(const FileDescriptor* descriptor) { - // TODO: Detect collisions with existing messages, - // and append an underscore if necessary. - return GetFileNameBase(descriptor) + "Reflection"; -} - -std::string GetExtensionClassUnqualifiedName(const FileDescriptor* descriptor) { - // TODO: Detect collisions with existing messages, - // and append an underscore if necessary. - return GetFileNameBase(descriptor) + "Extensions"; -} - -// TODO(jtattermusch): can we reuse a utility function? -std::string UnderscoresToCamelCase(const std::string& input, - bool cap_next_letter, - bool preserve_period) { - std::string result; - // Note: I distrust ctype.h due to locales. - for (int i = 0; i < input.size(); i++) { - if ('a' <= input[i] && input[i] <= 'z') { - if (cap_next_letter) { - result += input[i] + ('A' - 'a'); - } else { - result += input[i]; - } - cap_next_letter = false; - } else if ('A' <= input[i] && input[i] <= 'Z') { - if (i == 0 && !cap_next_letter) { - // Force first letter to lower-case unless explicitly told to - // capitalize it. - result += input[i] + ('a' - 'A'); - } else { - // Capital letters after the first are left as-is. - result += input[i]; - } - cap_next_letter = false; - } else if ('0' <= input[i] && input[i] <= '9') { - result += input[i]; - cap_next_letter = true; - } else { - cap_next_letter = true; - if (input[i] == '.' && preserve_period) { - result += '.'; - } - } - } - // Add a trailing "_" if the name should be altered. - if (input.size() > 0 && input[input.size() - 1] == '#') { - result += '_'; - } - return result; -} - -std::string UnderscoresToPascalCase(const std::string& input) { - return UnderscoresToCamelCase(input, true); -} - -// Convert a string which is expected to be SHOUTY_CASE (but may not be *precisely* shouty) -// into a PascalCase string. Precise rules implemented: - -// Previous input character Current character Case -// Any Non-alphanumeric Skipped -// None - first char of input Alphanumeric Upper -// Non-letter (e.g. _ or 1) Alphanumeric Upper -// Numeric Alphanumeric Upper -// Lower letter Alphanumeric Same as current -// Upper letter Alphanumeric Lower -std::string ShoutyToPascalCase(const std::string& input) { - std::string result; - // Simple way of implementing "always start with upper" - char previous = '_'; - for (int i = 0; i < input.size(); i++) { - char current = input[i]; - if (!ascii_isalnum(current)) { - previous = current; - continue; - } - if (!ascii_isalnum(previous)) { - result += ascii_toupper(current); - } else if (ascii_isdigit(previous)) { - result += ascii_toupper(current); - } else if (ascii_islower(previous)) { - result += current; - } else { - result += ascii_tolower(current); - } - previous = current; - } - return result; -} - -// Attempt to remove a prefix from a value, ignoring casing and skipping underscores. -// (foo, foo_bar) => bar - underscore after prefix is skipped -// (FOO, foo_bar) => bar - casing is ignored -// (foo_bar, foobarbaz) => baz - underscore in prefix is ignored -// (foobar, foo_barbaz) => baz - underscore in value is ignored -// (foo, bar) => bar - prefix isn't matched; return original value -std::string TryRemovePrefix(const std::string& prefix, const std::string& value) { - // First normalize to a lower-case no-underscores prefix to match against - std::string prefix_to_match = ""; - for (size_t i = 0; i < prefix.size(); i++) { - if (prefix[i] != '_') { - prefix_to_match += ascii_tolower(prefix[i]); - } - } - - // This keeps track of how much of value we've consumed - size_t prefix_index, value_index; - for (prefix_index = 0, value_index = 0; - prefix_index < prefix_to_match.size() && value_index < value.size(); - value_index++) { - // Skip over underscores in the value - if (value[value_index] == '_') { - continue; - } - if (ascii_tolower(value[value_index]) != prefix_to_match[prefix_index++]) { - // Failed to match the prefix - bail out early. - return value; - } - } - - // If we didn't finish looking through the prefix, we can't strip it. - if (prefix_index < prefix_to_match.size()) { - return value; - } - - // Step over any underscores after the prefix - while (value_index < value.size() && value[value_index] == '_') { - value_index++; - } - - // If there's nothing left (e.g. it was a prefix with only underscores afterwards), don't strip. - if (value_index == value.size()) { - return value; - } - - return value.substr(value_index); -} - -// Format the enum value name in a pleasant way for C#: -// - Strip the enum name as a prefix if possible -// - Convert to PascalCase. -// For example, an enum called Color with a value of COLOR_BLUE should -// result in an enum value in C# called just Blue -std::string GetEnumValueName(const std::string& enum_name, const std::string& enum_value_name) { - std::string stripped = TryRemovePrefix(enum_name, enum_value_name); - std::string result = ShoutyToPascalCase(stripped); - // Just in case we have an enum name of FOO and a value of FOO_2... make sure the returned - // string is a valid identifier. - if (ascii_isdigit(result[0])) { - result = "_" + result; - } - return result; -} - -uint GetGroupEndTag(const Descriptor* descriptor) { - const Descriptor* containing_type = descriptor->containing_type(); - if (containing_type != NULL) { - const FieldDescriptor* field; - for (int i = 0; i < containing_type->field_count(); i++) { - field = containing_type->field(i); - if (field->type() == FieldDescriptor::Type::TYPE_GROUP && - field->message_type() == descriptor) { - return internal::WireFormatLite::MakeTag( - field->number(), internal::WireFormatLite::WIRETYPE_END_GROUP); - } - } - for (int i = 0; i < containing_type->extension_count(); i++) { - field = containing_type->extension(i); - if (field->type() == FieldDescriptor::Type::TYPE_GROUP && - field->message_type() == descriptor) { - return internal::WireFormatLite::MakeTag( - field->number(), internal::WireFormatLite::WIRETYPE_END_GROUP); - } - } - } else { - const FileDescriptor* containing_file = descriptor->file(); - if (containing_file != NULL) { - const FieldDescriptor* field; - for (int i = 0; i < containing_file->extension_count(); i++) { - field = containing_file->extension(i); - if (field->type() == FieldDescriptor::Type::TYPE_GROUP && - field->message_type() == descriptor) { - return internal::WireFormatLite::MakeTag( - field->number(), internal::WireFormatLite::WIRETYPE_END_GROUP); - } - } - } - } - - return 0; -} - -std::string ToCSharpName(const std::string& name, const FileDescriptor* file) { - std::string result = GetFileNamespace(file); - if (!result.empty()) { - result += '.'; - } - std::string classname; - if (file->package().empty()) { - classname = name; - } else { - // Strip the proto package from full_name since we've replaced it with - // the C# namespace. - classname = name.substr(file->package().size() + 1); - } - result += StringReplace(classname, ".", ".Types.", true); - return "global::" + result; -} - -std::string GetReflectionClassName(const FileDescriptor* descriptor) { - std::string result = GetFileNamespace(descriptor); - if (!result.empty()) { - result += '.'; - } - result += GetReflectionClassUnqualifiedName(descriptor); - return "global::" + result; -} - -std::string GetFullExtensionName(const FieldDescriptor* descriptor) { - if (descriptor->extension_scope()) { - return GetClassName(descriptor->extension_scope()) + ".Extensions." + GetPropertyName(descriptor); - } - else { - return GetExtensionClassUnqualifiedName(descriptor->file()) + "." + GetPropertyName(descriptor); - } -} - -std::string GetClassName(const Descriptor* descriptor) { - return ToCSharpName(descriptor->full_name(), descriptor->file()); -} - -std::string GetClassName(const EnumDescriptor* descriptor) { - return ToCSharpName(descriptor->full_name(), descriptor->file()); -} - -// Groups are hacky: The name of the field is just the lower-cased name -// of the group type. In C#, though, we would like to retain the original -// capitalization of the type name. -std::string GetFieldName(const FieldDescriptor* descriptor) { - if (descriptor->type() == FieldDescriptor::TYPE_GROUP) { - return descriptor->message_type()->name(); - } else { - return descriptor->name(); - } -} - -std::string GetFieldConstantName(const FieldDescriptor* field) { - return GetPropertyName(field) + "FieldNumber"; -} - -std::string GetPropertyName(const FieldDescriptor* descriptor) { - // TODO(jtattermusch): consider introducing csharp_property_name field option - std::string property_name = UnderscoresToPascalCase(GetFieldName(descriptor)); - // Avoid either our own type name or reserved names. Note that not all names - // are reserved - a field called to_string, write_to etc would still cause a problem. - // There are various ways of ending up with naming collisions, but we try to avoid obvious - // ones. - if (property_name == descriptor->containing_type()->name() - || property_name == "Types" - || property_name == "Descriptor") { - property_name += "_"; - } - return property_name; -} - -std::string GetOutputFile(const FileDescriptor* descriptor, - const std::string file_extension, - const bool generate_directories, - const std::string base_namespace, - std::string* error) { - std::string relative_filename = GetFileNameBase(descriptor) + file_extension; - if (!generate_directories) { - return relative_filename; - } - std::string ns = GetFileNamespace(descriptor); - std::string namespace_suffix = ns; - if (!base_namespace.empty()) { - // Check that the base_namespace is either equal to or a leading part of - // the file namespace. This isn't just a simple prefix; "Foo.B" shouldn't - // be regarded as a prefix of "Foo.Bar". The simplest option is to add "." - // to both. - std::string extended_ns = ns + "."; - if (extended_ns.find(base_namespace + ".") != 0) { - *error = "Namespace " + ns + " is not a prefix namespace of base namespace " + base_namespace; - return ""; // This will be ignored, because we've set an error. - } - namespace_suffix = ns.substr(base_namespace.length()); - if (namespace_suffix.find(".") == 0) { - namespace_suffix = namespace_suffix.substr(1); - } - } - - std::string namespace_dir = StringReplace(namespace_suffix, ".", "/", true); - if (!namespace_dir.empty()) { - namespace_dir += "/"; - } - return namespace_dir + relative_filename; -} - -// TODO: c&p from Java protoc plugin -// For encodings with fixed sizes, returns that size in bytes. Otherwise -// returns -1. -int GetFixedSize(FieldDescriptor::Type type) { - switch (type) { - case FieldDescriptor::TYPE_INT32 : return -1; - case FieldDescriptor::TYPE_INT64 : return -1; - case FieldDescriptor::TYPE_UINT32 : return -1; - case FieldDescriptor::TYPE_UINT64 : return -1; - case FieldDescriptor::TYPE_SINT32 : return -1; - case FieldDescriptor::TYPE_SINT64 : return -1; - case FieldDescriptor::TYPE_FIXED32 : return internal::WireFormatLite::kFixed32Size; - case FieldDescriptor::TYPE_FIXED64 : return internal::WireFormatLite::kFixed64Size; - case FieldDescriptor::TYPE_SFIXED32: return internal::WireFormatLite::kSFixed32Size; - case FieldDescriptor::TYPE_SFIXED64: return internal::WireFormatLite::kSFixed64Size; - case FieldDescriptor::TYPE_FLOAT : return internal::WireFormatLite::kFloatSize; - case FieldDescriptor::TYPE_DOUBLE : return internal::WireFormatLite::kDoubleSize; - - case FieldDescriptor::TYPE_BOOL : return internal::WireFormatLite::kBoolSize; - case FieldDescriptor::TYPE_ENUM : return -1; - - case FieldDescriptor::TYPE_STRING : return -1; - case FieldDescriptor::TYPE_BYTES : return -1; - case FieldDescriptor::TYPE_GROUP : return -1; - case FieldDescriptor::TYPE_MESSAGE : return -1; - - // No default because we want the compiler to complain if any new - // types are added. - } - GOOGLE_LOG(FATAL) << "Can't get here."; - return -1; -} - -static const char base64_chars[] = - "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"; - -std::string StringToBase64(const std::string& input) { - std::string result; - size_t remaining = input.size(); - const unsigned char *src = (const unsigned char*) input.c_str(); - while (remaining > 2) { - result += base64_chars[src[0] >> 2]; - result += base64_chars[((src[0] & 0x3) << 4) | (src[1] >> 4)]; - result += base64_chars[((src[1] & 0xf) << 2) | (src[2] >> 6)]; - result += base64_chars[src[2] & 0x3f]; - remaining -= 3; - src += 3; - } - switch (remaining) { - case 2: - result += base64_chars[src[0] >> 2]; - result += base64_chars[((src[0] & 0x3) << 4) | (src[1] >> 4)]; - result += base64_chars[(src[1] & 0xf) << 2]; - result += '='; - src += 2; - break; - case 1: - result += base64_chars[src[0] >> 2]; - result += base64_chars[((src[0] & 0x3) << 4)]; - result += '='; - result += '='; - src += 1; - break; - } - return result; -} - -std::string FileDescriptorToBase64(const FileDescriptor* descriptor) { - std::string fdp_bytes; - FileDescriptorProto fdp; - descriptor->CopyTo(&fdp); - fdp.SerializeToString(&fdp_bytes); - return StringToBase64(fdp_bytes); -} - -FieldGeneratorBase* CreateFieldGenerator(const FieldDescriptor* descriptor, - int presenceIndex, - const Options* options) { - switch (descriptor->type()) { - case FieldDescriptor::TYPE_GROUP: - case FieldDescriptor::TYPE_MESSAGE: - if (descriptor->is_repeated()) { - if (descriptor->is_map()) { - return new MapFieldGenerator(descriptor, presenceIndex, options); - } else { - return new RepeatedMessageFieldGenerator(descriptor, presenceIndex, options); - } - } else { - if (IsWrapperType(descriptor)) { - if (descriptor->real_containing_oneof()) { - return new WrapperOneofFieldGenerator(descriptor, presenceIndex, options); - } else { - return new WrapperFieldGenerator(descriptor, presenceIndex, options); - } - } else { - if (descriptor->real_containing_oneof()) { - return new MessageOneofFieldGenerator(descriptor, presenceIndex, options); - } else { - return new MessageFieldGenerator(descriptor, presenceIndex, options); - } - } - } - case FieldDescriptor::TYPE_ENUM: - if (descriptor->is_repeated()) { - return new RepeatedEnumFieldGenerator(descriptor, presenceIndex, options); - } else { - if (descriptor->real_containing_oneof()) { - return new EnumOneofFieldGenerator(descriptor, presenceIndex, options); - } else { - return new EnumFieldGenerator(descriptor, presenceIndex, options); - } - } - default: - if (descriptor->is_repeated()) { - return new RepeatedPrimitiveFieldGenerator(descriptor, presenceIndex, options); - } else { - if (descriptor->real_containing_oneof()) { - return new PrimitiveOneofFieldGenerator(descriptor, presenceIndex, options); - } else { - return new PrimitiveFieldGenerator(descriptor, presenceIndex, options); - } - } - } -} - -bool IsNullable(const FieldDescriptor* descriptor) { - if (descriptor->is_repeated()) { - return true; - } - - switch (descriptor->type()) { - case FieldDescriptor::TYPE_ENUM: - case FieldDescriptor::TYPE_DOUBLE: - case FieldDescriptor::TYPE_FLOAT: - case FieldDescriptor::TYPE_INT64: - case FieldDescriptor::TYPE_UINT64: - case FieldDescriptor::TYPE_INT32: - case FieldDescriptor::TYPE_FIXED64: - case FieldDescriptor::TYPE_FIXED32: - case FieldDescriptor::TYPE_BOOL: - case FieldDescriptor::TYPE_UINT32: - case FieldDescriptor::TYPE_SFIXED32: - case FieldDescriptor::TYPE_SFIXED64: - case FieldDescriptor::TYPE_SINT32: - case FieldDescriptor::TYPE_SINT64: - return false; - - case FieldDescriptor::TYPE_MESSAGE: - case FieldDescriptor::TYPE_GROUP: - case FieldDescriptor::TYPE_STRING: - case FieldDescriptor::TYPE_BYTES: - return true; - - default: - GOOGLE_LOG(FATAL) << "Unknown field type."; - return true; - } -} - -} // namespace csharp -} // namespace compiler -} // namespace protobuf -} // namespace google diff --git a/extra/protobuf/protobuf-3.19.4/src/google/protobuf/compiler/csharp/csharp_helpers.h b/extra/protobuf/protobuf-3.19.4/src/google/protobuf/compiler/csharp/csharp_helpers.h deleted file mode 100644 index a6009c8b1e4e..000000000000 --- a/extra/protobuf/protobuf-3.19.4/src/google/protobuf/compiler/csharp/csharp_helpers.h +++ /dev/null @@ -1,195 +0,0 @@ -// Protocol Buffers - Google's data interchange format -// Copyright 2008 Google Inc. All rights reserved. -// https://developers.google.com/protocol-buffers/ -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// * Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// * Redistributions in binary form must reproduce the above -// copyright notice, this list of conditions and the following disclaimer -// in the documentation and/or other materials provided with the -// distribution. -// * Neither the name of Google Inc. nor the names of its -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -// Author: kenton@google.com (Kenton Varda) -// Based on original Protocol Buffers design by -// Sanjay Ghemawat, Jeff Dean, and others. - -#ifndef GOOGLE_PROTOBUF_COMPILER_CSHARP_HELPERS_H__ -#define GOOGLE_PROTOBUF_COMPILER_CSHARP_HELPERS_H__ - -#include -#include -#include -#include -#include -#include -#include - -#include - -namespace google { -namespace protobuf { -namespace compiler { -namespace csharp { - -struct Options; -class FieldGeneratorBase; - -// TODO: start using this enum. -enum CSharpType { - CSHARPTYPE_INT32 = 1, - CSHARPTYPE_INT64 = 2, - CSHARPTYPE_UINT32 = 3, - CSHARPTYPE_UINT64 = 4, - CSHARPTYPE_FLOAT = 5, - CSHARPTYPE_DOUBLE = 6, - CSHARPTYPE_BOOL = 7, - CSHARPTYPE_STRING = 8, - CSHARPTYPE_BYTESTRING = 9, - CSHARPTYPE_MESSAGE = 10, - CSHARPTYPE_ENUM = 11, - MAX_CSHARPTYPE = 11 -}; - -// Converts field type to corresponding C# type. -CSharpType GetCSharpType(FieldDescriptor::Type type); - -std::string StripDotProto(const std::string& proto_file); - -// Gets unqualified name of the reflection class -std::string GetReflectionClassUnqualifiedName(const FileDescriptor* descriptor); -// Gets unqualified name of the extension class -std::string GetExtensionClassUnqualifiedName(const FileDescriptor* descriptor); - -std::string GetClassName(const EnumDescriptor* descriptor); - -std::string GetFieldName(const FieldDescriptor* descriptor); - -std::string GetFieldConstantName(const FieldDescriptor* field); - -std::string GetPropertyName(const FieldDescriptor* descriptor); - -int GetFixedSize(FieldDescriptor::Type type); - -std::string UnderscoresToCamelCase(const std::string& input, - bool cap_next_letter, - bool preserve_period); - -inline std::string UnderscoresToCamelCase(const std::string& input, bool cap_next_letter) { - return UnderscoresToCamelCase(input, cap_next_letter, false); -} - -std::string UnderscoresToPascalCase(const std::string& input); - -// Note that we wouldn't normally want to export this (we're not expecting -// it to be used outside libprotoc itself) but this exposes it for testing. -std::string PROTOC_EXPORT GetEnumValueName(const std::string& enum_name, - const std::string& enum_value_name); - -// TODO(jtattermusch): perhaps we could move this to strutil -std::string StringToBase64(const std::string& input); - -std::string FileDescriptorToBase64(const FileDescriptor* descriptor); - -FieldGeneratorBase* CreateFieldGenerator(const FieldDescriptor* descriptor, - int presenceIndex, - const Options* options); - -std::string GetFullExtensionName(const FieldDescriptor* descriptor); - -bool IsNullable(const FieldDescriptor* descriptor); - -// Determines whether the given message is a map entry message, -// i.e. one implicitly created by protoc due to a map field. -inline bool IsMapEntryMessage(const Descriptor* descriptor) { - return descriptor->options().map_entry(); -} - -// Checks if this descriptor is for a group and gets its end tag or 0 if it's not a group -uint GetGroupEndTag(const Descriptor* descriptor); - -// Determines whether we're generating code for the proto representation of -// descriptors etc, for use in the runtime. This is the only type which is -// allowed to use proto2 syntax, and it generates internal classes. -inline bool IsDescriptorProto(const FileDescriptor* descriptor) { - return descriptor->name() == "google/protobuf/descriptor.proto"; -} - -// Determines whether the given message is an options message within descriptor.proto. -inline bool IsDescriptorOptionMessage(const Descriptor* descriptor) { - if (!IsDescriptorProto(descriptor->file())) { - return false; - } - const std::string name = descriptor->full_name(); - return name == "google.protobuf.FileOptions" || - name == "google.protobuf.MessageOptions" || - name == "google.protobuf.FieldOptions" || - name == "google.protobuf.OneofOptions" || - name == "google.protobuf.EnumOptions" || - name == "google.protobuf.EnumValueOptions" || - name == "google.protobuf.ServiceOptions" || - name == "google.protobuf.MethodOptions"; -} - -inline bool IsWrapperType(const FieldDescriptor* descriptor) { - return descriptor->type() == FieldDescriptor::TYPE_MESSAGE && - descriptor->message_type()->file()->name() == "google/protobuf/wrappers.proto"; -} - -inline bool IsProto2(const FileDescriptor* descriptor) { - return descriptor->syntax() == FileDescriptor::SYNTAX_PROTO2; -} - -inline bool SupportsPresenceApi(const FieldDescriptor* descriptor) { - // Unlike most languages, we don't generate Has/Clear members for message - // types, because they can always be set to null in C#. They're not really - // needed for oneof fields in proto2 either, as everything can be done via - // oneof case, but we follow the convention from other languages. Proto3 - // oneof fields never have Has/Clear members - but will also never have - // the explicit optional keyword either. - // - // None of the built-in helpers (descriptor->has_presence() etc) describe - // quite the behavior we want, so the rules are explicit below. - - if (descriptor->is_repeated() || - descriptor->type() == FieldDescriptor::TYPE_MESSAGE) { - return false; - } - // has_optional_keyword() has more complex rules for proto2, but that - // doesn't matter given the first part of this condition. - return IsProto2(descriptor->file()) || descriptor->has_optional_keyword(); -} - -inline bool RequiresPresenceBit(const FieldDescriptor* descriptor) { - return SupportsPresenceApi(descriptor) && - !IsNullable(descriptor) && - !descriptor->is_extension() && - !descriptor->real_containing_oneof(); -} - -} // namespace csharp -} // namespace compiler -} // namespace protobuf -} // namespace google - -#include - -#endif // GOOGLE_PROTOBUF_COMPILER_CSHARP_HELPERS_H__ diff --git a/extra/protobuf/protobuf-3.19.4/src/google/protobuf/compiler/csharp/csharp_map_field.cc b/extra/protobuf/protobuf-3.19.4/src/google/protobuf/compiler/csharp/csharp_map_field.cc deleted file mode 100644 index 44c13e2f637a..000000000000 --- a/extra/protobuf/protobuf-3.19.4/src/google/protobuf/compiler/csharp/csharp_map_field.cc +++ /dev/null @@ -1,152 +0,0 @@ -// Protocol Buffers - Google's data interchange format -// Copyright 2015 Google Inc. All rights reserved. -// https://developers.google.com/protocol-buffers/ -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// * Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// * Redistributions in binary form must reproduce the above -// copyright notice, this list of conditions and the following disclaimer -// in the documentation and/or other materials provided with the -// distribution. -// * Neither the name of Google Inc. nor the names of its -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -#include - -#include -#include -#include -#include -#include -#include - -#include -#include -#include - -namespace google { -namespace protobuf { -namespace compiler { -namespace csharp { - -MapFieldGenerator::MapFieldGenerator(const FieldDescriptor* descriptor, - int presenceIndex, - const Options* options) - : FieldGeneratorBase(descriptor, presenceIndex, options) { -} - -MapFieldGenerator::~MapFieldGenerator() { -} - -void MapFieldGenerator::GenerateMembers(io::Printer* printer) { - const FieldDescriptor* key_descriptor = - descriptor_->message_type()->FindFieldByName("key"); - const FieldDescriptor* value_descriptor = - descriptor_->message_type()->FindFieldByName("value"); - variables_["key_type_name"] = type_name(key_descriptor); - variables_["value_type_name"] = type_name(value_descriptor); - std::unique_ptr key_generator( - CreateFieldGenerator(key_descriptor, 1, this->options())); - std::unique_ptr value_generator( - CreateFieldGenerator(value_descriptor, 2, this->options())); - - printer->Print( - variables_, - "private static readonly pbc::MapField<$key_type_name$, $value_type_name$>.Codec _map_$name$_codec\n" - " = new pbc::MapField<$key_type_name$, $value_type_name$>.Codec("); - key_generator->GenerateCodecCode(printer); - printer->Print(", "); - value_generator->GenerateCodecCode(printer); - printer->Print( - variables_, - ", $tag$);\n" - "private readonly pbc::MapField<$key_type_name$, $value_type_name$> $name$_ = new pbc::MapField<$key_type_name$, $value_type_name$>();\n"); - WritePropertyDocComment(printer, descriptor_); - AddPublicMemberAttributes(printer); - printer->Print( - variables_, - "$access_level$ pbc::MapField<$key_type_name$, $value_type_name$> $property_name$ {\n" - " get { return $name$_; }\n" - "}\n"); -} - -void MapFieldGenerator::GenerateMergingCode(io::Printer* printer) { - printer->Print( - variables_, - "$name$_.Add(other.$name$_);\n"); -} - -void MapFieldGenerator::GenerateParsingCode(io::Printer* printer) { - GenerateParsingCode(printer, true); -} - -void MapFieldGenerator::GenerateParsingCode(io::Printer* printer, bool use_parse_context) { - printer->Print( - variables_, - use_parse_context - ? "$name$_.AddEntriesFrom(ref input, _map_$name$_codec);\n" - : "$name$_.AddEntriesFrom(input, _map_$name$_codec);\n"); -} - -void MapFieldGenerator::GenerateSerializationCode(io::Printer* printer) { - GenerateSerializationCode(printer, true); -} - -void MapFieldGenerator::GenerateSerializationCode(io::Printer* printer, bool use_write_context) { - printer->Print( - variables_, - use_write_context - ? "$name$_.WriteTo(ref output, _map_$name$_codec);\n" - : "$name$_.WriteTo(output, _map_$name$_codec);\n"); -} - -void MapFieldGenerator::GenerateSerializedSizeCode(io::Printer* printer) { - printer->Print( - variables_, - "size += $name$_.CalculateSize(_map_$name$_codec);\n"); -} - -void MapFieldGenerator::WriteHash(io::Printer* printer) { - printer->Print( - variables_, - "hash ^= $property_name$.GetHashCode();\n"); -} -void MapFieldGenerator::WriteEquals(io::Printer* printer) { - printer->Print( - variables_, - "if (!$property_name$.Equals(other.$property_name$)) return false;\n"); -} - -void MapFieldGenerator::WriteToString(io::Printer* printer) { - // TODO: If we ever actually use ToString, we'll need to impleme this... -} - -void MapFieldGenerator::GenerateCloningCode(io::Printer* printer) { - printer->Print(variables_, - "$name$_ = other.$name$_.Clone();\n"); -} - -void MapFieldGenerator::GenerateFreezingCode(io::Printer* printer) { -} - -} // namespace csharp -} // namespace compiler -} // namespace protobuf -} // namespace google diff --git a/extra/protobuf/protobuf-3.19.4/src/google/protobuf/compiler/csharp/csharp_map_field.h b/extra/protobuf/protobuf-3.19.4/src/google/protobuf/compiler/csharp/csharp_map_field.h deleted file mode 100644 index 9b5e214e6d9a..000000000000 --- a/extra/protobuf/protobuf-3.19.4/src/google/protobuf/compiler/csharp/csharp_map_field.h +++ /dev/null @@ -1,75 +0,0 @@ -// Protocol Buffers - Google's data interchange format -// Copyright 2008 Google Inc. All rights reserved. -// https://developers.google.com/protocol-buffers/ -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// * Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// * Redistributions in binary form must reproduce the above -// copyright notice, this list of conditions and the following disclaimer -// in the documentation and/or other materials provided with the -// distribution. -// * Neither the name of Google Inc. nor the names of its -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -#ifndef GOOGLE_PROTOBUF_COMPILER_CSHARP_MAP_FIELD_H__ -#define GOOGLE_PROTOBUF_COMPILER_CSHARP_MAP_FIELD_H__ - -#include - -#include -#include - -namespace google { -namespace protobuf { -namespace compiler { -namespace csharp { - -class MapFieldGenerator : public FieldGeneratorBase { - public: - MapFieldGenerator(const FieldDescriptor* descriptor, - int presenceIndex, - const Options* options); - ~MapFieldGenerator(); - - MapFieldGenerator(const MapFieldGenerator&) = delete; - MapFieldGenerator& operator=(const MapFieldGenerator&) = delete; - - virtual void GenerateCloningCode(io::Printer* printer) override; - virtual void GenerateFreezingCode(io::Printer* printer) override; - virtual void GenerateMembers(io::Printer* printer) override; - virtual void GenerateMergingCode(io::Printer* printer) override; - virtual void GenerateParsingCode(io::Printer* printer) override; - virtual void GenerateParsingCode(io::Printer* printer, bool use_parse_context) override; - virtual void GenerateSerializationCode(io::Printer* printer) override; - virtual void GenerateSerializationCode(io::Printer* printer, bool use_write_context) override; - virtual void GenerateSerializedSizeCode(io::Printer* printer) override; - - virtual void WriteHash(io::Printer* printer) override; - virtual void WriteEquals(io::Printer* printer) override; - virtual void WriteToString(io::Printer* printer) override; -}; - -} // namespace csharp -} // namespace compiler -} // namespace protobuf -} // namespace google - -#endif // GOOGLE_PROTOBUF_COMPILER_CSHARP_MAP_FIELD_H__ - diff --git a/extra/protobuf/protobuf-3.19.4/src/google/protobuf/compiler/csharp/csharp_message.cc b/extra/protobuf/protobuf-3.19.4/src/google/protobuf/compiler/csharp/csharp_message.cc deleted file mode 100644 index 998087492eb8..000000000000 --- a/extra/protobuf/protobuf-3.19.4/src/google/protobuf/compiler/csharp/csharp_message.cc +++ /dev/null @@ -1,779 +0,0 @@ -// Protocol Buffers - Google's data interchange format -// Copyright 2008 Google Inc. All rights reserved. -// https://developers.google.com/protocol-buffers/ -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// * Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// * Redistributions in binary form must reproduce the above -// copyright notice, this list of conditions and the following disclaimer -// in the documentation and/or other materials provided with the -// distribution. -// * Neither the name of Google Inc. nor the names of its -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -#include -#include -#include - -#include -#include -#include -#include -#include -#include -#include -#include - -#include -#include -#include -#include -#include -#include -#include - -namespace google { -namespace protobuf { -namespace compiler { -namespace csharp { - -bool CompareFieldNumbers(const FieldDescriptor* d1, const FieldDescriptor* d2) { - return d1->number() < d2->number(); -} - -MessageGenerator::MessageGenerator(const Descriptor* descriptor, - const Options* options) - : SourceGeneratorBase(options), - descriptor_(descriptor), - has_bit_field_count_(0), - end_tag_(GetGroupEndTag(descriptor)), - has_extension_ranges_(descriptor->extension_range_count() > 0) { - // fields by number - for (int i = 0; i < descriptor_->field_count(); i++) { - fields_by_number_.push_back(descriptor_->field(i)); - } - std::sort(fields_by_number_.begin(), fields_by_number_.end(), - CompareFieldNumbers); - - int presence_bit_count = 0; - for (int i = 0; i < descriptor_->field_count(); i++) { - const FieldDescriptor* field = descriptor_->field(i); - if (RequiresPresenceBit(field)) { - presence_bit_count++; - if (has_bit_field_count_ == 0 || (presence_bit_count % 32) == 0) { - has_bit_field_count_++; - } - } - } -} - -MessageGenerator::~MessageGenerator() { -} - -std::string MessageGenerator::class_name() { - return descriptor_->name(); -} - -std::string MessageGenerator::full_class_name() { - return GetClassName(descriptor_); -} - -const std::vector& MessageGenerator::fields_by_number() { - return fields_by_number_; -} - -void MessageGenerator::AddDeprecatedFlag(io::Printer* printer) { - if (descriptor_->options().deprecated()) { - printer->Print("[global::System.ObsoleteAttribute]\n"); - } -} - -void MessageGenerator::AddSerializableAttribute(io::Printer* printer) { - if (this->options()->serializable) { - printer->Print("[global::System.SerializableAttribute]\n"); - } -} - -void MessageGenerator::Generate(io::Printer* printer) { - std::map vars; - vars["class_name"] = class_name(); - vars["access_level"] = class_access_level(); - - WriteMessageDocComment(printer, descriptor_); - AddDeprecatedFlag(printer); - AddSerializableAttribute(printer); - - printer->Print( - vars, - "$access_level$ sealed partial class $class_name$ : "); - - if (has_extension_ranges_) { - printer->Print(vars, "pb::IExtendableMessage<$class_name$>\n"); - } - else { - printer->Print(vars, "pb::IMessage<$class_name$>\n"); - } - printer->Print("#if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE\n"); - printer->Print(" , pb::IBufferMessage\n"); - printer->Print("#endif\n"); - printer->Print("{\n"); - printer->Indent(); - - // All static fields and properties - printer->Print( - vars, - "private static readonly pb::MessageParser<$class_name$> _parser = new pb::MessageParser<$class_name$>(() => new $class_name$());\n"); - - printer->Print( - "private pb::UnknownFieldSet _unknownFields;\n"); - - if (has_extension_ranges_) { - if (IsDescriptorProto(descriptor_->file())) { - printer->Print(vars, "internal pb::ExtensionSet<$class_name$> _extensions;\n"); // CustomOptions compatibility - } else { - printer->Print(vars, "private pb::ExtensionSet<$class_name$> _extensions;\n"); - } - - // a read-only property for fast - // retrieval of the set in IsInitialized - printer->Print(vars, - "private pb::ExtensionSet<$class_name$> _Extensions { get { " - "return _extensions; } }\n"); - } - - for (int i = 0; i < has_bit_field_count_; i++) { - // don't use arrays since all arrays are heap allocated, saving allocations - // use ints instead of bytes since bytes lack bitwise operators, saving casts - printer->Print("private int _hasBits$i$;\n", "i", StrCat(i)); - } - - WriteGeneratedCodeAttributes(printer); - - printer->Print( - vars, - "public static pb::MessageParser<$class_name$> Parser { get { return _parser; } }\n\n"); - - // Access the message descriptor via the relevant file descriptor or containing message descriptor. - if (!descriptor_->containing_type()) { - vars["descriptor_accessor"] = GetReflectionClassName(descriptor_->file()) - + ".Descriptor.MessageTypes[" + StrCat(descriptor_->index()) + "]"; - } else { - vars["descriptor_accessor"] = GetClassName(descriptor_->containing_type()) - + ".Descriptor.NestedTypes[" + StrCat(descriptor_->index()) + "]"; - } - - WriteGeneratedCodeAttributes(printer); - printer->Print( - vars, - "public static pbr::MessageDescriptor Descriptor {\n" - " get { return $descriptor_accessor$; }\n" - "}\n" - "\n"); - WriteGeneratedCodeAttributes(printer); - printer->Print( - vars, - "pbr::MessageDescriptor pb::IMessage.Descriptor {\n" - " get { return Descriptor; }\n" - "}\n" - "\n"); - - // Parameterless constructor and partial OnConstruction method. - WriteGeneratedCodeAttributes(printer); - printer->Print( - vars, - "public $class_name$() {\n" - " OnConstruction();\n" - "}\n\n" - "partial void OnConstruction();\n\n"); - - GenerateCloningCode(printer); - GenerateFreezingCode(printer); - - // Fields/properties - for (int i = 0; i < descriptor_->field_count(); i++) { - const FieldDescriptor* fieldDescriptor = descriptor_->field(i); - - // Rats: we lose the debug comment here :( - printer->Print( - "/// Field number for the \"$field_name$\" field.\n" - "public const int $field_constant_name$ = $index$;\n", - "field_name", fieldDescriptor->name(), - "field_constant_name", GetFieldConstantName(fieldDescriptor), - "index", StrCat(fieldDescriptor->number())); - std::unique_ptr generator( - CreateFieldGeneratorInternal(fieldDescriptor)); - generator->GenerateMembers(printer); - printer->Print("\n"); - } - - // oneof properties (for real oneofs, which come before synthetic ones) - for (int i = 0; i < descriptor_->real_oneof_decl_count(); i++) { - const OneofDescriptor* oneof = descriptor_->oneof_decl(i); - vars["name"] = UnderscoresToCamelCase(oneof->name(), false); - vars["property_name"] = UnderscoresToCamelCase(oneof->name(), true); - vars["original_name"] = oneof->name(); - printer->Print( - vars, - "private object $name$_;\n" - "/// Enum of possible cases for the \"$original_name$\" oneof.\n" - "public enum $property_name$OneofCase {\n"); - printer->Indent(); - printer->Print("None = 0,\n"); - for (int j = 0; j < oneof->field_count(); j++) { - const FieldDescriptor* field = oneof->field(j); - printer->Print("$field_property_name$ = $index$,\n", - "field_property_name", GetPropertyName(field), - "index", StrCat(field->number())); - } - printer->Outdent(); - printer->Print("}\n"); - // TODO: Should we put the oneof .proto comments here? - // It's unclear exactly where they should go. - printer->Print( - vars, - "private $property_name$OneofCase $name$Case_ = $property_name$OneofCase.None;\n"); - WriteGeneratedCodeAttributes(printer); - printer->Print( - vars, - "public $property_name$OneofCase $property_name$Case {\n" - " get { return $name$Case_; }\n" - "}\n\n"); - WriteGeneratedCodeAttributes(printer); - printer->Print( - vars, - "public void Clear$property_name$() {\n" - " $name$Case_ = $property_name$OneofCase.None;\n" - " $name$_ = null;\n" - "}\n\n"); - } - - // Standard methods - GenerateFrameworkMethods(printer); - GenerateMessageSerializationMethods(printer); - GenerateMergingMethods(printer); - - if (has_extension_ranges_) { - printer->Print( - vars, - "public TValue GetExtension(pb::Extension<$class_name$, " - "TValue> extension) {\n" - " return pb::ExtensionSet.Get(ref _extensions, extension);\n" - "}\n" - "public pbc::RepeatedField " - "GetExtension(pb::RepeatedExtension<$class_name$, TValue> " - "extension) {\n" - " return pb::ExtensionSet.Get(ref _extensions, extension);\n" - "}\n" - "public pbc::RepeatedField " - "GetOrInitializeExtension(pb::RepeatedExtension<$class_name$, " - "TValue> extension) {\n" - " return pb::ExtensionSet.GetOrInitialize(ref _extensions, " - "extension);\n" - "}\n" - "public void SetExtension(pb::Extension<$class_name$, TValue> " - "extension, TValue value) {\n" - " pb::ExtensionSet.Set(ref _extensions, extension, value);\n" - "}\n" - "public bool HasExtension(pb::Extension<$class_name$, TValue> " - "extension) {\n" - " return pb::ExtensionSet.Has(ref _extensions, extension);\n" - "}\n" - "public void ClearExtension(pb::Extension<$class_name$, " - "TValue> extension) {\n" - " pb::ExtensionSet.Clear(ref _extensions, extension);\n" - "}\n" - "public void " - "ClearExtension(pb::RepeatedExtension<$class_name$, TValue> " - "extension) {\n" - " pb::ExtensionSet.Clear(ref _extensions, extension);\n" - "}\n\n"); - } - - // Nested messages and enums - if (HasNestedGeneratedTypes()) { - printer->Print( - vars, - "#region Nested types\n" - "/// Container for nested types declared in the $class_name$ message type.\n"); - WriteGeneratedCodeAttributes(printer); - printer->Print("public static partial class Types {\n"); - printer->Indent(); - for (int i = 0; i < descriptor_->enum_type_count(); i++) { - EnumGenerator enumGenerator(descriptor_->enum_type(i), this->options()); - enumGenerator.Generate(printer); - } - for (int i = 0; i < descriptor_->nested_type_count(); i++) { - // Don't generate nested types for maps... - if (!IsMapEntryMessage(descriptor_->nested_type(i))) { - MessageGenerator messageGenerator( - descriptor_->nested_type(i), this->options()); - messageGenerator.Generate(printer); - } - } - printer->Outdent(); - printer->Print("}\n" - "#endregion\n" - "\n"); - } - - if (descriptor_->extension_count() > 0) { - printer->Print( - vars, - "#region Extensions\n" - "/// Container for extensions for other messages declared in the $class_name$ message type.\n"); - WriteGeneratedCodeAttributes(printer); - printer->Print("public static partial class Extensions {\n"); - printer->Indent(); - for (int i = 0; i < descriptor_->extension_count(); i++) { - std::unique_ptr generator( - CreateFieldGeneratorInternal(descriptor_->extension(i))); - generator->GenerateExtensionCode(printer); - } - printer->Outdent(); - printer->Print( - "}\n" - "#endregion\n" - "\n"); - } - - printer->Outdent(); - printer->Print("}\n"); - printer->Print("\n"); -} - -// Helper to work out whether we need to generate a class to hold nested types/enums. -// Only tricky because we don't want to generate map entry types. -bool MessageGenerator::HasNestedGeneratedTypes() -{ - if (descriptor_->enum_type_count() > 0) { - return true; - } - for (int i = 0; i < descriptor_->nested_type_count(); i++) { - if (!IsMapEntryMessage(descriptor_->nested_type(i))) { - return true; - } - } - return false; -} - -void MessageGenerator::GenerateCloningCode(io::Printer* printer) { - std::map vars; - WriteGeneratedCodeAttributes(printer); - vars["class_name"] = class_name(); - printer->Print( - vars, - "public $class_name$($class_name$ other) : this() {\n"); - printer->Indent(); - for (int i = 0; i < has_bit_field_count_; i++) { - printer->Print("_hasBits$i$ = other._hasBits$i$;\n", "i", StrCat(i)); - } - // Clone non-oneof fields first (treating optional proto3 fields as non-oneof) - for (int i = 0; i < descriptor_->field_count(); i++) { - const FieldDescriptor* field = descriptor_->field(i); - if (field->real_containing_oneof()) { - continue; - } - std::unique_ptr generator(CreateFieldGeneratorInternal(field)); - generator->GenerateCloningCode(printer); - } - // Clone just the right field for each real oneof - for (int i = 0; i < descriptor_->real_oneof_decl_count(); ++i) { - const OneofDescriptor* oneof = descriptor_->oneof_decl(i); - vars["name"] = UnderscoresToCamelCase(oneof->name(), false); - vars["property_name"] = UnderscoresToCamelCase(oneof->name(), true); - printer->Print(vars, "switch (other.$property_name$Case) {\n"); - printer->Indent(); - for (int j = 0; j < oneof->field_count(); j++) { - const FieldDescriptor* field = oneof->field(j); - std::unique_ptr generator(CreateFieldGeneratorInternal(field)); - vars["field_property_name"] = GetPropertyName(field); - printer->Print( - vars, - "case $property_name$OneofCase.$field_property_name$:\n"); - printer->Indent(); - generator->GenerateCloningCode(printer); - printer->Print("break;\n"); - printer->Outdent(); - } - printer->Outdent(); - printer->Print("}\n\n"); - } - // Clone unknown fields - printer->Print( - "_unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields);\n"); - if (has_extension_ranges_) { - printer->Print( - "_extensions = pb::ExtensionSet.Clone(other._extensions);\n"); - } - - printer->Outdent(); - printer->Print("}\n\n"); - - WriteGeneratedCodeAttributes(printer); - printer->Print( - vars, - "public $class_name$ Clone() {\n" - " return new $class_name$(this);\n" - "}\n\n"); -} - -void MessageGenerator::GenerateFreezingCode(io::Printer* printer) { -} - -void MessageGenerator::GenerateFrameworkMethods(io::Printer* printer) { - std::map vars; - vars["class_name"] = class_name(); - - // Equality - WriteGeneratedCodeAttributes(printer); - printer->Print( - vars, - "public override bool Equals(object other) {\n" - " return Equals(other as $class_name$);\n" - "}\n\n"); - WriteGeneratedCodeAttributes(printer); - printer->Print( - vars, - "public bool Equals($class_name$ other) {\n" - " if (ReferenceEquals(other, null)) {\n" - " return false;\n" - " }\n" - " if (ReferenceEquals(other, this)) {\n" - " return true;\n" - " }\n"); - printer->Indent(); - for (int i = 0; i < descriptor_->field_count(); i++) { - std::unique_ptr generator( - CreateFieldGeneratorInternal(descriptor_->field(i))); - generator->WriteEquals(printer); - } - for (int i = 0; i < descriptor_->real_oneof_decl_count(); i++) { - printer->Print("if ($property_name$Case != other.$property_name$Case) return false;\n", - "property_name", UnderscoresToCamelCase(descriptor_->oneof_decl(i)->name(), true)); - } - if (has_extension_ranges_) { - printer->Print( - "if (!Equals(_extensions, other._extensions)) {\n" - " return false;\n" - "}\n"); - } - printer->Outdent(); - printer->Print( - " return Equals(_unknownFields, other._unknownFields);\n" - "}\n\n"); - - // GetHashCode - // Start with a non-zero value to easily distinguish between null and "empty" messages. - WriteGeneratedCodeAttributes(printer); - printer->Print( - "public override int GetHashCode() {\n" - " int hash = 1;\n"); - printer->Indent(); - for (int i = 0; i < descriptor_->field_count(); i++) { - std::unique_ptr generator( - CreateFieldGeneratorInternal(descriptor_->field(i))); - generator->WriteHash(printer); - } - for (int i = 0; i < descriptor_->real_oneof_decl_count(); i++) { - printer->Print("hash ^= (int) $name$Case_;\n", - "name", UnderscoresToCamelCase(descriptor_->oneof_decl(i)->name(), false)); - } - if (has_extension_ranges_) { - printer->Print( - "if (_extensions != null) {\n" - " hash ^= _extensions.GetHashCode();\n" - "}\n"); - } - printer->Print( - "if (_unknownFields != null) {\n" - " hash ^= _unknownFields.GetHashCode();\n" - "}\n" - "return hash;\n"); - printer->Outdent(); - printer->Print("}\n\n"); - - WriteGeneratedCodeAttributes(printer); - printer->Print( - "public override string ToString() {\n" - " return pb::JsonFormatter.ToDiagnosticString(this);\n" - "}\n\n"); -} - -void MessageGenerator::GenerateMessageSerializationMethods(io::Printer* printer) { - WriteGeneratedCodeAttributes(printer); - printer->Print( - "public void WriteTo(pb::CodedOutputStream output) {\n"); - printer->Print("#if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE\n"); - printer->Indent(); - printer->Print("output.WriteRawMessage(this);\n"); - printer->Outdent(); - printer->Print("#else\n"); - printer->Indent(); - GenerateWriteToBody(printer, false); - printer->Outdent(); - printer->Print("#endif\n"); - printer->Print("}\n\n"); - - printer->Print("#if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE\n"); - WriteGeneratedCodeAttributes(printer); - printer->Print("void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) {\n"); - printer->Indent(); - GenerateWriteToBody(printer, true); - printer->Outdent(); - printer->Print("}\n"); - printer->Print("#endif\n\n"); - - WriteGeneratedCodeAttributes(printer); - printer->Print( - "public int CalculateSize() {\n"); - printer->Indent(); - printer->Print("int size = 0;\n"); - for (int i = 0; i < descriptor_->field_count(); i++) { - std::unique_ptr generator( - CreateFieldGeneratorInternal(descriptor_->field(i))); - generator->GenerateSerializedSizeCode(printer); - } - - if (has_extension_ranges_) { - printer->Print( - "if (_extensions != null) {\n" - " size += _extensions.CalculateSize();\n" - "}\n"); - } - - printer->Print( - "if (_unknownFields != null) {\n" - " size += _unknownFields.CalculateSize();\n" - "}\n"); - - printer->Print("return size;\n"); - printer->Outdent(); - printer->Print("}\n\n"); -} - -void MessageGenerator::GenerateWriteToBody(io::Printer* printer, bool use_write_context) { - // Serialize all the fields - for (int i = 0; i < fields_by_number().size(); i++) { - std::unique_ptr generator( - CreateFieldGeneratorInternal(fields_by_number()[i])); - generator->GenerateSerializationCode(printer, use_write_context); - } - - if (has_extension_ranges_) { - // Serialize extensions - printer->Print( - use_write_context - ? "if (_extensions != null) {\n" - " _extensions.WriteTo(ref output);\n" - "}\n" - : "if (_extensions != null) {\n" - " _extensions.WriteTo(output);\n" - "}\n"); - } - - // Serialize unknown fields - printer->Print( - use_write_context - ? "if (_unknownFields != null) {\n" - " _unknownFields.WriteTo(ref output);\n" - "}\n" - : "if (_unknownFields != null) {\n" - " _unknownFields.WriteTo(output);\n" - "}\n"); - - // TODO(jonskeet): Memoize size of frozen messages? -} - -void MessageGenerator::GenerateMergingMethods(io::Printer* printer) { - // Note: These are separate from GenerateMessageSerializationMethods() - // because they need to be generated even for messages that are optimized - // for code size. - std::map vars; - vars["class_name"] = class_name(); - - WriteGeneratedCodeAttributes(printer); - printer->Print( - vars, - "public void MergeFrom($class_name$ other) {\n"); - printer->Indent(); - printer->Print( - "if (other == null) {\n" - " return;\n" - "}\n"); - // Merge non-oneof fields, treating optional proto3 fields as normal fields - for (int i = 0; i < descriptor_->field_count(); i++) { - const FieldDescriptor* field = descriptor_->field(i); - if (field->real_containing_oneof()) { - continue; - } - std::unique_ptr generator(CreateFieldGeneratorInternal(field)); - generator->GenerateMergingCode(printer); - } - // Merge oneof fields (for non-synthetic oneofs) - for (int i = 0; i < descriptor_->real_oneof_decl_count(); ++i) { - const OneofDescriptor* oneof = descriptor_->oneof_decl(i); - vars["name"] = UnderscoresToCamelCase(oneof->name(), false); - vars["property_name"] = UnderscoresToCamelCase(oneof->name(), true); - printer->Print(vars, "switch (other.$property_name$Case) {\n"); - printer->Indent(); - for (int j = 0; j < oneof->field_count(); j++) { - const FieldDescriptor* field = oneof->field(j); - vars["field_property_name"] = GetPropertyName(field); - printer->Print( - vars, - "case $property_name$OneofCase.$field_property_name$:\n"); - printer->Indent(); - std::unique_ptr generator(CreateFieldGeneratorInternal(field)); - generator->GenerateMergingCode(printer); - printer->Print("break;\n"); - printer->Outdent(); - } - printer->Outdent(); - printer->Print("}\n\n"); - } - // Merge extensions - if (has_extension_ranges_) { - printer->Print("pb::ExtensionSet.MergeFrom(ref _extensions, other._extensions);\n"); - } - - // Merge unknown fields. - printer->Print( - "_unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields);\n"); - - printer->Outdent(); - printer->Print("}\n\n"); - - WriteGeneratedCodeAttributes(printer); - printer->Print("public void MergeFrom(pb::CodedInputStream input) {\n"); - printer->Print("#if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE\n"); - printer->Indent(); - printer->Print("input.ReadRawMessage(this);\n"); - printer->Outdent(); - printer->Print("#else\n"); - printer->Indent(); - GenerateMainParseLoop(printer, false); - printer->Outdent(); - printer->Print("#endif\n"); - printer->Print("}\n\n"); - - printer->Print("#if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE\n"); - WriteGeneratedCodeAttributes(printer); - printer->Print("void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) {\n"); - printer->Indent(); - GenerateMainParseLoop(printer, true); - printer->Outdent(); - printer->Print("}\n"); // method - printer->Print("#endif\n\n"); - -} - -void MessageGenerator::GenerateMainParseLoop(io::Printer* printer, bool use_parse_context) { - std::map vars; - vars["maybe_ref_input"] = use_parse_context ? "ref input" : "input"; - - printer->Print( - "uint tag;\n" - "while ((tag = input.ReadTag()) != 0) {\n" - " switch(tag) {\n"); - printer->Indent(); - printer->Indent(); - if (end_tag_ != 0) { - printer->Print( - "case $end_tag$:\n" - " return;\n", - "end_tag", StrCat(end_tag_)); - } - if (has_extension_ranges_) { - printer->Print(vars, - "default:\n" - " if (!pb::ExtensionSet.TryMergeFieldFrom(ref _extensions, $maybe_ref_input$)) {\n" - " _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, $maybe_ref_input$);\n" - " }\n" - " break;\n"); - } else { - printer->Print(vars, - "default:\n" - " _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, $maybe_ref_input$);\n" - " break;\n"); - } - for (int i = 0; i < fields_by_number().size(); i++) { - const FieldDescriptor* field = fields_by_number()[i]; - internal::WireFormatLite::WireType wt = - internal::WireFormat::WireTypeForFieldType(field->type()); - uint32 tag = internal::WireFormatLite::MakeTag(field->number(), wt); - // Handle both packed and unpacked repeated fields with the same Read*Array call; - // the two generated cases are the packed and unpacked tags. - // TODO(jonskeet): Check that is_packable is equivalent to - // is_repeated && wt in { VARINT, FIXED32, FIXED64 }. - // It looks like it is... - if (field->is_packable()) { - printer->Print( - "case $packed_tag$:\n", - "packed_tag", - StrCat( - internal::WireFormatLite::MakeTag( - field->number(), - internal::WireFormatLite::WIRETYPE_LENGTH_DELIMITED))); - } - - printer->Print("case $tag$: {\n", "tag", StrCat(tag)); - printer->Indent(); - std::unique_ptr generator( - CreateFieldGeneratorInternal(field)); - generator->GenerateParsingCode(printer, use_parse_context); - printer->Print("break;\n"); - printer->Outdent(); - printer->Print("}\n"); - } - printer->Outdent(); - printer->Print("}\n"); // switch - printer->Outdent(); - printer->Print("}\n"); // while -} - -// it's a waste of space to track presence for all values, so we only track them if they're not nullable -int MessageGenerator::GetPresenceIndex(const FieldDescriptor* descriptor) { - if (!RequiresPresenceBit(descriptor)) { - return -1; - } - - int index = 0; - for (int i = 0; i < fields_by_number().size(); i++) { - const FieldDescriptor* field = fields_by_number()[i]; - if (field == descriptor) { - return index; - } - if (RequiresPresenceBit(field)) { - index++; - } - } - GOOGLE_LOG(DFATAL)<< "Could not find presence index for field " << descriptor->name(); - return -1; -} - -FieldGeneratorBase* MessageGenerator::CreateFieldGeneratorInternal( - const FieldDescriptor* descriptor) { - return CreateFieldGenerator(descriptor, GetPresenceIndex(descriptor), this->options()); -} - -} // namespace csharp -} // namespace compiler -} // namespace protobuf -} // namespace google diff --git a/extra/protobuf/protobuf-3.19.4/src/google/protobuf/compiler/csharp/csharp_message.h b/extra/protobuf/protobuf-3.19.4/src/google/protobuf/compiler/csharp/csharp_message.h deleted file mode 100644 index d02767e44b48..000000000000 --- a/extra/protobuf/protobuf-3.19.4/src/google/protobuf/compiler/csharp/csharp_message.h +++ /dev/null @@ -1,94 +0,0 @@ -// Protocol Buffers - Google's data interchange format -// Copyright 2008 Google Inc. All rights reserved. -// https://developers.google.com/protocol-buffers/ -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// * Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// * Redistributions in binary form must reproduce the above -// copyright notice, this list of conditions and the following disclaimer -// in the documentation and/or other materials provided with the -// distribution. -// * Neither the name of Google Inc. nor the names of its -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -#ifndef GOOGLE_PROTOBUF_COMPILER_CSHARP_MESSAGE_H__ -#define GOOGLE_PROTOBUF_COMPILER_CSHARP_MESSAGE_H__ - -#include -#include - -#include -#include -#include - -namespace google { -namespace protobuf { -namespace compiler { -namespace csharp { - -class FieldGeneratorBase; - -class MessageGenerator : public SourceGeneratorBase { - public: - MessageGenerator(const Descriptor* descriptor, const Options* options); - ~MessageGenerator(); - - MessageGenerator(const MessageGenerator&) = delete; - MessageGenerator& operator=(const MessageGenerator&) = delete; - - void GenerateCloningCode(io::Printer* printer); - void GenerateFreezingCode(io::Printer* printer); - void GenerateFrameworkMethods(io::Printer* printer); - void Generate(io::Printer* printer); - - private: - const Descriptor* descriptor_; - std::vector fields_by_number_; - int has_bit_field_count_; - uint end_tag_; - bool has_extension_ranges_; - - void GenerateMessageSerializationMethods(io::Printer* printer); - void GenerateWriteToBody(io::Printer* printer, bool use_write_context); - void GenerateMergingMethods(io::Printer* printer); - void GenerateMainParseLoop(io::Printer* printer, bool use_parse_context); - - int GetPresenceIndex(const FieldDescriptor* descriptor); - FieldGeneratorBase* CreateFieldGeneratorInternal( - const FieldDescriptor* descriptor); - - bool HasNestedGeneratedTypes(); - - void AddDeprecatedFlag(io::Printer* printer); - void AddSerializableAttribute(io::Printer* printer); - - std::string class_name(); - std::string full_class_name(); - - // field descriptors sorted by number - const std::vector& fields_by_number(); -}; - -} // namespace csharp -} // namespace compiler -} // namespace protobuf -} // namespace google - -#endif // GOOGLE_PROTOBUF_COMPILER_CSHARP_MESSAGE_H__ diff --git a/extra/protobuf/protobuf-3.19.4/src/google/protobuf/compiler/csharp/csharp_message_field.cc b/extra/protobuf/protobuf-3.19.4/src/google/protobuf/compiler/csharp/csharp_message_field.cc deleted file mode 100644 index 034fbd924270..000000000000 --- a/extra/protobuf/protobuf-3.19.4/src/google/protobuf/compiler/csharp/csharp_message_field.cc +++ /dev/null @@ -1,293 +0,0 @@ -// Protocol Buffers - Google's data interchange format -// Copyright 2008 Google Inc. All rights reserved. -// https://developers.google.com/protocol-buffers/ -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// * Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// * Redistributions in binary form must reproduce the above -// copyright notice, this list of conditions and the following disclaimer -// in the documentation and/or other materials provided with the -// distribution. -// * Neither the name of Google Inc. nor the names of its -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -#include - -#include -#include -#include -#include -#include -#include -#include -#include - -#include -#include -#include -#include - -namespace google { -namespace protobuf { -namespace compiler { -namespace csharp { - -MessageFieldGenerator::MessageFieldGenerator(const FieldDescriptor* descriptor, - int presenceIndex, - const Options *options) - : FieldGeneratorBase(descriptor, presenceIndex, options) { - if (!SupportsPresenceApi(descriptor_)) { - variables_["has_property_check"] = name() + "_ != null"; - variables_["has_not_property_check"] = name() + "_ == null"; - } -} - -MessageFieldGenerator::~MessageFieldGenerator() { - -} - -void MessageFieldGenerator::GenerateMembers(io::Printer* printer) { - printer->Print( - variables_, - "private $type_name$ $name$_;\n"); - WritePropertyDocComment(printer, descriptor_); - AddPublicMemberAttributes(printer); - printer->Print( - variables_, - "$access_level$ $type_name$ $property_name$ {\n" - " get { return $name$_; }\n" - " set {\n" - " $name$_ = value;\n" - " }\n" - "}\n"); - if (SupportsPresenceApi(descriptor_)) { - printer->Print( - variables_, - "/// Gets whether the $descriptor_name$ field is set\n"); - AddPublicMemberAttributes(printer); - printer->Print( - variables_, - "$access_level$ bool Has$property_name$ {\n" - " get { return $name$_ != null; }\n" - "}\n"); - printer->Print( - variables_, - "/// Clears the value of the $descriptor_name$ field\n"); - AddPublicMemberAttributes(printer); - printer->Print( - variables_, - "$access_level$ void Clear$property_name$() {\n" - " $name$_ = null;\n" - "}\n"); - } -} - -void MessageFieldGenerator::GenerateMergingCode(io::Printer* printer) { - printer->Print( - variables_, - "if (other.$has_property_check$) {\n" - " if ($has_not_property_check$) {\n" - " $property_name$ = new $type_name$();\n" - " }\n" - " $property_name$.MergeFrom(other.$property_name$);\n" - "}\n"); -} - -void MessageFieldGenerator::GenerateParsingCode(io::Printer* printer) { - printer->Print( - variables_, - "if ($has_not_property_check$) {\n" - " $property_name$ = new $type_name$();\n" - "}\n"); - if (descriptor_->type() == FieldDescriptor::Type::TYPE_MESSAGE) { - printer->Print(variables_, "input.ReadMessage($property_name$);\n"); - } else { - printer->Print(variables_, "input.ReadGroup($property_name$);\n"); - } -} - -void MessageFieldGenerator::GenerateSerializationCode(io::Printer* printer) { - if (descriptor_->type() == FieldDescriptor::Type::TYPE_MESSAGE) { - printer->Print( - variables_, - "if ($has_property_check$) {\n" - " output.WriteRawTag($tag_bytes$);\n" - " output.WriteMessage($property_name$);\n" - "}\n"); - } else { - printer->Print( - variables_, - "if ($has_property_check$) {\n" - " output.WriteRawTag($tag_bytes$);\n" - " output.WriteGroup($property_name$);\n" - " output.WriteRawTag($end_tag_bytes$);\n" - "}\n"); - } -} - -void MessageFieldGenerator::GenerateSerializedSizeCode(io::Printer* printer) { - if (descriptor_->type() == FieldDescriptor::Type::TYPE_MESSAGE) { - printer->Print( - variables_, - "if ($has_property_check$) {\n" - " size += $tag_size$ + pb::CodedOutputStream.ComputeMessageSize($property_name$);\n" - "}\n"); - } else { - printer->Print( - variables_, - "if ($has_property_check$) {\n" - " size += $tag_size$ + pb::CodedOutputStream.ComputeGroupSize($property_name$);\n" - "}\n"); - } -} - -void MessageFieldGenerator::WriteHash(io::Printer* printer) { - printer->Print( - variables_, - "if ($has_property_check$) hash ^= $property_name$.GetHashCode();\n"); -} -void MessageFieldGenerator::WriteEquals(io::Printer* printer) { - printer->Print( - variables_, - "if (!object.Equals($property_name$, other.$property_name$)) return false;\n"); -} -void MessageFieldGenerator::WriteToString(io::Printer* printer) { - variables_["field_name"] = GetFieldName(descriptor_); - printer->Print( - variables_, - "PrintField(\"$field_name$\", has$property_name$, $name$_, writer);\n"); -} -void MessageFieldGenerator::GenerateExtensionCode(io::Printer* printer) { - WritePropertyDocComment(printer, descriptor_); - AddDeprecatedFlag(printer); - printer->Print( - variables_, - "$access_level$ static readonly pb::Extension<$extended_type$, $type_name$> $property_name$ =\n" - " new pb::Extension<$extended_type$, $type_name$>($number$, "); - GenerateCodecCode(printer); - printer->Print(");\n"); -} -void MessageFieldGenerator::GenerateCloningCode(io::Printer* printer) { - printer->Print(variables_, - "$name$_ = other.$has_property_check$ ? other.$name$_.Clone() : null;\n"); -} - -void MessageFieldGenerator::GenerateFreezingCode(io::Printer* printer) { -} - -void MessageFieldGenerator::GenerateCodecCode(io::Printer* printer) { - if (descriptor_->type() == FieldDescriptor::Type::TYPE_MESSAGE) { - printer->Print( - variables_, - "pb::FieldCodec.ForMessage($tag$, $type_name$.Parser)"); - } else { - printer->Print( - variables_, - "pb::FieldCodec.ForGroup($tag$, $end_tag$, $type_name$.Parser)"); - } -} - -MessageOneofFieldGenerator::MessageOneofFieldGenerator( - const FieldDescriptor* descriptor, - int presenceIndex, - const Options *options) - : MessageFieldGenerator(descriptor, presenceIndex, options) { - SetCommonOneofFieldVariables(&variables_); -} - -MessageOneofFieldGenerator::~MessageOneofFieldGenerator() { - -} - -void MessageOneofFieldGenerator::GenerateMembers(io::Printer* printer) { - WritePropertyDocComment(printer, descriptor_); - AddPublicMemberAttributes(printer); - printer->Print( - variables_, - "$access_level$ $type_name$ $property_name$ {\n" - " get { return $has_property_check$ ? ($type_name$) $oneof_name$_ : null; }\n" - " set {\n" - " $oneof_name$_ = value;\n" - " $oneof_name$Case_ = value == null ? $oneof_property_name$OneofCase.None : $oneof_property_name$OneofCase.$property_name$;\n" - " }\n" - "}\n"); - if (SupportsPresenceApi(descriptor_)) { - printer->Print( - variables_, - "/// Gets whether the \"$descriptor_name$\" field is set\n"); - AddPublicMemberAttributes(printer); - printer->Print( - variables_, - "$access_level$ bool Has$property_name$ {\n" - " get { return $oneof_name$Case_ == $oneof_property_name$OneofCase.$property_name$; }\n" - "}\n"); - printer->Print( - variables_, - "/// Clears the value of the oneof if it's currently set to \"$descriptor_name$\" \n"); - AddPublicMemberAttributes(printer); - printer->Print( - variables_, - "$access_level$ void Clear$property_name$() {\n" - " if ($has_property_check$) {\n" - " Clear$oneof_property_name$();\n" - " }\n" - "}\n"); - } -} - -void MessageOneofFieldGenerator::GenerateMergingCode(io::Printer* printer) { - printer->Print(variables_, - "if ($property_name$ == null) {\n" - " $property_name$ = new $type_name$();\n" - "}\n" - "$property_name$.MergeFrom(other.$property_name$);\n"); -} - -void MessageOneofFieldGenerator::GenerateParsingCode(io::Printer* printer) { - // TODO(jonskeet): We may be able to do better than this - printer->Print( - variables_, - "$type_name$ subBuilder = new $type_name$();\n" - "if ($has_property_check$) {\n" - " subBuilder.MergeFrom($property_name$);\n" - "}\n"); - if (descriptor_->type() == FieldDescriptor::Type::TYPE_MESSAGE) { - printer->Print("input.ReadMessage(subBuilder);\n"); - } else { - printer->Print("input.ReadGroup(subBuilder);\n"); - } - printer->Print(variables_, "$property_name$ = subBuilder;\n"); -} - -void MessageOneofFieldGenerator::WriteToString(io::Printer* printer) { - printer->Print( - variables_, - "PrintField(\"$descriptor_name$\", $has_property_check$, $oneof_name$_, writer);\n"); -} - -void MessageOneofFieldGenerator::GenerateCloningCode(io::Printer* printer) { - printer->Print(variables_, - "$property_name$ = other.$property_name$.Clone();\n"); -} - -} // namespace csharp -} // namespace compiler -} // namespace protobuf -} // namespace google diff --git a/extra/protobuf/protobuf-3.19.4/src/google/protobuf/compiler/csharp/csharp_message_field.h b/extra/protobuf/protobuf-3.19.4/src/google/protobuf/compiler/csharp/csharp_message_field.h deleted file mode 100644 index 1436fe20087e..000000000000 --- a/extra/protobuf/protobuf-3.19.4/src/google/protobuf/compiler/csharp/csharp_message_field.h +++ /dev/null @@ -1,93 +0,0 @@ -// Protocol Buffers - Google's data interchange format -// Copyright 2008 Google Inc. All rights reserved. -// https://developers.google.com/protocol-buffers/ -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// * Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// * Redistributions in binary form must reproduce the above -// copyright notice, this list of conditions and the following disclaimer -// in the documentation and/or other materials provided with the -// distribution. -// * Neither the name of Google Inc. nor the names of its -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -#ifndef GOOGLE_PROTOBUF_COMPILER_CSHARP_MESSAGE_FIELD_H__ -#define GOOGLE_PROTOBUF_COMPILER_CSHARP_MESSAGE_FIELD_H__ - -#include - -#include -#include - -namespace google { -namespace protobuf { -namespace compiler { -namespace csharp { - -class MessageFieldGenerator : public FieldGeneratorBase { - public: - MessageFieldGenerator(const FieldDescriptor* descriptor, - int presenceIndex, - const Options *options); - ~MessageFieldGenerator(); - - MessageFieldGenerator(const MessageFieldGenerator&) = delete; - MessageFieldGenerator& operator=(const MessageFieldGenerator&) = delete; - - virtual void GenerateCodecCode(io::Printer* printer) override; - virtual void GenerateCloningCode(io::Printer* printer) override; - virtual void GenerateFreezingCode(io::Printer* printer) override; - virtual void GenerateMembers(io::Printer* printer) override; - virtual void GenerateMergingCode(io::Printer* printer) override; - virtual void GenerateParsingCode(io::Printer* printer) override; - virtual void GenerateSerializationCode(io::Printer* printer) override; - virtual void GenerateSerializedSizeCode(io::Printer* printer) override; - virtual void GenerateExtensionCode(io::Printer* printer) override; - - virtual void WriteHash(io::Printer* printer) override; - virtual void WriteEquals(io::Printer* printer) override; - virtual void WriteToString(io::Printer* printer) override; -}; - -class MessageOneofFieldGenerator : public MessageFieldGenerator { - public: - MessageOneofFieldGenerator(const FieldDescriptor* descriptor, - int presenceIndex, - const Options *options); - ~MessageOneofFieldGenerator(); - - MessageOneofFieldGenerator(const MessageOneofFieldGenerator&) = delete; - MessageOneofFieldGenerator& operator=(const MessageOneofFieldGenerator&) = - delete; - - virtual void GenerateCloningCode(io::Printer* printer) override; - virtual void GenerateMembers(io::Printer* printer) override; - virtual void GenerateMergingCode(io::Printer* printer) override; - virtual void WriteToString(io::Printer* printer) override; - virtual void GenerateParsingCode(io::Printer* printer) override; -}; - -} // namespace csharp -} // namespace compiler -} // namespace protobuf -} // namespace google - -#endif // GOOGLE_PROTOBUF_COMPILER_CSHARP_MESSAGE_FIELD_H__ - diff --git a/extra/protobuf/protobuf-3.19.4/src/google/protobuf/compiler/csharp/csharp_names.h b/extra/protobuf/protobuf-3.19.4/src/google/protobuf/compiler/csharp/csharp_names.h deleted file mode 100644 index 67e53b640108..000000000000 --- a/extra/protobuf/protobuf-3.19.4/src/google/protobuf/compiler/csharp/csharp_names.h +++ /dev/null @@ -1,109 +0,0 @@ -// Protocol Buffers - Google's data interchange format -// Copyright 2008 Google Inc. All rights reserved. -// https://developers.google.com/protocol-buffers/ -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// * Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// * Redistributions in binary form must reproduce the above -// copyright notice, this list of conditions and the following disclaimer -// in the documentation and/or other materials provided with the -// distribution. -// * Neither the name of Google Inc. nor the names of its -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -// Author: kenton@google.com (Kenton Varda) -// Based on original Protocol Buffers design by -// Sanjay Ghemawat, Jeff Dean, and others. -// -// Provides a mechanism for mapping a descriptor to the -// fully-qualified name of the corresponding C# class. - -#ifndef GOOGLE_PROTOBUF_COMPILER_CSHARP_NAMES_H__ -#define GOOGLE_PROTOBUF_COMPILER_CSHARP_NAMES_H__ - -#include -#include -#include - -#include - -namespace google { -namespace protobuf { - -class Descriptor; -class EnumDescriptor; -class FileDescriptor; -class ServiceDescriptor; - -namespace compiler { -namespace csharp { - -// Requires: -// descriptor != NULL -// -// Returns: -// The namespace to use for given file descriptor. -std::string PROTOC_EXPORT GetFileNamespace(const FileDescriptor* descriptor); - -// Requires: -// descriptor != NULL -// -// Returns: -// The fully-qualified C# class name. -std::string PROTOC_EXPORT GetClassName(const Descriptor* descriptor); - -// Requires: -// descriptor != NULL -// -// Returns: -// The fully-qualified name of the C# class that provides -// access to the file descriptor. Proto compiler generates -// such class for each .proto file processed. -std::string PROTOC_EXPORT -GetReflectionClassName(const FileDescriptor* descriptor); - -// Generates output file name for given file descriptor. If generate_directories -// is true, the output file will be put under directory corresponding to file's -// namespace. base_namespace can be used to strip some of the top level -// directories. E.g. for file with namespace "Bar.Foo" and base_namespace="Bar", -// the resulting file will be put under directory "Foo" (and not "Bar/Foo"). -// -// Requires: -// descriptor != NULL -// error != NULL -// -// Returns: -// The file name to use as output file for given file descriptor. In case -// of failure, this function will return empty string and error parameter -// will contain the error message. -std::string PROTOC_EXPORT GetOutputFile(const FileDescriptor* descriptor, - const std::string file_extension, - const bool generate_directories, - const std::string base_namespace, - std::string* error); - -} // namespace csharp -} // namespace compiler -} // namespace protobuf -} // namespace google - -#include - -#endif // GOOGLE_PROTOBUF_COMPILER_CSHARP_NAMES_H__ diff --git a/extra/protobuf/protobuf-3.19.4/src/google/protobuf/compiler/csharp/csharp_options.h b/extra/protobuf/protobuf-3.19.4/src/google/protobuf/compiler/csharp/csharp_options.h deleted file mode 100644 index 42ff6d866277..000000000000 --- a/extra/protobuf/protobuf-3.19.4/src/google/protobuf/compiler/csharp/csharp_options.h +++ /dev/null @@ -1,81 +0,0 @@ -// Protocol Buffers - Google's data interchange format -// Copyright 2008 Google Inc. All rights reserved. -// https://developers.google.com/protocol-buffers/ -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// * Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// * Redistributions in binary form must reproduce the above -// copyright notice, this list of conditions and the following disclaimer -// in the documentation and/or other materials provided with the -// distribution. -// * Neither the name of Google Inc. nor the names of its -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -#ifndef GOOGLE_PROTOBUF_COMPILER_CSHARP_OPTIONS_H__ -#define GOOGLE_PROTOBUF_COMPILER_CSHARP_OPTIONS_H__ - -#include - -namespace google { -namespace protobuf { -namespace compiler { -namespace csharp { - -// Generator options (used by csharp_generator.cc): -struct Options { - Options() : - file_extension(".cs"), - base_namespace(""), - base_namespace_specified(false), - internal_access(false), - serializable(false) { - } - // Extension of the generated file. Defaults to ".cs" - std::string file_extension; - // Base namespace to use to create directory hierarchy. Defaults to "". - // This option allows the simple creation of a conventional C# file layout, - // where directories are created relative to a project-specific base - // namespace. For example, in a project with a base namespace of PetShop, a - // proto of user.proto with a C# namespace of PetShop.Model.Shared would - // generate Model/Shared/User.cs underneath the specified --csharp_out - // directory. - // - // If no base namespace is specified, all files are generated in the - // --csharp_out directory, with no subdirectories created automatically. - std::string base_namespace; - // Whether the base namespace has been explicitly specified by the user. - // This is required as the base namespace can be explicitly set to the empty - // string, meaning "create a full directory hierarchy, starting from the first - // segment of the namespace." - bool base_namespace_specified; - // Whether the generated classes should have accessibility level of "internal". - // Defaults to false that generates "public" classes. - bool internal_access; - // Whether the generated classes should have a global::System.Serializable attribute added - // Defaults to false - bool serializable; -}; - -} // namespace csharp -} // namespace compiler -} // namespace protobuf -} // namespace google - -#endif // GOOGLE_PROTOBUF_COMPILER_CSHARP_OPTIONS_H__ diff --git a/extra/protobuf/protobuf-3.19.4/src/google/protobuf/compiler/csharp/csharp_primitive_field.cc b/extra/protobuf/protobuf-3.19.4/src/google/protobuf/compiler/csharp/csharp_primitive_field.cc deleted file mode 100644 index 9df1dd6abd73..000000000000 --- a/extra/protobuf/protobuf-3.19.4/src/google/protobuf/compiler/csharp/csharp_primitive_field.cc +++ /dev/null @@ -1,349 +0,0 @@ -// Protocol Buffers - Google's data interchange format -// Copyright 2008 Google Inc. All rights reserved. -// https://developers.google.com/protocol-buffers/ -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// * Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// * Redistributions in binary form must reproduce the above -// copyright notice, this list of conditions and the following disclaimer -// in the documentation and/or other materials provided with the -// distribution. -// * Neither the name of Google Inc. nor the names of its -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -#include - -#include -#include -#include -#include -#include -#include - -#include -#include -#include -#include - -namespace google { -namespace protobuf { -namespace compiler { -namespace csharp { - -PrimitiveFieldGenerator::PrimitiveFieldGenerator( - const FieldDescriptor* descriptor, int presenceIndex, const Options *options) - : FieldGeneratorBase(descriptor, presenceIndex, options) { - // TODO(jonskeet): Make this cleaner... - is_value_type = descriptor->type() != FieldDescriptor::TYPE_STRING - && descriptor->type() != FieldDescriptor::TYPE_BYTES; - if (!is_value_type && !SupportsPresenceApi(descriptor_)) { - variables_["has_property_check"] = variables_["property_name"] + ".Length != 0"; - variables_["other_has_property_check"] = "other." + variables_["property_name"] + ".Length != 0"; - } -} - -PrimitiveFieldGenerator::~PrimitiveFieldGenerator() { -} - -void PrimitiveFieldGenerator::GenerateMembers(io::Printer* printer) { - - // Note: in multiple places, this code assumes that all fields - // that support presence are either nullable, or use a presence field bit. - // Fields which are oneof members are not generated here; they're generated in PrimitiveOneofFieldGenerator below. - // Extensions are not generated here either. - - - // Proto2 allows different default values to be specified. These are retained - // via static fields. They don't particularly need to be, but we don't need - // to change that. In Proto3 the default value we don't generate these - // fields, just using the literal instead. - if (IsProto2(descriptor_->file())) { - // Note: "private readonly static" isn't as idiomatic as - // "private static readonly", but changing this now would create a lot of - // churn in generated code with near-to-zero benefit. - printer->Print( - variables_, - "private readonly static $type_name$ $property_name$DefaultValue = $default_value$;\n\n"); - variables_["default_value_access"] = - variables_["property_name"] + "DefaultValue"; - } else { - variables_["default_value_access"] = variables_["default_value"]; - } - - // Declare the field itself. - printer->Print( - variables_, - "private $type_name$ $name_def_message$;\n"); - - WritePropertyDocComment(printer, descriptor_); - AddPublicMemberAttributes(printer); - - // Most of the work is done in the property: - // Declare the property itself (the same for all options) - printer->Print(variables_, "$access_level$ $type_name$ $property_name$ {\n"); - - // Specify the "getter", which may need to check for a presence field. - if (SupportsPresenceApi(descriptor_)) { - if (IsNullable(descriptor_)) { - printer->Print( - variables_, - " get { return $name$_ ?? $default_value_access$; }\n"); - } else { - printer->Print( - variables_, - // Note: it's possible that this could be rewritten as a - // conditional ?: expression, but there's no significant benefit - // to changing it. - " get { if ($has_field_check$) { return $name$_; } else { return $default_value_access$; } }\n"); - } - } else { - printer->Print( - variables_, - " get { return $name$_; }\n"); - } - - // Specify the "setter", which may need to set a field bit as well as the - // value. - printer->Print(" set {\n"); - if (presenceIndex_ != -1) { - printer->Print( - variables_, - " $set_has_field$;\n"); - } - if (is_value_type) { - printer->Print( - variables_, - " $name$_ = value;\n"); - } else { - printer->Print( - variables_, - " $name$_ = pb::ProtoPreconditions.CheckNotNull(value, \"value\");\n"); - } - printer->Print( - " }\n" - "}\n"); - - // The "HasFoo" property, where required. - if (SupportsPresenceApi(descriptor_)) { - printer->Print(variables_, - "/// Gets whether the \"$descriptor_name$\" field is set\n"); - AddPublicMemberAttributes(printer); - printer->Print( - variables_, - "$access_level$ bool Has$property_name$ {\n" - " get { return "); - if (IsNullable(descriptor_)) { - printer->Print( - variables_, - "$name$_ != null; }\n}\n"); - } else { - printer->Print( - variables_, - "$has_field_check$; }\n}\n"); - } - } - - // The "ClearFoo" method, where required. - if (SupportsPresenceApi(descriptor_)) { - printer->Print(variables_, - "/// Clears the value of the \"$descriptor_name$\" field\n"); - AddPublicMemberAttributes(printer); - printer->Print( - variables_, - "$access_level$ void Clear$property_name$() {\n"); - if (IsNullable(descriptor_)) { - printer->Print(variables_, " $name$_ = null;\n"); - } else { - printer->Print(variables_, " $clear_has_field$;\n"); - } - printer->Print("}\n"); - } -} - -void PrimitiveFieldGenerator::GenerateMergingCode(io::Printer* printer) { - printer->Print( - variables_, - "if ($other_has_property_check$) {\n" - " $property_name$ = other.$property_name$;\n" - "}\n"); -} - -void PrimitiveFieldGenerator::GenerateParsingCode(io::Printer* printer) { - // Note: invoke the property setter rather than writing straight to the field, - // so that we can normalize "null to empty" for strings and bytes. - printer->Print( - variables_, - "$property_name$ = input.Read$capitalized_type_name$();\n"); -} - -void PrimitiveFieldGenerator::GenerateSerializationCode(io::Printer* printer) { - printer->Print( - variables_, - "if ($has_property_check$) {\n" - " output.WriteRawTag($tag_bytes$);\n" - " output.Write$capitalized_type_name$($property_name$);\n" - "}\n"); -} - -void PrimitiveFieldGenerator::GenerateSerializedSizeCode(io::Printer* printer) { - printer->Print( - variables_, - "if ($has_property_check$) {\n"); - printer->Indent(); - int fixedSize = GetFixedSize(descriptor_->type()); - if (fixedSize == -1) { - printer->Print( - variables_, - "size += $tag_size$ + pb::CodedOutputStream.Compute$capitalized_type_name$Size($property_name$);\n"); - } else { - printer->Print( - "size += $tag_size$ + $fixed_size$;\n", - "fixed_size", StrCat(fixedSize), - "tag_size", variables_["tag_size"]); - } - printer->Outdent(); - printer->Print("}\n"); -} - -void PrimitiveFieldGenerator::WriteHash(io::Printer* printer) { - const char *text = "if ($has_property_check$) hash ^= $property_name$.GetHashCode();\n"; - if (descriptor_->type() == FieldDescriptor::TYPE_FLOAT) { - text = "if ($has_property_check$) hash ^= pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.GetHashCode($property_name$);\n"; - } else if (descriptor_->type() == FieldDescriptor::TYPE_DOUBLE) { - text = "if ($has_property_check$) hash ^= pbc::ProtobufEqualityComparers.BitwiseDoubleEqualityComparer.GetHashCode($property_name$);\n"; - } - printer->Print(variables_, text); -} -void PrimitiveFieldGenerator::WriteEquals(io::Printer* printer) { - const char *text = "if ($property_name$ != other.$property_name$) return false;\n"; - if (descriptor_->type() == FieldDescriptor::TYPE_FLOAT) { - text = "if (!pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.Equals($property_name$, other.$property_name$)) return false;\n"; - } else if (descriptor_->type() == FieldDescriptor::TYPE_DOUBLE) { - text = "if (!pbc::ProtobufEqualityComparers.BitwiseDoubleEqualityComparer.Equals($property_name$, other.$property_name$)) return false;\n"; - } - printer->Print(variables_, text); -} -void PrimitiveFieldGenerator::WriteToString(io::Printer* printer) { - printer->Print( - variables_, - "PrintField(\"$descriptor_name$\", $has_property_check$, $property_name$, writer);\n"); -} - -void PrimitiveFieldGenerator::GenerateCloningCode(io::Printer* printer) { - printer->Print(variables_, - "$name$_ = other.$name$_;\n"); -} - -void PrimitiveFieldGenerator::GenerateCodecCode(io::Printer* printer) { - printer->Print( - variables_, - "pb::FieldCodec.For$capitalized_type_name$($tag$, $default_value$)"); -} - -void PrimitiveFieldGenerator::GenerateExtensionCode(io::Printer* printer) { - WritePropertyDocComment(printer, descriptor_); - AddDeprecatedFlag(printer); - printer->Print( - variables_, - "$access_level$ static readonly pb::Extension<$extended_type$, $type_name$> $property_name$ =\n" - " new pb::Extension<$extended_type$, $type_name$>($number$, "); - GenerateCodecCode(printer); - printer->Print(");\n"); -} - -PrimitiveOneofFieldGenerator::PrimitiveOneofFieldGenerator( - const FieldDescriptor* descriptor, int presenceIndex, const Options *options) - : PrimitiveFieldGenerator(descriptor, presenceIndex, options) { - SetCommonOneofFieldVariables(&variables_); -} - -PrimitiveOneofFieldGenerator::~PrimitiveOneofFieldGenerator() { -} - -void PrimitiveOneofFieldGenerator::GenerateMembers(io::Printer* printer) { - WritePropertyDocComment(printer, descriptor_); - AddPublicMemberAttributes(printer); - printer->Print( - variables_, - "$access_level$ $type_name$ $property_name$ {\n" - " get { return $has_property_check$ ? ($type_name$) $oneof_name$_ : $default_value$; }\n" - " set {\n"); - if (is_value_type) { - printer->Print( - variables_, - " $oneof_name$_ = value;\n"); - } else { - printer->Print( - variables_, - " $oneof_name$_ = pb::ProtoPreconditions.CheckNotNull(value, \"value\");\n"); - } - printer->Print( - variables_, - " $oneof_name$Case_ = $oneof_property_name$OneofCase.$property_name$;\n" - " }\n" - "}\n"); - if (SupportsPresenceApi(descriptor_)) { - printer->Print( - variables_, - "/// Gets whether the \"$descriptor_name$\" field is set\n"); - AddPublicMemberAttributes(printer); - printer->Print( - variables_, - "$access_level$ bool Has$property_name$ {\n" - " get { return $oneof_name$Case_ == $oneof_property_name$OneofCase.$property_name$; }\n" - "}\n"); - printer->Print( - variables_, - "/// Clears the value of the oneof if it's currently set to \"$descriptor_name$\" \n"); - AddPublicMemberAttributes(printer); - printer->Print( - variables_, - "$access_level$ void Clear$property_name$() {\n" - " if ($has_property_check$) {\n" - " Clear$oneof_property_name$();\n" - " }\n" - "}\n"); - } -} - -void PrimitiveOneofFieldGenerator::GenerateMergingCode(io::Printer* printer) { - printer->Print(variables_, "$property_name$ = other.$property_name$;\n"); -} - -void PrimitiveOneofFieldGenerator::WriteToString(io::Printer* printer) { - printer->Print(variables_, - "PrintField(\"$descriptor_name$\", $has_property_check$, $oneof_name$_, writer);\n"); -} - -void PrimitiveOneofFieldGenerator::GenerateParsingCode(io::Printer* printer) { - printer->Print( - variables_, - "$property_name$ = input.Read$capitalized_type_name$();\n"); -} - -void PrimitiveOneofFieldGenerator::GenerateCloningCode(io::Printer* printer) { - printer->Print(variables_, - "$property_name$ = other.$property_name$;\n"); -} - -} // namespace csharp -} // namespace compiler -} // namespace protobuf -} // namespace google diff --git a/extra/protobuf/protobuf-3.19.4/src/google/protobuf/compiler/csharp/csharp_primitive_field.h b/extra/protobuf/protobuf-3.19.4/src/google/protobuf/compiler/csharp/csharp_primitive_field.h deleted file mode 100644 index a2c11050e210..000000000000 --- a/extra/protobuf/protobuf-3.19.4/src/google/protobuf/compiler/csharp/csharp_primitive_field.h +++ /dev/null @@ -1,97 +0,0 @@ -// Protocol Buffers - Google's data interchange format -// Copyright 2008 Google Inc. All rights reserved. -// https://developers.google.com/protocol-buffers/ -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// * Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// * Redistributions in binary form must reproduce the above -// copyright notice, this list of conditions and the following disclaimer -// in the documentation and/or other materials provided with the -// distribution. -// * Neither the name of Google Inc. nor the names of its -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -#ifndef GOOGLE_PROTOBUF_COMPILER_CSHARP_PRIMITIVE_FIELD_H__ -#define GOOGLE_PROTOBUF_COMPILER_CSHARP_PRIMITIVE_FIELD_H__ - -#include - -#include -#include - -namespace google { -namespace protobuf { -namespace compiler { -namespace csharp { - -struct Options; - -class PrimitiveFieldGenerator : public FieldGeneratorBase { - public: - PrimitiveFieldGenerator(const FieldDescriptor* descriptor, - int presenceIndex, - const Options *options); - ~PrimitiveFieldGenerator(); - - PrimitiveFieldGenerator(const PrimitiveFieldGenerator&) = delete; - PrimitiveFieldGenerator& operator=(const PrimitiveFieldGenerator&) = delete; - - virtual void GenerateCodecCode(io::Printer* printer) override; - virtual void GenerateCloningCode(io::Printer* printer) override; - virtual void GenerateMembers(io::Printer* printer) override; - virtual void GenerateMergingCode(io::Printer* printer) override; - virtual void GenerateParsingCode(io::Printer* printer) override; - virtual void GenerateSerializationCode(io::Printer* printer) override; - virtual void GenerateSerializedSizeCode(io::Printer* printer) override; - virtual void GenerateExtensionCode(io::Printer* printer) override; - - virtual void WriteHash(io::Printer* printer) override; - virtual void WriteEquals(io::Printer* printer) override; - virtual void WriteToString(io::Printer* printer) override; - - protected: - bool is_value_type; -}; - -class PrimitiveOneofFieldGenerator : public PrimitiveFieldGenerator { - public: - PrimitiveOneofFieldGenerator(const FieldDescriptor* descriptor, - int presenceIndex, - const Options *options); - ~PrimitiveOneofFieldGenerator(); - - PrimitiveOneofFieldGenerator(const PrimitiveOneofFieldGenerator&) = delete; - PrimitiveOneofFieldGenerator& operator=(const PrimitiveOneofFieldGenerator&) = - delete; - - virtual void GenerateCloningCode(io::Printer* printer) override; - virtual void GenerateMembers(io::Printer* printer) override; - virtual void GenerateMergingCode(io::Printer* printer) override; - virtual void WriteToString(io::Printer* printer) override; - virtual void GenerateParsingCode(io::Printer* printer) override; -}; - -} // namespace csharp -} // namespace compiler -} // namespace protobuf -} // namespace google - -#endif // GOOGLE_PROTOBUF_COMPILER_CSHARP_PRIMITIVE_FIELD_H__ - diff --git a/extra/protobuf/protobuf-3.19.4/src/google/protobuf/compiler/csharp/csharp_reflection_class.cc b/extra/protobuf/protobuf-3.19.4/src/google/protobuf/compiler/csharp/csharp_reflection_class.cc deleted file mode 100644 index 644fbf16f935..000000000000 --- a/extra/protobuf/protobuf-3.19.4/src/google/protobuf/compiler/csharp/csharp_reflection_class.cc +++ /dev/null @@ -1,330 +0,0 @@ -// Protocol Buffers - Google's data interchange format -// Copyright 2008 Google Inc. All rights reserved. -// https://developers.google.com/protocol-buffers/ -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// * Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// * Redistributions in binary form must reproduce the above -// copyright notice, this list of conditions and the following disclaimer -// in the documentation and/or other materials provided with the -// distribution. -// * Neither the name of Google Inc. nor the names of its -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -#include - -#include -#include -#include -#include -#include -#include - - -#include -#include -#include -#include -#include -#include -#include - -namespace google { -namespace protobuf { -namespace compiler { -namespace csharp { - -ReflectionClassGenerator::ReflectionClassGenerator(const FileDescriptor* file, - const Options* options) - : SourceGeneratorBase(options), - file_(file) { - namespace_ = GetFileNamespace(file); - reflectionClassname_ = GetReflectionClassUnqualifiedName(file); - extensionClassname_ = GetExtensionClassUnqualifiedName(file); -} - -ReflectionClassGenerator::~ReflectionClassGenerator() { -} - -void ReflectionClassGenerator::Generate(io::Printer* printer) { - WriteIntroduction(printer); - - WriteDescriptor(printer); - // Close the class declaration. - printer->Outdent(); - printer->Print("}\n"); - - if (file_->extension_count() > 0) { - printer->Print( - "/// Holder for extension identifiers generated from the top " - "level of $file_name$\n" - "$access_level$ static partial class $class_name$ {\n", - "access_level", class_access_level(), "class_name", extensionClassname_, - "file_name", file_->name()); - printer->Indent(); - for (int i = 0; i < file_->extension_count(); i++) { - std::unique_ptr generator( - CreateFieldGenerator(file_->extension(i), -1, this->options())); - generator->GenerateExtensionCode(printer); - } - printer->Outdent(); - printer->Print( - "}\n" - "\n"); - } - - // write children: Enums - if (file_->enum_type_count() > 0) { - printer->Print("#region Enums\n"); - for (int i = 0; i < file_->enum_type_count(); i++) { - EnumGenerator enumGenerator(file_->enum_type(i), this->options()); - enumGenerator.Generate(printer); - } - printer->Print("#endregion\n"); - printer->Print("\n"); - } - - // write children: Messages - if (file_->message_type_count() > 0) { - printer->Print("#region Messages\n"); - for (int i = 0; i < file_->message_type_count(); i++) { - MessageGenerator messageGenerator(file_->message_type(i), this->options()); - messageGenerator.Generate(printer); - } - printer->Print("#endregion\n"); - printer->Print("\n"); - } - - // TODO(jtattermusch): add insertion point for services. - - if (!namespace_.empty()) { - printer->Outdent(); - printer->Print("}\n"); - } - printer->Print("\n"); - printer->Print("#endregion Designer generated code\n"); -} - -void ReflectionClassGenerator::WriteIntroduction(io::Printer* printer) { - printer->Print( - "// \n" - "// Generated by the protocol buffer compiler. DO NOT EDIT!\n" - "// source: $file_name$\n" - "// \n" - "#pragma warning disable 1591, 0612, 3021\n" - "#region Designer generated code\n" - "\n" - "using pb = global::Google.Protobuf;\n" - "using pbc = global::Google.Protobuf.Collections;\n" - "using pbr = global::Google.Protobuf.Reflection;\n" - "using scg = global::System.Collections.Generic;\n", - "file_name", file_->name()); - - if (!namespace_.empty()) { - printer->Print("namespace $namespace$ {\n", "namespace", namespace_); - printer->Indent(); - printer->Print("\n"); - } - - printer->Print( - "/// Holder for reflection information generated from $file_name$\n" - "$access_level$ static partial class $reflection_class_name$ {\n" - "\n", - "file_name", file_->name(), - "access_level", class_access_level(), - "reflection_class_name", reflectionClassname_); - printer->Indent(); -} - -void ReflectionClassGenerator::WriteDescriptor(io::Printer* printer) { - printer->Print( - "#region Descriptor\n" - "/// File descriptor for $file_name$\n" - "public static pbr::FileDescriptor Descriptor {\n" - " get { return descriptor; }\n" - "}\n" - "private static pbr::FileDescriptor descriptor;\n" - "\n" - "static $reflection_class_name$() {\n", - "file_name", file_->name(), - "reflection_class_name", reflectionClassname_); - printer->Indent(); - printer->Print( - "byte[] descriptorData = global::System.Convert.FromBase64String(\n"); - printer->Indent(); - printer->Indent(); - printer->Print("string.Concat(\n"); - printer->Indent(); - - // TODO(jonskeet): Consider a C#-escaping format here instead of just Base64. - std::string base64 = FileDescriptorToBase64(file_); - while (base64.size() > 60) { - printer->Print("\"$base64$\",\n", "base64", base64.substr(0, 60)); - base64 = base64.substr(60); - } - printer->Print("\"$base64$\"));\n", "base64", base64); - printer->Outdent(); - printer->Outdent(); - printer->Outdent(); - - // ----------------------------------------------------------------- - // Invoke InternalBuildGeneratedFileFrom() to build the file. - printer->Print( - "descriptor = pbr::FileDescriptor.FromGeneratedCode(descriptorData,\n"); - printer->Print(" new pbr::FileDescriptor[] { "); - for (int i = 0; i < file_->dependency_count(); i++) { - printer->Print( - "$full_reflection_class_name$.Descriptor, ", - "full_reflection_class_name", - GetReflectionClassName(file_->dependency(i))); - } - printer->Print("},\n" - " new pbr::GeneratedClrTypeInfo("); - // Specify all the generated code information, recursively. - if (file_->enum_type_count() > 0) { - printer->Print("new[] {"); - for (int i = 0; i < file_->enum_type_count(); i++) { - printer->Print("typeof($type_name$), ", "type_name", GetClassName(file_->enum_type(i))); - } - printer->Print("}, "); - } - else { - printer->Print("null, "); - } - if (file_->extension_count() > 0) { - std::vector extensions; - for (int i = 0; i < file_->extension_count(); i++) { - extensions.push_back(GetFullExtensionName(file_->extension(i))); - } - printer->Print("new pb::Extension[] { $extensions$ }, ", "extensions", Join(extensions, ", ")); - } - else { - printer->Print("null, "); - } - if (file_->message_type_count() > 0) { - printer->Print("new pbr::GeneratedClrTypeInfo[] {\n"); - printer->Indent(); - printer->Indent(); - printer->Indent(); - for (int i = 0; i < file_->message_type_count(); i++) { - WriteGeneratedCodeInfo(file_->message_type(i), printer, i == file_->message_type_count() - 1); - } - printer->Outdent(); - printer->Print("\n}));\n"); - printer->Outdent(); - printer->Outdent(); - } - else { - printer->Print("null));\n"); - } - - printer->Outdent(); - printer->Print("}\n"); - printer->Print("#endregion\n\n"); -} - -// Write out the generated code for a particular message. This consists of the CLR type, property names -// corresponding to fields, names corresponding to oneofs, nested enums, and nested types. Each array part -// can be specified as null if it would be empty, to make the generated code somewhat simpler to read. -// We write a line break at the end of each generated code info, so that in the final file we'll see all -// the types, pre-ordered depth first, one per line. The indentation will be slightly unusual, -// in that it will look like a single array when it's actually constructing a tree, but it'll be easy to -// read even with multiple levels of nesting. -// The "last" parameter indicates whether this message descriptor is the last one being printed in this immediate -// context. It governs whether or not a trailing comma and newline is written after the constructor, effectively -// just controlling the formatting in the generated code. -void ReflectionClassGenerator::WriteGeneratedCodeInfo(const Descriptor* descriptor, io::Printer* printer, bool last) { - if (IsMapEntryMessage(descriptor)) { - printer->Print("null, "); - return; - } - // Generated message type - printer->Print("new pbr::GeneratedClrTypeInfo(typeof($type_name$), $type_name$.Parser, ", "type_name", GetClassName(descriptor)); - - // Fields - if (descriptor->field_count() > 0) { - std::vector fields; - fields.reserve(descriptor->field_count()); - for (int i = 0; i < descriptor->field_count(); i++) { - fields.push_back(GetPropertyName(descriptor->field(i))); - } - printer->Print("new[]{ \"$fields$\" }, ", "fields", Join(fields, "\", \"")); - } - else { - printer->Print("null, "); - } - - // Oneofs - if (descriptor->oneof_decl_count() > 0) { - std::vector oneofs; - oneofs.reserve(descriptor->oneof_decl_count()); - for (int i = 0; i < descriptor->oneof_decl_count(); i++) { - oneofs.push_back(UnderscoresToCamelCase(descriptor->oneof_decl(i)->name(), true)); - } - printer->Print("new[]{ \"$oneofs$\" }, ", "oneofs", Join(oneofs, "\", \"")); - } - else { - printer->Print("null, "); - } - - // Nested enums - if (descriptor->enum_type_count() > 0) { - std::vector enums; - enums.reserve(descriptor->enum_type_count()); - for (int i = 0; i < descriptor->enum_type_count(); i++) { - enums.push_back(GetClassName(descriptor->enum_type(i))); - } - printer->Print("new[]{ typeof($enums$) }, ", "enums", Join(enums, "), typeof(")); - } - else { - printer->Print("null, "); - } - - // Extensions - if (descriptor->extension_count() > 0) { - std::vector extensions; - for (int i = 0; i < descriptor->extension_count(); i++) { - extensions.push_back(GetFullExtensionName(descriptor->extension(i))); - } - printer->Print("new pb::Extension[] { $extensions$ }, ", "extensions", Join(extensions, ", ")); - } - else { - printer->Print("null, "); - } - - // Nested types - if (descriptor->nested_type_count() > 0) { - // Need to specify array type explicitly here, as all elements may be null. - printer->Print("new pbr::GeneratedClrTypeInfo[] { "); - for (int i = 0; i < descriptor->nested_type_count(); i++) { - WriteGeneratedCodeInfo(descriptor->nested_type(i), printer, i == descriptor->nested_type_count() - 1); - } - printer->Print("}"); - } - else { - printer->Print("null"); - } - printer->Print(last ? ")" : "),\n"); -} - -} // namespace csharp -} // namespace compiler -} // namespace protobuf -} // namespace google diff --git a/extra/protobuf/protobuf-3.19.4/src/google/protobuf/compiler/csharp/csharp_reflection_class.h b/extra/protobuf/protobuf-3.19.4/src/google/protobuf/compiler/csharp/csharp_reflection_class.h deleted file mode 100644 index 955472776686..000000000000 --- a/extra/protobuf/protobuf-3.19.4/src/google/protobuf/compiler/csharp/csharp_reflection_class.h +++ /dev/null @@ -1,75 +0,0 @@ -// Protocol Buffers - Google's data interchange format -// Copyright 2008 Google Inc. All rights reserved. -// https://developers.google.com/protocol-buffers/ -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// * Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// * Redistributions in binary form must reproduce the above -// copyright notice, this list of conditions and the following disclaimer -// in the documentation and/or other materials provided with the -// distribution. -// * Neither the name of Google Inc. nor the names of its -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -#ifndef GOOGLE_PROTOBUF_COMPILER_CSHARP_REFLECTION_CLASS_H__ -#define GOOGLE_PROTOBUF_COMPILER_CSHARP_REFLECTION_CLASS_H__ - -#include - -#include -#include -#include -#include - -namespace google { -namespace protobuf { -namespace compiler { -namespace csharp { - -class ReflectionClassGenerator : public SourceGeneratorBase { - public: - ReflectionClassGenerator(const FileDescriptor* file, const Options* options); - ~ReflectionClassGenerator(); - - ReflectionClassGenerator(const ReflectionClassGenerator&) = delete; - ReflectionClassGenerator& operator=(const ReflectionClassGenerator&) = delete; - - void Generate(io::Printer* printer); - - private: - const FileDescriptor* file_; - - std::string namespace_; - std::string reflectionClassname_; - std::string extensionClassname_; - - void WriteIntroduction(io::Printer* printer); - void WriteDescriptor(io::Printer* printer); - void WriteGeneratedCodeInfo(const Descriptor* descriptor, - io::Printer* printer, - bool last); -}; - -} // namespace csharp -} // namespace compiler -} // namespace protobuf -} // namespace google - -#endif // GOOGLE_PROTOBUF_COMPILER_CSHARP_REFLECTION_CLASS_H__ diff --git a/extra/protobuf/protobuf-3.19.4/src/google/protobuf/compiler/csharp/csharp_repeated_enum_field.cc b/extra/protobuf/protobuf-3.19.4/src/google/protobuf/compiler/csharp/csharp_repeated_enum_field.cc deleted file mode 100644 index 04bc7bbb1bd2..000000000000 --- a/extra/protobuf/protobuf-3.19.4/src/google/protobuf/compiler/csharp/csharp_repeated_enum_field.cc +++ /dev/null @@ -1,148 +0,0 @@ -// Protocol Buffers - Google's data interchange format -// Copyright 2008 Google Inc. All rights reserved. -// https://developers.google.com/protocol-buffers/ -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// * Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// * Redistributions in binary form must reproduce the above -// copyright notice, this list of conditions and the following disclaimer -// in the documentation and/or other materials provided with the -// distribution. -// * Neither the name of Google Inc. nor the names of its -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -#include - -#include -#include -#include -#include -#include -#include - -#include -#include -#include - -namespace google { -namespace protobuf { -namespace compiler { -namespace csharp { - -RepeatedEnumFieldGenerator::RepeatedEnumFieldGenerator( - const FieldDescriptor* descriptor, int presenceIndex, const Options *options) - : FieldGeneratorBase(descriptor, presenceIndex, options) { -} - -RepeatedEnumFieldGenerator::~RepeatedEnumFieldGenerator() { - -} - -void RepeatedEnumFieldGenerator::GenerateMembers(io::Printer* printer) { - printer->Print( - variables_, - "private static readonly pb::FieldCodec<$type_name$> _repeated_$name$_codec\n" - " = pb::FieldCodec.ForEnum($tag$, x => (int) x, x => ($type_name$) x);\n"); - printer->Print(variables_, - "private readonly pbc::RepeatedField<$type_name$> $name$_ = new pbc::RepeatedField<$type_name$>();\n"); - WritePropertyDocComment(printer, descriptor_); - AddPublicMemberAttributes(printer); - printer->Print( - variables_, - "$access_level$ pbc::RepeatedField<$type_name$> $property_name$ {\n" - " get { return $name$_; }\n" - "}\n"); -} - -void RepeatedEnumFieldGenerator::GenerateMergingCode(io::Printer* printer) { - printer->Print( - variables_, - "$name$_.Add(other.$name$_);\n"); -} - -void RepeatedEnumFieldGenerator::GenerateParsingCode(io::Printer* printer) { - GenerateParsingCode(printer, true); -} - -void RepeatedEnumFieldGenerator::GenerateParsingCode(io::Printer* printer, bool use_parse_context) { - printer->Print( - variables_, - use_parse_context - ? "$name$_.AddEntriesFrom(ref input, _repeated_$name$_codec);\n" - : "$name$_.AddEntriesFrom(input, _repeated_$name$_codec);\n"); -} - -void RepeatedEnumFieldGenerator::GenerateSerializationCode(io::Printer* printer) { - GenerateSerializationCode(printer, true); -} - -void RepeatedEnumFieldGenerator::GenerateSerializationCode(io::Printer* printer, bool use_write_context) { - printer->Print( - variables_, - use_write_context - ? "$name$_.WriteTo(ref output, _repeated_$name$_codec);\n" - : "$name$_.WriteTo(output, _repeated_$name$_codec);\n"); -} - -void RepeatedEnumFieldGenerator::GenerateSerializedSizeCode(io::Printer* printer) { - printer->Print( - variables_, - "size += $name$_.CalculateSize(_repeated_$name$_codec);\n"); -} - -void RepeatedEnumFieldGenerator::WriteHash(io::Printer* printer) { - printer->Print( - variables_, - "hash ^= $name$_.GetHashCode();\n"); -} - -void RepeatedEnumFieldGenerator::WriteEquals(io::Printer* printer) { - printer->Print( - variables_, - "if(!$name$_.Equals(other.$name$_)) return false;\n"); -} - -void RepeatedEnumFieldGenerator::WriteToString(io::Printer* printer) { - printer->Print(variables_, - "PrintField(\"$descriptor_name$\", $name$_, writer);\n"); -} - -void RepeatedEnumFieldGenerator::GenerateCloningCode(io::Printer* printer) { - printer->Print(variables_, - "$name$_ = other.$name$_.Clone();\n"); -} - -void RepeatedEnumFieldGenerator::GenerateExtensionCode(io::Printer* printer) { - WritePropertyDocComment(printer, descriptor_); - AddDeprecatedFlag(printer); - printer->Print( - variables_, - "$access_level$ static readonly pb::RepeatedExtension<$extended_type$, $type_name$> $property_name$ =\n" - " new pb::RepeatedExtension<$extended_type$, $type_name$>($number$, " - "pb::FieldCodec.ForEnum($tag$, x => (int) x, x => ($type_name$) x));\n"); -} - -void RepeatedEnumFieldGenerator::GenerateFreezingCode(io::Printer* printer) { -} - -} // namespace csharp -} // namespace compiler -} // namespace protobuf -} // namespace google diff --git a/extra/protobuf/protobuf-3.19.4/src/google/protobuf/compiler/csharp/csharp_repeated_enum_field.h b/extra/protobuf/protobuf-3.19.4/src/google/protobuf/compiler/csharp/csharp_repeated_enum_field.h deleted file mode 100644 index 2e265702fb40..000000000000 --- a/extra/protobuf/protobuf-3.19.4/src/google/protobuf/compiler/csharp/csharp_repeated_enum_field.h +++ /dev/null @@ -1,79 +0,0 @@ -// Protocol Buffers - Google's data interchange format -// Copyright 2008 Google Inc. All rights reserved. -// https://developers.google.com/protocol-buffers/ -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// * Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// * Redistributions in binary form must reproduce the above -// copyright notice, this list of conditions and the following disclaimer -// in the documentation and/or other materials provided with the -// distribution. -// * Neither the name of Google Inc. nor the names of its -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -#ifndef GOOGLE_PROTOBUF_COMPILER_CSHARP_REPEATED_ENUM_FIELD_H__ -#define GOOGLE_PROTOBUF_COMPILER_CSHARP_REPEATED_ENUM_FIELD_H__ - -#include - -#include -#include - -namespace google { -namespace protobuf { -namespace compiler { -namespace csharp { - -// TODO(jonskeet): Refactor repeated field support; all the implementations are -// *really* similar. We should probably have a RepeatedFieldGeneratorBase. -class RepeatedEnumFieldGenerator : public FieldGeneratorBase { - public: - RepeatedEnumFieldGenerator(const FieldDescriptor* descriptor, - int presenceIndex, - const Options *options); - ~RepeatedEnumFieldGenerator(); - - RepeatedEnumFieldGenerator(const RepeatedEnumFieldGenerator&) = delete; - RepeatedEnumFieldGenerator& operator=(const RepeatedEnumFieldGenerator&) = - delete; - - virtual void GenerateCloningCode(io::Printer* printer) override; - virtual void GenerateFreezingCode(io::Printer* printer) override; - virtual void GenerateMembers(io::Printer* printer) override; - virtual void GenerateMergingCode(io::Printer* printer) override; - virtual void GenerateParsingCode(io::Printer* printer) override; - virtual void GenerateParsingCode(io::Printer* printer, bool use_parse_context) override; - virtual void GenerateSerializationCode(io::Printer* printer) override; - virtual void GenerateSerializationCode(io::Printer* printer, bool use_write_context) override; - virtual void GenerateSerializedSizeCode(io::Printer* printer) override; - virtual void GenerateExtensionCode(io::Printer* printer) override; - - virtual void WriteHash(io::Printer* printer) override; - virtual void WriteEquals(io::Printer* printer) override; - virtual void WriteToString(io::Printer* printer) override; -}; - -} // namespace csharp -} // namespace compiler -} // namespace protobuf -} // namespace google - -#endif // GOOGLE_PROTOBUF_COMPILER_CSHARP_REPEATED_ENUM_FIELD_H__ - diff --git a/extra/protobuf/protobuf-3.19.4/src/google/protobuf/compiler/csharp/csharp_repeated_message_field.cc b/extra/protobuf/protobuf-3.19.4/src/google/protobuf/compiler/csharp/csharp_repeated_message_field.cc deleted file mode 100644 index 8a93cd13cfca..000000000000 --- a/extra/protobuf/protobuf-3.19.4/src/google/protobuf/compiler/csharp/csharp_repeated_message_field.cc +++ /dev/null @@ -1,174 +0,0 @@ -// Protocol Buffers - Google's data interchange format -// Copyright 2008 Google Inc. All rights reserved. -// https://developers.google.com/protocol-buffers/ -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// * Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// * Redistributions in binary form must reproduce the above -// copyright notice, this list of conditions and the following disclaimer -// in the documentation and/or other materials provided with the -// distribution. -// * Neither the name of Google Inc. nor the names of its -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -#include - -#include -#include -#include -#include -#include - -#include -#include -#include -#include -#include - -namespace google { -namespace protobuf { -namespace compiler { -namespace csharp { - -RepeatedMessageFieldGenerator::RepeatedMessageFieldGenerator( - const FieldDescriptor* descriptor, int presenceIndex, const Options *options) - : FieldGeneratorBase(descriptor, presenceIndex, options) { -} - -RepeatedMessageFieldGenerator::~RepeatedMessageFieldGenerator() { - -} - -void RepeatedMessageFieldGenerator::GenerateMembers(io::Printer* printer) { - printer->Print( - variables_, - "private static readonly pb::FieldCodec<$type_name$> _repeated_$name$_codec\n" - " = "); - // Don't want to duplicate the codec code here... maybe we should have a - // "create single field generator for this repeated field" - // function, but it doesn't seem worth it for just this. - if (IsWrapperType(descriptor_)) { - std::unique_ptr single_generator( - new WrapperFieldGenerator(descriptor_, presenceIndex_, this->options())); - single_generator->GenerateCodecCode(printer); - } else { - std::unique_ptr single_generator( - new MessageFieldGenerator(descriptor_, presenceIndex_, this->options())); - single_generator->GenerateCodecCode(printer); - } - printer->Print(";\n"); - printer->Print( - variables_, - "private readonly pbc::RepeatedField<$type_name$> $name$_ = new pbc::RepeatedField<$type_name$>();\n"); - WritePropertyDocComment(printer, descriptor_); - AddPublicMemberAttributes(printer); - printer->Print( - variables_, - "$access_level$ pbc::RepeatedField<$type_name$> $property_name$ {\n" - " get { return $name$_; }\n" - "}\n"); -} - -void RepeatedMessageFieldGenerator::GenerateMergingCode(io::Printer* printer) { - printer->Print( - variables_, - "$name$_.Add(other.$name$_);\n"); -} - -void RepeatedMessageFieldGenerator::GenerateParsingCode(io::Printer* printer) { - GenerateParsingCode(printer, true); -} - -void RepeatedMessageFieldGenerator::GenerateParsingCode(io::Printer* printer, bool use_parse_context) { - printer->Print( - variables_, - use_parse_context - ? "$name$_.AddEntriesFrom(ref input, _repeated_$name$_codec);\n" - : "$name$_.AddEntriesFrom(input, _repeated_$name$_codec);\n"); -} - -void RepeatedMessageFieldGenerator::GenerateSerializationCode(io::Printer* printer) { - GenerateSerializationCode(printer, true); -} - -void RepeatedMessageFieldGenerator::GenerateSerializationCode(io::Printer* printer, bool use_write_context) { - printer->Print( - variables_, - use_write_context - ? "$name$_.WriteTo(ref output, _repeated_$name$_codec);\n" - : "$name$_.WriteTo(output, _repeated_$name$_codec);\n"); -} - -void RepeatedMessageFieldGenerator::GenerateSerializedSizeCode(io::Printer* printer) { - printer->Print( - variables_, - "size += $name$_.CalculateSize(_repeated_$name$_codec);\n"); -} - -void RepeatedMessageFieldGenerator::WriteHash(io::Printer* printer) { - printer->Print( - variables_, - "hash ^= $name$_.GetHashCode();\n"); -} - -void RepeatedMessageFieldGenerator::WriteEquals(io::Printer* printer) { - printer->Print( - variables_, - "if(!$name$_.Equals(other.$name$_)) return false;\n"); -} - -void RepeatedMessageFieldGenerator::WriteToString(io::Printer* printer) { - variables_["field_name"] = GetFieldName(descriptor_); - printer->Print( - variables_, - "PrintField(\"$field_name$\", $name$_, writer);\n"); -} - -void RepeatedMessageFieldGenerator::GenerateCloningCode(io::Printer* printer) { - printer->Print(variables_, - "$name$_ = other.$name$_.Clone();\n"); -} - -void RepeatedMessageFieldGenerator::GenerateFreezingCode(io::Printer* printer) { -} - -void RepeatedMessageFieldGenerator::GenerateExtensionCode(io::Printer* printer) { - WritePropertyDocComment(printer, descriptor_); - AddDeprecatedFlag(printer); - printer->Print( - variables_, - "$access_level$ static readonly pb::RepeatedExtension<$extended_type$, $type_name$> $property_name$ =\n" - " new pb::RepeatedExtension<$extended_type$, $type_name$>($number$, "); - if (IsWrapperType(descriptor_)) { - std::unique_ptr single_generator( - new WrapperFieldGenerator(descriptor_, -1, this->options())); - single_generator->GenerateCodecCode(printer); - } else { - std::unique_ptr single_generator( - new MessageFieldGenerator(descriptor_, -1, this->options())); - single_generator->GenerateCodecCode(printer); - } - printer->Print(");\n"); -} - -} // namespace csharp -} // namespace compiler -} // namespace protobuf -} // namespace google diff --git a/extra/protobuf/protobuf-3.19.4/src/google/protobuf/compiler/csharp/csharp_repeated_message_field.h b/extra/protobuf/protobuf-3.19.4/src/google/protobuf/compiler/csharp/csharp_repeated_message_field.h deleted file mode 100644 index a2267adf3da6..000000000000 --- a/extra/protobuf/protobuf-3.19.4/src/google/protobuf/compiler/csharp/csharp_repeated_message_field.h +++ /dev/null @@ -1,79 +0,0 @@ -// Protocol Buffers - Google's data interchange format -// Copyright 2008 Google Inc. All rights reserved. -// https://developers.google.com/protocol-buffers/ -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// * Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// * Redistributions in binary form must reproduce the above -// copyright notice, this list of conditions and the following disclaimer -// in the documentation and/or other materials provided with the -// distribution. -// * Neither the name of Google Inc. nor the names of its -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -#ifndef GOOGLE_PROTOBUF_COMPILER_CSHARP_REPEATED_MESSAGE_FIELD_H__ -#define GOOGLE_PROTOBUF_COMPILER_CSHARP_REPEATED_MESSAGE_FIELD_H__ - -#include - -#include -#include - -namespace google { -namespace protobuf { -namespace compiler { -namespace csharp { - -struct Options; - -class RepeatedMessageFieldGenerator : public FieldGeneratorBase { - public: - RepeatedMessageFieldGenerator(const FieldDescriptor* descriptor, - int presenceIndex, - const Options *options); - ~RepeatedMessageFieldGenerator(); - - RepeatedMessageFieldGenerator(const RepeatedMessageFieldGenerator&) = delete; - RepeatedMessageFieldGenerator& operator=( - const RepeatedMessageFieldGenerator&) = delete; - - virtual void GenerateCloningCode(io::Printer* printer) override; - virtual void GenerateFreezingCode(io::Printer* printer) override; - virtual void GenerateMembers(io::Printer* printer) override; - virtual void GenerateMergingCode(io::Printer* printer) override; - virtual void GenerateParsingCode(io::Printer* printer) override; - virtual void GenerateParsingCode(io::Printer* printer, bool use_parse_context) override; - virtual void GenerateSerializationCode(io::Printer* printer) override; - virtual void GenerateSerializationCode(io::Printer* printer, bool use_write_context) override; - virtual void GenerateSerializedSizeCode(io::Printer* printer) override; - virtual void GenerateExtensionCode(io::Printer* printer) override; - - virtual void WriteHash(io::Printer* printer) override; - virtual void WriteEquals(io::Printer* printer) override; - virtual void WriteToString(io::Printer* printer) override; -}; - -} // namespace csharp -} // namespace compiler -} // namespace protobuf -} // namespace google - -#endif // GOOGLE_PROTOBUF_COMPILER_CSHARP_REPEATED_MESSAGE_FIELD_H__ - diff --git a/extra/protobuf/protobuf-3.19.4/src/google/protobuf/compiler/csharp/csharp_repeated_primitive_field.cc b/extra/protobuf/protobuf-3.19.4/src/google/protobuf/compiler/csharp/csharp_repeated_primitive_field.cc deleted file mode 100644 index 0eacf91ce6ca..000000000000 --- a/extra/protobuf/protobuf-3.19.4/src/google/protobuf/compiler/csharp/csharp_repeated_primitive_field.cc +++ /dev/null @@ -1,145 +0,0 @@ -// Protocol Buffers - Google's data interchange format -// Copyright 2008 Google Inc. All rights reserved. -// https://developers.google.com/protocol-buffers/ -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// * Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// * Redistributions in binary form must reproduce the above -// copyright notice, this list of conditions and the following disclaimer -// in the documentation and/or other materials provided with the -// distribution. -// * Neither the name of Google Inc. nor the names of its -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -#include - -#include -#include -#include -#include -#include -#include - -#include -#include -#include - -namespace google { -namespace protobuf { -namespace compiler { -namespace csharp { - -RepeatedPrimitiveFieldGenerator::RepeatedPrimitiveFieldGenerator( - const FieldDescriptor* descriptor, int presenceIndex, const Options *options) - : FieldGeneratorBase(descriptor, presenceIndex, options) { -} - -RepeatedPrimitiveFieldGenerator::~RepeatedPrimitiveFieldGenerator() { - -} - -void RepeatedPrimitiveFieldGenerator::GenerateMembers(io::Printer* printer) { - printer->Print( - variables_, - "private static readonly pb::FieldCodec<$type_name$> _repeated_$name$_codec\n" - " = pb::FieldCodec.For$capitalized_type_name$($tag$);\n"); - printer->Print(variables_, - "private readonly pbc::RepeatedField<$type_name$> $name$_ = new pbc::RepeatedField<$type_name$>();\n"); - WritePropertyDocComment(printer, descriptor_); - AddPublicMemberAttributes(printer); - printer->Print( - variables_, - "$access_level$ pbc::RepeatedField<$type_name$> $property_name$ {\n" - " get { return $name$_; }\n" - "}\n"); -} - -void RepeatedPrimitiveFieldGenerator::GenerateMergingCode(io::Printer* printer) { - printer->Print( - variables_, - "$name$_.Add(other.$name$_);\n"); -} - -void RepeatedPrimitiveFieldGenerator::GenerateParsingCode(io::Printer* printer) { - GenerateParsingCode(printer, true); -} - -void RepeatedPrimitiveFieldGenerator::GenerateParsingCode(io::Printer* printer, bool use_parse_context) { - printer->Print( - variables_, - use_parse_context - ? "$name$_.AddEntriesFrom(ref input, _repeated_$name$_codec);\n" - : "$name$_.AddEntriesFrom(input, _repeated_$name$_codec);\n"); -} - -void RepeatedPrimitiveFieldGenerator::GenerateSerializationCode(io::Printer* printer) { - GenerateSerializationCode(printer, true); -} - -void RepeatedPrimitiveFieldGenerator::GenerateSerializationCode(io::Printer* printer, bool use_write_context) { - printer->Print( - variables_, - use_write_context - ? "$name$_.WriteTo(ref output, _repeated_$name$_codec);\n" - : "$name$_.WriteTo(output, _repeated_$name$_codec);\n"); -} - -void RepeatedPrimitiveFieldGenerator::GenerateSerializedSizeCode(io::Printer* printer) { - printer->Print( - variables_, - "size += $name$_.CalculateSize(_repeated_$name$_codec);\n"); -} - -void RepeatedPrimitiveFieldGenerator::WriteHash(io::Printer* printer) { - printer->Print( - variables_, - "hash ^= $name$_.GetHashCode();\n"); -} -void RepeatedPrimitiveFieldGenerator::WriteEquals(io::Printer* printer) { - printer->Print( - variables_, - "if(!$name$_.Equals(other.$name$_)) return false;\n"); -} -void RepeatedPrimitiveFieldGenerator::WriteToString(io::Printer* printer) { - printer->Print(variables_, - "PrintField(\"$descriptor_name$\", $name$_, writer);\n"); -} - -void RepeatedPrimitiveFieldGenerator::GenerateCloningCode(io::Printer* printer) { - printer->Print(variables_, - "$name$_ = other.$name$_.Clone();\n"); -} - -void RepeatedPrimitiveFieldGenerator::GenerateFreezingCode(io::Printer* printer) { -} - -void RepeatedPrimitiveFieldGenerator::GenerateExtensionCode(io::Printer* printer) { - WritePropertyDocComment(printer, descriptor_); - AddDeprecatedFlag(printer); - printer->Print( - variables_, - "$access_level$ static readonly pb::RepeatedExtension<$extended_type$, $type_name$> $property_name$ =\n" - " new pb::RepeatedExtension<$extended_type$, $type_name$>($number$, pb::FieldCodec.For$capitalized_type_name$($tag$));\n"); -} - -} // namespace csharp -} // namespace compiler -} // namespace protobuf -} // namespace google diff --git a/extra/protobuf/protobuf-3.19.4/src/google/protobuf/compiler/csharp/csharp_repeated_primitive_field.h b/extra/protobuf/protobuf-3.19.4/src/google/protobuf/compiler/csharp/csharp_repeated_primitive_field.h deleted file mode 100644 index d432f37b2f59..000000000000 --- a/extra/protobuf/protobuf-3.19.4/src/google/protobuf/compiler/csharp/csharp_repeated_primitive_field.h +++ /dev/null @@ -1,75 +0,0 @@ -// Protocol Buffers - Google's data interchange format -// Copyright 2008 Google Inc. All rights reserved. -// https://developers.google.com/protocol-buffers/ -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// * Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// * Redistributions in binary form must reproduce the above -// copyright notice, this list of conditions and the following disclaimer -// in the documentation and/or other materials provided with the -// distribution. -// * Neither the name of Google Inc. nor the names of its -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -#ifndef GOOGLE_PROTOBUF_COMPILER_CSHARP_REPEATED_PRIMITIVE_FIELD_H__ -#define GOOGLE_PROTOBUF_COMPILER_CSHARP_REPEATED_PRIMITIVE_FIELD_H__ - -#include - -#include -#include - -namespace google { -namespace protobuf { -namespace compiler { -namespace csharp { - -class RepeatedPrimitiveFieldGenerator : public FieldGeneratorBase { - public: - RepeatedPrimitiveFieldGenerator(const FieldDescriptor* descriptor, - int presenceIndex, const Options* options); - ~RepeatedPrimitiveFieldGenerator(); - - RepeatedPrimitiveFieldGenerator(const RepeatedPrimitiveFieldGenerator&) = delete; - RepeatedPrimitiveFieldGenerator& operator=(const RepeatedPrimitiveFieldGenerator&) = delete; - - virtual void GenerateCloningCode(io::Printer* printer) override; - virtual void GenerateFreezingCode(io::Printer* printer) override; - virtual void GenerateMembers(io::Printer* printer) override; - virtual void GenerateMergingCode(io::Printer* printer) override; - virtual void GenerateParsingCode(io::Printer* printer) override; - virtual void GenerateParsingCode(io::Printer* printer, bool use_parse_context) override; - virtual void GenerateSerializationCode(io::Printer* printer) override; - virtual void GenerateSerializationCode(io::Printer* printer, bool use_write_context) override; - virtual void GenerateSerializedSizeCode(io::Printer* printer) override; - virtual void GenerateExtensionCode(io::Printer* printer) override; - - virtual void WriteHash(io::Printer* printer) override; - virtual void WriteEquals(io::Printer* printer) override; - virtual void WriteToString(io::Printer* printer) override; -}; - -} // namespace csharp -} // namespace compiler -} // namespace protobuf -} // namespace google - -#endif // GOOGLE_PROTOBUF_COMPILER_CSHARP_REPEATED_PRIMITIVE_FIELD_H__ - diff --git a/extra/protobuf/protobuf-3.19.4/src/google/protobuf/compiler/csharp/csharp_source_generator_base.cc b/extra/protobuf/protobuf-3.19.4/src/google/protobuf/compiler/csharp/csharp_source_generator_base.cc deleted file mode 100644 index 7157e6ee1d72..000000000000 --- a/extra/protobuf/protobuf-3.19.4/src/google/protobuf/compiler/csharp/csharp_source_generator_base.cc +++ /dev/null @@ -1,75 +0,0 @@ -// Protocol Buffers - Google's data interchange format -// Copyright 2008 Google Inc. All rights reserved. -// https://developers.google.com/protocol-buffers/ -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// * Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// * Redistributions in binary form must reproduce the above -// copyright notice, this list of conditions and the following disclaimer -// in the documentation and/or other materials provided with the -// distribution. -// * Neither the name of Google Inc. nor the names of its -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -#include - -#include -#include -#include -#include -#include - -#include -#include -#include -#include - -namespace google { -namespace protobuf { -namespace compiler { -namespace csharp { - -SourceGeneratorBase::SourceGeneratorBase( - const Options *options) : options_(options) { -} - -SourceGeneratorBase::~SourceGeneratorBase() { -} - -void SourceGeneratorBase::WriteGeneratedCodeAttributes(io::Printer* printer) { - printer->Print("[global::System.Diagnostics.DebuggerNonUserCodeAttribute]\n"); - // The second argument of the [GeneratedCode] attribute could be set to current protoc - // version, but that would cause excessive code churn in the pre-generated - // code in the repository every time the protobuf version number is updated. - printer->Print("[global::System.CodeDom.Compiler.GeneratedCode(\"protoc\", null)]\n"); -} - -std::string SourceGeneratorBase::class_access_level() { - return this->options()->internal_access ? "internal" : "public"; -} - -const Options* SourceGeneratorBase::options() { - return this->options_; -} - -} // namespace csharp -} // namespace compiler -} // namespace protobuf -} // namespace google diff --git a/extra/protobuf/protobuf-3.19.4/src/google/protobuf/compiler/csharp/csharp_source_generator_base.h b/extra/protobuf/protobuf-3.19.4/src/google/protobuf/compiler/csharp/csharp_source_generator_base.h deleted file mode 100644 index 17a526916084..000000000000 --- a/extra/protobuf/protobuf-3.19.4/src/google/protobuf/compiler/csharp/csharp_source_generator_base.h +++ /dev/null @@ -1,71 +0,0 @@ -// Protocol Buffers - Google's data interchange format -// Copyright 2008 Google Inc. All rights reserved. -// https://developers.google.com/protocol-buffers/ -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// * Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// * Redistributions in binary form must reproduce the above -// copyright notice, this list of conditions and the following disclaimer -// in the documentation and/or other materials provided with the -// distribution. -// * Neither the name of Google Inc. nor the names of its -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -#ifndef GOOGLE_PROTOBUF_COMPILER_CSHARP_SOURCE_GENERATOR_BASE_H__ -#define GOOGLE_PROTOBUF_COMPILER_CSHARP_SOURCE_GENERATOR_BASE_H__ - -#include - -#include -#include - -namespace google { -namespace protobuf { -namespace compiler { -namespace csharp { - -struct Options; - -class SourceGeneratorBase { - protected: - SourceGeneratorBase(const Options* options); - virtual ~SourceGeneratorBase(); - - SourceGeneratorBase(const SourceGeneratorBase&) = delete; - SourceGeneratorBase& operator=(const SourceGeneratorBase&) = delete; - - std::string class_access_level(); - const Options* options(); - - // Write any attributes used to decorate generated function members (methods and properties). - // Should not be used to decorate types. - void WriteGeneratedCodeAttributes(io::Printer* printer); - - private: - const Options *options_; -}; - -} // namespace csharp -} // namespace compiler -} // namespace protobuf -} // namespace google - -#endif // GOOGLE_PROTOBUF_COMPILER_CSHARP_SOURCE_GENERATOR_BASE_H__ - diff --git a/extra/protobuf/protobuf-3.19.4/src/google/protobuf/compiler/csharp/csharp_wrapper_field.cc b/extra/protobuf/protobuf-3.19.4/src/google/protobuf/compiler/csharp/csharp_wrapper_field.cc deleted file mode 100644 index 578f54ba697e..000000000000 --- a/extra/protobuf/protobuf-3.19.4/src/google/protobuf/compiler/csharp/csharp_wrapper_field.cc +++ /dev/null @@ -1,308 +0,0 @@ -// Protocol Buffers - Google's data interchange format -// Copyright 2008 Google Inc. All rights reserved. -// https://developers.google.com/protocol-buffers/ -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// * Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// * Redistributions in binary form must reproduce the above -// copyright notice, this list of conditions and the following disclaimer -// in the documentation and/or other materials provided with the -// distribution. -// * Neither the name of Google Inc. nor the names of its -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -#include - -#include -#include -#include -#include -#include - -#include -#include -#include -#include - -namespace google { -namespace protobuf { -namespace compiler { -namespace csharp { - -WrapperFieldGenerator::WrapperFieldGenerator(const FieldDescriptor* descriptor, - int presenceIndex, const Options *options) - : FieldGeneratorBase(descriptor, presenceIndex, options) { - variables_["has_property_check"] = name() + "_ != null"; - variables_["has_not_property_check"] = name() + "_ == null"; - const FieldDescriptor* wrapped_field = descriptor->message_type()->field(0); - is_value_type = wrapped_field->type() != FieldDescriptor::TYPE_STRING && - wrapped_field->type() != FieldDescriptor::TYPE_BYTES; - if (is_value_type) { - variables_["nonnullable_type_name"] = type_name(wrapped_field); - } -} - -WrapperFieldGenerator::~WrapperFieldGenerator() { -} - -void WrapperFieldGenerator::GenerateMembers(io::Printer* printer) { - printer->Print( - variables_, - "private static readonly pb::FieldCodec<$type_name$> _single_$name$_codec = "); - GenerateCodecCode(printer); - printer->Print( - variables_, - ";\n" - "private $type_name$ $name$_;\n"); - WritePropertyDocComment(printer, descriptor_); - AddPublicMemberAttributes(printer); - printer->Print( - variables_, - "$access_level$ $type_name$ $property_name$ {\n" - " get { return $name$_; }\n" - " set {\n" - " $name$_ = value;\n" - " }\n" - "}\n\n"); - if (SupportsPresenceApi(descriptor_)) { - printer->Print( - variables_, - "/// Gets whether the $descriptor_name$ field is set\n"); - AddPublicMemberAttributes(printer); - printer->Print( - variables_, - "$access_level$ bool Has$property_name$ {\n" - " get { return $name$_ != null; }\n" - "}\n\n"); - printer->Print( - variables_, - "/// Clears the value of the $descriptor_name$ field\n"); - AddPublicMemberAttributes(printer); - printer->Print( - variables_, - "$access_level$ void Clear$property_name$() {\n" - " $name$_ = null;\n" - "}\n"); - } -} - -void WrapperFieldGenerator::GenerateMergingCode(io::Printer* printer) { - printer->Print( - variables_, - "if (other.$has_property_check$) {\n" - " if ($has_not_property_check$ || other.$property_name$ != $default_value$) {\n" - " $property_name$ = other.$property_name$;\n" - " }\n" - "}\n"); -} - -void WrapperFieldGenerator::GenerateParsingCode(io::Printer* printer) { - GenerateParsingCode(printer, true); -} - -void WrapperFieldGenerator::GenerateParsingCode(io::Printer* printer, bool use_parse_context) { - printer->Print( - variables_, - use_parse_context - ? "$type_name$ value = _single_$name$_codec.Read(ref input);\n" - "if ($has_not_property_check$ || value != $default_value$) {\n" - " $property_name$ = value;\n" - "}\n" - : "$type_name$ value = _single_$name$_codec.Read(input);\n" - "if ($has_not_property_check$ || value != $default_value$) {\n" - " $property_name$ = value;\n" - "}\n"); -} - -void WrapperFieldGenerator::GenerateSerializationCode(io::Printer* printer) { - GenerateSerializationCode(printer, true); -} - -void WrapperFieldGenerator::GenerateSerializationCode(io::Printer* printer, bool use_write_context) { - printer->Print( - variables_, - use_write_context - ? "if ($has_property_check$) {\n" - " _single_$name$_codec.WriteTagAndValue(ref output, $property_name$);\n" - "}\n" - : "if ($has_property_check$) {\n" - " _single_$name$_codec.WriteTagAndValue(output, $property_name$);\n" - "}\n"); -} - -void WrapperFieldGenerator::GenerateSerializedSizeCode(io::Printer* printer) { - printer->Print( - variables_, - "if ($has_property_check$) {\n" - " size += _single_$name$_codec.CalculateSizeWithTag($property_name$);\n" - "}\n"); -} - -void WrapperFieldGenerator::WriteHash(io::Printer* printer) { - const char *text = "if ($has_property_check$) hash ^= $property_name$.GetHashCode();\n"; - if (descriptor_->message_type()->field(0)->type() == FieldDescriptor::TYPE_FLOAT) { - text = "if ($has_property_check$) hash ^= pbc::ProtobufEqualityComparers.BitwiseNullableSingleEqualityComparer.GetHashCode($property_name$);\n"; - } - else if (descriptor_->message_type()->field(0)->type() == FieldDescriptor::TYPE_DOUBLE) { - text = "if ($has_property_check$) hash ^= pbc::ProtobufEqualityComparers.BitwiseNullableDoubleEqualityComparer.GetHashCode($property_name$);\n"; - } - printer->Print(variables_, text); -} - -void WrapperFieldGenerator::WriteEquals(io::Printer* printer) { - const char *text = "if ($property_name$ != other.$property_name$) return false;\n"; - if (descriptor_->message_type()->field(0)->type() == FieldDescriptor::TYPE_FLOAT) { - text = "if (!pbc::ProtobufEqualityComparers.BitwiseNullableSingleEqualityComparer.Equals($property_name$, other.$property_name$)) return false;\n"; - } - else if (descriptor_->message_type()->field(0)->type() == FieldDescriptor::TYPE_DOUBLE) { - text = "if (!pbc::ProtobufEqualityComparers.BitwiseNullableDoubleEqualityComparer.Equals($property_name$, other.$property_name$)) return false;\n"; - } - printer->Print(variables_, text); -} - -void WrapperFieldGenerator::WriteToString(io::Printer* printer) { - // TODO: Implement if we ever actually need it... -} - -void WrapperFieldGenerator::GenerateCloningCode(io::Printer* printer) { - printer->Print(variables_, - "$property_name$ = other.$property_name$;\n"); -} - -void WrapperFieldGenerator::GenerateCodecCode(io::Printer* printer) { - if (is_value_type) { - printer->Print( - variables_, - "pb::FieldCodec.ForStructWrapper<$nonnullable_type_name$>($tag$)"); - } else { - printer->Print( - variables_, - "pb::FieldCodec.ForClassWrapper<$type_name$>($tag$)"); - } -} - -void WrapperFieldGenerator::GenerateExtensionCode(io::Printer* printer) { - WritePropertyDocComment(printer, descriptor_); - AddDeprecatedFlag(printer); - printer->Print( - variables_, - "$access_level$ static readonly pb::Extension<$extended_type$, $type_name$> $property_name$ =\n" - " new pb::Extension<$extended_type$, $type_name$>($number$, "); - GenerateCodecCode(printer); - printer->Print(");\n"); -} - -WrapperOneofFieldGenerator::WrapperOneofFieldGenerator( - const FieldDescriptor* descriptor, int presenceIndex, const Options *options) - : WrapperFieldGenerator(descriptor, presenceIndex, options) { - SetCommonOneofFieldVariables(&variables_); -} - -WrapperOneofFieldGenerator::~WrapperOneofFieldGenerator() { -} - -void WrapperOneofFieldGenerator::GenerateMembers(io::Printer* printer) { - // Note: deliberately _oneof_$name$_codec, not _$oneof_name$_codec... we have one codec per field. - printer->Print( - variables_, - "private static readonly pb::FieldCodec<$type_name$> _oneof_$name$_codec = "); - GenerateCodecCode(printer); - printer->Print(";\n"); - WritePropertyDocComment(printer, descriptor_); - AddPublicMemberAttributes(printer); - printer->Print( - variables_, - "$access_level$ $type_name$ $property_name$ {\n" - " get { return $has_property_check$ ? ($type_name$) $oneof_name$_ : ($type_name$) null; }\n" - " set {\n" - " $oneof_name$_ = value;\n" - " $oneof_name$Case_ = value == null ? $oneof_property_name$OneofCase.None : $oneof_property_name$OneofCase.$property_name$;\n" - " }\n" - "}\n"); - if (SupportsPresenceApi(descriptor_)) { - printer->Print( - variables_, - "/// Gets whether the \"$descriptor_name$\" field is set\n"); - AddPublicMemberAttributes(printer); - printer->Print( - variables_, - "$access_level$ bool Has$property_name$ {\n" - " get { return $oneof_name$Case_ == $oneof_property_name$OneofCase.$property_name$; }\n" - "}\n"); - printer->Print( - variables_, - "/// Clears the value of the oneof if it's currently set to \"$descriptor_name$\" \n"); - AddPublicMemberAttributes(printer); - printer->Print( - variables_, - "$access_level$ void Clear$property_name$() {\n" - " if ($has_property_check$) {\n" - " Clear$oneof_property_name$();\n" - " }\n" - "}\n"); - } -} - -void WrapperOneofFieldGenerator::GenerateMergingCode(io::Printer* printer) { - printer->Print(variables_, "$property_name$ = other.$property_name$;\n"); -} - -void WrapperOneofFieldGenerator::GenerateParsingCode(io::Printer* printer) { - GenerateParsingCode(printer, true); -} - -void WrapperOneofFieldGenerator::GenerateParsingCode(io::Printer* printer, bool use_parse_context) { - printer->Print( - variables_, - use_parse_context - ? "$property_name$ = _oneof_$name$_codec.Read(ref input);\n" - : "$property_name$ = _oneof_$name$_codec.Read(input);\n"); -} - -void WrapperOneofFieldGenerator::GenerateSerializationCode(io::Printer* printer) { - GenerateSerializationCode(printer, true); -} - -void WrapperOneofFieldGenerator::GenerateSerializationCode(io::Printer* printer, bool use_write_context) { - // TODO: I suspect this is wrong... - printer->Print( - variables_, - use_write_context - ? "if ($has_property_check$) {\n" - " _oneof_$name$_codec.WriteTagAndValue(ref output, ($type_name$) $oneof_name$_);\n" - "}\n" - : "if ($has_property_check$) {\n" - " _oneof_$name$_codec.WriteTagAndValue(output, ($type_name$) $oneof_name$_);\n" - "}\n"); -} - -void WrapperOneofFieldGenerator::GenerateSerializedSizeCode(io::Printer* printer) { - // TODO: I suspect this is wrong... - printer->Print( - variables_, - "if ($has_property_check$) {\n" - " size += _oneof_$name$_codec.CalculateSizeWithTag($property_name$);\n" - "}\n"); -} - -} // namespace csharp -} // namespace compiler -} // namespace protobuf -} // namespace google diff --git a/extra/protobuf/protobuf-3.19.4/src/google/protobuf/compiler/csharp/csharp_wrapper_field.h b/extra/protobuf/protobuf-3.19.4/src/google/protobuf/compiler/csharp/csharp_wrapper_field.h deleted file mode 100644 index 57c4f5e76b4c..000000000000 --- a/extra/protobuf/protobuf-3.19.4/src/google/protobuf/compiler/csharp/csharp_wrapper_field.h +++ /dev/null @@ -1,99 +0,0 @@ -// Protocol Buffers - Google's data interchange format -// Copyright 2008 Google Inc. All rights reserved. -// https://developers.google.com/protocol-buffers/ -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// * Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// * Redistributions in binary form must reproduce the above -// copyright notice, this list of conditions and the following disclaimer -// in the documentation and/or other materials provided with the -// distribution. -// * Neither the name of Google Inc. nor the names of its -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -#ifndef GOOGLE_PROTOBUF_COMPILER_CSHARP_WRAPPER_FIELD_H__ -#define GOOGLE_PROTOBUF_COMPILER_CSHARP_WRAPPER_FIELD_H__ - -#include - -#include -#include - -namespace google { -namespace protobuf { -namespace compiler { -namespace csharp { - -struct Options; - -class WrapperFieldGenerator : public FieldGeneratorBase { - public: - WrapperFieldGenerator(const FieldDescriptor* descriptor, - int presenceIndex, - const Options *options); - ~WrapperFieldGenerator(); - - WrapperFieldGenerator(const WrapperFieldGenerator&) = delete; - WrapperFieldGenerator& operator=(const WrapperFieldGenerator&) = delete; - - virtual void GenerateCodecCode(io::Printer* printer) override; - virtual void GenerateCloningCode(io::Printer* printer) override; - virtual void GenerateMembers(io::Printer* printer) override; - virtual void GenerateMergingCode(io::Printer* printer) override; - virtual void GenerateParsingCode(io::Printer* printer) override; - virtual void GenerateParsingCode(io::Printer* printer, bool use_parse_context) override; - virtual void GenerateSerializationCode(io::Printer* printer) override; - virtual void GenerateSerializationCode(io::Printer* printer, bool use_write_context) override; - virtual void GenerateSerializedSizeCode(io::Printer* printer) override; - virtual void GenerateExtensionCode(io::Printer* printer) override; - - virtual void WriteHash(io::Printer* printer) override; - virtual void WriteEquals(io::Printer* printer) override; - virtual void WriteToString(io::Printer* printer) override; - - private: - bool is_value_type; // True for int32 etc; false for bytes and string -}; - -class WrapperOneofFieldGenerator : public WrapperFieldGenerator { - public: - WrapperOneofFieldGenerator(const FieldDescriptor* descriptor, - int presenceIndex, - const Options *options); - ~WrapperOneofFieldGenerator(); - - WrapperOneofFieldGenerator(const WrapperOneofFieldGenerator&) = delete; - WrapperOneofFieldGenerator& operator=(const WrapperOneofFieldGenerator&) = delete; - - virtual void GenerateMembers(io::Printer* printer) override; - virtual void GenerateMergingCode(io::Printer* printer) override; - virtual void GenerateParsingCode(io::Printer* printer) override; - virtual void GenerateParsingCode(io::Printer* printer, bool use_parse_context) override; - virtual void GenerateSerializationCode(io::Printer* printer) override; - virtual void GenerateSerializationCode(io::Printer* printer, bool use_write_context) override; - virtual void GenerateSerializedSizeCode(io::Printer* printer) override; -}; - -} // namespace csharp -} // namespace compiler -} // namespace protobuf -} // namespace google - -#endif // GOOGLE_PROTOBUF_COMPILER_CSHARP_WRAPPER_FIELD_H__ diff --git a/extra/protobuf/protobuf-3.19.4/src/google/protobuf/compiler/importer.cc b/extra/protobuf/protobuf-3.19.4/src/google/protobuf/compiler/importer.cc deleted file mode 100644 index 3bcb0c90c2ab..000000000000 --- a/extra/protobuf/protobuf-3.19.4/src/google/protobuf/compiler/importer.cc +++ /dev/null @@ -1,524 +0,0 @@ -// Protocol Buffers - Google's data interchange format -// Copyright 2008 Google Inc. All rights reserved. -// https://developers.google.com/protocol-buffers/ -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// * Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// * Redistributions in binary form must reproduce the above -// copyright notice, this list of conditions and the following disclaimer -// in the documentation and/or other materials provided with the -// distribution. -// * Neither the name of Google Inc. nor the names of its -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -// Author: kenton@google.com (Kenton Varda) -// Based on original Protocol Buffers design by -// Sanjay Ghemawat, Jeff Dean, and others. - -#ifdef _MSC_VER -#include -#else -#include -#endif -#include -#include -#include -#include - -#include -#include - -#include -#include -#include -#include -#include -#include - -#ifdef _WIN32 -#include -#endif - -namespace google { -namespace protobuf { -namespace compiler { - -#ifdef _WIN32 -// DO NOT include , instead create functions in io_win32.{h,cc} and import -// them like we do below. -using google::protobuf::io::win32::access; -using google::protobuf::io::win32::open; -#endif - -// Returns true if the text looks like a Windows-style absolute path, starting -// with a drive letter. Example: "C:\foo". TODO(kenton): Share this with -// copy in command_line_interface.cc? -static bool IsWindowsAbsolutePath(const std::string& text) { -#if defined(_WIN32) || defined(__CYGWIN__) - return text.size() >= 3 && text[1] == ':' && isalpha(text[0]) && - (text[2] == '/' || text[2] == '\\') && text.find_last_of(':') == 1; -#else - return false; -#endif -} - -MultiFileErrorCollector::~MultiFileErrorCollector() {} - -// This class serves two purposes: -// - It implements the ErrorCollector interface (used by Tokenizer and Parser) -// in terms of MultiFileErrorCollector, using a particular filename. -// - It lets us check if any errors have occurred. -class SourceTreeDescriptorDatabase::SingleFileErrorCollector - : public io::ErrorCollector { - public: - SingleFileErrorCollector(const std::string& filename, - MultiFileErrorCollector* multi_file_error_collector) - : filename_(filename), - multi_file_error_collector_(multi_file_error_collector), - had_errors_(false) {} - ~SingleFileErrorCollector() {} - - bool had_errors() { return had_errors_; } - - // implements ErrorCollector --------------------------------------- - void AddError(int line, int column, const std::string& message) override { - if (multi_file_error_collector_ != NULL) { - multi_file_error_collector_->AddError(filename_, line, column, message); - } - had_errors_ = true; - } - - private: - std::string filename_; - MultiFileErrorCollector* multi_file_error_collector_; - bool had_errors_; -}; - -// =================================================================== - -SourceTreeDescriptorDatabase::SourceTreeDescriptorDatabase( - SourceTree* source_tree) - : source_tree_(source_tree), - fallback_database_(nullptr), - error_collector_(nullptr), - using_validation_error_collector_(false), - validation_error_collector_(this) {} - -SourceTreeDescriptorDatabase::SourceTreeDescriptorDatabase( - SourceTree* source_tree, DescriptorDatabase* fallback_database) - : source_tree_(source_tree), - fallback_database_(fallback_database), - error_collector_(nullptr), - using_validation_error_collector_(false), - validation_error_collector_(this) {} - -SourceTreeDescriptorDatabase::~SourceTreeDescriptorDatabase() {} - -bool SourceTreeDescriptorDatabase::FindFileByName(const std::string& filename, - FileDescriptorProto* output) { - std::unique_ptr input(source_tree_->Open(filename)); - if (input == NULL) { - if (fallback_database_ != nullptr && - fallback_database_->FindFileByName(filename, output)) { - return true; - } - if (error_collector_ != NULL) { - error_collector_->AddError(filename, -1, 0, - source_tree_->GetLastErrorMessage()); - } - return false; - } - - // Set up the tokenizer and parser. - SingleFileErrorCollector file_error_collector(filename, error_collector_); - io::Tokenizer tokenizer(input.get(), &file_error_collector); - - Parser parser; - if (error_collector_ != NULL) { - parser.RecordErrorsTo(&file_error_collector); - } - if (using_validation_error_collector_) { - parser.RecordSourceLocationsTo(&source_locations_); - } - - // Parse it. - output->set_name(filename); - return parser.Parse(&tokenizer, output) && !file_error_collector.had_errors(); -} - -bool SourceTreeDescriptorDatabase::FindFileContainingSymbol( - const std::string& symbol_name, FileDescriptorProto* output) { - return false; -} - -bool SourceTreeDescriptorDatabase::FindFileContainingExtension( - const std::string& containing_type, int field_number, - FileDescriptorProto* output) { - return false; -} - -// ------------------------------------------------------------------- - -SourceTreeDescriptorDatabase::ValidationErrorCollector:: - ValidationErrorCollector(SourceTreeDescriptorDatabase* owner) - : owner_(owner) {} - -SourceTreeDescriptorDatabase::ValidationErrorCollector:: - ~ValidationErrorCollector() {} - -void SourceTreeDescriptorDatabase::ValidationErrorCollector::AddError( - const std::string& filename, const std::string& element_name, - const Message* descriptor, ErrorLocation location, - const std::string& message) { - if (owner_->error_collector_ == NULL) return; - - int line, column; - if (location == DescriptorPool::ErrorCollector::IMPORT) { - owner_->source_locations_.FindImport(descriptor, element_name, &line, - &column); - } else { - owner_->source_locations_.Find(descriptor, location, &line, &column); - } - owner_->error_collector_->AddError(filename, line, column, message); -} - -void SourceTreeDescriptorDatabase::ValidationErrorCollector::AddWarning( - const std::string& filename, const std::string& element_name, - const Message* descriptor, ErrorLocation location, - const std::string& message) { - if (owner_->error_collector_ == NULL) return; - - int line, column; - if (location == DescriptorPool::ErrorCollector::IMPORT) { - owner_->source_locations_.FindImport(descriptor, element_name, &line, - &column); - } else { - owner_->source_locations_.Find(descriptor, location, &line, &column); - } - owner_->error_collector_->AddWarning(filename, line, column, message); -} - -// =================================================================== - -Importer::Importer(SourceTree* source_tree, - MultiFileErrorCollector* error_collector) - : database_(source_tree), - pool_(&database_, database_.GetValidationErrorCollector()) { - pool_.EnforceWeakDependencies(true); - database_.RecordErrorsTo(error_collector); -} - -Importer::~Importer() {} - -const FileDescriptor* Importer::Import(const std::string& filename) { - return pool_.FindFileByName(filename); -} - -void Importer::AddUnusedImportTrackFile(const std::string& file_name, - bool is_error) { - pool_.AddUnusedImportTrackFile(file_name, is_error); -} - -void Importer::ClearUnusedImportTrackFiles() { - pool_.ClearUnusedImportTrackFiles(); -} - - -// =================================================================== - -SourceTree::~SourceTree() {} - -std::string SourceTree::GetLastErrorMessage() { return "File not found."; } - -DiskSourceTree::DiskSourceTree() {} - -DiskSourceTree::~DiskSourceTree() {} - -static inline char LastChar(const std::string& str) { - return str[str.size() - 1]; -} - -// Given a path, returns an equivalent path with these changes: -// - On Windows, any backslashes are replaced with forward slashes. -// - Any instances of the directory "." are removed. -// - Any consecutive '/'s are collapsed into a single slash. -// Note that the resulting string may be empty. -// -// TODO(kenton): It would be nice to handle "..", e.g. so that we can figure -// out that "foo/bar.proto" is inside "baz/../foo". However, if baz is a -// symlink or doesn't exist, then things get complicated, and we can't -// actually determine this without investigating the filesystem, probably -// in non-portable ways. So, we punt. -// -// TODO(kenton): It would be nice to use realpath() here except that it -// resolves symbolic links. This could cause problems if people place -// symbolic links in their source tree. For example, if you executed: -// protoc --proto_path=foo foo/bar/baz.proto -// then if foo/bar is a symbolic link, foo/bar/baz.proto will canonicalize -// to a path which does not appear to be under foo, and thus the compiler -// will complain that baz.proto is not inside the --proto_path. -static std::string CanonicalizePath(std::string path) { -#ifdef _WIN32 - // The Win32 API accepts forward slashes as a path delimiter even though - // backslashes are standard. Let's avoid confusion and use only forward - // slashes. - if (HasPrefixString(path, "\\\\")) { - // Avoid converting two leading backslashes. - path = "\\\\" + StringReplace(path.substr(2), "\\", "/", true); - } else { - path = StringReplace(path, "\\", "/", true); - } -#endif - - std::vector canonical_parts; - std::vector parts = Split( - path, "/", true); // Note: Removes empty parts. - for (const std::string& part : parts) { - if (part == ".") { - // Ignore. - } else { - canonical_parts.push_back(part); - } - } - std::string result = Join(canonical_parts, "/"); - if (!path.empty() && path[0] == '/') { - // Restore leading slash. - result = '/' + result; - } - if (!path.empty() && LastChar(path) == '/' && !result.empty() && - LastChar(result) != '/') { - // Restore trailing slash. - result += '/'; - } - return result; -} - -static inline bool ContainsParentReference(const std::string& path) { - return path == ".." || HasPrefixString(path, "../") || - HasSuffixString(path, "/..") || path.find("/../") != std::string::npos; -} - -// Maps a file from an old location to a new one. Typically, old_prefix is -// a virtual path and new_prefix is its corresponding disk path. Returns -// false if the filename did not start with old_prefix, otherwise replaces -// old_prefix with new_prefix and stores the result in *result. Examples: -// string result; -// assert(ApplyMapping("foo/bar", "", "baz", &result)); -// assert(result == "baz/foo/bar"); -// -// assert(ApplyMapping("foo/bar", "foo", "baz", &result)); -// assert(result == "baz/bar"); -// -// assert(ApplyMapping("foo", "foo", "bar", &result)); -// assert(result == "bar"); -// -// assert(!ApplyMapping("foo/bar", "baz", "qux", &result)); -// assert(!ApplyMapping("foo/bar", "baz", "qux", &result)); -// assert(!ApplyMapping("foobar", "foo", "baz", &result)); -static bool ApplyMapping(const std::string& filename, - const std::string& old_prefix, - const std::string& new_prefix, std::string* result) { - if (old_prefix.empty()) { - // old_prefix matches any relative path. - if (ContainsParentReference(filename)) { - // We do not allow the file name to use "..". - return false; - } - if (HasPrefixString(filename, "/") || IsWindowsAbsolutePath(filename)) { - // This is an absolute path, so it isn't matched by the empty string. - return false; - } - result->assign(new_prefix); - if (!result->empty()) result->push_back('/'); - result->append(filename); - return true; - } else if (HasPrefixString(filename, old_prefix)) { - // old_prefix is a prefix of the filename. Is it the whole filename? - if (filename.size() == old_prefix.size()) { - // Yep, it's an exact match. - *result = new_prefix; - return true; - } else { - // Not an exact match. Is the next character a '/'? Otherwise, - // this isn't actually a match at all. E.g. the prefix "foo/bar" - // does not match the filename "foo/barbaz". - int after_prefix_start = -1; - if (filename[old_prefix.size()] == '/') { - after_prefix_start = old_prefix.size() + 1; - } else if (filename[old_prefix.size() - 1] == '/') { - // old_prefix is never empty, and canonicalized paths never have - // consecutive '/' characters. - after_prefix_start = old_prefix.size(); - } - if (after_prefix_start != -1) { - // Yep. So the prefixes are directories and the filename is a file - // inside them. - std::string after_prefix = filename.substr(after_prefix_start); - if (ContainsParentReference(after_prefix)) { - // We do not allow the file name to use "..". - return false; - } - result->assign(new_prefix); - if (!result->empty()) result->push_back('/'); - result->append(after_prefix); - return true; - } - } - } - - return false; -} - -void DiskSourceTree::MapPath(const std::string& virtual_path, - const std::string& disk_path) { - mappings_.push_back(Mapping(virtual_path, CanonicalizePath(disk_path))); -} - -DiskSourceTree::DiskFileToVirtualFileResult -DiskSourceTree::DiskFileToVirtualFile(const std::string& disk_file, - std::string* virtual_file, - std::string* shadowing_disk_file) { - int mapping_index = -1; - std::string canonical_disk_file = CanonicalizePath(disk_file); - - for (int i = 0; i < mappings_.size(); i++) { - // Apply the mapping in reverse. - if (ApplyMapping(canonical_disk_file, mappings_[i].disk_path, - mappings_[i].virtual_path, virtual_file)) { - // Success. - mapping_index = i; - break; - } - } - - if (mapping_index == -1) { - return NO_MAPPING; - } - - // Iterate through all mappings with higher precedence and verify that none - // of them map this file to some other existing file. - for (int i = 0; i < mapping_index; i++) { - if (ApplyMapping(*virtual_file, mappings_[i].virtual_path, - mappings_[i].disk_path, shadowing_disk_file)) { - if (access(shadowing_disk_file->c_str(), F_OK) >= 0) { - // File exists. - return SHADOWED; - } - } - } - shadowing_disk_file->clear(); - - // Verify that we can open the file. Note that this also has the side-effect - // of verifying that we are not canonicalizing away any non-existent - // directories. - std::unique_ptr stream(OpenDiskFile(disk_file)); - if (stream == NULL) { - return CANNOT_OPEN; - } - - return SUCCESS; -} - -bool DiskSourceTree::VirtualFileToDiskFile(const std::string& virtual_file, - std::string* disk_file) { - std::unique_ptr stream( - OpenVirtualFile(virtual_file, disk_file)); - return stream != NULL; -} - -io::ZeroCopyInputStream* DiskSourceTree::Open(const std::string& filename) { - return OpenVirtualFile(filename, NULL); -} - -std::string DiskSourceTree::GetLastErrorMessage() { - return last_error_message_; -} - -io::ZeroCopyInputStream* DiskSourceTree::OpenVirtualFile( - const std::string& virtual_file, std::string* disk_file) { - if (virtual_file != CanonicalizePath(virtual_file) || - ContainsParentReference(virtual_file)) { - // We do not allow importing of paths containing things like ".." or - // consecutive slashes since the compiler expects files to be uniquely - // identified by file name. - last_error_message_ = - "Backslashes, consecutive slashes, \".\", or \"..\" " - "are not allowed in the virtual path"; - return NULL; - } - - for (const auto& mapping : mappings_) { - std::string temp_disk_file; - if (ApplyMapping(virtual_file, mapping.virtual_path, mapping.disk_path, - &temp_disk_file)) { - io::ZeroCopyInputStream* stream = OpenDiskFile(temp_disk_file); - if (stream != NULL) { - if (disk_file != NULL) { - *disk_file = temp_disk_file; - } - return stream; - } - - if (errno == EACCES) { - // The file exists but is not readable. - last_error_message_ = - "Read access is denied for file: " + temp_disk_file; - return NULL; - } - } - } - last_error_message_ = "File not found."; - return NULL; -} - -io::ZeroCopyInputStream* DiskSourceTree::OpenDiskFile( - const std::string& filename) { - struct stat sb; - int ret = 0; - do { - ret = stat(filename.c_str(), &sb); - } while (ret != 0 && errno == EINTR); -#if defined(_WIN32) - if (ret == 0 && sb.st_mode & S_IFDIR) { - last_error_message_ = "Input file is a directory."; - return NULL; - } -#else - if (ret == 0 && S_ISDIR(sb.st_mode)) { - last_error_message_ = "Input file is a directory."; - return NULL; - } -#endif - int file_descriptor; - do { - file_descriptor = open(filename.c_str(), O_RDONLY); - } while (file_descriptor < 0 && errno == EINTR); - if (file_descriptor >= 0) { - io::FileInputStream* result = new io::FileInputStream(file_descriptor); - result->SetCloseOnDelete(true); - return result; - } else { - return NULL; - } -} - -} // namespace compiler -} // namespace protobuf -} // namespace google diff --git a/extra/protobuf/protobuf-3.19.4/src/google/protobuf/compiler/importer.h b/extra/protobuf/protobuf-3.19.4/src/google/protobuf/compiler/importer.h deleted file mode 100644 index 08a49c55277f..000000000000 --- a/extra/protobuf/protobuf-3.19.4/src/google/protobuf/compiler/importer.h +++ /dev/null @@ -1,336 +0,0 @@ -// Protocol Buffers - Google's data interchange format -// Copyright 2008 Google Inc. All rights reserved. -// https://developers.google.com/protocol-buffers/ -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// * Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// * Redistributions in binary form must reproduce the above -// copyright notice, this list of conditions and the following disclaimer -// in the documentation and/or other materials provided with the -// distribution. -// * Neither the name of Google Inc. nor the names of its -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -// Author: kenton@google.com (Kenton Varda) -// Based on original Protocol Buffers design by -// Sanjay Ghemawat, Jeff Dean, and others. -// -// This file is the public interface to the .proto file parser. - -#ifndef GOOGLE_PROTOBUF_COMPILER_IMPORTER_H__ -#define GOOGLE_PROTOBUF_COMPILER_IMPORTER_H__ - -#include -#include -#include -#include -#include -#include -#include - -#include - -namespace google { -namespace protobuf { - -namespace io { -class ZeroCopyInputStream; -} - -namespace compiler { - -// Defined in this file. -class Importer; -class MultiFileErrorCollector; -class SourceTree; -class DiskSourceTree; - -// TODO(kenton): Move all SourceTree stuff to a separate file? - -// An implementation of DescriptorDatabase which loads files from a SourceTree -// and parses them. -// -// Note: This class is not thread-safe since it maintains a table of source -// code locations for error reporting. However, when a DescriptorPool wraps -// a DescriptorDatabase, it uses mutex locking to make sure only one method -// of the database is called at a time, even if the DescriptorPool is used -// from multiple threads. Therefore, there is only a problem if you create -// multiple DescriptorPools wrapping the same SourceTreeDescriptorDatabase -// and use them from multiple threads. -// -// Note: This class does not implement FindFileContainingSymbol() or -// FindFileContainingExtension(); these will always return false. -class PROTOBUF_EXPORT SourceTreeDescriptorDatabase : public DescriptorDatabase { - public: - SourceTreeDescriptorDatabase(SourceTree* source_tree); - - // If non-NULL, fallback_database will be checked if a file doesn't exist in - // the specified source_tree. - SourceTreeDescriptorDatabase(SourceTree* source_tree, - DescriptorDatabase* fallback_database); - ~SourceTreeDescriptorDatabase(); - - // Instructs the SourceTreeDescriptorDatabase to report any parse errors - // to the given MultiFileErrorCollector. This should be called before - // parsing. error_collector must remain valid until either this method - // is called again or the SourceTreeDescriptorDatabase is destroyed. - void RecordErrorsTo(MultiFileErrorCollector* error_collector) { - error_collector_ = error_collector; - } - - // Gets a DescriptorPool::ErrorCollector which records errors to the - // MultiFileErrorCollector specified with RecordErrorsTo(). This collector - // has the ability to determine exact line and column numbers of errors - // from the information given to it by the DescriptorPool. - DescriptorPool::ErrorCollector* GetValidationErrorCollector() { - using_validation_error_collector_ = true; - return &validation_error_collector_; - } - - // implements DescriptorDatabase ----------------------------------- - bool FindFileByName(const std::string& filename, - FileDescriptorProto* output) override; - bool FindFileContainingSymbol(const std::string& symbol_name, - FileDescriptorProto* output) override; - bool FindFileContainingExtension(const std::string& containing_type, - int field_number, - FileDescriptorProto* output) override; - - private: - class SingleFileErrorCollector; - - SourceTree* source_tree_; - DescriptorDatabase* fallback_database_; - MultiFileErrorCollector* error_collector_; - - class PROTOBUF_EXPORT ValidationErrorCollector - : public DescriptorPool::ErrorCollector { - public: - ValidationErrorCollector(SourceTreeDescriptorDatabase* owner); - ~ValidationErrorCollector(); - - // implements ErrorCollector --------------------------------------- - void AddError(const std::string& filename, const std::string& element_name, - const Message* descriptor, ErrorLocation location, - const std::string& message) override; - - void AddWarning(const std::string& filename, - const std::string& element_name, const Message* descriptor, - ErrorLocation location, - const std::string& message) override; - - private: - SourceTreeDescriptorDatabase* owner_; - }; - friend class ValidationErrorCollector; - - bool using_validation_error_collector_; - SourceLocationTable source_locations_; - ValidationErrorCollector validation_error_collector_; -}; - -// Simple interface for parsing .proto files. This wraps the process -// of opening the file, parsing it with a Parser, recursively parsing all its -// imports, and then cross-linking the results to produce a FileDescriptor. -// -// This is really just a thin wrapper around SourceTreeDescriptorDatabase. -// You may find that SourceTreeDescriptorDatabase is more flexible. -// -// TODO(kenton): I feel like this class is not well-named. -class PROTOBUF_EXPORT Importer { - public: - Importer(SourceTree* source_tree, MultiFileErrorCollector* error_collector); - ~Importer(); - - // Import the given file and build a FileDescriptor representing it. If - // the file is already in the DescriptorPool, the existing FileDescriptor - // will be returned. The FileDescriptor is property of the DescriptorPool, - // and will remain valid until it is destroyed. If any errors occur, they - // will be reported using the error collector and Import() will return NULL. - // - // A particular Importer object will only report errors for a particular - // file once. All future attempts to import the same file will return NULL - // without reporting any errors. The idea is that you might want to import - // a lot of files without seeing the same errors over and over again. If - // you want to see errors for the same files repeatedly, you can use a - // separate Importer object to import each one (but use the same - // DescriptorPool so that they can be cross-linked). - const FileDescriptor* Import(const std::string& filename); - - // The DescriptorPool in which all imported FileDescriptors and their - // contents are stored. - inline const DescriptorPool* pool() const { return &pool_; } - - void AddUnusedImportTrackFile(const std::string& file_name, - bool is_error = false); - void ClearUnusedImportTrackFiles(); - - - private: - SourceTreeDescriptorDatabase database_; - DescriptorPool pool_; - - GOOGLE_DISALLOW_EVIL_CONSTRUCTORS(Importer); -}; - -// If the importer encounters problems while trying to import the proto files, -// it reports them to a MultiFileErrorCollector. -class PROTOBUF_EXPORT MultiFileErrorCollector { - public: - inline MultiFileErrorCollector() {} - virtual ~MultiFileErrorCollector(); - - // Line and column numbers are zero-based. A line number of -1 indicates - // an error with the entire file (e.g. "not found"). - virtual void AddError(const std::string& filename, int line, int column, - const std::string& message) = 0; - - virtual void AddWarning(const std::string& /* filename */, int /* line */, - int /* column */, const std::string& /* message */) {} - - private: - GOOGLE_DISALLOW_EVIL_CONSTRUCTORS(MultiFileErrorCollector); -}; - -// Abstract interface which represents a directory tree containing proto files. -// Used by the default implementation of Importer to resolve import statements -// Most users will probably want to use the DiskSourceTree implementation, -// below. -class PROTOBUF_EXPORT SourceTree { - public: - inline SourceTree() {} - virtual ~SourceTree(); - - // Open the given file and return a stream that reads it, or NULL if not - // found. The caller takes ownership of the returned object. The filename - // must be a path relative to the root of the source tree and must not - // contain "." or ".." components. - virtual io::ZeroCopyInputStream* Open(const std::string& filename) = 0; - - // If Open() returns NULL, calling this method immediately will return an - // description of the error. - // Subclasses should implement this method and return a meaningful value for - // better error reporting. - // TODO(xiaofeng): change this to a pure virtual function. - virtual std::string GetLastErrorMessage(); - - private: - GOOGLE_DISALLOW_EVIL_CONSTRUCTORS(SourceTree); -}; - -// An implementation of SourceTree which loads files from locations on disk. -// Multiple mappings can be set up to map locations in the DiskSourceTree to -// locations in the physical filesystem. -class PROTOBUF_EXPORT DiskSourceTree : public SourceTree { - public: - DiskSourceTree(); - ~DiskSourceTree(); - - // Map a path on disk to a location in the SourceTree. The path may be - // either a file or a directory. If it is a directory, the entire tree - // under it will be mapped to the given virtual location. To map a directory - // to the root of the source tree, pass an empty string for virtual_path. - // - // If multiple mapped paths apply when opening a file, they will be searched - // in order. For example, if you do: - // MapPath("bar", "foo/bar"); - // MapPath("", "baz"); - // and then you do: - // Open("bar/qux"); - // the DiskSourceTree will first try to open foo/bar/qux, then baz/bar/qux, - // returning the first one that opens successfully. - // - // disk_path may be an absolute path or relative to the current directory, - // just like a path you'd pass to open(). - void MapPath(const std::string& virtual_path, const std::string& disk_path); - - // Return type for DiskFileToVirtualFile(). - enum DiskFileToVirtualFileResult { - SUCCESS, - SHADOWED, - CANNOT_OPEN, - NO_MAPPING - }; - - // Given a path to a file on disk, find a virtual path mapping to that - // file. The first mapping created with MapPath() whose disk_path contains - // the filename is used. However, that virtual path may not actually be - // usable to open the given file. Possible return values are: - // * SUCCESS: The mapping was found. *virtual_file is filled in so that - // calling Open(*virtual_file) will open the file named by disk_file. - // * SHADOWED: A mapping was found, but using Open() to open this virtual - // path will end up returning some different file. This is because some - // other mapping with a higher precedence also matches this virtual path - // and maps it to a different file that exists on disk. *virtual_file - // is filled in as it would be in the SUCCESS case. *shadowing_disk_file - // is filled in with the disk path of the file which would be opened if - // you were to call Open(*virtual_file). - // * CANNOT_OPEN: The mapping was found and was not shadowed, but the - // file specified cannot be opened. When this value is returned, - // errno will indicate the reason the file cannot be opened. *virtual_file - // will be set to the virtual path as in the SUCCESS case, even though - // it is not useful. - // * NO_MAPPING: Indicates that no mapping was found which contains this - // file. - DiskFileToVirtualFileResult DiskFileToVirtualFile( - const std::string& disk_file, std::string* virtual_file, - std::string* shadowing_disk_file); - - // Given a virtual path, find the path to the file on disk. - // Return true and update disk_file with the on-disk path if the file exists. - // Return false and leave disk_file untouched if the file doesn't exist. - bool VirtualFileToDiskFile(const std::string& virtual_file, - std::string* disk_file); - - // implements SourceTree ------------------------------------------- - io::ZeroCopyInputStream* Open(const std::string& filename) override; - - std::string GetLastErrorMessage() override; - - private: - struct Mapping { - std::string virtual_path; - std::string disk_path; - - inline Mapping(const std::string& virtual_path_param, - const std::string& disk_path_param) - : virtual_path(virtual_path_param), disk_path(disk_path_param) {} - }; - std::vector mappings_; - std::string last_error_message_; - - // Like Open(), but returns the on-disk path in disk_file if disk_file is - // non-NULL and the file could be successfully opened. - io::ZeroCopyInputStream* OpenVirtualFile(const std::string& virtual_file, - std::string* disk_file); - - // Like Open() but given the actual on-disk path. - io::ZeroCopyInputStream* OpenDiskFile(const std::string& filename); - - GOOGLE_DISALLOW_EVIL_CONSTRUCTORS(DiskSourceTree); -}; - -} // namespace compiler -} // namespace protobuf -} // namespace google - -#include - -#endif // GOOGLE_PROTOBUF_COMPILER_IMPORTER_H__ diff --git a/extra/protobuf/protobuf-3.19.4/src/google/protobuf/compiler/importer_unittest.cc b/extra/protobuf/protobuf-3.19.4/src/google/protobuf/compiler/importer_unittest.cc deleted file mode 100644 index daa197f46065..000000000000 --- a/extra/protobuf/protobuf-3.19.4/src/google/protobuf/compiler/importer_unittest.cc +++ /dev/null @@ -1,548 +0,0 @@ -// Protocol Buffers - Google's data interchange format -// Copyright 2008 Google Inc. All rights reserved. -// https://developers.google.com/protocol-buffers/ -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// * Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// * Redistributions in binary form must reproduce the above -// copyright notice, this list of conditions and the following disclaimer -// in the documentation and/or other materials provided with the -// distribution. -// * Neither the name of Google Inc. nor the names of its -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -// Author: kenton@google.com (Kenton Varda) -// Based on original Protocol Buffers design by -// Sanjay Ghemawat, Jeff Dean, and others. - -#include - -#include -#include - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -namespace google { -namespace protobuf { -namespace compiler { - -namespace { - -bool FileExists(const std::string& path) { - return File::Exists(path); -} - -#define EXPECT_SUBSTRING(needle, haystack) \ - EXPECT_PRED_FORMAT2(testing::IsSubstring, (needle), (haystack)) - -class MockErrorCollector : public MultiFileErrorCollector { - public: - MockErrorCollector() {} - ~MockErrorCollector() {} - - std::string text_; - std::string warning_text_; - - // implements ErrorCollector --------------------------------------- - void AddError(const std::string& filename, int line, int column, - const std::string& message) { - strings::SubstituteAndAppend(&text_, "$0:$1:$2: $3\n", filename, line, column, - message); - } - - void AddWarning(const std::string& filename, int line, int column, - const std::string& message) { - strings::SubstituteAndAppend(&warning_text_, "$0:$1:$2: $3\n", filename, line, - column, message); - } -}; - -// ------------------------------------------------------------------- - -// A dummy implementation of SourceTree backed by a simple map. -class MockSourceTree : public SourceTree { - public: - MockSourceTree() {} - ~MockSourceTree() {} - - void AddFile(const std::string& name, const char* contents) { - files_[name] = contents; - } - - // implements SourceTree ------------------------------------------- - io::ZeroCopyInputStream* Open(const std::string& filename) { - const char* contents = FindPtrOrNull(files_, filename); - if (contents == NULL) { - return NULL; - } else { - return new io::ArrayInputStream(contents, strlen(contents)); - } - } - - std::string GetLastErrorMessage() { return "File not found."; } - - private: - std::unordered_map files_; -}; - -// =================================================================== - -class ImporterTest : public testing::Test { - protected: - ImporterTest() : importer_(&source_tree_, &error_collector_) {} - - void AddFile(const std::string& filename, const char* text) { - source_tree_.AddFile(filename, text); - } - - // Return the collected error text - std::string warning() const { return error_collector_.warning_text_; } - - MockErrorCollector error_collector_; - MockSourceTree source_tree_; - Importer importer_; -}; - -TEST_F(ImporterTest, Import) { - // Test normal importing. - AddFile("foo.proto", - "syntax = \"proto2\";\n" - "message Foo {}\n"); - - const FileDescriptor* file = importer_.Import("foo.proto"); - EXPECT_EQ("", error_collector_.text_); - ASSERT_TRUE(file != NULL); - - ASSERT_EQ(1, file->message_type_count()); - EXPECT_EQ("Foo", file->message_type(0)->name()); - - // Importing again should return same object. - EXPECT_EQ(file, importer_.Import("foo.proto")); -} - -TEST_F(ImporterTest, ImportNested) { - // Test that importing a file which imports another file works. - AddFile("foo.proto", - "syntax = \"proto2\";\n" - "import \"bar.proto\";\n" - "message Foo {\n" - " optional Bar bar = 1;\n" - "}\n"); - AddFile("bar.proto", - "syntax = \"proto2\";\n" - "message Bar {}\n"); - - // Note that both files are actually parsed by the first call to Import() - // here, since foo.proto imports bar.proto. The second call just returns - // the same ProtoFile for bar.proto which was constructed while importing - // foo.proto. We test that this is the case below by checking that bar - // is among foo's dependencies (by pointer). - const FileDescriptor* foo = importer_.Import("foo.proto"); - const FileDescriptor* bar = importer_.Import("bar.proto"); - EXPECT_EQ("", error_collector_.text_); - ASSERT_TRUE(foo != NULL); - ASSERT_TRUE(bar != NULL); - - // Check that foo's dependency is the same object as bar. - ASSERT_EQ(1, foo->dependency_count()); - EXPECT_EQ(bar, foo->dependency(0)); - - // Check that foo properly cross-links bar. - ASSERT_EQ(1, foo->message_type_count()); - ASSERT_EQ(1, bar->message_type_count()); - ASSERT_EQ(1, foo->message_type(0)->field_count()); - ASSERT_EQ(FieldDescriptor::TYPE_MESSAGE, - foo->message_type(0)->field(0)->type()); - EXPECT_EQ(bar->message_type(0), - foo->message_type(0)->field(0)->message_type()); -} - -TEST_F(ImporterTest, FileNotFound) { - // Error: Parsing a file that doesn't exist. - EXPECT_TRUE(importer_.Import("foo.proto") == NULL); - EXPECT_EQ("foo.proto:-1:0: File not found.\n", error_collector_.text_); -} - -TEST_F(ImporterTest, ImportNotFound) { - // Error: Importing a file that doesn't exist. - AddFile("foo.proto", - "syntax = \"proto2\";\n" - "import \"bar.proto\";\n"); - - EXPECT_TRUE(importer_.Import("foo.proto") == NULL); - EXPECT_EQ( - "bar.proto:-1:0: File not found.\n" - "foo.proto:1:0: Import \"bar.proto\" was not found or had errors.\n", - error_collector_.text_); -} - -TEST_F(ImporterTest, RecursiveImport) { - // Error: Recursive import. - AddFile("recursive1.proto", - "syntax = \"proto2\";\n" - "\n" - "import \"recursive2.proto\";\n"); - AddFile("recursive2.proto", - "syntax = \"proto2\";\n" - "import \"recursive1.proto\";\n"); - - EXPECT_TRUE(importer_.Import("recursive1.proto") == NULL); - EXPECT_EQ( - "recursive1.proto:2:0: File recursively imports itself: " - "recursive1.proto " - "-> recursive2.proto -> recursive1.proto\n" - "recursive2.proto:1:0: Import \"recursive1.proto\" was not found " - "or had errors.\n" - "recursive1.proto:2:0: Import \"recursive2.proto\" was not found " - "or had errors.\n", - error_collector_.text_); -} - -TEST_F(ImporterTest, RecursiveImportSelf) { - // Error: Recursive import. - AddFile("recursive.proto", - "syntax = \"proto2\";\n" - "\n" - "import \"recursive.proto\";\n"); - - EXPECT_TRUE(importer_.Import("recursive.proto") == nullptr); - EXPECT_EQ( - "recursive.proto:2:0: File recursively imports itself: " - "recursive.proto -> recursive.proto\n", - error_collector_.text_); -} - -TEST_F(ImporterTest, LiteRuntimeImport) { - // Error: Recursive import. - AddFile("bar.proto", - "syntax = \"proto2\";\n" - "option optimize_for = LITE_RUNTIME;\n"); - AddFile("foo.proto", - "syntax = \"proto2\";\n" - "import \"bar.proto\";\n"); - - EXPECT_TRUE(importer_.Import("foo.proto") == nullptr); - EXPECT_EQ( - "foo.proto:1:0: Files that do not use optimize_for = LITE_RUNTIME " - "cannot import files which do use this option. This file is not " - "lite, but it imports \"bar.proto\" which is.\n", - error_collector_.text_); -} - - -// =================================================================== - -class DiskSourceTreeTest : public testing::Test { - protected: - virtual void SetUp() { - dirnames_.push_back(TestTempDir() + "/test_proto2_import_path_1"); - dirnames_.push_back(TestTempDir() + "/test_proto2_import_path_2"); - - for (int i = 0; i < dirnames_.size(); i++) { - if (FileExists(dirnames_[i])) { - File::DeleteRecursively(dirnames_[i], NULL, NULL); - } - GOOGLE_CHECK_OK(File::CreateDir(dirnames_[i], 0777)); - } - } - - virtual void TearDown() { - for (int i = 0; i < dirnames_.size(); i++) { - if (FileExists(dirnames_[i])) { - File::DeleteRecursively(dirnames_[i], NULL, NULL); - } - } - } - - void AddFile(const std::string& filename, const char* contents) { - GOOGLE_CHECK_OK(File::SetContents(filename, contents, true)); - } - - void AddSubdir(const std::string& dirname) { - GOOGLE_CHECK_OK(File::CreateDir(dirname, 0777)); - } - - void ExpectFileContents(const std::string& filename, - const char* expected_contents) { - std::unique_ptr input(source_tree_.Open(filename)); - - ASSERT_FALSE(input == NULL); - - // Read all the data from the file. - std::string file_contents; - const void* data; - int size; - while (input->Next(&data, &size)) { - file_contents.append(reinterpret_cast(data), size); - } - - EXPECT_EQ(expected_contents, file_contents); - } - - void ExpectCannotOpenFile(const std::string& filename, - const std::string& error_message) { - std::unique_ptr input(source_tree_.Open(filename)); - EXPECT_TRUE(input == NULL); - EXPECT_EQ(error_message, source_tree_.GetLastErrorMessage()); - } - - DiskSourceTree source_tree_; - - // Paths of two on-disk directories to use during the test. - std::vector dirnames_; -}; - -TEST_F(DiskSourceTreeTest, MapRoot) { - // Test opening a file in a directory that is mapped to the root of the - // source tree. - AddFile(dirnames_[0] + "/foo", "Hello World!"); - source_tree_.MapPath("", dirnames_[0]); - - ExpectFileContents("foo", "Hello World!"); - ExpectCannotOpenFile("bar", "File not found."); -} - -TEST_F(DiskSourceTreeTest, MapDirectory) { - // Test opening a file in a directory that is mapped to somewhere other - // than the root of the source tree. - - AddFile(dirnames_[0] + "/foo", "Hello World!"); - source_tree_.MapPath("baz", dirnames_[0]); - - ExpectFileContents("baz/foo", "Hello World!"); - ExpectCannotOpenFile("baz/bar", "File not found."); - ExpectCannotOpenFile("foo", "File not found."); - ExpectCannotOpenFile("bar", "File not found."); - - // Non-canonical file names should not work. - ExpectCannotOpenFile("baz//foo", - "Backslashes, consecutive slashes, \".\", or \"..\" are " - "not allowed in the virtual path"); - ExpectCannotOpenFile("baz/../baz/foo", - "Backslashes, consecutive slashes, \".\", or \"..\" are " - "not allowed in the virtual path"); - ExpectCannotOpenFile("baz/./foo", - "Backslashes, consecutive slashes, \".\", or \"..\" are " - "not allowed in the virtual path"); - ExpectCannotOpenFile("baz/foo/", "File not found."); -} - -TEST_F(DiskSourceTreeTest, NoParent) { - // Test that we cannot open files in a parent of a mapped directory. - - AddFile(dirnames_[0] + "/foo", "Hello World!"); - AddSubdir(dirnames_[0] + "/bar"); - AddFile(dirnames_[0] + "/bar/baz", "Blah."); - source_tree_.MapPath("", dirnames_[0] + "/bar"); - - ExpectFileContents("baz", "Blah."); - ExpectCannotOpenFile("../foo", - "Backslashes, consecutive slashes, \".\", or \"..\" are " - "not allowed in the virtual path"); - ExpectCannotOpenFile("../bar/baz", - "Backslashes, consecutive slashes, \".\", or \"..\" are " - "not allowed in the virtual path"); -} - -TEST_F(DiskSourceTreeTest, MapFile) { - // Test opening a file that is mapped directly into the source tree. - - AddFile(dirnames_[0] + "/foo", "Hello World!"); - source_tree_.MapPath("foo", dirnames_[0] + "/foo"); - - ExpectFileContents("foo", "Hello World!"); - ExpectCannotOpenFile("bar", "File not found."); -} - -TEST_F(DiskSourceTreeTest, SearchMultipleDirectories) { - // Test mapping and searching multiple directories. - - AddFile(dirnames_[0] + "/foo", "Hello World!"); - AddFile(dirnames_[1] + "/foo", "This file should be hidden."); - AddFile(dirnames_[1] + "/bar", "Goodbye World!"); - source_tree_.MapPath("", dirnames_[0]); - source_tree_.MapPath("", dirnames_[1]); - - ExpectFileContents("foo", "Hello World!"); - ExpectFileContents("bar", "Goodbye World!"); - ExpectCannotOpenFile("baz", "File not found."); -} - -TEST_F(DiskSourceTreeTest, OrderingTrumpsSpecificity) { - // Test that directories are always searched in order, even when a latter - // directory is more-specific than a former one. - - // Create the "bar" directory so we can put a file in it. - GOOGLE_CHECK_OK(File::CreateDir(dirnames_[0] + "/bar", 0777)); - - // Add files and map paths. - AddFile(dirnames_[0] + "/bar/foo", "Hello World!"); - AddFile(dirnames_[1] + "/foo", "This file should be hidden."); - source_tree_.MapPath("", dirnames_[0]); - source_tree_.MapPath("bar", dirnames_[1]); - - // Check. - ExpectFileContents("bar/foo", "Hello World!"); -} - -TEST_F(DiskSourceTreeTest, DiskFileToVirtualFile) { - // Test DiskFileToVirtualFile. - - AddFile(dirnames_[0] + "/foo", "Hello World!"); - AddFile(dirnames_[1] + "/foo", "This file should be hidden."); - source_tree_.MapPath("bar", dirnames_[0]); - source_tree_.MapPath("bar", dirnames_[1]); - - std::string virtual_file; - std::string shadowing_disk_file; - - EXPECT_EQ(DiskSourceTree::NO_MAPPING, - source_tree_.DiskFileToVirtualFile("/foo", &virtual_file, - &shadowing_disk_file)); - - EXPECT_EQ(DiskSourceTree::SHADOWED, - source_tree_.DiskFileToVirtualFile( - dirnames_[1] + "/foo", &virtual_file, &shadowing_disk_file)); - EXPECT_EQ("bar/foo", virtual_file); - EXPECT_EQ(dirnames_[0] + "/foo", shadowing_disk_file); - - EXPECT_EQ(DiskSourceTree::CANNOT_OPEN, - source_tree_.DiskFileToVirtualFile( - dirnames_[1] + "/baz", &virtual_file, &shadowing_disk_file)); - EXPECT_EQ("bar/baz", virtual_file); - - EXPECT_EQ(DiskSourceTree::SUCCESS, - source_tree_.DiskFileToVirtualFile( - dirnames_[0] + "/foo", &virtual_file, &shadowing_disk_file)); - EXPECT_EQ("bar/foo", virtual_file); -} - -TEST_F(DiskSourceTreeTest, DiskFileToVirtualFileCanonicalization) { - // Test handling of "..", ".", etc. in DiskFileToVirtualFile(). - - source_tree_.MapPath("dir1", ".."); - source_tree_.MapPath("dir2", "../../foo"); - source_tree_.MapPath("dir3", "./foo/bar/."); - source_tree_.MapPath("dir4", "."); - source_tree_.MapPath("", "/qux"); - source_tree_.MapPath("dir5", "/quux/"); - - std::string virtual_file; - std::string shadowing_disk_file; - - // "../.." should not be considered to be under "..". - EXPECT_EQ(DiskSourceTree::NO_MAPPING, - source_tree_.DiskFileToVirtualFile("../../baz", &virtual_file, - &shadowing_disk_file)); - - // "/foo" is not mapped (it should not be misinterpreted as being under "."). - EXPECT_EQ(DiskSourceTree::NO_MAPPING, - source_tree_.DiskFileToVirtualFile("/foo", &virtual_file, - &shadowing_disk_file)); - -#ifdef WIN32 - // "C:\foo" is not mapped (it should not be misinterpreted as being under - // "."). - EXPECT_EQ(DiskSourceTree::NO_MAPPING, - source_tree_.DiskFileToVirtualFile("C:\\foo", &virtual_file, - &shadowing_disk_file)); -#endif // WIN32 - - // But "../baz" should be. - EXPECT_EQ(DiskSourceTree::CANNOT_OPEN, - source_tree_.DiskFileToVirtualFile("../baz", &virtual_file, - &shadowing_disk_file)); - EXPECT_EQ("dir1/baz", virtual_file); - - // "../../foo/baz" is under "../../foo". - EXPECT_EQ(DiskSourceTree::CANNOT_OPEN, - source_tree_.DiskFileToVirtualFile("../../foo/baz", &virtual_file, - &shadowing_disk_file)); - EXPECT_EQ("dir2/baz", virtual_file); - - // "foo/./bar/baz" is under "./foo/bar/.". - EXPECT_EQ(DiskSourceTree::CANNOT_OPEN, - source_tree_.DiskFileToVirtualFile("foo/bar/baz", &virtual_file, - &shadowing_disk_file)); - EXPECT_EQ("dir3/baz", virtual_file); - - // "bar" is under ".". - EXPECT_EQ(DiskSourceTree::CANNOT_OPEN, - source_tree_.DiskFileToVirtualFile("bar", &virtual_file, - &shadowing_disk_file)); - EXPECT_EQ("dir4/bar", virtual_file); - - // "/qux/baz" is under "/qux". - EXPECT_EQ(DiskSourceTree::CANNOT_OPEN, - source_tree_.DiskFileToVirtualFile("/qux/baz", &virtual_file, - &shadowing_disk_file)); - EXPECT_EQ("baz", virtual_file); - - // "/quux/bar" is under "/quux". - EXPECT_EQ(DiskSourceTree::CANNOT_OPEN, - source_tree_.DiskFileToVirtualFile("/quux/bar", &virtual_file, - &shadowing_disk_file)); - EXPECT_EQ("dir5/bar", virtual_file); -} - -TEST_F(DiskSourceTreeTest, VirtualFileToDiskFile) { - // Test VirtualFileToDiskFile. - - AddFile(dirnames_[0] + "/foo", "Hello World!"); - AddFile(dirnames_[1] + "/foo", "This file should be hidden."); - AddFile(dirnames_[1] + "/quux", "This file should not be hidden."); - source_tree_.MapPath("bar", dirnames_[0]); - source_tree_.MapPath("bar", dirnames_[1]); - - // Existent files, shadowed and non-shadowed case. - std::string disk_file; - EXPECT_TRUE(source_tree_.VirtualFileToDiskFile("bar/foo", &disk_file)); - EXPECT_EQ(dirnames_[0] + "/foo", disk_file); - EXPECT_TRUE(source_tree_.VirtualFileToDiskFile("bar/quux", &disk_file)); - EXPECT_EQ(dirnames_[1] + "/quux", disk_file); - - // Nonexistent file in existent directory and vice versa. - std::string not_touched = "not touched"; - EXPECT_FALSE(source_tree_.VirtualFileToDiskFile("bar/baz", ¬_touched)); - EXPECT_EQ("not touched", not_touched); - EXPECT_FALSE(source_tree_.VirtualFileToDiskFile("baz/foo", ¬_touched)); - EXPECT_EQ("not touched", not_touched); - - // Accept NULL as output parameter. - EXPECT_TRUE(source_tree_.VirtualFileToDiskFile("bar/foo", NULL)); - EXPECT_FALSE(source_tree_.VirtualFileToDiskFile("baz/foo", NULL)); -} - -} // namespace - -} // namespace compiler -} // namespace protobuf -} // namespace google diff --git a/extra/protobuf/protobuf-3.19.4/src/google/protobuf/compiler/java/java_context.cc b/extra/protobuf/protobuf-3.19.4/src/google/protobuf/compiler/java/java_context.cc deleted file mode 100644 index fea870f1ca44..000000000000 --- a/extra/protobuf/protobuf-3.19.4/src/google/protobuf/compiler/java/java_context.cc +++ /dev/null @@ -1,202 +0,0 @@ -// Protocol Buffers - Google's data interchange format -// Copyright 2008 Google Inc. All rights reserved. -// https://developers.google.com/protocol-buffers/ -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// * Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// * Redistributions in binary form must reproduce the above -// copyright notice, this list of conditions and the following disclaimer -// in the documentation and/or other materials provided with the -// distribution. -// * Neither the name of Google Inc. nor the names of its -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -#include - -#include -#include -#include -#include -#include -#include - -namespace google { -namespace protobuf { -namespace compiler { -namespace java { - -Context::Context(const FileDescriptor* file, const Options& options) - : name_resolver_(new ClassNameResolver), options_(options) { - InitializeFieldGeneratorInfo(file); -} - -Context::~Context() {} - -ClassNameResolver* Context::GetNameResolver() const { - return name_resolver_.get(); -} - -namespace { -// Whether two fields have conflicting accessors (assuming name1 and name2 -// are different). name1 and name2 are field1 and field2's camel-case name -// respectively. -bool IsConflicting(const FieldDescriptor* field1, const std::string& name1, - const FieldDescriptor* field2, const std::string& name2, - std::string* info) { - if (field1->is_repeated()) { - if (field2->is_repeated()) { - // Both fields are repeated. - return false; - } else { - // field1 is repeated, and field2 is not. - if (name1 + "Count" == name2) { - *info = "both repeated field \"" + field1->name() + "\" and singular " + - "field \"" + field2->name() + "\" generate the method \"" + - "get" + name1 + "Count()\""; - return true; - } - if (name1 + "List" == name2) { - *info = "both repeated field \"" + field1->name() + "\" and singular " + - "field \"" + field2->name() + "\" generate the method \"" + - "get" + name1 + "List()\""; - return true; - } - // Well, there are obviously many more conflicting cases, but it probably - // doesn't worth the effort to exhaust all of them because they rarely - // happen and as we are continuing adding new methods/changing existing - // methods the number of different conflicting cases will keep growing. - // We can just add more cases here when they are found in the real world. - return false; - } - } else { - if (field2->is_repeated()) { - return IsConflicting(field2, name2, field1, name1, info); - } else { - // None of the two fields are repeated. - return false; - } - } -} -} // namespace - -void Context::InitializeFieldGeneratorInfo(const FileDescriptor* file) { - for (int i = 0; i < file->message_type_count(); ++i) { - InitializeFieldGeneratorInfoForMessage(file->message_type(i)); - } -} - -void Context::InitializeFieldGeneratorInfoForMessage( - const Descriptor* message) { - for (int i = 0; i < message->nested_type_count(); ++i) { - InitializeFieldGeneratorInfoForMessage(message->nested_type(i)); - } - std::vector fields; - fields.reserve(message->field_count()); - for (int i = 0; i < message->field_count(); ++i) { - fields.push_back(message->field(i)); - } - InitializeFieldGeneratorInfoForFields(fields); - - for (int i = 0; i < message->oneof_decl_count(); ++i) { - const OneofDescriptor* oneof = message->oneof_decl(i); - OneofGeneratorInfo info; - info.name = UnderscoresToCamelCase(oneof->name(), false); - info.capitalized_name = UnderscoresToCamelCase(oneof->name(), true); - oneof_generator_info_map_[oneof] = info; - } -} - -void Context::InitializeFieldGeneratorInfoForFields( - const std::vector& fields) { - // Find out all fields that conflict with some other field in the same - // message. - std::vector is_conflict(fields.size()); - std::vector conflict_reason(fields.size()); - for (int i = 0; i < fields.size(); ++i) { - const FieldDescriptor* field = fields[i]; - const std::string& name = UnderscoresToCapitalizedCamelCase(field); - for (int j = i + 1; j < fields.size(); ++j) { - const FieldDescriptor* other = fields[j]; - const std::string& other_name = UnderscoresToCapitalizedCamelCase(other); - if (name == other_name) { - is_conflict[i] = is_conflict[j] = true; - conflict_reason[i] = conflict_reason[j] = - "capitalized name of field \"" + field->name() + - "\" conflicts with field \"" + other->name() + "\""; - } else if (IsConflicting(field, name, other, other_name, - &conflict_reason[j])) { - is_conflict[i] = is_conflict[j] = true; - conflict_reason[i] = conflict_reason[j]; - } - } - if (is_conflict[i]) { - GOOGLE_LOG(WARNING) << "field \"" << field->full_name() << "\" is conflicting " - << "with another field: " << conflict_reason[i]; - } - } - for (int i = 0; i < fields.size(); ++i) { - const FieldDescriptor* field = fields[i]; - FieldGeneratorInfo info; - info.name = CamelCaseFieldName(field); - info.capitalized_name = UnderscoresToCapitalizedCamelCase(field); - // For fields conflicting with some other fields, we append the field - // number to their field names in generated code to avoid conflicts. - if (is_conflict[i]) { - info.name += StrCat(field->number()); - info.capitalized_name += StrCat(field->number()); - info.disambiguated_reason = conflict_reason[i]; - } - field_generator_info_map_[field] = info; - } -} - -const FieldGeneratorInfo* Context::GetFieldGeneratorInfo( - const FieldDescriptor* field) const { - const FieldGeneratorInfo* result = - FindOrNull(field_generator_info_map_, field); - if (result == NULL) { - GOOGLE_LOG(FATAL) << "Can not find FieldGeneratorInfo for field: " - << field->full_name(); - } - return result; -} - -const OneofGeneratorInfo* Context::GetOneofGeneratorInfo( - const OneofDescriptor* oneof) const { - const OneofGeneratorInfo* result = - FindOrNull(oneof_generator_info_map_, oneof); - if (result == NULL) { - GOOGLE_LOG(FATAL) << "Can not find OneofGeneratorInfo for oneof: " - << oneof->name(); - } - return result; -} - -// Does this message class have generated parsing, serialization, and other -// standard methods for which reflection-based fallback implementations exist? -bool Context::HasGeneratedMethods(const Descriptor* descriptor) const { - return options_.enforce_lite || - descriptor->file()->options().optimize_for() != FileOptions::CODE_SIZE; -} - -} // namespace java -} // namespace compiler -} // namespace protobuf -} // namespace google diff --git a/extra/protobuf/protobuf-3.19.4/src/google/protobuf/compiler/java/java_context.h b/extra/protobuf/protobuf-3.19.4/src/google/protobuf/compiler/java/java_context.h deleted file mode 100644 index 3fa6af17789a..000000000000 --- a/extra/protobuf/protobuf-3.19.4/src/google/protobuf/compiler/java/java_context.h +++ /dev/null @@ -1,113 +0,0 @@ -// Protocol Buffers - Google's data interchange format -// Copyright 2008 Google Inc. All rights reserved. -// https://developers.google.com/protocol-buffers/ -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// * Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// * Redistributions in binary form must reproduce the above -// copyright notice, this list of conditions and the following disclaimer -// in the documentation and/or other materials provided with the -// distribution. -// * Neither the name of Google Inc. nor the names of its -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -#ifndef GOOGLE_PROTOBUF_COMPILER_JAVA_CONTEXT_H__ -#define GOOGLE_PROTOBUF_COMPILER_JAVA_CONTEXT_H__ - -#include -#include -#include - -#include -#include - -namespace google { -namespace protobuf { -class FileDescriptor; -class FieldDescriptor; -class OneofDescriptor; -class Descriptor; -class EnumDescriptor; -namespace compiler { -namespace java { -class ClassNameResolver; // name_resolver.h -} -} // namespace compiler -} // namespace protobuf -} // namespace google - -namespace google { -namespace protobuf { -namespace compiler { -namespace java { - -struct FieldGeneratorInfo; -struct OneofGeneratorInfo; -// A context object holds the information that is shared among all code -// generators. -class Context { - public: - Context(const FileDescriptor* file, const Options& options); - ~Context(); - - // Get the name resolver associated with this context. The resolver - // can be used to map descriptors to Java class names. - ClassNameResolver* GetNameResolver() const; - - // Get the FieldGeneratorInfo for a given field. - const FieldGeneratorInfo* GetFieldGeneratorInfo( - const FieldDescriptor* field) const; - - // Get the OneofGeneratorInfo for a given oneof. - const OneofGeneratorInfo* GetOneofGeneratorInfo( - const OneofDescriptor* oneof) const; - - const Options& options() const { return options_; } - - // Enforces all the files (including transitive dependencies) to use - // LiteRuntime. - - bool EnforceLite() const { return options_.enforce_lite; } - - // Does this message class have generated parsing, serialization, and other - // standard methods for which reflection-based fallback implementations exist? - bool HasGeneratedMethods(const Descriptor* descriptor) const; - - private: - void InitializeFieldGeneratorInfo(const FileDescriptor* file); - void InitializeFieldGeneratorInfoForMessage(const Descriptor* message); - void InitializeFieldGeneratorInfoForFields( - const std::vector& fields); - - std::unique_ptr name_resolver_; - std::map - field_generator_info_map_; - std::map - oneof_generator_info_map_; - Options options_; - GOOGLE_DISALLOW_EVIL_CONSTRUCTORS(Context); -}; - -} // namespace java -} // namespace compiler -} // namespace protobuf -} // namespace google - -#endif // GOOGLE_PROTOBUF_COMPILER_JAVA_CONTEXT_H__ diff --git a/extra/protobuf/protobuf-3.19.4/src/google/protobuf/compiler/java/java_doc_comment.cc b/extra/protobuf/protobuf-3.19.4/src/google/protobuf/compiler/java/java_doc_comment.cc deleted file mode 100644 index 80b79025dfd7..000000000000 --- a/extra/protobuf/protobuf-3.19.4/src/google/protobuf/compiler/java/java_doc_comment.cc +++ /dev/null @@ -1,435 +0,0 @@ -// Protocol Buffers - Google's data interchange format -// Copyright 2008 Google Inc. All rights reserved. -// https://developers.google.com/protocol-buffers/ -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// * Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// * Redistributions in binary form must reproduce the above -// copyright notice, this list of conditions and the following disclaimer -// in the documentation and/or other materials provided with the -// distribution. -// * Neither the name of Google Inc. nor the names of its -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -// Author: kenton@google.com (Kenton Varda) -// Based on original Protocol Buffers design by -// Sanjay Ghemawat, Jeff Dean, and others. - -#include - -#include - -#include -#include -#include - -namespace google { -namespace protobuf { -namespace compiler { -namespace java { - -std::string EscapeJavadoc(const std::string& input) { - std::string result; - result.reserve(input.size() * 2); - - char prev = '*'; - - for (std::string::size_type i = 0; i < input.size(); i++) { - char c = input[i]; - switch (c) { - case '*': - // Avoid "/*". - if (prev == '/') { - result.append("*"); - } else { - result.push_back(c); - } - break; - case '/': - // Avoid "*/". - if (prev == '*') { - result.append("/"); - } else { - result.push_back(c); - } - break; - case '@': - // '@' starts javadoc tags including the @deprecated tag, which will - // cause a compile-time error if inserted before a declaration that - // does not have a corresponding @Deprecated annotation. - result.append("@"); - break; - case '<': - // Avoid interpretation as HTML. - result.append("<"); - break; - case '>': - // Avoid interpretation as HTML. - result.append(">"); - break; - case '&': - // Avoid interpretation as HTML. - result.append("&"); - break; - case '\\': - // Java interprets Unicode escape sequences anywhere! - result.append("\"); - break; - default: - result.push_back(c); - break; - } - - prev = c; - } - - return result; -} - -static void WriteDocCommentBodyForLocation(io::Printer* printer, - const SourceLocation& location) { - std::string comments = location.leading_comments.empty() - ? location.trailing_comments - : location.leading_comments; - if (!comments.empty()) { - // TODO(kenton): Ideally we should parse the comment text as Markdown and - // write it back as HTML, but this requires a Markdown parser. For now - // we just use
 to get fixed-width text formatting.
-
-    // If the comment itself contains block comment start or end markers,
-    // HTML-escape them so that they don't accidentally close the doc comment.
-    comments = EscapeJavadoc(comments);
-
-    std::vector lines = Split(comments, "\n");
-    while (!lines.empty() && lines.back().empty()) {
-      lines.pop_back();
-    }
-
-    printer->Print(" * 
\n");
-    for (int i = 0; i < lines.size(); i++) {
-      // Most lines should start with a space.  Watch out for lines that start
-      // with a /, since putting that right after the leading asterisk will
-      // close the comment.
-      if (!lines[i].empty() && lines[i][0] == '/') {
-        printer->Print(" * $line$\n", "line", lines[i]);
-      } else {
-        printer->Print(" *$line$\n", "line", lines[i]);
-      }
-    }
-    printer->Print(
-        " * 
\n" - " *\n"); - } -} - -template -static void WriteDocCommentBody(io::Printer* printer, - const DescriptorType* descriptor) { - SourceLocation location; - if (descriptor->GetSourceLocation(&location)) { - WriteDocCommentBodyForLocation(printer, location); - } -} - -static std::string FirstLineOf(const std::string& value) { - std::string result = value; - - std::string::size_type pos = result.find_first_of('\n'); - if (pos != std::string::npos) { - result.erase(pos); - } - - // If line ends in an opening brace, make it "{ ... }" so it looks nice. - if (!result.empty() && result[result.size() - 1] == '{') { - result.append(" ... }"); - } - - return result; -} - -void WriteMessageDocComment(io::Printer* printer, const Descriptor* message) { - printer->Print("/**\n"); - WriteDocCommentBody(printer, message); - printer->Print( - " * Protobuf type {@code $fullname$}\n" - " */\n", - "fullname", EscapeJavadoc(message->full_name())); -} - -void WriteFieldDocComment(io::Printer* printer, const FieldDescriptor* field) { - // We start the comment with the main body based on the comments from the - // .proto file (if present). We then continue with the field declaration, - // e.g.: - // optional string foo = 5; - // And then we end with the javadoc tags if applicable. - // If the field is a group, the debug string might end with {. - printer->Print("/**\n"); - WriteDocCommentBody(printer, field); - printer->Print(" * $def$\n", "def", - EscapeJavadoc(FirstLineOf(field->DebugString()))); - printer->Print(" */\n"); -} - -void WriteDeprecatedJavadoc(io::Printer* printer, const FieldDescriptor* field, - const FieldAccessorType type) { - if (!field->options().deprecated()) { - return; - } - - // Lite codegen does not annotate set & clear methods with @Deprecated. - if (field->file()->options().optimize_for() == FileOptions::LITE_RUNTIME && - (type == SETTER || type == CLEARER)) { - return; - } - - printer->Print(" * @deprecated\n"); -} - -void WriteFieldAccessorDocComment(io::Printer* printer, - const FieldDescriptor* field, - const FieldAccessorType type, - const bool builder) { - printer->Print("/**\n"); - WriteDocCommentBody(printer, field); - printer->Print(" * $def$\n", "def", - EscapeJavadoc(FirstLineOf(field->DebugString()))); - WriteDeprecatedJavadoc(printer, field, type); - switch (type) { - case HAZZER: - printer->Print(" * @return Whether the $name$ field is set.\n", "name", - field->camelcase_name()); - break; - case GETTER: - printer->Print(" * @return The $name$.\n", "name", - field->camelcase_name()); - break; - case SETTER: - printer->Print(" * @param value The $name$ to set.\n", "name", - field->camelcase_name()); - break; - case CLEARER: - // Print nothing - break; - // Repeated - case LIST_COUNT: - printer->Print(" * @return The count of $name$.\n", "name", - field->camelcase_name()); - break; - case LIST_GETTER: - printer->Print(" * @return A list containing the $name$.\n", "name", - field->camelcase_name()); - break; - case LIST_INDEXED_GETTER: - printer->Print(" * @param index The index of the element to return.\n"); - printer->Print(" * @return The $name$ at the given index.\n", "name", - field->camelcase_name()); - break; - case LIST_INDEXED_SETTER: - printer->Print(" * @param index The index to set the value at.\n"); - printer->Print(" * @param value The $name$ to set.\n", "name", - field->camelcase_name()); - break; - case LIST_ADDER: - printer->Print(" * @param value The $name$ to add.\n", "name", - field->camelcase_name()); - break; - case LIST_MULTI_ADDER: - printer->Print(" * @param values The $name$ to add.\n", "name", - field->camelcase_name()); - break; - } - if (builder) { - printer->Print(" * @return This builder for chaining.\n"); - } - printer->Print(" */\n"); -} - -void WriteFieldEnumValueAccessorDocComment(io::Printer* printer, - const FieldDescriptor* field, - const FieldAccessorType type, - const bool builder) { - printer->Print("/**\n"); - WriteDocCommentBody(printer, field); - printer->Print(" * $def$\n", "def", - EscapeJavadoc(FirstLineOf(field->DebugString()))); - WriteDeprecatedJavadoc(printer, field, type); - switch (type) { - case HAZZER: - // Should never happen - break; - case GETTER: - printer->Print( - " * @return The enum numeric value on the wire for $name$.\n", "name", - field->camelcase_name()); - break; - case SETTER: - printer->Print( - " * @param value The enum numeric value on the wire for $name$ to " - "set.\n", - "name", field->camelcase_name()); - break; - case CLEARER: - // Print nothing - break; - // Repeated - case LIST_COUNT: - // Should never happen - break; - case LIST_GETTER: - printer->Print( - " * @return A list containing the enum numeric values on the wire " - "for $name$.\n", - "name", field->camelcase_name()); - break; - case LIST_INDEXED_GETTER: - printer->Print(" * @param index The index of the value to return.\n"); - printer->Print( - " * @return The enum numeric value on the wire of $name$ at the " - "given index.\n", - "name", field->camelcase_name()); - break; - case LIST_INDEXED_SETTER: - printer->Print(" * @param index The index to set the value at.\n"); - printer->Print( - " * @param value The enum numeric value on the wire for $name$ to " - "set.\n", - "name", field->camelcase_name()); - break; - case LIST_ADDER: - printer->Print( - " * @param value The enum numeric value on the wire for $name$ to " - "add.\n", - "name", field->camelcase_name()); - break; - case LIST_MULTI_ADDER: - printer->Print( - " * @param values The enum numeric values on the wire for $name$ to " - "add.\n", - "name", field->camelcase_name()); - break; - } - if (builder) { - printer->Print(" * @return This builder for chaining.\n"); - } - printer->Print(" */\n"); -} - -void WriteFieldStringBytesAccessorDocComment(io::Printer* printer, - const FieldDescriptor* field, - const FieldAccessorType type, - const bool builder) { - printer->Print("/**\n"); - WriteDocCommentBody(printer, field); - printer->Print(" * $def$\n", "def", - EscapeJavadoc(FirstLineOf(field->DebugString()))); - WriteDeprecatedJavadoc(printer, field, type); - switch (type) { - case HAZZER: - // Should never happen - break; - case GETTER: - printer->Print(" * @return The bytes for $name$.\n", "name", - field->camelcase_name()); - break; - case SETTER: - printer->Print(" * @param value The bytes for $name$ to set.\n", "name", - field->camelcase_name()); - break; - case CLEARER: - // Print nothing - break; - // Repeated - case LIST_COUNT: - // Should never happen - break; - case LIST_GETTER: - printer->Print(" * @return A list containing the bytes for $name$.\n", - "name", field->camelcase_name()); - break; - case LIST_INDEXED_GETTER: - printer->Print(" * @param index The index of the value to return.\n"); - printer->Print(" * @return The bytes of the $name$ at the given index.\n", - "name", field->camelcase_name()); - break; - case LIST_INDEXED_SETTER: - printer->Print(" * @param index The index to set the value at.\n"); - printer->Print(" * @param value The bytes of the $name$ to set.\n", - "name", field->camelcase_name()); - break; - case LIST_ADDER: - printer->Print(" * @param value The bytes of the $name$ to add.\n", - "name", field->camelcase_name()); - break; - case LIST_MULTI_ADDER: - printer->Print(" * @param values The bytes of the $name$ to add.\n", - "name", field->camelcase_name()); - break; - } - if (builder) { - printer->Print(" * @return This builder for chaining.\n"); - } - printer->Print(" */\n"); -} - -// Enum - -void WriteEnumDocComment(io::Printer* printer, const EnumDescriptor* enum_) { - printer->Print("/**\n"); - WriteDocCommentBody(printer, enum_); - printer->Print( - " * Protobuf enum {@code $fullname$}\n" - " */\n", - "fullname", EscapeJavadoc(enum_->full_name())); -} - -void WriteEnumValueDocComment(io::Printer* printer, - const EnumValueDescriptor* value) { - printer->Print("/**\n"); - WriteDocCommentBody(printer, value); - printer->Print( - " * $def$\n" - " */\n", - "def", EscapeJavadoc(FirstLineOf(value->DebugString()))); -} - -void WriteServiceDocComment(io::Printer* printer, - const ServiceDescriptor* service) { - printer->Print("/**\n"); - WriteDocCommentBody(printer, service); - printer->Print( - " * Protobuf service {@code $fullname$}\n" - " */\n", - "fullname", EscapeJavadoc(service->full_name())); -} - -void WriteMethodDocComment(io::Printer* printer, - const MethodDescriptor* method) { - printer->Print("/**\n"); - WriteDocCommentBody(printer, method); - printer->Print( - " * $def$\n" - " */\n", - "def", EscapeJavadoc(FirstLineOf(method->DebugString()))); -} - -} // namespace java -} // namespace compiler -} // namespace protobuf -} // namespace google diff --git a/extra/protobuf/protobuf-3.19.4/src/google/protobuf/compiler/java/java_doc_comment.h b/extra/protobuf/protobuf-3.19.4/src/google/protobuf/compiler/java/java_doc_comment.h deleted file mode 100644 index b7de8776708d..000000000000 --- a/extra/protobuf/protobuf-3.19.4/src/google/protobuf/compiler/java/java_doc_comment.h +++ /dev/null @@ -1,101 +0,0 @@ -// Protocol Buffers - Google's data interchange format -// Copyright 2008 Google Inc. All rights reserved. -// https://developers.google.com/protocol-buffers/ -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// * Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// * Redistributions in binary form must reproduce the above -// copyright notice, this list of conditions and the following disclaimer -// in the documentation and/or other materials provided with the -// distribution. -// * Neither the name of Google Inc. nor the names of its -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -// Author: kenton@google.com (Kenton Varda) -// Based on original Protocol Buffers design by -// Sanjay Ghemawat, Jeff Dean, and others. - -#ifndef GOOGLE_PROTOBUF_COMPILER_JAVA_DOC_COMMENT_H__ -#define GOOGLE_PROTOBUF_COMPILER_JAVA_DOC_COMMENT_H__ - -#include - -#include - -namespace google { -namespace protobuf { -namespace io { -class Printer; // printer.h -} -} // namespace protobuf -} // namespace google - -namespace google { -namespace protobuf { -namespace compiler { -namespace java { - -enum FieldAccessorType { - HAZZER, - GETTER, - SETTER, - CLEARER, - // Repeated - LIST_COUNT, - LIST_GETTER, - LIST_INDEXED_GETTER, - LIST_INDEXED_SETTER, - LIST_ADDER, - LIST_MULTI_ADDER -}; - -void WriteMessageDocComment(io::Printer* printer, const Descriptor* message); -void WriteFieldDocComment(io::Printer* printer, const FieldDescriptor* field); -void WriteFieldAccessorDocComment(io::Printer* printer, - const FieldDescriptor* field, - const FieldAccessorType type, - const bool builder = false); -void WriteFieldEnumValueAccessorDocComment(io::Printer* printer, - const FieldDescriptor* field, - const FieldAccessorType type, - const bool builder = false); -void WriteFieldStringBytesAccessorDocComment(io::Printer* printer, - const FieldDescriptor* field, - const FieldAccessorType type, - const bool builder = false); -void WriteEnumDocComment(io::Printer* printer, const EnumDescriptor* enum_); -void WriteEnumValueDocComment(io::Printer* printer, - const EnumValueDescriptor* value); -void WriteServiceDocComment(io::Printer* printer, - const ServiceDescriptor* service); -void WriteMethodDocComment(io::Printer* printer, - const MethodDescriptor* method); - -// Exposed for testing only. -PROTOC_EXPORT std::string EscapeJavadoc(const std::string& input); - -} // namespace java -} // namespace compiler -} // namespace protobuf -} // namespace google - -#include - -#endif // GOOGLE_PROTOBUF_COMPILER_JAVA_DOC_COMMENT_H__ diff --git a/extra/protobuf/protobuf-3.19.4/src/google/protobuf/compiler/java/java_doc_comment_unittest.cc b/extra/protobuf/protobuf-3.19.4/src/google/protobuf/compiler/java/java_doc_comment_unittest.cc deleted file mode 100644 index ae582ea64904..000000000000 --- a/extra/protobuf/protobuf-3.19.4/src/google/protobuf/compiler/java/java_doc_comment_unittest.cc +++ /dev/null @@ -1,67 +0,0 @@ -// Protocol Buffers - Google's data interchange format -// Copyright 2008 Google Inc. All rights reserved. -// https://developers.google.com/protocol-buffers/ -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// * Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// * Redistributions in binary form must reproduce the above -// copyright notice, this list of conditions and the following disclaimer -// in the documentation and/or other materials provided with the -// distribution. -// * Neither the name of Google Inc. nor the names of its -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -// Author: kenton@google.com (Kenton Varda) - -#include - -#include - -namespace google { -namespace protobuf { -namespace compiler { -namespace java { -namespace { - -TEST(JavaDocCommentTest, Escaping) { - EXPECT_EQ("foo /* bar */ baz", EscapeJavadoc("foo /* bar */ baz")); - EXPECT_EQ("foo /*/ baz", EscapeJavadoc("foo /*/ baz")); - EXPECT_EQ("{@foo}", EscapeJavadoc("{@foo}")); - EXPECT_EQ("<i>&</i>", EscapeJavadoc("&")); - EXPECT_EQ("foo\u1234bar", EscapeJavadoc("foo\\u1234bar")); - EXPECT_EQ("@deprecated", EscapeJavadoc("@deprecated")); -} - -// TODO(kenton): It's hard to write a robust test of the doc comments -- we -// can only really compare the output against a golden value, which is a -// fairly tedious and fragile testing strategy. If we want to go that route, -// it probably makes sense to bite the bullet and write a test that compares -// the whole generated output for unittest.proto against a golden value, with -// a very simple script that can be run to regenerate it with the latest code. -// This would mean that updates to the golden file would have to be included -// in any change to the code generator, which would actually be fairly useful -// as it allows the reviewer to see clearly how the generated code is -// changing. - -} // namespace -} // namespace java -} // namespace compiler -} // namespace protobuf -} // namespace google diff --git a/extra/protobuf/protobuf-3.19.4/src/google/protobuf/compiler/java/java_enum.cc b/extra/protobuf/protobuf-3.19.4/src/google/protobuf/compiler/java/java_enum.cc deleted file mode 100644 index 51032c2742b3..000000000000 --- a/extra/protobuf/protobuf-3.19.4/src/google/protobuf/compiler/java/java_enum.cc +++ /dev/null @@ -1,391 +0,0 @@ -// Protocol Buffers - Google's data interchange format -// Copyright 2008 Google Inc. All rights reserved. -// https://developers.google.com/protocol-buffers/ -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// * Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// * Redistributions in binary form must reproduce the above -// copyright notice, this list of conditions and the following disclaimer -// in the documentation and/or other materials provided with the -// distribution. -// * Neither the name of Google Inc. nor the names of its -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -// Author: kenton@google.com (Kenton Varda) -// Based on original Protocol Buffers design by -// Sanjay Ghemawat, Jeff Dean, and others. - -#include -#include - -#include -#include -#include -#include -#include -#include -#include -#include - -namespace google { -namespace protobuf { -namespace compiler { -namespace java { - -EnumGenerator::EnumGenerator(const EnumDescriptor* descriptor, - bool immutable_api, Context* context) - : descriptor_(descriptor), - immutable_api_(immutable_api), - context_(context), - name_resolver_(context->GetNameResolver()) { - for (int i = 0; i < descriptor_->value_count(); i++) { - const EnumValueDescriptor* value = descriptor_->value(i); - const EnumValueDescriptor* canonical_value = - descriptor_->FindValueByNumber(value->number()); - - if (value == canonical_value) { - canonical_values_.push_back(value); - } else { - Alias alias; - alias.value = value; - alias.canonical_value = canonical_value; - aliases_.push_back(alias); - } - } -} - -EnumGenerator::~EnumGenerator() {} - -void EnumGenerator::Generate(io::Printer* printer) { - WriteEnumDocComment(printer, descriptor_); - MaybePrintGeneratedAnnotation(context_, printer, descriptor_, immutable_api_); - printer->Print( - "$deprecation$public enum $classname$\n" - " implements com.google.protobuf.ProtocolMessageEnum {\n", - "classname", descriptor_->name(), "deprecation", - descriptor_->options().deprecated() ? "@java.lang.Deprecated " : ""); - printer->Annotate("classname", descriptor_); - printer->Indent(); - - bool ordinal_is_index = true; - std::string index_text = "ordinal()"; - for (int i = 0; i < canonical_values_.size(); i++) { - if (canonical_values_[i]->index() != i) { - ordinal_is_index = false; - index_text = "index"; - break; - } - } - - for (int i = 0; i < canonical_values_.size(); i++) { - std::map vars; - vars["name"] = canonical_values_[i]->name(); - vars["index"] = StrCat(canonical_values_[i]->index()); - vars["number"] = StrCat(canonical_values_[i]->number()); - WriteEnumValueDocComment(printer, canonical_values_[i]); - if (canonical_values_[i]->options().deprecated()) { - printer->Print("@java.lang.Deprecated\n"); - } - if (ordinal_is_index) { - printer->Print(vars, "$name$($number$),\n"); - } else { - printer->Print(vars, "$name$($index$, $number$),\n"); - } - printer->Annotate("name", canonical_values_[i]); - } - - if (SupportUnknownEnumValue(descriptor_->file())) { - if (ordinal_is_index) { - printer->Print("${$UNRECOGNIZED$}$(-1),\n", "{", "", "}", ""); - } else { - printer->Print("${$UNRECOGNIZED$}$(-1, -1),\n", "{", "", "}", ""); - } - printer->Annotate("{", "}", descriptor_); - } - - printer->Print( - ";\n" - "\n"); - - // ----------------------------------------------------------------- - - for (int i = 0; i < aliases_.size(); i++) { - std::map vars; - vars["classname"] = descriptor_->name(); - vars["name"] = aliases_[i].value->name(); - vars["canonical_name"] = aliases_[i].canonical_value->name(); - WriteEnumValueDocComment(printer, aliases_[i].value); - printer->Print( - vars, "public static final $classname$ $name$ = $canonical_name$;\n"); - printer->Annotate("name", aliases_[i].value); - } - - for (int i = 0; i < descriptor_->value_count(); i++) { - std::map vars; - vars["name"] = descriptor_->value(i)->name(); - vars["number"] = StrCat(descriptor_->value(i)->number()); - vars["{"] = ""; - vars["}"] = ""; - vars["deprecation"] = descriptor_->value(i)->options().deprecated() - ? "@java.lang.Deprecated " - : ""; - WriteEnumValueDocComment(printer, descriptor_->value(i)); - printer->Print(vars, - "$deprecation$public static final int ${$$name$_VALUE$}$ = " - "$number$;\n"); - printer->Annotate("{", "}", descriptor_->value(i)); - } - printer->Print("\n"); - - // ----------------------------------------------------------------- - - printer->Print( - "\n" - "public final int getNumber() {\n"); - if (SupportUnknownEnumValue(descriptor_->file())) { - if (ordinal_is_index) { - printer->Print( - " if (this == UNRECOGNIZED) {\n" - " throw new java.lang.IllegalArgumentException(\n" - " \"Can't get the number of an unknown enum value.\");\n" - " }\n"); - } else { - printer->Print( - " if (index == -1) {\n" - " throw new java.lang.IllegalArgumentException(\n" - " \"Can't get the number of an unknown enum value.\");\n" - " }\n"); - } - } - printer->Print( - " return value;\n" - "}\n" - "\n" - "/**\n" - " * @param value The numeric wire value of the corresponding enum " - "entry.\n" - " * @return The enum associated with the given numeric wire value.\n" - " * @deprecated Use {@link #forNumber(int)} instead.\n" - " */\n" - "@java.lang.Deprecated\n" - "public static $classname$ valueOf(int value) {\n" - " return forNumber(value);\n" - "}\n" - "\n" - "/**\n" - " * @param value The numeric wire value of the corresponding enum " - "entry.\n" - " * @return The enum associated with the given numeric wire value.\n" - " */\n" - "public static $classname$ forNumber(int value) {\n" - " switch (value) {\n", - "classname", descriptor_->name()); - printer->Indent(); - printer->Indent(); - - for (int i = 0; i < canonical_values_.size(); i++) { - printer->Print("case $number$: return $name$;\n", "name", - canonical_values_[i]->name(), "number", - StrCat(canonical_values_[i]->number())); - } - - printer->Outdent(); - printer->Outdent(); - printer->Print( - " default: return null;\n" - " }\n" - "}\n" - "\n" - "public static com.google.protobuf.Internal.EnumLiteMap<$classname$>\n" - " internalGetValueMap() {\n" - " return internalValueMap;\n" - "}\n" - "private static final com.google.protobuf.Internal.EnumLiteMap<\n" - " $classname$> internalValueMap =\n" - " new com.google.protobuf.Internal.EnumLiteMap<$classname$>() {\n" - " public $classname$ findValueByNumber(int number) {\n" - " return $classname$.forNumber(number);\n" - " }\n" - " };\n" - "\n", - "classname", descriptor_->name()); - - // ----------------------------------------------------------------- - // Reflection - - if (HasDescriptorMethods(descriptor_, context_->EnforceLite())) { - printer->Print( - "public final com.google.protobuf.Descriptors.EnumValueDescriptor\n" - " getValueDescriptor() {\n"); - if (SupportUnknownEnumValue(descriptor_->file())) { - if (ordinal_is_index) { - printer->Print( - " if (this == UNRECOGNIZED) {\n" - " throw new java.lang.IllegalStateException(\n" - " \"Can't get the descriptor of an unrecognized enum " - "value.\");\n" - " }\n"); - } else { - printer->Print( - " if (index == -1) {\n" - " throw new java.lang.IllegalStateException(\n" - " \"Can't get the descriptor of an unrecognized enum " - "value.\");\n" - " }\n"); - } - } - printer->Print( - " return getDescriptor().getValues().get($index_text$);\n" - "}\n" - "public final com.google.protobuf.Descriptors.EnumDescriptor\n" - " getDescriptorForType() {\n" - " return getDescriptor();\n" - "}\n" - "public static final com.google.protobuf.Descriptors.EnumDescriptor\n" - " getDescriptor() {\n", - "index_text", index_text); - - // TODO(kenton): Cache statically? Note that we can't access descriptors - // at module init time because it wouldn't work with descriptor.proto, but - // we can cache the value the first time getDescriptor() is called. - if (descriptor_->containing_type() == NULL) { - // The class generated for the File fully populates the descriptor with - // extensions in both the mutable and immutable cases. (In the mutable api - // this is accomplished by attempting to load the immutable outer class). - printer->Print( - " return $file$.getDescriptor().getEnumTypes().get($index$);\n", - "file", - name_resolver_->GetClassName(descriptor_->file(), immutable_api_), - "index", StrCat(descriptor_->index())); - } else { - printer->Print( - " return $parent$.$descriptor$.getEnumTypes().get($index$);\n", - "parent", - name_resolver_->GetClassName(descriptor_->containing_type(), - immutable_api_), - "descriptor", - descriptor_->containing_type() - ->options() - .no_standard_descriptor_accessor() - ? "getDefaultInstance().getDescriptorForType()" - : "getDescriptor()", - "index", StrCat(descriptor_->index())); - } - - printer->Print( - "}\n" - "\n" - "private static final $classname$[] VALUES = ", - "classname", descriptor_->name()); - - if (CanUseEnumValues()) { - // If the constants we are going to output are exactly the ones we - // have declared in the Java enum in the same order, then we can use - // the values() method that the Java compiler automatically generates - // for every enum. - printer->Print("values();\n"); - } else { - printer->Print("getStaticValuesArray();\n"); - printer->Print("private static $classname$[] getStaticValuesArray() {\n", - "classname", descriptor_->name()); - printer->Indent(); - printer->Print( - "return new $classname$[] {\n" - " ", - "classname", descriptor_->name()); - for (int i = 0; i < descriptor_->value_count(); i++) { - printer->Print("$name$, ", "name", descriptor_->value(i)->name()); - } - printer->Print( - "\n" - "};\n"); - printer->Outdent(); - printer->Print("}"); - } - - printer->Print( - "\n" - "public static $classname$ valueOf(\n" - " com.google.protobuf.Descriptors.EnumValueDescriptor desc) {\n" - " if (desc.getType() != getDescriptor()) {\n" - " throw new java.lang.IllegalArgumentException(\n" - " \"EnumValueDescriptor is not for this type.\");\n" - " }\n", - "classname", descriptor_->name()); - if (SupportUnknownEnumValue(descriptor_->file())) { - printer->Print( - " if (desc.getIndex() == -1) {\n" - " return UNRECOGNIZED;\n" - " }\n"); - } - printer->Print( - " return VALUES[desc.getIndex()];\n" - "}\n" - "\n"); - - if (!ordinal_is_index) { - printer->Print("private final int index;\n"); - } - } - - // ----------------------------------------------------------------- - - printer->Print("private final int value;\n\n"); - - if (ordinal_is_index) { - printer->Print("private $classname$(int value) {\n", "classname", - descriptor_->name()); - } else { - printer->Print("private $classname$(int index, int value) {\n", "classname", - descriptor_->name()); - } - if (HasDescriptorMethods(descriptor_, context_->EnforceLite()) && - !ordinal_is_index) { - printer->Print(" this.index = index;\n"); - } - printer->Print( - " this.value = value;\n" - "}\n"); - - printer->Print( - "\n" - "// @@protoc_insertion_point(enum_scope:$full_name$)\n", - "full_name", descriptor_->full_name()); - - printer->Outdent(); - printer->Print("}\n\n"); -} - -bool EnumGenerator::CanUseEnumValues() { - if (canonical_values_.size() != descriptor_->value_count()) { - return false; - } - for (int i = 0; i < descriptor_->value_count(); i++) { - if (descriptor_->value(i)->name() != canonical_values_[i]->name()) { - return false; - } - } - return true; -} - -} // namespace java -} // namespace compiler -} // namespace protobuf -} // namespace google diff --git a/extra/protobuf/protobuf-3.19.4/src/google/protobuf/compiler/java/java_enum.h b/extra/protobuf/protobuf-3.19.4/src/google/protobuf/compiler/java/java_enum.h deleted file mode 100644 index 0a2c363b5335..000000000000 --- a/extra/protobuf/protobuf-3.19.4/src/google/protobuf/compiler/java/java_enum.h +++ /dev/null @@ -1,100 +0,0 @@ -// Protocol Buffers - Google's data interchange format -// Copyright 2008 Google Inc. All rights reserved. -// https://developers.google.com/protocol-buffers/ -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// * Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// * Redistributions in binary form must reproduce the above -// copyright notice, this list of conditions and the following disclaimer -// in the documentation and/or other materials provided with the -// distribution. -// * Neither the name of Google Inc. nor the names of its -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -// Author: kenton@google.com (Kenton Varda) -// Based on original Protocol Buffers design by -// Sanjay Ghemawat, Jeff Dean, and others. - -#ifndef GOOGLE_PROTOBUF_COMPILER_JAVA_ENUM_H__ -#define GOOGLE_PROTOBUF_COMPILER_JAVA_ENUM_H__ - -#include -#include -#include - -namespace google { -namespace protobuf { -namespace compiler { -namespace java { -class Context; // context.h -class ClassNameResolver; // name_resolver.h -} // namespace java -} // namespace compiler -namespace io { -class Printer; // printer.h -} -} // namespace protobuf -} // namespace google - -namespace google { -namespace protobuf { -namespace compiler { -namespace java { - -class EnumGenerator { - public: - EnumGenerator(const EnumDescriptor* descriptor, bool immutable_api, - Context* context); - ~EnumGenerator(); - - void Generate(io::Printer* printer); - - private: - const EnumDescriptor* descriptor_; - - // The proto language allows multiple enum constants to have the same - // numeric value. Java, however, does not allow multiple enum constants to - // be considered equivalent. We treat the first defined constant for any - // given numeric value as "canonical" and the rest as aliases of that - // canonical value. - std::vector canonical_values_; - - struct Alias { - const EnumValueDescriptor* value; - const EnumValueDescriptor* canonical_value; - }; - std::vector aliases_; - - bool immutable_api_; - - Context* context_; - ClassNameResolver* name_resolver_; - - bool CanUseEnumValues(); - - GOOGLE_DISALLOW_EVIL_CONSTRUCTORS(EnumGenerator); -}; - -} // namespace java -} // namespace compiler -} // namespace protobuf -} // namespace google - -#endif // GOOGLE_PROTOBUF_COMPILER_JAVA_ENUM_H__ diff --git a/extra/protobuf/protobuf-3.19.4/src/google/protobuf/compiler/java/java_enum_field.cc b/extra/protobuf/protobuf-3.19.4/src/google/protobuf/compiler/java/java_enum_field.cc deleted file mode 100644 index 0dad42ada354..000000000000 --- a/extra/protobuf/protobuf-3.19.4/src/google/protobuf/compiler/java/java_enum_field.cc +++ /dev/null @@ -1,1176 +0,0 @@ -// Protocol Buffers - Google's data interchange format -// Copyright 2008 Google Inc. All rights reserved. -// https://developers.google.com/protocol-buffers/ -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// * Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// * Redistributions in binary form must reproduce the above -// copyright notice, this list of conditions and the following disclaimer -// in the documentation and/or other materials provided with the -// distribution. -// * Neither the name of Google Inc. nor the names of its -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -// Author: kenton@google.com (Kenton Varda) -// Based on original Protocol Buffers design by -// Sanjay Ghemawat, Jeff Dean, and others. - -#include - -#include -#include -#include - -#include -#include -#include -#include -#include -#include -#include -#include -#include - -namespace google { -namespace protobuf { -namespace compiler { -namespace java { - -namespace { - -void SetEnumVariables(const FieldDescriptor* descriptor, int messageBitIndex, - int builderBitIndex, const FieldGeneratorInfo* info, - ClassNameResolver* name_resolver, - std::map* variables) { - SetCommonFieldVariables(descriptor, info, variables); - - (*variables)["type"] = - name_resolver->GetImmutableClassName(descriptor->enum_type()); - (*variables)["kt_type"] = (*variables)["type"]; - (*variables)["mutable_type"] = - name_resolver->GetMutableClassName(descriptor->enum_type()); - (*variables)["default"] = ImmutableDefaultValue(descriptor, name_resolver); - (*variables)["default_number"] = - StrCat(descriptor->default_value_enum()->number()); - (*variables)["tag"] = StrCat( - static_cast(internal::WireFormat::MakeTag(descriptor))); - (*variables)["tag_size"] = StrCat( - internal::WireFormat::TagSize(descriptor->number(), GetType(descriptor))); - // TODO(birdo): Add @deprecated javadoc when generating javadoc is supported - // by the proto compiler - (*variables)["deprecation"] = - descriptor->options().deprecated() ? "@java.lang.Deprecated " : ""; - (*variables)["kt_deprecation"] = - descriptor->options().deprecated() - ? "@kotlin.Deprecated(message = \"Field " + (*variables)["name"] + - " is deprecated\") " - : ""; - (*variables)["on_changed"] = "onChanged();"; - // Use deprecated valueOf() method to be compatible with old generated code - // for v2.5.0/v2.6.1. - // TODO(xiaofeng): Use "forNumber" when we no longer support compatibility - // with v2.5.0/v2.6.1, and remove the @SuppressWarnings annotations. - (*variables)["for_number"] = "valueOf"; - - if (HasHasbit(descriptor)) { - // For singular messages and builders, one bit is used for the hasField bit. - (*variables)["get_has_field_bit_message"] = GenerateGetBit(messageBitIndex); - (*variables)["get_has_field_bit_builder"] = GenerateGetBit(builderBitIndex); - - // Note that these have a trailing ";". - (*variables)["set_has_field_bit_message"] = - GenerateSetBit(messageBitIndex) + ";"; - (*variables)["set_has_field_bit_builder"] = - GenerateSetBit(builderBitIndex) + ";"; - (*variables)["clear_has_field_bit_builder"] = - GenerateClearBit(builderBitIndex) + ";"; - - (*variables)["is_field_present_message"] = GenerateGetBit(messageBitIndex); - } else { - (*variables)["set_has_field_bit_message"] = ""; - (*variables)["set_has_field_bit_builder"] = ""; - (*variables)["clear_has_field_bit_builder"] = ""; - - (*variables)["is_field_present_message"] = - (*variables)["name"] + "_ != " + (*variables)["default"] + - ".getNumber()"; - } - - // For repeated builders, one bit is used for whether the array is immutable. - (*variables)["get_mutable_bit_builder"] = GenerateGetBit(builderBitIndex); - (*variables)["set_mutable_bit_builder"] = GenerateSetBit(builderBitIndex); - (*variables)["clear_mutable_bit_builder"] = GenerateClearBit(builderBitIndex); - - // For repeated fields, one bit is used for whether the array is immutable - // in the parsing constructor. - (*variables)["get_mutable_bit_parser"] = - GenerateGetBitMutableLocal(builderBitIndex); - (*variables)["set_mutable_bit_parser"] = - GenerateSetBitMutableLocal(builderBitIndex); - - (*variables)["get_has_field_bit_from_local"] = - GenerateGetBitFromLocal(builderBitIndex); - (*variables)["set_has_field_bit_to_local"] = - GenerateSetBitToLocal(messageBitIndex); - - if (SupportUnknownEnumValue(descriptor->file())) { - (*variables)["unknown"] = (*variables)["type"] + ".UNRECOGNIZED"; - } else { - (*variables)["unknown"] = (*variables)["default"]; - } -} - -} // namespace - -// =================================================================== - -ImmutableEnumFieldGenerator::ImmutableEnumFieldGenerator( - const FieldDescriptor* descriptor, int messageBitIndex, int builderBitIndex, - Context* context) - : descriptor_(descriptor), name_resolver_(context->GetNameResolver()) { - SetEnumVariables(descriptor, messageBitIndex, builderBitIndex, - context->GetFieldGeneratorInfo(descriptor), name_resolver_, - &variables_); -} - -ImmutableEnumFieldGenerator::~ImmutableEnumFieldGenerator() {} - -int ImmutableEnumFieldGenerator::GetNumBitsForMessage() const { - return HasHasbit(descriptor_) ? 1 : 0; -} - -int ImmutableEnumFieldGenerator::GetNumBitsForBuilder() const { - return GetNumBitsForMessage(); -} - -void ImmutableEnumFieldGenerator::GenerateInterfaceMembers( - io::Printer* printer) const { - if (HasHazzer(descriptor_)) { - WriteFieldAccessorDocComment(printer, descriptor_, HAZZER); - printer->Print(variables_, - "$deprecation$boolean has$capitalized_name$();\n"); - } - if (SupportUnknownEnumValue(descriptor_->file())) { - WriteFieldEnumValueAccessorDocComment(printer, descriptor_, GETTER); - printer->Print(variables_, - "$deprecation$int get$capitalized_name$Value();\n"); - } - WriteFieldAccessorDocComment(printer, descriptor_, GETTER); - printer->Print(variables_, "$deprecation$$type$ get$capitalized_name$();\n"); -} - -void ImmutableEnumFieldGenerator::GenerateMembers(io::Printer* printer) const { - printer->Print(variables_, "private int $name$_;\n"); - PrintExtraFieldInfo(variables_, printer); - if (HasHazzer(descriptor_)) { - WriteFieldAccessorDocComment(printer, descriptor_, HAZZER); - printer->Print(variables_, - "@java.lang.Override $deprecation$public boolean " - "${$has$capitalized_name$$}$() {\n" - " return $get_has_field_bit_message$;\n" - "}\n"); - printer->Annotate("{", "}", descriptor_); - } - if (SupportUnknownEnumValue(descriptor_->file())) { - WriteFieldEnumValueAccessorDocComment(printer, descriptor_, GETTER); - printer->Print(variables_, - "@java.lang.Override $deprecation$public int " - "${$get$capitalized_name$Value$}$() {\n" - " return $name$_;\n" - "}\n"); - printer->Annotate("{", "}", descriptor_); - } - WriteFieldAccessorDocComment(printer, descriptor_, GETTER); - printer->Print(variables_, - "@java.lang.Override $deprecation$public $type$ " - "${$get$capitalized_name$$}$() {\n" - " @SuppressWarnings(\"deprecation\")\n" - " $type$ result = $type$.$for_number$($name$_);\n" - " return result == null ? $unknown$ : result;\n" - "}\n"); - printer->Annotate("{", "}", descriptor_); -} - -void ImmutableEnumFieldGenerator::GenerateBuilderMembers( - io::Printer* printer) const { - printer->Print(variables_, "private int $name$_ = $default_number$;\n"); - if (HasHazzer(descriptor_)) { - WriteFieldAccessorDocComment(printer, descriptor_, HAZZER); - printer->Print(variables_, - "@java.lang.Override $deprecation$public boolean " - "${$has$capitalized_name$$}$() {\n" - " return $get_has_field_bit_builder$;\n" - "}\n"); - printer->Annotate("{", "}", descriptor_); - } - if (SupportUnknownEnumValue(descriptor_->file())) { - WriteFieldEnumValueAccessorDocComment(printer, descriptor_, GETTER); - printer->Print(variables_, - "@java.lang.Override $deprecation$public int " - "${$get$capitalized_name$Value$}$() {\n" - " return $name$_;\n" - "}\n"); - printer->Annotate("{", "}", descriptor_); - WriteFieldEnumValueAccessorDocComment(printer, descriptor_, SETTER, - /* builder */ true); - printer->Print(variables_, - "$deprecation$public Builder " - "${$set$capitalized_name$Value$}$(int value) {\n" - " $set_has_field_bit_builder$\n" - " $name$_ = value;\n" - " $on_changed$\n" - " return this;\n" - "}\n"); - printer->Annotate("{", "}", descriptor_); - } - WriteFieldAccessorDocComment(printer, descriptor_, GETTER); - printer->Print(variables_, - "@java.lang.Override\n" - "$deprecation$public $type$ ${$get$capitalized_name$$}$() {\n" - " @SuppressWarnings(\"deprecation\")\n" - " $type$ result = $type$.$for_number$($name$_);\n" - " return result == null ? $unknown$ : result;\n" - "}\n"); - printer->Annotate("{", "}", descriptor_); - WriteFieldAccessorDocComment(printer, descriptor_, SETTER, - /* builder */ true); - printer->Print(variables_, - "$deprecation$public Builder " - "${$set$capitalized_name$$}$($type$ value) {\n" - " if (value == null) {\n" - " throw new NullPointerException();\n" - " }\n" - " $set_has_field_bit_builder$\n" - " $name$_ = value.getNumber();\n" - " $on_changed$\n" - " return this;\n" - "}\n"); - printer->Annotate("{", "}", descriptor_); - WriteFieldAccessorDocComment(printer, descriptor_, CLEARER, - /* builder */ true); - printer->Print( - variables_, - "$deprecation$public Builder ${$clear$capitalized_name$$}$() {\n" - " $clear_has_field_bit_builder$\n" - " $name$_ = $default_number$;\n" - " $on_changed$\n" - " return this;\n" - "}\n"); - printer->Annotate("{", "}", descriptor_); -} - -void ImmutableEnumFieldGenerator::GenerateKotlinDslMembers( - io::Printer* printer) const { - WriteFieldDocComment(printer, descriptor_); - printer->Print(variables_, - "$kt_deprecation$public var $kt_name$: $kt_type$\n" - " @JvmName(\"${$get$kt_capitalized_name$$}$\")\n" - " get() = $kt_dsl_builder$.${$get$capitalized_name$$}$()\n" - " @JvmName(\"${$set$kt_capitalized_name$$}$\")\n" - " set(value) {\n" - " $kt_dsl_builder$.${$set$capitalized_name$$}$(value)\n" - " }\n"); - - WriteFieldAccessorDocComment(printer, descriptor_, CLEARER, - /* builder */ false); - printer->Print(variables_, - "public fun ${$clear$kt_capitalized_name$$}$() {\n" - " $kt_dsl_builder$.${$clear$capitalized_name$$}$()\n" - "}\n"); - - if (HasHazzer(descriptor_)) { - WriteFieldAccessorDocComment(printer, descriptor_, HAZZER); - printer->Print( - variables_, - "public fun ${$has$kt_capitalized_name$$}$(): kotlin.Boolean {\n" - " return $kt_dsl_builder$.${$has$capitalized_name$$}$()\n" - "}\n"); - } -} - -void ImmutableEnumFieldGenerator::GenerateFieldBuilderInitializationCode( - io::Printer* printer) const { - // noop for enums -} - -void ImmutableEnumFieldGenerator::GenerateInitializationCode( - io::Printer* printer) const { - printer->Print(variables_, "$name$_ = $default_number$;\n"); -} - -void ImmutableEnumFieldGenerator::GenerateBuilderClearCode( - io::Printer* printer) const { - printer->Print(variables_, - "$name$_ = $default_number$;\n" - "$clear_has_field_bit_builder$\n"); -} - -void ImmutableEnumFieldGenerator::GenerateMergingCode( - io::Printer* printer) const { - if (HasHazzer(descriptor_)) { - printer->Print(variables_, - "if (other.has$capitalized_name$()) {\n" - " set$capitalized_name$(other.get$capitalized_name$());\n" - "}\n"); - } else if (SupportUnknownEnumValue(descriptor_->file())) { - printer->Print( - variables_, - "if (other.$name$_ != $default_number$) {\n" - " set$capitalized_name$Value(other.get$capitalized_name$Value());\n" - "}\n"); - } else { - GOOGLE_LOG(FATAL) << "Can't reach here."; - } -} - -void ImmutableEnumFieldGenerator::GenerateBuildingCode( - io::Printer* printer) const { - if (HasHazzer(descriptor_)) { - printer->Print(variables_, - "if ($get_has_field_bit_from_local$) {\n" - " $set_has_field_bit_to_local$;\n" - "}\n"); - } - printer->Print(variables_, "result.$name$_ = $name$_;\n"); -} - -void ImmutableEnumFieldGenerator::GenerateParsingCode( - io::Printer* printer) const { - if (SupportUnknownEnumValue(descriptor_->file())) { - printer->Print(variables_, - "int rawValue = input.readEnum();\n" - "$set_has_field_bit_message$\n" - "$name$_ = rawValue;\n"); - } else { - printer->Print(variables_, - "int rawValue = input.readEnum();\n" - " @SuppressWarnings(\"deprecation\")\n" - "$type$ value = $type$.$for_number$(rawValue);\n" - "if (value == null) {\n" - " unknownFields.mergeVarintField($number$, rawValue);\n" - "} else {\n" - " $set_has_field_bit_message$\n" - " $name$_ = rawValue;\n" - "}\n"); - } -} - -void ImmutableEnumFieldGenerator::GenerateParsingDoneCode( - io::Printer* printer) const { - // noop for enums -} - -void ImmutableEnumFieldGenerator::GenerateSerializationCode( - io::Printer* printer) const { - printer->Print(variables_, - "if ($is_field_present_message$) {\n" - " output.writeEnum($number$, $name$_);\n" - "}\n"); -} - -void ImmutableEnumFieldGenerator::GenerateSerializedSizeCode( - io::Printer* printer) const { - printer->Print(variables_, - "if ($is_field_present_message$) {\n" - " size += com.google.protobuf.CodedOutputStream\n" - " .computeEnumSize($number$, $name$_);\n" - "}\n"); -} - -void ImmutableEnumFieldGenerator::GenerateEqualsCode( - io::Printer* printer) const { - printer->Print(variables_, "if ($name$_ != other.$name$_) return false;\n"); -} - -void ImmutableEnumFieldGenerator::GenerateHashCode(io::Printer* printer) const { - printer->Print(variables_, - "hash = (37 * hash) + $constant_name$;\n" - "hash = (53 * hash) + $name$_;\n"); -} - -std::string ImmutableEnumFieldGenerator::GetBoxedType() const { - return name_resolver_->GetImmutableClassName(descriptor_->enum_type()); -} - -// =================================================================== - -ImmutableEnumOneofFieldGenerator::ImmutableEnumOneofFieldGenerator( - const FieldDescriptor* descriptor, int messageBitIndex, int builderBitIndex, - Context* context) - : ImmutableEnumFieldGenerator(descriptor, messageBitIndex, builderBitIndex, - context) { - const OneofGeneratorInfo* info = - context->GetOneofGeneratorInfo(descriptor->containing_oneof()); - SetCommonOneofVariables(descriptor, info, &variables_); -} - -ImmutableEnumOneofFieldGenerator::~ImmutableEnumOneofFieldGenerator() {} - -void ImmutableEnumOneofFieldGenerator::GenerateMembers( - io::Printer* printer) const { - PrintExtraFieldInfo(variables_, printer); - GOOGLE_DCHECK(HasHazzer(descriptor_)); - WriteFieldAccessorDocComment(printer, descriptor_, HAZZER); - printer->Print(variables_, - "$deprecation$public boolean ${$has$capitalized_name$$}$() {\n" - " return $has_oneof_case_message$;\n" - "}\n"); - printer->Annotate("{", "}", descriptor_); - - if (SupportUnknownEnumValue(descriptor_->file())) { - WriteFieldEnumValueAccessorDocComment(printer, descriptor_, GETTER); - printer->Print( - variables_, - "$deprecation$public int ${$get$capitalized_name$Value$}$() {\n" - " if ($has_oneof_case_message$) {\n" - " return (java.lang.Integer) $oneof_name$_;\n" - " }\n" - " return $default_number$;\n" - "}\n"); - printer->Annotate("{", "}", descriptor_); - } - WriteFieldAccessorDocComment(printer, descriptor_, GETTER); - printer->Print(variables_, - "$deprecation$public $type$ ${$get$capitalized_name$$}$() {\n" - " if ($has_oneof_case_message$) {\n" - " @SuppressWarnings(\"deprecation\")\n" - " $type$ result = $type$.$for_number$(\n" - " (java.lang.Integer) $oneof_name$_);\n" - " return result == null ? $unknown$ : result;\n" - " }\n" - " return $default$;\n" - "}\n"); - printer->Annotate("{", "}", descriptor_); -} - -void ImmutableEnumOneofFieldGenerator::GenerateBuilderMembers( - io::Printer* printer) const { - GOOGLE_DCHECK(HasHazzer(descriptor_)); - WriteFieldAccessorDocComment(printer, descriptor_, HAZZER); - printer->Print(variables_, - "@java.lang.Override\n" - "$deprecation$public boolean ${$has$capitalized_name$$}$() {\n" - " return $has_oneof_case_message$;\n" - "}\n"); - printer->Annotate("{", "}", descriptor_); - - if (SupportUnknownEnumValue(descriptor_->file())) { - WriteFieldEnumValueAccessorDocComment(printer, descriptor_, GETTER); - printer->Print( - variables_, - "@java.lang.Override\n" - "$deprecation$public int ${$get$capitalized_name$Value$}$() {\n" - " if ($has_oneof_case_message$) {\n" - " return ((java.lang.Integer) $oneof_name$_).intValue();\n" - " }\n" - " return $default_number$;\n" - "}\n"); - printer->Annotate("{", "}", descriptor_); - WriteFieldEnumValueAccessorDocComment(printer, descriptor_, SETTER, - /* builder */ true); - printer->Print(variables_, - "$deprecation$public Builder " - "${$set$capitalized_name$Value$}$(int value) {\n" - " $set_oneof_case_message$;\n" - " $oneof_name$_ = value;\n" - " $on_changed$\n" - " return this;\n" - "}\n"); - printer->Annotate("{", "}", descriptor_); - } - WriteFieldAccessorDocComment(printer, descriptor_, GETTER); - printer->Print(variables_, - "@java.lang.Override\n" - "$deprecation$public $type$ ${$get$capitalized_name$$}$() {\n" - " if ($has_oneof_case_message$) {\n" - " @SuppressWarnings(\"deprecation\")\n" - " $type$ result = $type$.$for_number$(\n" - " (java.lang.Integer) $oneof_name$_);\n" - " return result == null ? $unknown$ : result;\n" - " }\n" - " return $default$;\n" - "}\n"); - printer->Annotate("{", "}", descriptor_); - WriteFieldAccessorDocComment(printer, descriptor_, SETTER, - /* builder */ true); - printer->Print(variables_, - "$deprecation$public Builder " - "${$set$capitalized_name$$}$($type$ value) {\n" - " if (value == null) {\n" - " throw new NullPointerException();\n" - " }\n" - " $set_oneof_case_message$;\n" - " $oneof_name$_ = value.getNumber();\n" - " $on_changed$\n" - " return this;\n" - "}\n"); - printer->Annotate("{", "}", descriptor_); - WriteFieldAccessorDocComment(printer, descriptor_, CLEARER, - /* builder */ true); - printer->Print( - variables_, - "$deprecation$public Builder ${$clear$capitalized_name$$}$() {\n" - " if ($has_oneof_case_message$) {\n" - " $clear_oneof_case_message$;\n" - " $oneof_name$_ = null;\n" - " $on_changed$\n" - " }\n" - " return this;\n" - "}\n"); - printer->Annotate("{", "}", descriptor_); -} - -void ImmutableEnumOneofFieldGenerator::GenerateBuildingCode( - io::Printer* printer) const { - printer->Print(variables_, - "if ($has_oneof_case_message$) {\n" - " result.$oneof_name$_ = $oneof_name$_;\n" - "}\n"); -} - -void ImmutableEnumOneofFieldGenerator::GenerateMergingCode( - io::Printer* printer) const { - if (SupportUnknownEnumValue(descriptor_->file())) { - printer->Print( - variables_, - "set$capitalized_name$Value(other.get$capitalized_name$Value());\n"); - } else { - printer->Print(variables_, - "set$capitalized_name$(other.get$capitalized_name$());\n"); - } -} - -void ImmutableEnumOneofFieldGenerator::GenerateParsingCode( - io::Printer* printer) const { - if (SupportUnknownEnumValue(descriptor_->file())) { - printer->Print(variables_, - "int rawValue = input.readEnum();\n" - "$set_oneof_case_message$;\n" - "$oneof_name$_ = rawValue;\n"); - } else { - printer->Print(variables_, - "int rawValue = input.readEnum();\n" - "@SuppressWarnings(\"deprecation\")\n" - "$type$ value = $type$.$for_number$(rawValue);\n" - "if (value == null) {\n" - " unknownFields.mergeVarintField($number$, rawValue);\n" - "} else {\n" - " $set_oneof_case_message$;\n" - " $oneof_name$_ = rawValue;\n" - "}\n"); - } -} - -void ImmutableEnumOneofFieldGenerator::GenerateSerializationCode( - io::Printer* printer) const { - printer->Print( - variables_, - "if ($has_oneof_case_message$) {\n" - " output.writeEnum($number$, ((java.lang.Integer) $oneof_name$_));\n" - "}\n"); -} - -void ImmutableEnumOneofFieldGenerator::GenerateSerializedSizeCode( - io::Printer* printer) const { - printer->Print( - variables_, - "if ($has_oneof_case_message$) {\n" - " size += com.google.protobuf.CodedOutputStream\n" - " .computeEnumSize($number$, ((java.lang.Integer) $oneof_name$_));\n" - "}\n"); -} - -void ImmutableEnumOneofFieldGenerator::GenerateEqualsCode( - io::Printer* printer) const { - if (SupportUnknownEnumValue(descriptor_->file())) { - printer->Print( - variables_, - "if (get$capitalized_name$Value()\n" - " != other.get$capitalized_name$Value()) return false;\n"); - } else { - printer->Print( - variables_, - "if (!get$capitalized_name$()\n" - " .equals(other.get$capitalized_name$())) return false;\n"); - } -} - -void ImmutableEnumOneofFieldGenerator::GenerateHashCode( - io::Printer* printer) const { - if (SupportUnknownEnumValue(descriptor_->file())) { - printer->Print(variables_, - "hash = (37 * hash) + $constant_name$;\n" - "hash = (53 * hash) + get$capitalized_name$Value();\n"); - } else { - printer->Print( - variables_, - "hash = (37 * hash) + $constant_name$;\n" - "hash = (53 * hash) + get$capitalized_name$().getNumber();\n"); - } -} - -// =================================================================== - -RepeatedImmutableEnumFieldGenerator::RepeatedImmutableEnumFieldGenerator( - const FieldDescriptor* descriptor, int messageBitIndex, int builderBitIndex, - Context* context) - : descriptor_(descriptor), name_resolver_(context->GetNameResolver()) { - SetEnumVariables(descriptor, messageBitIndex, builderBitIndex, - context->GetFieldGeneratorInfo(descriptor), name_resolver_, - &variables_); -} - -RepeatedImmutableEnumFieldGenerator::~RepeatedImmutableEnumFieldGenerator() {} - -int RepeatedImmutableEnumFieldGenerator::GetNumBitsForMessage() const { - return 0; -} - -int RepeatedImmutableEnumFieldGenerator::GetNumBitsForBuilder() const { - return 1; -} - -void RepeatedImmutableEnumFieldGenerator::GenerateInterfaceMembers( - io::Printer* printer) const { - WriteFieldAccessorDocComment(printer, descriptor_, LIST_GETTER); - printer->Print( - variables_, - "$deprecation$java.util.List<$type$> get$capitalized_name$List();\n"); - WriteFieldAccessorDocComment(printer, descriptor_, LIST_COUNT); - printer->Print(variables_, - "$deprecation$int get$capitalized_name$Count();\n"); - WriteFieldAccessorDocComment(printer, descriptor_, LIST_INDEXED_GETTER); - printer->Print(variables_, - "$deprecation$$type$ get$capitalized_name$(int index);\n"); - if (SupportUnknownEnumValue(descriptor_->file())) { - WriteFieldEnumValueAccessorDocComment(printer, descriptor_, LIST_GETTER); - printer->Print(variables_, - "$deprecation$java.util.List\n" - "get$capitalized_name$ValueList();\n"); - WriteFieldEnumValueAccessorDocComment(printer, descriptor_, - LIST_INDEXED_GETTER); - printer->Print(variables_, - "$deprecation$int get$capitalized_name$Value(int index);\n"); - } -} - -void RepeatedImmutableEnumFieldGenerator::GenerateMembers( - io::Printer* printer) const { - printer->Print( - variables_, - "private java.util.List $name$_;\n" - "private static final " - "com.google.protobuf.Internal.ListAdapter.Converter<\n" - " java.lang.Integer, $type$> $name$_converter_ =\n" - " new com.google.protobuf.Internal.ListAdapter.Converter<\n" - " java.lang.Integer, $type$>() {\n" - " public $type$ convert(java.lang.Integer from) {\n" - " @SuppressWarnings(\"deprecation\")\n" - " $type$ result = $type$.$for_number$(from);\n" - " return result == null ? $unknown$ : result;\n" - " }\n" - " };\n"); - PrintExtraFieldInfo(variables_, printer); - WriteFieldAccessorDocComment(printer, descriptor_, LIST_GETTER); - printer->Print( - variables_, - "@java.lang.Override\n" - "$deprecation$public java.util.List<$type$> " - "${$get$capitalized_name$List$}$() {\n" - " return new com.google.protobuf.Internal.ListAdapter<\n" - " java.lang.Integer, $type$>($name$_, $name$_converter_);\n" - "}\n"); - printer->Annotate("{", "}", descriptor_); - WriteFieldAccessorDocComment(printer, descriptor_, LIST_COUNT); - printer->Print( - variables_, - "@java.lang.Override\n" - "$deprecation$public int ${$get$capitalized_name$Count$}$() {\n" - " return $name$_.size();\n" - "}\n"); - printer->Annotate("{", "}", descriptor_); - WriteFieldAccessorDocComment(printer, descriptor_, LIST_INDEXED_GETTER); - printer->Print( - variables_, - "@java.lang.Override\n" - "$deprecation$public $type$ ${$get$capitalized_name$$}$(int index) {\n" - " return $name$_converter_.convert($name$_.get(index));\n" - "}\n"); - printer->Annotate("{", "}", descriptor_); - if (SupportUnknownEnumValue(descriptor_->file())) { - WriteFieldEnumValueAccessorDocComment(printer, descriptor_, LIST_GETTER); - printer->Print(variables_, - "@java.lang.Override\n" - "$deprecation$public java.util.List\n" - "${$get$capitalized_name$ValueList$}$() {\n" - " return $name$_;\n" - "}\n"); - printer->Annotate("{", "}", descriptor_); - WriteFieldEnumValueAccessorDocComment(printer, descriptor_, - LIST_INDEXED_GETTER); - printer->Print(variables_, - "@java.lang.Override\n" - "$deprecation$public int " - "${$get$capitalized_name$Value$}$(int index) {\n" - " return $name$_.get(index);\n" - "}\n"); - printer->Annotate("{", "}", descriptor_); - } - - if (descriptor_->is_packed()) { - printer->Print(variables_, "private int $name$MemoizedSerializedSize;\n"); - } -} - -void RepeatedImmutableEnumFieldGenerator::GenerateBuilderMembers( - io::Printer* printer) const { - printer->Print( - variables_, - // One field is the list and the other field keeps track of whether the - // list is immutable. If it's immutable, the invariant is that it must - // either an instance of Collections.emptyList() or it's an ArrayList - // wrapped in a Collections.unmodifiableList() wrapper and nobody else has - // a reference to the underlying ArrayList. This invariant allows us to - // share instances of lists between protocol buffers avoiding expensive - // memory allocations. Note, immutable is a strong guarantee here -- not - // just that the list cannot be modified via the reference but that the - // list can never be modified. - "private java.util.List $name$_ =\n" - " java.util.Collections.emptyList();\n" - - "private void ensure$capitalized_name$IsMutable() {\n" - " if (!$get_mutable_bit_builder$) {\n" - " $name$_ = new java.util.ArrayList($name$_);\n" - " $set_mutable_bit_builder$;\n" - " }\n" - "}\n"); - - WriteFieldAccessorDocComment(printer, descriptor_, LIST_GETTER); - printer->Print( - variables_, - // Note: We return an unmodifiable list because otherwise the caller - // could hold on to the returned list and modify it after the message - // has been built, thus mutating the message which is supposed to be - // immutable. - "$deprecation$public java.util.List<$type$> " - "${$get$capitalized_name$List$}$() {\n" - " return new com.google.protobuf.Internal.ListAdapter<\n" - " java.lang.Integer, $type$>($name$_, $name$_converter_);\n" - "}\n"); - printer->Annotate("{", "}", descriptor_); - WriteFieldAccessorDocComment(printer, descriptor_, LIST_COUNT); - printer->Print( - variables_, - "$deprecation$public int ${$get$capitalized_name$Count$}$() {\n" - " return $name$_.size();\n" - "}\n"); - printer->Annotate("{", "}", descriptor_); - WriteFieldAccessorDocComment(printer, descriptor_, LIST_INDEXED_GETTER); - printer->Print( - variables_, - "$deprecation$public $type$ ${$get$capitalized_name$$}$(int index) {\n" - " return $name$_converter_.convert($name$_.get(index));\n" - "}\n"); - printer->Annotate("{", "}", descriptor_); - WriteFieldAccessorDocComment(printer, descriptor_, LIST_INDEXED_SETTER, - /* builder */ true); - printer->Print(variables_, - "$deprecation$public Builder ${$set$capitalized_name$$}$(\n" - " int index, $type$ value) {\n" - " if (value == null) {\n" - " throw new NullPointerException();\n" - " }\n" - " ensure$capitalized_name$IsMutable();\n" - " $name$_.set(index, value.getNumber());\n" - " $on_changed$\n" - " return this;\n" - "}\n"); - printer->Annotate("{", "}", descriptor_); - WriteFieldAccessorDocComment(printer, descriptor_, LIST_ADDER, - /* builder */ true); - printer->Print(variables_, - "$deprecation$public Builder " - "${$add$capitalized_name$$}$($type$ value) {\n" - " if (value == null) {\n" - " throw new NullPointerException();\n" - " }\n" - " ensure$capitalized_name$IsMutable();\n" - " $name$_.add(value.getNumber());\n" - " $on_changed$\n" - " return this;\n" - "}\n"); - printer->Annotate("{", "}", descriptor_); - WriteFieldAccessorDocComment(printer, descriptor_, LIST_MULTI_ADDER, - /* builder */ true); - printer->Print(variables_, - "$deprecation$public Builder ${$addAll$capitalized_name$$}$(\n" - " java.lang.Iterable values) {\n" - " ensure$capitalized_name$IsMutable();\n" - " for ($type$ value : values) {\n" - " $name$_.add(value.getNumber());\n" - " }\n" - " $on_changed$\n" - " return this;\n" - "}\n"); - printer->Annotate("{", "}", descriptor_); - WriteFieldAccessorDocComment(printer, descriptor_, CLEARER, - /* builder */ true); - printer->Print( - variables_, - "$deprecation$public Builder ${$clear$capitalized_name$$}$() {\n" - " $name$_ = java.util.Collections.emptyList();\n" - " $clear_mutable_bit_builder$;\n" - " $on_changed$\n" - " return this;\n" - "}\n"); - printer->Annotate("{", "}", descriptor_); - - if (SupportUnknownEnumValue(descriptor_->file())) { - WriteFieldEnumValueAccessorDocComment(printer, descriptor_, LIST_GETTER); - printer->Print(variables_, - "$deprecation$public java.util.List\n" - "${$get$capitalized_name$ValueList$}$() {\n" - " return java.util.Collections.unmodifiableList($name$_);\n" - "}\n"); - printer->Annotate("{", "}", descriptor_); - WriteFieldEnumValueAccessorDocComment(printer, descriptor_, - LIST_INDEXED_GETTER); - printer->Print(variables_, - "$deprecation$public int " - "${$get$capitalized_name$Value$}$(int index) {\n" - " return $name$_.get(index);\n" - "}\n"); - printer->Annotate("{", "}", descriptor_); - WriteFieldEnumValueAccessorDocComment(printer, descriptor_, - LIST_INDEXED_GETTER, - /* builder */ true); - printer->Print( - variables_, - "$deprecation$public Builder ${$set$capitalized_name$Value$}$(\n" - " int index, int value) {\n" - " ensure$capitalized_name$IsMutable();\n" - " $name$_.set(index, value);\n" - " $on_changed$\n" - " return this;\n" - "}\n"); - printer->Annotate("{", "}", descriptor_); - WriteFieldEnumValueAccessorDocComment(printer, descriptor_, LIST_ADDER, - /* builder */ true); - printer->Print(variables_, - "$deprecation$public Builder " - "${$add$capitalized_name$Value$}$(int value) {\n" - " ensure$capitalized_name$IsMutable();\n" - " $name$_.add(value);\n" - " $on_changed$\n" - " return this;\n" - "}\n"); - printer->Annotate("{", "}", descriptor_); - WriteFieldEnumValueAccessorDocComment(printer, descriptor_, - LIST_MULTI_ADDER, /* builder */ true); - printer->Print( - variables_, - "$deprecation$public Builder ${$addAll$capitalized_name$Value$}$(\n" - " java.lang.Iterable values) {\n" - " ensure$capitalized_name$IsMutable();\n" - " for (int value : values) {\n" - " $name$_.add(value);\n" - " }\n" - " $on_changed$\n" - " return this;\n" - "}\n"); - printer->Annotate("{", "}", descriptor_); - } -} - -void RepeatedImmutableEnumFieldGenerator:: - GenerateFieldBuilderInitializationCode(io::Printer* printer) const { - // noop for enums -} - -void RepeatedImmutableEnumFieldGenerator::GenerateInitializationCode( - io::Printer* printer) const { - printer->Print(variables_, "$name$_ = java.util.Collections.emptyList();\n"); -} - -void RepeatedImmutableEnumFieldGenerator::GenerateBuilderClearCode( - io::Printer* printer) const { - printer->Print(variables_, - "$name$_ = java.util.Collections.emptyList();\n" - "$clear_mutable_bit_builder$;\n"); -} - -void RepeatedImmutableEnumFieldGenerator::GenerateMergingCode( - io::Printer* printer) const { - // The code below does two optimizations: - // 1. If the other list is empty, there's nothing to do. This ensures we - // don't allocate a new array if we already have an immutable one. - // 2. If the other list is non-empty and our current list is empty, we can - // reuse the other list which is guaranteed to be immutable. - printer->Print(variables_, - "if (!other.$name$_.isEmpty()) {\n" - " if ($name$_.isEmpty()) {\n" - " $name$_ = other.$name$_;\n" - " $clear_mutable_bit_builder$;\n" - " } else {\n" - " ensure$capitalized_name$IsMutable();\n" - " $name$_.addAll(other.$name$_);\n" - " }\n" - " $on_changed$\n" - "}\n"); -} - -void RepeatedImmutableEnumFieldGenerator::GenerateBuildingCode( - io::Printer* printer) const { - // The code below ensures that the result has an immutable list. If our - // list is immutable, we can just reuse it. If not, we make it immutable. - printer->Print( - variables_, - "if ($get_mutable_bit_builder$) {\n" - " $name$_ = java.util.Collections.unmodifiableList($name$_);\n" - " $clear_mutable_bit_builder$;\n" - "}\n" - "result.$name$_ = $name$_;\n"); -} - -void RepeatedImmutableEnumFieldGenerator::GenerateParsingCode( - io::Printer* printer) const { - // Read and store the enum - if (SupportUnknownEnumValue(descriptor_->file())) { - printer->Print(variables_, - "int rawValue = input.readEnum();\n" - "if (!$get_mutable_bit_parser$) {\n" - " $name$_ = new java.util.ArrayList();\n" - " $set_mutable_bit_parser$;\n" - "}\n" - "$name$_.add(rawValue);\n"); - } else { - printer->Print( - variables_, - "int rawValue = input.readEnum();\n" - "@SuppressWarnings(\"deprecation\")\n" - "$type$ value = $type$.$for_number$(rawValue);\n" - "if (value == null) {\n" - " unknownFields.mergeVarintField($number$, rawValue);\n" - "} else {\n" - " if (!$get_mutable_bit_parser$) {\n" - " $name$_ = new java.util.ArrayList();\n" - " $set_mutable_bit_parser$;\n" - " }\n" - " $name$_.add(rawValue);\n" - "}\n"); - } -} - -void RepeatedImmutableEnumFieldGenerator::GenerateParsingCodeFromPacked( - io::Printer* printer) const { - // Wrap GenerateParsingCode's contents with a while loop. - - printer->Print(variables_, - "int length = input.readRawVarint32();\n" - "int oldLimit = input.pushLimit(length);\n" - "while(input.getBytesUntilLimit() > 0) {\n"); - printer->Indent(); - - GenerateParsingCode(printer); - - printer->Outdent(); - printer->Print(variables_, - "}\n" - "input.popLimit(oldLimit);\n"); -} - -void RepeatedImmutableEnumFieldGenerator::GenerateParsingDoneCode( - io::Printer* printer) const { - printer->Print( - variables_, - "if ($get_mutable_bit_parser$) {\n" - " $name$_ = java.util.Collections.unmodifiableList($name$_);\n" - "}\n"); -} - -void RepeatedImmutableEnumFieldGenerator::GenerateSerializationCode( - io::Printer* printer) const { - if (descriptor_->is_packed()) { - printer->Print(variables_, - "if (get$capitalized_name$List().size() > 0) {\n" - " output.writeUInt32NoTag($tag$);\n" - " output.writeUInt32NoTag($name$MemoizedSerializedSize);\n" - "}\n" - "for (int i = 0; i < $name$_.size(); i++) {\n" - " output.writeEnumNoTag($name$_.get(i));\n" - "}\n"); - } else { - printer->Print(variables_, - "for (int i = 0; i < $name$_.size(); i++) {\n" - " output.writeEnum($number$, $name$_.get(i));\n" - "}\n"); - } -} - -void RepeatedImmutableEnumFieldGenerator::GenerateSerializedSizeCode( - io::Printer* printer) const { - printer->Print(variables_, - "{\n" - " int dataSize = 0;\n"); - printer->Indent(); - - printer->Print(variables_, - "for (int i = 0; i < $name$_.size(); i++) {\n" - " dataSize += com.google.protobuf.CodedOutputStream\n" - " .computeEnumSizeNoTag($name$_.get(i));\n" - "}\n"); - printer->Print("size += dataSize;\n"); - if (descriptor_->is_packed()) { - printer->Print(variables_, - "if (!get$capitalized_name$List().isEmpty()) {" - " size += $tag_size$;\n" - " size += com.google.protobuf.CodedOutputStream\n" - " .computeUInt32SizeNoTag(dataSize);\n" - "}"); - } else { - printer->Print(variables_, "size += $tag_size$ * $name$_.size();\n"); - } - - // cache the data size for packed fields. - if (descriptor_->is_packed()) { - printer->Print(variables_, "$name$MemoizedSerializedSize = dataSize;\n"); - } - - printer->Outdent(); - printer->Print("}\n"); -} - -void RepeatedImmutableEnumFieldGenerator::GenerateEqualsCode( - io::Printer* printer) const { - printer->Print(variables_, - "if (!$name$_.equals(other.$name$_)) return false;\n"); -} - -void RepeatedImmutableEnumFieldGenerator::GenerateHashCode( - io::Printer* printer) const { - printer->Print(variables_, - "if (get$capitalized_name$Count() > 0) {\n" - " hash = (37 * hash) + $constant_name$;\n" - " hash = (53 * hash) + $name$_.hashCode();\n" - "}\n"); -} - -void RepeatedImmutableEnumFieldGenerator::GenerateKotlinDslMembers( - io::Printer* printer) const { - printer->Print( - variables_, - "/**\n" - " * An uninstantiable, behaviorless type to represent the field in\n" - " * generics.\n" - " */\n" - "@kotlin.OptIn" - "(com.google.protobuf.kotlin.OnlyForUseByGeneratedProtoCode::class)\n" - "public class ${$$kt_capitalized_name$Proxy$}$ private constructor()" - " : com.google.protobuf.kotlin.DslProxy()\n"); - - WriteFieldDocComment(printer, descriptor_); - printer->Print(variables_, - "$kt_deprecation$ public val $kt_name$: " - "com.google.protobuf.kotlin.DslList" - "<$kt_type$, ${$$kt_capitalized_name$Proxy$}$>\n" - " @kotlin.jvm.JvmSynthetic\n" - " get() = com.google.protobuf.kotlin.DslList(\n" - " $kt_dsl_builder$.${$get$capitalized_name$List$}$()\n" - " )\n"); - - WriteFieldAccessorDocComment(printer, descriptor_, LIST_ADDER, - /* builder */ false); - printer->Print(variables_, - "@kotlin.jvm.JvmSynthetic\n" - "@kotlin.jvm.JvmName(\"add$kt_capitalized_name$\")\n" - "public fun com.google.protobuf.kotlin.DslList" - "<$kt_type$, ${$$kt_capitalized_name$Proxy$}$>." - "add(value: $kt_type$) {\n" - " $kt_dsl_builder$.${$add$capitalized_name$$}$(value)\n" - "}"); - - WriteFieldAccessorDocComment(printer, descriptor_, LIST_ADDER, - /* builder */ false); - printer->Print(variables_, - "@kotlin.jvm.JvmSynthetic\n" - "@kotlin.jvm.JvmName(\"plusAssign$kt_capitalized_name$\")\n" - "@Suppress(\"NOTHING_TO_INLINE\")\n" - "public inline operator fun com.google.protobuf.kotlin.DslList" - "<$kt_type$, ${$$kt_capitalized_name$Proxy$}$>." - "plusAssign(value: $kt_type$) {\n" - " add(value)\n" - "}"); - - WriteFieldAccessorDocComment(printer, descriptor_, LIST_MULTI_ADDER, - /* builder */ false); - printer->Print(variables_, - "@kotlin.jvm.JvmSynthetic\n" - "@kotlin.jvm.JvmName(\"addAll$kt_capitalized_name$\")\n" - "public fun com.google.protobuf.kotlin.DslList" - "<$kt_type$, ${$$kt_capitalized_name$Proxy$}$>." - "addAll(values: kotlin.collections.Iterable<$kt_type$>) {\n" - " $kt_dsl_builder$.${$addAll$capitalized_name$$}$(values)\n" - "}"); - - WriteFieldAccessorDocComment(printer, descriptor_, LIST_MULTI_ADDER, - /* builder */ false); - printer->Print( - variables_, - "@kotlin.jvm.JvmSynthetic\n" - "@kotlin.jvm.JvmName(\"plusAssignAll$kt_capitalized_name$\")\n" - "@Suppress(\"NOTHING_TO_INLINE\")\n" - "public inline operator fun com.google.protobuf.kotlin.DslList" - "<$kt_type$, ${$$kt_capitalized_name$Proxy$}$>." - "plusAssign(values: kotlin.collections.Iterable<$kt_type$>) {\n" - " addAll(values)\n" - "}"); - - WriteFieldAccessorDocComment(printer, descriptor_, LIST_INDEXED_SETTER, - /* builder */ false); - printer->Print( - variables_, - "@kotlin.jvm.JvmSynthetic\n" - "@kotlin.jvm.JvmName(\"set$kt_capitalized_name$\")\n" - "public operator fun com.google.protobuf.kotlin.DslList" - "<$kt_type$, ${$$kt_capitalized_name$Proxy$}$>." - "set(index: kotlin.Int, value: $kt_type$) {\n" - " $kt_dsl_builder$.${$set$capitalized_name$$}$(index, value)\n" - "}"); - - WriteFieldAccessorDocComment(printer, descriptor_, CLEARER, - /* builder */ false); - printer->Print(variables_, - "@kotlin.jvm.JvmSynthetic\n" - "@kotlin.jvm.JvmName(\"clear$kt_capitalized_name$\")\n" - "public fun com.google.protobuf.kotlin.DslList" - "<$kt_type$, ${$$kt_capitalized_name$Proxy$}$>." - "clear() {\n" - " $kt_dsl_builder$.${$clear$capitalized_name$$}$()\n" - "}"); -} - -std::string RepeatedImmutableEnumFieldGenerator::GetBoxedType() const { - return name_resolver_->GetImmutableClassName(descriptor_->enum_type()); -} - -} // namespace java -} // namespace compiler -} // namespace protobuf -} // namespace google diff --git a/extra/protobuf/protobuf-3.19.4/src/google/protobuf/compiler/java/java_enum_field.h b/extra/protobuf/protobuf-3.19.4/src/google/protobuf/compiler/java/java_enum_field.h deleted file mode 100644 index 82dbd9e4a684..000000000000 --- a/extra/protobuf/protobuf-3.19.4/src/google/protobuf/compiler/java/java_enum_field.h +++ /dev/null @@ -1,161 +0,0 @@ -// Protocol Buffers - Google's data interchange format -// Copyright 2008 Google Inc. All rights reserved. -// https://developers.google.com/protocol-buffers/ -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// * Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// * Redistributions in binary form must reproduce the above -// copyright notice, this list of conditions and the following disclaimer -// in the documentation and/or other materials provided with the -// distribution. -// * Neither the name of Google Inc. nor the names of its -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -// Author: kenton@google.com (Kenton Varda) -// Based on original Protocol Buffers design by -// Sanjay Ghemawat, Jeff Dean, and others. - -#ifndef GOOGLE_PROTOBUF_COMPILER_JAVA_ENUM_FIELD_H__ -#define GOOGLE_PROTOBUF_COMPILER_JAVA_ENUM_FIELD_H__ - -#include -#include -#include - -namespace google { -namespace protobuf { -namespace compiler { -namespace java { -class Context; // context.h -class ClassNameResolver; // name_resolver.h -} // namespace java -} // namespace compiler -} // namespace protobuf -} // namespace google - -namespace google { -namespace protobuf { -namespace compiler { -namespace java { - -class ImmutableEnumFieldGenerator : public ImmutableFieldGenerator { - public: - explicit ImmutableEnumFieldGenerator(const FieldDescriptor* descriptor, - int messageBitIndex, int builderBitIndex, - Context* context); - ~ImmutableEnumFieldGenerator() override; - - // implements ImmutableFieldGenerator - // --------------------------------------- - int GetNumBitsForMessage() const override; - int GetNumBitsForBuilder() const override; - void GenerateInterfaceMembers(io::Printer* printer) const override; - void GenerateMembers(io::Printer* printer) const override; - void GenerateBuilderMembers(io::Printer* printer) const override; - void GenerateInitializationCode(io::Printer* printer) const override; - void GenerateBuilderClearCode(io::Printer* printer) const override; - void GenerateMergingCode(io::Printer* printer) const override; - void GenerateBuildingCode(io::Printer* printer) const override; - void GenerateParsingCode(io::Printer* printer) const override; - void GenerateParsingDoneCode(io::Printer* printer) const override; - void GenerateSerializationCode(io::Printer* printer) const override; - void GenerateSerializedSizeCode(io::Printer* printer) const override; - void GenerateFieldBuilderInitializationCode( - io::Printer* printer) const override; - void GenerateEqualsCode(io::Printer* printer) const override; - void GenerateHashCode(io::Printer* printer) const override; - void GenerateKotlinDslMembers(io::Printer* printer) const override; - - std::string GetBoxedType() const override; - - protected: - const FieldDescriptor* descriptor_; - std::map variables_; - ClassNameResolver* name_resolver_; - - private: - GOOGLE_DISALLOW_EVIL_CONSTRUCTORS(ImmutableEnumFieldGenerator); -}; - -class ImmutableEnumOneofFieldGenerator : public ImmutableEnumFieldGenerator { - public: - ImmutableEnumOneofFieldGenerator(const FieldDescriptor* descriptor, - int messageBitIndex, int builderBitIndex, - Context* context); - ~ImmutableEnumOneofFieldGenerator(); - - void GenerateMembers(io::Printer* printer) const override; - void GenerateBuilderMembers(io::Printer* printer) const override; - void GenerateMergingCode(io::Printer* printer) const override; - void GenerateBuildingCode(io::Printer* printer) const override; - void GenerateParsingCode(io::Printer* printer) const override; - void GenerateSerializationCode(io::Printer* printer) const override; - void GenerateSerializedSizeCode(io::Printer* printer) const override; - void GenerateEqualsCode(io::Printer* printer) const override; - void GenerateHashCode(io::Printer* printer) const override; - - private: - GOOGLE_DISALLOW_EVIL_CONSTRUCTORS(ImmutableEnumOneofFieldGenerator); -}; - -class RepeatedImmutableEnumFieldGenerator : public ImmutableFieldGenerator { - public: - explicit RepeatedImmutableEnumFieldGenerator( - const FieldDescriptor* descriptor, int messageBitIndex, - int builderBitIndex, Context* context); - ~RepeatedImmutableEnumFieldGenerator() override; - - // implements ImmutableFieldGenerator --------------------------------------- - int GetNumBitsForMessage() const override; - int GetNumBitsForBuilder() const override; - void GenerateInterfaceMembers(io::Printer* printer) const override; - void GenerateMembers(io::Printer* printer) const override; - void GenerateBuilderMembers(io::Printer* printer) const override; - void GenerateInitializationCode(io::Printer* printer) const override; - void GenerateBuilderClearCode(io::Printer* printer) const override; - void GenerateMergingCode(io::Printer* printer) const override; - void GenerateBuildingCode(io::Printer* printer) const override; - void GenerateParsingCode(io::Printer* printer) const override; - void GenerateParsingCodeFromPacked(io::Printer* printer) const override; - void GenerateParsingDoneCode(io::Printer* printer) const override; - void GenerateSerializationCode(io::Printer* printer) const override; - void GenerateSerializedSizeCode(io::Printer* printer) const override; - void GenerateFieldBuilderInitializationCode( - io::Printer* printer) const override; - void GenerateEqualsCode(io::Printer* printer) const override; - void GenerateHashCode(io::Printer* printer) const override; - void GenerateKotlinDslMembers(io::Printer* printer) const override; - - std::string GetBoxedType() const override; - - private: - const FieldDescriptor* descriptor_; - std::map variables_; - ClassNameResolver* name_resolver_; - - GOOGLE_DISALLOW_EVIL_CONSTRUCTORS(RepeatedImmutableEnumFieldGenerator); -}; - -} // namespace java -} // namespace compiler -} // namespace protobuf -} // namespace google - -#endif // GOOGLE_PROTOBUF_COMPILER_JAVA_ENUM_FIELD_H__ diff --git a/extra/protobuf/protobuf-3.19.4/src/google/protobuf/compiler/java/java_enum_field_lite.cc b/extra/protobuf/protobuf-3.19.4/src/google/protobuf/compiler/java/java_enum_field_lite.cc deleted file mode 100644 index ca3a2e880307..000000000000 --- a/extra/protobuf/protobuf-3.19.4/src/google/protobuf/compiler/java/java_enum_field_lite.cc +++ /dev/null @@ -1,918 +0,0 @@ -// Protocol Buffers - Google's data interchange format -// Copyright 2008 Google Inc. All rights reserved. -// https://developers.google.com/protocol-buffers/ -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// * Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// * Redistributions in binary form must reproduce the above -// copyright notice, this list of conditions and the following disclaimer -// in the documentation and/or other materials provided with the -// distribution. -// * Neither the name of Google Inc. nor the names of its -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -// Author: kenton@google.com (Kenton Varda) -// Based on original Protocol Buffers design by -// Sanjay Ghemawat, Jeff Dean, and others. - -#include - -#include -#include -#include - -#include -#include -#include -#include -#include -#include -#include -#include -#include - -namespace google { -namespace protobuf { -namespace compiler { -namespace java { - -namespace { -bool EnableExperimentalRuntimeForLite() { -#ifdef PROTOBUF_EXPERIMENT - return PROTOBUF_EXPERIMENT; -#else // PROTOBUF_EXPERIMENT - return false; -#endif // !PROTOBUF_EXPERIMENT -} - -void SetEnumVariables(const FieldDescriptor* descriptor, int messageBitIndex, - int builderBitIndex, const FieldGeneratorInfo* info, - ClassNameResolver* name_resolver, - std::map* variables) { - SetCommonFieldVariables(descriptor, info, variables); - - (*variables)["type"] = - name_resolver->GetImmutableClassName(descriptor->enum_type()); - (*variables)["kt_type"] = (*variables)["type"]; - (*variables)["mutable_type"] = - name_resolver->GetMutableClassName(descriptor->enum_type()); - (*variables)["default"] = ImmutableDefaultValue(descriptor, name_resolver); - (*variables)["default_number"] = - StrCat(descriptor->default_value_enum()->number()); - (*variables)["tag"] = StrCat( - static_cast(internal::WireFormat::MakeTag(descriptor))); - (*variables)["tag_size"] = StrCat( - internal::WireFormat::TagSize(descriptor->number(), GetType(descriptor))); - // TODO(birdo): Add @deprecated javadoc when generating javadoc is supported - // by the proto compiler - (*variables)["deprecation"] = - descriptor->options().deprecated() ? "@java.lang.Deprecated " : ""; - (*variables)["kt_deprecation"] = - descriptor->options().deprecated() - ? "@kotlin.Deprecated(message = \"Field " + (*variables)["name"] + - " is deprecated\") " - : ""; - (*variables)["required"] = descriptor->is_required() ? "true" : "false"; - - if (HasHasbit(descriptor)) { - // For singular messages and builders, one bit is used for the hasField bit. - (*variables)["get_has_field_bit_message"] = GenerateGetBit(messageBitIndex); - - // Note that these have a trailing ";". - (*variables)["set_has_field_bit_message"] = - GenerateSetBit(messageBitIndex) + ";"; - (*variables)["clear_has_field_bit_message"] = - GenerateClearBit(messageBitIndex) + ";"; - - (*variables)["is_field_present_message"] = GenerateGetBit(messageBitIndex); - } else { - (*variables)["set_has_field_bit_message"] = ""; - (*variables)["clear_has_field_bit_message"] = ""; - - (*variables)["is_field_present_message"] = - (*variables)["name"] + "_ != " + (*variables)["default"] + - ".getNumber()"; - } - - (*variables)["get_has_field_bit_from_local"] = - GenerateGetBitFromLocal(builderBitIndex); - (*variables)["set_has_field_bit_to_local"] = - GenerateSetBitToLocal(messageBitIndex); - - if (SupportUnknownEnumValue(descriptor->file())) { - (*variables)["unknown"] = (*variables)["type"] + ".UNRECOGNIZED"; - } else { - (*variables)["unknown"] = (*variables)["default"]; - } - - // We use `x.getClass()` as a null check because it generates less bytecode - // than an `if (x == null) { throw ... }` statement. - (*variables)["null_check"] = "value.getClass();\n"; -} - -} // namespace - -// =================================================================== - -ImmutableEnumFieldLiteGenerator::ImmutableEnumFieldLiteGenerator( - const FieldDescriptor* descriptor, int messageBitIndex, Context* context) - : descriptor_(descriptor), - messageBitIndex_(messageBitIndex), - context_(context), - name_resolver_(context->GetNameResolver()) { - SetEnumVariables(descriptor, messageBitIndex, 0, - context->GetFieldGeneratorInfo(descriptor), name_resolver_, - &variables_); -} - -ImmutableEnumFieldLiteGenerator::~ImmutableEnumFieldLiteGenerator() {} - -int ImmutableEnumFieldLiteGenerator::GetNumBitsForMessage() const { - return HasHasbit(descriptor_) ? 1 : 0; -} - -void ImmutableEnumFieldLiteGenerator::GenerateInterfaceMembers( - io::Printer* printer) const { - if (HasHazzer(descriptor_)) { - WriteFieldAccessorDocComment(printer, descriptor_, HAZZER); - printer->Print(variables_, - "$deprecation$boolean has$capitalized_name$();\n"); - } - if (SupportUnknownEnumValue(descriptor_->file())) { - WriteFieldEnumValueAccessorDocComment(printer, descriptor_, GETTER); - printer->Print(variables_, - "$deprecation$int get$capitalized_name$Value();\n"); - } - WriteFieldAccessorDocComment(printer, descriptor_, GETTER); - printer->Print(variables_, "$deprecation$$type$ get$capitalized_name$();\n"); -} - -void ImmutableEnumFieldLiteGenerator::GenerateMembers( - io::Printer* printer) const { - printer->Print(variables_, "private int $name$_;\n"); - PrintExtraFieldInfo(variables_, printer); - if (HasHazzer(descriptor_)) { - WriteFieldAccessorDocComment(printer, descriptor_, HAZZER); - printer->Print( - variables_, - "@java.lang.Override\n" - "$deprecation$public boolean ${$has$capitalized_name$$}$() {\n" - " return $get_has_field_bit_message$;\n" - "}\n"); - printer->Annotate("{", "}", descriptor_); - } - if (SupportUnknownEnumValue(descriptor_->file())) { - WriteFieldEnumValueAccessorDocComment(printer, descriptor_, GETTER); - printer->Print( - variables_, - "@java.lang.Override\n" - "$deprecation$public int ${$get$capitalized_name$Value$}$() {\n" - " return $name$_;\n" - "}\n"); - printer->Annotate("{", "}", descriptor_); - } - WriteFieldAccessorDocComment(printer, descriptor_, GETTER); - printer->Print(variables_, - "@java.lang.Override\n" - "$deprecation$public $type$ ${$get$capitalized_name$$}$() {\n" - " $type$ result = $type$.forNumber($name$_);\n" - " return result == null ? $unknown$ : result;\n" - "}\n"); - printer->Annotate("{", "}", descriptor_); - - // Generate private setters for the builder to proxy into. - if (SupportUnknownEnumValue(descriptor_->file())) { - WriteFieldEnumValueAccessorDocComment(printer, descriptor_, SETTER); - printer->Print(variables_, - "private void set$capitalized_name$Value(int value) {\n" - " $set_has_field_bit_message$" - " $name$_ = value;\n" - "}\n"); - } - WriteFieldAccessorDocComment(printer, descriptor_, SETTER); - printer->Print(variables_, - "private void set$capitalized_name$($type$ value) {\n" - " $name$_ = value.getNumber();\n" - " $set_has_field_bit_message$\n" - "}\n"); - WriteFieldAccessorDocComment(printer, descriptor_, CLEARER); - printer->Print(variables_, - "private void clear$capitalized_name$() {\n" - " $clear_has_field_bit_message$\n" - " $name$_ = $default_number$;\n" - "}\n"); -} - -void ImmutableEnumFieldLiteGenerator::GenerateBuilderMembers( - io::Printer* printer) const { - if (HasHazzer(descriptor_)) { - WriteFieldAccessorDocComment(printer, descriptor_, HAZZER); - printer->Print( - variables_, - "@java.lang.Override\n" - "$deprecation$public boolean ${$has$capitalized_name$$}$() {\n" - " return instance.has$capitalized_name$();\n" - "}\n"); - printer->Annotate("{", "}", descriptor_); - } - if (SupportUnknownEnumValue(descriptor_->file())) { - WriteFieldEnumValueAccessorDocComment(printer, descriptor_, GETTER); - printer->Print( - variables_, - "@java.lang.Override\n" - "$deprecation$public int ${$get$capitalized_name$Value$}$() {\n" - " return instance.get$capitalized_name$Value();\n" - "}\n"); - printer->Annotate("{", "}", descriptor_); - WriteFieldAccessorDocComment(printer, descriptor_, SETTER, - /* builder */ true); - printer->Print(variables_, - "$deprecation$public Builder " - "${$set$capitalized_name$Value$}$(int value) {\n" - " copyOnWrite();\n" - " instance.set$capitalized_name$Value(value);\n" - " return this;\n" - "}\n"); - printer->Annotate("{", "}", descriptor_); - } - WriteFieldAccessorDocComment(printer, descriptor_, GETTER); - printer->Print(variables_, - "@java.lang.Override\n" - "$deprecation$public $type$ ${$get$capitalized_name$$}$() {\n" - " return instance.get$capitalized_name$();\n" - "}\n"); - printer->Annotate("{", "}", descriptor_); - WriteFieldEnumValueAccessorDocComment(printer, descriptor_, SETTER, - /* builder */ true); - printer->Print(variables_, - "$deprecation$public Builder " - "${$set$capitalized_name$$}$($type$ value) {\n" - " copyOnWrite();\n" - " instance.set$capitalized_name$(value);\n" - " return this;\n" - "}\n"); - printer->Annotate("{", "}", descriptor_); - WriteFieldAccessorDocComment(printer, descriptor_, CLEARER, - /* builder */ true); - printer->Print( - variables_, - "$deprecation$public Builder ${$clear$capitalized_name$$}$() {\n" - " copyOnWrite();\n" - " instance.clear$capitalized_name$();\n" - " return this;\n" - "}\n"); - printer->Annotate("{", "}", descriptor_); -} - -void ImmutableEnumFieldLiteGenerator::GenerateKotlinDslMembers( - io::Printer* printer) const { - WriteFieldDocComment(printer, descriptor_); - printer->Print(variables_, - "$kt_deprecation$public var $kt_name$: $kt_type$\n" - " @JvmName(\"${$get$kt_capitalized_name$$}$\")\n" - " get() = $kt_dsl_builder$.${$get$capitalized_name$$}$()\n" - " @JvmName(\"${$set$kt_capitalized_name$$}$\")\n" - " set(value) {\n" - " $kt_dsl_builder$.${$set$capitalized_name$$}$(value)\n" - " }\n"); - - WriteFieldAccessorDocComment(printer, descriptor_, CLEARER, - /* builder */ false); - printer->Print(variables_, - "public fun ${$clear$kt_capitalized_name$$}$() {\n" - " $kt_dsl_builder$.${$clear$capitalized_name$$}$()\n" - "}\n"); - - if (HasHazzer(descriptor_)) { - WriteFieldAccessorDocComment(printer, descriptor_, HAZZER); - printer->Print( - variables_, - "public fun ${$has$kt_capitalized_name$$}$(): kotlin.Boolean {\n" - " return $kt_dsl_builder$.${$has$capitalized_name$$}$()\n" - "}\n"); - } -} - -void ImmutableEnumFieldLiteGenerator::GenerateInitializationCode( - io::Printer* printer) const { - if (!IsDefaultValueJavaDefault(descriptor_)) { - printer->Print(variables_, "$name$_ = $default_number$;\n"); - } -} - -void ImmutableEnumFieldLiteGenerator::GenerateFieldInfo( - io::Printer* printer, std::vector* output) const { - WriteIntToUtf16CharSequence(descriptor_->number(), output); - WriteIntToUtf16CharSequence(GetExperimentalJavaFieldType(descriptor_), - output); - if (HasHasbit(descriptor_)) { - WriteIntToUtf16CharSequence(messageBitIndex_, output); - } - printer->Print(variables_, "\"$name$_\",\n"); - if (!SupportUnknownEnumValue((descriptor_))) { - PrintEnumVerifierLogic(printer, descriptor_, variables_, - /*var_name=*/"$type$", - /*terminating_string=*/",\n", - /*enforce_lite=*/context_->EnforceLite()); - } -} - -std::string ImmutableEnumFieldLiteGenerator::GetBoxedType() const { - return name_resolver_->GetImmutableClassName(descriptor_->enum_type()); -} - -// =================================================================== - -ImmutableEnumOneofFieldLiteGenerator::ImmutableEnumOneofFieldLiteGenerator( - const FieldDescriptor* descriptor, int messageBitIndex, Context* context) - : ImmutableEnumFieldLiteGenerator(descriptor, messageBitIndex, context) { - const OneofGeneratorInfo* info = - context->GetOneofGeneratorInfo(descriptor->containing_oneof()); - SetCommonOneofVariables(descriptor, info, &variables_); -} - -ImmutableEnumOneofFieldLiteGenerator::~ImmutableEnumOneofFieldLiteGenerator() {} - -void ImmutableEnumOneofFieldLiteGenerator::GenerateMembers( - io::Printer* printer) const { - PrintExtraFieldInfo(variables_, printer); - GOOGLE_DCHECK(HasHazzer(descriptor_)); - WriteFieldAccessorDocComment(printer, descriptor_, HAZZER); - printer->Print(variables_, - "@java.lang.Override\n" - "$deprecation$public boolean ${$has$capitalized_name$$}$() {\n" - " return $has_oneof_case_message$;\n" - "}\n"); - printer->Annotate("{", "}", descriptor_); - - if (SupportUnknownEnumValue(descriptor_->file())) { - WriteFieldEnumValueAccessorDocComment(printer, descriptor_, GETTER); - printer->Print( - variables_, - "@java.lang.Override\n" - "$deprecation$public int ${$get$capitalized_name$Value$}$() {\n" - " if ($has_oneof_case_message$) {\n" - " return (java.lang.Integer) $oneof_name$_;\n" - " }\n" - " return $default_number$;\n" - "}\n"); - printer->Annotate("{", "}", descriptor_); - } - WriteFieldAccessorDocComment(printer, descriptor_, GETTER); - printer->Print(variables_, - "@java.lang.Override\n" - "$deprecation$public $type$ ${$get$capitalized_name$$}$() {\n" - " if ($has_oneof_case_message$) {\n" - " $type$ result = $type$.forNumber((java.lang.Integer) " - "$oneof_name$_);\n" - " return result == null ? $unknown$ : result;\n" - " }\n" - " return $default$;\n" - "}\n"); - printer->Annotate("{", "}", descriptor_); - - // Generate private setters for the builder to proxy into. - if (SupportUnknownEnumValue(descriptor_->file())) { - WriteFieldEnumValueAccessorDocComment(printer, descriptor_, SETTER); - printer->Print(variables_, - "private void set$capitalized_name$Value(int value) {\n" - " $set_oneof_case_message$;\n" - " $oneof_name$_ = value;\n" - "}\n"); - } - WriteFieldAccessorDocComment(printer, descriptor_, SETTER); - printer->Print(variables_, - "private void set$capitalized_name$($type$ value) {\n" - " $oneof_name$_ = value.getNumber();\n" - " $set_oneof_case_message$;\n" - "}\n"); - WriteFieldAccessorDocComment(printer, descriptor_, CLEARER); - printer->Print(variables_, - "private void clear$capitalized_name$() {\n" - " if ($has_oneof_case_message$) {\n" - " $clear_oneof_case_message$;\n" - " $oneof_name$_ = null;\n" - " }\n" - "}\n"); -} - -void ImmutableEnumOneofFieldLiteGenerator::GenerateFieldInfo( - io::Printer* printer, std::vector* output) const { - WriteIntToUtf16CharSequence(descriptor_->number(), output); - WriteIntToUtf16CharSequence(GetExperimentalJavaFieldType(descriptor_), - output); - WriteIntToUtf16CharSequence(descriptor_->containing_oneof()->index(), output); - if (!SupportUnknownEnumValue(descriptor_)) { - PrintEnumVerifierLogic(printer, descriptor_, variables_, - /*var_name=*/"$type$", - /*terminating_string=*/",\n", - /*enforce_lite=*/context_->EnforceLite()); - } -} - -void ImmutableEnumOneofFieldLiteGenerator::GenerateBuilderMembers( - io::Printer* printer) const { - GOOGLE_DCHECK(HasHazzer(descriptor_)); - WriteFieldAccessorDocComment(printer, descriptor_, HAZZER); - printer->Print(variables_, - "@java.lang.Override\n" - "$deprecation$public boolean ${$has$capitalized_name$$}$() {\n" - " return instance.has$capitalized_name$();\n" - "}\n"); - printer->Annotate("{", "}", descriptor_); - - if (SupportUnknownEnumValue(descriptor_->file())) { - WriteFieldEnumValueAccessorDocComment(printer, descriptor_, GETTER); - printer->Print( - variables_, - "@java.lang.Override\n" - "$deprecation$public int ${$get$capitalized_name$Value$}$() {\n" - " return instance.get$capitalized_name$Value();\n" - "}\n"); - printer->Annotate("{", "}", descriptor_); - WriteFieldEnumValueAccessorDocComment(printer, descriptor_, SETTER, - /* builder */ true); - printer->Print(variables_, - "$deprecation$public Builder " - "${$set$capitalized_name$Value$}$(int value) {\n" - " copyOnWrite();\n" - " instance.set$capitalized_name$Value(value);\n" - " return this;\n" - "}\n"); - printer->Annotate("{", "}", descriptor_); - } - WriteFieldAccessorDocComment(printer, descriptor_, GETTER); - printer->Print(variables_, - "@java.lang.Override\n" - "$deprecation$public $type$ ${$get$capitalized_name$$}$() {\n" - " return instance.get$capitalized_name$();\n" - "}\n"); - printer->Annotate("{", "}", descriptor_); - WriteFieldAccessorDocComment(printer, descriptor_, SETTER, - /* builder */ true); - printer->Print(variables_, - "$deprecation$public Builder " - "${$set$capitalized_name$$}$($type$ value) {\n" - " copyOnWrite();\n" - " instance.set$capitalized_name$(value);\n" - " return this;\n" - "}\n"); - printer->Annotate("{", "}", descriptor_); - WriteFieldAccessorDocComment(printer, descriptor_, CLEARER, - /* builder */ true); - printer->Print( - variables_, - "$deprecation$public Builder ${$clear$capitalized_name$$}$() {\n" - " copyOnWrite();\n" - " instance.clear$capitalized_name$();\n" - " return this;\n" - "}\n"); - printer->Annotate("{", "}", descriptor_); -} - -// =================================================================== - -RepeatedImmutableEnumFieldLiteGenerator:: - RepeatedImmutableEnumFieldLiteGenerator(const FieldDescriptor* descriptor, - int messageBitIndex, - Context* context) - : descriptor_(descriptor), - context_(context), - name_resolver_(context->GetNameResolver()) { - SetEnumVariables(descriptor, messageBitIndex, 0, - context->GetFieldGeneratorInfo(descriptor), name_resolver_, - &variables_); -} - -RepeatedImmutableEnumFieldLiteGenerator:: - ~RepeatedImmutableEnumFieldLiteGenerator() {} - -int RepeatedImmutableEnumFieldLiteGenerator::GetNumBitsForMessage() const { - return 0; -} - -void RepeatedImmutableEnumFieldLiteGenerator::GenerateInterfaceMembers( - io::Printer* printer) const { - WriteFieldAccessorDocComment(printer, descriptor_, LIST_GETTER); - printer->Print( - variables_, - "$deprecation$java.util.List<$type$> get$capitalized_name$List();\n"); - WriteFieldAccessorDocComment(printer, descriptor_, LIST_COUNT); - printer->Print(variables_, - "$deprecation$int get$capitalized_name$Count();\n"); - WriteFieldAccessorDocComment(printer, descriptor_, LIST_INDEXED_GETTER); - printer->Print(variables_, - "$deprecation$$type$ get$capitalized_name$(int index);\n"); - if (SupportUnknownEnumValue(descriptor_->file())) { - WriteFieldEnumValueAccessorDocComment(printer, descriptor_, LIST_GETTER); - printer->Print(variables_, - "$deprecation$java.util.List\n" - "get$capitalized_name$ValueList();\n"); - WriteFieldEnumValueAccessorDocComment(printer, descriptor_, - LIST_INDEXED_GETTER); - printer->Print(variables_, - "$deprecation$int get$capitalized_name$Value(int index);\n"); - } -} - -void RepeatedImmutableEnumFieldLiteGenerator::GenerateMembers( - io::Printer* printer) const { - printer->Print( - variables_, - "private com.google.protobuf.Internal.IntList $name$_;\n" - "private static final " - "com.google.protobuf.Internal.ListAdapter.Converter<\n" - " java.lang.Integer, $type$> $name$_converter_ =\n" - " new com.google.protobuf.Internal.ListAdapter.Converter<\n" - " java.lang.Integer, $type$>() {\n" - " @java.lang.Override\n" - " public $type$ convert(java.lang.Integer from) {\n" - " $type$ result = $type$.forNumber(from);\n" - " return result == null ? $unknown$ : result;\n" - " }\n" - " };\n"); - PrintExtraFieldInfo(variables_, printer); - WriteFieldAccessorDocComment(printer, descriptor_, LIST_GETTER); - printer->Print( - variables_, - "@java.lang.Override\n" - "$deprecation$public java.util.List<$type$> " - "${$get$capitalized_name$List$}$() {\n" - " return new com.google.protobuf.Internal.ListAdapter<\n" - " java.lang.Integer, $type$>($name$_, $name$_converter_);\n" - "}\n"); - printer->Annotate("{", "}", descriptor_); - WriteFieldAccessorDocComment(printer, descriptor_, LIST_COUNT); - printer->Print( - variables_, - "@java.lang.Override\n" - "$deprecation$public int ${$get$capitalized_name$Count$}$() {\n" - " return $name$_.size();\n" - "}\n"); - printer->Annotate("{", "}", descriptor_); - WriteFieldAccessorDocComment(printer, descriptor_, LIST_INDEXED_GETTER); - printer->Print( - variables_, - // NB: Do not use the "$name$_converter_" field; the usage of generics - // (and requisite upcasts to Object) prevent optimizations. Even - // without any optimizations, the below code is cheaper because it - // avoids boxing an int and a checkcast from the generics. - "@java.lang.Override\n" - "$deprecation$public $type$ ${$get$capitalized_name$$}$(int index) {\n" - " $type$ result = $type$.forNumber($name$_.getInt(index));\n" - " return result == null ? $unknown$ : result;\n" - "}\n"); - printer->Annotate("{", "}", descriptor_); - if (SupportUnknownEnumValue(descriptor_->file())) { - WriteFieldEnumValueAccessorDocComment(printer, descriptor_, LIST_GETTER); - printer->Print(variables_, - "@java.lang.Override\n" - "$deprecation$public java.util.List\n" - "${$get$capitalized_name$ValueList$}$() {\n" - " return $name$_;\n" - "}\n"); - printer->Annotate("{", "}", descriptor_); - WriteFieldEnumValueAccessorDocComment(printer, descriptor_, - LIST_INDEXED_GETTER); - printer->Print(variables_, - "@java.lang.Override\n" - "$deprecation$public int " - "${$get$capitalized_name$Value$}$(int index) {\n" - " return $name$_.getInt(index);\n" - "}\n"); - printer->Annotate("{", "}", descriptor_); - } - - if (!EnableExperimentalRuntimeForLite() && descriptor_->is_packed() && - context_->HasGeneratedMethods(descriptor_->containing_type())) { - printer->Print(variables_, "private int $name$MemoizedSerializedSize;\n"); - } - - // Generate private setters for the builder to proxy into. - printer->Print( - variables_, - "private void ensure$capitalized_name$IsMutable() {\n" - // Use a temporary to avoid a redundant iget-object. - " com.google.protobuf.Internal.IntList tmp = $name$_;\n" - " if (!tmp.isModifiable()) {\n" - " $name$_ =\n" - " com.google.protobuf.GeneratedMessageLite.mutableCopy(tmp);\n" - " }\n" - "}\n"); - WriteFieldAccessorDocComment(printer, descriptor_, LIST_INDEXED_SETTER); - printer->Print(variables_, - "private void set$capitalized_name$(\n" - " int index, $type$ value) {\n" - " $null_check$" - " ensure$capitalized_name$IsMutable();\n" - " $name$_.setInt(index, value.getNumber());\n" - "}\n"); - WriteFieldAccessorDocComment(printer, descriptor_, LIST_ADDER); - printer->Print(variables_, - "private void add$capitalized_name$($type$ value) {\n" - " $null_check$" - " ensure$capitalized_name$IsMutable();\n" - " $name$_.addInt(value.getNumber());\n" - "}\n"); - WriteFieldAccessorDocComment(printer, descriptor_, LIST_MULTI_ADDER); - printer->Print(variables_, - "private void addAll$capitalized_name$(\n" - " java.lang.Iterable values) {\n" - " ensure$capitalized_name$IsMutable();\n" - " for ($type$ value : values) {\n" - " $name$_.addInt(value.getNumber());\n" - " }\n" - "}\n"); - WriteFieldAccessorDocComment(printer, descriptor_, CLEARER); - printer->Print(variables_, - "private void clear$capitalized_name$() {\n" - " $name$_ = emptyIntList();\n" - "}\n"); - - if (SupportUnknownEnumValue(descriptor_->file())) { - WriteFieldEnumValueAccessorDocComment(printer, descriptor_, SETTER); - printer->Print(variables_, - "private void set$capitalized_name$Value(\n" - " int index, int value) {\n" - " ensure$capitalized_name$IsMutable();\n" - " $name$_.setInt(index, value);\n" - "}\n"); - WriteFieldEnumValueAccessorDocComment(printer, descriptor_, LIST_ADDER); - printer->Print(variables_, - "private void add$capitalized_name$Value(int value) {\n" - " ensure$capitalized_name$IsMutable();\n" - " $name$_.addInt(value);\n" - "}\n"); - WriteFieldEnumValueAccessorDocComment(printer, descriptor_, - LIST_MULTI_ADDER); - printer->Print(variables_, - "private void addAll$capitalized_name$Value(\n" - " java.lang.Iterable values) {\n" - " ensure$capitalized_name$IsMutable();\n" - " for (int value : values) {\n" - " $name$_.addInt(value);\n" - " }\n" - "}\n"); - } -} - -void RepeatedImmutableEnumFieldLiteGenerator::GenerateFieldInfo( - io::Printer* printer, std::vector* output) const { - WriteIntToUtf16CharSequence(descriptor_->number(), output); - WriteIntToUtf16CharSequence(GetExperimentalJavaFieldType(descriptor_), - output); - printer->Print(variables_, "\"$name$_\",\n"); - if (!SupportUnknownEnumValue(descriptor_->file())) { - PrintEnumVerifierLogic(printer, descriptor_, variables_, - /*var_name=*/"$type$", - /*terminating_string=*/",\n", - /*enforce_lite=*/context_->EnforceLite()); - } -} - -void RepeatedImmutableEnumFieldLiteGenerator::GenerateBuilderMembers( - io::Printer* printer) const { - WriteFieldAccessorDocComment(printer, descriptor_, LIST_GETTER); - printer->Print(variables_, - "@java.lang.Override\n" - "$deprecation$public java.util.List<$type$> " - "${$get$capitalized_name$List$}$() {\n" - " return instance.get$capitalized_name$List();\n" - "}\n"); - printer->Annotate("{", "}", descriptor_); - WriteFieldAccessorDocComment(printer, descriptor_, LIST_COUNT); - printer->Print( - variables_, - "@java.lang.Override\n" - "$deprecation$public int ${$get$capitalized_name$Count$}$() {\n" - " return instance.get$capitalized_name$Count();\n" - "}\n"); - printer->Annotate("{", "}", descriptor_); - WriteFieldAccessorDocComment(printer, descriptor_, LIST_INDEXED_GETTER); - printer->Print( - variables_, - "@java.lang.Override\n" - "$deprecation$public $type$ ${$get$capitalized_name$$}$(int index) {\n" - " return instance.get$capitalized_name$(index);\n" - "}\n"); - printer->Annotate("{", "}", descriptor_); - WriteFieldAccessorDocComment(printer, descriptor_, LIST_INDEXED_SETTER, - /* builder */ true); - printer->Print(variables_, - "$deprecation$public Builder ${$set$capitalized_name$$}$(\n" - " int index, $type$ value) {\n" - " copyOnWrite();\n" - " instance.set$capitalized_name$(index, value);\n" - " return this;\n" - "}\n"); - printer->Annotate("{", "}", descriptor_); - WriteFieldAccessorDocComment(printer, descriptor_, LIST_ADDER, - /* builder */ true); - printer->Print(variables_, - "$deprecation$public Builder " - "${$add$capitalized_name$$}$($type$ value) {\n" - " copyOnWrite();\n" - " instance.add$capitalized_name$(value);\n" - " return this;\n" - "}\n"); - printer->Annotate("{", "}", descriptor_); - WriteFieldAccessorDocComment(printer, descriptor_, LIST_MULTI_ADDER, - /* builder */ true); - printer->Print(variables_, - "$deprecation$public Builder ${$addAll$capitalized_name$$}$(\n" - " java.lang.Iterable values) {\n" - " copyOnWrite();\n" - " instance.addAll$capitalized_name$(values);" - " return this;\n" - "}\n"); - printer->Annotate("{", "}", descriptor_); - WriteFieldAccessorDocComment(printer, descriptor_, CLEARER, - /* builder */ true); - printer->Print( - variables_, - "$deprecation$public Builder ${$clear$capitalized_name$$}$() {\n" - " copyOnWrite();\n" - " instance.clear$capitalized_name$();\n" - " return this;\n" - "}\n"); - printer->Annotate("{", "}", descriptor_); - - if (SupportUnknownEnumValue(descriptor_->file())) { - WriteFieldEnumValueAccessorDocComment(printer, descriptor_, LIST_GETTER); - printer->Print(variables_, - "@java.lang.Override\n" - "$deprecation$public java.util.List\n" - "${$get$capitalized_name$ValueList$}$() {\n" - " return java.util.Collections.unmodifiableList(\n" - " instance.get$capitalized_name$ValueList());\n" - "}\n"); - printer->Annotate("{", "}", descriptor_); - WriteFieldEnumValueAccessorDocComment(printer, descriptor_, - LIST_INDEXED_GETTER); - printer->Print(variables_, - "@java.lang.Override\n" - "$deprecation$public int " - "${$get$capitalized_name$Value$}$(int index) {\n" - " return instance.get$capitalized_name$Value(index);\n" - "}\n"); - printer->Annotate("{", "}", descriptor_); - WriteFieldEnumValueAccessorDocComment(printer, descriptor_, - LIST_INDEXED_SETTER, - /* builder */ true); - printer->Print( - variables_, - "$deprecation$public Builder ${$set$capitalized_name$Value$}$(\n" - " int index, int value) {\n" - " copyOnWrite();\n" - " instance.set$capitalized_name$Value(index, value);\n" - " return this;\n" - "}\n"); - printer->Annotate("{", "}", descriptor_); - WriteFieldEnumValueAccessorDocComment(printer, descriptor_, LIST_ADDER, - /* builder */ true); - printer->Print(variables_, - "$deprecation$public Builder " - "${$add$capitalized_name$Value$}$(int value) {\n" - " instance.add$capitalized_name$Value(value);\n" - " return this;\n" - "}\n"); - printer->Annotate("{", "}", descriptor_); - WriteFieldEnumValueAccessorDocComment(printer, descriptor_, - LIST_MULTI_ADDER, - /* builder */ true); - printer->Print( - variables_, - "$deprecation$public Builder ${$addAll$capitalized_name$Value$}$(\n" - " java.lang.Iterable values) {\n" - " copyOnWrite();\n" - " instance.addAll$capitalized_name$Value(values);\n" - " return this;\n" - "}\n"); - printer->Annotate("{", "}", descriptor_); - } -} - -void RepeatedImmutableEnumFieldLiteGenerator::GenerateInitializationCode( - io::Printer* printer) const { - printer->Print(variables_, "$name$_ = emptyIntList();\n"); -} - -void RepeatedImmutableEnumFieldLiteGenerator::GenerateKotlinDslMembers( - io::Printer* printer) const { - printer->Print( - variables_, - "/**\n" - " * An uninstantiable, behaviorless type to represent the field in\n" - " * generics.\n" - " */\n" - "@kotlin.OptIn" - "(com.google.protobuf.kotlin.OnlyForUseByGeneratedProtoCode::class)\n" - "public class ${$$kt_capitalized_name$Proxy$}$ private constructor()" - " : com.google.protobuf.kotlin.DslProxy()\n"); - - WriteFieldDocComment(printer, descriptor_); - printer->Print(variables_, - "$kt_deprecation$ public val $kt_name$: " - "com.google.protobuf.kotlin.DslList" - "<$kt_type$, ${$$kt_capitalized_name$Proxy$}$>\n" - " @kotlin.jvm.JvmSynthetic\n" - " get() = com.google.protobuf.kotlin.DslList(\n" - " $kt_dsl_builder$.${$get$capitalized_name$List$}$()\n" - " )\n"); - - WriteFieldAccessorDocComment(printer, descriptor_, LIST_ADDER, - /* builder */ false); - printer->Print(variables_, - "@kotlin.jvm.JvmSynthetic\n" - "@kotlin.jvm.JvmName(\"add$kt_capitalized_name$\")\n" - "public fun com.google.protobuf.kotlin.DslList" - "<$kt_type$, ${$$kt_capitalized_name$Proxy$}$>." - "add(value: $kt_type$) {\n" - " $kt_dsl_builder$.${$add$capitalized_name$$}$(value)\n" - "}"); - - WriteFieldAccessorDocComment(printer, descriptor_, LIST_ADDER, - /* builder */ false); - printer->Print(variables_, - "@kotlin.jvm.JvmSynthetic\n" - "@kotlin.jvm.JvmName(\"plusAssign$kt_capitalized_name$\")\n" - "@Suppress(\"NOTHING_TO_INLINE\")\n" - "public inline operator fun com.google.protobuf.kotlin.DslList" - "<$kt_type$, ${$$kt_capitalized_name$Proxy$}$>." - "plusAssign(value: $kt_type$) {\n" - " add(value)\n" - "}"); - - WriteFieldAccessorDocComment(printer, descriptor_, LIST_MULTI_ADDER, - /* builder */ false); - printer->Print(variables_, - "@kotlin.jvm.JvmSynthetic\n" - "@kotlin.jvm.JvmName(\"addAll$kt_capitalized_name$\")\n" - "public fun com.google.protobuf.kotlin.DslList" - "<$kt_type$, ${$$kt_capitalized_name$Proxy$}$>." - "addAll(values: kotlin.collections.Iterable<$kt_type$>) {\n" - " $kt_dsl_builder$.${$addAll$capitalized_name$$}$(values)\n" - "}"); - - WriteFieldAccessorDocComment(printer, descriptor_, LIST_MULTI_ADDER, - /* builder */ false); - printer->Print( - variables_, - "@kotlin.jvm.JvmSynthetic\n" - "@kotlin.jvm.JvmName(\"plusAssignAll$kt_capitalized_name$\")\n" - "@Suppress(\"NOTHING_TO_INLINE\")\n" - "public inline operator fun com.google.protobuf.kotlin.DslList" - "<$kt_type$, ${$$kt_capitalized_name$Proxy$}$>." - "plusAssign(values: kotlin.collections.Iterable<$kt_type$>) {\n" - " addAll(values)\n" - "}"); - - WriteFieldAccessorDocComment(printer, descriptor_, LIST_INDEXED_SETTER, - /* builder */ false); - printer->Print( - variables_, - "@kotlin.jvm.JvmSynthetic\n" - "@kotlin.jvm.JvmName(\"set$kt_capitalized_name$\")\n" - "public operator fun com.google.protobuf.kotlin.DslList" - "<$kt_type$, ${$$kt_capitalized_name$Proxy$}$>." - "set(index: kotlin.Int, value: $kt_type$) {\n" - " $kt_dsl_builder$.${$set$capitalized_name$$}$(index, value)\n" - "}"); - - WriteFieldAccessorDocComment(printer, descriptor_, CLEARER, - /* builder */ false); - printer->Print(variables_, - "@kotlin.jvm.JvmSynthetic\n" - "@kotlin.jvm.JvmName(\"clear$kt_capitalized_name$\")\n" - "public fun com.google.protobuf.kotlin.DslList" - "<$kt_type$, ${$$kt_capitalized_name$Proxy$}$>." - "clear() {\n" - " $kt_dsl_builder$.${$clear$capitalized_name$$}$()\n" - "}"); -} - -std::string RepeatedImmutableEnumFieldLiteGenerator::GetBoxedType() const { - return name_resolver_->GetImmutableClassName(descriptor_->enum_type()); -} - -} // namespace java -} // namespace compiler -} // namespace protobuf -} // namespace google diff --git a/extra/protobuf/protobuf-3.19.4/src/google/protobuf/compiler/java/java_enum_field_lite.h b/extra/protobuf/protobuf-3.19.4/src/google/protobuf/compiler/java/java_enum_field_lite.h deleted file mode 100644 index 6ed11c9ef5e3..000000000000 --- a/extra/protobuf/protobuf-3.19.4/src/google/protobuf/compiler/java/java_enum_field_lite.h +++ /dev/null @@ -1,140 +0,0 @@ -// Protocol Buffers - Google's data interchange format -// Copyright 2008 Google Inc. All rights reserved. -// https://developers.google.com/protocol-buffers/ -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// * Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// * Redistributions in binary form must reproduce the above -// copyright notice, this list of conditions and the following disclaimer -// in the documentation and/or other materials provided with the -// distribution. -// * Neither the name of Google Inc. nor the names of its -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -// Author: kenton@google.com (Kenton Varda) -// Based on original Protocol Buffers design by -// Sanjay Ghemawat, Jeff Dean, and others. - -#ifndef GOOGLE_PROTOBUF_COMPILER_JAVA_ENUM_FIELD_LITE_H__ -#define GOOGLE_PROTOBUF_COMPILER_JAVA_ENUM_FIELD_LITE_H__ - -#include -#include -#include - -#include - -namespace google { -namespace protobuf { -namespace compiler { -namespace java { -class Context; // context.h -class ClassNameResolver; // name_resolver.h -} // namespace java -} // namespace compiler -} // namespace protobuf -} // namespace google - -namespace google { -namespace protobuf { -namespace compiler { -namespace java { - -class ImmutableEnumFieldLiteGenerator : public ImmutableFieldLiteGenerator { - public: - explicit ImmutableEnumFieldLiteGenerator(const FieldDescriptor* descriptor, - int messageBitIndex, - Context* context); - ~ImmutableEnumFieldLiteGenerator() override; - - // implements ImmutableFieldLiteGenerator - // ------------------------------------ - int GetNumBitsForMessage() const override; - void GenerateInterfaceMembers(io::Printer* printer) const override; - void GenerateMembers(io::Printer* printer) const override; - void GenerateBuilderMembers(io::Printer* printer) const override; - void GenerateInitializationCode(io::Printer* printer) const override; - void GenerateFieldInfo(io::Printer* printer, - std::vector* output) const override; - void GenerateKotlinDslMembers(io::Printer* printer) const override; - - std::string GetBoxedType() const override; - - protected: - const FieldDescriptor* descriptor_; - std::map variables_; - const int messageBitIndex_; - Context* context_; - ClassNameResolver* name_resolver_; - - private: - GOOGLE_DISALLOW_EVIL_CONSTRUCTORS(ImmutableEnumFieldLiteGenerator); -}; - -class ImmutableEnumOneofFieldLiteGenerator - : public ImmutableEnumFieldLiteGenerator { - public: - ImmutableEnumOneofFieldLiteGenerator(const FieldDescriptor* descriptor, - int messageBitIndex, Context* context); - ~ImmutableEnumOneofFieldLiteGenerator() override; - - void GenerateMembers(io::Printer* printer) const override; - void GenerateBuilderMembers(io::Printer* printer) const override; - void GenerateFieldInfo(io::Printer* printer, - std::vector* output) const override; - - private: - GOOGLE_DISALLOW_EVIL_CONSTRUCTORS(ImmutableEnumOneofFieldLiteGenerator); -}; - -class RepeatedImmutableEnumFieldLiteGenerator - : public ImmutableFieldLiteGenerator { - public: - explicit RepeatedImmutableEnumFieldLiteGenerator( - const FieldDescriptor* descriptor, int messageBitIndex, Context* context); - ~RepeatedImmutableEnumFieldLiteGenerator() override; - - // implements ImmutableFieldLiteGenerator ------------------------------------ - int GetNumBitsForMessage() const override; - void GenerateInterfaceMembers(io::Printer* printer) const override; - void GenerateMembers(io::Printer* printer) const override; - void GenerateBuilderMembers(io::Printer* printer) const override; - void GenerateInitializationCode(io::Printer* printer) const override; - void GenerateFieldInfo(io::Printer* printer, - std::vector* output) const override; - void GenerateKotlinDslMembers(io::Printer* printer) const override; - - std::string GetBoxedType() const override; - - private: - const FieldDescriptor* descriptor_; - std::map variables_; - Context* context_; - ClassNameResolver* name_resolver_; - - GOOGLE_DISALLOW_EVIL_CONSTRUCTORS(RepeatedImmutableEnumFieldLiteGenerator); -}; - -} // namespace java -} // namespace compiler -} // namespace protobuf -} // namespace google - -#endif // GOOGLE_PROTOBUF_COMPILER_JAVA_ENUM_FIELD_LITE_H__ diff --git a/extra/protobuf/protobuf-3.19.4/src/google/protobuf/compiler/java/java_enum_lite.cc b/extra/protobuf/protobuf-3.19.4/src/google/protobuf/compiler/java/java_enum_lite.cc deleted file mode 100644 index aa64c97127a5..000000000000 --- a/extra/protobuf/protobuf-3.19.4/src/google/protobuf/compiler/java/java_enum_lite.cc +++ /dev/null @@ -1,235 +0,0 @@ -// Protocol Buffers - Google's data interchange format -// Copyright 2008 Google Inc. All rights reserved. -// https://developers.google.com/protocol-buffers/ -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// * Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// * Redistributions in binary form must reproduce the above -// copyright notice, this list of conditions and the following disclaimer -// in the documentation and/or other materials provided with the -// distribution. -// * Neither the name of Google Inc. nor the names of its -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -// Author: kenton@google.com (Kenton Varda) -// Based on original Protocol Buffers design by -// Sanjay Ghemawat, Jeff Dean, and others. - -#include -#include - -#include -#include -#include -#include -#include -#include -#include -#include -#include - -namespace google { -namespace protobuf { -namespace compiler { -namespace java { - -EnumLiteGenerator::EnumLiteGenerator(const EnumDescriptor* descriptor, - bool immutable_api, Context* context) - : descriptor_(descriptor), - immutable_api_(immutable_api), - context_(context), - name_resolver_(context->GetNameResolver()) { - for (int i = 0; i < descriptor_->value_count(); i++) { - const EnumValueDescriptor* value = descriptor_->value(i); - const EnumValueDescriptor* canonical_value = - descriptor_->FindValueByNumber(value->number()); - - if (value == canonical_value) { - canonical_values_.push_back(value); - } else { - Alias alias; - alias.value = value; - alias.canonical_value = canonical_value; - aliases_.push_back(alias); - } - } -} - -EnumLiteGenerator::~EnumLiteGenerator() {} - -void EnumLiteGenerator::Generate(io::Printer* printer) { - WriteEnumDocComment(printer, descriptor_); - MaybePrintGeneratedAnnotation(context_, printer, descriptor_, immutable_api_); - printer->Print( - "$deprecation$public enum $classname$\n" - " implements com.google.protobuf.Internal.EnumLite {\n", - "classname", descriptor_->name(), "deprecation", - descriptor_->options().deprecated() ? "@java.lang.Deprecated " : ""); - printer->Annotate("classname", descriptor_); - printer->Indent(); - - for (int i = 0; i < canonical_values_.size(); i++) { - std::map vars; - vars["name"] = canonical_values_[i]->name(); - vars["number"] = StrCat(canonical_values_[i]->number()); - WriteEnumValueDocComment(printer, canonical_values_[i]); - if (canonical_values_[i]->options().deprecated()) { - printer->Print("@java.lang.Deprecated\n"); - } - printer->Print(vars, "$name$($number$),\n"); - printer->Annotate("name", canonical_values_[i]); - } - - if (SupportUnknownEnumValue(descriptor_->file())) { - printer->Print("${$UNRECOGNIZED$}$(-1),\n", "{", "", "}", ""); - printer->Annotate("{", "}", descriptor_); - } - - printer->Print( - ";\n" - "\n"); - - // ----------------------------------------------------------------- - - for (int i = 0; i < aliases_.size(); i++) { - std::map vars; - vars["classname"] = descriptor_->name(); - vars["name"] = aliases_[i].value->name(); - vars["canonical_name"] = aliases_[i].canonical_value->name(); - WriteEnumValueDocComment(printer, aliases_[i].value); - printer->Print( - vars, "public static final $classname$ $name$ = $canonical_name$;\n"); - printer->Annotate("name", aliases_[i].value); - } - - for (int i = 0; i < descriptor_->value_count(); i++) { - std::map vars; - vars["name"] = descriptor_->value(i)->name(); - vars["number"] = StrCat(descriptor_->value(i)->number()); - vars["{"] = ""; - vars["}"] = ""; - vars["deprecation"] = descriptor_->value(i)->options().deprecated() - ? "@java.lang.Deprecated " - : ""; - WriteEnumValueDocComment(printer, descriptor_->value(i)); - printer->Print(vars, - "$deprecation$public static final int ${$$name$_VALUE$}$ = " - "$number$;\n"); - printer->Annotate("{", "}", descriptor_->value(i)); - } - printer->Print("\n"); - - // ----------------------------------------------------------------- - - printer->Print( - "\n" - "@java.lang.Override\n" - "public final int getNumber() {\n"); - if (SupportUnknownEnumValue(descriptor_->file())) { - printer->Print( - " if (this == UNRECOGNIZED) {\n" - " throw new java.lang.IllegalArgumentException(\n" - " \"Can't get the number of an unknown enum value.\");\n" - " }\n"); - } - printer->Print( - " return value;\n" - "}\n" - "\n" - "/**\n" - " * @param value The number of the enum to look for.\n" - " * @return The enum associated with the given number.\n" - " * @deprecated Use {@link #forNumber(int)} instead.\n" - " */\n" - "@java.lang.Deprecated\n" - "public static $classname$ valueOf(int value) {\n" - " return forNumber(value);\n" - "}\n" - "\n" - "public static $classname$ forNumber(int value) {\n" - " switch (value) {\n", - "classname", descriptor_->name()); - printer->Indent(); - printer->Indent(); - - for (int i = 0; i < canonical_values_.size(); i++) { - printer->Print("case $number$: return $name$;\n", "name", - canonical_values_[i]->name(), "number", - StrCat(canonical_values_[i]->number())); - } - - printer->Outdent(); - printer->Outdent(); - printer->Print( - " default: return null;\n" - " }\n" - "}\n" - "\n" - "public static com.google.protobuf.Internal.EnumLiteMap<$classname$>\n" - " internalGetValueMap() {\n" - " return internalValueMap;\n" - "}\n" - "private static final com.google.protobuf.Internal.EnumLiteMap<\n" - " $classname$> internalValueMap =\n" - " new com.google.protobuf.Internal.EnumLiteMap<$classname$>() {\n" - " @java.lang.Override\n" - " public $classname$ findValueByNumber(int number) {\n" - " return $classname$.forNumber(number);\n" - " }\n" - " };\n" - "\n" - "public static com.google.protobuf.Internal.EnumVerifier \n" - " internalGetVerifier() {\n" - " return $classname$Verifier.INSTANCE;\n" - "}\n" - "\n" - "private static final class $classname$Verifier implements \n" - " com.google.protobuf.Internal.EnumVerifier { \n" - " static final com.google.protobuf.Internal.EnumVerifier " - " INSTANCE = new $classname$Verifier();\n" - " @java.lang.Override\n" - " public boolean isInRange(int number) {\n" - " return $classname$.forNumber(number) != null;\n" - " }\n" - " };\n" - "\n", - "classname", descriptor_->name()); - - printer->Print( - "private final int value;\n\n" - "private $classname$(int value) {\n", - "classname", descriptor_->name()); - printer->Print( - " this.value = value;\n" - "}\n"); - - printer->Print( - "\n" - "// @@protoc_insertion_point(enum_scope:$full_name$)\n", - "full_name", descriptor_->full_name()); - - printer->Outdent(); - printer->Print("}\n\n"); -} - -} // namespace java -} // namespace compiler -} // namespace protobuf -} // namespace google diff --git a/extra/protobuf/protobuf-3.19.4/src/google/protobuf/compiler/java/java_enum_lite.h b/extra/protobuf/protobuf-3.19.4/src/google/protobuf/compiler/java/java_enum_lite.h deleted file mode 100644 index 50f3fe7b1aac..000000000000 --- a/extra/protobuf/protobuf-3.19.4/src/google/protobuf/compiler/java/java_enum_lite.h +++ /dev/null @@ -1,98 +0,0 @@ -// Protocol Buffers - Google's data interchange format -// Copyright 2008 Google Inc. All rights reserved. -// https://developers.google.com/protocol-buffers/ -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// * Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// * Redistributions in binary form must reproduce the above -// copyright notice, this list of conditions and the following disclaimer -// in the documentation and/or other materials provided with the -// distribution. -// * Neither the name of Google Inc. nor the names of its -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -// Author: kenton@google.com (Kenton Varda) -// Based on original Protocol Buffers design by -// Sanjay Ghemawat, Jeff Dean, and others. - -#ifndef GOOGLE_PROTOBUF_COMPILER_JAVA_ENUM_LITE_H__ -#define GOOGLE_PROTOBUF_COMPILER_JAVA_ENUM_LITE_H__ - -#include -#include -#include - -namespace google { -namespace protobuf { -namespace compiler { -namespace java { -class Context; // context.h -class ClassNameResolver; // name_resolver.h -} // namespace java -} // namespace compiler -namespace io { -class Printer; // printer.h -} -} // namespace protobuf -} // namespace google - -namespace google { -namespace protobuf { -namespace compiler { -namespace java { - -class EnumLiteGenerator { - public: - EnumLiteGenerator(const EnumDescriptor* descriptor, bool immutable_api, - Context* context); - ~EnumLiteGenerator(); - - void Generate(io::Printer* printer); - - private: - const EnumDescriptor* descriptor_; - - // The proto language allows multiple enum constants to have the same - // numeric value. Java, however, does not allow multiple enum constants to - // be considered equivalent. We treat the first defined constant for any - // given numeric value as "canonical" and the rest as aliases of that - // canonical value. - std::vector canonical_values_; - - struct Alias { - const EnumValueDescriptor* value; - const EnumValueDescriptor* canonical_value; - }; - std::vector aliases_; - - bool immutable_api_; - - Context* context_; - ClassNameResolver* name_resolver_; - - GOOGLE_DISALLOW_EVIL_CONSTRUCTORS(EnumLiteGenerator); -}; - -} // namespace java -} // namespace compiler -} // namespace protobuf -} // namespace google - -#endif // GOOGLE_PROTOBUF_COMPILER_JAVA_ENUM_LITE_H__ diff --git a/extra/protobuf/protobuf-3.19.4/src/google/protobuf/compiler/java/java_extension.cc b/extra/protobuf/protobuf-3.19.4/src/google/protobuf/compiler/java/java_extension.cc deleted file mode 100644 index db210fb3e503..000000000000 --- a/extra/protobuf/protobuf-3.19.4/src/google/protobuf/compiler/java/java_extension.cc +++ /dev/null @@ -1,172 +0,0 @@ -// Protocol Buffers - Google's data interchange format -// Copyright 2008 Google Inc. All rights reserved. -// https://developers.google.com/protocol-buffers/ -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// * Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// * Redistributions in binary form must reproduce the above -// copyright notice, this list of conditions and the following disclaimer -// in the documentation and/or other materials provided with the -// distribution. -// * Neither the name of Google Inc. nor the names of its -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -// Author: kenton@google.com (Kenton Varda) -// Based on original Protocol Buffers design by -// Sanjay Ghemawat, Jeff Dean, and others. - -#include - -#include -#include -#include -#include -#include -#include - -namespace google { -namespace protobuf { -namespace compiler { -namespace java { - -ImmutableExtensionGenerator::ImmutableExtensionGenerator( - const FieldDescriptor* descriptor, Context* context) - : descriptor_(descriptor), name_resolver_(context->GetNameResolver()) { - if (descriptor_->extension_scope() != NULL) { - scope_ = - name_resolver_->GetImmutableClassName(descriptor_->extension_scope()); - } else { - scope_ = name_resolver_->GetImmutableClassName(descriptor_->file()); - } -} - -ImmutableExtensionGenerator::~ImmutableExtensionGenerator() {} - -// Initializes the vars referenced in the generated code templates. -void ExtensionGenerator::InitTemplateVars( - const FieldDescriptor* descriptor, const std::string& scope, bool immutable, - ClassNameResolver* name_resolver, - std::map* vars_pointer) { - std::map& vars = *vars_pointer; - vars["scope"] = scope; - vars["name"] = UnderscoresToCamelCaseCheckReserved(descriptor); - vars["containing_type"] = - name_resolver->GetClassName(descriptor->containing_type(), immutable); - vars["number"] = StrCat(descriptor->number()); - vars["constant_name"] = FieldConstantName(descriptor); - vars["index"] = StrCat(descriptor->index()); - vars["default"] = descriptor->is_repeated() - ? "" - : DefaultValue(descriptor, immutable, name_resolver); - vars["type_constant"] = FieldTypeName(GetType(descriptor)); - vars["packed"] = descriptor->is_packed() ? "true" : "false"; - vars["enum_map"] = "null"; - vars["prototype"] = "null"; - - JavaType java_type = GetJavaType(descriptor); - std::string singular_type; - switch (java_type) { - case JAVATYPE_MESSAGE: - singular_type = - name_resolver->GetClassName(descriptor->message_type(), immutable); - vars["prototype"] = singular_type + ".getDefaultInstance()"; - break; - case JAVATYPE_ENUM: - singular_type = - name_resolver->GetClassName(descriptor->enum_type(), immutable); - vars["enum_map"] = singular_type + ".internalGetValueMap()"; - break; - case JAVATYPE_STRING: - singular_type = "java.lang.String"; - break; - case JAVATYPE_BYTES: - singular_type = immutable ? "com.google.protobuf.ByteString" : "byte[]"; - break; - default: - singular_type = BoxedPrimitiveTypeName(java_type); - break; - } - vars["type"] = descriptor->is_repeated() - ? "java.util.List<" + singular_type + ">" - : singular_type; - vars["singular_type"] = singular_type; -} - -void ImmutableExtensionGenerator::Generate(io::Printer* printer) { - std::map vars; - const bool kUseImmutableNames = true; - InitTemplateVars(descriptor_, scope_, kUseImmutableNames, name_resolver_, - &vars); - printer->Print(vars, "public static final int $constant_name$ = $number$;\n"); - - WriteFieldDocComment(printer, descriptor_); - if (descriptor_->extension_scope() == NULL) { - // Non-nested - printer->Print( - vars, - "public static final\n" - " com.google.protobuf.GeneratedMessage.GeneratedExtension<\n" - " $containing_type$,\n" - " $type$> $name$ = com.google.protobuf.GeneratedMessage\n" - " .newFileScopedGeneratedExtension(\n" - " $singular_type$.class,\n" - " $prototype$);\n"); - } else { - // Nested - printer->Print( - vars, - "public static final\n" - " com.google.protobuf.GeneratedMessage.GeneratedExtension<\n" - " $containing_type$,\n" - " $type$> $name$ = com.google.protobuf.GeneratedMessage\n" - " .newMessageScopedGeneratedExtension(\n" - " $scope$.getDefaultInstance(),\n" - " $index$,\n" - " $singular_type$.class,\n" - " $prototype$);\n"); - } - printer->Annotate("name", descriptor_); -} - -int ImmutableExtensionGenerator::GenerateNonNestedInitializationCode( - io::Printer* printer) { - int bytecode_estimate = 0; - if (descriptor_->extension_scope() == NULL) { - // Only applies to non-nested extensions. - printer->Print( - "$name$.internalInit(descriptor.getExtensions().get($index$));\n", - "name", UnderscoresToCamelCaseCheckReserved(descriptor_), "index", - StrCat(descriptor_->index())); - bytecode_estimate += 21; - } - return bytecode_estimate; -} - -int ImmutableExtensionGenerator::GenerateRegistrationCode( - io::Printer* printer) { - printer->Print("registry.add($scope$.$name$);\n", "scope", scope_, "name", - UnderscoresToCamelCaseCheckReserved(descriptor_)); - return 7; -} - -} // namespace java -} // namespace compiler -} // namespace protobuf -} // namespace google diff --git a/extra/protobuf/protobuf-3.19.4/src/google/protobuf/compiler/java/java_extension.h b/extra/protobuf/protobuf-3.19.4/src/google/protobuf/compiler/java/java_extension.h deleted file mode 100644 index f928a783725d..000000000000 --- a/extra/protobuf/protobuf-3.19.4/src/google/protobuf/compiler/java/java_extension.h +++ /dev/null @@ -1,115 +0,0 @@ -// Protocol Buffers - Google's data interchange format -// Copyright 2008 Google Inc. All rights reserved. -// https://developers.google.com/protocol-buffers/ -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// * Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// * Redistributions in binary form must reproduce the above -// copyright notice, this list of conditions and the following disclaimer -// in the documentation and/or other materials provided with the -// distribution. -// * Neither the name of Google Inc. nor the names of its -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -// Author: kenton@google.com (Kenton Varda) -// Based on original Protocol Buffers design by -// Sanjay Ghemawat, Jeff Dean, and others. - -#ifndef GOOGLE_PROTOBUF_COMPILER_JAVA_EXTENSION_H__ -#define GOOGLE_PROTOBUF_COMPILER_JAVA_EXTENSION_H__ - -#include -#include - -#include - -namespace google { -namespace protobuf { -class FieldDescriptor; // descriptor.h -namespace compiler { -namespace java { -class Context; // context.h -class ClassNameResolver; // name_resolver.h -} // namespace java -} // namespace compiler -namespace io { -class Printer; // printer.h -} -} // namespace protobuf -} // namespace google - -namespace google { -namespace protobuf { -namespace compiler { -namespace java { - -// Generates code for an extension, which may be within the scope of some -// message or may be at file scope. This is much simpler than FieldGenerator -// since extensions are just simple identifiers with interesting types. -class ExtensionGenerator { - public: - explicit ExtensionGenerator() {} - virtual ~ExtensionGenerator() {} - - virtual void Generate(io::Printer* printer) = 0; - - // Returns an estimate of the number of bytes the printed code will compile - // to - virtual int GenerateNonNestedInitializationCode(io::Printer* printer) = 0; - - // Returns an estimate of the number of bytes the printed code will compile - // to - virtual int GenerateRegistrationCode(io::Printer* printer) = 0; - - protected: - static void InitTemplateVars( - const FieldDescriptor* descriptor, const std::string& scope, - bool immutable, ClassNameResolver* name_resolver, - std::map* vars_pointer); - - private: - GOOGLE_DISALLOW_EVIL_CONSTRUCTORS(ExtensionGenerator); -}; - -class ImmutableExtensionGenerator : public ExtensionGenerator { - public: - explicit ImmutableExtensionGenerator(const FieldDescriptor* descriptor, - Context* context); - virtual ~ImmutableExtensionGenerator(); - - void Generate(io::Printer* printer) override; - int GenerateNonNestedInitializationCode(io::Printer* printer) override; - int GenerateRegistrationCode(io::Printer* printer) override; - - protected: - const FieldDescriptor* descriptor_; - ClassNameResolver* name_resolver_; - std::string scope_; - - private: - GOOGLE_DISALLOW_EVIL_CONSTRUCTORS(ImmutableExtensionGenerator); -}; - -} // namespace java -} // namespace compiler -} // namespace protobuf -} // namespace google - -#endif // GOOGLE_PROTOBUF_COMPILER_JAVA_EXTENSION_H__ diff --git a/extra/protobuf/protobuf-3.19.4/src/google/protobuf/compiler/java/java_extension_lite.cc b/extra/protobuf/protobuf-3.19.4/src/google/protobuf/compiler/java/java_extension_lite.cc deleted file mode 100644 index 71bf4e23f3cb..000000000000 --- a/extra/protobuf/protobuf-3.19.4/src/google/protobuf/compiler/java/java_extension_lite.cc +++ /dev/null @@ -1,115 +0,0 @@ -// Protocol Buffers - Google's data interchange format -// Copyright 2008 Google Inc. All rights reserved. -// https://developers.google.com/protocol-buffers/ -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// * Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// * Redistributions in binary form must reproduce the above -// copyright notice, this list of conditions and the following disclaimer -// in the documentation and/or other materials provided with the -// distribution. -// * Neither the name of Google Inc. nor the names of its -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -#include - -#include -#include -#include -#include -#include -#include - -namespace google { -namespace protobuf { -namespace compiler { -namespace java { - -ImmutableExtensionLiteGenerator::ImmutableExtensionLiteGenerator( - const FieldDescriptor* descriptor, Context* context) - : descriptor_(descriptor), name_resolver_(context->GetNameResolver()) { - if (descriptor_->extension_scope() != NULL) { - scope_ = - name_resolver_->GetImmutableClassName(descriptor_->extension_scope()); - } else { - scope_ = name_resolver_->GetImmutableClassName(descriptor_->file()); - } -} - -ImmutableExtensionLiteGenerator::~ImmutableExtensionLiteGenerator() {} - -void ImmutableExtensionLiteGenerator::Generate(io::Printer* printer) { - std::map vars; - const bool kUseImmutableNames = true; - InitTemplateVars(descriptor_, scope_, kUseImmutableNames, name_resolver_, - &vars); - printer->Print(vars, "public static final int $constant_name$ = $number$;\n"); - - WriteFieldDocComment(printer, descriptor_); - if (descriptor_->is_repeated()) { - printer->Print( - vars, - "public static final\n" - " com.google.protobuf.GeneratedMessageLite.GeneratedExtension<\n" - " $containing_type$,\n" - " $type$> $name$ = com.google.protobuf.GeneratedMessageLite\n" - " .newRepeatedGeneratedExtension(\n" - " $containing_type$.getDefaultInstance(),\n" - " $prototype$,\n" - " $enum_map$,\n" - " $number$,\n" - " com.google.protobuf.WireFormat.FieldType.$type_constant$,\n" - " $packed$,\n" - " $singular_type$.class);\n"); - } else { - printer->Print( - vars, - "public static final\n" - " com.google.protobuf.GeneratedMessageLite.GeneratedExtension<\n" - " $containing_type$,\n" - " $type$> $name$ = com.google.protobuf.GeneratedMessageLite\n" - " .newSingularGeneratedExtension(\n" - " $containing_type$.getDefaultInstance(),\n" - " $default$,\n" - " $prototype$,\n" - " $enum_map$,\n" - " $number$,\n" - " com.google.protobuf.WireFormat.FieldType.$type_constant$,\n" - " $singular_type$.class);\n"); - } - printer->Annotate("name", descriptor_); -} - -int ImmutableExtensionLiteGenerator::GenerateNonNestedInitializationCode( - io::Printer* printer) { - return 0; -} - -int ImmutableExtensionLiteGenerator::GenerateRegistrationCode( - io::Printer* printer) { - printer->Print("registry.add($scope$.$name$);\n", "scope", scope_, "name", - UnderscoresToCamelCaseCheckReserved(descriptor_)); - return 7; -} - -} // namespace java -} // namespace compiler -} // namespace protobuf -} // namespace google diff --git a/extra/protobuf/protobuf-3.19.4/src/google/protobuf/compiler/java/java_extension_lite.h b/extra/protobuf/protobuf-3.19.4/src/google/protobuf/compiler/java/java_extension_lite.h deleted file mode 100644 index 76961563a920..000000000000 --- a/extra/protobuf/protobuf-3.19.4/src/google/protobuf/compiler/java/java_extension_lite.h +++ /dev/null @@ -1,75 +0,0 @@ -// Protocol Buffers - Google's data interchange format -// Copyright 2008 Google Inc. All rights reserved. -// https://developers.google.com/protocol-buffers/ -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// * Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// * Redistributions in binary form must reproduce the above -// copyright notice, this list of conditions and the following disclaimer -// in the documentation and/or other materials provided with the -// distribution. -// * Neither the name of Google Inc. nor the names of its -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -#ifndef GOOGLE_PROTOBUF_COMPILER_JAVA_EXTENSION_LITE_H__ -#define GOOGLE_PROTOBUF_COMPILER_JAVA_EXTENSION_LITE_H__ - -#include -#include - -#include -#include - -namespace google { -namespace protobuf { -namespace compiler { -namespace java { - -// Generates code for a lite extension, which may be within the scope of some -// message or may be at file scope. This is much simpler than FieldGenerator -// since extensions are just simple identifiers with interesting types. -class ImmutableExtensionLiteGenerator : public ExtensionGenerator { - public: - explicit ImmutableExtensionLiteGenerator(const FieldDescriptor* descriptor, - Context* context); - virtual ~ImmutableExtensionLiteGenerator(); - - void Generate(io::Printer* printer) override; - - // Returns an estimate of the number of bytes the printed code will compile to - int GenerateNonNestedInitializationCode(io::Printer* printer) override; - - // Returns an estimate of the number of bytes the printed code will compile to - int GenerateRegistrationCode(io::Printer* printer) override; - - private: - const FieldDescriptor* descriptor_; - ClassNameResolver* name_resolver_; - std::string scope_; - - GOOGLE_DISALLOW_EVIL_CONSTRUCTORS(ImmutableExtensionLiteGenerator); -}; - -} // namespace java -} // namespace compiler -} // namespace protobuf -} // namespace google - -#endif // GOOGLE_PROTOBUF_COMPILER_JAVA_EXTENSION_LITE_H__ diff --git a/extra/protobuf/protobuf-3.19.4/src/google/protobuf/compiler/java/java_field.cc b/extra/protobuf/protobuf-3.19.4/src/google/protobuf/compiler/java/java_field.cc deleted file mode 100644 index 8916d1385ae3..000000000000 --- a/extra/protobuf/protobuf-3.19.4/src/google/protobuf/compiler/java/java_field.cc +++ /dev/null @@ -1,312 +0,0 @@ -// Protocol Buffers - Google's data interchange format -// Copyright 2008 Google Inc. All rights reserved. -// https://developers.google.com/protocol-buffers/ -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// * Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// * Redistributions in binary form must reproduce the above -// copyright notice, this list of conditions and the following disclaimer -// in the documentation and/or other materials provided with the -// distribution. -// * Neither the name of Google Inc. nor the names of its -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -// Author: kenton@google.com (Kenton Varda) -// Based on original Protocol Buffers design by -// Sanjay Ghemawat, Jeff Dean, and others. - -#include - -#include - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - - -namespace google { -namespace protobuf { -namespace compiler { -namespace java { - -namespace { - -ImmutableFieldGenerator* MakeImmutableGenerator(const FieldDescriptor* field, - int messageBitIndex, - int builderBitIndex, - Context* context) { - if (field->is_repeated()) { - switch (GetJavaType(field)) { - case JAVATYPE_MESSAGE: - if (IsMapEntry(field->message_type())) { - return new ImmutableMapFieldGenerator(field, messageBitIndex, - builderBitIndex, context); - } else { - return new RepeatedImmutableMessageFieldGenerator( - field, messageBitIndex, builderBitIndex, context); - } - case JAVATYPE_ENUM: - return new RepeatedImmutableEnumFieldGenerator( - field, messageBitIndex, builderBitIndex, context); - case JAVATYPE_STRING: - return new RepeatedImmutableStringFieldGenerator( - field, messageBitIndex, builderBitIndex, context); - default: - return new RepeatedImmutablePrimitiveFieldGenerator( - field, messageBitIndex, builderBitIndex, context); - } - } else { - if (IsRealOneof(field)) { - switch (GetJavaType(field)) { - case JAVATYPE_MESSAGE: - return new ImmutableMessageOneofFieldGenerator( - field, messageBitIndex, builderBitIndex, context); - case JAVATYPE_ENUM: - return new ImmutableEnumOneofFieldGenerator(field, messageBitIndex, - builderBitIndex, context); - case JAVATYPE_STRING: - return new ImmutableStringOneofFieldGenerator( - field, messageBitIndex, builderBitIndex, context); - default: - return new ImmutablePrimitiveOneofFieldGenerator( - field, messageBitIndex, builderBitIndex, context); - } - } else { - switch (GetJavaType(field)) { - case JAVATYPE_MESSAGE: - return new ImmutableMessageFieldGenerator(field, messageBitIndex, - builderBitIndex, context); - case JAVATYPE_ENUM: - return new ImmutableEnumFieldGenerator(field, messageBitIndex, - builderBitIndex, context); - case JAVATYPE_STRING: - return new ImmutableStringFieldGenerator(field, messageBitIndex, - builderBitIndex, context); - default: - return new ImmutablePrimitiveFieldGenerator(field, messageBitIndex, - builderBitIndex, context); - } - } - } -} - -ImmutableFieldLiteGenerator* MakeImmutableLiteGenerator( - const FieldDescriptor* field, int messageBitIndex, Context* context) { - if (field->is_repeated()) { - switch (GetJavaType(field)) { - case JAVATYPE_MESSAGE: - if (IsMapEntry(field->message_type())) { - return new ImmutableMapFieldLiteGenerator(field, messageBitIndex, - context); - } else { - return new RepeatedImmutableMessageFieldLiteGenerator( - field, messageBitIndex, context); - } - case JAVATYPE_ENUM: - return new RepeatedImmutableEnumFieldLiteGenerator( - field, messageBitIndex, context); - case JAVATYPE_STRING: - return new RepeatedImmutableStringFieldLiteGenerator( - field, messageBitIndex, context); - default: - return new RepeatedImmutablePrimitiveFieldLiteGenerator( - field, messageBitIndex, context); - } - } else { - if (IsRealOneof(field)) { - switch (GetJavaType(field)) { - case JAVATYPE_MESSAGE: - return new ImmutableMessageOneofFieldLiteGenerator( - field, messageBitIndex, context); - case JAVATYPE_ENUM: - return new ImmutableEnumOneofFieldLiteGenerator( - field, messageBitIndex, context); - case JAVATYPE_STRING: - return new ImmutableStringOneofFieldLiteGenerator( - field, messageBitIndex, context); - default: - return new ImmutablePrimitiveOneofFieldLiteGenerator( - field, messageBitIndex, context); - } - } else { - switch (GetJavaType(field)) { - case JAVATYPE_MESSAGE: - return new ImmutableMessageFieldLiteGenerator(field, messageBitIndex, - context); - case JAVATYPE_ENUM: - return new ImmutableEnumFieldLiteGenerator(field, messageBitIndex, - context); - case JAVATYPE_STRING: - return new ImmutableStringFieldLiteGenerator(field, messageBitIndex, - context); - default: - return new ImmutablePrimitiveFieldLiteGenerator( - field, messageBitIndex, context); - } - } - } -} - - -static inline void ReportUnexpectedPackedFieldsCall(io::Printer* printer) { - // Reaching here indicates a bug. Cases are: - // - This FieldGenerator should support packing, - // but this method should be overridden. - // - This FieldGenerator doesn't support packing, and this method - // should never have been called. - GOOGLE_LOG(FATAL) << "GenerateParsingCodeFromPacked() " - << "called on field generator that does not support packing."; -} - -} // namespace - -ImmutableFieldGenerator::~ImmutableFieldGenerator() {} - -void ImmutableFieldGenerator::GenerateParsingCodeFromPacked( - io::Printer* printer) const { - ReportUnexpectedPackedFieldsCall(printer); -} - -ImmutableFieldLiteGenerator::~ImmutableFieldLiteGenerator() {} - -// =================================================================== - -template <> -FieldGeneratorMap::FieldGeneratorMap( - const Descriptor* descriptor, Context* context) - : descriptor_(descriptor), field_generators_(descriptor->field_count()) { - // Construct all the FieldGenerators and assign them bit indices for their - // bit fields. - int messageBitIndex = 0; - int builderBitIndex = 0; - for (int i = 0; i < descriptor->field_count(); i++) { - ImmutableFieldGenerator* generator = MakeImmutableGenerator( - descriptor->field(i), messageBitIndex, builderBitIndex, context); - field_generators_[i].reset(generator); - messageBitIndex += generator->GetNumBitsForMessage(); - builderBitIndex += generator->GetNumBitsForBuilder(); - } -} - -template <> -FieldGeneratorMap::~FieldGeneratorMap() {} - -template <> -FieldGeneratorMap::FieldGeneratorMap( - const Descriptor* descriptor, Context* context) - : descriptor_(descriptor), field_generators_(descriptor->field_count()) { - // Construct all the FieldGenerators and assign them bit indices for their - // bit fields. - int messageBitIndex = 0; - for (int i = 0; i < descriptor->field_count(); i++) { - ImmutableFieldLiteGenerator* generator = MakeImmutableLiteGenerator( - descriptor->field(i), messageBitIndex, context); - field_generators_[i].reset(generator); - messageBitIndex += generator->GetNumBitsForMessage(); - } -} - -template <> -FieldGeneratorMap::~FieldGeneratorMap() {} - - -void SetCommonFieldVariables(const FieldDescriptor* descriptor, - const FieldGeneratorInfo* info, - std::map* variables) { - (*variables)["field_name"] = descriptor->name(); - (*variables)["name"] = info->name; - (*variables)["classname"] = descriptor->containing_type()->name(); - (*variables)["capitalized_name"] = info->capitalized_name; - (*variables)["disambiguated_reason"] = info->disambiguated_reason; - (*variables)["constant_name"] = FieldConstantName(descriptor); - (*variables)["number"] = StrCat(descriptor->number()); - (*variables)["kt_dsl_builder"] = "_builder"; - // These variables are placeholders to pick out the beginning and ends of - // identifiers for annotations (when doing so with existing variables would - // be ambiguous or impossible). They should never be set to anything but the - // empty string. - (*variables)["{"] = ""; - (*variables)["}"] = ""; - (*variables)["kt_name"] = - IsForbiddenKotlin(info->name) ? info->name + "_" : info->name; - (*variables)["kt_capitalized_name"] = IsForbiddenKotlin(info->name) - ? info->capitalized_name + "_" - : info->capitalized_name; - if (!descriptor->is_repeated()) { - (*variables)["annotation_field_type"] = FieldTypeName(descriptor->type()); - } else if (GetJavaType(descriptor) == JAVATYPE_MESSAGE && - IsMapEntry(descriptor->message_type())) { - (*variables)["annotation_field_type"] = - std::string(FieldTypeName(descriptor->type())) + "MAP"; - } else { - (*variables)["annotation_field_type"] = - std::string(FieldTypeName(descriptor->type())) + "_LIST"; - if (descriptor->is_packed()) { - (*variables)["annotation_field_type"] = - (*variables)["annotation_field_type"] + "_PACKED"; - } - } -} - -void SetCommonOneofVariables(const FieldDescriptor* descriptor, - const OneofGeneratorInfo* info, - std::map* variables) { - (*variables)["oneof_name"] = info->name; - (*variables)["oneof_capitalized_name"] = info->capitalized_name; - (*variables)["oneof_index"] = - StrCat(descriptor->containing_oneof()->index()); - (*variables)["oneof_stored_type"] = GetOneofStoredType(descriptor); - (*variables)["set_oneof_case_message"] = - info->name + "Case_ = " + StrCat(descriptor->number()); - (*variables)["clear_oneof_case_message"] = info->name + "Case_ = 0"; - (*variables)["has_oneof_case_message"] = - info->name + "Case_ == " + StrCat(descriptor->number()); -} - -void PrintExtraFieldInfo(const std::map& variables, - io::Printer* printer) { - const std::map::const_iterator it = - variables.find("disambiguated_reason"); - if (it != variables.end() && !it->second.empty()) { - printer->Print( - variables, - "// An alternative name is used for field \"$field_name$\" because:\n" - "// $disambiguated_reason$\n"); - } -} - -} // namespace java -} // namespace compiler -} // namespace protobuf -} // namespace google diff --git a/extra/protobuf/protobuf-3.19.4/src/google/protobuf/compiler/java/java_field.h b/extra/protobuf/protobuf-3.19.4/src/google/protobuf/compiler/java/java_field.h deleted file mode 100644 index a7c995c4ef14..000000000000 --- a/extra/protobuf/protobuf-3.19.4/src/google/protobuf/compiler/java/java_field.h +++ /dev/null @@ -1,191 +0,0 @@ -// Protocol Buffers - Google's data interchange format -// Copyright 2008 Google Inc. All rights reserved. -// https://developers.google.com/protocol-buffers/ -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// * Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// * Redistributions in binary form must reproduce the above -// copyright notice, this list of conditions and the following disclaimer -// in the documentation and/or other materials provided with the -// distribution. -// * Neither the name of Google Inc. nor the names of its -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -// Author: kenton@google.com (Kenton Varda) -// Based on original Protocol Buffers design by -// Sanjay Ghemawat, Jeff Dean, and others. - -#ifndef GOOGLE_PROTOBUF_COMPILER_JAVA_FIELD_H__ -#define GOOGLE_PROTOBUF_COMPILER_JAVA_FIELD_H__ - -#include -#include -#include -#include - -#include -#include -#include - -namespace google { -namespace protobuf { -namespace compiler { -namespace java { -class Context; // context.h -class ClassNameResolver; // name_resolver.h -} // namespace java -} // namespace compiler -namespace io { -class Printer; // printer.h -} -} // namespace protobuf -} // namespace google - -namespace google { -namespace protobuf { -namespace compiler { -namespace java { - -class ImmutableFieldGenerator { - public: - ImmutableFieldGenerator() {} - virtual ~ImmutableFieldGenerator(); - - virtual int GetNumBitsForMessage() const = 0; - virtual int GetNumBitsForBuilder() const = 0; - virtual void GenerateInterfaceMembers(io::Printer* printer) const = 0; - virtual void GenerateMembers(io::Printer* printer) const = 0; - virtual void GenerateBuilderMembers(io::Printer* printer) const = 0; - virtual void GenerateInitializationCode(io::Printer* printer) const = 0; - virtual void GenerateBuilderClearCode(io::Printer* printer) const = 0; - virtual void GenerateMergingCode(io::Printer* printer) const = 0; - virtual void GenerateBuildingCode(io::Printer* printer) const = 0; - virtual void GenerateParsingCode(io::Printer* printer) const = 0; - virtual void GenerateParsingCodeFromPacked(io::Printer* printer) const; - virtual void GenerateParsingDoneCode(io::Printer* printer) const = 0; - virtual void GenerateSerializationCode(io::Printer* printer) const = 0; - virtual void GenerateSerializedSizeCode(io::Printer* printer) const = 0; - virtual void GenerateFieldBuilderInitializationCode( - io::Printer* printer) const = 0; - virtual void GenerateKotlinDslMembers(io::Printer* printer) const = 0; - - virtual void GenerateEqualsCode(io::Printer* printer) const = 0; - virtual void GenerateHashCode(io::Printer* printer) const = 0; - - virtual std::string GetBoxedType() const = 0; - - private: - GOOGLE_DISALLOW_EVIL_CONSTRUCTORS(ImmutableFieldGenerator); -}; - -class ImmutableFieldLiteGenerator { - public: - ImmutableFieldLiteGenerator() {} - virtual ~ImmutableFieldLiteGenerator(); - - virtual int GetNumBitsForMessage() const = 0; - virtual void GenerateInterfaceMembers(io::Printer* printer) const = 0; - virtual void GenerateMembers(io::Printer* printer) const = 0; - virtual void GenerateBuilderMembers(io::Printer* printer) const = 0; - virtual void GenerateInitializationCode(io::Printer* printer) const = 0; - virtual void GenerateFieldInfo(io::Printer* printer, - std::vector* output) const = 0; - virtual void GenerateKotlinDslMembers(io::Printer* printer) const = 0; - - virtual std::string GetBoxedType() const = 0; - - private: - GOOGLE_DISALLOW_EVIL_CONSTRUCTORS(ImmutableFieldLiteGenerator); -}; - - -// Convenience class which constructs FieldGenerators for a Descriptor. -template -class FieldGeneratorMap { - public: - explicit FieldGeneratorMap(const Descriptor* descriptor, Context* context); - ~FieldGeneratorMap(); - - const FieldGeneratorType& get(const FieldDescriptor* field) const; - - private: - const Descriptor* descriptor_; - std::vector> field_generators_; - - GOOGLE_DISALLOW_EVIL_CONSTRUCTORS(FieldGeneratorMap); -}; - -template -inline const FieldGeneratorType& FieldGeneratorMap::get( - const FieldDescriptor* field) const { - GOOGLE_CHECK_EQ(field->containing_type(), descriptor_); - return *field_generators_[field->index()]; -} - -// Instantiate template for mutable and immutable maps. -template <> -FieldGeneratorMap::FieldGeneratorMap( - const Descriptor* descriptor, Context* context); - -template <> -FieldGeneratorMap::~FieldGeneratorMap(); - - -template <> -FieldGeneratorMap::FieldGeneratorMap( - const Descriptor* descriptor, Context* context); - -template <> -FieldGeneratorMap::~FieldGeneratorMap(); - - -// Field information used in FieldGeneartors. -struct FieldGeneratorInfo { - std::string name; - std::string capitalized_name; - std::string disambiguated_reason; -}; - -// Oneof information used in OneofFieldGenerators. -struct OneofGeneratorInfo { - std::string name; - std::string capitalized_name; -}; - -// Set some common variables used in variable FieldGenerators. -void SetCommonFieldVariables(const FieldDescriptor* descriptor, - const FieldGeneratorInfo* info, - std::map* variables); - -// Set some common oneof variables used in OneofFieldGenerators. -void SetCommonOneofVariables(const FieldDescriptor* descriptor, - const OneofGeneratorInfo* info, - std::map* variables); - -// Print useful comments before a field's accessors. -void PrintExtraFieldInfo(const std::map& variables, - io::Printer* printer); - -} // namespace java -} // namespace compiler -} // namespace protobuf -} // namespace google - -#endif // GOOGLE_PROTOBUF_COMPILER_JAVA_FIELD_H__ diff --git a/extra/protobuf/protobuf-3.19.4/src/google/protobuf/compiler/java/java_file.cc b/extra/protobuf/protobuf-3.19.4/src/google/protobuf/compiler/java/java_file.cc deleted file mode 100644 index 9dbf81814bb5..000000000000 --- a/extra/protobuf/protobuf-3.19.4/src/google/protobuf/compiler/java/java_file.cc +++ /dev/null @@ -1,734 +0,0 @@ -// Protocol Buffers - Google's data interchange format -// Copyright 2008 Google Inc. All rights reserved. -// https://developers.google.com/protocol-buffers/ -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// * Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// * Redistributions in binary form must reproduce the above -// copyright notice, this list of conditions and the following disclaimer -// in the documentation and/or other materials provided with the -// distribution. -// * Neither the name of Google Inc. nor the names of its -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -// Author: kenton@google.com (Kenton Varda) -// Based on original Protocol Buffers design by -// Sanjay Ghemawat, Jeff Dean, and others. - -#include - -#include -#include - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -namespace google { -namespace protobuf { -namespace compiler { -namespace java { - -namespace { - -struct FieldDescriptorCompare { - bool operator()(const FieldDescriptor* f1, const FieldDescriptor* f2) const { - if (f1 == NULL) { - return false; - } - if (f2 == NULL) { - return true; - } - return f1->full_name() < f2->full_name(); - } -}; - -typedef std::set - FieldDescriptorSet; - -// Recursively searches the given message to collect extensions. -// Returns true if all the extensions can be recognized. The extensions will be -// appended in to the extensions parameter. -// Returns false when there are unknown fields, in which case the data in the -// extensions output parameter is not reliable and should be discarded. -bool CollectExtensions(const Message& message, FieldDescriptorSet* extensions) { - const Reflection* reflection = message.GetReflection(); - - // There are unknown fields that could be extensions, thus this call fails. - if (reflection->GetUnknownFields(message).field_count() > 0) return false; - - std::vector fields; - reflection->ListFields(message, &fields); - - for (int i = 0; i < fields.size(); i++) { - if (fields[i]->is_extension()) { - extensions->insert(fields[i]); - } - - if (GetJavaType(fields[i]) == JAVATYPE_MESSAGE) { - if (fields[i]->is_repeated()) { - int size = reflection->FieldSize(message, fields[i]); - for (int j = 0; j < size; j++) { - const Message& sub_message = - reflection->GetRepeatedMessage(message, fields[i], j); - if (!CollectExtensions(sub_message, extensions)) return false; - } - } else { - const Message& sub_message = reflection->GetMessage(message, fields[i]); - if (!CollectExtensions(sub_message, extensions)) return false; - } - } - } - - return true; -} - -// Finds all extensions in the given message and its sub-messages. If the -// message contains unknown fields (which could be extensions), then those -// extensions are defined in alternate_pool. -// The message will be converted to a DynamicMessage backed by alternate_pool -// in order to handle this case. -void CollectExtensions(const FileDescriptorProto& file_proto, - const DescriptorPool& alternate_pool, - FieldDescriptorSet* extensions, - const std::string& file_data) { - if (!CollectExtensions(file_proto, extensions)) { - // There are unknown fields in the file_proto, which are probably - // extensions. We need to parse the data into a dynamic message based on the - // builder-pool to find out all extensions. - const Descriptor* file_proto_desc = alternate_pool.FindMessageTypeByName( - file_proto.GetDescriptor()->full_name()); - GOOGLE_CHECK(file_proto_desc) - << "Find unknown fields in FileDescriptorProto when building " - << file_proto.name() - << ". It's likely that those fields are custom options, however, " - "descriptor.proto is not in the transitive dependencies. " - "This normally should not happen. Please report a bug."; - DynamicMessageFactory factory; - std::unique_ptr dynamic_file_proto( - factory.GetPrototype(file_proto_desc)->New()); - GOOGLE_CHECK(dynamic_file_proto.get() != NULL); - GOOGLE_CHECK(dynamic_file_proto->ParseFromString(file_data)); - - // Collect the extensions again from the dynamic message. There should be no - // more unknown fields this time, i.e. all the custom options should be - // parsed as extensions now. - extensions->clear(); - GOOGLE_CHECK(CollectExtensions(*dynamic_file_proto, extensions)) - << "Find unknown fields in FileDescriptorProto when building " - << file_proto.name() - << ". It's likely that those fields are custom options, however, " - "those options cannot be recognized in the builder pool. " - "This normally should not happen. Please report a bug."; - } -} - -// Our static initialization methods can become very, very large. -// So large that if we aren't careful we end up blowing the JVM's -// 64K bytes of bytecode/method. Fortunately, since these static -// methods are executed only once near the beginning of a program, -// there's usually plenty of stack space available and we can -// extend our methods by simply chaining them to another method -// with a tail call. This inserts the sequence call-next-method, -// end this one, begin-next-method as needed. -void MaybeRestartJavaMethod(io::Printer* printer, int* bytecode_estimate, - int* method_num, const char* chain_statement, - const char* method_decl) { - // The goal here is to stay under 64K bytes of jvm bytecode/method, - // since otherwise we hit a hardcoded limit in the jvm and javac will - // then fail with the error "code too large". This limit lets our - // estimates be off by a factor of two and still we're okay. - static const int bytesPerMethod = kMaxStaticSize; - - if ((*bytecode_estimate) > bytesPerMethod) { - ++(*method_num); - printer->Print(chain_statement, "method_num", StrCat(*method_num)); - printer->Outdent(); - printer->Print("}\n"); - printer->Print(method_decl, "method_num", StrCat(*method_num)); - printer->Indent(); - *bytecode_estimate = 0; - } -} -} // namespace - -FileGenerator::FileGenerator(const FileDescriptor* file, const Options& options, - bool immutable_api) - : file_(file), - java_package_(FileJavaPackage(file, immutable_api)), - message_generators_(file->message_type_count()), - extension_generators_(file->extension_count()), - context_(new Context(file, options)), - name_resolver_(context_->GetNameResolver()), - options_(options), - immutable_api_(immutable_api) { - classname_ = name_resolver_->GetFileClassName(file, immutable_api); - generator_factory_.reset(new ImmutableGeneratorFactory(context_.get())); - for (int i = 0; i < file_->message_type_count(); ++i) { - message_generators_[i].reset( - generator_factory_->NewMessageGenerator(file_->message_type(i))); - } - for (int i = 0; i < file_->extension_count(); ++i) { - extension_generators_[i].reset( - generator_factory_->NewExtensionGenerator(file_->extension(i))); - } -} - -FileGenerator::~FileGenerator() {} - -bool FileGenerator::Validate(std::string* error) { - // Check that no class name matches the file's class name. This is a common - // problem that leads to Java compile errors that can be hard to understand. - // It's especially bad when using the java_multiple_files, since we would - // end up overwriting the outer class with one of the inner ones. - if (name_resolver_->HasConflictingClassName(file_, classname_, - NameEquality::EXACT_EQUAL)) { - error->assign(file_->name()); - error->append( - ": Cannot generate Java output because the file's outer class name, " - "\""); - error->append(classname_); - error->append( - "\", matches the name of one of the types declared inside it. " - "Please either rename the type or use the java_outer_classname " - "option to specify a different outer class name for the .proto file."); - return false; - } - // Similar to the check above, but ignore the case this time. This is not a - // problem on Linux, but will lead to Java compile errors on Windows / Mac - // because filenames are case-insensitive on those platforms. - if (name_resolver_->HasConflictingClassName( - file_, classname_, NameEquality::EQUAL_IGNORE_CASE)) { - GOOGLE_LOG(WARNING) - << file_->name() << ": The file's outer class name, \"" << classname_ - << "\", matches the name of one of the types declared inside it when " - << "case is ignored. This can cause compilation issues on Windows / " - << "MacOS. Please either rename the type or use the " - << "java_outer_classname option to specify a different outer class " - << "name for the .proto file to be safe."; - } - - // Print a warning if optimize_for = LITE_RUNTIME is used. - if (file_->options().optimize_for() == FileOptions::LITE_RUNTIME && - !options_.enforce_lite) { - GOOGLE_LOG(WARNING) - << "The optimize_for = LITE_RUNTIME option is no longer supported by " - << "protobuf Java code generator and is ignored--protoc will always " - << "generate full runtime code for Java. To use Java Lite runtime, " - << "users should use the Java Lite plugin instead. See:\n" - << " " - "https://github.com/protocolbuffers/protobuf/blob/master/java/" - "lite.md"; - } - return true; -} - -void FileGenerator::Generate(io::Printer* printer) { - // We don't import anything because we refer to all classes by their - // fully-qualified names in the generated source. - printer->Print( - "// Generated by the protocol buffer compiler. DO NOT EDIT!\n" - "// source: $filename$\n" - "\n", - "filename", file_->name()); - if (!java_package_.empty()) { - printer->Print( - "package $package$;\n" - "\n", - "package", java_package_); - } - PrintGeneratedAnnotation( - printer, '$', options_.annotate_code ? classname_ + ".java.pb.meta" : ""); - - printer->Print( - "$deprecation$public final class $classname$ {\n" - " private $ctor$() {}\n", - "deprecation", - file_->options().deprecated() ? "@java.lang.Deprecated " : "", - "classname", classname_, "ctor", classname_); - printer->Annotate("classname", file_->name()); - printer->Indent(); - - // ----------------------------------------------------------------- - - printer->Print( - "public static void registerAllExtensions(\n" - " com.google.protobuf.ExtensionRegistryLite registry) {\n"); - - printer->Indent(); - - for (int i = 0; i < file_->extension_count(); i++) { - extension_generators_[i]->GenerateRegistrationCode(printer); - } - - for (int i = 0; i < file_->message_type_count(); i++) { - message_generators_[i]->GenerateExtensionRegistrationCode(printer); - } - - printer->Outdent(); - printer->Print("}\n"); - if (HasDescriptorMethods(file_, context_->EnforceLite())) { - // Overload registerAllExtensions for the non-lite usage to - // redundantly maintain the original signature (this is - // redundant because ExtensionRegistryLite now invokes - // ExtensionRegistry in the non-lite usage). Intent is - // to remove this in the future. - printer->Print( - "\n" - "public static void registerAllExtensions(\n" - " com.google.protobuf.ExtensionRegistry registry) {\n" - " registerAllExtensions(\n" - " (com.google.protobuf.ExtensionRegistryLite) registry);\n" - "}\n"); - } - - // ----------------------------------------------------------------- - - if (!MultipleJavaFiles(file_, immutable_api_)) { - for (int i = 0; i < file_->enum_type_count(); i++) { - if (HasDescriptorMethods(file_, context_->EnforceLite())) { - EnumGenerator(file_->enum_type(i), immutable_api_, context_.get()) - .Generate(printer); - } else { - EnumLiteGenerator(file_->enum_type(i), immutable_api_, context_.get()) - .Generate(printer); - } - } - for (int i = 0; i < file_->message_type_count(); i++) { - message_generators_[i]->GenerateInterface(printer); - message_generators_[i]->Generate(printer); - } - if (HasGenericServices(file_, context_->EnforceLite())) { - for (int i = 0; i < file_->service_count(); i++) { - std::unique_ptr generator( - generator_factory_->NewServiceGenerator(file_->service(i))); - generator->Generate(printer); - } - } - } - - // Extensions must be generated in the outer class since they are values, - // not classes. - for (int i = 0; i < file_->extension_count(); i++) { - extension_generators_[i]->Generate(printer); - } - - // Static variables. We'd like them to be final if possible, but due to - // the JVM's 64k size limit on static blocks, we have to initialize some - // of them in methods; thus they cannot be final. - int static_block_bytecode_estimate = 0; - for (int i = 0; i < file_->message_type_count(); i++) { - message_generators_[i]->GenerateStaticVariables( - printer, &static_block_bytecode_estimate); - } - - printer->Print("\n"); - - if (HasDescriptorMethods(file_, context_->EnforceLite())) { - if (immutable_api_) { - GenerateDescriptorInitializationCodeForImmutable(printer); - } else { - GenerateDescriptorInitializationCodeForMutable(printer); - } - } else { - printer->Print("static {\n"); - printer->Indent(); - int bytecode_estimate = 0; - int method_num = 0; - - for (int i = 0; i < file_->message_type_count(); i++) { - bytecode_estimate += - message_generators_[i]->GenerateStaticVariableInitializers(printer); - MaybeRestartJavaMethod( - printer, &bytecode_estimate, &method_num, - "_clinit_autosplit_$method_num$();\n", - "private static void _clinit_autosplit_$method_num$() {\n"); - } - - printer->Outdent(); - printer->Print("}\n"); - } - - printer->Print( - "\n" - "// @@protoc_insertion_point(outer_class_scope)\n"); - - printer->Outdent(); - printer->Print("}\n"); -} - -void FileGenerator::GenerateDescriptorInitializationCodeForImmutable( - io::Printer* printer) { - printer->Print( - "public static com.google.protobuf.Descriptors.FileDescriptor\n" - " getDescriptor() {\n" - " return descriptor;\n" - "}\n" - "private static $final$ com.google.protobuf.Descriptors.FileDescriptor\n" - " descriptor;\n" - "static {\n", - // TODO(dweis): Mark this as final. - "final", ""); - printer->Indent(); - - SharedCodeGenerator shared_code_generator(file_, options_); - shared_code_generator.GenerateDescriptors(printer); - - int bytecode_estimate = 0; - int method_num = 0; - - for (int i = 0; i < file_->message_type_count(); i++) { - bytecode_estimate += - message_generators_[i]->GenerateStaticVariableInitializers(printer); - MaybeRestartJavaMethod( - printer, &bytecode_estimate, &method_num, - "_clinit_autosplit_dinit_$method_num$();\n", - "private static void _clinit_autosplit_dinit_$method_num$() {\n"); - } - for (int i = 0; i < file_->extension_count(); i++) { - bytecode_estimate += - extension_generators_[i]->GenerateNonNestedInitializationCode(printer); - MaybeRestartJavaMethod( - printer, &bytecode_estimate, &method_num, - "_clinit_autosplit_dinit_$method_num$();\n", - "private static void _clinit_autosplit_dinit_$method_num$() {\n"); - } - - // Proto compiler builds a DescriptorPool, which holds all the descriptors to - // generate, when processing the ".proto" files. We call this DescriptorPool - // the parsed pool (a.k.a. file_->pool()). - // - // Note that when users try to extend the (.*)DescriptorProto in their - // ".proto" files, it does not affect the pre-built FileDescriptorProto class - // in proto compiler. When we put the descriptor data in the file_proto, those - // extensions become unknown fields. - // - // Now we need to find out all the extension value to the (.*)DescriptorProto - // in the file_proto message, and prepare an ExtensionRegistry to return. - // - // To find those extensions, we need to parse the data into a dynamic message - // of the FileDescriptor based on the builder-pool, then we can use - // reflections to find all extension fields - FileDescriptorProto file_proto; - file_->CopyTo(&file_proto); - std::string file_data; - file_proto.SerializeToString(&file_data); - FieldDescriptorSet extensions; - CollectExtensions(file_proto, *file_->pool(), &extensions, file_data); - - if (extensions.size() > 0) { - // Must construct an ExtensionRegistry containing all existing extensions - // and use it to parse the descriptor data again to recognize extensions. - printer->Print( - "com.google.protobuf.ExtensionRegistry registry =\n" - " com.google.protobuf.ExtensionRegistry.newInstance();\n"); - FieldDescriptorSet::iterator it; - for (it = extensions.begin(); it != extensions.end(); it++) { - std::unique_ptr generator( - generator_factory_->NewExtensionGenerator(*it)); - bytecode_estimate += generator->GenerateRegistrationCode(printer); - MaybeRestartJavaMethod( - printer, &bytecode_estimate, &method_num, - "_clinit_autosplit_dinit_$method_num$(registry);\n", - "private static void _clinit_autosplit_dinit_$method_num$(\n" - " com.google.protobuf.ExtensionRegistry registry) {\n"); - } - printer->Print( - "com.google.protobuf.Descriptors.FileDescriptor\n" - " .internalUpdateFileDescriptor(descriptor, registry);\n"); - } - - // Force descriptor initialization of all dependencies. - for (int i = 0; i < file_->dependency_count(); i++) { - if (ShouldIncludeDependency(file_->dependency(i), true)) { - std::string dependency = - name_resolver_->GetImmutableClassName(file_->dependency(i)); - printer->Print("$dependency$.getDescriptor();\n", "dependency", - dependency); - } - } - - printer->Outdent(); - printer->Print("}\n"); -} - -void FileGenerator::GenerateDescriptorInitializationCodeForMutable( - io::Printer* printer) { - printer->Print( - "public static com.google.protobuf.Descriptors.FileDescriptor\n" - " getDescriptor() {\n" - " return descriptor;\n" - "}\n" - "private static final com.google.protobuf.Descriptors.FileDescriptor\n" - " descriptor;\n" - "static {\n"); - printer->Indent(); - - printer->Print( - "descriptor = $immutable_package$.$descriptor_classname$.descriptor;\n", - "immutable_package", FileJavaPackage(file_, true), "descriptor_classname", - name_resolver_->GetDescriptorClassName(file_)); - - for (int i = 0; i < file_->message_type_count(); i++) { - message_generators_[i]->GenerateStaticVariableInitializers(printer); - } - for (int i = 0; i < file_->extension_count(); i++) { - extension_generators_[i]->GenerateNonNestedInitializationCode(printer); - } - - // Check if custom options exist. If any, try to load immutable classes since - // custom options are only represented with immutable messages. - FileDescriptorProto file_proto; - file_->CopyTo(&file_proto); - std::string file_data; - file_proto.SerializeToString(&file_data); - FieldDescriptorSet extensions; - CollectExtensions(file_proto, *file_->pool(), &extensions, file_data); - - if (extensions.size() > 0) { - // Try to load immutable messages' outer class. Its initialization code - // will take care of interpreting custom options. - printer->Print( - "try {\n" - // Note that we have to load the immutable class dynamically here as - // we want the mutable code to be independent from the immutable code - // at compile time. It is required to implement dual-compile for - // mutable and immutable API in blaze. - " java.lang.Class immutableClass = java.lang.Class.forName(\n" - " \"$immutable_classname$\");\n" - "} catch (java.lang.ClassNotFoundException e) {\n", - "immutable_classname", name_resolver_->GetImmutableClassName(file_)); - printer->Indent(); - - // The immutable class can not be found. We try our best to collect all - // custom option extensions to interpret the custom options. - printer->Print( - "com.google.protobuf.ExtensionRegistry registry =\n" - " com.google.protobuf.ExtensionRegistry.newInstance();\n" - "com.google.protobuf.MessageLite defaultExtensionInstance = null;\n"); - FieldDescriptorSet::iterator it; - for (it = extensions.begin(); it != extensions.end(); it++) { - const FieldDescriptor* field = *it; - std::string scope; - if (field->extension_scope() != NULL) { - scope = name_resolver_->GetMutableClassName(field->extension_scope()) + - ".getDescriptor()"; - } else { - scope = FileJavaPackage(field->file(), true) + "." + - name_resolver_->GetDescriptorClassName(field->file()) + - ".descriptor"; - } - if (field->cpp_type() == FieldDescriptor::CPPTYPE_MESSAGE) { - printer->Print( - "defaultExtensionInstance = com.google.protobuf.Internal\n" - " .getDefaultInstance(\"$class$\");\n" - "if (defaultExtensionInstance != null) {\n" - " registry.add(\n" - " $scope$.getExtensions().get($index$),\n" - " (com.google.protobuf.Message) defaultExtensionInstance);\n" - "}\n", - "scope", scope, "index", StrCat(field->index()), "class", - name_resolver_->GetImmutableClassName(field->message_type())); - } else { - printer->Print("registry.add($scope$.getExtensions().get($index$));\n", - "scope", scope, "index", StrCat(field->index())); - } - } - printer->Print( - "com.google.protobuf.Descriptors.FileDescriptor\n" - " .internalUpdateFileDescriptor(descriptor, registry);\n"); - - printer->Outdent(); - printer->Print("}\n"); - } - - // Force descriptor initialization of all dependencies. - for (int i = 0; i < file_->dependency_count(); i++) { - if (ShouldIncludeDependency(file_->dependency(i), false)) { - std::string dependency = - name_resolver_->GetMutableClassName(file_->dependency(i)); - printer->Print("$dependency$.getDescriptor();\n", "dependency", - dependency); - } - } - - printer->Outdent(); - printer->Print("}\n"); -} - -template -static void GenerateSibling( - const std::string& package_dir, const std::string& java_package, - const DescriptorClass* descriptor, GeneratorContext* context, - std::vector* file_list, bool annotate_code, - std::vector* annotation_list, const std::string& name_suffix, - GeneratorClass* generator, - void (GeneratorClass::*pfn)(io::Printer* printer)) { - std::string filename = - package_dir + descriptor->name() + name_suffix + ".java"; - file_list->push_back(filename); - std::string info_full_path = filename + ".pb.meta"; - GeneratedCodeInfo annotations; - io::AnnotationProtoCollector annotation_collector( - &annotations); - - std::unique_ptr output(context->Open(filename)); - io::Printer printer(output.get(), '$', - annotate_code ? &annotation_collector : NULL); - - printer.Print( - "// Generated by the protocol buffer compiler. DO NOT EDIT!\n" - "// source: $filename$\n" - "\n", - "filename", descriptor->file()->name()); - if (!java_package.empty()) { - printer.Print( - "package $package$;\n" - "\n", - "package", java_package); - } - - (generator->*pfn)(&printer); - - if (annotate_code) { - std::unique_ptr info_output( - context->Open(info_full_path)); - annotations.SerializeToZeroCopyStream(info_output.get()); - annotation_list->push_back(info_full_path); - } -} - -void FileGenerator::GenerateSiblings( - const std::string& package_dir, GeneratorContext* context, - std::vector* file_list, - std::vector* annotation_list) { - if (MultipleJavaFiles(file_, immutable_api_)) { - for (int i = 0; i < file_->enum_type_count(); i++) { - if (HasDescriptorMethods(file_, context_->EnforceLite())) { - EnumGenerator generator(file_->enum_type(i), immutable_api_, - context_.get()); - GenerateSibling( - package_dir, java_package_, file_->enum_type(i), context, file_list, - options_.annotate_code, annotation_list, "", &generator, - &EnumGenerator::Generate); - } else { - EnumLiteGenerator generator(file_->enum_type(i), immutable_api_, - context_.get()); - GenerateSibling( - package_dir, java_package_, file_->enum_type(i), context, file_list, - options_.annotate_code, annotation_list, "", &generator, - &EnumLiteGenerator::Generate); - } - } - for (int i = 0; i < file_->message_type_count(); i++) { - if (immutable_api_) { - GenerateSibling( - package_dir, java_package_, file_->message_type(i), context, - file_list, options_.annotate_code, annotation_list, "OrBuilder", - message_generators_[i].get(), &MessageGenerator::GenerateInterface); - } - GenerateSibling( - package_dir, java_package_, file_->message_type(i), context, - file_list, options_.annotate_code, annotation_list, "", - message_generators_[i].get(), &MessageGenerator::Generate); - } - if (HasGenericServices(file_, context_->EnforceLite())) { - for (int i = 0; i < file_->service_count(); i++) { - std::unique_ptr generator( - generator_factory_->NewServiceGenerator(file_->service(i))); - GenerateSibling( - package_dir, java_package_, file_->service(i), context, file_list, - options_.annotate_code, annotation_list, "", generator.get(), - &ServiceGenerator::Generate); - } - } - } -} - -std::string FileGenerator::GetKotlinClassname() { - return name_resolver_->GetFileClassName(file_, immutable_api_, true); -} - -void FileGenerator::GenerateKotlinSiblings( - const std::string& package_dir, GeneratorContext* context, - std::vector* file_list, - std::vector* annotation_list) { - for (int i = 0; i < file_->message_type_count(); i++) { - const Descriptor* descriptor = file_->message_type(i); - MessageGenerator* generator = message_generators_[i].get(); - auto open_file = [context](const std::string& filename) { - return std::unique_ptr(context->Open(filename)); - }; - std::string filename = package_dir + descriptor->name() + "Kt.kt"; - file_list->push_back(filename); - std::string info_full_path = filename + ".pb.meta"; - GeneratedCodeInfo annotations; - io::AnnotationProtoCollector annotation_collector( - &annotations); - auto output = open_file(filename); - io::Printer printer( - output.get(), '$', - options_.annotate_code ? &annotation_collector : nullptr); - - printer.Print( - "//Generated by the protocol buffer compiler. DO NOT EDIT!\n" - "// source: $filename$\n" - "\n", - "filename", descriptor->file()->name()); - if (!java_package_.empty()) { - printer.Print( - "package $package$;\n" - "\n", - "package", java_package_); - } - - generator->GenerateKotlinMembers(&printer); - generator->GenerateTopLevelKotlinMembers(&printer); - - if (options_.annotate_code) { - auto info_output = open_file(info_full_path); - annotations.SerializeToZeroCopyStream(info_output.get()); - annotation_list->push_back(info_full_path); - } - } -} - -bool FileGenerator::ShouldIncludeDependency(const FileDescriptor* descriptor, - bool immutable_api) { - return true; -} - -} // namespace java -} // namespace compiler -} // namespace protobuf -} // namespace google diff --git a/extra/protobuf/protobuf-3.19.4/src/google/protobuf/compiler/java/java_file.h b/extra/protobuf/protobuf-3.19.4/src/google/protobuf/compiler/java/java_file.h deleted file mode 100644 index 71ee3e85579c..000000000000 --- a/extra/protobuf/protobuf-3.19.4/src/google/protobuf/compiler/java/java_file.h +++ /dev/null @@ -1,125 +0,0 @@ -// Protocol Buffers - Google's data interchange format -// Copyright 2008 Google Inc. All rights reserved. -// https://developers.google.com/protocol-buffers/ -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// * Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// * Redistributions in binary form must reproduce the above -// copyright notice, this list of conditions and the following disclaimer -// in the documentation and/or other materials provided with the -// distribution. -// * Neither the name of Google Inc. nor the names of its -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -// Author: kenton@google.com (Kenton Varda) -// Based on original Protocol Buffers design by -// Sanjay Ghemawat, Jeff Dean, and others. - -#ifndef GOOGLE_PROTOBUF_COMPILER_JAVA_FILE_H__ -#define GOOGLE_PROTOBUF_COMPILER_JAVA_FILE_H__ - -#include -#include -#include -#include -#include - -namespace google { -namespace protobuf { -class FileDescriptor; // descriptor.h -namespace io { -class Printer; // printer.h -} -namespace compiler { -class GeneratorContext; // code_generator.h -namespace java { -class Context; // context.h -class MessageGenerator; // message.h -class GeneratorFactory; // generator_factory.h -class ExtensionGenerator; // extension.h -class ClassNameResolver; // name_resolver.h -} // namespace java -} // namespace compiler -} // namespace protobuf -} // namespace google - -namespace google { -namespace protobuf { -namespace compiler { -namespace java { - -class FileGenerator { - public: - FileGenerator(const FileDescriptor* file, const Options& options, - bool immutable_api = true); - ~FileGenerator(); - - // Checks for problems that would otherwise lead to cryptic compile errors. - // Returns true if there are no problems, or writes an error description to - // the given string and returns false otherwise. - bool Validate(std::string* error); - - void Generate(io::Printer* printer); - - std::string GetKotlinClassname(); - void GenerateKotlinSiblings(const std::string& package_dir, - GeneratorContext* generator_context, - std::vector* file_list, - std::vector* annotation_list); - - // If we aren't putting everything into one file, this will write all the - // files other than the outer file (i.e. one for each message, enum, and - // service type). - void GenerateSiblings(const std::string& package_dir, - GeneratorContext* generator_context, - std::vector* file_list, - std::vector* annotation_list); - - const std::string& java_package() { return java_package_; } - const std::string& classname() { return classname_; } - - private: - void GenerateDescriptorInitializationCodeForImmutable(io::Printer* printer); - void GenerateDescriptorInitializationCodeForMutable(io::Printer* printer); - - bool ShouldIncludeDependency(const FileDescriptor* descriptor, - bool immutable_api_); - - const FileDescriptor* file_; - std::string java_package_; - std::string classname_; - - std::vector> message_generators_; - std::vector> extension_generators_; - std::unique_ptr generator_factory_; - std::unique_ptr context_; - ClassNameResolver* name_resolver_; - const Options options_; - bool immutable_api_; - - GOOGLE_DISALLOW_EVIL_CONSTRUCTORS(FileGenerator); -}; - -} // namespace java -} // namespace compiler -} // namespace protobuf -} // namespace google - -#endif // GOOGLE_PROTOBUF_COMPILER_JAVA_FILE_H__ diff --git a/extra/protobuf/protobuf-3.19.4/src/google/protobuf/compiler/java/java_generator.cc b/extra/protobuf/protobuf-3.19.4/src/google/protobuf/compiler/java/java_generator.cc deleted file mode 100644 index 29ae2cf9f4c2..000000000000 --- a/extra/protobuf/protobuf-3.19.4/src/google/protobuf/compiler/java/java_generator.cc +++ /dev/null @@ -1,211 +0,0 @@ -// Protocol Buffers - Google's data interchange format -// Copyright 2008 Google Inc. All rights reserved. -// https://developers.google.com/protocol-buffers/ -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// * Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// * Redistributions in binary form must reproduce the above -// copyright notice, this list of conditions and the following disclaimer -// in the documentation and/or other materials provided with the -// distribution. -// * Neither the name of Google Inc. nor the names of its -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -// Author: kenton@google.com (Kenton Varda) -// Based on original Protocol Buffers design by -// Sanjay Ghemawat, Jeff Dean, and others. - -#include - - -#include - -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#include - -namespace google { -namespace protobuf { -namespace compiler { -namespace java { - - -JavaGenerator::JavaGenerator() {} -JavaGenerator::~JavaGenerator() {} - -uint64_t JavaGenerator::GetSupportedFeatures() const { - return CodeGenerator::Feature::FEATURE_PROTO3_OPTIONAL; -} - -bool JavaGenerator::Generate(const FileDescriptor* file, - const std::string& parameter, - GeneratorContext* context, - std::string* error) const { - // ----------------------------------------------------------------- - // parse generator options - - std::vector > options; - ParseGeneratorParameter(parameter, &options); - Options file_options; - - for (int i = 0; i < options.size(); i++) { - if (options[i].first == "output_list_file") { - file_options.output_list_file = options[i].second; - } else if (options[i].first == "immutable") { - file_options.generate_immutable_code = true; - } else if (options[i].first == "mutable") { - file_options.generate_mutable_code = true; - } else if (options[i].first == "shared") { - file_options.generate_shared_code = true; - } else if (options[i].first == "lite") { - // Note: Java Lite does not guarantee API/ABI stability. We may choose to - // break existing API in order to boost performance / reduce code size. - file_options.enforce_lite = true; - } else if (options[i].first == "annotate_code") { - file_options.annotate_code = true; - } else if (options[i].first == "annotation_list_file") { - file_options.annotation_list_file = options[i].second; - } else { - *error = "Unknown generator option: " + options[i].first; - return false; - } - } - - if (file_options.enforce_lite && file_options.generate_mutable_code) { - *error = "lite runtime generator option cannot be used with mutable API."; - return false; - } - - // By default we generate immutable code and shared code for immutable API. - if (!file_options.generate_immutable_code && - !file_options.generate_mutable_code && - !file_options.generate_shared_code) { - file_options.generate_immutable_code = true; - file_options.generate_shared_code = true; - } - - // ----------------------------------------------------------------- - - - std::vector all_files; - std::vector all_annotations; - - - std::vector file_generators; - if (file_options.generate_immutable_code) { - file_generators.push_back(new FileGenerator(file, file_options, - /* immutable = */ true)); - } - if (file_options.generate_mutable_code) { - file_generators.push_back(new FileGenerator(file, file_options, - /* mutable = */ false)); - } - - for (int i = 0; i < file_generators.size(); ++i) { - if (!file_generators[i]->Validate(error)) { - for (int j = 0; j < file_generators.size(); ++j) { - delete file_generators[j]; - } - return false; - } - } - - for (int i = 0; i < file_generators.size(); ++i) { - FileGenerator* file_generator = file_generators[i]; - - std::string package_dir = JavaPackageToDir(file_generator->java_package()); - - std::string java_filename = package_dir; - java_filename += file_generator->classname(); - java_filename += ".java"; - all_files.push_back(java_filename); - std::string info_full_path = java_filename + ".pb.meta"; - if (file_options.annotate_code) { - all_annotations.push_back(info_full_path); - } - - // Generate main java file. - std::unique_ptr output( - context->Open(java_filename)); - GeneratedCodeInfo annotations; - io::AnnotationProtoCollector annotation_collector( - &annotations); - io::Printer printer( - output.get(), '$', - file_options.annotate_code ? &annotation_collector : NULL); - - file_generator->Generate(&printer); - - // Generate sibling files. - file_generator->GenerateSiblings(package_dir, context, &all_files, - &all_annotations); - - if (file_options.annotate_code) { - std::unique_ptr info_output( - context->Open(info_full_path)); - annotations.SerializeToZeroCopyStream(info_output.get()); - } - } - - - for (int i = 0; i < file_generators.size(); ++i) { - delete file_generators[i]; - } - file_generators.clear(); - - // Generate output list if requested. - if (!file_options.output_list_file.empty()) { - // Generate output list. This is just a simple text file placed in a - // deterministic location which lists the .java files being generated. - std::unique_ptr srclist_raw_output( - context->Open(file_options.output_list_file)); - io::Printer srclist_printer(srclist_raw_output.get(), '$'); - for (int i = 0; i < all_files.size(); i++) { - srclist_printer.Print("$filename$\n", "filename", all_files[i]); - } - } - - if (!file_options.annotation_list_file.empty()) { - // Generate output list. This is just a simple text file placed in a - // deterministic location which lists the .java files being generated. - std::unique_ptr annotation_list_raw_output( - context->Open(file_options.annotation_list_file)); - io::Printer annotation_list_printer(annotation_list_raw_output.get(), '$'); - for (int i = 0; i < all_annotations.size(); i++) { - annotation_list_printer.Print("$filename$\n", "filename", - all_annotations[i]); - } - } - - return true; -} - -} // namespace java -} // namespace compiler -} // namespace protobuf -} // namespace google diff --git a/extra/protobuf/protobuf-3.19.4/src/google/protobuf/compiler/java/java_generator.h b/extra/protobuf/protobuf-3.19.4/src/google/protobuf/compiler/java/java_generator.h deleted file mode 100644 index 6315e7c3fedc..000000000000 --- a/extra/protobuf/protobuf-3.19.4/src/google/protobuf/compiler/java/java_generator.h +++ /dev/null @@ -1,76 +0,0 @@ -// Protocol Buffers - Google's data interchange format -// Copyright 2008 Google Inc. All rights reserved. -// https://developers.google.com/protocol-buffers/ -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// * Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// * Redistributions in binary form must reproduce the above -// copyright notice, this list of conditions and the following disclaimer -// in the documentation and/or other materials provided with the -// distribution. -// * Neither the name of Google Inc. nor the names of its -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -// Author: kenton@google.com (Kenton Varda) -// Based on original Protocol Buffers design by -// Sanjay Ghemawat, Jeff Dean, and others. -// -// Generates Java code for a given .proto file. - -#ifndef GOOGLE_PROTOBUF_COMPILER_JAVA_GENERATOR_H__ -#define GOOGLE_PROTOBUF_COMPILER_JAVA_GENERATOR_H__ - -#include -#include - -#include - -namespace google { -namespace protobuf { -namespace compiler { -namespace java { - -// CodeGenerator implementation which generates Java code. If you create your -// own protocol compiler binary and you want it to support Java output, you -// can do so by registering an instance of this CodeGenerator with the -// CommandLineInterface in your main() function. -class PROTOC_EXPORT JavaGenerator : public CodeGenerator { - public: - JavaGenerator(); - ~JavaGenerator(); - - // implements CodeGenerator ---------------------------------------- - bool Generate(const FileDescriptor* file, const std::string& parameter, - GeneratorContext* context, std::string* error) const override; - - uint64_t GetSupportedFeatures() const override; - - private: - GOOGLE_DISALLOW_EVIL_CONSTRUCTORS(JavaGenerator); -}; - -} // namespace java -} // namespace compiler -} // namespace protobuf -} // namespace google - -#include - -#endif // GOOGLE_PROTOBUF_COMPILER_JAVA_GENERATOR_H__ diff --git a/extra/protobuf/protobuf-3.19.4/src/google/protobuf/compiler/java/java_generator_factory.cc b/extra/protobuf/protobuf-3.19.4/src/google/protobuf/compiler/java/java_generator_factory.cc deleted file mode 100644 index 3a62adb103c8..000000000000 --- a/extra/protobuf/protobuf-3.19.4/src/google/protobuf/compiler/java/java_generator_factory.cc +++ /dev/null @@ -1,86 +0,0 @@ -// Protocol Buffers - Google's data interchange format -// Copyright 2008 Google Inc. All rights reserved. -// https://developers.google.com/protocol-buffers/ -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// * Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// * Redistributions in binary form must reproduce the above -// copyright notice, this list of conditions and the following disclaimer -// in the documentation and/or other materials provided with the -// distribution. -// * Neither the name of Google Inc. nor the names of its -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -// Author: liujisi@google.com (Pherl Liu) - -#include - -#include -#include -#include -#include -#include -#include -#include -#include -#include - -namespace google { -namespace protobuf { -namespace compiler { -namespace java { - -GeneratorFactory::GeneratorFactory() {} -GeneratorFactory::~GeneratorFactory() {} - -// =================================================================== - -ImmutableGeneratorFactory::ImmutableGeneratorFactory(Context* context) - : context_(context) {} -ImmutableGeneratorFactory::~ImmutableGeneratorFactory() {} - -MessageGenerator* ImmutableGeneratorFactory::NewMessageGenerator( - const Descriptor* descriptor) const { - if (HasDescriptorMethods(descriptor, context_->EnforceLite())) { - return new ImmutableMessageGenerator(descriptor, context_); - } else { - return new ImmutableMessageLiteGenerator(descriptor, context_); - } -} - -ExtensionGenerator* ImmutableGeneratorFactory::NewExtensionGenerator( - const FieldDescriptor* descriptor) const { - if (HasDescriptorMethods(descriptor->file(), context_->EnforceLite())) { - return new ImmutableExtensionGenerator(descriptor, context_); - } else { - return new ImmutableExtensionLiteGenerator(descriptor, context_); - } -} - -ServiceGenerator* ImmutableGeneratorFactory::NewServiceGenerator( - const ServiceDescriptor* descriptor) const { - return new ImmutableServiceGenerator(descriptor, context_); -} - - -} // namespace java -} // namespace compiler -} // namespace protobuf -} // namespace google diff --git a/extra/protobuf/protobuf-3.19.4/src/google/protobuf/compiler/java/java_generator_factory.h b/extra/protobuf/protobuf-3.19.4/src/google/protobuf/compiler/java/java_generator_factory.h deleted file mode 100644 index 831d9dd85711..000000000000 --- a/extra/protobuf/protobuf-3.19.4/src/google/protobuf/compiler/java/java_generator_factory.h +++ /dev/null @@ -1,103 +0,0 @@ -// Protocol Buffers - Google's data interchange format -// Copyright 2008 Google Inc. All rights reserved. -// https://developers.google.com/protocol-buffers/ -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// * Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// * Redistributions in binary form must reproduce the above -// copyright notice, this list of conditions and the following disclaimer -// in the documentation and/or other materials provided with the -// distribution. -// * Neither the name of Google Inc. nor the names of its -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -// Author: liujisi@google.com (Pherl Liu) - -#ifndef GOOGLE_PROTOBUF_COMPILER_JAVA_GENERATOR_FACTORY_H__ -#define GOOGLE_PROTOBUF_COMPILER_JAVA_GENERATOR_FACTORY_H__ - -#include - -namespace google { -namespace protobuf { -class FieldDescriptor; // descriptor.h -class Descriptor; // descriptor.h -class ServiceDescriptor; // descriptor.h -namespace compiler { -namespace java { -class MessageGenerator; // message.h -class ExtensionGenerator; // extension.h -class ServiceGenerator; // service.h -class Context; // context.h -} // namespace java -} // namespace compiler -} // namespace protobuf -} // namespace google - -namespace google { -namespace protobuf { -namespace compiler { -namespace java { - -class GeneratorFactory { - public: - GeneratorFactory(); - virtual ~GeneratorFactory(); - - virtual MessageGenerator* NewMessageGenerator( - const Descriptor* descriptor) const = 0; - - virtual ExtensionGenerator* NewExtensionGenerator( - const FieldDescriptor* descriptor) const = 0; - - virtual ServiceGenerator* NewServiceGenerator( - const ServiceDescriptor* descriptor) const = 0; - - private: - GOOGLE_DISALLOW_EVIL_CONSTRUCTORS(GeneratorFactory); -}; - -// Factory that creates generators for immutable-default messages. -class ImmutableGeneratorFactory : public GeneratorFactory { - public: - ImmutableGeneratorFactory(Context* context); - virtual ~ImmutableGeneratorFactory(); - - MessageGenerator* NewMessageGenerator( - const Descriptor* descriptor) const override; - - ExtensionGenerator* NewExtensionGenerator( - const FieldDescriptor* descriptor) const override; - - ServiceGenerator* NewServiceGenerator( - const ServiceDescriptor* descriptor) const override; - - private: - Context* context_; - GOOGLE_DISALLOW_EVIL_CONSTRUCTORS(ImmutableGeneratorFactory); -}; - - -} // namespace java -} // namespace compiler -} // namespace protobuf -} // namespace google - -#endif // GOOGLE_PROTOBUF_COMPILER_JAVA_GENERATOR_FACTORY_H__ diff --git a/extra/protobuf/protobuf-3.19.4/src/google/protobuf/compiler/java/java_helpers.cc b/extra/protobuf/protobuf-3.19.4/src/google/protobuf/compiler/java/java_helpers.cc deleted file mode 100644 index f37ecde7844f..000000000000 --- a/extra/protobuf/protobuf-3.19.4/src/google/protobuf/compiler/java/java_helpers.cc +++ /dev/null @@ -1,1100 +0,0 @@ -// Protocol Buffers - Google's data interchange format -// Copyright 2008 Google Inc. All rights reserved. -// https://developers.google.com/protocol-buffers/ -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// * Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// * Redistributions in binary form must reproduce the above -// copyright notice, this list of conditions and the following disclaimer -// in the documentation and/or other materials provided with the -// distribution. -// * Neither the name of Google Inc. nor the names of its -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -// Author: kenton@google.com (Kenton Varda) -// Based on original Protocol Buffers design by -// Sanjay Ghemawat, Jeff Dean, and others. - -#include - -#include -#include -#include -#include -#include - -#include -#include -#include -#include -#include -#include -#include -#include // for hash - -namespace google { -namespace protobuf { -namespace compiler { -namespace java { - -using internal::WireFormat; -using internal::WireFormatLite; - -const char kThickSeparator[] = - "// ===================================================================\n"; -const char kThinSeparator[] = - "// -------------------------------------------------------------------\n"; - -namespace { - -const char* kDefaultPackage = ""; - -// Names that should be avoided as field names. -// Using them will cause the compiler to generate accessors whose names are -// colliding with methods defined in base classes. -const char* kForbiddenWordList[] = { - // message base class: - "cached_size", - "serialized_size", - // java.lang.Object: - "class", -}; - -const std::unordered_set* kReservedNames = - new std::unordered_set({ - "abstract", "assert", "boolean", "break", "byte", - "case", "catch", "char", "class", "const", - "continue", "default", "do", "double", "else", - "enum", "extends", "final", "finally", "float", - "for", "goto", "if", "implements", "import", - "instanceof", "int", "interface", "long", "native", - "new", "package", "private", "protected", "public", - "return", "short", "static", "strictfp", "super", - "switch", "synchronized", "this", "throw", "throws", - "transient", "try", "void", "volatile", "while", - }); - -bool IsForbidden(const std::string& field_name) { - for (int i = 0; i < GOOGLE_ARRAYSIZE(kForbiddenWordList); ++i) { - if (field_name == kForbiddenWordList[i]) { - return true; - } - } - return false; -} - -std::string FieldName(const FieldDescriptor* field) { - std::string field_name; - // Groups are hacky: The name of the field is just the lower-cased name - // of the group type. In Java, though, we would like to retain the original - // capitalization of the type name. - if (GetType(field) == FieldDescriptor::TYPE_GROUP) { - field_name = field->message_type()->name(); - } else { - field_name = field->name(); - } - if (IsForbidden(field_name)) { - // Append a trailing "#" to indicate that the name should be decorated to - // avoid collision with other names. - field_name += "#"; - } - return field_name; -} - - -} // namespace - -void PrintGeneratedAnnotation(io::Printer* printer, char delimiter, - const std::string& annotation_file) { - if (annotation_file.empty()) { - return; - } - std::string ptemplate = - "@javax.annotation.Generated(value=\"protoc\", comments=\"annotations:"; - ptemplate.push_back(delimiter); - ptemplate.append("annotation_file"); - ptemplate.push_back(delimiter); - ptemplate.append("\")\n"); - printer->Print(ptemplate.c_str(), "annotation_file", annotation_file); -} - -void PrintEnumVerifierLogic(io::Printer* printer, - const FieldDescriptor* descriptor, - const std::map& variables, - const char* var_name, - const char* terminating_string, bool enforce_lite) { - std::string enum_verifier_string = - enforce_lite ? StrCat(var_name, ".internalGetVerifier()") - : StrCat( - "new com.google.protobuf.Internal.EnumVerifier() {\n" - " @java.lang.Override\n" - " public boolean isInRange(int number) {\n" - " return ", - var_name, - ".forNumber(number) != null;\n" - " }\n" - " }"); - printer->Print( - variables, - StrCat(enum_verifier_string, terminating_string).c_str()); -} - -std::string UnderscoresToCamelCase(const std::string& input, - bool cap_next_letter) { - GOOGLE_CHECK(!input.empty()); - std::string result; - // Note: I distrust ctype.h due to locales. - for (int i = 0; i < input.size(); i++) { - if ('a' <= input[i] && input[i] <= 'z') { - if (cap_next_letter) { - result += input[i] + ('A' - 'a'); - } else { - result += input[i]; - } - cap_next_letter = false; - } else if ('A' <= input[i] && input[i] <= 'Z') { - if (i == 0 && !cap_next_letter) { - // Force first letter to lower-case unless explicitly told to - // capitalize it. - result += input[i] + ('a' - 'A'); - } else { - // Capital letters after the first are left as-is. - result += input[i]; - } - cap_next_letter = false; - } else if ('0' <= input[i] && input[i] <= '9') { - result += input[i]; - cap_next_letter = true; - } else { - cap_next_letter = true; - } - } - // Add a trailing "_" if the name should be altered. - if (input[input.size() - 1] == '#') { - result += '_'; - } - return result; -} - -std::string ToCamelCase(const std::string& input, bool lower_first) { - bool capitalize_next = !lower_first; - std::string result; - result.reserve(input.size()); - - for (char i : input) { - if (i == '_') { - capitalize_next = true; - } else if (capitalize_next) { - result.push_back(ToUpperCh(i)); - capitalize_next = false; - } else { - result.push_back(i); - } - } - - // Lower-case the first letter. - if (lower_first && !result.empty()) { - result[0] = ToLowerCh(result[0]); - } - - return result; -} - -char ToUpperCh(char ch) { - return (ch >= 'a' && ch <= 'z') ? (ch - 'a' + 'A') : ch; -} - -char ToLowerCh(char ch) { - return (ch >= 'A' && ch <= 'Z') ? (ch - 'A' + 'a') : ch; -} - -std::string UnderscoresToCamelCase(const FieldDescriptor* field) { - return UnderscoresToCamelCase(FieldName(field), false); -} - -std::string UnderscoresToCapitalizedCamelCase(const FieldDescriptor* field) { - return UnderscoresToCamelCase(FieldName(field), true); -} - -std::string CapitalizedFieldName(const FieldDescriptor* field) { - return UnderscoresToCapitalizedCamelCase(field); -} - -std::string UnderscoresToCamelCase(const MethodDescriptor* method) { - return UnderscoresToCamelCase(method->name(), false); -} - -std::string UnderscoresToCamelCaseCheckReserved(const FieldDescriptor* field) { - std::string name = UnderscoresToCamelCase(field); - if (kReservedNames->find(name) != kReservedNames->end()) { - return name + "_"; - } - return name; -} - -bool IsForbiddenKotlin(const std::string& field_name) { - // Names that should be avoided as field names in Kotlin. - // All Kotlin hard keywords are in this list. - const std::unordered_set* kKotlinForbiddenNames = - new std::unordered_set({ - "as", "as?", "break", "class", "continue", "do", - "else", "false", "for", "fun", "if", "in", - "!in", "interface", "is", "!is", "null", "object", - "package", "return", "super", "this", "throw", "true", - "try", "typealias", "typeof", "val", "var", "when", - "while", - }); - return kKotlinForbiddenNames->find(field_name) != - kKotlinForbiddenNames->end(); -} - -std::string UniqueFileScopeIdentifier(const Descriptor* descriptor) { - return "static_" + StringReplace(descriptor->full_name(), ".", "_", true); -} - -std::string CamelCaseFieldName(const FieldDescriptor* field) { - std::string fieldName = UnderscoresToCamelCase(field); - if ('0' <= fieldName[0] && fieldName[0] <= '9') { - return '_' + fieldName; - } - return fieldName; -} - -std::string FileClassName(const FileDescriptor* file, bool immutable) { - ClassNameResolver name_resolver; - return name_resolver.GetFileClassName(file, immutable); -} - -std::string FileJavaPackage(const FileDescriptor* file, bool immutable) { - std::string result; - - if (file->options().has_java_package()) { - result = file->options().java_package(); - } else { - result = kDefaultPackage; - if (!file->package().empty()) { - if (!result.empty()) result += '.'; - result += file->package(); - } - } - - return result; -} - -std::string FileJavaPackage(const FileDescriptor* file) { - return FileJavaPackage(file, true /* immutable */); -} - -std::string JavaPackageToDir(std::string package_name) { - std::string package_dir = StringReplace(package_name, ".", "/", true); - if (!package_dir.empty()) package_dir += "/"; - return package_dir; -} - -std::string ClassName(const Descriptor* descriptor) { - ClassNameResolver name_resolver; - return name_resolver.GetClassName(descriptor, true); -} - -std::string ClassName(const EnumDescriptor* descriptor) { - ClassNameResolver name_resolver; - return name_resolver.GetClassName(descriptor, true); -} - -std::string ClassName(const ServiceDescriptor* descriptor) { - ClassNameResolver name_resolver; - return name_resolver.GetClassName(descriptor, true); -} - -std::string ClassName(const FileDescriptor* descriptor) { - ClassNameResolver name_resolver; - return name_resolver.GetClassName(descriptor, true); -} - - -std::string ExtraMessageInterfaces(const Descriptor* descriptor) { - std::string interfaces = "// @@protoc_insertion_point(message_implements:" + - descriptor->full_name() + ")"; - return interfaces; -} - - -std::string ExtraBuilderInterfaces(const Descriptor* descriptor) { - std::string interfaces = "// @@protoc_insertion_point(builder_implements:" + - descriptor->full_name() + ")"; - return interfaces; -} - -std::string ExtraMessageOrBuilderInterfaces(const Descriptor* descriptor) { - std::string interfaces = "// @@protoc_insertion_point(interface_extends:" + - descriptor->full_name() + ")"; - return interfaces; -} - -std::string FieldConstantName(const FieldDescriptor* field) { - std::string name = field->name() + "_FIELD_NUMBER"; - ToUpper(&name); - return name; -} - -FieldDescriptor::Type GetType(const FieldDescriptor* field) { - return field->type(); -} - -JavaType GetJavaType(const FieldDescriptor* field) { - switch (GetType(field)) { - case FieldDescriptor::TYPE_INT32: - case FieldDescriptor::TYPE_UINT32: - case FieldDescriptor::TYPE_SINT32: - case FieldDescriptor::TYPE_FIXED32: - case FieldDescriptor::TYPE_SFIXED32: - return JAVATYPE_INT; - - case FieldDescriptor::TYPE_INT64: - case FieldDescriptor::TYPE_UINT64: - case FieldDescriptor::TYPE_SINT64: - case FieldDescriptor::TYPE_FIXED64: - case FieldDescriptor::TYPE_SFIXED64: - return JAVATYPE_LONG; - - case FieldDescriptor::TYPE_FLOAT: - return JAVATYPE_FLOAT; - - case FieldDescriptor::TYPE_DOUBLE: - return JAVATYPE_DOUBLE; - - case FieldDescriptor::TYPE_BOOL: - return JAVATYPE_BOOLEAN; - - case FieldDescriptor::TYPE_STRING: - return JAVATYPE_STRING; - - case FieldDescriptor::TYPE_BYTES: - return JAVATYPE_BYTES; - - case FieldDescriptor::TYPE_ENUM: - return JAVATYPE_ENUM; - - case FieldDescriptor::TYPE_GROUP: - case FieldDescriptor::TYPE_MESSAGE: - return JAVATYPE_MESSAGE; - - // No default because we want the compiler to complain if any new - // types are added. - } - - GOOGLE_LOG(FATAL) << "Can't get here."; - return JAVATYPE_INT; -} - -const char* PrimitiveTypeName(JavaType type) { - switch (type) { - case JAVATYPE_INT: - return "int"; - case JAVATYPE_LONG: - return "long"; - case JAVATYPE_FLOAT: - return "float"; - case JAVATYPE_DOUBLE: - return "double"; - case JAVATYPE_BOOLEAN: - return "boolean"; - case JAVATYPE_STRING: - return "java.lang.String"; - case JAVATYPE_BYTES: - return "com.google.protobuf.ByteString"; - case JAVATYPE_ENUM: - return NULL; - case JAVATYPE_MESSAGE: - return NULL; - - // No default because we want the compiler to complain if any new - // JavaTypes are added. - } - - GOOGLE_LOG(FATAL) << "Can't get here."; - return NULL; -} - -const char* PrimitiveTypeName(const FieldDescriptor* descriptor) { - return PrimitiveTypeName(GetJavaType(descriptor)); -} - -const char* BoxedPrimitiveTypeName(JavaType type) { - switch (type) { - case JAVATYPE_INT: - return "java.lang.Integer"; - case JAVATYPE_LONG: - return "java.lang.Long"; - case JAVATYPE_FLOAT: - return "java.lang.Float"; - case JAVATYPE_DOUBLE: - return "java.lang.Double"; - case JAVATYPE_BOOLEAN: - return "java.lang.Boolean"; - case JAVATYPE_STRING: - return "java.lang.String"; - case JAVATYPE_BYTES: - return "com.google.protobuf.ByteString"; - case JAVATYPE_ENUM: - return NULL; - case JAVATYPE_MESSAGE: - return NULL; - - // No default because we want the compiler to complain if any new - // JavaTypes are added. - } - - GOOGLE_LOG(FATAL) << "Can't get here."; - return NULL; -} - -const char* BoxedPrimitiveTypeName(const FieldDescriptor* descriptor) { - return BoxedPrimitiveTypeName(GetJavaType(descriptor)); -} - -const char* KotlinTypeName(JavaType type) { - switch (type) { - case JAVATYPE_INT: - return "kotlin.Int"; - case JAVATYPE_LONG: - return "kotlin.Long"; - case JAVATYPE_FLOAT: - return "kotlin.Float"; - case JAVATYPE_DOUBLE: - return "kotlin.Double"; - case JAVATYPE_BOOLEAN: - return "kotlin.Boolean"; - case JAVATYPE_STRING: - return "kotlin.String"; - case JAVATYPE_BYTES: - return "com.google.protobuf.ByteString"; - case JAVATYPE_ENUM: - return NULL; - case JAVATYPE_MESSAGE: - return NULL; - - // No default because we want the compiler to complain if any new - // JavaTypes are added. - } - - GOOGLE_LOG(FATAL) << "Can't get here."; - return NULL; -} - -std::string GetOneofStoredType(const FieldDescriptor* field) { - const JavaType javaType = GetJavaType(field); - switch (javaType) { - case JAVATYPE_ENUM: - return "java.lang.Integer"; - case JAVATYPE_MESSAGE: - return ClassName(field->message_type()); - default: - return BoxedPrimitiveTypeName(javaType); - } -} - -const char* FieldTypeName(FieldDescriptor::Type field_type) { - switch (field_type) { - case FieldDescriptor::TYPE_INT32: - return "INT32"; - case FieldDescriptor::TYPE_UINT32: - return "UINT32"; - case FieldDescriptor::TYPE_SINT32: - return "SINT32"; - case FieldDescriptor::TYPE_FIXED32: - return "FIXED32"; - case FieldDescriptor::TYPE_SFIXED32: - return "SFIXED32"; - case FieldDescriptor::TYPE_INT64: - return "INT64"; - case FieldDescriptor::TYPE_UINT64: - return "UINT64"; - case FieldDescriptor::TYPE_SINT64: - return "SINT64"; - case FieldDescriptor::TYPE_FIXED64: - return "FIXED64"; - case FieldDescriptor::TYPE_SFIXED64: - return "SFIXED64"; - case FieldDescriptor::TYPE_FLOAT: - return "FLOAT"; - case FieldDescriptor::TYPE_DOUBLE: - return "DOUBLE"; - case FieldDescriptor::TYPE_BOOL: - return "BOOL"; - case FieldDescriptor::TYPE_STRING: - return "STRING"; - case FieldDescriptor::TYPE_BYTES: - return "BYTES"; - case FieldDescriptor::TYPE_ENUM: - return "ENUM"; - case FieldDescriptor::TYPE_GROUP: - return "GROUP"; - case FieldDescriptor::TYPE_MESSAGE: - return "MESSAGE"; - - // No default because we want the compiler to complain if any new - // types are added. - } - - GOOGLE_LOG(FATAL) << "Can't get here."; - return NULL; -} - -bool AllAscii(const std::string& text) { - for (int i = 0; i < text.size(); i++) { - if ((text[i] & 0x80) != 0) { - return false; - } - } - return true; -} - -std::string DefaultValue(const FieldDescriptor* field, bool immutable, - ClassNameResolver* name_resolver) { - // Switch on CppType since we need to know which default_value_* method - // of FieldDescriptor to call. - switch (field->cpp_type()) { - case FieldDescriptor::CPPTYPE_INT32: - return StrCat(field->default_value_int32()); - case FieldDescriptor::CPPTYPE_UINT32: - // Need to print as a signed int since Java has no unsigned. - return StrCat(static_cast(field->default_value_uint32())); - case FieldDescriptor::CPPTYPE_INT64: - return StrCat(field->default_value_int64()) + "L"; - case FieldDescriptor::CPPTYPE_UINT64: - return StrCat(static_cast(field->default_value_uint64())) + - "L"; - case FieldDescriptor::CPPTYPE_DOUBLE: { - double value = field->default_value_double(); - if (value == std::numeric_limits::infinity()) { - return "Double.POSITIVE_INFINITY"; - } else if (value == -std::numeric_limits::infinity()) { - return "Double.NEGATIVE_INFINITY"; - } else if (value != value) { - return "Double.NaN"; - } else { - return SimpleDtoa(value) + "D"; - } - } - case FieldDescriptor::CPPTYPE_FLOAT: { - float value = field->default_value_float(); - if (value == std::numeric_limits::infinity()) { - return "Float.POSITIVE_INFINITY"; - } else if (value == -std::numeric_limits::infinity()) { - return "Float.NEGATIVE_INFINITY"; - } else if (value != value) { - return "Float.NaN"; - } else { - return SimpleFtoa(value) + "F"; - } - } - case FieldDescriptor::CPPTYPE_BOOL: - return field->default_value_bool() ? "true" : "false"; - case FieldDescriptor::CPPTYPE_STRING: - if (GetType(field) == FieldDescriptor::TYPE_BYTES) { - if (field->has_default_value()) { - // See comments in Internal.java for gory details. - return strings::Substitute( - "com.google.protobuf.Internal.bytesDefaultValue(\"$0\")", - CEscape(field->default_value_string())); - } else { - return "com.google.protobuf.ByteString.EMPTY"; - } - } else { - if (AllAscii(field->default_value_string())) { - // All chars are ASCII. In this case CEscape() works fine. - return "\"" + CEscape(field->default_value_string()) + "\""; - } else { - // See comments in Internal.java for gory details. - return strings::Substitute( - "com.google.protobuf.Internal.stringDefaultValue(\"$0\")", - CEscape(field->default_value_string())); - } - } - - case FieldDescriptor::CPPTYPE_ENUM: - return name_resolver->GetClassName(field->enum_type(), immutable) + "." + - field->default_value_enum()->name(); - - case FieldDescriptor::CPPTYPE_MESSAGE: - return name_resolver->GetClassName(field->message_type(), immutable) + - ".getDefaultInstance()"; - - // No default because we want the compiler to complain if any new - // types are added. - } - - GOOGLE_LOG(FATAL) << "Can't get here."; - return ""; -} - -bool IsDefaultValueJavaDefault(const FieldDescriptor* field) { - // Switch on CppType since we need to know which default_value_* method - // of FieldDescriptor to call. - switch (field->cpp_type()) { - case FieldDescriptor::CPPTYPE_INT32: - return field->default_value_int32() == 0; - case FieldDescriptor::CPPTYPE_UINT32: - return field->default_value_uint32() == 0; - case FieldDescriptor::CPPTYPE_INT64: - return field->default_value_int64() == 0L; - case FieldDescriptor::CPPTYPE_UINT64: - return field->default_value_uint64() == 0L; - case FieldDescriptor::CPPTYPE_DOUBLE: - return field->default_value_double() == 0.0; - case FieldDescriptor::CPPTYPE_FLOAT: - return field->default_value_float() == 0.0; - case FieldDescriptor::CPPTYPE_BOOL: - return field->default_value_bool() == false; - case FieldDescriptor::CPPTYPE_ENUM: - return field->default_value_enum()->number() == 0; - case FieldDescriptor::CPPTYPE_STRING: - case FieldDescriptor::CPPTYPE_MESSAGE: - return false; - - // No default because we want the compiler to complain if any new - // types are added. - } - - GOOGLE_LOG(FATAL) << "Can't get here."; - return false; -} - -bool IsByteStringWithCustomDefaultValue(const FieldDescriptor* field) { - return GetJavaType(field) == JAVATYPE_BYTES && - field->default_value_string() != ""; -} - -const char* bit_masks[] = { - "0x00000001", "0x00000002", "0x00000004", "0x00000008", - "0x00000010", "0x00000020", "0x00000040", "0x00000080", - - "0x00000100", "0x00000200", "0x00000400", "0x00000800", - "0x00001000", "0x00002000", "0x00004000", "0x00008000", - - "0x00010000", "0x00020000", "0x00040000", "0x00080000", - "0x00100000", "0x00200000", "0x00400000", "0x00800000", - - "0x01000000", "0x02000000", "0x04000000", "0x08000000", - "0x10000000", "0x20000000", "0x40000000", "0x80000000", -}; - -std::string GetBitFieldName(int index) { - std::string varName = "bitField"; - varName += StrCat(index); - varName += "_"; - return varName; -} - -std::string GetBitFieldNameForBit(int bitIndex) { - return GetBitFieldName(bitIndex / 32); -} - -namespace { - -std::string GenerateGetBitInternal(const std::string& prefix, int bitIndex) { - std::string varName = prefix + GetBitFieldNameForBit(bitIndex); - int bitInVarIndex = bitIndex % 32; - - std::string mask = bit_masks[bitInVarIndex]; - std::string result = "((" + varName + " & " + mask + ") != 0)"; - return result; -} - -std::string GenerateSetBitInternal(const std::string& prefix, int bitIndex) { - std::string varName = prefix + GetBitFieldNameForBit(bitIndex); - int bitInVarIndex = bitIndex % 32; - - std::string mask = bit_masks[bitInVarIndex]; - std::string result = varName + " |= " + mask; - return result; -} - -} // namespace - -std::string GenerateGetBit(int bitIndex) { - return GenerateGetBitInternal("", bitIndex); -} - -std::string GenerateSetBit(int bitIndex) { - return GenerateSetBitInternal("", bitIndex); -} - -std::string GenerateClearBit(int bitIndex) { - std::string varName = GetBitFieldNameForBit(bitIndex); - int bitInVarIndex = bitIndex % 32; - - std::string mask = bit_masks[bitInVarIndex]; - std::string result = varName + " = (" + varName + " & ~" + mask + ")"; - return result; -} - -std::string GenerateGetBitFromLocal(int bitIndex) { - return GenerateGetBitInternal("from_", bitIndex); -} - -std::string GenerateSetBitToLocal(int bitIndex) { - return GenerateSetBitInternal("to_", bitIndex); -} - -std::string GenerateGetBitMutableLocal(int bitIndex) { - return GenerateGetBitInternal("mutable_", bitIndex); -} - -std::string GenerateSetBitMutableLocal(int bitIndex) { - return GenerateSetBitInternal("mutable_", bitIndex); -} - -bool IsReferenceType(JavaType type) { - switch (type) { - case JAVATYPE_INT: - return false; - case JAVATYPE_LONG: - return false; - case JAVATYPE_FLOAT: - return false; - case JAVATYPE_DOUBLE: - return false; - case JAVATYPE_BOOLEAN: - return false; - case JAVATYPE_STRING: - return true; - case JAVATYPE_BYTES: - return true; - case JAVATYPE_ENUM: - return true; - case JAVATYPE_MESSAGE: - return true; - - // No default because we want the compiler to complain if any new - // JavaTypes are added. - } - - GOOGLE_LOG(FATAL) << "Can't get here."; - return false; -} - -const char* GetCapitalizedType(const FieldDescriptor* field, bool immutable) { - switch (GetType(field)) { - case FieldDescriptor::TYPE_INT32: - return "Int32"; - case FieldDescriptor::TYPE_UINT32: - return "UInt32"; - case FieldDescriptor::TYPE_SINT32: - return "SInt32"; - case FieldDescriptor::TYPE_FIXED32: - return "Fixed32"; - case FieldDescriptor::TYPE_SFIXED32: - return "SFixed32"; - case FieldDescriptor::TYPE_INT64: - return "Int64"; - case FieldDescriptor::TYPE_UINT64: - return "UInt64"; - case FieldDescriptor::TYPE_SINT64: - return "SInt64"; - case FieldDescriptor::TYPE_FIXED64: - return "Fixed64"; - case FieldDescriptor::TYPE_SFIXED64: - return "SFixed64"; - case FieldDescriptor::TYPE_FLOAT: - return "Float"; - case FieldDescriptor::TYPE_DOUBLE: - return "Double"; - case FieldDescriptor::TYPE_BOOL: - return "Bool"; - case FieldDescriptor::TYPE_STRING: - return "String"; - case FieldDescriptor::TYPE_BYTES: { - return "Bytes"; - } - case FieldDescriptor::TYPE_ENUM: - return "Enum"; - case FieldDescriptor::TYPE_GROUP: - return "Group"; - case FieldDescriptor::TYPE_MESSAGE: - return "Message"; - - // No default because we want the compiler to complain if any new - // types are added. - } - - GOOGLE_LOG(FATAL) << "Can't get here."; - return NULL; -} - -// For encodings with fixed sizes, returns that size in bytes. Otherwise -// returns -1. -int FixedSize(FieldDescriptor::Type type) { - switch (type) { - case FieldDescriptor::TYPE_INT32: - return -1; - case FieldDescriptor::TYPE_INT64: - return -1; - case FieldDescriptor::TYPE_UINT32: - return -1; - case FieldDescriptor::TYPE_UINT64: - return -1; - case FieldDescriptor::TYPE_SINT32: - return -1; - case FieldDescriptor::TYPE_SINT64: - return -1; - case FieldDescriptor::TYPE_FIXED32: - return WireFormatLite::kFixed32Size; - case FieldDescriptor::TYPE_FIXED64: - return WireFormatLite::kFixed64Size; - case FieldDescriptor::TYPE_SFIXED32: - return WireFormatLite::kSFixed32Size; - case FieldDescriptor::TYPE_SFIXED64: - return WireFormatLite::kSFixed64Size; - case FieldDescriptor::TYPE_FLOAT: - return WireFormatLite::kFloatSize; - case FieldDescriptor::TYPE_DOUBLE: - return WireFormatLite::kDoubleSize; - - case FieldDescriptor::TYPE_BOOL: - return WireFormatLite::kBoolSize; - case FieldDescriptor::TYPE_ENUM: - return -1; - - case FieldDescriptor::TYPE_STRING: - return -1; - case FieldDescriptor::TYPE_BYTES: - return -1; - case FieldDescriptor::TYPE_GROUP: - return -1; - case FieldDescriptor::TYPE_MESSAGE: - return -1; - - // No default because we want the compiler to complain if any new - // types are added. - } - GOOGLE_LOG(FATAL) << "Can't get here."; - return -1; -} - -// Sort the fields of the given Descriptor by number into a new[]'d array -// and return it. The caller should delete the returned array. -const FieldDescriptor** SortFieldsByNumber(const Descriptor* descriptor) { - const FieldDescriptor** fields = - new const FieldDescriptor*[descriptor->field_count()]; - for (int i = 0; i < descriptor->field_count(); i++) { - fields[i] = descriptor->field(i); - } - std::sort(fields, fields + descriptor->field_count(), - FieldOrderingByNumber()); - return fields; -} - -// Returns true if the message type has any required fields. If it doesn't, -// we can optimize out calls to its isInitialized() method. -// -// already_seen is used to avoid checking the same type multiple times -// (and also to protect against recursion). -bool HasRequiredFields(const Descriptor* type, - std::unordered_set* already_seen) { - if (already_seen->count(type) > 0) { - // The type is already in cache. This means that either: - // a. The type has no required fields. - // b. We are in the midst of checking if the type has required fields, - // somewhere up the stack. In this case, we know that if the type - // has any required fields, they'll be found when we return to it, - // and the whole call to HasRequiredFields() will return true. - // Therefore, we don't have to check if this type has required fields - // here. - return false; - } - already_seen->insert(type); - - // If the type has extensions, an extension with message type could contain - // required fields, so we have to be conservative and assume such an - // extension exists. - if (type->extension_range_count() > 0) return true; - - for (int i = 0; i < type->field_count(); i++) { - const FieldDescriptor* field = type->field(i); - if (field->is_required()) { - return true; - } - if (GetJavaType(field) == JAVATYPE_MESSAGE) { - if (HasRequiredFields(field->message_type(), already_seen)) { - return true; - } - } - } - - return false; -} - -bool HasRequiredFields(const Descriptor* type) { - std::unordered_set already_seen; - return HasRequiredFields(type, &already_seen); -} - -bool HasRepeatedFields(const Descriptor* descriptor) { - for (int i = 0; i < descriptor->field_count(); ++i) { - const FieldDescriptor* field = descriptor->field(i); - if (field->is_repeated()) { - return true; - } - } - return false; -} - -// Encode an unsigned 32-bit value into a sequence of UTF-16 characters. -// -// If the value is in [0x0000, 0xD7FF], we encode it with a single character -// with the same numeric value. -// -// If the value is larger than 0xD7FF, we encode its lowest 13 bits into a -// character in the range [0xE000, 0xFFFF] by combining these 13 bits with -// 0xE000 using logic-or. Then we shift the value to the right by 13 bits, and -// encode the remaining value by repeating this same process until we get to -// a value in [0x0000, 0xD7FF] where we will encode it using a character with -// the same numeric value. -// -// Note that we only use code points in [0x0000, 0xD7FF] and [0xE000, 0xFFFF]. -// There will be no surrogate pairs in the encoded character sequence. -void WriteUInt32ToUtf16CharSequence(uint32_t number, - std::vector* output) { - // For values in [0x0000, 0xD7FF], only use one char to encode it. - if (number < 0xD800) { - output->push_back(static_cast(number)); - return; - } - // Encode into multiple chars. All except the last char will be in the range - // [0xE000, 0xFFFF], and the last char will be in the range [0x0000, 0xD7FF]. - // Note that we don't use any value in range [0xD800, 0xDFFF] because they - // have to come in pairs and the encoding is just more space-efficient w/o - // them. - while (number >= 0xD800) { - // [0xE000, 0xFFFF] can represent 13 bits of info. - output->push_back(static_cast(0xE000 | (number & 0x1FFF))); - number >>= 13; - } - output->push_back(static_cast(number)); -} - -int GetExperimentalJavaFieldTypeForSingular(const FieldDescriptor* field) { - // j/c/g/protobuf/FieldType.java lists field types in a slightly different - // order from FieldDescriptor::Type so we can't do a simple cast. - // - // TODO(xiaofeng): Make j/c/g/protobuf/FieldType.java follow the same order. - int result = field->type(); - if (result == FieldDescriptor::TYPE_GROUP) { - return 17; - } else if (result < FieldDescriptor::TYPE_GROUP) { - return result - 1; - } else { - return result - 2; - } -} - -int GetExperimentalJavaFieldTypeForRepeated(const FieldDescriptor* field) { - if (field->type() == FieldDescriptor::TYPE_GROUP) { - return 49; - } else { - return GetExperimentalJavaFieldTypeForSingular(field) + 18; - } -} - -int GetExperimentalJavaFieldTypeForPacked(const FieldDescriptor* field) { - int result = field->type(); - if (result < FieldDescriptor::TYPE_STRING) { - return result + 34; - } else if (result > FieldDescriptor::TYPE_BYTES) { - return result + 30; - } else { - GOOGLE_LOG(FATAL) << field->full_name() << " can't be packed."; - return 0; - } -} - -int GetExperimentalJavaFieldType(const FieldDescriptor* field) { - static const int kMapFieldType = 50; - static const int kOneofFieldTypeOffset = 51; - static const int kRequiredBit = 0x100; - static const int kUtf8CheckBit = 0x200; - static const int kCheckInitialized = 0x400; - static const int kMapWithProto2EnumValue = 0x800; - static const int kHasHasBit = 0x1000; - int extra_bits = field->is_required() ? kRequiredBit : 0; - if (field->type() == FieldDescriptor::TYPE_STRING && CheckUtf8(field)) { - extra_bits |= kUtf8CheckBit; - } - if (field->is_required() || (GetJavaType(field) == JAVATYPE_MESSAGE && - HasRequiredFields(field->message_type()))) { - extra_bits |= kCheckInitialized; - } - if (HasHasbit(field)) { - extra_bits |= kHasHasBit; - } - - if (field->is_map()) { - if (!SupportUnknownEnumValue(field)) { - const FieldDescriptor* value = - field->message_type()->FindFieldByName("value"); - if (GetJavaType(value) == JAVATYPE_ENUM) { - extra_bits |= kMapWithProto2EnumValue; - } - } - return kMapFieldType | extra_bits; - } else if (field->is_packed()) { - return GetExperimentalJavaFieldTypeForPacked(field); - } else if (field->is_repeated()) { - return GetExperimentalJavaFieldTypeForRepeated(field) | extra_bits; - } else if (IsRealOneof(field)) { - return (GetExperimentalJavaFieldTypeForSingular(field) + - kOneofFieldTypeOffset) | - extra_bits; - } else { - return GetExperimentalJavaFieldTypeForSingular(field) | extra_bits; - } -} - -// Escape a UTF-16 character to be embedded in a Java string. -void EscapeUtf16ToString(uint16_t code, std::string* output) { - if (code == '\t') { - output->append("\\t"); - } else if (code == '\b') { - output->append("\\b"); - } else if (code == '\n') { - output->append("\\n"); - } else if (code == '\r') { - output->append("\\r"); - } else if (code == '\f') { - output->append("\\f"); - } else if (code == '\'') { - output->append("\\'"); - } else if (code == '\"') { - output->append("\\\""); - } else if (code == '\\') { - output->append("\\\\"); - } else if (code >= 0x20 && code <= 0x7f) { - output->push_back(static_cast(code)); - } else { - output->append(StringPrintf("\\u%04x", code)); - } -} - -} // namespace java -} // namespace compiler -} // namespace protobuf -} // namespace google diff --git a/extra/protobuf/protobuf-3.19.4/src/google/protobuf/compiler/java/java_helpers.h b/extra/protobuf/protobuf-3.19.4/src/google/protobuf/compiler/java/java_helpers.h deleted file mode 100644 index 28cac6af9ae7..000000000000 --- a/extra/protobuf/protobuf-3.19.4/src/google/protobuf/compiler/java/java_helpers.h +++ /dev/null @@ -1,459 +0,0 @@ -// Protocol Buffers - Google's data interchange format -// Copyright 2008 Google Inc. All rights reserved. -// https://developers.google.com/protocol-buffers/ -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// * Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// * Redistributions in binary form must reproduce the above -// copyright notice, this list of conditions and the following disclaimer -// in the documentation and/or other materials provided with the -// distribution. -// * Neither the name of Google Inc. nor the names of its -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -// Author: kenton@google.com (Kenton Varda) -// Based on original Protocol Buffers design by -// Sanjay Ghemawat, Jeff Dean, and others. - -#ifndef GOOGLE_PROTOBUF_COMPILER_JAVA_HELPERS_H__ -#define GOOGLE_PROTOBUF_COMPILER_JAVA_HELPERS_H__ - -#include -#include - -#include -#include -#include -#include - -namespace google { -namespace protobuf { -namespace compiler { -namespace java { - -// Commonly-used separator comments. Thick is a line of '=', thin is a line -// of '-'. -extern const char kThickSeparator[]; -extern const char kThinSeparator[]; - -bool IsForbiddenKotlin(const std::string& field_name); - -// If annotation_file is non-empty, prints a javax.annotation.Generated -// annotation to the given Printer. annotation_file will be referenced in the -// annotation's comments field. delimiter should be the Printer's delimiter -// character. annotation_file will be included verbatim into a Java literal -// string, so it should not contain quotes or invalid Java escape sequences; -// however, these are unlikely to appear in practice, as the value of -// annotation_file should be generated from the filename of the source file -// being annotated (which in turn must be a Java identifier plus ".java"). -void PrintGeneratedAnnotation(io::Printer* printer, char delimiter = '$', - const std::string& annotation_file = ""); - -// If a GeneratedMessageLite contains non-lite enums, then its verifier -// must be instantiated inline, rather than retrieved from the enum class. -void PrintEnumVerifierLogic(io::Printer* printer, - const FieldDescriptor* descriptor, - const std::map& variables, - const char* var_name, - const char* terminating_string, bool enforce_lite); - -// Converts a name to camel-case. If cap_first_letter is true, capitalize the -// first letter. -std::string ToCamelCase(const std::string& input, bool lower_first); - -char ToUpperCh(char ch); -char ToLowerCh(char ch); - -// Converts a name to camel-case. If cap_first_letter is true, capitalize the -// first letter. -std::string UnderscoresToCamelCase(const std::string& name, - bool cap_first_letter); -// Converts the field's name to camel-case, e.g. "foo_bar_baz" becomes -// "fooBarBaz" or "FooBarBaz", respectively. -std::string UnderscoresToCamelCase(const FieldDescriptor* field); -std::string UnderscoresToCapitalizedCamelCase(const FieldDescriptor* field); - -// Similar, but for method names. (Typically, this merely has the effect -// of lower-casing the first letter of the name.) -std::string UnderscoresToCamelCase(const MethodDescriptor* method); - -// Same as UnderscoresToCamelCase, but checks for reserved keywords -std::string UnderscoresToCamelCaseCheckReserved(const FieldDescriptor* field); - -// Similar to UnderscoresToCamelCase, but guarantees that the result is a -// complete Java identifier by adding a _ if needed. -std::string CamelCaseFieldName(const FieldDescriptor* field); - -// Get an identifier that uniquely identifies this type within the file. -// This is used to declare static variables related to this type at the -// outermost file scope. -std::string UniqueFileScopeIdentifier(const Descriptor* descriptor); - -// Gets the unqualified class name for the file. For each .proto file, there -// will be one Java class containing all the immutable messages and another -// Java class containing all the mutable messages. -// TODO(xiaofeng): remove the default value after updating client code. -std::string FileClassName(const FileDescriptor* file, bool immutable = true); - -// Returns the file's Java package name. -std::string FileJavaPackage(const FileDescriptor* file, bool immutable); - -// Returns output directory for the given package name. -std::string JavaPackageToDir(std::string package_name); - -// Comma-separate list of option-specified interfaces implemented by the -// Message, to follow the "implements" declaration of the Message definition. -std::string ExtraMessageInterfaces(const Descriptor* descriptor); -// Comma-separate list of option-specified interfaces implemented by the -// MutableMessage, to follow the "implements" declaration of the MutableMessage -// definition. -std::string ExtraMutableMessageInterfaces(const Descriptor* descriptor); -// Comma-separate list of option-specified interfaces implemented by the -// Builder, to follow the "implements" declaration of the Builder definition. -std::string ExtraBuilderInterfaces(const Descriptor* descriptor); -// Comma-separate list of option-specified interfaces extended by the -// MessageOrBuilder, to follow the "extends" declaration of the -// MessageOrBuilder definition. -std::string ExtraMessageOrBuilderInterfaces(const Descriptor* descriptor); - -// Get the unqualified Java class name for mutable messages. i.e. without -// package or outer classnames. -inline std::string ShortMutableJavaClassName(const Descriptor* descriptor) { - return descriptor->name(); -} - -// Whether the given descriptor is for one of the core descriptor protos. We -// cannot currently use the new runtime with core protos since there is a -// bootstrapping problem with obtaining their descriptors. -inline bool IsDescriptorProto(const Descriptor* descriptor) { - return descriptor->file()->name() == "net/proto2/proto/descriptor.proto" || - descriptor->file()->name() == "google/protobuf/descriptor.proto"; -} - -// Returns the stored type string used by the experimental runtime for oneof -// fields. -std::string GetOneofStoredType(const FieldDescriptor* field); - - -// Whether we should generate multiple java files for messages. -inline bool MultipleJavaFiles(const FileDescriptor* descriptor, - bool immutable) { - (void)immutable; - return descriptor->options().java_multiple_files(); -} - - -// Returns true if `descriptor` will be written to its own .java file. -// `immutable` should be set to true if we're generating for the immutable API. -template -bool IsOwnFile(const Descriptor* descriptor, bool immutable) { - return descriptor->containing_type() == NULL && - MultipleJavaFiles(descriptor->file(), immutable); -} - -template <> -inline bool IsOwnFile(const ServiceDescriptor* descriptor, bool immutable) { - return MultipleJavaFiles(descriptor->file(), immutable); -} - -// If `descriptor` describes an object with its own .java file, -// returns the name (relative to that .java file) of the file that stores -// annotation data for that descriptor. `suffix` is usually empty, but may -// (e.g.) be "OrBuilder" for some generated interfaces. -template -std::string AnnotationFileName(const Descriptor* descriptor, - const std::string& suffix) { - return descriptor->name() + suffix + ".java.pb.meta"; -} - -template -void MaybePrintGeneratedAnnotation(Context* context, io::Printer* printer, - Descriptor* descriptor, bool immutable, - const std::string& suffix = "") { - if (IsOwnFile(descriptor, immutable)) { - PrintGeneratedAnnotation(printer, '$', - context->options().annotate_code - ? AnnotationFileName(descriptor, suffix) - : ""); - } -} - -// Get the unqualified name that should be used for a field's field -// number constant. -std::string FieldConstantName(const FieldDescriptor* field); - -// Returns the type of the FieldDescriptor. -// This does nothing interesting for the open source release, but is used for -// hacks that improve compatibility with version 1 protocol buffers at Google. -FieldDescriptor::Type GetType(const FieldDescriptor* field); - -enum JavaType { - JAVATYPE_INT, - JAVATYPE_LONG, - JAVATYPE_FLOAT, - JAVATYPE_DOUBLE, - JAVATYPE_BOOLEAN, - JAVATYPE_STRING, - JAVATYPE_BYTES, - JAVATYPE_ENUM, - JAVATYPE_MESSAGE -}; - -JavaType GetJavaType(const FieldDescriptor* field); - -const char* PrimitiveTypeName(JavaType type); - -// Get the fully-qualified class name for a boxed primitive type, e.g. -// "java.lang.Integer" for JAVATYPE_INT. Returns NULL for enum and message -// types. -const char* BoxedPrimitiveTypeName(JavaType type); - -// Kotlin source does not distinguish between primitives and non-primitives, -// but does use Kotlin-specific qualified types for them. -const char* KotlinTypeName(JavaType type); - -// Get the name of the java enum constant representing this type. E.g., -// "INT32" for FieldDescriptor::TYPE_INT32. The enum constant's full -// name is "com.google.protobuf.WireFormat.FieldType.INT32". -const char* FieldTypeName(const FieldDescriptor::Type field_type); - -class ClassNameResolver; -std::string DefaultValue(const FieldDescriptor* field, bool immutable, - ClassNameResolver* name_resolver); -inline std::string ImmutableDefaultValue(const FieldDescriptor* field, - ClassNameResolver* name_resolver) { - return DefaultValue(field, true, name_resolver); -} -bool IsDefaultValueJavaDefault(const FieldDescriptor* field); -bool IsByteStringWithCustomDefaultValue(const FieldDescriptor* field); - -// Does this message class have descriptor and reflection methods? -inline bool HasDescriptorMethods(const Descriptor* /* descriptor */, - bool enforce_lite) { - return !enforce_lite; -} -inline bool HasDescriptorMethods(const EnumDescriptor* /* descriptor */, - bool enforce_lite) { - return !enforce_lite; -} -inline bool HasDescriptorMethods(const FileDescriptor* /* descriptor */, - bool enforce_lite) { - return !enforce_lite; -} - -// Should we generate generic services for this file? -inline bool HasGenericServices(const FileDescriptor* file, bool enforce_lite) { - return file->service_count() > 0 && - HasDescriptorMethods(file, enforce_lite) && - file->options().java_generic_services(); -} - -// Methods for shared bitfields. - -// Gets the name of the shared bitfield for the given index. -std::string GetBitFieldName(int index); - -// Gets the name of the shared bitfield for the given bit index. -// Effectively, GetBitFieldName(bitIndex / 32) -std::string GetBitFieldNameForBit(int bitIndex); - -// Generates the java code for the expression that returns the boolean value -// of the bit of the shared bitfields for the given bit index. -// Example: "((bitField1_ & 0x04) == 0x04)" -std::string GenerateGetBit(int bitIndex); - -// Generates the java code for the expression that sets the bit of the shared -// bitfields for the given bit index. -// Example: "bitField1_ = (bitField1_ | 0x04)" -std::string GenerateSetBit(int bitIndex); - -// Generates the java code for the expression that clears the bit of the shared -// bitfields for the given bit index. -// Example: "bitField1_ = (bitField1_ & ~0x04)" -std::string GenerateClearBit(int bitIndex); - -// Does the same as GenerateGetBit but operates on the bit field on a local -// variable. This is used by the builder to copy the value in the builder to -// the message. -// Example: "((from_bitField1_ & 0x04) == 0x04)" -std::string GenerateGetBitFromLocal(int bitIndex); - -// Does the same as GenerateSetBit but operates on the bit field on a local -// variable. This is used by the builder to copy the value in the builder to -// the message. -// Example: "to_bitField1_ = (to_bitField1_ | 0x04)" -std::string GenerateSetBitToLocal(int bitIndex); - -// Does the same as GenerateGetBit but operates on the bit field on a local -// variable. This is used by the parsing constructor to record if a repeated -// field is mutable. -// Example: "((mutable_bitField1_ & 0x04) == 0x04)" -std::string GenerateGetBitMutableLocal(int bitIndex); - -// Does the same as GenerateSetBit but operates on the bit field on a local -// variable. This is used by the parsing constructor to record if a repeated -// field is mutable. -// Example: "mutable_bitField1_ = (mutable_bitField1_ | 0x04)" -std::string GenerateSetBitMutableLocal(int bitIndex); - -// Returns whether the JavaType is a reference type. -bool IsReferenceType(JavaType type); - -// Returns the capitalized name for calling relative functions in -// CodedInputStream -const char* GetCapitalizedType(const FieldDescriptor* field, bool immutable); - -// For encodings with fixed sizes, returns that size in bytes. Otherwise -// returns -1. -int FixedSize(FieldDescriptor::Type type); - -// Comparators used to sort fields in MessageGenerator -struct FieldOrderingByNumber { - inline bool operator()(const FieldDescriptor* a, - const FieldDescriptor* b) const { - return a->number() < b->number(); - } -}; - -struct ExtensionRangeOrdering { - bool operator()(const Descriptor::ExtensionRange* a, - const Descriptor::ExtensionRange* b) const { - return a->start < b->start; - } -}; - -// Sort the fields of the given Descriptor by number into a new[]'d array -// and return it. The caller should delete the returned array. -const FieldDescriptor** SortFieldsByNumber(const Descriptor* descriptor); - -// Does this message class have any packed fields? -inline bool HasPackedFields(const Descriptor* descriptor) { - for (int i = 0; i < descriptor->field_count(); i++) { - if (descriptor->field(i)->is_packed()) { - return true; - } - } - return false; -} - -// Check a message type and its sub-message types recursively to see if any of -// them has a required field. Return true if a required field is found. -bool HasRequiredFields(const Descriptor* descriptor); - -inline bool IsProto2(const FileDescriptor* descriptor) { - return descriptor->syntax() == FileDescriptor::SYNTAX_PROTO2; -} - -inline bool IsRealOneof(const FieldDescriptor* descriptor) { - return descriptor->containing_oneof() && - !descriptor->containing_oneof()->is_synthetic(); -} - -inline bool HasHazzer(const FieldDescriptor* descriptor) { - return !descriptor->is_repeated() && - (descriptor->message_type() || descriptor->has_optional_keyword() || - IsProto2(descriptor->file()) || IsRealOneof(descriptor)); -} - -inline bool HasHasbit(const FieldDescriptor* descriptor) { - // Note that currently message fields inside oneofs have hasbits. This is - // surprising, as the oneof case should avoid any need for a hasbit. But if - // you change this method to remove hasbits for oneofs, a few tests fail. - // TODO(b/124347790): remove hasbits for oneofs - return !descriptor->is_repeated() && - (descriptor->has_optional_keyword() || IsProto2(descriptor->file())); -} - -// Whether generate classes expose public PARSER instances. -inline bool ExposePublicParser(const FileDescriptor* descriptor) { - // TODO(liujisi): Mark the PARSER private in 3.1.x releases. - return descriptor->syntax() == FileDescriptor::SYNTAX_PROTO2; -} - -// Whether unknown enum values are kept (i.e., not stored in UnknownFieldSet -// but in the message and can be queried using additional getters that return -// ints. -inline bool SupportUnknownEnumValue(const FileDescriptor* descriptor) { - return descriptor->syntax() == FileDescriptor::SYNTAX_PROTO3; -} - -inline bool SupportUnknownEnumValue(const FieldDescriptor* field) { - return field->file()->syntax() == FileDescriptor::SYNTAX_PROTO3; -} - -// Check whether a message has repeated fields. -bool HasRepeatedFields(const Descriptor* descriptor); - -inline bool IsMapEntry(const Descriptor* descriptor) { - return descriptor->options().map_entry(); -} - -inline bool IsMapField(const FieldDescriptor* descriptor) { - return descriptor->is_map(); -} - -inline bool IsAnyMessage(const Descriptor* descriptor) { - return descriptor->full_name() == "google.protobuf.Any"; -} - -inline bool IsWrappersProtoFile(const FileDescriptor* descriptor) { - return descriptor->name() == "google/protobuf/wrappers.proto"; -} - -inline bool CheckUtf8(const FieldDescriptor* descriptor) { - return descriptor->file()->syntax() == FileDescriptor::SYNTAX_PROTO3 || - descriptor->file()->options().java_string_check_utf8(); -} - -inline std::string GeneratedCodeVersionSuffix() { - return "V3"; -} - -void WriteUInt32ToUtf16CharSequence(uint32_t number, - std::vector* output); - -inline void WriteIntToUtf16CharSequence(int value, - std::vector* output) { - WriteUInt32ToUtf16CharSequence(static_cast(value), output); -} - -// Escape a UTF-16 character so it can be embedded in a Java string literal. -void EscapeUtf16ToString(uint16_t code, std::string* output); - -// Only the lowest two bytes of the return value are used. The lowest byte -// is the integer value of a j/c/g/protobuf/FieldType enum. For the other -// byte: -// bit 0: whether the field is required. -// bit 1: whether the field requires UTF-8 validation. -// bit 2: whether the field needs isInitialized check. -// bit 3: whether the field is a map field with proto2 enum value. -// bits 4-7: unused -int GetExperimentalJavaFieldType(const FieldDescriptor* field); - -// To get the total number of entries need to be built for experimental runtime -// and the first field number that are not in the table part -std::pair GetTableDrivenNumberOfEntriesAndLookUpStartFieldNumber( - const FieldDescriptor** fields, int count); -} // namespace java -} // namespace compiler -} // namespace protobuf -} // namespace google - -#endif // GOOGLE_PROTOBUF_COMPILER_JAVA_HELPERS_H__ diff --git a/extra/protobuf/protobuf-3.19.4/src/google/protobuf/compiler/java/java_kotlin_generator.cc b/extra/protobuf/protobuf-3.19.4/src/google/protobuf/compiler/java/java_kotlin_generator.cc deleted file mode 100644 index 8d262a018aff..000000000000 --- a/extra/protobuf/protobuf-3.19.4/src/google/protobuf/compiler/java/java_kotlin_generator.cc +++ /dev/null @@ -1,162 +0,0 @@ -// Protocol Buffers - Google's data interchange format -// Copyright 2008 Google Inc. All rights reserved. -// https://developers.google.com/protocol-buffers/ -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// * Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// * Redistributions in binary form must reproduce the above -// copyright notice, this list of conditions and the following disclaimer -// in the documentation and/or other materials provided with the -// distribution. -// * Neither the name of Google Inc. nor the names of its -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -#include - -#include -#include -#include -#include -#include - -namespace google { -namespace protobuf { -namespace compiler { -namespace java { - -KotlinGenerator::KotlinGenerator() {} -KotlinGenerator::~KotlinGenerator() {} - -uint64_t KotlinGenerator::GetSupportedFeatures() const { - return CodeGenerator::Feature::FEATURE_PROTO3_OPTIONAL; -} - -bool KotlinGenerator::Generate(const FileDescriptor* file, - const std::string& parameter, - GeneratorContext* context, - std::string* error) const { - // ----------------------------------------------------------------- - // parse generator options - - std::vector > options; - ParseGeneratorParameter(parameter, &options); - Options file_options; - - for (auto& option : options) { - if (option.first == "output_list_file") { - file_options.output_list_file = option.second; - } else if (option.first == "immutable") { - file_options.generate_immutable_code = true; - } else if (option.first == "mutable") { - *error = "Mutable not supported by Kotlin generator"; - return false; - } else if (option.first == "shared") { - file_options.generate_shared_code = true; - } else if (option.first == "lite") { - file_options.enforce_lite = true; - } else if (option.first == "annotate_code") { - file_options.annotate_code = true; - } else if (option.first == "annotation_list_file") { - file_options.annotation_list_file = option.second; - } else { - *error = "Unknown generator option: " + option.first; - return false; - } - } - - // By default we generate immutable code and shared code for immutable API. - if (!file_options.generate_immutable_code && - !file_options.generate_shared_code) { - file_options.generate_immutable_code = true; - file_options.generate_shared_code = true; - } - - std::vector all_files; - std::vector all_annotations; - - std::unique_ptr file_generator; - if (file_options.generate_immutable_code) { - file_generator.reset( - new FileGenerator(file, file_options, /* immutable_api = */ true)); - } - - if (!file_generator->Validate(error)) { - return false; - } - - auto open_file = [context](const std::string& filename) { - return std::unique_ptr(context->Open(filename)); - }; - std::string package_dir = JavaPackageToDir(file_generator->java_package()); - std::string kotlin_filename = package_dir; - kotlin_filename += file_generator->GetKotlinClassname(); - kotlin_filename += ".kt"; - all_files.push_back(kotlin_filename); - std::string info_full_path = kotlin_filename + ".pb.meta"; - if (file_options.annotate_code) { - all_annotations.push_back(info_full_path); - } - - // Generate main kotlin file. - auto output = open_file(kotlin_filename); - GeneratedCodeInfo annotations; - io::AnnotationProtoCollector annotation_collector( - &annotations); - io::Printer printer( - output.get(), '$', - file_options.annotate_code ? &annotation_collector : nullptr); - - file_generator->GenerateKotlinSiblings(package_dir, context, &all_files, - &all_annotations); - - if (file_options.annotate_code) { - auto info_output = open_file(info_full_path); - annotations.SerializeToZeroCopyStream(info_output.get()); - } - - // Generate output list if requested. - if (!file_options.output_list_file.empty()) { - // Generate output list. This is just a simple text file placed in a - // deterministic location which lists the .kt files being generated. - auto srclist_raw_output = open_file(file_options.output_list_file); - io::Printer srclist_printer(srclist_raw_output.get(), '$'); - for (auto& all_file : all_files) { - srclist_printer.Print("$filename$\n", "filename", all_file); - } - } - - if (!file_options.annotation_list_file.empty()) { - // Generate output list. This is just a simple text file placed in a - // deterministic location which lists the .kt files being generated. - auto annotation_list_raw_output = - open_file(file_options.annotation_list_file); - io::Printer annotation_list_printer(annotation_list_raw_output.get(), '$'); - for (auto& all_annotation : all_annotations) { - annotation_list_printer.Print("$filename$\n", "filename", all_annotation); - } - } - - return true; -} - -} // namespace java -} // namespace compiler -} // namespace protobuf -} // namespace google diff --git a/extra/protobuf/protobuf-3.19.4/src/google/protobuf/compiler/java/java_kotlin_generator.h b/extra/protobuf/protobuf-3.19.4/src/google/protobuf/compiler/java/java_kotlin_generator.h deleted file mode 100644 index 66e32b9e0010..000000000000 --- a/extra/protobuf/protobuf-3.19.4/src/google/protobuf/compiler/java/java_kotlin_generator.h +++ /dev/null @@ -1,72 +0,0 @@ -// Protocol Buffers - Google's data interchange format -// Copyright 2008 Google Inc. All rights reserved. -// https://developers.google.com/protocol-buffers/ -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// * Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// * Redistributions in binary form must reproduce the above -// copyright notice, this list of conditions and the following disclaimer -// in the documentation and/or other materials provided with the -// distribution. -// * Neither the name of Google Inc. nor the names of its -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -// Generates Kotlin code for a given .proto file. - -#ifndef GOOGLE_PROTOBUF_COMPILER_JAVA_KOTLIN_GENERATOR_H__ -#define GOOGLE_PROTOBUF_COMPILER_JAVA_KOTLIN_GENERATOR_H__ - -#include - -#include -#include - -namespace google { -namespace protobuf { -namespace compiler { -namespace java { - -// CodeGenerator implementation which generates Kotlin code. If you create your -// own protocol compiler binary and you want it to support Kotlin output, you -// can do so by registering an instance of this CodeGenerator with the -// CommandLineInterface in your main() function. -class PROTOC_EXPORT KotlinGenerator : public CodeGenerator { - public: - KotlinGenerator(); - ~KotlinGenerator() override; - - // implements CodeGenerator ---------------------------------------- - bool Generate(const FileDescriptor* file, const std::string& parameter, - GeneratorContext* context, std::string* error) const override; - - uint64_t GetSupportedFeatures() const override; - - private: - GOOGLE_DISALLOW_EVIL_CONSTRUCTORS(KotlinGenerator); -}; - -} // namespace java -} // namespace compiler -} // namespace protobuf -} // namespace google - -#include - -#endif // GOOGLE_PROTOBUF_COMPILER_JAVA_KOTLIN_GENERATOR_H__ diff --git a/extra/protobuf/protobuf-3.19.4/src/google/protobuf/compiler/java/java_map_field.cc b/extra/protobuf/protobuf-3.19.4/src/google/protobuf/compiler/java/java_map_field.cc deleted file mode 100644 index 8a8910071411..000000000000 --- a/extra/protobuf/protobuf-3.19.4/src/google/protobuf/compiler/java/java_map_field.cc +++ /dev/null @@ -1,876 +0,0 @@ -// Protocol Buffers - Google's data interchange format -// Copyright 2008 Google Inc. All rights reserved. -// https://developers.google.com/protocol-buffers/ -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// * Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// * Redistributions in binary form must reproduce the above -// copyright notice, this list of conditions and the following disclaimer -// in the documentation and/or other materials provided with the -// distribution. -// * Neither the name of Google Inc. nor the names of its -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -#include - -#include -#include -#include -#include -#include - -namespace google { -namespace protobuf { -namespace compiler { -namespace java { - -namespace { - -const FieldDescriptor* KeyField(const FieldDescriptor* descriptor) { - GOOGLE_CHECK_EQ(FieldDescriptor::TYPE_MESSAGE, descriptor->type()); - const Descriptor* message = descriptor->message_type(); - GOOGLE_CHECK(message->options().map_entry()); - return message->FindFieldByName("key"); -} - -const FieldDescriptor* ValueField(const FieldDescriptor* descriptor) { - GOOGLE_CHECK_EQ(FieldDescriptor::TYPE_MESSAGE, descriptor->type()); - const Descriptor* message = descriptor->message_type(); - GOOGLE_CHECK(message->options().map_entry()); - return message->FindFieldByName("value"); -} - -std::string TypeName(const FieldDescriptor* field, - ClassNameResolver* name_resolver, bool boxed) { - if (GetJavaType(field) == JAVATYPE_MESSAGE) { - return name_resolver->GetImmutableClassName(field->message_type()); - } else if (GetJavaType(field) == JAVATYPE_ENUM) { - return name_resolver->GetImmutableClassName(field->enum_type()); - } else { - return boxed ? BoxedPrimitiveTypeName(GetJavaType(field)) - : PrimitiveTypeName(GetJavaType(field)); - } -} - -std::string KotlinTypeName(const FieldDescriptor* field, - ClassNameResolver* name_resolver) { - if (GetJavaType(field) == JAVATYPE_MESSAGE) { - return name_resolver->GetImmutableClassName(field->message_type()); - } else if (GetJavaType(field) == JAVATYPE_ENUM) { - return name_resolver->GetImmutableClassName(field->enum_type()); - } else { - return KotlinTypeName(GetJavaType(field)); - } -} - -std::string WireType(const FieldDescriptor* field) { - return "com.google.protobuf.WireFormat.FieldType." + - std::string(FieldTypeName(field->type())); -} - -void SetMessageVariables(const FieldDescriptor* descriptor, int messageBitIndex, - int builderBitIndex, const FieldGeneratorInfo* info, - Context* context, - std::map* variables) { - SetCommonFieldVariables(descriptor, info, variables); - ClassNameResolver* name_resolver = context->GetNameResolver(); - - (*variables)["type"] = - name_resolver->GetImmutableClassName(descriptor->message_type()); - const FieldDescriptor* key = KeyField(descriptor); - const FieldDescriptor* value = ValueField(descriptor); - const JavaType keyJavaType = GetJavaType(key); - const JavaType valueJavaType = GetJavaType(value); - - (*variables)["key_type"] = TypeName(key, name_resolver, false); - std::string boxed_key_type = TypeName(key, name_resolver, true); - (*variables)["boxed_key_type"] = boxed_key_type; - (*variables)["kt_key_type"] = KotlinTypeName(key, name_resolver); - (*variables)["kt_value_type"] = KotlinTypeName(value, name_resolver); - // Used for calling the serialization function. - (*variables)["short_key_type"] = - boxed_key_type.substr(boxed_key_type.rfind('.') + 1); - (*variables)["key_wire_type"] = WireType(key); - (*variables)["key_default_value"] = DefaultValue(key, true, name_resolver); - (*variables)["key_null_check"] = - IsReferenceType(keyJavaType) - ? "if (key == null) { throw new NullPointerException(\"map key\"); }" - : ""; - (*variables)["value_null_check"] = - valueJavaType != JAVATYPE_ENUM && IsReferenceType(valueJavaType) - ? "if (value == null) {\n" - " throw new NullPointerException(\"map value\");\n" - "}\n" - : ""; - if (valueJavaType == JAVATYPE_ENUM) { - // We store enums as Integers internally. - (*variables)["value_type"] = "int"; - (*variables)["boxed_value_type"] = "java.lang.Integer"; - (*variables)["value_wire_type"] = WireType(value); - (*variables)["value_default_value"] = - DefaultValue(value, true, name_resolver) + ".getNumber()"; - - (*variables)["value_enum_type"] = TypeName(value, name_resolver, false); - - if (SupportUnknownEnumValue(descriptor->file())) { - // Map unknown values to a special UNRECOGNIZED value if supported. - (*variables)["unrecognized_value"] = - (*variables)["value_enum_type"] + ".UNRECOGNIZED"; - } else { - // Map unknown values to the default value if we don't have UNRECOGNIZED. - (*variables)["unrecognized_value"] = - DefaultValue(value, true, name_resolver); - } - } else { - (*variables)["value_type"] = TypeName(value, name_resolver, false); - (*variables)["boxed_value_type"] = TypeName(value, name_resolver, true); - (*variables)["value_wire_type"] = WireType(value); - (*variables)["value_default_value"] = - DefaultValue(value, true, name_resolver); - } - (*variables)["type_parameters"] = - (*variables)["boxed_key_type"] + ", " + (*variables)["boxed_value_type"]; - // TODO(birdo): Add @deprecated javadoc when generating javadoc is supported - // by the proto compiler - (*variables)["deprecation"] = - descriptor->options().deprecated() ? "@java.lang.Deprecated " : ""; - (*variables)["kt_deprecation"] = - descriptor->options().deprecated() - ? "@kotlin.Deprecated(message = \"Field " + (*variables)["name"] + - " is deprecated\") " - : ""; - (*variables)["on_changed"] = "onChanged();"; - - // For repeated fields, one bit is used for whether the array is immutable - // in the parsing constructor. - (*variables)["get_mutable_bit_parser"] = - GenerateGetBitMutableLocal(builderBitIndex); - (*variables)["set_mutable_bit_parser"] = - GenerateSetBitMutableLocal(builderBitIndex); - - (*variables)["default_entry"] = - (*variables)["capitalized_name"] + "DefaultEntryHolder.defaultEntry"; - (*variables)["map_field_parameter"] = (*variables)["default_entry"]; - (*variables)["descriptor"] = - name_resolver->GetImmutableClassName(descriptor->file()) + ".internal_" + - UniqueFileScopeIdentifier(descriptor->message_type()) + "_descriptor, "; - (*variables)["ver"] = GeneratedCodeVersionSuffix(); -} - -} // namespace - -ImmutableMapFieldGenerator::ImmutableMapFieldGenerator( - const FieldDescriptor* descriptor, int messageBitIndex, int builderBitIndex, - Context* context) - : descriptor_(descriptor), name_resolver_(context->GetNameResolver()) { - SetMessageVariables(descriptor, messageBitIndex, builderBitIndex, - context->GetFieldGeneratorInfo(descriptor), context, - &variables_); -} - -ImmutableMapFieldGenerator::~ImmutableMapFieldGenerator() {} - -int ImmutableMapFieldGenerator::GetNumBitsForMessage() const { return 0; } - -int ImmutableMapFieldGenerator::GetNumBitsForBuilder() const { return 1; } - -void ImmutableMapFieldGenerator::GenerateInterfaceMembers( - io::Printer* printer) const { - WriteFieldDocComment(printer, descriptor_); - printer->Print(variables_, - "$deprecation$int ${$get$capitalized_name$Count$}$();\n"); - printer->Annotate("{", "}", descriptor_); - WriteFieldDocComment(printer, descriptor_); - printer->Print(variables_, - "$deprecation$boolean ${$contains$capitalized_name$$}$(\n" - " $key_type$ key);\n"); - printer->Annotate("{", "}", descriptor_); - if (GetJavaType(ValueField(descriptor_)) == JAVATYPE_ENUM) { - printer->Print(variables_, - "/**\n" - " * Use {@link #get$capitalized_name$Map()} instead.\n" - " */\n" - "@java.lang.Deprecated\n" - "java.util.Map<$boxed_key_type$, $value_enum_type$>\n" - "${$get$capitalized_name$$}$();\n"); - printer->Annotate("{", "}", descriptor_); - WriteFieldDocComment(printer, descriptor_); - printer->Print( - variables_, - "$deprecation$java.util.Map<$boxed_key_type$, $value_enum_type$>\n" - "${$get$capitalized_name$Map$}$();\n"); - printer->Annotate("{", "}", descriptor_); - WriteFieldDocComment(printer, descriptor_); - printer->Print( - variables_, - "$deprecation$$value_enum_type$ ${$get$capitalized_name$OrDefault$}$(\n" - " $key_type$ key,\n" - " $value_enum_type$ defaultValue);\n"); - printer->Annotate("{", "}", descriptor_); - WriteFieldDocComment(printer, descriptor_); - printer->Print( - variables_, - "$deprecation$$value_enum_type$ ${$get$capitalized_name$OrThrow$}$(\n" - " $key_type$ key);\n"); - printer->Annotate("{", "}", descriptor_); - if (SupportUnknownEnumValue(descriptor_->file())) { - printer->Print( - variables_, - "/**\n" - " * Use {@link #get$capitalized_name$ValueMap()} instead.\n" - " */\n" - "@java.lang.Deprecated\n" - "java.util.Map<$type_parameters$>\n" - "${$get$capitalized_name$Value$}$();\n"); - printer->Annotate("{", "}", descriptor_); - WriteFieldDocComment(printer, descriptor_); - printer->Print(variables_, - "$deprecation$java.util.Map<$type_parameters$>\n" - "${$get$capitalized_name$ValueMap$}$();\n"); - printer->Annotate("{", "}", descriptor_); - WriteFieldDocComment(printer, descriptor_); - printer->Print(variables_, - "$deprecation$\n" - "$value_type$ ${$get$capitalized_name$ValueOrDefault$}$(\n" - " $key_type$ key,\n" - " $value_type$ defaultValue);\n"); - printer->Annotate("{", "}", descriptor_); - WriteFieldDocComment(printer, descriptor_); - printer->Print(variables_, - "$deprecation$\n" - "$value_type$ ${$get$capitalized_name$ValueOrThrow$}$(\n" - " $key_type$ key);\n"); - printer->Annotate("{", "}", descriptor_); - } - } else { - printer->Print(variables_, - "/**\n" - " * Use {@link #get$capitalized_name$Map()} instead.\n" - " */\n" - "@java.lang.Deprecated\n" - "java.util.Map<$type_parameters$>\n" - "${$get$capitalized_name$$}$();\n"); - printer->Annotate("{", "}", descriptor_); - WriteFieldDocComment(printer, descriptor_); - printer->Print(variables_, - "$deprecation$java.util.Map<$type_parameters$>\n" - "${$get$capitalized_name$Map$}$();\n"); - printer->Annotate("{", "}", descriptor_); - WriteFieldDocComment(printer, descriptor_); - printer->Print(variables_, - "$deprecation$\n" - "$value_type$ ${$get$capitalized_name$OrDefault$}$(\n" - " $key_type$ key,\n" - " $value_type$ defaultValue);\n"); - printer->Annotate("{", "}", descriptor_); - WriteFieldDocComment(printer, descriptor_); - printer->Print(variables_, - "$deprecation$\n" - "$value_type$ ${$get$capitalized_name$OrThrow$}$(\n" - " $key_type$ key);\n"); - printer->Annotate("{", "}", descriptor_); - } -} - -void ImmutableMapFieldGenerator::GenerateMembers(io::Printer* printer) const { - printer->Print( - variables_, - "private static final class $capitalized_name$DefaultEntryHolder {\n" - " static final com.google.protobuf.MapEntry<\n" - " $type_parameters$> defaultEntry =\n" - " com.google.protobuf.MapEntry\n" - " .<$type_parameters$>newDefaultInstance(\n" - " $descriptor$\n" - " $key_wire_type$,\n" - " $key_default_value$,\n" - " $value_wire_type$,\n" - " $value_default_value$);\n" - "}\n"); - printer->Print(variables_, - "private com.google.protobuf.MapField<\n" - " $type_parameters$> $name$_;\n" - "private com.google.protobuf.MapField<$type_parameters$>\n" - "internalGet$capitalized_name$() {\n" - " if ($name$_ == null) {\n" - " return com.google.protobuf.MapField.emptyMapField(\n" - " $map_field_parameter$);\n" - " }\n" - " return $name$_;\n" - "}\n"); - if (GetJavaType(ValueField(descriptor_)) == JAVATYPE_ENUM) { - printer->Print( - variables_, - "private static final\n" - "com.google.protobuf.Internal.MapAdapter.Converter<\n" - " java.lang.Integer, $value_enum_type$> $name$ValueConverter =\n" - " com.google.protobuf.Internal.MapAdapter.newEnumConverter(\n" - " $value_enum_type$.internalGetValueMap(),\n" - " $unrecognized_value$);\n"); - printer->Print( - variables_, - "private static final java.util.Map<$boxed_key_type$, " - "$value_enum_type$>\n" - "internalGetAdapted$capitalized_name$Map(\n" - " java.util.Map<$boxed_key_type$, $boxed_value_type$> map) {\n" - " return new com.google.protobuf.Internal.MapAdapter<\n" - " $boxed_key_type$, $value_enum_type$, java.lang.Integer>(\n" - " map, $name$ValueConverter);\n" - "}\n"); - } - GenerateMapGetters(printer); -} - -void ImmutableMapFieldGenerator::GenerateBuilderMembers( - io::Printer* printer) const { - printer->Print(variables_, - "private com.google.protobuf.MapField<\n" - " $type_parameters$> $name$_;\n" - "private com.google.protobuf.MapField<$type_parameters$>\n" - "internalGet$capitalized_name$() {\n" - " if ($name$_ == null) {\n" - " return com.google.protobuf.MapField.emptyMapField(\n" - " $map_field_parameter$);\n" - " }\n" - " return $name$_;\n" - "}\n" - "private com.google.protobuf.MapField<$type_parameters$>\n" - "internalGetMutable$capitalized_name$() {\n" - " $on_changed$;\n" - " if ($name$_ == null) {\n" - " $name$_ = com.google.protobuf.MapField.newMapField(\n" - " $map_field_parameter$);\n" - " }\n" - " if (!$name$_.isMutable()) {\n" - " $name$_ = $name$_.copy();\n" - " }\n" - " return $name$_;\n" - "}\n"); - GenerateMapGetters(printer); - printer->Print(variables_, - "$deprecation$\n" - "public Builder ${$clear$capitalized_name$$}$() {\n" - " internalGetMutable$capitalized_name$().getMutableMap()\n" - " .clear();\n" - " return this;\n" - "}\n"); - printer->Annotate("{", "}", descriptor_); - WriteFieldDocComment(printer, descriptor_); - printer->Print(variables_, - "$deprecation$\n" - "public Builder ${$remove$capitalized_name$$}$(\n" - " $key_type$ key) {\n" - " $key_null_check$\n" - " internalGetMutable$capitalized_name$().getMutableMap()\n" - " .remove(key);\n" - " return this;\n" - "}\n"); - printer->Annotate("{", "}", descriptor_); - if (GetJavaType(ValueField(descriptor_)) == JAVATYPE_ENUM) { - printer->Print( - variables_, - "/**\n" - " * Use alternate mutation accessors instead.\n" - " */\n" - "@java.lang.Deprecated\n" - "public java.util.Map<$boxed_key_type$, $value_enum_type$>\n" - "${$getMutable$capitalized_name$$}$() {\n" - " return internalGetAdapted$capitalized_name$Map(\n" - " internalGetMutable$capitalized_name$().getMutableMap());\n" - "}\n"); - printer->Annotate("{", "}", descriptor_); - WriteFieldDocComment(printer, descriptor_); - printer->Print(variables_, - "$deprecation$public Builder ${$put$capitalized_name$$}$(\n" - " $key_type$ key,\n" - " $value_enum_type$ value) {\n" - " $key_null_check$\n" - " $value_null_check$\n" - " internalGetMutable$capitalized_name$().getMutableMap()\n" - " .put(key, $name$ValueConverter.doBackward(value));\n" - " return this;\n" - "}\n"); - printer->Annotate("{", "}", descriptor_); - WriteFieldDocComment(printer, descriptor_); - printer->Print( - variables_, - "$deprecation$public Builder ${$putAll$capitalized_name$$}$(\n" - " java.util.Map<$boxed_key_type$, $value_enum_type$> values) {\n" - " internalGetAdapted$capitalized_name$Map(\n" - " internalGetMutable$capitalized_name$().getMutableMap())\n" - " .putAll(values);\n" - " return this;\n" - "}\n"); - printer->Annotate("{", "}", descriptor_); - if (SupportUnknownEnumValue(descriptor_->file())) { - printer->Print( - variables_, - "/**\n" - " * Use alternate mutation accessors instead.\n" - " */\n" - "@java.lang.Deprecated\n" - "public java.util.Map<$boxed_key_type$, $boxed_value_type$>\n" - "${$getMutable$capitalized_name$Value$}$() {\n" - " return internalGetMutable$capitalized_name$().getMutableMap();\n" - "}\n"); - printer->Annotate("{", "}", descriptor_); - WriteFieldDocComment(printer, descriptor_); - printer->Print( - variables_, - "$deprecation$public Builder ${$put$capitalized_name$Value$}$(\n" - " $key_type$ key,\n" - " $value_type$ value) {\n" - " $key_null_check$\n" - " $value_null_check$\n" - " internalGetMutable$capitalized_name$().getMutableMap()\n" - " .put(key, value);\n" - " return this;\n" - "}\n"); - printer->Annotate("{", "}", descriptor_); - WriteFieldDocComment(printer, descriptor_); - printer->Print( - variables_, - "$deprecation$public Builder ${$putAll$capitalized_name$Value$}$(\n" - " java.util.Map<$boxed_key_type$, $boxed_value_type$> values) {\n" - " internalGetMutable$capitalized_name$().getMutableMap()\n" - " .putAll(values);\n" - " return this;\n" - "}\n"); - printer->Annotate("{", "}", descriptor_); - } - } else { - printer->Print( - variables_, - "/**\n" - " * Use alternate mutation accessors instead.\n" - " */\n" - "@java.lang.Deprecated\n" - "public java.util.Map<$type_parameters$>\n" - "${$getMutable$capitalized_name$$}$() {\n" - " return internalGetMutable$capitalized_name$().getMutableMap();\n" - "}\n"); - printer->Annotate("{", "}", descriptor_); - WriteFieldDocComment(printer, descriptor_); - printer->Print(variables_, - "$deprecation$" - "public Builder ${$put$capitalized_name$$}$(\n" - " $key_type$ key,\n" - " $value_type$ value) {\n" - " $key_null_check$\n" - " $value_null_check$\n" - " internalGetMutable$capitalized_name$().getMutableMap()\n" - " .put(key, value);\n" - " return this;\n" - "}\n"); - printer->Annotate("{", "}", descriptor_); - WriteFieldDocComment(printer, descriptor_); - printer->Print(variables_, - "$deprecation$\n" - "public Builder ${$putAll$capitalized_name$$}$(\n" - " java.util.Map<$type_parameters$> values) {\n" - " internalGetMutable$capitalized_name$().getMutableMap()\n" - " .putAll(values);\n" - " return this;\n" - "}\n"); - printer->Annotate("{", "}", descriptor_); - } -} - -void ImmutableMapFieldGenerator::GenerateMapGetters( - io::Printer* printer) const { - printer->Print(variables_, - "$deprecation$\n" - "public int ${$get$capitalized_name$Count$}$() {\n" - " return internalGet$capitalized_name$().getMap().size();\n" - "}\n"); - printer->Annotate("{", "}", descriptor_); - WriteFieldDocComment(printer, descriptor_); - printer->Print( - variables_, - "$deprecation$\n" - "@java.lang.Override\n" - "public boolean ${$contains$capitalized_name$$}$(\n" - " $key_type$ key) {\n" - " $key_null_check$\n" - " return internalGet$capitalized_name$().getMap().containsKey(key);\n" - "}\n"); - printer->Annotate("{", "}", descriptor_); - if (GetJavaType(ValueField(descriptor_)) == JAVATYPE_ENUM) { - printer->Print(variables_, - "/**\n" - " * Use {@link #get$capitalized_name$Map()} instead.\n" - " */\n" - "@java.lang.Override\n" - "@java.lang.Deprecated\n" - "public java.util.Map<$boxed_key_type$, $value_enum_type$>\n" - "${$get$capitalized_name$$}$() {\n" - " return get$capitalized_name$Map();\n" - "}\n"); - printer->Annotate("{", "}", descriptor_); - WriteFieldDocComment(printer, descriptor_); - printer->Print(variables_, - "@java.lang.Override\n" - "$deprecation$\n" - "public java.util.Map<$boxed_key_type$, $value_enum_type$>\n" - "${$get$capitalized_name$Map$}$() {\n" - " return internalGetAdapted$capitalized_name$Map(\n" - " internalGet$capitalized_name$().getMap());" - "}\n"); - printer->Annotate("{", "}", descriptor_); - WriteFieldDocComment(printer, descriptor_); - printer->Print( - variables_, - "@java.lang.Override\n" - "$deprecation$\n" - "public $value_enum_type$ ${$get$capitalized_name$OrDefault$}$(\n" - " $key_type$ key,\n" - " $value_enum_type$ defaultValue) {\n" - " $key_null_check$\n" - " java.util.Map<$boxed_key_type$, $boxed_value_type$> map =\n" - " internalGet$capitalized_name$().getMap();\n" - " return map.containsKey(key)\n" - " ? $name$ValueConverter.doForward(map.get(key))\n" - " : defaultValue;\n" - "}\n"); - printer->Annotate("{", "}", descriptor_); - WriteFieldDocComment(printer, descriptor_); - printer->Print( - variables_, - "@java.lang.Override\n" - "$deprecation$\n" - "public $value_enum_type$ ${$get$capitalized_name$OrThrow$}$(\n" - " $key_type$ key) {\n" - " $key_null_check$\n" - " java.util.Map<$boxed_key_type$, $boxed_value_type$> map =\n" - " internalGet$capitalized_name$().getMap();\n" - " if (!map.containsKey(key)) {\n" - " throw new java.lang.IllegalArgumentException();\n" - " }\n" - " return $name$ValueConverter.doForward(map.get(key));\n" - "}\n"); - printer->Annotate("{", "}", descriptor_); - if (SupportUnknownEnumValue(descriptor_->file())) { - printer->Print( - variables_, - "/**\n" - " * Use {@link #get$capitalized_name$ValueMap()} instead.\n" - " */\n" - "@java.lang.Override\n" - "@java.lang.Deprecated\n" - "public java.util.Map<$boxed_key_type$, $boxed_value_type$>\n" - "${$get$capitalized_name$Value$}$() {\n" - " return get$capitalized_name$ValueMap();\n" - "}\n"); - printer->Annotate("{", "}", descriptor_); - WriteFieldDocComment(printer, descriptor_); - printer->Print( - variables_, - "@java.lang.Override\n" - "$deprecation$\n" - "public java.util.Map<$boxed_key_type$, $boxed_value_type$>\n" - "${$get$capitalized_name$ValueMap$}$() {\n" - " return internalGet$capitalized_name$().getMap();\n" - "}\n"); - printer->Annotate("{", "}", descriptor_); - WriteFieldDocComment(printer, descriptor_); - printer->Print( - variables_, - "@java.lang.Override\n" - "$deprecation$\n" - "public $value_type$ ${$get$capitalized_name$ValueOrDefault$}$(\n" - " $key_type$ key,\n" - " $value_type$ defaultValue) {\n" - " $key_null_check$\n" - " java.util.Map<$boxed_key_type$, $boxed_value_type$> map =\n" - " internalGet$capitalized_name$().getMap();\n" - " return map.containsKey(key) ? map.get(key) : defaultValue;\n" - "}\n"); - printer->Annotate("{", "}", descriptor_); - WriteFieldDocComment(printer, descriptor_); - printer->Print( - variables_, - "@java.lang.Override\n" - "$deprecation$\n" - "public $value_type$ ${$get$capitalized_name$ValueOrThrow$}$(\n" - " $key_type$ key) {\n" - " $key_null_check$\n" - " java.util.Map<$boxed_key_type$, $boxed_value_type$> map =\n" - " internalGet$capitalized_name$().getMap();\n" - " if (!map.containsKey(key)) {\n" - " throw new java.lang.IllegalArgumentException();\n" - " }\n" - " return map.get(key);\n" - "}\n"); - printer->Annotate("{", "}", descriptor_); - } - } else { - printer->Print(variables_, - "/**\n" - " * Use {@link #get$capitalized_name$Map()} instead.\n" - " */\n" - "@java.lang.Override\n" - "@java.lang.Deprecated\n" - "public java.util.Map<$type_parameters$> " - "${$get$capitalized_name$$}$() {\n" - " return get$capitalized_name$Map();\n" - "}\n"); - printer->Annotate("{", "}", descriptor_); - WriteFieldDocComment(printer, descriptor_); - printer->Print(variables_, - "@java.lang.Override\n" - "$deprecation$\n" - "public java.util.Map<$type_parameters$> " - "${$get$capitalized_name$Map$}$() {\n" - " return internalGet$capitalized_name$().getMap();\n" - "}\n"); - printer->Annotate("{", "}", descriptor_); - WriteFieldDocComment(printer, descriptor_); - printer->Print( - variables_, - "@java.lang.Override\n" - "$deprecation$\n" - "public $value_type$ ${$get$capitalized_name$OrDefault$}$(\n" - " $key_type$ key,\n" - " $value_type$ defaultValue) {\n" - " $key_null_check$\n" - " java.util.Map<$type_parameters$> map =\n" - " internalGet$capitalized_name$().getMap();\n" - " return map.containsKey(key) ? map.get(key) : defaultValue;\n" - "}\n"); - printer->Annotate("{", "}", descriptor_); - WriteFieldDocComment(printer, descriptor_); - printer->Print(variables_, - "@java.lang.Override\n" - "$deprecation$\n" - "public $value_type$ ${$get$capitalized_name$OrThrow$}$(\n" - " $key_type$ key) {\n" - " $key_null_check$\n" - " java.util.Map<$type_parameters$> map =\n" - " internalGet$capitalized_name$().getMap();\n" - " if (!map.containsKey(key)) {\n" - " throw new java.lang.IllegalArgumentException();\n" - " }\n" - " return map.get(key);\n" - "}\n"); - printer->Annotate("{", "}", descriptor_); - } -} - -void ImmutableMapFieldGenerator::GenerateKotlinDslMembers( - io::Printer* printer) const { - printer->Print( - variables_, - "/**\n" - " * An uninstantiable, behaviorless type to represent the field in\n" - " * generics.\n" - " */\n" - "@kotlin.OptIn" - "(com.google.protobuf.kotlin.OnlyForUseByGeneratedProtoCode::class)\n" - "public class ${$$kt_capitalized_name$Proxy$}$ private constructor()" - " : com.google.protobuf.kotlin.DslProxy()\n"); - - WriteFieldDocComment(printer, descriptor_); - printer->Print( - variables_, - "$kt_deprecation$ public val $kt_name$: " - "com.google.protobuf.kotlin.DslMap" - "<$kt_key_type$, $kt_value_type$, ${$$kt_capitalized_name$Proxy$}$>\n" - " @kotlin.jvm.JvmSynthetic\n" - " @JvmName(\"get$kt_capitalized_name$Map\")\n" - " get() = com.google.protobuf.kotlin.DslMap(\n" - " $kt_dsl_builder$.${$get$capitalized_name$Map$}$()\n" - " )\n"); - - WriteFieldDocComment(printer, descriptor_); - printer->Print( - variables_, - "@JvmName(\"put$kt_capitalized_name$\")\n" - "public fun com.google.protobuf.kotlin.DslMap" - "<$kt_key_type$, $kt_value_type$, ${$$kt_capitalized_name$Proxy$}$>\n" - " .put(key: $kt_key_type$, value: $kt_value_type$) {\n" - " $kt_dsl_builder$.${$put$capitalized_name$$}$(key, value)\n" - " }\n"); - - WriteFieldDocComment(printer, descriptor_); - printer->Print( - variables_, - "@kotlin.jvm.JvmSynthetic\n" - "@JvmName(\"set$kt_capitalized_name$\")\n" - "@Suppress(\"NOTHING_TO_INLINE\")\n" - "public inline operator fun com.google.protobuf.kotlin.DslMap" - "<$kt_key_type$, $kt_value_type$, ${$$kt_capitalized_name$Proxy$}$>\n" - " .set(key: $kt_key_type$, value: $kt_value_type$) {\n" - " put(key, value)\n" - " }\n"); - - WriteFieldDocComment(printer, descriptor_); - printer->Print( - variables_, - "@kotlin.jvm.JvmSynthetic\n" - "@JvmName(\"remove$kt_capitalized_name$\")\n" - "public fun com.google.protobuf.kotlin.DslMap" - "<$kt_key_type$, $kt_value_type$, ${$$kt_capitalized_name$Proxy$}$>\n" - " .remove(key: $kt_key_type$) {\n" - " $kt_dsl_builder$.${$remove$capitalized_name$$}$(key)\n" - " }\n"); - - WriteFieldDocComment(printer, descriptor_); - printer->Print( - variables_, - "@kotlin.jvm.JvmSynthetic\n" - "@JvmName(\"putAll$kt_capitalized_name$\")\n" - "public fun com.google.protobuf.kotlin.DslMap" - "<$kt_key_type$, $kt_value_type$, ${$$kt_capitalized_name$Proxy$}$>\n" - " .putAll(map: kotlin.collections.Map<$kt_key_type$, $kt_value_type$>) " - "{\n" - " $kt_dsl_builder$.${$putAll$capitalized_name$$}$(map)\n" - " }\n"); - - WriteFieldDocComment(printer, descriptor_); - printer->Print( - variables_, - "@kotlin.jvm.JvmSynthetic\n" - "@JvmName(\"clear$kt_capitalized_name$\")\n" - "public fun com.google.protobuf.kotlin.DslMap" - "<$kt_key_type$, $kt_value_type$, ${$$kt_capitalized_name$Proxy$}$>\n" - " .clear() {\n" - " $kt_dsl_builder$.${$clear$capitalized_name$$}$()\n" - " }\n"); -} - -void ImmutableMapFieldGenerator::GenerateFieldBuilderInitializationCode( - io::Printer* printer) const { - // Nothing to initialize. -} - -void ImmutableMapFieldGenerator::GenerateInitializationCode( - io::Printer* printer) const { - // Nothing to initialize. -} - -void ImmutableMapFieldGenerator::GenerateBuilderClearCode( - io::Printer* printer) const { - printer->Print(variables_, - "internalGetMutable$capitalized_name$().clear();\n"); -} - -void ImmutableMapFieldGenerator::GenerateMergingCode( - io::Printer* printer) const { - printer->Print(variables_, - "internalGetMutable$capitalized_name$().mergeFrom(\n" - " other.internalGet$capitalized_name$());\n"); -} - -void ImmutableMapFieldGenerator::GenerateBuildingCode( - io::Printer* printer) const { - printer->Print(variables_, - "result.$name$_ = internalGet$capitalized_name$();\n" - "result.$name$_.makeImmutable();\n"); -} - -void ImmutableMapFieldGenerator::GenerateParsingCode( - io::Printer* printer) const { - printer->Print(variables_, - "if (!$get_mutable_bit_parser$) {\n" - " $name$_ = com.google.protobuf.MapField.newMapField(\n" - " $map_field_parameter$);\n" - " $set_mutable_bit_parser$;\n" - "}\n"); - if (!SupportUnknownEnumValue(descriptor_->file()) && - GetJavaType(ValueField(descriptor_)) == JAVATYPE_ENUM) { - printer->Print( - variables_, - "com.google.protobuf.ByteString bytes = input.readBytes();\n" - "com.google.protobuf.MapEntry<$type_parameters$>\n" - "$name$__ = $default_entry$.getParserForType().parseFrom(bytes);\n"); - printer->Print( - variables_, - "if ($value_enum_type$.forNumber($name$__.getValue()) == null) {\n" - " unknownFields.mergeLengthDelimitedField($number$, bytes);\n" - "} else {\n" - " $name$_.getMutableMap().put(\n" - " $name$__.getKey(), $name$__.getValue());\n" - "}\n"); - } else { - printer->Print( - variables_, - "com.google.protobuf.MapEntry<$type_parameters$>\n" - "$name$__ = input.readMessage(\n" - " $default_entry$.getParserForType(), extensionRegistry);\n" - "$name$_.getMutableMap().put(\n" - " $name$__.getKey(), $name$__.getValue());\n"); - } -} - -void ImmutableMapFieldGenerator::GenerateParsingDoneCode( - io::Printer* printer) const { - // Nothing to do here. -} - -void ImmutableMapFieldGenerator::GenerateSerializationCode( - io::Printer* printer) const { - printer->Print(variables_, - "com.google.protobuf.GeneratedMessage$ver$\n" - " .serialize$short_key_type$MapTo(\n" - " output,\n" - " internalGet$capitalized_name$(),\n" - " $default_entry$,\n" - " $number$);\n"); -} - -void ImmutableMapFieldGenerator::GenerateSerializedSizeCode( - io::Printer* printer) const { - printer->Print( - variables_, - "for (java.util.Map.Entry<$type_parameters$> entry\n" - " : internalGet$capitalized_name$().getMap().entrySet()) {\n" - " com.google.protobuf.MapEntry<$type_parameters$>\n" - " $name$__ = $default_entry$.newBuilderForType()\n" - " .setKey(entry.getKey())\n" - " .setValue(entry.getValue())\n" - " .build();\n" - " size += com.google.protobuf.CodedOutputStream\n" - " .computeMessageSize($number$, $name$__);\n" - "}\n"); -} - -void ImmutableMapFieldGenerator::GenerateEqualsCode( - io::Printer* printer) const { - printer->Print(variables_, - "if (!internalGet$capitalized_name$().equals(\n" - " other.internalGet$capitalized_name$())) return false;\n"); -} - -void ImmutableMapFieldGenerator::GenerateHashCode(io::Printer* printer) const { - printer->Print( - variables_, - "if (!internalGet$capitalized_name$().getMap().isEmpty()) {\n" - " hash = (37 * hash) + $constant_name$;\n" - " hash = (53 * hash) + internalGet$capitalized_name$().hashCode();\n" - "}\n"); -} - -std::string ImmutableMapFieldGenerator::GetBoxedType() const { - return name_resolver_->GetImmutableClassName(descriptor_->message_type()); -} - -} // namespace java -} // namespace compiler -} // namespace protobuf -} // namespace google diff --git a/extra/protobuf/protobuf-3.19.4/src/google/protobuf/compiler/java/java_map_field.h b/extra/protobuf/protobuf-3.19.4/src/google/protobuf/compiler/java/java_map_field.h deleted file mode 100644 index 98d9249a7915..000000000000 --- a/extra/protobuf/protobuf-3.19.4/src/google/protobuf/compiler/java/java_map_field.h +++ /dev/null @@ -1,82 +0,0 @@ -// Protocol Buffers - Google's data interchange format -// Copyright 2008 Google Inc. All rights reserved. -// https://developers.google.com/protocol-buffers/ -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// * Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// * Redistributions in binary form must reproduce the above -// copyright notice, this list of conditions and the following disclaimer -// in the documentation and/or other materials provided with the -// distribution. -// * Neither the name of Google Inc. nor the names of its -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -#ifndef GOOGLE_PROTOBUF_COMPILER_JAVA_MAP_FIELD_H__ -#define GOOGLE_PROTOBUF_COMPILER_JAVA_MAP_FIELD_H__ - -#include - -namespace google { -namespace protobuf { -namespace compiler { -namespace java { - -class ImmutableMapFieldGenerator : public ImmutableFieldGenerator { - public: - explicit ImmutableMapFieldGenerator(const FieldDescriptor* descriptor, - int messageBitIndex, int builderBitIndex, - Context* context); - ~ImmutableMapFieldGenerator() override; - - // implements ImmutableFieldGenerator --------------------------------------- - int GetNumBitsForMessage() const override; - int GetNumBitsForBuilder() const override; - void GenerateInterfaceMembers(io::Printer* printer) const override; - void GenerateMembers(io::Printer* printer) const override; - void GenerateBuilderMembers(io::Printer* printer) const override; - void GenerateInitializationCode(io::Printer* printer) const override; - void GenerateBuilderClearCode(io::Printer* printer) const override; - void GenerateMergingCode(io::Printer* printer) const override; - void GenerateBuildingCode(io::Printer* printer) const override; - void GenerateParsingCode(io::Printer* printer) const override; - void GenerateParsingDoneCode(io::Printer* printer) const override; - void GenerateSerializationCode(io::Printer* printer) const override; - void GenerateSerializedSizeCode(io::Printer* printer) const override; - void GenerateFieldBuilderInitializationCode( - io::Printer* printer) const override; - void GenerateEqualsCode(io::Printer* printer) const override; - void GenerateHashCode(io::Printer* printer) const override; - void GenerateKotlinDslMembers(io::Printer* printer) const override; - - std::string GetBoxedType() const override; - - private: - const FieldDescriptor* descriptor_; - std::map variables_; - ClassNameResolver* name_resolver_; - void GenerateMapGetters(io::Printer* printer) const; -}; - -} // namespace java -} // namespace compiler -} // namespace protobuf -} // namespace google - -#endif // GOOGLE_PROTOBUF_COMPILER_JAVA_MAP_FIELD_H__ diff --git a/extra/protobuf/protobuf-3.19.4/src/google/protobuf/compiler/java/java_map_field_lite.cc b/extra/protobuf/protobuf-3.19.4/src/google/protobuf/compiler/java/java_map_field_lite.cc deleted file mode 100644 index e71116866e2a..000000000000 --- a/extra/protobuf/protobuf-3.19.4/src/google/protobuf/compiler/java/java_map_field_lite.cc +++ /dev/null @@ -1,909 +0,0 @@ -// Protocol Buffers - Google's data interchange format -// Copyright 2008 Google Inc. All rights reserved. -// https://developers.google.com/protocol-buffers/ -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// * Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// * Redistributions in binary form must reproduce the above -// copyright notice, this list of conditions and the following disclaimer -// in the documentation and/or other materials provided with the -// distribution. -// * Neither the name of Google Inc. nor the names of its -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -#include - -#include - -#include -#include -#include -#include -#include - -namespace google { -namespace protobuf { -namespace compiler { -namespace java { - -namespace { - -const FieldDescriptor* KeyField(const FieldDescriptor* descriptor) { - GOOGLE_CHECK_EQ(FieldDescriptor::TYPE_MESSAGE, descriptor->type()); - const Descriptor* message = descriptor->message_type(); - GOOGLE_CHECK(message->options().map_entry()); - return message->FindFieldByName("key"); -} - -const FieldDescriptor* ValueField(const FieldDescriptor* descriptor) { - GOOGLE_CHECK_EQ(FieldDescriptor::TYPE_MESSAGE, descriptor->type()); - const Descriptor* message = descriptor->message_type(); - GOOGLE_CHECK(message->options().map_entry()); - return message->FindFieldByName("value"); -} - -std::string TypeName(const FieldDescriptor* field, - ClassNameResolver* name_resolver, bool boxed) { - if (GetJavaType(field) == JAVATYPE_MESSAGE) { - return name_resolver->GetImmutableClassName(field->message_type()); - } else if (GetJavaType(field) == JAVATYPE_ENUM) { - return name_resolver->GetImmutableClassName(field->enum_type()); - } else { - return boxed ? BoxedPrimitiveTypeName(GetJavaType(field)) - : PrimitiveTypeName(GetJavaType(field)); - } -} - -std::string KotlinTypeName(const FieldDescriptor* field, - ClassNameResolver* name_resolver) { - if (GetJavaType(field) == JAVATYPE_MESSAGE) { - return name_resolver->GetImmutableClassName(field->message_type()); - } else if (GetJavaType(field) == JAVATYPE_ENUM) { - return name_resolver->GetImmutableClassName(field->enum_type()); - } else { - return KotlinTypeName(GetJavaType(field)); - } -} - -std::string WireType(const FieldDescriptor* field) { - return "com.google.protobuf.WireFormat.FieldType." + - std::string(FieldTypeName(field->type())); -} - -void SetMessageVariables(const FieldDescriptor* descriptor, int messageBitIndex, - int builderBitIndex, const FieldGeneratorInfo* info, - Context* context, - std::map* variables) { - SetCommonFieldVariables(descriptor, info, variables); - - ClassNameResolver* name_resolver = context->GetNameResolver(); - (*variables)["type"] = - name_resolver->GetImmutableClassName(descriptor->message_type()); - const FieldDescriptor* key = KeyField(descriptor); - const FieldDescriptor* value = ValueField(descriptor); - const JavaType keyJavaType = GetJavaType(key); - const JavaType valueJavaType = GetJavaType(value); - - (*variables)["key_type"] = TypeName(key, name_resolver, false); - (*variables)["boxed_key_type"] = TypeName(key, name_resolver, true); - (*variables)["kt_key_type"] = KotlinTypeName(key, name_resolver); - (*variables)["kt_value_type"] = KotlinTypeName(value, name_resolver); - (*variables)["key_wire_type"] = WireType(key); - (*variables)["key_default_value"] = DefaultValue(key, true, name_resolver); - // We use `x.getClass()` as a null check because it generates less bytecode - // than an `if (x == null) { throw ... }` statement. - (*variables)["key_null_check"] = - IsReferenceType(keyJavaType) - ? "java.lang.Class keyClass = key.getClass();" - : ""; - (*variables)["value_null_check"] = - IsReferenceType(valueJavaType) - ? "java.lang.Class valueClass = value.getClass();" - : ""; - - if (GetJavaType(value) == JAVATYPE_ENUM) { - // We store enums as Integers internally. - (*variables)["value_type"] = "int"; - (*variables)["boxed_value_type"] = "java.lang.Integer"; - (*variables)["value_wire_type"] = WireType(value); - (*variables)["value_default_value"] = - DefaultValue(value, true, name_resolver) + ".getNumber()"; - - (*variables)["value_enum_type"] = TypeName(value, name_resolver, false); - - if (SupportUnknownEnumValue(descriptor->file())) { - // Map unknown values to a special UNRECOGNIZED value if supported. - (*variables)["unrecognized_value"] = - (*variables)["value_enum_type"] + ".UNRECOGNIZED"; - } else { - // Map unknown values to the default value if we don't have UNRECOGNIZED. - (*variables)["unrecognized_value"] = - DefaultValue(value, true, name_resolver); - } - } else { - (*variables)["value_type"] = TypeName(value, name_resolver, false); - (*variables)["boxed_value_type"] = TypeName(value, name_resolver, true); - (*variables)["value_wire_type"] = WireType(value); - (*variables)["value_default_value"] = - DefaultValue(value, true, name_resolver); - } - (*variables)["type_parameters"] = - (*variables)["boxed_key_type"] + ", " + (*variables)["boxed_value_type"]; - // TODO(birdo): Add @deprecated javadoc when generating javadoc is supported - // by the proto compiler - (*variables)["deprecation"] = - descriptor->options().deprecated() ? "@java.lang.Deprecated " : ""; - (*variables)["kt_deprecation"] = - descriptor->options().deprecated() - ? "@kotlin.Deprecated(message = \"Field " + (*variables)["name"] + - " is deprecated\") " - : ""; - - (*variables)["default_entry"] = - (*variables)["capitalized_name"] + "DefaultEntryHolder.defaultEntry"; -} - -} // namespace - -ImmutableMapFieldLiteGenerator::ImmutableMapFieldLiteGenerator( - const FieldDescriptor* descriptor, int messageBitIndex, Context* context) - : descriptor_(descriptor), - context_(context), - name_resolver_(context->GetNameResolver()) { - SetMessageVariables(descriptor, messageBitIndex, 0, - context->GetFieldGeneratorInfo(descriptor), context, - &variables_); -} - -ImmutableMapFieldLiteGenerator::~ImmutableMapFieldLiteGenerator() {} - -int ImmutableMapFieldLiteGenerator::GetNumBitsForMessage() const { return 0; } - -void ImmutableMapFieldLiteGenerator::GenerateInterfaceMembers( - io::Printer* printer) const { - WriteFieldDocComment(printer, descriptor_); - printer->Print(variables_, - "$deprecation$int ${$get$capitalized_name$Count$}$();\n"); - printer->Annotate("{", "}", descriptor_); - WriteFieldDocComment(printer, descriptor_); - printer->Print(variables_, - "$deprecation$boolean ${$contains$capitalized_name$$}$(\n" - " $key_type$ key);\n"); - printer->Annotate("{", "}", descriptor_); - if (GetJavaType(ValueField(descriptor_)) == JAVATYPE_ENUM) { - printer->Print(variables_, - "/**\n" - " * Use {@link #get$capitalized_name$Map()} instead.\n" - " */\n" - "@java.lang.Deprecated\n" - "java.util.Map<$boxed_key_type$, $value_enum_type$>\n" - "${$get$capitalized_name$$}$();\n"); - printer->Annotate("{", "}", descriptor_); - WriteFieldDocComment(printer, descriptor_); - printer->Print( - variables_, - "$deprecation$java.util.Map<$boxed_key_type$, $value_enum_type$>\n" - "${$get$capitalized_name$Map$}$();\n"); - printer->Annotate("{", "}", descriptor_); - WriteFieldDocComment(printer, descriptor_); - printer->Print( - variables_, - "$deprecation$$value_enum_type$ ${$get$capitalized_name$OrDefault$}$(\n" - " $key_type$ key,\n" - " $value_enum_type$ defaultValue);\n"); - printer->Annotate("{", "}", descriptor_); - WriteFieldDocComment(printer, descriptor_); - printer->Print( - variables_, - "$deprecation$$value_enum_type$ ${$get$capitalized_name$OrThrow$}$(\n" - " $key_type$ key);\n"); - printer->Annotate("{", "}", descriptor_); - if (SupportUnknownEnumValue(descriptor_->file())) { - printer->Print( - variables_, - "/**\n" - " * Use {@link #get$capitalized_name$ValueMap()} instead.\n" - " */\n" - "@java.lang.Deprecated\n" - "java.util.Map<$type_parameters$>\n" - "${$get$capitalized_name$Value$}$();\n"); - printer->Annotate("{", "}", descriptor_); - WriteFieldDocComment(printer, descriptor_); - printer->Print(variables_, - "$deprecation$java.util.Map<$type_parameters$>\n" - "${$get$capitalized_name$ValueMap$}$();\n"); - printer->Annotate("{", "}", descriptor_); - WriteFieldDocComment(printer, descriptor_); - printer->Print(variables_, - "$deprecation$\n" - "$value_type$ ${$get$capitalized_name$ValueOrDefault$}$(\n" - " $key_type$ key,\n" - " $value_type$ defaultValue);\n"); - printer->Annotate("{", "}", descriptor_); - WriteFieldDocComment(printer, descriptor_); - printer->Print(variables_, - "$deprecation$\n" - "$value_type$ ${$get$capitalized_name$ValueOrThrow$}$(\n" - " $key_type$ key);\n"); - printer->Annotate("{", "}", descriptor_); - } - } else { - printer->Print(variables_, - "/**\n" - " * Use {@link #get$capitalized_name$Map()} instead.\n" - " */\n" - "@java.lang.Deprecated\n" - "java.util.Map<$type_parameters$>\n" - "${$get$capitalized_name$$}$();\n"); - printer->Annotate("{", "}", descriptor_); - WriteFieldDocComment(printer, descriptor_); - printer->Print(variables_, - "$deprecation$java.util.Map<$type_parameters$>\n" - "${$get$capitalized_name$Map$}$();\n"); - printer->Annotate("{", "}", descriptor_); - WriteFieldDocComment(printer, descriptor_); - printer->Print(variables_, - "$deprecation$\n" - "$value_type$ ${$get$capitalized_name$OrDefault$}$(\n" - " $key_type$ key,\n" - " $value_type$ defaultValue);\n"); - printer->Annotate("{", "}", descriptor_); - WriteFieldDocComment(printer, descriptor_); - printer->Print(variables_, - "$deprecation$\n" - "$value_type$ ${$get$capitalized_name$OrThrow$}$(\n" - " $key_type$ key);\n"); - printer->Annotate("{", "}", descriptor_); - } -} - -void ImmutableMapFieldLiteGenerator::GenerateMembers( - io::Printer* printer) const { - printer->Print( - variables_, - "private static final class $capitalized_name$DefaultEntryHolder {\n" - " static final com.google.protobuf.MapEntryLite<\n" - " $type_parameters$> defaultEntry =\n" - " com.google.protobuf.MapEntryLite\n" - " .<$type_parameters$>newDefaultInstance(\n" - " $key_wire_type$,\n" - " $key_default_value$,\n" - " $value_wire_type$,\n" - " $value_default_value$);\n" - "}\n"); - printer->Print(variables_, - "private com.google.protobuf.MapFieldLite<\n" - " $type_parameters$> $name$_ =\n" - " com.google.protobuf.MapFieldLite.emptyMapField();\n" - "private com.google.protobuf.MapFieldLite<$type_parameters$>\n" - "internalGet$capitalized_name$() {\n" - " return $name$_;\n" - "}\n" - "private com.google.protobuf.MapFieldLite<$type_parameters$>\n" - "internalGetMutable$capitalized_name$() {\n" - " if (!$name$_.isMutable()) {\n" - " $name$_ = $name$_.mutableCopy();\n" - " }\n" - " return $name$_;\n" - "}\n"); - printer->Print(variables_, - "@java.lang.Override\n" - "$deprecation$\n" - "public int ${$get$capitalized_name$Count$}$() {\n" - " return internalGet$capitalized_name$().size();\n" - "}\n"); - printer->Annotate("{", "}", descriptor_); - WriteFieldDocComment(printer, descriptor_); - printer->Print(variables_, - "@java.lang.Override\n" - "$deprecation$\n" - "public boolean ${$contains$capitalized_name$$}$(\n" - " $key_type$ key) {\n" - " $key_null_check$\n" - " return internalGet$capitalized_name$().containsKey(key);\n" - "}\n"); - printer->Annotate("{", "}", descriptor_); - if (GetJavaType(ValueField(descriptor_)) == JAVATYPE_ENUM) { - printer->Print( - variables_, - "private static final\n" - "com.google.protobuf.Internal.MapAdapter.Converter<\n" - " java.lang.Integer, $value_enum_type$> $name$ValueConverter =\n" - " com.google.protobuf.Internal.MapAdapter.newEnumConverter(\n" - " $value_enum_type$.internalGetValueMap(),\n" - " $unrecognized_value$);\n"); - printer->Print(variables_, - "/**\n" - " * Use {@link #get$capitalized_name$Map()} instead.\n" - " */\n" - "@java.lang.Deprecated\n" - "public java.util.Map<$boxed_key_type$, $value_enum_type$>\n" - "${$get$capitalized_name$$}$() {\n" - " return get$capitalized_name$Map();\n" - "}\n"); - printer->Annotate("{", "}", descriptor_); - WriteFieldDocComment(printer, descriptor_); - printer->Print( - variables_, - "@java.lang.Override\n" - "$deprecation$\n" - "public java.util.Map<$boxed_key_type$, $value_enum_type$>\n" - "${$get$capitalized_name$Map$}$() {\n" - " return java.util.Collections.unmodifiableMap(\n" - " new com.google.protobuf.Internal.MapAdapter<\n" - " $boxed_key_type$, $value_enum_type$, java.lang.Integer>(\n" - " internalGet$capitalized_name$(),\n" - " $name$ValueConverter));\n" - "}\n"); - printer->Annotate("{", "}", descriptor_); - WriteFieldDocComment(printer, descriptor_); - printer->Print( - variables_, - "@java.lang.Override\n" - "$deprecation$\n" - "public $value_enum_type$ ${$get$capitalized_name$OrDefault$}$(\n" - " $key_type$ key,\n" - " $value_enum_type$ defaultValue) {\n" - " $key_null_check$\n" - " java.util.Map<$boxed_key_type$, $boxed_value_type$> map =\n" - " internalGet$capitalized_name$();\n" - " return map.containsKey(key)\n" - " ? $name$ValueConverter.doForward(map.get(key))\n" - " : defaultValue;\n" - "}\n"); - printer->Annotate("{", "}", descriptor_); - WriteFieldDocComment(printer, descriptor_); - printer->Print( - variables_, - "@java.lang.Override\n" - "$deprecation$\n" - "public $value_enum_type$ ${$get$capitalized_name$OrThrow$}$(\n" - " $key_type$ key) {\n" - " $key_null_check$\n" - " java.util.Map<$boxed_key_type$, $boxed_value_type$> map =\n" - " internalGet$capitalized_name$();\n" - " if (!map.containsKey(key)) {\n" - " throw new java.lang.IllegalArgumentException();\n" - " }\n" - " return $name$ValueConverter.doForward(map.get(key));\n" - "}\n"); - printer->Annotate("{", "}", descriptor_); - if (SupportUnknownEnumValue(descriptor_->file())) { - printer->Print( - variables_, - "/**\n" - " * Use {@link #get$capitalized_name$ValueMap()} instead.\n" - " */\n" - "@java.lang.Override\n" - "@java.lang.Deprecated\n" - "public java.util.Map<$boxed_key_type$, $boxed_value_type$>\n" - "${$get$capitalized_name$Value$}$() {\n" - " return get$capitalized_name$ValueMap();\n" - "}\n"); - printer->Annotate("{", "}", descriptor_); - WriteFieldDocComment(printer, descriptor_); - printer->Print( - variables_, - "@java.lang.Override\n" - "$deprecation$\n" - "public java.util.Map<$boxed_key_type$, $boxed_value_type$>\n" - "${$get$capitalized_name$ValueMap$}$() {\n" - " return java.util.Collections.unmodifiableMap(\n" - " internalGet$capitalized_name$());\n" - "}\n"); - printer->Annotate("{", "}", descriptor_); - WriteFieldDocComment(printer, descriptor_); - printer->Print( - variables_, - "@java.lang.Override\n" - "$deprecation$\n" - "public $value_type$ ${$get$capitalized_name$ValueOrDefault$}$(\n" - " $key_type$ key,\n" - " $value_type$ defaultValue) {\n" - " $key_null_check$\n" - " java.util.Map<$boxed_key_type$, $boxed_value_type$> map =\n" - " internalGet$capitalized_name$();\n" - " return map.containsKey(key) ? map.get(key) : defaultValue;\n" - "}\n"); - printer->Annotate("{", "}", descriptor_); - WriteFieldDocComment(printer, descriptor_); - printer->Print( - variables_, - "@java.lang.Override\n" - "$deprecation$\n" - "public $value_type$ ${$get$capitalized_name$ValueOrThrow$}$(\n" - " $key_type$ key) {\n" - " $key_null_check$\n" - " java.util.Map<$boxed_key_type$, $boxed_value_type$> map =\n" - " internalGet$capitalized_name$();\n" - " if (!map.containsKey(key)) {\n" - " throw new java.lang.IllegalArgumentException();\n" - " }\n" - " return map.get(key);\n" - "}\n"); - printer->Annotate("{", "}", descriptor_); - } - } else { - printer->Print(variables_, - "/**\n" - " * Use {@link #get$capitalized_name$Map()} instead.\n" - " */\n" - "@java.lang.Override\n" - "@java.lang.Deprecated\n" - "public java.util.Map<$type_parameters$> " - "${$get$capitalized_name$$}$() {\n" - " return get$capitalized_name$Map();\n" - "}\n"); - printer->Annotate("{", "}", descriptor_); - WriteFieldDocComment(printer, descriptor_); - printer->Print(variables_, - "@java.lang.Override\n" - "$deprecation$\n" - "public java.util.Map<$type_parameters$> " - "${$get$capitalized_name$Map$}$() {\n" - " return java.util.Collections.unmodifiableMap(\n" - " internalGet$capitalized_name$());\n" - "}\n"); - printer->Annotate("{", "}", descriptor_); - WriteFieldDocComment(printer, descriptor_); - printer->Print( - variables_, - "@java.lang.Override\n" - "$deprecation$\n" - "public $value_type$ ${$get$capitalized_name$OrDefault$}$(\n" - " $key_type$ key,\n" - " $value_type$ defaultValue) {\n" - " $key_null_check$\n" - " java.util.Map<$type_parameters$> map =\n" - " internalGet$capitalized_name$();\n" - " return map.containsKey(key) ? map.get(key) : defaultValue;\n" - "}\n"); - printer->Annotate("{", "}", descriptor_); - WriteFieldDocComment(printer, descriptor_); - printer->Print(variables_, - "@java.lang.Override\n" - "$deprecation$\n" - "public $value_type$ ${$get$capitalized_name$OrThrow$}$(\n" - " $key_type$ key) {\n" - " $key_null_check$\n" - " java.util.Map<$type_parameters$> map =\n" - " internalGet$capitalized_name$();\n" - " if (!map.containsKey(key)) {\n" - " throw new java.lang.IllegalArgumentException();\n" - " }\n" - " return map.get(key);\n" - "}\n"); - printer->Annotate("{", "}", descriptor_); - } - - // Generate private setters for the builder to proxy into. - if (GetJavaType(ValueField(descriptor_)) == JAVATYPE_ENUM) { - WriteFieldDocComment(printer, descriptor_); - printer->Print( - variables_, - "private java.util.Map<$boxed_key_type$, $value_enum_type$>\n" - "getMutable$capitalized_name$Map() {\n" - " return new com.google.protobuf.Internal.MapAdapter<\n" - " $boxed_key_type$, $value_enum_type$, java.lang.Integer>(\n" - " internalGetMutable$capitalized_name$(),\n" - " $name$ValueConverter);\n" - "}\n"); - if (SupportUnknownEnumValue(descriptor_->file())) { - WriteFieldDocComment(printer, descriptor_); - printer->Print( - variables_, - "private java.util.Map<$boxed_key_type$, $boxed_value_type$>\n" - "getMutable$capitalized_name$ValueMap() {\n" - " return internalGetMutable$capitalized_name$();\n" - "}\n"); - } - } else { - WriteFieldDocComment(printer, descriptor_); - printer->Print(variables_, - "private java.util.Map<$type_parameters$>\n" - "getMutable$capitalized_name$Map() {\n" - " return internalGetMutable$capitalized_name$();\n" - "}\n"); - } -} - -void ImmutableMapFieldLiteGenerator::GenerateFieldInfo( - io::Printer* printer, std::vector* output) const { - WriteIntToUtf16CharSequence(descriptor_->number(), output); - WriteIntToUtf16CharSequence(GetExperimentalJavaFieldType(descriptor_), - output); - printer->Print(variables_, - "\"$name$_\",\n" - "$default_entry$,\n"); - if (!SupportUnknownEnumValue(descriptor_) && - GetJavaType(ValueField(descriptor_)) == JAVATYPE_ENUM) { - PrintEnumVerifierLogic(printer, ValueField(descriptor_), variables_, - /*var_name=*/"$value_enum_type$", - /*terminating_string=*/",\n", - /*enforce_lite=*/context_->EnforceLite()); - } -} - -void ImmutableMapFieldLiteGenerator::GenerateBuilderMembers( - io::Printer* printer) const { - printer->Print(variables_, - "@java.lang.Override\n" - "$deprecation$\n" - "public int ${$get$capitalized_name$Count$}$() {\n" - " return instance.get$capitalized_name$Map().size();\n" - "}\n"); - printer->Annotate("{", "}", descriptor_); - WriteFieldDocComment(printer, descriptor_); - printer->Print( - variables_, - "@java.lang.Override\n" - "$deprecation$\n" - "public boolean ${$contains$capitalized_name$$}$(\n" - " $key_type$ key) {\n" - " $key_null_check$\n" - " return instance.get$capitalized_name$Map().containsKey(key);\n" - "}\n"); - printer->Annotate("{", "}", descriptor_); - printer->Print(variables_, - "$deprecation$\n" - "public Builder ${$clear$capitalized_name$$}$() {\n" - " copyOnWrite();\n" - " instance.getMutable$capitalized_name$Map().clear();\n" - " return this;\n" - "}\n"); - printer->Annotate("{", "}", descriptor_); - WriteFieldDocComment(printer, descriptor_); - printer->Print(variables_, - "$deprecation$\n" - "public Builder ${$remove$capitalized_name$$}$(\n" - " $key_type$ key) {\n" - " $key_null_check$\n" - " copyOnWrite();\n" - " instance.getMutable$capitalized_name$Map().remove(key);\n" - " return this;\n" - "}\n"); - printer->Annotate("{", "}", descriptor_); - if (GetJavaType(ValueField(descriptor_)) == JAVATYPE_ENUM) { - printer->Print(variables_, - "/**\n" - " * Use {@link #get$capitalized_name$Map()} instead.\n" - " */\n" - "@java.lang.Deprecated\n" - "public java.util.Map<$boxed_key_type$, $value_enum_type$>\n" - "${$get$capitalized_name$$}$() {\n" - " return get$capitalized_name$Map();\n" - "}\n"); - printer->Annotate("{", "}", descriptor_); - WriteFieldDocComment(printer, descriptor_); - printer->Print(variables_, - "@java.lang.Override\n" - "$deprecation$\n" - "public java.util.Map<$boxed_key_type$, $value_enum_type$>\n" - "${$get$capitalized_name$Map$}$() {\n" - " return java.util.Collections.unmodifiableMap(\n" - " instance.get$capitalized_name$Map());\n" - "}\n"); - printer->Annotate("{", "}", descriptor_); - WriteFieldDocComment(printer, descriptor_); - printer->Print( - variables_, - "@java.lang.Override\n" - "$deprecation$\n" - "public $value_enum_type$ ${$get$capitalized_name$OrDefault$}$(\n" - " $key_type$ key,\n" - " $value_enum_type$ defaultValue) {\n" - " $key_null_check$\n" - " java.util.Map<$boxed_key_type$, $value_enum_type$> map =\n" - " instance.get$capitalized_name$Map();\n" - " return map.containsKey(key)\n" - " ? map.get(key)\n" - " : defaultValue;\n" - "}\n"); - printer->Annotate("{", "}", descriptor_); - WriteFieldDocComment(printer, descriptor_); - printer->Print( - variables_, - "@java.lang.Override\n" - "$deprecation$\n" - "public $value_enum_type$ ${$get$capitalized_name$OrThrow$}$(\n" - " $key_type$ key) {\n" - " $key_null_check$\n" - " java.util.Map<$boxed_key_type$, $value_enum_type$> map =\n" - " instance.get$capitalized_name$Map();\n" - " if (!map.containsKey(key)) {\n" - " throw new java.lang.IllegalArgumentException();\n" - " }\n" - " return map.get(key);\n" - "}\n"); - printer->Annotate("{", "}", descriptor_); - WriteFieldDocComment(printer, descriptor_); - printer->Print( - variables_, - "$deprecation$public Builder ${$put$capitalized_name$$}$(\n" - " $key_type$ key,\n" - " $value_enum_type$ value) {\n" - " $key_null_check$\n" - " $value_null_check$\n" - " copyOnWrite();\n" - " instance.getMutable$capitalized_name$Map().put(key, value);\n" - " return this;\n" - "}\n"); - printer->Annotate("{", "}", descriptor_); - WriteFieldDocComment(printer, descriptor_); - printer->Print( - variables_, - "$deprecation$public Builder ${$putAll$capitalized_name$$}$(\n" - " java.util.Map<$boxed_key_type$, $value_enum_type$> values) {\n" - " copyOnWrite();\n" - " instance.getMutable$capitalized_name$Map().putAll(values);\n" - " return this;\n" - "}\n"); - printer->Annotate("{", "}", descriptor_); - if (SupportUnknownEnumValue(descriptor_->file())) { - printer->Print( - variables_, - "/**\n" - " * Use {@link #get$capitalized_name$ValueMap()} instead.\n" - " */\n" - "@java.lang.Override\n" - "@java.lang.Deprecated\n" - "public java.util.Map<$boxed_key_type$, $boxed_value_type$>\n" - "${$get$capitalized_name$Value$}$() {\n" - " return get$capitalized_name$ValueMap();\n" - "}\n"); - printer->Annotate("{", "}", descriptor_); - WriteFieldDocComment(printer, descriptor_); - printer->Print( - variables_, - "@java.lang.Override\n" - "$deprecation$\n" - "public java.util.Map<$boxed_key_type$, $boxed_value_type$>\n" - "${$get$capitalized_name$ValueMap$}$() {\n" - " return java.util.Collections.unmodifiableMap(\n" - " instance.get$capitalized_name$ValueMap());\n" - "}\n"); - printer->Annotate("{", "}", descriptor_); - WriteFieldDocComment(printer, descriptor_); - printer->Print( - variables_, - "@java.lang.Override\n" - "$deprecation$\n" - "public $value_type$ ${$get$capitalized_name$ValueOrDefault$}$(\n" - " $key_type$ key,\n" - " $value_type$ defaultValue) {\n" - " $key_null_check$\n" - " java.util.Map<$boxed_key_type$, $boxed_value_type$> map =\n" - " instance.get$capitalized_name$ValueMap();\n" - " return map.containsKey(key) ? map.get(key) : defaultValue;\n" - "}\n"); - printer->Annotate("{", "}", descriptor_); - WriteFieldDocComment(printer, descriptor_); - printer->Print( - variables_, - "@java.lang.Override\n" - "$deprecation$\n" - "public $value_type$ ${$get$capitalized_name$ValueOrThrow$}$(\n" - " $key_type$ key) {\n" - " $key_null_check$\n" - " java.util.Map<$boxed_key_type$, $boxed_value_type$> map =\n" - " instance.get$capitalized_name$ValueMap();\n" - " if (!map.containsKey(key)) {\n" - " throw new java.lang.IllegalArgumentException();\n" - " }\n" - " return map.get(key);\n" - "}\n"); - printer->Annotate("{", "}", descriptor_); - WriteFieldDocComment(printer, descriptor_); - printer->Print( - variables_, - "$deprecation$public Builder ${$put$capitalized_name$Value$}$(\n" - " $key_type$ key,\n" - " $value_type$ value) {\n" - " $key_null_check$\n" - " copyOnWrite();\n" - " instance.getMutable$capitalized_name$ValueMap().put(key, value);\n" - " return this;\n" - "}\n"); - printer->Annotate("{", "}", descriptor_); - WriteFieldDocComment(printer, descriptor_); - printer->Print( - variables_, - "$deprecation$public Builder ${$putAll$capitalized_name$Value$}$(\n" - " java.util.Map<$boxed_key_type$, $boxed_value_type$> values) {\n" - " copyOnWrite();\n" - " instance.getMutable$capitalized_name$ValueMap().putAll(values);\n" - " return this;\n" - "}\n"); - printer->Annotate("{", "}", descriptor_); - } - } else { - printer->Print(variables_, - "/**\n" - " * Use {@link #get$capitalized_name$Map()} instead.\n" - " */\n" - "@java.lang.Override\n" - "@java.lang.Deprecated\n" - "public java.util.Map<$type_parameters$> " - "${$get$capitalized_name$$}$() {\n" - " return get$capitalized_name$Map();\n" - "}\n"); - printer->Annotate("{", "}", descriptor_); - WriteFieldDocComment(printer, descriptor_); - printer->Print(variables_, - "@java.lang.Override\n" - "$deprecation$" - "public java.util.Map<$type_parameters$> " - "${$get$capitalized_name$Map$}$() {\n" - " return java.util.Collections.unmodifiableMap(\n" - " instance.get$capitalized_name$Map());\n" - "}\n"); - printer->Annotate("{", "}", descriptor_); - WriteFieldDocComment(printer, descriptor_); - printer->Print( - variables_, - "@java.lang.Override\n" - "$deprecation$\n" - "public $value_type$ ${$get$capitalized_name$OrDefault$}$(\n" - " $key_type$ key,\n" - " $value_type$ defaultValue) {\n" - " $key_null_check$\n" - " java.util.Map<$type_parameters$> map =\n" - " instance.get$capitalized_name$Map();\n" - " return map.containsKey(key) ? map.get(key) : defaultValue;\n" - "}\n"); - printer->Annotate("{", "}", descriptor_); - WriteFieldDocComment(printer, descriptor_); - printer->Print(variables_, - "@java.lang.Override\n" - "$deprecation$\n" - "public $value_type$ ${$get$capitalized_name$OrThrow$}$(\n" - " $key_type$ key) {\n" - " $key_null_check$\n" - " java.util.Map<$type_parameters$> map =\n" - " instance.get$capitalized_name$Map();\n" - " if (!map.containsKey(key)) {\n" - " throw new java.lang.IllegalArgumentException();\n" - " }\n" - " return map.get(key);\n" - "}\n"); - printer->Annotate("{", "}", descriptor_); - WriteFieldDocComment(printer, descriptor_); - printer->Print( - variables_, - "$deprecation$" - "public Builder ${$put$capitalized_name$$}$(\n" - " $key_type$ key,\n" - " $value_type$ value) {\n" - " $key_null_check$\n" - " $value_null_check$\n" - " copyOnWrite();\n" - " instance.getMutable$capitalized_name$Map().put(key, value);\n" - " return this;\n" - "}\n"); - printer->Annotate("{", "}", descriptor_); - WriteFieldDocComment(printer, descriptor_); - printer->Print( - variables_, - "$deprecation$" - "public Builder ${$putAll$capitalized_name$$}$(\n" - " java.util.Map<$type_parameters$> values) {\n" - " copyOnWrite();\n" - " instance.getMutable$capitalized_name$Map().putAll(values);\n" - " return this;\n" - "}\n"); - printer->Annotate("{", "}", descriptor_); - } -} - -void ImmutableMapFieldLiteGenerator::GenerateKotlinDslMembers( - io::Printer* printer) const { - printer->Print( - variables_, - "/**\n" - " * An uninstantiable, behaviorless type to represent the field in\n" - " * generics.\n" - " */\n" - "@kotlin.OptIn" - "(com.google.protobuf.kotlin.OnlyForUseByGeneratedProtoCode::class)\n" - "public class ${$$kt_capitalized_name$Proxy$}$ private constructor()" - " : com.google.protobuf.kotlin.DslProxy()\n"); - - WriteFieldDocComment(printer, descriptor_); - printer->Print( - variables_, - "$kt_deprecation$ public val $kt_name$: " - "com.google.protobuf.kotlin.DslMap" - "<$kt_key_type$, $kt_value_type$, ${$$kt_capitalized_name$Proxy$}$>\n" - " @kotlin.jvm.JvmSynthetic\n" - " @JvmName(\"get$kt_capitalized_name$Map\")\n" - " get() = com.google.protobuf.kotlin.DslMap(\n" - " $kt_dsl_builder$.${$get$capitalized_name$Map$}$()\n" - " )\n"); - - WriteFieldDocComment(printer, descriptor_); - printer->Print( - variables_, - "@JvmName(\"put$kt_capitalized_name$\")\n" - "public fun com.google.protobuf.kotlin.DslMap" - "<$kt_key_type$, $kt_value_type$, ${$$kt_capitalized_name$Proxy$}$>\n" - " .put(key: $kt_key_type$, value: $kt_value_type$) {\n" - " $kt_dsl_builder$.${$put$capitalized_name$$}$(key, value)\n" - " }\n"); - - WriteFieldDocComment(printer, descriptor_); - printer->Print( - variables_, - "@kotlin.jvm.JvmSynthetic\n" - "@JvmName(\"set$kt_capitalized_name$\")\n" - "@Suppress(\"NOTHING_TO_INLINE\")\n" - "public inline operator fun com.google.protobuf.kotlin.DslMap" - "<$kt_key_type$, $kt_value_type$, ${$$kt_capitalized_name$Proxy$}$>\n" - " .set(key: $kt_key_type$, value: $kt_value_type$) {\n" - " put(key, value)\n" - " }\n"); - - WriteFieldDocComment(printer, descriptor_); - printer->Print( - variables_, - "@kotlin.jvm.JvmSynthetic\n" - "@JvmName(\"remove$kt_capitalized_name$\")\n" - "public fun com.google.protobuf.kotlin.DslMap" - "<$kt_key_type$, $kt_value_type$, ${$$kt_capitalized_name$Proxy$}$>\n" - " .remove(key: $kt_key_type$) {\n" - " $kt_dsl_builder$.${$remove$capitalized_name$$}$(key)\n" - " }\n"); - - WriteFieldDocComment(printer, descriptor_); - printer->Print( - variables_, - "@kotlin.jvm.JvmSynthetic\n" - "@JvmName(\"putAll$kt_capitalized_name$\")\n" - "public fun com.google.protobuf.kotlin.DslMap" - "<$kt_key_type$, $kt_value_type$, ${$$kt_capitalized_name$Proxy$}$>\n" - " .putAll(map: kotlin.collections.Map<$kt_key_type$, $kt_value_type$>) " - "{\n" - " $kt_dsl_builder$.${$putAll$capitalized_name$$}$(map)\n" - " }\n"); - - WriteFieldDocComment(printer, descriptor_); - printer->Print( - variables_, - "@kotlin.jvm.JvmSynthetic\n" - "@JvmName(\"clear$kt_capitalized_name$\")\n" - "public fun com.google.protobuf.kotlin.DslMap" - "<$kt_key_type$, $kt_value_type$, ${$$kt_capitalized_name$Proxy$}$>\n" - " .clear() {\n" - " $kt_dsl_builder$.${$clear$capitalized_name$$}$()\n" - " }\n"); -} - -void ImmutableMapFieldLiteGenerator::GenerateInitializationCode( - io::Printer* printer) const { - // Nothing to initialize. -} - -std::string ImmutableMapFieldLiteGenerator::GetBoxedType() const { - return name_resolver_->GetImmutableClassName(descriptor_->message_type()); -} - -} // namespace java -} // namespace compiler -} // namespace protobuf -} // namespace google diff --git a/extra/protobuf/protobuf-3.19.4/src/google/protobuf/compiler/java/java_map_field_lite.h b/extra/protobuf/protobuf-3.19.4/src/google/protobuf/compiler/java/java_map_field_lite.h deleted file mode 100644 index da046b219930..000000000000 --- a/extra/protobuf/protobuf-3.19.4/src/google/protobuf/compiler/java/java_map_field_lite.h +++ /dev/null @@ -1,74 +0,0 @@ -// Protocol Buffers - Google's data interchange format -// Copyright 2008 Google Inc. All rights reserved. -// https://developers.google.com/protocol-buffers/ -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// * Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// * Redistributions in binary form must reproduce the above -// copyright notice, this list of conditions and the following disclaimer -// in the documentation and/or other materials provided with the -// distribution. -// * Neither the name of Google Inc. nor the names of its -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -#ifndef GOOGLE_PROTOBUF_COMPILER_JAVA_MAP_FIELD_LITE_H__ -#define GOOGLE_PROTOBUF_COMPILER_JAVA_MAP_FIELD_LITE_H__ - -#include - -#include - -namespace google { -namespace protobuf { -namespace compiler { -namespace java { - -class ImmutableMapFieldLiteGenerator : public ImmutableFieldLiteGenerator { - public: - explicit ImmutableMapFieldLiteGenerator(const FieldDescriptor* descriptor, - int messageBitIndex, - Context* context); - ~ImmutableMapFieldLiteGenerator() override; - - // implements ImmutableFieldLiteGenerator ------------------------------------ - int GetNumBitsForMessage() const override; - void GenerateInterfaceMembers(io::Printer* printer) const override; - void GenerateMembers(io::Printer* printer) const override; - void GenerateBuilderMembers(io::Printer* printer) const override; - void GenerateInitializationCode(io::Printer* printer) const override; - void GenerateFieldInfo(io::Printer* printer, - std::vector* output) const override; - void GenerateKotlinDslMembers(io::Printer* printer) const override; - - std::string GetBoxedType() const override; - - private: - const FieldDescriptor* descriptor_; - std::map variables_; - Context* context_; - ClassNameResolver* name_resolver_; -}; - -} // namespace java -} // namespace compiler -} // namespace protobuf -} // namespace google - -#endif // GOOGLE_PROTOBUF_COMPILER_JAVA_MAP_FIELD_LITE_H__ diff --git a/extra/protobuf/protobuf-3.19.4/src/google/protobuf/compiler/java/java_message.cc b/extra/protobuf/protobuf-3.19.4/src/google/protobuf/compiler/java/java_message.cc deleted file mode 100644 index 27d1014f69e3..000000000000 --- a/extra/protobuf/protobuf-3.19.4/src/google/protobuf/compiler/java/java_message.cc +++ /dev/null @@ -1,1729 +0,0 @@ -// Protocol Buffers - Google's data interchange format -// Copyright 2008 Google Inc. All rights reserved. -// https://developers.google.com/protocol-buffers/ -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// * Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// * Redistributions in binary form must reproduce the above -// copyright notice, this list of conditions and the following disclaimer -// in the documentation and/or other materials provided with the -// distribution. -// * Neither the name of Google Inc. nor the names of its -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -// Author: kenton@google.com (Kenton Varda) -// Based on original Protocol Buffers design by -// Sanjay Ghemawat, Jeff Dean, and others. - -#include - -#include -#include -#include -#include -#include - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -namespace google { -namespace protobuf { -namespace compiler { -namespace java { - -using internal::WireFormat; -using internal::WireFormatLite; - -namespace { -std::string MapValueImmutableClassdName(const Descriptor* descriptor, - ClassNameResolver* name_resolver) { - const FieldDescriptor* value_field = descriptor->FindFieldByName("value"); - GOOGLE_CHECK_EQ(FieldDescriptor::TYPE_MESSAGE, value_field->type()); - return name_resolver->GetImmutableClassName(value_field->message_type()); -} -} // namespace - -// =================================================================== - -MessageGenerator::MessageGenerator(const Descriptor* descriptor) - : descriptor_(descriptor) { - for (int i = 0; i < descriptor_->field_count(); i++) { - if (IsRealOneof(descriptor_->field(i))) { - oneofs_.insert(descriptor_->field(i)->containing_oneof()); - } - } -} - -MessageGenerator::~MessageGenerator() {} - -// =================================================================== -ImmutableMessageGenerator::ImmutableMessageGenerator( - const Descriptor* descriptor, Context* context) - : MessageGenerator(descriptor), - context_(context), - name_resolver_(context->GetNameResolver()), - field_generators_(descriptor, context_) { - GOOGLE_CHECK(HasDescriptorMethods(descriptor->file(), context->EnforceLite())) - << "Generator factory error: A non-lite message generator is used to " - "generate lite messages."; -} - -ImmutableMessageGenerator::~ImmutableMessageGenerator() {} - -void ImmutableMessageGenerator::GenerateStaticVariables( - io::Printer* printer, int* bytecode_estimate) { - // Because descriptor.proto (com.google.protobuf.DescriptorProtos) is - // used in the construction of descriptors, we have a tricky bootstrapping - // problem. To help control static initialization order, we make sure all - // descriptors and other static data that depends on them are members of - // the outermost class in the file. This way, they will be initialized in - // a deterministic order. - - std::map vars; - vars["identifier"] = UniqueFileScopeIdentifier(descriptor_); - vars["index"] = StrCat(descriptor_->index()); - vars["classname"] = name_resolver_->GetImmutableClassName(descriptor_); - if (descriptor_->containing_type() != NULL) { - vars["parent"] = UniqueFileScopeIdentifier(descriptor_->containing_type()); - } - if (MultipleJavaFiles(descriptor_->file(), /* immutable = */ true)) { - // We can only make these package-private since the classes that use them - // are in separate files. - vars["private"] = ""; - } else { - vars["private"] = "private "; - } - if (*bytecode_estimate <= kMaxStaticSize) { - vars["final"] = "final "; - } else { - vars["final"] = ""; - } - - // The descriptor for this type. - printer->Print( - vars, - // TODO(teboring): final needs to be added back. The way to fix it is to - // generate methods that can construct the types, and then still declare - // the types, and then init them in clinit with the new method calls. - "$private$static $final$com.google.protobuf.Descriptors.Descriptor\n" - " internal_$identifier$_descriptor;\n"); - *bytecode_estimate += 30; - - // And the FieldAccessorTable. - GenerateFieldAccessorTable(printer, bytecode_estimate); - - // Generate static members for all nested types. - for (int i = 0; i < descriptor_->nested_type_count(); i++) { - // TODO(kenton): Reuse MessageGenerator objects? - ImmutableMessageGenerator(descriptor_->nested_type(i), context_) - .GenerateStaticVariables(printer, bytecode_estimate); - } -} - -int ImmutableMessageGenerator::GenerateStaticVariableInitializers( - io::Printer* printer) { - int bytecode_estimate = 0; - std::map vars; - vars["identifier"] = UniqueFileScopeIdentifier(descriptor_); - vars["index"] = StrCat(descriptor_->index()); - vars["classname"] = name_resolver_->GetImmutableClassName(descriptor_); - if (descriptor_->containing_type() != NULL) { - vars["parent"] = UniqueFileScopeIdentifier(descriptor_->containing_type()); - } - - // The descriptor for this type. - if (descriptor_->containing_type() == NULL) { - printer->Print(vars, - "internal_$identifier$_descriptor =\n" - " getDescriptor().getMessageTypes().get($index$);\n"); - bytecode_estimate += 30; - } else { - printer->Print( - vars, - "internal_$identifier$_descriptor =\n" - " internal_$parent$_descriptor.getNestedTypes().get($index$);\n"); - bytecode_estimate += 30; - } - - // And the FieldAccessorTable. - bytecode_estimate += GenerateFieldAccessorTableInitializer(printer); - - // Generate static member initializers for all nested types. - for (int i = 0; i < descriptor_->nested_type_count(); i++) { - // TODO(kenton): Reuse MessageGenerator objects? - bytecode_estimate += - ImmutableMessageGenerator(descriptor_->nested_type(i), context_) - .GenerateStaticVariableInitializers(printer); - } - return bytecode_estimate; -} - -void ImmutableMessageGenerator::GenerateFieldAccessorTable( - io::Printer* printer, int* bytecode_estimate) { - std::map vars; - vars["identifier"] = UniqueFileScopeIdentifier(descriptor_); - if (MultipleJavaFiles(descriptor_->file(), /* immutable = */ true)) { - // We can only make these package-private since the classes that use them - // are in separate files. - vars["private"] = ""; - } else { - vars["private"] = "private "; - } - if (*bytecode_estimate <= kMaxStaticSize) { - vars["final"] = "final "; - } else { - vars["final"] = ""; - } - vars["ver"] = GeneratedCodeVersionSuffix(); - printer->Print( - vars, - "$private$static $final$\n" - " com.google.protobuf.GeneratedMessage$ver$.FieldAccessorTable\n" - " internal_$identifier$_fieldAccessorTable;\n"); - - // The following bytecode_estimate calculation logic must stay in sync with - // the similar logic in the GenerateFieldAccessorTableInitializer method below - // to make sure that the generated static final fields are initialized in the - // static initialization block directly. - // - // 6 bytes per field and oneof - *bytecode_estimate += - 10 + 6 * descriptor_->field_count() + 6 * descriptor_->oneof_decl_count(); -} - -int ImmutableMessageGenerator::GenerateFieldAccessorTableInitializer( - io::Printer* printer) { - int bytecode_estimate = 10; - printer->Print( - "internal_$identifier$_fieldAccessorTable = new\n" - " com.google.protobuf.GeneratedMessage$ver$.FieldAccessorTable(\n" - " internal_$identifier$_descriptor,\n" - " new java.lang.String[] { ", - "identifier", UniqueFileScopeIdentifier(descriptor_), "ver", - GeneratedCodeVersionSuffix()); - // All the bytecode_estimate calculation logic in this method must stay in - // sync with the similar logic in the GenerateFieldAccessorTable method - // above. See the corresponding comment in GenerateFieldAccessorTable for - // details. - for (int i = 0; i < descriptor_->field_count(); i++) { - const FieldDescriptor* field = descriptor_->field(i); - const FieldGeneratorInfo* info = context_->GetFieldGeneratorInfo(field); - bytecode_estimate += 6; - printer->Print("\"$field_name$\", ", "field_name", info->capitalized_name); - } - // We reproduce synthetic oneofs here since proto reflection needs these. - for (int i = 0; i < descriptor_->oneof_decl_count(); i++) { - const OneofDescriptor* oneof = descriptor_->oneof_decl(i); - const OneofGeneratorInfo* info = context_->GetOneofGeneratorInfo(oneof); - bytecode_estimate += 6; - printer->Print("\"$oneof_name$\", ", "oneof_name", info->capitalized_name); - } - printer->Print("});\n"); - return bytecode_estimate; -} - -// =================================================================== - -void ImmutableMessageGenerator::GenerateInterface(io::Printer* printer) { - MaybePrintGeneratedAnnotation(context_, printer, descriptor_, - /* immutable = */ true, "OrBuilder"); - if (descriptor_->extension_range_count() > 0) { - printer->Print( - "$deprecation$public interface ${$$classname$OrBuilder$}$ extends\n" - " $extra_interfaces$\n" - " com.google.protobuf.GeneratedMessage$ver$.\n" - " ExtendableMessageOrBuilder<$classname$> {\n", - "deprecation", - descriptor_->options().deprecated() ? "@java.lang.Deprecated " : "", - "extra_interfaces", ExtraMessageOrBuilderInterfaces(descriptor_), - "classname", descriptor_->name(), "{", "", "}", "", "ver", - GeneratedCodeVersionSuffix()); - } else { - printer->Print( - "$deprecation$public interface ${$$classname$OrBuilder$}$ extends\n" - " $extra_interfaces$\n" - " com.google.protobuf.MessageOrBuilder {\n", - "deprecation", - descriptor_->options().deprecated() ? "@java.lang.Deprecated " : "", - "extra_interfaces", ExtraMessageOrBuilderInterfaces(descriptor_), - "classname", descriptor_->name(), "{", "", "}", ""); - } - printer->Annotate("{", "}", descriptor_); - - printer->Indent(); - for (int i = 0; i < descriptor_->field_count(); i++) { - printer->Print("\n"); - field_generators_.get(descriptor_->field(i)) - .GenerateInterfaceMembers(printer); - } - for (auto oneof : oneofs_) { - printer->Print( - "\n" - "public $classname$.$oneof_capitalized_name$Case " - "get$oneof_capitalized_name$Case();\n", - "oneof_capitalized_name", - context_->GetOneofGeneratorInfo(oneof)->capitalized_name, "classname", - context_->GetNameResolver()->GetImmutableClassName(descriptor_)); - } - printer->Outdent(); - - printer->Print("}\n"); -} - -// =================================================================== - -void ImmutableMessageGenerator::Generate(io::Printer* printer) { - bool is_own_file = IsOwnFile(descriptor_, /* immutable = */ true); - - std::map variables; - variables["static"] = is_own_file ? "" : "static "; - variables["classname"] = descriptor_->name(); - variables["extra_interfaces"] = ExtraMessageInterfaces(descriptor_); - variables["ver"] = GeneratedCodeVersionSuffix(); - variables["deprecation"] = - descriptor_->options().deprecated() ? "@java.lang.Deprecated " : ""; - - 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) { - printer->Print( - variables, - "$deprecation$public $static$final class $classname$ extends\n"); - printer->Annotate("classname", descriptor_); - printer->Print( - variables, - " com.google.protobuf.GeneratedMessage$ver$.ExtendableMessage<\n" - " $classname$> implements\n" - " $extra_interfaces$\n" - " $classname$OrBuilder {\n"); - builder_type = strings::Substitute( - "com.google.protobuf.GeneratedMessage$1.ExtendableBuilder<$0, ?>", - name_resolver_->GetImmutableClassName(descriptor_), - GeneratedCodeVersionSuffix()); - } else { - printer->Print( - variables, - "$deprecation$public $static$final class $classname$ extends\n"); - printer->Annotate("classname", descriptor_); - printer->Print(variables, - " com.google.protobuf.GeneratedMessage$ver$ implements\n" - " $extra_interfaces$\n" - " $classname$OrBuilder {\n"); - builder_type = - strings::Substitute("com.google.protobuf.GeneratedMessage$0.Builder", - GeneratedCodeVersionSuffix()); - } - printer->Print("private static final long serialVersionUID = 0L;\n"); - - printer->Indent(); - // Using builder_type, instead of Builder, prevents the Builder class from - // being loaded into PermGen space when the default instance is created. - // This optimizes the PermGen space usage for clients that do not modify - // messages. - printer->Print( - "// Use $classname$.newBuilder() to construct.\n" - "private $classname$($buildertype$ builder) {\n" - " super(builder);\n" - "}\n", - "classname", descriptor_->name(), "buildertype", builder_type); - printer->Print("private $classname$() {\n", "classname", descriptor_->name()); - printer->Indent(); - GenerateInitializers(printer); - printer->Outdent(); - printer->Print( - "}\n" - "\n"); - - printer->Print(variables, - "@java.lang.Override\n" - "@SuppressWarnings({\"unused\"})\n" - "protected java.lang.Object newInstance(\n" - " UnusedPrivateParameter unused) {\n" - " return new $classname$();\n" - "}\n" - "\n"); - - printer->Print( - "@java.lang.Override\n" - "public final com.google.protobuf.UnknownFieldSet\n" - "getUnknownFields() {\n" - " return this.unknownFields;\n" - "}\n"); - - if (context_->HasGeneratedMethods(descriptor_)) { - GenerateParsingConstructor(printer); - } - - GenerateDescriptorMethods(printer); - - // Nested types - for (int i = 0; i < descriptor_->enum_type_count(); i++) { - EnumGenerator(descriptor_->enum_type(i), true, context_).Generate(printer); - } - - for (int i = 0; i < descriptor_->nested_type_count(); i++) { - // Don't generate Java classes for map entry messages. - if (IsMapEntry(descriptor_->nested_type(i))) continue; - ImmutableMessageGenerator messageGenerator(descriptor_->nested_type(i), - context_); - messageGenerator.GenerateInterface(printer); - messageGenerator.Generate(printer); - } - - // Integers for bit fields. - int totalBits = 0; - for (int i = 0; i < descriptor_->field_count(); i++) { - totalBits += - field_generators_.get(descriptor_->field(i)).GetNumBitsForMessage(); - } - int totalInts = (totalBits + 31) / 32; - for (int i = 0; i < totalInts; i++) { - printer->Print("private int $bit_field_name$;\n", "bit_field_name", - GetBitFieldName(i)); - } - - // oneof - std::map vars; - for (auto oneof : oneofs_) { - vars["oneof_name"] = context_->GetOneofGeneratorInfo(oneof)->name; - vars["oneof_capitalized_name"] = - context_->GetOneofGeneratorInfo(oneof)->capitalized_name; - vars["oneof_index"] = StrCat((oneof)->index()); - // oneofCase_ and oneof_ - printer->Print(vars, - "private int $oneof_name$Case_ = 0;\n" - "private java.lang.Object $oneof_name$_;\n"); - // OneofCase enum - printer->Print( - vars, - "public enum $oneof_capitalized_name$Case\n" - // TODO(dweis): Remove EnumLite when we want to break compatibility with - // 3.x users - " implements com.google.protobuf.Internal.EnumLite,\n" - " com.google.protobuf.AbstractMessage.InternalOneOfEnum {\n"); - printer->Indent(); - for (int j = 0; j < (oneof)->field_count(); j++) { - const FieldDescriptor* field = (oneof)->field(j); - printer->Print( - "$deprecation$$field_name$($field_number$),\n", "deprecation", - field->options().deprecated() ? "@java.lang.Deprecated " : "", - "field_name", ToUpper(field->name()), "field_number", - StrCat(field->number())); - } - printer->Print("$cap_oneof_name$_NOT_SET(0);\n", "cap_oneof_name", - ToUpper(vars["oneof_name"])); - printer->Print(vars, - "private final int value;\n" - "private $oneof_capitalized_name$Case(int value) {\n" - " this.value = value;\n" - "}\n"); - printer->Print( - vars, - "/**\n" - " * @param value The number of the enum to look for.\n" - " * @return The enum associated with the given number.\n" - " * @deprecated Use {@link #forNumber(int)} instead.\n" - " */\n" - "@java.lang.Deprecated\n" - "public static $oneof_capitalized_name$Case valueOf(int value) {\n" - " return forNumber(value);\n" - "}\n" - "\n" - "public static $oneof_capitalized_name$Case forNumber(int value) {\n" - " switch (value) {\n"); - for (int j = 0; j < (oneof)->field_count(); j++) { - const FieldDescriptor* field = (oneof)->field(j); - printer->Print(" case $field_number$: return $field_name$;\n", - "field_number", StrCat(field->number()), - "field_name", ToUpper(field->name())); - } - printer->Print( - " case 0: return $cap_oneof_name$_NOT_SET;\n" - " default: return null;\n" - " }\n" - "}\n" - "public int getNumber() {\n" - " return this.value;\n" - "}\n", - "cap_oneof_name", ToUpper(vars["oneof_name"])); - printer->Outdent(); - printer->Print("};\n\n"); - // oneofCase() - printer->Print(vars, - "public $oneof_capitalized_name$Case\n" - "get$oneof_capitalized_name$Case() {\n" - " return $oneof_capitalized_name$Case.forNumber(\n" - " $oneof_name$Case_);\n" - "}\n" - "\n"); - } - - if (IsAnyMessage(descriptor_)) { - GenerateAnyMethods(printer); - } - - // Fields - for (int i = 0; i < descriptor_->field_count(); i++) { - printer->Print("public static final int $constant_name$ = $number$;\n", - "constant_name", FieldConstantName(descriptor_->field(i)), - "number", StrCat(descriptor_->field(i)->number())); - printer->Annotate("constant_name", descriptor_->field(i)); - field_generators_.get(descriptor_->field(i)).GenerateMembers(printer); - printer->Print("\n"); - } - - if (context_->HasGeneratedMethods(descriptor_)) { - GenerateIsInitialized(printer); - GenerateMessageSerializationMethods(printer); - GenerateEqualsAndHashCode(printer); - } - - - GenerateParseFromMethods(printer); - GenerateBuilder(printer); - - printer->Print( - "\n" - "// @@protoc_insertion_point(class_scope:$full_name$)\n", - "full_name", descriptor_->full_name()); - - // Carefully initialize the default instance in such a way that it doesn't - // conflict with other initialization. - printer->Print("private static final $classname$ DEFAULT_INSTANCE;\n", - "classname", - name_resolver_->GetImmutableClassName(descriptor_)); - printer->Print( - "static {\n" - " DEFAULT_INSTANCE = new $classname$();\n" - "}\n" - "\n", - "classname", name_resolver_->GetImmutableClassName(descriptor_)); - - printer->Print( - "public static $classname$ getDefaultInstance() {\n" - " return DEFAULT_INSTANCE;\n" - "}\n" - "\n", - "classname", name_resolver_->GetImmutableClassName(descriptor_)); - - // 'of' method for Wrappers - if (IsWrappersProtoFile(descriptor_->file())) { - printer->Print( - "public static $classname$ of($field_type$ value) {\n" - " return newBuilder().setValue(value).build();\n" - "}\n" - "\n", - "classname", name_resolver_->GetImmutableClassName(descriptor_), - "field_type", PrimitiveTypeName(GetJavaType(descriptor_->field(0)))); - } - - GenerateParser(printer); - - printer->Print( - "@java.lang.Override\n" - "public $classname$ getDefaultInstanceForType() {\n" - " return DEFAULT_INSTANCE;\n" - "}\n" - "\n", - "classname", name_resolver_->GetImmutableClassName(descriptor_)); - - // Extensions must be declared after the DEFAULT_INSTANCE is initialized - // because the DEFAULT_INSTANCE is used by the extension to lazily retrieve - // the outer class's FileDescriptor. - for (int i = 0; i < descriptor_->extension_count(); i++) { - ImmutableExtensionGenerator(descriptor_->extension(i), context_) - .Generate(printer); - } - - printer->Outdent(); - printer->Print("}\n\n"); -} - -// =================================================================== - -void ImmutableMessageGenerator::GenerateMessageSerializationMethods( - io::Printer* printer) { - std::unique_ptr sorted_fields( - SortFieldsByNumber(descriptor_)); - - std::vector sorted_extensions; - sorted_extensions.reserve(descriptor_->extension_range_count()); - for (int i = 0; i < descriptor_->extension_range_count(); ++i) { - sorted_extensions.push_back(descriptor_->extension_range(i)); - } - std::sort(sorted_extensions.begin(), sorted_extensions.end(), - ExtensionRangeOrdering()); - printer->Print( - "@java.lang.Override\n" - "public void writeTo(com.google.protobuf.CodedOutputStream output)\n" - " throws java.io.IOException {\n"); - printer->Indent(); - - if (HasPackedFields(descriptor_)) { - // writeTo(CodedOutputStream output) might be invoked without - // getSerializedSize() ever being called, but we need the memoized - // sizes in case this message has packed fields. Rather than emit checks - // for each packed field, just call getSerializedSize() up front. In most - // cases, getSerializedSize() will have already been called anyway by one - // of the wrapper writeTo() methods, making this call cheap. - printer->Print("getSerializedSize();\n"); - } - - if (descriptor_->extension_range_count() > 0) { - if (descriptor_->options().message_set_wire_format()) { - printer->Print( - "com.google.protobuf.GeneratedMessage$ver$\n" - " .ExtendableMessage<$classname$>.ExtensionWriter\n" - " extensionWriter = newMessageSetExtensionWriter();\n", - "classname", name_resolver_->GetImmutableClassName(descriptor_), - "ver", GeneratedCodeVersionSuffix()); - } else { - printer->Print( - "com.google.protobuf.GeneratedMessage$ver$\n" - " .ExtendableMessage<$classname$>.ExtensionWriter\n" - " extensionWriter = newExtensionWriter();\n", - "classname", name_resolver_->GetImmutableClassName(descriptor_), - "ver", GeneratedCodeVersionSuffix()); - } - } - - // Merge the fields and the extension ranges, both sorted by field number. - for (int i = 0, j = 0; - i < descriptor_->field_count() || j < sorted_extensions.size();) { - if (i == descriptor_->field_count()) { - GenerateSerializeOneExtensionRange(printer, sorted_extensions[j++]); - } else if (j == sorted_extensions.size()) { - GenerateSerializeOneField(printer, sorted_fields[i++]); - } else if (sorted_fields[i]->number() < sorted_extensions[j]->start) { - GenerateSerializeOneField(printer, sorted_fields[i++]); - } else { - GenerateSerializeOneExtensionRange(printer, sorted_extensions[j++]); - } - } - - if (descriptor_->options().message_set_wire_format()) { - printer->Print("unknownFields.writeAsMessageSetTo(output);\n"); - } else { - printer->Print("unknownFields.writeTo(output);\n"); - } - - printer->Outdent(); - printer->Print( - "}\n" - "\n" - "@java.lang.Override\n" - "public int getSerializedSize() {\n" - " int size = memoizedSize;\n" - " if (size != -1) return size;\n" - "\n"); - printer->Indent(); - - printer->Print("size = 0;\n"); - - for (int i = 0; i < descriptor_->field_count(); i++) { - field_generators_.get(sorted_fields[i]).GenerateSerializedSizeCode(printer); - } - - if (descriptor_->extension_range_count() > 0) { - if (descriptor_->options().message_set_wire_format()) { - printer->Print("size += extensionsSerializedSizeAsMessageSet();\n"); - } else { - printer->Print("size += extensionsSerializedSize();\n"); - } - } - - if (descriptor_->options().message_set_wire_format()) { - printer->Print("size += unknownFields.getSerializedSizeAsMessageSet();\n"); - } else { - printer->Print("size += unknownFields.getSerializedSize();\n"); - } - - printer->Print( - "memoizedSize = size;\n" - "return size;\n"); - - printer->Outdent(); - printer->Print( - "}\n" - "\n"); -} - -void ImmutableMessageGenerator::GenerateParseFromMethods(io::Printer* printer) { - // Note: These are separate from GenerateMessageSerializationMethods() - // because they need to be generated even for messages that are optimized - // for code size. - printer->Print( - "public static $classname$ parseFrom(\n" - " java.nio.ByteBuffer data)\n" - " throws com.google.protobuf.InvalidProtocolBufferException {\n" - " return PARSER.parseFrom(data);\n" - "}\n" - "public static $classname$ parseFrom(\n" - " java.nio.ByteBuffer data,\n" - " com.google.protobuf.ExtensionRegistryLite extensionRegistry)\n" - " throws com.google.protobuf.InvalidProtocolBufferException {\n" - " return PARSER.parseFrom(data, extensionRegistry);\n" - "}\n" - "public static $classname$ parseFrom(\n" - " com.google.protobuf.ByteString data)\n" - " throws com.google.protobuf.InvalidProtocolBufferException {\n" - " return PARSER.parseFrom(data);\n" - "}\n" - "public static $classname$ parseFrom(\n" - " com.google.protobuf.ByteString data,\n" - " com.google.protobuf.ExtensionRegistryLite extensionRegistry)\n" - " throws com.google.protobuf.InvalidProtocolBufferException {\n" - " return PARSER.parseFrom(data, extensionRegistry);\n" - "}\n" - "public static $classname$ parseFrom(byte[] data)\n" - " throws com.google.protobuf.InvalidProtocolBufferException {\n" - " return PARSER.parseFrom(data);\n" - "}\n" - "public static $classname$ parseFrom(\n" - " byte[] data,\n" - " com.google.protobuf.ExtensionRegistryLite extensionRegistry)\n" - " throws com.google.protobuf.InvalidProtocolBufferException {\n" - " return PARSER.parseFrom(data, extensionRegistry);\n" - "}\n" - "public static $classname$ parseFrom(java.io.InputStream input)\n" - " throws java.io.IOException {\n" - " return com.google.protobuf.GeneratedMessage$ver$\n" - " .parseWithIOException(PARSER, input);\n" - "}\n" - "public static $classname$ parseFrom(\n" - " java.io.InputStream input,\n" - " com.google.protobuf.ExtensionRegistryLite extensionRegistry)\n" - " throws java.io.IOException {\n" - " return com.google.protobuf.GeneratedMessage$ver$\n" - " .parseWithIOException(PARSER, input, extensionRegistry);\n" - "}\n" - "public static $classname$ parseDelimitedFrom(java.io.InputStream " - "input)\n" - " throws java.io.IOException {\n" - " return com.google.protobuf.GeneratedMessage$ver$\n" - " .parseDelimitedWithIOException(PARSER, input);\n" - "}\n" - "public static $classname$ parseDelimitedFrom(\n" - " java.io.InputStream input,\n" - " com.google.protobuf.ExtensionRegistryLite extensionRegistry)\n" - " throws java.io.IOException {\n" - " return com.google.protobuf.GeneratedMessage$ver$\n" - " .parseDelimitedWithIOException(PARSER, input, " - "extensionRegistry);\n" - "}\n" - "public static $classname$ parseFrom(\n" - " com.google.protobuf.CodedInputStream input)\n" - " throws java.io.IOException {\n" - " return com.google.protobuf.GeneratedMessage$ver$\n" - " .parseWithIOException(PARSER, input);\n" - "}\n" - "public static $classname$ parseFrom(\n" - " com.google.protobuf.CodedInputStream input,\n" - " com.google.protobuf.ExtensionRegistryLite extensionRegistry)\n" - " throws java.io.IOException {\n" - " return com.google.protobuf.GeneratedMessage$ver$\n" - " .parseWithIOException(PARSER, input, extensionRegistry);\n" - "}\n" - "\n", - "classname", name_resolver_->GetImmutableClassName(descriptor_), "ver", - GeneratedCodeVersionSuffix()); -} - -void ImmutableMessageGenerator::GenerateSerializeOneField( - io::Printer* printer, const FieldDescriptor* field) { - field_generators_.get(field).GenerateSerializationCode(printer); -} - -void ImmutableMessageGenerator::GenerateSerializeOneExtensionRange( - io::Printer* printer, const Descriptor::ExtensionRange* range) { - printer->Print("extensionWriter.writeUntil($end$, output);\n", "end", - StrCat(range->end)); -} - -// =================================================================== - -void ImmutableMessageGenerator::GenerateBuilder(io::Printer* printer) { - // LITE_RUNTIME implements this at the GeneratedMessageLite level. - printer->Print( - "@java.lang.Override\n" - "public Builder newBuilderForType() { return newBuilder(); }\n"); - - printer->Print( - "public static Builder newBuilder() {\n" - " return DEFAULT_INSTANCE.toBuilder();\n" - "}\n" - "public static Builder newBuilder($classname$ prototype) {\n" - " return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype);\n" - "}\n" - "@java.lang.Override\n" - "public Builder toBuilder() {\n" - " return this == DEFAULT_INSTANCE\n" - " ? new Builder() : new Builder().mergeFrom(this);\n" - "}\n" - "\n", - "classname", name_resolver_->GetImmutableClassName(descriptor_)); - - printer->Print( - "@java.lang.Override\n" - "protected Builder newBuilderForType(\n" - " com.google.protobuf.GeneratedMessage$ver$.BuilderParent parent) {\n" - " Builder builder = new Builder(parent);\n" - " return builder;\n" - "}\n", - "ver", GeneratedCodeVersionSuffix()); - - MessageBuilderGenerator builderGenerator(descriptor_, context_); - builderGenerator.Generate(printer); -} - -void ImmutableMessageGenerator::GenerateDescriptorMethods( - io::Printer* printer) { - if (!descriptor_->options().no_standard_descriptor_accessor()) { - printer->Print( - "public static final com.google.protobuf.Descriptors.Descriptor\n" - " getDescriptor() {\n" - " return $fileclass$.internal_$identifier$_descriptor;\n" - "}\n" - "\n", - "fileclass", name_resolver_->GetImmutableClassName(descriptor_->file()), - "identifier", UniqueFileScopeIdentifier(descriptor_)); - } - std::vector map_fields; - for (int i = 0; i < descriptor_->field_count(); i++) { - const FieldDescriptor* field = descriptor_->field(i); - if (GetJavaType(field) == JAVATYPE_MESSAGE && - IsMapEntry(field->message_type())) { - map_fields.push_back(field); - } - } - if (!map_fields.empty()) { - printer->Print( - "@SuppressWarnings({\"rawtypes\"})\n" - "@java.lang.Override\n" - "protected com.google.protobuf.MapField internalGetMapField(\n" - " int number) {\n" - " switch (number) {\n"); - printer->Indent(); - printer->Indent(); - for (int i = 0; i < map_fields.size(); ++i) { - const FieldDescriptor* field = map_fields[i]; - const FieldGeneratorInfo* info = context_->GetFieldGeneratorInfo(field); - printer->Print( - "case $number$:\n" - " return internalGet$capitalized_name$();\n", - "number", StrCat(field->number()), "capitalized_name", - info->capitalized_name); - } - printer->Print( - "default:\n" - " throw new RuntimeException(\n" - " \"Invalid map field number: \" + number);\n"); - printer->Outdent(); - printer->Outdent(); - printer->Print( - " }\n" - "}\n"); - } - printer->Print( - "@java.lang.Override\n" - "protected com.google.protobuf.GeneratedMessage$ver$.FieldAccessorTable\n" - " internalGetFieldAccessorTable() {\n" - " return $fileclass$.internal_$identifier$_fieldAccessorTable\n" - " .ensureFieldAccessorsInitialized(\n" - " $classname$.class, $classname$.Builder.class);\n" - "}\n" - "\n", - "classname", name_resolver_->GetImmutableClassName(descriptor_), - "fileclass", name_resolver_->GetImmutableClassName(descriptor_->file()), - "identifier", UniqueFileScopeIdentifier(descriptor_), "ver", - GeneratedCodeVersionSuffix()); -} - -// =================================================================== - -void ImmutableMessageGenerator::GenerateIsInitialized(io::Printer* printer) { - // Memoizes whether the protocol buffer is fully initialized (has all - // required fields). -1 means not yet computed. 0 means false and 1 means - // true. - printer->Print("private byte memoizedIsInitialized = -1;\n"); - printer->Print( - "@java.lang.Override\n" - "public final boolean isInitialized() {\n"); - printer->Indent(); - - // Don't directly compare to -1 to avoid an Android x86 JIT bug. - printer->Print( - "byte isInitialized = memoizedIsInitialized;\n" - "if (isInitialized == 1) return true;\n" - "if (isInitialized == 0) return false;\n" - "\n"); - - // Check that all required fields in this message are set. - // TODO(kenton): We can optimize this when we switch to putting all the - // "has" fields into a single bitfield. - for (int i = 0; i < descriptor_->field_count(); i++) { - const FieldDescriptor* field = descriptor_->field(i); - const FieldGeneratorInfo* info = context_->GetFieldGeneratorInfo(field); - - if (field->is_required()) { - printer->Print( - "if (!has$name$()) {\n" - " memoizedIsInitialized = 0;\n" - " return false;\n" - "}\n", - "name", info->capitalized_name); - } - } - - // Now check that all embedded messages are initialized. - for (int i = 0; i < descriptor_->field_count(); i++) { - const FieldDescriptor* field = descriptor_->field(i); - const FieldGeneratorInfo* info = context_->GetFieldGeneratorInfo(field); - if (GetJavaType(field) == JAVATYPE_MESSAGE && - HasRequiredFields(field->message_type())) { - switch (field->label()) { - case FieldDescriptor::LABEL_REQUIRED: - printer->Print( - "if (!get$name$().isInitialized()) {\n" - " memoizedIsInitialized = 0;\n" - " return false;\n" - "}\n", - "type", - name_resolver_->GetImmutableClassName(field->message_type()), - "name", info->capitalized_name); - break; - case FieldDescriptor::LABEL_OPTIONAL: - printer->Print( - "if (has$name$()) {\n" - " if (!get$name$().isInitialized()) {\n" - " memoizedIsInitialized = 0;\n" - " return false;\n" - " }\n" - "}\n", - "name", info->capitalized_name); - break; - case FieldDescriptor::LABEL_REPEATED: - if (IsMapEntry(field->message_type())) { - printer->Print( - "for ($type$ item : get$name$Map().values()) {\n" - " if (!item.isInitialized()) {\n" - " memoizedIsInitialized = 0;\n" - " return false;\n" - " }\n" - "}\n", - "type", - MapValueImmutableClassdName(field->message_type(), - name_resolver_), - "name", info->capitalized_name); - } else { - printer->Print( - "for (int i = 0; i < get$name$Count(); i++) {\n" - " if (!get$name$(i).isInitialized()) {\n" - " memoizedIsInitialized = 0;\n" - " return false;\n" - " }\n" - "}\n", - "type", - name_resolver_->GetImmutableClassName(field->message_type()), - "name", info->capitalized_name); - } - break; - } - } - } - - if (descriptor_->extension_range_count() > 0) { - printer->Print( - "if (!extensionsAreInitialized()) {\n" - " memoizedIsInitialized = 0;\n" - " return false;\n" - "}\n"); - } - - printer->Outdent(); - - printer->Print(" memoizedIsInitialized = 1;\n"); - - printer->Print( - " return true;\n" - "}\n" - "\n"); -} - -// =================================================================== - -namespace { -bool CheckHasBitsForEqualsAndHashCode(const FieldDescriptor* field) { - if (field->is_repeated()) { - return false; - } - if (HasHasbit(field)) { - return true; - } - return GetJavaType(field) == JAVATYPE_MESSAGE && !IsRealOneof(field); -} -} // namespace - -void ImmutableMessageGenerator::GenerateEqualsAndHashCode( - io::Printer* printer) { - printer->Print( - "@java.lang.Override\n" - "public boolean equals("); - printer->Print("final java.lang.Object obj) {\n"); - printer->Indent(); - printer->Print( - "if (obj == this) {\n" - " return true;\n" - "}\n" - "if (!(obj instanceof $classname$)) {\n" - " return super.equals(obj);\n" - "}\n" - "$classname$ other = ($classname$) obj;\n" - "\n", - "classname", name_resolver_->GetImmutableClassName(descriptor_)); - - for (int i = 0; i < descriptor_->field_count(); i++) { - const FieldDescriptor* field = descriptor_->field(i); - if (!IsRealOneof(field)) { - const FieldGeneratorInfo* info = context_->GetFieldGeneratorInfo(field); - bool check_has_bits = CheckHasBitsForEqualsAndHashCode(field); - if (check_has_bits) { - printer->Print( - "if (has$name$() != other.has$name$()) return false;\n" - "if (has$name$()) {\n", - "name", info->capitalized_name); - printer->Indent(); - } - field_generators_.get(field).GenerateEqualsCode(printer); - if (check_has_bits) { - printer->Outdent(); - printer->Print("}\n"); - } - } - } - - // Compare oneofs. - for (auto oneof : oneofs_) { - printer->Print( - "if (!get$oneof_capitalized_name$Case().equals(" - "other.get$oneof_capitalized_name$Case())) return false;\n", - "oneof_capitalized_name", - context_->GetOneofGeneratorInfo(oneof)->capitalized_name); - printer->Print("switch ($oneof_name$Case_) {\n", "oneof_name", - context_->GetOneofGeneratorInfo(oneof)->name); - printer->Indent(); - for (int j = 0; j < (oneof)->field_count(); j++) { - const FieldDescriptor* field = (oneof)->field(j); - printer->Print("case $field_number$:\n", "field_number", - StrCat(field->number())); - printer->Indent(); - field_generators_.get(field).GenerateEqualsCode(printer); - printer->Print("break;\n"); - printer->Outdent(); - } - printer->Print( - "case 0:\n" - "default:\n"); - printer->Outdent(); - printer->Print("}\n"); - } - - // Always consider unknown fields for equality. This will sometimes return - // false for non-canonical ordering when running in LITE_RUNTIME but it's - // the best we can do. - printer->Print( - "if (!unknownFields.equals(other.unknownFields)) return false;\n"); - if (descriptor_->extension_range_count() > 0) { - printer->Print( - "if (!getExtensionFields().equals(other.getExtensionFields()))\n" - " return false;\n"); - } - printer->Print("return true;\n"); - printer->Outdent(); - printer->Print( - "}\n" - "\n"); - - printer->Print( - "@java.lang.Override\n" - "public int hashCode() {\n"); - printer->Indent(); - printer->Print("if (memoizedHashCode != 0) {\n"); - printer->Indent(); - printer->Print("return memoizedHashCode;\n"); - printer->Outdent(); - printer->Print( - "}\n" - "int hash = 41;\n"); - - // If we output a getDescriptor() method, use that as it is more efficient. - if (descriptor_->options().no_standard_descriptor_accessor()) { - printer->Print("hash = (19 * hash) + getDescriptorForType().hashCode();\n"); - } else { - printer->Print("hash = (19 * hash) + getDescriptor().hashCode();\n"); - } - - // hashCode non-oneofs. - for (int i = 0; i < descriptor_->field_count(); i++) { - const FieldDescriptor* field = descriptor_->field(i); - if (!IsRealOneof(field)) { - const FieldGeneratorInfo* info = context_->GetFieldGeneratorInfo(field); - bool check_has_bits = CheckHasBitsForEqualsAndHashCode(field); - if (check_has_bits) { - printer->Print("if (has$name$()) {\n", "name", info->capitalized_name); - printer->Indent(); - } - field_generators_.get(field).GenerateHashCode(printer); - if (check_has_bits) { - printer->Outdent(); - printer->Print("}\n"); - } - } - } - - // hashCode oneofs. - for (auto oneof : oneofs_) { - printer->Print("switch ($oneof_name$Case_) {\n", "oneof_name", - context_->GetOneofGeneratorInfo(oneof)->name); - printer->Indent(); - for (int j = 0; j < (oneof)->field_count(); j++) { - const FieldDescriptor* field = (oneof)->field(j); - printer->Print("case $field_number$:\n", "field_number", - StrCat(field->number())); - printer->Indent(); - field_generators_.get(field).GenerateHashCode(printer); - printer->Print("break;\n"); - printer->Outdent(); - } - printer->Print( - "case 0:\n" - "default:\n"); - printer->Outdent(); - printer->Print("}\n"); - } - - if (descriptor_->extension_range_count() > 0) { - printer->Print("hash = hashFields(hash, getExtensionFields());\n"); - } - - printer->Print("hash = (29 * hash) + unknownFields.hashCode();\n"); - printer->Print( - "memoizedHashCode = hash;\n" - "return hash;\n"); - printer->Outdent(); - printer->Print( - "}\n" - "\n"); -} - -// =================================================================== - -void ImmutableMessageGenerator::GenerateExtensionRegistrationCode( - io::Printer* printer) { - for (int i = 0; i < descriptor_->extension_count(); i++) { - ImmutableExtensionGenerator(descriptor_->extension(i), context_) - .GenerateRegistrationCode(printer); - } - - for (int i = 0; i < descriptor_->nested_type_count(); i++) { - ImmutableMessageGenerator(descriptor_->nested_type(i), context_) - .GenerateExtensionRegistrationCode(printer); - } -} - -// =================================================================== -void ImmutableMessageGenerator::GenerateParsingConstructor( - io::Printer* printer) { - std::unique_ptr sorted_fields( - SortFieldsByNumber(descriptor_)); - - printer->Print( - "private $classname$(\n" - " com.google.protobuf.CodedInputStream input,\n" - " com.google.protobuf.ExtensionRegistryLite extensionRegistry)\n" - " throws com.google.protobuf.InvalidProtocolBufferException {\n", - "classname", descriptor_->name()); - printer->Indent(); - - // Initialize all fields to default. - printer->Print( - "this();\n" - "if (extensionRegistry == null) {\n" - " throw new java.lang.NullPointerException();\n" - "}\n"); - - // Use builder bits to track mutable repeated fields. - int totalBuilderBits = 0; - for (int i = 0; i < descriptor_->field_count(); i++) { - const ImmutableFieldGenerator& field = - field_generators_.get(descriptor_->field(i)); - totalBuilderBits += field.GetNumBitsForBuilder(); - } - int totalBuilderInts = (totalBuilderBits + 31) / 32; - for (int i = 0; i < totalBuilderInts; i++) { - printer->Print("int mutable_$bit_field_name$ = 0;\n", "bit_field_name", - GetBitFieldName(i)); - } - - printer->Print( - "com.google.protobuf.UnknownFieldSet.Builder unknownFields =\n" - " com.google.protobuf.UnknownFieldSet.newBuilder();\n"); - - printer->Print("try {\n"); - printer->Indent(); - - printer->Print( - "boolean done = false;\n" - "while (!done) {\n"); - printer->Indent(); - - printer->Print( - "int tag = input.readTag();\n" - "switch (tag) {\n"); - printer->Indent(); - - printer->Print( - "case 0:\n" // zero signals EOF / limit reached - " done = true;\n" - " break;\n"); - - for (int i = 0; i < descriptor_->field_count(); i++) { - const FieldDescriptor* field = sorted_fields[i]; - uint32_t tag = WireFormatLite::MakeTag( - field->number(), WireFormat::WireTypeForFieldType(field->type())); - - printer->Print("case $tag$: {\n", "tag", - StrCat(static_cast(tag))); - printer->Indent(); - - field_generators_.get(field).GenerateParsingCode(printer); - - printer->Outdent(); - printer->Print( - " break;\n" - "}\n"); - - if (field->is_packable()) { - // To make packed = true wire compatible, we generate parsing code from a - // packed version of this field regardless of field->options().packed(). - uint32_t packed_tag = WireFormatLite::MakeTag( - field->number(), WireFormatLite::WIRETYPE_LENGTH_DELIMITED); - printer->Print("case $tag$: {\n", "tag", - StrCat(static_cast(packed_tag))); - printer->Indent(); - - field_generators_.get(field).GenerateParsingCodeFromPacked(printer); - - printer->Outdent(); - printer->Print( - " break;\n" - "}\n"); - } - } - - printer->Print( - "default: {\n" - " if (!parseUnknownField(\n" - " input, unknownFields, extensionRegistry, tag)) {\n" - " done = true;\n" // it's an endgroup tag - " }\n" - " break;\n" - "}\n"); - - printer->Outdent(); - printer->Outdent(); - printer->Print( - " }\n" // switch (tag) - "}\n"); // while (!done) - - printer->Outdent(); - printer->Print( - "} catch (com.google.protobuf.InvalidProtocolBufferException e) {\n" - " throw e.setUnfinishedMessage(this);\n" - "} catch (java.io.IOException e) {\n" - " throw new com.google.protobuf.InvalidProtocolBufferException(\n" - " e).setUnfinishedMessage(this);\n" - "} finally {\n"); - printer->Indent(); - - // Make repeated field list immutable. - for (int i = 0; i < descriptor_->field_count(); i++) { - const FieldDescriptor* field = sorted_fields[i]; - field_generators_.get(field).GenerateParsingDoneCode(printer); - } - - // Make unknown fields immutable. - printer->Print("this.unknownFields = unknownFields.build();\n"); - - // Make extensions immutable. - printer->Print("makeExtensionsImmutable();\n"); - - printer->Outdent(); - printer->Outdent(); - printer->Print( - " }\n" // finally - "}\n"); -} - -// =================================================================== -void ImmutableMessageGenerator::GenerateParser(io::Printer* printer) { - printer->Print( - "$visibility$ static final com.google.protobuf.Parser<$classname$>\n" - " PARSER = new com.google.protobuf.AbstractParser<$classname$>() {\n", - "visibility", - ExposePublicParser(descriptor_->file()) ? "@java.lang.Deprecated public" - : "private", - "classname", descriptor_->name()); - printer->Indent(); - printer->Print( - "@java.lang.Override\n" - "public $classname$ parsePartialFrom(\n" - " com.google.protobuf.CodedInputStream input,\n" - " com.google.protobuf.ExtensionRegistryLite extensionRegistry)\n" - " throws com.google.protobuf.InvalidProtocolBufferException {\n", - "classname", descriptor_->name()); - if (context_->HasGeneratedMethods(descriptor_)) { - printer->Print(" return new $classname$(input, extensionRegistry);\n", - "classname", descriptor_->name()); - } else { - // When parsing constructor isn't generated, use builder to parse - // messages. Note, will fallback to use reflection based mergeFieldFrom() - // in AbstractMessage.Builder. - printer->Indent(); - printer->Print( - "Builder builder = newBuilder();\n" - "try {\n" - " builder.mergeFrom(input, extensionRegistry);\n" - "} catch (com.google.protobuf.InvalidProtocolBufferException e) {\n" - " throw e.setUnfinishedMessage(builder.buildPartial());\n" - "} catch (java.io.IOException e) {\n" - " throw new com.google.protobuf.InvalidProtocolBufferException(\n" - " e.getMessage()).setUnfinishedMessage(\n" - " builder.buildPartial());\n" - "}\n" - "return builder.buildPartial();\n"); - printer->Outdent(); - } - printer->Print("}\n"); - printer->Outdent(); - printer->Print( - "};\n" - "\n"); - - printer->Print( - "public static com.google.protobuf.Parser<$classname$> parser() {\n" - " return PARSER;\n" - "}\n" - "\n" - "@java.lang.Override\n" - "public com.google.protobuf.Parser<$classname$> getParserForType() {\n" - " return PARSER;\n" - "}\n" - "\n", - "classname", descriptor_->name()); -} - -// =================================================================== -void ImmutableMessageGenerator::GenerateInitializers(io::Printer* printer) { - for (int i = 0; i < descriptor_->field_count(); i++) { - if (!IsRealOneof(descriptor_->field(i))) { - field_generators_.get(descriptor_->field(i)) - .GenerateInitializationCode(printer); - } - } -} - -// =================================================================== -void ImmutableMessageGenerator::GenerateMutableCopy(io::Printer* printer) { - printer->Print( - "protected com.google.protobuf.MutableMessage\n" - " internalMutableDefault() {\n" - " return MutableDefaultLoader.get();\n" - "}\n" - "\n" - "private static final class MutableDefaultLoader {\n" - " private static final java.lang.Object defaultOrRuntimeException;\n" - " static {\n" - " java.lang.Object local;\n" - " try {\n" - " local = internalMutableDefault(\"$mutable_name$\");\n" - " } catch (java.lang.RuntimeException e) {\n" - " local = e;\n" - " }\n" - " defaultOrRuntimeException = local;\n" - " }\n" - "\n" - " private MutableDefaultLoader() {}\n" - "\n" - " public static com.google.protobuf.MutableMessage get() {\n" - " if (defaultOrRuntimeException\n" - " instanceof java.lang.RuntimeException) {\n" - " throw (java.lang.RuntimeException) defaultOrRuntimeException;\n" - " }\n" - " return\n" - " (com.google.protobuf.MutableMessage) " - "defaultOrRuntimeException;\n" - " }\n" - "}\n", - "mutable_name", name_resolver_->GetJavaMutableClassName(descriptor_)); -} - -void ImmutableMessageGenerator::GenerateKotlinDsl(io::Printer* printer) const { - printer->Print( - "@kotlin.OptIn" - "(com.google.protobuf.kotlin.OnlyForUseByGeneratedProtoCode::class)\n" - "@com.google.protobuf.kotlin.ProtoDslMarker\n"); - printer->Print( - "public class Dsl private constructor(\n" - " private val _builder: $message$.Builder\n" - ") {\n" - " public companion object {\n" - " @kotlin.jvm.JvmSynthetic\n" - " @kotlin.PublishedApi\n" - " internal fun _create(builder: $message$.Builder): Dsl = " - "Dsl(builder)\n" - " }\n" - "\n" - " @kotlin.jvm.JvmSynthetic\n" - " @kotlin.PublishedApi\n" - " internal fun _build(): $message$ = _builder.build()\n", - "message", name_resolver_->GetClassName(descriptor_, true)); - - printer->Indent(); - - for (int i = 0; i < descriptor_->field_count(); i++) { - printer->Print("\n"); - field_generators_.get(descriptor_->field(i)) - .GenerateKotlinDslMembers(printer); - } - - for (auto oneof : oneofs_) { - printer->Print( - "public val $oneof_name$Case: $message$.$oneof_capitalized_name$Case\n" - " @JvmName(\"get$oneof_capitalized_name$Case\")\n" - " get() = _builder.get$oneof_capitalized_name$Case()\n\n" - "public fun clear$oneof_capitalized_name$() {\n" - " _builder.clear$oneof_capitalized_name$()\n" - "}\n", - "oneof_name", context_->GetOneofGeneratorInfo(oneof)->name, - "oneof_capitalized_name", - context_->GetOneofGeneratorInfo(oneof)->capitalized_name, "message", - name_resolver_->GetClassName(descriptor_, true)); - } - - if (descriptor_->extension_range_count() > 0) { - GenerateKotlinExtensions(printer); - } - - printer->Outdent(); - printer->Print("}\n"); -} - -void ImmutableMessageGenerator::GenerateKotlinMembers( - io::Printer* printer) const { - printer->Print( - "@kotlin.jvm.JvmSynthetic\n" - "public inline fun $camelcase_name$(block: $message_kt$.Dsl.() -> " - "kotlin.Unit): " - "$message$ " - "=\n" - " $message_kt$.Dsl._create($message$.newBuilder()).apply { block() " - "}._build()\n", - "camelcase_name", name_resolver_->GetKotlinFactoryName(descriptor_), - "message_kt", name_resolver_->GetKotlinExtensionsClassName(descriptor_), - "message", name_resolver_->GetClassName(descriptor_, true)); - - printer->Print("public object $name$Kt {\n", "name", descriptor_->name()); - printer->Indent(); - GenerateKotlinDsl(printer); - for (int i = 0; i < descriptor_->nested_type_count(); i++) { - if (IsMapEntry(descriptor_->nested_type(i))) continue; - ImmutableMessageGenerator(descriptor_->nested_type(i), context_) - .GenerateKotlinMembers(printer); - } - printer->Outdent(); - printer->Print("}\n"); -} - -void ImmutableMessageGenerator::GenerateTopLevelKotlinMembers( - io::Printer* printer) const { - printer->Print( - "@kotlin.jvm.JvmSynthetic\n" - "public inline fun $message$.copy(block: $message_kt$.Dsl.() -> " - "kotlin.Unit): " - "$message$ =\n" - " $message_kt$.Dsl._create(this.toBuilder()).apply { block() " - "}._build()\n", - "message", name_resolver_->GetClassName(descriptor_, true), "message_kt", - name_resolver_->GetKotlinExtensionsClassName(descriptor_)); - - for (int i = 0; i < descriptor_->nested_type_count(); i++) { - if (IsMapEntry(descriptor_->nested_type(i))) continue; - ImmutableMessageGenerator(descriptor_->nested_type(i), context_) - .GenerateTopLevelKotlinMembers(printer); - } -} - -void ImmutableMessageGenerator::GenerateKotlinExtensions( - io::Printer* printer) const { - std::string message_name = name_resolver_->GetClassName(descriptor_, true); - - printer->Print( - "@Suppress(\"UNCHECKED_CAST\")\n" - "@kotlin.jvm.JvmSynthetic\n" - "public operator fun get(extension: " - "com.google.protobuf.ExtensionLite<$message$, T>): T {\n" - " return if (extension.isRepeated) {\n" - " get(extension as com.google.protobuf.ExtensionLite<$message$, " - "List<*>>) as T\n" - " } else {\n" - " _builder.getExtension(extension)\n" - " }\n" - "}\n\n", - "message", message_name); - - printer->Print( - "@kotlin.jvm.JvmSynthetic\n" - "@kotlin.OptIn" - "(com.google.protobuf.kotlin.OnlyForUseByGeneratedProtoCode::class)\n" - "@kotlin.jvm.JvmName(\"-getRepeatedExtension\")\n" - "public operator fun get(\n" - " extension: com.google.protobuf.ExtensionLite<$message$, List>\n" - "): com.google.protobuf.kotlin.ExtensionList {\n" - " return com.google.protobuf.kotlin.ExtensionList(extension, " - "_builder.getExtension(extension))\n" - "}\n\n", - "message", message_name); - - printer->Print( - "@kotlin.jvm.JvmSynthetic\n" - "public operator fun contains(extension: " - "com.google.protobuf.ExtensionLite<$message$, *>): " - "Boolean {\n" - " return _builder.hasExtension(extension)\n" - "}\n\n", - "message", message_name); - - printer->Print( - "@kotlin.jvm.JvmSynthetic\n" - "public fun clear(extension: " - "com.google.protobuf.ExtensionLite<$message$, *>) " - "{\n" - " _builder.clearExtension(extension)\n" - "}\n\n", - "message", message_name); - - printer->Print( - "@kotlin.jvm.JvmSynthetic\n" - "@kotlin.PublishedApi\n" - "internal fun setExtension(extension: " - "com.google.protobuf.ExtensionLite<$message$, T>, " - "value: T) {\n" - " _builder.setExtension(extension, value)\n" - "}\n\n", - "message", message_name); - - printer->Print( - "@kotlin.jvm.JvmSynthetic\n" - "@Suppress(\"NOTHING_TO_INLINE\")\n" - "public inline operator fun > set(\n" - " extension: com.google.protobuf.ExtensionLite<$message$, T>,\n" - " value: T\n" - ") {\n" - " setExtension(extension, value)\n" - "}\n\n", - "message", message_name); - - printer->Print( - "@kotlin.jvm.JvmSynthetic\n" - "@Suppress(\"NOTHING_TO_INLINE\")\n" - "public inline operator fun set(\n" - " extension: com.google.protobuf.ExtensionLite<$message$, " - "com.google.protobuf.ByteString>,\n" - " value: com.google.protobuf.ByteString\n" - ") {\n" - " setExtension(extension, value)\n" - "}\n\n", - "message", message_name); - - printer->Print( - "@kotlin.jvm.JvmSynthetic\n" - "@Suppress(\"NOTHING_TO_INLINE\")\n" - "public inline operator fun set(\n" - " extension: com.google.protobuf.ExtensionLite<$message$, T>,\n" - " value: T\n" - ") {\n" - " setExtension(extension, value)\n" - "}\n\n", - "message", message_name); - - printer->Print( - "@kotlin.jvm.JvmSynthetic\n" - "public fun com.google.protobuf.kotlin.ExtensionList.add(value: E) {\n" - " _builder.addExtension(this.extension, value)\n" - "}\n\n", - "message", message_name); - - printer->Print( - "@kotlin.jvm.JvmSynthetic\n" - "@Suppress(\"NOTHING_TO_INLINE\")\n" - "public inline operator fun " - "com.google.protobuf.kotlin.ExtensionList.plusAssign" - "(value: E) {\n" - " add(value)\n" - "}\n\n", - "message", message_name); - - printer->Print( - "@kotlin.jvm.JvmSynthetic\n" - "public fun com.google.protobuf.kotlin.ExtensionList.addAll(values: Iterable) {\n" - " for (value in values) {\n" - " add(value)\n" - " }\n" - "}\n\n", - "message", message_name); - - printer->Print( - "@kotlin.jvm.JvmSynthetic\n" - "@Suppress(\"NOTHING_TO_INLINE\")\n" - "public inline operator fun " - "com.google.protobuf.kotlin.ExtensionList.plusAssign(values: " - "Iterable) {\n" - " addAll(values)\n" - "}\n\n", - "message", message_name); - - printer->Print( - "@kotlin.jvm.JvmSynthetic\n" - "public operator fun com.google.protobuf.kotlin.ExtensionList.set(index: Int, value: " - "E) {\n" - " _builder.setExtension(this.extension, index, value)\n" - "}\n\n", - "message", message_name); - - printer->Print( - "@kotlin.jvm.JvmSynthetic\n" - "@Suppress(\"NOTHING_TO_INLINE\")\n" - "public inline fun com.google.protobuf.kotlin.ExtensionList<*, " - "$message$>.clear() {\n" - " clear(extension)\n" - "}\n\n", - "message", message_name); -} - -void ImmutableMessageGenerator::GenerateAnyMethods(io::Printer* printer) { - printer->Print( - "private static String getTypeUrl(\n" - " java.lang.String typeUrlPrefix,\n" - " com.google.protobuf.Descriptors.Descriptor descriptor) {\n" - " return typeUrlPrefix.endsWith(\"/\")\n" - " ? typeUrlPrefix + descriptor.getFullName()\n" - " : typeUrlPrefix + \"/\" + descriptor.getFullName();\n" - "}\n" - "\n" - "private static String getTypeNameFromTypeUrl(\n" - " java.lang.String typeUrl) {\n" - " int pos = typeUrl.lastIndexOf('/');\n" - " return pos == -1 ? \"\" : typeUrl.substring(pos + 1);\n" - "}\n" - "\n" - "public static Any pack(\n" - " T message) {\n" - " return Any.newBuilder()\n" - " .setTypeUrl(getTypeUrl(\"type.googleapis.com\",\n" - " message.getDescriptorForType()))\n" - " .setValue(message.toByteString())\n" - " .build();\n" - "}\n" - "\n" - "/**\n" - " * Packs a message using the given type URL prefix. The type URL will\n" - " * be constructed by concatenating the message type's full name to the\n" - " * prefix with an optional \"/\" separator if the prefix doesn't end\n" - " * with \"/\" already.\n" - " */\n" - "public static Any pack(\n" - " T message, java.lang.String typeUrlPrefix) {\n" - " return Any.newBuilder()\n" - " .setTypeUrl(getTypeUrl(typeUrlPrefix,\n" - " message.getDescriptorForType()))\n" - " .setValue(message.toByteString())\n" - " .build();\n" - "}\n" - "\n" - "public boolean is(\n" - " java.lang.Class clazz) {\n" - " T defaultInstance =\n" - " com.google.protobuf.Internal.getDefaultInstance(clazz);\n" - " return getTypeNameFromTypeUrl(getTypeUrl()).equals(\n" - " defaultInstance.getDescriptorForType().getFullName());\n" - "}\n" - "\n" - "private volatile com.google.protobuf.Message cachedUnpackValue;\n" - "\n" - "@java.lang.SuppressWarnings(\"unchecked\")\n" - "public T unpack(\n" - " java.lang.Class clazz)\n" - " throws com.google.protobuf.InvalidProtocolBufferException {\n" - " boolean invalidClazz = false;\n" - " if (cachedUnpackValue != null) {\n" - " if (cachedUnpackValue.getClass() == clazz) {\n" - " return (T) cachedUnpackValue;\n" - " }\n" - " invalidClazz = true;\n" - " }\n" - " if (invalidClazz || !is(clazz)) {\n" - " throw new com.google.protobuf.InvalidProtocolBufferException(\n" - " \"Type of the Any message does not match the given class.\");\n" - " }\n" - " T defaultInstance =\n" - " com.google.protobuf.Internal.getDefaultInstance(clazz);\n" - " T result = (T) defaultInstance.getParserForType()\n" - " .parseFrom(getValue());\n" - " cachedUnpackValue = result;\n" - " return result;\n" - "}\n"); -} - -} // namespace java -} // namespace compiler -} // namespace protobuf -} // namespace google diff --git a/extra/protobuf/protobuf-3.19.4/src/google/protobuf/compiler/java/java_message.h b/extra/protobuf/protobuf-3.19.4/src/google/protobuf/compiler/java/java_message.h deleted file mode 100644 index cafc91e68ba8..000000000000 --- a/extra/protobuf/protobuf-3.19.4/src/google/protobuf/compiler/java/java_message.h +++ /dev/null @@ -1,153 +0,0 @@ -// Protocol Buffers - Google's data interchange format -// Copyright 2008 Google Inc. All rights reserved. -// https://developers.google.com/protocol-buffers/ -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// * Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// * Redistributions in binary form must reproduce the above -// copyright notice, this list of conditions and the following disclaimer -// in the documentation and/or other materials provided with the -// distribution. -// * Neither the name of Google Inc. nor the names of its -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -// Author: kenton@google.com (Kenton Varda) -// Based on original Protocol Buffers design by -// Sanjay Ghemawat, Jeff Dean, and others. - -#ifndef GOOGLE_PROTOBUF_COMPILER_JAVA_MESSAGE_H__ -#define GOOGLE_PROTOBUF_COMPILER_JAVA_MESSAGE_H__ - -#include -#include -#include - -namespace google { -namespace protobuf { -namespace compiler { -namespace java { -class Context; // context.h -class ClassNameResolver; // name_resolver.h -} // namespace java -} // namespace compiler -namespace io { -class Printer; // printer.h -} -} // namespace protobuf -} // namespace google - -namespace google { -namespace protobuf { -namespace compiler { -namespace java { - -static const int kMaxStaticSize = 1 << 15; // aka 32k - -class MessageGenerator { - public: - explicit MessageGenerator(const Descriptor* descriptor); - virtual ~MessageGenerator(); - - // All static variables have to be declared at the top-level of the file - // so that we can control initialization order, which is important for - // DescriptorProto bootstrapping to work. - virtual void GenerateStaticVariables(io::Printer* printer, - int* bytecode_estimate) = 0; - - // Output code which initializes the static variables generated by - // GenerateStaticVariables(). Returns an estimate of bytecode size. - virtual int GenerateStaticVariableInitializers(io::Printer* printer) = 0; - - // Generate the class itself. - virtual void Generate(io::Printer* printer) = 0; - - // Generates the base interface that both the class and its builder - // implement - virtual void GenerateInterface(io::Printer* printer) = 0; - - // Generate code to register all contained extensions with an - // ExtensionRegistry. - virtual void GenerateExtensionRegistrationCode(io::Printer* printer) = 0; - virtual void GenerateKotlinDsl(io::Printer* printer) const = 0; - virtual void GenerateKotlinMembers(io::Printer* printer) const = 0; - virtual void GenerateTopLevelKotlinMembers(io::Printer* printer) const = 0; - - protected: - const Descriptor* descriptor_; - std::set oneofs_; - - private: - GOOGLE_DISALLOW_EVIL_CONSTRUCTORS(MessageGenerator); -}; - -class ImmutableMessageGenerator : public MessageGenerator { - public: - ImmutableMessageGenerator(const Descriptor* descriptor, Context* context); - virtual ~ImmutableMessageGenerator(); - - void Generate(io::Printer* printer) override; - void GenerateInterface(io::Printer* printer) override; - void GenerateExtensionRegistrationCode(io::Printer* printer) override; - void GenerateStaticVariables(io::Printer* printer, - int* bytecode_estimate) override; - - // Returns an estimate of the number of bytes the printed code will compile to - int GenerateStaticVariableInitializers(io::Printer* printer) override; - void GenerateKotlinDsl(io::Printer* printer) const override; - void GenerateKotlinMembers(io::Printer* printer) const override; - void GenerateTopLevelKotlinMembers(io::Printer* printer) const override; - - private: - void GenerateFieldAccessorTable(io::Printer* printer, int* bytecode_estimate); - - // Returns an estimate of the number of bytes the printed code will compile to - int GenerateFieldAccessorTableInitializer(io::Printer* printer); - - void GenerateMessageSerializationMethods(io::Printer* printer); - void GenerateParseFromMethods(io::Printer* printer); - void GenerateSerializeOneField(io::Printer* printer, - const FieldDescriptor* field); - void GenerateSerializeOneExtensionRange( - io::Printer* printer, const Descriptor::ExtensionRange* range); - - void GenerateBuilder(io::Printer* printer); - void GenerateIsInitialized(io::Printer* printer); - void GenerateDescriptorMethods(io::Printer* printer); - void GenerateInitializers(io::Printer* printer); - void GenerateEqualsAndHashCode(io::Printer* printer); - void GenerateParser(io::Printer* printer); - void GenerateParsingConstructor(io::Printer* printer); - void GenerateMutableCopy(io::Printer* printer); - void GenerateKotlinExtensions(io::Printer* printer) const; - void GenerateAnyMethods(io::Printer* printer); - - Context* context_; - ClassNameResolver* name_resolver_; - FieldGeneratorMap field_generators_; - - GOOGLE_DISALLOW_EVIL_CONSTRUCTORS(ImmutableMessageGenerator); -}; - -} // namespace java -} // namespace compiler -} // namespace protobuf -} // namespace google - -#endif // GOOGLE_PROTOBUF_COMPILER_JAVA_MESSAGE_H__ diff --git a/extra/protobuf/protobuf-3.19.4/src/google/protobuf/compiler/java/java_message_builder.cc b/extra/protobuf/protobuf-3.19.4/src/google/protobuf/compiler/java/java_message_builder.cc deleted file mode 100644 index 320852b1be97..000000000000 --- a/extra/protobuf/protobuf-3.19.4/src/google/protobuf/compiler/java/java_message_builder.cc +++ /dev/null @@ -1,712 +0,0 @@ -// Protocol Buffers - Google's data interchange format -// Copyright 2008 Google Inc. All rights reserved. -// https://developers.google.com/protocol-buffers/ -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// * Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// * Redistributions in binary form must reproduce the above -// copyright notice, this list of conditions and the following disclaimer -// in the documentation and/or other materials provided with the -// distribution. -// * Neither the name of Google Inc. nor the names of its -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -// Author: dweis@google.com (Daniel Weis) -// Based on original Protocol Buffers design by -// Sanjay Ghemawat, Jeff Dean, and others. - -#include - -#include -#include -#include -#include - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -namespace google { -namespace protobuf { -namespace compiler { -namespace java { - -namespace { -std::string MapValueImmutableClassdName(const Descriptor* descriptor, - ClassNameResolver* name_resolver) { - const FieldDescriptor* value_field = descriptor->FindFieldByName("value"); - GOOGLE_CHECK_EQ(FieldDescriptor::TYPE_MESSAGE, value_field->type()); - return name_resolver->GetImmutableClassName(value_field->message_type()); -} -} // namespace - -MessageBuilderGenerator::MessageBuilderGenerator(const Descriptor* descriptor, - Context* context) - : descriptor_(descriptor), - context_(context), - name_resolver_(context->GetNameResolver()), - field_generators_(descriptor, context_) { - GOOGLE_CHECK(HasDescriptorMethods(descriptor->file(), context->EnforceLite())) - << "Generator factory error: A non-lite message generator is used to " - "generate lite messages."; - for (int i = 0; i < descriptor_->field_count(); i++) { - if (IsRealOneof(descriptor_->field(i))) { - oneofs_.insert(descriptor_->field(i)->containing_oneof()); - } - } -} - -MessageBuilderGenerator::~MessageBuilderGenerator() {} - -void MessageBuilderGenerator::Generate(io::Printer* printer) { - WriteMessageDocComment(printer, descriptor_); - if (descriptor_->extension_range_count() > 0) { - printer->Print( - "public static final class Builder extends\n" - " com.google.protobuf.GeneratedMessage$ver$.ExtendableBuilder<\n" - " $classname$, Builder> implements\n" - " $extra_interfaces$\n" - " $classname$OrBuilder {\n", - "classname", name_resolver_->GetImmutableClassName(descriptor_), - "extra_interfaces", ExtraBuilderInterfaces(descriptor_), "ver", - GeneratedCodeVersionSuffix()); - } else { - printer->Print( - "public static final class Builder extends\n" - " com.google.protobuf.GeneratedMessage$ver$.Builder " - "implements\n" - " $extra_interfaces$\n" - " $classname$OrBuilder {\n", - "classname", name_resolver_->GetImmutableClassName(descriptor_), - "extra_interfaces", ExtraBuilderInterfaces(descriptor_), "ver", - GeneratedCodeVersionSuffix()); - } - printer->Indent(); - - GenerateDescriptorMethods(printer); - GenerateCommonBuilderMethods(printer); - - if (context_->HasGeneratedMethods(descriptor_)) { - GenerateIsInitialized(printer); - GenerateBuilderParsingMethods(printer); - } - - // oneof - std::map vars; - for (auto oneof : oneofs_) { - vars["oneof_name"] = context_->GetOneofGeneratorInfo(oneof)->name; - vars["oneof_capitalized_name"] = - context_->GetOneofGeneratorInfo(oneof)->capitalized_name; - vars["oneof_index"] = StrCat(oneof->index()); - // oneofCase_ and oneof_ - printer->Print(vars, - "private int $oneof_name$Case_ = 0;\n" - "private java.lang.Object $oneof_name$_;\n"); - // oneofCase() and clearOneof() - printer->Print(vars, - "public $oneof_capitalized_name$Case\n" - " get$oneof_capitalized_name$Case() {\n" - " return $oneof_capitalized_name$Case.forNumber(\n" - " $oneof_name$Case_);\n" - "}\n" - "\n" - "public Builder clear$oneof_capitalized_name$() {\n" - " $oneof_name$Case_ = 0;\n" - " $oneof_name$_ = null;\n"); - printer->Print(" onChanged();\n"); - printer->Print( - " return this;\n" - "}\n" - "\n"); - } - - // Integers for bit fields. - int totalBits = 0; - for (int i = 0; i < descriptor_->field_count(); i++) { - totalBits += - field_generators_.get(descriptor_->field(i)).GetNumBitsForBuilder(); - } - int totalInts = (totalBits + 31) / 32; - for (int i = 0; i < totalInts; i++) { - printer->Print("private int $bit_field_name$;\n", "bit_field_name", - GetBitFieldName(i)); - } - - for (int i = 0; i < descriptor_->field_count(); i++) { - printer->Print("\n"); - field_generators_.get(descriptor_->field(i)) - .GenerateBuilderMembers(printer); - } - - // Override methods declared in GeneratedMessage to return the concrete - // generated type so callsites won't depend on GeneratedMessage. This - // is needed to keep binary compatibility when we change generated code - // to subclass a different GeneratedMessage class (e.g., in v3.0.0 release - // we changed all generated code to subclass GeneratedMessageV3). - printer->Print( - "@java.lang.Override\n" - "public final Builder setUnknownFields(\n" - " final com.google.protobuf.UnknownFieldSet unknownFields) {\n" - " return super.setUnknownFields(unknownFields);\n" - "}\n" - "\n" - "@java.lang.Override\n" - "public final Builder mergeUnknownFields(\n" - " final com.google.protobuf.UnknownFieldSet unknownFields) {\n" - " return super.mergeUnknownFields(unknownFields);\n" - "}\n" - "\n"); - - printer->Print( - "\n" - "// @@protoc_insertion_point(builder_scope:$full_name$)\n", - "full_name", descriptor_->full_name()); - - printer->Outdent(); - printer->Print("}\n"); -} - -// =================================================================== - -void MessageBuilderGenerator::GenerateDescriptorMethods(io::Printer* printer) { - if (!descriptor_->options().no_standard_descriptor_accessor()) { - printer->Print( - "public static final com.google.protobuf.Descriptors.Descriptor\n" - " getDescriptor() {\n" - " return $fileclass$.internal_$identifier$_descriptor;\n" - "}\n" - "\n", - "fileclass", name_resolver_->GetImmutableClassName(descriptor_->file()), - "identifier", UniqueFileScopeIdentifier(descriptor_)); - } - std::vector map_fields; - for (int i = 0; i < descriptor_->field_count(); i++) { - const FieldDescriptor* field = descriptor_->field(i); - if (GetJavaType(field) == JAVATYPE_MESSAGE && - IsMapEntry(field->message_type())) { - map_fields.push_back(field); - } - } - if (!map_fields.empty()) { - printer->Print( - "@SuppressWarnings({\"rawtypes\"})\n" - "protected com.google.protobuf.MapField internalGetMapField(\n" - " int number) {\n" - " switch (number) {\n"); - printer->Indent(); - printer->Indent(); - for (int i = 0; i < map_fields.size(); ++i) { - const FieldDescriptor* field = map_fields[i]; - const FieldGeneratorInfo* info = context_->GetFieldGeneratorInfo(field); - printer->Print( - "case $number$:\n" - " return internalGet$capitalized_name$();\n", - "number", StrCat(field->number()), "capitalized_name", - info->capitalized_name); - } - printer->Print( - "default:\n" - " throw new RuntimeException(\n" - " \"Invalid map field number: \" + number);\n"); - printer->Outdent(); - printer->Outdent(); - printer->Print( - " }\n" - "}\n"); - printer->Print( - "@SuppressWarnings({\"rawtypes\"})\n" - "protected com.google.protobuf.MapField internalGetMutableMapField(\n" - " int number) {\n" - " switch (number) {\n"); - printer->Indent(); - printer->Indent(); - for (int i = 0; i < map_fields.size(); ++i) { - const FieldDescriptor* field = map_fields[i]; - const FieldGeneratorInfo* info = context_->GetFieldGeneratorInfo(field); - printer->Print( - "case $number$:\n" - " return internalGetMutable$capitalized_name$();\n", - "number", StrCat(field->number()), "capitalized_name", - info->capitalized_name); - } - printer->Print( - "default:\n" - " throw new RuntimeException(\n" - " \"Invalid map field number: \" + number);\n"); - printer->Outdent(); - printer->Outdent(); - printer->Print( - " }\n" - "}\n"); - } - printer->Print( - "@java.lang.Override\n" - "protected com.google.protobuf.GeneratedMessage$ver$.FieldAccessorTable\n" - " internalGetFieldAccessorTable() {\n" - " return $fileclass$.internal_$identifier$_fieldAccessorTable\n" - " .ensureFieldAccessorsInitialized(\n" - " $classname$.class, $classname$.Builder.class);\n" - "}\n" - "\n", - "classname", name_resolver_->GetImmutableClassName(descriptor_), - "fileclass", name_resolver_->GetImmutableClassName(descriptor_->file()), - "identifier", UniqueFileScopeIdentifier(descriptor_), "ver", - GeneratedCodeVersionSuffix()); -} - -// =================================================================== - -void MessageBuilderGenerator::GenerateCommonBuilderMethods( - io::Printer* printer) { - printer->Print( - "// Construct using $classname$.newBuilder()\n" - "private Builder() {\n" - " maybeForceBuilderInitialization();\n" - "}\n" - "\n", - "classname", name_resolver_->GetImmutableClassName(descriptor_)); - - printer->Print( - "private Builder(\n" - " com.google.protobuf.GeneratedMessage$ver$.BuilderParent parent) {\n" - " super(parent);\n" - " maybeForceBuilderInitialization();\n" - "}\n", - "classname", name_resolver_->GetImmutableClassName(descriptor_), "ver", - GeneratedCodeVersionSuffix()); - - printer->Print( - "private void maybeForceBuilderInitialization() {\n" - " if (com.google.protobuf.GeneratedMessage$ver$\n" - " .alwaysUseFieldBuilders) {\n", - "ver", GeneratedCodeVersionSuffix()); - - printer->Indent(); - printer->Indent(); - for (int i = 0; i < descriptor_->field_count(); i++) { - if (!IsRealOneof(descriptor_->field(i))) { - field_generators_.get(descriptor_->field(i)) - .GenerateFieldBuilderInitializationCode(printer); - } - } - printer->Outdent(); - printer->Outdent(); - - printer->Print( - " }\n" - "}\n"); - - printer->Print( - "@java.lang.Override\n" - "public Builder clear() {\n" - " super.clear();\n"); - - printer->Indent(); - - for (int i = 0; i < descriptor_->field_count(); i++) { - if (!IsRealOneof(descriptor_->field(i))) { - field_generators_.get(descriptor_->field(i)) - .GenerateBuilderClearCode(printer); - } - } - - for (auto oneof : oneofs_) { - printer->Print( - "$oneof_name$Case_ = 0;\n" - "$oneof_name$_ = null;\n", - "oneof_name", context_->GetOneofGeneratorInfo(oneof)->name); - } - - printer->Outdent(); - - printer->Print( - " return this;\n" - "}\n" - "\n"); - - printer->Print( - "@java.lang.Override\n" - "public com.google.protobuf.Descriptors.Descriptor\n" - " getDescriptorForType() {\n" - " return $fileclass$.internal_$identifier$_descriptor;\n" - "}\n" - "\n", - "fileclass", name_resolver_->GetImmutableClassName(descriptor_->file()), - "identifier", UniqueFileScopeIdentifier(descriptor_)); - - // LITE runtime implements this in GeneratedMessageLite. - printer->Print( - "@java.lang.Override\n" - "public $classname$ getDefaultInstanceForType() {\n" - " return $classname$.getDefaultInstance();\n" - "}\n" - "\n", - "classname", name_resolver_->GetImmutableClassName(descriptor_)); - - printer->Print( - "@java.lang.Override\n" - "public $classname$ build() {\n" - " $classname$ result = buildPartial();\n" - " if (!result.isInitialized()) {\n" - " throw newUninitializedMessageException(result);\n" - " }\n" - " return result;\n" - "}\n" - "\n", - "classname", name_resolver_->GetImmutableClassName(descriptor_)); - - printer->Print( - "@java.lang.Override\n" - "public $classname$ buildPartial() {\n" - " $classname$ result = new $classname$(this);\n", - "classname", name_resolver_->GetImmutableClassName(descriptor_)); - - printer->Indent(); - - int totalBuilderBits = 0; - int totalMessageBits = 0; - for (int i = 0; i < descriptor_->field_count(); i++) { - const ImmutableFieldGenerator& field = - field_generators_.get(descriptor_->field(i)); - totalBuilderBits += field.GetNumBitsForBuilder(); - totalMessageBits += field.GetNumBitsForMessage(); - } - int totalBuilderInts = (totalBuilderBits + 31) / 32; - int totalMessageInts = (totalMessageBits + 31) / 32; - - // Local vars for from and to bit fields to avoid accessing the builder and - // message over and over for these fields. Seems to provide a slight - // perforamance improvement in micro benchmark and this is also what proto1 - // code does. - for (int i = 0; i < totalBuilderInts; i++) { - printer->Print("int from_$bit_field_name$ = $bit_field_name$;\n", - "bit_field_name", GetBitFieldName(i)); - } - for (int i = 0; i < totalMessageInts; i++) { - printer->Print("int to_$bit_field_name$ = 0;\n", "bit_field_name", - GetBitFieldName(i)); - } - - // Output generation code for each field. - for (int i = 0; i < descriptor_->field_count(); i++) { - field_generators_.get(descriptor_->field(i)).GenerateBuildingCode(printer); - } - - // Copy the bit field results to the generated message - for (int i = 0; i < totalMessageInts; i++) { - printer->Print("result.$bit_field_name$ = to_$bit_field_name$;\n", - "bit_field_name", GetBitFieldName(i)); - } - - for (auto oneof : oneofs_) { - printer->Print("result.$oneof_name$Case_ = $oneof_name$Case_;\n", - "oneof_name", context_->GetOneofGeneratorInfo(oneof)->name); - } - - printer->Outdent(); - - printer->Print(" onBuilt();\n"); - - printer->Print( - " return result;\n" - "}\n" - "\n", - "classname", name_resolver_->GetImmutableClassName(descriptor_)); - - // Override methods declared in GeneratedMessage to return the concrete - // generated type so callsites won't depend on GeneratedMessage. This - // is needed to keep binary compatibility when we change generated code - // to subclass a different GeneratedMessage class (e.g., in v3.0.0 release - // we changed all generated code to subclass GeneratedMessageV3). - printer->Print( - "@java.lang.Override\n" - "public Builder clone() {\n" - " return super.clone();\n" - "}\n" - "@java.lang.Override\n" - "public Builder setField(\n" - " com.google.protobuf.Descriptors.FieldDescriptor field,\n" - " java.lang.Object value) {\n" - " return super.setField(field, value);\n" - "}\n" - "@java.lang.Override\n" - "public Builder clearField(\n" - " com.google.protobuf.Descriptors.FieldDescriptor field) {\n" - " return super.clearField(field);\n" - "}\n" - "@java.lang.Override\n" - "public Builder clearOneof(\n" - " com.google.protobuf.Descriptors.OneofDescriptor oneof) {\n" - " return super.clearOneof(oneof);\n" - "}\n" - "@java.lang.Override\n" - "public Builder setRepeatedField(\n" - " com.google.protobuf.Descriptors.FieldDescriptor field,\n" - " int index, java.lang.Object value) {\n" - " return super.setRepeatedField(field, index, value);\n" - "}\n" - "@java.lang.Override\n" - "public Builder addRepeatedField(\n" - " com.google.protobuf.Descriptors.FieldDescriptor field,\n" - " java.lang.Object value) {\n" - " return super.addRepeatedField(field, value);\n" - "}\n"); - - if (descriptor_->extension_range_count() > 0) { - printer->Print( - "@java.lang.Override\n" - "public Builder setExtension(\n" - " com.google.protobuf.GeneratedMessage.GeneratedExtension<\n" - " $classname$, Type> extension,\n" - " Type value) {\n" - " return super.setExtension(extension, value);\n" - "}\n" - "@java.lang.Override\n" - "public Builder setExtension(\n" - " com.google.protobuf.GeneratedMessage.GeneratedExtension<\n" - " $classname$, java.util.List> extension,\n" - " int index, Type value) {\n" - " return super.setExtension(extension, index, value);\n" - "}\n" - "@java.lang.Override\n" - "public Builder addExtension(\n" - " com.google.protobuf.GeneratedMessage.GeneratedExtension<\n" - " $classname$, java.util.List> extension,\n" - " Type value) {\n" - " return super.addExtension(extension, value);\n" - "}\n" - "@java.lang.Override\n" - "public Builder clearExtension(\n" - " com.google.protobuf.GeneratedMessage.GeneratedExtension<\n" - " $classname$, ?> extension) {\n" - " return super.clearExtension(extension);\n" - "}\n", - "classname", name_resolver_->GetImmutableClassName(descriptor_)); - } - - // ----------------------------------------------------------------- - - if (context_->HasGeneratedMethods(descriptor_)) { - printer->Print( - "@java.lang.Override\n" - "public Builder mergeFrom(com.google.protobuf.Message other) {\n" - " if (other instanceof $classname$) {\n" - " return mergeFrom(($classname$)other);\n" - " } else {\n" - " super.mergeFrom(other);\n" - " return this;\n" - " }\n" - "}\n" - "\n", - "classname", name_resolver_->GetImmutableClassName(descriptor_)); - - printer->Print( - "public Builder mergeFrom($classname$ other) {\n" - // Optimization: If other is the default instance, we know none of its - // fields are set so we can skip the merge. - " if (other == $classname$.getDefaultInstance()) return this;\n", - "classname", name_resolver_->GetImmutableClassName(descriptor_)); - printer->Indent(); - - for (int i = 0; i < descriptor_->field_count(); i++) { - if (!IsRealOneof(descriptor_->field(i))) { - field_generators_.get(descriptor_->field(i)) - .GenerateMergingCode(printer); - } - } - - // Merge oneof fields. - for (auto oneof : oneofs_) { - printer->Print("switch (other.get$oneof_capitalized_name$Case()) {\n", - "oneof_capitalized_name", - context_->GetOneofGeneratorInfo(oneof)->capitalized_name); - printer->Indent(); - for (int j = 0; j < oneof->field_count(); j++) { - const FieldDescriptor* field = oneof->field(j); - printer->Print("case $field_name$: {\n", "field_name", - ToUpper(field->name())); - printer->Indent(); - field_generators_.get(field).GenerateMergingCode(printer); - printer->Print("break;\n"); - printer->Outdent(); - printer->Print("}\n"); - } - printer->Print( - "case $cap_oneof_name$_NOT_SET: {\n" - " break;\n" - "}\n", - "cap_oneof_name", - ToUpper(context_->GetOneofGeneratorInfo(oneof)->name)); - printer->Outdent(); - printer->Print("}\n"); - } - - printer->Outdent(); - - // if message type has extensions - if (descriptor_->extension_range_count() > 0) { - printer->Print(" this.mergeExtensionFields(other);\n"); - } - - printer->Print(" this.mergeUnknownFields(other.unknownFields);\n"); - - printer->Print(" onChanged();\n"); - - printer->Print( - " return this;\n" - "}\n" - "\n"); - } -} - -// =================================================================== - -void MessageBuilderGenerator::GenerateBuilderParsingMethods( - io::Printer* printer) { - printer->Print( - "@java.lang.Override\n" - "public Builder mergeFrom(\n" - " com.google.protobuf.CodedInputStream input,\n" - " com.google.protobuf.ExtensionRegistryLite extensionRegistry)\n" - " throws java.io.IOException {\n" - " $classname$ parsedMessage = null;\n" - " try {\n" - " parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry);\n" - " } catch (com.google.protobuf.InvalidProtocolBufferException e) {\n" - " parsedMessage = ($classname$) e.getUnfinishedMessage();\n" - " throw e.unwrapIOException();\n" - " } finally {\n" - " if (parsedMessage != null) {\n" - " mergeFrom(parsedMessage);\n" - " }\n" - " }\n" - " return this;\n" - "}\n", - "classname", name_resolver_->GetImmutableClassName(descriptor_)); -} - -// =================================================================== - -void MessageBuilderGenerator::GenerateIsInitialized(io::Printer* printer) { - printer->Print( - "@java.lang.Override\n" - "public final boolean isInitialized() {\n"); - printer->Indent(); - - // Check that all required fields in this message are set. - // TODO(kenton): We can optimize this when we switch to putting all the - // "has" fields into a single bitfield. - for (int i = 0; i < descriptor_->field_count(); i++) { - const FieldDescriptor* field = descriptor_->field(i); - const FieldGeneratorInfo* info = context_->GetFieldGeneratorInfo(field); - - if (field->is_required()) { - printer->Print( - "if (!has$name$()) {\n" - " return false;\n" - "}\n", - "name", info->capitalized_name); - } - } - - // Now check that all embedded messages are initialized. - for (int i = 0; i < descriptor_->field_count(); i++) { - const FieldDescriptor* field = descriptor_->field(i); - const FieldGeneratorInfo* info = context_->GetFieldGeneratorInfo(field); - if (GetJavaType(field) == JAVATYPE_MESSAGE && - HasRequiredFields(field->message_type())) { - switch (field->label()) { - case FieldDescriptor::LABEL_REQUIRED: - printer->Print( - "if (!get$name$().isInitialized()) {\n" - " return false;\n" - "}\n", - "type", - name_resolver_->GetImmutableClassName(field->message_type()), - "name", info->capitalized_name); - break; - case FieldDescriptor::LABEL_OPTIONAL: - printer->Print( - "if (has$name$()) {\n" - " if (!get$name$().isInitialized()) {\n" - " return false;\n" - " }\n" - "}\n", - "name", info->capitalized_name); - break; - case FieldDescriptor::LABEL_REPEATED: - if (IsMapEntry(field->message_type())) { - printer->Print( - "for ($type$ item : get$name$Map().values()) {\n" - " if (!item.isInitialized()) {\n" - " return false;\n" - " }\n" - "}\n", - "type", - MapValueImmutableClassdName(field->message_type(), - name_resolver_), - "name", info->capitalized_name); - } else { - printer->Print( - "for (int i = 0; i < get$name$Count(); i++) {\n" - " if (!get$name$(i).isInitialized()) {\n" - " return false;\n" - " }\n" - "}\n", - "type", - name_resolver_->GetImmutableClassName(field->message_type()), - "name", info->capitalized_name); - } - break; - } - } - } - - if (descriptor_->extension_range_count() > 0) { - printer->Print( - "if (!extensionsAreInitialized()) {\n" - " return false;\n" - "}\n"); - } - - printer->Outdent(); - - printer->Print( - " return true;\n" - "}\n" - "\n"); -} - -// =================================================================== - -} // namespace java -} // namespace compiler -} // namespace protobuf -} // namespace google diff --git a/extra/protobuf/protobuf-3.19.4/src/google/protobuf/compiler/java/java_message_builder.h b/extra/protobuf/protobuf-3.19.4/src/google/protobuf/compiler/java/java_message_builder.h deleted file mode 100644 index fcd73b343626..000000000000 --- a/extra/protobuf/protobuf-3.19.4/src/google/protobuf/compiler/java/java_message_builder.h +++ /dev/null @@ -1,89 +0,0 @@ -// Protocol Buffers - Google's data interchange format -// Copyright 2008 Google Inc. All rights reserved. -// https://developers.google.com/protocol-buffers/ -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// * Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// * Redistributions in binary form must reproduce the above -// copyright notice, this list of conditions and the following disclaimer -// in the documentation and/or other materials provided with the -// distribution. -// * Neither the name of Google Inc. nor the names of its -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -// Author: dweis@google.com (Daniel Weis) -// Based on original Protocol Buffers design by -// Sanjay Ghemawat, Jeff Dean, and others. - -#ifndef GOOGLE_PROTOBUF_COMPILER_JAVA_MESSAGE_BUILDER_H__ -#define GOOGLE_PROTOBUF_COMPILER_JAVA_MESSAGE_BUILDER_H__ - -#include -#include -#include - -namespace google { -namespace protobuf { -namespace compiler { -namespace java { -class Context; // context.h -class ClassNameResolver; // name_resolver.h -} // namespace java -} // namespace compiler -namespace io { -class Printer; // printer.h -} -} // namespace protobuf -} // namespace google - -namespace google { -namespace protobuf { -namespace compiler { -namespace java { - -class MessageBuilderGenerator { - public: - explicit MessageBuilderGenerator(const Descriptor* descriptor, - Context* context); - virtual ~MessageBuilderGenerator(); - - virtual void Generate(io::Printer* printer); - - private: - void GenerateCommonBuilderMethods(io::Printer* printer); - void GenerateDescriptorMethods(io::Printer* printer); - void GenerateBuilderParsingMethods(io::Printer* printer); - void GenerateIsInitialized(io::Printer* printer); - - const Descriptor* descriptor_; - Context* context_; - ClassNameResolver* name_resolver_; - FieldGeneratorMap field_generators_; - std::set oneofs_; - - GOOGLE_DISALLOW_EVIL_CONSTRUCTORS(MessageBuilderGenerator); -}; - -} // namespace java -} // namespace compiler -} // namespace protobuf -} // namespace google - -#endif // GOOGLE_PROTOBUF_COMPILER_JAVA_MESSAGE_BUILDER_H__ diff --git a/extra/protobuf/protobuf-3.19.4/src/google/protobuf/compiler/java/java_message_builder_lite.cc b/extra/protobuf/protobuf-3.19.4/src/google/protobuf/compiler/java/java_message_builder_lite.cc deleted file mode 100644 index 7b69a9ab3894..000000000000 --- a/extra/protobuf/protobuf-3.19.4/src/google/protobuf/compiler/java/java_message_builder_lite.cc +++ /dev/null @@ -1,151 +0,0 @@ -// Protocol Buffers - Google's data interchange format -// Copyright 2008 Google Inc. All rights reserved. -// https://developers.google.com/protocol-buffers/ -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// * Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// * Redistributions in binary form must reproduce the above -// copyright notice, this list of conditions and the following disclaimer -// in the documentation and/or other materials provided with the -// distribution. -// * Neither the name of Google Inc. nor the names of its -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -// Author: dweis@google.com (Daniel Weis) -// Based on original Protocol Buffers design by -// Sanjay Ghemawat, Jeff Dean, and others. - -#include - -#include -#include -#include -#include - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -namespace google { -namespace protobuf { -namespace compiler { -namespace java { - -MessageBuilderLiteGenerator::MessageBuilderLiteGenerator( - const Descriptor* descriptor, Context* context) - : descriptor_(descriptor), - context_(context), - name_resolver_(context->GetNameResolver()), - field_generators_(descriptor, context_) { - GOOGLE_CHECK(!HasDescriptorMethods(descriptor->file(), context->EnforceLite())) - << "Generator factory error: A lite message generator is used to " - "generate non-lite messages."; - for (int i = 0; i < descriptor_->field_count(); i++) { - if (IsRealOneof(descriptor_->field(i))) { - oneofs_.insert(descriptor_->field(i)->containing_oneof()); - } - } -} - -MessageBuilderLiteGenerator::~MessageBuilderLiteGenerator() {} - -void MessageBuilderLiteGenerator::Generate(io::Printer* printer) { - WriteMessageDocComment(printer, descriptor_); - printer->Print( - "public static final class Builder extends\n" - " com.google.protobuf.GeneratedMessageLite.$extendible$Builder<\n" - " $classname$, Builder> implements\n" - " $extra_interfaces$\n" - " $classname$OrBuilder {\n", - "classname", name_resolver_->GetImmutableClassName(descriptor_), - "extra_interfaces", ExtraBuilderInterfaces(descriptor_), "extendible", - descriptor_->extension_range_count() > 0 ? "Extendable" : ""); - printer->Indent(); - - GenerateCommonBuilderMethods(printer); - - // oneof - std::map vars; - for (auto oneof : oneofs_) { - vars["oneof_name"] = context_->GetOneofGeneratorInfo(oneof)->name; - vars["oneof_capitalized_name"] = - context_->GetOneofGeneratorInfo(oneof)->capitalized_name; - vars["oneof_index"] = StrCat(oneof->index()); - - // oneofCase() and clearOneof() - printer->Print(vars, - "@java.lang.Override\n" - "public $oneof_capitalized_name$Case\n" - " get$oneof_capitalized_name$Case() {\n" - " return instance.get$oneof_capitalized_name$Case();\n" - "}\n" - "\n" - "public Builder clear$oneof_capitalized_name$() {\n" - " copyOnWrite();\n" - " instance.clear$oneof_capitalized_name$();\n" - " return this;\n" - "}\n" - "\n"); - } - - for (int i = 0; i < descriptor_->field_count(); i++) { - printer->Print("\n"); - field_generators_.get(descriptor_->field(i)) - .GenerateBuilderMembers(printer); - } - - printer->Print( - "\n" - "// @@protoc_insertion_point(builder_scope:$full_name$)\n", - "full_name", descriptor_->full_name()); - - printer->Outdent(); - printer->Print("}\n"); -} - -// =================================================================== - -void MessageBuilderLiteGenerator::GenerateCommonBuilderMethods( - io::Printer* printer) { - printer->Print( - "// Construct using $classname$.newBuilder()\n" - "private Builder() {\n" - " super(DEFAULT_INSTANCE);\n" - "}\n" - "\n", - "classname", name_resolver_->GetImmutableClassName(descriptor_)); -} - -// =================================================================== - -} // namespace java -} // namespace compiler -} // namespace protobuf -} // namespace google diff --git a/extra/protobuf/protobuf-3.19.4/src/google/protobuf/compiler/java/java_message_builder_lite.h b/extra/protobuf/protobuf-3.19.4/src/google/protobuf/compiler/java/java_message_builder_lite.h deleted file mode 100644 index 3402adf3322b..000000000000 --- a/extra/protobuf/protobuf-3.19.4/src/google/protobuf/compiler/java/java_message_builder_lite.h +++ /dev/null @@ -1,86 +0,0 @@ -// Protocol Buffers - Google's data interchange format -// Copyright 2008 Google Inc. All rights reserved. -// https://developers.google.com/protocol-buffers/ -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// * Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// * Redistributions in binary form must reproduce the above -// copyright notice, this list of conditions and the following disclaimer -// in the documentation and/or other materials provided with the -// distribution. -// * Neither the name of Google Inc. nor the names of its -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -// Author: dweis@google.com (Daniel Weis) -// Based on original Protocol Buffers design by -// Sanjay Ghemawat, Jeff Dean, and others. - -#ifndef GOOGLE_PROTOBUF_COMPILER_JAVA_MESSAGE_BUILDER_LITE_H__ -#define GOOGLE_PROTOBUF_COMPILER_JAVA_MESSAGE_BUILDER_LITE_H__ - -#include -#include -#include - -namespace google { -namespace protobuf { -namespace compiler { -namespace java { -class Context; // context.h -class ClassNameResolver; // name_resolver.h -} // namespace java -} // namespace compiler -namespace io { -class Printer; // printer.h -} -} // namespace protobuf -} // namespace google - -namespace google { -namespace protobuf { -namespace compiler { -namespace java { - -class MessageBuilderLiteGenerator { - public: - explicit MessageBuilderLiteGenerator(const Descriptor* descriptor, - Context* context); - virtual ~MessageBuilderLiteGenerator(); - - virtual void Generate(io::Printer* printer); - - private: - void GenerateCommonBuilderMethods(io::Printer* printer); - - const Descriptor* descriptor_; - Context* context_; - ClassNameResolver* name_resolver_; - FieldGeneratorMap field_generators_; - std::set oneofs_; - - GOOGLE_DISALLOW_EVIL_CONSTRUCTORS(MessageBuilderLiteGenerator); -}; - -} // namespace java -} // namespace compiler -} // namespace protobuf -} // namespace google - -#endif // GOOGLE_PROTOBUF_COMPILER_JAVA_MESSAGE_BUILDER_LITE_H__ diff --git a/extra/protobuf/protobuf-3.19.4/src/google/protobuf/compiler/java/java_message_field.cc b/extra/protobuf/protobuf-3.19.4/src/google/protobuf/compiler/java/java_message_field.cc deleted file mode 100644 index 8aae96145fc8..000000000000 --- a/extra/protobuf/protobuf-3.19.4/src/google/protobuf/compiler/java/java_message_field.cc +++ /dev/null @@ -1,1494 +0,0 @@ -// Protocol Buffers - Google's data interchange format -// Copyright 2008 Google Inc. All rights reserved. -// https://developers.google.com/protocol-buffers/ -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// * Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// * Redistributions in binary form must reproduce the above -// copyright notice, this list of conditions and the following disclaimer -// in the documentation and/or other materials provided with the -// distribution. -// * Neither the name of Google Inc. nor the names of its -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -// Author: kenton@google.com (Kenton Varda) -// Based on original Protocol Buffers design by -// Sanjay Ghemawat, Jeff Dean, and others. - -#include -#include - -#include -#include -#include -#include -#include -#include -#include -#include - -namespace google { -namespace protobuf { -namespace compiler { -namespace java { - - -namespace { - -void SetMessageVariables(const FieldDescriptor* descriptor, int messageBitIndex, - int builderBitIndex, const FieldGeneratorInfo* info, - ClassNameResolver* name_resolver, - std::map* variables) { - SetCommonFieldVariables(descriptor, info, variables); - - (*variables)["type"] = - name_resolver->GetImmutableClassName(descriptor->message_type()); - (*variables)["kt_type"] = (*variables)["type"]; - (*variables)["mutable_type"] = - name_resolver->GetMutableClassName(descriptor->message_type()); - (*variables)["group_or_message"] = - (GetType(descriptor) == FieldDescriptor::TYPE_GROUP) ? "Group" - : "Message"; - // TODO(birdo): Add @deprecated javadoc when generating javadoc is supported - // by the proto compiler - (*variables)["deprecation"] = - descriptor->options().deprecated() ? "@java.lang.Deprecated " : ""; - (*variables)["kt_deprecation"] = - descriptor->options().deprecated() - ? "@kotlin.Deprecated(message = \"Field " + (*variables)["name"] + - " is deprecated\") " - : ""; - (*variables)["on_changed"] = "onChanged();"; - (*variables)["ver"] = GeneratedCodeVersionSuffix(); - (*variables)["get_parser"] = - ExposePublicParser(descriptor->message_type()->file()) ? "PARSER" - : "parser()"; - - if (HasHasbit(descriptor)) { - // For singular messages and builders, one bit is used for the hasField bit. - (*variables)["get_has_field_bit_message"] = GenerateGetBit(messageBitIndex); - (*variables)["get_has_field_bit_builder"] = GenerateGetBit(builderBitIndex); - - // Note that these have a trailing ";". - (*variables)["set_has_field_bit_message"] = - GenerateSetBit(messageBitIndex) + ";"; - (*variables)["set_has_field_bit_builder"] = - GenerateSetBit(builderBitIndex) + ";"; - (*variables)["clear_has_field_bit_builder"] = - GenerateClearBit(builderBitIndex) + ";"; - - (*variables)["is_field_present_message"] = GenerateGetBit(messageBitIndex); - } else { - (*variables)["set_has_field_bit_message"] = ""; - (*variables)["set_has_field_bit_builder"] = ""; - (*variables)["clear_has_field_bit_builder"] = ""; - - (*variables)["is_field_present_message"] = - (*variables)["name"] + "_ != null"; - } - - // For repeated builders, one bit is used for whether the array is immutable. - (*variables)["get_mutable_bit_builder"] = GenerateGetBit(builderBitIndex); - (*variables)["set_mutable_bit_builder"] = GenerateSetBit(builderBitIndex); - (*variables)["clear_mutable_bit_builder"] = GenerateClearBit(builderBitIndex); - - // For repeated fields, one bit is used for whether the array is immutable - // in the parsing constructor. - (*variables)["get_mutable_bit_parser"] = - GenerateGetBitMutableLocal(builderBitIndex); - (*variables)["set_mutable_bit_parser"] = - GenerateSetBitMutableLocal(builderBitIndex); - - (*variables)["get_has_field_bit_from_local"] = - GenerateGetBitFromLocal(builderBitIndex); - (*variables)["set_has_field_bit_to_local"] = - GenerateSetBitToLocal(messageBitIndex); -} - -} // namespace - -// =================================================================== - -ImmutableMessageFieldGenerator::ImmutableMessageFieldGenerator( - const FieldDescriptor* descriptor, int messageBitIndex, int builderBitIndex, - Context* context) - : descriptor_(descriptor), name_resolver_(context->GetNameResolver()) { - SetMessageVariables(descriptor, messageBitIndex, builderBitIndex, - context->GetFieldGeneratorInfo(descriptor), - name_resolver_, &variables_); -} - -ImmutableMessageFieldGenerator::~ImmutableMessageFieldGenerator() {} - -int ImmutableMessageFieldGenerator::GetNumBitsForMessage() const { - return HasHasbit(descriptor_) ? 1 : 0; -} - -int ImmutableMessageFieldGenerator::GetNumBitsForBuilder() const { - return GetNumBitsForMessage(); -} - -void ImmutableMessageFieldGenerator::GenerateInterfaceMembers( - io::Printer* printer) const { - // TODO(jonp): In the future, consider having a method specific to the - // interface so that builders can choose dynamically to either return a - // message or a nested builder, so that asking for the interface doesn't - // cause a message to ever be built. - WriteFieldAccessorDocComment(printer, descriptor_, HAZZER); - printer->Print(variables_, "$deprecation$boolean has$capitalized_name$();\n"); - WriteFieldAccessorDocComment(printer, descriptor_, GETTER); - printer->Print(variables_, "$deprecation$$type$ get$capitalized_name$();\n"); - - WriteFieldDocComment(printer, descriptor_); - printer->Print( - variables_, - "$deprecation$$type$OrBuilder get$capitalized_name$OrBuilder();\n"); -} - -void ImmutableMessageFieldGenerator::GenerateMembers( - io::Printer* printer) const { - printer->Print(variables_, "private $type$ $name$_;\n"); - PrintExtraFieldInfo(variables_, printer); - - if (HasHasbit(descriptor_)) { - WriteFieldAccessorDocComment(printer, descriptor_, HAZZER); - printer->Print( - variables_, - "@java.lang.Override\n" - "$deprecation$public boolean ${$has$capitalized_name$$}$() {\n" - " return $get_has_field_bit_message$;\n" - "}\n"); - printer->Annotate("{", "}", descriptor_); - WriteFieldAccessorDocComment(printer, descriptor_, GETTER); - printer->Print( - variables_, - "@java.lang.Override\n" - "$deprecation$public $type$ ${$get$capitalized_name$$}$() {\n" - " return $name$_ == null ? $type$.getDefaultInstance() : $name$_;\n" - "}\n"); - printer->Annotate("{", "}", descriptor_); - - WriteFieldDocComment(printer, descriptor_); - printer->Print( - variables_, - "@java.lang.Override\n" - "$deprecation$public $type$OrBuilder " - "${$get$capitalized_name$OrBuilder$}$() {\n" - " return $name$_ == null ? $type$.getDefaultInstance() : $name$_;\n" - "}\n"); - printer->Annotate("{", "}", descriptor_); - } else { - WriteFieldAccessorDocComment(printer, descriptor_, HAZZER); - printer->Print( - variables_, - "@java.lang.Override\n" - "$deprecation$public boolean ${$has$capitalized_name$$}$() {\n" - " return $name$_ != null;\n" - "}\n"); - printer->Annotate("{", "}", descriptor_); - WriteFieldAccessorDocComment(printer, descriptor_, GETTER); - printer->Print( - variables_, - "@java.lang.Override\n" - "$deprecation$public $type$ ${$get$capitalized_name$$}$() {\n" - " return $name$_ == null ? $type$.getDefaultInstance() : $name$_;\n" - "}\n"); - printer->Annotate("{", "}", descriptor_); - - WriteFieldDocComment(printer, descriptor_); - printer->Print(variables_, - "@java.lang.Override\n" - "$deprecation$public $type$OrBuilder " - "${$get$capitalized_name$OrBuilder$}$() {\n" - " return get$capitalized_name$();\n" - "}\n"); - printer->Annotate("{", "}", descriptor_); - } -} - -void ImmutableMessageFieldGenerator::PrintNestedBuilderCondition( - io::Printer* printer, const char* regular_case, - const char* nested_builder_case) const { - printer->Print(variables_, "if ($name$Builder_ == null) {\n"); - printer->Indent(); - printer->Print(variables_, regular_case); - printer->Outdent(); - printer->Print("} else {\n"); - printer->Indent(); - printer->Print(variables_, nested_builder_case); - printer->Outdent(); - printer->Print("}\n"); -} - -void ImmutableMessageFieldGenerator::PrintNestedBuilderFunction( - io::Printer* printer, const char* method_prototype, - const char* regular_case, const char* nested_builder_case, - const char* trailing_code) const { - printer->Print(variables_, method_prototype); - printer->Annotate("{", "}", descriptor_); - printer->Print(" {\n"); - printer->Indent(); - PrintNestedBuilderCondition(printer, regular_case, nested_builder_case); - if (trailing_code != NULL) { - printer->Print(variables_, trailing_code); - } - printer->Outdent(); - printer->Print("}\n"); -} - -void ImmutableMessageFieldGenerator::GenerateBuilderMembers( - io::Printer* printer) const { - // When using nested-builders, the code initially works just like the - // non-nested builder case. It only creates a nested builder lazily on - // demand and then forever delegates to it after creation. - - bool has_hasbit = HasHasbit(descriptor_); - - printer->Print(variables_, "private $type$ $name$_;\n"); - - printer->Print(variables_, - // If this builder is non-null, it is used and the other fields - // are ignored. - "private com.google.protobuf.SingleFieldBuilder$ver$<\n" - " $type$, $type$.Builder, $type$OrBuilder> $name$Builder_;" - "\n"); - - // The comments above the methods below are based on a hypothetical - // field of type "Field" called "Field". - - // boolean hasField() - WriteFieldAccessorDocComment(printer, descriptor_, HAZZER); - if (has_hasbit) { - printer->Print( - variables_, - "$deprecation$public boolean ${$has$capitalized_name$$}$() {\n" - " return $get_has_field_bit_builder$;\n" - "}\n"); - printer->Annotate("{", "}", descriptor_); - } else { - printer->Print( - variables_, - "$deprecation$public boolean ${$has$capitalized_name$$}$() {\n" - " return $name$Builder_ != null || $name$_ != null;\n" - "}\n"); - printer->Annotate("{", "}", descriptor_); - } - - // Field getField() - WriteFieldAccessorDocComment(printer, descriptor_, GETTER); - PrintNestedBuilderFunction( - printer, "$deprecation$public $type$ ${$get$capitalized_name$$}$()", - "return $name$_ == null ? $type$.getDefaultInstance() : $name$_;\n", - "return $name$Builder_.getMessage();\n", NULL); - - // Field.Builder setField(Field value) - WriteFieldDocComment(printer, descriptor_); - PrintNestedBuilderFunction( - printer, - "$deprecation$public Builder ${$set$capitalized_name$$}$($type$ value)", - - "if (value == null) {\n" - " throw new NullPointerException();\n" - "}\n" - "$name$_ = value;\n" - "$on_changed$\n", - - "$name$Builder_.setMessage(value);\n", - - "$set_has_field_bit_builder$\n" - "return this;\n"); - - // Field.Builder setField(Field.Builder builderForValue) - WriteFieldDocComment(printer, descriptor_); - PrintNestedBuilderFunction( - printer, - "$deprecation$public Builder ${$set$capitalized_name$$}$(\n" - " $type$.Builder builderForValue)", - - "$name$_ = builderForValue.build();\n" - "$on_changed$\n", - - "$name$Builder_.setMessage(builderForValue.build());\n", - - "$set_has_field_bit_builder$\n" - "return this;\n"); - - // Field.Builder mergeField(Field value) - WriteFieldDocComment(printer, descriptor_); - PrintNestedBuilderFunction( - printer, - "$deprecation$public Builder ${$merge$capitalized_name$$}$($type$ value)", - - has_hasbit - ? "if ($get_has_field_bit_builder$ &&\n" - " $name$_ != null &&\n" - " $name$_ != $type$.getDefaultInstance()) {\n" - " $name$_ =\n" - " $type$.newBuilder($name$_).mergeFrom(value).buildPartial();\n" - "} else {\n" - " $name$_ = value;\n" - "}\n" - "$on_changed$\n" - : "if ($name$_ != null) {\n" - " $name$_ =\n" - " $type$.newBuilder($name$_).mergeFrom(value).buildPartial();\n" - "} else {\n" - " $name$_ = value;\n" - "}\n" - "$on_changed$\n", - - "$name$Builder_.mergeFrom(value);\n", - - "$set_has_field_bit_builder$\n" - "return this;\n"); - - // Field.Builder clearField() - WriteFieldDocComment(printer, descriptor_); - PrintNestedBuilderFunction( - printer, "$deprecation$public Builder ${$clear$capitalized_name$$}$()", - - "$name$_ = null;\n" - "$on_changed$\n", - - has_hasbit ? "$name$Builder_.clear();\n" - : "$name$_ = null;\n" - "$name$Builder_ = null;\n", - - "$clear_has_field_bit_builder$\n" - "return this;\n"); - - WriteFieldDocComment(printer, descriptor_); - printer->Print(variables_, - "$deprecation$public $type$.Builder " - "${$get$capitalized_name$Builder$}$() {\n" - " $set_has_field_bit_builder$\n" - " $on_changed$\n" - " return get$capitalized_name$FieldBuilder().getBuilder();\n" - "}\n"); - printer->Annotate("{", "}", descriptor_); - WriteFieldDocComment(printer, descriptor_); - printer->Print(variables_, - "$deprecation$public $type$OrBuilder " - "${$get$capitalized_name$OrBuilder$}$() {\n" - " if ($name$Builder_ != null) {\n" - " return $name$Builder_.getMessageOrBuilder();\n" - " } else {\n" - " return $name$_ == null ?\n" - " $type$.getDefaultInstance() : $name$_;\n" - " }\n" - "}\n"); - printer->Annotate("{", "}", descriptor_); - WriteFieldDocComment(printer, descriptor_); - printer->Print( - variables_, - "private com.google.protobuf.SingleFieldBuilder$ver$<\n" - " $type$, $type$.Builder, $type$OrBuilder> \n" - " get$capitalized_name$FieldBuilder() {\n" - " if ($name$Builder_ == null) {\n" - " $name$Builder_ = new com.google.protobuf.SingleFieldBuilder$ver$<\n" - " $type$, $type$.Builder, $type$OrBuilder>(\n" - " get$capitalized_name$(),\n" - " getParentForChildren(),\n" - " isClean());\n" - " $name$_ = null;\n" - " }\n" - " return $name$Builder_;\n" - "}\n"); -} - -void ImmutableMessageFieldGenerator::GenerateKotlinDslMembers( - io::Printer* printer) const { - WriteFieldDocComment(printer, descriptor_); - printer->Print(variables_, - "$kt_deprecation$public var $kt_name$: $kt_type$\n" - " @JvmName(\"${$get$kt_capitalized_name$$}$\")\n" - " get() = $kt_dsl_builder$.${$get$capitalized_name$$}$()\n" - " @JvmName(\"${$set$kt_capitalized_name$$}$\")\n" - " set(value) {\n" - " $kt_dsl_builder$.${$set$capitalized_name$$}$(value)\n" - " }\n"); - - WriteFieldAccessorDocComment(printer, descriptor_, CLEARER, - /* builder */ false); - printer->Print(variables_, - "public fun ${$clear$kt_capitalized_name$$}$() {\n" - " $kt_dsl_builder$.${$clear$capitalized_name$$}$()\n" - "}\n"); - - WriteFieldAccessorDocComment(printer, descriptor_, HAZZER); - printer->Print( - variables_, - "public fun ${$has$kt_capitalized_name$$}$(): kotlin.Boolean {\n" - " return $kt_dsl_builder$.${$has$capitalized_name$$}$()\n" - "}\n"); -} - -void ImmutableMessageFieldGenerator::GenerateFieldBuilderInitializationCode( - io::Printer* printer) const { - if (HasHasbit(descriptor_)) { - printer->Print(variables_, "get$capitalized_name$FieldBuilder();\n"); - } -} - -void ImmutableMessageFieldGenerator::GenerateInitializationCode( - io::Printer* printer) const {} - -void ImmutableMessageFieldGenerator::GenerateBuilderClearCode( - io::Printer* printer) const { - if (HasHasbit(descriptor_)) { - PrintNestedBuilderCondition(printer, "$name$_ = null;\n", - - "$name$Builder_.clear();\n"); - printer->Print(variables_, "$clear_has_field_bit_builder$\n"); - } else { - PrintNestedBuilderCondition(printer, "$name$_ = null;\n", - - "$name$_ = null;\n" - "$name$Builder_ = null;\n"); - } -} - -void ImmutableMessageFieldGenerator::GenerateMergingCode( - io::Printer* printer) const { - printer->Print(variables_, - "if (other.has$capitalized_name$()) {\n" - " merge$capitalized_name$(other.get$capitalized_name$());\n" - "}\n"); -} - -void ImmutableMessageFieldGenerator::GenerateBuildingCode( - io::Printer* printer) const { - if (HasHasbit(descriptor_)) { - printer->Print(variables_, "if ($get_has_field_bit_from_local$) {\n"); - printer->Indent(); - PrintNestedBuilderCondition(printer, "result.$name$_ = $name$_;\n", - "result.$name$_ = $name$Builder_.build();\n"); - printer->Outdent(); - printer->Print(variables_, - " $set_has_field_bit_to_local$;\n" - "}\n"); - } else { - PrintNestedBuilderCondition(printer, "result.$name$_ = $name$_;\n", - "result.$name$_ = $name$Builder_.build();\n"); - } -} - -void ImmutableMessageFieldGenerator::GenerateParsingCode( - io::Printer* printer) const { - printer->Print(variables_, - "$type$.Builder subBuilder = null;\n" - "if ($is_field_present_message$) {\n" - " subBuilder = $name$_.toBuilder();\n" - "}\n"); - - if (GetType(descriptor_) == FieldDescriptor::TYPE_GROUP) { - printer->Print(variables_, - "$name$_ = input.readGroup($number$, $type$.$get_parser$,\n" - " extensionRegistry);\n"); - } else { - printer->Print(variables_, - "$name$_ = input.readMessage($type$.$get_parser$, " - "extensionRegistry);\n"); - } - - printer->Print(variables_, - "if (subBuilder != null) {\n" - " subBuilder.mergeFrom($name$_);\n" - " $name$_ = subBuilder.buildPartial();\n" - "}\n" - "$set_has_field_bit_message$\n"); -} - -void ImmutableMessageFieldGenerator::GenerateParsingDoneCode( - io::Printer* printer) const { - // noop for messages. -} - -void ImmutableMessageFieldGenerator::GenerateSerializationCode( - io::Printer* printer) const { - printer->Print( - variables_, - "if ($is_field_present_message$) {\n" - " output.write$group_or_message$($number$, get$capitalized_name$());\n" - "}\n"); -} - -void ImmutableMessageFieldGenerator::GenerateSerializedSizeCode( - io::Printer* printer) const { - printer->Print( - variables_, - "if ($is_field_present_message$) {\n" - " size += com.google.protobuf.CodedOutputStream\n" - " .compute$group_or_message$Size($number$, get$capitalized_name$());\n" - "}\n"); -} - -void ImmutableMessageFieldGenerator::GenerateEqualsCode( - io::Printer* printer) const { - printer->Print(variables_, - "if (!get$capitalized_name$()\n" - " .equals(other.get$capitalized_name$())) return false;\n"); -} - -void ImmutableMessageFieldGenerator::GenerateHashCode( - io::Printer* printer) const { - printer->Print(variables_, - "hash = (37 * hash) + $constant_name$;\n" - "hash = (53 * hash) + get$capitalized_name$().hashCode();\n"); -} - -std::string ImmutableMessageFieldGenerator::GetBoxedType() const { - return name_resolver_->GetImmutableClassName(descriptor_->message_type()); -} - -// =================================================================== - -ImmutableMessageOneofFieldGenerator::ImmutableMessageOneofFieldGenerator( - const FieldDescriptor* descriptor, int messageBitIndex, int builderBitIndex, - Context* context) - : ImmutableMessageFieldGenerator(descriptor, messageBitIndex, - builderBitIndex, context) { - const OneofGeneratorInfo* info = - context->GetOneofGeneratorInfo(descriptor->containing_oneof()); - SetCommonOneofVariables(descriptor, info, &variables_); -} - -ImmutableMessageOneofFieldGenerator::~ImmutableMessageOneofFieldGenerator() {} - -void ImmutableMessageOneofFieldGenerator::GenerateMembers( - io::Printer* printer) const { - PrintExtraFieldInfo(variables_, printer); - WriteFieldAccessorDocComment(printer, descriptor_, HAZZER); - printer->Print(variables_, - "@java.lang.Override\n" - "$deprecation$public boolean ${$has$capitalized_name$$}$() {\n" - " return $has_oneof_case_message$;\n" - "}\n"); - printer->Annotate("{", "}", descriptor_); - WriteFieldAccessorDocComment(printer, descriptor_, GETTER); - printer->Print(variables_, - "@java.lang.Override\n" - "$deprecation$public $type$ ${$get$capitalized_name$$}$() {\n" - " if ($has_oneof_case_message$) {\n" - " return ($type$) $oneof_name$_;\n" - " }\n" - " return $type$.getDefaultInstance();\n" - "}\n"); - printer->Annotate("{", "}", descriptor_); - - WriteFieldDocComment(printer, descriptor_); - printer->Print(variables_, - "@java.lang.Override\n" - "$deprecation$public $type$OrBuilder " - "${$get$capitalized_name$OrBuilder$}$() {\n" - " if ($has_oneof_case_message$) {\n" - " return ($type$) $oneof_name$_;\n" - " }\n" - " return $type$.getDefaultInstance();\n" - "}\n"); - printer->Annotate("{", "}", descriptor_); -} - -void ImmutableMessageOneofFieldGenerator::GenerateBuilderMembers( - io::Printer* printer) const { - // When using nested-builders, the code initially works just like the - // non-nested builder case. It only creates a nested builder lazily on - // demand and then forever delegates to it after creation. - printer->Print(variables_, - // If this builder is non-null, it is used and the other fields - // are ignored. - "private com.google.protobuf.SingleFieldBuilder$ver$<\n" - " $type$, $type$.Builder, $type$OrBuilder> $name$Builder_;" - "\n"); - - // The comments above the methods below are based on a hypothetical - // field of type "Field" called "Field". - - // boolean hasField() - WriteFieldAccessorDocComment(printer, descriptor_, HAZZER); - printer->Print(variables_, - "@java.lang.Override\n" - "$deprecation$public boolean ${$has$capitalized_name$$}$() {\n" - " return $has_oneof_case_message$;\n" - "}\n"); - printer->Annotate("{", "}", descriptor_); - - // Field getField() - WriteFieldAccessorDocComment(printer, descriptor_, GETTER); - PrintNestedBuilderFunction( - printer, - "@java.lang.Override\n" - "$deprecation$public $type$ ${$get$capitalized_name$$}$()", - - "if ($has_oneof_case_message$) {\n" - " return ($type$) $oneof_name$_;\n" - "}\n" - "return $type$.getDefaultInstance();\n", - - "if ($has_oneof_case_message$) {\n" - " return $name$Builder_.getMessage();\n" - "}\n" - "return $type$.getDefaultInstance();\n", - - NULL); - - // Field.Builder setField(Field value) - WriteFieldDocComment(printer, descriptor_); - PrintNestedBuilderFunction( - printer, - "$deprecation$public Builder ${$set$capitalized_name$$}$($type$ value)", - - "if (value == null) {\n" - " throw new NullPointerException();\n" - "}\n" - "$oneof_name$_ = value;\n" - "$on_changed$\n", - - "$name$Builder_.setMessage(value);\n", - - "$set_oneof_case_message$;\n" - "return this;\n"); - - // Field.Builder setField(Field.Builder builderForValue) - WriteFieldDocComment(printer, descriptor_); - PrintNestedBuilderFunction( - printer, - "$deprecation$public Builder ${$set$capitalized_name$$}$(\n" - " $type$.Builder builderForValue)", - - "$oneof_name$_ = builderForValue.build();\n" - "$on_changed$\n", - - "$name$Builder_.setMessage(builderForValue.build());\n", - - "$set_oneof_case_message$;\n" - "return this;\n"); - - // Field.Builder mergeField(Field value) - WriteFieldDocComment(printer, descriptor_); - PrintNestedBuilderFunction( - printer, - "$deprecation$public Builder ${$merge$capitalized_name$$}$($type$ value)", - - "if ($has_oneof_case_message$ &&\n" - " $oneof_name$_ != $type$.getDefaultInstance()) {\n" - " $oneof_name$_ = $type$.newBuilder(($type$) $oneof_name$_)\n" - " .mergeFrom(value).buildPartial();\n" - "} else {\n" - " $oneof_name$_ = value;\n" - "}\n" - "$on_changed$\n", - - "if ($has_oneof_case_message$) {\n" - " $name$Builder_.mergeFrom(value);\n" - "}\n" - "$name$Builder_.setMessage(value);\n", - - "$set_oneof_case_message$;\n" - "return this;\n"); - - // Field.Builder clearField() - WriteFieldDocComment(printer, descriptor_); - PrintNestedBuilderFunction( - printer, "$deprecation$public Builder ${$clear$capitalized_name$$}$()", - - "if ($has_oneof_case_message$) {\n" - " $clear_oneof_case_message$;\n" - " $oneof_name$_ = null;\n" - " $on_changed$\n" - "}\n", - - "if ($has_oneof_case_message$) {\n" - " $clear_oneof_case_message$;\n" - " $oneof_name$_ = null;\n" - "}\n" - "$name$Builder_.clear();\n", - - "return this;\n"); - - WriteFieldDocComment(printer, descriptor_); - printer->Print(variables_, - "$deprecation$public $type$.Builder " - "${$get$capitalized_name$Builder$}$() {\n" - " return get$capitalized_name$FieldBuilder().getBuilder();\n" - "}\n"); - printer->Annotate("{", "}", descriptor_); - WriteFieldDocComment(printer, descriptor_); - printer->Print( - variables_, - "@java.lang.Override\n" - "$deprecation$public $type$OrBuilder " - "${$get$capitalized_name$OrBuilder$}$() {\n" - " if (($has_oneof_case_message$) && ($name$Builder_ != null)) {\n" - " return $name$Builder_.getMessageOrBuilder();\n" - " } else {\n" - " if ($has_oneof_case_message$) {\n" - " return ($type$) $oneof_name$_;\n" - " }\n" - " return $type$.getDefaultInstance();\n" - " }\n" - "}\n"); - printer->Annotate("{", "}", descriptor_); - WriteFieldDocComment(printer, descriptor_); - printer->Print( - variables_, - "private com.google.protobuf.SingleFieldBuilder$ver$<\n" - " $type$, $type$.Builder, $type$OrBuilder> \n" - " ${$get$capitalized_name$FieldBuilder$}$() {\n" - " if ($name$Builder_ == null) {\n" - " if (!($has_oneof_case_message$)) {\n" - " $oneof_name$_ = $type$.getDefaultInstance();\n" - " }\n" - " $name$Builder_ = new com.google.protobuf.SingleFieldBuilder$ver$<\n" - " $type$, $type$.Builder, $type$OrBuilder>(\n" - " ($type$) $oneof_name$_,\n" - " getParentForChildren(),\n" - " isClean());\n" - " $oneof_name$_ = null;\n" - " }\n" - " $set_oneof_case_message$;\n" - " $on_changed$;\n" - " return $name$Builder_;\n" - "}\n"); - printer->Annotate("{", "}", descriptor_); -} - -void ImmutableMessageOneofFieldGenerator::GenerateBuildingCode( - io::Printer* printer) const { - printer->Print(variables_, "if ($has_oneof_case_message$) {\n"); - printer->Indent(); - - PrintNestedBuilderCondition( - printer, "result.$oneof_name$_ = $oneof_name$_;\n", - - "result.$oneof_name$_ = $name$Builder_.build();\n"); - - printer->Outdent(); - printer->Print("}\n"); -} - -void ImmutableMessageOneofFieldGenerator::GenerateMergingCode( - io::Printer* printer) const { - printer->Print(variables_, - "merge$capitalized_name$(other.get$capitalized_name$());\n"); -} - -void ImmutableMessageOneofFieldGenerator::GenerateParsingCode( - io::Printer* printer) const { - printer->Print(variables_, - "$type$.Builder subBuilder = null;\n" - "if ($has_oneof_case_message$) {\n" - " subBuilder = (($type$) $oneof_name$_).toBuilder();\n" - "}\n"); - - if (GetType(descriptor_) == FieldDescriptor::TYPE_GROUP) { - printer->Print( - variables_, - "$oneof_name$_ = input.readGroup($number$, $type$.$get_parser$,\n" - " extensionRegistry);\n"); - } else { - printer->Print( - variables_, - "$oneof_name$_ =\n" - " input.readMessage($type$.$get_parser$, extensionRegistry);\n"); - } - - printer->Print(variables_, - "if (subBuilder != null) {\n" - " subBuilder.mergeFrom(($type$) $oneof_name$_);\n" - " $oneof_name$_ = subBuilder.buildPartial();\n" - "}\n"); - printer->Print(variables_, "$set_oneof_case_message$;\n"); -} - -void ImmutableMessageOneofFieldGenerator::GenerateSerializationCode( - io::Printer* printer) const { - printer->Print( - variables_, - "if ($has_oneof_case_message$) {\n" - " output.write$group_or_message$($number$, ($type$) $oneof_name$_);\n" - "}\n"); -} - -void ImmutableMessageOneofFieldGenerator::GenerateSerializedSizeCode( - io::Printer* printer) const { - printer->Print( - variables_, - "if ($has_oneof_case_message$) {\n" - " size += com.google.protobuf.CodedOutputStream\n" - " .compute$group_or_message$Size($number$, ($type$) $oneof_name$_);\n" - "}\n"); -} - -// =================================================================== - -RepeatedImmutableMessageFieldGenerator::RepeatedImmutableMessageFieldGenerator( - const FieldDescriptor* descriptor, int messageBitIndex, int builderBitIndex, - Context* context) - : descriptor_(descriptor), name_resolver_(context->GetNameResolver()) { - SetMessageVariables(descriptor, messageBitIndex, builderBitIndex, - context->GetFieldGeneratorInfo(descriptor), - name_resolver_, &variables_); -} - -RepeatedImmutableMessageFieldGenerator:: - ~RepeatedImmutableMessageFieldGenerator() {} - -int RepeatedImmutableMessageFieldGenerator::GetNumBitsForMessage() const { - return 0; -} - -int RepeatedImmutableMessageFieldGenerator::GetNumBitsForBuilder() const { - return 1; -} - -void RepeatedImmutableMessageFieldGenerator::GenerateInterfaceMembers( - io::Printer* printer) const { - // TODO(jonp): In the future, consider having methods specific to the - // interface so that builders can choose dynamically to either return a - // message or a nested builder, so that asking for the interface doesn't - // cause a message to ever be built. - WriteFieldDocComment(printer, descriptor_); - printer->Print(variables_, - "$deprecation$java.util.List<$type$> \n" - " get$capitalized_name$List();\n"); - WriteFieldDocComment(printer, descriptor_); - printer->Print(variables_, - "$deprecation$$type$ get$capitalized_name$(int index);\n"); - WriteFieldDocComment(printer, descriptor_); - printer->Print(variables_, - "$deprecation$int get$capitalized_name$Count();\n"); - - WriteFieldDocComment(printer, descriptor_); - printer->Print(variables_, - "$deprecation$java.util.List \n" - " get$capitalized_name$OrBuilderList();\n"); - WriteFieldDocComment(printer, descriptor_); - printer->Print( - variables_, - "$deprecation$$type$OrBuilder get$capitalized_name$OrBuilder(\n" - " int index);\n"); -} - -void RepeatedImmutableMessageFieldGenerator::GenerateMembers( - io::Printer* printer) const { - printer->Print(variables_, "private java.util.List<$type$> $name$_;\n"); - PrintExtraFieldInfo(variables_, printer); - WriteFieldDocComment(printer, descriptor_); - printer->Print(variables_, - "@java.lang.Override\n" - "$deprecation$public java.util.List<$type$> " - "${$get$capitalized_name$List$}$() {\n" - " return $name$_;\n" // note: unmodifiable list - "}\n"); - printer->Annotate("{", "}", descriptor_); - WriteFieldDocComment(printer, descriptor_); - printer->Print( - variables_, - "@java.lang.Override\n" - "$deprecation$public java.util.List \n" - " ${$get$capitalized_name$OrBuilderList$}$() {\n" - " return $name$_;\n" - "}\n"); - printer->Annotate("{", "}", descriptor_); - WriteFieldDocComment(printer, descriptor_); - printer->Print( - variables_, - "@java.lang.Override\n" - "$deprecation$public int ${$get$capitalized_name$Count$}$() {\n" - " return $name$_.size();\n" - "}\n"); - printer->Annotate("{", "}", descriptor_); - WriteFieldDocComment(printer, descriptor_); - printer->Print( - variables_, - "@java.lang.Override\n" - "$deprecation$public $type$ ${$get$capitalized_name$$}$(int index) {\n" - " return $name$_.get(index);\n" - "}\n"); - printer->Annotate("{", "}", descriptor_); - WriteFieldDocComment(printer, descriptor_); - printer->Print(variables_, - "@java.lang.Override\n" - "$deprecation$public $type$OrBuilder " - "${$get$capitalized_name$OrBuilder$}$(\n" - " int index) {\n" - " return $name$_.get(index);\n" - "}\n"); - printer->Annotate("{", "}", descriptor_); -} - -void RepeatedImmutableMessageFieldGenerator::PrintNestedBuilderCondition( - io::Printer* printer, const char* regular_case, - const char* nested_builder_case) const { - printer->Print(variables_, "if ($name$Builder_ == null) {\n"); - printer->Indent(); - printer->Print(variables_, regular_case); - printer->Outdent(); - printer->Print("} else {\n"); - printer->Indent(); - printer->Print(variables_, nested_builder_case); - printer->Outdent(); - printer->Print("}\n"); -} - -void RepeatedImmutableMessageFieldGenerator::PrintNestedBuilderFunction( - io::Printer* printer, const char* method_prototype, - const char* regular_case, const char* nested_builder_case, - const char* trailing_code) const { - printer->Print(variables_, method_prototype); - printer->Annotate("{", "}", descriptor_); - printer->Print(" {\n"); - printer->Indent(); - PrintNestedBuilderCondition(printer, regular_case, nested_builder_case); - if (trailing_code != NULL) { - printer->Print(variables_, trailing_code); - } - printer->Outdent(); - printer->Print("}\n"); -} - -void RepeatedImmutableMessageFieldGenerator::GenerateBuilderMembers( - io::Printer* printer) const { - // When using nested-builders, the code initially works just like the - // non-nested builder case. It only creates a nested builder lazily on - // demand and then forever delegates to it after creation. - - printer->Print( - variables_, - // Used when the builder is null. - // One field is the list and the other field keeps track of whether the - // list is immutable. If it's immutable, the invariant is that it must - // either an instance of Collections.emptyList() or it's an ArrayList - // wrapped in a Collections.unmodifiableList() wrapper and nobody else has - // a reference to the underlying ArrayList. This invariant allows us to - // share instances of lists between protocol buffers avoiding expensive - // memory allocations. Note, immutable is a strong guarantee here -- not - // just that the list cannot be modified via the reference but that the - // list can never be modified. - "private java.util.List<$type$> $name$_ =\n" - " java.util.Collections.emptyList();\n" - - "private void ensure$capitalized_name$IsMutable() {\n" - " if (!$get_mutable_bit_builder$) {\n" - " $name$_ = new java.util.ArrayList<$type$>($name$_);\n" - " $set_mutable_bit_builder$;\n" - " }\n" - "}\n" - "\n"); - - printer->Print( - variables_, - // If this builder is non-null, it is used and the other fields are - // ignored. - "private com.google.protobuf.RepeatedFieldBuilder$ver$<\n" - " $type$, $type$.Builder, $type$OrBuilder> $name$Builder_;\n" - "\n"); - - // The comments above the methods below are based on a hypothetical - // repeated field of type "Field" called "RepeatedField". - - // List getRepeatedFieldList() - WriteFieldDocComment(printer, descriptor_); - PrintNestedBuilderFunction( - printer, - "$deprecation$public java.util.List<$type$> " - "${$get$capitalized_name$List$}$()", - - "return java.util.Collections.unmodifiableList($name$_);\n", - "return $name$Builder_.getMessageList();\n", - - NULL); - - // int getRepeatedFieldCount() - WriteFieldDocComment(printer, descriptor_); - PrintNestedBuilderFunction( - printer, "$deprecation$public int ${$get$capitalized_name$Count$}$()", - - "return $name$_.size();\n", "return $name$Builder_.getCount();\n", - - NULL); - - // Field getRepeatedField(int index) - WriteFieldDocComment(printer, descriptor_); - PrintNestedBuilderFunction( - printer, - "$deprecation$public $type$ ${$get$capitalized_name$$}$(int index)", - - "return $name$_.get(index);\n", - - "return $name$Builder_.getMessage(index);\n", - - NULL); - - // Builder setRepeatedField(int index, Field value) - WriteFieldDocComment(printer, descriptor_); - PrintNestedBuilderFunction( - printer, - "$deprecation$public Builder ${$set$capitalized_name$$}$(\n" - " int index, $type$ value)", - "if (value == null) {\n" - " throw new NullPointerException();\n" - "}\n" - "ensure$capitalized_name$IsMutable();\n" - "$name$_.set(index, value);\n" - "$on_changed$\n", - "$name$Builder_.setMessage(index, value);\n", "return this;\n"); - - // Builder setRepeatedField(int index, Field.Builder builderForValue) - WriteFieldDocComment(printer, descriptor_); - PrintNestedBuilderFunction( - printer, - "$deprecation$public Builder ${$set$capitalized_name$$}$(\n" - " int index, $type$.Builder builderForValue)", - - "ensure$capitalized_name$IsMutable();\n" - "$name$_.set(index, builderForValue.build());\n" - "$on_changed$\n", - - "$name$Builder_.setMessage(index, builderForValue.build());\n", - - "return this;\n"); - - // Builder addRepeatedField(Field value) - WriteFieldDocComment(printer, descriptor_); - PrintNestedBuilderFunction( - printer, - "$deprecation$public Builder ${$add$capitalized_name$$}$($type$ value)", - - "if (value == null) {\n" - " throw new NullPointerException();\n" - "}\n" - "ensure$capitalized_name$IsMutable();\n" - "$name$_.add(value);\n" - - "$on_changed$\n", - - "$name$Builder_.addMessage(value);\n", - - "return this;\n"); - - // Builder addRepeatedField(int index, Field value) - WriteFieldDocComment(printer, descriptor_); - PrintNestedBuilderFunction( - printer, - "$deprecation$public Builder ${$add$capitalized_name$$}$(\n" - " int index, $type$ value)", - - "if (value == null) {\n" - " throw new NullPointerException();\n" - "}\n" - "ensure$capitalized_name$IsMutable();\n" - "$name$_.add(index, value);\n" - "$on_changed$\n", - - "$name$Builder_.addMessage(index, value);\n", - - "return this;\n"); - - // Builder addRepeatedField(Field.Builder builderForValue) - WriteFieldDocComment(printer, descriptor_); - PrintNestedBuilderFunction( - printer, - "$deprecation$public Builder ${$add$capitalized_name$$}$(\n" - " $type$.Builder builderForValue)", - - "ensure$capitalized_name$IsMutable();\n" - "$name$_.add(builderForValue.build());\n" - "$on_changed$\n", - - "$name$Builder_.addMessage(builderForValue.build());\n", - - "return this;\n"); - - // Builder addRepeatedField(int index, Field.Builder builderForValue) - WriteFieldDocComment(printer, descriptor_); - PrintNestedBuilderFunction( - printer, - "$deprecation$public Builder ${$add$capitalized_name$$}$(\n" - " int index, $type$.Builder builderForValue)", - - "ensure$capitalized_name$IsMutable();\n" - "$name$_.add(index, builderForValue.build());\n" - "$on_changed$\n", - - "$name$Builder_.addMessage(index, builderForValue.build());\n", - - "return this;\n"); - - // Builder addAllRepeatedField(Iterable values) - WriteFieldDocComment(printer, descriptor_); - PrintNestedBuilderFunction( - printer, - "$deprecation$public Builder ${$addAll$capitalized_name$$}$(\n" - " java.lang.Iterable values)", - - "ensure$capitalized_name$IsMutable();\n" - "com.google.protobuf.AbstractMessageLite.Builder.addAll(\n" - " values, $name$_);\n" - "$on_changed$\n", - - "$name$Builder_.addAllMessages(values);\n", - - "return this;\n"); - - // Builder clearAllRepeatedField() - WriteFieldDocComment(printer, descriptor_); - PrintNestedBuilderFunction( - printer, "$deprecation$public Builder ${$clear$capitalized_name$$}$()", - - "$name$_ = java.util.Collections.emptyList();\n" - "$clear_mutable_bit_builder$;\n" - "$on_changed$\n", - - "$name$Builder_.clear();\n", - - "return this;\n"); - - // Builder removeRepeatedField(int index) - WriteFieldDocComment(printer, descriptor_); - PrintNestedBuilderFunction( - printer, - "$deprecation$public Builder ${$remove$capitalized_name$$}$(int index)", - - "ensure$capitalized_name$IsMutable();\n" - "$name$_.remove(index);\n" - "$on_changed$\n", - - "$name$Builder_.remove(index);\n", - - "return this;\n"); - - WriteFieldDocComment(printer, descriptor_); - printer->Print( - variables_, - "$deprecation$public $type$.Builder ${$get$capitalized_name$Builder$}$(\n" - " int index) {\n" - " return get$capitalized_name$FieldBuilder().getBuilder(index);\n" - "}\n"); - printer->Annotate("{", "}", descriptor_); - - WriteFieldDocComment(printer, descriptor_); - printer->Print(variables_, - "$deprecation$public $type$OrBuilder " - "${$get$capitalized_name$OrBuilder$}$(\n" - " int index) {\n" - " if ($name$Builder_ == null) {\n" - " return $name$_.get(index);" - " } else {\n" - " return $name$Builder_.getMessageOrBuilder(index);\n" - " }\n" - "}\n"); - printer->Annotate("{", "}", descriptor_); - - WriteFieldDocComment(printer, descriptor_); - printer->Print( - variables_, - "$deprecation$public java.util.List \n" - " ${$get$capitalized_name$OrBuilderList$}$() {\n" - " if ($name$Builder_ != null) {\n" - " return $name$Builder_.getMessageOrBuilderList();\n" - " } else {\n" - " return java.util.Collections.unmodifiableList($name$_);\n" - " }\n" - "}\n"); - printer->Annotate("{", "}", descriptor_); - - WriteFieldDocComment(printer, descriptor_); - printer->Print(variables_, - "$deprecation$public $type$.Builder " - "${$add$capitalized_name$Builder$}$() {\n" - " return get$capitalized_name$FieldBuilder().addBuilder(\n" - " $type$.getDefaultInstance());\n" - "}\n"); - printer->Annotate("{", "}", descriptor_); - WriteFieldDocComment(printer, descriptor_); - printer->Print( - variables_, - "$deprecation$public $type$.Builder ${$add$capitalized_name$Builder$}$(\n" - " int index) {\n" - " return get$capitalized_name$FieldBuilder().addBuilder(\n" - " index, $type$.getDefaultInstance());\n" - "}\n"); - printer->Annotate("{", "}", descriptor_); - WriteFieldDocComment(printer, descriptor_); - printer->Print( - variables_, - "$deprecation$public java.util.List<$type$.Builder> \n" - " ${$get$capitalized_name$BuilderList$}$() {\n" - " return get$capitalized_name$FieldBuilder().getBuilderList();\n" - "}\n" - "private com.google.protobuf.RepeatedFieldBuilder$ver$<\n" - " $type$, $type$.Builder, $type$OrBuilder> \n" - " get$capitalized_name$FieldBuilder() {\n" - " if ($name$Builder_ == null) {\n" - " $name$Builder_ = new " - "com.google.protobuf.RepeatedFieldBuilder$ver$<\n" - " $type$, $type$.Builder, $type$OrBuilder>(\n" - " $name$_,\n" - " $get_mutable_bit_builder$,\n" - " getParentForChildren(),\n" - " isClean());\n" - " $name$_ = null;\n" - " }\n" - " return $name$Builder_;\n" - "}\n"); - printer->Annotate("{", "}", descriptor_); -} - -void RepeatedImmutableMessageFieldGenerator:: - GenerateFieldBuilderInitializationCode(io::Printer* printer) const { - printer->Print(variables_, "get$capitalized_name$FieldBuilder();\n"); -} - -void RepeatedImmutableMessageFieldGenerator::GenerateInitializationCode( - io::Printer* printer) const { - printer->Print(variables_, "$name$_ = java.util.Collections.emptyList();\n"); -} - -void RepeatedImmutableMessageFieldGenerator::GenerateBuilderClearCode( - io::Printer* printer) const { - PrintNestedBuilderCondition(printer, - "$name$_ = java.util.Collections.emptyList();\n" - "$clear_mutable_bit_builder$;\n", - - "$name$Builder_.clear();\n"); -} - -void RepeatedImmutableMessageFieldGenerator::GenerateMergingCode( - io::Printer* printer) const { - // The code below does two optimizations (non-nested builder case): - // 1. If the other list is empty, there's nothing to do. This ensures we - // don't allocate a new array if we already have an immutable one. - // 2. If the other list is non-empty and our current list is empty, we can - // reuse the other list which is guaranteed to be immutable. - PrintNestedBuilderCondition( - printer, - "if (!other.$name$_.isEmpty()) {\n" - " if ($name$_.isEmpty()) {\n" - " $name$_ = other.$name$_;\n" - " $clear_mutable_bit_builder$;\n" - " } else {\n" - " ensure$capitalized_name$IsMutable();\n" - " $name$_.addAll(other.$name$_);\n" - " }\n" - " $on_changed$\n" - "}\n", - - "if (!other.$name$_.isEmpty()) {\n" - " if ($name$Builder_.isEmpty()) {\n" - " $name$Builder_.dispose();\n" - " $name$Builder_ = null;\n" - " $name$_ = other.$name$_;\n" - " $clear_mutable_bit_builder$;\n" - " $name$Builder_ = \n" - " com.google.protobuf.GeneratedMessage$ver$.alwaysUseFieldBuilders " - "?\n" - " get$capitalized_name$FieldBuilder() : null;\n" - " } else {\n" - " $name$Builder_.addAllMessages(other.$name$_);\n" - " }\n" - "}\n"); -} - -void RepeatedImmutableMessageFieldGenerator::GenerateBuildingCode( - io::Printer* printer) const { - // The code below (non-nested builder case) ensures that the result has an - // immutable list. If our list is immutable, we can just reuse it. If not, - // we make it immutable. - PrintNestedBuilderCondition( - printer, - "if ($get_mutable_bit_builder$) {\n" - " $name$_ = java.util.Collections.unmodifiableList($name$_);\n" - " $clear_mutable_bit_builder$;\n" - "}\n" - "result.$name$_ = $name$_;\n", - - "result.$name$_ = $name$Builder_.build();\n"); -} - -void RepeatedImmutableMessageFieldGenerator::GenerateParsingCode( - io::Printer* printer) const { - printer->Print(variables_, - "if (!$get_mutable_bit_parser$) {\n" - " $name$_ = new java.util.ArrayList<$type$>();\n" - " $set_mutable_bit_parser$;\n" - "}\n"); - - if (GetType(descriptor_) == FieldDescriptor::TYPE_GROUP) { - printer->Print( - variables_, - "$name$_.add(input.readGroup($number$, $type$.$get_parser$,\n" - " extensionRegistry));\n"); - } else { - printer->Print( - variables_, - "$name$_.add(\n" - " input.readMessage($type$.$get_parser$, extensionRegistry));\n"); - } -} - -void RepeatedImmutableMessageFieldGenerator::GenerateParsingDoneCode( - io::Printer* printer) const { - printer->Print( - variables_, - "if ($get_mutable_bit_parser$) {\n" - " $name$_ = java.util.Collections.unmodifiableList($name$_);\n" - "}\n"); -} - -void RepeatedImmutableMessageFieldGenerator::GenerateSerializationCode( - io::Printer* printer) const { - printer->Print(variables_, - "for (int i = 0; i < $name$_.size(); i++) {\n" - " output.write$group_or_message$($number$, $name$_.get(i));\n" - "}\n"); -} - -void RepeatedImmutableMessageFieldGenerator::GenerateSerializedSizeCode( - io::Printer* printer) const { - printer->Print( - variables_, - "for (int i = 0; i < $name$_.size(); i++) {\n" - " size += com.google.protobuf.CodedOutputStream\n" - " .compute$group_or_message$Size($number$, $name$_.get(i));\n" - "}\n"); -} - -void RepeatedImmutableMessageFieldGenerator::GenerateEqualsCode( - io::Printer* printer) const { - printer->Print( - variables_, - "if (!get$capitalized_name$List()\n" - " .equals(other.get$capitalized_name$List())) return false;\n"); -} - -void RepeatedImmutableMessageFieldGenerator::GenerateHashCode( - io::Printer* printer) const { - printer->Print( - variables_, - "if (get$capitalized_name$Count() > 0) {\n" - " hash = (37 * hash) + $constant_name$;\n" - " hash = (53 * hash) + get$capitalized_name$List().hashCode();\n" - "}\n"); -} - -std::string RepeatedImmutableMessageFieldGenerator::GetBoxedType() const { - return name_resolver_->GetImmutableClassName(descriptor_->message_type()); -} - -void RepeatedImmutableMessageFieldGenerator::GenerateKotlinDslMembers( - io::Printer* printer) const { - printer->Print( - variables_, - "/**\n" - " * An uninstantiable, behaviorless type to represent the field in\n" - " * generics.\n" - " */\n" - "@kotlin.OptIn" - "(com.google.protobuf.kotlin.OnlyForUseByGeneratedProtoCode::class)\n" - "public class ${$$kt_capitalized_name$Proxy$}$ private constructor()" - " : com.google.protobuf.kotlin.DslProxy()\n"); - - WriteFieldDocComment(printer, descriptor_); - printer->Print(variables_, - "$kt_deprecation$ public val $kt_name$: " - "com.google.protobuf.kotlin.DslList" - "<$kt_type$, ${$$kt_capitalized_name$Proxy$}$>\n" - " @kotlin.jvm.JvmSynthetic\n" - " get() = com.google.protobuf.kotlin.DslList(\n" - " $kt_dsl_builder$.${$get$capitalized_name$List$}$()\n" - " )\n"); - - WriteFieldAccessorDocComment(printer, descriptor_, LIST_ADDER, - /* builder */ false); - printer->Print(variables_, - "@kotlin.jvm.JvmSynthetic\n" - "@kotlin.jvm.JvmName(\"add$kt_capitalized_name$\")\n" - "public fun com.google.protobuf.kotlin.DslList" - "<$kt_type$, ${$$kt_capitalized_name$Proxy$}$>." - "add(value: $kt_type$) {\n" - " $kt_dsl_builder$.${$add$capitalized_name$$}$(value)\n" - "}"); - - WriteFieldAccessorDocComment(printer, descriptor_, LIST_ADDER, - /* builder */ false); - printer->Print(variables_, - "@kotlin.jvm.JvmSynthetic\n" - "@kotlin.jvm.JvmName(\"plusAssign$kt_capitalized_name$\")\n" - "@Suppress(\"NOTHING_TO_INLINE\")\n" - "public inline operator fun com.google.protobuf.kotlin.DslList" - "<$kt_type$, ${$$kt_capitalized_name$Proxy$}$>." - "plusAssign(value: $kt_type$) {\n" - " add(value)\n" - "}"); - - WriteFieldAccessorDocComment(printer, descriptor_, LIST_MULTI_ADDER, - /* builder */ false); - printer->Print(variables_, - "@kotlin.jvm.JvmSynthetic\n" - "@kotlin.jvm.JvmName(\"addAll$kt_capitalized_name$\")\n" - "public fun com.google.protobuf.kotlin.DslList" - "<$kt_type$, ${$$kt_capitalized_name$Proxy$}$>." - "addAll(values: kotlin.collections.Iterable<$kt_type$>) {\n" - " $kt_dsl_builder$.${$addAll$capitalized_name$$}$(values)\n" - "}"); - - WriteFieldAccessorDocComment(printer, descriptor_, LIST_MULTI_ADDER, - /* builder */ false); - printer->Print( - variables_, - "@kotlin.jvm.JvmSynthetic\n" - "@kotlin.jvm.JvmName(\"plusAssignAll$kt_capitalized_name$\")\n" - "@Suppress(\"NOTHING_TO_INLINE\")\n" - "public inline operator fun com.google.protobuf.kotlin.DslList" - "<$kt_type$, ${$$kt_capitalized_name$Proxy$}$>." - "plusAssign(values: kotlin.collections.Iterable<$kt_type$>) {\n" - " addAll(values)\n" - "}"); - - WriteFieldAccessorDocComment(printer, descriptor_, LIST_INDEXED_SETTER, - /* builder */ false); - printer->Print( - variables_, - "@kotlin.jvm.JvmSynthetic\n" - "@kotlin.jvm.JvmName(\"set$kt_capitalized_name$\")\n" - "public operator fun com.google.protobuf.kotlin.DslList" - "<$kt_type$, ${$$kt_capitalized_name$Proxy$}$>." - "set(index: kotlin.Int, value: $kt_type$) {\n" - " $kt_dsl_builder$.${$set$capitalized_name$$}$(index, value)\n" - "}"); - - WriteFieldAccessorDocComment(printer, descriptor_, CLEARER, - /* builder */ false); - printer->Print(variables_, - "@kotlin.jvm.JvmSynthetic\n" - "@kotlin.jvm.JvmName(\"clear$kt_capitalized_name$\")\n" - "public fun com.google.protobuf.kotlin.DslList" - "<$kt_type$, ${$$kt_capitalized_name$Proxy$}$>." - "clear() {\n" - " $kt_dsl_builder$.${$clear$capitalized_name$$}$()\n" - "}"); -} - -} // namespace java -} // namespace compiler -} // namespace protobuf -} // namespace google diff --git a/extra/protobuf/protobuf-3.19.4/src/google/protobuf/compiler/java/java_message_field.h b/extra/protobuf/protobuf-3.19.4/src/google/protobuf/compiler/java/java_message_field.h deleted file mode 100644 index 8588100b6b96..000000000000 --- a/extra/protobuf/protobuf-3.19.4/src/google/protobuf/compiler/java/java_message_field.h +++ /dev/null @@ -1,179 +0,0 @@ -// Protocol Buffers - Google's data interchange format -// Copyright 2008 Google Inc. All rights reserved. -// https://developers.google.com/protocol-buffers/ -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// * Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// * Redistributions in binary form must reproduce the above -// copyright notice, this list of conditions and the following disclaimer -// in the documentation and/or other materials provided with the -// distribution. -// * Neither the name of Google Inc. nor the names of its -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -// Author: kenton@google.com (Kenton Varda) -// Based on original Protocol Buffers design by -// Sanjay Ghemawat, Jeff Dean, and others. - -#ifndef GOOGLE_PROTOBUF_COMPILER_JAVA_MESSAGE_FIELD_H__ -#define GOOGLE_PROTOBUF_COMPILER_JAVA_MESSAGE_FIELD_H__ - -#include -#include -#include - -namespace google { -namespace protobuf { -namespace compiler { -namespace java { -class Context; // context.h -class ClassNameResolver; // name_resolver.h -} // namespace java -} // namespace compiler -} // namespace protobuf -} // namespace google - -namespace google { -namespace protobuf { -namespace compiler { -namespace java { - -class ImmutableMessageFieldGenerator : public ImmutableFieldGenerator { - public: - explicit ImmutableMessageFieldGenerator(const FieldDescriptor* descriptor, - int messageBitIndex, - int builderBitIndex, - Context* context); - ~ImmutableMessageFieldGenerator(); - - // implements ImmutableFieldGenerator - // --------------------------------------- - int GetNumBitsForMessage() const override; - int GetNumBitsForBuilder() const override; - void GenerateInterfaceMembers(io::Printer* printer) const override; - void GenerateMembers(io::Printer* printer) const override; - void GenerateBuilderMembers(io::Printer* printer) const override; - void GenerateInitializationCode(io::Printer* printer) const override; - void GenerateBuilderClearCode(io::Printer* printer) const override; - void GenerateMergingCode(io::Printer* printer) const override; - void GenerateBuildingCode(io::Printer* printer) const override; - void GenerateParsingCode(io::Printer* printer) const override; - void GenerateParsingDoneCode(io::Printer* printer) const override; - void GenerateSerializationCode(io::Printer* printer) const override; - void GenerateSerializedSizeCode(io::Printer* printer) const override; - void GenerateFieldBuilderInitializationCode( - io::Printer* printer) const override; - void GenerateEqualsCode(io::Printer* printer) const override; - void GenerateHashCode(io::Printer* printer) const override; - void GenerateKotlinDslMembers(io::Printer* printer) const override; - - std::string GetBoxedType() const override; - - protected: - const FieldDescriptor* descriptor_; - std::map variables_; - ClassNameResolver* name_resolver_; - - void PrintNestedBuilderCondition(io::Printer* printer, - const char* regular_case, - const char* nested_builder_case) const; - void PrintNestedBuilderFunction(io::Printer* printer, - const char* method_prototype, - const char* regular_case, - const char* nested_builder_case, - const char* trailing_code) const; - - private: - GOOGLE_DISALLOW_EVIL_CONSTRUCTORS(ImmutableMessageFieldGenerator); -}; - -class ImmutableMessageOneofFieldGenerator - : public ImmutableMessageFieldGenerator { - public: - ImmutableMessageOneofFieldGenerator(const FieldDescriptor* descriptor, - int messageBitIndex, int builderBitIndex, - Context* context); - ~ImmutableMessageOneofFieldGenerator(); - - void GenerateMembers(io::Printer* printer) const override; - void GenerateBuilderMembers(io::Printer* printer) const override; - void GenerateBuildingCode(io::Printer* printer) const override; - void GenerateMergingCode(io::Printer* printer) const override; - void GenerateParsingCode(io::Printer* printer) const override; - void GenerateSerializationCode(io::Printer* printer) const override; - void GenerateSerializedSizeCode(io::Printer* printer) const override; - - private: - GOOGLE_DISALLOW_EVIL_CONSTRUCTORS(ImmutableMessageOneofFieldGenerator); -}; - -class RepeatedImmutableMessageFieldGenerator : public ImmutableFieldGenerator { - public: - explicit RepeatedImmutableMessageFieldGenerator( - const FieldDescriptor* descriptor, int messageBitIndex, - int builderBitIndex, Context* context); - ~RepeatedImmutableMessageFieldGenerator() override; - - // implements ImmutableFieldGenerator --------------------------------------- - int GetNumBitsForMessage() const override; - int GetNumBitsForBuilder() const override; - void GenerateInterfaceMembers(io::Printer* printer) const override; - void GenerateMembers(io::Printer* printer) const override; - void GenerateBuilderMembers(io::Printer* printer) const override; - void GenerateInitializationCode(io::Printer* printer) const override; - void GenerateBuilderClearCode(io::Printer* printer) const override; - void GenerateMergingCode(io::Printer* printer) const override; - void GenerateBuildingCode(io::Printer* printer) const override; - void GenerateParsingCode(io::Printer* printer) const override; - void GenerateParsingDoneCode(io::Printer* printer) const override; - void GenerateSerializationCode(io::Printer* printer) const override; - void GenerateSerializedSizeCode(io::Printer* printer) const override; - void GenerateFieldBuilderInitializationCode( - io::Printer* printer) const override; - void GenerateEqualsCode(io::Printer* printer) const override; - void GenerateHashCode(io::Printer* printer) const override; - void GenerateKotlinDslMembers(io::Printer* printer) const override; - - std::string GetBoxedType() const override; - - protected: - const FieldDescriptor* descriptor_; - std::map variables_; - ClassNameResolver* name_resolver_; - - void PrintNestedBuilderCondition(io::Printer* printer, - const char* regular_case, - const char* nested_builder_case) const; - void PrintNestedBuilderFunction(io::Printer* printer, - const char* method_prototype, - const char* regular_case, - const char* nested_builder_case, - const char* trailing_code) const; - - private: - GOOGLE_DISALLOW_EVIL_CONSTRUCTORS(RepeatedImmutableMessageFieldGenerator); -}; - -} // namespace java -} // namespace compiler -} // namespace protobuf -} // namespace google - -#endif // GOOGLE_PROTOBUF_COMPILER_JAVA_MESSAGE_FIELD_H__ diff --git a/extra/protobuf/protobuf-3.19.4/src/google/protobuf/compiler/java/java_message_field_lite.cc b/extra/protobuf/protobuf-3.19.4/src/google/protobuf/compiler/java/java_message_field_lite.cc deleted file mode 100644 index 1c4d016d3ca4..000000000000 --- a/extra/protobuf/protobuf-3.19.4/src/google/protobuf/compiler/java/java_message_field_lite.cc +++ /dev/null @@ -1,884 +0,0 @@ -// Protocol Buffers - Google's data interchange format -// Copyright 2008 Google Inc. All rights reserved. -// https://developers.google.com/protocol-buffers/ -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// * Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// * Redistributions in binary form must reproduce the above -// copyright notice, this list of conditions and the following disclaimer -// in the documentation and/or other materials provided with the -// distribution. -// * Neither the name of Google Inc. nor the names of its -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -// Author: kenton@google.com (Kenton Varda) -// Based on original Protocol Buffers design by -// Sanjay Ghemawat, Jeff Dean, and others. - -#include - -#include -#include -#include - -#include -#include -#include -#include -#include -#include -#include - -namespace google { -namespace protobuf { -namespace compiler { -namespace java { - -namespace { - -void SetMessageVariables(const FieldDescriptor* descriptor, int messageBitIndex, - int builderBitIndex, const FieldGeneratorInfo* info, - ClassNameResolver* name_resolver, - std::map* variables) { - SetCommonFieldVariables(descriptor, info, variables); - - (*variables)["type"] = - name_resolver->GetImmutableClassName(descriptor->message_type()); - (*variables)["kt_type"] = (*variables)["type"]; - (*variables)["mutable_type"] = - name_resolver->GetMutableClassName(descriptor->message_type()); - (*variables)["group_or_message"] = - (GetType(descriptor) == FieldDescriptor::TYPE_GROUP) ? "Group" - : "Message"; - // TODO(birdo): Add @deprecated javadoc when generating javadoc is supported - // by the proto compiler - (*variables)["deprecation"] = - descriptor->options().deprecated() ? "@java.lang.Deprecated " : ""; - (*variables)["kt_deprecation"] = - descriptor->options().deprecated() - ? "@kotlin.Deprecated(message = \"Field " + (*variables)["name"] + - " is deprecated\") " - : ""; - (*variables)["required"] = descriptor->is_required() ? "true" : "false"; - - if (HasHasbit(descriptor)) { - // For singular messages and builders, one bit is used for the hasField bit. - (*variables)["get_has_field_bit_message"] = GenerateGetBit(messageBitIndex); - - // Note that these have a trailing ";". - (*variables)["set_has_field_bit_message"] = - GenerateSetBit(messageBitIndex) + ";"; - (*variables)["clear_has_field_bit_message"] = - GenerateClearBit(messageBitIndex) + ";"; - - (*variables)["is_field_present_message"] = GenerateGetBit(messageBitIndex); - } else { - (*variables)["set_has_field_bit_message"] = ""; - (*variables)["clear_has_field_bit_message"] = ""; - - (*variables)["is_field_present_message"] = - (*variables)["name"] + "_ != null"; - } - - (*variables)["get_has_field_bit_from_local"] = - GenerateGetBitFromLocal(builderBitIndex); - (*variables)["set_has_field_bit_to_local"] = - GenerateSetBitToLocal(messageBitIndex); - - // We use `x.getClass()` as a null check because it generates less bytecode - // than an `if (x == null) { throw ... }` statement. - (*variables)["null_check"] = "value.getClass();\n"; -} - -} // namespace - -// =================================================================== - -ImmutableMessageFieldLiteGenerator::ImmutableMessageFieldLiteGenerator( - const FieldDescriptor* descriptor, int messageBitIndex, Context* context) - : descriptor_(descriptor), - messageBitIndex_(messageBitIndex), - name_resolver_(context->GetNameResolver()) { - SetMessageVariables(descriptor, messageBitIndex, 0, - context->GetFieldGeneratorInfo(descriptor), - name_resolver_, &variables_); -} - -ImmutableMessageFieldLiteGenerator::~ImmutableMessageFieldLiteGenerator() {} - -int ImmutableMessageFieldLiteGenerator::GetNumBitsForMessage() const { - // TODO(dweis): We don't need a has bit for messages as they have null - // sentinels and no user should be reflecting on this. We could save some - // bits by setting to 0 and updating the runtimes but this might come at a - // runtime performance cost since we can't memoize has-bit reads. - return HasHasbit(descriptor_) ? 1 : 0; -} - -void ImmutableMessageFieldLiteGenerator::GenerateInterfaceMembers( - io::Printer* printer) const { - WriteFieldAccessorDocComment(printer, descriptor_, HAZZER); - printer->Print(variables_, "$deprecation$boolean has$capitalized_name$();\n"); - WriteFieldAccessorDocComment(printer, descriptor_, GETTER); - printer->Print(variables_, "$deprecation$$type$ get$capitalized_name$();\n"); -} - -void ImmutableMessageFieldLiteGenerator::GenerateMembers( - io::Printer* printer) const { - - printer->Print(variables_, "private $type$ $name$_;\n"); - PrintExtraFieldInfo(variables_, printer); - - if (HasHasbit(descriptor_)) { - WriteFieldDocComment(printer, descriptor_); - printer->Print( - variables_, - "@java.lang.Override\n" - "$deprecation$public boolean ${$has$capitalized_name$$}$() {\n" - " return $get_has_field_bit_message$;\n" - "}\n"); - printer->Annotate("{", "}", descriptor_); - WriteFieldDocComment(printer, descriptor_); - printer->Print( - variables_, - "@java.lang.Override\n" - "$deprecation$public $type$ ${$get$capitalized_name$$}$() {\n" - " return $name$_ == null ? $type$.getDefaultInstance() : $name$_;\n" - "}\n"); - printer->Annotate("{", "}", descriptor_); - } else { - WriteFieldDocComment(printer, descriptor_); - printer->Print( - variables_, - "@java.lang.Override\n" - "$deprecation$public boolean ${$has$capitalized_name$$}$() {\n" - " return $name$_ != null;\n" - "}\n"); - printer->Annotate("{", "}", descriptor_); - WriteFieldDocComment(printer, descriptor_); - printer->Print( - variables_, - "@java.lang.Override\n" - "$deprecation$public $type$ ${$get$capitalized_name$$}$() {\n" - " return $name$_ == null ? $type$.getDefaultInstance() : $name$_;\n" - "}\n"); - printer->Annotate("{", "}", descriptor_); - } - - // Field.Builder setField(Field value) - WriteFieldDocComment(printer, descriptor_); - printer->Print(variables_, - "private void set$capitalized_name$($type$ value) {\n" - " $null_check$" - " $name$_ = value;\n" - " $set_has_field_bit_message$\n" - " }\n"); - - // Field.Builder mergeField(Field value) - WriteFieldDocComment(printer, descriptor_); - printer->Print( - variables_, - "@java.lang.SuppressWarnings({\"ReferenceEquality\"})\n" - "private void merge$capitalized_name$($type$ value) {\n" - " $null_check$" - " if ($name$_ != null &&\n" - " $name$_ != $type$.getDefaultInstance()) {\n" - " $name$_ =\n" - " $type$.newBuilder($name$_).mergeFrom(value).buildPartial();\n" - " } else {\n" - " $name$_ = value;\n" - " }\n" - " $set_has_field_bit_message$\n" - "}\n"); - - // Field.Builder clearField() - WriteFieldDocComment(printer, descriptor_); - printer->Print(variables_, - "private void clear$capitalized_name$() {" - " $name$_ = null;\n" - " $clear_has_field_bit_message$\n" - "}\n"); -} - -void ImmutableMessageFieldLiteGenerator::GenerateBuilderMembers( - io::Printer* printer) const { - // The comments above the methods below are based on a hypothetical - // field of type "Field" called "Field". - - // boolean hasField() - WriteFieldDocComment(printer, descriptor_); - printer->Print(variables_, - "@java.lang.Override\n" - "$deprecation$public boolean ${$has$capitalized_name$$}$() {\n" - " return instance.has$capitalized_name$();\n" - "}\n"); - printer->Annotate("{", "}", descriptor_); - - // Field getField() - WriteFieldDocComment(printer, descriptor_); - printer->Print(variables_, - "@java.lang.Override\n" - "$deprecation$public $type$ ${$get$capitalized_name$$}$() {\n" - " return instance.get$capitalized_name$();\n" - "}\n"); - printer->Annotate("{", "}", descriptor_); - - // Field.Builder setField(Field value) - WriteFieldDocComment(printer, descriptor_); - printer->Print(variables_, - "$deprecation$public Builder " - "${$set$capitalized_name$$}$($type$ value) {\n" - " copyOnWrite();\n" - " instance.set$capitalized_name$(value);\n" - " return this;\n" - " }\n"); - printer->Annotate("{", "}", descriptor_); - - // Field.Builder setField(Field.Builder builderForValue) - WriteFieldDocComment(printer, descriptor_); - printer->Print(variables_, - "$deprecation$public Builder ${$set$capitalized_name$$}$(\n" - " $type$.Builder builderForValue) {\n" - " copyOnWrite();\n" - " instance.set$capitalized_name$(builderForValue.build());\n" - " return this;\n" - "}\n"); - printer->Annotate("{", "}", descriptor_); - - // Field.Builder mergeField(Field value) - WriteFieldDocComment(printer, descriptor_); - printer->Print(variables_, - "$deprecation$public Builder " - "${$merge$capitalized_name$$}$($type$ value) {\n" - " copyOnWrite();\n" - " instance.merge$capitalized_name$(value);\n" - " return this;\n" - "}\n"); - printer->Annotate("{", "}", descriptor_); - - // Field.Builder clearField() - WriteFieldDocComment(printer, descriptor_); - printer->Print(variables_, - "$deprecation$public Builder ${$clear$capitalized_name$$}$() {" - " copyOnWrite();\n" - " instance.clear$capitalized_name$();\n" - " return this;\n" - "}\n"); - printer->Annotate("{", "}", descriptor_); -} - -void ImmutableMessageFieldLiteGenerator::GenerateKotlinDslMembers( - io::Printer* printer) const { - WriteFieldDocComment(printer, descriptor_); - printer->Print(variables_, - "$kt_deprecation$public var $kt_name$: $kt_type$\n" - " @JvmName(\"${$get$kt_capitalized_name$$}$\")\n" - " get() = $kt_dsl_builder$.${$get$capitalized_name$$}$()\n" - " @JvmName(\"${$set$kt_capitalized_name$$}$\")\n" - " set(value) {\n" - " $kt_dsl_builder$.${$set$capitalized_name$$}$(value)\n" - " }\n"); - - WriteFieldAccessorDocComment(printer, descriptor_, CLEARER, - /* builder */ false); - printer->Print(variables_, - "public fun ${$clear$kt_capitalized_name$$}$() {\n" - " $kt_dsl_builder$.${$clear$capitalized_name$$}$()\n" - "}\n"); - - WriteFieldAccessorDocComment(printer, descriptor_, HAZZER); - printer->Print( - variables_, - "public fun ${$has$kt_capitalized_name$$}$(): kotlin.Boolean {\n" - " return $kt_dsl_builder$.${$has$capitalized_name$$}$()\n" - "}\n"); -} - -void ImmutableMessageFieldLiteGenerator::GenerateFieldInfo( - io::Printer* printer, std::vector* output) const { - WriteIntToUtf16CharSequence(descriptor_->number(), output); - WriteIntToUtf16CharSequence(GetExperimentalJavaFieldType(descriptor_), - output); - if (HasHasbit(descriptor_)) { - WriteIntToUtf16CharSequence(messageBitIndex_, output); - } - printer->Print(variables_, "\"$name$_\",\n"); -} - -void ImmutableMessageFieldLiteGenerator::GenerateInitializationCode( - io::Printer* printer) const {} - -std::string ImmutableMessageFieldLiteGenerator::GetBoxedType() const { - return name_resolver_->GetImmutableClassName(descriptor_->message_type()); -} - -// =================================================================== - -ImmutableMessageOneofFieldLiteGenerator:: - ImmutableMessageOneofFieldLiteGenerator(const FieldDescriptor* descriptor, - int messageBitIndex, - Context* context) - : ImmutableMessageFieldLiteGenerator(descriptor, messageBitIndex, context) { - const OneofGeneratorInfo* info = - context->GetOneofGeneratorInfo(descriptor->containing_oneof()); - SetCommonOneofVariables(descriptor, info, &variables_); -} - -ImmutableMessageOneofFieldLiteGenerator:: - ~ImmutableMessageOneofFieldLiteGenerator() {} - -void ImmutableMessageOneofFieldLiteGenerator::GenerateMembers( - io::Printer* printer) const { - PrintExtraFieldInfo(variables_, printer); - WriteFieldDocComment(printer, descriptor_); - printer->Print(variables_, - "@java.lang.Override\n" - "$deprecation$public boolean ${$has$capitalized_name$$}$() {\n" - " return $has_oneof_case_message$;\n" - "}\n"); - printer->Annotate("{", "}", descriptor_); - WriteFieldDocComment(printer, descriptor_); - printer->Print(variables_, - "@java.lang.Override\n" - "$deprecation$public $type$ ${$get$capitalized_name$$}$() {\n" - " if ($has_oneof_case_message$) {\n" - " return ($type$) $oneof_name$_;\n" - " }\n" - " return $type$.getDefaultInstance();\n" - "}\n"); - printer->Annotate("{", "}", descriptor_); - - // Field.Builder setField(Field value) - WriteFieldDocComment(printer, descriptor_); - printer->Print(variables_, - "private void set$capitalized_name$($type$ value) {\n" - " $null_check$" - " $oneof_name$_ = value;\n" - " $set_oneof_case_message$;\n" - "}\n"); - - // Field.Builder mergeField(Field value) - WriteFieldDocComment(printer, descriptor_); - printer->Print( - variables_, - "private void merge$capitalized_name$($type$ value) {\n" - " $null_check$" - " if ($has_oneof_case_message$ &&\n" - " $oneof_name$_ != $type$.getDefaultInstance()) {\n" - " $oneof_name$_ = $type$.newBuilder(($type$) $oneof_name$_)\n" - " .mergeFrom(value).buildPartial();\n" - " } else {\n" - " $oneof_name$_ = value;\n" - " }\n" - " $set_oneof_case_message$;\n" - "}\n"); - - // Field.Builder clearField() - WriteFieldDocComment(printer, descriptor_); - printer->Print(variables_, - "private void clear$capitalized_name$() {\n" - " if ($has_oneof_case_message$) {\n" - " $clear_oneof_case_message$;\n" - " $oneof_name$_ = null;\n" - " }\n" - "}\n"); -} - -void ImmutableMessageOneofFieldLiteGenerator::GenerateFieldInfo( - io::Printer* printer, std::vector* output) const { - WriteIntToUtf16CharSequence(descriptor_->number(), output); - WriteIntToUtf16CharSequence(GetExperimentalJavaFieldType(descriptor_), - output); - WriteIntToUtf16CharSequence(descriptor_->containing_oneof()->index(), output); - printer->Print(variables_, "$oneof_stored_type$.class,\n"); -} - -void ImmutableMessageOneofFieldLiteGenerator::GenerateBuilderMembers( - io::Printer* printer) const { - // The comments above the methods below are based on a hypothetical - // field of type "Field" called "Field". - - // boolean hasField() - WriteFieldDocComment(printer, descriptor_); - printer->Print(variables_, - "@java.lang.Override\n" - "$deprecation$public boolean ${$has$capitalized_name$$}$() {\n" - " return instance.has$capitalized_name$();\n" - "}\n"); - printer->Annotate("{", "}", descriptor_); - - // Field getField() - WriteFieldDocComment(printer, descriptor_); - printer->Print(variables_, - "@java.lang.Override\n" - "$deprecation$public $type$ ${$get$capitalized_name$$}$() {\n" - " return instance.get$capitalized_name$();\n" - "}\n"); - printer->Annotate("{", "}", descriptor_); - - // Field.Builder setField(Field value) - WriteFieldDocComment(printer, descriptor_); - printer->Print(variables_, - "$deprecation$public Builder " - "${$set$capitalized_name$$}$($type$ value) {\n" - " copyOnWrite();\n" - " instance.set$capitalized_name$(value);\n" - " return this;\n" - "}\n"); - printer->Annotate("{", "}", descriptor_); - - // Field.Builder setField(Field.Builder builderForValue) - WriteFieldDocComment(printer, descriptor_); - printer->Print(variables_, - "$deprecation$public Builder ${$set$capitalized_name$$}$(\n" - " $type$.Builder builderForValue) {\n" - " copyOnWrite();\n" - " instance.set$capitalized_name$(builderForValue.build());\n" - " return this;\n" - "}\n"); - printer->Annotate("{", "}", descriptor_); - - // Field.Builder mergeField(Field value) - WriteFieldDocComment(printer, descriptor_); - printer->Print(variables_, - "$deprecation$public Builder " - "${$merge$capitalized_name$$}$($type$ value) {\n" - " copyOnWrite();\n" - " instance.merge$capitalized_name$(value);\n" - " return this;\n" - "}\n"); - printer->Annotate("{", "}", descriptor_); - - // Field.Builder clearField() - WriteFieldDocComment(printer, descriptor_); - printer->Print( - variables_, - "$deprecation$public Builder ${$clear$capitalized_name$$}$() {\n" - " copyOnWrite();\n" - " instance.clear$capitalized_name$();\n" - " return this;\n" - "}\n"); - printer->Annotate("{", "}", descriptor_); -} - -// =================================================================== - -RepeatedImmutableMessageFieldLiteGenerator:: - RepeatedImmutableMessageFieldLiteGenerator( - const FieldDescriptor* descriptor, int messageBitIndex, - Context* context) - : descriptor_(descriptor), name_resolver_(context->GetNameResolver()) { - SetMessageVariables(descriptor, messageBitIndex, 0, - context->GetFieldGeneratorInfo(descriptor), - name_resolver_, &variables_); -} - -RepeatedImmutableMessageFieldLiteGenerator:: - ~RepeatedImmutableMessageFieldLiteGenerator() {} - -int RepeatedImmutableMessageFieldLiteGenerator::GetNumBitsForMessage() const { - return 0; -} - -void RepeatedImmutableMessageFieldLiteGenerator::GenerateInterfaceMembers( - io::Printer* printer) const { - // TODO(jonp): In the future, consider having methods specific to the - // interface so that builders can choose dynamically to either return a - // message or a nested builder, so that asking for the interface doesn't - // cause a message to ever be built. - WriteFieldDocComment(printer, descriptor_); - printer->Print(variables_, - "$deprecation$java.util.List<$type$> \n" - " get$capitalized_name$List();\n"); - WriteFieldDocComment(printer, descriptor_); - printer->Print(variables_, - "$deprecation$$type$ get$capitalized_name$(int index);\n"); - WriteFieldDocComment(printer, descriptor_); - printer->Print(variables_, - "$deprecation$int get$capitalized_name$Count();\n"); -} - -void RepeatedImmutableMessageFieldLiteGenerator::GenerateMembers( - io::Printer* printer) const { - printer->Print( - variables_, - "private com.google.protobuf.Internal.ProtobufList<$type$> $name$_;\n"); - PrintExtraFieldInfo(variables_, printer); - WriteFieldDocComment(printer, descriptor_); - printer->Print(variables_, - "@java.lang.Override\n" - "$deprecation$public java.util.List<$type$> " - "${$get$capitalized_name$List$}$() {\n" - " return $name$_;\n" // note: unmodifiable list - "}\n"); - printer->Annotate("{", "}", descriptor_); - WriteFieldDocComment(printer, descriptor_); - printer->Print( - variables_, - "$deprecation$public java.util.List \n" - " ${$get$capitalized_name$OrBuilderList$}$() {\n" - " return $name$_;\n" - "}\n"); - printer->Annotate("{", "}", descriptor_); - WriteFieldDocComment(printer, descriptor_); - printer->Print( - variables_, - "@java.lang.Override\n" - "$deprecation$public int ${$get$capitalized_name$Count$}$() {\n" - " return $name$_.size();\n" - "}\n"); - printer->Annotate("{", "}", descriptor_); - WriteFieldDocComment(printer, descriptor_); - printer->Print( - variables_, - "@java.lang.Override\n" - "$deprecation$public $type$ ${$get$capitalized_name$$}$(int index) {\n" - " return $name$_.get(index);\n" - "}\n"); - printer->Annotate("{", "}", descriptor_); - WriteFieldDocComment(printer, descriptor_); - printer->Print(variables_, - "$deprecation$public $type$OrBuilder " - "${$get$capitalized_name$OrBuilder$}$(\n" - " int index) {\n" - " return $name$_.get(index);\n" - "}\n"); - printer->Annotate("{", "}", descriptor_); - - printer->Print( - variables_, - "private void ensure$capitalized_name$IsMutable() {\n" - // Use a temporary to avoid a redundant iget-object. - " com.google.protobuf.Internal.ProtobufList<$type$> tmp = $name$_;\n" - " if (!tmp.isModifiable()) {\n" - " $name$_ =\n" - " com.google.protobuf.GeneratedMessageLite.mutableCopy(tmp);\n" - " }\n" - "}\n" - "\n"); - - // Builder setRepeatedField(int index, Field value) - WriteFieldDocComment(printer, descriptor_); - printer->Print(variables_, - "private void set$capitalized_name$(\n" - " int index, $type$ value) {\n" - " $null_check$" - " ensure$capitalized_name$IsMutable();\n" - " $name$_.set(index, value);\n" - "}\n"); - - // Builder addRepeatedField(Field value) - WriteFieldDocComment(printer, descriptor_); - printer->Print(variables_, - "private void add$capitalized_name$($type$ value) {\n" - " $null_check$" - " ensure$capitalized_name$IsMutable();\n" - " $name$_.add(value);\n" - "}\n"); - - // Builder addRepeatedField(int index, Field value) - WriteFieldDocComment(printer, descriptor_); - printer->Print(variables_, - "private void add$capitalized_name$(\n" - " int index, $type$ value) {\n" - " $null_check$" - " ensure$capitalized_name$IsMutable();\n" - " $name$_.add(index, value);\n" - "}\n"); - - // Builder addAllRepeatedField(Iterable values) - WriteFieldDocComment(printer, descriptor_); - printer->Print(variables_, - "private void addAll$capitalized_name$(\n" - " java.lang.Iterable values) {\n" - " ensure$capitalized_name$IsMutable();\n" - " com.google.protobuf.AbstractMessageLite.addAll(\n" - " values, $name$_);\n" - "}\n"); - - // Builder clearAllRepeatedField() - WriteFieldDocComment(printer, descriptor_); - printer->Print(variables_, - "private void clear$capitalized_name$() {\n" - " $name$_ = emptyProtobufList();\n" - "}\n"); - - // Builder removeRepeatedField(int index) - WriteFieldDocComment(printer, descriptor_); - printer->Print(variables_, - "private void remove$capitalized_name$(int index) {\n" - " ensure$capitalized_name$IsMutable();\n" - " $name$_.remove(index);\n" - "}\n"); -} - -void RepeatedImmutableMessageFieldLiteGenerator::GenerateBuilderMembers( - io::Printer* printer) const { - // The comments above the methods below are based on a hypothetical - // repeated field of type "Field" called "RepeatedField". - - // List getRepeatedFieldList() - WriteFieldDocComment(printer, descriptor_); - printer->Print(variables_, - "@java.lang.Override\n" - "$deprecation$public java.util.List<$type$> " - "${$get$capitalized_name$List$}$() {\n" - " return java.util.Collections.unmodifiableList(\n" - " instance.get$capitalized_name$List());\n" - "}\n"); - printer->Annotate("{", "}", descriptor_); - - // int getRepeatedFieldCount() - WriteFieldDocComment(printer, descriptor_); - printer->Print( - variables_, - "@java.lang.Override\n" - "$deprecation$public int ${$get$capitalized_name$Count$}$() {\n" - " return instance.get$capitalized_name$Count();\n" - "}"); - printer->Annotate("{", "}", descriptor_); - - // Field getRepeatedField(int index) - WriteFieldDocComment(printer, descriptor_); - printer->Print( - variables_, - "@java.lang.Override\n" - "$deprecation$public $type$ ${$get$capitalized_name$$}$(int index) {\n" - " return instance.get$capitalized_name$(index);\n" - "}\n"); - printer->Annotate("{", "}", descriptor_); - - // Builder setRepeatedField(int index, Field value) - WriteFieldDocComment(printer, descriptor_); - printer->Print(variables_, - "$deprecation$public Builder ${$set$capitalized_name$$}$(\n" - " int index, $type$ value) {\n" - " copyOnWrite();\n" - " instance.set$capitalized_name$(index, value);\n" - " return this;\n" - "}\n"); - printer->Annotate("{", "}", descriptor_); - - // Builder setRepeatedField(int index, Field.Builder builderForValue) - WriteFieldDocComment(printer, descriptor_); - printer->Print(variables_, - "$deprecation$public Builder ${$set$capitalized_name$$}$(\n" - " int index, $type$.Builder builderForValue) {\n" - " copyOnWrite();\n" - " instance.set$capitalized_name$(index,\n" - " builderForValue.build());\n" - " return this;\n" - "}\n"); - printer->Annotate("{", "}", descriptor_); - - // Builder addRepeatedField(Field value) - WriteFieldDocComment(printer, descriptor_); - printer->Print(variables_, - "$deprecation$public Builder " - "${$add$capitalized_name$$}$($type$ value) {\n" - " copyOnWrite();\n" - " instance.add$capitalized_name$(value);\n" - " return this;\n" - "}\n"); - printer->Annotate("{", "}", descriptor_); - - // Builder addRepeatedField(int index, Field value) - WriteFieldDocComment(printer, descriptor_); - printer->Print(variables_, - "$deprecation$public Builder ${$add$capitalized_name$$}$(\n" - " int index, $type$ value) {\n" - " copyOnWrite();\n" - " instance.add$capitalized_name$(index, value);\n" - " return this;\n" - "}\n"); - printer->Annotate("{", "}", descriptor_); - // Builder addRepeatedField(Field.Builder builderForValue) - WriteFieldDocComment(printer, descriptor_); - printer->Print(variables_, - "$deprecation$public Builder ${$add$capitalized_name$$}$(\n" - " $type$.Builder builderForValue) {\n" - " copyOnWrite();\n" - " instance.add$capitalized_name$(builderForValue.build());\n" - " return this;\n" - "}\n"); - printer->Annotate("{", "}", descriptor_); - - // Builder addRepeatedField(int index, Field.Builder builderForValue) - WriteFieldDocComment(printer, descriptor_); - printer->Print(variables_, - "$deprecation$public Builder ${$add$capitalized_name$$}$(\n" - " int index, $type$.Builder builderForValue) {\n" - " copyOnWrite();\n" - " instance.add$capitalized_name$(index,\n" - " builderForValue.build());\n" - " return this;\n" - "}\n"); - printer->Annotate("{", "}", descriptor_); - - // Builder addAllRepeatedField(Iterable values) - WriteFieldDocComment(printer, descriptor_); - printer->Print(variables_, - "$deprecation$public Builder ${$addAll$capitalized_name$$}$(\n" - " java.lang.Iterable values) {\n" - " copyOnWrite();\n" - " instance.addAll$capitalized_name$(values);\n" - " return this;\n" - "}\n"); - printer->Annotate("{", "}", descriptor_); - - // Builder clearAllRepeatedField() - WriteFieldDocComment(printer, descriptor_); - printer->Print( - variables_, - "$deprecation$public Builder ${$clear$capitalized_name$$}$() {\n" - " copyOnWrite();\n" - " instance.clear$capitalized_name$();\n" - " return this;\n" - "}\n"); - printer->Annotate("{", "}", descriptor_); - - // Builder removeRepeatedField(int index) - WriteFieldDocComment(printer, descriptor_); - printer->Print(variables_, - "$deprecation$public Builder " - "${$remove$capitalized_name$$}$(int index) {\n" - " copyOnWrite();\n" - " instance.remove$capitalized_name$(index);\n" - " return this;\n" - "}\n"); - printer->Annotate("{", "}", descriptor_); -} - -void RepeatedImmutableMessageFieldLiteGenerator::GenerateFieldInfo( - io::Printer* printer, std::vector* output) const { - WriteIntToUtf16CharSequence(descriptor_->number(), output); - WriteIntToUtf16CharSequence(GetExperimentalJavaFieldType(descriptor_), - output); - printer->Print(variables_, - "\"$name$_\",\n" - "$type$.class,\n"); -} - -void RepeatedImmutableMessageFieldLiteGenerator::GenerateInitializationCode( - io::Printer* printer) const { - printer->Print(variables_, "$name$_ = emptyProtobufList();\n"); -} - -std::string RepeatedImmutableMessageFieldLiteGenerator::GetBoxedType() const { - return name_resolver_->GetImmutableClassName(descriptor_->message_type()); -} - -void RepeatedImmutableMessageFieldLiteGenerator::GenerateKotlinDslMembers( - io::Printer* printer) const { - printer->Print( - variables_, - "/**\n" - " * An uninstantiable, behaviorless type to represent the field in\n" - " * generics.\n" - " */\n" - "@kotlin.OptIn" - "(com.google.protobuf.kotlin.OnlyForUseByGeneratedProtoCode::class)\n" - "public class ${$$kt_capitalized_name$Proxy$}$ private constructor()" - " : com.google.protobuf.kotlin.DslProxy()\n"); - - WriteFieldDocComment(printer, descriptor_); - printer->Print(variables_, - "$kt_deprecation$ public val $kt_name$: " - "com.google.protobuf.kotlin.DslList" - "<$kt_type$, ${$$kt_capitalized_name$Proxy$}$>\n" - " @kotlin.jvm.JvmSynthetic\n" - " get() = com.google.protobuf.kotlin.DslList(\n" - " $kt_dsl_builder$.${$get$capitalized_name$List$}$()\n" - " )\n"); - - WriteFieldAccessorDocComment(printer, descriptor_, LIST_ADDER, - /* builder */ false); - printer->Print(variables_, - "@kotlin.jvm.JvmSynthetic\n" - "@kotlin.jvm.JvmName(\"add$kt_capitalized_name$\")\n" - "public fun com.google.protobuf.kotlin.DslList" - "<$kt_type$, ${$$kt_capitalized_name$Proxy$}$>." - "add(value: $kt_type$) {\n" - " $kt_dsl_builder$.${$add$capitalized_name$$}$(value)\n" - "}"); - - WriteFieldAccessorDocComment(printer, descriptor_, LIST_ADDER, - /* builder */ false); - printer->Print(variables_, - "@kotlin.jvm.JvmSynthetic\n" - "@kotlin.jvm.JvmName(\"plusAssign$kt_capitalized_name$\")\n" - "@Suppress(\"NOTHING_TO_INLINE\")\n" - "public inline operator fun com.google.protobuf.kotlin.DslList" - "<$kt_type$, ${$$kt_capitalized_name$Proxy$}$>." - "plusAssign(value: $kt_type$) {\n" - " add(value)\n" - "}"); - - WriteFieldAccessorDocComment(printer, descriptor_, LIST_MULTI_ADDER, - /* builder */ false); - printer->Print(variables_, - "@kotlin.jvm.JvmSynthetic\n" - "@kotlin.jvm.JvmName(\"addAll$kt_capitalized_name$\")\n" - "public fun com.google.protobuf.kotlin.DslList" - "<$kt_type$, ${$$kt_capitalized_name$Proxy$}$>." - "addAll(values: kotlin.collections.Iterable<$kt_type$>) {\n" - " $kt_dsl_builder$.${$addAll$capitalized_name$$}$(values)\n" - "}"); - - WriteFieldAccessorDocComment(printer, descriptor_, LIST_MULTI_ADDER, - /* builder */ false); - printer->Print( - variables_, - "@kotlin.jvm.JvmSynthetic\n" - "@kotlin.jvm.JvmName(\"plusAssignAll$kt_capitalized_name$\")\n" - "@Suppress(\"NOTHING_TO_INLINE\")\n" - "public inline operator fun com.google.protobuf.kotlin.DslList" - "<$kt_type$, ${$$kt_capitalized_name$Proxy$}$>." - "plusAssign(values: kotlin.collections.Iterable<$kt_type$>) {\n" - " addAll(values)\n" - "}"); - - WriteFieldAccessorDocComment(printer, descriptor_, LIST_INDEXED_SETTER, - /* builder */ false); - printer->Print( - variables_, - "@kotlin.jvm.JvmSynthetic\n" - "@kotlin.jvm.JvmName(\"set$kt_capitalized_name$\")\n" - "public operator fun com.google.protobuf.kotlin.DslList" - "<$kt_type$, ${$$kt_capitalized_name$Proxy$}$>." - "set(index: kotlin.Int, value: $kt_type$) {\n" - " $kt_dsl_builder$.${$set$capitalized_name$$}$(index, value)\n" - "}"); - - WriteFieldAccessorDocComment(printer, descriptor_, CLEARER, - /* builder */ false); - printer->Print(variables_, - "@kotlin.jvm.JvmSynthetic\n" - "@kotlin.jvm.JvmName(\"clear$kt_capitalized_name$\")\n" - "public fun com.google.protobuf.kotlin.DslList" - "<$kt_type$, ${$$kt_capitalized_name$Proxy$}$>." - "clear() {\n" - " $kt_dsl_builder$.${$clear$capitalized_name$$}$()\n" - "}"); -} - -} // namespace java -} // namespace compiler -} // namespace protobuf -} // namespace google diff --git a/extra/protobuf/protobuf-3.19.4/src/google/protobuf/compiler/java/java_message_field_lite.h b/extra/protobuf/protobuf-3.19.4/src/google/protobuf/compiler/java/java_message_field_lite.h deleted file mode 100644 index 8f81f60dfe18..000000000000 --- a/extra/protobuf/protobuf-3.19.4/src/google/protobuf/compiler/java/java_message_field_lite.h +++ /dev/null @@ -1,140 +0,0 @@ -// Protocol Buffers - Google's data interchange format -// Copyright 2008 Google Inc. All rights reserved. -// https://developers.google.com/protocol-buffers/ -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// * Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// * Redistributions in binary form must reproduce the above -// copyright notice, this list of conditions and the following disclaimer -// in the documentation and/or other materials provided with the -// distribution. -// * Neither the name of Google Inc. nor the names of its -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -// Author: kenton@google.com (Kenton Varda) -// Based on original Protocol Buffers design by -// Sanjay Ghemawat, Jeff Dean, and others. - -#ifndef GOOGLE_PROTOBUF_COMPILER_JAVA_MESSAGE_FIELD_LITE_H__ -#define GOOGLE_PROTOBUF_COMPILER_JAVA_MESSAGE_FIELD_LITE_H__ - -#include -#include -#include - -#include - -namespace google { -namespace protobuf { -namespace compiler { -namespace java { -class Context; // context.h -class ClassNameResolver; // name_resolver.h -} // namespace java -} // namespace compiler -} // namespace protobuf -} // namespace google - -namespace google { -namespace protobuf { -namespace compiler { -namespace java { - -class ImmutableMessageFieldLiteGenerator : public ImmutableFieldLiteGenerator { - public: - explicit ImmutableMessageFieldLiteGenerator(const FieldDescriptor* descriptor, - int messageBitIndex, - Context* context); - ~ImmutableMessageFieldLiteGenerator(); - - // implements ImmutableFieldLiteGenerator - // ------------------------------------ - int GetNumBitsForMessage() const override; - void GenerateInterfaceMembers(io::Printer* printer) const override; - void GenerateMembers(io::Printer* printer) const override; - void GenerateBuilderMembers(io::Printer* printer) const override; - void GenerateInitializationCode(io::Printer* printer) const override; - void GenerateFieldInfo(io::Printer* printer, - std::vector* output) const override; - void GenerateKotlinDslMembers(io::Printer* printer) const override; - - std::string GetBoxedType() const override; - - protected: - const FieldDescriptor* descriptor_; - std::map variables_; - const int messageBitIndex_; - ClassNameResolver* name_resolver_; - - private: - GOOGLE_DISALLOW_EVIL_CONSTRUCTORS(ImmutableMessageFieldLiteGenerator); -}; - -class ImmutableMessageOneofFieldLiteGenerator - : public ImmutableMessageFieldLiteGenerator { - public: - ImmutableMessageOneofFieldLiteGenerator(const FieldDescriptor* descriptor, - int messageBitIndex, - Context* context); - ~ImmutableMessageOneofFieldLiteGenerator(); - - void GenerateMembers(io::Printer* printer) const override; - void GenerateBuilderMembers(io::Printer* printer) const override; - void GenerateFieldInfo(io::Printer* printer, - std::vector* output) const override; - - private: - GOOGLE_DISALLOW_EVIL_CONSTRUCTORS(ImmutableMessageOneofFieldLiteGenerator); -}; - -class RepeatedImmutableMessageFieldLiteGenerator - : public ImmutableFieldLiteGenerator { - public: - explicit RepeatedImmutableMessageFieldLiteGenerator( - const FieldDescriptor* descriptor, int messageBitIndex, Context* context); - ~RepeatedImmutableMessageFieldLiteGenerator() override; - - // implements ImmutableFieldLiteGenerator ------------------------------------ - int GetNumBitsForMessage() const override; - void GenerateInterfaceMembers(io::Printer* printer) const override; - void GenerateMembers(io::Printer* printer) const override; - void GenerateBuilderMembers(io::Printer* printer) const override; - void GenerateInitializationCode(io::Printer* printer) const override; - void GenerateFieldInfo(io::Printer* printer, - std::vector* output) const override; - void GenerateKotlinDslMembers(io::Printer* printer) const override; - - std::string GetBoxedType() const override; - - protected: - const FieldDescriptor* descriptor_; - std::map variables_; - ClassNameResolver* name_resolver_; - - private: - GOOGLE_DISALLOW_EVIL_CONSTRUCTORS(RepeatedImmutableMessageFieldLiteGenerator); -}; - -} // namespace java -} // namespace compiler -} // namespace protobuf -} // namespace google - -#endif // GOOGLE_PROTOBUF_COMPILER_JAVA_MESSAGE_FIELD_LITE_H__ diff --git a/extra/protobuf/protobuf-3.19.4/src/google/protobuf/compiler/java/java_message_lite.cc b/extra/protobuf/protobuf-3.19.4/src/google/protobuf/compiler/java/java_message_lite.cc deleted file mode 100644 index c2c278890204..000000000000 --- a/extra/protobuf/protobuf-3.19.4/src/google/protobuf/compiler/java/java_message_lite.cc +++ /dev/null @@ -1,977 +0,0 @@ -// Protocol Buffers - Google's data interchange format -// Copyright 2008 Google Inc. All rights reserved. -// https://developers.google.com/protocol-buffers/ -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// * Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// * Redistributions in binary form must reproduce the above -// copyright notice, this list of conditions and the following disclaimer -// in the documentation and/or other materials provided with the -// distribution. -// * Neither the name of Google Inc. nor the names of its -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -// Author: dweis@google.com (Daniel Weis) -// Based on original Protocol Buffers design by -// Sanjay Ghemawat, Jeff Dean, and others. - -#include - -#include -#include -#include -#include -#include - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -namespace google { -namespace protobuf { -namespace compiler { -namespace java { - -using internal::WireFormat; -using internal::WireFormatLite; - -// =================================================================== -ImmutableMessageLiteGenerator::ImmutableMessageLiteGenerator( - const Descriptor* descriptor, Context* context) - : MessageGenerator(descriptor), - context_(context), - name_resolver_(context->GetNameResolver()), - field_generators_(descriptor, context_) { - GOOGLE_CHECK(!HasDescriptorMethods(descriptor->file(), context->EnforceLite())) - << "Generator factory error: A lite message generator is used to " - "generate non-lite messages."; - for (int i = 0; i < descriptor_->field_count(); i++) { - if (IsRealOneof(descriptor_->field(i))) { - oneofs_.insert(descriptor_->field(i)->containing_oneof()); - } - } -} - -ImmutableMessageLiteGenerator::~ImmutableMessageLiteGenerator() {} - -void ImmutableMessageLiteGenerator::GenerateStaticVariables( - io::Printer* printer, int* bytecode_estimate) { - // Generate static members for all nested types. - for (int i = 0; i < descriptor_->nested_type_count(); i++) { - // TODO(kenton): Reuse MessageGenerator objects? - ImmutableMessageLiteGenerator(descriptor_->nested_type(i), context_) - .GenerateStaticVariables(printer, bytecode_estimate); - } -} - -int ImmutableMessageLiteGenerator::GenerateStaticVariableInitializers( - io::Printer* printer) { - int bytecode_estimate = 0; - // Generate static member initializers for all nested types. - for (int i = 0; i < descriptor_->nested_type_count(); i++) { - // TODO(kenton): Reuse MessageGenerator objects? - bytecode_estimate += - ImmutableMessageLiteGenerator(descriptor_->nested_type(i), context_) - .GenerateStaticVariableInitializers(printer); - } - return bytecode_estimate; -} - -// =================================================================== - -void ImmutableMessageLiteGenerator::GenerateInterface(io::Printer* printer) { - MaybePrintGeneratedAnnotation(context_, printer, descriptor_, - /* immutable = */ true, "OrBuilder"); - if (descriptor_->extension_range_count() > 0) { - printer->Print( - "$deprecation$public interface ${$$classname$OrBuilder$}$ extends \n" - " $extra_interfaces$\n" - " com.google.protobuf.GeneratedMessageLite.\n" - " ExtendableMessageOrBuilder<\n" - " $classname$, $classname$.Builder> {\n", - "deprecation", - descriptor_->options().deprecated() ? "@java.lang.Deprecated " : "", - "extra_interfaces", ExtraMessageOrBuilderInterfaces(descriptor_), - "classname", descriptor_->name(), "{", "", "}", ""); - } else { - printer->Print( - "$deprecation$public interface ${$$classname$OrBuilder$}$ extends\n" - " $extra_interfaces$\n" - " com.google.protobuf.MessageLiteOrBuilder {\n", - "deprecation", - descriptor_->options().deprecated() ? "@java.lang.Deprecated " : "", - "extra_interfaces", ExtraMessageOrBuilderInterfaces(descriptor_), - "classname", descriptor_->name(), "{", "", "}", ""); - } - printer->Annotate("{", "}", descriptor_); - - printer->Indent(); - for (int i = 0; i < descriptor_->field_count(); i++) { - printer->Print("\n"); - field_generators_.get(descriptor_->field(i)) - .GenerateInterfaceMembers(printer); - } - for (auto oneof : oneofs_) { - printer->Print( - "\n" - "public $classname$.$oneof_capitalized_name$Case " - "get$oneof_capitalized_name$Case();\n", - "oneof_capitalized_name", - context_->GetOneofGeneratorInfo(oneof)->capitalized_name, "classname", - context_->GetNameResolver()->GetImmutableClassName(descriptor_)); - } - printer->Outdent(); - - printer->Print("}\n"); -} - -// =================================================================== - -void ImmutableMessageLiteGenerator::Generate(io::Printer* printer) { - bool is_own_file = IsOwnFile(descriptor_, /* immutable = */ true); - - std::map variables; - variables["static"] = is_own_file ? " " : " static "; - variables["classname"] = descriptor_->name(); - variables["extra_interfaces"] = ExtraMessageInterfaces(descriptor_); - variables["deprecation"] = - descriptor_->options().deprecated() ? "@java.lang.Deprecated " : ""; - - 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) { - printer->Print( - variables, - "$deprecation$public $static$final class $classname$ extends\n" - " com.google.protobuf.GeneratedMessageLite.ExtendableMessage<\n" - " $classname$, $classname$.Builder> implements\n" - " $extra_interfaces$\n" - " $classname$OrBuilder {\n"); - builder_type = strings::Substitute( - "com.google.protobuf.GeneratedMessageLite.ExtendableBuilder<$0, ?>", - name_resolver_->GetImmutableClassName(descriptor_)); - } else { - printer->Print( - variables, - "$deprecation$public $static$final class $classname$ extends\n" - " com.google.protobuf.GeneratedMessageLite<\n" - " $classname$, $classname$.Builder> implements\n" - " $extra_interfaces$\n" - " $classname$OrBuilder {\n"); - - builder_type = "com.google.protobuf.GeneratedMessageLite.Builder"; - } - printer->Indent(); - - GenerateConstructor(printer); - - // Nested types - for (int i = 0; i < descriptor_->enum_type_count(); i++) { - EnumLiteGenerator(descriptor_->enum_type(i), true, context_) - .Generate(printer); - } - - for (int i = 0; i < descriptor_->nested_type_count(); i++) { - // Don't generate Java classes for map entry messages. - if (IsMapEntry(descriptor_->nested_type(i))) continue; - ImmutableMessageLiteGenerator messageGenerator(descriptor_->nested_type(i), - context_); - messageGenerator.GenerateInterface(printer); - messageGenerator.Generate(printer); - } - - // Integers for bit fields. - int totalBits = 0; - for (int i = 0; i < descriptor_->field_count(); i++) { - totalBits += - field_generators_.get(descriptor_->field(i)).GetNumBitsForMessage(); - } - int totalInts = (totalBits + 31) / 32; - for (int i = 0; i < totalInts; i++) { - printer->Print("private int $bit_field_name$;\n", "bit_field_name", - GetBitFieldName(i)); - } - - // oneof - std::map vars; - for (auto oneof : oneofs_) { - vars["oneof_name"] = context_->GetOneofGeneratorInfo(oneof)->name; - vars["oneof_capitalized_name"] = - context_->GetOneofGeneratorInfo(oneof)->capitalized_name; - vars["oneof_index"] = StrCat((oneof)->index()); - // oneofCase_ and oneof_ - printer->Print(vars, - "private int $oneof_name$Case_ = 0;\n" - "private java.lang.Object $oneof_name$_;\n"); - // OneofCase enum - printer->Print(vars, "public enum $oneof_capitalized_name$Case {\n"); - printer->Indent(); - for (int j = 0; j < (oneof)->field_count(); j++) { - const FieldDescriptor* field = (oneof)->field(j); - printer->Print("$field_name$($field_number$),\n", "field_name", - ToUpper(field->name()), "field_number", - StrCat(field->number())); - } - printer->Print("$cap_oneof_name$_NOT_SET(0);\n", "cap_oneof_name", - ToUpper(vars["oneof_name"])); - printer->Print(vars, - "private final int value;\n" - "private $oneof_capitalized_name$Case(int value) {\n" - " this.value = value;\n" - "}\n"); - printer->Print( - vars, - "/**\n" - " * @deprecated Use {@link #forNumber(int)} instead.\n" - " */\n" - "@java.lang.Deprecated\n" - "public static $oneof_capitalized_name$Case valueOf(int value) {\n" - " return forNumber(value);\n" - "}\n" - "\n" - "public static $oneof_capitalized_name$Case forNumber(int value) {\n" - " switch (value) {\n"); - for (int j = 0; j < (oneof)->field_count(); j++) { - const FieldDescriptor* field = (oneof)->field(j); - printer->Print(" case $field_number$: return $field_name$;\n", - "field_number", StrCat(field->number()), - "field_name", ToUpper(field->name())); - } - printer->Print( - " case 0: return $cap_oneof_name$_NOT_SET;\n" - " default: return null;\n" - " }\n" - "}\n" - // TODO(b/135620659): Rename this to "getFieldNumber" or something to - // disambiguate it from actual proto enums. - "public int getNumber() {\n" - " return this.value;\n" - "}\n", - "cap_oneof_name", ToUpper(vars["oneof_name"])); - printer->Outdent(); - printer->Print("};\n\n"); - // oneofCase() - printer->Print(vars, - "@java.lang.Override\n" - "public $oneof_capitalized_name$Case\n" - "get$oneof_capitalized_name$Case() {\n" - " return $oneof_capitalized_name$Case.forNumber(\n" - " $oneof_name$Case_);\n" - "}\n" - "\n" - "private void clear$oneof_capitalized_name$() {\n" - " $oneof_name$Case_ = 0;\n" - " $oneof_name$_ = null;\n" - "}\n" - "\n"); - } - - // Fields - for (int i = 0; i < descriptor_->field_count(); i++) { - printer->Print("public static final int $constant_name$ = $number$;\n", - "constant_name", FieldConstantName(descriptor_->field(i)), - "number", StrCat(descriptor_->field(i)->number())); - field_generators_.get(descriptor_->field(i)).GenerateMembers(printer); - printer->Print("\n"); - } - - GenerateParseFromMethods(printer); - GenerateBuilder(printer); - - if (HasRequiredFields(descriptor_)) { - // Memoizes whether the protocol buffer is fully initialized (has all - // required fields). 0 means false, 1 means true, and all other values - // mean not yet computed. - printer->Print("private byte memoizedIsInitialized = 2;\n"); - } - - printer->Print( - "@java.lang.Override\n" - "@java.lang.SuppressWarnings({\"unchecked\", \"fallthrough\"})\n" - "protected final java.lang.Object dynamicMethod(\n" - " com.google.protobuf.GeneratedMessageLite.MethodToInvoke method,\n" - " java.lang.Object arg0, java.lang.Object arg1) {\n" - " switch (method) {\n" - " case NEW_MUTABLE_INSTANCE: {\n" - " return new $classname$();\n" - " }\n", - "classname", name_resolver_->GetImmutableClassName(descriptor_)); - - printer->Indent(); - printer->Indent(); - - printer->Print("case NEW_BUILDER: {\n"); - - printer->Indent(); - GenerateDynamicMethodNewBuilder(printer); - printer->Outdent(); - - printer->Print( - "}\n" - "case BUILD_MESSAGE_INFO: {\n"); - - printer->Indent(); - GenerateDynamicMethodNewBuildMessageInfo(printer); - printer->Outdent(); - - printer->Print( - "}\n" - "// fall through\n" - "case GET_DEFAULT_INSTANCE: {\n" - " return DEFAULT_INSTANCE;\n" - "}\n" - "case GET_PARSER: {\n" - // Generally one would use the lazy initialization holder pattern for - // manipulating static fields but that has exceptional cost on Android as - // it will generate an extra class for every message. Instead, use the - // double-check locking pattern which works just as well. - // - // The "parser" temporary mirrors the "PARSER" field to eliminate a read - // at the final return statement. - " com.google.protobuf.Parser<$classname$> parser = PARSER;\n" - " if (parser == null) {\n" - " synchronized ($classname$.class) {\n" - " parser = PARSER;\n" - " if (parser == null) {\n" - " parser =\n" - " new DefaultInstanceBasedParser<$classname$>(\n" - " DEFAULT_INSTANCE);\n" - " PARSER = parser;\n" - " }\n" - " }\n" - " }\n" - " return parser;\n", - "classname", name_resolver_->GetImmutableClassName(descriptor_)); - - printer->Outdent(); - - if (HasRequiredFields(descriptor_)) { - printer->Print( - "}\n" - "case GET_MEMOIZED_IS_INITIALIZED: {\n" - " return memoizedIsInitialized;\n" - "}\n" - "case SET_MEMOIZED_IS_INITIALIZED: {\n" - " memoizedIsInitialized = (byte) (arg0 == null ? 0 : 1);\n" - " return null;\n" - "}\n"); - } else { - printer->Print( - "}\n" - "case GET_MEMOIZED_IS_INITIALIZED: {\n" - " return (byte) 1;\n" - "}\n" - "case SET_MEMOIZED_IS_INITIALIZED: {\n" - " return null;\n" - "}\n"); - } - - printer->Outdent(); - printer->Print( - " }\n" - " throw new UnsupportedOperationException();\n" - "}\n" - "\n", - "classname", name_resolver_->GetImmutableClassName(descriptor_)); - - printer->Print( - "\n" - "// @@protoc_insertion_point(class_scope:$full_name$)\n", - "full_name", descriptor_->full_name()); - - // Carefully initialize the default instance in such a way that it doesn't - // conflict with other initialization. - printer->Print("private static final $classname$ DEFAULT_INSTANCE;\n", - "classname", - name_resolver_->GetImmutableClassName(descriptor_)); - - printer->Print( - "static {\n" - " $classname$ defaultInstance = new $classname$();\n" - " // New instances are implicitly immutable so no need to make\n" - " // immutable.\n" - " DEFAULT_INSTANCE = defaultInstance;\n" - // Register the default instance in a map. This map will be used by - // experimental runtime to lookup default instance given a class instance - // without using Java reflection. - " com.google.protobuf.GeneratedMessageLite.registerDefaultInstance(\n" - " $classname$.class, defaultInstance);\n" - "}\n" - "\n", - "classname", descriptor_->name()); - - printer->Print( - "public static $classname$ getDefaultInstance() {\n" - " return DEFAULT_INSTANCE;\n" - "}\n" - "\n", - "classname", name_resolver_->GetImmutableClassName(descriptor_)); - - // 'of' method for Wrappers - if (IsWrappersProtoFile(descriptor_->file())) { - printer->Print( - "public static $classname$ of($field_type$ value) {\n" - " return newBuilder().setValue(value).build();\n" - "}\n" - "\n", - "classname", name_resolver_->GetImmutableClassName(descriptor_), - "field_type", PrimitiveTypeName(GetJavaType(descriptor_->field(0)))); - } - - GenerateParser(printer); - - // Extensions must be declared after the DEFAULT_INSTANCE is initialized - // because the DEFAULT_INSTANCE is used by the extension to lazily retrieve - // the outer class's FileDescriptor. - for (int i = 0; i < descriptor_->extension_count(); i++) { - ImmutableExtensionLiteGenerator(descriptor_->extension(i), context_) - .Generate(printer); - } - - printer->Outdent(); - printer->Print("}\n\n"); -} - -void ImmutableMessageLiteGenerator::GenerateDynamicMethodNewBuildMessageInfo( - io::Printer* printer) { - printer->Indent(); - - // Collect field info into a sequence of UTF-16 chars. It will be embedded - // as a Java string in the generated code. - std::vector chars; - - int flags = 0; - if (IsProto2(descriptor_->file())) { - flags |= 0x1; - } - if (descriptor_->options().message_set_wire_format()) { - flags |= 0x2; - } - WriteIntToUtf16CharSequence(flags, &chars); - WriteIntToUtf16CharSequence(descriptor_->field_count(), &chars); - - if (descriptor_->field_count() == 0) { - printer->Print("java.lang.Object[] objects = null;"); - } else { - // A single array of all fields (including oneof, oneofCase, hasBits). - printer->Print("java.lang.Object[] objects = new java.lang.Object[] {\n"); - printer->Indent(); - - // Record the number of oneofs. - WriteIntToUtf16CharSequence(oneofs_.size(), &chars); - for (auto oneof : oneofs_) { - printer->Print( - "\"$oneof_name$_\",\n" - "\"$oneof_name$Case_\",\n", - "oneof_name", context_->GetOneofGeneratorInfo(oneof)->name); - } - - // Integers for bit fields. - int total_bits = 0; - for (int i = 0; i < descriptor_->field_count(); i++) { - total_bits += - field_generators_.get(descriptor_->field(i)).GetNumBitsForMessage(); - } - int total_ints = (total_bits + 31) / 32; - for (int i = 0; i < total_ints; i++) { - printer->Print("\"$bit_field_name$\",\n", "bit_field_name", - GetBitFieldName(i)); - } - WriteIntToUtf16CharSequence(total_ints, &chars); - - int map_count = 0; - int repeated_count = 0; - std::unique_ptr sorted_fields( - SortFieldsByNumber(descriptor_)); - for (int i = 0; i < descriptor_->field_count(); i++) { - const FieldDescriptor* field = sorted_fields[i]; - if (field->is_map()) { - map_count++; - } else if (field->is_repeated()) { - repeated_count++; - } - } - - WriteIntToUtf16CharSequence(sorted_fields[0]->number(), &chars); - WriteIntToUtf16CharSequence( - sorted_fields[descriptor_->field_count() - 1]->number(), &chars); - WriteIntToUtf16CharSequence(descriptor_->field_count(), &chars); - WriteIntToUtf16CharSequence(map_count, &chars); - WriteIntToUtf16CharSequence(repeated_count, &chars); - - std::vector fields_for_is_initialized_check; - for (int i = 0; i < descriptor_->field_count(); i++) { - if (descriptor_->field(i)->is_required() || - (GetJavaType(descriptor_->field(i)) == JAVATYPE_MESSAGE && - HasRequiredFields(descriptor_->field(i)->message_type()))) { - fields_for_is_initialized_check.push_back(descriptor_->field(i)); - } - } - WriteIntToUtf16CharSequence(fields_for_is_initialized_check.size(), &chars); - - for (int i = 0; i < descriptor_->field_count(); i++) { - const FieldDescriptor* field = sorted_fields[i]; - field_generators_.get(field).GenerateFieldInfo(printer, &chars); - } - printer->Outdent(); - printer->Print("};\n"); - } - - printer->Print("java.lang.String info =\n"); - std::string line; - for (size_t i = 0; i < chars.size(); i++) { - uint16_t code = chars[i]; - EscapeUtf16ToString(code, &line); - if (line.size() >= 80) { - printer->Print(" \"$string$\" +\n", "string", line); - line.clear(); - } - } - printer->Print(" \"$string$\";\n", "string", line); - - printer->Print("return newMessageInfo(DEFAULT_INSTANCE, info, objects);\n"); - printer->Outdent(); -} - -// =================================================================== - -void ImmutableMessageLiteGenerator::GenerateParseFromMethods( - io::Printer* printer) { - printer->Print( - "public static $classname$ parseFrom(\n" - " java.nio.ByteBuffer data)\n" - " throws com.google.protobuf.InvalidProtocolBufferException {\n" - " return com.google.protobuf.GeneratedMessageLite.parseFrom(\n" - " DEFAULT_INSTANCE, data);\n" - "}\n" - "public static $classname$ parseFrom(\n" - " java.nio.ByteBuffer data,\n" - " com.google.protobuf.ExtensionRegistryLite extensionRegistry)\n" - " throws com.google.protobuf.InvalidProtocolBufferException {\n" - " return com.google.protobuf.GeneratedMessageLite.parseFrom(\n" - " DEFAULT_INSTANCE, data, extensionRegistry);\n" - "}\n" - "public static $classname$ parseFrom(\n" - " com.google.protobuf.ByteString data)\n" - " throws com.google.protobuf.InvalidProtocolBufferException {\n" - " return com.google.protobuf.GeneratedMessageLite.parseFrom(\n" - " DEFAULT_INSTANCE, data);\n" - "}\n" - "public static $classname$ parseFrom(\n" - " com.google.protobuf.ByteString data,\n" - " com.google.protobuf.ExtensionRegistryLite extensionRegistry)\n" - " throws com.google.protobuf.InvalidProtocolBufferException {\n" - " return com.google.protobuf.GeneratedMessageLite.parseFrom(\n" - " DEFAULT_INSTANCE, data, extensionRegistry);\n" - "}\n" - "public static $classname$ parseFrom(byte[] data)\n" - " throws com.google.protobuf.InvalidProtocolBufferException {\n" - " return com.google.protobuf.GeneratedMessageLite.parseFrom(\n" - " DEFAULT_INSTANCE, data);\n" - "}\n" - "public static $classname$ parseFrom(\n" - " byte[] data,\n" - " com.google.protobuf.ExtensionRegistryLite extensionRegistry)\n" - " throws com.google.protobuf.InvalidProtocolBufferException {\n" - " return com.google.protobuf.GeneratedMessageLite.parseFrom(\n" - " DEFAULT_INSTANCE, data, extensionRegistry);\n" - "}\n" - "public static $classname$ parseFrom(java.io.InputStream input)\n" - " throws java.io.IOException {\n" - " return com.google.protobuf.GeneratedMessageLite.parseFrom(\n" - " DEFAULT_INSTANCE, input);\n" - "}\n" - "public static $classname$ parseFrom(\n" - " java.io.InputStream input,\n" - " com.google.protobuf.ExtensionRegistryLite extensionRegistry)\n" - " throws java.io.IOException {\n" - " return com.google.protobuf.GeneratedMessageLite.parseFrom(\n" - " DEFAULT_INSTANCE, input, extensionRegistry);\n" - "}\n" - "public static $classname$ parseDelimitedFrom(java.io.InputStream " - "input)\n" - " throws java.io.IOException {\n" - " return parseDelimitedFrom(DEFAULT_INSTANCE, input);\n" - "}\n" - "public static $classname$ parseDelimitedFrom(\n" - " java.io.InputStream input,\n" - " com.google.protobuf.ExtensionRegistryLite extensionRegistry)\n" - " throws java.io.IOException {\n" - " return parseDelimitedFrom(DEFAULT_INSTANCE, input, " - "extensionRegistry);\n" - "}\n" - "public static $classname$ parseFrom(\n" - " com.google.protobuf.CodedInputStream input)\n" - " throws java.io.IOException {\n" - " return com.google.protobuf.GeneratedMessageLite.parseFrom(\n" - " DEFAULT_INSTANCE, input);\n" - "}\n" - "public static $classname$ parseFrom(\n" - " com.google.protobuf.CodedInputStream input,\n" - " com.google.protobuf.ExtensionRegistryLite extensionRegistry)\n" - " throws java.io.IOException {\n" - " return com.google.protobuf.GeneratedMessageLite.parseFrom(\n" - " DEFAULT_INSTANCE, input, extensionRegistry);\n" - "}\n" - "\n", - "classname", name_resolver_->GetImmutableClassName(descriptor_)); -} - -// =================================================================== - -void ImmutableMessageLiteGenerator::GenerateBuilder(io::Printer* printer) { - printer->Print( - "public static Builder newBuilder() {\n" - " return (Builder) DEFAULT_INSTANCE.createBuilder();\n" - "}\n" - "public static Builder newBuilder($classname$ prototype) {\n" - " return (Builder) DEFAULT_INSTANCE.createBuilder(prototype);\n" - "}\n" - "\n", - "classname", name_resolver_->GetImmutableClassName(descriptor_)); - - MessageBuilderLiteGenerator builderGenerator(descriptor_, context_); - builderGenerator.Generate(printer); -} - -// =================================================================== - -void ImmutableMessageLiteGenerator::GenerateDynamicMethodNewBuilder( - io::Printer* printer) { - printer->Print("return new Builder();\n"); -} - -// =================================================================== - -void ImmutableMessageLiteGenerator::GenerateExtensionRegistrationCode( - io::Printer* printer) { - for (int i = 0; i < descriptor_->extension_count(); i++) { - ImmutableExtensionLiteGenerator(descriptor_->extension(i), context_) - .GenerateRegistrationCode(printer); - } - - for (int i = 0; i < descriptor_->nested_type_count(); i++) { - ImmutableMessageLiteGenerator(descriptor_->nested_type(i), context_) - .GenerateExtensionRegistrationCode(printer); - } -} - -// =================================================================== -void ImmutableMessageLiteGenerator::GenerateConstructor(io::Printer* printer) { - printer->Print("private $classname$() {\n", "classname", descriptor_->name()); - printer->Indent(); - - // Initialize all fields to default. - GenerateInitializers(printer); - - printer->Outdent(); - printer->Print("}\n"); -} - -// =================================================================== -void ImmutableMessageLiteGenerator::GenerateParser(io::Printer* printer) { - printer->Print( - "private static volatile com.google.protobuf.Parser<$classname$> " - "PARSER;\n" - "\n" - "public static com.google.protobuf.Parser<$classname$> parser() {\n" - " return DEFAULT_INSTANCE.getParserForType();\n" - "}\n", - "classname", descriptor_->name()); -} - -// =================================================================== -void ImmutableMessageLiteGenerator::GenerateInitializers(io::Printer* printer) { - for (int i = 0; i < descriptor_->field_count(); i++) { - if (!IsRealOneof(descriptor_->field(i))) { - field_generators_.get(descriptor_->field(i)) - .GenerateInitializationCode(printer); - } - } -} - -void ImmutableMessageLiteGenerator::GenerateKotlinDsl( - io::Printer* printer) const { - printer->Print( - "@kotlin.OptIn" - "(com.google.protobuf.kotlin.OnlyForUseByGeneratedProtoCode::class)\n" - "@com.google.protobuf.kotlin.ProtoDslMarker\n"); - printer->Print( - "public class Dsl private constructor(\n" - " private val _builder: $message$.Builder\n" - ") {\n" - " public companion object {\n" - " @kotlin.jvm.JvmSynthetic\n" - " @kotlin.PublishedApi\n" - " internal fun _create(builder: $message$.Builder): Dsl = " - "Dsl(builder)\n" - " }\n" - "\n" - " @kotlin.jvm.JvmSynthetic\n" - " @kotlin.PublishedApi\n" - " internal fun _build(): $message$ = _builder.build()\n", - "message", name_resolver_->GetClassName(descriptor_, true)); - - printer->Indent(); - - for (int i = 0; i < descriptor_->field_count(); i++) { - printer->Print("\n"); - field_generators_.get(descriptor_->field(i)) - .GenerateKotlinDslMembers(printer); - } - - for (auto oneof : oneofs_) { - printer->Print( - "public val $oneof_name$Case: $message$.$oneof_capitalized_name$Case\n" - " @JvmName(\"get$oneof_capitalized_name$Case\")\n" - " get() = _builder.get$oneof_capitalized_name$Case()\n\n" - "public fun clear$oneof_capitalized_name$() {\n" - " _builder.clear$oneof_capitalized_name$()\n" - "}\n", - "oneof_name", context_->GetOneofGeneratorInfo(oneof)->name, - "oneof_capitalized_name", - context_->GetOneofGeneratorInfo(oneof)->capitalized_name, "message", - name_resolver_->GetClassName(descriptor_, true)); - } - - if (descriptor_->extension_range_count() > 0) { - GenerateKotlinExtensions(printer); - } - - printer->Outdent(); - printer->Print("}\n"); -} - -void ImmutableMessageLiteGenerator::GenerateKotlinMembers( - io::Printer* printer) const { - printer->Print( - "@kotlin.jvm.JvmSynthetic\n" - "public inline fun $camelcase_name$(block: $message_kt$.Dsl.() -> " - "kotlin.Unit): " - "$message$ =\n" - " $message_kt$.Dsl._create($message$.newBuilder()).apply { block() " - "}._build()\n", - "camelcase_name", name_resolver_->GetKotlinFactoryName(descriptor_), - "message_kt", name_resolver_->GetKotlinExtensionsClassName(descriptor_), - "message", name_resolver_->GetClassName(descriptor_, true)); - - printer->Print("public object $name$Kt {\n", "name", descriptor_->name()); - printer->Indent(); - GenerateKotlinDsl(printer); - for (int i = 0; i < descriptor_->nested_type_count(); i++) { - if (IsMapEntry(descriptor_->nested_type(i))) continue; - ImmutableMessageLiteGenerator(descriptor_->nested_type(i), context_) - .GenerateKotlinMembers(printer); - } - printer->Outdent(); - printer->Print("}\n"); -} - -void ImmutableMessageLiteGenerator::GenerateTopLevelKotlinMembers( - io::Printer* printer) const { - printer->Print( - "public inline fun $message$.copy(block: $message_kt$.Dsl.() -> " - "kotlin.Unit): " - "$message$ =\n" - " $message_kt$.Dsl._create(this.toBuilder()).apply { block() " - "}._build()\n", - "message", name_resolver_->GetClassName(descriptor_, true), "message_kt", - name_resolver_->GetKotlinExtensionsClassName(descriptor_)); - - for (int i = 0; i < descriptor_->nested_type_count(); i++) { - if (IsMapEntry(descriptor_->nested_type(i))) continue; - ImmutableMessageLiteGenerator(descriptor_->nested_type(i), context_) - .GenerateTopLevelKotlinMembers(printer); - } -} - -void ImmutableMessageLiteGenerator::GenerateKotlinExtensions( - io::Printer* printer) const { - std::string message_name = name_resolver_->GetClassName(descriptor_, true); - - printer->Print( - "@Suppress(\"UNCHECKED_CAST\")\n" - "@kotlin.jvm.JvmSynthetic\n" - "public operator fun get(extension: " - "com.google.protobuf.ExtensionLite<$message$, T>): T {\n" - " return if (extension.isRepeated) {\n" - " get(extension as com.google.protobuf.ExtensionLite<$message$, " - "List<*>>) as T\n" - " } else {\n" - " _builder.getExtension(extension)\n" - " }\n" - "}\n\n", - "message", message_name); - - printer->Print( - "@kotlin.jvm.JvmSynthetic\n" - "@kotlin.OptIn" - "(com.google.protobuf.kotlin.OnlyForUseByGeneratedProtoCode::class)\n" - "@kotlin.jvm.JvmName(\"-getRepeatedExtension\")\n" - "public operator fun get(\n" - " extension: com.google.protobuf.ExtensionLite<$message$, List>\n" - "): com.google.protobuf.kotlin.ExtensionList {\n" - " return com.google.protobuf.kotlin.ExtensionList(extension, " - "_builder.getExtension(extension))\n" - "}\n\n", - "message", message_name); - - printer->Print( - "@kotlin.jvm.JvmSynthetic\n" - "public operator fun contains(extension: " - "com.google.protobuf.ExtensionLite<$message$, *>): " - "Boolean {\n" - " return _builder.hasExtension(extension)\n" - "}\n\n", - "message", message_name); - - printer->Print( - "@kotlin.jvm.JvmSynthetic\n" - "public fun clear(extension: " - "com.google.protobuf.ExtensionLite<$message$, *>) " - "{\n" - " _builder.clearExtension(extension)\n" - "}\n\n", - "message", message_name); - - printer->Print( - "@kotlin.jvm.JvmSynthetic\n" - "@kotlin.PublishedApi\n" - "internal fun setExtension(extension: " - "com.google.protobuf.ExtensionLite<$message$, T>, " - "value: T) {\n" - " _builder.setExtension(extension, value)\n" - "}\n\n", - "message", message_name); - - printer->Print( - "@kotlin.jvm.JvmSynthetic\n" - "@Suppress(\"NOTHING_TO_INLINE\")\n" - "public inline operator fun > set(\n" - " extension: com.google.protobuf.ExtensionLite<$message$, T>,\n" - " value: T\n" - ") {\n" - " setExtension(extension, value)\n" - "}\n\n", - "message", message_name); - - printer->Print( - "@kotlin.jvm.JvmSynthetic\n" - "@Suppress(\"NOTHING_TO_INLINE\")\n" - "public inline operator fun set(\n" - " extension: com.google.protobuf.ExtensionLite<$message$, " - "com.google.protobuf.ByteString>,\n" - " value: com.google.protobuf.ByteString\n" - ") {\n" - " setExtension(extension, value)\n" - "}\n\n", - "message", message_name); - - printer->Print( - "@kotlin.jvm.JvmSynthetic\n" - "@Suppress(\"NOTHING_TO_INLINE\")\n" - "public inline operator fun set(\n" - " extension: com.google.protobuf.ExtensionLite<$message$, T>,\n" - " value: T\n" - ") {\n" - " setExtension(extension, value)\n" - "}\n\n", - "message", message_name); - - printer->Print( - "@kotlin.jvm.JvmSynthetic\n" - "public fun com.google.protobuf.kotlin.ExtensionList.add(value: E) {\n" - " _builder.addExtension(this.extension, value)\n" - "}\n\n", - "message", message_name); - - printer->Print( - "@kotlin.jvm.JvmSynthetic\n" - "@Suppress(\"NOTHING_TO_INLINE\")\n" - "public inline operator fun " - "com.google.protobuf.kotlin.ExtensionList.plusAssign" - "(value: E) {\n" - " add(value)\n" - "}\n\n", - "message", message_name); - - printer->Print( - "@kotlin.jvm.JvmSynthetic\n" - "public fun com.google.protobuf.kotlin.ExtensionList.addAll(values: Iterable) {\n" - " for (value in values) {\n" - " add(value)\n" - " }\n" - "}\n\n", - "message", message_name); - - printer->Print( - "@kotlin.jvm.JvmSynthetic\n" - "@Suppress(\"NOTHING_TO_INLINE\")\n" - "public inline operator fun " - "com.google.protobuf.kotlin.ExtensionList.plusAssign(values: " - "Iterable) {\n" - " addAll(values)\n" - "}\n\n", - "message", message_name); - - printer->Print( - "@kotlin.jvm.JvmSynthetic\n" - "public operator fun com.google.protobuf.kotlin.ExtensionList.set(index: Int, value: " - "E) {\n" - " _builder.setExtension(this.extension, index, value)\n" - "}\n\n", - "message", message_name); - - printer->Print( - "@kotlin.jvm.JvmSynthetic\n" - "@Suppress(\"NOTHING_TO_INLINE\")\n" - "public inline fun com.google.protobuf.kotlin.ExtensionList<*, " - "$message$>.clear() {\n" - " clear(extension)\n" - "}\n\n", - "message", message_name); -} - -} // namespace java -} // namespace compiler -} // namespace protobuf -} // namespace google diff --git a/extra/protobuf/protobuf-3.19.4/src/google/protobuf/compiler/java/java_message_lite.h b/extra/protobuf/protobuf-3.19.4/src/google/protobuf/compiler/java/java_message_lite.h deleted file mode 100644 index adb0df7cc77a..000000000000 --- a/extra/protobuf/protobuf-3.19.4/src/google/protobuf/compiler/java/java_message_lite.h +++ /dev/null @@ -1,86 +0,0 @@ -// Protocol Buffers - Google's data interchange format -// Copyright 2008 Google Inc. All rights reserved. -// https://developers.google.com/protocol-buffers/ -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// * Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// * Redistributions in binary form must reproduce the above -// copyright notice, this list of conditions and the following disclaimer -// in the documentation and/or other materials provided with the -// distribution. -// * Neither the name of Google Inc. nor the names of its -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -// Author: dweis@google.com (Daniel Weis) -// Based on original Protocol Buffers design by -// Sanjay Ghemawat, Jeff Dean, and others. - -#ifndef GOOGLE_PROTOBUF_COMPILER_JAVA_MESSAGE_LITE_H__ -#define GOOGLE_PROTOBUF_COMPILER_JAVA_MESSAGE_LITE_H__ - -#include -#include -#include -#include - -namespace google { -namespace protobuf { -namespace compiler { -namespace java { - -class ImmutableMessageLiteGenerator : public MessageGenerator { - public: - ImmutableMessageLiteGenerator(const Descriptor* descriptor, Context* context); - virtual ~ImmutableMessageLiteGenerator(); - - void Generate(io::Printer* printer) override; - void GenerateInterface(io::Printer* printer) override; - void GenerateExtensionRegistrationCode(io::Printer* printer) override; - void GenerateStaticVariables(io::Printer* printer, - int* bytecode_estimate) override; - int GenerateStaticVariableInitializers(io::Printer* printer) override; - void GenerateKotlinDsl(io::Printer* printer) const override; - void GenerateKotlinMembers(io::Printer* printer) const override; - void GenerateTopLevelKotlinMembers(io::Printer* printer) const override; - - private: - void GenerateParseFromMethods(io::Printer* printer); - - void GenerateBuilder(io::Printer* printer); - void GenerateDynamicMethodNewBuilder(io::Printer* printer); - void GenerateInitializers(io::Printer* printer); - void GenerateParser(io::Printer* printer); - void GenerateConstructor(io::Printer* printer); - void GenerateDynamicMethodNewBuildMessageInfo(io::Printer* printer); - void GenerateKotlinExtensions(io::Printer* printer) const; - - Context* context_; - ClassNameResolver* name_resolver_; - FieldGeneratorMap field_generators_; - - GOOGLE_DISALLOW_EVIL_CONSTRUCTORS(ImmutableMessageLiteGenerator); -}; - -} // namespace java -} // namespace compiler -} // namespace protobuf -} // namespace google - -#endif // GOOGLE_PROTOBUF_COMPILER_JAVA_MESSAGE_LITE_H__ diff --git a/extra/protobuf/protobuf-3.19.4/src/google/protobuf/compiler/java/java_name_resolver.cc b/extra/protobuf/protobuf-3.19.4/src/google/protobuf/compiler/java/java_name_resolver.cc deleted file mode 100644 index 39bf3e278417..000000000000 --- a/extra/protobuf/protobuf-3.19.4/src/google/protobuf/compiler/java/java_name_resolver.cc +++ /dev/null @@ -1,380 +0,0 @@ -// Protocol Buffers - Google's data interchange format -// Copyright 2008 Google Inc. All rights reserved. -// https://developers.google.com/protocol-buffers/ -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// * Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// * Redistributions in binary form must reproduce the above -// copyright notice, this list of conditions and the following disclaimer -// in the documentation and/or other materials provided with the -// distribution. -// * Neither the name of Google Inc. nor the names of its -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -#include - -#include -#include - -#include -#include -#include -#include - -namespace google { -namespace protobuf { -namespace compiler { -namespace java { - -namespace { -// A suffix that will be appended to the file's outer class name if the name -// conflicts with some other types defined in the file. -const char* kOuterClassNameSuffix = "OuterClass"; - -// Strip package name from a descriptor's full name. -// For example: -// Full name : foo.Bar.Baz -// Package name: foo -// After strip : Bar.Baz -std::string StripPackageName(const std::string& full_name, - const FileDescriptor* file) { - if (file->package().empty()) { - return full_name; - } else { - // Strip package name - return full_name.substr(file->package().size() + 1); - } -} - -// Get the name of a message's Java class without package name prefix. -std::string ClassNameWithoutPackage(const Descriptor* descriptor, - bool immutable) { - return StripPackageName(descriptor->full_name(), descriptor->file()); -} - -std::string ClassNameWithoutPackageKotlin(const Descriptor* descriptor) { - std::string result = descriptor->name(); - const Descriptor* temp = descriptor->containing_type(); - - while (temp) { - result = temp->name() + "Kt." + result; - temp = temp->containing_type(); - } - return result; -} - -// Get the name of an enum's Java class without package name prefix. -std::string ClassNameWithoutPackage(const EnumDescriptor* descriptor, - bool immutable) { - // Doesn't append "Mutable" for enum type's name. - const Descriptor* message_descriptor = descriptor->containing_type(); - if (message_descriptor == NULL) { - return descriptor->name(); - } else { - return ClassNameWithoutPackage(message_descriptor, immutable) + "." + - descriptor->name(); - } -} - -// Get the name of a service's Java class without package name prefix. -std::string ClassNameWithoutPackage(const ServiceDescriptor* descriptor, - bool immutable) { - std::string full_name = - StripPackageName(descriptor->full_name(), descriptor->file()); - // We don't allow nested service definitions. - GOOGLE_CHECK(full_name.find('.') == std::string::npos); - return full_name; -} - -// Return true if a and b are equals (case insensitive). -NameEquality CheckNameEquality(const std::string& a, const std::string& b) { - if (ToUpper(a) == ToUpper(b)) { - if (a == b) { - return NameEquality::EXACT_EQUAL; - } - return NameEquality::EQUAL_IGNORE_CASE; - } - return NameEquality::NO_MATCH; -} - -// Check whether a given message or its nested types has the given class name. -bool MessageHasConflictingClassName(const Descriptor* message, - const std::string& classname, - NameEquality equality_mode) { - if (CheckNameEquality(message->name(), classname) == equality_mode) { - return true; - } - for (int i = 0; i < message->nested_type_count(); ++i) { - if (MessageHasConflictingClassName(message->nested_type(i), classname, - equality_mode)) { - return true; - } - } - for (int i = 0; i < message->enum_type_count(); ++i) { - if (CheckNameEquality(message->enum_type(i)->name(), classname) == - equality_mode) { - return true; - } - } - return false; -} - -} // namespace - -ClassNameResolver::ClassNameResolver() {} - -ClassNameResolver::~ClassNameResolver() {} - -std::string ClassNameResolver::GetFileDefaultImmutableClassName( - const FileDescriptor* file) { - std::string basename; - std::string::size_type last_slash = file->name().find_last_of('/'); - if (last_slash == std::string::npos) { - basename = file->name(); - } else { - basename = file->name().substr(last_slash + 1); - } - return UnderscoresToCamelCase(StripProto(basename), true); -} - -std::string ClassNameResolver::GetFileImmutableClassName( - const FileDescriptor* file) { - std::string& class_name = file_immutable_outer_class_names_[file]; - if (class_name.empty()) { - if (file->options().has_java_outer_classname()) { - class_name = file->options().java_outer_classname(); - } else { - class_name = GetFileDefaultImmutableClassName(file); - if (HasConflictingClassName(file, class_name, - NameEquality::EXACT_EQUAL)) { - class_name += kOuterClassNameSuffix; - } - } - } - return class_name; -} - -std::string ClassNameResolver::GetFileClassName(const FileDescriptor* file, - bool immutable) { - return GetFileClassName(file, immutable, false); -} - -std::string ClassNameResolver::GetFileClassName(const FileDescriptor* file, - bool immutable, bool kotlin) { - if (kotlin) { - return GetFileImmutableClassName(file) + "Kt"; - } else if (immutable) { - return GetFileImmutableClassName(file); - } else { - return "Mutable" + GetFileImmutableClassName(file); - } -} - -// Check whether there is any type defined in the proto file that has -// the given class name. -bool ClassNameResolver::HasConflictingClassName(const FileDescriptor* file, - const std::string& classname, - NameEquality equality_mode) { - for (int i = 0; i < file->enum_type_count(); i++) { - if (CheckNameEquality(file->enum_type(i)->name(), classname) == - equality_mode) { - return true; - } - } - for (int i = 0; i < file->service_count(); i++) { - if (CheckNameEquality(file->service(i)->name(), classname) == - equality_mode) { - return true; - } - } - for (int i = 0; i < file->message_type_count(); i++) { - if (MessageHasConflictingClassName(file->message_type(i), classname, - equality_mode)) { - return true; - } - } - return false; -} - -std::string ClassNameResolver::GetDescriptorClassName( - const FileDescriptor* descriptor) { - return GetFileImmutableClassName(descriptor); -} - -std::string ClassNameResolver::GetClassName(const FileDescriptor* descriptor, - bool immutable) { - return GetClassName(descriptor, immutable, false); -} - -std::string ClassNameResolver::GetClassName(const FileDescriptor* descriptor, - bool immutable, bool kotlin) { - std::string result = FileJavaPackage(descriptor, immutable); - if (!result.empty()) result += '.'; - result += GetFileClassName(descriptor, immutable, kotlin); - return result; -} - -// Get the full name of a Java class by prepending the Java package name -// or outer class name. -std::string ClassNameResolver::GetClassFullName( - const std::string& name_without_package, const FileDescriptor* file, - bool immutable, bool is_own_file) { - return GetClassFullName(name_without_package, file, immutable, is_own_file, - false); -} - -std::string ClassNameResolver::GetClassFullName( - const std::string& name_without_package, const FileDescriptor* file, - bool immutable, bool is_own_file, bool kotlin) { - std::string result; - if (is_own_file) { - result = FileJavaPackage(file, immutable); - } else { - result = GetClassName(file, immutable, kotlin); - } - if (!result.empty()) { - result += '.'; - } - result += name_without_package; - if (kotlin) result += "Kt"; - return result; -} - -std::string ClassNameResolver::GetClassName(const Descriptor* descriptor, - bool immutable) { - return GetClassName(descriptor, immutable, false); -} - -std::string ClassNameResolver::GetClassName(const Descriptor* descriptor, - bool immutable, bool kotlin) { - return GetClassFullName( - ClassNameWithoutPackage(descriptor, immutable), descriptor->file(), - immutable, MultipleJavaFiles(descriptor->file(), immutable), kotlin); -} - -std::string ClassNameResolver::GetClassName(const EnumDescriptor* descriptor, - bool immutable) { - return GetClassName(descriptor, immutable, false); -} - -std::string ClassNameResolver::GetClassName(const EnumDescriptor* descriptor, - bool immutable, bool kotlin) { - return GetClassFullName( - ClassNameWithoutPackage(descriptor, immutable), descriptor->file(), - immutable, MultipleJavaFiles(descriptor->file(), immutable), kotlin); -} - -std::string ClassNameResolver::GetClassName(const ServiceDescriptor* descriptor, - bool immutable) { - return GetClassName(descriptor, immutable, false); -} - -std::string ClassNameResolver::GetClassName(const ServiceDescriptor* descriptor, - bool immutable, bool kotlin) { - return GetClassFullName(ClassNameWithoutPackage(descriptor, immutable), - descriptor->file(), immutable, - IsOwnFile(descriptor, immutable), kotlin); -} - -// Get the Java Class style full name of a message. -std::string ClassNameResolver::GetJavaClassFullName( - const std::string& name_without_package, const FileDescriptor* file, - bool immutable) { - return GetJavaClassFullName(name_without_package, file, immutable, false); -} - -std::string ClassNameResolver::GetJavaClassFullName( - const std::string& name_without_package, const FileDescriptor* file, - bool immutable, bool kotlin) { - std::string result; - if (MultipleJavaFiles(file, immutable)) { - result = FileJavaPackage(file, immutable); - if (!result.empty()) result += '.'; - } else { - result = GetClassName(file, immutable, kotlin); - if (!result.empty()) result += '$'; - } - result += StringReplace(name_without_package, ".", "$", true); - return result; -} - -std::string ClassNameResolver::GetExtensionIdentifierName( - const FieldDescriptor* descriptor, bool immutable) { - return GetExtensionIdentifierName(descriptor, immutable, false); -} - -std::string ClassNameResolver::GetExtensionIdentifierName( - const FieldDescriptor* descriptor, bool immutable, bool kotlin) { - return GetClassName(descriptor->containing_type(), immutable, kotlin) + "." + - descriptor->name(); -} - -std::string ClassNameResolver::GetKotlinFactoryName( - const Descriptor* descriptor) { - std::string name = ToCamelCase(descriptor->name(), /* lower_first = */ true); - return IsForbiddenKotlin(name) ? name + "_" : name; -} - -std::string ClassNameResolver::GetJavaImmutableClassName( - const Descriptor* descriptor) { - return GetJavaClassFullName(ClassNameWithoutPackage(descriptor, true), - descriptor->file(), true); -} - -std::string ClassNameResolver::GetJavaImmutableClassName( - const EnumDescriptor* descriptor) { - return GetJavaClassFullName(ClassNameWithoutPackage(descriptor, true), - descriptor->file(), true); -} - -std::string ClassNameResolver::GetKotlinExtensionsClassName( - const Descriptor* descriptor) { - return GetClassFullName(ClassNameWithoutPackageKotlin(descriptor), - descriptor->file(), true, true, true); -} - -std::string ClassNameResolver::GetJavaMutableClassName( - const Descriptor* descriptor) { - return GetJavaClassFullName(ClassNameWithoutPackage(descriptor, false), - descriptor->file(), false); -} - -std::string ClassNameResolver::GetJavaMutableClassName( - const EnumDescriptor* descriptor) { - return GetJavaClassFullName(ClassNameWithoutPackage(descriptor, false), - descriptor->file(), false); -} - -std::string ClassNameResolver::GetDowngradedFileClassName( - const FileDescriptor* file) { - return "Downgraded" + GetFileClassName(file, false); -} - -std::string ClassNameResolver::GetDowngradedClassName( - const Descriptor* descriptor) { - return FileJavaPackage(descriptor->file()) + "." + - GetDowngradedFileClassName(descriptor->file()) + "." + - ClassNameWithoutPackage(descriptor, false); -} - -} // namespace java -} // namespace compiler -} // namespace protobuf -} // namespace google diff --git a/extra/protobuf/protobuf-3.19.4/src/google/protobuf/compiler/java/java_name_resolver.h b/extra/protobuf/protobuf-3.19.4/src/google/protobuf/compiler/java/java_name_resolver.h deleted file mode 100644 index a688d49a4210..000000000000 --- a/extra/protobuf/protobuf-3.19.4/src/google/protobuf/compiler/java/java_name_resolver.h +++ /dev/null @@ -1,153 +0,0 @@ -// Protocol Buffers - Google's data interchange format -// Copyright 2008 Google Inc. All rights reserved. -// https://developers.google.com/protocol-buffers/ -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// * Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// * Redistributions in binary form must reproduce the above -// copyright notice, this list of conditions and the following disclaimer -// in the documentation and/or other materials provided with the -// distribution. -// * Neither the name of Google Inc. nor the names of its -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -#ifndef GOOGLE_PROTOBUF_COMPILER_JAVA_NAME_RESOLVER_H__ -#define GOOGLE_PROTOBUF_COMPILER_JAVA_NAME_RESOLVER_H__ - -#include -#include - -#include - -namespace google { -namespace protobuf { -class Descriptor; -class EnumDescriptor; -class FieldDescriptor; -class FileDescriptor; -class ServiceDescriptor; - -namespace compiler { -namespace java { - -// Indicates how closely the two class names match. -enum NameEquality { NO_MATCH, EXACT_EQUAL, EQUAL_IGNORE_CASE }; - -// Used to get the Java class related names for a given descriptor. It caches -// the results to avoid redundant calculation across multiple name queries. -// Thread-safety note: This class is *not* thread-safe. -class ClassNameResolver { - public: - ClassNameResolver(); - ~ClassNameResolver(); - - // Gets the unqualified outer class name for the file. - std::string GetFileClassName(const FileDescriptor* file, bool immutable); - std::string GetFileClassName(const FileDescriptor* file, bool immutable, - bool kotlin); - // Gets the unqualified immutable outer class name of a file. - std::string GetFileImmutableClassName(const FileDescriptor* file); - // Gets the unqualified default immutable outer class name of a file - // (converted from the proto file's name). - std::string GetFileDefaultImmutableClassName(const FileDescriptor* file); - - // Check whether there is any type defined in the proto file that has - // the given class name. - bool HasConflictingClassName(const FileDescriptor* file, - const std::string& classname, - NameEquality equality_mode); - - // Gets the name of the outer class that holds descriptor information. - // Descriptors are shared between immutable messages and mutable messages. - // Since both of them are generated optionally, the descriptors need to be - // put in another common place. - std::string GetDescriptorClassName(const FileDescriptor* file); - - // Gets the fully-qualified class name corresponding to the given descriptor. - std::string GetClassName(const Descriptor* descriptor, bool immutable); - std::string GetClassName(const Descriptor* descriptor, bool immutable, - bool kotlin); - std::string GetClassName(const EnumDescriptor* descriptor, bool immutable); - std::string GetClassName(const EnumDescriptor* descriptor, bool immutable, - bool kotlin); - std::string GetClassName(const ServiceDescriptor* descriptor, bool immutable); - std::string GetClassName(const ServiceDescriptor* descriptor, bool immutable, - bool kotlin); - std::string GetClassName(const FileDescriptor* descriptor, bool immutable); - std::string GetClassName(const FileDescriptor* descriptor, bool immutable, - bool kotlin); - - template - std::string GetImmutableClassName(const DescriptorType* descriptor) { - return GetClassName(descriptor, true); - } - template - std::string GetMutableClassName(const DescriptorType* descriptor) { - return GetClassName(descriptor, false); - } - - // Gets the fully qualified name of an extension identifier. - std::string GetExtensionIdentifierName(const FieldDescriptor* descriptor, - bool immutable); - std::string GetExtensionIdentifierName(const FieldDescriptor* descriptor, - bool immutable, bool kotlin); - - // Gets the fully qualified name for generated classes in Java convention. - // Nested classes will be separated using '$' instead of '.' - // For example: - // com.package.OuterClass$OuterMessage$InnerMessage - std::string GetJavaImmutableClassName(const Descriptor* descriptor); - std::string GetJavaImmutableClassName(const EnumDescriptor* descriptor); - std::string GetKotlinFactoryName(const Descriptor* descriptor); - std::string GetKotlinExtensionsClassName(const Descriptor* descriptor); - std::string GetJavaMutableClassName(const Descriptor* descriptor); - std::string GetJavaMutableClassName(const EnumDescriptor* descriptor); - // Gets the outer class and the actual class for downgraded mutable messages. - std::string GetDowngradedFileClassName(const FileDescriptor* file); - std::string GetDowngradedClassName(const Descriptor* descriptor); - - private: - // Get the full name of a Java class by prepending the Java package name - // or outer class name. - std::string GetClassFullName(const std::string& name_without_package, - const FileDescriptor* file, bool immutable, - bool is_own_file); - std::string GetClassFullName(const std::string& name_without_package, - const FileDescriptor* file, bool immutable, - bool is_own_file, bool kotlin); - // Get the Java Class style full name of a message. - std::string GetJavaClassFullName(const std::string& name_without_package, - const FileDescriptor* file, bool immutable); - std::string GetJavaClassFullName(const std::string& name_without_package, - const FileDescriptor* file, bool immutable, - bool kotlin); - // Caches the result to provide better performance. - std::map - file_immutable_outer_class_names_; - - GOOGLE_DISALLOW_EVIL_CONSTRUCTORS(ClassNameResolver); -}; - -} // namespace java -} // namespace compiler -} // namespace protobuf -} // namespace google - -#endif // GOOGLE_PROTOBUF_COMPILER_JAVA_NAME_RESOLVER_H__ diff --git a/extra/protobuf/protobuf-3.19.4/src/google/protobuf/compiler/java/java_names.h b/extra/protobuf/protobuf-3.19.4/src/google/protobuf/compiler/java/java_names.h deleted file mode 100644 index 313ace4feb05..000000000000 --- a/extra/protobuf/protobuf-3.19.4/src/google/protobuf/compiler/java/java_names.h +++ /dev/null @@ -1,100 +0,0 @@ -// Protocol Buffers - Google's data interchange format -// Copyright 2008 Google Inc. All rights reserved. -// https://developers.google.com/protocol-buffers/ -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// * Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// * Redistributions in binary form must reproduce the above -// copyright notice, this list of conditions and the following disclaimer -// in the documentation and/or other materials provided with the -// distribution. -// * Neither the name of Google Inc. nor the names of its -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -// Author: kenton@google.com (Kenton Varda) -// Based on original Protocol Buffers design by -// Sanjay Ghemawat, Jeff Dean, and others. -// -// Provides a mechanism for mapping a descriptor to the -// fully-qualified name of the corresponding Java class. - -#ifndef GOOGLE_PROTOBUF_COMPILER_JAVA_NAMES_H__ -#define GOOGLE_PROTOBUF_COMPILER_JAVA_NAMES_H__ - -#include - -namespace google { -namespace protobuf { - -class Descriptor; -class EnumDescriptor; -class FileDescriptor; -class FieldDescriptor; -class ServiceDescriptor; - -namespace compiler { -namespace java { - -// Requires: -// descriptor != NULL -// -// Returns: -// The fully-qualified Java class name. -std::string ClassName(const Descriptor* descriptor); - -// Requires: -// descriptor != NULL -// -// Returns: -// The fully-qualified Java class name. -std::string ClassName(const EnumDescriptor* descriptor); - -// Requires: -// descriptor != NULL -// -// Returns: -// The fully-qualified Java class name. -std::string ClassName(const FileDescriptor* descriptor); - -// Requires: -// descriptor != NULL -// -// Returns: -// The fully-qualified Java class name. -std::string ClassName(const ServiceDescriptor* descriptor); - -// Requires: -// descriptor != NULL -// -// Returns: -// Java package name. -std::string FileJavaPackage(const FileDescriptor* descriptor); - -// Requires: -// descriptor != NULL -// Returns: -// Capitalized camel case name field name. -std::string CapitalizedFieldName(const FieldDescriptor* descriptor); - -} // namespace java -} // namespace compiler -} // namespace protobuf -} // namespace google -#endif // GOOGLE_PROTOBUF_COMPILER_JAVA_NAMES_H__ diff --git a/extra/protobuf/protobuf-3.19.4/src/google/protobuf/compiler/java/java_options.h b/extra/protobuf/protobuf-3.19.4/src/google/protobuf/compiler/java/java_options.h deleted file mode 100644 index 6c29be1500b8..000000000000 --- a/extra/protobuf/protobuf-3.19.4/src/google/protobuf/compiler/java/java_options.h +++ /dev/null @@ -1,73 +0,0 @@ -// Protocol Buffers - Google's data interchange format -// Copyright 2008 Google Inc. All rights reserved. -// https://developers.google.com/protocol-buffers/ -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// * Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// * Redistributions in binary form must reproduce the above -// copyright notice, this list of conditions and the following disclaimer -// in the documentation and/or other materials provided with the -// distribution. -// * Neither the name of Google Inc. nor the names of its -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -#ifndef GOOGLE_PROTOBUF_COMPILER_JAVA_OPTIONS_H__ -#define GOOGLE_PROTOBUF_COMPILER_JAVA_OPTIONS_H__ - -#include - -namespace google { -namespace protobuf { -namespace compiler { -namespace java { - -// Generator options -struct Options { - Options() - : generate_immutable_code(false), - generate_mutable_code(false), - generate_shared_code(false), - enforce_lite(false), - annotate_code(false) { - } - - bool generate_immutable_code; - bool generate_mutable_code; - bool generate_shared_code; - // When set, the protoc will generate the current files and all the transitive - // dependencies as lite runtime. - bool enforce_lite; - // If true, we should build .meta files and emit @Generated annotations into - // generated code. - bool annotate_code; - // Name of a file where we will write a list of generated .meta file names, - // one per line. - std::string annotation_list_file; - // Name of a file where we will write a list of generated file names, one - // per line. - std::string output_list_file; -}; - -} // namespace java -} // namespace compiler -} // namespace protobuf -} // namespace google - -#endif // GOOGLE_PROTOBUF_COMPILER_JAVA_OPTIONS_H__ diff --git a/extra/protobuf/protobuf-3.19.4/src/google/protobuf/compiler/java/java_plugin_unittest.cc b/extra/protobuf/protobuf-3.19.4/src/google/protobuf/compiler/java/java_plugin_unittest.cc deleted file mode 100644 index 3bdd53bff67e..000000000000 --- a/extra/protobuf/protobuf-3.19.4/src/google/protobuf/compiler/java/java_plugin_unittest.cc +++ /dev/null @@ -1,119 +0,0 @@ -// Protocol Buffers - Google's data interchange format -// Copyright 2008 Google Inc. All rights reserved. -// https://developers.google.com/protocol-buffers/ -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// * Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// * Redistributions in binary form must reproduce the above -// copyright notice, this list of conditions and the following disclaimer -// in the documentation and/or other materials provided with the -// distribution. -// * Neither the name of Google Inc. nor the names of its -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -// Author: kenton@google.com (Kenton Varda) -// -// TODO(kenton): Share code with the versions of this test in other languages? -// It seemed like parameterizing it would add more complexity than it is -// worth. - -#include - -#include -#include -#include -#include -#include -#include -#include -#include - -namespace google { -namespace protobuf { -namespace compiler { -namespace java { -namespace { - -class TestGenerator : public CodeGenerator { - public: - TestGenerator() {} - ~TestGenerator() {} - - virtual bool Generate(const FileDescriptor* file, - const std::string& parameter, GeneratorContext* context, - std::string* error) const { - std::string filename = "Test.java"; - TryInsert(filename, "outer_class_scope", context); - TryInsert(filename, "class_scope:foo.Bar", context); - TryInsert(filename, "class_scope:foo.Bar.Baz", context); - TryInsert(filename, "builder_scope:foo.Bar", context); - TryInsert(filename, "builder_scope:foo.Bar.Baz", context); - TryInsert(filename, "enum_scope:foo.Qux", context); - return true; - } - - void TryInsert(const std::string& filename, - const std::string& insertion_point, - GeneratorContext* context) const { - std::unique_ptr output( - context->OpenForInsert(filename, insertion_point)); - io::Printer printer(output.get(), '$'); - printer.Print("// inserted $name$\n", "name", insertion_point); - } -}; - -// This test verifies that all the expected insertion points exist. It does -// not verify that they are correctly-placed; that would require actually -// compiling the output which is a bit more than I care to do for this test. -TEST(JavaPluginTest, PluginTest) { - GOOGLE_CHECK_OK(File::SetContents(TestTempDir() + "/test.proto", - "syntax = \"proto2\";\n" - "package foo;\n" - "option java_package = \"\";\n" - "option java_outer_classname = \"Test\";\n" - "message Bar {\n" - " message Baz {}\n" - "}\n" - "enum Qux { BLAH = 1; }\n", - true)); - - CommandLineInterface cli; - cli.SetInputsAreProtoPathRelative(true); - - JavaGenerator java_generator; - TestGenerator test_generator; - cli.RegisterGenerator("--java_out", &java_generator, ""); - cli.RegisterGenerator("--test_out", &test_generator, ""); - - std::string proto_path = "-I" + TestTempDir(); - std::string java_out = "--java_out=" + TestTempDir(); - std::string test_out = "--test_out=" + TestTempDir(); - - const char* argv[] = {"protoc", proto_path.c_str(), java_out.c_str(), - test_out.c_str(), "test.proto"}; - - EXPECT_EQ(0, cli.Run(5, argv)); -} - -} // namespace -} // namespace java -} // namespace compiler -} // namespace protobuf -} // namespace google diff --git a/extra/protobuf/protobuf-3.19.4/src/google/protobuf/compiler/java/java_primitive_field.cc b/extra/protobuf/protobuf-3.19.4/src/google/protobuf/compiler/java/java_primitive_field.cc deleted file mode 100644 index f67f6d39e1f2..000000000000 --- a/extra/protobuf/protobuf-3.19.4/src/google/protobuf/compiler/java/java_primitive_field.cc +++ /dev/null @@ -1,1111 +0,0 @@ -// Protocol Buffers - Google's data interchange format -// Copyright 2008 Google Inc. All rights reserved. -// https://developers.google.com/protocol-buffers/ -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// * Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// * Redistributions in binary form must reproduce the above -// copyright notice, this list of conditions and the following disclaimer -// in the documentation and/or other materials provided with the -// distribution. -// * Neither the name of Google Inc. nor the names of its -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -// Author: kenton@google.com (Kenton Varda) -// Based on original Protocol Buffers design by -// Sanjay Ghemawat, Jeff Dean, and others. - -#include - -#include -#include -#include - -#include -#include -#include -#include -#include -#include -#include -#include -#include - -namespace google { -namespace protobuf { -namespace compiler { -namespace java { - -using internal::WireFormat; - -namespace { - -void SetPrimitiveVariables(const FieldDescriptor* descriptor, - int messageBitIndex, int builderBitIndex, - const FieldGeneratorInfo* info, - ClassNameResolver* name_resolver, - std::map* variables) { - SetCommonFieldVariables(descriptor, info, variables); - JavaType javaType = GetJavaType(descriptor); - - (*variables)["type"] = PrimitiveTypeName(javaType); - (*variables)["boxed_type"] = BoxedPrimitiveTypeName(javaType); - (*variables)["kt_type"] = KotlinTypeName(javaType); - (*variables)["field_type"] = (*variables)["type"]; - - if (javaType == JAVATYPE_BOOLEAN || javaType == JAVATYPE_DOUBLE || - javaType == JAVATYPE_FLOAT || javaType == JAVATYPE_INT || - javaType == JAVATYPE_LONG) { - std::string capitalized_type = UnderscoresToCamelCase( - PrimitiveTypeName(javaType), /*cap_first_letter=*/true); - (*variables)["field_list_type"] = - "com.google.protobuf.Internal." + capitalized_type + "List"; - (*variables)["empty_list"] = "empty" + capitalized_type + "List()"; - (*variables)["create_list"] = "new" + capitalized_type + "List()"; - (*variables)["mutable_copy_list"] = - "mutableCopy(" + (*variables)["name"] + "_)"; - (*variables)["name_make_immutable"] = - (*variables)["name"] + "_.makeImmutable()"; - (*variables)["repeated_get"] = - (*variables)["name"] + "_.get" + capitalized_type; - (*variables)["repeated_add"] = - (*variables)["name"] + "_.add" + capitalized_type; - (*variables)["repeated_set"] = - (*variables)["name"] + "_.set" + capitalized_type; - } else { - (*variables)["field_list_type"] = - "java.util.List<" + (*variables)["boxed_type"] + ">"; - (*variables)["create_list"] = - "new java.util.ArrayList<" + (*variables)["boxed_type"] + ">()"; - (*variables)["mutable_copy_list"] = "new java.util.ArrayList<" + - (*variables)["boxed_type"] + ">(" + - (*variables)["name"] + "_)"; - (*variables)["empty_list"] = "java.util.Collections.emptyList()"; - (*variables)["name_make_immutable"] = - (*variables)["name"] + "_ = java.util.Collections.unmodifiableList(" + - (*variables)["name"] + "_)"; - (*variables)["repeated_get"] = (*variables)["name"] + "_.get"; - (*variables)["repeated_add"] = (*variables)["name"] + "_.add"; - (*variables)["repeated_set"] = (*variables)["name"] + "_.set"; - } - - (*variables)["default"] = ImmutableDefaultValue(descriptor, name_resolver); - (*variables)["default_init"] = - IsDefaultValueJavaDefault(descriptor) - ? "" - : ("= " + ImmutableDefaultValue(descriptor, name_resolver)); - (*variables)["capitalized_type"] = - GetCapitalizedType(descriptor, /* immutable = */ true); - (*variables)["tag"] = - StrCat(static_cast(WireFormat::MakeTag(descriptor))); - (*variables)["tag_size"] = StrCat( - WireFormat::TagSize(descriptor->number(), GetType(descriptor))); - if (IsReferenceType(GetJavaType(descriptor))) { - (*variables)["null_check"] = - " if (value == null) {\n" - " throw new NullPointerException();\n" - " }\n"; - } else { - (*variables)["null_check"] = ""; - } - // TODO(birdo): Add @deprecated javadoc when generating javadoc is supported - // by the proto compiler - (*variables)["deprecation"] = - descriptor->options().deprecated() ? "@java.lang.Deprecated " : ""; - (*variables)["kt_deprecation"] = - descriptor->options().deprecated() - ? "@kotlin.Deprecated(message = \"Field " + (*variables)["name"] + - " is deprecated\") " - : ""; - int fixed_size = FixedSize(GetType(descriptor)); - if (fixed_size != -1) { - (*variables)["fixed_size"] = StrCat(fixed_size); - } - (*variables)["on_changed"] = "onChanged();"; - - if (HasHasbit(descriptor)) { - // For singular messages and builders, one bit is used for the hasField bit. - (*variables)["get_has_field_bit_message"] = GenerateGetBit(messageBitIndex); - (*variables)["get_has_field_bit_builder"] = GenerateGetBit(builderBitIndex); - - // Note that these have a trailing ";". - (*variables)["set_has_field_bit_message"] = - GenerateSetBit(messageBitIndex) + ";"; - (*variables)["set_has_field_bit_builder"] = - GenerateSetBit(builderBitIndex) + ";"; - (*variables)["clear_has_field_bit_builder"] = - GenerateClearBit(builderBitIndex) + ";"; - - (*variables)["is_field_present_message"] = GenerateGetBit(messageBitIndex); - } else { - (*variables)["set_has_field_bit_message"] = ""; - (*variables)["set_has_field_bit_builder"] = ""; - (*variables)["clear_has_field_bit_builder"] = ""; - - switch (descriptor->type()) { - case FieldDescriptor::TYPE_BYTES: - (*variables)["is_field_present_message"] = - "!" + (*variables)["name"] + "_.isEmpty()"; - break; - case FieldDescriptor::TYPE_FLOAT: - (*variables)["is_field_present_message"] = - "java.lang.Float.floatToRawIntBits(" + (*variables)["name"] + - "_) != 0"; - break; - case FieldDescriptor::TYPE_DOUBLE: - (*variables)["is_field_present_message"] = - "java.lang.Double.doubleToRawLongBits(" + (*variables)["name"] + - "_) != 0"; - break; - default: - (*variables)["is_field_present_message"] = - (*variables)["name"] + "_ != " + (*variables)["default"]; - break; - } - } - - // For repeated builders, one bit is used for whether the array is immutable. - (*variables)["get_mutable_bit_builder"] = GenerateGetBit(builderBitIndex); - (*variables)["set_mutable_bit_builder"] = GenerateSetBit(builderBitIndex); - (*variables)["clear_mutable_bit_builder"] = GenerateClearBit(builderBitIndex); - - // For repeated fields, one bit is used for whether the array is immutable - // in the parsing constructor. - (*variables)["get_mutable_bit_parser"] = - GenerateGetBitMutableLocal(builderBitIndex); - (*variables)["set_mutable_bit_parser"] = - GenerateSetBitMutableLocal(builderBitIndex); - - (*variables)["get_has_field_bit_from_local"] = - GenerateGetBitFromLocal(builderBitIndex); - (*variables)["set_has_field_bit_to_local"] = - GenerateSetBitToLocal(messageBitIndex); -} - -} // namespace - -// =================================================================== - -ImmutablePrimitiveFieldGenerator::ImmutablePrimitiveFieldGenerator( - const FieldDescriptor* descriptor, int messageBitIndex, int builderBitIndex, - Context* context) - : descriptor_(descriptor), name_resolver_(context->GetNameResolver()) { - SetPrimitiveVariables(descriptor, messageBitIndex, builderBitIndex, - context->GetFieldGeneratorInfo(descriptor), - name_resolver_, &variables_); -} - -ImmutablePrimitiveFieldGenerator::~ImmutablePrimitiveFieldGenerator() {} - -int ImmutablePrimitiveFieldGenerator::GetNumBitsForMessage() const { - return HasHasbit(descriptor_) ? 1 : 0; -} - -int ImmutablePrimitiveFieldGenerator::GetNumBitsForBuilder() const { - return GetNumBitsForMessage(); -} - -void ImmutablePrimitiveFieldGenerator::GenerateInterfaceMembers( - io::Printer* printer) const { - if (HasHazzer(descriptor_)) { - WriteFieldAccessorDocComment(printer, descriptor_, HAZZER); - printer->Print(variables_, - "$deprecation$boolean has$capitalized_name$();\n"); - } - WriteFieldAccessorDocComment(printer, descriptor_, GETTER); - printer->Print(variables_, "$deprecation$$type$ get$capitalized_name$();\n"); -} - -void ImmutablePrimitiveFieldGenerator::GenerateMembers( - io::Printer* printer) const { - printer->Print(variables_, "private $field_type$ $name$_;\n"); - PrintExtraFieldInfo(variables_, printer); - if (HasHazzer(descriptor_)) { - WriteFieldAccessorDocComment(printer, descriptor_, HAZZER); - printer->Print( - variables_, - "@java.lang.Override\n" - "$deprecation$public boolean ${$has$capitalized_name$$}$() {\n" - " return $get_has_field_bit_message$;\n" - "}\n"); - printer->Annotate("{", "}", descriptor_); - } - - WriteFieldAccessorDocComment(printer, descriptor_, GETTER); - printer->Print(variables_, - "@java.lang.Override\n" - "$deprecation$public $type$ ${$get$capitalized_name$$}$() {\n" - " return $name$_;\n" - "}\n"); - printer->Annotate("{", "}", descriptor_); -} - -void ImmutablePrimitiveFieldGenerator::GenerateBuilderMembers( - io::Printer* printer) const { - printer->Print(variables_, "private $field_type$ $name$_ $default_init$;\n"); - - if (HasHazzer(descriptor_)) { - WriteFieldAccessorDocComment(printer, descriptor_, HAZZER); - printer->Print( - variables_, - "@java.lang.Override\n" - "$deprecation$public boolean ${$has$capitalized_name$$}$() {\n" - " return $get_has_field_bit_builder$;\n" - "}\n"); - printer->Annotate("{", "}", descriptor_); - } - - WriteFieldAccessorDocComment(printer, descriptor_, GETTER); - printer->Print(variables_, - "@java.lang.Override\n" - "$deprecation$public $type$ ${$get$capitalized_name$$}$() {\n" - " return $name$_;\n" - "}\n"); - printer->Annotate("{", "}", descriptor_); - - WriteFieldAccessorDocComment(printer, descriptor_, SETTER, - /* builder */ true); - printer->Print(variables_, - "$deprecation$public Builder " - "${$set$capitalized_name$$}$($type$ value) {\n" - "$null_check$" - " $set_has_field_bit_builder$\n" - " $name$_ = value;\n" - " $on_changed$\n" - " return this;\n" - "}\n"); - printer->Annotate("{", "}", descriptor_); - - WriteFieldAccessorDocComment(printer, descriptor_, CLEARER, - /* builder */ true); - printer->Print( - variables_, - "$deprecation$public Builder ${$clear$capitalized_name$$}$() {\n" - " $clear_has_field_bit_builder$\n"); - printer->Annotate("{", "}", descriptor_); - JavaType type = GetJavaType(descriptor_); - if (type == JAVATYPE_STRING || type == JAVATYPE_BYTES) { - // The default value is not a simple literal so we want to avoid executing - // it multiple times. Instead, get the default out of the default instance. - printer->Print( - variables_, - " $name$_ = getDefaultInstance().get$capitalized_name$();\n"); - } else { - printer->Print(variables_, " $name$_ = $default$;\n"); - } - printer->Print(variables_, - " $on_changed$\n" - " return this;\n" - "}\n"); -} - -void ImmutablePrimitiveFieldGenerator::GenerateKotlinDslMembers( - io::Printer* printer) const { - WriteFieldDocComment(printer, descriptor_); - printer->Print(variables_, - "$kt_deprecation$public var $kt_name$: $kt_type$\n" - " @JvmName(\"${$get$kt_capitalized_name$$}$\")\n" - " get() = $kt_dsl_builder$.${$get$capitalized_name$$}$()\n" - " @JvmName(\"${$set$kt_capitalized_name$$}$\")\n" - " set(value) {\n" - " $kt_dsl_builder$.${$set$capitalized_name$$}$(value)\n" - " }\n"); - - WriteFieldAccessorDocComment(printer, descriptor_, CLEARER, - /* builder */ false); - printer->Print(variables_, - "public fun ${$clear$kt_capitalized_name$$}$() {\n" - " $kt_dsl_builder$.${$clear$capitalized_name$$}$()\n" - "}\n"); - - if (HasHazzer(descriptor_)) { - WriteFieldAccessorDocComment(printer, descriptor_, HAZZER); - printer->Print( - variables_, - "public fun ${$has$kt_capitalized_name$$}$(): kotlin.Boolean {\n" - " return $kt_dsl_builder$.${$has$capitalized_name$$}$()\n" - "}\n"); - } -} - -void ImmutablePrimitiveFieldGenerator::GenerateFieldBuilderInitializationCode( - io::Printer* printer) const { - // noop for primitives -} - -void ImmutablePrimitiveFieldGenerator::GenerateInitializationCode( - io::Printer* printer) const { - if (!IsDefaultValueJavaDefault(descriptor_)) { - printer->Print(variables_, "$name$_ = $default$;\n"); - } -} - -void ImmutablePrimitiveFieldGenerator::GenerateBuilderClearCode( - io::Printer* printer) const { - printer->Print(variables_, - "$name$_ = $default$;\n" - "$clear_has_field_bit_builder$\n"); -} - -void ImmutablePrimitiveFieldGenerator::GenerateMergingCode( - io::Printer* printer) const { - if (HasHazzer(descriptor_)) { - printer->Print(variables_, - "if (other.has$capitalized_name$()) {\n" - " set$capitalized_name$(other.get$capitalized_name$());\n" - "}\n"); - } else { - printer->Print(variables_, - "if (other.get$capitalized_name$() != $default$) {\n" - " set$capitalized_name$(other.get$capitalized_name$());\n" - "}\n"); - } -} - -void ImmutablePrimitiveFieldGenerator::GenerateBuildingCode( - io::Printer* printer) const { - if (HasHazzer(descriptor_)) { - if (IsDefaultValueJavaDefault(descriptor_)) { - printer->Print(variables_, - "if ($get_has_field_bit_from_local$) {\n" - " result.$name$_ = $name$_;\n" - " $set_has_field_bit_to_local$;\n" - "}\n"); - } else { - printer->Print(variables_, - "if ($get_has_field_bit_from_local$) {\n" - " $set_has_field_bit_to_local$;\n" - "}\n" - "result.$name$_ = $name$_;\n"); - } - } else { - printer->Print(variables_, "result.$name$_ = $name$_;\n"); - } -} - -void ImmutablePrimitiveFieldGenerator::GenerateParsingCode( - io::Printer* printer) const { - printer->Print(variables_, - "$set_has_field_bit_message$\n" - "$name$_ = input.read$capitalized_type$();\n"); -} - -void ImmutablePrimitiveFieldGenerator::GenerateParsingDoneCode( - io::Printer* printer) const { - // noop for primitives. -} - -void ImmutablePrimitiveFieldGenerator::GenerateSerializationCode( - io::Printer* printer) const { - printer->Print(variables_, - "if ($is_field_present_message$) {\n" - " output.write$capitalized_type$($number$, $name$_);\n" - "}\n"); -} - -void ImmutablePrimitiveFieldGenerator::GenerateSerializedSizeCode( - io::Printer* printer) const { - printer->Print(variables_, - "if ($is_field_present_message$) {\n" - " size += com.google.protobuf.CodedOutputStream\n" - " .compute$capitalized_type$Size($number$, $name$_);\n" - "}\n"); -} - -void ImmutablePrimitiveFieldGenerator::GenerateEqualsCode( - io::Printer* printer) const { - switch (GetJavaType(descriptor_)) { - case JAVATYPE_INT: - case JAVATYPE_LONG: - case JAVATYPE_BOOLEAN: - printer->Print(variables_, - "if (get$capitalized_name$()\n" - " != other.get$capitalized_name$()) return false;\n"); - break; - - case JAVATYPE_FLOAT: - printer->Print( - variables_, - "if (java.lang.Float.floatToIntBits(get$capitalized_name$())\n" - " != java.lang.Float.floatToIntBits(\n" - " other.get$capitalized_name$())) return false;\n"); - break; - - case JAVATYPE_DOUBLE: - printer->Print( - variables_, - "if (java.lang.Double.doubleToLongBits(get$capitalized_name$())\n" - " != java.lang.Double.doubleToLongBits(\n" - " other.get$capitalized_name$())) return false;\n"); - break; - - case JAVATYPE_STRING: - case JAVATYPE_BYTES: - printer->Print( - variables_, - "if (!get$capitalized_name$()\n" - " .equals(other.get$capitalized_name$())) return false;\n"); - break; - - case JAVATYPE_ENUM: - case JAVATYPE_MESSAGE: - default: - GOOGLE_LOG(FATAL) << "Can't get here."; - break; - } -} - -void ImmutablePrimitiveFieldGenerator::GenerateHashCode( - io::Printer* printer) const { - printer->Print(variables_, "hash = (37 * hash) + $constant_name$;\n"); - switch (GetJavaType(descriptor_)) { - case JAVATYPE_INT: - printer->Print(variables_, - "hash = (53 * hash) + get$capitalized_name$();\n"); - break; - - case JAVATYPE_LONG: - printer->Print( - variables_, - "hash = (53 * hash) + com.google.protobuf.Internal.hashLong(\n" - " get$capitalized_name$());\n"); - break; - - case JAVATYPE_BOOLEAN: - printer->Print( - variables_, - "hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean(\n" - " get$capitalized_name$());\n"); - break; - - case JAVATYPE_FLOAT: - printer->Print(variables_, - "hash = (53 * hash) + java.lang.Float.floatToIntBits(\n" - " get$capitalized_name$());\n"); - break; - - case JAVATYPE_DOUBLE: - printer->Print( - variables_, - "hash = (53 * hash) + com.google.protobuf.Internal.hashLong(\n" - " java.lang.Double.doubleToLongBits(get$capitalized_name$()));\n"); - break; - - case JAVATYPE_STRING: - case JAVATYPE_BYTES: - printer->Print( - variables_, - "hash = (53 * hash) + get$capitalized_name$().hashCode();\n"); - break; - - case JAVATYPE_ENUM: - case JAVATYPE_MESSAGE: - default: - GOOGLE_LOG(FATAL) << "Can't get here."; - break; - } -} - -std::string ImmutablePrimitiveFieldGenerator::GetBoxedType() const { - return BoxedPrimitiveTypeName(GetJavaType(descriptor_)); -} - -// =================================================================== - -ImmutablePrimitiveOneofFieldGenerator::ImmutablePrimitiveOneofFieldGenerator( - const FieldDescriptor* descriptor, int messageBitIndex, int builderBitIndex, - Context* context) - : ImmutablePrimitiveFieldGenerator(descriptor, messageBitIndex, - builderBitIndex, context) { - const OneofGeneratorInfo* info = - context->GetOneofGeneratorInfo(descriptor->containing_oneof()); - SetCommonOneofVariables(descriptor, info, &variables_); -} - -ImmutablePrimitiveOneofFieldGenerator:: - ~ImmutablePrimitiveOneofFieldGenerator() {} - -void ImmutablePrimitiveOneofFieldGenerator::GenerateMembers( - io::Printer* printer) const { - PrintExtraFieldInfo(variables_, printer); - GOOGLE_DCHECK(HasHazzer(descriptor_)); - WriteFieldAccessorDocComment(printer, descriptor_, HAZZER); - printer->Print(variables_, - "@java.lang.Override\n" - "$deprecation$public boolean ${$has$capitalized_name$$}$() {\n" - " return $has_oneof_case_message$;\n" - "}\n"); - printer->Annotate("{", "}", descriptor_); - - WriteFieldAccessorDocComment(printer, descriptor_, GETTER); - printer->Print(variables_, - "@java.lang.Override\n" - "$deprecation$public $type$ ${$get$capitalized_name$$}$() {\n" - " if ($has_oneof_case_message$) {\n" - " return ($boxed_type$) $oneof_name$_;\n" - " }\n" - " return $default$;\n" - "}\n"); - printer->Annotate("{", "}", descriptor_); -} - -void ImmutablePrimitiveOneofFieldGenerator::GenerateBuilderMembers( - io::Printer* printer) const { - GOOGLE_DCHECK(HasHazzer(descriptor_)); - WriteFieldAccessorDocComment(printer, descriptor_, HAZZER); - printer->Print(variables_, - "$deprecation$public boolean ${$has$capitalized_name$$}$() {\n" - " return $has_oneof_case_message$;\n" - "}\n"); - printer->Annotate("{", "}", descriptor_); - - WriteFieldAccessorDocComment(printer, descriptor_, GETTER); - printer->Print(variables_, - "$deprecation$public $type$ ${$get$capitalized_name$$}$() {\n" - " if ($has_oneof_case_message$) {\n" - " return ($boxed_type$) $oneof_name$_;\n" - " }\n" - " return $default$;\n" - "}\n"); - printer->Annotate("{", "}", descriptor_); - - WriteFieldAccessorDocComment(printer, descriptor_, SETTER, - /* builder */ true); - printer->Print(variables_, - "$deprecation$public Builder " - "${$set$capitalized_name$$}$($type$ value) {\n" - "$null_check$" - " $set_oneof_case_message$;\n" - " $oneof_name$_ = value;\n" - " $on_changed$\n" - " return this;\n" - "}\n"); - printer->Annotate("{", "}", descriptor_); - - WriteFieldAccessorDocComment(printer, descriptor_, CLEARER, - /* builder */ true); - printer->Print( - variables_, - "$deprecation$public Builder ${$clear$capitalized_name$$}$() {\n" - " if ($has_oneof_case_message$) {\n" - " $clear_oneof_case_message$;\n" - " $oneof_name$_ = null;\n" - " $on_changed$\n" - " }\n" - " return this;\n" - "}\n"); - printer->Annotate("{", "}", descriptor_); -} - -void ImmutablePrimitiveOneofFieldGenerator::GenerateBuildingCode( - io::Printer* printer) const { - printer->Print(variables_, - "if ($has_oneof_case_message$) {\n" - " result.$oneof_name$_ = $oneof_name$_;\n" - "}\n"); -} - -void ImmutablePrimitiveOneofFieldGenerator::GenerateMergingCode( - io::Printer* printer) const { - printer->Print(variables_, - "set$capitalized_name$(other.get$capitalized_name$());\n"); -} - -void ImmutablePrimitiveOneofFieldGenerator::GenerateParsingCode( - io::Printer* printer) const { - printer->Print(variables_, - "$oneof_name$_ = input.read$capitalized_type$();\n" - "$set_oneof_case_message$;\n"); -} - -void ImmutablePrimitiveOneofFieldGenerator::GenerateSerializationCode( - io::Printer* printer) const { - printer->Print(variables_, - "if ($has_oneof_case_message$) {\n" - " output.write$capitalized_type$(\n"); - // $type$ and $boxed_type$ is the same for bytes fields so we don't need to - // do redundant casts. - if (GetJavaType(descriptor_) == JAVATYPE_BYTES) { - printer->Print(variables_, " $number$, ($type$) $oneof_name$_);\n"); - } else { - printer->Print( - variables_, - " $number$, ($type$)(($boxed_type$) $oneof_name$_));\n"); - } - printer->Print("}\n"); -} - -void ImmutablePrimitiveOneofFieldGenerator::GenerateSerializedSizeCode( - io::Printer* printer) const { - printer->Print(variables_, - "if ($has_oneof_case_message$) {\n" - " size += com.google.protobuf.CodedOutputStream\n" - " .compute$capitalized_type$Size(\n"); - // $type$ and $boxed_type$ is the same for bytes fields so we don't need to - // do redundant casts. - if (GetJavaType(descriptor_) == JAVATYPE_BYTES) { - printer->Print(variables_, " $number$, ($type$) $oneof_name$_);\n"); - } else { - printer->Print( - variables_, - " $number$, ($type$)(($boxed_type$) $oneof_name$_));\n"); - } - printer->Print("}\n"); -} - -// =================================================================== - -RepeatedImmutablePrimitiveFieldGenerator:: - RepeatedImmutablePrimitiveFieldGenerator(const FieldDescriptor* descriptor, - int messageBitIndex, - int builderBitIndex, - Context* context) - : descriptor_(descriptor), name_resolver_(context->GetNameResolver()) { - SetPrimitiveVariables(descriptor, messageBitIndex, builderBitIndex, - context->GetFieldGeneratorInfo(descriptor), - name_resolver_, &variables_); -} - -RepeatedImmutablePrimitiveFieldGenerator:: - ~RepeatedImmutablePrimitiveFieldGenerator() {} - -int RepeatedImmutablePrimitiveFieldGenerator::GetNumBitsForMessage() const { - return 0; -} - -int RepeatedImmutablePrimitiveFieldGenerator::GetNumBitsForBuilder() const { - return 1; -} - -void RepeatedImmutablePrimitiveFieldGenerator::GenerateInterfaceMembers( - io::Printer* printer) const { - WriteFieldAccessorDocComment(printer, descriptor_, LIST_GETTER); - printer->Print(variables_, - "$deprecation$java.util.List<$boxed_type$> " - "get$capitalized_name$List();\n"); - WriteFieldAccessorDocComment(printer, descriptor_, LIST_COUNT); - printer->Print(variables_, - "$deprecation$int get$capitalized_name$Count();\n"); - WriteFieldAccessorDocComment(printer, descriptor_, LIST_INDEXED_GETTER); - printer->Print(variables_, - "$deprecation$$type$ get$capitalized_name$(int index);\n"); -} - -void RepeatedImmutablePrimitiveFieldGenerator::GenerateMembers( - io::Printer* printer) const { - printer->Print(variables_, "private $field_list_type$ $name$_;\n"); - PrintExtraFieldInfo(variables_, printer); - WriteFieldAccessorDocComment(printer, descriptor_, LIST_GETTER); - printer->Print(variables_, - "@java.lang.Override\n" - "$deprecation$public java.util.List<$boxed_type$>\n" - " ${$get$capitalized_name$List$}$() {\n" - " return $name$_;\n" // note: unmodifiable list - "}\n"); - printer->Annotate("{", "}", descriptor_); - WriteFieldAccessorDocComment(printer, descriptor_, LIST_COUNT); - printer->Print( - variables_, - "$deprecation$public int ${$get$capitalized_name$Count$}$() {\n" - " return $name$_.size();\n" - "}\n"); - printer->Annotate("{", "}", descriptor_); - WriteFieldAccessorDocComment(printer, descriptor_, LIST_INDEXED_GETTER); - printer->Print( - variables_, - "$deprecation$public $type$ ${$get$capitalized_name$$}$(int index) {\n" - " return $repeated_get$(index);\n" - "}\n"); - printer->Annotate("{", "}", descriptor_); - - if (descriptor_->is_packed()) { - printer->Print(variables_, - "private int $name$MemoizedSerializedSize = -1;\n"); - } -} - -void RepeatedImmutablePrimitiveFieldGenerator::GenerateBuilderMembers( - io::Printer* printer) const { - // One field is the list and the bit field keeps track of whether the - // list is immutable. If it's immutable, the invariant is that it must - // either an instance of Collections.emptyList() or it's an ArrayList - // wrapped in a Collections.unmodifiableList() wrapper and nobody else has - // a reference to the underlying ArrayList. This invariant allows us to - // share instances of lists between protocol buffers avoiding expensive - // memory allocations. Note, immutable is a strong guarantee here -- not - // just that the list cannot be modified via the reference but that the - // list can never be modified. - printer->Print(variables_, - "private $field_list_type$ $name$_ = $empty_list$;\n"); - - printer->Print(variables_, - "private void ensure$capitalized_name$IsMutable() {\n" - " if (!$get_mutable_bit_builder$) {\n" - " $name$_ = $mutable_copy_list$;\n" - " $set_mutable_bit_builder$;\n" - " }\n" - "}\n"); - - // Note: We return an unmodifiable list because otherwise the caller - // could hold on to the returned list and modify it after the message - // has been built, thus mutating the message which is supposed to be - // immutable. - WriteFieldAccessorDocComment(printer, descriptor_, LIST_GETTER); - printer->Print( - variables_, - "$deprecation$public java.util.List<$boxed_type$>\n" - " ${$get$capitalized_name$List$}$() {\n" - " return $get_mutable_bit_builder$ ?\n" - " java.util.Collections.unmodifiableList($name$_) : $name$_;\n" - "}\n"); - printer->Annotate("{", "}", descriptor_); - WriteFieldAccessorDocComment(printer, descriptor_, LIST_COUNT); - printer->Print( - variables_, - "$deprecation$public int ${$get$capitalized_name$Count$}$() {\n" - " return $name$_.size();\n" - "}\n"); - printer->Annotate("{", "}", descriptor_); - WriteFieldAccessorDocComment(printer, descriptor_, LIST_INDEXED_GETTER); - printer->Print( - variables_, - "$deprecation$public $type$ ${$get$capitalized_name$$}$(int index) {\n" - " return $repeated_get$(index);\n" - "}\n"); - printer->Annotate("{", "}", descriptor_); - WriteFieldAccessorDocComment(printer, descriptor_, LIST_INDEXED_SETTER, - /* builder */ true); - printer->Print(variables_, - "$deprecation$public Builder ${$set$capitalized_name$$}$(\n" - " int index, $type$ value) {\n" - "$null_check$" - " ensure$capitalized_name$IsMutable();\n" - " $repeated_set$(index, value);\n" - " $on_changed$\n" - " return this;\n" - "}\n"); - printer->Annotate("{", "}", descriptor_); - WriteFieldAccessorDocComment(printer, descriptor_, LIST_ADDER, - /* builder */ true); - printer->Print(variables_, - "$deprecation$public Builder " - "${$add$capitalized_name$$}$($type$ value) {\n" - "$null_check$" - " ensure$capitalized_name$IsMutable();\n" - " $repeated_add$(value);\n" - " $on_changed$\n" - " return this;\n" - "}\n"); - printer->Annotate("{", "}", descriptor_); - WriteFieldAccessorDocComment(printer, descriptor_, LIST_MULTI_ADDER, - /* builder */ true); - printer->Print(variables_, - "$deprecation$public Builder ${$addAll$capitalized_name$$}$(\n" - " java.lang.Iterable values) {\n" - " ensure$capitalized_name$IsMutable();\n" - " com.google.protobuf.AbstractMessageLite.Builder.addAll(\n" - " values, $name$_);\n" - " $on_changed$\n" - " return this;\n" - "}\n"); - printer->Annotate("{", "}", descriptor_); - WriteFieldAccessorDocComment(printer, descriptor_, CLEARER, - /* builder */ true); - printer->Print( - variables_, - "$deprecation$public Builder ${$clear$capitalized_name$$}$() {\n" - " $name$_ = $empty_list$;\n" - " $clear_mutable_bit_builder$;\n" - " $on_changed$\n" - " return this;\n" - "}\n"); - printer->Annotate("{", "}", descriptor_); -} - -void RepeatedImmutablePrimitiveFieldGenerator::GenerateKotlinDslMembers( - io::Printer* printer) const { - printer->Print( - variables_, - "/**\n" - " * An uninstantiable, behaviorless type to represent the field in\n" - " * generics.\n" - " */\n" - "@kotlin.OptIn" - "(com.google.protobuf.kotlin.OnlyForUseByGeneratedProtoCode::class)\n" - "public class ${$$kt_capitalized_name$Proxy$}$ private constructor()" - " : com.google.protobuf.kotlin.DslProxy()\n"); - - WriteFieldDocComment(printer, descriptor_); - printer->Print(variables_, - "$kt_deprecation$ public val $kt_name$: " - "com.google.protobuf.kotlin.DslList" - "<$kt_type$, ${$$kt_capitalized_name$Proxy$}$>\n" - " @kotlin.jvm.JvmSynthetic\n" - " get() = com.google.protobuf.kotlin.DslList(\n" - " $kt_dsl_builder$.${$get$capitalized_name$List$}$()\n" - " )\n"); - - WriteFieldAccessorDocComment(printer, descriptor_, LIST_ADDER, - /* builder */ false); - printer->Print(variables_, - "@kotlin.jvm.JvmSynthetic\n" - "@kotlin.jvm.JvmName(\"add$kt_capitalized_name$\")\n" - "public fun com.google.protobuf.kotlin.DslList" - "<$kt_type$, ${$$kt_capitalized_name$Proxy$}$>." - "add(value: $kt_type$) {\n" - " $kt_dsl_builder$.${$add$capitalized_name$$}$(value)\n" - "}"); - - WriteFieldAccessorDocComment(printer, descriptor_, LIST_ADDER, - /* builder */ false); - printer->Print(variables_, - "@kotlin.jvm.JvmSynthetic\n" - "@kotlin.jvm.JvmName(\"plusAssign$kt_capitalized_name$\")\n" - "@Suppress(\"NOTHING_TO_INLINE\")\n" - "public inline operator fun com.google.protobuf.kotlin.DslList" - "<$kt_type$, ${$$kt_capitalized_name$Proxy$}$>." - "plusAssign(value: $kt_type$) {\n" - " add(value)\n" - "}"); - - WriteFieldAccessorDocComment(printer, descriptor_, LIST_MULTI_ADDER, - /* builder */ false); - printer->Print(variables_, - "@kotlin.jvm.JvmSynthetic\n" - "@kotlin.jvm.JvmName(\"addAll$kt_capitalized_name$\")\n" - "public fun com.google.protobuf.kotlin.DslList" - "<$kt_type$, ${$$kt_capitalized_name$Proxy$}$>." - "addAll(values: kotlin.collections.Iterable<$kt_type$>) {\n" - " $kt_dsl_builder$.${$addAll$capitalized_name$$}$(values)\n" - "}"); - - WriteFieldAccessorDocComment(printer, descriptor_, LIST_MULTI_ADDER, - /* builder */ false); - printer->Print( - variables_, - "@kotlin.jvm.JvmSynthetic\n" - "@kotlin.jvm.JvmName(\"plusAssignAll$kt_capitalized_name$\")\n" - "@Suppress(\"NOTHING_TO_INLINE\")\n" - "public inline operator fun com.google.protobuf.kotlin.DslList" - "<$kt_type$, ${$$kt_capitalized_name$Proxy$}$>." - "plusAssign(values: kotlin.collections.Iterable<$kt_type$>) {\n" - " addAll(values)\n" - "}"); - - WriteFieldAccessorDocComment(printer, descriptor_, LIST_INDEXED_SETTER, - /* builder */ false); - printer->Print( - variables_, - "@kotlin.jvm.JvmSynthetic\n" - "@kotlin.jvm.JvmName(\"set$kt_capitalized_name$\")\n" - "public operator fun com.google.protobuf.kotlin.DslList" - "<$kt_type$, ${$$kt_capitalized_name$Proxy$}$>." - "set(index: kotlin.Int, value: $kt_type$) {\n" - " $kt_dsl_builder$.${$set$capitalized_name$$}$(index, value)\n" - "}"); - - WriteFieldAccessorDocComment(printer, descriptor_, CLEARER, - /* builder */ false); - printer->Print(variables_, - "@kotlin.jvm.JvmSynthetic\n" - "@kotlin.jvm.JvmName(\"clear$kt_capitalized_name$\")\n" - "public fun com.google.protobuf.kotlin.DslList" - "<$kt_type$, ${$$kt_capitalized_name$Proxy$}$>." - "clear() {\n" - " $kt_dsl_builder$.${$clear$capitalized_name$$}$()\n" - "}"); -} - -void RepeatedImmutablePrimitiveFieldGenerator:: - GenerateFieldBuilderInitializationCode(io::Printer* printer) const { - // noop for primitives -} - -void RepeatedImmutablePrimitiveFieldGenerator::GenerateInitializationCode( - io::Printer* printer) const { - printer->Print(variables_, "$name$_ = $empty_list$;\n"); -} - -void RepeatedImmutablePrimitiveFieldGenerator::GenerateBuilderClearCode( - io::Printer* printer) const { - printer->Print(variables_, - "$name$_ = $empty_list$;\n" - "$clear_mutable_bit_builder$;\n"); -} - -void RepeatedImmutablePrimitiveFieldGenerator::GenerateMergingCode( - io::Printer* printer) const { - // The code below does two optimizations: - // 1. If the other list is empty, there's nothing to do. This ensures we - // don't allocate a new array if we already have an immutable one. - // 2. If the other list is non-empty and our current list is empty, we can - // reuse the other list which is guaranteed to be immutable. - printer->Print(variables_, - "if (!other.$name$_.isEmpty()) {\n" - " if ($name$_.isEmpty()) {\n" - " $name$_ = other.$name$_;\n" - " $clear_mutable_bit_builder$;\n" - " } else {\n" - " ensure$capitalized_name$IsMutable();\n" - " $name$_.addAll(other.$name$_);\n" - " }\n" - " $on_changed$\n" - "}\n"); -} - -void RepeatedImmutablePrimitiveFieldGenerator::GenerateBuildingCode( - io::Printer* printer) const { - // The code below ensures that the result has an immutable list. If our - // list is immutable, we can just reuse it. If not, we make it immutable. - printer->Print(variables_, - "if ($get_mutable_bit_builder$) {\n" - " $name_make_immutable$;\n" - " $clear_mutable_bit_builder$;\n" - "}\n" - "result.$name$_ = $name$_;\n"); -} - -void RepeatedImmutablePrimitiveFieldGenerator::GenerateParsingCode( - io::Printer* printer) const { - printer->Print(variables_, - "if (!$get_mutable_bit_parser$) {\n" - " $name$_ = $create_list$;\n" - " $set_mutable_bit_parser$;\n" - "}\n" - "$repeated_add$(input.read$capitalized_type$());\n"); -} - -void RepeatedImmutablePrimitiveFieldGenerator::GenerateParsingCodeFromPacked( - io::Printer* printer) const { - printer->Print( - variables_, - "int length = input.readRawVarint32();\n" - "int limit = input.pushLimit(length);\n" - "if (!$get_mutable_bit_parser$ && input.getBytesUntilLimit() > 0) {\n" - " $name$_ = $create_list$;\n" - " $set_mutable_bit_parser$;\n" - "}\n" - "while (input.getBytesUntilLimit() > 0) {\n" - " $repeated_add$(input.read$capitalized_type$());\n" - "}\n" - "input.popLimit(limit);\n"); -} - -void RepeatedImmutablePrimitiveFieldGenerator::GenerateParsingDoneCode( - io::Printer* printer) const { - printer->Print(variables_, - "if ($get_mutable_bit_parser$) {\n" - " $name_make_immutable$; // C\n" - "}\n"); -} - -void RepeatedImmutablePrimitiveFieldGenerator::GenerateSerializationCode( - io::Printer* printer) const { - if (descriptor_->is_packed()) { - // We invoke getSerializedSize in writeTo for messages that have packed - // fields in ImmutableMessageGenerator::GenerateMessageSerializationMethods. - // That makes it safe to rely on the memoized size here. - printer->Print(variables_, - "if (get$capitalized_name$List().size() > 0) {\n" - " output.writeUInt32NoTag($tag$);\n" - " output.writeUInt32NoTag($name$MemoizedSerializedSize);\n" - "}\n" - "for (int i = 0; i < $name$_.size(); i++) {\n" - " output.write$capitalized_type$NoTag($repeated_get$(i));\n" - "}\n"); - } else { - printer->Print( - variables_, - "for (int i = 0; i < $name$_.size(); i++) {\n" - " output.write$capitalized_type$($number$, $repeated_get$(i));\n" - "}\n"); - } -} - -void RepeatedImmutablePrimitiveFieldGenerator::GenerateSerializedSizeCode( - io::Printer* printer) const { - printer->Print(variables_, - "{\n" - " int dataSize = 0;\n"); - printer->Indent(); - - if (FixedSize(GetType(descriptor_)) == -1) { - printer->Print( - variables_, - "for (int i = 0; i < $name$_.size(); i++) {\n" - " dataSize += com.google.protobuf.CodedOutputStream\n" - " .compute$capitalized_type$SizeNoTag($repeated_get$(i));\n" - "}\n"); - } else { - printer->Print( - variables_, - "dataSize = $fixed_size$ * get$capitalized_name$List().size();\n"); - } - - printer->Print("size += dataSize;\n"); - - if (descriptor_->is_packed()) { - printer->Print(variables_, - "if (!get$capitalized_name$List().isEmpty()) {\n" - " size += $tag_size$;\n" - " size += com.google.protobuf.CodedOutputStream\n" - " .computeInt32SizeNoTag(dataSize);\n" - "}\n"); - } else { - printer->Print( - variables_, - "size += $tag_size$ * get$capitalized_name$List().size();\n"); - } - - // cache the data size for packed fields. - if (descriptor_->is_packed()) { - printer->Print(variables_, "$name$MemoizedSerializedSize = dataSize;\n"); - } - - printer->Outdent(); - printer->Print("}\n"); -} - -void RepeatedImmutablePrimitiveFieldGenerator::GenerateEqualsCode( - io::Printer* printer) const { - printer->Print( - variables_, - "if (!get$capitalized_name$List()\n" - " .equals(other.get$capitalized_name$List())) return false;\n"); -} - -void RepeatedImmutablePrimitiveFieldGenerator::GenerateHashCode( - io::Printer* printer) const { - printer->Print( - variables_, - "if (get$capitalized_name$Count() > 0) {\n" - " hash = (37 * hash) + $constant_name$;\n" - " hash = (53 * hash) + get$capitalized_name$List().hashCode();\n" - "}\n"); -} - -std::string RepeatedImmutablePrimitiveFieldGenerator::GetBoxedType() const { - return BoxedPrimitiveTypeName(GetJavaType(descriptor_)); -} - -} // namespace java -} // namespace compiler -} // namespace protobuf -} // namespace google diff --git a/extra/protobuf/protobuf-3.19.4/src/google/protobuf/compiler/java/java_primitive_field.h b/extra/protobuf/protobuf-3.19.4/src/google/protobuf/compiler/java/java_primitive_field.h deleted file mode 100644 index 1f0eb8c8692a..000000000000 --- a/extra/protobuf/protobuf-3.19.4/src/google/protobuf/compiler/java/java_primitive_field.h +++ /dev/null @@ -1,162 +0,0 @@ -// Protocol Buffers - Google's data interchange format -// Copyright 2008 Google Inc. All rights reserved. -// https://developers.google.com/protocol-buffers/ -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// * Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// * Redistributions in binary form must reproduce the above -// copyright notice, this list of conditions and the following disclaimer -// in the documentation and/or other materials provided with the -// distribution. -// * Neither the name of Google Inc. nor the names of its -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -// Author: kenton@google.com (Kenton Varda) -// Based on original Protocol Buffers design by -// Sanjay Ghemawat, Jeff Dean, and others. - -#ifndef GOOGLE_PROTOBUF_COMPILER_JAVA_PRIMITIVE_FIELD_H__ -#define GOOGLE_PROTOBUF_COMPILER_JAVA_PRIMITIVE_FIELD_H__ - -#include -#include -#include - -namespace google { -namespace protobuf { -namespace compiler { -namespace java { -class Context; // context.h -class ClassNameResolver; // name_resolver.h -} // namespace java -} // namespace compiler -} // namespace protobuf -} // namespace google - -namespace google { -namespace protobuf { -namespace compiler { -namespace java { - -class ImmutablePrimitiveFieldGenerator : public ImmutableFieldGenerator { - public: - explicit ImmutablePrimitiveFieldGenerator(const FieldDescriptor* descriptor, - int messageBitIndex, - int builderBitIndex, - Context* context); - ~ImmutablePrimitiveFieldGenerator() override; - - // implements ImmutableFieldGenerator - // --------------------------------------- - int GetNumBitsForMessage() const override; - int GetNumBitsForBuilder() const override; - void GenerateInterfaceMembers(io::Printer* printer) const override; - void GenerateMembers(io::Printer* printer) const override; - void GenerateBuilderMembers(io::Printer* printer) const override; - void GenerateInitializationCode(io::Printer* printer) const override; - void GenerateBuilderClearCode(io::Printer* printer) const override; - void GenerateMergingCode(io::Printer* printer) const override; - void GenerateBuildingCode(io::Printer* printer) const override; - void GenerateParsingCode(io::Printer* printer) const override; - void GenerateParsingDoneCode(io::Printer* printer) const override; - void GenerateSerializationCode(io::Printer* printer) const override; - void GenerateSerializedSizeCode(io::Printer* printer) const override; - void GenerateFieldBuilderInitializationCode( - io::Printer* printer) const override; - void GenerateEqualsCode(io::Printer* printer) const override; - void GenerateHashCode(io::Printer* printer) const override; - void GenerateKotlinDslMembers(io::Printer* printer) const override; - - std::string GetBoxedType() const override; - - protected: - const FieldDescriptor* descriptor_; - std::map variables_; - ClassNameResolver* name_resolver_; - - private: - GOOGLE_DISALLOW_EVIL_CONSTRUCTORS(ImmutablePrimitiveFieldGenerator); -}; - -class ImmutablePrimitiveOneofFieldGenerator - : public ImmutablePrimitiveFieldGenerator { - public: - ImmutablePrimitiveOneofFieldGenerator(const FieldDescriptor* descriptor, - int messageBitIndex, - int builderBitIndex, Context* context); - ~ImmutablePrimitiveOneofFieldGenerator(); - - void GenerateMembers(io::Printer* printer) const override; - void GenerateBuilderMembers(io::Printer* printer) const override; - void GenerateBuildingCode(io::Printer* printer) const override; - void GenerateMergingCode(io::Printer* printer) const override; - void GenerateParsingCode(io::Printer* printer) const override; - void GenerateSerializationCode(io::Printer* printer) const override; - void GenerateSerializedSizeCode(io::Printer* printer) const override; - - private: - GOOGLE_DISALLOW_EVIL_CONSTRUCTORS(ImmutablePrimitiveOneofFieldGenerator); -}; - -class RepeatedImmutablePrimitiveFieldGenerator - : public ImmutableFieldGenerator { - public: - explicit RepeatedImmutablePrimitiveFieldGenerator( - const FieldDescriptor* descriptor, int messageBitIndex, - int builderBitIndex, Context* context); - ~RepeatedImmutablePrimitiveFieldGenerator() override; - - // implements ImmutableFieldGenerator --------------------------------------- - int GetNumBitsForMessage() const override; - int GetNumBitsForBuilder() const override; - void GenerateInterfaceMembers(io::Printer* printer) const override; - void GenerateMembers(io::Printer* printer) const override; - void GenerateBuilderMembers(io::Printer* printer) const override; - void GenerateInitializationCode(io::Printer* printer) const override; - void GenerateBuilderClearCode(io::Printer* printer) const override; - void GenerateMergingCode(io::Printer* printer) const override; - void GenerateBuildingCode(io::Printer* printer) const override; - void GenerateParsingCode(io::Printer* printer) const override; - void GenerateParsingCodeFromPacked(io::Printer* printer) const override; - void GenerateParsingDoneCode(io::Printer* printer) const override; - void GenerateSerializationCode(io::Printer* printer) const override; - void GenerateSerializedSizeCode(io::Printer* printer) const override; - void GenerateFieldBuilderInitializationCode( - io::Printer* printer) const override; - void GenerateEqualsCode(io::Printer* printer) const override; - void GenerateHashCode(io::Printer* printer) const override; - void GenerateKotlinDslMembers(io::Printer* printer) const override; - - std::string GetBoxedType() const override; - - private: - const FieldDescriptor* descriptor_; - std::map variables_; - ClassNameResolver* name_resolver_; - - GOOGLE_DISALLOW_EVIL_CONSTRUCTORS(RepeatedImmutablePrimitiveFieldGenerator); -}; - -} // namespace java -} // namespace compiler -} // namespace protobuf -} // namespace google - -#endif // GOOGLE_PROTOBUF_COMPILER_JAVA_PRIMITIVE_FIELD_H__ diff --git a/extra/protobuf/protobuf-3.19.4/src/google/protobuf/compiler/java/java_primitive_field_lite.cc b/extra/protobuf/protobuf-3.19.4/src/google/protobuf/compiler/java/java_primitive_field_lite.cc deleted file mode 100644 index 5441d01a511a..000000000000 --- a/extra/protobuf/protobuf-3.19.4/src/google/protobuf/compiler/java/java_primitive_field_lite.cc +++ /dev/null @@ -1,779 +0,0 @@ -// Protocol Buffers - Google's data interchange format -// Copyright 2008 Google Inc. All rights reserved. -// https://developers.google.com/protocol-buffers/ -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// * Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// * Redistributions in binary form must reproduce the above -// copyright notice, this list of conditions and the following disclaimer -// in the documentation and/or other materials provided with the -// distribution. -// * Neither the name of Google Inc. nor the names of its -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -// Author: kenton@google.com (Kenton Varda) -// Based on original Protocol Buffers design by -// Sanjay Ghemawat, Jeff Dean, and others. - -#include - -#include -#include -#include - -#include -#include -#include -#include -#include -#include -#include -#include -#include - -namespace google { -namespace protobuf { -namespace compiler { -namespace java { - -using internal::WireFormat; -using internal::WireFormatLite; - -namespace { -bool EnableExperimentalRuntimeForLite() { -#ifdef PROTOBUF_EXPERIMENT - return PROTOBUF_EXPERIMENT; -#else // PROTOBUF_EXPERIMENT - return false; -#endif // !PROTOBUF_EXPERIMENT -} - -void SetPrimitiveVariables(const FieldDescriptor* descriptor, - int messageBitIndex, int builderBitIndex, - const FieldGeneratorInfo* info, - ClassNameResolver* name_resolver, - std::map* variables) { - SetCommonFieldVariables(descriptor, info, variables); - JavaType javaType = GetJavaType(descriptor); - (*variables)["type"] = PrimitiveTypeName(javaType); - (*variables)["boxed_type"] = BoxedPrimitiveTypeName(javaType); - (*variables)["kt_type"] = KotlinTypeName(javaType); - (*variables)["field_type"] = (*variables)["type"]; - (*variables)["default"] = ImmutableDefaultValue(descriptor, name_resolver); - (*variables)["capitalized_type"] = - GetCapitalizedType(descriptor, /* immutable = */ true); - (*variables)["tag"] = - StrCat(static_cast(WireFormat::MakeTag(descriptor))); - (*variables)["tag_size"] = StrCat( - WireFormat::TagSize(descriptor->number(), GetType(descriptor))); - (*variables)["required"] = descriptor->is_required() ? "true" : "false"; - - std::string capitalized_type = UnderscoresToCamelCase( - PrimitiveTypeName(javaType), true /* cap_next_letter */); - switch (javaType) { - case JAVATYPE_INT: - case JAVATYPE_LONG: - case JAVATYPE_FLOAT: - case JAVATYPE_DOUBLE: - case JAVATYPE_BOOLEAN: - (*variables)["field_list_type"] = - "com.google.protobuf.Internal." + capitalized_type + "List"; - (*variables)["empty_list"] = "empty" + capitalized_type + "List()"; - (*variables)["make_name_unmodifiable"] = - (*variables)["name"] + "_.makeImmutable()"; - (*variables)["repeated_get"] = - (*variables)["name"] + "_.get" + capitalized_type; - (*variables)["repeated_add"] = - (*variables)["name"] + "_.add" + capitalized_type; - (*variables)["repeated_set"] = - (*variables)["name"] + "_.set" + capitalized_type; - (*variables)["visit_type"] = capitalized_type; - (*variables)["visit_type_list"] = "visit" + capitalized_type + "List"; - break; - default: - (*variables)["field_list_type"] = - "com.google.protobuf.Internal.ProtobufList<" + - (*variables)["boxed_type"] + ">"; - (*variables)["empty_list"] = "emptyProtobufList()"; - (*variables)["make_name_unmodifiable"] = - (*variables)["name"] + "_.makeImmutable()"; - (*variables)["repeated_get"] = (*variables)["name"] + "_.get"; - (*variables)["repeated_add"] = (*variables)["name"] + "_.add"; - (*variables)["repeated_set"] = (*variables)["name"] + "_.set"; - (*variables)["visit_type"] = "ByteString"; - (*variables)["visit_type_list"] = "visitList"; - } - - if (javaType == JAVATYPE_BYTES) { - (*variables)["bytes_default"] = - ToUpper((*variables)["name"]) + "_DEFAULT_VALUE"; - } - - if (IsReferenceType(javaType)) { - // We use `x.getClass()` as a null check because it generates less bytecode - // than an `if (x == null) { throw ... }` statement. - (*variables)["null_check"] = - " java.lang.Class valueClass = value.getClass();\n"; - } else { - (*variables)["null_check"] = ""; - } - // TODO(birdo): Add @deprecated javadoc when generating javadoc is supported - // by the proto compiler - (*variables)["deprecation"] = - descriptor->options().deprecated() ? "@java.lang.Deprecated " : ""; - (*variables)["kt_deprecation"] = - descriptor->options().deprecated() - ? "@kotlin.Deprecated(message = \"Field " + (*variables)["name"] + - " is deprecated\") " - : ""; - int fixed_size = FixedSize(GetType(descriptor)); - if (fixed_size != -1) { - (*variables)["fixed_size"] = StrCat(fixed_size); - } - - if (HasHasbit(descriptor)) { - // For singular messages and builders, one bit is used for the hasField bit. - (*variables)["get_has_field_bit_message"] = GenerateGetBit(messageBitIndex); - - // Note that these have a trailing ";". - (*variables)["set_has_field_bit_message"] = - GenerateSetBit(messageBitIndex) + ";"; - (*variables)["clear_has_field_bit_message"] = - GenerateClearBit(messageBitIndex) + ";"; - - (*variables)["is_field_present_message"] = GenerateGetBit(messageBitIndex); - } else { - (*variables)["set_has_field_bit_message"] = ""; - (*variables)["set_has_field_bit_message"] = ""; - (*variables)["clear_has_field_bit_message"] = ""; - - switch (descriptor->type()) { - case FieldDescriptor::TYPE_BYTES: - (*variables)["is_field_present_message"] = - "!" + (*variables)["name"] + "_.isEmpty()"; - break; - case FieldDescriptor::TYPE_FLOAT: - (*variables)["is_field_present_message"] = - "java.lang.Float.floatToRawIntBits(" + (*variables)["name"] + - "_) != 0"; - break; - case FieldDescriptor::TYPE_DOUBLE: - (*variables)["is_field_present_message"] = - "java.lang.Double.doubleToRawLongBits(" + (*variables)["name"] + - "_) != 0"; - break; - default: - (*variables)["is_field_present_message"] = - (*variables)["name"] + "_ != " + (*variables)["default"]; - break; - } - } - - (*variables)["get_has_field_bit_from_local"] = - GenerateGetBitFromLocal(builderBitIndex); - (*variables)["set_has_field_bit_to_local"] = - GenerateSetBitToLocal(messageBitIndex); -} - -} // namespace - -// =================================================================== - -ImmutablePrimitiveFieldLiteGenerator::ImmutablePrimitiveFieldLiteGenerator( - const FieldDescriptor* descriptor, int messageBitIndex, Context* context) - : descriptor_(descriptor), - messageBitIndex_(messageBitIndex), - name_resolver_(context->GetNameResolver()) { - SetPrimitiveVariables(descriptor, messageBitIndex, 0, - context->GetFieldGeneratorInfo(descriptor), - name_resolver_, &variables_); -} - -ImmutablePrimitiveFieldLiteGenerator::~ImmutablePrimitiveFieldLiteGenerator() {} - -int ImmutablePrimitiveFieldLiteGenerator::GetNumBitsForMessage() const { - return HasHasbit(descriptor_) ? 1 : 0; -} - -void ImmutablePrimitiveFieldLiteGenerator::GenerateInterfaceMembers( - io::Printer* printer) const { - if (HasHazzer(descriptor_)) { - WriteFieldAccessorDocComment(printer, descriptor_, HAZZER); - printer->Print(variables_, - "$deprecation$boolean has$capitalized_name$();\n"); - } - WriteFieldAccessorDocComment(printer, descriptor_, GETTER); - printer->Print(variables_, "$deprecation$$type$ get$capitalized_name$();\n"); -} - -void ImmutablePrimitiveFieldLiteGenerator::GenerateMembers( - io::Printer* printer) const { - if (IsByteStringWithCustomDefaultValue(descriptor_)) { - // allocate this once statically since we know ByteStrings are immutable - // values that can be reused. - printer->Print( - variables_, - "private static final $field_type$ $bytes_default$ = $default$;\n"); - } - printer->Print(variables_, "private $field_type$ $name$_;\n"); - PrintExtraFieldInfo(variables_, printer); - if (HasHazzer(descriptor_)) { - WriteFieldAccessorDocComment(printer, descriptor_, HAZZER); - printer->Print( - variables_, - "@java.lang.Override\n" - "$deprecation$public boolean ${$has$capitalized_name$$}$() {\n" - " return $get_has_field_bit_message$;\n" - "}\n"); - printer->Annotate("{", "}", descriptor_); - } - - WriteFieldAccessorDocComment(printer, descriptor_, GETTER); - printer->Print(variables_, - "@java.lang.Override\n" - "$deprecation$public $type$ ${$get$capitalized_name$$}$() {\n" - " return $name$_;\n" - "}\n"); - printer->Annotate("{", "}", descriptor_); - - WriteFieldAccessorDocComment(printer, descriptor_, SETTER); - printer->Print(variables_, - "private void set$capitalized_name$($type$ value) {\n" - "$null_check$" - " $set_has_field_bit_message$\n" - " $name$_ = value;\n" - "}\n"); - - WriteFieldAccessorDocComment(printer, descriptor_, CLEARER); - printer->Print(variables_, - "private void clear$capitalized_name$() {\n" - " $clear_has_field_bit_message$\n"); - JavaType type = GetJavaType(descriptor_); - if (type == JAVATYPE_STRING || type == JAVATYPE_BYTES) { - // The default value is not a simple literal so we want to avoid executing - // it multiple times. Instead, get the default out of the default instance. - printer->Print( - variables_, - " $name$_ = getDefaultInstance().get$capitalized_name$();\n"); - } else { - printer->Print(variables_, " $name$_ = $default$;\n"); - } - printer->Print(variables_, "}\n"); -} - -void ImmutablePrimitiveFieldLiteGenerator::GenerateBuilderMembers( - io::Printer* printer) const { - if (HasHazzer(descriptor_)) { - WriteFieldAccessorDocComment(printer, descriptor_, HAZZER); - printer->Print( - variables_, - "@java.lang.Override\n" - "$deprecation$public boolean ${$has$capitalized_name$$}$() {\n" - " return instance.has$capitalized_name$();\n" - "}\n"); - printer->Annotate("{", "}", descriptor_); - } - - WriteFieldAccessorDocComment(printer, descriptor_, GETTER); - printer->Print(variables_, - "@java.lang.Override\n" - "$deprecation$public $type$ ${$get$capitalized_name$$}$() {\n" - " return instance.get$capitalized_name$();\n" - "}\n"); - printer->Annotate("{", "}", descriptor_); - - WriteFieldAccessorDocComment(printer, descriptor_, SETTER, - /* builder */ true); - printer->Print(variables_, - "$deprecation$public Builder " - "${$set$capitalized_name$$}$($type$ value) {\n" - " copyOnWrite();\n" - " instance.set$capitalized_name$(value);\n" - " return this;\n" - "}\n"); - printer->Annotate("{", "}", descriptor_); - - WriteFieldAccessorDocComment(printer, descriptor_, CLEARER, - /* builder */ true); - printer->Print( - variables_, - "$deprecation$public Builder ${$clear$capitalized_name$$}$() {\n" - " copyOnWrite();\n" - " instance.clear$capitalized_name$();\n" - " return this;\n" - "}\n"); - printer->Annotate("{", "}", descriptor_); -} - -void ImmutablePrimitiveFieldLiteGenerator::GenerateKotlinDslMembers( - io::Printer* printer) const { - WriteFieldDocComment(printer, descriptor_); - printer->Print(variables_, - "$kt_deprecation$public var $kt_name$: $kt_type$\n" - " @JvmName(\"${$get$kt_capitalized_name$$}$\")\n" - " get() = $kt_dsl_builder$.${$get$capitalized_name$$}$()\n" - " @JvmName(\"${$set$kt_capitalized_name$$}$\")\n" - " set(value) {\n" - " $kt_dsl_builder$.${$set$capitalized_name$$}$(value)\n" - " }\n"); - - WriteFieldAccessorDocComment(printer, descriptor_, CLEARER, - /* builder */ false); - printer->Print(variables_, - "public fun ${$clear$kt_capitalized_name$$}$() {\n" - " $kt_dsl_builder$.${$clear$capitalized_name$$}$()\n" - "}\n"); - - if (HasHazzer(descriptor_)) { - WriteFieldAccessorDocComment(printer, descriptor_, HAZZER); - printer->Print( - variables_, - "public fun ${$has$kt_capitalized_name$$}$(): kotlin.Boolean {\n" - " return $kt_dsl_builder$.${$has$capitalized_name$$}$()\n" - "}\n"); - } -} - -void ImmutablePrimitiveFieldLiteGenerator::GenerateFieldInfo( - io::Printer* printer, std::vector* output) const { - WriteIntToUtf16CharSequence(descriptor_->number(), output); - WriteIntToUtf16CharSequence(GetExperimentalJavaFieldType(descriptor_), - output); - if (HasHasbit(descriptor_)) { - WriteIntToUtf16CharSequence(messageBitIndex_, output); - } - printer->Print(variables_, "\"$name$_\",\n"); -} - -void ImmutablePrimitiveFieldLiteGenerator::GenerateInitializationCode( - io::Printer* printer) const { - if (IsByteStringWithCustomDefaultValue(descriptor_)) { - printer->Print(variables_, "$name$_ = $bytes_default$;\n"); - } else if (!IsDefaultValueJavaDefault(descriptor_)) { - printer->Print(variables_, "$name$_ = $default$;\n"); - } -} - -std::string ImmutablePrimitiveFieldLiteGenerator::GetBoxedType() const { - return BoxedPrimitiveTypeName(GetJavaType(descriptor_)); -} - -// =================================================================== - -ImmutablePrimitiveOneofFieldLiteGenerator:: - ImmutablePrimitiveOneofFieldLiteGenerator(const FieldDescriptor* descriptor, - int messageBitIndex, - Context* context) - : ImmutablePrimitiveFieldLiteGenerator(descriptor, messageBitIndex, - context) { - const OneofGeneratorInfo* info = - context->GetOneofGeneratorInfo(descriptor->containing_oneof()); - SetCommonOneofVariables(descriptor, info, &variables_); -} - -ImmutablePrimitiveOneofFieldLiteGenerator:: - ~ImmutablePrimitiveOneofFieldLiteGenerator() {} - -void ImmutablePrimitiveOneofFieldLiteGenerator::GenerateMembers( - io::Printer* printer) const { - PrintExtraFieldInfo(variables_, printer); - GOOGLE_DCHECK(HasHazzer(descriptor_)); - WriteFieldAccessorDocComment(printer, descriptor_, HAZZER); - printer->Print(variables_, - "@java.lang.Override\n" - "$deprecation$public boolean ${$has$capitalized_name$$}$() {\n" - " return $has_oneof_case_message$;\n" - "}\n"); - printer->Annotate("{", "}", descriptor_); - - WriteFieldAccessorDocComment(printer, descriptor_, GETTER); - printer->Print(variables_, - "@java.lang.Override\n" - "$deprecation$public $type$ ${$get$capitalized_name$$}$() {\n" - " if ($has_oneof_case_message$) {\n" - " return ($boxed_type$) $oneof_name$_;\n" - " }\n" - " return $default$;\n" - "}\n"); - printer->Annotate("{", "}", descriptor_); - - WriteFieldAccessorDocComment(printer, descriptor_, SETTER); - printer->Print(variables_, - "private void set$capitalized_name$($type$ value) {\n" - "$null_check$" - " $set_oneof_case_message$;\n" - " $oneof_name$_ = value;\n" - "}\n"); - - WriteFieldAccessorDocComment(printer, descriptor_, CLEARER); - printer->Print(variables_, - "private void clear$capitalized_name$() {\n" - " if ($has_oneof_case_message$) {\n" - " $clear_oneof_case_message$;\n" - " $oneof_name$_ = null;\n" - " }\n" - "}\n"); -} - -void ImmutablePrimitiveOneofFieldLiteGenerator::GenerateFieldInfo( - io::Printer* printer, std::vector* output) const { - WriteIntToUtf16CharSequence(descriptor_->number(), output); - WriteIntToUtf16CharSequence(GetExperimentalJavaFieldType(descriptor_), - output); - WriteIntToUtf16CharSequence(descriptor_->containing_oneof()->index(), output); -} - -void ImmutablePrimitiveOneofFieldLiteGenerator::GenerateBuilderMembers( - io::Printer* printer) const { - GOOGLE_DCHECK(HasHazzer(descriptor_)); - WriteFieldAccessorDocComment(printer, descriptor_, HAZZER); - printer->Print(variables_, - "@java.lang.Override\n" - "$deprecation$public boolean ${$has$capitalized_name$$}$() {\n" - " return instance.has$capitalized_name$();\n" - "}\n"); - printer->Annotate("{", "}", descriptor_); - - WriteFieldAccessorDocComment(printer, descriptor_, GETTER); - printer->Print(variables_, - "@java.lang.Override\n" - "$deprecation$public $type$ ${$get$capitalized_name$$}$() {\n" - " return instance.get$capitalized_name$();\n" - "}\n"); - printer->Annotate("{", "}", descriptor_); - - WriteFieldAccessorDocComment(printer, descriptor_, SETTER, - /* builder */ true); - printer->Print(variables_, - "$deprecation$public Builder " - "${$set$capitalized_name$$}$($type$ value) {\n" - " copyOnWrite();\n" - " instance.set$capitalized_name$(value);\n" - " return this;\n" - "}\n"); - printer->Annotate("{", "}", descriptor_); - - WriteFieldAccessorDocComment(printer, descriptor_, CLEARER, - /* builder */ true); - printer->Print( - variables_, - "$deprecation$public Builder ${$clear$capitalized_name$$}$() {\n" - " copyOnWrite();\n" - " instance.clear$capitalized_name$();\n" - " return this;\n" - "}\n"); - printer->Annotate("{", "}", descriptor_); -} - -// =================================================================== - -RepeatedImmutablePrimitiveFieldLiteGenerator:: - RepeatedImmutablePrimitiveFieldLiteGenerator( - const FieldDescriptor* descriptor, int messageBitIndex, - Context* context) - : descriptor_(descriptor), - context_(context), - name_resolver_(context->GetNameResolver()) { - SetPrimitiveVariables(descriptor, messageBitIndex, 0, - context->GetFieldGeneratorInfo(descriptor), - name_resolver_, &variables_); -} - -RepeatedImmutablePrimitiveFieldLiteGenerator:: - ~RepeatedImmutablePrimitiveFieldLiteGenerator() {} - -int RepeatedImmutablePrimitiveFieldLiteGenerator::GetNumBitsForMessage() const { - return 0; -} - -void RepeatedImmutablePrimitiveFieldLiteGenerator::GenerateInterfaceMembers( - io::Printer* printer) const { - WriteFieldAccessorDocComment(printer, descriptor_, LIST_GETTER); - printer->Print(variables_, - "$deprecation$java.util.List<$boxed_type$> " - "get$capitalized_name$List();\n"); - WriteFieldAccessorDocComment(printer, descriptor_, LIST_COUNT); - printer->Print(variables_, - "$deprecation$int get$capitalized_name$Count();\n"); - WriteFieldAccessorDocComment(printer, descriptor_, LIST_INDEXED_GETTER); - printer->Print(variables_, - "$deprecation$$type$ get$capitalized_name$(int index);\n"); -} - -void RepeatedImmutablePrimitiveFieldLiteGenerator::GenerateMembers( - io::Printer* printer) const { - printer->Print(variables_, "private $field_list_type$ $name$_;\n"); - PrintExtraFieldInfo(variables_, printer); - WriteFieldAccessorDocComment(printer, descriptor_, LIST_GETTER); - printer->Print(variables_, - "@java.lang.Override\n" - "$deprecation$public java.util.List<$boxed_type$>\n" - " ${$get$capitalized_name$List$}$() {\n" - " return $name$_;\n" // note: unmodifiable list - "}\n"); - printer->Annotate("{", "}", descriptor_); - WriteFieldAccessorDocComment(printer, descriptor_, LIST_COUNT); - printer->Print( - variables_, - "@java.lang.Override\n" - "$deprecation$public int ${$get$capitalized_name$Count$}$() {\n" - " return $name$_.size();\n" - "}\n"); - printer->Annotate("{", "}", descriptor_); - WriteFieldAccessorDocComment(printer, descriptor_, LIST_INDEXED_GETTER); - printer->Print( - variables_, - "@java.lang.Override\n" - "$deprecation$public $type$ ${$get$capitalized_name$$}$(int index) {\n" - " return $repeated_get$(index);\n" - "}\n"); - printer->Annotate("{", "}", descriptor_); - - if (!EnableExperimentalRuntimeForLite() && descriptor_->is_packed() && - context_->HasGeneratedMethods(descriptor_->containing_type())) { - printer->Print(variables_, - "private int $name$MemoizedSerializedSize = -1;\n"); - } - - printer->Print( - variables_, - "private void ensure$capitalized_name$IsMutable() {\n" - // Use a temporary to avoid a redundant iget-object. - " $field_list_type$ tmp = $name$_;\n" - " if (!tmp.isModifiable()) {\n" - " $name$_ =\n" - " com.google.protobuf.GeneratedMessageLite.mutableCopy(tmp);\n" - " }\n" - "}\n"); - - WriteFieldAccessorDocComment(printer, descriptor_, LIST_INDEXED_SETTER); - printer->Print(variables_, - "private void set$capitalized_name$(\n" - " int index, $type$ value) {\n" - "$null_check$" - " ensure$capitalized_name$IsMutable();\n" - " $repeated_set$(index, value);\n" - "}\n"); - WriteFieldAccessorDocComment(printer, descriptor_, LIST_ADDER); - printer->Print(variables_, - "private void add$capitalized_name$($type$ value) {\n" - "$null_check$" - " ensure$capitalized_name$IsMutable();\n" - " $repeated_add$(value);\n" - "}\n"); - WriteFieldAccessorDocComment(printer, descriptor_, LIST_MULTI_ADDER); - printer->Print(variables_, - "private void addAll$capitalized_name$(\n" - " java.lang.Iterable values) {\n" - " ensure$capitalized_name$IsMutable();\n" - " com.google.protobuf.AbstractMessageLite.addAll(\n" - " values, $name$_);\n" - "}\n"); - WriteFieldAccessorDocComment(printer, descriptor_, CLEARER); - printer->Print(variables_, - "private void clear$capitalized_name$() {\n" - " $name$_ = $empty_list$;\n" - "}\n"); -} - -void RepeatedImmutablePrimitiveFieldLiteGenerator::GenerateBuilderMembers( - io::Printer* printer) const { - WriteFieldAccessorDocComment(printer, descriptor_, LIST_GETTER); - printer->Print(variables_, - "@java.lang.Override\n" - "$deprecation$public java.util.List<$boxed_type$>\n" - " ${$get$capitalized_name$List$}$() {\n" - " return java.util.Collections.unmodifiableList(\n" - " instance.get$capitalized_name$List());\n" - "}\n"); - printer->Annotate("{", "}", descriptor_); - WriteFieldAccessorDocComment(printer, descriptor_, LIST_COUNT); - printer->Print( - variables_, - "@java.lang.Override\n" - "$deprecation$public int ${$get$capitalized_name$Count$}$() {\n" - " return instance.get$capitalized_name$Count();\n" - "}\n"); - printer->Annotate("{", "}", descriptor_); - WriteFieldAccessorDocComment(printer, descriptor_, LIST_INDEXED_GETTER); - printer->Print( - variables_, - "@java.lang.Override\n" - "$deprecation$public $type$ ${$get$capitalized_name$$}$(int index) {\n" - " return instance.get$capitalized_name$(index);\n" - "}\n"); - printer->Annotate("{", "}", descriptor_); - WriteFieldAccessorDocComment(printer, descriptor_, SETTER, - /* builder */ true); - printer->Print(variables_, - "$deprecation$public Builder ${$set$capitalized_name$$}$(\n" - " int index, $type$ value) {\n" - " copyOnWrite();\n" - " instance.set$capitalized_name$(index, value);\n" - " return this;\n" - "}\n"); - printer->Annotate("{", "}", descriptor_); - WriteFieldAccessorDocComment(printer, descriptor_, LIST_ADDER, - /* builder */ true); - printer->Print(variables_, - "$deprecation$public Builder " - "${$add$capitalized_name$$}$($type$ value) {\n" - " copyOnWrite();\n" - " instance.add$capitalized_name$(value);\n" - " return this;\n" - "}\n"); - printer->Annotate("{", "}", descriptor_); - WriteFieldAccessorDocComment(printer, descriptor_, LIST_MULTI_ADDER, - /* builder */ true); - printer->Print(variables_, - "$deprecation$public Builder ${$addAll$capitalized_name$$}$(\n" - " java.lang.Iterable values) {\n" - " copyOnWrite();\n" - " instance.addAll$capitalized_name$(values);\n" - " return this;\n" - "}\n"); - printer->Annotate("{", "}", descriptor_); - WriteFieldAccessorDocComment(printer, descriptor_, CLEARER, - /* builder */ true); - printer->Print( - variables_, - "$deprecation$public Builder ${$clear$capitalized_name$$}$() {\n" - " copyOnWrite();\n" - " instance.clear$capitalized_name$();\n" - " return this;\n" - "}\n"); - printer->Annotate("{", "}", descriptor_); -} - -void RepeatedImmutablePrimitiveFieldLiteGenerator::GenerateKotlinDslMembers( - io::Printer* printer) const { - printer->Print( - variables_, - "/**\n" - " * An uninstantiable, behaviorless type to represent the field in\n" - " * generics.\n" - " */\n" - "@kotlin.OptIn" - "(com.google.protobuf.kotlin.OnlyForUseByGeneratedProtoCode::class)\n" - "public class ${$$kt_capitalized_name$Proxy$}$ private constructor()" - " : com.google.protobuf.kotlin.DslProxy()\n"); - - WriteFieldDocComment(printer, descriptor_); - printer->Print(variables_, - "$kt_deprecation$ public val $kt_name$: " - "com.google.protobuf.kotlin.DslList" - "<$kt_type$, ${$$kt_capitalized_name$Proxy$}$>\n" - " @kotlin.jvm.JvmSynthetic\n" - " get() = com.google.protobuf.kotlin.DslList(\n" - " $kt_dsl_builder$.${$get$capitalized_name$List$}$()\n" - " )\n"); - - WriteFieldAccessorDocComment(printer, descriptor_, LIST_ADDER, - /* builder */ false); - printer->Print(variables_, - "@kotlin.jvm.JvmSynthetic\n" - "@kotlin.jvm.JvmName(\"add$kt_capitalized_name$\")\n" - "public fun com.google.protobuf.kotlin.DslList" - "<$kt_type$, ${$$kt_capitalized_name$Proxy$}$>." - "add(value: $kt_type$) {\n" - " $kt_dsl_builder$.${$add$capitalized_name$$}$(value)\n" - "}"); - - WriteFieldAccessorDocComment(printer, descriptor_, LIST_ADDER, - /* builder */ false); - printer->Print(variables_, - "@kotlin.jvm.JvmSynthetic\n" - "@kotlin.jvm.JvmName(\"plusAssign$kt_capitalized_name$\")\n" - "@Suppress(\"NOTHING_TO_INLINE\")\n" - "public inline operator fun com.google.protobuf.kotlin.DslList" - "<$kt_type$, ${$$kt_capitalized_name$Proxy$}$>." - "plusAssign(value: $kt_type$) {\n" - " add(value)\n" - "}"); - - WriteFieldAccessorDocComment(printer, descriptor_, LIST_MULTI_ADDER, - /* builder */ false); - printer->Print(variables_, - "@kotlin.jvm.JvmSynthetic\n" - "@kotlin.jvm.JvmName(\"addAll$kt_capitalized_name$\")\n" - "public fun com.google.protobuf.kotlin.DslList" - "<$kt_type$, ${$$kt_capitalized_name$Proxy$}$>." - "addAll(values: kotlin.collections.Iterable<$kt_type$>) {\n" - " $kt_dsl_builder$.${$addAll$capitalized_name$$}$(values)\n" - "}"); - - WriteFieldAccessorDocComment(printer, descriptor_, LIST_MULTI_ADDER, - /* builder */ false); - printer->Print( - variables_, - "@kotlin.jvm.JvmSynthetic\n" - "@kotlin.jvm.JvmName(\"plusAssignAll$kt_capitalized_name$\")\n" - "@Suppress(\"NOTHING_TO_INLINE\")\n" - "public inline operator fun com.google.protobuf.kotlin.DslList" - "<$kt_type$, ${$$kt_capitalized_name$Proxy$}$>." - "plusAssign(values: kotlin.collections.Iterable<$kt_type$>) {\n" - " addAll(values)\n" - "}"); - - WriteFieldAccessorDocComment(printer, descriptor_, LIST_INDEXED_SETTER, - /* builder */ false); - printer->Print( - variables_, - "@kotlin.jvm.JvmSynthetic\n" - "@kotlin.jvm.JvmName(\"set$kt_capitalized_name$\")\n" - "public operator fun com.google.protobuf.kotlin.DslList" - "<$kt_type$, ${$$kt_capitalized_name$Proxy$}$>." - "set(index: kotlin.Int, value: $kt_type$) {\n" - " $kt_dsl_builder$.${$set$capitalized_name$$}$(index, value)\n" - "}"); - - WriteFieldAccessorDocComment(printer, descriptor_, CLEARER, - /* builder */ false); - printer->Print(variables_, - "@kotlin.jvm.JvmSynthetic\n" - "@kotlin.jvm.JvmName(\"clear$kt_capitalized_name$\")\n" - "public fun com.google.protobuf.kotlin.DslList" - "<$kt_type$, ${$$kt_capitalized_name$Proxy$}$>." - "clear() {\n" - " $kt_dsl_builder$.${$clear$capitalized_name$$}$()\n" - "}"); -} - -void RepeatedImmutablePrimitiveFieldLiteGenerator::GenerateFieldInfo( - io::Printer* printer, std::vector* output) const { - WriteIntToUtf16CharSequence(descriptor_->number(), output); - WriteIntToUtf16CharSequence(GetExperimentalJavaFieldType(descriptor_), - output); - printer->Print(variables_, "\"$name$_\",\n"); -} - -void RepeatedImmutablePrimitiveFieldLiteGenerator::GenerateInitializationCode( - io::Printer* printer) const { - printer->Print(variables_, "$name$_ = $empty_list$;\n"); -} - -std::string RepeatedImmutablePrimitiveFieldLiteGenerator::GetBoxedType() const { - return BoxedPrimitiveTypeName(GetJavaType(descriptor_)); -} - -} // namespace java -} // namespace compiler -} // namespace protobuf -} // namespace google diff --git a/extra/protobuf/protobuf-3.19.4/src/google/protobuf/compiler/java/java_primitive_field_lite.h b/extra/protobuf/protobuf-3.19.4/src/google/protobuf/compiler/java/java_primitive_field_lite.h deleted file mode 100644 index dfafae392180..000000000000 --- a/extra/protobuf/protobuf-3.19.4/src/google/protobuf/compiler/java/java_primitive_field_lite.h +++ /dev/null @@ -1,141 +0,0 @@ -// Protocol Buffers - Google's data interchange format -// Copyright 2008 Google Inc. All rights reserved. -// https://developers.google.com/protocol-buffers/ -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// * Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// * Redistributions in binary form must reproduce the above -// copyright notice, this list of conditions and the following disclaimer -// in the documentation and/or other materials provided with the -// distribution. -// * Neither the name of Google Inc. nor the names of its -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -// Author: kenton@google.com (Kenton Varda) -// Based on original Protocol Buffers design by -// Sanjay Ghemawat, Jeff Dean, and others. - -#ifndef GOOGLE_PROTOBUF_COMPILER_JAVA_PRIMITIVE_FIELD_LITE_H__ -#define GOOGLE_PROTOBUF_COMPILER_JAVA_PRIMITIVE_FIELD_LITE_H__ - -#include -#include -#include - -#include - -namespace google { -namespace protobuf { -namespace compiler { -namespace java { -class Context; // context.h -class ClassNameResolver; // name_resolver.h -} // namespace java -} // namespace compiler -} // namespace protobuf -} // namespace google - -namespace google { -namespace protobuf { -namespace compiler { -namespace java { - -class ImmutablePrimitiveFieldLiteGenerator - : public ImmutableFieldLiteGenerator { - public: - explicit ImmutablePrimitiveFieldLiteGenerator( - const FieldDescriptor* descriptor, int messageBitIndex, Context* context); - ~ImmutablePrimitiveFieldLiteGenerator() override; - - // implements ImmutableFieldLiteGenerator - // ------------------------------------ - int GetNumBitsForMessage() const override; - void GenerateInterfaceMembers(io::Printer* printer) const override; - void GenerateMembers(io::Printer* printer) const override; - void GenerateBuilderMembers(io::Printer* printer) const override; - void GenerateInitializationCode(io::Printer* printer) const override; - void GenerateFieldInfo(io::Printer* printer, - std::vector* output) const override; - void GenerateKotlinDslMembers(io::Printer* printer) const override; - - std::string GetBoxedType() const override; - - protected: - const FieldDescriptor* descriptor_; - std::map variables_; - const int messageBitIndex_; - ClassNameResolver* name_resolver_; - - private: - GOOGLE_DISALLOW_EVIL_CONSTRUCTORS(ImmutablePrimitiveFieldLiteGenerator); -}; - -class ImmutablePrimitiveOneofFieldLiteGenerator - : public ImmutablePrimitiveFieldLiteGenerator { - public: - ImmutablePrimitiveOneofFieldLiteGenerator(const FieldDescriptor* descriptor, - int messageBitIndex, - Context* context); - ~ImmutablePrimitiveOneofFieldLiteGenerator(); - - void GenerateMembers(io::Printer* printer) const override; - void GenerateBuilderMembers(io::Printer* printer) const override; - - void GenerateFieldInfo(io::Printer* printer, - std::vector* output) const override; - - private: - GOOGLE_DISALLOW_EVIL_CONSTRUCTORS(ImmutablePrimitiveOneofFieldLiteGenerator); -}; - -class RepeatedImmutablePrimitiveFieldLiteGenerator - : public ImmutableFieldLiteGenerator { - public: - explicit RepeatedImmutablePrimitiveFieldLiteGenerator( - const FieldDescriptor* descriptor, int messageBitIndex, Context* context); - ~RepeatedImmutablePrimitiveFieldLiteGenerator() override; - - // implements ImmutableFieldLiteGenerator ------------------------------------ - int GetNumBitsForMessage() const override; - void GenerateInterfaceMembers(io::Printer* printer) const override; - void GenerateMembers(io::Printer* printer) const override; - void GenerateBuilderMembers(io::Printer* printer) const override; - void GenerateInitializationCode(io::Printer* printer) const override; - void GenerateFieldInfo(io::Printer* printer, - std::vector* output) const override; - void GenerateKotlinDslMembers(io::Printer* printer) const override; - - std::string GetBoxedType() const override; - - private: - const FieldDescriptor* descriptor_; - std::map variables_; - Context* context_; - ClassNameResolver* name_resolver_; - - GOOGLE_DISALLOW_EVIL_CONSTRUCTORS(RepeatedImmutablePrimitiveFieldLiteGenerator); -}; - -} // namespace java -} // namespace compiler -} // namespace protobuf -} // namespace google - -#endif // GOOGLE_PROTOBUF_COMPILER_JAVA_PRIMITIVE_FIELD_LITE_H__ diff --git a/extra/protobuf/protobuf-3.19.4/src/google/protobuf/compiler/java/java_service.cc b/extra/protobuf/protobuf-3.19.4/src/google/protobuf/compiler/java/java_service.cc deleted file mode 100644 index e30d155e47eb..000000000000 --- a/extra/protobuf/protobuf-3.19.4/src/google/protobuf/compiler/java/java_service.cc +++ /dev/null @@ -1,474 +0,0 @@ -// Protocol Buffers - Google's data interchange format -// Copyright 2008 Google Inc. All rights reserved. -// https://developers.google.com/protocol-buffers/ -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// * Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// * Redistributions in binary form must reproduce the above -// copyright notice, this list of conditions and the following disclaimer -// in the documentation and/or other materials provided with the -// distribution. -// * Neither the name of Google Inc. nor the names of its -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -// Author: kenton@google.com (Kenton Varda) -// Based on original Protocol Buffers design by -// Sanjay Ghemawat, Jeff Dean, and others. - -#include - -#include -#include -#include -#include -#include -#include - -namespace google { -namespace protobuf { -namespace compiler { -namespace java { - -ServiceGenerator::ServiceGenerator(const ServiceDescriptor* descriptor) - : descriptor_(descriptor) {} - -ServiceGenerator::~ServiceGenerator() {} - -// =================================================================== -ImmutableServiceGenerator::ImmutableServiceGenerator( - const ServiceDescriptor* descriptor, Context* context) - : ServiceGenerator(descriptor), - context_(context), - name_resolver_(context->GetNameResolver()) {} - -ImmutableServiceGenerator::~ImmutableServiceGenerator() {} - -void ImmutableServiceGenerator::Generate(io::Printer* printer) { - bool is_own_file = IsOwnFile(descriptor_, /* immutable = */ true); - WriteServiceDocComment(printer, descriptor_); - MaybePrintGeneratedAnnotation(context_, printer, descriptor_, - /* immutable = */ true); - printer->Print( - "public $static$ abstract class $classname$\n" - " implements com.google.protobuf.Service {\n", - "static", is_own_file ? "" : "static", "classname", descriptor_->name()); - printer->Indent(); - - printer->Print("protected $classname$() {}\n\n", "classname", - descriptor_->name()); - - GenerateInterface(printer); - - GenerateNewReflectiveServiceMethod(printer); - GenerateNewReflectiveBlockingServiceMethod(printer); - - GenerateAbstractMethods(printer); - - // Generate getDescriptor() and getDescriptorForType(). - printer->Print( - "public static final\n" - " com.google.protobuf.Descriptors.ServiceDescriptor\n" - " getDescriptor() {\n" - " return $file$.getDescriptor().getServices().get($index$);\n" - "}\n", - "file", name_resolver_->GetImmutableClassName(descriptor_->file()), - "index", StrCat(descriptor_->index())); - GenerateGetDescriptorForType(printer); - - // Generate more stuff. - GenerateCallMethod(printer); - GenerateGetPrototype(REQUEST, printer); - GenerateGetPrototype(RESPONSE, printer); - GenerateStub(printer); - GenerateBlockingStub(printer); - - // Add an insertion point. - printer->Print( - "\n" - "// @@protoc_insertion_point(class_scope:$full_name$)\n", - "full_name", descriptor_->full_name()); - - printer->Outdent(); - printer->Print("}\n\n"); -} - -void ImmutableServiceGenerator::GenerateGetDescriptorForType( - io::Printer* printer) { - printer->Print( - "public final com.google.protobuf.Descriptors.ServiceDescriptor\n" - " getDescriptorForType() {\n" - " return getDescriptor();\n" - "}\n"); -} - -void ImmutableServiceGenerator::GenerateInterface(io::Printer* printer) { - printer->Print("public interface Interface {\n"); - printer->Indent(); - GenerateAbstractMethods(printer); - printer->Outdent(); - printer->Print("}\n\n"); -} - -void ImmutableServiceGenerator::GenerateNewReflectiveServiceMethod( - io::Printer* printer) { - printer->Print( - "public static com.google.protobuf.Service newReflectiveService(\n" - " final Interface impl) {\n" - " return new $classname$() {\n", - "classname", descriptor_->name()); - printer->Indent(); - printer->Indent(); - - for (int i = 0; i < descriptor_->method_count(); i++) { - const MethodDescriptor* method = descriptor_->method(i); - printer->Print("@java.lang.Override\n"); - GenerateMethodSignature(printer, method, IS_CONCRETE); - printer->Print( - " {\n" - " impl.$method$(controller, request, done);\n" - "}\n\n", - "method", UnderscoresToCamelCase(method)); - } - - printer->Outdent(); - printer->Print("};\n"); - printer->Outdent(); - printer->Print("}\n\n"); -} - -void ImmutableServiceGenerator::GenerateNewReflectiveBlockingServiceMethod( - io::Printer* printer) { - printer->Print( - "public static com.google.protobuf.BlockingService\n" - " newReflectiveBlockingService(final BlockingInterface impl) {\n" - " return new com.google.protobuf.BlockingService() {\n"); - printer->Indent(); - printer->Indent(); - - GenerateGetDescriptorForType(printer); - - GenerateCallBlockingMethod(printer); - GenerateGetPrototype(REQUEST, printer); - GenerateGetPrototype(RESPONSE, printer); - - printer->Outdent(); - printer->Print("};\n"); - printer->Outdent(); - printer->Print("}\n\n"); -} - -void ImmutableServiceGenerator::GenerateAbstractMethods(io::Printer* printer) { - for (int i = 0; i < descriptor_->method_count(); i++) { - const MethodDescriptor* method = descriptor_->method(i); - WriteMethodDocComment(printer, method); - GenerateMethodSignature(printer, method, IS_ABSTRACT); - printer->Print(";\n\n"); - } -} - -std::string ImmutableServiceGenerator::GetOutput( - const MethodDescriptor* method) { - return name_resolver_->GetImmutableClassName(method->output_type()); -} - -void ImmutableServiceGenerator::GenerateCallMethod(io::Printer* printer) { - printer->Print( - "\n" - "public final void callMethod(\n" - " com.google.protobuf.Descriptors.MethodDescriptor method,\n" - " com.google.protobuf.RpcController controller,\n" - " com.google.protobuf.Message request,\n" - " com.google.protobuf.RpcCallback<\n" - " com.google.protobuf.Message> done) {\n" - " if (method.getService() != getDescriptor()) {\n" - " throw new java.lang.IllegalArgumentException(\n" - " \"Service.callMethod() given method descriptor for wrong \" +\n" - " \"service type.\");\n" - " }\n" - " switch(method.getIndex()) {\n"); - printer->Indent(); - printer->Indent(); - - for (int i = 0; i < descriptor_->method_count(); i++) { - const MethodDescriptor* method = descriptor_->method(i); - std::map vars; - vars["index"] = StrCat(i); - vars["method"] = UnderscoresToCamelCase(method); - vars["input"] = name_resolver_->GetImmutableClassName(method->input_type()); - vars["output"] = GetOutput(method); - printer->Print( - vars, - "case $index$:\n" - " this.$method$(controller, ($input$)request,\n" - " com.google.protobuf.RpcUtil.<$output$>specializeCallback(\n" - " done));\n" - " return;\n"); - } - - printer->Print( - "default:\n" - " throw new java.lang.AssertionError(\"Can't get here.\");\n"); - - printer->Outdent(); - printer->Outdent(); - - printer->Print( - " }\n" - "}\n" - "\n"); -} - -void ImmutableServiceGenerator::GenerateCallBlockingMethod( - io::Printer* printer) { - printer->Print( - "\n" - "public final com.google.protobuf.Message callBlockingMethod(\n" - " com.google.protobuf.Descriptors.MethodDescriptor method,\n" - " com.google.protobuf.RpcController controller,\n" - " com.google.protobuf.Message request)\n" - " throws com.google.protobuf.ServiceException {\n" - " if (method.getService() != getDescriptor()) {\n" - " throw new java.lang.IllegalArgumentException(\n" - " \"Service.callBlockingMethod() given method descriptor for \" +\n" - " \"wrong service type.\");\n" - " }\n" - " switch(method.getIndex()) {\n"); - printer->Indent(); - printer->Indent(); - - for (int i = 0; i < descriptor_->method_count(); i++) { - const MethodDescriptor* method = descriptor_->method(i); - std::map vars; - vars["index"] = StrCat(i); - vars["method"] = UnderscoresToCamelCase(method); - vars["input"] = name_resolver_->GetImmutableClassName(method->input_type()); - vars["output"] = GetOutput(method); - printer->Print(vars, - "case $index$:\n" - " return impl.$method$(controller, ($input$)request);\n"); - } - - printer->Print( - "default:\n" - " throw new java.lang.AssertionError(\"Can't get here.\");\n"); - - printer->Outdent(); - printer->Outdent(); - - printer->Print( - " }\n" - "}\n" - "\n"); -} - -void ImmutableServiceGenerator::GenerateGetPrototype(RequestOrResponse which, - io::Printer* printer) { - /* - * TODO(cpovirk): The exception message says "Service.foo" when it may be - * "BlockingService.foo." Consider fixing. - */ - printer->Print( - "public final com.google.protobuf.Message\n" - " get$request_or_response$Prototype(\n" - " com.google.protobuf.Descriptors.MethodDescriptor method) {\n" - " if (method.getService() != getDescriptor()) {\n" - " throw new java.lang.IllegalArgumentException(\n" - " \"Service.get$request_or_response$Prototype() given method \" +\n" - " \"descriptor for wrong service type.\");\n" - " }\n" - " switch(method.getIndex()) {\n", - "request_or_response", (which == REQUEST) ? "Request" : "Response"); - printer->Indent(); - printer->Indent(); - - for (int i = 0; i < descriptor_->method_count(); i++) { - const MethodDescriptor* method = descriptor_->method(i); - std::map vars; - vars["index"] = StrCat(i); - vars["type"] = - (which == REQUEST) - ? name_resolver_->GetImmutableClassName(method->input_type()) - : GetOutput(method); - printer->Print(vars, - "case $index$:\n" - " return $type$.getDefaultInstance();\n"); - } - - printer->Print( - "default:\n" - " throw new java.lang.AssertionError(\"Can't get here.\");\n"); - - printer->Outdent(); - printer->Outdent(); - - printer->Print( - " }\n" - "}\n" - "\n"); -} - -void ImmutableServiceGenerator::GenerateStub(io::Printer* printer) { - printer->Print( - "public static Stub newStub(\n" - " com.google.protobuf.RpcChannel channel) {\n" - " return new Stub(channel);\n" - "}\n" - "\n" - "public static final class Stub extends $classname$ implements Interface " - "{" - "\n", - "classname", name_resolver_->GetImmutableClassName(descriptor_)); - printer->Indent(); - - printer->Print( - "private Stub(com.google.protobuf.RpcChannel channel) {\n" - " this.channel = channel;\n" - "}\n" - "\n" - "private final com.google.protobuf.RpcChannel channel;\n" - "\n" - "public com.google.protobuf.RpcChannel getChannel() {\n" - " return channel;\n" - "}\n"); - - for (int i = 0; i < descriptor_->method_count(); i++) { - const MethodDescriptor* method = descriptor_->method(i); - printer->Print("\n"); - GenerateMethodSignature(printer, method, IS_CONCRETE); - printer->Print(" {\n"); - printer->Indent(); - - std::map vars; - vars["index"] = StrCat(i); - vars["output"] = GetOutput(method); - printer->Print(vars, - "channel.callMethod(\n" - " getDescriptor().getMethods().get($index$),\n" - " controller,\n" - " request,\n" - " $output$.getDefaultInstance(),\n" - " com.google.protobuf.RpcUtil.generalizeCallback(\n" - " done,\n" - " $output$.class,\n" - " $output$.getDefaultInstance()));\n"); - - printer->Outdent(); - printer->Print("}\n"); - } - - printer->Outdent(); - printer->Print( - "}\n" - "\n"); -} - -void ImmutableServiceGenerator::GenerateBlockingStub(io::Printer* printer) { - printer->Print( - "public static BlockingInterface newBlockingStub(\n" - " com.google.protobuf.BlockingRpcChannel channel) {\n" - " return new BlockingStub(channel);\n" - "}\n" - "\n"); - - printer->Print("public interface BlockingInterface {"); - printer->Indent(); - - for (int i = 0; i < descriptor_->method_count(); i++) { - const MethodDescriptor* method = descriptor_->method(i); - GenerateBlockingMethodSignature(printer, method); - printer->Print(";\n"); - } - - printer->Outdent(); - printer->Print( - "}\n" - "\n"); - - printer->Print( - "private static final class BlockingStub implements BlockingInterface " - "{\n"); - printer->Indent(); - - printer->Print( - "private BlockingStub(com.google.protobuf.BlockingRpcChannel channel) {\n" - " this.channel = channel;\n" - "}\n" - "\n" - "private final com.google.protobuf.BlockingRpcChannel channel;\n"); - - for (int i = 0; i < descriptor_->method_count(); i++) { - const MethodDescriptor* method = descriptor_->method(i); - GenerateBlockingMethodSignature(printer, method); - printer->Print(" {\n"); - printer->Indent(); - - std::map vars; - vars["index"] = StrCat(i); - vars["output"] = GetOutput(method); - printer->Print(vars, - "return ($output$) channel.callBlockingMethod(\n" - " getDescriptor().getMethods().get($index$),\n" - " controller,\n" - " request,\n" - " $output$.getDefaultInstance());\n"); - - printer->Outdent(); - printer->Print( - "}\n" - "\n"); - } - - printer->Outdent(); - printer->Print("}\n"); -} - -void ImmutableServiceGenerator::GenerateMethodSignature( - io::Printer* printer, const MethodDescriptor* method, - IsAbstract is_abstract) { - std::map vars; - vars["name"] = UnderscoresToCamelCase(method); - vars["input"] = name_resolver_->GetImmutableClassName(method->input_type()); - vars["output"] = GetOutput(method); - vars["abstract"] = (is_abstract == IS_ABSTRACT) ? "abstract" : ""; - printer->Print(vars, - "public $abstract$ void $name$(\n" - " com.google.protobuf.RpcController controller,\n" - " $input$ request,\n" - " com.google.protobuf.RpcCallback<$output$> done)"); -} - -void ImmutableServiceGenerator::GenerateBlockingMethodSignature( - io::Printer* printer, const MethodDescriptor* method) { - std::map vars; - vars["method"] = UnderscoresToCamelCase(method); - vars["input"] = name_resolver_->GetImmutableClassName(method->input_type()); - vars["output"] = GetOutput(method); - printer->Print(vars, - "\n" - "public $output$ $method$(\n" - " com.google.protobuf.RpcController controller,\n" - " $input$ request)\n" - " throws com.google.protobuf.ServiceException"); -} - -} // namespace java -} // namespace compiler -} // namespace protobuf -} // namespace google diff --git a/extra/protobuf/protobuf-3.19.4/src/google/protobuf/compiler/java/java_service.h b/extra/protobuf/protobuf-3.19.4/src/google/protobuf/compiler/java/java_service.h deleted file mode 100644 index 81db51948134..000000000000 --- a/extra/protobuf/protobuf-3.19.4/src/google/protobuf/compiler/java/java_service.h +++ /dev/null @@ -1,139 +0,0 @@ -// Protocol Buffers - Google's data interchange format -// Copyright 2008 Google Inc. All rights reserved. -// https://developers.google.com/protocol-buffers/ -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// * Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// * Redistributions in binary form must reproduce the above -// copyright notice, this list of conditions and the following disclaimer -// in the documentation and/or other materials provided with the -// distribution. -// * Neither the name of Google Inc. nor the names of its -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -// Author: kenton@google.com (Kenton Varda) -// Based on original Protocol Buffers design by -// Sanjay Ghemawat, Jeff Dean, and others. - -#ifndef GOOGLE_PROTOBUF_COMPILER_JAVA_SERVICE_H__ -#define GOOGLE_PROTOBUF_COMPILER_JAVA_SERVICE_H__ - -#include -#include - -namespace google { -namespace protobuf { -namespace compiler { -namespace java { -class Context; // context.h -class ClassNameResolver; // name_resolver.h -} // namespace java -} // namespace compiler -namespace io { -class Printer; // printer.h -} -} // namespace protobuf -} // namespace google - -namespace google { -namespace protobuf { -namespace compiler { -namespace java { - -class ServiceGenerator { - public: - explicit ServiceGenerator(const ServiceDescriptor* descriptor); - virtual ~ServiceGenerator(); - - virtual void Generate(io::Printer* printer) = 0; - - enum RequestOrResponse { REQUEST, RESPONSE }; - enum IsAbstract { IS_ABSTRACT, IS_CONCRETE }; - - protected: - const ServiceDescriptor* descriptor_; - - private: - GOOGLE_DISALLOW_EVIL_CONSTRUCTORS(ServiceGenerator); -}; - -class ImmutableServiceGenerator : public ServiceGenerator { - public: - ImmutableServiceGenerator(const ServiceDescriptor* descriptor, - Context* context); - virtual ~ImmutableServiceGenerator(); - - void Generate(io::Printer* printer) override; - - private: - // Generate the getDescriptorForType() method. - void GenerateGetDescriptorForType(io::Printer* printer); - - // Generate a Java interface for the service. - void GenerateInterface(io::Printer* printer); - - // Generate newReflectiveService() method. - void GenerateNewReflectiveServiceMethod(io::Printer* printer); - - // Generate newReflectiveBlockingService() method. - void GenerateNewReflectiveBlockingServiceMethod(io::Printer* printer); - - // Generate abstract method declarations for all methods. - void GenerateAbstractMethods(io::Printer* printer); - - // Generate the implementation of Service.callMethod(). - void GenerateCallMethod(io::Printer* printer); - - // Generate the implementation of BlockingService.callBlockingMethod(). - void GenerateCallBlockingMethod(io::Printer* printer); - - // Generate the implementations of Service.get{Request,Response}Prototype(). - void GenerateGetPrototype(RequestOrResponse which, io::Printer* printer); - - // Generate a stub implementation of the service. - void GenerateStub(io::Printer* printer); - - // Generate a method signature, possibly abstract, without body or trailing - // semicolon. - void GenerateMethodSignature(io::Printer* printer, - const MethodDescriptor* method, - IsAbstract is_abstract); - - // Generate a blocking stub interface and implementation of the service. - void GenerateBlockingStub(io::Printer* printer); - - // Generate the method signature for one method of a blocking stub. - void GenerateBlockingMethodSignature(io::Printer* printer, - const MethodDescriptor* method); - - // Return the output type of the method. - std::string GetOutput(const MethodDescriptor* method); - - Context* context_; - ClassNameResolver* name_resolver_; - GOOGLE_DISALLOW_EVIL_CONSTRUCTORS(ImmutableServiceGenerator); -}; - -} // namespace java -} // namespace compiler -} // namespace protobuf -} // namespace google - -#endif // NET_PROTO2_COMPILER_JAVA_SERVICE_H__ diff --git a/extra/protobuf/protobuf-3.19.4/src/google/protobuf/compiler/java/java_shared_code_generator.cc b/extra/protobuf/protobuf-3.19.4/src/google/protobuf/compiler/java/java_shared_code_generator.cc deleted file mode 100644 index 45943d76226d..000000000000 --- a/extra/protobuf/protobuf-3.19.4/src/google/protobuf/compiler/java/java_shared_code_generator.cc +++ /dev/null @@ -1,198 +0,0 @@ -// Protocol Buffers - Google's data interchange format -// Copyright 2008 Google Inc. All rights reserved. -// https://developers.google.com/protocol-buffers/ -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// * Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// * Redistributions in binary form must reproduce the above -// copyright notice, this list of conditions and the following disclaimer -// in the documentation and/or other materials provided with the -// distribution. -// * Neither the name of Google Inc. nor the names of its -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -// Author: xiaofeng@google.com (Feng Xiao) - -#include - -#include - -#include -#include -#include -#include -#include -#include -#include -#include -#include - -namespace google { -namespace protobuf { -namespace compiler { -namespace java { - -SharedCodeGenerator::SharedCodeGenerator(const FileDescriptor* file, - const Options& options) - : name_resolver_(new ClassNameResolver), file_(file), options_(options) {} - -SharedCodeGenerator::~SharedCodeGenerator() {} - -void SharedCodeGenerator::Generate( - GeneratorContext* context, std::vector* file_list, - std::vector* annotation_file_list) { - std::string java_package = FileJavaPackage(file_); - std::string package_dir = JavaPackageToDir(java_package); - - if (HasDescriptorMethods(file_, options_.enforce_lite)) { - // Generate descriptors. - std::string classname = name_resolver_->GetDescriptorClassName(file_); - std::string filename = package_dir + classname + ".java"; - file_list->push_back(filename); - std::unique_ptr output(context->Open(filename)); - GeneratedCodeInfo annotations; - io::AnnotationProtoCollector annotation_collector( - &annotations); - std::unique_ptr printer( - new io::Printer(output.get(), '$', - options_.annotate_code ? &annotation_collector : NULL)); - std::string info_relative_path = classname + ".java.pb.meta"; - std::string info_full_path = filename + ".pb.meta"; - printer->Print( - "// Generated by the protocol buffer compiler. DO NOT EDIT!\n" - "// source: $filename$\n" - "\n", - "filename", file_->name()); - if (!java_package.empty()) { - printer->Print( - "package $package$;\n" - "\n", - "package", java_package); - } - PrintGeneratedAnnotation(printer.get(), '$', - options_.annotate_code ? info_relative_path : ""); - printer->Print( - "public final class $classname$ {\n" - " public static com.google.protobuf.Descriptors.FileDescriptor\n" - " descriptor;\n" - " static {\n", - "classname", classname); - printer->Annotate("classname", file_->name()); - printer->Indent(); - printer->Indent(); - GenerateDescriptors(printer.get()); - printer->Outdent(); - printer->Outdent(); - printer->Print( - " }\n" - "}\n"); - - if (options_.annotate_code) { - std::unique_ptr info_output( - context->Open(info_full_path)); - annotations.SerializeToZeroCopyStream(info_output.get()); - annotation_file_list->push_back(info_full_path); - } - - printer.reset(); - output.reset(); - } -} - -void SharedCodeGenerator::GenerateDescriptors(io::Printer* printer) { - // Embed the descriptor. We simply serialize the entire FileDescriptorProto - // and embed it as a string literal, which is parsed and built into real - // descriptors at initialization time. We unfortunately have to put it in - // a string literal, not a byte array, because apparently using a literal - // byte array causes the Java compiler to generate *instructions* to - // initialize each and every byte of the array, e.g. as if you typed: - // b[0] = 123; b[1] = 456; b[2] = 789; - // This makes huge bytecode files and can easily hit the compiler's internal - // code size limits (error "code to large"). String literals are apparently - // embedded raw, which is what we want. - FileDescriptorProto file_proto; - file_->CopyTo(&file_proto); - - std::string file_data; - file_proto.SerializeToString(&file_data); - - printer->Print("java.lang.String[] descriptorData = {\n"); - printer->Indent(); - - // Limit the number of bytes per line. - static const int kBytesPerLine = 40; - // Limit the number of lines per string part. - static const int kLinesPerPart = 400; - // Every block of bytes, start a new string literal, in order to avoid the - // 64k length limit. Note that this value needs to be <64k. - static const int kBytesPerPart = kBytesPerLine * kLinesPerPart; - for (int i = 0; i < file_data.size(); i += kBytesPerLine) { - if (i > 0) { - if (i % kBytesPerPart == 0) { - printer->Print(",\n"); - } else { - printer->Print(" +\n"); - } - } - printer->Print("\"$data$\"", "data", - CEscape(file_data.substr(i, kBytesPerLine))); - } - - printer->Outdent(); - printer->Print("\n};\n"); - - // ----------------------------------------------------------------- - // Find out all dependencies. - std::vector > dependencies; - for (int i = 0; i < file_->dependency_count(); i++) { - std::string filename = file_->dependency(i)->name(); - std::string package = FileJavaPackage(file_->dependency(i)); - std::string classname = - name_resolver_->GetDescriptorClassName(file_->dependency(i)); - std::string full_name; - if (package.empty()) { - full_name = classname; - } else { - full_name = package + "." + classname; - } - dependencies.push_back(std::make_pair(filename, full_name)); - } - - // ----------------------------------------------------------------- - // Invoke internalBuildGeneratedFileFrom() to build the file. - printer->Print( - "descriptor = com.google.protobuf.Descriptors.FileDescriptor\n" - " .internalBuildGeneratedFileFrom(descriptorData,\n"); - printer->Print( - " new com.google.protobuf.Descriptors.FileDescriptor[] {\n"); - - for (int i = 0; i < dependencies.size(); i++) { - const std::string& dependency = dependencies[i].second; - printer->Print(" $dependency$.getDescriptor(),\n", "dependency", - dependency); - } - - printer->Print(" });\n"); -} - -} // namespace java -} // namespace compiler -} // namespace protobuf -} // namespace google diff --git a/extra/protobuf/protobuf-3.19.4/src/google/protobuf/compiler/java/java_shared_code_generator.h b/extra/protobuf/protobuf-3.19.4/src/google/protobuf/compiler/java/java_shared_code_generator.h deleted file mode 100644 index 7c79abe2e11f..000000000000 --- a/extra/protobuf/protobuf-3.19.4/src/google/protobuf/compiler/java/java_shared_code_generator.h +++ /dev/null @@ -1,90 +0,0 @@ -// Protocol Buffers - Google's data interchange format -// Copyright 2008 Google Inc. All rights reserved. -// https://developers.google.com/protocol-buffers/ -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// * Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// * Redistributions in binary form must reproduce the above -// copyright notice, this list of conditions and the following disclaimer -// in the documentation and/or other materials provided with the -// distribution. -// * Neither the name of Google Inc. nor the names of its -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -// Author: xiaofeng@google.com (Feng Xiao) -// -// Generators that generate shared code between immutable API and mutable API. - -#ifndef GOOGLE_PROTOBUF_COMPILER_JAVA_SHARED_CODE_GENERATOR_H__ -#define GOOGLE_PROTOBUF_COMPILER_JAVA_SHARED_CODE_GENERATOR_H__ - -#include -#include -#include - -#include -#include - -namespace google { -namespace protobuf { -class FileDescriptor; // descriptor.h -namespace compiler { -class GeneratorContext; // code_generator.h -namespace java { -class ClassNameResolver; // name_resolver.h -} -} // namespace compiler -namespace io { -class Printer; // printer.h -} -} // namespace protobuf -} // namespace google - -namespace google { -namespace protobuf { -namespace compiler { -namespace java { - -// A generator that generates code that are shared between immutable API -// and mutable API. Currently only descriptors are shared. -class SharedCodeGenerator { - public: - SharedCodeGenerator(const FileDescriptor* file, const Options& options); - ~SharedCodeGenerator(); - - void Generate(GeneratorContext* generator_context, - std::vector* file_list, - std::vector* annotation_file_list); - - void GenerateDescriptors(io::Printer* printer); - - private: - std::unique_ptr name_resolver_; - const FileDescriptor* file_; - const Options options_; - GOOGLE_DISALLOW_EVIL_CONSTRUCTORS(SharedCodeGenerator); -}; - -} // namespace java -} // namespace compiler -} // namespace protobuf -} // namespace google - -#endif // GOOGLE_PROTOBUF_COMPILER_JAVA_SHARED_CODE_GENERATOR_H__ diff --git a/extra/protobuf/protobuf-3.19.4/src/google/protobuf/compiler/java/java_string_field.cc b/extra/protobuf/protobuf-3.19.4/src/google/protobuf/compiler/java/java_string_field.cc deleted file mode 100644 index 1a0959e408bc..000000000000 --- a/extra/protobuf/protobuf-3.19.4/src/google/protobuf/compiler/java/java_string_field.cc +++ /dev/null @@ -1,1190 +0,0 @@ -// Protocol Buffers - Google's data interchange format -// Copyright 2008 Google Inc. All rights reserved. -// https://developers.google.com/protocol-buffers/ -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// * Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// * Redistributions in binary form must reproduce the above -// copyright notice, this list of conditions and the following disclaimer -// in the documentation and/or other materials provided with the -// distribution. -// * Neither the name of Google Inc. nor the names of its -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -// Author: kenton@google.com (Kenton Varda) -// Author: jonp@google.com (Jon Perlow) -// Based on original Protocol Buffers design by -// Sanjay Ghemawat, Jeff Dean, and others. - -#include - -#include -#include -#include - -#include -#include -#include -#include -#include -#include -#include -#include -#include - -namespace google { -namespace protobuf { -namespace compiler { -namespace java { - -using internal::WireFormat; -using internal::WireFormatLite; - -namespace { - -void SetPrimitiveVariables(const FieldDescriptor* descriptor, - int messageBitIndex, int builderBitIndex, - const FieldGeneratorInfo* info, - ClassNameResolver* name_resolver, - std::map* variables) { - SetCommonFieldVariables(descriptor, info, variables); - - (*variables)["empty_list"] = "com.google.protobuf.LazyStringArrayList.EMPTY"; - - (*variables)["default"] = ImmutableDefaultValue(descriptor, name_resolver); - (*variables)["default_init"] = - "= " + ImmutableDefaultValue(descriptor, name_resolver); - (*variables)["capitalized_type"] = "String"; - (*variables)["tag"] = - StrCat(static_cast(WireFormat::MakeTag(descriptor))); - (*variables)["tag_size"] = StrCat( - WireFormat::TagSize(descriptor->number(), GetType(descriptor))); - (*variables)["null_check"] = - " if (value == null) {\n" - " throw new NullPointerException();\n" - " }\n"; - (*variables)["isStringEmpty"] = "com.google.protobuf.GeneratedMessage" + - GeneratedCodeVersionSuffix() + - ".isStringEmpty"; - (*variables)["writeString"] = "com.google.protobuf.GeneratedMessage" + - GeneratedCodeVersionSuffix() + ".writeString"; - (*variables)["computeStringSize"] = "com.google.protobuf.GeneratedMessage" + - GeneratedCodeVersionSuffix() + - ".computeStringSize"; - - // TODO(birdo): Add @deprecated javadoc when generating javadoc is supported - // by the proto compiler - (*variables)["deprecation"] = - descriptor->options().deprecated() ? "@java.lang.Deprecated " : ""; - (*variables)["kt_deprecation"] = - descriptor->options().deprecated() - ? "@kotlin.Deprecated(message = \"Field " + (*variables)["name"] + - " is deprecated\") " - : ""; - (*variables)["on_changed"] = "onChanged();"; - - if (HasHasbit(descriptor)) { - // For singular messages and builders, one bit is used for the hasField bit. - (*variables)["get_has_field_bit_message"] = GenerateGetBit(messageBitIndex); - (*variables)["get_has_field_bit_builder"] = GenerateGetBit(builderBitIndex); - - // Note that these have a trailing ";". - (*variables)["set_has_field_bit_message"] = - GenerateSetBit(messageBitIndex) + ";"; - (*variables)["set_has_field_bit_builder"] = - GenerateSetBit(builderBitIndex) + ";"; - (*variables)["clear_has_field_bit_builder"] = - GenerateClearBit(builderBitIndex) + ";"; - - (*variables)["is_field_present_message"] = GenerateGetBit(messageBitIndex); - } else { - (*variables)["set_has_field_bit_message"] = ""; - (*variables)["set_has_field_bit_builder"] = ""; - (*variables)["clear_has_field_bit_builder"] = ""; - - (*variables)["is_field_present_message"] = - "!" + (*variables)["isStringEmpty"] + "(" + (*variables)["name"] + "_)"; - } - - // For repeated builders, one bit is used for whether the array is immutable. - (*variables)["get_mutable_bit_builder"] = GenerateGetBit(builderBitIndex); - (*variables)["set_mutable_bit_builder"] = GenerateSetBit(builderBitIndex); - (*variables)["clear_mutable_bit_builder"] = GenerateClearBit(builderBitIndex); - - // For repeated fields, one bit is used for whether the array is immutable - // in the parsing constructor. - (*variables)["get_mutable_bit_parser"] = - GenerateGetBitMutableLocal(builderBitIndex); - (*variables)["set_mutable_bit_parser"] = - GenerateSetBitMutableLocal(builderBitIndex); - - (*variables)["get_has_field_bit_from_local"] = - GenerateGetBitFromLocal(builderBitIndex); - (*variables)["set_has_field_bit_to_local"] = - GenerateSetBitToLocal(messageBitIndex); -} - -} // namespace - -// =================================================================== - -ImmutableStringFieldGenerator::ImmutableStringFieldGenerator( - const FieldDescriptor* descriptor, int messageBitIndex, int builderBitIndex, - Context* context) - : descriptor_(descriptor), name_resolver_(context->GetNameResolver()) { - SetPrimitiveVariables(descriptor, messageBitIndex, builderBitIndex, - context->GetFieldGeneratorInfo(descriptor), - name_resolver_, &variables_); -} - -ImmutableStringFieldGenerator::~ImmutableStringFieldGenerator() {} - -int ImmutableStringFieldGenerator::GetNumBitsForMessage() const { - return HasHasbit(descriptor_) ? 1 : 0; -} - -int ImmutableStringFieldGenerator::GetNumBitsForBuilder() const { - return GetNumBitsForMessage(); -} - -// A note about how strings are handled. This code used to just store a String -// in the Message. This had two issues: -// -// 1. It wouldn't roundtrip byte arrays that were not valid UTF-8 encoded -// strings, but rather fields that were raw bytes incorrectly marked -// as strings in the proto file. This is common because in the proto1 -// syntax, string was the way to indicate bytes and C++ engineers can -// easily make this mistake without affecting the C++ API. By converting to -// strings immediately, some java code might corrupt these byte arrays as -// it passes through a java server even if the field was never accessed by -// application code. -// -// 2. There's a performance hit to converting between bytes and strings and -// it many cases, the field is never even read by the application code. This -// avoids unnecessary conversions in the common use cases. -// -// So now, the field for String is maintained as an Object reference which can -// either store a String or a ByteString. The code uses an instanceof check -// to see which one it has and converts to the other one if needed. It remembers -// the last value requested (in a thread safe manner) as this is most likely -// the one needed next. The thread safety is such that if two threads both -// convert the field because the changes made by each thread were not visible to -// the other, they may cause a conversion to happen more times than would -// otherwise be necessary. This was deemed better than adding synchronization -// overhead. It will not cause any corruption issues or affect the behavior of -// the API. The instanceof check is also highly optimized in the JVM and we -// decided it was better to reduce the memory overhead by not having two -// separate fields but rather use dynamic type checking. -// -// For single fields, the logic for this is done inside the generated code. For -// repeated fields, the logic is done in LazyStringArrayList and -// UnmodifiableLazyStringList. -void ImmutableStringFieldGenerator::GenerateInterfaceMembers( - io::Printer* printer) const { - if (HasHazzer(descriptor_)) { - WriteFieldAccessorDocComment(printer, descriptor_, HAZZER); - printer->Print(variables_, - "$deprecation$boolean has$capitalized_name$();\n"); - } - WriteFieldAccessorDocComment(printer, descriptor_, GETTER); - printer->Print(variables_, - "$deprecation$java.lang.String get$capitalized_name$();\n"); - WriteFieldStringBytesAccessorDocComment(printer, descriptor_, GETTER); - printer->Print(variables_, - "$deprecation$com.google.protobuf.ByteString\n" - " get$capitalized_name$Bytes();\n"); -} - -void ImmutableStringFieldGenerator::GenerateMembers( - io::Printer* printer) const { - printer->Print(variables_, "private volatile java.lang.Object $name$_;\n"); - PrintExtraFieldInfo(variables_, printer); - - if (HasHazzer(descriptor_)) { - WriteFieldAccessorDocComment(printer, descriptor_, HAZZER); - printer->Print( - variables_, - "@java.lang.Override\n" - "$deprecation$public boolean ${$has$capitalized_name$$}$() {\n" - " return $get_has_field_bit_message$;\n" - "}\n"); - printer->Annotate("{", "}", descriptor_); - } - - WriteFieldAccessorDocComment(printer, descriptor_, GETTER); - printer->Print( - variables_, - "@java.lang.Override\n" - "$deprecation$public java.lang.String ${$get$capitalized_name$$}$() {\n" - " java.lang.Object ref = $name$_;\n" - " if (ref instanceof java.lang.String) {\n" - " return (java.lang.String) ref;\n" - " } else {\n" - " com.google.protobuf.ByteString bs = \n" - " (com.google.protobuf.ByteString) ref;\n" - " java.lang.String s = bs.toStringUtf8();\n"); - printer->Annotate("{", "}", descriptor_); - if (CheckUtf8(descriptor_)) { - printer->Print(variables_, " $name$_ = s;\n"); - } else { - printer->Print(variables_, - " if (bs.isValidUtf8()) {\n" - " $name$_ = s;\n" - " }\n"); - } - printer->Print(variables_, - " return s;\n" - " }\n" - "}\n"); - WriteFieldStringBytesAccessorDocComment(printer, descriptor_, GETTER); - printer->Print(variables_, - "@java.lang.Override\n" - "$deprecation$public com.google.protobuf.ByteString\n" - " ${$get$capitalized_name$Bytes$}$() {\n" - " java.lang.Object ref = $name$_;\n" - " if (ref instanceof java.lang.String) {\n" - " com.google.protobuf.ByteString b = \n" - " com.google.protobuf.ByteString.copyFromUtf8(\n" - " (java.lang.String) ref);\n" - " $name$_ = b;\n" - " return b;\n" - " } else {\n" - " return (com.google.protobuf.ByteString) ref;\n" - " }\n" - "}\n"); - printer->Annotate("{", "}", descriptor_); -} - -void ImmutableStringFieldGenerator::GenerateBuilderMembers( - io::Printer* printer) const { - printer->Print(variables_, - "private java.lang.Object $name$_ $default_init$;\n"); - if (HasHazzer(descriptor_)) { - WriteFieldAccessorDocComment(printer, descriptor_, HAZZER); - printer->Print( - variables_, - "$deprecation$public boolean ${$has$capitalized_name$$}$() {\n" - " return $get_has_field_bit_builder$;\n" - "}\n"); - printer->Annotate("{", "}", descriptor_); - } - - WriteFieldAccessorDocComment(printer, descriptor_, GETTER); - printer->Print( - variables_, - "$deprecation$public java.lang.String ${$get$capitalized_name$$}$() {\n" - " java.lang.Object ref = $name$_;\n" - " if (!(ref instanceof java.lang.String)) {\n" - " com.google.protobuf.ByteString bs =\n" - " (com.google.protobuf.ByteString) ref;\n" - " java.lang.String s = bs.toStringUtf8();\n"); - printer->Annotate("{", "}", descriptor_); - if (CheckUtf8(descriptor_)) { - printer->Print(variables_, " $name$_ = s;\n"); - } else { - printer->Print(variables_, - " if (bs.isValidUtf8()) {\n" - " $name$_ = s;\n" - " }\n"); - } - printer->Print(variables_, - " return s;\n" - " } else {\n" - " return (java.lang.String) ref;\n" - " }\n" - "}\n"); - - WriteFieldStringBytesAccessorDocComment(printer, descriptor_, GETTER); - printer->Print(variables_, - "$deprecation$public com.google.protobuf.ByteString\n" - " ${$get$capitalized_name$Bytes$}$() {\n" - " java.lang.Object ref = $name$_;\n" - " if (ref instanceof String) {\n" - " com.google.protobuf.ByteString b = \n" - " com.google.protobuf.ByteString.copyFromUtf8(\n" - " (java.lang.String) ref);\n" - " $name$_ = b;\n" - " return b;\n" - " } else {\n" - " return (com.google.protobuf.ByteString) ref;\n" - " }\n" - "}\n"); - printer->Annotate("{", "}", descriptor_); - - WriteFieldAccessorDocComment(printer, descriptor_, SETTER, - /* builder */ true); - printer->Print(variables_, - "$deprecation$public Builder ${$set$capitalized_name$$}$(\n" - " java.lang.String value) {\n" - "$null_check$" - " $set_has_field_bit_builder$\n" - " $name$_ = value;\n" - " $on_changed$\n" - " return this;\n" - "}\n"); - printer->Annotate("{", "}", descriptor_); - WriteFieldAccessorDocComment(printer, descriptor_, CLEARER, - /* builder */ true); - printer->Print( - variables_, - "$deprecation$public Builder ${$clear$capitalized_name$$}$() {\n" - " $clear_has_field_bit_builder$\n"); - printer->Annotate("{", "}", descriptor_); - // The default value is not a simple literal so we want to avoid executing - // it multiple times. Instead, get the default out of the default instance. - printer->Print(variables_, - " $name$_ = getDefaultInstance().get$capitalized_name$();\n"); - printer->Print(variables_, - " $on_changed$\n" - " return this;\n" - "}\n"); - - WriteFieldStringBytesAccessorDocComment(printer, descriptor_, SETTER, - /* builder */ true); - printer->Print( - variables_, - "$deprecation$public Builder ${$set$capitalized_name$Bytes$}$(\n" - " com.google.protobuf.ByteString value) {\n" - "$null_check$"); - printer->Annotate("{", "}", descriptor_); - if (CheckUtf8(descriptor_)) { - printer->Print(variables_, " checkByteStringIsUtf8(value);\n"); - } - printer->Print(variables_, - " $set_has_field_bit_builder$\n" - " $name$_ = value;\n" - " $on_changed$\n" - " return this;\n" - "}\n"); -} - -void ImmutableStringFieldGenerator::GenerateKotlinDslMembers( - io::Printer* printer) const { - WriteFieldDocComment(printer, descriptor_); - printer->Print(variables_, - "$kt_deprecation$public var $kt_name$: kotlin.String\n" - " @JvmName(\"${$get$kt_capitalized_name$$}$\")\n" - " get() = $kt_dsl_builder$.${$get$capitalized_name$$}$()\n" - " @JvmName(\"${$set$kt_capitalized_name$$}$\")\n" - " set(value) {\n" - " $kt_dsl_builder$.${$set$capitalized_name$$}$(value)\n" - " }\n"); - - WriteFieldAccessorDocComment(printer, descriptor_, CLEARER, - /* builder */ false); - printer->Print(variables_, - "public fun ${$clear$kt_capitalized_name$$}$() {\n" - " $kt_dsl_builder$.${$clear$capitalized_name$$}$()\n" - "}\n"); - - if (HasHazzer(descriptor_)) { - WriteFieldAccessorDocComment(printer, descriptor_, HAZZER); - printer->Print( - variables_, - "public fun ${$has$kt_capitalized_name$$}$(): kotlin.Boolean {\n" - " return $kt_dsl_builder$.${$has$capitalized_name$$}$()\n" - "}\n"); - } -} - -void ImmutableStringFieldGenerator::GenerateFieldBuilderInitializationCode( - io::Printer* printer) const { - // noop for primitives -} - -void ImmutableStringFieldGenerator::GenerateInitializationCode( - io::Printer* printer) const { - printer->Print(variables_, "$name$_ = $default$;\n"); -} - -void ImmutableStringFieldGenerator::GenerateBuilderClearCode( - io::Printer* printer) const { - printer->Print(variables_, - "$name$_ = $default$;\n" - "$clear_has_field_bit_builder$\n"); -} - -void ImmutableStringFieldGenerator::GenerateMergingCode( - io::Printer* printer) const { - if (HasHazzer(descriptor_)) { - // Allow a slight breach of abstraction here in order to avoid forcing - // all string fields to Strings when copying fields from a Message. - printer->Print(variables_, - "if (other.has$capitalized_name$()) {\n" - " $set_has_field_bit_builder$\n" - " $name$_ = other.$name$_;\n" - " $on_changed$\n" - "}\n"); - } else { - printer->Print(variables_, - "if (!other.get$capitalized_name$().isEmpty()) {\n" - " $name$_ = other.$name$_;\n" - " $on_changed$\n" - "}\n"); - } -} - -void ImmutableStringFieldGenerator::GenerateBuildingCode( - io::Printer* printer) const { - if (HasHazzer(descriptor_)) { - printer->Print(variables_, - "if ($get_has_field_bit_from_local$) {\n" - " $set_has_field_bit_to_local$;\n" - "}\n"); - } - printer->Print(variables_, "result.$name$_ = $name$_;\n"); -} - -void ImmutableStringFieldGenerator::GenerateParsingCode( - io::Printer* printer) const { - if (CheckUtf8(descriptor_)) { - printer->Print(variables_, - "java.lang.String s = input.readStringRequireUtf8();\n" - "$set_has_field_bit_message$\n" - "$name$_ = s;\n"); - } else { - printer->Print(variables_, - "com.google.protobuf.ByteString bs = input.readBytes();\n" - "$set_has_field_bit_message$\n" - "$name$_ = bs;\n"); - } -} - -void ImmutableStringFieldGenerator::GenerateParsingDoneCode( - io::Printer* printer) const { - // noop for strings. -} - -void ImmutableStringFieldGenerator::GenerateSerializationCode( - io::Printer* printer) const { - printer->Print(variables_, - "if ($is_field_present_message$) {\n" - " $writeString$(output, $number$, $name$_);\n" - "}\n"); -} - -void ImmutableStringFieldGenerator::GenerateSerializedSizeCode( - io::Printer* printer) const { - printer->Print(variables_, - "if ($is_field_present_message$) {\n" - " size += $computeStringSize$($number$, $name$_);\n" - "}\n"); -} - -void ImmutableStringFieldGenerator::GenerateEqualsCode( - io::Printer* printer) const { - printer->Print(variables_, - "if (!get$capitalized_name$()\n" - " .equals(other.get$capitalized_name$())) return false;\n"); -} - -void ImmutableStringFieldGenerator::GenerateHashCode( - io::Printer* printer) const { - printer->Print(variables_, "hash = (37 * hash) + $constant_name$;\n"); - printer->Print(variables_, - "hash = (53 * hash) + get$capitalized_name$().hashCode();\n"); -} - -std::string ImmutableStringFieldGenerator::GetBoxedType() const { - return "java.lang.String"; -} - -// =================================================================== - -ImmutableStringOneofFieldGenerator::ImmutableStringOneofFieldGenerator( - const FieldDescriptor* descriptor, int messageBitIndex, int builderBitIndex, - Context* context) - : ImmutableStringFieldGenerator(descriptor, messageBitIndex, - builderBitIndex, context) { - const OneofGeneratorInfo* info = - context->GetOneofGeneratorInfo(descriptor->containing_oneof()); - SetCommonOneofVariables(descriptor, info, &variables_); -} - -ImmutableStringOneofFieldGenerator::~ImmutableStringOneofFieldGenerator() {} - -void ImmutableStringOneofFieldGenerator::GenerateMembers( - io::Printer* printer) const { - PrintExtraFieldInfo(variables_, printer); - GOOGLE_DCHECK(HasHazzer(descriptor_)); - WriteFieldAccessorDocComment(printer, descriptor_, HAZZER); - printer->Print(variables_, - "$deprecation$public boolean ${$has$capitalized_name$$}$() {\n" - " return $has_oneof_case_message$;\n" - "}\n"); - printer->Annotate("{", "}", descriptor_); - - WriteFieldAccessorDocComment(printer, descriptor_, GETTER); - printer->Print( - variables_, - "$deprecation$public java.lang.String ${$get$capitalized_name$$}$() {\n" - " java.lang.Object ref $default_init$;\n" - " if ($has_oneof_case_message$) {\n" - " ref = $oneof_name$_;\n" - " }\n" - " if (ref instanceof java.lang.String) {\n" - " return (java.lang.String) ref;\n" - " } else {\n" - " com.google.protobuf.ByteString bs = \n" - " (com.google.protobuf.ByteString) ref;\n" - " java.lang.String s = bs.toStringUtf8();\n"); - printer->Annotate("{", "}", descriptor_); - if (CheckUtf8(descriptor_)) { - printer->Print(variables_, - " if ($has_oneof_case_message$) {\n" - " $oneof_name$_ = s;\n" - " }\n"); - } else { - printer->Print(variables_, - " if (bs.isValidUtf8() && ($has_oneof_case_message$)) {\n" - " $oneof_name$_ = s;\n" - " }\n"); - } - printer->Print(variables_, - " return s;\n" - " }\n" - "}\n"); - WriteFieldStringBytesAccessorDocComment(printer, descriptor_, GETTER); - - printer->Print(variables_, - "$deprecation$public com.google.protobuf.ByteString\n" - " ${$get$capitalized_name$Bytes$}$() {\n" - " java.lang.Object ref $default_init$;\n" - " if ($has_oneof_case_message$) {\n" - " ref = $oneof_name$_;\n" - " }\n" - " if (ref instanceof java.lang.String) {\n" - " com.google.protobuf.ByteString b = \n" - " com.google.protobuf.ByteString.copyFromUtf8(\n" - " (java.lang.String) ref);\n" - " if ($has_oneof_case_message$) {\n" - " $oneof_name$_ = b;\n" - " }\n" - " return b;\n" - " } else {\n" - " return (com.google.protobuf.ByteString) ref;\n" - " }\n" - "}\n"); - printer->Annotate("{", "}", descriptor_); -} - -void ImmutableStringOneofFieldGenerator::GenerateBuilderMembers( - io::Printer* printer) const { - GOOGLE_DCHECK(HasHazzer(descriptor_)); - WriteFieldAccessorDocComment(printer, descriptor_, HAZZER); - printer->Print(variables_, - "@java.lang.Override\n" - "$deprecation$public boolean ${$has$capitalized_name$$}$() {\n" - " return $has_oneof_case_message$;\n" - "}\n"); - printer->Annotate("{", "}", descriptor_); - - WriteFieldAccessorDocComment(printer, descriptor_, GETTER); - printer->Print( - variables_, - "@java.lang.Override\n" - "$deprecation$public java.lang.String ${$get$capitalized_name$$}$() {\n" - " java.lang.Object ref $default_init$;\n" - " if ($has_oneof_case_message$) {\n" - " ref = $oneof_name$_;\n" - " }\n" - " if (!(ref instanceof java.lang.String)) {\n" - " com.google.protobuf.ByteString bs =\n" - " (com.google.protobuf.ByteString) ref;\n" - " java.lang.String s = bs.toStringUtf8();\n" - " if ($has_oneof_case_message$) {\n"); - printer->Annotate("{", "}", descriptor_); - if (CheckUtf8(descriptor_)) { - printer->Print(variables_, " $oneof_name$_ = s;\n"); - } else { - printer->Print(variables_, - " if (bs.isValidUtf8()) {\n" - " $oneof_name$_ = s;\n" - " }\n"); - } - printer->Print(variables_, - " }\n" - " return s;\n" - " } else {\n" - " return (java.lang.String) ref;\n" - " }\n" - "}\n"); - - WriteFieldStringBytesAccessorDocComment(printer, descriptor_, GETTER); - printer->Print(variables_, - "@java.lang.Override\n" - "$deprecation$public com.google.protobuf.ByteString\n" - " ${$get$capitalized_name$Bytes$}$() {\n" - " java.lang.Object ref $default_init$;\n" - " if ($has_oneof_case_message$) {\n" - " ref = $oneof_name$_;\n" - " }\n" - " if (ref instanceof String) {\n" - " com.google.protobuf.ByteString b = \n" - " com.google.protobuf.ByteString.copyFromUtf8(\n" - " (java.lang.String) ref);\n" - " if ($has_oneof_case_message$) {\n" - " $oneof_name$_ = b;\n" - " }\n" - " return b;\n" - " } else {\n" - " return (com.google.protobuf.ByteString) ref;\n" - " }\n" - "}\n"); - printer->Annotate("{", "}", descriptor_); - - WriteFieldAccessorDocComment(printer, descriptor_, SETTER, - /* builder */ true); - printer->Print(variables_, - "$deprecation$public Builder ${$set$capitalized_name$$}$(\n" - " java.lang.String value) {\n" - "$null_check$" - " $set_oneof_case_message$;\n" - " $oneof_name$_ = value;\n" - " $on_changed$\n" - " return this;\n" - "}\n"); - printer->Annotate("{", "}", descriptor_); - WriteFieldAccessorDocComment(printer, descriptor_, CLEARER, - /* builder */ true); - printer->Print( - variables_, - "$deprecation$public Builder ${$clear$capitalized_name$$}$() {\n" - " if ($has_oneof_case_message$) {\n" - " $clear_oneof_case_message$;\n" - " $oneof_name$_ = null;\n" - " $on_changed$\n" - " }\n" - " return this;\n" - "}\n"); - printer->Annotate("{", "}", descriptor_); - - WriteFieldStringBytesAccessorDocComment(printer, descriptor_, SETTER, - /* builder */ true); - printer->Print( - variables_, - "$deprecation$public Builder ${$set$capitalized_name$Bytes$}$(\n" - " com.google.protobuf.ByteString value) {\n" - "$null_check$"); - printer->Annotate("{", "}", descriptor_); - if (CheckUtf8(descriptor_)) { - printer->Print(variables_, " checkByteStringIsUtf8(value);\n"); - } - printer->Print(variables_, - " $set_oneof_case_message$;\n" - " $oneof_name$_ = value;\n" - " $on_changed$\n" - " return this;\n" - "}\n"); -} - -void ImmutableStringOneofFieldGenerator::GenerateMergingCode( - io::Printer* printer) const { - // Allow a slight breach of abstraction here in order to avoid forcing - // all string fields to Strings when copying fields from a Message. - printer->Print(variables_, - "$set_oneof_case_message$;\n" - "$oneof_name$_ = other.$oneof_name$_;\n" - "$on_changed$\n"); -} - -void ImmutableStringOneofFieldGenerator::GenerateBuildingCode( - io::Printer* printer) const { - printer->Print(variables_, - "if ($has_oneof_case_message$) {\n" - " result.$oneof_name$_ = $oneof_name$_;\n" - "}\n"); -} - -void ImmutableStringOneofFieldGenerator::GenerateParsingCode( - io::Printer* printer) const { - if (CheckUtf8(descriptor_)) { - printer->Print(variables_, - "java.lang.String s = input.readStringRequireUtf8();\n" - "$set_oneof_case_message$;\n" - "$oneof_name$_ = s;\n"); - } else { - printer->Print(variables_, - "com.google.protobuf.ByteString bs = input.readBytes();\n" - "$set_oneof_case_message$;\n" - "$oneof_name$_ = bs;\n"); - } -} - -void ImmutableStringOneofFieldGenerator::GenerateSerializationCode( - io::Printer* printer) const { - printer->Print(variables_, - "if ($has_oneof_case_message$) {\n" - " $writeString$(output, $number$, $oneof_name$_);\n" - "}\n"); -} - -void ImmutableStringOneofFieldGenerator::GenerateSerializedSizeCode( - io::Printer* printer) const { - printer->Print(variables_, - "if ($has_oneof_case_message$) {\n" - " size += $computeStringSize$($number$, $oneof_name$_);\n" - "}\n"); -} - -// =================================================================== - -RepeatedImmutableStringFieldGenerator::RepeatedImmutableStringFieldGenerator( - const FieldDescriptor* descriptor, int messageBitIndex, int builderBitIndex, - Context* context) - : descriptor_(descriptor), name_resolver_(context->GetNameResolver()) { - SetPrimitiveVariables(descriptor, messageBitIndex, builderBitIndex, - context->GetFieldGeneratorInfo(descriptor), - name_resolver_, &variables_); -} - -RepeatedImmutableStringFieldGenerator:: - ~RepeatedImmutableStringFieldGenerator() {} - -int RepeatedImmutableStringFieldGenerator::GetNumBitsForMessage() const { - return 0; -} - -int RepeatedImmutableStringFieldGenerator::GetNumBitsForBuilder() const { - return 1; -} - -void RepeatedImmutableStringFieldGenerator::GenerateInterfaceMembers( - io::Printer* printer) const { - WriteFieldAccessorDocComment(printer, descriptor_, LIST_GETTER); - printer->Print( - variables_, - // NOTE: the same method in the implementation class actually returns - // com.google.protobuf.ProtocolStringList (a subclass of List). It's - // changed between protobuf 2.5.0 release and protobuf 2.6.1 release. - // To retain binary compatibility with both 2.5.0 and 2.6.1 generated - // code, we make this interface method return List so both methods - // with different return types exist in the compiled byte code. - "$deprecation$java.util.List\n" - " get$capitalized_name$List();\n"); - WriteFieldAccessorDocComment(printer, descriptor_, LIST_COUNT); - printer->Print(variables_, - "$deprecation$int get$capitalized_name$Count();\n"); - WriteFieldAccessorDocComment(printer, descriptor_, LIST_INDEXED_GETTER); - printer->Print( - variables_, - "$deprecation$java.lang.String get$capitalized_name$(int index);\n"); - WriteFieldStringBytesAccessorDocComment(printer, descriptor_, - LIST_INDEXED_GETTER); - printer->Print(variables_, - "$deprecation$com.google.protobuf.ByteString\n" - " get$capitalized_name$Bytes(int index);\n"); -} - -void RepeatedImmutableStringFieldGenerator::GenerateMembers( - io::Printer* printer) const { - printer->Print(variables_, - "private com.google.protobuf.LazyStringList $name$_;\n"); - PrintExtraFieldInfo(variables_, printer); - WriteFieldAccessorDocComment(printer, descriptor_, LIST_GETTER); - printer->Print(variables_, - "$deprecation$public com.google.protobuf.ProtocolStringList\n" - " ${$get$capitalized_name$List$}$() {\n" - " return $name$_;\n" // note: unmodifiable list - "}\n"); - printer->Annotate("{", "}", descriptor_); - WriteFieldAccessorDocComment(printer, descriptor_, LIST_COUNT); - printer->Print( - variables_, - "$deprecation$public int ${$get$capitalized_name$Count$}$() {\n" - " return $name$_.size();\n" - "}\n"); - printer->Annotate("{", "}", descriptor_); - WriteFieldAccessorDocComment(printer, descriptor_, LIST_INDEXED_GETTER); - printer->Print(variables_, - "$deprecation$public java.lang.String " - "${$get$capitalized_name$$}$(int index) {\n" - " return $name$_.get(index);\n" - "}\n"); - printer->Annotate("{", "}", descriptor_); - WriteFieldStringBytesAccessorDocComment(printer, descriptor_, - LIST_INDEXED_GETTER); - printer->Print(variables_, - "$deprecation$public com.google.protobuf.ByteString\n" - " ${$get$capitalized_name$Bytes$}$(int index) {\n" - " return $name$_.getByteString(index);\n" - "}\n"); - printer->Annotate("{", "}", descriptor_); -} - -void RepeatedImmutableStringFieldGenerator::GenerateBuilderMembers( - io::Printer* printer) const { - // One field is the list and the bit field keeps track of whether the - // list is immutable. If it's immutable, the invariant is that it must - // either an instance of Collections.emptyList() or it's an ArrayList - // wrapped in a Collections.unmodifiableList() wrapper and nobody else has - // a reference to the underlying ArrayList. This invariant allows us to - // share instances of lists between protocol buffers avoiding expensive - // memory allocations. Note, immutable is a strong guarantee here -- not - // just that the list cannot be modified via the reference but that the - // list can never be modified. - printer->Print( - variables_, - "private com.google.protobuf.LazyStringList $name$_ = $empty_list$;\n"); - - printer->Print( - variables_, - "private void ensure$capitalized_name$IsMutable() {\n" - " if (!$get_mutable_bit_builder$) {\n" - " $name$_ = new com.google.protobuf.LazyStringArrayList($name$_);\n" - " $set_mutable_bit_builder$;\n" - " }\n" - "}\n"); - - // Note: We return an unmodifiable list because otherwise the caller - // could hold on to the returned list and modify it after the message - // has been built, thus mutating the message which is supposed to be - // immutable. - WriteFieldAccessorDocComment(printer, descriptor_, LIST_GETTER); - printer->Print(variables_, - "$deprecation$public com.google.protobuf.ProtocolStringList\n" - " ${$get$capitalized_name$List$}$() {\n" - " return $name$_.getUnmodifiableView();\n" - "}\n"); - printer->Annotate("{", "}", descriptor_); - WriteFieldAccessorDocComment(printer, descriptor_, LIST_COUNT); - printer->Print( - variables_, - "$deprecation$public int ${$get$capitalized_name$Count$}$() {\n" - " return $name$_.size();\n" - "}\n"); - printer->Annotate("{", "}", descriptor_); - WriteFieldAccessorDocComment(printer, descriptor_, LIST_INDEXED_GETTER); - printer->Print(variables_, - "$deprecation$public java.lang.String " - "${$get$capitalized_name$$}$(int index) {\n" - " return $name$_.get(index);\n" - "}\n"); - printer->Annotate("{", "}", descriptor_); - WriteFieldStringBytesAccessorDocComment(printer, descriptor_, - LIST_INDEXED_GETTER); - printer->Print(variables_, - "$deprecation$public com.google.protobuf.ByteString\n" - " ${$get$capitalized_name$Bytes$}$(int index) {\n" - " return $name$_.getByteString(index);\n" - "}\n"); - printer->Annotate("{", "}", descriptor_); - WriteFieldAccessorDocComment(printer, descriptor_, LIST_INDEXED_SETTER, - /* builder */ true); - printer->Print(variables_, - "$deprecation$public Builder ${$set$capitalized_name$$}$(\n" - " int index, java.lang.String value) {\n" - "$null_check$" - " ensure$capitalized_name$IsMutable();\n" - " $name$_.set(index, value);\n" - " $on_changed$\n" - " return this;\n" - "}\n"); - printer->Annotate("{", "}", descriptor_); - WriteFieldAccessorDocComment(printer, descriptor_, LIST_ADDER, - /* builder */ true); - printer->Print(variables_, - "$deprecation$public Builder ${$add$capitalized_name$$}$(\n" - " java.lang.String value) {\n" - "$null_check$" - " ensure$capitalized_name$IsMutable();\n" - " $name$_.add(value);\n" - " $on_changed$\n" - " return this;\n" - "}\n"); - printer->Annotate("{", "}", descriptor_); - WriteFieldAccessorDocComment(printer, descriptor_, LIST_MULTI_ADDER, - /* builder */ true); - printer->Print(variables_, - "$deprecation$public Builder ${$addAll$capitalized_name$$}$(\n" - " java.lang.Iterable values) {\n" - " ensure$capitalized_name$IsMutable();\n" - " com.google.protobuf.AbstractMessageLite.Builder.addAll(\n" - " values, $name$_);\n" - " $on_changed$\n" - " return this;\n" - "}\n"); - printer->Annotate("{", "}", descriptor_); - WriteFieldAccessorDocComment(printer, descriptor_, CLEARER, - /* builder */ true); - printer->Print( - variables_, - "$deprecation$public Builder ${$clear$capitalized_name$$}$() {\n" - " $name$_ = $empty_list$;\n" - " $clear_mutable_bit_builder$;\n" - " $on_changed$\n" - " return this;\n" - "}\n"); - printer->Annotate("{", "}", descriptor_); - - WriteFieldStringBytesAccessorDocComment(printer, descriptor_, LIST_ADDER, - /* builder */ true); - printer->Print( - variables_, - "$deprecation$public Builder ${$add$capitalized_name$Bytes$}$(\n" - " com.google.protobuf.ByteString value) {\n" - "$null_check$"); - printer->Annotate("{", "}", descriptor_); - if (CheckUtf8(descriptor_)) { - printer->Print(variables_, " checkByteStringIsUtf8(value);\n"); - } - printer->Print(variables_, - " ensure$capitalized_name$IsMutable();\n" - " $name$_.add(value);\n" - " $on_changed$\n" - " return this;\n" - "}\n"); -} - -void RepeatedImmutableStringFieldGenerator::GenerateKotlinDslMembers( - io::Printer* printer) const { - printer->Print( - variables_, - "/**\n" - " * An uninstantiable, behaviorless type to represent the field in\n" - " * generics.\n" - " */\n" - "@kotlin.OptIn" - "(com.google.protobuf.kotlin.OnlyForUseByGeneratedProtoCode::class)\n" - "public class ${$$kt_capitalized_name$Proxy$}$ private constructor()" - " : com.google.protobuf.kotlin.DslProxy()\n"); - - // property for List - WriteFieldAccessorDocComment(printer, descriptor_, LIST_GETTER); - printer->Print(variables_, - "$kt_deprecation$public val $kt_name$: " - "com.google.protobuf.kotlin.DslList" - "\n" - " @kotlin.jvm.JvmSynthetic\n" - " get() = com.google.protobuf.kotlin.DslList(\n" - " $kt_dsl_builder$.${$get$capitalized_name$List$}$()\n" - " )\n"); - - // List.add(String) - WriteFieldAccessorDocComment(printer, descriptor_, LIST_ADDER, - /* builder */ false); - printer->Print(variables_, - "@kotlin.jvm.JvmSynthetic\n" - "@kotlin.jvm.JvmName(\"add$kt_capitalized_name$\")\n" - "public fun com.google.protobuf.kotlin.DslList" - "." - "add(value: kotlin.String) {\n" - " $kt_dsl_builder$.${$add$capitalized_name$$}$(value)\n" - "}\n"); - - // List += String - WriteFieldAccessorDocComment(printer, descriptor_, LIST_ADDER, - /* builder */ false); - printer->Print(variables_, - "@kotlin.jvm.JvmSynthetic\n" - "@kotlin.jvm.JvmName(\"plusAssign$kt_capitalized_name$\")\n" - "@Suppress(\"NOTHING_TO_INLINE\")\n" - "public inline operator fun com.google.protobuf.kotlin.DslList" - "." - "plusAssign(value: kotlin.String) {\n" - " add(value)\n" - "}\n"); - - // List.addAll(Iterable) - WriteFieldAccessorDocComment(printer, descriptor_, LIST_MULTI_ADDER, - /* builder */ false); - printer->Print( - variables_, - "@kotlin.jvm.JvmSynthetic\n" - "@kotlin.jvm.JvmName(\"addAll$kt_capitalized_name$\")\n" - "public fun com.google.protobuf.kotlin.DslList" - "." - "addAll(values: kotlin.collections.Iterable) {\n" - " $kt_dsl_builder$.${$addAll$capitalized_name$$}$(values)\n" - "}\n"); - - // List += Iterable - WriteFieldAccessorDocComment(printer, descriptor_, LIST_MULTI_ADDER, - /* builder */ false); - printer->Print( - variables_, - "@kotlin.jvm.JvmSynthetic\n" - "@kotlin.jvm.JvmName(\"plusAssignAll$kt_capitalized_name$\")\n" - "@Suppress(\"NOTHING_TO_INLINE\")\n" - "public inline operator fun com.google.protobuf.kotlin.DslList" - "." - "plusAssign(values: kotlin.collections.Iterable) {\n" - " addAll(values)\n" - "}\n"); - - // List[Int] = String - WriteFieldAccessorDocComment(printer, descriptor_, LIST_INDEXED_SETTER, - /* builder */ false); - printer->Print( - variables_, - "@kotlin.jvm.JvmSynthetic\n" - "@kotlin.jvm.JvmName(\"set$kt_capitalized_name$\")\n" - "public operator fun com.google.protobuf.kotlin.DslList" - "." - "set(index: kotlin.Int, value: kotlin.String) {\n" - " $kt_dsl_builder$.${$set$capitalized_name$$}$(index, value)\n" - "}"); - - WriteFieldAccessorDocComment(printer, descriptor_, CLEARER, - /* builder */ false); - printer->Print(variables_, - "@kotlin.jvm.JvmSynthetic\n" - "@kotlin.jvm.JvmName(\"clear$kt_capitalized_name$\")\n" - "public fun com.google.protobuf.kotlin.DslList" - "." - "clear() {\n" - " $kt_dsl_builder$.${$clear$capitalized_name$$}$()\n" - "}"); -} - -void RepeatedImmutableStringFieldGenerator:: - GenerateFieldBuilderInitializationCode(io::Printer* printer) const { - // noop for primitives -} - -void RepeatedImmutableStringFieldGenerator::GenerateInitializationCode( - io::Printer* printer) const { - printer->Print(variables_, "$name$_ = $empty_list$;\n"); -} - -void RepeatedImmutableStringFieldGenerator::GenerateBuilderClearCode( - io::Printer* printer) const { - printer->Print(variables_, - "$name$_ = $empty_list$;\n" - "$clear_mutable_bit_builder$;\n"); -} - -void RepeatedImmutableStringFieldGenerator::GenerateMergingCode( - io::Printer* printer) const { - // The code below does two optimizations: - // 1. If the other list is empty, there's nothing to do. This ensures we - // don't allocate a new array if we already have an immutable one. - // 2. If the other list is non-empty and our current list is empty, we can - // reuse the other list which is guaranteed to be immutable. - printer->Print(variables_, - "if (!other.$name$_.isEmpty()) {\n" - " if ($name$_.isEmpty()) {\n" - " $name$_ = other.$name$_;\n" - " $clear_mutable_bit_builder$;\n" - " } else {\n" - " ensure$capitalized_name$IsMutable();\n" - " $name$_.addAll(other.$name$_);\n" - " }\n" - " $on_changed$\n" - "}\n"); -} - -void RepeatedImmutableStringFieldGenerator::GenerateBuildingCode( - io::Printer* printer) const { - // The code below ensures that the result has an immutable list. If our - // list is immutable, we can just reuse it. If not, we make it immutable. - - printer->Print(variables_, - "if ($get_mutable_bit_builder$) {\n" - " $name$_ = $name$_.getUnmodifiableView();\n" - " $clear_mutable_bit_builder$;\n" - "}\n" - "result.$name$_ = $name$_;\n"); -} - -void RepeatedImmutableStringFieldGenerator::GenerateParsingCode( - io::Printer* printer) const { - if (CheckUtf8(descriptor_)) { - printer->Print(variables_, - "java.lang.String s = input.readStringRequireUtf8();\n"); - } else { - printer->Print(variables_, - "com.google.protobuf.ByteString bs = input.readBytes();\n"); - } - printer->Print(variables_, - "if (!$get_mutable_bit_parser$) {\n" - " $name$_ = new com.google.protobuf.LazyStringArrayList();\n" - " $set_mutable_bit_parser$;\n" - "}\n"); - if (CheckUtf8(descriptor_)) { - printer->Print(variables_, "$name$_.add(s);\n"); - } else { - printer->Print(variables_, "$name$_.add(bs);\n"); - } -} - -void RepeatedImmutableStringFieldGenerator::GenerateParsingDoneCode( - io::Printer* printer) const { - printer->Print(variables_, - "if ($get_mutable_bit_parser$) {\n" - " $name$_ = $name$_.getUnmodifiableView();\n" - "}\n"); -} - -void RepeatedImmutableStringFieldGenerator::GenerateSerializationCode( - io::Printer* printer) const { - printer->Print(variables_, - "for (int i = 0; i < $name$_.size(); i++) {\n" - " $writeString$(output, $number$, $name$_.getRaw(i));\n" - "}\n"); -} - -void RepeatedImmutableStringFieldGenerator::GenerateSerializedSizeCode( - io::Printer* printer) const { - printer->Print(variables_, - "{\n" - " int dataSize = 0;\n"); - printer->Indent(); - - printer->Print(variables_, - "for (int i = 0; i < $name$_.size(); i++) {\n" - " dataSize += computeStringSizeNoTag($name$_.getRaw(i));\n" - "}\n"); - - printer->Print("size += dataSize;\n"); - - printer->Print(variables_, - "size += $tag_size$ * get$capitalized_name$List().size();\n"); - - printer->Outdent(); - printer->Print("}\n"); -} - -void RepeatedImmutableStringFieldGenerator::GenerateEqualsCode( - io::Printer* printer) const { - printer->Print( - variables_, - "if (!get$capitalized_name$List()\n" - " .equals(other.get$capitalized_name$List())) return false;\n"); -} - -void RepeatedImmutableStringFieldGenerator::GenerateHashCode( - io::Printer* printer) const { - printer->Print( - variables_, - "if (get$capitalized_name$Count() > 0) {\n" - " hash = (37 * hash) + $constant_name$;\n" - " hash = (53 * hash) + get$capitalized_name$List().hashCode();\n" - "}\n"); -} - -std::string RepeatedImmutableStringFieldGenerator::GetBoxedType() const { - return "String"; -} - -} // namespace java -} // namespace compiler -} // namespace protobuf -} // namespace google diff --git a/extra/protobuf/protobuf-3.19.4/src/google/protobuf/compiler/java/java_string_field.h b/extra/protobuf/protobuf-3.19.4/src/google/protobuf/compiler/java/java_string_field.h deleted file mode 100644 index efab5fee4add..000000000000 --- a/extra/protobuf/protobuf-3.19.4/src/google/protobuf/compiler/java/java_string_field.h +++ /dev/null @@ -1,160 +0,0 @@ -// Protocol Buffers - Google's data interchange format -// Copyright 2008 Google Inc. All rights reserved. -// https://developers.google.com/protocol-buffers/ -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// * Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// * Redistributions in binary form must reproduce the above -// copyright notice, this list of conditions and the following disclaimer -// in the documentation and/or other materials provided with the -// distribution. -// * Neither the name of Google Inc. nor the names of its -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -// Author: kenton@google.com (Kenton Varda) -// Author: jonp@google.com (Jon Perlow) -// Based on original Protocol Buffers design by -// Sanjay Ghemawat, Jeff Dean, and others. - -#ifndef GOOGLE_PROTOBUF_COMPILER_JAVA_STRING_FIELD_H__ -#define GOOGLE_PROTOBUF_COMPILER_JAVA_STRING_FIELD_H__ - -#include -#include -#include - -namespace google { -namespace protobuf { -namespace compiler { -namespace java { -class Context; // context.h -class ClassNameResolver; // name_resolver.h -} // namespace java -} // namespace compiler -} // namespace protobuf -} // namespace google - -namespace google { -namespace protobuf { -namespace compiler { -namespace java { - -class ImmutableStringFieldGenerator : public ImmutableFieldGenerator { - public: - explicit ImmutableStringFieldGenerator(const FieldDescriptor* descriptor, - int messageBitIndex, - int builderBitIndex, Context* context); - ~ImmutableStringFieldGenerator(); - - // implements ImmutableFieldGenerator - // --------------------------------------- - int GetNumBitsForMessage() const override; - int GetNumBitsForBuilder() const override; - void GenerateInterfaceMembers(io::Printer* printer) const override; - void GenerateMembers(io::Printer* printer) const override; - void GenerateBuilderMembers(io::Printer* printer) const override; - void GenerateInitializationCode(io::Printer* printer) const override; - void GenerateBuilderClearCode(io::Printer* printer) const override; - void GenerateMergingCode(io::Printer* printer) const override; - void GenerateBuildingCode(io::Printer* printer) const override; - void GenerateParsingCode(io::Printer* printer) const override; - void GenerateParsingDoneCode(io::Printer* printer) const override; - void GenerateSerializationCode(io::Printer* printer) const override; - void GenerateSerializedSizeCode(io::Printer* printer) const override; - void GenerateFieldBuilderInitializationCode( - io::Printer* printer) const override; - void GenerateEqualsCode(io::Printer* printer) const override; - void GenerateHashCode(io::Printer* printer) const override; - void GenerateKotlinDslMembers(io::Printer* printer) const override; - - std::string GetBoxedType() const override; - - protected: - const FieldDescriptor* descriptor_; - std::map variables_; - ClassNameResolver* name_resolver_; - - private: - GOOGLE_DISALLOW_EVIL_CONSTRUCTORS(ImmutableStringFieldGenerator); -}; - -class ImmutableStringOneofFieldGenerator - : public ImmutableStringFieldGenerator { - public: - ImmutableStringOneofFieldGenerator(const FieldDescriptor* descriptor, - int messageBitIndex, int builderBitIndex, - Context* context); - ~ImmutableStringOneofFieldGenerator(); - - private: - void GenerateMembers(io::Printer* printer) const override; - void GenerateBuilderMembers(io::Printer* printer) const override; - void GenerateMergingCode(io::Printer* printer) const override; - void GenerateBuildingCode(io::Printer* printer) const override; - void GenerateParsingCode(io::Printer* printer) const override; - void GenerateSerializationCode(io::Printer* printer) const override; - void GenerateSerializedSizeCode(io::Printer* printer) const override; - - GOOGLE_DISALLOW_EVIL_CONSTRUCTORS(ImmutableStringOneofFieldGenerator); -}; - -class RepeatedImmutableStringFieldGenerator : public ImmutableFieldGenerator { - public: - explicit RepeatedImmutableStringFieldGenerator( - const FieldDescriptor* descriptor, int messageBitIndex, - int builderBitIndex, Context* context); - ~RepeatedImmutableStringFieldGenerator() override; - - // implements ImmutableFieldGenerator --------------------------------------- - int GetNumBitsForMessage() const override; - int GetNumBitsForBuilder() const override; - void GenerateInterfaceMembers(io::Printer* printer) const override; - void GenerateMembers(io::Printer* printer) const override; - void GenerateBuilderMembers(io::Printer* printer) const override; - void GenerateInitializationCode(io::Printer* printer) const override; - void GenerateBuilderClearCode(io::Printer* printer) const override; - void GenerateMergingCode(io::Printer* printer) const override; - void GenerateBuildingCode(io::Printer* printer) const override; - void GenerateParsingCode(io::Printer* printer) const override; - void GenerateParsingDoneCode(io::Printer* printer) const override; - void GenerateSerializationCode(io::Printer* printer) const override; - void GenerateSerializedSizeCode(io::Printer* printer) const override; - void GenerateFieldBuilderInitializationCode( - io::Printer* printer) const override; - void GenerateEqualsCode(io::Printer* printer) const override; - void GenerateHashCode(io::Printer* printer) const override; - void GenerateKotlinDslMembers(io::Printer* printer) const override; - - std::string GetBoxedType() const override; - - private: - const FieldDescriptor* descriptor_; - std::map variables_; - ClassNameResolver* name_resolver_; - - GOOGLE_DISALLOW_EVIL_CONSTRUCTORS(RepeatedImmutableStringFieldGenerator); -}; - -} // namespace java -} // namespace compiler -} // namespace protobuf -} // namespace google - -#endif // GOOGLE_PROTOBUF_COMPILER_JAVA_STRING_FIELD_H__ diff --git a/extra/protobuf/protobuf-3.19.4/src/google/protobuf/compiler/java/java_string_field_lite.cc b/extra/protobuf/protobuf-3.19.4/src/google/protobuf/compiler/java/java_string_field_lite.cc deleted file mode 100644 index 183390331613..000000000000 --- a/extra/protobuf/protobuf-3.19.4/src/google/protobuf/compiler/java/java_string_field_lite.cc +++ /dev/null @@ -1,864 +0,0 @@ -// Protocol Buffers - Google's data interchange format -// Copyright 2008 Google Inc. All rights reserved. -// https://developers.google.com/protocol-buffers/ -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// * Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// * Redistributions in binary form must reproduce the above -// copyright notice, this list of conditions and the following disclaimer -// in the documentation and/or other materials provided with the -// distribution. -// * Neither the name of Google Inc. nor the names of its -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -// Author: kenton@google.com (Kenton Varda) -// Author: jonp@google.com (Jon Perlow) -// Based on original Protocol Buffers design by -// Sanjay Ghemawat, Jeff Dean, and others. - -#include - -#include -#include -#include - -#include -#include -#include -#include -#include -#include -#include -#include -#include - -namespace google { -namespace protobuf { -namespace compiler { -namespace java { - -using internal::WireFormat; -using internal::WireFormatLite; - -namespace { - -void SetPrimitiveVariables(const FieldDescriptor* descriptor, - int messageBitIndex, int builderBitIndex, - const FieldGeneratorInfo* info, - ClassNameResolver* name_resolver, - std::map* variables) { - SetCommonFieldVariables(descriptor, info, variables); - - (*variables)["empty_list"] = - "com.google.protobuf.GeneratedMessageLite.emptyProtobufList()"; - - (*variables)["default"] = ImmutableDefaultValue(descriptor, name_resolver); - (*variables)["default_init"] = - "= " + ImmutableDefaultValue(descriptor, name_resolver); - (*variables)["capitalized_type"] = "java.lang.String"; - (*variables)["tag"] = - StrCat(static_cast(WireFormat::MakeTag(descriptor))); - (*variables)["tag_size"] = StrCat( - WireFormat::TagSize(descriptor->number(), GetType(descriptor))); - // We use `x.getClass()` as a null check because it generates less bytecode - // than an `if (x == null) { throw ... }` statement. - (*variables)["null_check"] = - " java.lang.Class valueClass = value.getClass();\n"; - - // TODO(birdo): Add @deprecated javadoc when generating javadoc is supported - // by the proto compiler - (*variables)["deprecation"] = - descriptor->options().deprecated() ? "@java.lang.Deprecated " : ""; - (*variables)["kt_deprecation"] = - descriptor->options().deprecated() - ? "@kotlin.Deprecated(message = \"Field " + (*variables)["name"] + - " is deprecated\") " - : ""; - (*variables)["required"] = descriptor->is_required() ? "true" : "false"; - - if (HasHasbit(descriptor)) { - // For singular messages and builders, one bit is used for the hasField bit. - (*variables)["get_has_field_bit_message"] = GenerateGetBit(messageBitIndex); - - // Note that these have a trailing ";". - (*variables)["set_has_field_bit_message"] = - GenerateSetBit(messageBitIndex) + ";"; - (*variables)["clear_has_field_bit_message"] = - GenerateClearBit(messageBitIndex) + ";"; - - (*variables)["is_field_present_message"] = GenerateGetBit(messageBitIndex); - } else { - (*variables)["set_has_field_bit_message"] = ""; - (*variables)["clear_has_field_bit_message"] = ""; - - (*variables)["is_field_present_message"] = - "!" + (*variables)["name"] + "_.isEmpty()"; - } - - (*variables)["get_has_field_bit_from_local"] = - GenerateGetBitFromLocal(builderBitIndex); - (*variables)["set_has_field_bit_to_local"] = - GenerateSetBitToLocal(messageBitIndex); -} - -} // namespace - -// =================================================================== - -ImmutableStringFieldLiteGenerator::ImmutableStringFieldLiteGenerator( - const FieldDescriptor* descriptor, int messageBitIndex, Context* context) - : descriptor_(descriptor), - messageBitIndex_(messageBitIndex), - name_resolver_(context->GetNameResolver()) { - SetPrimitiveVariables(descriptor, messageBitIndex, 0, - context->GetFieldGeneratorInfo(descriptor), - name_resolver_, &variables_); -} - -ImmutableStringFieldLiteGenerator::~ImmutableStringFieldLiteGenerator() {} - -int ImmutableStringFieldLiteGenerator::GetNumBitsForMessage() const { - return HasHasbit(descriptor_) ? 1 : 0; -} - -// A note about how strings are handled. In the SPEED and CODE_SIZE runtimes, -// strings are not stored as java.lang.String in the Message because of two -// issues: -// -// 1. It wouldn't roundtrip byte arrays that were not valid UTF-8 encoded -// strings, but rather fields that were raw bytes incorrectly marked -// as strings in the proto file. This is common because in the proto1 -// syntax, string was the way to indicate bytes and C++ engineers can -// easily make this mistake without affecting the C++ API. By converting to -// strings immediately, some java code might corrupt these byte arrays as -// it passes through a java server even if the field was never accessed by -// application code. -// -// 2. There's a performance hit to converting between bytes and strings and -// it many cases, the field is never even read by the application code. This -// avoids unnecessary conversions in the common use cases. -// -// In the LITE_RUNTIME, we store strings as java.lang.String because we assume -// that the users of this runtime are not subject to proto1 constraints and are -// running code on devices that are user facing. That is, the developers are -// properly incentivized to only fetch the data they need to read and wish to -// reduce the number of allocations incurred when running on a user's device. - -// TODO(dweis): Consider dropping all of the *Bytes() methods. They really -// shouldn't be necessary or used on devices. -void ImmutableStringFieldLiteGenerator::GenerateInterfaceMembers( - io::Printer* printer) const { - if (HasHazzer(descriptor_)) { - WriteFieldAccessorDocComment(printer, descriptor_, HAZZER); - printer->Print(variables_, - "$deprecation$boolean has$capitalized_name$();\n"); - } - WriteFieldAccessorDocComment(printer, descriptor_, GETTER); - printer->Print(variables_, - "$deprecation$java.lang.String get$capitalized_name$();\n"); - WriteFieldStringBytesAccessorDocComment(printer, descriptor_, GETTER); - printer->Print(variables_, - "$deprecation$com.google.protobuf.ByteString\n" - " get$capitalized_name$Bytes();\n"); -} - -void ImmutableStringFieldLiteGenerator::GenerateMembers( - io::Printer* printer) const { - printer->Print(variables_, "private java.lang.String $name$_;\n"); - PrintExtraFieldInfo(variables_, printer); - - if (HasHazzer(descriptor_)) { - WriteFieldAccessorDocComment(printer, descriptor_, HAZZER); - printer->Print( - variables_, - "@java.lang.Override\n" - "$deprecation$public boolean ${$has$capitalized_name$$}$() {\n" - " return $get_has_field_bit_message$;\n" - "}\n"); - printer->Annotate("{", "}", descriptor_); - } - - WriteFieldAccessorDocComment(printer, descriptor_, GETTER); - printer->Print( - variables_, - "@java.lang.Override\n" - "$deprecation$public java.lang.String ${$get$capitalized_name$$}$() {\n" - " return $name$_;\n" - "}\n"); - printer->Annotate("{", "}", descriptor_); - WriteFieldStringBytesAccessorDocComment(printer, descriptor_, GETTER); - printer->Print( - variables_, - "@java.lang.Override\n" - "$deprecation$public com.google.protobuf.ByteString\n" - " ${$get$capitalized_name$Bytes$}$() {\n" - " return com.google.protobuf.ByteString.copyFromUtf8($name$_);\n" - "}\n"); - printer->Annotate("{", "}", descriptor_); - - WriteFieldAccessorDocComment(printer, descriptor_, SETTER); - printer->Print(variables_, - "private void set$capitalized_name$(\n" - " java.lang.String value) {\n" - "$null_check$" - " $set_has_field_bit_message$\n" - " $name$_ = value;\n" - "}\n"); - WriteFieldAccessorDocComment(printer, descriptor_, CLEARER); - printer->Print(variables_, - "private void clear$capitalized_name$() {\n" - " $clear_has_field_bit_message$\n" - // The default value is not a simple literal so we want to - // avoid executing it multiple times. Instead, get the default - // out of the default instance. - " $name$_ = getDefaultInstance().get$capitalized_name$();\n" - "}\n"); - - WriteFieldStringBytesAccessorDocComment(printer, descriptor_, SETTER); - printer->Print(variables_, - "private void set$capitalized_name$Bytes(\n" - " com.google.protobuf.ByteString value) {\n"); - if (CheckUtf8(descriptor_)) { - printer->Print(variables_, " checkByteStringIsUtf8(value);\n"); - } - printer->Print(variables_, - " $name$_ = value.toStringUtf8();\n" - " $set_has_field_bit_message$\n" - "}\n"); -} - -void ImmutableStringFieldLiteGenerator::GenerateBuilderMembers( - io::Printer* printer) const { - if (HasHazzer(descriptor_)) { - WriteFieldAccessorDocComment(printer, descriptor_, HAZZER); - printer->Print( - variables_, - "@java.lang.Override\n" - "$deprecation$public boolean ${$has$capitalized_name$$}$() {\n" - " return instance.has$capitalized_name$();\n" - "}\n"); - printer->Annotate("{", "}", descriptor_); - } - - WriteFieldAccessorDocComment(printer, descriptor_, GETTER); - printer->Print( - variables_, - "@java.lang.Override\n" - "$deprecation$public java.lang.String ${$get$capitalized_name$$}$() {\n" - " return instance.get$capitalized_name$();\n" - "}\n"); - printer->Annotate("{", "}", descriptor_); - - WriteFieldStringBytesAccessorDocComment(printer, descriptor_, GETTER); - printer->Print(variables_, - "@java.lang.Override\n" - "$deprecation$public com.google.protobuf.ByteString\n" - " ${$get$capitalized_name$Bytes$}$() {\n" - " return instance.get$capitalized_name$Bytes();\n" - "}\n"); - printer->Annotate("{", "}", descriptor_); - - WriteFieldAccessorDocComment(printer, descriptor_, SETTER, - /* builder */ true); - printer->Print(variables_, - "$deprecation$public Builder ${$set$capitalized_name$$}$(\n" - " java.lang.String value) {\n" - " copyOnWrite();\n" - " instance.set$capitalized_name$(value);\n" - " return this;\n" - "}\n"); - printer->Annotate("{", "}", descriptor_); - WriteFieldAccessorDocComment(printer, descriptor_, CLEARER, - /* builder */ true); - printer->Print( - variables_, - "$deprecation$public Builder ${$clear$capitalized_name$$}$() {\n" - " copyOnWrite();\n" - " instance.clear$capitalized_name$();\n" - " return this;\n" - "}\n"); - printer->Annotate("{", "}", descriptor_); - - WriteFieldStringBytesAccessorDocComment(printer, descriptor_, SETTER, - /* builder */ true); - printer->Print( - variables_, - "$deprecation$public Builder ${$set$capitalized_name$Bytes$}$(\n" - " com.google.protobuf.ByteString value) {\n" - " copyOnWrite();\n" - " instance.set$capitalized_name$Bytes(value);\n" - " return this;\n" - "}\n"); - printer->Annotate("{", "}", descriptor_); -} - -void ImmutableStringFieldLiteGenerator::GenerateKotlinDslMembers( - io::Printer* printer) const { - WriteFieldDocComment(printer, descriptor_); - printer->Print(variables_, - "$kt_deprecation$public var $kt_name$: kotlin.String\n" - " @JvmName(\"${$get$kt_capitalized_name$$}$\")\n" - " get() = $kt_dsl_builder$.${$get$capitalized_name$$}$()\n" - " @JvmName(\"${$set$kt_capitalized_name$$}$\")\n" - " set(value) {\n" - " $kt_dsl_builder$.${$set$capitalized_name$$}$(value)\n" - " }\n"); - - WriteFieldAccessorDocComment(printer, descriptor_, CLEARER, - /* builder */ false); - printer->Print(variables_, - "public fun ${$clear$kt_capitalized_name$$}$() {\n" - " $kt_dsl_builder$.${$clear$capitalized_name$$}$()\n" - "}\n"); - - if (HasHazzer(descriptor_)) { - WriteFieldAccessorDocComment(printer, descriptor_, HAZZER); - printer->Print( - variables_, - "public fun ${$has$kt_capitalized_name$$}$(): kotlin.Boolean {\n" - " return $kt_dsl_builder$.${$has$capitalized_name$$}$()\n" - "}\n"); - } -} - -void ImmutableStringFieldLiteGenerator::GenerateFieldInfo( - io::Printer* printer, std::vector* output) const { - WriteIntToUtf16CharSequence(descriptor_->number(), output); - WriteIntToUtf16CharSequence(GetExperimentalJavaFieldType(descriptor_), - output); - if (HasHasbit(descriptor_)) { - WriteIntToUtf16CharSequence(messageBitIndex_, output); - } - printer->Print(variables_, "\"$name$_\",\n"); -} - -void ImmutableStringFieldLiteGenerator::GenerateInitializationCode( - io::Printer* printer) const { - printer->Print(variables_, "$name$_ = $default$;\n"); -} - -std::string ImmutableStringFieldLiteGenerator::GetBoxedType() const { - return "java.lang.String"; -} - -// =================================================================== - -ImmutableStringOneofFieldLiteGenerator::ImmutableStringOneofFieldLiteGenerator( - const FieldDescriptor* descriptor, int messageBitIndex, Context* context) - : ImmutableStringFieldLiteGenerator(descriptor, messageBitIndex, context) { - const OneofGeneratorInfo* info = - context->GetOneofGeneratorInfo(descriptor->containing_oneof()); - SetCommonOneofVariables(descriptor, info, &variables_); -} - -ImmutableStringOneofFieldLiteGenerator:: - ~ImmutableStringOneofFieldLiteGenerator() {} - -void ImmutableStringOneofFieldLiteGenerator::GenerateMembers( - io::Printer* printer) const { - PrintExtraFieldInfo(variables_, printer); - GOOGLE_DCHECK(HasHazzer(descriptor_)); - WriteFieldAccessorDocComment(printer, descriptor_, HAZZER); - printer->Print(variables_, - "@java.lang.Override\n" - "$deprecation$public boolean ${$has$capitalized_name$$}$() {\n" - " return $has_oneof_case_message$;\n" - "}\n"); - printer->Annotate("{", "}", descriptor_); - - WriteFieldAccessorDocComment(printer, descriptor_, GETTER); - printer->Print( - variables_, - "@java.lang.Override\n" - "$deprecation$public java.lang.String ${$get$capitalized_name$$}$() {\n" - " java.lang.String ref $default_init$;\n" - " if ($has_oneof_case_message$) {\n" - " ref = (java.lang.String) $oneof_name$_;\n" - " }\n" - " return ref;\n" - "}\n"); - printer->Annotate("{", "}", descriptor_); - - WriteFieldStringBytesAccessorDocComment(printer, descriptor_, GETTER); - printer->Print(variables_, - "@java.lang.Override\n" - "$deprecation$public com.google.protobuf.ByteString\n" - " ${$get$capitalized_name$Bytes$}$() {\n" - " java.lang.String ref $default_init$;\n" - " if ($has_oneof_case_message$) {\n" - " ref = (java.lang.String) $oneof_name$_;\n" - " }\n" - " return com.google.protobuf.ByteString.copyFromUtf8(ref);\n" - "}\n"); - printer->Annotate("{", "}", descriptor_); - - WriteFieldAccessorDocComment(printer, descriptor_, SETTER); - printer->Print(variables_, - "private void ${$set$capitalized_name$$}$(\n" - " java.lang.String value) {\n" - "$null_check$" - " $set_oneof_case_message$;\n" - " $oneof_name$_ = value;\n" - "}\n"); - printer->Annotate("{", "}", descriptor_); - WriteFieldAccessorDocComment(printer, descriptor_, CLEARER); - printer->Print(variables_, - "private void ${$clear$capitalized_name$$}$() {\n" - " if ($has_oneof_case_message$) {\n" - " $clear_oneof_case_message$;\n" - " $oneof_name$_ = null;\n" - " }\n" - "}\n"); - printer->Annotate("{", "}", descriptor_); - - WriteFieldStringBytesAccessorDocComment(printer, descriptor_, SETTER); - printer->Print(variables_, - "private void ${$set$capitalized_name$Bytes$}$(\n" - " com.google.protobuf.ByteString value) {\n"); - printer->Annotate("{", "}", descriptor_); - if (CheckUtf8(descriptor_)) { - printer->Print(variables_, " checkByteStringIsUtf8(value);\n"); - } - printer->Print(variables_, - " $oneof_name$_ = value.toStringUtf8();\n" - " $set_oneof_case_message$;\n" - "}\n"); -} - -void ImmutableStringOneofFieldLiteGenerator::GenerateFieldInfo( - io::Printer* printer, std::vector* output) const { - WriteIntToUtf16CharSequence(descriptor_->number(), output); - WriteIntToUtf16CharSequence(GetExperimentalJavaFieldType(descriptor_), - output); - WriteIntToUtf16CharSequence(descriptor_->containing_oneof()->index(), output); -} - -void ImmutableStringOneofFieldLiteGenerator::GenerateBuilderMembers( - io::Printer* printer) const { - GOOGLE_DCHECK(HasHazzer(descriptor_)); - WriteFieldAccessorDocComment(printer, descriptor_, HAZZER); - printer->Print(variables_, - "@java.lang.Override\n" - "$deprecation$public boolean ${$has$capitalized_name$$}$() {\n" - " return instance.has$capitalized_name$();\n" - "}\n"); - printer->Annotate("{", "}", descriptor_); - - WriteFieldAccessorDocComment(printer, descriptor_, GETTER); - printer->Print( - variables_, - "@java.lang.Override\n" - "$deprecation$public java.lang.String ${$get$capitalized_name$$}$() {\n" - " return instance.get$capitalized_name$();\n" - "}\n"); - printer->Annotate("{", "}", descriptor_); - - WriteFieldStringBytesAccessorDocComment(printer, descriptor_, GETTER); - printer->Print(variables_, - "@java.lang.Override\n" - "$deprecation$public com.google.protobuf.ByteString\n" - " ${$get$capitalized_name$Bytes$}$() {\n" - " return instance.get$capitalized_name$Bytes();\n" - "}\n"); - printer->Annotate("{", "}", descriptor_); - - WriteFieldAccessorDocComment(printer, descriptor_, SETTER, - /* builder */ true); - printer->Print(variables_, - "$deprecation$public Builder ${$set$capitalized_name$$}$(\n" - " java.lang.String value) {\n" - " copyOnWrite();\n" - " instance.set$capitalized_name$(value);\n" - " return this;\n" - "}\n"); - printer->Annotate("{", "}", descriptor_); - WriteFieldAccessorDocComment(printer, descriptor_, CLEARER, - /* builder */ true); - printer->Print( - variables_, - "$deprecation$public Builder ${$clear$capitalized_name$$}$() {\n" - " copyOnWrite();\n" - " instance.clear$capitalized_name$();\n" - " return this;\n" - "}\n"); - printer->Annotate("{", "}", descriptor_); - - WriteFieldStringBytesAccessorDocComment(printer, descriptor_, SETTER, - /* builder */ true); - printer->Print( - variables_, - "$deprecation$public Builder ${$set$capitalized_name$Bytes$}$(\n" - " com.google.protobuf.ByteString value) {\n" - " copyOnWrite();\n" - " instance.set$capitalized_name$Bytes(value);\n" - " return this;\n" - "}\n"); - printer->Annotate("{", "}", descriptor_); -} - -// =================================================================== - -RepeatedImmutableStringFieldLiteGenerator:: - RepeatedImmutableStringFieldLiteGenerator(const FieldDescriptor* descriptor, - int messageBitIndex, - Context* context) - : descriptor_(descriptor), name_resolver_(context->GetNameResolver()) { - SetPrimitiveVariables(descriptor, messageBitIndex, 0, - context->GetFieldGeneratorInfo(descriptor), - name_resolver_, &variables_); -} - -RepeatedImmutableStringFieldLiteGenerator:: - ~RepeatedImmutableStringFieldLiteGenerator() {} - -int RepeatedImmutableStringFieldLiteGenerator::GetNumBitsForMessage() const { - return 0; -} - -void RepeatedImmutableStringFieldLiteGenerator::GenerateInterfaceMembers( - io::Printer* printer) const { - WriteFieldAccessorDocComment(printer, descriptor_, LIST_GETTER); - printer->Print(variables_, - "$deprecation$java.util.List\n" - " get$capitalized_name$List();\n"); - WriteFieldAccessorDocComment(printer, descriptor_, LIST_COUNT); - printer->Print(variables_, - "$deprecation$int get$capitalized_name$Count();\n"); - WriteFieldAccessorDocComment(printer, descriptor_, LIST_INDEXED_GETTER); - printer->Print( - variables_, - "$deprecation$java.lang.String get$capitalized_name$(int index);\n"); - WriteFieldAccessorDocComment(printer, descriptor_, LIST_INDEXED_GETTER); - printer->Print(variables_, - "$deprecation$com.google.protobuf.ByteString\n" - " get$capitalized_name$Bytes(int index);\n"); -} - -void RepeatedImmutableStringFieldLiteGenerator::GenerateMembers( - io::Printer* printer) const { - printer->Print( - variables_, - "private com.google.protobuf.Internal.ProtobufList " - "$name$_;\n"); - PrintExtraFieldInfo(variables_, printer); - WriteFieldAccessorDocComment(printer, descriptor_, LIST_GETTER); - printer->Print(variables_, - "@java.lang.Override\n" - "$deprecation$public java.util.List " - "${$get$capitalized_name$List$}$() {\n" - " return $name$_;\n" // note: unmodifiable list - "}\n"); - printer->Annotate("{", "}", descriptor_); - WriteFieldAccessorDocComment(printer, descriptor_, LIST_COUNT); - printer->Print( - variables_, - "@java.lang.Override\n" - "$deprecation$public int ${$get$capitalized_name$Count$}$() {\n" - " return $name$_.size();\n" - "}\n"); - printer->Annotate("{", "}", descriptor_); - WriteFieldAccessorDocComment(printer, descriptor_, LIST_INDEXED_GETTER); - printer->Print(variables_, - "@java.lang.Override\n" - "$deprecation$public java.lang.String " - "${$get$capitalized_name$$}$(int index) {\n" - " return $name$_.get(index);\n" - "}\n"); - printer->Annotate("{", "}", descriptor_); - WriteFieldStringBytesAccessorDocComment(printer, descriptor_, - LIST_INDEXED_GETTER); - printer->Print(variables_, - "@java.lang.Override\n" - "$deprecation$public com.google.protobuf.ByteString\n" - " ${$get$capitalized_name$Bytes$}$(int index) {\n" - " return com.google.protobuf.ByteString.copyFromUtf8(\n" - " $name$_.get(index));\n" - "}\n"); - printer->Annotate("{", "}", descriptor_); - - printer->Print( - variables_, - "private void ensure$capitalized_name$IsMutable() {\n" - // Use a temporary to avoid a redundant iget-object. - " com.google.protobuf.Internal.ProtobufList tmp =\n" - " $name$_;" - " if (!tmp.isModifiable()) {\n" - " $name$_ =\n" - " com.google.protobuf.GeneratedMessageLite.mutableCopy(tmp);\n" - " }\n" - "}\n"); - - WriteFieldAccessorDocComment(printer, descriptor_, LIST_INDEXED_SETTER); - printer->Print(variables_, - "private void set$capitalized_name$(\n" - " int index, java.lang.String value) {\n" - "$null_check$" - " ensure$capitalized_name$IsMutable();\n" - " $name$_.set(index, value);\n" - "}\n"); - WriteFieldAccessorDocComment(printer, descriptor_, LIST_ADDER); - printer->Print(variables_, - "private void add$capitalized_name$(\n" - " java.lang.String value) {\n" - "$null_check$" - " ensure$capitalized_name$IsMutable();\n" - " $name$_.add(value);\n" - "}\n"); - WriteFieldAccessorDocComment(printer, descriptor_, LIST_MULTI_ADDER); - printer->Print(variables_, - "private void addAll$capitalized_name$(\n" - " java.lang.Iterable values) {\n" - " ensure$capitalized_name$IsMutable();\n" - " com.google.protobuf.AbstractMessageLite.addAll(\n" - " values, $name$_);\n" - "}\n"); - WriteFieldAccessorDocComment(printer, descriptor_, CLEARER); - printer->Print(variables_, - "private void clear$capitalized_name$() {\n" - " $name$_ = $empty_list$;\n" - "}\n"); - - WriteFieldStringBytesAccessorDocComment(printer, descriptor_, LIST_ADDER); - printer->Print(variables_, - "private void add$capitalized_name$Bytes(\n" - " com.google.protobuf.ByteString value) {\n"); - if (CheckUtf8(descriptor_)) { - printer->Print(variables_, " checkByteStringIsUtf8(value);\n"); - } - printer->Print(variables_, - " ensure$capitalized_name$IsMutable();\n" - " $name$_.add(value.toStringUtf8());\n" - "}\n"); -} - -void RepeatedImmutableStringFieldLiteGenerator::GenerateBuilderMembers( - io::Printer* printer) const { - WriteFieldAccessorDocComment(printer, descriptor_, LIST_GETTER); - printer->Print(variables_, - "@java.lang.Override\n" - "$deprecation$public java.util.List\n" - " ${$get$capitalized_name$List$}$() {\n" - " return java.util.Collections.unmodifiableList(\n" - " instance.get$capitalized_name$List());\n" - "}\n"); - printer->Annotate("{", "}", descriptor_); - WriteFieldAccessorDocComment(printer, descriptor_, LIST_COUNT); - printer->Print( - variables_, - "@java.lang.Override\n" - "$deprecation$public int ${$get$capitalized_name$Count$}$() {\n" - " return instance.get$capitalized_name$Count();\n" - "}\n"); - printer->Annotate("{", "}", descriptor_); - WriteFieldAccessorDocComment(printer, descriptor_, LIST_INDEXED_GETTER); - printer->Print(variables_, - "@java.lang.Override\n" - "$deprecation$public java.lang.String " - "${$get$capitalized_name$$}$(int index) {\n" - " return instance.get$capitalized_name$(index);\n" - "}\n"); - printer->Annotate("{", "}", descriptor_); - WriteFieldStringBytesAccessorDocComment(printer, descriptor_, - LIST_INDEXED_GETTER); - printer->Print(variables_, - "@java.lang.Override\n" - "$deprecation$public com.google.protobuf.ByteString\n" - " ${$get$capitalized_name$Bytes$}$(int index) {\n" - " return instance.get$capitalized_name$Bytes(index);\n" - "}\n"); - printer->Annotate("{", "}", descriptor_); - WriteFieldAccessorDocComment(printer, descriptor_, LIST_INDEXED_SETTER, - /* builder */ true); - printer->Print(variables_, - "$deprecation$public Builder ${$set$capitalized_name$$}$(\n" - " int index, java.lang.String value) {\n" - " copyOnWrite();\n" - " instance.set$capitalized_name$(index, value);\n" - " return this;\n" - "}\n"); - printer->Annotate("{", "}", descriptor_); - WriteFieldAccessorDocComment(printer, descriptor_, LIST_ADDER, - /* builder */ true); - printer->Print(variables_, - "$deprecation$public Builder ${$add$capitalized_name$$}$(\n" - " java.lang.String value) {\n" - " copyOnWrite();\n" - " instance.add$capitalized_name$(value);\n" - " return this;\n" - "}\n"); - printer->Annotate("{", "}", descriptor_); - WriteFieldAccessorDocComment(printer, descriptor_, LIST_MULTI_ADDER, - /* builder */ true); - printer->Print(variables_, - "$deprecation$public Builder ${$addAll$capitalized_name$$}$(\n" - " java.lang.Iterable values) {\n" - " copyOnWrite();\n" - " instance.addAll$capitalized_name$(values);\n" - " return this;\n" - "}\n"); - printer->Annotate("{", "}", descriptor_); - WriteFieldAccessorDocComment(printer, descriptor_, CLEARER, - /* builder */ true); - printer->Print( - variables_, - "$deprecation$public Builder ${$clear$capitalized_name$$}$() {\n" - " copyOnWrite();\n" - " instance.clear$capitalized_name$();\n" - " return this;\n" - "}\n"); - printer->Annotate("{", "}", descriptor_); - - WriteFieldStringBytesAccessorDocComment(printer, descriptor_, LIST_ADDER, - /* builder */ true); - printer->Print( - variables_, - "$deprecation$public Builder ${$add$capitalized_name$Bytes$}$(\n" - " com.google.protobuf.ByteString value) {\n" - " copyOnWrite();\n" - " instance.add$capitalized_name$Bytes(value);\n" - " return this;\n" - "}\n"); - printer->Annotate("{", "}", descriptor_); -} - -void RepeatedImmutableStringFieldLiteGenerator::GenerateKotlinDslMembers( - io::Printer* printer) const { - printer->Print( - variables_, - "/**\n" - " * An uninstantiable, behaviorless type to represent the field in\n" - " * generics.\n" - " */\n" - "@kotlin.OptIn" - "(com.google.protobuf.kotlin.OnlyForUseByGeneratedProtoCode::class)\n" - "public class ${$$kt_capitalized_name$Proxy$}$ private constructor()" - " : com.google.protobuf.kotlin.DslProxy()\n"); - - // property for List - WriteFieldAccessorDocComment(printer, descriptor_, LIST_GETTER); - printer->Print( - variables_, - "$kt_deprecation$public val $kt_name$: " - "com.google.protobuf.kotlin.DslList" - "\n" - " @kotlin.OptIn" - "(com.google.protobuf.kotlin.OnlyForUseByGeneratedProtoCode::class)\n" - " get() = com.google.protobuf.kotlin.DslList(\n" - " $kt_dsl_builder$.${$get$capitalized_name$List$}$()\n" - " )\n"); - - // List.add(String) - WriteFieldAccessorDocComment(printer, descriptor_, LIST_ADDER, - /* builder */ false); - printer->Print(variables_, - "@kotlin.jvm.JvmSynthetic\n" - "@kotlin.jvm.JvmName(\"add$kt_capitalized_name$\")\n" - "public fun com.google.protobuf.kotlin.DslList" - "." - "add(value: kotlin.String) {\n" - " $kt_dsl_builder$.${$add$capitalized_name$$}$(value)\n" - "}\n"); - - // List += String - WriteFieldAccessorDocComment(printer, descriptor_, LIST_ADDER, - /* builder */ false); - printer->Print(variables_, - "@kotlin.jvm.JvmSynthetic\n" - "@kotlin.jvm.JvmName(\"plusAssign$kt_capitalized_name$\")\n" - "@Suppress(\"NOTHING_TO_INLINE\")\n" - "public inline operator fun com.google.protobuf.kotlin.DslList" - "." - "plusAssign(value: kotlin.String) {\n" - " add(value)\n" - "}\n"); - - // List.addAll(Iterable) - WriteFieldAccessorDocComment(printer, descriptor_, LIST_MULTI_ADDER, - /* builder */ false); - printer->Print( - variables_, - "@kotlin.jvm.JvmSynthetic\n" - "@kotlin.jvm.JvmName(\"addAll$kt_capitalized_name$\")\n" - "public fun com.google.protobuf.kotlin.DslList" - "." - "addAll(values: kotlin.collections.Iterable) {\n" - " $kt_dsl_builder$.${$addAll$capitalized_name$$}$(values)\n" - "}\n"); - - // List += Iterable - WriteFieldAccessorDocComment(printer, descriptor_, LIST_MULTI_ADDER, - /* builder */ false); - printer->Print( - variables_, - "@kotlin.jvm.JvmSynthetic\n" - "@kotlin.jvm.JvmName(\"plusAssignAll$kt_capitalized_name$\")\n" - "@Suppress(\"NOTHING_TO_INLINE\")\n" - "public inline operator fun com.google.protobuf.kotlin.DslList" - "." - "plusAssign(values: kotlin.collections.Iterable) {\n" - " addAll(values)\n" - "}\n"); - - // List[Int] = String - WriteFieldAccessorDocComment(printer, descriptor_, LIST_INDEXED_SETTER, - /* builder */ false); - printer->Print( - variables_, - "@kotlin.jvm.JvmSynthetic\n" - "@kotlin.jvm.JvmName(\"set$kt_capitalized_name$\")\n" - "public operator fun com.google.protobuf.kotlin.DslList" - "." - "set(index: kotlin.Int, value: kotlin.String) {\n" - " $kt_dsl_builder$.${$set$capitalized_name$$}$(index, value)\n" - "}"); - - WriteFieldAccessorDocComment(printer, descriptor_, CLEARER, - /* builder */ false); - printer->Print(variables_, - "@kotlin.jvm.JvmSynthetic\n" - "@kotlin.jvm.JvmName(\"clear$kt_capitalized_name$\")\n" - "public fun com.google.protobuf.kotlin.DslList" - "." - "clear() {\n" - " $kt_dsl_builder$.${$clear$capitalized_name$$}$()\n" - "}"); -} - -void RepeatedImmutableStringFieldLiteGenerator::GenerateFieldInfo( - io::Printer* printer, std::vector* output) const { - WriteIntToUtf16CharSequence(descriptor_->number(), output); - WriteIntToUtf16CharSequence(GetExperimentalJavaFieldType(descriptor_), - output); - printer->Print(variables_, "\"$name$_\",\n"); -} - -void RepeatedImmutableStringFieldLiteGenerator::GenerateInitializationCode( - io::Printer* printer) const { - printer->Print(variables_, "$name$_ = $empty_list$;\n"); -} - -std::string RepeatedImmutableStringFieldLiteGenerator::GetBoxedType() const { - return "java.lang.String"; -} - -} // namespace java -} // namespace compiler -} // namespace protobuf -} // namespace google diff --git a/extra/protobuf/protobuf-3.19.4/src/google/protobuf/compiler/java/java_string_field_lite.h b/extra/protobuf/protobuf-3.19.4/src/google/protobuf/compiler/java/java_string_field_lite.h deleted file mode 100644 index 85ec6027762f..000000000000 --- a/extra/protobuf/protobuf-3.19.4/src/google/protobuf/compiler/java/java_string_field_lite.h +++ /dev/null @@ -1,139 +0,0 @@ -// Protocol Buffers - Google's data interchange format -// Copyright 2008 Google Inc. All rights reserved. -// https://developers.google.com/protocol-buffers/ -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// * Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// * Redistributions in binary form must reproduce the above -// copyright notice, this list of conditions and the following disclaimer -// in the documentation and/or other materials provided with the -// distribution. -// * Neither the name of Google Inc. nor the names of its -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -// Author: kenton@google.com (Kenton Varda) -// Author: jonp@google.com (Jon Perlow) -// Based on original Protocol Buffers design by -// Sanjay Ghemawat, Jeff Dean, and others. - -#ifndef GOOGLE_PROTOBUF_COMPILER_JAVA_STRING_FIELD_LITE_H__ -#define GOOGLE_PROTOBUF_COMPILER_JAVA_STRING_FIELD_LITE_H__ - -#include -#include -#include - -#include - -namespace google { -namespace protobuf { -namespace compiler { -namespace java { -class Context; // context.h -class ClassNameResolver; // name_resolver.h -} // namespace java -} // namespace compiler -} // namespace protobuf -} // namespace google - -namespace google { -namespace protobuf { -namespace compiler { -namespace java { - -class ImmutableStringFieldLiteGenerator : public ImmutableFieldLiteGenerator { - public: - explicit ImmutableStringFieldLiteGenerator(const FieldDescriptor* descriptor, - int messageBitIndex, - Context* context); - ~ImmutableStringFieldLiteGenerator() override; - - // implements ImmutableFieldLiteGenerator - // ------------------------------------ - int GetNumBitsForMessage() const override; - void GenerateInterfaceMembers(io::Printer* printer) const override; - void GenerateMembers(io::Printer* printer) const override; - void GenerateBuilderMembers(io::Printer* printer) const override; - void GenerateInitializationCode(io::Printer* printer) const override; - void GenerateFieldInfo(io::Printer* printer, - std::vector* output) const override; - void GenerateKotlinDslMembers(io::Printer* printer) const override; - - std::string GetBoxedType() const override; - - protected: - const FieldDescriptor* descriptor_; - std::map variables_; - const int messageBitIndex_; - ClassNameResolver* name_resolver_; - - private: - GOOGLE_DISALLOW_EVIL_CONSTRUCTORS(ImmutableStringFieldLiteGenerator); -}; - -class ImmutableStringOneofFieldLiteGenerator - : public ImmutableStringFieldLiteGenerator { - public: - ImmutableStringOneofFieldLiteGenerator(const FieldDescriptor* descriptor, - int messageBitIndex, Context* context); - ~ImmutableStringOneofFieldLiteGenerator() override; - - private: - void GenerateMembers(io::Printer* printer) const override; - void GenerateBuilderMembers(io::Printer* printer) const override; - void GenerateFieldInfo(io::Printer* printer, - std::vector* output) const override; - - GOOGLE_DISALLOW_EVIL_CONSTRUCTORS(ImmutableStringOneofFieldLiteGenerator); -}; - -class RepeatedImmutableStringFieldLiteGenerator - : public ImmutableFieldLiteGenerator { - public: - explicit RepeatedImmutableStringFieldLiteGenerator( - const FieldDescriptor* descriptor, int messageBitIndex, Context* context); - ~RepeatedImmutableStringFieldLiteGenerator() override; - - // implements ImmutableFieldLiteGenerator ------------------------------------ - int GetNumBitsForMessage() const override; - void GenerateInterfaceMembers(io::Printer* printer) const override; - void GenerateMembers(io::Printer* printer) const override; - void GenerateBuilderMembers(io::Printer* printer) const override; - void GenerateInitializationCode(io::Printer* printer) const override; - void GenerateFieldInfo(io::Printer* printer, - std::vector* output) const override; - void GenerateKotlinDslMembers(io::Printer* printer) const override; - - std::string GetBoxedType() const override; - - private: - const FieldDescriptor* descriptor_; - std::map variables_; - ClassNameResolver* name_resolver_; - - GOOGLE_DISALLOW_EVIL_CONSTRUCTORS(RepeatedImmutableStringFieldLiteGenerator); -}; - -} // namespace java -} // namespace compiler -} // namespace protobuf -} // namespace google - -#endif // GOOGLE_PROTOBUF_COMPILER_JAVA_STRING_FIELD_LITE_H__ diff --git a/extra/protobuf/protobuf-3.19.4/src/google/protobuf/compiler/js/js_generator.cc b/extra/protobuf/protobuf-3.19.4/src/google/protobuf/compiler/js/js_generator.cc deleted file mode 100644 index cc5f0dc5c64c..000000000000 --- a/extra/protobuf/protobuf-3.19.4/src/google/protobuf/compiler/js/js_generator.cc +++ /dev/null @@ -1,3945 +0,0 @@ -// Protocol Buffers - Google's data interchange format -// Copyright 2008 Google Inc. All rights reserved. -// https://developers.google.com/protocol-buffers/ -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// * Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// * Redistributions in binary form must reproduce the above -// copyright notice, this list of conditions and the following disclaimer -// in the documentation and/or other materials provided with the -// distribution. -// * Neither the name of Google Inc. nor the names of its -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#include -#include -#include -#include -#include -#include -#include - -namespace google { -namespace protobuf { -namespace compiler { -namespace js { - -// Sorted list of JavaScript keywords. These cannot be used as names. If they -// appear, we prefix them with "pb_". -const char* kKeyword[] = { - "abstract", "boolean", "break", "byte", "case", - "catch", "char", "class", "const", "continue", - "debugger", "default", "delete", "do", "double", - "else", "enum", "export", "extends", "false", - "final", "finally", "float", "for", "function", - "goto", "if", "implements", "import", "in", - "instanceof", "int", "interface", "long", "native", - "new", "null", "package", "private", "protected", - "public", "return", "short", "static", "super", - "switch", "synchronized", "this", "throw", "throws", - "transient", "try", "typeof", "var", "void", - "volatile", "while", "with", -}; - -static const int kNumKeyword = sizeof(kKeyword) / sizeof(char*); - -namespace { - -// The mode of operation for bytes fields. Historically JSPB always carried -// bytes as JS {string}, containing base64 content by convention. With binary -// and proto3 serialization the new convention is to represent it as binary -// data in Uint8Array. See b/26173701 for background on the migration. -enum BytesMode { - BYTES_DEFAULT, // Default type for getBytesField to return. - BYTES_B64, // Explicitly coerce to base64 string where needed. - BYTES_U8, // Explicitly coerce to Uint8Array where needed. -}; - -bool IsReserved(const std::string& ident) { - for (int i = 0; i < kNumKeyword; i++) { - if (ident == kKeyword[i]) { - return true; - } - } - return false; -} - -std::string GetSnakeFilename(const std::string& filename) { - std::string snake_name = filename; - ReplaceCharacters(&snake_name, "/", '_'); - return snake_name; -} - -// Given a filename like foo/bar/baz.proto, returns the corresponding JavaScript -// file foo/bar/baz.js. -std::string GetJSFilename(const GeneratorOptions& options, - const std::string& filename) { - return StripProto(filename) + options.GetFileNameExtension(); -} - -// Given a filename like foo/bar/baz.proto, returns the root directory -// path ../../ -std::string GetRootPath(const std::string& from_filename, - const std::string& to_filename) { - if (to_filename.find("google/protobuf") == 0) { - // Well-known types (.proto files in the google/protobuf directory) are - // assumed to come from the 'google-protobuf' npm package. We may want to - // generalize this exception later by letting others put generated code in - // their own npm packages. - return "google-protobuf/"; - } - - size_t slashes = std::count(from_filename.begin(), from_filename.end(), '/'); - if (slashes == 0) { - return "./"; - } - std::string result = ""; - for (size_t i = 0; i < slashes; i++) { - result += "../"; - } - return result; -} - -// Returns the alias we assign to the module of the given .proto filename -// when importing. -std::string ModuleAlias(const std::string& filename) { - // This scheme could technically cause problems if a file includes any 2 of: - // foo/bar_baz.proto - // foo_bar_baz.proto - // foo_bar/baz.proto - // - // We'll worry about this problem if/when we actually see it. This name isn't - // exposed to users so we can change it later if we need to. - std::string basename = StripProto(filename); - ReplaceCharacters(&basename, "-", '$'); - ReplaceCharacters(&basename, "/", '_'); - ReplaceCharacters(&basename, ".", '_'); - return basename + "_pb"; -} - -// Returns the fully normalized JavaScript namespace for the given -// file descriptor's package. -std::string GetNamespace(const GeneratorOptions& options, - const FileDescriptor* file) { - if (!options.namespace_prefix.empty()) { - return options.namespace_prefix; - } else if (!file->package().empty()) { - return "proto." + file->package(); - } else { - return "proto"; - } -} - -// Returns the name of the message with a leading dot and taking into account -// nesting, for example ".OuterMessage.InnerMessage", or returns empty if -// descriptor is null. This function does not handle namespacing, only message -// nesting. -std::string GetNestedMessageName(const Descriptor* descriptor) { - if (descriptor == NULL) { - return ""; - } - std::string result = - StripPrefixString(descriptor->full_name(), descriptor->file()->package()); - // Add a leading dot if one is not already present. - if (!result.empty() && result[0] != '.') { - result = "." + result; - } - return result; -} - -// Returns the path prefix for a message or enumeration that -// lives under the given file and containing type. -std::string GetPrefix(const GeneratorOptions& options, - const FileDescriptor* file_descriptor, - const Descriptor* containing_type) { - std::string prefix = GetNamespace(options, file_descriptor) + - GetNestedMessageName(containing_type); - if (!prefix.empty()) { - prefix += "."; - } - return prefix; -} - -// Returns the fully normalized JavaScript path prefix for the given -// message descriptor. -std::string GetMessagePathPrefix(const GeneratorOptions& options, - const Descriptor* descriptor) { - return GetPrefix(options, descriptor->file(), descriptor->containing_type()); -} - -// Returns the fully normalized JavaScript path for the given -// message descriptor. -std::string GetMessagePath(const GeneratorOptions& options, - const Descriptor* descriptor) { - return GetMessagePathPrefix(options, descriptor) + descriptor->name(); -} - -// Returns the fully normalized JavaScript path prefix for the given -// enumeration descriptor. -std::string GetEnumPathPrefix(const GeneratorOptions& options, - const EnumDescriptor* enum_descriptor) { - return GetPrefix(options, enum_descriptor->file(), - enum_descriptor->containing_type()); -} - -// Returns the fully normalized JavaScript path for the given -// enumeration descriptor. -std::string GetEnumPath(const GeneratorOptions& options, - const EnumDescriptor* enum_descriptor) { - return GetEnumPathPrefix(options, enum_descriptor) + enum_descriptor->name(); -} - -std::string MaybeCrossFileRef(const GeneratorOptions& options, - const FileDescriptor* from_file, - const Descriptor* to_message) { - if ((options.import_style == GeneratorOptions::kImportCommonJs || - options.import_style == GeneratorOptions::kImportCommonJsStrict) && - from_file != to_message->file()) { - // Cross-file ref in CommonJS needs to use the module alias instead of - // the global name. - return ModuleAlias(to_message->file()->name()) + - GetNestedMessageName(to_message->containing_type()) + "." + - to_message->name(); - } else { - // Within a single file we use a full name. - return GetMessagePath(options, to_message); - } -} - -std::string SubmessageTypeRef(const GeneratorOptions& options, - const FieldDescriptor* field) { - GOOGLE_CHECK(field->cpp_type() == FieldDescriptor::CPPTYPE_MESSAGE); - return MaybeCrossFileRef(options, field->file(), field->message_type()); -} - -// - Object field name: LOWER_UNDERSCORE -> LOWER_CAMEL, except for group fields -// (UPPER_CAMEL -> LOWER_CAMEL), with "List" (or "Map") appended if appropriate, -// and with reserved words triggering a "pb_" prefix. -// - Getters/setters: LOWER_UNDERSCORE -> UPPER_CAMEL, except for group fields -// (use the name directly), then append "List" if appropriate, then append "$" -// if resulting name is equal to a reserved word. -// - Enums: just uppercase. - -// Locale-independent version of ToLower that deals only with ASCII A-Z. -char ToLowerASCII(char c) { - if (c >= 'A' && c <= 'Z') { - return (c - 'A') + 'a'; - } else { - return c; - } -} - -std::vector ParseLowerUnderscore(const std::string& input) { - std::vector words; - std::string running = ""; - for (int i = 0; i < input.size(); i++) { - if (input[i] == '_') { - if (!running.empty()) { - words.push_back(running); - running.clear(); - } - } else { - running += ToLowerASCII(input[i]); - } - } - if (!running.empty()) { - words.push_back(running); - } - return words; -} - -std::vector ParseUpperCamel(const std::string& input) { - std::vector words; - std::string running = ""; - for (int i = 0; i < input.size(); i++) { - if (input[i] >= 'A' && input[i] <= 'Z' && !running.empty()) { - words.push_back(running); - running.clear(); - } - running += ToLowerASCII(input[i]); - } - if (!running.empty()) { - words.push_back(running); - } - return words; -} - -std::string ToLowerCamel(const std::vector& words) { - std::string result; - for (int i = 0; i < words.size(); i++) { - std::string word = words[i]; - if (i == 0 && (word[0] >= 'A' && word[0] <= 'Z')) { - word[0] = (word[0] - 'A') + 'a'; - } else if (i != 0 && (word[0] >= 'a' && word[0] <= 'z')) { - word[0] = (word[0] - 'a') + 'A'; - } - result += word; - } - return result; -} - -std::string ToUpperCamel(const std::vector& words) { - std::string result; - for (int i = 0; i < words.size(); i++) { - std::string word = words[i]; - if (word[0] >= 'a' && word[0] <= 'z') { - word[0] = (word[0] - 'a') + 'A'; - } - result += word; - } - return result; -} - -// Based on code from descriptor.cc (Thanks Kenton!) -// Uppercases the entire string, turning ValueName into -// VALUENAME. -std::string ToEnumCase(const std::string& input) { - std::string result; - result.reserve(input.size()); - - for (int i = 0; i < input.size(); i++) { - if ('a' <= input[i] && input[i] <= 'z') { - result.push_back(input[i] - 'a' + 'A'); - } else { - result.push_back(input[i]); - } - } - - return result; -} - -std::string ToLower(const std::string& input) { - std::string result; - result.reserve(input.size()); - - for (int i = 0; i < input.size(); i++) { - if ('A' <= input[i] && input[i] <= 'Z') { - result.push_back(input[i] - 'A' + 'a'); - } else { - result.push_back(input[i]); - } - } - - return result; -} - -// When we're generating one output file per SCC, this is the filename -// that top-level extensions should go in. -// e.g. one proto file (test.proto): -// package a; -// extends Foo { -// ... -// } -// If "with_filename" equals true, the extension filename will be -// "proto.a_test_extensions.js", otherwise will be "proto.a.js" -std::string GetExtensionFileName(const GeneratorOptions& options, - const FileDescriptor* file, - bool with_filename) { - std::string snake_name = StripProto(GetSnakeFilename(file->name())); - return options.output_dir + "/" + ToLower(GetNamespace(options, file)) + - (with_filename ? ("_" + snake_name + "_extensions") : "") + - options.GetFileNameExtension(); -} -// When we're generating one output file per SCC, this is the filename -// that all messages in the SCC should go in. -// If with_package equals true, filename will have package prefix, -// If the filename length is longer than 200, the filename will be the -// SCC's proto filename with suffix "_long_sccs_(index)" (if with_package equals -// true it still has package prefix) -std::string GetMessagesFileName(const GeneratorOptions& options, const SCC* scc, - bool with_package) { - static std::map* long_name_dict = - new std::map(); - std::string package_base = - with_package - ? ToLower(GetNamespace(options, scc->GetRepresentative()->file()) + - "_") - : ""; - std::string filename_base = ""; - std::vector all_message_names; - for (auto one_desc : scc->descriptors) { - if (one_desc->containing_type() == nullptr) { - all_message_names.push_back(ToLower(one_desc->name())); - } - } - sort(all_message_names.begin(), all_message_names.end()); - for (auto one_message : all_message_names) { - if (!filename_base.empty()) { - filename_base += "_"; - } - filename_base += one_message; - } - if (filename_base.size() + package_base.size() > 200) { - if ((*long_name_dict).find(scc->GetRepresentative()) == - (*long_name_dict).end()) { - std::string snake_name = StripProto( - GetSnakeFilename(scc->GetRepresentative()->file()->name())); - (*long_name_dict)[scc->GetRepresentative()] = - StrCat(snake_name, "_long_sccs_", - static_cast((*long_name_dict).size())); - } - filename_base = (*long_name_dict)[scc->GetRepresentative()]; - } - return options.output_dir + "/" + package_base + filename_base + - options.GetFileNameExtension(); -} - -// When we're generating one output file per type name, this is the filename -// that a top-level enum should go in. -// If with_package equals true, filename will have package prefix. -std::string GetEnumFileName(const GeneratorOptions& options, - const EnumDescriptor* desc, bool with_package) { - return options.output_dir + "/" + - (with_package ? ToLower(GetNamespace(options, desc->file()) + "_") - : "") + - ToLower(desc->name()) + options.GetFileNameExtension(); -} - -// Returns the message/response ID, if set. -std::string GetMessageId(const Descriptor* desc) { return std::string(); } - -bool IgnoreExtensionField(const FieldDescriptor* field) { - // Exclude descriptor extensions from output "to avoid clutter" (from original - // codegen). - if (!field->is_extension()) return false; - const FileDescriptor* file = field->containing_type()->file(); - return file->name() == "net/proto2/proto/descriptor.proto" || - file->name() == "google/protobuf/descriptor.proto"; -} - -// Used inside Google only -- do not remove. -bool IsResponse(const Descriptor* desc) { return false; } - -bool IgnoreField(const FieldDescriptor* field) { - return IgnoreExtensionField(field); -} - -// Do we ignore this message type? -bool IgnoreMessage(const Descriptor* d) { return d->options().map_entry(); } - -// Does JSPB ignore this entire oneof? True only if all fields are ignored. -bool IgnoreOneof(const OneofDescriptor* oneof) { - if (oneof->is_synthetic()) return true; - for (int i = 0; i < oneof->field_count(); i++) { - if (!IgnoreField(oneof->field(i))) { - return false; - } - } - return true; -} - -std::string JSIdent(const GeneratorOptions& options, - const FieldDescriptor* field, bool is_upper_camel, - bool is_map, bool drop_list) { - std::string result; - if (field->type() == FieldDescriptor::TYPE_GROUP) { - result = is_upper_camel - ? ToUpperCamel(ParseUpperCamel(field->message_type()->name())) - : ToLowerCamel(ParseUpperCamel(field->message_type()->name())); - } else { - result = is_upper_camel ? ToUpperCamel(ParseLowerUnderscore(field->name())) - : ToLowerCamel(ParseLowerUnderscore(field->name())); - } - if (is_map || field->is_map()) { - // JSPB-style or proto3-style map. - result += "Map"; - } else if (!drop_list && field->is_repeated()) { - // Repeated field. - result += "List"; - } - return result; -} - -std::string JSObjectFieldName(const GeneratorOptions& options, - const FieldDescriptor* field) { - std::string name = JSIdent(options, field, - /* is_upper_camel = */ false, - /* is_map = */ false, - /* drop_list = */ false); - if (IsReserved(name)) { - name = "pb_" + name; - } - return name; -} - -std::string JSByteGetterSuffix(BytesMode bytes_mode) { - switch (bytes_mode) { - case BYTES_DEFAULT: - return ""; - case BYTES_B64: - return "B64"; - case BYTES_U8: - return "U8"; - default: - assert(false); - } - return ""; -} - -// Returns the field name as a capitalized portion of a getter/setter method -// name, e.g. MyField for .getMyField(). -std::string JSGetterName(const GeneratorOptions& options, - const FieldDescriptor* field, - BytesMode bytes_mode = BYTES_DEFAULT, - bool drop_list = false) { - std::string name = JSIdent(options, field, - /* is_upper_camel = */ true, - /* is_map = */ false, drop_list); - if (field->type() == FieldDescriptor::TYPE_BYTES) { - std::string suffix = JSByteGetterSuffix(bytes_mode); - if (!suffix.empty()) { - name += "_as" + suffix; - } - } - if (name == "Extension" || name == "JsPbMessageId") { - // Avoid conflicts with base-class names. - name += "$"; - } - return name; -} - -std::string JSOneofName(const OneofDescriptor* oneof) { - return ToUpperCamel(ParseLowerUnderscore(oneof->name())); -} - -// Returns the index corresponding to this field in the JSPB array (underlying -// data storage array). -std::string JSFieldIndex(const FieldDescriptor* field) { - // Determine whether this field is a member of a group. Group fields are a bit - // wonky: their "containing type" is a message type created just for the - // group, and that type's parent type has a field with the group-message type - // as its message type and TYPE_GROUP as its field type. For such fields, the - // index we use is relative to the field number of the group submessage field. - // For all other fields, we just use the field number. - const Descriptor* containing_type = field->containing_type(); - const Descriptor* parent_type = containing_type->containing_type(); - if (parent_type != NULL) { - for (int i = 0; i < parent_type->field_count(); i++) { - if (parent_type->field(i)->type() == FieldDescriptor::TYPE_GROUP && - parent_type->field(i)->message_type() == containing_type) { - return StrCat(field->number() - parent_type->field(i)->number()); - } - } - } - return StrCat(field->number()); -} - -std::string JSOneofIndex(const OneofDescriptor* oneof) { - int index = -1; - for (int i = 0; i < oneof->containing_type()->oneof_decl_count(); i++) { - const OneofDescriptor* o = oneof->containing_type()->oneof_decl(i); - if (o->is_synthetic()) continue; - // If at least one field in this oneof is not JSPB-ignored, count the oneof. - for (int j = 0; j < o->field_count(); j++) { - const FieldDescriptor* f = o->field(j); - if (!IgnoreField(f)) { - index++; - break; // inner loop - } - } - if (o == oneof) { - break; - } - } - return StrCat(index); -} - -// Decodes a codepoint in \x0000 -- \xFFFF. -uint16 DecodeUTF8Codepoint(uint8* bytes, size_t* length) { - if (*length == 0) { - return 0; - } - size_t expected = 0; - if ((*bytes & 0x80) == 0) { - expected = 1; - } else if ((*bytes & 0xe0) == 0xc0) { - expected = 2; - } else if ((*bytes & 0xf0) == 0xe0) { - expected = 3; - } else { - // Too long -- don't accept. - *length = 0; - return 0; - } - - if (*length < expected) { - // Not enough bytes -- don't accept. - *length = 0; - return 0; - } - - *length = expected; - switch (expected) { - case 1: - return bytes[0]; - case 2: - return ((bytes[0] & 0x1F) << 6) | ((bytes[1] & 0x3F) << 0); - case 3: - return ((bytes[0] & 0x0F) << 12) | ((bytes[1] & 0x3F) << 6) | - ((bytes[2] & 0x3F) << 0); - default: - return 0; - } -} - -// Escapes the contents of a string to be included within double-quotes ("") in -// JavaScript. The input data should be a UTF-8 encoded C++ string of chars. -// Returns false if |out| was truncated because |in| contained invalid UTF-8 or -// codepoints outside the BMP. -// TODO(b/115551870): Support codepoints outside the BMP. -bool EscapeJSString(const std::string& in, std::string* out) { - size_t decoded = 0; - for (size_t i = 0; i < in.size(); i += decoded) { - uint16 codepoint = 0; - // Decode the next UTF-8 codepoint. - size_t have_bytes = in.size() - i; - uint8 bytes[3] = { - static_cast(in[i]), - static_cast(((i + 1) < in.size()) ? in[i + 1] : 0), - static_cast(((i + 2) < in.size()) ? in[i + 2] : 0), - }; - codepoint = DecodeUTF8Codepoint(bytes, &have_bytes); - if (have_bytes == 0) { - return false; - } - decoded = have_bytes; - - switch (codepoint) { - case '\'': - *out += "\\x27"; - break; - case '"': - *out += "\\x22"; - break; - case '<': - *out += "\\x3c"; - break; - case '=': - *out += "\\x3d"; - break; - case '>': - *out += "\\x3e"; - break; - case '&': - *out += "\\x26"; - break; - case '\b': - *out += "\\b"; - break; - case '\t': - *out += "\\t"; - break; - case '\n': - *out += "\\n"; - break; - case '\f': - *out += "\\f"; - break; - case '\r': - *out += "\\r"; - break; - case '\\': - *out += "\\\\"; - break; - default: - // TODO(b/115551870): Once we're supporting codepoints outside the BMP, - // use a single Unicode codepoint escape if the output language is - // ECMAScript 2015 or above. Otherwise, use a surrogate pair. - // https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Lexical_grammar#String_literals - if (codepoint >= 0x20 && codepoint <= 0x7e) { - *out += static_cast(codepoint); - } else if (codepoint >= 0x100) { - *out += StringPrintf("\\u%04x", codepoint); - } else { - *out += StringPrintf("\\x%02x", codepoint); - } - break; - } - } - return true; -} - -std::string EscapeBase64(const std::string& in) { - static const char* kAlphabet = - "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"; - std::string result; - - for (size_t i = 0; i < in.size(); i += 3) { - int value = (in[i] << 16) | (((i + 1) < in.size()) ? (in[i + 1] << 8) : 0) | - (((i + 2) < in.size()) ? (in[i + 2] << 0) : 0); - result += kAlphabet[(value >> 18) & 0x3f]; - result += kAlphabet[(value >> 12) & 0x3f]; - if ((i + 1) < in.size()) { - result += kAlphabet[(value >> 6) & 0x3f]; - } else { - result += '='; - } - if ((i + 2) < in.size()) { - result += kAlphabet[(value >> 0) & 0x3f]; - } else { - result += '='; - } - } - - return result; -} - -// Post-process the result of SimpleFtoa/SimpleDtoa to *exactly* match the -// original codegen's formatting (which is just .toString() on java.lang.Double -// or java.lang.Float). -std::string PostProcessFloat(std::string result) { - // If inf, -inf or nan, replace with +Infinity, -Infinity or NaN. - if (result == "inf") { - return "Infinity"; - } else if (result == "-inf") { - return "-Infinity"; - } else if (result == "nan") { - return "NaN"; - } - - // If scientific notation (e.g., "1e10"), (i) capitalize the "e", (ii) - // ensure that the mantissa (portion prior to the "e") has at least one - // fractional digit (after the decimal point), and (iii) strip any unnecessary - // leading zeroes and/or '+' signs from the exponent. - std::string::size_type exp_pos = result.find('e'); - if (exp_pos != std::string::npos) { - std::string mantissa = result.substr(0, exp_pos); - std::string exponent = result.substr(exp_pos + 1); - - // Add ".0" to mantissa if no fractional part exists. - if (mantissa.find('.') == std::string::npos) { - mantissa += ".0"; - } - - // Strip the sign off the exponent and store as |exp_neg|. - bool exp_neg = false; - if (!exponent.empty() && exponent[0] == '+') { - exponent = exponent.substr(1); - } else if (!exponent.empty() && exponent[0] == '-') { - exp_neg = true; - exponent = exponent.substr(1); - } - - // Strip any leading zeroes off the exponent. - while (exponent.size() > 1 && exponent[0] == '0') { - exponent = exponent.substr(1); - } - - return mantissa + "E" + std::string(exp_neg ? "-" : "") + exponent; - } - - // Otherwise, this is an ordinary decimal number. Append ".0" if result has no - // decimal/fractional part in order to match output of original codegen. - if (result.find('.') == std::string::npos) { - result += ".0"; - } - - return result; -} - -std::string FloatToString(float value) { - std::string result = SimpleFtoa(value); - return PostProcessFloat(result); -} - -std::string DoubleToString(double value) { - std::string result = SimpleDtoa(value); - return PostProcessFloat(result); -} - -bool InRealOneof(const FieldDescriptor* field) { - return field->containing_oneof() && - !field->containing_oneof()->is_synthetic(); -} - -// Return true if this is an integral field that should be represented as string -// in JS. -bool IsIntegralFieldWithStringJSType(const FieldDescriptor* field) { - switch (field->cpp_type()) { - case FieldDescriptor::CPPTYPE_INT64: - case FieldDescriptor::CPPTYPE_UINT64: - // The default value of JSType is JS_NORMAL, which behaves the same as - // JS_NUMBER. - return field->options().jstype() == FieldOptions::JS_STRING; - default: - return false; - } -} - -std::string MaybeNumberString(const FieldDescriptor* field, - const std::string& orig) { - return IsIntegralFieldWithStringJSType(field) ? ("\"" + orig + "\"") : orig; -} - -std::string JSFieldDefault(const FieldDescriptor* field) { - if (field->is_repeated()) { - return "[]"; - } - - switch (field->cpp_type()) { - case FieldDescriptor::CPPTYPE_INT32: - return MaybeNumberString(field, StrCat(field->default_value_int32())); - case FieldDescriptor::CPPTYPE_UINT32: - // The original codegen is in Java, and Java protobufs store unsigned - // integer values as signed integer values. In order to exactly match the - // output, we need to reinterpret as base-2 signed. Ugh. - return MaybeNumberString( - field, StrCat(static_cast(field->default_value_uint32()))); - case FieldDescriptor::CPPTYPE_INT64: - return MaybeNumberString(field, StrCat(field->default_value_int64())); - case FieldDescriptor::CPPTYPE_UINT64: - // See above note for uint32 -- reinterpreting as signed. - return MaybeNumberString( - field, StrCat(static_cast(field->default_value_uint64()))); - case FieldDescriptor::CPPTYPE_ENUM: - return StrCat(field->default_value_enum()->number()); - case FieldDescriptor::CPPTYPE_BOOL: - return field->default_value_bool() ? "true" : "false"; - case FieldDescriptor::CPPTYPE_FLOAT: - return FloatToString(field->default_value_float()); - case FieldDescriptor::CPPTYPE_DOUBLE: - return DoubleToString(field->default_value_double()); - case FieldDescriptor::CPPTYPE_STRING: - if (field->type() == FieldDescriptor::TYPE_STRING) { - std::string out; - bool is_valid = EscapeJSString(field->default_value_string(), &out); - if (!is_valid) { - // TODO(b/115551870): Decide whether this should be a hard error. - GOOGLE_LOG(WARNING) - << "The default value for field " << field->full_name() - << " was truncated since it contained invalid UTF-8 or" - " codepoints outside the basic multilingual plane."; - } - return "\"" + out + "\""; - } else { // Bytes - return "\"" + EscapeBase64(field->default_value_string()) + "\""; - } - case FieldDescriptor::CPPTYPE_MESSAGE: - return "null"; - } - GOOGLE_LOG(FATAL) << "Shouldn't reach here."; - return ""; -} - -std::string ProtoTypeName(const GeneratorOptions& options, - const FieldDescriptor* field) { - switch (field->type()) { - case FieldDescriptor::TYPE_BOOL: - return "bool"; - case FieldDescriptor::TYPE_INT32: - return "int32"; - case FieldDescriptor::TYPE_UINT32: - return "uint32"; - case FieldDescriptor::TYPE_SINT32: - return "sint32"; - case FieldDescriptor::TYPE_FIXED32: - return "fixed32"; - case FieldDescriptor::TYPE_SFIXED32: - return "sfixed32"; - case FieldDescriptor::TYPE_INT64: - return "int64"; - case FieldDescriptor::TYPE_UINT64: - return "uint64"; - case FieldDescriptor::TYPE_SINT64: - return "sint64"; - case FieldDescriptor::TYPE_FIXED64: - return "fixed64"; - case FieldDescriptor::TYPE_SFIXED64: - return "sfixed64"; - case FieldDescriptor::TYPE_FLOAT: - return "float"; - case FieldDescriptor::TYPE_DOUBLE: - return "double"; - case FieldDescriptor::TYPE_STRING: - return "string"; - case FieldDescriptor::TYPE_BYTES: - return "bytes"; - case FieldDescriptor::TYPE_GROUP: - return GetMessagePath(options, field->message_type()); - case FieldDescriptor::TYPE_ENUM: - return GetEnumPath(options, field->enum_type()); - case FieldDescriptor::TYPE_MESSAGE: - return GetMessagePath(options, field->message_type()); - default: - return ""; - } -} - -std::string JSIntegerTypeName(const FieldDescriptor* field) { - return IsIntegralFieldWithStringJSType(field) ? "string" : "number"; -} - -std::string JSStringTypeName(const GeneratorOptions& options, - const FieldDescriptor* field, - BytesMode bytes_mode) { - if (field->type() == FieldDescriptor::TYPE_BYTES) { - switch (bytes_mode) { - case BYTES_DEFAULT: - return "(string|Uint8Array)"; - case BYTES_B64: - return "string"; - case BYTES_U8: - return "Uint8Array"; - default: - assert(false); - } - } - return "string"; -} - -std::string JSTypeName(const GeneratorOptions& options, - const FieldDescriptor* field, BytesMode bytes_mode) { - switch (field->cpp_type()) { - case FieldDescriptor::CPPTYPE_BOOL: - return "boolean"; - case FieldDescriptor::CPPTYPE_INT32: - return JSIntegerTypeName(field); - case FieldDescriptor::CPPTYPE_INT64: - return JSIntegerTypeName(field); - case FieldDescriptor::CPPTYPE_UINT32: - return JSIntegerTypeName(field); - case FieldDescriptor::CPPTYPE_UINT64: - return JSIntegerTypeName(field); - case FieldDescriptor::CPPTYPE_FLOAT: - return "number"; - case FieldDescriptor::CPPTYPE_DOUBLE: - return "number"; - case FieldDescriptor::CPPTYPE_STRING: - return JSStringTypeName(options, field, bytes_mode); - case FieldDescriptor::CPPTYPE_ENUM: - return GetEnumPath(options, field->enum_type()); - case FieldDescriptor::CPPTYPE_MESSAGE: - return GetMessagePath(options, field->message_type()); - default: - return ""; - } -} - -// Used inside Google only -- do not remove. -bool UseBrokenPresenceSemantics(const GeneratorOptions& options, - const FieldDescriptor* field) { - return false; -} - -// Returns true for fields that return "null" from accessors when they are -// unset. This should normally only be true for non-repeated submessages, but we -// have legacy users who relied on old behavior where accessors behaved this -// way. -bool ReturnsNullWhenUnset(const GeneratorOptions& options, - const FieldDescriptor* field) { - if (field->cpp_type() == FieldDescriptor::CPPTYPE_MESSAGE && - field->is_optional()) { - return true; - } - - // TODO(haberman): remove this case and unconditionally return false. - return UseBrokenPresenceSemantics(options, field) && !field->is_repeated() && - !field->has_default_value(); -} - -// In a sane world, this would be the same as ReturnsNullWhenUnset(). But in -// the status quo, some fields declare that they never return null/undefined -// even though they actually do: -// * required fields -// * optional enum fields -// * proto3 primitive fields. -bool DeclaredReturnTypeIsNullable(const GeneratorOptions& options, - const FieldDescriptor* field) { - if (field->is_required() || field->type() == FieldDescriptor::TYPE_ENUM) { - return false; - } - - if (field->file()->syntax() == FileDescriptor::SYNTAX_PROTO3 && - field->cpp_type() != FieldDescriptor::CPPTYPE_MESSAGE) { - return false; - } - - return ReturnsNullWhenUnset(options, field); -} - -bool SetterAcceptsUndefined(const GeneratorOptions& options, - const FieldDescriptor* field) { - if (ReturnsNullWhenUnset(options, field)) { - return true; - } - - // Broken presence semantics always accepts undefined for setters. - return UseBrokenPresenceSemantics(options, field); -} - -bool SetterAcceptsNull(const GeneratorOptions& options, - const FieldDescriptor* field) { - if (ReturnsNullWhenUnset(options, field)) { - return true; - } - - // With broken presence semantics, fields with defaults accept "null" for - // setters, but other fields do not. This is a strange quirk of the old - // codegen. - return UseBrokenPresenceSemantics(options, field) && - field->has_default_value(); -} - -// Returns types which are known to by non-nullable by default. -// The style guide requires that we omit "!" in this case. -bool IsPrimitive(const std::string& type) { - return type == "undefined" || type == "string" || type == "number" || - type == "boolean"; -} - -std::string JSFieldTypeAnnotation(const GeneratorOptions& options, - const FieldDescriptor* field, - bool is_setter_argument, bool force_present, - bool singular_if_not_packed, - BytesMode bytes_mode = BYTES_DEFAULT, - bool force_singular = false) { - std::string jstype = JSTypeName(options, field, bytes_mode); - - if (!force_singular && field->is_repeated() && - (field->is_packed() || !singular_if_not_packed)) { - if (field->type() == FieldDescriptor::TYPE_BYTES && - bytes_mode == BYTES_DEFAULT) { - jstype = "(Array|Array)"; - } else { - if (!IsPrimitive(jstype)) { - jstype = "!" + jstype; - } - jstype = "Array<" + jstype + ">"; - } - } - - bool is_null_or_undefined = false; - - if (is_setter_argument) { - if (SetterAcceptsNull(options, field)) { - jstype = "?" + jstype; - is_null_or_undefined = true; - } - - if (SetterAcceptsUndefined(options, field)) { - jstype += "|undefined"; - is_null_or_undefined = true; - } - } else if (force_present) { - // Don't add null or undefined. - } else { - if (DeclaredReturnTypeIsNullable(options, field)) { - jstype = "?" + jstype; - is_null_or_undefined = true; - } - } - - if (!is_null_or_undefined && !IsPrimitive(jstype)) { - jstype = "!" + jstype; - } - - return jstype; -} - -std::string JSBinaryReaderMethodType(const FieldDescriptor* field) { - std::string name = field->type_name(); - if (name[0] >= 'a' && name[0] <= 'z') { - name[0] = (name[0] - 'a') + 'A'; - } - return IsIntegralFieldWithStringJSType(field) ? (name + "String") : name; -} - -std::string JSBinaryReadWriteMethodName(const FieldDescriptor* field, - bool is_writer) { - std::string name = JSBinaryReaderMethodType(field); - if (field->is_packed()) { - name = "Packed" + name; - } else if (is_writer && field->is_repeated()) { - name = "Repeated" + name; - } - return name; -} - -std::string JSBinaryReaderMethodName(const GeneratorOptions& options, - const FieldDescriptor* field) { - return "jspb.BinaryReader.prototype.read" + - JSBinaryReadWriteMethodName(field, /* is_writer = */ false); -} - -std::string JSBinaryWriterMethodName(const GeneratorOptions& options, - const FieldDescriptor* field) { - if (field->containing_type() && - field->containing_type()->options().message_set_wire_format()) { - return "jspb.BinaryWriter.prototype.writeMessageSet"; - } - return "jspb.BinaryWriter.prototype.write" + - JSBinaryReadWriteMethodName(field, /* is_writer = */ true); -} - -std::string JSTypeTag(const FieldDescriptor* desc) { - switch (desc->type()) { - case FieldDescriptor::TYPE_DOUBLE: - case FieldDescriptor::TYPE_FLOAT: - return "Float"; - case FieldDescriptor::TYPE_INT32: - case FieldDescriptor::TYPE_UINT32: - case FieldDescriptor::TYPE_INT64: - case FieldDescriptor::TYPE_UINT64: - case FieldDescriptor::TYPE_FIXED32: - case FieldDescriptor::TYPE_FIXED64: - case FieldDescriptor::TYPE_SINT32: - case FieldDescriptor::TYPE_SINT64: - case FieldDescriptor::TYPE_SFIXED32: - case FieldDescriptor::TYPE_SFIXED64: - if (IsIntegralFieldWithStringJSType(desc)) { - return "StringInt"; - } else { - return "Int"; - } - case FieldDescriptor::TYPE_BOOL: - return "Boolean"; - case FieldDescriptor::TYPE_STRING: - return "String"; - case FieldDescriptor::TYPE_BYTES: - return "Bytes"; - case FieldDescriptor::TYPE_ENUM: - return "Enum"; - default: - assert(false); - } - return ""; -} - -bool HasRepeatedFields(const GeneratorOptions& options, - const Descriptor* desc) { - for (int i = 0; i < desc->field_count(); i++) { - if (desc->field(i)->is_repeated() && !desc->field(i)->is_map()) { - return true; - } - } - return false; -} - -static const char* kRepeatedFieldArrayName = ".repeatedFields_"; - -std::string RepeatedFieldsArrayName(const GeneratorOptions& options, - const Descriptor* desc) { - return HasRepeatedFields(options, desc) - ? (GetMessagePath(options, desc) + kRepeatedFieldArrayName) - : "null"; -} - -bool HasOneofFields(const Descriptor* desc) { - for (int i = 0; i < desc->field_count(); i++) { - if (InRealOneof(desc->field(i))) { - return true; - } - } - return false; -} - -static const char* kOneofGroupArrayName = ".oneofGroups_"; - -std::string OneofFieldsArrayName(const GeneratorOptions& options, - const Descriptor* desc) { - return HasOneofFields(desc) - ? (GetMessagePath(options, desc) + kOneofGroupArrayName) - : "null"; -} - -std::string RepeatedFieldNumberList(const GeneratorOptions& options, - const Descriptor* desc) { - std::vector numbers; - for (int i = 0; i < desc->field_count(); i++) { - if (desc->field(i)->is_repeated() && !desc->field(i)->is_map()) { - numbers.push_back(JSFieldIndex(desc->field(i))); - } - } - return "[" + Join(numbers, ",") + "]"; -} - -std::string OneofGroupList(const Descriptor* desc) { - // List of arrays (one per oneof), each of which is a list of field indices - std::vector oneof_entries; - for (int i = 0; i < desc->oneof_decl_count(); i++) { - const OneofDescriptor* oneof = desc->oneof_decl(i); - if (IgnoreOneof(oneof)) { - continue; - } - - std::vector oneof_fields; - for (int j = 0; j < oneof->field_count(); j++) { - if (IgnoreField(oneof->field(j))) { - continue; - } - oneof_fields.push_back(JSFieldIndex(oneof->field(j))); - } - oneof_entries.push_back("[" + Join(oneof_fields, ",") + "]"); - } - return "[" + Join(oneof_entries, ",") + "]"; -} - -std::string JSOneofArray(const GeneratorOptions& options, - const FieldDescriptor* field) { - return OneofFieldsArrayName(options, field->containing_type()) + "[" + - JSOneofIndex(field->containing_oneof()) + "]"; -} - -std::string RelativeTypeName(const FieldDescriptor* field) { - assert(field->cpp_type() == FieldDescriptor::CPPTYPE_ENUM || - field->cpp_type() == FieldDescriptor::CPPTYPE_MESSAGE); - // For a field with an enum or message type, compute a name relative to the - // path name of the message type containing this field. - std::string package = field->file()->package(); - std::string containing_type = field->containing_type()->full_name() + "."; - std::string type = (field->cpp_type() == FieldDescriptor::CPPTYPE_ENUM) - ? field->enum_type()->full_name() - : field->message_type()->full_name(); - - // |prefix| is advanced as we find separators '.' past the common package - // prefix that yield common prefixes in the containing type's name and this - // type's name. - int prefix = 0; - for (int i = 0; i < type.size() && i < containing_type.size(); i++) { - if (type[i] != containing_type[i]) { - break; - } - if (type[i] == '.' && i >= package.size()) { - prefix = i + 1; - } - } - - return type.substr(prefix); -} - -std::string JSExtensionsObjectName(const GeneratorOptions& options, - const FileDescriptor* from_file, - const Descriptor* desc) { - if (desc->full_name() == "google.protobuf.bridge.MessageSet") { - // TODO(haberman): fix this for the kImportCommonJs case. - return "jspb.Message.messageSetExtensions"; - } else { - return MaybeCrossFileRef(options, from_file, desc) + ".extensions"; - } -} - -static const int kMapKeyField = 1; -static const int kMapValueField = 2; - -const FieldDescriptor* MapFieldKey(const FieldDescriptor* field) { - assert(field->is_map()); - return field->message_type()->FindFieldByNumber(kMapKeyField); -} - -const FieldDescriptor* MapFieldValue(const FieldDescriptor* field) { - assert(field->is_map()); - return field->message_type()->FindFieldByNumber(kMapValueField); -} - -std::string FieldDefinition(const GeneratorOptions& options, - const FieldDescriptor* field) { - if (field->is_map()) { - const FieldDescriptor* key_field = MapFieldKey(field); - const FieldDescriptor* value_field = MapFieldValue(field); - std::string key_type = ProtoTypeName(options, key_field); - std::string value_type; - if (value_field->type() == FieldDescriptor::TYPE_ENUM || - value_field->type() == FieldDescriptor::TYPE_MESSAGE) { - value_type = RelativeTypeName(value_field); - } else { - value_type = ProtoTypeName(options, value_field); - } - return StringPrintf("map<%s, %s> %s = %d;", key_type.c_str(), - value_type.c_str(), field->name().c_str(), - field->number()); - } else { - std::string qualifier = - field->is_repeated() ? "repeated" - : (field->is_optional() ? "optional" : "required"); - std::string type, name; - if (field->type() == FieldDescriptor::TYPE_ENUM || - field->type() == FieldDescriptor::TYPE_MESSAGE) { - type = RelativeTypeName(field); - name = field->name(); - } else if (field->type() == FieldDescriptor::TYPE_GROUP) { - type = "group"; - name = field->message_type()->name(); - } else { - type = ProtoTypeName(options, field); - name = field->name(); - } - return StringPrintf("%s %s %s = %d;", qualifier.c_str(), type.c_str(), - name.c_str(), field->number()); - } -} - -std::string FieldComments(const FieldDescriptor* field, BytesMode bytes_mode) { - std::string comments; - if (field->type() == FieldDescriptor::TYPE_BYTES && bytes_mode == BYTES_U8) { - comments += - " * Note that Uint8Array is not supported on all browsers.\n" - " * @see http://caniuse.com/Uint8Array\n"; - } - return comments; -} - -bool ShouldGenerateExtension(const FieldDescriptor* field) { - return field->is_extension() && !IgnoreField(field); -} - -bool HasExtensions(const Descriptor* desc) { - for (int i = 0; i < desc->extension_count(); i++) { - if (ShouldGenerateExtension(desc->extension(i))) { - return true; - } - } - for (int i = 0; i < desc->nested_type_count(); i++) { - if (HasExtensions(desc->nested_type(i))) { - return true; - } - } - return false; -} - -bool HasExtensions(const FileDescriptor* file) { - for (int i = 0; i < file->extension_count(); i++) { - if (ShouldGenerateExtension(file->extension(i))) { - return true; - } - } - for (int i = 0; i < file->message_type_count(); i++) { - if (HasExtensions(file->message_type(i))) { - return true; - } - } - return false; -} - -bool HasMap(const GeneratorOptions& options, const Descriptor* desc) { - for (int i = 0; i < desc->field_count(); i++) { - if (desc->field(i)->is_map()) { - return true; - } - } - for (int i = 0; i < desc->nested_type_count(); i++) { - if (HasMap(options, desc->nested_type(i))) { - return true; - } - } - return false; -} - -bool FileHasMap(const GeneratorOptions& options, const FileDescriptor* desc) { - for (int i = 0; i < desc->message_type_count(); i++) { - if (HasMap(options, desc->message_type(i))) { - return true; - } - } - return false; -} - -bool IsExtendable(const Descriptor* desc) { - return desc->extension_range_count() > 0; -} - -// Returns the max index in the underlying data storage array beyond which the -// extension object is used. -std::string GetPivot(const Descriptor* desc) { - static const int kDefaultPivot = 500; - - // Find the max field number - int max_field_number = 0; - for (int i = 0; i < desc->field_count(); i++) { - if (!IgnoreField(desc->field(i)) && - desc->field(i)->number() > max_field_number) { - max_field_number = desc->field(i)->number(); - } - } - - int pivot = -1; - if (IsExtendable(desc) || (max_field_number >= kDefaultPivot)) { - pivot = ((max_field_number + 1) < kDefaultPivot) ? (max_field_number + 1) - : kDefaultPivot; - } - - return StrCat(pivot); -} - -// Whether this field represents presence. For fields with presence, we -// generate extra methods (clearFoo() and hasFoo()) for this field. -bool HasFieldPresence(const GeneratorOptions& options, - const FieldDescriptor* field) { - // This returns false for repeated fields and maps, but we still do - // generate clearFoo() methods for these through a special case elsewhere. - return field->has_presence(); -} - -// We use this to implement the semantics that same file can be generated -// multiple times, but only the last one keep the short name. Others all use -// long name with extra information to distinguish (For message and enum, the -// extra information is package name, for file level extension, the extra -// information is proto's filename). -// We never actually write the files, but we keep a set of which descriptors -// were the final one for a given filename. -class FileDeduplicator { - public: - explicit FileDeduplicator(const GeneratorOptions& options) {} - - // params: - // filenames: a pair of {short filename, full filename} - // (short filename don't have extra information, full filename - // contains extra information) - // desc: The Descriptor or SCC pointer or EnumDescriptor. - bool AddFile(const std::pair filenames, - const void* desc) { - if (descs_by_shortname_.find(filenames.first) != - descs_by_shortname_.end()) { - // Change old pointer's actual name to full name. - auto short_name_desc = descs_by_shortname_[filenames.first]; - allowed_descs_actual_name_[short_name_desc] = - allowed_descs_full_name_[short_name_desc]; - } - descs_by_shortname_[filenames.first] = desc; - allowed_descs_actual_name_[desc] = filenames.first; - allowed_descs_full_name_[desc] = filenames.second; - - return true; - } - - void GetAllowedMap(std::map* allowed_set) { - *allowed_set = allowed_descs_actual_name_; - } - - private: - // The map that restores all the descs that are using short name as filename. - std::map descs_by_shortname_; - // The final actual filename map. - std::map allowed_descs_actual_name_; - // The full name map. - std::map allowed_descs_full_name_; -}; - -void DepthFirstSearch(const FileDescriptor* file, - std::vector* list, - std::set* seen) { - if (!seen->insert(file).second) { - return; - } - - // Add all dependencies. - for (int i = 0; i < file->dependency_count(); i++) { - DepthFirstSearch(file->dependency(i), list, seen); - } - - // Add this file. - list->push_back(file); -} - -// A functor for the predicate to remove_if() below. Returns true if a given -// FileDescriptor is not in the given set. -class NotInSet { - public: - explicit NotInSet(const std::set& file_set) - : file_set_(file_set) {} - - bool operator()(const FileDescriptor* file) { - return file_set_.count(file) == 0; - } - - private: - const std::set& file_set_; -}; - -// This function generates an ordering of the input FileDescriptors that matches -// the logic of the old code generator. The order is significant because two -// different input files can generate the same output file, and the last one -// needs to win. -void GenerateJspbFileOrder(const std::vector& input, - std::vector* ordered) { - // First generate an ordering of all reachable files (including dependencies) - // with depth-first search. This mimics the behavior of --include_imports, - // which is what the old codegen used. - ordered->clear(); - std::set seen; - std::set input_set; - for (int i = 0; i < input.size(); i++) { - DepthFirstSearch(input[i], ordered, &seen); - input_set.insert(input[i]); - } - - // Now remove the entries that are not actually in our input list. - ordered->erase( - std::remove_if(ordered->begin(), ordered->end(), NotInSet(input_set)), - ordered->end()); -} - -} // namespace - -// If we're generating code in file-per-type mode, avoid overwriting files -// by choosing the last descriptor that writes each filename and permitting -// only those to generate code. - -struct DepsGenerator { - std::vector operator()(const Descriptor* desc) const { - std::vector deps; - auto maybe_add = [&](const Descriptor* d) { - if (d) deps.push_back(d); - }; - for (int i = 0; i < desc->field_count(); i++) { - if (!IgnoreField(desc->field(i))) { - maybe_add(desc->field(i)->message_type()); - } - } - for (int i = 0; i < desc->extension_count(); i++) { - maybe_add(desc->extension(i)->message_type()); - maybe_add(desc->extension(i)->containing_type()); - } - for (int i = 0; i < desc->nested_type_count(); i++) { - maybe_add(desc->nested_type(i)); - } - maybe_add(desc->containing_type()); - - return deps; - } -}; - -namespace { - -bool GenerateJspbAllowedMap(const GeneratorOptions& options, - const std::vector& files, - std::map* allowed_set, - SCCAnalyzer* analyzer) { - std::vector files_ordered; - GenerateJspbFileOrder(files, &files_ordered); - - // Choose the last descriptor for each filename. - FileDeduplicator dedup(options); - std::set added; - for (int i = 0; i < files_ordered.size(); i++) { - for (int j = 0; j < files_ordered[i]->message_type_count(); j++) { - const Descriptor* desc = files_ordered[i]->message_type(j); - if (added.insert(analyzer->GetSCC(desc)).second && - !dedup.AddFile( - std::make_pair( - GetMessagesFileName(options, analyzer->GetSCC(desc), false), - GetMessagesFileName(options, analyzer->GetSCC(desc), true)), - analyzer->GetSCC(desc))) { - return false; - } - } - for (int j = 0; j < files_ordered[i]->enum_type_count(); j++) { - const EnumDescriptor* desc = files_ordered[i]->enum_type(j); - if (!dedup.AddFile(std::make_pair(GetEnumFileName(options, desc, false), - GetEnumFileName(options, desc, true)), - desc)) { - return false; - } - } - - // Pull out all free-floating extensions and generate files for those too. - bool has_extension = false; - - for (int j = 0; j < files_ordered[i]->extension_count(); j++) { - if (ShouldGenerateExtension(files_ordered[i]->extension(j))) { - has_extension = true; - } - } - - if (has_extension) { - if (!dedup.AddFile( - std::make_pair( - GetExtensionFileName(options, files_ordered[i], false), - GetExtensionFileName(options, files_ordered[i], true)), - files_ordered[i])) { - return false; - } - } - } - - dedup.GetAllowedMap(allowed_set); - - return true; -} - -// Embeds base64 encoded GeneratedCodeInfo proto in a comment at the end of -// file. -void EmbedCodeAnnotations(const GeneratedCodeInfo& annotations, - io::Printer* printer) { - // Serialize annotations proto into base64 string. - std::string meta_content; - annotations.SerializeToString(&meta_content); - std::string meta_64; - Base64Escape(meta_content, &meta_64); - - // Print base64 encoded annotations at the end of output file in - // a comment. - printer->Print("\n// Below is base64 encoded GeneratedCodeInfo proto"); - printer->Print("\n// $encoded_proto$\n", "encoded_proto", meta_64); -} - -bool IsWellKnownTypeFile(const FileDescriptor* file) { - return HasPrefixString(file->name(), "google/protobuf/"); -} - -} // anonymous namespace - -void Generator::GenerateHeader(const GeneratorOptions& options, - const FileDescriptor* file, - io::Printer* printer) const { - if (file != nullptr) { - printer->Print("// source: $filename$\n", "filename", file->name()); - } - printer->Print( - "/**\n" - " * @fileoverview\n" - " * @enhanceable\n" - // TODO(b/152440355): requireType/requires diverged from internal version. - " * @suppress {missingRequire} reports error on implicit type usages.\n" - " * @suppress {messageConventions} JS Compiler reports an " - "error if a variable or\n" - " * field starts with 'MSG_' and isn't a translatable " - "message.\n" - " * @public\n" - " */\n" - "// GENERATED CODE -- DO NOT EDIT!\n" - "/* eslint-disable */\n" - "// @ts-nocheck\n" - "\n"); -} - -void Generator::FindProvidesForFile(const GeneratorOptions& options, - io::Printer* printer, - const FileDescriptor* file, - std::set* provided) const { - for (int i = 0; i < file->message_type_count(); i++) { - FindProvidesForMessage(options, printer, file->message_type(i), provided); - } - for (int i = 0; i < file->enum_type_count(); i++) { - FindProvidesForEnum(options, printer, file->enum_type(i), provided); - } -} - -void Generator::FindProvides(const GeneratorOptions& options, - io::Printer* printer, - const std::vector& files, - std::set* provided) const { - for (int i = 0; i < files.size(); i++) { - FindProvidesForFile(options, printer, files[i], provided); - } - - printer->Print("\n"); -} - -void FindProvidesForOneOfEnum(const GeneratorOptions& options, - const OneofDescriptor* oneof, - std::set* provided) { - std::string name = GetMessagePath(options, oneof->containing_type()) + "." + - JSOneofName(oneof) + "Case"; - provided->insert(name); -} - -void FindProvidesForOneOfEnums(const GeneratorOptions& options, - io::Printer* printer, const Descriptor* desc, - std::set* provided) { - if (HasOneofFields(desc)) { - for (int i = 0; i < desc->oneof_decl_count(); i++) { - if (IgnoreOneof(desc->oneof_decl(i))) { - continue; - } - FindProvidesForOneOfEnum(options, desc->oneof_decl(i), provided); - } - } -} - -void Generator::FindProvidesForMessage(const GeneratorOptions& options, - io::Printer* printer, - const Descriptor* desc, - std::set* provided) const { - if (IgnoreMessage(desc)) { - return; - } - - std::string name = GetMessagePath(options, desc); - provided->insert(name); - - for (int i = 0; i < desc->enum_type_count(); i++) { - FindProvidesForEnum(options, printer, desc->enum_type(i), provided); - } - - FindProvidesForOneOfEnums(options, printer, desc, provided); - - for (int i = 0; i < desc->nested_type_count(); i++) { - FindProvidesForMessage(options, printer, desc->nested_type(i), provided); - } -} -void Generator::FindProvidesForEnum(const GeneratorOptions& options, - io::Printer* printer, - const EnumDescriptor* enumdesc, - std::set* provided) const { - std::string name = GetEnumPath(options, enumdesc); - provided->insert(name); -} - -void Generator::FindProvidesForFields( - const GeneratorOptions& options, io::Printer* printer, - const std::vector& fields, - std::set* provided) const { - for (int i = 0; i < fields.size(); i++) { - const FieldDescriptor* field = fields[i]; - - if (IgnoreField(field)) { - continue; - } - - std::string name = GetNamespace(options, field->file()) + "." + - JSObjectFieldName(options, field); - provided->insert(name); - } -} - -void Generator::GenerateProvides(const GeneratorOptions& options, - io::Printer* printer, - std::set* provided) const { - for (std::set::iterator it = provided->begin(); - it != provided->end(); ++it) { - if (options.import_style == GeneratorOptions::kImportClosure) { - printer->Print("goog.provide('$name$');\n", "name", *it); - } else { - // We aren't using Closure's import system, but we use goog.exportSymbol() - // to construct the expected tree of objects, eg. - // - // goog.exportSymbol('foo.bar.Baz', null, this); - // - // // Later generated code expects foo.bar = {} to exist: - // foo.bar.Baz = function() { /* ... */ } - - // Do not use global scope in strict mode - if (options.import_style == GeneratorOptions::kImportCommonJsStrict) { - std::string namespaceObject = *it; - // Remove "proto." from the namespace object - GOOGLE_CHECK_EQ(0, namespaceObject.compare(0, 6, "proto.")); - namespaceObject.erase(0, 6); - printer->Print("goog.exportSymbol('$name$', null, proto);\n", "name", - namespaceObject); - } else { - printer->Print("goog.exportSymbol('$name$', null, global);\n", "name", - *it); - } - } - } -} - -void Generator::GenerateRequiresForSCC(const GeneratorOptions& options, - io::Printer* printer, const SCC* scc, - std::set* provided) const { - std::set required; - std::set forwards; - bool have_message = false; - bool has_extension = false; - bool has_map = false; - for (auto desc : scc->descriptors) { - if (desc->containing_type() == nullptr) { - FindRequiresForMessage(options, desc, &required, &forwards, - &have_message); - has_extension = (has_extension || HasExtensions(desc)); - has_map = (has_map || HasMap(options, desc)); - } - } - - GenerateRequiresImpl(options, printer, &required, &forwards, provided, - /* require_jspb = */ have_message, - /* require_extension = */ has_extension, - /* require_map = */ has_map); -} - -void Generator::GenerateRequiresForLibrary( - const GeneratorOptions& options, io::Printer* printer, - const std::vector& files, - std::set* provided) const { - GOOGLE_CHECK_EQ(options.import_style, GeneratorOptions::kImportClosure); - // For Closure imports we need to import every message type individually. - std::set required; - std::set forwards; - bool have_extensions = false; - bool have_map = false; - bool have_message = false; - - for (int i = 0; i < files.size(); i++) { - for (int j = 0; j < files[i]->message_type_count(); j++) { - const Descriptor* desc = files[i]->message_type(j); - if (!IgnoreMessage(desc)) { - FindRequiresForMessage(options, desc, &required, &forwards, - &have_message); - } - } - - if (!have_extensions && HasExtensions(files[i])) { - have_extensions = true; - } - - if (!have_map && FileHasMap(options, files[i])) { - have_map = true; - } - - for (int j = 0; j < files[i]->extension_count(); j++) { - const FieldDescriptor* extension = files[i]->extension(j); - if (IgnoreField(extension)) { - continue; - } - if (extension->containing_type()->full_name() != - "google.protobuf.bridge.MessageSet") { - required.insert(GetMessagePath(options, extension->containing_type())); - } - FindRequiresForField(options, extension, &required, &forwards); - have_extensions = true; - } - } - - GenerateRequiresImpl(options, printer, &required, &forwards, provided, - /* require_jspb = */ have_message, - /* require_extension = */ have_extensions, - /* require_map = */ have_map); -} - -void Generator::GenerateRequiresForExtensions( - const GeneratorOptions& options, io::Printer* printer, - const std::vector& fields, - std::set* provided) const { - std::set required; - std::set forwards; - for (int i = 0; i < fields.size(); i++) { - const FieldDescriptor* field = fields[i]; - if (IgnoreField(field)) { - continue; - } - FindRequiresForExtension(options, field, &required, &forwards); - } - - GenerateRequiresImpl(options, printer, &required, &forwards, provided, - /* require_jspb = */ false, - /* require_extension = */ fields.size() > 0, - /* require_map = */ false); -} - -void Generator::GenerateRequiresImpl(const GeneratorOptions& options, - io::Printer* printer, - std::set* required, - std::set* forwards, - std::set* provided, - bool require_jspb, bool require_extension, - bool require_map) const { - if (require_jspb) { - required->insert("jspb.Message"); - required->insert("jspb.BinaryReader"); - required->insert("jspb.BinaryWriter"); - } - if (require_extension) { - required->insert("jspb.ExtensionFieldBinaryInfo"); - required->insert("jspb.ExtensionFieldInfo"); - } - if (require_map) { - required->insert("jspb.Map"); - } - - std::set::iterator it; - for (it = required->begin(); it != required->end(); ++it) { - if (provided->find(*it) != provided->end()) { - continue; - } - printer->Print("goog.require('$name$');\n", "name", *it); - } - - printer->Print("\n"); - - for (it = forwards->begin(); it != forwards->end(); ++it) { - if (provided->find(*it) != provided->end()) { - continue; - } - printer->Print("goog.forwardDeclare('$name$');\n", "name", *it); - } -} - -bool NamespaceOnly(const Descriptor* desc) { return false; } - -void Generator::FindRequiresForMessage(const GeneratorOptions& options, - const Descriptor* desc, - std::set* required, - std::set* forwards, - bool* have_message) const { - if (!NamespaceOnly(desc)) { - *have_message = true; - for (int i = 0; i < desc->field_count(); i++) { - const FieldDescriptor* field = desc->field(i); - if (IgnoreField(field)) { - continue; - } - FindRequiresForField(options, field, required, forwards); - } - } - - for (int i = 0; i < desc->extension_count(); i++) { - const FieldDescriptor* field = desc->extension(i); - if (IgnoreField(field)) { - continue; - } - FindRequiresForExtension(options, field, required, forwards); - } - - for (int i = 0; i < desc->nested_type_count(); i++) { - FindRequiresForMessage(options, desc->nested_type(i), required, forwards, - have_message); - } -} - -void Generator::FindRequiresForField(const GeneratorOptions& options, - const FieldDescriptor* field, - std::set* required, - std::set* forwards) const { - if (field->cpp_type() == FieldDescriptor::CPPTYPE_ENUM && - // N.B.: file-level extensions with enum type do *not* create - // dependencies, as per original codegen. - !(field->is_extension() && field->extension_scope() == nullptr)) { - if (options.add_require_for_enums) { - required->insert(GetEnumPath(options, field->enum_type())); - } else { - forwards->insert(GetEnumPath(options, field->enum_type())); - } - } else if (field->cpp_type() == FieldDescriptor::CPPTYPE_MESSAGE) { - if (!IgnoreMessage(field->message_type())) { - required->insert(GetMessagePath(options, field->message_type())); - } - } -} - -void Generator::FindRequiresForExtension( - const GeneratorOptions& options, const FieldDescriptor* field, - std::set* required, std::set* forwards) const { - if (field->containing_type()->full_name() != - "google.protobuf.bridge.MessageSet") { - required->insert(GetMessagePath(options, field->containing_type())); - } - FindRequiresForField(options, field, required, forwards); -} - -void Generator::GenerateTestOnly(const GeneratorOptions& options, - io::Printer* printer) const { - if (options.testonly) { - printer->Print("goog.setTestOnly();\n\n"); - } - printer->Print("\n"); -} - -void Generator::GenerateClassesAndEnums(const GeneratorOptions& options, - io::Printer* printer, - const FileDescriptor* file) const { - for (int i = 0; i < file->message_type_count(); i++) { - GenerateClassConstructorAndDeclareExtensionFieldInfo(options, printer, - file->message_type(i)); - } - for (int i = 0; i < file->message_type_count(); i++) { - GenerateClass(options, printer, file->message_type(i)); - } - for (int i = 0; i < file->enum_type_count(); i++) { - GenerateEnum(options, printer, file->enum_type(i)); - } -} - -void Generator::GenerateClass(const GeneratorOptions& options, - io::Printer* printer, - const Descriptor* desc) const { - if (IgnoreMessage(desc)) { - return; - } - - if (!NamespaceOnly(desc)) { - printer->Print("\n"); - GenerateClassFieldInfo(options, printer, desc); - - GenerateClassToObject(options, printer, desc); - // These must come *before* the extension-field info generation in - // GenerateClassRegistration so that references to the binary - // serialization/deserialization functions may be placed in the extension - // objects. - GenerateClassDeserializeBinary(options, printer, desc); - GenerateClassSerializeBinary(options, printer, desc); - } - - // Recurse on nested types. These must come *before* the extension-field - // info generation in GenerateClassRegistration so that extensions that - // reference nested types proceed the definitions of the nested types. - for (int i = 0; i < desc->enum_type_count(); i++) { - GenerateEnum(options, printer, desc->enum_type(i)); - } - for (int i = 0; i < desc->nested_type_count(); i++) { - GenerateClass(options, printer, desc->nested_type(i)); - } - - if (!NamespaceOnly(desc)) { - GenerateClassRegistration(options, printer, desc); - GenerateClassFields(options, printer, desc); - - if (options.import_style != GeneratorOptions::kImportClosure) { - for (int i = 0; i < desc->extension_count(); i++) { - GenerateExtension(options, printer, desc->extension(i)); - } - } - } -} - -void Generator::GenerateClassConstructor(const GeneratorOptions& options, - io::Printer* printer, - const Descriptor* desc) const { - printer->Print( - "/**\n" - " * Generated by JsPbCodeGenerator.\n" - " * @param {Array=} opt_data Optional initial data array, typically " - "from a\n" - " * server response, or constructed directly in Javascript. The array " - "is used\n" - " * in place and becomes part of the constructed object. It is not " - "cloned.\n" - " * If no data is provided, the constructed object will be empty, but " - "still\n" - " * valid.\n" - " * @extends {jspb.Message}\n" - " * @constructor\n" - " */\n" - "$classprefix$$classname$ = function(opt_data) {\n", - "classprefix", GetMessagePathPrefix(options, desc), "classname", - desc->name()); - printer->Annotate("classname", desc); - std::string message_id = GetMessageId(desc); - printer->Print( - " jspb.Message.initialize(this, opt_data, $messageId$, $pivot$, " - "$rptfields$, $oneoffields$);\n", - "messageId", - !message_id.empty() ? ("'" + message_id + "'") - : (IsResponse(desc) ? "''" : "0"), - "pivot", GetPivot(desc), "rptfields", - RepeatedFieldsArrayName(options, desc), "oneoffields", - OneofFieldsArrayName(options, desc)); - printer->Print( - "};\n" - "goog.inherits($classname$, jspb.Message);\n" - "if (goog.DEBUG && !COMPILED) {\n" - // displayName overrides Function.prototype.displayName - // http://google3/javascript/externs/es3.js?l=511 - " /**\n" - " * @public\n" - " * @override\n" - " */\n" - " $classname$.displayName = '$classname$';\n" - "}\n", - "classname", GetMessagePath(options, desc)); -} - -void Generator::GenerateClassConstructorAndDeclareExtensionFieldInfo( - const GeneratorOptions& options, io::Printer* printer, - const Descriptor* desc) const { - if (!NamespaceOnly(desc)) { - GenerateClassConstructor(options, printer, desc); - if (IsExtendable(desc) && - desc->full_name() != "google.protobuf.bridge.MessageSet") { - GenerateClassExtensionFieldInfo(options, printer, desc); - } - } - for (int i = 0; i < desc->nested_type_count(); i++) { - if (!IgnoreMessage(desc->nested_type(i))) { - GenerateClassConstructorAndDeclareExtensionFieldInfo( - options, printer, desc->nested_type(i)); - } - } -} - -void Generator::GenerateClassFieldInfo(const GeneratorOptions& options, - io::Printer* printer, - const Descriptor* desc) const { - if (HasRepeatedFields(options, desc)) { - printer->Print( - "/**\n" - " * List of repeated fields within this message type.\n" - " * @private {!Array}\n" - " * @const\n" - " */\n" - "$classname$$rptfieldarray$ = $rptfields$;\n" - "\n", - "classname", GetMessagePath(options, desc), "rptfieldarray", - kRepeatedFieldArrayName, "rptfields", - RepeatedFieldNumberList(options, desc)); - } - - if (HasOneofFields(desc)) { - printer->Print( - "/**\n" - " * Oneof group definitions for this message. Each group defines the " - "field\n" - " * numbers belonging to that group. When of these fields' value is " - "set, all\n" - " * other fields in the group are cleared. During deserialization, if " - "multiple\n" - " * fields are encountered for a group, only the last value seen will " - "be kept.\n" - " * @private {!Array>}\n" - " * @const\n" - " */\n" - "$classname$$oneofgrouparray$ = $oneofgroups$;\n" - "\n", - "classname", GetMessagePath(options, desc), "oneofgrouparray", - kOneofGroupArrayName, "oneofgroups", OneofGroupList(desc)); - - for (int i = 0; i < desc->oneof_decl_count(); i++) { - if (IgnoreOneof(desc->oneof_decl(i))) { - continue; - } - GenerateOneofCaseDefinition(options, printer, desc->oneof_decl(i)); - } - } -} - -void Generator::GenerateClassXid(const GeneratorOptions& options, - io::Printer* printer, - const Descriptor* desc) const { - printer->Print( - "\n" - "\n" - "$class$.prototype.messageXid = xid('$class$');\n", - "class", GetMessagePath(options, desc)); -} - -void Generator::GenerateOneofCaseDefinition( - const GeneratorOptions& options, io::Printer* printer, - const OneofDescriptor* oneof) const { - printer->Print( - "/**\n" - " * @enum {number}\n" - " */\n" - "$classname$.$oneof$Case = {\n" - " $upcase$_NOT_SET: 0", - "classname", GetMessagePath(options, oneof->containing_type()), "oneof", - JSOneofName(oneof), "upcase", ToEnumCase(oneof->name())); - - for (int i = 0; i < oneof->field_count(); i++) { - if (IgnoreField(oneof->field(i))) { - continue; - } - - printer->Print( - ",\n" - " $upcase$: $number$", - "upcase", ToEnumCase(oneof->field(i)->name()), "number", - JSFieldIndex(oneof->field(i))); - printer->Annotate("upcase", oneof->field(i)); - } - - printer->Print( - "\n" - "};\n" - "\n" - "/**\n" - " * @return {$class$.$oneof$Case}\n" - " */\n" - "$class$.prototype.get$oneof$Case = function() {\n" - " return /** @type {$class$.$oneof$Case} */(jspb.Message." - "computeOneofCase(this, $class$.oneofGroups_[$oneofindex$]));\n" - "};\n" - "\n", - "class", GetMessagePath(options, oneof->containing_type()), "oneof", - JSOneofName(oneof), "oneofindex", JSOneofIndex(oneof)); -} - -void Generator::GenerateClassToObject(const GeneratorOptions& options, - io::Printer* printer, - const Descriptor* desc) const { - printer->Print( - "\n" - "\n" - "if (jspb.Message.GENERATE_TO_OBJECT) {\n" - "/**\n" - " * Creates an object representation of this proto.\n" - " * Field names that are reserved in JavaScript and will be renamed to " - "pb_name.\n" - " * Optional fields that are not set will be set to undefined.\n" - " * To access a reserved field use, foo.pb_, eg, foo.pb_default.\n" - " * For the list of reserved names please see:\n" - " * net/proto2/compiler/js/internal/generator.cc#kKeyword.\n" - " * @param {boolean=} opt_includeInstance Deprecated. whether to include " - "the\n" - " * JSPB instance for transitional soy proto support:\n" - " * http://goto/soy-param-migration\n" - " * @return {!Object}\n" - " */\n" - "$classname$.prototype.toObject = function(opt_includeInstance) {\n" - " return $classname$.toObject(opt_includeInstance, this);\n" - "};\n" - "\n" - "\n" - "/**\n" - " * Static version of the {@see toObject} method.\n" - " * @param {boolean|undefined} includeInstance Deprecated. Whether to " - "include\n" - " * the JSPB instance for transitional soy proto support:\n" - " * http://goto/soy-param-migration\n" - " * @param {!$classname$} msg The msg instance to transform.\n" - " * @return {!Object}\n" - " * @suppress {unusedLocalVariables} f is only used for nested messages\n" - " */\n" - "$classname$.toObject = function(includeInstance, msg) {\n" - " var f, obj = {", - "classname", GetMessagePath(options, desc)); - - bool first = true; - for (int i = 0; i < desc->field_count(); i++) { - const FieldDescriptor* field = desc->field(i); - if (IgnoreField(field)) { - continue; - } - - if (!first) { - printer->Print(",\n "); - } else { - printer->Print("\n "); - first = false; - } - - GenerateClassFieldToObject(options, printer, field); - } - - if (!first) { - printer->Print("\n };\n\n"); - } else { - printer->Print("\n\n };\n\n"); - } - - if (IsExtendable(desc)) { - printer->Print( - " jspb.Message.toObjectExtension(/** @type {!jspb.Message} */ (msg), " - "obj,\n" - " $extObject$, $class$.prototype.getExtension,\n" - " includeInstance);\n", - "extObject", JSExtensionsObjectName(options, desc->file(), desc), - "class", GetMessagePath(options, desc)); - } - - printer->Print( - " if (includeInstance) {\n" - " obj.$$jspbMessageInstance = msg;\n" - " }\n" - " return obj;\n" - "};\n" - "}\n" - "\n" - "\n", - "classname", GetMessagePath(options, desc)); -} - -void Generator::GenerateFieldValueExpression(io::Printer* printer, - const char* obj_reference, - const FieldDescriptor* field, - bool use_default) const { - const bool is_float_or_double = - field->cpp_type() == FieldDescriptor::CPPTYPE_FLOAT || - field->cpp_type() == FieldDescriptor::CPPTYPE_DOUBLE; - const bool is_boolean = field->cpp_type() == FieldDescriptor::CPPTYPE_BOOL; - - const std::string with_default = use_default ? "WithDefault" : ""; - const std::string default_arg = - use_default ? StrCat(", ", JSFieldDefault(field)) : ""; - const std::string cardinality = field->is_repeated() ? "Repeated" : ""; - std::string type = ""; - if (is_float_or_double) { - type = "FloatingPoint"; - } - if (is_boolean) { - type = "Boolean"; - } - - // Prints the appropriate function, among: - // - getField - // - getBooleanField - // - getFloatingPointField => Replaced by getOptionalFloatingPointField to - // preserve backward compatibility. - // - getFieldWithDefault - // - getBooleanFieldWithDefault - // - getFloatingPointFieldWithDefault - // - getRepeatedField - // - getRepeatedBooleanField - // - getRepeatedFloatingPointField - if (is_float_or_double && !field->is_repeated() && !use_default) { - printer->Print( - "jspb.Message.getOptionalFloatingPointField($obj$, " - "$index$$default$)", - "obj", obj_reference, "index", JSFieldIndex(field), "default", - default_arg); - } else { - printer->Print( - "jspb.Message.get$cardinality$$type$Field$with_default$($obj$, " - "$index$$default$)", - "cardinality", cardinality, "type", type, "with_default", with_default, - "obj", obj_reference, "index", JSFieldIndex(field), "default", - default_arg); - } -} - -void Generator::GenerateClassFieldToObject(const GeneratorOptions& options, - io::Printer* printer, - const FieldDescriptor* field) const { - printer->Print("$fieldname$: ", "fieldname", - JSObjectFieldName(options, field)); - - if (field->is_map()) { - const FieldDescriptor* value_field = MapFieldValue(field); - // If the map values are of a message type, we must provide their static - // toObject() method; otherwise we pass undefined for that argument. - std::string value_to_object; - if (value_field->cpp_type() == FieldDescriptor::CPPTYPE_MESSAGE) { - value_to_object = - GetMessagePath(options, value_field->message_type()) + ".toObject"; - } else { - value_to_object = "undefined"; - } - printer->Print( - "(f = msg.get$name$()) ? f.toObject(includeInstance, $valuetoobject$) " - ": []", - "name", JSGetterName(options, field), "valuetoobject", value_to_object); - } else if (field->cpp_type() == FieldDescriptor::CPPTYPE_MESSAGE) { - // Message field. - if (field->is_repeated()) { - { - printer->Print( - "jspb.Message.toObjectList(msg.get$getter$(),\n" - " $type$.toObject, includeInstance)", - "getter", JSGetterName(options, field), "type", - SubmessageTypeRef(options, field)); - } - } else { - printer->Print( - "(f = msg.get$getter$()) && " - "$type$.toObject(includeInstance, f)", - "getter", JSGetterName(options, field), "type", - SubmessageTypeRef(options, field)); - } - } else if (field->type() == FieldDescriptor::TYPE_BYTES) { - // For bytes fields we want to always return the B64 data. - printer->Print("msg.get$getter$()", "getter", - JSGetterName(options, field, BYTES_B64)); - } else { - bool use_default = field->has_default_value(); - - if (field->file()->syntax() == FileDescriptor::SYNTAX_PROTO3 && - // Repeated fields get initialized to their default in the constructor - // (why?), so we emit a plain getField() call for them. - !field->is_repeated()) { - // Proto3 puts all defaults (including implicit defaults) in toObject(). - // But for proto2 we leave the existing semantics unchanged: unset fields - // without default are unset. - use_default = true; - } - - // We don't implement this by calling the accessors, because the semantics - // of the accessors are changing independently of the toObject() semantics. - // We are migrating the accessors to return defaults instead of null, but - // it may take longer to migrate toObject (or we might not want to do it at - // all). So we want to generate independent code. - // The accessor for unset optional values without default should return - // null. Those are converted to undefined in the generated object. - if (!use_default) { - printer->Print("(f = "); - } - GenerateFieldValueExpression(printer, "msg", field, use_default); - if (!use_default) { - printer->Print(") == null ? undefined : f"); - } - } -} - -void Generator::GenerateObjectTypedef(const GeneratorOptions& options, - io::Printer* printer, - const Descriptor* desc) const { - // TODO(b/122687752): Consider renaming nested messages called ObjectFormat - // to prevent collisions. - const std::string type_name = GetMessagePath(options, desc) + ".ObjectFormat"; - - printer->Print( - "/**\n" - " * The raw object form of $messageName$ as accepted by the `fromObject` " - "method.\n" - " * @record\n" - " */\n" - "$typeName$ = function() {\n", - "messageName", desc->name(), "typeName", type_name); - - for (int i = 0; i < desc->field_count(); i++) { - if (i > 0) { - printer->Print("\n"); - } - printer->Print( - " /** @type {$fieldType$|undefined} */\n" - " this.$fieldName$;\n", - "fieldName", JSObjectFieldName(options, desc->field(i)), - // TODO(b/121097361): Add type checking for field values. - "fieldType", "?"); - } - - printer->Print("};\n\n"); -} - -void Generator::GenerateClassFromObject(const GeneratorOptions& options, - io::Printer* printer, - const Descriptor* desc) const { - printer->Print("if (jspb.Message.GENERATE_FROM_OBJECT) {\n\n"); - - GenerateObjectTypedef(options, printer, desc); - - printer->Print( - "/**\n" - " * Loads data from an object into a new instance of this proto.\n" - " * @param {!$classname$.ObjectFormat} obj\n" - " * The object representation of this proto to load the data from.\n" - " * @return {!$classname$}\n" - " */\n" - "$classname$.fromObject = function(obj) {\n" - " var msg = new $classname$();\n", - "classname", GetMessagePath(options, desc)); - - for (int i = 0; i < desc->field_count(); i++) { - const FieldDescriptor* field = desc->field(i); - if (!IgnoreField(field)) { - GenerateClassFieldFromObject(options, printer, field); - } - } - - printer->Print( - " return msg;\n" - "};\n" - "}\n\n"); -} - -void Generator::GenerateClassFieldFromObject( - const GeneratorOptions& options, io::Printer* printer, - const FieldDescriptor* field) const { - if (field->is_map()) { - const FieldDescriptor* value_field = MapFieldValue(field); - if (value_field->type() == FieldDescriptor::TYPE_MESSAGE) { - // Since the map values are of message type, we have to do some extra work - // to recursively call fromObject() on them before setting the map field. - printer->Print( - " obj.$name$ && jspb.Message.setWrapperField(\n" - " msg, $index$, jspb.Map.fromObject(obj.$name$, $fieldclass$, " - "$fieldclass$.fromObject));\n", - "name", JSObjectFieldName(options, field), "index", - JSFieldIndex(field), "fieldclass", - GetMessagePath(options, value_field->message_type())); - } else { - // `msg` is a newly-constructed message object that has not yet built any - // map containers wrapping underlying arrays, so we can simply directly - // set the array here without fear of a stale wrapper. - printer->Print( - " obj.$name$ && " - "jspb.Message.setField(msg, $index$, obj.$name$);\n", - "name", JSObjectFieldName(options, field), "index", - JSFieldIndex(field)); - } - } else if (field->cpp_type() == FieldDescriptor::CPPTYPE_MESSAGE) { - // Message field (singular or repeated) - if (field->is_repeated()) { - { - printer->Print( - " obj.$name$ && " - "jspb.Message.setRepeatedWrapperField(\n" - " msg, $index$, obj.$name$.map(\n" - " $fieldclass$.fromObject));\n", - "name", JSObjectFieldName(options, field), "index", - JSFieldIndex(field), "fieldclass", - SubmessageTypeRef(options, field)); - } - } else { - printer->Print( - " obj.$name$ && jspb.Message.setWrapperField(\n" - " msg, $index$, $fieldclass$.fromObject(obj.$name$));\n", - "name", JSObjectFieldName(options, field), "index", - JSFieldIndex(field), "fieldclass", SubmessageTypeRef(options, field)); - } - } else { - // Simple (primitive) field. - printer->Print( - " obj.$name$ != null && jspb.Message.setField(msg, $index$, " - "obj.$name$);\n", - "name", JSObjectFieldName(options, field), "index", - JSFieldIndex(field)); - } -} - -void Generator::GenerateClassRegistration(const GeneratorOptions& options, - io::Printer* printer, - const Descriptor* desc) const { - // Register any extensions defined inside this message type. - for (int i = 0; i < desc->extension_count(); i++) { - const FieldDescriptor* extension = desc->extension(i); - if (ShouldGenerateExtension(extension)) { - GenerateExtension(options, printer, extension); - } - } -} - -void Generator::GenerateClassFields(const GeneratorOptions& options, - io::Printer* printer, - const Descriptor* desc) const { - for (int i = 0; i < desc->field_count(); i++) { - if (!IgnoreField(desc->field(i))) { - GenerateClassField(options, printer, desc->field(i)); - } - } -} - -void GenerateBytesWrapper(const GeneratorOptions& options, io::Printer* printer, - const FieldDescriptor* field, BytesMode bytes_mode) { - std::string type = - JSFieldTypeAnnotation(options, field, - /* is_setter_argument = */ false, - /* force_present = */ false, - /* singular_if_not_packed = */ false, bytes_mode); - printer->Print( - "/**\n" - " * $fielddef$\n" - "$comment$" - " * This is a type-conversion wrapper around `get$defname$()`\n" - " * @return {$type$}\n" - " */\n" - "$class$.prototype.get$name$ = function() {\n" - " return /** @type {$type$} */ (jspb.Message.bytes$list$As$suffix$(\n" - " this.get$defname$()));\n" - "};\n" - "\n" - "\n", - "fielddef", FieldDefinition(options, field), "comment", - FieldComments(field, bytes_mode), "type", type, "class", - GetMessagePath(options, field->containing_type()), "name", - JSGetterName(options, field, bytes_mode), "list", - field->is_repeated() ? "List" : "", "suffix", - JSByteGetterSuffix(bytes_mode), "defname", - JSGetterName(options, field, BYTES_DEFAULT)); -} - -void Generator::GenerateClassField(const GeneratorOptions& options, - io::Printer* printer, - const FieldDescriptor* field) const { - if (field->is_map()) { - const FieldDescriptor* key_field = MapFieldKey(field); - const FieldDescriptor* value_field = MapFieldValue(field); - // Map field: special handling to instantiate the map object on demand. - std::string key_type = - JSFieldTypeAnnotation(options, key_field, - /* is_setter_argument = */ false, - /* force_present = */ true, - /* singular_if_not_packed = */ false); - std::string value_type = - JSFieldTypeAnnotation(options, value_field, - /* is_setter_argument = */ false, - /* force_present = */ true, - /* singular_if_not_packed = */ false); - - printer->Print( - "/**\n" - " * $fielddef$\n" - " * @param {boolean=} opt_noLazyCreate Do not create the map if\n" - " * empty, instead returning `undefined`\n" - " * @return {!jspb.Map<$keytype$,$valuetype$>}\n" - " */\n", - "fielddef", FieldDefinition(options, field), "keytype", key_type, - "valuetype", value_type); - printer->Print( - "$class$.prototype.$gettername$ = function(opt_noLazyCreate) {\n" - " return /** @type {!jspb.Map<$keytype$,$valuetype$>} */ (\n", - "class", GetMessagePath(options, field->containing_type()), - "gettername", "get" + JSGetterName(options, field), "keytype", key_type, - "valuetype", value_type); - printer->Annotate("gettername", field); - printer->Print( - " jspb.Message.getMapField(this, $index$, opt_noLazyCreate", - "index", JSFieldIndex(field)); - - if (value_field->type() == FieldDescriptor::TYPE_MESSAGE) { - printer->Print( - ",\n" - " $messageType$", - "messageType", GetMessagePath(options, value_field->message_type())); - } else { - printer->Print( - ",\n" - " null"); - } - - printer->Print("));\n"); - - printer->Print( - "};\n" - "\n" - "\n"); - } else if (field->cpp_type() == FieldDescriptor::CPPTYPE_MESSAGE) { - // Message field: special handling in order to wrap the underlying data - // array with a message object. - - printer->Print( - "/**\n" - " * $fielddef$\n" - "$comment$" - " * @return {$type$}\n" - " */\n", - "fielddef", FieldDefinition(options, field), "comment", - FieldComments(field, BYTES_DEFAULT), "type", - JSFieldTypeAnnotation(options, field, - /* is_setter_argument = */ false, - /* force_present = */ false, - /* singular_if_not_packed = */ false)); - printer->Print( - "$class$.prototype.$gettername$ = function() {\n" - " return /** @type{$type$} */ (\n" - " jspb.Message.get$rpt$WrapperField(this, $wrapperclass$, " - "$index$$required$));\n" - "};\n" - "\n" - "\n", - "class", GetMessagePath(options, field->containing_type()), - "gettername", "get" + JSGetterName(options, field), "type", - JSFieldTypeAnnotation(options, field, - /* is_setter_argument = */ false, - /* force_present = */ false, - /* singular_if_not_packed = */ false), - "rpt", (field->is_repeated() ? "Repeated" : ""), "index", - JSFieldIndex(field), "wrapperclass", SubmessageTypeRef(options, field), - "required", - (field->label() == FieldDescriptor::LABEL_REQUIRED ? ", 1" : "")); - printer->Annotate("gettername", field); - printer->Print( - "/**\n" - " * @param {$optionaltype$} value\n" - " * @return {!$class$} returns this\n" - "*/\n" - "$class$.prototype.$settername$ = function(value) {\n" - " return jspb.Message.set$oneoftag$$repeatedtag$WrapperField(", - "optionaltype", - JSFieldTypeAnnotation(options, field, - /* is_setter_argument = */ true, - /* force_present = */ false, - /* singular_if_not_packed = */ false), - "class", GetMessagePath(options, field->containing_type()), - "settername", "set" + JSGetterName(options, field), "oneoftag", - (InRealOneof(field) ? "Oneof" : ""), "repeatedtag", - (field->is_repeated() ? "Repeated" : "")); - printer->Annotate("settername", field); - - printer->Print( - "this, $index$$oneofgroup$, value);\n" - "};\n" - "\n" - "\n", - "index", JSFieldIndex(field), "oneofgroup", - (InRealOneof(field) ? (", " + JSOneofArray(options, field)) : "")); - - if (field->is_repeated()) { - GenerateRepeatedMessageHelperMethods(options, printer, field); - } - - } else { - bool untyped = false; - - // Simple (primitive) field, either singular or repeated. - - // TODO(b/26173701): Always use BYTES_DEFAULT for the getter return type; - // at this point we "lie" to non-binary users and tell the return - // type is always base64 string, pending a LSC to migrate to typed getters. - BytesMode bytes_mode = - field->type() == FieldDescriptor::TYPE_BYTES && !options.binary - ? BYTES_B64 - : BYTES_DEFAULT; - std::string typed_annotation = - JSFieldTypeAnnotation(options, field, - /* is_setter_argument = */ false, - /* force_present = */ false, - /* singular_if_not_packed = */ false, - /* bytes_mode = */ bytes_mode); - if (untyped) { - printer->Print( - "/**\n" - " * @return {?} Raw field, untyped.\n" - " */\n"); - } else { - printer->Print( - "/**\n" - " * $fielddef$\n" - "$comment$" - " * @return {$type$}\n" - " */\n", - "fielddef", FieldDefinition(options, field), "comment", - FieldComments(field, bytes_mode), "type", typed_annotation); - } - - printer->Print("$class$.prototype.$gettername$ = function() {\n", "class", - GetMessagePath(options, field->containing_type()), - "gettername", "get" + JSGetterName(options, field)); - printer->Annotate("gettername", field); - - if (untyped) { - printer->Print(" return "); - } else { - printer->Print(" return /** @type {$type$} */ (", "type", - typed_annotation); - } - - bool use_default = !ReturnsNullWhenUnset(options, field); - - // Raw fields with no default set should just return undefined. - if (untyped && !field->has_default_value()) { - use_default = false; - } - - // Repeated fields get initialized to their default in the constructor - // (why?), so we emit a plain getField() call for them. - if (field->is_repeated()) { - use_default = false; - } - - GenerateFieldValueExpression(printer, "this", field, use_default); - - if (untyped) { - printer->Print( - ";\n" - "};\n" - "\n" - "\n"); - } else { - printer->Print( - ");\n" - "};\n" - "\n" - "\n"); - } - - if (field->type() == FieldDescriptor::TYPE_BYTES && !untyped) { - GenerateBytesWrapper(options, printer, field, BYTES_B64); - GenerateBytesWrapper(options, printer, field, BYTES_U8); - } - - printer->Print( - "/**\n" - " * @param {$optionaltype$} value\n" - " * @return {!$class$} returns this\n" - " */\n", - "class", GetMessagePath(options, field->containing_type()), - "optionaltype", - untyped ? "*" - : JSFieldTypeAnnotation(options, field, - /* is_setter_argument = */ true, - /* force_present = */ false, - /* singular_if_not_packed = */ false)); - - if (field->file()->syntax() == FileDescriptor::SYNTAX_PROTO3 && - !field->is_repeated() && !field->is_map() && - !HasFieldPresence(options, field)) { - // Proto3 non-repeated and non-map fields without presence use the - // setProto3*Field function. - printer->Print( - "$class$.prototype.$settername$ = function(value) {\n" - " return jspb.Message.setProto3$typetag$Field(this, $index$, " - "value);" - "\n" - "};\n" - "\n" - "\n", - "class", GetMessagePath(options, field->containing_type()), - "settername", "set" + JSGetterName(options, field), "typetag", - JSTypeTag(field), "index", JSFieldIndex(field)); - printer->Annotate("settername", field); - } else { - // Otherwise, use the regular setField function. - printer->Print( - "$class$.prototype.$settername$ = function(value) {\n" - " return jspb.Message.set$oneoftag$Field(this, $index$", - "class", GetMessagePath(options, field->containing_type()), - "settername", "set" + JSGetterName(options, field), "oneoftag", - (InRealOneof(field) ? "Oneof" : ""), "index", JSFieldIndex(field)); - printer->Annotate("settername", field); - printer->Print( - "$oneofgroup$, $type$value$rptvalueinit$$typeclose$);\n" - "};\n" - "\n" - "\n", - "type", - untyped ? "/** @type{string|number|boolean|Array|undefined} */(" : "", - "typeclose", untyped ? ")" : "", "oneofgroup", - (InRealOneof(field) ? (", " + JSOneofArray(options, field)) : ""), - "rptvalueinit", (field->is_repeated() ? " || []" : "")); - } - - if (untyped) { - printer->Print( - "/**\n" - " * Clears the value.\n" - " * @return {!$class$} returns this\n" - " */\n", - "class", GetMessagePath(options, field->containing_type())); - } - - if (field->is_repeated()) { - GenerateRepeatedPrimitiveHelperMethods(options, printer, field, untyped); - } - } - - // Generate clearFoo() method for map fields, repeated fields, and other - // fields with presence. - if (field->is_map()) { - // clang-format off - printer->Print( - "/**\n" - " * Clears values from the map. The map will be non-null.\n" - " * @return {!$class$} returns this\n" - " */\n" - "$class$.prototype.$clearername$ = function() {\n" - " this.$gettername$().clear();\n" - " return this;" - "};\n" - "\n" - "\n", - "class", GetMessagePath(options, field->containing_type()), - "clearername", "clear" + JSGetterName(options, field), - "gettername", "get" + JSGetterName(options, field)); - // clang-format on - printer->Annotate("clearername", field); - } else if (field->is_repeated() || - (field->cpp_type() == FieldDescriptor::CPPTYPE_MESSAGE && - !field->is_required())) { - // Fields where we can delegate to the regular setter. - // clang-format off - printer->Print( - "/**\n" - " * $jsdoc$\n" - " * @return {!$class$} returns this\n" - " */\n" - "$class$.prototype.$clearername$ = function() {\n" - " return this.$settername$($clearedvalue$);\n" - "};\n" - "\n" - "\n", - "jsdoc", field->is_repeated() - ? "Clears the list making it empty but non-null." - : "Clears the message field making it undefined.", - "class", GetMessagePath(options, field->containing_type()), - "clearername", "clear" + JSGetterName(options, field), - "settername", "set" + JSGetterName(options, field), - "clearedvalue", (field->is_repeated() ? "[]" : "undefined")); - // clang-format on - printer->Annotate("clearername", field); - } else if (HasFieldPresence(options, field)) { - // Fields where we can't delegate to the regular setter because it doesn't - // accept "undefined" as an argument. - // clang-format off - printer->Print( - "/**\n" - " * Clears the field making it undefined.\n" - " * @return {!$class$} returns this\n" - " */\n" - "$class$.prototype.$clearername$ = function() {\n" - " return jspb.Message.set$maybeoneof$Field(this, " - "$index$$maybeoneofgroup$, ", - "class", GetMessagePath(options, field->containing_type()), - "clearername", "clear" + JSGetterName(options, field), - "maybeoneof", (InRealOneof(field) ? "Oneof" : ""), - "maybeoneofgroup", (InRealOneof(field) - ? (", " + JSOneofArray(options, field)) - : ""), - "index", JSFieldIndex(field)); - // clang-format on - printer->Annotate("clearername", field); - printer->Print( - "$clearedvalue$);\n" - "};\n" - "\n" - "\n", - "clearedvalue", (field->is_repeated() ? "[]" : "undefined")); - } - - if (HasFieldPresence(options, field)) { - printer->Print( - "/**\n" - " * Returns whether this field is set.\n" - " * @return {boolean}\n" - " */\n" - "$class$.prototype.$hasername$ = function() {\n" - " return jspb.Message.getField(this, $index$) != null;\n" - "};\n" - "\n" - "\n", - "class", GetMessagePath(options, field->containing_type()), "hasername", - "has" + JSGetterName(options, field), "index", JSFieldIndex(field)); - printer->Annotate("hasername", field); - } -} - -void Generator::GenerateRepeatedPrimitiveHelperMethods( - const GeneratorOptions& options, io::Printer* printer, - const FieldDescriptor* field, bool untyped) const { - // clang-format off - printer->Print( - "/**\n" - " * @param {$optionaltype$} value\n" - " * @param {number=} opt_index\n" - " * @return {!$class$} returns this\n" - " */\n" - "$class$.prototype.$addername$ = function(value, opt_index) {\n" - " return jspb.Message.addToRepeatedField(this, " - "$index$", - "class", GetMessagePath(options, field->containing_type()), "addername", - "add" + JSGetterName(options, field, BYTES_DEFAULT, - /* drop_list = */ true), - "optionaltype", - JSFieldTypeAnnotation( - options, field, - /* is_setter_argument = */ false, - /* force_present = */ true, - /* singular_if_not_packed = */ false, - BYTES_DEFAULT, - /* force_singular = */ true), - "index", JSFieldIndex(field)); - printer->Annotate("addername", field); - printer->Print( - "$oneofgroup$, $type$value$rptvalueinit$$typeclose$, " - "opt_index);\n" - "};\n" - "\n" - "\n", - "type", untyped ? "/** @type{string|number|boolean|!Uint8Array} */(" : "", - "typeclose", untyped ? ")" : "", "oneofgroup", - (InRealOneof(field) ? (", " + JSOneofArray(options, field)) : ""), - "rptvalueinit", ""); - // clang-format on -} - -void Generator::GenerateRepeatedMessageHelperMethods( - const GeneratorOptions& options, io::Printer* printer, - const FieldDescriptor* field) const { - printer->Print( - "/**\n" - " * @param {!$optionaltype$=} opt_value\n" - " * @param {number=} opt_index\n" - " * @return {!$optionaltype$}\n" - " */\n" - "$class$.prototype.$addername$ = function(opt_value, opt_index) {\n" - " return jspb.Message.addTo$repeatedtag$WrapperField(", - "optionaltype", JSTypeName(options, field, BYTES_DEFAULT), "class", - GetMessagePath(options, field->containing_type()), "addername", - "add" + JSGetterName(options, field, BYTES_DEFAULT, - /* drop_list = */ true), - "repeatedtag", (field->is_repeated() ? "Repeated" : "")); - - printer->Annotate("addername", field); - printer->Print( - "this, $index$$oneofgroup$, opt_value, $ctor$, opt_index);\n" - "};\n" - "\n" - "\n", - "index", JSFieldIndex(field), "oneofgroup", - (InRealOneof(field) ? (", " + JSOneofArray(options, field)) : ""), "ctor", - GetMessagePath(options, field->message_type())); -} - -void Generator::GenerateClassExtensionFieldInfo(const GeneratorOptions& options, - io::Printer* printer, - const Descriptor* desc) const { - if (IsExtendable(desc)) { - printer->Print( - "\n" - "/**\n" - " * The extensions registered with this message class. This is a " - "map of\n" - " * extension field number to fieldInfo object.\n" - " *\n" - " * For example:\n" - " * { 123: {fieldIndex: 123, fieldName: {my_field_name: 0}, " - "ctor: proto.example.MyMessage} }\n" - " *\n" - " * fieldName contains the JsCompiler renamed field name property " - "so that it\n" - " * works in OPTIMIZED mode.\n" - " *\n" - " * @type {!Object}\n" - " */\n" - "$class$.extensions = {};\n" - "\n", - "class", GetMessagePath(options, desc)); - - printer->Print( - "\n" - "/**\n" - " * The extensions registered with this message class. This is a " - "map of\n" - " * extension field number to fieldInfo object.\n" - " *\n" - " * For example:\n" - " * { 123: {fieldIndex: 123, fieldName: {my_field_name: 0}, " - "ctor: proto.example.MyMessage} }\n" - " *\n" - " * fieldName contains the JsCompiler renamed field name property " - "so that it\n" - " * works in OPTIMIZED mode.\n" - " *\n" - " * @type {!Object}\n" - " */\n" - "$class$.extensionsBinary = {};\n" - "\n", - "class", GetMessagePath(options, desc)); - } -} - -void Generator::GenerateClassDeserializeBinary(const GeneratorOptions& options, - io::Printer* printer, - const Descriptor* desc) const { - // TODO(cfallin): Handle lazy decoding when requested by field option and/or - // by default for 'bytes' fields and packed repeated fields. - - printer->Print( - "/**\n" - " * Deserializes binary data (in protobuf wire format).\n" - " * @param {jspb.ByteSource} bytes The bytes to deserialize.\n" - " * @return {!$class$}\n" - " */\n" - "$class$.deserializeBinary = function(bytes) {\n" - " var reader = new jspb.BinaryReader(bytes);\n" - " var msg = new $class$;\n" - " return $class$.deserializeBinaryFromReader(msg, reader);\n" - "};\n" - "\n" - "\n" - "/**\n" - " * Deserializes binary data (in protobuf wire format) from the\n" - " * given reader into the given message object.\n" - " * @param {!$class$} msg The message object to deserialize into.\n" - " * @param {!jspb.BinaryReader} reader The BinaryReader to use.\n" - " * @return {!$class$}\n" - " */\n" - "$class$.deserializeBinaryFromReader = function(msg, reader) {\n" - " while (reader.nextField()) {\n", - "class", GetMessagePath(options, desc)); - printer->Print( - " if (reader.isEndGroup()) {\n" - " break;\n" - " }\n" - " var field = reader.getFieldNumber();\n" - " switch (field) {\n"); - - for (int i = 0; i < desc->field_count(); i++) { - if (!IgnoreField(desc->field(i))) { - GenerateClassDeserializeBinaryField(options, printer, desc->field(i)); - } - } - - printer->Print(" default:\n"); - if (IsExtendable(desc)) { - printer->Print( - " jspb.Message.readBinaryExtension(msg, reader,\n" - " $extobj$Binary,\n" - " $class$.prototype.getExtension,\n" - " $class$.prototype.setExtension);\n" - " break;\n" - " }\n", - "extobj", JSExtensionsObjectName(options, desc->file(), desc), "class", - GetMessagePath(options, desc)); - } else { - printer->Print( - " reader.skipField();\n" - " break;\n" - " }\n"); - } - - printer->Print( - " }\n" - " return msg;\n" - "};\n" - "\n" - "\n"); -} - -void Generator::GenerateClassDeserializeBinaryField( - const GeneratorOptions& options, io::Printer* printer, - const FieldDescriptor* field) const { - printer->Print(" case $num$:\n", "num", StrCat(field->number())); - - if (field->is_map()) { - const FieldDescriptor* key_field = MapFieldKey(field); - const FieldDescriptor* value_field = MapFieldValue(field); - printer->Print( - " var value = msg.get$name$();\n" - " reader.readMessage(value, function(message, reader) {\n", - "name", JSGetterName(options, field)); - - printer->Print( - " jspb.Map.deserializeBinary(message, reader, " - "$keyReaderFn$, $valueReaderFn$", - "keyReaderFn", JSBinaryReaderMethodName(options, key_field), - "valueReaderFn", JSBinaryReaderMethodName(options, value_field)); - - if (value_field->type() == FieldDescriptor::TYPE_MESSAGE) { - printer->Print(", $messageType$.deserializeBinaryFromReader", - "messageType", - GetMessagePath(options, value_field->message_type())); - } else { - printer->Print(", null"); - } - printer->Print(", $defaultKey$", "defaultKey", JSFieldDefault(key_field)); - if (value_field->type() == FieldDescriptor::TYPE_MESSAGE) { - printer->Print(", new $messageType$()", "messageType", - GetMessagePath(options, value_field->message_type())); - } else { - printer->Print(", $defaultValue$", "defaultValue", - JSFieldDefault(value_field)); - } - printer->Print(");\n"); - printer->Print(" });\n"); - } else { - if (field->cpp_type() == FieldDescriptor::CPPTYPE_MESSAGE) { - printer->Print( - " var value = new $fieldclass$;\n" - " reader.read$msgOrGroup$($grpfield$value," - "$fieldclass$.deserializeBinaryFromReader);\n", - "fieldclass", SubmessageTypeRef(options, field), "msgOrGroup", - (field->type() == FieldDescriptor::TYPE_GROUP) ? "Group" : "Message", - "grpfield", - (field->type() == FieldDescriptor::TYPE_GROUP) - ? (StrCat(field->number()) + ", ") - : ""); - } else if (field->is_packable()) { - printer->Print( - " var values = /** @type {$fieldtype$} */ " - "(reader.isDelimited() " - "? reader.readPacked$reader$() : [reader.read$reader$()]);\n", - "fieldtype", - JSFieldTypeAnnotation(options, field, false, true, - /* singular_if_not_packed */ false, BYTES_U8), - "reader", JSBinaryReaderMethodType(field)); - } else { - printer->Print( - " var value = /** @type {$fieldtype$} */ " - "(reader.read$reader$());\n", - "fieldtype", - JSFieldTypeAnnotation(options, field, false, true, - /* singular_if_not_packed */ true, BYTES_U8), - "reader", - JSBinaryReadWriteMethodName(field, /* is_writer = */ false)); - } - - if (field->is_packable()) { - printer->Print( - " for (var i = 0; i < values.length; i++) {\n" - " msg.add$name$(values[i]);\n" - " }\n", - "name", - JSGetterName(options, field, BYTES_DEFAULT, /* drop_list = */ true)); - } else if (field->is_repeated()) { - printer->Print( - " msg.add$name$(value);\n", "name", - JSGetterName(options, field, BYTES_DEFAULT, /* drop_list = */ true)); - } else { - // Singular fields, and packed repeated fields, receive a |value| either - // as the field's value or as the array of all the field's values; set - // this as the field's value directly. - printer->Print(" msg.set$name$(value);\n", "name", - JSGetterName(options, field)); - } - } - - printer->Print(" break;\n"); -} - -void Generator::GenerateClassSerializeBinary(const GeneratorOptions& options, - io::Printer* printer, - const Descriptor* desc) const { - printer->Print( - "/**\n" - " * Serializes the message to binary data (in protobuf wire format).\n" - " * @return {!Uint8Array}\n" - " */\n" - "$class$.prototype.serializeBinary = function() {\n" - " var writer = new jspb.BinaryWriter();\n" - " $class$.serializeBinaryToWriter(this, writer);\n" - " return writer.getResultBuffer();\n" - "};\n" - "\n" - "\n" - "/**\n" - " * Serializes the given message to binary data (in protobuf wire\n" - " * format), writing to the given BinaryWriter.\n" - " * @param {!$class$} message\n" - " * @param {!jspb.BinaryWriter} writer\n" - " * @suppress {unusedLocalVariables} f is only used for nested messages\n" - " */\n" - "$class$.serializeBinaryToWriter = function(message, " - "writer) {\n" - " var f = undefined;\n", - "class", GetMessagePath(options, desc)); - - for (int i = 0; i < desc->field_count(); i++) { - if (!IgnoreField(desc->field(i))) { - GenerateClassSerializeBinaryField(options, printer, desc->field(i)); - } - } - - if (IsExtendable(desc)) { - printer->Print( - " jspb.Message.serializeBinaryExtensions(message, writer,\n" - " $extobj$Binary, $class$.prototype.getExtension);\n", - "extobj", JSExtensionsObjectName(options, desc->file(), desc), "class", - GetMessagePath(options, desc)); - } - - printer->Print( - "};\n" - "\n" - "\n"); -} - -void Generator::GenerateClassSerializeBinaryField( - const GeneratorOptions& options, io::Printer* printer, - const FieldDescriptor* field) const { - if (HasFieldPresence(options, field) && - field->cpp_type() != FieldDescriptor::CPPTYPE_MESSAGE) { - std::string typed_annotation = - JSFieldTypeAnnotation(options, field, - /* is_setter_argument = */ false, - /* force_present = */ false, - /* singular_if_not_packed = */ false, - /* bytes_mode = */ BYTES_DEFAULT); - printer->Print( - " f = /** @type {$type$} */ " - "(jspb.Message.getField(message, $index$));\n", - "index", JSFieldIndex(field), "type", typed_annotation); - } else { - printer->Print( - " f = message.get$name$($nolazy$);\n", "name", - JSGetterName(options, field, BYTES_U8), - // No lazy creation for maps containers -- fastpath the empty case. - "nolazy", field->is_map() ? "true" : ""); - } - - // Print an `if (condition)` statement that evaluates to true if the field - // goes on the wire. - if (field->is_map()) { - printer->Print(" if (f && f.getLength() > 0) {\n"); - } else if (field->is_repeated()) { - printer->Print(" if (f.length > 0) {\n"); - } else { - if (HasFieldPresence(options, field)) { - printer->Print(" if (f != null) {\n"); - } else { - // No field presence: serialize onto the wire only if value is - // non-default. Defaults are documented here: - // https://goto.google.com/lhdfm - switch (field->cpp_type()) { - case FieldDescriptor::CPPTYPE_INT32: - case FieldDescriptor::CPPTYPE_INT64: - case FieldDescriptor::CPPTYPE_UINT32: - case FieldDescriptor::CPPTYPE_UINT64: { - if (IsIntegralFieldWithStringJSType(field)) { - // We can use `parseInt` here even though it will not be precise for - // 64-bit quantities because we are only testing for zero/nonzero, - // and JS numbers (64-bit floating point values, i.e., doubles) are - // integer-precise in the range that includes zero. - printer->Print(" if (parseInt(f, 10) !== 0) {\n"); - } else { - printer->Print(" if (f !== 0) {\n"); - } - break; - } - - case FieldDescriptor::CPPTYPE_ENUM: - case FieldDescriptor::CPPTYPE_FLOAT: - case FieldDescriptor::CPPTYPE_DOUBLE: - printer->Print(" if (f !== 0.0) {\n"); - break; - case FieldDescriptor::CPPTYPE_BOOL: - printer->Print(" if (f) {\n"); - break; - case FieldDescriptor::CPPTYPE_STRING: - printer->Print(" if (f.length > 0) {\n"); - break; - default: - assert(false); - break; - } - } - } - - // Write the field on the wire. - if (field->is_map()) { - const FieldDescriptor* key_field = MapFieldKey(field); - const FieldDescriptor* value_field = MapFieldValue(field); - printer->Print( - " f.serializeBinary($index$, writer, " - "$keyWriterFn$, $valueWriterFn$", - "index", StrCat(field->number()), "keyWriterFn", - JSBinaryWriterMethodName(options, key_field), "valueWriterFn", - JSBinaryWriterMethodName(options, value_field)); - - if (value_field->type() == FieldDescriptor::TYPE_MESSAGE) { - printer->Print(", $messageType$.serializeBinaryToWriter", "messageType", - GetMessagePath(options, value_field->message_type())); - } - - printer->Print(");\n"); - } else { - printer->Print( - " writer.write$method$(\n" - " $index$,\n" - " f", - "method", JSBinaryReadWriteMethodName(field, /* is_writer = */ true), - "index", StrCat(field->number())); - - if (field->cpp_type() == FieldDescriptor::CPPTYPE_MESSAGE && - !field->is_map()) { - printer->Print( - ",\n" - " $submsg$.serializeBinaryToWriter\n", - "submsg", SubmessageTypeRef(options, field)); - } else { - printer->Print("\n"); - } - - printer->Print(" );\n"); - } - - // Close the `if`. - printer->Print(" }\n"); -} - -void Generator::GenerateEnum(const GeneratorOptions& options, - io::Printer* printer, - const EnumDescriptor* enumdesc) const { - printer->Print( - "/**\n" - " * @enum {number}\n" - " */\n" - "$enumprefix$$name$ = {\n", - "enumprefix", GetEnumPathPrefix(options, enumdesc), "name", - enumdesc->name()); - printer->Annotate("name", enumdesc); - - std::set used_name; - std::vector valid_index; - for (int i = 0; i < enumdesc->value_count(); i++) { - if (enumdesc->options().allow_alias() && - !used_name.insert(ToEnumCase(enumdesc->value(i)->name())).second) { - continue; - } - valid_index.push_back(i); - } - for (auto i : valid_index) { - const EnumValueDescriptor* value = enumdesc->value(i); - printer->Print(" $name$: $value$$comma$\n", "name", - ToEnumCase(value->name()), "value", StrCat(value->number()), - "comma", (i == valid_index.back()) ? "" : ","); - printer->Annotate("name", value); - } - - printer->Print( - "};\n" - "\n"); -} - -void Generator::GenerateExtension(const GeneratorOptions& options, - io::Printer* printer, - const FieldDescriptor* field) const { - std::string extension_scope = - (field->extension_scope() - ? GetMessagePath(options, field->extension_scope()) - : GetNamespace(options, field->file())); - - const std::string extension_object_name = JSObjectFieldName(options, field); - printer->Print( - "\n" - "/**\n" - " * A tuple of {field number, class constructor} for the extension\n" - " * field named `$nameInComment$`.\n" - " * @type {!jspb.ExtensionFieldInfo<$extensionType$>}\n" - " */\n" - "$class$.$name$ = new jspb.ExtensionFieldInfo(\n", - "nameInComment", extension_object_name, "name", extension_object_name, - "class", extension_scope, "extensionType", - JSFieldTypeAnnotation(options, field, - /* is_setter_argument = */ false, - /* force_present = */ true, - /* singular_if_not_packed = */ false)); - printer->Annotate("name", field); - printer->Print( - " $index$,\n" - " {$name$: 0},\n" - " $ctor$,\n" - " /** @type {?function((boolean|undefined),!jspb.Message=): " - "!Object} */ (\n" - " $toObject$),\n" - " $repeated$);\n", - "index", StrCat(field->number()), "name", extension_object_name, "ctor", - (field->cpp_type() == FieldDescriptor::CPPTYPE_MESSAGE - ? SubmessageTypeRef(options, field) - : std::string("null")), - "toObject", - (field->cpp_type() == FieldDescriptor::CPPTYPE_MESSAGE - ? (SubmessageTypeRef(options, field) + ".toObject") - : std::string("null")), - "repeated", (field->is_repeated() ? "1" : "0")); - - printer->Print( - "\n" - "$extendName$Binary[$index$] = new jspb.ExtensionFieldBinaryInfo(\n" - " $class$.$name$,\n" - " $binaryReaderFn$,\n" - " $binaryWriterFn$,\n" - " $binaryMessageSerializeFn$,\n" - " $binaryMessageDeserializeFn$,\n", - "extendName", - JSExtensionsObjectName(options, field->file(), field->containing_type()), - "index", StrCat(field->number()), "class", extension_scope, "name", - extension_object_name, "binaryReaderFn", - JSBinaryReaderMethodName(options, field), "binaryWriterFn", - JSBinaryWriterMethodName(options, field), "binaryMessageSerializeFn", - (field->cpp_type() == FieldDescriptor::CPPTYPE_MESSAGE) - ? (SubmessageTypeRef(options, field) + ".serializeBinaryToWriter") - : "undefined", - "binaryMessageDeserializeFn", - (field->cpp_type() == FieldDescriptor::CPPTYPE_MESSAGE) - ? (SubmessageTypeRef(options, field) + ".deserializeBinaryFromReader") - : "undefined"); - - printer->Print(" $isPacked$);\n", "isPacked", - (field->is_packed() ? "true" : "false")); - - printer->Print( - "// This registers the extension field with the extended class, so that\n" - "// toObject() will function correctly.\n" - "$extendName$[$index$] = $class$.$name$;\n" - "\n", - "extendName", - JSExtensionsObjectName(options, field->file(), field->containing_type()), - "index", StrCat(field->number()), "class", extension_scope, "name", - extension_object_name); -} - -bool GeneratorOptions::ParseFromOptions( - const std::vector >& options, - std::string* error) { - for (int i = 0; i < options.size(); i++) { - if (options[i].first == "add_require_for_enums") { - if (options[i].second != "") { - *error = "Unexpected option value for add_require_for_enums"; - return false; - } - add_require_for_enums = true; - } else if (options[i].first == "binary") { - if (options[i].second != "") { - *error = "Unexpected option value for binary"; - return false; - } - binary = true; - } else if (options[i].first == "testonly") { - if (options[i].second != "") { - *error = "Unexpected option value for testonly"; - return false; - } - testonly = true; - - } else if (options[i].first == "error_on_name_conflict") { - GOOGLE_LOG(WARNING) << "Ignoring error_on_name_conflict option, this " - "will be removed in a future release"; - } else if (options[i].first == "output_dir") { - output_dir = options[i].second; - } else if (options[i].first == "namespace_prefix") { - namespace_prefix = options[i].second; - } else if (options[i].first == "library") { - library = options[i].second; - } else if (options[i].first == "import_style") { - if (options[i].second == "closure") { - import_style = kImportClosure; - } else if (options[i].second == "commonjs") { - import_style = kImportCommonJs; - } else if (options[i].second == "commonjs_strict") { - import_style = kImportCommonJsStrict; - } else if (options[i].second == "browser") { - import_style = kImportBrowser; - } else if (options[i].second == "es6") { - import_style = kImportEs6; - } else { - *error = "Unknown import style " + options[i].second + ", expected " + - "one of: closure, commonjs, browser, es6."; - } - } else if (options[i].first == "extension") { - extension = options[i].second; - } else if (options[i].first == "one_output_file_per_input_file") { - if (!options[i].second.empty()) { - *error = "Unexpected option value for one_output_file_per_input_file"; - return false; - } - one_output_file_per_input_file = true; - } else if (options[i].first == "annotate_code") { - if (!options[i].second.empty()) { - *error = "Unexpected option value for annotate_code"; - return false; - } - annotate_code = true; - } else { - // Assume any other option is an output directory, as long as it is a bare - // `key` rather than a `key=value` option. - if (options[i].second != "") { - *error = "Unknown option: " + options[i].first; - return false; - } - output_dir = options[i].first; - } - } - - if (import_style != kImportClosure && - (add_require_for_enums || testonly || !library.empty() || - extension != ".js" || one_output_file_per_input_file)) { - *error = - "The add_require_for_enums, testonly, library, extension, and " - "one_output_file_per_input_file options should only be " - "used for import_style=closure"; - return false; - } - - return true; -} - -GeneratorOptions::OutputMode GeneratorOptions::output_mode() const { - // We use one output file per input file if we are not using Closure or if - // this is explicitly requested. - if (import_style != kImportClosure || one_output_file_per_input_file) { - return kOneOutputFilePerInputFile; - } - - // If a library name is provided, we put everything in that one file. - if (!library.empty()) { - return kEverythingInOneFile; - } - - // Otherwise, we create one output file per SCC. - return kOneOutputFilePerSCC; -} - -void Generator::GenerateFilesInDepOrder( - const GeneratorOptions& options, io::Printer* printer, - const std::vector& files) const { - // Build a std::set over all files so that the DFS can detect when it recurses - // into a dep not specified in the user's command line. - std::set all_files(files.begin(), files.end()); - // Track the in-progress set of files that have been generated already. - std::set generated; - for (int i = 0; i < files.size(); i++) { - GenerateFileAndDeps(options, printer, files[i], &all_files, &generated); - } -} - -void Generator::GenerateFileAndDeps( - const GeneratorOptions& options, io::Printer* printer, - const FileDescriptor* root, std::set* all_files, - std::set* generated) const { - // Skip if already generated. - if (generated->find(root) != generated->end()) { - return; - } - generated->insert(root); - - // Generate all dependencies before this file's content. - for (int i = 0; i < root->dependency_count(); i++) { - const FileDescriptor* dep = root->dependency(i); - GenerateFileAndDeps(options, printer, dep, all_files, generated); - } - - // Generate this file's content. Only generate if the file is part of the - // original set requested to be generated; i.e., don't take all transitive - // deps down to the roots. - if (all_files->find(root) != all_files->end()) { - GenerateClassesAndEnums(options, printer, root); - } -} - -bool Generator::GenerateFile(const FileDescriptor* file, - const GeneratorOptions& options, - GeneratorContext* context, - bool use_short_name) const { - std::string filename = - options.output_dir + "/" + - GetJSFilename(options, use_short_name - ? file->name().substr(file->name().rfind('/')) - : file->name()); - std::unique_ptr output(context->Open(filename)); - GOOGLE_CHECK(output); - GeneratedCodeInfo annotations; - io::AnnotationProtoCollector annotation_collector( - &annotations); - io::Printer printer(output.get(), '$', - options.annotate_code ? &annotation_collector : nullptr); - - GenerateFile(options, &printer, file); - - if (printer.failed()) { - return false; - } - - if (options.annotate_code) { - EmbedCodeAnnotations(annotations, &printer); - } - - return true; -} - -void Generator::GenerateFile(const GeneratorOptions& options, - io::Printer* printer, - const FileDescriptor* file) const { - GenerateHeader(options, file, printer); - - // Generate "require" statements. - if ((options.import_style == GeneratorOptions::kImportCommonJs || - options.import_style == GeneratorOptions::kImportCommonJsStrict)) { - printer->Print("var jspb = require('google-protobuf');\n"); - printer->Print("var goog = jspb;\n"); - - // Do not use global scope in strict mode - if (options.import_style == GeneratorOptions::kImportCommonJsStrict) { - printer->Print("var proto = {};\n\n"); - } else { - // To get the global object we call a function with .call(null), this will set "this" inside the - // function to the global object. - // This does not work if we are running in strict mode ("use strict"), - // so we fallback to the following things (in order from first to last): - // - window: defined in browsers - // - global: defined in most server side environments like NodeJS - // - self: defined inside Web Workers (WorkerGlobalScope) - // - Function('return this')(): this will work on most platforms, but it may be blocked by things like CSP. - // Function('') is almost the same as eval('') - printer->Print( - "var global = (function() {\n" - " if (this) { return this; }\n" - " if (typeof window !== 'undefined') { return window; }\n" - " if (typeof global !== 'undefined') { return global; }\n" - " if (typeof self !== 'undefined') { return self; }\n" - " return Function('return this')();\n" - "}.call(null));\n\n"); - } - - for (int i = 0; i < file->dependency_count(); i++) { - const std::string& name = file->dependency(i)->name(); - printer->Print( - "var $alias$ = require('$file$');\n" - "goog.object.extend(proto, $alias$);\n", - "alias", ModuleAlias(name), "file", - GetRootPath(file->name(), name) + GetJSFilename(options, name)); - } - } - - std::set provided; - std::set extensions; - for (int i = 0; i < file->extension_count(); i++) { - // We honor the jspb::ignore option here only when working with - // Closure-style imports. Use of this option is discouraged and so we want - // to avoid adding new support for it. - if (options.import_style == GeneratorOptions::kImportClosure && - IgnoreField(file->extension(i))) { - continue; - } - provided.insert(GetNamespace(options, file) + "." + - JSObjectFieldName(options, file->extension(i))); - extensions.insert(file->extension(i)); - } - - FindProvidesForFile(options, printer, file, &provided); - GenerateProvides(options, printer, &provided); - std::vector files; - files.push_back(file); - if (options.import_style == GeneratorOptions::kImportClosure) { - GenerateRequiresForLibrary(options, printer, files, &provided); - } - - GenerateClassesAndEnums(options, printer, file); - - // Generate code for top-level extensions. Extensions nested inside messages - // are emitted inside GenerateClassesAndEnums(). - for (std::set::const_iterator it = extensions.begin(); - it != extensions.end(); ++it) { - GenerateExtension(options, printer, *it); - } - - // if provided is empty, do not export anything - if (options.import_style == GeneratorOptions::kImportCommonJs && - !provided.empty()) { - printer->Print("goog.object.extend(exports, $package$);\n", "package", - GetNamespace(options, file)); - } else if (options.import_style == GeneratorOptions::kImportCommonJsStrict) { - printer->Print("goog.object.extend(exports, proto);\n", "package", - GetNamespace(options, file)); - } - - // Emit well-known type methods. - for (FileToc* toc = well_known_types_js; toc->name != NULL; toc++) { - std::string name = std::string("google/protobuf/") + toc->name; - if (name == StripProto(file->name()) + ".js") { - printer->Print(toc->data); - } - } -} - -bool Generator::GenerateAll(const std::vector& files, - const std::string& parameter, - GeneratorContext* context, - std::string* error) const { - std::vector > option_pairs; - ParseGeneratorParameter(parameter, &option_pairs); - GeneratorOptions options; - if (!options.ParseFromOptions(option_pairs, error)) { - return false; - } - - if (options.output_mode() == GeneratorOptions::kEverythingInOneFile) { - // All output should go in a single file. - std::string filename = options.output_dir + "/" + options.library + - options.GetFileNameExtension(); - std::unique_ptr output(context->Open(filename)); - GOOGLE_CHECK(output.get()); - GeneratedCodeInfo annotations; - io::AnnotationProtoCollector annotation_collector( - &annotations); - io::Printer printer( - output.get(), '$', - options.annotate_code ? &annotation_collector : nullptr); - - // Pull out all extensions -- we need these to generate all - // provides/requires. - std::vector extensions; - for (int i = 0; i < files.size(); i++) { - for (int j = 0; j < files[i]->extension_count(); j++) { - const FieldDescriptor* extension = files[i]->extension(j); - extensions.push_back(extension); - } - } - - if (files.size() == 1) { - GenerateHeader(options, files[0], &printer); - } else { - GenerateHeader(options, nullptr, &printer); - } - - std::set provided; - FindProvides(options, &printer, files, &provided); - FindProvidesForFields(options, &printer, extensions, &provided); - GenerateProvides(options, &printer, &provided); - GenerateTestOnly(options, &printer); - GenerateRequiresForLibrary(options, &printer, files, &provided); - - GenerateFilesInDepOrder(options, &printer, files); - - for (int i = 0; i < extensions.size(); i++) { - if (ShouldGenerateExtension(extensions[i])) { - GenerateExtension(options, &printer, extensions[i]); - } - } - - if (printer.failed()) { - return false; - } - if (options.annotate_code) { - EmbedCodeAnnotations(annotations, &printer); - } - } else if (options.output_mode() == GeneratorOptions::kOneOutputFilePerSCC) { - std::set have_printed; - SCCAnalyzer analyzer; - std::map allowed_map; - if (!GenerateJspbAllowedMap(options, files, &allowed_map, &analyzer)) { - return false; - } - - bool generated = false; - for (int i = 0; i < files.size(); i++) { - const FileDescriptor* file = files[i]; - // Force well known type to generate in a whole file. - if (IsWellKnownTypeFile(file)) { - if (!GenerateFile(file, options, context, true)) { - return false; - } - generated = true; - continue; - } - for (int j = 0; j < file->message_type_count(); j++) { - const Descriptor* desc = file->message_type(j); - if (have_printed.count(desc) || - allowed_map.count(analyzer.GetSCC(desc)) == 0) { - continue; - } - - generated = true; - const SCC* scc = analyzer.GetSCC(desc); - const std::string& filename = allowed_map[scc]; - std::unique_ptr output( - context->Open(filename)); - GOOGLE_CHECK(output.get()); - GeneratedCodeInfo annotations; - io::AnnotationProtoCollector annotation_collector( - &annotations); - io::Printer printer( - output.get(), '$', - options.annotate_code ? &annotation_collector : nullptr); - - GenerateHeader(options, file, &printer); - - std::set provided; - for (auto one_desc : scc->descriptors) { - if (one_desc->containing_type() == nullptr) { - FindProvidesForMessage(options, &printer, one_desc, &provided); - } - } - GenerateProvides(options, &printer, &provided); - GenerateTestOnly(options, &printer); - GenerateRequiresForSCC(options, &printer, scc, &provided); - - for (auto one_desc : scc->descriptors) { - if (one_desc->containing_type() == nullptr) { - GenerateClassConstructorAndDeclareExtensionFieldInfo( - options, &printer, one_desc); - } - } - for (auto one_desc : scc->descriptors) { - if (one_desc->containing_type() == nullptr) { - GenerateClass(options, &printer, one_desc); - } - } - - for (auto one_desc : scc->descriptors) { - have_printed.insert(one_desc); - } - - if (printer.failed()) { - return false; - } - if (options.annotate_code) { - EmbedCodeAnnotations(annotations, &printer); - } - } - for (int j = 0; j < file->enum_type_count(); j++) { - const EnumDescriptor* enumdesc = file->enum_type(j); - if (allowed_map.count(enumdesc) == 0) { - continue; - } - - generated = true; - const std::string& filename = allowed_map[enumdesc]; - std::unique_ptr output( - context->Open(filename)); - GOOGLE_CHECK(output.get()); - GeneratedCodeInfo annotations; - io::AnnotationProtoCollector annotation_collector( - &annotations); - io::Printer printer( - output.get(), '$', - options.annotate_code ? &annotation_collector : nullptr); - - GenerateHeader(options, file, &printer); - - std::set provided; - FindProvidesForEnum(options, &printer, enumdesc, &provided); - GenerateProvides(options, &printer, &provided); - GenerateTestOnly(options, &printer); - - GenerateEnum(options, &printer, enumdesc); - - if (printer.failed()) { - return false; - } - if (options.annotate_code) { - EmbedCodeAnnotations(annotations, &printer); - } - } - // File-level extensions (message-level extensions are generated under - // the enclosing message). - if (allowed_map.count(file) == 1) { - generated = true; - const std::string& filename = allowed_map[file]; - - std::unique_ptr output( - context->Open(filename)); - GOOGLE_CHECK(output.get()); - GeneratedCodeInfo annotations; - io::AnnotationProtoCollector annotation_collector( - &annotations); - io::Printer printer( - output.get(), '$', - options.annotate_code ? &annotation_collector : nullptr); - - GenerateHeader(options, file, &printer); - - std::set provided; - std::vector fields; - - for (int j = 0; j < files[i]->extension_count(); j++) { - if (ShouldGenerateExtension(files[i]->extension(j))) { - fields.push_back(files[i]->extension(j)); - } - } - - FindProvidesForFields(options, &printer, fields, &provided); - GenerateProvides(options, &printer, &provided); - GenerateTestOnly(options, &printer); - GenerateRequiresForExtensions(options, &printer, fields, &provided); - - for (int j = 0; j < files[i]->extension_count(); j++) { - if (ShouldGenerateExtension(files[i]->extension(j))) { - GenerateExtension(options, &printer, files[i]->extension(j)); - } - } - if (options.annotate_code) { - EmbedCodeAnnotations(annotations, &printer); - } - } - } - if (!generated) { - std::string filename = options.output_dir + "/" + - "empty_no_content_void_file" + - options.GetFileNameExtension(); - std::unique_ptr output(context->Open(filename)); - } - } else /* options.output_mode() == kOneOutputFilePerInputFile */ { - // Generate one output file per input (.proto) file. - - for (int i = 0; i < files.size(); i++) { - const FileDescriptor* file = files[i]; - if (!GenerateFile(file, options, context, false)) { - return false; - } - } - } - return true; -} - -} // namespace js -} // namespace compiler -} // namespace protobuf -} // namespace google diff --git a/extra/protobuf/protobuf-3.19.4/src/google/protobuf/compiler/js/js_generator.h b/extra/protobuf/protobuf-3.19.4/src/google/protobuf/compiler/js/js_generator.h deleted file mode 100644 index cd9631afb772..000000000000 --- a/extra/protobuf/protobuf-3.19.4/src/google/protobuf/compiler/js/js_generator.h +++ /dev/null @@ -1,336 +0,0 @@ -// Protocol Buffers - Google's data interchange format -// Copyright 2008 Google Inc. All rights reserved. -// https://developers.google.com/protocol-buffers/ -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// * Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// * Redistributions in binary form must reproduce the above -// copyright notice, this list of conditions and the following disclaimer -// in the documentation and/or other materials provided with the -// distribution. -// * Neither the name of Google Inc. nor the names of its -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -// Generates JavaScript code for a given .proto file. -// -#ifndef GOOGLE_PROTOBUF_COMPILER_JS_GENERATOR_H__ -#define GOOGLE_PROTOBUF_COMPILER_JS_GENERATOR_H__ - -#include -#include - -#include -#include -#include -#include - -#include - -namespace google { -namespace protobuf { - -class Descriptor; -class EnumDescriptor; -class FieldDescriptor; -class OneofDescriptor; -class FileDescriptor; - -namespace io { -class Printer; -} - -namespace compiler { -namespace js { - -struct GeneratorOptions { - // Output path. - std::string output_dir; - // Namespace prefix. - std::string namespace_prefix; - // Enable binary-format support? - bool binary; - // What style of imports should be used. - enum ImportStyle { - kImportClosure, // goog.require() - kImportCommonJs, // require() - kImportCommonJsStrict, // require() with no global export - kImportBrowser, // no import statements - kImportEs6, // import { member } from '' - } import_style; - - GeneratorOptions() - : output_dir("."), - namespace_prefix(""), - binary(false), - import_style(kImportClosure), - add_require_for_enums(false), - testonly(false), - library(""), - extension(".js"), - one_output_file_per_input_file(false), - annotate_code(false) {} - - bool ParseFromOptions( - const std::vector >& options, - std::string* error); - - // Returns the file name extension to use for generated code. - std::string GetFileNameExtension() const { - return import_style == kImportClosure ? extension : "_pb.js"; - } - - enum OutputMode { - // Create an output file for each input .proto file. - kOneOutputFilePerInputFile, - // Create an output file for each type. - kOneOutputFilePerSCC, - // Put everything in a single file named by the library option. - kEverythingInOneFile, - }; - - // Indicates how to output the generated code based on the provided options. - OutputMode output_mode() const; - - // The remaining options are only relevant when we are using kImportClosure. - - // Add a `goog.requires()` call for each enum type used. If not set, a - // forward declaration with `goog.forwardDeclare` is produced instead. - bool add_require_for_enums; - // Set this as a test-only module via `goog.setTestOnly();`. - bool testonly; - // Create a library with name _lib.js rather than a separate .js file - // per type? - std::string library; - // The extension to use for output file names. - std::string extension; - // Create a separate output file for each input file? - bool one_output_file_per_input_file; - // If true, we should append annotations as comments on the last line for - // generated .js file. Annotations used by tools like https://kythe.io - // to provide cross-references between .js and .proto files. Annotations - // are encoded as base64 proto of GeneratedCodeInfo message (see - // descriptor.proto). - bool annotate_code; -}; - -// CodeGenerator implementation which generates a JavaScript source file and -// header. If you create your own protocol compiler binary and you want it to -// support JavaScript output, you can do so by registering an instance of this -// CodeGenerator with the CommandLineInterface in your main() function. -class PROTOC_EXPORT Generator : public CodeGenerator { - public: - Generator() {} - virtual ~Generator() {} - - bool Generate(const FileDescriptor* file, const std::string& parameter, - GeneratorContext* context, std::string* error) const override { - *error = "Unimplemented Generate() method. Call GenerateAll() instead."; - return false; - } - - bool HasGenerateAll() const override { return true; } - - bool GenerateAll(const std::vector& files, - const std::string& parameter, GeneratorContext* context, - std::string* error) const override; - - uint64 GetSupportedFeatures() const override { - return FEATURE_PROTO3_OPTIONAL; - } - - private: - void GenerateHeader(const GeneratorOptions& options, - const FileDescriptor* file, io::Printer* printer) const; - - // Generate goog.provides() calls. - void FindProvides(const GeneratorOptions& options, io::Printer* printer, - const std::vector& file, - std::set* provided) const; - void FindProvidesForFile(const GeneratorOptions& options, - io::Printer* printer, const FileDescriptor* file, - std::set* provided) const; - void FindProvidesForMessage(const GeneratorOptions& options, - io::Printer* printer, const Descriptor* desc, - std::set* provided) const; - void FindProvidesForEnum(const GeneratorOptions& options, - io::Printer* printer, const EnumDescriptor* enumdesc, - std::set* provided) const; - // For extension fields at file scope. - void FindProvidesForFields(const GeneratorOptions& options, - io::Printer* printer, - const std::vector& fields, - std::set* provided) const; - // Print the goog.provides() found by the methods above. - void GenerateProvides(const GeneratorOptions& options, io::Printer* printer, - std::set* provided) const; - - // Generate goog.setTestOnly() if indicated. - void GenerateTestOnly(const GeneratorOptions& options, - io::Printer* printer) const; - - // Generate goog.requires() calls. - void GenerateRequiresForLibrary( - const GeneratorOptions& options, io::Printer* printer, - const std::vector& files, - std::set* provided) const; - void GenerateRequiresForSCC(const GeneratorOptions& options, - io::Printer* printer, const SCC* scc, - std::set* provided) const; - // For extension fields at file scope. - void GenerateRequiresForExtensions( - const GeneratorOptions& options, io::Printer* printer, - const std::vector& fields, - std::set* provided) const; - void GenerateRequiresImpl(const GeneratorOptions& options, - io::Printer* printer, - std::set* required, - std::set* forwards, - std::set* provided, bool require_jspb, - bool require_extension, bool require_map) const; - void FindRequiresForMessage(const GeneratorOptions& options, - const Descriptor* desc, - std::set* required, - std::set* forwards, - bool* have_message) const; - void FindRequiresForField(const GeneratorOptions& options, - const FieldDescriptor* field, - std::set* required, - std::set* forwards) const; - void FindRequiresForExtension(const GeneratorOptions& options, - const FieldDescriptor* field, - std::set* required, - std::set* forwards) const; - // Generate all things in a proto file into one file. - // If use_short_name is true, the generated file's name will only be short - // name that without directory, otherwise filename equals file->name() - bool GenerateFile(const FileDescriptor* file, const GeneratorOptions& options, - GeneratorContext* context, bool use_short_name) const; - void GenerateFile(const GeneratorOptions& options, io::Printer* printer, - const FileDescriptor* file) const; - - // Generate definitions for all message classes and enums in all files, - // processing the files in dependence order. - void GenerateFilesInDepOrder( - const GeneratorOptions& options, io::Printer* printer, - const std::vector& file) const; - // Helper for above. - void GenerateFileAndDeps(const GeneratorOptions& options, - io::Printer* printer, const FileDescriptor* root, - std::set* all_files, - std::set* generated) const; - - // Generate definitions for all message classes and enums. - void GenerateClassesAndEnums(const GeneratorOptions& options, - io::Printer* printer, - const FileDescriptor* file) const; - - void GenerateFieldValueExpression(io::Printer* printer, - const char* obj_reference, - const FieldDescriptor* field, - bool use_default) const; - - // Generate definition for one class. - void GenerateClass(const GeneratorOptions& options, io::Printer* printer, - const Descriptor* desc) const; - void GenerateClassConstructor(const GeneratorOptions& options, - io::Printer* printer, - const Descriptor* desc) const; - void GenerateClassFieldInfo(const GeneratorOptions& options, - io::Printer* printer, - const Descriptor* desc) const; - void GenerateClassConstructorAndDeclareExtensionFieldInfo( - const GeneratorOptions& options, io::Printer* printer, - const Descriptor* desc) const; - void GenerateClassXid(const GeneratorOptions& options, io::Printer* printer, - const Descriptor* desc) const; - void GenerateOneofCaseDefinition(const GeneratorOptions& options, - io::Printer* printer, - const OneofDescriptor* oneof) const; - void GenerateObjectTypedef(const GeneratorOptions& options, - io::Printer* printer, - const Descriptor* desc) const; - void GenerateClassToObject(const GeneratorOptions& options, - io::Printer* printer, - const Descriptor* desc) const; - void GenerateClassFieldToObject(const GeneratorOptions& options, - io::Printer* printer, - const FieldDescriptor* field) const; - void GenerateClassFromObject(const GeneratorOptions& options, - io::Printer* printer, - const Descriptor* desc) const; - void GenerateClassFieldFromObject(const GeneratorOptions& options, - io::Printer* printer, - const FieldDescriptor* field) const; - void GenerateClassRegistration(const GeneratorOptions& options, - io::Printer* printer, - const Descriptor* desc) const; - void GenerateClassFields(const GeneratorOptions& options, - io::Printer* printer, const Descriptor* desc) const; - void GenerateClassField(const GeneratorOptions& options, io::Printer* printer, - const FieldDescriptor* desc) const; - void GenerateClassExtensionFieldInfo(const GeneratorOptions& options, - io::Printer* printer, - const Descriptor* desc) const; - void GenerateClassDeserialize(const GeneratorOptions& options, - io::Printer* printer, - const Descriptor* desc) const; - void GenerateClassDeserializeBinary(const GeneratorOptions& options, - io::Printer* printer, - const Descriptor* desc) const; - void GenerateClassDeserializeBinaryField(const GeneratorOptions& options, - io::Printer* printer, - const FieldDescriptor* field) const; - void GenerateClassSerializeBinary(const GeneratorOptions& options, - io::Printer* printer, - const Descriptor* desc) const; - void GenerateClassSerializeBinaryField(const GeneratorOptions& options, - io::Printer* printer, - const FieldDescriptor* field) const; - - // Generate definition for one enum. - void GenerateEnum(const GeneratorOptions& options, io::Printer* printer, - const EnumDescriptor* enumdesc) const; - - // Generate an extension definition. - void GenerateExtension(const GeneratorOptions& options, io::Printer* printer, - const FieldDescriptor* field) const; - - // Generate addFoo() method for repeated primitive fields. - void GenerateRepeatedPrimitiveHelperMethods(const GeneratorOptions& options, - io::Printer* printer, - const FieldDescriptor* field, - bool untyped) const; - - // Generate addFoo() method for repeated message fields. - void GenerateRepeatedMessageHelperMethods(const GeneratorOptions& options, - io::Printer* printer, - const FieldDescriptor* field) const; - - GOOGLE_DISALLOW_EVIL_CONSTRUCTORS(Generator); -}; - -} // namespace js -} // namespace compiler -} // namespace protobuf -} // namespace google - -#include - -#endif // GOOGLE_PROTOBUF_COMPILER_JS_GENERATOR_H__ diff --git a/extra/protobuf/protobuf-3.19.4/src/google/protobuf/compiler/js/well_known_types_embed.cc b/extra/protobuf/protobuf-3.19.4/src/google/protobuf/compiler/js/well_known_types_embed.cc deleted file mode 100644 index 5cb73657e722..000000000000 --- a/extra/protobuf/protobuf-3.19.4/src/google/protobuf/compiler/js/well_known_types_embed.cc +++ /dev/null @@ -1,270 +0,0 @@ -// Protocol Buffers - Google's data interchange format -// Copyright 2008 Google Inc. All rights reserved. -// https://developers.google.com/protocol-buffers/ -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// * Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// * Redistributions in binary form must reproduce the above -// copyright notice, this list of conditions and the following disclaimer -// in the documentation and/or other materials provided with the -// distribution. -// * Neither the name of Google Inc. nor the names of its -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -#include - -struct FileToc well_known_types_js[] = { - {"any.js", - "/* This code will be inserted into generated code for\n" - " * google/protobuf/any.proto. */\n" - "\n" - "/**\n" - " * Returns the type name contained in this instance, if any.\n" - " * @return {string|undefined}\n" - " */\n" - "proto.google.protobuf.Any.prototype.getTypeName = function() {\n" - " return this.getTypeUrl().split('/').pop();\n" - "};\n" - "\n" - "\n" - "/**\n" - " * Packs the given message instance into this Any.\n" - " * For binary format usage only.\n" - " * @param {!Uint8Array} serialized The serialized data to pack.\n" - " * @param {string} name The type name of this message object.\n" - " * @param {string=} opt_typeUrlPrefix the type URL prefix.\n" - " */\n" - "proto.google.protobuf.Any.prototype.pack = function(serialized, name,\n" - " opt_typeUrlPrefix) " - "{\n" - " if (!opt_typeUrlPrefix) {\n" - " opt_typeUrlPrefix = 'type.googleapis.com/';\n" - " }\n" - "\n" - " if (opt_typeUrlPrefix.substr(-1) != '/') {\n" - " this.setTypeUrl(opt_typeUrlPrefix + '/' + name);\n" - " } else {\n" - " this.setTypeUrl(opt_typeUrlPrefix + name);\n" - " }\n" - "\n" - " this.setValue(serialized);\n" - "};\n" - "\n" - "\n" - "/**\n" - " * @template T\n" - " * Unpacks this Any into the given message object.\n" - " * @param {function(Uint8Array):T} deserialize Function that will " - "deserialize\n" - " * the binary data properly.\n" - " * @param {string} name The expected type name of this message object.\n" - " * @return {?T} If the name matched the expected name, returns the " - "deserialized\n" - " * object, otherwise returns null.\n" - " */\n" - "proto.google.protobuf.Any.prototype.unpack = function(deserialize, name) " - "{\n" - " if (this.getTypeName() == name) {\n" - " return deserialize(this.getValue_asU8());\n" - " } else {\n" - " return null;\n" - " }\n" - "};\n" - }, - {"timestamp.js", - "/* This code will be inserted into generated code for\n" - " * google/protobuf/timestamp.proto. */\n" - "\n" - "/**\n" - " * Returns a JavaScript 'Date' object corresponding to this Timestamp.\n" - " * @return {!Date}\n" - " */\n" - "proto.google.protobuf.Timestamp.prototype.toDate = function() {\n" - " var seconds = this.getSeconds();\n" - " var nanos = this.getNanos();\n" - "\n" - " return new Date((seconds * 1000) + (nanos / 1000000));\n" - "};\n" - "\n" - "\n" - "/**\n" - " * Sets the value of this Timestamp object to be the given Date.\n" - " * @param {!Date} value The value to set.\n" - " */\n" - "proto.google.protobuf.Timestamp.prototype.fromDate = function(value) {\n" - " this.setSeconds(Math.floor(value.getTime() / 1000));\n" - " this.setNanos(value.getMilliseconds() * 1000000);\n" - "};\n" - "\n" - "\n" - "/**\n" - " * Factory method that returns a Timestamp object with value equal to\n" - " * the given Date.\n" - " * @param {!Date} value The value to set.\n" - " * @return {!proto.google.protobuf.Timestamp}\n" - " */\n" - "proto.google.protobuf.Timestamp.fromDate = function(value) {\n" - " var timestamp = new proto.google.protobuf.Timestamp();\n" - " timestamp.fromDate(value);\n" - " return timestamp;\n" - "};\n"}, - {"struct.js", - "/* This code will be inserted into generated code for\n" - " * google/protobuf/struct.proto. */\n" - "\n" - "/**\n" - " * Typedef representing plain JavaScript values that can go into a\n" - " * Struct.\n" - " * @typedef {null|number|string|boolean|Array|Object}\n" - " */\n" - "proto.google.protobuf.JavaScriptValue;\n" - "\n" - "\n" - "/**\n" - " * Converts this Value object to a plain JavaScript value.\n" - " * @return {?proto.google.protobuf.JavaScriptValue} a plain JavaScript\n" - " * value representing this Struct.\n" - " */\n" - "proto.google.protobuf.Value.prototype.toJavaScript = function() {\n" - " var kindCase = proto.google.protobuf.Value.KindCase;\n" - " switch (this.getKindCase()) {\n" - " case kindCase.NULL_VALUE:\n" - " return null;\n" - " case kindCase.NUMBER_VALUE:\n" - " return this.getNumberValue();\n" - " case kindCase.STRING_VALUE:\n" - " return this.getStringValue();\n" - " case kindCase.BOOL_VALUE:\n" - " return this.getBoolValue();\n" - " case kindCase.STRUCT_VALUE:\n" - " return this.getStructValue().toJavaScript();\n" - " case kindCase.LIST_VALUE:\n" - " return this.getListValue().toJavaScript();\n" - " default:\n" - " throw new Error('Unexpected struct type');\n" - " }\n" - "};\n" - "\n" - "\n" - "/**\n" - " * Converts this JavaScript value to a new Value proto.\n" - " * @param {!proto.google.protobuf.JavaScriptValue} value The value to\n" - " * convert.\n" - " * @return {!proto.google.protobuf.Value} The newly constructed value.\n" - " */\n" - "proto.google.protobuf.Value.fromJavaScript = function(value) {\n" - " var ret = new proto.google.protobuf.Value();\n" - " switch (goog.typeOf(value)) {\n" - " case 'string':\n" - " ret.setStringValue(/** @type {string} */ (value));\n" - " break;\n" - " case 'number':\n" - " ret.setNumberValue(/** @type {number} */ (value));\n" - " break;\n" - " case 'boolean':\n" - " ret.setBoolValue(/** @type {boolean} */ (value));\n" - " break;\n" - " case 'null':\n" - " ret.setNullValue(proto.google.protobuf.NullValue.NULL_VALUE);\n" - " break;\n" - " case 'array':\n" - " ret.setListValue(proto.google.protobuf.ListValue.fromJavaScript(\n" - " /** @type{!Array} */ (value)));\n" - " break;\n" - " case 'object':\n" - " ret.setStructValue(proto.google.protobuf.Struct.fromJavaScript(\n" - " /** @type{!Object} */ (value)));\n" - " break;\n" - " default:\n" - " throw new Error('Unexpected struct type.');\n" - " }\n" - "\n" - " return ret;\n" - "};\n" - "\n" - "\n" - "/**\n" - " * Converts this ListValue object to a plain JavaScript array.\n" - " * @return {!Array} a plain JavaScript array representing this List.\n" - " */\n" - "proto.google.protobuf.ListValue.prototype.toJavaScript = function() {\n" - " var ret = [];\n" - " var values = this.getValuesList();\n" - "\n" - " for (var i = 0; i < values.length; i++) {\n" - " ret[i] = values[i].toJavaScript();\n" - " }\n" - "\n" - " return ret;\n" - "};\n" - "\n" - "\n" - "/**\n" - " * Constructs a ListValue protobuf from this plain JavaScript array.\n" - " * @param {!Array} array a plain JavaScript array\n" - " * @return {proto.google.protobuf.ListValue} a new ListValue object\n" - " */\n" - "proto.google.protobuf.ListValue.fromJavaScript = function(array) {\n" - " var ret = new proto.google.protobuf.ListValue();\n" - "\n" - " for (var i = 0; i < array.length; i++) {\n" - " " - "ret.addValues(proto.google.protobuf.Value.fromJavaScript(array[i]));\n" - " }\n" - "\n" - " return ret;\n" - "};\n" - "\n" - "\n" - "/**\n" - " * Converts this Struct object to a plain JavaScript object.\n" - " * @return {!Object} a " - "plain\n" - " * JavaScript object representing this Struct.\n" - " */\n" - "proto.google.protobuf.Struct.prototype.toJavaScript = function() {\n" - " var ret = {};\n" - "\n" - " this.getFieldsMap().forEach(function(value, key) {\n" - " ret[key] = value.toJavaScript();\n" - " });\n" - "\n" - " return ret;\n" - "};\n" - "\n" - "\n" - "/**\n" - " * Constructs a Struct protobuf from this plain JavaScript object.\n" - " * @param {!Object} obj a plain JavaScript object\n" - " * @return {proto.google.protobuf.Struct} a new Struct object\n" - " */\n" - "proto.google.protobuf.Struct.fromJavaScript = function(obj) {\n" - " var ret = new proto.google.protobuf.Struct();\n" - " var map = ret.getFieldsMap();\n" - "\n" - " for (var property in obj) {\n" - " var val = obj[property];\n" - " map.set(property, proto.google.protobuf.Value.fromJavaScript(val));\n" - " }\n" - "\n" - " return ret;\n" - "};\n"}, - {NULL, NULL} // Terminate the list. -}; diff --git a/extra/protobuf/protobuf-3.19.4/src/google/protobuf/compiler/js/well_known_types_embed.h b/extra/protobuf/protobuf-3.19.4/src/google/protobuf/compiler/js/well_known_types_embed.h deleted file mode 100644 index 174c665e452c..000000000000 --- a/extra/protobuf/protobuf-3.19.4/src/google/protobuf/compiler/js/well_known_types_embed.h +++ /dev/null @@ -1,43 +0,0 @@ -// Protocol Buffers - Google's data interchange format -// Copyright 2008 Google Inc. All rights reserved. -// https://developers.google.com/protocol-buffers/ -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// * Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// * Redistributions in binary form must reproduce the above -// copyright notice, this list of conditions and the following disclaimer -// in the documentation and/or other materials provided with the -// distribution. -// * Neither the name of Google Inc. nor the names of its -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -#ifndef GOOGLE_PROTOBUF_COMPILER_JS_WELL_KNOWN_TYPES_EMBED_H__ -#define GOOGLE_PROTOBUF_COMPILER_JS_WELL_KNOWN_TYPES_EMBED_H__ - -#include - -struct FileToc { - const char* name; - const char* data; -}; - -extern struct FileToc well_known_types_js[]; - -#endif // GOOGLE_PROTOBUF_COMPILER_JS_WELL_KNOWN_TYPES_EMBED_H__ diff --git a/extra/protobuf/protobuf-3.19.4/src/google/protobuf/compiler/main.cc b/extra/protobuf/protobuf-3.19.4/src/google/protobuf/compiler/main.cc deleted file mode 100644 index 7cb7a6375cd4..000000000000 --- a/extra/protobuf/protobuf-3.19.4/src/google/protobuf/compiler/main.cc +++ /dev/null @@ -1,113 +0,0 @@ -// Protocol Buffers - Google's data interchange format -// Copyright 2008 Google Inc. All rights reserved. -// https://developers.google.com/protocol-buffers/ -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// * Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// * Redistributions in binary form must reproduce the above -// copyright notice, this list of conditions and the following disclaimer -// in the documentation and/or other materials provided with the -// distribution. -// * Neither the name of Google Inc. nor the names of its -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#include - -namespace google { -namespace protobuf { -namespace compiler { - -int ProtobufMain(int argc, char* argv[]) { - - CommandLineInterface cli; - cli.AllowPlugins("protoc-"); - - // Proto2 C++ - cpp::CppGenerator cpp_generator; - cli.RegisterGenerator("--cpp_out", "--cpp_opt", &cpp_generator, - "Generate C++ header and source."); - -#ifdef GOOGLE_PROTOBUF_RUNTIME_INCLUDE_BASE - cpp_generator.set_opensource_runtime(true); - cpp_generator.set_runtime_include_base(GOOGLE_PROTOBUF_RUNTIME_INCLUDE_BASE); -#endif - - // Proto2 Java - java::JavaGenerator java_generator; - cli.RegisterGenerator("--java_out", "--java_opt", &java_generator, - "Generate Java source file."); - - // Proto2 Kotlin - java::KotlinGenerator kt_generator; - cli.RegisterGenerator("--kotlin_out", "--kotlin_opt", &kt_generator, - "Generate Kotlin file."); - - - // Proto2 Python - python::Generator py_generator; - cli.RegisterGenerator("--python_out", "--python_opt", &py_generator, - "Generate Python source file."); - - // PHP - php::Generator php_generator; - cli.RegisterGenerator("--php_out", "--php_opt", &php_generator, - "Generate PHP source file."); - - // Ruby - ruby::Generator rb_generator; - cli.RegisterGenerator("--ruby_out", "--ruby_opt", &rb_generator, - "Generate Ruby source file."); - - // CSharp - csharp::Generator csharp_generator; - cli.RegisterGenerator("--csharp_out", "--csharp_opt", &csharp_generator, - "Generate C# source file."); - - // Objective-C - objectivec::ObjectiveCGenerator objc_generator; - cli.RegisterGenerator("--objc_out", "--objc_opt", &objc_generator, - "Generate Objective-C header and source."); - - // JavaScript - js::Generator js_generator; - cli.RegisterGenerator("--js_out", "--js_opt", &js_generator, - "Generate JavaScript source."); - - return cli.Run(argc, argv); -} - -} // namespace compiler -} // namespace protobuf -} // namespace google - -int main(int argc, char* argv[]) { - return PROTOBUF_NAMESPACE_ID::compiler::ProtobufMain(argc, argv); -} diff --git a/extra/protobuf/protobuf-3.19.4/src/google/protobuf/compiler/mock_code_generator.cc b/extra/protobuf/protobuf-3.19.4/src/google/protobuf/compiler/mock_code_generator.cc deleted file mode 100644 index 1fce1060969b..000000000000 --- a/extra/protobuf/protobuf-3.19.4/src/google/protobuf/compiler/mock_code_generator.cc +++ /dev/null @@ -1,384 +0,0 @@ -// Protocol Buffers - Google's data interchange format -// Copyright 2008 Google Inc. All rights reserved. -// https://developers.google.com/protocol-buffers/ -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// * Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// * Redistributions in binary form must reproduce the above -// copyright notice, this list of conditions and the following disclaimer -// in the documentation and/or other materials provided with the -// distribution. -// * Neither the name of Google Inc. nor the names of its -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -// Author: kenton@google.com (Kenton Varda) - -#include - -#include - -#include -#include -#include -#include - -#include - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#ifdef major -#undef major -#endif -#ifdef minor -#undef minor -#endif - -namespace google { -namespace protobuf { -namespace compiler { - -// Returns the list of the names of files in all_files in the form of a -// comma-separated string. -std::string CommaSeparatedList( - const std::vector& all_files) { - std::vector names; - for (size_t i = 0; i < all_files.size(); i++) { - names.push_back(all_files[i]->name()); - } - return Join(names, ","); -} - -static const char* kFirstInsertionPointName = "first_mock_insertion_point"; -static const char* kSecondInsertionPointName = "second_mock_insertion_point"; -static const char* kFirstInsertionPoint = - "# @@protoc_insertion_point(first_mock_insertion_point) is here\n"; -static const char* kSecondInsertionPoint = - " # @@protoc_insertion_point(second_mock_insertion_point) is here\n"; - -MockCodeGenerator::MockCodeGenerator(const std::string& name) : name_(name) {} - -MockCodeGenerator::~MockCodeGenerator() {} - -uint64_t MockCodeGenerator::GetSupportedFeatures() const { - uint64_t all_features = CodeGenerator::FEATURE_PROTO3_OPTIONAL; - return all_features & ~suppressed_features_; -} - -void MockCodeGenerator::SuppressFeatures(uint64_t features) { - suppressed_features_ = features; -} - -void MockCodeGenerator::ExpectGenerated( - const std::string& name, const std::string& parameter, - const std::string& insertions, const std::string& file, - const std::string& first_message_name, - const std::string& first_parsed_file_name, - const std::string& output_directory) { - std::string content; - GOOGLE_CHECK_OK( - File::GetContents(output_directory + "/" + GetOutputFileName(name, file), - &content, true)); - - std::vector lines = - Split(content, "\n", true); - - while (!lines.empty() && lines.back().empty()) { - lines.pop_back(); - } - for (size_t i = 0; i < lines.size(); i++) { - lines[i] += "\n"; - } - - std::vector insertion_list; - if (!insertions.empty()) { - insertion_list = Split(insertions, ",", true); - } - - EXPECT_EQ(lines.size(), 3 + insertion_list.size() * 2); - EXPECT_EQ(GetOutputFileContent(name, parameter, file, first_parsed_file_name, - first_message_name), - lines[0]); - - EXPECT_EQ(kFirstInsertionPoint, lines[1 + insertion_list.size()]); - EXPECT_EQ(kSecondInsertionPoint, lines[2 + insertion_list.size() * 2]); - - for (size_t i = 0; i < insertion_list.size(); i++) { - EXPECT_EQ(GetOutputFileContent(insertion_list[i], "first_insert", file, - file, first_message_name), - lines[1 + i]); - // Second insertion point is indented, so the inserted text should - // automatically be indented too. - EXPECT_EQ(" " + GetOutputFileContent(insertion_list[i], "second_insert", - file, file, first_message_name), - lines[2 + insertion_list.size() + i]); - } -} - -namespace { -void CheckSingleAnnotation(const std::string& expected_file, - const std::string& expected_text, - const std::string& file_content, - const GeneratedCodeInfo::Annotation& annotation) { - EXPECT_EQ(expected_file, annotation.source_file()); - ASSERT_GE(file_content.size(), annotation.begin()); - ASSERT_GE(file_content.size(), annotation.end()); - ASSERT_LE(annotation.begin(), annotation.end()); - EXPECT_EQ(expected_text.size(), annotation.end() - annotation.begin()); - EXPECT_EQ(expected_text, - file_content.substr(annotation.begin(), expected_text.size())); -} -} // anonymous namespace - -void MockCodeGenerator::CheckGeneratedAnnotations( - const std::string& name, const std::string& file, - const std::string& output_directory) { - std::string file_content; - GOOGLE_CHECK_OK( - File::GetContents(output_directory + "/" + GetOutputFileName(name, file), - &file_content, true)); - std::string meta_content; - GOOGLE_CHECK_OK(File::GetContents( - output_directory + "/" + GetOutputFileName(name, file) + ".pb.meta", - &meta_content, true)); - GeneratedCodeInfo annotations; - GOOGLE_CHECK(TextFormat::ParseFromString(meta_content, &annotations)); - ASSERT_EQ(7, annotations.annotation_size()); - - CheckSingleAnnotation("first_annotation", "first", file_content, - annotations.annotation(0)); - CheckSingleAnnotation("first_path", - "test_generator: first_insert,\n foo.proto,\n " - "MockCodeGenerator_Annotate,\n foo.proto\n", - file_content, annotations.annotation(1)); - CheckSingleAnnotation("first_path", - "test_plugin: first_insert,\n foo.proto,\n " - "MockCodeGenerator_Annotate,\n foo.proto\n", - file_content, annotations.annotation(2)); - CheckSingleAnnotation("second_annotation", "second", file_content, - annotations.annotation(3)); - // This annotated text has changed because it was inserted at an indented - // insertion point. - CheckSingleAnnotation("second_path", - "test_generator: second_insert,\n foo.proto,\n " - "MockCodeGenerator_Annotate,\n foo.proto\n", - file_content, annotations.annotation(4)); - CheckSingleAnnotation("second_path", - "test_plugin: second_insert,\n foo.proto,\n " - "MockCodeGenerator_Annotate,\n foo.proto\n", - file_content, annotations.annotation(5)); - CheckSingleAnnotation("third_annotation", "third", file_content, - annotations.annotation(6)); -} - -bool MockCodeGenerator::Generate(const FileDescriptor* file, - const std::string& parameter, - GeneratorContext* context, - std::string* error) const { - bool annotate = false; - for (int i = 0; i < file->message_type_count(); i++) { - if (HasPrefixString(file->message_type(i)->name(), "MockCodeGenerator_")) { - std::string command = StripPrefixString( - file->message_type(i)->name(), "MockCodeGenerator_"); - if (command == "Error") { - *error = "Saw message type MockCodeGenerator_Error."; - return false; - } else if (command == "Exit") { - std::cerr << "Saw message type MockCodeGenerator_Exit." << std::endl; - exit(123); - } else if (command == "Abort") { - std::cerr << "Saw message type MockCodeGenerator_Abort." << std::endl; - abort(); - } else if (command == "HasSourceCodeInfo") { - FileDescriptorProto file_descriptor_proto; - file->CopySourceCodeInfoTo(&file_descriptor_proto); - bool has_source_code_info = - file_descriptor_proto.has_source_code_info() && - file_descriptor_proto.source_code_info().location_size() > 0; - std::cerr << "Saw message type MockCodeGenerator_HasSourceCodeInfo: " - << has_source_code_info << "." << std::endl; - abort(); - } else if (command == "HasJsonName") { - FieldDescriptorProto field_descriptor_proto; - file->message_type(i)->field(0)->CopyTo(&field_descriptor_proto); - std::cerr << "Saw json_name: " << field_descriptor_proto.has_json_name() - << std::endl; - abort(); - } else if (command == "Annotate") { - annotate = true; - } else if (command == "ShowVersionNumber") { - Version compiler_version; - context->GetCompilerVersion(&compiler_version); - std::cerr << "Saw compiler_version: " - << compiler_version.major() * 1000000 + - compiler_version.minor() * 1000 + - compiler_version.patch() - << " " << compiler_version.suffix() << std::endl; - abort(); - } else { - GOOGLE_LOG(FATAL) << "Unknown MockCodeGenerator command: " << command; - } - } - } - - bool insert_endlines = HasPrefixString(parameter, "insert_endlines="); - if (insert_endlines || HasPrefixString(parameter, "insert=")) { - std::vector insert_into = Split( - StripPrefixString( - parameter, insert_endlines ? "insert_endlines=" : "insert="), - ",", true); - - for (size_t i = 0; i < insert_into.size(); i++) { - { - google::protobuf::GeneratedCodeInfo info; - std::string content = - GetOutputFileContent(name_, "first_insert", file, context); - if (insert_endlines) { - GlobalReplaceSubstring(",", ",\n", &content); - } - if (annotate) { - auto* annotation = info.add_annotation(); - annotation->set_begin(0); - annotation->set_end(content.size()); - annotation->set_source_file("first_path"); - } - std::unique_ptr output( - context->OpenForInsertWithGeneratedCodeInfo( - GetOutputFileName(insert_into[i], file), - kFirstInsertionPointName, info)); - io::Printer printer(output.get(), '$'); - printer.PrintRaw(content); - if (printer.failed()) { - *error = "MockCodeGenerator detected write error."; - return false; - } - } - - { - google::protobuf::GeneratedCodeInfo info; - std::string content = - GetOutputFileContent(name_, "second_insert", file, context); - if (insert_endlines) { - GlobalReplaceSubstring(",", ",\n", &content); - } - if (annotate) { - auto* annotation = info.add_annotation(); - annotation->set_begin(0); - annotation->set_end(content.size()); - annotation->set_source_file("second_path"); - } - std::unique_ptr output( - context->OpenForInsertWithGeneratedCodeInfo( - GetOutputFileName(insert_into[i], file), - kSecondInsertionPointName, info)); - io::Printer printer(output.get(), '$'); - printer.PrintRaw(content); - if (printer.failed()) { - *error = "MockCodeGenerator detected write error."; - return false; - } - } - } - } else { - std::unique_ptr output( - context->Open(GetOutputFileName(name_, file))); - - GeneratedCodeInfo annotations; - io::AnnotationProtoCollector annotation_collector( - &annotations); - io::Printer printer(output.get(), '$', - annotate ? &annotation_collector : NULL); - printer.PrintRaw(GetOutputFileContent(name_, parameter, file, context)); - std::string annotate_suffix = "_annotation"; - if (annotate) { - printer.Print("$p$\n", "p", "first"); - printer.Annotate("p", "first" + annotate_suffix); - } - printer.PrintRaw(kFirstInsertionPoint); - if (annotate) { - printer.Print("$p$\n", "p", "second"); - printer.Annotate("p", "second" + annotate_suffix); - } - printer.PrintRaw(kSecondInsertionPoint); - if (annotate) { - printer.Print("$p$\n", "p", "third"); - printer.Annotate("p", "third" + annotate_suffix); - } - - if (printer.failed()) { - *error = "MockCodeGenerator detected write error."; - return false; - } - if (annotate) { - std::unique_ptr meta_output( - context->Open(GetOutputFileName(name_, file) + ".pb.meta")); - if (!TextFormat::Print(annotations, meta_output.get())) { - *error = "MockCodeGenerator couldn't write .pb.meta"; - return false; - } - } - } - - return true; -} - -std::string MockCodeGenerator::GetOutputFileName( - const std::string& generator_name, const FileDescriptor* file) { - return GetOutputFileName(generator_name, file->name()); -} - -std::string MockCodeGenerator::GetOutputFileName( - const std::string& generator_name, const std::string& file) { - return file + ".MockCodeGenerator." + generator_name; -} - -std::string MockCodeGenerator::GetOutputFileContent( - const std::string& generator_name, const std::string& parameter, - const FileDescriptor* file, GeneratorContext* context) { - std::vector all_files; - context->ListParsedFiles(&all_files); - return GetOutputFileContent( - generator_name, parameter, file->name(), CommaSeparatedList(all_files), - file->message_type_count() > 0 ? file->message_type(0)->name() - : "(none)"); -} - -std::string MockCodeGenerator::GetOutputFileContent( - const std::string& generator_name, const std::string& parameter, - const std::string& file, const std::string& parsed_file_list, - const std::string& first_message_name) { - return strings::Substitute("$0: $1, $2, $3, $4\n", generator_name, parameter, - file, first_message_name, parsed_file_list); -} - -} // namespace compiler -} // namespace protobuf -} // namespace google diff --git a/extra/protobuf/protobuf-3.19.4/src/google/protobuf/compiler/mock_code_generator.h b/extra/protobuf/protobuf-3.19.4/src/google/protobuf/compiler/mock_code_generator.h deleted file mode 100644 index 6e101055de72..000000000000 --- a/extra/protobuf/protobuf-3.19.4/src/google/protobuf/compiler/mock_code_generator.h +++ /dev/null @@ -1,136 +0,0 @@ -// Protocol Buffers - Google's data interchange format -// Copyright 2008 Google Inc. All rights reserved. -// https://developers.google.com/protocol-buffers/ -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// * Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// * Redistributions in binary form must reproduce the above -// copyright notice, this list of conditions and the following disclaimer -// in the documentation and/or other materials provided with the -// distribution. -// * Neither the name of Google Inc. nor the names of its -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -// Author: kenton@google.com (Kenton Varda) - -#ifndef GOOGLE_PROTOBUF_COMPILER_MOCK_CODE_GENERATOR_H__ -#define GOOGLE_PROTOBUF_COMPILER_MOCK_CODE_GENERATOR_H__ - -#include -#include - -#include - -namespace google { -namespace protobuf { -class FileDescriptor; -} // namespace protobuf -} // namespace google - -namespace google { -namespace protobuf { -namespace compiler { - -// A mock CodeGenerator, used by command_line_interface_unittest. This is in -// its own file so that it can be used both directly and as a plugin. -// -// Generate() produces some output which can be checked by ExpectCalled(). The -// generator can run in a different process (e.g. a plugin). -// -// If the parameter is "insert=NAMES", the MockCodeGenerator will insert lines -// into the files generated by other MockCodeGenerators instead of creating -// its own file. NAMES is a comma-separated list of the names of those other -// MockCodeGenerators. If the parameter is "insert_endlines=NAMES", the -// MockCodeGenerator will insert data guaranteed to contain more than one -// endline into the files generated by NAMES. -// -// MockCodeGenerator will also modify its behavior slightly if the input file -// contains a message type with one of the following names: -// MockCodeGenerator_Error: Causes Generate() to return false and set the -// error message to "Saw message type MockCodeGenerator_Error." -// MockCodeGenerator_Exit: Generate() prints "Saw message type -// MockCodeGenerator_Exit." to stderr and then calls exit(123). -// MockCodeGenerator_Abort: Generate() prints "Saw message type -// MockCodeGenerator_Abort." to stderr and then calls abort(). -// MockCodeGenerator_HasSourceCodeInfo: Causes Generate() to abort after -// printing "Saw message type MockCodeGenerator_HasSourceCodeInfo: FOO." to -// stderr, where FOO is "1" if the supplied FileDescriptorProto has source -// code info, and "0" otherwise. -// MockCodeGenerator_Annotate: Generate() will add annotations to its output -// that can later be verified with CheckGeneratedAnnotations. -class MockCodeGenerator : public CodeGenerator { - public: - MockCodeGenerator(const std::string& name); - virtual ~MockCodeGenerator(); - - // Expect (via gTest) that a MockCodeGenerator with the given name was called - // with the given parameters by inspecting the output location. - // - // |insertions| is a comma-separated list of names of MockCodeGenerators which - // should have inserted lines into this file. - // |parsed_file_list| is a comma-separated list of names of the files - // that are being compiled together in this run. - static void ExpectGenerated(const std::string& name, - const std::string& parameter, - const std::string& insertions, - const std::string& file, - const std::string& first_message_name, - const std::string& parsed_file_list, - const std::string& output_directory); - - // Checks that the correct text ranges were annotated by the - // MockCodeGenerator_Annotate directive. - static void CheckGeneratedAnnotations(const std::string& name, - const std::string& file, - const std::string& output_directory); - - // Get the name of the file which would be written by the given generator. - static std::string GetOutputFileName(const std::string& generator_name, - const FileDescriptor* file); - static std::string GetOutputFileName(const std::string& generator_name, - const std::string& file); - - // implements CodeGenerator ---------------------------------------- - - bool Generate(const FileDescriptor* file, const std::string& parameter, - GeneratorContext* context, std::string* error) const override; - - uint64_t GetSupportedFeatures() const override; - void SuppressFeatures(uint64_t features); - - private: - std::string name_; - uint64_t suppressed_features_ = 0; - - static std::string GetOutputFileContent(const std::string& generator_name, - const std::string& parameter, - const FileDescriptor* file, - GeneratorContext* context); - static std::string GetOutputFileContent( - const std::string& generator_name, const std::string& parameter, - const std::string& file, const std::string& parsed_file_list, - const std::string& first_message_name); -}; - -} // namespace compiler -} // namespace protobuf -} // namespace google - -#endif // GOOGLE_PROTOBUF_COMPILER_MOCK_CODE_GENERATOR_H__ diff --git a/extra/protobuf/protobuf-3.19.4/src/google/protobuf/compiler/objectivec/objectivec_enum.cc b/extra/protobuf/protobuf-3.19.4/src/google/protobuf/compiler/objectivec/objectivec_enum.cc deleted file mode 100644 index ea8f394ebe04..000000000000 --- a/extra/protobuf/protobuf-3.19.4/src/google/protobuf/compiler/objectivec/objectivec_enum.cc +++ /dev/null @@ -1,260 +0,0 @@ -// Protocol Buffers - Google's data interchange format -// Copyright 2008 Google Inc. All rights reserved. -// https://developers.google.com/protocol-buffers/ -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// * Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// * Redistributions in binary form must reproduce the above -// copyright notice, this list of conditions and the following disclaimer -// in the documentation and/or other materials provided with the -// distribution. -// * Neither the name of Google Inc. nor the names of its -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -#include -#include - -#include -#include -#include -#include -#include // std::find() - -namespace google { -namespace protobuf { -namespace compiler { -namespace objectivec { - -EnumGenerator::EnumGenerator(const EnumDescriptor* descriptor) - : descriptor_(descriptor), - name_(EnumName(descriptor_)) { - // Track the names for the enum values, and if an alias overlaps a base - // value, skip making a name for it. Likewise if two alias overlap, the - // first one wins. - // The one gap in this logic is if two base values overlap, but for that - // to happen you have to have "Foo" and "FOO" or "FOO_BAR" and "FooBar", - // and if an enum has that, it is already going to be confusing and a - // compile error is just fine. - // The values are still tracked to support the reflection apis and - // TextFormat handing since they are different there. - std::set value_names; - - for (int i = 0; i < descriptor_->value_count(); i++) { - const EnumValueDescriptor* value = descriptor_->value(i); - const EnumValueDescriptor* canonical_value = - descriptor_->FindValueByNumber(value->number()); - - if (value == canonical_value) { - base_values_.push_back(value); - value_names.insert(EnumValueName(value)); - } else { - std::string value_name(EnumValueName(value)); - if (value_names.find(value_name) != value_names.end()) { - alias_values_to_skip_.insert(value); - } else { - value_names.insert(value_name); - } - } - all_values_.push_back(value); - } -} - -EnumGenerator::~EnumGenerator() {} - -void EnumGenerator::GenerateHeader(io::Printer* printer) { - std::string enum_comments; - SourceLocation location; - if (descriptor_->GetSourceLocation(&location)) { - enum_comments = BuildCommentsString(location, true); - } else { - enum_comments = ""; - } - - printer->Print( - "#pragma mark - Enum $name$\n" - "\n", - "name", name_); - - // Swift 5 included SE0192 "Handling Future Enum Cases" - // https://github.com/apple/swift-evolution/blob/master/proposals/0192-non-exhaustive-enums.md - // Since a .proto file can get new values added to an enum at any time, they - // are effectively "non-frozen". Even in a proto3 syntax file where there is - // support for the unknown value, an edit to the file can always add a new - // value moving something from unknown to known. Since Swift is now ABI - // stable, it also means a binary could contain Swift compiled against one - // version of the .pbobjc.h file, but finally linked against an enum with - // more cases. So the Swift code will always have to treat ObjC Proto Enums - // as "non-frozen". The default behavior in SE0192 is for all objc enums to - // be "non-frozen" unless marked as otherwise, so this means this generation - // doesn't have to bother with the `enum_extensibility` attribute, as the - // default will be what is needed. - - printer->Print("$comments$typedef$deprecated_attribute$ GPB_ENUM($name$) {\n", - "comments", enum_comments, - "deprecated_attribute", GetOptionalDeprecatedAttribute(descriptor_, descriptor_->file()), - "name", name_); - printer->Indent(); - - if (HasPreservingUnknownEnumSemantics(descriptor_->file())) { - // Include the unknown value. - printer->Print( - "/**\n" - " * Value used if any message's field encounters a value that is not defined\n" - " * by this enum. The message will also have C functions to get/set the rawValue\n" - " * of the field.\n" - " **/\n" - "$name$_GPBUnrecognizedEnumeratorValue = kGPBUnrecognizedEnumeratorValue,\n", - "name", name_); - } - for (int i = 0; i < all_values_.size(); i++) { - if (alias_values_to_skip_.find(all_values_[i]) != alias_values_to_skip_.end()) { - continue; - } - if (all_values_[i]->GetSourceLocation(&location)) { - std::string comments = BuildCommentsString(location, true).c_str(); - if (comments.length() > 0) { - if (i > 0) { - printer->Print("\n"); - } - printer->Print(comments.c_str()); - } - } - - printer->Print( - "$name$$deprecated_attribute$ = $value$,\n", - "name", EnumValueName(all_values_[i]), - "deprecated_attribute", GetOptionalDeprecatedAttribute(all_values_[i]), - "value", StrCat(all_values_[i]->number())); - } - printer->Outdent(); - printer->Print( - "};\n" - "\n" - "GPBEnumDescriptor *$name$_EnumDescriptor(void);\n" - "\n" - "/**\n" - " * Checks to see if the given value is defined by the enum or was not known at\n" - " * the time this source was generated.\n" - " **/\n" - "BOOL $name$_IsValidValue(int32_t value);\n" - "\n", - "name", name_); -} - -void EnumGenerator::GenerateSource(io::Printer* printer) { - printer->Print( - "#pragma mark - Enum $name$\n" - "\n", - "name", name_); - - // Note: For the TextFormat decode info, we can't use the enum value as - // the key because protocol buffer enums have 'allow_alias', which lets - // a value be used more than once. Instead, the index into the list of - // enum value descriptions is used. Note: start with -1 so the first one - // will be zero. - TextFormatDecodeData text_format_decode_data; - int enum_value_description_key = -1; - std::string text_blob; - - for (int i = 0; i < all_values_.size(); i++) { - ++enum_value_description_key; - std::string short_name(EnumValueShortName(all_values_[i])); - text_blob += short_name + '\0'; - if (UnCamelCaseEnumShortName(short_name) != all_values_[i]->name()) { - text_format_decode_data.AddString(enum_value_description_key, short_name, - all_values_[i]->name()); - } - } - - printer->Print( - "GPBEnumDescriptor *$name$_EnumDescriptor(void) {\n" - " static _Atomic(GPBEnumDescriptor*) descriptor = nil;\n" - " if (!descriptor) {\n", - "name", name_); - - static const int kBytesPerLine = 40; // allow for escaping - printer->Print( - " static const char *valueNames ="); - for (int i = 0; i < text_blob.size(); i += kBytesPerLine) { - printer->Print( - "\n \"$data$\"", - "data", EscapeTrigraphs(CEscape(text_blob.substr(i, kBytesPerLine)))); - } - printer->Print( - ";\n" - " static const int32_t values[] = {\n"); - for (int i = 0; i < all_values_.size(); i++) { - printer->Print(" $name$,\n", "name", EnumValueName(all_values_[i])); - } - printer->Print(" };\n"); - - if (text_format_decode_data.num_entries() == 0) { - printer->Print( - " GPBEnumDescriptor *worker =\n" - " [GPBEnumDescriptor allocDescriptorForName:GPBNSStringifySymbol($name$)\n" - " valueNames:valueNames\n" - " values:values\n" - " count:(uint32_t)(sizeof(values) / sizeof(int32_t))\n" - " enumVerifier:$name$_IsValidValue];\n", - "name", name_); - } else { - printer->Print( - " static const char *extraTextFormatInfo = \"$extraTextFormatInfo$\";\n" - " GPBEnumDescriptor *worker =\n" - " [GPBEnumDescriptor allocDescriptorForName:GPBNSStringifySymbol($name$)\n" - " valueNames:valueNames\n" - " values:values\n" - " count:(uint32_t)(sizeof(values) / sizeof(int32_t))\n" - " enumVerifier:$name$_IsValidValue\n" - " extraTextFormatInfo:extraTextFormatInfo];\n", - "name", name_, - "extraTextFormatInfo", CEscape(text_format_decode_data.Data())); - } - printer->Print( - " GPBEnumDescriptor *expected = nil;\n" - " if (!atomic_compare_exchange_strong(&descriptor, &expected, worker)) {\n" - " [worker release];\n" - " }\n" - " }\n" - " return descriptor;\n" - "}\n\n"); - - printer->Print( - "BOOL $name$_IsValidValue(int32_t value__) {\n" - " switch (value__) {\n", - "name", name_); - - for (int i = 0; i < base_values_.size(); i++) { - printer->Print( - " case $name$:\n", - "name", EnumValueName(base_values_[i])); - } - - printer->Print( - " return YES;\n" - " default:\n" - " return NO;\n" - " }\n" - "}\n\n"); -} -} // namespace objectivec -} // namespace compiler -} // namespace protobuf -} // namespace google diff --git a/extra/protobuf/protobuf-3.19.4/src/google/protobuf/compiler/objectivec/objectivec_enum.h b/extra/protobuf/protobuf-3.19.4/src/google/protobuf/compiler/objectivec/objectivec_enum.h deleted file mode 100644 index 1d5741a53ce2..000000000000 --- a/extra/protobuf/protobuf-3.19.4/src/google/protobuf/compiler/objectivec/objectivec_enum.h +++ /dev/null @@ -1,71 +0,0 @@ -// Protocol Buffers - Google's data interchange format -// Copyright 2008 Google Inc. All rights reserved. -// https://developers.google.com/protocol-buffers/ -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// * Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// * Redistributions in binary form must reproduce the above -// copyright notice, this list of conditions and the following disclaimer -// in the documentation and/or other materials provided with the -// distribution. -// * Neither the name of Google Inc. nor the names of its -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -#ifndef GOOGLE_PROTOBUF_COMPILER_OBJECTIVEC_ENUM_H__ -#define GOOGLE_PROTOBUF_COMPILER_OBJECTIVEC_ENUM_H__ - -#include -#include -#include -#include -#include - -namespace google { -namespace protobuf { -namespace compiler { -namespace objectivec { - -class EnumGenerator { - public: - explicit EnumGenerator(const EnumDescriptor* descriptor); - ~EnumGenerator(); - - EnumGenerator(const EnumGenerator&) = delete; - EnumGenerator& operator=(const EnumGenerator&) = delete; - - void GenerateHeader(io::Printer* printer); - void GenerateSource(io::Printer* printer); - - const std::string& name() const { return name_; } - - private: - const EnumDescriptor* descriptor_; - std::vector base_values_; - std::vector all_values_; - std::set alias_values_to_skip_; - const std::string name_; -}; - -} // namespace objectivec -} // namespace compiler -} // namespace protobuf -} // namespace google - -#endif // GOOGLE_PROTOBUF_COMPILER_OBJECTIVEC_ENUM_H__ diff --git a/extra/protobuf/protobuf-3.19.4/src/google/protobuf/compiler/objectivec/objectivec_enum_field.cc b/extra/protobuf/protobuf-3.19.4/src/google/protobuf/compiler/objectivec/objectivec_enum_field.cc deleted file mode 100644 index ff69f39f484f..000000000000 --- a/extra/protobuf/protobuf-3.19.4/src/google/protobuf/compiler/objectivec/objectivec_enum_field.cc +++ /dev/null @@ -1,149 +0,0 @@ -// Protocol Buffers - Google's data interchange format -// Copyright 2008 Google Inc. All rights reserved. -// https://developers.google.com/protocol-buffers/ -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// * Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// * Redistributions in binary form must reproduce the above -// copyright notice, this list of conditions and the following disclaimer -// in the documentation and/or other materials provided with the -// distribution. -// * Neither the name of Google Inc. nor the names of its -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -#include -#include - -#include -#include -#include -#include - -namespace google { -namespace protobuf { -namespace compiler { -namespace objectivec { - -namespace { - -void SetEnumVariables(const FieldDescriptor* descriptor, - std::map* variables) { - std::string type = EnumName(descriptor->enum_type()); - (*variables)["storage_type"] = type; - // For non repeated fields, if it was defined in a different file, the - // property decls need to use "enum NAME" rather than just "NAME" to support - // the forward declaration of the enums. - if (!descriptor->is_repeated() && - (descriptor->file() != descriptor->enum_type()->file())) { - (*variables)["property_type"] = "enum " + type; - } - (*variables)["enum_verifier"] = type + "_IsValidValue"; - (*variables)["enum_desc_func"] = type + "_EnumDescriptor"; - - (*variables)["dataTypeSpecific_name"] = "enumDescFunc"; - (*variables)["dataTypeSpecific_value"] = (*variables)["enum_desc_func"]; - - const Descriptor* msg_descriptor = descriptor->containing_type(); - (*variables)["owning_message_class"] = ClassName(msg_descriptor); -} -} // namespace - -EnumFieldGenerator::EnumFieldGenerator(const FieldDescriptor* descriptor, - const Options& options) - : SingleFieldGenerator(descriptor, options) { - SetEnumVariables(descriptor, &variables_); -} - -EnumFieldGenerator::~EnumFieldGenerator() {} - -void EnumFieldGenerator::GenerateCFunctionDeclarations( - io::Printer* printer) const { - if (!HasPreservingUnknownEnumSemantics(descriptor_->file())) { - return; - } - - printer->Print( - variables_, - "/**\n" - " * Fetches the raw value of a @c $owning_message_class$'s @c $name$ property, even\n" - " * if the value was not defined by the enum at the time the code was generated.\n" - " **/\n" - "int32_t $owning_message_class$_$capitalized_name$_RawValue($owning_message_class$ *message);\n" - "/**\n" - " * Sets the raw value of an @c $owning_message_class$'s @c $name$ property, allowing\n" - " * it to be set to a value that was not defined by the enum at the time the code\n" - " * was generated.\n" - " **/\n" - "void Set$owning_message_class$_$capitalized_name$_RawValue($owning_message_class$ *message, int32_t value);\n" - "\n"); -} - -void EnumFieldGenerator::GenerateCFunctionImplementations( - io::Printer* printer) const { - if (!HasPreservingUnknownEnumSemantics(descriptor_->file())) return; - - printer->Print( - variables_, - "int32_t $owning_message_class$_$capitalized_name$_RawValue($owning_message_class$ *message) {\n" - " GPBDescriptor *descriptor = [$owning_message_class$ descriptor];\n" - " GPBFieldDescriptor *field = [descriptor fieldWithNumber:$field_number_name$];\n" - " return GPBGetMessageRawEnumField(message, field);\n" - "}\n" - "\n" - "void Set$owning_message_class$_$capitalized_name$_RawValue($owning_message_class$ *message, int32_t value) {\n" - " GPBDescriptor *descriptor = [$owning_message_class$ descriptor];\n" - " GPBFieldDescriptor *field = [descriptor fieldWithNumber:$field_number_name$];\n" - " GPBSetMessageRawEnumField(message, field, value);\n" - "}\n" - "\n"); -} - -void EnumFieldGenerator::DetermineForwardDeclarations( - std::set* fwd_decls) const { - SingleFieldGenerator::DetermineForwardDeclarations(fwd_decls); - // If it is an enum defined in a different file, then we'll need a forward - // declaration for it. When it is in our file, all the enums are output - // before the message, so it will be declared before it is needed. - if (descriptor_->file() != descriptor_->enum_type()->file()) { - // Enum name is already in "storage_type". - const std::string& name = variable("storage_type"); - fwd_decls->insert("GPB_ENUM_FWD_DECLARE(" + name + ")"); - } -} - -RepeatedEnumFieldGenerator::RepeatedEnumFieldGenerator( - const FieldDescriptor* descriptor, const Options& options) - : RepeatedFieldGenerator(descriptor, options) { - SetEnumVariables(descriptor, &variables_); - variables_["array_storage_type"] = "GPBEnumArray"; -} - -RepeatedEnumFieldGenerator::~RepeatedEnumFieldGenerator() {} - -void RepeatedEnumFieldGenerator::FinishInitialization(void) { - RepeatedFieldGenerator::FinishInitialization(); - variables_["array_comment"] = - "// |" + variables_["name"] + "| contains |" + variables_["storage_type"] + "|\n"; -} - -} // namespace objectivec -} // namespace compiler -} // namespace protobuf -} // namespace google diff --git a/extra/protobuf/protobuf-3.19.4/src/google/protobuf/compiler/objectivec/objectivec_enum_field.h b/extra/protobuf/protobuf-3.19.4/src/google/protobuf/compiler/objectivec/objectivec_enum_field.h deleted file mode 100644 index 3fb0a9fd11fe..000000000000 --- a/extra/protobuf/protobuf-3.19.4/src/google/protobuf/compiler/objectivec/objectivec_enum_field.h +++ /dev/null @@ -1,80 +0,0 @@ -// Protocol Buffers - Google's data interchange format -// Copyright 2008 Google Inc. All rights reserved. -// https://developers.google.com/protocol-buffers/ -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// * Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// * Redistributions in binary form must reproduce the above -// copyright notice, this list of conditions and the following disclaimer -// in the documentation and/or other materials provided with the -// distribution. -// * Neither the name of Google Inc. nor the names of its -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -#ifndef GOOGLE_PROTOBUF_COMPILER_OBJECTIVEC_ENUM_FIELD_H__ -#define GOOGLE_PROTOBUF_COMPILER_OBJECTIVEC_ENUM_FIELD_H__ - -#include -#include -#include - -namespace google { -namespace protobuf { -namespace compiler { -namespace objectivec { - -class EnumFieldGenerator : public SingleFieldGenerator { - friend FieldGenerator* FieldGenerator::Make(const FieldDescriptor* field, - const Options& options); - - EnumFieldGenerator(const EnumFieldGenerator&) = delete; - EnumFieldGenerator& operator=(const EnumFieldGenerator&) = delete; - - public: - virtual void GenerateCFunctionDeclarations( - io::Printer* printer) const override; - virtual void GenerateCFunctionImplementations( - io::Printer* printer) const override; - virtual void DetermineForwardDeclarations( - std::set* fwd_decls) const override; - - protected: - EnumFieldGenerator(const FieldDescriptor* descriptor, const Options& options); - virtual ~EnumFieldGenerator(); -}; - -class RepeatedEnumFieldGenerator : public RepeatedFieldGenerator { - friend FieldGenerator* FieldGenerator::Make(const FieldDescriptor* field, - const Options& options); - - public: - virtual void FinishInitialization() override; - - protected: - RepeatedEnumFieldGenerator(const FieldDescriptor* descriptor, - const Options& options); - virtual ~RepeatedEnumFieldGenerator(); -}; - -} // namespace objectivec -} // namespace compiler -} // namespace protobuf -} // namespace google -#endif // GOOGLE_PROTOBUF_COMPILER_OBJECTIVEC_ENUM_FIELD_H__ diff --git a/extra/protobuf/protobuf-3.19.4/src/google/protobuf/compiler/objectivec/objectivec_extension.cc b/extra/protobuf/protobuf-3.19.4/src/google/protobuf/compiler/objectivec/objectivec_extension.cc deleted file mode 100644 index 9cebcb22afa6..000000000000 --- a/extra/protobuf/protobuf-3.19.4/src/google/protobuf/compiler/objectivec/objectivec_extension.cc +++ /dev/null @@ -1,156 +0,0 @@ -// Protocol Buffers - Google's data interchange format -// Copyright 2008 Google Inc. All rights reserved. -// https://developers.google.com/protocol-buffers/ -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// * Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// * Redistributions in binary form must reproduce the above -// copyright notice, this list of conditions and the following disclaimer -// in the documentation and/or other materials provided with the -// distribution. -// * Neither the name of Google Inc. nor the names of its -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -#include - -#include -#include -#include -#include -#include - -namespace google { -namespace protobuf { -namespace compiler { -namespace objectivec { - -ExtensionGenerator::ExtensionGenerator(const std::string& root_class_name, - const FieldDescriptor* descriptor) - : method_name_(ExtensionMethodName(descriptor)), - root_class_and_method_name_(root_class_name + "_" + method_name_), - descriptor_(descriptor) { - if (descriptor->is_map()) { - // NOTE: src/google/protobuf/compiler/plugin.cc makes use of cerr for some - // error cases, so it seems to be ok to use as a back door for errors. - std::cerr << "error: Extension is a map<>!" - << " That used to be blocked by the compiler." << std::endl; - std::cerr.flush(); - abort(); - } -} - -ExtensionGenerator::~ExtensionGenerator() {} - -void ExtensionGenerator::GenerateMembersHeader(io::Printer* printer) { - std::map vars; - vars["method_name"] = method_name_; - if (IsRetainedName(method_name_)) { - vars["storage_attribute"] = " NS_RETURNS_NOT_RETAINED"; - } else { - vars["storage_attribute"] = ""; - } - SourceLocation location; - if (descriptor_->GetSourceLocation(&location)) { - vars["comments"] = BuildCommentsString(location, true); - } else { - vars["comments"] = ""; - } - // Unlike normal message fields, check if the file for the extension was - // deprecated. - vars["deprecated_attribute"] = GetOptionalDeprecatedAttribute(descriptor_, descriptor_->file()); - printer->Print(vars, - "$comments$" - "+ (GPBExtensionDescriptor *)$method_name$$storage_attribute$$deprecated_attribute$;\n"); -} - -void ExtensionGenerator::GenerateStaticVariablesInitialization( - io::Printer* printer) { - std::map vars; - vars["root_class_and_method_name"] = root_class_and_method_name_; - const std::string containing_type = ClassName(descriptor_->containing_type()); - vars["extended_type"] = ObjCClass(containing_type); - vars["number"] = StrCat(descriptor_->number()); - - std::vector options; - if (descriptor_->is_repeated()) options.push_back("GPBExtensionRepeated"); - if (descriptor_->is_packed()) options.push_back("GPBExtensionPacked"); - if (descriptor_->containing_type()->options().message_set_wire_format()) { - options.push_back("GPBExtensionSetWireFormat"); - } - vars["options"] = BuildFlagsString(FLAGTYPE_EXTENSION, options); - - ObjectiveCType objc_type = GetObjectiveCType(descriptor_); - if (objc_type == OBJECTIVECTYPE_MESSAGE) { - std::string message_type = ClassName(descriptor_->message_type()); - vars["type"] = ObjCClass(message_type); - } else { - vars["type"] = "Nil"; - } - - vars["default_name"] = GPBGenericValueFieldName(descriptor_); - if (descriptor_->is_repeated()) { - vars["default"] = "nil"; - } else { - vars["default"] = DefaultValue(descriptor_); - } - std::string type = GetCapitalizedType(descriptor_); - vars["extension_type"] = std::string("GPBDataType") + type; - - if (objc_type == OBJECTIVECTYPE_ENUM) { - vars["enum_desc_func_name"] = - EnumName(descriptor_->enum_type()) + "_EnumDescriptor"; - } else { - vars["enum_desc_func_name"] = "NULL"; - } - - printer->Print(vars, - "{\n" - " .defaultValue.$default_name$ = $default$,\n" - " .singletonName = GPBStringifySymbol($root_class_and_method_name$),\n" - " .extendedClass.clazz = $extended_type$,\n" - " .messageOrGroupClass.clazz = $type$,\n" - " .enumDescriptorFunc = $enum_desc_func_name$,\n" - " .fieldNumber = $number$,\n" - " .dataType = $extension_type$,\n" - " .options = $options$,\n" - "},\n"); -} - -void ExtensionGenerator::DetermineObjectiveCClassDefinitions( - std::set* fwd_decls) { - std::string extended_type = ClassName(descriptor_->containing_type()); - fwd_decls->insert(ObjCClassDeclaration(extended_type)); - ObjectiveCType objc_type = GetObjectiveCType(descriptor_); - if (objc_type == OBJECTIVECTYPE_MESSAGE) { - std::string message_type = ClassName(descriptor_->message_type()); - fwd_decls->insert(ObjCClassDeclaration(message_type)); - } -} - -void ExtensionGenerator::GenerateRegistrationSource(io::Printer* printer) { - printer->Print( - "[registry addExtension:$root_class_and_method_name$];\n", - "root_class_and_method_name", root_class_and_method_name_); -} - -} // namespace objectivec -} // namespace compiler -} // namespace protobuf -} // namespace google diff --git a/extra/protobuf/protobuf-3.19.4/src/google/protobuf/compiler/objectivec/objectivec_extension.h b/extra/protobuf/protobuf-3.19.4/src/google/protobuf/compiler/objectivec/objectivec_extension.h deleted file mode 100644 index d412f4a9f2a8..000000000000 --- a/extra/protobuf/protobuf-3.19.4/src/google/protobuf/compiler/objectivec/objectivec_extension.h +++ /dev/null @@ -1,67 +0,0 @@ -// Protocol Buffers - Google's data interchange format -// Copyright 2008 Google Inc. All rights reserved. -// https://developers.google.com/protocol-buffers/ -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// * Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// * Redistributions in binary form must reproduce the above -// copyright notice, this list of conditions and the following disclaimer -// in the documentation and/or other materials provided with the -// distribution. -// * Neither the name of Google Inc. nor the names of its -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -#ifndef GOOGLE_PROTOBUF_COMPILER_OBJECTIVEC_EXTENSION_H__ -#define GOOGLE_PROTOBUF_COMPILER_OBJECTIVEC_EXTENSION_H__ - -#include -#include - -namespace google { -namespace protobuf { -namespace compiler { -namespace objectivec { - -class ExtensionGenerator { - public: - ExtensionGenerator(const std::string& root_class_name, - const FieldDescriptor* descriptor); - ~ExtensionGenerator(); - - ExtensionGenerator(const ExtensionGenerator&) = delete; - ExtensionGenerator& operator=(const ExtensionGenerator&) = delete; - - void GenerateMembersHeader(io::Printer* printer); - void GenerateStaticVariablesInitialization(io::Printer* printer); - void GenerateRegistrationSource(io::Printer* printer); - void DetermineObjectiveCClassDefinitions(std::set* fwd_decls); - - private: - std::string method_name_; - std::string root_class_and_method_name_; - const FieldDescriptor* descriptor_; -}; - -} // namespace objectivec -} // namespace compiler -} // namespace protobuf -} // namespace google - -#endif // GOOGLE_PROTOBUF_COMPILER_OBJECTIVEC_MESSAGE_H__ diff --git a/extra/protobuf/protobuf-3.19.4/src/google/protobuf/compiler/objectivec/objectivec_field.cc b/extra/protobuf/protobuf-3.19.4/src/google/protobuf/compiler/objectivec/objectivec_field.cc deleted file mode 100644 index eb23fee19f80..000000000000 --- a/extra/protobuf/protobuf-3.19.4/src/google/protobuf/compiler/objectivec/objectivec_field.cc +++ /dev/null @@ -1,475 +0,0 @@ -// Protocol Buffers - Google's data interchange format -// Copyright 2008 Google Inc. All rights reserved. -// https://developers.google.com/protocol-buffers/ -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// * Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// * Redistributions in binary form must reproduce the above -// copyright notice, this list of conditions and the following disclaimer -// in the documentation and/or other materials provided with the -// distribution. -// * Neither the name of Google Inc. nor the names of its -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -#include - -#include -#include -#include -#include -#include -#include -#include -#include -#include - -namespace google { -namespace protobuf { -namespace compiler { -namespace objectivec { - -namespace { - -void SetCommonFieldVariables(const FieldDescriptor* descriptor, - std::map* variables) { - std::string camel_case_name = FieldName(descriptor); - std::string raw_field_name; - if (descriptor->type() == FieldDescriptor::TYPE_GROUP) { - raw_field_name = descriptor->message_type()->name(); - } else { - raw_field_name = descriptor->name(); - } - // The logic here has to match -[GGPBFieldDescriptor textFormatName]. - const std::string un_camel_case_name( - UnCamelCaseFieldName(camel_case_name, descriptor)); - const bool needs_custom_name = (raw_field_name != un_camel_case_name); - - SourceLocation location; - if (descriptor->GetSourceLocation(&location)) { - (*variables)["comments"] = BuildCommentsString(location, true); - } else { - (*variables)["comments"] = "\n"; - } - const std::string& classname = ClassName(descriptor->containing_type()); - (*variables)["classname"] = classname; - (*variables)["name"] = camel_case_name; - const std::string& capitalized_name = FieldNameCapitalized(descriptor); - (*variables)["capitalized_name"] = capitalized_name; - (*variables)["raw_field_name"] = raw_field_name; - (*variables)["field_number_name"] = - classname + "_FieldNumber_" + capitalized_name; - (*variables)["field_number"] = StrCat(descriptor->number()); - (*variables)["field_type"] = GetCapitalizedType(descriptor); - (*variables)["deprecated_attribute"] = GetOptionalDeprecatedAttribute(descriptor); - std::vector field_flags; - if (descriptor->is_repeated()) field_flags.push_back("GPBFieldRepeated"); - if (descriptor->is_required()) field_flags.push_back("GPBFieldRequired"); - if (descriptor->is_optional()) field_flags.push_back("GPBFieldOptional"); - if (descriptor->is_packed()) field_flags.push_back("GPBFieldPacked"); - - // ObjC custom flags. - if (descriptor->has_default_value()) - field_flags.push_back("GPBFieldHasDefaultValue"); - if (needs_custom_name) field_flags.push_back("GPBFieldTextFormatNameCustom"); - if (descriptor->type() == FieldDescriptor::TYPE_ENUM) { - field_flags.push_back("GPBFieldHasEnumDescriptor"); - } - // It will clear on a zero value if... - // - not repeated/map - // - doesn't have presence - bool clear_on_zero = - (!descriptor->is_repeated() && !descriptor->has_presence()); - if (clear_on_zero) { - field_flags.push_back("GPBFieldClearHasIvarOnZero"); - } - - (*variables)["fieldflags"] = BuildFlagsString(FLAGTYPE_FIELD, field_flags); - - (*variables)["default"] = DefaultValue(descriptor); - (*variables)["default_name"] = GPBGenericValueFieldName(descriptor); - - (*variables)["dataTypeSpecific_name"] = "clazz"; - (*variables)["dataTypeSpecific_value"] = "Nil"; - - (*variables)["storage_offset_value"] = - "(uint32_t)offsetof(" + classname + "__storage_, " + camel_case_name + ")"; - (*variables)["storage_offset_comment"] = ""; - - // Clear some common things so they can be set just when needed. - (*variables)["storage_attribute"] = ""; -} - -} // namespace - -FieldGenerator* FieldGenerator::Make(const FieldDescriptor* field, - const Options& options) { - FieldGenerator* result = NULL; - if (field->is_repeated()) { - switch (GetObjectiveCType(field)) { - case OBJECTIVECTYPE_MESSAGE: { - if (field->is_map()) { - result = new MapFieldGenerator(field, options); - } else { - result = new RepeatedMessageFieldGenerator(field, options); - } - break; - } - case OBJECTIVECTYPE_ENUM: - result = new RepeatedEnumFieldGenerator(field, options); - break; - default: - result = new RepeatedPrimitiveFieldGenerator(field, options); - break; - } - } else { - switch (GetObjectiveCType(field)) { - case OBJECTIVECTYPE_MESSAGE: { - result = new MessageFieldGenerator(field, options); - break; - } - case OBJECTIVECTYPE_ENUM: - result = new EnumFieldGenerator(field, options); - break; - default: - if (IsReferenceType(field)) { - result = new PrimitiveObjFieldGenerator(field, options); - } else { - result = new PrimitiveFieldGenerator(field, options); - } - break; - } - } - result->FinishInitialization(); - return result; -} - -FieldGenerator::FieldGenerator(const FieldDescriptor* descriptor, - const Options& options) - : descriptor_(descriptor) { - SetCommonFieldVariables(descriptor, &variables_); -} - -FieldGenerator::~FieldGenerator() {} - -void FieldGenerator::GenerateFieldNumberConstant(io::Printer* printer) const { - printer->Print( - variables_, - "$field_number_name$ = $field_number$,\n"); -} - -void FieldGenerator::GenerateCFunctionDeclarations( - io::Printer* printer) const { - // Nothing -} - -void FieldGenerator::GenerateCFunctionImplementations( - io::Printer* printer) const { - // Nothing -} - -void FieldGenerator::DetermineForwardDeclarations( - std::set* fwd_decls) const { - // Nothing -} - -void FieldGenerator::DetermineObjectiveCClassDefinitions( - std::set* fwd_decls) const { - // Nothing -} - -void FieldGenerator::GenerateFieldDescription( - io::Printer* printer, bool include_default) const { - // Printed in the same order as the structure decl. - if (include_default) { - printer->Print( - variables_, - "{\n" - " .defaultValue.$default_name$ = $default$,\n" - " .core.name = \"$name$\",\n" - " .core.dataTypeSpecific.$dataTypeSpecific_name$ = $dataTypeSpecific_value$,\n" - " .core.number = $field_number_name$,\n" - " .core.hasIndex = $has_index$,\n" - " .core.offset = $storage_offset_value$,$storage_offset_comment$\n" - " .core.flags = $fieldflags$,\n" - " .core.dataType = GPBDataType$field_type$,\n" - "},\n"); - } else { - printer->Print( - variables_, - "{\n" - " .name = \"$name$\",\n" - " .dataTypeSpecific.$dataTypeSpecific_name$ = $dataTypeSpecific_value$,\n" - " .number = $field_number_name$,\n" - " .hasIndex = $has_index$,\n" - " .offset = $storage_offset_value$,$storage_offset_comment$\n" - " .flags = $fieldflags$,\n" - " .dataType = GPBDataType$field_type$,\n" - "},\n"); - } -} - -void FieldGenerator::SetRuntimeHasBit(int has_index) { - variables_["has_index"] = StrCat(has_index); -} - -void FieldGenerator::SetNoHasBit(void) { - variables_["has_index"] = "GPBNoHasBit"; -} - -int FieldGenerator::ExtraRuntimeHasBitsNeeded(void) const { - return 0; -} - -void FieldGenerator::SetExtraRuntimeHasBitsBase(int index_base) { - // NOTE: src/google/protobuf/compiler/plugin.cc makes use of cerr for some - // error cases, so it seems to be ok to use as a back door for errors. - std::cerr << "Error: should have overridden SetExtraRuntimeHasBitsBase()." << std::endl; - std::cerr.flush(); - abort(); -} - -void FieldGenerator::SetOneofIndexBase(int index_base) { - const OneofDescriptor* oneof = descriptor_->real_containing_oneof(); - if (oneof != NULL) { - int index = oneof->index() + index_base; - // Flip the sign to mark it as a oneof. - variables_["has_index"] = StrCat(-index); - } -} - -bool FieldGenerator::WantsHasProperty(void) const { - return descriptor_->has_presence() && !descriptor_->real_containing_oneof(); -} - -void FieldGenerator::FinishInitialization(void) { - // If "property_type" wasn't set, make it "storage_type". - if ((variables_.find("property_type") == variables_.end()) && - (variables_.find("storage_type") != variables_.end())) { - variables_["property_type"] = variable("storage_type"); - } -} - -SingleFieldGenerator::SingleFieldGenerator(const FieldDescriptor* descriptor, - const Options& options) - : FieldGenerator(descriptor, options) { - // Nothing -} - -SingleFieldGenerator::~SingleFieldGenerator() {} - -void SingleFieldGenerator::GenerateFieldStorageDeclaration( - io::Printer* printer) const { - printer->Print(variables_, "$storage_type$ $name$;\n"); -} - -void SingleFieldGenerator::GeneratePropertyDeclaration( - io::Printer* printer) const { - printer->Print(variables_, "$comments$"); - printer->Print( - variables_, - "@property(nonatomic, readwrite) $property_type$ $name$$deprecated_attribute$;\n" - "\n"); - if (WantsHasProperty()) { - printer->Print( - variables_, - "@property(nonatomic, readwrite) BOOL has$capitalized_name$$deprecated_attribute$;\n"); - } -} - -void SingleFieldGenerator::GeneratePropertyImplementation( - io::Printer* printer) const { - if (WantsHasProperty()) { - printer->Print(variables_, "@dynamic has$capitalized_name$, $name$;\n"); - } else { - printer->Print(variables_, "@dynamic $name$;\n"); - } -} - -bool SingleFieldGenerator::RuntimeUsesHasBit(void) const { - if (descriptor_->real_containing_oneof()) { - // The oneof tracks what is set instead. - return false; - } - return true; -} - -ObjCObjFieldGenerator::ObjCObjFieldGenerator(const FieldDescriptor* descriptor, - const Options& options) - : SingleFieldGenerator(descriptor, options) { - variables_["property_storage_attribute"] = "strong"; - if (IsRetainedName(variables_["name"])) { - variables_["storage_attribute"] = " NS_RETURNS_NOT_RETAINED"; - } -} - -ObjCObjFieldGenerator::~ObjCObjFieldGenerator() {} - -void ObjCObjFieldGenerator::GenerateFieldStorageDeclaration( - io::Printer* printer) const { - printer->Print(variables_, "$storage_type$ *$name$;\n"); -} - -void ObjCObjFieldGenerator::GeneratePropertyDeclaration( - io::Printer* printer) const { - - // Differs from SingleFieldGenerator::GeneratePropertyDeclaration() in that - // it uses pointers and deals with Objective C's rules around storage name - // conventions (init*, new*, etc.) - - printer->Print(variables_, "$comments$"); - printer->Print( - variables_, - "@property(nonatomic, readwrite, $property_storage_attribute$, null_resettable) $property_type$ *$name$$storage_attribute$$deprecated_attribute$;\n"); - if (WantsHasProperty()) { - printer->Print( - variables_, - "/** Test to see if @c $name$ has been set. */\n" - "@property(nonatomic, readwrite) BOOL has$capitalized_name$$deprecated_attribute$;\n"); - } - if (IsInitName(variables_.find("name")->second)) { - // If property name starts with init we need to annotate it to get past ARC. - // http://stackoverflow.com/questions/18723226/how-do-i-annotate-an-objective-c-property-with-an-objc-method-family/18723227#18723227 - printer->Print(variables_, - "- ($property_type$ *)$name$ GPB_METHOD_FAMILY_NONE$deprecated_attribute$;\n"); - } - printer->Print("\n"); -} - -RepeatedFieldGenerator::RepeatedFieldGenerator( - const FieldDescriptor* descriptor, const Options& options) - : ObjCObjFieldGenerator(descriptor, options) { - // Default to no comment and let the cases needing it fill it in. - variables_["array_comment"] = ""; -} - -RepeatedFieldGenerator::~RepeatedFieldGenerator() {} - -void RepeatedFieldGenerator::FinishInitialization(void) { - FieldGenerator::FinishInitialization(); - if (variables_.find("array_property_type") == variables_.end()) { - variables_["array_property_type"] = variable("array_storage_type"); - } -} - -void RepeatedFieldGenerator::GenerateFieldStorageDeclaration( - io::Printer* printer) const { - printer->Print(variables_, "$array_storage_type$ *$name$;\n"); -} - -void RepeatedFieldGenerator::GeneratePropertyImplementation( - io::Printer* printer) const { - printer->Print(variables_, "@dynamic $name$, $name$_Count;\n"); -} - -void RepeatedFieldGenerator::GeneratePropertyDeclaration( - io::Printer* printer) const { - - // Repeated fields don't need the has* properties, but they do expose a - // *Count (to check without autocreation). So for the field property we need - // the same logic as ObjCObjFieldGenerator::GeneratePropertyDeclaration() for - // dealing with needing Objective C's rules around storage name conventions - // (init*, new*, etc.) - - printer->Print( - variables_, - "$comments$" - "$array_comment$" - "@property(nonatomic, readwrite, strong, null_resettable) $array_property_type$ *$name$$storage_attribute$$deprecated_attribute$;\n" - "/** The number of items in @c $name$ without causing the array to be created. */\n" - "@property(nonatomic, readonly) NSUInteger $name$_Count$deprecated_attribute$;\n"); - if (IsInitName(variables_.find("name")->second)) { - // If property name starts with init we need to annotate it to get past ARC. - // http://stackoverflow.com/questions/18723226/how-do-i-annotate-an-objective-c-property-with-an-objc-method-family/18723227#18723227 - printer->Print(variables_, - "- ($array_property_type$ *)$name$ GPB_METHOD_FAMILY_NONE$deprecated_attribute$;\n"); - } - printer->Print("\n"); -} - -bool RepeatedFieldGenerator::RuntimeUsesHasBit(void) const { - return false; // The array (or map/dict) having anything is what is used. -} - -FieldGeneratorMap::FieldGeneratorMap(const Descriptor* descriptor, - const Options& options) - : descriptor_(descriptor), - field_generators_(descriptor->field_count()), - extension_generators_(descriptor->extension_count()) { - // Construct all the FieldGenerators. - for (int i = 0; i < descriptor->field_count(); i++) { - field_generators_[i].reset( - FieldGenerator::Make(descriptor->field(i), options)); - } - for (int i = 0; i < descriptor->extension_count(); i++) { - extension_generators_[i].reset( - FieldGenerator::Make(descriptor->extension(i), options)); - } -} - -FieldGeneratorMap::~FieldGeneratorMap() {} - -const FieldGenerator& FieldGeneratorMap::get( - const FieldDescriptor* field) const { - GOOGLE_CHECK_EQ(field->containing_type(), descriptor_); - return *field_generators_[field->index()]; -} - -const FieldGenerator& FieldGeneratorMap::get_extension(int index) const { - return *extension_generators_[index]; -} - -int FieldGeneratorMap::CalculateHasBits(void) { - int total_bits = 0; - for (int i = 0; i < descriptor_->field_count(); i++) { - if (field_generators_[i]->RuntimeUsesHasBit()) { - field_generators_[i]->SetRuntimeHasBit(total_bits); - ++total_bits; - } else { - field_generators_[i]->SetNoHasBit(); - } - int extra_bits = field_generators_[i]->ExtraRuntimeHasBitsNeeded(); - if (extra_bits) { - field_generators_[i]->SetExtraRuntimeHasBitsBase(total_bits); - total_bits += extra_bits; - } - } - return total_bits; -} - -void FieldGeneratorMap::SetOneofIndexBase(int index_base) { - for (int i = 0; i < descriptor_->field_count(); i++) { - field_generators_[i]->SetOneofIndexBase(index_base); - } -} - -bool FieldGeneratorMap::DoesAnyFieldHaveNonZeroDefault(void) const { - for (int i = 0; i < descriptor_->field_count(); i++) { - if (HasNonZeroDefaultValue(descriptor_->field(i))) { - return true; - } - } - - return false; -} - -} // namespace objectivec -} // namespace compiler -} // namespace protobuf -} // namespace google diff --git a/extra/protobuf/protobuf-3.19.4/src/google/protobuf/compiler/objectivec/objectivec_field.h b/extra/protobuf/protobuf-3.19.4/src/google/protobuf/compiler/objectivec/objectivec_field.h deleted file mode 100644 index ad8e55aeb228..000000000000 --- a/extra/protobuf/protobuf-3.19.4/src/google/protobuf/compiler/objectivec/objectivec_field.h +++ /dev/null @@ -1,194 +0,0 @@ -// Protocol Buffers - Google's data interchange format -// Copyright 2008 Google Inc. All rights reserved. -// https://developers.google.com/protocol-buffers/ -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// * Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// * Redistributions in binary form must reproduce the above -// copyright notice, this list of conditions and the following disclaimer -// in the documentation and/or other materials provided with the -// distribution. -// * Neither the name of Google Inc. nor the names of its -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -#ifndef GOOGLE_PROTOBUF_COMPILER_OBJECTIVEC_FIELD_H__ -#define GOOGLE_PROTOBUF_COMPILER_OBJECTIVEC_FIELD_H__ - -#include -#include -#include -#include -#include - -namespace google { -namespace protobuf { -namespace compiler { -namespace objectivec { - -class FieldGenerator { - public: - static FieldGenerator* Make(const FieldDescriptor* field, - const Options& options); - - virtual ~FieldGenerator(); - - FieldGenerator(const FieldGenerator&) = delete; - FieldGenerator& operator=(const FieldGenerator&) = delete; - - // Exposed for subclasses to fill in. - virtual void GenerateFieldStorageDeclaration(io::Printer* printer) const = 0; - virtual void GeneratePropertyDeclaration(io::Printer* printer) const = 0; - virtual void GeneratePropertyImplementation(io::Printer* printer) const = 0; - - // Called by GenerateFieldDescription, exposed for classes that need custom - // generation. - - // Exposed for subclasses to extend, base does nothing. - virtual void GenerateCFunctionDeclarations(io::Printer* printer) const; - virtual void GenerateCFunctionImplementations(io::Printer* printer) const; - - // Exposed for subclasses, should always call it on the parent class also. - virtual void DetermineForwardDeclarations( - std::set* fwd_decls) const; - virtual void DetermineObjectiveCClassDefinitions( - std::set* fwd_decls) const; - - // Used during generation, not intended to be extended by subclasses. - void GenerateFieldDescription( - io::Printer* printer, bool include_default) const; - void GenerateFieldNumberConstant(io::Printer* printer) const; - - // Exposed to get and set the has bits information. - virtual bool RuntimeUsesHasBit(void) const = 0; - void SetRuntimeHasBit(int has_index); - void SetNoHasBit(void); - virtual int ExtraRuntimeHasBitsNeeded(void) const; - virtual void SetExtraRuntimeHasBitsBase(int index_base); - void SetOneofIndexBase(int index_base); - - std::string variable(const char* key) const { - return variables_.find(key)->second; - } - - bool needs_textformat_name_support() const { - const std::string& field_flags = variable("fieldflags"); - return field_flags.find("GPBFieldTextFormatNameCustom") != - std::string::npos; - } - std::string generated_objc_name() const { return variable("name"); } - std::string raw_field_name() const { return variable("raw_field_name"); } - - protected: - FieldGenerator(const FieldDescriptor* descriptor, const Options& options); - - virtual void FinishInitialization(void); - bool WantsHasProperty(void) const; - - const FieldDescriptor* descriptor_; - std::map variables_; -}; - -class SingleFieldGenerator : public FieldGenerator { - public: - virtual ~SingleFieldGenerator(); - - SingleFieldGenerator(const SingleFieldGenerator&) = delete; - SingleFieldGenerator& operator=(const SingleFieldGenerator&) = delete; - - virtual void GenerateFieldStorageDeclaration(io::Printer* printer) const override; - virtual void GeneratePropertyDeclaration(io::Printer* printer) const override; - - virtual void GeneratePropertyImplementation(io::Printer* printer) const override; - - virtual bool RuntimeUsesHasBit(void) const override; - - protected: - SingleFieldGenerator(const FieldDescriptor* descriptor, - const Options& options); -}; - -// Subclass with common support for when the field ends up as an ObjC Object. -class ObjCObjFieldGenerator : public SingleFieldGenerator { - public: - virtual ~ObjCObjFieldGenerator(); - - ObjCObjFieldGenerator(const ObjCObjFieldGenerator&) = delete; - ObjCObjFieldGenerator& operator=(const ObjCObjFieldGenerator&) = delete; - - virtual void GenerateFieldStorageDeclaration(io::Printer* printer) const override; - virtual void GeneratePropertyDeclaration(io::Printer* printer) const override; - - protected: - ObjCObjFieldGenerator(const FieldDescriptor* descriptor, - const Options& options); -}; - -class RepeatedFieldGenerator : public ObjCObjFieldGenerator { - public: - virtual ~RepeatedFieldGenerator(); - - RepeatedFieldGenerator(const RepeatedFieldGenerator&) = delete; - RepeatedFieldGenerator& operator=(const RepeatedFieldGenerator&) = delete; - - virtual void GenerateFieldStorageDeclaration(io::Printer* printer) const override; - virtual void GeneratePropertyDeclaration(io::Printer* printer) const override; - - virtual void GeneratePropertyImplementation(io::Printer* printer) const override; - - virtual bool RuntimeUsesHasBit(void) const override; - - protected: - RepeatedFieldGenerator(const FieldDescriptor* descriptor, - const Options& options); - virtual void FinishInitialization(void) override; -}; - -// Convenience class which constructs FieldGenerators for a Descriptor. -class FieldGeneratorMap { - public: - FieldGeneratorMap(const Descriptor* descriptor, const Options& options); - ~FieldGeneratorMap(); - - FieldGeneratorMap(const FieldGeneratorMap&) = delete; - FieldGeneratorMap& operator=(const FieldGeneratorMap&) = delete; - - const FieldGenerator& get(const FieldDescriptor* field) const; - const FieldGenerator& get_extension(int index) const; - - // Assigns the has bits and returns the number of bits needed. - int CalculateHasBits(void); - - void SetOneofIndexBase(int index_base); - - // Check if any field of this message has a non zero default. - bool DoesAnyFieldHaveNonZeroDefault(void) const; - - private: - const Descriptor* descriptor_; - std::vector> field_generators_; - std::vector> extension_generators_; -}; - -} // namespace objectivec -} // namespace compiler -} // namespace protobuf -} // namespace google - -#endif // GOOGLE_PROTOBUF_COMPILER_OBJECTIVEC_FIELD_H__ diff --git a/extra/protobuf/protobuf-3.19.4/src/google/protobuf/compiler/objectivec/objectivec_file.cc b/extra/protobuf/protobuf-3.19.4/src/google/protobuf/compiler/objectivec/objectivec_file.cc deleted file mode 100644 index d9f43a55c73c..000000000000 --- a/extra/protobuf/protobuf-3.19.4/src/google/protobuf/compiler/objectivec/objectivec_file.cc +++ /dev/null @@ -1,610 +0,0 @@ -// Protocol Buffers - Google's data interchange format -// Copyright 2008 Google Inc. All rights reserved. -// https://developers.google.com/protocol-buffers/ -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// * Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// * Redistributions in binary form must reproduce the above -// copyright notice, this list of conditions and the following disclaimer -// in the documentation and/or other materials provided with the -// distribution. -// * Neither the name of Google Inc. nor the names of its -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include // std::find() -#include -#include - -// NOTE: src/google/protobuf/compiler/plugin.cc makes use of cerr for some -// error cases, so it seems to be ok to use as a back door for errors. - -namespace google { -namespace protobuf { -namespace compiler { -namespace objectivec { - -namespace { - -// This is also found in GPBBootstrap.h, and needs to be kept in sync. -const int32_t GOOGLE_PROTOBUF_OBJC_VERSION = 30004; - -const char* kHeaderExtension = ".pbobjc.h"; - -// Checks if a message contains any enums definitions (on the message or -// a nested message under it). -bool MessageContainsEnums(const Descriptor* message) { - if (message->enum_type_count() > 0) { - return true; - } - for (int i = 0; i < message->nested_type_count(); i++) { - if (MessageContainsEnums(message->nested_type(i))) { - return true; - } - } - return false; -} - -// Checks if a message contains any extension definitions (on the message or -// a nested message under it). -bool MessageContainsExtensions(const Descriptor* message) { - if (message->extension_count() > 0) { - return true; - } - for (int i = 0; i < message->nested_type_count(); i++) { - if (MessageContainsExtensions(message->nested_type(i))) { - return true; - } - } - return false; -} - -// Checks if the file contains any enum definitions (at the root or -// nested under a message). -bool FileContainsEnums(const FileDescriptor* file) { - if (file->enum_type_count() > 0) { - return true; - } - for (int i = 0; i < file->message_type_count(); i++) { - if (MessageContainsEnums(file->message_type(i))) { - return true; - } - } - return false; -} - -// Checks if the file contains any extensions definitions (at the root or -// nested under a message). -bool FileContainsExtensions(const FileDescriptor* file) { - if (file->extension_count() > 0) { - return true; - } - for (int i = 0; i < file->message_type_count(); i++) { - if (MessageContainsExtensions(file->message_type(i))) { - return true; - } - } - return false; -} - -// Helper for CollectMinimalFileDepsContainingExtensionsWorker that marks all -// deps as visited and prunes them from the needed files list. -void PruneFileAndDepsMarkingAsVisited( - const FileDescriptor* file, - std::vector* files, - std::set* files_visited) { - std::vector::iterator iter = - std::find(files->begin(), files->end(), file); - if (iter != files->end()) { - files->erase(iter); - } - files_visited->insert(file); - for (int i = 0; i < file->dependency_count(); i++) { - PruneFileAndDepsMarkingAsVisited(file->dependency(i), files, files_visited); - } -} - -// Helper for CollectMinimalFileDepsContainingExtensions. -void CollectMinimalFileDepsContainingExtensionsWorker( - const FileDescriptor* file, - std::vector* files, - std::set* files_visited) { - if (files_visited->find(file) != files_visited->end()) { - return; - } - files_visited->insert(file); - - if (FileContainsExtensions(file)) { - files->push_back(file); - for (int i = 0; i < file->dependency_count(); i++) { - const FileDescriptor* dep = file->dependency(i); - PruneFileAndDepsMarkingAsVisited(dep, files, files_visited); - } - } else { - for (int i = 0; i < file->dependency_count(); i++) { - const FileDescriptor* dep = file->dependency(i); - CollectMinimalFileDepsContainingExtensionsWorker(dep, files, - files_visited); - } - } -} - -// Collect the deps of the given file that contain extensions. This can be used to -// create the chain of roots that need to be wired together. -// -// NOTE: If any changes are made to this and the supporting functions, you will -// need to manually validate what the generated code is for the test files: -// objectivec/Tests/unittest_extension_chain_*.proto -// There are comments about what the expected code should be line and limited -// testing objectivec/Tests/GPBUnittestProtos2.m around compilation (#imports -// specifically). -void CollectMinimalFileDepsContainingExtensions( - const FileDescriptor* file, - std::vector* files) { - std::set files_visited; - for (int i = 0; i < file->dependency_count(); i++) { - const FileDescriptor* dep = file->dependency(i); - CollectMinimalFileDepsContainingExtensionsWorker(dep, files, - &files_visited); - } -} - -bool IsDirectDependency(const FileDescriptor* dep, const FileDescriptor* file) { - for (int i = 0; i < file->dependency_count(); i++) { - if (dep == file->dependency(i)) { - return true; - } - } - return false; -} - -} // namespace - -FileGenerator::FileGenerator(const FileDescriptor* file, const Options& options) - : file_(file), - root_class_name_(FileClassName(file)), - is_bundled_proto_(IsProtobufLibraryBundledProtoFile(file)), - options_(options) { - for (int i = 0; i < file_->enum_type_count(); i++) { - EnumGenerator* generator = new EnumGenerator(file_->enum_type(i)); - enum_generators_.emplace_back(generator); - } - for (int i = 0; i < file_->message_type_count(); i++) { - MessageGenerator* generator = - new MessageGenerator(root_class_name_, file_->message_type(i), options_); - message_generators_.emplace_back(generator); - } - for (int i = 0; i < file_->extension_count(); i++) { - ExtensionGenerator* generator = - new ExtensionGenerator(root_class_name_, file_->extension(i)); - extension_generators_.emplace_back(generator); - } -} - -FileGenerator::~FileGenerator() {} - -void FileGenerator::GenerateHeader(io::Printer* printer) { - std::vector headers; - // Generated files bundled with the library get minimal imports, everything - // else gets the wrapper so everything is usable. - if (is_bundled_proto_) { - headers.push_back("GPBDescriptor.h"); - headers.push_back("GPBMessage.h"); - headers.push_back("GPBRootObject.h"); - } else { - headers.push_back("GPBProtocolBuffers.h"); - } - PrintFileRuntimePreamble(printer, headers); - - // Add some verification that the generated code matches the source the - // code is being compiled with. - // NOTE: This captures the raw numeric values at the time the generator was - // compiled, since that will be the versions for the ObjC runtime at that - // time. The constants in the generated code will then get their values at - // at compile time (so checking against the headers being used to compile). - printer->Print( - "#if GOOGLE_PROTOBUF_OBJC_VERSION < $google_protobuf_objc_version$\n" - "#error This file was generated by a newer version of protoc which is incompatible with your Protocol Buffer library sources.\n" - "#endif\n" - "#if $google_protobuf_objc_version$ < GOOGLE_PROTOBUF_OBJC_MIN_SUPPORTED_VERSION\n" - "#error This file was generated by an older version of protoc which is incompatible with your Protocol Buffer library sources.\n" - "#endif\n" - "\n", - "google_protobuf_objc_version", StrCat(GOOGLE_PROTOBUF_OBJC_VERSION)); - - // #import any headers for "public imports" in the proto file. - { - ImportWriter import_writer( - options_.generate_for_named_framework, - options_.named_framework_to_proto_path_mappings_path, - options_.runtime_import_prefix, - is_bundled_proto_); - const std::string header_extension(kHeaderExtension); - for (int i = 0; i < file_->public_dependency_count(); i++) { - import_writer.AddFile(file_->public_dependency(i), header_extension); - } - import_writer.Print(printer); - } - - // Note: - // deprecated-declarations suppression is only needed if some place in this - // proto file is something deprecated or if it references something from - // another file that is deprecated. - printer->Print( - "// @@protoc_insertion_point(imports)\n" - "\n" - "#pragma clang diagnostic push\n" - "#pragma clang diagnostic ignored \"-Wdeprecated-declarations\"\n" - "\n" - "CF_EXTERN_C_BEGIN\n" - "\n"); - - std::set fwd_decls; - for (const auto& generator : message_generators_) { - generator->DetermineForwardDeclarations(&fwd_decls); - } - for (std::set::const_iterator i(fwd_decls.begin()); - i != fwd_decls.end(); ++i) { - printer->Print("$value$;\n", "value", *i); - } - if (fwd_decls.begin() != fwd_decls.end()) { - printer->Print("\n"); - } - - printer->Print( - "NS_ASSUME_NONNULL_BEGIN\n" - "\n"); - - // need to write out all enums first - for (const auto& generator : enum_generators_) { - generator->GenerateHeader(printer); - } - - for (const auto& generator : message_generators_) { - generator->GenerateEnumHeader(printer); - } - - // For extensions to chain together, the Root gets created even if there - // are no extensions. - printer->Print( - "#pragma mark - $root_class_name$\n" - "\n" - "/**\n" - " * Exposes the extension registry for this file.\n" - " *\n" - " * The base class provides:\n" - " * @code\n" - " * + (GPBExtensionRegistry *)extensionRegistry;\n" - " * @endcode\n" - " * which is a @c GPBExtensionRegistry that includes all the extensions defined by\n" - " * this file and all files that it depends on.\n" - " **/\n" - "GPB_FINAL @interface $root_class_name$ : GPBRootObject\n" - "@end\n" - "\n", - "root_class_name", root_class_name_); - - if (!extension_generators_.empty()) { - // The dynamic methods block is only needed if there are extensions. - printer->Print( - "@interface $root_class_name$ (DynamicMethods)\n", - "root_class_name", root_class_name_); - - for (const auto& generator : extension_generators_) { - generator->GenerateMembersHeader(printer); - } - - printer->Print("@end\n\n"); - } // !extension_generators_.empty() - - for (const auto& generator : message_generators_) { - generator->GenerateMessageHeader(printer); - } - - printer->Print( - "NS_ASSUME_NONNULL_END\n" - "\n" - "CF_EXTERN_C_END\n" - "\n" - "#pragma clang diagnostic pop\n" - "\n" - "// @@protoc_insertion_point(global_scope)\n"); -} - -void FileGenerator::GenerateSource(io::Printer* printer) { - // #import the runtime support. - std::vector headers; - headers.push_back("GPBProtocolBuffers_RuntimeSupport.h"); - PrintFileRuntimePreamble(printer, headers); - - // Enums use atomic in the generated code, so add the system import as needed. - if (FileContainsEnums(file_)) { - printer->Print( - "#import \n" - "\n"); - } - - std::vector deps_with_extensions; - CollectMinimalFileDepsContainingExtensions(file_, &deps_with_extensions); - - { - ImportWriter import_writer( - options_.generate_for_named_framework, - options_.named_framework_to_proto_path_mappings_path, - options_.runtime_import_prefix, - is_bundled_proto_); - const std::string header_extension(kHeaderExtension); - - // #import the header for this proto file. - import_writer.AddFile(file_, header_extension); - - // #import the headers for anything that a plain dependency of this proto - // file (that means they were just an include, not a "public" include). - std::set public_import_names; - for (int i = 0; i < file_->public_dependency_count(); i++) { - public_import_names.insert(file_->public_dependency(i)->name()); - } - for (int i = 0; i < file_->dependency_count(); i++) { - const FileDescriptor *dep = file_->dependency(i); - bool public_import = (public_import_names.count(dep->name()) != 0); - if (!public_import) { - import_writer.AddFile(dep, header_extension); - } - } - - // If any indirect dependency provided extensions, it needs to be directly - // imported so it can get merged into the root's extensions registry. - // See the Note by CollectMinimalFileDepsContainingExtensions before - // changing this. - for (std::vector::iterator iter = - deps_with_extensions.begin(); - iter != deps_with_extensions.end(); ++iter) { - if (!IsDirectDependency(*iter, file_)) { - import_writer.AddFile(*iter, header_extension); - } - } - - import_writer.Print(printer); - } - - bool includes_oneof = false; - for (const auto& generator : message_generators_) { - if (generator->IncludesOneOfDefinition()) { - includes_oneof = true; - break; - } - } - - std::set fwd_decls; - for (const auto& generator : message_generators_) { - generator->DetermineObjectiveCClassDefinitions(&fwd_decls); - } - for (const auto& generator : extension_generators_) { - generator->DetermineObjectiveCClassDefinitions(&fwd_decls); - } - - // Note: - // deprecated-declarations suppression is only needed if some place in this - // proto file is something deprecated or if it references something from - // another file that is deprecated. - // dollar-in-identifier-extension is needed because we use references to - // objc class names that have $ in identifiers. - printer->Print( - "// @@protoc_insertion_point(imports)\n" - "\n" - "#pragma clang diagnostic push\n" - "#pragma clang diagnostic ignored \"-Wdeprecated-declarations\"\n"); - if (includes_oneof) { - // The generated code for oneof's uses direct ivar access, suppress the - // warning in case developer turn that on in the context they compile the - // generated code. - printer->Print( - "#pragma clang diagnostic ignored \"-Wdirect-ivar-access\"\n"); - } - if (!fwd_decls.empty()) { - printer->Print( - "#pragma clang diagnostic ignored \"-Wdollar-in-identifier-extension\"\n"); - } - printer->Print( - "\n"); - if (!fwd_decls.empty()) { - printer->Print( - "#pragma mark - Objective C Class declarations\n" - "// Forward declarations of Objective C classes that we can use as\n" - "// static values in struct initializers.\n" - "// We don't use [Foo class] because it is not a static value.\n"); - } - for (const auto& i : fwd_decls) { - printer->Print("$value$\n", "value", i); - } - if (!fwd_decls.empty()) { - printer->Print("\n"); - } - printer->Print( - "#pragma mark - $root_class_name$\n" - "\n" - "@implementation $root_class_name$\n\n", - "root_class_name", root_class_name_); - - const bool file_contains_extensions = FileContainsExtensions(file_); - - // If there were any extensions or this file has any dependencies, output - // a registry to override to create the file specific registry. - if (file_contains_extensions || !deps_with_extensions.empty()) { - printer->Print( - "+ (GPBExtensionRegistry*)extensionRegistry {\n" - " // This is called by +initialize so there is no need to worry\n" - " // about thread safety and initialization of registry.\n" - " static GPBExtensionRegistry* registry = nil;\n" - " if (!registry) {\n" - " GPB_DEBUG_CHECK_RUNTIME_VERSIONS();\n" - " registry = [[GPBExtensionRegistry alloc] init];\n"); - - printer->Indent(); - printer->Indent(); - - if (file_contains_extensions) { - printer->Print( - "static GPBExtensionDescription descriptions[] = {\n"); - printer->Indent(); - for (const auto& generator : extension_generators_) { - generator->GenerateStaticVariablesInitialization(printer); - } - for (const auto& generator : message_generators_) { - generator->GenerateStaticVariablesInitialization(printer); - } - printer->Outdent(); - printer->Print( - "};\n" - "for (size_t i = 0; i < sizeof(descriptions) / sizeof(descriptions[0]); ++i) {\n" - " GPBExtensionDescriptor *extension =\n" - " [[GPBExtensionDescriptor alloc] initWithExtensionDescription:&descriptions[i]\n" - " usesClassRefs:YES];\n" - " [registry addExtension:extension];\n" - " [self globallyRegisterExtension:extension];\n" - " [extension release];\n" - "}\n"); - } - - if (deps_with_extensions.empty()) { - printer->Print( - "// None of the imports (direct or indirect) defined extensions, so no need to add\n" - "// them to this registry.\n"); - } else { - printer->Print( - "// Merge in the imports (direct or indirect) that defined extensions.\n"); - for (std::vector::iterator iter = - deps_with_extensions.begin(); - iter != deps_with_extensions.end(); ++iter) { - const std::string root_class_name(FileClassName((*iter))); - printer->Print( - "[registry addExtensions:[$dependency$ extensionRegistry]];\n", - "dependency", root_class_name); - } - } - - printer->Outdent(); - printer->Outdent(); - - printer->Print( - " }\n" - " return registry;\n" - "}\n"); - } else { - if (file_->dependency_count() > 0) { - printer->Print( - "// No extensions in the file and none of the imports (direct or indirect)\n" - "// defined extensions, so no need to generate +extensionRegistry.\n"); - } else { - printer->Print( - "// No extensions in the file and no imports, so no need to generate\n" - "// +extensionRegistry.\n"); - } - } - - printer->Print("\n@end\n\n"); - - // File descriptor only needed if there are messages to use it. - if (!message_generators_.empty()) { - std::map vars; - vars["root_class_name"] = root_class_name_; - vars["package"] = file_->package(); - vars["objc_prefix"] = FileClassPrefix(file_); - switch (file_->syntax()) { - case FileDescriptor::SYNTAX_UNKNOWN: - vars["syntax"] = "GPBFileSyntaxUnknown"; - break; - case FileDescriptor::SYNTAX_PROTO2: - vars["syntax"] = "GPBFileSyntaxProto2"; - break; - case FileDescriptor::SYNTAX_PROTO3: - vars["syntax"] = "GPBFileSyntaxProto3"; - break; - } - printer->Print(vars, - "#pragma mark - $root_class_name$_FileDescriptor\n" - "\n" - "static GPBFileDescriptor *$root_class_name$_FileDescriptor(void) {\n" - " // This is called by +initialize so there is no need to worry\n" - " // about thread safety of the singleton.\n" - " static GPBFileDescriptor *descriptor = NULL;\n" - " if (!descriptor) {\n" - " GPB_DEBUG_CHECK_RUNTIME_VERSIONS();\n"); - if (!vars["objc_prefix"].empty()) { - printer->Print( - vars, - " descriptor = [[GPBFileDescriptor alloc] initWithPackage:@\"$package$\"\n" - " objcPrefix:@\"$objc_prefix$\"\n" - " syntax:$syntax$];\n"); - } else { - printer->Print( - vars, - " descriptor = [[GPBFileDescriptor alloc] initWithPackage:@\"$package$\"\n" - " syntax:$syntax$];\n"); - } - printer->Print( - " }\n" - " return descriptor;\n" - "}\n" - "\n"); - } - - for (const auto& generator : enum_generators_) { - generator->GenerateSource(printer); - } - for (const auto& generator : message_generators_) { - generator->GenerateSource(printer); - } - - printer->Print( - "\n" - "#pragma clang diagnostic pop\n" - "\n" - "// @@protoc_insertion_point(global_scope)\n"); -} - -// Helper to print the import of the runtime support at the top of generated -// files. This currently only supports the runtime coming from a framework -// as defined by the official CocoaPod. -void FileGenerator::PrintFileRuntimePreamble( - io::Printer* printer, - const std::vector& headers_to_import) const { - printer->Print( - "// Generated by the protocol buffer compiler. DO NOT EDIT!\n" - "// source: $filename$\n" - "\n", - "filename", file_->name()); - ImportWriter::PrintRuntimeImports( - printer, headers_to_import, options_.runtime_import_prefix, true); - printer->Print("\n"); -} - -} // namespace objectivec -} // namespace compiler -} // namespace protobuf -} // namespace google diff --git a/extra/protobuf/protobuf-3.19.4/src/google/protobuf/compiler/objectivec/objectivec_file.h b/extra/protobuf/protobuf-3.19.4/src/google/protobuf/compiler/objectivec/objectivec_file.h deleted file mode 100644 index 87258a39fe06..000000000000 --- a/extra/protobuf/protobuf-3.19.4/src/google/protobuf/compiler/objectivec/objectivec_file.h +++ /dev/null @@ -1,82 +0,0 @@ -// Protocol Buffers - Google's data interchange format -// Copyright 2008 Google Inc. All rights reserved. -// https://developers.google.com/protocol-buffers/ -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// * Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// * Redistributions in binary form must reproduce the above -// copyright notice, this list of conditions and the following disclaimer -// in the documentation and/or other materials provided with the -// distribution. -// * Neither the name of Google Inc. nor the names of its -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -#ifndef GOOGLE_PROTOBUF_COMPILER_OBJECTIVEC_FILE_H__ -#define GOOGLE_PROTOBUF_COMPILER_OBJECTIVEC_FILE_H__ - -#include -#include -#include -#include -#include -#include - -namespace google { -namespace protobuf { -namespace compiler { -namespace objectivec { - -class EnumGenerator; -class ExtensionGenerator; -class MessageGenerator; - -class FileGenerator { - public: - FileGenerator(const FileDescriptor* file, const Options& options); - ~FileGenerator(); - - FileGenerator(const FileGenerator&) = delete; - FileGenerator& operator=(const FileGenerator&) = delete; - - void GenerateSource(io::Printer* printer); - void GenerateHeader(io::Printer* printer); - - private: - const FileDescriptor* file_; - std::string root_class_name_; - bool is_bundled_proto_; - - std::vector> enum_generators_; - std::vector> message_generators_; - std::vector> extension_generators_; - - const Options options_; - - void PrintFileRuntimePreamble( - io::Printer* printer, - const std::vector& headers_to_import) const; -}; - -} // namespace objectivec -} // namespace compiler -} // namespace protobuf -} // namespace google - -#endif // GOOGLE_PROTOBUF_COMPILER_OBJECTIVEC_FILE_H__ diff --git a/extra/protobuf/protobuf-3.19.4/src/google/protobuf/compiler/objectivec/objectivec_generator.cc b/extra/protobuf/protobuf-3.19.4/src/google/protobuf/compiler/objectivec/objectivec_generator.cc deleted file mode 100644 index a03b8604fca1..000000000000 --- a/extra/protobuf/protobuf-3.19.4/src/google/protobuf/compiler/objectivec/objectivec_generator.cc +++ /dev/null @@ -1,276 +0,0 @@ -// Protocol Buffers - Google's data interchange format -// Copyright 2008 Google Inc. All rights reserved. -// https://developers.google.com/protocol-buffers/ -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// * Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// * Redistributions in binary form must reproduce the above -// copyright notice, this list of conditions and the following disclaimer -// in the documentation and/or other materials provided with the -// distribution. -// * Neither the name of Google Inc. nor the names of its -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -namespace google { -namespace protobuf { -namespace compiler { -namespace objectivec { - -namespace { - -// Convert a string with "yes"/"no" (case insensitive) to a boolean, returning -// true/false for if the input string was a valid value. If the input string is -// invalid, `result` is unchanged. -bool StringToBool(const std::string& value, bool* result) { - std::string upper_value(value); - UpperString(&upper_value); - if (upper_value == "NO") { - *result = false; - return true; - } - if (upper_value == "YES") { - *result = true; - return true; - } - - return false; -} - -} // namespace - -ObjectiveCGenerator::ObjectiveCGenerator() {} - -ObjectiveCGenerator::~ObjectiveCGenerator() {} - -bool ObjectiveCGenerator::HasGenerateAll() const { - return true; -} - -bool ObjectiveCGenerator::Generate(const FileDescriptor* file, - const std::string& parameter, - GeneratorContext* context, - std::string* error) const { - *error = "Unimplemented Generate() method. Call GenerateAll() instead."; - return false; -} - -bool ObjectiveCGenerator::GenerateAll( - const std::vector& files, - const std::string& parameter, GeneratorContext* context, - std::string* error) const { - // ----------------------------------------------------------------- - // Parse generator options. These options are passed to the compiler using the - // --objc_opt flag. The options are passed as a comma separated list of - // options along with their values. If the option appears multiple times, only - // the last value will be considered. - // - // e.g. protoc ... --objc_opt=expected_prefixes=file.txt,generate_for_named_framework=MyFramework - - Options generation_options; - - std::vector > options; - ParseGeneratorParameter(parameter, &options); - for (int i = 0; i < options.size(); i++) { - if (options[i].first == "expected_prefixes_path") { - // Path to find a file containing the expected prefixes - // (objc_class_prefix "PREFIX") for proto packages (package NAME). The - // generator will then issue warnings/errors if in the proto files being - // generated the option is not listed/wrong/etc in the file. - // - // The format of the file is: - // - An entry is a line of "package=prefix". - // - Comments start with "#". - // - A comment can go on a line after a expected package/prefix pair. - // (i.e. - "package=prefix # comment") - // - // There is no validation that the prefixes are good prefixes, it is - // assumed that they are when you create the file. - generation_options.expected_prefixes_path = options[i].second; - } else if (options[i].first == "expected_prefixes_suppressions") { - // A semicolon delimited string that lists the paths of .proto files to - // exclude from the package prefix validations (expected_prefixes_path). - // This is provided as an "out", to skip some files being checked. - for (StringPiece split_piece : Split( - options[i].second, ";", true)) { - generation_options.expected_prefixes_suppressions.push_back( - std::string(split_piece)); - } - } else if (options[i].first == "prefixes_must_be_registered") { - // If objc prefix file option value must be registered to be used. This - // option has no meaning if an "expected_prefixes_path" isn't set. The - // available options are: - // "no": They don't have to be registered. - // "yes": They must be registered and an error will be raised if a files - // tried to use a prefix that isn't registered. - // Default is "no". - if (!StringToBool(options[i].second, - &generation_options.prefixes_must_be_registered)) { - *error = "error: Unknown value for prefixes_must_be_registered: " + options[i].second; - return false; - } - } else if (options[i].first == "require_prefixes") { - // If every file must have an objc prefix file option to be used. The - // available options are: - // "no": Files can be generated without the prefix option. - // "yes": Files must have the objc prefix option, and an error will be - // raised if a files doesn't have one. - // Default is "no". - if (!StringToBool(options[i].second, - &generation_options.require_prefixes)) { - *error = "error: Unknown value for require_prefixes: " + options[i].second; - return false; - } - } else if (options[i].first == "generate_for_named_framework") { - // The name of the framework that protos are being generated for. This - // will cause the #import statements to be framework based using this - // name (i.e. - "#import ). - // - // NOTE: If this option is used with - // named_framework_to_proto_path_mappings_path, then this is effectively - // the "default" framework name used for everything that wasn't mapped by - // the mapping file. - generation_options.generate_for_named_framework = options[i].second; - } else if (options[i].first == "named_framework_to_proto_path_mappings_path") { - // Path to find a file containing the list of framework names and proto - // files. The generator uses this to decide if a proto file - // referenced should use a framework style import vs. a user level import - // (#import vs #import "dir/file.pbobjc.h"). - // - // The format of the file is: - // - An entry is a line of "frameworkName: file.proto, dir/file2.proto". - // - Comments start with "#". - // - A comment can go on a line after a expected package/prefix pair. - // (i.e. - "frameworkName: file.proto # comment") - // - // Any number of files can be listed for a framework, just separate them - // with commas. - // - // There can be multiple lines listing the same frameworkName in case it - // has a lot of proto files included in it; having multiple lines makes - // things easier to read. If a proto file is not configured in the - // mappings file, it will use the default framework name if one was passed - // with generate_for_named_framework, or the relative path to it's include - // path otherwise. - generation_options.named_framework_to_proto_path_mappings_path = options[i].second; - } else if (options[i].first == "runtime_import_prefix") { - // Path to use as a prefix on #imports of runtime provided headers in the - // generated files. When integrating ObjC protos into a build system, - // this can be used to avoid having to add the runtime directory to the - // header search path since the generate #import will be more complete. - generation_options.runtime_import_prefix = - StripSuffixString(options[i].second, "/"); - } else if (options[i].first == "use_package_as_prefix") { - // Controls how the symbols should be prefixed to avoid symbols - // collisions. The objc_class_prefix file option is always honored, this - // is just what to do if that isn't set. The available options are: - // "no": Not prefixed (the existing mode). - // "yes": Make a prefix out of the proto package. - bool value = false; - if (StringToBool(options[i].second, &value)) { - SetUseProtoPackageAsDefaultPrefix(value); - } else { - *error = "error: Unknown use_package_as_prefix: " + options[i].second; - return false; - } - } else if (options[i].first == "proto_package_prefix_exceptions_path") { - // Path to find a file containing the list of proto package names that are - // exceptions when use_package_as_prefix is enabled. This can be used to - // migrate packages one at a time to use_package_as_prefix since there - // are likely code updates needed with each one. - // - // The format of the file is: - // - An entry is a line of "proto.package.name". - // - Comments start with "#". - // - A comment can go on a line after a expected package/prefix pair. - // (i.e. - "some.proto.package # comment") - SetProtoPackagePrefixExceptionList(options[i].second); - } else { - *error = "error: Unknown generator option: " + options[i].first; - return false; - } - } - - // ----------------------------------------------------------------- - - // These are not official generation options and could be removed/changed in - // the future and doing that won't count as a breaking change. - bool headers_only = getenv("GPB_OBJC_HEADERS_ONLY") != NULL; - std::unordered_set skip_impls; - if (getenv("GPB_OBJC_SKIP_IMPLS_FILE") != NULL) { - std::ifstream skip_file(getenv("GPB_OBJC_SKIP_IMPLS_FILE")); - if (skip_file.is_open()) { - std::string line; - while (std::getline(skip_file, line)) { - skip_impls.insert(line); - } - } else { - *error = "error: Failed to open GPB_OBJC_SKIP_IMPLS_FILE file"; - return false; - } - } - - // ----------------------------------------------------------------- - - // Validate the objc prefix/package pairings. - if (!ValidateObjCClassPrefixes(files, generation_options, error)) { - // *error will have been filled in. - return false; - } - - for (int i = 0; i < files.size(); i++) { - const FileDescriptor* file = files[i]; - FileGenerator file_generator(file, generation_options); - std::string filepath = FilePath(file); - - // Generate header. - { - std::unique_ptr output( - context->Open(filepath + ".pbobjc.h")); - io::Printer printer(output.get(), '$'); - file_generator.GenerateHeader(&printer); - } - - // Generate m file. - if (!headers_only && skip_impls.count(file->name()) == 0) { - std::unique_ptr output( - context->Open(filepath + ".pbobjc.m")); - io::Printer printer(output.get(), '$'); - file_generator.GenerateSource(&printer); - } - } - - return true; -} - -} // namespace objectivec -} // namespace compiler -} // namespace protobuf -} // namespace google diff --git a/extra/protobuf/protobuf-3.19.4/src/google/protobuf/compiler/objectivec/objectivec_generator.h b/extra/protobuf/protobuf-3.19.4/src/google/protobuf/compiler/objectivec/objectivec_generator.h deleted file mode 100644 index 1dbc666af16f..000000000000 --- a/extra/protobuf/protobuf-3.19.4/src/google/protobuf/compiler/objectivec/objectivec_generator.h +++ /dev/null @@ -1,79 +0,0 @@ -// Protocol Buffers - Google's data interchange format -// Copyright 2008 Google Inc. All rights reserved. -// https://developers.google.com/protocol-buffers/ -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// * Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// * Redistributions in binary form must reproduce the above -// copyright notice, this list of conditions and the following disclaimer -// in the documentation and/or other materials provided with the -// distribution. -// * Neither the name of Google Inc. nor the names of its -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -// Generates ObjectiveC code for a given .proto file. - -#ifndef GOOGLE_PROTOBUF_COMPILER_OBJECTIVEC_GENERATOR_H__ -#define GOOGLE_PROTOBUF_COMPILER_OBJECTIVEC_GENERATOR_H__ - -#include -#include -#include - -#include - -namespace google { -namespace protobuf { -namespace compiler { -namespace objectivec { - -// CodeGenerator implementation which generates a ObjectiveC source file and -// header. If you create your own protocol compiler binary and you want it to -// support ObjectiveC output, you can do so by registering an instance of this -// CodeGenerator with the CommandLineInterface in your main() function. -class PROTOC_EXPORT ObjectiveCGenerator : public CodeGenerator { - public: - ObjectiveCGenerator(); - ~ObjectiveCGenerator(); - - ObjectiveCGenerator(const ObjectiveCGenerator&) = delete; - ObjectiveCGenerator& operator=(const ObjectiveCGenerator&) = delete; - - // implements CodeGenerator ---------------------------------------- - bool HasGenerateAll() const override; - bool Generate(const FileDescriptor* file, const std::string& parameter, - GeneratorContext* context, std::string* error) const override; - bool GenerateAll(const std::vector& files, - const std::string& parameter, GeneratorContext* context, - std::string* error) const override; - - uint64_t GetSupportedFeatures() const override { - return FEATURE_PROTO3_OPTIONAL; - } -}; - -} // namespace objectivec -} // namespace compiler -} // namespace protobuf -} // namespace google - -#include - -#endif // GOOGLE_PROTOBUF_COMPILER_OBJECTIVEC_GENERATOR_H__ diff --git a/extra/protobuf/protobuf-3.19.4/src/google/protobuf/compiler/objectivec/objectivec_helpers.cc b/extra/protobuf/protobuf-3.19.4/src/google/protobuf/compiler/objectivec/objectivec_helpers.cc deleted file mode 100644 index 5f4b7f60fa25..000000000000 --- a/extra/protobuf/protobuf-3.19.4/src/google/protobuf/compiler/objectivec/objectivec_helpers.cc +++ /dev/null @@ -1,1960 +0,0 @@ -// Protocol Buffers - Google's data interchange format -// Copyright 2008 Google Inc. All rights reserved. -// https://developers.google.com/protocol-buffers/ -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// * Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// * Redistributions in binary form must reproduce the above -// copyright notice, this list of conditions and the following disclaimer -// in the documentation and/or other materials provided with the -// distribution. -// * Neither the name of Google Inc. nor the names of its -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -#ifndef _MSC_VER -#include -#endif -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -// NOTE: src/google/protobuf/compiler/plugin.cc makes use of cerr for some -// error cases, so it seems to be ok to use as a back door for errors. - -namespace google { -namespace protobuf { -namespace compiler { -namespace objectivec { - -// is transitively included in this file. Import the functions explicitly -// in this port namespace to avoid ambiguous definition. -namespace posix { -#ifdef _WIN32 -using ::google::protobuf::io::win32::open; -#else -using ::open; -#endif -} // namespace port - -namespace { - -class SimpleLineCollector : public LineConsumer { - public: - SimpleLineCollector(std::unordered_set* inout_set) - : set_(inout_set) {} - - virtual bool ConsumeLine(const StringPiece& line, std::string* out_error) override { - set_->insert(std::string(line)); - return true; - } - - private: - std::unordered_set* set_; -}; - -class PrefixModeStorage { - public: - PrefixModeStorage(); - - bool use_package_name() const { return use_package_name_; } - void set_use_package_name(bool on_or_off) { use_package_name_ = on_or_off; } - - const std::string exception_path() const { return exception_path_; } - void set_exception_path(const std::string& path) { - exception_path_ = path; - exceptions_.clear(); - } - - bool is_package_exempted(const std::string& package); - - private: - bool use_package_name_; - std::string exception_path_; - std::unordered_set exceptions_; -}; - -PrefixModeStorage::PrefixModeStorage() { - // Even thought there are generation options, have an env back door since some - // of these helpers could be used in other plugins. - - const char* use_package_cstr = getenv("GPB_OBJC_USE_PACKAGE_AS_PREFIX"); - use_package_name_ = - (use_package_cstr && (std::string("YES") == ToUpper(use_package_cstr))); - - const char* exception_path = getenv("GPB_OBJC_PACKAGE_PREFIX_EXCEPTIONS_PATH"); - if (exception_path) { - exception_path_ = exception_path; - } -} - -bool PrefixModeStorage::is_package_exempted(const std::string& package) { - if (exceptions_.empty() && !exception_path_.empty()) { - std::string error_str; - SimpleLineCollector collector(&exceptions_); - if (!ParseSimpleFile(exception_path_, &collector, &error_str)) { - if (error_str.empty()) { - error_str = std::string("protoc:0: warning: Failed to parse") - + std::string(" package prefix exceptions file: ") - + exception_path_; - } - std::cerr << error_str << std::endl; - std::cerr.flush(); - exceptions_.clear(); - } - - // If the file was empty put something in it so it doesn't get reloaded over - // and over. - if (exceptions_.empty()) { - exceptions_.insert(""); - } - } - - return exceptions_.count(package) != 0; -} - -PrefixModeStorage g_prefix_mode; - -} // namespace - -bool UseProtoPackageAsDefaultPrefix() { - return g_prefix_mode.use_package_name(); -} - -void SetUseProtoPackageAsDefaultPrefix(bool on_or_off) { - g_prefix_mode.set_use_package_name(on_or_off); -} - -std::string GetProtoPackagePrefixExceptionList() { - return g_prefix_mode.exception_path(); -} - -void SetProtoPackagePrefixExceptionList(const std::string& file_path) { - g_prefix_mode.set_exception_path(file_path); -} - -Options::Options() { - // Default is the value of the env for the package prefixes. - const char* file_path = getenv("GPB_OBJC_EXPECTED_PACKAGE_PREFIXES"); - if (file_path) { - expected_prefixes_path = file_path; - } - const char* suppressions = getenv("GPB_OBJC_EXPECTED_PACKAGE_PREFIXES_SUPPRESSIONS"); - if (suppressions) { - expected_prefixes_suppressions = - Split(suppressions, ";", true); - } - prefixes_must_be_registered = false; - require_prefixes = false; -} - -namespace { - -std::unordered_set MakeWordsMap(const char* const words[], - size_t num_words) { - std::unordered_set result; - for (int i = 0; i < num_words; i++) { - result.insert(words[i]); - } - return result; -} - -const char* const kUpperSegmentsList[] = {"url", "http", "https"}; - -std::unordered_set kUpperSegments = - MakeWordsMap(kUpperSegmentsList, GOOGLE_ARRAYSIZE(kUpperSegmentsList)); - -bool ascii_isnewline(char c) { - return c == '\n' || c == '\r'; -} - -// Internal helper for name handing. -// Do not expose this outside of helpers, stick to having functions for specific -// cases (ClassName(), FieldName()), so there is always consistent suffix rules. -std::string UnderscoresToCamelCase(const std::string& input, - bool first_capitalized) { - std::vector values; - std::string current; - - bool last_char_was_number = false; - bool last_char_was_lower = false; - bool last_char_was_upper = false; - for (int i = 0; i < input.size(); i++) { - char c = input[i]; - if (ascii_isdigit(c)) { - if (!last_char_was_number) { - values.push_back(current); - current = ""; - } - current += c; - last_char_was_number = last_char_was_lower = last_char_was_upper = false; - last_char_was_number = true; - } else if (ascii_islower(c)) { - // lowercase letter can follow a lowercase or uppercase letter - if (!last_char_was_lower && !last_char_was_upper) { - values.push_back(current); - current = ""; - } - current += c; // already lower - last_char_was_number = last_char_was_lower = last_char_was_upper = false; - last_char_was_lower = true; - } else if (ascii_isupper(c)) { - if (!last_char_was_upper) { - values.push_back(current); - current = ""; - } - current += ascii_tolower(c); - last_char_was_number = last_char_was_lower = last_char_was_upper = false; - last_char_was_upper = true; - } else { - last_char_was_number = last_char_was_lower = last_char_was_upper = false; - } - } - values.push_back(current); - - std::string result; - bool first_segment_forces_upper = false; - for (std::vector::iterator i = values.begin(); i != values.end(); - ++i) { - std::string value = *i; - bool all_upper = (kUpperSegments.count(value) > 0); - if (all_upper && (result.length() == 0)) { - first_segment_forces_upper = true; - } - for (int j = 0; j < value.length(); j++) { - if (j == 0 || all_upper) { - value[j] = ascii_toupper(value[j]); - } else { - // Nothing, already in lower. - } - } - result += value; - } - if ((result.length() != 0) && - !first_capitalized && - !first_segment_forces_upper) { - result[0] = ascii_tolower(result[0]); - } - return result; -} - -const char* const kReservedWordList[] = { - // Note NSObject Methods: - // These are brought in from objectivec_nsobject_methods.h that is generated - // using method_dump.sh. See kNSObjectMethods below. - - // Objective C "keywords" that aren't in C - // From - // http://stackoverflow.com/questions/1873630/reserved-keywords-in-objective-c - // with some others added on. - "id", "_cmd", "super", "in", "out", "inout", "bycopy", "byref", "oneway", - "self", "instancetype", "nullable", "nonnull", "nil", "Nil", - "YES", "NO", "weak", - - // C/C++ keywords (Incl C++ 0x11) - // From http://en.cppreference.com/w/cpp/keywords - "and", "and_eq", "alignas", "alignof", "asm", "auto", "bitand", "bitor", - "bool", "break", "case", "catch", "char", "char16_t", "char32_t", "class", - "compl", "const", "constexpr", "const_cast", "continue", "decltype", - "default", "delete", "double", "dynamic_cast", "else", "enum", "explicit", - "export", "extern ", "false", "float", "for", "friend", "goto", "if", - "inline", "int", "long", "mutable", "namespace", "new", "noexcept", "not", - "not_eq", "nullptr", "operator", "or", "or_eq", "private", "protected", - "public", "register", "reinterpret_cast", "return", "short", "signed", - "sizeof", "static", "static_assert", "static_cast", "struct", "switch", - "template", "this", "thread_local", "throw", "true", "try", "typedef", - "typeid", "typename", "union", "unsigned", "using", "virtual", "void", - "volatile", "wchar_t", "while", "xor", "xor_eq", - - // C99 keywords - // From - // http://publib.boulder.ibm.com/infocenter/lnxpcomp/v8v101/index.jsp?topic=%2Fcom.ibm.xlcpp8l.doc%2Flanguage%2Fref%2Fkeyw.htm - "restrict", - - // GCC/Clang extension - "typeof", - - // Not a keyword, but will break you - "NULL", - - // C88+ specs call for these to be macros, so depending on what they are - // defined to be it can lead to odd errors for some Xcode/SDK versions. - "stdin", "stdout", "stderr", - - // Objective-C Runtime typedefs - // From - "Category", "Ivar", "Method", "Protocol", - - // GPBMessage Methods - // Only need to add instance methods that may conflict with - // method declared in protos. The main cases are methods - // that take no arguments, or setFoo:/hasFoo: type methods. - "clear", "data", "delimitedData", "descriptor", "extensionRegistry", - "extensionsCurrentlySet", "initialized", "isInitialized", "serializedSize", - "sortedExtensionsInUse", "unknownFields", - - // MacTypes.h names - "Fixed", "Fract", "Size", "LogicalAddress", "PhysicalAddress", "ByteCount", - "ByteOffset", "Duration", "AbsoluteTime", "OptionBits", "ItemCount", - "PBVersion", "ScriptCode", "LangCode", "RegionCode", "OSType", - "ProcessSerialNumber", "Point", "Rect", "FixedPoint", "FixedRect", "Style", - "StyleParameter", "StyleField", "TimeScale", "TimeBase", "TimeRecord", -}; - -// returns true is input starts with __ or _[A-Z] which are reserved identifiers -// in C/ C++. All calls should go through UnderscoresToCamelCase before getting here -// but this verifies and allows for future expansion if we decide to redefine what a -// reserved C identifier is (for example the GNU list -// https://www.gnu.org/software/libc/manual/html_node/Reserved-Names.html ) -bool IsReservedCIdentifier(const std::string& input) { - if (input.length() > 2) { - if (input.at(0) == '_') { - if (isupper(input.at(1)) || input.at(1) == '_') { - return true; - } - } - } - return false; -} - -std::string SanitizeNameForObjC(const std::string& prefix, - const std::string& input, - const std::string& extension, - std::string* out_suffix_added) { - static const std::unordered_set kReservedWords = - MakeWordsMap(kReservedWordList, GOOGLE_ARRAYSIZE(kReservedWordList)); - static const std::unordered_set kNSObjectMethods = - MakeWordsMap(kNSObjectMethodsList, GOOGLE_ARRAYSIZE(kNSObjectMethodsList)); - std::string sanitized; - // We add the prefix in the cases where the string is missing a prefix. - // We define "missing a prefix" as where 'input': - // a) Doesn't start with the prefix or - // b) Isn't equivalent to the prefix or - // c) Has the prefix, but the letter after the prefix is lowercase - if (HasPrefixString(input, prefix)) { - if (input.length() == prefix.length() || !ascii_isupper(input[prefix.length()])) { - sanitized = prefix + input; - } else { - sanitized = input; - } - } else { - sanitized = prefix + input; - } - if (IsReservedCIdentifier(sanitized) || - (kReservedWords.count(sanitized) > 0) || - (kNSObjectMethods.count(sanitized) > 0)) { - if (out_suffix_added) *out_suffix_added = extension; - return sanitized + extension; - } - if (out_suffix_added) out_suffix_added->clear(); - return sanitized; -} - -std::string NameFromFieldDescriptor(const FieldDescriptor* field) { - if (field->type() == FieldDescriptor::TYPE_GROUP) { - return field->message_type()->name(); - } else { - return field->name(); - } -} - -void PathSplit(const std::string& path, std::string* directory, - std::string* basename) { - std::string::size_type last_slash = path.rfind('/'); - if (last_slash == std::string::npos) { - if (directory) { - *directory = ""; - } - if (basename) { - *basename = path; - } - } else { - if (directory) { - *directory = path.substr(0, last_slash); - } - if (basename) { - *basename = path.substr(last_slash + 1); - } - } -} - -bool IsSpecialName(const std::string& name, const std::string* special_names, - size_t count) { - for (size_t i = 0; i < count; ++i) { - size_t length = special_names[i].length(); - if (name.compare(0, length, special_names[i]) == 0) { - if (name.length() > length) { - // If name is longer than the retained_name[i] that it matches - // the next character must be not lower case (newton vs newTon vs - // new_ton). - return !ascii_islower(name[length]); - } else { - return true; - } - } - } - return false; -} - -std::string GetZeroEnumNameForFlagType(const FlagType flag_type) { - switch(flag_type) { - case FLAGTYPE_DESCRIPTOR_INITIALIZATION: - return "GPBDescriptorInitializationFlag_None"; - case FLAGTYPE_EXTENSION: - return "GPBExtensionNone"; - case FLAGTYPE_FIELD: - return "GPBFieldNone"; - default: - GOOGLE_LOG(FATAL) << "Can't get here."; - return "0"; - } -} - -std::string GetEnumNameForFlagType(const FlagType flag_type) { - switch(flag_type) { - case FLAGTYPE_DESCRIPTOR_INITIALIZATION: - return "GPBDescriptorInitializationFlags"; - case FLAGTYPE_EXTENSION: - return "GPBExtensionOptions"; - case FLAGTYPE_FIELD: - return "GPBFieldFlags"; - default: - GOOGLE_LOG(FATAL) << "Can't get here."; - return std::string(); - } -} - -void MaybeUnQuote(StringPiece* input) { - if ((input->length() >= 2) && - ((*input->data() == '\'' || *input->data() == '"')) && - ((*input)[input->length() - 1] == *input->data())) { - input->remove_prefix(1); - input->remove_suffix(1); - } -} - -} // namespace - -// Escape C++ trigraphs by escaping question marks to \? -std::string EscapeTrigraphs(const std::string& to_escape) { - return StringReplace(to_escape, "?", "\\?", true); -} - -void TrimWhitespace(StringPiece* input) { - while (!input->empty() && ascii_isspace(*input->data())) { - input->remove_prefix(1); - } - while (!input->empty() && ascii_isspace((*input)[input->length() - 1])) { - input->remove_suffix(1); - } -} - -bool IsRetainedName(const std::string& name) { - // List of prefixes from - // http://developer.apple.com/library/mac/#documentation/Cocoa/Conceptual/MemoryMgmt/Articles/mmRules.html - static const std::string retained_names[] = {"new", "alloc", "copy", - "mutableCopy"}; - return IsSpecialName(name, retained_names, - sizeof(retained_names) / sizeof(retained_names[0])); -} - -bool IsInitName(const std::string& name) { - static const std::string init_names[] = {"init"}; - return IsSpecialName(name, init_names, - sizeof(init_names) / sizeof(init_names[0])); -} - -std::string BaseFileName(const FileDescriptor* file) { - std::string basename; - PathSplit(file->name(), NULL, &basename); - return basename; -} - -std::string FileClassPrefix(const FileDescriptor* file) { - // Always honor the file option. - if (file->options().has_objc_class_prefix()) { - return file->options().objc_class_prefix(); - } - - // If package prefix isn't enabled or no package, done. - if (!g_prefix_mode.use_package_name() || file->package().empty()) { - return ""; - } - - // If the package is in the exceptions list, done. - if (g_prefix_mode.is_package_exempted(file->package())) { - return ""; - } - - // Transform the package into a prefix: use the dot segments as part, - // camelcase each one and then join them with underscores, and add an - // underscore at the end. - std::string result; - const std::vector segments = Split(file->package(), ".", true); - for (const auto& segment : segments) { - const std::string part = UnderscoresToCamelCase(segment, true); - if (part.empty()) { - continue; - } - if (!result.empty()) { - result.append("_"); - } - result.append(part); - } - if (!result.empty()) { - result.append("_"); - } - return result; -} - -std::string FilePath(const FileDescriptor* file) { - std::string output; - std::string basename; - std::string directory; - PathSplit(file->name(), &directory, &basename); - if (directory.length() > 0) { - output = directory + "/"; - } - basename = StripProto(basename); - - // CamelCase to be more ObjC friendly. - basename = UnderscoresToCamelCase(basename, true); - - output += basename; - return output; -} - -std::string FilePathBasename(const FileDescriptor* file) { - std::string output; - std::string basename; - std::string directory; - PathSplit(file->name(), &directory, &basename); - basename = StripProto(basename); - - // CamelCase to be more ObjC friendly. - output = UnderscoresToCamelCase(basename, true); - - return output; -} - -std::string FileClassName(const FileDescriptor* file) { - const std::string prefix = FileClassPrefix(file); - const std::string name = - UnderscoresToCamelCase(StripProto(BaseFileName(file)), true) + "Root"; - // There aren't really any reserved words that end in "Root", but playing - // it safe and checking. - return SanitizeNameForObjC(prefix, name, "_RootClass", NULL); -} - -std::string ClassNameWorker(const Descriptor* descriptor) { - std::string name; - if (descriptor->containing_type() != NULL) { - name = ClassNameWorker(descriptor->containing_type()); - name += "_"; - } - return name + descriptor->name(); -} - -std::string ClassNameWorker(const EnumDescriptor* descriptor) { - std::string name; - if (descriptor->containing_type() != NULL) { - name = ClassNameWorker(descriptor->containing_type()); - name += "_"; - } - return name + descriptor->name(); -} - -std::string ClassName(const Descriptor* descriptor) { - return ClassName(descriptor, NULL); -} - -std::string ClassName(const Descriptor* descriptor, - std::string* out_suffix_added) { - // 1. Message names are used as is (style calls for CamelCase, trust it). - // 2. Check for reserved word at the very end and then suffix things. - const std::string prefix = FileClassPrefix(descriptor->file()); - const std::string name = ClassNameWorker(descriptor); - return SanitizeNameForObjC(prefix, name, "_Class", out_suffix_added); -} - -std::string EnumName(const EnumDescriptor* descriptor) { - // 1. Enum names are used as is (style calls for CamelCase, trust it). - // 2. Check for reserved word at the every end and then suffix things. - // message Fixed { - // message Size {...} - // enum Mumble {...} - // ... - // } - // yields Fixed_Class, Fixed_Size. - const std::string prefix = FileClassPrefix(descriptor->file()); - const std::string name = ClassNameWorker(descriptor); - return SanitizeNameForObjC(prefix, name, "_Enum", NULL); -} - -std::string EnumValueName(const EnumValueDescriptor* descriptor) { - // Because of the Switch enum compatibility, the name on the enum has to have - // the suffix handing, so it slightly diverges from how nested classes work. - // enum Fixed { - // FOO = 1 - // } - // yields Fixed_Enum and Fixed_Enum_Foo (not Fixed_Foo). - const std::string class_name = EnumName(descriptor->type()); - const std::string value_str = - UnderscoresToCamelCase(descriptor->name(), true); - const std::string name = class_name + "_" + value_str; - // There aren't really any reserved words with an underscore and a leading - // capital letter, but playing it safe and checking. - return SanitizeNameForObjC("", name, "_Value", NULL); -} - -std::string EnumValueShortName(const EnumValueDescriptor* descriptor) { - // Enum value names (EnumValueName above) are the enum name turned into - // a class name and then the value name is CamelCased and concatenated; the - // whole thing then gets sanitized for reserved words. - // The "short name" is intended to be the final leaf, the value name; but - // you can't simply send that off to sanitize as that could result in it - // getting modified when the full name didn't. For example enum - // "StorageModes" has a value "retain". So the full name is - // "StorageModes_Retain", but if we sanitize "retain" it would become - // "RetainValue". - // So the right way to get the short name is to take the full enum name - // and then strip off the enum name (leaving the value name and anything - // done by sanitize). - const std::string class_name = EnumName(descriptor->type()); - const std::string long_name_prefix = class_name + "_"; - const std::string long_name = EnumValueName(descriptor); - return StripPrefixString(long_name, long_name_prefix); -} - -std::string UnCamelCaseEnumShortName(const std::string& name) { - std::string result; - for (int i = 0; i < name.size(); i++) { - char c = name[i]; - if (i > 0 && ascii_isupper(c)) { - result += '_'; - } - result += ascii_toupper(c); - } - return result; -} - -std::string ExtensionMethodName(const FieldDescriptor* descriptor) { - const std::string name = NameFromFieldDescriptor(descriptor); - const std::string result = UnderscoresToCamelCase(name, false); - return SanitizeNameForObjC("", result, "_Extension", NULL); -} - -std::string FieldName(const FieldDescriptor* field) { - const std::string name = NameFromFieldDescriptor(field); - std::string result = UnderscoresToCamelCase(name, false); - if (field->is_repeated() && !field->is_map()) { - // Add "Array" before do check for reserved worlds. - result += "Array"; - } else { - // If it wasn't repeated, but ends in "Array", force on the _p suffix. - if (HasSuffixString(result, "Array")) { - result += "_p"; - } - } - return SanitizeNameForObjC("", result, "_p", NULL); -} - -std::string FieldNameCapitalized(const FieldDescriptor* field) { - // Want the same suffix handling, so upcase the first letter of the other - // name. - std::string result = FieldName(field); - if (result.length() > 0) { - result[0] = ascii_toupper(result[0]); - } - return result; -} - -std::string OneofEnumName(const OneofDescriptor* descriptor) { - const Descriptor* fieldDescriptor = descriptor->containing_type(); - std::string name = ClassName(fieldDescriptor); - name += "_" + UnderscoresToCamelCase(descriptor->name(), true) + "_OneOfCase"; - // No sanitize needed because the OS never has names that end in _OneOfCase. - return name; -} - -std::string OneofName(const OneofDescriptor* descriptor) { - std::string name = UnderscoresToCamelCase(descriptor->name(), false); - // No sanitize needed because it gets OneOfCase added and that shouldn't - // ever conflict. - return name; -} - -std::string OneofNameCapitalized(const OneofDescriptor* descriptor) { - // Use the common handling and then up-case the first letter. - std::string result = OneofName(descriptor); - if (result.length() > 0) { - result[0] = ascii_toupper(result[0]); - } - return result; -} - -std::string ObjCClass(const std::string& class_name) { - return std::string("GPBObjCClass(") + class_name + ")"; -} - -std::string ObjCClassDeclaration(const std::string& class_name) { - return std::string("GPBObjCClassDeclaration(") + class_name + ");"; -} - -std::string UnCamelCaseFieldName(const std::string& name, const FieldDescriptor* field) { - std::string worker(name); - if (HasSuffixString(worker, "_p")) { - worker = StripSuffixString(worker, "_p"); - } - if (field->is_repeated() && HasSuffixString(worker, "Array")) { - worker = StripSuffixString(worker, "Array"); - } - if (field->type() == FieldDescriptor::TYPE_GROUP) { - if (worker.length() > 0) { - if (ascii_islower(worker[0])) { - worker[0] = ascii_toupper(worker[0]); - } - } - return worker; - } else { - std::string result; - for (int i = 0; i < worker.size(); i++) { - char c = worker[i]; - if (ascii_isupper(c)) { - if (i > 0) { - result += '_'; - } - result += ascii_tolower(c); - } else { - result += c; - } - } - return result; - } -} - -std::string GetCapitalizedType(const FieldDescriptor* field) { - switch (field->type()) { - case FieldDescriptor::TYPE_INT32: - return "Int32"; - case FieldDescriptor::TYPE_UINT32: - return "UInt32"; - case FieldDescriptor::TYPE_SINT32: - return "SInt32"; - case FieldDescriptor::TYPE_FIXED32: - return "Fixed32"; - case FieldDescriptor::TYPE_SFIXED32: - return "SFixed32"; - case FieldDescriptor::TYPE_INT64: - return "Int64"; - case FieldDescriptor::TYPE_UINT64: - return "UInt64"; - case FieldDescriptor::TYPE_SINT64: - return "SInt64"; - case FieldDescriptor::TYPE_FIXED64: - return "Fixed64"; - case FieldDescriptor::TYPE_SFIXED64: - return "SFixed64"; - case FieldDescriptor::TYPE_FLOAT: - return "Float"; - case FieldDescriptor::TYPE_DOUBLE: - return "Double"; - case FieldDescriptor::TYPE_BOOL: - return "Bool"; - case FieldDescriptor::TYPE_STRING: - return "String"; - case FieldDescriptor::TYPE_BYTES: - return "Bytes"; - case FieldDescriptor::TYPE_ENUM: - return "Enum"; - case FieldDescriptor::TYPE_GROUP: - return "Group"; - case FieldDescriptor::TYPE_MESSAGE: - return "Message"; - } - - // Some compilers report reaching end of function even though all cases of - // the enum are handed in the switch. - GOOGLE_LOG(FATAL) << "Can't get here."; - return std::string(); -} - -ObjectiveCType GetObjectiveCType(FieldDescriptor::Type field_type) { - switch (field_type) { - case FieldDescriptor::TYPE_INT32: - case FieldDescriptor::TYPE_SINT32: - case FieldDescriptor::TYPE_SFIXED32: - return OBJECTIVECTYPE_INT32; - - case FieldDescriptor::TYPE_UINT32: - case FieldDescriptor::TYPE_FIXED32: - return OBJECTIVECTYPE_UINT32; - - case FieldDescriptor::TYPE_INT64: - case FieldDescriptor::TYPE_SINT64: - case FieldDescriptor::TYPE_SFIXED64: - return OBJECTIVECTYPE_INT64; - - case FieldDescriptor::TYPE_UINT64: - case FieldDescriptor::TYPE_FIXED64: - return OBJECTIVECTYPE_UINT64; - - case FieldDescriptor::TYPE_FLOAT: - return OBJECTIVECTYPE_FLOAT; - - case FieldDescriptor::TYPE_DOUBLE: - return OBJECTIVECTYPE_DOUBLE; - - case FieldDescriptor::TYPE_BOOL: - return OBJECTIVECTYPE_BOOLEAN; - - case FieldDescriptor::TYPE_STRING: - return OBJECTIVECTYPE_STRING; - - case FieldDescriptor::TYPE_BYTES: - return OBJECTIVECTYPE_DATA; - - case FieldDescriptor::TYPE_ENUM: - return OBJECTIVECTYPE_ENUM; - - case FieldDescriptor::TYPE_GROUP: - case FieldDescriptor::TYPE_MESSAGE: - return OBJECTIVECTYPE_MESSAGE; - } - - // Some compilers report reaching end of function even though all cases of - // the enum are handed in the switch. - GOOGLE_LOG(FATAL) << "Can't get here."; - return OBJECTIVECTYPE_INT32; -} - -bool IsPrimitiveType(const FieldDescriptor* field) { - ObjectiveCType type = GetObjectiveCType(field); - switch (type) { - case OBJECTIVECTYPE_INT32: - case OBJECTIVECTYPE_UINT32: - case OBJECTIVECTYPE_INT64: - case OBJECTIVECTYPE_UINT64: - case OBJECTIVECTYPE_FLOAT: - case OBJECTIVECTYPE_DOUBLE: - case OBJECTIVECTYPE_BOOLEAN: - case OBJECTIVECTYPE_ENUM: - return true; - break; - default: - return false; - } -} - -bool IsReferenceType(const FieldDescriptor* field) { - return !IsPrimitiveType(field); -} - -static std::string HandleExtremeFloatingPoint(std::string val, - bool add_float_suffix) { - if (val == "nan") { - return "NAN"; - } else if (val == "inf") { - return "INFINITY"; - } else if (val == "-inf") { - return "-INFINITY"; - } else { - // float strings with ., e or E need to have f appended - if (add_float_suffix && (val.find(".") != std::string::npos || - val.find("e") != std::string::npos || - val.find("E") != std::string::npos)) { - val += "f"; - } - return val; - } -} - -std::string GPBGenericValueFieldName(const FieldDescriptor* field) { - // Returns the field within the GPBGenericValue union to use for the given - // field. - if (field->is_repeated()) { - return "valueMessage"; - } - switch (field->cpp_type()) { - case FieldDescriptor::CPPTYPE_INT32: - return "valueInt32"; - case FieldDescriptor::CPPTYPE_UINT32: - return "valueUInt32"; - case FieldDescriptor::CPPTYPE_INT64: - return "valueInt64"; - case FieldDescriptor::CPPTYPE_UINT64: - return "valueUInt64"; - case FieldDescriptor::CPPTYPE_FLOAT: - return "valueFloat"; - case FieldDescriptor::CPPTYPE_DOUBLE: - return "valueDouble"; - case FieldDescriptor::CPPTYPE_BOOL: - return "valueBool"; - case FieldDescriptor::CPPTYPE_STRING: - if (field->type() == FieldDescriptor::TYPE_BYTES) { - return "valueData"; - } else { - return "valueString"; - } - case FieldDescriptor::CPPTYPE_ENUM: - return "valueEnum"; - case FieldDescriptor::CPPTYPE_MESSAGE: - return "valueMessage"; - } - - // Some compilers report reaching end of function even though all cases of - // the enum are handed in the switch. - GOOGLE_LOG(FATAL) << "Can't get here."; - return std::string(); -} - - -std::string DefaultValue(const FieldDescriptor* field) { - // Repeated fields don't have defaults. - if (field->is_repeated()) { - return "nil"; - } - - // Switch on cpp_type since we need to know which default_value_* method - // of FieldDescriptor to call. - switch (field->cpp_type()) { - case FieldDescriptor::CPPTYPE_INT32: - // gcc and llvm reject the decimal form of kint32min and kint64min. - if (field->default_value_int32() == INT_MIN) { - return "-0x80000000"; - } - return StrCat(field->default_value_int32()); - case FieldDescriptor::CPPTYPE_UINT32: - return StrCat(field->default_value_uint32()) + "U"; - case FieldDescriptor::CPPTYPE_INT64: - // gcc and llvm reject the decimal form of kint32min and kint64min. - if (field->default_value_int64() == LLONG_MIN) { - return "-0x8000000000000000LL"; - } - return StrCat(field->default_value_int64()) + "LL"; - case FieldDescriptor::CPPTYPE_UINT64: - return StrCat(field->default_value_uint64()) + "ULL"; - case FieldDescriptor::CPPTYPE_DOUBLE: - return HandleExtremeFloatingPoint( - SimpleDtoa(field->default_value_double()), false); - case FieldDescriptor::CPPTYPE_FLOAT: - return HandleExtremeFloatingPoint( - SimpleFtoa(field->default_value_float()), true); - case FieldDescriptor::CPPTYPE_BOOL: - return field->default_value_bool() ? "YES" : "NO"; - case FieldDescriptor::CPPTYPE_STRING: { - const bool has_default_value = field->has_default_value(); - const std::string& default_string = field->default_value_string(); - if (!has_default_value || default_string.length() == 0) { - // If the field is defined as being the empty string, - // then we will just assign to nil, as the empty string is the - // default for both strings and data. - return "nil"; - } - if (field->type() == FieldDescriptor::TYPE_BYTES) { - // We want constant fields in our data structures so we can - // declare them as static. To achieve this we cheat and stuff - // a escaped c string (prefixed with a length) into the data - // field, and cast it to an (NSData*) so it will compile. - // The runtime library knows how to handle it. - - // Must convert to a standard byte order for packing length into - // a cstring. - uint32_t length = ghtonl(default_string.length()); - std::string bytes((const char*)&length, sizeof(length)); - bytes.append(default_string); - return "(NSData*)\"" + EscapeTrigraphs(CEscape(bytes)) + "\""; - } else { - return "@\"" + EscapeTrigraphs(CEscape(default_string)) + "\""; - } - } - case FieldDescriptor::CPPTYPE_ENUM: - return EnumValueName(field->default_value_enum()); - case FieldDescriptor::CPPTYPE_MESSAGE: - return "nil"; - } - - // Some compilers report reaching end of function even though all cases of - // the enum are handed in the switch. - GOOGLE_LOG(FATAL) << "Can't get here."; - return std::string(); -} - -bool HasNonZeroDefaultValue(const FieldDescriptor* field) { - // Repeated fields don't have defaults. - if (field->is_repeated()) { - return false; - } - - // As much as checking field->has_default_value() seems useful, it isn't - // because of enums. proto2 syntax allows the first item in an enum (the - // default) to be non zero. So checking field->has_default_value() would - // result in missing this non zero default. See MessageWithOneBasedEnum in - // objectivec/Tests/unittest_objc.proto for a test Message to confirm this. - - // Some proto file set the default to the zero value, so make sure the value - // isn't the zero case. - switch (field->cpp_type()) { - case FieldDescriptor::CPPTYPE_INT32: - return field->default_value_int32() != 0; - case FieldDescriptor::CPPTYPE_UINT32: - return field->default_value_uint32() != 0U; - case FieldDescriptor::CPPTYPE_INT64: - return field->default_value_int64() != 0LL; - case FieldDescriptor::CPPTYPE_UINT64: - return field->default_value_uint64() != 0ULL; - case FieldDescriptor::CPPTYPE_DOUBLE: - return field->default_value_double() != 0.0; - case FieldDescriptor::CPPTYPE_FLOAT: - return field->default_value_float() != 0.0f; - case FieldDescriptor::CPPTYPE_BOOL: - return field->default_value_bool(); - case FieldDescriptor::CPPTYPE_STRING: { - const std::string& default_string = field->default_value_string(); - return default_string.length() != 0; - } - case FieldDescriptor::CPPTYPE_ENUM: - return field->default_value_enum()->number() != 0; - case FieldDescriptor::CPPTYPE_MESSAGE: - return false; - } - - // Some compilers report reaching end of function even though all cases of - // the enum are handed in the switch. - GOOGLE_LOG(FATAL) << "Can't get here."; - return false; -} - -std::string BuildFlagsString(const FlagType flag_type, - const std::vector& strings) { - if (strings.empty()) { - return GetZeroEnumNameForFlagType(flag_type); - } else if (strings.size() == 1) { - return strings[0]; - } - std::string string("(" + GetEnumNameForFlagType(flag_type) + ")("); - for (size_t i = 0; i != strings.size(); ++i) { - if (i > 0) { - string.append(" | "); - } - string.append(strings[i]); - } - string.append(")"); - return string; -} - -std::string BuildCommentsString(const SourceLocation& location, - bool prefer_single_line) { - const std::string& comments = location.leading_comments.empty() - ? location.trailing_comments - : location.leading_comments; - std::vector lines; - lines = Split(comments, "\n", false); - while (!lines.empty() && lines.back().empty()) { - lines.pop_back(); - } - // If there are no comments, just return an empty string. - if (lines.empty()) { - return ""; - } - - std::string prefix; - std::string suffix; - std::string final_comments; - std::string epilogue; - - bool add_leading_space = false; - - if (prefer_single_line && lines.size() == 1) { - prefix = "/** "; - suffix = " */\n"; - } else { - prefix = "* "; - suffix = "\n"; - final_comments += "/**\n"; - epilogue = " **/\n"; - add_leading_space = true; - } - - for (int i = 0; i < lines.size(); i++) { - std::string line = StripPrefixString(lines[i], " "); - // HeaderDoc and appledoc use '\' and '@' for markers; escape them. - line = StringReplace(line, "\\", "\\\\", true); - line = StringReplace(line, "@", "\\@", true); - // Decouple / from * to not have inline comments inside comments. - line = StringReplace(line, "/*", "/\\*", true); - line = StringReplace(line, "*/", "*\\/", true); - line = prefix + line; - StripWhitespace(&line); - // If not a one line, need to add the first space before *, as - // StripWhitespace would have removed it. - line = (add_leading_space ? " " : "") + line; - final_comments += line + suffix; - } - final_comments += epilogue; - return final_comments; -} - -// Making these a generator option for folks that don't use CocoaPods, but do -// want to put the library in a framework is an interesting question. The -// problem is it means changing sources shipped with the library to actually -// use a different value; so it isn't as simple as a option. -const char* const ProtobufLibraryFrameworkName = "Protobuf"; - -std::string ProtobufFrameworkImportSymbol(const std::string& framework_name) { - // GPB_USE_[framework_name]_FRAMEWORK_IMPORTS - std::string result = std::string("GPB_USE_"); - result += ToUpper(framework_name); - result += "_FRAMEWORK_IMPORTS"; - return result; -} - -bool IsProtobufLibraryBundledProtoFile(const FileDescriptor* file) { - // We don't check the name prefix or proto package because some files - // (descriptor.proto), aren't shipped generated by the library, so this - // seems to be the safest way to only catch the ones shipped. - const std::string name = file->name(); - if (name == "google/protobuf/any.proto" || - name == "google/protobuf/api.proto" || - name == "google/protobuf/duration.proto" || - name == "google/protobuf/empty.proto" || - name == "google/protobuf/field_mask.proto" || - name == "google/protobuf/source_context.proto" || - name == "google/protobuf/struct.proto" || - name == "google/protobuf/timestamp.proto" || - name == "google/protobuf/type.proto" || - name == "google/protobuf/wrappers.proto") { - return true; - } - return false; -} - -bool ReadLine(StringPiece* input, StringPiece* line) { - for (int len = 0; len < input->size(); ++len) { - if (ascii_isnewline((*input)[len])) { - *line = StringPiece(input->data(), len); - ++len; // advance over the newline - *input = StringPiece(input->data() + len, input->size() - len); - return true; - } - } - return false; // Ran out of input with no newline. -} - -void RemoveComment(StringPiece* input) { - int offset = input->find('#'); - if (offset != StringPiece::npos) { - input->remove_suffix(input->length() - offset); - } -} - -namespace { - -class ExpectedPrefixesCollector : public LineConsumer { - public: - ExpectedPrefixesCollector(std::map* inout_package_to_prefix_map) - : prefix_map_(inout_package_to_prefix_map) {} - - virtual bool ConsumeLine(const StringPiece& line, std::string* out_error) override; - - private: - std::map* prefix_map_; -}; - -bool ExpectedPrefixesCollector::ConsumeLine( - const StringPiece& line, std::string* out_error) { - int offset = line.find('='); - if (offset == StringPiece::npos) { - *out_error = std::string("Expected prefixes file line without equal sign: '") + - std::string(line) + "'."; - return false; - } - StringPiece package = line.substr(0, offset); - StringPiece prefix = line.substr(offset + 1); - TrimWhitespace(&package); - TrimWhitespace(&prefix); - MaybeUnQuote(&prefix); - // Don't really worry about error checking the package/prefix for - // being valid. Assume the file is validated when it is created/edited. - (*prefix_map_)[std::string(package)] = std::string(prefix); - return true; -} - -bool LoadExpectedPackagePrefixes(const Options& generation_options, - std::map* prefix_map, - std::string* out_error) { - if (generation_options.expected_prefixes_path.empty()) { - return true; - } - - ExpectedPrefixesCollector collector(prefix_map); - return ParseSimpleFile( - generation_options.expected_prefixes_path, &collector, out_error); -} - -bool ValidateObjCClassPrefix( - const FileDescriptor* file, const std::string& expected_prefixes_path, - const std::map& expected_package_prefixes, - bool prefixes_must_be_registered, bool require_prefixes, - std::string* out_error) { - // Reminder: An explicit prefix option of "" is valid in case the default - // prefixing is set to use the proto package and a file needs to be generated - // without any prefix at all (for legacy reasons). - - bool has_prefix = file->options().has_objc_class_prefix(); - bool have_expected_prefix_file = !expected_prefixes_path.empty(); - - const std::string prefix = file->options().objc_class_prefix(); - const std::string package = file->package(); - - // NOTE: src/google/protobuf/compiler/plugin.cc makes use of cerr for some - // error cases, so it seems to be ok to use as a back door for warnings. - - // Check: Error - See if there was an expected prefix for the package and - // report if it doesn't match (wrong or missing). - std::map::const_iterator package_match = - expected_package_prefixes.find(package); - if (package_match != expected_package_prefixes.end()) { - // There was an entry, and... - if (has_prefix && package_match->second == prefix) { - // ...it matches. All good, out of here! - return true; - } else { - // ...it didn't match! - *out_error = "error: Expected 'option objc_class_prefix = \"" + - package_match->second + "\";' for package '" + package + - "' in '" + file->name() + "'"; - if (has_prefix) { - *out_error += "; but found '" + prefix + "' instead"; - } - *out_error += "."; - return false; - } - } - - // If there was no prefix option, we're done at this point. - if (!has_prefix) { - if (require_prefixes) { - *out_error = - "error: '" + file->name() + "' does not have a required 'option" + - " objc_class_prefix'."; - return false; - } - return true; - } - - // When the prefix is non empty, check it against the expected entries. - if (!prefix.empty() && have_expected_prefix_file) { - // For a non empty prefix, look for any other package that uses the prefix. - std::string other_package_for_prefix; - for (std::map::const_iterator i = - expected_package_prefixes.begin(); - i != expected_package_prefixes.end(); ++i) { - if (i->second == prefix) { - other_package_for_prefix = i->first; - break; - } - } - - // Check: Warning - If the file does not have a package, check whether the - // prefix was declared is being used by another package or not. This is - // a special case for empty packages. - if (package.empty()) { - // The file does not have a package and ... - if (other_package_for_prefix.empty()) { - // ... no other package has declared that prefix. - std::cerr - << "protoc:0: warning: File '" << file->name() << "' has no " - << "package. Consider adding a new package to the proto and adding '" - << "new.package = " << prefix << "' to the expected prefixes file (" - << expected_prefixes_path << ")." << std::endl; - std::cerr.flush(); - } else { - // ... another package has declared the same prefix. - std::cerr - << "protoc:0: warning: File '" << file->name() << "' has no package " - << "and package '" << other_package_for_prefix << "' already uses '" - << prefix << "' as its prefix. Consider either adding a new package " - << "to the proto, or reusing one of the packages already using this " - << "prefix in the expected prefixes file (" - << expected_prefixes_path << ")." << std::endl; - std::cerr.flush(); - } - return true; - } - - // Check: Error - Make sure the prefix wasn't expected for a different - // package (overlap is allowed, but it has to be listed as an expected - // overlap). - if (!other_package_for_prefix.empty()) { - *out_error = - "error: Found 'option objc_class_prefix = \"" + prefix + - "\";' in '" + file->name() + - "'; that prefix is already used for 'package " + - other_package_for_prefix + ";'. It can only be reused by listing " + - "it in the expected file (" + - expected_prefixes_path + ")."; - return false; // Only report first usage of the prefix. - } - } // !prefix.empty() - - // Check: Warning - Make sure the prefix is is a reasonable value according - // to Apple's rules (the checks above implicitly whitelist anything that - // doesn't meet these rules). - if (!prefix.empty() && !ascii_isupper(prefix[0])) { - std::cerr - << "protoc:0: warning: Invalid 'option objc_class_prefix = \"" - << prefix << "\";' in '" << file->name() << "';" - << " it should start with a capital letter." << std::endl; - std::cerr.flush(); - } - if (!prefix.empty() && prefix.length() < 3) { - // Apple reserves 2 character prefixes for themselves. They do use some - // 3 character prefixes, but they haven't updated the rules/docs. - std::cerr - << "protoc:0: warning: Invalid 'option objc_class_prefix = \"" - << prefix << "\";' in '" << file->name() << "';" - << " Apple recommends they should be at least 3 characters long." - << std::endl; - std::cerr.flush(); - } - - // Check: Error/Warning - If the given package/prefix pair wasn't expected, - // issue a error/warning to added to the file. - if (have_expected_prefix_file) { - if (prefixes_must_be_registered) { - *out_error = - "error: '" + file->name() + "' has 'option objc_class_prefix = \"" + - prefix + "\";', but it is not registered; add it to the expected " + - "prefixes file (" + expected_prefixes_path + ") for the package '" + - package + "'."; - return false; - } - - std::cerr - << "protoc:0: warning: Found unexpected 'option objc_class_prefix = \"" - << prefix << "\";' in '" << file->name() << "';" - << " consider adding it to the expected prefixes file (" - << expected_prefixes_path << ")." << std::endl; - std::cerr.flush(); - } - - return true; -} - -} // namespace - -bool ValidateObjCClassPrefixes(const std::vector& files, - const Options& generation_options, - std::string* out_error) { - // Allow a '-' as the path for the expected prefixes to completely disable - // even the most basic of checks. - if (generation_options.expected_prefixes_path == "-") { - return true; - } - - // Load the expected package prefixes, if available, to validate against. - std::map expected_package_prefixes; - if (!LoadExpectedPackagePrefixes(generation_options, - &expected_package_prefixes, - out_error)) { - return false; - } - - for (int i = 0; i < files.size(); i++) { - bool should_skip = - (std::find(generation_options.expected_prefixes_suppressions.begin(), - generation_options.expected_prefixes_suppressions.end(), - files[i]->name()) - != generation_options.expected_prefixes_suppressions.end()); - if (should_skip) { - continue; - } - - bool is_valid = - ValidateObjCClassPrefix(files[i], - generation_options.expected_prefixes_path, - expected_package_prefixes, - generation_options.prefixes_must_be_registered, - generation_options.require_prefixes, - out_error); - if (!is_valid) { - return false; - } - } - return true; -} - -TextFormatDecodeData::TextFormatDecodeData() { } - -TextFormatDecodeData::~TextFormatDecodeData() { } - -void TextFormatDecodeData::AddString(int32_t key, - const std::string& input_for_decode, - const std::string& desired_output) { - for (std::vector::const_iterator i = entries_.begin(); - i != entries_.end(); ++i) { - if (i->first == key) { - std::cerr << "error: duplicate key (" << key - << ") making TextFormat data, input: \"" << input_for_decode - << "\", desired: \"" << desired_output << "\"." << std::endl; - std::cerr.flush(); - abort(); - } - } - - const std::string& data = TextFormatDecodeData::DecodeDataForString( - input_for_decode, desired_output); - entries_.push_back(DataEntry(key, data)); -} - -std::string TextFormatDecodeData::Data() const { - std::ostringstream data_stringstream; - - if (num_entries() > 0) { - io::OstreamOutputStream data_outputstream(&data_stringstream); - io::CodedOutputStream output_stream(&data_outputstream); - - output_stream.WriteVarint32(num_entries()); - for (std::vector::const_iterator i = entries_.begin(); - i != entries_.end(); ++i) { - output_stream.WriteVarint32(i->first); - output_stream.WriteString(i->second); - } - } - - data_stringstream.flush(); - return data_stringstream.str(); -} - -namespace { - -// Helper to build up the decode data for a string. -class DecodeDataBuilder { - public: - DecodeDataBuilder() { Reset(); } - - bool AddCharacter(const char desired, const char input); - void AddUnderscore() { - Push(); - need_underscore_ = true; - } - std::string Finish() { - Push(); - return decode_data_; - } - - private: - static constexpr uint8_t kAddUnderscore = 0x80; - - static constexpr uint8_t kOpAsIs = 0x00; - static constexpr uint8_t kOpFirstUpper = 0x40; - static constexpr uint8_t kOpFirstLower = 0x20; - static constexpr uint8_t kOpAllUpper = 0x60; - - static constexpr int kMaxSegmentLen = 0x1f; - - void AddChar(const char desired) { - ++segment_len_; - is_all_upper_ &= ascii_isupper(desired); - } - - void Push() { - uint8_t op = (op_ | segment_len_); - if (need_underscore_) op |= kAddUnderscore; - if (op != 0) { - decode_data_ += (char)op; - } - Reset(); - } - - bool AddFirst(const char desired, const char input) { - if (desired == input) { - op_ = kOpAsIs; - } else if (desired == ascii_toupper(input)) { - op_ = kOpFirstUpper; - } else if (desired == ascii_tolower(input)) { - op_ = kOpFirstLower; - } else { - // Can't be transformed to match. - return false; - } - AddChar(desired); - return true; - } - - void Reset() { - need_underscore_ = false; - op_ = 0; - segment_len_ = 0; - is_all_upper_ = true; - } - - bool need_underscore_; - bool is_all_upper_; - uint8_t op_; - int segment_len_; - - std::string decode_data_; -}; - -bool DecodeDataBuilder::AddCharacter(const char desired, const char input) { - // If we've hit the max size, push to start a new segment. - if (segment_len_ == kMaxSegmentLen) { - Push(); - } - if (segment_len_ == 0) { - return AddFirst(desired, input); - } - - // Desired and input match... - if (desired == input) { - // If we aren't transforming it, or we're upper casing it and it is - // supposed to be uppercase; just add it to the segment. - if ((op_ != kOpAllUpper) || ascii_isupper(desired)) { - AddChar(desired); - return true; - } - - // Add the current segment, and start the next one. - Push(); - return AddFirst(desired, input); - } - - // If we need to uppercase, and everything so far has been uppercase, - // promote op to AllUpper. - if ((desired == ascii_toupper(input)) && is_all_upper_) { - op_ = kOpAllUpper; - AddChar(desired); - return true; - } - - // Give up, push and start a new segment. - Push(); - return AddFirst(desired, input); -} - -// If decode data can't be generated, a directive for the raw string -// is used instead. -std::string DirectDecodeString(const std::string& str) { - std::string result; - result += (char)'\0'; // Marker for full string. - result += str; - result += (char)'\0'; // End of string. - return result; -} - -} // namespace - -// static -std::string TextFormatDecodeData::DecodeDataForString( - const std::string& input_for_decode, const std::string& desired_output) { - if (input_for_decode.empty() || desired_output.empty()) { - std::cerr << "error: got empty string for making TextFormat data, input: \"" - << input_for_decode << "\", desired: \"" << desired_output << "\"." - << std::endl; - std::cerr.flush(); - abort(); - } - if ((input_for_decode.find('\0') != std::string::npos) || - (desired_output.find('\0') != std::string::npos)) { - std::cerr << "error: got a null char in a string for making TextFormat data," - << " input: \"" << CEscape(input_for_decode) << "\", desired: \"" - << CEscape(desired_output) << "\"." << std::endl; - std::cerr.flush(); - abort(); - } - - DecodeDataBuilder builder; - - // Walk the output building it from the input. - int x = 0; - for (int y = 0; y < desired_output.size(); y++) { - const char d = desired_output[y]; - if (d == '_') { - builder.AddUnderscore(); - continue; - } - - if (x >= input_for_decode.size()) { - // Out of input, no way to encode it, just return a full decode. - return DirectDecodeString(desired_output); - } - if (builder.AddCharacter(d, input_for_decode[x])) { - ++x; // Consumed one input - } else { - // Couldn't transform for the next character, just return a full decode. - return DirectDecodeString(desired_output); - } - } - - if (x != input_for_decode.size()) { - // Extra input (suffix from name sanitizing?), just return a full decode. - return DirectDecodeString(desired_output); - } - - // Add the end marker. - return builder.Finish() + (char)'\0'; -} - -namespace { - -class Parser { - public: - Parser(LineConsumer* line_consumer) - : line_consumer_(line_consumer), line_(0) {} - - // Feeds in some input, parse what it can, returning success/failure. Calling - // again after an error is undefined. - bool ParseChunk(StringPiece chunk, std::string* out_error); - - // Should be called to finish parsing (after all input has been provided via - // successful calls to ParseChunk(), calling after a ParseChunk() failure is - // undefined). Returns success/failure. - bool Finish(std::string* out_error); - - int last_line() const { return line_; } - - private: - LineConsumer* line_consumer_; - int line_; - std::string leftover_; -}; - -bool Parser::ParseChunk(StringPiece chunk, std::string* out_error) { - StringPiece full_chunk; - if (!leftover_.empty()) { - leftover_ += std::string(chunk); - full_chunk = StringPiece(leftover_); - } else { - full_chunk = chunk; - } - - StringPiece line; - while (ReadLine(&full_chunk, &line)) { - ++line_; - RemoveComment(&line); - TrimWhitespace(&line); - if (!line.empty() && !line_consumer_->ConsumeLine(line, out_error)) { - if (out_error->empty()) { - *out_error = "ConsumeLine failed without setting an error."; - } - leftover_.clear(); - return false; - } - } - - if (full_chunk.empty()) { - leftover_.clear(); - } else { - leftover_ = std::string(full_chunk); - } - return true; -} - -bool Parser::Finish(std::string* out_error) { - // If there is still something to go, flush it with a newline. - if (!leftover_.empty() && !ParseChunk("\n", out_error)) { - return false; - } - // This really should never fail if ParseChunk succeeded, but check to be sure. - if (!leftover_.empty()) { - *out_error = "ParseSimple Internal error: finished with pending data."; - return false; - } - return true; -} - -std::string FullErrorString(const std::string& name, int line_num, const std::string& msg) { - return std::string("error: ") + name + " Line " + StrCat(line_num) + ", " + msg; -} - -} // namespace - -LineConsumer::LineConsumer() {} - -LineConsumer::~LineConsumer() {} - -bool ParseSimpleFile(const std::string& path, LineConsumer* line_consumer, - std::string* out_error) { - int fd; - do { - fd = posix::open(path.c_str(), O_RDONLY); - } while (fd < 0 && errno == EINTR); - if (fd < 0) { - *out_error = std::string("error: Unable to open \"") + path + "\", " + - strerror(errno); - return false; - } - io::FileInputStream file_stream(fd); - file_stream.SetCloseOnDelete(true); - - return ParseSimpleStream(file_stream, path, line_consumer, out_error); -} - -bool ParseSimpleStream(io::ZeroCopyInputStream& input_stream, - const std::string& stream_name, - LineConsumer* line_consumer, - std::string* out_error) { - std::string local_error; - Parser parser(line_consumer); - const void* buf; - int buf_len; - while (input_stream.Next(&buf, &buf_len)) { - if (buf_len == 0) { - continue; - } - - if (!parser.ParseChunk(StringPiece(static_cast(buf), buf_len), - &local_error)) { - *out_error = FullErrorString(stream_name, parser.last_line(), local_error); - return false; - } - } - if (!parser.Finish(&local_error)) { - *out_error = FullErrorString(stream_name, parser.last_line(), local_error); - return false; - } - return true; -} - -ImportWriter::ImportWriter( - const std::string& generate_for_named_framework, - const std::string& named_framework_to_proto_path_mappings_path, - const std::string& runtime_import_prefix, bool include_wkt_imports) - : generate_for_named_framework_(generate_for_named_framework), - named_framework_to_proto_path_mappings_path_( - named_framework_to_proto_path_mappings_path), - runtime_import_prefix_(runtime_import_prefix), - include_wkt_imports_(include_wkt_imports), - need_to_parse_mapping_file_(true) {} - -ImportWriter::~ImportWriter() {} - -void ImportWriter::AddFile(const FileDescriptor* file, - const std::string& header_extension) { - if (IsProtobufLibraryBundledProtoFile(file)) { - // The imports of the WKTs are only needed within the library itself, - // in other cases, they get skipped because the generated code already - // import GPBProtocolBuffers.h and hence proves them. - if (include_wkt_imports_) { - const std::string header_name = - "GPB" + FilePathBasename(file) + header_extension; - protobuf_imports_.push_back(header_name); - } - return; - } - - // Lazy parse any mappings. - if (need_to_parse_mapping_file_) { - ParseFrameworkMappings(); - } - - std::map::iterator proto_lookup = - proto_file_to_framework_name_.find(file->name()); - if (proto_lookup != proto_file_to_framework_name_.end()) { - other_framework_imports_.push_back( - proto_lookup->second + "/" + - FilePathBasename(file) + header_extension); - return; - } - - if (!generate_for_named_framework_.empty()) { - other_framework_imports_.push_back( - generate_for_named_framework_ + "/" + - FilePathBasename(file) + header_extension); - return; - } - - other_imports_.push_back(FilePath(file) + header_extension); -} - -void ImportWriter::Print(io::Printer* printer) const { - bool add_blank_line = false; - - if (!protobuf_imports_.empty()) { - PrintRuntimeImports(printer, protobuf_imports_, runtime_import_prefix_); - add_blank_line = true; - } - - if (!other_framework_imports_.empty()) { - if (add_blank_line) { - printer->Print("\n"); - } - - for (std::vector::const_iterator iter = - other_framework_imports_.begin(); - iter != other_framework_imports_.end(); ++iter) { - printer->Print( - "#import <$header$>\n", - "header", *iter); - } - - add_blank_line = true; - } - - if (!other_imports_.empty()) { - if (add_blank_line) { - printer->Print("\n"); - } - - for (std::vector::const_iterator iter = other_imports_.begin(); - iter != other_imports_.end(); ++iter) { - printer->Print( - "#import \"$header$\"\n", - "header", *iter); - } - } -} - -void ImportWriter::PrintRuntimeImports( - io::Printer* printer, const std::vector& header_to_import, - const std::string& runtime_import_prefix, bool default_cpp_symbol) { - // Given an override, use that. - if (!runtime_import_prefix.empty()) { - for (const auto& header : header_to_import) { - printer->Print( - " #import \"$import_prefix$/$header$\"\n", - "import_prefix", runtime_import_prefix, - "header", header); - } - return; - } - - const std::string framework_name(ProtobufLibraryFrameworkName); - const std::string cpp_symbol(ProtobufFrameworkImportSymbol(framework_name)); - - if (default_cpp_symbol) { - printer->Print( - "// This CPP symbol can be defined to use imports that match up to the framework\n" - "// imports needed when using CocoaPods.\n" - "#if !defined($cpp_symbol$)\n" - " #define $cpp_symbol$ 0\n" - "#endif\n" - "\n", - "cpp_symbol", cpp_symbol); - } - - printer->Print( - "#if $cpp_symbol$\n", - "cpp_symbol", cpp_symbol); - for (const auto& header : header_to_import) { - printer->Print( - " #import <$framework_name$/$header$>\n", - "framework_name", framework_name, - "header", header); - } - printer->Print( - "#else\n"); - for (const auto& header : header_to_import) { - printer->Print( - " #import \"$header$\"\n", - "header", header); - } - printer->Print( - "#endif\n"); -} - -void ImportWriter::ParseFrameworkMappings() { - need_to_parse_mapping_file_ = false; - if (named_framework_to_proto_path_mappings_path_.empty()) { - return; // Nothing to do. - } - - ProtoFrameworkCollector collector(&proto_file_to_framework_name_); - std::string parse_error; - if (!ParseSimpleFile(named_framework_to_proto_path_mappings_path_, - &collector, &parse_error)) { - std::cerr << "error parsing " << named_framework_to_proto_path_mappings_path_ - << " : " << parse_error << std::endl; - std::cerr.flush(); - } -} - -bool ImportWriter::ProtoFrameworkCollector::ConsumeLine( - const StringPiece& line, std::string* out_error) { - int offset = line.find(':'); - if (offset == StringPiece::npos) { - *out_error = - std::string("Framework/proto file mapping line without colon sign: '") + - std::string(line) + "'."; - return false; - } - StringPiece framework_name = line.substr(0, offset); - StringPiece proto_file_list = line.substr(offset + 1); - TrimWhitespace(&framework_name); - - int start = 0; - while (start < proto_file_list.length()) { - offset = proto_file_list.find(',', start); - if (offset == StringPiece::npos) { - offset = proto_file_list.length(); - } - - StringPiece proto_file = proto_file_list.substr(start, offset - start); - TrimWhitespace(&proto_file); - if (!proto_file.empty()) { - std::map::iterator existing_entry = - map_->find(std::string(proto_file)); - if (existing_entry != map_->end()) { - std::cerr << "warning: duplicate proto file reference, replacing " - "framework entry for '" - << std::string(proto_file) << "' with '" << std::string(framework_name) - << "' (was '" << existing_entry->second << "')." << std::endl; - std::cerr.flush(); - } - - if (proto_file.find(' ') != StringPiece::npos) { - std::cerr << "note: framework mapping file had a proto file with a " - "space in, hopefully that isn't a missing comma: '" - << std::string(proto_file) << "'" << std::endl; - std::cerr.flush(); - } - - (*map_)[std::string(proto_file)] = std::string(framework_name); - } - - start = offset + 1; - } - - return true; -} - -} // namespace objectivec -} // namespace compiler -} // namespace protobuf -} // namespace google diff --git a/extra/protobuf/protobuf-3.19.4/src/google/protobuf/compiler/objectivec/objectivec_helpers.h b/extra/protobuf/protobuf-3.19.4/src/google/protobuf/compiler/objectivec/objectivec_helpers.h deleted file mode 100644 index 13a105240662..000000000000 --- a/extra/protobuf/protobuf-3.19.4/src/google/protobuf/compiler/objectivec/objectivec_helpers.h +++ /dev/null @@ -1,347 +0,0 @@ -// Protocol Buffers - Google's data interchange format -// Copyright 2008 Google Inc. All rights reserved. -// https://developers.google.com/protocol-buffers/ -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// * Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// * Redistributions in binary form must reproduce the above -// copyright notice, this list of conditions and the following disclaimer -// in the documentation and/or other materials provided with the -// distribution. -// * Neither the name of Google Inc. nor the names of its -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -// Helper functions for generating ObjectiveC code. - -#ifndef GOOGLE_PROTOBUF_COMPILER_OBJECTIVEC_HELPERS_H__ -#define GOOGLE_PROTOBUF_COMPILER_OBJECTIVEC_HELPERS_H__ - -#include -#include - -#include -#include -#include - -#include - -namespace google { -namespace protobuf { -namespace compiler { -namespace objectivec { - -// Get/Set if the proto package should be used to make the default prefix for -// symbols. This will then impact most of the type naming apis below. It is done -// as a global to not break any other generator reusing the methods since they -// are exported. -bool PROTOC_EXPORT UseProtoPackageAsDefaultPrefix(); -void PROTOC_EXPORT SetUseProtoPackageAsDefaultPrefix(bool on_or_off); -// Get/Set the path to a file to load as exceptions when -// `UseProtoPackageAsDefaultPrefixUseProtoPackageAsDefaultPrefix()` is `true`. -// And empty string means there should be no exceptions loaded. -std::string PROTOC_EXPORT GetProtoPackagePrefixExceptionList(); -void PROTOC_EXPORT SetProtoPackagePrefixExceptionList( - const std::string& file_path); - -// Generator options (see objectivec_generator.cc for a description of each): -struct Options { - Options(); - std::string expected_prefixes_path; - std::vector expected_prefixes_suppressions; - std::string generate_for_named_framework; - std::string named_framework_to_proto_path_mappings_path; - std::string runtime_import_prefix; - bool prefixes_must_be_registered; - bool require_prefixes; -}; - -// Escape C++ trigraphs by escaping question marks to "\?". -std::string PROTOC_EXPORT EscapeTrigraphs(const std::string& to_escape); - -// Remove white space from either end of a StringPiece. -void PROTOC_EXPORT TrimWhitespace(StringPiece* input); - -// Returns true if the name requires a ns_returns_not_retained attribute applied -// to it. -bool PROTOC_EXPORT IsRetainedName(const std::string& name); - -// Returns true if the name starts with "init" and will need to have special -// handling under ARC. -bool PROTOC_EXPORT IsInitName(const std::string& name); - -// Gets the objc_class_prefix or the prefix made from the proto package. -std::string PROTOC_EXPORT FileClassPrefix(const FileDescriptor* file); - -// Gets the path of the file we're going to generate (sans the .pb.h -// extension). The path will be dependent on the objectivec package -// declared in the proto package. -std::string PROTOC_EXPORT FilePath(const FileDescriptor* file); - -// Just like FilePath(), but without the directory part. -std::string PROTOC_EXPORT FilePathBasename(const FileDescriptor* file); - -// Gets the name of the root class we'll generate in the file. This class -// is not meant for external consumption, but instead contains helpers that -// the rest of the classes need -std::string PROTOC_EXPORT FileClassName(const FileDescriptor* file); - -// These return the fully-qualified class name corresponding to the given -// descriptor. -std::string PROTOC_EXPORT ClassName(const Descriptor* descriptor); -std::string PROTOC_EXPORT ClassName(const Descriptor* descriptor, - std::string* out_suffix_added); -std::string PROTOC_EXPORT EnumName(const EnumDescriptor* descriptor); - -// Returns the fully-qualified name of the enum value corresponding to the -// the descriptor. -std::string PROTOC_EXPORT EnumValueName(const EnumValueDescriptor* descriptor); - -// Returns the name of the enum value corresponding to the descriptor. -std::string PROTOC_EXPORT EnumValueShortName(const EnumValueDescriptor* descriptor); - -// Reverse what an enum does. -std::string PROTOC_EXPORT UnCamelCaseEnumShortName(const std::string& name); - -// Returns the name to use for the extension (used as the method off the file's -// Root class). -std::string PROTOC_EXPORT ExtensionMethodName(const FieldDescriptor* descriptor); - -// Returns the transformed field name. -std::string PROTOC_EXPORT FieldName(const FieldDescriptor* field); -std::string PROTOC_EXPORT FieldNameCapitalized(const FieldDescriptor* field); - -// Returns the transformed oneof name. -std::string PROTOC_EXPORT OneofEnumName(const OneofDescriptor* descriptor); -std::string PROTOC_EXPORT OneofName(const OneofDescriptor* descriptor); -std::string PROTOC_EXPORT OneofNameCapitalized(const OneofDescriptor* descriptor); - -// Returns a symbol that can be used in C code to refer to an Objective C -// class without initializing the class. -std::string PROTOC_EXPORT ObjCClass(const std::string& class_name); - -// Declares an Objective C class without initializing the class so that it can -// be refrerred to by ObjCClass. -std::string PROTOC_EXPORT ObjCClassDeclaration(const std::string& class_name); - -inline bool HasPreservingUnknownEnumSemantics(const FileDescriptor* file) { - return file->syntax() == FileDescriptor::SYNTAX_PROTO3; -} - -inline bool IsMapEntryMessage(const Descriptor* descriptor) { - return descriptor->options().map_entry(); -} - -// Reverse of the above. -std::string PROTOC_EXPORT UnCamelCaseFieldName(const std::string& name, - const FieldDescriptor* field); - -enum ObjectiveCType { - OBJECTIVECTYPE_INT32, - OBJECTIVECTYPE_UINT32, - OBJECTIVECTYPE_INT64, - OBJECTIVECTYPE_UINT64, - OBJECTIVECTYPE_FLOAT, - OBJECTIVECTYPE_DOUBLE, - OBJECTIVECTYPE_BOOLEAN, - OBJECTIVECTYPE_STRING, - OBJECTIVECTYPE_DATA, - OBJECTIVECTYPE_ENUM, - OBJECTIVECTYPE_MESSAGE -}; - -enum FlagType { - FLAGTYPE_DESCRIPTOR_INITIALIZATION, - FLAGTYPE_EXTENSION, - FLAGTYPE_FIELD -}; - -template -std::string GetOptionalDeprecatedAttribute(const TDescriptor* descriptor, - const FileDescriptor* file = NULL, - bool preSpace = true, - bool postNewline = false) { - bool isDeprecated = descriptor->options().deprecated(); - // The file is only passed when checking Messages & Enums, so those types - // get tagged. At the moment, it doesn't seem to make sense to tag every - // field or enum value with when the file is deprecated. - bool isFileLevelDeprecation = false; - if (!isDeprecated && file) { - isFileLevelDeprecation = file->options().deprecated(); - isDeprecated = isFileLevelDeprecation; - } - if (isDeprecated) { - std::string message; - const FileDescriptor* sourceFile = descriptor->file(); - if (isFileLevelDeprecation) { - message = sourceFile->name() + " is deprecated."; - } else { - message = descriptor->full_name() + " is deprecated (see " + - sourceFile->name() + ")."; - } - - std::string result = std::string("GPB_DEPRECATED_MSG(\"") + message + "\")"; - if (preSpace) { - result.insert(0, " "); - } - if (postNewline) { - result.append("\n"); - } - return result; - } else { - return ""; - } -} - -std::string PROTOC_EXPORT GetCapitalizedType(const FieldDescriptor* field); - -ObjectiveCType PROTOC_EXPORT -GetObjectiveCType(FieldDescriptor::Type field_type); - -inline ObjectiveCType GetObjectiveCType(const FieldDescriptor* field) { - return GetObjectiveCType(field->type()); -} - -bool PROTOC_EXPORT IsPrimitiveType(const FieldDescriptor* field); -bool PROTOC_EXPORT IsReferenceType(const FieldDescriptor* field); - -std::string PROTOC_EXPORT -GPBGenericValueFieldName(const FieldDescriptor* field); -std::string PROTOC_EXPORT DefaultValue(const FieldDescriptor* field); -bool PROTOC_EXPORT HasNonZeroDefaultValue(const FieldDescriptor* field); - -std::string PROTOC_EXPORT -BuildFlagsString(const FlagType type, const std::vector& strings); - -// Builds HeaderDoc/appledoc style comments out of the comments in the .proto -// file. -std::string PROTOC_EXPORT BuildCommentsString(const SourceLocation& location, - bool prefer_single_line); - -// The name the commonly used by the library when built as a framework. -// This lines up to the name used in the CocoaPod. -extern PROTOC_EXPORT const char* const ProtobufLibraryFrameworkName; -// Returns the CPP symbol name to use as the gate for framework style imports -// for the given framework name to use. -std::string PROTOC_EXPORT -ProtobufFrameworkImportSymbol(const std::string& framework_name); - -// Checks if the file is one of the proto's bundled with the library. -bool PROTOC_EXPORT -IsProtobufLibraryBundledProtoFile(const FileDescriptor* file); - -// Checks the prefix for the given files and outputs any warnings as needed. If -// there are flat out errors, then out_error is filled in with the first error -// and the result is false. -bool PROTOC_EXPORT ValidateObjCClassPrefixes( - const std::vector& files, - const Options& generation_options, std::string* out_error); - -// Generate decode data needed for ObjC's GPBDecodeTextFormatName() to transform -// the input into the expected output. -class PROTOC_EXPORT TextFormatDecodeData { - public: - TextFormatDecodeData(); - ~TextFormatDecodeData(); - - TextFormatDecodeData(const TextFormatDecodeData&) = delete; - TextFormatDecodeData& operator=(const TextFormatDecodeData&) = delete; - - void AddString(int32_t key, const std::string& input_for_decode, - const std::string& desired_output); - size_t num_entries() const { return entries_.size(); } - std::string Data() const; - - static std::string DecodeDataForString(const std::string& input_for_decode, - const std::string& desired_output); - - private: - typedef std::pair DataEntry; - std::vector entries_; -}; - -// Helper for parsing simple files. -class PROTOC_EXPORT LineConsumer { - public: - LineConsumer(); - virtual ~LineConsumer(); - virtual bool ConsumeLine(const StringPiece& line, std::string* out_error) = 0; -}; - -bool PROTOC_EXPORT ParseSimpleFile(const std::string& path, - LineConsumer* line_consumer, - std::string* out_error); - -bool PROTOC_EXPORT ParseSimpleStream(io::ZeroCopyInputStream& input_stream, - const std::string& stream_name, - LineConsumer* line_consumer, - std::string* out_error); - -// Helper class for parsing framework import mappings and generating -// import statements. -class PROTOC_EXPORT ImportWriter { - public: - ImportWriter(const std::string& generate_for_named_framework, - const std::string& named_framework_to_proto_path_mappings_path, - const std::string& runtime_import_prefix, - bool include_wkt_imports); - ~ImportWriter(); - - void AddFile(const FileDescriptor* file, const std::string& header_extension); - void Print(io::Printer* printer) const; - - static void PrintRuntimeImports(io::Printer* printer, - const std::vector& header_to_import, - const std::string& runtime_import_prefix, - bool default_cpp_symbol = false); - - private: - class ProtoFrameworkCollector : public LineConsumer { - public: - ProtoFrameworkCollector(std::map* inout_proto_file_to_framework_name) - : map_(inout_proto_file_to_framework_name) {} - - virtual bool ConsumeLine(const StringPiece& line, std::string* out_error) override; - - private: - std::map* map_; - }; - - void ParseFrameworkMappings(); - - const std::string generate_for_named_framework_; - const std::string named_framework_to_proto_path_mappings_path_; - const std::string runtime_import_prefix_; - const bool include_wkt_imports_; - std::map proto_file_to_framework_name_; - bool need_to_parse_mapping_file_; - - std::vector protobuf_imports_; - std::vector other_framework_imports_; - std::vector other_imports_; -}; - -} // namespace objectivec -} // namespace compiler -} // namespace protobuf -} // namespace google - -#include - -#endif // GOOGLE_PROTOBUF_COMPILER_OBJECTIVEC_HELPERS_H__ diff --git a/extra/protobuf/protobuf-3.19.4/src/google/protobuf/compiler/objectivec/objectivec_helpers_unittest.cc b/extra/protobuf/protobuf-3.19.4/src/google/protobuf/compiler/objectivec/objectivec_helpers_unittest.cc deleted file mode 100644 index 3c5eda226596..000000000000 --- a/extra/protobuf/protobuf-3.19.4/src/google/protobuf/compiler/objectivec/objectivec_helpers_unittest.cc +++ /dev/null @@ -1,385 +0,0 @@ -// Protocol Buffers - Google's data interchange format -// Copyright 2014 Google Inc. All rights reserved. -// https://developers.google.com/protocol-buffers/ -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// * Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// * Redistributions in binary form must reproduce the above -// copyright notice, this list of conditions and the following disclaimer -// in the documentation and/or other materials provided with the -// distribution. -// * Neither the name of Google Inc. nor the names of its -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -#include -#include -#include -#include - -namespace google { -namespace protobuf { -namespace compiler { -namespace objectivec { -namespace { - -TEST(ObjCHelper, TextFormatDecodeData_DecodeDataForString_RawStrings) { - std::string input_for_decode("abcdefghIJ"); - std::string desired_output_for_decode; - std::string expected; - std::string result; - - // Different data, can't transform. - - desired_output_for_decode = "zbcdefghIJ"; - expected = std::string("\0zbcdefghIJ\0", 12); - result = TextFormatDecodeData::DecodeDataForString(input_for_decode, - desired_output_for_decode); - EXPECT_EQ(expected, result); - - desired_output_for_decode = "abcdezghIJ"; - expected = std::string("\0abcdezghIJ\0", 12); - result = TextFormatDecodeData::DecodeDataForString(input_for_decode, - desired_output_for_decode); - EXPECT_EQ(expected, result); - - // Shortened data, can't transform. - - desired_output_for_decode = "abcdefghI"; - expected = std::string("\0abcdefghI\0", 11); - result = TextFormatDecodeData::DecodeDataForString(input_for_decode, - desired_output_for_decode); - EXPECT_EQ(expected, result); - - // Extra data, can't transform. - - desired_output_for_decode = "abcdefghIJz"; - expected = std::string("\0abcdefghIJz\0", 13); - result = TextFormatDecodeData::DecodeDataForString(input_for_decode, - desired_output_for_decode); - EXPECT_EQ(expected, result); -} - -TEST(ObjCHelper, TextFormatDecodeData_DecodeDataForString_ByteCodes) { - std::string input_for_decode("abcdefghIJ"); - std::string desired_output_for_decode; - std::string expected; - std::string result; - - desired_output_for_decode = "abcdefghIJ"; - expected = std::string("\x0A\x0", 2); - result = TextFormatDecodeData::DecodeDataForString(input_for_decode, - desired_output_for_decode); - EXPECT_EQ(expected, result); - - desired_output_for_decode = "_AbcdefghIJ"; - expected = std::string("\xCA\x0", 2); - result = TextFormatDecodeData::DecodeDataForString(input_for_decode, - desired_output_for_decode); - EXPECT_EQ(expected, result); - - desired_output_for_decode = "ABCD__EfghI_j"; - expected = std::string("\x64\x80\xC5\xA1\x0", 5); - result = TextFormatDecodeData::DecodeDataForString(input_for_decode, - desired_output_for_decode); - EXPECT_EQ(expected, result); - - // Long name so multiple decode ops are needed. - - input_for_decode = - "longFieldNameIsLooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong1000"; - desired_output_for_decode = - "long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_1000"; - expected = std::string("\x04\xA5\xA4\xA2\xBF\x1F\x0E\x84\x0", 9); - result = TextFormatDecodeData::DecodeDataForString(input_for_decode, - desired_output_for_decode); - EXPECT_EQ(expected, result); -} - -// Death tests do not work on Windows as of yet. -#ifdef PROTOBUF_HAS_DEATH_TEST -TEST(ObjCHelperDeathTest, TextFormatDecodeData_DecodeDataForString_Failures) { - // Empty inputs. - - EXPECT_EXIT(TextFormatDecodeData::DecodeDataForString("", ""), - ::testing::KilledBySignal(SIGABRT), - "error: got empty string for making TextFormat data, input:"); - EXPECT_EXIT(TextFormatDecodeData::DecodeDataForString("a", ""), - ::testing::KilledBySignal(SIGABRT), - "error: got empty string for making TextFormat data, input:"); - EXPECT_EXIT(TextFormatDecodeData::DecodeDataForString("", "a"), - ::testing::KilledBySignal(SIGABRT), - "error: got empty string for making TextFormat data, input:"); - - // Null char in the string. - - std::string str_with_null_char("ab\0c", 4); - EXPECT_EXIT( - TextFormatDecodeData::DecodeDataForString(str_with_null_char, "def"), - ::testing::KilledBySignal(SIGABRT), - "error: got a null char in a string for making TextFormat data, input:"); - EXPECT_EXIT( - TextFormatDecodeData::DecodeDataForString("def", str_with_null_char), - ::testing::KilledBySignal(SIGABRT), - "error: got a null char in a string for making TextFormat data, input:"); -} -#endif // PROTOBUF_HAS_DEATH_TEST - -TEST(ObjCHelper, TextFormatDecodeData_RawStrings) { - TextFormatDecodeData decode_data; - - // Different data, can't transform. - decode_data.AddString(1, "abcdefghIJ", "zbcdefghIJ"); - decode_data.AddString(3, "abcdefghIJ", "abcdezghIJ"); - // Shortened data, can't transform. - decode_data.AddString(2, "abcdefghIJ", "abcdefghI"); - // Extra data, can't transform. - decode_data.AddString(4, "abcdefghIJ", "abcdefghIJz"); - - EXPECT_EQ(4, decode_data.num_entries()); - - uint8 expected_data[] = { - 0x4, - 0x1, 0x0, 'z', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'I', 'J', 0x0, - 0x3, 0x0, 'a', 'b', 'c', 'd', 'e', 'z', 'g', 'h', 'I', 'J', 0x0, - 0x2, 0x0, 'a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'I', 0x0, - 0x4, 0x0, 'a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'I', 'J', 'z', 0x0, - }; - std::string expected((const char*)expected_data, sizeof(expected_data)); - - EXPECT_EQ(expected, decode_data.Data()); -} - -TEST(ObjCHelper, TextFormatDecodeData_ByteCodes) { - TextFormatDecodeData decode_data; - - decode_data.AddString(1, "abcdefghIJ", "abcdefghIJ"); - decode_data.AddString(3, "abcdefghIJ", "_AbcdefghIJ"); - decode_data.AddString(2, "abcdefghIJ", "Abcd_EfghIJ"); - decode_data.AddString(4, "abcdefghIJ", "ABCD__EfghI_j"); - decode_data.AddString(1000, - "longFieldNameIsLooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong1000", - "long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_1000"); - - EXPECT_EQ(5, decode_data.num_entries()); - - uint8 expected_data[] = { - 0x5, - // All as is (00 op) - 0x1, 0x0A, 0x0, - // Underscore, upper + 9 (10 op) - 0x3, 0xCA, 0x0, - // Upper + 3 (10 op), underscore, upper + 5 (10 op) - 0x2, 0x44, 0xC6, 0x0, - // All Upper for 4 (11 op), underscore, underscore, upper + 5 (10 op), - // underscore, lower + 0 (01 op) - 0x4, 0x64, 0x80, 0xC5, 0xA1, 0x0, - // 2 byte key: as is + 3 (00 op), underscore, lower + 4 (01 op), - // underscore, lower + 3 (01 op), underscore, lower + 1 (01 op), - // underscore, lower + 30 (01 op), as is + 30 (00 op), as is + 13 (00 - // op), - // underscore, as is + 3 (00 op) - 0xE8, 0x07, 0x04, 0xA5, 0xA4, 0xA2, 0xBF, 0x1F, 0x0E, 0x84, 0x0, - }; - std::string expected((const char*)expected_data, sizeof(expected_data)); - - EXPECT_EQ(expected, decode_data.Data()); -} - - -// Death tests do not work on Windows as of yet. -#ifdef PROTOBUF_HAS_DEATH_TEST -TEST(ObjCHelperDeathTest, TextFormatDecodeData_Failures) { - TextFormatDecodeData decode_data; - - // Empty inputs. - - EXPECT_EXIT(decode_data.AddString(1, "", ""), - ::testing::KilledBySignal(SIGABRT), - "error: got empty string for making TextFormat data, input:"); - EXPECT_EXIT(decode_data.AddString(1, "a", ""), - ::testing::KilledBySignal(SIGABRT), - "error: got empty string for making TextFormat data, input:"); - EXPECT_EXIT(decode_data.AddString(1, "", "a"), - ::testing::KilledBySignal(SIGABRT), - "error: got empty string for making TextFormat data, input:"); - - // Null char in the string. - - std::string str_with_null_char("ab\0c", 4); - EXPECT_EXIT( - decode_data.AddString(1, str_with_null_char, "def"), - ::testing::KilledBySignal(SIGABRT), - "error: got a null char in a string for making TextFormat data, input:"); - EXPECT_EXIT( - decode_data.AddString(1, "def", str_with_null_char), - ::testing::KilledBySignal(SIGABRT), - "error: got a null char in a string for making TextFormat data, input:"); - - // Duplicate keys - - decode_data.AddString(1, "abcdefghIJ", "abcdefghIJ"); - decode_data.AddString(3, "abcdefghIJ", "_AbcdefghIJ"); - decode_data.AddString(2, "abcdefghIJ", "Abcd_EfghIJ"); - EXPECT_EXIT(decode_data.AddString(2, "xyz", "x_yz"), - ::testing::KilledBySignal(SIGABRT), - "error: duplicate key \\(2\\) making TextFormat data, input:"); -} -#endif // PROTOBUF_HAS_DEATH_TEST - -class TestLineCollector : public LineConsumer { - public: - TestLineCollector(std::vector* inout_lines, - const std::string* reject_line = nullptr, - bool skip_msg = false) - : lines_(inout_lines), reject_(reject_line), skip_msg_(skip_msg) {} - - bool ConsumeLine(const StringPiece& line, std::string* out_error) override { - if (reject_ && *reject_ == line) { - if (!skip_msg_) { - *out_error = std::string("Rejected '") + *reject_ + "'"; - } - return false; - } - if (lines_) { - lines_->emplace_back(line); - } - return true; - } - - private: - std::vector* lines_; - const std::string* reject_; - bool skip_msg_; -}; - -const int kBlockSizes[] = {-1, 1, 2, 5, 64}; -const int kBlockSizeCount = GOOGLE_ARRAYSIZE(kBlockSizes); - -TEST(ObjCHelper, ParseSimple_BasicsSuccess) { - const std::vector>> tests = { - {"", {}}, - {"a", {"a"}}, - {"a c", {"a c"}}, - {" a c ", {"a c"}}, - {"\ta c ", {"a c"}}, - {"abc\n", {"abc"}}, - {"abc\nd f", {"abc", "d f"}}, - {"\n abc \n def \n\n", {"abc", "def"}}, - }; - - for (const auto& test : tests) { - for (int i = 0; i < kBlockSizeCount; i++) { - io::ArrayInputStream input(test.first.data(), test.first.size(), kBlockSizes[i]); - std::string err_str; - std::vector lines; - TestLineCollector collector(&lines); - EXPECT_TRUE(ParseSimpleStream(input, "dummy", &collector, &err_str)); - EXPECT_EQ(lines, test.second); - EXPECT_TRUE(err_str.empty()); - } - } -} - -TEST(ObjCHelper, ParseSimple_DropsComments) { - const std::vector>> tests = { - {"# nothing", {}}, - {"#", {}}, - {"##", {}}, - {"\n# nothing\n", {}}, - {"a # same line", {"a"}}, - {"a # same line\n", {"a"}}, - {"a\n# line\nc", {"a", "c"}}, - {"# n o t # h i n g #", {}}, - {"## n o # t h i n g #", {}}, - {"a# n o t # h i n g #", {"a"}}, - {"a\n## n o # t h i n g #", {"a"}}, - }; - - for (const auto& test : tests) { - for (int i = 0; i < kBlockSizeCount; i++) { - io::ArrayInputStream input(test.first.data(), test.first.size(), kBlockSizes[i]); - std::string err_str; - std::vector lines; - TestLineCollector collector(&lines); - EXPECT_TRUE(ParseSimpleStream(input, "dummy", &collector, &err_str)); - EXPECT_EQ(lines, test.second); - EXPECT_TRUE(err_str.empty()); - } - } -} - -TEST(ObjCHelper, ParseSimple_RejectLines) { - const std::vector> tests = { - std::make_tuple("a\nb\nc", "a", 1), - std::make_tuple("a\nb\nc", "b", 2), - std::make_tuple("a\nb\nc", "c", 3), - std::make_tuple("a\nb\nc\n", "c", 3), - }; - - for (const auto& test : tests) { - for (int i = 0; i < kBlockSizeCount; i++) { - io::ArrayInputStream input(std::get<0>(test).data(), std::get<0>(test).size(), - kBlockSizes[i]); - std::string err_str; - TestLineCollector collector(nullptr, &std::get<1>(test)); - EXPECT_FALSE(ParseSimpleStream(input, "dummy", &collector, &err_str)); - std::string expected_err = - StrCat("error: dummy Line ", std::get<2>(test), ", Rejected '", std::get<1>(test), "'"); - EXPECT_EQ(err_str, expected_err); - } - } -} - -TEST(ObjCHelper, ParseSimple_RejectLinesNoMessage) { - const std::vector> tests = { - std::make_tuple("a\nb\nc", "a", 1), - std::make_tuple("a\nb\nc", "b", 2), - std::make_tuple("a\nb\nc", "c", 3), - std::make_tuple("a\nb\nc\n", "c", 3), - }; - - for (const auto& test : tests) { - for (int i = 0; i < kBlockSizeCount; i++) { - io::ArrayInputStream input(std::get<0>(test).data(), std::get<0>(test).size(), - kBlockSizes[i]); - std::string err_str; - TestLineCollector collector(nullptr, &std::get<1>(test), true /* skip msg */); - EXPECT_FALSE(ParseSimpleStream(input, "dummy", &collector, &err_str)); - std::string expected_err = - StrCat("error: dummy Line ", std::get<2>(test), - ", ConsumeLine failed without setting an error."); - EXPECT_EQ(err_str, expected_err); - } - } -} - -// TODO(thomasvl): Should probably add some unittests for all the special cases -// of name mangling (class name, field name, enum names). Rather than doing -// this with an ObjC test in the objectivec directory, we should be able to -// use src/google/protobuf/compiler/importer* (like other tests) to support a -// virtual file system to feed in protos, once we have the Descriptor tree, the -// tests could use the helper methods for generating names and validate the -// right things are happening. - -} // namespace -} // namespace objectivec -} // namespace compiler -} // namespace protobuf -} // namespace google diff --git a/extra/protobuf/protobuf-3.19.4/src/google/protobuf/compiler/objectivec/objectivec_map_field.cc b/extra/protobuf/protobuf-3.19.4/src/google/protobuf/compiler/objectivec/objectivec_map_field.cc deleted file mode 100644 index 746224ff86b2..000000000000 --- a/extra/protobuf/protobuf-3.19.4/src/google/protobuf/compiler/objectivec/objectivec_map_field.cc +++ /dev/null @@ -1,189 +0,0 @@ -// Protocol Buffers - Google's data interchange format -// Copyright 2015 Google Inc. All rights reserved. -// https://developers.google.com/protocol-buffers/ -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// * Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// * Redistributions in binary form must reproduce the above -// copyright notice, this list of conditions and the following disclaimer -// in the documentation and/or other materials provided with the -// distribution. -// * Neither the name of Google Inc. nor the names of its -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -#include -#include - -#include -#include -#include - -namespace google { -namespace protobuf { -namespace compiler { -namespace objectivec { - -// MapFieldGenerator uses RepeatedFieldGenerator as the parent because it -// provides a bunch of things (no has* methods, comments for contained type, -// etc.). - -namespace { - -const char* MapEntryTypeName(const FieldDescriptor* descriptor, bool isKey) { - ObjectiveCType type = GetObjectiveCType(descriptor); - switch (type) { - case OBJECTIVECTYPE_INT32: - return "Int32"; - case OBJECTIVECTYPE_UINT32: - return "UInt32"; - case OBJECTIVECTYPE_INT64: - return "Int64"; - case OBJECTIVECTYPE_UINT64: - return "UInt64"; - case OBJECTIVECTYPE_FLOAT: - return "Float"; - case OBJECTIVECTYPE_DOUBLE: - return "Double"; - case OBJECTIVECTYPE_BOOLEAN: - return "Bool"; - case OBJECTIVECTYPE_STRING: - return (isKey ? "String" : "Object"); - case OBJECTIVECTYPE_DATA: - return "Object"; - case OBJECTIVECTYPE_ENUM: - return "Enum"; - case OBJECTIVECTYPE_MESSAGE: - return "Object"; - } - - // Some compilers report reaching end of function even though all cases of - // the enum are handed in the switch. - GOOGLE_LOG(FATAL) << "Can't get here."; - return NULL; -} - -} // namespace - -MapFieldGenerator::MapFieldGenerator(const FieldDescriptor* descriptor, - const Options& options) - : RepeatedFieldGenerator(descriptor, options) { - const FieldDescriptor* key_descriptor = - descriptor->message_type()->map_key(); - const FieldDescriptor* value_descriptor = - descriptor->message_type()->map_value(); - value_field_generator_.reset(FieldGenerator::Make(value_descriptor, options)); - - // Pull over some variables_ from the value. - variables_["field_type"] = value_field_generator_->variable("field_type"); - variables_["default"] = value_field_generator_->variable("default"); - variables_["default_name"] = value_field_generator_->variable("default_name"); - - // Build custom field flags. - std::vector field_flags; - field_flags.push_back("GPBFieldMapKey" + GetCapitalizedType(key_descriptor)); - // Pull over the current text format custom name values that was calculated. - if (variables_["fieldflags"].find("GPBFieldTextFormatNameCustom") != - std::string::npos) { - field_flags.push_back("GPBFieldTextFormatNameCustom"); - } - // Pull over some info from the value's flags. - const std::string& value_field_flags = - value_field_generator_->variable("fieldflags"); - if (value_field_flags.find("GPBFieldHasDefaultValue") != std::string::npos) { - field_flags.push_back("GPBFieldHasDefaultValue"); - } - if (value_field_flags.find("GPBFieldHasEnumDescriptor") != - std::string::npos) { - field_flags.push_back("GPBFieldHasEnumDescriptor"); - } - - variables_["fieldflags"] = BuildFlagsString(FLAGTYPE_FIELD, field_flags); - - ObjectiveCType value_objc_type = GetObjectiveCType(value_descriptor); - const bool value_is_object_type = - ((value_objc_type == OBJECTIVECTYPE_STRING) || - (value_objc_type == OBJECTIVECTYPE_DATA) || - (value_objc_type == OBJECTIVECTYPE_MESSAGE)); - if ((GetObjectiveCType(key_descriptor) == OBJECTIVECTYPE_STRING) && - value_is_object_type) { - variables_["array_storage_type"] = "NSMutableDictionary"; - variables_["array_property_type"] = - "NSMutableDictionaryvariable("storage_type") + "*>"; - } else { - std::string class_name("GPB"); - class_name += MapEntryTypeName(key_descriptor, true); - class_name += MapEntryTypeName(value_descriptor, false); - class_name += "Dictionary"; - variables_["array_storage_type"] = class_name; - if (value_is_object_type) { - variables_["array_property_type"] = - class_name + "<" + - value_field_generator_->variable("storage_type") + "*>"; - } - } - - variables_["dataTypeSpecific_name"] = - value_field_generator_->variable("dataTypeSpecific_name"); - variables_["dataTypeSpecific_value"] = - value_field_generator_->variable("dataTypeSpecific_value"); -} - -MapFieldGenerator::~MapFieldGenerator() {} - -void MapFieldGenerator::FinishInitialization(void) { - RepeatedFieldGenerator::FinishInitialization(); - // Use the array_comment support in RepeatedFieldGenerator to output what the - // values in the map are. - const FieldDescriptor* value_descriptor = - descriptor_->message_type()->FindFieldByName("value"); - if (GetObjectiveCType(value_descriptor) == OBJECTIVECTYPE_ENUM) { - variables_["array_comment"] = - "// |" + variables_["name"] + "| values are |" + value_field_generator_->variable("storage_type") + "|\n"; - } -} - -void MapFieldGenerator::DetermineForwardDeclarations( - std::set* fwd_decls) const { - RepeatedFieldGenerator::DetermineForwardDeclarations(fwd_decls); - const FieldDescriptor* value_descriptor = - descriptor_->message_type()->FindFieldByName("value"); - if (GetObjectiveCType(value_descriptor) == OBJECTIVECTYPE_MESSAGE) { - const std::string& value_storage_type = - value_field_generator_->variable("storage_type"); - fwd_decls->insert("@class " + value_storage_type); - } -} - -void MapFieldGenerator::DetermineObjectiveCClassDefinitions( - std::set* fwd_decls) const { - // Class name is already in "storage_type". - const FieldDescriptor* value_descriptor = - descriptor_->message_type()->FindFieldByName("value"); - if (GetObjectiveCType(value_descriptor) == OBJECTIVECTYPE_MESSAGE) { - fwd_decls->insert(ObjCClassDeclaration( - value_field_generator_->variable("storage_type"))); - } -} - -} // namespace objectivec -} // namespace compiler -} // namespace protobuf -} // namespace google diff --git a/extra/protobuf/protobuf-3.19.4/src/google/protobuf/compiler/objectivec/objectivec_map_field.h b/extra/protobuf/protobuf-3.19.4/src/google/protobuf/compiler/objectivec/objectivec_map_field.h deleted file mode 100644 index 84eac6183a29..000000000000 --- a/extra/protobuf/protobuf-3.19.4/src/google/protobuf/compiler/objectivec/objectivec_map_field.h +++ /dev/null @@ -1,71 +0,0 @@ -// Protocol Buffers - Google's data interchange format -// Copyright 2015 Google Inc. All rights reserved. -// https://developers.google.com/protocol-buffers/ -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// * Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// * Redistributions in binary form must reproduce the above -// copyright notice, this list of conditions and the following disclaimer -// in the documentation and/or other materials provided with the -// distribution. -// * Neither the name of Google Inc. nor the names of its -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -#ifndef GOOGLE_PROTOBUF_COMPILER_OBJECTIVEC_MAP_FIELD_H__ -#define GOOGLE_PROTOBUF_COMPILER_OBJECTIVEC_MAP_FIELD_H__ - -#include -#include -#include - -namespace google { -namespace protobuf { -namespace compiler { -namespace objectivec { - -class MapFieldGenerator : public RepeatedFieldGenerator { - friend FieldGenerator* FieldGenerator::Make(const FieldDescriptor* field, - const Options& options); - - public: - virtual void FinishInitialization(void) override; - - MapFieldGenerator(const MapFieldGenerator&) = delete; - MapFieldGenerator& operator=(const MapFieldGenerator&) = delete; - - protected: - MapFieldGenerator(const FieldDescriptor* descriptor, const Options& options); - virtual ~MapFieldGenerator(); - - virtual void DetermineObjectiveCClassDefinitions( - std::set* fwd_decls) const override; - virtual void DetermineForwardDeclarations( - std::set* fwd_decls) const override; - - private: - std::unique_ptr value_field_generator_; -}; - -} // namespace objectivec -} // namespace compiler -} // namespace protobuf -} // namespace google - -#endif // GOOGLE_PROTOBUF_COMPILER_OBJECTIVEC_MAP_FIELD_H__ diff --git a/extra/protobuf/protobuf-3.19.4/src/google/protobuf/compiler/objectivec/objectivec_message.cc b/extra/protobuf/protobuf-3.19.4/src/google/protobuf/compiler/objectivec/objectivec_message.cc deleted file mode 100644 index 3a00113f3262..000000000000 --- a/extra/protobuf/protobuf-3.19.4/src/google/protobuf/compiler/objectivec/objectivec_message.cc +++ /dev/null @@ -1,636 +0,0 @@ -// Protocol Buffers - Google's data interchange format -// Copyright 2008 Google Inc. All rights reserved. -// https://developers.google.com/protocol-buffers/ -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// * Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// * Redistributions in binary form must reproduce the above -// copyright notice, this list of conditions and the following disclaimer -// in the documentation and/or other materials provided with the -// distribution. -// * Neither the name of Google Inc. nor the names of its -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -#include -#include -#include - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -namespace google { -namespace protobuf { -namespace compiler { -namespace objectivec { - -namespace { -struct FieldOrderingByNumber { - inline bool operator()(const FieldDescriptor* a, - const FieldDescriptor* b) const { - return a->number() < b->number(); - } -}; - -int OrderGroupForFieldDescriptor(const FieldDescriptor* descriptor) { - // The first item in the object structure is our uint32[] for has bits. - // We then want to order things to make the instances as small as - // possible. So we follow the has bits with: - // 1. Anything always 4 bytes - float, *32, enums - // 2. Anything that is always a pointer (they will be 8 bytes on 64 bit - // builds and 4 bytes on 32bit builds. - // 3. Anything always 8 bytes - double, *64 - // - // NOTE: Bools aren't listed, they were stored in the has bits. - // - // Why? Using 64bit builds as an example, this means worse case, we have - // enough bools that we overflow 1 byte from 4 byte alignment, so 3 bytes - // are wasted before the 4 byte values. Then if we have an odd number of - // those 4 byte values, the 8 byte values will be pushed down by 32bits to - // keep them aligned. But the structure will end 8 byte aligned, so no - // waste on the end. If you did the reverse order, you could waste 4 bytes - // before the first 8 byte value (after the has array), then a single - // bool on the end would need 7 bytes of padding to make the overall - // structure 8 byte aligned; so 11 bytes, wasted total. - - // Anything repeated is a GPB*Array/NSArray, so pointer. - if (descriptor->is_repeated()) { - return 3; - } - - switch (descriptor->type()) { - // All always 8 bytes. - case FieldDescriptor::TYPE_DOUBLE: - case FieldDescriptor::TYPE_INT64: - case FieldDescriptor::TYPE_SINT64: - case FieldDescriptor::TYPE_UINT64: - case FieldDescriptor::TYPE_SFIXED64: - case FieldDescriptor::TYPE_FIXED64: - return 4; - - // Pointers (string and bytes are NSString and NSData); 8 or 4 bytes - // depending on the build architecture. - case FieldDescriptor::TYPE_GROUP: - case FieldDescriptor::TYPE_MESSAGE: - case FieldDescriptor::TYPE_STRING: - case FieldDescriptor::TYPE_BYTES: - return 3; - - // All always 4 bytes (enums are int32s). - case FieldDescriptor::TYPE_FLOAT: - case FieldDescriptor::TYPE_INT32: - case FieldDescriptor::TYPE_SINT32: - case FieldDescriptor::TYPE_UINT32: - case FieldDescriptor::TYPE_SFIXED32: - case FieldDescriptor::TYPE_FIXED32: - case FieldDescriptor::TYPE_ENUM: - return 2; - - // 0 bytes. Stored in the has bits. - case FieldDescriptor::TYPE_BOOL: - return 99; // End of the list (doesn't really matter). - } - - // Some compilers report reaching end of function even though all cases of - // the enum are handed in the switch. - GOOGLE_LOG(FATAL) << "Can't get here."; - return 0; -} - -struct FieldOrderingByStorageSize { - inline bool operator()(const FieldDescriptor* a, - const FieldDescriptor* b) const { - // Order by grouping. - const int order_group_a = OrderGroupForFieldDescriptor(a); - const int order_group_b = OrderGroupForFieldDescriptor(b); - if (order_group_a != order_group_b) { - return order_group_a < order_group_b; - } - // Within the group, order by field number (provides stable ordering). - return a->number() < b->number(); - } -}; - -struct ExtensionRangeOrdering { - bool operator()(const Descriptor::ExtensionRange* a, - const Descriptor::ExtensionRange* b) const { - return a->start < b->start; - } -}; - -// Sort the fields of the given Descriptor by number into a new[]'d array -// and return it. -const FieldDescriptor** SortFieldsByNumber(const Descriptor* descriptor) { - const FieldDescriptor** fields = - new const FieldDescriptor* [descriptor->field_count()]; - for (int i = 0; i < descriptor->field_count(); i++) { - fields[i] = descriptor->field(i); - } - std::sort(fields, fields + descriptor->field_count(), FieldOrderingByNumber()); - return fields; -} - -// Sort the fields of the given Descriptor by storage size into a new[]'d -// array and return it. -const FieldDescriptor** SortFieldsByStorageSize(const Descriptor* descriptor) { - const FieldDescriptor** fields = - new const FieldDescriptor* [descriptor->field_count()]; - for (int i = 0; i < descriptor->field_count(); i++) { - fields[i] = descriptor->field(i); - } - std::sort(fields, fields + descriptor->field_count(), - FieldOrderingByStorageSize()); - return fields; -} -} // namespace - -MessageGenerator::MessageGenerator(const std::string& root_classname, - const Descriptor* descriptor, - const Options& options) - : root_classname_(root_classname), - descriptor_(descriptor), - field_generators_(descriptor, options), - class_name_(ClassName(descriptor_)), - deprecated_attribute_(GetOptionalDeprecatedAttribute( - descriptor, descriptor->file(), false, true)) { - for (int i = 0; i < descriptor_->extension_count(); i++) { - extension_generators_.emplace_back( - new ExtensionGenerator(class_name_, descriptor_->extension(i))); - } - - for (int i = 0; i < descriptor_->real_oneof_decl_count(); i++) { - OneofGenerator* generator = new OneofGenerator(descriptor_->oneof_decl(i)); - oneof_generators_.emplace_back(generator); - } - - for (int i = 0; i < descriptor_->enum_type_count(); i++) { - EnumGenerator* generator = new EnumGenerator(descriptor_->enum_type(i)); - enum_generators_.emplace_back(generator); - } - - for (int i = 0; i < descriptor_->nested_type_count(); i++) { - MessageGenerator* generator = - new MessageGenerator(root_classname_, - descriptor_->nested_type(i), - options); - nested_message_generators_.emplace_back(generator); - } -} - -MessageGenerator::~MessageGenerator() {} - -void MessageGenerator::GenerateStaticVariablesInitialization( - io::Printer* printer) { - for (const auto& generator : extension_generators_) { - generator->GenerateStaticVariablesInitialization(printer); - } - - for (const auto& generator : nested_message_generators_) { - generator->GenerateStaticVariablesInitialization(printer); - } -} - -void MessageGenerator::DetermineForwardDeclarations( - std::set* fwd_decls) { - if (!IsMapEntryMessage(descriptor_)) { - for (int i = 0; i < descriptor_->field_count(); i++) { - const FieldDescriptor* fieldDescriptor = descriptor_->field(i); - field_generators_.get(fieldDescriptor) - .DetermineForwardDeclarations(fwd_decls); - } - } - - for (const auto& generator : nested_message_generators_) { - generator->DetermineForwardDeclarations(fwd_decls); - } -} - -void MessageGenerator::DetermineObjectiveCClassDefinitions( - std::set* fwd_decls) { - if (!IsMapEntryMessage(descriptor_)) { - for (int i = 0; i < descriptor_->field_count(); i++) { - const FieldDescriptor* fieldDescriptor = descriptor_->field(i); - field_generators_.get(fieldDescriptor) - .DetermineObjectiveCClassDefinitions(fwd_decls); - } - } - - for (const auto& generator : extension_generators_) { - generator->DetermineObjectiveCClassDefinitions(fwd_decls); - } - - for (const auto& generator : nested_message_generators_) { - generator->DetermineObjectiveCClassDefinitions(fwd_decls); - } - - const Descriptor* containing_descriptor = descriptor_->containing_type(); - if (containing_descriptor != NULL) { - std::string containing_class = ClassName(containing_descriptor); - fwd_decls->insert(ObjCClassDeclaration(containing_class)); - } -} - -bool MessageGenerator::IncludesOneOfDefinition() const { - if (!oneof_generators_.empty()) { - return true; - } - - for (const auto& generator : nested_message_generators_) { - if (generator->IncludesOneOfDefinition()) { - return true; - } - } - - return false; -} - -void MessageGenerator::GenerateEnumHeader(io::Printer* printer) { - for (const auto& generator : enum_generators_) { - generator->GenerateHeader(printer); - } - - for (const auto& generator : nested_message_generators_) { - generator->GenerateEnumHeader(printer); - } -} - -void MessageGenerator::GenerateExtensionRegistrationSource( - io::Printer* printer) { - for (const auto& generator : extension_generators_) { - generator->GenerateRegistrationSource(printer); - } - - for (const auto& generator : nested_message_generators_) { - generator->GenerateExtensionRegistrationSource(printer); - } -} - -void MessageGenerator::GenerateMessageHeader(io::Printer* printer) { - // This a a map entry message, just recurse and do nothing directly. - if (IsMapEntryMessage(descriptor_)) { - for (const auto& generator : nested_message_generators_) { - generator->GenerateMessageHeader(printer); - } - return; - } - - printer->Print( - "#pragma mark - $classname$\n" - "\n", - "classname", class_name_); - - if (descriptor_->field_count()) { - std::unique_ptr sorted_fields( - SortFieldsByNumber(descriptor_)); - - printer->Print("typedef GPB_ENUM($classname$_FieldNumber) {\n", - "classname", class_name_); - printer->Indent(); - - for (int i = 0; i < descriptor_->field_count(); i++) { - field_generators_.get(sorted_fields[i]) - .GenerateFieldNumberConstant(printer); - } - - printer->Outdent(); - printer->Print("};\n\n"); - } - - for (const auto& generator : oneof_generators_) { - generator->GenerateCaseEnum(printer); - } - - std::string message_comments; - SourceLocation location; - if (descriptor_->GetSourceLocation(&location)) { - message_comments = BuildCommentsString(location, false); - } else { - message_comments = ""; - } - - printer->Print( - "$comments$$deprecated_attribute$GPB_FINAL @interface $classname$ : GPBMessage\n\n", - "classname", class_name_, - "deprecated_attribute", deprecated_attribute_, - "comments", message_comments); - - std::vector seen_oneofs(oneof_generators_.size(), 0); - for (int i = 0; i < descriptor_->field_count(); i++) { - const FieldDescriptor* field = descriptor_->field(i); - const OneofDescriptor* oneof = field->real_containing_oneof(); - if (oneof) { - const int oneof_index = oneof->index(); - if (!seen_oneofs[oneof_index]) { - seen_oneofs[oneof_index] = 1; - oneof_generators_[oneof_index]->GeneratePublicCasePropertyDeclaration( - printer); - } - } - field_generators_.get(field).GeneratePropertyDeclaration(printer); - } - - printer->Print("@end\n\n"); - - for (int i = 0; i < descriptor_->field_count(); i++) { - field_generators_.get(descriptor_->field(i)) - .GenerateCFunctionDeclarations(printer); - } - - if (!oneof_generators_.empty()) { - for (const auto& generator : oneof_generators_) { - generator->GenerateClearFunctionDeclaration(printer); - } - printer->Print("\n"); - } - - if (descriptor_->extension_count() > 0) { - printer->Print("@interface $classname$ (DynamicMethods)\n\n", - "classname", class_name_); - for (const auto& generator : extension_generators_) { - generator->GenerateMembersHeader(printer); - } - printer->Print("@end\n\n"); - } - - for (const auto& generator : nested_message_generators_) { - generator->GenerateMessageHeader(printer); - } -} - -void MessageGenerator::GenerateSource(io::Printer* printer) { - if (!IsMapEntryMessage(descriptor_)) { - printer->Print( - "#pragma mark - $classname$\n" - "\n", - "classname", class_name_); - - if (!deprecated_attribute_.empty()) { - // No warnings when compiling the impl of this deprecated class. - printer->Print( - "#pragma clang diagnostic push\n" - "#pragma clang diagnostic ignored \"-Wdeprecated-implementations\"\n" - "\n"); - } - - printer->Print("@implementation $classname$\n\n", - "classname", class_name_); - - for (const auto& generator : oneof_generators_) { - generator->GeneratePropertyImplementation(printer); - } - - for (int i = 0; i < descriptor_->field_count(); i++) { - field_generators_.get(descriptor_->field(i)) - .GeneratePropertyImplementation(printer); - } - - std::unique_ptr sorted_fields( - SortFieldsByNumber(descriptor_)); - std::unique_ptr size_order_fields( - SortFieldsByStorageSize(descriptor_)); - - std::vector sorted_extensions; - sorted_extensions.reserve(descriptor_->extension_range_count()); - for (int i = 0; i < descriptor_->extension_range_count(); ++i) { - sorted_extensions.push_back(descriptor_->extension_range(i)); - } - - std::sort(sorted_extensions.begin(), sorted_extensions.end(), - ExtensionRangeOrdering()); - - // Assign has bits: - // 1. FieldGeneratorMap::CalculateHasBits() loops through the fields seeing - // who needs has bits and assigning them. - // 2. FieldGenerator::SetOneofIndexBase() overrides has_bit with a negative - // index that groups all the elements in the oneof. - size_t num_has_bits = field_generators_.CalculateHasBits(); - size_t sizeof_has_storage = (num_has_bits + 31) / 32; - if (sizeof_has_storage == 0) { - // In the case where no field needs has bits, don't let the _has_storage_ - // end up as zero length (zero length arrays are sort of a grey area - // since it has to be at the start of the struct). This also ensures a - // field with only oneofs keeps the required negative indices they need. - sizeof_has_storage = 1; - } - // Tell all the fields the oneof base. - for (const auto& generator : oneof_generators_) { - generator->SetOneofIndexBase(sizeof_has_storage); - } - field_generators_.SetOneofIndexBase(sizeof_has_storage); - // sizeof_has_storage needs enough bits for the single fields that aren't in - // any oneof, and then one int32 for each oneof (to store the field number). - sizeof_has_storage += oneof_generators_.size(); - - printer->Print( - "\n" - "typedef struct $classname$__storage_ {\n" - " uint32_t _has_storage_[$sizeof_has_storage$];\n", - "classname", class_name_, - "sizeof_has_storage", StrCat(sizeof_has_storage)); - printer->Indent(); - - for (int i = 0; i < descriptor_->field_count(); i++) { - field_generators_.get(size_order_fields[i]) - .GenerateFieldStorageDeclaration(printer); - } - printer->Outdent(); - - printer->Print("} $classname$__storage_;\n\n", "classname", class_name_); - - - printer->Print( - "// This method is threadsafe because it is initially called\n" - "// in +initialize for each subclass.\n" - "+ (GPBDescriptor *)descriptor {\n" - " static GPBDescriptor *descriptor = nil;\n" - " if (!descriptor) {\n"); - - TextFormatDecodeData text_format_decode_data; - bool has_fields = descriptor_->field_count() > 0; - bool need_defaults = field_generators_.DoesAnyFieldHaveNonZeroDefault(); - std::string field_description_type; - if (need_defaults) { - field_description_type = "GPBMessageFieldDescriptionWithDefault"; - } else { - field_description_type = "GPBMessageFieldDescription"; - } - if (has_fields) { - printer->Indent(); - printer->Indent(); - printer->Print( - "static $field_description_type$ fields[] = {\n", - "field_description_type", field_description_type); - printer->Indent(); - for (int i = 0; i < descriptor_->field_count(); ++i) { - const FieldGenerator& field_generator = - field_generators_.get(sorted_fields[i]); - field_generator.GenerateFieldDescription(printer, need_defaults); - if (field_generator.needs_textformat_name_support()) { - text_format_decode_data.AddString(sorted_fields[i]->number(), - field_generator.generated_objc_name(), - field_generator.raw_field_name()); - } - } - printer->Outdent(); - printer->Print( - "};\n"); - printer->Outdent(); - printer->Outdent(); - } - - std::map vars; - vars["classname"] = class_name_; - vars["rootclassname"] = root_classname_; - vars["fields"] = has_fields ? "fields" : "NULL"; - if (has_fields) { - vars["fields_count"] = - "(uint32_t)(sizeof(fields) / sizeof(" + field_description_type + "))"; - } else { - vars["fields_count"] = "0"; - } - - std::vector init_flags; - init_flags.push_back("GPBDescriptorInitializationFlag_UsesClassRefs"); - init_flags.push_back("GPBDescriptorInitializationFlag_Proto3OptionalKnown"); - if (need_defaults) { - init_flags.push_back("GPBDescriptorInitializationFlag_FieldsWithDefault"); - } - if (descriptor_->options().message_set_wire_format()) { - init_flags.push_back("GPBDescriptorInitializationFlag_WireFormat"); - } - vars["init_flags"] = BuildFlagsString(FLAGTYPE_DESCRIPTOR_INITIALIZATION, - init_flags); - - printer->Print( - vars, - " GPBDescriptor *localDescriptor =\n" - " [GPBDescriptor allocDescriptorForClass:[$classname$ class]\n" - " rootClass:[$rootclassname$ class]\n" - " file:$rootclassname$_FileDescriptor()\n" - " fields:$fields$\n" - " fieldCount:$fields_count$\n" - " storageSize:sizeof($classname$__storage_)\n" - " flags:$init_flags$];\n"); - if (!oneof_generators_.empty()) { - printer->Print( - " static const char *oneofs[] = {\n"); - for (const auto& generator : oneof_generators_) { - printer->Print(" \"$name$\",\n", "name", - generator->DescriptorName()); - } - printer->Print( - " };\n" - " [localDescriptor setupOneofs:oneofs\n" - " count:(uint32_t)(sizeof(oneofs) / sizeof(char*))\n" - " firstHasIndex:$first_has_index$];\n", - "first_has_index", oneof_generators_[0]->HasIndexAsString()); - } - if (text_format_decode_data.num_entries() != 0) { - const std::string text_format_data_str(text_format_decode_data.Data()); - printer->Print( - "#if !GPBOBJC_SKIP_MESSAGE_TEXTFORMAT_EXTRAS\n" - " static const char *extraTextFormatInfo ="); - static const int kBytesPerLine = 40; // allow for escaping - for (int i = 0; i < text_format_data_str.size(); i += kBytesPerLine) { - printer->Print( - "\n \"$data$\"", - "data", EscapeTrigraphs( - CEscape(text_format_data_str.substr(i, kBytesPerLine)))); - } - printer->Print( - ";\n" - " [localDescriptor setupExtraTextInfo:extraTextFormatInfo];\n" - "#endif // !GPBOBJC_SKIP_MESSAGE_TEXTFORMAT_EXTRAS\n"); - } - if (!sorted_extensions.empty()) { - printer->Print( - " static const GPBExtensionRange ranges[] = {\n"); - for (int i = 0; i < sorted_extensions.size(); i++) { - printer->Print(" { .start = $start$, .end = $end$ },\n", - "start", StrCat(sorted_extensions[i]->start), - "end", StrCat(sorted_extensions[i]->end)); - } - printer->Print( - " };\n" - " [localDescriptor setupExtensionRanges:ranges\n" - " count:(uint32_t)(sizeof(ranges) / sizeof(GPBExtensionRange))];\n"); - } - if (descriptor_->containing_type() != NULL) { - std::string containing_class = ClassName(descriptor_->containing_type()); - std::string parent_class_ref = ObjCClass(containing_class); - printer->Print( - " [localDescriptor setupContainingMessageClass:$parent_class_ref$];\n", - "parent_class_ref", parent_class_ref); - } - std::string suffix_added; - ClassName(descriptor_, &suffix_added); - if (!suffix_added.empty()) { - printer->Print( - " [localDescriptor setupMessageClassNameSuffix:@\"$suffix$\"];\n", - "suffix", suffix_added); - } - printer->Print( - " #if defined(DEBUG) && DEBUG\n" - " NSAssert(descriptor == nil, @\"Startup recursed!\");\n" - " #endif // DEBUG\n" - " descriptor = localDescriptor;\n" - " }\n" - " return descriptor;\n" - "}\n\n" - "@end\n\n"); - - if (!deprecated_attribute_.empty()) { - printer->Print( - "#pragma clang diagnostic pop\n" - "\n"); - } - - for (int i = 0; i < descriptor_->field_count(); i++) { - field_generators_.get(descriptor_->field(i)) - .GenerateCFunctionImplementations(printer); - } - - for (const auto& generator : oneof_generators_) { - generator->GenerateClearFunctionImplementation(printer); - } - } - - for (const auto& generator : enum_generators_) { - generator->GenerateSource(printer); - } - - for (const auto& generator : nested_message_generators_) { - generator->GenerateSource(printer); - } -} - -} // namespace objectivec -} // namespace compiler -} // namespace protobuf -} // namespace google diff --git a/extra/protobuf/protobuf-3.19.4/src/google/protobuf/compiler/objectivec/objectivec_message.h b/extra/protobuf/protobuf-3.19.4/src/google/protobuf/compiler/objectivec/objectivec_message.h deleted file mode 100644 index 01108d29e75a..000000000000 --- a/extra/protobuf/protobuf-3.19.4/src/google/protobuf/compiler/objectivec/objectivec_message.h +++ /dev/null @@ -1,99 +0,0 @@ -// Protocol Buffers - Google's data interchange format -// Copyright 2008 Google Inc. All rights reserved. -// https://developers.google.com/protocol-buffers/ -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// * Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// * Redistributions in binary form must reproduce the above -// copyright notice, this list of conditions and the following disclaimer -// in the documentation and/or other materials provided with the -// distribution. -// * Neither the name of Google Inc. nor the names of its -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -#ifndef GOOGLE_PROTOBUF_COMPILER_OBJECTIVEC_MESSAGE_H__ -#define GOOGLE_PROTOBUF_COMPILER_OBJECTIVEC_MESSAGE_H__ - -#include -#include -#include -#include -#include -#include -#include -#include - -namespace google { -namespace protobuf { -namespace compiler { -namespace objectivec { - -class ExtensionGenerator; -class EnumGenerator; - -class MessageGenerator { - public: - MessageGenerator(const std::string& root_classname, - const Descriptor* descriptor, const Options& options); - ~MessageGenerator(); - - MessageGenerator(const MessageGenerator&) = delete; - MessageGenerator& operator=(const MessageGenerator&) = delete; - - void GenerateStaticVariablesInitialization(io::Printer* printer); - void GenerateEnumHeader(io::Printer* printer); - void GenerateMessageHeader(io::Printer* printer); - void GenerateSource(io::Printer* printer); - void GenerateExtensionRegistrationSource(io::Printer* printer); - void DetermineObjectiveCClassDefinitions(std::set* fwd_decls); - void DetermineForwardDeclarations(std::set* fwd_decls); - - // Checks if the message or a nested message includes a oneof definition. - bool IncludesOneOfDefinition() const; - - private: - void GenerateParseFromMethodsHeader(io::Printer* printer); - - void GenerateSerializeOneFieldSource(io::Printer* printer, - const FieldDescriptor* field); - void GenerateSerializeOneExtensionRangeSource( - io::Printer* printer, const Descriptor::ExtensionRange* range); - - void GenerateMessageDescriptionSource(io::Printer* printer); - void GenerateDescriptionOneFieldSource(io::Printer* printer, - const FieldDescriptor* field); - - const std::string root_classname_; - const Descriptor* descriptor_; - FieldGeneratorMap field_generators_; - const std::string class_name_; - const std::string deprecated_attribute_; - std::vector> extension_generators_; - std::vector> enum_generators_; - std::vector> nested_message_generators_; - std::vector> oneof_generators_; -}; - -} // namespace objectivec -} // namespace compiler -} // namespace protobuf -} // namespace google - -#endif // GOOGLE_PROTOBUF_COMPILER_OBJECTIVEC_MESSAGE_H__ diff --git a/extra/protobuf/protobuf-3.19.4/src/google/protobuf/compiler/objectivec/objectivec_message_field.cc b/extra/protobuf/protobuf-3.19.4/src/google/protobuf/compiler/objectivec/objectivec_message_field.cc deleted file mode 100644 index 299a20b152ee..000000000000 --- a/extra/protobuf/protobuf-3.19.4/src/google/protobuf/compiler/objectivec/objectivec_message_field.cc +++ /dev/null @@ -1,107 +0,0 @@ -// Protocol Buffers - Google's data interchange format -// Copyright 2008 Google Inc. All rights reserved. -// https://developers.google.com/protocol-buffers/ -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// * Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// * Redistributions in binary form must reproduce the above -// copyright notice, this list of conditions and the following disclaimer -// in the documentation and/or other materials provided with the -// distribution. -// * Neither the name of Google Inc. nor the names of its -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -#include -#include - -#include -#include -#include -#include - -namespace google { -namespace protobuf { -namespace compiler { -namespace objectivec { - -namespace { - -void SetMessageVariables(const FieldDescriptor* descriptor, - std::map* variables) { - const std::string& message_type = ClassName(descriptor->message_type()); - const std::string& containing_class = - ClassName(descriptor->containing_type()); - (*variables)["type"] = message_type; - (*variables)["containing_class"] = containing_class; - (*variables)["storage_type"] = message_type; - (*variables)["group_or_message"] = - (descriptor->type() == FieldDescriptor::TYPE_GROUP) ? "Group" : "Message"; - (*variables)["dataTypeSpecific_value"] = ObjCClass(message_type); -} - -} // namespace - -MessageFieldGenerator::MessageFieldGenerator(const FieldDescriptor* descriptor, - const Options& options) - : ObjCObjFieldGenerator(descriptor, options) { - SetMessageVariables(descriptor, &variables_); -} - -MessageFieldGenerator::~MessageFieldGenerator() {} - -void MessageFieldGenerator::DetermineForwardDeclarations( - std::set* fwd_decls) const { - ObjCObjFieldGenerator::DetermineForwardDeclarations(fwd_decls); - // Class name is already in "storage_type". - fwd_decls->insert("@class " + variable("storage_type")); -} - -void MessageFieldGenerator::DetermineObjectiveCClassDefinitions( - std::set* fwd_decls) const { - fwd_decls->insert(ObjCClassDeclaration(variable("storage_type"))); -} - -RepeatedMessageFieldGenerator::RepeatedMessageFieldGenerator( - const FieldDescriptor* descriptor, const Options& options) - : RepeatedFieldGenerator(descriptor, options) { - SetMessageVariables(descriptor, &variables_); - variables_["array_storage_type"] = "NSMutableArray"; - variables_["array_property_type"] = - "NSMutableArray<" + variables_["storage_type"] + "*>"; -} - -RepeatedMessageFieldGenerator::~RepeatedMessageFieldGenerator() {} - -void RepeatedMessageFieldGenerator::DetermineForwardDeclarations( - std::set* fwd_decls) const { - RepeatedFieldGenerator::DetermineForwardDeclarations(fwd_decls); - // Class name is already in "storage_type". - fwd_decls->insert("@class " + variable("storage_type")); -} - -void RepeatedMessageFieldGenerator::DetermineObjectiveCClassDefinitions( - std::set* fwd_decls) const { - fwd_decls->insert(ObjCClassDeclaration(variable("storage_type"))); -} - -} // namespace objectivec -} // namespace compiler -} // namespace protobuf -} // namespace google diff --git a/extra/protobuf/protobuf-3.19.4/src/google/protobuf/compiler/objectivec/objectivec_message_field.h b/extra/protobuf/protobuf-3.19.4/src/google/protobuf/compiler/objectivec/objectivec_message_field.h deleted file mode 100644 index 01799a120b3f..000000000000 --- a/extra/protobuf/protobuf-3.19.4/src/google/protobuf/compiler/objectivec/objectivec_message_field.h +++ /dev/null @@ -1,87 +0,0 @@ -// Protocol Buffers - Google's data interchange format -// Copyright 2008 Google Inc. All rights reserved. -// https://developers.google.com/protocol-buffers/ -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// * Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// * Redistributions in binary form must reproduce the above -// copyright notice, this list of conditions and the following disclaimer -// in the documentation and/or other materials provided with the -// distribution. -// * Neither the name of Google Inc. nor the names of its -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -#ifndef GOOGLE_PROTOBUF_COMPILER_OBJECTIVEC_MESSAGE_FIELD_H__ -#define GOOGLE_PROTOBUF_COMPILER_OBJECTIVEC_MESSAGE_FIELD_H__ - -#include -#include -#include - -namespace google { -namespace protobuf { -namespace compiler { -namespace objectivec { - -class MessageFieldGenerator : public ObjCObjFieldGenerator { - friend FieldGenerator* FieldGenerator::Make(const FieldDescriptor* field, - const Options& options); - - protected: - MessageFieldGenerator(const FieldDescriptor* descriptor, - const Options& options); - - MessageFieldGenerator(const MessageFieldGenerator&) = delete; - MessageFieldGenerator& operator=(const MessageFieldGenerator&) = delete; - - virtual ~MessageFieldGenerator(); - - public: - virtual void DetermineForwardDeclarations( - std::set* fwd_decls) const override; - virtual void DetermineObjectiveCClassDefinitions( - std::set* fwd_decls) const override; -}; - -class RepeatedMessageFieldGenerator : public RepeatedFieldGenerator { - friend FieldGenerator* FieldGenerator::Make(const FieldDescriptor* field, - const Options& options); - - protected: - RepeatedMessageFieldGenerator(const FieldDescriptor* descriptor, - const Options& options); - virtual ~RepeatedMessageFieldGenerator(); - - RepeatedMessageFieldGenerator(const RepeatedMessageFieldGenerator&) = delete; - RepeatedMessageFieldGenerator operator=(const RepeatedMessageFieldGenerator&) = delete; - - public: - virtual void DetermineForwardDeclarations( - std::set* fwd_decls) const override; - virtual void DetermineObjectiveCClassDefinitions( - std::set* fwd_decls) const override; -}; - -} // namespace objectivec -} // namespace compiler -} // namespace protobuf -} // namespace google - -#endif // GOOGLE_PROTOBUF_COMPILER_OBJECTIVEC_MESSAGE_FIELD_H__ diff --git a/extra/protobuf/protobuf-3.19.4/src/google/protobuf/compiler/objectivec/objectivec_nsobject_methods.h b/extra/protobuf/protobuf-3.19.4/src/google/protobuf/compiler/objectivec/objectivec_nsobject_methods.h deleted file mode 100644 index 163304665cb3..000000000000 --- a/extra/protobuf/protobuf-3.19.4/src/google/protobuf/compiler/objectivec/objectivec_nsobject_methods.h +++ /dev/null @@ -1,197 +0,0 @@ -// NSObject methods -// Autogenerated by method_dump.sh. Do not edit by hand. -// Date: Thu Nov 1 14:12:16 PDT 2018 -// macOS: MacOSX10.14.sdk -// iOS: iPhoneSimulator12.1.sdk - -const char* const kNSObjectMethodsList[] = { - "CAMLType", - "CA_copyRenderValue", - "CA_prepareRenderValue", - "NS_copyCGImage", - "NS_tiledLayerVisibleRect", - "___tryRetain_OA", - "__autorelease_OA", - "__dealloc_zombie", - "__release_OA", - "__retain_OA", - "_accessibilityFinalize", - "_accessibilityIsTableViewDescendant", - "_accessibilityUIElementSpecifier", - "_accessibilityUseConvenienceAPI", - "_allowsDirectEncoding", - "_asScriptTerminologyNameArray", - "_asScriptTerminologyNameString", - "_bindingAdaptor", - "_cfTypeID", - "_copyDescription", - "_destroyObserverList", - "_didEndKeyValueObserving", - "_implicitObservationInfo", - "_internalAccessibilityAttributedHint", - "_internalAccessibilityAttributedLabel", - "_internalAccessibilityAttributedValue", - "_isAXConnector", - "_isAccessibilityContainerSectionCandidate", - "_isAccessibilityContentNavigatorSectionCandidate", - "_isAccessibilityContentSectionCandidate", - "_isAccessibilityTopLevelNavigatorSectionCandidate", - "_isDeallocating", - "_isKVOA", - "_isToManyChangeInformation", - "_ivarDescription", - "_localClassNameForClass", - "_methodDescription", - "_observerStorage", - "_overrideUseFastBlockObservers", - "_propertyDescription", - "_releaseBindingAdaptor", - "_scriptingCount", - "_scriptingCountNonrecursively", - "_scriptingDebugDescription", - "_scriptingExists", - "_scriptingShouldCheckObjectIndexes", - "_shortMethodDescription", - "_shouldSearchChildrenForSection", - "_traitStorageList", - "_tryRetain", - "_ui_descriptionBuilder", - "_uikit_variesByTraitCollections", - "_web_description", - "_webkit_invokeOnMainThread", - "_willBeginKeyValueObserving", - "accessibilityActivate", - "accessibilityActivationPoint", - "accessibilityAllowsOverriddenAttributesWhenIgnored", - "accessibilityAssistiveTechnologyFocusedIdentifiers", - "accessibilityAttributedHint", - "accessibilityAttributedLabel", - "accessibilityAttributedValue", - "accessibilityContainer", - "accessibilityContainerType", - "accessibilityCustomActions", - "accessibilityCustomRotors", - "accessibilityDecrement", - "accessibilityDragSourceDescriptors", - "accessibilityDropPointDescriptors", - "accessibilityElementCount", - "accessibilityElementDidBecomeFocused", - "accessibilityElementDidLoseFocus", - "accessibilityElementIsFocused", - "accessibilityElements", - "accessibilityElementsHidden", - "accessibilityFrame", - "accessibilityHeaderElements", - "accessibilityHint", - "accessibilityIdentification", - "accessibilityIdentifier", - "accessibilityIncrement", - "accessibilityLabel", - "accessibilityLanguage", - "accessibilityLocalizedStringKey", - "accessibilityNavigationStyle", - "accessibilityOverriddenAttributes", - "accessibilityParameterizedAttributeNames", - "accessibilityPath", - "accessibilityPerformEscape", - "accessibilityPerformMagicTap", - "accessibilityPresenterProcessIdentifier", - "accessibilityShouldUseUniqueId", - "accessibilitySupportsNotifications", - "accessibilitySupportsOverriddenAttributes", - "accessibilityTemporaryChildren", - "accessibilityTraits", - "accessibilityValue", - "accessibilityViewIsModal", - "accessibilityVisibleArea", - "allPropertyKeys", - "allowsWeakReference", - "attributeKeys", - "autoContentAccessingProxy", - "autorelease", - "awakeFromNib", - "boolValueSafe", - "bs_encoded", - "bs_isPlistableType", - "bs_secureEncoded", - "cl_json_serializeKey", - "class", - "classCode", - "classDescription", - "classForArchiver", - "classForCoder", - "classForKeyedArchiver", - "classForPortCoder", - "className", - "clearProperties", - "copy", - "dealloc", - "debugDescription", - "defaultAccessibilityTraits", - "description", - "doubleValueSafe", - "entityName", - "exposedBindings", - "finalize", - "finishObserving", - "flushKeyBindings", - "hash", - "init", - "int64ValueSafe", - "isAccessibilityElement", - "isAccessibilityElementByDefault", - "isElementAccessibilityExposedToInterfaceBuilder", - "isFault", - "isNSArray__", - "isNSCFConstantString__", - "isNSData__", - "isNSDate__", - "isNSDictionary__", - "isNSNumber__", - "isNSObject__", - "isNSOrderedSet__", - "isNSSet__", - "isNSString__", - "isNSTimeZone__", - "isNSValue__", - "isProxy", - "mutableCopy", - "nilValueForKey", - "objectSpecifier", - "observationInfo", - "pep_onDetachedThread", - "pep_onMainThread", - "pep_onMainThreadIfNecessary", - "prepareForInterfaceBuilder", - "release", - "releaseOnMainThread", - "retain", - "retainCount", - "retainWeakReference", - "scriptingProperties", - "self", - "shouldGroupAccessibilityChildren", - "storedAccessibilityActivationPoint", - "storedAccessibilityContainerType", - "storedAccessibilityElementsHidden", - "storedAccessibilityFrame", - "storedAccessibilityNavigationStyle", - "storedAccessibilityTraits", - "storedAccessibilityViewIsModal", - "storedIsAccessibilityElement", - "storedShouldGroupAccessibilityChildren", - "stringValueSafe", - "superclass", - "toManyRelationshipKeys", - "toOneRelationshipKeys", - "traitStorageList", - "un_safeBoolValue", - "userInterfaceItemIdentifier", - "utf8ValueSafe", - "valuesForKeysWithDictionary", - "zone", -// Protocol: CAAnimatableValue -// Protocol: CARenderValue -// Protocol: NSObject -// Protocol: ROCKRemoteInvocationInterface -}; diff --git a/extra/protobuf/protobuf-3.19.4/src/google/protobuf/compiler/objectivec/objectivec_oneof.cc b/extra/protobuf/protobuf-3.19.4/src/google/protobuf/compiler/objectivec/objectivec_oneof.cc deleted file mode 100644 index 1bef293e2885..000000000000 --- a/extra/protobuf/protobuf-3.19.4/src/google/protobuf/compiler/objectivec/objectivec_oneof.cc +++ /dev/null @@ -1,140 +0,0 @@ -// Protocol Buffers - Google's data interchange format -// Copyright 2008 Google Inc. All rights reserved. -// https://developers.google.com/protocol-buffers/ -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// * Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// * Redistributions in binary form must reproduce the above -// copyright notice, this list of conditions and the following disclaimer -// in the documentation and/or other materials provided with the -// distribution. -// * Neither the name of Google Inc. nor the names of its -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -#include -#include - -#include -#include -#include -#include - -namespace google { -namespace protobuf { -namespace compiler { -namespace objectivec { - -OneofGenerator::OneofGenerator(const OneofDescriptor* descriptor) - : descriptor_(descriptor) { - variables_["enum_name"] = OneofEnumName(descriptor_); - variables_["name"] = OneofName(descriptor_); - variables_["capitalized_name"] = OneofNameCapitalized(descriptor_); - variables_["raw_index"] = StrCat(descriptor_->index()); - const Descriptor* msg_descriptor = descriptor_->containing_type(); - variables_["owning_message_class"] = ClassName(msg_descriptor); - - std::string comments; - SourceLocation location; - if (descriptor_->GetSourceLocation(&location)) { - comments = BuildCommentsString(location, true); - } else { - comments = ""; - } - variables_["comments"] = comments; -} - -OneofGenerator::~OneofGenerator() {} - -void OneofGenerator::SetOneofIndexBase(int index_base) { - int index = descriptor_->index() + index_base; - // Flip the sign to mark it as a oneof. - variables_["index"] = StrCat(-index); -} - -void OneofGenerator::GenerateCaseEnum(io::Printer* printer) { - printer->Print( - variables_, - "typedef GPB_ENUM($enum_name$) {\n"); - printer->Indent(); - printer->Print( - variables_, - "$enum_name$_GPBUnsetOneOfCase = 0,\n"); - std::string enum_name = variables_["enum_name"]; - for (int j = 0; j < descriptor_->field_count(); j++) { - const FieldDescriptor* field = descriptor_->field(j); - std::string field_name = FieldNameCapitalized(field); - printer->Print( - "$enum_name$_$field_name$ = $field_number$,\n", - "enum_name", enum_name, - "field_name", field_name, - "field_number", StrCat(field->number())); - } - printer->Outdent(); - printer->Print( - "};\n" - "\n"); -} - -void OneofGenerator::GeneratePublicCasePropertyDeclaration( - io::Printer* printer) { - printer->Print( - variables_, - "$comments$" - "@property(nonatomic, readonly) $enum_name$ $name$OneOfCase;\n" - "\n"); -} - -void OneofGenerator::GenerateClearFunctionDeclaration(io::Printer* printer) { - printer->Print( - variables_, - "/**\n" - " * Clears whatever value was set for the oneof '$name$'.\n" - " **/\n" - "void $owning_message_class$_Clear$capitalized_name$OneOfCase($owning_message_class$ *message);\n"); -} - -void OneofGenerator::GeneratePropertyImplementation(io::Printer* printer) { - printer->Print( - variables_, - "@dynamic $name$OneOfCase;\n"); -} - -void OneofGenerator::GenerateClearFunctionImplementation(io::Printer* printer) { - printer->Print( - variables_, - "void $owning_message_class$_Clear$capitalized_name$OneOfCase($owning_message_class$ *message) {\n" - " GPBDescriptor *descriptor = [$owning_message_class$ descriptor];\n" - " GPBOneofDescriptor *oneof = [descriptor.oneofs objectAtIndex:$raw_index$];\n" - " GPBClearOneof(message, oneof);\n" - "}\n"); -} - -std::string OneofGenerator::DescriptorName(void) const { - return variables_.find("name")->second; -} - -std::string OneofGenerator::HasIndexAsString(void) const { - return variables_.find("index")->second; -} - -} // namespace objectivec -} // namespace compiler -} // namespace protobuf -} // namespace google diff --git a/extra/protobuf/protobuf-3.19.4/src/google/protobuf/compiler/objectivec/objectivec_oneof.h b/extra/protobuf/protobuf-3.19.4/src/google/protobuf/compiler/objectivec/objectivec_oneof.h deleted file mode 100644 index 034f07fb3306..000000000000 --- a/extra/protobuf/protobuf-3.19.4/src/google/protobuf/compiler/objectivec/objectivec_oneof.h +++ /dev/null @@ -1,76 +0,0 @@ -// Protocol Buffers - Google's data interchange format -// Copyright 2008 Google Inc. All rights reserved. -// https://developers.google.com/protocol-buffers/ -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// * Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// * Redistributions in binary form must reproduce the above -// copyright notice, this list of conditions and the following disclaimer -// in the documentation and/or other materials provided with the -// distribution. -// * Neither the name of Google Inc. nor the names of its -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -#ifndef GOOGLE_PROTOBUF_COMPILER_OBJECTIVEC_ONEOF_H__ -#define GOOGLE_PROTOBUF_COMPILER_OBJECTIVEC_ONEOF_H__ - -#include -#include -#include -#include -#include - -namespace google { -namespace protobuf { -namespace compiler { -namespace objectivec { - -class OneofGenerator { - public: - explicit OneofGenerator(const OneofDescriptor* descriptor); - ~OneofGenerator(); - - OneofGenerator(const OneofGenerator&) = delete; - OneofGenerator& operator=(const OneofGenerator&) = delete; - - void SetOneofIndexBase(int index_base); - - void GenerateCaseEnum(io::Printer* printer); - - void GeneratePublicCasePropertyDeclaration(io::Printer* printer); - void GenerateClearFunctionDeclaration(io::Printer* printer); - - void GeneratePropertyImplementation(io::Printer* printer); - void GenerateClearFunctionImplementation(io::Printer* printer); - - std::string DescriptorName(void) const; - std::string HasIndexAsString(void) const; - - private: - const OneofDescriptor* descriptor_; - std::map variables_; -}; - -} // namespace objectivec -} // namespace compiler -} // namespace protobuf -} // namespace google - -#endif // GOOGLE_PROTOBUF_COMPILER_OBJECTIVEC_ONEOF_H__ diff --git a/extra/protobuf/protobuf-3.19.4/src/google/protobuf/compiler/objectivec/objectivec_primitive_field.cc b/extra/protobuf/protobuf-3.19.4/src/google/protobuf/compiler/objectivec/objectivec_primitive_field.cc deleted file mode 100644 index e198c5c182ca..000000000000 --- a/extra/protobuf/protobuf-3.19.4/src/google/protobuf/compiler/objectivec/objectivec_primitive_field.cc +++ /dev/null @@ -1,190 +0,0 @@ -// Protocol Buffers - Google's data interchange format -// Copyright 2008 Google Inc. All rights reserved. -// https://developers.google.com/protocol-buffers/ -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// * Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// * Redistributions in binary form must reproduce the above -// copyright notice, this list of conditions and the following disclaimer -// in the documentation and/or other materials provided with the -// distribution. -// * Neither the name of Google Inc. nor the names of its -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -#include -#include - -#include -#include -#include -#include -#include -#include - -namespace google { -namespace protobuf { -namespace compiler { -namespace objectivec { - -using internal::WireFormat; -using internal::WireFormatLite; - -namespace { - -const char* PrimitiveTypeName(const FieldDescriptor* descriptor) { - ObjectiveCType type = GetObjectiveCType(descriptor); - switch (type) { - case OBJECTIVECTYPE_INT32: - return "int32_t"; - case OBJECTIVECTYPE_UINT32: - return "uint32_t"; - case OBJECTIVECTYPE_INT64: - return "int64_t"; - case OBJECTIVECTYPE_UINT64: - return "uint64_t"; - case OBJECTIVECTYPE_FLOAT: - return "float"; - case OBJECTIVECTYPE_DOUBLE: - return "double"; - case OBJECTIVECTYPE_BOOLEAN: - return "BOOL"; - case OBJECTIVECTYPE_STRING: - return "NSString"; - case OBJECTIVECTYPE_DATA: - return "NSData"; - case OBJECTIVECTYPE_ENUM: - return "int32_t"; - case OBJECTIVECTYPE_MESSAGE: - return NULL; // Messages go through objectivec_message_field.cc|h. - } - - // Some compilers report reaching end of function even though all cases of - // the enum are handed in the switch. - GOOGLE_LOG(FATAL) << "Can't get here."; - return NULL; -} - -const char* PrimitiveArrayTypeName(const FieldDescriptor* descriptor) { - ObjectiveCType type = GetObjectiveCType(descriptor); - switch (type) { - case OBJECTIVECTYPE_INT32: - return "Int32"; - case OBJECTIVECTYPE_UINT32: - return "UInt32"; - case OBJECTIVECTYPE_INT64: - return "Int64"; - case OBJECTIVECTYPE_UINT64: - return "UInt64"; - case OBJECTIVECTYPE_FLOAT: - return "Float"; - case OBJECTIVECTYPE_DOUBLE: - return "Double"; - case OBJECTIVECTYPE_BOOLEAN: - return "Bool"; - case OBJECTIVECTYPE_STRING: - return ""; // Want NSArray - case OBJECTIVECTYPE_DATA: - return ""; // Want NSArray - case OBJECTIVECTYPE_ENUM: - return "Enum"; - case OBJECTIVECTYPE_MESSAGE: - // Want NSArray (but goes through objectivec_message_field.cc|h). - return ""; - } - - // Some compilers report reaching end of function even though all cases of - // the enum are handed in the switch. - GOOGLE_LOG(FATAL) << "Can't get here."; - return NULL; -} - -void SetPrimitiveVariables(const FieldDescriptor* descriptor, - std::map* variables) { - std::string primitive_name = PrimitiveTypeName(descriptor); - (*variables)["type"] = primitive_name; - (*variables)["storage_type"] = primitive_name; -} - -} // namespace - -PrimitiveFieldGenerator::PrimitiveFieldGenerator( - const FieldDescriptor* descriptor, const Options& options) - : SingleFieldGenerator(descriptor, options) { - SetPrimitiveVariables(descriptor, &variables_); -} - -PrimitiveFieldGenerator::~PrimitiveFieldGenerator() {} - -void PrimitiveFieldGenerator::GenerateFieldStorageDeclaration( - io::Printer* printer) const { - if (GetObjectiveCType(descriptor_) == OBJECTIVECTYPE_BOOLEAN) { - // Nothing, BOOLs are stored in the has bits. - } else { - SingleFieldGenerator::GenerateFieldStorageDeclaration(printer); - } -} - -int PrimitiveFieldGenerator::ExtraRuntimeHasBitsNeeded(void) const { - if (GetObjectiveCType(descriptor_) == OBJECTIVECTYPE_BOOLEAN) { - // Reserve a bit for the storage of the boolean. - return 1; - } - return 0; -} - -void PrimitiveFieldGenerator::SetExtraRuntimeHasBitsBase(int has_base) { - if (GetObjectiveCType(descriptor_) == OBJECTIVECTYPE_BOOLEAN) { - // Set into the offset the has bit to use for the actual value. - variables_["storage_offset_value"] = StrCat(has_base); - variables_["storage_offset_comment"] = - " // Stored in _has_storage_ to save space."; - } -} - -PrimitiveObjFieldGenerator::PrimitiveObjFieldGenerator( - const FieldDescriptor* descriptor, const Options& options) - : ObjCObjFieldGenerator(descriptor, options) { - SetPrimitiveVariables(descriptor, &variables_); - variables_["property_storage_attribute"] = "copy"; -} - -PrimitiveObjFieldGenerator::~PrimitiveObjFieldGenerator() {} - -RepeatedPrimitiveFieldGenerator::RepeatedPrimitiveFieldGenerator( - const FieldDescriptor* descriptor, const Options& options) - : RepeatedFieldGenerator(descriptor, options) { - SetPrimitiveVariables(descriptor, &variables_); - - std::string base_name = PrimitiveArrayTypeName(descriptor); - if (base_name.length()) { - variables_["array_storage_type"] = "GPB" + base_name + "Array"; - } else { - variables_["array_storage_type"] = "NSMutableArray"; - variables_["array_property_type"] = - "NSMutableArray<" + variables_["storage_type"] + "*>"; - } -} - -RepeatedPrimitiveFieldGenerator::~RepeatedPrimitiveFieldGenerator() {} - -} // namespace objectivec -} // namespace compiler -} // namespace protobuf -} // namespace google diff --git a/extra/protobuf/protobuf-3.19.4/src/google/protobuf/compiler/objectivec/objectivec_primitive_field.h b/extra/protobuf/protobuf-3.19.4/src/google/protobuf/compiler/objectivec/objectivec_primitive_field.h deleted file mode 100644 index a9f30f641954..000000000000 --- a/extra/protobuf/protobuf-3.19.4/src/google/protobuf/compiler/objectivec/objectivec_primitive_field.h +++ /dev/null @@ -1,95 +0,0 @@ -// Protocol Buffers - Google's data interchange format -// Copyright 2008 Google Inc. All rights reserved. -// https://developers.google.com/protocol-buffers/ -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// * Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// * Redistributions in binary form must reproduce the above -// copyright notice, this list of conditions and the following disclaimer -// in the documentation and/or other materials provided with the -// distribution. -// * Neither the name of Google Inc. nor the names of its -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -#ifndef GOOGLE_PROTOBUF_COMPILER_OBJECTIVEC_PRIMITIVE_FIELD_H__ -#define GOOGLE_PROTOBUF_COMPILER_OBJECTIVEC_PRIMITIVE_FIELD_H__ - -#include -#include -#include - -namespace google { -namespace protobuf { -namespace compiler { -namespace objectivec { - -class PrimitiveFieldGenerator : public SingleFieldGenerator { - friend FieldGenerator* FieldGenerator::Make(const FieldDescriptor* field, - const Options& options); - - protected: - PrimitiveFieldGenerator(const FieldDescriptor* descriptor, - const Options& options); - virtual ~PrimitiveFieldGenerator(); - - PrimitiveFieldGenerator(const PrimitiveFieldGenerator&) = delete; - PrimitiveFieldGenerator& operator=(const PrimitiveFieldGenerator&) = delete; - - virtual void GenerateFieldStorageDeclaration(io::Printer* printer) const override; - - virtual int ExtraRuntimeHasBitsNeeded(void) const override; - virtual void SetExtraRuntimeHasBitsBase(int index_base) override; -}; - -class PrimitiveObjFieldGenerator : public ObjCObjFieldGenerator { - friend FieldGenerator* FieldGenerator::Make(const FieldDescriptor* field, - const Options& options); - - protected: - PrimitiveObjFieldGenerator(const FieldDescriptor* descriptor, - const Options& options); - virtual ~PrimitiveObjFieldGenerator(); - - PrimitiveObjFieldGenerator(const PrimitiveObjFieldGenerator&) = delete; - PrimitiveObjFieldGenerator& operator=(const PrimitiveObjFieldGenerator&) = - delete; -}; - -class RepeatedPrimitiveFieldGenerator : public RepeatedFieldGenerator { - friend FieldGenerator* FieldGenerator::Make(const FieldDescriptor* field, - const Options& options); - - protected: - RepeatedPrimitiveFieldGenerator(const FieldDescriptor* descriptor, - const Options& options); - virtual ~RepeatedPrimitiveFieldGenerator(); - - RepeatedPrimitiveFieldGenerator(const RepeatedPrimitiveFieldGenerator&) = - delete; - RepeatedPrimitiveFieldGenerator& operator=( - const RepeatedPrimitiveFieldGenerator&) = delete; -}; - -} // namespace objectivec -} // namespace compiler -} // namespace protobuf -} // namespace google - -#endif // GOOGLE_PROTOBUF_COMPILER_OBJECTIVEC_PRIMITIVE_FIELD_H__ diff --git a/extra/protobuf/protobuf-3.19.4/src/google/protobuf/compiler/package_info.h b/extra/protobuf/protobuf-3.19.4/src/google/protobuf/compiler/package_info.h deleted file mode 100644 index 105ef601a5b3..000000000000 --- a/extra/protobuf/protobuf-3.19.4/src/google/protobuf/compiler/package_info.h +++ /dev/null @@ -1,63 +0,0 @@ -// Protocol Buffers - Google's data interchange format -// Copyright 2008 Google Inc. All rights reserved. -// https://developers.google.com/protocol-buffers/ -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// * Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// * Redistributions in binary form must reproduce the above -// copyright notice, this list of conditions and the following disclaimer -// in the documentation and/or other materials provided with the -// distribution. -// * Neither the name of Google Inc. nor the names of its -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -// Author: kenton@google.com (Kenton Varda) -// Based on original Protocol Buffers design by -// Sanjay Ghemawat, Jeff Dean, and others. -// -// This file exists solely to document the google::protobuf::compiler namespace. -// It is not compiled into anything, but it may be read by an automated -// documentation generator. - -namespace google { -namespace protobuf { - -// Implementation of the Protocol Buffer compiler. -// -// This package contains code for parsing .proto files and generating code -// based on them. There are two reasons you might be interested in this -// package: -// - You want to parse .proto files at runtime. In this case, you should -// look at importer.h. Since this functionality is widely useful, it is -// included in the libprotobuf base library; you do not have to link against -// libprotoc. -// - You want to write a custom protocol compiler which generates different -// kinds of code, e.g. code in a different language which is not supported -// by the official compiler. For this purpose, command_line_interface.h -// provides you with a complete compiler front-end, so all you need to do -// is write a custom implementation of CodeGenerator and a trivial main() -// function. You can even make your compiler support the official languages -// in addition to your own. Since this functionality is only useful to those -// writing custom compilers, it is in a separate library called "libprotoc" -// which you will have to link against. -namespace compiler {} - -} // namespace protobuf -} // namespace google diff --git a/extra/protobuf/protobuf-3.19.4/src/google/protobuf/compiler/parser.cc b/extra/protobuf/protobuf-3.19.4/src/google/protobuf/compiler/parser.cc deleted file mode 100644 index 49ddfceb1aa9..000000000000 --- a/extra/protobuf/protobuf-3.19.4/src/google/protobuf/compiler/parser.cc +++ /dev/null @@ -1,2445 +0,0 @@ -// Protocol Buffers - Google's data interchange format -// Copyright 2008 Google Inc. All rights reserved. -// https://developers.google.com/protocol-buffers/ -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// * Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// * Redistributions in binary form must reproduce the above -// copyright notice, this list of conditions and the following disclaimer -// in the documentation and/or other materials provided with the -// distribution. -// * Neither the name of Google Inc. nor the names of its -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -// Author: kenton@google.com (Kenton Varda) -// Based on original Protocol Buffers design by -// Sanjay Ghemawat, Jeff Dean, and others. -// -// Recursive descent FTW. - -#include - -#include - -#include -#include -#include -#include - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -namespace google { -namespace protobuf { -namespace compiler { - -using internal::WireFormat; - -namespace { - -typedef std::unordered_map TypeNameMap; - -TypeNameMap MakeTypeNameTable() { - TypeNameMap result; - - result["double"] = FieldDescriptorProto::TYPE_DOUBLE; - result["float"] = FieldDescriptorProto::TYPE_FLOAT; - result["uint64"] = FieldDescriptorProto::TYPE_UINT64; - result["fixed64"] = FieldDescriptorProto::TYPE_FIXED64; - result["fixed32"] = FieldDescriptorProto::TYPE_FIXED32; - result["bool"] = FieldDescriptorProto::TYPE_BOOL; - result["string"] = FieldDescriptorProto::TYPE_STRING; - result["group"] = FieldDescriptorProto::TYPE_GROUP; - - result["bytes"] = FieldDescriptorProto::TYPE_BYTES; - result["uint32"] = FieldDescriptorProto::TYPE_UINT32; - result["sfixed32"] = FieldDescriptorProto::TYPE_SFIXED32; - result["sfixed64"] = FieldDescriptorProto::TYPE_SFIXED64; - result["int32"] = FieldDescriptorProto::TYPE_INT32; - result["int64"] = FieldDescriptorProto::TYPE_INT64; - result["sint32"] = FieldDescriptorProto::TYPE_SINT32; - result["sint64"] = FieldDescriptorProto::TYPE_SINT64; - - return result; -} - -const TypeNameMap kTypeNames = MakeTypeNameTable(); - -// Camel-case the field name and append "Entry" for generated map entry name. -// e.g. map foo_map => FooMapEntry -std::string MapEntryName(const std::string& field_name) { - std::string result; - static const char kSuffix[] = "Entry"; - result.reserve(field_name.size() + sizeof(kSuffix)); - bool cap_next = true; - for (const char field_name_char : field_name) { - if (field_name_char == '_') { - cap_next = true; - } else if (cap_next) { - // Note: Do not use ctype.h due to locales. - if ('a' <= field_name_char && field_name_char <= 'z') { - result.push_back(field_name_char - 'a' + 'A'); - } else { - result.push_back(field_name_char); - } - cap_next = false; - } else { - result.push_back(field_name_char); - } - } - result.append(kSuffix); - return result; -} - -bool IsUppercase(char c) { return c >= 'A' && c <= 'Z'; } - -bool IsLowercase(char c) { return c >= 'a' && c <= 'z'; } - -bool IsNumber(char c) { return c >= '0' && c <= '9'; } - -bool IsUpperCamelCase(const std::string& name) { - if (name.empty()) { - return true; - } - // Name must start with an upper case character. - if (!IsUppercase(name[0])) { - return false; - } - // Must not contains underscore. - for (const char c : name) { - if (c == '_') { - return false; - } - } - return true; -} - -bool IsUpperUnderscore(const std::string& name) { - for (const char c : name) { - if (!IsUppercase(c) && c != '_' && !IsNumber(c)) { - return false; - } - } - return true; -} - -bool IsLowerUnderscore(const std::string& name) { - for (const char c : name) { - if (!IsLowercase(c) && c != '_' && !IsNumber(c)) { - return false; - } - } - return true; -} - -bool IsNumberFollowUnderscore(const std::string& name) { - for (int i = 1; i < name.length(); i++) { - const char c = name[i]; - if (IsNumber(c) && name[i - 1] == '_') { - return true; - } - } - return false; -} - -} // anonymous namespace - -// Makes code slightly more readable. The meaning of "DO(foo)" is -// "Execute foo and fail if it fails.", where failure is indicated by -// returning false. -#define DO(STATEMENT) \ - if (STATEMENT) { \ - } else \ - return false - -// =================================================================== - -Parser::Parser() - : input_(NULL), - error_collector_(NULL), - source_location_table_(NULL), - had_errors_(false), - require_syntax_identifier_(false), - stop_after_syntax_identifier_(false) { -} - -Parser::~Parser() {} - -// =================================================================== - -inline bool Parser::LookingAt(const char* text) { - return input_->current().text == text; -} - -inline bool Parser::LookingAtType(io::Tokenizer::TokenType token_type) { - return input_->current().type == token_type; -} - -inline bool Parser::AtEnd() { return LookingAtType(io::Tokenizer::TYPE_END); } - -bool Parser::TryConsume(const char* text) { - if (LookingAt(text)) { - input_->Next(); - return true; - } else { - return false; - } -} - -bool Parser::Consume(const char* text, const char* error) { - if (TryConsume(text)) { - return true; - } else { - AddError(error); - return false; - } -} - -bool Parser::Consume(const char* text) { - if (TryConsume(text)) { - return true; - } else { - AddError("Expected \"" + std::string(text) + "\"."); - return false; - } -} - -bool Parser::ConsumeIdentifier(std::string* output, const char* error) { - if (LookingAtType(io::Tokenizer::TYPE_IDENTIFIER)) { - *output = input_->current().text; - input_->Next(); - return true; - } else { - AddError(error); - return false; - } -} - -bool Parser::ConsumeInteger(int* output, const char* error) { - if (LookingAtType(io::Tokenizer::TYPE_INTEGER)) { - uint64_t value = 0; - if (!io::Tokenizer::ParseInteger(input_->current().text, - std::numeric_limits::max(), - &value)) { - AddError("Integer out of range."); - // We still return true because we did, in fact, parse an integer. - } - *output = value; - input_->Next(); - return true; - } else { - AddError(error); - return false; - } -} - -bool Parser::ConsumeSignedInteger(int* output, const char* error) { - bool is_negative = false; - uint64_t max_value = std::numeric_limits::max(); - if (TryConsume("-")) { - is_negative = true; - max_value += 1; - } - uint64_t value = 0; - DO(ConsumeInteger64(max_value, &value, error)); - if (is_negative) value *= -1; - *output = value; - return true; -} - -bool Parser::ConsumeInteger64(uint64_t max_value, uint64_t* output, - const char* error) { - if (LookingAtType(io::Tokenizer::TYPE_INTEGER)) { - if (!io::Tokenizer::ParseInteger(input_->current().text, max_value, - output)) { - AddError("Integer out of range."); - // We still return true because we did, in fact, parse an integer. - *output = 0; - } - input_->Next(); - return true; - } else { - AddError(error); - return false; - } -} - -bool Parser::ConsumeNumber(double* output, const char* error) { - if (LookingAtType(io::Tokenizer::TYPE_FLOAT)) { - *output = io::Tokenizer::ParseFloat(input_->current().text); - input_->Next(); - return true; - } else if (LookingAtType(io::Tokenizer::TYPE_INTEGER)) { - // Also accept integers. - uint64_t value = 0; - if (!io::Tokenizer::ParseInteger(input_->current().text, - std::numeric_limits::max(), - &value)) { - AddError("Integer out of range."); - // We still return true because we did, in fact, parse a number. - } - *output = value; - input_->Next(); - return true; - } else if (LookingAt("inf")) { - *output = std::numeric_limits::infinity(); - input_->Next(); - return true; - } else if (LookingAt("nan")) { - *output = std::numeric_limits::quiet_NaN(); - input_->Next(); - return true; - } else { - AddError(error); - return false; - } -} - -bool Parser::ConsumeString(std::string* output, const char* error) { - if (LookingAtType(io::Tokenizer::TYPE_STRING)) { - io::Tokenizer::ParseString(input_->current().text, output); - input_->Next(); - // Allow C++ like concatenation of adjacent string tokens. - while (LookingAtType(io::Tokenizer::TYPE_STRING)) { - io::Tokenizer::ParseStringAppend(input_->current().text, output); - input_->Next(); - } - return true; - } else { - AddError(error); - return false; - } -} - -bool Parser::TryConsumeEndOfDeclaration(const char* text, - const LocationRecorder* location) { - if (LookingAt(text)) { - std::string leading, trailing; - std::vector detached; - input_->NextWithComments(&trailing, &detached, &leading); - - // Save the leading comments for next time, and recall the leading comments - // from last time. - leading.swap(upcoming_doc_comments_); - - if (location != NULL) { - upcoming_detached_comments_.swap(detached); - location->AttachComments(&leading, &trailing, &detached); - } else if (strcmp(text, "}") == 0) { - // If the current location is null and we are finishing the current scope, - // drop pending upcoming detached comments. - upcoming_detached_comments_.swap(detached); - } else { - // Otherwise, append the new detached comments to the existing upcoming - // detached comments. - upcoming_detached_comments_.insert(upcoming_detached_comments_.end(), - detached.begin(), detached.end()); - } - - return true; - } else { - return false; - } -} - -bool Parser::ConsumeEndOfDeclaration(const char* text, - const LocationRecorder* location) { - if (TryConsumeEndOfDeclaration(text, location)) { - return true; - } else { - AddError("Expected \"" + std::string(text) + "\"."); - return false; - } -} - -// ------------------------------------------------------------------- - -void Parser::AddError(int line, int column, const std::string& error) { - if (error_collector_ != NULL) { - error_collector_->AddError(line, column, error); - } - had_errors_ = true; -} - -void Parser::AddError(const std::string& error) { - AddError(input_->current().line, input_->current().column, error); -} - -void Parser::AddWarning(const std::string& warning) { - if (error_collector_ != nullptr) { - error_collector_->AddWarning(input_->current().line, - input_->current().column, warning); - } -} - -// ------------------------------------------------------------------- - -Parser::LocationRecorder::LocationRecorder(Parser* parser) - : parser_(parser), - source_code_info_(parser->source_code_info_), - location_(parser_->source_code_info_->add_location()) { - location_->add_span(parser_->input_->current().line); - location_->add_span(parser_->input_->current().column); -} - -Parser::LocationRecorder::LocationRecorder(const LocationRecorder& parent) { - Init(parent, parent.source_code_info_); -} - -Parser::LocationRecorder::LocationRecorder(const LocationRecorder& parent, - int path1, - SourceCodeInfo* source_code_info) { - Init(parent, source_code_info); - AddPath(path1); -} - -Parser::LocationRecorder::LocationRecorder(const LocationRecorder& parent, - int path1) { - Init(parent, parent.source_code_info_); - AddPath(path1); -} - -Parser::LocationRecorder::LocationRecorder(const LocationRecorder& parent, - int path1, int path2) { - Init(parent, parent.source_code_info_); - AddPath(path1); - AddPath(path2); -} - -void Parser::LocationRecorder::Init(const LocationRecorder& parent, - SourceCodeInfo* source_code_info) { - parser_ = parent.parser_; - source_code_info_ = source_code_info; - - location_ = source_code_info_->add_location(); - location_->mutable_path()->CopyFrom(parent.location_->path()); - - location_->add_span(parser_->input_->current().line); - location_->add_span(parser_->input_->current().column); -} - -Parser::LocationRecorder::~LocationRecorder() { - if (location_->span_size() <= 2) { - EndAt(parser_->input_->previous()); - } -} - -void Parser::LocationRecorder::AddPath(int path_component) { - location_->add_path(path_component); -} - -void Parser::LocationRecorder::StartAt(const io::Tokenizer::Token& token) { - location_->set_span(0, token.line); - location_->set_span(1, token.column); -} - -void Parser::LocationRecorder::StartAt(const LocationRecorder& other) { - location_->set_span(0, other.location_->span(0)); - location_->set_span(1, other.location_->span(1)); -} - -void Parser::LocationRecorder::EndAt(const io::Tokenizer::Token& token) { - if (token.line != location_->span(0)) { - location_->add_span(token.line); - } - location_->add_span(token.end_column); -} - -void Parser::LocationRecorder::RecordLegacyLocation( - const Message* descriptor, - DescriptorPool::ErrorCollector::ErrorLocation location) { - if (parser_->source_location_table_ != NULL) { - parser_->source_location_table_->Add( - descriptor, location, location_->span(0), location_->span(1)); - } -} - -void Parser::LocationRecorder::RecordLegacyImportLocation( - const Message* descriptor, const std::string& name) { - if (parser_->source_location_table_ != nullptr) { - parser_->source_location_table_->AddImport( - descriptor, name, location_->span(0), location_->span(1)); - } -} - -int Parser::LocationRecorder::CurrentPathSize() const { - return location_->path_size(); -} - -void Parser::LocationRecorder::AttachComments( - std::string* leading, std::string* trailing, - std::vector* detached_comments) const { - GOOGLE_CHECK(!location_->has_leading_comments()); - GOOGLE_CHECK(!location_->has_trailing_comments()); - - if (!leading->empty()) { - location_->mutable_leading_comments()->swap(*leading); - } - if (!trailing->empty()) { - location_->mutable_trailing_comments()->swap(*trailing); - } - for (int i = 0; i < detached_comments->size(); ++i) { - location_->add_leading_detached_comments()->swap((*detached_comments)[i]); - } - detached_comments->clear(); -} - -// ------------------------------------------------------------------- - -void Parser::SkipStatement() { - while (true) { - if (AtEnd()) { - return; - } else if (LookingAtType(io::Tokenizer::TYPE_SYMBOL)) { - if (TryConsumeEndOfDeclaration(";", NULL)) { - return; - } else if (TryConsume("{")) { - SkipRestOfBlock(); - return; - } else if (LookingAt("}")) { - return; - } - } - input_->Next(); - } -} - -void Parser::SkipRestOfBlock() { - while (true) { - if (AtEnd()) { - return; - } else if (LookingAtType(io::Tokenizer::TYPE_SYMBOL)) { - if (TryConsumeEndOfDeclaration("}", NULL)) { - return; - } else if (TryConsume("{")) { - SkipRestOfBlock(); - } - } - input_->Next(); - } -} - -// =================================================================== - -bool Parser::ValidateEnum(const EnumDescriptorProto* proto) { - bool has_allow_alias = false; - bool allow_alias = false; - - for (int i = 0; i < proto->options().uninterpreted_option_size(); i++) { - const UninterpretedOption option = proto->options().uninterpreted_option(i); - if (option.name_size() > 1) { - continue; - } - if (!option.name(0).is_extension() && - option.name(0).name_part() == "allow_alias") { - has_allow_alias = true; - if (option.identifier_value() == "true") { - allow_alias = true; - } - break; - } - } - - if (has_allow_alias && !allow_alias) { - std::string error = - "\"" + proto->name() + - "\" declares 'option allow_alias = false;' which has no effect. " - "Please remove the declaration."; - // This needlessly clutters declarations with nops. - AddError(error); - return false; - } - - std::set used_values; - bool has_duplicates = false; - for (int i = 0; i < proto->value_size(); ++i) { - const EnumValueDescriptorProto& enum_value = proto->value(i); - if (used_values.find(enum_value.number()) != used_values.end()) { - has_duplicates = true; - break; - } else { - used_values.insert(enum_value.number()); - } - } - if (allow_alias && !has_duplicates) { - std::string error = - "\"" + proto->name() + - "\" declares support for enum aliases but no enum values share field " - "numbers. Please remove the unnecessary 'option allow_alias = true;' " - "declaration."; - // Generate an error if an enum declares support for duplicate enum values - // and does not use it protect future authors. - AddError(error); - return false; - } - - // Enforce that enum constants must be UPPER_CASE except in case of - // enum_alias. - if (!allow_alias) { - for (const auto& enum_value : proto->value()) { - if (!IsUpperUnderscore(enum_value.name())) { - AddWarning( - "Enum constant should be in UPPER_CASE. Found: " + - enum_value.name() + - ". See https://developers.google.com/protocol-buffers/docs/style"); - } - } - } - - return true; -} - -bool Parser::Parse(io::Tokenizer* input, FileDescriptorProto* file) { - input_ = input; - had_errors_ = false; - syntax_identifier_.clear(); - - // Note that |file| could be NULL at this point if - // stop_after_syntax_identifier_ is true. So, we conservatively allocate - // SourceCodeInfo on the stack, then swap it into the FileDescriptorProto - // later on. - SourceCodeInfo source_code_info; - source_code_info_ = &source_code_info; - - if (LookingAtType(io::Tokenizer::TYPE_START)) { - // Advance to first token. - input_->NextWithComments(NULL, &upcoming_detached_comments_, - &upcoming_doc_comments_); - } - - { - LocationRecorder root_location(this); - root_location.RecordLegacyLocation(file, - DescriptorPool::ErrorCollector::OTHER); - - if (require_syntax_identifier_ || LookingAt("syntax")) { - if (!ParseSyntaxIdentifier(root_location)) { - // Don't attempt to parse the file if we didn't recognize the syntax - // identifier. - return false; - } - // Store the syntax into the file. - if (file != NULL) file->set_syntax(syntax_identifier_); - } else if (!stop_after_syntax_identifier_) { - GOOGLE_LOG(WARNING) << "No syntax specified for the proto file: " << file->name() - << ". Please use 'syntax = \"proto2\";' " - << "or 'syntax = \"proto3\";' to specify a syntax " - << "version. (Defaulted to proto2 syntax.)"; - syntax_identifier_ = "proto2"; - } - - if (stop_after_syntax_identifier_) return !had_errors_; - - // Repeatedly parse statements until we reach the end of the file. - while (!AtEnd()) { - if (!ParseTopLevelStatement(file, root_location)) { - // This statement failed to parse. Skip it, but keep looping to parse - // other statements. - SkipStatement(); - - if (LookingAt("}")) { - AddError("Unmatched \"}\"."); - input_->NextWithComments(NULL, &upcoming_detached_comments_, - &upcoming_doc_comments_); - } - } - } - } - - input_ = NULL; - source_code_info_ = NULL; - assert(file != NULL); - source_code_info.Swap(file->mutable_source_code_info()); - return !had_errors_; -} - -bool Parser::ParseSyntaxIdentifier(const LocationRecorder& parent) { - LocationRecorder syntax_location(parent, - FileDescriptorProto::kSyntaxFieldNumber); - DO(Consume( - "syntax", - "File must begin with a syntax statement, e.g. 'syntax = \"proto2\";'.")); - DO(Consume("=")); - io::Tokenizer::Token syntax_token = input_->current(); - std::string syntax; - DO(ConsumeString(&syntax, "Expected syntax identifier.")); - DO(ConsumeEndOfDeclaration(";", &syntax_location)); - - syntax_identifier_ = syntax; - - if (syntax != "proto2" && syntax != "proto3" && - !stop_after_syntax_identifier_) { - AddError(syntax_token.line, syntax_token.column, - "Unrecognized syntax identifier \"" + syntax + - "\". This parser " - "only recognizes \"proto2\" and \"proto3\"."); - return false; - } - - return true; -} - -bool Parser::ParseTopLevelStatement(FileDescriptorProto* file, - const LocationRecorder& root_location) { - if (TryConsumeEndOfDeclaration(";", NULL)) { - // empty statement; ignore - return true; - } else if (LookingAt("message")) { - LocationRecorder location(root_location, - FileDescriptorProto::kMessageTypeFieldNumber, - file->message_type_size()); - return ParseMessageDefinition(file->add_message_type(), location, file); - } else if (LookingAt("enum")) { - LocationRecorder location(root_location, - FileDescriptorProto::kEnumTypeFieldNumber, - file->enum_type_size()); - return ParseEnumDefinition(file->add_enum_type(), location, file); - } else if (LookingAt("service")) { - LocationRecorder location(root_location, - FileDescriptorProto::kServiceFieldNumber, - file->service_size()); - return ParseServiceDefinition(file->add_service(), location, file); - } else if (LookingAt("extend")) { - LocationRecorder location(root_location, - FileDescriptorProto::kExtensionFieldNumber); - return ParseExtend( - file->mutable_extension(), file->mutable_message_type(), root_location, - FileDescriptorProto::kMessageTypeFieldNumber, location, file); - } else if (LookingAt("import")) { - return ParseImport(file->mutable_dependency(), - file->mutable_public_dependency(), - file->mutable_weak_dependency(), root_location, file); - } else if (LookingAt("package")) { - return ParsePackage(file, root_location, file); - } else if (LookingAt("option")) { - LocationRecorder location(root_location, - FileDescriptorProto::kOptionsFieldNumber); - return ParseOption(file->mutable_options(), location, file, - OPTION_STATEMENT); - } else { - AddError("Expected top-level statement (e.g. \"message\")."); - return false; - } -} - -// ------------------------------------------------------------------- -// Messages - -bool Parser::ParseMessageDefinition( - DescriptorProto* message, const LocationRecorder& message_location, - const FileDescriptorProto* containing_file) { - DO(Consume("message")); - { - LocationRecorder location(message_location, - DescriptorProto::kNameFieldNumber); - location.RecordLegacyLocation(message, - DescriptorPool::ErrorCollector::NAME); - DO(ConsumeIdentifier(message->mutable_name(), "Expected message name.")); - if (!IsUpperCamelCase(message->name())) { - AddWarning( - "Message name should be in UpperCamelCase. Found: " + - message->name() + - ". See https://developers.google.com/protocol-buffers/docs/style"); - } - } - DO(ParseMessageBlock(message, message_location, containing_file)); - - if (syntax_identifier_ == "proto3") { - // Add synthetic one-field oneofs for optional fields, except messages which - // already have presence in proto3. - // - // We have to make sure the oneof names don't conflict with any other - // field or oneof. - std::unordered_set names; - for (const auto& field : message->field()) { - names.insert(field.name()); - } - for (const auto& oneof : message->oneof_decl()) { - names.insert(oneof.name()); - } - - for (auto& field : *message->mutable_field()) { - if (field.proto3_optional()) { - std::string oneof_name = field.name(); - - // Prepend 'XXXXX_' until we are no longer conflicting. - // Avoid prepending a double-underscore because such names are - // reserved in C++. - if (oneof_name.empty() || oneof_name[0] != '_') { - oneof_name = '_' + oneof_name; - } - while (names.count(oneof_name) > 0) { - oneof_name = 'X' + oneof_name; - } - - names.insert(oneof_name); - field.set_oneof_index(message->oneof_decl_size()); - OneofDescriptorProto* oneof = message->add_oneof_decl(); - oneof->set_name(oneof_name); - } - } - } - - return true; -} - -namespace { - -const int kMaxRangeSentinel = -1; - -bool IsMessageSetWireFormatMessage(const DescriptorProto& message) { - const MessageOptions& options = message.options(); - for (int i = 0; i < options.uninterpreted_option_size(); ++i) { - const UninterpretedOption& uninterpreted = options.uninterpreted_option(i); - if (uninterpreted.name_size() == 1 && - uninterpreted.name(0).name_part() == "message_set_wire_format" && - uninterpreted.identifier_value() == "true") { - return true; - } - } - return false; -} - -// Modifies any extension ranges that specified 'max' as the end of the -// extension range, and sets them to the type-specific maximum. The actual max -// tag number can only be determined after all options have been parsed. -void AdjustExtensionRangesWithMaxEndNumber(DescriptorProto* message) { - const bool is_message_set = IsMessageSetWireFormatMessage(*message); - const int max_extension_number = is_message_set - ? std::numeric_limits::max() - : FieldDescriptor::kMaxNumber + 1; - for (int i = 0; i < message->extension_range_size(); ++i) { - if (message->extension_range(i).end() == kMaxRangeSentinel) { - message->mutable_extension_range(i)->set_end(max_extension_number); - } - } -} - -// Modifies any reserved ranges that specified 'max' as the end of the -// reserved range, and sets them to the type-specific maximum. The actual max -// tag number can only be determined after all options have been parsed. -void AdjustReservedRangesWithMaxEndNumber(DescriptorProto* message) { - const bool is_message_set = IsMessageSetWireFormatMessage(*message); - const int max_field_number = is_message_set - ? std::numeric_limits::max() - : FieldDescriptor::kMaxNumber + 1; - for (int i = 0; i < message->reserved_range_size(); ++i) { - if (message->reserved_range(i).end() == kMaxRangeSentinel) { - message->mutable_reserved_range(i)->set_end(max_field_number); - } - } -} - -} // namespace - -bool Parser::ParseMessageBlock(DescriptorProto* message, - const LocationRecorder& message_location, - const FileDescriptorProto* containing_file) { - DO(ConsumeEndOfDeclaration("{", &message_location)); - - while (!TryConsumeEndOfDeclaration("}", NULL)) { - if (AtEnd()) { - AddError("Reached end of input in message definition (missing '}')."); - return false; - } - - if (!ParseMessageStatement(message, message_location, containing_file)) { - // This statement failed to parse. Skip it, but keep looping to parse - // other statements. - SkipStatement(); - } - } - - if (message->extension_range_size() > 0) { - AdjustExtensionRangesWithMaxEndNumber(message); - } - if (message->reserved_range_size() > 0) { - AdjustReservedRangesWithMaxEndNumber(message); - } - return true; -} - -bool Parser::ParseMessageStatement(DescriptorProto* message, - const LocationRecorder& message_location, - const FileDescriptorProto* containing_file) { - if (TryConsumeEndOfDeclaration(";", NULL)) { - // empty statement; ignore - return true; - } else if (LookingAt("message")) { - LocationRecorder location(message_location, - DescriptorProto::kNestedTypeFieldNumber, - message->nested_type_size()); - return ParseMessageDefinition(message->add_nested_type(), location, - containing_file); - } else if (LookingAt("enum")) { - LocationRecorder location(message_location, - DescriptorProto::kEnumTypeFieldNumber, - message->enum_type_size()); - return ParseEnumDefinition(message->add_enum_type(), location, - containing_file); - } else if (LookingAt("extensions")) { - LocationRecorder location(message_location, - DescriptorProto::kExtensionRangeFieldNumber); - return ParseExtensions(message, location, containing_file); - } else if (LookingAt("reserved")) { - return ParseReserved(message, message_location); - } else if (LookingAt("extend")) { - LocationRecorder location(message_location, - DescriptorProto::kExtensionFieldNumber); - return ParseExtend(message->mutable_extension(), - message->mutable_nested_type(), message_location, - DescriptorProto::kNestedTypeFieldNumber, location, - containing_file); - } else if (LookingAt("option")) { - LocationRecorder location(message_location, - DescriptorProto::kOptionsFieldNumber); - return ParseOption(message->mutable_options(), location, containing_file, - OPTION_STATEMENT); - } else if (LookingAt("oneof")) { - int oneof_index = message->oneof_decl_size(); - LocationRecorder oneof_location( - message_location, DescriptorProto::kOneofDeclFieldNumber, oneof_index); - - return ParseOneof(message->add_oneof_decl(), message, oneof_index, - oneof_location, message_location, containing_file); - } else { - LocationRecorder location(message_location, - DescriptorProto::kFieldFieldNumber, - message->field_size()); - return ParseMessageField( - message->add_field(), message->mutable_nested_type(), message_location, - DescriptorProto::kNestedTypeFieldNumber, location, containing_file); - } -} - -bool Parser::ParseMessageField(FieldDescriptorProto* field, - RepeatedPtrField* messages, - const LocationRecorder& parent_location, - int location_field_number_for_nested_type, - const LocationRecorder& field_location, - const FileDescriptorProto* containing_file) { - { - FieldDescriptorProto::Label label; - if (ParseLabel(&label, field_location, containing_file)) { - field->set_label(label); - if (label == FieldDescriptorProto::LABEL_OPTIONAL && - syntax_identifier_ == "proto3") { - field->set_proto3_optional(true); - } - } - } - - return ParseMessageFieldNoLabel(field, messages, parent_location, - location_field_number_for_nested_type, - field_location, containing_file); -} - -bool Parser::ParseMessageFieldNoLabel( - FieldDescriptorProto* field, RepeatedPtrField* messages, - const LocationRecorder& parent_location, - int location_field_number_for_nested_type, - const LocationRecorder& field_location, - const FileDescriptorProto* containing_file) { - MapField map_field; - // Parse type. - { - LocationRecorder location(field_location); // add path later - location.RecordLegacyLocation(field, DescriptorPool::ErrorCollector::TYPE); - - bool type_parsed = false; - FieldDescriptorProto::Type type = FieldDescriptorProto::TYPE_INT32; - std::string type_name; - - // Special case map field. We only treat the field as a map field if the - // field type name starts with the word "map" with a following "<". - if (TryConsume("map")) { - if (LookingAt("<")) { - map_field.is_map_field = true; - } else { - // False positive - type_parsed = true; - type_name = "map"; - } - } - if (map_field.is_map_field) { - if (field->has_oneof_index()) { - AddError("Map fields are not allowed in oneofs."); - return false; - } - if (field->has_label()) { - AddError( - "Field labels (required/optional/repeated) are not allowed on " - "map fields."); - return false; - } - if (field->has_extendee()) { - AddError("Map fields are not allowed to be extensions."); - return false; - } - field->set_label(FieldDescriptorProto::LABEL_REPEATED); - DO(Consume("<")); - DO(ParseType(&map_field.key_type, &map_field.key_type_name)); - DO(Consume(",")); - DO(ParseType(&map_field.value_type, &map_field.value_type_name)); - DO(Consume(">")); - // Defer setting of the type name of the map field until the - // field name is parsed. Add the source location though. - location.AddPath(FieldDescriptorProto::kTypeNameFieldNumber); - } else { - // Handle the case where no explicit label is given for a non-map field. - if (!field->has_label() && DefaultToOptionalFields()) { - field->set_label(FieldDescriptorProto::LABEL_OPTIONAL); - } - if (!field->has_label()) { - AddError("Expected \"required\", \"optional\", or \"repeated\"."); - // We can actually reasonably recover here by just assuming the user - // forgot the label altogether. - field->set_label(FieldDescriptorProto::LABEL_OPTIONAL); - } - - // Handle the case where the actual type is a message or enum named "map", - // which we already consumed in the code above. - if (!type_parsed) { - DO(ParseType(&type, &type_name)); - } - if (type_name.empty()) { - location.AddPath(FieldDescriptorProto::kTypeFieldNumber); - field->set_type(type); - } else { - location.AddPath(FieldDescriptorProto::kTypeNameFieldNumber); - field->set_type_name(type_name); - } - } - } - - // Parse name and '='. - io::Tokenizer::Token name_token = input_->current(); - { - LocationRecorder location(field_location, - FieldDescriptorProto::kNameFieldNumber); - location.RecordLegacyLocation(field, DescriptorPool::ErrorCollector::NAME); - DO(ConsumeIdentifier(field->mutable_name(), "Expected field name.")); - - if (!IsLowerUnderscore(field->name())) { - AddWarning( - "Field name should be lowercase. Found: " + field->name() + - ". See: https://developers.google.com/protocol-buffers/docs/style"); - } - if (IsNumberFollowUnderscore(field->name())) { - AddWarning( - "Number should not come right after an underscore. Found: " + - field->name() + - ". See: https://developers.google.com/protocol-buffers/docs/style"); - } - } - DO(Consume("=", "Missing field number.")); - - // Parse field number. - { - LocationRecorder location(field_location, - FieldDescriptorProto::kNumberFieldNumber); - location.RecordLegacyLocation(field, - DescriptorPool::ErrorCollector::NUMBER); - int number; - DO(ConsumeInteger(&number, "Expected field number.")); - field->set_number(number); - } - - // Parse options. - DO(ParseFieldOptions(field, field_location, containing_file)); - - // Deal with groups. - if (field->has_type() && field->type() == FieldDescriptorProto::TYPE_GROUP) { - // Awkward: Since a group declares both a message type and a field, we - // have to create overlapping locations. - LocationRecorder group_location(parent_location); - group_location.StartAt(field_location); - group_location.AddPath(location_field_number_for_nested_type); - group_location.AddPath(messages->size()); - - DescriptorProto* group = messages->Add(); - group->set_name(field->name()); - - // Record name location to match the field name's location. - { - LocationRecorder location(group_location, - DescriptorProto::kNameFieldNumber); - location.StartAt(name_token); - location.EndAt(name_token); - location.RecordLegacyLocation(group, - DescriptorPool::ErrorCollector::NAME); - } - - // The field's type_name also comes from the name. Confusing! - { - LocationRecorder location(field_location, - FieldDescriptorProto::kTypeNameFieldNumber); - location.StartAt(name_token); - location.EndAt(name_token); - } - - // As a hack for backwards-compatibility, we force the group name to start - // with a capital letter and lower-case the field name. New code should - // not use groups; it should use nested messages. - if (group->name()[0] < 'A' || 'Z' < group->name()[0]) { - AddError(name_token.line, name_token.column, - "Group names must start with a capital letter."); - } - LowerString(field->mutable_name()); - - field->set_type_name(group->name()); - if (LookingAt("{")) { - DO(ParseMessageBlock(group, group_location, containing_file)); - } else { - AddError("Missing group body."); - return false; - } - } else { - DO(ConsumeEndOfDeclaration(";", &field_location)); - } - - // Create a map entry type if this is a map field. - if (map_field.is_map_field) { - GenerateMapEntry(map_field, field, messages); - } - - return true; -} - -void Parser::GenerateMapEntry(const MapField& map_field, - FieldDescriptorProto* field, - RepeatedPtrField* messages) { - DescriptorProto* entry = messages->Add(); - std::string entry_name = MapEntryName(field->name()); - field->set_type_name(entry_name); - entry->set_name(entry_name); - entry->mutable_options()->set_map_entry(true); - FieldDescriptorProto* key_field = entry->add_field(); - key_field->set_name("key"); - key_field->set_label(FieldDescriptorProto::LABEL_OPTIONAL); - key_field->set_number(1); - if (map_field.key_type_name.empty()) { - key_field->set_type(map_field.key_type); - } else { - key_field->set_type_name(map_field.key_type_name); - } - FieldDescriptorProto* value_field = entry->add_field(); - value_field->set_name("value"); - value_field->set_label(FieldDescriptorProto::LABEL_OPTIONAL); - value_field->set_number(2); - if (map_field.value_type_name.empty()) { - value_field->set_type(map_field.value_type); - } else { - value_field->set_type_name(map_field.value_type_name); - } - // Propagate the "enforce_utf8" option to key and value fields if they - // are strings. This helps simplify the implementation of code generators - // and also reflection-based parsing code. - // - // The following definition: - // message Foo { - // map value = 1 [enforce_utf8 = false]; - // } - // will be interpreted as: - // message Foo { - // message ValueEntry { - // option map_entry = true; - // string key = 1 [enforce_utf8 = false]; - // string value = 2 [enforce_utf8 = false]; - // } - // repeated ValueEntry value = 1 [enforce_utf8 = false]; - // } - // - // TODO(xiaofeng): Remove this when the "enforce_utf8" option is removed - // from protocol compiler. - for (int i = 0; i < field->options().uninterpreted_option_size(); ++i) { - const UninterpretedOption& option = - field->options().uninterpreted_option(i); - if (option.name_size() == 1 && - option.name(0).name_part() == "enforce_utf8" && - !option.name(0).is_extension()) { - if (key_field->type() == FieldDescriptorProto::TYPE_STRING) { - key_field->mutable_options()->add_uninterpreted_option()->CopyFrom( - option); - } - if (value_field->type() == FieldDescriptorProto::TYPE_STRING) { - value_field->mutable_options()->add_uninterpreted_option()->CopyFrom( - option); - } - } - } -} - -bool Parser::ParseFieldOptions(FieldDescriptorProto* field, - const LocationRecorder& field_location, - const FileDescriptorProto* containing_file) { - if (!LookingAt("[")) return true; - - LocationRecorder location(field_location, - FieldDescriptorProto::kOptionsFieldNumber); - - DO(Consume("[")); - - // Parse field options. - do { - if (LookingAt("default")) { - // We intentionally pass field_location rather than location here, since - // the default value is not actually an option. - DO(ParseDefaultAssignment(field, field_location, containing_file)); - } else if (LookingAt("json_name")) { - // Like default value, this "json_name" is not an actual option. - DO(ParseJsonName(field, field_location, containing_file)); - } else { - DO(ParseOption(field->mutable_options(), location, containing_file, - OPTION_ASSIGNMENT)); - } - } while (TryConsume(",")); - - DO(Consume("]")); - return true; -} - -bool Parser::ParseDefaultAssignment( - FieldDescriptorProto* field, const LocationRecorder& field_location, - const FileDescriptorProto* containing_file) { - if (field->has_default_value()) { - AddError("Already set option \"default\"."); - field->clear_default_value(); - } - - DO(Consume("default")); - DO(Consume("=")); - - LocationRecorder location(field_location, - FieldDescriptorProto::kDefaultValueFieldNumber); - location.RecordLegacyLocation(field, - DescriptorPool::ErrorCollector::DEFAULT_VALUE); - std::string* default_value = field->mutable_default_value(); - - if (!field->has_type()) { - // The field has a type name, but we don't know if it is a message or an - // enum yet. (If it were a primitive type, |field| would have a type set - // already.) In this case, simply take the current string as the default - // value; we will catch the error later if it is not a valid enum value. - // (N.B. that we do not check whether the current token is an identifier: - // doing so throws strange errors when the user mistypes a primitive - // typename and we assume it's an enum. E.g.: "optional int foo = 1 [default - // = 42]". In such a case the fundamental error is really that "int" is not - // a type, not that "42" is not an identifier. See b/12533582.) - *default_value = input_->current().text; - input_->Next(); - return true; - } - - switch (field->type()) { - case FieldDescriptorProto::TYPE_INT32: - case FieldDescriptorProto::TYPE_INT64: - case FieldDescriptorProto::TYPE_SINT32: - case FieldDescriptorProto::TYPE_SINT64: - case FieldDescriptorProto::TYPE_SFIXED32: - case FieldDescriptorProto::TYPE_SFIXED64: { - uint64_t max_value = std::numeric_limits::max(); - if (field->type() == FieldDescriptorProto::TYPE_INT32 || - field->type() == FieldDescriptorProto::TYPE_SINT32 || - field->type() == FieldDescriptorProto::TYPE_SFIXED32) { - max_value = std::numeric_limits::max(); - } - - // These types can be negative. - if (TryConsume("-")) { - default_value->append("-"); - // Two's complement always has one more negative value than positive. - ++max_value; - } - // Parse the integer to verify that it is not out-of-range. - uint64_t value; - DO(ConsumeInteger64(max_value, &value, - "Expected integer for field default value.")); - // And stringify it again. - default_value->append(StrCat(value)); - break; - } - - case FieldDescriptorProto::TYPE_UINT32: - case FieldDescriptorProto::TYPE_UINT64: - case FieldDescriptorProto::TYPE_FIXED32: - case FieldDescriptorProto::TYPE_FIXED64: { - uint64_t max_value = std::numeric_limits::max(); - if (field->type() == FieldDescriptorProto::TYPE_UINT32 || - field->type() == FieldDescriptorProto::TYPE_FIXED32) { - max_value = std::numeric_limits::max(); - } - - // Numeric, not negative. - if (TryConsume("-")) { - AddError("Unsigned field can't have negative default value."); - } - // Parse the integer to verify that it is not out-of-range. - uint64_t value; - DO(ConsumeInteger64(max_value, &value, - "Expected integer for field default value.")); - // And stringify it again. - default_value->append(StrCat(value)); - break; - } - - case FieldDescriptorProto::TYPE_FLOAT: - case FieldDescriptorProto::TYPE_DOUBLE: - // These types can be negative. - if (TryConsume("-")) { - default_value->append("-"); - } - // Parse the integer because we have to convert hex integers to decimal - // floats. - double value; - DO(ConsumeNumber(&value, "Expected number.")); - // And stringify it again. - default_value->append(SimpleDtoa(value)); - break; - - case FieldDescriptorProto::TYPE_BOOL: - if (TryConsume("true")) { - default_value->assign("true"); - } else if (TryConsume("false")) { - default_value->assign("false"); - } else { - AddError("Expected \"true\" or \"false\"."); - return false; - } - break; - - case FieldDescriptorProto::TYPE_STRING: - // Note: When file option java_string_check_utf8 is true, if a - // non-string representation (eg byte[]) is later supported, it must - // be checked for UTF-8-ness. - DO(ConsumeString(default_value, - "Expected string for field default " - "value.")); - break; - - case FieldDescriptorProto::TYPE_BYTES: - DO(ConsumeString(default_value, "Expected string.")); - *default_value = CEscape(*default_value); - break; - - case FieldDescriptorProto::TYPE_ENUM: - DO(ConsumeIdentifier(default_value, - "Expected enum identifier for field " - "default value.")); - break; - - case FieldDescriptorProto::TYPE_MESSAGE: - case FieldDescriptorProto::TYPE_GROUP: - AddError("Messages can't have default values."); - return false; - } - - return true; -} - -bool Parser::ParseJsonName(FieldDescriptorProto* field, - const LocationRecorder& field_location, - const FileDescriptorProto* containing_file) { - if (field->has_json_name()) { - AddError("Already set option \"json_name\"."); - field->clear_json_name(); - } - - LocationRecorder location(field_location, - FieldDescriptorProto::kJsonNameFieldNumber); - location.RecordLegacyLocation(field, - DescriptorPool::ErrorCollector::OPTION_NAME); - - DO(Consume("json_name")); - DO(Consume("=")); - - LocationRecorder value_location(location); - value_location.RecordLegacyLocation( - field, DescriptorPool::ErrorCollector::OPTION_VALUE); - - DO(ConsumeString(field->mutable_json_name(), - "Expected string for JSON name.")); - return true; -} - -bool Parser::ParseOptionNamePart(UninterpretedOption* uninterpreted_option, - const LocationRecorder& part_location, - const FileDescriptorProto* containing_file) { - UninterpretedOption::NamePart* name = uninterpreted_option->add_name(); - std::string identifier; // We parse identifiers into this string. - if (LookingAt("(")) { // This is an extension. - DO(Consume("(")); - - { - LocationRecorder location( - part_location, UninterpretedOption::NamePart::kNamePartFieldNumber); - // An extension name consists of dot-separated identifiers, and may begin - // with a dot. - if (LookingAtType(io::Tokenizer::TYPE_IDENTIFIER)) { - DO(ConsumeIdentifier(&identifier, "Expected identifier.")); - name->mutable_name_part()->append(identifier); - } - while (LookingAt(".")) { - DO(Consume(".")); - name->mutable_name_part()->append("."); - DO(ConsumeIdentifier(&identifier, "Expected identifier.")); - name->mutable_name_part()->append(identifier); - } - } - - DO(Consume(")")); - name->set_is_extension(true); - } else { // This is a regular field. - LocationRecorder location( - part_location, UninterpretedOption::NamePart::kNamePartFieldNumber); - DO(ConsumeIdentifier(&identifier, "Expected identifier.")); - name->mutable_name_part()->append(identifier); - name->set_is_extension(false); - } - return true; -} - -bool Parser::ParseUninterpretedBlock(std::string* value) { - // Note that enclosing braces are not added to *value. - // We do NOT use ConsumeEndOfStatement for this brace because it's delimiting - // an expression, not a block of statements. - DO(Consume("{")); - int brace_depth = 1; - while (!AtEnd()) { - if (LookingAt("{")) { - brace_depth++; - } else if (LookingAt("}")) { - brace_depth--; - if (brace_depth == 0) { - input_->Next(); - return true; - } - } - // TODO(sanjay): Interpret line/column numbers to preserve formatting - if (!value->empty()) value->push_back(' '); - value->append(input_->current().text); - input_->Next(); - } - AddError("Unexpected end of stream while parsing aggregate value."); - return false; -} - -// We don't interpret the option here. Instead we store it in an -// UninterpretedOption, to be interpreted later. -bool Parser::ParseOption(Message* options, - const LocationRecorder& options_location, - const FileDescriptorProto* containing_file, - OptionStyle style) { - // Create an entry in the uninterpreted_option field. - const FieldDescriptor* uninterpreted_option_field = - options->GetDescriptor()->FindFieldByName("uninterpreted_option"); - GOOGLE_CHECK(uninterpreted_option_field != NULL) - << "No field named \"uninterpreted_option\" in the Options proto."; - - const Reflection* reflection = options->GetReflection(); - - LocationRecorder location( - options_location, uninterpreted_option_field->number(), - reflection->FieldSize(*options, uninterpreted_option_field)); - - if (style == OPTION_STATEMENT) { - DO(Consume("option")); - } - - UninterpretedOption* uninterpreted_option = - down_cast(options->GetReflection()->AddMessage( - options, uninterpreted_option_field)); - - // Parse dot-separated name. - { - LocationRecorder name_location(location, - UninterpretedOption::kNameFieldNumber); - name_location.RecordLegacyLocation( - uninterpreted_option, DescriptorPool::ErrorCollector::OPTION_NAME); - - { - LocationRecorder part_location(name_location, - uninterpreted_option->name_size()); - DO(ParseOptionNamePart(uninterpreted_option, part_location, - containing_file)); - } - - while (LookingAt(".")) { - DO(Consume(".")); - LocationRecorder part_location(name_location, - uninterpreted_option->name_size()); - DO(ParseOptionNamePart(uninterpreted_option, part_location, - containing_file)); - } - } - - DO(Consume("=")); - - { - LocationRecorder value_location(location); - value_location.RecordLegacyLocation( - uninterpreted_option, DescriptorPool::ErrorCollector::OPTION_VALUE); - - // All values are a single token, except for negative numbers, which consist - // of a single '-' symbol, followed by a positive number. - bool is_negative = TryConsume("-"); - - switch (input_->current().type) { - case io::Tokenizer::TYPE_START: - GOOGLE_LOG(FATAL) << "Trying to read value before any tokens have been read."; - return false; - - case io::Tokenizer::TYPE_END: - AddError("Unexpected end of stream while parsing option value."); - return false; - - case io::Tokenizer::TYPE_WHITESPACE: - case io::Tokenizer::TYPE_NEWLINE: - GOOGLE_CHECK(!input_->report_whitespace() && !input_->report_newlines()) - << "Whitespace tokens were not requested."; - GOOGLE_LOG(FATAL) << "Tokenizer reported whitespace."; - return false; - - case io::Tokenizer::TYPE_IDENTIFIER: { - value_location.AddPath( - UninterpretedOption::kIdentifierValueFieldNumber); - if (is_negative) { - AddError("Invalid '-' symbol before identifier."); - return false; - } - std::string value; - DO(ConsumeIdentifier(&value, "Expected identifier.")); - uninterpreted_option->set_identifier_value(value); - break; - } - - case io::Tokenizer::TYPE_INTEGER: { - uint64_t value; - uint64_t max_value = - is_negative - ? static_cast(std::numeric_limits::max()) + 1 - : std::numeric_limits::max(); - DO(ConsumeInteger64(max_value, &value, "Expected integer.")); - if (is_negative) { - value_location.AddPath( - UninterpretedOption::kNegativeIntValueFieldNumber); - uninterpreted_option->set_negative_int_value( - static_cast(0 - value)); - } else { - value_location.AddPath( - UninterpretedOption::kPositiveIntValueFieldNumber); - uninterpreted_option->set_positive_int_value(value); - } - break; - } - - case io::Tokenizer::TYPE_FLOAT: { - value_location.AddPath(UninterpretedOption::kDoubleValueFieldNumber); - double value; - DO(ConsumeNumber(&value, "Expected number.")); - uninterpreted_option->set_double_value(is_negative ? -value : value); - break; - } - - case io::Tokenizer::TYPE_STRING: { - value_location.AddPath(UninterpretedOption::kStringValueFieldNumber); - if (is_negative) { - AddError("Invalid '-' symbol before string."); - return false; - } - std::string value; - DO(ConsumeString(&value, "Expected string.")); - uninterpreted_option->set_string_value(value); - break; - } - - case io::Tokenizer::TYPE_SYMBOL: - if (LookingAt("{")) { - value_location.AddPath( - UninterpretedOption::kAggregateValueFieldNumber); - DO(ParseUninterpretedBlock( - uninterpreted_option->mutable_aggregate_value())); - } else { - AddError("Expected option value."); - return false; - } - break; - } - } - - if (style == OPTION_STATEMENT) { - DO(ConsumeEndOfDeclaration(";", &location)); - } - - return true; -} - -bool Parser::ParseExtensions(DescriptorProto* message, - const LocationRecorder& extensions_location, - const FileDescriptorProto* containing_file) { - // Parse the declaration. - DO(Consume("extensions")); - - int old_range_size = message->extension_range_size(); - - do { - // Note that kExtensionRangeFieldNumber was already pushed by the parent. - LocationRecorder location(extensions_location, - message->extension_range_size()); - - DescriptorProto::ExtensionRange* range = message->add_extension_range(); - location.RecordLegacyLocation(range, - DescriptorPool::ErrorCollector::NUMBER); - - int start, end; - io::Tokenizer::Token start_token; - - { - LocationRecorder start_location( - location, DescriptorProto::ExtensionRange::kStartFieldNumber); - start_token = input_->current(); - DO(ConsumeInteger(&start, "Expected field number range.")); - } - - if (TryConsume("to")) { - LocationRecorder end_location( - location, DescriptorProto::ExtensionRange::kEndFieldNumber); - if (TryConsume("max")) { - // Set to the sentinel value - 1 since we increment the value below. - // The actual value of the end of the range should be set with - // AdjustExtensionRangesWithMaxEndNumber. - end = kMaxRangeSentinel - 1; - } else { - DO(ConsumeInteger(&end, "Expected integer.")); - } - } else { - LocationRecorder end_location( - location, DescriptorProto::ExtensionRange::kEndFieldNumber); - end_location.StartAt(start_token); - end_location.EndAt(start_token); - end = start; - } - - // Users like to specify inclusive ranges, but in code we like the end - // number to be exclusive. - ++end; - - range->set_start(start); - range->set_end(end); - } while (TryConsume(",")); - - if (LookingAt("[")) { - int range_number_index = extensions_location.CurrentPathSize(); - SourceCodeInfo info; - - // Parse extension range options in the first range. - ExtensionRangeOptions* options = - message->mutable_extension_range(old_range_size)->mutable_options(); - - { - LocationRecorder index_location( - extensions_location, 0 /* we fill this in w/ actual index below */, - &info); - LocationRecorder location( - index_location, DescriptorProto::ExtensionRange::kOptionsFieldNumber); - DO(Consume("[")); - - do { - DO(ParseOption(options, location, containing_file, OPTION_ASSIGNMENT)); - } while (TryConsume(",")); - - DO(Consume("]")); - } - - // Then copy the extension range options to all of the other ranges we've - // parsed. - for (int i = old_range_size + 1; i < message->extension_range_size(); i++) { - message->mutable_extension_range(i)->mutable_options()->CopyFrom( - *options); - } - // and copy source locations to the other ranges, too - for (int i = old_range_size; i < message->extension_range_size(); i++) { - for (int j = 0; j < info.location_size(); j++) { - if (info.location(j).path_size() == range_number_index + 1) { - // this location's path is up to the extension range index, but - // doesn't include options; so it's redundant with location above - continue; - } - SourceCodeInfo_Location* dest = source_code_info_->add_location(); - *dest = info.location(j); - dest->set_path(range_number_index, i); - } - } - } - - DO(ConsumeEndOfDeclaration(";", &extensions_location)); - return true; -} - -// This is similar to extension range parsing, except that it accepts field -// name literals. -bool Parser::ParseReserved(DescriptorProto* message, - const LocationRecorder& message_location) { - io::Tokenizer::Token start_token = input_->current(); - // Parse the declaration. - DO(Consume("reserved")); - if (LookingAtType(io::Tokenizer::TYPE_STRING)) { - LocationRecorder location(message_location, - DescriptorProto::kReservedNameFieldNumber); - location.StartAt(start_token); - return ParseReservedNames(message, location); - } else { - LocationRecorder location(message_location, - DescriptorProto::kReservedRangeFieldNumber); - location.StartAt(start_token); - return ParseReservedNumbers(message, location); - } -} - -bool Parser::ParseReservedNames(DescriptorProto* message, - const LocationRecorder& parent_location) { - do { - LocationRecorder location(parent_location, message->reserved_name_size()); - DO(ConsumeString(message->add_reserved_name(), "Expected field name.")); - } while (TryConsume(",")); - DO(ConsumeEndOfDeclaration(";", &parent_location)); - return true; -} - -bool Parser::ParseReservedNumbers(DescriptorProto* message, - const LocationRecorder& parent_location) { - bool first = true; - do { - LocationRecorder location(parent_location, message->reserved_range_size()); - - DescriptorProto::ReservedRange* range = message->add_reserved_range(); - int start, end; - io::Tokenizer::Token start_token; - { - LocationRecorder start_location( - location, DescriptorProto::ReservedRange::kStartFieldNumber); - start_token = input_->current(); - DO(ConsumeInteger(&start, (first ? "Expected field name or number range." - : "Expected field number range."))); - } - - if (TryConsume("to")) { - LocationRecorder end_location( - location, DescriptorProto::ReservedRange::kEndFieldNumber); - if (TryConsume("max")) { - // Set to the sentinel value - 1 since we increment the value below. - // The actual value of the end of the range should be set with - // AdjustExtensionRangesWithMaxEndNumber. - end = kMaxRangeSentinel - 1; - } else { - DO(ConsumeInteger(&end, "Expected integer.")); - } - } else { - LocationRecorder end_location( - location, DescriptorProto::ReservedRange::kEndFieldNumber); - end_location.StartAt(start_token); - end_location.EndAt(start_token); - end = start; - } - - // Users like to specify inclusive ranges, but in code we like the end - // number to be exclusive. - ++end; - - range->set_start(start); - range->set_end(end); - first = false; - } while (TryConsume(",")); - - DO(ConsumeEndOfDeclaration(";", &parent_location)); - return true; -} - -bool Parser::ParseReserved(EnumDescriptorProto* message, - const LocationRecorder& message_location) { - io::Tokenizer::Token start_token = input_->current(); - // Parse the declaration. - DO(Consume("reserved")); - if (LookingAtType(io::Tokenizer::TYPE_STRING)) { - LocationRecorder location(message_location, - EnumDescriptorProto::kReservedNameFieldNumber); - location.StartAt(start_token); - return ParseReservedNames(message, location); - } else { - LocationRecorder location(message_location, - EnumDescriptorProto::kReservedRangeFieldNumber); - location.StartAt(start_token); - return ParseReservedNumbers(message, location); - } -} - -bool Parser::ParseReservedNames(EnumDescriptorProto* message, - const LocationRecorder& parent_location) { - do { - LocationRecorder location(parent_location, message->reserved_name_size()); - DO(ConsumeString(message->add_reserved_name(), "Expected enum value.")); - } while (TryConsume(",")); - DO(ConsumeEndOfDeclaration(";", &parent_location)); - return true; -} - -bool Parser::ParseReservedNumbers(EnumDescriptorProto* message, - const LocationRecorder& parent_location) { - bool first = true; - do { - LocationRecorder location(parent_location, message->reserved_range_size()); - - EnumDescriptorProto::EnumReservedRange* range = - message->add_reserved_range(); - int start, end; - io::Tokenizer::Token start_token; - { - LocationRecorder start_location( - location, EnumDescriptorProto::EnumReservedRange::kStartFieldNumber); - start_token = input_->current(); - DO(ConsumeSignedInteger(&start, - (first ? "Expected enum value or number range." - : "Expected enum number range."))); - } - - if (TryConsume("to")) { - LocationRecorder end_location( - location, EnumDescriptorProto::EnumReservedRange::kEndFieldNumber); - if (TryConsume("max")) { - // This is in the enum descriptor path, which doesn't have the message - // set duality to fix up, so it doesn't integrate with the sentinel. - end = INT_MAX; - } else { - DO(ConsumeSignedInteger(&end, "Expected integer.")); - } - } else { - LocationRecorder end_location( - location, EnumDescriptorProto::EnumReservedRange::kEndFieldNumber); - end_location.StartAt(start_token); - end_location.EndAt(start_token); - end = start; - } - - range->set_start(start); - range->set_end(end); - first = false; - } while (TryConsume(",")); - - DO(ConsumeEndOfDeclaration(";", &parent_location)); - return true; -} - -bool Parser::ParseExtend(RepeatedPtrField* extensions, - RepeatedPtrField* messages, - const LocationRecorder& parent_location, - int location_field_number_for_nested_type, - const LocationRecorder& extend_location, - const FileDescriptorProto* containing_file) { - DO(Consume("extend")); - - // Parse the extendee type. - io::Tokenizer::Token extendee_start = input_->current(); - std::string extendee; - DO(ParseUserDefinedType(&extendee)); - io::Tokenizer::Token extendee_end = input_->previous(); - - // Parse the block. - DO(ConsumeEndOfDeclaration("{", &extend_location)); - - bool is_first = true; - - do { - if (AtEnd()) { - AddError("Reached end of input in extend definition (missing '}')."); - return false; - } - - // Note that kExtensionFieldNumber was already pushed by the parent. - LocationRecorder location(extend_location, extensions->size()); - - FieldDescriptorProto* field = extensions->Add(); - - { - LocationRecorder extendee_location( - location, FieldDescriptorProto::kExtendeeFieldNumber); - extendee_location.StartAt(extendee_start); - extendee_location.EndAt(extendee_end); - - if (is_first) { - extendee_location.RecordLegacyLocation( - field, DescriptorPool::ErrorCollector::EXTENDEE); - is_first = false; - } - } - - field->set_extendee(extendee); - - if (!ParseMessageField(field, messages, parent_location, - location_field_number_for_nested_type, location, - containing_file)) { - // This statement failed to parse. Skip it, but keep looping to parse - // other statements. - SkipStatement(); - } - } while (!TryConsumeEndOfDeclaration("}", NULL)); - - return true; -} - -bool Parser::ParseOneof(OneofDescriptorProto* oneof_decl, - DescriptorProto* containing_type, int oneof_index, - const LocationRecorder& oneof_location, - const LocationRecorder& containing_type_location, - const FileDescriptorProto* containing_file) { - DO(Consume("oneof")); - - { - LocationRecorder name_location(oneof_location, - OneofDescriptorProto::kNameFieldNumber); - DO(ConsumeIdentifier(oneof_decl->mutable_name(), "Expected oneof name.")); - } - - DO(ConsumeEndOfDeclaration("{", &oneof_location)); - - do { - if (AtEnd()) { - AddError("Reached end of input in oneof definition (missing '}')."); - return false; - } - - if (LookingAt("option")) { - LocationRecorder option_location( - oneof_location, OneofDescriptorProto::kOptionsFieldNumber); - if (!ParseOption(oneof_decl->mutable_options(), option_location, - containing_file, OPTION_STATEMENT)) { - return false; - } - continue; - } - - // Print a nice error if the user accidentally tries to place a label - // on an individual member of a oneof. - if (LookingAt("required") || LookingAt("optional") || - LookingAt("repeated")) { - AddError( - "Fields in oneofs must not have labels (required / optional " - "/ repeated)."); - // We can continue parsing here because we understand what the user - // meant. The error report will still make parsing fail overall. - input_->Next(); - } - - LocationRecorder field_location(containing_type_location, - DescriptorProto::kFieldFieldNumber, - containing_type->field_size()); - - FieldDescriptorProto* field = containing_type->add_field(); - field->set_label(FieldDescriptorProto::LABEL_OPTIONAL); - field->set_oneof_index(oneof_index); - - if (!ParseMessageFieldNoLabel(field, containing_type->mutable_nested_type(), - containing_type_location, - DescriptorProto::kNestedTypeFieldNumber, - field_location, containing_file)) { - // This statement failed to parse. Skip it, but keep looping to parse - // other statements. - SkipStatement(); - } - } while (!TryConsumeEndOfDeclaration("}", NULL)); - - return true; -} - -// ------------------------------------------------------------------- -// Enums - -bool Parser::ParseEnumDefinition(EnumDescriptorProto* enum_type, - const LocationRecorder& enum_location, - const FileDescriptorProto* containing_file) { - DO(Consume("enum")); - - { - LocationRecorder location(enum_location, - EnumDescriptorProto::kNameFieldNumber); - location.RecordLegacyLocation(enum_type, - DescriptorPool::ErrorCollector::NAME); - DO(ConsumeIdentifier(enum_type->mutable_name(), "Expected enum name.")); - } - - DO(ParseEnumBlock(enum_type, enum_location, containing_file)); - - DO(ValidateEnum(enum_type)); - - return true; -} - -bool Parser::ParseEnumBlock(EnumDescriptorProto* enum_type, - const LocationRecorder& enum_location, - const FileDescriptorProto* containing_file) { - DO(ConsumeEndOfDeclaration("{", &enum_location)); - - while (!TryConsumeEndOfDeclaration("}", NULL)) { - if (AtEnd()) { - AddError("Reached end of input in enum definition (missing '}')."); - return false; - } - - if (!ParseEnumStatement(enum_type, enum_location, containing_file)) { - // This statement failed to parse. Skip it, but keep looping to parse - // other statements. - SkipStatement(); - } - } - - return true; -} - -bool Parser::ParseEnumStatement(EnumDescriptorProto* enum_type, - const LocationRecorder& enum_location, - const FileDescriptorProto* containing_file) { - if (TryConsumeEndOfDeclaration(";", NULL)) { - // empty statement; ignore - return true; - } else if (LookingAt("option")) { - LocationRecorder location(enum_location, - EnumDescriptorProto::kOptionsFieldNumber); - return ParseOption(enum_type->mutable_options(), location, containing_file, - OPTION_STATEMENT); - } else if (LookingAt("reserved")) { - return ParseReserved(enum_type, enum_location); - } else { - LocationRecorder location(enum_location, - EnumDescriptorProto::kValueFieldNumber, - enum_type->value_size()); - return ParseEnumConstant(enum_type->add_value(), location, containing_file); - } -} - -bool Parser::ParseEnumConstant(EnumValueDescriptorProto* enum_value, - const LocationRecorder& enum_value_location, - const FileDescriptorProto* containing_file) { - // Parse name. - { - LocationRecorder location(enum_value_location, - EnumValueDescriptorProto::kNameFieldNumber); - location.RecordLegacyLocation(enum_value, - DescriptorPool::ErrorCollector::NAME); - DO(ConsumeIdentifier(enum_value->mutable_name(), - "Expected enum constant name.")); - } - - DO(Consume("=", "Missing numeric value for enum constant.")); - - // Parse value. - { - LocationRecorder location(enum_value_location, - EnumValueDescriptorProto::kNumberFieldNumber); - location.RecordLegacyLocation(enum_value, - DescriptorPool::ErrorCollector::NUMBER); - - int number; - DO(ConsumeSignedInteger(&number, "Expected integer.")); - enum_value->set_number(number); - } - - DO(ParseEnumConstantOptions(enum_value, enum_value_location, - containing_file)); - - DO(ConsumeEndOfDeclaration(";", &enum_value_location)); - - return true; -} - -bool Parser::ParseEnumConstantOptions( - EnumValueDescriptorProto* value, - const LocationRecorder& enum_value_location, - const FileDescriptorProto* containing_file) { - if (!LookingAt("[")) return true; - - LocationRecorder location(enum_value_location, - EnumValueDescriptorProto::kOptionsFieldNumber); - - DO(Consume("[")); - - do { - DO(ParseOption(value->mutable_options(), location, containing_file, - OPTION_ASSIGNMENT)); - } while (TryConsume(",")); - - DO(Consume("]")); - return true; -} - -// ------------------------------------------------------------------- -// Services - -bool Parser::ParseServiceDefinition( - ServiceDescriptorProto* service, const LocationRecorder& service_location, - const FileDescriptorProto* containing_file) { - DO(Consume("service")); - - { - LocationRecorder location(service_location, - ServiceDescriptorProto::kNameFieldNumber); - location.RecordLegacyLocation(service, - DescriptorPool::ErrorCollector::NAME); - DO(ConsumeIdentifier(service->mutable_name(), "Expected service name.")); - } - - DO(ParseServiceBlock(service, service_location, containing_file)); - return true; -} - -bool Parser::ParseServiceBlock(ServiceDescriptorProto* service, - const LocationRecorder& service_location, - const FileDescriptorProto* containing_file) { - DO(ConsumeEndOfDeclaration("{", &service_location)); - - while (!TryConsumeEndOfDeclaration("}", NULL)) { - if (AtEnd()) { - AddError("Reached end of input in service definition (missing '}')."); - return false; - } - - if (!ParseServiceStatement(service, service_location, containing_file)) { - // This statement failed to parse. Skip it, but keep looping to parse - // other statements. - SkipStatement(); - } - } - - return true; -} - -bool Parser::ParseServiceStatement(ServiceDescriptorProto* service, - const LocationRecorder& service_location, - const FileDescriptorProto* containing_file) { - if (TryConsumeEndOfDeclaration(";", NULL)) { - // empty statement; ignore - return true; - } else if (LookingAt("option")) { - LocationRecorder location(service_location, - ServiceDescriptorProto::kOptionsFieldNumber); - return ParseOption(service->mutable_options(), location, containing_file, - OPTION_STATEMENT); - } else { - LocationRecorder location(service_location, - ServiceDescriptorProto::kMethodFieldNumber, - service->method_size()); - return ParseServiceMethod(service->add_method(), location, containing_file); - } -} - -bool Parser::ParseServiceMethod(MethodDescriptorProto* method, - const LocationRecorder& method_location, - const FileDescriptorProto* containing_file) { - DO(Consume("rpc")); - - { - LocationRecorder location(method_location, - MethodDescriptorProto::kNameFieldNumber); - location.RecordLegacyLocation(method, DescriptorPool::ErrorCollector::NAME); - DO(ConsumeIdentifier(method->mutable_name(), "Expected method name.")); - } - - // Parse input type. - DO(Consume("(")); - { - if (LookingAt("stream")) { - LocationRecorder location( - method_location, MethodDescriptorProto::kClientStreamingFieldNumber); - location.RecordLegacyLocation(method, - DescriptorPool::ErrorCollector::OTHER); - method->set_client_streaming(true); - DO(Consume("stream")); - - } - LocationRecorder location(method_location, - MethodDescriptorProto::kInputTypeFieldNumber); - location.RecordLegacyLocation(method, - DescriptorPool::ErrorCollector::INPUT_TYPE); - DO(ParseUserDefinedType(method->mutable_input_type())); - } - DO(Consume(")")); - - // Parse output type. - DO(Consume("returns")); - DO(Consume("(")); - { - if (LookingAt("stream")) { - LocationRecorder location( - method_location, MethodDescriptorProto::kServerStreamingFieldNumber); - location.RecordLegacyLocation(method, - DescriptorPool::ErrorCollector::OTHER); - DO(Consume("stream")); - method->set_server_streaming(true); - - } - LocationRecorder location(method_location, - MethodDescriptorProto::kOutputTypeFieldNumber); - location.RecordLegacyLocation(method, - DescriptorPool::ErrorCollector::OUTPUT_TYPE); - DO(ParseUserDefinedType(method->mutable_output_type())); - } - DO(Consume(")")); - - if (LookingAt("{")) { - // Options! - DO(ParseMethodOptions(method_location, containing_file, - MethodDescriptorProto::kOptionsFieldNumber, - method->mutable_options())); - } else { - DO(ConsumeEndOfDeclaration(";", &method_location)); - } - - return true; -} - -bool Parser::ParseMethodOptions(const LocationRecorder& parent_location, - const FileDescriptorProto* containing_file, - const int optionsFieldNumber, - Message* mutable_options) { - // Options! - ConsumeEndOfDeclaration("{", &parent_location); - while (!TryConsumeEndOfDeclaration("}", NULL)) { - if (AtEnd()) { - AddError("Reached end of input in method options (missing '}')."); - return false; - } - - if (TryConsumeEndOfDeclaration(";", NULL)) { - // empty statement; ignore - } else { - LocationRecorder location(parent_location, optionsFieldNumber); - if (!ParseOption(mutable_options, location, containing_file, - OPTION_STATEMENT)) { - // This statement failed to parse. Skip it, but keep looping to - // parse other statements. - SkipStatement(); - } - } - } - - return true; -} - -// ------------------------------------------------------------------- - -bool Parser::ParseLabel(FieldDescriptorProto::Label* label, - const LocationRecorder& field_location, - const FileDescriptorProto* containing_file) { - if (!LookingAt("optional") && !LookingAt("repeated") && - !LookingAt("required")) { - return false; - } - LocationRecorder location(field_location, - FieldDescriptorProto::kLabelFieldNumber); - if (TryConsume("optional")) { - *label = FieldDescriptorProto::LABEL_OPTIONAL; - } else if (TryConsume("repeated")) { - *label = FieldDescriptorProto::LABEL_REPEATED; - } else { - Consume("required"); - *label = FieldDescriptorProto::LABEL_REQUIRED; - } - return true; -} - -bool Parser::ParseType(FieldDescriptorProto::Type* type, - std::string* type_name) { - TypeNameMap::const_iterator iter = kTypeNames.find(input_->current().text); - if (iter != kTypeNames.end()) { - *type = iter->second; - input_->Next(); - } else { - DO(ParseUserDefinedType(type_name)); - } - return true; -} - -bool Parser::ParseUserDefinedType(std::string* type_name) { - type_name->clear(); - - TypeNameMap::const_iterator iter = kTypeNames.find(input_->current().text); - if (iter != kTypeNames.end()) { - // Note: The only place enum types are allowed is for field types, but - // if we are parsing a field type then we would not get here because - // primitives are allowed there as well. So this error message doesn't - // need to account for enums. - AddError("Expected message type."); - - // Pretend to accept this type so that we can go on parsing. - *type_name = input_->current().text; - input_->Next(); - return true; - } - - // A leading "." means the name is fully-qualified. - if (TryConsume(".")) type_name->append("."); - - // Consume the first part of the name. - std::string identifier; - DO(ConsumeIdentifier(&identifier, "Expected type name.")); - type_name->append(identifier); - - // Consume more parts. - while (TryConsume(".")) { - type_name->append("."); - DO(ConsumeIdentifier(&identifier, "Expected identifier.")); - type_name->append(identifier); - } - - return true; -} - -// =================================================================== - -bool Parser::ParsePackage(FileDescriptorProto* file, - const LocationRecorder& root_location, - const FileDescriptorProto* containing_file) { - if (file->has_package()) { - AddError("Multiple package definitions."); - // Don't append the new package to the old one. Just replace it. Not - // that it really matters since this is an error anyway. - file->clear_package(); - } - - LocationRecorder location(root_location, - FileDescriptorProto::kPackageFieldNumber); - location.RecordLegacyLocation(file, DescriptorPool::ErrorCollector::NAME); - - DO(Consume("package")); - - while (true) { - std::string identifier; - DO(ConsumeIdentifier(&identifier, "Expected identifier.")); - file->mutable_package()->append(identifier); - if (!TryConsume(".")) break; - file->mutable_package()->append("."); - } - - DO(ConsumeEndOfDeclaration(";", &location)); - - return true; -} - -bool Parser::ParseImport(RepeatedPtrField* dependency, - RepeatedField* public_dependency, - RepeatedField* weak_dependency, - const LocationRecorder& root_location, - const FileDescriptorProto* containing_file) { - LocationRecorder location(root_location, - FileDescriptorProto::kDependencyFieldNumber, - dependency->size()); - - DO(Consume("import")); - - if (LookingAt("public")) { - LocationRecorder public_location( - root_location, FileDescriptorProto::kPublicDependencyFieldNumber, - public_dependency->size()); - DO(Consume("public")); - *public_dependency->Add() = dependency->size(); - } else if (LookingAt("weak")) { - LocationRecorder weak_location( - root_location, FileDescriptorProto::kWeakDependencyFieldNumber, - weak_dependency->size()); - weak_location.RecordLegacyImportLocation(containing_file, "weak"); - DO(Consume("weak")); - *weak_dependency->Add() = dependency->size(); - } - - std::string import_file; - DO(ConsumeString(&import_file, - "Expected a string naming the file to import.")); - *dependency->Add() = import_file; - location.RecordLegacyImportLocation(containing_file, import_file); - - DO(ConsumeEndOfDeclaration(";", &location)); - - return true; -} - -// =================================================================== - -SourceLocationTable::SourceLocationTable() {} -SourceLocationTable::~SourceLocationTable() {} - -bool SourceLocationTable::Find( - const Message* descriptor, - DescriptorPool::ErrorCollector::ErrorLocation location, int* line, - int* column) const { - const std::pair* result = - FindOrNull(location_map_, std::make_pair(descriptor, location)); - if (result == NULL) { - *line = -1; - *column = 0; - return false; - } else { - *line = result->first; - *column = result->second; - return true; - } -} - -bool SourceLocationTable::FindImport(const Message* descriptor, - const std::string& name, int* line, - int* column) const { - const std::pair* result = - FindOrNull(import_location_map_, std::make_pair(descriptor, name)); - if (result == nullptr) { - *line = -1; - *column = 0; - return false; - } else { - *line = result->first; - *column = result->second; - return true; - } -} - -void SourceLocationTable::Add( - const Message* descriptor, - DescriptorPool::ErrorCollector::ErrorLocation location, int line, - int column) { - location_map_[std::make_pair(descriptor, location)] = - std::make_pair(line, column); -} - -void SourceLocationTable::AddImport(const Message* descriptor, - const std::string& name, int line, - int column) { - import_location_map_[std::make_pair(descriptor, name)] = - std::make_pair(line, column); -} - -void SourceLocationTable::Clear() { location_map_.clear(); } - -} // namespace compiler -} // namespace protobuf -} // namespace google diff --git a/extra/protobuf/protobuf-3.19.4/src/google/protobuf/compiler/parser.h b/extra/protobuf/protobuf-3.19.4/src/google/protobuf/compiler/parser.h deleted file mode 100644 index b5a5df89969b..000000000000 --- a/extra/protobuf/protobuf-3.19.4/src/google/protobuf/compiler/parser.h +++ /dev/null @@ -1,603 +0,0 @@ -// Protocol Buffers - Google's data interchange format -// Copyright 2008 Google Inc. All rights reserved. -// https://developers.google.com/protocol-buffers/ -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// * Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// * Redistributions in binary form must reproduce the above -// copyright notice, this list of conditions and the following disclaimer -// in the documentation and/or other materials provided with the -// distribution. -// * Neither the name of Google Inc. nor the names of its -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -// Author: kenton@google.com (Kenton Varda) -// Based on original Protocol Buffers design by -// Sanjay Ghemawat, Jeff Dean, and others. -// -// Implements parsing of .proto files to FileDescriptorProtos. - -#ifndef GOOGLE_PROTOBUF_COMPILER_PARSER_H__ -#define GOOGLE_PROTOBUF_COMPILER_PARSER_H__ - -#include -#include -#include -#include - -#include -#include -#include -#include - -// Must be included last. -#include - -namespace google { -namespace protobuf { - -class Message; - -namespace compiler { - -// Defined in this file. -class Parser; -class SourceLocationTable; - -// Implements parsing of protocol definitions (such as .proto files). -// -// Note that most users will be more interested in the Importer class. -// Parser is a lower-level class which simply converts a single .proto file -// to a FileDescriptorProto. It does not resolve import directives or perform -// many other kinds of validation needed to construct a complete -// FileDescriptor. -class PROTOBUF_EXPORT Parser { - public: - Parser(); - ~Parser(); - - // Parse the entire input and construct a FileDescriptorProto representing - // it. Returns true if no errors occurred, false otherwise. - bool Parse(io::Tokenizer* input, FileDescriptorProto* file); - - // Optional features: - - // DEPRECATED: New code should use the SourceCodeInfo embedded in the - // FileDescriptorProto. - // - // Requests that locations of certain definitions be recorded to the given - // SourceLocationTable while parsing. This can be used to look up exact line - // and column numbers for errors reported by DescriptorPool during validation. - // Set to NULL (the default) to discard source location information. - void RecordSourceLocationsTo(SourceLocationTable* location_table) { - source_location_table_ = location_table; - } - - // Requests that errors be recorded to the given ErrorCollector while - // parsing. Set to NULL (the default) to discard error messages. - void RecordErrorsTo(io::ErrorCollector* error_collector) { - error_collector_ = error_collector; - } - - // Returns the identifier used in the "syntax = " declaration, if one was - // seen during the last call to Parse(), or the empty string otherwise. - const std::string& GetSyntaxIdentifier() { return syntax_identifier_; } - - // If set true, input files will be required to begin with a syntax - // identifier. Otherwise, files may omit this. If a syntax identifier - // is provided, it must be 'syntax = "proto2";' and must appear at the - // top of this file regardless of whether or not it was required. - void SetRequireSyntaxIdentifier(bool value) { - require_syntax_identifier_ = value; - } - - // Call SetStopAfterSyntaxIdentifier(true) to tell the parser to stop - // parsing as soon as it has seen the syntax identifier, or lack thereof. - // This is useful for quickly identifying the syntax of the file without - // parsing the whole thing. If this is enabled, no error will be recorded - // if the syntax identifier is something other than "proto2" (since - // presumably the caller intends to deal with that), but other kinds of - // errors (e.g. parse errors) will still be reported. When this is enabled, - // you may pass a NULL FileDescriptorProto to Parse(). - void SetStopAfterSyntaxIdentifier(bool value) { - stop_after_syntax_identifier_ = value; - } - - private: - class LocationRecorder; - - // ================================================================= - // Error recovery helpers - - // Consume the rest of the current statement. This consumes tokens - // until it sees one of: - // ';' Consumes the token and returns. - // '{' Consumes the brace then calls SkipRestOfBlock(). - // '}' Returns without consuming. - // EOF Returns (can't consume). - // The Parser often calls SkipStatement() after encountering a syntax - // error. This allows it to go on parsing the following lines, allowing - // it to report more than just one error in the file. - void SkipStatement(); - - // Consume the rest of the current block, including nested blocks, - // ending after the closing '}' is encountered and consumed, or at EOF. - void SkipRestOfBlock(); - - // ----------------------------------------------------------------- - // Single-token consuming helpers - // - // These make parsing code more readable. - - // True if the current token is TYPE_END. - inline bool AtEnd(); - - // True if the next token matches the given text. - inline bool LookingAt(const char* text); - // True if the next token is of the given type. - inline bool LookingAtType(io::Tokenizer::TokenType token_type); - - // If the next token exactly matches the text given, consume it and return - // true. Otherwise, return false without logging an error. - bool TryConsume(const char* text); - - // These attempt to read some kind of token from the input. If successful, - // they return true. Otherwise they return false and add the given error - // to the error list. - - // Consume a token with the exact text given. - bool Consume(const char* text, const char* error); - // Same as above, but automatically generates the error "Expected \"text\".", - // where "text" is the expected token text. - bool Consume(const char* text); - // Consume a token of type IDENTIFIER and store its text in "output". - bool ConsumeIdentifier(std::string* output, const char* error); - // Consume an integer and store its value in "output". - bool ConsumeInteger(int* output, const char* error); - // Consume a signed integer and store its value in "output". - bool ConsumeSignedInteger(int* output, const char* error); - // Consume a 64-bit integer and store its value in "output". If the value - // is greater than max_value, an error will be reported. - bool ConsumeInteger64(uint64_t max_value, uint64_t* output, - const char* error); - // Consume a number and store its value in "output". This will accept - // tokens of either INTEGER or FLOAT type. - bool ConsumeNumber(double* output, const char* error); - // Consume a string literal and store its (unescaped) value in "output". - bool ConsumeString(std::string* output, const char* error); - - // Consume a token representing the end of the statement. Comments between - // this token and the next will be harvested for documentation. The given - // LocationRecorder should refer to the declaration that was just parsed; - // it will be populated with these comments. - // - // TODO(kenton): The LocationRecorder is const because historically locations - // have been passed around by const reference, for no particularly good - // reason. We should probably go through and change them all to mutable - // pointer to make this more intuitive. - bool TryConsumeEndOfDeclaration(const char* text, - const LocationRecorder* location); - bool TryConsumeEndOfDeclarationFinishScope(const char* text, - const LocationRecorder* location); - - bool ConsumeEndOfDeclaration(const char* text, - const LocationRecorder* location); - - // ----------------------------------------------------------------- - // Error logging helpers - - // Invokes error_collector_->AddError(), if error_collector_ is not NULL. - void AddError(int line, int column, const std::string& error); - - // Invokes error_collector_->AddError() with the line and column number - // of the current token. - void AddError(const std::string& error); - - // Invokes error_collector_->AddWarning() with the line and column number - // of the current token. - void AddWarning(const std::string& warning); - - // Records a location in the SourceCodeInfo.location table (see - // descriptor.proto). We use RAII to ensure that the start and end locations - // are recorded -- the constructor records the start location and the - // destructor records the end location. Since the parser is - // recursive-descent, this works out beautifully. - class PROTOBUF_EXPORT LocationRecorder { - public: - // Construct the file's "root" location. - LocationRecorder(Parser* parser); - - // Construct a location that represents a declaration nested within the - // given parent. E.g. a field's location is nested within the location - // for a message type. The parent's path will be copied, so you should - // call AddPath() only to add the path components leading from the parent - // to the child (as opposed to leading from the root to the child). - LocationRecorder(const LocationRecorder& parent); - - // Convenience constructors that call AddPath() one or two times. - LocationRecorder(const LocationRecorder& parent, int path1); - LocationRecorder(const LocationRecorder& parent, int path1, int path2); - - // Creates a recorder that generates locations into given source code info. - LocationRecorder(const LocationRecorder& parent, int path1, - SourceCodeInfo* source_code_info); - - ~LocationRecorder(); - - // Add a path component. See SourceCodeInfo.Location.path in - // descriptor.proto. - void AddPath(int path_component); - - // By default the location is considered to start at the current token at - // the time the LocationRecorder is created. StartAt() sets the start - // location to the given token instead. - void StartAt(const io::Tokenizer::Token& token); - - // Start at the same location as some other LocationRecorder. - void StartAt(const LocationRecorder& other); - - // By default the location is considered to end at the previous token at - // the time the LocationRecorder is destroyed. EndAt() sets the end - // location to the given token instead. - void EndAt(const io::Tokenizer::Token& token); - - // Records the start point of this location to the SourceLocationTable that - // was passed to RecordSourceLocationsTo(), if any. SourceLocationTable - // is an older way of keeping track of source locations which is still - // used in some places. - void RecordLegacyLocation( - const Message* descriptor, - DescriptorPool::ErrorCollector::ErrorLocation location); - void RecordLegacyImportLocation(const Message* descriptor, - const std::string& name); - - // Returns the number of path components in the recorder's current location. - int CurrentPathSize() const; - - // Attaches leading and trailing comments to the location. The two strings - // will be swapped into place, so after this is called *leading and - // *trailing will be empty. - // - // TODO(kenton): See comment on TryConsumeEndOfDeclaration(), above, for - // why this is const. - void AttachComments(std::string* leading, std::string* trailing, - std::vector* detached_comments) const; - - private: - // Indexes of parent and current location in the parent - // SourceCodeInfo.location repeated field. For top-level elements, - // parent_index_ is -1. - Parser* parser_; - SourceCodeInfo* source_code_info_; - SourceCodeInfo::Location* location_; - - void Init(const LocationRecorder& parent, SourceCodeInfo* source_code_info); - }; - - // ================================================================= - // Parsers for various language constructs - - // Parses the "syntax = \"proto2\";" line at the top of the file. Returns - // false if it failed to parse or if the syntax identifier was not - // recognized. - bool ParseSyntaxIdentifier(const LocationRecorder& parent); - - // These methods parse various individual bits of code. They return - // false if they completely fail to parse the construct. In this case, - // it is probably necessary to skip the rest of the statement to recover. - // However, if these methods return true, it does NOT mean that there - // were no errors; only that there were no *syntax* errors. For instance, - // if a service method is defined using proper syntax but uses a primitive - // type as its input or output, ParseMethodField() still returns true - // and only reports the error by calling AddError(). In practice, this - // makes logic much simpler for the caller. - - // Parse a top-level message, enum, service, etc. - bool ParseTopLevelStatement(FileDescriptorProto* file, - const LocationRecorder& root_location); - - // Parse various language high-level language construrcts. - bool ParseMessageDefinition(DescriptorProto* message, - const LocationRecorder& message_location, - const FileDescriptorProto* containing_file); - bool ParseEnumDefinition(EnumDescriptorProto* enum_type, - const LocationRecorder& enum_location, - const FileDescriptorProto* containing_file); - bool ParseServiceDefinition(ServiceDescriptorProto* service, - const LocationRecorder& service_location, - const FileDescriptorProto* containing_file); - bool ParsePackage(FileDescriptorProto* file, - const LocationRecorder& root_location, - const FileDescriptorProto* containing_file); - bool ParseImport(RepeatedPtrField* dependency, - RepeatedField* public_dependency, - RepeatedField* weak_dependency, - const LocationRecorder& root_location, - const FileDescriptorProto* containing_file); - - // These methods parse the contents of a message, enum, or service type and - // add them to the given object. They consume the entire block including - // the beginning and ending brace. - bool ParseMessageBlock(DescriptorProto* message, - const LocationRecorder& message_location, - const FileDescriptorProto* containing_file); - bool ParseEnumBlock(EnumDescriptorProto* enum_type, - const LocationRecorder& enum_location, - const FileDescriptorProto* containing_file); - bool ParseServiceBlock(ServiceDescriptorProto* service, - const LocationRecorder& service_location, - const FileDescriptorProto* containing_file); - - // Parse one statement within a message, enum, or service block, including - // final semicolon. - bool ParseMessageStatement(DescriptorProto* message, - const LocationRecorder& message_location, - const FileDescriptorProto* containing_file); - bool ParseEnumStatement(EnumDescriptorProto* message, - const LocationRecorder& enum_location, - const FileDescriptorProto* containing_file); - bool ParseServiceStatement(ServiceDescriptorProto* message, - const LocationRecorder& service_location, - const FileDescriptorProto* containing_file); - - // Parse a field of a message. If the field is a group, its type will be - // added to "messages". - // - // parent_location and location_field_number_for_nested_type are needed when - // parsing groups -- we need to generate a nested message type within the - // parent and record its location accordingly. Since the parent could be - // either a FileDescriptorProto or a DescriptorProto, we must pass in the - // correct field number to use. - bool ParseMessageField(FieldDescriptorProto* field, - RepeatedPtrField* messages, - const LocationRecorder& parent_location, - int location_field_number_for_nested_type, - const LocationRecorder& field_location, - const FileDescriptorProto* containing_file); - - // Like ParseMessageField() but expects the label has already been filled in - // by the caller. - bool ParseMessageFieldNoLabel(FieldDescriptorProto* field, - RepeatedPtrField* messages, - const LocationRecorder& parent_location, - int location_field_number_for_nested_type, - const LocationRecorder& field_location, - const FileDescriptorProto* containing_file); - - // Parse an "extensions" declaration. - bool ParseExtensions(DescriptorProto* message, - const LocationRecorder& extensions_location, - const FileDescriptorProto* containing_file); - - // Parse a "reserved" declaration. - bool ParseReserved(DescriptorProto* message, - const LocationRecorder& message_location); - bool ParseReservedNames(DescriptorProto* message, - const LocationRecorder& parent_location); - bool ParseReservedNumbers(DescriptorProto* message, - const LocationRecorder& parent_location); - bool ParseReserved(EnumDescriptorProto* message, - const LocationRecorder& message_location); - bool ParseReservedNames(EnumDescriptorProto* message, - const LocationRecorder& parent_location); - bool ParseReservedNumbers(EnumDescriptorProto* message, - const LocationRecorder& parent_location); - - // Parse an "extend" declaration. (See also comments for - // ParseMessageField().) - bool ParseExtend(RepeatedPtrField* extensions, - RepeatedPtrField* messages, - const LocationRecorder& parent_location, - int location_field_number_for_nested_type, - const LocationRecorder& extend_location, - const FileDescriptorProto* containing_file); - - // Parse a "oneof" declaration. The caller is responsible for setting - // oneof_decl->label() since it will have had to parse the label before it - // knew it was parsing a oneof. - bool ParseOneof(OneofDescriptorProto* oneof_decl, - DescriptorProto* containing_type, int oneof_index, - const LocationRecorder& oneof_location, - const LocationRecorder& containing_type_location, - const FileDescriptorProto* containing_file); - - // Parse a single enum value within an enum block. - bool ParseEnumConstant(EnumValueDescriptorProto* enum_value, - const LocationRecorder& enum_value_location, - const FileDescriptorProto* containing_file); - - // Parse enum constant options, i.e. the list in square brackets at the end - // of the enum constant value definition. - bool ParseEnumConstantOptions(EnumValueDescriptorProto* value, - const LocationRecorder& enum_value_location, - const FileDescriptorProto* containing_file); - - // Parse a single method within a service definition. - bool ParseServiceMethod(MethodDescriptorProto* method, - const LocationRecorder& method_location, - const FileDescriptorProto* containing_file); - - - // Parse options of a single method or stream. - bool ParseMethodOptions(const LocationRecorder& parent_location, - const FileDescriptorProto* containing_file, - const int optionsFieldNumber, - Message* mutable_options); - - // Parse "required", "optional", or "repeated" and fill in "label" - // with the value. Returns true if such a label is consumed. - bool ParseLabel(FieldDescriptorProto::Label* label, - const LocationRecorder& field_location, - const FileDescriptorProto* containing_file); - - // Parse a type name and fill in "type" (if it is a primitive) or - // "type_name" (if it is not) with the type parsed. - bool ParseType(FieldDescriptorProto::Type* type, std::string* type_name); - // Parse a user-defined type and fill in "type_name" with the name. - // If a primitive type is named, it is treated as an error. - bool ParseUserDefinedType(std::string* type_name); - - // Parses field options, i.e. the stuff in square brackets at the end - // of a field definition. Also parses default value. - bool ParseFieldOptions(FieldDescriptorProto* field, - const LocationRecorder& field_location, - const FileDescriptorProto* containing_file); - - // Parse the "default" option. This needs special handling because its - // type is the field's type. - bool ParseDefaultAssignment(FieldDescriptorProto* field, - const LocationRecorder& field_location, - const FileDescriptorProto* containing_file); - - bool ParseJsonName(FieldDescriptorProto* field, - const LocationRecorder& field_location, - const FileDescriptorProto* containing_file); - - enum OptionStyle { - OPTION_ASSIGNMENT, // just "name = value" - OPTION_STATEMENT // "option name = value;" - }; - - // Parse a single option name/value pair, e.g. "ctype = CORD". The name - // identifies a field of the given Message, and the value of that field - // is set to the parsed value. - bool ParseOption(Message* options, const LocationRecorder& options_location, - const FileDescriptorProto* containing_file, - OptionStyle style); - - // Parses a single part of a multipart option name. A multipart name consists - // of names separated by dots. Each name is either an identifier or a series - // of identifiers separated by dots and enclosed in parentheses. E.g., - // "foo.(bar.baz).qux". - bool ParseOptionNamePart(UninterpretedOption* uninterpreted_option, - const LocationRecorder& part_location, - const FileDescriptorProto* containing_file); - - // Parses a string surrounded by balanced braces. Strips off the outer - // braces and stores the enclosed string in *value. - // E.g., - // { foo } *value gets 'foo' - // { foo { bar: box } } *value gets 'foo { bar: box }' - // {} *value gets '' - // - // REQUIRES: LookingAt("{") - // When finished successfully, we are looking at the first token past - // the ending brace. - bool ParseUninterpretedBlock(std::string* value); - - struct MapField { - // Whether the field is a map field. - bool is_map_field; - // The types of the key and value if they are primitive types. - FieldDescriptorProto::Type key_type; - FieldDescriptorProto::Type value_type; - // Or the type names string if the types are customized types. - std::string key_type_name; - std::string value_type_name; - - MapField() : is_map_field(false) {} - }; - // Desugar the map syntax to generate a nested map entry message. - void GenerateMapEntry(const MapField& map_field, FieldDescriptorProto* field, - RepeatedPtrField* messages); - - // Whether fields without label default to optional fields. - bool DefaultToOptionalFields() const { - return syntax_identifier_ == "proto3"; - } - - bool ValidateEnum(const EnumDescriptorProto* proto); - - // ================================================================= - - io::Tokenizer* input_; - io::ErrorCollector* error_collector_; - SourceCodeInfo* source_code_info_; - SourceLocationTable* source_location_table_; // legacy - bool had_errors_; - bool require_syntax_identifier_; - bool stop_after_syntax_identifier_; - std::string syntax_identifier_; - - // Leading doc comments for the next declaration. These are not complete - // yet; use ConsumeEndOfDeclaration() to get the complete comments. - std::string upcoming_doc_comments_; - - // Detached comments are not connected to any syntax entities. Elements in - // this vector are paragraphs of comments separated by empty lines. The - // detached comments will be put into the leading_detached_comments field for - // the next element (See SourceCodeInfo.Location in descriptor.proto), when - // ConsumeEndOfDeclaration() is called. - std::vector upcoming_detached_comments_; - - GOOGLE_DISALLOW_EVIL_CONSTRUCTORS(Parser); -}; - -// A table mapping (descriptor, ErrorLocation) pairs -- as reported by -// DescriptorPool when validating descriptors -- to line and column numbers -// within the original source code. -// -// This is semi-obsolete: FileDescriptorProto.source_code_info now contains -// far more complete information about source locations. However, as of this -// writing you still need to use SourceLocationTable when integrating with -// DescriptorPool. -class PROTOBUF_EXPORT SourceLocationTable { - public: - SourceLocationTable(); - ~SourceLocationTable(); - - // Finds the precise location of the given error and fills in *line and - // *column with the line and column numbers. If not found, sets *line to - // -1 and *column to 0 (since line = -1 is used to mean "error has no exact - // location" in the ErrorCollector interface). Returns true if found, false - // otherwise. - bool Find(const Message* descriptor, - DescriptorPool::ErrorCollector::ErrorLocation location, int* line, - int* column) const; - bool FindImport(const Message* descriptor, const std::string& name, int* line, - int* column) const; - - // Adds a location to the table. - void Add(const Message* descriptor, - DescriptorPool::ErrorCollector::ErrorLocation location, int line, - int column); - void AddImport(const Message* descriptor, const std::string& name, int line, - int column); - - // Clears the contents of the table. - void Clear(); - - private: - typedef std::map< - std::pair, - std::pair > - LocationMap; - LocationMap location_map_; - std::map, std::pair > - import_location_map_; -}; - -} // namespace compiler -} // namespace protobuf -} // namespace google - -#include - -#endif // GOOGLE_PROTOBUF_COMPILER_PARSER_H__ diff --git a/extra/protobuf/protobuf-3.19.4/src/google/protobuf/compiler/parser_unittest.cc b/extra/protobuf/protobuf-3.19.4/src/google/protobuf/compiler/parser_unittest.cc deleted file mode 100644 index 6973bc993dd5..000000000000 --- a/extra/protobuf/protobuf-3.19.4/src/google/protobuf/compiler/parser_unittest.cc +++ /dev/null @@ -1,3681 +0,0 @@ -// Protocol Buffers - Google's data interchange format -// Copyright 2008 Google Inc. All rights reserved. -// https://developers.google.com/protocol-buffers/ -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// * Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// * Redistributions in binary form must reproduce the above -// copyright notice, this list of conditions and the following disclaimer -// in the documentation and/or other materials provided with the -// distribution. -// * Neither the name of Google Inc. nor the names of its -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -// Author: kenton@google.com (Kenton Varda) -// Based on original Protocol Buffers design by -// Sanjay Ghemawat, Jeff Dean, and others. - -#include - -#include -#include -#include -#include - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -namespace google { -namespace protobuf { -namespace compiler { - -namespace { - -class MockErrorCollector : public io::ErrorCollector { - public: - MockErrorCollector() = default; - ~MockErrorCollector() override = default; - - std::string warning_; - std::string text_; - - // implements ErrorCollector --------------------------------------- - void AddWarning(int line, int column, const std::string& message) override { - strings::SubstituteAndAppend(&warning_, "$0:$1: $2\n", line, column, message); - } - - void AddError(int line, int column, const std::string& message) override { - strings::SubstituteAndAppend(&text_, "$0:$1: $2\n", line, column, message); - } -}; - -class MockValidationErrorCollector : public DescriptorPool::ErrorCollector { - public: - MockValidationErrorCollector(const SourceLocationTable& source_locations, - io::ErrorCollector* wrapped_collector) - : source_locations_(source_locations), - wrapped_collector_(wrapped_collector) {} - ~MockValidationErrorCollector() {} - - // implements ErrorCollector --------------------------------------- - void AddError(const std::string& filename, const std::string& element_name, - const Message* descriptor, ErrorLocation location, - const std::string& message) override { - int line, column; - if (location == DescriptorPool::ErrorCollector::IMPORT) { - source_locations_.FindImport(descriptor, element_name, &line, &column); - } else { - source_locations_.Find(descriptor, location, &line, &column); - } - wrapped_collector_->AddError(line, column, message); - } - - private: - const SourceLocationTable& source_locations_; - io::ErrorCollector* wrapped_collector_; -}; - -class ParserTest : public testing::Test { - protected: - ParserTest() : require_syntax_identifier_(false) {} - - // Set up the parser to parse the given text. - void SetupParser(const char* text) { - raw_input_.reset(new io::ArrayInputStream(text, strlen(text))); - input_.reset(new io::Tokenizer(raw_input_.get(), &error_collector_)); - parser_.reset(new Parser()); - parser_->RecordErrorsTo(&error_collector_); - parser_->SetRequireSyntaxIdentifier(require_syntax_identifier_); - } - - // Parse the input and expect that the resulting FileDescriptorProto matches - // the given output. The output is a FileDescriptorProto in protocol buffer - // text format. - void ExpectParsesTo(const char* input, const char* output) { - SetupParser(input); - FileDescriptorProto actual, expected; - - parser_->Parse(input_.get(), &actual); - EXPECT_EQ(io::Tokenizer::TYPE_END, input_->current().type); - ASSERT_EQ("", error_collector_.text_); - - // We don't cover SourceCodeInfo in these tests. - actual.clear_source_code_info(); - - // Parse the ASCII representation in order to canonicalize it. We could - // just compare directly to actual.DebugString(), but that would require - // that the caller precisely match the formatting that DebugString() - // produces. - ASSERT_TRUE(TextFormat::ParseFromString(output, &expected)); - - // Compare by comparing debug strings. - // TODO(kenton): Use differencer, once it is available. - EXPECT_EQ(expected.DebugString(), actual.DebugString()); - } - - // Parse the text and expect that the given errors are reported. - void ExpectHasErrors(const char* text, const char* expected_errors) { - ExpectHasEarlyExitErrors(text, expected_errors); - EXPECT_EQ(io::Tokenizer::TYPE_END, input_->current().type); - } - - // Same as above but does not expect that the parser parses the complete - // input. - void ExpectHasEarlyExitErrors(const char* text, const char* expected_errors) { - SetupParser(text); - FileDescriptorProto file; - parser_->Parse(input_.get(), &file); - EXPECT_EQ(expected_errors, error_collector_.text_); - } - - // Parse the text as a file and validate it (with a DescriptorPool), and - // expect that the validation step reports the given errors. - void ExpectHasValidationErrors(const char* text, - const char* expected_errors) { - SetupParser(text); - SourceLocationTable source_locations; - parser_->RecordSourceLocationsTo(&source_locations); - - FileDescriptorProto file; - file.set_name("foo.proto"); - parser_->Parse(input_.get(), &file); - EXPECT_EQ(io::Tokenizer::TYPE_END, input_->current().type); - ASSERT_EQ("", error_collector_.text_); - - MockValidationErrorCollector validation_error_collector(source_locations, - &error_collector_); - EXPECT_TRUE(pool_.BuildFileCollectingErrors( - file, &validation_error_collector) == NULL); - EXPECT_EQ(expected_errors, error_collector_.text_); - } - - MockErrorCollector error_collector_; - DescriptorPool pool_; - - std::unique_ptr raw_input_; - std::unique_ptr input_; - std::unique_ptr parser_; - bool require_syntax_identifier_; -}; - -// =================================================================== - -TEST_F(ParserTest, StopAfterSyntaxIdentifier) { - SetupParser( - "// blah\n" - "syntax = \"foobar\";\n" - "this line will not be parsed\n"); - parser_->SetStopAfterSyntaxIdentifier(true); - EXPECT_TRUE(parser_->Parse(input_.get(), NULL)); - EXPECT_EQ("", error_collector_.text_); - EXPECT_EQ("foobar", parser_->GetSyntaxIdentifier()); -} - -TEST_F(ParserTest, StopAfterOmittedSyntaxIdentifier) { - SetupParser( - "// blah\n" - "this line will not be parsed\n"); - parser_->SetStopAfterSyntaxIdentifier(true); - EXPECT_TRUE(parser_->Parse(input_.get(), NULL)); - EXPECT_EQ("", error_collector_.text_); - EXPECT_EQ("", parser_->GetSyntaxIdentifier()); -} - -TEST_F(ParserTest, StopAfterSyntaxIdentifierWithErrors) { - SetupParser( - "// blah\n" - "syntax = error;\n"); - parser_->SetStopAfterSyntaxIdentifier(true); - EXPECT_FALSE(parser_->Parse(input_.get(), NULL)); - EXPECT_EQ("1:9: Expected syntax identifier.\n", error_collector_.text_); -} - -TEST_F(ParserTest, WarnIfSyntaxIdentifierOmmitted) { - SetupParser("message A {}"); - FileDescriptorProto file; - CaptureTestStderr(); - EXPECT_TRUE(parser_->Parse(input_.get(), &file)); - EXPECT_TRUE(GetCapturedTestStderr().find("No syntax specified") != - std::string::npos); -} - -TEST_F(ParserTest, WarnIfFieldNameIsNotUpperCamel) { - SetupParser( - "syntax = \"proto2\";" - "message abc {}"); - FileDescriptorProto file; - EXPECT_TRUE(parser_->Parse(input_.get(), &file)); - EXPECT_TRUE(error_collector_.warning_.find( - "Message name should be in UpperCamelCase. Found: abc.") != - std::string::npos); -} - -TEST_F(ParserTest, WarnIfFieldNameIsNotLowerUnderscore) { - SetupParser( - "syntax = \"proto2\";" - "message A {" - " optional string SongName = 1;" - "}"); - FileDescriptorProto file; - EXPECT_TRUE(parser_->Parse(input_.get(), &file)); - EXPECT_TRUE(error_collector_.warning_.find( - "Field name should be lowercase. Found: SongName") != - std::string::npos); -} - -TEST_F(ParserTest, WarnIfFieldNameContainsNumberImmediatelyFollowUnderscore) { - SetupParser( - "syntax = \"proto2\";" - "message A {" - " optional string song_name_1 = 1;" - "}"); - FileDescriptorProto file; - EXPECT_TRUE(parser_->Parse(input_.get(), &file)); - EXPECT_TRUE(error_collector_.warning_.find( - "Number should not come right after an underscore. Found: " - "song_name_1.") != std::string::npos); -} - -// =================================================================== - -typedef ParserTest ParseMessageTest; - -TEST_F(ParseMessageTest, IgnoreBOM) { - char input[] = - " message TestMessage {\n" - " required int32 foo = 1;\n" - "}\n"; - // Set UTF-8 BOM. - input[0] = (char)0xEF; - input[1] = (char)0xBB; - input[2] = (char)0xBF; - ExpectParsesTo( - input, - "message_type {" - " name: \"TestMessage\"" - " field { name:\"foo\" label:LABEL_REQUIRED type:TYPE_INT32 number:1 }" - "}"); -} - -TEST_F(ParseMessageTest, BOMError) { - char input[] = - " message TestMessage {\n" - " required int32 foo = 1;\n" - "}\n"; - input[0] = (char)0xEF; - ExpectHasErrors(input, - "0:1: Proto file starts with 0xEF but not UTF-8 BOM. " - "Only UTF-8 is accepted for proto file.\n" - "0:0: Expected top-level statement (e.g. \"message\").\n"); -} - -TEST_F(ParseMessageTest, SimpleMessage) { - ExpectParsesTo( - "message TestMessage {\n" - " required int32 foo = 1;\n" - "}\n", - - "message_type {" - " name: \"TestMessage\"" - " field { name:\"foo\" label:LABEL_REQUIRED type:TYPE_INT32 number:1 }" - "}"); -} - -TEST_F(ParseMessageTest, ImplicitSyntaxIdentifier) { - require_syntax_identifier_ = false; - ExpectParsesTo( - "message TestMessage {\n" - " required int32 foo = 1;\n" - "}\n", - - "message_type {" - " name: \"TestMessage\"" - " field { name:\"foo\" label:LABEL_REQUIRED type:TYPE_INT32 number:1 }" - "}"); - EXPECT_EQ("proto2", parser_->GetSyntaxIdentifier()); -} - -TEST_F(ParseMessageTest, ExplicitSyntaxIdentifier) { - ExpectParsesTo( - "syntax = \"proto2\";\n" - "message TestMessage {\n" - " required int32 foo = 1;\n" - "}\n", - - "syntax: 'proto2' " - "message_type {" - " name: \"TestMessage\"" - " field { name:\"foo\" label:LABEL_REQUIRED type:TYPE_INT32 number:1 }" - "}"); - EXPECT_EQ("proto2", parser_->GetSyntaxIdentifier()); -} - -TEST_F(ParseMessageTest, ExplicitRequiredSyntaxIdentifier) { - require_syntax_identifier_ = true; - ExpectParsesTo( - "syntax = \"proto2\";\n" - "message TestMessage {\n" - " required int32 foo = 1;\n" - "}\n", - - "syntax: 'proto2' " - "message_type {" - " name: \"TestMessage\"" - " field { name:\"foo\" label:LABEL_REQUIRED type:TYPE_INT32 number:1 }" - "}"); - EXPECT_EQ("proto2", parser_->GetSyntaxIdentifier()); -} - -TEST_F(ParseMessageTest, SimpleFields) { - ExpectParsesTo( - "message TestMessage {\n" - " required int32 foo = 15;\n" - " optional int32 bar = 34;\n" - " repeated int32 baz = 3;\n" - "}\n", - - "message_type {" - " name: \"TestMessage\"" - " field { name:\"foo\" label:LABEL_REQUIRED type:TYPE_INT32 number:15 }" - " field { name:\"bar\" label:LABEL_OPTIONAL type:TYPE_INT32 number:34 }" - " field { name:\"baz\" label:LABEL_REPEATED type:TYPE_INT32 number:3 }" - "}"); -} - -TEST_F(ParseMessageTest, PrimitiveFieldTypes) { - ExpectParsesTo( - "message TestMessage {\n" - " required int32 foo = 1;\n" - " required int64 foo = 1;\n" - " required uint32 foo = 1;\n" - " required uint64 foo = 1;\n" - " required sint32 foo = 1;\n" - " required sint64 foo = 1;\n" - " required fixed32 foo = 1;\n" - " required fixed64 foo = 1;\n" - " required sfixed32 foo = 1;\n" - " required sfixed64 foo = 1;\n" - " required float foo = 1;\n" - " required double foo = 1;\n" - " required string foo = 1;\n" - " required bytes foo = 1;\n" - " required bool foo = 1;\n" - "}\n", - - "message_type {" - " name: \"TestMessage\"" - " field { name:\"foo\" label:LABEL_REQUIRED type:TYPE_INT32 number:1 " - "}" - " field { name:\"foo\" label:LABEL_REQUIRED type:TYPE_INT64 number:1 " - "}" - " field { name:\"foo\" label:LABEL_REQUIRED type:TYPE_UINT32 number:1 " - "}" - " field { name:\"foo\" label:LABEL_REQUIRED type:TYPE_UINT64 number:1 " - "}" - " field { name:\"foo\" label:LABEL_REQUIRED type:TYPE_SINT32 number:1 " - "}" - " field { name:\"foo\" label:LABEL_REQUIRED type:TYPE_SINT64 number:1 " - "}" - " field { name:\"foo\" label:LABEL_REQUIRED type:TYPE_FIXED32 number:1 " - "}" - " field { name:\"foo\" label:LABEL_REQUIRED type:TYPE_FIXED64 number:1 " - "}" - " field { name:\"foo\" label:LABEL_REQUIRED type:TYPE_SFIXED32 number:1 " - "}" - " field { name:\"foo\" label:LABEL_REQUIRED type:TYPE_SFIXED64 number:1 " - "}" - " field { name:\"foo\" label:LABEL_REQUIRED type:TYPE_FLOAT number:1 " - "}" - " field { name:\"foo\" label:LABEL_REQUIRED type:TYPE_DOUBLE number:1 " - "}" - " field { name:\"foo\" label:LABEL_REQUIRED type:TYPE_STRING number:1 " - "}" - " field { name:\"foo\" label:LABEL_REQUIRED type:TYPE_BYTES number:1 " - "}" - " field { name:\"foo\" label:LABEL_REQUIRED type:TYPE_BOOL number:1 " - "}" - "}"); -} - -TEST_F(ParseMessageTest, FieldDefaults) { - ExpectParsesTo( - "message TestMessage {\n" - " required int32 foo = 1 [default= 1 ];\n" - " required int32 foo = 1 [default= -2 ];\n" - " required int64 foo = 1 [default= 3 ];\n" - " required int64 foo = 1 [default= -4 ];\n" - " required uint32 foo = 1 [default= 5 ];\n" - " required uint64 foo = 1 [default= 6 ];\n" - " required float foo = 1 [default= 7.5];\n" - " required float foo = 1 [default= -8.5];\n" - " required float foo = 1 [default= 9 ];\n" - " required double foo = 1 [default= 10.5];\n" - " required double foo = 1 [default=-11.5];\n" - " required double foo = 1 [default= 12 ];\n" - " required double foo = 1 [default= inf ];\n" - " required double foo = 1 [default=-inf ];\n" - " required double foo = 1 [default= nan ];\n" - " required string foo = 1 [default='13\\001'];\n" - " required string foo = 1 [default='a' \"b\" \n \"c\"];\n" - " required bytes foo = 1 [default='14\\002'];\n" - " required bytes foo = 1 [default='a' \"b\" \n 'c'];\n" - " required bool foo = 1 [default=true ];\n" - " required Foo foo = 1 [default=FOO ];\n" - - " required int32 foo = 1 [default= 0x7FFFFFFF];\n" - " required int32 foo = 1 [default=-0x80000000];\n" - " required uint32 foo = 1 [default= 0xFFFFFFFF];\n" - " required int64 foo = 1 [default= 0x7FFFFFFFFFFFFFFF];\n" - " required int64 foo = 1 [default=-0x8000000000000000];\n" - " required uint64 foo = 1 [default= 0xFFFFFFFFFFFFFFFF];\n" - " required double foo = 1 [default= 0xabcd];\n" - "}\n", - -#define ETC "name:\"foo\" label:LABEL_REQUIRED number:1" - "message_type {" - " name: \"TestMessage\"" - " field { type:TYPE_INT32 default_value:\"1\" " ETC - " }" - " field { type:TYPE_INT32 default_value:\"-2\" " ETC - " }" - " field { type:TYPE_INT64 default_value:\"3\" " ETC - " }" - " field { type:TYPE_INT64 default_value:\"-4\" " ETC - " }" - " field { type:TYPE_UINT32 default_value:\"5\" " ETC - " }" - " field { type:TYPE_UINT64 default_value:\"6\" " ETC - " }" - " field { type:TYPE_FLOAT default_value:\"7.5\" " ETC - " }" - " field { type:TYPE_FLOAT default_value:\"-8.5\" " ETC - " }" - " field { type:TYPE_FLOAT default_value:\"9\" " ETC - " }" - " field { type:TYPE_DOUBLE default_value:\"10.5\" " ETC - " }" - " field { type:TYPE_DOUBLE default_value:\"-11.5\" " ETC - " }" - " field { type:TYPE_DOUBLE default_value:\"12\" " ETC - " }" - " field { type:TYPE_DOUBLE default_value:\"inf\" " ETC - " }" - " field { type:TYPE_DOUBLE default_value:\"-inf\" " ETC - " }" - " field { type:TYPE_DOUBLE default_value:\"nan\" " ETC - " }" - " field { type:TYPE_STRING default_value:\"13\\001\" " ETC - " }" - " field { type:TYPE_STRING default_value:\"abc\" " ETC - " }" - " field { type:TYPE_BYTES default_value:\"14\\\\002\" " ETC - " }" - " field { type:TYPE_BYTES default_value:\"abc\" " ETC - " }" - " field { type:TYPE_BOOL default_value:\"true\" " ETC - " }" - " field { type_name:\"Foo\" default_value:\"FOO\" " ETC - " }" - - " field {" - " type:TYPE_INT32 default_value:\"2147483647\" " ETC - " }" - " field {" - " type:TYPE_INT32 default_value:\"-2147483648\" " ETC - " }" - " field {" - " type:TYPE_UINT32 default_value:\"4294967295\" " ETC - " }" - " field {" - " type:TYPE_INT64 default_value:\"9223372036854775807\" " ETC - " }" - " field {" - " type:TYPE_INT64 default_value:\"-9223372036854775808\" " ETC - " }" - " field {" - " type:TYPE_UINT64 default_value:\"18446744073709551615\" " ETC - " }" - " field {" - " type:TYPE_DOUBLE default_value:\"43981\" " ETC - " }" - "}"); -#undef ETC -} - -TEST_F(ParseMessageTest, FieldJsonName) { - ExpectParsesTo( - "message TestMessage {\n" - " optional string foo = 1 [json_name = \"@type\"];\n" - "}\n", - "message_type {" - " name: \"TestMessage\"" - " field {\n" - " name: \"foo\" label: LABEL_OPTIONAL type: TYPE_STRING number: 1" - " json_name: \"@type\"\n" - " }\n" - "}\n"); -} - -TEST_F(ParseMessageTest, FieldOptions) { - ExpectParsesTo( - "message TestMessage {\n" - " optional string foo = 1\n" - " [ctype=CORD, (foo)=7, foo.(.bar.baz).qux.quux.(corge)=-33, \n" - " (quux)=\"x\040y\", (baz.qux)=hey];\n" - "}\n", - - "message_type {" - " name: \"TestMessage\"" - " field { name: \"foo\" label: LABEL_OPTIONAL type: TYPE_STRING number: " - "1" - " options { uninterpreted_option: { name { name_part: \"ctype\" " - " is_extension: false " - "} " - " identifier_value: \"CORD\" " - "}" - " uninterpreted_option: { name { name_part: \"foo\" " - " is_extension: true } " - " positive_int_value: 7 }" - " uninterpreted_option: { name { name_part: \"foo\" " - " is_extension: false " - "} " - " name { name_part: " - "\".bar.baz\"" - " is_extension: true } " - " name { name_part: \"qux\" " - " is_extension: false " - "} " - " name { name_part: \"quux\" " - " is_extension: false " - "} " - " name { name_part: \"corge\" " - " is_extension: true } " - " negative_int_value: -33 }" - " uninterpreted_option: { name { name_part: \"quux\" " - " is_extension: true } " - " string_value: \"x y\" }" - " uninterpreted_option: { name { name_part: " - "\"baz.qux\" " - " is_extension: true } " - " identifier_value: \"hey\" }" - " }" - " }" - "}"); -} - -TEST_F(ParseMessageTest, Oneof) { - ExpectParsesTo( - "message TestMessage {\n" - " oneof foo {\n" - " int32 a = 1;\n" - " string b = 2;\n" - " TestMessage c = 3;\n" - " group D = 4 { optional int32 i = 5; }\n" - " }\n" - "}\n", - - "message_type {" - " name: \"TestMessage\"" - " field { name:\"a\" label:LABEL_OPTIONAL type:TYPE_INT32 number:1 " - " oneof_index:0 }" - " field { name:\"b\" label:LABEL_OPTIONAL type:TYPE_STRING number:2 " - " oneof_index:0 }" - " field { name:\"c\" label:LABEL_OPTIONAL type_name:\"TestMessage\" " - " number:3 oneof_index:0 }" - " field { name:\"d\" label:LABEL_OPTIONAL type:TYPE_GROUP " - " type_name:\"D\" number:4 oneof_index:0 }" - " oneof_decl {" - " name: \"foo\"" - " }" - " nested_type {" - " name: \"D\"" - " field { name:\"i\" label:LABEL_OPTIONAL type:TYPE_INT32 number:5 }" - " }" - "}"); -} - -TEST_F(ParseMessageTest, MultipleOneofs) { - ExpectParsesTo( - "message TestMessage {\n" - " oneof foo {\n" - " int32 a = 1;\n" - " string b = 2;\n" - " }\n" - " oneof bar {\n" - " int32 c = 3;\n" - " string d = 4;\n" - " }\n" - "}\n", - - "message_type {" - " name: \"TestMessage\"" - " field { name:\"a\" label:LABEL_OPTIONAL type:TYPE_INT32 number:1 " - " oneof_index:0 }" - " field { name:\"b\" label:LABEL_OPTIONAL type:TYPE_STRING number:2 " - " oneof_index:0 }" - " field { name:\"c\" label:LABEL_OPTIONAL type:TYPE_INT32 number:3 " - " oneof_index:1 }" - " field { name:\"d\" label:LABEL_OPTIONAL type:TYPE_STRING number:4 " - " oneof_index:1 }" - " oneof_decl {" - " name: \"foo\"" - " }" - " oneof_decl {" - " name: \"bar\"" - " }" - "}"); -} - -TEST_F(ParseMessageTest, Maps) { - ExpectParsesTo( - "message TestMessage {\n" - " map primitive_type_map = 1;\n" - " map composite_type_map = 2;\n" - "}\n", - - "message_type {" - " name: \"TestMessage\"" - " nested_type {" - " name: \"PrimitiveTypeMapEntry\"" - " field { " - " name: \"key\" number: 1 label:LABEL_OPTIONAL" - " type:TYPE_INT32" - " }" - " field { " - " name: \"value\" number: 2 label:LABEL_OPTIONAL" - " type:TYPE_STRING" - " }" - " options { map_entry: true }" - " }" - " nested_type {" - " name: \"CompositeTypeMapEntry\"" - " field { " - " name: \"key\" number: 1 label:LABEL_OPTIONAL" - " type_name: \"KeyType\"" - " }" - " field { " - " name: \"value\" number: 2 label:LABEL_OPTIONAL" - " type_name: \"ValueType\"" - " }" - " options { map_entry: true }" - " }" - " field {" - " name: \"primitive_type_map\"" - " label: LABEL_REPEATED" - " type_name: \"PrimitiveTypeMapEntry\"" - " number: 1" - " }" - " field {" - " name: \"composite_type_map\"" - " label: LABEL_REPEATED" - " type_name: \"CompositeTypeMapEntry\"" - " number: 2" - " }" - "}"); -} - -TEST_F(ParseMessageTest, Group) { - ExpectParsesTo( - "message TestMessage {\n" - " optional group TestGroup = 1 {};\n" - "}\n", - - "message_type {" - " name: \"TestMessage\"" - " nested_type { name: \"TestGroup\" }" - " field { name:\"testgroup\" label:LABEL_OPTIONAL number:1" - " type:TYPE_GROUP type_name: \"TestGroup\" }" - "}"); -} - -TEST_F(ParseMessageTest, NestedMessage) { - ExpectParsesTo( - "message TestMessage {\n" - " message Nested {}\n" - " optional Nested test_nested = 1;\n" - "}\n", - - "message_type {" - " name: \"TestMessage\"" - " nested_type { name: \"Nested\" }" - " field { name:\"test_nested\" label:LABEL_OPTIONAL number:1" - " type_name: \"Nested\" }" - "}"); -} - -TEST_F(ParseMessageTest, NestedEnum) { - ExpectParsesTo( - "message TestMessage {\n" - " enum NestedEnum {}\n" - " optional NestedEnum test_enum = 1;\n" - "}\n", - - "message_type {" - " name: \"TestMessage\"" - " enum_type { name: \"NestedEnum\" }" - " field { name:\"test_enum\" label:LABEL_OPTIONAL number:1" - " type_name: \"NestedEnum\" }" - "}"); -} - -TEST_F(ParseMessageTest, ReservedRange) { - ExpectParsesTo( - "message TestMessage {\n" - " required int32 foo = 1;\n" - " reserved 2, 15, 9 to 11, 3, 20 to max;\n" - "}\n", - - "message_type {" - " name: \"TestMessage\"" - " field { name:\"foo\" label:LABEL_REQUIRED type:TYPE_INT32 number:1 }" - " reserved_range { start:2 end:3 }" - " reserved_range { start:15 end:16 }" - " reserved_range { start:9 end:12 }" - " reserved_range { start:3 end:4 }" - " reserved_range { start:20 end:536870912 }" - "}"); -} - -TEST_F(ParseMessageTest, ReservedRangeOnMessageSet) { - ExpectParsesTo( - "message TestMessage {\n" - " option message_set_wire_format = true;\n" - " reserved 20 to max;\n" - "}\n", - - "message_type {" - " name: \"TestMessage\"" - " options {" - " uninterpreted_option {" - " name {" - " name_part: \"message_set_wire_format\"" - " is_extension: false" - " }" - " identifier_value: \"true\"" - " }" - " }" - " reserved_range { start:20 end:2147483647 }" - "}"); -} - -TEST_F(ParseMessageTest, ReservedNames) { - ExpectParsesTo( - "message TestMessage {\n" - " reserved \"foo\", \"bar\";\n" - "}\n", - - "message_type {" - " name: \"TestMessage\"" - " reserved_name: \"foo\"" - " reserved_name: \"bar\"" - "}"); -} - -TEST_F(ParseMessageTest, ExtensionRange) { - ExpectParsesTo( - "message TestMessage {\n" - " extensions 10 to 19;\n" - " extensions 30 to max;\n" - "}\n", - - "message_type {" - " name: \"TestMessage\"" - " extension_range { start:10 end:20 }" - " extension_range { start:30 end:536870912 }" - "}"); -} - -TEST_F(ParseMessageTest, ExtensionRangeWithOptions) { - ExpectParsesTo( - "message TestMessage {\n" - " extensions 10 to 19 [(i) = 5];\n" - "}\n", - - "message_type {" - " name: \"TestMessage\"" - " extension_range {" - " start:10" - " end:20" - " options {" - " uninterpreted_option {" - " name {" - " name_part: \"i\"" - " is_extension: true" - " }" - " positive_int_value: 5" - " }" - " }" - " }" - "}"); -} - -TEST_F(ParseMessageTest, CompoundExtensionRange) { - ExpectParsesTo( - "message TestMessage {\n" - " extensions 2, 15, 9 to 11, 100 to max, 3;\n" - "}\n", - - "message_type {" - " name: \"TestMessage\"" - " extension_range { start:2 end:3 }" - " extension_range { start:15 end:16 }" - " extension_range { start:9 end:12 }" - " extension_range { start:100 end:536870912 }" - " extension_range { start:3 end:4 }" - "}"); -} - -TEST_F(ParseMessageTest, CompoundExtensionRangeWithOptions) { - ExpectParsesTo( - "message TestMessage {\n" - " extensions 2, 15, 9 to 11, 100 to max, 3 [(i) = 5];\n" - "}\n", - - "message_type {" - " name: \"TestMessage\"" - " extension_range {" - " start:2" - " end:3" - " options {" - " uninterpreted_option {" - " name {" - " name_part: \"i\"" - " is_extension: true" - " }" - " positive_int_value: 5" - " }" - " }" - " }" - " extension_range {" - " start:15" - " end:16" - " options {" - " uninterpreted_option {" - " name {" - " name_part: \"i\"" - " is_extension: true" - " }" - " positive_int_value: 5" - " }" - " }" - " }" - " extension_range {" - " start:9" - " end:12" - " options {" - " uninterpreted_option {" - " name {" - " name_part: \"i\"" - " is_extension: true" - " }" - " positive_int_value: 5" - " }" - " }" - " }" - " extension_range {" - " start:100" - " end:536870912" - " options {" - " uninterpreted_option {" - " name {" - " name_part: \"i\"" - " is_extension: true" - " }" - " positive_int_value: 5" - " }" - " }" - " }" - " extension_range {" - " start:3" - " end:4" - " options {" - " uninterpreted_option {" - " name {" - " name_part: \"i\"" - " is_extension: true" - " }" - " positive_int_value: 5" - " }" - " }" - " }" - "}"); -} - -TEST_F(ParseMessageTest, LargerMaxForMessageSetWireFormatMessages) { - // Messages using the message_set_wire_format option can accept larger - // extension numbers, as the numbers are not encoded as int32 field values - // rather than tags. - ExpectParsesTo( - "message TestMessage {\n" - " extensions 4 to max;\n" - " option message_set_wire_format = true;\n" - "}\n", - - "message_type {" - " name: \"TestMessage\"" - " extension_range { start:4 end: 0x7fffffff }" - " options {\n" - " uninterpreted_option { \n" - " name {\n" - " name_part: \"message_set_wire_format\"\n" - " is_extension: false\n" - " }\n" - " identifier_value: \"true\"\n" - " }\n" - " }\n" - "}"); -} - -TEST_F(ParseMessageTest, Extensions) { - ExpectParsesTo( - "extend Extendee1 { optional int32 foo = 12; }\n" - "extend Extendee2 { repeated TestMessage bar = 22; }\n", - - "extension { name:\"foo\" label:LABEL_OPTIONAL type:TYPE_INT32 number:12" - " extendee: \"Extendee1\" } " - "extension { name:\"bar\" label:LABEL_REPEATED number:22" - " type_name:\"TestMessage\" extendee: \"Extendee2\" }"); -} - -TEST_F(ParseMessageTest, ExtensionsInMessageScope) { - ExpectParsesTo( - "message TestMessage {\n" - " extend Extendee1 { optional int32 foo = 12; }\n" - " extend Extendee2 { repeated TestMessage bar = 22; }\n" - "}\n", - - "message_type {" - " name: \"TestMessage\"" - " extension { name:\"foo\" label:LABEL_OPTIONAL type:TYPE_INT32 " - "number:12" - " extendee: \"Extendee1\" }" - " extension { name:\"bar\" label:LABEL_REPEATED number:22" - " type_name:\"TestMessage\" extendee: \"Extendee2\" }" - "}"); -} - -TEST_F(ParseMessageTest, MultipleExtensionsOneExtendee) { - ExpectParsesTo( - "extend Extendee1 {\n" - " optional int32 foo = 12;\n" - " repeated TestMessage bar = 22;\n" - "}\n", - - "extension { name:\"foo\" label:LABEL_OPTIONAL type:TYPE_INT32 number:12" - " extendee: \"Extendee1\" } " - "extension { name:\"bar\" label:LABEL_REPEATED number:22" - " type_name:\"TestMessage\" extendee: \"Extendee1\" }"); -} - -TEST_F(ParseMessageTest, OptionalLabelProto3) { - ExpectParsesTo( - "syntax = \"proto3\";\n" - "message TestMessage {\n" - " int32 foo = 1;\n" - "}\n", - - "syntax: \"proto3\" " - "message_type {" - " name: \"TestMessage\"" - " field { name:\"foo\" label:LABEL_OPTIONAL type:TYPE_INT32 number:1 } " - "}"); -} - -TEST_F(ParseMessageTest, ExplicitOptionalLabelProto3) { - ExpectParsesTo( - "syntax = 'proto3';\n" - "message TestMessage {\n" - " optional int32 foo = 1;\n" - "}\n", - - "syntax: \"proto3\" " - "message_type {" - " name: \"TestMessage\"" - " field { name:\"foo\" label:LABEL_OPTIONAL type:TYPE_INT32 number:1 " - " proto3_optional: true oneof_index: 0 } " - " oneof_decl { name:\"_foo\" } " - "}"); - - // Handle collisions in the synthetic oneof name. - ExpectParsesTo( - "syntax = 'proto3';\n" - "message TestMessage {\n" - " optional int32 foo = 1;\n" - " oneof _foo {\n" - " int32 __foo = 2;\n" - " }\n" - "}\n", - - "syntax: \"proto3\" " - "message_type {" - " name: \"TestMessage\"" - " field { name:\"foo\" label:LABEL_OPTIONAL type:TYPE_INT32 number:1 " - " proto3_optional: true oneof_index: 1 } " - " field { name:\"__foo\" label:LABEL_OPTIONAL type:TYPE_INT32 number:2 " - " oneof_index: 0 } " - " oneof_decl { name:\"_foo\" } " - " oneof_decl { name:\"X_foo\" } " - "}"); -} - -// =================================================================== - -typedef ParserTest ParseEnumTest; - -TEST_F(ParseEnumTest, SimpleEnum) { - ExpectParsesTo( - "enum TestEnum {\n" - " FOO = 0;\n" - "}\n", - - "enum_type {" - " name: \"TestEnum\"" - " value { name:\"FOO\" number:0 }" - "}"); -} - -TEST_F(ParseEnumTest, Values) { - ExpectParsesTo( - "enum TestEnum {\n" - " FOO = 13;\n" - " BAR = -10;\n" - " BAZ = 500;\n" - " HEX_MAX = 0x7FFFFFFF;\n" - " HEX_MIN = -0x80000000;\n" - " INT_MAX = 2147483647;\n" - " INT_MIN = -2147483648;\n" - "}\n", - - "enum_type {" - " name: \"TestEnum\"" - " value { name:\"FOO\" number:13 }" - " value { name:\"BAR\" number:-10 }" - " value { name:\"BAZ\" number:500 }" - " value { name:\"HEX_MAX\" number:2147483647 }" - " value { name:\"HEX_MIN\" number:-2147483648 }" - " value { name:\"INT_MAX\" number:2147483647 }" - " value { name:\"INT_MIN\" number:-2147483648 }" - "}"); -} - -TEST_F(ParseEnumTest, ValueOptions) { - ExpectParsesTo( - "enum TestEnum {\n" - " FOO = 13;\n" - " BAR = -10 [ (something.text) = 'abc' ];\n" - " BAZ = 500 [ (something.text) = 'def', other = 1 ];\n" - "}\n", - - "enum_type {" - " name: \"TestEnum\"" - " value { name: \"FOO\" number: 13 }" - " value { name: \"BAR\" number: -10 " - " options { " - " uninterpreted_option { " - " name { name_part: \"something.text\" is_extension: true } " - " string_value: \"abc\" " - " } " - " } " - " } " - " value { name: \"BAZ\" number: 500 " - " options { " - " uninterpreted_option { " - " name { name_part: \"something.text\" is_extension: true } " - " string_value: \"def\" " - " } " - " uninterpreted_option { " - " name { name_part: \"other\" is_extension: false } " - " positive_int_value: 1 " - " } " - " } " - " } " - "}"); -} - -TEST_F(ParseEnumTest, ReservedRange) { - ExpectParsesTo( - "enum TestEnum {\n" - " FOO = 0;\n" - " reserved -2147483648, -6 to -4, -1 to 1, 2, 15, 9 to 11, 3, 20 to " - "max;\n" - "}\n", - - "enum_type {" - " name: \"TestEnum\"" - " value { name:\"FOO\" number:0 }" - " reserved_range { start:-2147483648 end:-2147483648 }" - " reserved_range { start:-6 end:-4 }" - " reserved_range { start:-1 end:1 }" - " reserved_range { start:2 end:2 }" - " reserved_range { start:15 end:15 }" - " reserved_range { start:9 end:11 }" - " reserved_range { start:3 end:3 }" - " reserved_range { start:20 end:2147483647 }" - "}"); -} - -TEST_F(ParseEnumTest, ReservedNames) { - ExpectParsesTo( - "enum TestEnum {\n" - " FOO = 0;\n" - " reserved \"foo\", \"bar\";\n" - "}\n", - - "enum_type {" - " name: \"TestEnum\"" - " value { name:\"FOO\" number:0 }" - " reserved_name: \"foo\"" - " reserved_name: \"bar\"" - "}"); -} - -// =================================================================== - -typedef ParserTest ParseServiceTest; - -TEST_F(ParseServiceTest, SimpleService) { - ExpectParsesTo( - "service TestService {\n" - " rpc Foo(In) returns (Out);\n" - "}\n", - - "service {" - " name: \"TestService\"" - " method { name:\"Foo\" input_type:\"In\" output_type:\"Out\" }" - "}"); -} - -TEST_F(ParseServiceTest, MethodsAndStreams) { - ExpectParsesTo( - "service TestService {\n" - " rpc Foo(In1) returns (Out1);\n" - " rpc Bar(In2) returns (Out2);\n" - " rpc Baz(In3) returns (Out3);\n" - "}\n", - - "service {" - " name: \"TestService\"" - " method { name:\"Foo\" input_type:\"In1\" output_type:\"Out1\" }" - " method { name:\"Bar\" input_type:\"In2\" output_type:\"Out2\" }" - " method { name:\"Baz\" input_type:\"In3\" output_type:\"Out3\" }" - "}"); -} - - -// =================================================================== -// imports and packages - -typedef ParserTest ParseMiscTest; - -TEST_F(ParseMiscTest, ParseImport) { - ExpectParsesTo("import \"foo/bar/baz.proto\";\n", - "dependency: \"foo/bar/baz.proto\""); -} - -TEST_F(ParseMiscTest, ParseMultipleImports) { - ExpectParsesTo( - "import \"foo.proto\";\n" - "import \"bar.proto\";\n" - "import \"baz.proto\";\n", - "dependency: \"foo.proto\"" - "dependency: \"bar.proto\"" - "dependency: \"baz.proto\""); -} - -TEST_F(ParseMiscTest, ParsePublicImports) { - ExpectParsesTo( - "import \"foo.proto\";\n" - "import public \"bar.proto\";\n" - "import \"baz.proto\";\n" - "import public \"qux.proto\";\n", - "dependency: \"foo.proto\"" - "dependency: \"bar.proto\"" - "dependency: \"baz.proto\"" - "dependency: \"qux.proto\"" - "public_dependency: 1 " - "public_dependency: 3 "); -} - -TEST_F(ParseMiscTest, ParsePackage) { - ExpectParsesTo("package foo.bar.baz;\n", "package: \"foo.bar.baz\""); -} - -TEST_F(ParseMiscTest, ParsePackageWithSpaces) { - ExpectParsesTo( - "package foo . bar. \n" - " baz;\n", - "package: \"foo.bar.baz\""); -} - -// =================================================================== -// options - -TEST_F(ParseMiscTest, ParseFileOptions) { - ExpectParsesTo( - "option java_package = \"com.google.foo\";\n" - "option optimize_for = CODE_SIZE;", - - "options {" - "uninterpreted_option { name { name_part: \"java_package\" " - " is_extension: false }" - " string_value: \"com.google.foo\"} " - "uninterpreted_option { name { name_part: \"optimize_for\" " - " is_extension: false }" - " identifier_value: \"CODE_SIZE\" } " - "}"); -} - -// =================================================================== -// Error tests -// -// There are a very large number of possible errors that the parser could -// report, so it's infeasible to test every single one of them. Instead, -// we test each unique call to AddError() in parser.h. This does not mean -// we are testing every possible error that Parser can generate because -// each variant of the Consume() helper only counts as one unique call to -// AddError(). - -typedef ParserTest ParseErrorTest; - -TEST_F(ParseErrorTest, MissingSyntaxIdentifier) { - require_syntax_identifier_ = true; - ExpectHasEarlyExitErrors("message TestMessage {}", - "0:0: File must begin with a syntax statement, e.g. " - "'syntax = \"proto2\";'.\n"); - EXPECT_EQ("", parser_->GetSyntaxIdentifier()); -} - -TEST_F(ParseErrorTest, UnknownSyntaxIdentifier) { - ExpectHasEarlyExitErrors( - "syntax = \"no_such_syntax\";", - "0:9: Unrecognized syntax identifier \"no_such_syntax\". This parser " - "only recognizes \"proto2\" and \"proto3\".\n"); - EXPECT_EQ("no_such_syntax", parser_->GetSyntaxIdentifier()); -} - -TEST_F(ParseErrorTest, SimpleSyntaxError) { - ExpectHasErrors("message TestMessage @#$ { blah }", - "0:20: Expected \"{\".\n"); - EXPECT_EQ("proto2", parser_->GetSyntaxIdentifier()); -} - -TEST_F(ParseErrorTest, ExpectedTopLevel) { - ExpectHasErrors("blah;", - "0:0: Expected top-level statement (e.g. \"message\").\n"); -} - -TEST_F(ParseErrorTest, UnmatchedCloseBrace) { - // This used to cause an infinite loop. Doh. - ExpectHasErrors("}", - "0:0: Expected top-level statement (e.g. \"message\").\n" - "0:0: Unmatched \"}\".\n"); -} - -// ------------------------------------------------------------------- -// Message errors - -TEST_F(ParseErrorTest, MessageMissingName) { - ExpectHasErrors("message {}", "0:8: Expected message name.\n"); -} - -TEST_F(ParseErrorTest, MessageMissingBody) { - ExpectHasErrors("message TestMessage;", "0:19: Expected \"{\".\n"); -} - -TEST_F(ParseErrorTest, EofInMessage) { - ExpectHasErrors( - "message TestMessage {", - "0:21: Reached end of input in message definition (missing '}').\n"); -} - -TEST_F(ParseErrorTest, MissingFieldNumber) { - ExpectHasErrors( - "message TestMessage {\n" - " optional int32 foo;\n" - "}\n", - "1:20: Missing field number.\n"); -} - -TEST_F(ParseErrorTest, ExpectedFieldNumber) { - ExpectHasErrors( - "message TestMessage {\n" - " optional int32 foo = ;\n" - "}\n", - "1:23: Expected field number.\n"); -} - -TEST_F(ParseErrorTest, FieldNumberOutOfRange) { - ExpectHasErrors( - "message TestMessage {\n" - " optional int32 foo = 0x100000000;\n" - "}\n", - "1:23: Integer out of range.\n"); -} - -TEST_F(ParseErrorTest, MissingLabel) { - ExpectHasErrors( - "message TestMessage {\n" - " int32 foo = 1;\n" - "}\n", - "1:2: Expected \"required\", \"optional\", or \"repeated\".\n"); -} - -TEST_F(ParseErrorTest, ExpectedOptionName) { - ExpectHasErrors( - "message TestMessage {\n" - " optional uint32 foo = 1 [];\n" - "}\n", - "1:27: Expected identifier.\n"); -} - -TEST_F(ParseErrorTest, NonExtensionOptionNameBeginningWithDot) { - ExpectHasErrors( - "message TestMessage {\n" - " optional uint32 foo = 1 [.foo=1];\n" - "}\n", - "1:27: Expected identifier.\n"); -} - -TEST_F(ParseErrorTest, DefaultValueTypeMismatch) { - ExpectHasErrors( - "message TestMessage {\n" - " optional uint32 foo = 1 [default=true];\n" - "}\n", - "1:35: Expected integer for field default value.\n"); -} - -TEST_F(ParseErrorTest, DefaultValueNotBoolean) { - ExpectHasErrors( - "message TestMessage {\n" - " optional bool foo = 1 [default=blah];\n" - "}\n", - "1:33: Expected \"true\" or \"false\".\n"); -} - -TEST_F(ParseErrorTest, DefaultValueNotString) { - ExpectHasErrors( - "message TestMessage {\n" - " optional string foo = 1 [default=1];\n" - "}\n", - "1:35: Expected string for field default value.\n"); -} - -TEST_F(ParseErrorTest, DefaultValueUnsignedNegative) { - ExpectHasErrors( - "message TestMessage {\n" - " optional uint32 foo = 1 [default=-1];\n" - "}\n", - "1:36: Unsigned field can't have negative default value.\n"); -} - -TEST_F(ParseErrorTest, DefaultValueTooLarge) { - ExpectHasErrors( - "message TestMessage {\n" - " optional int32 foo = 1 [default= 0x80000000];\n" - " optional int32 foo = 1 [default=-0x80000001];\n" - " optional uint32 foo = 1 [default= 0x100000000];\n" - " optional int64 foo = 1 [default= 0x80000000000000000];\n" - " optional int64 foo = 1 [default=-0x80000000000000001];\n" - " optional uint64 foo = 1 [default= 0x100000000000000000];\n" - "}\n", - "1:36: Integer out of range.\n" - "2:36: Integer out of range.\n" - "3:36: Integer out of range.\n" - "4:36: Integer out of range.\n" - "5:36: Integer out of range.\n" - "6:36: Integer out of range.\n"); -} - -TEST_F(ParseErrorTest, JsonNameNotString) { - ExpectHasErrors( - "message TestMessage {\n" - " optional string foo = 1 [json_name=1];\n" - "}\n", - "1:37: Expected string for JSON name.\n"); -} - -TEST_F(ParseErrorTest, DuplicateJsonName) { - ExpectHasErrors( - "message TestMessage {\n" - " optional uint32 foo = 1 [json_name=\"a\",json_name=\"b\"];\n" - "}\n", - "1:41: Already set option \"json_name\".\n"); -} - -TEST_F(ParseErrorTest, EnumValueOutOfRange) { - ExpectHasErrors( - "enum TestEnum {\n" - " HEX_TOO_BIG = 0x80000000;\n" - " HEX_TOO_SMALL = -0x80000001;\n" - " INT_TOO_BIG = 2147483648;\n" - " INT_TOO_SMALL = -2147483649;\n" - "}\n", - "1:19: Integer out of range.\n" - "2:19: Integer out of range.\n" - "3:19: Integer out of range.\n" - "4:19: Integer out of range.\n"); -} - -TEST_F(ParseErrorTest, EnumAllowAliasFalse) { - ExpectHasErrors( - "enum Foo {\n" - " option allow_alias = false;\n" - " BAR = 1;\n" - " BAZ = 2;\n" - "}\n", - "5:0: \"Foo\" declares 'option allow_alias = false;' which has no " - "effect. " - "Please remove the declaration.\n"); -} - -TEST_F(ParseErrorTest, UnnecessaryEnumAllowAlias) { - ExpectHasErrors( - "enum Foo {\n" - " option allow_alias = true;\n" - " BAR = 1;\n" - " BAZ = 2;\n" - "}\n", - "5:0: \"Foo\" declares support for enum aliases but no enum values share " - "field numbers. Please remove the unnecessary 'option allow_alias = " - "true;' " - "declaration.\n"); -} - -TEST_F(ParseErrorTest, DefaultValueMissing) { - ExpectHasErrors( - "message TestMessage {\n" - " optional uint32 foo = 1 [default=];\n" - "}\n", - "1:35: Expected integer for field default value.\n"); -} - -TEST_F(ParseErrorTest, DefaultValueForGroup) { - ExpectHasErrors( - "message TestMessage {\n" - " optional group Foo = 1 [default=blah] {}\n" - "}\n", - "1:34: Messages can't have default values.\n"); -} - -TEST_F(ParseErrorTest, DuplicateDefaultValue) { - ExpectHasErrors( - "message TestMessage {\n" - " optional uint32 foo = 1 [default=1,default=2];\n" - "}\n", - "1:37: Already set option \"default\".\n"); -} - -TEST_F(ParseErrorTest, MissingOneofName) { - ExpectHasErrors( - "message TestMessage {\n" - " oneof {\n" - " int32 bar = 1;\n" - " }\n" - "}\n", - "1:8: Expected oneof name.\n"); -} - -TEST_F(ParseErrorTest, LabelInOneof) { - ExpectHasErrors( - "message TestMessage {\n" - " oneof foo {\n" - " optional int32 bar = 1;\n" - " }\n" - "}\n", - "2:4: Fields in oneofs must not have labels (required / optional " - "/ repeated).\n"); -} - -TEST_F(ParseErrorTest, MapInOneof) { - ExpectHasErrors( - "message TestMessage {\n" - " oneof foo {\n" - " map foo_map = 1;\n" - " map message_field = 2;\n" // a normal message field is OK - " }\n" - "}\n", - "2:7: Map fields are not allowed in oneofs.\n"); -} - -TEST_F(ParseErrorTest, LabelForMap) { - ExpectHasErrors( - "message TestMessage {\n" - " optional map int_map = 1;\n" - " required map int_map2 = 2;\n" - " repeated map int_map3 = 3;\n" - " optional map map_message = 4;\n" // a normal message field is OK - "}\n", - "1:14: Field labels (required/optional/repeated) are not allowed on map " - "fields.\n" - "2:14: Field labels (required/optional/repeated) are not allowed on map " - "fields.\n" - "3:14: Field labels (required/optional/repeated) are not allowed on map " - "fields.\n"); -} - -TEST_F(ParseErrorTest, MalformedMaps) { - ExpectHasErrors( - "message TestMessage {\n" - " map map_message = 1;\n" // a normal message field lacking label - " map str_map = 2;\n" - " map str_map2 = 3;\n" - " map<,string> str_map3 = 4;\n" - " map<> empty_map = 5;\n" - " map int_map = 1;\n" - "}", - "1:6: Expected \"required\", \"optional\", or \"repeated\".\n" - "2:12: Expected \",\".\n" - "3:13: Expected type name.\n" - "4:6: Expected type name.\n" - "5:6: Expected type name.\n" - "6:20: Expected \">\".\n" - "8:5: Map fields are not allowed to be extensions.\n"); -} - -TEST_F(ParseErrorTest, GroupNotCapitalized) { - ExpectHasErrors( - "message TestMessage {\n" - " optional group foo = 1 {}\n" - "}\n", - "1:17: Group names must start with a capital letter.\n"); -} - -TEST_F(ParseErrorTest, GroupMissingBody) { - ExpectHasErrors( - "message TestMessage {\n" - " optional group Foo = 1;\n" - "}\n", - "1:24: Missing group body.\n"); -} - -TEST_F(ParseErrorTest, ExtendingPrimitive) { - ExpectHasErrors("extend int32 { optional string foo = 4; }\n", - "0:7: Expected message type.\n"); -} - -TEST_F(ParseErrorTest, ErrorInExtension) { - ExpectHasErrors( - "message Foo { extensions 100 to 199; }\n" - "extend Foo { optional string foo; }\n", - "1:32: Missing field number.\n"); -} - -TEST_F(ParseErrorTest, MultipleParseErrors) { - // When a statement has a parse error, the parser should be able to continue - // parsing at the next statement. - ExpectHasErrors( - "message TestMessage {\n" - " optional int32 foo;\n" - " !invalid statement ending in a block { blah blah { blah } blah }\n" - " optional int32 bar = 3 {}\n" - "}\n", - "1:20: Missing field number.\n" - "2:2: Expected \"required\", \"optional\", or \"repeated\".\n" - "2:2: Expected type name.\n" - "3:25: Expected \";\".\n"); -} - -TEST_F(ParseErrorTest, EofInAggregateValue) { - ExpectHasErrors( - "option (fileopt) = { i:100\n", - "1:0: Unexpected end of stream while parsing aggregate value.\n"); -} - -// ------------------------------------------------------------------- -// Enum errors - -TEST_F(ParseErrorTest, EofInEnum) { - ExpectHasErrors( - "enum TestEnum {", - "0:15: Reached end of input in enum definition (missing '}').\n"); -} - -TEST_F(ParseErrorTest, EnumValueMissingNumber) { - ExpectHasErrors( - "enum TestEnum {\n" - " FOO;\n" - "}\n", - "1:5: Missing numeric value for enum constant.\n"); -} - -TEST_F(ParseErrorTest, EnumReservedStandaloneMaxNotAllowed) { - ExpectHasErrors( - "enum TestEnum {\n" - " FOO = 1;\n" - " reserved max;\n" - "}\n", - "2:11: Expected enum value or number range.\n"); -} - -TEST_F(ParseErrorTest, EnumReservedMixNameAndNumber) { - ExpectHasErrors( - "enum TestEnum {\n" - " FOO = 1;\n" - " reserved 10, \"foo\";\n" - "}\n", - "2:15: Expected enum number range.\n"); -} - -TEST_F(ParseErrorTest, EnumReservedPositiveNumberOutOfRange) { - ExpectHasErrors( - "enum TestEnum {\n" - "FOO = 1;\n" - " reserved 2147483648;\n" - "}\n", - "2:11: Integer out of range.\n"); -} - -TEST_F(ParseErrorTest, EnumReservedNegativeNumberOutOfRange) { - ExpectHasErrors( - "enum TestEnum {\n" - "FOO = 1;\n" - " reserved -2147483649;\n" - "}\n", - "2:12: Integer out of range.\n"); -} - -TEST_F(ParseErrorTest, EnumReservedMissingQuotes) { - ExpectHasErrors( - "enum TestEnum {\n" - " FOO = 1;\n" - " reserved foo;\n" - "}\n", - "2:11: Expected enum value or number range.\n"); -} - -// ------------------------------------------------------------------- -// Reserved field number errors - -TEST_F(ParseErrorTest, ReservedStandaloneMaxNotAllowed) { - ExpectHasErrors( - "message Foo {\n" - " reserved max;\n" - "}\n", - "1:11: Expected field name or number range.\n"); -} - -TEST_F(ParseErrorTest, ReservedMixNameAndNumber) { - ExpectHasErrors( - "message Foo {\n" - " reserved 10, \"foo\";\n" - "}\n", - "1:15: Expected field number range.\n"); -} - -TEST_F(ParseErrorTest, ReservedMissingQuotes) { - ExpectHasErrors( - "message Foo {\n" - " reserved foo;\n" - "}\n", - "1:11: Expected field name or number range.\n"); -} - -TEST_F(ParseErrorTest, ReservedNegativeNumber) { - ExpectHasErrors( - "message Foo {\n" - " reserved -10;\n" - "}\n", - "1:11: Expected field name or number range.\n"); -} - -TEST_F(ParseErrorTest, ReservedNumberOutOfRange) { - ExpectHasErrors( - "message Foo {\n" - " reserved 2147483648;\n" - "}\n", - "1:11: Integer out of range.\n"); -} - -// ------------------------------------------------------------------- -// Service errors - -TEST_F(ParseErrorTest, EofInService) { - ExpectHasErrors( - "service TestService {", - "0:21: Reached end of input in service definition (missing '}').\n"); -} - -TEST_F(ParseErrorTest, ServiceMethodPrimitiveParams) { - ExpectHasErrors( - "service TestService {\n" - " rpc Foo(int32) returns (string);\n" - "}\n", - "1:10: Expected message type.\n" - "1:26: Expected message type.\n"); -} - - -TEST_F(ParseErrorTest, EofInMethodOptions) { - ExpectHasErrors( - "service TestService {\n" - " rpc Foo(Bar) returns(Bar) {", - "1:29: Reached end of input in method options (missing '}').\n" - "1:29: Reached end of input in service definition (missing '}').\n"); -} - - -TEST_F(ParseErrorTest, PrimitiveMethodInput) { - ExpectHasErrors( - "service TestService {\n" - " rpc Foo(int32) returns(Bar);\n" - "}\n", - "1:10: Expected message type.\n"); -} - - -TEST_F(ParseErrorTest, MethodOptionTypeError) { - // This used to cause an infinite loop. - ExpectHasErrors( - "message Baz {}\n" - "service Foo {\n" - " rpc Bar(Baz) returns(Baz) { option invalid syntax; }\n" - "}\n", - "2:45: Expected \"=\".\n"); -} - - -// ------------------------------------------------------------------- -// Import and package errors - -TEST_F(ParseErrorTest, ImportNotQuoted) { - ExpectHasErrors("import foo;\n", - "0:7: Expected a string naming the file to import.\n"); -} - -TEST_F(ParseErrorTest, MultiplePackagesInFile) { - ExpectHasErrors( - "package foo;\n" - "package bar;\n", - "1:0: Multiple package definitions.\n"); -} - -// =================================================================== -// Test that errors detected by DescriptorPool correctly report line and -// column numbers. We have one test for every call to RecordLocation() in -// parser.cc. - -typedef ParserTest ParserValidationErrorTest; - -TEST_F(ParserValidationErrorTest, PackageNameError) { - // Create another file which defines symbol "foo". - FileDescriptorProto other_file; - other_file.set_name("bar.proto"); - other_file.add_message_type()->set_name("foo"); - EXPECT_TRUE(pool_.BuildFile(other_file) != NULL); - - // Now try to define it as a package. - ExpectHasValidationErrors( - "package foo.bar;", - "0:0: \"foo\" is already defined (as something other than a package) " - "in file \"bar.proto\".\n"); -} - -TEST_F(ParserValidationErrorTest, ImportUnloadedError) { - ExpectHasValidationErrors( - "package test;\n" - "\n" - "import \"unloaded.proto\";", - "2:0: Import \"unloaded.proto\" has not been loaded.\n"); -} - -TEST_F(ParserValidationErrorTest, ImportTwice) { - FileDescriptorProto other_file; - other_file.set_name("bar.proto"); - other_file.add_message_type()->set_name("foo"); - EXPECT_TRUE(pool_.BuildFile(other_file) != nullptr); - - ExpectHasValidationErrors( - "package test;\n" - "\n" - "import \"bar.proto\";\n" - " import \"bar.proto\";", - "3:2: Import \"bar.proto\" was listed twice.\n"); -} - -TEST_F(ParserValidationErrorTest, DuplicateFileError) { - FileDescriptorProto other_file; - other_file.set_name("foo.proto"); - EXPECT_TRUE(pool_.BuildFile(other_file) != nullptr); - - ExpectHasValidationErrors( - "package test;", "0:0: A file with this name is already in the pool.\n"); -} - -TEST_F(ParserValidationErrorTest, MessageNameError) { - ExpectHasValidationErrors( - "message Foo {}\n" - "message Foo {}\n", - "1:8: \"Foo\" is already defined.\n"); -} - -TEST_F(ParserValidationErrorTest, FieldNameError) { - ExpectHasValidationErrors( - "message Foo {\n" - " optional int32 bar = 1;\n" - " optional int32 bar = 2;\n" - "}\n", - "2:17: \"bar\" is already defined in \"Foo\".\n"); -} - -TEST_F(ParserValidationErrorTest, FieldTypeError) { - ExpectHasValidationErrors( - "message Foo {\n" - " optional Baz bar = 1;\n" - "}\n", - "1:11: \"Baz\" is not defined.\n"); -} - -TEST_F(ParserValidationErrorTest, FieldNumberError) { - ExpectHasValidationErrors( - "message Foo {\n" - " optional int32 bar = 0;\n" - "}\n", - "1:23: Field numbers must be positive integers.\n"); -} - -TEST_F(ParserValidationErrorTest, FieldExtendeeError) { - ExpectHasValidationErrors("extend Baz { optional int32 bar = 1; }\n", - "0:7: \"Baz\" is not defined.\n"); -} - -TEST_F(ParserValidationErrorTest, ExtensionJsonNameError) { - ExpectHasValidationErrors( - "message TestMessage {\n" - " extensions 1 to 100;\n" - "}\n" - "extend TestMessage {\n" - " optional int32 foo = 12 [json_name = \"bar\"];\n" - "}", - "4:27: option json_name is not allowed on extension fields.\n"); -} - -TEST_F(ParserValidationErrorTest, FieldDefaultValueError) { - ExpectHasValidationErrors( - "enum Baz { QUX = 1; }\n" - "message Foo {\n" - " optional Baz bar = 1 [default=NO_SUCH_VALUE];\n" - "}\n", - "2:32: Enum type \"Baz\" has no value named \"NO_SUCH_VALUE\".\n"); -} - -TEST_F(ParserValidationErrorTest, FileOptionNameError) { - ExpectHasValidationErrors( - "option foo = 5;", - "0:7: Option \"foo\" unknown. Ensure that your proto definition file " - "imports the proto which defines the option.\n"); -} - -TEST_F(ParserValidationErrorTest, FileOptionValueError) { - ExpectHasValidationErrors( - "option java_outer_classname = 5;", - "0:30: Value must be quoted string for string option " - "\"google.protobuf.FileOptions.java_outer_classname\".\n"); -} - -TEST_F(ParserValidationErrorTest, FieldOptionNameError) { - ExpectHasValidationErrors( - "message Foo {\n" - " optional bool bar = 1 [foo=1];\n" - "}\n", - "1:25: Option \"foo\" unknown. Ensure that your proto definition file " - "imports the proto which defines the option.\n"); -} - -TEST_F(ParserValidationErrorTest, FieldOptionValueError) { - ExpectHasValidationErrors( - "message Foo {\n" - " optional int32 bar = 1 [ctype=1];\n" - "}\n", - "1:32: Value must be identifier for enum-valued option " - "\"google.protobuf.FieldOptions.ctype\".\n"); -} - -TEST_F(ParserValidationErrorTest, ExtensionRangeNumberError) { - ExpectHasValidationErrors( - "message Foo {\n" - " extensions 0;\n" - "}\n", - "1:13: Extension numbers must be positive integers.\n"); -} - -TEST_F(ParserValidationErrorTest, Proto3ExtensionError) { - ExpectHasValidationErrors( - "syntax = 'proto3';\n" - "message Foo { \n" - " extensions 100 to 199;\n" - "}\n" - "extend Foo { string foo = 101; }\n", - "4:7: Extensions in proto3 are only allowed for defining options.\n" - "2:13: Extension ranges are not allowed in proto3.\n"); -} - -TEST_F(ParserValidationErrorTest, Proto3MessageSet) { - ExpectHasValidationErrors( - "syntax = 'proto3';\n" - "message Foo { \n" - " option message_set_wire_format = true;\n" - "}\n", - "1:8: MessageSet is not supported in proto3.\n"); -} - -TEST_F(ParserValidationErrorTest, Proto3Required) { - ExpectHasValidationErrors( - "syntax = 'proto3';\n" - "message Foo { \n" - " required int32 field = 1;" - "}\n", - "2:11: Required fields are not allowed in proto3.\n"); -} - -TEST_F(ParserValidationErrorTest, Proto3Default) { - ExpectHasValidationErrors( - "syntax = 'proto3';\n" - "message Foo { \n" - " int32 field = 1 [default = 12];" - "}\n", - "2:29: Explicit default values are not allowed in proto3.\n"); -} - -TEST_F(ParserValidationErrorTest, Proto3JsonConflictError) { - ExpectHasValidationErrors( - "syntax = 'proto3';\n" - "message TestMessage {\n" - " uint32 foo = 1;\n" - " uint32 Foo = 2;\n" - "}\n", - "3:9: The JSON camel-case name of field \"Foo\" conflicts with field " - "\"foo\". This is not allowed in proto3.\n"); -} - -TEST_F(ParserValidationErrorTest, EnumNameError) { - ExpectHasValidationErrors( - "enum Foo {A = 1;}\n" - "enum Foo {B = 1;}\n", - "1:5: \"Foo\" is already defined.\n"); -} - -TEST_F(ParserValidationErrorTest, Proto3EnumError) { - ExpectHasValidationErrors( - "syntax = 'proto3';\n" - "enum Foo {A = 1;}\n", - "1:14: The first enum value must be zero in proto3.\n"); -} - -TEST_F(ParserValidationErrorTest, EnumValueNameError) { - ExpectHasValidationErrors( - "enum Foo {\n" - " BAR = 1;\n" - " BAR = 1;\n" - "}\n", - "2:2: \"BAR\" is already defined.\n"); -} - -TEST_F(ParserValidationErrorTest, EnumValueAliasError) { - ExpectHasValidationErrors( - "enum Foo {\n" - " BAR = 1;\n" - " BAZ = 1;\n" - "}\n", - "2:8: \"BAZ\" uses the same enum value as \"BAR\". If this is " - "intended, set 'option allow_alias = true;' to the enum " - "definition.\n"); -} - -TEST_F(ParserValidationErrorTest, ExplicitlyMapEntryError) { - ExpectHasValidationErrors( - "message Foo {\n" - " message ValueEntry {\n" - " option map_entry = true;\n" - " optional int32 key = 1;\n" - " optional int32 value = 2;\n" - " extensions 99 to 999;\n" - " }\n" - " repeated ValueEntry value = 1;\n" - "}", - "7:11: map_entry should not be set explicitly. Use " - "map instead.\n"); -} - -TEST_F(ParserValidationErrorTest, ServiceNameError) { - ExpectHasValidationErrors( - "service Foo {}\n" - "service Foo {}\n", - "1:8: \"Foo\" is already defined.\n"); -} - -TEST_F(ParserValidationErrorTest, MethodNameError) { - ExpectHasValidationErrors( - "message Baz {}\n" - "service Foo {\n" - " rpc Bar(Baz) returns(Baz);\n" - " rpc Bar(Baz) returns(Baz);\n" - "}\n", - "3:6: \"Bar\" is already defined in \"Foo\".\n"); -} - - -TEST_F(ParserValidationErrorTest, MethodInputTypeError) { - ExpectHasValidationErrors( - "message Baz {}\n" - "service Foo {\n" - " rpc Bar(Qux) returns(Baz);\n" - "}\n", - "2:10: \"Qux\" is not defined.\n"); -} - - -TEST_F(ParserValidationErrorTest, MethodOutputTypeError) { - ExpectHasValidationErrors( - "message Baz {}\n" - "service Foo {\n" - " rpc Bar(Baz) returns(Qux);\n" - "}\n", - "2:23: \"Qux\" is not defined.\n"); -} - - -TEST_F(ParserValidationErrorTest, ResolvedUndefinedError) { - // Create another file which defines symbol ".base.bar". - FileDescriptorProto other_file; - other_file.set_name("base.proto"); - other_file.set_package("base"); - other_file.add_message_type()->set_name("bar"); - EXPECT_TRUE(pool_.BuildFile(other_file) != NULL); - - // Define "foo.base" and try "base.bar". - // "base.bar" is resolved to "foo.base.bar" which is not defined. - ExpectHasValidationErrors( - "package foo.base;\n" - "import \"base.proto\";\n" - "message qux {\n" - " optional base.bar baz = 1;\n" - " optional .base.bar quz = 2;\n" - "}\n", - "3:11: \"base.bar\" is resolved to \"foo.base.bar\"," - " which is not defined. The innermost scope is searched first " - "in name resolution. Consider using a leading '.'(i.e., \".base.bar\")" - " to start from the outermost scope.\n"); -} - -TEST_F(ParserValidationErrorTest, ResovledUndefinedOptionError) { - // Build descriptor message in test pool - FileDescriptorProto descriptor_proto; - DescriptorProto::descriptor()->file()->CopyTo(&descriptor_proto); - ASSERT_TRUE(pool_.BuildFile(descriptor_proto) != NULL); - - // base2.proto: - // package baz - // import net/proto2/proto/descriptor.proto - // message Bar { optional int32 foo = 1; } - // extend FileOptions { optional Bar bar = 7672757; } - FileDescriptorProto other_file; - other_file.set_name("base2.proto"); - other_file.set_package("baz"); - other_file.add_dependency(); - other_file.set_dependency(0, descriptor_proto.name()); - - DescriptorProto* message(other_file.add_message_type()); - message->set_name("Bar"); - FieldDescriptorProto* field(message->add_field()); - field->set_name("foo"); - field->set_number(1); - field->set_label(FieldDescriptorProto::LABEL_OPTIONAL); - field->set_type(FieldDescriptorProto::TYPE_INT32); - - FieldDescriptorProto* extension(other_file.add_extension()); - extension->set_name("bar"); - extension->set_number(7672757); - extension->set_label(FieldDescriptorProto::LABEL_OPTIONAL); - extension->set_type(FieldDescriptorProto::TYPE_MESSAGE); - extension->set_type_name("Bar"); - extension->set_extendee("google.protobuf.FileOptions"); - - EXPECT_TRUE(pool_.BuildFile(other_file) != NULL); - - // qux.proto: - // package qux.baz - // option (baz.bar).foo = 1; - // - // Although "baz.bar" is already defined, the lookup code will try - // "qux.baz.bar", since it's the match from the innermost scope, - // which will cause a symbol not defined error. - ExpectHasValidationErrors( - "package qux.baz;\n" - "import \"base2.proto\";\n" - "option (baz.bar).foo = 1;\n", - "2:7: Option \"(baz.bar)\" is resolved to \"(qux.baz.bar)\"," - " which is not defined. The innermost scope is searched first " - "in name resolution. Consider using a leading '.'(i.e., \"(.baz.bar)\")" - " to start from the outermost scope.\n"); -} - -// =================================================================== -// Test that the output from FileDescriptor::DebugString() (and all other -// descriptor types) is parseable, and results in the same Descriptor -// definitions again afoter parsing (note, however, that the order of messages -// cannot be guaranteed to be the same) - -typedef ParserTest ParseDescriptorDebugTest; - -class CompareDescriptorNames { - public: - bool operator()(const DescriptorProto* left, - const DescriptorProto* right) const { - return left->name() < right->name(); - } -}; - -// Sorts nested DescriptorProtos of a DescriptoProto, by name. -void SortMessages(DescriptorProto* descriptor_proto) { - int size = descriptor_proto->nested_type_size(); - // recursively sort; we can't guarantee the order of nested messages either - for (int i = 0; i < size; ++i) { - SortMessages(descriptor_proto->mutable_nested_type(i)); - } - DescriptorProto** data = - descriptor_proto->mutable_nested_type()->mutable_data(); - std::sort(data, data + size, CompareDescriptorNames()); -} - -// Sorts DescriptorProtos belonging to a FileDescriptorProto, by name. -void SortMessages(FileDescriptorProto* file_descriptor_proto) { - int size = file_descriptor_proto->message_type_size(); - // recursively sort; we can't guarantee the order of nested messages either - for (int i = 0; i < size; ++i) { - SortMessages(file_descriptor_proto->mutable_message_type(i)); - } - DescriptorProto** data = - file_descriptor_proto->mutable_message_type()->mutable_data(); - std::sort(data, data + size, CompareDescriptorNames()); -} - -// Strips the message and enum field type names for comparison purpose only. -void StripFieldTypeName(DescriptorProto* proto) { - for (int i = 0; i < proto->field_size(); ++i) { - std::string type_name = proto->field(i).type_name(); - std::string::size_type pos = type_name.find_last_of('.'); - if (pos != std::string::npos) { - proto->mutable_field(i)->mutable_type_name()->assign( - type_name.begin() + pos + 1, type_name.end()); - } - } - for (int i = 0; i < proto->nested_type_size(); ++i) { - StripFieldTypeName(proto->mutable_nested_type(i)); - } -} - -void StripFieldTypeName(FileDescriptorProto* file_proto) { - for (int i = 0; i < file_proto->message_type_size(); ++i) { - StripFieldTypeName(file_proto->mutable_message_type(i)); - } -} - -TEST_F(ParseDescriptorDebugTest, TestAllDescriptorTypes) { - const FileDescriptor* original_file = - protobuf_unittest::TestAllTypes::descriptor()->file(); - FileDescriptorProto expected; - original_file->CopyTo(&expected); - - // Get the DebugString of the unittest.proto FileDecriptor, which includes - // all other descriptor types - std::string debug_string = original_file->DebugString(); - - // Parse the debug string - SetupParser(debug_string.c_str()); - FileDescriptorProto parsed; - parser_->Parse(input_.get(), &parsed); - EXPECT_EQ(io::Tokenizer::TYPE_END, input_->current().type); - ASSERT_EQ("", error_collector_.text_) << "Failed to parse:\n" << debug_string; - - // We now have a FileDescriptorProto, but to compare with the expected we - // need to link to a FileDecriptor, then output back to a proto. We'll - // also need to give it the same name as the original. - parsed.set_name( - TestUtil::MaybeTranslatePath("net/proto2/internal/unittest.proto")); - // We need the imported dependency before we can build our parsed proto - const FileDescriptor* public_import = - protobuf_unittest_import::PublicImportMessage::descriptor()->file(); - FileDescriptorProto public_import_proto; - public_import->CopyTo(&public_import_proto); - ASSERT_TRUE(pool_.BuildFile(public_import_proto) != NULL); - const FileDescriptor* import = - protobuf_unittest_import::ImportMessage::descriptor()->file(); - FileDescriptorProto import_proto; - import->CopyTo(&import_proto); - ASSERT_TRUE(pool_.BuildFile(import_proto) != NULL); - const FileDescriptor* actual = pool_.BuildFile(parsed); - parsed.Clear(); - ASSERT_TRUE(actual != NULL) << "Failed to validate:\n" << debug_string; - actual->CopyTo(&parsed); - ASSERT_TRUE(actual != NULL); - - // The messages might be in different orders, making them hard to compare. - // So, sort the messages in the descriptor protos (including nested messages, - // recursively). - SortMessages(&expected); - SortMessages(&parsed); - - // I really wanted to use StringDiff here for the debug output on fail, - // but the strings are too long for it, and if I increase its max size, - // we get a memory allocation failure :( - EXPECT_EQ(expected.DebugString(), parsed.DebugString()); -} - -TEST_F(ParseDescriptorDebugTest, TestCustomOptions) { - const FileDescriptor* original_file = - protobuf_unittest::AggregateMessage::descriptor()->file(); - FileDescriptorProto expected; - original_file->CopyTo(&expected); - - std::string debug_string = original_file->DebugString(); - - // Parse the debug string - SetupParser(debug_string.c_str()); - FileDescriptorProto parsed; - parser_->Parse(input_.get(), &parsed); - EXPECT_EQ(io::Tokenizer::TYPE_END, input_->current().type); - ASSERT_EQ("", error_collector_.text_); - - // We now have a FileDescriptorProto, but to compare with the expected we - // need to link to a FileDecriptor, then output back to a proto. We'll - // also need to give it the same name as the original. - parsed.set_name(original_file->name()); - - // unittest_custom_options.proto depends on descriptor.proto. - const FileDescriptor* import = FileDescriptorProto::descriptor()->file(); - FileDescriptorProto import_proto; - import->CopyTo(&import_proto); - ASSERT_TRUE(pool_.BuildFile(import_proto) != NULL); - - FileDescriptorProto any_import; - google::protobuf::Any::descriptor()->file()->CopyTo(&any_import); - ASSERT_TRUE(pool_.BuildFile(any_import) != nullptr); - - const FileDescriptor* actual = pool_.BuildFile(parsed); - ASSERT_TRUE(actual != NULL); - parsed.Clear(); - actual->CopyTo(&parsed); - - // The messages might be in different orders, making them hard to compare. - // So, sort the messages in the descriptor protos (including nested messages, - // recursively). - SortMessages(&expected); - SortMessages(&parsed); - - EXPECT_EQ(expected.DebugString(), parsed.DebugString()); -} - -// Ensure that DebugStringWithOptions(), with |include_comments| set to true, -// includes comments from the original parser input in all of the appropriate -// places. -TEST_F(ParseDescriptorDebugTest, TestCommentsInDebugString) { - SetupParser( - "// Detached comment before syntax.\n" - "\n" - "// Syntax comment.\n" - "syntax = \"proto2\";\n" - "\n" - "// Detached comment before package.\n" - "\n" - "// Package comment.\n" - "package comment_test;\n" - "\n" - "// Detached comment before TestMessage1.\n" - "\n" - "// Message comment.\n" - "//\n" - "// More detail in message comment.\n" - "message TestMessage1 {\n" - "\n" - " // Detached comment before foo.\n" - "\n" - " // Field comment.\n" - " optional int32 foo = 1;\n" - "\n" - " // Detached comment before NestedMessage.\n" - "\n" - " // Nested-message comment.\n" - " message NestedMessage {\n" - " optional int32 bar = 1;\n" - " }\n" - "}\n" - "\n" - "// Detached comment before MyEnumType.\n" - "\n" - "// Enum comment.\n" - "enum MyEnumType {\n" - "\n" - " // Detached comment before ASDF.\n" - "\n" - " // Enum-value comment.\n" - " ASDF = 1;\n" - "}\n" - "\n" - "// Detached comment before MyService.\n" - "\n" - "// Service comment.\n" - "service MyService {\n" - "\n" - " // Detached comment before MyRPCCall.\n" - "\n" - " // RPC comment.\n" - " rpc MyRPCCall(TestMessage1) returns (TestMessage1) { }\n" - "}\n"); - - FileDescriptorProto parsed_desc; - parsed_desc.set_name("foo.proto"); - SourceLocationTable source_locations; - parser_->RecordSourceLocationsTo(&source_locations); - parser_->Parse(input_.get(), &parsed_desc); - EXPECT_EQ(io::Tokenizer::TYPE_END, input_->current().type); - ASSERT_EQ("", error_collector_.text_); - - // We need to import the FileDescriptorProto to get a FileDescriptor. - MockValidationErrorCollector collector(source_locations, &error_collector_); - const FileDescriptor* descriptor = - pool_.BuildFileCollectingErrors(parsed_desc, &collector); - ASSERT_TRUE(descriptor != NULL); - - // Ensure that each of the comments appears somewhere in the DebugString(). - // We don't test the exact comment placement or formatting, because we do not - // want to be too fragile here. - const char* expected_comments[] = { - "Detached comment before syntax.", - "Syntax comment.", - "Detached comment before package.", - "Package comment.", - "Detached comment before TestMessage1.", - "Message comment.", - "More detail in message comment.", - "Detached comment before foo.", - "Field comment", - "Detached comment before NestedMessage.", - "Nested-message comment", - "Detached comment before MyEnumType.", - "Enum comment", - "Detached comment before ASDF.", - "Enum-value comment", - "Detached comment before MyService.", - "Service comment", - "Detached comment before MyRPCCall.", - "RPC comment", - }; - - DebugStringOptions debug_string_options; - debug_string_options.include_comments = true; - - { - const std::string debug_string = - descriptor->DebugStringWithOptions(debug_string_options); - - for (int i = 0; i < GOOGLE_ARRAYSIZE(expected_comments); ++i) { - std::string::size_type found_pos = - debug_string.find(expected_comments[i]); - EXPECT_TRUE(found_pos != std::string::npos) - << "\"" << expected_comments[i] << "\" not found."; - } - - // Result of DebugStringWithOptions should be parseable. - SetupParser(debug_string.c_str()); - FileDescriptorProto parsed; - parser_->Parse(input_.get(), &parsed); - EXPECT_EQ(io::Tokenizer::TYPE_END, input_->current().type); - ASSERT_EQ("", error_collector_.text_) << "Failed to parse:\n" - << debug_string; - } - -} - -TEST_F(ParseDescriptorDebugTest, TestMaps) { - SetupParser( - "syntax = \"proto3\"; " - "message Foo { " - " message Bar { } " - " map enum_message_map = 1; " - " map primitive_map = 2; " - "} "); - FileDescriptorProto original; - EXPECT_TRUE(parser_->Parse(input_.get(), &original)); - original.set_name("foo.proto"); - const FileDescriptor* file = pool_.BuildFile(original); - ASSERT_TRUE(file != NULL); - - // Make sure the debug string uses map syntax and does not have the auto - // generated entry. - std::string debug_string = file->DebugString(); - EXPECT_TRUE(debug_string.find("map<") != std::string::npos); - EXPECT_TRUE(debug_string.find("option map_entry") == std::string::npos); - EXPECT_TRUE(debug_string.find("MapEntry") == std::string::npos); - - // Make sure the descriptor debug string is parsable. - FileDescriptorProto parsed; - SetupParser(debug_string.c_str()); - parsed.set_name("foo.proto"); - ASSERT_TRUE(parser_->Parse(input_.get(), &parsed)); - - original.clear_source_code_info(); - parsed.clear_source_code_info(); - StripFieldTypeName(&original); - StripFieldTypeName(&parsed); - EXPECT_EQ(original.DebugString(), parsed.DebugString()); -} - -// =================================================================== -// SourceCodeInfo tests. - -// Follows a path -- as defined by SourceCodeInfo.Location.path -- from a -// message to a particular sub-field. -// * If the target is itself a message, sets *output_message to point at it, -// *output_field to NULL, and *output_index to -1. -// * Otherwise, if the target is an element of a repeated field, sets -// *output_message to the containing message, *output_field to the descriptor -// of the field, and *output_index to the index of the element. -// * Otherwise, the target is a field (possibly a repeated field, but not any -// one element). Sets *output_message to the containing message, -// *output_field to the descriptor of the field, and *output_index to -1. -// Returns true if the path was valid, false otherwise. A gTest failure is -// recorded before returning false. -bool FollowPath(const Message& root, const int* path_begin, const int* path_end, - const Message** output_message, - const FieldDescriptor** output_field, int* output_index) { - if (path_begin == path_end) { - // Path refers to this whole message. - *output_message = &root; - *output_field = NULL; - *output_index = -1; - return true; - } - - const Descriptor* descriptor = root.GetDescriptor(); - const Reflection* reflection = root.GetReflection(); - - const FieldDescriptor* field = descriptor->FindFieldByNumber(*path_begin); - - if (field == NULL) { - ADD_FAILURE() << descriptor->name() - << " has no field number: " << *path_begin; - return false; - } - - ++path_begin; - - if (field->is_repeated()) { - if (path_begin == path_end) { - // Path refers to the whole repeated field. - *output_message = &root; - *output_field = field; - *output_index = -1; - return true; - } - - int index = *path_begin++; - int size = reflection->FieldSize(root, field); - - if (index >= size) { - ADD_FAILURE() << descriptor->name() << "." << field->name() - << " has size " << size - << ", but path contained index: " << index; - return false; - } - - if (field->cpp_type() == FieldDescriptor::CPPTYPE_MESSAGE) { - // Descend into child message. - const Message& child = reflection->GetRepeatedMessage(root, field, index); - return FollowPath(child, path_begin, path_end, output_message, - output_field, output_index); - } else if (path_begin == path_end) { - // Path refers to this element. - *output_message = &root; - *output_field = field; - *output_index = index; - return true; - } else { - ADD_FAILURE() << descriptor->name() << "." << field->name() - << " is not a message; cannot descend into it."; - return false; - } - } else { - if (field->cpp_type() == FieldDescriptor::CPPTYPE_MESSAGE) { - const Message& child = reflection->GetMessage(root, field); - return FollowPath(child, path_begin, path_end, output_message, - output_field, output_index); - } else if (path_begin == path_end) { - // Path refers to this field. - *output_message = &root; - *output_field = field; - *output_index = -1; - return true; - } else { - ADD_FAILURE() << descriptor->name() << "." << field->name() - << " is not a message; cannot descend into it."; - return false; - } - } -} - -// Check if two spans are equal. -bool CompareSpans(const RepeatedField& span1, - const RepeatedField& span2) { - if (span1.size() != span2.size()) return false; - for (int i = 0; i < span1.size(); i++) { - if (span1.Get(i) != span2.Get(i)) return false; - } - return true; -} - -// Test fixture for source info tests, which check that source locations are -// recorded correctly in FileDescriptorProto.source_code_info.location. -class SourceInfoTest : public ParserTest { - protected: - // The parsed file (initialized by Parse()). - FileDescriptorProto file_; - - // Parse the given text as a .proto file and populate the spans_ map with - // all the source location spans in its SourceCodeInfo table. - bool Parse(const char* text) { - ExtractMarkers(text); - SetupParser(text_without_markers_.c_str()); - if (!parser_->Parse(input_.get(), &file_)) { - return false; - } - - const SourceCodeInfo& source_info = file_.source_code_info(); - for (int i = 0; i < source_info.location_size(); i++) { - const SourceCodeInfo::Location& location = source_info.location(i); - const Message* descriptor_proto = NULL; - const FieldDescriptor* field = NULL; - int index = 0; - if (!FollowPath(file_, location.path().begin(), location.path().end(), - &descriptor_proto, &field, &index)) { - return false; - } - - spans_.insert( - std::make_pair(SpanKey(*descriptor_proto, field, index), &location)); - } - - return true; - } - - void TearDown() override { - EXPECT_TRUE(spans_.empty()) << "Forgot to call HasSpan() for:\n" - << spans_.begin()->second->DebugString(); - } - - // ----------------------------------------------------------------- - // HasSpan() checks that the span of source code delimited by the given - // tags (comments) correspond via the SourceCodeInfo table to the given - // part of the FileDescriptorProto. (If unclear, look at the actual tests; - // it should quickly become obvious.) - - bool HasSpan(char start_marker, char end_marker, - const Message& descriptor_proto) { - return HasSpanWithComment(start_marker, end_marker, descriptor_proto, NULL, - -1, NULL, NULL, NULL); - } - - bool HasSpanWithComment(char start_marker, char end_marker, - const Message& descriptor_proto, - const char* expected_leading_comments, - const char* expected_trailing_comments, - const char* expected_leading_detached_comments) { - return HasSpanWithComment(start_marker, end_marker, descriptor_proto, NULL, - -1, expected_leading_comments, - expected_trailing_comments, - expected_leading_detached_comments); - } - - bool HasSpan(char start_marker, char end_marker, - const Message& descriptor_proto, const std::string& field_name) { - return HasSpan(start_marker, end_marker, descriptor_proto, field_name, -1); - } - - bool HasSpan(char start_marker, char end_marker, - const Message& descriptor_proto, const std::string& field_name, - int index) { - return HasSpan(start_marker, end_marker, descriptor_proto, field_name, - index, NULL, NULL, NULL); - } - - bool HasSpan(char start_marker, char end_marker, - const Message& descriptor_proto, const std::string& field_name, - int index, const char* expected_leading_comments, - const char* expected_trailing_comments, - const char* expected_leading_detached_comments) { - const FieldDescriptor* field = - descriptor_proto.GetDescriptor()->FindFieldByName(field_name); - if (field == NULL) { - ADD_FAILURE() << descriptor_proto.GetDescriptor()->name() - << " has no such field: " << field_name; - return false; - } - - return HasSpanWithComment(start_marker, end_marker, descriptor_proto, field, - index, expected_leading_comments, - expected_trailing_comments, - expected_leading_detached_comments); - } - - bool HasSpan(const Message& descriptor_proto) { - return HasSpanWithComment('\0', '\0', descriptor_proto, NULL, -1, NULL, - NULL, NULL); - } - - bool HasSpan(const Message& descriptor_proto, const std::string& field_name) { - return HasSpan('\0', '\0', descriptor_proto, field_name, -1); - } - - bool HasSpanWithComment(char start_marker, char end_marker, - const Message& descriptor_proto, - const FieldDescriptor* field, int index, - const char* expected_leading_comments, - const char* expected_trailing_comments, - const char* expected_leading_detached_comments) { - std::pair range = - spans_.equal_range(SpanKey(descriptor_proto, field, index)); - - if (start_marker == '\0') { - if (range.first == range.second) { - return false; - } else { - spans_.erase(range.first); - return true; - } - } else { - std::pair start_pos = FindOrDie(markers_, start_marker); - std::pair end_pos = FindOrDie(markers_, end_marker); - - RepeatedField expected_span; - expected_span.Add(start_pos.first); - expected_span.Add(start_pos.second); - if (end_pos.first != start_pos.first) { - expected_span.Add(end_pos.first); - } - expected_span.Add(end_pos.second); - - for (SpanMap::iterator iter = range.first; iter != range.second; ++iter) { - if (CompareSpans(expected_span, iter->second->span())) { - if (expected_leading_comments == NULL) { - EXPECT_FALSE(iter->second->has_leading_comments()); - } else { - EXPECT_TRUE(iter->second->has_leading_comments()); - EXPECT_EQ(expected_leading_comments, - iter->second->leading_comments()); - } - if (expected_trailing_comments == NULL) { - EXPECT_FALSE(iter->second->has_trailing_comments()); - } else { - EXPECT_TRUE(iter->second->has_trailing_comments()); - EXPECT_EQ(expected_trailing_comments, - iter->second->trailing_comments()); - } - if (expected_leading_detached_comments == NULL) { - EXPECT_EQ(0, iter->second->leading_detached_comments_size()); - } else { - EXPECT_EQ( - expected_leading_detached_comments, - Join(iter->second->leading_detached_comments(), "\n")); - } - - spans_.erase(iter); - return true; - } - } - - return false; - } - } - - private: - struct SpanKey { - const Message* descriptor_proto; - const FieldDescriptor* field; - int index; - - inline SpanKey() {} - inline SpanKey(const Message& descriptor_proto_param, - const FieldDescriptor* field_param, int index_param) - : descriptor_proto(&descriptor_proto_param), - field(field_param), - index(index_param) {} - - inline bool operator<(const SpanKey& other) const { - if (descriptor_proto < other.descriptor_proto) return true; - if (descriptor_proto > other.descriptor_proto) return false; - if (field < other.field) return true; - if (field > other.field) return false; - return index < other.index; - } - }; - - typedef std::multimap SpanMap; - SpanMap spans_; - std::map > markers_; - std::string text_without_markers_; - - void ExtractMarkers(const char* text) { - markers_.clear(); - text_without_markers_.clear(); - int line = 0; - int column = 0; - while (*text != '\0') { - if (*text == '$') { - ++text; - GOOGLE_CHECK_NE('\0', *text); - if (*text == '$') { - text_without_markers_ += '$'; - ++column; - } else { - markers_[*text] = std::make_pair(line, column); - ++text; - GOOGLE_CHECK_EQ('$', *text); - } - } else if (*text == '\n') { - ++line; - column = 0; - text_without_markers_ += *text; - } else { - text_without_markers_ += *text; - ++column; - } - ++text; - } - } -}; - -TEST_F(SourceInfoTest, BasicFileDecls) { - EXPECT_TRUE( - Parse("$a$syntax = \"proto2\";$i$\n" - "$b$package foo.bar;$c$\n" - "$d$import \"baz.proto\";$e$\n" - "$f$import\"qux.proto\";$h$\n" - "$j$import $k$public$l$ \"bar.proto\";$m$\n" - "$n$import $o$weak$p$ \"bar.proto\";$q$\n" - "\n" - "// comment ignored\n")); - - EXPECT_TRUE(HasSpan('a', 'q', file_)); - EXPECT_TRUE(HasSpan('b', 'c', file_, "package")); - EXPECT_TRUE(HasSpan('d', 'e', file_, "dependency", 0)); - EXPECT_TRUE(HasSpan('f', 'h', file_, "dependency", 1)); - EXPECT_TRUE(HasSpan('j', 'm', file_, "dependency", 2)); - EXPECT_TRUE(HasSpan('k', 'l', file_, "public_dependency", 0)); - EXPECT_TRUE(HasSpan('n', 'q', file_, "dependency", 3)); - EXPECT_TRUE(HasSpan('o', 'p', file_, "weak_dependency", 0)); - EXPECT_TRUE(HasSpan('a', 'i', file_, "syntax")); -} - -TEST_F(SourceInfoTest, Messages) { - EXPECT_TRUE( - Parse("$a$message $b$Foo$c$ {}$d$\n" - "$e$message $f$Bar$g$ {}$h$\n")); - - EXPECT_TRUE(HasSpan('a', 'd', file_.message_type(0))); - EXPECT_TRUE(HasSpan('b', 'c', file_.message_type(0), "name")); - EXPECT_TRUE(HasSpan('e', 'h', file_.message_type(1))); - EXPECT_TRUE(HasSpan('f', 'g', file_.message_type(1), "name")); - - // Ignore these. - EXPECT_TRUE(HasSpan(file_)); -} - -TEST_F(SourceInfoTest, Fields) { - EXPECT_TRUE( - Parse("message Foo {\n" - " $a$optional$b$ $c$int32$d$ $e$bar$f$ = $g$1$h$;$i$\n" - " $j$repeated$k$ $l$X.Y$m$ $n$baz$o$ = $p$2$q$;$r$\n" - "}\n")); - - const FieldDescriptorProto& field1 = file_.message_type(0).field(0); - const FieldDescriptorProto& field2 = file_.message_type(0).field(1); - - EXPECT_TRUE(HasSpan('a', 'i', field1)); - EXPECT_TRUE(HasSpan('a', 'b', field1, "label")); - EXPECT_TRUE(HasSpan('c', 'd', field1, "type")); - EXPECT_TRUE(HasSpan('e', 'f', field1, "name")); - EXPECT_TRUE(HasSpan('g', 'h', field1, "number")); - - EXPECT_TRUE(HasSpan('j', 'r', field2)); - EXPECT_TRUE(HasSpan('j', 'k', field2, "label")); - EXPECT_TRUE(HasSpan('l', 'm', field2, "type_name")); - EXPECT_TRUE(HasSpan('n', 'o', field2, "name")); - EXPECT_TRUE(HasSpan('p', 'q', field2, "number")); - - // Ignore these. - EXPECT_TRUE(HasSpan(file_)); - EXPECT_TRUE(HasSpan(file_.message_type(0))); - EXPECT_TRUE(HasSpan(file_.message_type(0), "name")); -} - -TEST_F(SourceInfoTest, Proto3Fields) { - EXPECT_TRUE( - Parse("syntax = \"proto3\";\n" - "message Foo {\n" - " $a$int32$b$ $c$bar$d$ = $e$1$f$;$g$\n" - " $h$repeated$i$ $j$X.Y$k$ $l$baz$m$ = $n$2$o$;$p$\n" - "}\n")); - - const FieldDescriptorProto& field1 = file_.message_type(0).field(0); - const FieldDescriptorProto& field2 = file_.message_type(0).field(1); - - EXPECT_TRUE(HasSpan('a', 'g', field1)); - EXPECT_TRUE(HasSpan('a', 'b', field1, "type")); - EXPECT_TRUE(HasSpan('c', 'd', field1, "name")); - EXPECT_TRUE(HasSpan('e', 'f', field1, "number")); - - EXPECT_TRUE(HasSpan('h', 'p', field2)); - EXPECT_TRUE(HasSpan('h', 'i', field2, "label")); - EXPECT_TRUE(HasSpan('j', 'k', field2, "type_name")); - EXPECT_TRUE(HasSpan('l', 'm', field2, "name")); - EXPECT_TRUE(HasSpan('n', 'o', field2, "number")); - - // Ignore these. - EXPECT_TRUE(HasSpan(file_)); - EXPECT_TRUE(HasSpan(file_, "syntax")); - EXPECT_TRUE(HasSpan(file_.message_type(0))); - EXPECT_TRUE(HasSpan(file_.message_type(0), "name")); -} - -TEST_F(SourceInfoTest, Extensions) { - EXPECT_TRUE( - Parse("$a$extend $b$Foo$c$ {\n" - " $d$optional$e$ int32 bar = 1;$f$\n" - " $g$repeated$h$ X.Y baz = 2;$i$\n" - "}$j$\n" - "$k$extend $l$Bar$m$ {\n" - " $n$optional int32 qux = 1;$o$\n" - "}$p$\n")); - - const FieldDescriptorProto& field1 = file_.extension(0); - const FieldDescriptorProto& field2 = file_.extension(1); - const FieldDescriptorProto& field3 = file_.extension(2); - - EXPECT_TRUE(HasSpan('a', 'j', file_, "extension")); - EXPECT_TRUE(HasSpan('k', 'p', file_, "extension")); - - EXPECT_TRUE(HasSpan('d', 'f', field1)); - EXPECT_TRUE(HasSpan('d', 'e', field1, "label")); - EXPECT_TRUE(HasSpan('b', 'c', field1, "extendee")); - - EXPECT_TRUE(HasSpan('g', 'i', field2)); - EXPECT_TRUE(HasSpan('g', 'h', field2, "label")); - EXPECT_TRUE(HasSpan('b', 'c', field2, "extendee")); - - EXPECT_TRUE(HasSpan('n', 'o', field3)); - EXPECT_TRUE(HasSpan('l', 'm', field3, "extendee")); - - // Ignore these. - EXPECT_TRUE(HasSpan(file_)); - EXPECT_TRUE(HasSpan(field1, "type")); - EXPECT_TRUE(HasSpan(field1, "name")); - EXPECT_TRUE(HasSpan(field1, "number")); - EXPECT_TRUE(HasSpan(field2, "type_name")); - EXPECT_TRUE(HasSpan(field2, "name")); - EXPECT_TRUE(HasSpan(field2, "number")); - EXPECT_TRUE(HasSpan(field3, "label")); - EXPECT_TRUE(HasSpan(field3, "type")); - EXPECT_TRUE(HasSpan(field3, "name")); - EXPECT_TRUE(HasSpan(field3, "number")); -} - -TEST_F(SourceInfoTest, NestedExtensions) { - EXPECT_TRUE( - Parse("message Message {\n" - " $a$extend $b$Foo$c$ {\n" - " $d$optional$e$ int32 bar = 1;$f$\n" - " $g$repeated$h$ X.Y baz = 2;$i$\n" - " }$j$\n" - " $k$extend $l$Bar$m$ {\n" - " $n$optional int32 qux = 1;$o$\n" - " }$p$\n" - "}\n")); - - const FieldDescriptorProto& field1 = file_.message_type(0).extension(0); - const FieldDescriptorProto& field2 = file_.message_type(0).extension(1); - const FieldDescriptorProto& field3 = file_.message_type(0).extension(2); - - EXPECT_TRUE(HasSpan('a', 'j', file_.message_type(0), "extension")); - EXPECT_TRUE(HasSpan('k', 'p', file_.message_type(0), "extension")); - - EXPECT_TRUE(HasSpan('d', 'f', field1)); - EXPECT_TRUE(HasSpan('d', 'e', field1, "label")); - EXPECT_TRUE(HasSpan('b', 'c', field1, "extendee")); - - EXPECT_TRUE(HasSpan('g', 'i', field2)); - EXPECT_TRUE(HasSpan('g', 'h', field2, "label")); - EXPECT_TRUE(HasSpan('b', 'c', field2, "extendee")); - - EXPECT_TRUE(HasSpan('n', 'o', field3)); - EXPECT_TRUE(HasSpan('l', 'm', field3, "extendee")); - - // Ignore these. - EXPECT_TRUE(HasSpan(file_)); - EXPECT_TRUE(HasSpan(file_.message_type(0))); - EXPECT_TRUE(HasSpan(file_.message_type(0), "name")); - EXPECT_TRUE(HasSpan(field1, "type")); - EXPECT_TRUE(HasSpan(field1, "name")); - EXPECT_TRUE(HasSpan(field1, "number")); - EXPECT_TRUE(HasSpan(field2, "type_name")); - EXPECT_TRUE(HasSpan(field2, "name")); - EXPECT_TRUE(HasSpan(field2, "number")); - EXPECT_TRUE(HasSpan(field3, "label")); - EXPECT_TRUE(HasSpan(field3, "type")); - EXPECT_TRUE(HasSpan(field3, "name")); - EXPECT_TRUE(HasSpan(field3, "number")); -} - -TEST_F(SourceInfoTest, ExtensionRanges) { - EXPECT_TRUE( - Parse("message Message {\n" - " $a$extensions $b$1$c$ to $d$4$e$, $f$6$g$;$h$\n" - " $i$extensions $j$8$k$ to $l$max$m$;$n$\n" - "}\n")); - - const DescriptorProto::ExtensionRange& range1 = - file_.message_type(0).extension_range(0); - const DescriptorProto::ExtensionRange& range2 = - file_.message_type(0).extension_range(1); - const DescriptorProto::ExtensionRange& range3 = - file_.message_type(0).extension_range(2); - - EXPECT_TRUE(HasSpan('a', 'h', file_.message_type(0), "extension_range")); - EXPECT_TRUE(HasSpan('i', 'n', file_.message_type(0), "extension_range")); - - EXPECT_TRUE(HasSpan('b', 'e', range1)); - EXPECT_TRUE(HasSpan('b', 'c', range1, "start")); - EXPECT_TRUE(HasSpan('d', 'e', range1, "end")); - - EXPECT_TRUE(HasSpan('f', 'g', range2)); - EXPECT_TRUE(HasSpan('f', 'g', range2, "start")); - EXPECT_TRUE(HasSpan('f', 'g', range2, "end")); - - EXPECT_TRUE(HasSpan('j', 'm', range3)); - EXPECT_TRUE(HasSpan('j', 'k', range3, "start")); - EXPECT_TRUE(HasSpan('l', 'm', range3, "end")); - - // Ignore these. - EXPECT_TRUE(HasSpan(file_)); - EXPECT_TRUE(HasSpan(file_.message_type(0))); - EXPECT_TRUE(HasSpan(file_.message_type(0), "name")); -} - -TEST_F(SourceInfoTest, ReservedRanges) { - EXPECT_TRUE( - Parse("message Message {\n" - " $a$reserved $b$1$c$ to $d$4$e$, $f$6$g$;$h$\n" - "}\n")); - - const DescriptorProto::ReservedRange& range1 = - file_.message_type(0).reserved_range(0); - const DescriptorProto::ReservedRange& range2 = - file_.message_type(0).reserved_range(1); - - EXPECT_TRUE(HasSpan('a', 'h', file_.message_type(0), "reserved_range")); - - EXPECT_TRUE(HasSpan('b', 'e', range1)); - EXPECT_TRUE(HasSpan('b', 'c', range1, "start")); - EXPECT_TRUE(HasSpan('d', 'e', range1, "end")); - - EXPECT_TRUE(HasSpan('f', 'g', range2)); - EXPECT_TRUE(HasSpan('f', 'g', range2, "start")); - EXPECT_TRUE(HasSpan('f', 'g', range2, "end")); - - // Ignore these. - EXPECT_TRUE(HasSpan(file_)); - EXPECT_TRUE(HasSpan(file_.message_type(0))); - EXPECT_TRUE(HasSpan(file_.message_type(0), "name")); -} - -TEST_F(SourceInfoTest, Oneofs) { - EXPECT_TRUE( - Parse("message Foo {\n" - " $a$oneof $c$foo$d$ {\n" - " $e$int32$f$ $g$a$h$ = $i$1$j$;$k$\n" - " }$r$\n" - "}\n")); - - const OneofDescriptorProto& oneof_decl = file_.message_type(0).oneof_decl(0); - const FieldDescriptorProto& field = file_.message_type(0).field(0); - - EXPECT_TRUE(HasSpan('a', 'r', oneof_decl)); - EXPECT_TRUE(HasSpan('c', 'd', oneof_decl, "name")); - - EXPECT_TRUE(HasSpan('e', 'k', field)); - EXPECT_TRUE(HasSpan('e', 'f', field, "type")); - EXPECT_TRUE(HasSpan('g', 'h', field, "name")); - EXPECT_TRUE(HasSpan('i', 'j', field, "number")); - - // Ignore these. - EXPECT_TRUE(HasSpan(file_)); - EXPECT_TRUE(HasSpan(file_.message_type(0))); - EXPECT_TRUE(HasSpan(file_.message_type(0), "name")); -} - -TEST_F(SourceInfoTest, NestedMessages) { - EXPECT_TRUE( - Parse("message Foo {\n" - " $a$message $b$Bar$c$ {\n" - " $d$message $e$Baz$f$ {}$g$\n" - " }$h$\n" - " $i$message $j$Qux$k$ {}$l$\n" - "}\n")); - - const DescriptorProto& bar = file_.message_type(0).nested_type(0); - const DescriptorProto& baz = bar.nested_type(0); - const DescriptorProto& qux = file_.message_type(0).nested_type(1); - - EXPECT_TRUE(HasSpan('a', 'h', bar)); - EXPECT_TRUE(HasSpan('b', 'c', bar, "name")); - EXPECT_TRUE(HasSpan('d', 'g', baz)); - EXPECT_TRUE(HasSpan('e', 'f', baz, "name")); - EXPECT_TRUE(HasSpan('i', 'l', qux)); - EXPECT_TRUE(HasSpan('j', 'k', qux, "name")); - - // Ignore these. - EXPECT_TRUE(HasSpan(file_)); - EXPECT_TRUE(HasSpan(file_.message_type(0))); - EXPECT_TRUE(HasSpan(file_.message_type(0), "name")); -} - -TEST_F(SourceInfoTest, Groups) { - EXPECT_TRUE( - Parse("message Foo {\n" - " message Bar {}\n" - " $a$optional$b$ $c$group$d$ $e$Baz$f$ = $g$1$h$ {\n" - " $i$message Qux {}$j$\n" - " }$k$\n" - "}\n")); - - const DescriptorProto& bar = file_.message_type(0).nested_type(0); - const DescriptorProto& baz = file_.message_type(0).nested_type(1); - const DescriptorProto& qux = baz.nested_type(0); - const FieldDescriptorProto& field = file_.message_type(0).field(0); - - EXPECT_TRUE(HasSpan('a', 'k', field)); - EXPECT_TRUE(HasSpan('a', 'b', field, "label")); - EXPECT_TRUE(HasSpan('c', 'd', field, "type")); - EXPECT_TRUE(HasSpan('e', 'f', field, "name")); - EXPECT_TRUE(HasSpan('e', 'f', field, "type_name")); - EXPECT_TRUE(HasSpan('g', 'h', field, "number")); - - EXPECT_TRUE(HasSpan('a', 'k', baz)); - EXPECT_TRUE(HasSpan('e', 'f', baz, "name")); - EXPECT_TRUE(HasSpan('i', 'j', qux)); - - // Ignore these. - EXPECT_TRUE(HasSpan(file_)); - EXPECT_TRUE(HasSpan(file_.message_type(0))); - EXPECT_TRUE(HasSpan(file_.message_type(0), "name")); - EXPECT_TRUE(HasSpan(bar)); - EXPECT_TRUE(HasSpan(bar, "name")); - EXPECT_TRUE(HasSpan(qux, "name")); -} - -TEST_F(SourceInfoTest, Enums) { - EXPECT_TRUE( - Parse("$a$enum $b$Foo$c$ {}$d$\n" - "$e$enum $f$Bar$g$ {}$h$\n")); - - EXPECT_TRUE(HasSpan('a', 'd', file_.enum_type(0))); - EXPECT_TRUE(HasSpan('b', 'c', file_.enum_type(0), "name")); - EXPECT_TRUE(HasSpan('e', 'h', file_.enum_type(1))); - EXPECT_TRUE(HasSpan('f', 'g', file_.enum_type(1), "name")); - - // Ignore these. - EXPECT_TRUE(HasSpan(file_)); -} - -TEST_F(SourceInfoTest, EnumValues) { - EXPECT_TRUE( - Parse("enum Foo {\n" - " $a$BAR$b$ = $c$1$d$;$e$\n" - " $f$BAZ$g$ = $h$2$i$;$j$\n" - "}")); - - const EnumValueDescriptorProto& bar = file_.enum_type(0).value(0); - const EnumValueDescriptorProto& baz = file_.enum_type(0).value(1); - - EXPECT_TRUE(HasSpan('a', 'e', bar)); - EXPECT_TRUE(HasSpan('a', 'b', bar, "name")); - EXPECT_TRUE(HasSpan('c', 'd', bar, "number")); - EXPECT_TRUE(HasSpan('f', 'j', baz)); - EXPECT_TRUE(HasSpan('f', 'g', baz, "name")); - EXPECT_TRUE(HasSpan('h', 'i', baz, "number")); - - // Ignore these. - EXPECT_TRUE(HasSpan(file_)); - EXPECT_TRUE(HasSpan(file_.enum_type(0))); - EXPECT_TRUE(HasSpan(file_.enum_type(0), "name")); -} - -TEST_F(SourceInfoTest, EnumReservedRange) { - EXPECT_TRUE( - Parse("enum TestEnum {\n" - " $a$reserved $b$1$c$ to $d$10$e$;$f$\n" - "}")); - - const EnumDescriptorProto::EnumReservedRange& bar = - file_.enum_type(0).reserved_range(0); - - EXPECT_TRUE(HasSpan('a', 'f', file_.enum_type(0), "reserved_range")); - EXPECT_TRUE(HasSpan('b', 'e', bar)); - EXPECT_TRUE(HasSpan('b', 'c', bar, "start")); - EXPECT_TRUE(HasSpan('d', 'e', bar, "end")); - - // Ignore these. - EXPECT_TRUE(HasSpan(file_)); - EXPECT_TRUE(HasSpan(file_.enum_type(0))); - EXPECT_TRUE(HasSpan(file_.enum_type(0), "name")); -} - -TEST_F(SourceInfoTest, EnumReservedName) { - EXPECT_TRUE( - Parse("enum TestEnum {\n" - " $a$reserved $b$'foo'$c$;$d$\n" - "}")); - - const EnumDescriptorProto& bar = file_.enum_type(0); - - EXPECT_TRUE(HasSpan('a', 'd', bar, "reserved_name")); - EXPECT_TRUE(HasSpan('b', 'c', bar, "reserved_name", 0)); - - // Ignore these. - EXPECT_TRUE(HasSpan(file_)); - EXPECT_TRUE(HasSpan(file_.enum_type(0))); - EXPECT_TRUE(HasSpan(file_.enum_type(0), "name")); -} - -TEST_F(SourceInfoTest, NestedEnums) { - EXPECT_TRUE( - Parse("message Foo {\n" - " $a$enum $b$Bar$c$ {}$d$\n" - " $e$enum $f$Baz$g$ {}$h$\n" - "}\n")); - - const EnumDescriptorProto& bar = file_.message_type(0).enum_type(0); - const EnumDescriptorProto& baz = file_.message_type(0).enum_type(1); - - EXPECT_TRUE(HasSpan('a', 'd', bar)); - EXPECT_TRUE(HasSpan('b', 'c', bar, "name")); - EXPECT_TRUE(HasSpan('e', 'h', baz)); - EXPECT_TRUE(HasSpan('f', 'g', baz, "name")); - - // Ignore these. - EXPECT_TRUE(HasSpan(file_)); - EXPECT_TRUE(HasSpan(file_.message_type(0))); - EXPECT_TRUE(HasSpan(file_.message_type(0), "name")); -} - -TEST_F(SourceInfoTest, Services) { - EXPECT_TRUE( - Parse("$a$service $b$Foo$c$ {}$d$\n" - "$e$service $f$Bar$g$ {}$h$\n")); - - EXPECT_TRUE(HasSpan('a', 'd', file_.service(0))); - EXPECT_TRUE(HasSpan('b', 'c', file_.service(0), "name")); - EXPECT_TRUE(HasSpan('e', 'h', file_.service(1))); - EXPECT_TRUE(HasSpan('f', 'g', file_.service(1), "name")); - - // Ignore these. - EXPECT_TRUE(HasSpan(file_)); -} - -TEST_F(SourceInfoTest, MethodsAndStreams) { - EXPECT_TRUE( - Parse("service Foo {\n" - " $a$rpc $b$Bar$c$($d$X$e$) returns($f$Y$g$);$h$" - " $i$rpc $j$Baz$k$($l$Z$m$) returns($n$W$o$);$p$" - "}")); - - const MethodDescriptorProto& bar = file_.service(0).method(0); - const MethodDescriptorProto& baz = file_.service(0).method(1); - - EXPECT_TRUE(HasSpan('a', 'h', bar)); - EXPECT_TRUE(HasSpan('b', 'c', bar, "name")); - EXPECT_TRUE(HasSpan('d', 'e', bar, "input_type")); - EXPECT_TRUE(HasSpan('f', 'g', bar, "output_type")); - - EXPECT_TRUE(HasSpan('i', 'p', baz)); - EXPECT_TRUE(HasSpan('j', 'k', baz, "name")); - EXPECT_TRUE(HasSpan('l', 'm', baz, "input_type")); - EXPECT_TRUE(HasSpan('n', 'o', baz, "output_type")); - - // Ignore these. - EXPECT_TRUE(HasSpan(file_)); - EXPECT_TRUE(HasSpan(file_.service(0))); - EXPECT_TRUE(HasSpan(file_.service(0), "name")); -} - - -TEST_F(SourceInfoTest, Options) { - EXPECT_TRUE( - Parse("$a$option $b$foo$c$.$d$($e$bar.baz$f$)$g$ = " - "$h$123$i$;$j$\n" - "$k$option qux = $l$-123$m$;$n$\n" - "$o$option corge = $p$abc$q$;$r$\n" - "$s$option grault = $t$'blah'$u$;$v$\n" - "$w$option garply = $x${ yadda yadda }$y$;$z$\n" - "$0$option waldo = $1$123.0$2$;$3$\n")); - - const UninterpretedOption& option1 = file_.options().uninterpreted_option(0); - const UninterpretedOption& option2 = file_.options().uninterpreted_option(1); - const UninterpretedOption& option3 = file_.options().uninterpreted_option(2); - const UninterpretedOption& option4 = file_.options().uninterpreted_option(3); - const UninterpretedOption& option5 = file_.options().uninterpreted_option(4); - const UninterpretedOption& option6 = file_.options().uninterpreted_option(5); - - EXPECT_TRUE(HasSpan('a', 'j', file_.options())); - EXPECT_TRUE(HasSpan('a', 'j', option1)); - EXPECT_TRUE(HasSpan('b', 'g', option1, "name")); - EXPECT_TRUE(HasSpan('b', 'c', option1.name(0))); - EXPECT_TRUE(HasSpan('b', 'c', option1.name(0), "name_part")); - EXPECT_TRUE(HasSpan('d', 'g', option1.name(1))); - EXPECT_TRUE(HasSpan('e', 'f', option1.name(1), "name_part")); - EXPECT_TRUE(HasSpan('h', 'i', option1, "positive_int_value")); - - EXPECT_TRUE(HasSpan('k', 'n', file_.options())); - EXPECT_TRUE(HasSpan('l', 'm', option2, "negative_int_value")); - - EXPECT_TRUE(HasSpan('o', 'r', file_.options())); - EXPECT_TRUE(HasSpan('p', 'q', option3, "identifier_value")); - - EXPECT_TRUE(HasSpan('s', 'v', file_.options())); - EXPECT_TRUE(HasSpan('t', 'u', option4, "string_value")); - - EXPECT_TRUE(HasSpan('w', 'z', file_.options())); - EXPECT_TRUE(HasSpan('x', 'y', option5, "aggregate_value")); - - EXPECT_TRUE(HasSpan('0', '3', file_.options())); - EXPECT_TRUE(HasSpan('1', '2', option6, "double_value")); - - // Ignore these. - EXPECT_TRUE(HasSpan(file_)); - EXPECT_TRUE(HasSpan(option2)); - EXPECT_TRUE(HasSpan(option3)); - EXPECT_TRUE(HasSpan(option4)); - EXPECT_TRUE(HasSpan(option5)); - EXPECT_TRUE(HasSpan(option6)); - EXPECT_TRUE(HasSpan(option2, "name")); - EXPECT_TRUE(HasSpan(option3, "name")); - EXPECT_TRUE(HasSpan(option4, "name")); - EXPECT_TRUE(HasSpan(option5, "name")); - EXPECT_TRUE(HasSpan(option6, "name")); - EXPECT_TRUE(HasSpan(option2.name(0))); - EXPECT_TRUE(HasSpan(option3.name(0))); - EXPECT_TRUE(HasSpan(option4.name(0))); - EXPECT_TRUE(HasSpan(option5.name(0))); - EXPECT_TRUE(HasSpan(option6.name(0))); - EXPECT_TRUE(HasSpan(option2.name(0), "name_part")); - EXPECT_TRUE(HasSpan(option3.name(0), "name_part")); - EXPECT_TRUE(HasSpan(option4.name(0), "name_part")); - EXPECT_TRUE(HasSpan(option5.name(0), "name_part")); - EXPECT_TRUE(HasSpan(option6.name(0), "name_part")); -} - -TEST_F(SourceInfoTest, ScopedOptions) { - EXPECT_TRUE( - Parse("message Foo {\n" - " $a$option mopt = 1;$b$\n" - "}\n" - "enum Bar {\n" - " $c$option eopt = 1;$d$\n" - "}\n" - "service Baz {\n" - " $e$option sopt = 1;$f$\n" - " rpc M(X) returns(Y) {\n" - " $g$option mopt = 1;$h$\n" - " }\n" - " rpc MS4($1$stream$2$ X) returns($3$stream$4$ Y) {\n" - " $k$option mopt = 1;$l$\n" - " }\n" - "}\n")); - - EXPECT_TRUE(HasSpan('a', 'b', file_.message_type(0).options())); - EXPECT_TRUE(HasSpan('c', 'd', file_.enum_type(0).options())); - EXPECT_TRUE(HasSpan('e', 'f', file_.service(0).options())); - EXPECT_TRUE(HasSpan('g', 'h', file_.service(0).method(0).options())); - - // Ignore these. - EXPECT_TRUE(HasSpan(file_)); - EXPECT_TRUE(HasSpan(file_.message_type(0))); - EXPECT_TRUE(HasSpan(file_.message_type(0), "name")); - EXPECT_TRUE(HasSpan(file_.message_type(0).options().uninterpreted_option(0))); - EXPECT_TRUE( - HasSpan(file_.message_type(0).options().uninterpreted_option(0), "name")); - EXPECT_TRUE( - HasSpan(file_.message_type(0).options().uninterpreted_option(0).name(0))); - EXPECT_TRUE( - HasSpan(file_.message_type(0).options().uninterpreted_option(0).name(0), - "name_part")); - EXPECT_TRUE(HasSpan(file_.message_type(0).options().uninterpreted_option(0), - "positive_int_value")); - EXPECT_TRUE(HasSpan(file_.enum_type(0))); - EXPECT_TRUE(HasSpan(file_.enum_type(0), "name")); - EXPECT_TRUE(HasSpan(file_.enum_type(0).options().uninterpreted_option(0))); - EXPECT_TRUE( - HasSpan(file_.enum_type(0).options().uninterpreted_option(0), "name")); - EXPECT_TRUE( - HasSpan(file_.enum_type(0).options().uninterpreted_option(0).name(0))); - EXPECT_TRUE( - HasSpan(file_.enum_type(0).options().uninterpreted_option(0).name(0), - "name_part")); - EXPECT_TRUE(HasSpan(file_.enum_type(0).options().uninterpreted_option(0), - "positive_int_value")); - EXPECT_TRUE(HasSpan(file_.service(0))); - EXPECT_TRUE(HasSpan(file_.service(0), "name")); - EXPECT_TRUE(HasSpan(file_.service(0).method(0))); - EXPECT_TRUE(HasSpan(file_.service(0).options().uninterpreted_option(0))); - EXPECT_TRUE( - HasSpan(file_.service(0).options().uninterpreted_option(0), "name")); - EXPECT_TRUE( - HasSpan(file_.service(0).options().uninterpreted_option(0).name(0))); - EXPECT_TRUE(HasSpan( - file_.service(0).options().uninterpreted_option(0).name(0), "name_part")); - EXPECT_TRUE(HasSpan(file_.service(0).options().uninterpreted_option(0), - "positive_int_value")); - EXPECT_TRUE(HasSpan(file_.service(0).method(0), "name")); - EXPECT_TRUE(HasSpan(file_.service(0).method(0), "input_type")); - EXPECT_TRUE(HasSpan(file_.service(0).method(0), "output_type")); - EXPECT_TRUE( - HasSpan(file_.service(0).method(0).options().uninterpreted_option(0))); - EXPECT_TRUE(HasSpan( - file_.service(0).method(0).options().uninterpreted_option(0), "name")); - EXPECT_TRUE(HasSpan( - file_.service(0).method(0).options().uninterpreted_option(0).name(0))); - EXPECT_TRUE(HasSpan( - file_.service(0).method(0).options().uninterpreted_option(0).name(0), - "name_part")); - EXPECT_TRUE( - HasSpan(file_.service(0).method(0).options().uninterpreted_option(0), - "positive_int_value")); - - EXPECT_TRUE(HasSpan('k', 'l', file_.service(0).method(1).options())); - EXPECT_TRUE(HasSpan(file_.service(0).method(1))); - EXPECT_TRUE(HasSpan(file_.service(0).method(1), "name")); - EXPECT_TRUE(HasSpan(file_.service(0).method(1), "input_type")); - EXPECT_TRUE(HasSpan(file_.service(0).method(1), "output_type")); - EXPECT_TRUE( - HasSpan(file_.service(0).method(1).options().uninterpreted_option(0))); - EXPECT_TRUE(HasSpan( - file_.service(0).method(1).options().uninterpreted_option(0), "name")); - EXPECT_TRUE(HasSpan( - file_.service(0).method(1).options().uninterpreted_option(0).name(0))); - EXPECT_TRUE(HasSpan( - file_.service(0).method(1).options().uninterpreted_option(0).name(0), - "name_part")); - EXPECT_TRUE( - HasSpan(file_.service(0).method(1).options().uninterpreted_option(0), - "positive_int_value")); - EXPECT_TRUE( - HasSpan('1', '2', file_.service(0).method(1), "client_streaming")); - EXPECT_TRUE( - HasSpan('3', '4', file_.service(0).method(1), "server_streaming")); -} - -TEST_F(SourceInfoTest, FieldOptions) { - // The actual "name = value" pairs are parsed by the same code as for - // top-level options so we won't re-test that -- just make sure that the - // syntax used for field options is understood. - EXPECT_TRUE( - Parse("message Foo {" - " optional int32 bar = 1 " - "$a$[default=$b$123$c$,$d$opt1=123$e$," - "$f$opt2='hi'$g$]$h$;" - "}\n")); - - const FieldDescriptorProto& field = file_.message_type(0).field(0); - const UninterpretedOption& option1 = field.options().uninterpreted_option(0); - const UninterpretedOption& option2 = field.options().uninterpreted_option(1); - - EXPECT_TRUE(HasSpan('a', 'h', field.options())); - EXPECT_TRUE(HasSpan('b', 'c', field, "default_value")); - EXPECT_TRUE(HasSpan('d', 'e', option1)); - EXPECT_TRUE(HasSpan('f', 'g', option2)); - - // Ignore these. - EXPECT_TRUE(HasSpan(file_)); - EXPECT_TRUE(HasSpan(file_.message_type(0))); - EXPECT_TRUE(HasSpan(file_.message_type(0), "name")); - EXPECT_TRUE(HasSpan(field)); - EXPECT_TRUE(HasSpan(field, "label")); - EXPECT_TRUE(HasSpan(field, "type")); - EXPECT_TRUE(HasSpan(field, "name")); - EXPECT_TRUE(HasSpan(field, "number")); - EXPECT_TRUE(HasSpan(option1, "name")); - EXPECT_TRUE(HasSpan(option2, "name")); - EXPECT_TRUE(HasSpan(option1.name(0))); - EXPECT_TRUE(HasSpan(option2.name(0))); - EXPECT_TRUE(HasSpan(option1.name(0), "name_part")); - EXPECT_TRUE(HasSpan(option2.name(0), "name_part")); - EXPECT_TRUE(HasSpan(option1, "positive_int_value")); - EXPECT_TRUE(HasSpan(option2, "string_value")); -} - -TEST_F(SourceInfoTest, EnumValueOptions) { - // The actual "name = value" pairs are parsed by the same code as for - // top-level options so we won't re-test that -- just make sure that the - // syntax used for enum options is understood. - EXPECT_TRUE( - Parse("enum Foo {" - " BAR = 1 $a$[$b$opt1=123$c$,$d$opt2='hi'$e$]$f$;" - "}\n")); - - const EnumValueDescriptorProto& value = file_.enum_type(0).value(0); - const UninterpretedOption& option1 = value.options().uninterpreted_option(0); - const UninterpretedOption& option2 = value.options().uninterpreted_option(1); - - EXPECT_TRUE(HasSpan('a', 'f', value.options())); - EXPECT_TRUE(HasSpan('b', 'c', option1)); - EXPECT_TRUE(HasSpan('d', 'e', option2)); - - // Ignore these. - EXPECT_TRUE(HasSpan(file_)); - EXPECT_TRUE(HasSpan(file_.enum_type(0))); - EXPECT_TRUE(HasSpan(file_.enum_type(0), "name")); - EXPECT_TRUE(HasSpan(value)); - EXPECT_TRUE(HasSpan(value, "name")); - EXPECT_TRUE(HasSpan(value, "number")); - EXPECT_TRUE(HasSpan(option1, "name")); - EXPECT_TRUE(HasSpan(option2, "name")); - EXPECT_TRUE(HasSpan(option1.name(0))); - EXPECT_TRUE(HasSpan(option2.name(0))); - EXPECT_TRUE(HasSpan(option1.name(0), "name_part")); - EXPECT_TRUE(HasSpan(option2.name(0), "name_part")); - EXPECT_TRUE(HasSpan(option1, "positive_int_value")); - EXPECT_TRUE(HasSpan(option2, "string_value")); -} - -TEST_F(SourceInfoTest, DocComments) { - EXPECT_TRUE( - Parse("// Foo leading\n" - "// line 2\n" - "$a$message Foo {\n" - " // Foo trailing\n" - " // line 2\n" - "\n" - " // detached\n" - "\n" - " // bar leading\n" - " $b$optional int32 bar = 1;$c$\n" - " // bar trailing\n" - "}$d$\n" - "// ignored\n")); - - const DescriptorProto& foo = file_.message_type(0); - const FieldDescriptorProto& bar = foo.field(0); - - EXPECT_TRUE(HasSpanWithComment('a', 'd', foo, " Foo leading\n line 2\n", - " Foo trailing\n line 2\n", NULL)); - EXPECT_TRUE(HasSpanWithComment('b', 'c', bar, " bar leading\n", - " bar trailing\n", " detached\n")); - - // Ignore these. - EXPECT_TRUE(HasSpan(file_)); - EXPECT_TRUE(HasSpan(foo, "name")); - EXPECT_TRUE(HasSpan(bar, "label")); - EXPECT_TRUE(HasSpan(bar, "type")); - EXPECT_TRUE(HasSpan(bar, "name")); - EXPECT_TRUE(HasSpan(bar, "number")); -} - -TEST_F(SourceInfoTest, DocComments2) { - EXPECT_TRUE( - Parse("// detached before message.\n" - "\n" - "// Foo leading\n" - "// line 2\n" - "$a$message Foo {\n" - " /* Foo trailing\n" - " * line 2 */\n" - " // detached\n" - " /* bar leading\n" - " */" - " $b$optional int32 bar = 1;$c$ // bar trailing\n" - " // ignored detached\n" - "}$d$\n" - "// ignored\n" - "\n" - "// detached before option\n" - "\n" - "// option leading\n" - "$e$option baz = 123;$f$\n" - "// option trailing\n")); - - const DescriptorProto& foo = file_.message_type(0); - const FieldDescriptorProto& bar = foo.field(0); - const UninterpretedOption& baz = file_.options().uninterpreted_option(0); - - EXPECT_TRUE(HasSpanWithComment('a', 'd', foo, " Foo leading\n line 2\n", - " Foo trailing\n line 2 ", - " detached before message.\n")); - EXPECT_TRUE(HasSpanWithComment('b', 'c', bar, " bar leading\n", - " bar trailing\n", " detached\n")); - EXPECT_TRUE(HasSpanWithComment('e', 'f', baz, " option leading\n", - " option trailing\n", - " detached before option\n")); - - // Ignore these. - EXPECT_TRUE(HasSpan(file_)); - EXPECT_TRUE(HasSpan(foo, "name")); - EXPECT_TRUE(HasSpan(bar, "label")); - EXPECT_TRUE(HasSpan(bar, "type")); - EXPECT_TRUE(HasSpan(bar, "name")); - EXPECT_TRUE(HasSpan(bar, "number")); - EXPECT_TRUE(HasSpan(file_.options())); - EXPECT_TRUE(HasSpan(baz, "name")); - EXPECT_TRUE(HasSpan(baz.name(0))); - EXPECT_TRUE(HasSpan(baz.name(0), "name_part")); - EXPECT_TRUE(HasSpan(baz, "positive_int_value")); -} - -TEST_F(SourceInfoTest, DocComments3) { - EXPECT_TRUE( - Parse("$a$message Foo {\n" - " // bar leading\n" - " $b$optional int32 bar = 1 [(baz.qux) = {}];$c$\n" - " // bar trailing\n" - "}$d$\n" - "// ignored\n")); - - const DescriptorProto& foo = file_.message_type(0); - const FieldDescriptorProto& bar = foo.field(0); - - EXPECT_TRUE(HasSpanWithComment('b', 'c', bar, " bar leading\n", - " bar trailing\n", NULL)); - - // Ignore these. - EXPECT_TRUE(HasSpan(file_)); - EXPECT_TRUE(HasSpan(foo)); - EXPECT_TRUE(HasSpan(foo, "name")); - EXPECT_TRUE(HasSpan(bar, "label")); - EXPECT_TRUE(HasSpan(bar, "type")); - EXPECT_TRUE(HasSpan(bar, "name")); - EXPECT_TRUE(HasSpan(bar, "number")); - EXPECT_TRUE(HasSpan(bar.options())); - EXPECT_TRUE(HasSpan(bar.options().uninterpreted_option(0))); - EXPECT_TRUE(HasSpan(bar.options().uninterpreted_option(0), "name")); - EXPECT_TRUE(HasSpan(bar.options().uninterpreted_option(0).name(0))); - EXPECT_TRUE( - HasSpan(bar.options().uninterpreted_option(0).name(0), "name_part")); - EXPECT_TRUE( - HasSpan(bar.options().uninterpreted_option(0), "aggregate_value")); -} - -TEST_F(SourceInfoTest, DocCommentsTopLevel) { - EXPECT_TRUE( - Parse("// detached before syntax paragraph 1\n" - "\n" - "// detached before syntax paragraph 2\n" - "\n" - "// syntax leading\n" - "$a$syntax = \"proto2\";$b$\n" - "// syntax trailing\n" - "\n" - "// syntax-package detached comments\n" - "\n" - ";\n" - "\n" - "// detached after empty before package\n" - "\n" - "// package leading\n" - "$c$package foo;$d$\n" - "// package trailing\n" - "\n" - "// ignored detach\n" - "\n")); - - EXPECT_TRUE(HasSpan('a', 'b', file_, "syntax", -1, " syntax leading\n", - " syntax trailing\n", - " detached before syntax paragraph 1\n" - "\n" - " detached before syntax paragraph 2\n")); - EXPECT_TRUE(HasSpan('c', 'd', file_, "package", -1, " package leading\n", - " package trailing\n", - " syntax-package detached comments\n" - "\n" - " detached after empty before package\n")); - - // ignore these. - EXPECT_TRUE(HasSpan(file_)); -} - -TEST_F(SourceInfoTest, DocCommentsOneof) { - EXPECT_TRUE( - Parse("// Foo leading\n" - "$a$message Foo {\n" - " /* Foo trailing\n" - " */\n" - " // detached before oneof\n" - " /* bar leading\n" - " * line 2 */\n" - " $b$oneof bar {\n" - " /* bar trailing\n" - " * line 2 */\n" - " // detached before bar_int\n" - " /* bar_int leading\n" - " */\n" - " $c$int32 bar_int = 1;$d$ // bar_int trailing\n" - " // detach comment ignored\n" - " }$e$\n" - "}$f$\n")); - - const DescriptorProto& foo = file_.message_type(0); - const OneofDescriptorProto& bar = foo.oneof_decl(0); - const FieldDescriptorProto& bar_int = foo.field(0); - - EXPECT_TRUE(HasSpanWithComment('a', 'f', foo, " Foo leading\n", - " Foo trailing\n", NULL)); - EXPECT_TRUE(HasSpanWithComment('b', 'e', bar, " bar leading\n line 2 ", - " bar trailing\n line 2 ", - " detached before oneof\n")); - EXPECT_TRUE(HasSpanWithComment('c', 'd', bar_int, " bar_int leading\n", - " bar_int trailing\n", - " detached before bar_int\n")); - - // Ignore these. - EXPECT_TRUE(HasSpan(file_)); - EXPECT_TRUE(HasSpan(foo, "name")); - EXPECT_TRUE(HasSpan(bar, "name")); - EXPECT_TRUE(HasSpan(bar_int, "type")); - EXPECT_TRUE(HasSpan(bar_int, "name")); - EXPECT_TRUE(HasSpan(bar_int, "number")); -} - -// =================================================================== - -} // anonymous namespace - -} // namespace compiler -} // namespace protobuf -} // namespace google diff --git a/extra/protobuf/protobuf-3.19.4/src/google/protobuf/compiler/php/php_generator.cc b/extra/protobuf/protobuf-3.19.4/src/google/protobuf/compiler/php/php_generator.cc deleted file mode 100644 index 05f8acad8753..000000000000 --- a/extra/protobuf/protobuf-3.19.4/src/google/protobuf/compiler/php/php_generator.cc +++ /dev/null @@ -1,2325 +0,0 @@ -// Protocol Buffers - Google's data interchange format -// Copyright 2008 Google Inc. All rights reserved. -// https://developers.google.com/protocol-buffers/ -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// * Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// * Redistributions in binary form must reproduce the above -// copyright notice, this list of conditions and the following disclaimer -// in the documentation and/or other materials provided with the -// distribution. -// * Neither the name of Google Inc. nor the names of its -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -#include - -#include -#include -#include -#include -#include -#include -#include - -#include - -const std::string kDescriptorFile = "google/protobuf/descriptor.proto"; -const std::string kEmptyFile = "google/protobuf/empty.proto"; -const std::string kEmptyMetadataFile = "GPBMetadata/Google/Protobuf/GPBEmpty.php"; -const std::string kDescriptorMetadataFile = - "GPBMetadata/Google/Protobuf/Internal/Descriptor.php"; -const std::string kDescriptorDirName = "Google/Protobuf/Internal"; -const std::string kDescriptorPackageName = "Google\\Protobuf\\Internal"; -const char* const kReservedNames[] = { - "abstract", "and", "array", "as", "break", - "callable", "case", "catch", "class", "clone", - "const", "continue", "declare", "default", "die", - "do", "echo", "else", "elseif", "empty", - "enddeclare", "endfor", "endforeach", "endif", "endswitch", - "endwhile", "eval", "exit", "extends", "final", - "finally", "fn", "for", "foreach", "function", - "global", "goto", "if", "implements", "include", - "include_once", "instanceof", "insteadof", "interface", "isset", - "list", "match", "namespace", "new", "or", - "print", "private", "protected", "public", "require", - "require_once", "return", "static", "switch", "throw", - "trait", "try", "unset", "use", "var", - "while", "xor", "yield", "int", "float", - "bool", "string", "true", "false", "null", - "void", "iterable"}; -const char* const kValidConstantNames[] = { - "int", "float", "bool", "string", "true", - "false", "null", "void", "iterable", -}; -const int kReservedNamesSize = 77; -const int kValidConstantNamesSize = 9; -const int kFieldSetter = 1; -const int kFieldGetter = 2; -const int kFieldProperty = 3; - -namespace google { -namespace protobuf { -namespace compiler { -namespace php { - -struct Options { - bool is_descriptor = false; - bool aggregate_metadata = false; - bool gen_c_wkt = false; - std::set aggregate_metadata_prefixes; -}; - -namespace { - -// Forward decls. -std::string PhpName(const std::string& full_name, const Options& options); -std::string IntToString(int32 value); -std::string FilenameToClassname(const std::string& filename); -std::string GeneratedMetadataFileName(const FileDescriptor* file, - const Options& options); -std::string UnderscoresToCamelCase(const std::string& name, - bool cap_first_letter); -void Indent(io::Printer* printer); -void Outdent(io::Printer* printer); -void GenerateAddFilesToPool(const FileDescriptor* file, const Options& options, - io::Printer* printer); -void GenerateMessageDocComment(io::Printer* printer, const Descriptor* message, - const Options& options); -void GenerateMessageConstructorDocComment(io::Printer* printer, - const Descriptor* message, - const Options& options); -void GenerateFieldDocComment(io::Printer* printer, const FieldDescriptor* field, - const Options& options, int function_type); -void GenerateWrapperFieldGetterDocComment(io::Printer* printer, - const FieldDescriptor* field); -void GenerateWrapperFieldSetterDocComment(io::Printer* printer, - const FieldDescriptor* field); -void GenerateEnumDocComment(io::Printer* printer, const EnumDescriptor* enum_, - const Options& options); -void GenerateEnumValueDocComment(io::Printer* printer, - const EnumValueDescriptor* value); -void GenerateServiceDocComment(io::Printer* printer, - const ServiceDescriptor* service); -void GenerateServiceMethodDocComment(io::Printer* printer, - const MethodDescriptor* method); - -std::string ReservedNamePrefix(const std::string& classname, - const FileDescriptor* file) { - bool is_reserved = false; - - std::string lower = classname; - std::transform(lower.begin(), lower.end(), lower.begin(), ::tolower); - - for (int i = 0; i < kReservedNamesSize; i++) { - if (lower == kReservedNames[i]) { - is_reserved = true; - break; - } - } - - if (is_reserved) { - if (file->package() == "google.protobuf") { - return "GPB"; - } else { - return "PB"; - } - } - - return ""; -} - -template -std::string DescriptorFullName(const DescriptorType* desc, bool is_internal) { - if (is_internal) { - return StringReplace(desc->full_name(), - "google.protobuf", - "google.protobuf.internal", false); - } else { - return desc->full_name(); - } -} - -template -std::string ClassNamePrefix(const std::string& classname, - const DescriptorType* desc) { - const std::string& prefix = (desc->file()->options()).php_class_prefix(); - if (!prefix.empty()) { - return prefix; - } - - return ReservedNamePrefix(classname, desc->file()); -} - -template -std::string GeneratedClassNameImpl(const DescriptorType* desc) { - std::string classname = ClassNamePrefix(desc->name(), desc) + desc->name(); - const Descriptor* containing = desc->containing_type(); - while (containing != NULL) { - classname = ClassNamePrefix(containing->name(), desc) + containing->name() - + '\\' + classname; - containing = containing->containing_type(); - } - return classname; -} - -std::string GeneratedClassNameImpl(const ServiceDescriptor* desc) { - std::string classname = desc->name(); - return ClassNamePrefix(classname, desc) + classname; -} - -template -std::string LegacyGeneratedClassName(const DescriptorType* desc) { - std::string classname = desc->name(); - const Descriptor* containing = desc->containing_type(); - while (containing != NULL) { - classname = containing->name() + '_' + classname; - containing = containing->containing_type(); - } - return ClassNamePrefix(classname, desc) + classname; -} - -std::string ClassNamePrefix(const std::string& classname) { - std::string lower = classname; - std::transform(lower.begin(), lower.end(), lower.begin(), ::tolower); - - for (int i = 0; i < kReservedNamesSize; i++) { - if (lower == kReservedNames[i]) { - return "PB"; - } - } - - return ""; -} - -std::string ConstantNamePrefix(const std::string& classname) { - bool is_reserved = false; - - std::string lower = classname; - std::transform(lower.begin(), lower.end(), lower.begin(), ::tolower); - - for (int i = 0; i < kReservedNamesSize; i++) { - if (lower == kReservedNames[i]) { - is_reserved = true; - break; - } - } - - for (int i = 0; i < kValidConstantNamesSize; i++) { - if (lower == kValidConstantNames[i]) { - is_reserved = false; - break; - } - } - - if (is_reserved) { - return "PB"; - } - - return ""; -} - -template -std::string RootPhpNamespace(const DescriptorType* desc, - const Options& options) { - if (desc->file()->options().has_php_namespace()) { - const std::string& php_namespace = desc->file()->options().php_namespace(); - if (!php_namespace.empty()) { - return php_namespace; - } - return ""; - } - - if (!desc->file()->package().empty()) { - return PhpName(desc->file()->package(), options); - } - return ""; -} - -template -std::string FullClassName(const DescriptorType* desc, const Options& options) { - std::string classname = GeneratedClassNameImpl(desc); - std::string php_namespace = RootPhpNamespace(desc, options); - if (!php_namespace.empty()) { - return php_namespace + "\\" + classname; - } - return classname; -} - -template -std::string FullClassName(const DescriptorType* desc, bool is_descriptor) { - Options options; - options.is_descriptor = is_descriptor; - return FullClassName(desc, options); -} - -template -std::string LegacyFullClassName(const DescriptorType* desc, - const Options& options) { - std::string classname = LegacyGeneratedClassName(desc); - std::string php_namespace = RootPhpNamespace(desc, options); - if (!php_namespace.empty()) { - return php_namespace + "\\" + classname; - } - return classname; -} - -std::string PhpName(const std::string& full_name, const Options& options) { - if (options.is_descriptor) { - return kDescriptorPackageName; - } - - std::string segment; - std::string result; - bool cap_next_letter = true; - for (int i = 0; i < full_name.size(); i++) { - if ('a' <= full_name[i] && full_name[i] <= 'z' && cap_next_letter) { - segment += full_name[i] + ('A' - 'a'); - cap_next_letter = false; - } else if (full_name[i] == '.') { - result += ClassNamePrefix(segment) + segment + '\\'; - segment = ""; - cap_next_letter = true; - } else { - segment += full_name[i]; - cap_next_letter = false; - } - } - result += ClassNamePrefix(segment) + segment; - return result; -} - -std::string DefaultForField(const FieldDescriptor* field) { - switch (field->type()) { - case FieldDescriptor::TYPE_INT32: - case FieldDescriptor::TYPE_INT64: - case FieldDescriptor::TYPE_UINT32: - case FieldDescriptor::TYPE_UINT64: - case FieldDescriptor::TYPE_SINT32: - case FieldDescriptor::TYPE_SINT64: - case FieldDescriptor::TYPE_FIXED32: - case FieldDescriptor::TYPE_FIXED64: - case FieldDescriptor::TYPE_SFIXED32: - case FieldDescriptor::TYPE_SFIXED64: - case FieldDescriptor::TYPE_ENUM: return "0"; - case FieldDescriptor::TYPE_DOUBLE: - case FieldDescriptor::TYPE_FLOAT: return "0.0"; - case FieldDescriptor::TYPE_BOOL: return "false"; - case FieldDescriptor::TYPE_STRING: - case FieldDescriptor::TYPE_BYTES: return "''"; - case FieldDescriptor::TYPE_MESSAGE: - case FieldDescriptor::TYPE_GROUP: return "null"; - default: assert(false); return ""; - } -} - -std::string GeneratedMetadataFileName(const FileDescriptor* file, - const Options& options) { - const std::string& proto_file = file->name(); - int start_index = 0; - int first_index = proto_file.find_first_of("/", start_index); - std::string result = ""; - std::string segment = ""; - - if (proto_file == kEmptyFile) { - return kEmptyMetadataFile; - } - if (options.is_descriptor) { - return kDescriptorMetadataFile; - } - - // Append directory name. - std::string file_no_suffix; - int lastindex = proto_file.find_last_of("."); - if (proto_file == kEmptyFile) { - return kEmptyMetadataFile; - } else { - file_no_suffix = proto_file.substr(0, lastindex); - } - - if (file->options().has_php_metadata_namespace()) { - const std::string& php_metadata_namespace = - file->options().php_metadata_namespace(); - if (!php_metadata_namespace.empty() && php_metadata_namespace != "\\") { - result += php_metadata_namespace; - std::replace(result.begin(), result.end(), '\\', '/'); - if (result.at(result.size() - 1) != '/') { - result += "/"; - } - } - } else { - result += "GPBMetadata/"; - while (first_index != std::string::npos) { - segment = UnderscoresToCamelCase( - file_no_suffix.substr(start_index, first_index - start_index), true); - result += ReservedNamePrefix(segment, file) + segment + "/"; - start_index = first_index + 1; - first_index = file_no_suffix.find_first_of("/", start_index); - } - } - - // Append file name. - int file_name_start = file_no_suffix.find_last_of("/"); - if (file_name_start == std::string::npos) { - file_name_start = 0; - } else { - file_name_start += 1; - } - segment = UnderscoresToCamelCase( - file_no_suffix.substr(file_name_start, first_index - file_name_start), true); - - return result + ReservedNamePrefix(segment, file) + segment + ".php"; -} - -std::string GeneratedMetadataFileName(const FileDescriptor* file, - bool is_descriptor) { - Options options; - options.is_descriptor = is_descriptor; - return GeneratedMetadataFileName(file, options); -} - -template -std::string GeneratedClassFileName(const DescriptorType* desc, - const Options& options) { - std::string result = FullClassName(desc, options); - for (int i = 0; i < result.size(); i++) { - if (result[i] == '\\') { - result[i] = '/'; - } - } - return result + ".php"; -} - -template -std::string LegacyGeneratedClassFileName(const DescriptorType* desc, - const Options& options) { - std::string result = LegacyFullClassName(desc, options); - - for (int i = 0; i < result.size(); i++) { - if (result[i] == '\\') { - result[i] = '/'; - } - } - return result + ".php"; -} - -std::string GeneratedServiceFileName(const ServiceDescriptor* service, - const Options& options) { - std::string result = FullClassName(service, options) + "Interface"; - for (int i = 0; i < result.size(); i++) { - if (result[i] == '\\') { - result[i] = '/'; - } - } - return result + ".php"; -} - -std::string IntToString(int32 value) { - std::ostringstream os; - os << value; - return os.str(); -} - -std::string LabelForField(const FieldDescriptor* field) { - switch (field->label()) { - case FieldDescriptor::LABEL_OPTIONAL: return "optional"; - case FieldDescriptor::LABEL_REQUIRED: return "required"; - case FieldDescriptor::LABEL_REPEATED: return "repeated"; - default: assert(false); return ""; - } -} - -std::string PhpSetterTypeName(const FieldDescriptor* field, - const Options& options) { - if (field->is_map()) { - return "array|\\Google\\Protobuf\\Internal\\MapField"; - } - std::string type; - switch (field->type()) { - case FieldDescriptor::TYPE_INT32: - case FieldDescriptor::TYPE_UINT32: - case FieldDescriptor::TYPE_SINT32: - case FieldDescriptor::TYPE_FIXED32: - case FieldDescriptor::TYPE_SFIXED32: - case FieldDescriptor::TYPE_ENUM: - type = "int"; - break; - case FieldDescriptor::TYPE_INT64: - case FieldDescriptor::TYPE_UINT64: - case FieldDescriptor::TYPE_SINT64: - case FieldDescriptor::TYPE_FIXED64: - case FieldDescriptor::TYPE_SFIXED64: - type = "int|string"; - break; - case FieldDescriptor::TYPE_DOUBLE: - case FieldDescriptor::TYPE_FLOAT: - type = "float"; - break; - case FieldDescriptor::TYPE_BOOL: - type = "bool"; - break; - case FieldDescriptor::TYPE_STRING: - case FieldDescriptor::TYPE_BYTES: - type = "string"; - break; - case FieldDescriptor::TYPE_MESSAGE: - type = "\\" + FullClassName(field->message_type(), options); - break; - case FieldDescriptor::TYPE_GROUP: - return "null"; - default: assert(false); return ""; - } - if (field->is_repeated()) { - // accommodate for edge case with multiple types. - size_t start_pos = type.find("|"); - if (start_pos != std::string::npos) { - type.replace(start_pos, 1, "[]|"); - } - type += "[]|\\Google\\Protobuf\\Internal\\RepeatedField"; - } - return type; -} - -std::string PhpSetterTypeName(const FieldDescriptor* field, - bool is_descriptor) { - Options options; - options.is_descriptor = is_descriptor; - return PhpSetterTypeName(field, options); -} - -std::string PhpGetterTypeName(const FieldDescriptor* field, - const Options& options) { - if (field->is_map()) { - return "\\Google\\Protobuf\\Internal\\MapField"; - } - if (field->is_repeated()) { - return "\\Google\\Protobuf\\Internal\\RepeatedField"; - } - switch (field->type()) { - case FieldDescriptor::TYPE_INT32: - case FieldDescriptor::TYPE_UINT32: - case FieldDescriptor::TYPE_SINT32: - case FieldDescriptor::TYPE_FIXED32: - case FieldDescriptor::TYPE_SFIXED32: - case FieldDescriptor::TYPE_ENUM: return "int"; - case FieldDescriptor::TYPE_INT64: - case FieldDescriptor::TYPE_UINT64: - case FieldDescriptor::TYPE_SINT64: - case FieldDescriptor::TYPE_FIXED64: - case FieldDescriptor::TYPE_SFIXED64: return "int|string"; - case FieldDescriptor::TYPE_DOUBLE: - case FieldDescriptor::TYPE_FLOAT: return "float"; - case FieldDescriptor::TYPE_BOOL: return "bool"; - case FieldDescriptor::TYPE_STRING: - case FieldDescriptor::TYPE_BYTES: return "string"; - case FieldDescriptor::TYPE_MESSAGE: - return "\\" + FullClassName(field->message_type(), options); - case FieldDescriptor::TYPE_GROUP: return "null"; - default: assert(false); return ""; - } -} - -std::string PhpGetterTypeName(const FieldDescriptor* field, - bool is_descriptor) { - Options options; - options.is_descriptor = is_descriptor; - return PhpGetterTypeName(field, options); -} - -std::string EnumOrMessageSuffix(const FieldDescriptor* field, - const Options& options) { - if (field->cpp_type() == FieldDescriptor::CPPTYPE_MESSAGE) { - return ", '" + - DescriptorFullName(field->message_type(), options.is_descriptor) + - "'"; - } - if (field->cpp_type() == FieldDescriptor::CPPTYPE_ENUM) { - return ", '" + - DescriptorFullName(field->enum_type(), options.is_descriptor) + "'"; - } - return ""; -} - -std::string EnumOrMessageSuffix(const FieldDescriptor* field, - bool is_descriptor) { - Options options; - options.is_descriptor = is_descriptor; - return EnumOrMessageSuffix(field, options); -} - -// Converts a name to camel-case. If cap_first_letter is true, capitalize the -// first letter. -std::string UnderscoresToCamelCase(const std::string& name, - bool cap_first_letter) { - std::string result; - for (int i = 0; i < name.size(); i++) { - if ('a' <= name[i] && name[i] <= 'z') { - if (cap_first_letter) { - result += name[i] + ('A' - 'a'); - } else { - result += name[i]; - } - cap_first_letter = false; - } else if ('A' <= name[i] && name[i] <= 'Z') { - if (i == 0 && !cap_first_letter) { - // Force first letter to lower-case unless explicitly told to - // capitalize it. - result += name[i] + ('a' - 'A'); - } else { - // Capital letters after the first are left as-is. - result += name[i]; - } - cap_first_letter = false; - } else if ('0' <= name[i] && name[i] <= '9') { - result += name[i]; - cap_first_letter = true; - } else { - cap_first_letter = true; - } - } - // Add a trailing "_" if the name should be altered. - if (name[name.size() - 1] == '#') { - result += '_'; - } - return result; -} - -void Indent(io::Printer* printer) { - printer->Indent(); - printer->Indent(); -} -void Outdent(io::Printer* printer) { - printer->Outdent(); - printer->Outdent(); -} - -void GenerateField(const FieldDescriptor* field, io::Printer* printer, - const Options& options) { - if (field->is_repeated()) { - GenerateFieldDocComment(printer, field, options, kFieldProperty); - printer->Print( - "private $^name^;\n", - "name", field->name()); - } else if (field->real_containing_oneof()) { - // Oneof fields are handled by GenerateOneofField. - return; - } else { - std::string initial_value = - field->has_presence() ? "null" : DefaultForField(field); - GenerateFieldDocComment(printer, field, options, kFieldProperty); - printer->Print( - "protected $^name^ = ^initial_value^;\n", - "name", field->name(), - "initial_value", initial_value); - } -} - -void GenerateOneofField(const OneofDescriptor* oneof, io::Printer* printer) { - // Oneof property needs to be protected in order to be accessed by parent - // class in implementation. - printer->Print( - "protected $^name^;\n", - "name", oneof->name()); -} - -void GenerateFieldAccessor(const FieldDescriptor* field, const Options& options, - io::Printer* printer) { - const OneofDescriptor* oneof = field->real_containing_oneof(); - - // Generate getter. - GenerateFieldDocComment(printer, field, options, kFieldGetter); - - // deprecation - std::string deprecation_trigger = (field->options().deprecated()) ? "@trigger_error('" + - field->name() + " is deprecated.', E_USER_DEPRECATED);\n " : ""; - - // Emit getter. - if (oneof != NULL) { - printer->Print( - "public function get^camel_name^()\n" - "{\n" - " ^deprecation_trigger^return $this->readOneof(^number^);\n" - "}\n\n", - "camel_name", UnderscoresToCamelCase(field->name(), true), - "number", IntToString(field->number()), - "deprecation_trigger", deprecation_trigger); - } else if (field->has_presence() && !field->message_type()) { - printer->Print( - "public function get^camel_name^()\n" - "{\n" - " ^deprecation_trigger^return isset($this->^name^) ? $this->^name^ : ^default_value^;\n" - "}\n\n", - "camel_name", UnderscoresToCamelCase(field->name(), true), - "name", field->name(), - "default_value", DefaultForField(field), - "deprecation_trigger", deprecation_trigger); - } else { - printer->Print( - "public function get^camel_name^()\n" - "{\n" - " ^deprecation_trigger^return $this->^name^;\n" - "}\n\n", - "camel_name", UnderscoresToCamelCase(field->name(), true), - "name", field->name(), - "deprecation_trigger", deprecation_trigger); - } - - // Emit hazzers/clear. - if (oneof) { - printer->Print( - "public function has^camel_name^()\n" - "{\n" - " ^deprecation_trigger^return $this->hasOneof(^number^);\n" - "}\n\n", - "camel_name", UnderscoresToCamelCase(field->name(), true), - "number", IntToString(field->number()), - "deprecation_trigger", deprecation_trigger); - } else if (field->has_presence()) { - printer->Print( - "public function has^camel_name^()\n" - "{\n" - " ^deprecation_trigger^return isset($this->^name^);\n" - "}\n\n" - "public function clear^camel_name^()\n" - "{\n" - " ^deprecation_trigger^unset($this->^name^);\n" - "}\n\n", - "camel_name", UnderscoresToCamelCase(field->name(), true), - "name", field->name(), - "default_value", DefaultForField(field), - "deprecation_trigger", deprecation_trigger); - } - - // For wrapper types, generate an additional getXXXUnwrapped getter - if (!field->is_map() && - !field->is_repeated() && - field->cpp_type() == FieldDescriptor::CPPTYPE_MESSAGE && - IsWrapperType(field)) { - GenerateWrapperFieldGetterDocComment(printer, field); - printer->Print( - "public function get^camel_name^Unwrapped()\n" - "{\n" - " ^deprecation_trigger^return $this->readWrapperValue(\"^field_name^\");\n" - "}\n\n", - "camel_name", UnderscoresToCamelCase(field->name(), true), - "field_name", field->name(), - "deprecation_trigger", deprecation_trigger); - } - - // Generate setter. - GenerateFieldDocComment(printer, field, options, kFieldSetter); - printer->Print( - "public function set^camel_name^($var)\n" - "{\n", - "camel_name", UnderscoresToCamelCase(field->name(), true)); - - Indent(printer); - - if (field->options().deprecated()) { - printer->Print( - "^deprecation_trigger^", - "deprecation_trigger", deprecation_trigger - ); - } - - // Type check. - if (field->is_map()) { - const Descriptor* map_entry = field->message_type(); - const FieldDescriptor* key = map_entry->FindFieldByName("key"); - const FieldDescriptor* value = map_entry->FindFieldByName("value"); - printer->Print( - "$arr = GPBUtil::checkMapField($var, " - "\\Google\\Protobuf\\Internal\\GPBType::^key_type^, " - "\\Google\\Protobuf\\Internal\\GPBType::^value_type^", - "key_type", ToUpper(key->type_name()), - "value_type", ToUpper(value->type_name())); - if (value->cpp_type() == FieldDescriptor::CPPTYPE_MESSAGE) { - printer->Print( - ", \\^class_name^);\n", - "class_name", - FullClassName(value->message_type(), options) + "::class"); - } else if (value->cpp_type() == FieldDescriptor::CPPTYPE_ENUM) { - printer->Print( - ", \\^class_name^);\n", - "class_name", - FullClassName(value->enum_type(), options) + "::class"); - } else { - printer->Print(");\n"); - } - } else if (field->is_repeated()) { - printer->Print( - "$arr = GPBUtil::checkRepeatedField($var, " - "\\Google\\Protobuf\\Internal\\GPBType::^type^", - "type", ToUpper(field->type_name())); - if (field->cpp_type() == FieldDescriptor::CPPTYPE_MESSAGE) { - printer->Print( - ", \\^class_name^);\n", - "class_name", - FullClassName(field->message_type(), options) + "::class"); - } else if (field->cpp_type() == FieldDescriptor::CPPTYPE_ENUM) { - printer->Print( - ", \\^class_name^);\n", - "class_name", - FullClassName(field->enum_type(), options) + "::class"); - } else { - printer->Print(");\n"); - } - } else if (field->cpp_type() == FieldDescriptor::CPPTYPE_MESSAGE) { - printer->Print( - "GPBUtil::checkMessage($var, \\^class_name^::class);\n", - "class_name", FullClassName(field->message_type(), options)); - } else if (field->cpp_type() == FieldDescriptor::CPPTYPE_ENUM) { - printer->Print( - "GPBUtil::checkEnum($var, \\^class_name^::class);\n", - "class_name", FullClassName(field->enum_type(), options)); - } else if (field->cpp_type() == FieldDescriptor::CPPTYPE_STRING) { - printer->Print( - "GPBUtil::checkString($var, ^utf8^);\n", - "utf8", - field->type() == FieldDescriptor::TYPE_STRING ? "True": "False"); - } else { - printer->Print( - "GPBUtil::check^type^($var);\n", - "type", UnderscoresToCamelCase(field->cpp_type_name(), true)); - } - - if (oneof != NULL) { - printer->Print( - "$this->writeOneof(^number^, $var);\n", - "number", IntToString(field->number())); - } else if (field->is_repeated()) { - printer->Print( - "$this->^name^ = $arr;\n", - "name", field->name()); - } else { - printer->Print( - "$this->^name^ = $var;\n", - "name", field->name()); - } - - printer->Print("\nreturn $this;\n"); - - Outdent(printer); - - printer->Print( - "}\n\n"); - - // For wrapper types, generate an additional setXXXValue getter - if (!field->is_map() && - !field->is_repeated() && - field->cpp_type() == FieldDescriptor::CPPTYPE_MESSAGE && - IsWrapperType(field)) { - GenerateWrapperFieldSetterDocComment(printer, field); - printer->Print( - "public function set^camel_name^Unwrapped($var)\n" - "{\n" - " $this->writeWrapperValue(\"^field_name^\", $var);\n" - " return $this;" - "}\n\n", - "camel_name", UnderscoresToCamelCase(field->name(), true), - "field_name", field->name()); - } -} - -void GenerateEnumToPool(const EnumDescriptor* en, io::Printer* printer) { - printer->Print( - "$pool->addEnum('^name^', " - "\\Google\\Protobuf\\Internal\\^class_name^::class)\n", - "name", DescriptorFullName(en, true), - "class_name", en->name()); - Indent(printer); - - for (int i = 0; i < en->value_count(); i++) { - const EnumValueDescriptor* value = en->value(i); - printer->Print( - "->value(\"^name^\", ^number^)\n", - "name", ConstantNamePrefix(value->name()) + value->name(), - "number", IntToString(value->number())); - } - printer->Print("->finalizeToPool();\n\n"); - Outdent(printer); -} - -void GenerateServiceMethod(const MethodDescriptor* method, - io::Printer* printer) { - printer->Print( - "public function ^camel_name^(\\^request_name^ $request);\n\n", - "camel_name", UnderscoresToCamelCase(method->name(), false), - "request_name", FullClassName( - method->input_type(), false) - ); -} - -void GenerateMessageToPool(const std::string& name_prefix, - const Descriptor* message, io::Printer* printer) { - // Don't generate MapEntry messages -- we use the PHP extension's native - // support for map fields instead. - if (message->options().map_entry()) { - return; - } - std::string class_name = - (name_prefix.empty() ? "" : name_prefix + "\\") + - ReservedNamePrefix(message->name(), message->file()) + message->name(); - - printer->Print( - "$pool->addMessage('^message^', " - "\\Google\\Protobuf\\Internal\\^class_name^::class)\n", - "message", DescriptorFullName(message, true), - "class_name", class_name); - - Indent(printer); - - for (int i = 0; i < message->field_count(); i++) { - const FieldDescriptor* field = message->field(i); - if (field->is_map()) { - const FieldDescriptor* key = - field->message_type()->FindFieldByName("key"); - const FieldDescriptor* val = - field->message_type()->FindFieldByName("value"); - printer->Print( - "->map('^field^', \\Google\\Protobuf\\Internal\\GPBType::^key^, " - "\\Google\\Protobuf\\Internal\\GPBType::^value^, ^number^^other^)\n", - "field", field->name(), - "key", ToUpper(key->type_name()), - "value", ToUpper(val->type_name()), - "number", StrCat(field->number()), - "other", EnumOrMessageSuffix(val, true)); - } else if (!field->real_containing_oneof()) { - printer->Print( - "->^label^('^field^', " - "\\Google\\Protobuf\\Internal\\GPBType::^type^, ^number^^other^)\n", - "field", field->name(), - "label", LabelForField(field), - "type", ToUpper(field->type_name()), - "number", StrCat(field->number()), - "other", EnumOrMessageSuffix(field, true)); - } - } - - // oneofs. - for (int i = 0; i < message->real_oneof_decl_count(); i++) { - const OneofDescriptor* oneof = message->oneof_decl(i); - printer->Print("->oneof(^name^)\n", - "name", oneof->name()); - Indent(printer); - for (int index = 0; index < oneof->field_count(); index++) { - const FieldDescriptor* field = oneof->field(index); - printer->Print( - "->value('^field^', " - "\\Google\\Protobuf\\Internal\\GPBType::^type^, ^number^^other^)\n", - "field", field->name(), - "type", ToUpper(field->type_name()), - "number", StrCat(field->number()), - "other", EnumOrMessageSuffix(field, true)); - } - printer->Print("->finish()\n"); - Outdent(printer); - } - - printer->Print( - "->finalizeToPool();\n"); - - Outdent(printer); - - printer->Print( - "\n"); - - for (int i = 0; i < message->nested_type_count(); i++) { - GenerateMessageToPool(class_name, message->nested_type(i), printer); - } - for (int i = 0; i < message->enum_type_count(); i++) { - GenerateEnumToPool(message->enum_type(i), printer); - } -} - -void GenerateAddFileToPool(const FileDescriptor* file, const Options& options, - io::Printer* printer) { - printer->Print( - "public static $is_initialized = false;\n\n" - "public static function initOnce() {\n"); - Indent(printer); - - if (options.aggregate_metadata) { - GenerateAddFilesToPool(file, options, printer); - } else { - printer->Print( - "$pool = \\Google\\Protobuf\\Internal\\" - "DescriptorPool::getGeneratedPool();\n\n" - "if (static::$is_initialized == true) {\n" - " return;\n" - "}\n"); - - if (options.is_descriptor) { - for (int i = 0; i < file->message_type_count(); i++) { - GenerateMessageToPool("", file->message_type(i), printer); - } - for (int i = 0; i < file->enum_type_count(); i++) { - GenerateEnumToPool(file->enum_type(i), printer); - } - - printer->Print( - "$pool->finish();\n"); - } else { - for (int i = 0; i < file->dependency_count(); i++) { - const std::string& name = file->dependency(i)->name(); - // Currently, descriptor.proto is not ready for external usage. Skip to - // import it for now, so that its dependencies can still work as long as - // they don't use protos defined in descriptor.proto. - if (name == kDescriptorFile) { - continue; - } - std::string dependency_filename = - GeneratedMetadataFileName(file->dependency(i), options); - printer->Print( - "\\^name^::initOnce();\n", - "name", FilenameToClassname(dependency_filename)); - } - - // Add messages and enums to descriptor pool. - FileDescriptorSet files; - FileDescriptorProto* file_proto = files.add_file(); - file->CopyTo(file_proto); - - // Filter out descriptor.proto as it cannot be depended on for now. - RepeatedPtrField* dependency = - file_proto->mutable_dependency(); - for (RepeatedPtrField::iterator it = dependency->begin(); - it != dependency->end(); ++it) { - if (*it != kDescriptorFile) { - dependency->erase(it); - break; - } - } - - // Filter out all extensions, since we do not support extension yet. - file_proto->clear_extension(); - RepeatedPtrField* message_type = - file_proto->mutable_message_type(); - for (RepeatedPtrField::iterator it = message_type->begin(); - it != message_type->end(); ++it) { - it->clear_extension(); - } - - std::string files_data; - files.SerializeToString(&files_data); - - printer->Print("$pool->internalAddGeneratedFile(\n"); - Indent(printer); - printer->Print("'"); - - for (auto ch : files_data) { - switch (ch) { - case '\\': - printer->Print(R"(\\)"); - break; - case '\'': - printer->Print(R"(\')"); - break; - default: - printer->Print("^char^", "char", std::string(1, ch)); - break; - } - } - - printer->Print("'\n"); - Outdent(printer); - printer->Print( - ", true);\n\n"); - } - printer->Print( - "static::$is_initialized = true;\n"); - } - - Outdent(printer); - printer->Print("}\n"); -} - -static void AnalyzeDependencyForFile( - const FileDescriptor* file, - std::set* nodes_without_dependency, - std::map>* deps, - std::map* dependency_count) { - int count = file->dependency_count(); - for (int i = 0; i < file->dependency_count(); i++) { - const FileDescriptor* dependency = file->dependency(i); - if (dependency->name() == kDescriptorFile) { - count--; - break; - } - } - - if (count == 0) { - nodes_without_dependency->insert(file); - } else { - (*dependency_count)[file] = count; - for (int i = 0; i < file->dependency_count(); i++) { - const FileDescriptor* dependency = file->dependency(i); - if (dependency->name() == kDescriptorFile) { - continue; - } - if (deps->find(dependency) == deps->end()) { - (*deps)[dependency] = std::set(); - } - (*deps)[dependency].insert(file); - AnalyzeDependencyForFile( - dependency, nodes_without_dependency, deps, dependency_count); - } - } -} - -static bool NeedsUnwrapping(const FileDescriptor* file, - const Options& options) { - bool has_aggregate_metadata_prefix = false; - if (options.aggregate_metadata_prefixes.empty()) { - has_aggregate_metadata_prefix = true; - } else { - for (const auto& prefix : options.aggregate_metadata_prefixes) { - if (HasPrefixString(file->package(), prefix)) { - has_aggregate_metadata_prefix = true; - break; - } - } - } - - return has_aggregate_metadata_prefix; -} - -void GenerateAddFilesToPool(const FileDescriptor* file, const Options& options, - io::Printer* printer) { - printer->Print( - "$pool = \\Google\\Protobuf\\Internal\\" - "DescriptorPool::getGeneratedPool();\n" - "if (static::$is_initialized == true) {\n" - " return;\n" - "}\n"); - - // Sort files according to dependency - std::map> deps; - std::map dependency_count; - std::set nodes_without_dependency; - FileDescriptorSet sorted_file_set; - - AnalyzeDependencyForFile( - file, &nodes_without_dependency, &deps, &dependency_count); - - while (!nodes_without_dependency.empty()) { - auto file_node = *nodes_without_dependency.begin(); - nodes_without_dependency.erase(file_node); - for (auto dependent : deps[file_node]) { - if (dependency_count[dependent] == 1) { - dependency_count.erase(dependent); - nodes_without_dependency.insert(dependent); - } else { - dependency_count[dependent] -= 1; - } - } - - bool needs_aggregate = NeedsUnwrapping(file_node, options); - - if (needs_aggregate) { - auto file_proto = sorted_file_set.add_file(); - file_node->CopyTo(file_proto); - - // Filter out descriptor.proto as it cannot be depended on for now. - RepeatedPtrField* dependency = - file_proto->mutable_dependency(); - for (RepeatedPtrField::iterator it = dependency->begin(); - it != dependency->end(); ++it) { - if (*it != kDescriptorFile) { - dependency->erase(it); - break; - } - } - - // Filter out all extensions, since we do not support extension yet. - file_proto->clear_extension(); - RepeatedPtrField* message_type = - file_proto->mutable_message_type(); - for (RepeatedPtrField::iterator it = message_type->begin(); - it != message_type->end(); ++it) { - it->clear_extension(); - } - } else { - std::string dependency_filename = GeneratedMetadataFileName(file_node, false); - printer->Print( - "\\^name^::initOnce();\n", - "name", FilenameToClassname(dependency_filename)); - } - } - - std::string files_data; - sorted_file_set.SerializeToString(&files_data); - - printer->Print("$pool->internalAddGeneratedFile(\n"); - Indent(printer); - printer->Print("'"); - - for (auto ch : files_data) { - switch (ch) { - case '\\': - printer->Print(R"(\\)"); - break; - case '\'': - printer->Print(R"(\')"); - break; - default: - printer->Print("^char^", "char", std::string(1, ch)); - break; - } - } - - printer->Print("'\n"); - Outdent(printer); - printer->Print( - ", true);\n"); - - printer->Print( - "static::$is_initialized = true;\n"); -} - -void GenerateUseDeclaration(const Options& options, io::Printer* printer) { - if (!options.is_descriptor) { - printer->Print( - "use Google\\Protobuf\\Internal\\GPBType;\n" - "use Google\\Protobuf\\Internal\\RepeatedField;\n" - "use Google\\Protobuf\\Internal\\GPBUtil;\n\n"); - } else { - printer->Print( - "use Google\\Protobuf\\Internal\\GPBType;\n" - "use Google\\Protobuf\\Internal\\GPBWire;\n" - "use Google\\Protobuf\\Internal\\RepeatedField;\n" - "use Google\\Protobuf\\Internal\\InputStream;\n" - "use Google\\Protobuf\\Internal\\GPBUtil;\n\n"); - } -} - -void GenerateHead(const FileDescriptor* file, io::Printer* printer) { - printer->Print( - "name()); -} - -std::string FilenameToClassname(const std::string& filename) { - int lastindex = filename.find_last_of("."); - std::string result = filename.substr(0, lastindex); - for (int i = 0; i < result.size(); i++) { - if (result[i] == '/') { - result[i] = '\\'; - } - } - return result; -} - -void GenerateMetadataFile(const FileDescriptor* file, const Options& options, - GeneratorContext* generator_context) { - std::string filename = GeneratedMetadataFileName(file, options); - std::unique_ptr output( - generator_context->Open(filename)); - io::Printer printer(output.get(), '^'); - - GenerateHead(file, &printer); - - std::string fullname = FilenameToClassname(filename); - int lastindex = fullname.find_last_of("\\"); - - if (lastindex != std::string::npos) { - printer.Print( - "namespace ^name^;\n\n", - "name", fullname.substr(0, lastindex)); - - printer.Print( - "class ^name^\n" - "{\n", - "name", fullname.substr(lastindex + 1)); - } else { - printer.Print( - "class ^name^\n" - "{\n", - "name", fullname); - } - Indent(&printer); - - GenerateAddFileToPool(file, options, &printer); - - Outdent(&printer); - printer.Print("}\n\n"); -} - -template -void LegacyGenerateClassFile(const FileDescriptor* file, - const DescriptorType* desc, const Options& options, - GeneratorContext* generator_context) { - std::string filename = LegacyGeneratedClassFileName(desc, options); - std::unique_ptr output( - generator_context->Open(filename)); - io::Printer printer(output.get(), '^'); - - GenerateHead(file, &printer); - - std::string php_namespace = RootPhpNamespace(desc, options); - if (!php_namespace.empty()) { - printer.Print( - "namespace ^name^;\n\n", - "name", php_namespace); - } - std::string newname = FullClassName(desc, options); - printer.Print("if (false) {\n"); - Indent(&printer); - printer.Print("/**\n"); - printer.Print(" * This class is deprecated. Use ^new^ instead.\n", - "new", newname); - printer.Print(" * @deprecated\n"); - printer.Print(" */\n"); - printer.Print("class ^old^ {}\n", - "old", LegacyGeneratedClassName(desc)); - Outdent(&printer); - printer.Print("}\n"); - printer.Print("class_exists(^new^::class);\n", - "new", GeneratedClassNameImpl(desc)); - printer.Print("@trigger_error('^old^ is deprecated and will be removed in " - "the next major release. Use ^fullname^ instead', E_USER_DEPRECATED);\n\n", - "old", LegacyFullClassName(desc, options), - "fullname", newname); -} - -void GenerateEnumFile(const FileDescriptor* file, const EnumDescriptor* en, - const Options& options, - GeneratorContext* generator_context) { - std::string filename = GeneratedClassFileName(en, options); - std::unique_ptr output( - generator_context->Open(filename)); - io::Printer printer(output.get(), '^'); - - GenerateHead(file, &printer); - - std::string fullname = FilenameToClassname(filename); - int lastindex = fullname.find_last_of("\\"); - - if (lastindex != std::string::npos) { - printer.Print( - "namespace ^name^;\n\n", - "name", fullname.substr(0, lastindex)); - - // We only need this 'use' statement if the enum has a namespace. - // Otherwise, we get a warning that the use statement has no effect. - printer.Print("use UnexpectedValueException;\n\n"); - } - - GenerateEnumDocComment(&printer, en, options); - - if (lastindex != std::string::npos) { - fullname = fullname.substr(lastindex + 1); - } - - printer.Print( - "class ^name^\n" - "{\n", - "name", fullname); - Indent(&printer); - - for (int i = 0; i < en->value_count(); i++) { - const EnumValueDescriptor* value = en->value(i); - GenerateEnumValueDocComment(&printer, value); - printer.Print("const ^name^ = ^number^;\n", - "name", ConstantNamePrefix(value->name()) + value->name(), - "number", IntToString(value->number())); - } - - printer.Print("\nprivate static $valueToName = [\n"); - Indent(&printer); - for (int i = 0; i < en->value_count(); i++) { - const EnumValueDescriptor* value = en->value(i); - printer.Print("self::^name^ => '^name^',\n", - "name", ConstantNamePrefix(value->name()) + value->name()); - } - Outdent(&printer); - printer.Print("];\n"); - - printer.Print( - "\npublic static function name($value)\n" - "{\n"); - Indent(&printer); - printer.Print("if (!isset(self::$valueToName[$value])) {\n"); - Indent(&printer); - printer.Print("throw new UnexpectedValueException(sprintf(\n"); - Indent(&printer); - Indent(&printer); - printer.Print("'Enum %s has no name defined for value %s', __CLASS__, $value));\n"); - Outdent(&printer); - Outdent(&printer); - Outdent(&printer); - printer.Print("}\n" - "return self::$valueToName[$value];\n"); - Outdent(&printer); - printer.Print("}\n\n"); - - printer.Print( - "\npublic static function value($name)\n" - "{\n"); - Indent(&printer); - printer.Print("$const = __CLASS__ . '::' . strtoupper($name);\n" - "if (!defined($const)) {\n"); - Indent(&printer); - printer.Print("throw new UnexpectedValueException(sprintf(\n"); - Indent(&printer); - Indent(&printer); - printer.Print("'Enum %s has no value defined for name %s', __CLASS__, $name));\n"); - Outdent(&printer); - Outdent(&printer); - Outdent(&printer); - printer.Print("}\n" - "return constant($const);\n"); - Outdent(&printer); - printer.Print("}\n"); - - Outdent(&printer); - printer.Print("}\n\n"); - - // write legacy file for backwards compatibility with nested messages and enums - if (en->containing_type() != NULL) { - printer.Print( - "// Adding a class alias for backwards compatibility with the previous class name.\n"); - printer.Print( - "class_alias(^new^::class, \\^old^::class);\n\n", - "new", fullname, - "old", LegacyFullClassName(en, options)); - LegacyGenerateClassFile(file, en, options, generator_context); - } -} - -void GenerateMessageFile(const FileDescriptor* file, const Descriptor* message, - const Options& options, - GeneratorContext* generator_context) { - // Don't generate MapEntry messages -- we use the PHP extension's native - // support for map fields instead. - if (message->options().map_entry()) { - return; - } - - std::string filename = GeneratedClassFileName(message, options); - std::unique_ptr output( - generator_context->Open(filename)); - io::Printer printer(output.get(), '^'); - - GenerateHead(file, &printer); - - std::string fullname = FilenameToClassname(filename); - int lastindex = fullname.find_last_of("\\"); - - if (lastindex != std::string::npos) { - printer.Print( - "namespace ^name^;\n\n", - "name", fullname.substr(0, lastindex)); - } - - GenerateUseDeclaration(options, &printer); - - GenerateMessageDocComment(&printer, message, options); - if (lastindex != std::string::npos) { - fullname = fullname.substr(lastindex + 1); - } - - std::string base; - - switch (message->well_known_type()) { - case Descriptor::WELLKNOWNTYPE_ANY: - base = "\\Google\\Protobuf\\Internal\\AnyBase"; - break; - case Descriptor::WELLKNOWNTYPE_TIMESTAMP: - base = "\\Google\\Protobuf\\Internal\\TimestampBase"; - break; - default: - base = "\\Google\\Protobuf\\Internal\\Message"; - break; - } - - printer.Print( - "class ^name^ extends ^base^\n" - "{\n", - "base", base, - "name", fullname); - Indent(&printer); - - // Field and oneof definitions. - for (int i = 0; i < message->field_count(); i++) { - const FieldDescriptor* field = message->field(i); - GenerateField(field, &printer, options); - } - for (int i = 0; i < message->real_oneof_decl_count(); i++) { - const OneofDescriptor* oneof = message->oneof_decl(i); - GenerateOneofField(oneof, &printer); - } - printer.Print("\n"); - - GenerateMessageConstructorDocComment(&printer, message, options); - printer.Print( - "public function __construct($data = NULL) {\n"); - Indent(&printer); - - std::string metadata_filename = GeneratedMetadataFileName(file, options); - std::string metadata_fullname = FilenameToClassname(metadata_filename); - printer.Print( - "\\^fullname^::initOnce();\n", - "fullname", metadata_fullname); - - printer.Print( - "parent::__construct($data);\n"); - - Outdent(&printer); - printer.Print("}\n\n"); - - // Field and oneof accessors. - for (int i = 0; i < message->field_count(); i++) { - const FieldDescriptor* field = message->field(i); - GenerateFieldAccessor(field, options, &printer); - } - for (int i = 0; i < message->real_oneof_decl_count(); i++) { - const OneofDescriptor* oneof = message->oneof_decl(i); - printer.Print( - "/**\n" - " * @return string\n" - " */\n" - "public function get^camel_name^()\n" - "{\n" - " return $this->whichOneof(\"^name^\");\n" - "}\n\n", - "camel_name", UnderscoresToCamelCase(oneof->name(), true), "name", - oneof->name()); - } - - Outdent(&printer); - printer.Print("}\n\n"); - - // write legacy file for backwards compatibility with nested messages and enums - if (message->containing_type() != NULL) { - printer.Print( - "// Adding a class alias for backwards compatibility with the previous class name.\n"); - printer.Print( - "class_alias(^new^::class, \\^old^::class);\n\n", - "new", fullname, - "old", LegacyFullClassName(message, options)); - LegacyGenerateClassFile(file, message, options, generator_context); - } - - // Nested messages and enums. - for (int i = 0; i < message->nested_type_count(); i++) { - GenerateMessageFile(file, message->nested_type(i), options, - generator_context); - } - for (int i = 0; i < message->enum_type_count(); i++) { - GenerateEnumFile(file, message->enum_type(i), options, generator_context); - } -} - -void GenerateServiceFile( - const FileDescriptor* file, const ServiceDescriptor* service, - const Options& options, GeneratorContext* generator_context) { - std::string filename = GeneratedServiceFileName(service, options); - std::unique_ptr output( - generator_context->Open(filename)); - io::Printer printer(output.get(), '^'); - - GenerateHead(file, &printer); - - std::string fullname = FilenameToClassname(filename); - int lastindex = fullname.find_last_of("\\"); - - if (!file->options().php_namespace().empty() || - (!file->options().has_php_namespace() && !file->package().empty()) || - lastindex != std::string::npos) { - printer.Print( - "namespace ^name^;\n\n", - "name", fullname.substr(0, lastindex)); - } - - GenerateServiceDocComment(&printer, service); - - if (lastindex != std::string::npos) { - printer.Print( - "interface ^name^\n" - "{\n", - "name", fullname.substr(lastindex + 1)); - } else { - printer.Print( - "interface ^name^\n" - "{\n", - "name", fullname); - } - - Indent(&printer); - - for (int i = 0; i < service->method_count(); i++) { - const MethodDescriptor* method = service->method(i); - GenerateServiceMethodDocComment(&printer, method); - GenerateServiceMethod(method, &printer); - } - - Outdent(&printer); - printer.Print("}\n\n"); -} - -void GenerateFile(const FileDescriptor* file, const Options& options, - GeneratorContext* generator_context) { - GenerateMetadataFile(file, options, generator_context); - - for (int i = 0; i < file->message_type_count(); i++) { - GenerateMessageFile(file, file->message_type(i), options, - generator_context); - } - for (int i = 0; i < file->enum_type_count(); i++) { - GenerateEnumFile(file, file->enum_type(i), options, generator_context); - } - if (file->options().php_generic_services()) { - for (int i = 0; i < file->service_count(); i++) { - GenerateServiceFile(file, file->service(i), options, generator_context); - } - } -} - -static std::string EscapePhpdoc(const std::string& input) { - std::string result; - result.reserve(input.size() * 2); - - char prev = '*'; - - for (std::string::size_type i = 0; i < input.size(); i++) { - char c = input[i]; - switch (c) { - case '*': - // Avoid "/*". - if (prev == '/') { - result.append("*"); - } else { - result.push_back(c); - } - break; - case '/': - // Avoid "*/". - if (prev == '*') { - result.append("/"); - } else { - result.push_back(c); - } - break; - case '@': - // '@' starts phpdoc tags including the @deprecated tag, which will - // cause a compile-time error if inserted before a declaration that - // does not have a corresponding @Deprecated annotation. - result.append("@"); - break; - default: - result.push_back(c); - break; - } - - prev = c; - } - - return result; -} - -static void GenerateDocCommentBodyForLocation( - io::Printer* printer, const SourceLocation& location, bool trailingNewline, - int indentCount) { - std::string comments = location.leading_comments.empty() - ? location.trailing_comments - : location.leading_comments; - if (!comments.empty()) { - // TODO(teboring): Ideally we should parse the comment text as Markdown and - // write it back as HTML, but this requires a Markdown parser. For now - // we just use the proto comments unchanged. - - // If the comment itself contains block comment start or end markers, - // HTML-escape them so that they don't accidentally close the doc comment. - comments = EscapePhpdoc(comments); - - std::vector lines = Split(comments, "\n", true); - while (!lines.empty() && lines.back().empty()) { - lines.pop_back(); - } - - for (int i = 0; i < lines.size(); i++) { - // Most lines should start with a space. Watch out for lines that start - // with a /, since putting that right after the leading asterisk will - // close the comment. - if (indentCount == 0 && !lines[i].empty() && lines[i][0] == '/') { - printer->Print(" * ^line^\n", "line", lines[i]); - } else { - std::string indent = std::string(indentCount, ' '); - printer->Print(" *^ind^^line^\n", "ind", indent, "line", lines[i]); - } - } - if (trailingNewline) { - printer->Print(" *\n"); - } - } -} - -template -static void GenerateDocCommentBody( - io::Printer* printer, const DescriptorType* descriptor) { - SourceLocation location; - if (descriptor->GetSourceLocation(&location)) { - GenerateDocCommentBodyForLocation(printer, location, true, 0); - } -} - -static std::string FirstLineOf(const std::string& value) { - std::string result = value; - - std::string::size_type pos = result.find_first_of('\n'); - if (pos != std::string::npos) { - result.erase(pos); - } - - return result; -} - -void GenerateMessageDocComment(io::Printer* printer, const Descriptor* message, - const Options& options) { - printer->Print("/**\n"); - GenerateDocCommentBody(printer, message); - printer->Print( - " * Generated from protobuf message ^messagename^\n" - " */\n", - "fullname", EscapePhpdoc(FullClassName(message, options)), - "messagename", EscapePhpdoc(message->full_name())); -} - -void GenerateMessageConstructorDocComment(io::Printer* printer, - const Descriptor* message, - const Options& options) { - // In theory we should have slightly different comments for setters, getters, - // etc., but in practice everyone already knows the difference between these - // so it's redundant information. - - // We start the comment with the main body based on the comments from the - // .proto file (if present). We then end with the field declaration, e.g.: - // optional string foo = 5; - // If the field is a group, the debug string might end with {. - printer->Print("/**\n"); - printer->Print(" * Constructor.\n"); - printer->Print(" *\n"); - printer->Print(" * @param array $data {\n"); - printer->Print(" * Optional. Data for populating the Message object.\n"); - printer->Print(" *\n"); - for (int i = 0; i < message->field_count(); i++) { - const FieldDescriptor* field = message->field(i); - printer->Print(" * @type ^php_type^ $^var^\n", - "php_type", PhpSetterTypeName(field, options), - "var", field->name()); - SourceLocation location; - if (field->GetSourceLocation(&location)) { - GenerateDocCommentBodyForLocation(printer, location, false, 10); - } - } - printer->Print(" * }\n"); - printer->Print(" */\n"); -} - -void GenerateServiceDocComment(io::Printer* printer, - const ServiceDescriptor* service) { - printer->Print("/**\n"); - GenerateDocCommentBody(printer, service); - printer->Print( - " * Protobuf type ^fullname^\n" - " */\n", - "fullname", EscapePhpdoc(service->full_name())); -} - -void GenerateFieldDocComment(io::Printer* printer, const FieldDescriptor* field, - const Options& options, int function_type) { - // In theory we should have slightly different comments for setters, getters, - // etc., but in practice everyone already knows the difference between these - // so it's redundant information. - - // We start the comment with the main body based on the comments from the - // .proto file (if present). We then end with the field declaration, e.g.: - // optional string foo = 5; - // If the field is a group, the debug string might end with {. - printer->Print("/**\n"); - GenerateDocCommentBody(printer, field); - printer->Print( - " * Generated from protobuf field ^def^\n", - "def", EscapePhpdoc(FirstLineOf(field->DebugString()))); - if (function_type == kFieldSetter) { - printer->Print(" * @param ^php_type^ $var\n", - "php_type", PhpSetterTypeName(field, options)); - printer->Print(" * @return $this\n"); - } else if (function_type == kFieldGetter) { - bool can_return_null = field->has_presence() && - field->cpp_type() == FieldDescriptor::CPPTYPE_MESSAGE; - printer->Print(" * @return ^php_type^^maybe_null^\n", - "php_type", PhpGetterTypeName(field, options), - "maybe_null", can_return_null ? "|null" : ""); - } - if (field->options().deprecated()) { - printer->Print(" * @deprecated\n"); - } - printer->Print(" */\n"); -} - -void GenerateWrapperFieldGetterDocComment(io::Printer* printer, const FieldDescriptor* field) { - // Generate a doc comment for the special getXXXValue methods that are - // generated for wrapper types. - const FieldDescriptor* primitiveField = field->message_type()->FindFieldByName("value"); - printer->Print("/**\n"); - printer->Print( - " * Returns the unboxed value from get^camel_name^()\n\n", - "camel_name", UnderscoresToCamelCase(field->name(), true)); - GenerateDocCommentBody(printer, field); - printer->Print( - " * Generated from protobuf field ^def^\n", - "def", EscapePhpdoc(FirstLineOf(field->DebugString()))); - printer->Print(" * @return ^php_type^|null\n", - "php_type", PhpGetterTypeName(primitiveField, false)); - printer->Print(" */\n"); -} - -void GenerateWrapperFieldSetterDocComment(io::Printer* printer, const FieldDescriptor* field) { - // Generate a doc comment for the special setXXXValue methods that are - // generated for wrapper types. - const FieldDescriptor* primitiveField = field->message_type()->FindFieldByName("value"); - printer->Print("/**\n"); - printer->Print( - " * Sets the field by wrapping a primitive type in a ^message_name^ object.\n\n", - "message_name", FullClassName(field->message_type(), false)); - GenerateDocCommentBody(printer, field); - printer->Print( - " * Generated from protobuf field ^def^\n", - "def", EscapePhpdoc(FirstLineOf(field->DebugString()))); - printer->Print(" * @param ^php_type^|null $var\n", - "php_type", PhpSetterTypeName(primitiveField, false)); - printer->Print(" * @return $this\n"); - printer->Print(" */\n"); -} - -void GenerateEnumDocComment(io::Printer* printer, const EnumDescriptor* enum_, - const Options& options) { - printer->Print("/**\n"); - GenerateDocCommentBody(printer, enum_); - printer->Print( - " * Protobuf type ^fullname^\n" - " */\n", - "fullname", EscapePhpdoc(enum_->full_name())); -} - -void GenerateEnumValueDocComment(io::Printer* printer, - const EnumValueDescriptor* value) { - printer->Print("/**\n"); - GenerateDocCommentBody(printer, value); - printer->Print( - " * Generated from protobuf enum ^def^\n" - " */\n", - "def", EscapePhpdoc(FirstLineOf(value->DebugString()))); -} - -void GenerateServiceMethodDocComment(io::Printer* printer, - const MethodDescriptor* method) { - printer->Print("/**\n"); - GenerateDocCommentBody(printer, method); - printer->Print( - " * Method ^method_name^\n" - " *\n", - "method_name", EscapePhpdoc(UnderscoresToCamelCase(method->name(), false))); - printer->Print( - " * @param \\^input_type^ $request\n", - "input_type", EscapePhpdoc(FullClassName(method->input_type(), false))); - printer->Print( - " * @return \\^return_type^\n" - " */\n", - "return_type", EscapePhpdoc(FullClassName(method->output_type(), false))); -} - -std::string FilenameCName(const FileDescriptor* file) { - std::string c_name = file->name(); - c_name = StringReplace(c_name, ".", "_", true); - c_name = StringReplace(c_name, "/", "_", true); - return c_name; -} - -void GenerateCEnum(const EnumDescriptor* desc, io::Printer* printer) { - std::string c_name = desc->full_name(); - c_name = StringReplace(c_name, ".", "_", true); - std::string php_name = FullClassName(desc, Options()); - php_name = StringReplace(php_name, "\\", "\\\\", true); - printer->Print( - "/* $c_name$ */\n" - "\n" - "zend_class_entry* $c_name$_ce;\n" - "\n" - "PHP_METHOD($c_name$, name) {\n" - " $file_c_name$_AddDescriptor();\n" - " const upb_symtab *symtab = DescriptorPool_GetSymbolTable();\n" - " const upb_enumdef *e = upb_symtab_lookupenum(symtab, \"$name$\");\n" - " const char *name;\n" - " zend_long value;\n" - " if (zend_parse_parameters(ZEND_NUM_ARGS(), \"l\", &value) ==\n" - " FAILURE) {\n" - " return;\n" - " }\n" - " name = upb_enumdef_iton(e, value);\n" - " if (!name) {\n" - " zend_throw_exception_ex(NULL, 0,\n" - " \"$php_name$ has no name \"\n" - " \"defined for value \" ZEND_LONG_FMT \".\",\n" - " value);\n" - " return;\n" - " }\n" - " RETURN_STRING(name);\n" - "}\n" - "\n" - "PHP_METHOD($c_name$, value) {\n" - " $file_c_name$_AddDescriptor();\n" - " const upb_symtab *symtab = DescriptorPool_GetSymbolTable();\n" - " const upb_enumdef *e = upb_symtab_lookupenum(symtab, \"$name$\");\n" - " char *name = NULL;\n" - " size_t name_len;\n" - " int32_t num;\n" - " if (zend_parse_parameters(ZEND_NUM_ARGS(), \"s\", &name,\n" - " &name_len) == FAILURE) {\n" - " return;\n" - " }\n" - " if (!upb_enumdef_ntoi(e, name, name_len, &num)) {\n" - " zend_throw_exception_ex(NULL, 0,\n" - " \"$php_name$ has no value \"\n" - " \"defined for name %s.\",\n" - " name);\n" - " return;\n" - " }\n" - " RETURN_LONG(num);\n" - "}\n" - "\n" - "static zend_function_entry $c_name$_phpmethods[] = {\n" - " PHP_ME($c_name$, name, arginfo_lookup, ZEND_ACC_PUBLIC | ZEND_ACC_STATIC)\n" - " PHP_ME($c_name$, value, arginfo_lookup, ZEND_ACC_PUBLIC | ZEND_ACC_STATIC)\n" - " ZEND_FE_END\n" - "};\n" - "\n" - "static void $c_name$_ModuleInit() {\n" - " zend_class_entry tmp_ce;\n" - "\n" - " INIT_CLASS_ENTRY(tmp_ce, \"$php_name$\",\n" - " $c_name$_phpmethods);\n" - "\n" - " $c_name$_ce = zend_register_internal_class(&tmp_ce);\n", - "name", desc->full_name(), - "file_c_name", FilenameCName(desc->file()), - "c_name", c_name, - "php_name", php_name); - - for (int i = 0; i < desc->value_count(); i++) { - const EnumValueDescriptor* value = desc->value(i); - printer->Print( - " zend_declare_class_constant_long($c_name$_ce, \"$name$\",\n" - " strlen(\"$name$\"), $num$);\n", - "c_name", c_name, - "name", value->name(), - "num", std::to_string(value->number())); - } - - printer->Print( - "}\n" - "\n"); -} - -void GenerateCMessage(const Descriptor* message, io::Printer* printer) { - std::string c_name = message->full_name(); - c_name = StringReplace(c_name, ".", "_", true); - std::string php_name = FullClassName(message, Options()); - php_name = StringReplace(php_name, "\\", "\\\\", true); - printer->Print( - "/* $c_name$ */\n" - "\n" - "zend_class_entry* $c_name$_ce;\n" - "\n" - "static PHP_METHOD($c_name$, __construct) {\n" - " $file_c_name$_AddDescriptor();\n" - " zim_Message___construct(INTERNAL_FUNCTION_PARAM_PASSTHRU);\n" - "}\n" - "\n", - "file_c_name", FilenameCName(message->file()), - "c_name", c_name); - - for (int i = 0; i < message->field_count(); i++) { - auto field = message->field(i); - printer->Print( - "static PHP_METHOD($c_name$, get$camel_name$) {\n" - " Message* intern = (Message*)Z_OBJ_P(getThis());\n" - " const upb_fielddef *f = upb_msgdef_ntofz(intern->desc->msgdef,\n" - " \"$name$\");\n" - " zval ret;\n" - " Message_get(intern, f, &ret);\n" - " RETURN_COPY_VALUE(&ret);\n" - "}\n" - "\n" - "static PHP_METHOD($c_name$, set$camel_name$) {\n" - " Message* intern = (Message*)Z_OBJ_P(getThis());\n" - " const upb_fielddef *f = upb_msgdef_ntofz(intern->desc->msgdef,\n" - " \"$name$\");\n" - " zval *val;\n" - " if (zend_parse_parameters(ZEND_NUM_ARGS(), \"z\", &val)\n" - " == FAILURE) {\n" - " return;\n" - " }\n" - " Message_set(intern, f, val);\n" - " RETURN_COPY(getThis());\n" - "}\n" - "\n", - "c_name", c_name, - "name", field->name(), - "camel_name", UnderscoresToCamelCase(field->name(), true)); - } - - for (int i = 0; i < message->real_oneof_decl_count(); i++) { - auto oneof = message->oneof_decl(i); - printer->Print( - "static PHP_METHOD($c_name$, get$camel_name$) {\n" - " Message* intern = (Message*)Z_OBJ_P(getThis());\n" - " const upb_oneofdef *oneof = upb_msgdef_ntooz(intern->desc->msgdef,\n" - " \"$name$\");\n" - " const upb_fielddef *field = upb_msg_whichoneof(intern->msg, oneof);\n" - " RETURN_STRING(field ? upb_fielddef_name(field) : \"\");\n" - "}\n", - "c_name", c_name, - "name", oneof->name(), - "camel_name", UnderscoresToCamelCase(oneof->name(), true)); - } - - switch (message->well_known_type()) { - case Descriptor::WELLKNOWNTYPE_ANY: - printer->Print( - "ZEND_BEGIN_ARG_INFO_EX(arginfo_is, 0, 0, 1)\n" - " ZEND_ARG_INFO(0, proto)\n" - "ZEND_END_ARG_INFO()\n" - "\n" - ); - break; - case Descriptor::WELLKNOWNTYPE_TIMESTAMP: - printer->Print( - "ZEND_BEGIN_ARG_INFO_EX(arginfo_timestamp_fromdatetime, 0, 0, 1)\n" - " ZEND_ARG_INFO(0, datetime)\n" - "ZEND_END_ARG_INFO()\n" - "\n" - ); - break; - default: - break; - } - - printer->Print( - "static zend_function_entry $c_name$_phpmethods[] = {\n" - " PHP_ME($c_name$, __construct, arginfo_construct, ZEND_ACC_PUBLIC)\n", - "c_name", c_name); - - for (int i = 0; i < message->field_count(); i++) { - auto field = message->field(i); - printer->Print( - " PHP_ME($c_name$, get$camel_name$, arginfo_void, ZEND_ACC_PUBLIC)\n" - " PHP_ME($c_name$, set$camel_name$, arginfo_setter, ZEND_ACC_PUBLIC)\n", - "c_name", c_name, - "camel_name", UnderscoresToCamelCase(field->name(), true)); - } - - for (int i = 0; i < message->real_oneof_decl_count(); i++) { - auto oneof = message->oneof_decl(i); - printer->Print( - " PHP_ME($c_name$, get$camel_name$, arginfo_void, ZEND_ACC_PUBLIC)\n", - "c_name", c_name, - "camel_name", UnderscoresToCamelCase(oneof->name(), true)); - } - - // Extra hand-written functions added to the well-known types. - switch (message->well_known_type()) { - case Descriptor::WELLKNOWNTYPE_ANY: - printer->Print( - " PHP_ME($c_name$, is, arginfo_is, ZEND_ACC_PUBLIC)\n" - " PHP_ME($c_name$, pack, arginfo_setter, ZEND_ACC_PUBLIC)\n" - " PHP_ME($c_name$, unpack, arginfo_void, ZEND_ACC_PUBLIC)\n", - "c_name", c_name); - break; - case Descriptor::WELLKNOWNTYPE_TIMESTAMP: - printer->Print( - " PHP_ME($c_name$, fromDateTime, arginfo_timestamp_fromdatetime, ZEND_ACC_PUBLIC)\n" - " PHP_ME($c_name$, toDateTime, arginfo_void, ZEND_ACC_PUBLIC)\n", - "c_name", c_name); - break; - default: - break; - } - - printer->Print( - " ZEND_FE_END\n" - "};\n" - "\n" - "static void $c_name$_ModuleInit() {\n" - " zend_class_entry tmp_ce;\n" - "\n" - " INIT_CLASS_ENTRY(tmp_ce, \"$php_name$\",\n" - " $c_name$_phpmethods);\n" - "\n" - " $c_name$_ce = zend_register_internal_class(&tmp_ce);\n" - " $c_name$_ce->ce_flags |= ZEND_ACC_FINAL;\n" - " $c_name$_ce->create_object = Message_create;\n" - " zend_do_inheritance($c_name$_ce, message_ce);\n" - "}\n" - "\n", - "c_name", c_name, - "php_name", php_name); - - for (int i = 0; i < message->nested_type_count(); i++) { - GenerateCMessage(message->nested_type(i), printer); - } - for (int i = 0; i < message->enum_type_count(); i++) { - GenerateCEnum(message->enum_type(i), printer); - } -} - -void GenerateEnumCInit(const EnumDescriptor* desc, io::Printer* printer) { - std::string c_name = desc->full_name(); - c_name = StringReplace(c_name, ".", "_", true); - - printer->Print( - " $c_name$_ModuleInit();\n", - "c_name", c_name); -} - -void GenerateCInit(const Descriptor* message, io::Printer* printer) { - std::string c_name = message->full_name(); - c_name = StringReplace(c_name, ".", "_", true); - - printer->Print( - " $c_name$_ModuleInit();\n", - "c_name", c_name); - - for (int i = 0; i < message->nested_type_count(); i++) { - GenerateCInit(message->nested_type(i), printer); - } - for (int i = 0; i < message->enum_type_count(); i++) { - GenerateEnumCInit(message->enum_type(i), printer); - } -} - -void GenerateCWellKnownTypes(const std::vector& files, - GeneratorContext* context) { - std::unique_ptr output( - context->Open("../ext/google/protobuf/wkt.inc")); - io::Printer printer(output.get(), '$'); - - printer.Print( - "// This file is generated from the .proto files for the well-known\n" - "// types. Do not edit!\n\n"); - - printer.Print( - "ZEND_BEGIN_ARG_INFO_EX(arginfo_lookup, 0, 0, 1)\n" - " ZEND_ARG_INFO(0, key)\n" - "ZEND_END_ARG_INFO()\n" - "\n" - ); - - for (auto file : files) { - printer.Print( - "static void $c_name$_AddDescriptor();\n", - "c_name", FilenameCName(file)); - } - - for (auto file : files) { - std::string c_name = FilenameCName(file); - std::string metadata_filename = GeneratedMetadataFileName(file, Options()); - std::string metadata_classname = FilenameToClassname(metadata_filename); - std::string metadata_c_name = - StringReplace(metadata_classname, "\\", "_", true); - metadata_classname = StringReplace(metadata_classname, "\\", "\\\\", true); - FileDescriptorProto file_proto; - file->CopyTo(&file_proto); - std::string serialized; - file_proto.SerializeToString(&serialized); - printer.Print( - "/* $filename$ */\n" - "\n" - "zend_class_entry* $metadata_c_name$_ce;\n" - "\n" - "const char $c_name$_descriptor [$size$] = {\n", - "filename", file->name(), - "c_name", c_name, - "metadata_c_name", metadata_c_name, - "size", std::to_string(serialized.size())); - - for (size_t i = 0; i < serialized.size();) { - for (size_t j = 0; j < 25 && i < serialized.size(); ++i, ++j) { - printer.Print("'$ch$', ", "ch", CEscape(serialized.substr(i, 1))); - } - printer.Print("\n"); - } - - printer.Print( - "};\n" - "\n" - "static void $c_name$_AddDescriptor() {\n" - " if (DescriptorPool_HasFile(\"$filename$\")) return;\n", - "filename", file->name(), - "c_name", c_name, - "metadata_c_name", metadata_c_name); - - for (int i = 0; i < file->dependency_count(); i++) { - std::string dep_c_name = FilenameCName(file->dependency(i)); - printer.Print( - " $dep_c_name$_AddDescriptor();\n", - "dep_c_name", dep_c_name); - } - - printer.Print( - " DescriptorPool_AddDescriptor(\"$filename$\", $c_name$_descriptor,\n" - " sizeof($c_name$_descriptor));\n" - "}\n" - "\n" - "static PHP_METHOD($metadata_c_name$, initOnce) {\n" - " $c_name$_AddDescriptor();\n" - "}\n" - "\n" - "static zend_function_entry $metadata_c_name$_methods[] = {\n" - " PHP_ME($metadata_c_name$, initOnce, arginfo_void, ZEND_ACC_PUBLIC | ZEND_ACC_STATIC)\n" - " ZEND_FE_END\n" - "};\n" - "\n" - "static void $metadata_c_name$_ModuleInit() {\n" - " zend_class_entry tmp_ce;\n" - "\n" - " INIT_CLASS_ENTRY(tmp_ce, \"$metadata_classname$\",\n" - " $metadata_c_name$_methods);\n" - "\n" - " $metadata_c_name$_ce = zend_register_internal_class(&tmp_ce);\n" - "}\n" - "\n", - "filename", file->name(), - "c_name", c_name, - "metadata_c_name", metadata_c_name, - "metadata_classname", metadata_classname); - for (int i = 0; i < file->message_type_count(); i++) { - GenerateCMessage(file->message_type(i), &printer); - } - for (int i = 0; i < file->enum_type_count(); i++) { - GenerateCEnum(file->enum_type(i), &printer); - } - } - - printer.Print( - "static void WellKnownTypes_ModuleInit() {\n"); - - for (auto file : files) { - std::string metadata_filename = GeneratedMetadataFileName(file, Options()); - std::string metadata_classname = FilenameToClassname(metadata_filename); - std::string metadata_c_name = - StringReplace(metadata_classname, "\\", "_", true); - printer.Print( - " $metadata_c_name$_ModuleInit();\n", - "metadata_c_name", metadata_c_name); - for (int i = 0; i < file->message_type_count(); i++) { - GenerateCInit(file->message_type(i), &printer); - } - for (int i = 0; i < file->enum_type_count(); i++) { - GenerateEnumCInit(file->enum_type(i), &printer); - } - } - - printer.Print( - "}\n"); -} - -} // namespace - -std::string GeneratedClassName(const Descriptor* desc) { - return GeneratedClassNameImpl(desc); -} - -std::string GeneratedClassName(const EnumDescriptor* desc) { - return GeneratedClassNameImpl(desc); -} - -std::string GeneratedClassName(const ServiceDescriptor* desc) { - return GeneratedClassNameImpl(desc); -} - -bool Generator::Generate(const FileDescriptor* file, - const std::string& parameter, - GeneratorContext* generator_context, - std::string* error) const { - return Generate(file, Options(), generator_context, error); -} - -bool Generator::Generate(const FileDescriptor* file, const Options& options, - GeneratorContext* generator_context, - std::string* error) const { - if (options.is_descriptor && file->name() != kDescriptorFile) { - *error = - "Can only generate PHP code for google/protobuf/descriptor.proto.\n"; - return false; - } - - if (!options.is_descriptor && file->syntax() != FileDescriptor::SYNTAX_PROTO3) { - *error = - "Can only generate PHP code for proto3 .proto files.\n" - "Please add 'syntax = \"proto3\";' to the top of your .proto file.\n"; - return false; - } - - GenerateFile(file, options, generator_context); - - return true; -} - -bool Generator::GenerateAll(const std::vector& files, - const std::string& parameter, - GeneratorContext* generator_context, - std::string* error) const { - Options options; - - for (const auto& option : Split(parameter, ",", true)) { - const std::vector option_pair = Split(option, "=", true); - if (HasPrefixString(option_pair[0], "aggregate_metadata")) { - options.aggregate_metadata = true; - for (const auto& prefix : Split(option_pair[1], "#", false)) { - options.aggregate_metadata_prefixes.emplace(prefix); - GOOGLE_LOG(INFO) << prefix; - } - } else if (option_pair[0] == "internal") { - options.is_descriptor = true; - } else if (option_pair[0] == "internal_generate_c_wkt") { - GenerateCWellKnownTypes(files, generator_context); - } else { - GOOGLE_LOG(FATAL) << "Unknown codegen option: " << option_pair[0]; - } - } - - for (auto file : files) { - if (!Generate(file, options, generator_context, error)) { - return false; - } - } - - return true; -} - -} // namespace php -} // namespace compiler -} // namespace protobuf -} // namespace google diff --git a/extra/protobuf/protobuf-3.19.4/src/google/protobuf/compiler/php/php_generator.h b/extra/protobuf/protobuf-3.19.4/src/google/protobuf/compiler/php/php_generator.h deleted file mode 100644 index 17cb59c08b6a..000000000000 --- a/extra/protobuf/protobuf-3.19.4/src/google/protobuf/compiler/php/php_generator.h +++ /dev/null @@ -1,92 +0,0 @@ -// Protocol Buffers - Google's data interchange format -// Copyright 2008 Google Inc. All rights reserved. -// https://developers.google.com/protocol-buffers/ -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// * Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// * Redistributions in binary form must reproduce the above -// copyright notice, this list of conditions and the following disclaimer -// in the documentation and/or other materials provided with the -// distribution. -// * Neither the name of Google Inc. nor the names of its -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -#ifndef GOOGLE_PROTOBUF_COMPILER_PHP_GENERATOR_H__ -#define GOOGLE_PROTOBUF_COMPILER_PHP_GENERATOR_H__ - -#include -#include - -#include - -#include - -namespace google { -namespace protobuf { -namespace compiler { -namespace php { - -struct Options; - -class PROTOC_EXPORT Generator : public CodeGenerator { - public: - virtual bool Generate( - const FileDescriptor* file, - const std::string& parameter, - GeneratorContext* generator_context, - std::string* error) const override; - - bool GenerateAll(const std::vector& files, - const std::string& parameter, - GeneratorContext* generator_context, - std::string* error) const override; - - uint64_t GetSupportedFeatures() const override { - return FEATURE_PROTO3_OPTIONAL; - } - - private: - bool Generate( - const FileDescriptor* file, - const Options& options, - GeneratorContext* generator_context, - std::string* error) const; -}; - -// To skip reserved keywords in php, some generated classname are prefixed. -// Other code generators may need following API to figure out the actual -// classname. -PROTOC_EXPORT std::string GeneratedClassName(const Descriptor* desc); -PROTOC_EXPORT std::string GeneratedClassName(const EnumDescriptor* desc); -PROTOC_EXPORT std::string GeneratedClassName(const ServiceDescriptor* desc); - -inline bool IsWrapperType(const FieldDescriptor* descriptor) { - return descriptor->cpp_type() == FieldDescriptor::CPPTYPE_MESSAGE && - descriptor->message_type()->file()->name() == "google/protobuf/wrappers.proto"; -} - -} // namespace php -} // namespace compiler -} // namespace protobuf -} // namespace google - -#include - -#endif // GOOGLE_PROTOBUF_COMPILER_PHP_GENERATOR_H__ diff --git a/extra/protobuf/protobuf-3.19.4/src/google/protobuf/compiler/plugin.cc b/extra/protobuf/protobuf-3.19.4/src/google/protobuf/compiler/plugin.cc deleted file mode 100644 index 780996866295..000000000000 --- a/extra/protobuf/protobuf-3.19.4/src/google/protobuf/compiler/plugin.cc +++ /dev/null @@ -1,200 +0,0 @@ -// Protocol Buffers - Google's data interchange format -// Copyright 2008 Google Inc. All rights reserved. -// https://developers.google.com/protocol-buffers/ -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// * Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// * Redistributions in binary form must reproduce the above -// copyright notice, this list of conditions and the following disclaimer -// in the documentation and/or other materials provided with the -// distribution. -// * Neither the name of Google Inc. nor the names of its -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -// Author: kenton@google.com (Kenton Varda) - -#include - -#include -#include - -#ifdef _WIN32 -#include -#else -#include -#endif - -#include -#include -#include -#include -#include -#include -#include - - -namespace google { -namespace protobuf { -namespace compiler { - -#if defined(_WIN32) -// DO NOT include , instead create functions in io_win32.{h,cc} and import -// them like we do below. -using google::protobuf::io::win32::setmode; -#endif - -class GeneratorResponseContext : public GeneratorContext { - public: - GeneratorResponseContext( - const Version& compiler_version, CodeGeneratorResponse* response, - const std::vector& parsed_files) - : compiler_version_(compiler_version), - response_(response), - parsed_files_(parsed_files) {} - virtual ~GeneratorResponseContext() {} - - // implements GeneratorContext -------------------------------------- - - io::ZeroCopyOutputStream* Open(const std::string& filename) override { - CodeGeneratorResponse::File* file = response_->add_file(); - file->set_name(filename); - return new io::StringOutputStream(file->mutable_content()); - } - - io::ZeroCopyOutputStream* OpenForInsert( - const std::string& filename, - const std::string& insertion_point) override { - CodeGeneratorResponse::File* file = response_->add_file(); - file->set_name(filename); - file->set_insertion_point(insertion_point); - return new io::StringOutputStream(file->mutable_content()); - } - - io::ZeroCopyOutputStream* OpenForInsertWithGeneratedCodeInfo( - const std::string& filename, const std::string& insertion_point, - const google::protobuf::GeneratedCodeInfo& info) override { - CodeGeneratorResponse::File* file = response_->add_file(); - file->set_name(filename); - file->set_insertion_point(insertion_point); - *file->mutable_generated_code_info() = info; - return new io::StringOutputStream(file->mutable_content()); - } - - void ListParsedFiles(std::vector* output) override { - *output = parsed_files_; - } - - void GetCompilerVersion(Version* version) const override { - *version = compiler_version_; - } - - private: - Version compiler_version_; - CodeGeneratorResponse* response_; - const std::vector& parsed_files_; -}; - -bool GenerateCode(const CodeGeneratorRequest& request, - const CodeGenerator& generator, - CodeGeneratorResponse* response, std::string* error_msg) { - DescriptorPool pool; - for (int i = 0; i < request.proto_file_size(); i++) { - const FileDescriptor* file = pool.BuildFile(request.proto_file(i)); - if (file == NULL) { - // BuildFile() already wrote an error message. - return false; - } - } - - std::vector parsed_files; - for (int i = 0; i < request.file_to_generate_size(); i++) { - parsed_files.push_back(pool.FindFileByName(request.file_to_generate(i))); - if (parsed_files.back() == NULL) { - *error_msg = - "protoc asked plugin to generate a file but " - "did not provide a descriptor for the file: " + - request.file_to_generate(i); - return false; - } - } - - GeneratorResponseContext context(request.compiler_version(), response, - parsed_files); - - - std::string error; - bool succeeded = generator.GenerateAll(parsed_files, request.parameter(), - &context, &error); - - response->set_supported_features(generator.GetSupportedFeatures()); - - if (!succeeded && error.empty()) { - error = - "Code generator returned false but provided no error " - "description."; - } - if (!error.empty()) { - response->set_error(error); - } - - return true; -} - -int PluginMain(int argc, char* argv[], const CodeGenerator* generator) { - - if (argc > 1) { - std::cerr << argv[0] << ": Unknown option: " << argv[1] << std::endl; - return 1; - } - -#ifdef _WIN32 - setmode(STDIN_FILENO, _O_BINARY); - setmode(STDOUT_FILENO, _O_BINARY); -#endif - - CodeGeneratorRequest request; - if (!request.ParseFromFileDescriptor(STDIN_FILENO)) { - std::cerr << argv[0] << ": protoc sent unparseable request to plugin." - << std::endl; - return 1; - } - - - std::string error_msg; - CodeGeneratorResponse response; - - if (GenerateCode(request, *generator, &response, &error_msg)) { - if (!response.SerializeToFileDescriptor(STDOUT_FILENO)) { - std::cerr << argv[0] << ": Error writing to stdout." << std::endl; - return 1; - } - } else { - if (!error_msg.empty()) { - std::cerr << argv[0] << ": " << error_msg << std::endl; - } - return 1; - } - - return 0; -} - -} // namespace compiler -} // namespace protobuf -} // namespace google diff --git a/extra/protobuf/protobuf-3.19.4/src/google/protobuf/compiler/plugin.h b/extra/protobuf/protobuf-3.19.4/src/google/protobuf/compiler/plugin.h deleted file mode 100644 index 7d1bf450847e..000000000000 --- a/extra/protobuf/protobuf-3.19.4/src/google/protobuf/compiler/plugin.h +++ /dev/null @@ -1,95 +0,0 @@ -// Protocol Buffers - Google's data interchange format -// Copyright 2008 Google Inc. All rights reserved. -// https://developers.google.com/protocol-buffers/ -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// * Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// * Redistributions in binary form must reproduce the above -// copyright notice, this list of conditions and the following disclaimer -// in the documentation and/or other materials provided with the -// distribution. -// * Neither the name of Google Inc. nor the names of its -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -// Author: kenton@google.com (Kenton Varda) -// -// Front-end for protoc code generator plugins written in C++. -// -// To implement a protoc plugin in C++, simply write an implementation of -// CodeGenerator, then create a main() function like: -// int main(int argc, char* argv[]) { -// MyCodeGenerator generator; -// return google::protobuf::compiler::PluginMain(argc, argv, &generator); -// } -// You must link your plugin against libprotobuf and libprotoc. -// -// The core part of PluginMain is to invoke the given CodeGenerator on a -// CodeGeneratorRequest to generate a CodeGeneratorResponse. This part is -// abstracted out and made into function GenerateCode so that it can be reused, -// for example, to implement a variant of PluginMain that does some -// preprocessing on the input CodeGeneratorRequest before feeding the request -// to the given code generator. -// -// To get protoc to use the plugin, do one of the following: -// * Place the plugin binary somewhere in the PATH and give it the name -// "protoc-gen-NAME" (replacing "NAME" with the name of your plugin). If you -// then invoke protoc with the parameter --NAME_out=OUT_DIR (again, replace -// "NAME" with your plugin's name), protoc will invoke your plugin to generate -// the output, which will be placed in OUT_DIR. -// * Place the plugin binary anywhere, with any name, and pass the --plugin -// parameter to protoc to direct it to your plugin like so: -// protoc --plugin=protoc-gen-NAME=path/to/mybinary --NAME_out=OUT_DIR -// On Windows, make sure to include the .exe suffix: -// protoc --plugin=protoc-gen-NAME=path/to/mybinary.exe --NAME_out=OUT_DIR - -#ifndef GOOGLE_PROTOBUF_COMPILER_PLUGIN_H__ -#define GOOGLE_PROTOBUF_COMPILER_PLUGIN_H__ - -#include - -#include - -namespace google { -namespace protobuf { -namespace compiler { - -class CodeGenerator; // code_generator.h -class CodeGeneratorRequest; -class CodeGeneratorResponse; - -// Implements main() for a protoc plugin exposing the given code generator. -PROTOC_EXPORT int PluginMain(int argc, char* argv[], - const CodeGenerator* generator); - - -// Generates code using the given code generator. Returns true if the code -// generation is successful. If the code generation fails, error_msg may be -// populated to describe the failure cause. -bool GenerateCode(const CodeGeneratorRequest& request, - const CodeGenerator& generator, - CodeGeneratorResponse* response, std::string* error_msg); - -} // namespace compiler -} // namespace protobuf -} // namespace google - -#include - -#endif // GOOGLE_PROTOBUF_COMPILER_PLUGIN_H__ diff --git a/extra/protobuf/protobuf-3.19.4/src/google/protobuf/compiler/plugin.pb.cc b/extra/protobuf/protobuf-3.19.4/src/google/protobuf/compiler/plugin.pb.cc deleted file mode 100644 index e423e851be02..000000000000 --- a/extra/protobuf/protobuf-3.19.4/src/google/protobuf/compiler/plugin.pb.cc +++ /dev/null @@ -1,1584 +0,0 @@ -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: google/protobuf/compiler/plugin.proto - -#include - -#include - -#include -#include -#include -#include -#include -#include -#include -// @@protoc_insertion_point(includes) -#include - -PROTOBUF_PRAGMA_INIT_SEG -PROTOBUF_NAMESPACE_OPEN -namespace compiler { -constexpr Version::Version( - ::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized) - : suffix_(&::PROTOBUF_NAMESPACE_ID::internal::fixed_address_empty_string) - , major_(0) - , minor_(0) - , patch_(0){} -struct VersionDefaultTypeInternal { - constexpr VersionDefaultTypeInternal() - : _instance(::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized{}) {} - ~VersionDefaultTypeInternal() {} - union { - Version _instance; - }; -}; -PROTOBUF_ATTRIBUTE_NO_DESTROY PROTOBUF_CONSTINIT VersionDefaultTypeInternal _Version_default_instance_; -constexpr CodeGeneratorRequest::CodeGeneratorRequest( - ::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized) - : file_to_generate_() - , proto_file_() - , parameter_(&::PROTOBUF_NAMESPACE_ID::internal::fixed_address_empty_string) - , compiler_version_(nullptr){} -struct CodeGeneratorRequestDefaultTypeInternal { - constexpr CodeGeneratorRequestDefaultTypeInternal() - : _instance(::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized{}) {} - ~CodeGeneratorRequestDefaultTypeInternal() {} - union { - CodeGeneratorRequest _instance; - }; -}; -PROTOBUF_ATTRIBUTE_NO_DESTROY PROTOBUF_CONSTINIT CodeGeneratorRequestDefaultTypeInternal _CodeGeneratorRequest_default_instance_; -constexpr CodeGeneratorResponse_File::CodeGeneratorResponse_File( - ::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized) - : name_(&::PROTOBUF_NAMESPACE_ID::internal::fixed_address_empty_string) - , insertion_point_(&::PROTOBUF_NAMESPACE_ID::internal::fixed_address_empty_string) - , content_(&::PROTOBUF_NAMESPACE_ID::internal::fixed_address_empty_string) - , generated_code_info_(nullptr){} -struct CodeGeneratorResponse_FileDefaultTypeInternal { - constexpr CodeGeneratorResponse_FileDefaultTypeInternal() - : _instance(::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized{}) {} - ~CodeGeneratorResponse_FileDefaultTypeInternal() {} - union { - CodeGeneratorResponse_File _instance; - }; -}; -PROTOBUF_ATTRIBUTE_NO_DESTROY PROTOBUF_CONSTINIT CodeGeneratorResponse_FileDefaultTypeInternal _CodeGeneratorResponse_File_default_instance_; -constexpr CodeGeneratorResponse::CodeGeneratorResponse( - ::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized) - : file_() - , error_(&::PROTOBUF_NAMESPACE_ID::internal::fixed_address_empty_string) - , supported_features_(uint64_t{0u}){} -struct CodeGeneratorResponseDefaultTypeInternal { - constexpr CodeGeneratorResponseDefaultTypeInternal() - : _instance(::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized{}) {} - ~CodeGeneratorResponseDefaultTypeInternal() {} - union { - CodeGeneratorResponse _instance; - }; -}; -PROTOBUF_ATTRIBUTE_NO_DESTROY PROTOBUF_CONSTINIT CodeGeneratorResponseDefaultTypeInternal _CodeGeneratorResponse_default_instance_; -} // namespace compiler -PROTOBUF_NAMESPACE_CLOSE -static ::PROTOBUF_NAMESPACE_ID::Metadata file_level_metadata_google_2fprotobuf_2fcompiler_2fplugin_2eproto[4]; -static const ::PROTOBUF_NAMESPACE_ID::EnumDescriptor* file_level_enum_descriptors_google_2fprotobuf_2fcompiler_2fplugin_2eproto[1]; -static constexpr ::PROTOBUF_NAMESPACE_ID::ServiceDescriptor const** file_level_service_descriptors_google_2fprotobuf_2fcompiler_2fplugin_2eproto = nullptr; - -const uint32_t 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_), - ~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_), - 1, - 2, - 3, - 0, - 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_), - ~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_), - ~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_), - 0, - 1, - 2, - 3, - 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_), - 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)}, -}; - -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_), -}; - -const char descriptor_table_protodef_google_2fprotobuf_2fcompiler_2fplugin_2eproto[] PROTOBUF_SECTION_VARIABLE(protodesc_cold) = - "\n%google/protobuf/compiler/plugin.proto\022" - "\030google.protobuf.compiler\032 google/protob" - "uf/descriptor.proto\"F\n\007Version\022\r\n\005major\030" - "\001 \001(\005\022\r\n\005minor\030\002 \001(\005\022\r\n\005patch\030\003 \001(\005\022\016\n\006s" - "uffix\030\004 \001(\t\"\272\001\n\024CodeGeneratorRequest\022\030\n\020" - "file_to_generate\030\001 \003(\t\022\021\n\tparameter\030\002 \001(" - "\t\0228\n\nproto_file\030\017 \003(\0132$.google.protobuf." - "FileDescriptorProto\022;\n\020compiler_version\030" - "\003 \001(\0132!.google.protobuf.compiler.Version" - "\"\301\002\n\025CodeGeneratorResponse\022\r\n\005error\030\001 \001(" - "\t\022\032\n\022supported_features\030\002 \001(\004\022B\n\004file\030\017 " - "\003(\01324.google.protobuf.compiler.CodeGener" - "atorResponse.File\032\177\n\004File\022\014\n\004name\030\001 \001(\t\022" - "\027\n\017insertion_point\030\002 \001(\t\022\017\n\007content\030\017 \001(" - "\t\022\?\n\023generated_code_info\030\020 \001(\0132\".google." - "protobuf.GeneratedCodeInfo\"8\n\007Feature\022\020\n" - "\014FEATURE_NONE\020\000\022\033\n\027FEATURE_PROTO3_OPTION" - "AL\020\001BW\n\034com.google.protobuf.compilerB\014Pl" - "uginProtosZ)google.golang.org/protobuf/t" - "ypes/pluginpb" - ; -static const ::PROTOBUF_NAMESPACE_ID::internal::DescriptorTable*const descriptor_table_google_2fprotobuf_2fcompiler_2fplugin_2eproto_deps[1] = { - &::descriptor_table_google_2fprotobuf_2fdescriptor_2eproto, -}; -static ::PROTOBUF_NAMESPACE_ID::internal::once_flag descriptor_table_google_2fprotobuf_2fcompiler_2fplugin_2eproto_once; -const ::PROTOBUF_NAMESPACE_ID::internal::DescriptorTable descriptor_table_google_2fprotobuf_2fcompiler_2fplugin_2eproto = { - false, false, 773, descriptor_table_protodef_google_2fprotobuf_2fcompiler_2fplugin_2eproto, "google/protobuf/compiler/plugin.proto", - &descriptor_table_google_2fprotobuf_2fcompiler_2fplugin_2eproto_once, descriptor_table_google_2fprotobuf_2fcompiler_2fplugin_2eproto_deps, 1, 4, - schemas, file_default_instances, TableStruct_google_2fprotobuf_2fcompiler_2fplugin_2eproto::offsets, - file_level_metadata_google_2fprotobuf_2fcompiler_2fplugin_2eproto, file_level_enum_descriptors_google_2fprotobuf_2fcompiler_2fplugin_2eproto, file_level_service_descriptors_google_2fprotobuf_2fcompiler_2fplugin_2eproto, -}; -PROTOBUF_ATTRIBUTE_WEAK const ::PROTOBUF_NAMESPACE_ID::internal::DescriptorTable* descriptor_table_google_2fprotobuf_2fcompiler_2fplugin_2eproto_getter() { - return &descriptor_table_google_2fprotobuf_2fcompiler_2fplugin_2eproto; -} - -// Force running AddDescriptors() at dynamic initialization time. -PROTOBUF_ATTRIBUTE_INIT_PRIORITY static ::PROTOBUF_NAMESPACE_ID::internal::AddDescriptorsRunner dynamic_init_dummy_google_2fprotobuf_2fcompiler_2fplugin_2eproto(&descriptor_table_google_2fprotobuf_2fcompiler_2fplugin_2eproto); -PROTOBUF_NAMESPACE_OPEN -namespace compiler { -const ::PROTOBUF_NAMESPACE_ID::EnumDescriptor* CodeGeneratorResponse_Feature_descriptor() { - ::PROTOBUF_NAMESPACE_ID::internal::AssignDescriptors(&descriptor_table_google_2fprotobuf_2fcompiler_2fplugin_2eproto); - return file_level_enum_descriptors_google_2fprotobuf_2fcompiler_2fplugin_2eproto[0]; -} -bool CodeGeneratorResponse_Feature_IsValid(int value) { - switch (value) { - case 0: - case 1: - return true; - default: - return false; - } -} - -#if (__cplusplus < 201703) && (!defined(_MSC_VER) || (_MSC_VER >= 1900 && _MSC_VER < 1912)) -constexpr CodeGeneratorResponse_Feature CodeGeneratorResponse::FEATURE_NONE; -constexpr CodeGeneratorResponse_Feature CodeGeneratorResponse::FEATURE_PROTO3_OPTIONAL; -constexpr CodeGeneratorResponse_Feature CodeGeneratorResponse::Feature_MIN; -constexpr CodeGeneratorResponse_Feature CodeGeneratorResponse::Feature_MAX; -constexpr int CodeGeneratorResponse::Feature_ARRAYSIZE; -#endif // (__cplusplus < 201703) && (!defined(_MSC_VER) || (_MSC_VER >= 1900 && _MSC_VER < 1912)) - -// =================================================================== - -class Version::_Internal { - public: - using HasBits = decltype(std::declval()._has_bits_); - static void set_has_major(HasBits* has_bits) { - (*has_bits)[0] |= 2u; - } - static void set_has_minor(HasBits* has_bits) { - (*has_bits)[0] |= 4u; - } - static void set_has_patch(HasBits* has_bits) { - (*has_bits)[0] |= 8u; - } - static void set_has_suffix(HasBits* has_bits) { - (*has_bits)[0] |= 1u; - } -}; - -Version::Version(::PROTOBUF_NAMESPACE_ID::Arena* arena, - bool is_message_owned) - : ::PROTOBUF_NAMESPACE_ID::Message(arena, is_message_owned) { - SharedCtor(); - if (!is_message_owned) { - RegisterArenaDtor(arena); - } - // @@protoc_insertion_point(arena_constructor:google.protobuf.compiler.Version) -} -Version::Version(const Version& from) - : ::PROTOBUF_NAMESPACE_ID::Message(), - _has_bits_(from._has_bits_) { - _internal_metadata_.MergeFrom<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(from._internal_metadata_); - suffix_.UnsafeSetDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited()); - #ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING - suffix_.Set(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), "", GetArenaForAllocation()); - #endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING - if (from._internal_has_suffix()) { - suffix_.Set(::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::EmptyDefault{}, from._internal_suffix(), - GetArenaForAllocation()); - } - ::memcpy(&major_, &from.major_, - static_cast(reinterpret_cast(&patch_) - - reinterpret_cast(&major_)) + sizeof(patch_)); - // @@protoc_insertion_point(copy_constructor:google.protobuf.compiler.Version) -} - -inline void Version::SharedCtor() { -suffix_.UnsafeSetDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited()); -#ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING - suffix_.Set(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), "", GetArenaForAllocation()); -#endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING -::memset(reinterpret_cast(this) + static_cast( - reinterpret_cast(&major_) - reinterpret_cast(this)), - 0, static_cast(reinterpret_cast(&patch_) - - reinterpret_cast(&major_)) + sizeof(patch_)); -} - -Version::~Version() { - // @@protoc_insertion_point(destructor:google.protobuf.compiler.Version) - if (GetArenaForAllocation() != nullptr) return; - SharedDtor(); - _internal_metadata_.Delete<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(); -} - -inline void Version::SharedDtor() { - GOOGLE_DCHECK(GetArenaForAllocation() == nullptr); - suffix_.DestroyNoArena(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited()); -} - -void Version::ArenaDtor(void* object) { - Version* _this = reinterpret_cast< Version* >(object); - (void)_this; -} -void Version::RegisterArenaDtor(::PROTOBUF_NAMESPACE_ID::Arena*) { -} -void Version::SetCachedSize(int size) const { - _cached_size_.Set(size); -} - -void Version::Clear() { -// @@protoc_insertion_point(message_clear_start:google.protobuf.compiler.Version) - uint32_t cached_has_bits = 0; - // Prevent compiler warnings about cached_has_bits being unused - (void) cached_has_bits; - - cached_has_bits = _has_bits_[0]; - if (cached_has_bits & 0x00000001u) { - suffix_.ClearNonDefaultToEmpty(); - } - if (cached_has_bits & 0x0000000eu) { - ::memset(&major_, 0, static_cast( - reinterpret_cast(&patch_) - - reinterpret_cast(&major_)) + sizeof(patch_)); - } - _has_bits_.Clear(); - _internal_metadata_.Clear<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(); -} - -const char* Version::_InternalParse(const char* ptr, ::PROTOBUF_NAMESPACE_ID::internal::ParseContext* ctx) { -#define CHK_(x) if (PROTOBUF_PREDICT_FALSE(!(x))) goto failure - _Internal::HasBits has_bits{}; - while (!ctx->Done(&ptr)) { - uint32_t tag; - ptr = ::PROTOBUF_NAMESPACE_ID::internal::ReadTag(ptr, &tag); - switch (tag >> 3) { - // optional int32 major = 1; - case 1: - if (PROTOBUF_PREDICT_TRUE(static_cast(tag) == 8)) { - _Internal::set_has_major(&has_bits); - major_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint32(&ptr); - CHK_(ptr); - } else - goto handle_unusual; - continue; - // optional int32 minor = 2; - case 2: - if (PROTOBUF_PREDICT_TRUE(static_cast(tag) == 16)) { - _Internal::set_has_minor(&has_bits); - minor_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint32(&ptr); - CHK_(ptr); - } else - goto handle_unusual; - continue; - // optional int32 patch = 3; - case 3: - if (PROTOBUF_PREDICT_TRUE(static_cast(tag) == 24)) { - _Internal::set_has_patch(&has_bits); - patch_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint32(&ptr); - CHK_(ptr); - } else - goto handle_unusual; - continue; - // optional string suffix = 4; - case 4: - if (PROTOBUF_PREDICT_TRUE(static_cast(tag) == 34)) { - auto str = _internal_mutable_suffix(); - ptr = ::PROTOBUF_NAMESPACE_ID::internal::InlineGreedyStringParser(str, ptr, ctx); - #ifndef NDEBUG - ::PROTOBUF_NAMESPACE_ID::internal::VerifyUTF8(str, "google.protobuf.compiler.Version.suffix"); - #endif // !NDEBUG - CHK_(ptr); - } else - goto handle_unusual; - continue; - default: - goto handle_unusual; - } // switch - handle_unusual: - if ((tag == 0) || ((tag & 7) == 4)) { - CHK_(ptr); - ctx->SetLastTag(tag); - goto message_done; - } - ptr = UnknownFieldParse( - tag, - _internal_metadata_.mutable_unknown_fields<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(), - ptr, ctx); - CHK_(ptr != nullptr); - } // while -message_done: - _has_bits_.Or(has_bits); - return ptr; -failure: - ptr = nullptr; - goto message_done; -#undef CHK_ -} - -uint8_t* Version::_InternalSerialize( - uint8_t* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const { - // @@protoc_insertion_point(serialize_to_array_start:google.protobuf.compiler.Version) - uint32_t cached_has_bits = 0; - (void) cached_has_bits; - - cached_has_bits = _has_bits_[0]; - // optional int32 major = 1; - if (cached_has_bits & 0x00000002u) { - target = stream->EnsureSpace(target); - target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteInt32ToArray(1, this->_internal_major(), target); - } - - // optional int32 minor = 2; - if (cached_has_bits & 0x00000004u) { - target = stream->EnsureSpace(target); - target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteInt32ToArray(2, this->_internal_minor(), target); - } - - // optional int32 patch = 3; - if (cached_has_bits & 0x00000008u) { - target = stream->EnsureSpace(target); - target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteInt32ToArray(3, this->_internal_patch(), target); - } - - // optional string suffix = 4; - if (cached_has_bits & 0x00000001u) { - ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::VerifyUTF8StringNamedField( - this->_internal_suffix().data(), static_cast(this->_internal_suffix().length()), - ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::SERIALIZE, - "google.protobuf.compiler.Version.suffix"); - target = stream->WriteStringMaybeAliased( - 4, this->_internal_suffix(), target); - } - - if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) { - target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::InternalSerializeUnknownFieldsToArray( - _internal_metadata_.unknown_fields<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(::PROTOBUF_NAMESPACE_ID::UnknownFieldSet::default_instance), target, stream); - } - // @@protoc_insertion_point(serialize_to_array_end:google.protobuf.compiler.Version) - return target; -} - -size_t Version::ByteSizeLong() const { -// @@protoc_insertion_point(message_byte_size_start:google.protobuf.compiler.Version) - size_t total_size = 0; - - uint32_t cached_has_bits = 0; - // Prevent compiler warnings about cached_has_bits being unused - (void) cached_has_bits; - - cached_has_bits = _has_bits_[0]; - if (cached_has_bits & 0x0000000fu) { - // optional string suffix = 4; - if (cached_has_bits & 0x00000001u) { - total_size += 1 + - ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::StringSize( - this->_internal_suffix()); - } - - // optional int32 major = 1; - if (cached_has_bits & 0x00000002u) { - total_size += ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::Int32SizePlusOne(this->_internal_major()); - } - - // optional int32 minor = 2; - if (cached_has_bits & 0x00000004u) { - total_size += ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::Int32SizePlusOne(this->_internal_minor()); - } - - // optional int32 patch = 3; - if (cached_has_bits & 0x00000008u) { - total_size += ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::Int32SizePlusOne(this->_internal_patch()); - } - - } - return MaybeComputeUnknownFieldsSize(total_size, &_cached_size_); -} - -const ::PROTOBUF_NAMESPACE_ID::Message::ClassData Version::_class_data_ = { - ::PROTOBUF_NAMESPACE_ID::Message::CopyWithSizeCheck, - Version::MergeImpl -}; -const ::PROTOBUF_NAMESPACE_ID::Message::ClassData*Version::GetClassData() const { return &_class_data_; } - -void Version::MergeImpl(::PROTOBUF_NAMESPACE_ID::Message* to, - const ::PROTOBUF_NAMESPACE_ID::Message& from) { - static_cast(to)->MergeFrom( - static_cast(from)); -} - - -void Version::MergeFrom(const Version& from) { -// @@protoc_insertion_point(class_specific_merge_from_start:google.protobuf.compiler.Version) - GOOGLE_DCHECK_NE(&from, this); - uint32_t cached_has_bits = 0; - (void) cached_has_bits; - - cached_has_bits = from._has_bits_[0]; - if (cached_has_bits & 0x0000000fu) { - if (cached_has_bits & 0x00000001u) { - _internal_set_suffix(from._internal_suffix()); - } - if (cached_has_bits & 0x00000002u) { - major_ = from.major_; - } - if (cached_has_bits & 0x00000004u) { - minor_ = from.minor_; - } - if (cached_has_bits & 0x00000008u) { - patch_ = from.patch_; - } - _has_bits_[0] |= cached_has_bits; - } - _internal_metadata_.MergeFrom<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(from._internal_metadata_); -} - -void Version::CopyFrom(const Version& from) { -// @@protoc_insertion_point(class_specific_copy_from_start:google.protobuf.compiler.Version) - if (&from == this) return; - Clear(); - MergeFrom(from); -} - -bool Version::IsInitialized() const { - return true; -} - -void Version::InternalSwap(Version* other) { - using std::swap; - auto* lhs_arena = GetArenaForAllocation(); - auto* rhs_arena = other->GetArenaForAllocation(); - _internal_metadata_.InternalSwap(&other->_internal_metadata_); - swap(_has_bits_[0], other->_has_bits_[0]); - ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::InternalSwap( - &::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), - &suffix_, lhs_arena, - &other->suffix_, rhs_arena - ); - ::PROTOBUF_NAMESPACE_ID::internal::memswap< - PROTOBUF_FIELD_OFFSET(Version, patch_) - + sizeof(Version::patch_) - - PROTOBUF_FIELD_OFFSET(Version, major_)>( - reinterpret_cast(&major_), - reinterpret_cast(&other->major_)); -} - -::PROTOBUF_NAMESPACE_ID::Metadata Version::GetMetadata() const { - return ::PROTOBUF_NAMESPACE_ID::internal::AssignDescriptors( - &descriptor_table_google_2fprotobuf_2fcompiler_2fplugin_2eproto_getter, &descriptor_table_google_2fprotobuf_2fcompiler_2fplugin_2eproto_once, - file_level_metadata_google_2fprotobuf_2fcompiler_2fplugin_2eproto[0]); -} - -// =================================================================== - -class CodeGeneratorRequest::_Internal { - public: - using HasBits = decltype(std::declval()._has_bits_); - 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 void set_has_compiler_version(HasBits* has_bits) { - (*has_bits)[0] |= 2u; - } -}; - -const ::PROTOBUF_NAMESPACE_ID::compiler::Version& -CodeGeneratorRequest::_Internal::compiler_version(const CodeGeneratorRequest* msg) { - return *msg->compiler_version_; -} -void CodeGeneratorRequest::clear_proto_file() { - proto_file_.Clear(); -} -CodeGeneratorRequest::CodeGeneratorRequest(::PROTOBUF_NAMESPACE_ID::Arena* arena, - bool is_message_owned) - : ::PROTOBUF_NAMESPACE_ID::Message(arena, is_message_owned), - file_to_generate_(arena), - proto_file_(arena) { - SharedCtor(); - if (!is_message_owned) { - RegisterArenaDtor(arena); - } - // @@protoc_insertion_point(arena_constructor:google.protobuf.compiler.CodeGeneratorRequest) -} -CodeGeneratorRequest::CodeGeneratorRequest(const CodeGeneratorRequest& from) - : ::PROTOBUF_NAMESPACE_ID::Message(), - _has_bits_(from._has_bits_), - file_to_generate_(from.file_to_generate_), - proto_file_(from.proto_file_) { - _internal_metadata_.MergeFrom<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(from._internal_metadata_); - parameter_.UnsafeSetDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited()); - #ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING - parameter_.Set(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), "", GetArenaForAllocation()); - #endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING - if (from._internal_has_parameter()) { - parameter_.Set(::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::EmptyDefault{}, from._internal_parameter(), - GetArenaForAllocation()); - } - if (from._internal_has_compiler_version()) { - compiler_version_ = new ::PROTOBUF_NAMESPACE_ID::compiler::Version(*from.compiler_version_); - } else { - compiler_version_ = nullptr; - } - // @@protoc_insertion_point(copy_constructor:google.protobuf.compiler.CodeGeneratorRequest) -} - -inline void CodeGeneratorRequest::SharedCtor() { -parameter_.UnsafeSetDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited()); -#ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING - parameter_.Set(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), "", GetArenaForAllocation()); -#endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING -compiler_version_ = nullptr; -} - -CodeGeneratorRequest::~CodeGeneratorRequest() { - // @@protoc_insertion_point(destructor:google.protobuf.compiler.CodeGeneratorRequest) - if (GetArenaForAllocation() != nullptr) return; - SharedDtor(); - _internal_metadata_.Delete<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(); -} - -inline void CodeGeneratorRequest::SharedDtor() { - GOOGLE_DCHECK(GetArenaForAllocation() == nullptr); - parameter_.DestroyNoArena(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited()); - if (this != internal_default_instance()) delete compiler_version_; -} - -void CodeGeneratorRequest::ArenaDtor(void* object) { - CodeGeneratorRequest* _this = reinterpret_cast< CodeGeneratorRequest* >(object); - (void)_this; -} -void CodeGeneratorRequest::RegisterArenaDtor(::PROTOBUF_NAMESPACE_ID::Arena*) { -} -void CodeGeneratorRequest::SetCachedSize(int size) const { - _cached_size_.Set(size); -} - -void CodeGeneratorRequest::Clear() { -// @@protoc_insertion_point(message_clear_start:google.protobuf.compiler.CodeGeneratorRequest) - uint32_t cached_has_bits = 0; - // Prevent compiler warnings about cached_has_bits being unused - (void) cached_has_bits; - - file_to_generate_.Clear(); - proto_file_.Clear(); - cached_has_bits = _has_bits_[0]; - if (cached_has_bits & 0x00000003u) { - if (cached_has_bits & 0x00000001u) { - parameter_.ClearNonDefaultToEmpty(); - } - if (cached_has_bits & 0x00000002u) { - GOOGLE_DCHECK(compiler_version_ != nullptr); - compiler_version_->Clear(); - } - } - _has_bits_.Clear(); - _internal_metadata_.Clear<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(); -} - -const char* CodeGeneratorRequest::_InternalParse(const char* ptr, ::PROTOBUF_NAMESPACE_ID::internal::ParseContext* ctx) { -#define CHK_(x) if (PROTOBUF_PREDICT_FALSE(!(x))) goto failure - _Internal::HasBits has_bits{}; - while (!ctx->Done(&ptr)) { - uint32_t tag; - ptr = ::PROTOBUF_NAMESPACE_ID::internal::ReadTag(ptr, &tag); - switch (tag >> 3) { - // repeated string file_to_generate = 1; - case 1: - if (PROTOBUF_PREDICT_TRUE(static_cast(tag) == 10)) { - ptr -= 1; - do { - ptr += 1; - auto str = _internal_add_file_to_generate(); - ptr = ::PROTOBUF_NAMESPACE_ID::internal::InlineGreedyStringParser(str, ptr, ctx); - #ifndef NDEBUG - ::PROTOBUF_NAMESPACE_ID::internal::VerifyUTF8(str, "google.protobuf.compiler.CodeGeneratorRequest.file_to_generate"); - #endif // !NDEBUG - CHK_(ptr); - if (!ctx->DataAvailable(ptr)) break; - } while (::PROTOBUF_NAMESPACE_ID::internal::ExpectTag<10>(ptr)); - } else - goto handle_unusual; - continue; - // optional string parameter = 2; - case 2: - if (PROTOBUF_PREDICT_TRUE(static_cast(tag) == 18)) { - auto str = _internal_mutable_parameter(); - ptr = ::PROTOBUF_NAMESPACE_ID::internal::InlineGreedyStringParser(str, ptr, ctx); - #ifndef NDEBUG - ::PROTOBUF_NAMESPACE_ID::internal::VerifyUTF8(str, "google.protobuf.compiler.CodeGeneratorRequest.parameter"); - #endif // !NDEBUG - CHK_(ptr); - } else - goto handle_unusual; - continue; - // optional .google.protobuf.compiler.Version compiler_version = 3; - case 3: - if (PROTOBUF_PREDICT_TRUE(static_cast(tag) == 26)) { - ptr = ctx->ParseMessage(_internal_mutable_compiler_version(), ptr); - CHK_(ptr); - } else - goto handle_unusual; - continue; - // repeated .google.protobuf.FileDescriptorProto proto_file = 15; - case 15: - if (PROTOBUF_PREDICT_TRUE(static_cast(tag) == 122)) { - ptr -= 1; - do { - ptr += 1; - ptr = ctx->ParseMessage(_internal_add_proto_file(), ptr); - CHK_(ptr); - if (!ctx->DataAvailable(ptr)) break; - } while (::PROTOBUF_NAMESPACE_ID::internal::ExpectTag<122>(ptr)); - } else - goto handle_unusual; - continue; - default: - goto handle_unusual; - } // switch - handle_unusual: - if ((tag == 0) || ((tag & 7) == 4)) { - CHK_(ptr); - ctx->SetLastTag(tag); - goto message_done; - } - ptr = UnknownFieldParse( - tag, - _internal_metadata_.mutable_unknown_fields<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(), - ptr, ctx); - CHK_(ptr != nullptr); - } // while -message_done: - _has_bits_.Or(has_bits); - return ptr; -failure: - ptr = nullptr; - goto message_done; -#undef CHK_ -} - -uint8_t* CodeGeneratorRequest::_InternalSerialize( - uint8_t* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const { - // @@protoc_insertion_point(serialize_to_array_start:google.protobuf.compiler.CodeGeneratorRequest) - uint32_t cached_has_bits = 0; - (void) cached_has_bits; - - // repeated string file_to_generate = 1; - for (int i = 0, n = this->_internal_file_to_generate_size(); i < n; i++) { - const auto& s = this->_internal_file_to_generate(i); - ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::VerifyUTF8StringNamedField( - s.data(), static_cast(s.length()), - ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::SERIALIZE, - "google.protobuf.compiler.CodeGeneratorRequest.file_to_generate"); - target = stream->WriteString(1, s, target); - } - - cached_has_bits = _has_bits_[0]; - // optional string parameter = 2; - if (cached_has_bits & 0x00000001u) { - ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::VerifyUTF8StringNamedField( - this->_internal_parameter().data(), static_cast(this->_internal_parameter().length()), - ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::SERIALIZE, - "google.protobuf.compiler.CodeGeneratorRequest.parameter"); - target = stream->WriteStringMaybeAliased( - 2, this->_internal_parameter(), target); - } - - // optional .google.protobuf.compiler.Version compiler_version = 3; - if (cached_has_bits & 0x00000002u) { - target = stream->EnsureSpace(target); - target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite:: - InternalWriteMessage( - 3, _Internal::compiler_version(this), target, stream); - } - - // repeated .google.protobuf.FileDescriptorProto proto_file = 15; - for (unsigned int i = 0, - n = static_cast(this->_internal_proto_file_size()); i < n; i++) { - target = stream->EnsureSpace(target); - target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite:: - InternalWriteMessage(15, this->_internal_proto_file(i), target, stream); - } - - if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) { - target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::InternalSerializeUnknownFieldsToArray( - _internal_metadata_.unknown_fields<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(::PROTOBUF_NAMESPACE_ID::UnknownFieldSet::default_instance), target, stream); - } - // @@protoc_insertion_point(serialize_to_array_end:google.protobuf.compiler.CodeGeneratorRequest) - return target; -} - -size_t CodeGeneratorRequest::ByteSizeLong() const { -// @@protoc_insertion_point(message_byte_size_start:google.protobuf.compiler.CodeGeneratorRequest) - size_t total_size = 0; - - uint32_t cached_has_bits = 0; - // Prevent compiler warnings about cached_has_bits being unused - (void) cached_has_bits; - - // repeated string file_to_generate = 1; - total_size += 1 * - ::PROTOBUF_NAMESPACE_ID::internal::FromIntSize(file_to_generate_.size()); - for (int i = 0, n = file_to_generate_.size(); i < n; i++) { - total_size += ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::StringSize( - file_to_generate_.Get(i)); - } - - // repeated .google.protobuf.FileDescriptorProto proto_file = 15; - total_size += 1UL * this->_internal_proto_file_size(); - for (const auto& msg : this->proto_file_) { - total_size += - ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::MessageSize(msg); - } - - cached_has_bits = _has_bits_[0]; - if (cached_has_bits & 0x00000003u) { - // optional string parameter = 2; - if (cached_has_bits & 0x00000001u) { - total_size += 1 + - ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::StringSize( - this->_internal_parameter()); - } - - // optional .google.protobuf.compiler.Version compiler_version = 3; - if (cached_has_bits & 0x00000002u) { - total_size += 1 + - ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::MessageSize( - *compiler_version_); - } - - } - return MaybeComputeUnknownFieldsSize(total_size, &_cached_size_); -} - -const ::PROTOBUF_NAMESPACE_ID::Message::ClassData CodeGeneratorRequest::_class_data_ = { - ::PROTOBUF_NAMESPACE_ID::Message::CopyWithSizeCheck, - CodeGeneratorRequest::MergeImpl -}; -const ::PROTOBUF_NAMESPACE_ID::Message::ClassData*CodeGeneratorRequest::GetClassData() const { return &_class_data_; } - -void CodeGeneratorRequest::MergeImpl(::PROTOBUF_NAMESPACE_ID::Message* to, - const ::PROTOBUF_NAMESPACE_ID::Message& from) { - static_cast(to)->MergeFrom( - static_cast(from)); -} - - -void CodeGeneratorRequest::MergeFrom(const CodeGeneratorRequest& from) { -// @@protoc_insertion_point(class_specific_merge_from_start:google.protobuf.compiler.CodeGeneratorRequest) - GOOGLE_DCHECK_NE(&from, this); - uint32_t cached_has_bits = 0; - (void) cached_has_bits; - - file_to_generate_.MergeFrom(from.file_to_generate_); - proto_file_.MergeFrom(from.proto_file_); - cached_has_bits = from._has_bits_[0]; - if (cached_has_bits & 0x00000003u) { - if (cached_has_bits & 0x00000001u) { - _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_metadata_.MergeFrom<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(from._internal_metadata_); -} - -void CodeGeneratorRequest::CopyFrom(const CodeGeneratorRequest& from) { -// @@protoc_insertion_point(class_specific_copy_from_start:google.protobuf.compiler.CodeGeneratorRequest) - if (&from == this) return; - Clear(); - MergeFrom(from); -} - -bool CodeGeneratorRequest::IsInitialized() const { - if (!::PROTOBUF_NAMESPACE_ID::internal::AllAreInitialized(proto_file_)) - return false; - return true; -} - -void CodeGeneratorRequest::InternalSwap(CodeGeneratorRequest* other) { - using std::swap; - auto* lhs_arena = GetArenaForAllocation(); - auto* rhs_arena = other->GetArenaForAllocation(); - _internal_metadata_.InternalSwap(&other->_internal_metadata_); - swap(_has_bits_[0], other->_has_bits_[0]); - file_to_generate_.InternalSwap(&other->file_to_generate_); - proto_file_.InternalSwap(&other->proto_file_); - ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::InternalSwap( - &::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), - ¶meter_, lhs_arena, - &other->parameter_, rhs_arena - ); - swap(compiler_version_, other->compiler_version_); -} - -::PROTOBUF_NAMESPACE_ID::Metadata CodeGeneratorRequest::GetMetadata() const { - return ::PROTOBUF_NAMESPACE_ID::internal::AssignDescriptors( - &descriptor_table_google_2fprotobuf_2fcompiler_2fplugin_2eproto_getter, &descriptor_table_google_2fprotobuf_2fcompiler_2fplugin_2eproto_once, - file_level_metadata_google_2fprotobuf_2fcompiler_2fplugin_2eproto[1]); -} - -// =================================================================== - -class CodeGeneratorResponse_File::_Internal { - public: - using HasBits = decltype(std::declval()._has_bits_); - static void set_has_name(HasBits* has_bits) { - (*has_bits)[0] |= 1u; - } - static void set_has_insertion_point(HasBits* has_bits) { - (*has_bits)[0] |= 2u; - } - 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 void set_has_generated_code_info(HasBits* has_bits) { - (*has_bits)[0] |= 8u; - } -}; - -const ::PROTOBUF_NAMESPACE_ID::GeneratedCodeInfo& -CodeGeneratorResponse_File::_Internal::generated_code_info(const CodeGeneratorResponse_File* msg) { - return *msg->generated_code_info_; -} -void CodeGeneratorResponse_File::clear_generated_code_info() { - if (generated_code_info_ != nullptr) generated_code_info_->Clear(); - _has_bits_[0] &= ~0x00000008u; -} -CodeGeneratorResponse_File::CodeGeneratorResponse_File(::PROTOBUF_NAMESPACE_ID::Arena* arena, - bool is_message_owned) - : ::PROTOBUF_NAMESPACE_ID::Message(arena, is_message_owned) { - SharedCtor(); - if (!is_message_owned) { - RegisterArenaDtor(arena); - } - // @@protoc_insertion_point(arena_constructor:google.protobuf.compiler.CodeGeneratorResponse.File) -} -CodeGeneratorResponse_File::CodeGeneratorResponse_File(const CodeGeneratorResponse_File& from) - : ::PROTOBUF_NAMESPACE_ID::Message(), - _has_bits_(from._has_bits_) { - _internal_metadata_.MergeFrom<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(from._internal_metadata_); - name_.UnsafeSetDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited()); - #ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING - name_.Set(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), "", GetArenaForAllocation()); - #endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING - if (from._internal_has_name()) { - name_.Set(::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::EmptyDefault{}, from._internal_name(), - GetArenaForAllocation()); - } - insertion_point_.UnsafeSetDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited()); - #ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING - insertion_point_.Set(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), "", GetArenaForAllocation()); - #endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING - if (from._internal_has_insertion_point()) { - insertion_point_.Set(::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::EmptyDefault{}, from._internal_insertion_point(), - GetArenaForAllocation()); - } - content_.UnsafeSetDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited()); - #ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING - content_.Set(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), "", GetArenaForAllocation()); - #endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING - if (from._internal_has_content()) { - content_.Set(::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::EmptyDefault{}, from._internal_content(), - GetArenaForAllocation()); - } - if (from._internal_has_generated_code_info()) { - generated_code_info_ = new ::PROTOBUF_NAMESPACE_ID::GeneratedCodeInfo(*from.generated_code_info_); - } else { - generated_code_info_ = nullptr; - } - // @@protoc_insertion_point(copy_constructor:google.protobuf.compiler.CodeGeneratorResponse.File) -} - -inline void CodeGeneratorResponse_File::SharedCtor() { -name_.UnsafeSetDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited()); -#ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING - name_.Set(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), "", GetArenaForAllocation()); -#endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING -insertion_point_.UnsafeSetDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited()); -#ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING - insertion_point_.Set(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), "", GetArenaForAllocation()); -#endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING -content_.UnsafeSetDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited()); -#ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING - content_.Set(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), "", GetArenaForAllocation()); -#endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING -generated_code_info_ = nullptr; -} - -CodeGeneratorResponse_File::~CodeGeneratorResponse_File() { - // @@protoc_insertion_point(destructor:google.protobuf.compiler.CodeGeneratorResponse.File) - if (GetArenaForAllocation() != nullptr) return; - SharedDtor(); - _internal_metadata_.Delete<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(); -} - -inline void CodeGeneratorResponse_File::SharedDtor() { - GOOGLE_DCHECK(GetArenaForAllocation() == nullptr); - name_.DestroyNoArena(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited()); - insertion_point_.DestroyNoArena(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited()); - content_.DestroyNoArena(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited()); - if (this != internal_default_instance()) delete generated_code_info_; -} - -void CodeGeneratorResponse_File::ArenaDtor(void* object) { - CodeGeneratorResponse_File* _this = reinterpret_cast< CodeGeneratorResponse_File* >(object); - (void)_this; -} -void CodeGeneratorResponse_File::RegisterArenaDtor(::PROTOBUF_NAMESPACE_ID::Arena*) { -} -void CodeGeneratorResponse_File::SetCachedSize(int size) const { - _cached_size_.Set(size); -} - -void CodeGeneratorResponse_File::Clear() { -// @@protoc_insertion_point(message_clear_start:google.protobuf.compiler.CodeGeneratorResponse.File) - uint32_t cached_has_bits = 0; - // Prevent compiler warnings about cached_has_bits being unused - (void) cached_has_bits; - - cached_has_bits = _has_bits_[0]; - if (cached_has_bits & 0x0000000fu) { - if (cached_has_bits & 0x00000001u) { - name_.ClearNonDefaultToEmpty(); - } - if (cached_has_bits & 0x00000002u) { - insertion_point_.ClearNonDefaultToEmpty(); - } - if (cached_has_bits & 0x00000004u) { - content_.ClearNonDefaultToEmpty(); - } - if (cached_has_bits & 0x00000008u) { - GOOGLE_DCHECK(generated_code_info_ != nullptr); - generated_code_info_->Clear(); - } - } - _has_bits_.Clear(); - _internal_metadata_.Clear<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(); -} - -const char* CodeGeneratorResponse_File::_InternalParse(const char* ptr, ::PROTOBUF_NAMESPACE_ID::internal::ParseContext* ctx) { -#define CHK_(x) if (PROTOBUF_PREDICT_FALSE(!(x))) goto failure - _Internal::HasBits has_bits{}; - while (!ctx->Done(&ptr)) { - uint32_t tag; - ptr = ::PROTOBUF_NAMESPACE_ID::internal::ReadTag(ptr, &tag); - switch (tag >> 3) { - // optional string name = 1; - case 1: - if (PROTOBUF_PREDICT_TRUE(static_cast(tag) == 10)) { - auto str = _internal_mutable_name(); - ptr = ::PROTOBUF_NAMESPACE_ID::internal::InlineGreedyStringParser(str, ptr, ctx); - #ifndef NDEBUG - ::PROTOBUF_NAMESPACE_ID::internal::VerifyUTF8(str, "google.protobuf.compiler.CodeGeneratorResponse.File.name"); - #endif // !NDEBUG - CHK_(ptr); - } else - goto handle_unusual; - continue; - // optional string insertion_point = 2; - case 2: - if (PROTOBUF_PREDICT_TRUE(static_cast(tag) == 18)) { - auto str = _internal_mutable_insertion_point(); - ptr = ::PROTOBUF_NAMESPACE_ID::internal::InlineGreedyStringParser(str, ptr, ctx); - #ifndef NDEBUG - ::PROTOBUF_NAMESPACE_ID::internal::VerifyUTF8(str, "google.protobuf.compiler.CodeGeneratorResponse.File.insertion_point"); - #endif // !NDEBUG - CHK_(ptr); - } else - goto handle_unusual; - continue; - // optional string content = 15; - case 15: - if (PROTOBUF_PREDICT_TRUE(static_cast(tag) == 122)) { - auto str = _internal_mutable_content(); - ptr = ::PROTOBUF_NAMESPACE_ID::internal::InlineGreedyStringParser(str, ptr, ctx); - #ifndef NDEBUG - ::PROTOBUF_NAMESPACE_ID::internal::VerifyUTF8(str, "google.protobuf.compiler.CodeGeneratorResponse.File.content"); - #endif // !NDEBUG - CHK_(ptr); - } else - goto handle_unusual; - continue; - // optional .google.protobuf.GeneratedCodeInfo generated_code_info = 16; - case 16: - if (PROTOBUF_PREDICT_TRUE(static_cast(tag) == 130)) { - ptr = ctx->ParseMessage(_internal_mutable_generated_code_info(), ptr); - CHK_(ptr); - } else - goto handle_unusual; - continue; - default: - goto handle_unusual; - } // switch - handle_unusual: - if ((tag == 0) || ((tag & 7) == 4)) { - CHK_(ptr); - ctx->SetLastTag(tag); - goto message_done; - } - ptr = UnknownFieldParse( - tag, - _internal_metadata_.mutable_unknown_fields<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(), - ptr, ctx); - CHK_(ptr != nullptr); - } // while -message_done: - _has_bits_.Or(has_bits); - return ptr; -failure: - ptr = nullptr; - goto message_done; -#undef CHK_ -} - -uint8_t* CodeGeneratorResponse_File::_InternalSerialize( - uint8_t* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const { - // @@protoc_insertion_point(serialize_to_array_start:google.protobuf.compiler.CodeGeneratorResponse.File) - uint32_t cached_has_bits = 0; - (void) cached_has_bits; - - cached_has_bits = _has_bits_[0]; - // optional string name = 1; - if (cached_has_bits & 0x00000001u) { - ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::VerifyUTF8StringNamedField( - this->_internal_name().data(), static_cast(this->_internal_name().length()), - ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::SERIALIZE, - "google.protobuf.compiler.CodeGeneratorResponse.File.name"); - target = stream->WriteStringMaybeAliased( - 1, this->_internal_name(), target); - } - - // optional string insertion_point = 2; - if (cached_has_bits & 0x00000002u) { - ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::VerifyUTF8StringNamedField( - this->_internal_insertion_point().data(), static_cast(this->_internal_insertion_point().length()), - ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::SERIALIZE, - "google.protobuf.compiler.CodeGeneratorResponse.File.insertion_point"); - target = stream->WriteStringMaybeAliased( - 2, this->_internal_insertion_point(), target); - } - - // optional string content = 15; - if (cached_has_bits & 0x00000004u) { - ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::VerifyUTF8StringNamedField( - this->_internal_content().data(), static_cast(this->_internal_content().length()), - ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::SERIALIZE, - "google.protobuf.compiler.CodeGeneratorResponse.File.content"); - target = stream->WriteStringMaybeAliased( - 15, this->_internal_content(), target); - } - - // optional .google.protobuf.GeneratedCodeInfo generated_code_info = 16; - if (cached_has_bits & 0x00000008u) { - target = stream->EnsureSpace(target); - target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite:: - InternalWriteMessage( - 16, _Internal::generated_code_info(this), target, stream); - } - - if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) { - target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::InternalSerializeUnknownFieldsToArray( - _internal_metadata_.unknown_fields<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(::PROTOBUF_NAMESPACE_ID::UnknownFieldSet::default_instance), target, stream); - } - // @@protoc_insertion_point(serialize_to_array_end:google.protobuf.compiler.CodeGeneratorResponse.File) - return target; -} - -size_t CodeGeneratorResponse_File::ByteSizeLong() const { -// @@protoc_insertion_point(message_byte_size_start:google.protobuf.compiler.CodeGeneratorResponse.File) - size_t total_size = 0; - - uint32_t cached_has_bits = 0; - // Prevent compiler warnings about cached_has_bits being unused - (void) cached_has_bits; - - cached_has_bits = _has_bits_[0]; - if (cached_has_bits & 0x0000000fu) { - // optional string name = 1; - if (cached_has_bits & 0x00000001u) { - total_size += 1 + - ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::StringSize( - this->_internal_name()); - } - - // optional string insertion_point = 2; - if (cached_has_bits & 0x00000002u) { - total_size += 1 + - ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::StringSize( - this->_internal_insertion_point()); - } - - // optional string content = 15; - if (cached_has_bits & 0x00000004u) { - total_size += 1 + - ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::StringSize( - this->_internal_content()); - } - - // optional .google.protobuf.GeneratedCodeInfo generated_code_info = 16; - if (cached_has_bits & 0x00000008u) { - total_size += 2 + - ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::MessageSize( - *generated_code_info_); - } - - } - return MaybeComputeUnknownFieldsSize(total_size, &_cached_size_); -} - -const ::PROTOBUF_NAMESPACE_ID::Message::ClassData CodeGeneratorResponse_File::_class_data_ = { - ::PROTOBUF_NAMESPACE_ID::Message::CopyWithSizeCheck, - CodeGeneratorResponse_File::MergeImpl -}; -const ::PROTOBUF_NAMESPACE_ID::Message::ClassData*CodeGeneratorResponse_File::GetClassData() const { return &_class_data_; } - -void CodeGeneratorResponse_File::MergeImpl(::PROTOBUF_NAMESPACE_ID::Message* to, - const ::PROTOBUF_NAMESPACE_ID::Message& from) { - static_cast(to)->MergeFrom( - static_cast(from)); -} - - -void CodeGeneratorResponse_File::MergeFrom(const CodeGeneratorResponse_File& from) { -// @@protoc_insertion_point(class_specific_merge_from_start:google.protobuf.compiler.CodeGeneratorResponse.File) - GOOGLE_DCHECK_NE(&from, this); - uint32_t cached_has_bits = 0; - (void) cached_has_bits; - - cached_has_bits = from._has_bits_[0]; - if (cached_has_bits & 0x0000000fu) { - if (cached_has_bits & 0x00000001u) { - _internal_set_name(from._internal_name()); - } - if (cached_has_bits & 0x00000002u) { - _internal_set_insertion_point(from._internal_insertion_point()); - } - if (cached_has_bits & 0x00000004u) { - _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_metadata_.MergeFrom<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(from._internal_metadata_); -} - -void CodeGeneratorResponse_File::CopyFrom(const CodeGeneratorResponse_File& from) { -// @@protoc_insertion_point(class_specific_copy_from_start:google.protobuf.compiler.CodeGeneratorResponse.File) - if (&from == this) return; - Clear(); - MergeFrom(from); -} - -bool CodeGeneratorResponse_File::IsInitialized() const { - return true; -} - -void CodeGeneratorResponse_File::InternalSwap(CodeGeneratorResponse_File* other) { - using std::swap; - auto* lhs_arena = GetArenaForAllocation(); - auto* rhs_arena = other->GetArenaForAllocation(); - _internal_metadata_.InternalSwap(&other->_internal_metadata_); - swap(_has_bits_[0], other->_has_bits_[0]); - ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::InternalSwap( - &::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), - &name_, lhs_arena, - &other->name_, rhs_arena - ); - ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::InternalSwap( - &::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), - &insertion_point_, lhs_arena, - &other->insertion_point_, rhs_arena - ); - ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::InternalSwap( - &::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), - &content_, lhs_arena, - &other->content_, rhs_arena - ); - swap(generated_code_info_, other->generated_code_info_); -} - -::PROTOBUF_NAMESPACE_ID::Metadata CodeGeneratorResponse_File::GetMetadata() const { - return ::PROTOBUF_NAMESPACE_ID::internal::AssignDescriptors( - &descriptor_table_google_2fprotobuf_2fcompiler_2fplugin_2eproto_getter, &descriptor_table_google_2fprotobuf_2fcompiler_2fplugin_2eproto_once, - file_level_metadata_google_2fprotobuf_2fcompiler_2fplugin_2eproto[2]); -} - -// =================================================================== - -class CodeGeneratorResponse::_Internal { - public: - using HasBits = decltype(std::declval()._has_bits_); - static void set_has_error(HasBits* has_bits) { - (*has_bits)[0] |= 1u; - } - static void set_has_supported_features(HasBits* has_bits) { - (*has_bits)[0] |= 2u; - } -}; - -CodeGeneratorResponse::CodeGeneratorResponse(::PROTOBUF_NAMESPACE_ID::Arena* arena, - bool is_message_owned) - : ::PROTOBUF_NAMESPACE_ID::Message(arena, is_message_owned), - file_(arena) { - SharedCtor(); - if (!is_message_owned) { - RegisterArenaDtor(arena); - } - // @@protoc_insertion_point(arena_constructor:google.protobuf.compiler.CodeGeneratorResponse) -} -CodeGeneratorResponse::CodeGeneratorResponse(const CodeGeneratorResponse& from) - : ::PROTOBUF_NAMESPACE_ID::Message(), - _has_bits_(from._has_bits_), - file_(from.file_) { - _internal_metadata_.MergeFrom<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(from._internal_metadata_); - error_.UnsafeSetDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited()); - #ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING - error_.Set(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), "", GetArenaForAllocation()); - #endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING - if (from._internal_has_error()) { - error_.Set(::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::EmptyDefault{}, from._internal_error(), - GetArenaForAllocation()); - } - supported_features_ = from.supported_features_; - // @@protoc_insertion_point(copy_constructor:google.protobuf.compiler.CodeGeneratorResponse) -} - -inline void CodeGeneratorResponse::SharedCtor() { -error_.UnsafeSetDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited()); -#ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING - error_.Set(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), "", GetArenaForAllocation()); -#endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING -supported_features_ = uint64_t{0u}; -} - -CodeGeneratorResponse::~CodeGeneratorResponse() { - // @@protoc_insertion_point(destructor:google.protobuf.compiler.CodeGeneratorResponse) - if (GetArenaForAllocation() != nullptr) return; - SharedDtor(); - _internal_metadata_.Delete<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(); -} - -inline void CodeGeneratorResponse::SharedDtor() { - GOOGLE_DCHECK(GetArenaForAllocation() == nullptr); - error_.DestroyNoArena(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited()); -} - -void CodeGeneratorResponse::ArenaDtor(void* object) { - CodeGeneratorResponse* _this = reinterpret_cast< CodeGeneratorResponse* >(object); - (void)_this; -} -void CodeGeneratorResponse::RegisterArenaDtor(::PROTOBUF_NAMESPACE_ID::Arena*) { -} -void CodeGeneratorResponse::SetCachedSize(int size) const { - _cached_size_.Set(size); -} - -void CodeGeneratorResponse::Clear() { -// @@protoc_insertion_point(message_clear_start:google.protobuf.compiler.CodeGeneratorResponse) - uint32_t cached_has_bits = 0; - // Prevent compiler warnings about cached_has_bits being unused - (void) cached_has_bits; - - file_.Clear(); - cached_has_bits = _has_bits_[0]; - if (cached_has_bits & 0x00000001u) { - error_.ClearNonDefaultToEmpty(); - } - supported_features_ = uint64_t{0u}; - _has_bits_.Clear(); - _internal_metadata_.Clear<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(); -} - -const char* CodeGeneratorResponse::_InternalParse(const char* ptr, ::PROTOBUF_NAMESPACE_ID::internal::ParseContext* ctx) { -#define CHK_(x) if (PROTOBUF_PREDICT_FALSE(!(x))) goto failure - _Internal::HasBits has_bits{}; - while (!ctx->Done(&ptr)) { - uint32_t tag; - ptr = ::PROTOBUF_NAMESPACE_ID::internal::ReadTag(ptr, &tag); - switch (tag >> 3) { - // optional string error = 1; - case 1: - if (PROTOBUF_PREDICT_TRUE(static_cast(tag) == 10)) { - auto str = _internal_mutable_error(); - ptr = ::PROTOBUF_NAMESPACE_ID::internal::InlineGreedyStringParser(str, ptr, ctx); - #ifndef NDEBUG - ::PROTOBUF_NAMESPACE_ID::internal::VerifyUTF8(str, "google.protobuf.compiler.CodeGeneratorResponse.error"); - #endif // !NDEBUG - CHK_(ptr); - } else - goto handle_unusual; - continue; - // optional uint64 supported_features = 2; - case 2: - if (PROTOBUF_PREDICT_TRUE(static_cast(tag) == 16)) { - _Internal::set_has_supported_features(&has_bits); - supported_features_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr); - CHK_(ptr); - } else - goto handle_unusual; - continue; - // repeated .google.protobuf.compiler.CodeGeneratorResponse.File file = 15; - case 15: - if (PROTOBUF_PREDICT_TRUE(static_cast(tag) == 122)) { - ptr -= 1; - do { - ptr += 1; - ptr = ctx->ParseMessage(_internal_add_file(), ptr); - CHK_(ptr); - if (!ctx->DataAvailable(ptr)) break; - } while (::PROTOBUF_NAMESPACE_ID::internal::ExpectTag<122>(ptr)); - } else - goto handle_unusual; - continue; - default: - goto handle_unusual; - } // switch - handle_unusual: - if ((tag == 0) || ((tag & 7) == 4)) { - CHK_(ptr); - ctx->SetLastTag(tag); - goto message_done; - } - ptr = UnknownFieldParse( - tag, - _internal_metadata_.mutable_unknown_fields<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(), - ptr, ctx); - CHK_(ptr != nullptr); - } // while -message_done: - _has_bits_.Or(has_bits); - return ptr; -failure: - ptr = nullptr; - goto message_done; -#undef CHK_ -} - -uint8_t* CodeGeneratorResponse::_InternalSerialize( - uint8_t* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const { - // @@protoc_insertion_point(serialize_to_array_start:google.protobuf.compiler.CodeGeneratorResponse) - uint32_t cached_has_bits = 0; - (void) cached_has_bits; - - cached_has_bits = _has_bits_[0]; - // optional string error = 1; - if (cached_has_bits & 0x00000001u) { - ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::VerifyUTF8StringNamedField( - this->_internal_error().data(), static_cast(this->_internal_error().length()), - ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::SERIALIZE, - "google.protobuf.compiler.CodeGeneratorResponse.error"); - target = stream->WriteStringMaybeAliased( - 1, this->_internal_error(), target); - } - - // optional uint64 supported_features = 2; - if (cached_has_bits & 0x00000002u) { - target = stream->EnsureSpace(target); - target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteUInt64ToArray(2, this->_internal_supported_features(), target); - } - - // repeated .google.protobuf.compiler.CodeGeneratorResponse.File file = 15; - for (unsigned int i = 0, - n = static_cast(this->_internal_file_size()); i < n; i++) { - target = stream->EnsureSpace(target); - target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite:: - InternalWriteMessage(15, this->_internal_file(i), target, stream); - } - - if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) { - target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::InternalSerializeUnknownFieldsToArray( - _internal_metadata_.unknown_fields<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(::PROTOBUF_NAMESPACE_ID::UnknownFieldSet::default_instance), target, stream); - } - // @@protoc_insertion_point(serialize_to_array_end:google.protobuf.compiler.CodeGeneratorResponse) - return target; -} - -size_t CodeGeneratorResponse::ByteSizeLong() const { -// @@protoc_insertion_point(message_byte_size_start:google.protobuf.compiler.CodeGeneratorResponse) - size_t total_size = 0; - - uint32_t cached_has_bits = 0; - // Prevent compiler warnings about cached_has_bits being unused - (void) cached_has_bits; - - // repeated .google.protobuf.compiler.CodeGeneratorResponse.File file = 15; - total_size += 1UL * this->_internal_file_size(); - for (const auto& msg : this->file_) { - total_size += - ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::MessageSize(msg); - } - - cached_has_bits = _has_bits_[0]; - if (cached_has_bits & 0x00000003u) { - // optional string error = 1; - if (cached_has_bits & 0x00000001u) { - total_size += 1 + - ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::StringSize( - this->_internal_error()); - } - - // optional uint64 supported_features = 2; - if (cached_has_bits & 0x00000002u) { - total_size += ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::UInt64SizePlusOne(this->_internal_supported_features()); - } - - } - return MaybeComputeUnknownFieldsSize(total_size, &_cached_size_); -} - -const ::PROTOBUF_NAMESPACE_ID::Message::ClassData CodeGeneratorResponse::_class_data_ = { - ::PROTOBUF_NAMESPACE_ID::Message::CopyWithSizeCheck, - CodeGeneratorResponse::MergeImpl -}; -const ::PROTOBUF_NAMESPACE_ID::Message::ClassData*CodeGeneratorResponse::GetClassData() const { return &_class_data_; } - -void CodeGeneratorResponse::MergeImpl(::PROTOBUF_NAMESPACE_ID::Message* to, - const ::PROTOBUF_NAMESPACE_ID::Message& from) { - static_cast(to)->MergeFrom( - static_cast(from)); -} - - -void CodeGeneratorResponse::MergeFrom(const CodeGeneratorResponse& from) { -// @@protoc_insertion_point(class_specific_merge_from_start:google.protobuf.compiler.CodeGeneratorResponse) - GOOGLE_DCHECK_NE(&from, this); - uint32_t cached_has_bits = 0; - (void) cached_has_bits; - - file_.MergeFrom(from.file_); - cached_has_bits = from._has_bits_[0]; - if (cached_has_bits & 0x00000003u) { - if (cached_has_bits & 0x00000001u) { - _internal_set_error(from._internal_error()); - } - if (cached_has_bits & 0x00000002u) { - supported_features_ = from.supported_features_; - } - _has_bits_[0] |= cached_has_bits; - } - _internal_metadata_.MergeFrom<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(from._internal_metadata_); -} - -void CodeGeneratorResponse::CopyFrom(const CodeGeneratorResponse& from) { -// @@protoc_insertion_point(class_specific_copy_from_start:google.protobuf.compiler.CodeGeneratorResponse) - if (&from == this) return; - Clear(); - MergeFrom(from); -} - -bool CodeGeneratorResponse::IsInitialized() const { - return true; -} - -void CodeGeneratorResponse::InternalSwap(CodeGeneratorResponse* other) { - using std::swap; - auto* lhs_arena = GetArenaForAllocation(); - auto* rhs_arena = other->GetArenaForAllocation(); - _internal_metadata_.InternalSwap(&other->_internal_metadata_); - swap(_has_bits_[0], other->_has_bits_[0]); - file_.InternalSwap(&other->file_); - ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::InternalSwap( - &::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), - &error_, lhs_arena, - &other->error_, rhs_arena - ); - swap(supported_features_, other->supported_features_); -} - -::PROTOBUF_NAMESPACE_ID::Metadata CodeGeneratorResponse::GetMetadata() const { - return ::PROTOBUF_NAMESPACE_ID::internal::AssignDescriptors( - &descriptor_table_google_2fprotobuf_2fcompiler_2fplugin_2eproto_getter, &descriptor_table_google_2fprotobuf_2fcompiler_2fplugin_2eproto_once, - file_level_metadata_google_2fprotobuf_2fcompiler_2fplugin_2eproto[3]); -} - -// @@protoc_insertion_point(namespace_scope) -} // 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::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* Arena::CreateMaybeMessage< ::PROTOBUF_NAMESPACE_ID::compiler::CodeGeneratorResponse >(Arena* arena) { - return Arena::CreateMessageInternal< ::PROTOBUF_NAMESPACE_ID::compiler::CodeGeneratorResponse >(arena); -} -PROTOBUF_NAMESPACE_CLOSE - -// @@protoc_insertion_point(global_scope) -#include diff --git a/extra/protobuf/protobuf-3.19.4/src/google/protobuf/compiler/plugin.pb.h b/extra/protobuf/protobuf-3.19.4/src/google/protobuf/compiler/plugin.pb.h deleted file mode 100644 index d558f5b7a338..000000000000 --- a/extra/protobuf/protobuf-3.19.4/src/google/protobuf/compiler/plugin.pb.h +++ /dev/null @@ -1,1909 +0,0 @@ -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: google/protobuf/compiler/plugin.proto - -#ifndef GOOGLE_PROTOBUF_INCLUDED_google_2fprotobuf_2fcompiler_2fplugin_2eproto -#define GOOGLE_PROTOBUF_INCLUDED_google_2fprotobuf_2fcompiler_2fplugin_2eproto - -#include -#include - -#include -#if PROTOBUF_VERSION < 3019000 -#error This file was generated by a newer version of protoc which is -#error incompatible with your Protocol Buffer headers. Please update -#error your headers. -#endif -#if 3019004 < PROTOBUF_MIN_PROTOC_VERSION -#error This file was generated by an older version of protoc which is -#error incompatible with your Protocol Buffer headers. Please -#error regenerate this file with a newer version of protoc. -#endif - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include // IWYU pragma: export -#include // IWYU pragma: export -#include -#include -#include -// @@protoc_insertion_point(includes) -#include -#define PROTOBUF_INTERNAL_EXPORT_google_2fprotobuf_2fcompiler_2fplugin_2eproto PROTOC_EXPORT -#ifdef major -#undef major -#endif -#ifdef minor -#undef minor -#endif -PROTOBUF_NAMESPACE_OPEN -namespace internal { -class AnyMetadata; -} // namespace internal -PROTOBUF_NAMESPACE_CLOSE - -// Internal implementation detail -- do not use these members. -struct PROTOC_EXPORT TableStruct_google_2fprotobuf_2fcompiler_2fplugin_2eproto { - static const ::PROTOBUF_NAMESPACE_ID::internal::ParseTableField entries[] - PROTOBUF_SECTION_VARIABLE(protodesc_cold); - static const ::PROTOBUF_NAMESPACE_ID::internal::AuxiliaryParseTableField aux[] - PROTOBUF_SECTION_VARIABLE(protodesc_cold); - static const ::PROTOBUF_NAMESPACE_ID::internal::ParseTable schema[4] - PROTOBUF_SECTION_VARIABLE(protodesc_cold); - static const ::PROTOBUF_NAMESPACE_ID::internal::FieldMetadata field_metadata[]; - static const ::PROTOBUF_NAMESPACE_ID::internal::SerializationTable serialization_table[]; - static const uint32_t offsets[]; -}; -PROTOC_EXPORT extern const ::PROTOBUF_NAMESPACE_ID::internal::DescriptorTable descriptor_table_google_2fprotobuf_2fcompiler_2fplugin_2eproto; -PROTOBUF_NAMESPACE_OPEN -namespace compiler { -class CodeGeneratorRequest; -struct CodeGeneratorRequestDefaultTypeInternal; -PROTOC_EXPORT extern CodeGeneratorRequestDefaultTypeInternal _CodeGeneratorRequest_default_instance_; -class CodeGeneratorResponse; -struct CodeGeneratorResponseDefaultTypeInternal; -PROTOC_EXPORT extern CodeGeneratorResponseDefaultTypeInternal _CodeGeneratorResponse_default_instance_; -class CodeGeneratorResponse_File; -struct CodeGeneratorResponse_FileDefaultTypeInternal; -PROTOC_EXPORT extern CodeGeneratorResponse_FileDefaultTypeInternal _CodeGeneratorResponse_File_default_instance_; -class Version; -struct VersionDefaultTypeInternal; -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<::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 { - -enum CodeGeneratorResponse_Feature : int { - CodeGeneratorResponse_Feature_FEATURE_NONE = 0, - CodeGeneratorResponse_Feature_FEATURE_PROTO3_OPTIONAL = 1 -}; -PROTOC_EXPORT bool CodeGeneratorResponse_Feature_IsValid(int value); -constexpr CodeGeneratorResponse_Feature CodeGeneratorResponse_Feature_Feature_MIN = CodeGeneratorResponse_Feature_FEATURE_NONE; -constexpr CodeGeneratorResponse_Feature CodeGeneratorResponse_Feature_Feature_MAX = CodeGeneratorResponse_Feature_FEATURE_PROTO3_OPTIONAL; -constexpr int CodeGeneratorResponse_Feature_Feature_ARRAYSIZE = CodeGeneratorResponse_Feature_Feature_MAX + 1; - -PROTOC_EXPORT const ::PROTOBUF_NAMESPACE_ID::EnumDescriptor* CodeGeneratorResponse_Feature_descriptor(); -template -inline const std::string& CodeGeneratorResponse_Feature_Name(T enum_t_value) { - static_assert(::std::is_same::value || - ::std::is_integral::value, - "Incorrect type passed to function CodeGeneratorResponse_Feature_Name."); - return ::PROTOBUF_NAMESPACE_ID::internal::NameOfEnum( - CodeGeneratorResponse_Feature_descriptor(), enum_t_value); -} -inline bool CodeGeneratorResponse_Feature_Parse( - ::PROTOBUF_NAMESPACE_ID::ConstStringParam name, CodeGeneratorResponse_Feature* value) { - return ::PROTOBUF_NAMESPACE_ID::internal::ParseNamedEnum( - CodeGeneratorResponse_Feature_descriptor(), name, value); -} -// =================================================================== - -class PROTOC_EXPORT Version final : - public ::PROTOBUF_NAMESPACE_ID::Message /* @@protoc_insertion_point(class_definition:google.protobuf.compiler.Version) */ { - public: - inline Version() : Version(nullptr) {} - ~Version() override; - explicit constexpr Version(::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized); - - Version(const Version& from); - Version(Version&& from) noexcept - : Version() { - *this = ::std::move(from); - } - - inline Version& operator=(const Version& from) { - CopyFrom(from); - return *this; - } - inline Version& operator=(Version&& from) noexcept { - if (this == &from) return *this; - if (GetOwningArena() == from.GetOwningArena() - #ifdef PROTOBUF_FORCE_COPY_IN_MOVE - && GetOwningArena() != nullptr - #endif // !PROTOBUF_FORCE_COPY_IN_MOVE - ) { - InternalSwap(&from); - } else { - CopyFrom(from); - } - return *this; - } - - inline const ::PROTOBUF_NAMESPACE_ID::UnknownFieldSet& unknown_fields() const { - return _internal_metadata_.unknown_fields<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(::PROTOBUF_NAMESPACE_ID::UnknownFieldSet::default_instance); - } - inline ::PROTOBUF_NAMESPACE_ID::UnknownFieldSet* mutable_unknown_fields() { - return _internal_metadata_.mutable_unknown_fields<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(); - } - - static const ::PROTOBUF_NAMESPACE_ID::Descriptor* descriptor() { - return GetDescriptor(); - } - static const ::PROTOBUF_NAMESPACE_ID::Descriptor* GetDescriptor() { - return default_instance().GetMetadata().descriptor; - } - static const ::PROTOBUF_NAMESPACE_ID::Reflection* GetReflection() { - return default_instance().GetMetadata().reflection; - } - static const Version& default_instance() { - return *internal_default_instance(); - } - static inline const Version* internal_default_instance() { - return reinterpret_cast( - &_Version_default_instance_); - } - static constexpr int kIndexInFileMessages = - 0; - - friend void swap(Version& a, Version& b) { - a.Swap(&b); - } - inline void Swap(Version* other) { - if (other == this) return; - #ifdef PROTOBUF_FORCE_COPY_IN_SWAP - if (GetOwningArena() != nullptr && - GetOwningArena() == other->GetOwningArena()) { - #else // PROTOBUF_FORCE_COPY_IN_SWAP - if (GetOwningArena() == other->GetOwningArena()) { - #endif // !PROTOBUF_FORCE_COPY_IN_SWAP - InternalSwap(other); - } else { - ::PROTOBUF_NAMESPACE_ID::internal::GenericSwap(this, other); - } - } - void UnsafeArenaSwap(Version* other) { - if (other == this) return; - GOOGLE_DCHECK(GetOwningArena() == other->GetOwningArena()); - InternalSwap(other); - } - - // implements Message ---------------------------------------------- - - Version* New(::PROTOBUF_NAMESPACE_ID::Arena* arena = nullptr) const final { - return CreateMaybeMessage(arena); - } - using ::PROTOBUF_NAMESPACE_ID::Message::CopyFrom; - void CopyFrom(const Version& from); - using ::PROTOBUF_NAMESPACE_ID::Message::MergeFrom; - void MergeFrom(const Version& from); - private: - static void MergeImpl(::PROTOBUF_NAMESPACE_ID::Message* to, const ::PROTOBUF_NAMESPACE_ID::Message& from); - public: - PROTOBUF_ATTRIBUTE_REINITIALIZES void Clear() final; - bool IsInitialized() const final; - - size_t ByteSizeLong() const final; - const char* _InternalParse(const char* ptr, ::PROTOBUF_NAMESPACE_ID::internal::ParseContext* ctx) final; - uint8_t* _InternalSerialize( - uint8_t* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const final; - int GetCachedSize() const final { return _cached_size_.Get(); } - - private: - void SharedCtor(); - void SharedDtor(); - void SetCachedSize(int size) const final; - void InternalSwap(Version* other); - - private: - friend class ::PROTOBUF_NAMESPACE_ID::internal::AnyMetadata; - static ::PROTOBUF_NAMESPACE_ID::StringPiece FullMessageName() { - return "google.protobuf.compiler.Version"; - } - protected: - explicit Version(::PROTOBUF_NAMESPACE_ID::Arena* arena, - bool is_message_owned = false); - private: - static void ArenaDtor(void* object); - inline void RegisterArenaDtor(::PROTOBUF_NAMESPACE_ID::Arena* arena); - public: - - static const ClassData _class_data_; - const ::PROTOBUF_NAMESPACE_ID::Message::ClassData*GetClassData() const final; - - ::PROTOBUF_NAMESPACE_ID::Metadata GetMetadata() const final; - - // nested types ---------------------------------------------------- - - // accessors ------------------------------------------------------- - - enum : int { - kSuffixFieldNumber = 4, - kMajorFieldNumber = 1, - kMinorFieldNumber = 2, - kPatchFieldNumber = 3, - }; - // optional string suffix = 4; - bool has_suffix() const; - private: - bool _internal_has_suffix() const; - public: - void clear_suffix(); - const std::string& suffix() const; - template - void set_suffix(ArgT0&& arg0, ArgT... args); - std::string* mutable_suffix(); - PROTOBUF_NODISCARD std::string* release_suffix(); - void set_allocated_suffix(std::string* suffix); - private: - const std::string& _internal_suffix() const; - inline PROTOBUF_ALWAYS_INLINE void _internal_set_suffix(const std::string& value); - std::string* _internal_mutable_suffix(); - public: - - // optional int32 major = 1; - bool has_major() const; - private: - bool _internal_has_major() const; - public: - void clear_major(); - int32_t major() const; - void set_major(int32_t value); - private: - int32_t _internal_major() const; - void _internal_set_major(int32_t value); - public: - - // optional int32 minor = 2; - bool has_minor() const; - private: - bool _internal_has_minor() const; - public: - void clear_minor(); - int32_t minor() const; - void set_minor(int32_t value); - private: - int32_t _internal_minor() const; - void _internal_set_minor(int32_t value); - public: - - // optional int32 patch = 3; - bool has_patch() const; - private: - bool _internal_has_patch() const; - public: - void clear_patch(); - int32_t patch() const; - void set_patch(int32_t value); - private: - int32_t _internal_patch() const; - void _internal_set_patch(int32_t value); - public: - - // @@protoc_insertion_point(class_scope:google.protobuf.compiler.Version) - private: - class _Internal; - - template friend class ::PROTOBUF_NAMESPACE_ID::Arena::InternalHelper; - typedef void InternalArenaConstructable_; - typedef void DestructorSkippable_; - ::PROTOBUF_NAMESPACE_ID::internal::HasBits<1> _has_bits_; - mutable ::PROTOBUF_NAMESPACE_ID::internal::CachedSize _cached_size_; - ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr suffix_; - int32_t major_; - int32_t minor_; - int32_t patch_; - friend struct ::TableStruct_google_2fprotobuf_2fcompiler_2fplugin_2eproto; -}; -// ------------------------------------------------------------------- - -class PROTOC_EXPORT CodeGeneratorRequest final : - public ::PROTOBUF_NAMESPACE_ID::Message /* @@protoc_insertion_point(class_definition:google.protobuf.compiler.CodeGeneratorRequest) */ { - public: - inline CodeGeneratorRequest() : CodeGeneratorRequest(nullptr) {} - ~CodeGeneratorRequest() override; - explicit constexpr CodeGeneratorRequest(::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized); - - CodeGeneratorRequest(const CodeGeneratorRequest& from); - CodeGeneratorRequest(CodeGeneratorRequest&& from) noexcept - : CodeGeneratorRequest() { - *this = ::std::move(from); - } - - inline CodeGeneratorRequest& operator=(const CodeGeneratorRequest& from) { - CopyFrom(from); - return *this; - } - inline CodeGeneratorRequest& operator=(CodeGeneratorRequest&& from) noexcept { - if (this == &from) return *this; - if (GetOwningArena() == from.GetOwningArena() - #ifdef PROTOBUF_FORCE_COPY_IN_MOVE - && GetOwningArena() != nullptr - #endif // !PROTOBUF_FORCE_COPY_IN_MOVE - ) { - InternalSwap(&from); - } else { - CopyFrom(from); - } - return *this; - } - - inline const ::PROTOBUF_NAMESPACE_ID::UnknownFieldSet& unknown_fields() const { - return _internal_metadata_.unknown_fields<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(::PROTOBUF_NAMESPACE_ID::UnknownFieldSet::default_instance); - } - inline ::PROTOBUF_NAMESPACE_ID::UnknownFieldSet* mutable_unknown_fields() { - return _internal_metadata_.mutable_unknown_fields<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(); - } - - static const ::PROTOBUF_NAMESPACE_ID::Descriptor* descriptor() { - return GetDescriptor(); - } - static const ::PROTOBUF_NAMESPACE_ID::Descriptor* GetDescriptor() { - return default_instance().GetMetadata().descriptor; - } - static const ::PROTOBUF_NAMESPACE_ID::Reflection* GetReflection() { - return default_instance().GetMetadata().reflection; - } - static const CodeGeneratorRequest& default_instance() { - return *internal_default_instance(); - } - static inline const CodeGeneratorRequest* internal_default_instance() { - return reinterpret_cast( - &_CodeGeneratorRequest_default_instance_); - } - static constexpr int kIndexInFileMessages = - 1; - - friend void swap(CodeGeneratorRequest& a, CodeGeneratorRequest& b) { - a.Swap(&b); - } - inline void Swap(CodeGeneratorRequest* other) { - if (other == this) return; - #ifdef PROTOBUF_FORCE_COPY_IN_SWAP - if (GetOwningArena() != nullptr && - GetOwningArena() == other->GetOwningArena()) { - #else // PROTOBUF_FORCE_COPY_IN_SWAP - if (GetOwningArena() == other->GetOwningArena()) { - #endif // !PROTOBUF_FORCE_COPY_IN_SWAP - InternalSwap(other); - } else { - ::PROTOBUF_NAMESPACE_ID::internal::GenericSwap(this, other); - } - } - void UnsafeArenaSwap(CodeGeneratorRequest* other) { - if (other == this) return; - GOOGLE_DCHECK(GetOwningArena() == other->GetOwningArena()); - InternalSwap(other); - } - - // implements Message ---------------------------------------------- - - CodeGeneratorRequest* New(::PROTOBUF_NAMESPACE_ID::Arena* arena = nullptr) const final { - return CreateMaybeMessage(arena); - } - using ::PROTOBUF_NAMESPACE_ID::Message::CopyFrom; - void CopyFrom(const CodeGeneratorRequest& from); - using ::PROTOBUF_NAMESPACE_ID::Message::MergeFrom; - void MergeFrom(const CodeGeneratorRequest& from); - private: - static void MergeImpl(::PROTOBUF_NAMESPACE_ID::Message* to, const ::PROTOBUF_NAMESPACE_ID::Message& from); - public: - PROTOBUF_ATTRIBUTE_REINITIALIZES void Clear() final; - bool IsInitialized() const final; - - size_t ByteSizeLong() const final; - const char* _InternalParse(const char* ptr, ::PROTOBUF_NAMESPACE_ID::internal::ParseContext* ctx) final; - uint8_t* _InternalSerialize( - uint8_t* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const final; - int GetCachedSize() const final { return _cached_size_.Get(); } - - private: - void SharedCtor(); - void SharedDtor(); - void SetCachedSize(int size) const final; - void InternalSwap(CodeGeneratorRequest* other); - - private: - friend class ::PROTOBUF_NAMESPACE_ID::internal::AnyMetadata; - static ::PROTOBUF_NAMESPACE_ID::StringPiece FullMessageName() { - return "google.protobuf.compiler.CodeGeneratorRequest"; - } - protected: - explicit CodeGeneratorRequest(::PROTOBUF_NAMESPACE_ID::Arena* arena, - bool is_message_owned = false); - private: - static void ArenaDtor(void* object); - inline void RegisterArenaDtor(::PROTOBUF_NAMESPACE_ID::Arena* arena); - public: - - static const ClassData _class_data_; - const ::PROTOBUF_NAMESPACE_ID::Message::ClassData*GetClassData() const final; - - ::PROTOBUF_NAMESPACE_ID::Metadata GetMetadata() const final; - - // nested types ---------------------------------------------------- - - // accessors ------------------------------------------------------- - - enum : int { - kFileToGenerateFieldNumber = 1, - kProtoFileFieldNumber = 15, - kParameterFieldNumber = 2, - kCompilerVersionFieldNumber = 3, - }; - // repeated string file_to_generate = 1; - int file_to_generate_size() const; - private: - int _internal_file_to_generate_size() const; - public: - void clear_file_to_generate(); - const std::string& file_to_generate(int index) const; - std::string* mutable_file_to_generate(int index); - void set_file_to_generate(int index, const std::string& value); - void set_file_to_generate(int index, std::string&& value); - void set_file_to_generate(int index, const char* value); - void set_file_to_generate(int index, const char* value, size_t size); - std::string* add_file_to_generate(); - void add_file_to_generate(const std::string& value); - void add_file_to_generate(std::string&& value); - void add_file_to_generate(const char* value); - void add_file_to_generate(const char* value, size_t size); - const ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField& file_to_generate() const; - ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField* mutable_file_to_generate(); - private: - const std::string& _internal_file_to_generate(int index) const; - std::string* _internal_add_file_to_generate(); - public: - - // repeated .google.protobuf.FileDescriptorProto proto_file = 15; - int proto_file_size() const; - private: - 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 >* - mutable_proto_file(); - private: - 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 >& - proto_file() const; - - // optional string parameter = 2; - bool has_parameter() const; - private: - bool _internal_has_parameter() const; - public: - void clear_parameter(); - const std::string& parameter() const; - template - void set_parameter(ArgT0&& arg0, ArgT... args); - std::string* mutable_parameter(); - PROTOBUF_NODISCARD std::string* release_parameter(); - void set_allocated_parameter(std::string* parameter); - private: - const std::string& _internal_parameter() const; - inline PROTOBUF_ALWAYS_INLINE void _internal_set_parameter(const std::string& value); - std::string* _internal_mutable_parameter(); - public: - - // optional .google.protobuf.compiler.Version compiler_version = 3; - bool has_compiler_version() const; - private: - bool _internal_has_compiler_version() const; - public: - void clear_compiler_version(); - const ::PROTOBUF_NAMESPACE_ID::compiler::Version& compiler_version() const; - PROTOBUF_NODISCARD ::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(); - 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(); - - // @@protoc_insertion_point(class_scope:google.protobuf.compiler.CodeGeneratorRequest) - private: - class _Internal; - - template friend class ::PROTOBUF_NAMESPACE_ID::Arena::InternalHelper; - typedef void InternalArenaConstructable_; - typedef void DestructorSkippable_; - ::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::internal::ArenaStringPtr parameter_; - ::PROTOBUF_NAMESPACE_ID::compiler::Version* compiler_version_; - friend struct ::TableStruct_google_2fprotobuf_2fcompiler_2fplugin_2eproto; -}; -// ------------------------------------------------------------------- - -class PROTOC_EXPORT CodeGeneratorResponse_File final : - public ::PROTOBUF_NAMESPACE_ID::Message /* @@protoc_insertion_point(class_definition:google.protobuf.compiler.CodeGeneratorResponse.File) */ { - public: - inline CodeGeneratorResponse_File() : CodeGeneratorResponse_File(nullptr) {} - ~CodeGeneratorResponse_File() override; - explicit constexpr CodeGeneratorResponse_File(::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized); - - CodeGeneratorResponse_File(const CodeGeneratorResponse_File& from); - CodeGeneratorResponse_File(CodeGeneratorResponse_File&& from) noexcept - : CodeGeneratorResponse_File() { - *this = ::std::move(from); - } - - inline CodeGeneratorResponse_File& operator=(const CodeGeneratorResponse_File& from) { - CopyFrom(from); - return *this; - } - inline CodeGeneratorResponse_File& operator=(CodeGeneratorResponse_File&& from) noexcept { - if (this == &from) return *this; - if (GetOwningArena() == from.GetOwningArena() - #ifdef PROTOBUF_FORCE_COPY_IN_MOVE - && GetOwningArena() != nullptr - #endif // !PROTOBUF_FORCE_COPY_IN_MOVE - ) { - InternalSwap(&from); - } else { - CopyFrom(from); - } - return *this; - } - - inline const ::PROTOBUF_NAMESPACE_ID::UnknownFieldSet& unknown_fields() const { - return _internal_metadata_.unknown_fields<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(::PROTOBUF_NAMESPACE_ID::UnknownFieldSet::default_instance); - } - inline ::PROTOBUF_NAMESPACE_ID::UnknownFieldSet* mutable_unknown_fields() { - return _internal_metadata_.mutable_unknown_fields<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(); - } - - static const ::PROTOBUF_NAMESPACE_ID::Descriptor* descriptor() { - return GetDescriptor(); - } - static const ::PROTOBUF_NAMESPACE_ID::Descriptor* GetDescriptor() { - return default_instance().GetMetadata().descriptor; - } - static const ::PROTOBUF_NAMESPACE_ID::Reflection* GetReflection() { - return default_instance().GetMetadata().reflection; - } - static const CodeGeneratorResponse_File& default_instance() { - return *internal_default_instance(); - } - static inline const CodeGeneratorResponse_File* internal_default_instance() { - return reinterpret_cast( - &_CodeGeneratorResponse_File_default_instance_); - } - static constexpr int kIndexInFileMessages = - 2; - - friend void swap(CodeGeneratorResponse_File& a, CodeGeneratorResponse_File& b) { - a.Swap(&b); - } - inline void Swap(CodeGeneratorResponse_File* other) { - if (other == this) return; - #ifdef PROTOBUF_FORCE_COPY_IN_SWAP - if (GetOwningArena() != nullptr && - GetOwningArena() == other->GetOwningArena()) { - #else // PROTOBUF_FORCE_COPY_IN_SWAP - if (GetOwningArena() == other->GetOwningArena()) { - #endif // !PROTOBUF_FORCE_COPY_IN_SWAP - InternalSwap(other); - } else { - ::PROTOBUF_NAMESPACE_ID::internal::GenericSwap(this, other); - } - } - void UnsafeArenaSwap(CodeGeneratorResponse_File* other) { - if (other == this) return; - GOOGLE_DCHECK(GetOwningArena() == other->GetOwningArena()); - InternalSwap(other); - } - - // implements Message ---------------------------------------------- - - CodeGeneratorResponse_File* New(::PROTOBUF_NAMESPACE_ID::Arena* arena = nullptr) const final { - return CreateMaybeMessage(arena); - } - using ::PROTOBUF_NAMESPACE_ID::Message::CopyFrom; - void CopyFrom(const CodeGeneratorResponse_File& from); - using ::PROTOBUF_NAMESPACE_ID::Message::MergeFrom; - void MergeFrom(const CodeGeneratorResponse_File& from); - private: - static void MergeImpl(::PROTOBUF_NAMESPACE_ID::Message* to, const ::PROTOBUF_NAMESPACE_ID::Message& from); - public: - PROTOBUF_ATTRIBUTE_REINITIALIZES void Clear() final; - bool IsInitialized() const final; - - size_t ByteSizeLong() const final; - const char* _InternalParse(const char* ptr, ::PROTOBUF_NAMESPACE_ID::internal::ParseContext* ctx) final; - uint8_t* _InternalSerialize( - uint8_t* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const final; - int GetCachedSize() const final { return _cached_size_.Get(); } - - private: - void SharedCtor(); - void SharedDtor(); - void SetCachedSize(int size) const final; - void InternalSwap(CodeGeneratorResponse_File* other); - - private: - friend class ::PROTOBUF_NAMESPACE_ID::internal::AnyMetadata; - static ::PROTOBUF_NAMESPACE_ID::StringPiece FullMessageName() { - return "google.protobuf.compiler.CodeGeneratorResponse.File"; - } - protected: - explicit CodeGeneratorResponse_File(::PROTOBUF_NAMESPACE_ID::Arena* arena, - bool is_message_owned = false); - private: - static void ArenaDtor(void* object); - inline void RegisterArenaDtor(::PROTOBUF_NAMESPACE_ID::Arena* arena); - public: - - static const ClassData _class_data_; - const ::PROTOBUF_NAMESPACE_ID::Message::ClassData*GetClassData() const final; - - ::PROTOBUF_NAMESPACE_ID::Metadata GetMetadata() const final; - - // nested types ---------------------------------------------------- - - // accessors ------------------------------------------------------- - - enum : int { - kNameFieldNumber = 1, - kInsertionPointFieldNumber = 2, - kContentFieldNumber = 15, - kGeneratedCodeInfoFieldNumber = 16, - }; - // optional string name = 1; - bool has_name() const; - private: - bool _internal_has_name() const; - public: - void clear_name(); - const std::string& name() const; - template - void set_name(ArgT0&& arg0, ArgT... args); - std::string* mutable_name(); - PROTOBUF_NODISCARD std::string* release_name(); - void set_allocated_name(std::string* name); - private: - const std::string& _internal_name() const; - inline PROTOBUF_ALWAYS_INLINE void _internal_set_name(const std::string& value); - std::string* _internal_mutable_name(); - public: - - // optional string insertion_point = 2; - bool has_insertion_point() const; - private: - bool _internal_has_insertion_point() const; - public: - void clear_insertion_point(); - const std::string& insertion_point() const; - template - void set_insertion_point(ArgT0&& arg0, ArgT... args); - std::string* mutable_insertion_point(); - PROTOBUF_NODISCARD std::string* release_insertion_point(); - void set_allocated_insertion_point(std::string* insertion_point); - private: - const std::string& _internal_insertion_point() const; - inline PROTOBUF_ALWAYS_INLINE void _internal_set_insertion_point(const std::string& value); - std::string* _internal_mutable_insertion_point(); - public: - - // optional string content = 15; - bool has_content() const; - private: - bool _internal_has_content() const; - public: - void clear_content(); - const std::string& content() const; - template - void set_content(ArgT0&& arg0, ArgT... args); - std::string* mutable_content(); - PROTOBUF_NODISCARD std::string* release_content(); - void set_allocated_content(std::string* content); - private: - const std::string& _internal_content() const; - inline PROTOBUF_ALWAYS_INLINE void _internal_set_content(const std::string& value); - std::string* _internal_mutable_content(); - public: - - // optional .google.protobuf.GeneratedCodeInfo generated_code_info = 16; - bool has_generated_code_info() const; - private: - bool _internal_has_generated_code_info() const; - public: - void clear_generated_code_info(); - const ::PROTOBUF_NAMESPACE_ID::GeneratedCodeInfo& generated_code_info() const; - PROTOBUF_NODISCARD ::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(); - 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(); - - // @@protoc_insertion_point(class_scope:google.protobuf.compiler.CodeGeneratorResponse.File) - private: - class _Internal; - - template friend class ::PROTOBUF_NAMESPACE_ID::Arena::InternalHelper; - typedef void InternalArenaConstructable_; - typedef void DestructorSkippable_; - ::PROTOBUF_NAMESPACE_ID::internal::HasBits<1> _has_bits_; - mutable ::PROTOBUF_NAMESPACE_ID::internal::CachedSize _cached_size_; - ::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_; - friend struct ::TableStruct_google_2fprotobuf_2fcompiler_2fplugin_2eproto; -}; -// ------------------------------------------------------------------- - -class PROTOC_EXPORT CodeGeneratorResponse final : - public ::PROTOBUF_NAMESPACE_ID::Message /* @@protoc_insertion_point(class_definition:google.protobuf.compiler.CodeGeneratorResponse) */ { - public: - inline CodeGeneratorResponse() : CodeGeneratorResponse(nullptr) {} - ~CodeGeneratorResponse() override; - explicit constexpr CodeGeneratorResponse(::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized); - - CodeGeneratorResponse(const CodeGeneratorResponse& from); - CodeGeneratorResponse(CodeGeneratorResponse&& from) noexcept - : CodeGeneratorResponse() { - *this = ::std::move(from); - } - - inline CodeGeneratorResponse& operator=(const CodeGeneratorResponse& from) { - CopyFrom(from); - return *this; - } - inline CodeGeneratorResponse& operator=(CodeGeneratorResponse&& from) noexcept { - if (this == &from) return *this; - if (GetOwningArena() == from.GetOwningArena() - #ifdef PROTOBUF_FORCE_COPY_IN_MOVE - && GetOwningArena() != nullptr - #endif // !PROTOBUF_FORCE_COPY_IN_MOVE - ) { - InternalSwap(&from); - } else { - CopyFrom(from); - } - return *this; - } - - inline const ::PROTOBUF_NAMESPACE_ID::UnknownFieldSet& unknown_fields() const { - return _internal_metadata_.unknown_fields<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(::PROTOBUF_NAMESPACE_ID::UnknownFieldSet::default_instance); - } - inline ::PROTOBUF_NAMESPACE_ID::UnknownFieldSet* mutable_unknown_fields() { - return _internal_metadata_.mutable_unknown_fields<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(); - } - - static const ::PROTOBUF_NAMESPACE_ID::Descriptor* descriptor() { - return GetDescriptor(); - } - static const ::PROTOBUF_NAMESPACE_ID::Descriptor* GetDescriptor() { - return default_instance().GetMetadata().descriptor; - } - static const ::PROTOBUF_NAMESPACE_ID::Reflection* GetReflection() { - return default_instance().GetMetadata().reflection; - } - static const CodeGeneratorResponse& default_instance() { - return *internal_default_instance(); - } - static inline const CodeGeneratorResponse* internal_default_instance() { - return reinterpret_cast( - &_CodeGeneratorResponse_default_instance_); - } - static constexpr int kIndexInFileMessages = - 3; - - friend void swap(CodeGeneratorResponse& a, CodeGeneratorResponse& b) { - a.Swap(&b); - } - inline void Swap(CodeGeneratorResponse* other) { - if (other == this) return; - #ifdef PROTOBUF_FORCE_COPY_IN_SWAP - if (GetOwningArena() != nullptr && - GetOwningArena() == other->GetOwningArena()) { - #else // PROTOBUF_FORCE_COPY_IN_SWAP - if (GetOwningArena() == other->GetOwningArena()) { - #endif // !PROTOBUF_FORCE_COPY_IN_SWAP - InternalSwap(other); - } else { - ::PROTOBUF_NAMESPACE_ID::internal::GenericSwap(this, other); - } - } - void UnsafeArenaSwap(CodeGeneratorResponse* other) { - if (other == this) return; - GOOGLE_DCHECK(GetOwningArena() == other->GetOwningArena()); - InternalSwap(other); - } - - // implements Message ---------------------------------------------- - - CodeGeneratorResponse* New(::PROTOBUF_NAMESPACE_ID::Arena* arena = nullptr) const final { - return CreateMaybeMessage(arena); - } - using ::PROTOBUF_NAMESPACE_ID::Message::CopyFrom; - void CopyFrom(const CodeGeneratorResponse& from); - using ::PROTOBUF_NAMESPACE_ID::Message::MergeFrom; - void MergeFrom(const CodeGeneratorResponse& from); - private: - static void MergeImpl(::PROTOBUF_NAMESPACE_ID::Message* to, const ::PROTOBUF_NAMESPACE_ID::Message& from); - public: - PROTOBUF_ATTRIBUTE_REINITIALIZES void Clear() final; - bool IsInitialized() const final; - - size_t ByteSizeLong() const final; - const char* _InternalParse(const char* ptr, ::PROTOBUF_NAMESPACE_ID::internal::ParseContext* ctx) final; - uint8_t* _InternalSerialize( - uint8_t* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const final; - int GetCachedSize() const final { return _cached_size_.Get(); } - - private: - void SharedCtor(); - void SharedDtor(); - void SetCachedSize(int size) const final; - void InternalSwap(CodeGeneratorResponse* other); - - private: - friend class ::PROTOBUF_NAMESPACE_ID::internal::AnyMetadata; - static ::PROTOBUF_NAMESPACE_ID::StringPiece FullMessageName() { - return "google.protobuf.compiler.CodeGeneratorResponse"; - } - protected: - explicit CodeGeneratorResponse(::PROTOBUF_NAMESPACE_ID::Arena* arena, - bool is_message_owned = false); - private: - static void ArenaDtor(void* object); - inline void RegisterArenaDtor(::PROTOBUF_NAMESPACE_ID::Arena* arena); - public: - - static const ClassData _class_data_; - const ::PROTOBUF_NAMESPACE_ID::Message::ClassData*GetClassData() const final; - - ::PROTOBUF_NAMESPACE_ID::Metadata GetMetadata() const final; - - // nested types ---------------------------------------------------- - - typedef CodeGeneratorResponse_File File; - - typedef CodeGeneratorResponse_Feature Feature; - static constexpr Feature FEATURE_NONE = - CodeGeneratorResponse_Feature_FEATURE_NONE; - static constexpr Feature FEATURE_PROTO3_OPTIONAL = - CodeGeneratorResponse_Feature_FEATURE_PROTO3_OPTIONAL; - static inline bool Feature_IsValid(int value) { - return CodeGeneratorResponse_Feature_IsValid(value); - } - static constexpr Feature Feature_MIN = - CodeGeneratorResponse_Feature_Feature_MIN; - static constexpr Feature Feature_MAX = - CodeGeneratorResponse_Feature_Feature_MAX; - static constexpr int Feature_ARRAYSIZE = - CodeGeneratorResponse_Feature_Feature_ARRAYSIZE; - static inline const ::PROTOBUF_NAMESPACE_ID::EnumDescriptor* - Feature_descriptor() { - return CodeGeneratorResponse_Feature_descriptor(); - } - template - static inline const std::string& Feature_Name(T enum_t_value) { - static_assert(::std::is_same::value || - ::std::is_integral::value, - "Incorrect type passed to function Feature_Name."); - return CodeGeneratorResponse_Feature_Name(enum_t_value); - } - static inline bool Feature_Parse(::PROTOBUF_NAMESPACE_ID::ConstStringParam name, - Feature* value) { - return CodeGeneratorResponse_Feature_Parse(name, value); - } - - // accessors ------------------------------------------------------- - - enum : int { - kFileFieldNumber = 15, - kErrorFieldNumber = 1, - kSupportedFeaturesFieldNumber = 2, - }; - // repeated .google.protobuf.compiler.CodeGeneratorResponse.File file = 15; - int file_size() const; - private: - 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 >* - mutable_file(); - private: - 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 >& - file() const; - - // optional string error = 1; - bool has_error() const; - private: - bool _internal_has_error() const; - public: - void clear_error(); - const std::string& error() const; - template - void set_error(ArgT0&& arg0, ArgT... args); - std::string* mutable_error(); - PROTOBUF_NODISCARD std::string* release_error(); - void set_allocated_error(std::string* error); - private: - const std::string& _internal_error() const; - inline PROTOBUF_ALWAYS_INLINE void _internal_set_error(const std::string& value); - std::string* _internal_mutable_error(); - public: - - // optional uint64 supported_features = 2; - bool has_supported_features() const; - private: - bool _internal_has_supported_features() const; - public: - void clear_supported_features(); - uint64_t supported_features() const; - void set_supported_features(uint64_t value); - private: - uint64_t _internal_supported_features() const; - void _internal_set_supported_features(uint64_t value); - public: - - // @@protoc_insertion_point(class_scope:google.protobuf.compiler.CodeGeneratorResponse) - private: - class _Internal; - - template friend class ::PROTOBUF_NAMESPACE_ID::Arena::InternalHelper; - typedef void InternalArenaConstructable_; - 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::internal::ArenaStringPtr error_; - uint64_t supported_features_; - friend struct ::TableStruct_google_2fprotobuf_2fcompiler_2fplugin_2eproto; -}; -// =================================================================== - - -// =================================================================== - -#ifdef __GNUC__ - #pragma GCC diagnostic push - #pragma GCC diagnostic ignored "-Wstrict-aliasing" -#endif // __GNUC__ -// Version - -// optional int32 major = 1; -inline bool Version::_internal_has_major() const { - bool value = (_has_bits_[0] & 0x00000002u) != 0; - return value; -} -inline bool Version::has_major() const { - return _internal_has_major(); -} -inline void Version::clear_major() { - major_ = 0; - _has_bits_[0] &= ~0x00000002u; -} -inline int32_t Version::_internal_major() const { - return major_; -} -inline int32_t Version::major() const { - // @@protoc_insertion_point(field_get:google.protobuf.compiler.Version.major) - return _internal_major(); -} -inline void Version::_internal_set_major(int32_t value) { - _has_bits_[0] |= 0x00000002u; - major_ = value; -} -inline void Version::set_major(int32_t value) { - _internal_set_major(value); - // @@protoc_insertion_point(field_set:google.protobuf.compiler.Version.major) -} - -// optional int32 minor = 2; -inline bool Version::_internal_has_minor() const { - bool value = (_has_bits_[0] & 0x00000004u) != 0; - return value; -} -inline bool Version::has_minor() const { - return _internal_has_minor(); -} -inline void Version::clear_minor() { - minor_ = 0; - _has_bits_[0] &= ~0x00000004u; -} -inline int32_t Version::_internal_minor() const { - return minor_; -} -inline int32_t Version::minor() const { - // @@protoc_insertion_point(field_get:google.protobuf.compiler.Version.minor) - return _internal_minor(); -} -inline void Version::_internal_set_minor(int32_t value) { - _has_bits_[0] |= 0x00000004u; - minor_ = value; -} -inline void Version::set_minor(int32_t value) { - _internal_set_minor(value); - // @@protoc_insertion_point(field_set:google.protobuf.compiler.Version.minor) -} - -// optional int32 patch = 3; -inline bool Version::_internal_has_patch() const { - bool value = (_has_bits_[0] & 0x00000008u) != 0; - return value; -} -inline bool Version::has_patch() const { - return _internal_has_patch(); -} -inline void Version::clear_patch() { - patch_ = 0; - _has_bits_[0] &= ~0x00000008u; -} -inline int32_t Version::_internal_patch() const { - return patch_; -} -inline int32_t Version::patch() const { - // @@protoc_insertion_point(field_get:google.protobuf.compiler.Version.patch) - return _internal_patch(); -} -inline void Version::_internal_set_patch(int32_t value) { - _has_bits_[0] |= 0x00000008u; - patch_ = value; -} -inline void Version::set_patch(int32_t value) { - _internal_set_patch(value); - // @@protoc_insertion_point(field_set:google.protobuf.compiler.Version.patch) -} - -// optional string suffix = 4; -inline bool Version::_internal_has_suffix() const { - bool value = (_has_bits_[0] & 0x00000001u) != 0; - return value; -} -inline bool Version::has_suffix() const { - return _internal_has_suffix(); -} -inline void Version::clear_suffix() { - suffix_.ClearToEmpty(); - _has_bits_[0] &= ~0x00000001u; -} -inline const std::string& Version::suffix() const { - // @@protoc_insertion_point(field_get:google.protobuf.compiler.Version.suffix) - return _internal_suffix(); -} -template -inline PROTOBUF_ALWAYS_INLINE -void Version::set_suffix(ArgT0&& arg0, ArgT... args) { - _has_bits_[0] |= 0x00000001u; - suffix_.Set(::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::EmptyDefault{}, static_cast(arg0), args..., GetArenaForAllocation()); - // @@protoc_insertion_point(field_set:google.protobuf.compiler.Version.suffix) -} -inline std::string* Version::mutable_suffix() { - std::string* _s = _internal_mutable_suffix(); - // @@protoc_insertion_point(field_mutable:google.protobuf.compiler.Version.suffix) - return _s; -} -inline const std::string& Version::_internal_suffix() const { - return suffix_.Get(); -} -inline void Version::_internal_set_suffix(const std::string& value) { - _has_bits_[0] |= 0x00000001u; - suffix_.Set(::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::EmptyDefault{}, value, GetArenaForAllocation()); -} -inline std::string* Version::_internal_mutable_suffix() { - _has_bits_[0] |= 0x00000001u; - return suffix_.Mutable(::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::EmptyDefault{}, GetArenaForAllocation()); -} -inline std::string* Version::release_suffix() { - // @@protoc_insertion_point(field_release:google.protobuf.compiler.Version.suffix) - if (!_internal_has_suffix()) { - return nullptr; - } - _has_bits_[0] &= ~0x00000001u; - auto* p = suffix_.ReleaseNonDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), GetArenaForAllocation()); -#ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING - if (suffix_.IsDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited())) { - suffix_.Set(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), "", GetArenaForAllocation()); - } -#endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING - return p; -} -inline void Version::set_allocated_suffix(std::string* suffix) { - if (suffix != nullptr) { - _has_bits_[0] |= 0x00000001u; - } else { - _has_bits_[0] &= ~0x00000001u; - } - suffix_.SetAllocated(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), suffix, - GetArenaForAllocation()); -#ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING - if (suffix_.IsDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited())) { - suffix_.Set(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), "", GetArenaForAllocation()); - } -#endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING - // @@protoc_insertion_point(field_set_allocated:google.protobuf.compiler.Version.suffix) -} - -// ------------------------------------------------------------------- - -// CodeGeneratorRequest - -// repeated string file_to_generate = 1; -inline int CodeGeneratorRequest::_internal_file_to_generate_size() const { - return file_to_generate_.size(); -} -inline int CodeGeneratorRequest::file_to_generate_size() const { - return _internal_file_to_generate_size(); -} -inline void CodeGeneratorRequest::clear_file_to_generate() { - file_to_generate_.Clear(); -} -inline std::string* CodeGeneratorRequest::add_file_to_generate() { - std::string* _s = _internal_add_file_to_generate(); - // @@protoc_insertion_point(field_add_mutable:google.protobuf.compiler.CodeGeneratorRequest.file_to_generate) - return _s; -} -inline const std::string& CodeGeneratorRequest::_internal_file_to_generate(int index) const { - return file_to_generate_.Get(index); -} -inline const std::string& CodeGeneratorRequest::file_to_generate(int index) const { - // @@protoc_insertion_point(field_get:google.protobuf.compiler.CodeGeneratorRequest.file_to_generate) - return _internal_file_to_generate(index); -} -inline std::string* CodeGeneratorRequest::mutable_file_to_generate(int index) { - // @@protoc_insertion_point(field_mutable:google.protobuf.compiler.CodeGeneratorRequest.file_to_generate) - return file_to_generate_.Mutable(index); -} -inline void CodeGeneratorRequest::set_file_to_generate(int index, const std::string& value) { - file_to_generate_.Mutable(index)->assign(value); - // @@protoc_insertion_point(field_set:google.protobuf.compiler.CodeGeneratorRequest.file_to_generate) -} -inline void CodeGeneratorRequest::set_file_to_generate(int index, std::string&& value) { - file_to_generate_.Mutable(index)->assign(std::move(value)); - // @@protoc_insertion_point(field_set:google.protobuf.compiler.CodeGeneratorRequest.file_to_generate) -} -inline void CodeGeneratorRequest::set_file_to_generate(int index, const char* value) { - GOOGLE_DCHECK(value != nullptr); - file_to_generate_.Mutable(index)->assign(value); - // @@protoc_insertion_point(field_set_char:google.protobuf.compiler.CodeGeneratorRequest.file_to_generate) -} -inline void CodeGeneratorRequest::set_file_to_generate(int index, const char* value, size_t size) { - file_to_generate_.Mutable(index)->assign( - reinterpret_cast(value), size); - // @@protoc_insertion_point(field_set_pointer:google.protobuf.compiler.CodeGeneratorRequest.file_to_generate) -} -inline std::string* CodeGeneratorRequest::_internal_add_file_to_generate() { - return file_to_generate_.Add(); -} -inline void CodeGeneratorRequest::add_file_to_generate(const std::string& value) { - file_to_generate_.Add()->assign(value); - // @@protoc_insertion_point(field_add:google.protobuf.compiler.CodeGeneratorRequest.file_to_generate) -} -inline void CodeGeneratorRequest::add_file_to_generate(std::string&& value) { - file_to_generate_.Add(std::move(value)); - // @@protoc_insertion_point(field_add:google.protobuf.compiler.CodeGeneratorRequest.file_to_generate) -} -inline void CodeGeneratorRequest::add_file_to_generate(const char* value) { - GOOGLE_DCHECK(value != nullptr); - file_to_generate_.Add()->assign(value); - // @@protoc_insertion_point(field_add_char:google.protobuf.compiler.CodeGeneratorRequest.file_to_generate) -} -inline void CodeGeneratorRequest::add_file_to_generate(const char* value, size_t size) { - file_to_generate_.Add()->assign(reinterpret_cast(value), size); - // @@protoc_insertion_point(field_add_pointer:google.protobuf.compiler.CodeGeneratorRequest.file_to_generate) -} -inline const ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField& -CodeGeneratorRequest::file_to_generate() const { - // @@protoc_insertion_point(field_list:google.protobuf.compiler.CodeGeneratorRequest.file_to_generate) - return file_to_generate_; -} -inline ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField* -CodeGeneratorRequest::mutable_file_to_generate() { - // @@protoc_insertion_point(field_mutable_list:google.protobuf.compiler.CodeGeneratorRequest.file_to_generate) - return &file_to_generate_; -} - -// optional string parameter = 2; -inline bool CodeGeneratorRequest::_internal_has_parameter() const { - bool value = (_has_bits_[0] & 0x00000001u) != 0; - return value; -} -inline bool CodeGeneratorRequest::has_parameter() const { - return _internal_has_parameter(); -} -inline void CodeGeneratorRequest::clear_parameter() { - parameter_.ClearToEmpty(); - _has_bits_[0] &= ~0x00000001u; -} -inline const std::string& CodeGeneratorRequest::parameter() const { - // @@protoc_insertion_point(field_get:google.protobuf.compiler.CodeGeneratorRequest.parameter) - return _internal_parameter(); -} -template -inline PROTOBUF_ALWAYS_INLINE -void CodeGeneratorRequest::set_parameter(ArgT0&& arg0, ArgT... args) { - _has_bits_[0] |= 0x00000001u; - parameter_.Set(::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::EmptyDefault{}, static_cast(arg0), args..., GetArenaForAllocation()); - // @@protoc_insertion_point(field_set:google.protobuf.compiler.CodeGeneratorRequest.parameter) -} -inline std::string* CodeGeneratorRequest::mutable_parameter() { - std::string* _s = _internal_mutable_parameter(); - // @@protoc_insertion_point(field_mutable:google.protobuf.compiler.CodeGeneratorRequest.parameter) - return _s; -} -inline const std::string& CodeGeneratorRequest::_internal_parameter() const { - return parameter_.Get(); -} -inline void CodeGeneratorRequest::_internal_set_parameter(const std::string& value) { - _has_bits_[0] |= 0x00000001u; - parameter_.Set(::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::EmptyDefault{}, value, GetArenaForAllocation()); -} -inline std::string* CodeGeneratorRequest::_internal_mutable_parameter() { - _has_bits_[0] |= 0x00000001u; - return parameter_.Mutable(::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::EmptyDefault{}, GetArenaForAllocation()); -} -inline std::string* CodeGeneratorRequest::release_parameter() { - // @@protoc_insertion_point(field_release:google.protobuf.compiler.CodeGeneratorRequest.parameter) - if (!_internal_has_parameter()) { - return nullptr; - } - _has_bits_[0] &= ~0x00000001u; - auto* p = parameter_.ReleaseNonDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), GetArenaForAllocation()); -#ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING - if (parameter_.IsDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited())) { - parameter_.Set(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), "", GetArenaForAllocation()); - } -#endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING - return p; -} -inline void CodeGeneratorRequest::set_allocated_parameter(std::string* parameter) { - if (parameter != nullptr) { - _has_bits_[0] |= 0x00000001u; - } else { - _has_bits_[0] &= ~0x00000001u; - } - parameter_.SetAllocated(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), parameter, - GetArenaForAllocation()); -#ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING - if (parameter_.IsDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited())) { - parameter_.Set(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), "", GetArenaForAllocation()); - } -#endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING - // @@protoc_insertion_point(field_set_allocated:google.protobuf.compiler.CodeGeneratorRequest.parameter) -} - -// repeated .google.protobuf.FileDescriptorProto proto_file = 15; -inline int CodeGeneratorRequest::_internal_proto_file_size() const { - return proto_file_.size(); -} -inline int CodeGeneratorRequest::proto_file_size() const { - return _internal_proto_file_size(); -} -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 >* -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 { - return proto_file_.Get(index); -} -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() { - return proto_file_.Add(); -} -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 >& -CodeGeneratorRequest::proto_file() const { - // @@protoc_insertion_point(field_list:google.protobuf.compiler.CodeGeneratorRequest.proto_file) - return proto_file_; -} - -// optional .google.protobuf.compiler.Version compiler_version = 3; -inline bool CodeGeneratorRequest::_internal_has_compiler_version() const { - bool value = (_has_bits_[0] & 0x00000002u) != 0; - PROTOBUF_ASSUME(!value || compiler_version_ != nullptr); - return value; -} -inline bool CodeGeneratorRequest::has_compiler_version() const { - return _internal_has_compiler_version(); -} -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::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) { - if (GetArenaForAllocation() == nullptr) { - delete reinterpret_cast<::PROTOBUF_NAMESPACE_ID::MessageLite*>(compiler_version_); - } - compiler_version_ = compiler_version; - if (compiler_version) { - _has_bits_[0] |= 0x00000002u; - } else { - _has_bits_[0] &= ~0x00000002u; - } - // @@protoc_insertion_point(field_unsafe_arena_set_allocated:google.protobuf.compiler.CodeGeneratorRequest.compiler_version) -} -inline ::PROTOBUF_NAMESPACE_ID::compiler::Version* CodeGeneratorRequest::release_compiler_version() { - _has_bits_[0] &= ~0x00000002u; - ::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); - temp = ::PROTOBUF_NAMESPACE_ID::internal::DuplicateIfNonNull(temp); - if (GetArenaForAllocation() == nullptr) { delete old; } -#else // PROTOBUF_FORCE_COPY_IN_RELEASE - if (GetArenaForAllocation() != nullptr) { - temp = ::PROTOBUF_NAMESPACE_ID::internal::DuplicateIfNonNull(temp); - } -#endif // !PROTOBUF_FORCE_COPY_IN_RELEASE - return temp; -} -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_; - compiler_version_ = nullptr; - return temp; -} -inline ::PROTOBUF_NAMESPACE_ID::compiler::Version* CodeGeneratorRequest::_internal_mutable_compiler_version() { - _has_bits_[0] |= 0x00000002u; - if (compiler_version_ == nullptr) { - 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(); - // @@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) { - ::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<::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); - } - _has_bits_[0] |= 0x00000002u; - } else { - _has_bits_[0] &= ~0x00000002u; - } - compiler_version_ = compiler_version; - // @@protoc_insertion_point(field_set_allocated:google.protobuf.compiler.CodeGeneratorRequest.compiler_version) -} - -// ------------------------------------------------------------------- - -// CodeGeneratorResponse_File - -// optional string name = 1; -inline bool CodeGeneratorResponse_File::_internal_has_name() const { - bool value = (_has_bits_[0] & 0x00000001u) != 0; - return value; -} -inline bool CodeGeneratorResponse_File::has_name() const { - return _internal_has_name(); -} -inline void CodeGeneratorResponse_File::clear_name() { - name_.ClearToEmpty(); - _has_bits_[0] &= ~0x00000001u; -} -inline const std::string& CodeGeneratorResponse_File::name() const { - // @@protoc_insertion_point(field_get:google.protobuf.compiler.CodeGeneratorResponse.File.name) - return _internal_name(); -} -template -inline PROTOBUF_ALWAYS_INLINE -void CodeGeneratorResponse_File::set_name(ArgT0&& arg0, ArgT... args) { - _has_bits_[0] |= 0x00000001u; - name_.Set(::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::EmptyDefault{}, static_cast(arg0), args..., GetArenaForAllocation()); - // @@protoc_insertion_point(field_set:google.protobuf.compiler.CodeGeneratorResponse.File.name) -} -inline std::string* CodeGeneratorResponse_File::mutable_name() { - std::string* _s = _internal_mutable_name(); - // @@protoc_insertion_point(field_mutable:google.protobuf.compiler.CodeGeneratorResponse.File.name) - return _s; -} -inline const std::string& CodeGeneratorResponse_File::_internal_name() const { - return name_.Get(); -} -inline void CodeGeneratorResponse_File::_internal_set_name(const std::string& value) { - _has_bits_[0] |= 0x00000001u; - name_.Set(::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::EmptyDefault{}, value, GetArenaForAllocation()); -} -inline std::string* CodeGeneratorResponse_File::_internal_mutable_name() { - _has_bits_[0] |= 0x00000001u; - return name_.Mutable(::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::EmptyDefault{}, GetArenaForAllocation()); -} -inline std::string* CodeGeneratorResponse_File::release_name() { - // @@protoc_insertion_point(field_release:google.protobuf.compiler.CodeGeneratorResponse.File.name) - if (!_internal_has_name()) { - return nullptr; - } - _has_bits_[0] &= ~0x00000001u; - auto* p = name_.ReleaseNonDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), GetArenaForAllocation()); -#ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING - if (name_.IsDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited())) { - name_.Set(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), "", GetArenaForAllocation()); - } -#endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING - return p; -} -inline void CodeGeneratorResponse_File::set_allocated_name(std::string* name) { - if (name != nullptr) { - _has_bits_[0] |= 0x00000001u; - } else { - _has_bits_[0] &= ~0x00000001u; - } - name_.SetAllocated(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), name, - GetArenaForAllocation()); -#ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING - if (name_.IsDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited())) { - name_.Set(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), "", GetArenaForAllocation()); - } -#endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING - // @@protoc_insertion_point(field_set_allocated:google.protobuf.compiler.CodeGeneratorResponse.File.name) -} - -// optional string insertion_point = 2; -inline bool CodeGeneratorResponse_File::_internal_has_insertion_point() const { - bool value = (_has_bits_[0] & 0x00000002u) != 0; - return value; -} -inline bool CodeGeneratorResponse_File::has_insertion_point() const { - return _internal_has_insertion_point(); -} -inline void CodeGeneratorResponse_File::clear_insertion_point() { - insertion_point_.ClearToEmpty(); - _has_bits_[0] &= ~0x00000002u; -} -inline const std::string& CodeGeneratorResponse_File::insertion_point() const { - // @@protoc_insertion_point(field_get:google.protobuf.compiler.CodeGeneratorResponse.File.insertion_point) - return _internal_insertion_point(); -} -template -inline PROTOBUF_ALWAYS_INLINE -void CodeGeneratorResponse_File::set_insertion_point(ArgT0&& arg0, ArgT... args) { - _has_bits_[0] |= 0x00000002u; - insertion_point_.Set(::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::EmptyDefault{}, static_cast(arg0), args..., GetArenaForAllocation()); - // @@protoc_insertion_point(field_set:google.protobuf.compiler.CodeGeneratorResponse.File.insertion_point) -} -inline std::string* CodeGeneratorResponse_File::mutable_insertion_point() { - std::string* _s = _internal_mutable_insertion_point(); - // @@protoc_insertion_point(field_mutable:google.protobuf.compiler.CodeGeneratorResponse.File.insertion_point) - return _s; -} -inline const std::string& CodeGeneratorResponse_File::_internal_insertion_point() const { - return insertion_point_.Get(); -} -inline void CodeGeneratorResponse_File::_internal_set_insertion_point(const std::string& value) { - _has_bits_[0] |= 0x00000002u; - insertion_point_.Set(::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::EmptyDefault{}, value, GetArenaForAllocation()); -} -inline std::string* CodeGeneratorResponse_File::_internal_mutable_insertion_point() { - _has_bits_[0] |= 0x00000002u; - return insertion_point_.Mutable(::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::EmptyDefault{}, GetArenaForAllocation()); -} -inline std::string* CodeGeneratorResponse_File::release_insertion_point() { - // @@protoc_insertion_point(field_release:google.protobuf.compiler.CodeGeneratorResponse.File.insertion_point) - if (!_internal_has_insertion_point()) { - return nullptr; - } - _has_bits_[0] &= ~0x00000002u; - auto* p = insertion_point_.ReleaseNonDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), GetArenaForAllocation()); -#ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING - if (insertion_point_.IsDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited())) { - insertion_point_.Set(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), "", GetArenaForAllocation()); - } -#endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING - return p; -} -inline void CodeGeneratorResponse_File::set_allocated_insertion_point(std::string* insertion_point) { - if (insertion_point != nullptr) { - _has_bits_[0] |= 0x00000002u; - } else { - _has_bits_[0] &= ~0x00000002u; - } - insertion_point_.SetAllocated(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), insertion_point, - GetArenaForAllocation()); -#ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING - if (insertion_point_.IsDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited())) { - insertion_point_.Set(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), "", GetArenaForAllocation()); - } -#endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING - // @@protoc_insertion_point(field_set_allocated:google.protobuf.compiler.CodeGeneratorResponse.File.insertion_point) -} - -// optional string content = 15; -inline bool CodeGeneratorResponse_File::_internal_has_content() const { - bool value = (_has_bits_[0] & 0x00000004u) != 0; - return value; -} -inline bool CodeGeneratorResponse_File::has_content() const { - return _internal_has_content(); -} -inline void CodeGeneratorResponse_File::clear_content() { - content_.ClearToEmpty(); - _has_bits_[0] &= ~0x00000004u; -} -inline const std::string& CodeGeneratorResponse_File::content() const { - // @@protoc_insertion_point(field_get:google.protobuf.compiler.CodeGeneratorResponse.File.content) - return _internal_content(); -} -template -inline PROTOBUF_ALWAYS_INLINE -void CodeGeneratorResponse_File::set_content(ArgT0&& arg0, ArgT... args) { - _has_bits_[0] |= 0x00000004u; - content_.Set(::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::EmptyDefault{}, static_cast(arg0), args..., GetArenaForAllocation()); - // @@protoc_insertion_point(field_set:google.protobuf.compiler.CodeGeneratorResponse.File.content) -} -inline std::string* CodeGeneratorResponse_File::mutable_content() { - std::string* _s = _internal_mutable_content(); - // @@protoc_insertion_point(field_mutable:google.protobuf.compiler.CodeGeneratorResponse.File.content) - return _s; -} -inline const std::string& CodeGeneratorResponse_File::_internal_content() const { - return content_.Get(); -} -inline void CodeGeneratorResponse_File::_internal_set_content(const std::string& value) { - _has_bits_[0] |= 0x00000004u; - content_.Set(::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::EmptyDefault{}, value, GetArenaForAllocation()); -} -inline std::string* CodeGeneratorResponse_File::_internal_mutable_content() { - _has_bits_[0] |= 0x00000004u; - return content_.Mutable(::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::EmptyDefault{}, GetArenaForAllocation()); -} -inline std::string* CodeGeneratorResponse_File::release_content() { - // @@protoc_insertion_point(field_release:google.protobuf.compiler.CodeGeneratorResponse.File.content) - if (!_internal_has_content()) { - return nullptr; - } - _has_bits_[0] &= ~0x00000004u; - auto* p = content_.ReleaseNonDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), GetArenaForAllocation()); -#ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING - if (content_.IsDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited())) { - content_.Set(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), "", GetArenaForAllocation()); - } -#endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING - return p; -} -inline void CodeGeneratorResponse_File::set_allocated_content(std::string* content) { - if (content != nullptr) { - _has_bits_[0] |= 0x00000004u; - } else { - _has_bits_[0] &= ~0x00000004u; - } - content_.SetAllocated(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), content, - GetArenaForAllocation()); -#ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING - if (content_.IsDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited())) { - content_.Set(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), "", GetArenaForAllocation()); - } -#endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING - // @@protoc_insertion_point(field_set_allocated:google.protobuf.compiler.CodeGeneratorResponse.File.content) -} - -// optional .google.protobuf.GeneratedCodeInfo generated_code_info = 16; -inline bool CodeGeneratorResponse_File::_internal_has_generated_code_info() const { - bool value = (_has_bits_[0] & 0x00000008u) != 0; - PROTOBUF_ASSUME(!value || generated_code_info_ != nullptr); - return value; -} -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::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) { - if (GetArenaForAllocation() == nullptr) { - delete reinterpret_cast<::PROTOBUF_NAMESPACE_ID::MessageLite*>(generated_code_info_); - } - generated_code_info_ = generated_code_info; - if (generated_code_info) { - _has_bits_[0] |= 0x00000008u; - } else { - _has_bits_[0] &= ~0x00000008u; - } - // @@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() { - _has_bits_[0] &= ~0x00000008u; - ::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); - temp = ::PROTOBUF_NAMESPACE_ID::internal::DuplicateIfNonNull(temp); - if (GetArenaForAllocation() == nullptr) { delete old; } -#else // PROTOBUF_FORCE_COPY_IN_RELEASE - if (GetArenaForAllocation() != nullptr) { - temp = ::PROTOBUF_NAMESPACE_ID::internal::DuplicateIfNonNull(temp); - } -#endif // !PROTOBUF_FORCE_COPY_IN_RELEASE - return temp; -} -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_; - generated_code_info_ = nullptr; - return temp; -} -inline ::PROTOBUF_NAMESPACE_ID::GeneratedCodeInfo* CodeGeneratorResponse_File::_internal_mutable_generated_code_info() { - _has_bits_[0] |= 0x00000008u; - if (generated_code_info_ == nullptr) { - 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(); - // @@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) { - ::PROTOBUF_NAMESPACE_ID::Arena* message_arena = GetArenaForAllocation(); - if (message_arena == nullptr) { - delete reinterpret_cast< ::PROTOBUF_NAMESPACE_ID::MessageLite*>(generated_code_info_); - } - if (generated_code_info) { - ::PROTOBUF_NAMESPACE_ID::Arena* submessage_arena = - ::PROTOBUF_NAMESPACE_ID::Arena::InternalHelper< - ::PROTOBUF_NAMESPACE_ID::MessageLite>::GetOwningArena( - reinterpret_cast<::PROTOBUF_NAMESPACE_ID::MessageLite*>(generated_code_info)); - if (message_arena != submessage_arena) { - generated_code_info = ::PROTOBUF_NAMESPACE_ID::internal::GetOwnedMessage( - message_arena, generated_code_info, submessage_arena); - } - _has_bits_[0] |= 0x00000008u; - } else { - _has_bits_[0] &= ~0x00000008u; - } - generated_code_info_ = generated_code_info; - // @@protoc_insertion_point(field_set_allocated:google.protobuf.compiler.CodeGeneratorResponse.File.generated_code_info) -} - -// ------------------------------------------------------------------- - -// CodeGeneratorResponse - -// optional string error = 1; -inline bool CodeGeneratorResponse::_internal_has_error() const { - bool value = (_has_bits_[0] & 0x00000001u) != 0; - return value; -} -inline bool CodeGeneratorResponse::has_error() const { - return _internal_has_error(); -} -inline void CodeGeneratorResponse::clear_error() { - error_.ClearToEmpty(); - _has_bits_[0] &= ~0x00000001u; -} -inline const std::string& CodeGeneratorResponse::error() const { - // @@protoc_insertion_point(field_get:google.protobuf.compiler.CodeGeneratorResponse.error) - return _internal_error(); -} -template -inline PROTOBUF_ALWAYS_INLINE -void CodeGeneratorResponse::set_error(ArgT0&& arg0, ArgT... args) { - _has_bits_[0] |= 0x00000001u; - error_.Set(::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::EmptyDefault{}, static_cast(arg0), args..., GetArenaForAllocation()); - // @@protoc_insertion_point(field_set:google.protobuf.compiler.CodeGeneratorResponse.error) -} -inline std::string* CodeGeneratorResponse::mutable_error() { - std::string* _s = _internal_mutable_error(); - // @@protoc_insertion_point(field_mutable:google.protobuf.compiler.CodeGeneratorResponse.error) - return _s; -} -inline const std::string& CodeGeneratorResponse::_internal_error() const { - return error_.Get(); -} -inline void CodeGeneratorResponse::_internal_set_error(const std::string& value) { - _has_bits_[0] |= 0x00000001u; - error_.Set(::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::EmptyDefault{}, value, GetArenaForAllocation()); -} -inline std::string* CodeGeneratorResponse::_internal_mutable_error() { - _has_bits_[0] |= 0x00000001u; - return error_.Mutable(::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::EmptyDefault{}, GetArenaForAllocation()); -} -inline std::string* CodeGeneratorResponse::release_error() { - // @@protoc_insertion_point(field_release:google.protobuf.compiler.CodeGeneratorResponse.error) - if (!_internal_has_error()) { - return nullptr; - } - _has_bits_[0] &= ~0x00000001u; - auto* p = error_.ReleaseNonDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), GetArenaForAllocation()); -#ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING - if (error_.IsDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited())) { - error_.Set(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), "", GetArenaForAllocation()); - } -#endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING - return p; -} -inline void CodeGeneratorResponse::set_allocated_error(std::string* error) { - if (error != nullptr) { - _has_bits_[0] |= 0x00000001u; - } else { - _has_bits_[0] &= ~0x00000001u; - } - error_.SetAllocated(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), error, - GetArenaForAllocation()); -#ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING - if (error_.IsDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited())) { - error_.Set(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), "", GetArenaForAllocation()); - } -#endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING - // @@protoc_insertion_point(field_set_allocated:google.protobuf.compiler.CodeGeneratorResponse.error) -} - -// optional uint64 supported_features = 2; -inline bool CodeGeneratorResponse::_internal_has_supported_features() const { - bool value = (_has_bits_[0] & 0x00000002u) != 0; - return value; -} -inline bool CodeGeneratorResponse::has_supported_features() const { - return _internal_has_supported_features(); -} -inline void CodeGeneratorResponse::clear_supported_features() { - supported_features_ = uint64_t{0u}; - _has_bits_[0] &= ~0x00000002u; -} -inline uint64_t CodeGeneratorResponse::_internal_supported_features() const { - return supported_features_; -} -inline uint64_t CodeGeneratorResponse::supported_features() const { - // @@protoc_insertion_point(field_get:google.protobuf.compiler.CodeGeneratorResponse.supported_features) - return _internal_supported_features(); -} -inline void CodeGeneratorResponse::_internal_set_supported_features(uint64_t value) { - _has_bits_[0] |= 0x00000002u; - supported_features_ = value; -} -inline void CodeGeneratorResponse::set_supported_features(uint64_t value) { - _internal_set_supported_features(value); - // @@protoc_insertion_point(field_set:google.protobuf.compiler.CodeGeneratorResponse.supported_features) -} - -// repeated .google.protobuf.compiler.CodeGeneratorResponse.File file = 15; -inline int CodeGeneratorResponse::_internal_file_size() const { - return file_.size(); -} -inline int CodeGeneratorResponse::file_size() const { - return _internal_file_size(); -} -inline void CodeGeneratorResponse::clear_file() { - file_.Clear(); -} -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 >* -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 { - return file_.Get(index); -} -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() { - return file_.Add(); -} -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 >& -CodeGeneratorResponse::file() const { - // @@protoc_insertion_point(field_list:google.protobuf.compiler.CodeGeneratorResponse.file) - return file_; -} - -#ifdef __GNUC__ - #pragma GCC diagnostic pop -#endif // __GNUC__ -// ------------------------------------------------------------------- - -// ------------------------------------------------------------------- - -// ------------------------------------------------------------------- - - -// @@protoc_insertion_point(namespace_scope) - -} // namespace compiler -PROTOBUF_NAMESPACE_CLOSE - -PROTOBUF_NAMESPACE_OPEN - -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(); -} - -PROTOBUF_NAMESPACE_CLOSE - -// @@protoc_insertion_point(global_scope) - -#include -#endif // GOOGLE_PROTOBUF_INCLUDED_GOOGLE_PROTOBUF_INCLUDED_google_2fprotobuf_2fcompiler_2fplugin_2eproto diff --git a/extra/protobuf/protobuf-3.19.4/src/google/protobuf/compiler/plugin.proto b/extra/protobuf/protobuf-3.19.4/src/google/protobuf/compiler/plugin.proto deleted file mode 100644 index 9242aacc5bd9..000000000000 --- a/extra/protobuf/protobuf-3.19.4/src/google/protobuf/compiler/plugin.proto +++ /dev/null @@ -1,183 +0,0 @@ -// Protocol Buffers - Google's data interchange format -// Copyright 2008 Google Inc. All rights reserved. -// https://developers.google.com/protocol-buffers/ -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// * Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// * Redistributions in binary form must reproduce the above -// copyright notice, this list of conditions and the following disclaimer -// in the documentation and/or other materials provided with the -// distribution. -// * Neither the name of Google Inc. nor the names of its -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -// Author: kenton@google.com (Kenton Varda) -// -// WARNING: The plugin interface is currently EXPERIMENTAL and is subject to -// change. -// -// protoc (aka the Protocol Compiler) can be extended via plugins. A plugin is -// just a program that reads a CodeGeneratorRequest from stdin and writes a -// CodeGeneratorResponse to stdout. -// -// Plugins written using C++ can use google/protobuf/compiler/plugin.h instead -// of dealing with the raw protocol defined here. -// -// A plugin executable needs only to be placed somewhere in the path. The -// plugin should be named "protoc-gen-$NAME", and will then be used when the -// flag "--${NAME}_out" is passed to protoc. - -syntax = "proto2"; - -package google.protobuf.compiler; -option java_package = "com.google.protobuf.compiler"; -option java_outer_classname = "PluginProtos"; - -option go_package = "google.golang.org/protobuf/types/pluginpb"; - -import "google/protobuf/descriptor.proto"; - -// The version number of protocol compiler. -message Version { - optional int32 major = 1; - optional int32 minor = 2; - optional int32 patch = 3; - // A suffix for alpha, beta or rc release, e.g., "alpha-1", "rc2". It should - // be empty for mainline stable releases. - optional string suffix = 4; -} - -// An encoded CodeGeneratorRequest is written to the plugin's stdin. -message CodeGeneratorRequest { - // The .proto files that were explicitly listed on the command-line. The - // code generator should generate code only for these files. Each file's - // descriptor will be included in proto_file, below. - repeated string file_to_generate = 1; - - // The generator parameter passed on the command-line. - optional string parameter = 2; - - // FileDescriptorProtos for all files in files_to_generate and everything - // they import. The files will appear in topological order, so each file - // appears before any file that imports it. - // - // protoc guarantees that all proto_files will be written after - // the fields above, even though this is not technically guaranteed by the - // protobuf wire format. This theoretically could allow a plugin to stream - // in the FileDescriptorProtos and handle them one by one rather than read - // the entire set into memory at once. However, as of this writing, this - // is not similarly optimized on protoc's end -- it will store all fields in - // memory at once before sending them to the plugin. - // - // Type names of fields and extensions in the FileDescriptorProto are always - // fully qualified. - repeated FileDescriptorProto proto_file = 15; - - // The version number of protocol compiler. - optional Version compiler_version = 3; - -} - -// The plugin writes an encoded CodeGeneratorResponse to stdout. -message CodeGeneratorResponse { - // Error message. If non-empty, code generation failed. The plugin process - // should exit with status code zero even if it reports an error in this way. - // - // This should be used to indicate errors in .proto files which prevent the - // code generator from generating correct code. Errors which indicate a - // problem in protoc itself -- such as the input CodeGeneratorRequest being - // unparseable -- should be reported by writing a message to stderr and - // exiting with a non-zero status code. - optional string error = 1; - - // A bitmask of supported features that the code generator supports. - // This is a bitwise "or" of values from the Feature enum. - optional uint64 supported_features = 2; - - // Sync with code_generator.h. - enum Feature { - FEATURE_NONE = 0; - FEATURE_PROTO3_OPTIONAL = 1; - } - - // Represents a single generated file. - message File { - // The file name, relative to the output directory. The name must not - // contain "." or ".." components and must be relative, not be absolute (so, - // the file cannot lie outside the output directory). "/" must be used as - // the path separator, not "\". - // - // If the name is omitted, the content will be appended to the previous - // file. This allows the generator to break large files into small chunks, - // and allows the generated text to be streamed back to protoc so that large - // files need not reside completely in memory at one time. Note that as of - // this writing protoc does not optimize for this -- it will read the entire - // CodeGeneratorResponse before writing files to disk. - optional string name = 1; - - // If non-empty, indicates that the named file should already exist, and the - // content here is to be inserted into that file at a defined insertion - // point. This feature allows a code generator to extend the output - // produced by another code generator. The original generator may provide - // insertion points by placing special annotations in the file that look - // like: - // @@protoc_insertion_point(NAME) - // The annotation can have arbitrary text before and after it on the line, - // which allows it to be placed in a comment. NAME should be replaced with - // an identifier naming the point -- this is what other generators will use - // as the insertion_point. Code inserted at this point will be placed - // immediately above the line containing the insertion point (thus multiple - // insertions to the same point will come out in the order they were added). - // The double-@ is intended to make it unlikely that the generated code - // could contain things that look like insertion points by accident. - // - // For example, the C++ code generator places the following line in the - // .pb.h files that it generates: - // // @@protoc_insertion_point(namespace_scope) - // This line appears within the scope of the file's package namespace, but - // outside of any particular class. Another plugin can then specify the - // insertion_point "namespace_scope" to generate additional classes or - // other declarations that should be placed in this scope. - // - // Note that if the line containing the insertion point begins with - // whitespace, the same whitespace will be added to every line of the - // inserted text. This is useful for languages like Python, where - // indentation matters. In these languages, the insertion point comment - // should be indented the same amount as any inserted code will need to be - // in order to work correctly in that context. - // - // The code generator that generates the initial file and the one which - // inserts into it must both run as part of a single invocation of protoc. - // Code generators are executed in the order in which they appear on the - // command line. - // - // If |insertion_point| is present, |name| must also be present. - optional string insertion_point = 2; - - // The file contents. - optional string content = 15; - - // Information describing the file content being inserted. If an insertion - // point is used, this information will be appropriately offset and inserted - // into the code generation metadata for the generated files. - optional GeneratedCodeInfo generated_code_info = 16; - } - repeated File file = 15; -} diff --git a/extra/protobuf/protobuf-3.19.4/src/google/protobuf/compiler/python/python_generator.cc b/extra/protobuf/protobuf-3.19.4/src/google/protobuf/compiler/python/python_generator.cc deleted file mode 100644 index 9ad7a33b2e71..000000000000 --- a/extra/protobuf/protobuf-3.19.4/src/google/protobuf/compiler/python/python_generator.cc +++ /dev/null @@ -1,1577 +0,0 @@ -// Protocol Buffers - Google's data interchange format -// Copyright 2008 Google Inc. All rights reserved. -// https://developers.google.com/protocol-buffers/ -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// * Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// * Redistributions in binary form must reproduce the above -// copyright notice, this list of conditions and the following disclaimer -// in the documentation and/or other materials provided with the -// distribution. -// * Neither the name of Google Inc. nor the names of its -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -// Author: robinson@google.com (Will Robinson) -// -// This module outputs pure-Python protocol message classes that will -// largely be constructed at runtime via the metaclass in reflection.py. -// In other words, our job is basically to output a Python equivalent -// of the C++ *Descriptor objects, and fix up all circular references -// within these objects. -// -// Note that the runtime performance of protocol message classes created in -// this way is expected to be lousy. The plan is to create an alternate -// generator that outputs a Python/C extension module that lets -// performance-minded Python code leverage the fast C++ implementation -// directly. - -#include - -#include -#include -#include -#include -#include -#include -#include - -#include -#include -#include -#include -#include -#include -#include -#include -#include - -namespace google { -namespace protobuf { -namespace compiler { -namespace python { - -namespace { - - -// Returns the Python module name expected for a given .proto filename. -std::string ModuleName(const std::string& filename) { - std::string basename = StripProto(filename); - ReplaceCharacters(&basename, "-", '_'); - ReplaceCharacters(&basename, "/", '.'); - return basename + "_pb2"; -} - -// Returns the alias we assign to the module of the given .proto filename -// when importing. See testPackageInitializationImport in -// net/proto2/python/internal/reflection_test.py -// to see why we need the alias. -std::string ModuleAlias(const std::string& filename) { - std::string module_name = ModuleName(filename); - // We can't have dots in the module name, so we replace each with _dot_. - // But that could lead to a collision between a.b and a_dot_b, so we also - // duplicate each underscore. - GlobalReplaceSubstring("_", "__", &module_name); - GlobalReplaceSubstring(".", "_dot_", &module_name); - return module_name; -} - -// Keywords reserved by the Python language. -const char* const kKeywords[] = { - "False", "None", "True", "and", "as", "assert", - "async", "await", "break", "class", "continue", "def", - "del", "elif", "else", "except", "finally", "for", - "from", "global", "if", "import", "in", "is", - "lambda", "nonlocal", "not", "or", "pass", "raise", - "return", "try", "while", "with", "yield", "print", -}; -const char* const* kKeywordsEnd = - kKeywords + (sizeof(kKeywords) / sizeof(kKeywords[0])); - -bool ContainsPythonKeyword(const std::string& module_name) { - std::vector tokens = Split(module_name, "."); - for (int i = 0; i < tokens.size(); ++i) { - if (std::find(kKeywords, kKeywordsEnd, tokens[i]) != kKeywordsEnd) { - return true; - } - } - return false; -} - -inline bool IsPythonKeyword(const std::string& name) { - return (std::find(kKeywords, kKeywordsEnd, name) != kKeywordsEnd); -} - -std::string ResolveKeyword(const std::string& name) { - if (IsPythonKeyword(name)) { - return "globals()['" + name + "']"; - } - return name; -} - -// Returns the name of all containing types for descriptor, -// in order from outermost to innermost, followed by descriptor's -// own name. Each name is separated by |separator|. -template -std::string NamePrefixedWithNestedTypes(const DescriptorT& descriptor, - const std::string& separator) { - std::string name = descriptor.name(); - const Descriptor* parent = descriptor.containing_type(); - if (parent != nullptr) { - std::string prefix = NamePrefixedWithNestedTypes(*parent, separator); - if (separator == "." && IsPythonKeyword(name)) { - return "getattr(" + prefix + ", '" + name + "')"; - } else { - return prefix + separator + name; - } - } - if (separator == ".") { - name = ResolveKeyword(name); - } - return name; -} - -// Name of the class attribute where we store the Python -// descriptor.Descriptor instance for the generated class. -// Must stay consistent with the _DESCRIPTOR_KEY constant -// in proto2/public/reflection.py. -const char kDescriptorKey[] = "DESCRIPTOR"; - -// Does the file have top-level enums? -inline bool HasTopLevelEnums(const FileDescriptor* file) { - return file->enum_type_count() > 0; -} - -// Should we generate generic services for this file? -inline bool HasGenericServices(const FileDescriptor* file) { - return file->service_count() > 0 && file->options().py_generic_services(); -} - -// Prints the common boilerplate needed at the top of every .py -// file output by this generator. -void PrintTopBoilerplate(io::Printer* printer, const FileDescriptor* file, - bool descriptor_proto) { - // TODO(robinson): Allow parameterization of Python version? - printer->Print( - "# -*- coding: utf-8 -*-\n" - "# Generated by the protocol buffer compiler. DO NOT EDIT!\n" - "# source: $filename$\n" - "\"\"\"Generated protocol buffer code.\"\"\"\n", - "filename", file->name()); - if (HasTopLevelEnums(file)) { - printer->Print( - "from google.protobuf.internal import enum_type_wrapper\n"); - } - printer->Print( - "from google.protobuf import descriptor as _descriptor\n" - "from google.protobuf import descriptor_pool as " - "_descriptor_pool\n" - "from google.protobuf import message as _message\n" - "from google.protobuf import reflection as _reflection\n" - "from google.protobuf import symbol_database as " - "_symbol_database\n"); - if (HasGenericServices(file)) { - printer->Print( - "from google.protobuf import service as _service\n" - "from google.protobuf import service_reflection\n"); - } - - printer->Print( - "# @@protoc_insertion_point(imports)\n\n" - "_sym_db = _symbol_database.Default()\n"); - printer->Print("\n\n"); -} - -// Returns a Python literal giving the default value for a field. -// If the field specifies no explicit default value, we'll return -// the default default value for the field type (zero for numbers, -// empty string for strings, empty list for repeated fields, and -// None for non-repeated, composite fields). -// -// TODO(robinson): Unify with code from -// //compiler/cpp/internal/primitive_field.cc -// //compiler/cpp/internal/enum_field.cc -// //compiler/cpp/internal/string_field.cc -std::string StringifyDefaultValue(const FieldDescriptor& field) { - if (field.is_repeated()) { - return "[]"; - } - - switch (field.cpp_type()) { - case FieldDescriptor::CPPTYPE_INT32: - return StrCat(field.default_value_int32()); - case FieldDescriptor::CPPTYPE_UINT32: - return StrCat(field.default_value_uint32()); - case FieldDescriptor::CPPTYPE_INT64: - return StrCat(field.default_value_int64()); - case FieldDescriptor::CPPTYPE_UINT64: - return StrCat(field.default_value_uint64()); - case FieldDescriptor::CPPTYPE_DOUBLE: { - double value = field.default_value_double(); - if (value == std::numeric_limits::infinity()) { - // Python pre-2.6 on Windows does not parse "inf" correctly. However, - // a numeric literal that is too big for a double will become infinity. - return "1e10000"; - } else if (value == -std::numeric_limits::infinity()) { - // See above. - return "-1e10000"; - } else if (value != value) { - // infinity * 0 = nan - return "(1e10000 * 0)"; - } else { - return "float(" + SimpleDtoa(value) + ")"; - } - } - case FieldDescriptor::CPPTYPE_FLOAT: { - float value = field.default_value_float(); - if (value == std::numeric_limits::infinity()) { - // Python pre-2.6 on Windows does not parse "inf" correctly. However, - // a numeric literal that is too big for a double will become infinity. - return "1e10000"; - } else if (value == -std::numeric_limits::infinity()) { - // See above. - return "-1e10000"; - } else if (value != value) { - // infinity - infinity = nan - return "(1e10000 * 0)"; - } else { - return "float(" + SimpleFtoa(value) + ")"; - } - } - case FieldDescriptor::CPPTYPE_BOOL: - return field.default_value_bool() ? "True" : "False"; - case FieldDescriptor::CPPTYPE_ENUM: - return StrCat(field.default_value_enum()->number()); - case FieldDescriptor::CPPTYPE_STRING: - return "b\"" + CEscape(field.default_value_string()) + - (field.type() != FieldDescriptor::TYPE_STRING - ? "\"" - : "\".decode('utf-8')"); - case FieldDescriptor::CPPTYPE_MESSAGE: - return "None"; - } - // (We could add a default case above but then we wouldn't get the nice - // compiler warning when a new type is added.) - GOOGLE_LOG(FATAL) << "Not reached."; - return ""; -} - -std::string StringifySyntax(FileDescriptor::Syntax syntax) { - switch (syntax) { - case FileDescriptor::SYNTAX_PROTO2: - return "proto2"; - case FileDescriptor::SYNTAX_PROTO3: - return "proto3"; - case FileDescriptor::SYNTAX_UNKNOWN: - default: - GOOGLE_LOG(FATAL) << "Unsupported syntax; this generator only supports proto2 " - "and proto3 syntax."; - return ""; - } -} - -} // namespace - -Generator::Generator() : file_(nullptr) {} - -Generator::~Generator() {} - -uint64_t Generator::GetSupportedFeatures() const { - return CodeGenerator::Feature::FEATURE_PROTO3_OPTIONAL; -} - -bool Generator::Generate(const FileDescriptor* file, - const std::string& parameter, - GeneratorContext* context, std::string* error) const { - // ----------------------------------------------------------------- - // parse generator options - bool cpp_generated_lib_linked = false; - - std::vector > options; - ParseGeneratorParameter(parameter, &options); - - for (int i = 0; i < options.size(); i++) { - if (options[i].first == "cpp_generated_lib_linked") { - cpp_generated_lib_linked = true; - } else { - *error = "Unknown generator option: " + options[i].first; - return false; - } - } - - // Completely serialize all Generate() calls on this instance. The - // thread-safety constraints of the CodeGenerator interface aren't clear so - // just be as conservative as possible. It's easier to relax this later if - // we need to, but I doubt it will be an issue. - // TODO(kenton): The proper thing to do would be to allocate any state on - // the stack and use that, so that the Generator class itself does not need - // to have any mutable members. Then it is implicitly thread-safe. - MutexLock lock(&mutex_); - file_ = file; - std::string module_name = ModuleName(file->name()); - std::string filename = module_name; - ReplaceCharacters(&filename, ".", '/'); - filename += ".py"; - - pure_python_workable_ = !cpp_generated_lib_linked; - if (HasPrefixString(file->name(), "google/protobuf/")) { - pure_python_workable_ = true; - } - - FileDescriptorProto fdp; - file_->CopyTo(&fdp); - fdp.SerializeToString(&file_descriptor_serialized_); - - - std::unique_ptr output(context->Open(filename)); - GOOGLE_CHECK(output.get()); - io::Printer printer(output.get(), '$'); - printer_ = &printer; - - PrintTopBoilerplate(printer_, file_, GeneratingDescriptorProto()); - if (pure_python_workable_) { - PrintImports(); - } - PrintFileDescriptor(); - PrintTopLevelEnums(); - PrintTopLevelExtensions(); - if (pure_python_workable_) { - if (GeneratingDescriptorProto()) { - printer_->Print("if _descriptor._USE_C_DESCRIPTORS == False:\n"); - printer_->Indent(); - // Create enums before message descriptors - PrintAllNestedEnumsInFile(StripPrintDescriptor::kCreate); - PrintMessageDescriptors(StripPrintDescriptor::kCreate); - FixForeignFieldsInDescriptors(); - printer_->Outdent(); - printer_->Print("else:\n"); - printer_->Indent(); - } - // Find the message descriptors first and then use the message - // descriptor to find enums. - PrintMessageDescriptors(StripPrintDescriptor::kFind); - PrintAllNestedEnumsInFile(StripPrintDescriptor::kFind); - if (GeneratingDescriptorProto()) { - printer_->Outdent(); - } - } - PrintMessages(); - if (pure_python_workable_) { - PrintServiceDescriptors(); - - printer.Print("if _descriptor._USE_C_DESCRIPTORS == False:\n"); - printer_->Indent(); - - // We have to fix up the extensions after the message classes themselves, - // since they need to call static RegisterExtension() methods on these - // classes. - FixForeignFieldsInExtensions(); - // Descriptor options may have custom extensions. These custom options - // can only be successfully parsed after we register corresponding - // extensions. Therefore we parse all options again here to recognize - // custom options that may be unknown when we define the descriptors. - // This does not apply to services because they are not used by extensions. - FixAllDescriptorOptions(); - - // Set serialized_start and serialized_end. - SetSerializedPbInterval(); - - printer_->Outdent(); - } - if (HasGenericServices(file)) { - PrintServices(); - } - - printer.Print("# @@protoc_insertion_point(module_scope)\n"); - - return !printer.failed(); -} - - -// Prints Python imports for all modules imported by |file|. -void Generator::PrintImports() const { - for (int i = 0; i < file_->dependency_count(); ++i) { - const std::string& filename = file_->dependency(i)->name(); - - std::string module_name = ModuleName(filename); - std::string module_alias = ModuleAlias(filename); - if (ContainsPythonKeyword(module_name)) { - // If the module path contains a Python keyword, we have to quote the - // module name and import it using importlib. Otherwise the usual kind of - // import statement would result in a syntax error from the presence of - // the keyword. - printer_->Print("import importlib\n"); - printer_->Print("$alias$ = importlib.import_module('$name$')\n", "alias", - module_alias, "name", module_name); - } else { - int last_dot_pos = module_name.rfind('.'); - std::string import_statement; - if (last_dot_pos == std::string::npos) { - // NOTE(petya): this is not tested as it would require a protocol buffer - // outside of any package, and I don't think that is easily achievable. - import_statement = "import " + module_name; - } else { - import_statement = "from " + module_name.substr(0, last_dot_pos) + - " import " + module_name.substr(last_dot_pos + 1); - } - printer_->Print("$statement$ as $alias$\n", "statement", import_statement, - "alias", module_alias); - } - - CopyPublicDependenciesAliases(module_alias, file_->dependency(i)); - } - printer_->Print("\n"); - - // Print public imports. - for (int i = 0; i < file_->public_dependency_count(); ++i) { - std::string module_name = ModuleName(file_->public_dependency(i)->name()); - printer_->Print("from $module$ import *\n", "module", module_name); - } - printer_->Print("\n"); -} - -// Prints the single file descriptor for this file. -void Generator::PrintFileDescriptor() const { - std::map m; - m["descriptor_name"] = kDescriptorKey; - m["name"] = file_->name(); - m["package"] = file_->package(); - m["syntax"] = StringifySyntax(file_->syntax()); - m["options"] = OptionsValue(file_->options().SerializeAsString()); - m["serialized_descriptor"] = strings::CHexEscape(file_descriptor_serialized_); - if (GeneratingDescriptorProto()) { - printer_->Print("if _descriptor._USE_C_DESCRIPTORS == False:\n"); - printer_->Indent(); - // Pure python's AddSerializedFile() depend on the generated - // descriptor_pb2.py thus we can not use AddSerializedFile() when - // generated descriptor.proto for pure python. - const char file_descriptor_template[] = - "$descriptor_name$ = _descriptor.FileDescriptor(\n" - " name='$name$',\n" - " package='$package$',\n" - " syntax='$syntax$',\n" - " serialized_options=$options$,\n" - " create_key=_descriptor._internal_create_key,\n"; - printer_->Print(m, file_descriptor_template); - printer_->Indent(); - if (pure_python_workable_) { - printer_->Print("serialized_pb=b'$value$'\n", "value", - strings::CHexEscape(file_descriptor_serialized_)); - if (file_->dependency_count() != 0) { - printer_->Print(",\ndependencies=["); - for (int i = 0; i < file_->dependency_count(); ++i) { - std::string module_alias = ModuleAlias(file_->dependency(i)->name()); - printer_->Print("$module_alias$.DESCRIPTOR,", "module_alias", - module_alias); - } - printer_->Print("]"); - } - if (file_->public_dependency_count() > 0) { - printer_->Print(",\npublic_dependencies=["); - for (int i = 0; i < file_->public_dependency_count(); ++i) { - std::string module_alias = - ModuleAlias(file_->public_dependency(i)->name()); - printer_->Print("$module_alias$.DESCRIPTOR,", "module_alias", - module_alias); - } - printer_->Print("]"); - } - } else { - printer_->Print("serialized_pb=''\n"); - } - - // TODO(falk): Also print options and fix the message_type, enum_type, - // service and extension later in the generation. - - printer_->Outdent(); - printer_->Print(")\n"); - - printer_->Outdent(); - printer_->Print("else:\n"); - printer_->Indent(); - } - printer_->Print(m, - "$descriptor_name$ = " - "_descriptor_pool.Default().AddSerializedFile(b'$serialized_" - "descriptor$')\n"); - if (GeneratingDescriptorProto()) { - printer_->Outdent(); - } - printer_->Print("\n"); -} - -// Prints descriptors and module-level constants for all top-level -// enums defined in |file|. -void Generator::PrintTopLevelEnums() const { - std::vector > top_level_enum_values; - for (int i = 0; i < file_->enum_type_count(); ++i) { - const EnumDescriptor& enum_descriptor = *file_->enum_type(i); - PrintFindEnum(enum_descriptor); - printer_->Print( - "$name$ = " - "enum_type_wrapper.EnumTypeWrapper($descriptor_name$)", - "name", ResolveKeyword(enum_descriptor.name()), "descriptor_name", - ModuleLevelDescriptorName(enum_descriptor)); - printer_->Print("\n"); - - for (int j = 0; j < enum_descriptor.value_count(); ++j) { - const EnumValueDescriptor& value_descriptor = *enum_descriptor.value(j); - top_level_enum_values.push_back( - std::make_pair(value_descriptor.name(), value_descriptor.number())); - } - } - - for (int i = 0; i < top_level_enum_values.size(); ++i) { - printer_->Print("$name$ = $value$\n", "name", - ResolveKeyword(top_level_enum_values[i].first), "value", - StrCat(top_level_enum_values[i].second)); - } - printer_->Print("\n"); -} - -// Prints all enums contained in all message types in |file|. -void Generator::PrintAllNestedEnumsInFile( - StripPrintDescriptor print_mode) const { - for (int i = 0; i < file_->message_type_count(); ++i) { - PrintNestedEnums(*file_->message_type(i), print_mode); - } -} - -// Prints a Python statement assigning the appropriate module-level -// enum name to a Python EnumDescriptor object equivalent to -// enum_descriptor. -void Generator::PrintCreateEnum(const EnumDescriptor& enum_descriptor) const { - std::map m; - std::string module_level_descriptor_name = - ModuleLevelDescriptorName(enum_descriptor); - m["descriptor_name"] = module_level_descriptor_name; - m["name"] = enum_descriptor.name(); - m["full_name"] = enum_descriptor.full_name(); - m["file"] = kDescriptorKey; - const char enum_descriptor_template[] = - "$descriptor_name$ = _descriptor.EnumDescriptor(\n" - " name='$name$',\n" - " full_name='$full_name$',\n" - " filename=None,\n" - " file=$file$,\n" - " create_key=_descriptor._internal_create_key,\n" - " values=[\n"; - std::string options_string; - enum_descriptor.options().SerializeToString(&options_string); - printer_->Print(m, enum_descriptor_template); - printer_->Indent(); - printer_->Indent(); - - if (pure_python_workable_) { - for (int i = 0; i < enum_descriptor.value_count(); ++i) { - PrintEnumValueDescriptor(*enum_descriptor.value(i)); - printer_->Print(",\n"); - } - } - - printer_->Outdent(); - printer_->Print("],\n"); - printer_->Print("containing_type=None,\n"); - printer_->Print("serialized_options=$options_value$,\n", "options_value", - OptionsValue(options_string)); - EnumDescriptorProto edp; - printer_->Outdent(); - printer_->Print(")\n"); - if (pure_python_workable_) { - printer_->Print("_sym_db.RegisterEnumDescriptor($name$)\n", "name", - module_level_descriptor_name); - } - printer_->Print("\n"); -} - -void Generator::PrintFindEnum(const EnumDescriptor& enum_descriptor) const { - std::map m; - m["descriptor_name"] = ModuleLevelDescriptorName(enum_descriptor); - m["name"] = enum_descriptor.name(); - m["file"] = kDescriptorKey; - if (enum_descriptor.containing_type()) { - m["containing_type"] = - ModuleLevelDescriptorName(*enum_descriptor.containing_type()); - printer_->Print(m, - "$descriptor_name$ = " - "$containing_type$.enum_types_by_name['$name$']\n"); - } else { - printer_->Print( - m, "$descriptor_name$ = $file$.enum_types_by_name['$name$']\n"); - } -} - -// Recursively prints enums in nested types within descriptor, then -// prints enums contained at the top level in descriptor. -void Generator::PrintNestedEnums(const Descriptor& descriptor, - StripPrintDescriptor print_mode) const { - for (int i = 0; i < descriptor.nested_type_count(); ++i) { - PrintNestedEnums(*descriptor.nested_type(i), print_mode); - } - - for (int i = 0; i < descriptor.enum_type_count(); ++i) { - if (print_mode == StripPrintDescriptor::kCreate) { - PrintCreateEnum(*descriptor.enum_type(i)); - } else { - PrintFindEnum(*descriptor.enum_type(i)); - } - } -} - -void Generator::PrintTopLevelExtensions() const { - for (int i = 0; i < file_->extension_count(); ++i) { - const FieldDescriptor& extension_field = *file_->extension(i); - std::string constant_name = extension_field.name() + "_FIELD_NUMBER"; - ToUpper(&constant_name); - printer_->Print("$constant_name$ = $number$\n", "constant_name", - constant_name, "number", - StrCat(extension_field.number())); - printer_->Print( - "$resolved_name$ = " - "$file$.extensions_by_name['$name$']\n", - "resolved_name", ResolveKeyword(extension_field.name()), "file", - kDescriptorKey, "name", extension_field.name()); - } - printer_->Print("\n"); -} - -// Prints Python equivalents of all Descriptors in |file|. -void Generator::PrintMessageDescriptors(StripPrintDescriptor print_mode) const { - if (print_mode == StripPrintDescriptor::kCreate) { - for (int i = 0; i < file_->message_type_count(); ++i) { - PrintCreateDescriptor(*file_->message_type(i)); - printer_->Print("\n"); - } - } else { - for (int i = 0; i < file_->message_type_count(); ++i) { - PrintFindDescriptor(*file_->message_type(i)); - } - } -} - -void Generator::PrintServiceDescriptors() const { - for (int i = 0; i < file_->service_count(); ++i) { - PrintServiceDescriptor(*file_->service(i)); - } -} - -void Generator::PrintServices() const { - for (int i = 0; i < file_->service_count(); ++i) { - PrintServiceClass(*file_->service(i)); - PrintServiceStub(*file_->service(i)); - printer_->Print("\n"); - } -} - -void Generator::PrintServiceDescriptor( - const ServiceDescriptor& descriptor) const { - std::map m; - m["service_name"] = ModuleLevelServiceDescriptorName(descriptor); - m["name"] = descriptor.name(); - m["file"] = kDescriptorKey; - printer_->Print(m, "$service_name$ = $file$.services_by_name['$name$']\n"); -} - -void Generator::PrintDescriptorKeyAndModuleName( - const ServiceDescriptor& descriptor) const { - std::string name = ModuleLevelServiceDescriptorName(descriptor); - if (!pure_python_workable_) { - name = "_descriptor.ServiceDescriptor(full_name='" + - descriptor.full_name() + "')"; - } - printer_->Print("$descriptor_key$ = $descriptor_name$,\n", "descriptor_key", - kDescriptorKey, "descriptor_name", name); - std::string module_name = ModuleName(file_->name()); - printer_->Print("__module__ = '$module_name$'\n", "module_name", module_name); -} - -void Generator::PrintServiceClass(const ServiceDescriptor& descriptor) const { - // Print the service. - printer_->Print( - "$class_name$ = service_reflection.GeneratedServiceType(" - "'$class_name$', (_service.Service,), dict(\n", - "class_name", descriptor.name()); - printer_->Indent(); - Generator::PrintDescriptorKeyAndModuleName(descriptor); - printer_->Print("))\n\n"); - printer_->Outdent(); -} - -void Generator::PrintServiceStub(const ServiceDescriptor& descriptor) const { - // Print the service stub. - printer_->Print( - "$class_name$_Stub = " - "service_reflection.GeneratedServiceStubType(" - "'$class_name$_Stub', ($class_name$,), dict(\n", - "class_name", descriptor.name()); - printer_->Indent(); - Generator::PrintDescriptorKeyAndModuleName(descriptor); - printer_->Print("))\n\n"); - printer_->Outdent(); -} - -// Prints statement assigning ModuleLevelDescriptorName(message_descriptor) -// to a Python Descriptor object for message_descriptor. -// -// Mutually recursive with PrintNestedDescriptors(). -void Generator::PrintCreateDescriptor( - const Descriptor& message_descriptor) const { - std::map m; - m["name"] = message_descriptor.name(); - m["full_name"] = message_descriptor.full_name(); - m["file"] = kDescriptorKey; - - PrintNestedDescriptors(message_descriptor, StripPrintDescriptor::kCreate); - - printer_->Print("\n"); - printer_->Print("$descriptor_name$ = _descriptor.Descriptor(\n", - "descriptor_name", - ModuleLevelDescriptorName(message_descriptor)); - printer_->Indent(); - const char required_function_arguments[] = - "name='$name$',\n" - "full_name='$full_name$',\n" - "filename=None,\n" - "file=$file$,\n" - "containing_type=None,\n" - "create_key=_descriptor._internal_create_key,\n"; - printer_->Print(m, required_function_arguments); - PrintFieldsInDescriptor(message_descriptor); - PrintExtensionsInDescriptor(message_descriptor); - - // Nested types - printer_->Print("nested_types=["); - for (int i = 0; i < message_descriptor.nested_type_count(); ++i) { - const std::string nested_name = - ModuleLevelDescriptorName(*message_descriptor.nested_type(i)); - printer_->Print("$name$, ", "name", nested_name); - } - printer_->Print("],\n"); - - // Enum types - printer_->Print("enum_types=[\n"); - printer_->Indent(); - for (int i = 0; i < message_descriptor.enum_type_count(); ++i) { - const std::string descriptor_name = - ModuleLevelDescriptorName(*message_descriptor.enum_type(i)); - printer_->Print(descriptor_name.c_str()); - printer_->Print(",\n"); - } - printer_->Outdent(); - printer_->Print("],\n"); - std::string options_string; - message_descriptor.options().SerializeToString(&options_string); - printer_->Print( - "serialized_options=$options_value$,\n" - "is_extendable=$extendable$,\n" - "syntax='$syntax$'", - "options_value", OptionsValue(options_string), "extendable", - message_descriptor.extension_range_count() > 0 ? "True" : "False", - "syntax", StringifySyntax(message_descriptor.file()->syntax())); - printer_->Print(",\n"); - - // Extension ranges - printer_->Print("extension_ranges=["); - for (int i = 0; i < message_descriptor.extension_range_count(); ++i) { - const Descriptor::ExtensionRange* range = - message_descriptor.extension_range(i); - printer_->Print("($start$, $end$), ", "start", StrCat(range->start), - "end", StrCat(range->end)); - } - printer_->Print("],\n"); - printer_->Print("oneofs=[\n"); - printer_->Indent(); - for (int i = 0; i < message_descriptor.oneof_decl_count(); ++i) { - const OneofDescriptor* desc = message_descriptor.oneof_decl(i); - m.clear(); - m["name"] = desc->name(); - m["full_name"] = desc->full_name(); - m["index"] = StrCat(desc->index()); - options_string = OptionsValue(desc->options().SerializeAsString()); - if (options_string == "None") { - m["serialized_options"] = ""; - } else { - m["serialized_options"] = ", serialized_options=" + options_string; - } - printer_->Print(m, - "_descriptor.OneofDescriptor(\n" - " name='$name$', full_name='$full_name$',\n" - " index=$index$, containing_type=None,\n" - " create_key=_descriptor._internal_create_key,\n" - "fields=[]$serialized_options$),\n"); - } - printer_->Outdent(); - printer_->Print("],\n"); - - printer_->Outdent(); - printer_->Print(")\n"); -} - -void Generator::PrintFindDescriptor( - const Descriptor& message_descriptor) const { - std::map m; - m["descriptor_name"] = ModuleLevelDescriptorName(message_descriptor); - m["name"] = message_descriptor.name(); - - if (message_descriptor.containing_type()) { - m["containing_type"] = - ModuleLevelDescriptorName(*message_descriptor.containing_type()); - printer_->Print(m, - "$descriptor_name$ = " - "$containing_type$.nested_types_by_name['$name$']\n"); - } else { - m["file"] = kDescriptorKey; - printer_->Print( - m, "$descriptor_name$ = $file$.message_types_by_name['$name$']\n"); - } - - PrintNestedDescriptors(message_descriptor, StripPrintDescriptor::kFind); -} - -// Prints Python Descriptor objects for all nested types contained in -// message_descriptor. -// -// Mutually recursive with PrintDescriptor(). -void Generator::PrintNestedDescriptors(const Descriptor& containing_descriptor, - StripPrintDescriptor print_mode) const { - if (print_mode == StripPrintDescriptor::kCreate) { - for (int i = 0; i < containing_descriptor.nested_type_count(); ++i) { - PrintCreateDescriptor(*containing_descriptor.nested_type(i)); - } - } else { - for (int i = 0; i < containing_descriptor.nested_type_count(); ++i) { - PrintFindDescriptor(*containing_descriptor.nested_type(i)); - } - } -} - -// Prints all messages in |file|. -void Generator::PrintMessages() const { - for (int i = 0; i < file_->message_type_count(); ++i) { - std::vector to_register; - PrintMessage(*file_->message_type(i), "", &to_register, false); - for (int j = 0; j < to_register.size(); ++j) { - printer_->Print("_sym_db.RegisterMessage($name$)\n", "name", - ResolveKeyword(to_register[j])); - } - printer_->Print("\n"); - } -} - -// Prints a Python class for the given message descriptor. We defer to the -// metaclass to do almost all of the work of actually creating a useful class. -// The purpose of this function and its many helper functions above is merely -// to output a Python version of the descriptors, which the metaclass in -// reflection.py will use to construct the meat of the class itself. -// -// Mutually recursive with PrintNestedMessages(). -// Collect nested message names to_register for the symbol_database. -void Generator::PrintMessage(const Descriptor& message_descriptor, - const std::string& prefix, - std::vector* to_register, - bool is_nested) const { - std::string qualified_name; - if (is_nested) { - if (IsPythonKeyword(message_descriptor.name())) { - qualified_name = - "getattr(" + prefix + ", '" + message_descriptor.name() + "')"; - } else { - qualified_name = prefix + "." + message_descriptor.name(); - } - printer_->Print( - "'$name$' : _reflection.GeneratedProtocolMessageType('$name$', " - "(_message.Message,), {\n", - "name", message_descriptor.name()); - } else { - qualified_name = ResolveKeyword(message_descriptor.name()); - printer_->Print( - "$qualified_name$ = _reflection.GeneratedProtocolMessageType('$name$', " - "(_message.Message,), {\n", - "qualified_name", qualified_name, "name", message_descriptor.name()); - } - printer_->Indent(); - - to_register->push_back(qualified_name); - - PrintNestedMessages(message_descriptor, qualified_name, to_register); - std::map m; - m["descriptor_key"] = kDescriptorKey; - if (pure_python_workable_) { - m["descriptor_name"] = ModuleLevelDescriptorName(message_descriptor); - } else { - m["descriptor_name"] = "_descriptor.Descriptor(full_name='" + - message_descriptor.full_name() + "')"; - } - printer_->Print(m, "'$descriptor_key$' : $descriptor_name$,\n"); - std::string module_name = ModuleName(file_->name()); - printer_->Print("'__module__' : '$module_name$'\n", "module_name", - module_name); - printer_->Print("# @@protoc_insertion_point(class_scope:$full_name$)\n", - "full_name", message_descriptor.full_name()); - printer_->Print("})\n"); - printer_->Outdent(); -} - -// Prints all nested messages within |containing_descriptor|. -// Mutually recursive with PrintMessage(). -void Generator::PrintNestedMessages( - const Descriptor& containing_descriptor, const std::string& prefix, - std::vector* to_register) const { - for (int i = 0; i < containing_descriptor.nested_type_count(); ++i) { - printer_->Print("\n"); - PrintMessage(*containing_descriptor.nested_type(i), prefix, to_register, - true); - printer_->Print(",\n"); - } -} - -// Recursively fixes foreign fields in all nested types in |descriptor|, then -// sets the message_type and enum_type of all message and enum fields to point -// to their respective descriptors. -// Args: -// descriptor: descriptor to print fields for. -// containing_descriptor: if descriptor is a nested type, this is its -// containing type, or NULL if this is a root/top-level type. -void Generator::FixForeignFieldsInDescriptor( - const Descriptor& descriptor, - const Descriptor* containing_descriptor) const { - for (int i = 0; i < descriptor.nested_type_count(); ++i) { - FixForeignFieldsInDescriptor(*descriptor.nested_type(i), &descriptor); - } - - for (int i = 0; i < descriptor.field_count(); ++i) { - const FieldDescriptor& field_descriptor = *descriptor.field(i); - FixForeignFieldsInField(&descriptor, field_descriptor, "fields_by_name"); - } - - FixContainingTypeInDescriptor(descriptor, containing_descriptor); - for (int i = 0; i < descriptor.enum_type_count(); ++i) { - const EnumDescriptor& enum_descriptor = *descriptor.enum_type(i); - FixContainingTypeInDescriptor(enum_descriptor, &descriptor); - } - for (int i = 0; i < descriptor.oneof_decl_count(); ++i) { - std::map m; - const OneofDescriptor* oneof = descriptor.oneof_decl(i); - m["descriptor_name"] = ModuleLevelDescriptorName(descriptor); - m["oneof_name"] = oneof->name(); - for (int j = 0; j < oneof->field_count(); ++j) { - m["field_name"] = oneof->field(j)->name(); - printer_->Print( - m, - "$descriptor_name$.oneofs_by_name['$oneof_name$'].fields.append(\n" - " $descriptor_name$.fields_by_name['$field_name$'])\n"); - printer_->Print( - m, - "$descriptor_name$.fields_by_name['$field_name$'].containing_oneof = " - "$descriptor_name$.oneofs_by_name['$oneof_name$']\n"); - } - } -} - -void Generator::AddMessageToFileDescriptor(const Descriptor& descriptor) const { - std::map m; - m["descriptor_name"] = kDescriptorKey; - m["message_name"] = descriptor.name(); - m["message_descriptor_name"] = ModuleLevelDescriptorName(descriptor); - const char file_descriptor_template[] = - "$descriptor_name$.message_types_by_name['$message_name$'] = " - "$message_descriptor_name$\n"; - printer_->Print(m, file_descriptor_template); -} - -void Generator::AddServiceToFileDescriptor( - const ServiceDescriptor& descriptor) const { - std::map m; - m["descriptor_name"] = kDescriptorKey; - m["service_name"] = descriptor.name(); - m["service_descriptor_name"] = ModuleLevelServiceDescriptorName(descriptor); - const char file_descriptor_template[] = - "$descriptor_name$.services_by_name['$service_name$'] = " - "$service_descriptor_name$\n"; - printer_->Print(m, file_descriptor_template); -} - -void Generator::AddEnumToFileDescriptor( - const EnumDescriptor& descriptor) const { - std::map m; - m["descriptor_name"] = kDescriptorKey; - m["enum_name"] = descriptor.name(); - m["enum_descriptor_name"] = ModuleLevelDescriptorName(descriptor); - const char file_descriptor_template[] = - "$descriptor_name$.enum_types_by_name['$enum_name$'] = " - "$enum_descriptor_name$\n"; - printer_->Print(m, file_descriptor_template); -} - -void Generator::AddExtensionToFileDescriptor( - const FieldDescriptor& descriptor) const { - std::map m; - m["descriptor_name"] = kDescriptorKey; - m["field_name"] = descriptor.name(); - m["resolved_name"] = ResolveKeyword(descriptor.name()); - const char file_descriptor_template[] = - "$descriptor_name$.extensions_by_name['$field_name$'] = " - "$resolved_name$\n"; - printer_->Print(m, file_descriptor_template); -} - -// Sets any necessary message_type and enum_type attributes -// for the Python version of |field|. -// -// containing_type may be NULL, in which case this is a module-level field. -// -// python_dict_name is the name of the Python dict where we should -// look the field up in the containing type. (e.g., fields_by_name -// or extensions_by_name). We ignore python_dict_name if containing_type -// is NULL. -void Generator::FixForeignFieldsInField( - const Descriptor* containing_type, const FieldDescriptor& field, - const std::string& python_dict_name) const { - const std::string field_referencing_expression = - FieldReferencingExpression(containing_type, field, python_dict_name); - std::map m; - m["field_ref"] = field_referencing_expression; - const Descriptor* foreign_message_type = field.message_type(); - if (foreign_message_type) { - m["foreign_type"] = ModuleLevelDescriptorName(*foreign_message_type); - printer_->Print(m, "$field_ref$.message_type = $foreign_type$\n"); - } - const EnumDescriptor* enum_type = field.enum_type(); - if (enum_type) { - m["enum_type"] = ModuleLevelDescriptorName(*enum_type); - printer_->Print(m, "$field_ref$.enum_type = $enum_type$\n"); - } -} - -// Returns the module-level expression for the given FieldDescriptor. -// Only works for fields in the .proto file this Generator is generating for. -// -// containing_type may be NULL, in which case this is a module-level field. -// -// python_dict_name is the name of the Python dict where we should -// look the field up in the containing type. (e.g., fields_by_name -// or extensions_by_name). We ignore python_dict_name if containing_type -// is NULL. -std::string Generator::FieldReferencingExpression( - const Descriptor* containing_type, const FieldDescriptor& field, - const std::string& python_dict_name) const { - // We should only ever be looking up fields in the current file. - // The only things we refer to from other files are message descriptors. - GOOGLE_CHECK_EQ(field.file(), file_) - << field.file()->name() << " vs. " << file_->name(); - if (!containing_type) { - return ResolveKeyword(field.name()); - } - return strings::Substitute("$0.$1['$2']", - ModuleLevelDescriptorName(*containing_type), - python_dict_name, field.name()); -} - -// Prints containing_type for nested descriptors or enum descriptors. -template -void Generator::FixContainingTypeInDescriptor( - const DescriptorT& descriptor, - const Descriptor* containing_descriptor) const { - if (containing_descriptor != nullptr) { - const std::string nested_name = ModuleLevelDescriptorName(descriptor); - const std::string parent_name = - ModuleLevelDescriptorName(*containing_descriptor); - printer_->Print("$nested_name$.containing_type = $parent_name$\n", - "nested_name", nested_name, "parent_name", parent_name); - } -} - -// Prints statements setting the message_type and enum_type fields in the -// Python descriptor objects we've already output in the file. We must -// do this in a separate step due to circular references (otherwise, we'd -// just set everything in the initial assignment statements). -void Generator::FixForeignFieldsInDescriptors() const { - for (int i = 0; i < file_->message_type_count(); ++i) { - FixForeignFieldsInDescriptor(*file_->message_type(i), nullptr); - } - for (int i = 0; i < file_->message_type_count(); ++i) { - AddMessageToFileDescriptor(*file_->message_type(i)); - } - for (int i = 0; i < file_->enum_type_count(); ++i) { - AddEnumToFileDescriptor(*file_->enum_type(i)); - } - for (int i = 0; i < file_->extension_count(); ++i) { - AddExtensionToFileDescriptor(*file_->extension(i)); - } - - // TODO(jieluo): Move this register to PrintFileDescriptor() when - // FieldDescriptor.file is added in generated file. - printer_->Print("_sym_db.RegisterFileDescriptor($name$)\n", "name", - kDescriptorKey); - printer_->Print("\n"); -} - -// We need to not only set any necessary message_type fields, but -// also need to call RegisterExtension() on each message we're -// extending. -void Generator::FixForeignFieldsInExtensions() const { - // Top-level extensions. - for (int i = 0; i < file_->extension_count(); ++i) { - FixForeignFieldsInExtension(*file_->extension(i)); - } - // Nested extensions. - for (int i = 0; i < file_->message_type_count(); ++i) { - FixForeignFieldsInNestedExtensions(*file_->message_type(i)); - } - printer_->Print("\n"); -} - -void Generator::FixForeignFieldsInExtension( - const FieldDescriptor& extension_field) const { - GOOGLE_CHECK(extension_field.is_extension()); - - std::map m; - // Confusingly, for FieldDescriptors that happen to be extensions, - // containing_type() means "extended type." - // On the other hand, extension_scope() will give us what we normally - // mean by containing_type(). - m["extended_message_class"] = - ModuleLevelMessageName(*extension_field.containing_type()); - m["field"] = FieldReferencingExpression( - extension_field.extension_scope(), extension_field, "extensions_by_name"); - printer_->Print(m, "$extended_message_class$.RegisterExtension($field$)\n"); -} - -void Generator::FixForeignFieldsInNestedExtensions( - const Descriptor& descriptor) const { - // Recursively fix up extensions in all nested types. - for (int i = 0; i < descriptor.nested_type_count(); ++i) { - FixForeignFieldsInNestedExtensions(*descriptor.nested_type(i)); - } - // Fix up extensions directly contained within this type. - for (int i = 0; i < descriptor.extension_count(); ++i) { - FixForeignFieldsInExtension(*descriptor.extension(i)); - } -} - -// Returns a Python expression that instantiates a Python EnumValueDescriptor -// object for the given C++ descriptor. -void Generator::PrintEnumValueDescriptor( - const EnumValueDescriptor& descriptor) const { - // TODO(robinson): Fix up EnumValueDescriptor "type" fields. - // More circular references. ::sigh:: - std::string options_string; - descriptor.options().SerializeToString(&options_string); - std::map m; - m["name"] = descriptor.name(); - m["index"] = StrCat(descriptor.index()); - m["number"] = StrCat(descriptor.number()); - m["options"] = OptionsValue(options_string); - printer_->Print(m, - "_descriptor.EnumValueDescriptor(\n" - " name='$name$', index=$index$, number=$number$,\n" - " serialized_options=$options$,\n" - " type=None,\n" - " create_key=_descriptor._internal_create_key)"); -} - -// Returns a CEscaped string of serialized_options. -std::string Generator::OptionsValue( - const std::string& serialized_options) const { - if (serialized_options.length() == 0 || GeneratingDescriptorProto()) { - return "None"; - } else { - return "b'" + CEscape(serialized_options) + "'"; - } -} - -// Prints an expression for a Python FieldDescriptor for |field|. -void Generator::PrintFieldDescriptor(const FieldDescriptor& field, - bool is_extension) const { - std::string options_string; - field.options().SerializeToString(&options_string); - std::map m; - m["name"] = field.name(); - m["full_name"] = field.full_name(); - m["index"] = StrCat(field.index()); - m["number"] = StrCat(field.number()); - m["type"] = StrCat(field.type()); - m["cpp_type"] = StrCat(field.cpp_type()); - m["label"] = StrCat(field.label()); - m["has_default_value"] = field.has_default_value() ? "True" : "False"; - m["default_value"] = StringifyDefaultValue(field); - m["is_extension"] = is_extension ? "True" : "False"; - m["serialized_options"] = OptionsValue(options_string); - m["json_name"] = - field.has_json_name() ? ", json_name='" + field.json_name() + "'" : ""; - // We always set message_type and enum_type to None at this point, and then - // these fields in correctly after all referenced descriptors have been - // defined and/or imported (see FixForeignFieldsInDescriptors()). - const char field_descriptor_decl[] = - "_descriptor.FieldDescriptor(\n" - " name='$name$', full_name='$full_name$', index=$index$,\n" - " number=$number$, type=$type$, cpp_type=$cpp_type$, label=$label$,\n" - " has_default_value=$has_default_value$, " - "default_value=$default_value$,\n" - " message_type=None, enum_type=None, containing_type=None,\n" - " is_extension=$is_extension$, extension_scope=None,\n" - " serialized_options=$serialized_options$$json_name$, file=DESCRIPTOR," - " create_key=_descriptor._internal_create_key)"; - printer_->Print(m, field_descriptor_decl); -} - -// Helper for Print{Fields,Extensions}InDescriptor(). -void Generator::PrintFieldDescriptorsInDescriptor( - const Descriptor& message_descriptor, bool is_extension, - const std::string& list_variable_name, int (Descriptor::*CountFn)() const, - const FieldDescriptor* (Descriptor::*GetterFn)(int)const) const { - printer_->Print("$list$=[\n", "list", list_variable_name); - printer_->Indent(); - for (int i = 0; i < (message_descriptor.*CountFn)(); ++i) { - PrintFieldDescriptor(*(message_descriptor.*GetterFn)(i), is_extension); - printer_->Print(",\n"); - } - printer_->Outdent(); - printer_->Print("],\n"); -} - -// Prints a statement assigning "fields" to a list of Python FieldDescriptors, -// one for each field present in message_descriptor. -void Generator::PrintFieldsInDescriptor( - const Descriptor& message_descriptor) const { - const bool is_extension = false; - PrintFieldDescriptorsInDescriptor(message_descriptor, is_extension, "fields", - &Descriptor::field_count, - &Descriptor::field); -} - -// Prints a statement assigning "extensions" to a list of Python -// FieldDescriptors, one for each extension present in message_descriptor. -void Generator::PrintExtensionsInDescriptor( - const Descriptor& message_descriptor) const { - const bool is_extension = true; - PrintFieldDescriptorsInDescriptor(message_descriptor, is_extension, - "extensions", &Descriptor::extension_count, - &Descriptor::extension); -} - -bool Generator::GeneratingDescriptorProto() const { - return file_->name() == "net/proto2/proto/descriptor.proto" || - file_->name() == "google/protobuf/descriptor.proto"; -} - -// Returns the unique Python module-level identifier given to a descriptor. -// This name is module-qualified iff the given descriptor describes an -// entity that doesn't come from the current file. -template -std::string Generator::ModuleLevelDescriptorName( - const DescriptorT& descriptor) const { - // FIXME(robinson): - // We currently don't worry about collisions with underscores in the type - // names, so these would collide in nasty ways if found in the same file: - // OuterProto.ProtoA.ProtoB - // OuterProto_ProtoA.ProtoB # Underscore instead of period. - // As would these: - // OuterProto.ProtoA_.ProtoB - // OuterProto.ProtoA._ProtoB # Leading vs. trailing underscore. - // (Contrived, but certainly possible). - // - // The C++ implementation doesn't guard against this either. Leaving - // it for now... - std::string name = NamePrefixedWithNestedTypes(descriptor, "_"); - ToUpper(&name); - // Module-private for now. Easy to make public later; almost impossible - // to make private later. - name = "_" + name; - // We now have the name relative to its own module. Also qualify with - // the module name iff this descriptor is from a different .proto file. - if (descriptor.file() != file_) { - name = ModuleAlias(descriptor.file()->name()) + "." + name; - } - return name; -} - -// Returns the name of the message class itself, not the descriptor. -// Like ModuleLevelDescriptorName(), module-qualifies the name iff -// the given descriptor describes an entity that doesn't come from -// the current file. -std::string Generator::ModuleLevelMessageName( - const Descriptor& descriptor) const { - std::string name = NamePrefixedWithNestedTypes(descriptor, "."); - if (descriptor.file() != file_) { - name = ModuleAlias(descriptor.file()->name()) + "." + name; - } - return name; -} - -// Returns the unique Python module-level identifier given to a service -// descriptor. -std::string Generator::ModuleLevelServiceDescriptorName( - const ServiceDescriptor& descriptor) const { - std::string name = descriptor.name(); - ToUpper(&name); - name = "_" + name; - if (descriptor.file() != file_) { - name = ModuleAlias(descriptor.file()->name()) + "." + name; - } - return name; -} - -// Prints standard constructor arguments serialized_start and serialized_end. -// Args: -// descriptor: The cpp descriptor to have a serialized reference. -// proto: A proto -// Example printer output: -// serialized_start=41, -// serialized_end=43, -// -template -void Generator::PrintSerializedPbInterval(const DescriptorT& descriptor, - DescriptorProtoT& proto, - const std::string& name) const { - descriptor.CopyTo(&proto); - std::string sp; - proto.SerializeToString(&sp); - int offset = file_descriptor_serialized_.find(sp); - GOOGLE_CHECK_GE(offset, 0); - - printer_->Print( - "$name$._serialized_start=$serialized_start$\n" - "$name$._serialized_end=$serialized_end$\n", - "name", name, "serialized_start", StrCat(offset), "serialized_end", - StrCat(offset + sp.size())); -} - -namespace { -void PrintDescriptorOptionsFixingCode(const std::string& descriptor, - const std::string& options, - io::Printer* printer) { - // Reset the _options to None thus DescriptorBase.GetOptions() can - // parse _options again after extensions are registered. - printer->Print( - "$descriptor$._options = None\n" - "$descriptor$._serialized_options = $serialized_value$\n", - "descriptor", descriptor, "serialized_value", options); -} -} // namespace - -void Generator::SetSerializedPbInterval() const { - // Top level enums. - for (int i = 0; i < file_->enum_type_count(); ++i) { - EnumDescriptorProto proto; - const EnumDescriptor& descriptor = *file_->enum_type(i); - PrintSerializedPbInterval(descriptor, proto, - ModuleLevelDescriptorName(descriptor)); - } - - // Messages. - for (int i = 0; i < file_->message_type_count(); ++i) { - SetMessagePbInterval(*file_->message_type(i)); - } - - // Services. - for (int i = 0; i < file_->service_count(); ++i) { - ServiceDescriptorProto proto; - const ServiceDescriptor& service = *file_->service(i); - PrintSerializedPbInterval(service, proto, - ModuleLevelServiceDescriptorName(service)); - } -} - -void Generator::SetMessagePbInterval(const Descriptor& descriptor) const { - DescriptorProto message_proto; - PrintSerializedPbInterval(descriptor, message_proto, - ModuleLevelDescriptorName(descriptor)); - - // Nested messages. - for (int i = 0; i < descriptor.nested_type_count(); ++i) { - SetMessagePbInterval(*descriptor.nested_type(i)); - } - - for (int i = 0; i < descriptor.enum_type_count(); ++i) { - EnumDescriptorProto proto; - const EnumDescriptor& enum_des = *descriptor.enum_type(i); - PrintSerializedPbInterval(enum_des, proto, - ModuleLevelDescriptorName(enum_des)); - } -} - -// Prints expressions that set the options field of all descriptors. -void Generator::FixAllDescriptorOptions() const { - // Prints an expression that sets the file descriptor's options. - std::string file_options = OptionsValue(file_->options().SerializeAsString()); - if (file_options != "None") { - PrintDescriptorOptionsFixingCode(kDescriptorKey, file_options, printer_); - } else { - printer_->Print("DESCRIPTOR._options = None\n"); - } - // Prints expressions that set the options for all top level enums. - for (int i = 0; i < file_->enum_type_count(); ++i) { - const EnumDescriptor& enum_descriptor = *file_->enum_type(i); - FixOptionsForEnum(enum_descriptor); - } - // Prints expressions that set the options for all top level extensions. - for (int i = 0; i < file_->extension_count(); ++i) { - const FieldDescriptor& field = *file_->extension(i); - FixOptionsForField(field); - } - // Prints expressions that set the options for all messages, nested enums, - // nested extensions and message fields. - for (int i = 0; i < file_->message_type_count(); ++i) { - FixOptionsForMessage(*file_->message_type(i)); - } - - for (int i = 0; i < file_->service_count(); ++i) { - FixOptionsForService(*file_->service(i)); - } -} - -void Generator::FixOptionsForOneof(const OneofDescriptor& oneof) const { - std::string oneof_options = OptionsValue(oneof.options().SerializeAsString()); - if (oneof_options != "None") { - std::string oneof_name = strings::Substitute( - "$0.$1['$2']", ModuleLevelDescriptorName(*oneof.containing_type()), - "oneofs_by_name", oneof.name()); - PrintDescriptorOptionsFixingCode(oneof_name, oneof_options, printer_); - } -} - -// Prints expressions that set the options for an enum descriptor and its -// value descriptors. -void Generator::FixOptionsForEnum(const EnumDescriptor& enum_descriptor) const { - std::string descriptor_name = ModuleLevelDescriptorName(enum_descriptor); - std::string enum_options = - OptionsValue(enum_descriptor.options().SerializeAsString()); - if (enum_options != "None") { - PrintDescriptorOptionsFixingCode(descriptor_name, enum_options, printer_); - } - for (int i = 0; i < enum_descriptor.value_count(); ++i) { - const EnumValueDescriptor& value_descriptor = *enum_descriptor.value(i); - std::string value_options = - OptionsValue(value_descriptor.options().SerializeAsString()); - if (value_options != "None") { - PrintDescriptorOptionsFixingCode( - StringPrintf("%s.values_by_name[\"%s\"]", descriptor_name.c_str(), - value_descriptor.name().c_str()), - value_options, printer_); - } - } -} - -// Prints expressions that set the options for an service descriptor and its -// value descriptors. -void Generator::FixOptionsForService( - const ServiceDescriptor& service_descriptor) const { - std::string descriptor_name = - ModuleLevelServiceDescriptorName(service_descriptor); - std::string service_options = - OptionsValue(service_descriptor.options().SerializeAsString()); - if (service_options != "None") { - PrintDescriptorOptionsFixingCode(descriptor_name, service_options, - printer_); - } - - for (int i = 0; i < service_descriptor.method_count(); ++i) { - const MethodDescriptor* method = service_descriptor.method(i); - std::string method_options = - OptionsValue(method->options().SerializeAsString()); - if (method_options != "None") { - std::string method_name = - descriptor_name + ".methods_by_name['" + method->name() + "']"; - PrintDescriptorOptionsFixingCode(method_name, method_options, printer_); - } - } -} - -// Prints expressions that set the options for field descriptors (including -// extensions). -void Generator::FixOptionsForField(const FieldDescriptor& field) const { - std::string field_options = OptionsValue(field.options().SerializeAsString()); - if (field_options != "None") { - std::string field_name; - if (field.is_extension()) { - if (field.extension_scope() == nullptr) { - // Top level extensions. - field_name = field.name(); - } else { - field_name = FieldReferencingExpression(field.extension_scope(), field, - "extensions_by_name"); - } - } else { - field_name = FieldReferencingExpression(field.containing_type(), field, - "fields_by_name"); - } - PrintDescriptorOptionsFixingCode(field_name, field_options, printer_); - } -} - -// Prints expressions that set the options for a message and all its inner -// types (nested messages, nested enums, extensions, fields). -void Generator::FixOptionsForMessage(const Descriptor& descriptor) const { - // Nested messages. - for (int i = 0; i < descriptor.nested_type_count(); ++i) { - FixOptionsForMessage(*descriptor.nested_type(i)); - } - // Oneofs. - for (int i = 0; i < descriptor.oneof_decl_count(); ++i) { - FixOptionsForOneof(*descriptor.oneof_decl(i)); - } - // Enums. - for (int i = 0; i < descriptor.enum_type_count(); ++i) { - FixOptionsForEnum(*descriptor.enum_type(i)); - } - // Fields. - for (int i = 0; i < descriptor.field_count(); ++i) { - const FieldDescriptor& field = *descriptor.field(i); - FixOptionsForField(field); - } - // Extensions. - for (int i = 0; i < descriptor.extension_count(); ++i) { - const FieldDescriptor& field = *descriptor.extension(i); - FixOptionsForField(field); - } - // Message option for this message. - std::string message_options = - OptionsValue(descriptor.options().SerializeAsString()); - if (message_options != "None") { - std::string descriptor_name = ModuleLevelDescriptorName(descriptor); - PrintDescriptorOptionsFixingCode(descriptor_name, message_options, - printer_); - } -} - -// If a dependency forwards other files through public dependencies, let's -// copy over the corresponding module aliases. -void Generator::CopyPublicDependenciesAliases( - const std::string& copy_from, const FileDescriptor* file) const { - for (int i = 0; i < file->public_dependency_count(); ++i) { - std::string module_name = ModuleName(file->public_dependency(i)->name()); - std::string module_alias = ModuleAlias(file->public_dependency(i)->name()); - // There's no module alias in the dependent file if it was generated by - // an old protoc (less than 3.0.0-alpha-1). Use module name in this - // situation. - printer_->Print( - "try:\n" - " $alias$ = $copy_from$.$alias$\n" - "except AttributeError:\n" - " $alias$ = $copy_from$.$module$\n", - "alias", module_alias, "module", module_name, "copy_from", copy_from); - CopyPublicDependenciesAliases(copy_from, file->public_dependency(i)); - } -} - -} // namespace python -} // namespace compiler -} // namespace protobuf -} // namespace google diff --git a/extra/protobuf/protobuf-3.19.4/src/google/protobuf/compiler/python/python_generator.h b/extra/protobuf/protobuf-3.19.4/src/google/protobuf/compiler/python/python_generator.h deleted file mode 100644 index 3b4c1323bdd2..000000000000 --- a/extra/protobuf/protobuf-3.19.4/src/google/protobuf/compiler/python/python_generator.h +++ /dev/null @@ -1,193 +0,0 @@ -// Protocol Buffers - Google's data interchange format -// Copyright 2008 Google Inc. All rights reserved. -// https://developers.google.com/protocol-buffers/ -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// * Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// * Redistributions in binary form must reproduce the above -// copyright notice, this list of conditions and the following disclaimer -// in the documentation and/or other materials provided with the -// distribution. -// * Neither the name of Google Inc. nor the names of its -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -// Author: robinson@google.com (Will Robinson) -// -// Generates Python code for a given .proto file. - -#ifndef GOOGLE_PROTOBUF_COMPILER_PYTHON_GENERATOR_H__ -#define GOOGLE_PROTOBUF_COMPILER_PYTHON_GENERATOR_H__ - -#include - -#include -#include - -#include - -namespace google { -namespace protobuf { - -class Descriptor; -class EnumDescriptor; -class EnumValueDescriptor; -class FieldDescriptor; -class OneofDescriptor; -class ServiceDescriptor; - -namespace io { -class Printer; -} - -namespace compiler { -namespace python { - -enum class StripPrintDescriptor { kCreate, kFind }; - -// CodeGenerator implementation for generated Python protocol buffer classes. -// If you create your own protocol compiler binary and you want it to support -// Python output, you can do so by registering an instance of this -// CodeGenerator with the CommandLineInterface in your main() function. -class PROTOC_EXPORT Generator : public CodeGenerator { - public: - Generator(); - virtual ~Generator(); - - // CodeGenerator methods. - bool Generate(const FileDescriptor* file, const std::string& parameter, - GeneratorContext* generator_context, - std::string* error) const override; - - uint64_t GetSupportedFeatures() const override; - - private: - void PrintImports() const; - void PrintFileDescriptor() const; - void PrintTopLevelEnums() const; - void PrintAllNestedEnumsInFile(StripPrintDescriptor print_mode) const; - void PrintNestedEnums(const Descriptor& descriptor, - StripPrintDescriptor print_mode) const; - void PrintCreateEnum(const EnumDescriptor& enum_descriptor) const; - void PrintFindEnum(const EnumDescriptor& enum_descriptor) const; - - void PrintTopLevelExtensions() const; - - void PrintFieldDescriptor(const FieldDescriptor& field, - bool is_extension) const; - void PrintFieldDescriptorsInDescriptor( - const Descriptor& message_descriptor, bool is_extension, - const std::string& list_variable_name, int (Descriptor::*CountFn)() const, - const FieldDescriptor* (Descriptor::*GetterFn)(int)const) const; - void PrintFieldsInDescriptor(const Descriptor& message_descriptor) const; - void PrintExtensionsInDescriptor(const Descriptor& message_descriptor) const; - void PrintMessageDescriptors(StripPrintDescriptor print_mode) const; - void PrintCreateDescriptor(const Descriptor& message_descriptor) const; - void PrintFindDescriptor(const Descriptor& message_descriptor) const; - void PrintNestedDescriptors(const Descriptor& containing_descriptor, - StripPrintDescriptor print_mode) const; - - void PrintMessages() const; - void PrintMessage(const Descriptor& message_descriptor, - const std::string& prefix, - std::vector* to_register, - bool is_nested) const; - void PrintNestedMessages(const Descriptor& containing_descriptor, - const std::string& prefix, - std::vector* to_register) const; - - void FixForeignFieldsInDescriptors() const; - void FixForeignFieldsInDescriptor( - const Descriptor& descriptor, - const Descriptor* containing_descriptor) const; - void FixForeignFieldsInField(const Descriptor* containing_type, - const FieldDescriptor& field, - const std::string& python_dict_name) const; - void AddMessageToFileDescriptor(const Descriptor& descriptor) const; - void AddEnumToFileDescriptor(const EnumDescriptor& descriptor) const; - void AddExtensionToFileDescriptor(const FieldDescriptor& descriptor) const; - void AddServiceToFileDescriptor(const ServiceDescriptor& descriptor) const; - std::string FieldReferencingExpression( - const Descriptor* containing_type, const FieldDescriptor& field, - const std::string& python_dict_name) const; - template - void FixContainingTypeInDescriptor( - const DescriptorT& descriptor, - const Descriptor* containing_descriptor) const; - - void FixForeignFieldsInExtensions() const; - void FixForeignFieldsInExtension( - const FieldDescriptor& extension_field) const; - void FixForeignFieldsInNestedExtensions(const Descriptor& descriptor) const; - - void PrintServices() const; - void PrintServiceDescriptors() const; - void PrintServiceDescriptor(const ServiceDescriptor& descriptor) const; - void PrintServiceClass(const ServiceDescriptor& descriptor) const; - void PrintServiceStub(const ServiceDescriptor& descriptor) const; - void PrintDescriptorKeyAndModuleName( - const ServiceDescriptor& descriptor) const; - - void PrintEnumValueDescriptor(const EnumValueDescriptor& descriptor) const; - std::string OptionsValue(const std::string& serialized_options) const; - bool GeneratingDescriptorProto() const; - - template - std::string ModuleLevelDescriptorName(const DescriptorT& descriptor) const; - std::string ModuleLevelMessageName(const Descriptor& descriptor) const; - std::string ModuleLevelServiceDescriptorName( - const ServiceDescriptor& descriptor) const; - - template - void PrintSerializedPbInterval(const DescriptorT& descriptor, - DescriptorProtoT& proto, - const std::string& name) const; - - void FixAllDescriptorOptions() const; - void FixOptionsForField(const FieldDescriptor& field) const; - void FixOptionsForOneof(const OneofDescriptor& oneof) const; - void FixOptionsForEnum(const EnumDescriptor& descriptor) const; - void FixOptionsForService(const ServiceDescriptor& descriptor) const; - void FixOptionsForMessage(const Descriptor& descriptor) const; - - void SetSerializedPbInterval() const; - void SetMessagePbInterval(const Descriptor& descriptor) const; - - void CopyPublicDependenciesAliases(const std::string& copy_from, - const FileDescriptor* file) const; - - // Very coarse-grained lock to ensure that Generate() is reentrant. - // Guards file_, printer_ and file_descriptor_serialized_. - mutable Mutex mutex_; - mutable const FileDescriptor* file_; // Set in Generate(). Under mutex_. - mutable std::string file_descriptor_serialized_; - mutable io::Printer* printer_; // Set in Generate(). Under mutex_. - mutable bool pure_python_workable_; - - GOOGLE_DISALLOW_EVIL_CONSTRUCTORS(Generator); -}; - -} // namespace python -} // namespace compiler -} // namespace protobuf -} // namespace google - -#include - -#endif // GOOGLE_PROTOBUF_COMPILER_PYTHON_GENERATOR_H__ diff --git a/extra/protobuf/protobuf-3.19.4/src/google/protobuf/compiler/python/python_plugin_unittest.cc b/extra/protobuf/protobuf-3.19.4/src/google/protobuf/compiler/python/python_plugin_unittest.cc deleted file mode 100644 index 76ceef32a0af..000000000000 --- a/extra/protobuf/protobuf-3.19.4/src/google/protobuf/compiler/python/python_plugin_unittest.cc +++ /dev/null @@ -1,161 +0,0 @@ -// Protocol Buffers - Google's data interchange format -// Copyright 2008 Google Inc. All rights reserved. -// https://developers.google.com/protocol-buffers/ -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// * Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// * Redistributions in binary form must reproduce the above -// copyright notice, this list of conditions and the following disclaimer -// in the documentation and/or other materials provided with the -// distribution. -// * Neither the name of Google Inc. nor the names of its -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -// Author: kenton@google.com (Kenton Varda) -// -// TODO(kenton): Share code with the versions of this test in other languages? -// It seemed like parameterizing it would add more complexity than it is -// worth. - -#include - -#include -#include -#include -#include -#include -#include -#include -#include -#include - -namespace google { -namespace protobuf { -namespace compiler { -namespace python { -namespace { - -class TestGenerator : public CodeGenerator { - public: - TestGenerator() {} - ~TestGenerator() {} - - virtual bool Generate(const FileDescriptor* file, - const std::string& parameter, GeneratorContext* context, - std::string* error) const { - TryInsert("test_pb2.py", "imports", context); - TryInsert("test_pb2.py", "module_scope", context); - TryInsert("test_pb2.py", "class_scope:foo.Bar", context); - TryInsert("test_pb2.py", "class_scope:foo.Bar.Baz", context); - return true; - } - - void TryInsert(const std::string& filename, - const std::string& insertion_point, - GeneratorContext* context) const { - std::unique_ptr output( - context->OpenForInsert(filename, insertion_point)); - io::Printer printer(output.get(), '$'); - printer.Print("// inserted $name$\n", "name", insertion_point); - } -}; - -// This test verifies that all the expected insertion points exist. It does -// not verify that they are correctly-placed; that would require actually -// compiling the output which is a bit more than I care to do for this test. -TEST(PythonPluginTest, PluginTest) { - GOOGLE_CHECK_OK(File::SetContents(TestTempDir() + "/test.proto", - "syntax = \"proto2\";\n" - "package foo;\n" - "message Bar {\n" - " message Baz {}\n" - "}\n", - true)); - - compiler::CommandLineInterface cli; - cli.SetInputsAreProtoPathRelative(true); - - python::Generator python_generator; - TestGenerator test_generator; - cli.RegisterGenerator("--python_out", &python_generator, ""); - cli.RegisterGenerator("--test_out", &test_generator, ""); - - std::string proto_path = "-I" + TestTempDir(); - std::string python_out = "--python_out=" + TestTempDir(); - std::string test_out = "--test_out=" + TestTempDir(); - - const char* argv[] = {"protoc", proto_path.c_str(), python_out.c_str(), - test_out.c_str(), "test.proto"}; - - EXPECT_EQ(0, cli.Run(5, argv)); -} - -// This test verifies that the generated Python output uses regular imports (as -// opposed to importlib) in the usual case where the .proto file paths do not -// not contain any Python keywords. -TEST(PythonPluginTest, ImportTest) { - // Create files test1.proto and test2.proto with the former importing the - // latter. - GOOGLE_CHECK_OK(File::SetContents(TestTempDir() + "/test1.proto", - "syntax = \"proto3\";\n" - "package foo;\n" - "import \"test2.proto\";" - "message Message1 {\n" - " Message2 message_2 = 1;\n" - "}\n", - true)); - GOOGLE_CHECK_OK(File::SetContents(TestTempDir() + "/test2.proto", - "syntax = \"proto3\";\n" - "package foo;\n" - "message Message2 {}\n", - true)); - - compiler::CommandLineInterface cli; - cli.SetInputsAreProtoPathRelative(true); - python::Generator python_generator; - cli.RegisterGenerator("--python_out", &python_generator, ""); - std::string proto_path = "-I" + TestTempDir(); - std::string python_out = "--python_out=" + TestTempDir(); - const char* argv[] = {"protoc", proto_path.c_str(), "-I.", python_out.c_str(), - "test1.proto"}; - ASSERT_EQ(0, cli.Run(5, argv)); - - // Loop over the lines of the generated code and verify that we find an - // ordinary Python import but do not find the string "importlib". - std::string output; - GOOGLE_CHECK_OK(File::GetContents(TestTempDir() + "/test1_pb2.py", &output, - true)); - std::vector lines = Split(output, "\n"); - std::string expected_import = "import test2_pb2"; - bool found_expected_import = false; - for (int i = 0; i < lines.size(); ++i) { - if (lines[i].find(expected_import) != std::string::npos) { - found_expected_import = true; - } - EXPECT_EQ(std::string::npos, lines[i].find("importlib")); - } - EXPECT_TRUE(found_expected_import); -} - -} // namespace -} // namespace python -} // namespace compiler -} // namespace protobuf -} // namespace google diff --git a/extra/protobuf/protobuf-3.19.4/src/google/protobuf/compiler/ruby/ruby_generated_code.proto b/extra/protobuf/protobuf-3.19.4/src/google/protobuf/compiler/ruby/ruby_generated_code.proto deleted file mode 100644 index 70ec9f17a0fc..000000000000 --- a/extra/protobuf/protobuf-3.19.4/src/google/protobuf/compiler/ruby/ruby_generated_code.proto +++ /dev/null @@ -1,70 +0,0 @@ -syntax = "proto3"; - -package A.B.C; - -import "ruby_generated_code_proto2_import.proto"; - -message TestMessage { - int32 optional_int32 = 1; - int64 optional_int64 = 2; - uint32 optional_uint32 = 3; - uint64 optional_uint64 = 4; - bool optional_bool = 5; - double optional_double = 6; - float optional_float = 7; - string optional_string = 8; - bytes optional_bytes = 9; - TestEnum optional_enum = 10; - TestMessage optional_msg = 11; - TestImportedMessage optional_proto2_submessage = 12; - - repeated int32 repeated_int32 = 21; - repeated int64 repeated_int64 = 22; - repeated uint32 repeated_uint32 = 23; - repeated uint64 repeated_uint64 = 24; - repeated bool repeated_bool = 25; - repeated double repeated_double = 26; - repeated float repeated_float = 27; - repeated string repeated_string = 28; - repeated bytes repeated_bytes = 29; - repeated TestEnum repeated_enum = 30; - repeated TestMessage repeated_msg = 31; - - oneof my_oneof { - int32 oneof_int32 = 41; - int64 oneof_int64 = 42; - uint32 oneof_uint32 = 43; - uint64 oneof_uint64 = 44; - bool oneof_bool = 45; - double oneof_double = 46; - float oneof_float = 47; - string oneof_string = 48; - bytes oneof_bytes = 49; - TestEnum oneof_enum = 50; - TestMessage oneof_msg = 51; - } - - map map_int32_string = 61; - map map_int64_string = 62; - map map_uint32_string = 63; - map map_uint64_string = 64; - map map_bool_string = 65; - map map_string_string = 66; - map map_string_msg = 67; - map map_string_enum = 68; - map map_string_int32 = 69; - map map_string_bool = 70; - - message NestedMessage { - int32 foo = 1; - } - - NestedMessage nested_message = 80; -} - -enum TestEnum { - Default = 0; - A = 1; - B = 2; - C = 3; -} diff --git a/extra/protobuf/protobuf-3.19.4/src/google/protobuf/compiler/ruby/ruby_generated_code_pb.rb b/extra/protobuf/protobuf-3.19.4/src/google/protobuf/compiler/ruby/ruby_generated_code_pb.rb deleted file mode 100644 index 256ac7c153a3..000000000000 --- a/extra/protobuf/protobuf-3.19.4/src/google/protobuf/compiler/ruby/ruby_generated_code_pb.rb +++ /dev/null @@ -1,79 +0,0 @@ -# Generated by the protocol buffer compiler. DO NOT EDIT! -# source: ruby_generated_code.proto - -require 'google/protobuf' - -require 'ruby_generated_code_proto2_import_pb' - -Google::Protobuf::DescriptorPool.generated_pool.build do - add_file("ruby_generated_code.proto", :syntax => :proto3) do - add_message "A.B.C.TestMessage" do - optional :optional_int32, :int32, 1 - optional :optional_int64, :int64, 2 - optional :optional_uint32, :uint32, 3 - optional :optional_uint64, :uint64, 4 - optional :optional_bool, :bool, 5 - optional :optional_double, :double, 6 - optional :optional_float, :float, 7 - optional :optional_string, :string, 8 - optional :optional_bytes, :bytes, 9 - optional :optional_enum, :enum, 10, "A.B.C.TestEnum" - optional :optional_msg, :message, 11, "A.B.C.TestMessage" - optional :optional_proto2_submessage, :message, 12, "A.B.C.TestImportedMessage" - repeated :repeated_int32, :int32, 21 - repeated :repeated_int64, :int64, 22 - repeated :repeated_uint32, :uint32, 23 - repeated :repeated_uint64, :uint64, 24 - repeated :repeated_bool, :bool, 25 - repeated :repeated_double, :double, 26 - repeated :repeated_float, :float, 27 - repeated :repeated_string, :string, 28 - repeated :repeated_bytes, :bytes, 29 - repeated :repeated_enum, :enum, 30, "A.B.C.TestEnum" - repeated :repeated_msg, :message, 31, "A.B.C.TestMessage" - map :map_int32_string, :int32, :string, 61 - map :map_int64_string, :int64, :string, 62 - map :map_uint32_string, :uint32, :string, 63 - map :map_uint64_string, :uint64, :string, 64 - map :map_bool_string, :bool, :string, 65 - map :map_string_string, :string, :string, 66 - map :map_string_msg, :string, :message, 67, "A.B.C.TestMessage" - map :map_string_enum, :string, :enum, 68, "A.B.C.TestEnum" - map :map_string_int32, :string, :int32, 69 - map :map_string_bool, :string, :bool, 70 - optional :nested_message, :message, 80, "A.B.C.TestMessage.NestedMessage" - oneof :my_oneof do - optional :oneof_int32, :int32, 41 - optional :oneof_int64, :int64, 42 - optional :oneof_uint32, :uint32, 43 - optional :oneof_uint64, :uint64, 44 - optional :oneof_bool, :bool, 45 - optional :oneof_double, :double, 46 - optional :oneof_float, :float, 47 - optional :oneof_string, :string, 48 - optional :oneof_bytes, :bytes, 49 - optional :oneof_enum, :enum, 50, "A.B.C.TestEnum" - optional :oneof_msg, :message, 51, "A.B.C.TestMessage" - end - end - add_message "A.B.C.TestMessage.NestedMessage" do - optional :foo, :int32, 1 - end - add_enum "A.B.C.TestEnum" do - value :Default, 0 - value :A, 1 - value :B, 2 - value :C, 3 - end - end -end - -module A - module B - module C - TestMessage = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("A.B.C.TestMessage").msgclass - TestMessage::NestedMessage = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("A.B.C.TestMessage.NestedMessage").msgclass - TestEnum = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("A.B.C.TestEnum").enummodule - end - end -end diff --git a/extra/protobuf/protobuf-3.19.4/src/google/protobuf/compiler/ruby/ruby_generated_code_proto2.proto b/extra/protobuf/protobuf-3.19.4/src/google/protobuf/compiler/ruby/ruby_generated_code_proto2.proto deleted file mode 100644 index ea7f78363447..000000000000 --- a/extra/protobuf/protobuf-3.19.4/src/google/protobuf/compiler/ruby/ruby_generated_code_proto2.proto +++ /dev/null @@ -1,71 +0,0 @@ -syntax = "proto2"; - -package A.B.C; - -import "ruby_generated_code_proto2_import.proto"; - -message TestMessage { - optional int32 optional_int32 = 1 [default = 1]; - optional int64 optional_int64 = 2 [default = 2]; - optional uint32 optional_uint32 = 3 [default = 3]; - optional uint64 optional_uint64 = 4 [default = 4]; - optional bool optional_bool = 5 [default = true]; - optional double optional_double = 6 [default = 6.0]; - optional float optional_float = 7 [default = 7.0]; - optional string optional_string = 8 [default = "default str"]; - optional bytes optional_bytes = 9 [default = "\0\1\2\100fubar"]; - optional TestEnum optional_enum = 10 [default = A]; - optional TestMessage optional_msg = 11; - optional TestImportedMessage optional_proto2_submessage = 12; - - repeated int32 repeated_int32 = 21; - repeated int64 repeated_int64 = 22; - repeated uint32 repeated_uint32 = 23; - repeated uint64 repeated_uint64 = 24; - repeated bool repeated_bool = 25; - repeated double repeated_double = 26; - repeated float repeated_float = 27; - repeated string repeated_string = 28; - repeated bytes repeated_bytes = 29; - repeated TestEnum repeated_enum = 30; - repeated TestMessage repeated_msg = 31; - - required int32 required_int32 = 41; - required int64 required_int64 = 42; - required uint32 required_uint32 = 43; - required uint64 required_uint64 = 44; - required bool required_bool = 45; - required double required_double = 46; - required float required_float = 47; - required string required_string = 48; - required bytes required_bytes = 49; - required TestEnum required_enum = 50; - required TestMessage required_msg = 51; - - oneof my_oneof { - int32 oneof_int32 = 61; - int64 oneof_int64 = 62; - uint32 oneof_uint32 = 63; - uint64 oneof_uint64 = 64; - bool oneof_bool = 65; - double oneof_double = 66; - float oneof_float = 67; - string oneof_string = 68; - bytes oneof_bytes = 69; - TestEnum oneof_enum = 70; - TestMessage oneof_msg = 71; - } - - message NestedMessage { - optional int32 foo = 1; - } - - optional NestedMessage nested_message = 80; -} - -enum TestEnum { - Default = 0; - A = 1; - B = 2; - C = 3; -} diff --git a/extra/protobuf/protobuf-3.19.4/src/google/protobuf/compiler/ruby/ruby_generated_code_proto2_import.proto b/extra/protobuf/protobuf-3.19.4/src/google/protobuf/compiler/ruby/ruby_generated_code_proto2_import.proto deleted file mode 100644 index 9ec07381be54..000000000000 --- a/extra/protobuf/protobuf-3.19.4/src/google/protobuf/compiler/ruby/ruby_generated_code_proto2_import.proto +++ /dev/null @@ -1,5 +0,0 @@ -syntax = "proto2"; - -package A.B.C; - -message TestImportedMessage {} diff --git a/extra/protobuf/protobuf-3.19.4/src/google/protobuf/compiler/ruby/ruby_generated_code_proto2_pb.rb b/extra/protobuf/protobuf-3.19.4/src/google/protobuf/compiler/ruby/ruby_generated_code_proto2_pb.rb deleted file mode 100644 index 44d31969eca4..000000000000 --- a/extra/protobuf/protobuf-3.19.4/src/google/protobuf/compiler/ruby/ruby_generated_code_proto2_pb.rb +++ /dev/null @@ -1,80 +0,0 @@ -# Generated by the protocol buffer compiler. DO NOT EDIT! -# source: ruby_generated_code_proto2.proto - -require 'google/protobuf' - -require 'ruby_generated_code_proto2_import_pb' - -Google::Protobuf::DescriptorPool.generated_pool.build do - add_file("ruby_generated_code_proto2.proto", :syntax => :proto2) do - add_message "A.B.C.TestMessage" do - optional :optional_int32, :int32, 1, default: 1 - optional :optional_int64, :int64, 2, default: 2 - optional :optional_uint32, :uint32, 3, default: 3 - optional :optional_uint64, :uint64, 4, default: 4 - optional :optional_bool, :bool, 5, default: true - optional :optional_double, :double, 6, default: 6 - optional :optional_float, :float, 7, default: 7 - optional :optional_string, :string, 8, default: "default str" - optional :optional_bytes, :bytes, 9, default: "\x00\x01\x02\x40\x66\x75\x62\x61\x72".force_encoding("ASCII-8BIT") - optional :optional_enum, :enum, 10, "A.B.C.TestEnum", default: 1 - optional :optional_msg, :message, 11, "A.B.C.TestMessage" - optional :optional_proto2_submessage, :message, 12, "A.B.C.TestImportedMessage" - repeated :repeated_int32, :int32, 21 - repeated :repeated_int64, :int64, 22 - repeated :repeated_uint32, :uint32, 23 - repeated :repeated_uint64, :uint64, 24 - repeated :repeated_bool, :bool, 25 - repeated :repeated_double, :double, 26 - repeated :repeated_float, :float, 27 - repeated :repeated_string, :string, 28 - repeated :repeated_bytes, :bytes, 29 - repeated :repeated_enum, :enum, 30, "A.B.C.TestEnum" - repeated :repeated_msg, :message, 31, "A.B.C.TestMessage" - required :required_int32, :int32, 41 - required :required_int64, :int64, 42 - required :required_uint32, :uint32, 43 - required :required_uint64, :uint64, 44 - required :required_bool, :bool, 45 - required :required_double, :double, 46 - required :required_float, :float, 47 - required :required_string, :string, 48 - required :required_bytes, :bytes, 49 - required :required_enum, :enum, 50, "A.B.C.TestEnum" - required :required_msg, :message, 51, "A.B.C.TestMessage" - optional :nested_message, :message, 80, "A.B.C.TestMessage.NestedMessage" - oneof :my_oneof do - optional :oneof_int32, :int32, 61 - optional :oneof_int64, :int64, 62 - optional :oneof_uint32, :uint32, 63 - optional :oneof_uint64, :uint64, 64 - optional :oneof_bool, :bool, 65 - optional :oneof_double, :double, 66 - optional :oneof_float, :float, 67 - optional :oneof_string, :string, 68 - optional :oneof_bytes, :bytes, 69 - optional :oneof_enum, :enum, 70, "A.B.C.TestEnum" - optional :oneof_msg, :message, 71, "A.B.C.TestMessage" - end - end - add_message "A.B.C.TestMessage.NestedMessage" do - optional :foo, :int32, 1 - end - add_enum "A.B.C.TestEnum" do - value :Default, 0 - value :A, 1 - value :B, 2 - value :C, 3 - end - end -end - -module A - module B - module C - TestMessage = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("A.B.C.TestMessage").msgclass - TestMessage::NestedMessage = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("A.B.C.TestMessage.NestedMessage").msgclass - TestEnum = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("A.B.C.TestEnum").enummodule - end - end -end diff --git a/extra/protobuf/protobuf-3.19.4/src/google/protobuf/compiler/ruby/ruby_generated_pkg_explicit.proto b/extra/protobuf/protobuf-3.19.4/src/google/protobuf/compiler/ruby/ruby_generated_pkg_explicit.proto deleted file mode 100644 index 8d7c948a180b..000000000000 --- a/extra/protobuf/protobuf-3.19.4/src/google/protobuf/compiler/ruby/ruby_generated_pkg_explicit.proto +++ /dev/null @@ -1,9 +0,0 @@ -syntax = "proto3"; - -package one.two.a_three; - -option ruby_package = "A::B::C"; - -message Four { - string a_string = 1; -} diff --git a/extra/protobuf/protobuf-3.19.4/src/google/protobuf/compiler/ruby/ruby_generated_pkg_explicit_legacy.proto b/extra/protobuf/protobuf-3.19.4/src/google/protobuf/compiler/ruby/ruby_generated_pkg_explicit_legacy.proto deleted file mode 100644 index 7a0d26086544..000000000000 --- a/extra/protobuf/protobuf-3.19.4/src/google/protobuf/compiler/ruby/ruby_generated_pkg_explicit_legacy.proto +++ /dev/null @@ -1,9 +0,0 @@ -syntax = "proto3"; - -package one.two.a_three.and; - -option ruby_package = "AA.BB.CC"; - -message Four { - string another_string = 1; -} diff --git a/extra/protobuf/protobuf-3.19.4/src/google/protobuf/compiler/ruby/ruby_generated_pkg_explicit_legacy_pb.rb b/extra/protobuf/protobuf-3.19.4/src/google/protobuf/compiler/ruby/ruby_generated_pkg_explicit_legacy_pb.rb deleted file mode 100644 index cdbbe891bc2a..000000000000 --- a/extra/protobuf/protobuf-3.19.4/src/google/protobuf/compiler/ruby/ruby_generated_pkg_explicit_legacy_pb.rb +++ /dev/null @@ -1,20 +0,0 @@ -# Generated by the protocol buffer compiler. DO NOT EDIT! -# source: ruby_generated_pkg_explicit_legacy.proto - -require 'google/protobuf' - -Google::Protobuf::DescriptorPool.generated_pool.build do - add_file("ruby_generated_pkg_explicit_legacy.proto", :syntax => :proto3) do - add_message "one.two.a_three.and.Four" do - optional :another_string, :string, 1 - end - end -end - -module AA - module BB - module CC - Four = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("one.two.a_three.and.Four").msgclass - end - end -end diff --git a/extra/protobuf/protobuf-3.19.4/src/google/protobuf/compiler/ruby/ruby_generated_pkg_explicit_pb.rb b/extra/protobuf/protobuf-3.19.4/src/google/protobuf/compiler/ruby/ruby_generated_pkg_explicit_pb.rb deleted file mode 100644 index e6d47011e882..000000000000 --- a/extra/protobuf/protobuf-3.19.4/src/google/protobuf/compiler/ruby/ruby_generated_pkg_explicit_pb.rb +++ /dev/null @@ -1,20 +0,0 @@ -# Generated by the protocol buffer compiler. DO NOT EDIT! -# source: ruby_generated_pkg_explicit.proto - -require 'google/protobuf' - -Google::Protobuf::DescriptorPool.generated_pool.build do - add_file("ruby_generated_pkg_explicit.proto", :syntax => :proto3) do - add_message "one.two.a_three.Four" do - optional :a_string, :string, 1 - end - end -end - -module A - module B - module C - Four = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("one.two.a_three.Four").msgclass - end - end -end diff --git a/extra/protobuf/protobuf-3.19.4/src/google/protobuf/compiler/ruby/ruby_generated_pkg_implicit.proto b/extra/protobuf/protobuf-3.19.4/src/google/protobuf/compiler/ruby/ruby_generated_pkg_implicit.proto deleted file mode 100644 index 544db64d94e9..000000000000 --- a/extra/protobuf/protobuf-3.19.4/src/google/protobuf/compiler/ruby/ruby_generated_pkg_implicit.proto +++ /dev/null @@ -1,7 +0,0 @@ -syntax = "proto3"; - -package one.two.a_three; - -message Four { - string a_string = 1; -} diff --git a/extra/protobuf/protobuf-3.19.4/src/google/protobuf/compiler/ruby/ruby_generated_pkg_implicit_pb.rb b/extra/protobuf/protobuf-3.19.4/src/google/protobuf/compiler/ruby/ruby_generated_pkg_implicit_pb.rb deleted file mode 100644 index 1ac0ef7ad045..000000000000 --- a/extra/protobuf/protobuf-3.19.4/src/google/protobuf/compiler/ruby/ruby_generated_pkg_implicit_pb.rb +++ /dev/null @@ -1,20 +0,0 @@ -# Generated by the protocol buffer compiler. DO NOT EDIT! -# source: ruby_generated_pkg_implicit.proto - -require 'google/protobuf' - -Google::Protobuf::DescriptorPool.generated_pool.build do - add_file("ruby_generated_pkg_implicit.proto", :syntax => :proto3) do - add_message "one.two.a_three.Four" do - optional :a_string, :string, 1 - end - end -end - -module One - module Two - module AThree - Four = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("one.two.a_three.Four").msgclass - end - end -end diff --git a/extra/protobuf/protobuf-3.19.4/src/google/protobuf/compiler/ruby/ruby_generator.cc b/extra/protobuf/protobuf-3.19.4/src/google/protobuf/compiler/ruby/ruby_generator.cc deleted file mode 100644 index 46e60f587474..000000000000 --- a/extra/protobuf/protobuf-3.19.4/src/google/protobuf/compiler/ruby/ruby_generator.cc +++ /dev/null @@ -1,575 +0,0 @@ -// Protocol Buffers - Google's data interchange format -// Copyright 2008 Google Inc. All rights reserved. -// https://developers.google.com/protocol-buffers/ -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// * Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// * Redistributions in binary form must reproduce the above -// copyright notice, this list of conditions and the following disclaimer -// in the documentation and/or other materials provided with the -// distribution. -// * Neither the name of Google Inc. nor the names of its -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -#include -#include - -#include -#include -#include -#include -#include -#include - -#include - -namespace google { -namespace protobuf { -namespace compiler { -namespace ruby { - -// Forward decls. -template -std::string NumberToString(numeric_type value); -std::string GetRequireName(const std::string& proto_file); -std::string LabelForField(FieldDescriptor* field); -std::string TypeName(FieldDescriptor* field); -bool GenerateMessage(const Descriptor* message, io::Printer* printer, - std::string* error); -void GenerateEnum(const EnumDescriptor* en, io::Printer* printer); -void GenerateMessageAssignment(const std::string& prefix, - const Descriptor* message, io::Printer* printer); -void GenerateEnumAssignment(const std::string& prefix, const EnumDescriptor* en, - io::Printer* printer); -std::string DefaultValueForField(const FieldDescriptor* field); - -template -std::string NumberToString(numeric_type value) { - std::ostringstream os; - os << value; - return os.str(); -} - -std::string GetRequireName(const std::string& proto_file) { - int lastindex = proto_file.find_last_of("."); - return proto_file.substr(0, lastindex) + "_pb"; -} - -std::string GetOutputFilename(const std::string& proto_file) { - return GetRequireName(proto_file) + ".rb"; -} - -std::string LabelForField(const FieldDescriptor* field) { - if (field->has_optional_keyword() && - field->file()->syntax() == FileDescriptor::SYNTAX_PROTO3) { - return "proto3_optional"; - } - switch (field->label()) { - case FieldDescriptor::LABEL_OPTIONAL: return "optional"; - case FieldDescriptor::LABEL_REQUIRED: return "required"; - case FieldDescriptor::LABEL_REPEATED: return "repeated"; - default: assert(false); return ""; - } -} - -std::string TypeName(const FieldDescriptor* field) { - switch (field->type()) { - case FieldDescriptor::TYPE_INT32: return "int32"; - case FieldDescriptor::TYPE_INT64: return "int64"; - case FieldDescriptor::TYPE_UINT32: return "uint32"; - case FieldDescriptor::TYPE_UINT64: return "uint64"; - case FieldDescriptor::TYPE_SINT32: return "sint32"; - case FieldDescriptor::TYPE_SINT64: return "sint64"; - case FieldDescriptor::TYPE_FIXED32: return "fixed32"; - case FieldDescriptor::TYPE_FIXED64: return "fixed64"; - case FieldDescriptor::TYPE_SFIXED32: return "sfixed32"; - case FieldDescriptor::TYPE_SFIXED64: return "sfixed64"; - case FieldDescriptor::TYPE_DOUBLE: return "double"; - case FieldDescriptor::TYPE_FLOAT: return "float"; - case FieldDescriptor::TYPE_BOOL: return "bool"; - case FieldDescriptor::TYPE_ENUM: return "enum"; - case FieldDescriptor::TYPE_STRING: return "string"; - case FieldDescriptor::TYPE_BYTES: return "bytes"; - case FieldDescriptor::TYPE_MESSAGE: return "message"; - case FieldDescriptor::TYPE_GROUP: return "group"; - default: assert(false); return ""; - } -} - -std::string StringifySyntax(FileDescriptor::Syntax syntax) { - switch (syntax) { - case FileDescriptor::SYNTAX_PROTO2: - return "proto2"; - case FileDescriptor::SYNTAX_PROTO3: - return "proto3"; - case FileDescriptor::SYNTAX_UNKNOWN: - default: - GOOGLE_LOG(FATAL) << "Unsupported syntax; this generator only supports " - "proto2 and proto3 syntax."; - return ""; - } -} - -std::string DefaultValueForField(const FieldDescriptor* field) { - switch(field->cpp_type()) { - case FieldDescriptor::CPPTYPE_INT32: - return NumberToString(field->default_value_int32()); - case FieldDescriptor::CPPTYPE_INT64: - return NumberToString(field->default_value_int64()); - case FieldDescriptor::CPPTYPE_UINT32: - return NumberToString(field->default_value_uint32()); - case FieldDescriptor::CPPTYPE_UINT64: - return NumberToString(field->default_value_uint64()); - case FieldDescriptor::CPPTYPE_FLOAT: - return NumberToString(field->default_value_float()); - case FieldDescriptor::CPPTYPE_DOUBLE: - return NumberToString(field->default_value_double()); - case FieldDescriptor::CPPTYPE_BOOL: - return field->default_value_bool() ? "true" : "false"; - case FieldDescriptor::CPPTYPE_ENUM: - return NumberToString(field->default_value_enum()->number()); - case FieldDescriptor::CPPTYPE_STRING: { - std::ostringstream os; - std::string default_str = field->default_value_string(); - - if (field->type() == FieldDescriptor::TYPE_STRING) { - os << "\"" << default_str << "\""; - } else if (field->type() == FieldDescriptor::TYPE_BYTES) { - os << "\""; - - os.fill('0'); - for (int i = 0; i < default_str.length(); ++i) { - // Write the hex form of each byte. - os << "\\x" << std::hex << std::setw(2) - << ((uint16)((unsigned char)default_str.at(i))); - } - os << "\".force_encoding(\"ASCII-8BIT\")"; - } - - return os.str(); - } - default: assert(false); return ""; - } -} - -void GenerateField(const FieldDescriptor* field, io::Printer* printer) { - if (field->is_map()) { - const FieldDescriptor* key_field = - field->message_type()->FindFieldByNumber(1); - const FieldDescriptor* value_field = - field->message_type()->FindFieldByNumber(2); - - printer->Print( - "map :$name$, :$key_type$, :$value_type$, $number$", - "name", field->name(), - "key_type", TypeName(key_field), - "value_type", TypeName(value_field), - "number", NumberToString(field->number())); - - if (value_field->cpp_type() == FieldDescriptor::CPPTYPE_MESSAGE) { - printer->Print( - ", \"$subtype$\"\n", - "subtype", value_field->message_type()->full_name()); - } else if (value_field->cpp_type() == FieldDescriptor::CPPTYPE_ENUM) { - printer->Print( - ", \"$subtype$\"\n", - "subtype", value_field->enum_type()->full_name()); - } else { - printer->Print("\n"); - } - } else { - - printer->Print( - "$label$ :$name$, ", - "label", LabelForField(field), - "name", field->name()); - printer->Print( - ":$type$, $number$", - "type", TypeName(field), - "number", NumberToString(field->number())); - - if (field->cpp_type() == FieldDescriptor::CPPTYPE_MESSAGE) { - printer->Print( - ", \"$subtype$\"", - "subtype", field->message_type()->full_name()); - } else if (field->cpp_type() == FieldDescriptor::CPPTYPE_ENUM) { - printer->Print( - ", \"$subtype$\"", - "subtype", field->enum_type()->full_name()); - } - - if (field->has_default_value()) { - printer->Print(", default: $default$", "default", - DefaultValueForField(field)); - } - - if (field->has_json_name()) { - printer->Print(", json_name: \"$json_name$\"", "json_name", - field->json_name()); - } - - printer->Print("\n"); - } -} - -void GenerateOneof(const OneofDescriptor* oneof, io::Printer* printer) { - printer->Print( - "oneof :$name$ do\n", - "name", oneof->name()); - printer->Indent(); - - for (int i = 0; i < oneof->field_count(); i++) { - const FieldDescriptor* field = oneof->field(i); - GenerateField(field, printer); - } - - printer->Outdent(); - printer->Print("end\n"); -} - -bool GenerateMessage(const Descriptor* message, io::Printer* printer, - std::string* error) { - if (message->extension_range_count() > 0 || message->extension_count() > 0) { - GOOGLE_LOG(WARNING) << "Extensions are not yet supported for proto2 .proto files."; - } - - // Don't generate MapEntry messages -- we use the Ruby extension's native - // support for map fields instead. - if (message->options().map_entry()) { - return true; - } - - printer->Print( - "add_message \"$name$\" do\n", - "name", message->full_name()); - printer->Indent(); - - for (int i = 0; i < message->field_count(); i++) { - const FieldDescriptor* field = message->field(i); - if (!field->real_containing_oneof()) { - GenerateField(field, printer); - } - } - - for (int i = 0; i < message->real_oneof_decl_count(); i++) { - const OneofDescriptor* oneof = message->oneof_decl(i); - GenerateOneof(oneof, printer); - } - - printer->Outdent(); - printer->Print("end\n"); - - for (int i = 0; i < message->nested_type_count(); i++) { - if (!GenerateMessage(message->nested_type(i), printer, error)) { - return false; - } - } - for (int i = 0; i < message->enum_type_count(); i++) { - GenerateEnum(message->enum_type(i), printer); - } - - return true; -} - -void GenerateEnum(const EnumDescriptor* en, io::Printer* printer) { - printer->Print( - "add_enum \"$name$\" do\n", - "name", en->full_name()); - printer->Indent(); - - for (int i = 0; i < en->value_count(); i++) { - const EnumValueDescriptor* value = en->value(i); - printer->Print( - "value :$name$, $number$\n", - "name", value->name(), - "number", NumberToString(value->number())); - } - - printer->Outdent(); - printer->Print( - "end\n"); -} - -// Locale-agnostic utility functions. -bool IsLower(char ch) { return ch >= 'a' && ch <= 'z'; } - -bool IsUpper(char ch) { return ch >= 'A' && ch <= 'Z'; } - -bool IsAlpha(char ch) { return IsLower(ch) || IsUpper(ch); } - -char UpperChar(char ch) { return IsLower(ch) ? (ch - 'a' + 'A') : ch; } - - -// Package names in protobuf are snake_case by convention, but Ruby module -// names must be PascalCased. -// -// foo_bar_baz -> FooBarBaz -std::string PackageToModule(const std::string& name) { - bool next_upper = true; - std::string result; - result.reserve(name.size()); - - for (int i = 0; i < name.size(); i++) { - if (name[i] == '_') { - next_upper = true; - } else { - if (next_upper) { - result.push_back(UpperChar(name[i])); - } else { - result.push_back(name[i]); - } - next_upper = false; - } - } - - return result; -} - -// Class and enum names in protobuf should be PascalCased by convention, but -// since there is nothing enforcing this we need to ensure that they are valid -// Ruby constants. That mainly means making sure that the first character is -// an upper-case letter. -std::string RubifyConstant(const std::string& name) { - std::string ret = name; - if (!ret.empty()) { - if (IsLower(ret[0])) { - // If it starts with a lowercase letter, capitalize it. - ret[0] = UpperChar(ret[0]); - } else if (!IsAlpha(ret[0])) { - // Otherwise (e.g. if it begins with an underscore), we need to come up - // with some prefix that starts with a capital letter. We could be smarter - // here, e.g. try to strip leading underscores, but this may cause other - // problems if the user really intended the name. So let's just prepend a - // well-known suffix. - ret = "PB_" + ret; - } - } - - return ret; -} - -void GenerateMessageAssignment(const std::string& prefix, - const Descriptor* message, - io::Printer* printer) { - // Don't generate MapEntry messages -- we use the Ruby extension's native - // support for map fields instead. - if (message->options().map_entry()) { - return; - } - - printer->Print( - "$prefix$$name$ = ", - "prefix", prefix, - "name", RubifyConstant(message->name())); - printer->Print( - "::Google::Protobuf::DescriptorPool.generated_pool." - "lookup(\"$full_name$\").msgclass\n", - "full_name", message->full_name()); - - std::string nested_prefix = prefix + RubifyConstant(message->name()) + "::"; - for (int i = 0; i < message->nested_type_count(); i++) { - GenerateMessageAssignment(nested_prefix, message->nested_type(i), printer); - } - for (int i = 0; i < message->enum_type_count(); i++) { - GenerateEnumAssignment(nested_prefix, message->enum_type(i), printer); - } -} - -void GenerateEnumAssignment(const std::string& prefix, const EnumDescriptor* en, - io::Printer* printer) { - printer->Print( - "$prefix$$name$ = ", - "prefix", prefix, - "name", RubifyConstant(en->name())); - printer->Print( - "::Google::Protobuf::DescriptorPool.generated_pool." - "lookup(\"$full_name$\").enummodule\n", - "full_name", en->full_name()); -} - -int GeneratePackageModules(const FileDescriptor* file, io::Printer* printer) { - int levels = 0; - bool need_change_to_module = true; - std::string package_name; - - // Determine the name to use in either format: - // proto package: one.two.three - // option ruby_package: One::Two::Three - if (file->options().has_ruby_package()) { - package_name = file->options().ruby_package(); - - // If :: is in the package use the Ruby formatted name as-is - // -> A::B::C - // otherwise, use the dot separator - // -> A.B.C - if (package_name.find("::") != std::string::npos) { - need_change_to_module = false; - } else { - GOOGLE_LOG(WARNING) << "ruby_package option should be in the form of:" - << " 'A::B::C' and not 'A.B.C'"; - } - } else { - package_name = file->package(); - } - - // Use the appropriate delimiter - std::string delimiter = need_change_to_module ? "." : "::"; - int delimiter_size = need_change_to_module ? 1 : 2; - - // Extract each module name and indent - while (!package_name.empty()) { - size_t dot_index = package_name.find(delimiter); - std::string component; - if (dot_index == std::string::npos) { - component = package_name; - package_name = ""; - } else { - component = package_name.substr(0, dot_index); - package_name = package_name.substr(dot_index + delimiter_size); - } - if (need_change_to_module) { - component = PackageToModule(component); - } - printer->Print( - "module $name$\n", - "name", component); - printer->Indent(); - levels++; - } - return levels; -} - -void EndPackageModules(int levels, io::Printer* printer) { - while (levels > 0) { - levels--; - printer->Outdent(); - printer->Print( - "end\n"); - } -} - -bool GenerateDslDescriptor(const FileDescriptor* file, io::Printer* printer, - std::string* error) { - printer->Print("Google::Protobuf::DescriptorPool.generated_pool.build do\n"); - printer->Indent(); - printer->Print("add_file(\"$filename$\", :syntax => :$syntax$) do\n", - "filename", file->name(), "syntax", - StringifySyntax(file->syntax())); - printer->Indent(); - for (int i = 0; i < file->message_type_count(); i++) { - if (!GenerateMessage(file->message_type(i), printer, error)) { - return false; - } - } - for (int i = 0; i < file->enum_type_count(); i++) { - GenerateEnum(file->enum_type(i), printer); - } - printer->Outdent(); - printer->Print("end\n"); - printer->Outdent(); - printer->Print( - "end\n\n"); - return true; -} - -bool GenerateBinaryDescriptor(const FileDescriptor* file, io::Printer* printer, - std::string* error) { - printer->Print( - R"(descriptor_data = File.binread(__FILE__).split("\n__END__\n", 2)[1])"); - printer->Print( - "\nGoogle::Protobuf::DescriptorPool.generated_pool.add_serialized_file(" - "descriptor_data)\n\n"); - return true; -} - -bool GenerateFile(const FileDescriptor* file, io::Printer* printer, - std::string* error) { - printer->Print( - "# Generated by the protocol buffer compiler. DO NOT EDIT!\n" - "# source: $filename$\n" - "\n", - "filename", file->name()); - - printer->Print("require 'google/protobuf'\n\n"); - - if (file->dependency_count() != 0) { - for (int i = 0; i < file->dependency_count(); i++) { - printer->Print("require '$name$'\n", "name", GetRequireName(file->dependency(i)->name())); - } - printer->Print("\n"); - } - - // TODO: Remove this when ruby supports extensions for proto2 syntax. - if (file->syntax() == FileDescriptor::SYNTAX_PROTO2 && - file->extension_count() > 0) { - GOOGLE_LOG(WARNING) << "Extensions are not yet supported for proto2 .proto files."; - } - - bool use_raw_descriptor = file->name() == "google/protobuf/descriptor.proto"; - - if (use_raw_descriptor) { - GenerateBinaryDescriptor(file, printer, error); - } else { - GenerateDslDescriptor(file, printer, error); - } - - int levels = GeneratePackageModules(file, printer); - for (int i = 0; i < file->message_type_count(); i++) { - GenerateMessageAssignment("", file->message_type(i), printer); - } - for (int i = 0; i < file->enum_type_count(); i++) { - GenerateEnumAssignment("", file->enum_type(i), printer); - } - EndPackageModules(levels, printer); - - if (use_raw_descriptor) { - printer->Print("\n__END__\n"); - FileDescriptorProto file_proto; - file->CopyTo(&file_proto); - std::string file_data; - file_proto.SerializeToString(&file_data); - printer->Print("$raw_descriptor$", "raw_descriptor", file_data); - } - return true; -} - -bool Generator::Generate( - const FileDescriptor* file, - const std::string& parameter, - GeneratorContext* generator_context, - std::string* error) const { - - if (file->syntax() != FileDescriptor::SYNTAX_PROTO3 && - file->syntax() != FileDescriptor::SYNTAX_PROTO2) { - *error = "Invalid or unsupported proto syntax"; - return false; - } - - std::unique_ptr output( - generator_context->Open(GetOutputFilename(file->name()))); - io::Printer printer(output.get(), '$'); - - return GenerateFile(file, &printer, error); -} - -} // namespace ruby -} // namespace compiler -} // namespace protobuf -} // namespace google diff --git a/extra/protobuf/protobuf-3.19.4/src/google/protobuf/compiler/ruby/ruby_generator.h b/extra/protobuf/protobuf-3.19.4/src/google/protobuf/compiler/ruby/ruby_generator.h deleted file mode 100644 index 647bb836065a..000000000000 --- a/extra/protobuf/protobuf-3.19.4/src/google/protobuf/compiler/ruby/ruby_generator.h +++ /dev/null @@ -1,67 +0,0 @@ -// Protocol Buffers - Google's data interchange format -// Copyright 2008 Google Inc. All rights reserved. -// https://developers.google.com/protocol-buffers/ -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// * Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// * Redistributions in binary form must reproduce the above -// copyright notice, this list of conditions and the following disclaimer -// in the documentation and/or other materials provided with the -// distribution. -// * Neither the name of Google Inc. nor the names of its -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -// Generates Ruby code for a given .proto file. - -#ifndef GOOGLE_PROTOBUF_COMPILER_RUBY_GENERATOR_H__ -#define GOOGLE_PROTOBUF_COMPILER_RUBY_GENERATOR_H__ - -#include - -#include - -#include - -namespace google { -namespace protobuf { -namespace compiler { -namespace ruby { - -// CodeGenerator implementation for generated Ruby protocol buffer classes. -// If you create your own protocol compiler binary and you want it to support -// Ruby output, you can do so by registering an instance of this -// CodeGenerator with the CommandLineInterface in your main() function. -class PROTOC_EXPORT Generator : public CodeGenerator { - bool Generate(const FileDescriptor* file, const std::string& parameter, - GeneratorContext* generator_context, - std::string* error) const override; - uint64_t GetSupportedFeatures() const override { - return FEATURE_PROTO3_OPTIONAL; - } -}; - -} // namespace ruby -} // namespace compiler -} // namespace protobuf -} // namespace google - -#include - -#endif // GOOGLE_PROTOBUF_COMPILER_RUBY_GENERATOR_H__ diff --git a/extra/protobuf/protobuf-3.19.4/src/google/protobuf/compiler/ruby/ruby_generator_unittest.cc b/extra/protobuf/protobuf-3.19.4/src/google/protobuf/compiler/ruby/ruby_generator_unittest.cc deleted file mode 100644 index 040b6c981cb2..000000000000 --- a/extra/protobuf/protobuf-3.19.4/src/google/protobuf/compiler/ruby/ruby_generator_unittest.cc +++ /dev/null @@ -1,145 +0,0 @@ -// Protocol Buffers - Google's data interchange format -// Copyright 2014 Google Inc. All rights reserved. -// https://developers.google.com/protocol-buffers/ -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// * Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// * Redistributions in binary form must reproduce the above -// copyright notice, this list of conditions and the following disclaimer -// in the documentation and/or other materials provided with the -// distribution. -// * Neither the name of Google Inc. nor the names of its -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -#include -#include - -#include -#include -#include -#include - -#include -#include -#include - -namespace google { -namespace protobuf { -namespace compiler { -namespace ruby { -namespace { - -std::string FindRubyTestDir() { - return TestSourceDir() + "/google/protobuf/compiler/ruby"; -} - -// This test is a simple golden-file test over the output of the Ruby code -// generator. When we make changes to the Ruby extension and alter the Ruby code -// generator to use those changes, we should (i) manually test the output of the -// code generator with the extension, and (ii) update the golden output above. -// Some day, we may integrate build systems between protoc and the language -// extensions to the point where we can do this test in a more automated way. - -void RubyTest(string proto_file, string import_proto_file = "") { - std::string ruby_tests = FindRubyTestDir(); - - google::protobuf::compiler::CommandLineInterface cli; - cli.SetInputsAreProtoPathRelative(true); - - ruby::Generator ruby_generator; - cli.RegisterGenerator("--ruby_out", &ruby_generator, ""); - - // Copy generated_code.proto to the temporary test directory. - std::string test_input; - GOOGLE_CHECK_OK(File::GetContents( - ruby_tests + proto_file + ".proto", - &test_input, - true)); - GOOGLE_CHECK_OK(File::SetContents( - TestTempDir() + proto_file + ".proto", - test_input, - true)); - - // Copy generated_code_import.proto to the temporary test directory. - std::string test_import; - if (!import_proto_file.empty()) { - GOOGLE_CHECK_OK(File::GetContents( - ruby_tests + import_proto_file + ".proto", - &test_import, - true)); - GOOGLE_CHECK_OK(File::SetContents( - TestTempDir() + import_proto_file + ".proto", - test_import, - true)); - } - - // Invoke the proto compiler (we will be inside TestTempDir() at this point). - std::string ruby_out = "--ruby_out=" + TestTempDir(); - std::string proto_path = "--proto_path=" + TestTempDir(); - - std::string proto_target = TestTempDir() + proto_file + ".proto"; - const char* argv[] = { - "protoc", - ruby_out.c_str(), - proto_path.c_str(), - proto_target.c_str(), - }; - - EXPECT_EQ(0, cli.Run(4, argv)); - - // Load the generated output and compare to the expected result. - std::string output; - GOOGLE_CHECK_OK(File::GetContentsAsText( - TestTempDir() + proto_file + "_pb.rb", - &output, - true)); - std::string expected_output; - GOOGLE_CHECK_OK(File::GetContentsAsText( - ruby_tests + proto_file + "_pb.rb", - &expected_output, - true)); - EXPECT_EQ(expected_output, output); -} - -TEST(RubyGeneratorTest, Proto3GeneratorTest) { - RubyTest("/ruby_generated_code", "/ruby_generated_code_proto2_import"); -} - -TEST(RubyGeneratorTest, Proto2GeneratorTest) { - RubyTest("/ruby_generated_code_proto2", "/ruby_generated_code_proto2_import"); -} - -TEST(RubyGeneratorTest, Proto3ImplicitPackageTest) { - RubyTest("/ruby_generated_pkg_implicit"); -} - -TEST(RubyGeneratorTest, Proto3ExplictPackageTest) { - RubyTest("/ruby_generated_pkg_explicit"); -} - -TEST(RubyGeneratorTest, Proto3ExplictLegacyPackageTest) { - RubyTest("/ruby_generated_pkg_explicit_legacy"); -} - -} // namespace -} // namespace ruby -} // namespace compiler -} // namespace protobuf -} // namespace google diff --git a/extra/protobuf/protobuf-3.19.4/src/google/protobuf/compiler/scc.h b/extra/protobuf/protobuf-3.19.4/src/google/protobuf/compiler/scc.h deleted file mode 100644 index a1394602f78c..000000000000 --- a/extra/protobuf/protobuf-3.19.4/src/google/protobuf/compiler/scc.h +++ /dev/null @@ -1,164 +0,0 @@ -// Protocol Buffers - Google's data interchange format -// Copyright 2008 Google Inc. All rights reserved. -// https://developers.google.com/protocol-buffers/ -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// * Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// * Redistributions in binary form must reproduce the above -// copyright notice, this list of conditions and the following disclaimer -// in the documentation and/or other materials provided with the -// distribution. -// * Neither the name of Google Inc. nor the names of its -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -#ifndef GOOGLE_PROTOBUF_COMPILER_SCC_H__ -#define GOOGLE_PROTOBUF_COMPILER_SCC_H__ - -#include - -#include -#include -#include - -#include - -namespace google { -namespace protobuf { -namespace compiler { - -// Description of each strongly connected component. Note that the order -// of both the descriptors in this SCC and the order of children is -// deterministic. -struct SCC { - std::vector descriptors; - std::vector children; - - const Descriptor* GetRepresentative() const { return descriptors[0]; } - - // All messages must necessarily be in the same file. - const FileDescriptor* GetFile() const { return descriptors[0]->file(); } -}; - -// This class is used for analyzing the SCC for each message, to ensure linear -// instead of quadratic performance, if we do this per message we would get -// O(V*(V+E)). -template -class PROTOC_EXPORT SCCAnalyzer { - public: - explicit SCCAnalyzer() : index_(0) {} - - const SCC* GetSCC(const Descriptor* descriptor) { - if (cache_.count(descriptor)) return cache_[descriptor].scc; - return DFS(descriptor).scc; - } - - private: - struct NodeData { - const SCC* scc; // if null it means its still on the stack - int index; - int lowlink; - }; - - std::map cache_; - std::vector stack_; - int index_; - std::vector> garbage_bin_; - - SCC* CreateSCC() { - garbage_bin_.emplace_back(new SCC()); - return garbage_bin_.back().get(); - } - - // Tarjan's Strongly Connected Components algo - NodeData DFS(const Descriptor* descriptor) { - // Must not have visited already. - GOOGLE_DCHECK_EQ(cache_.count(descriptor), 0); - - // Mark visited by inserting in map. - NodeData& result = cache_[descriptor]; - // Initialize data structures. - result.index = result.lowlink = index_++; - stack_.push_back(descriptor); - - // Recurse the fields / nodes in graph - for (auto dep : DepsGenerator()(descriptor)) { - GOOGLE_CHECK(dep); - if (cache_.count(dep) == 0) { - // unexplored node - NodeData child_data = DFS(dep); - result.lowlink = std::min(result.lowlink, child_data.lowlink); - } else { - NodeData child_data = cache_[dep]; - if (child_data.scc == nullptr) { - // Still in the stack_ so we found a back edge - result.lowlink = std::min(result.lowlink, child_data.index); - } - } - } - if (result.index == result.lowlink) { - // This is the root of a strongly connected component - SCC* scc = CreateSCC(); - while (true) { - const Descriptor* scc_desc = stack_.back(); - scc->descriptors.push_back(scc_desc); - // Remove from stack - stack_.pop_back(); - cache_[scc_desc].scc = scc; - - if (scc_desc == descriptor) break; - } - - // The order of descriptors is random and depends how this SCC was - // discovered. In-order to ensure maximum stability we sort it by name. - std::sort(scc->descriptors.begin(), scc->descriptors.end(), - [](const Descriptor* a, const Descriptor* b) { - return a->full_name() < b->full_name(); - }); - AddChildren(scc); - } - return result; - } - - // Add the SCC's that are children of this SCC to its children. - void AddChildren(SCC* scc) { - std::set seen; - for (auto descriptor : scc->descriptors) { - for (auto child_msg : DepsGenerator()(descriptor)) { - GOOGLE_CHECK(child_msg); - const SCC* child = GetSCC(child_msg); - if (child == scc) continue; - if (seen.insert(child).second) { - scc->children.push_back(child); - } - } - } - } - - // This is necessary for compiler bug in msvc2015. - GOOGLE_DISALLOW_EVIL_CONSTRUCTORS(SCCAnalyzer); -}; - -} // namespace compiler -} // namespace protobuf -} // namespace google - -#include - -#endif // GOOGLE_PROTOBUF_COMPILER_SCC_H__ diff --git a/extra/protobuf/protobuf-3.19.4/src/google/protobuf/compiler/subprocess.cc b/extra/protobuf/protobuf-3.19.4/src/google/protobuf/compiler/subprocess.cc deleted file mode 100644 index 7e59cd7d8d26..000000000000 --- a/extra/protobuf/protobuf-3.19.4/src/google/protobuf/compiler/subprocess.cc +++ /dev/null @@ -1,475 +0,0 @@ -// Protocol Buffers - Google's data interchange format -// Copyright 2008 Google Inc. All rights reserved. -// https://developers.google.com/protocol-buffers/ -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// * Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// * Redistributions in binary form must reproduce the above -// copyright notice, this list of conditions and the following disclaimer -// in the documentation and/or other materials provided with the -// distribution. -// * Neither the name of Google Inc. nor the names of its -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -// Author: kenton@google.com (Kenton Varda) - -#include - -#include -#include -#include - -#ifndef _WIN32 -#include -#include -#include -#include -#endif - -#include -#include -#include -#include - -namespace google { -namespace protobuf { -namespace compiler { - -namespace { -char* portable_strdup(const char* s) { - char* ns = (char*)malloc(strlen(s) + 1); - if (ns != NULL) { - strcpy(ns, s); - } - return ns; -} -} // namespace - -#ifdef _WIN32 - -static void CloseHandleOrDie(HANDLE handle) { - if (!CloseHandle(handle)) { - GOOGLE_LOG(FATAL) << "CloseHandle: " - << Subprocess::Win32ErrorMessage(GetLastError()); - } -} - -Subprocess::Subprocess() - : process_start_error_(ERROR_SUCCESS), - child_handle_(NULL), - child_stdin_(NULL), - child_stdout_(NULL) {} - -Subprocess::~Subprocess() { - if (child_stdin_ != NULL) { - CloseHandleOrDie(child_stdin_); - } - if (child_stdout_ != NULL) { - CloseHandleOrDie(child_stdout_); - } -} - -void Subprocess::Start(const std::string& program, SearchMode search_mode) { - // Create the pipes. - HANDLE stdin_pipe_read; - HANDLE stdin_pipe_write; - HANDLE stdout_pipe_read; - HANDLE stdout_pipe_write; - - if (!CreatePipe(&stdin_pipe_read, &stdin_pipe_write, NULL, 0)) { - GOOGLE_LOG(FATAL) << "CreatePipe: " << Win32ErrorMessage(GetLastError()); - } - if (!CreatePipe(&stdout_pipe_read, &stdout_pipe_write, NULL, 0)) { - GOOGLE_LOG(FATAL) << "CreatePipe: " << Win32ErrorMessage(GetLastError()); - } - - // Make child side of the pipes inheritable. - if (!SetHandleInformation(stdin_pipe_read, HANDLE_FLAG_INHERIT, - HANDLE_FLAG_INHERIT)) { - GOOGLE_LOG(FATAL) << "SetHandleInformation: " - << Win32ErrorMessage(GetLastError()); - } - if (!SetHandleInformation(stdout_pipe_write, HANDLE_FLAG_INHERIT, - HANDLE_FLAG_INHERIT)) { - GOOGLE_LOG(FATAL) << "SetHandleInformation: " - << Win32ErrorMessage(GetLastError()); - } - - // Setup STARTUPINFO to redirect handles. - STARTUPINFOA startup_info; - ZeroMemory(&startup_info, sizeof(startup_info)); - startup_info.cb = sizeof(startup_info); - startup_info.dwFlags = STARTF_USESTDHANDLES; - startup_info.hStdInput = stdin_pipe_read; - startup_info.hStdOutput = stdout_pipe_write; - startup_info.hStdError = GetStdHandle(STD_ERROR_HANDLE); - - if (startup_info.hStdError == INVALID_HANDLE_VALUE) { - GOOGLE_LOG(FATAL) << "GetStdHandle: " << Win32ErrorMessage(GetLastError()); - } - - // Invoking cmd.exe allows for '.bat' files from the path as well as '.exe'. - // Using a malloc'ed string because CreateProcess() can mutate its second - // parameter. - char* command_line = - portable_strdup(("cmd.exe /c \"" + program + "\"").c_str()); - - // Create the process. - PROCESS_INFORMATION process_info; - - if (CreateProcessA((search_mode == SEARCH_PATH) ? NULL : program.c_str(), - (search_mode == SEARCH_PATH) ? command_line : NULL, - NULL, // process security attributes - NULL, // thread security attributes - TRUE, // inherit handles? - 0, // obscure creation flags - NULL, // environment (inherit from parent) - NULL, // current directory (inherit from parent) - &startup_info, &process_info)) { - child_handle_ = process_info.hProcess; - CloseHandleOrDie(process_info.hThread); - child_stdin_ = stdin_pipe_write; - child_stdout_ = stdout_pipe_read; - } else { - process_start_error_ = GetLastError(); - CloseHandleOrDie(stdin_pipe_write); - CloseHandleOrDie(stdout_pipe_read); - } - - CloseHandleOrDie(stdin_pipe_read); - CloseHandleOrDie(stdout_pipe_write); - free(command_line); -} - -bool Subprocess::Communicate(const Message& input, Message* output, - std::string* error) { - if (process_start_error_ != ERROR_SUCCESS) { - *error = Win32ErrorMessage(process_start_error_); - return false; - } - - GOOGLE_CHECK(child_handle_ != NULL) << "Must call Start() first."; - - std::string input_data = input.SerializeAsString(); - std::string output_data; - - int input_pos = 0; - - while (child_stdout_ != NULL) { - HANDLE handles[2]; - int handle_count = 0; - - if (child_stdin_ != NULL) { - handles[handle_count++] = child_stdin_; - } - if (child_stdout_ != NULL) { - handles[handle_count++] = child_stdout_; - } - - DWORD wait_result = - WaitForMultipleObjects(handle_count, handles, FALSE, INFINITE); - - HANDLE signaled_handle = NULL; - if (wait_result >= WAIT_OBJECT_0 && - wait_result < WAIT_OBJECT_0 + handle_count) { - signaled_handle = handles[wait_result - WAIT_OBJECT_0]; - } else if (wait_result == WAIT_FAILED) { - GOOGLE_LOG(FATAL) << "WaitForMultipleObjects: " - << Win32ErrorMessage(GetLastError()); - } else { - GOOGLE_LOG(FATAL) << "WaitForMultipleObjects: Unexpected return code: " - << wait_result; - } - - if (signaled_handle == child_stdin_) { - DWORD n; - if (!WriteFile(child_stdin_, input_data.data() + input_pos, - input_data.size() - input_pos, &n, NULL)) { - // Child closed pipe. Presumably it will report an error later. - // Pretend we're done for now. - input_pos = input_data.size(); - } else { - input_pos += n; - } - - if (input_pos == input_data.size()) { - // We're done writing. Close. - CloseHandleOrDie(child_stdin_); - child_stdin_ = NULL; - } - } else if (signaled_handle == child_stdout_) { - char buffer[4096]; - DWORD n; - - if (!ReadFile(child_stdout_, buffer, sizeof(buffer), &n, NULL)) { - // We're done reading. Close. - CloseHandleOrDie(child_stdout_); - child_stdout_ = NULL; - } else { - output_data.append(buffer, n); - } - } - } - - if (child_stdin_ != NULL) { - // Child did not finish reading input before it closed the output. - // Presumably it exited with an error. - CloseHandleOrDie(child_stdin_); - child_stdin_ = NULL; - } - - DWORD wait_result = WaitForSingleObject(child_handle_, INFINITE); - - if (wait_result == WAIT_FAILED) { - GOOGLE_LOG(FATAL) << "WaitForSingleObject: " - << Win32ErrorMessage(GetLastError()); - } else if (wait_result != WAIT_OBJECT_0) { - GOOGLE_LOG(FATAL) << "WaitForSingleObject: Unexpected return code: " - << wait_result; - } - - DWORD exit_code; - if (!GetExitCodeProcess(child_handle_, &exit_code)) { - GOOGLE_LOG(FATAL) << "GetExitCodeProcess: " - << Win32ErrorMessage(GetLastError()); - } - - CloseHandleOrDie(child_handle_); - child_handle_ = NULL; - - if (exit_code != 0) { - *error = strings::Substitute("Plugin failed with status code $0.", exit_code); - return false; - } - - if (!output->ParseFromString(output_data)) { - *error = "Plugin output is unparseable: " + CEscape(output_data); - return false; - } - - return true; -} - -std::string Subprocess::Win32ErrorMessage(DWORD error_code) { - char* message; - - // WTF? - FormatMessageA(FORMAT_MESSAGE_ALLOCATE_BUFFER | FORMAT_MESSAGE_FROM_SYSTEM | - FORMAT_MESSAGE_IGNORE_INSERTS, - NULL, error_code, MAKELANGID(LANG_ENGLISH, SUBLANG_ENGLISH_US), - (LPSTR)&message, // NOT A BUG! - 0, NULL); - - std::string result = message; - LocalFree(message); - return result; -} - -// =================================================================== - -#else // _WIN32 - -Subprocess::Subprocess() - : child_pid_(-1), child_stdin_(-1), child_stdout_(-1) {} - -Subprocess::~Subprocess() { - if (child_stdin_ != -1) { - close(child_stdin_); - } - if (child_stdout_ != -1) { - close(child_stdout_); - } -} - -void Subprocess::Start(const std::string& program, SearchMode search_mode) { - // Note that we assume that there are no other threads, thus we don't have to - // do crazy stuff like using socket pairs or avoiding libc locks. - - // [0] is read end, [1] is write end. - int stdin_pipe[2]; - int stdout_pipe[2]; - - GOOGLE_CHECK(pipe(stdin_pipe) != -1); - GOOGLE_CHECK(pipe(stdout_pipe) != -1); - - char* argv[2] = {portable_strdup(program.c_str()), NULL}; - - child_pid_ = fork(); - if (child_pid_ == -1) { - GOOGLE_LOG(FATAL) << "fork: " << strerror(errno); - } else if (child_pid_ == 0) { - // We are the child. - dup2(stdin_pipe[0], STDIN_FILENO); - dup2(stdout_pipe[1], STDOUT_FILENO); - - close(stdin_pipe[0]); - close(stdin_pipe[1]); - close(stdout_pipe[0]); - close(stdout_pipe[1]); - - switch (search_mode) { - case SEARCH_PATH: - execvp(argv[0], argv); - break; - case EXACT_NAME: - execv(argv[0], argv); - break; - } - - // Write directly to STDERR_FILENO to avoid stdio code paths that may do - // stuff that is unsafe here. - int ignored; - ignored = write(STDERR_FILENO, argv[0], strlen(argv[0])); - const char* message = - ": program not found or is not executable\n" - "Please specify a program using absolute path or make sure " - "the program is available in your PATH system variable\n"; - ignored = write(STDERR_FILENO, message, strlen(message)); - (void)ignored; - - // Must use _exit() rather than exit() to avoid flushing output buffers - // that will also be flushed by the parent. - _exit(1); - } else { - free(argv[0]); - - close(stdin_pipe[0]); - close(stdout_pipe[1]); - - child_stdin_ = stdin_pipe[1]; - child_stdout_ = stdout_pipe[0]; - } -} - -bool Subprocess::Communicate(const Message& input, Message* output, - std::string* error) { - GOOGLE_CHECK_NE(child_stdin_, -1) << "Must call Start() first."; - - // The "sighandler_t" typedef is GNU-specific, so define our own. - typedef void SignalHandler(int); - - // Make sure SIGPIPE is disabled so that if the child dies it doesn't kill us. - SignalHandler* old_pipe_handler = signal(SIGPIPE, SIG_IGN); - - std::string input_data = input.SerializeAsString(); - std::string output_data; - - int input_pos = 0; - int max_fd = std::max(child_stdin_, child_stdout_); - - while (child_stdout_ != -1) { - fd_set read_fds; - fd_set write_fds; - FD_ZERO(&read_fds); - FD_ZERO(&write_fds); - if (child_stdout_ != -1) { - FD_SET(child_stdout_, &read_fds); - } - if (child_stdin_ != -1) { - FD_SET(child_stdin_, &write_fds); - } - - if (select(max_fd + 1, &read_fds, &write_fds, NULL, NULL) < 0) { - if (errno == EINTR) { - // Interrupted by signal. Try again. - continue; - } else { - GOOGLE_LOG(FATAL) << "select: " << strerror(errno); - } - } - - if (child_stdin_ != -1 && FD_ISSET(child_stdin_, &write_fds)) { - int n = write(child_stdin_, input_data.data() + input_pos, - input_data.size() - input_pos); - if (n < 0) { - // Child closed pipe. Presumably it will report an error later. - // Pretend we're done for now. - input_pos = input_data.size(); - } else { - input_pos += n; - } - - if (input_pos == input_data.size()) { - // We're done writing. Close. - close(child_stdin_); - child_stdin_ = -1; - } - } - - if (child_stdout_ != -1 && FD_ISSET(child_stdout_, &read_fds)) { - char buffer[4096]; - int n = read(child_stdout_, buffer, sizeof(buffer)); - - if (n > 0) { - output_data.append(buffer, n); - } else { - // We're done reading. Close. - close(child_stdout_); - child_stdout_ = -1; - } - } - } - - if (child_stdin_ != -1) { - // Child did not finish reading input before it closed the output. - // Presumably it exited with an error. - close(child_stdin_); - child_stdin_ = -1; - } - - int status; - while (waitpid(child_pid_, &status, 0) == -1) { - if (errno != EINTR) { - GOOGLE_LOG(FATAL) << "waitpid: " << strerror(errno); - } - } - - // Restore SIGPIPE handling. - signal(SIGPIPE, old_pipe_handler); - - if (WIFEXITED(status)) { - if (WEXITSTATUS(status) != 0) { - int error_code = WEXITSTATUS(status); - *error = - strings::Substitute("Plugin failed with status code $0.", error_code); - return false; - } - } else if (WIFSIGNALED(status)) { - int signal = WTERMSIG(status); - *error = strings::Substitute("Plugin killed by signal $0.", signal); - return false; - } else { - *error = "Neither WEXITSTATUS nor WTERMSIG is true?"; - return false; - } - - if (!output->ParseFromString(output_data)) { - *error = "Plugin output is unparseable: " + CEscape(output_data); - return false; - } - - return true; -} - -#endif // !_WIN32 - -} // namespace compiler -} // namespace protobuf -} // namespace google diff --git a/extra/protobuf/protobuf-3.19.4/src/google/protobuf/compiler/subprocess.h b/extra/protobuf/protobuf-3.19.4/src/google/protobuf/compiler/subprocess.h deleted file mode 100644 index c1ddaae531de..000000000000 --- a/extra/protobuf/protobuf-3.19.4/src/google/protobuf/compiler/subprocess.h +++ /dev/null @@ -1,113 +0,0 @@ -// Protocol Buffers - Google's data interchange format -// Copyright 2008 Google Inc. All rights reserved. -// https://developers.google.com/protocol-buffers/ -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// * Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// * Redistributions in binary form must reproduce the above -// copyright notice, this list of conditions and the following disclaimer -// in the documentation and/or other materials provided with the -// distribution. -// * Neither the name of Google Inc. nor the names of its -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -// Author: kenton@google.com (Kenton Varda) - -#ifndef GOOGLE_PROTOBUF_COMPILER_SUBPROCESS_H__ -#define GOOGLE_PROTOBUF_COMPILER_SUBPROCESS_H__ - -#ifdef _WIN32 -#ifndef WIN32_LEAN_AND_MEAN -#define WIN32_LEAN_AND_MEAN // right... -#endif -#include -#else // _WIN32 -#include -#include -#endif // !_WIN32 -#include - -#include - -#include - -namespace google { -namespace protobuf { - -class Message; - -namespace compiler { - -// Utility class for launching sub-processes. -class PROTOC_EXPORT Subprocess { - public: - Subprocess(); - ~Subprocess(); - - enum SearchMode { - SEARCH_PATH, // Use PATH environment variable. - EXACT_NAME // Program is an exact file name; don't use the PATH. - }; - - // Start the subprocess. Currently we don't provide a way to specify - // arguments as protoc plugins don't have any. - void Start(const std::string& program, SearchMode search_mode); - - // Serialize the input message and pipe it to the subprocess's stdin, then - // close the pipe. Meanwhile, read from the subprocess's stdout and parse - // the data into *output. All this is done carefully to avoid deadlocks. - // Returns true if successful. On any sort of error, returns false and sets - // *error to a description of the problem. - bool Communicate(const Message& input, Message* output, std::string* error); - -#ifdef _WIN32 - // Given an error code, returns a human-readable error message. This is - // defined here so that CommandLineInterface can share it. - static std::string Win32ErrorMessage(DWORD error_code); -#endif - - private: -#ifdef _WIN32 - DWORD process_start_error_; - HANDLE child_handle_; - - // The file handles for our end of the child's pipes. We close each and - // set it to NULL when no longer needed. - HANDLE child_stdin_; - HANDLE child_stdout_; - -#else // _WIN32 - pid_t child_pid_; - - // The file descriptors for our end of the child's pipes. We close each and - // set it to -1 when no longer needed. - int child_stdin_; - int child_stdout_; - -#endif // !_WIN32 -}; - -} // namespace compiler -} // namespace protobuf -} // namespace google - -#include - -#endif // GOOGLE_PROTOBUF_COMPILER_SUBPROCESS_H__ diff --git a/extra/protobuf/protobuf-3.19.4/src/google/protobuf/compiler/test_plugin.cc b/extra/protobuf/protobuf-3.19.4/src/google/protobuf/compiler/test_plugin.cc deleted file mode 100644 index 6b56170003e4..000000000000 --- a/extra/protobuf/protobuf-3.19.4/src/google/protobuf/compiler/test_plugin.cc +++ /dev/null @@ -1,61 +0,0 @@ -// Protocol Buffers - Google's data interchange format -// Copyright 2008 Google Inc. All rights reserved. -// https://developers.google.com/protocol-buffers/ -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// * Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// * Redistributions in binary form must reproduce the above -// copyright notice, this list of conditions and the following disclaimer -// in the documentation and/or other materials provided with the -// distribution. -// * Neither the name of Google Inc. nor the names of its -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -// Author: kenton@google.com (Kenton Varda) -// -// This is a dummy code generator plugin used by -// command_line_interface_unittest. - -#include -#include -#include -#include - -namespace google { -namespace protobuf { -namespace compiler { - -int ProtobufMain(int argc, char* argv[]) { - MockCodeGenerator generator("test_plugin"); - return PluginMain(argc, argv, &generator); -} - -} // namespace compiler -} // namespace protobuf -} // namespace google - -int main(int argc, char* argv[]) { -#ifdef _MSC_VER - // Don't print a silly message or stick a modal dialog box in my face, - // please. - _set_abort_behavior(0, ~0); -#endif // !_MSC_VER - return google::protobuf::compiler::ProtobufMain(argc, argv); -} diff --git a/extra/protobuf/protobuf-3.19.4/src/google/protobuf/compiler/zip_output_unittest.sh b/extra/protobuf/protobuf-3.19.4/src/google/protobuf/compiler/zip_output_unittest.sh deleted file mode 100755 index f85979128b73..000000000000 --- a/extra/protobuf/protobuf-3.19.4/src/google/protobuf/compiler/zip_output_unittest.sh +++ /dev/null @@ -1,100 +0,0 @@ -#!/bin/sh -# -# Protocol Buffers - Google's data interchange format -# Copyright 2009 Google Inc. All rights reserved. -# https://developers.google.com/protocol-buffers/ -# -# Redistribution and use in source and binary forms, with or without -# modification, are permitted provided that the following conditions are -# met: -# -# * Redistributions of source code must retain the above copyright -# notice, this list of conditions and the following disclaimer. -# * Redistributions in binary form must reproduce the above -# copyright notice, this list of conditions and the following disclaimer -# in the documentation and/or other materials provided with the -# distribution. -# * Neither the name of Google Inc. nor the names of its -# contributors may be used to endorse or promote products derived from -# this software without specific prior written permission. -# -# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -# Author: kenton@google.com (Kenton Varda) -# -# Test protoc's zip output mode. - -fail() { - echo "$@" >&2 - exit 1 -} - -TEST_TMPDIR=. -PROTOC=./protoc -JAR=jar -UNZIP=unzip - -echo ' - syntax = "proto2"; - option java_multiple_files = true; - option java_package = "test.jar"; - option java_outer_classname = "Outer"; - message Foo {} - message Bar {} -' > $TEST_TMPDIR/testzip.proto - -$PROTOC \ - --cpp_out=$TEST_TMPDIR/testzip.zip --python_out=$TEST_TMPDIR/testzip.zip \ - --java_out=$TEST_TMPDIR/testzip.jar -I$TEST_TMPDIR testzip.proto \ - || fail 'protoc failed.' - -echo "Testing output to zip..." -if $UNZIP -h > /dev/null; then - $UNZIP -t $TEST_TMPDIR/testzip.zip > $TEST_TMPDIR/testzip.list \ - || fail 'unzip failed.' - - grep 'testing: testzip\.pb\.cc *OK$' $TEST_TMPDIR/testzip.list > /dev/null \ - || fail 'testzip.pb.cc not found in output zip.' - grep 'testing: testzip\.pb\.h *OK$' $TEST_TMPDIR/testzip.list > /dev/null \ - || fail 'testzip.pb.h not found in output zip.' - grep 'testing: testzip_pb2\.py *OK$' $TEST_TMPDIR/testzip.list > /dev/null \ - || fail 'testzip_pb2.py not found in output zip.' - grep -i 'manifest' $TEST_TMPDIR/testzip.list > /dev/null \ - && fail 'Zip file contained manifest.' -else - echo "Warning: 'unzip' command not available. Skipping test." -fi - -echo "Testing output to jar..." -if $JAR c $TEST_TMPDIR/testzip.proto > /dev/null; then - $JAR tf $TEST_TMPDIR/testzip.jar > $TEST_TMPDIR/testzip.list \ - || fail 'jar failed.' - - # Check that -interface.jar timestamps are normalized: - if [[ "$(TZ=UTC $JAR tvf $TEST_TMPDIR/testzip.jar)" != *'Tue Jan 01 00:00:00 UTC 1980'* ]]; then - fail 'Zip did not contain normalized timestamps' - fi - - grep '^test/jar/Foo\.java$' $TEST_TMPDIR/testzip.list > /dev/null \ - || fail 'Foo.java not found in output jar.' - grep '^test/jar/Bar\.java$' $TEST_TMPDIR/testzip.list > /dev/null \ - || fail 'Bar.java not found in output jar.' - grep '^test/jar/Outer\.java$' $TEST_TMPDIR/testzip.list > /dev/null \ - || fail 'Outer.java not found in output jar.' - grep '^META-INF/MANIFEST\.MF$' $TEST_TMPDIR/testzip.list > /dev/null \ - || fail 'Manifest not found in output jar.' -else - echo "Warning: 'jar' command not available. Skipping test." -fi - -echo PASS diff --git a/extra/protobuf/protobuf-3.19.4/src/google/protobuf/compiler/zip_writer.cc b/extra/protobuf/protobuf-3.19.4/src/google/protobuf/compiler/zip_writer.cc deleted file mode 100644 index 72e1d7114d82..000000000000 --- a/extra/protobuf/protobuf-3.19.4/src/google/protobuf/compiler/zip_writer.cc +++ /dev/null @@ -1,195 +0,0 @@ -// Protocol Buffers - Google's data interchange format -// Copyright 2008 Google Inc. All rights reserved. -// https://developers.google.com/protocol-buffers/ -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// * Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// * Redistributions in binary form must reproduce the above -// copyright notice, this list of conditions and the following disclaimer -// in the documentation and/or other materials provided with the -// distribution. -// * Neither the name of Google Inc. nor the names of its -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -// Author: ambrose@google.com (Ambrose Feinstein), -// kenton@google.com (Kenton Varda) -// -// Based on http://www.pkware.com/documents/casestudies/APPNOTE.TXT - -#include - -#include - -#include - -namespace google { -namespace protobuf { -namespace compiler { - -// January 1, 1980 as a DOS date. -// see https://msdn.microsoft.com/en-us/library/9kkf9tah.aspx -static const uint16_t kDosEpoch = 1 << 5 | 1; - -static const uint32_t kCRC32Table[256] = { - 0x00000000, 0x77073096, 0xee0e612c, 0x990951ba, 0x076dc419, 0x706af48f, - 0xe963a535, 0x9e6495a3, 0x0edb8832, 0x79dcb8a4, 0xe0d5e91e, 0x97d2d988, - 0x09b64c2b, 0x7eb17cbd, 0xe7b82d07, 0x90bf1d91, 0x1db71064, 0x6ab020f2, - 0xf3b97148, 0x84be41de, 0x1adad47d, 0x6ddde4eb, 0xf4d4b551, 0x83d385c7, - 0x136c9856, 0x646ba8c0, 0xfd62f97a, 0x8a65c9ec, 0x14015c4f, 0x63066cd9, - 0xfa0f3d63, 0x8d080df5, 0x3b6e20c8, 0x4c69105e, 0xd56041e4, 0xa2677172, - 0x3c03e4d1, 0x4b04d447, 0xd20d85fd, 0xa50ab56b, 0x35b5a8fa, 0x42b2986c, - 0xdbbbc9d6, 0xacbcf940, 0x32d86ce3, 0x45df5c75, 0xdcd60dcf, 0xabd13d59, - 0x26d930ac, 0x51de003a, 0xc8d75180, 0xbfd06116, 0x21b4f4b5, 0x56b3c423, - 0xcfba9599, 0xb8bda50f, 0x2802b89e, 0x5f058808, 0xc60cd9b2, 0xb10be924, - 0x2f6f7c87, 0x58684c11, 0xc1611dab, 0xb6662d3d, 0x76dc4190, 0x01db7106, - 0x98d220bc, 0xefd5102a, 0x71b18589, 0x06b6b51f, 0x9fbfe4a5, 0xe8b8d433, - 0x7807c9a2, 0x0f00f934, 0x9609a88e, 0xe10e9818, 0x7f6a0dbb, 0x086d3d2d, - 0x91646c97, 0xe6635c01, 0x6b6b51f4, 0x1c6c6162, 0x856530d8, 0xf262004e, - 0x6c0695ed, 0x1b01a57b, 0x8208f4c1, 0xf50fc457, 0x65b0d9c6, 0x12b7e950, - 0x8bbeb8ea, 0xfcb9887c, 0x62dd1ddf, 0x15da2d49, 0x8cd37cf3, 0xfbd44c65, - 0x4db26158, 0x3ab551ce, 0xa3bc0074, 0xd4bb30e2, 0x4adfa541, 0x3dd895d7, - 0xa4d1c46d, 0xd3d6f4fb, 0x4369e96a, 0x346ed9fc, 0xad678846, 0xda60b8d0, - 0x44042d73, 0x33031de5, 0xaa0a4c5f, 0xdd0d7cc9, 0x5005713c, 0x270241aa, - 0xbe0b1010, 0xc90c2086, 0x5768b525, 0x206f85b3, 0xb966d409, 0xce61e49f, - 0x5edef90e, 0x29d9c998, 0xb0d09822, 0xc7d7a8b4, 0x59b33d17, 0x2eb40d81, - 0xb7bd5c3b, 0xc0ba6cad, 0xedb88320, 0x9abfb3b6, 0x03b6e20c, 0x74b1d29a, - 0xead54739, 0x9dd277af, 0x04db2615, 0x73dc1683, 0xe3630b12, 0x94643b84, - 0x0d6d6a3e, 0x7a6a5aa8, 0xe40ecf0b, 0x9309ff9d, 0x0a00ae27, 0x7d079eb1, - 0xf00f9344, 0x8708a3d2, 0x1e01f268, 0x6906c2fe, 0xf762575d, 0x806567cb, - 0x196c3671, 0x6e6b06e7, 0xfed41b76, 0x89d32be0, 0x10da7a5a, 0x67dd4acc, - 0xf9b9df6f, 0x8ebeeff9, 0x17b7be43, 0x60b08ed5, 0xd6d6a3e8, 0xa1d1937e, - 0x38d8c2c4, 0x4fdff252, 0xd1bb67f1, 0xa6bc5767, 0x3fb506dd, 0x48b2364b, - 0xd80d2bda, 0xaf0a1b4c, 0x36034af6, 0x41047a60, 0xdf60efc3, 0xa867df55, - 0x316e8eef, 0x4669be79, 0xcb61b38c, 0xbc66831a, 0x256fd2a0, 0x5268e236, - 0xcc0c7795, 0xbb0b4703, 0x220216b9, 0x5505262f, 0xc5ba3bbe, 0xb2bd0b28, - 0x2bb45a92, 0x5cb36a04, 0xc2d7ffa7, 0xb5d0cf31, 0x2cd99e8b, 0x5bdeae1d, - 0x9b64c2b0, 0xec63f226, 0x756aa39c, 0x026d930a, 0x9c0906a9, 0xeb0e363f, - 0x72076785, 0x05005713, 0x95bf4a82, 0xe2b87a14, 0x7bb12bae, 0x0cb61b38, - 0x92d28e9b, 0xe5d5be0d, 0x7cdcefb7, 0x0bdbdf21, 0x86d3d2d4, 0xf1d4e242, - 0x68ddb3f8, 0x1fda836e, 0x81be16cd, 0xf6b9265b, 0x6fb077e1, 0x18b74777, - 0x88085ae6, 0xff0f6a70, 0x66063bca, 0x11010b5c, 0x8f659eff, 0xf862ae69, - 0x616bffd3, 0x166ccf45, 0xa00ae278, 0xd70dd2ee, 0x4e048354, 0x3903b3c2, - 0xa7672661, 0xd06016f7, 0x4969474d, 0x3e6e77db, 0xaed16a4a, 0xd9d65adc, - 0x40df0b66, 0x37d83bf0, 0xa9bcae53, 0xdebb9ec5, 0x47b2cf7f, 0x30b5ffe9, - 0xbdbdf21c, 0xcabac28a, 0x53b39330, 0x24b4a3a6, 0xbad03605, 0xcdd70693, - 0x54de5729, 0x23d967bf, 0xb3667a2e, 0xc4614ab8, 0x5d681b02, 0x2a6f2b94, - 0xb40bbe37, 0xc30c8ea1, 0x5a05df1b, 0x2d02ef8d}; - -static uint32_t ComputeCRC32(const std::string& buf) { - uint32_t x = ~0U; - for (int i = 0; i < buf.size(); ++i) { - unsigned char c = buf[i]; - x = kCRC32Table[(x ^ c) & 0xff] ^ (x >> 8); - } - return ~x; -} - -static void WriteShort(io::CodedOutputStream* out, uint16_t val) { - uint8_t p[2]; - p[0] = static_cast(val); - p[1] = static_cast(val >> 8); - out->WriteRaw(p, 2); -} - -ZipWriter::ZipWriter(io::ZeroCopyOutputStream* raw_output) - : raw_output_(raw_output) {} -ZipWriter::~ZipWriter() {} - -bool ZipWriter::Write(const std::string& filename, - const std::string& contents) { - FileInfo info; - - info.name = filename; - uint16_t filename_size = filename.size(); - info.offset = raw_output_->ByteCount(); - info.size = contents.size(); - info.crc32 = ComputeCRC32(contents); - - files_.push_back(info); - - // write file header - io::CodedOutputStream output(raw_output_); - output.WriteLittleEndian32(0x04034b50); // magic - WriteShort(&output, 10); // version needed to extract - WriteShort(&output, 0); // flags - WriteShort(&output, 0); // compression method: stored - WriteShort(&output, 0); // last modified time - WriteShort(&output, kDosEpoch); // last modified date - output.WriteLittleEndian32(info.crc32); // crc-32 - output.WriteLittleEndian32(info.size); // compressed size - output.WriteLittleEndian32(info.size); // uncompressed size - WriteShort(&output, filename_size); // file name length - WriteShort(&output, 0); // extra field length - output.WriteString(filename); // file name - output.WriteString(contents); // file data - - return !output.HadError(); -} - -bool ZipWriter::WriteDirectory() { - uint16_t num_entries = files_.size(); - uint32_t dir_ofs = raw_output_->ByteCount(); - - // write central directory - io::CodedOutputStream output(raw_output_); - for (int i = 0; i < num_entries; ++i) { - const std::string& filename = files_[i].name; - uint16_t filename_size = filename.size(); - uint32_t crc32 = files_[i].crc32; - uint32_t size = files_[i].size; - uint32_t offset = files_[i].offset; - - output.WriteLittleEndian32(0x02014b50); // magic - WriteShort(&output, 10); // version made by - WriteShort(&output, 10); // version needed to extract - WriteShort(&output, 0); // flags - WriteShort(&output, 0); // compression method: stored - WriteShort(&output, 0); // last modified time - WriteShort(&output, kDosEpoch); // last modified date - output.WriteLittleEndian32(crc32); // crc-32 - output.WriteLittleEndian32(size); // compressed size - output.WriteLittleEndian32(size); // uncompressed size - WriteShort(&output, filename_size); // file name length - WriteShort(&output, 0); // extra field length - WriteShort(&output, 0); // file comment length - WriteShort(&output, 0); // starting disk number - WriteShort(&output, 0); // internal file attributes - output.WriteLittleEndian32(0); // external file attributes - output.WriteLittleEndian32(offset); // local header offset - output.WriteString(filename); // file name - } - uint32_t dir_len = output.ByteCount(); - - // write end of central directory marker - output.WriteLittleEndian32(0x06054b50); // magic - WriteShort(&output, 0); // disk number - WriteShort(&output, 0); // disk with start of central directory - WriteShort(&output, num_entries); // central directory entries (this disk) - WriteShort(&output, num_entries); // central directory entries (total) - output.WriteLittleEndian32(dir_len); // central directory byte size - output.WriteLittleEndian32(dir_ofs); // central directory offset - WriteShort(&output, 0); // comment length - - return output.HadError(); -} - -} // namespace compiler -} // namespace protobuf -} // namespace google diff --git a/extra/protobuf/protobuf-3.19.4/src/google/protobuf/compiler/zip_writer.h b/extra/protobuf/protobuf-3.19.4/src/google/protobuf/compiler/zip_writer.h deleted file mode 100644 index 0a8a77355213..000000000000 --- a/extra/protobuf/protobuf-3.19.4/src/google/protobuf/compiler/zip_writer.h +++ /dev/null @@ -1,65 +0,0 @@ -// Protocol Buffers - Google's data interchange format -// Copyright 2008 Google Inc. All rights reserved. -// https://developers.google.com/protocol-buffers/ -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// * Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// * Redistributions in binary form must reproduce the above -// copyright notice, this list of conditions and the following disclaimer -// in the documentation and/or other materials provided with the -// distribution. -// * Neither the name of Google Inc. nor the names of its -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -// Author: kenton@google.com (Kenton Varda) - -#include -#include - -#include -#include - -namespace google { -namespace protobuf { -namespace compiler { - -class ZipWriter { - public: - ZipWriter(io::ZeroCopyOutputStream* raw_output); - ~ZipWriter(); - - bool Write(const std::string& filename, const std::string& contents); - bool WriteDirectory(); - - private: - struct FileInfo { - std::string name; - uint32_t offset; - uint32_t size; - uint32_t crc32; - }; - - io::ZeroCopyOutputStream* raw_output_; - std::vector files_; -}; - -} // namespace compiler -} // namespace protobuf -} // namespace google diff --git a/extra/protobuf/protobuf-3.19.4/src/google/protobuf/descriptor.cc b/extra/protobuf/protobuf-3.19.4/src/google/protobuf/descriptor.cc deleted file mode 100644 index c8ce218a981d..000000000000 --- a/extra/protobuf/protobuf-3.19.4/src/google/protobuf/descriptor.cc +++ /dev/null @@ -1,8025 +0,0 @@ -// Protocol Buffers - Google's data interchange format -// Copyright 2008 Google Inc. All rights reserved. -// https://developers.google.com/protocol-buffers/ -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// * Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// * Redistributions in binary form must reproduce the above -// copyright notice, this list of conditions and the following disclaimer -// in the documentation and/or other materials provided with the -// distribution. -// * Neither the name of Google Inc. nor the names of its -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -// Author: kenton@google.com (Kenton Varda) -// Based on original Protocol Buffers design by -// Sanjay Ghemawat, Jeff Dean, and others. - -#include - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#undef PACKAGE // autoheader #defines this. :( - - -#include - -namespace google { -namespace protobuf { - -class Symbol { - public: - enum Type { - NULL_SYMBOL, - MESSAGE, - FIELD, - ONEOF, - ENUM, - ENUM_VALUE, - ENUM_VALUE_OTHER_PARENT, - SERVICE, - METHOD, - PACKAGE, - QUERY_KEY - }; - - Symbol() : ptr_(nullptr) {} - - // Every object we store derives from internal::SymbolBase, where we store the - // symbol type enum. - // Storing in the object can be done without using more space in most cases, - // while storing it in the Symbol type would require 8 bytes. -#define DEFINE_MEMBERS(TYPE, TYPE_CONSTANT, FIELD) \ - explicit Symbol(TYPE* value) : ptr_(value) { \ - value->symbol_type_ = TYPE_CONSTANT; \ - } \ - const TYPE* FIELD() const { \ - return type() == TYPE_CONSTANT ? static_cast(ptr_) : nullptr; \ - } - - DEFINE_MEMBERS(Descriptor, MESSAGE, descriptor) - DEFINE_MEMBERS(FieldDescriptor, FIELD, field_descriptor) - DEFINE_MEMBERS(OneofDescriptor, ONEOF, oneof_descriptor) - DEFINE_MEMBERS(EnumDescriptor, ENUM, enum_descriptor) - DEFINE_MEMBERS(ServiceDescriptor, SERVICE, service_descriptor) - DEFINE_MEMBERS(MethodDescriptor, METHOD, method_descriptor) - - // We use a special node for FileDescriptor. - // It is potentially added to the table with multiple different names, so we - // need a separate place to put the name. - struct Package : internal::SymbolBase { - const std::string* name; - const FileDescriptor* file; - }; - DEFINE_MEMBERS(Package, PACKAGE, package_file_descriptor) - - // Enum values have two different parents. - // We use two different identitied for the same object to determine the two - // different insertions in the map. - static Symbol EnumValue(EnumValueDescriptor* value, int n) { - Symbol s; - internal::SymbolBase* ptr; - if (n == 0) { - ptr = static_cast*>(value); - ptr->symbol_type_ = ENUM_VALUE; - } else { - ptr = static_cast*>(value); - ptr->symbol_type_ = ENUM_VALUE_OTHER_PARENT; - } - s.ptr_ = ptr; - return s; - } - - const EnumValueDescriptor* enum_value_descriptor() const { - return type() == ENUM_VALUE - ? static_cast( - static_cast*>(ptr_)) - : type() == ENUM_VALUE_OTHER_PARENT - ? static_cast( - static_cast*>(ptr_)) - : nullptr; - } - - // Not a real symbol. - // Only used for heterogeneous lookups and never actually inserted in the - // tables. - struct QueryKey : internal::SymbolBase { - StringPiece name; - const void* parent; - int field_number; - }; - DEFINE_MEMBERS(QueryKey, QUERY_KEY, query_key); -#undef DEFINE_MEMBERS - - Type type() const { - return ptr_ == nullptr ? NULL_SYMBOL - : static_cast(ptr_->symbol_type_); - } - bool IsNull() const { return type() == NULL_SYMBOL; } - bool IsType() const { return type() == MESSAGE || type() == ENUM; } - bool IsAggregate() const { - return type() == MESSAGE || type() == PACKAGE || type() == ENUM || - type() == SERVICE; - } - - const FileDescriptor* GetFile() const { - switch (type()) { - case MESSAGE: - return descriptor()->file(); - case FIELD: - return field_descriptor()->file(); - case ONEOF: - return oneof_descriptor()->containing_type()->file(); - case ENUM: - return enum_descriptor()->file(); - case ENUM_VALUE: - return enum_value_descriptor()->type()->file(); - case SERVICE: - return service_descriptor()->file(); - case METHOD: - return method_descriptor()->service()->file(); - case PACKAGE: - return package_file_descriptor()->file; - default: - return nullptr; - } - } - - StringPiece full_name() const { - switch (type()) { - case MESSAGE: - return descriptor()->full_name(); - case FIELD: - return field_descriptor()->full_name(); - case ONEOF: - return oneof_descriptor()->full_name(); - case ENUM: - return enum_descriptor()->full_name(); - case ENUM_VALUE: - return enum_value_descriptor()->full_name(); - case SERVICE: - return service_descriptor()->full_name(); - case METHOD: - return method_descriptor()->full_name(); - case PACKAGE: - return *package_file_descriptor()->name; - case QUERY_KEY: - return query_key()->name; - default: - GOOGLE_CHECK(false); - } - return ""; - } - - std::pair parent_name_key() const { - const auto or_file = [&](const void* p) { return p ? p : GetFile(); }; - switch (type()) { - case MESSAGE: - return {or_file(descriptor()->containing_type()), descriptor()->name()}; - case FIELD: { - auto* field = field_descriptor(); - return {or_file(field->is_extension() ? field->extension_scope() - : field->containing_type()), - field->name()}; - } - case ONEOF: - return {oneof_descriptor()->containing_type(), - oneof_descriptor()->name()}; - case ENUM: - return {or_file(enum_descriptor()->containing_type()), - enum_descriptor()->name()}; - case ENUM_VALUE: - return {or_file(enum_value_descriptor()->type()->containing_type()), - enum_value_descriptor()->name()}; - case ENUM_VALUE_OTHER_PARENT: - return {enum_value_descriptor()->type(), - enum_value_descriptor()->name()}; - case SERVICE: - return {GetFile(), service_descriptor()->name()}; - case METHOD: - return {method_descriptor()->service(), method_descriptor()->name()}; - case QUERY_KEY: - return {query_key()->parent, query_key()->name}; - default: - GOOGLE_CHECK(false); - } - return {}; - } - - std::pair parent_number_key() const { - switch (type()) { - case FIELD: - return {field_descriptor()->containing_type(), - field_descriptor()->number()}; - case ENUM_VALUE: - return {enum_value_descriptor()->type(), - enum_value_descriptor()->number()}; - case QUERY_KEY: - return {query_key()->parent, query_key()->field_number}; - default: - GOOGLE_CHECK(false); - } - return {}; - } - - private: - const internal::SymbolBase* ptr_; -}; - -const FieldDescriptor::CppType - FieldDescriptor::kTypeToCppTypeMap[MAX_TYPE + 1] = { - static_cast(0), // 0 is reserved for errors - - CPPTYPE_DOUBLE, // TYPE_DOUBLE - CPPTYPE_FLOAT, // TYPE_FLOAT - CPPTYPE_INT64, // TYPE_INT64 - CPPTYPE_UINT64, // TYPE_UINT64 - CPPTYPE_INT32, // TYPE_INT32 - CPPTYPE_UINT64, // TYPE_FIXED64 - CPPTYPE_UINT32, // TYPE_FIXED32 - CPPTYPE_BOOL, // TYPE_BOOL - CPPTYPE_STRING, // TYPE_STRING - CPPTYPE_MESSAGE, // TYPE_GROUP - CPPTYPE_MESSAGE, // TYPE_MESSAGE - CPPTYPE_STRING, // TYPE_BYTES - CPPTYPE_UINT32, // TYPE_UINT32 - CPPTYPE_ENUM, // TYPE_ENUM - CPPTYPE_INT32, // TYPE_SFIXED32 - CPPTYPE_INT64, // TYPE_SFIXED64 - CPPTYPE_INT32, // TYPE_SINT32 - CPPTYPE_INT64, // TYPE_SINT64 -}; - -const char* const FieldDescriptor::kTypeToName[MAX_TYPE + 1] = { - "ERROR", // 0 is reserved for errors - - "double", // TYPE_DOUBLE - "float", // TYPE_FLOAT - "int64", // TYPE_INT64 - "uint64", // TYPE_UINT64 - "int32", // TYPE_INT32 - "fixed64", // TYPE_FIXED64 - "fixed32", // TYPE_FIXED32 - "bool", // TYPE_BOOL - "string", // TYPE_STRING - "group", // TYPE_GROUP - "message", // TYPE_MESSAGE - "bytes", // TYPE_BYTES - "uint32", // TYPE_UINT32 - "enum", // TYPE_ENUM - "sfixed32", // TYPE_SFIXED32 - "sfixed64", // TYPE_SFIXED64 - "sint32", // TYPE_SINT32 - "sint64", // TYPE_SINT64 -}; - -const char* const FieldDescriptor::kCppTypeToName[MAX_CPPTYPE + 1] = { - "ERROR", // 0 is reserved for errors - - "int32", // CPPTYPE_INT32 - "int64", // CPPTYPE_INT64 - "uint32", // CPPTYPE_UINT32 - "uint64", // CPPTYPE_UINT64 - "double", // CPPTYPE_DOUBLE - "float", // CPPTYPE_FLOAT - "bool", // CPPTYPE_BOOL - "enum", // CPPTYPE_ENUM - "string", // CPPTYPE_STRING - "message", // CPPTYPE_MESSAGE -}; - -const char* const FieldDescriptor::kLabelToName[MAX_LABEL + 1] = { - "ERROR", // 0 is reserved for errors - - "optional", // LABEL_OPTIONAL - "required", // LABEL_REQUIRED - "repeated", // LABEL_REPEATED -}; - -const char* FileDescriptor::SyntaxName(FileDescriptor::Syntax syntax) { - switch (syntax) { - case SYNTAX_PROTO2: - return "proto2"; - case SYNTAX_PROTO3: - return "proto3"; - case SYNTAX_UNKNOWN: - return "unknown"; - } - GOOGLE_LOG(FATAL) << "can't reach here."; - return nullptr; -} - -static const char* const kNonLinkedWeakMessageReplacementName = "google.protobuf.Empty"; - -#if !defined(_MSC_VER) || (_MSC_VER >= 1900 && _MSC_VER < 1912) -const int FieldDescriptor::kMaxNumber; -const int FieldDescriptor::kFirstReservedNumber; -const int FieldDescriptor::kLastReservedNumber; -#endif - -namespace { - -// Note: I distrust ctype.h due to locales. -char ToUpper(char ch) { - return (ch >= 'a' && ch <= 'z') ? (ch - 'a' + 'A') : ch; -} - -char ToLower(char ch) { - return (ch >= 'A' && ch <= 'Z') ? (ch - 'A' + 'a') : ch; -} - -std::string ToCamelCase(const std::string& input, bool lower_first) { - bool capitalize_next = !lower_first; - std::string result; - result.reserve(input.size()); - - for (char character : input) { - if (character == '_') { - capitalize_next = true; - } else if (capitalize_next) { - result.push_back(ToUpper(character)); - capitalize_next = false; - } else { - result.push_back(character); - } - } - - // Lower-case the first letter. - if (lower_first && !result.empty()) { - result[0] = ToLower(result[0]); - } - - return result; -} - -std::string ToJsonName(const std::string& input) { - bool capitalize_next = false; - std::string result; - result.reserve(input.size()); - - for (char character : input) { - if (character == '_') { - capitalize_next = true; - } else if (capitalize_next) { - result.push_back(ToUpper(character)); - capitalize_next = false; - } else { - result.push_back(character); - } - } - - return result; -} - -std::string EnumValueToPascalCase(const std::string& input) { - bool next_upper = true; - std::string result; - result.reserve(input.size()); - - for (char character : input) { - if (character == '_') { - next_upper = true; - } else { - if (next_upper) { - result.push_back(ToUpper(character)); - } else { - result.push_back(ToLower(character)); - } - next_upper = false; - } - } - - return result; -} - -// Class to remove an enum prefix from enum values. -class PrefixRemover { - public: - PrefixRemover(StringPiece prefix) { - // Strip underscores and lower-case the prefix. - for (char character : prefix) { - if (character != '_') { - prefix_ += ascii_tolower(character); - } - } - } - - // Tries to remove the enum prefix from this enum value. - // If this is not possible, returns the input verbatim. - std::string MaybeRemove(StringPiece str) { - // We can't just lowercase and strip str and look for a prefix. - // We need to properly recognize the difference between: - // - // enum Foo { - // FOO_BAR_BAZ = 0; - // FOO_BARBAZ = 1; - // } - // - // This is acceptable (though perhaps not advisable) because even when - // we PascalCase, these two will still be distinct (BarBaz vs. Barbaz). - size_t i, j; - - // Skip past prefix_ in str if we can. - for (i = 0, j = 0; i < str.size() && j < prefix_.size(); i++) { - if (str[i] == '_') { - continue; - } - - if (ascii_tolower(str[i]) != prefix_[j++]) { - return std::string(str); - } - } - - // If we didn't make it through the prefix, we've failed to strip the - // prefix. - if (j < prefix_.size()) { - return std::string(str); - } - - // Skip underscores between prefix and further characters. - while (i < str.size() && str[i] == '_') { - i++; - } - - // Enum label can't be the empty string. - if (i == str.size()) { - return std::string(str); - } - - // We successfully stripped the prefix. - str.remove_prefix(i); - return std::string(str); - } - - private: - std::string prefix_; -}; - -// A DescriptorPool contains a bunch of hash-maps to implement the -// various Find*By*() methods. Since hashtable lookups are O(1), it's -// most efficient to construct a fixed set of large hash-maps used by -// all objects in the pool rather than construct one or more small -// hash-maps for each object. -// -// The keys to these hash-maps are (parent, name) or (parent, number) pairs. - -typedef std::pair PointerStringPair; - -typedef std::pair DescriptorIntPair; - -#define HASH_MAP std::unordered_map -#define HASH_SET std::unordered_set -#define HASH_FXN hash - -template -struct PointerIntegerPairHash { - size_t operator()(const PairType& p) const { - static const size_t prime1 = 16777499; - static const size_t prime2 = 16777619; - return reinterpret_cast(p.first) * prime1 ^ - static_cast(p.second) * prime2; - } - -#ifdef _MSC_VER - // Used only by MSVC and platforms where hash_map is not available. - static const size_t bucket_size = 4; - static const size_t min_buckets = 8; -#endif - inline bool operator()(const PairType& a, const PairType& b) const { - return a < b; - } -}; - -struct PointerStringPairHash { - size_t operator()(const PointerStringPair& p) const { - static const size_t prime = 16777619; - hash string_hash; - return reinterpret_cast(p.first) * prime ^ - static_cast(string_hash(p.second)); - } - -#ifdef _MSC_VER - // Used only by MSVC and platforms where hash_map is not available. - static const size_t bucket_size = 4; - static const size_t min_buckets = 8; -#endif - inline bool operator()(const PointerStringPair& a, - const PointerStringPair& b) const { - return a < b; - } -}; - - -const Symbol kNullSymbol; - -struct SymbolByFullNameHash { - size_t operator()(Symbol s) const { - return HASH_FXN{}(s.full_name()); - } -}; -struct SymbolByFullNameEq { - bool operator()(Symbol a, Symbol b) const { - return a.full_name() == b.full_name(); - } -}; -using SymbolsByNameSet = - HASH_SET; - -struct SymbolByParentHash { - size_t operator()(Symbol s) const { - return PointerStringPairHash{}(s.parent_name_key()); - } -}; -struct SymbolByParentEq { - bool operator()(Symbol a, Symbol b) const { - return a.parent_name_key() == b.parent_name_key(); - } -}; -using SymbolsByParentSet = - HASH_SET; - -typedef HASH_MAP> - FilesByNameMap; - -typedef HASH_MAP - FieldsByNameMap; - -struct FieldsByNumberHash { - size_t operator()(Symbol s) const { - return PointerIntegerPairHash>{}( - s.parent_number_key()); - } -}; -struct FieldsByNumberEq { - bool operator()(Symbol a, Symbol b) const { - return a.parent_number_key() == b.parent_number_key(); - } -}; -using FieldsByNumberSet = - HASH_SET; -using EnumValuesByNumberSet = FieldsByNumberSet; - -// This is a map rather than a hash-map, since we use it to iterate -// through all the extensions that extend a given Descriptor, and an -// ordered data structure that implements lower_bound is convenient -// for that. -typedef std::map - ExtensionsGroupedByDescriptorMap; -typedef HASH_MAP - LocationsByPathMap; - -std::set* NewAllowedProto3Extendee() { - auto allowed_proto3_extendees = new std::set; - const char* kOptionNames[] = { - "FileOptions", "MessageOptions", "FieldOptions", "EnumOptions", - "EnumValueOptions", "ServiceOptions", "MethodOptions", "OneofOptions"}; - for (const char* option_name : kOptionNames) { - // descriptor.proto has a different package name in opensource. We allow - // both so the opensource protocol compiler can also compile internal - // proto3 files with custom options. See: b/27567912 - allowed_proto3_extendees->insert(std::string("google.protobuf.") + - option_name); - // Split the word to trick the opensource processing scripts so they - // will keep the original package name. - allowed_proto3_extendees->insert(std::string("proto") + "2." + option_name); - } - return allowed_proto3_extendees; -} - -// Checks whether the extendee type is allowed in proto3. -// Only extensions to descriptor options are allowed. We use name comparison -// instead of comparing the descriptor directly because the extensions may be -// defined in a different pool. -bool AllowedExtendeeInProto3(const std::string& name) { - static auto allowed_proto3_extendees = - internal::OnShutdownDelete(NewAllowedProto3Extendee()); - return allowed_proto3_extendees->find(name) != - allowed_proto3_extendees->end(); -} - -// This bump allocator arena is optimized for the use case of this file. It is -// mostly optimized for memory usage, since these objects are expected to live -// for the entirety of the program. -// -// Some differences from other arenas: -// - It has a fixed number of non-trivial types it can hold. This allows -// tracking the allocations with a single byte. In contrast, google::protobuf::Arena -// uses 16 bytes per non-trivial object created. -// - It has some extra metadata for rollbacks. This is necessary for -// implementing the API below. This metadata is flushed at the end and would -// not cause persistent memory usage. -// - It tries to squeeze every byte of out the blocks. If an allocation is too -// large for the current block we move the block to a secondary area where we -// can still use it for smaller objects. This complicates rollback logic but -// makes it much more memory efficient. -// -// The allocation strategy is as follows: -// - Memory is allocated from the front, with a forced 8 byte alignment. -// - Metadata is allocated from the back, one byte per element. -// - The metadata encodes one of two things: -// * For types we want to track, the index into KnownTypes. -// * For raw memory blocks, the size of the block (in 8 byte increments -// to allow for a larger limit). -// - When the raw data is too large to represent in the metadata byte, we -// allocate this memory separately in the heap and store an OutOfLineAlloc -// object instead. These come from large array allocations and alike. -// -// Blocks are kept in 3 areas: -// - `current_` is the one we are currently allocating from. When we need to -// allocate a block that doesn't fit there, we make a new block and move the -// old `current_` to one of the areas below. -// - Blocks that have no more usable space left (ie less than 9 bytes) are -// stored in `full_blocks_`. -// - Blocks that have some usable space are categorized in -// `small_size_blocks_` depending on how much space they have left. -// See `kSmallSizes` to see which sizes we track. -// -class TableArena { - public: - // Allocate a block on `n` bytes, with no destructor information saved. - void* AllocateMemory(uint32_t n) { - uint32_t tag = SizeToRawTag(n) + kFirstRawTag; - if (tag > 255) { - // We can't fit the size, use an OutOfLineAlloc. - return Create(OutOfLineAlloc{::operator new(n), n})->ptr; - } - - return AllocRawInternal(n, static_cast(tag)); - } - - // Allocate and construct an element of type `T` as if by - // `T(std::forward(args...))`. - // The object is registered for destruction, if its destructor is not trivial. - template - T* Create(Args&&... args) { - static_assert(alignof(T) <= 8, ""); - return ::new (AllocRawInternal(sizeof(T), TypeTag(KnownTypes{}))) - T(std::forward(args)...); - } - - TableArena() {} - - TableArena(const TableArena&) = delete; - TableArena& operator=(const TableArena&) = delete; - - ~TableArena() { - // Uncomment this to debug usage statistics of the arena blocks. - // PrintUsageInfo(); - - for (Block* list : GetLists()) { - while (list != nullptr) { - Block* b = list; - list = list->next; - b->VisitBlock(DestroyVisitor{}); - b->Destroy(); - } - } - } - - - // This function exists for debugging only. - // It can be called from the destructor to dump some info in the tests to - // inspect the usage of the arena. - void PrintUsageInfo() const { - const auto print_histogram = [](Block* b, int size) { - std::map unused_space_count; - int count = 0; - for (; b != nullptr; b = b->next) { - ++unused_space_count[b->space_left()]; - ++count; - } - if (size > 0) { - fprintf(stderr, " Blocks `At least %d`", size); - } else { - fprintf(stderr, " Blocks `full`"); - } - fprintf(stderr, ": %d blocks.\n", count); - for (auto p : unused_space_count) { - fprintf(stderr, " space=%4u, count=%3u\n", p.first, p.second); - } - }; - - fprintf(stderr, "TableArena unused space histogram:\n"); - fprintf(stderr, " Current: %u\n", - current_ != nullptr ? current_->space_left() : 0); - print_histogram(full_blocks_, 0); - for (size_t i = 0; i < kSmallSizes.size(); ++i) { - print_histogram(small_size_blocks_[i], kSmallSizes[i]); - } - } - - // Current allocation count. - // This can be used for checkpointing. - size_t num_allocations() const { return num_allocations_; } - - // Rollback the latest allocations until we reach back to `checkpoint` - // num_allocations. - void RollbackTo(size_t checkpoint) { - while (num_allocations_ > checkpoint) { - GOOGLE_DCHECK(!rollback_info_.empty()); - auto& info = rollback_info_.back(); - Block* b = info.block; - - VisitAlloc(b->data(), &b->start_offset, &b->end_offset, DestroyVisitor{}, - KnownTypes{}); - if (--info.count == 0) { - rollback_info_.pop_back(); - } - --num_allocations_; - } - - // Reconstruct the lists and destroy empty blocks. - auto lists = GetLists(); - current_ = full_blocks_ = nullptr; - small_size_blocks_.fill(nullptr); - - for (Block* list : lists) { - while (list != nullptr) { - Block* b = list; - list = list->next; - - if (b->start_offset == 0) { - // This is empty, free it. - b->Destroy(); - } else { - RelocateToUsedList(b); - } - } - } - } - - // Clear all rollback information. Reduces memory usage. - // Trying to rollback past num_allocations() is now impossible. - void ClearRollbackData() { - rollback_info_.clear(); - rollback_info_.shrink_to_fit(); - } - - private: - static constexpr size_t RoundUp(size_t n) { return (n + 7) & ~7; } - - using Tag = unsigned char; - - void* AllocRawInternal(uint32_t size, Tag tag) { - GOOGLE_DCHECK_GT(size, 0); - size = RoundUp(size); - - Block* to_relocate = nullptr; - Block* to_use = nullptr; - - for (size_t i = 0; i < kSmallSizes.size(); ++i) { - if (small_size_blocks_[i] != nullptr && size <= kSmallSizes[i]) { - to_use = to_relocate = PopBlock(small_size_blocks_[i]); - break; - } - } - - if (to_relocate != nullptr) { - // We found one in the loop. - } else if (current_ != nullptr && size + 1 <= current_->space_left()) { - to_use = current_; - } else { - // No space left anywhere, make a new block. - to_relocate = current_; - // For now we hardcode the size to one page. Note that the maximum we can - // allocate in the block according to the limits of Tag is less than 2k, - // so this can fit anything that Tag can represent. - constexpr size_t kBlockSize = 4096; - to_use = current_ = ::new (::operator new(kBlockSize)) Block(kBlockSize); - GOOGLE_DCHECK_GE(current_->space_left(), size + 1); - } - - ++num_allocations_; - if (!rollback_info_.empty() && rollback_info_.back().block == to_use) { - ++rollback_info_.back().count; - } else { - rollback_info_.push_back({to_use, 1}); - } - - void* p = to_use->Allocate(size, tag); - if (to_relocate != nullptr) { - RelocateToUsedList(to_relocate); - } - return p; - } - - static void OperatorDelete(void* p, size_t s) { -#if defined(__GXX_DELETE_WITH_SIZE__) || defined(__cpp_sized_deallocation) - ::operator delete(p, s); -#else - ::operator delete(p); -#endif - } - - struct OutOfLineAlloc { - void* ptr; - uint32_t size; - }; - - template - struct TypeList { - static constexpr Tag kSize = static_cast(sizeof...(T)); - }; - - template - static void RunVisitor(char* p, uint16_t* start, Visitor visit) { - *start -= RoundUp(sizeof(T)); - visit(reinterpret_cast(p + *start)); - } - - // Visit the allocation at the passed location. - // It updates start/end to be after the visited object. - // This allows visiting a whole block by calling the function in a loop. - template - static void VisitAlloc(char* p, uint16_t* start, uint16_t* end, Visitor visit, - TypeList) { - const Tag tag = static_cast(p[*end]); - if (tag >= kFirstRawTag) { - // Raw memory. Skip it. - *start -= TagToSize(tag); - } else { - using F = void (*)(char*, uint16_t*, Visitor); - static constexpr F kFuncs[] = {&RunVisitor...}; - kFuncs[tag](p, start, visit); - } - ++*end; - } - - template - static constexpr Tag TypeTag(TypeList) { - return 0; - } - - template < - typename U, typename T, typename... Ts, - typename = typename std::enable_if::value>::type> - static constexpr Tag TypeTag(TypeList) { - return 1 + TypeTag(TypeList{}); - } - - template - static constexpr Tag TypeTag(TypeList<>) { - static_assert(std::is_trivially_destructible::value, ""); - return SizeToRawTag(sizeof(U)); - } - - using KnownTypes = - TypeList, std::array, - std::array, std::array, - FileDescriptorTables, SourceCodeInfo, FileOptions, - MessageOptions, FieldOptions, ExtensionRangeOptions, - OneofOptions, EnumOptions, EnumValueOptions, ServiceOptions, - MethodOptions>; - static constexpr Tag kFirstRawTag = KnownTypes::kSize; - - - struct DestroyVisitor { - template - void operator()(T* p) { - p->~T(); - } - void operator()(OutOfLineAlloc* p) { OperatorDelete(p->ptr, p->size); } - }; - - static uint32_t SizeToRawTag(size_t n) { return (RoundUp(n) / 8) - 1; } - - static uint32_t TagToSize(Tag tag) { - GOOGLE_DCHECK_GE(tag, kFirstRawTag); - return static_cast(tag - kFirstRawTag + 1) * 8; - } - - struct Block { - uint16_t start_offset; - uint16_t end_offset; - uint16_t capacity; - Block* next; - - // `allocated_size` is the total size of the memory block allocated. - // The `Block` structure is constructed at the start and the rest of the - // memory is used as the payload of the `Block`. - explicit Block(uint32_t allocated_size) { - start_offset = 0; - end_offset = capacity = - reinterpret_cast(this) + allocated_size - data(); - next = nullptr; - } - - char* data() { - return reinterpret_cast(this) + RoundUp(sizeof(Block)); - } - - uint32_t memory_used() { - return data() + capacity - reinterpret_cast(this); - } - uint32_t space_left() const { return end_offset - start_offset; } - - void* Allocate(uint32_t n, Tag tag) { - GOOGLE_DCHECK_LE(n + 1, space_left()); - void* p = data() + start_offset; - start_offset += n; - data()[--end_offset] = tag; - return p; - } - - void Destroy() { OperatorDelete(this, memory_used()); } - - void PrependTo(Block*& list) { - next = list; - list = this; - } - - template - void VisitBlock(Visitor visit) { - for (uint16_t s = start_offset, e = end_offset; s != 0;) { - VisitAlloc(data(), &s, &e, visit, KnownTypes{}); - } - } - }; - - Block* PopBlock(Block*& list) { - Block* res = list; - list = list->next; - return res; - } - - void RelocateToUsedList(Block* to_relocate) { - if (current_ == nullptr) { - current_ = to_relocate; - current_->next = nullptr; - return; - } else if (current_->space_left() < to_relocate->space_left()) { - std::swap(current_, to_relocate); - current_->next = nullptr; - } - - for (int i = kSmallSizes.size(); --i >= 0;) { - if (to_relocate->space_left() >= 1 + kSmallSizes[i]) { - to_relocate->PrependTo(small_size_blocks_[i]); - return; - } - } - - to_relocate->PrependTo(full_blocks_); - } - - static constexpr std::array kSmallSizes = { - {// Sizes for pointer arrays. - 8, 16, 24, 32, - // Sizes for string arrays (for descriptor names). - // The most common array sizes are 2 and 3. - 2 * sizeof(std::string), 3 * sizeof(std::string)}}; - - // Helper function to iterate all lists. - std::array GetLists() const { - std::array res; - res[0] = current_; - res[1] = full_blocks_; - std::copy(small_size_blocks_.begin(), small_size_blocks_.end(), &res[2]); - return res; - } - - Block* current_ = nullptr; - std::array small_size_blocks_ = {{}}; - Block* full_blocks_ = nullptr; - - size_t num_allocations_ = 0; - struct RollbackInfo { - Block* block; - size_t count; - }; - std::vector rollback_info_; -}; - -constexpr std::array TableArena::kSmallSizes; - -} // anonymous namespace - -// =================================================================== -// DescriptorPool::Tables - -class DescriptorPool::Tables { - public: - Tables(); - ~Tables(); - - // Record the current state of the tables to the stack of checkpoints. - // Each call to AddCheckpoint() must be paired with exactly one call to either - // ClearLastCheckpoint() or RollbackToLastCheckpoint(). - // - // This is used when building files, since some kinds of validation errors - // cannot be detected until the file's descriptors have already been added to - // the tables. - // - // This supports recursive checkpoints, since building a file may trigger - // recursive building of other files. Note that recursive checkpoints are not - // normally necessary; explicit dependencies are built prior to checkpointing. - // So although we recursively build transitive imports, there is at most one - // checkpoint in the stack during dependency building. - // - // Recursive checkpoints only arise during cross-linking of the descriptors. - // Symbol references must be resolved, via DescriptorBuilder::FindSymbol and - // friends. If the pending file references an unknown symbol - // (e.g., it is not defined in the pending file's explicit dependencies), and - // the pool is using a fallback database, and that database contains a file - // defining that symbol, and that file has not yet been built by the pool, - // the pool builds the file during cross-linking, leading to another - // checkpoint. - void AddCheckpoint(); - - // Mark the last checkpoint as having cleared successfully, removing it from - // the stack. If the stack is empty, all pending symbols will be committed. - // - // Note that this does not guarantee that the symbols added since the last - // checkpoint won't be rolled back: if a checkpoint gets rolled back, - // everything past that point gets rolled back, including symbols added after - // checkpoints that were pushed onto the stack after it and marked as cleared. - void ClearLastCheckpoint(); - - // Roll back the Tables to the state of the checkpoint at the top of the - // stack, removing everything that was added after that point. - void RollbackToLastCheckpoint(); - - // The stack of files which are currently being built. Used to detect - // cyclic dependencies when loading files from a DescriptorDatabase. Not - // used when fallback_database_ == nullptr. - std::vector pending_files_; - - // A set of files which we have tried to load from the fallback database - // and encountered errors. We will not attempt to load them again during - // execution of the current public API call, but for compatibility with - // legacy clients, this is cleared at the beginning of each public API call. - // Not used when fallback_database_ == nullptr. - HASH_SET known_bad_files_; - - // A set of symbols which we have tried to load from the fallback database - // and encountered errors. We will not attempt to load them again during - // execution of the current public API call, but for compatibility with - // legacy clients, this is cleared at the beginning of each public API call. - HASH_SET known_bad_symbols_; - - // The set of descriptors for which we've already loaded the full - // set of extensions numbers from fallback_database_. - HASH_SET extensions_loaded_from_db_; - - // Maps type name to Descriptor::WellKnownType. This is logically global - // and const, but we make it a member here to simplify its construction and - // destruction. This only has 20-ish entries and is one per DescriptorPool, - // so the overhead is small. - HASH_MAP well_known_types_; - - // ----------------------------------------------------------------- - // Finding items. - - // Find symbols. This returns a null Symbol (symbol.IsNull() is true) - // if not found. - inline Symbol FindSymbol(StringPiece key) const; - - // This implements the body of DescriptorPool::Find*ByName(). It should - // really be a private method of DescriptorPool, but that would require - // declaring Symbol in descriptor.h, which would drag all kinds of other - // stuff into the header. Yay C++. - Symbol FindByNameHelper(const DescriptorPool* pool, StringPiece name); - - // These return nullptr if not found. - inline const FileDescriptor* FindFile(StringPiece key) const; - inline const FieldDescriptor* FindExtension(const Descriptor* extendee, - int number) const; - inline void FindAllExtensions(const Descriptor* extendee, - std::vector* out) const; - - // ----------------------------------------------------------------- - // Adding items. - - // These add items to the corresponding tables. They return false if - // the key already exists in the table. For AddSymbol(), the string passed - // in must be one that was constructed using AllocateString(), as it will - // be used as a key in the symbols_by_name_ map without copying. - bool AddSymbol(const std::string& full_name, Symbol symbol); - bool AddFile(const FileDescriptor* file); - bool AddExtension(const FieldDescriptor* field); - - // ----------------------------------------------------------------- - // Allocating memory. - - // Allocate an object which will be reclaimed when the pool is - // destroyed. Note that the object's destructor will never be called, - // so its fields must be plain old data (primitive data types and - // pointers). All of the descriptor types are such objects. - template - Type* Allocate(); - - // Allocate an array of objects which will be reclaimed when the - // pool in destroyed. Again, destructors are never called. - template - Type* AllocateArray(int count); - - // Allocate a string which will be destroyed when the pool is destroyed. - // The string is initialized to the given value for convenience. - const std::string* AllocateString(StringPiece value); - - // Copy the input into a NUL terminated string whose lifetime is managed by - // the pool. - const char* Strdup(StringPiece value); - - // Allocates an array of strings which will be destroyed when the pool is - // destroyed. The array is initialized with the input values. - template - const std::string* AllocateStringArray(In&&... values); - - struct FieldNamesResult { - std::string* array; - int lowercase_index; - int camelcase_index; - int json_index; - }; - // Allocate all 5 names of the field: - // name, full name, lowercase, camelcase and json. - // This function will dedup the strings when possible. - // The resulting array contains `name` at index 0, `full_name` at index 1 and - // the other 3 indices are specified in the result. - FieldNamesResult AllocateFieldNames(const std::string& name, - const std::string& scope, - const std::string* opt_json_name); - - // Create an object that will be deleted when the pool is destroyed. - // The object is value initialized, and its destructor will be called if - // non-trivial. - template - Type* Create(); - - // Allocate a protocol message object. Some older versions of GCC have - // trouble understanding explicit template instantiations in some cases, so - // in those cases we have to pass a dummy pointer of the right type as the - // parameter instead of specifying the type explicitly. - template - Type* AllocateMessage(Type* dummy = nullptr); - - // Allocate a FileDescriptorTables object. - FileDescriptorTables* AllocateFileTables(); - - private: - // All other memory allocated in the pool. Must be first as other objects can - // point into these. - TableArena arena_; - - SymbolsByNameSet symbols_by_name_; - FilesByNameMap files_by_name_; - ExtensionsGroupedByDescriptorMap extensions_; - - struct CheckPoint { - explicit CheckPoint(const Tables* tables) - : arena_before_checkpoint(tables->arena_.num_allocations()), - pending_symbols_before_checkpoint( - tables->symbols_after_checkpoint_.size()), - pending_files_before_checkpoint( - tables->files_after_checkpoint_.size()), - pending_extensions_before_checkpoint( - tables->extensions_after_checkpoint_.size()) {} - int arena_before_checkpoint; - int pending_symbols_before_checkpoint; - int pending_files_before_checkpoint; - int pending_extensions_before_checkpoint; - }; - std::vector checkpoints_; - std::vector symbols_after_checkpoint_; - std::vector files_after_checkpoint_; - std::vector extensions_after_checkpoint_; - - // Allocate some bytes which will be reclaimed when the pool is - // destroyed. - void* AllocateBytes(int size); -}; - -// Contains tables specific to a particular file. These tables are not -// modified once the file has been constructed, so they need not be -// protected by a mutex. This makes operations that depend only on the -// contents of a single file -- e.g. Descriptor::FindFieldByName() -- -// lock-free. -// -// For historical reasons, the definitions of the methods of -// FileDescriptorTables and DescriptorPool::Tables are interleaved below. -// These used to be a single class. -class FileDescriptorTables { - public: - FileDescriptorTables(); - ~FileDescriptorTables(); - - // Empty table, used with placeholder files. - inline static const FileDescriptorTables& GetEmptyInstance(); - - // ----------------------------------------------------------------- - // Finding items. - - // Returns a null Symbol (symbol.IsNull() is true) if not found. - inline Symbol FindNestedSymbol(const void* parent, - StringPiece name) const; - - // These return nullptr if not found. - inline const FieldDescriptor* FindFieldByNumber(const Descriptor* parent, - int number) const; - inline const FieldDescriptor* FindFieldByLowercaseName( - const void* parent, StringPiece lowercase_name) const; - inline const FieldDescriptor* FindFieldByCamelcaseName( - const void* parent, StringPiece camelcase_name) const; - inline const EnumValueDescriptor* FindEnumValueByNumber( - const EnumDescriptor* parent, int number) const; - // This creates a new EnumValueDescriptor if not found, in a thread-safe way. - inline const EnumValueDescriptor* FindEnumValueByNumberCreatingIfUnknown( - const EnumDescriptor* parent, int number) const; - - // ----------------------------------------------------------------- - // Adding items. - - // These add items to the corresponding tables. They return false if - // the key already exists in the table. For AddAliasUnderParent(), the - // string passed in must be one that was constructed using AllocateString(), - // as it will be used as a key in the symbols_by_parent_ map without copying. - bool AddAliasUnderParent(const void* parent, const std::string& name, - Symbol symbol); - bool AddFieldByNumber(FieldDescriptor* field); - bool AddEnumValueByNumber(EnumValueDescriptor* value); - - // Adds the field to the lowercase_name and camelcase_name maps. Never - // fails because we allow duplicates; the first field by the name wins. - void AddFieldByStylizedNames(const FieldDescriptor* field); - - // Populates p->first->locations_by_path_ from p->second. - // Unusual signature dictated by internal::call_once. - static void BuildLocationsByPath( - std::pair* p); - - // Returns the location denoted by the specified path through info, - // or nullptr if not found. - // The value of info must be that of the corresponding FileDescriptor. - // (Conceptually a pure function, but stateful as an optimisation.) - const SourceCodeInfo_Location* GetSourceLocation( - const std::vector& path, const SourceCodeInfo* info) const; - - // Must be called after BuildFileImpl(), even if the build failed and - // we are going to roll back to the last checkpoint. - void FinalizeTables(); - - private: - const void* FindParentForFieldsByMap(const FieldDescriptor* field) const; - static void FieldsByLowercaseNamesLazyInitStatic( - const FileDescriptorTables* tables); - void FieldsByLowercaseNamesLazyInitInternal() const; - static void FieldsByCamelcaseNamesLazyInitStatic( - const FileDescriptorTables* tables); - void FieldsByCamelcaseNamesLazyInitInternal() const; - - SymbolsByParentSet symbols_by_parent_; - mutable FieldsByNameMap fields_by_lowercase_name_; - std::unique_ptr fields_by_lowercase_name_tmp_; - mutable internal::once_flag fields_by_lowercase_name_once_; - mutable FieldsByNameMap fields_by_camelcase_name_; - std::unique_ptr fields_by_camelcase_name_tmp_; - mutable internal::once_flag fields_by_camelcase_name_once_; - FieldsByNumberSet fields_by_number_; // Not including extensions. - EnumValuesByNumberSet enum_values_by_number_; - mutable EnumValuesByNumberSet unknown_enum_values_by_number_ - PROTOBUF_GUARDED_BY(unknown_enum_values_mu_); - - // Populated on first request to save space, hence constness games. - mutable internal::once_flag locations_by_path_once_; - mutable LocationsByPathMap locations_by_path_; - - // Mutex to protect the unknown-enum-value map due to dynamic - // EnumValueDescriptor creation on unknown values. - mutable internal::WrappedMutex unknown_enum_values_mu_; -}; - -DescriptorPool::Tables::Tables() { - well_known_types_.insert({ - {"google.protobuf.DoubleValue", Descriptor::WELLKNOWNTYPE_DOUBLEVALUE}, - {"google.protobuf.FloatValue", Descriptor::WELLKNOWNTYPE_FLOATVALUE}, - {"google.protobuf.Int64Value", Descriptor::WELLKNOWNTYPE_INT64VALUE}, - {"google.protobuf.UInt64Value", Descriptor::WELLKNOWNTYPE_UINT64VALUE}, - {"google.protobuf.Int32Value", Descriptor::WELLKNOWNTYPE_INT32VALUE}, - {"google.protobuf.UInt32Value", Descriptor::WELLKNOWNTYPE_UINT32VALUE}, - {"google.protobuf.StringValue", Descriptor::WELLKNOWNTYPE_STRINGVALUE}, - {"google.protobuf.BytesValue", Descriptor::WELLKNOWNTYPE_BYTESVALUE}, - {"google.protobuf.BoolValue", Descriptor::WELLKNOWNTYPE_BOOLVALUE}, - {"google.protobuf.Any", Descriptor::WELLKNOWNTYPE_ANY}, - {"google.protobuf.FieldMask", Descriptor::WELLKNOWNTYPE_FIELDMASK}, - {"google.protobuf.Duration", Descriptor::WELLKNOWNTYPE_DURATION}, - {"google.protobuf.Timestamp", Descriptor::WELLKNOWNTYPE_TIMESTAMP}, - {"google.protobuf.Value", Descriptor::WELLKNOWNTYPE_VALUE}, - {"google.protobuf.ListValue", Descriptor::WELLKNOWNTYPE_LISTVALUE}, - {"google.protobuf.Struct", Descriptor::WELLKNOWNTYPE_STRUCT}, - }); -} - -DescriptorPool::Tables::~Tables() { GOOGLE_DCHECK(checkpoints_.empty()); } - -FileDescriptorTables::FileDescriptorTables() - : fields_by_lowercase_name_tmp_(new FieldsByNameMap()), - fields_by_camelcase_name_tmp_(new FieldsByNameMap()) {} - -FileDescriptorTables::~FileDescriptorTables() {} - -inline const FileDescriptorTables& FileDescriptorTables::GetEmptyInstance() { - static auto file_descriptor_tables = - internal::OnShutdownDelete(new FileDescriptorTables()); - return *file_descriptor_tables; -} - -void DescriptorPool::Tables::AddCheckpoint() { - checkpoints_.push_back(CheckPoint(this)); -} - -void DescriptorPool::Tables::ClearLastCheckpoint() { - GOOGLE_DCHECK(!checkpoints_.empty()); - checkpoints_.pop_back(); - if (checkpoints_.empty()) { - // All checkpoints have been cleared: we can now commit all of the pending - // data. - symbols_after_checkpoint_.clear(); - files_after_checkpoint_.clear(); - extensions_after_checkpoint_.clear(); - arena_.ClearRollbackData(); - } -} - -void DescriptorPool::Tables::RollbackToLastCheckpoint() { - GOOGLE_DCHECK(!checkpoints_.empty()); - const CheckPoint& checkpoint = checkpoints_.back(); - - for (size_t i = checkpoint.pending_symbols_before_checkpoint; - i < symbols_after_checkpoint_.size(); i++) { - Symbol::QueryKey name; - name.name = symbols_after_checkpoint_[i]; - symbols_by_name_.erase(Symbol(&name)); - } - for (size_t i = checkpoint.pending_files_before_checkpoint; - i < files_after_checkpoint_.size(); i++) { - files_by_name_.erase(files_after_checkpoint_[i]); - } - for (size_t i = checkpoint.pending_extensions_before_checkpoint; - i < extensions_after_checkpoint_.size(); i++) { - extensions_.erase(extensions_after_checkpoint_[i]); - } - - symbols_after_checkpoint_.resize( - checkpoint.pending_symbols_before_checkpoint); - files_after_checkpoint_.resize(checkpoint.pending_files_before_checkpoint); - extensions_after_checkpoint_.resize( - checkpoint.pending_extensions_before_checkpoint); - - arena_.RollbackTo(checkpoint.arena_before_checkpoint); - checkpoints_.pop_back(); -} - -// ------------------------------------------------------------------- - -inline Symbol DescriptorPool::Tables::FindSymbol(StringPiece key) const { - Symbol::QueryKey name; - name.name = key; - auto it = symbols_by_name_.find(Symbol(&name)); - return it == symbols_by_name_.end() ? kNullSymbol : *it; -} - -inline Symbol FileDescriptorTables::FindNestedSymbol( - const void* parent, StringPiece name) const { - Symbol::QueryKey query; - query.name = name; - query.parent = parent; - auto it = symbols_by_parent_.find(Symbol(&query)); - return it == symbols_by_parent_.end() ? kNullSymbol : *it; -} - -Symbol DescriptorPool::Tables::FindByNameHelper(const DescriptorPool* pool, - StringPiece name) { - if (pool->mutex_ != nullptr) { - // Fast path: the Symbol is already cached. This is just a hash lookup. - ReaderMutexLock lock(pool->mutex_); - if (known_bad_symbols_.empty() && known_bad_files_.empty()) { - Symbol result = FindSymbol(name); - if (!result.IsNull()) return result; - } - } - MutexLockMaybe lock(pool->mutex_); - if (pool->fallback_database_ != nullptr) { - known_bad_symbols_.clear(); - known_bad_files_.clear(); - } - Symbol result = FindSymbol(name); - - if (result.IsNull() && pool->underlay_ != nullptr) { - // Symbol not found; check the underlay. - result = pool->underlay_->tables_->FindByNameHelper(pool->underlay_, name); - } - - if (result.IsNull()) { - // Symbol still not found, so check fallback database. - if (pool->TryFindSymbolInFallbackDatabase(name)) { - result = FindSymbol(name); - } - } - - return result; -} - -inline const FileDescriptor* DescriptorPool::Tables::FindFile( - StringPiece key) const { - return FindPtrOrNull(files_by_name_, key); -} - -inline const FieldDescriptor* FileDescriptorTables::FindFieldByNumber( - const Descriptor* parent, int number) const { - // If `number` is within the sequential range, just index into the parent - // without doing a table lookup. - if (parent != nullptr && // - 1 <= number && number <= parent->sequential_field_limit_) { - return parent->field(number - 1); - } - - Symbol::QueryKey query; - query.parent = parent; - query.field_number = number; - - auto it = fields_by_number_.find(Symbol(&query)); - return it == fields_by_number_.end() ? nullptr : it->field_descriptor(); -} - -const void* FileDescriptorTables::FindParentForFieldsByMap( - const FieldDescriptor* field) const { - if (field->is_extension()) { - if (field->extension_scope() == nullptr) { - return field->file(); - } else { - return field->extension_scope(); - } - } else { - return field->containing_type(); - } -} - -void FileDescriptorTables::FieldsByLowercaseNamesLazyInitStatic( - const FileDescriptorTables* tables) { - tables->FieldsByLowercaseNamesLazyInitInternal(); -} - -void FileDescriptorTables::FieldsByLowercaseNamesLazyInitInternal() const { - for (Symbol symbol : symbols_by_parent_) { - const FieldDescriptor* field = symbol.field_descriptor(); - if (!field) continue; - PointerStringPair lowercase_key(FindParentForFieldsByMap(field), - field->lowercase_name().c_str()); - InsertIfNotPresent(&fields_by_lowercase_name_, lowercase_key, field); - } -} - -inline const FieldDescriptor* FileDescriptorTables::FindFieldByLowercaseName( - const void* parent, StringPiece lowercase_name) const { - internal::call_once( - fields_by_lowercase_name_once_, - &FileDescriptorTables::FieldsByLowercaseNamesLazyInitStatic, this); - return FindPtrOrNull(fields_by_lowercase_name_, - PointerStringPair(parent, lowercase_name)); -} - -void FileDescriptorTables::FieldsByCamelcaseNamesLazyInitStatic( - const FileDescriptorTables* tables) { - tables->FieldsByCamelcaseNamesLazyInitInternal(); -} - -void FileDescriptorTables::FieldsByCamelcaseNamesLazyInitInternal() const { - for (Symbol symbol : symbols_by_parent_) { - const FieldDescriptor* field = symbol.field_descriptor(); - if (!field) continue; - PointerStringPair camelcase_key(FindParentForFieldsByMap(field), - field->camelcase_name().c_str()); - InsertIfNotPresent(&fields_by_camelcase_name_, camelcase_key, field); - } -} - -inline const FieldDescriptor* FileDescriptorTables::FindFieldByCamelcaseName( - const void* parent, StringPiece camelcase_name) const { - internal::call_once( - fields_by_camelcase_name_once_, - FileDescriptorTables::FieldsByCamelcaseNamesLazyInitStatic, this); - return FindPtrOrNull(fields_by_camelcase_name_, - PointerStringPair(parent, camelcase_name)); -} - -inline const EnumValueDescriptor* FileDescriptorTables::FindEnumValueByNumber( - const EnumDescriptor* parent, int number) const { - // If `number` is within the sequential range, just index into the parent - // without doing a table lookup. - const int base = parent->value(0)->number(); - if (base <= number && - number <= static_cast(base) + parent->sequential_value_limit_) { - return parent->value(number - base); - } - - Symbol::QueryKey query; - query.parent = parent; - query.field_number = number; - - auto it = enum_values_by_number_.find(Symbol(&query)); - return it == enum_values_by_number_.end() ? nullptr - : it->enum_value_descriptor(); -} - -inline const EnumValueDescriptor* -FileDescriptorTables::FindEnumValueByNumberCreatingIfUnknown( - const EnumDescriptor* parent, int number) const { - // First try, with map of compiled-in values. - { - const auto* value = FindEnumValueByNumber(parent, number); - if (value != nullptr) { - return value; - } - } - - Symbol::QueryKey query; - query.parent = parent; - query.field_number = number; - - // Second try, with reader lock held on unknown enum values: common case. - { - ReaderMutexLock l(&unknown_enum_values_mu_); - auto it = unknown_enum_values_by_number_.find(Symbol(&query)); - if (it != unknown_enum_values_by_number_.end() && - it->enum_value_descriptor() != nullptr) { - return it->enum_value_descriptor(); - } - } - // If not found, try again with writer lock held, and create new descriptor if - // necessary. - { - WriterMutexLock l(&unknown_enum_values_mu_); - auto it = unknown_enum_values_by_number_.find(Symbol(&query)); - if (it != unknown_enum_values_by_number_.end() && - it->enum_value_descriptor() != nullptr) { - return it->enum_value_descriptor(); - } - - // Create an EnumValueDescriptor dynamically. We don't insert it into the - // EnumDescriptor (it's not a part of the enum as originally defined), but - // we do insert it into the table so that we can return the same pointer - // later. - std::string enum_value_name = StringPrintf("UNKNOWN_ENUM_VALUE_%s_%d", - parent->name().c_str(), number); - auto* pool = DescriptorPool::generated_pool(); - auto* tables = const_cast(pool->tables_.get()); - EnumValueDescriptor* result; - { - // Must lock the pool because we will do allocations in the shared arena. - MutexLockMaybe l2(pool->mutex_); - result = tables->Allocate(); - result->all_names_ = tables->AllocateStringArray( - enum_value_name, - StrCat(parent->full_name(), ".", enum_value_name)); - } - result->number_ = number; - result->type_ = parent; - result->options_ = &EnumValueOptions::default_instance(); - unknown_enum_values_by_number_.insert(Symbol::EnumValue(result, 0)); - return result; - } -} - -inline const FieldDescriptor* DescriptorPool::Tables::FindExtension( - const Descriptor* extendee, int number) const { - return FindPtrOrNull(extensions_, std::make_pair(extendee, number)); -} - -inline void DescriptorPool::Tables::FindAllExtensions( - const Descriptor* extendee, - std::vector* out) const { - ExtensionsGroupedByDescriptorMap::const_iterator it = - extensions_.lower_bound(std::make_pair(extendee, 0)); - for (; it != extensions_.end() && it->first.first == extendee; ++it) { - out->push_back(it->second); - } -} - -// ------------------------------------------------------------------- - -bool DescriptorPool::Tables::AddSymbol(const std::string& full_name, - Symbol symbol) { - GOOGLE_DCHECK_EQ(full_name, symbol.full_name()); - if (symbols_by_name_.insert(symbol).second) { - symbols_after_checkpoint_.push_back(full_name.c_str()); - return true; - } else { - return false; - } -} - -bool FileDescriptorTables::AddAliasUnderParent(const void* parent, - const std::string& name, - Symbol symbol) { - GOOGLE_DCHECK_EQ(name, symbol.parent_name_key().second); - GOOGLE_DCHECK_EQ(parent, symbol.parent_name_key().first); - return symbols_by_parent_.insert(symbol).second; -} - -bool DescriptorPool::Tables::AddFile(const FileDescriptor* file) { - if (InsertIfNotPresent(&files_by_name_, file->name(), file)) { - files_after_checkpoint_.push_back(file->name().c_str()); - return true; - } else { - return false; - } -} - -void FileDescriptorTables::FinalizeTables() { - // Clean up the temporary maps used by AddFieldByStylizedNames(). - fields_by_lowercase_name_tmp_ = nullptr; - fields_by_camelcase_name_tmp_ = nullptr; -} - -void FileDescriptorTables::AddFieldByStylizedNames( - const FieldDescriptor* field) { - const void* parent = FindParentForFieldsByMap(field); - - // We want fields_by_{lower,camel}case_name_ to be lazily built, but - // cross-link order determines which entry will be present in the case of a - // conflict. So we use the temporary maps that get destroyed after - // BuildFileImpl() to detect the conflicts, and only store the conflicts in - // the map that will persist. We will then lazily populate the rest of the - // entries from fields_by_number_. - - PointerStringPair lowercase_key(parent, field->lowercase_name().c_str()); - if (!InsertIfNotPresent(fields_by_lowercase_name_tmp_.get(), - lowercase_key, field)) { - InsertIfNotPresent( - &fields_by_lowercase_name_, lowercase_key, - FindPtrOrNull(*fields_by_lowercase_name_tmp_, lowercase_key)); - } - - PointerStringPair camelcase_key(parent, field->camelcase_name().c_str()); - if (!InsertIfNotPresent(fields_by_camelcase_name_tmp_.get(), - camelcase_key, field)) { - InsertIfNotPresent( - &fields_by_camelcase_name_, camelcase_key, - FindPtrOrNull(*fields_by_camelcase_name_tmp_, camelcase_key)); - } -} - -bool FileDescriptorTables::AddFieldByNumber(FieldDescriptor* field) { - // Skip fields that are at the start of the sequence. - if (field->containing_type() != nullptr && field->number() >= 1 && - field->number() <= field->containing_type()->sequential_field_limit_) { - if (field->is_extension()) { - // Conflicts with the field that already exists in the sequential range. - return false; - } - // Only return true if the field at that index matches. Otherwise it - // conflicts with the existing field in the sequential range. - return field->containing_type()->field(field->number() - 1) == field; - } - - return fields_by_number_.insert(Symbol(field)).second; -} - -bool FileDescriptorTables::AddEnumValueByNumber(EnumValueDescriptor* value) { - // Skip values that are at the start of the sequence. - const int base = value->type()->value(0)->number(); - if (base <= value->number() && - value->number() <= - static_cast(base) + value->type()->sequential_value_limit_) - return true; - return enum_values_by_number_.insert(Symbol::EnumValue(value, 0)).second; -} - -bool DescriptorPool::Tables::AddExtension(const FieldDescriptor* field) { - DescriptorIntPair key(field->containing_type(), field->number()); - if (InsertIfNotPresent(&extensions_, key, field)) { - extensions_after_checkpoint_.push_back(key); - return true; - } else { - return false; - } -} - -// ------------------------------------------------------------------- - -template -Type* DescriptorPool::Tables::Allocate() { - return reinterpret_cast(AllocateBytes(sizeof(Type))); -} - -template -Type* DescriptorPool::Tables::AllocateArray(int count) { - return reinterpret_cast(AllocateBytes(sizeof(Type) * count)); -} - -const std::string* DescriptorPool::Tables::AllocateString( - StringPiece value) { - return arena_.Create(value); -} - -const char* DescriptorPool::Tables::Strdup(StringPiece value) { - char* p = AllocateArray(static_cast(value.size() + 1)); - memcpy(p, value.data(), value.size()); - p[value.size()] = 0; - return p; -} - -template -const std::string* DescriptorPool::Tables::AllocateStringArray(In&&... values) { - auto& array = *arena_.Create>(); - array = {{std::string(std::forward(values))...}}; - return array.data(); -} - -DescriptorPool::Tables::FieldNamesResult -DescriptorPool::Tables::AllocateFieldNames(const std::string& name, - const std::string& scope, - const std::string* opt_json_name) { - std::string lowercase_name = name; - LowerString(&lowercase_name); - - std::string camelcase_name = ToCamelCase(name, /* lower_first = */ true); - std::string json_name; - if (opt_json_name != nullptr) { - json_name = *opt_json_name; - } else { - json_name = ToJsonName(name); - } - - const bool lower_eq_name = lowercase_name == name; - const bool camel_eq_name = camelcase_name == name; - const bool json_eq_name = json_name == name; - const bool json_eq_camel = json_name == camelcase_name; - - const int total_count = 2 + (lower_eq_name ? 0 : 1) + - (camel_eq_name ? 0 : 1) + - (json_eq_name || json_eq_camel ? 0 : 1); - FieldNamesResult result{nullptr, 0, 0, 0}; - // We use std::array to allow handling of the destruction of the strings. - switch (total_count) { - case 2: - result.array = arena_.Create>()->data(); - break; - case 3: - result.array = arena_.Create>()->data(); - break; - case 4: - result.array = arena_.Create>()->data(); - break; - case 5: - result.array = arena_.Create>()->data(); - break; - } - - result.array[0] = name; - if (scope.empty()) { - result.array[1] = name; - } else { - result.array[1] = StrCat(scope, ".", name); - } - int index = 2; - if (lower_eq_name) { - result.lowercase_index = 0; - } else { - result.lowercase_index = index; - result.array[index++] = std::move(lowercase_name); - } - - if (camel_eq_name) { - result.camelcase_index = 0; - } else { - result.camelcase_index = index; - result.array[index++] = std::move(camelcase_name); - } - - if (json_eq_name) { - result.json_index = 0; - } else if (json_eq_camel) { - result.json_index = result.camelcase_index; - } else { - result.json_index = index; - result.array[index] = std::move(json_name); - } - - return result; -} - -template -Type* DescriptorPool::Tables::Create() { - return arena_.Create(); -} - -template -Type* DescriptorPool::Tables::AllocateMessage(Type* /* dummy */) { - return arena_.Create(); -} - -FileDescriptorTables* DescriptorPool::Tables::AllocateFileTables() { - return arena_.Create(); -} - -void* DescriptorPool::Tables::AllocateBytes(int size) { - if (size == 0) return nullptr; - return arena_.AllocateMemory(size); -} - -void FileDescriptorTables::BuildLocationsByPath( - std::pair* p) { - for (int i = 0, len = p->second->location_size(); i < len; ++i) { - const SourceCodeInfo_Location* loc = &p->second->location().Get(i); - p->first->locations_by_path_[Join(loc->path(), ",")] = loc; - } -} - -const SourceCodeInfo_Location* FileDescriptorTables::GetSourceLocation( - const std::vector& path, const SourceCodeInfo* info) const { - std::pair p( - std::make_pair(this, info)); - internal::call_once(locations_by_path_once_, - FileDescriptorTables::BuildLocationsByPath, &p); - return FindPtrOrNull(locations_by_path_, Join(path, ",")); -} - -// =================================================================== -// DescriptorPool - -DescriptorPool::ErrorCollector::~ErrorCollector() {} - -DescriptorPool::DescriptorPool() - : mutex_(nullptr), - fallback_database_(nullptr), - default_error_collector_(nullptr), - underlay_(nullptr), - tables_(new Tables), - enforce_dependencies_(true), - lazily_build_dependencies_(false), - allow_unknown_(false), - enforce_weak_(false), - disallow_enforce_utf8_(false) {} - -DescriptorPool::DescriptorPool(DescriptorDatabase* fallback_database, - ErrorCollector* error_collector) - : mutex_(new internal::WrappedMutex), - fallback_database_(fallback_database), - default_error_collector_(error_collector), - underlay_(nullptr), - tables_(new Tables), - enforce_dependencies_(true), - lazily_build_dependencies_(false), - allow_unknown_(false), - enforce_weak_(false), - disallow_enforce_utf8_(false) {} - -DescriptorPool::DescriptorPool(const DescriptorPool* underlay) - : mutex_(nullptr), - fallback_database_(nullptr), - default_error_collector_(nullptr), - underlay_(underlay), - tables_(new Tables), - enforce_dependencies_(true), - lazily_build_dependencies_(false), - allow_unknown_(false), - enforce_weak_(false), - disallow_enforce_utf8_(false) {} - -DescriptorPool::~DescriptorPool() { - if (mutex_ != nullptr) delete mutex_; -} - -// DescriptorPool::BuildFile() defined later. -// DescriptorPool::BuildFileCollectingErrors() defined later. - -void DescriptorPool::InternalDontEnforceDependencies() { - enforce_dependencies_ = false; -} - -void DescriptorPool::AddUnusedImportTrackFile(ConstStringParam file_name, - bool is_error) { - unused_import_track_files_[std::string(file_name)] = is_error; -} - -void DescriptorPool::ClearUnusedImportTrackFiles() { - unused_import_track_files_.clear(); -} - -bool DescriptorPool::InternalIsFileLoaded(ConstStringParam filename) const { - MutexLockMaybe lock(mutex_); - return tables_->FindFile(filename) != nullptr; -} - -// generated_pool ==================================================== - -namespace { - - -EncodedDescriptorDatabase* GeneratedDatabase() { - static auto generated_database = - internal::OnShutdownDelete(new EncodedDescriptorDatabase()); - return generated_database; -} - -DescriptorPool* NewGeneratedPool() { - auto generated_pool = new DescriptorPool(GeneratedDatabase()); - generated_pool->InternalSetLazilyBuildDependencies(); - return generated_pool; -} - -} // anonymous namespace - -DescriptorDatabase* DescriptorPool::internal_generated_database() { - return GeneratedDatabase(); -} - -DescriptorPool* DescriptorPool::internal_generated_pool() { - static DescriptorPool* generated_pool = - internal::OnShutdownDelete(NewGeneratedPool()); - return generated_pool; -} - -const DescriptorPool* DescriptorPool::generated_pool() { - const DescriptorPool* pool = internal_generated_pool(); - // Ensure that descriptor.proto has been registered in the generated pool. - DescriptorProto::descriptor(); - return pool; -} - - -void DescriptorPool::InternalAddGeneratedFile( - const void* encoded_file_descriptor, int size) { - // So, this function is called in the process of initializing the - // descriptors for generated proto classes. Each generated .pb.cc file - // has an internal procedure called AddDescriptors() which is called at - // process startup, and that function calls this one in order to register - // the raw bytes of the FileDescriptorProto representing the file. - // - // We do not actually construct the descriptor objects right away. We just - // hang on to the bytes until they are actually needed. We actually construct - // the descriptor the first time one of the following things happens: - // * Someone calls a method like descriptor(), GetDescriptor(), or - // GetReflection() on the generated types, which requires returning the - // descriptor or an object based on it. - // * Someone looks up the descriptor in DescriptorPool::generated_pool(). - // - // Once one of these happens, the DescriptorPool actually parses the - // FileDescriptorProto and generates a FileDescriptor (and all its children) - // based on it. - // - // Note that FileDescriptorProto is itself a generated protocol message. - // Therefore, when we parse one, we have to be very careful to avoid using - // any descriptor-based operations, since this might cause infinite recursion - // or deadlock. - GOOGLE_CHECK(GeneratedDatabase()->Add(encoded_file_descriptor, size)); -} - - -// Find*By* methods ================================================== - -// TODO(kenton): There's a lot of repeated code here, but I'm not sure if -// there's any good way to factor it out. Think about this some time when -// there's nothing more important to do (read: never). - -const FileDescriptor* DescriptorPool::FindFileByName( - ConstStringParam name) const { - MutexLockMaybe lock(mutex_); - if (fallback_database_ != nullptr) { - tables_->known_bad_symbols_.clear(); - tables_->known_bad_files_.clear(); - } - const FileDescriptor* result = tables_->FindFile(name); - if (result != nullptr) return result; - if (underlay_ != nullptr) { - result = underlay_->FindFileByName(name); - if (result != nullptr) return result; - } - if (TryFindFileInFallbackDatabase(name)) { - result = tables_->FindFile(name); - if (result != nullptr) return result; - } - return nullptr; -} - -const FileDescriptor* DescriptorPool::FindFileContainingSymbol( - ConstStringParam symbol_name) const { - MutexLockMaybe lock(mutex_); - if (fallback_database_ != nullptr) { - tables_->known_bad_symbols_.clear(); - tables_->known_bad_files_.clear(); - } - Symbol result = tables_->FindSymbol(symbol_name); - if (!result.IsNull()) return result.GetFile(); - if (underlay_ != nullptr) { - const FileDescriptor* file_result = - underlay_->FindFileContainingSymbol(symbol_name); - if (file_result != nullptr) return file_result; - } - if (TryFindSymbolInFallbackDatabase(symbol_name)) { - result = tables_->FindSymbol(symbol_name); - if (!result.IsNull()) return result.GetFile(); - } - return nullptr; -} - -const Descriptor* DescriptorPool::FindMessageTypeByName( - ConstStringParam name) const { - return tables_->FindByNameHelper(this, name).descriptor(); -} - -const FieldDescriptor* DescriptorPool::FindFieldByName( - ConstStringParam name) const { - if (const FieldDescriptor* field = - tables_->FindByNameHelper(this, name).field_descriptor()) { - if (!field->is_extension()) { - return field; - } - } - return nullptr; -} - -const FieldDescriptor* DescriptorPool::FindExtensionByName( - ConstStringParam name) const { - if (const FieldDescriptor* field = - tables_->FindByNameHelper(this, name).field_descriptor()) { - if (field->is_extension()) { - return field; - } - } - return nullptr; -} - -const OneofDescriptor* DescriptorPool::FindOneofByName( - ConstStringParam name) const { - return tables_->FindByNameHelper(this, name).oneof_descriptor(); -} - -const EnumDescriptor* DescriptorPool::FindEnumTypeByName( - ConstStringParam name) const { - return tables_->FindByNameHelper(this, name).enum_descriptor(); -} - -const EnumValueDescriptor* DescriptorPool::FindEnumValueByName( - ConstStringParam name) const { - return tables_->FindByNameHelper(this, name).enum_value_descriptor(); -} - -const ServiceDescriptor* DescriptorPool::FindServiceByName( - ConstStringParam name) const { - return tables_->FindByNameHelper(this, name).service_descriptor(); -} - -const MethodDescriptor* DescriptorPool::FindMethodByName( - ConstStringParam name) const { - return tables_->FindByNameHelper(this, name).method_descriptor(); -} - -const FieldDescriptor* DescriptorPool::FindExtensionByNumber( - const Descriptor* extendee, int number) const { - if (extendee->extension_range_count() == 0) return nullptr; - // A faster path to reduce lock contention in finding extensions, assuming - // most extensions will be cache hit. - if (mutex_ != nullptr) { - ReaderMutexLock lock(mutex_); - const FieldDescriptor* result = tables_->FindExtension(extendee, number); - if (result != nullptr) { - return result; - } - } - MutexLockMaybe lock(mutex_); - if (fallback_database_ != nullptr) { - tables_->known_bad_symbols_.clear(); - tables_->known_bad_files_.clear(); - } - const FieldDescriptor* result = tables_->FindExtension(extendee, number); - if (result != nullptr) { - return result; - } - if (underlay_ != nullptr) { - result = underlay_->FindExtensionByNumber(extendee, number); - if (result != nullptr) return result; - } - if (TryFindExtensionInFallbackDatabase(extendee, number)) { - result = tables_->FindExtension(extendee, number); - if (result != nullptr) { - return result; - } - } - return nullptr; -} - -const FieldDescriptor* DescriptorPool::InternalFindExtensionByNumberNoLock( - const Descriptor* extendee, int number) const { - if (extendee->extension_range_count() == 0) return nullptr; - - const FieldDescriptor* result = tables_->FindExtension(extendee, number); - if (result != nullptr) { - return result; - } - - if (underlay_ != nullptr) { - result = underlay_->InternalFindExtensionByNumberNoLock(extendee, number); - if (result != nullptr) return result; - } - - return nullptr; -} - -const FieldDescriptor* DescriptorPool::FindExtensionByPrintableName( - const Descriptor* extendee, ConstStringParam printable_name) const { - if (extendee->extension_range_count() == 0) return nullptr; - const FieldDescriptor* result = FindExtensionByName(printable_name); - if (result != nullptr && result->containing_type() == extendee) { - return result; - } - if (extendee->options().message_set_wire_format()) { - // MessageSet extensions may be identified by type name. - const Descriptor* type = FindMessageTypeByName(printable_name); - if (type != nullptr) { - // Look for a matching extension in the foreign type's scope. - const int type_extension_count = type->extension_count(); - for (int i = 0; i < type_extension_count; i++) { - const FieldDescriptor* extension = type->extension(i); - if (extension->containing_type() == extendee && - extension->type() == FieldDescriptor::TYPE_MESSAGE && - extension->is_optional() && extension->message_type() == type) { - // Found it. - return extension; - } - } - } - } - return nullptr; -} - -void DescriptorPool::FindAllExtensions( - const Descriptor* extendee, - std::vector* out) const { - MutexLockMaybe lock(mutex_); - if (fallback_database_ != nullptr) { - tables_->known_bad_symbols_.clear(); - tables_->known_bad_files_.clear(); - } - - // Initialize tables_->extensions_ from the fallback database first - // (but do this only once per descriptor). - if (fallback_database_ != nullptr && - tables_->extensions_loaded_from_db_.count(extendee) == 0) { - std::vector numbers; - if (fallback_database_->FindAllExtensionNumbers(extendee->full_name(), - &numbers)) { - for (int number : numbers) { - if (tables_->FindExtension(extendee, number) == nullptr) { - TryFindExtensionInFallbackDatabase(extendee, number); - } - } - tables_->extensions_loaded_from_db_.insert(extendee); - } - } - - tables_->FindAllExtensions(extendee, out); - if (underlay_ != nullptr) { - underlay_->FindAllExtensions(extendee, out); - } -} - - -// ------------------------------------------------------------------- - -const FieldDescriptor* Descriptor::FindFieldByNumber(int key) const { - const FieldDescriptor* result = file()->tables_->FindFieldByNumber(this, key); - if (result == nullptr || result->is_extension()) { - return nullptr; - } else { - return result; - } -} - -const FieldDescriptor* Descriptor::FindFieldByLowercaseName( - ConstStringParam key) const { - const FieldDescriptor* result = - file()->tables_->FindFieldByLowercaseName(this, key); - if (result == nullptr || result->is_extension()) { - return nullptr; - } else { - return result; - } -} - -const FieldDescriptor* Descriptor::FindFieldByCamelcaseName( - ConstStringParam key) const { - const FieldDescriptor* result = - file()->tables_->FindFieldByCamelcaseName(this, key); - if (result == nullptr || result->is_extension()) { - return nullptr; - } else { - return result; - } -} - -const FieldDescriptor* Descriptor::FindFieldByName(ConstStringParam key) const { - const FieldDescriptor* field = - file()->tables_->FindNestedSymbol(this, key).field_descriptor(); - return field != nullptr && !field->is_extension() ? field : nullptr; -} - -const OneofDescriptor* Descriptor::FindOneofByName(ConstStringParam key) const { - return file()->tables_->FindNestedSymbol(this, key).oneof_descriptor(); -} - -const FieldDescriptor* Descriptor::FindExtensionByName( - ConstStringParam key) const { - const FieldDescriptor* field = - file()->tables_->FindNestedSymbol(this, key).field_descriptor(); - return field != nullptr && field->is_extension() ? field : nullptr; -} - -const FieldDescriptor* Descriptor::FindExtensionByLowercaseName( - ConstStringParam key) const { - const FieldDescriptor* result = - file()->tables_->FindFieldByLowercaseName(this, key); - if (result == nullptr || !result->is_extension()) { - return nullptr; - } else { - return result; - } -} - -const FieldDescriptor* Descriptor::FindExtensionByCamelcaseName( - ConstStringParam key) const { - const FieldDescriptor* result = - file()->tables_->FindFieldByCamelcaseName(this, key); - if (result == nullptr || !result->is_extension()) { - return nullptr; - } else { - return result; - } -} - -const Descriptor* Descriptor::FindNestedTypeByName(ConstStringParam key) const { - return file()->tables_->FindNestedSymbol(this, key).descriptor(); -} - -const EnumDescriptor* Descriptor::FindEnumTypeByName( - ConstStringParam key) const { - return file()->tables_->FindNestedSymbol(this, key).enum_descriptor(); -} - -const EnumValueDescriptor* Descriptor::FindEnumValueByName( - ConstStringParam key) const { - return file()->tables_->FindNestedSymbol(this, key).enum_value_descriptor(); -} - -const FieldDescriptor* Descriptor::map_key() const { - if (!options().map_entry()) return nullptr; - GOOGLE_DCHECK_EQ(field_count(), 2); - return field(0); -} - -const FieldDescriptor* Descriptor::map_value() const { - if (!options().map_entry()) return nullptr; - GOOGLE_DCHECK_EQ(field_count(), 2); - return field(1); -} - -const EnumValueDescriptor* EnumDescriptor::FindValueByName( - ConstStringParam key) const { - return file()->tables_->FindNestedSymbol(this, key).enum_value_descriptor(); -} - -const EnumValueDescriptor* EnumDescriptor::FindValueByNumber(int key) const { - return file()->tables_->FindEnumValueByNumber(this, key); -} - -const EnumValueDescriptor* EnumDescriptor::FindValueByNumberCreatingIfUnknown( - int key) const { - return file()->tables_->FindEnumValueByNumberCreatingIfUnknown(this, key); -} - -const MethodDescriptor* ServiceDescriptor::FindMethodByName( - ConstStringParam key) const { - return file()->tables_->FindNestedSymbol(this, key).method_descriptor(); -} - -const Descriptor* FileDescriptor::FindMessageTypeByName( - ConstStringParam key) const { - return tables_->FindNestedSymbol(this, key).descriptor(); -} - -const EnumDescriptor* FileDescriptor::FindEnumTypeByName( - ConstStringParam key) const { - return tables_->FindNestedSymbol(this, key).enum_descriptor(); -} - -const EnumValueDescriptor* FileDescriptor::FindEnumValueByName( - ConstStringParam key) const { - return tables_->FindNestedSymbol(this, key).enum_value_descriptor(); -} - -const ServiceDescriptor* FileDescriptor::FindServiceByName( - ConstStringParam key) const { - return tables_->FindNestedSymbol(this, key).service_descriptor(); -} - -const FieldDescriptor* FileDescriptor::FindExtensionByName( - ConstStringParam key) const { - const FieldDescriptor* field = - tables_->FindNestedSymbol(this, key).field_descriptor(); - return field != nullptr && field->is_extension() ? field : nullptr; -} - -const FieldDescriptor* FileDescriptor::FindExtensionByLowercaseName( - ConstStringParam key) const { - const FieldDescriptor* result = tables_->FindFieldByLowercaseName(this, key); - if (result == nullptr || !result->is_extension()) { - return nullptr; - } else { - return result; - } -} - -const FieldDescriptor* FileDescriptor::FindExtensionByCamelcaseName( - ConstStringParam key) const { - const FieldDescriptor* result = tables_->FindFieldByCamelcaseName(this, key); - if (result == nullptr || !result->is_extension()) { - return nullptr; - } else { - return result; - } -} - -void Descriptor::ExtensionRange::CopyTo( - DescriptorProto_ExtensionRange* proto) const { - proto->set_start(this->start); - proto->set_end(this->end); - if (options_ != &ExtensionRangeOptions::default_instance()) { - *proto->mutable_options() = *options_; - } -} - -const Descriptor::ExtensionRange* -Descriptor::FindExtensionRangeContainingNumber(int number) const { - // Linear search should be fine because we don't expect a message to have - // more than a couple extension ranges. - for (int i = 0; i < extension_range_count(); i++) { - if (number >= extension_range(i)->start && - number < extension_range(i)->end) { - return extension_range(i); - } - } - return nullptr; -} - -const Descriptor::ReservedRange* Descriptor::FindReservedRangeContainingNumber( - int number) const { - // TODO(chrisn): Consider a non-linear search. - for (int i = 0; i < reserved_range_count(); i++) { - if (number >= reserved_range(i)->start && number < reserved_range(i)->end) { - return reserved_range(i); - } - } - return nullptr; -} - -const EnumDescriptor::ReservedRange* -EnumDescriptor::FindReservedRangeContainingNumber(int number) const { - // TODO(chrisn): Consider a non-linear search. - for (int i = 0; i < reserved_range_count(); i++) { - if (number >= reserved_range(i)->start && - number <= reserved_range(i)->end) { - return reserved_range(i); - } - } - return nullptr; -} - -// ------------------------------------------------------------------- - -bool DescriptorPool::TryFindFileInFallbackDatabase( - StringPiece name) const { - if (fallback_database_ == nullptr) return false; - - auto name_string = std::string(name); - if (tables_->known_bad_files_.count(name_string) > 0) return false; - - FileDescriptorProto file_proto; - if (!fallback_database_->FindFileByName(name_string, &file_proto) || - BuildFileFromDatabase(file_proto) == nullptr) { - tables_->known_bad_files_.insert(std::move(name_string)); - return false; - } - return true; -} - -bool DescriptorPool::IsSubSymbolOfBuiltType(StringPiece name) const { - auto prefix = std::string(name); - for (;;) { - std::string::size_type dot_pos = prefix.find_last_of('.'); - if (dot_pos == std::string::npos) { - break; - } - prefix = prefix.substr(0, dot_pos); - Symbol symbol = tables_->FindSymbol(prefix); - // If the symbol type is anything other than PACKAGE, then its complete - // definition is already known. - if (!symbol.IsNull() && symbol.type() != Symbol::PACKAGE) { - return true; - } - } - if (underlay_ != nullptr) { - // Check to see if any prefix of this symbol exists in the underlay. - return underlay_->IsSubSymbolOfBuiltType(name); - } - return false; -} - -bool DescriptorPool::TryFindSymbolInFallbackDatabase( - StringPiece name) const { - if (fallback_database_ == nullptr) return false; - - auto name_string = std::string(name); - if (tables_->known_bad_symbols_.count(name_string) > 0) return false; - - FileDescriptorProto file_proto; - if ( // We skip looking in the fallback database if the name is a sub-symbol - // of any descriptor that already exists in the descriptor pool (except - // for package descriptors). This is valid because all symbols except - // for packages are defined in a single file, so if the symbol exists - // then we should already have its definition. - // - // The other reason to do this is to support "overriding" type - // definitions by merging two databases that define the same type. (Yes, - // people do this.) The main difficulty with making this work is that - // FindFileContainingSymbol() is allowed to return both false positives - // (e.g., SimpleDescriptorDatabase, UpgradedDescriptorDatabase) and - // false negatives (e.g. ProtoFileParser, SourceTreeDescriptorDatabase). - // When two such databases are merged, looking up a non-existent - // sub-symbol of a type that already exists in the descriptor pool can - // result in an attempt to load multiple definitions of the same type. - // The check below avoids this. - IsSubSymbolOfBuiltType(name) - - // Look up file containing this symbol in fallback database. - || !fallback_database_->FindFileContainingSymbol(name_string, &file_proto) - - // Check if we've already built this file. If so, it apparently doesn't - // contain the symbol we're looking for. Some DescriptorDatabases - // return false positives. - || tables_->FindFile(file_proto.name()) != nullptr - - // Build the file. - || BuildFileFromDatabase(file_proto) == nullptr) { - tables_->known_bad_symbols_.insert(std::move(name_string)); - return false; - } - - return true; -} - -bool DescriptorPool::TryFindExtensionInFallbackDatabase( - const Descriptor* containing_type, int field_number) const { - if (fallback_database_ == nullptr) return false; - - FileDescriptorProto file_proto; - if (!fallback_database_->FindFileContainingExtension( - containing_type->full_name(), field_number, &file_proto)) { - return false; - } - - if (tables_->FindFile(file_proto.name()) != nullptr) { - // We've already loaded this file, and it apparently doesn't contain the - // extension we're looking for. Some DescriptorDatabases return false - // positives. - return false; - } - - if (BuildFileFromDatabase(file_proto) == nullptr) { - return false; - } - - return true; -} - -// =================================================================== - -bool FieldDescriptor::is_map_message_type() const { - return type_descriptor_.message_type->options().map_entry(); -} - -std::string FieldDescriptor::DefaultValueAsString( - bool quote_string_type) const { - GOOGLE_CHECK(has_default_value()) << "No default value"; - switch (cpp_type()) { - case CPPTYPE_INT32: - return StrCat(default_value_int32_t()); - case CPPTYPE_INT64: - return StrCat(default_value_int64_t()); - case CPPTYPE_UINT32: - return StrCat(default_value_uint32_t()); - case CPPTYPE_UINT64: - return StrCat(default_value_uint64_t()); - case CPPTYPE_FLOAT: - return SimpleFtoa(default_value_float()); - case CPPTYPE_DOUBLE: - return SimpleDtoa(default_value_double()); - case CPPTYPE_BOOL: - return default_value_bool() ? "true" : "false"; - case CPPTYPE_STRING: - if (quote_string_type) { - return "\"" + CEscape(default_value_string()) + "\""; - } else { - if (type() == TYPE_BYTES) { - return CEscape(default_value_string()); - } else { - return default_value_string(); - } - } - case CPPTYPE_ENUM: - return default_value_enum()->name(); - case CPPTYPE_MESSAGE: - GOOGLE_LOG(DFATAL) << "Messages can't have default values!"; - break; - } - GOOGLE_LOG(FATAL) << "Can't get here: failed to get default value as string"; - return ""; -} - -// CopyTo methods ==================================================== - -void FileDescriptor::CopyTo(FileDescriptorProto* proto) const { - proto->set_name(name()); - if (!package().empty()) proto->set_package(package()); - // TODO(liujisi): Also populate when syntax="proto2". - if (syntax() == SYNTAX_PROTO3) proto->set_syntax(SyntaxName(syntax())); - - for (int i = 0; i < dependency_count(); i++) { - proto->add_dependency(dependency(i)->name()); - } - - for (int i = 0; i < public_dependency_count(); i++) { - proto->add_public_dependency(public_dependencies_[i]); - } - - for (int i = 0; i < weak_dependency_count(); i++) { - proto->add_weak_dependency(weak_dependencies_[i]); - } - - for (int i = 0; i < message_type_count(); i++) { - message_type(i)->CopyTo(proto->add_message_type()); - } - for (int i = 0; i < enum_type_count(); i++) { - enum_type(i)->CopyTo(proto->add_enum_type()); - } - for (int i = 0; i < service_count(); i++) { - service(i)->CopyTo(proto->add_service()); - } - for (int i = 0; i < extension_count(); i++) { - extension(i)->CopyTo(proto->add_extension()); - } - - if (&options() != &FileOptions::default_instance()) { - proto->mutable_options()->CopyFrom(options()); - } -} - -void FileDescriptor::CopyJsonNameTo(FileDescriptorProto* proto) const { - if (message_type_count() != proto->message_type_size() || - extension_count() != proto->extension_size()) { - GOOGLE_LOG(ERROR) << "Cannot copy json_name to a proto of a different size."; - return; - } - for (int i = 0; i < message_type_count(); i++) { - message_type(i)->CopyJsonNameTo(proto->mutable_message_type(i)); - } - for (int i = 0; i < extension_count(); i++) { - extension(i)->CopyJsonNameTo(proto->mutable_extension(i)); - } -} - -void FileDescriptor::CopySourceCodeInfoTo(FileDescriptorProto* proto) const { - if (source_code_info_ && - source_code_info_ != &SourceCodeInfo::default_instance()) { - proto->mutable_source_code_info()->CopyFrom(*source_code_info_); - } -} - -void Descriptor::CopyTo(DescriptorProto* proto) const { - proto->set_name(name()); - - for (int i = 0; i < field_count(); i++) { - field(i)->CopyTo(proto->add_field()); - } - for (int i = 0; i < oneof_decl_count(); i++) { - oneof_decl(i)->CopyTo(proto->add_oneof_decl()); - } - for (int i = 0; i < nested_type_count(); i++) { - nested_type(i)->CopyTo(proto->add_nested_type()); - } - for (int i = 0; i < enum_type_count(); i++) { - enum_type(i)->CopyTo(proto->add_enum_type()); - } - for (int i = 0; i < extension_range_count(); i++) { - extension_range(i)->CopyTo(proto->add_extension_range()); - } - for (int i = 0; i < extension_count(); i++) { - extension(i)->CopyTo(proto->add_extension()); - } - for (int i = 0; i < reserved_range_count(); i++) { - DescriptorProto::ReservedRange* range = proto->add_reserved_range(); - range->set_start(reserved_range(i)->start); - range->set_end(reserved_range(i)->end); - } - for (int i = 0; i < reserved_name_count(); i++) { - proto->add_reserved_name(reserved_name(i)); - } - - if (&options() != &MessageOptions::default_instance()) { - proto->mutable_options()->CopyFrom(options()); - } -} - -void Descriptor::CopyJsonNameTo(DescriptorProto* proto) const { - if (field_count() != proto->field_size() || - nested_type_count() != proto->nested_type_size() || - extension_count() != proto->extension_size()) { - GOOGLE_LOG(ERROR) << "Cannot copy json_name to a proto of a different size."; - return; - } - for (int i = 0; i < field_count(); i++) { - field(i)->CopyJsonNameTo(proto->mutable_field(i)); - } - for (int i = 0; i < nested_type_count(); i++) { - nested_type(i)->CopyJsonNameTo(proto->mutable_nested_type(i)); - } - for (int i = 0; i < extension_count(); i++) { - extension(i)->CopyJsonNameTo(proto->mutable_extension(i)); - } -} - -void FieldDescriptor::CopyTo(FieldDescriptorProto* proto) const { - proto->set_name(name()); - proto->set_number(number()); - if (has_json_name_) { - proto->set_json_name(json_name()); - } - if (proto3_optional_) { - proto->set_proto3_optional(true); - } - // Some compilers do not allow static_cast directly between two enum types, - // so we must cast to int first. - proto->set_label(static_cast( - implicit_cast(label()))); - proto->set_type(static_cast( - implicit_cast(type()))); - - if (is_extension()) { - if (!containing_type()->is_unqualified_placeholder_) { - proto->set_extendee("."); - } - proto->mutable_extendee()->append(containing_type()->full_name()); - } - - if (cpp_type() == CPPTYPE_MESSAGE) { - if (message_type()->is_placeholder_) { - // We don't actually know if the type is a message type. It could be - // an enum. - proto->clear_type(); - } - - if (!message_type()->is_unqualified_placeholder_) { - proto->set_type_name("."); - } - proto->mutable_type_name()->append(message_type()->full_name()); - } else if (cpp_type() == CPPTYPE_ENUM) { - if (!enum_type()->is_unqualified_placeholder_) { - proto->set_type_name("."); - } - proto->mutable_type_name()->append(enum_type()->full_name()); - } - - if (has_default_value()) { - proto->set_default_value(DefaultValueAsString(false)); - } - - if (containing_oneof() != nullptr && !is_extension()) { - proto->set_oneof_index(containing_oneof()->index()); - } - - if (&options() != &FieldOptions::default_instance()) { - proto->mutable_options()->CopyFrom(options()); - } -} - -void FieldDescriptor::CopyJsonNameTo(FieldDescriptorProto* proto) const { - proto->set_json_name(json_name()); -} - -void OneofDescriptor::CopyTo(OneofDescriptorProto* proto) const { - proto->set_name(name()); - if (&options() != &OneofOptions::default_instance()) { - proto->mutable_options()->CopyFrom(options()); - } -} - -void EnumDescriptor::CopyTo(EnumDescriptorProto* proto) const { - proto->set_name(name()); - - for (int i = 0; i < value_count(); i++) { - value(i)->CopyTo(proto->add_value()); - } - for (int i = 0; i < reserved_range_count(); i++) { - EnumDescriptorProto::EnumReservedRange* range = proto->add_reserved_range(); - range->set_start(reserved_range(i)->start); - range->set_end(reserved_range(i)->end); - } - for (int i = 0; i < reserved_name_count(); i++) { - proto->add_reserved_name(reserved_name(i)); - } - - if (&options() != &EnumOptions::default_instance()) { - proto->mutable_options()->CopyFrom(options()); - } -} - -void EnumValueDescriptor::CopyTo(EnumValueDescriptorProto* proto) const { - proto->set_name(name()); - proto->set_number(number()); - - if (&options() != &EnumValueOptions::default_instance()) { - proto->mutable_options()->CopyFrom(options()); - } -} - -void ServiceDescriptor::CopyTo(ServiceDescriptorProto* proto) const { - proto->set_name(name()); - - for (int i = 0; i < method_count(); i++) { - method(i)->CopyTo(proto->add_method()); - } - - if (&options() != &ServiceOptions::default_instance()) { - proto->mutable_options()->CopyFrom(options()); - } -} - -void MethodDescriptor::CopyTo(MethodDescriptorProto* proto) const { - proto->set_name(name()); - - if (!input_type()->is_unqualified_placeholder_) { - proto->set_input_type("."); - } - proto->mutable_input_type()->append(input_type()->full_name()); - - if (!output_type()->is_unqualified_placeholder_) { - proto->set_output_type("."); - } - proto->mutable_output_type()->append(output_type()->full_name()); - - if (&options() != &MethodOptions::default_instance()) { - proto->mutable_options()->CopyFrom(options()); - } - - if (client_streaming_) { - proto->set_client_streaming(true); - } - if (server_streaming_) { - proto->set_server_streaming(true); - } -} - -// DebugString methods =============================================== - -namespace { - -bool RetrieveOptionsAssumingRightPool( - int depth, const Message& options, - std::vector* option_entries) { - option_entries->clear(); - const Reflection* reflection = options.GetReflection(); - std::vector fields; - reflection->ListFields(options, &fields); - for (const FieldDescriptor* field : fields) { - int count = 1; - bool repeated = false; - if (field->is_repeated()) { - count = reflection->FieldSize(options, field); - repeated = true; - } - for (int j = 0; j < count; j++) { - std::string fieldval; - if (field->cpp_type() == FieldDescriptor::CPPTYPE_MESSAGE) { - std::string tmp; - TextFormat::Printer printer; - printer.SetExpandAny(true); - printer.SetInitialIndentLevel(depth + 1); - printer.PrintFieldValueToString(options, field, repeated ? j : -1, - &tmp); - fieldval.append("{\n"); - fieldval.append(tmp); - fieldval.append(depth * 2, ' '); - fieldval.append("}"); - } else { - TextFormat::PrintFieldValueToString(options, field, repeated ? j : -1, - &fieldval); - } - std::string name; - if (field->is_extension()) { - name = "(." + field->full_name() + ")"; - } else { - name = field->name(); - } - option_entries->push_back(name + " = " + fieldval); - } - } - return !option_entries->empty(); -} - -// Used by each of the option formatters. -bool RetrieveOptions(int depth, const Message& options, - const DescriptorPool* pool, - std::vector* option_entries) { - // When printing custom options for a descriptor, we must use an options - // message built on top of the same DescriptorPool where the descriptor - // is coming from. This is to ensure we are interpreting custom options - // against the right pool. - if (options.GetDescriptor()->file()->pool() == pool) { - return RetrieveOptionsAssumingRightPool(depth, options, option_entries); - } else { - const Descriptor* option_descriptor = - pool->FindMessageTypeByName(options.GetDescriptor()->full_name()); - if (option_descriptor == nullptr) { - // descriptor.proto is not in the pool. This means no custom options are - // used so we are safe to proceed with the compiled options message type. - return RetrieveOptionsAssumingRightPool(depth, options, option_entries); - } - DynamicMessageFactory factory; - std::unique_ptr dynamic_options( - factory.GetPrototype(option_descriptor)->New()); - std::string serialized = options.SerializeAsString(); - io::CodedInputStream input( - reinterpret_cast(serialized.c_str()), - serialized.size()); - input.SetExtensionRegistry(pool, &factory); - if (dynamic_options->ParseFromCodedStream(&input)) { - return RetrieveOptionsAssumingRightPool(depth, *dynamic_options, - option_entries); - } else { - GOOGLE_LOG(ERROR) << "Found invalid proto option data for: " - << options.GetDescriptor()->full_name(); - return RetrieveOptionsAssumingRightPool(depth, options, option_entries); - } - } -} - -// Formats options that all appear together in brackets. Does not include -// brackets. -bool FormatBracketedOptions(int depth, const Message& options, - const DescriptorPool* pool, std::string* output) { - std::vector all_options; - if (RetrieveOptions(depth, options, pool, &all_options)) { - output->append(Join(all_options, ", ")); - } - return !all_options.empty(); -} - -// Formats options one per line -bool FormatLineOptions(int depth, const Message& options, - const DescriptorPool* pool, std::string* output) { - std::string prefix(depth * 2, ' '); - std::vector all_options; - if (RetrieveOptions(depth, options, pool, &all_options)) { - for (const std::string& option : all_options) { - strings::SubstituteAndAppend(output, "$0option $1;\n", prefix, option); - } - } - return !all_options.empty(); -} - -class SourceLocationCommentPrinter { - public: - template - SourceLocationCommentPrinter(const DescType* desc, const std::string& prefix, - const DebugStringOptions& options) - : options_(options), prefix_(prefix) { - // Perform the SourceLocation lookup only if we're including user comments, - // because the lookup is fairly expensive. - have_source_loc_ = - options.include_comments && desc->GetSourceLocation(&source_loc_); - } - SourceLocationCommentPrinter(const FileDescriptor* file, - const std::vector& path, - const std::string& prefix, - const DebugStringOptions& options) - : options_(options), prefix_(prefix) { - // Perform the SourceLocation lookup only if we're including user comments, - // because the lookup is fairly expensive. - have_source_loc_ = - options.include_comments && file->GetSourceLocation(path, &source_loc_); - } - void AddPreComment(std::string* output) { - if (have_source_loc_) { - // Detached leading comments. - for (const std::string& leading_detached_comment : - source_loc_.leading_detached_comments) { - *output += FormatComment(leading_detached_comment); - *output += "\n"; - } - // Attached leading comments. - if (!source_loc_.leading_comments.empty()) { - *output += FormatComment(source_loc_.leading_comments); - } - } - } - void AddPostComment(std::string* output) { - if (have_source_loc_ && source_loc_.trailing_comments.size() > 0) { - *output += FormatComment(source_loc_.trailing_comments); - } - } - - // Format comment such that each line becomes a full-line C++-style comment in - // the DebugString() output. - std::string FormatComment(const std::string& comment_text) { - std::string stripped_comment = comment_text; - StripWhitespace(&stripped_comment); - std::vector lines = Split(stripped_comment, "\n"); - std::string output; - for (const std::string& line : lines) { - strings::SubstituteAndAppend(&output, "$0// $1\n", prefix_, line); - } - return output; - } - - private: - - bool have_source_loc_; - SourceLocation source_loc_; - DebugStringOptions options_; - std::string prefix_; -}; - -} // anonymous namespace - -std::string FileDescriptor::DebugString() const { - DebugStringOptions options; // default options - return DebugStringWithOptions(options); -} - -std::string FileDescriptor::DebugStringWithOptions( - const DebugStringOptions& debug_string_options) const { - std::string contents; - { - std::vector path; - path.push_back(FileDescriptorProto::kSyntaxFieldNumber); - SourceLocationCommentPrinter syntax_comment(this, path, "", - debug_string_options); - syntax_comment.AddPreComment(&contents); - strings::SubstituteAndAppend(&contents, "syntax = \"$0\";\n\n", - SyntaxName(syntax())); - syntax_comment.AddPostComment(&contents); - } - - SourceLocationCommentPrinter comment_printer(this, "", debug_string_options); - comment_printer.AddPreComment(&contents); - - std::set public_dependencies; - std::set weak_dependencies; - public_dependencies.insert(public_dependencies_, - public_dependencies_ + public_dependency_count_); - weak_dependencies.insert(weak_dependencies_, - weak_dependencies_ + weak_dependency_count_); - - for (int i = 0; i < dependency_count(); i++) { - if (public_dependencies.count(i) > 0) { - strings::SubstituteAndAppend(&contents, "import public \"$0\";\n", - dependency(i)->name()); - } else if (weak_dependencies.count(i) > 0) { - strings::SubstituteAndAppend(&contents, "import weak \"$0\";\n", - dependency(i)->name()); - } else { - strings::SubstituteAndAppend(&contents, "import \"$0\";\n", - dependency(i)->name()); - } - } - - if (!package().empty()) { - std::vector path; - path.push_back(FileDescriptorProto::kPackageFieldNumber); - SourceLocationCommentPrinter package_comment(this, path, "", - debug_string_options); - package_comment.AddPreComment(&contents); - strings::SubstituteAndAppend(&contents, "package $0;\n\n", package()); - package_comment.AddPostComment(&contents); - } - - if (FormatLineOptions(0, options(), pool(), &contents)) { - contents.append("\n"); // add some space if we had options - } - - for (int i = 0; i < enum_type_count(); i++) { - enum_type(i)->DebugString(0, &contents, debug_string_options); - contents.append("\n"); - } - - // Find all the 'group' type extensions; we will not output their nested - // definitions (those will be done with their group field descriptor). - std::set groups; - for (int i = 0; i < extension_count(); i++) { - if (extension(i)->type() == FieldDescriptor::TYPE_GROUP) { - groups.insert(extension(i)->message_type()); - } - } - - for (int i = 0; i < message_type_count(); i++) { - if (groups.count(message_type(i)) == 0) { - message_type(i)->DebugString(0, &contents, debug_string_options, - /* include_opening_clause */ true); - contents.append("\n"); - } - } - - for (int i = 0; i < service_count(); i++) { - service(i)->DebugString(&contents, debug_string_options); - contents.append("\n"); - } - - const Descriptor* containing_type = nullptr; - for (int i = 0; i < extension_count(); i++) { - if (extension(i)->containing_type() != containing_type) { - if (i > 0) contents.append("}\n\n"); - containing_type = extension(i)->containing_type(); - strings::SubstituteAndAppend(&contents, "extend .$0 {\n", - containing_type->full_name()); - } - extension(i)->DebugString(1, &contents, debug_string_options); - } - if (extension_count() > 0) contents.append("}\n\n"); - - comment_printer.AddPostComment(&contents); - - return contents; -} - -std::string Descriptor::DebugString() const { - DebugStringOptions options; // default options - return DebugStringWithOptions(options); -} - -std::string Descriptor::DebugStringWithOptions( - const DebugStringOptions& options) const { - std::string contents; - DebugString(0, &contents, options, /* include_opening_clause */ true); - return contents; -} - -void Descriptor::DebugString(int depth, std::string* contents, - const DebugStringOptions& debug_string_options, - bool include_opening_clause) const { - if (options().map_entry()) { - // Do not generate debug string for auto-generated map-entry type. - return; - } - std::string prefix(depth * 2, ' '); - ++depth; - - SourceLocationCommentPrinter comment_printer(this, prefix, - debug_string_options); - comment_printer.AddPreComment(contents); - - if (include_opening_clause) { - strings::SubstituteAndAppend(contents, "$0message $1", prefix, name()); - } - contents->append(" {\n"); - - FormatLineOptions(depth, options(), file()->pool(), contents); - - // Find all the 'group' types for fields and extensions; we will not output - // their nested definitions (those will be done with their group field - // descriptor). - std::set groups; - for (int i = 0; i < field_count(); i++) { - if (field(i)->type() == FieldDescriptor::TYPE_GROUP) { - groups.insert(field(i)->message_type()); - } - } - for (int i = 0; i < extension_count(); i++) { - if (extension(i)->type() == FieldDescriptor::TYPE_GROUP) { - groups.insert(extension(i)->message_type()); - } - } - - for (int i = 0; i < nested_type_count(); i++) { - if (groups.count(nested_type(i)) == 0) { - nested_type(i)->DebugString(depth, contents, debug_string_options, - /* include_opening_clause */ true); - } - } - for (int i = 0; i < enum_type_count(); i++) { - enum_type(i)->DebugString(depth, contents, debug_string_options); - } - for (int i = 0; i < field_count(); i++) { - if (field(i)->real_containing_oneof() == nullptr) { - field(i)->DebugString(depth, contents, debug_string_options); - } else if (field(i)->containing_oneof()->field(0) == field(i)) { - // This is the first field in this oneof, so print the whole oneof. - field(i)->containing_oneof()->DebugString(depth, contents, - debug_string_options); - } - } - - for (int i = 0; i < extension_range_count(); i++) { - strings::SubstituteAndAppend(contents, "$0 extensions $1 to $2;\n", prefix, - extension_range(i)->start, - extension_range(i)->end - 1); - } - - // Group extensions by what they extend, so they can be printed out together. - const Descriptor* containing_type = nullptr; - for (int i = 0; i < extension_count(); i++) { - if (extension(i)->containing_type() != containing_type) { - if (i > 0) strings::SubstituteAndAppend(contents, "$0 }\n", prefix); - containing_type = extension(i)->containing_type(); - strings::SubstituteAndAppend(contents, "$0 extend .$1 {\n", prefix, - containing_type->full_name()); - } - extension(i)->DebugString(depth + 1, contents, debug_string_options); - } - if (extension_count() > 0) - strings::SubstituteAndAppend(contents, "$0 }\n", prefix); - - if (reserved_range_count() > 0) { - strings::SubstituteAndAppend(contents, "$0 reserved ", prefix); - for (int i = 0; i < reserved_range_count(); i++) { - const Descriptor::ReservedRange* range = reserved_range(i); - if (range->end == range->start + 1) { - strings::SubstituteAndAppend(contents, "$0, ", range->start); - } else if (range->end > FieldDescriptor::kMaxNumber) { - strings::SubstituteAndAppend(contents, "$0 to max, ", range->start); - } else { - strings::SubstituteAndAppend(contents, "$0 to $1, ", range->start, - range->end - 1); - } - } - contents->replace(contents->size() - 2, 2, ";\n"); - } - - if (reserved_name_count() > 0) { - strings::SubstituteAndAppend(contents, "$0 reserved ", prefix); - for (int i = 0; i < reserved_name_count(); i++) { - strings::SubstituteAndAppend(contents, "\"$0\", ", - CEscape(reserved_name(i))); - } - contents->replace(contents->size() - 2, 2, ";\n"); - } - - strings::SubstituteAndAppend(contents, "$0}\n", prefix); - comment_printer.AddPostComment(contents); -} - -std::string FieldDescriptor::DebugString() const { - DebugStringOptions options; // default options - return DebugStringWithOptions(options); -} - -std::string FieldDescriptor::DebugStringWithOptions( - const DebugStringOptions& debug_string_options) const { - std::string contents; - int depth = 0; - if (is_extension()) { - strings::SubstituteAndAppend(&contents, "extend .$0 {\n", - containing_type()->full_name()); - depth = 1; - } - DebugString(depth, &contents, debug_string_options); - if (is_extension()) { - contents.append("}\n"); - } - return contents; -} - -// The field type string used in FieldDescriptor::DebugString() -std::string FieldDescriptor::FieldTypeNameDebugString() const { - switch (type()) { - case TYPE_MESSAGE: - return "." + message_type()->full_name(); - case TYPE_ENUM: - return "." + enum_type()->full_name(); - default: - return kTypeToName[type()]; - } -} - -void FieldDescriptor::DebugString( - int depth, std::string* contents, - const DebugStringOptions& debug_string_options) const { - std::string prefix(depth * 2, ' '); - std::string field_type; - - // Special case map fields. - if (is_map()) { - strings::SubstituteAndAppend( - &field_type, "map<$0, $1>", - message_type()->field(0)->FieldTypeNameDebugString(), - message_type()->field(1)->FieldTypeNameDebugString()); - } else { - field_type = FieldTypeNameDebugString(); - } - - std::string label = StrCat(kLabelToName[this->label()], " "); - - // Label is omitted for maps, oneof, and plain proto3 fields. - if (is_map() || real_containing_oneof() || - (is_optional() && !has_optional_keyword())) { - label.clear(); - } - - SourceLocationCommentPrinter comment_printer(this, prefix, - debug_string_options); - comment_printer.AddPreComment(contents); - - strings::SubstituteAndAppend( - contents, "$0$1$2 $3 = $4", prefix, label, field_type, - type() == TYPE_GROUP ? message_type()->name() : name(), number()); - - bool bracketed = false; - if (has_default_value()) { - bracketed = true; - strings::SubstituteAndAppend(contents, " [default = $0", - DefaultValueAsString(true)); - } - if (has_json_name_) { - if (!bracketed) { - bracketed = true; - contents->append(" ["); - } else { - contents->append(", "); - } - contents->append("json_name = \""); - contents->append(CEscape(json_name())); - contents->append("\""); - } - - std::string formatted_options; - if (FormatBracketedOptions(depth, options(), file()->pool(), - &formatted_options)) { - contents->append(bracketed ? ", " : " ["); - bracketed = true; - contents->append(formatted_options); - } - - if (bracketed) { - contents->append("]"); - } - - if (type() == TYPE_GROUP) { - if (debug_string_options.elide_group_body) { - contents->append(" { ... };\n"); - } else { - message_type()->DebugString(depth, contents, debug_string_options, - /* include_opening_clause */ false); - } - } else { - contents->append(";\n"); - } - - comment_printer.AddPostComment(contents); -} - -std::string OneofDescriptor::DebugString() const { - DebugStringOptions options; // default values - return DebugStringWithOptions(options); -} - -std::string OneofDescriptor::DebugStringWithOptions( - const DebugStringOptions& options) const { - std::string contents; - DebugString(0, &contents, options); - return contents; -} - -void OneofDescriptor::DebugString( - int depth, std::string* contents, - const DebugStringOptions& debug_string_options) const { - std::string prefix(depth * 2, ' '); - ++depth; - SourceLocationCommentPrinter comment_printer(this, prefix, - debug_string_options); - comment_printer.AddPreComment(contents); - strings::SubstituteAndAppend(contents, "$0oneof $1 {", prefix, name()); - - FormatLineOptions(depth, options(), containing_type()->file()->pool(), - contents); - - if (debug_string_options.elide_oneof_body) { - contents->append(" ... }\n"); - } else { - contents->append("\n"); - for (int i = 0; i < field_count(); i++) { - field(i)->DebugString(depth, contents, debug_string_options); - } - strings::SubstituteAndAppend(contents, "$0}\n", prefix); - } - comment_printer.AddPostComment(contents); -} - -std::string EnumDescriptor::DebugString() const { - DebugStringOptions options; // default values - return DebugStringWithOptions(options); -} - -std::string EnumDescriptor::DebugStringWithOptions( - const DebugStringOptions& options) const { - std::string contents; - DebugString(0, &contents, options); - return contents; -} - -void EnumDescriptor::DebugString( - int depth, std::string* contents, - const DebugStringOptions& debug_string_options) const { - std::string prefix(depth * 2, ' '); - ++depth; - - SourceLocationCommentPrinter comment_printer(this, prefix, - debug_string_options); - comment_printer.AddPreComment(contents); - - strings::SubstituteAndAppend(contents, "$0enum $1 {\n", prefix, name()); - - FormatLineOptions(depth, options(), file()->pool(), contents); - - for (int i = 0; i < value_count(); i++) { - value(i)->DebugString(depth, contents, debug_string_options); - } - - if (reserved_range_count() > 0) { - strings::SubstituteAndAppend(contents, "$0 reserved ", prefix); - for (int i = 0; i < reserved_range_count(); i++) { - const EnumDescriptor::ReservedRange* range = reserved_range(i); - if (range->end == range->start) { - strings::SubstituteAndAppend(contents, "$0, ", range->start); - } else if (range->end == INT_MAX) { - strings::SubstituteAndAppend(contents, "$0 to max, ", range->start); - } else { - strings::SubstituteAndAppend(contents, "$0 to $1, ", range->start, - range->end); - } - } - contents->replace(contents->size() - 2, 2, ";\n"); - } - - if (reserved_name_count() > 0) { - strings::SubstituteAndAppend(contents, "$0 reserved ", prefix); - for (int i = 0; i < reserved_name_count(); i++) { - strings::SubstituteAndAppend(contents, "\"$0\", ", - CEscape(reserved_name(i))); - } - contents->replace(contents->size() - 2, 2, ";\n"); - } - - strings::SubstituteAndAppend(contents, "$0}\n", prefix); - - comment_printer.AddPostComment(contents); -} - -std::string EnumValueDescriptor::DebugString() const { - DebugStringOptions options; // default values - return DebugStringWithOptions(options); -} - -std::string EnumValueDescriptor::DebugStringWithOptions( - const DebugStringOptions& options) const { - std::string contents; - DebugString(0, &contents, options); - return contents; -} - -void EnumValueDescriptor::DebugString( - int depth, std::string* contents, - const DebugStringOptions& debug_string_options) const { - std::string prefix(depth * 2, ' '); - - SourceLocationCommentPrinter comment_printer(this, prefix, - debug_string_options); - comment_printer.AddPreComment(contents); - - strings::SubstituteAndAppend(contents, "$0$1 = $2", prefix, name(), number()); - - std::string formatted_options; - if (FormatBracketedOptions(depth, options(), type()->file()->pool(), - &formatted_options)) { - strings::SubstituteAndAppend(contents, " [$0]", formatted_options); - } - contents->append(";\n"); - - comment_printer.AddPostComment(contents); -} - -std::string ServiceDescriptor::DebugString() const { - DebugStringOptions options; // default values - return DebugStringWithOptions(options); -} - -std::string ServiceDescriptor::DebugStringWithOptions( - const DebugStringOptions& options) const { - std::string contents; - DebugString(&contents, options); - return contents; -} - -void ServiceDescriptor::DebugString( - std::string* contents, - const DebugStringOptions& debug_string_options) const { - SourceLocationCommentPrinter comment_printer(this, /* prefix */ "", - debug_string_options); - comment_printer.AddPreComment(contents); - - strings::SubstituteAndAppend(contents, "service $0 {\n", name()); - - FormatLineOptions(1, options(), file()->pool(), contents); - - for (int i = 0; i < method_count(); i++) { - method(i)->DebugString(1, contents, debug_string_options); - } - - contents->append("}\n"); - - comment_printer.AddPostComment(contents); -} - -std::string MethodDescriptor::DebugString() const { - DebugStringOptions options; // default values - return DebugStringWithOptions(options); -} - -std::string MethodDescriptor::DebugStringWithOptions( - const DebugStringOptions& options) const { - std::string contents; - DebugString(0, &contents, options); - return contents; -} - -void MethodDescriptor::DebugString( - int depth, std::string* contents, - const DebugStringOptions& debug_string_options) const { - std::string prefix(depth * 2, ' '); - ++depth; - - SourceLocationCommentPrinter comment_printer(this, prefix, - debug_string_options); - comment_printer.AddPreComment(contents); - - strings::SubstituteAndAppend( - contents, "$0rpc $1($4.$2) returns ($5.$3)", prefix, name(), - input_type()->full_name(), output_type()->full_name(), - client_streaming() ? "stream " : "", server_streaming() ? "stream " : ""); - - std::string formatted_options; - if (FormatLineOptions(depth, options(), service()->file()->pool(), - &formatted_options)) { - strings::SubstituteAndAppend(contents, " {\n$0$1}\n", formatted_options, - prefix); - } else { - contents->append(";\n"); - } - - comment_printer.AddPostComment(contents); -} - - -// Location methods =============================================== - -bool FileDescriptor::GetSourceLocation(const std::vector& path, - SourceLocation* out_location) const { - GOOGLE_CHECK(out_location != nullptr); - if (source_code_info_) { - if (const SourceCodeInfo_Location* loc = - tables_->GetSourceLocation(path, source_code_info_)) { - const RepeatedField& span = loc->span(); - if (span.size() == 3 || span.size() == 4) { - out_location->start_line = span.Get(0); - out_location->start_column = span.Get(1); - out_location->end_line = span.Get(span.size() == 3 ? 0 : 2); - out_location->end_column = span.Get(span.size() - 1); - - out_location->leading_comments = loc->leading_comments(); - out_location->trailing_comments = loc->trailing_comments(); - out_location->leading_detached_comments.assign( - loc->leading_detached_comments().begin(), - loc->leading_detached_comments().end()); - return true; - } - } - } - return false; -} - -bool FileDescriptor::GetSourceLocation(SourceLocation* out_location) const { - std::vector path; // empty path for root FileDescriptor - return GetSourceLocation(path, out_location); -} - -bool FieldDescriptor::is_packed() const { - if (!is_packable()) return false; - if (file_->syntax() == FileDescriptor::SYNTAX_PROTO2) { - return (options_ != nullptr) && options_->packed(); - } else { - return options_ == nullptr || !options_->has_packed() || options_->packed(); - } -} - -bool Descriptor::GetSourceLocation(SourceLocation* out_location) const { - std::vector path; - GetLocationPath(&path); - return file()->GetSourceLocation(path, out_location); -} - -bool FieldDescriptor::GetSourceLocation(SourceLocation* out_location) const { - std::vector path; - GetLocationPath(&path); - return file()->GetSourceLocation(path, out_location); -} - -bool OneofDescriptor::GetSourceLocation(SourceLocation* out_location) const { - std::vector path; - GetLocationPath(&path); - return containing_type()->file()->GetSourceLocation(path, out_location); -} - -bool EnumDescriptor::GetSourceLocation(SourceLocation* out_location) const { - std::vector path; - GetLocationPath(&path); - return file()->GetSourceLocation(path, out_location); -} - -bool MethodDescriptor::GetSourceLocation(SourceLocation* out_location) const { - std::vector path; - GetLocationPath(&path); - return service()->file()->GetSourceLocation(path, out_location); -} - -bool ServiceDescriptor::GetSourceLocation(SourceLocation* out_location) const { - std::vector path; - GetLocationPath(&path); - return file()->GetSourceLocation(path, out_location); -} - -bool EnumValueDescriptor::GetSourceLocation( - SourceLocation* out_location) const { - std::vector path; - GetLocationPath(&path); - return type()->file()->GetSourceLocation(path, out_location); -} - -void Descriptor::GetLocationPath(std::vector* output) const { - if (containing_type()) { - containing_type()->GetLocationPath(output); - output->push_back(DescriptorProto::kNestedTypeFieldNumber); - output->push_back(index()); - } else { - output->push_back(FileDescriptorProto::kMessageTypeFieldNumber); - output->push_back(index()); - } -} - -void FieldDescriptor::GetLocationPath(std::vector* output) const { - if (is_extension()) { - if (extension_scope() == nullptr) { - output->push_back(FileDescriptorProto::kExtensionFieldNumber); - output->push_back(index()); - } else { - extension_scope()->GetLocationPath(output); - output->push_back(DescriptorProto::kExtensionFieldNumber); - output->push_back(index()); - } - } else { - containing_type()->GetLocationPath(output); - output->push_back(DescriptorProto::kFieldFieldNumber); - output->push_back(index()); - } -} - -void OneofDescriptor::GetLocationPath(std::vector* output) const { - containing_type()->GetLocationPath(output); - output->push_back(DescriptorProto::kOneofDeclFieldNumber); - output->push_back(index()); -} - -void EnumDescriptor::GetLocationPath(std::vector* output) const { - if (containing_type()) { - containing_type()->GetLocationPath(output); - output->push_back(DescriptorProto::kEnumTypeFieldNumber); - output->push_back(index()); - } else { - output->push_back(FileDescriptorProto::kEnumTypeFieldNumber); - output->push_back(index()); - } -} - -void EnumValueDescriptor::GetLocationPath(std::vector* output) const { - type()->GetLocationPath(output); - output->push_back(EnumDescriptorProto::kValueFieldNumber); - output->push_back(index()); -} - -void ServiceDescriptor::GetLocationPath(std::vector* output) const { - output->push_back(FileDescriptorProto::kServiceFieldNumber); - output->push_back(index()); -} - -void MethodDescriptor::GetLocationPath(std::vector* output) const { - service()->GetLocationPath(output); - output->push_back(ServiceDescriptorProto::kMethodFieldNumber); - output->push_back(index()); -} - -// =================================================================== - -namespace { - -// Represents an options message to interpret. Extension names in the option -// name are resolved relative to name_scope. element_name and orig_opt are -// used only for error reporting (since the parser records locations against -// pointers in the original options, not the mutable copy). The Message must be -// one of the Options messages in descriptor.proto. -struct OptionsToInterpret { - OptionsToInterpret(const std::string& ns, const std::string& el, - const std::vector& path, const Message* orig_opt, - Message* opt) - : name_scope(ns), - element_name(el), - element_path(path), - original_options(orig_opt), - options(opt) {} - std::string name_scope; - std::string element_name; - std::vector element_path; - const Message* original_options; - Message* options; -}; - -} // namespace - -class DescriptorBuilder { - public: - DescriptorBuilder(const DescriptorPool* pool, DescriptorPool::Tables* tables, - DescriptorPool::ErrorCollector* error_collector); - ~DescriptorBuilder(); - - const FileDescriptor* BuildFile(const FileDescriptorProto& proto); - - private: - friend class OptionInterpreter; - - // Non-recursive part of BuildFile functionality. - FileDescriptor* BuildFileImpl(const FileDescriptorProto& proto); - - const DescriptorPool* pool_; - DescriptorPool::Tables* tables_; // for convenience - DescriptorPool::ErrorCollector* error_collector_; - - // As we build descriptors we store copies of the options messages in - // them. We put pointers to those copies in this vector, as we build, so we - // can later (after cross-linking) interpret those options. - std::vector options_to_interpret_; - - bool had_errors_; - std::string filename_; - FileDescriptor* file_; - FileDescriptorTables* file_tables_; - std::set dependencies_; - - // unused_dependency_ is used to record the unused imported files. - // Note: public import is not considered. - std::set unused_dependency_; - - // If LookupSymbol() finds a symbol that is in a file which is not a declared - // dependency of this file, it will fail, but will set - // possible_undeclared_dependency_ to point at that file. This is only used - // by AddNotDefinedError() to report a more useful error message. - // possible_undeclared_dependency_name_ is the name of the symbol that was - // actually found in possible_undeclared_dependency_, which may be a parent - // of the symbol actually looked for. - const FileDescriptor* possible_undeclared_dependency_; - std::string possible_undeclared_dependency_name_; - - // If LookupSymbol() could resolve a symbol which is not defined, - // record the resolved name. This is only used by AddNotDefinedError() - // to report a more useful error message. - std::string undefine_resolved_name_; - - void AddError(const std::string& element_name, const Message& descriptor, - DescriptorPool::ErrorCollector::ErrorLocation location, - const std::string& error); - void AddError(const std::string& element_name, const Message& descriptor, - DescriptorPool::ErrorCollector::ErrorLocation location, - const char* error); - void AddRecursiveImportError(const FileDescriptorProto& proto, int from_here); - void AddTwiceListedError(const FileDescriptorProto& proto, int index); - void AddImportError(const FileDescriptorProto& proto, int index); - - // Adds an error indicating that undefined_symbol was not defined. Must - // only be called after LookupSymbol() fails. - void AddNotDefinedError( - const std::string& element_name, const Message& descriptor, - DescriptorPool::ErrorCollector::ErrorLocation location, - const std::string& undefined_symbol); - - void AddWarning(const std::string& element_name, const Message& descriptor, - DescriptorPool::ErrorCollector::ErrorLocation location, - const std::string& error); - - // Silly helper which determines if the given file is in the given package. - // I.e., either file->package() == package_name or file->package() is a - // nested package within package_name. - bool IsInPackage(const FileDescriptor* file, const std::string& package_name); - - // Helper function which finds all public dependencies of the given file, and - // stores the them in the dependencies_ set in the builder. - void RecordPublicDependencies(const FileDescriptor* file); - - // Like tables_->FindSymbol(), but additionally: - // - Search the pool's underlay if not found in tables_. - // - Insure that the resulting Symbol is from one of the file's declared - // dependencies. - Symbol FindSymbol(const std::string& name, bool build_it = true); - - // Like FindSymbol() but does not require that the symbol is in one of the - // file's declared dependencies. - Symbol FindSymbolNotEnforcingDeps(const std::string& name, - bool build_it = true); - - // This implements the body of FindSymbolNotEnforcingDeps(). - Symbol FindSymbolNotEnforcingDepsHelper(const DescriptorPool* pool, - const std::string& name, - bool build_it = true); - - // Like FindSymbol(), but looks up the name relative to some other symbol - // name. This first searches siblings of relative_to, then siblings of its - // parents, etc. For example, LookupSymbol("foo.bar", "baz.qux.corge") makes - // the following calls, returning the first non-null result: - // FindSymbol("baz.qux.foo.bar"), FindSymbol("baz.foo.bar"), - // FindSymbol("foo.bar"). If AllowUnknownDependencies() has been called - // on the DescriptorPool, this will generate a placeholder type if - // the name is not found (unless the name itself is malformed). The - // placeholder_type parameter indicates what kind of placeholder should be - // constructed in this case. The resolve_mode parameter determines whether - // any symbol is returned, or only symbols that are types. Note, however, - // that LookupSymbol may still return a non-type symbol in LOOKUP_TYPES mode, - // if it believes that's all it could refer to. The caller should always - // check that it receives the type of symbol it was expecting. - enum ResolveMode { LOOKUP_ALL, LOOKUP_TYPES }; - Symbol LookupSymbol(const std::string& name, const std::string& relative_to, - DescriptorPool::PlaceholderType placeholder_type = - DescriptorPool::PLACEHOLDER_MESSAGE, - ResolveMode resolve_mode = LOOKUP_ALL, - bool build_it = true); - - // Like LookupSymbol() but will not return a placeholder even if - // AllowUnknownDependencies() has been used. - Symbol LookupSymbolNoPlaceholder(const std::string& name, - const std::string& relative_to, - ResolveMode resolve_mode = LOOKUP_ALL, - bool build_it = true); - - // Calls tables_->AddSymbol() and records an error if it fails. Returns - // true if successful or false if failed, though most callers can ignore - // the return value since an error has already been recorded. - bool AddSymbol(const std::string& full_name, const void* parent, - const std::string& name, const Message& proto, Symbol symbol); - - // Like AddSymbol(), but succeeds if the symbol is already defined as long - // as the existing definition is also a package (because it's OK to define - // the same package in two different files). Also adds all parents of the - // package to the symbol table (e.g. AddPackage("foo.bar", ...) will add - // "foo.bar" and "foo" to the table). - void AddPackage(const std::string& name, const Message& proto, - FileDescriptor* file); - - // Checks that the symbol name contains only alphanumeric characters and - // underscores. Records an error otherwise. - void ValidateSymbolName(const std::string& name, const std::string& full_name, - const Message& proto); - - // Used by BUILD_ARRAY macro (below) to avoid having to have the type - // specified as a macro parameter. - template - inline void AllocateArray(int size, Type** output) { - *output = tables_->AllocateArray(size); - } - - // Allocates a copy of orig_options in tables_ and stores it in the - // descriptor. Remembers its uninterpreted options, to be interpreted - // later. DescriptorT must be one of the Descriptor messages from - // descriptor.proto. - template - void AllocateOptions(const typename DescriptorT::OptionsType& orig_options, - DescriptorT* descriptor, int options_field_tag, - const std::string& option_name); - // Specialization for FileOptions. - void AllocateOptions(const FileOptions& orig_options, - FileDescriptor* descriptor); - - // Implementation for AllocateOptions(). Don't call this directly. - template - void AllocateOptionsImpl( - const std::string& name_scope, const std::string& element_name, - const typename DescriptorT::OptionsType& orig_options, - DescriptorT* descriptor, const std::vector& options_path, - const std::string& option_name); - - // Allocates an array of two strings, the first one is a copy of `proto_name`, - // and the second one is the full name. - // Full proto name is "scope.proto_name" if scope is non-empty and - // "proto_name" otherwise. - const std::string* AllocateNameStrings(const std::string& scope, - const std::string& proto_name); - - // These methods all have the same signature for the sake of the BUILD_ARRAY - // macro, below. - void BuildMessage(const DescriptorProto& proto, const Descriptor* parent, - Descriptor* result); - void BuildFieldOrExtension(const FieldDescriptorProto& proto, - Descriptor* parent, FieldDescriptor* result, - bool is_extension); - void BuildField(const FieldDescriptorProto& proto, Descriptor* parent, - FieldDescriptor* result) { - BuildFieldOrExtension(proto, parent, result, false); - } - void BuildExtension(const FieldDescriptorProto& proto, Descriptor* parent, - FieldDescriptor* result) { - BuildFieldOrExtension(proto, parent, result, true); - } - void BuildExtensionRange(const DescriptorProto::ExtensionRange& proto, - const Descriptor* parent, - Descriptor::ExtensionRange* result); - void BuildReservedRange(const DescriptorProto::ReservedRange& proto, - const Descriptor* parent, - Descriptor::ReservedRange* result); - void BuildReservedRange(const EnumDescriptorProto::EnumReservedRange& proto, - const EnumDescriptor* parent, - EnumDescriptor::ReservedRange* result); - void BuildOneof(const OneofDescriptorProto& proto, Descriptor* parent, - OneofDescriptor* result); - void CheckEnumValueUniqueness(const EnumDescriptorProto& proto, - const EnumDescriptor* result); - void BuildEnum(const EnumDescriptorProto& proto, const Descriptor* parent, - EnumDescriptor* result); - void BuildEnumValue(const EnumValueDescriptorProto& proto, - const EnumDescriptor* parent, - EnumValueDescriptor* result); - void BuildService(const ServiceDescriptorProto& proto, const void* dummy, - ServiceDescriptor* result); - void BuildMethod(const MethodDescriptorProto& proto, - const ServiceDescriptor* parent, MethodDescriptor* result); - - void LogUnusedDependency(const FileDescriptorProto& proto, - const FileDescriptor* result); - - // Must be run only after building. - // - // NOTE: Options will not be available during cross-linking, as they - // have not yet been interpreted. Defer any handling of options to the - // Validate*Options methods. - void CrossLinkFile(FileDescriptor* file, const FileDescriptorProto& proto); - void CrossLinkMessage(Descriptor* message, const DescriptorProto& proto); - void CrossLinkField(FieldDescriptor* field, - const FieldDescriptorProto& proto); - void CrossLinkExtensionRange(Descriptor::ExtensionRange* range, - const DescriptorProto::ExtensionRange& proto); - void CrossLinkEnum(EnumDescriptor* enum_type, - const EnumDescriptorProto& proto); - void CrossLinkEnumValue(EnumValueDescriptor* enum_value, - const EnumValueDescriptorProto& proto); - void CrossLinkService(ServiceDescriptor* service, - const ServiceDescriptorProto& proto); - void CrossLinkMethod(MethodDescriptor* method, - const MethodDescriptorProto& proto); - - // Must be run only after cross-linking. - void InterpretOptions(); - - // A helper class for interpreting options. - class OptionInterpreter { - public: - // Creates an interpreter that operates in the context of the pool of the - // specified builder, which must not be nullptr. We don't take ownership of - // the builder. - explicit OptionInterpreter(DescriptorBuilder* builder); - - ~OptionInterpreter(); - - // Interprets the uninterpreted options in the specified Options message. - // On error, calls AddError() on the underlying builder and returns false. - // Otherwise returns true. - bool InterpretOptions(OptionsToInterpret* options_to_interpret); - - // Updates the given source code info by re-writing uninterpreted option - // locations to refer to the corresponding interpreted option. - void UpdateSourceCodeInfo(SourceCodeInfo* info); - - class AggregateOptionFinder; - - private: - // Interprets uninterpreted_option_ on the specified message, which - // must be the mutable copy of the original options message to which - // uninterpreted_option_ belongs. The given src_path is the source - // location path to the uninterpreted option, and options_path is the - // source location path to the options message. The location paths are - // recorded and then used in UpdateSourceCodeInfo. - bool InterpretSingleOption(Message* options, - const std::vector& src_path, - const std::vector& options_path); - - // Adds the uninterpreted_option to the given options message verbatim. - // Used when AllowUnknownDependencies() is in effect and we can't find - // the option's definition. - void AddWithoutInterpreting(const UninterpretedOption& uninterpreted_option, - Message* options); - - // A recursive helper function that drills into the intermediate fields - // in unknown_fields to check if field innermost_field is set on the - // innermost message. Returns false and sets an error if so. - bool ExamineIfOptionIsSet( - std::vector::const_iterator - intermediate_fields_iter, - std::vector::const_iterator - intermediate_fields_end, - const FieldDescriptor* innermost_field, - const std::string& debug_msg_name, - const UnknownFieldSet& unknown_fields); - - // Validates the value for the option field of the currently interpreted - // option and then sets it on the unknown_field. - bool SetOptionValue(const FieldDescriptor* option_field, - UnknownFieldSet* unknown_fields); - - // Parses an aggregate value for a CPPTYPE_MESSAGE option and - // saves it into *unknown_fields. - bool SetAggregateOption(const FieldDescriptor* option_field, - UnknownFieldSet* unknown_fields); - - // Convenience functions to set an int field the right way, depending on - // its wire type (a single int CppType can represent multiple wire types). - void SetInt32(int number, int32_t value, FieldDescriptor::Type type, - UnknownFieldSet* unknown_fields); - void SetInt64(int number, int64_t value, FieldDescriptor::Type type, - UnknownFieldSet* unknown_fields); - void SetUInt32(int number, uint32_t value, FieldDescriptor::Type type, - UnknownFieldSet* unknown_fields); - void SetUInt64(int number, uint64_t value, FieldDescriptor::Type type, - UnknownFieldSet* unknown_fields); - - // A helper function that adds an error at the specified location of the - // option we're currently interpreting, and returns false. - bool AddOptionError(DescriptorPool::ErrorCollector::ErrorLocation location, - const std::string& msg) { - builder_->AddError(options_to_interpret_->element_name, - *uninterpreted_option_, location, msg); - return false; - } - - // A helper function that adds an error at the location of the option name - // and returns false. - bool AddNameError(const std::string& msg) { -#ifdef PROTOBUF_INTERNAL_IGNORE_FIELD_NAME_ERRORS_ - return true; -#else // PROTOBUF_INTERNAL_IGNORE_FIELD_NAME_ERRORS_ - return AddOptionError(DescriptorPool::ErrorCollector::OPTION_NAME, msg); -#endif // PROTOBUF_INTERNAL_IGNORE_FIELD_NAME_ERRORS_ - } - - // A helper function that adds an error at the location of the option name - // and returns false. - bool AddValueError(const std::string& msg) { - return AddOptionError(DescriptorPool::ErrorCollector::OPTION_VALUE, msg); - } - - // We interpret against this builder's pool. Is never nullptr. We don't own - // this pointer. - DescriptorBuilder* builder_; - - // The options we're currently interpreting, or nullptr if we're not in a - // call to InterpretOptions. - const OptionsToInterpret* options_to_interpret_; - - // The option we're currently interpreting within options_to_interpret_, or - // nullptr if we're not in a call to InterpretOptions(). This points to a - // submessage of the original option, not the mutable copy. Therefore we - // can use it to find locations recorded by the parser. - const UninterpretedOption* uninterpreted_option_; - - // This maps the element path of uninterpreted options to the element path - // of the resulting interpreted option. This is used to modify a file's - // source code info to account for option interpretation. - std::map, std::vector> interpreted_paths_; - - // This maps the path to a repeated option field to the known number of - // elements the field contains. This is used to track the compute the - // index portion of the element path when interpreting a single option. - std::map, int> repeated_option_counts_; - - // Factory used to create the dynamic messages we need to parse - // any aggregate option values we encounter. - DynamicMessageFactory dynamic_factory_; - - GOOGLE_DISALLOW_EVIL_CONSTRUCTORS(OptionInterpreter); - }; - - // Work-around for broken compilers: According to the C++ standard, - // OptionInterpreter should have access to the private members of any class - // which has declared DescriptorBuilder as a friend. Unfortunately some old - // versions of GCC and other compilers do not implement this correctly. So, - // we have to have these intermediate methods to provide access. We also - // redundantly declare OptionInterpreter a friend just to make things extra - // clear for these bad compilers. - friend class OptionInterpreter; - friend class OptionInterpreter::AggregateOptionFinder; - - static inline bool get_allow_unknown(const DescriptorPool* pool) { - return pool->allow_unknown_; - } - static inline bool get_enforce_weak(const DescriptorPool* pool) { - return pool->enforce_weak_; - } - static inline bool get_is_placeholder(const Descriptor* descriptor) { - return descriptor != nullptr && descriptor->is_placeholder_; - } - static inline void assert_mutex_held(const DescriptorPool* pool) { - if (pool->mutex_ != nullptr) { - pool->mutex_->AssertHeld(); - } - } - - // Must be run only after options have been interpreted. - // - // NOTE: Validation code must only reference the options in the mutable - // descriptors, which are the ones that have been interpreted. The const - // proto references are passed in only so they can be provided to calls to - // AddError(). Do not look at their options, which have not been interpreted. - void ValidateFileOptions(FileDescriptor* file, - const FileDescriptorProto& proto); - void ValidateMessageOptions(Descriptor* message, - const DescriptorProto& proto); - void ValidateFieldOptions(FieldDescriptor* field, - const FieldDescriptorProto& proto); - void ValidateEnumOptions(EnumDescriptor* enm, - const EnumDescriptorProto& proto); - void ValidateEnumValueOptions(EnumValueDescriptor* enum_value, - const EnumValueDescriptorProto& proto); - void ValidateExtensionRangeOptions( - const std::string& full_name, Descriptor::ExtensionRange* extension_range, - const DescriptorProto_ExtensionRange& proto); - void ValidateServiceOptions(ServiceDescriptor* service, - const ServiceDescriptorProto& proto); - void ValidateMethodOptions(MethodDescriptor* method, - const MethodDescriptorProto& proto); - void ValidateProto3(FileDescriptor* file, const FileDescriptorProto& proto); - void ValidateProto3Message(Descriptor* message, const DescriptorProto& proto); - void ValidateProto3Field(FieldDescriptor* field, - const FieldDescriptorProto& proto); - void ValidateProto3Enum(EnumDescriptor* enm, - const EnumDescriptorProto& proto); - - // Returns true if the map entry message is compatible with the - // auto-generated entry message from map fields syntax. - bool ValidateMapEntry(FieldDescriptor* field, - const FieldDescriptorProto& proto); - - // Recursively detects naming conflicts with map entry types for a - // better error message. - void DetectMapConflicts(const Descriptor* message, - const DescriptorProto& proto); - - void ValidateJSType(FieldDescriptor* field, - const FieldDescriptorProto& proto); -}; - -const FileDescriptor* DescriptorPool::BuildFile( - const FileDescriptorProto& proto) { - GOOGLE_CHECK(fallback_database_ == nullptr) - << "Cannot call BuildFile on a DescriptorPool that uses a " - "DescriptorDatabase. You must instead find a way to get your file " - "into the underlying database."; - GOOGLE_CHECK(mutex_ == nullptr); // Implied by the above GOOGLE_CHECK. - tables_->known_bad_symbols_.clear(); - tables_->known_bad_files_.clear(); - return DescriptorBuilder(this, tables_.get(), nullptr).BuildFile(proto); -} - -const FileDescriptor* DescriptorPool::BuildFileCollectingErrors( - const FileDescriptorProto& proto, ErrorCollector* error_collector) { - GOOGLE_CHECK(fallback_database_ == nullptr) - << "Cannot call BuildFile on a DescriptorPool that uses a " - "DescriptorDatabase. You must instead find a way to get your file " - "into the underlying database."; - GOOGLE_CHECK(mutex_ == nullptr); // Implied by the above GOOGLE_CHECK. - tables_->known_bad_symbols_.clear(); - tables_->known_bad_files_.clear(); - return DescriptorBuilder(this, tables_.get(), error_collector) - .BuildFile(proto); -} - -const FileDescriptor* DescriptorPool::BuildFileFromDatabase( - const FileDescriptorProto& proto) const { - mutex_->AssertHeld(); - if (tables_->known_bad_files_.count(proto.name()) > 0) { - return nullptr; - } - const FileDescriptor* result = - DescriptorBuilder(this, tables_.get(), default_error_collector_) - .BuildFile(proto); - if (result == nullptr) { - tables_->known_bad_files_.insert(proto.name()); - } - return result; -} - -DescriptorBuilder::DescriptorBuilder( - const DescriptorPool* pool, DescriptorPool::Tables* tables, - DescriptorPool::ErrorCollector* error_collector) - : pool_(pool), - tables_(tables), - error_collector_(error_collector), - had_errors_(false), - possible_undeclared_dependency_(nullptr), - undefine_resolved_name_("") {} - -DescriptorBuilder::~DescriptorBuilder() {} - -void DescriptorBuilder::AddError( - const std::string& element_name, const Message& descriptor, - DescriptorPool::ErrorCollector::ErrorLocation location, - const std::string& error) { - if (error_collector_ == nullptr) { - if (!had_errors_) { - GOOGLE_LOG(ERROR) << "Invalid proto descriptor for file \"" << filename_ - << "\":"; - } - GOOGLE_LOG(ERROR) << " " << element_name << ": " << error; - } else { - error_collector_->AddError(filename_, element_name, &descriptor, location, - error); - } - had_errors_ = true; -} - -void DescriptorBuilder::AddError( - const std::string& element_name, const Message& descriptor, - DescriptorPool::ErrorCollector::ErrorLocation location, const char* error) { - AddError(element_name, descriptor, location, std::string(error)); -} - -void DescriptorBuilder::AddNotDefinedError( - const std::string& element_name, const Message& descriptor, - DescriptorPool::ErrorCollector::ErrorLocation location, - const std::string& undefined_symbol) { - if (possible_undeclared_dependency_ == nullptr && - undefine_resolved_name_.empty()) { - AddError(element_name, descriptor, location, - "\"" + undefined_symbol + "\" is not defined."); - } else { - if (possible_undeclared_dependency_ != nullptr) { - AddError(element_name, descriptor, location, - "\"" + possible_undeclared_dependency_name_ + - "\" seems to be defined in \"" + - possible_undeclared_dependency_->name() + - "\", which is not " - "imported by \"" + - filename_ + - "\". To use it here, please " - "add the necessary import."); - } - if (!undefine_resolved_name_.empty()) { - AddError(element_name, descriptor, location, - "\"" + undefined_symbol + "\" is resolved to \"" + - undefine_resolved_name_ + - "\", which is not defined. " - "The innermost scope is searched first in name resolution. " - "Consider using a leading '.'(i.e., \"." + - undefined_symbol + "\") to start from the outermost scope."); - } - } -} - -void DescriptorBuilder::AddWarning( - const std::string& element_name, const Message& descriptor, - DescriptorPool::ErrorCollector::ErrorLocation location, - const std::string& error) { - if (error_collector_ == nullptr) { - GOOGLE_LOG(WARNING) << filename_ << " " << element_name << ": " << error; - } else { - error_collector_->AddWarning(filename_, element_name, &descriptor, location, - error); - } -} - -bool DescriptorBuilder::IsInPackage(const FileDescriptor* file, - const std::string& package_name) { - return HasPrefixString(file->package(), package_name) && - (file->package().size() == package_name.size() || - file->package()[package_name.size()] == '.'); -} - -void DescriptorBuilder::RecordPublicDependencies(const FileDescriptor* file) { - if (file == nullptr || !dependencies_.insert(file).second) return; - for (int i = 0; file != nullptr && i < file->public_dependency_count(); i++) { - RecordPublicDependencies(file->public_dependency(i)); - } -} - -Symbol DescriptorBuilder::FindSymbolNotEnforcingDepsHelper( - const DescriptorPool* pool, const std::string& name, bool build_it) { - // If we are looking at an underlay, we must lock its mutex_, since we are - // accessing the underlay's tables_ directly. - MutexLockMaybe lock((pool == pool_) ? nullptr : pool->mutex_); - - Symbol result = pool->tables_->FindSymbol(name); - if (result.IsNull() && pool->underlay_ != nullptr) { - // Symbol not found; check the underlay. - result = FindSymbolNotEnforcingDepsHelper(pool->underlay_, name); - } - - if (result.IsNull()) { - // With lazily_build_dependencies_, a symbol lookup at cross link time is - // not guaranteed to be successful. In most cases, build_it will be false, - // which intentionally prevents us from building an import until it's - // actually needed. In some cases, like registering an extension, we want - // to build the file containing the symbol, and build_it will be set. - // Also, build_it will be true when !lazily_build_dependencies_, to provide - // better error reporting of missing dependencies. - if (build_it && pool->TryFindSymbolInFallbackDatabase(name)) { - result = pool->tables_->FindSymbol(name); - } - } - - return result; -} - -Symbol DescriptorBuilder::FindSymbolNotEnforcingDeps(const std::string& name, - bool build_it) { - Symbol result = FindSymbolNotEnforcingDepsHelper(pool_, name, build_it); - // Only find symbols which were defined in this file or one of its - // dependencies. - const FileDescriptor* file = result.GetFile(); - if (file == file_ || dependencies_.count(file) > 0) { - unused_dependency_.erase(file); - } - return result; -} - -Symbol DescriptorBuilder::FindSymbol(const std::string& name, bool build_it) { - Symbol result = FindSymbolNotEnforcingDeps(name, build_it); - - if (result.IsNull()) return result; - - if (!pool_->enforce_dependencies_) { - // Hack for CompilerUpgrader, and also used for lazily_build_dependencies_ - return result; - } - - // Only find symbols which were defined in this file or one of its - // dependencies. - const FileDescriptor* file = result.GetFile(); - if (file == file_ || dependencies_.count(file) > 0) { - return result; - } - - if (result.type() == Symbol::PACKAGE) { - // Arg, this is overcomplicated. The symbol is a package name. It could - // be that the package was defined in multiple files. result.GetFile() - // returns the first file we saw that used this package. We've determined - // that that file is not a direct dependency of the file we are currently - // building, but it could be that some other file which *is* a direct - // dependency also defines the same package. We can't really rule out this - // symbol unless none of the dependencies define it. - if (IsInPackage(file_, name)) return result; - for (std::set::const_iterator it = - dependencies_.begin(); - it != dependencies_.end(); ++it) { - // Note: A dependency may be nullptr if it was not found or had errors. - if (*it != nullptr && IsInPackage(*it, name)) return result; - } - } - - possible_undeclared_dependency_ = file; - possible_undeclared_dependency_name_ = name; - return kNullSymbol; -} - -Symbol DescriptorBuilder::LookupSymbolNoPlaceholder( - const std::string& name, const std::string& relative_to, - ResolveMode resolve_mode, bool build_it) { - possible_undeclared_dependency_ = nullptr; - undefine_resolved_name_.clear(); - - if (!name.empty() && name[0] == '.') { - // Fully-qualified name. - return FindSymbol(name.substr(1), build_it); - } - - // If name is something like "Foo.Bar.baz", and symbols named "Foo" are - // defined in multiple parent scopes, we only want to find "Bar.baz" in the - // innermost one. E.g., the following should produce an error: - // message Bar { message Baz {} } - // message Foo { - // message Bar { - // } - // optional Bar.Baz baz = 1; - // } - // So, we look for just "Foo" first, then look for "Bar.baz" within it if - // found. - std::string::size_type name_dot_pos = name.find_first_of('.'); - std::string first_part_of_name; - if (name_dot_pos == std::string::npos) { - first_part_of_name = name; - } else { - first_part_of_name = name.substr(0, name_dot_pos); - } - - std::string scope_to_try(relative_to); - - while (true) { - // Chop off the last component of the scope. - std::string::size_type dot_pos = scope_to_try.find_last_of('.'); - if (dot_pos == std::string::npos) { - return FindSymbol(name, build_it); - } else { - scope_to_try.erase(dot_pos); - } - - // Append ".first_part_of_name" and try to find. - std::string::size_type old_size = scope_to_try.size(); - scope_to_try.append(1, '.'); - scope_to_try.append(first_part_of_name); - Symbol result = FindSymbol(scope_to_try, build_it); - if (!result.IsNull()) { - if (first_part_of_name.size() < name.size()) { - // name is a compound symbol, of which we only found the first part. - // Now try to look up the rest of it. - if (result.IsAggregate()) { - scope_to_try.append(name, first_part_of_name.size(), - name.size() - first_part_of_name.size()); - result = FindSymbol(scope_to_try, build_it); - if (result.IsNull()) { - undefine_resolved_name_ = scope_to_try; - } - return result; - } else { - // We found a symbol but it's not an aggregate. Continue the loop. - } - } else { - if (resolve_mode == LOOKUP_TYPES && !result.IsType()) { - // We found a symbol but it's not a type. Continue the loop. - } else { - return result; - } - } - } - - // Not found. Remove the name so we can try again. - scope_to_try.erase(old_size); - } -} - -Symbol DescriptorBuilder::LookupSymbol( - const std::string& name, const std::string& relative_to, - DescriptorPool::PlaceholderType placeholder_type, ResolveMode resolve_mode, - bool build_it) { - Symbol result = - LookupSymbolNoPlaceholder(name, relative_to, resolve_mode, build_it); - if (result.IsNull() && pool_->allow_unknown_) { - // Not found, but AllowUnknownDependencies() is enabled. Return a - // placeholder instead. - result = pool_->NewPlaceholderWithMutexHeld(name, placeholder_type); - } - return result; -} - -static bool ValidateQualifiedName(StringPiece name) { - bool last_was_period = false; - - for (char character : name) { - // I don't trust isalnum() due to locales. :( - if (('a' <= character && character <= 'z') || - ('A' <= character && character <= 'Z') || - ('0' <= character && character <= '9') || (character == '_')) { - last_was_period = false; - } else if (character == '.') { - if (last_was_period) return false; - last_was_period = true; - } else { - return false; - } - } - - return !name.empty() && !last_was_period; -} - -Symbol DescriptorPool::NewPlaceholder(StringPiece name, - PlaceholderType placeholder_type) const { - MutexLockMaybe lock(mutex_); - return NewPlaceholderWithMutexHeld(name, placeholder_type); -} - -Symbol DescriptorPool::NewPlaceholderWithMutexHeld( - StringPiece name, PlaceholderType placeholder_type) const { - if (mutex_) { - mutex_->AssertHeld(); - } - // Compute names. - StringPiece placeholder_full_name; - StringPiece placeholder_name; - const std::string* placeholder_package; - - if (!ValidateQualifiedName(name)) return kNullSymbol; - if (name[0] == '.') { - // Fully-qualified. - placeholder_full_name = name.substr(1); - } else { - placeholder_full_name = name; - } - - std::string::size_type dotpos = placeholder_full_name.find_last_of('.'); - if (dotpos != std::string::npos) { - placeholder_package = - tables_->AllocateString(placeholder_full_name.substr(0, dotpos)); - placeholder_name = placeholder_full_name.substr(dotpos + 1); - } else { - placeholder_package = &internal::GetEmptyString(); - placeholder_name = placeholder_full_name; - } - - // Create the placeholders. - FileDescriptor* placeholder_file = NewPlaceholderFileWithMutexHeld( - StrCat(placeholder_full_name, ".placeholder.proto")); - placeholder_file->package_ = placeholder_package; - - if (placeholder_type == PLACEHOLDER_ENUM) { - placeholder_file->enum_type_count_ = 1; - placeholder_file->enum_types_ = tables_->AllocateArray(1); - - EnumDescriptor* placeholder_enum = &placeholder_file->enum_types_[0]; - memset(static_cast(placeholder_enum), 0, sizeof(*placeholder_enum)); - - placeholder_enum->all_names_ = - tables_->AllocateStringArray(placeholder_name, placeholder_full_name); - placeholder_enum->file_ = placeholder_file; - placeholder_enum->options_ = &EnumOptions::default_instance(); - placeholder_enum->is_placeholder_ = true; - placeholder_enum->is_unqualified_placeholder_ = (name[0] != '.'); - - // Enums must have at least one value. - placeholder_enum->value_count_ = 1; - placeholder_enum->values_ = tables_->AllocateArray(1); - // Disable fast-path lookup for this enum. - placeholder_enum->sequential_value_limit_ = -1; - - EnumValueDescriptor* placeholder_value = &placeholder_enum->values_[0]; - memset(static_cast(placeholder_value), 0, - sizeof(*placeholder_value)); - - // Note that enum value names are siblings of their type, not children. - placeholder_value->all_names_ = tables_->AllocateStringArray( - "PLACEHOLDER_VALUE", placeholder_package->empty() - ? "PLACEHOLDER_VALUE" - : *placeholder_package + ".PLACEHOLDER_VALUE"); - - placeholder_value->number_ = 0; - placeholder_value->type_ = placeholder_enum; - placeholder_value->options_ = &EnumValueOptions::default_instance(); - - return Symbol(placeholder_enum); - } else { - placeholder_file->message_type_count_ = 1; - placeholder_file->message_types_ = tables_->AllocateArray(1); - - Descriptor* placeholder_message = &placeholder_file->message_types_[0]; - memset(static_cast(placeholder_message), 0, - sizeof(*placeholder_message)); - - placeholder_message->all_names_ = - tables_->AllocateStringArray(placeholder_name, placeholder_full_name); - placeholder_message->file_ = placeholder_file; - placeholder_message->options_ = &MessageOptions::default_instance(); - placeholder_message->is_placeholder_ = true; - placeholder_message->is_unqualified_placeholder_ = (name[0] != '.'); - - if (placeholder_type == PLACEHOLDER_EXTENDABLE_MESSAGE) { - placeholder_message->extension_range_count_ = 1; - placeholder_message->extension_ranges_ = - tables_->AllocateArray(1); - placeholder_message->extension_ranges_->start = 1; - // kMaxNumber + 1 because ExtensionRange::end is exclusive. - placeholder_message->extension_ranges_->end = - FieldDescriptor::kMaxNumber + 1; - placeholder_message->extension_ranges_->options_ = nullptr; - } - - return Symbol(placeholder_message); - } -} - -FileDescriptor* DescriptorPool::NewPlaceholderFile( - StringPiece name) const { - MutexLockMaybe lock(mutex_); - return NewPlaceholderFileWithMutexHeld(name); -} - -FileDescriptor* DescriptorPool::NewPlaceholderFileWithMutexHeld( - StringPiece name) const { - if (mutex_) { - mutex_->AssertHeld(); - } - FileDescriptor* placeholder = tables_->Allocate(); - memset(static_cast(placeholder), 0, sizeof(*placeholder)); - - placeholder->name_ = tables_->AllocateString(name); - placeholder->package_ = &internal::GetEmptyString(); - placeholder->pool_ = this; - placeholder->options_ = &FileOptions::default_instance(); - placeholder->tables_ = &FileDescriptorTables::GetEmptyInstance(); - placeholder->source_code_info_ = &SourceCodeInfo::default_instance(); - placeholder->is_placeholder_ = true; - placeholder->syntax_ = FileDescriptor::SYNTAX_UNKNOWN; - placeholder->finished_building_ = true; - // All other fields are zero or nullptr. - - return placeholder; -} - -bool DescriptorBuilder::AddSymbol(const std::string& full_name, - const void* parent, const std::string& name, - const Message& proto, Symbol symbol) { - // If the caller passed nullptr for the parent, the symbol is at file scope. - // Use its file as the parent instead. - if (parent == nullptr) parent = file_; - - if (full_name.find('\0') != std::string::npos) { - AddError(full_name, proto, DescriptorPool::ErrorCollector::NAME, - "\"" + full_name + "\" contains null character."); - return false; - } - if (tables_->AddSymbol(full_name, symbol)) { - if (!file_tables_->AddAliasUnderParent(parent, name, symbol)) { - // This is only possible if there was already an error adding something of - // the same name. - if (!had_errors_) { - GOOGLE_LOG(DFATAL) << "\"" << full_name - << "\" not previously defined in " - "symbols_by_name_, but was defined in " - "symbols_by_parent_; this shouldn't be possible."; - } - return false; - } - return true; - } else { - const FileDescriptor* other_file = tables_->FindSymbol(full_name).GetFile(); - if (other_file == file_) { - std::string::size_type dot_pos = full_name.find_last_of('.'); - if (dot_pos == std::string::npos) { - AddError(full_name, proto, DescriptorPool::ErrorCollector::NAME, - "\"" + full_name + "\" is already defined."); - } else { - AddError(full_name, proto, DescriptorPool::ErrorCollector::NAME, - "\"" + full_name.substr(dot_pos + 1) + - "\" is already defined in \"" + - full_name.substr(0, dot_pos) + "\"."); - } - } else { - // Symbol seems to have been defined in a different file. - AddError(full_name, proto, DescriptorPool::ErrorCollector::NAME, - "\"" + full_name + "\" is already defined in file \"" + - (other_file == nullptr ? "null" : other_file->name()) + - "\"."); - } - return false; - } -} - -void DescriptorBuilder::AddPackage(const std::string& name, - const Message& proto, FileDescriptor* file) { - if (name.find('\0') != std::string::npos) { - AddError(name, proto, DescriptorPool::ErrorCollector::NAME, - "\"" + name + "\" contains null character."); - return; - } - - Symbol existing_symbol = tables_->FindSymbol(name); - // It's OK to redefine a package. - if (existing_symbol.IsNull()) { - auto* package = tables_->AllocateArray(1); - // If the name is the package name, then it is already in the arena. - // If not, copy it there. It came from the call to AddPackage below. - package->name = - &name == &file->package() ? &name : tables_->AllocateString(name); - package->file = file; - tables_->AddSymbol(*package->name, Symbol(package)); - // Also add parent package, if any. - std::string::size_type dot_pos = name.find_last_of('.'); - if (dot_pos == std::string::npos) { - // No parents. - ValidateSymbolName(name, name, proto); - } else { - // Has parent. - AddPackage(name.substr(0, dot_pos), proto, file); - ValidateSymbolName(name.substr(dot_pos + 1), name, proto); - } - } else if (existing_symbol.type() != Symbol::PACKAGE) { - // Symbol seems to have been defined in a different file. - AddError(name, proto, DescriptorPool::ErrorCollector::NAME, - "\"" + name + - "\" is already defined (as something other than " - "a package) in file \"" + - existing_symbol.GetFile()->name() + "\"."); - } -} - -void DescriptorBuilder::ValidateSymbolName(const std::string& name, - const std::string& full_name, - const Message& proto) { - if (name.empty()) { - AddError(full_name, proto, DescriptorPool::ErrorCollector::NAME, - "Missing name."); - } else { - for (char character : name) { - // I don't trust isalnum() due to locales. :( - if ((character < 'a' || 'z' < character) && - (character < 'A' || 'Z' < character) && - (character < '0' || '9' < character) && (character != '_')) { - AddError(full_name, proto, DescriptorPool::ErrorCollector::NAME, - "\"" + name + "\" is not a valid identifier."); - } - } - } -} - -// ------------------------------------------------------------------- - -// This generic implementation is good for all descriptors except -// FileDescriptor. -template -void DescriptorBuilder::AllocateOptions( - const typename DescriptorT::OptionsType& orig_options, - DescriptorT* descriptor, int options_field_tag, - const std::string& option_name) { - std::vector options_path; - descriptor->GetLocationPath(&options_path); - options_path.push_back(options_field_tag); - AllocateOptionsImpl(descriptor->full_name(), descriptor->full_name(), - orig_options, descriptor, options_path, option_name); -} - -// We specialize for FileDescriptor. -void DescriptorBuilder::AllocateOptions(const FileOptions& orig_options, - FileDescriptor* descriptor) { - std::vector options_path; - options_path.push_back(FileDescriptorProto::kOptionsFieldNumber); - // We add the dummy token so that LookupSymbol does the right thing. - AllocateOptionsImpl(descriptor->package() + ".dummy", descriptor->name(), - orig_options, descriptor, options_path, - "google.protobuf.FileOptions"); -} - -template -void DescriptorBuilder::AllocateOptionsImpl( - const std::string& name_scope, const std::string& element_name, - const typename DescriptorT::OptionsType& orig_options, - DescriptorT* descriptor, const std::vector& options_path, - const std::string& option_name) { - // We need to use a dummy pointer to work around a bug in older versions of - // GCC. Otherwise, the following two lines could be replaced with: - // typename DescriptorT::OptionsType* options = - // tables_->AllocateMessage(); - typename DescriptorT::OptionsType* const dummy = nullptr; - typename DescriptorT::OptionsType* options = tables_->AllocateMessage(dummy); - - if (!orig_options.IsInitialized()) { - AddError(name_scope + "." + element_name, orig_options, - DescriptorPool::ErrorCollector::OPTION_NAME, - "Uninterpreted option is missing name or value."); - return; - } - - // Avoid using MergeFrom()/CopyFrom() in this class to make it -fno-rtti - // friendly. Without RTTI, MergeFrom() and CopyFrom() will fallback to the - // reflection based method, which requires the Descriptor. However, we are in - // the middle of building the descriptors, thus the deadlock. - options->ParseFromString(orig_options.SerializeAsString()); - descriptor->options_ = options; - - // Don't add to options_to_interpret_ unless there were uninterpreted - // options. This not only avoids unnecessary work, but prevents a - // bootstrapping problem when building descriptors for descriptor.proto. - // descriptor.proto does not contain any uninterpreted options, but - // attempting to interpret options anyway will cause - // OptionsType::GetDescriptor() to be called which may then deadlock since - // we're still trying to build it. - if (options->uninterpreted_option_size() > 0) { - options_to_interpret_.push_back(OptionsToInterpret( - name_scope, element_name, options_path, &orig_options, options)); - } - - // If the custom option is in unknown fields, no need to interpret it. - // Remove the dependency file from unused_dependency. - const UnknownFieldSet& unknown_fields = orig_options.unknown_fields(); - if (!unknown_fields.empty()) { - // Can not use options->GetDescriptor() which may case deadlock. - Symbol msg_symbol = tables_->FindSymbol(option_name); - if (msg_symbol.type() == Symbol::MESSAGE) { - for (int i = 0; i < unknown_fields.field_count(); ++i) { - assert_mutex_held(pool_); - const FieldDescriptor* field = - pool_->InternalFindExtensionByNumberNoLock( - msg_symbol.descriptor(), unknown_fields.field(i).number()); - if (field) { - unused_dependency_.erase(field->file()); - } - } - } - } -} - -// A common pattern: We want to convert a repeated field in the descriptor -// to an array of values, calling some method to build each value. -#define BUILD_ARRAY(INPUT, OUTPUT, NAME, METHOD, PARENT) \ - OUTPUT->NAME##_count_ = INPUT.NAME##_size(); \ - AllocateArray(INPUT.NAME##_size(), &OUTPUT->NAME##s_); \ - for (int i = 0; i < INPUT.NAME##_size(); i++) { \ - METHOD(INPUT.NAME(i), PARENT, OUTPUT->NAME##s_ + i); \ - } - -void DescriptorBuilder::AddRecursiveImportError( - const FileDescriptorProto& proto, int from_here) { - std::string error_message("File recursively imports itself: "); - for (size_t i = from_here; i < tables_->pending_files_.size(); i++) { - error_message.append(tables_->pending_files_[i]); - error_message.append(" -> "); - } - error_message.append(proto.name()); - - if (static_cast(from_here) < tables_->pending_files_.size() - 1) { - AddError(tables_->pending_files_[from_here + 1], proto, - DescriptorPool::ErrorCollector::IMPORT, error_message); - } else { - AddError(proto.name(), proto, DescriptorPool::ErrorCollector::IMPORT, - error_message); - } -} - -void DescriptorBuilder::AddTwiceListedError(const FileDescriptorProto& proto, - int index) { - AddError(proto.dependency(index), proto, - DescriptorPool::ErrorCollector::IMPORT, - "Import \"" + proto.dependency(index) + "\" was listed twice."); -} - -void DescriptorBuilder::AddImportError(const FileDescriptorProto& proto, - int index) { - std::string message; - if (pool_->fallback_database_ == nullptr) { - message = "Import \"" + proto.dependency(index) + "\" has not been loaded."; - } else { - message = "Import \"" + proto.dependency(index) + - "\" was not found or had errors."; - } - AddError(proto.dependency(index), proto, - DescriptorPool::ErrorCollector::IMPORT, message); -} - -static bool ExistingFileMatchesProto(const FileDescriptor* existing_file, - const FileDescriptorProto& proto) { - FileDescriptorProto existing_proto; - existing_file->CopyTo(&existing_proto); - // TODO(liujisi): Remove it when CopyTo supports copying syntax params when - // syntax="proto2". - if (existing_file->syntax() == FileDescriptor::SYNTAX_PROTO2 && - proto.has_syntax()) { - existing_proto.set_syntax( - existing_file->SyntaxName(existing_file->syntax())); - } - - return existing_proto.SerializeAsString() == proto.SerializeAsString(); -} - -const FileDescriptor* DescriptorBuilder::BuildFile( - const FileDescriptorProto& proto) { - filename_ = proto.name(); - - // Check if the file already exists and is identical to the one being built. - // Note: This only works if the input is canonical -- that is, it - // fully-qualifies all type names, has no UninterpretedOptions, etc. - // This is fine, because this idempotency "feature" really only exists to - // accommodate one hack in the proto1->proto2 migration layer. - const FileDescriptor* existing_file = tables_->FindFile(filename_); - if (existing_file != nullptr) { - // File already in pool. Compare the existing one to the input. - if (ExistingFileMatchesProto(existing_file, proto)) { - // They're identical. Return the existing descriptor. - return existing_file; - } - - // Not a match. The error will be detected and handled later. - } - - // Check to see if this file is already on the pending files list. - // TODO(kenton): Allow recursive imports? It may not work with some - // (most?) programming languages. E.g., in C++, a forward declaration - // of a type is not sufficient to allow it to be used even in a - // generated header file due to inlining. This could perhaps be - // worked around using tricks involving inserting #include statements - // mid-file, but that's pretty ugly, and I'm pretty sure there are - // some languages out there that do not allow recursive dependencies - // at all. - for (size_t i = 0; i < tables_->pending_files_.size(); i++) { - if (tables_->pending_files_[i] == proto.name()) { - AddRecursiveImportError(proto, i); - return nullptr; - } - } - - // If we have a fallback_database_, and we aren't doing lazy import building, - // attempt to load all dependencies now, before checkpointing tables_. This - // avoids confusion with recursive checkpoints. - if (!pool_->lazily_build_dependencies_) { - if (pool_->fallback_database_ != nullptr) { - tables_->pending_files_.push_back(proto.name()); - for (int i = 0; i < proto.dependency_size(); i++) { - if (tables_->FindFile(proto.dependency(i)) == nullptr && - (pool_->underlay_ == nullptr || - pool_->underlay_->FindFileByName(proto.dependency(i)) == - nullptr)) { - // We don't care what this returns since we'll find out below anyway. - pool_->TryFindFileInFallbackDatabase(proto.dependency(i)); - } - } - tables_->pending_files_.pop_back(); - } - } - - // Checkpoint the tables so that we can roll back if something goes wrong. - tables_->AddCheckpoint(); - - FileDescriptor* result = BuildFileImpl(proto); - - file_tables_->FinalizeTables(); - if (result) { - tables_->ClearLastCheckpoint(); - result->finished_building_ = true; - } else { - tables_->RollbackToLastCheckpoint(); - } - - return result; -} - -FileDescriptor* DescriptorBuilder::BuildFileImpl( - const FileDescriptorProto& proto) { - FileDescriptor* result = tables_->Allocate(); - file_ = result; - - result->is_placeholder_ = false; - result->finished_building_ = false; - SourceCodeInfo* info = nullptr; - if (proto.has_source_code_info()) { - info = tables_->AllocateMessage(); - info->CopyFrom(proto.source_code_info()); - result->source_code_info_ = info; - } else { - result->source_code_info_ = &SourceCodeInfo::default_instance(); - } - - file_tables_ = tables_->AllocateFileTables(); - file_->tables_ = file_tables_; - - if (!proto.has_name()) { - AddError("", proto, DescriptorPool::ErrorCollector::OTHER, - "Missing field: FileDescriptorProto.name."); - } - - // TODO(liujisi): Report error when the syntax is empty after all the protos - // have added the syntax statement. - if (proto.syntax().empty() || proto.syntax() == "proto2") { - file_->syntax_ = FileDescriptor::SYNTAX_PROTO2; - } else if (proto.syntax() == "proto3") { - file_->syntax_ = FileDescriptor::SYNTAX_PROTO3; - } else { - file_->syntax_ = FileDescriptor::SYNTAX_UNKNOWN; - AddError(proto.name(), proto, DescriptorPool::ErrorCollector::OTHER, - "Unrecognized syntax: " + proto.syntax()); - } - - result->name_ = tables_->AllocateString(proto.name()); - if (proto.has_package()) { - result->package_ = tables_->AllocateString(proto.package()); - } else { - // We cannot rely on proto.package() returning a valid string if - // proto.has_package() is false, because we might be running at static - // initialization time, in which case default values have not yet been - // initialized. - result->package_ = tables_->AllocateString(""); - } - result->pool_ = pool_; - - if (result->name().find('\0') != std::string::npos) { - AddError(result->name(), proto, DescriptorPool::ErrorCollector::NAME, - "\"" + result->name() + "\" contains null character."); - return nullptr; - } - - // Add to tables. - if (!tables_->AddFile(result)) { - AddError(proto.name(), proto, DescriptorPool::ErrorCollector::OTHER, - "A file with this name is already in the pool."); - // Bail out early so that if this is actually the exact same file, we - // don't end up reporting that every single symbol is already defined. - return nullptr; - } - if (!result->package().empty()) { - AddPackage(result->package(), proto, result); - } - - // Make sure all dependencies are loaded. - std::set seen_dependencies; - result->dependency_count_ = proto.dependency_size(); - result->dependencies_ = - tables_->AllocateArray(proto.dependency_size()); - result->dependencies_once_ = nullptr; - unused_dependency_.clear(); - std::set weak_deps; - for (int i = 0; i < proto.weak_dependency_size(); ++i) { - weak_deps.insert(proto.weak_dependency(i)); - } - for (int i = 0; i < proto.dependency_size(); i++) { - if (!seen_dependencies.insert(proto.dependency(i)).second) { - AddTwiceListedError(proto, i); - } - - const FileDescriptor* dependency = tables_->FindFile(proto.dependency(i)); - if (dependency == nullptr && pool_->underlay_ != nullptr) { - dependency = pool_->underlay_->FindFileByName(proto.dependency(i)); - } - - if (dependency == result) { - // Recursive import. dependency/result is not fully initialized, and it's - // dangerous to try to do anything with it. The recursive import error - // will be detected and reported in DescriptorBuilder::BuildFile(). - return nullptr; - } - - if (dependency == nullptr) { - if (!pool_->lazily_build_dependencies_) { - if (pool_->allow_unknown_ || - (!pool_->enforce_weak_ && weak_deps.find(i) != weak_deps.end())) { - dependency = - pool_->NewPlaceholderFileWithMutexHeld(proto.dependency(i)); - } else { - AddImportError(proto, i); - } - } - } else { - // Add to unused_dependency_ to track unused imported files. - // Note: do not track unused imported files for public import. - if (pool_->enforce_dependencies_ && - (pool_->unused_import_track_files_.find(proto.name()) != - pool_->unused_import_track_files_.end()) && - (dependency->public_dependency_count() == 0)) { - unused_dependency_.insert(dependency); - } - } - - result->dependencies_[i] = dependency; - if (pool_->lazily_build_dependencies_ && !dependency) { - if (result->dependencies_once_ == nullptr) { - result->dependencies_once_ = - tables_->Create(); - result->dependencies_once_->dependencies_names = - tables_->AllocateArray(proto.dependency_size()); - if (proto.dependency_size() > 0) { - std::fill_n(result->dependencies_once_->dependencies_names, - proto.dependency_size(), nullptr); - } - } - - result->dependencies_once_->dependencies_names[i] = - tables_->Strdup(proto.dependency(i)); - } - } - - // Check public dependencies. - int public_dependency_count = 0; - result->public_dependencies_ = - tables_->AllocateArray(proto.public_dependency_size()); - for (int i = 0; i < proto.public_dependency_size(); i++) { - // Only put valid public dependency indexes. - int index = proto.public_dependency(i); - if (index >= 0 && index < proto.dependency_size()) { - result->public_dependencies_[public_dependency_count++] = index; - // Do not track unused imported files for public import. - // Calling dependency(i) builds that file when doing lazy imports, - // need to avoid doing this. Unused dependency detection isn't done - // when building lazily, anyways. - if (!pool_->lazily_build_dependencies_) { - unused_dependency_.erase(result->dependency(index)); - } - } else { - AddError(proto.name(), proto, DescriptorPool::ErrorCollector::OTHER, - "Invalid public dependency index."); - } - } - result->public_dependency_count_ = public_dependency_count; - - // Build dependency set - dependencies_.clear(); - // We don't/can't do proper dependency error checking when - // lazily_build_dependencies_, and calling dependency(i) will force - // a dependency to be built, which we don't want. - if (!pool_->lazily_build_dependencies_) { - for (int i = 0; i < result->dependency_count(); i++) { - RecordPublicDependencies(result->dependency(i)); - } - } - - // Check weak dependencies. - int weak_dependency_count = 0; - result->weak_dependencies_ = - tables_->AllocateArray(proto.weak_dependency_size()); - for (int i = 0; i < proto.weak_dependency_size(); i++) { - int index = proto.weak_dependency(i); - if (index >= 0 && index < proto.dependency_size()) { - result->weak_dependencies_[weak_dependency_count++] = index; - } else { - AddError(proto.name(), proto, DescriptorPool::ErrorCollector::OTHER, - "Invalid weak dependency index."); - } - } - result->weak_dependency_count_ = weak_dependency_count; - - // Convert children. - BUILD_ARRAY(proto, result, message_type, BuildMessage, nullptr); - BUILD_ARRAY(proto, result, enum_type, BuildEnum, nullptr); - BUILD_ARRAY(proto, result, service, BuildService, nullptr); - BUILD_ARRAY(proto, result, extension, BuildExtension, nullptr); - - // Copy options. - result->options_ = nullptr; // Set to default_instance later if necessary. - if (proto.has_options()) { - AllocateOptions(proto.options(), result); - } - - // Note that the following steps must occur in exactly the specified order. - - // Cross-link. - CrossLinkFile(result, proto); - - // Interpret any remaining uninterpreted options gathered into - // options_to_interpret_ during descriptor building. Cross-linking has made - // extension options known, so all interpretations should now succeed. - if (!had_errors_) { - OptionInterpreter option_interpreter(this); - for (std::vector::iterator iter = - options_to_interpret_.begin(); - iter != options_to_interpret_.end(); ++iter) { - option_interpreter.InterpretOptions(&(*iter)); - } - options_to_interpret_.clear(); - if (info != nullptr) { - option_interpreter.UpdateSourceCodeInfo(info); - } - } - - // Validate options. See comments at InternalSetLazilyBuildDependencies about - // error checking and lazy import building. - if (!had_errors_ && !pool_->lazily_build_dependencies_) { - ValidateFileOptions(result, proto); - } - - // Additional naming conflict check for map entry types. Only need to check - // this if there are already errors. - if (had_errors_) { - for (int i = 0; i < proto.message_type_size(); ++i) { - DetectMapConflicts(result->message_type(i), proto.message_type(i)); - } - } - - - // Again, see comments at InternalSetLazilyBuildDependencies about error - // checking. Also, don't log unused dependencies if there were previous - // errors, since the results might be inaccurate. - if (!had_errors_ && !unused_dependency_.empty() && - !pool_->lazily_build_dependencies_) { - LogUnusedDependency(proto, result); - } - - if (had_errors_) { - return nullptr; - } else { - return result; - } -} - - -const std::string* DescriptorBuilder::AllocateNameStrings( - const std::string& scope, const std::string& proto_name) { - if (scope.empty()) { - return tables_->AllocateStringArray(proto_name, proto_name); - } else { - return tables_->AllocateStringArray(proto_name, - StrCat(scope, ".", proto_name)); - } -} - -void DescriptorBuilder::BuildMessage(const DescriptorProto& proto, - const Descriptor* parent, - Descriptor* result) { - const std::string& scope = - (parent == nullptr) ? file_->package() : parent->full_name(); - result->all_names_ = AllocateNameStrings(scope, proto.name()); - ValidateSymbolName(proto.name(), result->full_name(), proto); - - result->file_ = file_; - result->containing_type_ = parent; - result->is_placeholder_ = false; - result->is_unqualified_placeholder_ = false; - result->well_known_type_ = Descriptor::WELLKNOWNTYPE_UNSPECIFIED; - - auto it = pool_->tables_->well_known_types_.find(result->full_name()); - if (it != pool_->tables_->well_known_types_.end()) { - result->well_known_type_ = it->second; - } - - // Calculate the continuous sequence of fields. - // These can be fast-path'd during lookup and don't need to be added to the - // tables. - // We use uint16_t to save space for sequential_field_limit_, so stop before - // overflowing it. Worst case, we are not taking full advantage on huge - // messages, but it is unlikely. - result->sequential_field_limit_ = 0; - for (int i = 0; i < std::numeric_limits::max() && - i < proto.field_size() && proto.field(i).number() == i + 1; - ++i) { - result->sequential_field_limit_ = i + 1; - } - - // Build oneofs first so that fields and extension ranges can refer to them. - BUILD_ARRAY(proto, result, oneof_decl, BuildOneof, result); - BUILD_ARRAY(proto, result, field, BuildField, result); - BUILD_ARRAY(proto, result, nested_type, BuildMessage, result); - BUILD_ARRAY(proto, result, enum_type, BuildEnum, result); - BUILD_ARRAY(proto, result, extension_range, BuildExtensionRange, result); - BUILD_ARRAY(proto, result, extension, BuildExtension, result); - BUILD_ARRAY(proto, result, reserved_range, BuildReservedRange, result); - - // Copy reserved names. - int reserved_name_count = proto.reserved_name_size(); - result->reserved_name_count_ = reserved_name_count; - result->reserved_names_ = - tables_->AllocateArray(reserved_name_count); - for (int i = 0; i < reserved_name_count; ++i) { - result->reserved_names_[i] = - tables_->AllocateString(proto.reserved_name(i)); - } - - // Copy options. - result->options_ = nullptr; // Set to default_instance later if necessary. - if (proto.has_options()) { - AllocateOptions(proto.options(), result, - DescriptorProto::kOptionsFieldNumber, - "google.protobuf.MessageOptions"); - } - - AddSymbol(result->full_name(), parent, result->name(), proto, Symbol(result)); - - for (int i = 0; i < proto.reserved_range_size(); i++) { - const DescriptorProto_ReservedRange& range1 = proto.reserved_range(i); - for (int j = i + 1; j < proto.reserved_range_size(); j++) { - const DescriptorProto_ReservedRange& range2 = proto.reserved_range(j); - if (range1.end() > range2.start() && range2.end() > range1.start()) { - AddError(result->full_name(), proto.reserved_range(i), - DescriptorPool::ErrorCollector::NUMBER, - strings::Substitute("Reserved range $0 to $1 overlaps with " - "already-defined range $2 to $3.", - range2.start(), range2.end() - 1, - range1.start(), range1.end() - 1)); - } - } - } - - HASH_SET reserved_name_set; - for (int i = 0; i < proto.reserved_name_size(); i++) { - const std::string& name = proto.reserved_name(i); - if (reserved_name_set.find(name) == reserved_name_set.end()) { - reserved_name_set.insert(name); - } else { - AddError(name, proto, DescriptorPool::ErrorCollector::NAME, - strings::Substitute("Field name \"$0\" is reserved multiple times.", - name)); - } - } - - - for (int i = 0; i < result->field_count(); i++) { - const FieldDescriptor* field = result->field(i); - for (int j = 0; j < result->extension_range_count(); j++) { - const Descriptor::ExtensionRange* range = result->extension_range(j); - if (range->start <= field->number() && field->number() < range->end) { - AddError( - field->full_name(), proto.extension_range(j), - DescriptorPool::ErrorCollector::NUMBER, - strings::Substitute( - "Extension range $0 to $1 includes field \"$2\" ($3).", - range->start, range->end - 1, field->name(), field->number())); - } - } - for (int j = 0; j < result->reserved_range_count(); j++) { - const Descriptor::ReservedRange* range = result->reserved_range(j); - if (range->start <= field->number() && field->number() < range->end) { - AddError(field->full_name(), proto.reserved_range(j), - DescriptorPool::ErrorCollector::NUMBER, - strings::Substitute("Field \"$0\" uses reserved number $1.", - field->name(), field->number())); - } - } - if (reserved_name_set.find(field->name()) != reserved_name_set.end()) { - AddError( - field->full_name(), proto.field(i), - DescriptorPool::ErrorCollector::NAME, - strings::Substitute("Field name \"$0\" is reserved.", field->name())); - } - - } - - // Check that extension ranges don't overlap and don't include - // reserved field numbers or names. - for (int i = 0; i < result->extension_range_count(); i++) { - const Descriptor::ExtensionRange* range1 = result->extension_range(i); - for (int j = 0; j < result->reserved_range_count(); j++) { - const Descriptor::ReservedRange* range2 = result->reserved_range(j); - if (range1->end > range2->start && range2->end > range1->start) { - AddError(result->full_name(), proto.extension_range(i), - DescriptorPool::ErrorCollector::NUMBER, - strings::Substitute("Extension range $0 to $1 overlaps with " - "reserved range $2 to $3.", - range1->start, range1->end - 1, range2->start, - range2->end - 1)); - } - } - for (int j = i + 1; j < result->extension_range_count(); j++) { - const Descriptor::ExtensionRange* range2 = result->extension_range(j); - if (range1->end > range2->start && range2->end > range1->start) { - AddError(result->full_name(), proto.extension_range(i), - DescriptorPool::ErrorCollector::NUMBER, - strings::Substitute("Extension range $0 to $1 overlaps with " - "already-defined range $2 to $3.", - range2->start, range2->end - 1, range1->start, - range1->end - 1)); - } - } - } -} - -void DescriptorBuilder::BuildFieldOrExtension(const FieldDescriptorProto& proto, - Descriptor* parent, - FieldDescriptor* result, - bool is_extension) { - const std::string& scope = - (parent == nullptr) ? file_->package() : parent->full_name(); - - // We allocate all names in a single array, and dedup them. - // We remember the indices for the potentially deduped values. - auto all_names = tables_->AllocateFieldNames( - proto.name(), scope, - proto.has_json_name() ? &proto.json_name() : nullptr); - result->all_names_ = all_names.array; - result->lowercase_name_index_ = all_names.lowercase_index; - result->camelcase_name_index_ = all_names.camelcase_index; - result->json_name_index_ = all_names.json_index; - - ValidateSymbolName(proto.name(), result->full_name(), 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() && - file_->syntax() != FileDescriptor::SYNTAX_PROTO3) { - AddError(result->full_name(), proto, DescriptorPool::ErrorCollector::TYPE, - "The [proto3_optional=true] option may only be set on proto3" - "fields, not " + - result->full_name()); - } - - result->has_json_name_ = proto.has_json_name(); - - // Some compilers do not allow static_cast directly between two enum types, - // so we must cast to int first. - result->type_ = static_cast( - implicit_cast(proto.type())); - result->label_ = static_cast( - implicit_cast(proto.label())); - - if (result->label_ == FieldDescriptor::LABEL_REQUIRED) { - // An extension cannot have a required field (b/13365836). - if (result->is_extension_) { - AddError(result->full_name(), proto, - // Error location `TYPE`: we would really like to indicate - // `LABEL`, but the `ErrorLocation` enum has no entry for this, - // and we don't necessarily know about all implementations of the - // `ErrorCollector` interface to extend them to handle the new - // error location type properly. - DescriptorPool::ErrorCollector::TYPE, - "The extension " + result->full_name() + " cannot be required."); - } - } - - // Some of these may be filled in when cross-linking. - result->containing_type_ = nullptr; - result->type_once_ = nullptr; - result->default_value_enum_ = nullptr; - - result->has_default_value_ = proto.has_default_value(); - if (proto.has_default_value() && result->is_repeated()) { - AddError(result->full_name(), proto, - DescriptorPool::ErrorCollector::DEFAULT_VALUE, - "Repeated fields can't have default values."); - } - - if (proto.has_type()) { - if (proto.has_default_value()) { - char* end_pos = nullptr; - switch (result->cpp_type()) { - case FieldDescriptor::CPPTYPE_INT32: - result->default_value_int32_t_ = - strtol(proto.default_value().c_str(), &end_pos, 0); - break; - case FieldDescriptor::CPPTYPE_INT64: - result->default_value_int64_t_ = - strto64(proto.default_value().c_str(), &end_pos, 0); - break; - case FieldDescriptor::CPPTYPE_UINT32: - result->default_value_uint32_t_ = - strtoul(proto.default_value().c_str(), &end_pos, 0); - break; - case FieldDescriptor::CPPTYPE_UINT64: - result->default_value_uint64_t_ = - strtou64(proto.default_value().c_str(), &end_pos, 0); - break; - case FieldDescriptor::CPPTYPE_FLOAT: - if (proto.default_value() == "inf") { - result->default_value_float_ = - std::numeric_limits::infinity(); - } else if (proto.default_value() == "-inf") { - result->default_value_float_ = - -std::numeric_limits::infinity(); - } else if (proto.default_value() == "nan") { - result->default_value_float_ = - std::numeric_limits::quiet_NaN(); - } else { - result->default_value_float_ = io::SafeDoubleToFloat( - io::NoLocaleStrtod(proto.default_value().c_str(), &end_pos)); - } - break; - case FieldDescriptor::CPPTYPE_DOUBLE: - if (proto.default_value() == "inf") { - result->default_value_double_ = - std::numeric_limits::infinity(); - } else if (proto.default_value() == "-inf") { - result->default_value_double_ = - -std::numeric_limits::infinity(); - } else if (proto.default_value() == "nan") { - result->default_value_double_ = - std::numeric_limits::quiet_NaN(); - } else { - result->default_value_double_ = - io::NoLocaleStrtod(proto.default_value().c_str(), &end_pos); - } - break; - case FieldDescriptor::CPPTYPE_BOOL: - if (proto.default_value() == "true") { - result->default_value_bool_ = true; - } else if (proto.default_value() == "false") { - result->default_value_bool_ = false; - } else { - AddError(result->full_name(), proto, - DescriptorPool::ErrorCollector::DEFAULT_VALUE, - "Boolean default must be true or false."); - } - break; - case FieldDescriptor::CPPTYPE_ENUM: - // This will be filled in when cross-linking. - result->default_value_enum_ = nullptr; - break; - case FieldDescriptor::CPPTYPE_STRING: - if (result->type() == FieldDescriptor::TYPE_BYTES) { - result->default_value_string_ = tables_->AllocateString( - UnescapeCEscapeString(proto.default_value())); - } else { - result->default_value_string_ = - tables_->AllocateString(proto.default_value()); - } - break; - case FieldDescriptor::CPPTYPE_MESSAGE: - AddError(result->full_name(), proto, - DescriptorPool::ErrorCollector::DEFAULT_VALUE, - "Messages can't have default values."); - result->has_default_value_ = false; - result->default_generated_instance_ = nullptr; - break; - } - - if (end_pos != nullptr) { - // end_pos is only set non-null by the parsers for numeric types, - // above. This checks that the default was non-empty and had no extra - // junk after the end of the number. - if (proto.default_value().empty() || *end_pos != '\0') { - AddError(result->full_name(), proto, - DescriptorPool::ErrorCollector::DEFAULT_VALUE, - "Couldn't parse default value \"" + proto.default_value() + - "\"."); - } - } - } else { - // No explicit default value - switch (result->cpp_type()) { - case FieldDescriptor::CPPTYPE_INT32: - result->default_value_int32_t_ = 0; - break; - case FieldDescriptor::CPPTYPE_INT64: - result->default_value_int64_t_ = 0; - break; - case FieldDescriptor::CPPTYPE_UINT32: - result->default_value_uint32_t_ = 0; - break; - case FieldDescriptor::CPPTYPE_UINT64: - result->default_value_uint64_t_ = 0; - break; - case FieldDescriptor::CPPTYPE_FLOAT: - result->default_value_float_ = 0.0f; - break; - case FieldDescriptor::CPPTYPE_DOUBLE: - result->default_value_double_ = 0.0; - break; - case FieldDescriptor::CPPTYPE_BOOL: - result->default_value_bool_ = false; - break; - case FieldDescriptor::CPPTYPE_ENUM: - // This will be filled in when cross-linking. - result->default_value_enum_ = nullptr; - break; - case FieldDescriptor::CPPTYPE_STRING: - result->default_value_string_ = &internal::GetEmptyString(); - break; - case FieldDescriptor::CPPTYPE_MESSAGE: - result->default_generated_instance_ = nullptr; - break; - } - } - } - - if (result->number() <= 0) { - AddError(result->full_name(), proto, DescriptorPool::ErrorCollector::NUMBER, - "Field numbers must be positive integers."); - } else if (!is_extension && result->number() > FieldDescriptor::kMaxNumber) { - // Only validate that the number is within the valid field range if it is - // not an extension. Since extension numbers are validated with the - // extendee's valid set of extension numbers, and those are in turn - // validated against the max allowed number, the check is unnecessary for - // extension fields. - // This avoids cross-linking issues that arise when attempting to check if - // the extendee is a message_set_wire_format message, which has a higher max - // on extension numbers. - AddError(result->full_name(), proto, DescriptorPool::ErrorCollector::NUMBER, - strings::Substitute("Field numbers cannot be greater than $0.", - FieldDescriptor::kMaxNumber)); - } else if (result->number() >= FieldDescriptor::kFirstReservedNumber && - result->number() <= FieldDescriptor::kLastReservedNumber) { - AddError(result->full_name(), proto, DescriptorPool::ErrorCollector::NUMBER, - strings::Substitute( - "Field numbers $0 through $1 are reserved for the protocol " - "buffer library implementation.", - FieldDescriptor::kFirstReservedNumber, - FieldDescriptor::kLastReservedNumber)); - } - - if (is_extension) { - if (!proto.has_extendee()) { - AddError(result->full_name(), proto, - DescriptorPool::ErrorCollector::EXTENDEE, - "FieldDescriptorProto.extendee not set for extension field."); - } - - 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."); - } - } else { - if (proto.has_extendee()) { - AddError(result->full_name(), proto, - DescriptorPool::ErrorCollector::EXTENDEE, - "FieldDescriptorProto.extendee set for non-extension field."); - } - - result->containing_type_ = parent; - - if (proto.has_oneof_index()) { - if (proto.oneof_index() < 0 || - proto.oneof_index() >= parent->oneof_decl_count()) { - AddError(result->full_name(), proto, - DescriptorPool::ErrorCollector::TYPE, - strings::Substitute("FieldDescriptorProto.oneof_index $0 is " - "out of range for type \"$1\".", - proto.oneof_index(), parent->name())); - } else { - result->is_oneof_ = true; - result->scope_.containing_oneof = - parent->oneof_decl(proto.oneof_index()); - } - } - } - - // Copy options. - result->options_ = nullptr; // Set to default_instance later if necessary. - if (proto.has_options()) { - AllocateOptions(proto.options(), result, - FieldDescriptorProto::kOptionsFieldNumber, - "google.protobuf.FieldOptions"); - } - - - AddSymbol(result->full_name(), parent, result->name(), proto, Symbol(result)); -} - -void DescriptorBuilder::BuildExtensionRange( - const DescriptorProto::ExtensionRange& proto, const Descriptor* parent, - Descriptor::ExtensionRange* result) { - result->start = proto.start(); - result->end = proto.end(); - if (result->start <= 0) { - AddError(parent->full_name(), proto, DescriptorPool::ErrorCollector::NUMBER, - "Extension numbers must be positive integers."); - } - - // Checking of the upper bound of the extension range is deferred until after - // options interpreting. This allows messages with message_set_wire_format to - // have extensions beyond FieldDescriptor::kMaxNumber, since the extension - // numbers are actually used as int32s in the message_set_wire_format. - - if (result->start >= result->end) { - AddError(parent->full_name(), proto, DescriptorPool::ErrorCollector::NUMBER, - "Extension range end number must be greater than start number."); - } - - result->options_ = nullptr; // Set to default_instance later if necessary. - if (proto.has_options()) { - std::vector options_path; - parent->GetLocationPath(&options_path); - options_path.push_back(DescriptorProto::kExtensionRangeFieldNumber); - // find index of this extension range in order to compute path - int index; - for (index = 0; parent->extension_ranges_ + index != result; index++) { - } - options_path.push_back(index); - options_path.push_back(DescriptorProto_ExtensionRange::kOptionsFieldNumber); - AllocateOptionsImpl(parent->full_name(), parent->full_name(), - proto.options(), result, options_path, - "google.protobuf.ExtensionRangeOptions"); - } -} - -void DescriptorBuilder::BuildReservedRange( - const DescriptorProto::ReservedRange& proto, const Descriptor* parent, - Descriptor::ReservedRange* result) { - result->start = proto.start(); - result->end = proto.end(); - if (result->start <= 0) { - AddError(parent->full_name(), proto, DescriptorPool::ErrorCollector::NUMBER, - "Reserved numbers must be positive integers."); - } -} - -void DescriptorBuilder::BuildReservedRange( - const EnumDescriptorProto::EnumReservedRange& proto, - const EnumDescriptor* parent, EnumDescriptor::ReservedRange* result) { - result->start = proto.start(); - result->end = proto.end(); - - if (result->start > result->end) { - AddError(parent->full_name(), proto, DescriptorPool::ErrorCollector::NUMBER, - "Reserved range end number must be greater than start number."); - } -} - -void DescriptorBuilder::BuildOneof(const OneofDescriptorProto& proto, - Descriptor* parent, - OneofDescriptor* result) { - result->all_names_ = AllocateNameStrings(parent->full_name(), proto.name()); - ValidateSymbolName(proto.name(), result->full_name(), proto); - - result->containing_type_ = parent; - - // We need to fill these in later. - result->field_count_ = 0; - result->fields_ = nullptr; - result->options_ = nullptr; - - // Copy options. - if (proto.has_options()) { - AllocateOptions(proto.options(), result, - OneofDescriptorProto::kOptionsFieldNumber, - "google.protobuf.OneofOptions"); - } - - AddSymbol(result->full_name(), parent, result->name(), proto, Symbol(result)); -} - -void DescriptorBuilder::CheckEnumValueUniqueness( - const EnumDescriptorProto& proto, const EnumDescriptor* result) { - - // Check that enum labels are still unique when we remove the enum prefix from - // values that have it. - // - // This will fail for something like: - // - // enum MyEnum { - // MY_ENUM_FOO = 0; - // FOO = 1; - // } - // - // By enforcing this reasonable constraint, we allow code generators to strip - // the prefix and/or PascalCase it without creating conflicts. This can lead - // to much nicer language-specific enums like: - // - // enum NameType { - // FirstName = 1, - // LastName = 2, - // } - // - // Instead of: - // - // enum NameType { - // NAME_TYPE_FIRST_NAME = 1, - // NAME_TYPE_LAST_NAME = 2, - // } - PrefixRemover remover(result->name()); - std::map values; - for (int i = 0; i < result->value_count(); i++) { - const EnumValueDescriptor* value = result->value(i); - std::string stripped = - EnumValueToPascalCase(remover.MaybeRemove(value->name())); - std::pair::iterator, bool> - insert_result = values.insert(std::make_pair(stripped, value)); - bool inserted = insert_result.second; - - // We don't throw the error if the two conflicting symbols are identical, or - // if they map to the same number. In the former case, the normal symbol - // duplication error will fire so we don't need to (and its error message - // will make more sense). We allow the latter case so users can create - // aliases which add or remove the prefix (code generators that do prefix - // stripping should de-dup the labels in this case). - if (!inserted && insert_result.first->second->name() != value->name() && - insert_result.first->second->number() != value->number()) { - std::string error_message = - "Enum name " + value->name() + " has the same name as " + - values[stripped]->name() + - " if you ignore case and strip out the enum name prefix (if any). " - "This is error-prone and can lead to undefined behavior. " - "Please avoid doing this. If you are using allow_alias, please " - "assign the same numeric value to both enums."; - // There are proto2 enums out there with conflicting names, so to preserve - // compatibility we issue only a warning for proto2. - if (result->file()->syntax() == FileDescriptor::SYNTAX_PROTO2) { - AddWarning(value->full_name(), proto.value(i), - DescriptorPool::ErrorCollector::NAME, error_message); - } else { - AddError(value->full_name(), proto.value(i), - DescriptorPool::ErrorCollector::NAME, error_message); - } - } - } -} - -void DescriptorBuilder::BuildEnum(const EnumDescriptorProto& proto, - const Descriptor* parent, - EnumDescriptor* result) { - const std::string& scope = - (parent == nullptr) ? file_->package() : parent->full_name(); - - result->all_names_ = AllocateNameStrings(scope, proto.name()); - ValidateSymbolName(proto.name(), result->full_name(), proto); - result->file_ = file_; - result->containing_type_ = parent; - result->is_placeholder_ = false; - result->is_unqualified_placeholder_ = false; - - if (proto.value_size() == 0) { - // We cannot allow enums with no values because this would mean there - // would be no valid default value for fields of this type. - AddError(result->full_name(), proto, DescriptorPool::ErrorCollector::NAME, - "Enums must contain at least one value."); - } - - // Calculate the continuous sequence of the labels. - // These can be fast-path'd during lookup and don't need to be added to the - // tables. - // We use uint16_t to save space for sequential_value_limit_, so stop before - // overflowing it. Worst case, we are not taking full advantage on huge - // enums, but it is unlikely. - for (int i = 0; - i < std::numeric_limits::max() && i < proto.value_size() && - // We do the math in int64_t to avoid overflows. - proto.value(i).number() == - static_cast(i) + proto.value(0).number(); - ++i) { - result->sequential_value_limit_ = i; - } - - BUILD_ARRAY(proto, result, value, BuildEnumValue, result); - BUILD_ARRAY(proto, result, reserved_range, BuildReservedRange, result); - - // Copy reserved names. - int reserved_name_count = proto.reserved_name_size(); - result->reserved_name_count_ = reserved_name_count; - result->reserved_names_ = - tables_->AllocateArray(reserved_name_count); - for (int i = 0; i < reserved_name_count; ++i) { - result->reserved_names_[i] = - tables_->AllocateString(proto.reserved_name(i)); - } - - CheckEnumValueUniqueness(proto, result); - - // Copy options. - result->options_ = nullptr; // Set to default_instance later if necessary. - if (proto.has_options()) { - AllocateOptions(proto.options(), result, - EnumDescriptorProto::kOptionsFieldNumber, - "google.protobuf.EnumOptions"); - } - - AddSymbol(result->full_name(), parent, result->name(), proto, Symbol(result)); - - for (int i = 0; i < proto.reserved_range_size(); i++) { - const EnumDescriptorProto_EnumReservedRange& range1 = - proto.reserved_range(i); - for (int j = i + 1; j < proto.reserved_range_size(); j++) { - const EnumDescriptorProto_EnumReservedRange& range2 = - proto.reserved_range(j); - if (range1.end() >= range2.start() && range2.end() >= range1.start()) { - AddError(result->full_name(), proto.reserved_range(i), - DescriptorPool::ErrorCollector::NUMBER, - strings::Substitute("Reserved range $0 to $1 overlaps with " - "already-defined range $2 to $3.", - range2.start(), range2.end(), range1.start(), - range1.end())); - } - } - } - - HASH_SET reserved_name_set; - for (int i = 0; i < proto.reserved_name_size(); i++) { - const std::string& name = proto.reserved_name(i); - if (reserved_name_set.find(name) == reserved_name_set.end()) { - reserved_name_set.insert(name); - } else { - AddError(name, proto, DescriptorPool::ErrorCollector::NAME, - strings::Substitute("Enum value \"$0\" is reserved multiple times.", - name)); - } - } - - for (int i = 0; i < result->value_count(); i++) { - const EnumValueDescriptor* value = result->value(i); - for (int j = 0; j < result->reserved_range_count(); j++) { - const EnumDescriptor::ReservedRange* range = result->reserved_range(j); - if (range->start <= value->number() && value->number() <= range->end) { - AddError(value->full_name(), proto.reserved_range(j), - DescriptorPool::ErrorCollector::NUMBER, - strings::Substitute("Enum value \"$0\" uses reserved number $1.", - value->name(), value->number())); - } - } - if (reserved_name_set.find(value->name()) != reserved_name_set.end()) { - AddError( - value->full_name(), proto.value(i), - DescriptorPool::ErrorCollector::NAME, - strings::Substitute("Enum value \"$0\" is reserved.", value->name())); - } - } -} - -void DescriptorBuilder::BuildEnumValue(const EnumValueDescriptorProto& proto, - const EnumDescriptor* parent, - EnumValueDescriptor* result) { - // Note: full_name for enum values is a sibling to the parent's name, not a - // child of it. - std::string full_name; - size_t scope_len = parent->full_name().size() - parent->name().size(); - full_name.reserve(scope_len + proto.name().size()); - full_name.append(parent->full_name().data(), scope_len); - full_name.append(proto.name()); - - result->all_names_ = - tables_->AllocateStringArray(proto.name(), std::move(full_name)); - result->number_ = proto.number(); - result->type_ = parent; - - ValidateSymbolName(proto.name(), result->full_name(), proto); - - // Copy options. - result->options_ = nullptr; // Set to default_instance later if necessary. - if (proto.has_options()) { - AllocateOptions(proto.options(), result, - EnumValueDescriptorProto::kOptionsFieldNumber, - "google.protobuf.EnumValueOptions"); - } - - // Again, enum values are weird because we makes them appear as siblings - // of the enum type instead of children of it. So, we use - // parent->containing_type() as the value's parent. - bool added_to_outer_scope = - AddSymbol(result->full_name(), parent->containing_type(), result->name(), - proto, Symbol::EnumValue(result, 0)); - - // However, we also want to be able to search for values within a single - // enum type, so we add it as a child of the enum type itself, too. - // Note: This could fail, but if it does, the error has already been - // reported by the above AddSymbol() call, so we ignore the return code. - bool added_to_inner_scope = file_tables_->AddAliasUnderParent( - parent, result->name(), Symbol::EnumValue(result, 1)); - - if (added_to_inner_scope && !added_to_outer_scope) { - // This value did not conflict with any values defined in the same enum, - // but it did conflict with some other symbol defined in the enum type's - // scope. Let's print an additional error to explain this. - std::string outer_scope; - if (parent->containing_type() == nullptr) { - outer_scope = file_->package(); - } else { - outer_scope = parent->containing_type()->full_name(); - } - - if (outer_scope.empty()) { - outer_scope = "the global scope"; - } else { - outer_scope = "\"" + outer_scope + "\""; - } - - AddError(result->full_name(), proto, DescriptorPool::ErrorCollector::NAME, - "Note that enum values use C++ scoping rules, meaning that " - "enum values are siblings of their type, not children of it. " - "Therefore, \"" + - result->name() + "\" must be unique within " + outer_scope + - ", not just within \"" + parent->name() + "\"."); - } - - // An enum is allowed to define two numbers that refer to the same value. - // FindValueByNumber() should return the first such value, so we simply - // ignore AddEnumValueByNumber()'s return code. - file_tables_->AddEnumValueByNumber(result); -} - -void DescriptorBuilder::BuildService(const ServiceDescriptorProto& proto, - const void* /* dummy */, - ServiceDescriptor* result) { - result->all_names_ = AllocateNameStrings(file_->package(), proto.name()); - result->file_ = file_; - ValidateSymbolName(proto.name(), result->full_name(), proto); - - BUILD_ARRAY(proto, result, method, BuildMethod, result); - - // Copy options. - result->options_ = nullptr; // Set to default_instance later if necessary. - if (proto.has_options()) { - AllocateOptions(proto.options(), result, - ServiceDescriptorProto::kOptionsFieldNumber, - "google.protobuf.ServiceOptions"); - } - - AddSymbol(result->full_name(), nullptr, result->name(), proto, - Symbol(result)); -} - -void DescriptorBuilder::BuildMethod(const MethodDescriptorProto& proto, - const ServiceDescriptor* parent, - MethodDescriptor* result) { - result->service_ = parent; - result->all_names_ = AllocateNameStrings(parent->full_name(), proto.name()); - - ValidateSymbolName(proto.name(), result->full_name(), proto); - - // These will be filled in when cross-linking. - result->input_type_.Init(); - result->output_type_.Init(); - - // Copy options. - result->options_ = nullptr; // Set to default_instance later if necessary. - if (proto.has_options()) { - AllocateOptions(proto.options(), result, - MethodDescriptorProto::kOptionsFieldNumber, - "google.protobuf.MethodOptions"); - } - - result->client_streaming_ = proto.client_streaming(); - result->server_streaming_ = proto.server_streaming(); - - AddSymbol(result->full_name(), parent, result->name(), proto, Symbol(result)); -} - -#undef BUILD_ARRAY - -// ------------------------------------------------------------------- - -void DescriptorBuilder::CrossLinkFile(FileDescriptor* file, - const FileDescriptorProto& proto) { - if (file->options_ == nullptr) { - file->options_ = &FileOptions::default_instance(); - } - - for (int i = 0; i < file->message_type_count(); i++) { - CrossLinkMessage(&file->message_types_[i], proto.message_type(i)); - } - - for (int i = 0; i < file->extension_count(); i++) { - CrossLinkField(&file->extensions_[i], proto.extension(i)); - } - - for (int i = 0; i < file->enum_type_count(); i++) { - CrossLinkEnum(&file->enum_types_[i], proto.enum_type(i)); - } - - for (int i = 0; i < file->service_count(); i++) { - CrossLinkService(&file->services_[i], proto.service(i)); - } -} - -void DescriptorBuilder::CrossLinkMessage(Descriptor* message, - const DescriptorProto& proto) { - if (message->options_ == nullptr) { - message->options_ = &MessageOptions::default_instance(); - } - - for (int i = 0; i < message->nested_type_count(); i++) { - CrossLinkMessage(&message->nested_types_[i], proto.nested_type(i)); - } - - for (int i = 0; i < message->enum_type_count(); i++) { - CrossLinkEnum(&message->enum_types_[i], proto.enum_type(i)); - } - - for (int i = 0; i < message->field_count(); i++) { - CrossLinkField(&message->fields_[i], proto.field(i)); - } - - for (int i = 0; i < message->extension_count(); i++) { - CrossLinkField(&message->extensions_[i], proto.extension(i)); - } - - for (int i = 0; i < message->extension_range_count(); i++) { - CrossLinkExtensionRange(&message->extension_ranges_[i], - proto.extension_range(i)); - } - - // Set up field array for each oneof. - - // First count the number of fields per oneof. - for (int i = 0; i < message->field_count(); i++) { - const OneofDescriptor* oneof_decl = message->field(i)->containing_oneof(); - if (oneof_decl != nullptr) { - // Make sure fields belonging to the same oneof are defined consecutively. - // This enables optimizations in codegens and reflection libraries to - // skip fields in the oneof group, as only one of the field can be set. - // Note that field_count() returns how many fields in this oneof we have - // seen so far. field_count() > 0 guarantees that i > 0, so field(i-1) is - // safe. - if (oneof_decl->field_count() > 0 && - message->field(i - 1)->containing_oneof() != oneof_decl) { - AddError(message->full_name() + "." + message->field(i - 1)->name(), - proto.field(i - 1), DescriptorPool::ErrorCollector::TYPE, - strings::Substitute( - "Fields in the same oneof must be defined consecutively. " - "\"$0\" cannot be defined before the completion of the " - "\"$1\" oneof definition.", - message->field(i - 1)->name(), oneof_decl->name())); - } - // Must go through oneof_decls_ array to get a non-const version of the - // OneofDescriptor. - auto& out_oneof_decl = message->oneof_decls_[oneof_decl->index()]; - if (out_oneof_decl.field_count_ == 0) { - out_oneof_decl.fields_ = message->field(i); - } - - if (!had_errors_) { - // Verify that they are contiguous. - // This is assumed by OneofDescriptor::field(i). - // But only if there are no errors. - GOOGLE_CHECK_EQ(out_oneof_decl.fields_ + out_oneof_decl.field_count_, - message->field(i)); - } - ++out_oneof_decl.field_count_; - } - } - - // Then verify the sizes. - for (int i = 0; i < message->oneof_decl_count(); i++) { - OneofDescriptor* oneof_decl = &message->oneof_decls_[i]; - - if (oneof_decl->field_count() == 0) { - AddError(message->full_name() + "." + oneof_decl->name(), - proto.oneof_decl(i), DescriptorPool::ErrorCollector::NAME, - "Oneof must have at least one field."); - } - - if (oneof_decl->options_ == nullptr) { - oneof_decl->options_ = &OneofOptions::default_instance(); - } - } - - for (int i = 0; i < message->field_count(); i++) { - const FieldDescriptor* field = message->field(i); - if (field->proto3_optional_) { - if (!field->containing_oneof() || - !field->containing_oneof()->is_synthetic()) { - AddError(message->full_name(), proto.field(i), - DescriptorPool::ErrorCollector::OTHER, - "Fields with proto3_optional set must be " - "a member of a one-field oneof"); - } - } - } - - // Synthetic oneofs must be last. - int first_synthetic = -1; - for (int i = 0; i < message->oneof_decl_count(); i++) { - const OneofDescriptor* oneof = message->oneof_decl(i); - if (oneof->is_synthetic()) { - if (first_synthetic == -1) { - first_synthetic = i; - } - } else { - if (first_synthetic != -1) { - AddError(message->full_name(), proto.oneof_decl(i), - DescriptorPool::ErrorCollector::OTHER, - "Synthetic oneofs must be after all other oneofs"); - } - } - } - - if (first_synthetic == -1) { - message->real_oneof_decl_count_ = message->oneof_decl_count_; - } else { - message->real_oneof_decl_count_ = first_synthetic; - } -} - -void DescriptorBuilder::CrossLinkExtensionRange( - Descriptor::ExtensionRange* range, - const DescriptorProto::ExtensionRange& /*proto*/) { - if (range->options_ == nullptr) { - range->options_ = &ExtensionRangeOptions::default_instance(); - } -} - -void DescriptorBuilder::CrossLinkField(FieldDescriptor* field, - const FieldDescriptorProto& proto) { - if (field->options_ == nullptr) { - field->options_ = &FieldOptions::default_instance(); - } - - // Add the field to the lowercase-name and camelcase-name tables. - file_tables_->AddFieldByStylizedNames(field); - - if (proto.has_extendee()) { - Symbol extendee = - LookupSymbol(proto.extendee(), field->full_name(), - DescriptorPool::PLACEHOLDER_EXTENDABLE_MESSAGE); - if (extendee.IsNull()) { - AddNotDefinedError(field->full_name(), proto, - DescriptorPool::ErrorCollector::EXTENDEE, - proto.extendee()); - return; - } else if (extendee.type() != Symbol::MESSAGE) { - AddError(field->full_name(), proto, - DescriptorPool::ErrorCollector::EXTENDEE, - "\"" + proto.extendee() + "\" is not a message type."); - return; - } - field->containing_type_ = extendee.descriptor(); - - const Descriptor::ExtensionRange* extension_range = - field->containing_type()->FindExtensionRangeContainingNumber( - field->number()); - - if (extension_range == nullptr) { - // Set of valid extension numbers for MessageSet is different (< 2^32) - // from other extendees (< 2^29). If unknown deps are allowed, we may not - // have that information, and wrongly deem the extension as invalid. - auto skip_check = get_allow_unknown(pool_) && - proto.extendee() == "google.protobuf.bridge.MessageSet"; - if (!skip_check) { - AddError(field->full_name(), proto, - DescriptorPool::ErrorCollector::NUMBER, - strings::Substitute("\"$0\" does not declare $1 as an " - "extension number.", - field->containing_type()->full_name(), - field->number())); - } - } - } - - if (field->containing_oneof() != nullptr) { - if (field->label() != FieldDescriptor::LABEL_OPTIONAL) { - // Note that this error will never happen when parsing .proto files. - // It can only happen if you manually construct a FileDescriptorProto - // that is incorrect. - AddError(field->full_name(), proto, DescriptorPool::ErrorCollector::NAME, - "Fields of oneofs must themselves have label LABEL_OPTIONAL."); - } - } - - if (proto.has_type_name()) { - // Assume we are expecting a message type unless the proto contains some - // evidence that it expects an enum type. This only makes a difference if - // we end up creating a placeholder. - bool expecting_enum = (proto.type() == FieldDescriptorProto::TYPE_ENUM) || - proto.has_default_value(); - - // In case of weak fields we force building the dependency. We need to know - // if the type exist or not. If it doesn't exist we substitute Empty which - // should only be done if the type can't be found in the generated pool. - // TODO(gerbens) Ideally we should query the database directly to check - // if weak fields exist or not so that we don't need to force building - // weak dependencies. However the name lookup rules for symbols are - // somewhat complicated, so I defer it too another CL. - bool is_weak = !pool_->enforce_weak_ && proto.options().weak(); - bool is_lazy = pool_->lazily_build_dependencies_ && !is_weak; - - Symbol type = - LookupSymbol(proto.type_name(), field->full_name(), - expecting_enum ? DescriptorPool::PLACEHOLDER_ENUM - : DescriptorPool::PLACEHOLDER_MESSAGE, - LOOKUP_TYPES, !is_lazy); - - if (type.IsNull()) { - if (is_lazy) { - // Save the symbol names for later for lookup, and allocate the once - // object needed for the accessors. - std::string name = proto.type_name(); - field->type_once_ = tables_->Create(); - field->type_descriptor_.lazy_type_name = tables_->Strdup(name); - field->lazy_default_value_enum_name_ = - proto.has_default_value() ? tables_->Strdup(proto.default_value()) - : nullptr; - - // AddFieldByNumber and AddExtension are done later in this function, - // and can/must be done if the field type was not found. The related - // error checking is not necessary when in lazily_build_dependencies_ - // mode, and can't be done without building the type's descriptor, - // which we don't want to do. - file_tables_->AddFieldByNumber(field); - if (field->is_extension()) { - tables_->AddExtension(field); - } - return; - } else { - // If the type is a weak type, we change the type to a google.protobuf.Empty - // field. - if (is_weak) { - type = FindSymbol(kNonLinkedWeakMessageReplacementName); - } - if (type.IsNull()) { - AddNotDefinedError(field->full_name(), proto, - DescriptorPool::ErrorCollector::TYPE, - proto.type_name()); - return; - } - } - } - - if (!proto.has_type()) { - // Choose field type based on symbol. - if (type.type() == Symbol::MESSAGE) { - field->type_ = FieldDescriptor::TYPE_MESSAGE; - } else if (type.type() == Symbol::ENUM) { - field->type_ = FieldDescriptor::TYPE_ENUM; - } else { - AddError(field->full_name(), proto, - DescriptorPool::ErrorCollector::TYPE, - "\"" + proto.type_name() + "\" is not a type."); - return; - } - } - - if (field->cpp_type() == FieldDescriptor::CPPTYPE_MESSAGE) { - 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."); - return; - } - - if (field->has_default_value()) { - AddError(field->full_name(), proto, - DescriptorPool::ErrorCollector::DEFAULT_VALUE, - "Messages can't have default values."); - } - } else if (field->cpp_type() == FieldDescriptor::CPPTYPE_ENUM) { - 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."); - return; - } - - if (field->enum_type()->is_placeholder_) { - // We can't look up default values for placeholder types. We'll have - // to just drop them. - field->has_default_value_ = false; - } - - if (field->has_default_value()) { - // Ensure that the default value is an identifier. Parser cannot always - // verify this because it does not have complete type information. - // N.B. that this check yields better error messages but is not - // necessary for correctness (an enum symbol must be a valid identifier - // anyway), only for better errors. - if (!io::Tokenizer::IsIdentifier(proto.default_value())) { - AddError(field->full_name(), proto, - DescriptorPool::ErrorCollector::DEFAULT_VALUE, - "Default value for an enum field must be an identifier."); - } else { - // We can't just use field->enum_type()->FindValueByName() here - // because that locks the pool's mutex, which we have already locked - // at this point. - const EnumValueDescriptor* default_value = - LookupSymbolNoPlaceholder(proto.default_value(), - field->enum_type()->full_name()) - .enum_value_descriptor(); - - if (default_value != nullptr && - default_value->type() == field->enum_type()) { - field->default_value_enum_ = default_value; - } else { - AddError(field->full_name(), proto, - DescriptorPool::ErrorCollector::DEFAULT_VALUE, - "Enum type \"" + field->enum_type()->full_name() + - "\" has no value named \"" + proto.default_value() + - "\"."); - } - } - } else if (field->enum_type()->value_count() > 0) { - // All enums must have at least one value, or we would have reported - // an error elsewhere. We use the first defined value as the default - // if a default is not explicitly defined. - field->default_value_enum_ = field->enum_type()->value(0); - } - } else { - AddError(field->full_name(), proto, DescriptorPool::ErrorCollector::TYPE, - "Field with primitive type has type_name."); - } - } else { - if (field->cpp_type() == FieldDescriptor::CPPTYPE_MESSAGE || - field->cpp_type() == FieldDescriptor::CPPTYPE_ENUM) { - AddError(field->full_name(), proto, DescriptorPool::ErrorCollector::TYPE, - "Field with message or enum type missing type_name."); - } - } - - // Add the field to the fields-by-number table. - // Note: We have to do this *after* cross-linking because extensions do not - // know their containing type until now. If we're in - // lazily_build_dependencies_ mode, we're guaranteed there's no errors, so no - // risk to calling containing_type() or other accessors that will build - // dependencies. - if (!file_tables_->AddFieldByNumber(field)) { - const FieldDescriptor* conflicting_field = file_tables_->FindFieldByNumber( - field->containing_type(), field->number()); - std::string containing_type_name = - field->containing_type() == nullptr - ? "unknown" - : field->containing_type()->full_name(); - if (field->is_extension()) { - AddError(field->full_name(), proto, - DescriptorPool::ErrorCollector::NUMBER, - strings::Substitute("Extension number $0 has already been used " - "in \"$1\" by extension \"$2\".", - field->number(), containing_type_name, - conflicting_field->full_name())); - } else { - AddError(field->full_name(), proto, - DescriptorPool::ErrorCollector::NUMBER, - strings::Substitute("Field number $0 has already been used in " - "\"$1\" by field \"$2\".", - field->number(), containing_type_name, - conflicting_field->name())); - } - } else { - if (field->is_extension()) { - if (!tables_->AddExtension(field)) { - const FieldDescriptor* conflicting_field = - tables_->FindExtension(field->containing_type(), field->number()); - std::string containing_type_name = - field->containing_type() == nullptr - ? "unknown" - : field->containing_type()->full_name(); - std::string error_msg = strings::Substitute( - "Extension number $0 has already been used in \"$1\" by extension " - "\"$2\" defined in $3.", - field->number(), containing_type_name, - conflicting_field->full_name(), conflicting_field->file()->name()); - // Conflicting extension numbers should be an error. However, before - // turning this into an error we need to fix all existing broken - // protos first. - // TODO(xiaofeng): Change this to an error. - AddWarning(field->full_name(), proto, - DescriptorPool::ErrorCollector::NUMBER, error_msg); - } - } - } -} - -void DescriptorBuilder::CrossLinkEnum(EnumDescriptor* enum_type, - const EnumDescriptorProto& proto) { - if (enum_type->options_ == nullptr) { - enum_type->options_ = &EnumOptions::default_instance(); - } - - for (int i = 0; i < enum_type->value_count(); i++) { - CrossLinkEnumValue(&enum_type->values_[i], proto.value(i)); - } -} - -void DescriptorBuilder::CrossLinkEnumValue( - EnumValueDescriptor* enum_value, - const EnumValueDescriptorProto& /* proto */) { - if (enum_value->options_ == nullptr) { - enum_value->options_ = &EnumValueOptions::default_instance(); - } -} - -void DescriptorBuilder::CrossLinkService(ServiceDescriptor* service, - const ServiceDescriptorProto& proto) { - if (service->options_ == nullptr) { - service->options_ = &ServiceOptions::default_instance(); - } - - for (int i = 0; i < service->method_count(); i++) { - CrossLinkMethod(&service->methods_[i], proto.method(i)); - } -} - -void DescriptorBuilder::CrossLinkMethod(MethodDescriptor* method, - const MethodDescriptorProto& proto) { - if (method->options_ == nullptr) { - method->options_ = &MethodOptions::default_instance(); - } - - Symbol input_type = - LookupSymbol(proto.input_type(), method->full_name(), - DescriptorPool::PLACEHOLDER_MESSAGE, LOOKUP_ALL, - !pool_->lazily_build_dependencies_); - if (input_type.IsNull()) { - if (!pool_->lazily_build_dependencies_) { - AddNotDefinedError(method->full_name(), proto, - DescriptorPool::ErrorCollector::INPUT_TYPE, - proto.input_type()); - } else { - method->input_type_.SetLazy(proto.input_type(), file_); - } - } else if (input_type.type() != Symbol::MESSAGE) { - AddError(method->full_name(), proto, - DescriptorPool::ErrorCollector::INPUT_TYPE, - "\"" + proto.input_type() + "\" is not a message type."); - } else { - method->input_type_.Set(input_type.descriptor()); - } - - Symbol output_type = - LookupSymbol(proto.output_type(), method->full_name(), - DescriptorPool::PLACEHOLDER_MESSAGE, LOOKUP_ALL, - !pool_->lazily_build_dependencies_); - if (output_type.IsNull()) { - if (!pool_->lazily_build_dependencies_) { - AddNotDefinedError(method->full_name(), proto, - DescriptorPool::ErrorCollector::OUTPUT_TYPE, - proto.output_type()); - } else { - method->output_type_.SetLazy(proto.output_type(), file_); - } - } else if (output_type.type() != Symbol::MESSAGE) { - AddError(method->full_name(), proto, - DescriptorPool::ErrorCollector::OUTPUT_TYPE, - "\"" + proto.output_type() + "\" is not a message type."); - } else { - method->output_type_.Set(output_type.descriptor()); - } -} - -// ------------------------------------------------------------------- - -#define VALIDATE_OPTIONS_FROM_ARRAY(descriptor, array_name, type) \ - for (int i = 0; i < descriptor->array_name##_count(); ++i) { \ - Validate##type##Options(descriptor->array_name##s_ + i, \ - proto.array_name(i)); \ - } - -// Determine if the file uses optimize_for = LITE_RUNTIME, being careful to -// avoid problems that exist at init time. -static bool IsLite(const FileDescriptor* file) { - // TODO(kenton): I don't even remember how many of these conditions are - // actually possible. I'm just being super-safe. - return file != nullptr && - &file->options() != &FileOptions::default_instance() && - file->options().optimize_for() == FileOptions::LITE_RUNTIME; -} - -void DescriptorBuilder::ValidateFileOptions(FileDescriptor* file, - const FileDescriptorProto& proto) { - VALIDATE_OPTIONS_FROM_ARRAY(file, message_type, Message); - VALIDATE_OPTIONS_FROM_ARRAY(file, enum_type, Enum); - VALIDATE_OPTIONS_FROM_ARRAY(file, service, Service); - VALIDATE_OPTIONS_FROM_ARRAY(file, extension, Field); - - // Lite files can only be imported by other Lite files. - if (!IsLite(file)) { - for (int i = 0; i < file->dependency_count(); i++) { - if (IsLite(file->dependency(i))) { - AddError( - file->dependency(i)->name(), proto, - DescriptorPool::ErrorCollector::IMPORT, - "Files that do not use optimize_for = LITE_RUNTIME cannot import " - "files which do use this option. This file is not lite, but it " - "imports \"" + - file->dependency(i)->name() + "\" which is."); - break; - } - } - } - if (file->syntax() == FileDescriptor::SYNTAX_PROTO3) { - ValidateProto3(file, proto); - } -} - -void DescriptorBuilder::ValidateProto3(FileDescriptor* file, - const FileDescriptorProto& proto) { - for (int i = 0; i < file->extension_count(); ++i) { - ValidateProto3Field(file->extensions_ + i, proto.extension(i)); - } - for (int i = 0; i < file->message_type_count(); ++i) { - ValidateProto3Message(file->message_types_ + i, proto.message_type(i)); - } - for (int i = 0; i < file->enum_type_count(); ++i) { - ValidateProto3Enum(file->enum_types_ + i, proto.enum_type(i)); - } -} - -static std::string ToLowercaseWithoutUnderscores(const std::string& name) { - std::string result; - for (char character : name) { - if (character != '_') { - if (character >= 'A' && character <= 'Z') { - result.push_back(character - 'A' + 'a'); - } else { - result.push_back(character); - } - } - } - return result; -} - -void DescriptorBuilder::ValidateProto3Message(Descriptor* message, - const DescriptorProto& proto) { - for (int i = 0; i < message->nested_type_count(); ++i) { - ValidateProto3Message(message->nested_types_ + i, proto.nested_type(i)); - } - for (int i = 0; i < message->enum_type_count(); ++i) { - ValidateProto3Enum(message->enum_types_ + i, proto.enum_type(i)); - } - for (int i = 0; i < message->field_count(); ++i) { - ValidateProto3Field(message->fields_ + i, proto.field(i)); - } - for (int i = 0; i < message->extension_count(); ++i) { - ValidateProto3Field(message->extensions_ + i, proto.extension(i)); - } - if (message->extension_range_count() > 0) { - AddError(message->full_name(), proto.extension_range(0), - DescriptorPool::ErrorCollector::NUMBER, - "Extension ranges are not allowed in proto3."); - } - if (message->options().message_set_wire_format()) { - // Using MessageSet doesn't make sense since we disallow extensions. - AddError(message->full_name(), proto, DescriptorPool::ErrorCollector::NAME, - "MessageSet is not supported in proto3."); - } - - // In proto3, we reject field names if they conflict in camelCase. - // Note that we currently enforce a stricter rule: Field names must be - // unique after being converted to lowercase with underscores removed. - std::map name_to_field; - for (int i = 0; i < message->field_count(); ++i) { - std::string lowercase_name = - ToLowercaseWithoutUnderscores(message->field(i)->name()); - if (name_to_field.find(lowercase_name) != name_to_field.end()) { - AddError(message->full_name(), proto.field(i), - DescriptorPool::ErrorCollector::NAME, - "The JSON camel-case name of field \"" + - message->field(i)->name() + "\" conflicts with field \"" + - name_to_field[lowercase_name]->name() + "\". This is not " + - "allowed in proto3."); - } else { - name_to_field[lowercase_name] = message->field(i); - } - } -} - -void DescriptorBuilder::ValidateProto3Field(FieldDescriptor* field, - const FieldDescriptorProto& proto) { - if (field->is_extension() && - !AllowedExtendeeInProto3(field->containing_type()->full_name())) { - AddError(field->full_name(), proto, - DescriptorPool::ErrorCollector::EXTENDEE, - "Extensions in proto3 are only allowed for defining options."); - } - if (field->is_required()) { - AddError(field->full_name(), proto, DescriptorPool::ErrorCollector::TYPE, - "Required fields are not allowed in proto3."); - } - if (field->has_default_value()) { - AddError(field->full_name(), proto, - DescriptorPool::ErrorCollector::DEFAULT_VALUE, - "Explicit default values are not allowed in proto3."); - } - if (field->cpp_type() == FieldDescriptor::CPPTYPE_ENUM && - field->enum_type() && - field->enum_type()->file()->syntax() != FileDescriptor::SYNTAX_PROTO3 && - field->enum_type()->file()->syntax() != FileDescriptor::SYNTAX_UNKNOWN) { - // Proto3 messages can only use Proto3 enum types; otherwise we can't - // guarantee that the default value is zero. - AddError(field->full_name(), proto, DescriptorPool::ErrorCollector::TYPE, - "Enum type \"" + field->enum_type()->full_name() + - "\" is not a proto3 enum, but is used in \"" + - field->containing_type()->full_name() + - "\" which is a proto3 message type."); - } - if (field->type() == FieldDescriptor::TYPE_GROUP) { - AddError(field->full_name(), proto, DescriptorPool::ErrorCollector::TYPE, - "Groups are not supported in proto3 syntax."); - } -} - -void DescriptorBuilder::ValidateProto3Enum(EnumDescriptor* enm, - const EnumDescriptorProto& proto) { - if (enm->value_count() > 0 && enm->value(0)->number() != 0) { - AddError(enm->full_name(), proto.value(0), - DescriptorPool::ErrorCollector::NUMBER, - "The first enum value must be zero in proto3."); - } -} - -void DescriptorBuilder::ValidateMessageOptions(Descriptor* message, - const DescriptorProto& proto) { - VALIDATE_OPTIONS_FROM_ARRAY(message, field, Field); - VALIDATE_OPTIONS_FROM_ARRAY(message, nested_type, Message); - VALIDATE_OPTIONS_FROM_ARRAY(message, enum_type, Enum); - VALIDATE_OPTIONS_FROM_ARRAY(message, extension, Field); - - const int64_t max_extension_range = - static_cast(message->options().message_set_wire_format() - ? std::numeric_limits::max() - : FieldDescriptor::kMaxNumber); - for (int i = 0; i < message->extension_range_count(); ++i) { - if (message->extension_range(i)->end > max_extension_range + 1) { - AddError(message->full_name(), proto.extension_range(i), - DescriptorPool::ErrorCollector::NUMBER, - strings::Substitute("Extension numbers cannot be greater than $0.", - max_extension_range)); - } - - ValidateExtensionRangeOptions(message->full_name(), - message->extension_ranges_ + i, - proto.extension_range(i)); - } -} - - -void DescriptorBuilder::ValidateFieldOptions( - FieldDescriptor* field, const FieldDescriptorProto& proto) { - if (pool_->lazily_build_dependencies_ && (!field || !field->message_type())) { - return; - } - // Only message type fields may be lazy. - if (field->options().lazy()) { - if (field->type() != FieldDescriptor::TYPE_MESSAGE) { - AddError(field->full_name(), proto, DescriptorPool::ErrorCollector::TYPE, - "[lazy = true] can only be specified for submessage fields."); - } - } - - // Only repeated primitive fields may be packed. - if (field->options().packed() && !field->is_packable()) { - AddError( - field->full_name(), proto, DescriptorPool::ErrorCollector::TYPE, - "[packed = true] can only be specified for repeated primitive fields."); - } - - // Note: Default instance may not yet be initialized here, so we have to - // avoid reading from it. - if (field->containing_type_ != nullptr && - &field->containing_type()->options() != - &MessageOptions::default_instance() && - field->containing_type()->options().message_set_wire_format()) { - if (field->is_extension()) { - if (!field->is_optional() || - field->type() != FieldDescriptor::TYPE_MESSAGE) { - AddError(field->full_name(), proto, - DescriptorPool::ErrorCollector::TYPE, - "Extensions of MessageSets must be optional messages."); - } - } else { - AddError(field->full_name(), proto, DescriptorPool::ErrorCollector::NAME, - "MessageSets cannot have fields, only extensions."); - } - } - - // Lite extensions can only be of Lite types. - if (IsLite(field->file()) && field->containing_type_ != nullptr && - !IsLite(field->containing_type()->file())) { - AddError(field->full_name(), proto, - DescriptorPool::ErrorCollector::EXTENDEE, - "Extensions to non-lite types can only be declared in non-lite " - "files. Note that you cannot extend a non-lite type to contain " - "a lite type, but the reverse is allowed."); - } - - // Validate map types. - if (field->is_map()) { - if (!ValidateMapEntry(field, proto)) { - AddError(field->full_name(), proto, DescriptorPool::ErrorCollector::TYPE, - "map_entry should not be set explicitly. Use map instead."); - } - } - - ValidateJSType(field, proto); - - // json_name option is not allowed on extension fields. Note that the - // json_name field in FieldDescriptorProto is always populated by protoc - // when it sends descriptor data to plugins (calculated from field name if - // the option is not explicitly set) so we can't rely on its presence to - // determine whether the json_name option is set on the field. Here we - // compare it against the default calculated json_name value and consider - // the option set if they are different. This won't catch the case when - // an user explicitly sets json_name to the default value, but should be - // good enough to catch common misuses. - if (field->is_extension() && - (field->has_json_name() && - field->json_name() != ToJsonName(field->name()))) { - AddError(field->full_name(), proto, - DescriptorPool::ErrorCollector::OPTION_NAME, - "option json_name is not allowed on extension fields."); - } - -} - -void DescriptorBuilder::ValidateEnumOptions(EnumDescriptor* enm, - const EnumDescriptorProto& proto) { - VALIDATE_OPTIONS_FROM_ARRAY(enm, value, EnumValue); - if (!enm->options().has_allow_alias() || !enm->options().allow_alias()) { - std::map used_values; - for (int i = 0; i < enm->value_count(); ++i) { - const EnumValueDescriptor* enum_value = enm->value(i); - if (used_values.find(enum_value->number()) != used_values.end()) { - std::string error = - "\"" + enum_value->full_name() + - "\" uses the same enum value as \"" + - used_values[enum_value->number()] + - "\". If this is intended, set " - "'option allow_alias = true;' to the enum definition."; - if (!enm->options().allow_alias()) { - // Generate error if duplicated enum values are explicitly disallowed. - AddError(enm->full_name(), proto.value(i), - DescriptorPool::ErrorCollector::NUMBER, error); - } - } else { - used_values[enum_value->number()] = enum_value->full_name(); - } - } - } -} - -void DescriptorBuilder::ValidateEnumValueOptions( - EnumValueDescriptor* /* enum_value */, - const EnumValueDescriptorProto& /* proto */) { - // Nothing to do so far. -} - -void DescriptorBuilder::ValidateExtensionRangeOptions( - const std::string& full_name, Descriptor::ExtensionRange* extension_range, - const DescriptorProto_ExtensionRange& proto) { - (void)full_name; // Parameter is used by Google-internal code. - (void)extension_range; // Parameter is used by Google-internal code. -} - -void DescriptorBuilder::ValidateServiceOptions( - ServiceDescriptor* service, const ServiceDescriptorProto& proto) { - if (IsLite(service->file()) && - (service->file()->options().cc_generic_services() || - service->file()->options().java_generic_services())) { - AddError(service->full_name(), proto, DescriptorPool::ErrorCollector::NAME, - "Files with optimize_for = LITE_RUNTIME cannot define services " - "unless you set both options cc_generic_services and " - "java_generic_services to false."); - } - - VALIDATE_OPTIONS_FROM_ARRAY(service, method, Method); -} - -void DescriptorBuilder::ValidateMethodOptions( - MethodDescriptor* /* method */, const MethodDescriptorProto& /* proto */) { - // Nothing to do so far. -} - -bool DescriptorBuilder::ValidateMapEntry(FieldDescriptor* field, - const FieldDescriptorProto& proto) { - const Descriptor* message = field->message_type(); - if ( // Must not contain extensions, extension range or nested message or - // enums - message->extension_count() != 0 || - field->label() != FieldDescriptor::LABEL_REPEATED || - message->extension_range_count() != 0 || - message->nested_type_count() != 0 || message->enum_type_count() != 0 || - // Must contain exactly two fields - message->field_count() != 2 || - // Field name and message name must match - message->name() != ToCamelCase(field->name(), false) + "Entry" || - // Entry message must be in the same containing type of the field. - field->containing_type() != message->containing_type()) { - return false; - } - - const FieldDescriptor* key = message->map_key(); - const FieldDescriptor* value = message->map_value(); - if (key->label() != FieldDescriptor::LABEL_OPTIONAL || key->number() != 1 || - key->name() != "key") { - return false; - } - if (value->label() != FieldDescriptor::LABEL_OPTIONAL || - value->number() != 2 || value->name() != "value") { - return false; - } - - // Check key types are legal. - switch (key->type()) { - case FieldDescriptor::TYPE_ENUM: - AddError(field->full_name(), proto, DescriptorPool::ErrorCollector::TYPE, - "Key in map fields cannot be enum types."); - break; - case FieldDescriptor::TYPE_FLOAT: - case FieldDescriptor::TYPE_DOUBLE: - case FieldDescriptor::TYPE_MESSAGE: - case FieldDescriptor::TYPE_GROUP: - case FieldDescriptor::TYPE_BYTES: - AddError( - field->full_name(), proto, DescriptorPool::ErrorCollector::TYPE, - "Key in map fields cannot be float/double, bytes or message types."); - break; - case FieldDescriptor::TYPE_BOOL: - case FieldDescriptor::TYPE_INT32: - case FieldDescriptor::TYPE_INT64: - case FieldDescriptor::TYPE_SINT32: - case FieldDescriptor::TYPE_SINT64: - case FieldDescriptor::TYPE_STRING: - case FieldDescriptor::TYPE_UINT32: - case FieldDescriptor::TYPE_UINT64: - case FieldDescriptor::TYPE_FIXED32: - case FieldDescriptor::TYPE_FIXED64: - case FieldDescriptor::TYPE_SFIXED32: - case FieldDescriptor::TYPE_SFIXED64: - // Legal cases - break; - // Do not add a default, so that the compiler will complain when new types - // are added. - } - - if (value->type() == FieldDescriptor::TYPE_ENUM) { - if (value->enum_type()->value(0)->number() != 0) { - AddError(field->full_name(), proto, DescriptorPool::ErrorCollector::TYPE, - "Enum value in map must define 0 as the first value."); - } - } - - return true; -} - -void DescriptorBuilder::DetectMapConflicts(const Descriptor* message, - const DescriptorProto& proto) { - std::map seen_types; - for (int i = 0; i < message->nested_type_count(); ++i) { - const Descriptor* nested = message->nested_type(i); - std::pair::iterator, bool> result = - seen_types.insert(std::make_pair(nested->name(), nested)); - if (!result.second) { - if (result.first->second->options().map_entry() || - nested->options().map_entry()) { - AddError(message->full_name(), proto, - DescriptorPool::ErrorCollector::NAME, - "Expanded map entry type " + nested->name() + - " conflicts with an existing nested message type."); - } - } - // Recursively test on the nested types. - DetectMapConflicts(message->nested_type(i), proto.nested_type(i)); - } - // Check for conflicted field names. - for (int i = 0; i < message->field_count(); ++i) { - const FieldDescriptor* field = message->field(i); - std::map::iterator iter = - seen_types.find(field->name()); - if (iter != seen_types.end() && iter->second->options().map_entry()) { - AddError(message->full_name(), proto, - DescriptorPool::ErrorCollector::NAME, - "Expanded map entry type " + iter->second->name() + - " conflicts with an existing field."); - } - } - // Check for conflicted enum names. - for (int i = 0; i < message->enum_type_count(); ++i) { - const EnumDescriptor* enum_desc = message->enum_type(i); - std::map::iterator iter = - seen_types.find(enum_desc->name()); - if (iter != seen_types.end() && iter->second->options().map_entry()) { - AddError(message->full_name(), proto, - DescriptorPool::ErrorCollector::NAME, - "Expanded map entry type " + iter->second->name() + - " conflicts with an existing enum type."); - } - } - // Check for conflicted oneof names. - for (int i = 0; i < message->oneof_decl_count(); ++i) { - const OneofDescriptor* oneof_desc = message->oneof_decl(i); - std::map::iterator iter = - seen_types.find(oneof_desc->name()); - if (iter != seen_types.end() && iter->second->options().map_entry()) { - AddError(message->full_name(), proto, - DescriptorPool::ErrorCollector::NAME, - "Expanded map entry type " + iter->second->name() + - " conflicts with an existing oneof type."); - } - } -} - -void DescriptorBuilder::ValidateJSType(FieldDescriptor* field, - const FieldDescriptorProto& proto) { - FieldOptions::JSType jstype = field->options().jstype(); - // The default is always acceptable. - if (jstype == FieldOptions::JS_NORMAL) { - return; - } - - switch (field->type()) { - // Integral 64-bit types may be represented as JavaScript numbers or - // strings. - case FieldDescriptor::TYPE_UINT64: - case FieldDescriptor::TYPE_INT64: - case FieldDescriptor::TYPE_SINT64: - case FieldDescriptor::TYPE_FIXED64: - case FieldDescriptor::TYPE_SFIXED64: - if (jstype == FieldOptions::JS_STRING || - jstype == FieldOptions::JS_NUMBER) { - return; - } - AddError(field->full_name(), proto, DescriptorPool::ErrorCollector::TYPE, - "Illegal jstype for int64, uint64, sint64, fixed64 " - "or sfixed64 field: " + - FieldOptions_JSType_descriptor()->value(jstype)->name()); - break; - - // No other types permit a jstype option. - default: - AddError(field->full_name(), proto, DescriptorPool::ErrorCollector::TYPE, - "jstype is only allowed on int64, uint64, sint64, fixed64 " - "or sfixed64 fields."); - break; - } -} - -#undef VALIDATE_OPTIONS_FROM_ARRAY - -// ------------------------------------------------------------------- - -DescriptorBuilder::OptionInterpreter::OptionInterpreter( - DescriptorBuilder* builder) - : builder_(builder) { - GOOGLE_CHECK(builder_); -} - -DescriptorBuilder::OptionInterpreter::~OptionInterpreter() {} - -bool DescriptorBuilder::OptionInterpreter::InterpretOptions( - OptionsToInterpret* options_to_interpret) { - // Note that these may be in different pools, so we can't use the same - // descriptor and reflection objects on both. - Message* options = options_to_interpret->options; - const Message* original_options = options_to_interpret->original_options; - - bool failed = false; - options_to_interpret_ = options_to_interpret; - - // Find the uninterpreted_option field in the mutable copy of the options - // and clear them, since we're about to interpret them. - const FieldDescriptor* uninterpreted_options_field = - options->GetDescriptor()->FindFieldByName("uninterpreted_option"); - GOOGLE_CHECK(uninterpreted_options_field != nullptr) - << "No field named \"uninterpreted_option\" in the Options proto."; - options->GetReflection()->ClearField(options, uninterpreted_options_field); - - std::vector src_path = options_to_interpret->element_path; - src_path.push_back(uninterpreted_options_field->number()); - - // Find the uninterpreted_option field in the original options. - const FieldDescriptor* original_uninterpreted_options_field = - original_options->GetDescriptor()->FindFieldByName( - "uninterpreted_option"); - GOOGLE_CHECK(original_uninterpreted_options_field != nullptr) - << "No field named \"uninterpreted_option\" in the Options proto."; - - const int num_uninterpreted_options = - original_options->GetReflection()->FieldSize( - *original_options, original_uninterpreted_options_field); - for (int i = 0; i < num_uninterpreted_options; ++i) { - src_path.push_back(i); - uninterpreted_option_ = down_cast( - &original_options->GetReflection()->GetRepeatedMessage( - *original_options, original_uninterpreted_options_field, i)); - if (!InterpretSingleOption(options, src_path, - options_to_interpret->element_path)) { - // Error already added by InterpretSingleOption(). - failed = true; - break; - } - src_path.pop_back(); - } - // Reset these, so we don't have any dangling pointers. - uninterpreted_option_ = nullptr; - options_to_interpret_ = nullptr; - - if (!failed) { - // InterpretSingleOption() added the interpreted options in the - // UnknownFieldSet, in case the option isn't yet known to us. Now we - // serialize the options message and deserialize it back. That way, any - // option fields that we do happen to know about will get moved from the - // UnknownFieldSet into the real fields, and thus be available right away. - // If they are not known, that's OK too. They will get reparsed into the - // UnknownFieldSet and wait there until the message is parsed by something - // that does know about the options. - - // Keep the unparsed options around in case the reparsing fails. - std::unique_ptr unparsed_options(options->New()); - options->GetReflection()->Swap(unparsed_options.get(), options); - - std::string buf; - if (!unparsed_options->AppendToString(&buf) || - !options->ParseFromString(buf)) { - builder_->AddError( - options_to_interpret->element_name, *original_options, - DescriptorPool::ErrorCollector::OTHER, - "Some options could not be correctly parsed using the proto " - "descriptors compiled into this binary.\n" - "Unparsed options: " + - unparsed_options->ShortDebugString() + - "\n" - "Parsing attempt: " + - options->ShortDebugString()); - // Restore the unparsed options. - options->GetReflection()->Swap(unparsed_options.get(), options); - } - } - - return !failed; -} - -bool DescriptorBuilder::OptionInterpreter::InterpretSingleOption( - Message* options, const std::vector& src_path, - const std::vector& options_path) { - // First do some basic validation. - if (uninterpreted_option_->name_size() == 0) { - // This should never happen unless the parser has gone seriously awry or - // someone has manually created the uninterpreted option badly. - return AddNameError("Option must have a name."); - } - if (uninterpreted_option_->name(0).name_part() == "uninterpreted_option") { - return AddNameError( - "Option must not use reserved name " - "\"uninterpreted_option\"."); - } - - const Descriptor* options_descriptor = nullptr; - // Get the options message's descriptor from the builder's pool, so that we - // get the version that knows about any extension options declared in the file - // we're currently building. The descriptor should be there as long as the - // file we're building imported descriptor.proto. - - // Note that we use DescriptorBuilder::FindSymbolNotEnforcingDeps(), not - // DescriptorPool::FindMessageTypeByName() because we're already holding the - // pool's mutex, and the latter method locks it again. We don't use - // FindSymbol() because files that use custom options only need to depend on - // the file that defines the option, not descriptor.proto itself. - Symbol symbol = builder_->FindSymbolNotEnforcingDeps( - options->GetDescriptor()->full_name()); - options_descriptor = symbol.descriptor(); - if (options_descriptor == nullptr) { - // The options message's descriptor was not in the builder's pool, so use - // the standard version from the generated pool. We're not holding the - // generated pool's mutex, so we can search it the straightforward way. - options_descriptor = options->GetDescriptor(); - } - GOOGLE_CHECK(options_descriptor); - - // We iterate over the name parts to drill into the submessages until we find - // the leaf field for the option. As we drill down we remember the current - // submessage's descriptor in |descriptor| and the next field in that - // submessage in |field|. We also track the fields we're drilling down - // through in |intermediate_fields|. As we go, we reconstruct the full option - // name in |debug_msg_name|, for use in error messages. - const Descriptor* descriptor = options_descriptor; - const FieldDescriptor* field = nullptr; - std::vector intermediate_fields; - std::string debug_msg_name = ""; - - std::vector dest_path = options_path; - - for (int i = 0; i < uninterpreted_option_->name_size(); ++i) { - builder_->undefine_resolved_name_.clear(); - const std::string& name_part = uninterpreted_option_->name(i).name_part(); - if (debug_msg_name.size() > 0) { - debug_msg_name += "."; - } - if (uninterpreted_option_->name(i).is_extension()) { - debug_msg_name += "(" + name_part + ")"; - // Search for the extension's descriptor as an extension in the builder's - // pool. Note that we use DescriptorBuilder::LookupSymbol(), not - // DescriptorPool::FindExtensionByName(), for two reasons: 1) It allows - // relative lookups, and 2) because we're already holding the pool's - // mutex, and the latter method locks it again. - symbol = - builder_->LookupSymbol(name_part, options_to_interpret_->name_scope); - field = symbol.field_descriptor(); - // If we don't find the field then the field's descriptor was not in the - // builder's pool, but there's no point in looking in the generated - // pool. We require that you import the file that defines any extensions - // you use, so they must be present in the builder's pool. - } else { - debug_msg_name += name_part; - // Search for the field's descriptor as a regular field. - field = descriptor->FindFieldByName(name_part); - } - - if (field == nullptr) { - if (get_allow_unknown(builder_->pool_)) { - // We can't find the option, but AllowUnknownDependencies() is enabled, - // so we will just leave it as uninterpreted. - AddWithoutInterpreting(*uninterpreted_option_, options); - return true; - } else if (!(builder_->undefine_resolved_name_).empty()) { - // Option is resolved to a name which is not defined. - return AddNameError( - "Option \"" + debug_msg_name + "\" is resolved to \"(" + - builder_->undefine_resolved_name_ + - ")\", which is not defined. The innermost scope is searched first " - "in name resolution. Consider using a leading '.'(i.e., \"(." + - debug_msg_name.substr(1) + - "\") to start from the outermost scope."); - } else { - return AddNameError( - "Option \"" + debug_msg_name + - "\" unknown. Ensure that your proto" + - " definition file imports the proto which defines the option."); - } - } else if (field->containing_type() != descriptor) { - if (get_is_placeholder(field->containing_type())) { - // The field is an extension of a placeholder type, so we can't - // reliably verify whether it is a valid extension to use here (e.g. - // we don't know if it is an extension of the correct *Options message, - // or if it has a valid field number, etc.). Just leave it as - // uninterpreted instead. - AddWithoutInterpreting(*uninterpreted_option_, options); - return true; - } else { - // This can only happen if, due to some insane misconfiguration of the - // pools, we find the options message in one pool but the field in - // another. This would probably imply a hefty bug somewhere. - return AddNameError("Option field \"" + debug_msg_name + - "\" is not a field or extension of message \"" + - descriptor->name() + "\"."); - } - } else { - // accumulate field numbers to form path to interpreted option - dest_path.push_back(field->number()); - - if (i < uninterpreted_option_->name_size() - 1) { - if (field->cpp_type() != FieldDescriptor::CPPTYPE_MESSAGE) { - return AddNameError("Option \"" + debug_msg_name + - "\" is an atomic type, not a message."); - } else if (field->is_repeated()) { - return AddNameError("Option field \"" + debug_msg_name + - "\" is a repeated message. Repeated message " - "options must be initialized using an " - "aggregate value."); - } else { - // Drill down into the submessage. - intermediate_fields.push_back(field); - descriptor = field->message_type(); - } - } - } - } - - // We've found the leaf field. Now we use UnknownFieldSets to set its value - // on the options message. We do so because the message may not yet know - // about its extension fields, so we may not be able to set the fields - // directly. But the UnknownFieldSets will serialize to the same wire-format - // message, so reading that message back in once the extension fields are - // known will populate them correctly. - - // First see if the option is already set. - if (!field->is_repeated() && - !ExamineIfOptionIsSet( - intermediate_fields.begin(), intermediate_fields.end(), field, - debug_msg_name, - options->GetReflection()->GetUnknownFields(*options))) { - return false; // ExamineIfOptionIsSet() already added the error. - } - - // First set the value on the UnknownFieldSet corresponding to the - // innermost message. - std::unique_ptr unknown_fields(new UnknownFieldSet()); - if (!SetOptionValue(field, unknown_fields.get())) { - return false; // SetOptionValue() already added the error. - } - - // Now wrap the UnknownFieldSet with UnknownFieldSets corresponding to all - // the intermediate messages. - for (std::vector::reverse_iterator iter = - intermediate_fields.rbegin(); - iter != intermediate_fields.rend(); ++iter) { - std::unique_ptr parent_unknown_fields( - new UnknownFieldSet()); - switch ((*iter)->type()) { - case FieldDescriptor::TYPE_MESSAGE: { - io::StringOutputStream outstr( - parent_unknown_fields->AddLengthDelimited((*iter)->number())); - io::CodedOutputStream out(&outstr); - internal::WireFormat::SerializeUnknownFields(*unknown_fields, &out); - GOOGLE_CHECK(!out.HadError()) - << "Unexpected failure while serializing option submessage " - << debug_msg_name << "\"."; - break; - } - - case FieldDescriptor::TYPE_GROUP: { - parent_unknown_fields->AddGroup((*iter)->number()) - ->MergeFrom(*unknown_fields); - break; - } - - default: - GOOGLE_LOG(FATAL) << "Invalid wire type for CPPTYPE_MESSAGE: " - << (*iter)->type(); - return false; - } - unknown_fields.reset(parent_unknown_fields.release()); - } - - // Now merge the UnknownFieldSet corresponding to the top-level message into - // the options message. - options->GetReflection()->MutableUnknownFields(options)->MergeFrom( - *unknown_fields); - - // record the element path of the interpreted option - if (field->is_repeated()) { - int index = repeated_option_counts_[dest_path]++; - dest_path.push_back(index); - } - interpreted_paths_[src_path] = dest_path; - - return true; -} - -void DescriptorBuilder::OptionInterpreter::UpdateSourceCodeInfo( - SourceCodeInfo* info) { - if (interpreted_paths_.empty()) { - // nothing to do! - return; - } - - // We find locations that match keys in interpreted_paths_ and - // 1) replace the path with the corresponding value in interpreted_paths_ - // 2) remove any subsequent sub-locations (sub-location is one whose path - // has the parent path as a prefix) - // - // To avoid quadratic behavior of removing interior rows as we go, - // we keep a copy. But we don't actually copy anything until we've - // found the first match (so if the source code info has no locations - // that need to be changed, there is zero copy overhead). - - RepeatedPtrField* locs = info->mutable_location(); - RepeatedPtrField new_locs; - bool copying = false; - - std::vector pathv; - bool matched = false; - - for (RepeatedPtrField::iterator loc = locs->begin(); - loc != locs->end(); loc++) { - if (matched) { - // see if this location is in the range to remove - bool loc_matches = true; - if (loc->path_size() < static_cast(pathv.size())) { - loc_matches = false; - } else { - for (size_t j = 0; j < pathv.size(); j++) { - if (loc->path(j) != pathv[j]) { - loc_matches = false; - break; - } - } - } - - if (loc_matches) { - // don't copy this row since it is a sub-location that we're removing - continue; - } - - matched = false; - } - - pathv.clear(); - for (int j = 0; j < loc->path_size(); j++) { - pathv.push_back(loc->path(j)); - } - - std::map, std::vector>::iterator entry = - interpreted_paths_.find(pathv); - - if (entry == interpreted_paths_.end()) { - // not a match - if (copying) { - *new_locs.Add() = *loc; - } - continue; - } - - matched = true; - - if (!copying) { - // initialize the copy we are building - copying = true; - new_locs.Reserve(locs->size()); - for (RepeatedPtrField::iterator it = - locs->begin(); - it != loc; it++) { - *new_locs.Add() = *it; - } - } - - // add replacement and update its path - SourceCodeInfo_Location* replacement = new_locs.Add(); - *replacement = *loc; - replacement->clear_path(); - for (std::vector::iterator rit = entry->second.begin(); - rit != entry->second.end(); rit++) { - replacement->add_path(*rit); - } - } - - // if we made a changed copy, put it in place - if (copying) { - *locs = new_locs; - } -} - -void DescriptorBuilder::OptionInterpreter::AddWithoutInterpreting( - const UninterpretedOption& uninterpreted_option, Message* options) { - const FieldDescriptor* field = - options->GetDescriptor()->FindFieldByName("uninterpreted_option"); - GOOGLE_CHECK(field != nullptr); - - options->GetReflection() - ->AddMessage(options, field) - ->CopyFrom(uninterpreted_option); -} - -bool DescriptorBuilder::OptionInterpreter::ExamineIfOptionIsSet( - std::vector::const_iterator - intermediate_fields_iter, - std::vector::const_iterator intermediate_fields_end, - const FieldDescriptor* innermost_field, const std::string& debug_msg_name, - const UnknownFieldSet& unknown_fields) { - // We do linear searches of the UnknownFieldSet and its sub-groups. This - // should be fine since it's unlikely that any one options structure will - // contain more than a handful of options. - - if (intermediate_fields_iter == intermediate_fields_end) { - // We're at the innermost submessage. - for (int i = 0; i < unknown_fields.field_count(); i++) { - if (unknown_fields.field(i).number() == innermost_field->number()) { - return AddNameError("Option \"" + debug_msg_name + - "\" was already set."); - } - } - return true; - } - - for (int i = 0; i < unknown_fields.field_count(); i++) { - if (unknown_fields.field(i).number() == - (*intermediate_fields_iter)->number()) { - const UnknownField* unknown_field = &unknown_fields.field(i); - FieldDescriptor::Type type = (*intermediate_fields_iter)->type(); - // Recurse into the next submessage. - switch (type) { - case FieldDescriptor::TYPE_MESSAGE: - if (unknown_field->type() == UnknownField::TYPE_LENGTH_DELIMITED) { - UnknownFieldSet intermediate_unknown_fields; - if (intermediate_unknown_fields.ParseFromString( - unknown_field->length_delimited()) && - !ExamineIfOptionIsSet(intermediate_fields_iter + 1, - intermediate_fields_end, innermost_field, - debug_msg_name, - intermediate_unknown_fields)) { - return false; // Error already added. - } - } - break; - - case FieldDescriptor::TYPE_GROUP: - if (unknown_field->type() == UnknownField::TYPE_GROUP) { - if (!ExamineIfOptionIsSet(intermediate_fields_iter + 1, - intermediate_fields_end, innermost_field, - debug_msg_name, unknown_field->group())) { - return false; // Error already added. - } - } - break; - - default: - GOOGLE_LOG(FATAL) << "Invalid wire type for CPPTYPE_MESSAGE: " << type; - return false; - } - } - } - return true; -} - -bool DescriptorBuilder::OptionInterpreter::SetOptionValue( - const FieldDescriptor* option_field, UnknownFieldSet* unknown_fields) { - // We switch on the CppType to validate. - switch (option_field->cpp_type()) { - case FieldDescriptor::CPPTYPE_INT32: - if (uninterpreted_option_->has_positive_int_value()) { - if (uninterpreted_option_->positive_int_value() > - static_cast(std::numeric_limits::max())) { - return AddValueError("Value out of range for int32 option \"" + - option_field->full_name() + "\"."); - } else { - SetInt32(option_field->number(), - uninterpreted_option_->positive_int_value(), - option_field->type(), unknown_fields); - } - } else if (uninterpreted_option_->has_negative_int_value()) { - if (uninterpreted_option_->negative_int_value() < - static_cast(std::numeric_limits::min())) { - return AddValueError("Value out of range for int32 option \"" + - option_field->full_name() + "\"."); - } else { - SetInt32(option_field->number(), - uninterpreted_option_->negative_int_value(), - option_field->type(), unknown_fields); - } - } else { - return AddValueError("Value must be integer for int32 option \"" + - option_field->full_name() + "\"."); - } - break; - - case FieldDescriptor::CPPTYPE_INT64: - if (uninterpreted_option_->has_positive_int_value()) { - if (uninterpreted_option_->positive_int_value() > - static_cast(std::numeric_limits::max())) { - return AddValueError("Value out of range for int64 option \"" + - option_field->full_name() + "\"."); - } else { - SetInt64(option_field->number(), - uninterpreted_option_->positive_int_value(), - option_field->type(), unknown_fields); - } - } else if (uninterpreted_option_->has_negative_int_value()) { - SetInt64(option_field->number(), - uninterpreted_option_->negative_int_value(), - option_field->type(), unknown_fields); - } else { - return AddValueError("Value must be integer for int64 option \"" + - option_field->full_name() + "\"."); - } - break; - - case FieldDescriptor::CPPTYPE_UINT32: - if (uninterpreted_option_->has_positive_int_value()) { - if (uninterpreted_option_->positive_int_value() > - std::numeric_limits::max()) { - return AddValueError("Value out of range for uint32 option \"" + - option_field->name() + "\"."); - } else { - SetUInt32(option_field->number(), - uninterpreted_option_->positive_int_value(), - option_field->type(), unknown_fields); - } - } else { - return AddValueError( - "Value must be non-negative integer for uint32 " - "option \"" + - option_field->full_name() + "\"."); - } - break; - - case FieldDescriptor::CPPTYPE_UINT64: - if (uninterpreted_option_->has_positive_int_value()) { - SetUInt64(option_field->number(), - uninterpreted_option_->positive_int_value(), - option_field->type(), unknown_fields); - } else { - return AddValueError( - "Value must be non-negative integer for uint64 " - "option \"" + - option_field->full_name() + "\"."); - } - break; - - case FieldDescriptor::CPPTYPE_FLOAT: { - float value; - if (uninterpreted_option_->has_double_value()) { - value = uninterpreted_option_->double_value(); - } else if (uninterpreted_option_->has_positive_int_value()) { - value = uninterpreted_option_->positive_int_value(); - } else if (uninterpreted_option_->has_negative_int_value()) { - value = uninterpreted_option_->negative_int_value(); - } else { - return AddValueError("Value must be number for float option \"" + - option_field->full_name() + "\"."); - } - unknown_fields->AddFixed32(option_field->number(), - internal::WireFormatLite::EncodeFloat(value)); - break; - } - - case FieldDescriptor::CPPTYPE_DOUBLE: { - double value; - if (uninterpreted_option_->has_double_value()) { - value = uninterpreted_option_->double_value(); - } else if (uninterpreted_option_->has_positive_int_value()) { - value = uninterpreted_option_->positive_int_value(); - } else if (uninterpreted_option_->has_negative_int_value()) { - value = uninterpreted_option_->negative_int_value(); - } else { - return AddValueError("Value must be number for double option \"" + - option_field->full_name() + "\"."); - } - unknown_fields->AddFixed64(option_field->number(), - internal::WireFormatLite::EncodeDouble(value)); - break; - } - - case FieldDescriptor::CPPTYPE_BOOL: - uint64_t value; - if (!uninterpreted_option_->has_identifier_value()) { - return AddValueError( - "Value must be identifier for boolean option " - "\"" + - option_field->full_name() + "\"."); - } - if (uninterpreted_option_->identifier_value() == "true") { - value = 1; - } else if (uninterpreted_option_->identifier_value() == "false") { - value = 0; - } else { - return AddValueError( - "Value must be \"true\" or \"false\" for boolean " - "option \"" + - option_field->full_name() + "\"."); - } - unknown_fields->AddVarint(option_field->number(), value); - break; - - case FieldDescriptor::CPPTYPE_ENUM: { - if (!uninterpreted_option_->has_identifier_value()) { - return AddValueError( - "Value must be identifier for enum-valued option " - "\"" + - option_field->full_name() + "\"."); - } - const EnumDescriptor* enum_type = option_field->enum_type(); - const std::string& value_name = uninterpreted_option_->identifier_value(); - const EnumValueDescriptor* enum_value = nullptr; - - if (enum_type->file()->pool() != DescriptorPool::generated_pool()) { - // Note that the enum value's fully-qualified name is a sibling of the - // enum's name, not a child of it. - std::string fully_qualified_name = enum_type->full_name(); - fully_qualified_name.resize(fully_qualified_name.size() - - enum_type->name().size()); - fully_qualified_name += value_name; - - // Search for the enum value's descriptor in the builder's pool. Note - // that we use DescriptorBuilder::FindSymbolNotEnforcingDeps(), not - // DescriptorPool::FindEnumValueByName() because we're already holding - // the pool's mutex, and the latter method locks it again. - Symbol symbol = - builder_->FindSymbolNotEnforcingDeps(fully_qualified_name); - if (auto* candicate_descriptor = symbol.enum_value_descriptor()) { - if (candicate_descriptor->type() != enum_type) { - return AddValueError( - "Enum type \"" + enum_type->full_name() + - "\" has no value named \"" + value_name + "\" for option \"" + - option_field->full_name() + - "\". This appears to be a value from a sibling type."); - } else { - enum_value = candicate_descriptor; - } - } - } else { - // The enum type is in the generated pool, so we can search for the - // value there. - enum_value = enum_type->FindValueByName(value_name); - } - - if (enum_value == nullptr) { - return AddValueError("Enum type \"" + - option_field->enum_type()->full_name() + - "\" has no value named \"" + value_name + - "\" for " - "option \"" + - option_field->full_name() + "\"."); - } else { - // Sign-extension is not a problem, since we cast directly from int32_t - // to uint64_t, without first going through uint32_t. - unknown_fields->AddVarint( - option_field->number(), - static_cast(static_cast(enum_value->number()))); - } - break; - } - - case FieldDescriptor::CPPTYPE_STRING: - if (!uninterpreted_option_->has_string_value()) { - return AddValueError( - "Value must be quoted string for string option " - "\"" + - option_field->full_name() + "\"."); - } - // The string has already been unquoted and unescaped by the parser. - unknown_fields->AddLengthDelimited(option_field->number(), - uninterpreted_option_->string_value()); - break; - - case FieldDescriptor::CPPTYPE_MESSAGE: - if (!SetAggregateOption(option_field, unknown_fields)) { - return false; - } - break; - } - - return true; -} - -class DescriptorBuilder::OptionInterpreter::AggregateOptionFinder - : public TextFormat::Finder { - public: - DescriptorBuilder* builder_; - - const Descriptor* FindAnyType(const Message& /*message*/, - const std::string& prefix, - const std::string& name) const override { - if (prefix != internal::kTypeGoogleApisComPrefix && - prefix != internal::kTypeGoogleProdComPrefix) { - return nullptr; - } - assert_mutex_held(builder_->pool_); - return builder_->FindSymbol(name).descriptor(); - } - - const FieldDescriptor* FindExtension(Message* message, - const std::string& name) const override { - assert_mutex_held(builder_->pool_); - const Descriptor* descriptor = message->GetDescriptor(); - Symbol result = - builder_->LookupSymbolNoPlaceholder(name, descriptor->full_name()); - if (auto* field = result.field_descriptor()) { - return field; - } else if (result.type() == Symbol::MESSAGE && - descriptor->options().message_set_wire_format()) { - const Descriptor* foreign_type = result.descriptor(); - // The text format allows MessageSet items to be specified using - // the type name, rather than the extension identifier. If the symbol - // lookup returned a Message, and the enclosing Message has - // message_set_wire_format = true, then return the message set - // extension, if one exists. - for (int i = 0; i < foreign_type->extension_count(); i++) { - const FieldDescriptor* extension = foreign_type->extension(i); - if (extension->containing_type() == descriptor && - extension->type() == FieldDescriptor::TYPE_MESSAGE && - extension->is_optional() && - extension->message_type() == foreign_type) { - // Found it. - return extension; - } - } - } - return nullptr; - } -}; - -// A custom error collector to record any text-format parsing errors -namespace { -class AggregateErrorCollector : public io::ErrorCollector { - public: - std::string error_; - - void AddError(int /* line */, int /* column */, - const std::string& message) override { - if (!error_.empty()) { - error_ += "; "; - } - error_ += message; - } - - void AddWarning(int /* line */, int /* column */, - const std::string& /* message */) override { - // Ignore warnings - } -}; -} // namespace - -// We construct a dynamic message of the type corresponding to -// option_field, parse the supplied text-format string into this -// message, and serialize the resulting message to produce the value. -bool DescriptorBuilder::OptionInterpreter::SetAggregateOption( - const FieldDescriptor* option_field, UnknownFieldSet* unknown_fields) { - if (!uninterpreted_option_->has_aggregate_value()) { - return AddValueError("Option \"" + option_field->full_name() + - "\" is a message. To set the entire message, use " - "syntax like \"" + - option_field->name() + - " = { }\". " - "To set fields within it, use " - "syntax like \"" + - option_field->name() + ".foo = value\"."); - } - - const Descriptor* type = option_field->message_type(); - std::unique_ptr dynamic(dynamic_factory_.GetPrototype(type)->New()); - GOOGLE_CHECK(dynamic.get() != nullptr) - << "Could not create an instance of " << option_field->DebugString(); - - AggregateErrorCollector collector; - AggregateOptionFinder finder; - finder.builder_ = builder_; - TextFormat::Parser parser; - parser.RecordErrorsTo(&collector); - parser.SetFinder(&finder); - if (!parser.ParseFromString(uninterpreted_option_->aggregate_value(), - dynamic.get())) { - AddValueError("Error while parsing option value for \"" + - option_field->name() + "\": " + collector.error_); - return false; - } else { - std::string serial; - dynamic->SerializeToString(&serial); // Never fails - if (option_field->type() == FieldDescriptor::TYPE_MESSAGE) { - unknown_fields->AddLengthDelimited(option_field->number(), serial); - } else { - GOOGLE_CHECK_EQ(option_field->type(), FieldDescriptor::TYPE_GROUP); - UnknownFieldSet* group = unknown_fields->AddGroup(option_field->number()); - group->ParseFromString(serial); - } - return true; - } -} - -void DescriptorBuilder::OptionInterpreter::SetInt32( - int number, int32_t value, FieldDescriptor::Type type, - UnknownFieldSet* unknown_fields) { - switch (type) { - case FieldDescriptor::TYPE_INT32: - unknown_fields->AddVarint( - number, static_cast(static_cast(value))); - break; - - case FieldDescriptor::TYPE_SFIXED32: - unknown_fields->AddFixed32(number, static_cast(value)); - break; - - case FieldDescriptor::TYPE_SINT32: - unknown_fields->AddVarint( - number, internal::WireFormatLite::ZigZagEncode32(value)); - break; - - default: - GOOGLE_LOG(FATAL) << "Invalid wire type for CPPTYPE_INT32: " << type; - break; - } -} - -void DescriptorBuilder::OptionInterpreter::SetInt64( - int number, int64_t value, FieldDescriptor::Type type, - UnknownFieldSet* unknown_fields) { - switch (type) { - case FieldDescriptor::TYPE_INT64: - unknown_fields->AddVarint(number, static_cast(value)); - break; - - case FieldDescriptor::TYPE_SFIXED64: - unknown_fields->AddFixed64(number, static_cast(value)); - break; - - case FieldDescriptor::TYPE_SINT64: - unknown_fields->AddVarint( - number, internal::WireFormatLite::ZigZagEncode64(value)); - break; - - default: - GOOGLE_LOG(FATAL) << "Invalid wire type for CPPTYPE_INT64: " << type; - break; - } -} - -void DescriptorBuilder::OptionInterpreter::SetUInt32( - int number, uint32_t value, FieldDescriptor::Type type, - UnknownFieldSet* unknown_fields) { - switch (type) { - case FieldDescriptor::TYPE_UINT32: - unknown_fields->AddVarint(number, static_cast(value)); - break; - - case FieldDescriptor::TYPE_FIXED32: - unknown_fields->AddFixed32(number, static_cast(value)); - break; - - default: - GOOGLE_LOG(FATAL) << "Invalid wire type for CPPTYPE_UINT32: " << type; - break; - } -} - -void DescriptorBuilder::OptionInterpreter::SetUInt64( - int number, uint64_t value, FieldDescriptor::Type type, - UnknownFieldSet* unknown_fields) { - switch (type) { - case FieldDescriptor::TYPE_UINT64: - unknown_fields->AddVarint(number, value); - break; - - case FieldDescriptor::TYPE_FIXED64: - unknown_fields->AddFixed64(number, value); - break; - - default: - GOOGLE_LOG(FATAL) << "Invalid wire type for CPPTYPE_UINT64: " << type; - break; - } -} - -void DescriptorBuilder::LogUnusedDependency(const FileDescriptorProto& proto, - const FileDescriptor* result) { - (void)result; // Parameter is used by Google-internal code. - - if (!unused_dependency_.empty()) { - auto itr = pool_->unused_import_track_files_.find(proto.name()); - bool is_error = - itr != pool_->unused_import_track_files_.end() && itr->second; - for (std::set::const_iterator it = - unused_dependency_.begin(); - it != unused_dependency_.end(); ++it) { - std::string error_message = "Import " + (*it)->name() + " is unused."; - if (is_error) { - AddError((*it)->name(), proto, DescriptorPool::ErrorCollector::IMPORT, - error_message); - } else { - AddWarning((*it)->name(), proto, DescriptorPool::ErrorCollector::IMPORT, - error_message); - } - } - } -} - -Symbol DescriptorPool::CrossLinkOnDemandHelper(StringPiece name, - bool expecting_enum) const { - (void)expecting_enum; // Parameter is used by Google-internal code. - auto lookup_name = std::string(name); - if (!lookup_name.empty() && lookup_name[0] == '.') { - lookup_name = lookup_name.substr(1); - } - Symbol result = tables_->FindByNameHelper(this, lookup_name); - return result; -} - -// Handle the lazy import building for a message field whose type wasn't built -// at cross link time. If that was the case, we saved the name of the type to -// be looked up when the accessor for the type was called. Set type_, -// enum_type_, message_type_, and default_value_enum_ appropriately. -void FieldDescriptor::InternalTypeOnceInit() const { - GOOGLE_CHECK(file()->finished_building_ == true); - const EnumDescriptor* enum_type = nullptr; - Symbol result = file()->pool()->CrossLinkOnDemandHelper( - type_descriptor_.lazy_type_name, type_ == FieldDescriptor::TYPE_ENUM); - if (result.type() == Symbol::MESSAGE) { - type_ = FieldDescriptor::TYPE_MESSAGE; - type_descriptor_.message_type = result.descriptor(); - } else if (result.type() == Symbol::ENUM) { - type_ = FieldDescriptor::TYPE_ENUM; - enum_type = type_descriptor_.enum_type = result.enum_descriptor(); - } - - if (enum_type) { - if (lazy_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(); - // 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) { - name = name.substr(0, last_dot) + "." + lazy_default_value_enum_name_; - } else { - name = lazy_default_value_enum_name_; - } - Symbol result = file()->pool()->CrossLinkOnDemandHelper(name, true); - default_value_enum_ = result.enum_value_descriptor(); - } else { - default_value_enum_ = nullptr; - } - 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); - } - } -} - -void FieldDescriptor::TypeOnceInit(const FieldDescriptor* to_init) { - to_init->InternalTypeOnceInit(); -} - -// message_type(), enum_type(), default_value_enum(), and type() -// all share the same internal::call_once init path to do lazy -// import building and cross linking of a field of a message. -const Descriptor* FieldDescriptor::message_type() const { - if (type_once_) { - internal::call_once(*type_once_, FieldDescriptor::TypeOnceInit, this); - } - 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_, FieldDescriptor::TypeOnceInit, this); - } - return type_ == TYPE_ENUM ? type_descriptor_.enum_type : nullptr; -} - -const EnumValueDescriptor* FieldDescriptor::default_value_enum() const { - if (type_once_) { - internal::call_once(*type_once_, FieldDescriptor::TypeOnceInit, this); - } - return default_value_enum_; -} - -const std::string& FieldDescriptor::PrintableNameForExtension() const { - const bool is_message_set_extension = - is_extension() && - containing_type()->options().message_set_wire_format() && - type() == FieldDescriptor::TYPE_MESSAGE && is_optional() && - extension_scope() == message_type(); - return is_message_set_extension ? message_type()->full_name() : full_name(); -} - -void FileDescriptor::InternalDependenciesOnceInit() const { - GOOGLE_CHECK(finished_building_ == true); - auto* names = dependencies_once_->dependencies_names; - for (int i = 0; i < dependency_count(); i++) { - if (names[i]) { - dependencies_[i] = pool_->FindFileByName(names[i]); - } - } -} - -void FileDescriptor::DependenciesOnceInit(const FileDescriptor* to_init) { - to_init->InternalDependenciesOnceInit(); -} - -const FileDescriptor* FileDescriptor::dependency(int index) const { - if (dependencies_once_) { - // Do once init for all indices, as it's unlikely only a single index would - // be called, and saves on internal::call_once allocations. - internal::call_once(dependencies_once_->once, - FileDescriptor::DependenciesOnceInit, this); - } - return dependencies_[index]; -} - -const Descriptor* MethodDescriptor::input_type() const { - return input_type_.Get(service()); -} - -const Descriptor* MethodDescriptor::output_type() const { - return output_type_.Get(service()); -} - - -namespace internal { -void LazyDescriptor::Set(const Descriptor* descriptor) { - GOOGLE_CHECK(!once_); - descriptor_ = descriptor; -} - -void LazyDescriptor::SetLazy(StringPiece name, - const FileDescriptor* file) { - // verify Init() has been called and Set hasn't been called yet. - GOOGLE_CHECK(!descriptor_); - GOOGLE_CHECK(!once_); - GOOGLE_CHECK(file && file->pool_); - GOOGLE_CHECK(file->pool_->lazily_build_dependencies_); - GOOGLE_CHECK(!file->finished_building_); - once_ = file->pool_->tables_->Create(); - lazy_name_ = file->pool_->tables_->Strdup(name); -} - -void LazyDescriptor::Once(const ServiceDescriptor* service) { - if (once_) { - internal::call_once(*once_, [&] { - auto* file = service->file(); - GOOGLE_CHECK(file->finished_building_); - descriptor_ = - file->pool_->CrossLinkOnDemandHelper(lazy_name_, false).descriptor(); - }); - } -} - -} // namespace internal - -} // namespace protobuf -} // namespace google - -#include diff --git a/extra/protobuf/protobuf-3.19.4/src/google/protobuf/descriptor.h b/extra/protobuf/protobuf-3.19.4/src/google/protobuf/descriptor.h deleted file mode 100644 index e74e355b5a38..000000000000 --- a/extra/protobuf/protobuf-3.19.4/src/google/protobuf/descriptor.h +++ /dev/null @@ -1,2417 +0,0 @@ -// Protocol Buffers - Google's data interchange format -// Copyright 2008 Google Inc. All rights reserved. -// https://developers.google.com/protocol-buffers/ -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// * Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// * Redistributions in binary form must reproduce the above -// copyright notice, this list of conditions and the following disclaimer -// in the documentation and/or other materials provided with the -// distribution. -// * Neither the name of Google Inc. nor the names of its -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -// Author: kenton@google.com (Kenton Varda) -// Based on original Protocol Buffers design by -// Sanjay Ghemawat, Jeff Dean, and others. -// -// This file contains classes which describe a type of protocol message. -// You can use a message's descriptor to learn at runtime what fields -// it contains and what the types of those fields are. The Message -// interface also allows you to dynamically access and modify individual -// fields by passing the FieldDescriptor of the field you are interested -// in. -// -// Most users will not care about descriptors, because they will write -// code specific to certain protocol types and will simply use the classes -// generated by the protocol compiler directly. Advanced users who want -// to operate on arbitrary types (not known at compile time) may want to -// read descriptors in order to learn about the contents of a message. -// A very small number of users will want to construct their own -// Descriptors, either because they are implementing Message manually or -// because they are writing something like the protocol compiler. -// -// For an example of how you might use descriptors, see the code example -// at the top of message.h. - -#ifndef GOOGLE_PROTOBUF_DESCRIPTOR_H__ -#define GOOGLE_PROTOBUF_DESCRIPTOR_H__ - -#include -#include -#include -#include -#include -#include - -#include -#include -#include -#include -#include -#include - -// TYPE_BOOL is defined in the MacOS's ConditionalMacros.h. -#ifdef TYPE_BOOL -#undef TYPE_BOOL -#endif // TYPE_BOOL - -#ifdef SWIG -#define PROTOBUF_EXPORT -#endif - - -namespace google { -namespace protobuf { - -// Defined in this file. -class Descriptor; -class FieldDescriptor; -class OneofDescriptor; -class EnumDescriptor; -class EnumValueDescriptor; -class ServiceDescriptor; -class MethodDescriptor; -class FileDescriptor; -class DescriptorDatabase; -class DescriptorPool; - -// Defined in descriptor.proto -class DescriptorProto; -class DescriptorProto_ExtensionRange; -class FieldDescriptorProto; -class OneofDescriptorProto; -class EnumDescriptorProto; -class EnumValueDescriptorProto; -class ServiceDescriptorProto; -class MethodDescriptorProto; -class FileDescriptorProto; -class MessageOptions; -class FieldOptions; -class OneofOptions; -class EnumOptions; -class EnumValueOptions; -class ExtensionRangeOptions; -class ServiceOptions; -class MethodOptions; -class FileOptions; -class UninterpretedOption; -class SourceCodeInfo; - -// Defined in message.h -class Message; -class Reflection; - -// Defined in descriptor.cc -class DescriptorBuilder; -class FileDescriptorTables; -class Symbol; - -// Defined in unknown_field_set.h. -class UnknownField; - -// Defined in command_line_interface.cc -namespace compiler { -class CommandLineInterface; -namespace cpp { -// Defined in helpers.h -class Formatter; -} // namespace cpp -} // namespace compiler - -namespace descriptor_unittest { -class DescriptorTest; -} // namespace descriptor_unittest - -// Defined in printer.h -namespace io { -class Printer; -} // namespace io - -// NB, all indices are zero-based. -struct SourceLocation { - int start_line; - int end_line; - int start_column; - int end_column; - - // Doc comments found at the source location. - // See the comments in SourceCodeInfo.Location (descriptor.proto) for details. - std::string leading_comments; - std::string trailing_comments; - std::vector leading_detached_comments; -}; - -// Options when generating machine-parsable output from a descriptor with -// DebugString(). -struct DebugStringOptions { - // include original user comments as recorded in SourceLocation entries. N.B. - // that this must be |false| by default: several other pieces of code (for - // example, the C++ code generation for fields in the proto compiler) rely on - // DebugString() output being unobstructed by user comments. - bool include_comments; - // If true, elide the braced body in the debug string. - bool elide_group_body; - bool elide_oneof_body; - - DebugStringOptions() - : include_comments(false), - elide_group_body(false), - elide_oneof_body(false) { - } -}; - -// A class to handle the simplest cases of a lazily linked descriptor -// for a message type that isn't built at the time of cross linking, -// which is needed when a pool has lazily_build_dependencies_ set. -// Must be instantiated as mutable in a descriptor. -namespace internal { - -class PROTOBUF_EXPORT LazyDescriptor { - public: - // Init function to be called at init time of a descriptor containing - // a LazyDescriptor. - void Init() { - descriptor_ = nullptr; - once_ = nullptr; - } - - // Sets the value of the descriptor if it is known during the descriptor - // building process. Not thread safe, should only be called during the - // descriptor build process. Should not be called after SetLazy has been - // called. - void Set(const Descriptor* descriptor); - - // Sets the information needed to lazily cross link the descriptor at a later - // time, SetLazy is not thread safe, should be called only once at descriptor - // build time if the symbol wasn't found and building of the file containing - // that type is delayed because lazily_build_dependencies_ is set on the pool. - // Should not be called after Set() has been called. - void SetLazy(StringPiece name, const FileDescriptor* file); - - // Returns the current value of the descriptor, thread-safe. If SetLazy(...) - // has been called, will do a one-time cross link of the type specified, - // building the descriptor file that contains the type if necessary. - inline const Descriptor* Get(const ServiceDescriptor* service) { - Once(service); - return descriptor_; - } - - private: - void Once(const ServiceDescriptor* service); - - union { - const Descriptor* descriptor_; - const char* lazy_name_; - }; - internal::once_flag* once_; -}; - -class PROTOBUF_EXPORT SymbolBase { - private: - friend class google::protobuf::Symbol; - uint8_t symbol_type_; -}; - -// Some types have more than one SymbolBase because they have multiple -// identities in the table. We can't have duplicate direct bases, so we use this -// intermediate base to do so. -// See BuildEnumValue for details. -template -class PROTOBUF_EXPORT SymbolBaseN : public SymbolBase {}; - -} // namespace internal - -// Describes a type of protocol message, or a particular group within a -// message. To obtain the Descriptor for a given message object, call -// Message::GetDescriptor(). Generated message classes also have a -// static method called descriptor() which returns the type's descriptor. -// Use DescriptorPool to construct your own descriptors. -class PROTOBUF_EXPORT Descriptor : private internal::SymbolBase { - public: - typedef DescriptorProto Proto; - - // The name of the message type, not including its scope. - const std::string& name() const; - - // The fully-qualified name of the message type, scope delimited by - // periods. For example, message type "Foo" which is declared in package - // "bar" has full name "bar.Foo". If a type "Baz" is nested within - // Foo, Baz's full_name is "bar.Foo.Baz". To get only the part that - // comes after the last '.', use name(). - const std::string& full_name() const; - - // Index of this descriptor within the file or containing type's message - // type array. - int index() const; - - // The .proto file in which this message type was defined. Never nullptr. - const FileDescriptor* file() const; - - // If this Descriptor describes a nested type, this returns the type - // in which it is nested. Otherwise, returns nullptr. - const Descriptor* containing_type() const; - - // Get options for this message type. These are specified in the .proto file - // by placing lines like "option foo = 1234;" in the message definition. - // Allowed options are defined by MessageOptions in descriptor.proto, and any - // available extensions of that message. - const MessageOptions& options() const; - - // Write the contents of this Descriptor into the given DescriptorProto. - // The target DescriptorProto must be clear before calling this; if it - // isn't, the result may be garbage. - void CopyTo(DescriptorProto* proto) const; - - // Write the contents of this descriptor in a human-readable form. Output - // will be suitable for re-parsing. - std::string DebugString() const; - - // Similar to DebugString(), but additionally takes options (e.g., - // include original user comments in output). - std::string DebugStringWithOptions(const DebugStringOptions& options) const; - - // Returns true if this is a placeholder for an unknown type. This will - // only be the case if this descriptor comes from a DescriptorPool - // with AllowUnknownDependencies() set. - bool is_placeholder() const; - - enum WellKnownType { - WELLKNOWNTYPE_UNSPECIFIED, // Not a well-known type. - - // Wrapper types. - WELLKNOWNTYPE_DOUBLEVALUE, // google.protobuf.DoubleValue - WELLKNOWNTYPE_FLOATVALUE, // google.protobuf.FloatValue - WELLKNOWNTYPE_INT64VALUE, // google.protobuf.Int64Value - WELLKNOWNTYPE_UINT64VALUE, // google.protobuf.UInt64Value - WELLKNOWNTYPE_INT32VALUE, // google.protobuf.Int32Value - WELLKNOWNTYPE_UINT32VALUE, // google.protobuf.UInt32Value - WELLKNOWNTYPE_STRINGVALUE, // google.protobuf.StringValue - WELLKNOWNTYPE_BYTESVALUE, // google.protobuf.BytesValue - WELLKNOWNTYPE_BOOLVALUE, // google.protobuf.BoolValue - - // Other well known types. - WELLKNOWNTYPE_ANY, // google.protobuf.Any - WELLKNOWNTYPE_FIELDMASK, // google.protobuf.FieldMask - WELLKNOWNTYPE_DURATION, // google.protobuf.Duration - WELLKNOWNTYPE_TIMESTAMP, // google.protobuf.Timestamp - WELLKNOWNTYPE_VALUE, // google.protobuf.Value - WELLKNOWNTYPE_LISTVALUE, // google.protobuf.ListValue - WELLKNOWNTYPE_STRUCT, // google.protobuf.Struct - - // New well-known types may be added in the future. - // Please make sure any switch() statements have a 'default' case. - __WELLKNOWNTYPE__DO_NOT_USE__ADD_DEFAULT_INSTEAD__, - }; - - WellKnownType well_known_type() const; - - // Field stuff ----------------------------------------------------- - - // The number of fields in this message type. - int field_count() const; - // Gets a field by index, where 0 <= index < field_count(). - // These are returned in the order they were defined in the .proto file. - const FieldDescriptor* field(int index) const; - - // Looks up a field by declared tag number. Returns nullptr if no such field - // exists. - const FieldDescriptor* FindFieldByNumber(int number) const; - // Looks up a field by name. Returns nullptr if no such field exists. - const FieldDescriptor* FindFieldByName(ConstStringParam name) const; - - // Looks up a field by lowercased name (as returned by lowercase_name()). - // This lookup may be ambiguous if multiple field names differ only by case, - // in which case the field returned is chosen arbitrarily from the matches. - const FieldDescriptor* FindFieldByLowercaseName( - ConstStringParam lowercase_name) const; - - // Looks up a field by camel-case name (as returned by camelcase_name()). - // This lookup may be ambiguous if multiple field names differ in a way that - // leads them to have identical camel-case names, in which case the field - // returned is chosen arbitrarily from the matches. - const FieldDescriptor* FindFieldByCamelcaseName( - ConstStringParam camelcase_name) const; - - // The number of oneofs in this message type. - int oneof_decl_count() const; - // The number of oneofs in this message type, excluding synthetic oneofs. - // Real oneofs always come first, so iterating up to real_oneof_decl_cout() - // will yield all real oneofs. - int real_oneof_decl_count() const; - // Get a oneof by index, where 0 <= index < oneof_decl_count(). - // These are returned in the order they were defined in the .proto file. - const OneofDescriptor* oneof_decl(int index) const; - - // Looks up a oneof by name. Returns nullptr if no such oneof exists. - const OneofDescriptor* FindOneofByName(ConstStringParam name) const; - - // Nested type stuff ----------------------------------------------- - - // The number of nested types in this message type. - int nested_type_count() const; - // Gets a nested type by index, where 0 <= index < nested_type_count(). - // These are returned in the order they were defined in the .proto file. - const Descriptor* nested_type(int index) const; - - // Looks up a nested type by name. Returns nullptr if no such nested type - // exists. - const Descriptor* FindNestedTypeByName(ConstStringParam name) const; - - // Enum stuff ------------------------------------------------------ - - // The number of enum types in this message type. - int enum_type_count() const; - // Gets an enum type by index, where 0 <= index < enum_type_count(). - // These are returned in the order they were defined in the .proto file. - const EnumDescriptor* enum_type(int index) const; - - // Looks up an enum type by name. Returns nullptr if no such enum type - // exists. - const EnumDescriptor* FindEnumTypeByName(ConstStringParam name) const; - - // Looks up an enum value by name, among all enum types in this message. - // Returns nullptr if no such value exists. - const EnumValueDescriptor* FindEnumValueByName(ConstStringParam name) const; - - // Extensions ------------------------------------------------------ - - // A range of field numbers which are designated for third-party - // extensions. - struct ExtensionRange { - typedef DescriptorProto_ExtensionRange Proto; - - typedef ExtensionRangeOptions OptionsType; - - // See Descriptor::CopyTo(). - void CopyTo(DescriptorProto_ExtensionRange* proto) const; - - int start; // inclusive - int end; // exclusive - - const ExtensionRangeOptions* options_; - }; - - // The number of extension ranges in this message type. - int extension_range_count() const; - // Gets an extension range by index, where 0 <= index < - // extension_range_count(). These are returned in the order they were defined - // in the .proto file. - const ExtensionRange* extension_range(int index) const; - - // Returns true if the number is in one of the extension ranges. - bool IsExtensionNumber(int number) const; - - // Returns nullptr if no extension range contains the given number. - const ExtensionRange* FindExtensionRangeContainingNumber(int number) const; - - // The number of extensions defined nested within this message type's scope. - // See doc: - // https://developers.google.com/protocol-buffers/docs/proto#nested-extensions - // - // Note that the extensions may be extending *other* messages. - // - // For example: - // message M1 { - // extensions 1 to max; - // } - // - // message M2 { - // extend M1 { - // optional int32 foo = 1; - // } - // } - // - // In this case, - // DescriptorPool::generated_pool() - // ->FindMessageTypeByName("M2") - // ->extension(0) - // will return "foo", even though "foo" is an extension of M1. - // To find all known extensions of a given message, instead use - // DescriptorPool::FindAllExtensions. - int extension_count() const; - // Get an extension by index, where 0 <= index < extension_count(). - // These are returned in the order they were defined in the .proto file. - const FieldDescriptor* extension(int index) const; - - // Looks up a named extension (which extends some *other* message type) - // defined within this message type's scope. - const FieldDescriptor* FindExtensionByName(ConstStringParam name) const; - - // Similar to FindFieldByLowercaseName(), but finds extensions defined within - // this message type's scope. - const FieldDescriptor* FindExtensionByLowercaseName( - ConstStringParam name) const; - - // Similar to FindFieldByCamelcaseName(), but finds extensions defined within - // this message type's scope. - const FieldDescriptor* FindExtensionByCamelcaseName( - ConstStringParam name) const; - - // Reserved fields ------------------------------------------------- - - // A range of reserved field numbers. - struct ReservedRange { - int start; // inclusive - int end; // exclusive - }; - - // The number of reserved ranges in this message type. - int reserved_range_count() const; - // Gets an reserved range by index, where 0 <= index < - // reserved_range_count(). These are returned in the order they were defined - // in the .proto file. - const ReservedRange* reserved_range(int index) const; - - // Returns true if the number is in one of the reserved ranges. - bool IsReservedNumber(int number) const; - - // Returns nullptr if no reserved range contains the given number. - const ReservedRange* FindReservedRangeContainingNumber(int number) const; - - // The number of reserved field names in this message type. - int reserved_name_count() const; - - // Gets a reserved name by index, where 0 <= index < reserved_name_count(). - const std::string& reserved_name(int index) const; - - // Returns true if the field name is reserved. - bool IsReservedName(ConstStringParam name) const; - - // Source Location --------------------------------------------------- - - // Updates |*out_location| to the source location of the complete - // extent of this message declaration. Returns false and leaves - // |*out_location| unchanged iff location information was not available. - bool GetSourceLocation(SourceLocation* out_location) const; - - // Maps -------------------------------------------------------------- - - // Returns the FieldDescriptor for the "key" field. If this isn't a map entry - // field, returns nullptr. - const FieldDescriptor* map_key() const; - - // Returns the FieldDescriptor for the "value" field. If this isn't a map - // entry field, returns nullptr. - const FieldDescriptor* map_value() const; - - private: - friend class Symbol; - typedef MessageOptions OptionsType; - - // Allows tests to test CopyTo(proto, true). - friend class descriptor_unittest::DescriptorTest; - - // Allows access to GetLocationPath for annotations. - friend class io::Printer; - friend class compiler::cpp::Formatter; - - // Fill the json_name field of FieldDescriptorProto. - void CopyJsonNameTo(DescriptorProto* proto) const; - - // Internal version of DebugString; controls the level of indenting for - // correct depth. Takes |options| to control debug-string options, and - // |include_opening_clause| to indicate whether the "message ... " part of the - // clause has already been generated (this varies depending on context). - void DebugString(int depth, std::string* contents, - const DebugStringOptions& options, - bool include_opening_clause) const; - - // Walks up the descriptor tree to generate the source location path - // to this descriptor from the file root. - void GetLocationPath(std::vector* output) const; - - // True if this is a placeholder for an unknown type. - bool is_placeholder_ : 1; - // True if this is a placeholder and the type name wasn't fully-qualified. - bool is_unqualified_placeholder_ : 1; - // Well known type. Stored like this to conserve space. - uint8_t well_known_type_ : 5; - - // This points to the last field _number_ that is part of the sequence - // starting at 1, where - // `desc->field(i)->number() == i + 1` - // A value of `0` means no field matches. That is, there are no fields or the - // first field is not field `1`. - // Uses 16-bit to avoid extra padding. Unlikely to have more than 2^16 - // sequentially numbered fields in a message. - uint16_t sequential_field_limit_; - - int field_count_; - - // all_names_ = [name, full_name] - const std::string* all_names_; - const FileDescriptor* file_; - const Descriptor* containing_type_; - const MessageOptions* options_; - - // These arrays are separated from their sizes to minimize padding on 64-bit. - FieldDescriptor* fields_; - OneofDescriptor* oneof_decls_; - Descriptor* nested_types_; - EnumDescriptor* enum_types_; - ExtensionRange* extension_ranges_; - FieldDescriptor* extensions_; - ReservedRange* reserved_ranges_; - const std::string** reserved_names_; - - int oneof_decl_count_; - int real_oneof_decl_count_; - int nested_type_count_; - int enum_type_count_; - int extension_range_count_; - int extension_count_; - int reserved_range_count_; - int reserved_name_count_; - - // IMPORTANT: If you add a new field, make sure to search for all instances - // of Allocate() and AllocateArray() in descriptor.cc - // and update them to initialize the field. - - // Must be constructed using DescriptorPool. - Descriptor() {} - friend class DescriptorBuilder; - friend class DescriptorPool; - friend class EnumDescriptor; - friend class FieldDescriptor; - friend class FileDescriptorTables; - friend class OneofDescriptor; - friend class MethodDescriptor; - friend class FileDescriptor; - GOOGLE_DISALLOW_EVIL_CONSTRUCTORS(Descriptor); -}; - - -// Describes a single field of a message. To get the descriptor for a given -// field, first get the Descriptor for the message in which it is defined, -// then call Descriptor::FindFieldByName(). To get a FieldDescriptor for -// an extension, do one of the following: -// - Get the Descriptor or FileDescriptor for its containing scope, then -// call Descriptor::FindExtensionByName() or -// FileDescriptor::FindExtensionByName(). -// - Given a DescriptorPool, call DescriptorPool::FindExtensionByNumber() or -// DescriptorPool::FindExtensionByPrintableName(). -// Use DescriptorPool to construct your own descriptors. -class PROTOBUF_EXPORT FieldDescriptor : private internal::SymbolBase { - public: - typedef FieldDescriptorProto Proto; - - // Identifies a field type. 0 is reserved for errors. The order is weird - // for historical reasons. Types 12 and up are new in proto2. - enum Type { - TYPE_DOUBLE = 1, // double, exactly eight bytes on the wire. - TYPE_FLOAT = 2, // float, exactly four bytes on the wire. - TYPE_INT64 = 3, // int64, varint on the wire. Negative numbers - // take 10 bytes. Use TYPE_SINT64 if negative - // values are likely. - TYPE_UINT64 = 4, // uint64, varint on the wire. - TYPE_INT32 = 5, // int32, varint on the wire. Negative numbers - // take 10 bytes. Use TYPE_SINT32 if negative - // values are likely. - TYPE_FIXED64 = 6, // uint64, exactly eight bytes on the wire. - TYPE_FIXED32 = 7, // uint32, exactly four bytes on the wire. - TYPE_BOOL = 8, // bool, varint on the wire. - TYPE_STRING = 9, // UTF-8 text. - TYPE_GROUP = 10, // Tag-delimited message. Deprecated. - TYPE_MESSAGE = 11, // Length-delimited message. - - TYPE_BYTES = 12, // Arbitrary byte array. - TYPE_UINT32 = 13, // uint32, varint on the wire - TYPE_ENUM = 14, // Enum, varint on the wire - TYPE_SFIXED32 = 15, // int32, exactly four bytes on the wire - TYPE_SFIXED64 = 16, // int64, exactly eight bytes on the wire - TYPE_SINT32 = 17, // int32, ZigZag-encoded varint on the wire - TYPE_SINT64 = 18, // int64, ZigZag-encoded varint on the wire - - MAX_TYPE = 18, // Constant useful for defining lookup tables - // indexed by Type. - }; - - // Specifies the C++ data type used to represent the field. There is a - // fixed mapping from Type to CppType where each Type maps to exactly one - // CppType. 0 is reserved for errors. - enum CppType { - CPPTYPE_INT32 = 1, // TYPE_INT32, TYPE_SINT32, TYPE_SFIXED32 - CPPTYPE_INT64 = 2, // TYPE_INT64, TYPE_SINT64, TYPE_SFIXED64 - CPPTYPE_UINT32 = 3, // TYPE_UINT32, TYPE_FIXED32 - CPPTYPE_UINT64 = 4, // TYPE_UINT64, TYPE_FIXED64 - CPPTYPE_DOUBLE = 5, // TYPE_DOUBLE - CPPTYPE_FLOAT = 6, // TYPE_FLOAT - CPPTYPE_BOOL = 7, // TYPE_BOOL - CPPTYPE_ENUM = 8, // TYPE_ENUM - CPPTYPE_STRING = 9, // TYPE_STRING, TYPE_BYTES - CPPTYPE_MESSAGE = 10, // TYPE_MESSAGE, TYPE_GROUP - - MAX_CPPTYPE = 10, // Constant useful for defining lookup tables - // indexed by CppType. - }; - - // Identifies whether the field is optional, required, or repeated. 0 is - // reserved for errors. - enum Label { - LABEL_OPTIONAL = 1, // optional - LABEL_REQUIRED = 2, // required - LABEL_REPEATED = 3, // repeated - - MAX_LABEL = 3, // Constant useful for defining lookup tables - // indexed by Label. - }; - - // Valid field numbers are positive integers up to kMaxNumber. - static const int kMaxNumber = (1 << 29) - 1; - - // First field number reserved for the protocol buffer library implementation. - // Users may not declare fields that use reserved numbers. - static const int kFirstReservedNumber = 19000; - // Last field number reserved for the protocol buffer library implementation. - // Users may not declare fields that use reserved numbers. - static const int kLastReservedNumber = 19999; - - const std::string& name() const; // Name of this field within the message. - const std::string& full_name() const; // Fully-qualified name of the field. - const std::string& json_name() const; // JSON name of this field. - const FileDescriptor* file() const; // File in which this field was defined. - bool is_extension() const; // Is this an extension field? - int number() const; // Declared tag number. - - // Same as name() except converted to lower-case. This (and especially the - // FindFieldByLowercaseName() method) can be useful when parsing formats - // which prefer to use lowercase naming style. (Although, technically - // field names should be lowercased anyway according to the protobuf style - // guide, so this only makes a difference when dealing with old .proto files - // which do not follow the guide.) - const std::string& lowercase_name() const; - - // Same as name() except converted to camel-case. In this conversion, any - // time an underscore appears in the name, it is removed and the next - // letter is capitalized. Furthermore, the first letter of the name is - // lower-cased. Examples: - // FooBar -> fooBar - // foo_bar -> fooBar - // fooBar -> fooBar - // This (and especially the FindFieldByCamelcaseName() method) can be useful - // when parsing formats which prefer to use camel-case naming style. - const std::string& camelcase_name() const; - - Type type() const; // Declared type of this field. - const char* type_name() const; // Name of the declared type. - CppType cpp_type() const; // C++ type of this field. - const char* cpp_type_name() const; // Name of the C++ type. - Label label() const; // optional/required/repeated - - bool is_required() const; // shorthand for label() == LABEL_REQUIRED - bool is_optional() const; // shorthand for label() == LABEL_OPTIONAL - bool is_repeated() const; // shorthand for label() == LABEL_REPEATED - bool is_packable() const; // shorthand for is_repeated() && - // IsTypePackable(type()) - bool is_packed() const; // shorthand for is_packable() && - // options().packed() - bool is_map() const; // shorthand for type() == TYPE_MESSAGE && - // message_type()->options().map_entry() - - // Returns true if this field was syntactically written with "optional" in the - // .proto file. Excludes singular proto3 fields that do not have a label. - bool has_optional_keyword() const; - - // Returns true if this field tracks presence, ie. does the field - // distinguish between "unset" and "present with default value." - // This includes required, optional, and oneof fields. It excludes maps, - // repeated fields, and singular proto3 fields without "optional". - // - // For fields where has_presence() == true, the return value of - // Reflection::HasField() is semantically meaningful. - bool has_presence() const; - - // Index of this field within the message's field array, or the file or - // extension scope's extensions array. - int index() const; - - // Does this field have an explicitly-declared default value? - bool has_default_value() const; - - // Whether the user has specified the json_name field option in the .proto - // file. - bool has_json_name() const; - - // Get the field default value if cpp_type() == CPPTYPE_INT32. If no - // explicit default was defined, the default is 0. - int32_t default_value_int32_t() const; - int32_t default_value_int32() const { return default_value_int32_t(); } - // Get the field default value if cpp_type() == CPPTYPE_INT64. If no - // explicit default was defined, the default is 0. - int64_t default_value_int64_t() const; - int64_t default_value_int64() const { return default_value_int64_t(); } - // Get the field default value if cpp_type() == CPPTYPE_UINT32. If no - // explicit default was defined, the default is 0. - uint32_t default_value_uint32_t() const; - uint32_t default_value_uint32() const { return default_value_uint32_t(); } - // Get the field default value if cpp_type() == CPPTYPE_UINT64. If no - // explicit default was defined, the default is 0. - uint64_t default_value_uint64_t() const; - uint64_t default_value_uint64() const { return default_value_uint64_t(); } - // Get the field default value if cpp_type() == CPPTYPE_FLOAT. If no - // explicit default was defined, the default is 0.0. - float default_value_float() const; - // Get the field default value if cpp_type() == CPPTYPE_DOUBLE. If no - // explicit default was defined, the default is 0.0. - double default_value_double() const; - // Get the field default value if cpp_type() == CPPTYPE_BOOL. If no - // explicit default was defined, the default is false. - bool default_value_bool() const; - // Get the field default value if cpp_type() == CPPTYPE_ENUM. If no - // explicit default was defined, the default is the first value defined - // in the enum type (all enum types are required to have at least one value). - // This never returns nullptr. - const EnumValueDescriptor* default_value_enum() const; - // Get the field default value if cpp_type() == CPPTYPE_STRING. If no - // explicit default was defined, the default is the empty string. - const std::string& default_value_string() const; - - // The Descriptor for the message of which this is a field. For extensions, - // this is the extended type. Never nullptr. - const Descriptor* containing_type() const; - - // If the field is a member of a oneof, this is the one, otherwise this is - // nullptr. - const OneofDescriptor* containing_oneof() const; - - // If the field is a member of a non-synthetic oneof, returns the descriptor - // for the oneof, otherwise returns nullptr. - const OneofDescriptor* real_containing_oneof() const; - - // If the field is a member of a oneof, returns the index in that oneof. - int index_in_oneof() const; - - // An extension may be declared within the scope of another message. If this - // field is an extension (is_extension() is true), then extension_scope() - // returns that message, or nullptr if the extension was declared at global - // scope. If this is not an extension, extension_scope() is undefined (may - // assert-fail). - const Descriptor* extension_scope() const; - - // If type is TYPE_MESSAGE or TYPE_GROUP, returns a descriptor for the - // message or the group type. Otherwise, returns null. - const Descriptor* message_type() const; - // If type is TYPE_ENUM, returns a descriptor for the enum. Otherwise, - // returns null. - const EnumDescriptor* enum_type() const; - - // Get the FieldOptions for this field. This includes things listed in - // square brackets after the field definition. E.g., the field: - // optional string text = 1 [ctype=CORD]; - // has the "ctype" option set. Allowed options are defined by FieldOptions in - // descriptor.proto, and any available extensions of that message. - const FieldOptions& options() const; - - // See Descriptor::CopyTo(). - void CopyTo(FieldDescriptorProto* proto) const; - - // See Descriptor::DebugString(). - std::string DebugString() const; - - // See Descriptor::DebugStringWithOptions(). - std::string DebugStringWithOptions(const DebugStringOptions& options) const; - - // Helper method to get the CppType for a particular Type. - static CppType TypeToCppType(Type type); - - // Helper method to get the name of a Type. - static const char* TypeName(Type type); - - // Helper method to get the name of a CppType. - static const char* CppTypeName(CppType cpp_type); - - // Return true iff [packed = true] is valid for fields of this type. - static inline bool IsTypePackable(Type field_type); - - // Returns full_name() except if the field is a MessageSet extension, - // in which case it returns the full_name() of the containing message type - // for backwards compatibility with proto1. - // - // A MessageSet extension is defined as an optional message extension - // whose containing type has the message_set_wire_format option set. - // This should be true of extensions of google.protobuf.bridge.MessageSet; - // by convention, such extensions are named "message_set_extension". - // - // The opposite operation (looking up an extension's FieldDescriptor given - // its printable name) can be accomplished with - // message->file()->pool()->FindExtensionByPrintableName(message, name) - // where the extension extends "message". - const std::string& PrintableNameForExtension() const; - - // Source Location --------------------------------------------------- - - // Updates |*out_location| to the source location of the complete - // extent of this field declaration. Returns false and leaves - // |*out_location| unchanged iff location information was not available. - bool GetSourceLocation(SourceLocation* out_location) const; - - private: - friend class Symbol; - typedef FieldOptions OptionsType; - - // Allows access to GetLocationPath for annotations. - friend class io::Printer; - friend class compiler::cpp::Formatter; - friend class Reflection; - - // Fill the json_name field of FieldDescriptorProto. - void CopyJsonNameTo(FieldDescriptorProto* proto) const; - - // See Descriptor::DebugString(). - void DebugString(int depth, std::string* contents, - const DebugStringOptions& options) const; - - // formats the default value appropriately and returns it as a string. - // Must have a default value to call this. If quote_string_type is true, then - // types of CPPTYPE_STRING whill be surrounded by quotes and CEscaped. - std::string DefaultValueAsString(bool quote_string_type) const; - - // Helper function that returns the field type name for DebugString. - std::string FieldTypeNameDebugString() const; - - // Walks up the descriptor tree to generate the source location path - // to this descriptor from the file root. - void GetLocationPath(std::vector* output) const; - - // Returns true if this is a map message type. - bool is_map_message_type() const; - - bool has_default_value_ : 1; - bool proto3_optional_ : 1; - // Whether the user has specified the json_name field option in the .proto - // file. - bool has_json_name_ : 1; - bool is_extension_ : 1; - bool is_oneof_ : 1; - - // Actually a `Label` but stored as uint8_t to save space. - uint8_t label_ : 2; - - // Actually a `Type`, but stored as uint8_t to save space. - mutable uint8_t type_; - - // Logically: - // all_names_ = [name, full_name, lower, camel, json] - // However: - // duplicates will be omitted, so lower/camel/json might be in the same - // position. - // We store the true offset for each name here, and the bit width must be - // large enough to account for the worst case where all names are present. - uint8_t lowercase_name_index_ : 2; - uint8_t camelcase_name_index_ : 2; - uint8_t json_name_index_ : 3; - // Sadly, `number_` located here to reduce padding. Unrelated to all_names_ - // and its indices above. - int number_; - const std::string* all_names_; - const FileDescriptor* file_; - - internal::once_flag* type_once_; - static void TypeOnceInit(const FieldDescriptor* to_init); - void InternalTypeOnceInit() const; - const Descriptor* containing_type_; - union { - const OneofDescriptor* containing_oneof; - const Descriptor* extension_scope; - } scope_; - union { - mutable const Descriptor* message_type; - mutable const EnumDescriptor* enum_type; - const char* lazy_type_name; - } type_descriptor_; - const FieldOptions* options_; - // IMPORTANT: If you add a new field, make sure to search for all instances - // of Allocate() and AllocateArray() in - // descriptor.cc and update them to initialize the field. - - union { - int32_t default_value_int32_t_; - int64_t default_value_int64_t_; - uint32_t default_value_uint32_t_; - uint64_t default_value_uint64_t_; - float default_value_float_; - double default_value_double_; - bool default_value_bool_; - - mutable const EnumValueDescriptor* default_value_enum_; - const char* lazy_default_value_enum_name_; - const std::string* default_value_string_; - mutable std::atomic default_generated_instance_; - }; - - static const CppType kTypeToCppTypeMap[MAX_TYPE + 1]; - - static const char* const kTypeToName[MAX_TYPE + 1]; - - static const char* const kCppTypeToName[MAX_CPPTYPE + 1]; - - static const char* const kLabelToName[MAX_LABEL + 1]; - - // Must be constructed using DescriptorPool. - FieldDescriptor() {} - friend class DescriptorBuilder; - friend class FileDescriptor; - friend class Descriptor; - friend class OneofDescriptor; - GOOGLE_DISALLOW_EVIL_CONSTRUCTORS(FieldDescriptor); -}; - - -// Describes a oneof defined in a message type. -class PROTOBUF_EXPORT OneofDescriptor : private internal::SymbolBase { - public: - typedef OneofDescriptorProto Proto; - - const std::string& name() const; // Name of this oneof. - const std::string& full_name() const; // Fully-qualified name of the oneof. - - // Index of this oneof within the message's oneof array. - int index() const; - - // Returns whether this oneof was inserted by the compiler to wrap a proto3 - // optional field. If this returns true, code generators should *not* emit it. - bool is_synthetic() const; - - // The .proto file in which this oneof was defined. Never nullptr. - const FileDescriptor* file() const; - // The Descriptor for the message containing this oneof. - const Descriptor* containing_type() const; - - // The number of (non-extension) fields which are members of this oneof. - int field_count() const; - // Get a member of this oneof, in the order in which they were declared in the - // .proto file. Does not include extensions. - const FieldDescriptor* field(int index) const; - - const OneofOptions& options() const; - - // See Descriptor::CopyTo(). - void CopyTo(OneofDescriptorProto* proto) const; - - // See Descriptor::DebugString(). - std::string DebugString() const; - - // See Descriptor::DebugStringWithOptions(). - std::string DebugStringWithOptions(const DebugStringOptions& options) const; - - // Source Location --------------------------------------------------- - - // Updates |*out_location| to the source location of the complete - // extent of this oneof declaration. Returns false and leaves - // |*out_location| unchanged iff location information was not available. - bool GetSourceLocation(SourceLocation* out_location) const; - - private: - friend class Symbol; - typedef OneofOptions OptionsType; - - // Allows access to GetLocationPath for annotations. - friend class io::Printer; - friend class compiler::cpp::Formatter; - - // See Descriptor::DebugString(). - void DebugString(int depth, std::string* contents, - const DebugStringOptions& options) const; - - // Walks up the descriptor tree to generate the source location path - // to this descriptor from the file root. - void GetLocationPath(std::vector* output) const; - - int field_count_; - - // all_names_ = [name, full_name] - const std::string* all_names_; - const Descriptor* containing_type_; - const OneofOptions* options_; - const FieldDescriptor* fields_; - - // IMPORTANT: If you add a new field, make sure to search for all instances - // of Allocate() and AllocateArray() - // in descriptor.cc and update them to initialize the field. - - // Must be constructed using DescriptorPool. - OneofDescriptor() {} - friend class DescriptorBuilder; - friend class Descriptor; - GOOGLE_DISALLOW_EVIL_CONSTRUCTORS(OneofDescriptor); -}; - -// Describes an enum type defined in a .proto file. To get the EnumDescriptor -// for a generated enum type, call TypeName_descriptor(). Use DescriptorPool -// to construct your own descriptors. -class PROTOBUF_EXPORT EnumDescriptor : private internal::SymbolBase { - public: - typedef EnumDescriptorProto Proto; - - // The name of this enum type in the containing scope. - const std::string& name() const; - - // The fully-qualified name of the enum type, scope delimited by periods. - const std::string& full_name() const; - - // Index of this enum within the file or containing message's enum array. - int index() const; - - // The .proto file in which this enum type was defined. Never nullptr. - const FileDescriptor* file() const; - - // The number of values for this EnumDescriptor. Guaranteed to be greater - // than zero. - int value_count() const; - // Gets a value by index, where 0 <= index < value_count(). - // These are returned in the order they were defined in the .proto file. - const EnumValueDescriptor* value(int index) const; - - // Looks up a value by name. Returns nullptr if no such value exists. - const EnumValueDescriptor* FindValueByName(ConstStringParam name) const; - // Looks up a value by number. Returns nullptr if no such value exists. If - // multiple values have this number, the first one defined is returned. - const EnumValueDescriptor* FindValueByNumber(int number) const; - - // If this enum type is nested in a message type, this is that message type. - // Otherwise, nullptr. - const Descriptor* containing_type() const; - - // Get options for this enum type. These are specified in the .proto file by - // placing lines like "option foo = 1234;" in the enum definition. Allowed - // options are defined by EnumOptions in descriptor.proto, and any available - // extensions of that message. - const EnumOptions& options() const; - - // See Descriptor::CopyTo(). - void CopyTo(EnumDescriptorProto* proto) const; - - // See Descriptor::DebugString(). - std::string DebugString() const; - - // See Descriptor::DebugStringWithOptions(). - std::string DebugStringWithOptions(const DebugStringOptions& options) const; - - // Returns true if this is a placeholder for an unknown enum. This will - // only be the case if this descriptor comes from a DescriptorPool - // with AllowUnknownDependencies() set. - bool is_placeholder() const; - - // Reserved fields ------------------------------------------------- - - // A range of reserved field numbers. - struct ReservedRange { - int start; // inclusive - int end; // inclusive - }; - - // The number of reserved ranges in this message type. - int reserved_range_count() const; - // Gets an reserved range by index, where 0 <= index < - // reserved_range_count(). These are returned in the order they were defined - // in the .proto file. - const EnumDescriptor::ReservedRange* reserved_range(int index) const; - - // Returns true if the number is in one of the reserved ranges. - bool IsReservedNumber(int number) const; - - // Returns nullptr if no reserved range contains the given number. - const EnumDescriptor::ReservedRange* FindReservedRangeContainingNumber( - int number) const; - - // The number of reserved field names in this message type. - int reserved_name_count() const; - - // Gets a reserved name by index, where 0 <= index < reserved_name_count(). - const std::string& reserved_name(int index) const; - - // Returns true if the field name is reserved. - bool IsReservedName(ConstStringParam name) const; - - // Source Location --------------------------------------------------- - - // Updates |*out_location| to the source location of the complete - // extent of this enum declaration. Returns false and leaves - // |*out_location| unchanged iff location information was not available. - bool GetSourceLocation(SourceLocation* out_location) const; - - private: - friend class Symbol; - typedef EnumOptions OptionsType; - - // Allows access to GetLocationPath for annotations. - friend class io::Printer; - friend class compiler::cpp::Formatter; - - // Allow access to FindValueByNumberCreatingIfUnknown. - friend class descriptor_unittest::DescriptorTest; - - // Looks up a value by number. If the value does not exist, dynamically - // creates a new EnumValueDescriptor for that value, assuming that it was - // unknown. If a new descriptor is created, this is done in a thread-safe way, - // and future calls will return the same value descriptor pointer. - // - // This is private but is used by Reflection (which is friended below) to - // return a valid EnumValueDescriptor from GetEnum() when this feature is - // enabled. - const EnumValueDescriptor* FindValueByNumberCreatingIfUnknown( - int number) const; - - // See Descriptor::DebugString(). - void DebugString(int depth, std::string* contents, - const DebugStringOptions& options) const; - - // Walks up the descriptor tree to generate the source location path - // to this descriptor from the file root. - void GetLocationPath(std::vector* output) const; - - // True if this is a placeholder for an unknown type. - bool is_placeholder_ : 1; - // True if this is a placeholder and the type name wasn't fully-qualified. - bool is_unqualified_placeholder_ : 1; - - // This points to the last value _index_ that is part of the sequence starting - // with the first label, where - // `enum->value(i)->number() == enum->value(0)->number() + i` - // We measure relative to the first label to adapt to enum labels starting at - // 0 or 1. - // Uses 16-bit to avoid extra padding. Unlikely to have more than 2^15 - // sequentially numbered labels in an enum. - int16_t sequential_value_limit_; - - int value_count_; - - // all_names_ = [name, full_name] - const std::string* all_names_; - const FileDescriptor* file_; - const Descriptor* containing_type_; - const EnumOptions* options_; - EnumValueDescriptor* values_; - - int reserved_range_count_; - int reserved_name_count_; - EnumDescriptor::ReservedRange* reserved_ranges_; - const std::string** reserved_names_; - - // IMPORTANT: If you add a new field, make sure to search for all instances - // of Allocate() and AllocateArray() in - // descriptor.cc and update them to initialize the field. - - // Must be constructed using DescriptorPool. - EnumDescriptor() {} - friend class DescriptorBuilder; - friend class Descriptor; - friend class FieldDescriptor; - friend class FileDescriptorTables; - friend class EnumValueDescriptor; - friend class FileDescriptor; - friend class DescriptorPool; - friend class Reflection; - GOOGLE_DISALLOW_EVIL_CONSTRUCTORS(EnumDescriptor); -}; - -// Describes an individual enum constant of a particular type. To get the -// EnumValueDescriptor for a given enum value, first get the EnumDescriptor -// for its type, then use EnumDescriptor::FindValueByName() or -// EnumDescriptor::FindValueByNumber(). Use DescriptorPool to construct -// your own descriptors. -class PROTOBUF_EXPORT EnumValueDescriptor : private internal::SymbolBaseN<0>, - private internal::SymbolBaseN<1> { - public: - typedef EnumValueDescriptorProto Proto; - - const std::string& name() const; // Name of this enum constant. - int index() const; // Index within the enums's Descriptor. - int number() const; // Numeric value of this enum constant. - - // The full_name of an enum value is a sibling symbol of the enum type. - // e.g. the full name of FieldDescriptorProto::TYPE_INT32 is actually - // "google.protobuf.FieldDescriptorProto.TYPE_INT32", NOT - // "google.protobuf.FieldDescriptorProto.Type.TYPE_INT32". This is to conform - // with C++ scoping rules for enums. - const std::string& full_name() const; - - // The .proto file in which this value was defined. Never nullptr. - const FileDescriptor* file() const; - // The type of this value. Never nullptr. - const EnumDescriptor* type() const; - - // Get options for this enum value. These are specified in the .proto file by - // adding text like "[foo = 1234]" after an enum value definition. Allowed - // options are defined by EnumValueOptions in descriptor.proto, and any - // available extensions of that message. - const EnumValueOptions& options() const; - - // See Descriptor::CopyTo(). - void CopyTo(EnumValueDescriptorProto* proto) const; - - // See Descriptor::DebugString(). - std::string DebugString() const; - - // See Descriptor::DebugStringWithOptions(). - std::string DebugStringWithOptions(const DebugStringOptions& options) const; - - // Source Location --------------------------------------------------- - - // Updates |*out_location| to the source location of the complete - // extent of this enum value declaration. Returns false and leaves - // |*out_location| unchanged iff location information was not available. - bool GetSourceLocation(SourceLocation* out_location) const; - - private: - friend class Symbol; - typedef EnumValueOptions OptionsType; - - // Allows access to GetLocationPath for annotations. - friend class io::Printer; - friend class compiler::cpp::Formatter; - - // See Descriptor::DebugString(). - void DebugString(int depth, std::string* contents, - const DebugStringOptions& options) const; - - // Walks up the descriptor tree to generate the source location path - // to this descriptor from the file root. - void GetLocationPath(std::vector* output) const; - - int number_; - // all_names_ = [name, full_name] - const std::string* all_names_; - const EnumDescriptor* type_; - const EnumValueOptions* options_; - // IMPORTANT: If you add a new field, make sure to search for all instances - // of Allocate() and AllocateArray() - // in descriptor.cc and update them to initialize the field. - - // Must be constructed using DescriptorPool. - EnumValueDescriptor() {} - friend class DescriptorBuilder; - friend class EnumDescriptor; - friend class DescriptorPool; - friend class FileDescriptorTables; - friend class Reflection; - GOOGLE_DISALLOW_EVIL_CONSTRUCTORS(EnumValueDescriptor); -}; - -// Describes an RPC service. Use DescriptorPool to construct your own -// descriptors. -class PROTOBUF_EXPORT ServiceDescriptor : private internal::SymbolBase { - public: - typedef ServiceDescriptorProto Proto; - - // The name of the service, not including its containing scope. - const std::string& name() const; - // The fully-qualified name of the service, scope delimited by periods. - const std::string& full_name() const; - // Index of this service within the file's services array. - int index() const; - - // The .proto file in which this service was defined. Never nullptr. - const FileDescriptor* file() const; - - // Get options for this service type. These are specified in the .proto file - // by placing lines like "option foo = 1234;" in the service definition. - // Allowed options are defined by ServiceOptions in descriptor.proto, and any - // available extensions of that message. - const ServiceOptions& options() const; - - // The number of methods this service defines. - int method_count() const; - // Gets a MethodDescriptor by index, where 0 <= index < method_count(). - // These are returned in the order they were defined in the .proto file. - const MethodDescriptor* method(int index) const; - - // Look up a MethodDescriptor by name. - const MethodDescriptor* FindMethodByName(ConstStringParam name) const; - // See Descriptor::CopyTo(). - void CopyTo(ServiceDescriptorProto* proto) const; - - // See Descriptor::DebugString(). - std::string DebugString() const; - - // See Descriptor::DebugStringWithOptions(). - std::string DebugStringWithOptions(const DebugStringOptions& options) const; - - // Source Location --------------------------------------------------- - - // Updates |*out_location| to the source location of the complete - // extent of this service declaration. Returns false and leaves - // |*out_location| unchanged iff location information was not available. - bool GetSourceLocation(SourceLocation* out_location) const; - - private: - friend class Symbol; - typedef ServiceOptions OptionsType; - - // Allows access to GetLocationPath for annotations. - friend class io::Printer; - friend class compiler::cpp::Formatter; - - // See Descriptor::DebugString(). - void DebugString(std::string* contents, - const DebugStringOptions& options) const; - - // Walks up the descriptor tree to generate the source location path - // to this descriptor from the file root. - void GetLocationPath(std::vector* output) const; - - // all_names_ = [name, full_name] - const std::string* all_names_; - const FileDescriptor* file_; - const ServiceOptions* options_; - MethodDescriptor* methods_; - int method_count_; - // IMPORTANT: If you add a new field, make sure to search for all instances - // of Allocate() and AllocateArray() in - // descriptor.cc and update them to initialize the field. - - // Must be constructed using DescriptorPool. - ServiceDescriptor() {} - friend class DescriptorBuilder; - friend class FileDescriptor; - friend class MethodDescriptor; - GOOGLE_DISALLOW_EVIL_CONSTRUCTORS(ServiceDescriptor); -}; - - -// Describes an individual service method. To obtain a MethodDescriptor given -// a service, first get its ServiceDescriptor, then call -// ServiceDescriptor::FindMethodByName(). Use DescriptorPool to construct your -// own descriptors. -class PROTOBUF_EXPORT MethodDescriptor : private internal::SymbolBase { - public: - typedef MethodDescriptorProto Proto; - - // Name of this method, not including containing scope. - const std::string& name() const; - // The fully-qualified name of the method, scope delimited by periods. - const std::string& full_name() const; - // Index within the service's Descriptor. - int index() const; - - // The .proto file in which this method was defined. Never nullptr. - const FileDescriptor* file() const; - // Gets the service to which this method belongs. Never nullptr. - const ServiceDescriptor* service() const; - - // Gets the type of protocol message which this method accepts as input. - const Descriptor* input_type() const; - // Gets the type of protocol message which this message produces as output. - const Descriptor* output_type() const; - - // Gets whether the client streams multiple requests. - bool client_streaming() const; - // Gets whether the server streams multiple responses. - bool server_streaming() const; - - // Get options for this method. These are specified in the .proto file by - // placing lines like "option foo = 1234;" in curly-braces after a method - // declaration. Allowed options are defined by MethodOptions in - // descriptor.proto, and any available extensions of that message. - const MethodOptions& options() const; - - // See Descriptor::CopyTo(). - void CopyTo(MethodDescriptorProto* proto) const; - - // See Descriptor::DebugString(). - std::string DebugString() const; - - // See Descriptor::DebugStringWithOptions(). - std::string DebugStringWithOptions(const DebugStringOptions& options) const; - - // Source Location --------------------------------------------------- - - // Updates |*out_location| to the source location of the complete - // extent of this method declaration. Returns false and leaves - // |*out_location| unchanged iff location information was not available. - bool GetSourceLocation(SourceLocation* out_location) const; - - private: - friend class Symbol; - typedef MethodOptions OptionsType; - - // Allows access to GetLocationPath for annotations. - friend class io::Printer; - friend class compiler::cpp::Formatter; - - // See Descriptor::DebugString(). - void DebugString(int depth, std::string* contents, - const DebugStringOptions& options) const; - - // Walks up the descriptor tree to generate the source location path - // to this descriptor from the file root. - void GetLocationPath(std::vector* output) const; - - bool client_streaming_; - bool server_streaming_; - // all_names_ = [name, full_name] - const std::string* all_names_; - const ServiceDescriptor* service_; - mutable internal::LazyDescriptor input_type_; - mutable internal::LazyDescriptor output_type_; - const MethodOptions* options_; - // IMPORTANT: If you add a new field, make sure to search for all instances - // of Allocate() and AllocateArray() in - // descriptor.cc and update them to initialize the field. - - // Must be constructed using DescriptorPool. - MethodDescriptor() {} - friend class DescriptorBuilder; - friend class ServiceDescriptor; - GOOGLE_DISALLOW_EVIL_CONSTRUCTORS(MethodDescriptor); -}; - - -// Describes a whole .proto file. To get the FileDescriptor for a compiled-in -// file, get the descriptor for something defined in that file and call -// descriptor->file(). Use DescriptorPool to construct your own descriptors. -class PROTOBUF_EXPORT FileDescriptor { - public: - typedef FileDescriptorProto Proto; - - // The filename, relative to the source tree. - // e.g. "foo/bar/baz.proto" - const std::string& name() const; - - // The package, e.g. "google.protobuf.compiler". - const std::string& package() const; - - // The DescriptorPool in which this FileDescriptor and all its contents were - // allocated. Never nullptr. - const DescriptorPool* pool() const; - - // The number of files imported by this one. - int dependency_count() const; - // Gets an imported file by index, where 0 <= index < dependency_count(). - // These are returned in the order they were defined in the .proto file. - const FileDescriptor* dependency(int index) const; - - // The number of files public imported by this one. - // The public dependency list is a subset of the dependency list. - int public_dependency_count() const; - // Gets a public imported file by index, where 0 <= index < - // public_dependency_count(). - // These are returned in the order they were defined in the .proto file. - const FileDescriptor* public_dependency(int index) const; - - // The number of files that are imported for weak fields. - // The weak dependency list is a subset of the dependency list. - int weak_dependency_count() const; - // Gets a weak imported file by index, where 0 <= index < - // weak_dependency_count(). - // These are returned in the order they were defined in the .proto file. - const FileDescriptor* weak_dependency(int index) const; - - // Number of top-level message types defined in this file. (This does not - // include nested types.) - int message_type_count() const; - // Gets a top-level message type, where 0 <= index < message_type_count(). - // These are returned in the order they were defined in the .proto file. - const Descriptor* message_type(int index) const; - - // Number of top-level enum types defined in this file. (This does not - // include nested types.) - int enum_type_count() const; - // Gets a top-level enum type, where 0 <= index < enum_type_count(). - // These are returned in the order they were defined in the .proto file. - const EnumDescriptor* enum_type(int index) const; - - // Number of services defined in this file. - int service_count() const; - // Gets a service, where 0 <= index < service_count(). - // These are returned in the order they were defined in the .proto file. - const ServiceDescriptor* service(int index) const; - - // Number of extensions defined at file scope. (This does not include - // extensions nested within message types.) - int extension_count() const; - // Gets an extension's descriptor, where 0 <= index < extension_count(). - // These are returned in the order they were defined in the .proto file. - const FieldDescriptor* extension(int index) const; - - // Get options for this file. These are specified in the .proto file by - // placing lines like "option foo = 1234;" at the top level, outside of any - // other definitions. Allowed options are defined by FileOptions in - // descriptor.proto, and any available extensions of that message. - const FileOptions& options() const; - - // Syntax of this file. - enum Syntax { - SYNTAX_UNKNOWN = 0, - SYNTAX_PROTO2 = 2, - SYNTAX_PROTO3 = 3, - }; - Syntax syntax() const; - static const char* SyntaxName(Syntax syntax); - - // Find a top-level message type by name (not full_name). Returns nullptr if - // not found. - const Descriptor* FindMessageTypeByName(ConstStringParam name) const; - // Find a top-level enum type by name. Returns nullptr if not found. - const EnumDescriptor* FindEnumTypeByName(ConstStringParam name) const; - // Find an enum value defined in any top-level enum by name. Returns nullptr - // if not found. - const EnumValueDescriptor* FindEnumValueByName(ConstStringParam name) const; - // Find a service definition by name. Returns nullptr if not found. - const ServiceDescriptor* FindServiceByName(ConstStringParam name) const; - // Find a top-level extension definition by name. Returns nullptr if not - // found. - const FieldDescriptor* FindExtensionByName(ConstStringParam name) const; - // Similar to FindExtensionByName(), but searches by lowercased-name. See - // Descriptor::FindFieldByLowercaseName(). - const FieldDescriptor* FindExtensionByLowercaseName( - ConstStringParam name) const; - // Similar to FindExtensionByName(), but searches by camelcased-name. See - // Descriptor::FindFieldByCamelcaseName(). - const FieldDescriptor* FindExtensionByCamelcaseName( - ConstStringParam name) const; - - // See Descriptor::CopyTo(). - // Notes: - // - This method does NOT copy source code information since it is relatively - // large and rarely needed. See CopySourceCodeInfoTo() below. - void CopyTo(FileDescriptorProto* proto) const; - // Write the source code information of this FileDescriptor into the given - // FileDescriptorProto. See CopyTo() above. - void CopySourceCodeInfoTo(FileDescriptorProto* proto) const; - // Fill the json_name field of FieldDescriptorProto for all fields. Can only - // be called after CopyTo(). - void CopyJsonNameTo(FileDescriptorProto* proto) const; - - // See Descriptor::DebugString(). - std::string DebugString() const; - - // See Descriptor::DebugStringWithOptions(). - std::string DebugStringWithOptions(const DebugStringOptions& options) const; - - // Returns true if this is a placeholder for an unknown file. This will - // only be the case if this descriptor comes from a DescriptorPool - // with AllowUnknownDependencies() set. - bool is_placeholder() const; - - // Updates |*out_location| to the source location of the complete extent of - // this file declaration (namely, the empty path). - bool GetSourceLocation(SourceLocation* out_location) const; - - // Updates |*out_location| to the source location of the complete - // extent of the declaration or declaration-part denoted by |path|. - // Returns false and leaves |*out_location| unchanged iff location - // information was not available. (See SourceCodeInfo for - // description of path encoding.) - bool GetSourceLocation(const std::vector& path, - SourceLocation* out_location) const; - - private: - typedef FileOptions OptionsType; - - const std::string* name_; - const std::string* package_; - const DescriptorPool* pool_; - - // Data required to do lazy initialization. - struct PROTOBUF_EXPORT LazyInitData { -#ifndef SWIG - internal::once_flag once; -#endif - const char** dependencies_names; - }; - - LazyInitData* dependencies_once_; - static void DependenciesOnceInit(const FileDescriptor* to_init); - void InternalDependenciesOnceInit() const; - - // These are arranged to minimize padding on 64-bit. - int dependency_count_; - int public_dependency_count_; - int weak_dependency_count_; - int message_type_count_; - int enum_type_count_; - int service_count_; - - bool is_placeholder_; - // Indicates the FileDescriptor is completed building. Used to verify - // that type accessor functions that can possibly build a dependent file - // aren't called during the process of building the file. - bool finished_building_; - // Actually a `Syntax` but stored as uint8_t to save space. - uint8_t syntax_; - // This one is here to fill the padding. - int extension_count_; - - mutable const FileDescriptor** dependencies_; - int* public_dependencies_; - int* weak_dependencies_; - Descriptor* message_types_; - EnumDescriptor* enum_types_; - ServiceDescriptor* services_; - FieldDescriptor* extensions_; - const FileOptions* options_; - - const FileDescriptorTables* tables_; - const SourceCodeInfo* source_code_info_; - - // IMPORTANT: If you add a new field, make sure to search for all instances - // of Allocate() and AllocateArray() in - // descriptor.cc and update them to initialize the field. - - FileDescriptor() {} - friend class DescriptorBuilder; - friend class DescriptorPool; - friend class Descriptor; - friend class FieldDescriptor; - friend class internal::LazyDescriptor; - friend class OneofDescriptor; - friend class EnumDescriptor; - friend class EnumValueDescriptor; - friend class MethodDescriptor; - friend class ServiceDescriptor; - GOOGLE_DISALLOW_EVIL_CONSTRUCTORS(FileDescriptor); -}; - - -// =================================================================== - -// Used to construct descriptors. -// -// Normally you won't want to build your own descriptors. Message classes -// constructed by the protocol compiler will provide them for you. However, -// if you are implementing Message on your own, or if you are writing a -// program which can operate on totally arbitrary types and needs to load -// them from some sort of database, you might need to. -// -// Since Descriptors are composed of a whole lot of cross-linked bits of -// data that would be a pain to put together manually, the -// DescriptorPool class is provided to make the process easier. It can -// take a FileDescriptorProto (defined in descriptor.proto), validate it, -// and convert it to a set of nicely cross-linked Descriptors. -// -// DescriptorPool also helps with memory management. Descriptors are -// composed of many objects containing static data and pointers to each -// other. In all likelihood, when it comes time to delete this data, -// you'll want to delete it all at once. In fact, it is not uncommon to -// have a whole pool of descriptors all cross-linked with each other which -// you wish to delete all at once. This class represents such a pool, and -// handles the memory management for you. -// -// You can also search for descriptors within a DescriptorPool by name, and -// extensions by number. -class PROTOBUF_EXPORT DescriptorPool { - public: - // Create a normal, empty DescriptorPool. - DescriptorPool(); - - // Constructs a DescriptorPool that, when it can't find something among the - // descriptors already in the pool, looks for it in the given - // DescriptorDatabase. - // Notes: - // - If a DescriptorPool is constructed this way, its BuildFile*() methods - // must not be called (they will assert-fail). The only way to populate - // the pool with descriptors is to call the Find*By*() methods. - // - The Find*By*() methods may block the calling thread if the - // DescriptorDatabase blocks. This in turn means that parsing messages - // may block if they need to look up extensions. - // - The Find*By*() methods will use mutexes for thread-safety, thus making - // them slower even when they don't have to fall back to the database. - // In fact, even the Find*By*() methods of descriptor objects owned by - // this pool will be slower, since they will have to obtain locks too. - // - An ErrorCollector may optionally be given to collect validation errors - // in files loaded from the database. If not given, errors will be printed - // to GOOGLE_LOG(ERROR). Remember that files are built on-demand, so this - // ErrorCollector may be called from any thread that calls one of the - // Find*By*() methods. - // - The DescriptorDatabase must not be mutated during the lifetime of - // the DescriptorPool. Even if the client takes care to avoid data races, - // changes to the content of the DescriptorDatabase may not be reflected - // in subsequent lookups in the DescriptorPool. - class ErrorCollector; - explicit DescriptorPool(DescriptorDatabase* fallback_database, - ErrorCollector* error_collector = nullptr); - - ~DescriptorPool(); - - // Get a pointer to the generated pool. Generated protocol message classes - // which are compiled into the binary will allocate their descriptors in - // this pool. Do not add your own descriptors to this pool. - static const DescriptorPool* generated_pool(); - - - // Find a FileDescriptor in the pool by file name. Returns nullptr if not - // found. - const FileDescriptor* FindFileByName(ConstStringParam name) const; - - // Find the FileDescriptor in the pool which defines the given symbol. - // If any of the Find*ByName() methods below would succeed, then this is - // equivalent to calling that method and calling the result's file() method. - // Otherwise this returns nullptr. - const FileDescriptor* FindFileContainingSymbol( - ConstStringParam symbol_name) const; - - // Looking up descriptors ------------------------------------------ - // These find descriptors by fully-qualified name. These will find both - // top-level descriptors and nested descriptors. They return nullptr if not - // found. - - const Descriptor* FindMessageTypeByName(ConstStringParam name) const; - const FieldDescriptor* FindFieldByName(ConstStringParam name) const; - const FieldDescriptor* FindExtensionByName(ConstStringParam name) const; - const OneofDescriptor* FindOneofByName(ConstStringParam name) const; - const EnumDescriptor* FindEnumTypeByName(ConstStringParam name) const; - const EnumValueDescriptor* FindEnumValueByName(ConstStringParam name) const; - const ServiceDescriptor* FindServiceByName(ConstStringParam name) const; - const MethodDescriptor* FindMethodByName(ConstStringParam name) const; - - // Finds an extension of the given type by number. The extendee must be - // a member of this DescriptorPool or one of its underlays. - const FieldDescriptor* FindExtensionByNumber(const Descriptor* extendee, - int number) const; - - // Finds an extension of the given type by its printable name. - // See comments above PrintableNameForExtension() for the definition of - // "printable name". The extendee must be a member of this DescriptorPool - // or one of its underlays. Returns nullptr if there is no known message - // extension with the given printable name. - const FieldDescriptor* FindExtensionByPrintableName( - const Descriptor* extendee, ConstStringParam printable_name) const; - - // Finds extensions of extendee. The extensions will be appended to - // out in an undefined order. Only extensions defined directly in - // this DescriptorPool or one of its underlays are guaranteed to be - // found: extensions defined in the fallback database might not be found - // depending on the database implementation. - void FindAllExtensions(const Descriptor* extendee, - std::vector* out) const; - - // Building descriptors -------------------------------------------- - - // When converting a FileDescriptorProto to a FileDescriptor, various - // errors might be detected in the input. The caller may handle these - // programmatically by implementing an ErrorCollector. - class PROTOBUF_EXPORT ErrorCollector { - public: - inline ErrorCollector() {} - virtual ~ErrorCollector(); - - // These constants specify what exact part of the construct is broken. - // This is useful e.g. for mapping the error back to an exact location - // in a .proto file. - enum ErrorLocation { - NAME, // the symbol name, or the package name for files - NUMBER, // field or extension range number - TYPE, // field type - EXTENDEE, // field extendee - DEFAULT_VALUE, // field default value - INPUT_TYPE, // method input type - OUTPUT_TYPE, // method output type - OPTION_NAME, // name in assignment - OPTION_VALUE, // value in option assignment - IMPORT, // import error - OTHER // some other problem - }; - - // Reports an error in the FileDescriptorProto. Use this function if the - // problem occurred should interrupt building the FileDescriptorProto. - virtual void AddError( - const std::string& filename, // File name in which the error occurred. - const std::string& element_name, // Full name of the erroneous element. - const Message* descriptor, // Descriptor of the erroneous element. - ErrorLocation location, // One of the location constants, above. - const std::string& message // Human-readable error message. - ) = 0; - - // Reports a warning in the FileDescriptorProto. Use this function if the - // problem occurred should NOT interrupt building the FileDescriptorProto. - virtual void AddWarning( - const std::string& /*filename*/, // File name in which the error - // occurred. - const std::string& /*element_name*/, // Full name of the erroneous - // element. - const Message* /*descriptor*/, // Descriptor of the erroneous element. - ErrorLocation /*location*/, // One of the location constants, above. - const std::string& /*message*/ // Human-readable error message. - ) {} - - private: - GOOGLE_DISALLOW_EVIL_CONSTRUCTORS(ErrorCollector); - }; - - // Convert the FileDescriptorProto to real descriptors and place them in - // this DescriptorPool. All dependencies of the file must already be in - // the pool. Returns the resulting FileDescriptor, or nullptr if there were - // problems with the input (e.g. the message was invalid, or dependencies - // were missing). Details about the errors are written to GOOGLE_LOG(ERROR). - const FileDescriptor* BuildFile(const FileDescriptorProto& proto); - - // Same as BuildFile() except errors are sent to the given ErrorCollector. - const FileDescriptor* BuildFileCollectingErrors( - const FileDescriptorProto& proto, ErrorCollector* error_collector); - - // By default, it is an error if a FileDescriptorProto contains references - // to types or other files that are not found in the DescriptorPool (or its - // backing DescriptorDatabase, if any). If you call - // AllowUnknownDependencies(), however, then unknown types and files - // will be replaced by placeholder descriptors (which can be identified by - // the is_placeholder() method). This can allow you to - // perform some useful operations with a .proto file even if you do not - // have access to other .proto files on which it depends. However, some - // heuristics must be used to fill in the gaps in information, and these - // can lead to descriptors which are inaccurate. For example, the - // DescriptorPool may be forced to guess whether an unknown type is a message - // or an enum, as well as what package it resides in. Furthermore, - // placeholder types will not be discoverable via FindMessageTypeByName() - // and similar methods, which could confuse some descriptor-based algorithms. - // Generally, the results of this option should be handled with extreme care. - void AllowUnknownDependencies() { allow_unknown_ = true; } - - // By default, weak imports are allowed to be missing, in which case we will - // use a placeholder for the dependency and convert the field to be an Empty - // message field. If you call EnforceWeakDependencies(true), however, the - // DescriptorPool will report a import not found error. - void EnforceWeakDependencies(bool enforce) { enforce_weak_ = enforce; } - - // Internal stuff -------------------------------------------------- - // These methods MUST NOT be called from outside the proto2 library. - // These methods may contain hidden pitfalls and may be removed in a - // future library version. - - // Create a DescriptorPool which is overlaid on top of some other pool. - // If you search for a descriptor in the overlay and it is not found, the - // underlay will be searched as a backup. If the underlay has its own - // underlay, that will be searched next, and so on. This also means that - // files built in the overlay will be cross-linked with the underlay's - // descriptors if necessary. The underlay remains property of the caller; - // it must remain valid for the lifetime of the newly-constructed pool. - // - // Example: Say you want to parse a .proto file at runtime in order to use - // its type with a DynamicMessage. Say this .proto file has dependencies, - // but you know that all the dependencies will be things that are already - // compiled into the binary. For ease of use, you'd like to load the types - // right out of generated_pool() rather than have to parse redundant copies - // of all these .protos and runtime. But, you don't want to add the parsed - // types directly into generated_pool(): this is not allowed, and would be - // bad design anyway. So, instead, you could use generated_pool() as an - // underlay for a new DescriptorPool in which you add only the new file. - // - // WARNING: Use of underlays can lead to many subtle gotchas. Instead, - // try to formulate what you want to do in terms of DescriptorDatabases. - explicit DescriptorPool(const DescriptorPool* underlay); - - // Called by generated classes at init time to add their descriptors to - // generated_pool. Do NOT call this in your own code! filename must be a - // permanent string (e.g. a string literal). - static void InternalAddGeneratedFile(const void* encoded_file_descriptor, - int size); - - // Disallow [enforce_utf8 = false] in .proto files. - void DisallowEnforceUtf8() { disallow_enforce_utf8_ = true; } - - - // For internal use only: Gets a non-const pointer to the generated pool. - // This is called at static-initialization time only, so thread-safety is - // not a concern. If both an underlay and a fallback database are present, - // the underlay takes precedence. - static DescriptorPool* internal_generated_pool(); - - // For internal use only: Gets a non-const pointer to the generated - // descriptor database. - // Only used for testing. - static DescriptorDatabase* internal_generated_database(); - - // For internal use only: Changes the behavior of BuildFile() such that it - // allows the file to make reference to message types declared in other files - // which it did not officially declare as dependencies. - void InternalDontEnforceDependencies(); - - // For internal use only: Enables lazy building of dependencies of a file. - // Delay the building of dependencies of a file descriptor until absolutely - // necessary, like when message_type() is called on a field that is defined - // in that dependency's file. This will cause functional issues if a proto - // or one of its dependencies has errors. Should only be enabled for the - // generated_pool_ (because no descriptor build errors are guaranteed by - // the compilation generation process), testing, or if a lack of descriptor - // build errors can be guaranteed for a pool. - void InternalSetLazilyBuildDependencies() { - lazily_build_dependencies_ = true; - // This needs to be set when lazily building dependencies, as it breaks - // dependency checking. - InternalDontEnforceDependencies(); - } - - // For internal use only. - void internal_set_underlay(const DescriptorPool* underlay) { - underlay_ = underlay; - } - - // For internal (unit test) use only: Returns true if a FileDescriptor has - // been constructed for the given file, false otherwise. Useful for testing - // lazy descriptor initialization behavior. - bool InternalIsFileLoaded(ConstStringParam filename) const; - - // Add a file to unused_import_track_files_. DescriptorBuilder will log - // warnings or errors for those files if there is any unused import. - void AddUnusedImportTrackFile(ConstStringParam file_name, - bool is_error = false); - void ClearUnusedImportTrackFiles(); - - private: - friend class Descriptor; - friend class internal::LazyDescriptor; - friend class FieldDescriptor; - friend class EnumDescriptor; - friend class ServiceDescriptor; - friend class MethodDescriptor; - friend class FileDescriptor; - friend class StreamDescriptor; - friend class DescriptorBuilder; - friend class FileDescriptorTables; - - // Return true if the given name is a sub-symbol of any non-package - // descriptor that already exists in the descriptor pool. (The full - // definition of such types is already known.) - bool IsSubSymbolOfBuiltType(StringPiece name) const; - - // Tries to find something in the fallback database and link in the - // corresponding proto file. Returns true if successful, in which case - // the caller should search for the thing again. These are declared - // const because they are called by (semantically) const methods. - bool TryFindFileInFallbackDatabase(StringPiece name) const; - bool TryFindSymbolInFallbackDatabase(StringPiece name) const; - bool TryFindExtensionInFallbackDatabase(const Descriptor* containing_type, - int field_number) const; - - // This internal find extension method only check with its table and underlay - // descriptor_pool's table. It does not check with fallback DB and no - // additional proto file will be build in this method. - const FieldDescriptor* InternalFindExtensionByNumberNoLock( - const Descriptor* extendee, int number) const; - - // Like BuildFile() but called internally when the file has been loaded from - // fallback_database_. Declared const because it is called by (semantically) - // const methods. - const FileDescriptor* BuildFileFromDatabase( - const FileDescriptorProto& proto) const; - - // Helper for when lazily_build_dependencies_ is set, can look up a symbol - // after the file's descriptor is built, and can build the file where that - // symbol is defined if necessary. Will create a placeholder if the type - // doesn't exist in the fallback database, or the file doesn't build - // successfully. - Symbol CrossLinkOnDemandHelper(StringPiece name, - bool expecting_enum) const; - - // Create a placeholder FileDescriptor of the specified name - FileDescriptor* NewPlaceholderFile(StringPiece name) const; - FileDescriptor* NewPlaceholderFileWithMutexHeld(StringPiece name) const; - - enum PlaceholderType { - PLACEHOLDER_MESSAGE, - PLACEHOLDER_ENUM, - PLACEHOLDER_EXTENDABLE_MESSAGE - }; - // Create a placeholder Descriptor of the specified name - Symbol NewPlaceholder(StringPiece name, - PlaceholderType placeholder_type) const; - Symbol NewPlaceholderWithMutexHeld(StringPiece name, - PlaceholderType placeholder_type) const; - - // If fallback_database_ is nullptr, this is nullptr. Otherwise, this is a - // mutex which must be locked while accessing tables_. - internal::WrappedMutex* mutex_; - - // See constructor. - DescriptorDatabase* fallback_database_; - ErrorCollector* default_error_collector_; - const DescriptorPool* underlay_; - - // This class contains a lot of hash maps with complicated types that - // we'd like to keep out of the header. - class Tables; - std::unique_ptr tables_; - - bool enforce_dependencies_; - bool lazily_build_dependencies_; - bool allow_unknown_; - bool enforce_weak_; - bool disallow_enforce_utf8_; - - // Set of files to track for unused imports. The bool value when true means - // unused imports are treated as errors (and as warnings when false). - std::map unused_import_track_files_; - - GOOGLE_DISALLOW_EVIL_CONSTRUCTORS(DescriptorPool); -}; - - -// inline methods ==================================================== - -// These macros makes this repetitive code more readable. -#define PROTOBUF_DEFINE_ACCESSOR(CLASS, FIELD, TYPE) \ - inline TYPE CLASS::FIELD() const { return FIELD##_; } - -// Strings fields are stored as pointers but returned as const references. -#define PROTOBUF_DEFINE_STRING_ACCESSOR(CLASS, FIELD) \ - inline const std::string& CLASS::FIELD() const { return *FIELD##_; } - -// Name and full name are stored in a single array to save space. -#define PROTOBUF_DEFINE_NAME_ACCESSOR(CLASS) \ - inline const std::string& CLASS::name() const { return all_names_[0]; } \ - inline const std::string& CLASS::full_name() const { return all_names_[1]; } - -// Arrays take an index parameter, obviously. -#define PROTOBUF_DEFINE_ARRAY_ACCESSOR(CLASS, FIELD, TYPE) \ - inline TYPE CLASS::FIELD(int index) const { return FIELD##s_ + index; } - -#define PROTOBUF_DEFINE_OPTIONS_ACCESSOR(CLASS, TYPE) \ - inline const TYPE& CLASS::options() const { return *options_; } - -PROTOBUF_DEFINE_NAME_ACCESSOR(Descriptor) -PROTOBUF_DEFINE_ACCESSOR(Descriptor, file, const FileDescriptor*) -PROTOBUF_DEFINE_ACCESSOR(Descriptor, containing_type, const Descriptor*) - -PROTOBUF_DEFINE_ACCESSOR(Descriptor, field_count, int) -PROTOBUF_DEFINE_ACCESSOR(Descriptor, oneof_decl_count, int) -PROTOBUF_DEFINE_ACCESSOR(Descriptor, real_oneof_decl_count, int) -PROTOBUF_DEFINE_ACCESSOR(Descriptor, nested_type_count, int) -PROTOBUF_DEFINE_ACCESSOR(Descriptor, enum_type_count, int) - -PROTOBUF_DEFINE_ARRAY_ACCESSOR(Descriptor, field, const FieldDescriptor*) -PROTOBUF_DEFINE_ARRAY_ACCESSOR(Descriptor, oneof_decl, const OneofDescriptor*) -PROTOBUF_DEFINE_ARRAY_ACCESSOR(Descriptor, nested_type, const Descriptor*) -PROTOBUF_DEFINE_ARRAY_ACCESSOR(Descriptor, enum_type, const EnumDescriptor*) - -PROTOBUF_DEFINE_ACCESSOR(Descriptor, extension_range_count, int) -PROTOBUF_DEFINE_ACCESSOR(Descriptor, extension_count, int) -PROTOBUF_DEFINE_ARRAY_ACCESSOR(Descriptor, extension_range, - const Descriptor::ExtensionRange*) -PROTOBUF_DEFINE_ARRAY_ACCESSOR(Descriptor, extension, const FieldDescriptor*) - -PROTOBUF_DEFINE_ACCESSOR(Descriptor, reserved_range_count, int) -PROTOBUF_DEFINE_ARRAY_ACCESSOR(Descriptor, reserved_range, - const Descriptor::ReservedRange*) -PROTOBUF_DEFINE_ACCESSOR(Descriptor, reserved_name_count, int) - -PROTOBUF_DEFINE_OPTIONS_ACCESSOR(Descriptor, MessageOptions) -PROTOBUF_DEFINE_ACCESSOR(Descriptor, is_placeholder, bool) - -PROTOBUF_DEFINE_NAME_ACCESSOR(FieldDescriptor) -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_OPTIONS_ACCESSOR(FieldDescriptor, FieldOptions) -PROTOBUF_DEFINE_ACCESSOR(FieldDescriptor, has_default_value, bool) -PROTOBUF_DEFINE_ACCESSOR(FieldDescriptor, has_json_name, bool) -PROTOBUF_DEFINE_ACCESSOR(FieldDescriptor, default_value_int32_t, int32_t) -PROTOBUF_DEFINE_ACCESSOR(FieldDescriptor, default_value_int64_t, int64_t) -PROTOBUF_DEFINE_ACCESSOR(FieldDescriptor, default_value_uint32_t, uint32_t) -PROTOBUF_DEFINE_ACCESSOR(FieldDescriptor, default_value_uint64_t, uint64_t) -PROTOBUF_DEFINE_ACCESSOR(FieldDescriptor, default_value_float, float) -PROTOBUF_DEFINE_ACCESSOR(FieldDescriptor, default_value_double, double) -PROTOBUF_DEFINE_ACCESSOR(FieldDescriptor, default_value_bool, bool) -PROTOBUF_DEFINE_STRING_ACCESSOR(FieldDescriptor, default_value_string) - -PROTOBUF_DEFINE_NAME_ACCESSOR(OneofDescriptor) -PROTOBUF_DEFINE_ACCESSOR(OneofDescriptor, containing_type, const Descriptor*) -PROTOBUF_DEFINE_ACCESSOR(OneofDescriptor, field_count, int) -PROTOBUF_DEFINE_ARRAY_ACCESSOR(OneofDescriptor, field, const FieldDescriptor*) -PROTOBUF_DEFINE_OPTIONS_ACCESSOR(OneofDescriptor, OneofOptions) - -PROTOBUF_DEFINE_NAME_ACCESSOR(EnumDescriptor) -PROTOBUF_DEFINE_ACCESSOR(EnumDescriptor, file, const FileDescriptor*) -PROTOBUF_DEFINE_ACCESSOR(EnumDescriptor, containing_type, const Descriptor*) -PROTOBUF_DEFINE_ACCESSOR(EnumDescriptor, value_count, int) -PROTOBUF_DEFINE_ARRAY_ACCESSOR(EnumDescriptor, value, - const EnumValueDescriptor*) -PROTOBUF_DEFINE_OPTIONS_ACCESSOR(EnumDescriptor, EnumOptions) -PROTOBUF_DEFINE_ACCESSOR(EnumDescriptor, is_placeholder, bool) -PROTOBUF_DEFINE_ACCESSOR(EnumDescriptor, reserved_range_count, int) -PROTOBUF_DEFINE_ARRAY_ACCESSOR(EnumDescriptor, reserved_range, - const EnumDescriptor::ReservedRange*) -PROTOBUF_DEFINE_ACCESSOR(EnumDescriptor, reserved_name_count, int) - -PROTOBUF_DEFINE_NAME_ACCESSOR(EnumValueDescriptor) -PROTOBUF_DEFINE_ACCESSOR(EnumValueDescriptor, number, int) -PROTOBUF_DEFINE_ACCESSOR(EnumValueDescriptor, type, const EnumDescriptor*) -PROTOBUF_DEFINE_OPTIONS_ACCESSOR(EnumValueDescriptor, EnumValueOptions) - -PROTOBUF_DEFINE_NAME_ACCESSOR(ServiceDescriptor) -PROTOBUF_DEFINE_ACCESSOR(ServiceDescriptor, file, const FileDescriptor*) -PROTOBUF_DEFINE_ACCESSOR(ServiceDescriptor, method_count, int) -PROTOBUF_DEFINE_ARRAY_ACCESSOR(ServiceDescriptor, method, - const MethodDescriptor*) -PROTOBUF_DEFINE_OPTIONS_ACCESSOR(ServiceDescriptor, ServiceOptions) - -PROTOBUF_DEFINE_NAME_ACCESSOR(MethodDescriptor) -PROTOBUF_DEFINE_ACCESSOR(MethodDescriptor, service, const ServiceDescriptor*) -PROTOBUF_DEFINE_OPTIONS_ACCESSOR(MethodDescriptor, MethodOptions) -PROTOBUF_DEFINE_ACCESSOR(MethodDescriptor, client_streaming, bool) -PROTOBUF_DEFINE_ACCESSOR(MethodDescriptor, server_streaming, bool) - -PROTOBUF_DEFINE_STRING_ACCESSOR(FileDescriptor, name) -PROTOBUF_DEFINE_STRING_ACCESSOR(FileDescriptor, package) -PROTOBUF_DEFINE_ACCESSOR(FileDescriptor, pool, const DescriptorPool*) -PROTOBUF_DEFINE_ACCESSOR(FileDescriptor, dependency_count, int) -PROTOBUF_DEFINE_ACCESSOR(FileDescriptor, public_dependency_count, int) -PROTOBUF_DEFINE_ACCESSOR(FileDescriptor, weak_dependency_count, int) -PROTOBUF_DEFINE_ACCESSOR(FileDescriptor, message_type_count, int) -PROTOBUF_DEFINE_ACCESSOR(FileDescriptor, enum_type_count, int) -PROTOBUF_DEFINE_ACCESSOR(FileDescriptor, service_count, int) -PROTOBUF_DEFINE_ACCESSOR(FileDescriptor, extension_count, int) -PROTOBUF_DEFINE_OPTIONS_ACCESSOR(FileDescriptor, FileOptions) -PROTOBUF_DEFINE_ACCESSOR(FileDescriptor, is_placeholder, bool) - -PROTOBUF_DEFINE_ARRAY_ACCESSOR(FileDescriptor, message_type, const Descriptor*) -PROTOBUF_DEFINE_ARRAY_ACCESSOR(FileDescriptor, enum_type, const EnumDescriptor*) -PROTOBUF_DEFINE_ARRAY_ACCESSOR(FileDescriptor, service, - const ServiceDescriptor*) -PROTOBUF_DEFINE_ARRAY_ACCESSOR(FileDescriptor, extension, - const FieldDescriptor*) - -#undef PROTOBUF_DEFINE_ACCESSOR -#undef PROTOBUF_DEFINE_STRING_ACCESSOR -#undef PROTOBUF_DEFINE_ARRAY_ACCESSOR - -// A few accessors differ from the macros... - -inline Descriptor::WellKnownType Descriptor::well_known_type() const { - return static_cast(well_known_type_); -} - -inline bool Descriptor::IsExtensionNumber(int number) const { - return FindExtensionRangeContainingNumber(number) != nullptr; -} - -inline bool Descriptor::IsReservedNumber(int number) const { - return FindReservedRangeContainingNumber(number) != nullptr; -} - -inline bool Descriptor::IsReservedName(ConstStringParam name) const { - for (int i = 0; i < reserved_name_count(); i++) { - if (name == static_cast(reserved_name(i))) { - return true; - } - } - return false; -} - -// Can't use PROTOBUF_DEFINE_ARRAY_ACCESSOR because reserved_names_ is actually -// an array of pointers rather than the usual array of objects. -inline const std::string& Descriptor::reserved_name(int index) const { - return *reserved_names_[index]; -} - -inline bool EnumDescriptor::IsReservedNumber(int number) const { - return FindReservedRangeContainingNumber(number) != nullptr; -} - -inline bool EnumDescriptor::IsReservedName(ConstStringParam name) const { - for (int i = 0; i < reserved_name_count(); i++) { - if (name == static_cast(reserved_name(i))) { - return true; - } - } - return false; -} - -// Can't use PROTOBUF_DEFINE_ARRAY_ACCESSOR because reserved_names_ is actually -// an array of pointers rather than the usual array of objects. -inline const std::string& EnumDescriptor::reserved_name(int index) const { - return *reserved_names_[index]; -} - -inline const std::string& FieldDescriptor::lowercase_name() const { - return all_names_[lowercase_name_index_]; -} - -inline const std::string& FieldDescriptor::camelcase_name() const { - return all_names_[camelcase_name_index_]; -} - -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 int FieldDescriptor::index_in_oneof() const { - GOOGLE_DCHECK(is_oneof_); - return static_cast(this - scope_.containing_oneof->field(0)); -} - -inline const Descriptor* FieldDescriptor::extension_scope() const { - GOOGLE_CHECK(is_extension_); - return scope_.extension_scope; -} - -inline FieldDescriptor::Label FieldDescriptor::label() const { - return static_cast