From 141ae38bc95960961e257e7228e3e1a12518005e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=A8=E5=86=8D=E9=B9=8F?= Date: Mon, 11 May 2026 22:07:48 +0800 Subject: [PATCH 1/3] AI_blank.cpp is ready --- .../API/src/{AI.backup.cpp => AI_backup.cpp} | 0 CAPI/cpp/API/src/AI_blank.cpp | 23 +++++++++++++++++++ 2 files changed, 23 insertions(+) rename CAPI/cpp/API/src/{AI.backup.cpp => AI_backup.cpp} (100%) create mode 100644 CAPI/cpp/API/src/AI_blank.cpp diff --git a/CAPI/cpp/API/src/AI.backup.cpp b/CAPI/cpp/API/src/AI_backup.cpp similarity index 100% rename from CAPI/cpp/API/src/AI.backup.cpp rename to CAPI/cpp/API/src/AI_backup.cpp diff --git a/CAPI/cpp/API/src/AI_blank.cpp b/CAPI/cpp/API/src/AI_blank.cpp new file mode 100644 index 00000000..fead6352 --- /dev/null +++ b/CAPI/cpp/API/src/AI_blank.cpp @@ -0,0 +1,23 @@ +#include + +#include "AI.h" + +extern const bool asynchronous = false; + +extern const std::array CharacterTypeDict = { + THUAI9::CharacterType::Robot, + THUAI9::CharacterType::Drone, + THUAI9::CharacterType::AutonomousCar, +}; + +void AI::play(ICharacterAPI& api) +{ + (void)api; + // TODO: implement character strategy. +} + +void AI::play(ITeamAPI& api) +{ + (void)api; + // TODO: implement team strategy. +} From 9b703ab7e75a6155ca052a348064ff5ffe352502 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=A8=E5=86=8D=E9=B9=8F?= Date: Tue, 12 May 2026 10:23:28 +0800 Subject: [PATCH 2/3] Independent run and add docs for cpp --- CAPI/cpp/.gitignore | 1 - CAPI/cpp/API.sln | 12 - CAPI/cpp/API/API.vcxproj | 208 +- CAPI/cpp/README.md | 200 +- .../grpc/include/absl/algorithm/algorithm.h | 117 +- .../grpc/include/absl/algorithm/container.h | 308 +- CAPI/cpp/grpc/include/absl/base/attributes.h | 204 +- CAPI/cpp/grpc/include/absl/base/call_once.h | 28 +- CAPI/cpp/grpc/include/absl/base/casts.h | 2 +- CAPI/cpp/grpc/include/absl/base/config.h | 167 +- .../include/absl/base/dynamic_annotations.h | 43 +- .../include/absl/base/internal/atomic_hook.h | 2 +- .../absl/base/internal/dynamic_annotations.h | 45 +- .../grpc/include/absl/base/internal/endian.h | 25 +- .../base/internal/exception_safety_testing.h | 3 +- .../include/absl/base/internal/identity.h | 6 +- .../absl/base/internal/inline_variable.h | 37 +- .../absl/base/internal/nullability_impl.h | 81 +- .../grpc/include/absl/base/internal/poison.h | 63 + .../include/absl/base/internal/raw_logging.h | 2 + .../include/absl/base/internal/spinlock.h | 44 +- .../absl/base/internal/spinlock_wait.h | 3 +- .../absl/base/internal/thread_identity.h | 6 +- .../grpc/include/absl/base/internal/tracing.h | 88 + .../absl/base/internal/unaligned_access.h | 13 +- .../absl/base/internal/unscaledcycleclock.h | 16 +- .../base/internal/unscaledcycleclock_config.h | 7 +- .../cpp/grpc/include/absl/base/log_severity.h | 36 +- CAPI/cpp/grpc/include/absl/base/macros.h | 85 +- .../grpc/include/absl/base/no_destructor.h | 251 + CAPI/cpp/grpc/include/absl/base/nullability.h | 106 +- .../cpp/grpc/include/absl/base/optimization.h | 37 +- CAPI/cpp/grpc/include/absl/base/options.h | 42 +- .../grpc/include/absl/base/policy_checks.h | 2 + CAPI/cpp/grpc/include/absl/base/prefetch.h | 54 +- .../include/absl/base/thread_annotations.h | 2 - .../grpc/include/absl/container/btree_map.h | 14 +- .../grpc/include/absl/container/btree_set.h | 11 +- .../grpc/include/absl/container/fixed_array.h | 3 +- .../include/absl/container/flat_hash_map.h | 95 +- .../include/absl/container/flat_hash_set.h | 90 +- .../absl/container/hash_container_defaults.h | 46 + .../include/absl/container/inlined_vector.h | 16 +- .../include/absl/container/internal/btree.h | 105 +- .../container/internal/common_policy_traits.h | 45 +- .../container/internal/compressed_tuple.h | 28 +- .../container/internal/container_memory.h | 57 +- .../internal/hash_function_defaults.h | 80 +- .../internal/hash_generator_testing.h | 2 +- .../container/internal/hash_policy_testing.h | 3 +- .../container/internal/hash_policy_traits.h | 62 + .../absl/container/internal/hashtable_debug.h | 9 - .../internal/hashtable_debug_hooks.h | 2 +- .../container/internal/hashtablez_sampler.h | 51 +- .../absl/container/internal/inlined_vector.h | 100 +- .../include/absl/container/internal/layout.h | 364 +- .../container/internal/node_slot_policy.h | 4 +- .../absl/container/internal/raw_hash_map.h | 26 +- .../absl/container/internal/raw_hash_set.h | 2935 +- .../absl/container/internal/test_allocator.h | 444 + .../include/absl/container/node_hash_map.h | 92 +- .../include/absl/container/node_hash_set.h | 92 +- .../include/absl/crc/internal/cpu_detect.h | 6 + .../internal/crc32_x86_arm_combined_simd.h | 77 +- .../include/absl/crc/internal/crc_memcpy.h | 9 +- .../absl/crc/internal/non_temporal_memcpy.h | 49 +- .../absl/debugging/failure_signal_handler.h | 2 +- .../internal/bounded_utf8_length_sequence.h | 134 + .../debugging/internal/decode_rust_punycode.h | 58 + .../absl/debugging/internal/demangle.h | 81 +- .../absl/debugging/internal/demangle_rust.h | 43 + .../absl/debugging/internal/elf_mem_image.h | 17 +- .../debugging/internal/stack_consumption.h | 4 +- .../internal/stacktrace_aarch64-inl.inc | 432 +- .../debugging/internal/stacktrace_config.h | 7 + .../internal/stacktrace_riscv-inl.inc | 274 +- .../debugging/internal/utf8_for_code_point.h | 53 + .../include/absl/debugging/symbolize_elf.inc | 3325 +- .../grpc/include/absl/flags/commandlineflag.h | 54 +- CAPI/cpp/grpc/include/absl/flags/declare.h | 11 +- CAPI/cpp/grpc/include/absl/flags/flag.h | 97 +- .../grpc/include/absl/flags/internal/flag.h | 264 +- .../flags/internal/private_handle_accessor.h | 3 + .../include/absl/functional/any_invocable.h | 16 +- .../grpc/include/absl/functional/bind_front.h | 4 +- .../include/absl/functional/function_ref.h | 9 + .../absl/functional/internal/any_invocable.h | 30 +- .../absl/functional/internal/front_binder.h | 14 +- .../absl/functional/internal/function_ref.h | 2 +- .../grpc/include/absl/functional/overload.h | 98 + CAPI/cpp/grpc/include/absl/hash/hash.h | 31 +- .../cpp/grpc/include/absl/hash/hash_testing.h | 16 +- .../grpc/include/absl/hash/internal/hash.h | 377 +- .../absl/hash/internal/low_level_hash.h | 3 + .../absl/hash/internal/spy_hash_state.h | 39 +- CAPI/cpp/grpc/include/absl/log/absl_check.h | 117 + CAPI/cpp/grpc/include/absl/log/absl_log.h | 115 + .../grpc/include/absl/log/absl_vlog_is_on.h | 95 + CAPI/cpp/grpc/include/absl/log/check.h | 209 + .../grpc/include/absl/log/check_test_impl.inc | 770 + CAPI/cpp/grpc/include/absl/log/die_if_null.h | 80 + CAPI/cpp/grpc/include/absl/log/flags.h | 43 + CAPI/cpp/grpc/include/absl/log/globals.h | 240 + CAPI/cpp/grpc/include/absl/log/initialize.h | 46 + .../absl/log/internal/append_truncated.h | 53 + .../include/absl/log/internal/check_impl.h | 147 + .../grpc/include/absl/log/internal/check_op.h | 519 + .../include/absl/log/internal/conditions.h | 271 + .../grpc/include/absl/log/internal/config.h | 47 + .../grpc/include/absl/log/internal/flags.h | 59 + .../grpc/include/absl/log/internal/fnmatch.h | 37 + .../grpc/include/absl/log/internal/globals.h | 103 + .../include/absl/log/internal/log_format.h | 75 + .../grpc/include/absl/log/internal/log_impl.h | 289 + .../include/absl/log/internal/log_message.h | 439 + .../include/absl/log/internal/log_sink_set.h | 55 + .../include/absl/log/internal/nullguard.h | 114 + .../include/absl/log/internal/nullstream.h | 162 + .../grpc/include/absl/log/internal/proto.h | 349 + .../grpc/include/absl/log/internal/strip.h | 109 + .../include/absl/log/internal/structured.h | 187 + .../absl/log/internal/structured_proto.h | 115 + .../include/absl/log/internal/test_actions.h | 106 + .../include/absl/log/internal/test_helpers.h | 74 + .../include/absl/log/internal/test_matchers.h | 112 + .../include/absl/log/internal/vlog_config.h | 178 + .../grpc/include/absl/log/internal/voidify.h | 49 + CAPI/cpp/grpc/include/absl/log/log.h | 365 + .../include/absl/log/log_basic_test_impl.inc | 588 + CAPI/cpp/grpc/include/absl/log/log_entry.h | 255 + CAPI/cpp/grpc/include/absl/log/log_sink.h | 75 + .../grpc/include/absl/log/log_sink_registry.h | 70 + CAPI/cpp/grpc/include/absl/log/log_streamer.h | 197 + .../grpc/include/absl/log/scoped_mock_log.h | 212 + CAPI/cpp/grpc/include/absl/log/structured.h | 78 + CAPI/cpp/grpc/include/absl/log/vlog_is_on.h | 74 + CAPI/cpp/grpc/include/absl/meta/type_traits.h | 189 +- CAPI/cpp/grpc/include/absl/numeric/bits.h | 55 +- CAPI/cpp/grpc/include/absl/numeric/int128.h | 73 +- .../absl/numeric/int128_have_intrinsic.inc | 412 +- .../absl/numeric/int128_no_intrinsic.inc | 584 +- .../grpc/include/absl/numeric/internal/bits.h | 8 +- .../profiling/internal/periodic_sampler.h | 2 +- .../absl/random/bernoulli_distribution.h | 4 +- .../include/absl/random/beta_distribution.h | 20 +- .../grpc/include/absl/random/bit_gen_ref.h | 15 +- .../absl/random/discrete_distribution.h | 6 +- .../grpc/include/absl/random/distributions.h | 20 +- .../absl/random/exponential_distribution.h | 1 + .../absl/random/gaussian_distribution.h | 1 + .../random/internal/distribution_caller.h | 4 +- .../random/internal/distribution_test_util.h | 6 +- .../random/internal/iostream_state_saver.h | 7 +- .../absl/random/internal/mock_helpers.h | 44 +- .../absl/random/internal/mock_overload_set.h | 65 +- .../absl/random/internal/mock_validators.h | 127 + .../include/absl/random/internal/platform.h | 24 +- .../absl/random/internal/randen_engine.h | 3 +- .../absl/random/internal/uniform_helper.h | 5 +- .../random/log_uniform_int_distribution.h | 5 +- .../include/absl/random/mock_distributions.h | 23 +- .../include/absl/random/mocking_bit_gen.h | 54 +- .../absl/random/poisson_distribution.h | 7 +- .../grpc/include/absl/random/seed_sequences.h | 5 +- .../absl/random/uniform_int_distribution.h | 3 +- .../absl/random/uniform_real_distribution.h | 2 + .../include/absl/random/zipf_distribution.h | 7 +- .../absl/status/internal/status_internal.h | 81 +- .../absl/status/internal/status_matchers.h | 292 + .../absl/status/internal/statusor_internal.h | 128 +- CAPI/cpp/grpc/include/absl/status/status.h | 182 +- .../include/absl/status/status_matchers.h | 126 + .../absl/status/status_payload_printer.h | 5 +- CAPI/cpp/grpc/include/absl/status/statusor.h | 281 +- CAPI/cpp/grpc/include/absl/strings/ascii.h | 60 +- CAPI/cpp/grpc/include/absl/strings/charconv.h | 7 +- CAPI/cpp/grpc/include/absl/strings/charset.h | 195 + CAPI/cpp/grpc/include/absl/strings/cord.h | 325 +- .../grpc/include/absl/strings/cord_analysis.h | 7 +- .../include/absl/strings/cordz_test_helpers.h | 10 +- CAPI/cpp/grpc/include/absl/strings/escaping.h | 28 +- .../include/absl/strings/has_absl_stringify.h | 73 + .../absl/strings/has_ostream_operator.h | 47 + .../absl/strings/internal/charconv_bigint.h | 12 +- .../absl/strings/internal/cord_internal.h | 176 +- .../absl/strings/internal/cord_rep_btree.h | 4 +- .../absl/strings/internal/cordz_functions.h | 39 +- .../absl/strings/internal/cordz_info.h | 15 +- .../absl/strings/internal/str_format/arg.h | 84 +- .../absl/strings/internal/str_format/bind.h | 11 +- .../internal/str_format/constexpr_parser.h | 24 +- .../strings/internal/str_format/extension.h | 33 +- .../absl/strings/internal/str_format/parser.h | 9 +- .../absl/strings/internal/str_join_internal.h | 27 +- .../strings/internal/str_split_internal.h | 44 +- CAPI/cpp/grpc/include/absl/strings/match.h | 31 +- CAPI/cpp/grpc/include/absl/strings/numbers.h | 73 +- CAPI/cpp/grpc/include/absl/strings/str_cat.h | 148 +- .../grpc/include/absl/strings/str_format.h | 49 +- CAPI/cpp/grpc/include/absl/strings/str_join.h | 49 +- .../grpc/include/absl/strings/str_replace.h | 9 +- .../cpp/grpc/include/absl/strings/str_split.h | 42 +- .../grpc/include/absl/strings/string_view.h | 152 +- CAPI/cpp/grpc/include/absl/strings/strip.h | 16 +- .../grpc/include/absl/strings/substitute.h | 100 +- .../absl/synchronization/blocking_counter.h | 7 + .../synchronization/internal/graphcycles.h | 5 + .../synchronization/internal/per_thread_sem.h | 6 +- .../synchronization/internal/pthread_waiter.h | 4 +- .../synchronization/internal/win32_waiter.h | 6 +- .../grpc/include/absl/synchronization/mutex.h | 154 +- .../absl/synchronization/notification.h | 14 +- CAPI/cpp/grpc/include/absl/time/civil_time.h | 36 +- CAPI/cpp/grpc/include/absl/time/clock.h | 10 +- .../internal/cctz/include/cctz/civil_time.h | 2 +- .../cctz/include/cctz/civil_time_detail.h | 8 +- .../internal/cctz/include/cctz/time_zone.h | 4 +- .../cctz/include/cctz/zone_info_source.h | 4 +- .../time/internal/cctz/src/time_zone_fixed.h | 2 +- .../time/internal/cctz/src/time_zone_if.h | 2 +- .../time/internal/cctz/src/time_zone_impl.h | 6 +- .../time/internal/cctz/src/time_zone_info.h | 6 +- .../time/internal/cctz/src/time_zone_libc.h | 4 +- .../time/internal/cctz/src/time_zone_posix.h | 2 +- .../absl/time/internal/cctz/src/tzfile.h | 24 +- CAPI/cpp/grpc/include/absl/time/time.h | 210 +- CAPI/cpp/grpc/include/absl/types/compare.h | 184 +- .../include/absl/types/internal/optional.h | 10 +- .../grpc/include/absl/types/internal/span.h | 5 +- .../include/absl/types/internal/variant.h | 138 +- CAPI/cpp/grpc/include/absl/types/optional.h | 33 +- CAPI/cpp/grpc/include/absl/types/span.h | 139 +- CAPI/cpp/grpc/include/absl/types/variant.h | 44 +- .../absl/utility/internal/if_constexpr.h | 4 +- CAPI/cpp/grpc/include/absl/utility/utility.h | 160 +- CAPI/cpp/grpc/include/ares.h | 638 +- CAPI/cpp/grpc/include/ares_build.h | 9 +- CAPI/cpp/grpc/include/ares_dns.h | 33 +- CAPI/cpp/grpc/include/ares_dns_record.h | 236 +- CAPI/cpp/grpc/include/ares_version.h | 20 +- CAPI/cpp/grpc/include/google/protobuf/any.h | 187 +- .../cpp/grpc/include/google/protobuf/any.pb.h | 938 +- .../grpc/include/google/protobuf/any.proto | 16 +- .../cpp/grpc/include/google/protobuf/api.pb.h | 3053 +- .../grpc/include/google/protobuf/api.proto | 3 +- CAPI/cpp/grpc/include/google/protobuf/arena.h | 1585 +- .../include/google/protobuf/arena_align.h | 199 + .../google/protobuf/arena_allocation_policy.h | 102 + .../include/google/protobuf/arena_cleanup.h | 102 + .../include/google/protobuf/arenastring.h | 1048 +- .../include/google/protobuf/arenaz_sampler.h | 429 +- .../google/protobuf/compiler/code_generator.h | 409 +- .../protobuf/compiler/code_generator_lite.h | 45 + .../compiler/command_line_interface.h | 899 +- .../google/protobuf/compiler/cpp/enum.h | 81 + .../google/protobuf/compiler/cpp/extension.h | 94 + .../google/protobuf/compiler/cpp/field.h | 539 + .../cpp/field_generators/generators.h | 94 + .../google/protobuf/compiler/cpp/file.h | 390 +- .../google/protobuf/compiler/cpp/generator.h | 175 +- .../google/protobuf/compiler/cpp/helpers.h | 2330 +- .../protobuf/compiler/cpp/ifndef_guard.h | 66 + .../google/protobuf/compiler/cpp/message.h | 245 + .../compiler/cpp/message_layout_helper.h | 41 + .../google/protobuf/compiler/cpp/names.h | 163 +- .../protobuf/compiler/cpp/namespace_printer.h | 58 + .../google/protobuf/compiler/cpp/options.h | 76 + .../protobuf/compiler/cpp/padding_optimizer.h | 42 + .../compiler/cpp/parse_function_generator.h | 71 + .../google/protobuf/compiler/cpp/service.h | 91 + .../google/protobuf/compiler/cpp/tracker.h | 35 + .../compiler/csharp/csharp_doc_comment.h | 68 +- .../protobuf/compiler/csharp/csharp_enum.h | 42 + .../compiler/csharp/csharp_enum_field.h | 57 + .../compiler/csharp/csharp_field_base.h | 93 + .../compiler/csharp/csharp_generator.h | 96 +- .../protobuf/compiler/csharp/csharp_helpers.h | 143 + .../compiler/csharp/csharp_map_field.h | 49 + .../protobuf/compiler/csharp/csharp_message.h | 70 + .../compiler/csharp/csharp_message_field.h | 67 + .../protobuf/compiler/csharp/csharp_options.h | 119 +- .../compiler/csharp/csharp_primitive_field.h | 71 + .../compiler/csharp/csharp_reflection_class.h | 52 + .../csharp/csharp_repeated_enum_field.h | 53 + .../csharp/csharp_repeated_message_field.h | 53 + .../csharp/csharp_repeated_primitive_field.h | 49 + .../csharp/csharp_source_generator_base.h | 47 + .../compiler/csharp/csharp_wrapper_field.h | 74 + .../google/protobuf/compiler/csharp/names.h | 124 + .../google/protobuf/compiler/importer.h | 625 +- .../google/protobuf/compiler/java/context.h | 106 + .../protobuf/compiler/java/doc_comment.h | 84 + .../protobuf/compiler/java/field_common.h | 69 + .../google/protobuf/compiler/java/file.h | 96 + .../google/protobuf/compiler/java/full/enum.h | 81 + .../protobuf/compiler/java/full/enum_field.h | 144 + .../protobuf/compiler/java/full/extension.h | 66 + .../compiler/java/full/field_generator.h | 53 + .../compiler/java/full/generator_factory.h | 19 + .../compiler/java/full/make_field_gens.h | 29 + .../protobuf/compiler/java/full/map_field.h | 69 + .../protobuf/compiler/java/full/message.h | 88 + .../compiler/java/full/message_builder.h | 80 + .../compiler/java/full/message_field.h | 167 + .../compiler/java/full/primitive_field.h | 144 + .../protobuf/compiler/java/full/service.h | 101 + .../compiler/java/full/string_field.h | 142 + .../google/protobuf/compiler/java/generator.h | 117 +- .../protobuf/compiler/java/generator_common.h | 90 + .../compiler/java/generator_factory.h | 133 + .../google/protobuf/compiler/java/helpers.h | 407 + .../protobuf/compiler/java/internal_helpers.h | 72 + .../protobuf/compiler/java/java_features.pb.h | 430 + .../google/protobuf/compiler/java/lite/enum.h | 77 + .../protobuf/compiler/java/lite/enum_field.h | 122 + .../protobuf/compiler/java/lite/extension.h | 55 + .../compiler/java/lite/field_generator.h | 43 + .../compiler/java/lite/generator_factory.h | 19 + .../compiler/java/lite/make_field_gens.h | 32 + .../protobuf/compiler/java/lite/map_field.h | 57 + .../protobuf/compiler/java/lite/message.h | 66 + .../compiler/java/lite/message_builder.h | 66 + .../compiler/java/lite/message_field.h | 129 + .../compiler/java/lite/primitive_field.h | 126 + .../compiler/java/lite/string_field.h | 126 + .../compiler/java/message_serialization.h | 78 + .../protobuf/compiler/java/name_resolver.h | 143 + .../google/protobuf/compiler/java/names.h | 201 +- .../google/protobuf/compiler/java/options.h | 60 + .../compiler/java/shared_code_generator.h | 68 + .../google/protobuf/compiler/kotlin/file.h | 78 + .../protobuf/compiler/kotlin/generator.h | 63 + .../google/protobuf/compiler/kotlin/message.h | 58 + .../protobuf/compiler/objectivec/enum.h | 52 + .../protobuf/compiler/objectivec/enum_field.h | 66 + .../protobuf/compiler/objectivec/extension.h | 54 + .../protobuf/compiler/objectivec/field.h | 181 + .../protobuf/compiler/objectivec/file.h | 139 + .../protobuf/compiler/objectivec/generator.h | 63 + .../protobuf/compiler/objectivec/helpers.h | 164 + .../compiler/objectivec/import_writer.h | 61 + .../compiler/objectivec/line_consumer.h | 51 + .../protobuf/compiler/objectivec/map_field.h | 57 + .../protobuf/compiler/objectivec/message.h | 73 + .../compiler/objectivec/message_field.h | 74 + .../protobuf/compiler/objectivec/names.h | 178 + .../compiler/objectivec/nsobject_methods.h | 204 + .../protobuf/compiler/objectivec/oneof.h | 57 + .../protobuf/compiler/objectivec/options.h | 39 + .../compiler/objectivec/primitive_field.h | 75 + .../compiler/objectivec/tf_decode_data.h | 58 + .../include/google/protobuf/compiler/parser.h | 1119 +- .../google/protobuf/compiler/php/names.h | 50 + .../protobuf/compiler/php/php_generator.h | 123 +- .../include/google/protobuf/compiler/plugin.h | 68 +- .../google/protobuf/compiler/plugin.pb.h | 4443 +- .../google/protobuf/compiler/plugin.proto | 57 +- .../protobuf/compiler/python/generator.h | 348 +- .../google/protobuf/compiler/python/helpers.h | 42 + .../protobuf/compiler/python/pyi_generator.h | 189 +- .../google/protobuf/compiler/retention.h | 70 + .../protobuf/compiler/ruby/ruby_generator.h | 87 +- .../compiler/rust/accessors/accessor_case.h | 43 + .../compiler/rust/accessors/accessors.h | 33 + .../compiler/rust/accessors/default_value.h | 33 + .../compiler/rust/accessors/generator.h | 150 + .../compiler/rust/accessors/with_presence.h | 35 + .../google/protobuf/compiler/rust/context.h | 154 + .../protobuf/compiler/rust/crate_mapping.h | 42 + .../google/protobuf/compiler/rust/enum.h | 49 + .../google/protobuf/compiler/rust/generator.h | 49 + .../google/protobuf/compiler/rust/message.h | 34 + .../google/protobuf/compiler/rust/naming.h | 186 + .../google/protobuf/compiler/rust/oneof.h | 31 + .../protobuf/compiler/rust/relative_path.h | 54 + .../protobuf/compiler/rust/rust_field_type.h | 39 + .../protobuf/compiler/rust/rust_keywords.h | 34 + .../protobuf/compiler/rust/upb_helpers.h | 32 + .../include/google/protobuf/compiler/scc.h | 147 + .../google/protobuf/compiler/subprocess.h | 91 + .../google/protobuf/compiler/versions.h | 77 + .../google/protobuf/compiler/zip_writer.h | 46 + .../google/protobuf/cpp_edition_defaults.h | 12 + .../include/google/protobuf/cpp_features.pb.h | 473 + .../google/protobuf/cpp_features.proto | 67 + .../grpc/include/google/protobuf/descriptor.h | 5469 +-- .../include/google/protobuf/descriptor.pb.h | 37311 +++++++++------- .../include/google/protobuf/descriptor.proto | 492 +- .../google/protobuf/descriptor_database.h | 709 +- .../google/protobuf/descriptor_legacy.h | 25 + .../include/google/protobuf/descriptor_lite.h | 98 + .../google/protobuf/descriptor_visitor.h | 187 + .../include/google/protobuf/duration.pb.h | 555 +- .../include/google/protobuf/duration.proto | 3 +- .../include/google/protobuf/dynamic_message.h | 396 +- .../grpc/include/google/protobuf/empty.pb.h | 387 +- .../grpc/include/google/protobuf/empty.proto | 2 +- .../cpp/grpc/include/google/protobuf/endian.h | 248 +- .../google/protobuf/explicitly_constructed.h | 136 +- .../include/google/protobuf/extension_set.h | 3195 +- .../google/protobuf/extension_set_inl.h | 519 +- .../google/protobuf/feature_resolver.h | 88 + .../google/protobuf/field_access_listener.h | 342 +- .../include/google/protobuf/field_mask.pb.h | 622 +- .../include/google/protobuf/field_mask.proto | 2 +- .../protobuf/generated_enum_reflection.h | 121 +- .../google/protobuf/generated_enum_util.h | 161 +- .../google/protobuf/generated_message_bases.h | 121 +- .../protobuf/generated_message_reflection.h | 734 +- .../protobuf/generated_message_tctable_decl.h | 869 +- .../protobuf/generated_message_tctable_gen.h | 166 + .../protobuf/generated_message_tctable_impl.h | 1459 +- .../google/protobuf/generated_message_util.h | 567 +- .../grpc/include/google/protobuf/has_bits.h | 233 +- .../google/protobuf/implicit_weak_message.h | 482 +- .../google/protobuf/inlined_string_field.h | 1049 +- .../google/protobuf/internal_visibility.h | 44 + .../include/google/protobuf/io/coded_stream.h | 3505 +- .../include/google/protobuf/io/gzip_stream.h | 350 +- .../include/google/protobuf/io/io_win32.h | 155 +- .../grpc/include/google/protobuf/io/printer.h | 1547 +- .../grpc/include/google/protobuf/io/strtod.h | 77 +- .../include/google/protobuf/io/tokenizer.h | 847 +- .../google/protobuf/io/zero_copy_sink.h | 57 + .../google/protobuf/io/zero_copy_stream.h | 324 +- .../protobuf/io/zero_copy_stream_impl.h | 622 +- .../protobuf/io/zero_copy_stream_impl_lite.h | 886 +- .../json/internal/descriptor_traits.h | 512 + .../google/protobuf/json/internal/lexer.h | 336 + .../protobuf/json/internal/message_path.h | 61 + .../google/protobuf/json/internal/parser.h | 36 + .../protobuf/json/internal/parser_traits.h | 400 + .../google/protobuf/json/internal/unparser.h | 36 + .../protobuf/json/internal/unparser_traits.h | 415 + .../protobuf/json/internal/untyped_message.h | 237 + .../google/protobuf/json/internal/writer.h | 218 + .../json/internal/zero_copy_buffered_stream.h | 332 + .../grpc/include/google/protobuf/json/json.h | 175 + CAPI/cpp/grpc/include/google/protobuf/map.h | 3544 +- .../grpc/include/google/protobuf/map_entry.h | 239 +- .../grpc/include/google/protobuf/map_field.h | 2005 +- .../include/google/protobuf/map_field_inl.h | 568 +- .../include/google/protobuf/map_field_lite.h | 325 +- .../google/protobuf/map_type_handler.h | 1116 +- .../grpc/include/google/protobuf/message.h | 2875 +- .../include/google/protobuf/message_lite.h | 2028 +- .../grpc/include/google/protobuf/metadata.h | 31 +- .../include/google/protobuf/metadata_lite.h | 595 +- .../include/google/protobuf/parse_context.h | 2536 +- CAPI/cpp/grpc/include/google/protobuf/port.h | 484 +- .../grpc/include/google/protobuf/port_def.inc | 880 +- .../include/google/protobuf/port_undef.inc | 151 +- .../grpc/include/google/protobuf/raw_ptr.h | 64 + .../grpc/include/google/protobuf/reflection.h | 1210 +- .../google/protobuf/reflection_internal.h | 351 + .../include/google/protobuf/reflection_mode.h | 144 + .../include/google/protobuf/reflection_ops.h | 102 +- .../protobuf/reflection_visit_field_info.h | 1426 + .../google/protobuf/reflection_visit_fields.h | 506 + .../include/google/protobuf/repeated_field.h | 2779 +- .../google/protobuf/repeated_ptr_field.h | 4308 +- .../include/google/protobuf/runtime_version.h | 27 + .../include/google/protobuf/serial_arena.h | 437 + .../grpc/include/google/protobuf/service.h | 361 +- .../google/protobuf/source_context.pb.h | 559 +- .../google/protobuf/source_context.proto | 2 +- .../include/google/protobuf/string_block.h | 181 + .../grpc/include/google/protobuf/struct.pb.h | 2546 +- .../grpc/include/google/protobuf/struct.proto | 4 +- .../include/google/protobuf/stubs/callback.h | 1272 +- .../include/google/protobuf/stubs/common.h | 212 +- .../google/protobuf/stubs/platform_macros.h | 49 +- .../grpc/include/google/protobuf/stubs/port.h | 546 +- .../google/protobuf/stubs/status_macros.h | 71 + .../include/google/protobuf/text_format.h | 1508 +- .../google/protobuf/thread_safe_arena.h | 281 + .../include/google/protobuf/timestamp.pb.h | 555 +- .../include/google/protobuf/timestamp.proto | 7 +- .../grpc/include/google/protobuf/type.pb.h | 5629 ++- .../grpc/include/google/protobuf/type.proto | 8 +- .../google/protobuf/unknown_field_set.h | 843 +- .../protobuf/util/delimited_message_util.h | 145 +- .../google/protobuf/util/field_comparator.h | 507 +- .../google/protobuf/util/field_mask_util.h | 495 +- .../include/google/protobuf/util/json_util.h | 209 +- .../protobuf/util/message_differencer.h | 1917 +- .../include/google/protobuf/util/time_util.h | 565 +- .../google/protobuf/util/type_resolver.h | 103 +- .../google/protobuf/util/type_resolver_util.h | 73 +- .../include/google/protobuf/varint_shuffle.h | 163 + .../include/google/protobuf/wire_format.h | 766 +- .../google/protobuf/wire_format_lite.h | 3974 +- .../include/google/protobuf/wrappers.pb.h | 3902 +- .../include/google/protobuf/wrappers.proto | 4 +- CAPI/cpp/grpc/include/grpc++/alarm.h | 34 +- CAPI/cpp/grpc/include/grpc++/channel.h | 34 +- CAPI/cpp/grpc/include/grpc++/client_context.h | 34 +- .../grpc/include/grpc++/completion_queue.h | 34 +- CAPI/cpp/grpc/include/grpc++/create_channel.h | 34 +- .../include/grpc++/create_channel_posix.h | 34 +- ...alth_check_service_server_builder_option.h | 34 +- .../ext/proto_server_reflection_plugin.h | 28 + .../grpc++/generic/async_generic_service.h | 34 +- .../include/grpc++/generic/generic_stub.h | 34 +- CAPI/cpp/grpc/include/grpc++/grpc++.h | 34 +- .../grpc++/health_check_service_interface.h | 34 +- CAPI/cpp/grpc/include/grpc++/impl/call.h | 34 +- .../grpc++/impl/channel_argument_option.h | 34 +- .../include/grpc++/impl/client_unary_call.h | 34 +- .../grpc++/impl/codegen/async_stream.h | 34 +- .../grpc++/impl/codegen/async_unary_call.h | 34 +- .../include/grpc++/impl/codegen/byte_buffer.h | 34 +- .../grpc/include/grpc++/impl/codegen/call.h | 34 +- .../include/grpc++/impl/codegen/call_hook.h | 34 +- .../grpc++/impl/codegen/channel_interface.h | 34 +- .../grpc++/impl/codegen/client_context.h | 34 +- .../grpc++/impl/codegen/client_unary_call.h | 34 +- .../grpc++/impl/codegen/completion_queue.h | 34 +- .../impl/codegen/completion_queue_tag.h | 34 +- .../grpc/include/grpc++/impl/codegen/config.h | 34 +- .../grpc++/impl/codegen/config_protobuf.h | 34 +- .../grpc++/impl/codegen/create_auth_context.h | 34 +- .../grpc++/impl/codegen/metadata_map.h | 34 +- .../grpc++/impl/codegen/method_handler_impl.h | 34 +- .../include/grpc++/impl/codegen/proto_utils.h | 34 +- .../include/grpc++/impl/codegen/rpc_method.h | 34 +- .../grpc++/impl/codegen/rpc_service_method.h | 34 +- .../impl/codegen/security/auth_context.h | 34 +- .../impl/codegen/serialization_traits.h | 34 +- .../grpc++/impl/codegen/server_context.h | 34 +- .../grpc++/impl/codegen/server_interface.h | 34 +- .../grpc++/impl/codegen/service_type.h | 34 +- .../grpc/include/grpc++/impl/codegen/slice.h | 34 +- .../grpc/include/grpc++/impl/codegen/status.h | 34 +- .../grpc++/impl/codegen/status_code_enum.h | 34 +- .../include/grpc++/impl/codegen/string_ref.h | 34 +- .../grpc++/impl/codegen/stub_options.h | 34 +- .../include/grpc++/impl/codegen/sync_stream.h | 34 +- .../grpc/include/grpc++/impl/codegen/time.h | 34 +- .../grpc/include/grpc++/impl/grpc_library.h | 34 +- .../include/grpc++/impl/method_handler_impl.h | 34 +- .../cpp/grpc/include/grpc++/impl/rpc_method.h | 34 +- .../include/grpc++/impl/rpc_service_method.h | 34 +- .../grpc++/impl/serialization_traits.h | 34 +- .../grpc++/impl/server_builder_option.h | 34 +- .../grpc++/impl/server_builder_plugin.h | 34 +- .../include/grpc++/impl/server_initializer.h | 34 +- .../grpc/include/grpc++/impl/service_type.h | 34 +- CAPI/cpp/grpc/include/grpc++/resource_quota.h | 34 +- .../include/grpc++/security/auth_context.h | 34 +- .../grpc++/security/auth_metadata_processor.h | 34 +- .../include/grpc++/security/credentials.h | 34 +- .../grpc++/security/server_credentials.h | 34 +- CAPI/cpp/grpc/include/grpc++/server.h | 34 +- CAPI/cpp/grpc/include/grpc++/server_builder.h | 34 +- CAPI/cpp/grpc/include/grpc++/server_context.h | 34 +- CAPI/cpp/grpc/include/grpc++/server_posix.h | 34 +- .../include/grpc++/support/async_stream.h | 34 +- .../include/grpc++/support/async_unary_call.h | 34 +- .../grpc/include/grpc++/support/byte_buffer.h | 34 +- .../grpc++/support/channel_arguments.h | 34 +- CAPI/cpp/grpc/include/grpc++/support/config.h | 34 +- .../include/grpc++/support/error_details.h | 34 +- CAPI/cpp/grpc/include/grpc++/support/slice.h | 34 +- CAPI/cpp/grpc/include/grpc++/support/status.h | 34 +- .../include/grpc++/support/status_code_enum.h | 34 +- .../grpc/include/grpc++/support/string_ref.h | 34 +- .../include/grpc++/support/stub_options.h | 34 +- .../grpc/include/grpc++/support/sync_stream.h | 34 +- CAPI/cpp/grpc/include/grpc++/support/time.h | 34 +- CAPI/cpp/grpc/include/grpc/byte_buffer.h | 78 +- .../grpc/include/grpc/byte_buffer_reader.h | 20 +- CAPI/cpp/grpc/include/grpc/census.h | 16 +- CAPI/cpp/grpc/include/grpc/compression.h | 77 +- CAPI/cpp/grpc/include/grpc/credentials.h | 1221 + .../grpc/event_engine/endpoint_config.h | 48 +- .../include/grpc/event_engine/event_engine.h | 933 +- .../include/grpc/event_engine/extensible.h | 71 + .../internal/memory_allocator_impl.h | 80 +- .../grpc/event_engine/internal/slice_cast.h | 79 + .../grpc/event_engine/memory_allocator.h | 419 +- .../grpc/event_engine/memory_request.h | 92 +- .../grpc/include/grpc/event_engine/slice.h | 630 +- .../include/grpc/event_engine/slice_buffer.h | 262 +- CAPI/cpp/grpc/include/grpc/fork.h | 26 +- CAPI/cpp/grpc/include/grpc/grpc.h | 1045 +- .../grpc/include/grpc/grpc_audit_logging.h | 95 + .../cpp/grpc/include/grpc/grpc_crl_provider.h | 95 + CAPI/cpp/grpc/include/grpc/grpc_posix.h | 58 +- CAPI/cpp/grpc/include/grpc/grpc_security.h | 1405 +- .../include/grpc/grpc_security_constants.h | 181 +- CAPI/cpp/grpc/include/grpc/impl/call.h | 28 + .../include/grpc/impl/channel_arg_names.h | 407 + CAPI/cpp/grpc/include/grpc/impl/codegen/atm.h | 74 +- .../grpc/impl/codegen/atm_gcc_atomic.h | 62 +- .../include/grpc/impl/codegen/atm_gcc_sync.h | 71 +- .../include/grpc/impl/codegen/atm_windows.h | 119 +- .../include/grpc/impl/codegen/byte_buffer.h | 81 +- .../grpc/impl/codegen/byte_buffer_reader.h | 26 +- .../grpc/impl/codegen/compression_types.h | 91 +- .../grpc/impl/codegen/connectivity_state.h | 25 +- .../cpp/grpc/include/grpc/impl/codegen/fork.h | 29 +- .../include/grpc/impl/codegen/gpr_types.h | 39 +- .../include/grpc/impl/codegen/grpc_types.h | 826 +- CAPI/cpp/grpc/include/grpc/impl/codegen/log.h | 92 +- .../include/grpc/impl/codegen/port_platform.h | 759 +- .../grpc/impl/codegen/propagation_bits.h | 33 +- .../grpc/include/grpc/impl/codegen/slice.h | 108 +- .../grpc/include/grpc/impl/codegen/status.h | 137 +- .../cpp/grpc/include/grpc/impl/codegen/sync.h | 46 +- .../include/grpc/impl/codegen/sync_abseil.h | 15 +- .../include/grpc/impl/codegen/sync_custom.h | 17 +- .../include/grpc/impl/codegen/sync_generic.h | 35 +- .../include/grpc/impl/codegen/sync_posix.h | 33 +- .../include/grpc/impl/codegen/sync_windows.h | 20 +- .../include/grpc/impl/compression_types.h | 109 + .../include/grpc/impl/connectivity_state.h | 47 + CAPI/cpp/grpc/include/grpc/impl/grpc_types.h | 487 + .../grpc/include/grpc/impl/propagation_bits.h | 54 + CAPI/cpp/grpc/include/grpc/impl/slice_type.h | 111 + CAPI/cpp/grpc/include/grpc/load_reporting.h | 5 +- CAPI/cpp/grpc/include/grpc/passive_listener.h | 62 + CAPI/cpp/grpc/include/grpc/slice.h | 247 +- CAPI/cpp/grpc/include/grpc/slice_buffer.h | 95 +- CAPI/cpp/grpc/include/grpc/status.h | 132 +- CAPI/cpp/grpc/include/grpc/support/alloc.h | 38 +- CAPI/cpp/grpc/include/grpc/support/atm.h | 58 +- .../include/grpc/support/atm_gcc_atomic.h | 60 +- .../grpc/include/grpc/support/atm_gcc_sync.h | 59 +- .../grpc/include/grpc/support/atm_windows.h | 106 +- CAPI/cpp/grpc/include/grpc/support/cpu.h | 21 +- CAPI/cpp/grpc/include/grpc/support/json.h | 217 + CAPI/cpp/grpc/include/grpc/support/log.h | 61 +- .../grpc/include/grpc/support/log_windows.h | 15 +- CAPI/cpp/grpc/include/grpc/support/metrics.h | 66 + .../grpc/include/grpc/support/port_platform.h | 869 +- .../grpc/include/grpc/support/string_util.h | 30 +- CAPI/cpp/grpc/include/grpc/support/sync.h | 267 +- .../grpc/include/grpc/support/sync_abseil.h | 11 +- .../grpc/include/grpc/support/sync_custom.h | 13 +- .../grpc/include/grpc/support/sync_generic.h | 22 +- .../grpc/include/grpc/support/sync_posix.h | 26 +- .../grpc/include/grpc/support/sync_windows.h | 16 +- CAPI/cpp/grpc/include/grpc/support/thd_id.h | 9 +- CAPI/cpp/grpc/include/grpc/support/time.h | 103 +- .../include/grpc/support/workaround_list.h | 7 +- CAPI/cpp/grpc/include/grpcpp/alarm.h | 193 +- CAPI/cpp/grpc/include/grpcpp/channel.h | 206 +- CAPI/cpp/grpc/include/grpcpp/client_context.h | 1027 +- .../grpc/include/grpcpp/completion_queue.h | 894 +- CAPI/cpp/grpc/include/grpcpp/create_channel.h | 131 +- .../include/grpcpp/create_channel_posix.h | 101 +- .../include/grpcpp/ext/call_metric_recorder.h | 179 +- .../grpcpp/ext/channelz_service_plugin.h | 40 + ...alth_check_service_server_builder_option.h | 76 +- .../ext/proto_server_reflection_plugin.h | 58 + .../grpcpp/ext/server_metric_recorder.h | 121 + .../grpcpp/generic/async_generic_service.h | 224 +- .../grpcpp/generic/callback_generic_service.h | 84 + .../include/grpcpp/generic/generic_stub.h | 255 +- .../grpcpp/generic/generic_stub_callback.h | 44 + CAPI/cpp/grpc/include/grpcpp/grpcpp.h | 41 +- .../grpcpp/health_check_service_interface.h | 101 +- CAPI/cpp/grpc/include/grpcpp/impl/call.h | 174 +- CAPI/cpp/grpc/include/grpcpp/impl/call_hook.h | 63 +- .../grpc/include/grpcpp/impl/call_op_set.h | 2325 +- .../grpcpp/impl/call_op_set_interface.h | 107 +- .../grpcpp/impl/channel_argument_option.h | 55 +- .../include/grpcpp/impl/channel_interface.h | 306 +- .../include/grpcpp/impl/client_unary_call.h | 167 +- .../impl/codegen/async_generic_service.h | 34 +- .../grpcpp/impl/codegen/async_stream.h | 32 +- .../grpcpp/impl/codegen/async_unary_call.h | 34 +- .../include/grpcpp/impl/codegen/byte_buffer.h | 34 +- .../grpc/include/grpcpp/impl/codegen/call.h | 34 +- .../include/grpcpp/impl/codegen/call_hook.h | 34 +- .../include/grpcpp/impl/codegen/call_op_set.h | 34 +- .../impl/codegen/call_op_set_interface.h | 34 +- .../grpcpp/impl/codegen/callback_common.h | 34 +- .../grpcpp/impl/codegen/channel_interface.h | 34 +- .../grpcpp/impl/codegen/client_callback.h | 32 +- .../grpcpp/impl/codegen/client_context.h | 34 +- .../grpcpp/impl/codegen/client_interceptor.h | 34 +- .../grpcpp/impl/codegen/client_unary_call.h | 34 +- .../grpcpp/impl/codegen/completion_queue.h | 34 +- .../impl/codegen/completion_queue_tag.h | 72 +- .../grpc/include/grpcpp/impl/codegen/config.h | 34 +- .../grpcpp/impl/codegen/config_protobuf.h | 125 +- .../grpcpp/impl/codegen/create_auth_context.h | 47 +- .../grpcpp/impl/codegen/delegating_channel.h | 110 +- .../grpcpp/impl/codegen/intercepted_channel.h | 108 +- .../include/grpcpp/impl/codegen/interceptor.h | 34 +- .../grpcpp/impl/codegen/interceptor_common.h | 660 +- .../grpcpp/impl/codegen/message_allocator.h | 34 +- .../grpcpp/impl/codegen/metadata_map.h | 141 +- .../grpcpp/impl/codegen/method_handler.h | 34 +- .../grpcpp/impl/codegen/method_handler_impl.h | 34 +- .../grpcpp/impl/codegen/proto_buffer_reader.h | 34 +- .../grpcpp/impl/codegen/proto_buffer_writer.h | 34 +- .../include/grpcpp/impl/codegen/proto_utils.h | 132 +- .../include/grpcpp/impl/codegen/rpc_method.h | 34 +- .../grpcpp/impl/codegen/rpc_service_method.h | 34 +- .../impl/codegen/security/auth_context.h | 34 +- .../impl/codegen/serialization_traits.h | 34 +- .../grpcpp/impl/codegen/server_callback.h | 32 +- .../impl/codegen/server_callback_handlers.h | 1066 +- .../grpcpp/impl/codegen/server_context.h | 34 +- .../grpcpp/impl/codegen/server_interceptor.h | 34 +- .../grpcpp/impl/codegen/server_interface.h | 368 +- .../grpcpp/impl/codegen/service_type.h | 34 +- .../grpc/include/grpcpp/impl/codegen/slice.h | 34 +- .../grpc/include/grpcpp/impl/codegen/status.h | 161 +- .../grpcpp/impl/codegen/status_code_enum.h | 158 +- .../include/grpcpp/impl/codegen/string_ref.h | 34 +- .../grpcpp/impl/codegen/stub_options.h | 34 +- .../grpc/include/grpcpp/impl/codegen/sync.h | 208 +- .../include/grpcpp/impl/codegen/sync_stream.h | 32 +- .../grpc/include/grpcpp/impl/codegen/time.h | 34 +- .../grpcpp/impl/completion_queue_tag.h | 54 + .../include/grpcpp/impl/create_auth_context.h | 34 + .../include/grpcpp/impl/delegating_channel.h | 91 + .../include/grpcpp/impl/generic_serialize.h | 93 + .../grpcpp/impl/generic_stub_internal.h | 125 + .../grpc/include/grpcpp/impl/grpc_library.h | 107 +- .../include/grpcpp/impl/intercepted_channel.h | 83 + .../include/grpcpp/impl/interceptor_common.h | 528 + .../grpc/include/grpcpp/impl/metadata_map.h | 103 + .../include/grpcpp/impl/method_handler_impl.h | 34 +- .../grpc/include/grpcpp/impl/proto_utils.h | 62 + .../cpp/grpc/include/grpcpp/impl/rpc_method.h | 153 +- .../include/grpcpp/impl/rpc_service_method.h | 301 +- .../grpcpp/impl/serialization_traits.h | 106 +- .../grpcpp/impl/server_builder_option.h | 67 +- .../grpcpp/impl/server_builder_plugin.h | 108 +- .../grpcpp/impl/server_callback_handlers.h | 898 + .../include/grpcpp/impl/server_initializer.h | 94 +- .../grpc/include/grpcpp/impl/service_type.h | 467 +- CAPI/cpp/grpc/include/grpcpp/impl/status.h | 140 + CAPI/cpp/grpc/include/grpcpp/impl/sync.h | 150 + .../grpc/include/grpcpp/passive_listener.h | 27 + CAPI/cpp/grpc/include/grpcpp/ports_def.inc | 136 + CAPI/cpp/grpc/include/grpcpp/ports_undef.inc | 74 + CAPI/cpp/grpc/include/grpcpp/resource_quota.h | 105 +- .../include/grpcpp/security/alts_context.h | 111 +- .../grpc/include/grpcpp/security/alts_util.h | 78 +- .../include/grpcpp/security/audit_logging.h | 44 + .../include/grpcpp/security/auth_context.h | 173 +- .../grpcpp/security/auth_metadata_processor.h | 118 +- .../security/authorization_policy_provider.h | 144 +- .../include/grpcpp/security/credentials.h | 682 +- .../grpcpp/security/server_credentials.h | 262 +- .../security/tls_certificate_provider.h | 230 +- .../security/tls_certificate_verifier.h | 423 +- .../grpcpp/security/tls_credentials_options.h | 340 +- .../grpcpp/security/tls_crl_provider.h | 39 + CAPI/cpp/grpc/include/grpcpp/server.h | 679 +- CAPI/cpp/grpc/include/grpcpp/server_builder.h | 883 +- CAPI/cpp/grpc/include/grpcpp/server_context.h | 1386 +- .../grpc/include/grpcpp/server_interface.h | 378 + CAPI/cpp/grpc/include/grpcpp/server_posix.h | 52 +- .../include/grpcpp/support/async_stream.h | 2325 +- .../include/grpcpp/support/async_unary_call.h | 822 +- .../grpc/include/grpcpp/support/byte_buffer.h | 486 +- .../include/grpcpp/support/callback_common.h | 469 +- .../grpcpp/support/channel_arguments.h | 279 +- .../include/grpcpp/support/client_callback.h | 2616 +- .../grpcpp/support/client_interceptor.h | 413 +- CAPI/cpp/grpc/include/grpcpp/support/config.h | 47 +- .../include/grpcpp/support/error_details.h | 136 +- .../grpcpp/support/global_callback_hook.h | 58 + .../grpc/include/grpcpp/support/interceptor.h | 448 +- .../grpcpp/support/message_allocator.h | 134 +- .../include/grpcpp/support/method_handler.h | 810 +- .../grpcpp/support/proto_buffer_reader.h | 376 +- .../grpcpp/support/proto_buffer_writer.h | 390 +- .../include/grpcpp/support/server_callback.h | 1728 +- .../grpcpp/support/server_interceptor.h | 285 +- CAPI/cpp/grpc/include/grpcpp/support/slice.h | 328 +- CAPI/cpp/grpc/include/grpcpp/support/status.h | 36 +- .../include/grpcpp/support/status_code_enum.h | 157 +- .../grpc/include/grpcpp/support/string_ref.h | 351 +- .../include/grpcpp/support/stub_options.h | 70 +- .../grpc/include/grpcpp/support/sync_stream.h | 1961 +- CAPI/cpp/grpc/include/grpcpp/support/time.h | 167 +- .../grpcpp/support/validate_service_config.h | 52 +- CAPI/cpp/grpc/include/grpcpp/version_info.h | 10 +- .../grpc/include/grpcpp/xds_server_builder.h | 174 +- .../include/openssl/__DECC_INCLUDE_EPILOGUE.H | 2 +- .../include/openssl/__DECC_INCLUDE_PROLOGUE.H | 4 +- CAPI/cpp/grpc/include/openssl/aes.h | 151 +- CAPI/cpp/grpc/include/openssl/asn1.h | 1701 +- CAPI/cpp/grpc/include/openssl/asn1err.h | 246 +- CAPI/cpp/grpc/include/openssl/asn1t.h | 1587 +- CAPI/cpp/grpc/include/openssl/async.h | 124 +- CAPI/cpp/grpc/include/openssl/asyncerr.h | 20 +- CAPI/cpp/grpc/include/openssl/bio.h | 1654 +- CAPI/cpp/grpc/include/openssl/bioerr.h | 106 +- CAPI/cpp/grpc/include/openssl/blowfish.h | 87 +- CAPI/cpp/grpc/include/openssl/bn.h | 998 +- CAPI/cpp/grpc/include/openssl/bnerr.h | 56 +- CAPI/cpp/grpc/include/openssl/buffer.h | 80 +- CAPI/cpp/grpc/include/openssl/buffererr.h | 12 +- CAPI/cpp/grpc/include/openssl/byteorder.h | 339 + CAPI/cpp/grpc/include/openssl/camellia.h | 142 +- CAPI/cpp/grpc/include/openssl/cast.h | 91 +- CAPI/cpp/grpc/include/openssl/cmac.h | 75 +- CAPI/cpp/grpc/include/openssl/cmp.h | 898 +- CAPI/cpp/grpc/include/openssl/cmp_util.h | 83 +- CAPI/cpp/grpc/include/openssl/cmperr.h | 216 +- CAPI/cpp/grpc/include/openssl/cms.h | 749 +- CAPI/cpp/grpc/include/openssl/cmserr.h | 213 +- CAPI/cpp/grpc/include/openssl/comp.h | 126 +- CAPI/cpp/grpc/include/openssl/comperr.h | 36 +- CAPI/cpp/grpc/include/openssl/conf.h | 276 +- CAPI/cpp/grpc/include/openssl/conf_api.h | 50 +- CAPI/cpp/grpc/include/openssl/conferr.h | 66 +- CAPI/cpp/grpc/include/openssl/configuration.h | 316 +- CAPI/cpp/grpc/include/openssl/conftypes.h | 46 +- CAPI/cpp/grpc/include/openssl/core.h | 314 +- CAPI/cpp/grpc/include/openssl/core_dispatch.h | 1598 +- CAPI/cpp/grpc/include/openssl/core_names.h | 972 +- CAPI/cpp/grpc/include/openssl/core_object.h | 31 +- CAPI/cpp/grpc/include/openssl/crmf.h | 371 +- CAPI/cpp/grpc/include/openssl/crmferr.h | 69 +- CAPI/cpp/grpc/include/openssl/crypto.h | 919 +- CAPI/cpp/grpc/include/openssl/cryptoerr.h | 75 +- .../grpc/include/openssl/cryptoerr_legacy.h | 2641 +- CAPI/cpp/grpc/include/openssl/ct.h | 1024 +- CAPI/cpp/grpc/include/openssl/cterr.h | 50 +- CAPI/cpp/grpc/include/openssl/decoder.h | 205 +- CAPI/cpp/grpc/include/openssl/decodererr.h | 18 +- CAPI/cpp/grpc/include/openssl/des.h | 300 +- CAPI/cpp/grpc/include/openssl/dh.h | 540 +- CAPI/cpp/grpc/include/openssl/dherr.h | 78 +- CAPI/cpp/grpc/include/openssl/dsa.h | 454 +- CAPI/cpp/grpc/include/openssl/dsaerr.h | 48 +- CAPI/cpp/grpc/include/openssl/dtls1.h | 51 +- CAPI/cpp/grpc/include/openssl/e_os2.h | 455 +- CAPI/cpp/grpc/include/openssl/e_ostime.h | 36 +- CAPI/cpp/grpc/include/openssl/ebcdic.h | 37 +- CAPI/cpp/grpc/include/openssl/ec.h | 2875 +- CAPI/cpp/grpc/include/openssl/ecerr.h | 168 +- CAPI/cpp/grpc/include/openssl/encoder.h | 191 +- CAPI/cpp/grpc/include/openssl/encodererr.h | 18 +- CAPI/cpp/grpc/include/openssl/engine.h | 978 +- CAPI/cpp/grpc/include/openssl/engineerr.h | 86 +- CAPI/cpp/grpc/include/openssl/err.h | 741 +- CAPI/cpp/grpc/include/openssl/ess.h | 132 +- CAPI/cpp/grpc/include/openssl/esserr.h | 28 +- CAPI/cpp/grpc/include/openssl/evp.h | 3675 +- CAPI/cpp/grpc/include/openssl/evperr.h | 249 +- CAPI/cpp/grpc/include/openssl/fips_names.h | 76 +- CAPI/cpp/grpc/include/openssl/fipskey.h | 22 +- CAPI/cpp/grpc/include/openssl/hmac.h | 92 +- CAPI/cpp/grpc/include/openssl/hpke.h | 223 +- CAPI/cpp/grpc/include/openssl/http.h | 150 +- CAPI/cpp/grpc/include/openssl/httperr.h | 75 +- CAPI/cpp/grpc/include/openssl/idea.h | 99 +- CAPI/cpp/grpc/include/openssl/indicator.h | 31 + CAPI/cpp/grpc/include/openssl/kdf.h | 198 +- CAPI/cpp/grpc/include/openssl/kdferr.h | 4 +- CAPI/cpp/grpc/include/openssl/lhash.h | 572 +- CAPI/cpp/grpc/include/openssl/macros.h | 444 +- CAPI/cpp/grpc/include/openssl/md2.h | 88 +- CAPI/cpp/grpc/include/openssl/md4.h | 79 +- CAPI/cpp/grpc/include/openssl/md5.h | 79 +- CAPI/cpp/grpc/include/openssl/mdc2.h | 84 +- CAPI/cpp/grpc/include/openssl/ml_kem.h | 31 + CAPI/cpp/grpc/include/openssl/modes.h | 308 +- CAPI/cpp/grpc/include/openssl/obj_mac.h | 11666 ++--- CAPI/cpp/grpc/include/openssl/objects.h | 302 +- CAPI/cpp/grpc/include/openssl/objectserr.h | 18 +- CAPI/cpp/grpc/include/openssl/ocsp.h | 698 +- CAPI/cpp/grpc/include/openssl/ocsperr.h | 66 +- CAPI/cpp/grpc/include/openssl/opensslconf.h | 10 +- CAPI/cpp/grpc/include/openssl/opensslv.h | 72 +- CAPI/cpp/grpc/include/openssl/ossl_typ.h | 2 +- CAPI/cpp/grpc/include/openssl/param_build.h | 77 +- CAPI/cpp/grpc/include/openssl/params.h | 242 +- CAPI/cpp/grpc/include/openssl/pem.h | 800 +- CAPI/cpp/grpc/include/openssl/pem2.h | 14 +- CAPI/cpp/grpc/include/openssl/pemerr.h | 81 +- CAPI/cpp/grpc/include/openssl/pkcs12.h | 496 +- CAPI/cpp/grpc/include/openssl/pkcs12err.h | 54 +- CAPI/cpp/grpc/include/openssl/pkcs7.h | 711 +- CAPI/cpp/grpc/include/openssl/pkcs7err.h | 88 +- CAPI/cpp/grpc/include/openssl/prov_ssl.h | 37 +- CAPI/cpp/grpc/include/openssl/proverr.h | 286 +- CAPI/cpp/grpc/include/openssl/provider.h | 106 +- CAPI/cpp/grpc/include/openssl/quic.h | 79 +- CAPI/cpp/grpc/include/openssl/rand.h | 199 +- CAPI/cpp/grpc/include/openssl/randerr.h | 103 +- CAPI/cpp/grpc/include/openssl/rc2.h | 82 +- CAPI/cpp/grpc/include/openssl/rc4.h | 57 +- CAPI/cpp/grpc/include/openssl/rc5.h | 93 +- CAPI/cpp/grpc/include/openssl/ripemd.h | 93 +- CAPI/cpp/grpc/include/openssl/rsa.h | 896 +- CAPI/cpp/grpc/include/openssl/rsaerr.h | 176 +- CAPI/cpp/grpc/include/openssl/safestack.h | 441 +- CAPI/cpp/grpc/include/openssl/seed.h | 117 +- CAPI/cpp/grpc/include/openssl/self_test.h | 159 +- CAPI/cpp/grpc/include/openssl/sha.h | 207 +- CAPI/cpp/grpc/include/openssl/srp.h | 406 +- CAPI/cpp/grpc/include/openssl/srtp.h | 65 +- CAPI/cpp/grpc/include/openssl/ssl.h | 4534 +- CAPI/cpp/grpc/include/openssl/ssl2.h | 23 +- CAPI/cpp/grpc/include/openssl/ssl3.h | 543 +- CAPI/cpp/grpc/include/openssl/sslerr.h | 714 +- CAPI/cpp/grpc/include/openssl/sslerr_legacy.h | 880 +- CAPI/cpp/grpc/include/openssl/stack.h | 130 +- CAPI/cpp/grpc/include/openssl/store.h | 587 +- CAPI/cpp/grpc/include/openssl/storeerr.h | 60 +- CAPI/cpp/grpc/include/openssl/symhacks.h | 44 +- CAPI/cpp/grpc/include/openssl/thread.h | 25 +- CAPI/cpp/grpc/include/openssl/tls1.h | 1916 +- CAPI/cpp/grpc/include/openssl/trace.h | 478 +- CAPI/cpp/grpc/include/openssl/ts.h | 759 +- CAPI/cpp/grpc/include/openssl/tserr.h | 94 +- CAPI/cpp/grpc/include/openssl/txt_db.h | 94 +- CAPI/cpp/grpc/include/openssl/types.h | 324 +- CAPI/cpp/grpc/include/openssl/ui.h | 633 +- CAPI/cpp/grpc/include/openssl/uierr.h | 38 +- CAPI/cpp/grpc/include/openssl/whrlpool.h | 98 +- CAPI/cpp/grpc/include/openssl/x509.h | 2025 +- CAPI/cpp/grpc/include/openssl/x509_acert.h | 294 + CAPI/cpp/grpc/include/openssl/x509_vfy.h | 1348 +- CAPI/cpp/grpc/include/openssl/x509err.h | 103 +- CAPI/cpp/grpc/include/openssl/x509v3.h | 2714 +- CAPI/cpp/grpc/include/openssl/x509v3err.h | 157 +- CAPI/cpp/grpc/include/re2/filtered_re2.h | 163 +- CAPI/cpp/grpc/include/re2/re2.h | 1836 +- CAPI/cpp/grpc/include/re2/set.h | 139 +- CAPI/cpp/grpc/include/re2/stringpiece.h | 9 +- CAPI/cpp/grpc/include/upb/port/atomic.h | 83 + CAPI/cpp/grpc/include/upb/port/def.inc | 442 + CAPI/cpp/grpc/include/upb/port/undef.inc | 65 + .../grpc/include/upb/port/vsnprintf_compat.h | 30 + .../grpc/include/upb_generator/common/names.h | 30 + .../include/upb_generator/minitable/names.h | 46 + .../upb_generator/minitable/names_internal.h | 35 + CAPI/cpp/grpc/include/utf8_range.h | 22 + CAPI/cpp/grpc/include/utf8_validity.h | 25 + CAPI/cpp/grpc/include/zconf.h | 722 +- CAPI/cpp/grpc/include/zlib.h | 3606 +- ...17\243\346\226\207\346\241\243_for_cpp.md" | 0 ...20\350\241\214\350\257\264\346\230\216.md" | 27 + 946 files changed, 177365 insertions(+), 134322 deletions(-) create mode 100644 CAPI/cpp/grpc/include/absl/base/internal/poison.h create mode 100644 CAPI/cpp/grpc/include/absl/base/internal/tracing.h create mode 100644 CAPI/cpp/grpc/include/absl/base/no_destructor.h create mode 100644 CAPI/cpp/grpc/include/absl/container/hash_container_defaults.h create mode 100644 CAPI/cpp/grpc/include/absl/container/internal/test_allocator.h create mode 100644 CAPI/cpp/grpc/include/absl/debugging/internal/bounded_utf8_length_sequence.h create mode 100644 CAPI/cpp/grpc/include/absl/debugging/internal/decode_rust_punycode.h create mode 100644 CAPI/cpp/grpc/include/absl/debugging/internal/demangle_rust.h create mode 100644 CAPI/cpp/grpc/include/absl/debugging/internal/utf8_for_code_point.h create mode 100644 CAPI/cpp/grpc/include/absl/functional/overload.h create mode 100644 CAPI/cpp/grpc/include/absl/log/absl_check.h create mode 100644 CAPI/cpp/grpc/include/absl/log/absl_log.h create mode 100644 CAPI/cpp/grpc/include/absl/log/absl_vlog_is_on.h create mode 100644 CAPI/cpp/grpc/include/absl/log/check.h create mode 100644 CAPI/cpp/grpc/include/absl/log/check_test_impl.inc create mode 100644 CAPI/cpp/grpc/include/absl/log/die_if_null.h create mode 100644 CAPI/cpp/grpc/include/absl/log/flags.h create mode 100644 CAPI/cpp/grpc/include/absl/log/globals.h create mode 100644 CAPI/cpp/grpc/include/absl/log/initialize.h create mode 100644 CAPI/cpp/grpc/include/absl/log/internal/append_truncated.h create mode 100644 CAPI/cpp/grpc/include/absl/log/internal/check_impl.h create mode 100644 CAPI/cpp/grpc/include/absl/log/internal/check_op.h create mode 100644 CAPI/cpp/grpc/include/absl/log/internal/conditions.h create mode 100644 CAPI/cpp/grpc/include/absl/log/internal/config.h create mode 100644 CAPI/cpp/grpc/include/absl/log/internal/flags.h create mode 100644 CAPI/cpp/grpc/include/absl/log/internal/fnmatch.h create mode 100644 CAPI/cpp/grpc/include/absl/log/internal/globals.h create mode 100644 CAPI/cpp/grpc/include/absl/log/internal/log_format.h create mode 100644 CAPI/cpp/grpc/include/absl/log/internal/log_impl.h create mode 100644 CAPI/cpp/grpc/include/absl/log/internal/log_message.h create mode 100644 CAPI/cpp/grpc/include/absl/log/internal/log_sink_set.h create mode 100644 CAPI/cpp/grpc/include/absl/log/internal/nullguard.h create mode 100644 CAPI/cpp/grpc/include/absl/log/internal/nullstream.h create mode 100644 CAPI/cpp/grpc/include/absl/log/internal/proto.h create mode 100644 CAPI/cpp/grpc/include/absl/log/internal/strip.h create mode 100644 CAPI/cpp/grpc/include/absl/log/internal/structured.h create mode 100644 CAPI/cpp/grpc/include/absl/log/internal/structured_proto.h create mode 100644 CAPI/cpp/grpc/include/absl/log/internal/test_actions.h create mode 100644 CAPI/cpp/grpc/include/absl/log/internal/test_helpers.h create mode 100644 CAPI/cpp/grpc/include/absl/log/internal/test_matchers.h create mode 100644 CAPI/cpp/grpc/include/absl/log/internal/vlog_config.h create mode 100644 CAPI/cpp/grpc/include/absl/log/internal/voidify.h create mode 100644 CAPI/cpp/grpc/include/absl/log/log.h create mode 100644 CAPI/cpp/grpc/include/absl/log/log_basic_test_impl.inc create mode 100644 CAPI/cpp/grpc/include/absl/log/log_entry.h create mode 100644 CAPI/cpp/grpc/include/absl/log/log_sink.h create mode 100644 CAPI/cpp/grpc/include/absl/log/log_sink_registry.h create mode 100644 CAPI/cpp/grpc/include/absl/log/log_streamer.h create mode 100644 CAPI/cpp/grpc/include/absl/log/scoped_mock_log.h create mode 100644 CAPI/cpp/grpc/include/absl/log/structured.h create mode 100644 CAPI/cpp/grpc/include/absl/log/vlog_is_on.h create mode 100644 CAPI/cpp/grpc/include/absl/random/internal/mock_validators.h create mode 100644 CAPI/cpp/grpc/include/absl/status/internal/status_matchers.h create mode 100644 CAPI/cpp/grpc/include/absl/status/status_matchers.h create mode 100644 CAPI/cpp/grpc/include/absl/strings/charset.h create mode 100644 CAPI/cpp/grpc/include/absl/strings/has_absl_stringify.h create mode 100644 CAPI/cpp/grpc/include/absl/strings/has_ostream_operator.h create mode 100644 CAPI/cpp/grpc/include/google/protobuf/arena_align.h create mode 100644 CAPI/cpp/grpc/include/google/protobuf/arena_allocation_policy.h create mode 100644 CAPI/cpp/grpc/include/google/protobuf/arena_cleanup.h create mode 100644 CAPI/cpp/grpc/include/google/protobuf/compiler/code_generator_lite.h create mode 100644 CAPI/cpp/grpc/include/google/protobuf/compiler/cpp/enum.h create mode 100644 CAPI/cpp/grpc/include/google/protobuf/compiler/cpp/extension.h create mode 100644 CAPI/cpp/grpc/include/google/protobuf/compiler/cpp/field.h create mode 100644 CAPI/cpp/grpc/include/google/protobuf/compiler/cpp/field_generators/generators.h create mode 100644 CAPI/cpp/grpc/include/google/protobuf/compiler/cpp/ifndef_guard.h create mode 100644 CAPI/cpp/grpc/include/google/protobuf/compiler/cpp/message.h create mode 100644 CAPI/cpp/grpc/include/google/protobuf/compiler/cpp/message_layout_helper.h create mode 100644 CAPI/cpp/grpc/include/google/protobuf/compiler/cpp/namespace_printer.h create mode 100644 CAPI/cpp/grpc/include/google/protobuf/compiler/cpp/options.h create mode 100644 CAPI/cpp/grpc/include/google/protobuf/compiler/cpp/padding_optimizer.h create mode 100644 CAPI/cpp/grpc/include/google/protobuf/compiler/cpp/parse_function_generator.h create mode 100644 CAPI/cpp/grpc/include/google/protobuf/compiler/cpp/service.h create mode 100644 CAPI/cpp/grpc/include/google/protobuf/compiler/cpp/tracker.h create mode 100644 CAPI/cpp/grpc/include/google/protobuf/compiler/csharp/csharp_enum.h create mode 100644 CAPI/cpp/grpc/include/google/protobuf/compiler/csharp/csharp_enum_field.h create mode 100644 CAPI/cpp/grpc/include/google/protobuf/compiler/csharp/csharp_field_base.h create mode 100644 CAPI/cpp/grpc/include/google/protobuf/compiler/csharp/csharp_helpers.h create mode 100644 CAPI/cpp/grpc/include/google/protobuf/compiler/csharp/csharp_map_field.h create mode 100644 CAPI/cpp/grpc/include/google/protobuf/compiler/csharp/csharp_message.h create mode 100644 CAPI/cpp/grpc/include/google/protobuf/compiler/csharp/csharp_message_field.h create mode 100644 CAPI/cpp/grpc/include/google/protobuf/compiler/csharp/csharp_primitive_field.h create mode 100644 CAPI/cpp/grpc/include/google/protobuf/compiler/csharp/csharp_reflection_class.h create mode 100644 CAPI/cpp/grpc/include/google/protobuf/compiler/csharp/csharp_repeated_enum_field.h create mode 100644 CAPI/cpp/grpc/include/google/protobuf/compiler/csharp/csharp_repeated_message_field.h create mode 100644 CAPI/cpp/grpc/include/google/protobuf/compiler/csharp/csharp_repeated_primitive_field.h create mode 100644 CAPI/cpp/grpc/include/google/protobuf/compiler/csharp/csharp_source_generator_base.h create mode 100644 CAPI/cpp/grpc/include/google/protobuf/compiler/csharp/csharp_wrapper_field.h create mode 100644 CAPI/cpp/grpc/include/google/protobuf/compiler/csharp/names.h create mode 100644 CAPI/cpp/grpc/include/google/protobuf/compiler/java/context.h create mode 100644 CAPI/cpp/grpc/include/google/protobuf/compiler/java/doc_comment.h create mode 100644 CAPI/cpp/grpc/include/google/protobuf/compiler/java/field_common.h create mode 100644 CAPI/cpp/grpc/include/google/protobuf/compiler/java/file.h create mode 100644 CAPI/cpp/grpc/include/google/protobuf/compiler/java/full/enum.h create mode 100644 CAPI/cpp/grpc/include/google/protobuf/compiler/java/full/enum_field.h create mode 100644 CAPI/cpp/grpc/include/google/protobuf/compiler/java/full/extension.h create mode 100644 CAPI/cpp/grpc/include/google/protobuf/compiler/java/full/field_generator.h create mode 100644 CAPI/cpp/grpc/include/google/protobuf/compiler/java/full/generator_factory.h create mode 100644 CAPI/cpp/grpc/include/google/protobuf/compiler/java/full/make_field_gens.h create mode 100644 CAPI/cpp/grpc/include/google/protobuf/compiler/java/full/map_field.h create mode 100644 CAPI/cpp/grpc/include/google/protobuf/compiler/java/full/message.h create mode 100644 CAPI/cpp/grpc/include/google/protobuf/compiler/java/full/message_builder.h create mode 100644 CAPI/cpp/grpc/include/google/protobuf/compiler/java/full/message_field.h create mode 100644 CAPI/cpp/grpc/include/google/protobuf/compiler/java/full/primitive_field.h create mode 100644 CAPI/cpp/grpc/include/google/protobuf/compiler/java/full/service.h create mode 100644 CAPI/cpp/grpc/include/google/protobuf/compiler/java/full/string_field.h create mode 100644 CAPI/cpp/grpc/include/google/protobuf/compiler/java/generator_common.h create mode 100644 CAPI/cpp/grpc/include/google/protobuf/compiler/java/generator_factory.h create mode 100644 CAPI/cpp/grpc/include/google/protobuf/compiler/java/helpers.h create mode 100644 CAPI/cpp/grpc/include/google/protobuf/compiler/java/internal_helpers.h create mode 100644 CAPI/cpp/grpc/include/google/protobuf/compiler/java/java_features.pb.h create mode 100644 CAPI/cpp/grpc/include/google/protobuf/compiler/java/lite/enum.h create mode 100644 CAPI/cpp/grpc/include/google/protobuf/compiler/java/lite/enum_field.h create mode 100644 CAPI/cpp/grpc/include/google/protobuf/compiler/java/lite/extension.h create mode 100644 CAPI/cpp/grpc/include/google/protobuf/compiler/java/lite/field_generator.h create mode 100644 CAPI/cpp/grpc/include/google/protobuf/compiler/java/lite/generator_factory.h create mode 100644 CAPI/cpp/grpc/include/google/protobuf/compiler/java/lite/make_field_gens.h create mode 100644 CAPI/cpp/grpc/include/google/protobuf/compiler/java/lite/map_field.h create mode 100644 CAPI/cpp/grpc/include/google/protobuf/compiler/java/lite/message.h create mode 100644 CAPI/cpp/grpc/include/google/protobuf/compiler/java/lite/message_builder.h create mode 100644 CAPI/cpp/grpc/include/google/protobuf/compiler/java/lite/message_field.h create mode 100644 CAPI/cpp/grpc/include/google/protobuf/compiler/java/lite/primitive_field.h create mode 100644 CAPI/cpp/grpc/include/google/protobuf/compiler/java/lite/string_field.h create mode 100644 CAPI/cpp/grpc/include/google/protobuf/compiler/java/message_serialization.h create mode 100644 CAPI/cpp/grpc/include/google/protobuf/compiler/java/name_resolver.h create mode 100644 CAPI/cpp/grpc/include/google/protobuf/compiler/java/options.h create mode 100644 CAPI/cpp/grpc/include/google/protobuf/compiler/java/shared_code_generator.h create mode 100644 CAPI/cpp/grpc/include/google/protobuf/compiler/kotlin/file.h create mode 100644 CAPI/cpp/grpc/include/google/protobuf/compiler/kotlin/generator.h create mode 100644 CAPI/cpp/grpc/include/google/protobuf/compiler/kotlin/message.h create mode 100644 CAPI/cpp/grpc/include/google/protobuf/compiler/objectivec/enum.h create mode 100644 CAPI/cpp/grpc/include/google/protobuf/compiler/objectivec/enum_field.h create mode 100644 CAPI/cpp/grpc/include/google/protobuf/compiler/objectivec/extension.h create mode 100644 CAPI/cpp/grpc/include/google/protobuf/compiler/objectivec/field.h create mode 100644 CAPI/cpp/grpc/include/google/protobuf/compiler/objectivec/file.h create mode 100644 CAPI/cpp/grpc/include/google/protobuf/compiler/objectivec/generator.h create mode 100644 CAPI/cpp/grpc/include/google/protobuf/compiler/objectivec/helpers.h create mode 100644 CAPI/cpp/grpc/include/google/protobuf/compiler/objectivec/import_writer.h create mode 100644 CAPI/cpp/grpc/include/google/protobuf/compiler/objectivec/line_consumer.h create mode 100644 CAPI/cpp/grpc/include/google/protobuf/compiler/objectivec/map_field.h create mode 100644 CAPI/cpp/grpc/include/google/protobuf/compiler/objectivec/message.h create mode 100644 CAPI/cpp/grpc/include/google/protobuf/compiler/objectivec/message_field.h create mode 100644 CAPI/cpp/grpc/include/google/protobuf/compiler/objectivec/names.h create mode 100644 CAPI/cpp/grpc/include/google/protobuf/compiler/objectivec/nsobject_methods.h create mode 100644 CAPI/cpp/grpc/include/google/protobuf/compiler/objectivec/oneof.h create mode 100644 CAPI/cpp/grpc/include/google/protobuf/compiler/objectivec/options.h create mode 100644 CAPI/cpp/grpc/include/google/protobuf/compiler/objectivec/primitive_field.h create mode 100644 CAPI/cpp/grpc/include/google/protobuf/compiler/objectivec/tf_decode_data.h create mode 100644 CAPI/cpp/grpc/include/google/protobuf/compiler/php/names.h create mode 100644 CAPI/cpp/grpc/include/google/protobuf/compiler/python/helpers.h create mode 100644 CAPI/cpp/grpc/include/google/protobuf/compiler/retention.h create mode 100644 CAPI/cpp/grpc/include/google/protobuf/compiler/rust/accessors/accessor_case.h create mode 100644 CAPI/cpp/grpc/include/google/protobuf/compiler/rust/accessors/accessors.h create mode 100644 CAPI/cpp/grpc/include/google/protobuf/compiler/rust/accessors/default_value.h create mode 100644 CAPI/cpp/grpc/include/google/protobuf/compiler/rust/accessors/generator.h create mode 100644 CAPI/cpp/grpc/include/google/protobuf/compiler/rust/accessors/with_presence.h create mode 100644 CAPI/cpp/grpc/include/google/protobuf/compiler/rust/context.h create mode 100644 CAPI/cpp/grpc/include/google/protobuf/compiler/rust/crate_mapping.h create mode 100644 CAPI/cpp/grpc/include/google/protobuf/compiler/rust/enum.h create mode 100644 CAPI/cpp/grpc/include/google/protobuf/compiler/rust/generator.h create mode 100644 CAPI/cpp/grpc/include/google/protobuf/compiler/rust/message.h create mode 100644 CAPI/cpp/grpc/include/google/protobuf/compiler/rust/naming.h create mode 100644 CAPI/cpp/grpc/include/google/protobuf/compiler/rust/oneof.h create mode 100644 CAPI/cpp/grpc/include/google/protobuf/compiler/rust/relative_path.h create mode 100644 CAPI/cpp/grpc/include/google/protobuf/compiler/rust/rust_field_type.h create mode 100644 CAPI/cpp/grpc/include/google/protobuf/compiler/rust/rust_keywords.h create mode 100644 CAPI/cpp/grpc/include/google/protobuf/compiler/rust/upb_helpers.h create mode 100644 CAPI/cpp/grpc/include/google/protobuf/compiler/scc.h create mode 100644 CAPI/cpp/grpc/include/google/protobuf/compiler/subprocess.h create mode 100644 CAPI/cpp/grpc/include/google/protobuf/compiler/versions.h create mode 100644 CAPI/cpp/grpc/include/google/protobuf/compiler/zip_writer.h create mode 100644 CAPI/cpp/grpc/include/google/protobuf/cpp_edition_defaults.h create mode 100644 CAPI/cpp/grpc/include/google/protobuf/cpp_features.pb.h create mode 100644 CAPI/cpp/grpc/include/google/protobuf/cpp_features.proto create mode 100644 CAPI/cpp/grpc/include/google/protobuf/descriptor_legacy.h create mode 100644 CAPI/cpp/grpc/include/google/protobuf/descriptor_lite.h create mode 100644 CAPI/cpp/grpc/include/google/protobuf/descriptor_visitor.h create mode 100644 CAPI/cpp/grpc/include/google/protobuf/feature_resolver.h create mode 100644 CAPI/cpp/grpc/include/google/protobuf/generated_message_tctable_gen.h create mode 100644 CAPI/cpp/grpc/include/google/protobuf/internal_visibility.h create mode 100644 CAPI/cpp/grpc/include/google/protobuf/io/zero_copy_sink.h create mode 100644 CAPI/cpp/grpc/include/google/protobuf/json/internal/descriptor_traits.h create mode 100644 CAPI/cpp/grpc/include/google/protobuf/json/internal/lexer.h create mode 100644 CAPI/cpp/grpc/include/google/protobuf/json/internal/message_path.h create mode 100644 CAPI/cpp/grpc/include/google/protobuf/json/internal/parser.h create mode 100644 CAPI/cpp/grpc/include/google/protobuf/json/internal/parser_traits.h create mode 100644 CAPI/cpp/grpc/include/google/protobuf/json/internal/unparser.h create mode 100644 CAPI/cpp/grpc/include/google/protobuf/json/internal/unparser_traits.h create mode 100644 CAPI/cpp/grpc/include/google/protobuf/json/internal/untyped_message.h create mode 100644 CAPI/cpp/grpc/include/google/protobuf/json/internal/writer.h create mode 100644 CAPI/cpp/grpc/include/google/protobuf/json/internal/zero_copy_buffered_stream.h create mode 100644 CAPI/cpp/grpc/include/google/protobuf/json/json.h create mode 100644 CAPI/cpp/grpc/include/google/protobuf/raw_ptr.h create mode 100644 CAPI/cpp/grpc/include/google/protobuf/reflection_internal.h create mode 100644 CAPI/cpp/grpc/include/google/protobuf/reflection_mode.h create mode 100644 CAPI/cpp/grpc/include/google/protobuf/reflection_visit_field_info.h create mode 100644 CAPI/cpp/grpc/include/google/protobuf/reflection_visit_fields.h create mode 100644 CAPI/cpp/grpc/include/google/protobuf/runtime_version.h create mode 100644 CAPI/cpp/grpc/include/google/protobuf/serial_arena.h create mode 100644 CAPI/cpp/grpc/include/google/protobuf/string_block.h create mode 100644 CAPI/cpp/grpc/include/google/protobuf/stubs/status_macros.h create mode 100644 CAPI/cpp/grpc/include/google/protobuf/thread_safe_arena.h create mode 100644 CAPI/cpp/grpc/include/google/protobuf/varint_shuffle.h create mode 100644 CAPI/cpp/grpc/include/grpc++/ext/proto_server_reflection_plugin.h create mode 100644 CAPI/cpp/grpc/include/grpc/credentials.h create mode 100644 CAPI/cpp/grpc/include/grpc/event_engine/extensible.h create mode 100644 CAPI/cpp/grpc/include/grpc/event_engine/internal/slice_cast.h create mode 100644 CAPI/cpp/grpc/include/grpc/grpc_audit_logging.h create mode 100644 CAPI/cpp/grpc/include/grpc/grpc_crl_provider.h create mode 100644 CAPI/cpp/grpc/include/grpc/impl/call.h create mode 100644 CAPI/cpp/grpc/include/grpc/impl/channel_arg_names.h create mode 100644 CAPI/cpp/grpc/include/grpc/impl/compression_types.h create mode 100644 CAPI/cpp/grpc/include/grpc/impl/connectivity_state.h create mode 100644 CAPI/cpp/grpc/include/grpc/impl/grpc_types.h create mode 100644 CAPI/cpp/grpc/include/grpc/impl/propagation_bits.h create mode 100644 CAPI/cpp/grpc/include/grpc/impl/slice_type.h create mode 100644 CAPI/cpp/grpc/include/grpc/passive_listener.h create mode 100644 CAPI/cpp/grpc/include/grpc/support/json.h create mode 100644 CAPI/cpp/grpc/include/grpc/support/metrics.h create mode 100644 CAPI/cpp/grpc/include/grpcpp/ext/channelz_service_plugin.h create mode 100644 CAPI/cpp/grpc/include/grpcpp/ext/proto_server_reflection_plugin.h create mode 100644 CAPI/cpp/grpc/include/grpcpp/ext/server_metric_recorder.h create mode 100644 CAPI/cpp/grpc/include/grpcpp/generic/callback_generic_service.h create mode 100644 CAPI/cpp/grpc/include/grpcpp/generic/generic_stub_callback.h create mode 100644 CAPI/cpp/grpc/include/grpcpp/impl/completion_queue_tag.h create mode 100644 CAPI/cpp/grpc/include/grpcpp/impl/create_auth_context.h create mode 100644 CAPI/cpp/grpc/include/grpcpp/impl/delegating_channel.h create mode 100644 CAPI/cpp/grpc/include/grpcpp/impl/generic_serialize.h create mode 100644 CAPI/cpp/grpc/include/grpcpp/impl/generic_stub_internal.h create mode 100644 CAPI/cpp/grpc/include/grpcpp/impl/intercepted_channel.h create mode 100644 CAPI/cpp/grpc/include/grpcpp/impl/interceptor_common.h create mode 100644 CAPI/cpp/grpc/include/grpcpp/impl/metadata_map.h create mode 100644 CAPI/cpp/grpc/include/grpcpp/impl/proto_utils.h create mode 100644 CAPI/cpp/grpc/include/grpcpp/impl/server_callback_handlers.h create mode 100644 CAPI/cpp/grpc/include/grpcpp/impl/status.h create mode 100644 CAPI/cpp/grpc/include/grpcpp/impl/sync.h create mode 100644 CAPI/cpp/grpc/include/grpcpp/passive_listener.h create mode 100644 CAPI/cpp/grpc/include/grpcpp/ports_def.inc create mode 100644 CAPI/cpp/grpc/include/grpcpp/ports_undef.inc create mode 100644 CAPI/cpp/grpc/include/grpcpp/security/audit_logging.h create mode 100644 CAPI/cpp/grpc/include/grpcpp/security/tls_crl_provider.h create mode 100644 CAPI/cpp/grpc/include/grpcpp/server_interface.h create mode 100644 CAPI/cpp/grpc/include/grpcpp/support/global_callback_hook.h create mode 100644 CAPI/cpp/grpc/include/openssl/byteorder.h create mode 100644 CAPI/cpp/grpc/include/openssl/indicator.h create mode 100644 CAPI/cpp/grpc/include/openssl/ml_kem.h create mode 100644 CAPI/cpp/grpc/include/openssl/x509_acert.h create mode 100644 CAPI/cpp/grpc/include/upb/port/atomic.h create mode 100644 CAPI/cpp/grpc/include/upb/port/def.inc create mode 100644 CAPI/cpp/grpc/include/upb/port/undef.inc create mode 100644 CAPI/cpp/grpc/include/upb/port/vsnprintf_compat.h create mode 100644 CAPI/cpp/grpc/include/upb_generator/common/names.h create mode 100644 CAPI/cpp/grpc/include/upb_generator/minitable/names.h create mode 100644 CAPI/cpp/grpc/include/upb_generator/minitable/names_internal.h create mode 100644 CAPI/cpp/grpc/include/utf8_range.h create mode 100644 CAPI/cpp/grpc/include/utf8_validity.h rename "CAPI/cpp/API\346\226\207\346\241\243.md" => "docs/THUAI9_API\346\216\245\345\217\243\346\226\207\346\241\243_for_cpp.md" (100%) create mode 100644 "docs/THUAI9_CPP\351\200\211\346\211\213\350\277\220\350\241\214\350\257\264\346\230\216.md" diff --git a/CAPI/cpp/.gitignore b/CAPI/cpp/.gitignore index b0d8cd15..b87550b3 100644 --- a/CAPI/cpp/.gitignore +++ b/CAPI/cpp/.gitignore @@ -499,4 +499,3 @@ CTestTestfile.cmake _deps /build/ -/lib/ diff --git a/CAPI/cpp/API.sln b/CAPI/cpp/API.sln index d3e8f7cc..27cc63b7 100644 --- a/CAPI/cpp/API.sln +++ b/CAPI/cpp/API.sln @@ -8,25 +8,13 @@ EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution Debug|x64 = Debug|x64 - Debug|x86 = Debug|x86 - ReDyn|x64 = ReDyn|x64 - ReDyn|x86 = ReDyn|x86 Release|x64 = Release|x64 - Release|x86 = Release|x86 EndGlobalSection GlobalSection(ProjectConfigurationPlatforms) = postSolution {689DDF03-CFAE-4148-8D49-A16B5C6AA039}.Debug|x64.ActiveCfg = Debug|x64 {689DDF03-CFAE-4148-8D49-A16B5C6AA039}.Debug|x64.Build.0 = Debug|x64 - {689DDF03-CFAE-4148-8D49-A16B5C6AA039}.Debug|x86.ActiveCfg = Debug|Win32 - {689DDF03-CFAE-4148-8D49-A16B5C6AA039}.Debug|x86.Build.0 = Debug|Win32 - {689DDF03-CFAE-4148-8D49-A16B5C6AA039}.ReDyn|x64.ActiveCfg = ReleaseDynamic|x64 - {689DDF03-CFAE-4148-8D49-A16B5C6AA039}.ReDyn|x64.Build.0 = ReleaseDynamic|x64 - {689DDF03-CFAE-4148-8D49-A16B5C6AA039}.ReDyn|x86.ActiveCfg = ReleaseDynamic|Win32 - {689DDF03-CFAE-4148-8D49-A16B5C6AA039}.ReDyn|x86.Build.0 = ReleaseDynamic|Win32 {689DDF03-CFAE-4148-8D49-A16B5C6AA039}.Release|x64.ActiveCfg = Release|x64 {689DDF03-CFAE-4148-8D49-A16B5C6AA039}.Release|x64.Build.0 = Release|x64 - {689DDF03-CFAE-4148-8D49-A16B5C6AA039}.Release|x86.ActiveCfg = Release|Win32 - {689DDF03-CFAE-4148-8D49-A16B5C6AA039}.Release|x86.Build.0 = Release|Win32 EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE diff --git a/CAPI/cpp/API/API.vcxproj b/CAPI/cpp/API/API.vcxproj index a3e81efa..ec940719 100644 --- a/CAPI/cpp/API/API.vcxproj +++ b/CAPI/cpp/API/API.vcxproj @@ -1,207 +1 @@ - - - - - Debug - Win32 - - - Release - Win32 - - - Debug - x64 - - - Release - x64 - - - - 16.0 - Win32Proj - {689DDF03-CFAE-4148-8D49-A16B5C6AA039} - API - 10.0 - - - - Application - true - v143 - Unicode - - - Application - false - v143 - true - Unicode - - - Application - true - v143 - Unicode - - - Application - false - v143 - true - Unicode - - - - - - - - - - - - - - - - - - - - - true - - - false - - - true - x64-windows-static - - - false - x64-windows-static - - - - Level3 - true - WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions) - true - stdcpp17 - stdc17 - ..\spdlog\include;..\tclap\include;..\grpc\include;..\proto;include;%(AdditionalIncludeDirectories) - /source-charset:utf-8 %(AdditionalOptions) - MultiThreadedDebugDLL - true - - - Console - true - ..\lib\debug;%(AdditionalLibraryDirectories) - absl_bad_any_cast_impl.lib;absl_bad_optional_access.lib;absl_bad_variant_access.lib;absl_base.lib;absl_city.lib;absl_civil_time.lib;absl_cord.lib;absl_cordz_functions.lib;absl_cordz_handle.lib;absl_cordz_info.lib;absl_cordz_sample_token.lib;absl_cord_internal.lib;absl_debugging_internal.lib;absl_demangle_internal.lib;absl_examine_stack.lib;absl_exponential_biased.lib;absl_failure_signal_handler.lib;absl_flags.lib;absl_flags_commandlineflag.lib;absl_flags_commandlineflag_internal.lib;absl_flags_config.lib;absl_flags_internal.lib;absl_flags_marshalling.lib;absl_flags_parse.lib;absl_flags_private_handle_accessor.lib;absl_flags_program_name.lib;absl_flags_reflection.lib;absl_flags_usage.lib;absl_flags_usage_internal.lib;absl_graphcycles_internal.lib;absl_hash.lib;absl_hashtablez_sampler.lib;absl_int128.lib;absl_leak_check.lib;absl_log_severity.lib;absl_low_level_hash.lib;absl_malloc_internal.lib;absl_periodic_sampler.lib;absl_random_distributions.lib;absl_random_internal_distribution_test_util.lib;absl_random_internal_platform.lib;absl_random_internal_pool_urbg.lib;absl_random_internal_randen.lib;absl_random_internal_randen_hwaes.lib;absl_random_internal_randen_hwaes_impl.lib;absl_random_internal_randen_slow.lib;absl_random_internal_seed_material.lib;absl_random_seed_gen_exception.lib;absl_random_seed_sequences.lib;absl_raw_hash_set.lib;absl_raw_logging_internal.lib;absl_scoped_set_env.lib;absl_spinlock_wait.lib;absl_stacktrace.lib;absl_status.lib;absl_statusor.lib;absl_strerror.lib;absl_strings.lib;absl_strings_internal.lib;absl_str_format_internal.lib;absl_symbolize.lib;absl_synchronization.lib;absl_throw_delegate.lib;absl_time.lib;absl_time_zone.lib;address_sorting.lib;cares.lib;descriptor_upb_proto.lib;gpr.lib;grpc++.lib;grpc++_alts.lib;grpc++_error_details.lib;grpc++_unsecure.lib;grpc.lib;grpc_plugin_support.lib;grpc_unsecure.lib;libcrypto.lib;libprotobuf-lited.lib;libprotobufd.lib;libprotocd.lib;libssl.lib;re2.lib;upb.lib;upb_collections.lib;upb_extension_registry.lib;upb_fastdecode.lib;upb_json.lib;upb_mini_table.lib;upb_reflection.lib;upb_textformat.lib;upb_utf8_range.lib;zlibd.lib;Ws2_32.lib;Crypt32.lib;Iphlpapi.lib;%(AdditionalDependencies) - - - - - Level3 - true - true - true - WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions) - true - stdcpp17 - stdc17 - ..\spdlog\include;..\tclap\include;..\grpc\include;..\proto;include;%(AdditionalIncludeDirectories) - /source-charset:utf-8 %(AdditionalOptions) - MultiThreaded - true - - - Console - true - true - true - absl_bad_any_cast_impl.lib;absl_bad_optional_access.lib;absl_bad_variant_access.lib;absl_base.lib;absl_city.lib;absl_civil_time.lib;absl_cord.lib;absl_cordz_functions.lib;absl_cordz_handle.lib;absl_cordz_info.lib;absl_cordz_sample_token.lib;absl_cord_internal.lib;absl_debugging_internal.lib;absl_demangle_internal.lib;absl_examine_stack.lib;absl_exponential_biased.lib;absl_failure_signal_handler.lib;absl_flags.lib;absl_flags_commandlineflag.lib;absl_flags_commandlineflag_internal.lib;absl_flags_config.lib;absl_flags_internal.lib;absl_flags_marshalling.lib;absl_flags_parse.lib;absl_flags_private_handle_accessor.lib;absl_flags_program_name.lib;absl_flags_reflection.lib;absl_flags_usage.lib;absl_flags_usage_internal.lib;absl_graphcycles_internal.lib;absl_hash.lib;absl_hashtablez_sampler.lib;absl_int128.lib;absl_leak_check.lib;absl_log_severity.lib;absl_low_level_hash.lib;absl_malloc_internal.lib;absl_periodic_sampler.lib;absl_random_distributions.lib;absl_random_internal_distribution_test_util.lib;absl_random_internal_platform.lib;absl_random_internal_pool_urbg.lib;absl_random_internal_randen.lib;absl_random_internal_randen_hwaes.lib;absl_random_internal_randen_hwaes_impl.lib;absl_random_internal_randen_slow.lib;absl_random_internal_seed_material.lib;absl_random_seed_gen_exception.lib;absl_random_seed_sequences.lib;absl_raw_hash_set.lib;absl_raw_logging_internal.lib;absl_scoped_set_env.lib;absl_spinlock_wait.lib;absl_stacktrace.lib;absl_status.lib;absl_statusor.lib;absl_strerror.lib;absl_strings.lib;absl_strings_internal.lib;absl_str_format_internal.lib;absl_symbolize.lib;absl_synchronization.lib;absl_throw_delegate.lib;absl_time.lib;absl_time_zone.lib;address_sorting.lib;cares.lib;descriptor_upb_proto.lib;gpr.lib;grpc++.lib;grpc++_alts.lib;grpc++_error_details.lib;grpc++_unsecure.lib;grpc.lib;grpc_plugin_support.lib;grpc_unsecure.lib;libcrypto.lib;libprotobuf-lite.lib;libprotobuf.lib;libprotoc.lib;libssl.lib;re2.lib;upb.lib;upb_collections.lib;upb_extension_registry.lib;upb_fastdecode.lib;upb_json.lib;upb_mini_table.lib;upb_reflection.lib;upb_textformat.lib;upb_utf8_range.lib;zlib.lib;Ws2_32.lib;Crypt32.lib;Iphlpapi.lib;%(AdditionalDependencies) - ..\lib\release;%(AdditionalLibraryDirectories) - - - - - Level3 - true - _DEBUG;_CONSOLE;%(PreprocessorDefinitions) - true - stdcpp17 - stdc17 - ..\fmt;..\spdlog\include;..\tclap\include;..\proto;include;%(AdditionalIncludeDirectories) - /utf-8 %(AdditionalOptions) - MultiThreadedDebug - true - - - Console - true - $(VcpkgRoot)installed\x64-windows-static\debug\lib;$(VcpkgRoot)installed\x64-windows-static\lib;%(AdditionalLibraryDirectories) - absl_bad_any_cast_impl.lib;absl_bad_optional_access.lib;absl_bad_variant_access.lib;absl_base.lib;absl_city.lib;absl_civil_time.lib;absl_cord.lib;absl_cordz_functions.lib;absl_cordz_handle.lib;absl_cordz_info.lib;absl_cordz_sample_token.lib;absl_cord_internal.lib;absl_crc32c.lib;absl_crc_cord_state.lib;absl_crc_cpu_detect.lib;absl_crc_internal.lib;absl_debugging_internal.lib;absl_demangle_internal.lib;absl_die_if_null.lib;absl_examine_stack.lib;absl_exponential_biased.lib;absl_failure_signal_handler.lib;absl_flags_commandlineflag.lib;absl_flags_commandlineflag_internal.lib;absl_flags_config.lib;absl_flags_internal.lib;absl_flags_marshalling.lib;absl_flags_parse.lib;absl_flags_private_handle_accessor.lib;absl_flags_program_name.lib;absl_flags_reflection.lib;absl_flags_usage.lib;absl_flags_usage_internal.lib;absl_graphcycles_internal.lib;absl_hash.lib;absl_hashtablez_sampler.lib;absl_int128.lib;absl_kernel_timeout_internal.lib;absl_leak_check.lib;absl_log_entry.lib;absl_log_flags.lib;absl_log_globals.lib;absl_log_initialize.lib;absl_log_internal_check_op.lib;absl_log_internal_conditions.lib;absl_log_internal_format.lib;absl_log_internal_globals.lib;absl_log_internal_log_sink_set.lib;absl_log_internal_message.lib;absl_log_internal_nullguard.lib;absl_log_internal_proto.lib;absl_log_severity.lib;absl_log_sink.lib;absl_low_level_hash.lib;absl_malloc_internal.lib;absl_periodic_sampler.lib;absl_random_distributions.lib;absl_random_internal_distribution_test_util.lib;absl_random_internal_platform.lib;absl_random_internal_pool_urbg.lib;absl_random_internal_randen.lib;absl_random_internal_randen_hwaes.lib;absl_random_internal_randen_hwaes_impl.lib;absl_random_internal_randen_slow.lib;absl_random_internal_seed_material.lib;absl_random_seed_gen_exception.lib;absl_random_seed_sequences.lib;absl_raw_hash_set.lib;absl_raw_logging_internal.lib;absl_scoped_set_env.lib;absl_spinlock_wait.lib;absl_stacktrace.lib;absl_status.lib;absl_statusor.lib;absl_strerror.lib;absl_strings.lib;absl_strings_internal.lib;absl_string_view.lib;absl_str_format_internal.lib;absl_symbolize.lib;absl_synchronization.lib;absl_throw_delegate.lib;absl_time.lib;absl_time_zone.lib;address_sorting.lib;cares.lib;gpr.lib;grpc++.lib;grpc++_alts.lib;grpc++_error_details.lib;grpc++_reflection.lib;grpc++_unsecure.lib;grpc.lib;grpcpp_channelz.lib;grpc_authorization_provider.lib;grpc_plugin_support.lib;grpc_unsecure.lib;libcrypto.lib;libprotobuf-lited.lib;libprotobufd.lib;libprotocd.lib;libssl.lib;re2.lib;upb_base_lib.lib;upb_json_lib.lib;upb_mem_lib.lib;upb_message_lib.lib;upb_mini_descriptor_lib.lib;upb_textformat_lib.lib;upb_wire_lib.lib;utf8_range.lib;utf8_validity.lib;zlibd.lib;Ws2_32.lib;Crypt32.lib;Iphlpapi.lib;%(AdditionalDependencies) - - - - - Level3 - true - true - true - NDEBUG;_CONSOLE;%(PreprocessorDefinitions) - true - stdcpp17 - stdc17 - ..\fmt;..\spdlog\include;..\tclap\include;..\proto;include;%(AdditionalIncludeDirectories) - /utf-8 %(AdditionalOptions) - MultiThreaded - true - - - Console - true - true - true - absl_bad_any_cast_impl.lib;absl_bad_optional_access.lib;absl_bad_variant_access.lib;absl_base.lib;absl_city.lib;absl_civil_time.lib;absl_cord.lib;absl_cordz_functions.lib;absl_cordz_handle.lib;absl_cordz_info.lib;absl_cordz_sample_token.lib;absl_cord_internal.lib;absl_crc32c.lib;absl_crc_cord_state.lib;absl_crc_cpu_detect.lib;absl_crc_internal.lib;absl_debugging_internal.lib;absl_demangle_internal.lib;absl_die_if_null.lib;absl_examine_stack.lib;absl_exponential_biased.lib;absl_failure_signal_handler.lib;absl_flags_commandlineflag.lib;absl_flags_commandlineflag_internal.lib;absl_flags_config.lib;absl_flags_internal.lib;absl_flags_marshalling.lib;absl_flags_parse.lib;absl_flags_private_handle_accessor.lib;absl_flags_program_name.lib;absl_flags_reflection.lib;absl_flags_usage.lib;absl_flags_usage_internal.lib;absl_graphcycles_internal.lib;absl_hash.lib;absl_hashtablez_sampler.lib;absl_int128.lib;absl_kernel_timeout_internal.lib;absl_leak_check.lib;absl_log_entry.lib;absl_log_flags.lib;absl_log_globals.lib;absl_log_initialize.lib;absl_log_internal_check_op.lib;absl_log_internal_conditions.lib;absl_log_internal_format.lib;absl_log_internal_globals.lib;absl_log_internal_log_sink_set.lib;absl_log_internal_message.lib;absl_log_internal_nullguard.lib;absl_log_internal_proto.lib;absl_log_severity.lib;absl_log_sink.lib;absl_low_level_hash.lib;absl_malloc_internal.lib;absl_periodic_sampler.lib;absl_random_distributions.lib;absl_random_internal_distribution_test_util.lib;absl_random_internal_platform.lib;absl_random_internal_pool_urbg.lib;absl_random_internal_randen.lib;absl_random_internal_randen_hwaes.lib;absl_random_internal_randen_hwaes_impl.lib;absl_random_internal_randen_slow.lib;absl_random_internal_seed_material.lib;absl_random_seed_gen_exception.lib;absl_random_seed_sequences.lib;absl_raw_hash_set.lib;absl_raw_logging_internal.lib;absl_scoped_set_env.lib;absl_spinlock_wait.lib;absl_stacktrace.lib;absl_status.lib;absl_statusor.lib;absl_strerror.lib;absl_strings.lib;absl_strings_internal.lib;absl_string_view.lib;absl_str_format_internal.lib;absl_symbolize.lib;absl_synchronization.lib;absl_throw_delegate.lib;absl_time.lib;absl_time_zone.lib;address_sorting.lib;cares.lib;gpr.lib;grpc++.lib;grpc++_alts.lib;grpc++_error_details.lib;grpc++_reflection.lib;grpc++_unsecure.lib;grpc.lib;grpcpp_channelz.lib;grpc_authorization_provider.lib;grpc_plugin_support.lib;grpc_unsecure.lib;libcrypto.lib;libprotobuf-lite.lib;libprotobuf.lib;libprotoc.lib;libssl.lib;re2.lib;upb_base_lib.lib;upb_json_lib.lib;upb_mem_lib.lib;upb_message_lib.lib;upb_mini_descriptor_lib.lib;upb_textformat_lib.lib;upb_wire_lib.lib;utf8_range.lib;utf8_validity.lib;zlib.lib;Ws2_32.lib;Crypt32.lib;Iphlpapi.lib;%(AdditionalDependencies) - $(VcpkgRoot)installed\x64-windows-static\lib;%(AdditionalLibraryDirectories) - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + Debug x64 Release x64 16.0 Win32Proj {689DDF03-CFAE-4148-8D49-A16B5C6AA039} API 10.0 false false Application true v143 Unicode Application false v143 true Unicode true false Level3 true _DEBUG;_CONSOLE;%(PreprocessorDefinitions) true stdcpp17 stdc17 ..\fmt;..\spdlog\include;..\tclap\include;..\grpc\include;..\proto;include;%(AdditionalIncludeDirectories) /utf-8 %(AdditionalOptions) MultiThreadedDebug true Console true ..\lib\debug;%(AdditionalLibraryDirectories) absl_bad_any_cast_impl.lib;absl_bad_optional_access.lib;absl_bad_variant_access.lib;absl_base.lib;absl_city.lib;absl_civil_time.lib;absl_cord.lib;absl_cordz_functions.lib;absl_cordz_handle.lib;absl_cordz_info.lib;absl_cordz_sample_token.lib;absl_cord_internal.lib;absl_crc32c.lib;absl_crc_cord_state.lib;absl_crc_cpu_detect.lib;absl_crc_internal.lib;absl_debugging_internal.lib;absl_demangle_internal.lib;absl_die_if_null.lib;absl_examine_stack.lib;absl_exponential_biased.lib;absl_failure_signal_handler.lib;absl_flags_commandlineflag.lib;absl_flags_commandlineflag_internal.lib;absl_flags_config.lib;absl_flags_internal.lib;absl_flags_marshalling.lib;absl_flags_parse.lib;absl_flags_private_handle_accessor.lib;absl_flags_program_name.lib;absl_flags_reflection.lib;absl_flags_usage.lib;absl_flags_usage_internal.lib;absl_graphcycles_internal.lib;absl_hash.lib;absl_hashtablez_sampler.lib;absl_int128.lib;absl_kernel_timeout_internal.lib;absl_leak_check.lib;absl_log_entry.lib;absl_log_flags.lib;absl_log_globals.lib;absl_log_initialize.lib;absl_log_internal_check_op.lib;absl_log_internal_conditions.lib;absl_log_internal_fnmatch.lib;absl_log_internal_format.lib;absl_log_internal_globals.lib;absl_log_internal_log_sink_set.lib;absl_log_internal_message.lib;absl_log_internal_nullguard.lib;absl_log_internal_proto.lib;absl_log_internal_structured_proto.lib;absl_log_severity.lib;absl_log_sink.lib;absl_low_level_hash.lib;absl_malloc_internal.lib;absl_periodic_sampler.lib;absl_random_distributions.lib;absl_random_internal_distribution_test_util.lib;absl_random_internal_platform.lib;absl_random_internal_pool_urbg.lib;absl_random_internal_randen.lib;absl_random_internal_randen_hwaes.lib;absl_random_internal_randen_hwaes_impl.lib;absl_random_internal_randen_slow.lib;absl_random_internal_seed_material.lib;absl_random_seed_gen_exception.lib;absl_random_seed_sequences.lib;absl_raw_hash_set.lib;absl_raw_logging_internal.lib;absl_scoped_set_env.lib;absl_spinlock_wait.lib;absl_stacktrace.lib;absl_status.lib;absl_statusor.lib;absl_strerror.lib;absl_strings.lib;absl_strings_internal.lib;absl_string_view.lib;absl_str_format_internal.lib;absl_symbolize.lib;absl_synchronization.lib;absl_throw_delegate.lib;absl_time.lib;absl_time_zone.lib;absl_vlog_config_internal.lib;address_sorting.lib;cares.lib;gpr.lib;grpc++.lib;grpc++_alts.lib;grpc++_error_details.lib;grpc++_reflection.lib;grpc++_unsecure.lib;grpc.lib;grpcpp_channelz.lib;grpc_authorization_provider.lib;grpc_plugin_support.lib;grpc_unsecure.lib;libcrypto.lib;libprotobuf-lited.lib;libprotobufd.lib;libprotocd.lib;libssl.lib;re2.lib;upb_base_lib.lib;upb_json_lib.lib;upb_mem_lib.lib;upb_message_lib.lib;upb_mini_descriptor_lib.lib;upb_textformat_lib.lib;upb_wire_lib.lib;utf8_range.lib;utf8_validity.lib;zlibd.lib;Ws2_32.lib;Crypt32.lib;Iphlpapi.lib;%(AdditionalDependencies) Level3 true true true NDEBUG;_CONSOLE;%(PreprocessorDefinitions) true stdcpp17 stdc17 ..\fmt;..\spdlog\include;..\tclap\include;..\grpc\include;..\proto;include;%(AdditionalIncludeDirectories) /utf-8 %(AdditionalOptions) MultiThreaded true Console true true true absl_bad_any_cast_impl.lib;absl_bad_optional_access.lib;absl_bad_variant_access.lib;absl_base.lib;absl_city.lib;absl_civil_time.lib;absl_cord.lib;absl_cordz_functions.lib;absl_cordz_handle.lib;absl_cordz_info.lib;absl_cordz_sample_token.lib;absl_cord_internal.lib;absl_crc32c.lib;absl_crc_cord_state.lib;absl_crc_cpu_detect.lib;absl_crc_internal.lib;absl_debugging_internal.lib;absl_demangle_internal.lib;absl_die_if_null.lib;absl_examine_stack.lib;absl_exponential_biased.lib;absl_failure_signal_handler.lib;absl_flags_commandlineflag.lib;absl_flags_commandlineflag_internal.lib;absl_flags_config.lib;absl_flags_internal.lib;absl_flags_marshalling.lib;absl_flags_parse.lib;absl_flags_private_handle_accessor.lib;absl_flags_program_name.lib;absl_flags_reflection.lib;absl_flags_usage.lib;absl_flags_usage_internal.lib;absl_graphcycles_internal.lib;absl_hash.lib;absl_hashtablez_sampler.lib;absl_int128.lib;absl_kernel_timeout_internal.lib;absl_leak_check.lib;absl_log_entry.lib;absl_log_flags.lib;absl_log_globals.lib;absl_log_initialize.lib;absl_log_internal_check_op.lib;absl_log_internal_conditions.lib;absl_log_internal_fnmatch.lib;absl_log_internal_format.lib;absl_log_internal_globals.lib;absl_log_internal_log_sink_set.lib;absl_log_internal_message.lib;absl_log_internal_nullguard.lib;absl_log_internal_proto.lib;absl_log_internal_structured_proto.lib;absl_log_severity.lib;absl_log_sink.lib;absl_low_level_hash.lib;absl_malloc_internal.lib;absl_periodic_sampler.lib;absl_random_distributions.lib;absl_random_internal_distribution_test_util.lib;absl_random_internal_platform.lib;absl_random_internal_pool_urbg.lib;absl_random_internal_randen.lib;absl_random_internal_randen_hwaes.lib;absl_random_internal_randen_hwaes_impl.lib;absl_random_internal_randen_slow.lib;absl_random_internal_seed_material.lib;absl_random_seed_gen_exception.lib;absl_random_seed_sequences.lib;absl_raw_hash_set.lib;absl_raw_logging_internal.lib;absl_scoped_set_env.lib;absl_spinlock_wait.lib;absl_stacktrace.lib;absl_status.lib;absl_statusor.lib;absl_strerror.lib;absl_strings.lib;absl_strings_internal.lib;absl_string_view.lib;absl_str_format_internal.lib;absl_symbolize.lib;absl_synchronization.lib;absl_throw_delegate.lib;absl_time.lib;absl_time_zone.lib;absl_vlog_config_internal.lib;address_sorting.lib;cares.lib;gpr.lib;grpc++.lib;grpc++_alts.lib;grpc++_error_details.lib;grpc++_reflection.lib;grpc++_unsecure.lib;grpc.lib;grpcpp_channelz.lib;grpc_authorization_provider.lib;grpc_plugin_support.lib;grpc_unsecure.lib;libcrypto.lib;libprotobuf-lite.lib;libprotobuf.lib;libprotoc.lib;libssl.lib;re2.lib;upb_base_lib.lib;upb_json_lib.lib;upb_mem_lib.lib;upb_message_lib.lib;upb_mini_descriptor_lib.lib;upb_textformat_lib.lib;upb_wire_lib.lib;utf8_range.lib;utf8_validity.lib;zlib.lib;Ws2_32.lib;Crypt32.lib;Iphlpapi.lib;%(AdditionalDependencies) ..\lib\release;%(AdditionalLibraryDirectories) \ No newline at end of file diff --git a/CAPI/cpp/README.md b/CAPI/cpp/README.md index dafbce99..604c4c29 100644 --- a/CAPI/cpp/README.md +++ b/CAPI/cpp/README.md @@ -2,106 +2,100 @@ ## 简介 -C++ 通信组件与选手接口 - -## 目标 - -### 基本目标 - -- 基于 Protobuf 与 gRPC,为客户端提供 C++ 通信组件 -- 为选手提供游戏接口 - -### 重要目标 - -- 理解 RPC 的工作原理,使用 gRPC 完善通信逻辑 -- 将通信逻辑与游戏逻辑分离开,便于日后复用 -- 客户端不对游戏人数、观战人数做出任何限制,这些方面全都由服务器决定 -- 改进选手接口,思考如何强制禁止选手一直占用 CPU 而导致 CPU 占用过大的问题。 - -### 提高目标 - -- 提供其他语言的接口:Python、Java、Rust ...... - -## 统一约定 - -- 主要使用现代 C++ 进行编程 -- 代码应当能够同时运行在 Windows 10 平台和 Linux 平台上。Windows 平台下采用 MSVC 作为编译工具,Linux 平台采用 GCC 作为编译工具 -- Windows 下的开发工具使用 Visual Studio 2022,语言标准采用 C++17 和 C17 (MSVC 编译选项 `/std:c++17; /std:c17`),并且应同时在 x64 平台的 Debug 与 Release 模式下正确编译并运行 -- Linux 下 C 语言编译工具使用 gcc,语言标准为 `-std=c17`;C++ 编译工具使用 g++,语言标准为 `-std=c++17`。优化选项为 `-O2`,生成 64 位程序 `-m64`,并编写相应的 CMakeLists - -## 注意事项 - -- 与逻辑组共同商议通信协议 -- Visual Studio 新建的 C++ 代码文件默认字符编码是 GB2312、默认缩进方式是 TAB,应该注意手动改成 UTF-8 和 空格缩进 -- 了解 Visual Studio 的项目属性配置,例如第三方库的链接、预定义宏等 -- 使用现代 C++ 特性进行编程,避免不安全的旧特性,例如: - + 尽量避免裸指针,多使用智能指针 - + 禁止使用 `::operator new`、`::operator new[]`;使用 `std::make_unique`、`std::make_shared`、`std::vector` 等代替; - + 禁止使用宏作为编译期常量;使用 `constexpr` 代替; - + 善用 attribute,例如 `[[nodiscard]]`、`[[fallthrough]]`、`[[noreturn]]` 等; - + C 语言接口需要基于 RAII 原则进行封装,通过对象的生命周期来关系资源的申请和释放; - + …… -- 了解 C、C++ 预处理、编译、链接的基本概念 -- 注意模块化、单元化,降低各个类、各个模块之间的耦合。特别注意避免相互依赖、环形依赖的问题 -- 遵循头文件(`.h`、`.hpp`)的编写规范 - + 杜绝头文件相互包含与环形包含 - + 头文件中最好同时写 `#pragma once` 以及保护宏,而 `cpp` 中不要写这两个东西 - + 头文件中**禁止** `using namespace std`!!!也不允许在任何自定义的名字空间中 `using namespace std`!!! - + 头文件和 `cpp` 文件各司其职,代码写在改写的位置 - + 禁止 include .cpp 或 .c 文件 -- 避免忙等待,注意线程安全,做好线程同步 -- 善于使用 [Google](https://www.google.com/) 并使用[**英文**](https://en.wikipedia.org/wiki/American_English)搜索,善于查阅 [Microsoft Learn](https://learn.microsoft.com/)、[cppreference](https://en.cppreference.com/)、[StackOverflow](https://stackoverflow.com/) 以及第三方库官方文档等;不应轻信 [CSDN](https://www.csdn.net/) 等劣质博客社区以及[博客园](https://www.cnblogs.com/)、[简书](https://www.jianshu.com/)等质量参差不齐的博客社区,对其内容需全方位多角度仔细求证方可相信 - -## 开发纪实 - -### C++ SDK Windows 环境配置 - -#### 配置方法 - -起初 C++ 开发时使用 Linux 开发,但在选手包发布 Windows SDK 时遇到诸多问题。Windows 平台的 C++ 接口使用 Visual Studio 进行环境配置。期间遇到诸多问题,配置环境方法如下: - -1. 更新 Visual Studio:由于届时要求选手与开发组使用**完全相同**版本的 Visual Studio,否则可能会出现找不到一些标准库内置的符号的问题,因此在选手包发布前夕,将开发组的 Visual Studio 升级到最新版后执行步骤 2 -2. 编译 gRPC:分别编译 Debug 和 Release 的 gRPC 依赖库各一份。方法有二: - - 方法一:根据 [gRPC Windows 生成教程](https://github.com/grpc/grpc/blob/0b2609a61d50f2dbba4604978ef9243543a2675a/BUILDING.md#windows-using-visual-studio-2019-or-later) 在本地分别编译一份 `Debug` 和 `Release`(即在 CMake config 参数中分别指定 Debug 和 Release 各生成一份 Visual Studio 工程)的 x64 平台的依赖库。注意使用静态编译,根据[此原则](https://github.com/grpc/grpc/blob/0b2609a61d50f2dbba4604978ef9243543a2675a/BUILDING.md#windows-a-note-on-building-shared-libs-dlls)**不生成** gRPC 和 Protocol Buffers 本身的 DLL,即只有 `.lib` 无 `.dll`(但是可能会有一些其依赖的第三方库的 `.dll`),将 Debug 和 Release 生成的 `.lib` 和 `.dll`(如果有的话)均分别保存 - - 方法二:根据 [gRPC vcpkg 安装教程](https://github.com/grpc/grpc/tree/master/src/cpp#install-using-vcpkg-package) 安装 **`x64-windows-static`** 的 gRPC,即执行 `vcpkg install grpc:x64-windows-static`,以生成静态库(注意 vcpkg 需要调用本地的 Visual Studio 进行现场编译和生成,所以所耗时间可能较长,请耐心等待;并且此步骤由于需要从 GitHub 上现场拉源代码,因此可能需要科学上网)。然后进入 vcpkg 的安装目录,将里面安装的 gRPC 的所有 Debug 和 Release 的 `.lib` 和 `.dll`(如果有的话)分别保存一份 -3. 提取 gRPC 头文件:参考 [gRPC 所有所需头文件](https://github.com/eesast/THUAI6/tree/217d87aeedf6735e3257acb1e2c70574df45b823/CAPI/cpp/grpc)将头文件放入本仓库的相应目录内,以供使用(记得放该版本对应的 LICENSE x)。 -4. 配置 `.vcxproj` 和 `.vcxproj.filters`:`.vcxproj` 用于配置项目的编译与链接,`.vcxproj.filters` 用于配置 Visual Studio 的筛选器的结构(即解决方案资源管理器的结构)。参考 THUAI6 的 [`API.vcxproj`](https://github.com/eesast/THUAI6/blob/ad4db599f97449786e6c910940bf4f69224d5408/CAPI/cpp/API/API.vcxproj) 和 [`API.vcxproj.filters`](https://github.com/eesast/THUAI6/blob/ad4db599f97449786e6c910940bf4f69224d5408/CAPI/cpp/API/API.vcxproj.filters)。基本上可以直接无脑复制过来,不用做什么修改。如果非要在 Visual Studio 里手动配置,需要配置以下几项(以下的链接均以 x64 Release 为例,Debug 的相应配置在相应链接的上面一些的位置): - - 添加头文件和源文件:[将**自己编写**的 `.h` 和 `.cpp` 文件加入到项目中](https://github.com/eesast/THUAI6/blob/c8e1fbe299c67a6e101fa02e85bcc971acd0f48b/CAPI/cpp/API/API.vcxproj#L169-L197)(包括 protoc 生成的那些 `.pb.h` 和 `.pb.cc`,但这些最好参照 `API.vcxproj.filters` 的组织结构[各单独开一个子筛选器](https://github.com/eesast/THUAI6/blob/c8e1fbe299c67a6e101fa02e85bcc971acd0f48b/CAPI/cpp/API/API.vcxproj.filters#L16-L21)放进去以使得 Visual Studio 打开时更美观) - - 在项目属性中的 Debug 和 Release 的“C/C++”的“语言”中[均设置 C++ 语言标准为 `/std:c++17`](https://github.com/eesast/THUAI6/blob/c8e1fbe299c67a6e101fa02e85bcc971acd0f48b/CAPI/cpp/API/API.vcxproj#L154)、[C 语言标准为 `/std:c17`](https://github.com/eesast/THUAI6/blob/c8e1fbe299c67a6e101fa02e85bcc971acd0f48b/CAPI/cpp/API/API.vcxproj#L155) - - 在项目属性中的 Debug 和 Release 的[附加编译选项(即在“C/C++”的“命令行”)里均增加 `/source-charset:utf-8` 选项](https://github.com/eesast/THUAI6/blob/c8e1fbe299c67a6e101fa02e85bcc971acd0f48b/CAPI/cpp/API/API.vcxproj#L157),以保证编译时编译器使用 UTF-8 编码进行源文件读取(注意这个与 Visual Studio 的高级保存选项不同,高级保存选项决定了文件的保存时的保存编码,而非编译器编译时读取使用的编码) - - 设置头文件的搜索路径:在项目属性的“C/C++”的首页的“附加包含目录”中设置 Debug 和 Release 下的[搜索头文件的根路径](https://github.com/eesast/THUAI6/blob/c8e1fbe299c67a6e101fa02e85bcc971acd0f48b/CAPI/cpp/API/API.vcxproj#L156),注意 Windows 下的路径分隔符最好使用 `\` 而非 `/`,负责可能会出现一些玄学问题 - - 设置生成方式为静态生成:在项目属性的“C/C++”的“代码生成”的“运行库”中,[Debug 下设置其为“多线程调试(`/MTd`)”](https://github.com/eesast/THUAI6/blob/c8e1fbe299c67a6e101fa02e85bcc971acd0f48b/CAPI/cpp/API/API.vcxproj#L137),[Release 下设置其为“多线程(`/MT`)”](https://github.com/eesast/THUAI6/blob/c8e1fbe299c67a6e101fa02e85bcc971acd0f48b/CAPI/cpp/API/API.vcxproj#L158) - - 将之前提取的 Debug 和 Release 的 `.lib` 分别放在项目中的单独的文件夹里(THUAI6 使用的是 `CAPI\cpp\lib\debug` 和 `CAPI\cpp\lib\release`),并[使用 `.gitignore` 忽略掉](https://github.com/eesast/THUAI6/blob/c8e1fbe299c67a6e101fa02e85bcc971acd0f48b/CAPI/cpp/.gitignore#L502) - - 在项目属性的“链接器”的首页的“附加库目录”中分别配置 Debug 和 Release 的 [`.lib` 文件的相应路径](https://github.com/eesast/THUAI6/blob/c8e1fbe299c67a6e101fa02e85bcc971acd0f48b/CAPI/cpp/API/API.vcxproj#L166) - - 在项目属性中的“链接器”的“输入”的“附加依赖库”中分别配置 Debug 和 Release [所需要链接的库的文件名](https://github.com/eesast/THUAI6/blob/c8e1fbe299c67a6e101fa02e85bcc971acd0f48b/CAPI/cpp/API/API.vcxproj#L165)。注意 Debug 和 Release 链接的库可能并不完全相同,建议在 cmd 中使用 `dir /b` 将其自动列举并复制。还需要注意需要手动指定链接一些 Windows 自带的 `lib`,例如 `ws2_32.lib`、`Crypt32.lib`、`Iphlpapi.lib` 等。如果生成过程中不通过,表示找不到一些函数,则在 Google 中搜索该函数,如果发现是 Windows 系统的 API 函数则会搜到[微软官方文档](https://learn.microsoft.com) 的对应链接的页面,则在页面最下方会表明它所在的 `.lib`(例如 [`CreateProcessA` 的页面](https://learn.microsoft.com/en-us/windows/win32/api/processthreadsapi/nf-processthreadsapi-createprocessa#requirements)),加进去即可 - - 然后进行生成解决方案。如果感觉编译的速度过慢,可以在项目属性的 `C/C++` 的“所有选项”中搜索多处理器编译,并[开启(`/MP`)](https://github.com/eesast/THUAI6/blob/ad4db599f97449786e6c910940bf4f69224d5408/CAPI/cpp/API/API.vcxproj#L162) - - 然后开始运行。如果提示缺少一些 DLL,可以把之前保存的 `.dll` 文件(如果有的话)放在与 `.exe` 相同的目录下。该目录为**与 `.sln` 相同目录的**(不是与 `.vcxproj` 相同目录的)`x64\Debug` 和 `x64\Release` - - 如果 x64 的 Debug 和 x64 的 Release 均生成成功,那么找一台没配过的电脑再试一次 - - 随便写点 AI 代码,重新生成解决方案,确认成功后发布选手包 - - 有兴趣也可以支持一下 x86 的 Windows(x - - 有兴趣还可以支持一下 Cygwin(x - -### Q&A - -#### 为什么不用 CMake - -1. 由于 CMake 生成的 Visual Studio 工程是绝对路径,因此不能将 CMake 生成的 Visual Studio 工程直接给选手,需要选手使用 CMake,增加了选手尤其是大一小白选手的负担 -2. 对 Debug 和 Release 分别编译时,需要 CMake 分别生成 Debug 和 Release 的 Visual Studio 工程,而难以使用 Visual Studio 和 MSBuild 自带的 Debug 和 Release 的切换方式,这就需要生成两份 Visual Studio 工程,对选手的测试来说也是一种麻烦 - -#### 为什么不让选手用 vcpkg - -1. vcpkg 是将代码拉下来本地编译。拉代码过程需要科学上网,这对一些大一小白选手来说是个不小的负担 -2. vcpkg 编译过程极其漫长,会极大消磨选手的耐心 - -#### 为什么不用 CLion 配合 MinGW、MinGW-w64 等 - -1. 贵校程设课大多数使用 Visual Studio。对大多数选手来说,这是最易上手的 -2. 开箱即用,方便 -3. Visual Studio 已使用多年,坑全部踩过了一遍,突然变更又要重新踩坑 -4. MinGW 已停止维护,正在维护的是 MinGW-w64,两者名称很像,选手尤其是使用百度等劣质搜索引擎或查阅 CSDN 等劣质博客安装时极易混淆 -5. MinGW 需要附加更多的其自己的依赖库如 glibc 等,此 glibc 依然依赖 msvcrt,多一层依赖库便增加了一些版本不兼容问题的风险 -6. 其与 MSVC 的 Name Mangling 的规则、ABI 等并不一致或不完全一致,增加各种不兼容问题的风险 - -## 开发人员 - -- 杨再鹏、王俊杰 +这是 THUAI9 的 C++ 选手接口工程。 + +选手使用方式: + +1. 安装 `Visual Studio 2022` +2. 安装工作负载 `Desktop development with C++` +3. 打开 [API.sln](./API.sln) +4. 选择 `x64` +5. 直接编译 `Debug` 或 `Release` + +当前仓库已经内置 C++ API 所需的第三方头文件和预编译库,选手**不需要**再安装或配置: + +- `vcpkg` +- `gRPC` +- `protobuf` +- `absl` +- `re2` +- `OpenSSL` +- `zlib` + +## 环境要求 + +- `Visual Studio 2022` +- `MSVC v143` 工具链 +- `Windows SDK` + +说明: + +- 工程当前支持并验证通过的配置是 `x64 Debug` 和 `x64 Release` +- 不要求配置 `VcpkgRoot` +- 不依赖本机额外安装的第三方 C++ 库 + +## 目录说明 + +- [API.sln](./API.sln): 选手直接打开的解决方案 +- [API/API.vcxproj](./API/API.vcxproj): VS 工程文件 +- [API/include](./API/include): C++ 接口头文件 +- [API/src](./API/src): C++ 接口实现 +- [proto](./proto): 已生成的 protobuf / gRPC 源码 +- [grpc/include](./grpc/include): 工程随包分发的第三头文件 +- [lib/debug](./lib/debug): `x64 Debug` 依赖库 +- [lib/release](./lib/release): `x64 Release` 依赖库 + +## 编译说明 + +### Visual Studio + +1. 打开 [API.sln](./API.sln) +2. 在顶部配置中选择: + - `Debug` 或 `Release` + - `x64` +3. 点击“生成解决方案” + +生成产物默认位于: + +- `x64/Debug/API.exe` +- `x64/Release/API.exe` + +### MSBuild + +如果需要命令行编译,可使用: + +```powershell +MSBuild.exe API.sln /t:Rebuild /p:Configuration=Debug /p:Platform=x64 /m +MSBuild.exe API.sln /t:Rebuild /p:Configuration=Release /p:Platform=x64 /m +``` + +## 当前验证结果 + +本工程已验证: + +- 在不设置 `VcpkgRoot` 的情况下可编译 +- 将 `CAPI/cpp` 单独复制到新目录后仍可编译 +- `x64 Debug` 可生成成功 +- `x64 Release` 可生成成功 + +## 常见问题 + +### 1. 打开工程后无法编译 + +先确认本机是否安装了: + +- `Visual Studio 2022` +- `Desktop development with C++` +- `Windows SDK` + +### 2. 需要自己安装 vcpkg 吗 + +不需要。 + +### 3. 需要自己生成 protobuf / gRPC 代码吗 + +不需要,仓库中已经包含生成后的源码。 + +### 4. 需要自己准备 `.lib` 文件吗 + +不需要,仓库中已经包含 `Debug` 和 `Release` 所需库文件。 diff --git a/CAPI/cpp/grpc/include/absl/algorithm/algorithm.h b/CAPI/cpp/grpc/include/absl/algorithm/algorithm.h index 865b6d17..e2786ba1 100644 --- a/CAPI/cpp/grpc/include/absl/algorithm/algorithm.h +++ b/CAPI/cpp/grpc/include/absl/algorithm/algorithm.h @@ -32,95 +32,17 @@ namespace absl { ABSL_NAMESPACE_BEGIN - namespace algorithm_internal - { - - // Performs comparisons with operator==, similar to C++14's `std::equal_to<>`. - struct EqualTo - { - template - bool operator()(const T& a, const U& b) const - { - return a == b; - } - }; - - template - bool EqualImpl(InputIter1 first1, InputIter1 last1, InputIter2 first2, InputIter2 last2, Pred pred, std::input_iterator_tag, std::input_iterator_tag) - { - while (true) - { - if (first1 == last1) - return first2 == last2; - if (first2 == last2) - return false; - if (!pred(*first1, *first2)) - return false; - ++first1; - ++first2; - } - } - - template - bool EqualImpl(InputIter1 first1, InputIter1 last1, InputIter2 first2, InputIter2 last2, Pred&& pred, std::random_access_iterator_tag, std::random_access_iterator_tag) - { - return (last1 - first1 == last2 - first2) && - std::equal(first1, last1, first2, std::forward(pred)); - } - - // When we are using our own internal predicate that just applies operator==, we - // forward to the non-predicate form of std::equal. This enables an optimization - // in libstdc++ that can result in std::memcmp being used for integer types. - template - bool EqualImpl(InputIter1 first1, InputIter1 last1, InputIter2 first2, InputIter2 last2, algorithm_internal::EqualTo /* unused */, std::random_access_iterator_tag, std::random_access_iterator_tag) - { - return (last1 - first1 == last2 - first2) && - std::equal(first1, last1, first2); - } - - template - It RotateImpl(It first, It middle, It last, std::true_type) - { - return std::rotate(first, middle, last); - } - - template - It RotateImpl(It first, It middle, It last, std::false_type) - { - std::rotate(first, middle, last); - return std::next(first, std::distance(middle, last)); - } - - } // namespace algorithm_internal - // equal() + // rotate() // - // Compares the equality of two ranges specified by pairs of iterators, using - // the given predicate, returning true iff for each corresponding iterator i1 - // and i2 in the first and second range respectively, pred(*i1, *i2) == true - // - // This comparison takes at most min(`last1` - `first1`, `last2` - `first2`) - // invocations of the predicate. Additionally, if InputIter1 and InputIter2 are - // both random-access iterators, and `last1` - `first1` != `last2` - `first2`, - // then the predicate is never invoked and the function returns false. + // Historical note: Abseil once provided implementations of these algorithms + // prior to their adoption in C++14. New code should prefer to use the std + // variants. // - // This is a C++11-compatible implementation of C++14 `std::equal`. See - // https://en.cppreference.com/w/cpp/algorithm/equal for more information. - template - bool equal(InputIter1 first1, InputIter1 last1, InputIter2 first2, InputIter2 last2, Pred&& pred) - { - return algorithm_internal::EqualImpl( - first1, last1, first2, last2, std::forward(pred), typename std::iterator_traits::iterator_category{}, typename std::iterator_traits::iterator_category{} - ); - } - - // Overload of equal() that performs comparison of two ranges specified by pairs - // of iterators using operator==. - template - bool equal(InputIter1 first1, InputIter1 last1, InputIter2 first2, InputIter2 last2) - { - return absl::equal(first1, last1, first2, last2, algorithm_internal::EqualTo{}); - } + // See the documentation for the STL header for more information: + // https://en.cppreference.com/w/cpp/header/algorithm + using std::equal; + using std::rotate; // linear_search() // @@ -132,30 +54,13 @@ namespace absl // n = (`last` - `first`) comparisons. A linear search over short containers // may be faster than a binary search, even when the container is sorted. template - bool linear_search(InputIterator first, InputIterator last, const EqualityComparable& value) + ABSL_INTERNAL_CONSTEXPR_SINCE_CXX20 bool linear_search( + InputIterator first, InputIterator last, const EqualityComparable& value + ) { return std::find(first, last, value) != last; } - // rotate() - // - // Performs a left rotation on a range of elements (`first`, `last`) such that - // `middle` is now the first element. `rotate()` returns an iterator pointing to - // the first element before rotation. This function is exactly the same as - // `std::rotate`, but fixes a bug in gcc - // <= 4.9 where `std::rotate` returns `void` instead of an iterator. - // - // The complexity of this algorithm is the same as that of `std::rotate`, but if - // `ForwardIterator` is not a random-access iterator, then `absl::rotate` - // performs an additional pass over the range to construct the return value. - template - ForwardIterator rotate(ForwardIterator first, ForwardIterator middle, ForwardIterator last) - { - return algorithm_internal::RotateImpl( - first, middle, last, std::is_same() - ); - } - ABSL_NAMESPACE_END } // namespace absl diff --git a/CAPI/cpp/grpc/include/absl/algorithm/container.h b/CAPI/cpp/grpc/include/absl/algorithm/container.h index 8babfee2..6487d91f 100644 --- a/CAPI/cpp/grpc/include/absl/algorithm/container.h +++ b/CAPI/cpp/grpc/include/absl/algorithm/container.h @@ -44,6 +44,7 @@ #include #include #include +#include #include #include #include @@ -51,7 +52,9 @@ #include #include "absl/algorithm/algorithm.h" +#include "absl/base/config.h" #include "absl/base/macros.h" +#include "absl/base/nullability.h" #include "absl/meta/type_traits.h" namespace absl @@ -94,18 +97,18 @@ namespace absl // using std::end; // std::foo(begin(c), end(c)); // becomes - // std::foo(container_algorithm_internal::begin(c), - // container_algorithm_internal::end(c)); + // std::foo(container_algorithm_internal::c_begin(c), + // container_algorithm_internal::c_end(c)); // These are meant for internal use only. template - ContainerIter c_begin(C& c) + ABSL_INTERNAL_CONSTEXPR_SINCE_CXX17 ContainerIter c_begin(C& c) { return begin(c); } template - ContainerIter c_end(C& c) + ABSL_INTERNAL_CONSTEXPR_SINCE_CXX17 ContainerIter c_end(C& c) { return end(c); } @@ -126,20 +129,6 @@ namespace absl { }; - // container_algorithm_internal::c_size. It is meant for internal use only. - - template - auto c_size(C& c) -> decltype(c.size()) - { - return c.size(); - } - - template - constexpr std::size_t c_size(T (&)[N]) - { - return N; - } - } // namespace container_algorithm_internal // PUBLIC API @@ -152,10 +141,14 @@ namespace absl // // Container-based version of absl::linear_search() for performing a linear // search within a container. + // + // For a generalization that uses a predicate, see absl::c_any_of(). template - bool c_linear_search(const C& c, EqualityComparable&& value) + ABSL_INTERNAL_CONSTEXPR_SINCE_CXX20 bool c_linear_search( + const C& c, EqualityComparable&& value + ) { - return linear_search(container_algorithm_internal::c_begin(c), container_algorithm_internal::c_end(c), std::forward(value)); + return absl::linear_search(container_algorithm_internal::c_begin(c), container_algorithm_internal::c_end(c), std::forward(value)); } //------------------------------------------------------------------------------ @@ -167,9 +160,9 @@ namespace absl // Container-based version of the `std::distance()` function to // return the number of elements within a container. template - container_algorithm_internal::ContainerDifferenceType c_distance( - const C& c - ) + ABSL_INTERNAL_CONSTEXPR_SINCE_CXX17 + container_algorithm_internal::ContainerDifferenceType + c_distance(const C& c) { return std::distance(container_algorithm_internal::c_begin(c), container_algorithm_internal::c_end(c)); } @@ -183,7 +176,7 @@ namespace absl // Container-based version of the `std::all_of()` function to // test if all elements within a container satisfy a condition. template - bool c_all_of(const C& c, Pred&& pred) + ABSL_INTERNAL_CONSTEXPR_SINCE_CXX20 bool c_all_of(const C& c, Pred&& pred) { return std::all_of(container_algorithm_internal::c_begin(c), container_algorithm_internal::c_end(c), std::forward(pred)); } @@ -193,7 +186,7 @@ namespace absl // Container-based version of the `std::any_of()` function to // test if any element in a container fulfills a condition. template - bool c_any_of(const C& c, Pred&& pred) + ABSL_INTERNAL_CONSTEXPR_SINCE_CXX20 bool c_any_of(const C& c, Pred&& pred) { return std::any_of(container_algorithm_internal::c_begin(c), container_algorithm_internal::c_end(c), std::forward(pred)); } @@ -203,7 +196,7 @@ namespace absl // Container-based version of the `std::none_of()` function to // test if no elements in a container fulfill a condition. template - bool c_none_of(const C& c, Pred&& pred) + ABSL_INTERNAL_CONSTEXPR_SINCE_CXX20 bool c_none_of(const C& c, Pred&& pred) { return std::none_of(container_algorithm_internal::c_begin(c), container_algorithm_internal::c_end(c), std::forward(pred)); } @@ -213,7 +206,7 @@ namespace absl // Container-based version of the `std::for_each()` function to // apply a function to a container's elements. template - decay_t c_for_each(C&& c, Function&& f) + ABSL_INTERNAL_CONSTEXPR_SINCE_CXX20 decay_t c_for_each(C&& c, Function&& f) { return std::for_each(container_algorithm_internal::c_begin(c), container_algorithm_internal::c_end(c), std::forward(f)); } @@ -223,17 +216,32 @@ namespace absl // Container-based version of the `std::find()` function to find // the first element containing the passed value within a container value. template - container_algorithm_internal::ContainerIter c_find(C& c, T&& value) + ABSL_INTERNAL_CONSTEXPR_SINCE_CXX20 + container_algorithm_internal::ContainerIter + c_find(C& c, T&& value) { return std::find(container_algorithm_internal::c_begin(c), container_algorithm_internal::c_end(c), std::forward(value)); } + // c_contains() + // + // Container-based version of the `std::ranges::contains()` C++23 + // function to search a container for a value. + template + ABSL_INTERNAL_CONSTEXPR_SINCE_CXX20 bool c_contains(const Sequence& sequence, T&& value) + { + return absl::c_find(sequence, std::forward(value)) != + container_algorithm_internal::c_end(sequence); + } + // c_find_if() // // Container-based version of the `std::find_if()` function to find // the first element in a container matching the given condition. template - container_algorithm_internal::ContainerIter c_find_if(C& c, Pred&& pred) + ABSL_INTERNAL_CONSTEXPR_SINCE_CXX20 + container_algorithm_internal::ContainerIter + c_find_if(C& c, Pred&& pred) { return std::find_if(container_algorithm_internal::c_begin(c), container_algorithm_internal::c_end(c), std::forward(pred)); } @@ -243,7 +251,9 @@ namespace absl // Container-based version of the `std::find_if_not()` function to // find the first element in a container not matching the given condition. template - container_algorithm_internal::ContainerIter c_find_if_not(C& c, Pred&& pred) + ABSL_INTERNAL_CONSTEXPR_SINCE_CXX20 + container_algorithm_internal::ContainerIter + c_find_if_not(C& c, Pred&& pred) { return std::find_if_not(container_algorithm_internal::c_begin(c), container_algorithm_internal::c_end(c), std::forward(pred)); } @@ -253,9 +263,9 @@ namespace absl // Container-based version of the `std::find_end()` function to // find the last subsequence within a container. template - container_algorithm_internal::ContainerIter c_find_end( - Sequence1& sequence, Sequence2& subsequence - ) + ABSL_INTERNAL_CONSTEXPR_SINCE_CXX20 + container_algorithm_internal::ContainerIter + c_find_end(Sequence1& sequence, Sequence2& subsequence) { return std::find_end(container_algorithm_internal::c_begin(sequence), container_algorithm_internal::c_end(sequence), container_algorithm_internal::c_begin(subsequence), container_algorithm_internal::c_end(subsequence)); } @@ -263,9 +273,9 @@ namespace absl // Overload of c_find_end() for using a predicate evaluation other than `==` as // the function's test condition. template - container_algorithm_internal::ContainerIter c_find_end( - Sequence1& sequence, Sequence2& subsequence, BinaryPredicate&& pred - ) + ABSL_INTERNAL_CONSTEXPR_SINCE_CXX20 + container_algorithm_internal::ContainerIter + c_find_end(Sequence1& sequence, Sequence2& subsequence, BinaryPredicate&& pred) { return std::find_end(container_algorithm_internal::c_begin(sequence), container_algorithm_internal::c_end(sequence), container_algorithm_internal::c_begin(subsequence), container_algorithm_internal::c_end(subsequence), std::forward(pred)); } @@ -276,7 +286,9 @@ namespace absl // find the first element within the container that is also within the options // container. template - container_algorithm_internal::ContainerIter c_find_first_of(C1& container, C2& options) + ABSL_INTERNAL_CONSTEXPR_SINCE_CXX20 + container_algorithm_internal::ContainerIter + c_find_first_of(C1& container, const C2& options) { return std::find_first_of(container_algorithm_internal::c_begin(container), container_algorithm_internal::c_end(container), container_algorithm_internal::c_begin(options), container_algorithm_internal::c_end(options)); } @@ -284,9 +296,9 @@ namespace absl // Overload of c_find_first_of() for using a predicate evaluation other than // `==` as the function's test condition. template - container_algorithm_internal::ContainerIter c_find_first_of( - C1& container, C2& options, BinaryPredicate&& pred - ) + ABSL_INTERNAL_CONSTEXPR_SINCE_CXX20 + container_algorithm_internal::ContainerIter + c_find_first_of(C1& container, const C2& options, BinaryPredicate&& pred) { return std::find_first_of(container_algorithm_internal::c_begin(container), container_algorithm_internal::c_end(container), container_algorithm_internal::c_begin(options), container_algorithm_internal::c_end(options), std::forward(pred)); } @@ -296,9 +308,9 @@ namespace absl // Container-based version of the `std::adjacent_find()` function to // find equal adjacent elements within a container. template - container_algorithm_internal::ContainerIter c_adjacent_find( - Sequence& sequence - ) + ABSL_INTERNAL_CONSTEXPR_SINCE_CXX20 + container_algorithm_internal::ContainerIter + c_adjacent_find(Sequence& sequence) { return std::adjacent_find(container_algorithm_internal::c_begin(sequence), container_algorithm_internal::c_end(sequence)); } @@ -306,9 +318,9 @@ namespace absl // Overload of c_adjacent_find() for using a predicate evaluation other than // `==` as the function's test condition. template - container_algorithm_internal::ContainerIter c_adjacent_find( - Sequence& sequence, BinaryPredicate&& pred - ) + ABSL_INTERNAL_CONSTEXPR_SINCE_CXX20 + container_algorithm_internal::ContainerIter + c_adjacent_find(Sequence& sequence, BinaryPredicate&& pred) { return std::adjacent_find(container_algorithm_internal::c_begin(sequence), container_algorithm_internal::c_end(sequence), std::forward(pred)); } @@ -318,9 +330,9 @@ namespace absl // Container-based version of the `std::count()` function to count // values that match within a container. template - container_algorithm_internal::ContainerDifferenceType c_count( - const C& c, T&& value - ) + ABSL_INTERNAL_CONSTEXPR_SINCE_CXX20 + container_algorithm_internal::ContainerDifferenceType + c_count(const C& c, T&& value) { return std::count(container_algorithm_internal::c_begin(c), container_algorithm_internal::c_end(c), std::forward(value)); } @@ -330,9 +342,9 @@ namespace absl // Container-based version of the `std::count_if()` function to // count values matching a condition within a container. template - container_algorithm_internal::ContainerDifferenceType c_count_if( - const C& c, Pred&& pred - ) + ABSL_INTERNAL_CONSTEXPR_SINCE_CXX20 + container_algorithm_internal::ContainerDifferenceType + c_count_if(const C& c, Pred&& pred) { return std::count_if(container_algorithm_internal::c_begin(c), container_algorithm_internal::c_end(c), std::forward(pred)); } @@ -343,79 +355,40 @@ namespace absl // return the first element where two ordered containers differ. Applies `==` to // the first N elements of `c1` and `c2`, where N = min(size(c1), size(c2)). template - container_algorithm_internal::ContainerIterPairType c_mismatch(C1& c1, C2& c2) + ABSL_INTERNAL_CONSTEXPR_SINCE_CXX20 + container_algorithm_internal::ContainerIterPairType + c_mismatch(C1& c1, C2& c2) { - auto first1 = container_algorithm_internal::c_begin(c1); - auto last1 = container_algorithm_internal::c_end(c1); - auto first2 = container_algorithm_internal::c_begin(c2); - auto last2 = container_algorithm_internal::c_end(c2); - - for (; first1 != last1 && first2 != last2; ++first1, (void)++first2) - { - // Negates equality because Cpp17EqualityComparable doesn't require clients - // to overload both `operator==` and `operator!=`. - if (!(*first1 == *first2)) - { - break; - } - } - - return std::make_pair(first1, first2); + return std::mismatch(container_algorithm_internal::c_begin(c1), container_algorithm_internal::c_end(c1), container_algorithm_internal::c_begin(c2), container_algorithm_internal::c_end(c2)); } // Overload of c_mismatch() for using a predicate evaluation other than `==` as // the function's test condition. Applies `pred`to the first N elements of `c1` // and `c2`, where N = min(size(c1), size(c2)). template - container_algorithm_internal::ContainerIterPairType c_mismatch( - C1& c1, C2& c2, BinaryPredicate pred - ) + ABSL_INTERNAL_CONSTEXPR_SINCE_CXX20 + container_algorithm_internal::ContainerIterPairType + c_mismatch(C1& c1, C2& c2, BinaryPredicate pred) { - auto first1 = container_algorithm_internal::c_begin(c1); - auto last1 = container_algorithm_internal::c_end(c1); - auto first2 = container_algorithm_internal::c_begin(c2); - auto last2 = container_algorithm_internal::c_end(c2); - - for (; first1 != last1 && first2 != last2; ++first1, (void)++first2) - { - if (!pred(*first1, *first2)) - { - break; - } - } - - return std::make_pair(first1, first2); + return std::mismatch(container_algorithm_internal::c_begin(c1), container_algorithm_internal::c_end(c1), container_algorithm_internal::c_begin(c2), container_algorithm_internal::c_end(c2), pred); } // c_equal() // // Container-based version of the `std::equal()` function to // test whether two containers are equal. - // - // NOTE: the semantics of c_equal() are slightly different than those of - // equal(): while the latter iterates over the second container only up to the - // size of the first container, c_equal() also checks whether the container - // sizes are equal. This better matches expectations about c_equal() based on - // its signature. - // - // Example: - // vector v1 = <1, 2, 3>; - // vector v2 = <1, 2, 3, 4>; - // equal(std::begin(v1), std::end(v1), std::begin(v2)) returns true - // c_equal(v1, v2) returns false - template - bool c_equal(const C1& c1, const C2& c2) + ABSL_INTERNAL_CONSTEXPR_SINCE_CXX20 bool c_equal(const C1& c1, const C2& c2) { - return ((container_algorithm_internal::c_size(c1) == container_algorithm_internal::c_size(c2)) && std::equal(container_algorithm_internal::c_begin(c1), container_algorithm_internal::c_end(c1), container_algorithm_internal::c_begin(c2))); + return std::equal(container_algorithm_internal::c_begin(c1), container_algorithm_internal::c_end(c1), container_algorithm_internal::c_begin(c2), container_algorithm_internal::c_end(c2)); } // Overload of c_equal() for using a predicate evaluation other than `==` as // the function's test condition. template - bool c_equal(const C1& c1, const C2& c2, BinaryPredicate&& pred) + ABSL_INTERNAL_CONSTEXPR_SINCE_CXX20 bool c_equal(const C1& c1, const C2& c2, BinaryPredicate&& pred) { - return ((container_algorithm_internal::c_size(c1) == container_algorithm_internal::c_size(c2)) && std::equal(container_algorithm_internal::c_begin(c1), container_algorithm_internal::c_end(c1), container_algorithm_internal::c_begin(c2), std::forward(pred))); + return std::equal(container_algorithm_internal::c_begin(c1), container_algorithm_internal::c_end(c1), container_algorithm_internal::c_begin(c2), container_algorithm_internal::c_end(c2), std::forward(pred)); } // c_is_permutation() @@ -423,23 +396,19 @@ namespace absl // Container-based version of the `std::is_permutation()` function // to test whether a container is a permutation of another. template - bool c_is_permutation(const C1& c1, const C2& c2) + ABSL_INTERNAL_CONSTEXPR_SINCE_CXX20 bool c_is_permutation(const C1& c1, const C2& c2) { - using std::begin; - using std::end; - return c1.size() == c2.size() && - std::is_permutation(begin(c1), end(c1), begin(c2)); + return std::is_permutation(container_algorithm_internal::c_begin(c1), container_algorithm_internal::c_end(c1), container_algorithm_internal::c_begin(c2), container_algorithm_internal::c_end(c2)); } // Overload of c_is_permutation() for using a predicate evaluation other than // `==` as the function's test condition. template - bool c_is_permutation(const C1& c1, const C2& c2, BinaryPredicate&& pred) + ABSL_INTERNAL_CONSTEXPR_SINCE_CXX20 bool c_is_permutation( + const C1& c1, const C2& c2, BinaryPredicate&& pred + ) { - using std::begin; - using std::end; - return c1.size() == c2.size() && - std::is_permutation(begin(c1), end(c1), begin(c2), std::forward(pred)); + return std::is_permutation(container_algorithm_internal::c_begin(c1), container_algorithm_internal::c_end(c1), container_algorithm_internal::c_begin(c2), container_algorithm_internal::c_end(c2), std::forward(pred)); } // c_search() @@ -447,9 +416,9 @@ namespace absl // Container-based version of the `std::search()` function to search // a container for a subsequence. template - container_algorithm_internal::ContainerIter c_search( - Sequence1& sequence, Sequence2& subsequence - ) + ABSL_INTERNAL_CONSTEXPR_SINCE_CXX20 + container_algorithm_internal::ContainerIter + c_search(Sequence1& sequence, Sequence2& subsequence) { return std::search(container_algorithm_internal::c_begin(sequence), container_algorithm_internal::c_end(sequence), container_algorithm_internal::c_begin(subsequence), container_algorithm_internal::c_end(subsequence)); } @@ -457,11 +426,35 @@ namespace absl // Overload of c_search() for using a predicate evaluation other than // `==` as the function's test condition. template - container_algorithm_internal::ContainerIter c_search( + ABSL_INTERNAL_CONSTEXPR_SINCE_CXX20 + container_algorithm_internal::ContainerIter + c_search(Sequence1& sequence, Sequence2& subsequence, BinaryPredicate&& pred) + { + return std::search(container_algorithm_internal::c_begin(sequence), container_algorithm_internal::c_end(sequence), container_algorithm_internal::c_begin(subsequence), container_algorithm_internal::c_end(subsequence), std::forward(pred)); + } + + // c_contains_subrange() + // + // Container-based version of the `std::ranges::contains_subrange()` + // C++23 function to search a container for a subsequence. + template + ABSL_INTERNAL_CONSTEXPR_SINCE_CXX20 bool c_contains_subrange( + Sequence1& sequence, Sequence2& subsequence + ) + { + return absl::c_search(sequence, subsequence) != + container_algorithm_internal::c_end(sequence); + } + + // Overload of c_contains_subrange() for using a predicate evaluation other than + // `==` as the function's test condition. + template + ABSL_INTERNAL_CONSTEXPR_SINCE_CXX20 bool c_contains_subrange( Sequence1& sequence, Sequence2& subsequence, BinaryPredicate&& pred ) { - return std::search(container_algorithm_internal::c_begin(sequence), container_algorithm_internal::c_end(sequence), container_algorithm_internal::c_begin(subsequence), container_algorithm_internal::c_end(subsequence), std::forward(pred)); + return absl::c_search(sequence, subsequence, std::forward(pred)) != + container_algorithm_internal::c_end(sequence); } // c_search_n() @@ -469,9 +462,9 @@ namespace absl // Container-based version of the `std::search_n()` function to // search a container for the first sequence of N elements. template - container_algorithm_internal::ContainerIter c_search_n( - Sequence& sequence, Size count, T&& value - ) + ABSL_INTERNAL_CONSTEXPR_SINCE_CXX20 + container_algorithm_internal::ContainerIter + c_search_n(Sequence& sequence, Size count, T&& value) { return std::search_n(container_algorithm_internal::c_begin(sequence), container_algorithm_internal::c_end(sequence), count, std::forward(value)); } @@ -479,9 +472,9 @@ namespace absl // Overload of c_search_n() for using a predicate evaluation other than // `==` as the function's test condition. template - container_algorithm_internal::ContainerIter c_search_n( - Sequence& sequence, Size count, T&& value, BinaryPredicate&& pred - ) + ABSL_INTERNAL_CONSTEXPR_SINCE_CXX20 + container_algorithm_internal::ContainerIter + c_search_n(Sequence& sequence, Size count, T&& value, BinaryPredicate&& pred) { return std::search_n(container_algorithm_internal::c_begin(sequence), container_algorithm_internal::c_end(sequence), count, std::forward(value), std::forward(pred)); } @@ -790,6 +783,35 @@ namespace absl std::shuffle(container_algorithm_internal::c_begin(c), container_algorithm_internal::c_end(c), std::forward(gen)); } + // c_sample() + // + // Container-based version of the `std::sample()` function to + // randomly sample elements from the container without replacement using a + // `gen()` uniform random number generator and write them to an iterator range. + template + OutputIterator c_sample(const C& c, OutputIterator result, Distance n, UniformRandomBitGenerator&& gen) + { +#if defined(__cpp_lib_sample) && __cpp_lib_sample >= 201603L + return std::sample(container_algorithm_internal::c_begin(c), container_algorithm_internal::c_end(c), result, n, std::forward(gen)); +#else + // Fall back to a stable selection-sampling implementation. + auto first = container_algorithm_internal::c_begin(c); + Distance unsampled_elements = c_distance(c); + n = (std::min)(n, unsampled_elements); + for (; n != 0; ++first) + { + Distance r = + std::uniform_int_distribution(0, --unsampled_elements)(gen); + if (r < n) + { + *result++ = *first; + --n; + } + } + return result; +#endif + } + //------------------------------------------------------------------------------ // Partition functions //------------------------------------------------------------------------------ @@ -1383,9 +1405,9 @@ namespace absl // to return an iterator pointing to the element with the smallest value, using // `operator<` to make the comparisons. template - container_algorithm_internal::ContainerIter c_min_element( - Sequence& sequence - ) + ABSL_INTERNAL_CONSTEXPR_SINCE_CXX17 + container_algorithm_internal::ContainerIter + c_min_element(Sequence& sequence) { return std::min_element(container_algorithm_internal::c_begin(sequence), container_algorithm_internal::c_end(sequence)); } @@ -1393,9 +1415,9 @@ namespace absl // Overload of c_min_element() for performing a `comp` comparison other than // `operator<`. template - container_algorithm_internal::ContainerIter c_min_element( - Sequence& sequence, LessThan&& comp - ) + ABSL_INTERNAL_CONSTEXPR_SINCE_CXX17 + container_algorithm_internal::ContainerIter + c_min_element(Sequence& sequence, LessThan&& comp) { return std::min_element(container_algorithm_internal::c_begin(sequence), container_algorithm_internal::c_end(sequence), std::forward(comp)); } @@ -1406,9 +1428,9 @@ namespace absl // to return an iterator pointing to the element with the largest value, using // `operator<` to make the comparisons. template - container_algorithm_internal::ContainerIter c_max_element( - Sequence& sequence - ) + ABSL_INTERNAL_CONSTEXPR_SINCE_CXX17 + container_algorithm_internal::ContainerIter + c_max_element(Sequence& sequence) { return std::max_element(container_algorithm_internal::c_begin(sequence), container_algorithm_internal::c_end(sequence)); } @@ -1416,9 +1438,9 @@ namespace absl // Overload of c_max_element() for performing a `comp` comparison other than // `operator<`. template - container_algorithm_internal::ContainerIter c_max_element( - Sequence& sequence, LessThan&& comp - ) + ABSL_INTERNAL_CONSTEXPR_SINCE_CXX17 + container_algorithm_internal::ContainerIter + c_max_element(Sequence& sequence, LessThan&& comp) { return std::max_element(container_algorithm_internal::c_begin(sequence), container_algorithm_internal::c_end(sequence), std::forward(comp)); } @@ -1430,9 +1452,9 @@ namespace absl // smallest and largest values, respectively, using `operator<` to make the // comparisons. template - container_algorithm_internal::ContainerIterPairType c_minmax_element( - C& c - ) + ABSL_INTERNAL_CONSTEXPR_SINCE_CXX17 + container_algorithm_internal::ContainerIterPairType + c_minmax_element(C& c) { return std::minmax_element(container_algorithm_internal::c_begin(c), container_algorithm_internal::c_end(c)); } @@ -1440,9 +1462,9 @@ namespace absl // Overload of c_minmax_element() for performing `comp` comparisons other than // `operator<`. template - container_algorithm_internal::ContainerIterPairType c_minmax_element( - C& c, LessThan&& comp - ) + ABSL_INTERNAL_CONSTEXPR_SINCE_CXX17 + container_algorithm_internal::ContainerIterPairType + c_minmax_element(C& c, LessThan&& comp) { return std::minmax_element(container_algorithm_internal::c_begin(c), container_algorithm_internal::c_end(c), std::forward(comp)); } @@ -1529,7 +1551,7 @@ namespace absl // // Container-based version of the `std::iota()` function // to compute successive values of `value`, as if incremented with `++value` - // after each element is written. and write them to the container. + // after each element is written, and write them to the container. template void c_iota(Sequence& sequence, const T& value) { diff --git a/CAPI/cpp/grpc/include/absl/base/attributes.h b/CAPI/cpp/grpc/include/absl/base/attributes.h index f7f0edd2..dd4e5298 100644 --- a/CAPI/cpp/grpc/include/absl/base/attributes.h +++ b/CAPI/cpp/grpc/include/absl/base/attributes.h @@ -31,6 +31,8 @@ // `__has_attribute()` first. If the check fails, we check if we are on GCC and // assume the attribute exists on GCC (which is verified on GCC 4.7). +// SKIP_ABSL_INLINE_NAMESPACE_CHECK + #ifndef ABSL_BASE_ATTRIBUTES_H_ #define ABSL_BASE_ATTRIBUTES_H_ @@ -133,11 +135,14 @@ // Tags a function as weak for the purposes of compilation and linking. // Weak attributes did not work properly in LLVM's Windows backend before // 9.0.0, so disable them there. See https://bugs.llvm.org/show_bug.cgi?id=37598 -// for further information. +// for further information. Weak attributes do not work across DLL boundary. // The MinGW compiler doesn't complain about the weak attribute until the link // step, presumably because Windows doesn't use ELF binaries. -#if (ABSL_HAVE_ATTRIBUTE(weak) || (defined(__GNUC__) && !defined(__clang__))) && \ - (!defined(_WIN32) || (defined(__clang__) && __clang_major__ >= 9)) && \ +#if (ABSL_HAVE_ATTRIBUTE(weak) || \ + (defined(__GNUC__) && !defined(__clang__))) && \ + (!defined(_WIN32) || \ + (defined(__clang__) && __clang_major__ >= 9 && \ + !defined(ABSL_BUILD_DLL) && !defined(ABSL_CONSUME_DLL))) && \ !defined(__MINGW32__) #undef ABSL_ATTRIBUTE_WEAK #define ABSL_ATTRIBUTE_WEAK __attribute__((weak)) @@ -194,6 +199,9 @@ // ABSL_ATTRIBUTE_NORETURN // // Tells the compiler that a given function never returns. +// +// Deprecated: Prefer the `[[noreturn]]` attribute standardized by C++11 over +// this macro. #if ABSL_HAVE_ATTRIBUTE(noreturn) || (defined(__GNUC__) && !defined(__clang__)) #define ABSL_ATTRIBUTE_NORETURN __attribute__((noreturn)) #elif defined(_MSC_VER) @@ -686,7 +694,7 @@ // When deprecating Abseil code, it is sometimes necessary to turn off the // warning within Abseil, until the deprecated code is actually removed. The -// deprecated code can be surrounded with these directives to acheive that +// deprecated code can be surrounded with these directives to achieve that // result. // // class ABSL_DEPRECATED("Use Bar instead") Foo; @@ -701,6 +709,11 @@ _Pragma("GCC diagnostic ignored \"-Wdeprecated-declarations\"") #define ABSL_INTERNAL_RESTORE_DEPRECATED_DECLARATION_WARNING \ _Pragma("GCC diagnostic pop") +#elif defined(_MSC_VER) +#define ABSL_INTERNAL_DISABLE_DEPRECATED_DECLARATION_WARNING \ + _Pragma("warning(push)") _Pragma("warning(disable: 4996)") +#define ABSL_INTERNAL_RESTORE_DEPRECATED_DECLARATION_WARNING \ + _Pragma("warning(pop)") #else #define ABSL_INTERNAL_DISABLE_DEPRECATED_DECLARATION_WARNING #define ABSL_INTERNAL_RESTORE_DEPRECATED_DECLARATION_WARNING @@ -746,9 +759,52 @@ #define ABSL_CONST_INIT #endif -// These annotations are not available yet due to fear of breaking code. -#define ABSL_ATTRIBUTE_PURE_FUNCTION -#define ABSL_ATTRIBUTE_CONST_FUNCTION +// ABSL_ATTRIBUTE_PURE_FUNCTION +// +// ABSL_ATTRIBUTE_PURE_FUNCTION is used to annotate declarations of "pure" +// functions. A function is pure if its return value is only a function of its +// arguments. The pure attribute prohibits a function from modifying the state +// of the program that is observable by means other than inspecting the +// function's return value. Declaring such functions with the pure attribute +// allows the compiler to avoid emitting some calls in repeated invocations of +// the function with the same argument values. +// +// Example: +// +// ABSL_ATTRIBUTE_PURE_FUNCTION std::string FormatTime(Time t); +#if ABSL_HAVE_CPP_ATTRIBUTE(gnu::pure) +#define ABSL_ATTRIBUTE_PURE_FUNCTION [[gnu::pure]] +#elif ABSL_HAVE_ATTRIBUTE(pure) +#define ABSL_ATTRIBUTE_PURE_FUNCTION __attribute__((pure)) +#else +// If the attribute isn't defined, we'll fallback to ABSL_MUST_USE_RESULT since +// pure functions are useless if its return is ignored. +#define ABSL_ATTRIBUTE_PURE_FUNCTION ABSL_MUST_USE_RESULT +#endif + +// ABSL_ATTRIBUTE_CONST_FUNCTION +// +// ABSL_ATTRIBUTE_CONST_FUNCTION is used to annotate declarations of "const" +// functions. A const function is similar to a pure function, with one +// exception: Pure functions may return value that depend on a non-volatile +// object that isn't provided as a function argument, while the const function +// is guaranteed to return the same result given the same arguments. +// +// Example: +// +// ABSL_ATTRIBUTE_CONST_FUNCTION int64_t ToInt64Milliseconds(Duration d); +#if defined(_MSC_VER) && !defined(__clang__) +// Put the MSVC case first since MSVC seems to parse const as a C++ keyword. +#define ABSL_ATTRIBUTE_CONST_FUNCTION ABSL_ATTRIBUTE_PURE_FUNCTION +#elif ABSL_HAVE_CPP_ATTRIBUTE(gnu::const) +#define ABSL_ATTRIBUTE_CONST_FUNCTION [[gnu::const]] +#elif ABSL_HAVE_ATTRIBUTE(const) +#define ABSL_ATTRIBUTE_CONST_FUNCTION __attribute__((const)) +#else +// Since const functions are more restrictive pure function, we'll fallback to a +// pure function if the const attribute is not handled. +#define ABSL_ATTRIBUTE_CONST_FUNCTION ABSL_ATTRIBUTE_PURE_FUNCTION +#endif // ABSL_ATTRIBUTE_LIFETIME_BOUND indicates that a resource owned by a function // parameter or implicit object parameter is retained by the return value of the @@ -764,14 +820,89 @@ // // See also the upstream documentation: // https://clang.llvm.org/docs/AttributeReference.html#lifetimebound +// https://learn.microsoft.com/en-us/cpp/code-quality/c26816?view=msvc-170 #if ABSL_HAVE_CPP_ATTRIBUTE(clang::lifetimebound) #define ABSL_ATTRIBUTE_LIFETIME_BOUND [[clang::lifetimebound]] +#elif ABSL_HAVE_CPP_ATTRIBUTE(msvc::lifetimebound) +#define ABSL_ATTRIBUTE_LIFETIME_BOUND [[msvc::lifetimebound]] #elif ABSL_HAVE_ATTRIBUTE(lifetimebound) #define ABSL_ATTRIBUTE_LIFETIME_BOUND __attribute__((lifetimebound)) #else #define ABSL_ATTRIBUTE_LIFETIME_BOUND #endif +// Internal attribute; name and documentation TBD. +// +// See the upstream documentation: +// https://clang.llvm.org/docs/AttributeReference.html#lifetime_capture_by +#if ABSL_HAVE_CPP_ATTRIBUTE(clang::lifetime_capture_by) +#define ABSL_INTERNAL_ATTRIBUTE_CAPTURED_BY(Owner) \ + [[clang::lifetime_capture_by(Owner)]] +#else +#define ABSL_INTERNAL_ATTRIBUTE_CAPTURED_BY(Owner) +#endif + +// ABSL_ATTRIBUTE_VIEW indicates that a type is solely a "view" of data that it +// points to, similarly to a span, string_view, or other non-owning reference +// type. +// This enables diagnosing certain lifetime issues similar to those enabled by +// ABSL_ATTRIBUTE_LIFETIME_BOUND, such as: +// +// struct ABSL_ATTRIBUTE_VIEW StringView { +// template +// StringView(const R&); +// }; +// +// StringView f(std::string s) { +// return s; // warning: address of stack memory returned +// } +// +// We disable this on Clang versions < 13 because of the following +// false-positive: +// +// absl::string_view f(absl::optional sv) { return *sv; } +// +// See the following links for details: +// https://reviews.llvm.org/D64448 +// https://lists.llvm.org/pipermail/cfe-dev/2018-November/060355.html +#if ABSL_HAVE_CPP_ATTRIBUTE(gsl::Pointer) && \ + (!defined(__clang_major__) || __clang_major__ >= 13) +#define ABSL_ATTRIBUTE_VIEW [[gsl::Pointer]] +#else +#define ABSL_ATTRIBUTE_VIEW +#endif + +// ABSL_ATTRIBUTE_OWNER indicates that a type is a container, smart pointer, or +// similar class that owns all the data that it points to. +// This enables diagnosing certain lifetime issues similar to those enabled by +// ABSL_ATTRIBUTE_LIFETIME_BOUND, such as: +// +// struct ABSL_ATTRIBUTE_VIEW StringView { +// template +// StringView(const R&); +// }; +// +// struct ABSL_ATTRIBUTE_OWNER String {}; +// +// StringView f(String s) { +// return s; // warning: address of stack memory returned +// } +// +// We disable this on Clang versions < 13 because of the following +// false-positive: +// +// absl::string_view f(absl::optional sv) { return *sv; } +// +// See the following links for details: +// https://reviews.llvm.org/D64448 +// https://lists.llvm.org/pipermail/cfe-dev/2018-November/060355.html +#if ABSL_HAVE_CPP_ATTRIBUTE(gsl::Owner) && \ + (!defined(__clang_major__) || __clang_major__ >= 13) +#define ABSL_ATTRIBUTE_OWNER [[gsl::Owner]] +#else +#define ABSL_ATTRIBUTE_OWNER +#endif + // ABSL_ATTRIBUTE_TRIVIAL_ABI // Indicates that a type is "trivially relocatable" -- meaning it can be // relocated without invoking the constructor/destructor, using a form of move @@ -799,15 +930,11 @@ // See also the upstream documentation: // https://clang.llvm.org/docs/AttributeReference.html#trivial-abi // -#if ABSL_HAVE_CPP_ATTRIBUTE(clang::trivial_abi) -#define ABSL_ATTRIBUTE_TRIVIAL_ABI [[clang::trivial_abi]] -#define ABSL_HAVE_ATTRIBUTE_TRIVIAL_ABI 1 -#elif ABSL_HAVE_ATTRIBUTE(trivial_abi) -#define ABSL_ATTRIBUTE_TRIVIAL_ABI __attribute__((trivial_abi)) -#define ABSL_HAVE_ATTRIBUTE_TRIVIAL_ABI 1 -#else +// b/321691395 - This is currently disabled in open-source builds since +// compiler support differs. If system libraries compiled with GCC are mixed +// with libraries compiled with Clang, types will have different ideas about +// their ABI, leading to hard to debug crashes. #define ABSL_ATTRIBUTE_TRIVIAL_ABI -#endif // ABSL_ATTRIBUTE_NO_UNIQUE_ADDRESS // @@ -831,4 +958,51 @@ #define ABSL_ATTRIBUTE_NO_UNIQUE_ADDRESS #endif +// ABSL_ATTRIBUTE_UNINITIALIZED +// +// GCC and Clang support a flag `-ftrivial-auto-var-init=