aboutsummaryrefslogtreecommitdiffhomepage
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/core/ext/census/base_resources.cc (renamed from src/core/ext/census/base_resources.c)14
-rw-r--r--src/core/ext/census/base_resources.h10
-rw-r--r--src/core/ext/census/census_init.cc (renamed from src/core/ext/census/census_init.c)0
-rw-r--r--src/core/ext/census/census_interface.h10
-rw-r--r--src/core/ext/census/census_log.cc (renamed from src/core/ext/census/census_log.c)0
-rw-r--r--src/core/ext/census/census_log.h10
-rw-r--r--src/core/ext/census/census_rpc_stats.cc (renamed from src/core/ext/census/census_rpc_stats.c)0
-rw-r--r--src/core/ext/census/census_tracing.cc (renamed from src/core/ext/census/census_tracing.c)0
-rw-r--r--src/core/ext/census/context.cc (renamed from src/core/ext/census/context.c)0
-rw-r--r--src/core/ext/census/grpc_context.cc (renamed from src/core/ext/census/grpc_context.c)0
-rw-r--r--src/core/ext/census/grpc_filter.cc (renamed from src/core/ext/census/grpc_filter.c)0
-rw-r--r--src/core/ext/census/grpc_filter.h8
-rw-r--r--src/core/ext/census/grpc_plugin.cc (renamed from src/core/ext/census/grpc_plugin.c)4
-rw-r--r--src/core/ext/census/hash_table.cc (renamed from src/core/ext/census/hash_table.c)0
-rw-r--r--src/core/ext/census/hash_table.h10
-rw-r--r--src/core/ext/census/initialize.cc (renamed from src/core/ext/census/initialize.c)0
-rw-r--r--src/core/ext/census/intrusive_hash_map.cc (renamed from src/core/ext/census/intrusive_hash_map.c)0
-rw-r--r--src/core/ext/census/intrusive_hash_map.h8
-rw-r--r--src/core/ext/census/mlog.cc (renamed from src/core/ext/census/mlog.c)0
-rw-r--r--src/core/ext/census/mlog.h10
-rw-r--r--src/core/ext/census/operation.cc (renamed from src/core/ext/census/operation.c)0
-rw-r--r--src/core/ext/census/placeholders.cc (renamed from src/core/ext/census/placeholders.c)0
-rw-r--r--src/core/ext/census/resource.cc (renamed from src/core/ext/census/resource.c)0
-rw-r--r--src/core/ext/census/resource.h10
-rw-r--r--src/core/ext/census/trace_context.cc (renamed from src/core/ext/census/trace_context.c)0
-rw-r--r--src/core/ext/census/trace_context.h10
-rw-r--r--src/core/ext/census/trace_propagation.h10
-rw-r--r--src/core/ext/census/tracing.cc (renamed from src/core/ext/census/tracing.c)0
-rw-r--r--src/core/ext/census/tracing.h10
-rw-r--r--src/core/ext/census/window_stats.cc (renamed from src/core/ext/census/window_stats.c)0
-rw-r--r--src/core/ext/census/window_stats.h10
-rw-r--r--src/core/ext/filters/client_channel/channel_connectivity.cc (renamed from src/core/ext/filters/client_channel/channel_connectivity.c)2
-rw-r--r--src/core/ext/filters/client_channel/client_channel.cc (renamed from src/core/ext/filters/client_channel/client_channel.c)18
-rw-r--r--src/core/ext/filters/client_channel/client_channel.h10
-rw-r--r--src/core/ext/filters/client_channel/client_channel_factory.cc (renamed from src/core/ext/filters/client_channel/client_channel_factory.c)0
-rw-r--r--src/core/ext/filters/client_channel/client_channel_factory.h10
-rw-r--r--src/core/ext/filters/client_channel/client_channel_plugin.cc (renamed from src/core/ext/filters/client_channel/client_channel_plugin.c)4
-rw-r--r--src/core/ext/filters/client_channel/connector.cc (renamed from src/core/ext/filters/client_channel/connector.c)0
-rw-r--r--src/core/ext/filters/client_channel/connector.h10
-rw-r--r--src/core/ext/filters/client_channel/http_connect_handshaker.cc (renamed from src/core/ext/filters/client_channel/http_connect_handshaker.c)0
-rw-r--r--src/core/ext/filters/client_channel/http_connect_handshaker.h10
-rw-r--r--src/core/ext/filters/client_channel/http_proxy.cc (renamed from src/core/ext/filters/client_channel/http_proxy.c)0
-rw-r--r--src/core/ext/filters/client_channel/http_proxy.h10
-rw-r--r--src/core/ext/filters/client_channel/lb_policy.cc (renamed from src/core/ext/filters/client_channel/lb_policy.c)0
-rw-r--r--src/core/ext/filters/client_channel/lb_policy.h8
-rw-r--r--src/core/ext/filters/client_channel/lb_policy/grpclb/client_load_reporting_filter.cc (renamed from src/core/ext/filters/client_channel/lb_policy/grpclb/client_load_reporting_filter.c)0
-rw-r--r--src/core/ext/filters/client_channel/lb_policy/grpclb/client_load_reporting_filter.h8
-rw-r--r--src/core/ext/filters/client_channel/lb_policy/grpclb/grpclb.cc (renamed from src/core/ext/filters/client_channel/lb_policy/grpclb/grpclb.c)14
-rw-r--r--src/core/ext/filters/client_channel/lb_policy/grpclb/grpclb.h10
-rw-r--r--src/core/ext/filters/client_channel/lb_policy/grpclb/grpclb_channel.cc (renamed from src/core/ext/filters/client_channel/lb_policy/grpclb/grpclb_channel.c)0
-rw-r--r--src/core/ext/filters/client_channel/lb_policy/grpclb/grpclb_channel.h8
-rw-r--r--src/core/ext/filters/client_channel/lb_policy/grpclb/grpclb_channel_secure.cc (renamed from src/core/ext/filters/client_channel/lb_policy/grpclb/grpclb_channel_secure.c)0
-rw-r--r--src/core/ext/filters/client_channel/lb_policy/grpclb/grpclb_client_stats.cc (renamed from src/core/ext/filters/client_channel/lb_policy/grpclb/grpclb_client_stats.c)0
-rw-r--r--src/core/ext/filters/client_channel/lb_policy/grpclb/grpclb_client_stats.h8
-rw-r--r--src/core/ext/filters/client_channel/lb_policy/grpclb/load_balancer_api.cc (renamed from src/core/ext/filters/client_channel/lb_policy/grpclb/load_balancer_api.c)0
-rw-r--r--src/core/ext/filters/client_channel/lb_policy/pick_first/pick_first.cc (renamed from src/core/ext/filters/client_channel/lb_policy/pick_first/pick_first.c)4
-rw-r--r--src/core/ext/filters/client_channel/lb_policy/round_robin/round_robin.cc (renamed from src/core/ext/filters/client_channel/lb_policy/round_robin/round_robin.c)4
-rw-r--r--src/core/ext/filters/client_channel/lb_policy_factory.cc (renamed from src/core/ext/filters/client_channel/lb_policy_factory.c)0
-rw-r--r--src/core/ext/filters/client_channel/lb_policy_factory.h10
-rw-r--r--src/core/ext/filters/client_channel/lb_policy_registry.cc (renamed from src/core/ext/filters/client_channel/lb_policy_registry.c)0
-rw-r--r--src/core/ext/filters/client_channel/lb_policy_registry.h10
-rw-r--r--src/core/ext/filters/client_channel/parse_address.cc (renamed from src/core/ext/filters/client_channel/parse_address.c)0
-rw-r--r--src/core/ext/filters/client_channel/parse_address.h10
-rw-r--r--src/core/ext/filters/client_channel/proxy_mapper.cc (renamed from src/core/ext/filters/client_channel/proxy_mapper.c)0
-rw-r--r--src/core/ext/filters/client_channel/proxy_mapper.h10
-rw-r--r--src/core/ext/filters/client_channel/proxy_mapper_registry.cc (renamed from src/core/ext/filters/client_channel/proxy_mapper_registry.c)0
-rw-r--r--src/core/ext/filters/client_channel/proxy_mapper_registry.h10
-rw-r--r--src/core/ext/filters/client_channel/resolver.cc (renamed from src/core/ext/filters/client_channel/resolver.c)0
-rw-r--r--src/core/ext/filters/client_channel/resolver.h8
-rw-r--r--src/core/ext/filters/client_channel/resolver/dns/c_ares/dns_resolver_ares.cc (renamed from src/core/ext/filters/client_channel/resolver/dns/c_ares/dns_resolver_ares.c)8
-rw-r--r--src/core/ext/filters/client_channel/resolver/dns/c_ares/grpc_ares_ev_driver.h8
-rw-r--r--src/core/ext/filters/client_channel/resolver/dns/c_ares/grpc_ares_ev_driver_posix.cc (renamed from src/core/ext/filters/client_channel/resolver/dns/c_ares/grpc_ares_ev_driver_posix.c)0
-rw-r--r--src/core/ext/filters/client_channel/resolver/dns/c_ares/grpc_ares_wrapper.cc (renamed from src/core/ext/filters/client_channel/resolver/dns/c_ares/grpc_ares_wrapper.c)0
-rw-r--r--src/core/ext/filters/client_channel/resolver/dns/c_ares/grpc_ares_wrapper.h8
-rw-r--r--src/core/ext/filters/client_channel/resolver/dns/c_ares/grpc_ares_wrapper_fallback.cc (renamed from src/core/ext/filters/client_channel/resolver/dns/c_ares/grpc_ares_wrapper_fallback.c)0
-rw-r--r--src/core/ext/filters/client_channel/resolver/dns/native/dns_resolver.cc (renamed from src/core/ext/filters/client_channel/resolver/dns/native/dns_resolver.c)7
-rw-r--r--src/core/ext/filters/client_channel/resolver/fake/fake_resolver.cc (renamed from src/core/ext/filters/client_channel/resolver/fake/fake_resolver.c)4
-rw-r--r--src/core/ext/filters/client_channel/resolver/fake/fake_resolver.h8
-rw-r--r--src/core/ext/filters/client_channel/resolver/sockaddr/sockaddr_resolver.cc (renamed from src/core/ext/filters/client_channel/resolver/sockaddr/sockaddr_resolver.c)4
-rw-r--r--src/core/ext/filters/client_channel/resolver_factory.cc (renamed from src/core/ext/filters/client_channel/resolver_factory.c)0
-rw-r--r--src/core/ext/filters/client_channel/resolver_factory.h10
-rw-r--r--src/core/ext/filters/client_channel/resolver_registry.cc (renamed from src/core/ext/filters/client_channel/resolver_registry.c)0
-rw-r--r--src/core/ext/filters/client_channel/resolver_registry.h10
-rw-r--r--src/core/ext/filters/client_channel/retry_throttle.cc (renamed from src/core/ext/filters/client_channel/retry_throttle.c)0
-rw-r--r--src/core/ext/filters/client_channel/retry_throttle.h10
-rw-r--r--src/core/ext/filters/client_channel/subchannel.cc (renamed from src/core/ext/filters/client_channel/subchannel.c)32
-rw-r--r--src/core/ext/filters/client_channel/subchannel.h8
-rw-r--r--src/core/ext/filters/client_channel/subchannel_index.cc (renamed from src/core/ext/filters/client_channel/subchannel_index.c)11
-rw-r--r--src/core/ext/filters/client_channel/subchannel_index.h10
-rw-r--r--src/core/ext/filters/client_channel/uri_parser.cc (renamed from src/core/ext/filters/client_channel/uri_parser.c)0
-rw-r--r--src/core/ext/filters/client_channel/uri_parser.h10
-rw-r--r--src/core/ext/filters/deadline/deadline_filter.cc (renamed from src/core/ext/filters/deadline/deadline_filter.c)4
-rw-r--r--src/core/ext/filters/deadline/deadline_filter.h10
-rw-r--r--src/core/ext/filters/http/client/http_client_filter.cc (renamed from src/core/ext/filters/http/client/http_client_filter.c)0
-rw-r--r--src/core/ext/filters/http/client/http_client_filter.h8
-rw-r--r--src/core/ext/filters/http/http_filters_plugin.cc (renamed from src/core/ext/filters/http/http_filters_plugin.c)4
-rw-r--r--src/core/ext/filters/http/message_compress/message_compress_filter.cc (renamed from src/core/ext/filters/http/message_compress/message_compress_filter.c)0
-rw-r--r--src/core/ext/filters/http/message_compress/message_compress_filter.h8
-rw-r--r--src/core/ext/filters/http/server/http_server_filter.cc (renamed from src/core/ext/filters/http/server/http_server_filter.c)0
-rw-r--r--src/core/ext/filters/http/server/http_server_filter.h8
-rw-r--r--src/core/ext/filters/load_reporting/server_load_reporting_filter.cc (renamed from src/core/ext/filters/load_reporting/server_load_reporting_filter.c)0
-rw-r--r--src/core/ext/filters/load_reporting/server_load_reporting_filter.h8
-rw-r--r--src/core/ext/filters/load_reporting/server_load_reporting_plugin.cc (renamed from src/core/ext/filters/load_reporting/server_load_reporting_plugin.c)4
-rw-r--r--src/core/ext/filters/load_reporting/server_load_reporting_plugin.h8
-rw-r--r--src/core/ext/filters/max_age/max_age_filter.cc (renamed from src/core/ext/filters/max_age/max_age_filter.c)11
-rw-r--r--src/core/ext/filters/max_age/max_age_filter.h8
-rw-r--r--src/core/ext/filters/message_size/message_size_filter.cc (renamed from src/core/ext/filters/message_size/message_size_filter.c)4
-rw-r--r--src/core/ext/filters/message_size/message_size_filter.h8
-rw-r--r--src/core/ext/filters/workarounds/workaround_cronet_compression_filter.cc (renamed from src/core/ext/filters/workarounds/workaround_cronet_compression_filter.c)4
-rw-r--r--src/core/ext/filters/workarounds/workaround_cronet_compression_filter.h8
-rw-r--r--src/core/ext/filters/workarounds/workaround_utils.cc (renamed from src/core/ext/filters/workarounds/workaround_utils.c)0
-rw-r--r--src/core/ext/filters/workarounds/workaround_utils.h10
-rw-r--r--src/core/ext/transport/chttp2/alpn/alpn.cc (renamed from src/core/ext/transport/chttp2/alpn/alpn.c)0
-rw-r--r--src/core/ext/transport/chttp2/alpn/alpn.h10
-rw-r--r--src/core/ext/transport/chttp2/client/chttp2_connector.cc (renamed from src/core/ext/transport/chttp2/client/chttp2_connector.c)0
-rw-r--r--src/core/ext/transport/chttp2/client/chttp2_connector.h8
-rw-r--r--src/core/ext/transport/chttp2/client/insecure/channel_create.cc (renamed from src/core/ext/transport/chttp2/client/insecure/channel_create.c)0
-rw-r--r--src/core/ext/transport/chttp2/client/insecure/channel_create_posix.cc (renamed from src/core/ext/transport/chttp2/client/insecure/channel_create_posix.c)0
-rw-r--r--src/core/ext/transport/chttp2/client/secure/secure_channel_create.cc (renamed from src/core/ext/transport/chttp2/client/secure/secure_channel_create.c)8
-rw-r--r--src/core/ext/transport/chttp2/server/chttp2_server.cc (renamed from src/core/ext/transport/chttp2/server/chttp2_server.c)1
-rw-r--r--src/core/ext/transport/chttp2/server/chttp2_server.h10
-rw-r--r--src/core/ext/transport/chttp2/server/insecure/server_chttp2.cc (renamed from src/core/ext/transport/chttp2/server/insecure/server_chttp2.c)0
-rw-r--r--src/core/ext/transport/chttp2/server/insecure/server_chttp2_posix.cc (renamed from src/core/ext/transport/chttp2/server/insecure/server_chttp2_posix.c)0
-rw-r--r--src/core/ext/transport/chttp2/server/secure/server_secure_chttp2.cc (renamed from src/core/ext/transport/chttp2/server/secure/server_secure_chttp2.c)6
-rw-r--r--src/core/ext/transport/chttp2/transport/bin_decoder.cc (renamed from src/core/ext/transport/chttp2/transport/bin_decoder.c)0
-rw-r--r--src/core/ext/transport/chttp2/transport/bin_decoder.h10
-rw-r--r--src/core/ext/transport/chttp2/transport/bin_encoder.cc (renamed from src/core/ext/transport/chttp2/transport/bin_encoder.c)0
-rw-r--r--src/core/ext/transport/chttp2/transport/bin_encoder.h10
-rw-r--r--src/core/ext/transport/chttp2/transport/chttp2_plugin.cc (renamed from src/core/ext/transport/chttp2/transport/chttp2_plugin.c)4
-rw-r--r--src/core/ext/transport/chttp2/transport/chttp2_transport.cc (renamed from src/core/ext/transport/chttp2/transport/chttp2_transport.c)87
-rw-r--r--src/core/ext/transport/chttp2/transport/chttp2_transport.h8
-rw-r--r--src/core/ext/transport/chttp2/transport/flow_control.cc (renamed from src/core/ext/transport/chttp2/transport/flow_control.c)5
-rw-r--r--src/core/ext/transport/chttp2/transport/frame.h8
-rw-r--r--src/core/ext/transport/chttp2/transport/frame_data.cc (renamed from src/core/ext/transport/chttp2/transport/frame_data.c)0
-rw-r--r--src/core/ext/transport/chttp2/transport/frame_data.h10
-rw-r--r--src/core/ext/transport/chttp2/transport/frame_goaway.cc (renamed from src/core/ext/transport/chttp2/transport/frame_goaway.c)0
-rw-r--r--src/core/ext/transport/chttp2/transport/frame_goaway.h10
-rw-r--r--src/core/ext/transport/chttp2/transport/frame_ping.cc (renamed from src/core/ext/transport/chttp2/transport/frame_ping.c)0
-rw-r--r--src/core/ext/transport/chttp2/transport/frame_ping.h10
-rw-r--r--src/core/ext/transport/chttp2/transport/frame_rst_stream.cc (renamed from src/core/ext/transport/chttp2/transport/frame_rst_stream.c)0
-rw-r--r--src/core/ext/transport/chttp2/transport/frame_rst_stream.h10
-rw-r--r--src/core/ext/transport/chttp2/transport/frame_settings.cc (renamed from src/core/ext/transport/chttp2/transport/frame_settings.c)0
-rw-r--r--src/core/ext/transport/chttp2/transport/frame_settings.h10
-rw-r--r--src/core/ext/transport/chttp2/transport/frame_window_update.cc (renamed from src/core/ext/transport/chttp2/transport/frame_window_update.c)0
-rw-r--r--src/core/ext/transport/chttp2/transport/frame_window_update.h10
-rw-r--r--src/core/ext/transport/chttp2/transport/hpack_encoder.cc (renamed from src/core/ext/transport/chttp2/transport/hpack_encoder.c)2
-rw-r--r--src/core/ext/transport/chttp2/transport/hpack_encoder.h10
-rw-r--r--src/core/ext/transport/chttp2/transport/hpack_parser.cc (renamed from src/core/ext/transport/chttp2/transport/hpack_parser.c)0
-rw-r--r--src/core/ext/transport/chttp2/transport/hpack_parser.h10
-rw-r--r--src/core/ext/transport/chttp2/transport/hpack_table.cc (renamed from src/core/ext/transport/chttp2/transport/hpack_table.c)2
-rw-r--r--src/core/ext/transport/chttp2/transport/hpack_table.h8
-rw-r--r--src/core/ext/transport/chttp2/transport/http2_settings.cc (renamed from src/core/ext/transport/chttp2/transport/http2_settings.c)0
-rw-r--r--src/core/ext/transport/chttp2/transport/http2_settings.h10
-rw-r--r--src/core/ext/transport/chttp2/transport/huffsyms.cc (renamed from src/core/ext/transport/chttp2/transport/huffsyms.c)0
-rw-r--r--src/core/ext/transport/chttp2/transport/huffsyms.h8
-rw-r--r--src/core/ext/transport/chttp2/transport/incoming_metadata.cc (renamed from src/core/ext/transport/chttp2/transport/incoming_metadata.c)0
-rw-r--r--src/core/ext/transport/chttp2/transport/incoming_metadata.h10
-rw-r--r--src/core/ext/transport/chttp2/transport/internal.h8
-rw-r--r--src/core/ext/transport/chttp2/transport/parsing.cc (renamed from src/core/ext/transport/chttp2/transport/parsing.c)0
-rw-r--r--src/core/ext/transport/chttp2/transport/stream_lists.cc (renamed from src/core/ext/transport/chttp2/transport/stream_lists.c)3
-rw-r--r--src/core/ext/transport/chttp2/transport/stream_map.cc (renamed from src/core/ext/transport/chttp2/transport/stream_map.c)0
-rw-r--r--src/core/ext/transport/chttp2/transport/stream_map.h10
-rw-r--r--src/core/ext/transport/chttp2/transport/varint.cc (renamed from src/core/ext/transport/chttp2/transport/varint.c)0
-rw-r--r--src/core/ext/transport/chttp2/transport/varint.h8
-rw-r--r--src/core/ext/transport/chttp2/transport/writing.cc (renamed from src/core/ext/transport/chttp2/transport/writing.c)33
-rw-r--r--src/core/ext/transport/cronet/client/secure/cronet_channel_create.cc (renamed from src/core/ext/transport/cronet/client/secure/cronet_channel_create.c)2
-rw-r--r--src/core/ext/transport/cronet/transport/cronet_api_dummy.cc (renamed from src/core/ext/transport/cronet/transport/cronet_api_dummy.c)0
-rw-r--r--src/core/ext/transport/cronet/transport/cronet_transport.cc (renamed from src/core/ext/transport/cronet/transport/cronet_transport.c)17
-rw-r--r--src/core/ext/transport/cronet/transport/cronet_transport.h8
-rw-r--r--src/core/ext/transport/inproc/inproc_plugin.cc (renamed from src/core/ext/transport/inproc/inproc_plugin.c)6
-rw-r--r--src/core/ext/transport/inproc/inproc_transport.cc (renamed from src/core/ext/transport/inproc/inproc_transport.c)0
-rw-r--r--src/core/lib/channel/channel_args.cc (renamed from src/core/lib/channel/channel_args.c)0
-rw-r--r--src/core/lib/channel/channel_args.h10
-rw-r--r--src/core/lib/channel/channel_stack.cc (renamed from src/core/lib/channel/channel_stack.c)0
-rw-r--r--src/core/lib/channel/channel_stack_builder.cc (renamed from src/core/lib/channel/channel_stack_builder.c)0
-rw-r--r--src/core/lib/channel/connected_channel.cc (renamed from src/core/lib/channel/connected_channel.c)0
-rw-r--r--src/core/lib/channel/connected_channel.h10
-rw-r--r--src/core/lib/channel/handshaker.cc (renamed from src/core/lib/channel/handshaker.c)0
-rw-r--r--src/core/lib/channel/handshaker.h10
-rw-r--r--src/core/lib/channel/handshaker_factory.cc (renamed from src/core/lib/channel/handshaker_factory.c)0
-rw-r--r--src/core/lib/channel/handshaker_factory.h10
-rw-r--r--src/core/lib/channel/handshaker_registry.cc (renamed from src/core/lib/channel/handshaker_registry.c)0
-rw-r--r--src/core/lib/channel/handshaker_registry.h10
-rw-r--r--src/core/lib/compression/algorithm_metadata.h10
-rw-r--r--src/core/lib/compression/compression.cc (renamed from src/core/lib/compression/compression.c)0
-rw-r--r--src/core/lib/compression/message_compress.cc (renamed from src/core/lib/compression/message_compress.c)0
-rw-r--r--src/core/lib/compression/message_compress.h10
-rw-r--r--src/core/lib/compression/stream_compression.cc (renamed from src/core/lib/compression/stream_compression.c)2
-rw-r--r--src/core/lib/compression/stream_compression.h8
-rw-r--r--src/core/lib/compression/stream_compression_gzip.cc (renamed from src/core/lib/compression/stream_compression_gzip.c)7
-rw-r--r--src/core/lib/compression/stream_compression_gzip.h8
-rw-r--r--src/core/lib/compression/stream_compression_identity.cc (renamed from src/core/lib/compression/stream_compression_identity.c)9
-rw-r--r--src/core/lib/compression/stream_compression_identity.h8
-rw-r--r--src/core/lib/debug/stats.cc (renamed from src/core/lib/debug/stats.c)0
-rw-r--r--src/core/lib/debug/stats.h8
-rw-r--r--src/core/lib/debug/stats_data.cc (renamed from src/core/lib/debug/stats_data.c)0
-rw-r--r--src/core/lib/debug/stats_data.h8
-rw-r--r--src/core/lib/debug/trace.cc (renamed from src/core/lib/debug/trace.c)1
-rw-r--r--src/core/lib/debug/trace.h8
-rw-r--r--src/core/lib/http/format_request.cc (renamed from src/core/lib/http/format_request.c)0
-rw-r--r--src/core/lib/http/format_request.h10
-rw-r--r--src/core/lib/http/httpcli.cc (renamed from src/core/lib/http/httpcli.c)0
-rw-r--r--src/core/lib/http/httpcli.h10
-rw-r--r--src/core/lib/http/httpcli_security_connector.cc (renamed from src/core/lib/http/httpcli_security_connector.c)9
-rw-r--r--src/core/lib/http/parser.cc (renamed from src/core/lib/http/parser.c)0
-rw-r--r--src/core/lib/http/parser.h10
-rw-r--r--src/core/lib/iomgr/call_combiner.cc (renamed from src/core/lib/iomgr/call_combiner.c)2
-rw-r--r--src/core/lib/iomgr/call_combiner.h8
-rw-r--r--src/core/lib/iomgr/closure.cc (renamed from src/core/lib/iomgr/closure.c)0
-rw-r--r--src/core/lib/iomgr/combiner.cc (renamed from src/core/lib/iomgr/combiner.c)1
-rw-r--r--src/core/lib/iomgr/combiner.h8
-rw-r--r--src/core/lib/iomgr/endpoint.cc (renamed from src/core/lib/iomgr/endpoint.c)0
-rw-r--r--src/core/lib/iomgr/endpoint.h10
-rw-r--r--src/core/lib/iomgr/endpoint_pair.h10
-rw-r--r--src/core/lib/iomgr/endpoint_pair_posix.cc (renamed from src/core/lib/iomgr/endpoint_pair_posix.c)0
-rw-r--r--src/core/lib/iomgr/endpoint_pair_uv.cc (renamed from src/core/lib/iomgr/endpoint_pair_uv.c)0
-rw-r--r--src/core/lib/iomgr/endpoint_pair_windows.cc (renamed from src/core/lib/iomgr/endpoint_pair_windows.c)0
-rw-r--r--src/core/lib/iomgr/error.cc (renamed from src/core/lib/iomgr/error.c)2
-rw-r--r--src/core/lib/iomgr/error.h2
-rw-r--r--src/core/lib/iomgr/error_internal.h10
-rw-r--r--src/core/lib/iomgr/ev_epoll1_linux.cc (renamed from src/core/lib/iomgr/ev_epoll1_linux.c)3
-rw-r--r--src/core/lib/iomgr/ev_epoll1_linux.h10
-rw-r--r--src/core/lib/iomgr/ev_epollex_linux.cc (renamed from src/core/lib/iomgr/ev_epollex_linux.c)2
-rw-r--r--src/core/lib/iomgr/ev_epollex_linux.h10
-rw-r--r--src/core/lib/iomgr/ev_epollsig_linux.cc (renamed from src/core/lib/iomgr/ev_epollsig_linux.c)2
-rw-r--r--src/core/lib/iomgr/ev_epollsig_linux.h8
-rw-r--r--src/core/lib/iomgr/ev_poll_posix.cc (renamed from src/core/lib/iomgr/ev_poll_posix.c)0
-rw-r--r--src/core/lib/iomgr/ev_poll_posix.h10
-rw-r--r--src/core/lib/iomgr/ev_posix.cc (renamed from src/core/lib/iomgr/ev_posix.c)0
-rw-r--r--src/core/lib/iomgr/ev_posix.h10
-rw-r--r--src/core/lib/iomgr/ev_windows.cc (renamed from src/core/lib/iomgr/ev_windows.c)0
-rw-r--r--src/core/lib/iomgr/exec_ctx.cc (renamed from src/core/lib/iomgr/exec_ctx.c)0
-rw-r--r--src/core/lib/iomgr/exec_ctx.h8
-rw-r--r--src/core/lib/iomgr/executor.cc (renamed from src/core/lib/iomgr/executor.c)4
-rw-r--r--src/core/lib/iomgr/executor.h10
-rw-r--r--src/core/lib/iomgr/gethostname.h8
-rw-r--r--src/core/lib/iomgr/gethostname_fallback.cc (renamed from src/core/lib/iomgr/gethostname_fallback.c)1
-rw-r--r--src/core/lib/iomgr/gethostname_host_name_max.cc (renamed from src/core/lib/iomgr/gethostname_host_name_max.c)1
-rw-r--r--src/core/lib/iomgr/gethostname_sysconf.cc (renamed from src/core/lib/iomgr/gethostname_sysconf.c)1
-rw-r--r--src/core/lib/iomgr/iocp_windows.cc (renamed from src/core/lib/iomgr/iocp_windows.c)0
-rw-r--r--src/core/lib/iomgr/iocp_windows.h10
-rw-r--r--src/core/lib/iomgr/iomgr.cc (renamed from src/core/lib/iomgr/iomgr.c)3
-rw-r--r--src/core/lib/iomgr/iomgr.h10
-rw-r--r--src/core/lib/iomgr/iomgr_internal.h10
-rw-r--r--src/core/lib/iomgr/iomgr_posix.cc (renamed from src/core/lib/iomgr/iomgr_posix.c)0
-rw-r--r--src/core/lib/iomgr/iomgr_uv.cc (renamed from src/core/lib/iomgr/iomgr_uv.c)0
-rw-r--r--src/core/lib/iomgr/iomgr_uv.h8
-rw-r--r--src/core/lib/iomgr/iomgr_windows.cc (renamed from src/core/lib/iomgr/iomgr_windows.c)0
-rw-r--r--src/core/lib/iomgr/is_epollexclusive_available.cc (renamed from src/core/lib/iomgr/is_epollexclusive_available.c)0
-rw-r--r--src/core/lib/iomgr/is_epollexclusive_available.h10
-rw-r--r--src/core/lib/iomgr/load_file.cc (renamed from src/core/lib/iomgr/load_file.c)0
-rw-r--r--src/core/lib/iomgr/lockfree_event.cc (renamed from src/core/lib/iomgr/lockfree_event.c)0
-rw-r--r--src/core/lib/iomgr/lockfree_event.h10
-rw-r--r--src/core/lib/iomgr/network_status_tracker.cc (renamed from src/core/lib/iomgr/network_status_tracker.c)1
-rw-r--r--src/core/lib/iomgr/network_status_tracker.h10
-rw-r--r--src/core/lib/iomgr/polling_entity.cc (renamed from src/core/lib/iomgr/polling_entity.c)0
-rw-r--r--src/core/lib/iomgr/polling_entity.h10
-rw-r--r--src/core/lib/iomgr/pollset.h8
-rw-r--r--src/core/lib/iomgr/pollset_set.h10
-rw-r--r--src/core/lib/iomgr/pollset_set_uv.cc (renamed from src/core/lib/iomgr/pollset_set_uv.c)0
-rw-r--r--src/core/lib/iomgr/pollset_set_windows.cc (renamed from src/core/lib/iomgr/pollset_set_windows.c)0
-rw-r--r--src/core/lib/iomgr/pollset_uv.cc (renamed from src/core/lib/iomgr/pollset_uv.c)2
-rw-r--r--src/core/lib/iomgr/pollset_uv.h10
-rw-r--r--src/core/lib/iomgr/pollset_windows.cc (renamed from src/core/lib/iomgr/pollset_windows.c)0
-rw-r--r--src/core/lib/iomgr/pollset_windows.h10
-rw-r--r--src/core/lib/iomgr/resolve_address.h10
-rw-r--r--src/core/lib/iomgr/resolve_address_posix.cc (renamed from src/core/lib/iomgr/resolve_address_posix.c)0
-rw-r--r--src/core/lib/iomgr/resolve_address_uv.cc (renamed from src/core/lib/iomgr/resolve_address_uv.c)25
-rw-r--r--src/core/lib/iomgr/resolve_address_windows.cc (renamed from src/core/lib/iomgr/resolve_address_windows.c)12
-rw-r--r--src/core/lib/iomgr/resource_quota.cc (renamed from src/core/lib/iomgr/resource_quota.c)1
-rw-r--r--src/core/lib/iomgr/resource_quota.h10
-rw-r--r--src/core/lib/iomgr/sockaddr_utils.cc (renamed from src/core/lib/iomgr/sockaddr_utils.c)1
-rw-r--r--src/core/lib/iomgr/sockaddr_utils.h10
-rw-r--r--src/core/lib/iomgr/socket_factory_posix.cc (renamed from src/core/lib/iomgr/socket_factory_posix.c)0
-rw-r--r--src/core/lib/iomgr/socket_mutator.cc (renamed from src/core/lib/iomgr/socket_mutator.c)0
-rw-r--r--src/core/lib/iomgr/socket_utils.h10
-rw-r--r--src/core/lib/iomgr/socket_utils_common_posix.cc (renamed from src/core/lib/iomgr/socket_utils_common_posix.c)0
-rw-r--r--src/core/lib/iomgr/socket_utils_linux.cc (renamed from src/core/lib/iomgr/socket_utils_linux.c)0
-rw-r--r--src/core/lib/iomgr/socket_utils_posix.cc (renamed from src/core/lib/iomgr/socket_utils_posix.c)0
-rw-r--r--src/core/lib/iomgr/socket_utils_posix.h10
-rw-r--r--src/core/lib/iomgr/socket_utils_uv.cc (renamed from src/core/lib/iomgr/socket_utils_uv.c)0
-rw-r--r--src/core/lib/iomgr/socket_utils_windows.cc (renamed from src/core/lib/iomgr/socket_utils_windows.c)0
-rw-r--r--src/core/lib/iomgr/socket_windows.cc (renamed from src/core/lib/iomgr/socket_windows.c)2
-rw-r--r--src/core/lib/iomgr/socket_windows.h10
-rw-r--r--src/core/lib/iomgr/tcp_client.h10
-rw-r--r--src/core/lib/iomgr/tcp_client_posix.cc (renamed from src/core/lib/iomgr/tcp_client_posix.c)2
-rw-r--r--src/core/lib/iomgr/tcp_client_posix.h10
-rw-r--r--src/core/lib/iomgr/tcp_client_uv.cc (renamed from src/core/lib/iomgr/tcp_client_uv.c)12
-rw-r--r--src/core/lib/iomgr/tcp_client_windows.cc (renamed from src/core/lib/iomgr/tcp_client_windows.c)10
-rw-r--r--src/core/lib/iomgr/tcp_posix.cc (renamed from src/core/lib/iomgr/tcp_posix.c)0
-rw-r--r--src/core/lib/iomgr/tcp_posix.h10
-rw-r--r--src/core/lib/iomgr/tcp_server.h10
-rw-r--r--src/core/lib/iomgr/tcp_server_posix.cc (renamed from src/core/lib/iomgr/tcp_server_posix.c)0
-rw-r--r--src/core/lib/iomgr/tcp_server_utils_posix.h10
-rw-r--r--src/core/lib/iomgr/tcp_server_utils_posix_common.cc (renamed from src/core/lib/iomgr/tcp_server_utils_posix_common.c)0
-rw-r--r--src/core/lib/iomgr/tcp_server_utils_posix_ifaddrs.cc (renamed from src/core/lib/iomgr/tcp_server_utils_posix_ifaddrs.c)0
-rw-r--r--src/core/lib/iomgr/tcp_server_utils_posix_noifaddrs.cc (renamed from src/core/lib/iomgr/tcp_server_utils_posix_noifaddrs.c)0
-rw-r--r--src/core/lib/iomgr/tcp_server_uv.cc (renamed from src/core/lib/iomgr/tcp_server_uv.c)20
-rw-r--r--src/core/lib/iomgr/tcp_server_windows.cc (renamed from src/core/lib/iomgr/tcp_server_windows.c)18
-rw-r--r--src/core/lib/iomgr/tcp_uv.cc (renamed from src/core/lib/iomgr/tcp_uv.c)10
-rw-r--r--src/core/lib/iomgr/tcp_uv.h10
-rw-r--r--src/core/lib/iomgr/tcp_windows.cc (renamed from src/core/lib/iomgr/tcp_windows.c)7
-rw-r--r--src/core/lib/iomgr/tcp_windows.h10
-rw-r--r--src/core/lib/iomgr/time_averaged_stats.cc (renamed from src/core/lib/iomgr/time_averaged_stats.c)0
-rw-r--r--src/core/lib/iomgr/time_averaged_stats.h10
-rw-r--r--src/core/lib/iomgr/timer.h8
-rw-r--r--src/core/lib/iomgr/timer_generic.cc (renamed from src/core/lib/iomgr/timer_generic.c)4
-rw-r--r--src/core/lib/iomgr/timer_heap.cc (renamed from src/core/lib/iomgr/timer_heap.c)0
-rw-r--r--src/core/lib/iomgr/timer_heap.h10
-rw-r--r--src/core/lib/iomgr/timer_manager.cc (renamed from src/core/lib/iomgr/timer_manager.c)5
-rw-r--r--src/core/lib/iomgr/timer_manager.h10
-rw-r--r--src/core/lib/iomgr/timer_uv.cc (renamed from src/core/lib/iomgr/timer_uv.c)4
-rw-r--r--src/core/lib/iomgr/udp_server.cc (renamed from src/core/lib/iomgr/udp_server.c)0
-rw-r--r--src/core/lib/iomgr/udp_server.h10
-rw-r--r--src/core/lib/iomgr/unix_sockets_posix.cc (renamed from src/core/lib/iomgr/unix_sockets_posix.c)0
-rw-r--r--src/core/lib/iomgr/unix_sockets_posix.h10
-rw-r--r--src/core/lib/iomgr/unix_sockets_posix_noop.cc (renamed from src/core/lib/iomgr/unix_sockets_posix_noop.c)0
-rw-r--r--src/core/lib/iomgr/wakeup_fd_cv.cc (renamed from src/core/lib/iomgr/wakeup_fd_cv.c)0
-rw-r--r--src/core/lib/iomgr/wakeup_fd_cv.h10
-rw-r--r--src/core/lib/iomgr/wakeup_fd_eventfd.cc (renamed from src/core/lib/iomgr/wakeup_fd_eventfd.c)0
-rw-r--r--src/core/lib/iomgr/wakeup_fd_nospecial.cc (renamed from src/core/lib/iomgr/wakeup_fd_nospecial.c)0
-rw-r--r--src/core/lib/iomgr/wakeup_fd_pipe.cc (renamed from src/core/lib/iomgr/wakeup_fd_pipe.c)1
-rw-r--r--src/core/lib/iomgr/wakeup_fd_pipe.h10
-rw-r--r--src/core/lib/iomgr/wakeup_fd_posix.cc (renamed from src/core/lib/iomgr/wakeup_fd_posix.c)1
-rw-r--r--src/core/lib/iomgr/wakeup_fd_posix.h8
-rw-r--r--src/core/lib/json/json.cc (renamed from src/core/lib/json/json.c)0
-rw-r--r--src/core/lib/json/json.h10
-rw-r--r--src/core/lib/json/json_reader.cc (renamed from src/core/lib/json/json_reader.c)0
-rw-r--r--src/core/lib/json/json_reader.h10
-rw-r--r--src/core/lib/json/json_string.cc (renamed from src/core/lib/json/json_string.c)0
-rw-r--r--src/core/lib/json/json_writer.cc (renamed from src/core/lib/json/json_writer.c)0
-rw-r--r--src/core/lib/json/json_writer.h10
-rw-r--r--src/core/lib/profiling/basic_timers.cc (renamed from src/core/lib/profiling/basic_timers.c)4
-rw-r--r--src/core/lib/profiling/stap_timers.cc (renamed from src/core/lib/profiling/stap_timers.c)0
-rw-r--r--src/core/lib/security/context/security_context.cc (renamed from src/core/lib/security/context/security_context.c)26
-rw-r--r--src/core/lib/security/credentials/composite/composite_credentials.cc (renamed from src/core/lib/security/credentials/composite/composite_credentials.c)12
-rw-r--r--src/core/lib/security/credentials/composite/composite_credentials.h8
-rw-r--r--src/core/lib/security/credentials/credentials.cc (renamed from src/core/lib/security/credentials/credentials.c)22
-rw-r--r--src/core/lib/security/credentials/credentials.h8
-rw-r--r--src/core/lib/security/credentials/credentials_metadata.cc (renamed from src/core/lib/security/credentials/credentials_metadata.c)3
-rw-r--r--src/core/lib/security/credentials/fake/fake_credentials.cc (renamed from src/core/lib/security/credentials/fake/fake_credentials.c)13
-rw-r--r--src/core/lib/security/credentials/fake/fake_credentials.h10
-rw-r--r--src/core/lib/security/credentials/google_default/credentials_generic.cc (renamed from src/core/lib/security/credentials/google_default/credentials_generic.c)0
-rw-r--r--src/core/lib/security/credentials/google_default/google_default_credentials.cc (renamed from src/core/lib/security/credentials/google_default/google_default_credentials.c)9
-rw-r--r--src/core/lib/security/credentials/google_default/google_default_credentials.h8
-rw-r--r--src/core/lib/security/credentials/iam/iam_credentials.cc (renamed from src/core/lib/security/credentials/iam/iam_credentials.c)3
-rw-r--r--src/core/lib/security/credentials/jwt/json_token.cc (renamed from src/core/lib/security/credentials/jwt/json_token.c)9
-rw-r--r--src/core/lib/security/credentials/jwt/json_token.h8
-rw-r--r--src/core/lib/security/credentials/jwt/jwt_credentials.cc (renamed from src/core/lib/security/credentials/jwt/jwt_credentials.c)6
-rw-r--r--src/core/lib/security/credentials/jwt/jwt_credentials.h10
-rw-r--r--src/core/lib/security/credentials/jwt/jwt_verifier.cc (renamed from src/core/lib/security/credentials/jwt/jwt_verifier.c)31
-rw-r--r--src/core/lib/security/credentials/jwt/jwt_verifier.h8
-rw-r--r--src/core/lib/security/credentials/oauth2/oauth2_credentials.cc (renamed from src/core/lib/security/credentials/oauth2/oauth2_credentials.c)25
-rw-r--r--src/core/lib/security/credentials/oauth2/oauth2_credentials.h10
-rw-r--r--src/core/lib/security/credentials/plugin/plugin_credentials.cc (renamed from src/core/lib/security/credentials/plugin/plugin_credentials.c)3
-rw-r--r--src/core/lib/security/credentials/ssl/ssl_credentials.cc (renamed from src/core/lib/security/credentials/ssl/ssl_credentials.c)15
-rw-r--r--src/core/lib/security/transport/auth_filters.h8
-rw-r--r--src/core/lib/security/transport/client_auth_filter.cc (renamed from src/core/lib/security/transport/client_auth_filter.c)32
-rw-r--r--src/core/lib/security/transport/lb_targets_info.cc (renamed from src/core/lib/security/transport/lb_targets_info.c)13
-rw-r--r--src/core/lib/security/transport/lb_targets_info.h10
-rw-r--r--src/core/lib/security/transport/secure_endpoint.cc (renamed from src/core/lib/security/transport/secure_endpoint.c)0
-rw-r--r--src/core/lib/security/transport/secure_endpoint.h10
-rw-r--r--src/core/lib/security/transport/security_connector.cc (renamed from src/core/lib/security/transport/security_connector.c)37
-rw-r--r--src/core/lib/security/transport/security_connector.h8
-rw-r--r--src/core/lib/security/transport/security_handshaker.cc (renamed from src/core/lib/security/transport/security_handshaker.c)0
-rw-r--r--src/core/lib/security/transport/security_handshaker.h10
-rw-r--r--src/core/lib/security/transport/server_auth_filter.cc (renamed from src/core/lib/security/transport/server_auth_filter.c)30
-rw-r--r--src/core/lib/security/transport/tsi_error.cc (renamed from src/core/lib/security/transport/tsi_error.c)0
-rw-r--r--src/core/lib/security/transport/tsi_error.h10
-rw-r--r--src/core/lib/security/util/json_util.cc (renamed from src/core/lib/security/util/json_util.c)0
-rw-r--r--src/core/lib/security/util/json_util.h10
-rw-r--r--src/core/lib/slice/b64.cc (renamed from src/core/lib/slice/b64.c)0
-rw-r--r--src/core/lib/slice/b64.h10
-rw-r--r--src/core/lib/slice/percent_encoding.cc (renamed from src/core/lib/slice/percent_encoding.c)0
-rw-r--r--src/core/lib/slice/percent_encoding.h10
-rw-r--r--src/core/lib/slice/slice.cc (renamed from src/core/lib/slice/slice.c)0
-rw-r--r--src/core/lib/slice/slice_buffer.cc (renamed from src/core/lib/slice/slice_buffer.c)0
-rw-r--r--src/core/lib/slice/slice_hash_table.cc (renamed from src/core/lib/slice/slice_hash_table.c)0
-rw-r--r--src/core/lib/slice/slice_hash_table.h10
-rw-r--r--src/core/lib/slice/slice_intern.cc (renamed from src/core/lib/slice/slice_intern.c)1
-rw-r--r--src/core/lib/slice/slice_internal.h10
-rw-r--r--src/core/lib/slice/slice_string_helpers.cc (renamed from src/core/lib/slice/slice_string_helpers.c)0
-rw-r--r--src/core/lib/slice/slice_traits.h10
-rw-r--r--src/core/lib/support/alloc.cc (renamed from src/core/lib/support/alloc.c)0
-rw-r--r--src/core/lib/support/arena.cc (renamed from src/core/lib/support/arena.c)0
-rw-r--r--src/core/lib/support/arena.h8
-rw-r--r--src/core/lib/support/atm.cc (renamed from src/core/lib/support/atm.c)0
-rw-r--r--src/core/lib/support/avl.cc (renamed from src/core/lib/support/avl.c)0
-rw-r--r--src/core/lib/support/backoff.cc (renamed from src/core/lib/support/backoff.c)0
-rw-r--r--src/core/lib/support/backoff.h8
-rw-r--r--src/core/lib/support/cmdline.cc (renamed from src/core/lib/support/cmdline.c)0
-rw-r--r--src/core/lib/support/cpu_iphone.cc (renamed from src/core/lib/support/cpu_iphone.c)2
-rw-r--r--src/core/lib/support/cpu_linux.cc (renamed from src/core/lib/support/cpu_linux.c)0
-rw-r--r--src/core/lib/support/cpu_posix.cc (renamed from src/core/lib/support/cpu_posix.c)1
-rw-r--r--src/core/lib/support/cpu_windows.cc (renamed from src/core/lib/support/cpu_windows.c)1
-rw-r--r--src/core/lib/support/env_linux.cc (renamed from src/core/lib/support/env_linux.c)0
-rw-r--r--src/core/lib/support/env_posix.cc (renamed from src/core/lib/support/env_posix.c)0
-rw-r--r--src/core/lib/support/env_windows.cc (renamed from src/core/lib/support/env_windows.c)2
-rw-r--r--src/core/lib/support/histogram.cc (renamed from src/core/lib/support/histogram.c)0
-rw-r--r--src/core/lib/support/host_port.cc (renamed from src/core/lib/support/host_port.c)0
-rw-r--r--src/core/lib/support/log.cc (renamed from src/core/lib/support/log.c)2
-rw-r--r--src/core/lib/support/log_android.cc (renamed from src/core/lib/support/log_android.c)0
-rw-r--r--src/core/lib/support/log_linux.cc (renamed from src/core/lib/support/log_linux.c)2
-rw-r--r--src/core/lib/support/log_posix.cc (renamed from src/core/lib/support/log_posix.c)4
-rw-r--r--src/core/lib/support/log_windows.cc (renamed from src/core/lib/support/log_windows.c)6
-rw-r--r--src/core/lib/support/mpscq.cc (renamed from src/core/lib/support/mpscq.c)0
-rw-r--r--src/core/lib/support/mpscq.h8
-rw-r--r--src/core/lib/support/murmur_hash.cc (renamed from src/core/lib/support/murmur_hash.c)0
-rw-r--r--src/core/lib/support/murmur_hash.h8
-rw-r--r--src/core/lib/support/spinlock.h5
-rw-r--r--src/core/lib/support/stack_lockfree.cc (renamed from src/core/lib/support/stack_lockfree.c)0
-rw-r--r--src/core/lib/support/stack_lockfree.h8
-rw-r--r--src/core/lib/support/string.cc (renamed from src/core/lib/support/string.c)1
-rw-r--r--src/core/lib/support/string_posix.cc (renamed from src/core/lib/support/string_posix.c)1
-rw-r--r--src/core/lib/support/string_util_windows.cc (renamed from src/core/lib/support/string_util_windows.c)11
-rw-r--r--src/core/lib/support/string_windows.cc (renamed from src/core/lib/support/string_windows.c)3
-rw-r--r--src/core/lib/support/string_windows.h8
-rw-r--r--src/core/lib/support/subprocess_posix.cc (renamed from src/core/lib/support/subprocess_posix.c)0
-rw-r--r--src/core/lib/support/subprocess_windows.cc (renamed from src/core/lib/support/subprocess_windows.c)2
-rw-r--r--src/core/lib/support/sync.cc (renamed from src/core/lib/support/sync.c)0
-rw-r--r--src/core/lib/support/sync_posix.cc (renamed from src/core/lib/support/sync_posix.c)0
-rw-r--r--src/core/lib/support/sync_windows.cc (renamed from src/core/lib/support/sync_windows.c)2
-rw-r--r--src/core/lib/support/thd.cc (renamed from src/core/lib/support/thd.c)0
-rw-r--r--src/core/lib/support/thd_posix.cc (renamed from src/core/lib/support/thd_posix.c)0
-rw-r--r--src/core/lib/support/thd_windows.cc (renamed from src/core/lib/support/thd_windows.c)2
-rw-r--r--src/core/lib/support/time.cc (renamed from src/core/lib/support/time.c)0
-rw-r--r--src/core/lib/support/time_posix.cc (renamed from src/core/lib/support/time_posix.c)2
-rw-r--r--src/core/lib/support/time_precise.cc (renamed from src/core/lib/support/time_precise.c)2
-rw-r--r--src/core/lib/support/time_precise.h8
-rw-r--r--src/core/lib/support/time_windows.cc (renamed from src/core/lib/support/time_windows.c)2
-rw-r--r--src/core/lib/support/tls_pthread.cc (renamed from src/core/lib/support/tls_pthread.c)0
-rw-r--r--src/core/lib/support/tmpfile_msys.cc (renamed from src/core/lib/support/tmpfile_msys.c)0
-rw-r--r--src/core/lib/support/tmpfile_posix.cc (renamed from src/core/lib/support/tmpfile_posix.c)0
-rw-r--r--src/core/lib/support/tmpfile_windows.cc (renamed from src/core/lib/support/tmpfile_windows.c)0
-rw-r--r--src/core/lib/support/wrap_memcpy.cc (renamed from src/core/lib/support/wrap_memcpy.c)2
-rw-r--r--src/core/lib/surface/alarm.cc (renamed from src/core/lib/surface/alarm.c)4
-rw-r--r--src/core/lib/surface/alarm_internal.h8
-rw-r--r--src/core/lib/surface/api_trace.cc (renamed from src/core/lib/surface/api_trace.c)0
-rw-r--r--src/core/lib/surface/api_trace.h8
-rw-r--r--src/core/lib/surface/byte_buffer.cc (renamed from src/core/lib/surface/byte_buffer.c)0
-rw-r--r--src/core/lib/surface/byte_buffer_reader.cc (renamed from src/core/lib/surface/byte_buffer_reader.c)0
-rw-r--r--src/core/lib/surface/call.cc (renamed from src/core/lib/surface/call.c)33
-rw-r--r--src/core/lib/surface/call_details.cc (renamed from src/core/lib/surface/call_details.c)0
-rw-r--r--src/core/lib/surface/call_log_batch.cc (renamed from src/core/lib/surface/call_log_batch.c)2
-rw-r--r--src/core/lib/surface/channel.cc (renamed from src/core/lib/surface/channel.c)21
-rw-r--r--src/core/lib/surface/channel.h8
-rw-r--r--src/core/lib/surface/channel_init.cc (renamed from src/core/lib/surface/channel_init.c)0
-rw-r--r--src/core/lib/surface/channel_ping.cc (renamed from src/core/lib/surface/channel_ping.c)0
-rw-r--r--src/core/lib/surface/channel_stack_type.cc (renamed from src/core/lib/surface/channel_stack_type.c)0
-rw-r--r--src/core/lib/surface/channel_stack_type.h10
-rw-r--r--src/core/lib/surface/completion_queue.cc (renamed from src/core/lib/surface/completion_queue.c)61
-rw-r--r--src/core/lib/surface/completion_queue_factory.cc (renamed from src/core/lib/surface/completion_queue_factory.c)0
-rw-r--r--src/core/lib/surface/completion_queue_factory.h10
-rw-r--r--src/core/lib/surface/event_string.cc (renamed from src/core/lib/surface/event_string.c)0
-rw-r--r--src/core/lib/surface/event_string.h10
-rw-r--r--src/core/lib/surface/init.cc (renamed from src/core/lib/surface/init.c)0
-rw-r--r--src/core/lib/surface/init.h10
-rw-r--r--src/core/lib/surface/init_secure.cc (renamed from src/core/lib/surface/init_secure.c)0
-rw-r--r--src/core/lib/surface/init_unsecure.cc (renamed from src/core/lib/surface/init_unsecure.c)0
-rw-r--r--src/core/lib/surface/lame_client.h8
-rw-r--r--src/core/lib/surface/metadata_array.cc (renamed from src/core/lib/surface/metadata_array.c)0
-rw-r--r--src/core/lib/surface/server.cc (renamed from src/core/lib/surface/server.c)0
-rw-r--r--src/core/lib/surface/server.h10
-rw-r--r--src/core/lib/surface/validate_metadata.cc (renamed from src/core/lib/surface/validate_metadata.c)1
-rw-r--r--src/core/lib/surface/validate_metadata.h10
-rw-r--r--src/core/lib/surface/version.cc (renamed from src/core/lib/surface/version.c)0
-rw-r--r--src/core/lib/transport/bdp_estimator.cc (renamed from src/core/lib/transport/bdp_estimator.c)1
-rw-r--r--src/core/lib/transport/bdp_estimator.h10
-rw-r--r--src/core/lib/transport/byte_stream.cc (renamed from src/core/lib/transport/byte_stream.c)0
-rw-r--r--src/core/lib/transport/byte_stream.h10
-rw-r--r--src/core/lib/transport/connectivity_state.cc (renamed from src/core/lib/transport/connectivity_state.c)0
-rw-r--r--src/core/lib/transport/connectivity_state.h10
-rw-r--r--src/core/lib/transport/error_utils.cc (renamed from src/core/lib/transport/error_utils.c)0
-rw-r--r--src/core/lib/transport/error_utils.h10
-rw-r--r--src/core/lib/transport/metadata.cc (renamed from src/core/lib/transport/metadata.c)1
-rw-r--r--src/core/lib/transport/metadata.h5
-rw-r--r--src/core/lib/transport/metadata_batch.cc (renamed from src/core/lib/transport/metadata_batch.c)0
-rw-r--r--src/core/lib/transport/metadata_batch.h7
-rw-r--r--src/core/lib/transport/pid_controller.cc (renamed from src/core/lib/transport/pid_controller.c)0
-rw-r--r--src/core/lib/transport/pid_controller.h10
-rw-r--r--src/core/lib/transport/service_config.cc (renamed from src/core/lib/transport/service_config.c)0
-rw-r--r--src/core/lib/transport/service_config.h10
-rw-r--r--src/core/lib/transport/static_metadata.cc (renamed from src/core/lib/transport/static_metadata.c)0
-rw-r--r--src/core/lib/transport/static_metadata.h7
-rw-r--r--src/core/lib/transport/status_conversion.cc (renamed from src/core/lib/transport/status_conversion.c)0
-rw-r--r--src/core/lib/transport/status_conversion.h10
-rw-r--r--src/core/lib/transport/timeout_encoding.cc (renamed from src/core/lib/transport/timeout_encoding.c)0
-rw-r--r--src/core/lib/transport/timeout_encoding.h10
-rw-r--r--src/core/lib/transport/transport.cc (renamed from src/core/lib/transport/transport.c)9
-rw-r--r--src/core/lib/transport/transport_impl.h10
-rw-r--r--src/core/lib/transport/transport_op_string.cc (renamed from src/core/lib/transport/transport_op_string.c)3
-rw-r--r--src/core/plugin_registry/grpc_cronet_plugin_registry.cc (renamed from src/core/plugin_registry/grpc_cronet_plugin_registry.c)24
-rw-r--r--src/core/plugin_registry/grpc_plugin_registry.cc (renamed from src/core/plugin_registry/grpc_plugin_registry.c)72
-rw-r--r--src/core/plugin_registry/grpc_unsecure_plugin_registry.cc (renamed from src/core/plugin_registry/grpc_unsecure_plugin_registry.c)68
-rw-r--r--src/core/tsi/fake_transport_security.cc (renamed from src/core/tsi/fake_transport_security.c)37
-rw-r--r--src/core/tsi/gts_transport_security.cc (renamed from src/core/tsi/gts_transport_security.c)4
-rw-r--r--src/core/tsi/gts_transport_security.h10
-rw-r--r--src/core/tsi/ssl_transport_security.cc (renamed from src/core/tsi/ssl_transport_security.c)40
-rw-r--r--src/core/tsi/ssl_types.h8
-rw-r--r--src/core/tsi/transport_security.cc (renamed from src/core/tsi/transport_security.c)5
-rw-r--r--src/core/tsi/transport_security_adapter.cc (renamed from src/core/tsi/transport_security_adapter.c)14
-rw-r--r--src/core/tsi/transport_security_grpc.cc (renamed from src/core/tsi/transport_security_grpc.c)0
-rw-r--r--src/python/grpcio/grpc_core_dependencies.py600
503 files changed, 2616 insertions, 997 deletions
diff --git a/src/core/ext/census/base_resources.c b/src/core/ext/census/base_resources.cc
index 1f2bb39fe0..3697c6f0e0 100644
--- a/src/core/ext/census/base_resources.c
+++ b/src/core/ext/census/base_resources.cc
@@ -45,12 +45,12 @@ void define_base_resources() {
0, // n_denominators
NULL}; // denominators
define_resource(&r);
- r = (resource){(char *)"server_rpc_latency", // name
- (char *)"Server RPC latency in seconds", // description
- 0, // prefix
- 1, // n_numerators
- &numerator, // numerators
- 0, // n_denominators
- NULL}; // denominators
+ r = {(char *)"server_rpc_latency", // name
+ (char *)"Server RPC latency in seconds", // description
+ 0, // prefix
+ 1, // n_numerators
+ &numerator, // numerators
+ 0, // n_denominators
+ NULL}; // denominators
define_resource(&r);
}
diff --git a/src/core/ext/census/base_resources.h b/src/core/ext/census/base_resources.h
index 78a4d1fae5..4b1b988e3f 100644
--- a/src/core/ext/census/base_resources.h
+++ b/src/core/ext/census/base_resources.h
@@ -18,7 +18,15 @@
#ifndef GRPC_CORE_EXT_CENSUS_BASE_RESOURCES_H
#define GRPC_CORE_EXT_CENSUS_BASE_RESOURCES_H
+#ifdef __cplusplus
+extern "C" {
+#endif
+
/* Define all base resources. This should be called by census initialization. */
void define_base_resources();
-#endif /* GRPC_CORE_EXT_CENSUS_BASE_RESOURCES_H */
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* GRPC_CORE_EXT_CENSUS_BASE_RESOURCES_H */ \ No newline at end of file
diff --git a/src/core/ext/census/census_init.c b/src/core/ext/census/census_init.cc
index d7f719ff8c..d7f719ff8c 100644
--- a/src/core/ext/census/census_init.c
+++ b/src/core/ext/census/census_init.cc
diff --git a/src/core/ext/census/census_interface.h b/src/core/ext/census/census_interface.h
index a42b68ad65..12438e3c0a 100644
--- a/src/core/ext/census/census_interface.h
+++ b/src/core/ext/census/census_interface.h
@@ -24,6 +24,10 @@
/* Maximum length of an individual census trace annotation. */
#define CENSUS_MAX_ANNOTATION_LENGTH 200
+#ifdef __cplusplus
+extern "C" {
+#endif
+
/* Structure of a census op id. Define as structure because 64bit integer is not
available on every platform for C89. */
typedef struct census_op_id {
@@ -58,4 +62,8 @@ census_op_id census_tracing_start_op(void);
/* Ends tracing. Calling this function will invalidate the input op_id. */
void census_tracing_end_op(census_op_id op_id);
-#endif /* GRPC_CORE_EXT_CENSUS_CENSUS_INTERFACE_H */
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* GRPC_CORE_EXT_CENSUS_CENSUS_INTERFACE_H */ \ No newline at end of file
diff --git a/src/core/ext/census/census_log.c b/src/core/ext/census/census_log.cc
index 100047f12b..100047f12b 100644
--- a/src/core/ext/census/census_log.c
+++ b/src/core/ext/census/census_log.cc
diff --git a/src/core/ext/census/census_log.h b/src/core/ext/census/census_log.h
index 6b68b6bd37..cc9e008907 100644
--- a/src/core/ext/census/census_log.h
+++ b/src/core/ext/census/census_log.h
@@ -25,6 +25,10 @@
#define CENSUS_LOG_2_MAX_RECORD_SIZE 14 /* 2^14 = 16KB */
#define CENSUS_LOG_MAX_RECORD_SIZE (1 << CENSUS_LOG_2_MAX_RECORD_SIZE)
+#ifdef __cplusplus
+extern "C" {
+#endif
+
/* Initialize the statistics logging subsystem with the given log size. A log
size of 0 will result in the smallest possible log for the platform
(approximately CENSUS_LOG_MAX_RECORD_SIZE * gpr_cpu_num_cores()). If
@@ -73,4 +77,8 @@ size_t census_log_remaining_space(void);
out-of-space. */
int census_log_out_of_space_count(void);
-#endif /* GRPC_CORE_EXT_CENSUS_CENSUS_LOG_H */
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* GRPC_CORE_EXT_CENSUS_CENSUS_LOG_H */ \ No newline at end of file
diff --git a/src/core/ext/census/census_rpc_stats.c b/src/core/ext/census/census_rpc_stats.cc
index 0aca1f109e..0aca1f109e 100644
--- a/src/core/ext/census/census_rpc_stats.c
+++ b/src/core/ext/census/census_rpc_stats.cc
diff --git a/src/core/ext/census/census_tracing.c b/src/core/ext/census/census_tracing.cc
index 199b260dd1..199b260dd1 100644
--- a/src/core/ext/census/census_tracing.c
+++ b/src/core/ext/census/census_tracing.cc
diff --git a/src/core/ext/census/context.c b/src/core/ext/census/context.cc
index 9b25a32e36..9b25a32e36 100644
--- a/src/core/ext/census/context.c
+++ b/src/core/ext/census/context.cc
diff --git a/src/core/ext/census/grpc_context.c b/src/core/ext/census/grpc_context.cc
index 0bfba63a5e..0bfba63a5e 100644
--- a/src/core/ext/census/grpc_context.c
+++ b/src/core/ext/census/grpc_context.cc
diff --git a/src/core/ext/census/grpc_filter.c b/src/core/ext/census/grpc_filter.cc
index b37ab90389..b37ab90389 100644
--- a/src/core/ext/census/grpc_filter.c
+++ b/src/core/ext/census/grpc_filter.cc
diff --git a/src/core/ext/census/grpc_filter.h b/src/core/ext/census/grpc_filter.h
index baa7bb931a..7940363061 100644
--- a/src/core/ext/census/grpc_filter.h
+++ b/src/core/ext/census/grpc_filter.h
@@ -21,9 +21,17 @@
#include "src/core/lib/channel/channel_stack.h"
+#ifdef __cplusplus
+extern "C" {
+#endif
+
/* Census filters: provides tracing and stats collection functionalities. It
needs to reside right below the surface filter in the channel stack. */
extern const grpc_channel_filter grpc_client_census_filter;
extern const grpc_channel_filter grpc_server_census_filter;
+#ifdef __cplusplus
+}
+#endif
+
#endif /* GRPC_CORE_EXT_CENSUS_GRPC_FILTER_H */
diff --git a/src/core/ext/census/grpc_plugin.c b/src/core/ext/census/grpc_plugin.cc
index c0efe5afb8..22b16c6c63 100644
--- a/src/core/ext/census/grpc_plugin.c
+++ b/src/core/ext/census/grpc_plugin.cc
@@ -50,7 +50,7 @@ static bool maybe_add_census_filter(grpc_exec_ctx *exec_ctx,
return true;
}
-void census_grpc_plugin_init(void) {
+extern "C" void census_grpc_plugin_init(void) {
/* Only initialize census if no one else has and some features are
* available. */
if (census_enabled() == CENSUS_FEATURE_NONE &&
@@ -67,4 +67,4 @@ void census_grpc_plugin_init(void) {
(void *)&grpc_server_census_filter);
}
-void census_grpc_plugin_shutdown(void) { census_shutdown(); }
+extern "C" void census_grpc_plugin_shutdown(void) { census_shutdown(); }
diff --git a/src/core/ext/census/hash_table.c b/src/core/ext/census/hash_table.cc
index 545b0857c7..545b0857c7 100644
--- a/src/core/ext/census/hash_table.c
+++ b/src/core/ext/census/hash_table.cc
diff --git a/src/core/ext/census/hash_table.h b/src/core/ext/census/hash_table.h
index 75770641c5..c22ba8df9d 100644
--- a/src/core/ext/census/hash_table.h
+++ b/src/core/ext/census/hash_table.h
@@ -23,6 +23,10 @@
#include <grpc/support/port_platform.h>
+#ifdef __cplusplus
+extern "C" {
+#endif
+
/* A chain based hash table with fixed number of buckets.
Your probably shouldn't use this code directly. It is implemented for the
use case in census trace store and stats store, where number of entries in
@@ -113,4 +117,8 @@ typedef void (*census_ht_itr_cb)(census_ht_key key, const void *val_ptr,
should not invalidate data entries. */
uint64_t census_ht_for_all(const census_ht *ht, census_ht_itr_cb);
-#endif /* GRPC_CORE_EXT_CENSUS_HASH_TABLE_H */
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* GRPC_CORE_EXT_CENSUS_HASH_TABLE_H */ \ No newline at end of file
diff --git a/src/core/ext/census/initialize.c b/src/core/ext/census/initialize.cc
index 165a1221d4..165a1221d4 100644
--- a/src/core/ext/census/initialize.c
+++ b/src/core/ext/census/initialize.cc
diff --git a/src/core/ext/census/intrusive_hash_map.c b/src/core/ext/census/intrusive_hash_map.cc
index 7930486963..7930486963 100644
--- a/src/core/ext/census/intrusive_hash_map.c
+++ b/src/core/ext/census/intrusive_hash_map.cc
diff --git a/src/core/ext/census/intrusive_hash_map.h b/src/core/ext/census/intrusive_hash_map.h
index f50de4fab4..2c7baa31fb 100644
--- a/src/core/ext/census/intrusive_hash_map.h
+++ b/src/core/ext/census/intrusive_hash_map.h
@@ -21,6 +21,10 @@
#include "src/core/ext/census/intrusive_hash_map_internal.h"
+#ifdef __cplusplus
+extern "C" {
+#endif
+
/* intrusive_hash_map is a fast chained hash table. This hash map is faster than
* a dense hash map when the application calls insert and erase more often than
* find. When the workload is dominated by find() a dense hash map may be
@@ -149,4 +153,8 @@ void intrusive_hash_map_clear(intrusive_hash_map *hash_map,
void intrusive_hash_map_free(intrusive_hash_map *hash_map,
void (*free_object)(void *));
+#ifdef __cplusplus
+}
+#endif
+
#endif /* GRPC_CORE_EXT_CENSUS_INTRUSIVE_HASH_MAP_H */
diff --git a/src/core/ext/census/mlog.c b/src/core/ext/census/mlog.cc
index 4b8c8466b3..4b8c8466b3 100644
--- a/src/core/ext/census/mlog.c
+++ b/src/core/ext/census/mlog.cc
diff --git a/src/core/ext/census/mlog.h b/src/core/ext/census/mlog.h
index 6f3125944f..7b4d39272b 100644
--- a/src/core/ext/census/mlog.h
+++ b/src/core/ext/census/mlog.h
@@ -28,6 +28,10 @@
#define CENSUS_LOG_2_MAX_RECORD_SIZE 14 /* 2^14 = 16KB */
#define CENSUS_LOG_MAX_RECORD_SIZE (1 << CENSUS_LOG_2_MAX_RECORD_SIZE)
+#ifdef __cplusplus
+extern "C" {
+#endif
+
/* Initialize the statistics logging subsystem with the given log size. A log
size of 0 will result in the smallest possible log for the platform
(approximately CENSUS_LOG_MAX_RECORD_SIZE * gpr_cpu_num_cores()). If
@@ -77,4 +81,8 @@ size_t census_log_remaining_space(void);
out-of-space. */
int64_t census_log_out_of_space_count(void);
-#endif /* GRPC_CORE_EXT_CENSUS_MLOG_H */
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* GRPC_CORE_EXT_CENSUS_MLOG_H */ \ No newline at end of file
diff --git a/src/core/ext/census/operation.c b/src/core/ext/census/operation.cc
index be88ac74e6..be88ac74e6 100644
--- a/src/core/ext/census/operation.c
+++ b/src/core/ext/census/operation.cc
diff --git a/src/core/ext/census/placeholders.c b/src/core/ext/census/placeholders.cc
index bed9837ee3..bed9837ee3 100644
--- a/src/core/ext/census/placeholders.c
+++ b/src/core/ext/census/placeholders.cc
diff --git a/src/core/ext/census/resource.c b/src/core/ext/census/resource.cc
index 44a887231c..44a887231c 100644
--- a/src/core/ext/census/resource.c
+++ b/src/core/ext/census/resource.cc
diff --git a/src/core/ext/census/resource.h b/src/core/ext/census/resource.h
index b8bda2c72e..5f7ac2ad27 100644
--- a/src/core/ext/census/resource.h
+++ b/src/core/ext/census/resource.h
@@ -23,6 +23,10 @@
#include <grpc/grpc.h>
#include "src/core/ext/census/gen/census.pb.h"
+#ifdef __cplusplus
+extern "C" {
+#endif
+
/* Internal representation of a resource. */
typedef struct {
char *name;
@@ -45,4 +49,8 @@ void shutdown_resources(void);
from configuration files. */
int32_t define_resource(const resource *base);
-#endif /* GRPC_CORE_EXT_CENSUS_RESOURCE_H */
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* GRPC_CORE_EXT_CENSUS_RESOURCE_H */ \ No newline at end of file
diff --git a/src/core/ext/census/trace_context.c b/src/core/ext/census/trace_context.cc
index af92ae6d9e..af92ae6d9e 100644
--- a/src/core/ext/census/trace_context.c
+++ b/src/core/ext/census/trace_context.cc
diff --git a/src/core/ext/census/trace_context.h b/src/core/ext/census/trace_context.h
index a7233e6a2b..c707c63263 100644
--- a/src/core/ext/census/trace_context.h
+++ b/src/core/ext/census/trace_context.h
@@ -39,6 +39,10 @@
1 byte for is_sampled (bool) */
#define TRACE_MAX_CONTEXT_SIZE 31
+#ifdef __cplusplus
+extern "C" {
+#endif
+
/* Encode a trace context (ctxt) into proto format to the buffer provided. The
size of buffer must be at least TRACE_MAX_CONTEXT_SIZE. On success, returns the
number of bytes successfully encoded into buffer. On failure, returns 0. */
@@ -53,4 +57,8 @@ of these do not exist. On success, returns true and false otherwise. */
bool decode_trace_context(google_trace_TraceContext *ctxt, uint8_t *buffer,
const size_t nbytes);
-#endif /* GRPC_CORE_EXT_CENSUS_TRACE_CONTEXT_H */
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* GRPC_CORE_EXT_CENSUS_TRACE_CONTEXT_H */ \ No newline at end of file
diff --git a/src/core/ext/census/trace_propagation.h b/src/core/ext/census/trace_propagation.h
index eecfcb7d01..3394e9e0fd 100644
--- a/src/core/ext/census/trace_propagation.h
+++ b/src/core/ext/census/trace_propagation.h
@@ -21,6 +21,10 @@
#include "src/core/ext/census/tracing.h"
+#ifdef __cplusplus
+extern "C" {
+#endif
+
/* Encoding and decoding functions for receiving and sending trace contexts
over the wire. Only RPC libraries should be calling these
functions. These functions return the number of bytes encoded/decoded
@@ -45,4 +49,8 @@ size_t trace_span_context_to_http_format(const trace_span_context *ctxt,
size_t http_format_to_trace_span_context(const char *buf, size_t buf_size,
trace_span_context *ctxt);
-#endif /* GRPC_CORE_EXT_CENSUS_TRACE_PROPAGATION_H */
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* GRPC_CORE_EXT_CENSUS_TRACE_PROPAGATION_H */ \ No newline at end of file
diff --git a/src/core/ext/census/tracing.c b/src/core/ext/census/tracing.cc
index 823c681abf..823c681abf 100644
--- a/src/core/ext/census/tracing.c
+++ b/src/core/ext/census/tracing.cc
diff --git a/src/core/ext/census/tracing.h b/src/core/ext/census/tracing.h
index 038c9e2790..5fcbb1e1f7 100644
--- a/src/core/ext/census/tracing.h
+++ b/src/core/ext/census/tracing.h
@@ -25,6 +25,10 @@
#include "src/core/ext/census/trace_label.h"
#include "src/core/ext/census/trace_status.h"
+#ifdef __cplusplus
+extern "C" {
+#endif
+
/* This is the low level tracing API that other languages will interface with.
This is not intended to be accessed by the end-user, therefore it has been
designed with performance in mind rather than ease of use. */
@@ -106,4 +110,8 @@ free to ignore all further calls using the Span. EndSpanOptions can
optionally be NULL. */
void trace_end_span(const trace_status *status, trace_span_context *span_ctxt);
-#endif /* GRPC_CORE_EXT_CENSUS_TRACING_H */
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* GRPC_CORE_EXT_CENSUS_TRACING_H */ \ No newline at end of file
diff --git a/src/core/ext/census/window_stats.c b/src/core/ext/census/window_stats.cc
index 0058e4bf9c..0058e4bf9c 100644
--- a/src/core/ext/census/window_stats.c
+++ b/src/core/ext/census/window_stats.cc
diff --git a/src/core/ext/census/window_stats.h b/src/core/ext/census/window_stats.h
index ebe3732008..3b1d197f76 100644
--- a/src/core/ext/census/window_stats.h
+++ b/src/core/ext/census/window_stats.h
@@ -21,6 +21,10 @@
#include <grpc/support/time.h>
+#ifdef __cplusplus
+extern "C" {
+#endif
+
/* Keep rolling sums of a user-defined statistic (containing a number of
measurements) over a a number of time intervals ("windows"). For example,
you can use a window_stats object to answer questions such as
@@ -155,4 +159,8 @@ void census_window_stats_get_sums(const struct census_window_stats *wstats,
assertion failure). This function is thread-compatible. */
void census_window_stats_destroy(struct census_window_stats *wstats);
-#endif /* GRPC_CORE_EXT_CENSUS_WINDOW_STATS_H */
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* GRPC_CORE_EXT_CENSUS_WINDOW_STATS_H */ \ No newline at end of file
diff --git a/src/core/ext/filters/client_channel/channel_connectivity.c b/src/core/ext/filters/client_channel/channel_connectivity.cc
index 3844b98021..a05a11dad1 100644
--- a/src/core/ext/filters/client_channel/channel_connectivity.c
+++ b/src/core/ext/filters/client_channel/channel_connectivity.cc
@@ -18,6 +18,8 @@
#include "src/core/lib/surface/channel.h"
+#include <inttypes.h>
+
#include <grpc/support/alloc.h>
#include <grpc/support/log.h>
diff --git a/src/core/ext/filters/client_channel/client_channel.c b/src/core/ext/filters/client_channel/client_channel.cc
index 016199b1f4..8bff7548ac 100644
--- a/src/core/ext/filters/client_channel/client_channel.c
+++ b/src/core/ext/filters/client_channel/client_channel.cc
@@ -16,8 +16,11 @@
*
*/
+#include <grpc/support/port_platform.h>
+
#include "src/core/ext/filters/client_channel/client_channel.h"
+#include <inttypes.h>
#include <stdbool.h>
#include <stdio.h>
#include <string.h>
@@ -995,13 +998,14 @@ static void create_subchannel_call_locked(grpc_exec_ctx *exec_ctx,
channel_data *chand = (channel_data *)elem->channel_data;
call_data *calld = (call_data *)elem->call_data;
const grpc_connected_subchannel_call_args call_args = {
- .pollent = calld->pollent,
- .path = calld->path,
- .start_time = calld->call_start_time,
- .deadline = calld->deadline,
- .arena = calld->arena,
- .context = calld->subchannel_call_context,
- .call_combiner = calld->call_combiner};
+ calld->pollent, // pollent
+ calld->path, // path
+ calld->call_start_time, // start_time
+ calld->deadline, // deadline
+ calld->arena, // arena
+ calld->subchannel_call_context, // context
+ calld->call_combiner // call_combiner
+ };
grpc_error *new_error = grpc_connected_subchannel_create_call(
exec_ctx, calld->connected_subchannel, &call_args,
&calld->subchannel_call);
diff --git a/src/core/ext/filters/client_channel/client_channel.h b/src/core/ext/filters/client_channel/client_channel.h
index c99f0092e9..b32f378c6c 100644
--- a/src/core/ext/filters/client_channel/client_channel.h
+++ b/src/core/ext/filters/client_channel/client_channel.h
@@ -28,6 +28,10 @@ extern grpc_tracer_flag grpc_client_channel_trace;
// Channel arg key for server URI string.
#define GRPC_ARG_SERVER_URI "grpc.server_uri"
+#ifdef __cplusplus
+extern "C" {
+#endif
+
/* A client channel is a channel that begins disconnected, and can connect
to some endpoint on demand. If that endpoint disconnects, it will be
connected to again later.
@@ -52,4 +56,8 @@ void grpc_client_channel_watch_connectivity_state(
grpc_subchannel_call *grpc_client_channel_get_subchannel_call(
grpc_call_element *elem);
-#endif /* GRPC_CORE_EXT_FILTERS_CLIENT_CHANNEL_CLIENT_CHANNEL_H */
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* GRPC_CORE_EXT_FILTERS_CLIENT_CHANNEL_CLIENT_CHANNEL_H */ \ No newline at end of file
diff --git a/src/core/ext/filters/client_channel/client_channel_factory.c b/src/core/ext/filters/client_channel/client_channel_factory.cc
index 57eac8f875..57eac8f875 100644
--- a/src/core/ext/filters/client_channel/client_channel_factory.c
+++ b/src/core/ext/filters/client_channel/client_channel_factory.cc
diff --git a/src/core/ext/filters/client_channel/client_channel_factory.h b/src/core/ext/filters/client_channel/client_channel_factory.h
index ce6266c769..bad8b97042 100644
--- a/src/core/ext/filters/client_channel/client_channel_factory.h
+++ b/src/core/ext/filters/client_channel/client_channel_factory.h
@@ -27,6 +27,10 @@
// Channel arg key for client channel factory.
#define GRPC_ARG_CLIENT_CHANNEL_FACTORY "grpc.client_channel_factory"
+#ifdef __cplusplus
+extern "C" {
+#endif
+
typedef struct grpc_client_channel_factory grpc_client_channel_factory;
typedef struct grpc_client_channel_factory_vtable
grpc_client_channel_factory_vtable;
@@ -74,4 +78,8 @@ grpc_channel *grpc_client_channel_factory_create_channel(
grpc_arg grpc_client_channel_factory_create_channel_arg(
grpc_client_channel_factory *factory);
-#endif /* GRPC_CORE_EXT_FILTERS_CLIENT_CHANNEL_CLIENT_CHANNEL_FACTORY_H */
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* GRPC_CORE_EXT_FILTERS_CLIENT_CHANNEL_CLIENT_CHANNEL_FACTORY_H */ \ No newline at end of file
diff --git a/src/core/ext/filters/client_channel/client_channel_plugin.c b/src/core/ext/filters/client_channel/client_channel_plugin.cc
index 1f71c5a7f9..4431d11519 100644
--- a/src/core/ext/filters/client_channel/client_channel_plugin.c
+++ b/src/core/ext/filters/client_channel/client_channel_plugin.cc
@@ -65,7 +65,7 @@ static bool set_default_host_if_unset(grpc_exec_ctx *exec_ctx,
return true;
}
-void grpc_client_channel_init(void) {
+extern "C" void grpc_client_channel_init(void) {
grpc_lb_policy_registry_init();
grpc_resolver_registry_init();
grpc_retry_throttle_map_init();
@@ -84,7 +84,7 @@ void grpc_client_channel_init(void) {
#endif
}
-void grpc_client_channel_shutdown(void) {
+extern "C" void grpc_client_channel_shutdown(void) {
grpc_subchannel_index_shutdown();
grpc_channel_init_shutdown();
grpc_proxy_mapper_registry_shutdown();
diff --git a/src/core/ext/filters/client_channel/connector.c b/src/core/ext/filters/client_channel/connector.cc
index c258468e58..c258468e58 100644
--- a/src/core/ext/filters/client_channel/connector.c
+++ b/src/core/ext/filters/client_channel/connector.cc
diff --git a/src/core/ext/filters/client_channel/connector.h b/src/core/ext/filters/client_channel/connector.h
index 7f3d4a1cc0..79ccb0d9bf 100644
--- a/src/core/ext/filters/client_channel/connector.h
+++ b/src/core/ext/filters/client_channel/connector.h
@@ -23,6 +23,10 @@
#include "src/core/lib/iomgr/resolve_address.h"
#include "src/core/lib/transport/transport.h"
+#ifdef __cplusplus
+extern "C" {
+#endif
+
typedef struct grpc_connector grpc_connector;
typedef struct grpc_connector_vtable grpc_connector_vtable;
@@ -70,4 +74,8 @@ void grpc_connector_connect(grpc_exec_ctx *exec_ctx, grpc_connector *connector,
void grpc_connector_shutdown(grpc_exec_ctx *exec_ctx, grpc_connector *connector,
grpc_error *why);
-#endif /* GRPC_CORE_EXT_FILTERS_CLIENT_CHANNEL_CONNECTOR_H */
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* GRPC_CORE_EXT_FILTERS_CLIENT_CHANNEL_CONNECTOR_H */ \ No newline at end of file
diff --git a/src/core/ext/filters/client_channel/http_connect_handshaker.c b/src/core/ext/filters/client_channel/http_connect_handshaker.cc
index 418bb41ef6..418bb41ef6 100644
--- a/src/core/ext/filters/client_channel/http_connect_handshaker.c
+++ b/src/core/ext/filters/client_channel/http_connect_handshaker.cc
diff --git a/src/core/ext/filters/client_channel/http_connect_handshaker.h b/src/core/ext/filters/client_channel/http_connect_handshaker.h
index 928a23dc93..5042c61bec 100644
--- a/src/core/ext/filters/client_channel/http_connect_handshaker.h
+++ b/src/core/ext/filters/client_channel/http_connect_handshaker.h
@@ -28,7 +28,15 @@
/// seperated by colons.
#define GRPC_ARG_HTTP_CONNECT_HEADERS "grpc.http_connect_headers"
+#ifdef __cplusplus
+extern "C" {
+#endif
+
/// Registers handshaker factory.
void grpc_http_connect_register_handshaker_factory();
-#endif /* GRPC_CORE_EXT_FILTERS_CLIENT_CHANNEL_HTTP_CONNECT_HANDSHAKER_H */
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* GRPC_CORE_EXT_FILTERS_CLIENT_CHANNEL_HTTP_CONNECT_HANDSHAKER_H */ \ No newline at end of file
diff --git a/src/core/ext/filters/client_channel/http_proxy.c b/src/core/ext/filters/client_channel/http_proxy.cc
index a16b44d3dc..a16b44d3dc 100644
--- a/src/core/ext/filters/client_channel/http_proxy.c
+++ b/src/core/ext/filters/client_channel/http_proxy.cc
diff --git a/src/core/ext/filters/client_channel/http_proxy.h b/src/core/ext/filters/client_channel/http_proxy.h
index 34694931d0..65d52334af 100644
--- a/src/core/ext/filters/client_channel/http_proxy.h
+++ b/src/core/ext/filters/client_channel/http_proxy.h
@@ -19,6 +19,14 @@
#ifndef GRPC_CORE_EXT_FILTERS_CLIENT_CHANNEL_HTTP_PROXY_H
#define GRPC_CORE_EXT_FILTERS_CLIENT_CHANNEL_HTTP_PROXY_H
+#ifdef __cplusplus
+extern "C" {
+#endif
+
void grpc_register_http_proxy_mapper();
-#endif /* GRPC_CORE_EXT_FILTERS_CLIENT_CHANNEL_HTTP_PROXY_H */
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* GRPC_CORE_EXT_FILTERS_CLIENT_CHANNEL_HTTP_PROXY_H */ \ No newline at end of file
diff --git a/src/core/ext/filters/client_channel/lb_policy.c b/src/core/ext/filters/client_channel/lb_policy.cc
index 8e6673d737..8e6673d737 100644
--- a/src/core/ext/filters/client_channel/lb_policy.c
+++ b/src/core/ext/filters/client_channel/lb_policy.cc
diff --git a/src/core/ext/filters/client_channel/lb_policy.h b/src/core/ext/filters/client_channel/lb_policy.h
index 645d51e138..010299c2f4 100644
--- a/src/core/ext/filters/client_channel/lb_policy.h
+++ b/src/core/ext/filters/client_channel/lb_policy.h
@@ -23,6 +23,10 @@
#include "src/core/lib/iomgr/polling_entity.h"
#include "src/core/lib/transport/connectivity_state.h"
+#ifdef __cplusplus
+extern "C" {
+#endif
+
/** A load balancing policy: specified by a vtable and a struct (which
is expected to be extended to contain some parameters) */
typedef struct grpc_lb_policy grpc_lb_policy;
@@ -204,4 +208,8 @@ void grpc_lb_policy_update_locked(grpc_exec_ctx *exec_ctx,
grpc_lb_policy *policy,
const grpc_lb_policy_args *lb_policy_args);
+#ifdef __cplusplus
+}
+#endif
+
#endif /* GRPC_CORE_EXT_FILTERS_CLIENT_CHANNEL_LB_POLICY_H */
diff --git a/src/core/ext/filters/client_channel/lb_policy/grpclb/client_load_reporting_filter.c b/src/core/ext/filters/client_channel/lb_policy/grpclb/client_load_reporting_filter.cc
index 7ad322902b..7ad322902b 100644
--- a/src/core/ext/filters/client_channel/lb_policy/grpclb/client_load_reporting_filter.c
+++ b/src/core/ext/filters/client_channel/lb_policy/grpclb/client_load_reporting_filter.cc
diff --git a/src/core/ext/filters/client_channel/lb_policy/grpclb/client_load_reporting_filter.h b/src/core/ext/filters/client_channel/lb_policy/grpclb/client_load_reporting_filter.h
index 51e30b20b8..c6a0d69c3f 100644
--- a/src/core/ext/filters/client_channel/lb_policy/grpclb/client_load_reporting_filter.h
+++ b/src/core/ext/filters/client_channel/lb_policy/grpclb/client_load_reporting_filter.h
@@ -21,7 +21,15 @@
#include "src/core/lib/channel/channel_stack.h"
+#ifdef __cplusplus
+extern "C" {
+#endif
+
extern const grpc_channel_filter grpc_client_load_reporting_filter;
+#ifdef __cplusplus
+}
+#endif
+
#endif /* GRPC_CORE_EXT_FILTERS_CLIENT_CHANNEL_LB_POLICY_GRPCLB_CLIENT_LOAD_REPORTING_FILTER_H \
*/
diff --git a/src/core/ext/filters/client_channel/lb_policy/grpclb/grpclb.c b/src/core/ext/filters/client_channel/lb_policy/grpclb/grpclb.cc
index 8dc81b46d1..d8e314d1f9 100644
--- a/src/core/ext/filters/client_channel/lb_policy/grpclb/grpclb.c
+++ b/src/core/ext/filters/client_channel/lb_policy/grpclb/grpclb.cc
@@ -80,6 +80,7 @@
headers. Therefore, sockaddr.h must always be included first */
#include "src/core/lib/iomgr/sockaddr.h"
+#include <inttypes.h>
#include <limits.h>
#include <string.h>
@@ -456,11 +457,11 @@ static bool is_server_valid(const grpc_grpclb_server *server, size_t idx,
static void *lb_token_copy(void *token) {
return token == NULL
? NULL
- : (void *)GRPC_MDELEM_REF((grpc_mdelem){(uintptr_t)token}).payload;
+ : (void *)GRPC_MDELEM_REF(grpc_mdelem{(uintptr_t)token}).payload;
}
static void lb_token_destroy(grpc_exec_ctx *exec_ctx, void *token) {
if (token != NULL) {
- GRPC_MDELEM_UNREF(exec_ctx, (grpc_mdelem){(uintptr_t)token});
+ GRPC_MDELEM_UNREF(exec_ctx, grpc_mdelem{(uintptr_t)token});
}
}
static int lb_token_cmp(void *token1, void *token2) {
@@ -1925,12 +1926,11 @@ static grpc_lb_policy *glb_create(grpc_exec_ctx *exec_ctx,
arg = grpc_channel_args_find(args->args, GRPC_ARG_GRPCLB_CALL_TIMEOUT_MS);
glb_policy->lb_call_timeout_ms =
- grpc_channel_arg_get_integer(arg, (grpc_integer_options){0, 0, INT_MAX});
+ grpc_channel_arg_get_integer(arg, {0, 0, INT_MAX});
arg = grpc_channel_args_find(args->args, GRPC_ARG_GRPCLB_FALLBACK_TIMEOUT_MS);
glb_policy->lb_fallback_timeout_ms = grpc_channel_arg_get_integer(
- arg, (grpc_integer_options){GRPC_GRPCLB_DEFAULT_FALLBACK_TIMEOUT_MS, 0,
- INT_MAX});
+ arg, {GRPC_GRPCLB_DEFAULT_FALLBACK_TIMEOUT_MS, 0, INT_MAX});
// Make sure that GRPC_ARG_LB_POLICY_NAME is set in channel args,
// since we use this to trigger the client_load_reporting filter.
@@ -2006,7 +2006,7 @@ static bool maybe_add_client_load_reporting_filter(
return true;
}
-void grpc_lb_policy_grpclb_init() {
+extern "C" void grpc_lb_policy_grpclb_init() {
grpc_register_lb_policy(grpc_glb_lb_factory_create());
grpc_register_tracer(&grpc_lb_glb_trace);
#ifndef NDEBUG
@@ -2018,4 +2018,4 @@ void grpc_lb_policy_grpclb_init() {
(void *)&grpc_client_load_reporting_filter);
}
-void grpc_lb_policy_grpclb_shutdown() {}
+extern "C" void grpc_lb_policy_grpclb_shutdown() {}
diff --git a/src/core/ext/filters/client_channel/lb_policy/grpclb/grpclb.h b/src/core/ext/filters/client_channel/lb_policy/grpclb/grpclb.h
index 63ad66c5e9..c67df609fc 100644
--- a/src/core/ext/filters/client_channel/lb_policy/grpclb/grpclb.h
+++ b/src/core/ext/filters/client_channel/lb_policy/grpclb/grpclb.h
@@ -21,9 +21,17 @@
#include "src/core/ext/filters/client_channel/lb_policy_factory.h"
+#ifdef __cplusplus
+extern "C" {
+#endif
+
/** Returns a load balancing factory for the glb policy, which tries to connect
* to a load balancing server to decide the next successfully connected
* subchannel to pick. */
grpc_lb_policy_factory *grpc_glb_lb_factory_create();
-#endif /* GRPC_CORE_EXT_FILTERS_CLIENT_CHANNEL_LB_POLICY_GRPCLB_GRPCLB_H */
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* GRPC_CORE_EXT_FILTERS_CLIENT_CHANNEL_LB_POLICY_GRPCLB_GRPCLB_H */ \ No newline at end of file
diff --git a/src/core/ext/filters/client_channel/lb_policy/grpclb/grpclb_channel.c b/src/core/ext/filters/client_channel/lb_policy/grpclb/grpclb_channel.cc
index f2967182e2..f2967182e2 100644
--- a/src/core/ext/filters/client_channel/lb_policy/grpclb/grpclb_channel.c
+++ b/src/core/ext/filters/client_channel/lb_policy/grpclb/grpclb_channel.cc
diff --git a/src/core/ext/filters/client_channel/lb_policy/grpclb/grpclb_channel.h b/src/core/ext/filters/client_channel/lb_policy/grpclb/grpclb_channel.h
index 6120bf53f7..e8599d1f51 100644
--- a/src/core/ext/filters/client_channel/lb_policy/grpclb/grpclb_channel.h
+++ b/src/core/ext/filters/client_channel/lb_policy/grpclb/grpclb_channel.h
@@ -23,6 +23,10 @@
#include "src/core/ext/filters/client_channel/resolver/fake/fake_resolver.h"
#include "src/core/lib/slice/slice_hash_table.h"
+#ifdef __cplusplus
+extern "C" {
+#endif
+
/** Create the channel used for communicating with an LB service.
* Note that an LB *service* may be comprised of several LB *servers*.
*
@@ -40,5 +44,9 @@ grpc_channel_args *grpc_lb_policy_grpclb_build_lb_channel_args(
grpc_fake_resolver_response_generator *response_generator,
const grpc_channel_args *args);
+#ifdef __cplusplus
+}
+#endif
+
#endif /* GRPC_CORE_EXT_FILTERS_CLIENT_CHANNEL_LB_POLICY_GRPCLB_GRPCLB_CHANNEL_H \
*/
diff --git a/src/core/ext/filters/client_channel/lb_policy/grpclb/grpclb_channel_secure.c b/src/core/ext/filters/client_channel/lb_policy/grpclb/grpclb_channel_secure.cc
index 2681b2a079..2681b2a079 100644
--- a/src/core/ext/filters/client_channel/lb_policy/grpclb/grpclb_channel_secure.c
+++ b/src/core/ext/filters/client_channel/lb_policy/grpclb/grpclb_channel_secure.cc
diff --git a/src/core/ext/filters/client_channel/lb_policy/grpclb/grpclb_client_stats.c b/src/core/ext/filters/client_channel/lb_policy/grpclb/grpclb_client_stats.cc
index 903120ca7d..903120ca7d 100644
--- a/src/core/ext/filters/client_channel/lb_policy/grpclb/grpclb_client_stats.c
+++ b/src/core/ext/filters/client_channel/lb_policy/grpclb/grpclb_client_stats.cc
diff --git a/src/core/ext/filters/client_channel/lb_policy/grpclb/grpclb_client_stats.h b/src/core/ext/filters/client_channel/lb_policy/grpclb/grpclb_client_stats.h
index c51e2a431a..b38c076f38 100644
--- a/src/core/ext/filters/client_channel/lb_policy/grpclb/grpclb_client_stats.h
+++ b/src/core/ext/filters/client_channel/lb_policy/grpclb/grpclb_client_stats.h
@@ -23,6 +23,10 @@
#include <grpc/impl/codegen/grpc_types.h>
+#ifdef __cplusplus
+extern "C" {
+#endif
+
typedef struct grpc_grpclb_client_stats grpc_grpclb_client_stats;
typedef struct {
@@ -61,5 +65,9 @@ void grpc_grpclb_client_stats_get_locked(
void grpc_grpclb_dropped_call_counts_destroy(
grpc_grpclb_dropped_call_counts* drop_entries);
+#ifdef __cplusplus
+}
+#endif
+
#endif /* GRPC_CORE_EXT_FILTERS_CLIENT_CHANNEL_LB_POLICY_GRPCLB_GRPCLB_CLIENT_STATS_H \
*/
diff --git a/src/core/ext/filters/client_channel/lb_policy/grpclb/load_balancer_api.c b/src/core/ext/filters/client_channel/lb_policy/grpclb/load_balancer_api.cc
index 8ef6dfc6f4..8ef6dfc6f4 100644
--- a/src/core/ext/filters/client_channel/lb_policy/grpclb/load_balancer_api.c
+++ b/src/core/ext/filters/client_channel/lb_policy/grpclb/load_balancer_api.cc
diff --git a/src/core/ext/filters/client_channel/lb_policy/pick_first/pick_first.c b/src/core/ext/filters/client_channel/lb_policy/pick_first/pick_first.cc
index d20cbb8388..b07fc3b720 100644
--- a/src/core/ext/filters/client_channel/lb_policy/pick_first/pick_first.c
+++ b/src/core/ext/filters/client_channel/lb_policy/pick_first/pick_first.cc
@@ -706,9 +706,9 @@ static grpc_lb_policy_factory *pick_first_lb_factory_create() {
/* Plugin registration */
-void grpc_lb_policy_pick_first_init() {
+extern "C" void grpc_lb_policy_pick_first_init() {
grpc_register_lb_policy(pick_first_lb_factory_create());
grpc_register_tracer(&grpc_lb_pick_first_trace);
}
-void grpc_lb_policy_pick_first_shutdown() {}
+extern "C" void grpc_lb_policy_pick_first_shutdown() {}
diff --git a/src/core/ext/filters/client_channel/lb_policy/round_robin/round_robin.c b/src/core/ext/filters/client_channel/lb_policy/round_robin/round_robin.cc
index a3a62e9f3c..6812bb50cd 100644
--- a/src/core/ext/filters/client_channel/lb_policy/round_robin/round_robin.c
+++ b/src/core/ext/filters/client_channel/lb_policy/round_robin/round_robin.cc
@@ -916,9 +916,9 @@ static grpc_lb_policy_factory *round_robin_lb_factory_create() {
/* Plugin registration */
-void grpc_lb_policy_round_robin_init() {
+extern "C" void grpc_lb_policy_round_robin_init() {
grpc_register_lb_policy(round_robin_lb_factory_create());
grpc_register_tracer(&grpc_lb_round_robin_trace);
}
-void grpc_lb_policy_round_robin_shutdown() {}
+extern "C" void grpc_lb_policy_round_robin_shutdown() {}
diff --git a/src/core/ext/filters/client_channel/lb_policy_factory.c b/src/core/ext/filters/client_channel/lb_policy_factory.cc
index 05ab43d0b6..05ab43d0b6 100644
--- a/src/core/ext/filters/client_channel/lb_policy_factory.c
+++ b/src/core/ext/filters/client_channel/lb_policy_factory.cc
diff --git a/src/core/ext/filters/client_channel/lb_policy_factory.h b/src/core/ext/filters/client_channel/lb_policy_factory.h
index cf0f8cb615..69bcba4232 100644
--- a/src/core/ext/filters/client_channel/lb_policy_factory.h
+++ b/src/core/ext/filters/client_channel/lb_policy_factory.h
@@ -29,6 +29,10 @@
// Channel arg key for grpc_lb_addresses.
#define GRPC_ARG_LB_ADDRESSES "grpc.lb_addresses"
+#ifdef __cplusplus
+extern "C" {
+#endif
+
typedef struct grpc_lb_policy_factory grpc_lb_policy_factory;
typedef struct grpc_lb_policy_factory_vtable grpc_lb_policy_factory_vtable;
@@ -130,4 +134,8 @@ grpc_lb_policy *grpc_lb_policy_factory_create_lb_policy(
grpc_exec_ctx *exec_ctx, grpc_lb_policy_factory *factory,
grpc_lb_policy_args *args);
-#endif /* GRPC_CORE_EXT_FILTERS_CLIENT_CHANNEL_LB_POLICY_FACTORY_H */
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* GRPC_CORE_EXT_FILTERS_CLIENT_CHANNEL_LB_POLICY_FACTORY_H */ \ No newline at end of file
diff --git a/src/core/ext/filters/client_channel/lb_policy_registry.c b/src/core/ext/filters/client_channel/lb_policy_registry.cc
index f2460f8304..f2460f8304 100644
--- a/src/core/ext/filters/client_channel/lb_policy_registry.c
+++ b/src/core/ext/filters/client_channel/lb_policy_registry.cc
diff --git a/src/core/ext/filters/client_channel/lb_policy_registry.h b/src/core/ext/filters/client_channel/lb_policy_registry.h
index f5995687cf..0867844c37 100644
--- a/src/core/ext/filters/client_channel/lb_policy_registry.h
+++ b/src/core/ext/filters/client_channel/lb_policy_registry.h
@@ -22,6 +22,10 @@
#include "src/core/ext/filters/client_channel/lb_policy_factory.h"
#include "src/core/lib/iomgr/exec_ctx.h"
+#ifdef __cplusplus
+extern "C" {
+#endif
+
/** Initialize the registry and set \a default_factory as the factory to be
* returned when no name is provided in a lookup */
void grpc_lb_policy_registry_init(void);
@@ -37,4 +41,8 @@ void grpc_register_lb_policy(grpc_lb_policy_factory *factory);
grpc_lb_policy *grpc_lb_policy_create(grpc_exec_ctx *exec_ctx, const char *name,
grpc_lb_policy_args *args);
-#endif /* GRPC_CORE_EXT_FILTERS_CLIENT_CHANNEL_LB_POLICY_REGISTRY_H */
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* GRPC_CORE_EXT_FILTERS_CLIENT_CHANNEL_LB_POLICY_REGISTRY_H */ \ No newline at end of file
diff --git a/src/core/ext/filters/client_channel/parse_address.c b/src/core/ext/filters/client_channel/parse_address.cc
index 2152b5a1e9..2152b5a1e9 100644
--- a/src/core/ext/filters/client_channel/parse_address.c
+++ b/src/core/ext/filters/client_channel/parse_address.cc
diff --git a/src/core/ext/filters/client_channel/parse_address.h b/src/core/ext/filters/client_channel/parse_address.h
index c90a827da5..742df380b7 100644
--- a/src/core/ext/filters/client_channel/parse_address.h
+++ b/src/core/ext/filters/client_channel/parse_address.h
@@ -24,6 +24,10 @@
#include "src/core/ext/filters/client_channel/uri_parser.h"
#include "src/core/lib/iomgr/resolve_address.h"
+#ifdef __cplusplus
+extern "C" {
+#endif
+
/** Populate \a resolved_addr from \a uri, whose path is expected to contain a
* unix socket path. Returns true upon success. */
bool grpc_parse_unix(const grpc_uri *uri, grpc_resolved_address *resolved_addr);
@@ -45,4 +49,8 @@ bool grpc_parse_ipv4_hostport(const char *hostport, grpc_resolved_address *addr,
bool grpc_parse_ipv6_hostport(const char *hostport, grpc_resolved_address *addr,
bool log_errors);
-#endif /* GRPC_CORE_EXT_FILTERS_CLIENT_CHANNEL_PARSE_ADDRESS_H */
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* GRPC_CORE_EXT_FILTERS_CLIENT_CHANNEL_PARSE_ADDRESS_H */ \ No newline at end of file
diff --git a/src/core/ext/filters/client_channel/proxy_mapper.c b/src/core/ext/filters/client_channel/proxy_mapper.cc
index c6ea5fc680..c6ea5fc680 100644
--- a/src/core/ext/filters/client_channel/proxy_mapper.c
+++ b/src/core/ext/filters/client_channel/proxy_mapper.cc
diff --git a/src/core/ext/filters/client_channel/proxy_mapper.h b/src/core/ext/filters/client_channel/proxy_mapper.h
index a13861ccaf..1325a9f1f6 100644
--- a/src/core/ext/filters/client_channel/proxy_mapper.h
+++ b/src/core/ext/filters/client_channel/proxy_mapper.h
@@ -25,6 +25,10 @@
#include "src/core/lib/iomgr/resolve_address.h"
+#ifdef __cplusplus
+extern "C" {
+#endif
+
typedef struct grpc_proxy_mapper grpc_proxy_mapper;
typedef struct {
@@ -71,4 +75,8 @@ bool grpc_proxy_mapper_map_address(grpc_exec_ctx* exec_ctx,
void grpc_proxy_mapper_destroy(grpc_proxy_mapper* mapper);
-#endif /* GRPC_CORE_EXT_FILTERS_CLIENT_CHANNEL_PROXY_MAPPER_H */
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* GRPC_CORE_EXT_FILTERS_CLIENT_CHANNEL_PROXY_MAPPER_H */ \ No newline at end of file
diff --git a/src/core/ext/filters/client_channel/proxy_mapper_registry.c b/src/core/ext/filters/client_channel/proxy_mapper_registry.cc
index 09967eea3c..09967eea3c 100644
--- a/src/core/ext/filters/client_channel/proxy_mapper_registry.c
+++ b/src/core/ext/filters/client_channel/proxy_mapper_registry.cc
diff --git a/src/core/ext/filters/client_channel/proxy_mapper_registry.h b/src/core/ext/filters/client_channel/proxy_mapper_registry.h
index 99e54d1a78..2d389f1c21 100644
--- a/src/core/ext/filters/client_channel/proxy_mapper_registry.h
+++ b/src/core/ext/filters/client_channel/proxy_mapper_registry.h
@@ -21,6 +21,10 @@
#include "src/core/ext/filters/client_channel/proxy_mapper.h"
+#ifdef __cplusplus
+extern "C" {
+#endif
+
void grpc_proxy_mapper_registry_init();
void grpc_proxy_mapper_registry_shutdown();
@@ -41,4 +45,8 @@ bool grpc_proxy_mappers_map_address(grpc_exec_ctx* exec_ctx,
grpc_resolved_address** new_address,
grpc_channel_args** new_args);
-#endif /* GRPC_CORE_EXT_FILTERS_CLIENT_CHANNEL_PROXY_MAPPER_REGISTRY_H */
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* GRPC_CORE_EXT_FILTERS_CLIENT_CHANNEL_PROXY_MAPPER_REGISTRY_H */ \ No newline at end of file
diff --git a/src/core/ext/filters/client_channel/resolver.c b/src/core/ext/filters/client_channel/resolver.cc
index 8401504fcf..8401504fcf 100644
--- a/src/core/ext/filters/client_channel/resolver.c
+++ b/src/core/ext/filters/client_channel/resolver.cc
diff --git a/src/core/ext/filters/client_channel/resolver.h b/src/core/ext/filters/client_channel/resolver.h
index ae9c8f66fe..73fbbbbc3b 100644
--- a/src/core/ext/filters/client_channel/resolver.h
+++ b/src/core/ext/filters/client_channel/resolver.h
@@ -22,6 +22,10 @@
#include "src/core/ext/filters/client_channel/subchannel.h"
#include "src/core/lib/iomgr/iomgr.h"
+#ifdef __cplusplus
+extern "C" {
+#endif
+
typedef struct grpc_resolver grpc_resolver;
typedef struct grpc_resolver_vtable grpc_resolver_vtable;
@@ -87,4 +91,8 @@ void grpc_resolver_next_locked(grpc_exec_ctx *exec_ctx, grpc_resolver *resolver,
grpc_channel_args **result,
grpc_closure *on_complete);
+#ifdef __cplusplus
+}
+#endif
+
#endif /* GRPC_CORE_EXT_FILTERS_CLIENT_CHANNEL_RESOLVER_H */
diff --git a/src/core/ext/filters/client_channel/resolver/dns/c_ares/dns_resolver_ares.c b/src/core/ext/filters/client_channel/resolver/dns/c_ares/dns_resolver_ares.cc
index 9bb229ad95..69f5877b00 100644
--- a/src/core/ext/filters/client_channel/resolver/dns/c_ares/dns_resolver_ares.c
+++ b/src/core/ext/filters/client_channel/resolver/dns/c_ares/dns_resolver_ares.cc
@@ -425,7 +425,7 @@ static grpc_resolver_factory *dns_ares_resolver_factory_create() {
return &dns_resolver_factory;
}
-void grpc_resolver_dns_ares_init(void) {
+extern "C" void grpc_resolver_dns_ares_init(void) {
char *resolver = gpr_getenv("GRPC_DNS_RESOLVER");
/* TODO(zyc): Turn on c-ares based resolver by default after the address
sorter and the CNAME support are added. */
@@ -441,7 +441,7 @@ void grpc_resolver_dns_ares_init(void) {
gpr_free(resolver);
}
-void grpc_resolver_dns_ares_shutdown(void) {
+extern "C" void grpc_resolver_dns_ares_shutdown(void) {
char *resolver = gpr_getenv("GRPC_DNS_RESOLVER");
if (resolver != NULL && gpr_stricmp(resolver, "ares") == 0) {
grpc_ares_cleanup();
@@ -451,8 +451,8 @@ void grpc_resolver_dns_ares_shutdown(void) {
#else /* GRPC_ARES == 1 && !defined(GRPC_UV) */
-void grpc_resolver_dns_ares_init(void) {}
+extern "C" void grpc_resolver_dns_ares_init(void) {}
-void grpc_resolver_dns_ares_shutdown(void) {}
+extern "C" void grpc_resolver_dns_ares_shutdown(void) {}
#endif /* GRPC_ARES == 1 && !defined(GRPC_UV) */
diff --git a/src/core/ext/filters/client_channel/resolver/dns/c_ares/grpc_ares_ev_driver.h b/src/core/ext/filters/client_channel/resolver/dns/c_ares/grpc_ares_ev_driver.h
index 386012d2ed..3d4309f2fa 100644
--- a/src/core/ext/filters/client_channel/resolver/dns/c_ares/grpc_ares_ev_driver.h
+++ b/src/core/ext/filters/client_channel/resolver/dns/c_ares/grpc_ares_ev_driver.h
@@ -22,6 +22,10 @@
#include "src/core/lib/iomgr/exec_ctx.h"
#include "src/core/lib/iomgr/pollset_set.h"
+#ifdef __cplusplus
+extern "C" {
+#endif
+
typedef struct grpc_ares_ev_driver grpc_ares_ev_driver;
/* Start \a ev_driver. It will keep working until all IO on its ares_channel is
@@ -49,5 +53,9 @@ void grpc_ares_ev_driver_destroy(grpc_ares_ev_driver *ev_driver);
void grpc_ares_ev_driver_shutdown(grpc_exec_ctx *exec_ctx,
grpc_ares_ev_driver *ev_driver);
+#ifdef __cplusplus
+}
+#endif
+
#endif /* GRPC_CORE_EXT_FILTERS_CLIENT_CHANNEL_RESOLVER_DNS_C_ARES_GRPC_ARES_EV_DRIVER_H \
*/
diff --git a/src/core/ext/filters/client_channel/resolver/dns/c_ares/grpc_ares_ev_driver_posix.c b/src/core/ext/filters/client_channel/resolver/dns/c_ares/grpc_ares_ev_driver_posix.cc
index c30cc93b6f..c30cc93b6f 100644
--- a/src/core/ext/filters/client_channel/resolver/dns/c_ares/grpc_ares_ev_driver_posix.c
+++ b/src/core/ext/filters/client_channel/resolver/dns/c_ares/grpc_ares_ev_driver_posix.cc
diff --git a/src/core/ext/filters/client_channel/resolver/dns/c_ares/grpc_ares_wrapper.c b/src/core/ext/filters/client_channel/resolver/dns/c_ares/grpc_ares_wrapper.cc
index 04379975e1..04379975e1 100644
--- a/src/core/ext/filters/client_channel/resolver/dns/c_ares/grpc_ares_wrapper.c
+++ b/src/core/ext/filters/client_channel/resolver/dns/c_ares/grpc_ares_wrapper.cc
diff --git a/src/core/ext/filters/client_channel/resolver/dns/c_ares/grpc_ares_wrapper.h b/src/core/ext/filters/client_channel/resolver/dns/c_ares/grpc_ares_wrapper.h
index 108333047d..38fbea9aac 100644
--- a/src/core/ext/filters/client_channel/resolver/dns/c_ares/grpc_ares_wrapper.h
+++ b/src/core/ext/filters/client_channel/resolver/dns/c_ares/grpc_ares_wrapper.h
@@ -25,6 +25,10 @@
#include "src/core/lib/iomgr/polling_entity.h"
#include "src/core/lib/iomgr/resolve_address.h"
+#ifdef __cplusplus
+extern "C" {
+#endif
+
typedef struct grpc_ares_request grpc_ares_request;
/* Asynchronously resolve \a name. Use \a default_port if a port isn't
@@ -65,5 +69,9 @@ grpc_error *grpc_ares_init(void);
it has been called the same number of times as grpc_ares_init(). */
void grpc_ares_cleanup(void);
+#ifdef __cplusplus
+}
+#endif
+
#endif /* GRPC_CORE_EXT_FILTERS_CLIENT_CHANNEL_RESOLVER_DNS_C_ARES_GRPC_ARES_WRAPPER_H \
*/
diff --git a/src/core/ext/filters/client_channel/resolver/dns/c_ares/grpc_ares_wrapper_fallback.c b/src/core/ext/filters/client_channel/resolver/dns/c_ares/grpc_ares_wrapper_fallback.cc
index f2587c4520..f2587c4520 100644
--- a/src/core/ext/filters/client_channel/resolver/dns/c_ares/grpc_ares_wrapper_fallback.c
+++ b/src/core/ext/filters/client_channel/resolver/dns/c_ares/grpc_ares_wrapper_fallback.cc
diff --git a/src/core/ext/filters/client_channel/resolver/dns/native/dns_resolver.c b/src/core/ext/filters/client_channel/resolver/dns/native/dns_resolver.cc
index 5ea75f0554..1c093d0ad2 100644
--- a/src/core/ext/filters/client_channel/resolver/dns/native/dns_resolver.c
+++ b/src/core/ext/filters/client_channel/resolver/dns/native/dns_resolver.cc
@@ -16,6 +16,9 @@
*
*/
+#include <grpc/support/port_platform.h>
+
+#include <inttypes.h>
#include <string.h>
#include <grpc/support/alloc.h>
@@ -289,7 +292,7 @@ static grpc_resolver_factory *dns_resolver_factory_create() {
return &dns_resolver_factory;
}
-void grpc_resolver_dns_native_init(void) {
+extern "C" void grpc_resolver_dns_native_init(void) {
char *resolver = gpr_getenv("GRPC_DNS_RESOLVER");
if (resolver != NULL && gpr_stricmp(resolver, "native") == 0) {
gpr_log(GPR_DEBUG, "Using native dns resolver");
@@ -307,4 +310,4 @@ void grpc_resolver_dns_native_init(void) {
gpr_free(resolver);
}
-void grpc_resolver_dns_native_shutdown(void) {}
+extern "C" void grpc_resolver_dns_native_shutdown(void) {}
diff --git a/src/core/ext/filters/client_channel/resolver/fake/fake_resolver.c b/src/core/ext/filters/client_channel/resolver/fake/fake_resolver.cc
index 69ea440ae6..ed5b1011fb 100644
--- a/src/core/ext/filters/client_channel/resolver/fake/fake_resolver.c
+++ b/src/core/ext/filters/client_channel/resolver/fake/fake_resolver.cc
@@ -258,8 +258,8 @@ static const grpc_resolver_factory_vtable fake_resolver_factory_vtable = {
static grpc_resolver_factory fake_resolver_factory = {
&fake_resolver_factory_vtable};
-void grpc_resolver_fake_init(void) {
+extern "C" void grpc_resolver_fake_init(void) {
grpc_register_resolver_type(&fake_resolver_factory);
}
-void grpc_resolver_fake_shutdown(void) {}
+extern "C" void grpc_resolver_fake_shutdown(void) {}
diff --git a/src/core/ext/filters/client_channel/resolver/fake/fake_resolver.h b/src/core/ext/filters/client_channel/resolver/fake/fake_resolver.h
index c084ef2a58..95c3bafed8 100644
--- a/src/core/ext/filters/client_channel/resolver/fake/fake_resolver.h
+++ b/src/core/ext/filters/client_channel/resolver/fake/fake_resolver.h
@@ -21,6 +21,10 @@
#include "src/core/ext/filters/client_channel/uri_parser.h"
#include "src/core/lib/channel/channel_args.h"
+#ifdef __cplusplus
+extern "C" {
+#endif
+
#define GRPC_ARG_FAKE_RESOLVER_RESPONSE_GENERATOR \
"grpc.fake_resolver.response_generator"
@@ -56,5 +60,9 @@ grpc_fake_resolver_response_generator_ref(
void grpc_fake_resolver_response_generator_unref(
grpc_fake_resolver_response_generator* generator);
+#ifdef __cplusplus
+}
+#endif
+
#endif /* GRPC_CORE_EXT_FILTERS_CLIENT_CHANNEL_RESOLVER_FAKE_FAKE_RESOLVER_H \
*/
diff --git a/src/core/ext/filters/client_channel/resolver/sockaddr/sockaddr_resolver.c b/src/core/ext/filters/client_channel/resolver/sockaddr/sockaddr_resolver.cc
index 7ceb8f40a1..dda9542325 100644
--- a/src/core/ext/filters/client_channel/resolver/sockaddr/sockaddr_resolver.c
+++ b/src/core/ext/filters/client_channel/resolver/sockaddr/sockaddr_resolver.cc
@@ -211,7 +211,7 @@ DECL_FACTORY(unix);
DECL_FACTORY(ipv4);
DECL_FACTORY(ipv6);
-void grpc_resolver_sockaddr_init(void) {
+extern "C" void grpc_resolver_sockaddr_init(void) {
grpc_register_resolver_type(&ipv4_resolver_factory);
grpc_register_resolver_type(&ipv6_resolver_factory);
#ifdef GRPC_HAVE_UNIX_SOCKET
@@ -219,4 +219,4 @@ void grpc_resolver_sockaddr_init(void) {
#endif
}
-void grpc_resolver_sockaddr_shutdown(void) {}
+extern "C" void grpc_resolver_sockaddr_shutdown(void) {}
diff --git a/src/core/ext/filters/client_channel/resolver_factory.c b/src/core/ext/filters/client_channel/resolver_factory.cc
index 6f0a7c1e36..6f0a7c1e36 100644
--- a/src/core/ext/filters/client_channel/resolver_factory.c
+++ b/src/core/ext/filters/client_channel/resolver_factory.cc
diff --git a/src/core/ext/filters/client_channel/resolver_factory.h b/src/core/ext/filters/client_channel/resolver_factory.h
index 6bd7929d4e..6e533e3248 100644
--- a/src/core/ext/filters/client_channel/resolver_factory.h
+++ b/src/core/ext/filters/client_channel/resolver_factory.h
@@ -24,6 +24,10 @@
#include "src/core/ext/filters/client_channel/uri_parser.h"
#include "src/core/lib/iomgr/pollset_set.h"
+#ifdef __cplusplus
+extern "C" {
+#endif
+
typedef struct grpc_resolver_factory grpc_resolver_factory;
typedef struct grpc_resolver_factory_vtable grpc_resolver_factory_vtable;
@@ -67,4 +71,8 @@ grpc_resolver *grpc_resolver_factory_create_resolver(
char *grpc_resolver_factory_get_default_authority(
grpc_resolver_factory *factory, grpc_uri *uri);
-#endif /* GRPC_CORE_EXT_FILTERS_CLIENT_CHANNEL_RESOLVER_FACTORY_H */
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* GRPC_CORE_EXT_FILTERS_CLIENT_CHANNEL_RESOLVER_FACTORY_H */ \ No newline at end of file
diff --git a/src/core/ext/filters/client_channel/resolver_registry.c b/src/core/ext/filters/client_channel/resolver_registry.cc
index 1a0fb0bc3c..1a0fb0bc3c 100644
--- a/src/core/ext/filters/client_channel/resolver_registry.c
+++ b/src/core/ext/filters/client_channel/resolver_registry.cc
diff --git a/src/core/ext/filters/client_channel/resolver_registry.h b/src/core/ext/filters/client_channel/resolver_registry.h
index 692490543d..eb08d887b1 100644
--- a/src/core/ext/filters/client_channel/resolver_registry.h
+++ b/src/core/ext/filters/client_channel/resolver_registry.h
@@ -22,6 +22,10 @@
#include "src/core/ext/filters/client_channel/resolver_factory.h"
#include "src/core/lib/iomgr/pollset_set.h"
+#ifdef __cplusplus
+extern "C" {
+#endif
+
void grpc_resolver_registry_init();
void grpc_resolver_registry_shutdown(void);
@@ -66,4 +70,8 @@ char *grpc_get_default_authority(grpc_exec_ctx *exec_ctx, const char *target);
char *grpc_resolver_factory_add_default_prefix_if_needed(
grpc_exec_ctx *exec_ctx, const char *target);
-#endif /* GRPC_CORE_EXT_FILTERS_CLIENT_CHANNEL_RESOLVER_REGISTRY_H */
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* GRPC_CORE_EXT_FILTERS_CLIENT_CHANNEL_RESOLVER_REGISTRY_H */ \ No newline at end of file
diff --git a/src/core/ext/filters/client_channel/retry_throttle.c b/src/core/ext/filters/client_channel/retry_throttle.cc
index 09dcade089..09dcade089 100644
--- a/src/core/ext/filters/client_channel/retry_throttle.c
+++ b/src/core/ext/filters/client_channel/retry_throttle.cc
diff --git a/src/core/ext/filters/client_channel/retry_throttle.h b/src/core/ext/filters/client_channel/retry_throttle.h
index bf99297e98..3b849475b9 100644
--- a/src/core/ext/filters/client_channel/retry_throttle.h
+++ b/src/core/ext/filters/client_channel/retry_throttle.h
@@ -21,6 +21,10 @@
#include <stdbool.h>
+#ifdef __cplusplus
+extern "C" {
+#endif
+
/// Tracks retry throttling data for an individual server name.
typedef struct grpc_server_retry_throttle_data grpc_server_retry_throttle_data;
@@ -47,4 +51,8 @@ void grpc_retry_throttle_map_shutdown();
grpc_server_retry_throttle_data* grpc_retry_throttle_map_get_data_for_server(
const char* server_name, int max_milli_tokens, int milli_token_ratio);
-#endif /* GRPC_CORE_EXT_FILTERS_CLIENT_CHANNEL_RETRY_THROTTLE_H */
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* GRPC_CORE_EXT_FILTERS_CLIENT_CHANNEL_RETRY_THROTTLE_H */ \ No newline at end of file
diff --git a/src/core/ext/filters/client_channel/subchannel.c b/src/core/ext/filters/client_channel/subchannel.cc
index 40a51c72d6..bff5001d69 100644
--- a/src/core/ext/filters/client_channel/subchannel.c
+++ b/src/core/ext/filters/client_channel/subchannel.cc
@@ -18,6 +18,7 @@
#include "src/core/ext/filters/client_channel/subchannel.h"
+#include <inttypes.h>
#include <limits.h>
#include <string.h>
@@ -343,27 +344,23 @@ grpc_subchannel *grpc_subchannel_create(grpc_exec_ctx *exec_ctx,
"grpc.testing.fixed_reconnect_backoff_ms")) {
fixed_reconnect_backoff = true;
initial_backoff_ms = min_backoff_ms = max_backoff_ms =
- grpc_channel_arg_get_integer(
- &c->args->args[i],
- (grpc_integer_options){initial_backoff_ms, 100, INT_MAX});
+ grpc_channel_arg_get_integer(&c->args->args[i],
+ {initial_backoff_ms, 100, INT_MAX});
} else if (0 == strcmp(c->args->args[i].key,
GRPC_ARG_MIN_RECONNECT_BACKOFF_MS)) {
fixed_reconnect_backoff = false;
min_backoff_ms = grpc_channel_arg_get_integer(
- &c->args->args[i],
- (grpc_integer_options){min_backoff_ms, 100, INT_MAX});
+ &c->args->args[i], {min_backoff_ms, 100, INT_MAX});
} else if (0 == strcmp(c->args->args[i].key,
GRPC_ARG_MAX_RECONNECT_BACKOFF_MS)) {
fixed_reconnect_backoff = false;
max_backoff_ms = grpc_channel_arg_get_integer(
- &c->args->args[i],
- (grpc_integer_options){max_backoff_ms, 100, INT_MAX});
+ &c->args->args[i], {max_backoff_ms, 100, INT_MAX});
} else if (0 == strcmp(c->args->args[i].key,
GRPC_ARG_INITIAL_RECONNECT_BACKOFF_MS)) {
fixed_reconnect_backoff = false;
initial_backoff_ms = grpc_channel_arg_get_integer(
- &c->args->args[i],
- (grpc_integer_options){initial_backoff_ms, 100, INT_MAX});
+ &c->args->args[i], {initial_backoff_ms, 100, INT_MAX});
}
}
}
@@ -759,14 +756,15 @@ grpc_error *grpc_connected_subchannel_create_call(
grpc_call_stack *callstk = SUBCHANNEL_CALL_TO_CALL_STACK(*call);
(*call)->connection = GRPC_CONNECTED_SUBCHANNEL_REF(con, "subchannel_call");
const grpc_call_element_args call_args = {
- .call_stack = callstk,
- .server_transport_data = NULL,
- .context = args->context,
- .path = args->path,
- .start_time = args->start_time,
- .deadline = args->deadline,
- .arena = args->arena,
- .call_combiner = args->call_combiner};
+ callstk, /* call_stack */
+ NULL, /* server_transport_data */
+ args->context, /* context */
+ args->path, /* path */
+ args->start_time, /* start_time */
+ args->deadline, /* deadline */
+ args->arena, /* arena */
+ args->call_combiner /* call_combiner */
+ };
grpc_error *error = grpc_call_stack_init(
exec_ctx, chanstk, 1, subchannel_call_destroy, *call, &call_args);
if (error != GRPC_ERROR_NONE) {
diff --git a/src/core/ext/filters/client_channel/subchannel.h b/src/core/ext/filters/client_channel/subchannel.h
index 51d712f6a7..c67ff97b0b 100644
--- a/src/core/ext/filters/client_channel/subchannel.h
+++ b/src/core/ext/filters/client_channel/subchannel.h
@@ -26,6 +26,10 @@
#include "src/core/lib/transport/connectivity_state.h"
#include "src/core/lib/transport/metadata.h"
+#ifdef __cplusplus
+extern "C" {
+#endif
+
// Channel arg containing a grpc_resolved_address to connect to.
#define GRPC_ARG_SUBCHANNEL_ADDRESS "grpc.subchannel_address"
@@ -188,4 +192,8 @@ const char *grpc_get_subchannel_address_uri_arg(const grpc_channel_args *args);
/// Caller is responsible for freeing the string.
grpc_arg grpc_create_subchannel_address_arg(const grpc_resolved_address *addr);
+#ifdef __cplusplus
+}
+#endif
+
#endif /* GRPC_CORE_EXT_FILTERS_CLIENT_CHANNEL_SUBCHANNEL_H */
diff --git a/src/core/ext/filters/client_channel/subchannel_index.c b/src/core/ext/filters/client_channel/subchannel_index.cc
index d7a51f3899..1f466ec0b8 100644
--- a/src/core/ext/filters/client_channel/subchannel_index.c
+++ b/src/core/ext/filters/client_channel/subchannel_index.cc
@@ -114,11 +114,12 @@ static void *scv_avl_copy(void *p, void *unused) {
}
static const gpr_avl_vtable subchannel_avl_vtable = {
- .destroy_key = sck_avl_destroy,
- .copy_key = sck_avl_copy,
- .compare_keys = sck_avl_compare,
- .destroy_value = scv_avl_destroy,
- .copy_value = scv_avl_copy};
+ sck_avl_destroy, // destroy_key
+ sck_avl_copy, // copy_key
+ sck_avl_compare, // compare_keys
+ scv_avl_destroy, // destroy_value
+ scv_avl_copy // copy_value
+};
void grpc_subchannel_index_init(void) {
g_subchannel_index = gpr_avl_create(&subchannel_avl_vtable);
diff --git a/src/core/ext/filters/client_channel/subchannel_index.h b/src/core/ext/filters/client_channel/subchannel_index.h
index 92e36d5283..09bac3592c 100644
--- a/src/core/ext/filters/client_channel/subchannel_index.h
+++ b/src/core/ext/filters/client_channel/subchannel_index.h
@@ -21,6 +21,10 @@
#include "src/core/ext/filters/client_channel/subchannel.h"
+#ifdef __cplusplus
+extern "C" {
+#endif
+
/** \file Provides an index of active subchannels so that they can be
shared amongst channels */
@@ -78,4 +82,8 @@ void grpc_subchannel_index_unref(void);
* force_creation set. */
void grpc_subchannel_index_test_only_set_force_creation(bool force_creation);
-#endif /* GRPC_CORE_EXT_FILTERS_CLIENT_CHANNEL_SUBCHANNEL_INDEX_H */
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* GRPC_CORE_EXT_FILTERS_CLIENT_CHANNEL_SUBCHANNEL_INDEX_H */ \ No newline at end of file
diff --git a/src/core/ext/filters/client_channel/uri_parser.c b/src/core/ext/filters/client_channel/uri_parser.cc
index fb4fb8e694..fb4fb8e694 100644
--- a/src/core/ext/filters/client_channel/uri_parser.c
+++ b/src/core/ext/filters/client_channel/uri_parser.cc
diff --git a/src/core/ext/filters/client_channel/uri_parser.h b/src/core/ext/filters/client_channel/uri_parser.h
index 05ca2e00e4..43e8ae64e0 100644
--- a/src/core/ext/filters/client_channel/uri_parser.h
+++ b/src/core/ext/filters/client_channel/uri_parser.h
@@ -22,6 +22,10 @@
#include <stddef.h>
#include "src/core/lib/iomgr/exec_ctx.h"
+#ifdef __cplusplus
+extern "C" {
+#endif
+
typedef struct {
char *scheme;
char *authority;
@@ -47,4 +51,8 @@ const char *grpc_uri_get_query_arg(const grpc_uri *uri, const char *key);
/** destroy a uri */
void grpc_uri_destroy(grpc_uri *uri);
-#endif /* GRPC_CORE_EXT_FILTERS_CLIENT_CHANNEL_URI_PARSER_H */
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* GRPC_CORE_EXT_FILTERS_CLIENT_CHANNEL_URI_PARSER_H */ \ No newline at end of file
diff --git a/src/core/ext/filters/deadline/deadline_filter.c b/src/core/ext/filters/deadline/deadline_filter.cc
index 1aed488077..866ce46acf 100644
--- a/src/core/ext/filters/deadline/deadline_filter.c
+++ b/src/core/ext/filters/deadline/deadline_filter.cc
@@ -385,7 +385,7 @@ static bool maybe_add_deadline_filter(grpc_exec_ctx* exec_ctx,
: true;
}
-void grpc_deadline_filter_init(void) {
+extern "C" void grpc_deadline_filter_init(void) {
grpc_channel_init_register_stage(
GRPC_CLIENT_DIRECT_CHANNEL, GRPC_CHANNEL_INIT_BUILTIN_PRIORITY,
maybe_add_deadline_filter, (void*)&grpc_client_deadline_filter);
@@ -394,4 +394,4 @@ void grpc_deadline_filter_init(void) {
maybe_add_deadline_filter, (void*)&grpc_server_deadline_filter);
}
-void grpc_deadline_filter_shutdown(void) {}
+extern "C" void grpc_deadline_filter_shutdown(void) {}
diff --git a/src/core/ext/filters/deadline/deadline_filter.h b/src/core/ext/filters/deadline/deadline_filter.h
index 3eb102ad28..f4a1110ee6 100644
--- a/src/core/ext/filters/deadline/deadline_filter.h
+++ b/src/core/ext/filters/deadline/deadline_filter.h
@@ -20,6 +20,10 @@
#include "src/core/lib/channel/channel_stack.h"
#include "src/core/lib/iomgr/timer.h"
+#ifdef __cplusplus
+extern "C" {
+#endif
+
typedef enum grpc_deadline_timer_state {
GRPC_DEADLINE_STATE_INITIAL,
GRPC_DEADLINE_STATE_PENDING,
@@ -89,4 +93,8 @@ bool grpc_deadline_checking_enabled(const grpc_channel_args* args);
extern const grpc_channel_filter grpc_client_deadline_filter;
extern const grpc_channel_filter grpc_server_deadline_filter;
-#endif /* GRPC_CORE_EXT_FILTERS_DEADLINE_DEADLINE_FILTER_H */
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* GRPC_CORE_EXT_FILTERS_DEADLINE_DEADLINE_FILTER_H */ \ No newline at end of file
diff --git a/src/core/ext/filters/http/client/http_client_filter.c b/src/core/ext/filters/http/client/http_client_filter.cc
index 6208089f2e..6208089f2e 100644
--- a/src/core/ext/filters/http/client/http_client_filter.c
+++ b/src/core/ext/filters/http/client/http_client_filter.cc
diff --git a/src/core/ext/filters/http/client/http_client_filter.h b/src/core/ext/filters/http/client/http_client_filter.h
index ec8177c436..9ed8e76915 100644
--- a/src/core/ext/filters/http/client/http_client_filter.h
+++ b/src/core/ext/filters/http/client/http_client_filter.h
@@ -20,10 +20,18 @@
#include "src/core/lib/channel/channel_stack.h"
+#ifdef __cplusplus
+extern "C" {
+#endif
+
/* Processes metadata on the client side for HTTP2 transports */
extern const grpc_channel_filter grpc_http_client_filter;
/* Channel arg to determine maximum size of payload eligable for GET request */
#define GRPC_ARG_MAX_PAYLOAD_SIZE_FOR_GET "grpc.max_payload_size_for_get"
+#ifdef __cplusplus
+}
+#endif
+
#endif /* GRPC_CORE_EXT_FILTERS_HTTP_CLIENT_HTTP_CLIENT_FILTER_H */
diff --git a/src/core/ext/filters/http/http_filters_plugin.c b/src/core/ext/filters/http/http_filters_plugin.cc
index 88bd2250f9..8f5b856317 100644
--- a/src/core/ext/filters/http/http_filters_plugin.c
+++ b/src/core/ext/filters/http/http_filters_plugin.cc
@@ -64,7 +64,7 @@ static bool maybe_add_required_filter(grpc_exec_ctx *exec_ctx,
: true;
}
-void grpc_http_filters_init(void) {
+extern "C" void grpc_http_filters_init(void) {
grpc_register_tracer(&grpc_compression_trace);
grpc_channel_init_register_stage(GRPC_CLIENT_SUBCHANNEL,
GRPC_CHANNEL_INIT_BUILTIN_PRIORITY,
@@ -86,4 +86,4 @@ void grpc_http_filters_init(void) {
maybe_add_required_filter, (void *)&grpc_http_server_filter);
}
-void grpc_http_filters_shutdown(void) {}
+extern "C" void grpc_http_filters_shutdown(void) {}
diff --git a/src/core/ext/filters/http/message_compress/message_compress_filter.c b/src/core/ext/filters/http/message_compress/message_compress_filter.cc
index f785e1355d..f785e1355d 100644
--- a/src/core/ext/filters/http/message_compress/message_compress_filter.c
+++ b/src/core/ext/filters/http/message_compress/message_compress_filter.cc
diff --git a/src/core/ext/filters/http/message_compress/message_compress_filter.h b/src/core/ext/filters/http/message_compress/message_compress_filter.h
index c121a391eb..92771d9858 100644
--- a/src/core/ext/filters/http/message_compress/message_compress_filter.h
+++ b/src/core/ext/filters/http/message_compress/message_compress_filter.h
@@ -23,6 +23,10 @@
#include "src/core/lib/channel/channel_stack.h"
+#ifdef __cplusplus
+extern "C" {
+#endif
+
/** Compression filter for outgoing data.
*
* See <grpc/compression.h> for the available compression settings.
@@ -47,5 +51,9 @@
extern const grpc_channel_filter grpc_message_compress_filter;
+#ifdef __cplusplus
+}
+#endif
+
#endif /* GRPC_CORE_EXT_FILTERS_HTTP_MESSAGE_COMPRESS_MESSAGE_COMPRESS_FILTER_H \
*/
diff --git a/src/core/ext/filters/http/server/http_server_filter.c b/src/core/ext/filters/http/server/http_server_filter.cc
index 03958136b4..03958136b4 100644
--- a/src/core/ext/filters/http/server/http_server_filter.c
+++ b/src/core/ext/filters/http/server/http_server_filter.cc
diff --git a/src/core/ext/filters/http/server/http_server_filter.h b/src/core/ext/filters/http/server/http_server_filter.h
index c0f678a329..4b38cc5bf7 100644
--- a/src/core/ext/filters/http/server/http_server_filter.h
+++ b/src/core/ext/filters/http/server/http_server_filter.h
@@ -21,7 +21,15 @@
#include "src/core/lib/channel/channel_stack.h"
+#ifdef __cplusplus
+extern "C" {
+#endif
+
/* Processes metadata on the client side for HTTP2 transports */
extern const grpc_channel_filter grpc_http_server_filter;
+#ifdef __cplusplus
+}
+#endif
+
#endif /* GRPC_CORE_EXT_FILTERS_HTTP_SERVER_HTTP_SERVER_FILTER_H */
diff --git a/src/core/ext/filters/load_reporting/server_load_reporting_filter.c b/src/core/ext/filters/load_reporting/server_load_reporting_filter.cc
index ca8a3b2a13..ca8a3b2a13 100644
--- a/src/core/ext/filters/load_reporting/server_load_reporting_filter.c
+++ b/src/core/ext/filters/load_reporting/server_load_reporting_filter.cc
diff --git a/src/core/ext/filters/load_reporting/server_load_reporting_filter.h b/src/core/ext/filters/load_reporting/server_load_reporting_filter.h
index 9527868c9f..94d19cc249 100644
--- a/src/core/ext/filters/load_reporting/server_load_reporting_filter.h
+++ b/src/core/ext/filters/load_reporting/server_load_reporting_filter.h
@@ -22,7 +22,15 @@
#include "src/core/ext/filters/load_reporting/server_load_reporting_plugin.h"
#include "src/core/lib/channel/channel_stack.h"
+#ifdef __cplusplus
+extern "C" {
+#endif
+
extern const grpc_channel_filter grpc_server_load_reporting_filter;
+#ifdef __cplusplus
+}
+#endif
+
#endif /* GRPC_CORE_EXT_FILTERS_LOAD_REPORTING_SERVER_LOAD_REPORTING_FILTER_H \
*/
diff --git a/src/core/ext/filters/load_reporting/server_load_reporting_plugin.c b/src/core/ext/filters/load_reporting/server_load_reporting_plugin.cc
index 2486ead427..223fb3ee8b 100644
--- a/src/core/ext/filters/load_reporting/server_load_reporting_plugin.c
+++ b/src/core/ext/filters/load_reporting/server_load_reporting_plugin.cc
@@ -61,10 +61,10 @@ grpc_arg grpc_load_reporting_enable_arg() {
/* Plugin registration */
-void grpc_server_load_reporting_plugin_init(void) {
+extern "C" void grpc_server_load_reporting_plugin_init(void) {
grpc_channel_init_register_stage(GRPC_SERVER_CHANNEL, INT_MAX,
maybe_add_server_load_reporting_filter,
(void *)&grpc_server_load_reporting_filter);
}
-void grpc_server_load_reporting_plugin_shutdown() {}
+extern "C" void grpc_server_load_reporting_plugin_shutdown() {}
diff --git a/src/core/ext/filters/load_reporting/server_load_reporting_plugin.h b/src/core/ext/filters/load_reporting/server_load_reporting_plugin.h
index 65a6d0900e..65e254eb53 100644
--- a/src/core/ext/filters/load_reporting/server_load_reporting_plugin.h
+++ b/src/core/ext/filters/load_reporting/server_load_reporting_plugin.h
@@ -23,6 +23,10 @@
#include "src/core/lib/channel/channel_stack.h"
+#ifdef __cplusplus
+extern "C" {
+#endif
+
/** Identifiers for the invocation point of the users LR callback */
typedef enum grpc_load_reporting_source {
GRPC_LR_POINT_UNKNOWN = 0,
@@ -55,5 +59,9 @@ typedef struct grpc_load_reporting_call_data {
/** Return a \a grpc_arg enabling load reporting */
grpc_arg grpc_load_reporting_enable_arg();
+#ifdef __cplusplus
+}
+#endif
+
#endif /* GRPC_CORE_EXT_FILTERS_LOAD_REPORTING_SERVER_LOAD_REPORTING_PLUGIN_H \
*/
diff --git a/src/core/ext/filters/max_age/max_age_filter.c b/src/core/ext/filters/max_age/max_age_filter.cc
index 0ac803ed41..f4d5b1427e 100644
--- a/src/core/ext/filters/max_age/max_age_filter.c
+++ b/src/core/ext/filters/max_age/max_age_filter.cc
@@ -33,9 +33,9 @@
#define MAX_CONNECTION_AGE_JITTER 0.1
#define MAX_CONNECTION_AGE_INTEGER_OPTIONS \
- (grpc_integer_options) { DEFAULT_MAX_CONNECTION_AGE_MS, 1, INT_MAX }
+ { DEFAULT_MAX_CONNECTION_AGE_MS, 1, INT_MAX }
#define MAX_CONNECTION_IDLE_INTEGER_OPTIONS \
- (grpc_integer_options) { DEFAULT_MAX_CONNECTION_IDLE_MS, 1, INT_MAX }
+ { DEFAULT_MAX_CONNECTION_IDLE_MS, 1, INT_MAX }
typedef struct channel_data {
/* We take a reference to the channel stack for the timer callback */
@@ -315,8 +315,7 @@ static grpc_error* init_channel_elem(grpc_exec_ctx* exec_ctx,
GRPC_ARG_MAX_CONNECTION_AGE_GRACE_MS)) {
const int value = grpc_channel_arg_get_integer(
&args->channel_args->args[i],
- (grpc_integer_options){DEFAULT_MAX_CONNECTION_AGE_GRACE_MS, 0,
- INT_MAX});
+ {DEFAULT_MAX_CONNECTION_AGE_GRACE_MS, 0, INT_MAX});
chand->max_connection_age_grace =
value == INT_MAX ? gpr_inf_future(GPR_TIMESPAN)
: gpr_time_from_millis(value, GPR_TIMESPAN);
@@ -414,10 +413,10 @@ static bool maybe_add_max_age_filter(grpc_exec_ctx* exec_ctx,
}
}
-void grpc_max_age_filter_init(void) {
+extern "C" void grpc_max_age_filter_init(void) {
grpc_channel_init_register_stage(GRPC_SERVER_CHANNEL,
GRPC_CHANNEL_INIT_BUILTIN_PRIORITY,
maybe_add_max_age_filter, NULL);
}
-void grpc_max_age_filter_shutdown(void) {}
+extern "C" void grpc_max_age_filter_shutdown(void) {}
diff --git a/src/core/ext/filters/max_age/max_age_filter.h b/src/core/ext/filters/max_age/max_age_filter.h
index 68fb4a4ca5..eeeefd695e 100644
--- a/src/core/ext/filters/max_age/max_age_filter.h
+++ b/src/core/ext/filters/max_age/max_age_filter.h
@@ -19,6 +19,14 @@
#include "src/core/lib/channel/channel_stack.h"
+#ifdef __cplusplus
+extern "C" {
+#endif
+
extern const grpc_channel_filter grpc_max_age_filter;
+#ifdef __cplusplus
+}
+#endif
+
#endif /* GRPC_CORE_EXT_FILTERS_MAX_AGE_MAX_AGE_FILTER_H */
diff --git a/src/core/ext/filters/message_size/message_size_filter.c b/src/core/ext/filters/message_size/message_size_filter.cc
index 47763b1deb..5dc131b9f6 100644
--- a/src/core/ext/filters/message_size/message_size_filter.c
+++ b/src/core/ext/filters/message_size/message_size_filter.cc
@@ -288,7 +288,7 @@ static bool maybe_add_message_size_filter(grpc_exec_ctx* exec_ctx,
}
}
-void grpc_message_size_filter_init(void) {
+extern "C" void grpc_message_size_filter_init(void) {
grpc_channel_init_register_stage(GRPC_CLIENT_SUBCHANNEL,
GRPC_CHANNEL_INIT_BUILTIN_PRIORITY,
maybe_add_message_size_filter, NULL);
@@ -300,4 +300,4 @@ void grpc_message_size_filter_init(void) {
maybe_add_message_size_filter, NULL);
}
-void grpc_message_size_filter_shutdown(void) {}
+extern "C" void grpc_message_size_filter_shutdown(void) {}
diff --git a/src/core/ext/filters/message_size/message_size_filter.h b/src/core/ext/filters/message_size/message_size_filter.h
index d3667f7003..da325d6f89 100644
--- a/src/core/ext/filters/message_size/message_size_filter.h
+++ b/src/core/ext/filters/message_size/message_size_filter.h
@@ -19,6 +19,14 @@
#include "src/core/lib/channel/channel_stack.h"
+#ifdef __cplusplus
+extern "C" {
+#endif
+
extern const grpc_channel_filter grpc_message_size_filter;
+#ifdef __cplusplus
+}
+#endif
+
#endif /* GRPC_CORE_EXT_FILTERS_MESSAGE_SIZE_MESSAGE_SIZE_FILTER_H */
diff --git a/src/core/ext/filters/workarounds/workaround_cronet_compression_filter.c b/src/core/ext/filters/workarounds/workaround_cronet_compression_filter.cc
index c8b2fe5f99..f77ed02421 100644
--- a/src/core/ext/filters/workarounds/workaround_cronet_compression_filter.c
+++ b/src/core/ext/filters/workarounds/workaround_cronet_compression_filter.cc
@@ -196,7 +196,7 @@ static bool register_workaround_cronet_compression(
builder, &grpc_workaround_cronet_compression_filter, NULL, NULL);
}
-void grpc_workaround_cronet_compression_filter_init(void) {
+extern "C" void grpc_workaround_cronet_compression_filter_init(void) {
grpc_channel_init_register_stage(
GRPC_SERVER_CHANNEL, GRPC_WORKAROUND_PRIORITY_HIGH,
register_workaround_cronet_compression, NULL);
@@ -204,4 +204,4 @@ void grpc_workaround_cronet_compression_filter_init(void) {
parse_user_agent);
}
-void grpc_workaround_cronet_compression_filter_shutdown(void) {}
+extern "C" void grpc_workaround_cronet_compression_filter_shutdown(void) {}
diff --git a/src/core/ext/filters/workarounds/workaround_cronet_compression_filter.h b/src/core/ext/filters/workarounds/workaround_cronet_compression_filter.h
index 9dae4f0734..c8b07df63e 100644
--- a/src/core/ext/filters/workarounds/workaround_cronet_compression_filter.h
+++ b/src/core/ext/filters/workarounds/workaround_cronet_compression_filter.h
@@ -19,7 +19,15 @@
#include "src/core/lib/channel/channel_stack.h"
+#ifdef __cplusplus
+extern "C" {
+#endif
+
extern const grpc_channel_filter grpc_workaround_cronet_compression_filter;
+#ifdef __cplusplus
+}
+#endif
+
#endif /* GRPC_CORE_EXT_FILTERS_WORKAROUNDS_WORKAROUND_CRONET_COMPRESSION_FILTER_H \
*/
diff --git a/src/core/ext/filters/workarounds/workaround_utils.c b/src/core/ext/filters/workarounds/workaround_utils.cc
index e600fbee67..e600fbee67 100644
--- a/src/core/ext/filters/workarounds/workaround_utils.c
+++ b/src/core/ext/filters/workarounds/workaround_utils.cc
diff --git a/src/core/ext/filters/workarounds/workaround_utils.h b/src/core/ext/filters/workarounds/workaround_utils.h
index 2ad7a876d5..afd5291333 100644
--- a/src/core/ext/filters/workarounds/workaround_utils.h
+++ b/src/core/ext/filters/workarounds/workaround_utils.h
@@ -24,6 +24,10 @@
#define GRPC_WORKAROUND_PRIORITY_HIGH 10001
#define GRPC_WORKAROUND_PROIRITY_LOW 9999
+#ifdef __cplusplus
+extern "C" {
+#endif
+
typedef struct grpc_workaround_user_agent_md {
bool workaround_active[GRPC_MAX_WORKAROUND_ID];
} grpc_workaround_user_agent_md;
@@ -34,4 +38,8 @@ typedef bool (*user_agent_parser)(grpc_mdelem);
void grpc_register_workaround(uint32_t id, user_agent_parser parser);
-#endif /* GRPC_CORE_EXT_FILTERS_WORKAROUNDS_WORKAROUND_UTILS_H */
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* GRPC_CORE_EXT_FILTERS_WORKAROUNDS_WORKAROUND_UTILS_H */ \ No newline at end of file
diff --git a/src/core/ext/transport/chttp2/alpn/alpn.c b/src/core/ext/transport/chttp2/alpn/alpn.cc
index ca2e801ec8..ca2e801ec8 100644
--- a/src/core/ext/transport/chttp2/alpn/alpn.c
+++ b/src/core/ext/transport/chttp2/alpn/alpn.cc
diff --git a/src/core/ext/transport/chttp2/alpn/alpn.h b/src/core/ext/transport/chttp2/alpn/alpn.h
index 379af4b24c..5842204c20 100644
--- a/src/core/ext/transport/chttp2/alpn/alpn.h
+++ b/src/core/ext/transport/chttp2/alpn/alpn.h
@@ -21,6 +21,10 @@
#include <string.h>
+#ifdef __cplusplus
+extern "C" {
+#endif
+
/* Retuns 1 if the version is supported, 0 otherwise. */
int grpc_chttp2_is_alpn_version_supported(const char *version, size_t size);
@@ -31,4 +35,8 @@ size_t grpc_chttp2_num_alpn_versions(void);
* grpc_chttp2_num_alpn_versions()) */
const char *grpc_chttp2_get_alpn_version_index(size_t i);
-#endif /* GRPC_CORE_EXT_TRANSPORT_CHTTP2_ALPN_ALPN_H */
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* GRPC_CORE_EXT_TRANSPORT_CHTTP2_ALPN_ALPN_H */ \ No newline at end of file
diff --git a/src/core/ext/transport/chttp2/client/chttp2_connector.c b/src/core/ext/transport/chttp2/client/chttp2_connector.cc
index 202bcd47f5..202bcd47f5 100644
--- a/src/core/ext/transport/chttp2/client/chttp2_connector.c
+++ b/src/core/ext/transport/chttp2/client/chttp2_connector.cc
diff --git a/src/core/ext/transport/chttp2/client/chttp2_connector.h b/src/core/ext/transport/chttp2/client/chttp2_connector.h
index e258892cfc..63f264e0ef 100644
--- a/src/core/ext/transport/chttp2/client/chttp2_connector.h
+++ b/src/core/ext/transport/chttp2/client/chttp2_connector.h
@@ -19,8 +19,16 @@
#ifndef GRPC_CORE_EXT_TRANSPORT_CHTTP2_CLIENT_CHTTP2_CONNECTOR_H
#define GRPC_CORE_EXT_TRANSPORT_CHTTP2_CLIENT_CHTTP2_CONNECTOR_H
+#ifdef __cplusplus
+extern "C" {
+#endif
+
#include "src/core/ext/filters/client_channel/connector.h"
grpc_connector* grpc_chttp2_connector_create();
+#ifdef __cplusplus
+}
+#endif
+
#endif /* GRPC_CORE_EXT_TRANSPORT_CHTTP2_CLIENT_CHTTP2_CONNECTOR_H */
diff --git a/src/core/ext/transport/chttp2/client/insecure/channel_create.c b/src/core/ext/transport/chttp2/client/insecure/channel_create.cc
index 6410a6043d..6410a6043d 100644
--- a/src/core/ext/transport/chttp2/client/insecure/channel_create.c
+++ b/src/core/ext/transport/chttp2/client/insecure/channel_create.cc
diff --git a/src/core/ext/transport/chttp2/client/insecure/channel_create_posix.c b/src/core/ext/transport/chttp2/client/insecure/channel_create_posix.cc
index dd88136f7b..dd88136f7b 100644
--- a/src/core/ext/transport/chttp2/client/insecure/channel_create_posix.c
+++ b/src/core/ext/transport/chttp2/client/insecure/channel_create_posix.cc
diff --git a/src/core/ext/transport/chttp2/client/secure/secure_channel_create.c b/src/core/ext/transport/chttp2/client/secure/secure_channel_create.cc
index d4580f15f5..fe296cf4ff 100644
--- a/src/core/ext/transport/chttp2/client/secure/secure_channel_create.c
+++ b/src/core/ext/transport/chttp2/client/secure/secure_channel_create.cc
@@ -86,7 +86,8 @@ static grpc_subchannel_args *get_secure_naming_subchannel_args(
if (target_uri->path[0] != '\0') { // "path" may be empty
const grpc_slice key = grpc_slice_from_static_string(
target_uri->path[0] == '/' ? target_uri->path + 1 : target_uri->path);
- const char *value = grpc_slice_hash_table_get(targets_info, key);
+ const char *value =
+ (const char *)grpc_slice_hash_table_get(targets_info, key);
if (value != NULL) target_name_to_check = gpr_strdup(value);
grpc_slice_unref_internal(exec_ctx, key);
}
@@ -127,7 +128,8 @@ static grpc_subchannel_args *get_secure_naming_subchannel_args(
if (new_args_from_connector != NULL) {
grpc_channel_args_destroy(exec_ctx, new_args_from_connector);
}
- grpc_subchannel_args *final_sc_args = gpr_malloc(sizeof(*final_sc_args));
+ grpc_subchannel_args *final_sc_args =
+ (grpc_subchannel_args *)gpr_malloc(sizeof(*final_sc_args));
memcpy(final_sc_args, args, sizeof(*args));
final_sc_args->args = new_args;
return final_sc_args;
@@ -164,7 +166,7 @@ static grpc_channel *client_channel_factory_create_channel(
}
// Add channel arg containing the server URI.
grpc_arg arg = grpc_channel_arg_string_create(
- GRPC_ARG_SERVER_URI,
+ (char *)GRPC_ARG_SERVER_URI,
grpc_resolver_factory_add_default_prefix_if_needed(exec_ctx, target));
const char *to_remove[] = {GRPC_ARG_SERVER_URI};
grpc_channel_args *new_args =
diff --git a/src/core/ext/transport/chttp2/server/chttp2_server.c b/src/core/ext/transport/chttp2/server/chttp2_server.cc
index 60244e163b..a51959bec7 100644
--- a/src/core/ext/transport/chttp2/server/chttp2_server.c
+++ b/src/core/ext/transport/chttp2/server/chttp2_server.cc
@@ -20,6 +20,7 @@
#include <grpc/grpc.h>
+#include <inttypes.h>
#include <string.h>
#include <grpc/support/alloc.h>
diff --git a/src/core/ext/transport/chttp2/server/chttp2_server.h b/src/core/ext/transport/chttp2/server/chttp2_server.h
index ed968496f9..e1df28ed11 100644
--- a/src/core/ext/transport/chttp2/server/chttp2_server.h
+++ b/src/core/ext/transport/chttp2/server/chttp2_server.h
@@ -23,10 +23,18 @@
#include "src/core/lib/iomgr/exec_ctx.h"
+#ifdef __cplusplus
+extern "C" {
+#endif
+
/// Adds a port to \a server. Sets \a port_num to the port number.
/// Takes ownership of \a args.
grpc_error *grpc_chttp2_server_add_port(grpc_exec_ctx *exec_ctx,
grpc_server *server, const char *addr,
grpc_channel_args *args, int *port_num);
-#endif /* GRPC_CORE_EXT_TRANSPORT_CHTTP2_SERVER_CHTTP2_SERVER_H */
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* GRPC_CORE_EXT_TRANSPORT_CHTTP2_SERVER_CHTTP2_SERVER_H */ \ No newline at end of file
diff --git a/src/core/ext/transport/chttp2/server/insecure/server_chttp2.c b/src/core/ext/transport/chttp2/server/insecure/server_chttp2.cc
index d42b2d123e..d42b2d123e 100644
--- a/src/core/ext/transport/chttp2/server/insecure/server_chttp2.c
+++ b/src/core/ext/transport/chttp2/server/insecure/server_chttp2.cc
diff --git a/src/core/ext/transport/chttp2/server/insecure/server_chttp2_posix.c b/src/core/ext/transport/chttp2/server/insecure/server_chttp2_posix.cc
index e647067f73..e647067f73 100644
--- a/src/core/ext/transport/chttp2/server/insecure/server_chttp2_posix.c
+++ b/src/core/ext/transport/chttp2/server/insecure/server_chttp2_posix.cc
diff --git a/src/core/ext/transport/chttp2/server/secure/server_secure_chttp2.c b/src/core/ext/transport/chttp2/server/secure/server_secure_chttp2.cc
index 5ad63aaf1f..e74a138d23 100644
--- a/src/core/ext/transport/chttp2/server/secure/server_secure_chttp2.c
+++ b/src/core/ext/transport/chttp2/server/secure/server_secure_chttp2.cc
@@ -40,6 +40,8 @@ int grpc_server_add_secure_http2_port(grpc_server *server, const char *addr,
grpc_error *err = GRPC_ERROR_NONE;
grpc_server_security_connector *sc = NULL;
int port_num = 0;
+ grpc_security_status status;
+ grpc_channel_args *args = NULL;
GRPC_API_TRACE(
"grpc_server_add_secure_http2_port("
"server=%p, addr=%s, creds=%p)",
@@ -50,7 +52,7 @@ int grpc_server_add_secure_http2_port(grpc_server *server, const char *addr,
"No credentials specified for secure server port (creds==NULL)");
goto done;
}
- grpc_security_status status =
+ status =
grpc_server_credentials_create_security_connector(&exec_ctx, creds, &sc);
if (status != GRPC_SECURITY_OK) {
char *msg;
@@ -66,7 +68,7 @@ int grpc_server_add_secure_http2_port(grpc_server *server, const char *addr,
grpc_arg args_to_add[2];
args_to_add[0] = grpc_server_credentials_to_arg(creds);
args_to_add[1] = grpc_security_connector_to_arg(&sc->base);
- grpc_channel_args *args =
+ args =
grpc_channel_args_copy_and_add(grpc_server_get_channel_args(server),
args_to_add, GPR_ARRAY_SIZE(args_to_add));
// Add server port.
diff --git a/src/core/ext/transport/chttp2/transport/bin_decoder.c b/src/core/ext/transport/chttp2/transport/bin_decoder.cc
index 5a99cbeffc..5a99cbeffc 100644
--- a/src/core/ext/transport/chttp2/transport/bin_decoder.c
+++ b/src/core/ext/transport/chttp2/transport/bin_decoder.cc
diff --git a/src/core/ext/transport/chttp2/transport/bin_decoder.h b/src/core/ext/transport/chttp2/transport/bin_decoder.h
index 047b33d587..f50e0a8ac4 100644
--- a/src/core/ext/transport/chttp2/transport/bin_decoder.h
+++ b/src/core/ext/transport/chttp2/transport/bin_decoder.h
@@ -22,6 +22,10 @@
#include <grpc/slice.h>
#include <stdbool.h>
+#ifdef __cplusplus
+extern "C" {
+#endif
+
struct grpc_base64_decode_context {
/* input/output: */
uint8_t *input_cur;
@@ -49,4 +53,8 @@ grpc_slice grpc_chttp2_base64_decode_with_length(grpc_exec_ctx *exec_ctx,
grpc_slice input,
size_t output_length);
-#endif /* GRPC_CORE_EXT_TRANSPORT_CHTTP2_TRANSPORT_BIN_DECODER_H */
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* GRPC_CORE_EXT_TRANSPORT_CHTTP2_TRANSPORT_BIN_DECODER_H */ \ No newline at end of file
diff --git a/src/core/ext/transport/chttp2/transport/bin_encoder.c b/src/core/ext/transport/chttp2/transport/bin_encoder.cc
index 42d481b3c0..42d481b3c0 100644
--- a/src/core/ext/transport/chttp2/transport/bin_encoder.c
+++ b/src/core/ext/transport/chttp2/transport/bin_encoder.cc
diff --git a/src/core/ext/transport/chttp2/transport/bin_encoder.h b/src/core/ext/transport/chttp2/transport/bin_encoder.h
index a8f36a345a..ae8219c5ce 100644
--- a/src/core/ext/transport/chttp2/transport/bin_encoder.h
+++ b/src/core/ext/transport/chttp2/transport/bin_encoder.h
@@ -21,6 +21,10 @@
#include <grpc/slice.h>
+#ifdef __cplusplus
+extern "C" {
+#endif
+
/* base64 encode a slice. Returns a new slice, does not take ownership of the
input */
grpc_slice grpc_chttp2_base64_encode(grpc_slice input);
@@ -36,4 +40,8 @@ grpc_slice grpc_chttp2_huffman_compress(grpc_slice input);
return y; */
grpc_slice grpc_chttp2_base64_encode_and_huffman_compress(grpc_slice input);
-#endif /* GRPC_CORE_EXT_TRANSPORT_CHTTP2_TRANSPORT_BIN_ENCODER_H */
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* GRPC_CORE_EXT_TRANSPORT_CHTTP2_TRANSPORT_BIN_ENCODER_H */ \ No newline at end of file
diff --git a/src/core/ext/transport/chttp2/transport/chttp2_plugin.c b/src/core/ext/transport/chttp2/transport/chttp2_plugin.cc
index 6d09953830..ac9ae5c395 100644
--- a/src/core/ext/transport/chttp2/transport/chttp2_plugin.c
+++ b/src/core/ext/transport/chttp2/transport/chttp2_plugin.cc
@@ -20,7 +20,7 @@
#include "src/core/lib/debug/trace.h"
#include "src/core/lib/transport/metadata.h"
-void grpc_chttp2_plugin_init(void) {
+extern "C" void grpc_chttp2_plugin_init(void) {
grpc_register_tracer(&grpc_http_trace);
grpc_register_tracer(&grpc_flowctl_trace);
grpc_register_tracer(&grpc_trace_http2_stream_state);
@@ -29,4 +29,4 @@ void grpc_chttp2_plugin_init(void) {
#endif
}
-void grpc_chttp2_plugin_shutdown(void) {}
+extern "C" void grpc_chttp2_plugin_shutdown(void) {}
diff --git a/src/core/ext/transport/chttp2/transport/chttp2_transport.c b/src/core/ext/transport/chttp2/transport/chttp2_transport.cc
index 70895abcc4..65167c03bb 100644
--- a/src/core/ext/transport/chttp2/transport/chttp2_transport.c
+++ b/src/core/ext/transport/chttp2/transport/chttp2_transport.cc
@@ -18,6 +18,9 @@
#include "src/core/ext/transport/chttp2/transport/chttp2_transport.h"
+#include <grpc/support/port_platform.h>
+
+#include <inttypes.h>
#include <limits.h>
#include <math.h>
#include <stdio.h>
@@ -315,15 +318,16 @@ static void init_transport(grpc_exec_ctx *exec_ctx, grpc_chttp2_transport *t,
grpc_bdp_estimator_init(&t->flow_control.bdp_estimator, t->peer_string);
t->flow_control.last_pid_update = gpr_now(GPR_CLOCK_MONOTONIC);
- grpc_pid_controller_init(
- &t->flow_control.pid_controller,
- (grpc_pid_controller_args){.gain_p = 4,
- .gain_i = 8,
- .gain_d = 0,
- .initial_control_value = log2(DEFAULT_WINDOW),
- .min_control_value = -1,
- .max_control_value = 25,
- .integral_range = 10});
+ grpc_pid_controller_init(&t->flow_control.pid_controller,
+ {
+ 4, /* gain_p */
+ 8, /* gain_t */
+ 0, /* gain_d */
+ log2(DEFAULT_WINDOW), /* initial_control_value */
+ -1, /* min_control_value */
+ 25, /* max_control_value */
+ 10 /* integral_range */
+ });
grpc_chttp2_goaway_parser_init(&t->goaway_parser);
grpc_chttp2_hpack_parser_init(exec_ctx, &t->hpack_parser);
@@ -433,13 +437,11 @@ static void init_transport(grpc_exec_ctx *exec_ctx, grpc_chttp2_transport *t,
GRPC_ARG_HTTP2_MAX_PINGS_WITHOUT_DATA)) {
t->ping_policy.max_pings_without_data = grpc_channel_arg_get_integer(
&channel_args->args[i],
- (grpc_integer_options){g_default_max_pings_without_data, 0,
- INT_MAX});
+ {g_default_max_pings_without_data, 0, INT_MAX});
} else if (0 == strcmp(channel_args->args[i].key,
GRPC_ARG_HTTP2_MAX_PING_STRIKES)) {
t->ping_policy.max_ping_strikes = grpc_channel_arg_get_integer(
- &channel_args->args[i],
- (grpc_integer_options){g_default_max_ping_strikes, 0, INT_MAX});
+ &channel_args->args[i], {g_default_max_ping_strikes, 0, INT_MAX});
} else if (0 ==
strcmp(
channel_args->args[i].key,
@@ -448,9 +450,8 @@ static void init_transport(grpc_exec_ctx *exec_ctx, grpc_chttp2_transport *t,
gpr_time_from_millis(
grpc_channel_arg_get_integer(
&channel_args->args[i],
- (grpc_integer_options){
- g_default_min_sent_ping_interval_without_data_ms, 0,
- INT_MAX}),
+ {g_default_min_sent_ping_interval_without_data_ms, 0,
+ INT_MAX}),
GPR_TIMESPAN);
} else if (0 ==
strcmp(
@@ -460,27 +461,24 @@ static void init_transport(grpc_exec_ctx *exec_ctx, grpc_chttp2_transport *t,
gpr_time_from_millis(
grpc_channel_arg_get_integer(
&channel_args->args[i],
- (grpc_integer_options){
- g_default_min_recv_ping_interval_without_data_ms, 0,
- INT_MAX}),
+ {g_default_min_recv_ping_interval_without_data_ms, 0,
+ INT_MAX}),
GPR_TIMESPAN);
} else if (0 == strcmp(channel_args->args[i].key,
GRPC_ARG_HTTP2_WRITE_BUFFER_SIZE)) {
t->write_buffer_size = (uint32_t)grpc_channel_arg_get_integer(
- &channel_args->args[i],
- (grpc_integer_options){0, 0, MAX_WRITE_BUFFER_SIZE});
+ &channel_args->args[i], {0, 0, MAX_WRITE_BUFFER_SIZE});
} else if (0 ==
strcmp(channel_args->args[i].key, GRPC_ARG_HTTP2_BDP_PROBE)) {
- t->flow_control.enable_bdp_probe = grpc_channel_arg_get_integer(
- &channel_args->args[i], (grpc_integer_options){1, 0, 1});
+ t->flow_control.enable_bdp_probe =
+ grpc_channel_arg_get_integer(&channel_args->args[i], {1, 0, 1});
} else if (0 == strcmp(channel_args->args[i].key,
GRPC_ARG_KEEPALIVE_TIME_MS)) {
const int value = grpc_channel_arg_get_integer(
&channel_args->args[i],
- (grpc_integer_options){t->is_client
- ? g_default_client_keepalive_time_ms
- : g_default_server_keepalive_time_ms,
- 1, INT_MAX});
+ {t->is_client ? g_default_client_keepalive_time_ms
+ : g_default_server_keepalive_time_ms,
+ 1, INT_MAX});
t->keepalive_time = value == INT_MAX
? gpr_inf_future(GPR_TIMESPAN)
: gpr_time_from_millis(value, GPR_TIMESPAN);
@@ -488,18 +486,17 @@ static void init_transport(grpc_exec_ctx *exec_ctx, grpc_chttp2_transport *t,
GRPC_ARG_KEEPALIVE_TIMEOUT_MS)) {
const int value = grpc_channel_arg_get_integer(
&channel_args->args[i],
- (grpc_integer_options){t->is_client
- ? g_default_client_keepalive_timeout_ms
- : g_default_server_keepalive_timeout_ms,
- 0, INT_MAX});
+ {t->is_client ? g_default_client_keepalive_timeout_ms
+ : g_default_server_keepalive_timeout_ms,
+ 0, INT_MAX});
t->keepalive_timeout = value == INT_MAX
? gpr_inf_future(GPR_TIMESPAN)
: gpr_time_from_millis(value, GPR_TIMESPAN);
} else if (0 == strcmp(channel_args->args[i].key,
GRPC_ARG_KEEPALIVE_PERMIT_WITHOUT_CALLS)) {
t->keepalive_permit_without_calls =
- (uint32_t)grpc_channel_arg_get_integer(
- &channel_args->args[i], (grpc_integer_options){0, 0, 1});
+ (uint32_t)grpc_channel_arg_get_integer(&channel_args->args[i],
+ {0, 0, 1});
} else if (0 == strcmp(channel_args->args[i].key,
GRPC_ARG_OPTIMIZATION_TARGET)) {
if (channel_args->args[i].type != GRPC_ARG_STRING) {
@@ -2628,9 +2625,7 @@ void grpc_chttp2_config_default_keepalive_args(grpc_channel_args *args,
for (i = 0; i < args->num_args; i++) {
if (0 == strcmp(args->args[i].key, GRPC_ARG_KEEPALIVE_TIME_MS)) {
const int value = grpc_channel_arg_get_integer(
- &args->args[i],
- (grpc_integer_options){g_default_client_keepalive_time_ms, 1,
- INT_MAX});
+ &args->args[i], {g_default_client_keepalive_time_ms, 1, INT_MAX});
if (is_client) {
g_default_client_keepalive_time_ms = value;
} else {
@@ -2640,8 +2635,7 @@ void grpc_chttp2_config_default_keepalive_args(grpc_channel_args *args,
strcmp(args->args[i].key, GRPC_ARG_KEEPALIVE_TIMEOUT_MS)) {
const int value = grpc_channel_arg_get_integer(
&args->args[i],
- (grpc_integer_options){g_default_client_keepalive_timeout_ms, 0,
- INT_MAX});
+ {g_default_client_keepalive_timeout_ms, 0, INT_MAX});
if (is_client) {
g_default_client_keepalive_timeout_ms = value;
} else {
@@ -2652,18 +2646,15 @@ void grpc_chttp2_config_default_keepalive_args(grpc_channel_args *args,
g_default_keepalive_permit_without_calls =
(uint32_t)grpc_channel_arg_get_integer(
&args->args[i],
- (grpc_integer_options){g_default_keepalive_permit_without_calls,
- 0, 1});
+ {g_default_keepalive_permit_without_calls, 0, 1});
} else if (0 ==
strcmp(args->args[i].key, GRPC_ARG_HTTP2_MAX_PING_STRIKES)) {
g_default_max_ping_strikes = grpc_channel_arg_get_integer(
- &args->args[i],
- (grpc_integer_options){g_default_max_ping_strikes, 0, INT_MAX});
+ &args->args[i], {g_default_max_ping_strikes, 0, INT_MAX});
} else if (0 == strcmp(args->args[i].key,
GRPC_ARG_HTTP2_MAX_PINGS_WITHOUT_DATA)) {
g_default_max_pings_without_data = grpc_channel_arg_get_integer(
- &args->args[i], (grpc_integer_options){
- g_default_max_pings_without_data, 0, INT_MAX});
+ &args->args[i], {g_default_max_pings_without_data, 0, INT_MAX});
} else if (0 ==
strcmp(
args->args[i].key,
@@ -2671,9 +2662,7 @@ void grpc_chttp2_config_default_keepalive_args(grpc_channel_args *args,
g_default_min_sent_ping_interval_without_data_ms =
grpc_channel_arg_get_integer(
&args->args[i],
- (grpc_integer_options){
- g_default_min_sent_ping_interval_without_data_ms, 0,
- INT_MAX});
+ {g_default_min_sent_ping_interval_without_data_ms, 0, INT_MAX});
} else if (0 ==
strcmp(
args->args[i].key,
@@ -2681,9 +2670,7 @@ void grpc_chttp2_config_default_keepalive_args(grpc_channel_args *args,
g_default_min_recv_ping_interval_without_data_ms =
grpc_channel_arg_get_integer(
&args->args[i],
- (grpc_integer_options){
- g_default_min_recv_ping_interval_without_data_ms, 0,
- INT_MAX});
+ {g_default_min_recv_ping_interval_without_data_ms, 0, INT_MAX});
}
}
}
diff --git a/src/core/ext/transport/chttp2/transport/chttp2_transport.h b/src/core/ext/transport/chttp2/transport/chttp2_transport.h
index 55fb1a8343..321fca4c82 100644
--- a/src/core/ext/transport/chttp2/transport/chttp2_transport.h
+++ b/src/core/ext/transport/chttp2/transport/chttp2_transport.h
@@ -23,6 +23,10 @@
#include "src/core/lib/iomgr/endpoint.h"
#include "src/core/lib/transport/transport.h"
+#ifdef __cplusplus
+extern "C" {
+#endif
+
extern grpc_tracer_flag grpc_http_trace;
extern grpc_tracer_flag grpc_flowctl_trace;
extern grpc_tracer_flag grpc_trace_http2_stream_state;
@@ -41,4 +45,8 @@ void grpc_chttp2_transport_start_reading(grpc_exec_ctx *exec_ctx,
grpc_transport *transport,
grpc_slice_buffer *read_buffer);
+#ifdef __cplusplus
+}
+#endif
+
#endif /* GRPC_CORE_EXT_TRANSPORT_CHTTP2_TRANSPORT_CHTTP2_TRANSPORT_H */
diff --git a/src/core/ext/transport/chttp2/transport/flow_control.c b/src/core/ext/transport/chttp2/transport/flow_control.cc
index 569a6349d3..75eae1f962 100644
--- a/src/core/ext/transport/chttp2/transport/flow_control.c
+++ b/src/core/ext/transport/chttp2/transport/flow_control.cc
@@ -18,6 +18,7 @@
#include "src/core/ext/transport/chttp2/transport/internal.h"
+#include <inttypes.h>
#include <limits.h>
#include <math.h>
#include <string.h>
@@ -86,7 +87,7 @@ static char* fmt_uint32_diff_str(uint32_t old_val, uint32_t new_val) {
static void posttrace(shadow_flow_control* shadow_fc,
grpc_chttp2_transport_flowctl* tfc,
- grpc_chttp2_stream_flowctl* sfc, char* reason) {
+ grpc_chttp2_stream_flowctl* sfc, const char* reason) {
uint32_t acked_local_window =
tfc->t->settings[GRPC_SENT_SETTINGS]
[GRPC_CHTTP2_SETTINGS_INITIAL_WINDOW_SIZE];
@@ -128,7 +129,7 @@ static void posttrace(shadow_flow_control* shadow_fc,
gpr_free(saw_str);
}
-static char* urgency_to_string(grpc_chttp2_flowctl_urgency urgency) {
+static const char* urgency_to_string(grpc_chttp2_flowctl_urgency urgency) {
switch (urgency) {
case GRPC_CHTTP2_FLOWCTL_NO_ACTION_NEEDED:
return "no action";
diff --git a/src/core/ext/transport/chttp2/transport/frame.h b/src/core/ext/transport/chttp2/transport/frame.h
index dba4c004ec..e7debdad79 100644
--- a/src/core/ext/transport/chttp2/transport/frame.h
+++ b/src/core/ext/transport/chttp2/transport/frame.h
@@ -24,6 +24,10 @@
#include "src/core/lib/iomgr/error.h"
+#ifdef __cplusplus
+extern "C" {
+#endif
+
/* defined in internal.h */
typedef struct grpc_chttp2_stream grpc_chttp2_stream;
typedef struct grpc_chttp2_transport grpc_chttp2_transport;
@@ -43,4 +47,8 @@ typedef struct grpc_chttp2_transport grpc_chttp2_transport;
#define GRPC_CHTTP2_DATA_FLAG_PADDED 8
#define GRPC_CHTTP2_FLAG_HAS_PRIORITY 0x20
+#ifdef __cplusplus
+}
+#endif
+
#endif /* GRPC_CORE_EXT_TRANSPORT_CHTTP2_TRANSPORT_FRAME_H */
diff --git a/src/core/ext/transport/chttp2/transport/frame_data.c b/src/core/ext/transport/chttp2/transport/frame_data.cc
index 73aaab1802..73aaab1802 100644
--- a/src/core/ext/transport/chttp2/transport/frame_data.c
+++ b/src/core/ext/transport/chttp2/transport/frame_data.cc
diff --git a/src/core/ext/transport/chttp2/transport/frame_data.h b/src/core/ext/transport/chttp2/transport/frame_data.h
index 3f1c787847..2df99ccf98 100644
--- a/src/core/ext/transport/chttp2/transport/frame_data.h
+++ b/src/core/ext/transport/chttp2/transport/frame_data.h
@@ -28,6 +28,10 @@
#include "src/core/lib/transport/byte_stream.h"
#include "src/core/lib/transport/transport.h"
+#ifdef __cplusplus
+extern "C" {
+#endif
+
typedef enum {
GRPC_CHTTP2_DATA_FH_0,
GRPC_CHTTP2_DATA_FH_1,
@@ -80,4 +84,8 @@ grpc_error *grpc_deframe_unprocessed_incoming_frames(
grpc_slice_buffer *slices, grpc_slice *slice_out,
grpc_byte_stream **stream_out);
-#endif /* GRPC_CORE_EXT_TRANSPORT_CHTTP2_TRANSPORT_FRAME_DATA_H */
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* GRPC_CORE_EXT_TRANSPORT_CHTTP2_TRANSPORT_FRAME_DATA_H */ \ No newline at end of file
diff --git a/src/core/ext/transport/chttp2/transport/frame_goaway.c b/src/core/ext/transport/chttp2/transport/frame_goaway.cc
index 78ec08e177..78ec08e177 100644
--- a/src/core/ext/transport/chttp2/transport/frame_goaway.c
+++ b/src/core/ext/transport/chttp2/transport/frame_goaway.cc
diff --git a/src/core/ext/transport/chttp2/transport/frame_goaway.h b/src/core/ext/transport/chttp2/transport/frame_goaway.h
index abc48f30c6..ce6f18b35c 100644
--- a/src/core/ext/transport/chttp2/transport/frame_goaway.h
+++ b/src/core/ext/transport/chttp2/transport/frame_goaway.h
@@ -25,6 +25,10 @@
#include "src/core/ext/transport/chttp2/transport/frame.h"
#include "src/core/lib/iomgr/exec_ctx.h"
+#ifdef __cplusplus
+extern "C" {
+#endif
+
typedef enum {
GRPC_CHTTP2_GOAWAY_LSI0,
GRPC_CHTTP2_GOAWAY_LSI1,
@@ -60,4 +64,8 @@ void grpc_chttp2_goaway_append(uint32_t last_stream_id, uint32_t error_code,
grpc_slice debug_data,
grpc_slice_buffer *slice_buffer);
-#endif /* GRPC_CORE_EXT_TRANSPORT_CHTTP2_TRANSPORT_FRAME_GOAWAY_H */
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* GRPC_CORE_EXT_TRANSPORT_CHTTP2_TRANSPORT_FRAME_GOAWAY_H */ \ No newline at end of file
diff --git a/src/core/ext/transport/chttp2/transport/frame_ping.c b/src/core/ext/transport/chttp2/transport/frame_ping.cc
index d431d6b2df..d431d6b2df 100644
--- a/src/core/ext/transport/chttp2/transport/frame_ping.c
+++ b/src/core/ext/transport/chttp2/transport/frame_ping.cc
diff --git a/src/core/ext/transport/chttp2/transport/frame_ping.h b/src/core/ext/transport/chttp2/transport/frame_ping.h
index 5969ace9bd..91f16f050f 100644
--- a/src/core/ext/transport/chttp2/transport/frame_ping.h
+++ b/src/core/ext/transport/chttp2/transport/frame_ping.h
@@ -23,6 +23,10 @@
#include "src/core/ext/transport/chttp2/transport/frame.h"
#include "src/core/lib/iomgr/exec_ctx.h"
+#ifdef __cplusplus
+extern "C" {
+#endif
+
typedef struct {
uint8_t byte;
uint8_t is_ack;
@@ -41,4 +45,8 @@ grpc_error *grpc_chttp2_ping_parser_parse(grpc_exec_ctx *exec_ctx, void *parser,
/* Test-only function for disabling ping ack */
void grpc_set_disable_ping_ack(bool disable_ping_ack);
-#endif /* GRPC_CORE_EXT_TRANSPORT_CHTTP2_TRANSPORT_FRAME_PING_H */
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* GRPC_CORE_EXT_TRANSPORT_CHTTP2_TRANSPORT_FRAME_PING_H */ \ No newline at end of file
diff --git a/src/core/ext/transport/chttp2/transport/frame_rst_stream.c b/src/core/ext/transport/chttp2/transport/frame_rst_stream.cc
index 0133b6efa2..0133b6efa2 100644
--- a/src/core/ext/transport/chttp2/transport/frame_rst_stream.c
+++ b/src/core/ext/transport/chttp2/transport/frame_rst_stream.cc
diff --git a/src/core/ext/transport/chttp2/transport/frame_rst_stream.h b/src/core/ext/transport/chttp2/transport/frame_rst_stream.h
index d088221b52..bdca064a91 100644
--- a/src/core/ext/transport/chttp2/transport/frame_rst_stream.h
+++ b/src/core/ext/transport/chttp2/transport/frame_rst_stream.h
@@ -24,6 +24,10 @@
#include "src/core/lib/iomgr/exec_ctx.h"
#include "src/core/lib/transport/transport.h"
+#ifdef __cplusplus
+extern "C" {
+#endif
+
typedef struct {
uint8_t byte;
uint8_t reason_bytes[4];
@@ -40,4 +44,8 @@ grpc_error *grpc_chttp2_rst_stream_parser_parse(grpc_exec_ctx *exec_ctx,
grpc_chttp2_stream *s,
grpc_slice slice, int is_last);
-#endif /* GRPC_CORE_EXT_TRANSPORT_CHTTP2_TRANSPORT_FRAME_RST_STREAM_H */
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* GRPC_CORE_EXT_TRANSPORT_CHTTP2_TRANSPORT_FRAME_RST_STREAM_H */ \ No newline at end of file
diff --git a/src/core/ext/transport/chttp2/transport/frame_settings.c b/src/core/ext/transport/chttp2/transport/frame_settings.cc
index 2995bf7310..2995bf7310 100644
--- a/src/core/ext/transport/chttp2/transport/frame_settings.c
+++ b/src/core/ext/transport/chttp2/transport/frame_settings.cc
diff --git a/src/core/ext/transport/chttp2/transport/frame_settings.h b/src/core/ext/transport/chttp2/transport/frame_settings.h
index 47479d675d..f0793f0e73 100644
--- a/src/core/ext/transport/chttp2/transport/frame_settings.h
+++ b/src/core/ext/transport/chttp2/transport/frame_settings.h
@@ -25,6 +25,10 @@
#include "src/core/ext/transport/chttp2/transport/http2_settings.h"
#include "src/core/lib/iomgr/exec_ctx.h"
+#ifdef __cplusplus
+extern "C" {
+#endif
+
typedef enum {
GRPC_CHTTP2_SPS_ID0,
GRPC_CHTTP2_SPS_ID1,
@@ -58,4 +62,8 @@ grpc_error *grpc_chttp2_settings_parser_parse(grpc_exec_ctx *exec_ctx,
grpc_chttp2_stream *s,
grpc_slice slice, int is_last);
-#endif /* GRPC_CORE_EXT_TRANSPORT_CHTTP2_TRANSPORT_FRAME_SETTINGS_H */
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* GRPC_CORE_EXT_TRANSPORT_CHTTP2_TRANSPORT_FRAME_SETTINGS_H */ \ No newline at end of file
diff --git a/src/core/ext/transport/chttp2/transport/frame_window_update.c b/src/core/ext/transport/chttp2/transport/frame_window_update.cc
index c9ab8d1b50..c9ab8d1b50 100644
--- a/src/core/ext/transport/chttp2/transport/frame_window_update.c
+++ b/src/core/ext/transport/chttp2/transport/frame_window_update.cc
diff --git a/src/core/ext/transport/chttp2/transport/frame_window_update.h b/src/core/ext/transport/chttp2/transport/frame_window_update.h
index 698da4e351..29cf0cc740 100644
--- a/src/core/ext/transport/chttp2/transport/frame_window_update.h
+++ b/src/core/ext/transport/chttp2/transport/frame_window_update.h
@@ -24,6 +24,10 @@
#include "src/core/lib/iomgr/exec_ctx.h"
#include "src/core/lib/transport/transport.h"
+#ifdef __cplusplus
+extern "C" {
+#endif
+
typedef struct {
uint8_t byte;
uint8_t is_connection_update;
@@ -39,4 +43,8 @@ grpc_error *grpc_chttp2_window_update_parser_parse(
grpc_exec_ctx *exec_ctx, void *parser, grpc_chttp2_transport *t,
grpc_chttp2_stream *s, grpc_slice slice, int is_last);
-#endif /* GRPC_CORE_EXT_TRANSPORT_CHTTP2_TRANSPORT_FRAME_WINDOW_UPDATE_H */
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* GRPC_CORE_EXT_TRANSPORT_CHTTP2_TRANSPORT_FRAME_WINDOW_UPDATE_H */ \ No newline at end of file
diff --git a/src/core/ext/transport/chttp2/transport/hpack_encoder.c b/src/core/ext/transport/chttp2/transport/hpack_encoder.cc
index a404b664e3..5f1a2708a5 100644
--- a/src/core/ext/transport/chttp2/transport/hpack_encoder.c
+++ b/src/core/ext/transport/chttp2/transport/hpack_encoder.cc
@@ -57,7 +57,7 @@ static const grpc_slice terminal_slice = {
{{0, 0}} /* data.refcounted */
};
-extern grpc_tracer_flag grpc_http_trace;
+extern "C" grpc_tracer_flag grpc_http_trace;
typedef struct {
int is_first_frame;
diff --git a/src/core/ext/transport/chttp2/transport/hpack_encoder.h b/src/core/ext/transport/chttp2/transport/hpack_encoder.h
index 271192f894..dc28b5566a 100644
--- a/src/core/ext/transport/chttp2/transport/hpack_encoder.h
+++ b/src/core/ext/transport/chttp2/transport/hpack_encoder.h
@@ -34,6 +34,10 @@
/* maximum table size we'll actually use */
#define GRPC_CHTTP2_HPACKC_MAX_TABLE_SIZE (1024 * 1024)
+#ifdef __cplusplus
+extern "C" {
+#endif
+
typedef struct {
uint32_t filter_elems_sum;
uint32_t max_table_size;
@@ -91,4 +95,8 @@ void grpc_chttp2_encode_header(grpc_exec_ctx *exec_ctx,
const grpc_encode_header_options *options,
grpc_slice_buffer *outbuf);
-#endif /* GRPC_CORE_EXT_TRANSPORT_CHTTP2_TRANSPORT_HPACK_ENCODER_H */
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* GRPC_CORE_EXT_TRANSPORT_CHTTP2_TRANSPORT_HPACK_ENCODER_H */ \ No newline at end of file
diff --git a/src/core/ext/transport/chttp2/transport/hpack_parser.c b/src/core/ext/transport/chttp2/transport/hpack_parser.cc
index 3d1df19bc3..3d1df19bc3 100644
--- a/src/core/ext/transport/chttp2/transport/hpack_parser.c
+++ b/src/core/ext/transport/chttp2/transport/hpack_parser.cc
diff --git a/src/core/ext/transport/chttp2/transport/hpack_parser.h b/src/core/ext/transport/chttp2/transport/hpack_parser.h
index 8fbc6a602b..6c36ebdf8d 100644
--- a/src/core/ext/transport/chttp2/transport/hpack_parser.h
+++ b/src/core/ext/transport/chttp2/transport/hpack_parser.h
@@ -27,6 +27,10 @@
#include "src/core/lib/iomgr/exec_ctx.h"
#include "src/core/lib/transport/metadata.h"
+#ifdef __cplusplus
+extern "C" {
+#endif
+
typedef struct grpc_chttp2_hpack_parser grpc_chttp2_hpack_parser;
typedef grpc_error *(*grpc_chttp2_hpack_parser_state)(
@@ -111,4 +115,8 @@ grpc_error *grpc_chttp2_header_parser_parse(grpc_exec_ctx *exec_ctx,
grpc_chttp2_stream *s,
grpc_slice slice, int is_last);
-#endif /* GRPC_CORE_EXT_TRANSPORT_CHTTP2_TRANSPORT_HPACK_PARSER_H */
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* GRPC_CORE_EXT_TRANSPORT_CHTTP2_TRANSPORT_HPACK_PARSER_H */ \ No newline at end of file
diff --git a/src/core/ext/transport/chttp2/transport/hpack_table.c b/src/core/ext/transport/chttp2/transport/hpack_table.cc
index bbd135a318..82c284b36e 100644
--- a/src/core/ext/transport/chttp2/transport/hpack_table.c
+++ b/src/core/ext/transport/chttp2/transport/hpack_table.cc
@@ -28,7 +28,7 @@
#include "src/core/lib/debug/trace.h"
#include "src/core/lib/support/murmur_hash.h"
-extern grpc_tracer_flag grpc_http_trace;
+extern "C" grpc_tracer_flag grpc_http_trace;
static struct {
const char *key;
diff --git a/src/core/ext/transport/chttp2/transport/hpack_table.h b/src/core/ext/transport/chttp2/transport/hpack_table.h
index 2cf8f68506..a3ce2730a8 100644
--- a/src/core/ext/transport/chttp2/transport/hpack_table.h
+++ b/src/core/ext/transport/chttp2/transport/hpack_table.h
@@ -24,6 +24,10 @@
#include "src/core/lib/iomgr/error.h"
#include "src/core/lib/transport/metadata.h"
+#ifdef __cplusplus
+extern "C" {
+#endif
+
/* HPACK header table */
/* last index in the static table */
@@ -94,4 +98,8 @@ typedef struct {
grpc_chttp2_hptbl_find_result grpc_chttp2_hptbl_find(
const grpc_chttp2_hptbl *tbl, grpc_mdelem md);
+#ifdef __cplusplus
+}
+#endif
+
#endif /* GRPC_CORE_EXT_TRANSPORT_CHTTP2_TRANSPORT_HPACK_TABLE_H */
diff --git a/src/core/ext/transport/chttp2/transport/http2_settings.c b/src/core/ext/transport/chttp2/transport/http2_settings.cc
index 46b7c0c49c..46b7c0c49c 100644
--- a/src/core/ext/transport/chttp2/transport/http2_settings.c
+++ b/src/core/ext/transport/chttp2/transport/http2_settings.cc
diff --git a/src/core/ext/transport/chttp2/transport/http2_settings.h b/src/core/ext/transport/chttp2/transport/http2_settings.h
index 706dfc3139..01e80b8d01 100644
--- a/src/core/ext/transport/chttp2/transport/http2_settings.h
+++ b/src/core/ext/transport/chttp2/transport/http2_settings.h
@@ -35,6 +35,10 @@ typedef enum {
} grpc_chttp2_setting_id;
#define GRPC_CHTTP2_NUM_SETTINGS 7
+
+#ifdef __cplusplus
+extern "C" {
+#endif
extern const uint16_t grpc_setting_id_to_wire_id[];
bool grpc_wire_id_to_setting_id(uint32_t wire_id, grpc_chttp2_setting_id *out);
@@ -56,4 +60,8 @@ typedef struct {
extern const grpc_chttp2_setting_parameters
grpc_chttp2_settings_parameters[GRPC_CHTTP2_NUM_SETTINGS];
-#endif /* GRPC_CORE_EXT_TRANSPORT_CHTTP2_TRANSPORT_HTTP2_SETTINGS_H */
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* GRPC_CORE_EXT_TRANSPORT_CHTTP2_TRANSPORT_HTTP2_SETTINGS_H */ \ No newline at end of file
diff --git a/src/core/ext/transport/chttp2/transport/huffsyms.c b/src/core/ext/transport/chttp2/transport/huffsyms.cc
index f28d8cc30a..f28d8cc30a 100644
--- a/src/core/ext/transport/chttp2/transport/huffsyms.c
+++ b/src/core/ext/transport/chttp2/transport/huffsyms.cc
diff --git a/src/core/ext/transport/chttp2/transport/huffsyms.h b/src/core/ext/transport/chttp2/transport/huffsyms.h
index 2e2a5dacae..4002706bc0 100644
--- a/src/core/ext/transport/chttp2/transport/huffsyms.h
+++ b/src/core/ext/transport/chttp2/transport/huffsyms.h
@@ -19,6 +19,10 @@
#ifndef GRPC_CORE_EXT_TRANSPORT_CHTTP2_TRANSPORT_HUFFSYMS_H
#define GRPC_CORE_EXT_TRANSPORT_CHTTP2_TRANSPORT_HUFFSYMS_H
+#ifdef __cplusplus
+extern "C" {
+#endif
+
/* HPACK static huffman table */
#define GRPC_CHTTP2_NUM_HUFFSYMS 257
@@ -30,4 +34,8 @@ typedef struct {
extern const grpc_chttp2_huffsym grpc_chttp2_huffsyms[GRPC_CHTTP2_NUM_HUFFSYMS];
+#ifdef __cplusplus
+}
+#endif
+
#endif /* GRPC_CORE_EXT_TRANSPORT_CHTTP2_TRANSPORT_HUFFSYMS_H */
diff --git a/src/core/ext/transport/chttp2/transport/incoming_metadata.c b/src/core/ext/transport/chttp2/transport/incoming_metadata.cc
index ba680a89db..ba680a89db 100644
--- a/src/core/ext/transport/chttp2/transport/incoming_metadata.c
+++ b/src/core/ext/transport/chttp2/transport/incoming_metadata.cc
diff --git a/src/core/ext/transport/chttp2/transport/incoming_metadata.h b/src/core/ext/transport/chttp2/transport/incoming_metadata.h
index a951d8764c..9ffcabd0b9 100644
--- a/src/core/ext/transport/chttp2/transport/incoming_metadata.h
+++ b/src/core/ext/transport/chttp2/transport/incoming_metadata.h
@@ -21,6 +21,10 @@
#include "src/core/lib/transport/transport.h"
+#ifdef __cplusplus
+extern "C" {
+#endif
+
typedef struct {
gpr_arena *arena;
grpc_metadata_batch batch;
@@ -45,4 +49,8 @@ grpc_error *grpc_chttp2_incoming_metadata_buffer_replace_or_add(
void grpc_chttp2_incoming_metadata_buffer_set_deadline(
grpc_chttp2_incoming_metadata_buffer *buffer, gpr_timespec deadline);
-#endif /* GRPC_CORE_EXT_TRANSPORT_CHTTP2_TRANSPORT_INCOMING_METADATA_H */
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* GRPC_CORE_EXT_TRANSPORT_CHTTP2_TRANSPORT_INCOMING_METADATA_H */ \ No newline at end of file
diff --git a/src/core/ext/transport/chttp2/transport/internal.h b/src/core/ext/transport/chttp2/transport/internal.h
index 49022155aa..96af18f1d1 100644
--- a/src/core/ext/transport/chttp2/transport/internal.h
+++ b/src/core/ext/transport/chttp2/transport/internal.h
@@ -42,6 +42,10 @@
#include "src/core/lib/transport/pid_controller.h"
#include "src/core/lib/transport/transport_impl.h"
+#ifdef __cplusplus
+extern "C" {
+#endif
+
/* streams are kept in various linked lists depending on what things need to
happen to them... this enum labels each list */
typedef enum {
@@ -908,4 +912,8 @@ void grpc_chttp2_fail_pending_writes(grpc_exec_ctx *exec_ctx,
void grpc_chttp2_config_default_keepalive_args(grpc_channel_args *args,
bool is_client);
+#ifdef __cplusplus
+}
+#endif
+
#endif /* GRPC_CORE_EXT_TRANSPORT_CHTTP2_TRANSPORT_INTERNAL_H */
diff --git a/src/core/ext/transport/chttp2/transport/parsing.c b/src/core/ext/transport/chttp2/transport/parsing.cc
index 3db1ad4123..3db1ad4123 100644
--- a/src/core/ext/transport/chttp2/transport/parsing.c
+++ b/src/core/ext/transport/chttp2/transport/parsing.cc
diff --git a/src/core/ext/transport/chttp2/transport/stream_lists.c b/src/core/ext/transport/chttp2/transport/stream_lists.cc
index 47cd22d177..9f731a397f 100644
--- a/src/core/ext/transport/chttp2/transport/stream_lists.c
+++ b/src/core/ext/transport/chttp2/transport/stream_lists.cc
@@ -16,11 +16,12 @@
*
*/
+#include "src/core/ext/transport/chttp2/transport/chttp2_transport.h"
#include "src/core/ext/transport/chttp2/transport/internal.h"
#include <grpc/support/log.h>
-static char *stream_list_id_string(grpc_chttp2_stream_list_id id) {
+static const char *stream_list_id_string(grpc_chttp2_stream_list_id id) {
switch (id) {
case GRPC_CHTTP2_LIST_WRITABLE:
return "writable";
diff --git a/src/core/ext/transport/chttp2/transport/stream_map.c b/src/core/ext/transport/chttp2/transport/stream_map.cc
index d6079a9a33..d6079a9a33 100644
--- a/src/core/ext/transport/chttp2/transport/stream_map.c
+++ b/src/core/ext/transport/chttp2/transport/stream_map.cc
diff --git a/src/core/ext/transport/chttp2/transport/stream_map.h b/src/core/ext/transport/chttp2/transport/stream_map.h
index 30c50ba32e..364d37c33a 100644
--- a/src/core/ext/transport/chttp2/transport/stream_map.h
+++ b/src/core/ext/transport/chttp2/transport/stream_map.h
@@ -23,6 +23,10 @@
#include <stddef.h>
+#ifdef __cplusplus
+extern "C" {
+#endif
+
/* Data structure to map a uint32_t to a data object (represented by a void*)
Represented as a sorted array of keys, and a corresponding array of values.
@@ -65,4 +69,8 @@ void grpc_chttp2_stream_map_for_each(grpc_chttp2_stream_map *map,
void *value),
void *user_data);
-#endif /* GRPC_CORE_EXT_TRANSPORT_CHTTP2_TRANSPORT_STREAM_MAP_H */
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* GRPC_CORE_EXT_TRANSPORT_CHTTP2_TRANSPORT_STREAM_MAP_H */ \ No newline at end of file
diff --git a/src/core/ext/transport/chttp2/transport/varint.c b/src/core/ext/transport/chttp2/transport/varint.cc
index 0d94ddcbc3..0d94ddcbc3 100644
--- a/src/core/ext/transport/chttp2/transport/varint.c
+++ b/src/core/ext/transport/chttp2/transport/varint.cc
diff --git a/src/core/ext/transport/chttp2/transport/varint.h b/src/core/ext/transport/chttp2/transport/varint.h
index 5a2b670f06..d3a9d902c4 100644
--- a/src/core/ext/transport/chttp2/transport/varint.h
+++ b/src/core/ext/transport/chttp2/transport/varint.h
@@ -21,6 +21,10 @@
#include <grpc/support/port_platform.h>
+#ifdef __cplusplus
+extern "C" {
+#endif
+
/* Helpers for hpack varint encoding */
/* length of a value that needs varint tail encoding (it's bigger than can be
@@ -57,4 +61,8 @@ void grpc_chttp2_hpack_write_varint_tail(uint32_t tail_value, uint8_t* target,
} \
} while (0)
+#ifdef __cplusplus
+}
+#endif
+
#endif /* GRPC_CORE_EXT_TRANSPORT_CHTTP2_TRANSPORT_VARINT_H */
diff --git a/src/core/ext/transport/chttp2/transport/writing.c b/src/core/ext/transport/chttp2/transport/writing.cc
index be1af16019..ba3d55abb3 100644
--- a/src/core/ext/transport/chttp2/transport/writing.c
+++ b/src/core/ext/transport/chttp2/transport/writing.cc
@@ -257,15 +257,15 @@ grpc_chttp2_begin_write_result grpc_chttp2_begin_write(
s->send_trailing_metadata == NULL ||
!is_default_initial_metadata(s->send_initial_metadata)) {
grpc_encode_header_options hopt = {
- .stream_id = s->id,
- .is_eof = false,
- .use_true_binary_metadata =
- t->settings
- [GRPC_PEER_SETTINGS]
- [GRPC_CHTTP2_SETTINGS_GRPC_ALLOW_TRUE_BINARY_METADATA] != 0,
- .max_frame_size = t->settings[GRPC_PEER_SETTINGS]
- [GRPC_CHTTP2_SETTINGS_MAX_FRAME_SIZE],
- .stats = &s->stats.outgoing};
+ s->id, // stream_id
+ false, // is_eof
+ t->settings[GRPC_PEER_SETTINGS]
+ [GRPC_CHTTP2_SETTINGS_GRPC_ALLOW_TRUE_BINARY_METADATA] !=
+ 0, // use_true_binary_metadata
+ t->settings[GRPC_PEER_SETTINGS]
+ [GRPC_CHTTP2_SETTINGS_MAX_FRAME_SIZE], // max_frame_size
+ &s->stats.outgoing // stats
+ };
grpc_chttp2_encode_header(exec_ctx, &t->hpack_compressor, NULL, 0,
s->send_initial_metadata, &hopt, &t->outbuf);
now_writing = true;
@@ -431,17 +431,16 @@ grpc_chttp2_begin_write_result grpc_chttp2_begin_write(
&s->stats.outgoing, &t->outbuf);
} else {
grpc_encode_header_options hopt = {
- .stream_id = s->id,
- .is_eof = true,
- .use_true_binary_metadata =
- t->settings
+ s->id, true,
+
+ t->settings
[GRPC_PEER_SETTINGS]
[GRPC_CHTTP2_SETTINGS_GRPC_ALLOW_TRUE_BINARY_METADATA] !=
0,
- .max_frame_size =
- t->settings[GRPC_PEER_SETTINGS]
- [GRPC_CHTTP2_SETTINGS_MAX_FRAME_SIZE],
- .stats = &s->stats.outgoing};
+
+ t->settings[GRPC_PEER_SETTINGS]
+ [GRPC_CHTTP2_SETTINGS_MAX_FRAME_SIZE],
+ &s->stats.outgoing};
grpc_chttp2_encode_header(exec_ctx, &t->hpack_compressor,
extra_headers_for_trailing_metadata,
num_extra_headers_for_trailing_metadata,
diff --git a/src/core/ext/transport/cronet/client/secure/cronet_channel_create.c b/src/core/ext/transport/cronet/client/secure/cronet_channel_create.cc
index 83365192e3..b280487ca3 100644
--- a/src/core/ext/transport/cronet/client/secure/cronet_channel_create.c
+++ b/src/core/ext/transport/cronet/client/secure/cronet_channel_create.cc
@@ -21,6 +21,8 @@
#include <stdio.h>
#include <string.h>
+#include <grpc/grpc_cronet.h>
+
#include <grpc/support/alloc.h>
#include <grpc/support/log.h>
diff --git a/src/core/ext/transport/cronet/transport/cronet_api_dummy.c b/src/core/ext/transport/cronet/transport/cronet_api_dummy.cc
index 4f248ad919..4f248ad919 100644
--- a/src/core/ext/transport/cronet/transport/cronet_api_dummy.c
+++ b/src/core/ext/transport/cronet/transport/cronet_api_dummy.cc
diff --git a/src/core/ext/transport/cronet/transport/cronet_transport.c b/src/core/ext/transport/cronet/transport/cronet_transport.cc
index 587a3b83b5..ff1367fb28 100644
--- a/src/core/ext/transport/cronet/transport/cronet_transport.c
+++ b/src/core/ext/transport/cronet/transport/cronet_transport.cc
@@ -27,6 +27,7 @@
#include <grpc/support/useful.h>
#include "src/core/ext/transport/chttp2/transport/incoming_metadata.h"
+#include "src/core/ext/transport/cronet/transport/cronet_transport.h"
#include "src/core/lib/iomgr/endpoint.h"
#include "src/core/lib/iomgr/exec_ctx.h"
#include "src/core/lib/slice/slice_internal.h"
@@ -288,7 +289,7 @@ static void maybe_flush_read(stream_obj *s) {
CRONET_LOG(GPR_DEBUG, "%p: Flush read", s);
s->state.flush_read = true;
null_and_maybe_free_read_buffer(s);
- s->state.rs.read_buffer = gpr_malloc(GRPC_FLUSH_READ_SIZE);
+ s->state.rs.read_buffer = (char *)gpr_malloc(GRPC_FLUSH_READ_SIZE);
if (!s->state.pending_read_from_cronet) {
CRONET_LOG(GPR_DEBUG, "bidirectional_stream_read(%p)", s->cbs);
bidirectional_stream_read(s->cbs, s->state.rs.read_buffer,
@@ -313,7 +314,8 @@ static void add_to_storage(struct stream_obj *s,
struct op_storage *storage = &s->storage;
/* add new op at the beginning of the linked list. The memory is freed
in remove_from_storage */
- struct op_and_state *new_op = gpr_malloc(sizeof(struct op_and_state));
+ struct op_and_state *new_op =
+ (struct op_and_state *)gpr_malloc(sizeof(struct op_and_state));
memcpy(&new_op->op, op, sizeof(grpc_transport_stream_op_batch));
memset(&new_op->state, 0, sizeof(new_op->state));
new_op->s = s;
@@ -685,7 +687,7 @@ static void create_grpc_frame(grpc_exec_ctx *exec_ctx,
size_t length = GRPC_SLICE_LENGTH(slice);
*p_write_buffer_size = length + GRPC_HEADER_SIZE_IN_BYTES;
/* This is freed in the on_write_completed callback */
- char *write_buffer = gpr_malloc(length + GRPC_HEADER_SIZE_IN_BYTES);
+ char *write_buffer = (char *)gpr_malloc(length + GRPC_HEADER_SIZE_IN_BYTES);
*pp_write_buffer = write_buffer;
uint8_t *p = (uint8_t *)write_buffer;
/* Append 5 byte header */
@@ -1182,7 +1184,7 @@ static enum e_op_result execute_stream_op(grpc_exec_ctx *exec_ctx,
stream_state->rs.length_field);
if (stream_state->rs.length_field > 0) {
stream_state->rs.read_buffer =
- gpr_malloc((size_t)stream_state->rs.length_field);
+ (char *)gpr_malloc((size_t)stream_state->rs.length_field);
GPR_ASSERT(stream_state->rs.read_buffer);
stream_state->rs.remaining_bytes = stream_state->rs.length_field;
stream_state->rs.received_bytes = 0;
@@ -1452,13 +1454,14 @@ static const grpc_transport_vtable grpc_cronet_vtable = {
grpc_transport *grpc_create_cronet_transport(void *engine, const char *target,
const grpc_channel_args *args,
void *reserved) {
- grpc_cronet_transport *ct = gpr_malloc(sizeof(grpc_cronet_transport));
+ grpc_cronet_transport *ct =
+ (grpc_cronet_transport *)gpr_malloc(sizeof(grpc_cronet_transport));
if (!ct) {
goto error;
}
ct->base.vtable = &grpc_cronet_vtable;
- ct->engine = engine;
- ct->host = gpr_malloc(strlen(target) + 1);
+ ct->engine = (stream_engine *)engine;
+ ct->host = (char *)gpr_malloc(strlen(target) + 1);
if (!ct->host) {
goto error;
}
diff --git a/src/core/ext/transport/cronet/transport/cronet_transport.h b/src/core/ext/transport/cronet/transport/cronet_transport.h
index 3bd4249b79..43ff391f79 100644
--- a/src/core/ext/transport/cronet/transport/cronet_transport.h
+++ b/src/core/ext/transport/cronet/transport/cronet_transport.h
@@ -21,8 +21,16 @@
#include "src/core/lib/transport/transport.h"
+#ifdef __cplusplus
+extern "C" {
+#endif
+
grpc_transport *grpc_create_cronet_transport(void *engine, const char *target,
const grpc_channel_args *args,
void *reserved);
+#ifdef __cplusplus
+}
+#endif
+
#endif /* GRPC_CORE_EXT_TRANSPORT_CRONET_TRANSPORT_CRONET_TRANSPORT_H */
diff --git a/src/core/ext/transport/inproc/inproc_plugin.c b/src/core/ext/transport/inproc/inproc_plugin.cc
index 6a796a0b19..5d8a1c74ab 100644
--- a/src/core/ext/transport/inproc/inproc_plugin.c
+++ b/src/core/ext/transport/inproc/inproc_plugin.cc
@@ -21,9 +21,11 @@
grpc_tracer_flag grpc_inproc_trace = GRPC_TRACER_INITIALIZER(false, "inproc");
-void grpc_inproc_plugin_init(void) {
+extern "C" void grpc_inproc_plugin_init(void) {
grpc_register_tracer(&grpc_inproc_trace);
grpc_inproc_transport_init();
}
-void grpc_inproc_plugin_shutdown(void) { grpc_inproc_transport_shutdown(); }
+extern "C" void grpc_inproc_plugin_shutdown(void) {
+ grpc_inproc_transport_shutdown();
+}
diff --git a/src/core/ext/transport/inproc/inproc_transport.c b/src/core/ext/transport/inproc/inproc_transport.cc
index 31739d07dd..31739d07dd 100644
--- a/src/core/ext/transport/inproc/inproc_transport.c
+++ b/src/core/ext/transport/inproc/inproc_transport.cc
diff --git a/src/core/lib/channel/channel_args.c b/src/core/lib/channel/channel_args.cc
index 30248b3c60..30248b3c60 100644
--- a/src/core/lib/channel/channel_args.c
+++ b/src/core/lib/channel/channel_args.cc
diff --git a/src/core/lib/channel/channel_args.h b/src/core/lib/channel/channel_args.h
index 0599e189c3..2837174f49 100644
--- a/src/core/lib/channel/channel_args.h
+++ b/src/core/lib/channel/channel_args.h
@@ -23,6 +23,10 @@
#include <grpc/grpc.h>
#include "src/core/lib/iomgr/socket_mutator.h"
+#ifdef __cplusplus
+extern "C" {
+#endif
+
// Channel args are intentionally immutable, to avoid the need for locking.
/** Copy the arguments in \a src into a new instance */
@@ -149,4 +153,8 @@ grpc_arg grpc_channel_arg_integer_create(char *name, int value);
grpc_arg grpc_channel_arg_pointer_create(char *name, void *value,
const grpc_arg_pointer_vtable *vtable);
-#endif /* GRPC_CORE_LIB_CHANNEL_CHANNEL_ARGS_H */
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* GRPC_CORE_LIB_CHANNEL_CHANNEL_ARGS_H */ \ No newline at end of file
diff --git a/src/core/lib/channel/channel_stack.c b/src/core/lib/channel/channel_stack.cc
index 775c8bc667..775c8bc667 100644
--- a/src/core/lib/channel/channel_stack.c
+++ b/src/core/lib/channel/channel_stack.cc
diff --git a/src/core/lib/channel/channel_stack_builder.c b/src/core/lib/channel/channel_stack_builder.cc
index b663ebfb52..b663ebfb52 100644
--- a/src/core/lib/channel/channel_stack_builder.c
+++ b/src/core/lib/channel/channel_stack_builder.cc
diff --git a/src/core/lib/channel/connected_channel.c b/src/core/lib/channel/connected_channel.cc
index 4f37908958..4f37908958 100644
--- a/src/core/lib/channel/connected_channel.c
+++ b/src/core/lib/channel/connected_channel.cc
diff --git a/src/core/lib/channel/connected_channel.h b/src/core/lib/channel/connected_channel.h
index 10c98cce54..b55a1089a0 100644
--- a/src/core/lib/channel/connected_channel.h
+++ b/src/core/lib/channel/connected_channel.h
@@ -21,6 +21,10 @@
#include "src/core/lib/channel/channel_stack_builder.h"
+#ifdef __cplusplus
+extern "C" {
+#endif
+
extern const grpc_channel_filter grpc_connected_filter;
bool grpc_add_connected_filter(grpc_exec_ctx *exec_ctx,
@@ -30,4 +34,8 @@ bool grpc_add_connected_filter(grpc_exec_ctx *exec_ctx,
/* Debug helper to dig the transport stream out of a call element */
grpc_stream *grpc_connected_channel_get_stream(grpc_call_element *elem);
-#endif /* GRPC_CORE_LIB_CHANNEL_CONNECTED_CHANNEL_H */
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* GRPC_CORE_LIB_CHANNEL_CONNECTED_CHANNEL_H */ \ No newline at end of file
diff --git a/src/core/lib/channel/handshaker.c b/src/core/lib/channel/handshaker.cc
index 1753da5721..1753da5721 100644
--- a/src/core/lib/channel/handshaker.c
+++ b/src/core/lib/channel/handshaker.cc
diff --git a/src/core/lib/channel/handshaker.h b/src/core/lib/channel/handshaker.h
index eb9a59bd08..a857cde791 100644
--- a/src/core/lib/channel/handshaker.h
+++ b/src/core/lib/channel/handshaker.h
@@ -26,6 +26,10 @@
#include "src/core/lib/iomgr/exec_ctx.h"
#include "src/core/lib/iomgr/tcp_server.h"
+#ifdef __cplusplus
+extern "C" {
+#endif
+
/// Handshakers are used to perform initial handshakes on a connection
/// before the client sends the initial request. Some examples of what
/// a handshaker can be used for includes support for HTTP CONNECT on
@@ -164,4 +168,8 @@ void grpc_handshake_manager_pending_list_remove(grpc_handshake_manager** head,
void grpc_handshake_manager_pending_list_shutdown_all(
grpc_exec_ctx* exec_ctx, grpc_handshake_manager* head, grpc_error* why);
-#endif /* GRPC_CORE_LIB_CHANNEL_HANDSHAKER_H */
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* GRPC_CORE_LIB_CHANNEL_HANDSHAKER_H */ \ No newline at end of file
diff --git a/src/core/lib/channel/handshaker_factory.c b/src/core/lib/channel/handshaker_factory.cc
index 4deb280c60..4deb280c60 100644
--- a/src/core/lib/channel/handshaker_factory.c
+++ b/src/core/lib/channel/handshaker_factory.cc
diff --git a/src/core/lib/channel/handshaker_factory.h b/src/core/lib/channel/handshaker_factory.h
index 6238e735dc..2a130de252 100644
--- a/src/core/lib/channel/handshaker_factory.h
+++ b/src/core/lib/channel/handshaker_factory.h
@@ -24,6 +24,10 @@
#include "src/core/lib/channel/handshaker.h"
#include "src/core/lib/iomgr/exec_ctx.h"
+#ifdef __cplusplus
+extern "C" {
+#endif
+
// A handshaker factory is used to create handshakers.
typedef struct grpc_handshaker_factory grpc_handshaker_factory;
@@ -48,4 +52,8 @@ void grpc_handshaker_factory_add_handshakers(
void grpc_handshaker_factory_destroy(
grpc_exec_ctx *exec_ctx, grpc_handshaker_factory *handshaker_factory);
-#endif /* GRPC_CORE_LIB_CHANNEL_HANDSHAKER_FACTORY_H */
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* GRPC_CORE_LIB_CHANNEL_HANDSHAKER_FACTORY_H */ \ No newline at end of file
diff --git a/src/core/lib/channel/handshaker_registry.c b/src/core/lib/channel/handshaker_registry.cc
index c6bc87d704..c6bc87d704 100644
--- a/src/core/lib/channel/handshaker_registry.c
+++ b/src/core/lib/channel/handshaker_registry.cc
diff --git a/src/core/lib/channel/handshaker_registry.h b/src/core/lib/channel/handshaker_registry.h
index a3b2ac1dc7..e96bf06b6a 100644
--- a/src/core/lib/channel/handshaker_registry.h
+++ b/src/core/lib/channel/handshaker_registry.h
@@ -24,6 +24,10 @@
#include "src/core/lib/channel/handshaker_factory.h"
#include "src/core/lib/iomgr/exec_ctx.h"
+#ifdef __cplusplus
+extern "C" {
+#endif
+
typedef enum {
HANDSHAKER_CLIENT = 0,
HANDSHAKER_SERVER,
@@ -45,4 +49,8 @@ void grpc_handshakers_add(grpc_exec_ctx* exec_ctx,
const grpc_channel_args* args,
grpc_handshake_manager* handshake_mgr);
-#endif /* GRPC_CORE_LIB_CHANNEL_HANDSHAKER_REGISTRY_H */
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* GRPC_CORE_LIB_CHANNEL_HANDSHAKER_REGISTRY_H */ \ No newline at end of file
diff --git a/src/core/lib/compression/algorithm_metadata.h b/src/core/lib/compression/algorithm_metadata.h
index 08feafc1bb..3eb7088230 100644
--- a/src/core/lib/compression/algorithm_metadata.h
+++ b/src/core/lib/compression/algorithm_metadata.h
@@ -22,6 +22,10 @@
#include <grpc/compression.h>
#include "src/core/lib/transport/metadata.h"
+#ifdef __cplusplus
+extern "C" {
+#endif
+
/** Return compression algorithm based metadata value */
grpc_slice grpc_compression_algorithm_slice(
grpc_compression_algorithm algorithm);
@@ -49,4 +53,8 @@ grpc_compression_algorithm grpc_compression_algorithm_from_slice(
grpc_stream_compression_algorithm grpc_stream_compression_algorithm_from_slice(
grpc_slice str);
-#endif /* GRPC_CORE_LIB_COMPRESSION_ALGORITHM_METADATA_H */
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* GRPC_CORE_LIB_COMPRESSION_ALGORITHM_METADATA_H */ \ No newline at end of file
diff --git a/src/core/lib/compression/compression.c b/src/core/lib/compression/compression.cc
index 1cfac23129..1cfac23129 100644
--- a/src/core/lib/compression/compression.c
+++ b/src/core/lib/compression/compression.cc
diff --git a/src/core/lib/compression/message_compress.c b/src/core/lib/compression/message_compress.cc
index c051e28864..c051e28864 100644
--- a/src/core/lib/compression/message_compress.c
+++ b/src/core/lib/compression/message_compress.cc
diff --git a/src/core/lib/compression/message_compress.h b/src/core/lib/compression/message_compress.h
index ca8ca37f8e..d2545a02c2 100644
--- a/src/core/lib/compression/message_compress.h
+++ b/src/core/lib/compression/message_compress.h
@@ -22,6 +22,10 @@
#include <grpc/compression.h>
#include <grpc/slice_buffer.h>
+#ifdef __cplusplus
+extern "C" {
+#endif
+
/* compress 'input' to 'output' using 'algorithm'.
On success, appends compressed slices to output and returns 1.
On failure, appends uncompressed slices to output and returns 0. */
@@ -36,4 +40,8 @@ int grpc_msg_decompress(grpc_exec_ctx* exec_ctx,
grpc_compression_algorithm algorithm,
grpc_slice_buffer* input, grpc_slice_buffer* output);
-#endif /* GRPC_CORE_LIB_COMPRESSION_MESSAGE_COMPRESS_H */
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* GRPC_CORE_LIB_COMPRESSION_MESSAGE_COMPRESS_H */ \ No newline at end of file
diff --git a/src/core/lib/compression/stream_compression.c b/src/core/lib/compression/stream_compression.cc
index 411489f029..7faeb0d34f 100644
--- a/src/core/lib/compression/stream_compression.c
+++ b/src/core/lib/compression/stream_compression.cc
@@ -21,7 +21,7 @@
#include "src/core/lib/compression/stream_compression.h"
#include "src/core/lib/compression/stream_compression_gzip.h"
-extern const grpc_stream_compression_vtable
+extern "C" const grpc_stream_compression_vtable
grpc_stream_compression_identity_vtable;
bool grpc_stream_compress(grpc_stream_compression_context *ctx,
diff --git a/src/core/lib/compression/stream_compression.h b/src/core/lib/compression/stream_compression.h
index 6d073280fa..6ee3ac1966 100644
--- a/src/core/lib/compression/stream_compression.h
+++ b/src/core/lib/compression/stream_compression.h
@@ -26,6 +26,10 @@
#include "src/core/lib/transport/static_metadata.h"
+#ifdef __cplusplus
+extern "C" {
+#endif
+
typedef struct grpc_stream_compression_vtable grpc_stream_compression_vtable;
/* Stream compression/decompression context */
@@ -111,4 +115,8 @@ void grpc_stream_compression_context_destroy(
int grpc_stream_compression_method_parse(
grpc_slice value, bool is_compress, grpc_stream_compression_method *method);
+#ifdef __cplusplus
+}
+#endif
+
#endif
diff --git a/src/core/lib/compression/stream_compression_gzip.c b/src/core/lib/compression/stream_compression_gzip.cc
index abcbdb3a91..087b018be5 100644
--- a/src/core/lib/compression/stream_compression_gzip.c
+++ b/src/core/lib/compression/stream_compression_gzip.cc
@@ -222,7 +222,6 @@ static void grpc_stream_compression_context_destroy_gzip(
}
const grpc_stream_compression_vtable grpc_stream_compression_gzip_vtable = {
- .compress = grpc_stream_compress_gzip,
- .decompress = grpc_stream_decompress_gzip,
- .context_create = grpc_stream_compression_context_create_gzip,
- .context_destroy = grpc_stream_compression_context_destroy_gzip};
+ grpc_stream_compress_gzip, grpc_stream_decompress_gzip,
+ grpc_stream_compression_context_create_gzip,
+ grpc_stream_compression_context_destroy_gzip};
diff --git a/src/core/lib/compression/stream_compression_gzip.h b/src/core/lib/compression/stream_compression_gzip.h
index 7cf49a0de9..a3f1b0406f 100644
--- a/src/core/lib/compression/stream_compression_gzip.h
+++ b/src/core/lib/compression/stream_compression_gzip.h
@@ -21,6 +21,14 @@
#include "src/core/lib/compression/stream_compression.h"
+#ifdef __cplusplus
+extern "C" {
+#endif
+
extern const grpc_stream_compression_vtable grpc_stream_compression_gzip_vtable;
+#ifdef __cplusplus
+}
+#endif
+
#endif
diff --git a/src/core/lib/compression/stream_compression_identity.c b/src/core/lib/compression/stream_compression_identity.cc
index 3dfcf53b85..9b2e6062e1 100644
--- a/src/core/lib/compression/stream_compression_identity.c
+++ b/src/core/lib/compression/stream_compression_identity.cc
@@ -27,7 +27,7 @@
/* Singleton context used for all identity streams. */
static grpc_stream_compression_context identity_ctx = {
- .vtable = &grpc_stream_compression_identity_vtable};
+ &grpc_stream_compression_identity_vtable};
static void grpc_stream_compression_pass_through(grpc_slice_buffer *in,
grpc_slice_buffer *out,
@@ -88,7 +88,6 @@ static void grpc_stream_compression_context_destroy_identity(
}
const grpc_stream_compression_vtable grpc_stream_compression_identity_vtable = {
- .compress = grpc_stream_compress_identity,
- .decompress = grpc_stream_decompress_identity,
- .context_create = grpc_stream_compression_context_create_identity,
- .context_destroy = grpc_stream_compression_context_destroy_identity};
+ grpc_stream_compress_identity, grpc_stream_decompress_identity,
+ grpc_stream_compression_context_create_identity,
+ grpc_stream_compression_context_destroy_identity};
diff --git a/src/core/lib/compression/stream_compression_identity.h b/src/core/lib/compression/stream_compression_identity.h
index 41926e949e..3a729fafad 100644
--- a/src/core/lib/compression/stream_compression_identity.h
+++ b/src/core/lib/compression/stream_compression_identity.h
@@ -21,7 +21,15 @@
#include "src/core/lib/compression/stream_compression.h"
+#ifdef __cplusplus
+extern "C" {
+#endif
+
extern const grpc_stream_compression_vtable
grpc_stream_compression_identity_vtable;
+#ifdef __cplusplus
+}
+#endif
+
#endif
diff --git a/src/core/lib/debug/stats.c b/src/core/lib/debug/stats.cc
index 4096384dd9..4096384dd9 100644
--- a/src/core/lib/debug/stats.c
+++ b/src/core/lib/debug/stats.cc
diff --git a/src/core/lib/debug/stats.h b/src/core/lib/debug/stats.h
index 09d190d488..fec1d651e6 100644
--- a/src/core/lib/debug/stats.h
+++ b/src/core/lib/debug/stats.h
@@ -23,6 +23,10 @@
#include "src/core/lib/debug/stats_data.h"
#include "src/core/lib/iomgr/exec_ctx.h"
+#ifdef __cplusplus
+extern "C" {
+#endif
+
typedef struct grpc_stats_data {
gpr_atm counters[GRPC_STATS_COUNTER_COUNT];
gpr_atm histograms[GRPC_STATS_HISTOGRAM_BUCKETS];
@@ -58,4 +62,8 @@ double grpc_stats_histo_percentile(const grpc_stats_data *data,
size_t grpc_stats_histo_count(const grpc_stats_data *data,
grpc_stats_histograms histogram);
+#ifdef __cplusplus
+}
+#endif
+
#endif
diff --git a/src/core/lib/debug/stats_data.c b/src/core/lib/debug/stats_data.cc
index c0aec63c1d..c0aec63c1d 100644
--- a/src/core/lib/debug/stats_data.c
+++ b/src/core/lib/debug/stats_data.cc
diff --git a/src/core/lib/debug/stats_data.h b/src/core/lib/debug/stats_data.h
index 28dab00117..cf5bafbd04 100644
--- a/src/core/lib/debug/stats_data.h
+++ b/src/core/lib/debug/stats_data.h
@@ -24,6 +24,10 @@
#include <inttypes.h>
#include "src/core/lib/iomgr/exec_ctx.h"
+#ifdef __cplusplus
+extern "C" {
+#endif
+
typedef enum {
GRPC_STATS_COUNTER_CLIENT_CALLS_CREATED,
GRPC_STATS_COUNTER_SERVER_CALLS_CREATED,
@@ -467,4 +471,8 @@ extern const int *const grpc_stats_histo_bucket_boundaries[13];
extern void (*const grpc_stats_inc_histogram[13])(grpc_exec_ctx *exec_ctx,
int x);
+#ifdef __cplusplus
+}
+#endif
+
#endif /* GRPC_CORE_LIB_DEBUG_STATS_DATA_H */
diff --git a/src/core/lib/debug/trace.c b/src/core/lib/debug/trace.cc
index 7cb2789a19..21b0d8c3a6 100644
--- a/src/core/lib/debug/trace.c
+++ b/src/core/lib/debug/trace.cc
@@ -20,6 +20,7 @@
#include <string.h>
+#include <grpc/grpc.h>
#include <grpc/support/alloc.h>
#include <grpc/support/log.h>
#include "src/core/lib/support/env.h"
diff --git a/src/core/lib/debug/trace.h b/src/core/lib/debug/trace.h
index 64f2e3fc33..558ba942bb 100644
--- a/src/core/lib/debug/trace.h
+++ b/src/core/lib/debug/trace.h
@@ -23,6 +23,10 @@
#include <grpc/support/port_platform.h>
#include <stdbool.h>
+#ifdef __cplusplus
+extern "C" {
+#endif
+
#if defined(__has_feature)
#if __has_feature(thread_sanitizer)
#define GRPC_THREADSAFE_TRACER
@@ -52,4 +56,8 @@ void grpc_register_tracer(grpc_tracer_flag *flag);
void grpc_tracer_init(const char *env_var_name);
void grpc_tracer_shutdown(void);
+#ifdef __cplusplus
+}
+#endif
+
#endif /* GRPC_CORE_LIB_DEBUG_TRACE_H */
diff --git a/src/core/lib/http/format_request.c b/src/core/lib/http/format_request.cc
index 88fb0ab0b6..88fb0ab0b6 100644
--- a/src/core/lib/http/format_request.c
+++ b/src/core/lib/http/format_request.cc
diff --git a/src/core/lib/http/format_request.h b/src/core/lib/http/format_request.h
index 12b42e42fa..a559aac660 100644
--- a/src/core/lib/http/format_request.h
+++ b/src/core/lib/http/format_request.h
@@ -22,6 +22,10 @@
#include <grpc/slice.h>
#include "src/core/lib/http/httpcli.h"
+#ifdef __cplusplus
+extern "C" {
+#endif
+
grpc_slice grpc_httpcli_format_get_request(const grpc_httpcli_request *request);
grpc_slice grpc_httpcli_format_post_request(const grpc_httpcli_request *request,
const char *body_bytes,
@@ -29,4 +33,8 @@ grpc_slice grpc_httpcli_format_post_request(const grpc_httpcli_request *request,
grpc_slice grpc_httpcli_format_connect_request(
const grpc_httpcli_request *request);
-#endif /* GRPC_CORE_LIB_HTTP_FORMAT_REQUEST_H */
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* GRPC_CORE_LIB_HTTP_FORMAT_REQUEST_H */ \ No newline at end of file
diff --git a/src/core/lib/http/httpcli.c b/src/core/lib/http/httpcli.cc
index db995943a9..db995943a9 100644
--- a/src/core/lib/http/httpcli.c
+++ b/src/core/lib/http/httpcli.cc
diff --git a/src/core/lib/http/httpcli.h b/src/core/lib/http/httpcli.h
index 809618695e..630481da54 100644
--- a/src/core/lib/http/httpcli.h
+++ b/src/core/lib/http/httpcli.h
@@ -32,6 +32,10 @@
/* User agent this library reports */
#define GRPC_HTTPCLI_USER_AGENT "grpc-httpcli/0.0"
+#ifdef __cplusplus
+extern "C" {
+#endif
+
/* Tracks in-progress http requests
TODO(ctiller): allow caching and capturing multiple requests for the
same content and combining them */
@@ -123,4 +127,8 @@ typedef int (*grpc_httpcli_post_override)(
void grpc_httpcli_set_override(grpc_httpcli_get_override get,
grpc_httpcli_post_override post);
-#endif /* GRPC_CORE_LIB_HTTP_HTTPCLI_H */
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* GRPC_CORE_LIB_HTTP_HTTPCLI_H */ \ No newline at end of file
diff --git a/src/core/lib/http/httpcli_security_connector.c b/src/core/lib/http/httpcli_security_connector.cc
index c553fa3981..8a0f225ba2 100644
--- a/src/core/lib/http/httpcli_security_connector.c
+++ b/src/core/lib/http/httpcli_security_connector.cc
@@ -106,7 +106,8 @@ static grpc_security_status httpcli_ssl_channel_security_connector_create(
return GRPC_SECURITY_ERROR;
}
- c = gpr_zalloc(sizeof(grpc_httpcli_ssl_channel_security_connector));
+ c = (grpc_httpcli_ssl_channel_security_connector *)gpr_zalloc(
+ sizeof(grpc_httpcli_ssl_channel_security_connector));
gpr_ref_init(&c->base.base.refcount, 1);
c->base.base.vtable = &httpcli_ssl_vtable;
@@ -137,8 +138,8 @@ typedef struct {
static void on_handshake_done(grpc_exec_ctx *exec_ctx, void *arg,
grpc_error *error) {
- grpc_handshaker_args *args = arg;
- on_done_closure *c = args->user_data;
+ grpc_handshaker_args *args = (grpc_handshaker_args *)arg;
+ on_done_closure *c = (on_done_closure *)args->user_data;
if (error != GRPC_ERROR_NONE) {
const char *msg = grpc_error_string(error);
gpr_log(GPR_ERROR, "Secure transport setup failed: %s", msg);
@@ -159,7 +160,7 @@ static void ssl_handshake(grpc_exec_ctx *exec_ctx, void *arg,
gpr_timespec deadline,
void (*on_done)(grpc_exec_ctx *exec_ctx, void *arg,
grpc_endpoint *endpoint)) {
- on_done_closure *c = gpr_malloc(sizeof(*c));
+ on_done_closure *c = (on_done_closure *)gpr_malloc(sizeof(*c));
const char *pem_root_certs = grpc_get_default_ssl_roots();
if (pem_root_certs == NULL) {
gpr_log(GPR_ERROR, "Could not get default pem root certs.");
diff --git a/src/core/lib/http/parser.c b/src/core/lib/http/parser.cc
index 0950bd655e..0950bd655e 100644
--- a/src/core/lib/http/parser.c
+++ b/src/core/lib/http/parser.cc
diff --git a/src/core/lib/http/parser.h b/src/core/lib/http/parser.h
index c8dced3901..5484948bea 100644
--- a/src/core/lib/http/parser.h
+++ b/src/core/lib/http/parser.h
@@ -27,6 +27,10 @@
/* Maximum length of a header string of the form 'Key: Value\r\n' */
#define GRPC_HTTP_PARSER_MAX_HEADER_LENGTH 4096
+#ifdef __cplusplus
+extern "C" {
+#endif
+
/* A single header to be passed in a request */
typedef struct grpc_http_header {
char *key;
@@ -109,4 +113,8 @@ void grpc_http_response_destroy(grpc_http_response *response);
extern grpc_tracer_flag grpc_http1_trace;
-#endif /* GRPC_CORE_LIB_HTTP_PARSER_H */
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* GRPC_CORE_LIB_HTTP_PARSER_H */ \ No newline at end of file
diff --git a/src/core/lib/iomgr/call_combiner.c b/src/core/lib/iomgr/call_combiner.cc
index 48d8eaec18..bab3df021a 100644
--- a/src/core/lib/iomgr/call_combiner.c
+++ b/src/core/lib/iomgr/call_combiner.cc
@@ -18,6 +18,8 @@
#include "src/core/lib/iomgr/call_combiner.h"
+#include <inttypes.h>
+
#include <grpc/support/log.h>
grpc_tracer_flag grpc_call_combiner_trace =
diff --git a/src/core/lib/iomgr/call_combiner.h b/src/core/lib/iomgr/call_combiner.h
index 5cfb3f0c07..527f84fce0 100644
--- a/src/core/lib/iomgr/call_combiner.h
+++ b/src/core/lib/iomgr/call_combiner.h
@@ -27,6 +27,10 @@
#include "src/core/lib/iomgr/exec_ctx.h"
#include "src/core/lib/support/mpscq.h"
+#ifdef __cplusplus
+extern "C" {
+#endif
+
// A simple, lock-free mechanism for serializing activity related to a
// single call. This is similar to a combiner but is more lightweight.
//
@@ -118,4 +122,8 @@ void grpc_call_combiner_cancel(grpc_exec_ctx* exec_ctx,
grpc_call_combiner* call_combiner,
grpc_error* error);
+#ifdef __cplusplus
+}
+#endif
+
#endif /* GRPC_CORE_LIB_IOMGR_CALL_COMBINER_H */
diff --git a/src/core/lib/iomgr/closure.c b/src/core/lib/iomgr/closure.cc
index 00edefc6ae..00edefc6ae 100644
--- a/src/core/lib/iomgr/closure.c
+++ b/src/core/lib/iomgr/closure.cc
diff --git a/src/core/lib/iomgr/combiner.c b/src/core/lib/iomgr/combiner.cc
index f899b25f10..0e707ef839 100644
--- a/src/core/lib/iomgr/combiner.c
+++ b/src/core/lib/iomgr/combiner.cc
@@ -19,6 +19,7 @@
#include "src/core/lib/iomgr/combiner.h"
#include <assert.h>
+#include <inttypes.h>
#include <string.h>
#include <grpc/support/alloc.h>
diff --git a/src/core/lib/iomgr/combiner.h b/src/core/lib/iomgr/combiner.h
index 8e0434369d..10e5fb480d 100644
--- a/src/core/lib/iomgr/combiner.h
+++ b/src/core/lib/iomgr/combiner.h
@@ -26,6 +26,10 @@
#include "src/core/lib/iomgr/exec_ctx.h"
#include "src/core/lib/support/mpscq.h"
+#ifdef __cplusplus
+extern "C" {
+#endif
+
// Provides serialized access to some resource.
// Each action queued on a combiner is executed serially in a borrowed thread.
// The actual thread executing actions may change over time (but there will only
@@ -63,4 +67,8 @@ bool grpc_combiner_continue_exec_ctx(grpc_exec_ctx *exec_ctx);
extern grpc_tracer_flag grpc_combiner_trace;
+#ifdef __cplusplus
+}
+#endif
+
#endif /* GRPC_CORE_LIB_IOMGR_COMBINER_H */
diff --git a/src/core/lib/iomgr/endpoint.c b/src/core/lib/iomgr/endpoint.cc
index 37cce335ca..37cce335ca 100644
--- a/src/core/lib/iomgr/endpoint.c
+++ b/src/core/lib/iomgr/endpoint.cc
diff --git a/src/core/lib/iomgr/endpoint.h b/src/core/lib/iomgr/endpoint.h
index 8f0523a981..16ff0ab733 100644
--- a/src/core/lib/iomgr/endpoint.h
+++ b/src/core/lib/iomgr/endpoint.h
@@ -26,6 +26,10 @@
#include "src/core/lib/iomgr/pollset_set.h"
#include "src/core/lib/iomgr/resource_quota.h"
+#ifdef __cplusplus
+extern "C" {
+#endif
+
/* An endpoint caps a streaming channel between two communicating processes.
Examples may be: a tcp socket, <stdin+stdout>, or some shared memory. */
@@ -95,4 +99,8 @@ struct grpc_endpoint {
const grpc_endpoint_vtable *vtable;
};
-#endif /* GRPC_CORE_LIB_IOMGR_ENDPOINT_H */
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* GRPC_CORE_LIB_IOMGR_ENDPOINT_H */ \ No newline at end of file
diff --git a/src/core/lib/iomgr/endpoint_pair.h b/src/core/lib/iomgr/endpoint_pair.h
index b60e62fc3e..f8830022f4 100644
--- a/src/core/lib/iomgr/endpoint_pair.h
+++ b/src/core/lib/iomgr/endpoint_pair.h
@@ -21,6 +21,10 @@
#include "src/core/lib/iomgr/endpoint.h"
+#ifdef __cplusplus
+extern "C" {
+#endif
+
typedef struct {
grpc_endpoint *client;
grpc_endpoint *server;
@@ -29,4 +33,8 @@ typedef struct {
grpc_endpoint_pair grpc_iomgr_create_endpoint_pair(const char *name,
grpc_channel_args *args);
-#endif /* GRPC_CORE_LIB_IOMGR_ENDPOINT_PAIR_H */
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* GRPC_CORE_LIB_IOMGR_ENDPOINT_PAIR_H */ \ No newline at end of file
diff --git a/src/core/lib/iomgr/endpoint_pair_posix.c b/src/core/lib/iomgr/endpoint_pair_posix.cc
index 3ade2148ba..3ade2148ba 100644
--- a/src/core/lib/iomgr/endpoint_pair_posix.c
+++ b/src/core/lib/iomgr/endpoint_pair_posix.cc
diff --git a/src/core/lib/iomgr/endpoint_pair_uv.c b/src/core/lib/iomgr/endpoint_pair_uv.cc
index ff72fe0492..ff72fe0492 100644
--- a/src/core/lib/iomgr/endpoint_pair_uv.c
+++ b/src/core/lib/iomgr/endpoint_pair_uv.cc
diff --git a/src/core/lib/iomgr/endpoint_pair_windows.c b/src/core/lib/iomgr/endpoint_pair_windows.cc
index 782fa2fd69..782fa2fd69 100644
--- a/src/core/lib/iomgr/endpoint_pair_windows.c
+++ b/src/core/lib/iomgr/endpoint_pair_windows.cc
diff --git a/src/core/lib/iomgr/error.c b/src/core/lib/iomgr/error.cc
index aa05501537..2ea6cf1301 100644
--- a/src/core/lib/iomgr/error.c
+++ b/src/core/lib/iomgr/error.cc
@@ -15,9 +15,11 @@
* limitations under the License.
*
*/
+#include <grpc/support/port_platform.h>
#include "src/core/lib/iomgr/error.h"
+#include <inttypes.h>
#include <string.h>
#include <grpc/status.h>
diff --git a/src/core/lib/iomgr/error.h b/src/core/lib/iomgr/error.h
index b362948691..b36330a7ab 100644
--- a/src/core/lib/iomgr/error.h
+++ b/src/core/lib/iomgr/error.h
@@ -19,8 +19,8 @@
#ifndef GRPC_CORE_LIB_IOMGR_ERROR_H
#define GRPC_CORE_LIB_IOMGR_ERROR_H
+#include <inttypes.h>
#include <stdbool.h>
-#include <stdint.h>
#include <grpc/slice.h>
#include <grpc/status.h>
diff --git a/src/core/lib/iomgr/error_internal.h b/src/core/lib/iomgr/error_internal.h
index 7507484557..f718e06d4e 100644
--- a/src/core/lib/iomgr/error_internal.h
+++ b/src/core/lib/iomgr/error_internal.h
@@ -24,6 +24,10 @@
#include <grpc/support/sync.h>
+#ifdef __cplusplus
+extern "C" {
+#endif
+
typedef struct grpc_linked_error grpc_linked_error;
struct grpc_linked_error {
@@ -57,4 +61,8 @@ struct grpc_error {
bool grpc_error_is_special(grpc_error *err);
-#endif /* GRPC_CORE_LIB_IOMGR_ERROR_INTERNAL_H */
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* GRPC_CORE_LIB_IOMGR_ERROR_INTERNAL_H */ \ No newline at end of file
diff --git a/src/core/lib/iomgr/ev_epoll1_linux.c b/src/core/lib/iomgr/ev_epoll1_linux.cc
index 3ac12ab56f..689aac15bf 100644
--- a/src/core/lib/iomgr/ev_epoll1_linux.c
+++ b/src/core/lib/iomgr/ev_epoll1_linux.cc
@@ -20,7 +20,6 @@
/* This polling engine is only relevant on linux kernels supporting epoll() */
#ifdef GRPC_LINUX_EPOLL
-
#include "src/core/lib/iomgr/ev_epoll1_linux.h"
#include <assert.h>
@@ -1257,7 +1256,7 @@ const grpc_event_engine_vtable *grpc_init_epoll1_linux(bool explicit_request) {
#else /* defined(GRPC_LINUX_EPOLL) */
#if defined(GRPC_POSIX_SOCKET)
-#include "src/core/lib/iomgr/ev_posix.h"
+#include "src/core/lib/iomgr/ev_epoll1_linux.h"
/* If GRPC_LINUX_EPOLL is not defined, it means epoll is not available. Return
* NULL */
const grpc_event_engine_vtable *grpc_init_epoll1_linux(bool explicit_request) {
diff --git a/src/core/lib/iomgr/ev_epoll1_linux.h b/src/core/lib/iomgr/ev_epoll1_linux.h
index 0696e0df40..66fd826b49 100644
--- a/src/core/lib/iomgr/ev_epoll1_linux.h
+++ b/src/core/lib/iomgr/ev_epoll1_linux.h
@@ -22,8 +22,16 @@
#include "src/core/lib/iomgr/ev_posix.h"
#include "src/core/lib/iomgr/port.h"
+#ifdef __cplusplus
+extern "C" {
+#endif
+
// a polling engine that utilizes a singleton epoll set and turnstile polling
const grpc_event_engine_vtable *grpc_init_epoll1_linux(bool explicit_request);
-#endif /* GRPC_CORE_LIB_IOMGR_EV_EPOLL1_LINUX_H */
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* GRPC_CORE_LIB_IOMGR_EV_EPOLL1_LINUX_H */ \ No newline at end of file
diff --git a/src/core/lib/iomgr/ev_epollex_linux.c b/src/core/lib/iomgr/ev_epollex_linux.cc
index 8eb4de44d9..bed47e4388 100644
--- a/src/core/lib/iomgr/ev_epollex_linux.c
+++ b/src/core/lib/iomgr/ev_epollex_linux.cc
@@ -1449,7 +1449,7 @@ const grpc_event_engine_vtable *grpc_init_epollex_linux(
#else /* defined(GRPC_LINUX_EPOLL) */
#if defined(GRPC_POSIX_SOCKET)
-#include "src/core/lib/iomgr/ev_posix.h"
+#include "src/core/lib/iomgr/ev_epollex_linux.h"
/* If GRPC_LINUX_EPOLL is not defined, it means epoll is not available. Return
* NULL */
const grpc_event_engine_vtable *grpc_init_epollex_linux(
diff --git a/src/core/lib/iomgr/ev_epollex_linux.h b/src/core/lib/iomgr/ev_epollex_linux.h
index cff9b43c02..58cc5a24f8 100644
--- a/src/core/lib/iomgr/ev_epollex_linux.h
+++ b/src/core/lib/iomgr/ev_epollex_linux.h
@@ -22,7 +22,15 @@
#include "src/core/lib/iomgr/ev_posix.h"
#include "src/core/lib/iomgr/port.h"
+#ifdef __cplusplus
+extern "C" {
+#endif
+
const grpc_event_engine_vtable *grpc_init_epollex_linux(
bool explicitly_requested);
-#endif /* GRPC_CORE_LIB_IOMGR_EV_EPOLLEX_LINUX_H */
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* GRPC_CORE_LIB_IOMGR_EV_EPOLLEX_LINUX_H */ \ No newline at end of file
diff --git a/src/core/lib/iomgr/ev_epollsig_linux.c b/src/core/lib/iomgr/ev_epollsig_linux.cc
index 4d8bdf1401..c8e07c6e18 100644
--- a/src/core/lib/iomgr/ev_epollsig_linux.c
+++ b/src/core/lib/iomgr/ev_epollsig_linux.cc
@@ -1756,7 +1756,7 @@ const grpc_event_engine_vtable *grpc_init_epollsig_linux(
#else /* defined(GRPC_LINUX_EPOLL) */
#if defined(GRPC_POSIX_SOCKET)
-#include "src/core/lib/iomgr/ev_posix.h"
+#include "src/core/lib/iomgr/ev_epollsig_linux.h"
/* If GRPC_LINUX_EPOLL is not defined, it means epoll is not available. Return
* NULL */
const grpc_event_engine_vtable *grpc_init_epollsig_linux(
diff --git a/src/core/lib/iomgr/ev_epollsig_linux.h b/src/core/lib/iomgr/ev_epollsig_linux.h
index 88328682b3..c04ff27400 100644
--- a/src/core/lib/iomgr/ev_epollsig_linux.h
+++ b/src/core/lib/iomgr/ev_epollsig_linux.h
@@ -22,6 +22,10 @@
#include "src/core/lib/iomgr/ev_posix.h"
#include "src/core/lib/iomgr/port.h"
+#ifdef __cplusplus
+extern "C" {
+#endif
+
const grpc_event_engine_vtable *grpc_init_epollsig_linux(bool explicit_request);
#ifdef GRPC_LINUX_EPOLL
@@ -30,4 +34,8 @@ void *grpc_pollset_get_polling_island(grpc_pollset *ps);
bool grpc_are_polling_islands_equal(void *p, void *q);
#endif /* defined(GRPC_LINUX_EPOLL) */
+#ifdef __cplusplus
+}
+#endif
+
#endif /* GRPC_CORE_LIB_IOMGR_EV_EPOLLSIG_LINUX_H */
diff --git a/src/core/lib/iomgr/ev_poll_posix.c b/src/core/lib/iomgr/ev_poll_posix.cc
index e170702dca..e170702dca 100644
--- a/src/core/lib/iomgr/ev_poll_posix.c
+++ b/src/core/lib/iomgr/ev_poll_posix.cc
diff --git a/src/core/lib/iomgr/ev_poll_posix.h b/src/core/lib/iomgr/ev_poll_posix.h
index d444e60944..84b68155b5 100644
--- a/src/core/lib/iomgr/ev_poll_posix.h
+++ b/src/core/lib/iomgr/ev_poll_posix.h
@@ -21,7 +21,15 @@
#include "src/core/lib/iomgr/ev_posix.h"
+#ifdef __cplusplus
+extern "C" {
+#endif
+
const grpc_event_engine_vtable *grpc_init_poll_posix(bool explicit_request);
const grpc_event_engine_vtable *grpc_init_poll_cv_posix(bool explicit_request);
-#endif /* GRPC_CORE_LIB_IOMGR_EV_POLL_POSIX_H */
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* GRPC_CORE_LIB_IOMGR_EV_POLL_POSIX_H */ \ No newline at end of file
diff --git a/src/core/lib/iomgr/ev_posix.c b/src/core/lib/iomgr/ev_posix.cc
index 4d3ae2228e..4d3ae2228e 100644
--- a/src/core/lib/iomgr/ev_posix.c
+++ b/src/core/lib/iomgr/ev_posix.cc
diff --git a/src/core/lib/iomgr/ev_posix.h b/src/core/lib/iomgr/ev_posix.h
index 1ff2ff1413..5ad1c13ee6 100644
--- a/src/core/lib/iomgr/ev_posix.h
+++ b/src/core/lib/iomgr/ev_posix.h
@@ -27,6 +27,10 @@
#include "src/core/lib/iomgr/pollset_set.h"
#include "src/core/lib/iomgr/wakeup_fd_posix.h"
+#ifdef __cplusplus
+extern "C" {
+#endif
+
extern grpc_tracer_flag grpc_polling_trace; /* Disabled by default */
typedef struct grpc_fd grpc_fd;
@@ -158,4 +162,8 @@ extern grpc_poll_function_type grpc_poll_function;
void grpc_set_event_engine_test_only(const grpc_event_engine_vtable *);
const grpc_event_engine_vtable *grpc_get_event_engine_test_only();
-#endif /* GRPC_CORE_LIB_IOMGR_EV_POSIX_H */
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* GRPC_CORE_LIB_IOMGR_EV_POSIX_H */ \ No newline at end of file
diff --git a/src/core/lib/iomgr/ev_windows.c b/src/core/lib/iomgr/ev_windows.cc
index c24dfaeaf7..c24dfaeaf7 100644
--- a/src/core/lib/iomgr/ev_windows.c
+++ b/src/core/lib/iomgr/ev_windows.cc
diff --git a/src/core/lib/iomgr/exec_ctx.c b/src/core/lib/iomgr/exec_ctx.cc
index 41c69add17..41c69add17 100644
--- a/src/core/lib/iomgr/exec_ctx.c
+++ b/src/core/lib/iomgr/exec_ctx.cc
diff --git a/src/core/lib/iomgr/exec_ctx.h b/src/core/lib/iomgr/exec_ctx.h
index c89792c8c4..a93728f0a6 100644
--- a/src/core/lib/iomgr/exec_ctx.h
+++ b/src/core/lib/iomgr/exec_ctx.h
@@ -22,6 +22,10 @@
#include <grpc/support/cpu.h>
#include "src/core/lib/iomgr/closure.h"
+#ifdef __cplusplus
+extern "C" {
+#endif
+
/* #define GRPC_EXECUTION_CONTEXT_SANITIZER 1 */
/** A workqueue represents a list of work to be executed asynchronously.
@@ -106,4 +110,8 @@ void grpc_exec_ctx_global_init(void);
void grpc_exec_ctx_global_init(void);
void grpc_exec_ctx_global_shutdown(void);
+#ifdef __cplusplus
+}
+#endif
+
#endif /* GRPC_CORE_LIB_IOMGR_EXEC_CTX_H */
diff --git a/src/core/lib/iomgr/executor.c b/src/core/lib/iomgr/executor.cc
index 892385d7d7..ebe7f240b4 100644
--- a/src/core/lib/iomgr/executor.c
+++ b/src/core/lib/iomgr/executor.cc
@@ -100,7 +100,7 @@ void grpc_executor_set_threading(grpc_exec_ctx *exec_ctx, bool threading) {
for (size_t i = 0; i < g_max_threads; i++) {
gpr_mu_init(&g_thread_state[i].mu);
gpr_cv_init(&g_thread_state[i].cv);
- g_thread_state[i].elems = (grpc_closure_list)GRPC_CLOSURE_LIST_INIT;
+ g_thread_state[i].elems = GRPC_CLOSURE_LIST_INIT;
}
gpr_thd_options opt = gpr_thd_options_default();
@@ -172,7 +172,7 @@ static void executor_thread(void *arg) {
}
GRPC_STATS_INC_EXECUTOR_QUEUE_DRAINED(&exec_ctx);
grpc_closure_list exec = ts->elems;
- ts->elems = (grpc_closure_list)GRPC_CLOSURE_LIST_INIT;
+ ts->elems = GRPC_CLOSURE_LIST_INIT;
gpr_mu_unlock(&ts->mu);
if (GRPC_TRACER_ON(executor_trace)) {
gpr_log(GPR_DEBUG, "EXECUTOR[%d]: execute", (int)(ts - g_thread_state));
diff --git a/src/core/lib/iomgr/executor.h b/src/core/lib/iomgr/executor.h
index 0412c02790..ab3fc901de 100644
--- a/src/core/lib/iomgr/executor.h
+++ b/src/core/lib/iomgr/executor.h
@@ -21,6 +21,10 @@
#include "src/core/lib/iomgr/closure.h"
+#ifdef __cplusplus
+extern "C" {
+#endif
+
typedef enum {
GRPC_EXECUTOR_SHORT,
GRPC_EXECUTOR_LONG
@@ -45,4 +49,8 @@ bool grpc_executor_is_threaded();
grpc_executor_shutdown */
void grpc_executor_set_threading(grpc_exec_ctx *exec_ctx, bool enable);
-#endif /* GRPC_CORE_LIB_IOMGR_EXECUTOR_H */
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* GRPC_CORE_LIB_IOMGR_EXECUTOR_H */ \ No newline at end of file
diff --git a/src/core/lib/iomgr/gethostname.h b/src/core/lib/iomgr/gethostname.h
index 9c6b9d8d42..f335fea586 100644
--- a/src/core/lib/iomgr/gethostname.h
+++ b/src/core/lib/iomgr/gethostname.h
@@ -19,8 +19,16 @@
#ifndef GRPC_CORE_LIB_IOMGR_GETHOSTNAME_H
#define GRPC_CORE_LIB_IOMGR_GETHOSTNAME_H
+#ifdef __cplusplus
+extern "C" {
+#endif
+
// Returns the hostname of the local machine.
// Caller takes ownership of result.
char *grpc_gethostname();
+#ifdef __cplusplus
+}
+#endif
+
#endif /* GRPC_CORE_LIB_IOMGR_GETHOSTNAME_H */
diff --git a/src/core/lib/iomgr/gethostname_fallback.c b/src/core/lib/iomgr/gethostname_fallback.cc
index 6229461568..e6f4c2f760 100644
--- a/src/core/lib/iomgr/gethostname_fallback.c
+++ b/src/core/lib/iomgr/gethostname_fallback.cc
@@ -16,6 +16,7 @@
*
*/
+#include "src/core/lib/iomgr/gethostname.h"
#include "src/core/lib/iomgr/port.h"
#ifdef GRPC_GETHOSTNAME_FALLBACK
diff --git a/src/core/lib/iomgr/gethostname_host_name_max.c b/src/core/lib/iomgr/gethostname_host_name_max.cc
index 4d0511412e..cdaf097c3e 100644
--- a/src/core/lib/iomgr/gethostname_host_name_max.c
+++ b/src/core/lib/iomgr/gethostname_host_name_max.cc
@@ -16,6 +16,7 @@
*
*/
+#include "src/core/lib/iomgr/gethostname.h"
#include "src/core/lib/iomgr/port.h"
#ifdef GRPC_POSIX_HOST_NAME_MAX
diff --git a/src/core/lib/iomgr/gethostname_sysconf.c b/src/core/lib/iomgr/gethostname_sysconf.cc
index 51bac5d69d..8441e0615e 100644
--- a/src/core/lib/iomgr/gethostname_sysconf.c
+++ b/src/core/lib/iomgr/gethostname_sysconf.cc
@@ -16,6 +16,7 @@
*
*/
+#include "src/core/lib/iomgr/gethostname.h"
#include "src/core/lib/iomgr/port.h"
#ifdef GRPC_POSIX_SYSCONF
diff --git a/src/core/lib/iomgr/iocp_windows.c b/src/core/lib/iomgr/iocp_windows.cc
index c082179c0b..c082179c0b 100644
--- a/src/core/lib/iomgr/iocp_windows.c
+++ b/src/core/lib/iomgr/iocp_windows.cc
diff --git a/src/core/lib/iomgr/iocp_windows.h b/src/core/lib/iomgr/iocp_windows.h
index 9c89e868c5..341c159501 100644
--- a/src/core/lib/iomgr/iocp_windows.h
+++ b/src/core/lib/iomgr/iocp_windows.h
@@ -23,6 +23,10 @@
#include "src/core/lib/iomgr/socket_windows.h"
+#ifdef __cplusplus
+extern "C" {
+#endif
+
typedef enum {
GRPC_IOCP_WORK_WORK,
GRPC_IOCP_WORK_TIMEOUT,
@@ -37,4 +41,8 @@ void grpc_iocp_flush(void);
void grpc_iocp_shutdown(void);
void grpc_iocp_add_socket(grpc_winsocket *);
-#endif /* GRPC_CORE_LIB_IOMGR_IOCP_WINDOWS_H */
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* GRPC_CORE_LIB_IOMGR_IOCP_WINDOWS_H */ \ No newline at end of file
diff --git a/src/core/lib/iomgr/iomgr.c b/src/core/lib/iomgr/iomgr.cc
index f63f190155..3a0605833a 100644
--- a/src/core/lib/iomgr/iomgr.c
+++ b/src/core/lib/iomgr/iomgr.cc
@@ -16,8 +16,11 @@
*
*/
+#include <grpc/support/port_platform.h>
+
#include "src/core/lib/iomgr/iomgr.h"
+#include <inttypes.h>
#include <stdlib.h>
#include <string.h>
diff --git a/src/core/lib/iomgr/iomgr.h b/src/core/lib/iomgr/iomgr.h
index e3cd6ebe79..fea08496fe 100644
--- a/src/core/lib/iomgr/iomgr.h
+++ b/src/core/lib/iomgr/iomgr.h
@@ -22,6 +22,10 @@
#include <grpc/impl/codegen/exec_ctx_fwd.h>
#include "src/core/lib/iomgr/port.h"
+#ifdef __cplusplus
+extern "C" {
+#endif
+
/** Initializes the iomgr. */
void grpc_iomgr_init(grpc_exec_ctx *exec_ctx);
@@ -32,4 +36,8 @@ void grpc_iomgr_start(grpc_exec_ctx *exec_ctx);
* exec_ctx. */
void grpc_iomgr_shutdown(grpc_exec_ctx *exec_ctx);
-#endif /* GRPC_CORE_LIB_IOMGR_IOMGR_H */
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* GRPC_CORE_LIB_IOMGR_IOMGR_H */ \ No newline at end of file
diff --git a/src/core/lib/iomgr/iomgr_internal.h b/src/core/lib/iomgr/iomgr_internal.h
index 836d82515d..005abbed13 100644
--- a/src/core/lib/iomgr/iomgr_internal.h
+++ b/src/core/lib/iomgr/iomgr_internal.h
@@ -23,6 +23,10 @@
#include "src/core/lib/iomgr/iomgr.h"
+#ifdef __cplusplus
+extern "C" {
+#endif
+
typedef struct grpc_iomgr_object {
char *name;
struct grpc_iomgr_object *next;
@@ -40,4 +44,8 @@ void grpc_iomgr_platform_shutdown(void);
bool grpc_iomgr_abort_on_leaks(void);
-#endif /* GRPC_CORE_LIB_IOMGR_IOMGR_INTERNAL_H */
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* GRPC_CORE_LIB_IOMGR_IOMGR_INTERNAL_H */ \ No newline at end of file
diff --git a/src/core/lib/iomgr/iomgr_posix.c b/src/core/lib/iomgr/iomgr_posix.cc
index f5875a247e..f5875a247e 100644
--- a/src/core/lib/iomgr/iomgr_posix.c
+++ b/src/core/lib/iomgr/iomgr_posix.cc
diff --git a/src/core/lib/iomgr/iomgr_uv.c b/src/core/lib/iomgr/iomgr_uv.cc
index df5d23af3b..df5d23af3b 100644
--- a/src/core/lib/iomgr/iomgr_uv.c
+++ b/src/core/lib/iomgr/iomgr_uv.cc
diff --git a/src/core/lib/iomgr/iomgr_uv.h b/src/core/lib/iomgr/iomgr_uv.h
index 3b4daaa73b..bc42ca8c1c 100644
--- a/src/core/lib/iomgr/iomgr_uv.h
+++ b/src/core/lib/iomgr/iomgr_uv.h
@@ -23,10 +23,18 @@
#include <grpc/support/thd.h>
+#ifdef __cplusplus
+extern "C" {
+#endif
+
/* The thread ID of the thread on which grpc was initialized. Used to verify
* that all calls into libuv are made on that same thread */
extern gpr_thd_id g_init_thread;
+#ifdef __cplusplus
+}
+#endif
+
#ifdef GRPC_UV_THREAD_CHECK
#define GRPC_UV_ASSERT_SAME_THREAD() \
GPR_ASSERT(gpr_thd_currentid() == g_init_thread)
diff --git a/src/core/lib/iomgr/iomgr_windows.c b/src/core/lib/iomgr/iomgr_windows.cc
index 630370166d..630370166d 100644
--- a/src/core/lib/iomgr/iomgr_windows.c
+++ b/src/core/lib/iomgr/iomgr_windows.cc
diff --git a/src/core/lib/iomgr/is_epollexclusive_available.c b/src/core/lib/iomgr/is_epollexclusive_available.cc
index d08844c0df..d08844c0df 100644
--- a/src/core/lib/iomgr/is_epollexclusive_available.c
+++ b/src/core/lib/iomgr/is_epollexclusive_available.cc
diff --git a/src/core/lib/iomgr/is_epollexclusive_available.h b/src/core/lib/iomgr/is_epollexclusive_available.h
index 1d2e133a3b..5c3e483065 100644
--- a/src/core/lib/iomgr/is_epollexclusive_available.h
+++ b/src/core/lib/iomgr/is_epollexclusive_available.h
@@ -21,6 +21,14 @@
#include <stdbool.h>
+#ifdef __cplusplus
+extern "C" {
+#endif
+
bool grpc_is_epollexclusive_available(void);
-#endif /* GRPC_CORE_LIB_IOMGR_IS_EPOLLEXCLUSIVE_AVAILABLE_H */
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* GRPC_CORE_LIB_IOMGR_IS_EPOLLEXCLUSIVE_AVAILABLE_H */ \ No newline at end of file
diff --git a/src/core/lib/iomgr/load_file.c b/src/core/lib/iomgr/load_file.cc
index 0b4d41ea4b..0b4d41ea4b 100644
--- a/src/core/lib/iomgr/load_file.c
+++ b/src/core/lib/iomgr/load_file.cc
diff --git a/src/core/lib/iomgr/lockfree_event.c b/src/core/lib/iomgr/lockfree_event.cc
index f967b22ba9..f967b22ba9 100644
--- a/src/core/lib/iomgr/lockfree_event.c
+++ b/src/core/lib/iomgr/lockfree_event.cc
diff --git a/src/core/lib/iomgr/lockfree_event.h b/src/core/lib/iomgr/lockfree_event.h
index 6a14a0f3b2..925f004945 100644
--- a/src/core/lib/iomgr/lockfree_event.h
+++ b/src/core/lib/iomgr/lockfree_event.h
@@ -25,6 +25,10 @@
#include "src/core/lib/iomgr/exec_ctx.h"
+#ifdef __cplusplus
+extern "C" {
+#endif
+
void grpc_lfev_init(gpr_atm *state);
void grpc_lfev_destroy(gpr_atm *state);
bool grpc_lfev_is_shutdown(gpr_atm *state);
@@ -37,4 +41,8 @@ bool grpc_lfev_set_shutdown(grpc_exec_ctx *exec_ctx, gpr_atm *state,
void grpc_lfev_set_ready(grpc_exec_ctx *exec_ctx, gpr_atm *state,
const char *variable);
-#endif /* GRPC_CORE_LIB_IOMGR_LOCKFREE_EVENT_H */
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* GRPC_CORE_LIB_IOMGR_LOCKFREE_EVENT_H */ \ No newline at end of file
diff --git a/src/core/lib/iomgr/network_status_tracker.c b/src/core/lib/iomgr/network_status_tracker.cc
index 4e5c1d5408..57a7faa9f1 100644
--- a/src/core/lib/iomgr/network_status_tracker.c
+++ b/src/core/lib/iomgr/network_status_tracker.cc
@@ -16,6 +16,7 @@
*
*/
+#include "src/core/lib/iomgr/network_status_tracker.h"
#include "src/core/lib/iomgr/endpoint.h"
void grpc_network_status_shutdown(void) {}
diff --git a/src/core/lib/iomgr/network_status_tracker.h b/src/core/lib/iomgr/network_status_tracker.h
index c0295c1f74..af50d51257 100644
--- a/src/core/lib/iomgr/network_status_tracker.h
+++ b/src/core/lib/iomgr/network_status_tracker.h
@@ -20,6 +20,10 @@
#define GRPC_CORE_LIB_IOMGR_NETWORK_STATUS_TRACKER_H
#include "src/core/lib/iomgr/endpoint.h"
+#ifdef __cplusplus
+extern "C" {
+#endif
+
void grpc_network_status_init(void);
void grpc_network_status_shutdown(void);
@@ -27,4 +31,8 @@ void grpc_network_status_register_endpoint(grpc_endpoint *ep);
void grpc_network_status_unregister_endpoint(grpc_endpoint *ep);
void grpc_network_status_shutdown_all_endpoints();
-#endif /* GRPC_CORE_LIB_IOMGR_NETWORK_STATUS_TRACKER_H */
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* GRPC_CORE_LIB_IOMGR_NETWORK_STATUS_TRACKER_H */ \ No newline at end of file
diff --git a/src/core/lib/iomgr/polling_entity.c b/src/core/lib/iomgr/polling_entity.cc
index 8591a5518e..8591a5518e 100644
--- a/src/core/lib/iomgr/polling_entity.c
+++ b/src/core/lib/iomgr/polling_entity.cc
diff --git a/src/core/lib/iomgr/polling_entity.h b/src/core/lib/iomgr/polling_entity.h
index a161e1fea6..4a37acf212 100644
--- a/src/core/lib/iomgr/polling_entity.h
+++ b/src/core/lib/iomgr/polling_entity.h
@@ -22,6 +22,10 @@
#include "src/core/lib/iomgr/pollset.h"
#include "src/core/lib/iomgr/pollset_set.h"
+#ifdef __cplusplus
+extern "C" {
+#endif
+
typedef enum grpc_pollset_tag {
GRPC_POLLS_NONE,
GRPC_POLLS_POLLSET,
@@ -64,4 +68,8 @@ void grpc_polling_entity_add_to_pollset_set(grpc_exec_ctx *exec_ctx,
void grpc_polling_entity_del_from_pollset_set(grpc_exec_ctx *exec_ctx,
grpc_polling_entity *pollent,
grpc_pollset_set *pss_dst);
-#endif /* GRPC_CORE_LIB_IOMGR_POLLING_ENTITY_H */
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* GRPC_CORE_LIB_IOMGR_POLLING_ENTITY_H */ \ No newline at end of file
diff --git a/src/core/lib/iomgr/pollset.h b/src/core/lib/iomgr/pollset.h
index a0f6b3a9d3..28d63949ea 100644
--- a/src/core/lib/iomgr/pollset.h
+++ b/src/core/lib/iomgr/pollset.h
@@ -25,6 +25,10 @@
#include "src/core/lib/iomgr/exec_ctx.h"
+#ifdef __cplusplus
+extern "C" {
+#endif
+
#ifndef NDEBUG
extern grpc_tracer_flag grpc_trace_fd_refcount;
#endif
@@ -80,4 +84,8 @@ grpc_error *grpc_pollset_kick(grpc_exec_ctx *exec_ctx, grpc_pollset *pollset,
grpc_pollset_worker *specific_worker)
GRPC_MUST_USE_RESULT;
+#ifdef __cplusplus
+}
+#endif
+
#endif /* GRPC_CORE_LIB_IOMGR_POLLSET_H */
diff --git a/src/core/lib/iomgr/pollset_set.h b/src/core/lib/iomgr/pollset_set.h
index 29c0f03561..17df86542d 100644
--- a/src/core/lib/iomgr/pollset_set.h
+++ b/src/core/lib/iomgr/pollset_set.h
@@ -21,6 +21,10 @@
#include "src/core/lib/iomgr/pollset.h"
+#ifdef __cplusplus
+extern "C" {
+#endif
+
/* A grpc_pollset_set is a set of pollsets that are interested in an
action. Adding a pollset to a pollset_set automatically adds any
fd's (etc) that have been registered with the set_set to that pollset.
@@ -44,4 +48,8 @@ void grpc_pollset_set_del_pollset_set(grpc_exec_ctx *exec_ctx,
grpc_pollset_set *bag,
grpc_pollset_set *item);
-#endif /* GRPC_CORE_LIB_IOMGR_POLLSET_SET_H */
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* GRPC_CORE_LIB_IOMGR_POLLSET_SET_H */ \ No newline at end of file
diff --git a/src/core/lib/iomgr/pollset_set_uv.c b/src/core/lib/iomgr/pollset_set_uv.cc
index 90186edbb7..90186edbb7 100644
--- a/src/core/lib/iomgr/pollset_set_uv.c
+++ b/src/core/lib/iomgr/pollset_set_uv.cc
diff --git a/src/core/lib/iomgr/pollset_set_windows.c b/src/core/lib/iomgr/pollset_set_windows.cc
index 2105a47ad4..2105a47ad4 100644
--- a/src/core/lib/iomgr/pollset_set_windows.c
+++ b/src/core/lib/iomgr/pollset_set_windows.cc
diff --git a/src/core/lib/iomgr/pollset_uv.c b/src/core/lib/iomgr/pollset_uv.cc
index 2651325e25..7ea5019ad5 100644
--- a/src/core/lib/iomgr/pollset_uv.c
+++ b/src/core/lib/iomgr/pollset_uv.cc
@@ -65,7 +65,7 @@ void dummy_handle_close_cb(uv_handle_t *handle) { gpr_free(handle); }
void grpc_pollset_global_init(void) {
gpr_mu_init(&grpc_polling_mu);
- dummy_uv_handle = gpr_malloc(sizeof(uv_timer_t));
+ dummy_uv_handle = (uv_timer_t *)gpr_malloc(sizeof(uv_timer_t));
uv_timer_init(uv_default_loop(), dummy_uv_handle);
grpc_pollset_work_run_loop = 1;
}
diff --git a/src/core/lib/iomgr/pollset_uv.h b/src/core/lib/iomgr/pollset_uv.h
index 566c110ca6..d8f72ff867 100644
--- a/src/core/lib/iomgr/pollset_uv.h
+++ b/src/core/lib/iomgr/pollset_uv.h
@@ -19,9 +19,17 @@
#ifndef GRPC_CORE_LIB_IOMGR_POLLSET_UV_H
#define GRPC_CORE_LIB_IOMGR_POLLSET_UV_H
+#ifdef __cplusplus
+extern "C" {
+#endif
+
extern int grpc_pollset_work_run_loop;
void grpc_pollset_global_init(void);
void grpc_pollset_global_shutdown(void);
-#endif /* GRPC_CORE_LIB_IOMGR_POLLSET_UV_H */
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* GRPC_CORE_LIB_IOMGR_POLLSET_UV_H */ \ No newline at end of file
diff --git a/src/core/lib/iomgr/pollset_windows.c b/src/core/lib/iomgr/pollset_windows.cc
index eb295d3eeb..eb295d3eeb 100644
--- a/src/core/lib/iomgr/pollset_windows.c
+++ b/src/core/lib/iomgr/pollset_windows.cc
diff --git a/src/core/lib/iomgr/pollset_windows.h b/src/core/lib/iomgr/pollset_windows.h
index 71878c3d30..7733d26471 100644
--- a/src/core/lib/iomgr/pollset_windows.h
+++ b/src/core/lib/iomgr/pollset_windows.h
@@ -23,6 +23,10 @@
#include "src/core/lib/iomgr/socket_windows.h"
+#ifdef __cplusplus
+extern "C" {
+#endif
+
/* There isn't really any such thing as a pollset under Windows, due to the
nature of the IO completion ports. A Windows "pollset" is merely a mutex
used to synchronize with the IOCP, and workers are condition variables
@@ -60,4 +64,8 @@ struct grpc_pollset {
void grpc_pollset_global_init(void);
void grpc_pollset_global_shutdown(void);
-#endif /* GRPC_CORE_LIB_IOMGR_POLLSET_WINDOWS_H */
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* GRPC_CORE_LIB_IOMGR_POLLSET_WINDOWS_H */ \ No newline at end of file
diff --git a/src/core/lib/iomgr/resolve_address.h b/src/core/lib/iomgr/resolve_address.h
index fe1dd78576..4a6df2cf26 100644
--- a/src/core/lib/iomgr/resolve_address.h
+++ b/src/core/lib/iomgr/resolve_address.h
@@ -25,6 +25,10 @@
#define GRPC_MAX_SOCKADDR_SIZE 128
+#ifdef __cplusplus
+extern "C" {
+#endif
+
typedef struct {
char addr[GRPC_MAX_SOCKADDR_SIZE];
size_t len;
@@ -52,4 +56,8 @@ extern grpc_error *(*grpc_blocking_resolve_address)(
const char *name, const char *default_port,
grpc_resolved_addresses **addresses);
-#endif /* GRPC_CORE_LIB_IOMGR_RESOLVE_ADDRESS_H */
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* GRPC_CORE_LIB_IOMGR_RESOLVE_ADDRESS_H */ \ No newline at end of file
diff --git a/src/core/lib/iomgr/resolve_address_posix.c b/src/core/lib/iomgr/resolve_address_posix.cc
index 60cfeebd47..60cfeebd47 100644
--- a/src/core/lib/iomgr/resolve_address_posix.c
+++ b/src/core/lib/iomgr/resolve_address_posix.cc
diff --git a/src/core/lib/iomgr/resolve_address_uv.c b/src/core/lib/iomgr/resolve_address_uv.cc
index 2d438e8b48..4f7f234877 100644
--- a/src/core/lib/iomgr/resolve_address_uv.c
+++ b/src/core/lib/iomgr/resolve_address_uv.cc
@@ -49,11 +49,12 @@ static int retry_named_port_failure(int status, request *r,
uv_getaddrinfo_cb getaddrinfo_cb) {
if (status != 0) {
// This loop is copied from resolve_address_posix.c
- char *svc[][2] = {{"http", "80"}, {"https", "443"}};
+ const char *svc[][2] = {{"http", "80"}, {"https", "443"}};
for (size_t i = 0; i < GPR_ARRAY_SIZE(svc); i++) {
if (strcmp(r->port, svc[i][0]) == 0) {
int retry_status;
- uv_getaddrinfo_t *req = gpr_malloc(sizeof(uv_getaddrinfo_t));
+ uv_getaddrinfo_t *req =
+ (uv_getaddrinfo_t *)gpr_malloc(sizeof(uv_getaddrinfo_t));
req->data = r;
r->port = gpr_strdup(svc[i][1]);
retry_status = uv_getaddrinfo(uv_default_loop(), req, getaddrinfo_cb,
@@ -85,13 +86,14 @@ static grpc_error *handle_addrinfo_result(int status, struct addrinfo *result,
grpc_slice_from_static_string(uv_strerror(status)));
return error;
}
- (*addresses) = gpr_malloc(sizeof(grpc_resolved_addresses));
+ (*addresses) =
+ (grpc_resolved_addresses *)gpr_malloc(sizeof(grpc_resolved_addresses));
(*addresses)->naddrs = 0;
for (resp = result; resp != NULL; resp = resp->ai_next) {
(*addresses)->naddrs++;
}
- (*addresses)->addrs =
- gpr_malloc(sizeof(grpc_resolved_address) * (*addresses)->naddrs);
+ (*addresses)->addrs = (grpc_resolved_address *)gpr_malloc(
+ sizeof(grpc_resolved_address) * (*addresses)->naddrs);
i = 0;
for (resp = result; resp != NULL; resp = resp->ai_next) {
memcpy(&(*addresses)->addrs[i].addr, resp->ai_addr, resp->ai_addrlen);
@@ -174,6 +176,7 @@ static grpc_error *blocking_resolve_address_impl(
int s;
grpc_error *err;
int retry_status;
+ request r;
GRPC_UV_ASSERT_SAME_THREAD();
@@ -191,8 +194,10 @@ static grpc_error *blocking_resolve_address_impl(
hints.ai_flags = AI_PASSIVE; /* for wildcard IP address */
s = uv_getaddrinfo(uv_default_loop(), &req, NULL, host, port, &hints);
- request r = {
- .addresses = addresses, .hints = &hints, .host = host, .port = port};
+ r.addresses = addresses;
+ r.hints = &hints;
+ r.host = host;
+ r.port = port;
retry_status = retry_named_port_failure(s, &r, NULL);
if (retry_status <= 0) {
s = retry_status;
@@ -239,16 +244,16 @@ static void resolve_address_impl(grpc_exec_ctx *exec_ctx, const char *name,
gpr_free(port);
return;
}
- r = gpr_malloc(sizeof(request));
+ r = (request *)gpr_malloc(sizeof(request));
r->on_done = on_done;
r->addresses = addrs;
r->host = host;
r->port = port;
- req = gpr_malloc(sizeof(uv_getaddrinfo_t));
+ req = (uv_getaddrinfo_t *)gpr_malloc(sizeof(uv_getaddrinfo_t));
req->data = r;
/* Call getaddrinfo */
- hints = gpr_malloc(sizeof(struct addrinfo));
+ hints = (addrinfo *)gpr_malloc(sizeof(struct addrinfo));
memset(hints, 0, sizeof(struct addrinfo));
hints->ai_family = AF_UNSPEC; /* ipv4 or ipv6 */
hints->ai_socktype = SOCK_STREAM; /* stream socket */
diff --git a/src/core/lib/iomgr/resolve_address_windows.c b/src/core/lib/iomgr/resolve_address_windows.cc
index 0cb0029f4e..abcfc2114d 100644
--- a/src/core/lib/iomgr/resolve_address_windows.c
+++ b/src/core/lib/iomgr/resolve_address_windows.cc
@@ -23,6 +23,7 @@
#include "src/core/lib/iomgr/resolve_address.h"
+#include <inttypes.h>
#include <string.h>
#include <sys/types.h>
@@ -93,13 +94,14 @@ static grpc_error *blocking_resolve_address_impl(
}
/* Success path: set addrs non-NULL, fill it in */
- (*addresses) = gpr_malloc(sizeof(grpc_resolved_addresses));
+ (*addresses) =
+ (grpc_resolved_addresses *)gpr_malloc(sizeof(grpc_resolved_addresses));
(*addresses)->naddrs = 0;
for (resp = result; resp != NULL; resp = resp->ai_next) {
(*addresses)->naddrs++;
}
- (*addresses)->addrs =
- gpr_malloc(sizeof(grpc_resolved_address) * (*addresses)->naddrs);
+ (*addresses)->addrs = (grpc_resolved_address *)gpr_malloc(
+ sizeof(grpc_resolved_address) * (*addresses)->naddrs);
i = 0;
for (resp = result; resp != NULL; resp = resp->ai_next) {
memcpy(&(*addresses)->addrs[i].addr, resp->ai_addr, resp->ai_addrlen);
@@ -132,7 +134,7 @@ grpc_error *(*grpc_blocking_resolve_address)(
* grpc_blocking_resolve_address */
static void do_request_thread(grpc_exec_ctx *exec_ctx, void *rp,
grpc_error *error) {
- request *r = rp;
+ request *r = (request *)rp;
if (error == GRPC_ERROR_NONE) {
error =
grpc_blocking_resolve_address(r->name, r->default_port, r->addresses);
@@ -157,7 +159,7 @@ static void resolve_address_impl(grpc_exec_ctx *exec_ctx, const char *name,
grpc_pollset_set *interested_parties,
grpc_closure *on_done,
grpc_resolved_addresses **addresses) {
- request *r = gpr_malloc(sizeof(request));
+ request *r = (request *)gpr_malloc(sizeof(request));
GRPC_CLOSURE_INIT(&r->request_closure, do_request_thread, r,
grpc_executor_scheduler(GRPC_EXECUTOR_SHORT));
r->name = gpr_strdup(name);
diff --git a/src/core/lib/iomgr/resource_quota.c b/src/core/lib/iomgr/resource_quota.cc
index 4d69986fbc..60262435b3 100644
--- a/src/core/lib/iomgr/resource_quota.c
+++ b/src/core/lib/iomgr/resource_quota.cc
@@ -18,6 +18,7 @@
#include "src/core/lib/iomgr/resource_quota.h"
+#include <inttypes.h>
#include <limits.h>
#include <stdint.h>
#include <string.h>
diff --git a/src/core/lib/iomgr/resource_quota.h b/src/core/lib/iomgr/resource_quota.h
index d66f9ae774..3afb525434 100644
--- a/src/core/lib/iomgr/resource_quota.h
+++ b/src/core/lib/iomgr/resource_quota.h
@@ -24,6 +24,10 @@
#include "src/core/lib/debug/trace.h"
#include "src/core/lib/iomgr/exec_ctx.h"
+#ifdef __cplusplus
+extern "C" {
+#endif
+
/** \file Tracks resource usage against a pool.
The current implementation tracks only memory usage, but in the future
@@ -150,4 +154,8 @@ grpc_slice grpc_resource_user_slice_malloc(grpc_exec_ctx *exec_ctx,
grpc_resource_user *resource_user,
size_t size);
-#endif /* GRPC_CORE_LIB_IOMGR_RESOURCE_QUOTA_H */
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* GRPC_CORE_LIB_IOMGR_RESOURCE_QUOTA_H */ \ No newline at end of file
diff --git a/src/core/lib/iomgr/sockaddr_utils.c b/src/core/lib/iomgr/sockaddr_utils.cc
index 3f4145d104..8a2e6ed89b 100644
--- a/src/core/lib/iomgr/sockaddr_utils.c
+++ b/src/core/lib/iomgr/sockaddr_utils.cc
@@ -19,6 +19,7 @@
#include "src/core/lib/iomgr/sockaddr_utils.h"
#include <errno.h>
+#include <inttypes.h>
#include <string.h>
#include <grpc/support/alloc.h>
diff --git a/src/core/lib/iomgr/sockaddr_utils.h b/src/core/lib/iomgr/sockaddr_utils.h
index a589a19705..129bb54fc9 100644
--- a/src/core/lib/iomgr/sockaddr_utils.h
+++ b/src/core/lib/iomgr/sockaddr_utils.h
@@ -21,6 +21,10 @@
#include "src/core/lib/iomgr/resolve_address.h"
+#ifdef __cplusplus
+extern "C" {
+#endif
+
/* Returns true if addr is an IPv4-mapped IPv6 address within the
::ffff:0.0.0.0/96 range, or false otherwise.
@@ -77,4 +81,8 @@ const char *grpc_sockaddr_get_uri_scheme(const grpc_resolved_address *addr);
int grpc_sockaddr_get_family(const grpc_resolved_address *resolved_addr);
-#endif /* GRPC_CORE_LIB_IOMGR_SOCKADDR_UTILS_H */
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* GRPC_CORE_LIB_IOMGR_SOCKADDR_UTILS_H */ \ No newline at end of file
diff --git a/src/core/lib/iomgr/socket_factory_posix.c b/src/core/lib/iomgr/socket_factory_posix.cc
index 8e907703ae..8e907703ae 100644
--- a/src/core/lib/iomgr/socket_factory_posix.c
+++ b/src/core/lib/iomgr/socket_factory_posix.cc
diff --git a/src/core/lib/iomgr/socket_mutator.c b/src/core/lib/iomgr/socket_mutator.cc
index b0435d5a07..b0435d5a07 100644
--- a/src/core/lib/iomgr/socket_mutator.c
+++ b/src/core/lib/iomgr/socket_mutator.cc
diff --git a/src/core/lib/iomgr/socket_utils.h b/src/core/lib/iomgr/socket_utils.h
index 03fe46e5e9..f319e931b6 100644
--- a/src/core/lib/iomgr/socket_utils.h
+++ b/src/core/lib/iomgr/socket_utils.h
@@ -21,7 +21,15 @@
#include <stddef.h>
+#ifdef __cplusplus
+extern "C" {
+#endif
+
/* A wrapper for inet_ntop on POSIX systems and InetNtop on Windows systems */
const char *grpc_inet_ntop(int af, const void *src, char *dst, size_t size);
-#endif /* GRPC_CORE_LIB_IOMGR_SOCKET_UTILS_H */
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* GRPC_CORE_LIB_IOMGR_SOCKET_UTILS_H */ \ No newline at end of file
diff --git a/src/core/lib/iomgr/socket_utils_common_posix.c b/src/core/lib/iomgr/socket_utils_common_posix.cc
index b8e2a0cdfd..b8e2a0cdfd 100644
--- a/src/core/lib/iomgr/socket_utils_common_posix.c
+++ b/src/core/lib/iomgr/socket_utils_common_posix.cc
diff --git a/src/core/lib/iomgr/socket_utils_linux.c b/src/core/lib/iomgr/socket_utils_linux.cc
index e7b094d216..e7b094d216 100644
--- a/src/core/lib/iomgr/socket_utils_linux.c
+++ b/src/core/lib/iomgr/socket_utils_linux.cc
diff --git a/src/core/lib/iomgr/socket_utils_posix.c b/src/core/lib/iomgr/socket_utils_posix.cc
index dfd1ffd1e3..dfd1ffd1e3 100644
--- a/src/core/lib/iomgr/socket_utils_posix.c
+++ b/src/core/lib/iomgr/socket_utils_posix.cc
diff --git a/src/core/lib/iomgr/socket_utils_posix.h b/src/core/lib/iomgr/socket_utils_posix.h
index eef80b439e..623b83f08b 100644
--- a/src/core/lib/iomgr/socket_utils_posix.h
+++ b/src/core/lib/iomgr/socket_utils_posix.h
@@ -29,6 +29,10 @@
#include "src/core/lib/iomgr/socket_factory_posix.h"
#include "src/core/lib/iomgr/socket_mutator.h"
+#ifdef __cplusplus
+extern "C" {
+#endif
+
/* a wrapper for accept or accept4 */
int grpc_accept4(int sockfd, grpc_resolved_address *resolved_addr, int nonblock,
int cloexec);
@@ -129,4 +133,8 @@ grpc_error *grpc_create_dualstack_socket_using_factory(
grpc_socket_factory *factory, const grpc_resolved_address *addr, int type,
int protocol, grpc_dualstack_mode *dsmode, int *newfd);
-#endif /* GRPC_CORE_LIB_IOMGR_SOCKET_UTILS_POSIX_H */
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* GRPC_CORE_LIB_IOMGR_SOCKET_UTILS_POSIX_H */ \ No newline at end of file
diff --git a/src/core/lib/iomgr/socket_utils_uv.c b/src/core/lib/iomgr/socket_utils_uv.cc
index 0f7de4dfad..0f7de4dfad 100644
--- a/src/core/lib/iomgr/socket_utils_uv.c
+++ b/src/core/lib/iomgr/socket_utils_uv.cc
diff --git a/src/core/lib/iomgr/socket_utils_windows.c b/src/core/lib/iomgr/socket_utils_windows.cc
index 6e85e4b61f..6e85e4b61f 100644
--- a/src/core/lib/iomgr/socket_utils_windows.c
+++ b/src/core/lib/iomgr/socket_utils_windows.cc
diff --git a/src/core/lib/iomgr/socket_windows.c b/src/core/lib/iomgr/socket_windows.cc
index a0d731b942..8c7f7cf683 100644
--- a/src/core/lib/iomgr/socket_windows.c
+++ b/src/core/lib/iomgr/socket_windows.cc
@@ -38,7 +38,7 @@
grpc_winsocket *grpc_winsocket_create(SOCKET socket, const char *name) {
char *final_name;
- grpc_winsocket *r = gpr_malloc(sizeof(grpc_winsocket));
+ grpc_winsocket *r = (grpc_winsocket *)gpr_malloc(sizeof(grpc_winsocket));
memset(r, 0, sizeof(grpc_winsocket));
r->socket = socket;
gpr_mu_init(&r->state_mu);
diff --git a/src/core/lib/iomgr/socket_windows.h b/src/core/lib/iomgr/socket_windows.h
index 67dc4ca53e..a00a7615a3 100644
--- a/src/core/lib/iomgr/socket_windows.h
+++ b/src/core/lib/iomgr/socket_windows.h
@@ -28,6 +28,10 @@
#include "src/core/lib/iomgr/exec_ctx.h"
#include "src/core/lib/iomgr/iomgr_internal.h"
+#ifdef __cplusplus
+extern "C" {
+#endif
+
/* This holds the data for an outstanding read or write on a socket.
The mutex to protect the concurrent access to that data is the one
inside the winsocket wrapper. */
@@ -107,4 +111,8 @@ void grpc_socket_become_ready(grpc_exec_ctx *exec_ctx,
grpc_winsocket *winsocket,
grpc_winsocket_callback_info *ci);
-#endif /* GRPC_CORE_LIB_IOMGR_SOCKET_WINDOWS_H */
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* GRPC_CORE_LIB_IOMGR_SOCKET_WINDOWS_H */ \ No newline at end of file
diff --git a/src/core/lib/iomgr/tcp_client.h b/src/core/lib/iomgr/tcp_client.h
index 6c9e51ae84..18cf6114f2 100644
--- a/src/core/lib/iomgr/tcp_client.h
+++ b/src/core/lib/iomgr/tcp_client.h
@@ -25,6 +25,10 @@
#include "src/core/lib/iomgr/pollset_set.h"
#include "src/core/lib/iomgr/resolve_address.h"
+#ifdef __cplusplus
+extern "C" {
+#endif
+
/* Asynchronously connect to an address (specified as (addr, len)), and call
cb with arg and the completed connection when done (or call cb with arg and
NULL on failure).
@@ -37,4 +41,8 @@ void grpc_tcp_client_connect(grpc_exec_ctx *exec_ctx, grpc_closure *on_connect,
const grpc_resolved_address *addr,
gpr_timespec deadline);
-#endif /* GRPC_CORE_LIB_IOMGR_TCP_CLIENT_H */
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* GRPC_CORE_LIB_IOMGR_TCP_CLIENT_H */ \ No newline at end of file
diff --git a/src/core/lib/iomgr/tcp_client_posix.c b/src/core/lib/iomgr/tcp_client_posix.cc
index 39dbb506e2..7d9e9533fd 100644
--- a/src/core/lib/iomgr/tcp_client_posix.c
+++ b/src/core/lib/iomgr/tcp_client_posix.cc
@@ -337,11 +337,13 @@ done:
}
// overridden by api_fuzzer.c
+extern "C" {
void (*grpc_tcp_client_connect_impl)(
grpc_exec_ctx *exec_ctx, grpc_closure *closure, grpc_endpoint **ep,
grpc_pollset_set *interested_parties, const grpc_channel_args *channel_args,
const grpc_resolved_address *addr,
gpr_timespec deadline) = tcp_client_connect_impl;
+}
void grpc_tcp_client_connect(grpc_exec_ctx *exec_ctx, grpc_closure *closure,
grpc_endpoint **ep,
diff --git a/src/core/lib/iomgr/tcp_client_posix.h b/src/core/lib/iomgr/tcp_client_posix.h
index b5a3814799..0b9775504c 100644
--- a/src/core/lib/iomgr/tcp_client_posix.h
+++ b/src/core/lib/iomgr/tcp_client_posix.h
@@ -23,8 +23,16 @@
#include "src/core/lib/iomgr/ev_posix.h"
#include "src/core/lib/iomgr/tcp_client.h"
+#ifdef __cplusplus
+extern "C" {
+#endif
+
grpc_endpoint *grpc_tcp_client_create_from_fd(
grpc_exec_ctx *exec_ctx, grpc_fd *fd, const grpc_channel_args *channel_args,
const char *addr_str);
-#endif /* GRPC_CORE_LIB_IOMGR_TCP_CLIENT_POSIX_H */
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* GRPC_CORE_LIB_IOMGR_TCP_CLIENT_POSIX_H */ \ No newline at end of file
diff --git a/src/core/lib/iomgr/tcp_client_uv.c b/src/core/lib/iomgr/tcp_client_uv.cc
index 0d9e7ed5f6..83835978f4 100644
--- a/src/core/lib/iomgr/tcp_client_uv.c
+++ b/src/core/lib/iomgr/tcp_client_uv.cc
@@ -58,7 +58,7 @@ static void tcp_close_callback(uv_handle_t *handle) { gpr_free(handle); }
static void uv_tc_on_alarm(grpc_exec_ctx *exec_ctx, void *acp,
grpc_error *error) {
int done;
- grpc_uv_tcp_connect *connect = acp;
+ grpc_uv_tcp_connect *connect = (grpc_uv_tcp_connect *)acp;
if (GRPC_TRACER_ON(grpc_tcp_trace)) {
const char *str = grpc_error_string(error);
gpr_log(GPR_DEBUG, "CLIENT_CONNECT: %s: on_alarm: error=%s",
@@ -77,7 +77,7 @@ static void uv_tc_on_alarm(grpc_exec_ctx *exec_ctx, void *acp,
}
static void uv_tc_on_connect(uv_connect_t *req, int status) {
- grpc_uv_tcp_connect *connect = req->data;
+ grpc_uv_tcp_connect *connect = (grpc_uv_tcp_connect *)req->data;
grpc_exec_ctx exec_ctx = GRPC_EXEC_CTX_INIT;
grpc_error *error = GRPC_ERROR_NONE;
int done;
@@ -132,15 +132,15 @@ static void tcp_client_connect_impl(grpc_exec_ctx *exec_ctx,
if (0 == strcmp(channel_args->args[i].key, GRPC_ARG_RESOURCE_QUOTA)) {
grpc_resource_quota_unref_internal(exec_ctx, resource_quota);
resource_quota = grpc_resource_quota_ref_internal(
- channel_args->args[i].value.pointer.p);
+ (grpc_resource_quota *)channel_args->args[i].value.pointer.p);
}
}
}
- connect = gpr_zalloc(sizeof(grpc_uv_tcp_connect));
+ connect = (grpc_uv_tcp_connect *)gpr_zalloc(sizeof(grpc_uv_tcp_connect));
connect->closure = closure;
connect->endpoint = ep;
- connect->tcp_handle = gpr_malloc(sizeof(uv_tcp_t));
+ connect->tcp_handle = (uv_tcp_t *)gpr_malloc(sizeof(uv_tcp_t));
connect->addr_name = grpc_sockaddr_to_uri(resolved_addr);
connect->resource_quota = resource_quota;
uv_tcp_init(uv_default_loop(), connect->tcp_handle);
@@ -164,11 +164,13 @@ static void tcp_client_connect_impl(grpc_exec_ctx *exec_ctx,
}
// overridden by api_fuzzer.c
+extern "C" {
void (*grpc_tcp_client_connect_impl)(
grpc_exec_ctx *exec_ctx, grpc_closure *closure, grpc_endpoint **ep,
grpc_pollset_set *interested_parties, const grpc_channel_args *channel_args,
const grpc_resolved_address *addr,
gpr_timespec deadline) = tcp_client_connect_impl;
+}
void grpc_tcp_client_connect(grpc_exec_ctx *exec_ctx, grpc_closure *closure,
grpc_endpoint **ep,
diff --git a/src/core/lib/iomgr/tcp_client_windows.c b/src/core/lib/iomgr/tcp_client_windows.cc
index fc62105cc9..1154965c82 100644
--- a/src/core/lib/iomgr/tcp_client_windows.c
+++ b/src/core/lib/iomgr/tcp_client_windows.cc
@@ -18,6 +18,8 @@
#include "src/core/lib/iomgr/port.h"
+#include <inttypes.h>
+
#ifdef GRPC_WINSOCK_SOCKET
#include "src/core/lib/iomgr/sockaddr_windows.h"
@@ -66,7 +68,7 @@ static void async_connect_unlock_and_cleanup(grpc_exec_ctx *exec_ctx,
}
static void on_alarm(grpc_exec_ctx *exec_ctx, void *acp, grpc_error *error) {
- async_connect *ac = acp;
+ async_connect *ac = (async_connect *)acp;
gpr_mu_lock(&ac->mu);
grpc_winsocket *socket = ac->socket;
ac->socket = NULL;
@@ -77,7 +79,7 @@ static void on_alarm(grpc_exec_ctx *exec_ctx, void *acp, grpc_error *error) {
}
static void on_connect(grpc_exec_ctx *exec_ctx, void *acp, grpc_error *error) {
- async_connect *ac = acp;
+ async_connect *ac = (async_connect *)acp;
grpc_endpoint **ep = ac->endpoint;
GPR_ASSERT(*ep == NULL);
grpc_closure *on_done = ac->on_done;
@@ -193,7 +195,7 @@ static void tcp_client_connect_impl(
}
}
- ac = gpr_malloc(sizeof(async_connect));
+ ac = (async_connect *)gpr_malloc(sizeof(async_connect));
ac->on_done = on_done;
ac->socket = socket;
gpr_mu_init(&ac->mu);
@@ -226,11 +228,13 @@ failure:
}
// overridden by api_fuzzer.c
+extern "C" {
void (*grpc_tcp_client_connect_impl)(
grpc_exec_ctx *exec_ctx, grpc_closure *closure, grpc_endpoint **ep,
grpc_pollset_set *interested_parties, const grpc_channel_args *channel_args,
const grpc_resolved_address *addr,
gpr_timespec deadline) = tcp_client_connect_impl;
+}
void grpc_tcp_client_connect(grpc_exec_ctx *exec_ctx, grpc_closure *closure,
grpc_endpoint **ep,
diff --git a/src/core/lib/iomgr/tcp_posix.c b/src/core/lib/iomgr/tcp_posix.cc
index 7e271294fd..7e271294fd 100644
--- a/src/core/lib/iomgr/tcp_posix.c
+++ b/src/core/lib/iomgr/tcp_posix.cc
diff --git a/src/core/lib/iomgr/tcp_posix.h b/src/core/lib/iomgr/tcp_posix.h
index 6831a4a57f..dda78b2f8e 100644
--- a/src/core/lib/iomgr/tcp_posix.h
+++ b/src/core/lib/iomgr/tcp_posix.h
@@ -33,6 +33,10 @@
#include "src/core/lib/iomgr/endpoint.h"
#include "src/core/lib/iomgr/ev_posix.h"
+#ifdef __cplusplus
+extern "C" {
+#endif
+
extern grpc_tracer_flag grpc_tcp_trace;
/* Create a tcp endpoint given a file desciptor and a read slice size.
@@ -53,4 +57,8 @@ int grpc_tcp_fd(grpc_endpoint *ep);
void grpc_tcp_destroy_and_release_fd(grpc_exec_ctx *exec_ctx, grpc_endpoint *ep,
int *fd, grpc_closure *done);
-#endif /* GRPC_CORE_LIB_IOMGR_TCP_POSIX_H */
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* GRPC_CORE_LIB_IOMGR_TCP_POSIX_H */ \ No newline at end of file
diff --git a/src/core/lib/iomgr/tcp_server.h b/src/core/lib/iomgr/tcp_server.h
index 8a126b6dee..3f190ac285 100644
--- a/src/core/lib/iomgr/tcp_server.h
+++ b/src/core/lib/iomgr/tcp_server.h
@@ -25,6 +25,10 @@
#include "src/core/lib/iomgr/endpoint.h"
#include "src/core/lib/iomgr/resolve_address.h"
+#ifdef __cplusplus
+extern "C" {
+#endif
+
/* Forward decl of grpc_tcp_server */
typedef struct grpc_tcp_server grpc_tcp_server;
@@ -98,4 +102,8 @@ void grpc_tcp_server_unref(grpc_exec_ctx *exec_ctx, grpc_tcp_server *s);
void grpc_tcp_server_shutdown_listeners(grpc_exec_ctx *exec_ctx,
grpc_tcp_server *s);
-#endif /* GRPC_CORE_LIB_IOMGR_TCP_SERVER_H */
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* GRPC_CORE_LIB_IOMGR_TCP_SERVER_H */ \ No newline at end of file
diff --git a/src/core/lib/iomgr/tcp_server_posix.c b/src/core/lib/iomgr/tcp_server_posix.cc
index 06612d639c..06612d639c 100644
--- a/src/core/lib/iomgr/tcp_server_posix.c
+++ b/src/core/lib/iomgr/tcp_server_posix.cc
diff --git a/src/core/lib/iomgr/tcp_server_utils_posix.h b/src/core/lib/iomgr/tcp_server_utils_posix.h
index 85dea515d9..4bb0660f09 100644
--- a/src/core/lib/iomgr/tcp_server_utils_posix.h
+++ b/src/core/lib/iomgr/tcp_server_utils_posix.h
@@ -24,6 +24,10 @@
#include "src/core/lib/iomgr/socket_utils_posix.h"
#include "src/core/lib/iomgr/tcp_server.h"
+#ifdef __cplusplus
+extern "C" {
+#endif
+
/* one listening port */
typedef struct grpc_tcp_listener {
int fd;
@@ -117,4 +121,8 @@ grpc_error *grpc_tcp_server_prepare_socket(int fd,
/* Ruturn true if the platform supports ifaddrs */
bool grpc_tcp_server_have_ifaddrs(void);
-#endif /* GRPC_CORE_LIB_IOMGR_TCP_SERVER_UTILS_POSIX_H */
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* GRPC_CORE_LIB_IOMGR_TCP_SERVER_UTILS_POSIX_H */ \ No newline at end of file
diff --git a/src/core/lib/iomgr/tcp_server_utils_posix_common.c b/src/core/lib/iomgr/tcp_server_utils_posix_common.cc
index a828bee074..a828bee074 100644
--- a/src/core/lib/iomgr/tcp_server_utils_posix_common.c
+++ b/src/core/lib/iomgr/tcp_server_utils_posix_common.cc
diff --git a/src/core/lib/iomgr/tcp_server_utils_posix_ifaddrs.c b/src/core/lib/iomgr/tcp_server_utils_posix_ifaddrs.cc
index a243b69f35..a243b69f35 100644
--- a/src/core/lib/iomgr/tcp_server_utils_posix_ifaddrs.c
+++ b/src/core/lib/iomgr/tcp_server_utils_posix_ifaddrs.cc
diff --git a/src/core/lib/iomgr/tcp_server_utils_posix_noifaddrs.c b/src/core/lib/iomgr/tcp_server_utils_posix_noifaddrs.cc
index 34eab20d6a..34eab20d6a 100644
--- a/src/core/lib/iomgr/tcp_server_utils_posix_noifaddrs.c
+++ b/src/core/lib/iomgr/tcp_server_utils_posix_noifaddrs.cc
diff --git a/src/core/lib/iomgr/tcp_server_uv.c b/src/core/lib/iomgr/tcp_server_uv.cc
index 3b9332321f..348838c495 100644
--- a/src/core/lib/iomgr/tcp_server_uv.c
+++ b/src/core/lib/iomgr/tcp_server_uv.cc
@@ -77,14 +77,14 @@ grpc_error *grpc_tcp_server_create(grpc_exec_ctx *exec_ctx,
grpc_closure *shutdown_complete,
const grpc_channel_args *args,
grpc_tcp_server **server) {
- grpc_tcp_server *s = gpr_malloc(sizeof(grpc_tcp_server));
+ grpc_tcp_server *s = (grpc_tcp_server *)gpr_malloc(sizeof(grpc_tcp_server));
s->resource_quota = grpc_resource_quota_create(NULL);
for (size_t i = 0; i < (args == NULL ? 0 : args->num_args); i++) {
if (0 == strcmp(GRPC_ARG_RESOURCE_QUOTA, args->args[i].key)) {
if (args->args[i].type == GRPC_ARG_POINTER) {
grpc_resource_quota_unref_internal(exec_ctx, s->resource_quota);
- s->resource_quota =
- grpc_resource_quota_ref_internal(args->args[i].value.pointer.p);
+ s->resource_quota = grpc_resource_quota_ref_internal(
+ (grpc_resource_quota *)args->args[i].value.pointer.p);
} else {
grpc_resource_quota_unref_internal(exec_ctx, s->resource_quota);
gpr_free(s);
@@ -190,15 +190,16 @@ void grpc_tcp_server_unref(grpc_exec_ctx *exec_ctx, grpc_tcp_server *s) {
}
static void finish_accept(grpc_exec_ctx *exec_ctx, grpc_tcp_listener *sp) {
- grpc_tcp_server_acceptor *acceptor = gpr_malloc(sizeof(*acceptor));
- uv_tcp_t *client;
+ grpc_tcp_server_acceptor *acceptor =
+ (grpc_tcp_server_acceptor *)gpr_malloc(sizeof(*acceptor));
+ uv_tcp_t *client = NULL;
grpc_endpoint *ep = NULL;
grpc_resolved_address peer_name;
char *peer_name_string;
int err;
uv_tcp_t *server = sp->handle;
- client = gpr_malloc(sizeof(uv_tcp_t));
+ client = (uv_tcp_t *)gpr_malloc(sizeof(uv_tcp_t));
uv_tcp_init(uv_default_loop(), client);
// UV documentation says this is guaranteed to succeed
uv_accept((uv_stream_t *)server, (uv_stream_t *)client);
@@ -303,7 +304,7 @@ static grpc_error *add_socket_to_server(grpc_tcp_server *s, uv_tcp_t *handle,
GPR_ASSERT(port >= 0);
GPR_ASSERT(!s->on_accept_cb && "must add ports before starting server");
- sp = gpr_zalloc(sizeof(grpc_tcp_listener));
+ sp = (grpc_tcp_listener *)gpr_zalloc(sizeof(grpc_tcp_listener));
sp->next = NULL;
if (s->head == NULL) {
s->head = sp;
@@ -355,7 +356,8 @@ grpc_error *grpc_tcp_server_add_port(grpc_tcp_server *s,
(int *)&sockname_temp.len)) {
*port = grpc_sockaddr_get_port(&sockname_temp);
if (*port > 0) {
- allocated_addr = gpr_malloc(sizeof(grpc_resolved_address));
+ allocated_addr = (grpc_resolved_address *)gpr_malloc(
+ sizeof(grpc_resolved_address));
memcpy(allocated_addr, addr, sizeof(grpc_resolved_address));
grpc_sockaddr_set_port(allocated_addr, *port);
addr = allocated_addr;
@@ -376,7 +378,7 @@ grpc_error *grpc_tcp_server_add_port(grpc_tcp_server *s,
addr = &wildcard;
}
- handle = gpr_malloc(sizeof(uv_tcp_t));
+ handle = (uv_tcp_t *)gpr_malloc(sizeof(uv_tcp_t));
family = grpc_sockaddr_get_family(addr);
status = uv_tcp_init_ex(uv_default_loop(), handle, (unsigned int)family);
diff --git a/src/core/lib/iomgr/tcp_server_windows.c b/src/core/lib/iomgr/tcp_server_windows.cc
index 0162afc1ad..f198aaaa5b 100644
--- a/src/core/lib/iomgr/tcp_server_windows.c
+++ b/src/core/lib/iomgr/tcp_server_windows.cc
@@ -22,6 +22,7 @@
#include "src/core/lib/iomgr/sockaddr.h"
+#include <inttypes.h>
#include <io.h>
#include <grpc/support/alloc.h>
@@ -97,7 +98,7 @@ grpc_error *grpc_tcp_server_create(grpc_exec_ctx *exec_ctx,
grpc_closure *shutdown_complete,
const grpc_channel_args *args,
grpc_tcp_server **server) {
- grpc_tcp_server *s = gpr_malloc(sizeof(grpc_tcp_server));
+ grpc_tcp_server *s = (grpc_tcp_server *)gpr_malloc(sizeof(grpc_tcp_server));
s->channel_args = grpc_channel_args_copy(args);
gpr_ref_init(&s->refs, 1);
gpr_mu_init(&s->mu);
@@ -115,7 +116,7 @@ grpc_error *grpc_tcp_server_create(grpc_exec_ctx *exec_ctx,
static void destroy_server(grpc_exec_ctx *exec_ctx, void *arg,
grpc_error *error) {
- grpc_tcp_server *s = arg;
+ grpc_tcp_server *s = (grpc_tcp_server *)arg;
/* Now that the accepts have been aborted, we can destroy the sockets.
The IOCP won't get notified on these, so we can flag them as already
@@ -188,6 +189,7 @@ static grpc_error *prepare_socket(SOCKET sock,
int *port) {
grpc_resolved_address sockname_temp;
grpc_error *error = GRPC_ERROR_NONE;
+ int sockname_temp_len;
error = grpc_tcp_prepare_socket(sock);
if (error != GRPC_ERROR_NONE) {
@@ -205,7 +207,7 @@ static grpc_error *prepare_socket(SOCKET sock,
goto failure;
}
- int sockname_temp_len = sizeof(struct sockaddr_storage);
+ sockname_temp_len = sizeof(struct sockaddr_storage);
if (getsockname(sock, (struct sockaddr *)sockname_temp.addr,
&sockname_temp_len) == SOCKET_ERROR) {
error = GRPC_WSA_ERROR(WSAGetLastError(), "getsockname");
@@ -294,7 +296,7 @@ failure:
/* Event manager callback when reads are ready. */
static void on_accept(grpc_exec_ctx *exec_ctx, void *arg, grpc_error *error) {
- grpc_tcp_listener *sp = arg;
+ grpc_tcp_listener *sp = (grpc_tcp_listener *)arg;
SOCKET sock = sp->new_socket;
grpc_winsocket_callback_info *info = &sp->socket->read_info;
grpc_endpoint *ep = NULL;
@@ -368,7 +370,8 @@ static void on_accept(grpc_exec_ctx *exec_ctx, void *arg, grpc_error *error) {
managed to accept a connection, and created an endpoint. */
if (ep) {
// Create acceptor.
- grpc_tcp_server_acceptor *acceptor = gpr_malloc(sizeof(*acceptor));
+ grpc_tcp_server_acceptor *acceptor =
+ (grpc_tcp_server_acceptor *)gpr_malloc(sizeof(*acceptor));
acceptor->from_server = sp->server;
acceptor->port_index = sp->port_index;
acceptor->fd_index = 0;
@@ -421,7 +424,7 @@ static grpc_error *add_socket_to_server(grpc_tcp_server *s, SOCKET sock,
GPR_ASSERT(port >= 0);
gpr_mu_lock(&s->mu);
GPR_ASSERT(!s->on_accept_cb && "must add ports before starting server");
- sp = gpr_malloc(sizeof(grpc_tcp_listener));
+ sp = (grpc_tcp_listener *)gpr_malloc(sizeof(grpc_tcp_listener));
sp->next = NULL;
if (s->head == NULL) {
s->head = sp;
@@ -472,7 +475,8 @@ grpc_error *grpc_tcp_server_add_port(grpc_tcp_server *s,
sockname_temp.len = (size_t)sockname_temp_len;
*port = grpc_sockaddr_get_port(&sockname_temp);
if (*port > 0) {
- allocated_addr = gpr_malloc(sizeof(grpc_resolved_address));
+ allocated_addr = (grpc_resolved_address *)gpr_malloc(
+ sizeof(grpc_resolved_address));
memcpy(allocated_addr, addr, sizeof(grpc_resolved_address));
grpc_sockaddr_set_port(allocated_addr, *port);
addr = allocated_addr;
diff --git a/src/core/lib/iomgr/tcp_uv.c b/src/core/lib/iomgr/tcp_uv.cc
index a05c19b4ac..e311964dbc 100644
--- a/src/core/lib/iomgr/tcp_uv.c
+++ b/src/core/lib/iomgr/tcp_uv.cc
@@ -114,7 +114,7 @@ static void tcp_ref(grpc_tcp *tcp) { gpr_ref(&tcp->refcount); }
static void uv_close_callback(uv_handle_t *handle) {
grpc_exec_ctx exec_ctx = GRPC_EXEC_CTX_INIT;
- grpc_tcp *tcp = handle->data;
+ grpc_tcp *tcp = (grpc_tcp *)handle->data;
TCP_UNREF(&exec_ctx, tcp, "destroy");
grpc_exec_ctx_finish(&exec_ctx);
}
@@ -128,7 +128,7 @@ static grpc_slice alloc_read_slice(grpc_exec_ctx *exec_ctx,
static void alloc_uv_buf(uv_handle_t *handle, size_t suggested_size,
uv_buf_t *buf) {
grpc_exec_ctx exec_ctx = GRPC_EXEC_CTX_INIT;
- grpc_tcp *tcp = handle->data;
+ grpc_tcp *tcp = (grpc_tcp *)handle->data;
(void)suggested_size;
buf->base = (char *)GRPC_SLICE_START_PTR(tcp->read_slice);
buf->len = GRPC_SLICE_LENGTH(tcp->read_slice);
@@ -140,7 +140,7 @@ static void read_callback(uv_stream_t *stream, ssize_t nread,
grpc_slice sub;
grpc_error *error;
grpc_exec_ctx exec_ctx = GRPC_EXEC_CTX_INIT;
- grpc_tcp *tcp = stream->data;
+ grpc_tcp *tcp = (grpc_tcp *)stream->data;
grpc_closure *cb = tcp->read_cb;
if (nread == 0) {
// Nothing happened. Wait for the next callback
@@ -207,7 +207,7 @@ static void uv_endpoint_read(grpc_exec_ctx *exec_ctx, grpc_endpoint *ep,
}
static void write_callback(uv_write_t *req, int status) {
- grpc_tcp *tcp = req->data;
+ grpc_tcp *tcp = (grpc_tcp *)req->data;
grpc_error *error;
grpc_exec_ctx exec_ctx = GRPC_EXEC_CTX_INIT;
grpc_closure *cb = tcp->write_cb;
@@ -269,7 +269,7 @@ static void uv_endpoint_write(grpc_exec_ctx *exec_ctx, grpc_endpoint *ep,
tcp->write_cb = cb;
buffer_count = (unsigned int)tcp->write_slices->count;
- buffers = gpr_malloc(sizeof(uv_buf_t) * buffer_count);
+ buffers = (uv_buf_t *)gpr_malloc(sizeof(uv_buf_t) * buffer_count);
grpc_resource_user_alloc(exec_ctx, tcp->resource_user,
sizeof(uv_buf_t) * buffer_count, NULL);
for (i = 0; i < buffer_count; i++) {
diff --git a/src/core/lib/iomgr/tcp_uv.h b/src/core/lib/iomgr/tcp_uv.h
index 0e67481d35..ba7db8a0f7 100644
--- a/src/core/lib/iomgr/tcp_uv.h
+++ b/src/core/lib/iomgr/tcp_uv.h
@@ -38,8 +38,16 @@ extern grpc_tracer_flag grpc_tcp_trace;
#define GRPC_TCP_DEFAULT_READ_SLICE_SIZE 8192
+#ifdef __cplusplus
+extern "C" {
+#endif
+
grpc_endpoint *grpc_tcp_create(uv_tcp_t *handle,
grpc_resource_quota *resource_quota,
char *peer_string);
-#endif /* GRPC_CORE_LIB_IOMGR_TCP_UV_H */
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* GRPC_CORE_LIB_IOMGR_TCP_UV_H */ \ No newline at end of file
diff --git a/src/core/lib/iomgr/tcp_windows.c b/src/core/lib/iomgr/tcp_windows.cc
index 2cbb97403b..dc84e564a9 100644
--- a/src/core/lib/iomgr/tcp_windows.c
+++ b/src/core/lib/iomgr/tcp_windows.cc
@@ -37,6 +37,7 @@
#include "src/core/lib/iomgr/sockaddr_utils.h"
#include "src/core/lib/iomgr/socket_windows.h"
#include "src/core/lib/iomgr/tcp_client.h"
+#include "src/core/lib/iomgr/tcp_windows.h"
#include "src/core/lib/iomgr/timer.h"
#include "src/core/lib/slice/slice_internal.h"
@@ -158,7 +159,7 @@ static void tcp_ref(grpc_tcp *tcp) { gpr_ref(&tcp->refcount); }
/* Asynchronous callback from the IOCP, or the background thread. */
static void on_read(grpc_exec_ctx *exec_ctx, void *tcpp, grpc_error *error) {
- grpc_tcp *tcp = tcpp;
+ grpc_tcp *tcp = (grpc_tcp *)tcpp;
grpc_closure *cb = tcp->read_cb;
grpc_winsocket *socket = tcp->socket;
grpc_slice sub;
@@ -418,14 +419,14 @@ static grpc_endpoint_vtable vtable = {
grpc_endpoint *grpc_tcp_create(grpc_exec_ctx *exec_ctx, grpc_winsocket *socket,
grpc_channel_args *channel_args,
- char *peer_string) {
+ const char *peer_string) {
grpc_resource_quota *resource_quota = grpc_resource_quota_create(NULL);
if (channel_args != NULL) {
for (size_t i = 0; i < channel_args->num_args; i++) {
if (0 == strcmp(channel_args->args[i].key, GRPC_ARG_RESOURCE_QUOTA)) {
grpc_resource_quota_unref_internal(exec_ctx, resource_quota);
resource_quota = grpc_resource_quota_ref_internal(
- channel_args->args[i].value.pointer.p);
+ (grpc_resource_quota *)channel_args->args[i].value.pointer.p);
}
}
}
diff --git a/src/core/lib/iomgr/tcp_windows.h b/src/core/lib/iomgr/tcp_windows.h
index 864184ce84..f3697f707c 100644
--- a/src/core/lib/iomgr/tcp_windows.h
+++ b/src/core/lib/iomgr/tcp_windows.h
@@ -32,13 +32,21 @@
#include "src/core/lib/iomgr/endpoint.h"
#include "src/core/lib/iomgr/socket_windows.h"
+#ifdef __cplusplus
+extern "C" {
+#endif
+
/* Create a tcp endpoint given a winsock handle.
* Takes ownership of the handle.
*/
grpc_endpoint *grpc_tcp_create(grpc_exec_ctx *exec_ctx, grpc_winsocket *socket,
grpc_channel_args *channel_args,
- char *peer_string);
+ const char *peer_string);
grpc_error *grpc_tcp_prepare_socket(SOCKET sock);
+#ifdef __cplusplus
+}
+#endif
+
#endif /* GRPC_CORE_LIB_IOMGR_TCP_WINDOWS_H */
diff --git a/src/core/lib/iomgr/time_averaged_stats.c b/src/core/lib/iomgr/time_averaged_stats.cc
index 3bddec04dd..3bddec04dd 100644
--- a/src/core/lib/iomgr/time_averaged_stats.c
+++ b/src/core/lib/iomgr/time_averaged_stats.cc
diff --git a/src/core/lib/iomgr/time_averaged_stats.h b/src/core/lib/iomgr/time_averaged_stats.h
index 8745f7fa13..e255b58fee 100644
--- a/src/core/lib/iomgr/time_averaged_stats.h
+++ b/src/core/lib/iomgr/time_averaged_stats.h
@@ -19,6 +19,10 @@
#ifndef GRPC_CORE_LIB_IOMGR_TIME_AVERAGED_STATS_H
#define GRPC_CORE_LIB_IOMGR_TIME_AVERAGED_STATS_H
+#ifdef __cplusplus
+extern "C" {
+#endif
+
/* This tracks a time-decaying weighted average. It works by collecting
batches of samples and then mixing their average into a time-decaying
weighted mean. It is designed for batch operations where we do many adds
@@ -70,4 +74,8 @@ void grpc_time_averaged_stats_add_sample(grpc_time_averaged_stats* stats,
value. */
double grpc_time_averaged_stats_update_average(grpc_time_averaged_stats* stats);
-#endif /* GRPC_CORE_LIB_IOMGR_TIME_AVERAGED_STATS_H */
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* GRPC_CORE_LIB_IOMGR_TIME_AVERAGED_STATS_H */ \ No newline at end of file
diff --git a/src/core/lib/iomgr/timer.h b/src/core/lib/iomgr/timer.h
index ac392f87fe..466600d582 100644
--- a/src/core/lib/iomgr/timer.h
+++ b/src/core/lib/iomgr/timer.h
@@ -32,6 +32,10 @@
#include "src/core/lib/iomgr/exec_ctx.h"
#include "src/core/lib/iomgr/iomgr.h"
+#ifdef __cplusplus
+extern "C" {
+#endif
+
typedef struct grpc_timer grpc_timer;
/* Initialize *timer. When expired or canceled, closure will be called with
@@ -103,4 +107,8 @@ void grpc_timer_consume_kick(void);
void grpc_kick_poller(void);
+#ifdef __cplusplus
+}
+#endif
+
#endif /* GRPC_CORE_LIB_IOMGR_TIMER_H */
diff --git a/src/core/lib/iomgr/timer_generic.c b/src/core/lib/iomgr/timer_generic.cc
index 2472cf26be..971d80d8bc 100644
--- a/src/core/lib/iomgr/timer_generic.c
+++ b/src/core/lib/iomgr/timer_generic.cc
@@ -18,6 +18,8 @@
#include "src/core/lib/iomgr/port.h"
+#include <inttypes.h>
+
#ifdef GRPC_TIMER_USE_GENERIC
#include "src/core/lib/iomgr/timer.h"
@@ -41,9 +43,11 @@
#define MIN_QUEUE_WINDOW_DURATION 0.01
#define MAX_QUEUE_WINDOW_DURATION 1
+extern "C" {
grpc_tracer_flag grpc_timer_trace = GRPC_TRACER_INITIALIZER(false, "timer");
grpc_tracer_flag grpc_timer_check_trace =
GRPC_TRACER_INITIALIZER(false, "timer_check");
+}
/* A "timer shard". Contains a 'heap' and a 'list' of timers. All timers with
* deadlines earlier than 'queue_deadline" cap are maintained in the heap and
diff --git a/src/core/lib/iomgr/timer_heap.c b/src/core/lib/iomgr/timer_heap.cc
index 2648d5da5d..2648d5da5d 100644
--- a/src/core/lib/iomgr/timer_heap.c
+++ b/src/core/lib/iomgr/timer_heap.cc
diff --git a/src/core/lib/iomgr/timer_heap.h b/src/core/lib/iomgr/timer_heap.h
index 0d64199ab9..f15e8a3abb 100644
--- a/src/core/lib/iomgr/timer_heap.h
+++ b/src/core/lib/iomgr/timer_heap.h
@@ -21,6 +21,10 @@
#include "src/core/lib/iomgr/timer.h"
+#ifdef __cplusplus
+extern "C" {
+#endif
+
typedef struct {
grpc_timer **timers;
uint32_t timer_count;
@@ -39,4 +43,8 @@ void grpc_timer_heap_pop(grpc_timer_heap *heap);
int grpc_timer_heap_is_empty(grpc_timer_heap *heap);
-#endif /* GRPC_CORE_LIB_IOMGR_TIMER_HEAP_H */
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* GRPC_CORE_LIB_IOMGR_TIMER_HEAP_H */ \ No newline at end of file
diff --git a/src/core/lib/iomgr/timer_manager.c b/src/core/lib/iomgr/timer_manager.cc
index 04ca44563d..9b54fab898 100644
--- a/src/core/lib/iomgr/timer_manager.c
+++ b/src/core/lib/iomgr/timer_manager.cc
@@ -20,8 +20,11 @@
#include <grpc/support/alloc.h>
#include <grpc/support/log.h>
+#include <grpc/support/port_platform.h>
#include <grpc/support/thd.h>
+#include <inttypes.h>
+
#include "src/core/lib/debug/trace.h"
#include "src/core/lib/iomgr/timer.h"
@@ -30,7 +33,7 @@ typedef struct completed_thread {
struct completed_thread *next;
} completed_thread;
-extern grpc_tracer_flag grpc_timer_check_trace;
+extern "C" grpc_tracer_flag grpc_timer_check_trace;
// global mutex
static gpr_mu g_mu;
diff --git a/src/core/lib/iomgr/timer_manager.h b/src/core/lib/iomgr/timer_manager.h
index 0ba502928a..d8a59a9477 100644
--- a/src/core/lib/iomgr/timer_manager.h
+++ b/src/core/lib/iomgr/timer_manager.h
@@ -21,6 +21,10 @@
#include <stdbool.h>
+#ifdef __cplusplus
+extern "C" {
+#endif
+
/* Timer Manager tries to keep one thread waiting for the next timeout at all
times */
@@ -34,4 +38,8 @@ void grpc_timer_manager_set_threading(bool enabled);
* disabled */
void grpc_timer_manager_tick(void);
-#endif /* GRPC_CORE_LIB_IOMGR_TIMER_MANAGER_H */
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* GRPC_CORE_LIB_IOMGR_TIMER_MANAGER_H */ \ No newline at end of file
diff --git a/src/core/lib/iomgr/timer_uv.c b/src/core/lib/iomgr/timer_uv.cc
index adced41f53..53f79b545a 100644
--- a/src/core/lib/iomgr/timer_uv.c
+++ b/src/core/lib/iomgr/timer_uv.cc
@@ -29,9 +29,11 @@
#include <uv.h>
+extern "C" {
grpc_tracer_flag grpc_timer_trace = GRPC_TRACER_INITIALIZER(false, "timer");
grpc_tracer_flag grpc_timer_check_trace =
GRPC_TRACER_INITIALIZER(false, "timer_check");
+}
static void timer_close_callback(uv_handle_t *handle) { gpr_free(handle); }
@@ -66,7 +68,7 @@ void grpc_timer_init(grpc_exec_ctx *exec_ctx, grpc_timer *timer,
}
timer->pending = 1;
timeout = (uint64_t)gpr_time_to_millis(gpr_time_sub(deadline, now));
- uv_timer = gpr_malloc(sizeof(uv_timer_t));
+ uv_timer = (uv_timer_t *)gpr_malloc(sizeof(uv_timer_t));
uv_timer_init(uv_default_loop(), uv_timer);
uv_timer->data = timer;
timer->uv_timer = uv_timer;
diff --git a/src/core/lib/iomgr/udp_server.c b/src/core/lib/iomgr/udp_server.cc
index 00b2e68bb5..00b2e68bb5 100644
--- a/src/core/lib/iomgr/udp_server.c
+++ b/src/core/lib/iomgr/udp_server.cc
diff --git a/src/core/lib/iomgr/udp_server.h b/src/core/lib/iomgr/udp_server.h
index 881468ea2c..bcd8572260 100644
--- a/src/core/lib/iomgr/udp_server.h
+++ b/src/core/lib/iomgr/udp_server.h
@@ -23,6 +23,10 @@
#include "src/core/lib/iomgr/ev_posix.h"
#include "src/core/lib/iomgr/resolve_address.h"
+#ifdef __cplusplus
+extern "C" {
+#endif
+
/* Forward decl of struct grpc_server */
/* This is not typedef'ed to avoid a typedef-redefinition error */
struct grpc_server;
@@ -73,4 +77,8 @@ int grpc_udp_server_add_port(grpc_udp_server *s,
void grpc_udp_server_destroy(grpc_exec_ctx *exec_ctx, grpc_udp_server *server,
grpc_closure *on_done);
-#endif /* GRPC_CORE_LIB_IOMGR_UDP_SERVER_H */
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* GRPC_CORE_LIB_IOMGR_UDP_SERVER_H */ \ No newline at end of file
diff --git a/src/core/lib/iomgr/unix_sockets_posix.c b/src/core/lib/iomgr/unix_sockets_posix.cc
index 35f898f13a..35f898f13a 100644
--- a/src/core/lib/iomgr/unix_sockets_posix.c
+++ b/src/core/lib/iomgr/unix_sockets_posix.cc
diff --git a/src/core/lib/iomgr/unix_sockets_posix.h b/src/core/lib/iomgr/unix_sockets_posix.h
index 25b64b3eec..b96131ae1c 100644
--- a/src/core/lib/iomgr/unix_sockets_posix.h
+++ b/src/core/lib/iomgr/unix_sockets_posix.h
@@ -25,6 +25,10 @@
#include "src/core/lib/iomgr/resolve_address.h"
+#ifdef __cplusplus
+extern "C" {
+#endif
+
void grpc_create_socketpair_if_unix(int sv[2]);
grpc_error *grpc_resolve_unix_domain_address(
@@ -38,4 +42,8 @@ void grpc_unlink_if_unix_domain_socket(
char *grpc_sockaddr_to_uri_unix_if_possible(
const grpc_resolved_address *resolved_addr);
-#endif /* GRPC_CORE_LIB_IOMGR_UNIX_SOCKETS_POSIX_H */
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* GRPC_CORE_LIB_IOMGR_UNIX_SOCKETS_POSIX_H */ \ No newline at end of file
diff --git a/src/core/lib/iomgr/unix_sockets_posix_noop.c b/src/core/lib/iomgr/unix_sockets_posix_noop.cc
index e46b1c003d..e46b1c003d 100644
--- a/src/core/lib/iomgr/unix_sockets_posix_noop.c
+++ b/src/core/lib/iomgr/unix_sockets_posix_noop.cc
diff --git a/src/core/lib/iomgr/wakeup_fd_cv.c b/src/core/lib/iomgr/wakeup_fd_cv.cc
index 268e0175dd..268e0175dd 100644
--- a/src/core/lib/iomgr/wakeup_fd_cv.c
+++ b/src/core/lib/iomgr/wakeup_fd_cv.cc
diff --git a/src/core/lib/iomgr/wakeup_fd_cv.h b/src/core/lib/iomgr/wakeup_fd_cv.h
index dc170ad5b4..dcd7bdb560 100644
--- a/src/core/lib/iomgr/wakeup_fd_cv.h
+++ b/src/core/lib/iomgr/wakeup_fd_cv.h
@@ -40,6 +40,10 @@
#define GRPC_FD_TO_IDX(fd) (-(fd)-1)
#define GRPC_IDX_TO_FD(idx) (-(idx)-1)
+#ifdef __cplusplus
+extern "C" {
+#endif
+
typedef struct cv_node {
gpr_cv* cv;
struct cv_node* next;
@@ -62,4 +66,10 @@ typedef struct cv_fd_table {
grpc_poll_function_type poll;
} cv_fd_table;
+extern const grpc_wakeup_fd_vtable grpc_cv_wakeup_fd_vtable;
+
+#ifdef __cplusplus
+}
+#endif
+
#endif /* GRPC_CORE_LIB_IOMGR_WAKEUP_FD_CV_H */
diff --git a/src/core/lib/iomgr/wakeup_fd_eventfd.c b/src/core/lib/iomgr/wakeup_fd_eventfd.cc
index 81cb7ee280..81cb7ee280 100644
--- a/src/core/lib/iomgr/wakeup_fd_eventfd.c
+++ b/src/core/lib/iomgr/wakeup_fd_eventfd.cc
diff --git a/src/core/lib/iomgr/wakeup_fd_nospecial.c b/src/core/lib/iomgr/wakeup_fd_nospecial.cc
index 4c20b8c1b7..4c20b8c1b7 100644
--- a/src/core/lib/iomgr/wakeup_fd_nospecial.c
+++ b/src/core/lib/iomgr/wakeup_fd_nospecial.cc
diff --git a/src/core/lib/iomgr/wakeup_fd_pipe.c b/src/core/lib/iomgr/wakeup_fd_pipe.cc
index 4189488f8a..05d69dc9cc 100644
--- a/src/core/lib/iomgr/wakeup_fd_pipe.c
+++ b/src/core/lib/iomgr/wakeup_fd_pipe.cc
@@ -20,6 +20,7 @@
#ifdef GRPC_POSIX_WAKEUP_FD
+#include "src/core/lib/iomgr/wakeup_fd_pipe.h"
#include "src/core/lib/iomgr/wakeup_fd_posix.h"
#include <errno.h>
diff --git a/src/core/lib/iomgr/wakeup_fd_pipe.h b/src/core/lib/iomgr/wakeup_fd_pipe.h
index f860406bda..9bbb5e2ff7 100644
--- a/src/core/lib/iomgr/wakeup_fd_pipe.h
+++ b/src/core/lib/iomgr/wakeup_fd_pipe.h
@@ -21,6 +21,14 @@
#include "src/core/lib/iomgr/wakeup_fd_posix.h"
-extern grpc_wakeup_fd_vtable grpc_pipe_wakeup_fd_vtable;
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+extern const grpc_wakeup_fd_vtable grpc_pipe_wakeup_fd_vtable;
+
+#ifdef __cplusplus
+}
+#endif
#endif /* GRPC_CORE_LIB_IOMGR_WAKEUP_FD_PIPE_H */
diff --git a/src/core/lib/iomgr/wakeup_fd_posix.c b/src/core/lib/iomgr/wakeup_fd_posix.cc
index 25daa7d3fb..9af96d314b 100644
--- a/src/core/lib/iomgr/wakeup_fd_posix.c
+++ b/src/core/lib/iomgr/wakeup_fd_posix.cc
@@ -25,7 +25,6 @@
#include "src/core/lib/iomgr/wakeup_fd_pipe.h"
#include "src/core/lib/iomgr/wakeup_fd_posix.h"
-extern grpc_wakeup_fd_vtable grpc_cv_wakeup_fd_vtable;
static const grpc_wakeup_fd_vtable *wakeup_fd_vtable = NULL;
int grpc_allow_specialized_wakeup_fd = 1;
diff --git a/src/core/lib/iomgr/wakeup_fd_posix.h b/src/core/lib/iomgr/wakeup_fd_posix.h
index a9584d0d48..ae7849f98c 100644
--- a/src/core/lib/iomgr/wakeup_fd_posix.h
+++ b/src/core/lib/iomgr/wakeup_fd_posix.h
@@ -49,6 +49,10 @@
#include "src/core/lib/iomgr/error.h"
+#ifdef __cplusplus
+extern "C" {
+#endif
+
void grpc_wakeup_fd_global_init(void);
void grpc_wakeup_fd_global_destroy(void);
@@ -91,4 +95,8 @@ void grpc_wakeup_fd_destroy(grpc_wakeup_fd* fd_info);
* wakeup_fd_nospecial.c if no such implementation exists. */
extern const grpc_wakeup_fd_vtable grpc_specialized_wakeup_fd_vtable;
+#ifdef __cplusplus
+}
+#endif
+
#endif /* GRPC_CORE_LIB_IOMGR_WAKEUP_FD_POSIX_H */
diff --git a/src/core/lib/json/json.c b/src/core/lib/json/json.cc
index 4ad51f662a..4ad51f662a 100644
--- a/src/core/lib/json/json.c
+++ b/src/core/lib/json/json.cc
diff --git a/src/core/lib/json/json.h b/src/core/lib/json/json.h
index bbd43025eb..81b7e0c9da 100644
--- a/src/core/lib/json/json.h
+++ b/src/core/lib/json/json.h
@@ -23,6 +23,10 @@
#include "src/core/lib/json/json_common.h"
+#ifdef __cplusplus
+extern "C" {
+#endif
+
/* A tree-like structure to hold json values. The key and value pointers
* are not owned by it.
*/
@@ -70,4 +74,8 @@ char* grpc_json_dump_to_string(grpc_json* json, int indent);
grpc_json* grpc_json_create(grpc_json_type type);
void grpc_json_destroy(grpc_json* json);
-#endif /* GRPC_CORE_LIB_JSON_JSON_H */
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* GRPC_CORE_LIB_JSON_JSON_H */ \ No newline at end of file
diff --git a/src/core/lib/json/json_reader.c b/src/core/lib/json/json_reader.cc
index 094a35176c..094a35176c 100644
--- a/src/core/lib/json/json_reader.c
+++ b/src/core/lib/json/json_reader.cc
diff --git a/src/core/lib/json/json_reader.h b/src/core/lib/json/json_reader.h
index 577fbbbaf6..ab2384f7a7 100644
--- a/src/core/lib/json/json_reader.h
+++ b/src/core/lib/json/json_reader.h
@@ -22,6 +22,10 @@
#include <grpc/support/port_platform.h>
#include "src/core/lib/json/json_common.h"
+#ifdef __cplusplus
+extern "C" {
+#endif
+
typedef enum {
GRPC_JSON_STATE_OBJECT_KEY_BEGIN,
GRPC_JSON_STATE_OBJECT_KEY_STRING,
@@ -142,4 +146,8 @@ void grpc_json_reader_init(grpc_json_reader *reader,
*/
int grpc_json_reader_is_complete(grpc_json_reader *reader);
-#endif /* GRPC_CORE_LIB_JSON_JSON_READER_H */
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* GRPC_CORE_LIB_JSON_JSON_READER_H */ \ No newline at end of file
diff --git a/src/core/lib/json/json_string.c b/src/core/lib/json/json_string.cc
index 3178d2d2b4..3178d2d2b4 100644
--- a/src/core/lib/json/json_string.c
+++ b/src/core/lib/json/json_string.cc
diff --git a/src/core/lib/json/json_writer.c b/src/core/lib/json/json_writer.cc
index eab1bff7a6..eab1bff7a6 100644
--- a/src/core/lib/json/json_writer.c
+++ b/src/core/lib/json/json_writer.cc
diff --git a/src/core/lib/json/json_writer.h b/src/core/lib/json/json_writer.h
index 8779039d42..18bd2a80fe 100644
--- a/src/core/lib/json/json_writer.h
+++ b/src/core/lib/json/json_writer.h
@@ -35,6 +35,10 @@
#include "src/core/lib/json/json_common.h"
+#ifdef __cplusplus
+extern "C" {
+#endif
+
typedef struct grpc_json_writer_vtable {
/* Adds a character to the output stream. */
void (*output_char)(void *userdata, char);
@@ -79,4 +83,8 @@ void grpc_json_writer_value_raw_with_len(grpc_json_writer *writer,
void grpc_json_writer_value_string(grpc_json_writer *writer,
const char *string);
-#endif /* GRPC_CORE_LIB_JSON_JSON_WRITER_H */
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* GRPC_CORE_LIB_JSON_JSON_WRITER_H */ \ No newline at end of file
diff --git a/src/core/lib/profiling/basic_timers.c b/src/core/lib/profiling/basic_timers.cc
index c7645b74f2..ab9d60481c 100644
--- a/src/core/lib/profiling/basic_timers.c
+++ b/src/core/lib/profiling/basic_timers.cc
@@ -18,10 +18,10 @@
#include <grpc/support/port_platform.h>
-#ifdef GRPC_BASIC_PROFILER
-
#include "src/core/lib/profiling/timers.h"
+#ifdef GRPC_BASIC_PROFILER
+
#include <grpc/support/alloc.h>
#include <grpc/support/log.h>
#include <grpc/support/sync.h>
diff --git a/src/core/lib/profiling/stap_timers.c b/src/core/lib/profiling/stap_timers.cc
index c86d74f058..c86d74f058 100644
--- a/src/core/lib/profiling/stap_timers.c
+++ b/src/core/lib/profiling/stap_timers.cc
diff --git a/src/core/lib/security/context/security_context.c b/src/core/lib/security/context/security_context.cc
index 8fff2c92c5..31d800b9b4 100644
--- a/src/core/lib/security/context/security_context.c
+++ b/src/core/lib/security/context/security_context.cc
@@ -82,7 +82,8 @@ void grpc_auth_context_release(grpc_auth_context *context) {
/* --- grpc_client_security_context --- */
grpc_client_security_context *grpc_client_security_context_create(void) {
- return gpr_zalloc(sizeof(grpc_client_security_context));
+ return (grpc_client_security_context *)gpr_zalloc(
+ sizeof(grpc_client_security_context));
}
void grpc_client_security_context_destroy(void *ctx) {
@@ -100,7 +101,8 @@ void grpc_client_security_context_destroy(void *ctx) {
/* --- grpc_server_security_context --- */
grpc_server_security_context *grpc_server_security_context_create(void) {
- return gpr_zalloc(sizeof(grpc_server_security_context));
+ return (grpc_server_security_context *)gpr_zalloc(
+ sizeof(grpc_server_security_context));
}
void grpc_server_security_context_destroy(void *ctx) {
@@ -117,7 +119,8 @@ void grpc_server_security_context_destroy(void *ctx) {
static grpc_auth_property_iterator empty_iterator = {NULL, 0, NULL};
grpc_auth_context *grpc_auth_context_create(grpc_auth_context *chained) {
- grpc_auth_context *ctx = gpr_zalloc(sizeof(grpc_auth_context));
+ grpc_auth_context *ctx =
+ (grpc_auth_context *)gpr_zalloc(sizeof(grpc_auth_context));
gpr_ref_init(&ctx->refcount, 1);
if (chained != NULL) {
ctx->chained = GRPC_AUTH_CONTEXT_REF(chained, "chained");
@@ -258,9 +261,9 @@ static void ensure_auth_context_capacity(grpc_auth_context *ctx) {
if (ctx->properties.count == ctx->properties.capacity) {
ctx->properties.capacity =
GPR_MAX(ctx->properties.capacity + 8, ctx->properties.capacity * 2);
- ctx->properties.array =
- gpr_realloc(ctx->properties.array,
- ctx->properties.capacity * sizeof(grpc_auth_property));
+ ctx->properties.array = (grpc_auth_property *)gpr_realloc(
+ ctx->properties.array,
+ ctx->properties.capacity * sizeof(grpc_auth_property));
}
}
@@ -275,7 +278,7 @@ void grpc_auth_context_add_property(grpc_auth_context *ctx, const char *name,
ensure_auth_context_capacity(ctx);
prop = &ctx->properties.array[ctx->properties.count++];
prop->name = gpr_strdup(name);
- prop->value = gpr_malloc(value_length + 1);
+ prop->value = (char *)gpr_malloc(value_length + 1);
memcpy(prop->value, value, value_length);
prop->value[value_length] = '\0';
prop->value_length = value_length;
@@ -302,11 +305,12 @@ void grpc_auth_property_reset(grpc_auth_property *property) {
}
static void auth_context_pointer_arg_destroy(grpc_exec_ctx *exec_ctx, void *p) {
- GRPC_AUTH_CONTEXT_UNREF(p, "auth_context_pointer_arg");
+ GRPC_AUTH_CONTEXT_UNREF((grpc_auth_context *)p, "auth_context_pointer_arg");
}
static void *auth_context_pointer_arg_copy(void *p) {
- return GRPC_AUTH_CONTEXT_REF(p, "auth_context_pointer_arg");
+ return GRPC_AUTH_CONTEXT_REF((grpc_auth_context *)p,
+ "auth_context_pointer_arg");
}
static int auth_context_pointer_cmp(void *a, void *b) { return GPR_ICMP(a, b); }
@@ -316,7 +320,7 @@ static const grpc_arg_pointer_vtable auth_context_pointer_vtable = {
auth_context_pointer_cmp};
grpc_arg grpc_auth_context_to_arg(grpc_auth_context *p) {
- return grpc_channel_arg_pointer_create(GRPC_AUTH_CONTEXT_ARG, p,
+ return grpc_channel_arg_pointer_create((char *)GRPC_AUTH_CONTEXT_ARG, p,
&auth_context_pointer_vtable);
}
@@ -327,7 +331,7 @@ grpc_auth_context *grpc_auth_context_from_arg(const grpc_arg *arg) {
GRPC_AUTH_CONTEXT_ARG);
return NULL;
}
- return arg->value.pointer.p;
+ return (grpc_auth_context *)arg->value.pointer.p;
}
grpc_auth_context *grpc_find_auth_context_in_args(
diff --git a/src/core/lib/security/credentials/composite/composite_credentials.c b/src/core/lib/security/credentials/composite/composite_credentials.cc
index b67ff48d0f..779300ac07 100644
--- a/src/core/lib/security/credentials/composite/composite_credentials.c
+++ b/src/core/lib/security/credentials/composite/composite_credentials.cc
@@ -79,7 +79,8 @@ static bool composite_call_get_request_metadata(
grpc_error **error) {
grpc_composite_call_credentials *c = (grpc_composite_call_credentials *)creds;
grpc_composite_call_credentials_metadata_context *ctx;
- ctx = gpr_zalloc(sizeof(grpc_composite_call_credentials_metadata_context));
+ ctx = (grpc_composite_call_credentials_metadata_context *)gpr_zalloc(
+ sizeof(grpc_composite_call_credentials_metadata_context));
ctx->composite_creds = c;
ctx->pollent = pollent;
ctx->auth_md_context = auth_md_context;
@@ -146,7 +147,8 @@ grpc_call_credentials *grpc_composite_call_credentials_create(
GPR_ASSERT(reserved == NULL);
GPR_ASSERT(creds1 != NULL);
GPR_ASSERT(creds2 != NULL);
- c = gpr_zalloc(sizeof(grpc_composite_call_credentials));
+ c = (grpc_composite_call_credentials *)gpr_zalloc(
+ sizeof(grpc_composite_call_credentials));
c->base.type = GRPC_CALL_CREDENTIALS_TYPE_COMPOSITE;
c->base.vtable = &composite_call_credentials_vtable;
gpr_ref_init(&c->base.refcount, 1);
@@ -154,7 +156,8 @@ grpc_call_credentials *grpc_composite_call_credentials_create(
creds2_array = get_creds_array(&creds2);
c->inner.num_creds = creds1_array.num_creds + creds2_array.num_creds;
creds_array_byte_size = c->inner.num_creds * sizeof(grpc_call_credentials *);
- c->inner.creds_array = gpr_zalloc(creds_array_byte_size);
+ c->inner.creds_array =
+ (grpc_call_credentials **)gpr_zalloc(creds_array_byte_size);
for (i = 0; i < creds1_array.num_creds; i++) {
grpc_call_credentials *cur_creds = creds1_array.creds_array[i];
c->inner.creds_array[i] = grpc_call_credentials_ref(cur_creds);
@@ -248,7 +251,8 @@ static grpc_channel_credentials_vtable composite_channel_credentials_vtable = {
grpc_channel_credentials *grpc_composite_channel_credentials_create(
grpc_channel_credentials *channel_creds, grpc_call_credentials *call_creds,
void *reserved) {
- grpc_composite_channel_credentials *c = gpr_zalloc(sizeof(*c));
+ grpc_composite_channel_credentials *c =
+ (grpc_composite_channel_credentials *)gpr_zalloc(sizeof(*c));
GPR_ASSERT(channel_creds != NULL && call_creds != NULL && reserved == NULL);
GRPC_API_TRACE(
"grpc_composite_channel_credentials_create(channel_creds=%p, "
diff --git a/src/core/lib/security/credentials/composite/composite_credentials.h b/src/core/lib/security/credentials/composite/composite_credentials.h
index 3076afcb7e..6e9f9a8f6f 100644
--- a/src/core/lib/security/credentials/composite/composite_credentials.h
+++ b/src/core/lib/security/credentials/composite/composite_credentials.h
@@ -21,6 +21,10 @@
#include "src/core/lib/security/credentials/credentials.h"
+#ifdef __cplusplus
+extern "C" {
+#endif
+
typedef struct {
grpc_call_credentials **creds_array;
size_t num_creds;
@@ -53,5 +57,9 @@ typedef struct {
grpc_call_credentials_array inner;
} grpc_composite_call_credentials;
+#ifdef __cplusplus
+}
+#endif
+
#endif /* GRPC_CORE_LIB_SECURITY_CREDENTIALS_COMPOSITE_COMPOSITE_CREDENTIALS_H \
*/
diff --git a/src/core/lib/security/credentials/credentials.c b/src/core/lib/security/credentials/credentials.cc
index 8a67c9865b..ebbf350865 100644
--- a/src/core/lib/security/credentials/credentials.c
+++ b/src/core/lib/security/credentials/credentials.cc
@@ -40,7 +40,8 @@
grpc_credentials_metadata_request *grpc_credentials_metadata_request_create(
grpc_call_credentials *creds) {
grpc_credentials_metadata_request *r =
- gpr_zalloc(sizeof(grpc_credentials_metadata_request));
+ (grpc_credentials_metadata_request *)gpr_zalloc(
+ sizeof(grpc_credentials_metadata_request));
r->creds = grpc_call_credentials_ref(creds);
return r;
}
@@ -148,11 +149,11 @@ grpc_channel_credentials_duplicate_without_call_credentials(
}
static void credentials_pointer_arg_destroy(grpc_exec_ctx *exec_ctx, void *p) {
- grpc_channel_credentials_unref(exec_ctx, p);
+ grpc_channel_credentials_unref(exec_ctx, (grpc_channel_credentials *)p);
}
static void *credentials_pointer_arg_copy(void *p) {
- return grpc_channel_credentials_ref(p);
+ return grpc_channel_credentials_ref((grpc_channel_credentials *)p);
}
static int credentials_pointer_cmp(void *a, void *b) { return GPR_ICMP(a, b); }
@@ -163,8 +164,9 @@ static const grpc_arg_pointer_vtable credentials_pointer_vtable = {
grpc_arg grpc_channel_credentials_to_arg(
grpc_channel_credentials *credentials) {
- return grpc_channel_arg_pointer_create(
- GRPC_ARG_CHANNEL_CREDENTIALS, credentials, &credentials_pointer_vtable);
+ return grpc_channel_arg_pointer_create((char *)GRPC_ARG_CHANNEL_CREDENTIALS,
+ credentials,
+ &credentials_pointer_vtable);
}
grpc_channel_credentials *grpc_channel_credentials_from_arg(
@@ -175,7 +177,7 @@ grpc_channel_credentials *grpc_channel_credentials_from_arg(
GRPC_ARG_CHANNEL_CREDENTIALS);
return NULL;
}
- return arg->value.pointer.p;
+ return (grpc_channel_credentials *)arg->value.pointer.p;
}
grpc_channel_credentials *grpc_channel_credentials_find_in_args(
@@ -244,11 +246,11 @@ void grpc_server_credentials_set_auth_metadata_processor(
static void server_credentials_pointer_arg_destroy(grpc_exec_ctx *exec_ctx,
void *p) {
- grpc_server_credentials_unref(exec_ctx, p);
+ grpc_server_credentials_unref(exec_ctx, (grpc_server_credentials *)p);
}
static void *server_credentials_pointer_arg_copy(void *p) {
- return grpc_server_credentials_ref(p);
+ return grpc_server_credentials_ref((grpc_server_credentials *)p);
}
static int server_credentials_pointer_cmp(void *a, void *b) {
@@ -260,7 +262,7 @@ static const grpc_arg_pointer_vtable cred_ptr_vtable = {
server_credentials_pointer_cmp};
grpc_arg grpc_server_credentials_to_arg(grpc_server_credentials *p) {
- return grpc_channel_arg_pointer_create(GRPC_SERVER_CREDENTIALS_ARG, p,
+ return grpc_channel_arg_pointer_create((char *)GRPC_SERVER_CREDENTIALS_ARG, p,
&cred_ptr_vtable);
}
@@ -271,7 +273,7 @@ grpc_server_credentials *grpc_server_credentials_from_arg(const grpc_arg *arg) {
GRPC_SERVER_CREDENTIALS_ARG);
return NULL;
}
- return arg->value.pointer.p;
+ return (grpc_server_credentials *)arg->value.pointer.p;
}
grpc_server_credentials *grpc_find_server_credentials_in_args(
diff --git a/src/core/lib/security/credentials/credentials.h b/src/core/lib/security/credentials/credentials.h
index 04a54b0ca8..73e39ae039 100644
--- a/src/core/lib/security/credentials/credentials.h
+++ b/src/core/lib/security/credentials/credentials.h
@@ -29,6 +29,10 @@
#include "src/core/lib/iomgr/polling_entity.h"
#include "src/core/lib/security/transport/security_connector.h"
+#ifdef __cplusplus
+extern "C" {
+#endif
+
struct grpc_http_response;
/* --- Constants. --- */
@@ -252,4 +256,8 @@ grpc_credentials_metadata_request *grpc_credentials_metadata_request_create(
void grpc_credentials_metadata_request_destroy(
grpc_exec_ctx *exec_ctx, grpc_credentials_metadata_request *r);
+#ifdef __cplusplus
+}
+#endif
+
#endif /* GRPC_CORE_LIB_SECURITY_CREDENTIALS_CREDENTIALS_H */
diff --git a/src/core/lib/security/credentials/credentials_metadata.c b/src/core/lib/security/credentials/credentials_metadata.cc
index ccd39e610f..5ba98bda4e 100644
--- a/src/core/lib/security/credentials/credentials_metadata.c
+++ b/src/core/lib/security/credentials/credentials_metadata.cc
@@ -33,7 +33,8 @@ static void mdelem_list_ensure_capacity(grpc_credentials_mdelem_array *list,
while (new_size < target_size) {
new_size *= 2;
}
- list->md = gpr_realloc(list->md, sizeof(grpc_mdelem) * new_size);
+ list->md =
+ (grpc_mdelem *)gpr_realloc(list->md, sizeof(grpc_mdelem) * new_size);
}
void grpc_credentials_mdelem_array_add(grpc_credentials_mdelem_array *list,
diff --git a/src/core/lib/security/credentials/fake/fake_credentials.c b/src/core/lib/security/credentials/fake/fake_credentials.cc
index ac9017850f..795ca0660a 100644
--- a/src/core/lib/security/credentials/fake/fake_credentials.c
+++ b/src/core/lib/security/credentials/fake/fake_credentials.cc
@@ -60,7 +60,8 @@ static grpc_server_credentials_vtable
grpc_channel_credentials *grpc_fake_transport_security_credentials_create(
void) {
- grpc_channel_credentials *c = gpr_zalloc(sizeof(grpc_channel_credentials));
+ grpc_channel_credentials *c =
+ (grpc_channel_credentials *)gpr_zalloc(sizeof(grpc_channel_credentials));
c->type = GRPC_CHANNEL_CREDENTIALS_TYPE_FAKE_TRANSPORT_SECURITY;
c->vtable = &fake_transport_security_credentials_vtable;
gpr_ref_init(&c->refcount, 1);
@@ -69,7 +70,8 @@ grpc_channel_credentials *grpc_fake_transport_security_credentials_create(
grpc_server_credentials *grpc_fake_transport_security_server_credentials_create(
void) {
- grpc_server_credentials *c = gpr_malloc(sizeof(grpc_server_credentials));
+ grpc_server_credentials *c =
+ (grpc_server_credentials *)gpr_malloc(sizeof(grpc_server_credentials));
memset(c, 0, sizeof(grpc_server_credentials));
c->type = GRPC_CHANNEL_CREDENTIALS_TYPE_FAKE_TRANSPORT_SECURITY;
gpr_ref_init(&c->refcount, 1);
@@ -78,8 +80,8 @@ grpc_server_credentials *grpc_fake_transport_security_server_credentials_create(
}
grpc_arg grpc_fake_transport_expected_targets_arg(char *expected_targets) {
- return grpc_channel_arg_string_create(GRPC_ARG_FAKE_SECURITY_EXPECTED_TARGETS,
- expected_targets);
+ return grpc_channel_arg_string_create(
+ (char *)GRPC_ARG_FAKE_SECURITY_EXPECTED_TARGETS, expected_targets);
}
const char *grpc_fake_transport_get_expected_targets(
@@ -129,7 +131,8 @@ grpc_call_credentials *grpc_md_only_test_credentials_create(
grpc_exec_ctx *exec_ctx, const char *md_key, const char *md_value,
bool is_async) {
grpc_md_only_test_credentials *c =
- gpr_zalloc(sizeof(grpc_md_only_test_credentials));
+ (grpc_md_only_test_credentials *)gpr_zalloc(
+ sizeof(grpc_md_only_test_credentials));
c->base.type = GRPC_CALL_CREDENTIALS_TYPE_OAUTH2;
c->base.vtable = &md_only_test_vtable;
gpr_ref_init(&c->base.refcount, 1);
diff --git a/src/core/lib/security/credentials/fake/fake_credentials.h b/src/core/lib/security/credentials/fake/fake_credentials.h
index aa0f3b6e20..64f6f439f0 100644
--- a/src/core/lib/security/credentials/fake/fake_credentials.h
+++ b/src/core/lib/security/credentials/fake/fake_credentials.h
@@ -21,6 +21,10 @@
#include "src/core/lib/security/credentials/credentials.h"
+#ifdef __cplusplus
+extern "C" {
+#endif
+
/* -- Fake transport security credentials. -- */
/* Creates a fake transport security credentials object for testing. */
@@ -56,4 +60,8 @@ typedef struct {
bool is_async;
} grpc_md_only_test_credentials;
-#endif /* GRPC_CORE_LIB_SECURITY_CREDENTIALS_FAKE_FAKE_CREDENTIALS_H */
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* GRPC_CORE_LIB_SECURITY_CREDENTIALS_FAKE_FAKE_CREDENTIALS_H */ \ No newline at end of file
diff --git a/src/core/lib/security/credentials/google_default/credentials_generic.c b/src/core/lib/security/credentials/google_default/credentials_generic.cc
index 4f79718f3d..4f79718f3d 100644
--- a/src/core/lib/security/credentials/google_default/credentials_generic.c
+++ b/src/core/lib/security/credentials/google_default/credentials_generic.cc
diff --git a/src/core/lib/security/credentials/google_default/google_default_credentials.c b/src/core/lib/security/credentials/google_default/google_default_credentials.cc
index 691d66df69..8fe5802d49 100644
--- a/src/core/lib/security/credentials/google_default/google_default_credentials.c
+++ b/src/core/lib/security/credentials/google_default/google_default_credentials.cc
@@ -28,6 +28,7 @@
#include "src/core/lib/http/parser.h"
#include "src/core/lib/iomgr/load_file.h"
#include "src/core/lib/iomgr/polling_entity.h"
+#include "src/core/lib/security/credentials/google_default/google_default_credentials.h"
#include "src/core/lib/security/credentials/jwt/jwt_credentials.h"
#include "src/core/lib/security/credentials/oauth2/oauth2_credentials.h"
#include "src/core/lib/slice/slice_internal.h"
@@ -85,7 +86,7 @@ static void on_compute_engine_detection_http_response(grpc_exec_ctx *exec_ctx,
}
static void destroy_pollset(grpc_exec_ctx *exec_ctx, void *p, grpc_error *e) {
- grpc_pollset_destroy(exec_ctx, p);
+ grpc_pollset_destroy(exec_ctx, (grpc_pollset *)p);
}
static int is_stack_running_on_compute_engine(grpc_exec_ctx *exec_ctx) {
@@ -98,7 +99,7 @@ static int is_stack_running_on_compute_engine(grpc_exec_ctx *exec_ctx) {
on compute engine. */
gpr_timespec max_detection_delay = gpr_time_from_seconds(1, GPR_TIMESPAN);
- grpc_pollset *pollset = gpr_zalloc(grpc_pollset_size());
+ grpc_pollset *pollset = (grpc_pollset *)gpr_zalloc(grpc_pollset_size());
grpc_pollset_init(pollset, &g_polling_mu);
detector.pollent = grpc_polling_entity_create_from_pollset(pollset);
detector.is_done = 0;
@@ -106,8 +107,8 @@ static int is_stack_running_on_compute_engine(grpc_exec_ctx *exec_ctx) {
memset(&detector.response, 0, sizeof(detector.response));
memset(&request, 0, sizeof(grpc_httpcli_request));
- request.host = GRPC_COMPUTE_ENGINE_DETECTION_HOST;
- request.http.path = "/";
+ request.host = (char *)GRPC_COMPUTE_ENGINE_DETECTION_HOST;
+ request.http.path = (char *)"/";
grpc_httpcli_context_init(&context);
diff --git a/src/core/lib/security/credentials/google_default/google_default_credentials.h b/src/core/lib/security/credentials/google_default/google_default_credentials.h
index c3755e01a6..66677873ca 100644
--- a/src/core/lib/security/credentials/google_default/google_default_credentials.h
+++ b/src/core/lib/security/credentials/google_default/google_default_credentials.h
@@ -23,6 +23,10 @@
#include "src/core/lib/security/credentials/credentials.h"
+#ifdef __cplusplus
+extern "C" {
+#endif
+
#define GRPC_GOOGLE_CLOUD_SDK_CONFIG_DIRECTORY "gcloud"
#define GRPC_GOOGLE_WELL_KNOWN_CREDENTIALS_FILE \
"application_default_credentials.json"
@@ -41,5 +45,9 @@
void grpc_flush_cached_google_default_credentials(void);
+#ifdef __cplusplus
+}
+#endif
+
#endif /* GRPC_CORE_LIB_SECURITY_CREDENTIALS_GOOGLE_DEFAULT_GOOGLE_DEFAULT_CREDENTIALS_H \
*/
diff --git a/src/core/lib/security/credentials/iam/iam_credentials.c b/src/core/lib/security/credentials/iam/iam_credentials.cc
index 3de8319d98..e9cf208c16 100644
--- a/src/core/lib/security/credentials/iam/iam_credentials.c
+++ b/src/core/lib/security/credentials/iam/iam_credentials.cc
@@ -64,7 +64,8 @@ grpc_call_credentials *grpc_google_iam_credentials_create(
GPR_ASSERT(reserved == NULL);
GPR_ASSERT(token != NULL);
GPR_ASSERT(authority_selector != NULL);
- grpc_google_iam_credentials *c = gpr_zalloc(sizeof(*c));
+ grpc_google_iam_credentials *c =
+ (grpc_google_iam_credentials *)gpr_zalloc(sizeof(*c));
c->base.type = GRPC_CALL_CREDENTIALS_TYPE_IAM;
c->base.vtable = &iam_vtable;
gpr_ref_init(&c->base.refcount, 1);
diff --git a/src/core/lib/security/credentials/jwt/json_token.c b/src/core/lib/security/credentials/jwt/json_token.cc
index fff71255a5..8c30353470 100644
--- a/src/core/lib/security/credentials/jwt/json_token.c
+++ b/src/core/lib/security/credentials/jwt/json_token.cc
@@ -20,6 +20,7 @@
#include <string.h>
+#include <grpc/grpc_security.h>
#include <grpc/support/alloc.h>
#include <grpc/support/log.h>
#include <grpc/support/string_util.h>
@@ -29,9 +30,11 @@
#include "src/core/lib/slice/b64.h"
#include "src/core/lib/support/string.h"
+extern "C" {
#include <openssl/bio.h>
#include <openssl/evp.h>
#include <openssl/pem.h>
+}
/* --- Constants. --- */
@@ -96,7 +99,7 @@ grpc_auth_json_key grpc_auth_json_key_create_from_json(const grpc_json *json) {
gpr_log(GPR_ERROR, "Could not write into openssl BIO.");
goto end;
}
- result.private_key = PEM_read_bio_RSAPrivateKey(bio, NULL, NULL, "");
+ result.private_key = PEM_read_bio_RSAPrivateKey(bio, NULL, NULL, (void *)"");
if (result.private_key == NULL) {
gpr_log(GPR_ERROR, "Could not deserialize private key.");
goto end;
@@ -214,7 +217,7 @@ static char *dot_concat_and_free_strings(char *str1, char *str2) {
size_t str1_len = strlen(str1);
size_t str2_len = strlen(str2);
size_t result_len = str1_len + 1 /* dot */ + str2_len;
- char *result = gpr_malloc(result_len + 1 /* NULL terminated */);
+ char *result = (char *)gpr_malloc(result_len + 1 /* NULL terminated */);
char *current = result;
memcpy(current, str1, str1_len);
current += str1_len;
@@ -266,7 +269,7 @@ char *compute_and_encode_signature(const grpc_auth_json_key *json_key,
gpr_log(GPR_ERROR, "DigestFinal (get signature length) failed.");
goto end;
}
- sig = gpr_malloc(sig_len);
+ sig = (unsigned char *)gpr_malloc(sig_len);
if (EVP_DigestSignFinal(md_ctx, sig, &sig_len) != 1) {
gpr_log(GPR_ERROR, "DigestFinal (signature compute) failed.");
goto end;
diff --git a/src/core/lib/security/credentials/jwt/json_token.h b/src/core/lib/security/credentials/jwt/json_token.h
index e50790ef2e..b923b02df6 100644
--- a/src/core/lib/security/credentials/jwt/json_token.h
+++ b/src/core/lib/security/credentials/jwt/json_token.h
@@ -19,6 +19,10 @@
#ifndef GRPC_CORE_LIB_SECURITY_CREDENTIALS_JWT_JSON_TOKEN_H
#define GRPC_CORE_LIB_SECURITY_CREDENTIALS_JWT_JSON_TOKEN_H
+#ifdef __cplusplus
+extern "C" {
+#endif
+
#include <grpc/slice.h>
#include <openssl/rsa.h>
@@ -70,4 +74,8 @@ typedef char *(*grpc_jwt_encode_and_sign_override)(
void grpc_jwt_encode_and_sign_set_override(
grpc_jwt_encode_and_sign_override func);
+#ifdef __cplusplus
+}
+#endif
+
#endif /* GRPC_CORE_LIB_SECURITY_CREDENTIALS_JWT_JSON_TOKEN_H */
diff --git a/src/core/lib/security/credentials/jwt/jwt_credentials.c b/src/core/lib/security/credentials/jwt/jwt_credentials.cc
index 02c82e99ba..835dd677ed 100644
--- a/src/core/lib/security/credentials/jwt/jwt_credentials.c
+++ b/src/core/lib/security/credentials/jwt/jwt_credentials.cc
@@ -16,8 +16,11 @@
*
*/
+#include <grpc/support/port_platform.h>
+
#include "src/core/lib/security/credentials/jwt/jwt_credentials.h"
+#include <inttypes.h>
#include <string.h>
#include "src/core/lib/surface/api_trace.h"
@@ -125,7 +128,8 @@ grpc_service_account_jwt_access_credentials_create_from_auth_json_key(
gpr_log(GPR_ERROR, "Invalid input for jwt credentials creation");
return NULL;
}
- c = gpr_zalloc(sizeof(grpc_service_account_jwt_access_credentials));
+ c = (grpc_service_account_jwt_access_credentials *)gpr_zalloc(
+ sizeof(grpc_service_account_jwt_access_credentials));
c->base.type = GRPC_CALL_CREDENTIALS_TYPE_JWT;
gpr_ref_init(&c->base.refcount, 1);
c->base.vtable = &jwt_vtable;
diff --git a/src/core/lib/security/credentials/jwt/jwt_credentials.h b/src/core/lib/security/credentials/jwt/jwt_credentials.h
index 07f4022669..c09485fd55 100644
--- a/src/core/lib/security/credentials/jwt/jwt_credentials.h
+++ b/src/core/lib/security/credentials/jwt/jwt_credentials.h
@@ -22,6 +22,10 @@
#include "src/core/lib/security/credentials/credentials.h"
#include "src/core/lib/security/credentials/jwt/json_token.h"
+#ifdef __cplusplus
+extern "C" {
+#endif
+
typedef struct {
grpc_call_credentials base;
@@ -45,4 +49,8 @@ grpc_service_account_jwt_access_credentials_create_from_auth_json_key(
grpc_exec_ctx *exec_ctx, grpc_auth_json_key key,
gpr_timespec token_lifetime);
-#endif /* GRPC_CORE_LIB_SECURITY_CREDENTIALS_JWT_JWT_CREDENTIALS_H */
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* GRPC_CORE_LIB_SECURITY_CREDENTIALS_JWT_JWT_CREDENTIALS_H */ \ No newline at end of file
diff --git a/src/core/lib/security/credentials/jwt/jwt_verifier.c b/src/core/lib/security/credentials/jwt/jwt_verifier.cc
index a27284bc50..aea16dee92 100644
--- a/src/core/lib/security/credentials/jwt/jwt_verifier.c
+++ b/src/core/lib/security/credentials/jwt/jwt_verifier.cc
@@ -26,7 +26,10 @@
#include <grpc/support/string_util.h>
#include <grpc/support/sync.h>
#include <grpc/support/useful.h>
+
+extern "C" {
#include <openssl/pem.h>
+}
#include "src/core/lib/http/httpcli.h"
#include "src/core/lib/iomgr/polling_entity.h"
@@ -129,7 +132,7 @@ static void jose_header_destroy(grpc_exec_ctx *exec_ctx, jose_header *h) {
static jose_header *jose_header_from_json(grpc_exec_ctx *exec_ctx,
grpc_json *json, grpc_slice buffer) {
grpc_json *cur;
- jose_header *h = gpr_zalloc(sizeof(jose_header));
+ jose_header *h = (jose_header *)gpr_zalloc(sizeof(jose_header));
h->buffer = buffer;
for (cur = json->child; cur != NULL; cur = cur->next) {
if (strcmp(cur->key, "alg") == 0) {
@@ -231,7 +234,8 @@ gpr_timespec grpc_jwt_claims_not_before(const grpc_jwt_claims *claims) {
grpc_jwt_claims *grpc_jwt_claims_from_json(grpc_exec_ctx *exec_ctx,
grpc_json *json, grpc_slice buffer) {
grpc_json *cur;
- grpc_jwt_claims *claims = gpr_malloc(sizeof(grpc_jwt_claims));
+ grpc_jwt_claims *claims =
+ (grpc_jwt_claims *)gpr_malloc(sizeof(grpc_jwt_claims));
memset(claims, 0, sizeof(grpc_jwt_claims));
claims->json = json;
claims->buffer = buffer;
@@ -347,7 +351,7 @@ static verifier_cb_ctx *verifier_cb_ctx_create(
const char *signed_jwt, size_t signed_jwt_len, void *user_data,
grpc_jwt_verification_done_cb cb) {
grpc_exec_ctx exec_ctx = GRPC_EXEC_CTX_INIT;
- verifier_cb_ctx *ctx = gpr_zalloc(sizeof(verifier_cb_ctx));
+ verifier_cb_ctx *ctx = (verifier_cb_ctx *)gpr_zalloc(sizeof(verifier_cb_ctx));
ctx->verifier = verifier;
ctx->pollent = grpc_polling_entity_create_from_pollset(pollset);
ctx->header = header;
@@ -676,6 +680,7 @@ static void on_openid_config_retrieved(grpc_exec_ctx *exec_ctx, void *user_data,
grpc_json *json = json_from_http(response);
grpc_httpcli_request req;
const char *jwks_uri;
+ grpc_resource_quota *resource_quota = NULL;
/* TODO(jboeuf): Cache the jwks_uri in order to avoid this hop next time. */
if (json == NULL) goto error;
@@ -693,9 +698,9 @@ static void on_openid_config_retrieved(grpc_exec_ctx *exec_ctx, void *user_data,
jwks_uri += 8;
req.handshaker = &grpc_httpcli_ssl;
req.host = gpr_strdup(jwks_uri);
- req.http.path = strchr(jwks_uri, '/');
+ req.http.path = (char *)strchr(jwks_uri, '/');
if (req.http.path == NULL) {
- req.http.path = "";
+ req.http.path = (char *)"";
} else {
*(req.host + (req.http.path - jwks_uri)) = '\0';
}
@@ -703,8 +708,7 @@ static void on_openid_config_retrieved(grpc_exec_ctx *exec_ctx, void *user_data,
/* TODO(ctiller): Carry the resource_quota in ctx and share it with the host
channel. This would allow us to cancel an authentication query when under
extreme memory pressure. */
- grpc_resource_quota *resource_quota =
- grpc_resource_quota_create("jwt_verifier");
+ resource_quota = grpc_resource_quota_create("jwt_verifier");
grpc_httpcli_get(
exec_ctx, &ctx->verifier->http_ctx, &ctx->pollent, resource_quota, &req,
gpr_time_add(gpr_now(GPR_CLOCK_REALTIME), grpc_jwt_verifier_max_delay),
@@ -760,7 +764,8 @@ const char *grpc_jwt_issuer_email_domain(const char *issuer) {
if (dot == NULL || dot == email_domain) return email_domain;
GPR_ASSERT(dot > email_domain);
/* There may be a subdomain, we just want the domain. */
- dot = gpr_memrchr(email_domain, '.', (size_t)(dot - email_domain));
+ dot = (const char *)gpr_memrchr((void *)email_domain, '.',
+ (size_t)(dot - email_domain));
if (dot == NULL) return email_domain;
return dot + 1;
}
@@ -773,6 +778,7 @@ static void retrieve_key_and_verify(grpc_exec_ctx *exec_ctx,
char *path_prefix = NULL;
const char *iss;
grpc_httpcli_request req;
+ grpc_resource_quota *resource_quota = NULL;
memset(&req, 0, sizeof(grpc_httpcli_request));
req.handshaker = &grpc_httpcli_ssl;
http_response_index rsp_idx;
@@ -831,8 +837,7 @@ static void retrieve_key_and_verify(grpc_exec_ctx *exec_ctx,
/* TODO(ctiller): Carry the resource_quota in ctx and share it with the host
channel. This would allow us to cancel an authentication query when under
extreme memory pressure. */
- grpc_resource_quota *resource_quota =
- grpc_resource_quota_create("jwt_verifier");
+ resource_quota = grpc_resource_quota_create("jwt_verifier");
grpc_httpcli_get(
exec_ctx, &ctx->verifier->http_ctx, &ctx->pollent, resource_quota, &req,
gpr_time_add(gpr_now(GPR_CLOCK_REALTIME), grpc_jwt_verifier_max_delay),
@@ -901,12 +906,14 @@ error:
grpc_jwt_verifier *grpc_jwt_verifier_create(
const grpc_jwt_verifier_email_domain_key_url_mapping *mappings,
size_t num_mappings) {
- grpc_jwt_verifier *v = gpr_zalloc(sizeof(grpc_jwt_verifier));
+ grpc_jwt_verifier *v =
+ (grpc_jwt_verifier *)gpr_zalloc(sizeof(grpc_jwt_verifier));
grpc_httpcli_context_init(&v->http_ctx);
/* We know at least of one mapping. */
v->allocated_mappings = 1 + num_mappings;
- v->mappings = gpr_malloc(v->allocated_mappings * sizeof(email_key_mapping));
+ v->mappings = (email_key_mapping *)gpr_malloc(v->allocated_mappings *
+ sizeof(email_key_mapping));
verifier_put_mapping(v, GRPC_GOOGLE_SERVICE_ACCOUNTS_EMAIL_DOMAIN,
GRPC_GOOGLE_SERVICE_ACCOUNTS_KEY_URL_PREFIX);
/* User-Provided mappings. */
diff --git a/src/core/lib/security/credentials/jwt/jwt_verifier.h b/src/core/lib/security/credentials/jwt/jwt_verifier.h
index 8fac452d4e..0603811627 100644
--- a/src/core/lib/security/credentials/jwt/jwt_verifier.h
+++ b/src/core/lib/security/credentials/jwt/jwt_verifier.h
@@ -32,6 +32,10 @@
#define GRPC_GOOGLE_SERVICE_ACCOUNTS_KEY_URL_PREFIX \
"www.googleapis.com/robot/v1/metadata/x509"
+#ifdef __cplusplus
+extern "C" {
+#endif
+
/* --- grpc_jwt_verifier_status. --- */
typedef enum {
@@ -122,4 +126,8 @@ grpc_jwt_verifier_status grpc_jwt_claims_check(const grpc_jwt_claims *claims,
const char *audience);
const char *grpc_jwt_issuer_email_domain(const char *issuer);
+#ifdef __cplusplus
+}
+#endif
+
#endif /* GRPC_CORE_LIB_SECURITY_CREDENTIALS_JWT_JWT_VERIFIER_H */
diff --git a/src/core/lib/security/credentials/oauth2/oauth2_credentials.c b/src/core/lib/security/credentials/oauth2/oauth2_credentials.cc
index 10b270c49c..0a801bec82 100644
--- a/src/core/lib/security/credentials/oauth2/oauth2_credentials.c
+++ b/src/core/lib/security/credentials/oauth2/oauth2_credentials.cc
@@ -130,7 +130,7 @@ grpc_oauth2_token_fetcher_credentials_parse_server_response(
}
if (response->body_length > 0) {
- null_terminated_body = gpr_malloc(response->body_length + 1);
+ null_terminated_body = (char *)gpr_malloc(response->body_length + 1);
null_terminated_body[response->body_length] = '\0';
memcpy(null_terminated_body, response->body, response->body_length);
}
@@ -359,11 +359,11 @@ static void compute_engine_fetch_oauth2(
grpc_exec_ctx *exec_ctx, grpc_credentials_metadata_request *metadata_req,
grpc_httpcli_context *httpcli_context, grpc_polling_entity *pollent,
grpc_iomgr_cb_func response_cb, gpr_timespec deadline) {
- grpc_http_header header = {"Metadata-Flavor", "Google"};
+ grpc_http_header header = {(char *)"Metadata-Flavor", (char *)"Google"};
grpc_httpcli_request request;
memset(&request, 0, sizeof(grpc_httpcli_request));
- request.host = GRPC_COMPUTE_ENGINE_METADATA_HOST;
- request.http.path = GRPC_COMPUTE_ENGINE_METADATA_TOKEN_PATH;
+ request.host = (char *)GRPC_COMPUTE_ENGINE_METADATA_HOST;
+ request.http.path = (char *)GRPC_COMPUTE_ENGINE_METADATA_TOKEN_PATH;
request.http.hdr_count = 1;
request.http.hdrs = &header;
/* TODO(ctiller): Carry the resource_quota in ctx and share it with the host
@@ -381,7 +381,8 @@ static void compute_engine_fetch_oauth2(
grpc_call_credentials *grpc_google_compute_engine_credentials_create(
void *reserved) {
grpc_oauth2_token_fetcher_credentials *c =
- gpr_malloc(sizeof(grpc_oauth2_token_fetcher_credentials));
+ (grpc_oauth2_token_fetcher_credentials *)gpr_malloc(
+ sizeof(grpc_oauth2_token_fetcher_credentials));
GRPC_API_TRACE("grpc_compute_engine_credentials_create(reserved=%p)", 1,
(reserved));
GPR_ASSERT(reserved == NULL);
@@ -412,16 +413,16 @@ static void refresh_token_fetch_oauth2(
grpc_iomgr_cb_func response_cb, gpr_timespec deadline) {
grpc_google_refresh_token_credentials *c =
(grpc_google_refresh_token_credentials *)metadata_req->creds;
- grpc_http_header header = {"Content-Type",
- "application/x-www-form-urlencoded"};
+ grpc_http_header header = {(char *)"Content-Type",
+ (char *)"application/x-www-form-urlencoded"};
grpc_httpcli_request request;
char *body = NULL;
gpr_asprintf(&body, GRPC_REFRESH_TOKEN_POST_BODY_FORMAT_STRING,
c->refresh_token.client_id, c->refresh_token.client_secret,
c->refresh_token.refresh_token);
memset(&request, 0, sizeof(grpc_httpcli_request));
- request.host = GRPC_GOOGLE_OAUTH2_SERVICE_HOST;
- request.http.path = GRPC_GOOGLE_OAUTH2_SERVICE_TOKEN_PATH;
+ request.host = (char *)GRPC_GOOGLE_OAUTH2_SERVICE_HOST;
+ request.http.path = (char *)GRPC_GOOGLE_OAUTH2_SERVICE_TOKEN_PATH;
request.http.hdr_count = 1;
request.http.hdrs = &header;
request.handshaker = &grpc_httpcli_ssl;
@@ -447,7 +448,8 @@ grpc_refresh_token_credentials_create_from_auth_refresh_token(
gpr_log(GPR_ERROR, "Invalid input for refresh token credentials creation");
return NULL;
}
- c = gpr_zalloc(sizeof(grpc_google_refresh_token_credentials));
+ c = (grpc_google_refresh_token_credentials *)gpr_zalloc(
+ sizeof(grpc_google_refresh_token_credentials));
init_oauth2_token_fetcher(&c->base, refresh_token_fetch_oauth2);
c->base.base.vtable = &refresh_token_vtable;
c->refresh_token = refresh_token;
@@ -515,7 +517,8 @@ static grpc_call_credentials_vtable access_token_vtable = {
grpc_call_credentials *grpc_access_token_credentials_create(
const char *access_token, void *reserved) {
grpc_access_token_credentials *c =
- gpr_zalloc(sizeof(grpc_access_token_credentials));
+ (grpc_access_token_credentials *)gpr_zalloc(
+ sizeof(grpc_access_token_credentials));
GRPC_API_TRACE(
"grpc_access_token_credentials_create(access_token=<redacted>, "
"reserved=%p)",
diff --git a/src/core/lib/security/credentials/oauth2/oauth2_credentials.h b/src/core/lib/security/credentials/oauth2/oauth2_credentials.h
index d9ad6691b8..c8a9333417 100644
--- a/src/core/lib/security/credentials/oauth2/oauth2_credentials.h
+++ b/src/core/lib/security/credentials/oauth2/oauth2_credentials.h
@@ -22,6 +22,10 @@
#include "src/core/lib/json/json.h"
#include "src/core/lib/security/credentials/credentials.h"
+#ifdef __cplusplus
+extern "C" {
+#endif
+
// auth_refresh_token parsing.
typedef struct {
const char *type;
@@ -102,4 +106,8 @@ grpc_oauth2_token_fetcher_credentials_parse_server_response(
grpc_exec_ctx *exec_ctx, const struct grpc_http_response *response,
grpc_mdelem *token_md, gpr_timespec *token_lifetime);
-#endif /* GRPC_CORE_LIB_SECURITY_CREDENTIALS_OAUTH2_OAUTH2_CREDENTIALS_H */
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* GRPC_CORE_LIB_SECURITY_CREDENTIALS_OAUTH2_OAUTH2_CREDENTIALS_H */ \ No newline at end of file
diff --git a/src/core/lib/security/credentials/plugin/plugin_credentials.c b/src/core/lib/security/credentials/plugin/plugin_credentials.cc
index ee20241e3f..8106a730fe 100644
--- a/src/core/lib/security/credentials/plugin/plugin_credentials.c
+++ b/src/core/lib/security/credentials/plugin/plugin_credentials.cc
@@ -258,7 +258,8 @@ static grpc_call_credentials_vtable plugin_vtable = {
grpc_call_credentials *grpc_metadata_credentials_create_from_plugin(
grpc_metadata_credentials_plugin plugin, void *reserved) {
- grpc_plugin_credentials *c = gpr_zalloc(sizeof(*c));
+ grpc_plugin_credentials *c =
+ (grpc_plugin_credentials *)gpr_zalloc(sizeof(*c));
GRPC_API_TRACE("grpc_metadata_credentials_create_from_plugin(reserved=%p)", 1,
(reserved));
GPR_ASSERT(reserved == NULL);
diff --git a/src/core/lib/security/credentials/ssl/ssl_credentials.c b/src/core/lib/security/credentials/ssl/ssl_credentials.cc
index 006db1ec76..9df69a2a3d 100644
--- a/src/core/lib/security/credentials/ssl/ssl_credentials.c
+++ b/src/core/lib/security/credentials/ssl/ssl_credentials.cc
@@ -66,8 +66,8 @@ static grpc_security_status ssl_create_security_connector(
if (status != GRPC_SECURITY_OK) {
return status;
}
- grpc_arg new_arg =
- grpc_channel_arg_string_create(GRPC_ARG_HTTP2_SCHEME, "https");
+ grpc_arg new_arg = grpc_channel_arg_string_create(
+ (char *)GRPC_ARG_HTTP2_SCHEME, (char *)"https");
*new_args = grpc_channel_args_copy_and_add(args, &new_arg, 1);
return status;
}
@@ -94,7 +94,8 @@ static void ssl_build_config(const char *pem_root_certs,
grpc_channel_credentials *grpc_ssl_credentials_create(
const char *pem_root_certs, grpc_ssl_pem_key_cert_pair *pem_key_cert_pair,
void *reserved) {
- grpc_ssl_credentials *c = gpr_zalloc(sizeof(grpc_ssl_credentials));
+ grpc_ssl_credentials *c =
+ (grpc_ssl_credentials *)gpr_zalloc(sizeof(grpc_ssl_credentials));
GRPC_API_TRACE(
"grpc_ssl_credentials_create(pem_root_certs=%s, "
"pem_key_cert_pair=%p, "
@@ -145,8 +146,8 @@ static void ssl_build_server_config(
}
if (num_key_cert_pairs > 0) {
GPR_ASSERT(pem_key_cert_pairs != NULL);
- config->pem_key_cert_pairs =
- gpr_zalloc(num_key_cert_pairs * sizeof(tsi_ssl_pem_key_cert_pair));
+ config->pem_key_cert_pairs = (tsi_ssl_pem_key_cert_pair *)gpr_zalloc(
+ num_key_cert_pairs * sizeof(tsi_ssl_pem_key_cert_pair));
}
config->num_key_cert_pairs = num_key_cert_pairs;
for (i = 0; i < num_key_cert_pairs; i++) {
@@ -175,8 +176,8 @@ grpc_server_credentials *grpc_ssl_server_credentials_create_ex(
size_t num_key_cert_pairs,
grpc_ssl_client_certificate_request_type client_certificate_request,
void *reserved) {
- grpc_ssl_server_credentials *c =
- gpr_zalloc(sizeof(grpc_ssl_server_credentials));
+ grpc_ssl_server_credentials *c = (grpc_ssl_server_credentials *)gpr_zalloc(
+ sizeof(grpc_ssl_server_credentials));
GRPC_API_TRACE(
"grpc_ssl_server_credentials_create_ex("
"pem_root_certs=%s, pem_key_cert_pairs=%p, num_key_cert_pairs=%lu, "
diff --git a/src/core/lib/security/transport/auth_filters.h b/src/core/lib/security/transport/auth_filters.h
index bd5902a128..ba5df7fe70 100644
--- a/src/core/lib/security/transport/auth_filters.h
+++ b/src/core/lib/security/transport/auth_filters.h
@@ -21,7 +21,15 @@
#include "src/core/lib/channel/channel_stack.h"
+#ifdef __cplusplus
+extern "C" {
+#endif
+
extern const grpc_channel_filter grpc_client_auth_filter;
extern const grpc_channel_filter grpc_server_auth_filter;
+#ifdef __cplusplus
+}
+#endif
+
#endif /* GRPC_CORE_LIB_SECURITY_TRANSPORT_AUTH_FILTERS_H */
diff --git a/src/core/lib/security/transport/client_auth_filter.c b/src/core/lib/security/transport/client_auth_filter.cc
index dd7dd44e79..a8464dbf9e 100644
--- a/src/core/lib/security/transport/client_auth_filter.c
+++ b/src/core/lib/security/transport/client_auth_filter.cc
@@ -93,8 +93,9 @@ static void add_error(grpc_error **combined, grpc_error *error) {
static void on_credentials_metadata(grpc_exec_ctx *exec_ctx, void *arg,
grpc_error *input_error) {
grpc_transport_stream_op_batch *batch = (grpc_transport_stream_op_batch *)arg;
- grpc_call_element *elem = batch->handler_private.extra_arg;
- call_data *calld = elem->call_data;
+ grpc_call_element *elem =
+ (grpc_call_element *)batch->handler_private.extra_arg;
+ call_data *calld = (call_data *)elem->call_data;
reset_auth_metadata_context(&calld->auth_md_context);
grpc_error *error = GRPC_ERROR_REF(input_error);
if (error == GRPC_ERROR_NONE) {
@@ -163,8 +164,8 @@ static void cancel_get_request_metadata(grpc_exec_ctx *exec_ctx, void *arg,
static void send_security_metadata(grpc_exec_ctx *exec_ctx,
grpc_call_element *elem,
grpc_transport_stream_op_batch *batch) {
- call_data *calld = elem->call_data;
- channel_data *chand = elem->channel_data;
+ call_data *calld = (call_data *)elem->call_data;
+ channel_data *chand = (channel_data *)elem->channel_data;
grpc_client_security_context *ctx =
(grpc_client_security_context *)batch->payload
->context[GRPC_CONTEXT_SECURITY]
@@ -225,8 +226,9 @@ static void send_security_metadata(grpc_exec_ctx *exec_ctx,
static void on_host_checked(grpc_exec_ctx *exec_ctx, void *arg,
grpc_error *error) {
grpc_transport_stream_op_batch *batch = (grpc_transport_stream_op_batch *)arg;
- grpc_call_element *elem = batch->handler_private.extra_arg;
- call_data *calld = elem->call_data;
+ grpc_call_element *elem =
+ (grpc_call_element *)batch->handler_private.extra_arg;
+ call_data *calld = (call_data *)elem->call_data;
if (error == GRPC_ERROR_NONE) {
send_security_metadata(exec_ctx, elem, batch);
} else {
@@ -264,8 +266,8 @@ static void auth_start_transport_stream_op_batch(
GPR_TIMER_BEGIN("auth_start_transport_stream_op_batch", 0);
/* grab pointers to our data from the call element */
- call_data *calld = elem->call_data;
- channel_data *chand = elem->channel_data;
+ call_data *calld = (call_data *)elem->call_data;
+ channel_data *chand = (channel_data *)elem->channel_data;
if (!batch->cancel_stream) {
GPR_ASSERT(batch->payload->context != NULL);
@@ -276,7 +278,9 @@ static void auth_start_transport_stream_op_batch(
grpc_client_security_context_destroy;
}
grpc_client_security_context *sec_ctx =
- batch->payload->context[GRPC_CONTEXT_SECURITY].value;
+ (grpc_client_security_context *)batch->payload
+ ->context[GRPC_CONTEXT_SECURITY]
+ .value;
GRPC_AUTH_CONTEXT_UNREF(sec_ctx->auth_context, "client auth filter");
sec_ctx->auth_context =
GRPC_AUTH_CONTEXT_REF(chand->auth_context, "client_auth_filter");
@@ -339,7 +343,7 @@ static void auth_start_transport_stream_op_batch(
static grpc_error *init_call_elem(grpc_exec_ctx *exec_ctx,
grpc_call_element *elem,
const grpc_call_element_args *args) {
- call_data *calld = elem->call_data;
+ call_data *calld = (call_data *)elem->call_data;
calld->owning_call = args->call_stack;
calld->call_combiner = args->call_combiner;
return GRPC_ERROR_NONE;
@@ -348,7 +352,7 @@ static grpc_error *init_call_elem(grpc_exec_ctx *exec_ctx,
static void set_pollset_or_pollset_set(grpc_exec_ctx *exec_ctx,
grpc_call_element *elem,
grpc_polling_entity *pollent) {
- call_data *calld = elem->call_data;
+ call_data *calld = (call_data *)elem->call_data;
calld->pollent = pollent;
}
@@ -356,7 +360,7 @@ static void set_pollset_or_pollset_set(grpc_exec_ctx *exec_ctx,
static void destroy_call_elem(grpc_exec_ctx *exec_ctx, grpc_call_element *elem,
const grpc_call_final_info *final_info,
grpc_closure *ignored) {
- call_data *calld = elem->call_data;
+ call_data *calld = (call_data *)elem->call_data;
grpc_credentials_mdelem_array_destroy(exec_ctx, &calld->md_array);
grpc_call_credentials_unref(exec_ctx, calld->creds);
if (calld->have_host) {
@@ -386,7 +390,7 @@ static grpc_error *init_channel_elem(grpc_exec_ctx *exec_ctx,
}
/* grab pointers to our data from the channel element */
- channel_data *chand = elem->channel_data;
+ channel_data *chand = (channel_data *)elem->channel_data;
/* The first and the last filters tend to be implemented differently to
handle the case that there's no 'next' filter to call on the up or down
@@ -406,7 +410,7 @@ static grpc_error *init_channel_elem(grpc_exec_ctx *exec_ctx,
static void destroy_channel_elem(grpc_exec_ctx *exec_ctx,
grpc_channel_element *elem) {
/* grab pointers to our data from the channel element */
- channel_data *chand = elem->channel_data;
+ channel_data *chand = (channel_data *)elem->channel_data;
grpc_channel_security_connector *sc = chand->security_connector;
if (sc != NULL) {
GRPC_SECURITY_CONNECTOR_UNREF(exec_ctx, &sc->base, "client_auth_filter");
diff --git a/src/core/lib/security/transport/lb_targets_info.c b/src/core/lib/security/transport/lb_targets_info.cc
index 5583a4e0ff..947fc1addf 100644
--- a/src/core/lib/security/transport/lb_targets_info.c
+++ b/src/core/lib/security/transport/lb_targets_info.cc
@@ -25,19 +25,22 @@
* secure naming purposes. */
#define GRPC_ARG_LB_SECURE_NAMING_MAP "grpc.lb_secure_naming_map"
-static void *targets_info_copy(void *p) { return grpc_slice_hash_table_ref(p); }
+static void *targets_info_copy(void *p) {
+ return grpc_slice_hash_table_ref((grpc_slice_hash_table *)p);
+}
static void targets_info_destroy(grpc_exec_ctx *exec_ctx, void *p) {
- grpc_slice_hash_table_unref(exec_ctx, p);
+ grpc_slice_hash_table_unref(exec_ctx, (grpc_slice_hash_table *)p);
}
static int targets_info_cmp(void *a, void *b) {
- return grpc_slice_hash_table_cmp(a, b);
+ return grpc_slice_hash_table_cmp((const grpc_slice_hash_table *)a,
+ (const grpc_slice_hash_table *)b);
}
static const grpc_arg_pointer_vtable server_to_balancer_names_vtable = {
targets_info_copy, targets_info_destroy, targets_info_cmp};
grpc_arg grpc_lb_targets_info_create_channel_arg(
grpc_slice_hash_table *targets_info) {
- return grpc_channel_arg_pointer_create(GRPC_ARG_LB_SECURE_NAMING_MAP,
+ return grpc_channel_arg_pointer_create((char *)GRPC_ARG_LB_SECURE_NAMING_MAP,
targets_info,
&server_to_balancer_names_vtable);
}
@@ -48,7 +51,7 @@ grpc_slice_hash_table *grpc_lb_targets_info_find_in_args(
grpc_channel_args_find(args, GRPC_ARG_LB_SECURE_NAMING_MAP);
if (targets_info_arg != NULL) {
GPR_ASSERT(targets_info_arg->type == GRPC_ARG_POINTER);
- return targets_info_arg->value.pointer.p;
+ return (grpc_slice_hash_table *)targets_info_arg->value.pointer.p;
}
return NULL;
}
diff --git a/src/core/lib/security/transport/lb_targets_info.h b/src/core/lib/security/transport/lb_targets_info.h
index c3d685df5f..705d33b0ab 100644
--- a/src/core/lib/security/transport/lb_targets_info.h
+++ b/src/core/lib/security/transport/lb_targets_info.h
@@ -21,6 +21,10 @@
#include "src/core/lib/slice/slice_hash_table.h"
+#ifdef __cplusplus
+extern "C" {
+#endif
+
/** Return a channel argument containing \a targets_info. */
grpc_arg grpc_lb_targets_info_create_channel_arg(
grpc_slice_hash_table *targets_info);
@@ -29,4 +33,8 @@ grpc_arg grpc_lb_targets_info_create_channel_arg(
grpc_slice_hash_table *grpc_lb_targets_info_find_in_args(
const grpc_channel_args *args);
-#endif /* GRPC_CORE_LIB_SECURITY_TRANSPORT_LB_TARGETS_INFO_H */
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* GRPC_CORE_LIB_SECURITY_TRANSPORT_LB_TARGETS_INFO_H */ \ No newline at end of file
diff --git a/src/core/lib/security/transport/secure_endpoint.c b/src/core/lib/security/transport/secure_endpoint.cc
index ae5633b82c..ae5633b82c 100644
--- a/src/core/lib/security/transport/secure_endpoint.c
+++ b/src/core/lib/security/transport/secure_endpoint.cc
diff --git a/src/core/lib/security/transport/secure_endpoint.h b/src/core/lib/security/transport/secure_endpoint.h
index 3323a6ff42..832cc1c0ce 100644
--- a/src/core/lib/security/transport/secure_endpoint.h
+++ b/src/core/lib/security/transport/secure_endpoint.h
@@ -22,6 +22,10 @@
#include <grpc/slice.h>
#include "src/core/lib/iomgr/endpoint.h"
+#ifdef __cplusplus
+extern "C" {
+#endif
+
struct tsi_frame_protector;
struct tsi_zero_copy_grpc_protector;
@@ -36,4 +40,8 @@ grpc_endpoint *grpc_secure_endpoint_create(
grpc_endpoint *to_wrap, grpc_slice *leftover_slices,
size_t leftover_nslices);
-#endif /* GRPC_CORE_LIB_SECURITY_TRANSPORT_SECURE_ENDPOINT_H */
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* GRPC_CORE_LIB_SECURITY_TRANSPORT_SECURE_ENDPOINT_H */ \ No newline at end of file
diff --git a/src/core/lib/security/transport/security_connector.c b/src/core/lib/security/transport/security_connector.cc
index 2a9e939d40..51844fb91f 100644
--- a/src/core/lib/security/transport/security_connector.c
+++ b/src/core/lib/security/transport/security_connector.cc
@@ -200,11 +200,13 @@ void grpc_security_connector_unref(grpc_exec_ctx *exec_ctx,
}
static void connector_pointer_arg_destroy(grpc_exec_ctx *exec_ctx, void *p) {
- GRPC_SECURITY_CONNECTOR_UNREF(exec_ctx, p, "connector_pointer_arg_destroy");
+ GRPC_SECURITY_CONNECTOR_UNREF(exec_ctx, (grpc_security_connector *)p,
+ "connector_pointer_arg_destroy");
}
static void *connector_pointer_arg_copy(void *p) {
- return GRPC_SECURITY_CONNECTOR_REF(p, "connector_pointer_arg_copy");
+ return GRPC_SECURITY_CONNECTOR_REF((grpc_security_connector *)p,
+ "connector_pointer_arg_copy");
}
static int connector_pointer_cmp(void *a, void *b) { return GPR_ICMP(a, b); }
@@ -214,8 +216,8 @@ static const grpc_arg_pointer_vtable connector_pointer_vtable = {
connector_pointer_cmp};
grpc_arg grpc_security_connector_to_arg(grpc_security_connector *sc) {
- return grpc_channel_arg_pointer_create(GRPC_ARG_SECURITY_CONNECTOR, sc,
- &connector_pointer_vtable);
+ return grpc_channel_arg_pointer_create((char *)GRPC_ARG_SECURITY_CONNECTOR,
+ sc, &connector_pointer_vtable);
}
grpc_security_connector *grpc_security_connector_from_arg(const grpc_arg *arg) {
@@ -225,7 +227,7 @@ grpc_security_connector *grpc_security_connector_from_arg(const grpc_arg *arg) {
GRPC_ARG_SECURITY_CONNECTOR);
return NULL;
}
- return arg->value.pointer.p;
+ return (grpc_security_connector *)arg->value.pointer.p;
}
grpc_security_connector *grpc_security_connector_find_in_args(
@@ -424,7 +426,8 @@ static grpc_security_connector_vtable fake_server_vtable = {
grpc_channel_security_connector *grpc_fake_channel_security_connector_create(
grpc_call_credentials *request_metadata_creds, const char *target,
const grpc_channel_args *args) {
- grpc_fake_channel_security_connector *c = gpr_zalloc(sizeof(*c));
+ grpc_fake_channel_security_connector *c =
+ (grpc_fake_channel_security_connector *)gpr_zalloc(sizeof(*c));
gpr_ref_init(&c->base.base.refcount, 1);
c->base.base.url_scheme = GRPC_FAKE_SECURITY_URL_SCHEME;
c->base.base.vtable = &fake_channel_vtable;
@@ -443,7 +446,8 @@ grpc_channel_security_connector *grpc_fake_channel_security_connector_create(
grpc_server_security_connector *grpc_fake_server_security_connector_create(
void) {
grpc_server_security_connector *c =
- gpr_zalloc(sizeof(grpc_server_security_connector));
+ (grpc_server_security_connector *)gpr_zalloc(
+ sizeof(grpc_server_security_connector));
gpr_ref_init(&c->base.refcount, 1);
c->base.vtable = &fake_server_vtable;
c->base.url_scheme = GRPC_FAKE_SECURITY_URL_SCHEME;
@@ -658,7 +662,8 @@ tsi_peer tsi_shallow_peer_from_ssl_auth_context(
while (grpc_auth_property_iterator_next(&it) != NULL) max_num_props++;
if (max_num_props > 0) {
- peer.properties = gpr_malloc(max_num_props * sizeof(tsi_peer_property));
+ peer.properties = (tsi_peer_property *)gpr_malloc(
+ max_num_props * sizeof(tsi_peer_property));
it = grpc_auth_context_property_iterator(auth_context);
while ((prop = grpc_auth_property_iterator_next(&it)) != NULL) {
if (strcmp(prop->name, GRPC_X509_SAN_PROPERTY_NAME) == 0) {
@@ -804,13 +809,13 @@ grpc_security_status grpc_ssl_channel_security_connector_create(
const char *overridden_target_name, grpc_channel_security_connector **sc) {
size_t num_alpn_protocols = grpc_chttp2_num_alpn_versions();
const char **alpn_protocol_strings =
- gpr_malloc(sizeof(const char *) * num_alpn_protocols);
+ (const char **)gpr_malloc(sizeof(const char *) * num_alpn_protocols);
tsi_result result = TSI_OK;
grpc_ssl_channel_security_connector *c;
size_t i;
const char *pem_root_certs;
char *port;
-
+ bool has_key_cert_pair;
for (i = 0; i < num_alpn_protocols; i++) {
alpn_protocol_strings[i] = grpc_chttp2_get_alpn_version_index(i);
}
@@ -829,7 +834,8 @@ grpc_security_status grpc_ssl_channel_security_connector_create(
pem_root_certs = config->pem_root_certs;
}
- c = gpr_zalloc(sizeof(grpc_ssl_channel_security_connector));
+ c = (grpc_ssl_channel_security_connector *)gpr_zalloc(
+ sizeof(grpc_ssl_channel_security_connector));
gpr_ref_init(&c->base.base.refcount, 1);
c->base.base.vtable = &ssl_channel_vtable;
@@ -845,8 +851,8 @@ grpc_security_status grpc_ssl_channel_security_connector_create(
c->overridden_target_name = gpr_strdup(overridden_target_name);
}
- bool has_key_cert_pair = config->pem_key_cert_pair.private_key != NULL &&
- config->pem_key_cert_pair.cert_chain != NULL;
+ has_key_cert_pair = config->pem_key_cert_pair.private_key != NULL &&
+ config->pem_key_cert_pair.cert_chain != NULL;
result = tsi_create_ssl_client_handshaker_factory(
has_key_cert_pair ? &config->pem_key_cert_pair : NULL, pem_root_certs,
ssl_cipher_suites(), alpn_protocol_strings, (uint16_t)num_alpn_protocols,
@@ -872,7 +878,7 @@ grpc_security_status grpc_ssl_server_security_connector_create(
grpc_server_security_connector **sc) {
size_t num_alpn_protocols = grpc_chttp2_num_alpn_versions();
const char **alpn_protocol_strings =
- gpr_malloc(sizeof(const char *) * num_alpn_protocols);
+ (const char **)gpr_malloc(sizeof(const char *) * num_alpn_protocols);
tsi_result result = TSI_OK;
grpc_ssl_server_security_connector *c;
size_t i;
@@ -885,7 +891,8 @@ grpc_security_status grpc_ssl_server_security_connector_create(
gpr_log(GPR_ERROR, "An SSL server needs a key and a cert.");
goto error;
}
- c = gpr_zalloc(sizeof(grpc_ssl_server_security_connector));
+ c = (grpc_ssl_server_security_connector *)gpr_zalloc(
+ sizeof(grpc_ssl_server_security_connector));
gpr_ref_init(&c->base.base.refcount, 1);
c->base.base.url_scheme = GRPC_SSL_URL_SCHEME;
diff --git a/src/core/lib/security/transport/security_connector.h b/src/core/lib/security/transport/security_connector.h
index 4f9b63ad20..4d87cd0c80 100644
--- a/src/core/lib/security/transport/security_connector.h
+++ b/src/core/lib/security/transport/security_connector.h
@@ -29,6 +29,10 @@
#include "src/core/tsi/ssl_transport_security.h"
#include "src/core/tsi/transport_security_interface.h"
+#ifdef __cplusplus
+extern "C" {
+#endif
+
#ifndef NDEBUG
extern grpc_tracer_flag grpc_trace_security_connector_refcount;
#endif
@@ -245,4 +249,8 @@ tsi_peer tsi_shallow_peer_from_ssl_auth_context(
const grpc_auth_context *auth_context);
void tsi_shallow_peer_destruct(tsi_peer *peer);
+#ifdef __cplusplus
+}
+#endif
+
#endif /* GRPC_CORE_LIB_SECURITY_TRANSPORT_SECURITY_CONNECTOR_H */
diff --git a/src/core/lib/security/transport/security_handshaker.c b/src/core/lib/security/transport/security_handshaker.cc
index 3d19605617..3d19605617 100644
--- a/src/core/lib/security/transport/security_handshaker.c
+++ b/src/core/lib/security/transport/security_handshaker.cc
diff --git a/src/core/lib/security/transport/security_handshaker.h b/src/core/lib/security/transport/security_handshaker.h
index 95bf127fc6..345065f26c 100644
--- a/src/core/lib/security/transport/security_handshaker.h
+++ b/src/core/lib/security/transport/security_handshaker.h
@@ -23,6 +23,10 @@
#include "src/core/lib/iomgr/exec_ctx.h"
#include "src/core/lib/security/transport/security_connector.h"
+#ifdef __cplusplus
+extern "C" {
+#endif
+
/// Creates a security handshaker using \a handshaker.
grpc_handshaker *grpc_security_handshaker_create(
grpc_exec_ctx *exec_ctx, tsi_handshaker *handshaker,
@@ -31,4 +35,8 @@ grpc_handshaker *grpc_security_handshaker_create(
/// Registers security handshaker factories.
void grpc_security_register_handshaker_factories();
-#endif /* GRPC_CORE_LIB_SECURITY_TRANSPORT_SECURITY_HANDSHAKER_H */
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* GRPC_CORE_LIB_SECURITY_TRANSPORT_SECURITY_HANDSHAKER_H */ \ No newline at end of file
diff --git a/src/core/lib/security/transport/server_auth_filter.c b/src/core/lib/security/transport/server_auth_filter.cc
index 7f523c0883..f5e02f42fe 100644
--- a/src/core/lib/security/transport/server_auth_filter.c
+++ b/src/core/lib/security/transport/server_auth_filter.cc
@@ -63,8 +63,8 @@ static grpc_metadata_array metadata_batch_to_md_array(
grpc_slice value = GRPC_MDVALUE(md);
if (result.count == result.capacity) {
result.capacity = GPR_MAX(result.capacity + 8, result.capacity * 2);
- result.metadata =
- gpr_realloc(result.metadata, result.capacity * sizeof(grpc_metadata));
+ result.metadata = (grpc_metadata *)gpr_realloc(
+ result.metadata, result.capacity * sizeof(grpc_metadata));
}
usr_md = &result.metadata[result.count++];
usr_md->key = grpc_slice_ref_internal(key);
@@ -76,8 +76,8 @@ static grpc_metadata_array metadata_batch_to_md_array(
static grpc_filtered_mdelem remove_consumed_md(grpc_exec_ctx *exec_ctx,
void *user_data,
grpc_mdelem md) {
- grpc_call_element *elem = user_data;
- call_data *calld = elem->call_data;
+ grpc_call_element *elem = (grpc_call_element *)user_data;
+ call_data *calld = (call_data *)elem->call_data;
size_t i;
for (i = 0; i < calld->num_consumed_md; i++) {
const grpc_metadata *consumed_md = &calld->consumed_md[i];
@@ -95,7 +95,7 @@ static void on_md_processing_done_inner(grpc_exec_ctx *exec_ctx,
const grpc_metadata *response_md,
size_t num_response_md,
grpc_error *error) {
- call_data *calld = elem->call_data;
+ call_data *calld = (call_data *)elem->call_data;
grpc_transport_stream_op_batch *batch = calld->recv_initial_metadata_batch;
/* TODO(jboeuf): Implement support for response_md. */
if (response_md != NULL && num_response_md > 0) {
@@ -119,8 +119,8 @@ static void on_md_processing_done(
void *user_data, const grpc_metadata *consumed_md, size_t num_consumed_md,
const grpc_metadata *response_md, size_t num_response_md,
grpc_status_code status, const char *error_details) {
- grpc_call_element *elem = user_data;
- call_data *calld = elem->call_data;
+ grpc_call_element *elem = (grpc_call_element *)user_data;
+ call_data *calld = (call_data *)elem->call_data;
grpc_exec_ctx exec_ctx = GRPC_EXEC_CTX_INIT;
// If the call was not cancelled while we were in flight, process the result.
if (gpr_atm_full_cas(&calld->state, (gpr_atm)STATE_INIT,
@@ -149,7 +149,7 @@ static void on_md_processing_done(
static void cancel_call(grpc_exec_ctx *exec_ctx, void *arg, grpc_error *error) {
grpc_call_element *elem = (grpc_call_element *)arg;
- call_data *calld = elem->call_data;
+ call_data *calld = (call_data *)elem->call_data;
// If the result was not already processed, invoke the callback now.
if (error != GRPC_ERROR_NONE &&
gpr_atm_full_cas(&calld->state, (gpr_atm)STATE_INIT,
@@ -163,8 +163,8 @@ static void cancel_call(grpc_exec_ctx *exec_ctx, void *arg, grpc_error *error) {
static void recv_initial_metadata_ready(grpc_exec_ctx *exec_ctx, void *arg,
grpc_error *error) {
grpc_call_element *elem = (grpc_call_element *)arg;
- channel_data *chand = elem->channel_data;
- call_data *calld = elem->call_data;
+ channel_data *chand = (channel_data *)elem->channel_data;
+ call_data *calld = (call_data *)elem->call_data;
grpc_transport_stream_op_batch *batch = calld->recv_initial_metadata_batch;
if (error == GRPC_ERROR_NONE) {
if (chand->creds != NULL && chand->creds->processor.process != NULL) {
@@ -191,7 +191,7 @@ static void recv_initial_metadata_ready(grpc_exec_ctx *exec_ctx, void *arg,
static void auth_start_transport_stream_op_batch(
grpc_exec_ctx *exec_ctx, grpc_call_element *elem,
grpc_transport_stream_op_batch *batch) {
- call_data *calld = elem->call_data;
+ call_data *calld = (call_data *)elem->call_data;
if (batch->recv_initial_metadata) {
// Inject our callback.
calld->recv_initial_metadata_batch = batch;
@@ -207,8 +207,8 @@ static void auth_start_transport_stream_op_batch(
static grpc_error *init_call_elem(grpc_exec_ctx *exec_ctx,
grpc_call_element *elem,
const grpc_call_element_args *args) {
- call_data *calld = elem->call_data;
- channel_data *chand = elem->channel_data;
+ call_data *calld = (call_data *)elem->call_data;
+ channel_data *chand = (channel_data *)elem->channel_data;
calld->call_combiner = args->call_combiner;
calld->owning_call = args->call_stack;
GRPC_CLOSURE_INIT(&calld->recv_initial_metadata_ready,
@@ -240,7 +240,7 @@ static grpc_error *init_channel_elem(grpc_exec_ctx *exec_ctx,
grpc_channel_element *elem,
grpc_channel_element_args *args) {
GPR_ASSERT(!args->is_last);
- channel_data *chand = elem->channel_data;
+ channel_data *chand = (channel_data *)elem->channel_data;
grpc_auth_context *auth_context =
grpc_find_auth_context_in_args(args->channel_args);
GPR_ASSERT(auth_context != NULL);
@@ -255,7 +255,7 @@ static grpc_error *init_channel_elem(grpc_exec_ctx *exec_ctx,
/* Destructor for channel data */
static void destroy_channel_elem(grpc_exec_ctx *exec_ctx,
grpc_channel_element *elem) {
- channel_data *chand = elem->channel_data;
+ channel_data *chand = (channel_data *)elem->channel_data;
GRPC_AUTH_CONTEXT_UNREF(chand->auth_context, "server_auth_filter");
grpc_server_credentials_unref(exec_ctx, chand->creds);
}
diff --git a/src/core/lib/security/transport/tsi_error.c b/src/core/lib/security/transport/tsi_error.cc
index 72f9600e84..72f9600e84 100644
--- a/src/core/lib/security/transport/tsi_error.c
+++ b/src/core/lib/security/transport/tsi_error.cc
diff --git a/src/core/lib/security/transport/tsi_error.h b/src/core/lib/security/transport/tsi_error.h
index 87a63a8a7c..4c78b06603 100644
--- a/src/core/lib/security/transport/tsi_error.h
+++ b/src/core/lib/security/transport/tsi_error.h
@@ -22,6 +22,14 @@
#include "src/core/lib/iomgr/error.h"
#include "src/core/tsi/transport_security_interface.h"
+#ifdef __cplusplus
+extern "C" {
+#endif
+
grpc_error *grpc_set_tsi_error_result(grpc_error *error, tsi_result result);
-#endif /* GRPC_CORE_LIB_SECURITY_TRANSPORT_TSI_ERROR_H */
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* GRPC_CORE_LIB_SECURITY_TRANSPORT_TSI_ERROR_H */ \ No newline at end of file
diff --git a/src/core/lib/security/util/json_util.c b/src/core/lib/security/util/json_util.cc
index d847addef9..d847addef9 100644
--- a/src/core/lib/security/util/json_util.c
+++ b/src/core/lib/security/util/json_util.cc
diff --git a/src/core/lib/security/util/json_util.h b/src/core/lib/security/util/json_util.h
index 5ea831e27e..43a2f6b9d1 100644
--- a/src/core/lib/security/util/json_util.h
+++ b/src/core/lib/security/util/json_util.h
@@ -28,6 +28,10 @@
#define GRPC_AUTH_JSON_TYPE_SERVICE_ACCOUNT "service_account"
#define GRPC_AUTH_JSON_TYPE_AUTHORIZED_USER "authorized_user"
+#ifdef __cplusplus
+extern "C" {
+#endif
+
// Gets a child property from a json node.
const char *grpc_json_get_string_property(const grpc_json *json,
const char *prop_name);
@@ -37,4 +41,8 @@ const char *grpc_json_get_string_property(const grpc_json *json,
bool grpc_copy_json_string_property(const grpc_json *json,
const char *prop_name, char **copied_value);
-#endif /* GRPC_CORE_LIB_SECURITY_UTIL_JSON_UTIL_H */
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* GRPC_CORE_LIB_SECURITY_UTIL_JSON_UTIL_H */ \ No newline at end of file
diff --git a/src/core/lib/slice/b64.c b/src/core/lib/slice/b64.cc
index 50264719a4..50264719a4 100644
--- a/src/core/lib/slice/b64.c
+++ b/src/core/lib/slice/b64.cc
diff --git a/src/core/lib/slice/b64.h b/src/core/lib/slice/b64.h
index 3fd15febe5..c01da56575 100644
--- a/src/core/lib/slice/b64.h
+++ b/src/core/lib/slice/b64.h
@@ -21,6 +21,10 @@
#include <grpc/slice.h>
+#ifdef __cplusplus
+extern "C" {
+#endif
+
/* Encodes data using base64. It is the caller's responsability to free
the returned char * using gpr_free. Returns NULL on NULL input.
TODO(makdharma) : change the flags to bool from int */
@@ -47,4 +51,8 @@ grpc_slice grpc_base64_decode(grpc_exec_ctx *exec_ctx, const char *b64,
grpc_slice grpc_base64_decode_with_len(grpc_exec_ctx *exec_ctx, const char *b64,
size_t b64_len, int url_safe);
-#endif /* GRPC_CORE_LIB_SLICE_B64_H */
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* GRPC_CORE_LIB_SLICE_B64_H */ \ No newline at end of file
diff --git a/src/core/lib/slice/percent_encoding.c b/src/core/lib/slice/percent_encoding.cc
index effc8d7ad6..effc8d7ad6 100644
--- a/src/core/lib/slice/percent_encoding.c
+++ b/src/core/lib/slice/percent_encoding.cc
diff --git a/src/core/lib/slice/percent_encoding.h b/src/core/lib/slice/percent_encoding.h
index faae26a683..e6f85120c3 100644
--- a/src/core/lib/slice/percent_encoding.h
+++ b/src/core/lib/slice/percent_encoding.h
@@ -30,6 +30,10 @@
#include <grpc/slice.h>
+#ifdef __cplusplus
+extern "C" {
+#endif
+
/* URL percent encoding spec bitfield (usabel as 'unreserved_bytes' in
grpc_percent_encode_slice, grpc_strict_percent_decode_slice).
Flags [A-Za-z0-9-_.~] as unreserved bytes for the percent encoding routines
@@ -60,4 +64,8 @@ bool grpc_strict_percent_decode_slice(grpc_slice slice_in,
This cannot fail. */
grpc_slice grpc_permissive_percent_decode_slice(grpc_slice slice_in);
-#endif /* GRPC_CORE_LIB_SLICE_PERCENT_ENCODING_H */
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* GRPC_CORE_LIB_SLICE_PERCENT_ENCODING_H */ \ No newline at end of file
diff --git a/src/core/lib/slice/slice.c b/src/core/lib/slice/slice.cc
index 0764eda052..0764eda052 100644
--- a/src/core/lib/slice/slice.c
+++ b/src/core/lib/slice/slice.cc
diff --git a/src/core/lib/slice/slice_buffer.c b/src/core/lib/slice/slice_buffer.cc
index 63ffc0b00d..63ffc0b00d 100644
--- a/src/core/lib/slice/slice_buffer.c
+++ b/src/core/lib/slice/slice_buffer.cc
diff --git a/src/core/lib/slice/slice_hash_table.c b/src/core/lib/slice/slice_hash_table.cc
index 6c2c9c201c..6c2c9c201c 100644
--- a/src/core/lib/slice/slice_hash_table.c
+++ b/src/core/lib/slice/slice_hash_table.cc
diff --git a/src/core/lib/slice/slice_hash_table.h b/src/core/lib/slice/slice_hash_table.h
index 339078fef5..3c3f0e61f3 100644
--- a/src/core/lib/slice/slice_hash_table.h
+++ b/src/core/lib/slice/slice_hash_table.h
@@ -19,6 +19,10 @@
#include "src/core/lib/transport/metadata.h"
+#ifdef __cplusplus
+extern "C" {
+#endif
+
/** Hash table implementation.
*
* This implementation uses open addressing
@@ -67,4 +71,8 @@ void *grpc_slice_hash_table_get(const grpc_slice_hash_table *table,
int grpc_slice_hash_table_cmp(const grpc_slice_hash_table *a,
const grpc_slice_hash_table *b);
-#endif /* GRPC_CORE_LIB_SLICE_SLICE_HASH_TABLE_H */
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* GRPC_CORE_LIB_SLICE_SLICE_HASH_TABLE_H */ \ No newline at end of file
diff --git a/src/core/lib/slice/slice_intern.c b/src/core/lib/slice/slice_intern.cc
index ec71b3ca1d..1ea9a2aa67 100644
--- a/src/core/lib/slice/slice_intern.c
+++ b/src/core/lib/slice/slice_intern.cc
@@ -18,6 +18,7 @@
#include "src/core/lib/slice/slice_internal.h"
+#include <inttypes.h>
#include <string.h>
#include <grpc/support/alloc.h>
diff --git a/src/core/lib/slice/slice_internal.h b/src/core/lib/slice/slice_internal.h
index 6df0b4b50b..8591185c53 100644
--- a/src/core/lib/slice/slice_internal.h
+++ b/src/core/lib/slice/slice_internal.h
@@ -24,6 +24,10 @@
#include "src/core/lib/iomgr/exec_ctx.h"
+#ifdef __cplusplus
+extern "C" {
+#endif
+
grpc_slice grpc_slice_ref_internal(grpc_slice slice);
void grpc_slice_unref_internal(grpc_exec_ctx *exec_ctx, grpc_slice slice);
void grpc_slice_buffer_reset_and_unref_internal(grpc_exec_ctx *exec_ctx,
@@ -46,4 +50,8 @@ grpc_slice grpc_slice_maybe_static_intern(grpc_slice slice,
uint32_t grpc_static_slice_hash(grpc_slice s);
int grpc_static_slice_eq(grpc_slice a, grpc_slice b);
-#endif /* GRPC_CORE_LIB_SLICE_SLICE_INTERNAL_H */
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* GRPC_CORE_LIB_SLICE_SLICE_INTERNAL_H */ \ No newline at end of file
diff --git a/src/core/lib/slice/slice_string_helpers.c b/src/core/lib/slice/slice_string_helpers.cc
index d461c474d2..d461c474d2 100644
--- a/src/core/lib/slice/slice_string_helpers.c
+++ b/src/core/lib/slice/slice_string_helpers.cc
diff --git a/src/core/lib/slice/slice_traits.h b/src/core/lib/slice/slice_traits.h
index 4b898bdcd4..1eda17cf00 100644
--- a/src/core/lib/slice/slice_traits.h
+++ b/src/core/lib/slice/slice_traits.h
@@ -22,8 +22,16 @@
#include <grpc/slice.h>
#include <stdbool.h>
+#ifdef __cplusplus
+extern "C" {
+#endif
+
bool grpc_slice_is_legal_header(grpc_slice s);
bool grpc_slice_is_legal_nonbin_header(grpc_slice s);
bool grpc_slice_is_bin_suffixed(grpc_slice s);
-#endif /* GRPC_CORE_LIB_SLICE_SLICE_TRAITS_H */
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* GRPC_CORE_LIB_SLICE_SLICE_TRAITS_H */ \ No newline at end of file
diff --git a/src/core/lib/support/alloc.c b/src/core/lib/support/alloc.cc
index 886d69d64c..886d69d64c 100644
--- a/src/core/lib/support/alloc.c
+++ b/src/core/lib/support/alloc.cc
diff --git a/src/core/lib/support/arena.c b/src/core/lib/support/arena.cc
index 9e0f73ae3d..9e0f73ae3d 100644
--- a/src/core/lib/support/arena.c
+++ b/src/core/lib/support/arena.cc
diff --git a/src/core/lib/support/arena.h b/src/core/lib/support/arena.h
index 47f0e4d16b..8a50786348 100644
--- a/src/core/lib/support/arena.h
+++ b/src/core/lib/support/arena.h
@@ -27,6 +27,10 @@
#include <stddef.h>
+#ifdef __cplusplus
+extern "C" {
+#endif
+
typedef struct gpr_arena gpr_arena;
// Create an arena, with \a initial_size bytes in the first allocated buffer
@@ -36,4 +40,8 @@ void *gpr_arena_alloc(gpr_arena *arena, size_t size);
// Destroy an arena, returning the total number of bytes allocated
size_t gpr_arena_destroy(gpr_arena *arena);
+#ifdef __cplusplus
+}
+#endif
+
#endif /* GRPC_CORE_LIB_SUPPORT_ARENA_H */
diff --git a/src/core/lib/support/atm.c b/src/core/lib/support/atm.cc
index 2f37d62f76..2f37d62f76 100644
--- a/src/core/lib/support/atm.c
+++ b/src/core/lib/support/atm.cc
diff --git a/src/core/lib/support/avl.c b/src/core/lib/support/avl.cc
index 0e28b24c98..0e28b24c98 100644
--- a/src/core/lib/support/avl.c
+++ b/src/core/lib/support/avl.cc
diff --git a/src/core/lib/support/backoff.c b/src/core/lib/support/backoff.cc
index 6dc0df473b..6dc0df473b 100644
--- a/src/core/lib/support/backoff.c
+++ b/src/core/lib/support/backoff.cc
diff --git a/src/core/lib/support/backoff.h b/src/core/lib/support/backoff.h
index 6e0cc3a4b6..31ec28f666 100644
--- a/src/core/lib/support/backoff.h
+++ b/src/core/lib/support/backoff.h
@@ -21,6 +21,10 @@
#include <grpc/support/time.h>
+#ifdef __cplusplus
+extern "C" {
+#endif
+
typedef struct {
/// const: how long to wait after the first failure before retrying
int64_t initial_connect_timeout;
@@ -53,4 +57,8 @@ gpr_timespec gpr_backoff_step(gpr_backoff *backoff, gpr_timespec now);
/// instead
void gpr_backoff_reset(gpr_backoff *backoff);
+#ifdef __cplusplus
+}
+#endif
+
#endif /* GRPC_CORE_LIB_SUPPORT_BACKOFF_H */
diff --git a/src/core/lib/support/cmdline.c b/src/core/lib/support/cmdline.cc
index 9fb80d4460..9fb80d4460 100644
--- a/src/core/lib/support/cmdline.c
+++ b/src/core/lib/support/cmdline.cc
diff --git a/src/core/lib/support/cpu_iphone.c b/src/core/lib/support/cpu_iphone.cc
index dfd69b9fd8..2847e03ba5 100644
--- a/src/core/lib/support/cpu_iphone.c
+++ b/src/core/lib/support/cpu_iphone.cc
@@ -18,6 +18,8 @@
#include <grpc/support/port_platform.h>
+#include <grpc/support/cpu.h>
+
#ifdef GPR_CPU_IPHONE
/* Probably 2 instead of 1, but see comment on gpr_cpu_current_cpu. */
diff --git a/src/core/lib/support/cpu_linux.c b/src/core/lib/support/cpu_linux.cc
index 2280668442..2280668442 100644
--- a/src/core/lib/support/cpu_linux.c
+++ b/src/core/lib/support/cpu_linux.cc
diff --git a/src/core/lib/support/cpu_posix.c b/src/core/lib/support/cpu_posix.cc
index a1ba8202a8..503a96b4c8 100644
--- a/src/core/lib/support/cpu_posix.c
+++ b/src/core/lib/support/cpu_posix.cc
@@ -24,6 +24,7 @@
#include <string.h>
#include <unistd.h>
+#include <grpc/support/cpu.h>
#include <grpc/support/log.h>
#include <grpc/support/sync.h>
#include <grpc/support/useful.h>
diff --git a/src/core/lib/support/cpu_windows.c b/src/core/lib/support/cpu_windows.cc
index af26ff3679..8d89453403 100644
--- a/src/core/lib/support/cpu_windows.c
+++ b/src/core/lib/support/cpu_windows.cc
@@ -19,6 +19,7 @@
#include <grpc/support/port_platform.h>
#ifdef GPR_WINDOWS
+#include <grpc/support/cpu.h>
#include <grpc/support/log.h>
unsigned gpr_cpu_num_cores(void) {
diff --git a/src/core/lib/support/env_linux.c b/src/core/lib/support/env_linux.cc
index 4c45a977ca..4c45a977ca 100644
--- a/src/core/lib/support/env_linux.c
+++ b/src/core/lib/support/env_linux.cc
diff --git a/src/core/lib/support/env_posix.c b/src/core/lib/support/env_posix.cc
index b88822ca02..b88822ca02 100644
--- a/src/core/lib/support/env_posix.c
+++ b/src/core/lib/support/env_posix.cc
diff --git a/src/core/lib/support/env_windows.c b/src/core/lib/support/env_windows.cc
index 652eeb61c6..73c643c560 100644
--- a/src/core/lib/support/env_windows.c
+++ b/src/core/lib/support/env_windows.cc
@@ -45,7 +45,7 @@ char *gpr_getenv(const char *name) {
ret = GetEnvironmentVariable(tname, NULL, 0);
if (ret == 0) return NULL;
size = ret * (DWORD)sizeof(TCHAR);
- tresult = gpr_malloc(size);
+ tresult = (LPTSTR)gpr_malloc(size);
ret = GetEnvironmentVariable(tname, tresult, size);
gpr_free(tname);
if (ret == 0) {
diff --git a/src/core/lib/support/histogram.c b/src/core/lib/support/histogram.cc
index 6d5ead9aa6..6d5ead9aa6 100644
--- a/src/core/lib/support/histogram.c
+++ b/src/core/lib/support/histogram.cc
diff --git a/src/core/lib/support/host_port.c b/src/core/lib/support/host_port.cc
index 3302e574ab..3302e574ab 100644
--- a/src/core/lib/support/host_port.c
+++ b/src/core/lib/support/host_port.cc
diff --git a/src/core/lib/support/log.c b/src/core/lib/support/log.cc
index fadb4d9a2c..69f92e001c 100644
--- a/src/core/lib/support/log.c
+++ b/src/core/lib/support/log.cc
@@ -27,7 +27,7 @@
#include <stdio.h>
#include <string.h>
-extern void gpr_default_log(gpr_log_func_args *args);
+extern "C" void gpr_default_log(gpr_log_func_args *args);
static gpr_atm g_log_func = (gpr_atm)gpr_default_log;
static gpr_atm g_min_severity_to_print = GPR_LOG_VERBOSITY_UNSET;
diff --git a/src/core/lib/support/log_android.c b/src/core/lib/support/log_android.cc
index 6f1cec51f1..6f1cec51f1 100644
--- a/src/core/lib/support/log_android.c
+++ b/src/core/lib/support/log_android.cc
diff --git a/src/core/lib/support/log_linux.c b/src/core/lib/support/log_linux.cc
index 7755018693..0914acedf4 100644
--- a/src/core/lib/support/log_linux.c
+++ b/src/core/lib/support/log_linux.cc
@@ -56,7 +56,7 @@ void gpr_log(const char *file, int line, gpr_log_severity severity,
free(message);
}
-void gpr_default_log(gpr_log_func_args *args) {
+extern "C" void gpr_default_log(gpr_log_func_args *args) {
const char *final_slash;
char *prefix;
const char *display_file;
diff --git a/src/core/lib/support/log_posix.c b/src/core/lib/support/log_posix.cc
index 8b376fce41..38a136e646 100644
--- a/src/core/lib/support/log_posix.c
+++ b/src/core/lib/support/log_posix.cc
@@ -48,7 +48,7 @@ void gpr_log(const char *file, int line, gpr_log_severity severity,
} else if ((size_t)ret <= sizeof(buf) - 1) {
message = buf;
} else {
- message = allocated = gpr_malloc((size_t)ret + 1);
+ message = allocated = (char *)gpr_malloc((size_t)ret + 1);
va_start(args, format);
vsnprintf(message, (size_t)(ret + 1), format, args);
va_end(args);
@@ -57,7 +57,7 @@ void gpr_log(const char *file, int line, gpr_log_severity severity,
gpr_free(allocated);
}
-void gpr_default_log(gpr_log_func_args *args) {
+extern "C" void gpr_default_log(gpr_log_func_args *args) {
char *final_slash;
const char *display_file;
char time_buffer[64];
diff --git a/src/core/lib/support/log_windows.c b/src/core/lib/support/log_windows.cc
index 0fdab79ae6..ee52abea73 100644
--- a/src/core/lib/support/log_windows.c
+++ b/src/core/lib/support/log_windows.cc
@@ -47,7 +47,7 @@ void gpr_log(const char *file, int line, gpr_log_severity severity,
} else {
/* Allocate a new buffer, with space for the NUL terminator. */
size_t strp_buflen = (size_t)ret + 1;
- message = gpr_malloc(strp_buflen);
+ message = (char *)gpr_malloc(strp_buflen);
/* Print to the buffer. */
va_start(args, format);
@@ -65,8 +65,8 @@ void gpr_log(const char *file, int line, gpr_log_severity severity,
}
/* Simple starter implementation */
-void gpr_default_log(gpr_log_func_args *args) {
- char *final_slash;
+extern "C" void gpr_default_log(gpr_log_func_args *args) {
+ const char *final_slash;
const char *display_file;
char time_buffer[64];
time_t timer;
diff --git a/src/core/lib/support/mpscq.c b/src/core/lib/support/mpscq.cc
index e9f893988d..e9f893988d 100644
--- a/src/core/lib/support/mpscq.c
+++ b/src/core/lib/support/mpscq.cc
diff --git a/src/core/lib/support/mpscq.h b/src/core/lib/support/mpscq.h
index daa51768f7..ca63a044bb 100644
--- a/src/core/lib/support/mpscq.h
+++ b/src/core/lib/support/mpscq.h
@@ -23,6 +23,10 @@
#include <stdbool.h>
#include <stddef.h>
+#ifdef __cplusplus
+extern "C" {
+#endif
+
// Multiple-producer single-consumer lock free queue, based upon the
// implementation from Dmitry Vyukov here:
// http://www.1024cores.net/home/lock-free-algorithms/queues/intrusive-mpsc-node-based-queue
@@ -50,4 +54,8 @@ gpr_mpscq_node *gpr_mpscq_pop(gpr_mpscq *q);
// Pop a node; sets *empty to true if the queue is empty, or false if it is not
gpr_mpscq_node *gpr_mpscq_pop_and_check_end(gpr_mpscq *q, bool *empty);
+#ifdef __cplusplus
+}
+#endif
+
#endif /* GRPC_CORE_LIB_SUPPORT_MPSCQ_H */
diff --git a/src/core/lib/support/murmur_hash.c b/src/core/lib/support/murmur_hash.cc
index f06b970de7..f06b970de7 100644
--- a/src/core/lib/support/murmur_hash.c
+++ b/src/core/lib/support/murmur_hash.cc
diff --git a/src/core/lib/support/murmur_hash.h b/src/core/lib/support/murmur_hash.h
index 7510b4d09c..a4c642e49f 100644
--- a/src/core/lib/support/murmur_hash.h
+++ b/src/core/lib/support/murmur_hash.h
@@ -23,7 +23,15 @@
#include <stddef.h>
+#ifdef __cplusplus
+extern "C" {
+#endif
+
/* compute the hash of key (length len) */
uint32_t gpr_murmur_hash3(const void *key, size_t len, uint32_t seed);
+#ifdef __cplusplus
+}
+#endif
+
#endif /* GRPC_CORE_LIB_SUPPORT_MURMUR_HASH_H */
diff --git a/src/core/lib/support/spinlock.h b/src/core/lib/support/spinlock.h
index 37adda11b0..47584f6279 100644
--- a/src/core/lib/support/spinlock.h
+++ b/src/core/lib/support/spinlock.h
@@ -25,9 +25,14 @@
a concurrency code smell. */
typedef struct { gpr_atm atm; } gpr_spinlock;
+#ifdef __cplusplus
+#define GPR_SPINLOCK_INITIALIZER (gpr_spinlock{0})
+#else
#define GPR_SPINLOCK_INITIALIZER ((gpr_spinlock){0})
+#endif
#define GPR_SPINLOCK_STATIC_INITIALIZER \
{ 0 }
+
#define gpr_spinlock_trylock(lock) (gpr_atm_acq_cas(&(lock)->atm, 0, 1))
#define gpr_spinlock_unlock(lock) (gpr_atm_rel_store(&(lock)->atm, 0))
#define gpr_spinlock_lock(lock) \
diff --git a/src/core/lib/support/stack_lockfree.c b/src/core/lib/support/stack_lockfree.cc
index 0fb64ed001..0fb64ed001 100644
--- a/src/core/lib/support/stack_lockfree.c
+++ b/src/core/lib/support/stack_lockfree.cc
diff --git a/src/core/lib/support/stack_lockfree.h b/src/core/lib/support/stack_lockfree.h
index 6324211b72..706f63fbf6 100644
--- a/src/core/lib/support/stack_lockfree.h
+++ b/src/core/lib/support/stack_lockfree.h
@@ -21,6 +21,10 @@
#include <stddef.h>
+#ifdef __cplusplus
+extern "C" {
+#endif
+
typedef struct gpr_stack_lockfree gpr_stack_lockfree;
/* This stack must specify the maximum number of entries to track.
@@ -35,4 +39,8 @@ int gpr_stack_lockfree_push(gpr_stack_lockfree *, int entry);
/* Returns -1 on empty or the actual entry number */
int gpr_stack_lockfree_pop(gpr_stack_lockfree *stack);
+#ifdef __cplusplus
+}
+#endif
+
#endif /* GRPC_CORE_LIB_SUPPORT_STACK_LOCKFREE_H */
diff --git a/src/core/lib/support/string.c b/src/core/lib/support/string.cc
index 6b172df82f..d55863892f 100644
--- a/src/core/lib/support/string.c
+++ b/src/core/lib/support/string.cc
@@ -27,6 +27,7 @@
#include <grpc/support/alloc.h>
#include <grpc/support/log.h>
#include <grpc/support/port_platform.h>
+#include <grpc/support/string_util.h>
#include <grpc/support/useful.h>
char *gpr_strdup(const char *src) {
diff --git a/src/core/lib/support/string_posix.c b/src/core/lib/support/string_posix.cc
index e768faf739..92de21a6e1 100644
--- a/src/core/lib/support/string_posix.c
+++ b/src/core/lib/support/string_posix.cc
@@ -25,6 +25,7 @@
#include <string.h>
#include <grpc/support/alloc.h>
+#include <grpc/support/string_util.h>
int gpr_asprintf(char **strp, const char *format, ...) {
va_list args;
diff --git a/src/core/lib/support/string_util_windows.c b/src/core/lib/support/string_util_windows.cc
index 2a03404448..b365512ee3 100644
--- a/src/core/lib/support/string_util_windows.c
+++ b/src/core/lib/support/string_util_windows.cc
@@ -26,15 +26,18 @@
anything else, especially strsafe.h. */
#include <wchar.h>
+#include <inttypes.h>
#include <stdarg.h>
#include <stdio.h>
#include <string.h>
#include <strsafe.h>
#include <grpc/support/alloc.h>
+#include <grpc/support/log_windows.h>
#include <grpc/support/string_util.h>
#include "src/core/lib/support/string.h"
+#include "src/core/lib/support/string_windows.h"
#if defined UNICODE || defined _UNICODE
LPTSTR
@@ -42,7 +45,7 @@ gpr_char_to_tchar(LPCSTR input) {
LPTSTR ret;
int needed = MultiByteToWideChar(CP_UTF8, 0, input, -1, NULL, 0);
if (needed <= 0) return NULL;
- ret = gpr_malloc((unsigned)needed * sizeof(TCHAR));
+ ret = (LPTSTR)gpr_malloc((unsigned)needed * sizeof(TCHAR));
MultiByteToWideChar(CP_UTF8, 0, input, -1, ret, needed);
return ret;
}
@@ -52,14 +55,14 @@ gpr_tchar_to_char(LPCTSTR input) {
LPSTR ret;
int needed = WideCharToMultiByte(CP_UTF8, 0, input, -1, NULL, 0, NULL, NULL);
if (needed <= 0) return NULL;
- ret = gpr_malloc((unsigned)needed);
+ ret = (LPSTR)gpr_malloc((unsigned)needed);
WideCharToMultiByte(CP_UTF8, 0, input, -1, ret, needed, NULL, NULL);
return ret;
}
#else
-char *gpr_tchar_to_char(LPTSTR input) { return gpr_strdup(input); }
+LPSTR gpr_tchar_to_char(LPCTSTR input) { return (LPSTR)gpr_strdup(input); }
-char *gpr_char_to_tchar(LPTSTR input) { return gpr_strdup(input); }
+LPTSTR gpr_char_to_tchar(LPCTSTR input) { return (LPTSTR)gpr_strdup(input); }
#endif
char *gpr_format_message(int messageid) {
diff --git a/src/core/lib/support/string_windows.c b/src/core/lib/support/string_windows.cc
index 50278d9559..d37863c066 100644
--- a/src/core/lib/support/string_windows.c
+++ b/src/core/lib/support/string_windows.cc
@@ -27,6 +27,7 @@
#include <string.h>
#include <grpc/support/alloc.h>
+#include <grpc/support/string_util.h>
#include "src/core/lib/support/string.h"
@@ -46,7 +47,7 @@ int gpr_asprintf(char **strp, const char *format, ...) {
/* Allocate a new buffer, with space for the NUL terminator. */
strp_buflen = (size_t)ret + 1;
- if ((*strp = gpr_malloc(strp_buflen)) == NULL) {
+ if ((*strp = (char *)gpr_malloc(strp_buflen)) == NULL) {
/* This shouldn't happen, because gpr_malloc() calls abort(). */
return -1;
}
diff --git a/src/core/lib/support/string_windows.h b/src/core/lib/support/string_windows.h
index 7c7f31e7aa..6771647581 100644
--- a/src/core/lib/support/string_windows.h
+++ b/src/core/lib/support/string_windows.h
@@ -21,6 +21,10 @@
#include <grpc/support/port_platform.h>
+#ifdef __cplusplus
+extern "C" {
+#endif
+
#ifdef GPR_WINDOWS
/* These allocate new strings using gpr_malloc to convert from and to utf-8. */
@@ -29,4 +33,8 @@ LPSTR gpr_tchar_to_char(LPCTSTR input);
#endif /* GPR_WINDOWS */
+#ifdef __cplusplus
+}
+#endif
+
#endif /* GRPC_CORE_LIB_SUPPORT_STRING_WINDOWS_H */
diff --git a/src/core/lib/support/subprocess_posix.c b/src/core/lib/support/subprocess_posix.cc
index af75162ee9..af75162ee9 100644
--- a/src/core/lib/support/subprocess_posix.c
+++ b/src/core/lib/support/subprocess_posix.cc
diff --git a/src/core/lib/support/subprocess_windows.c b/src/core/lib/support/subprocess_windows.cc
index 7412f8d344..6769f1d3a4 100644
--- a/src/core/lib/support/subprocess_windows.c
+++ b/src/core/lib/support/subprocess_windows.cc
@@ -61,7 +61,7 @@ gpr_subprocess *gpr_subprocess_create(int argc, const char **argv) {
}
gpr_free(args_tchar);
- r = gpr_malloc(sizeof(gpr_subprocess));
+ r = (gpr_subprocess *)gpr_malloc(sizeof(gpr_subprocess));
memset(r, 0, sizeof(*r));
r->pi = pi;
return r;
diff --git a/src/core/lib/support/sync.c b/src/core/lib/support/sync.cc
index 994dcb0e14..994dcb0e14 100644
--- a/src/core/lib/support/sync.c
+++ b/src/core/lib/support/sync.cc
diff --git a/src/core/lib/support/sync_posix.c b/src/core/lib/support/sync_posix.cc
index 62d800b18c..62d800b18c 100644
--- a/src/core/lib/support/sync_posix.c
+++ b/src/core/lib/support/sync_posix.cc
diff --git a/src/core/lib/support/sync_windows.c b/src/core/lib/support/sync_windows.cc
index 008c5aecba..62fdd40af7 100644
--- a/src/core/lib/support/sync_windows.c
+++ b/src/core/lib/support/sync_windows.cc
@@ -104,7 +104,7 @@ struct run_once_func_arg {
void (*init_function)(void);
};
static BOOL CALLBACK run_once_func(gpr_once *once, void *v, void **pv) {
- struct run_once_func_arg *arg = v;
+ struct run_once_func_arg *arg = (struct run_once_func_arg *)v;
(*arg->init_function)();
return 1;
}
diff --git a/src/core/lib/support/thd.c b/src/core/lib/support/thd.cc
index ca62615d65..ca62615d65 100644
--- a/src/core/lib/support/thd.c
+++ b/src/core/lib/support/thd.cc
diff --git a/src/core/lib/support/thd_posix.c b/src/core/lib/support/thd_posix.cc
index 98afd10df7..98afd10df7 100644
--- a/src/core/lib/support/thd_posix.c
+++ b/src/core/lib/support/thd_posix.cc
diff --git a/src/core/lib/support/thd_windows.c b/src/core/lib/support/thd_windows.cc
index 54533e9412..1a82805dd9 100644
--- a/src/core/lib/support/thd_windows.c
+++ b/src/core/lib/support/thd_windows.cc
@@ -66,7 +66,7 @@ static DWORD WINAPI thread_body(void *v) {
int gpr_thd_new(gpr_thd_id *t, void (*thd_body)(void *arg), void *arg,
const gpr_thd_options *options) {
HANDLE handle;
- struct thd_info *info = gpr_malloc(sizeof(*info));
+ struct thd_info *info = (struct thd_info *)gpr_malloc(sizeof(*info));
info->body = thd_body;
info->arg = arg;
*t = 0;
diff --git a/src/core/lib/support/time.c b/src/core/lib/support/time.cc
index 6903674d75..6903674d75 100644
--- a/src/core/lib/support/time.c
+++ b/src/core/lib/support/time.cc
diff --git a/src/core/lib/support/time_posix.c b/src/core/lib/support/time_posix.cc
index 3ead40d807..deccb50975 100644
--- a/src/core/lib/support/time_posix.c
+++ b/src/core/lib/support/time_posix.cc
@@ -128,7 +128,9 @@ static gpr_timespec now_impl(gpr_clock_type clock) {
}
#endif
+extern "C" {
gpr_timespec (*gpr_now_impl)(gpr_clock_type clock_type) = now_impl;
+}
#ifdef GPR_LOW_LEVEL_COUNTERS
gpr_atm gpr_now_call_count;
diff --git a/src/core/lib/support/time_precise.c b/src/core/lib/support/time_precise.cc
index 6ce19e53cc..05ef7c59bc 100644
--- a/src/core/lib/support/time_precise.c
+++ b/src/core/lib/support/time_precise.cc
@@ -20,6 +20,8 @@
#include <grpc/support/time.h>
#include <stdio.h>
+#include "src/core/lib/support/time_precise.h"
+
#ifdef GRPC_TIMERS_RDTSC
#if defined(__i386__)
static void gpr_get_cycle_counter(int64_t int *clk) {
diff --git a/src/core/lib/support/time_precise.h b/src/core/lib/support/time_precise.h
index aa28d6d7c4..cb15cdf919 100644
--- a/src/core/lib/support/time_precise.h
+++ b/src/core/lib/support/time_precise.h
@@ -21,7 +21,15 @@
#include <grpc/support/time.h>
+#ifdef __cplusplus
+extern "C" {
+#endif
+
void gpr_precise_clock_init(void);
void gpr_precise_clock_now(gpr_timespec *clk);
+#ifdef __cplusplus
+}
+#endif
+
#endif /* GRPC_CORE_LIB_SUPPORT_TIME_PRECISE_H */
diff --git a/src/core/lib/support/time_windows.c b/src/core/lib/support/time_windows.cc
index 40df3761c0..dda7566cd8 100644
--- a/src/core/lib/support/time_windows.c
+++ b/src/core/lib/support/time_windows.cc
@@ -69,7 +69,9 @@ static gpr_timespec now_impl(gpr_clock_type clock) {
return now_tv;
}
+extern "C" {
gpr_timespec (*gpr_now_impl)(gpr_clock_type clock_type) = now_impl;
+}
gpr_timespec gpr_now(gpr_clock_type clock_type) {
return gpr_now_impl(clock_type);
diff --git a/src/core/lib/support/tls_pthread.c b/src/core/lib/support/tls_pthread.cc
index 9ebee577fe..9ebee577fe 100644
--- a/src/core/lib/support/tls_pthread.c
+++ b/src/core/lib/support/tls_pthread.cc
diff --git a/src/core/lib/support/tmpfile_msys.c b/src/core/lib/support/tmpfile_msys.cc
index 614c0a4a18..614c0a4a18 100644
--- a/src/core/lib/support/tmpfile_msys.c
+++ b/src/core/lib/support/tmpfile_msys.cc
diff --git a/src/core/lib/support/tmpfile_posix.c b/src/core/lib/support/tmpfile_posix.cc
index 7ad3af0a57..7ad3af0a57 100644
--- a/src/core/lib/support/tmpfile_posix.c
+++ b/src/core/lib/support/tmpfile_posix.cc
diff --git a/src/core/lib/support/tmpfile_windows.c b/src/core/lib/support/tmpfile_windows.cc
index 47b4510a72..47b4510a72 100644
--- a/src/core/lib/support/tmpfile_windows.c
+++ b/src/core/lib/support/tmpfile_windows.cc
diff --git a/src/core/lib/support/wrap_memcpy.c b/src/core/lib/support/wrap_memcpy.cc
index cff056dc3b..c2362bf5b8 100644
--- a/src/core/lib/support/wrap_memcpy.c
+++ b/src/core/lib/support/wrap_memcpy.cc
@@ -26,6 +26,7 @@
* Enable by setting LDFLAGS=-Wl,-wrap,memcpy when linking.
*/
+extern "C" {
#ifdef __linux__
#if defined(__x86_64__) && !defined(GPR_MUSL_LIBC_COMPAT)
__asm__(".symver memcpy,memcpy@GLIBC_2.2.5");
@@ -38,3 +39,4 @@ void *__wrap_memcpy(void *destination, const void *source, size_t num) {
}
#endif
#endif
+}
diff --git a/src/core/lib/surface/alarm.c b/src/core/lib/surface/alarm.cc
index 7712f560b9..4e67543191 100644
--- a/src/core/lib/surface/alarm.c
+++ b/src/core/lib/surface/alarm.cc
@@ -15,6 +15,10 @@
* limitations under the License.
*
*/
+#include <grpc/support/port_platform.h>
+
+#include <inttypes.h>
+
#include "src/core/lib/surface/alarm_internal.h"
#include <grpc/grpc.h>
diff --git a/src/core/lib/surface/alarm_internal.h b/src/core/lib/surface/alarm_internal.h
index 7f2126c5c9..136b60547f 100644
--- a/src/core/lib/surface/alarm_internal.h
+++ b/src/core/lib/surface/alarm_internal.h
@@ -22,6 +22,10 @@
#include <grpc/support/log.h>
#include "src/core/lib/debug/trace.h"
+#ifdef __cplusplus
+extern "C" {
+#endif
+
#ifndef NDEBUG
extern grpc_tracer_flag grpc_trace_alarm_refcount;
@@ -37,4 +41,8 @@ extern grpc_tracer_flag grpc_trace_alarm_refcount;
#endif /* defined(NDEBUG) */
+#ifdef __cplusplus
+}
+#endif
+
#endif /* GRPC_CORE_LIB_SURFACE_ALARM_INTERNAL_H */
diff --git a/src/core/lib/surface/api_trace.c b/src/core/lib/surface/api_trace.cc
index 56973303da..56973303da 100644
--- a/src/core/lib/surface/api_trace.c
+++ b/src/core/lib/surface/api_trace.cc
diff --git a/src/core/lib/surface/api_trace.h b/src/core/lib/surface/api_trace.h
index 849cbaaef6..105abdf629 100644
--- a/src/core/lib/surface/api_trace.h
+++ b/src/core/lib/surface/api_trace.h
@@ -22,6 +22,10 @@
#include <grpc/support/log.h>
#include "src/core/lib/debug/trace.h"
+#ifdef __cplusplus
+extern "C" {
+#endif
+
extern grpc_tracer_flag grpc_api_trace;
/* Provide unwrapping macros because we're in C89 and variadic macros weren't
@@ -47,4 +51,8 @@ extern grpc_tracer_flag grpc_api_trace;
gpr_log(GPR_INFO, fmt GRPC_API_TRACE_UNWRAP##nargs args); \
}
+#ifdef __cplusplus
+}
+#endif
+
#endif /* GRPC_CORE_LIB_SURFACE_API_TRACE_H */
diff --git a/src/core/lib/surface/byte_buffer.c b/src/core/lib/surface/byte_buffer.cc
index 7ed550ef87..7ed550ef87 100644
--- a/src/core/lib/surface/byte_buffer.c
+++ b/src/core/lib/surface/byte_buffer.cc
diff --git a/src/core/lib/surface/byte_buffer_reader.c b/src/core/lib/surface/byte_buffer_reader.cc
index 87bd3239c0..87bd3239c0 100644
--- a/src/core/lib/surface/byte_buffer_reader.c
+++ b/src/core/lib/surface/byte_buffer_reader.cc
diff --git a/src/core/lib/surface/call.c b/src/core/lib/surface/call.cc
index 03f47553a1..6c97f5cc01 100644
--- a/src/core/lib/surface/call.c
+++ b/src/core/lib/surface/call.cc
@@ -41,6 +41,7 @@
#include "src/core/lib/support/string.h"
#include "src/core/lib/surface/api_trace.h"
#include "src/core/lib/surface/call.h"
+#include "src/core/lib/surface/call_test_only.h"
#include "src/core/lib/surface/channel.h"
#include "src/core/lib/surface/completion_queue.h"
#include "src/core/lib/surface/validate_metadata.h"
@@ -93,10 +94,11 @@ static gpr_atm pack_received_status(received_status r) {
}
static received_status unpack_received_status(gpr_atm atm) {
- return (atm & 1) == 0
- ? (received_status){.is_set = false, .error = GRPC_ERROR_NONE}
- : (received_status){.is_set = true,
- .error = (grpc_error *)(atm & ~(gpr_atm)1)};
+ if ((atm & 1) == 0) {
+ return {false, GRPC_ERROR_NONE};
+ } else {
+ return {true, (grpc_error *)(atm & ~(gpr_atm)1)};
+ }
}
#define MAX_ERRORS_PER_BATCH 4
@@ -439,15 +441,14 @@ grpc_error *grpc_call_create(grpc_exec_ctx *exec_ctx,
GRPC_CHANNEL_INTERNAL_REF(args->channel, "call");
/* initial refcount dropped by grpc_call_unref */
- grpc_call_element_args call_args = {
- .call_stack = CALL_STACK_FROM_CALL(call),
- .server_transport_data = args->server_transport_data,
- .context = call->context,
- .path = path,
- .start_time = call->start_time,
- .deadline = send_deadline,
- .arena = call->arena,
- .call_combiner = &call->call_combiner};
+ grpc_call_element_args call_args = {CALL_STACK_FROM_CALL(call),
+ args->server_transport_data,
+ call->context,
+ path,
+ call->start_time,
+ send_deadline,
+ call->arena,
+ &call->call_combiner};
add_init_error(&error, grpc_call_stack_init(exec_ctx, channel_stack, 1,
destroy_call, call, &call_args));
if (error != GRPC_ERROR_NONE) {
@@ -807,10 +808,8 @@ static void get_final_status(grpc_call *call,
static void set_status_from_error(grpc_exec_ctx *exec_ctx, grpc_call *call,
status_source source, grpc_error *error) {
if (!gpr_atm_rel_cas(&call->status[source],
- pack_received_status((received_status){
- .is_set = false, .error = GRPC_ERROR_NONE}),
- pack_received_status((received_status){
- .is_set = true, .error = error}))) {
+ pack_received_status({false, GRPC_ERROR_NONE}),
+ pack_received_status({true, error}))) {
GRPC_ERROR_UNREF(error);
}
}
diff --git a/src/core/lib/surface/call_details.c b/src/core/lib/surface/call_details.cc
index ea9208c7e3..ea9208c7e3 100644
--- a/src/core/lib/surface/call_details.c
+++ b/src/core/lib/surface/call_details.cc
diff --git a/src/core/lib/surface/call_log_batch.c b/src/core/lib/surface/call_log_batch.cc
index 4a1c265817..5557927b7c 100644
--- a/src/core/lib/surface/call_log_batch.c
+++ b/src/core/lib/surface/call_log_batch.cc
@@ -18,6 +18,8 @@
#include "src/core/lib/surface/call.h"
+#include <inttypes.h>
+
#include <grpc/support/alloc.h>
#include <grpc/support/string_util.h>
#include "src/core/lib/slice/slice_string_helpers.h"
diff --git a/src/core/lib/surface/channel.c b/src/core/lib/surface/channel.cc
index 48962e5e45..59fced7bc4 100644
--- a/src/core/lib/surface/channel.c
+++ b/src/core/lib/surface/channel.cc
@@ -18,6 +18,7 @@
#include "src/core/lib/surface/channel.h"
+#include <inttypes.h>
#include <stdlib.h>
#include <string.h>
@@ -144,9 +145,8 @@ grpc_channel *grpc_channel_create_with_builder(
channel->compression_options.default_level.level =
(grpc_compression_level)grpc_channel_arg_get_integer(
&args->args[i],
- (grpc_integer_options){GRPC_COMPRESS_LEVEL_NONE,
- GRPC_COMPRESS_LEVEL_NONE,
- GRPC_COMPRESS_LEVEL_COUNT - 1});
+ {GRPC_COMPRESS_LEVEL_NONE, GRPC_COMPRESS_LEVEL_NONE,
+ GRPC_COMPRESS_LEVEL_COUNT - 1});
} else if (0 == strcmp(args->args[i].key,
GRPC_STREAM_COMPRESSION_CHANNEL_DEFAULT_LEVEL)) {
channel->compression_options.default_stream_compression_level.is_set =
@@ -154,17 +154,15 @@ grpc_channel *grpc_channel_create_with_builder(
channel->compression_options.default_stream_compression_level.level =
(grpc_stream_compression_level)grpc_channel_arg_get_integer(
&args->args[i],
- (grpc_integer_options){GRPC_STREAM_COMPRESS_LEVEL_NONE,
- GRPC_STREAM_COMPRESS_LEVEL_NONE,
- GRPC_STREAM_COMPRESS_LEVEL_COUNT - 1});
+ {GRPC_STREAM_COMPRESS_LEVEL_NONE, GRPC_STREAM_COMPRESS_LEVEL_NONE,
+ GRPC_STREAM_COMPRESS_LEVEL_COUNT - 1});
} else if (0 == strcmp(args->args[i].key,
GRPC_COMPRESSION_CHANNEL_DEFAULT_ALGORITHM)) {
channel->compression_options.default_algorithm.is_set = true;
channel->compression_options.default_algorithm.algorithm =
(grpc_compression_algorithm)grpc_channel_arg_get_integer(
- &args->args[i],
- (grpc_integer_options){GRPC_COMPRESS_NONE, GRPC_COMPRESS_NONE,
- GRPC_COMPRESS_ALGORITHMS_COUNT - 1});
+ &args->args[i], {GRPC_COMPRESS_NONE, GRPC_COMPRESS_NONE,
+ GRPC_COMPRESS_ALGORITHMS_COUNT - 1});
} else if (0 == strcmp(args->args[i].key,
GRPC_STREAM_COMPRESSION_CHANNEL_DEFAULT_ALGORITHM)) {
channel->compression_options.default_stream_compression_algorithm.is_set =
@@ -173,9 +171,8 @@ grpc_channel *grpc_channel_create_with_builder(
.algorithm =
(grpc_stream_compression_algorithm)grpc_channel_arg_get_integer(
&args->args[i],
- (grpc_integer_options){
- GRPC_STREAM_COMPRESS_NONE, GRPC_STREAM_COMPRESS_NONE,
- GRPC_STREAM_COMPRESS_ALGORITHMS_COUNT - 1});
+ {GRPC_STREAM_COMPRESS_NONE, GRPC_STREAM_COMPRESS_NONE,
+ GRPC_STREAM_COMPRESS_ALGORITHMS_COUNT - 1});
} else if (0 ==
strcmp(args->args[i].key,
GRPC_COMPRESSION_CHANNEL_ENABLED_ALGORITHMS_BITSET)) {
diff --git a/src/core/lib/surface/channel.h b/src/core/lib/surface/channel.h
index 528bb868e2..427422b565 100644
--- a/src/core/lib/surface/channel.h
+++ b/src/core/lib/surface/channel.h
@@ -23,6 +23,10 @@
#include "src/core/lib/channel/channel_stack_builder.h"
#include "src/core/lib/surface/channel_stack_type.h"
+#ifdef __cplusplus
+extern "C" {
+#endif
+
grpc_channel *grpc_channel_create(grpc_exec_ctx *exec_ctx, const char *target,
const grpc_channel_args *args,
grpc_channel_stack_type channel_stack_type,
@@ -81,4 +85,8 @@ void grpc_channel_internal_unref(grpc_exec_ctx *exec_ctx,
grpc_compression_options grpc_channel_compression_options(
const grpc_channel *channel);
+#ifdef __cplusplus
+}
+#endif
+
#endif /* GRPC_CORE_LIB_SURFACE_CHANNEL_H */
diff --git a/src/core/lib/surface/channel_init.c b/src/core/lib/surface/channel_init.cc
index 33f444b89e..33f444b89e 100644
--- a/src/core/lib/surface/channel_init.c
+++ b/src/core/lib/surface/channel_init.cc
diff --git a/src/core/lib/surface/channel_ping.c b/src/core/lib/surface/channel_ping.cc
index f45b568958..f45b568958 100644
--- a/src/core/lib/surface/channel_ping.c
+++ b/src/core/lib/surface/channel_ping.cc
diff --git a/src/core/lib/surface/channel_stack_type.c b/src/core/lib/surface/channel_stack_type.cc
index 5f5c877727..5f5c877727 100644
--- a/src/core/lib/surface/channel_stack_type.c
+++ b/src/core/lib/surface/channel_stack_type.cc
diff --git a/src/core/lib/surface/channel_stack_type.h b/src/core/lib/surface/channel_stack_type.h
index 3f0e14ffc0..903b90a071 100644
--- a/src/core/lib/surface/channel_stack_type.h
+++ b/src/core/lib/surface/channel_stack_type.h
@@ -21,6 +21,10 @@
#include <stdbool.h>
+#ifdef __cplusplus
+extern "C" {
+#endif
+
typedef enum {
// normal top-half client channel with load-balancing, connection management
GRPC_CLIENT_CHANNEL,
@@ -42,4 +46,8 @@ bool grpc_channel_stack_type_is_client(grpc_channel_stack_type type);
const char *grpc_channel_stack_type_string(grpc_channel_stack_type type);
-#endif /* GRPC_CORE_LIB_SURFACE_CHANNEL_STACK_TYPE_H */
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* GRPC_CORE_LIB_SURFACE_CHANNEL_STACK_TYPE_H */ \ No newline at end of file
diff --git a/src/core/lib/surface/completion_queue.c b/src/core/lib/surface/completion_queue.cc
index fed66e3a20..453646bd49 100644
--- a/src/core/lib/surface/completion_queue.c
+++ b/src/core/lib/surface/completion_queue.cc
@@ -15,8 +15,11 @@
* limitations under the License.
*
*/
+#include <grpc/support/port_platform.h>
+
#include "src/core/lib/surface/completion_queue.h"
+#include <inttypes.h>
#include <stdio.h>
#include <string.h>
@@ -164,32 +167,15 @@ static void non_polling_poller_shutdown(grpc_exec_ctx *exec_ctx,
static const cq_poller_vtable g_poller_vtable_by_poller_type[] = {
/* GRPC_CQ_DEFAULT_POLLING */
- {.can_get_pollset = true,
- .can_listen = true,
- .size = grpc_pollset_size,
- .init = grpc_pollset_init,
- .kick = grpc_pollset_kick,
- .work = grpc_pollset_work,
- .shutdown = grpc_pollset_shutdown,
- .destroy = grpc_pollset_destroy},
+ {true, true, grpc_pollset_size, grpc_pollset_init, grpc_pollset_kick,
+ grpc_pollset_work, grpc_pollset_shutdown, grpc_pollset_destroy},
/* GRPC_CQ_NON_LISTENING */
- {.can_get_pollset = true,
- .can_listen = false,
- .size = grpc_pollset_size,
- .init = grpc_pollset_init,
- .kick = grpc_pollset_kick,
- .work = grpc_pollset_work,
- .shutdown = grpc_pollset_shutdown,
- .destroy = grpc_pollset_destroy},
+ {true, false, grpc_pollset_size, grpc_pollset_init, grpc_pollset_kick,
+ grpc_pollset_work, grpc_pollset_shutdown, grpc_pollset_destroy},
/* GRPC_CQ_NON_POLLING */
- {.can_get_pollset = false,
- .can_listen = false,
- .size = non_polling_poller_size,
- .init = non_polling_poller_init,
- .kick = non_polling_poller_kick,
- .work = non_polling_poller_work,
- .shutdown = non_polling_poller_shutdown,
- .destroy = non_polling_poller_destroy},
+ {false, false, non_polling_poller_size, non_polling_poller_init,
+ non_polling_poller_kick, non_polling_poller_work,
+ non_polling_poller_shutdown, non_polling_poller_destroy},
};
typedef struct cq_vtable {
@@ -838,13 +824,13 @@ static grpc_event cq_next(grpc_completion_queue *cq, gpr_timespec deadline,
GRPC_CQ_INTERNAL_REF(cq, "next");
cq_is_finished_arg is_finished_arg = {
- .last_seen_things_queued_ever =
- gpr_atm_no_barrier_load(&cqd->things_queued_ever),
- .cq = cq,
- .deadline = deadline,
- .stolen_completion = NULL,
- .tag = NULL,
- .first_loop = true};
+
+ gpr_atm_no_barrier_load(&cqd->things_queued_ever),
+ cq,
+ deadline,
+ NULL,
+ NULL,
+ true};
grpc_exec_ctx exec_ctx =
GRPC_EXEC_CTX_INITIALIZER(0, cq_is_next_finished, &is_finished_arg);
@@ -1080,13 +1066,12 @@ static grpc_event cq_pluck(grpc_completion_queue *cq, void *tag,
GRPC_CQ_INTERNAL_REF(cq, "pluck");
gpr_mu_lock(cq->mu);
cq_is_finished_arg is_finished_arg = {
- .last_seen_things_queued_ever =
- gpr_atm_no_barrier_load(&cqd->things_queued_ever),
- .cq = cq,
- .deadline = deadline,
- .stolen_completion = NULL,
- .tag = tag,
- .first_loop = true};
+ gpr_atm_no_barrier_load(&cqd->things_queued_ever),
+ cq,
+ deadline,
+ NULL,
+ tag,
+ true};
grpc_exec_ctx exec_ctx =
GRPC_EXEC_CTX_INITIALIZER(0, cq_is_pluck_finished, &is_finished_arg);
for (;;) {
diff --git a/src/core/lib/surface/completion_queue_factory.c b/src/core/lib/surface/completion_queue_factory.cc
index aeecff5306..aeecff5306 100644
--- a/src/core/lib/surface/completion_queue_factory.c
+++ b/src/core/lib/surface/completion_queue_factory.cc
diff --git a/src/core/lib/surface/completion_queue_factory.h b/src/core/lib/surface/completion_queue_factory.h
index 89be8f8216..cb0af6f0fb 100644
--- a/src/core/lib/surface/completion_queue_factory.h
+++ b/src/core/lib/surface/completion_queue_factory.h
@@ -22,6 +22,10 @@
#include <grpc/grpc.h>
#include "src/core/lib/surface/completion_queue.h"
+#ifdef __cplusplus
+extern "C" {
+#endif
+
typedef struct grpc_completion_queue_factory_vtable {
grpc_completion_queue* (*create)(const grpc_completion_queue_factory*,
const grpc_completion_queue_attributes*);
@@ -33,4 +37,8 @@ struct grpc_completion_queue_factory {
grpc_completion_queue_factory_vtable* vtable;
};
-#endif /* GRPC_CORE_LIB_SURFACE_COMPLETION_QUEUE_FACTORY_H */
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* GRPC_CORE_LIB_SURFACE_COMPLETION_QUEUE_FACTORY_H */ \ No newline at end of file
diff --git a/src/core/lib/surface/event_string.c b/src/core/lib/surface/event_string.cc
index f236272e2a..f236272e2a 100644
--- a/src/core/lib/surface/event_string.c
+++ b/src/core/lib/surface/event_string.cc
diff --git a/src/core/lib/surface/event_string.h b/src/core/lib/surface/event_string.h
index f00efca7f3..127609c404 100644
--- a/src/core/lib/surface/event_string.h
+++ b/src/core/lib/surface/event_string.h
@@ -21,7 +21,15 @@
#include <grpc/grpc.h>
+#ifdef __cplusplus
+extern "C" {
+#endif
+
/* Returns a string describing an event. Must be later freed with gpr_free() */
char *grpc_event_string(grpc_event *ev);
-#endif /* GRPC_CORE_LIB_SURFACE_EVENT_STRING_H */
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* GRPC_CORE_LIB_SURFACE_EVENT_STRING_H */ \ No newline at end of file
diff --git a/src/core/lib/surface/init.c b/src/core/lib/surface/init.cc
index b089da2c54..b089da2c54 100644
--- a/src/core/lib/surface/init.c
+++ b/src/core/lib/surface/init.cc
diff --git a/src/core/lib/surface/init.h b/src/core/lib/surface/init.h
index 9353208332..b2f48576e5 100644
--- a/src/core/lib/surface/init.h
+++ b/src/core/lib/surface/init.h
@@ -19,9 +19,17 @@
#ifndef GRPC_CORE_LIB_SURFACE_INIT_H
#define GRPC_CORE_LIB_SURFACE_INIT_H
+#ifdef __cplusplus
+extern "C" {
+#endif
+
void grpc_register_security_filters(void);
void grpc_security_pre_init(void);
void grpc_security_init(void);
int grpc_is_initialized(void);
-#endif /* GRPC_CORE_LIB_SURFACE_INIT_H */
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* GRPC_CORE_LIB_SURFACE_INIT_H */ \ No newline at end of file
diff --git a/src/core/lib/surface/init_secure.c b/src/core/lib/surface/init_secure.cc
index 8fbde3d1b4..8fbde3d1b4 100644
--- a/src/core/lib/surface/init_secure.c
+++ b/src/core/lib/surface/init_secure.cc
diff --git a/src/core/lib/surface/init_unsecure.c b/src/core/lib/surface/init_unsecure.cc
index b852cab985..b852cab985 100644
--- a/src/core/lib/surface/init_unsecure.c
+++ b/src/core/lib/surface/init_unsecure.cc
diff --git a/src/core/lib/surface/lame_client.h b/src/core/lib/surface/lame_client.h
index 3ce353f101..2f6f9cd046 100644
--- a/src/core/lib/surface/lame_client.h
+++ b/src/core/lib/surface/lame_client.h
@@ -21,6 +21,14 @@
#include "src/core/lib/channel/channel_stack.h"
+#ifdef __cplusplus
+extern "C" {
+#endif
+
extern const grpc_channel_filter grpc_lame_filter;
+#ifdef __cplusplus
+}
+#endif
+
#endif /* GRPC_CORE_LIB_SURFACE_LAME_CLIENT_H */
diff --git a/src/core/lib/surface/metadata_array.c b/src/core/lib/surface/metadata_array.cc
index 0afb8b4b87..0afb8b4b87 100644
--- a/src/core/lib/surface/metadata_array.c
+++ b/src/core/lib/surface/metadata_array.cc
diff --git a/src/core/lib/surface/server.c b/src/core/lib/surface/server.cc
index 1d0fd472d0..1d0fd472d0 100644
--- a/src/core/lib/surface/server.c
+++ b/src/core/lib/surface/server.cc
diff --git a/src/core/lib/surface/server.h b/src/core/lib/surface/server.h
index dd5639d97a..1114715833 100644
--- a/src/core/lib/surface/server.h
+++ b/src/core/lib/surface/server.h
@@ -24,6 +24,10 @@
#include "src/core/lib/debug/trace.h"
#include "src/core/lib/transport/transport.h"
+#ifdef __cplusplus
+extern "C" {
+#endif
+
extern const grpc_channel_filter grpc_server_top_filter;
/** Lightweight tracing of server channel state */
@@ -54,4 +58,8 @@ int grpc_server_has_open_connections(grpc_server *server);
void grpc_server_get_pollsets(grpc_server *server, grpc_pollset ***pollsets,
size_t *pollset_count);
-#endif /* GRPC_CORE_LIB_SURFACE_SERVER_H */
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* GRPC_CORE_LIB_SURFACE_SERVER_H */ \ No newline at end of file
diff --git a/src/core/lib/surface/validate_metadata.c b/src/core/lib/surface/validate_metadata.cc
index 61209ae48d..81d07fae44 100644
--- a/src/core/lib/surface/validate_metadata.c
+++ b/src/core/lib/surface/validate_metadata.cc
@@ -26,6 +26,7 @@
#include "src/core/lib/iomgr/error.h"
#include "src/core/lib/slice/slice_internal.h"
#include "src/core/lib/slice/slice_string_helpers.h"
+#include "src/core/lib/surface/validate_metadata.h"
static grpc_error *conforms_to(grpc_slice slice, const uint8_t *legal_bits,
const char *err_desc) {
diff --git a/src/core/lib/surface/validate_metadata.h b/src/core/lib/surface/validate_metadata.h
index de869d89b4..aa02419d9f 100644
--- a/src/core/lib/surface/validate_metadata.h
+++ b/src/core/lib/surface/validate_metadata.h
@@ -22,7 +22,15 @@
#include <grpc/slice.h>
#include "src/core/lib/iomgr/error.h"
+#ifdef __cplusplus
+extern "C" {
+#endif
+
grpc_error *grpc_validate_header_key_is_legal(grpc_slice slice);
grpc_error *grpc_validate_header_nonbin_value_is_legal(grpc_slice slice);
-#endif /* GRPC_CORE_LIB_SURFACE_VALIDATE_METADATA_H */
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* GRPC_CORE_LIB_SURFACE_VALIDATE_METADATA_H */ \ No newline at end of file
diff --git a/src/core/lib/surface/version.c b/src/core/lib/surface/version.cc
index 6cb8e7e1a0..6cb8e7e1a0 100644
--- a/src/core/lib/surface/version.c
+++ b/src/core/lib/surface/version.cc
diff --git a/src/core/lib/transport/bdp_estimator.c b/src/core/lib/transport/bdp_estimator.cc
index 8b57693413..e7fa0eefe8 100644
--- a/src/core/lib/transport/bdp_estimator.c
+++ b/src/core/lib/transport/bdp_estimator.cc
@@ -18,6 +18,7 @@
#include "src/core/lib/transport/bdp_estimator.h"
+#include <inttypes.h>
#include <stdlib.h>
#include <grpc/support/log.h>
diff --git a/src/core/lib/transport/bdp_estimator.h b/src/core/lib/transport/bdp_estimator.h
index 1ef0dc99dd..21c27ec6af 100644
--- a/src/core/lib/transport/bdp_estimator.h
+++ b/src/core/lib/transport/bdp_estimator.h
@@ -27,6 +27,10 @@
#define GRPC_BDP_SAMPLES 16
#define GRPC_BDP_MIN_SAMPLES_FOR_ESTIMATE 3
+#ifdef __cplusplus
+extern "C" {
+#endif
+
extern grpc_tracer_flag grpc_bdp_estimator_trace;
typedef enum {
@@ -66,4 +70,8 @@ void grpc_bdp_estimator_start_ping(grpc_bdp_estimator *estimator);
// Completes a previously started ping
void grpc_bdp_estimator_complete_ping(grpc_bdp_estimator *estimator);
-#endif /* GRPC_CORE_LIB_TRANSPORT_BDP_ESTIMATOR_H */
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* GRPC_CORE_LIB_TRANSPORT_BDP_ESTIMATOR_H */ \ No newline at end of file
diff --git a/src/core/lib/transport/byte_stream.c b/src/core/lib/transport/byte_stream.cc
index 08f61629a9..08f61629a9 100644
--- a/src/core/lib/transport/byte_stream.c
+++ b/src/core/lib/transport/byte_stream.cc
diff --git a/src/core/lib/transport/byte_stream.h b/src/core/lib/transport/byte_stream.h
index be2a35213e..d3e04df5c0 100644
--- a/src/core/lib/transport/byte_stream.h
+++ b/src/core/lib/transport/byte_stream.h
@@ -28,6 +28,10 @@
/** Mask of all valid internal flags. */
#define GRPC_WRITE_INTERNAL_USED_MASK (GRPC_WRITE_INTERNAL_COMPRESS)
+#ifdef __cplusplus
+extern "C" {
+#endif
+
typedef struct grpc_byte_stream grpc_byte_stream;
typedef struct {
@@ -135,4 +139,8 @@ void grpc_caching_byte_stream_init(grpc_caching_byte_stream *stream,
// Resets the byte stream to the start of the underlying stream.
void grpc_caching_byte_stream_reset(grpc_caching_byte_stream *stream);
-#endif /* GRPC_CORE_LIB_TRANSPORT_BYTE_STREAM_H */
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* GRPC_CORE_LIB_TRANSPORT_BYTE_STREAM_H */ \ No newline at end of file
diff --git a/src/core/lib/transport/connectivity_state.c b/src/core/lib/transport/connectivity_state.cc
index f328a6cdbb..f328a6cdbb 100644
--- a/src/core/lib/transport/connectivity_state.c
+++ b/src/core/lib/transport/connectivity_state.cc
diff --git a/src/core/lib/transport/connectivity_state.h b/src/core/lib/transport/connectivity_state.h
index 2fece6cc21..1796a540a7 100644
--- a/src/core/lib/transport/connectivity_state.h
+++ b/src/core/lib/transport/connectivity_state.h
@@ -23,6 +23,10 @@
#include "src/core/lib/debug/trace.h"
#include "src/core/lib/iomgr/exec_ctx.h"
+#ifdef __cplusplus
+extern "C" {
+#endif
+
typedef struct grpc_connectivity_state_watcher {
/** we keep watchers in a linked list */
struct grpc_connectivity_state_watcher *next;
@@ -84,4 +88,8 @@ bool grpc_connectivity_state_notify_on_state_change(
grpc_exec_ctx *exec_ctx, grpc_connectivity_state_tracker *tracker,
grpc_connectivity_state *current, grpc_closure *notify);
-#endif /* GRPC_CORE_LIB_TRANSPORT_CONNECTIVITY_STATE_H */
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* GRPC_CORE_LIB_TRANSPORT_CONNECTIVITY_STATE_H */ \ No newline at end of file
diff --git a/src/core/lib/transport/error_utils.c b/src/core/lib/transport/error_utils.cc
index 5e3920b627..5e3920b627 100644
--- a/src/core/lib/transport/error_utils.c
+++ b/src/core/lib/transport/error_utils.cc
diff --git a/src/core/lib/transport/error_utils.h b/src/core/lib/transport/error_utils.h
index e530884215..18ff54839c 100644
--- a/src/core/lib/transport/error_utils.h
+++ b/src/core/lib/transport/error_utils.h
@@ -22,6 +22,10 @@
#include "src/core/lib/iomgr/error.h"
#include "src/core/lib/transport/http2_errors.h"
+#ifdef __cplusplus
+extern "C" {
+#endif
+
/// A utility function to get the status code and message to be returned
/// to the application. If not set in the top-level message, looks
/// through child errors until it finds the first one with these attributes.
@@ -38,4 +42,8 @@ void grpc_error_get_status(grpc_error *error, gpr_timespec deadline,
/// GRPC_ERROR_CANCELLED
bool grpc_error_has_clear_grpc_status(grpc_error *error);
-#endif /* GRPC_CORE_LIB_TRANSPORT_ERROR_UTILS_H */
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* GRPC_CORE_LIB_TRANSPORT_ERROR_UTILS_H */ \ No newline at end of file
diff --git a/src/core/lib/transport/metadata.c b/src/core/lib/transport/metadata.cc
index 188b485625..5455b2481b 100644
--- a/src/core/lib/transport/metadata.c
+++ b/src/core/lib/transport/metadata.cc
@@ -19,6 +19,7 @@
#include "src/core/lib/transport/metadata.h"
#include <assert.h>
+#include <inttypes.h>
#include <stddef.h>
#include <string.h>
diff --git a/src/core/lib/transport/metadata.h b/src/core/lib/transport/metadata.h
index 974469e436..9f82225dc3 100644
--- a/src/core/lib/transport/metadata.h
+++ b/src/core/lib/transport/metadata.h
@@ -102,8 +102,13 @@ struct grpc_mdelem {
((grpc_mdelem_data *)((md).payload & ~(uintptr_t)3))
#define GRPC_MDELEM_STORAGE(md) \
((grpc_mdelem_data_storage)((md).payload & (uintptr_t)3))
+#ifdef __cplusplus
+#define GRPC_MAKE_MDELEM(data, storage) \
+ (grpc_mdelem{((uintptr_t)(data)) | ((uintptr_t)storage)})
+#else
#define GRPC_MAKE_MDELEM(data, storage) \
((grpc_mdelem){((uintptr_t)(data)) | ((uintptr_t)storage)})
+#endif
#define GRPC_MDELEM_IS_INTERNED(md) \
((grpc_mdelem_data_storage)((md).payload & \
(uintptr_t)GRPC_MDELEM_STORAGE_INTERNED_BIT))
diff --git a/src/core/lib/transport/metadata_batch.c b/src/core/lib/transport/metadata_batch.cc
index 54388bdcda..54388bdcda 100644
--- a/src/core/lib/transport/metadata_batch.c
+++ b/src/core/lib/transport/metadata_batch.cc
diff --git a/src/core/lib/transport/metadata_batch.h b/src/core/lib/transport/metadata_batch.h
index 57d298c75c..63f30a78d1 100644
--- a/src/core/lib/transport/metadata_batch.h
+++ b/src/core/lib/transport/metadata_batch.h
@@ -125,10 +125,11 @@ typedef struct {
} grpc_filtered_mdelem;
#define GRPC_FILTERED_ERROR(error) \
- ((grpc_filtered_mdelem){(error), GRPC_MDNULL})
-#define GRPC_FILTERED_MDELEM(md) ((grpc_filtered_mdelem){GRPC_ERROR_NONE, (md)})
+ { (error), GRPC_MDNULL }
+#define GRPC_FILTERED_MDELEM(md) \
+ { GRPC_ERROR_NONE, (md) }
#define GRPC_FILTERED_REMOVE() \
- ((grpc_filtered_mdelem){GRPC_ERROR_NONE, GRPC_MDNULL})
+ { GRPC_ERROR_NONE, GRPC_MDNULL }
typedef grpc_filtered_mdelem (*grpc_metadata_batch_filter_func)(
grpc_exec_ctx *exec_ctx, void *user_data, grpc_mdelem elem);
diff --git a/src/core/lib/transport/pid_controller.c b/src/core/lib/transport/pid_controller.cc
index 4b304f17b2..4b304f17b2 100644
--- a/src/core/lib/transport/pid_controller.c
+++ b/src/core/lib/transport/pid_controller.cc
diff --git a/src/core/lib/transport/pid_controller.h b/src/core/lib/transport/pid_controller.h
index 9352b2643f..17feabfd39 100644
--- a/src/core/lib/transport/pid_controller.h
+++ b/src/core/lib/transport/pid_controller.h
@@ -19,6 +19,10 @@
#ifndef GRPC_CORE_LIB_TRANSPORT_PID_CONTROLLER_H
#define GRPC_CORE_LIB_TRANSPORT_PID_CONTROLLER_H
+#ifdef __cplusplus
+extern "C" {
+#endif
+
/* \file Simple PID controller.
Implements a proportional-integral-derivative controller.
Used when we want to iteratively control a variable to converge some other
@@ -59,4 +63,8 @@ double grpc_pid_controller_update(grpc_pid_controller *pid_controller,
/** Returns the last control value calculated */
double grpc_pid_controller_last(grpc_pid_controller *pid_controller);
-#endif /* GRPC_CORE_LIB_TRANSPORT_PID_CONTROLLER_H */
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* GRPC_CORE_LIB_TRANSPORT_PID_CONTROLLER_H */ \ No newline at end of file
diff --git a/src/core/lib/transport/service_config.c b/src/core/lib/transport/service_config.cc
index 070a13a2b4..070a13a2b4 100644
--- a/src/core/lib/transport/service_config.c
+++ b/src/core/lib/transport/service_config.cc
diff --git a/src/core/lib/transport/service_config.h b/src/core/lib/transport/service_config.h
index 84110abc36..c485f52472 100644
--- a/src/core/lib/transport/service_config.h
+++ b/src/core/lib/transport/service_config.h
@@ -22,6 +22,10 @@
#include "src/core/lib/json/json.h"
#include "src/core/lib/slice/slice_hash_table.h"
+#ifdef __cplusplus
+extern "C" {
+#endif
+
typedef struct grpc_service_config grpc_service_config;
grpc_service_config* grpc_service_config_create(const char* json_string);
@@ -59,4 +63,8 @@ void* grpc_method_config_table_get(grpc_exec_ctx* exec_ctx,
const grpc_slice_hash_table* table,
grpc_slice path);
-#endif /* GRPC_CORE_LIB_TRANSPORT_SERVICE_CONFIG_H */
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* GRPC_CORE_LIB_TRANSPORT_SERVICE_CONFIG_H */ \ No newline at end of file
diff --git a/src/core/lib/transport/static_metadata.c b/src/core/lib/transport/static_metadata.cc
index 472cf888ea..472cf888ea 100644
--- a/src/core/lib/transport/static_metadata.c
+++ b/src/core/lib/transport/static_metadata.cc
diff --git a/src/core/lib/transport/static_metadata.h b/src/core/lib/transport/static_metadata.h
index f03a9d23b1..299410f22c 100644
--- a/src/core/lib/transport/static_metadata.h
+++ b/src/core/lib/transport/static_metadata.h
@@ -27,6 +27,10 @@
#ifndef GRPC_CORE_LIB_TRANSPORT_STATIC_METADATA_H
#define GRPC_CORE_LIB_TRANSPORT_STATIC_METADATA_H
+#ifdef __cplusplus
+extern "C" {
+#endif
+
#include "src/core/lib/transport/metadata.h"
#define GRPC_STATIC_MDSTR_COUNT 100
@@ -584,4 +588,7 @@ extern const uint8_t grpc_static_accept_stream_encoding_metadata[4];
(GRPC_MAKE_MDELEM(&grpc_static_mdelem_table \
[grpc_static_accept_stream_encoding_metadata[(algs)]], \
GRPC_MDELEM_STORAGE_STATIC))
+#ifdef __cplusplus
+}
+#endif
#endif /* GRPC_CORE_LIB_TRANSPORT_STATIC_METADATA_H */
diff --git a/src/core/lib/transport/status_conversion.c b/src/core/lib/transport/status_conversion.cc
index a40d333284..a40d333284 100644
--- a/src/core/lib/transport/status_conversion.c
+++ b/src/core/lib/transport/status_conversion.cc
diff --git a/src/core/lib/transport/status_conversion.h b/src/core/lib/transport/status_conversion.h
index e93f3dfd9b..b257998e4d 100644
--- a/src/core/lib/transport/status_conversion.h
+++ b/src/core/lib/transport/status_conversion.h
@@ -22,6 +22,10 @@
#include <grpc/grpc.h>
#include "src/core/lib/transport/http2_errors.h"
+#ifdef __cplusplus
+extern "C" {
+#endif
+
/* Conversion of grpc status codes to http2 error codes (for RST_STREAM) */
grpc_http2_error_code grpc_status_to_http2_error(grpc_status_code status);
grpc_status_code grpc_http2_error_to_grpc_status(grpc_http2_error_code error,
@@ -31,4 +35,8 @@ grpc_status_code grpc_http2_error_to_grpc_status(grpc_http2_error_code error,
grpc_status_code grpc_http2_status_to_grpc_status(int status);
int grpc_status_to_http2_status(grpc_status_code status);
-#endif /* GRPC_CORE_LIB_TRANSPORT_STATUS_CONVERSION_H */
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* GRPC_CORE_LIB_TRANSPORT_STATUS_CONVERSION_H */ \ No newline at end of file
diff --git a/src/core/lib/transport/timeout_encoding.c b/src/core/lib/transport/timeout_encoding.cc
index 02f179d6a3..02f179d6a3 100644
--- a/src/core/lib/transport/timeout_encoding.c
+++ b/src/core/lib/transport/timeout_encoding.cc
diff --git a/src/core/lib/transport/timeout_encoding.h b/src/core/lib/transport/timeout_encoding.h
index 7ff35c4083..1f4e206f8a 100644
--- a/src/core/lib/transport/timeout_encoding.h
+++ b/src/core/lib/transport/timeout_encoding.h
@@ -26,9 +26,17 @@
#define GRPC_HTTP2_TIMEOUT_ENCODE_MIN_BUFSIZE (GPR_LTOA_MIN_BUFSIZE + 1)
+#ifdef __cplusplus
+extern "C" {
+#endif
+
/* Encode/decode timeouts to the GRPC over HTTP/2 format;
encoding may round up arbitrarily */
void grpc_http2_encode_timeout(gpr_timespec timeout, char *buffer);
int grpc_http2_decode_timeout(grpc_slice text, gpr_timespec *timeout);
-#endif /* GRPC_CORE_LIB_TRANSPORT_TIMEOUT_ENCODING_H */
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* GRPC_CORE_LIB_TRANSPORT_TIMEOUT_ENCODING_H */ \ No newline at end of file
diff --git a/src/core/lib/transport/transport.c b/src/core/lib/transport/transport.cc
index 682a820b48..ab4f938e7b 100644
--- a/src/core/lib/transport/transport.c
+++ b/src/core/lib/transport/transport.cc
@@ -110,10 +110,11 @@ grpc_slice grpc_slice_from_stream_owned_buffer(grpc_stream_refcount *refcount,
}
static const grpc_slice_refcount_vtable stream_ref_slice_vtable = {
- .ref = slice_stream_ref,
- .unref = slice_stream_unref,
- .eq = grpc_slice_default_eq_impl,
- .hash = grpc_slice_default_hash_impl};
+ slice_stream_ref, /* ref */
+ slice_stream_unref, /* unref */
+ grpc_slice_default_eq_impl, /* eq */
+ grpc_slice_default_hash_impl /* hash */
+};
#ifndef NDEBUG
void grpc_stream_ref_init(grpc_stream_refcount *refcount, int initial_refs,
diff --git a/src/core/lib/transport/transport_impl.h b/src/core/lib/transport/transport_impl.h
index bbae69c223..41d34d3954 100644
--- a/src/core/lib/transport/transport_impl.h
+++ b/src/core/lib/transport/transport_impl.h
@@ -21,6 +21,10 @@
#include "src/core/lib/transport/transport.h"
+#ifdef __cplusplus
+extern "C" {
+#endif
+
typedef struct grpc_transport_vtable {
/* Memory required for a single stream element - this is allocated by upper
layers and initialized by the transport */
@@ -69,4 +73,8 @@ struct grpc_transport {
const grpc_transport_vtable *vtable;
};
-#endif /* GRPC_CORE_LIB_TRANSPORT_TRANSPORT_IMPL_H */
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* GRPC_CORE_LIB_TRANSPORT_TRANSPORT_IMPL_H */ \ No newline at end of file
diff --git a/src/core/lib/transport/transport_op_string.c b/src/core/lib/transport/transport_op_string.cc
index 858664715c..87fdf72e29 100644
--- a/src/core/lib/transport/transport_op_string.c
+++ b/src/core/lib/transport/transport_op_string.cc
@@ -16,8 +16,11 @@
*
*/
+#include <grpc/support/port_platform.h>
+
#include "src/core/lib/channel/channel_stack.h"
+#include <inttypes.h>
#include <stdarg.h>
#include <stdio.h>
#include <string.h>
diff --git a/src/core/plugin_registry/grpc_cronet_plugin_registry.c b/src/core/plugin_registry/grpc_cronet_plugin_registry.cc
index 1c09f54ad9..e0422f6750 100644
--- a/src/core/plugin_registry/grpc_cronet_plugin_registry.c
+++ b/src/core/plugin_registry/grpc_cronet_plugin_registry.cc
@@ -18,18 +18,18 @@
#include <grpc/grpc.h>
-extern void grpc_http_filters_init(void);
-extern void grpc_http_filters_shutdown(void);
-extern void grpc_chttp2_plugin_init(void);
-extern void grpc_chttp2_plugin_shutdown(void);
-extern void grpc_deadline_filter_init(void);
-extern void grpc_deadline_filter_shutdown(void);
-extern void grpc_client_channel_init(void);
-extern void grpc_client_channel_shutdown(void);
-extern void grpc_tsi_gts_init(void);
-extern void grpc_tsi_gts_shutdown(void);
-extern void grpc_server_load_reporting_plugin_init(void);
-extern void grpc_server_load_reporting_plugin_shutdown(void);
+extern "C" void grpc_http_filters_init(void);
+extern "C" void grpc_http_filters_shutdown(void);
+extern "C" void grpc_chttp2_plugin_init(void);
+extern "C" void grpc_chttp2_plugin_shutdown(void);
+extern "C" void grpc_deadline_filter_init(void);
+extern "C" void grpc_deadline_filter_shutdown(void);
+extern "C" void grpc_client_channel_init(void);
+extern "C" void grpc_client_channel_shutdown(void);
+extern "C" void grpc_tsi_gts_init(void);
+extern "C" void grpc_tsi_gts_shutdown(void);
+extern "C" void grpc_server_load_reporting_plugin_init(void);
+extern "C" void grpc_server_load_reporting_plugin_shutdown(void);
void grpc_register_built_in_plugins(void) {
grpc_register_plugin(grpc_http_filters_init,
diff --git a/src/core/plugin_registry/grpc_plugin_registry.c b/src/core/plugin_registry/grpc_plugin_registry.cc
index 9cacf3d306..2d332e2b91 100644
--- a/src/core/plugin_registry/grpc_plugin_registry.c
+++ b/src/core/plugin_registry/grpc_plugin_registry.cc
@@ -18,42 +18,42 @@
#include <grpc/grpc.h>
-extern void grpc_http_filters_init(void);
-extern void grpc_http_filters_shutdown(void);
-extern void grpc_chttp2_plugin_init(void);
-extern void grpc_chttp2_plugin_shutdown(void);
-extern void grpc_tsi_gts_init(void);
-extern void grpc_tsi_gts_shutdown(void);
-extern void grpc_deadline_filter_init(void);
-extern void grpc_deadline_filter_shutdown(void);
-extern void grpc_client_channel_init(void);
-extern void grpc_client_channel_shutdown(void);
-extern void grpc_inproc_plugin_init(void);
-extern void grpc_inproc_plugin_shutdown(void);
-extern void grpc_resolver_fake_init(void);
-extern void grpc_resolver_fake_shutdown(void);
-extern void grpc_lb_policy_grpclb_init(void);
-extern void grpc_lb_policy_grpclb_shutdown(void);
-extern void grpc_lb_policy_pick_first_init(void);
-extern void grpc_lb_policy_pick_first_shutdown(void);
-extern void grpc_lb_policy_round_robin_init(void);
-extern void grpc_lb_policy_round_robin_shutdown(void);
-extern void grpc_resolver_dns_ares_init(void);
-extern void grpc_resolver_dns_ares_shutdown(void);
-extern void grpc_resolver_dns_native_init(void);
-extern void grpc_resolver_dns_native_shutdown(void);
-extern void grpc_resolver_sockaddr_init(void);
-extern void grpc_resolver_sockaddr_shutdown(void);
-extern void grpc_server_load_reporting_plugin_init(void);
-extern void grpc_server_load_reporting_plugin_shutdown(void);
-extern void census_grpc_plugin_init(void);
-extern void census_grpc_plugin_shutdown(void);
-extern void grpc_max_age_filter_init(void);
-extern void grpc_max_age_filter_shutdown(void);
-extern void grpc_message_size_filter_init(void);
-extern void grpc_message_size_filter_shutdown(void);
-extern void grpc_workaround_cronet_compression_filter_init(void);
-extern void grpc_workaround_cronet_compression_filter_shutdown(void);
+extern "C" void grpc_http_filters_init(void);
+extern "C" void grpc_http_filters_shutdown(void);
+extern "C" void grpc_chttp2_plugin_init(void);
+extern "C" void grpc_chttp2_plugin_shutdown(void);
+extern "C" void grpc_tsi_gts_init(void);
+extern "C" void grpc_tsi_gts_shutdown(void);
+extern "C" void grpc_deadline_filter_init(void);
+extern "C" void grpc_deadline_filter_shutdown(void);
+extern "C" void grpc_client_channel_init(void);
+extern "C" void grpc_client_channel_shutdown(void);
+extern "C" void grpc_inproc_plugin_init(void);
+extern "C" void grpc_inproc_plugin_shutdown(void);
+extern "C" void grpc_resolver_fake_init(void);
+extern "C" void grpc_resolver_fake_shutdown(void);
+extern "C" void grpc_lb_policy_grpclb_init(void);
+extern "C" void grpc_lb_policy_grpclb_shutdown(void);
+extern "C" void grpc_lb_policy_pick_first_init(void);
+extern "C" void grpc_lb_policy_pick_first_shutdown(void);
+extern "C" void grpc_lb_policy_round_robin_init(void);
+extern "C" void grpc_lb_policy_round_robin_shutdown(void);
+extern "C" void grpc_resolver_dns_ares_init(void);
+extern "C" void grpc_resolver_dns_ares_shutdown(void);
+extern "C" void grpc_resolver_dns_native_init(void);
+extern "C" void grpc_resolver_dns_native_shutdown(void);
+extern "C" void grpc_resolver_sockaddr_init(void);
+extern "C" void grpc_resolver_sockaddr_shutdown(void);
+extern "C" void grpc_server_load_reporting_plugin_init(void);
+extern "C" void grpc_server_load_reporting_plugin_shutdown(void);
+extern "C" void census_grpc_plugin_init(void);
+extern "C" void census_grpc_plugin_shutdown(void);
+extern "C" void grpc_max_age_filter_init(void);
+extern "C" void grpc_max_age_filter_shutdown(void);
+extern "C" void grpc_message_size_filter_init(void);
+extern "C" void grpc_message_size_filter_shutdown(void);
+extern "C" void grpc_workaround_cronet_compression_filter_init(void);
+extern "C" void grpc_workaround_cronet_compression_filter_shutdown(void);
void grpc_register_built_in_plugins(void) {
grpc_register_plugin(grpc_http_filters_init,
diff --git a/src/core/plugin_registry/grpc_unsecure_plugin_registry.c b/src/core/plugin_registry/grpc_unsecure_plugin_registry.cc
index 7b90d796d5..78218582f0 100644
--- a/src/core/plugin_registry/grpc_unsecure_plugin_registry.c
+++ b/src/core/plugin_registry/grpc_unsecure_plugin_registry.cc
@@ -18,40 +18,40 @@
#include <grpc/grpc.h>
-extern void grpc_http_filters_init(void);
-extern void grpc_http_filters_shutdown(void);
-extern void grpc_chttp2_plugin_init(void);
-extern void grpc_chttp2_plugin_shutdown(void);
-extern void grpc_deadline_filter_init(void);
-extern void grpc_deadline_filter_shutdown(void);
-extern void grpc_client_channel_init(void);
-extern void grpc_client_channel_shutdown(void);
-extern void grpc_inproc_plugin_init(void);
-extern void grpc_inproc_plugin_shutdown(void);
-extern void grpc_resolver_dns_ares_init(void);
-extern void grpc_resolver_dns_ares_shutdown(void);
-extern void grpc_resolver_dns_native_init(void);
-extern void grpc_resolver_dns_native_shutdown(void);
-extern void grpc_resolver_sockaddr_init(void);
-extern void grpc_resolver_sockaddr_shutdown(void);
-extern void grpc_resolver_fake_init(void);
-extern void grpc_resolver_fake_shutdown(void);
-extern void grpc_server_load_reporting_plugin_init(void);
-extern void grpc_server_load_reporting_plugin_shutdown(void);
-extern void grpc_lb_policy_grpclb_init(void);
-extern void grpc_lb_policy_grpclb_shutdown(void);
-extern void grpc_lb_policy_pick_first_init(void);
-extern void grpc_lb_policy_pick_first_shutdown(void);
-extern void grpc_lb_policy_round_robin_init(void);
-extern void grpc_lb_policy_round_robin_shutdown(void);
-extern void census_grpc_plugin_init(void);
-extern void census_grpc_plugin_shutdown(void);
-extern void grpc_max_age_filter_init(void);
-extern void grpc_max_age_filter_shutdown(void);
-extern void grpc_message_size_filter_init(void);
-extern void grpc_message_size_filter_shutdown(void);
-extern void grpc_workaround_cronet_compression_filter_init(void);
-extern void grpc_workaround_cronet_compression_filter_shutdown(void);
+extern "C" void grpc_http_filters_init(void);
+extern "C" void grpc_http_filters_shutdown(void);
+extern "C" void grpc_chttp2_plugin_init(void);
+extern "C" void grpc_chttp2_plugin_shutdown(void);
+extern "C" void grpc_deadline_filter_init(void);
+extern "C" void grpc_deadline_filter_shutdown(void);
+extern "C" void grpc_client_channel_init(void);
+extern "C" void grpc_client_channel_shutdown(void);
+extern "C" void grpc_inproc_plugin_init(void);
+extern "C" void grpc_inproc_plugin_shutdown(void);
+extern "C" void grpc_resolver_dns_ares_init(void);
+extern "C" void grpc_resolver_dns_ares_shutdown(void);
+extern "C" void grpc_resolver_dns_native_init(void);
+extern "C" void grpc_resolver_dns_native_shutdown(void);
+extern "C" void grpc_resolver_sockaddr_init(void);
+extern "C" void grpc_resolver_sockaddr_shutdown(void);
+extern "C" void grpc_resolver_fake_init(void);
+extern "C" void grpc_resolver_fake_shutdown(void);
+extern "C" void grpc_server_load_reporting_plugin_init(void);
+extern "C" void grpc_server_load_reporting_plugin_shutdown(void);
+extern "C" void grpc_lb_policy_grpclb_init(void);
+extern "C" void grpc_lb_policy_grpclb_shutdown(void);
+extern "C" void grpc_lb_policy_pick_first_init(void);
+extern "C" void grpc_lb_policy_pick_first_shutdown(void);
+extern "C" void grpc_lb_policy_round_robin_init(void);
+extern "C" void grpc_lb_policy_round_robin_shutdown(void);
+extern "C" void census_grpc_plugin_init(void);
+extern "C" void census_grpc_plugin_shutdown(void);
+extern "C" void grpc_max_age_filter_init(void);
+extern "C" void grpc_max_age_filter_shutdown(void);
+extern "C" void grpc_message_size_filter_init(void);
+extern "C" void grpc_message_size_filter_shutdown(void);
+extern "C" void grpc_workaround_cronet_compression_filter_init(void);
+extern "C" void grpc_workaround_cronet_compression_filter_shutdown(void);
void grpc_register_built_in_plugins(void) {
grpc_register_plugin(grpc_http_filters_init,
diff --git a/src/core/tsi/fake_transport_security.c b/src/core/tsi/fake_transport_security.cc
index 64043fea08..349dcf5cb8 100644
--- a/src/core/tsi/fake_transport_security.c
+++ b/src/core/tsi/fake_transport_security.cc
@@ -98,11 +98,10 @@ static const char *tsi_fake_handshake_message_to_string(int msg) {
static tsi_result tsi_fake_handshake_message_from_string(
const char *msg_string, tsi_fake_handshake_message *msg) {
- tsi_fake_handshake_message i;
- for (i = 0; i < TSI_FAKE_HANDSHAKE_MESSAGE_MAX; i++) {
+ for (int i = 0; i < TSI_FAKE_HANDSHAKE_MESSAGE_MAX; i++) {
if (strncmp(msg_string, tsi_fake_handshake_message_strings[i],
strlen(tsi_fake_handshake_message_strings[i])) == 0) {
- *msg = i;
+ *msg = (tsi_fake_handshake_message)i;
return TSI_OK;
}
}
@@ -155,9 +154,10 @@ static void tsi_fake_frame_reset(tsi_fake_frame *frame, int needs_draining) {
static void tsi_fake_frame_ensure_size(tsi_fake_frame *frame) {
if (frame->data == NULL) {
frame->allocated_size = frame->size;
- frame->data = gpr_malloc(frame->allocated_size);
+ frame->data = (unsigned char *)gpr_malloc(frame->allocated_size);
} else if (frame->size > frame->allocated_size) {
- unsigned char *new_data = gpr_realloc(frame->data, frame->size);
+ unsigned char *new_data =
+ (unsigned char *)gpr_realloc(frame->data, frame->size);
frame->data = new_data;
frame->allocated_size = frame->size;
}
@@ -176,7 +176,7 @@ static tsi_result tsi_fake_frame_decode(const unsigned char *incoming_bytes,
if (frame->needs_draining) return TSI_INTERNAL_ERROR;
if (frame->data == NULL) {
frame->allocated_size = TSI_FAKE_FRAME_INITIAL_ALLOCATED_SIZE;
- frame->data = gpr_malloc(frame->allocated_size);
+ frame->data = (unsigned char *)gpr_malloc(frame->allocated_size);
}
if (frame->offset < TSI_FAKE_FRAME_HEADER_SIZE) {
@@ -538,10 +538,11 @@ static tsi_result fake_handshaker_result_create(
handshaker_result == NULL) {
return TSI_INVALID_ARGUMENT;
}
- fake_handshaker_result *result = gpr_zalloc(sizeof(*result));
+ fake_handshaker_result *result =
+ (fake_handshaker_result *)gpr_zalloc(sizeof(*result));
result->base.vtable = &handshaker_result_vtable;
if (unused_bytes_size > 0) {
- result->unused_bytes = gpr_malloc(unused_bytes_size);
+ result->unused_bytes = (unsigned char *)gpr_malloc(unused_bytes_size);
memcpy(result->unused_bytes, unused_bytes, unused_bytes_size);
}
result->unused_bytes_size = unused_bytes_size;
@@ -561,7 +562,7 @@ static tsi_result fake_handshaker_get_bytes_to_send_to_peer(
}
if (!impl->outgoing_frame.needs_draining) {
tsi_fake_handshake_message next_message_to_send =
- impl->next_message_to_send + 2;
+ (tsi_fake_handshake_message)(impl->next_message_to_send + 2);
const char *msg_string =
tsi_fake_handshake_message_to_string(impl->next_message_to_send);
result = tsi_fake_frame_set_data((unsigned char *)msg_string,
@@ -596,7 +597,8 @@ static tsi_result fake_handshaker_process_bytes_from_peer(
tsi_handshaker *self, const unsigned char *bytes, size_t *bytes_size) {
tsi_result result = TSI_OK;
tsi_fake_handshaker *impl = (tsi_fake_handshaker *)self;
- tsi_fake_handshake_message expected_msg = impl->next_message_to_send - 1;
+ tsi_fake_handshake_message expected_msg =
+ (tsi_fake_handshake_message)(impl->next_message_to_send - 1);
tsi_fake_handshake_message received_msg;
if (!impl->needs_incoming_message || impl->result == TSI_OK) {
@@ -681,8 +683,8 @@ static tsi_result fake_handshaker_next(
if (result == TSI_INCOMPLETE_DATA) {
handshaker->outgoing_bytes_buffer_size *= 2;
handshaker->outgoing_bytes_buffer =
- gpr_realloc(handshaker->outgoing_bytes_buffer,
- handshaker->outgoing_bytes_buffer_size);
+ (unsigned char *)gpr_realloc(handshaker->outgoing_bytes_buffer,
+ handshaker->outgoing_bytes_buffer_size);
}
} while (result == TSI_INCOMPLETE_DATA);
if (result != TSI_OK) return result;
@@ -723,13 +725,14 @@ static const tsi_handshaker_vtable handshaker_vtable = {
};
tsi_handshaker *tsi_create_fake_handshaker(int is_client) {
- tsi_fake_handshaker *impl = gpr_zalloc(sizeof(*impl));
+ tsi_fake_handshaker *impl = (tsi_fake_handshaker *)gpr_zalloc(sizeof(*impl));
impl->base.vtable = &handshaker_vtable;
impl->is_client = is_client;
impl->result = TSI_HANDSHAKE_IN_PROGRESS;
impl->outgoing_bytes_buffer_size =
TSI_FAKE_HANDSHAKER_OUTGOING_BUFFER_INITIAL_SIZE;
- impl->outgoing_bytes_buffer = gpr_malloc(impl->outgoing_bytes_buffer_size);
+ impl->outgoing_bytes_buffer =
+ (unsigned char *)gpr_malloc(impl->outgoing_bytes_buffer_size);
if (is_client) {
impl->needs_incoming_message = 0;
impl->next_message_to_send = TSI_FAKE_CLIENT_INIT;
@@ -742,7 +745,8 @@ tsi_handshaker *tsi_create_fake_handshaker(int is_client) {
tsi_frame_protector *tsi_create_fake_frame_protector(
size_t *max_protected_frame_size) {
- tsi_fake_frame_protector *impl = gpr_zalloc(sizeof(*impl));
+ tsi_fake_frame_protector *impl =
+ (tsi_fake_frame_protector *)gpr_zalloc(sizeof(*impl));
impl->max_frame_size = (max_protected_frame_size == NULL)
? TSI_FAKE_DEFAULT_FRAME_SIZE
: *max_protected_frame_size;
@@ -752,7 +756,8 @@ tsi_frame_protector *tsi_create_fake_frame_protector(
tsi_zero_copy_grpc_protector *tsi_create_fake_zero_copy_grpc_protector(
size_t *max_protected_frame_size) {
- tsi_fake_zero_copy_grpc_protector *impl = gpr_zalloc(sizeof(*impl));
+ tsi_fake_zero_copy_grpc_protector *impl =
+ (tsi_fake_zero_copy_grpc_protector *)gpr_zalloc(sizeof(*impl));
grpc_slice_buffer_init(&impl->header_sb);
grpc_slice_buffer_init(&impl->protected_sb);
impl->max_frame_size = (max_protected_frame_size == NULL)
diff --git a/src/core/tsi/gts_transport_security.c b/src/core/tsi/gts_transport_security.cc
index e2ac685e44..d37f3bf8f6 100644
--- a/src/core/tsi/gts_transport_security.c
+++ b/src/core/tsi/gts_transport_security.cc
@@ -24,12 +24,12 @@ static gts_shared_resource g_gts_resource;
gts_shared_resource *gts_get_shared_resource(void) { return &g_gts_resource; }
-void grpc_tsi_gts_init() {
+extern "C" void grpc_tsi_gts_init() {
memset(&g_gts_resource, 0, sizeof(gts_shared_resource));
gpr_mu_init(&g_gts_resource.mu);
}
-void grpc_tsi_gts_shutdown() {
+extern "C" void grpc_tsi_gts_shutdown() {
gpr_mu_destroy(&g_gts_resource.mu);
if (g_gts_resource.cq == NULL) {
return;
diff --git a/src/core/tsi/gts_transport_security.h b/src/core/tsi/gts_transport_security.h
index 538e1030bc..b988c3f861 100644
--- a/src/core/tsi/gts_transport_security.h
+++ b/src/core/tsi/gts_transport_security.h
@@ -23,6 +23,10 @@
#include <grpc/support/sync.h>
#include <grpc/support/thd.h>
+#ifdef __cplusplus
+extern "C" {
+#endif
+
typedef struct gts_shared_resource {
gpr_thd_id thread_id;
grpc_channel *channel;
@@ -34,4 +38,8 @@ typedef struct gts_shared_resource {
* TSI handshakes. */
gts_shared_resource *gts_get_shared_resource(void);
-#endif /* GRPC_CORE_TSI_GTS_TRANSPORT_SECURITY_H */
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* GRPC_CORE_TSI_GTS_TRANSPORT_SECURITY_H */ \ No newline at end of file
diff --git a/src/core/tsi/ssl_transport_security.c b/src/core/tsi/ssl_transport_security.cc
index 7ebf9dd96f..b1c69e9c7b 100644
--- a/src/core/tsi/ssl_transport_security.c
+++ b/src/core/tsi/ssl_transport_security.cc
@@ -39,12 +39,14 @@
#include <grpc/support/thd.h>
#include <grpc/support/useful.h>
+extern "C" {
#include <openssl/bio.h>
#include <openssl/crypto.h> /* For OPENSSL_free */
#include <openssl/err.h>
#include <openssl/ssl.h>
#include <openssl/x509.h>
#include <openssl/x509v3.h>
+}
#include "src/core/tsi/ssl_types.h"
#include "src/core/tsi/transport_security.h"
@@ -135,7 +137,7 @@ static void init_openssl(void) {
OpenSSL_add_all_algorithms();
num_locks = CRYPTO_num_locks();
GPR_ASSERT(num_locks > 0);
- openssl_mutexes = gpr_malloc((size_t)num_locks * sizeof(gpr_mu));
+ openssl_mutexes = (gpr_mu *)gpr_malloc((size_t)num_locks * sizeof(gpr_mu));
for (i = 0; i < CRYPTO_num_locks(); i++) {
gpr_mu_init(&openssl_mutexes[i]);
}
@@ -361,7 +363,7 @@ static tsi_result peer_from_x509(X509 *cert, int include_certificate_type,
tsi_peer *peer) {
/* TODO(jboeuf): Maybe add more properties. */
GENERAL_NAMES *subject_alt_names =
- X509_get_ext_d2i(cert, NID_subject_alt_name, 0, 0);
+ (GENERAL_NAMES *)X509_get_ext_d2i(cert, NID_subject_alt_name, 0, 0);
int subject_alt_name_count = (subject_alt_names != NULL)
? (int)sk_GENERAL_NAME_num(subject_alt_names)
: 0;
@@ -479,7 +481,7 @@ static tsi_result ssl_ctx_use_certificate_chain(SSL_CTX *context,
if (pem == NULL) return TSI_OUT_OF_RESOURCES;
do {
- certificate = PEM_read_bio_X509_AUX(pem, NULL, NULL, "");
+ certificate = PEM_read_bio_X509_AUX(pem, NULL, NULL, (void *)"");
if (certificate == NULL) {
result = TSI_INVALID_ARGUMENT;
break;
@@ -489,7 +491,8 @@ static tsi_result ssl_ctx_use_certificate_chain(SSL_CTX *context,
break;
}
while (1) {
- X509 *certificate_authority = PEM_read_bio_X509(pem, NULL, NULL, "");
+ X509 *certificate_authority =
+ PEM_read_bio_X509(pem, NULL, NULL, (void *)"");
if (certificate_authority == NULL) {
ERR_clear_error();
break; /* Done reading. */
@@ -520,7 +523,7 @@ static tsi_result ssl_ctx_use_private_key(SSL_CTX *context, const char *pem_key,
pem = BIO_new_mem_buf((void *)pem_key, (int)pem_key_size);
if (pem == NULL) return TSI_OUT_OF_RESOURCES;
do {
- private_key = PEM_read_bio_PrivateKey(pem, NULL, NULL, "");
+ private_key = PEM_read_bio_PrivateKey(pem, NULL, NULL, (void *)"");
if (private_key == NULL) {
result = TSI_INVALID_ARGUMENT;
break;
@@ -559,7 +562,7 @@ static tsi_result ssl_ctx_load_verification_certs(SSL_CTX *context,
}
while (1) {
- root = PEM_read_bio_X509_AUX(pem, NULL, NULL, "");
+ root = PEM_read_bio_X509_AUX(pem, NULL, NULL, (void *)"");
if (root == NULL) {
ERR_clear_error();
break; /* We're at the end of stream. */
@@ -655,7 +658,7 @@ static tsi_result extract_x509_subject_names_from_pem_cert(const char *pem_cert,
pem = BIO_new_mem_buf((void *)pem_cert, (int)strlen(pem_cert));
if (pem == NULL) return TSI_OUT_OF_RESOURCES;
- cert = PEM_read_bio_X509(pem, NULL, NULL, "");
+ cert = PEM_read_bio_X509(pem, NULL, NULL, (void *)"");
if (cert == NULL) {
gpr_log(GPR_ERROR, "Invalid certificate");
result = TSI_INVALID_ARGUMENT;
@@ -684,7 +687,7 @@ static tsi_result build_alpn_protocol_name_list(
}
*protocol_name_list_length += length + 1;
}
- *protocol_name_list = gpr_malloc(*protocol_name_list_length);
+ *protocol_name_list = (unsigned char *)gpr_malloc(*protocol_name_list_length);
if (*protocol_name_list == NULL) return TSI_OUT_OF_RESOURCES;
current = *protocol_name_list;
for (i = 0; i < num_alpn_protocols; i++) {
@@ -998,8 +1001,8 @@ static tsi_result ssl_handshaker_extract_peer(tsi_handshaker *self,
}
if (alpn_selected != NULL) {
size_t i;
- tsi_peer_property *new_properties =
- gpr_zalloc(sizeof(*new_properties) * (peer->property_count + 1));
+ tsi_peer_property *new_properties = (tsi_peer_property *)gpr_zalloc(
+ sizeof(*new_properties) * (peer->property_count + 1));
for (i = 0; i < peer->property_count; i++) {
new_properties[i] = peer->properties[i];
}
@@ -1023,7 +1026,8 @@ static tsi_result ssl_handshaker_create_frame_protector(
size_t actual_max_output_protected_frame_size =
TSI_SSL_MAX_PROTECTED_FRAME_SIZE_UPPER_BOUND;
tsi_ssl_handshaker *impl = (tsi_ssl_handshaker *)self;
- tsi_ssl_frame_protector *protector_impl = gpr_zalloc(sizeof(*protector_impl));
+ tsi_ssl_frame_protector *protector_impl =
+ (tsi_ssl_frame_protector *)gpr_zalloc(sizeof(*protector_impl));
if (max_output_protected_frame_size != NULL) {
if (*max_output_protected_frame_size >
@@ -1039,7 +1043,8 @@ static tsi_result ssl_handshaker_create_frame_protector(
}
protector_impl->buffer_size =
actual_max_output_protected_frame_size - TSI_SSL_MAX_PROTECTION_OVERHEAD;
- protector_impl->buffer = gpr_malloc(protector_impl->buffer_size);
+ protector_impl->buffer =
+ (unsigned char *)gpr_malloc(protector_impl->buffer_size);
if (protector_impl->buffer == NULL) {
gpr_log(GPR_ERROR,
"Could not allocated buffer for tsi_ssl_frame_protector.");
@@ -1130,7 +1135,7 @@ static tsi_result create_tsi_ssl_handshaker(SSL_CTX *ctx, int is_client,
SSL_set_accept_state(ssl);
}
- impl = gpr_zalloc(sizeof(*impl));
+ impl = (tsi_ssl_handshaker *)gpr_zalloc(sizeof(*impl));
impl->ssl = ssl;
impl->into_ssl = into_ssl;
impl->from_ssl = from_ssl;
@@ -1359,7 +1364,7 @@ tsi_result tsi_create_ssl_client_handshaker_factory(
return TSI_INVALID_ARGUMENT;
}
- impl = gpr_zalloc(sizeof(*impl));
+ impl = (tsi_ssl_client_handshaker_factory *)gpr_zalloc(sizeof(*impl));
tsi_ssl_handshaker_factory_init(&impl->base);
impl->base.vtable = &client_handshaker_factory_vtable;
@@ -1444,13 +1449,14 @@ tsi_result tsi_create_ssl_server_handshaker_factory_ex(
return TSI_INVALID_ARGUMENT;
}
- impl = gpr_zalloc(sizeof(*impl));
+ impl = (tsi_ssl_server_handshaker_factory *)gpr_zalloc(sizeof(*impl));
tsi_ssl_handshaker_factory_init(&impl->base);
impl->base.vtable = &server_handshaker_factory_vtable;
- impl->ssl_contexts = gpr_zalloc(num_key_cert_pairs * sizeof(SSL_CTX *));
+ impl->ssl_contexts =
+ (SSL_CTX **)gpr_zalloc(num_key_cert_pairs * sizeof(SSL_CTX *));
impl->ssl_context_x509_subject_names =
- gpr_zalloc(num_key_cert_pairs * sizeof(tsi_peer));
+ (tsi_peer *)gpr_zalloc(num_key_cert_pairs * sizeof(tsi_peer));
if (impl->ssl_contexts == NULL ||
impl->ssl_context_x509_subject_names == NULL) {
tsi_ssl_handshaker_factory_unref(&impl->base);
diff --git a/src/core/tsi/ssl_types.h b/src/core/tsi/ssl_types.h
index 3788643355..e0e967034b 100644
--- a/src/core/tsi/ssl_types.h
+++ b/src/core/tsi/ssl_types.h
@@ -19,6 +19,10 @@
#ifndef GRPC_CORE_TSI_SSL_TYPES_H
#define GRPC_CORE_TSI_SSL_TYPES_H
+#ifdef __cplusplus
+extern "C" {
+#endif
+
/* A collection of macros to cast between various integer types that are
* used differently between BoringSSL and OpenSSL:
* TSI_INT_AS_SIZE(x): convert 'int x' to a length parameter for an OpenSSL
@@ -37,4 +41,8 @@
#define TSI_SIZE_AS_SIZE(x) ((int)(x))
#endif
+#ifdef __cplusplus
+}
+#endif
+
#endif /* GRPC_CORE_TSI_SSL_TYPES_H */
diff --git a/src/core/tsi/transport_security.c b/src/core/tsi/transport_security.cc
index 76213072a3..21bd8eba78 100644
--- a/src/core/tsi/transport_security.c
+++ b/src/core/tsi/transport_security.cc
@@ -282,7 +282,7 @@ tsi_result tsi_construct_allocated_string_peer_property(
*property = tsi_init_peer_property();
if (name != NULL) property->name = gpr_strdup(name);
if (value_length > 0) {
- property->value.data = gpr_zalloc(value_length);
+ property->value.data = (char *)gpr_zalloc(value_length);
property->value.length = value_length;
}
return TSI_OK;
@@ -310,7 +310,8 @@ tsi_result tsi_construct_string_peer_property(const char *name,
tsi_result tsi_construct_peer(size_t property_count, tsi_peer *peer) {
memset(peer, 0, sizeof(tsi_peer));
if (property_count > 0) {
- peer->properties = gpr_zalloc(property_count * sizeof(tsi_peer_property));
+ peer->properties = (tsi_peer_property *)gpr_zalloc(
+ property_count * sizeof(tsi_peer_property));
peer->property_count = property_count;
}
return TSI_OK;
diff --git a/src/core/tsi/transport_security_adapter.c b/src/core/tsi/transport_security_adapter.cc
index 1c2a57b3bd..e399e42758 100644
--- a/src/core/tsi/transport_security_adapter.c
+++ b/src/core/tsi/transport_security_adapter.cc
@@ -80,12 +80,13 @@ static tsi_result tsi_adapter_create_handshaker_result(
if (wrapped == NULL || (unused_bytes_size > 0 && unused_bytes == NULL)) {
return TSI_INVALID_ARGUMENT;
}
- tsi_adapter_handshaker_result *impl = gpr_zalloc(sizeof(*impl));
+ tsi_adapter_handshaker_result *impl =
+ (tsi_adapter_handshaker_result *)gpr_zalloc(sizeof(*impl));
impl->base.vtable = &result_vtable;
impl->wrapped = wrapped;
impl->unused_bytes_size = unused_bytes_size;
if (unused_bytes_size > 0) {
- impl->unused_bytes = gpr_malloc(unused_bytes_size);
+ impl->unused_bytes = (unsigned char *)gpr_malloc(unused_bytes_size);
memcpy(impl->unused_bytes, unused_bytes, unused_bytes_size);
} else {
impl->unused_bytes = NULL;
@@ -172,8 +173,8 @@ static tsi_result adapter_next(
offset += to_send_size;
if (status == TSI_INCOMPLETE_DATA) {
impl->adapter_buffer_size *= 2;
- impl->adapter_buffer =
- gpr_realloc(impl->adapter_buffer, impl->adapter_buffer_size);
+ impl->adapter_buffer = (unsigned char *)gpr_realloc(
+ impl->adapter_buffer, impl->adapter_buffer_size);
}
} while (status == TSI_INCOMPLETE_DATA);
if (status != TSI_OK) return status;
@@ -209,11 +210,12 @@ static const tsi_handshaker_vtable handshaker_vtable = {
tsi_handshaker *tsi_create_adapter_handshaker(tsi_handshaker *wrapped) {
GPR_ASSERT(wrapped != NULL);
- tsi_adapter_handshaker *impl = gpr_zalloc(sizeof(*impl));
+ tsi_adapter_handshaker *impl =
+ (tsi_adapter_handshaker *)gpr_zalloc(sizeof(*impl));
impl->base.vtable = &handshaker_vtable;
impl->wrapped = wrapped;
impl->adapter_buffer_size = TSI_ADAPTER_INITIAL_BUFFER_SIZE;
- impl->adapter_buffer = gpr_malloc(impl->adapter_buffer_size);
+ impl->adapter_buffer = (unsigned char *)gpr_malloc(impl->adapter_buffer_size);
return &impl->base;
}
diff --git a/src/core/tsi/transport_security_grpc.c b/src/core/tsi/transport_security_grpc.cc
index affd995230..affd995230 100644
--- a/src/core/tsi/transport_security_grpc.c
+++ b/src/core/tsi/transport_security_grpc.cc
diff --git a/src/python/grpcio/grpc_core_dependencies.py b/src/python/grpcio/grpc_core_dependencies.py
index 7b684f2a58..7b9fd6424d 100644
--- a/src/python/grpcio/grpc_core_dependencies.py
+++ b/src/python/grpcio/grpc_core_dependencies.py
@@ -15,313 +15,313 @@
# AUTO-GENERATED FROM `$REPO_ROOT/templates/src/python/grpcio/grpc_core_dependencies.py.template`!!!
CORE_SOURCE_FILES = [
- 'src/core/lib/profiling/basic_timers.c',
- 'src/core/lib/profiling/stap_timers.c',
- 'src/core/lib/support/alloc.c',
- 'src/core/lib/support/arena.c',
- 'src/core/lib/support/atm.c',
- 'src/core/lib/support/avl.c',
- 'src/core/lib/support/backoff.c',
- 'src/core/lib/support/cmdline.c',
- 'src/core/lib/support/cpu_iphone.c',
- 'src/core/lib/support/cpu_linux.c',
- 'src/core/lib/support/cpu_posix.c',
- 'src/core/lib/support/cpu_windows.c',
- 'src/core/lib/support/env_linux.c',
- 'src/core/lib/support/env_posix.c',
- 'src/core/lib/support/env_windows.c',
- 'src/core/lib/support/histogram.c',
- 'src/core/lib/support/host_port.c',
- 'src/core/lib/support/log.c',
- 'src/core/lib/support/log_android.c',
- 'src/core/lib/support/log_linux.c',
- 'src/core/lib/support/log_posix.c',
- 'src/core/lib/support/log_windows.c',
- 'src/core/lib/support/mpscq.c',
- 'src/core/lib/support/murmur_hash.c',
- 'src/core/lib/support/stack_lockfree.c',
- 'src/core/lib/support/string.c',
- 'src/core/lib/support/string_posix.c',
- 'src/core/lib/support/string_util_windows.c',
- 'src/core/lib/support/string_windows.c',
- 'src/core/lib/support/subprocess_posix.c',
- 'src/core/lib/support/subprocess_windows.c',
- 'src/core/lib/support/sync.c',
- 'src/core/lib/support/sync_posix.c',
- 'src/core/lib/support/sync_windows.c',
- 'src/core/lib/support/thd.c',
- 'src/core/lib/support/thd_posix.c',
- 'src/core/lib/support/thd_windows.c',
- 'src/core/lib/support/time.c',
- 'src/core/lib/support/time_posix.c',
- 'src/core/lib/support/time_precise.c',
- 'src/core/lib/support/time_windows.c',
- 'src/core/lib/support/tls_pthread.c',
- 'src/core/lib/support/tmpfile_msys.c',
- 'src/core/lib/support/tmpfile_posix.c',
- 'src/core/lib/support/tmpfile_windows.c',
- 'src/core/lib/support/wrap_memcpy.c',
- 'src/core/lib/surface/init.c',
- 'src/core/lib/channel/channel_args.c',
- 'src/core/lib/channel/channel_stack.c',
- 'src/core/lib/channel/channel_stack_builder.c',
- 'src/core/lib/channel/connected_channel.c',
- 'src/core/lib/channel/handshaker.c',
- 'src/core/lib/channel/handshaker_factory.c',
- 'src/core/lib/channel/handshaker_registry.c',
- 'src/core/lib/compression/compression.c',
- 'src/core/lib/compression/message_compress.c',
- 'src/core/lib/compression/stream_compression.c',
- 'src/core/lib/compression/stream_compression_gzip.c',
- 'src/core/lib/compression/stream_compression_identity.c',
- 'src/core/lib/debug/stats.c',
- 'src/core/lib/debug/stats_data.c',
- 'src/core/lib/http/format_request.c',
- 'src/core/lib/http/httpcli.c',
- 'src/core/lib/http/parser.c',
- 'src/core/lib/iomgr/call_combiner.c',
- 'src/core/lib/iomgr/closure.c',
- 'src/core/lib/iomgr/combiner.c',
- 'src/core/lib/iomgr/endpoint.c',
- 'src/core/lib/iomgr/endpoint_pair_posix.c',
- 'src/core/lib/iomgr/endpoint_pair_uv.c',
- 'src/core/lib/iomgr/endpoint_pair_windows.c',
- 'src/core/lib/iomgr/error.c',
- 'src/core/lib/iomgr/ev_epoll1_linux.c',
- 'src/core/lib/iomgr/ev_epollex_linux.c',
- 'src/core/lib/iomgr/ev_epollsig_linux.c',
- 'src/core/lib/iomgr/ev_poll_posix.c',
- 'src/core/lib/iomgr/ev_posix.c',
- 'src/core/lib/iomgr/ev_windows.c',
- 'src/core/lib/iomgr/exec_ctx.c',
- 'src/core/lib/iomgr/executor.c',
- 'src/core/lib/iomgr/gethostname_fallback.c',
- 'src/core/lib/iomgr/gethostname_host_name_max.c',
- 'src/core/lib/iomgr/gethostname_sysconf.c',
- 'src/core/lib/iomgr/iocp_windows.c',
- 'src/core/lib/iomgr/iomgr.c',
- 'src/core/lib/iomgr/iomgr_posix.c',
- 'src/core/lib/iomgr/iomgr_uv.c',
- 'src/core/lib/iomgr/iomgr_windows.c',
- 'src/core/lib/iomgr/is_epollexclusive_available.c',
- 'src/core/lib/iomgr/load_file.c',
- 'src/core/lib/iomgr/lockfree_event.c',
- 'src/core/lib/iomgr/network_status_tracker.c',
- 'src/core/lib/iomgr/polling_entity.c',
- 'src/core/lib/iomgr/pollset_set_uv.c',
- 'src/core/lib/iomgr/pollset_set_windows.c',
- 'src/core/lib/iomgr/pollset_uv.c',
- 'src/core/lib/iomgr/pollset_windows.c',
- 'src/core/lib/iomgr/resolve_address_posix.c',
- 'src/core/lib/iomgr/resolve_address_uv.c',
- 'src/core/lib/iomgr/resolve_address_windows.c',
- 'src/core/lib/iomgr/resource_quota.c',
- 'src/core/lib/iomgr/sockaddr_utils.c',
- 'src/core/lib/iomgr/socket_factory_posix.c',
- 'src/core/lib/iomgr/socket_mutator.c',
- 'src/core/lib/iomgr/socket_utils_common_posix.c',
- 'src/core/lib/iomgr/socket_utils_linux.c',
- 'src/core/lib/iomgr/socket_utils_posix.c',
- 'src/core/lib/iomgr/socket_utils_uv.c',
- 'src/core/lib/iomgr/socket_utils_windows.c',
- 'src/core/lib/iomgr/socket_windows.c',
- 'src/core/lib/iomgr/tcp_client_posix.c',
- 'src/core/lib/iomgr/tcp_client_uv.c',
- 'src/core/lib/iomgr/tcp_client_windows.c',
- 'src/core/lib/iomgr/tcp_posix.c',
- 'src/core/lib/iomgr/tcp_server_posix.c',
- 'src/core/lib/iomgr/tcp_server_utils_posix_common.c',
- 'src/core/lib/iomgr/tcp_server_utils_posix_ifaddrs.c',
- 'src/core/lib/iomgr/tcp_server_utils_posix_noifaddrs.c',
- 'src/core/lib/iomgr/tcp_server_uv.c',
- 'src/core/lib/iomgr/tcp_server_windows.c',
- 'src/core/lib/iomgr/tcp_uv.c',
- 'src/core/lib/iomgr/tcp_windows.c',
- 'src/core/lib/iomgr/time_averaged_stats.c',
- 'src/core/lib/iomgr/timer_generic.c',
- 'src/core/lib/iomgr/timer_heap.c',
- 'src/core/lib/iomgr/timer_manager.c',
- 'src/core/lib/iomgr/timer_uv.c',
- 'src/core/lib/iomgr/udp_server.c',
- 'src/core/lib/iomgr/unix_sockets_posix.c',
- 'src/core/lib/iomgr/unix_sockets_posix_noop.c',
- 'src/core/lib/iomgr/wakeup_fd_cv.c',
- 'src/core/lib/iomgr/wakeup_fd_eventfd.c',
- 'src/core/lib/iomgr/wakeup_fd_nospecial.c',
- 'src/core/lib/iomgr/wakeup_fd_pipe.c',
- 'src/core/lib/iomgr/wakeup_fd_posix.c',
- 'src/core/lib/json/json.c',
- 'src/core/lib/json/json_reader.c',
- 'src/core/lib/json/json_string.c',
- 'src/core/lib/json/json_writer.c',
- 'src/core/lib/slice/b64.c',
- 'src/core/lib/slice/percent_encoding.c',
- 'src/core/lib/slice/slice.c',
- 'src/core/lib/slice/slice_buffer.c',
- 'src/core/lib/slice/slice_hash_table.c',
- 'src/core/lib/slice/slice_intern.c',
- 'src/core/lib/slice/slice_string_helpers.c',
- 'src/core/lib/surface/alarm.c',
- 'src/core/lib/surface/api_trace.c',
- 'src/core/lib/surface/byte_buffer.c',
- 'src/core/lib/surface/byte_buffer_reader.c',
- 'src/core/lib/surface/call.c',
- 'src/core/lib/surface/call_details.c',
- 'src/core/lib/surface/call_log_batch.c',
- 'src/core/lib/surface/channel.c',
- 'src/core/lib/surface/channel_init.c',
- 'src/core/lib/surface/channel_ping.c',
- 'src/core/lib/surface/channel_stack_type.c',
- 'src/core/lib/surface/completion_queue.c',
- 'src/core/lib/surface/completion_queue_factory.c',
- 'src/core/lib/surface/event_string.c',
+ 'src/core/lib/profiling/basic_timers.cc',
+ 'src/core/lib/profiling/stap_timers.cc',
+ 'src/core/lib/support/alloc.cc',
+ 'src/core/lib/support/arena.cc',
+ 'src/core/lib/support/atm.cc',
+ 'src/core/lib/support/avl.cc',
+ 'src/core/lib/support/backoff.cc',
+ 'src/core/lib/support/cmdline.cc',
+ 'src/core/lib/support/cpu_iphone.cc',
+ 'src/core/lib/support/cpu_linux.cc',
+ 'src/core/lib/support/cpu_posix.cc',
+ 'src/core/lib/support/cpu_windows.cc',
+ 'src/core/lib/support/env_linux.cc',
+ 'src/core/lib/support/env_posix.cc',
+ 'src/core/lib/support/env_windows.cc',
+ 'src/core/lib/support/histogram.cc',
+ 'src/core/lib/support/host_port.cc',
+ 'src/core/lib/support/log.cc',
+ 'src/core/lib/support/log_android.cc',
+ 'src/core/lib/support/log_linux.cc',
+ 'src/core/lib/support/log_posix.cc',
+ 'src/core/lib/support/log_windows.cc',
+ 'src/core/lib/support/mpscq.cc',
+ 'src/core/lib/support/murmur_hash.cc',
+ 'src/core/lib/support/stack_lockfree.cc',
+ 'src/core/lib/support/string.cc',
+ 'src/core/lib/support/string_posix.cc',
+ 'src/core/lib/support/string_util_windows.cc',
+ 'src/core/lib/support/string_windows.cc',
+ 'src/core/lib/support/subprocess_posix.cc',
+ 'src/core/lib/support/subprocess_windows.cc',
+ 'src/core/lib/support/sync.cc',
+ 'src/core/lib/support/sync_posix.cc',
+ 'src/core/lib/support/sync_windows.cc',
+ 'src/core/lib/support/thd.cc',
+ 'src/core/lib/support/thd_posix.cc',
+ 'src/core/lib/support/thd_windows.cc',
+ 'src/core/lib/support/time.cc',
+ 'src/core/lib/support/time_posix.cc',
+ 'src/core/lib/support/time_precise.cc',
+ 'src/core/lib/support/time_windows.cc',
+ 'src/core/lib/support/tls_pthread.cc',
+ 'src/core/lib/support/tmpfile_msys.cc',
+ 'src/core/lib/support/tmpfile_posix.cc',
+ 'src/core/lib/support/tmpfile_windows.cc',
+ 'src/core/lib/support/wrap_memcpy.cc',
+ 'src/core/lib/surface/init.cc',
+ 'src/core/lib/channel/channel_args.cc',
+ 'src/core/lib/channel/channel_stack.cc',
+ 'src/core/lib/channel/channel_stack_builder.cc',
+ 'src/core/lib/channel/connected_channel.cc',
+ 'src/core/lib/channel/handshaker.cc',
+ 'src/core/lib/channel/handshaker_factory.cc',
+ 'src/core/lib/channel/handshaker_registry.cc',
+ 'src/core/lib/compression/compression.cc',
+ 'src/core/lib/compression/message_compress.cc',
+ 'src/core/lib/compression/stream_compression.cc',
+ 'src/core/lib/compression/stream_compression_gzip.cc',
+ 'src/core/lib/compression/stream_compression_identity.cc',
+ 'src/core/lib/debug/stats.cc',
+ 'src/core/lib/debug/stats_data.cc',
+ 'src/core/lib/http/format_request.cc',
+ 'src/core/lib/http/httpcli.cc',
+ 'src/core/lib/http/parser.cc',
+ 'src/core/lib/iomgr/call_combiner.cc',
+ 'src/core/lib/iomgr/closure.cc',
+ 'src/core/lib/iomgr/combiner.cc',
+ 'src/core/lib/iomgr/endpoint.cc',
+ 'src/core/lib/iomgr/endpoint_pair_posix.cc',
+ 'src/core/lib/iomgr/endpoint_pair_uv.cc',
+ 'src/core/lib/iomgr/endpoint_pair_windows.cc',
+ 'src/core/lib/iomgr/error.cc',
+ 'src/core/lib/iomgr/ev_epoll1_linux.cc',
+ 'src/core/lib/iomgr/ev_epollex_linux.cc',
+ 'src/core/lib/iomgr/ev_epollsig_linux.cc',
+ 'src/core/lib/iomgr/ev_poll_posix.cc',
+ 'src/core/lib/iomgr/ev_posix.cc',
+ 'src/core/lib/iomgr/ev_windows.cc',
+ 'src/core/lib/iomgr/exec_ctx.cc',
+ 'src/core/lib/iomgr/executor.cc',
+ 'src/core/lib/iomgr/gethostname_fallback.cc',
+ 'src/core/lib/iomgr/gethostname_host_name_max.cc',
+ 'src/core/lib/iomgr/gethostname_sysconf.cc',
+ 'src/core/lib/iomgr/iocp_windows.cc',
+ 'src/core/lib/iomgr/iomgr.cc',
+ 'src/core/lib/iomgr/iomgr_posix.cc',
+ 'src/core/lib/iomgr/iomgr_uv.cc',
+ 'src/core/lib/iomgr/iomgr_windows.cc',
+ 'src/core/lib/iomgr/is_epollexclusive_available.cc',
+ 'src/core/lib/iomgr/load_file.cc',
+ 'src/core/lib/iomgr/lockfree_event.cc',
+ 'src/core/lib/iomgr/network_status_tracker.cc',
+ 'src/core/lib/iomgr/polling_entity.cc',
+ 'src/core/lib/iomgr/pollset_set_uv.cc',
+ 'src/core/lib/iomgr/pollset_set_windows.cc',
+ 'src/core/lib/iomgr/pollset_uv.cc',
+ 'src/core/lib/iomgr/pollset_windows.cc',
+ 'src/core/lib/iomgr/resolve_address_posix.cc',
+ 'src/core/lib/iomgr/resolve_address_uv.cc',
+ 'src/core/lib/iomgr/resolve_address_windows.cc',
+ 'src/core/lib/iomgr/resource_quota.cc',
+ 'src/core/lib/iomgr/sockaddr_utils.cc',
+ 'src/core/lib/iomgr/socket_factory_posix.cc',
+ 'src/core/lib/iomgr/socket_mutator.cc',
+ 'src/core/lib/iomgr/socket_utils_common_posix.cc',
+ 'src/core/lib/iomgr/socket_utils_linux.cc',
+ 'src/core/lib/iomgr/socket_utils_posix.cc',
+ 'src/core/lib/iomgr/socket_utils_uv.cc',
+ 'src/core/lib/iomgr/socket_utils_windows.cc',
+ 'src/core/lib/iomgr/socket_windows.cc',
+ 'src/core/lib/iomgr/tcp_client_posix.cc',
+ 'src/core/lib/iomgr/tcp_client_uv.cc',
+ 'src/core/lib/iomgr/tcp_client_windows.cc',
+ 'src/core/lib/iomgr/tcp_posix.cc',
+ 'src/core/lib/iomgr/tcp_server_posix.cc',
+ 'src/core/lib/iomgr/tcp_server_utils_posix_common.cc',
+ 'src/core/lib/iomgr/tcp_server_utils_posix_ifaddrs.cc',
+ 'src/core/lib/iomgr/tcp_server_utils_posix_noifaddrs.cc',
+ 'src/core/lib/iomgr/tcp_server_uv.cc',
+ 'src/core/lib/iomgr/tcp_server_windows.cc',
+ 'src/core/lib/iomgr/tcp_uv.cc',
+ 'src/core/lib/iomgr/tcp_windows.cc',
+ 'src/core/lib/iomgr/time_averaged_stats.cc',
+ 'src/core/lib/iomgr/timer_generic.cc',
+ 'src/core/lib/iomgr/timer_heap.cc',
+ 'src/core/lib/iomgr/timer_manager.cc',
+ 'src/core/lib/iomgr/timer_uv.cc',
+ 'src/core/lib/iomgr/udp_server.cc',
+ 'src/core/lib/iomgr/unix_sockets_posix.cc',
+ 'src/core/lib/iomgr/unix_sockets_posix_noop.cc',
+ 'src/core/lib/iomgr/wakeup_fd_cv.cc',
+ 'src/core/lib/iomgr/wakeup_fd_eventfd.cc',
+ 'src/core/lib/iomgr/wakeup_fd_nospecial.cc',
+ 'src/core/lib/iomgr/wakeup_fd_pipe.cc',
+ 'src/core/lib/iomgr/wakeup_fd_posix.cc',
+ 'src/core/lib/json/json.cc',
+ 'src/core/lib/json/json_reader.cc',
+ 'src/core/lib/json/json_string.cc',
+ 'src/core/lib/json/json_writer.cc',
+ 'src/core/lib/slice/b64.cc',
+ 'src/core/lib/slice/percent_encoding.cc',
+ 'src/core/lib/slice/slice.cc',
+ 'src/core/lib/slice/slice_buffer.cc',
+ 'src/core/lib/slice/slice_hash_table.cc',
+ 'src/core/lib/slice/slice_intern.cc',
+ 'src/core/lib/slice/slice_string_helpers.cc',
+ 'src/core/lib/surface/alarm.cc',
+ 'src/core/lib/surface/api_trace.cc',
+ 'src/core/lib/surface/byte_buffer.cc',
+ 'src/core/lib/surface/byte_buffer_reader.cc',
+ 'src/core/lib/surface/call.cc',
+ 'src/core/lib/surface/call_details.cc',
+ 'src/core/lib/surface/call_log_batch.cc',
+ 'src/core/lib/surface/channel.cc',
+ 'src/core/lib/surface/channel_init.cc',
+ 'src/core/lib/surface/channel_ping.cc',
+ 'src/core/lib/surface/channel_stack_type.cc',
+ 'src/core/lib/surface/completion_queue.cc',
+ 'src/core/lib/surface/completion_queue_factory.cc',
+ 'src/core/lib/surface/event_string.cc',
'src/core/lib/surface/lame_client.cc',
- 'src/core/lib/surface/metadata_array.c',
- 'src/core/lib/surface/server.c',
- 'src/core/lib/surface/validate_metadata.c',
- 'src/core/lib/surface/version.c',
- 'src/core/lib/transport/bdp_estimator.c',
- 'src/core/lib/transport/byte_stream.c',
- 'src/core/lib/transport/connectivity_state.c',
- 'src/core/lib/transport/error_utils.c',
- 'src/core/lib/transport/metadata.c',
- 'src/core/lib/transport/metadata_batch.c',
- 'src/core/lib/transport/pid_controller.c',
- 'src/core/lib/transport/service_config.c',
- 'src/core/lib/transport/static_metadata.c',
- 'src/core/lib/transport/status_conversion.c',
- 'src/core/lib/transport/timeout_encoding.c',
- 'src/core/lib/transport/transport.c',
- 'src/core/lib/transport/transport_op_string.c',
- 'src/core/lib/debug/trace.c',
- 'src/core/ext/transport/chttp2/server/secure/server_secure_chttp2.c',
- 'src/core/ext/transport/chttp2/transport/bin_decoder.c',
- 'src/core/ext/transport/chttp2/transport/bin_encoder.c',
- 'src/core/ext/transport/chttp2/transport/chttp2_plugin.c',
- 'src/core/ext/transport/chttp2/transport/chttp2_transport.c',
- 'src/core/ext/transport/chttp2/transport/flow_control.c',
- 'src/core/ext/transport/chttp2/transport/frame_data.c',
- 'src/core/ext/transport/chttp2/transport/frame_goaway.c',
- 'src/core/ext/transport/chttp2/transport/frame_ping.c',
- 'src/core/ext/transport/chttp2/transport/frame_rst_stream.c',
- 'src/core/ext/transport/chttp2/transport/frame_settings.c',
- 'src/core/ext/transport/chttp2/transport/frame_window_update.c',
- 'src/core/ext/transport/chttp2/transport/hpack_encoder.c',
- 'src/core/ext/transport/chttp2/transport/hpack_parser.c',
- 'src/core/ext/transport/chttp2/transport/hpack_table.c',
- 'src/core/ext/transport/chttp2/transport/http2_settings.c',
- 'src/core/ext/transport/chttp2/transport/huffsyms.c',
- 'src/core/ext/transport/chttp2/transport/incoming_metadata.c',
- 'src/core/ext/transport/chttp2/transport/parsing.c',
- 'src/core/ext/transport/chttp2/transport/stream_lists.c',
- 'src/core/ext/transport/chttp2/transport/stream_map.c',
- 'src/core/ext/transport/chttp2/transport/varint.c',
- 'src/core/ext/transport/chttp2/transport/writing.c',
- 'src/core/ext/transport/chttp2/alpn/alpn.c',
- 'src/core/ext/filters/http/client/http_client_filter.c',
- 'src/core/ext/filters/http/http_filters_plugin.c',
- 'src/core/ext/filters/http/message_compress/message_compress_filter.c',
- 'src/core/ext/filters/http/server/http_server_filter.c',
- 'src/core/lib/http/httpcli_security_connector.c',
- 'src/core/lib/security/context/security_context.c',
- 'src/core/lib/security/credentials/composite/composite_credentials.c',
- 'src/core/lib/security/credentials/credentials.c',
- 'src/core/lib/security/credentials/credentials_metadata.c',
- 'src/core/lib/security/credentials/fake/fake_credentials.c',
- 'src/core/lib/security/credentials/google_default/credentials_generic.c',
- 'src/core/lib/security/credentials/google_default/google_default_credentials.c',
- 'src/core/lib/security/credentials/iam/iam_credentials.c',
- 'src/core/lib/security/credentials/jwt/json_token.c',
- 'src/core/lib/security/credentials/jwt/jwt_credentials.c',
- 'src/core/lib/security/credentials/jwt/jwt_verifier.c',
- 'src/core/lib/security/credentials/oauth2/oauth2_credentials.c',
- 'src/core/lib/security/credentials/plugin/plugin_credentials.c',
- 'src/core/lib/security/credentials/ssl/ssl_credentials.c',
- 'src/core/lib/security/transport/client_auth_filter.c',
- 'src/core/lib/security/transport/lb_targets_info.c',
- 'src/core/lib/security/transport/secure_endpoint.c',
- 'src/core/lib/security/transport/security_connector.c',
- 'src/core/lib/security/transport/security_handshaker.c',
- 'src/core/lib/security/transport/server_auth_filter.c',
- 'src/core/lib/security/transport/tsi_error.c',
- 'src/core/lib/security/util/json_util.c',
- 'src/core/lib/surface/init_secure.c',
- 'src/core/tsi/fake_transport_security.c',
- 'src/core/tsi/gts_transport_security.c',
- 'src/core/tsi/ssl_transport_security.c',
- 'src/core/tsi/transport_security_grpc.c',
- 'src/core/tsi/transport_security.c',
- 'src/core/tsi/transport_security_adapter.c',
- 'src/core/ext/transport/chttp2/server/chttp2_server.c',
- 'src/core/ext/transport/chttp2/client/secure/secure_channel_create.c',
- 'src/core/ext/filters/client_channel/channel_connectivity.c',
- 'src/core/ext/filters/client_channel/client_channel.c',
- 'src/core/ext/filters/client_channel/client_channel_factory.c',
- 'src/core/ext/filters/client_channel/client_channel_plugin.c',
- 'src/core/ext/filters/client_channel/connector.c',
- 'src/core/ext/filters/client_channel/http_connect_handshaker.c',
- 'src/core/ext/filters/client_channel/http_proxy.c',
- 'src/core/ext/filters/client_channel/lb_policy.c',
- 'src/core/ext/filters/client_channel/lb_policy_factory.c',
- 'src/core/ext/filters/client_channel/lb_policy_registry.c',
- 'src/core/ext/filters/client_channel/parse_address.c',
- 'src/core/ext/filters/client_channel/proxy_mapper.c',
- 'src/core/ext/filters/client_channel/proxy_mapper_registry.c',
- 'src/core/ext/filters/client_channel/resolver.c',
- 'src/core/ext/filters/client_channel/resolver_factory.c',
- 'src/core/ext/filters/client_channel/resolver_registry.c',
- 'src/core/ext/filters/client_channel/retry_throttle.c',
- 'src/core/ext/filters/client_channel/subchannel.c',
- 'src/core/ext/filters/client_channel/subchannel_index.c',
- 'src/core/ext/filters/client_channel/uri_parser.c',
- 'src/core/ext/filters/deadline/deadline_filter.c',
- 'src/core/ext/transport/chttp2/client/chttp2_connector.c',
- 'src/core/ext/transport/chttp2/server/insecure/server_chttp2.c',
- 'src/core/ext/transport/chttp2/server/insecure/server_chttp2_posix.c',
- 'src/core/ext/transport/chttp2/client/insecure/channel_create.c',
- 'src/core/ext/transport/chttp2/client/insecure/channel_create_posix.c',
- 'src/core/ext/transport/inproc/inproc_plugin.c',
- 'src/core/ext/transport/inproc/inproc_transport.c',
- 'src/core/ext/filters/client_channel/lb_policy/grpclb/client_load_reporting_filter.c',
- 'src/core/ext/filters/client_channel/lb_policy/grpclb/grpclb.c',
- 'src/core/ext/filters/client_channel/lb_policy/grpclb/grpclb_channel_secure.c',
- 'src/core/ext/filters/client_channel/lb_policy/grpclb/grpclb_client_stats.c',
- 'src/core/ext/filters/client_channel/lb_policy/grpclb/load_balancer_api.c',
+ 'src/core/lib/surface/metadata_array.cc',
+ 'src/core/lib/surface/server.cc',
+ 'src/core/lib/surface/validate_metadata.cc',
+ 'src/core/lib/surface/version.cc',
+ 'src/core/lib/transport/bdp_estimator.cc',
+ 'src/core/lib/transport/byte_stream.cc',
+ 'src/core/lib/transport/connectivity_state.cc',
+ 'src/core/lib/transport/error_utils.cc',
+ 'src/core/lib/transport/metadata.cc',
+ 'src/core/lib/transport/metadata_batch.cc',
+ 'src/core/lib/transport/pid_controller.cc',
+ 'src/core/lib/transport/service_config.cc',
+ 'src/core/lib/transport/static_metadata.cc',
+ 'src/core/lib/transport/status_conversion.cc',
+ 'src/core/lib/transport/timeout_encoding.cc',
+ 'src/core/lib/transport/transport.cc',
+ 'src/core/lib/transport/transport_op_string.cc',
+ 'src/core/lib/debug/trace.cc',
+ 'src/core/ext/transport/chttp2/server/secure/server_secure_chttp2.cc',
+ 'src/core/ext/transport/chttp2/transport/bin_decoder.cc',
+ 'src/core/ext/transport/chttp2/transport/bin_encoder.cc',
+ 'src/core/ext/transport/chttp2/transport/chttp2_plugin.cc',
+ 'src/core/ext/transport/chttp2/transport/chttp2_transport.cc',
+ 'src/core/ext/transport/chttp2/transport/flow_control.cc',
+ 'src/core/ext/transport/chttp2/transport/frame_data.cc',
+ 'src/core/ext/transport/chttp2/transport/frame_goaway.cc',
+ 'src/core/ext/transport/chttp2/transport/frame_ping.cc',
+ 'src/core/ext/transport/chttp2/transport/frame_rst_stream.cc',
+ 'src/core/ext/transport/chttp2/transport/frame_settings.cc',
+ 'src/core/ext/transport/chttp2/transport/frame_window_update.cc',
+ 'src/core/ext/transport/chttp2/transport/hpack_encoder.cc',
+ 'src/core/ext/transport/chttp2/transport/hpack_parser.cc',
+ 'src/core/ext/transport/chttp2/transport/hpack_table.cc',
+ 'src/core/ext/transport/chttp2/transport/http2_settings.cc',
+ 'src/core/ext/transport/chttp2/transport/huffsyms.cc',
+ 'src/core/ext/transport/chttp2/transport/incoming_metadata.cc',
+ 'src/core/ext/transport/chttp2/transport/parsing.cc',
+ 'src/core/ext/transport/chttp2/transport/stream_lists.cc',
+ 'src/core/ext/transport/chttp2/transport/stream_map.cc',
+ 'src/core/ext/transport/chttp2/transport/varint.cc',
+ 'src/core/ext/transport/chttp2/transport/writing.cc',
+ 'src/core/ext/transport/chttp2/alpn/alpn.cc',
+ 'src/core/ext/filters/http/client/http_client_filter.cc',
+ 'src/core/ext/filters/http/http_filters_plugin.cc',
+ 'src/core/ext/filters/http/message_compress/message_compress_filter.cc',
+ 'src/core/ext/filters/http/server/http_server_filter.cc',
+ 'src/core/lib/http/httpcli_security_connector.cc',
+ 'src/core/lib/security/context/security_context.cc',
+ 'src/core/lib/security/credentials/composite/composite_credentials.cc',
+ 'src/core/lib/security/credentials/credentials.cc',
+ 'src/core/lib/security/credentials/credentials_metadata.cc',
+ 'src/core/lib/security/credentials/fake/fake_credentials.cc',
+ 'src/core/lib/security/credentials/google_default/credentials_generic.cc',
+ 'src/core/lib/security/credentials/google_default/google_default_credentials.cc',
+ 'src/core/lib/security/credentials/iam/iam_credentials.cc',
+ 'src/core/lib/security/credentials/jwt/json_token.cc',
+ 'src/core/lib/security/credentials/jwt/jwt_credentials.cc',
+ 'src/core/lib/security/credentials/jwt/jwt_verifier.cc',
+ 'src/core/lib/security/credentials/oauth2/oauth2_credentials.cc',
+ 'src/core/lib/security/credentials/plugin/plugin_credentials.cc',
+ 'src/core/lib/security/credentials/ssl/ssl_credentials.cc',
+ 'src/core/lib/security/transport/client_auth_filter.cc',
+ 'src/core/lib/security/transport/lb_targets_info.cc',
+ 'src/core/lib/security/transport/secure_endpoint.cc',
+ 'src/core/lib/security/transport/security_connector.cc',
+ 'src/core/lib/security/transport/security_handshaker.cc',
+ 'src/core/lib/security/transport/server_auth_filter.cc',
+ 'src/core/lib/security/transport/tsi_error.cc',
+ 'src/core/lib/security/util/json_util.cc',
+ 'src/core/lib/surface/init_secure.cc',
+ 'src/core/tsi/fake_transport_security.cc',
+ 'src/core/tsi/gts_transport_security.cc',
+ 'src/core/tsi/ssl_transport_security.cc',
+ 'src/core/tsi/transport_security_grpc.cc',
+ 'src/core/tsi/transport_security.cc',
+ 'src/core/tsi/transport_security_adapter.cc',
+ 'src/core/ext/transport/chttp2/server/chttp2_server.cc',
+ 'src/core/ext/transport/chttp2/client/secure/secure_channel_create.cc',
+ 'src/core/ext/filters/client_channel/channel_connectivity.cc',
+ 'src/core/ext/filters/client_channel/client_channel.cc',
+ 'src/core/ext/filters/client_channel/client_channel_factory.cc',
+ 'src/core/ext/filters/client_channel/client_channel_plugin.cc',
+ 'src/core/ext/filters/client_channel/connector.cc',
+ 'src/core/ext/filters/client_channel/http_connect_handshaker.cc',
+ 'src/core/ext/filters/client_channel/http_proxy.cc',
+ 'src/core/ext/filters/client_channel/lb_policy.cc',
+ 'src/core/ext/filters/client_channel/lb_policy_factory.cc',
+ 'src/core/ext/filters/client_channel/lb_policy_registry.cc',
+ 'src/core/ext/filters/client_channel/parse_address.cc',
+ 'src/core/ext/filters/client_channel/proxy_mapper.cc',
+ 'src/core/ext/filters/client_channel/proxy_mapper_registry.cc',
+ 'src/core/ext/filters/client_channel/resolver.cc',
+ 'src/core/ext/filters/client_channel/resolver_factory.cc',
+ 'src/core/ext/filters/client_channel/resolver_registry.cc',
+ 'src/core/ext/filters/client_channel/retry_throttle.cc',
+ 'src/core/ext/filters/client_channel/subchannel.cc',
+ 'src/core/ext/filters/client_channel/subchannel_index.cc',
+ 'src/core/ext/filters/client_channel/uri_parser.cc',
+ 'src/core/ext/filters/deadline/deadline_filter.cc',
+ 'src/core/ext/transport/chttp2/client/chttp2_connector.cc',
+ 'src/core/ext/transport/chttp2/server/insecure/server_chttp2.cc',
+ 'src/core/ext/transport/chttp2/server/insecure/server_chttp2_posix.cc',
+ 'src/core/ext/transport/chttp2/client/insecure/channel_create.cc',
+ 'src/core/ext/transport/chttp2/client/insecure/channel_create_posix.cc',
+ 'src/core/ext/transport/inproc/inproc_plugin.cc',
+ 'src/core/ext/transport/inproc/inproc_transport.cc',
+ 'src/core/ext/filters/client_channel/lb_policy/grpclb/client_load_reporting_filter.cc',
+ 'src/core/ext/filters/client_channel/lb_policy/grpclb/grpclb.cc',
+ 'src/core/ext/filters/client_channel/lb_policy/grpclb/grpclb_channel_secure.cc',
+ 'src/core/ext/filters/client_channel/lb_policy/grpclb/grpclb_client_stats.cc',
+ 'src/core/ext/filters/client_channel/lb_policy/grpclb/load_balancer_api.cc',
'src/core/ext/filters/client_channel/lb_policy/grpclb/proto/grpc/lb/v1/load_balancer.pb.c',
'third_party/nanopb/pb_common.c',
'third_party/nanopb/pb_decode.c',
'third_party/nanopb/pb_encode.c',
- 'src/core/ext/filters/client_channel/resolver/fake/fake_resolver.c',
- 'src/core/ext/filters/client_channel/lb_policy/pick_first/pick_first.c',
- 'src/core/ext/filters/client_channel/lb_policy/round_robin/round_robin.c',
- 'src/core/ext/filters/client_channel/resolver/dns/c_ares/dns_resolver_ares.c',
- 'src/core/ext/filters/client_channel/resolver/dns/c_ares/grpc_ares_ev_driver_posix.c',
- 'src/core/ext/filters/client_channel/resolver/dns/c_ares/grpc_ares_wrapper.c',
- 'src/core/ext/filters/client_channel/resolver/dns/c_ares/grpc_ares_wrapper_fallback.c',
- 'src/core/ext/filters/client_channel/resolver/dns/native/dns_resolver.c',
- 'src/core/ext/filters/client_channel/resolver/sockaddr/sockaddr_resolver.c',
- 'src/core/ext/filters/load_reporting/server_load_reporting_filter.c',
- 'src/core/ext/filters/load_reporting/server_load_reporting_plugin.c',
- 'src/core/ext/census/base_resources.c',
- 'src/core/ext/census/context.c',
+ 'src/core/ext/filters/client_channel/resolver/fake/fake_resolver.cc',
+ 'src/core/ext/filters/client_channel/lb_policy/pick_first/pick_first.cc',
+ 'src/core/ext/filters/client_channel/lb_policy/round_robin/round_robin.cc',
+ 'src/core/ext/filters/client_channel/resolver/dns/c_ares/dns_resolver_ares.cc',
+ 'src/core/ext/filters/client_channel/resolver/dns/c_ares/grpc_ares_ev_driver_posix.cc',
+ 'src/core/ext/filters/client_channel/resolver/dns/c_ares/grpc_ares_wrapper.cc',
+ 'src/core/ext/filters/client_channel/resolver/dns/c_ares/grpc_ares_wrapper_fallback.cc',
+ 'src/core/ext/filters/client_channel/resolver/dns/native/dns_resolver.cc',
+ 'src/core/ext/filters/client_channel/resolver/sockaddr/sockaddr_resolver.cc',
+ 'src/core/ext/filters/load_reporting/server_load_reporting_filter.cc',
+ 'src/core/ext/filters/load_reporting/server_load_reporting_plugin.cc',
+ 'src/core/ext/census/base_resources.cc',
+ 'src/core/ext/census/context.cc',
'src/core/ext/census/gen/census.pb.c',
'src/core/ext/census/gen/trace_context.pb.c',
- 'src/core/ext/census/grpc_context.c',
- 'src/core/ext/census/grpc_filter.c',
- 'src/core/ext/census/grpc_plugin.c',
- 'src/core/ext/census/initialize.c',
- 'src/core/ext/census/intrusive_hash_map.c',
- 'src/core/ext/census/mlog.c',
- 'src/core/ext/census/operation.c',
- 'src/core/ext/census/placeholders.c',
- 'src/core/ext/census/resource.c',
- 'src/core/ext/census/trace_context.c',
- 'src/core/ext/census/tracing.c',
- 'src/core/ext/filters/max_age/max_age_filter.c',
- 'src/core/ext/filters/message_size/message_size_filter.c',
- 'src/core/ext/filters/workarounds/workaround_cronet_compression_filter.c',
- 'src/core/ext/filters/workarounds/workaround_utils.c',
- 'src/core/plugin_registry/grpc_plugin_registry.c',
+ 'src/core/ext/census/grpc_context.cc',
+ 'src/core/ext/census/grpc_filter.cc',
+ 'src/core/ext/census/grpc_plugin.cc',
+ 'src/core/ext/census/initialize.cc',
+ 'src/core/ext/census/intrusive_hash_map.cc',
+ 'src/core/ext/census/mlog.cc',
+ 'src/core/ext/census/operation.cc',
+ 'src/core/ext/census/placeholders.cc',
+ 'src/core/ext/census/resource.cc',
+ 'src/core/ext/census/trace_context.cc',
+ 'src/core/ext/census/tracing.cc',
+ 'src/core/ext/filters/max_age/max_age_filter.cc',
+ 'src/core/ext/filters/message_size/message_size_filter.cc',
+ 'src/core/ext/filters/workarounds/workaround_cronet_compression_filter.cc',
+ 'src/core/ext/filters/workarounds/workaround_utils.cc',
+ 'src/core/plugin_registry/grpc_plugin_registry.cc',
'src/boringssl/err_data.c',
'third_party/boringssl/crypto/aes/aes.c',
'third_party/boringssl/crypto/aes/key_wrap.c',