aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorGravatar ncteisen <ncteisen@gmail.com>2017-11-16 15:35:45 -0800
committerGravatar ncteisen <ncteisen@gmail.com>2017-11-17 14:08:57 -0800
commitadbfbd5977104987bee9f946f691683b756305e8 (patch)
treee35bcf97ddf6864de5beea7bb903552d4fdd5592
parent90c8cf6acc698ddef1d2da3b205ad8d0014b52fa (diff)
Remove all extern C
-rw-r--r--include/grpc++/impl/codegen/core_codegen_interface.h4
-rw-r--r--include/grpc/census.h8
-rw-r--r--include/grpc/compression.h8
-rw-r--r--include/grpc/grpc.h8
-rw-r--r--include/grpc/grpc_cronet.h8
-rw-r--r--include/grpc/grpc_posix.h8
-rw-r--r--include/grpc/grpc_security.h8
-rw-r--r--include/grpc/grpc_security_constants.h8
-rw-r--r--include/grpc/impl/codegen/atm.h8
-rw-r--r--include/grpc/impl/codegen/atm_gcc_atomic.h8
-rw-r--r--include/grpc/impl/codegen/byte_buffer.h8
-rw-r--r--include/grpc/impl/codegen/byte_buffer_reader.h8
-rw-r--r--include/grpc/impl/codegen/compression_types.h8
-rw-r--r--include/grpc/impl/codegen/connectivity_state.h8
-rw-r--r--include/grpc/impl/codegen/gpr_types.h8
-rw-r--r--include/grpc/impl/codegen/grpc_types.h8
-rw-r--r--include/grpc/impl/codegen/propagation_bits.h8
-rw-r--r--include/grpc/impl/codegen/status.h8
-rw-r--r--include/grpc/impl/codegen/sync.h8
-rw-r--r--include/grpc/load_reporting.h8
-rw-r--r--include/grpc/slice.h8
-rw-r--r--include/grpc/slice_buffer.h8
-rw-r--r--include/grpc/support/alloc.h8
-rw-r--r--include/grpc/support/avl.h8
-rw-r--r--include/grpc/support/cmdline.h8
-rw-r--r--include/grpc/support/cpu.h8
-rw-r--r--include/grpc/support/histogram.h8
-rw-r--r--include/grpc/support/host_port.h8
-rw-r--r--include/grpc/support/log.h8
-rw-r--r--include/grpc/support/log_windows.h8
-rw-r--r--include/grpc/support/string_util.h8
-rw-r--r--include/grpc/support/subprocess.h8
-rw-r--r--include/grpc/support/sync.h8
-rw-r--r--include/grpc/support/thd.h8
-rw-r--r--include/grpc/support/time.h8
-rw-r--r--include/grpc/support/tls_pthread.h8
-rw-r--r--src/core/ext/filters/client_channel/client_channel.h8
-rw-r--r--src/core/ext/filters/client_channel/client_channel_factory.h8
-rw-r--r--src/core/ext/filters/client_channel/client_channel_plugin.cc4
-rw-r--r--src/core/ext/filters/client_channel/connector.h8
-rw-r--r--src/core/ext/filters/client_channel/http_connect_handshaker.h8
-rw-r--r--src/core/ext/filters/client_channel/http_proxy.h8
-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.h8
-rw-r--r--src/core/ext/filters/client_channel/lb_policy/grpclb/grpclb.cc4
-rw-r--r--src/core/ext/filters/client_channel/lb_policy/grpclb/grpclb.h8
-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_client_stats.h8
-rw-r--r--src/core/ext/filters/client_channel/lb_policy/grpclb/load_balancer_api.h8
-rw-r--r--src/core/ext/filters/client_channel/lb_policy/pick_first/pick_first.cc4
-rw-r--r--src/core/ext/filters/client_channel/lb_policy/round_robin/round_robin.cc4
-rw-r--r--src/core/ext/filters/client_channel/lb_policy/subchannel_list.h8
-rw-r--r--src/core/ext/filters/client_channel/lb_policy_factory.h8
-rw-r--r--src/core/ext/filters/client_channel/lb_policy_registry.h8
-rw-r--r--src/core/ext/filters/client_channel/parse_address.h8
-rw-r--r--src/core/ext/filters/client_channel/proxy_mapper.h8
-rw-r--r--src/core/ext/filters/client_channel/proxy_mapper_registry.h8
-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.cc8
-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_wrapper.h8
-rw-r--r--src/core/ext/filters/client_channel/resolver/dns/native/dns_resolver.cc4
-rw-r--r--src/core/ext/filters/client_channel/resolver/fake/fake_resolver.cc4
-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.cc4
-rw-r--r--src/core/ext/filters/client_channel/resolver_factory.h8
-rw-r--r--src/core/ext/filters/client_channel/resolver_registry.h8
-rw-r--r--src/core/ext/filters/client_channel/retry_throttle.h8
-rw-r--r--src/core/ext/filters/client_channel/subchannel.h8
-rw-r--r--src/core/ext/filters/client_channel/subchannel_index.h8
-rw-r--r--src/core/ext/filters/client_channel/uri_parser.h8
-rw-r--r--src/core/ext/filters/deadline/deadline_filter.cc4
-rw-r--r--src/core/ext/filters/deadline/deadline_filter.h8
-rw-r--r--src/core/ext/filters/http/client/http_client_filter.h8
-rw-r--r--src/core/ext/filters/http/http_filters_plugin.cc4
-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.h8
-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.cc4
-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.cc4
-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.cc4
-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.cc4
-rw-r--r--src/core/ext/filters/workarounds/workaround_cronet_compression_filter.h8
-rw-r--r--src/core/ext/filters/workarounds/workaround_utils.h8
-rw-r--r--src/core/ext/transport/chttp2/alpn/alpn.h8
-rw-r--r--src/core/ext/transport/chttp2/client/chttp2_connector.h8
-rw-r--r--src/core/ext/transport/chttp2/server/chttp2_server.h8
-rw-r--r--src/core/ext/transport/chttp2/transport/bin_decoder.h8
-rw-r--r--src/core/ext/transport/chttp2/transport/bin_encoder.h8
-rw-r--r--src/core/ext/transport/chttp2/transport/chttp2_plugin.cc4
-rw-r--r--src/core/ext/transport/chttp2/transport/chttp2_transport.h8
-rw-r--r--src/core/ext/transport/chttp2/transport/flow_control.h2
-rw-r--r--src/core/ext/transport/chttp2/transport/frame.h8
-rw-r--r--src/core/ext/transport/chttp2/transport/frame_data.h8
-rw-r--r--src/core/ext/transport/chttp2/transport/frame_goaway.h8
-rw-r--r--src/core/ext/transport/chttp2/transport/frame_ping.h8
-rw-r--r--src/core/ext/transport/chttp2/transport/frame_rst_stream.h8
-rw-r--r--src/core/ext/transport/chttp2/transport/frame_settings.h8
-rw-r--r--src/core/ext/transport/chttp2/transport/frame_window_update.h8
-rw-r--r--src/core/ext/transport/chttp2/transport/hpack_encoder.h8
-rw-r--r--src/core/ext/transport/chttp2/transport/hpack_parser.h8
-rw-r--r--src/core/ext/transport/chttp2/transport/hpack_table.h8
-rw-r--r--src/core/ext/transport/chttp2/transport/http2_settings.h8
-rw-r--r--src/core/ext/transport/chttp2/transport/huffsyms.h8
-rw-r--r--src/core/ext/transport/chttp2/transport/incoming_metadata.h8
-rw-r--r--src/core/ext/transport/chttp2/transport/internal.h8
-rw-r--r--src/core/ext/transport/chttp2/transport/stream_map.h8
-rw-r--r--src/core/ext/transport/chttp2/transport/varint.h8
-rw-r--r--src/core/ext/transport/cronet/transport/cronet_transport.h8
-rw-r--r--src/core/ext/transport/inproc/inproc_plugin.cc4
-rw-r--r--src/core/ext/transport/inproc/inproc_transport.h8
-rw-r--r--src/core/lib/backoff/backoff.h8
-rw-r--r--src/core/lib/channel/channel_args.h8
-rw-r--r--src/core/lib/channel/channel_stack.h8
-rw-r--r--src/core/lib/channel/channel_stack_builder.h8
-rw-r--r--src/core/lib/channel/connected_channel.h8
-rw-r--r--src/core/lib/channel/handshaker.h8
-rw-r--r--src/core/lib/channel/handshaker_factory.h8
-rw-r--r--src/core/lib/channel/handshaker_registry.h8
-rw-r--r--src/core/lib/compression/algorithm_metadata.h8
-rw-r--r--src/core/lib/compression/message_compress.h8
-rw-r--r--src/core/lib/compression/stream_compression.h8
-rw-r--r--src/core/lib/compression/stream_compression_gzip.h8
-rw-r--r--src/core/lib/compression/stream_compression_identity.h8
-rw-r--r--src/core/lib/debug/stats.h8
-rw-r--r--src/core/lib/debug/stats_data.h8
-rw-r--r--src/core/lib/debug/trace.h8
-rw-r--r--src/core/lib/http/format_request.h8
-rw-r--r--src/core/lib/http/httpcli.h8
-rw-r--r--src/core/lib/http/parser.h8
-rw-r--r--src/core/lib/iomgr/block_annotate.h8
-rw-r--r--src/core/lib/iomgr/call_combiner.h8
-rw-r--r--src/core/lib/iomgr/combiner.h8
-rw-r--r--src/core/lib/iomgr/endpoint.h8
-rw-r--r--src/core/lib/iomgr/endpoint_pair.h8
-rw-r--r--src/core/lib/iomgr/error.h8
-rw-r--r--src/core/lib/iomgr/error_internal.h8
-rw-r--r--src/core/lib/iomgr/ev_epoll1_linux.h8
-rw-r--r--src/core/lib/iomgr/ev_epollex_linux.h8
-rw-r--r--src/core/lib/iomgr/ev_epollsig_linux.h8
-rw-r--r--src/core/lib/iomgr/ev_poll_posix.h8
-rw-r--r--src/core/lib/iomgr/ev_posix.cc3
-rw-r--r--src/core/lib/iomgr/ev_posix.h8
-rw-r--r--src/core/lib/iomgr/exec_ctx.h8
-rw-r--r--src/core/lib/iomgr/executor.h8
-rw-r--r--src/core/lib/iomgr/gethostname.h8
-rw-r--r--src/core/lib/iomgr/iocp_windows.h8
-rw-r--r--src/core/lib/iomgr/iomgr.h8
-rw-r--r--src/core/lib/iomgr/iomgr_internal.h8
-rw-r--r--src/core/lib/iomgr/iomgr_uv.h8
-rw-r--r--src/core/lib/iomgr/is_epollexclusive_available.h8
-rw-r--r--src/core/lib/iomgr/load_file.h8
-rw-r--r--src/core/lib/iomgr/polling_entity.h8
-rw-r--r--src/core/lib/iomgr/pollset.h8
-rw-r--r--src/core/lib/iomgr/pollset_set.h8
-rw-r--r--src/core/lib/iomgr/pollset_uv.h8
-rw-r--r--src/core/lib/iomgr/pollset_windows.h8
-rw-r--r--src/core/lib/iomgr/resolve_address.h8
-rw-r--r--src/core/lib/iomgr/resource_quota.h8
-rw-r--r--src/core/lib/iomgr/sockaddr_utils.h8
-rw-r--r--src/core/lib/iomgr/socket_factory_posix.h8
-rw-r--r--src/core/lib/iomgr/socket_mutator.h8
-rw-r--r--src/core/lib/iomgr/socket_utils.h8
-rw-r--r--src/core/lib/iomgr/socket_utils_posix.h8
-rw-r--r--src/core/lib/iomgr/socket_windows.h8
-rw-r--r--src/core/lib/iomgr/tcp_client.h8
-rw-r--r--src/core/lib/iomgr/tcp_client_posix.cc2
-rw-r--r--src/core/lib/iomgr/tcp_client_posix.h8
-rw-r--r--src/core/lib/iomgr/tcp_client_windows.cc2
-rw-r--r--src/core/lib/iomgr/tcp_posix.h8
-rw-r--r--src/core/lib/iomgr/tcp_server.h8
-rw-r--r--src/core/lib/iomgr/tcp_server_utils_posix.h8
-rw-r--r--src/core/lib/iomgr/tcp_uv.h8
-rw-r--r--src/core/lib/iomgr/tcp_windows.h8
-rw-r--r--src/core/lib/iomgr/time_averaged_stats.h8
-rw-r--r--src/core/lib/iomgr/timer.h8
-rw-r--r--src/core/lib/iomgr/timer_generic.cc2
-rw-r--r--src/core/lib/iomgr/timer_heap.h8
-rw-r--r--src/core/lib/iomgr/timer_manager.h8
-rw-r--r--src/core/lib/iomgr/timer_uv.cc2
-rw-r--r--src/core/lib/iomgr/udp_server.h8
-rw-r--r--src/core/lib/iomgr/unix_sockets_posix.h8
-rw-r--r--src/core/lib/iomgr/wakeup_fd_cv.h8
-rw-r--r--src/core/lib/iomgr/wakeup_fd_pipe.h8
-rw-r--r--src/core/lib/iomgr/wakeup_fd_posix.h8
-rw-r--r--src/core/lib/json/json.h8
-rw-r--r--src/core/lib/json/json_reader.h8
-rw-r--r--src/core/lib/json/json_writer.h8
-rw-r--r--src/core/lib/profiling/timers.h8
-rw-r--r--src/core/lib/security/context/security_context.h8
-rw-r--r--src/core/lib/security/credentials/composite/composite_credentials.h8
-rw-r--r--src/core/lib/security/credentials/credentials.h8
-rw-r--r--src/core/lib/security/credentials/fake/fake_credentials.h8
-rw-r--r--src/core/lib/security/credentials/google_default/google_default_credentials.h8
-rw-r--r--src/core/lib/security/credentials/jwt/json_token.h8
-rw-r--r--src/core/lib/security/credentials/jwt/jwt_credentials.h8
-rw-r--r--src/core/lib/security/credentials/jwt/jwt_verifier.h8
-rw-r--r--src/core/lib/security/credentials/oauth2/oauth2_credentials.h8
-rw-r--r--src/core/lib/security/credentials/ssl/ssl_credentials.h8
-rw-r--r--src/core/lib/security/transport/auth_filters.h8
-rw-r--r--src/core/lib/security/transport/lb_targets_info.h8
-rw-r--r--src/core/lib/security/transport/secure_endpoint.h8
-rw-r--r--src/core/lib/security/transport/security_connector.h8
-rw-r--r--src/core/lib/security/transport/security_handshaker.h8
-rw-r--r--src/core/lib/security/transport/tsi_error.h8
-rw-r--r--src/core/lib/security/util/json_util.h8
-rw-r--r--src/core/lib/slice/b64.h8
-rw-r--r--src/core/lib/slice/percent_encoding.h8
-rw-r--r--src/core/lib/slice/slice_hash_table.h8
-rw-r--r--src/core/lib/slice/slice_internal.h8
-rw-r--r--src/core/lib/slice/slice_string_helpers.h8
-rw-r--r--src/core/lib/slice/slice_traits.h8
-rw-r--r--src/core/lib/support/arena.h8
-rw-r--r--src/core/lib/support/env.h8
-rw-r--r--src/core/lib/support/log.cc2
-rw-r--r--src/core/lib/support/log_android.cc4
-rw-r--r--src/core/lib/support/log_linux.cc2
-rw-r--r--src/core/lib/support/log_posix.cc2
-rw-r--r--src/core/lib/support/log_windows.cc2
-rw-r--r--src/core/lib/support/mpscq.h8
-rw-r--r--src/core/lib/support/murmur_hash.h8
-rw-r--r--src/core/lib/support/stack_lockfree.h8
-rw-r--r--src/core/lib/support/string.h8
-rw-r--r--src/core/lib/support/string_windows.h8
-rw-r--r--src/core/lib/support/time_posix.cc2
-rw-r--r--src/core/lib/support/time_precise.h8
-rw-r--r--src/core/lib/support/time_windows.cc2
-rw-r--r--src/core/lib/support/tmpfile.h8
-rw-r--r--src/core/lib/surface/alarm_internal.h8
-rw-r--r--src/core/lib/surface/api_trace.h8
-rw-r--r--src/core/lib/surface/call.h8
-rw-r--r--src/core/lib/surface/call_test_only.h8
-rw-r--r--src/core/lib/surface/channel.h8
-rw-r--r--src/core/lib/surface/channel_init.h8
-rw-r--r--src/core/lib/surface/channel_stack_type.h8
-rw-r--r--src/core/lib/surface/completion_queue.h8
-rw-r--r--src/core/lib/surface/completion_queue_factory.h8
-rw-r--r--src/core/lib/surface/event_string.h8
-rw-r--r--src/core/lib/surface/init.h8
-rw-r--r--src/core/lib/surface/lame_client.cc4
-rw-r--r--src/core/lib/surface/lame_client.h8
-rw-r--r--src/core/lib/surface/server.h8
-rw-r--r--src/core/lib/surface/validate_metadata.h8
-rw-r--r--src/core/lib/transport/byte_stream.h8
-rw-r--r--src/core/lib/transport/connectivity_state.h8
-rw-r--r--src/core/lib/transport/error_utils.h8
-rw-r--r--src/core/lib/transport/metadata.h8
-rw-r--r--src/core/lib/transport/metadata_batch.h8
-rw-r--r--src/core/lib/transport/service_config.h8
-rw-r--r--src/core/lib/transport/static_metadata.h8
-rw-r--r--src/core/lib/transport/status_conversion.h8
-rw-r--r--src/core/lib/transport/timeout_encoding.h8
-rw-r--r--src/core/lib/transport/transport.h8
-rw-r--r--src/core/lib/transport/transport_impl.h8
-rw-r--r--src/core/plugin_registry/grpc_cronet_plugin_registry.cc24
-rw-r--r--src/core/plugin_registry/grpc_plugin_registry.cc68
-rw-r--r--src/core/plugin_registry/grpc_unsecure_plugin_registry.cc64
-rw-r--r--src/core/tsi/fake_transport_security.h8
-rw-r--r--src/core/tsi/gts_transport_security.cc4
-rw-r--r--src/core/tsi/gts_transport_security.h8
-rw-r--r--src/core/tsi/ssl_transport_security.h8
-rw-r--r--src/core/tsi/ssl_types.h8
-rw-r--r--src/core/tsi/transport_security.h8
-rw-r--r--src/core/tsi/transport_security_adapter.h8
-rw-r--r--src/core/tsi/transport_security_grpc.h8
-rw-r--r--src/core/tsi/transport_security_interface.h8
-rw-r--r--src/cpp/common/channel_arguments.cc3
-rw-r--r--src/cpp/common/channel_filter.cc2
-rw-r--r--src/cpp/common/channel_filter.h2
-rw-r--r--src/cpp/common/core_codegen.cc2
-rw-r--r--templates/src/core/plugin_registry.template4
-rw-r--r--test/core/end2end/cq_verifier.h8
-rw-r--r--test/core/end2end/data/ssl_test_data.h8
-rw-r--r--test/core/end2end/end2end_tests.h8
-rw-r--r--test/core/end2end/fuzzers/api_fuzzer.cc2
-rw-r--r--test/core/end2end/tests/no_logging.cc2
-rw-r--r--test/core/util/port.h8
-rw-r--r--test/core/util/test_config.h8
-rw-r--r--test/cpp/client/client_channel_stress_test.cc2
-rw-r--r--test/cpp/interop/stress_test.cc2
283 files changed, 602 insertions, 1596 deletions
diff --git a/include/grpc++/impl/codegen/core_codegen_interface.h b/include/grpc++/impl/codegen/core_codegen_interface.h
index 1949cdab76..d7ad7a4b57 100644
--- a/include/grpc++/impl/codegen/core_codegen_interface.h
+++ b/include/grpc++/impl/codegen/core_codegen_interface.h
@@ -25,10 +25,6 @@
#include <grpc/impl/codegen/grpc_types.h>
#include <grpc/impl/codegen/sync.h>
-extern "C" {
-struct grpc_byte_buffer;
-}
-
namespace grpc {
/// Interface between the codegen library and the minimal subset of core
diff --git a/include/grpc/census.h b/include/grpc/census.h
index 2258af8898..d7f2fab50b 100644
--- a/include/grpc/census.h
+++ b/include/grpc/census.h
@@ -21,9 +21,7 @@
#include <grpc/grpc.h>
-#ifdef __cplusplus
-extern "C" {
-#endif
+
/**
A Census Context is a handle used by Census to represent the current tracing
@@ -31,8 +29,6 @@ extern "C" {
(this is the responsibility of the local RPC system). */
typedef struct census_context census_context;
-#ifdef __cplusplus
-}
-#endif
+
#endif /* GRPC_CENSUS_H */
diff --git a/include/grpc/compression.h b/include/grpc/compression.h
index b42f428d7d..c0db8c2bfa 100644
--- a/include/grpc/compression.h
+++ b/include/grpc/compression.h
@@ -26,9 +26,7 @@
#include <grpc/impl/codegen/compression_types.h>
#include <grpc/slice.h>
-#ifdef __cplusplus
-extern "C" {
-#endif
+
/** Parses the \a slice as a grpc_compression_algorithm instance and updating \a
* algorithm. Returns 1 upon success, 0 otherwise. */
@@ -85,8 +83,6 @@ GRPCAPI int grpc_compression_options_is_stream_compression_algorithm_enabled(
const grpc_compression_options* opts,
grpc_stream_compression_algorithm algorithm);
-#ifdef __cplusplus
-}
-#endif
+
#endif /* GRPC_COMPRESSION_H */
diff --git a/include/grpc/grpc.h b/include/grpc/grpc.h
index f083bc591e..6d6d56a7b3 100644
--- a/include/grpc/grpc.h
+++ b/include/grpc/grpc.h
@@ -29,9 +29,7 @@
#include <grpc/support/time.h>
#include <stddef.h>
-#ifdef __cplusplus
-extern "C" {
-#endif
+
/*! \mainpage GRPC Core
*
@@ -466,8 +464,6 @@ GRPCAPI void grpc_resource_quota_resize(grpc_resource_quota* resource_quota,
*/
GRPCAPI const grpc_arg_pointer_vtable* grpc_resource_quota_arg_vtable(void);
-#ifdef __cplusplus
-}
-#endif
+
#endif /* GRPC_GRPC_H */
diff --git a/include/grpc/grpc_cronet.h b/include/grpc/grpc_cronet.h
index 127d5d038d..b3e7ec2705 100644
--- a/include/grpc/grpc_cronet.h
+++ b/include/grpc/grpc_cronet.h
@@ -21,16 +21,12 @@
#include <grpc/grpc.h>
-#ifdef __cplusplus
-extern "C" {
-#endif
+
GRPCAPI grpc_channel* grpc_cronet_secure_channel_create(
void* engine, const char* target, const grpc_channel_args* args,
void* reserved);
-#ifdef __cplusplus
-}
-#endif
+
#endif /* GRPC_GRPC_CRONET_H */
diff --git a/include/grpc/grpc_posix.h b/include/grpc/grpc_posix.h
index fa7ebced3f..f14cbaa81b 100644
--- a/include/grpc/grpc_posix.h
+++ b/include/grpc/grpc_posix.h
@@ -24,9 +24,7 @@
#include <stddef.h>
-#ifdef __cplusplus
-extern "C" {
-#endif
+
/*! \mainpage GRPC Core POSIX
*
@@ -59,8 +57,6 @@ GRPCAPI void grpc_server_add_insecure_channel_from_fd(grpc_server* server,
- This API is optional but if called, it MUST be called before grpc_init() */
GRPCAPI void grpc_use_signal(int signum);
-#ifdef __cplusplus
-}
-#endif
+
#endif /* GRPC_GRPC_POSIX_H */
diff --git a/include/grpc/grpc_security.h b/include/grpc/grpc_security.h
index 7e87217de7..f2a05074c2 100644
--- a/include/grpc/grpc_security.h
+++ b/include/grpc/grpc_security.h
@@ -23,9 +23,7 @@
#include <grpc/grpc_security_constants.h>
#include <grpc/status.h>
-#ifdef __cplusplus
-extern "C" {
-#endif
+
/** --- Authentication Context. --- */
@@ -461,8 +459,6 @@ typedef struct {
GRPCAPI void grpc_server_credentials_set_auth_metadata_processor(
grpc_server_credentials* creds, grpc_auth_metadata_processor processor);
-#ifdef __cplusplus
-}
-#endif
+
#endif /* GRPC_GRPC_SECURITY_H */
diff --git a/include/grpc/grpc_security_constants.h b/include/grpc/grpc_security_constants.h
index 60e167eb88..1923525ea0 100644
--- a/include/grpc/grpc_security_constants.h
+++ b/include/grpc/grpc_security_constants.h
@@ -19,9 +19,7 @@
#ifndef GRPC_GRPC_SECURITY_CONSTANTS_H
#define GRPC_GRPC_SECURITY_CONSTANTS_H
-#ifdef __cplusplus
-extern "C" {
-#endif
+
#define GRPC_TRANSPORT_SECURITY_TYPE_PROPERTY_NAME "transport_security_type"
#define GRPC_SSL_TRANSPORT_SECURITY_TYPE "ssl"
@@ -99,8 +97,6 @@ typedef enum {
GRPC_SSL_REQUEST_AND_REQUIRE_CLIENT_CERTIFICATE_AND_VERIFY
} grpc_ssl_client_certificate_request_type;
-#ifdef __cplusplus
-}
-#endif
+
#endif /* GRPC_GRPC_SECURITY_CONSTANTS_H */
diff --git a/include/grpc/impl/codegen/atm.h b/include/grpc/impl/codegen/atm.h
index 00d83f0604..7bb41c55d2 100644
--- a/include/grpc/impl/codegen/atm.h
+++ b/include/grpc/impl/codegen/atm.h
@@ -79,17 +79,13 @@
#error could not determine platform for atm
#endif
-#ifdef __cplusplus
-extern "C" {
-#endif
+
/** Adds \a delta to \a *value, clamping the result to the range specified
by \a min and \a max. Returns the new value. */
gpr_atm gpr_atm_no_barrier_clamped_add(gpr_atm* value, gpr_atm delta,
gpr_atm min, gpr_atm max);
-#ifdef __cplusplus
-}
-#endif
+
#endif /* GRPC_IMPL_CODEGEN_ATM_H */
diff --git a/include/grpc/impl/codegen/atm_gcc_atomic.h b/include/grpc/impl/codegen/atm_gcc_atomic.h
index 5879708548..52eebb3c72 100644
--- a/include/grpc/impl/codegen/atm_gcc_atomic.h
+++ b/include/grpc/impl/codegen/atm_gcc_atomic.h
@@ -23,9 +23,7 @@
__atomic_* interface. */
#include <grpc/impl/codegen/port_platform.h>
-#ifdef __cplusplus
-extern "C" {
-#endif
+
typedef intptr_t gpr_atm;
#define GPR_ATM_MAX INTPTR_MAX
@@ -84,8 +82,6 @@ static __inline int gpr_atm_full_cas(gpr_atm* p, gpr_atm o, gpr_atm n) {
#define gpr_atm_full_xchg(p, n) \
GPR_ATM_INC_CAS_THEN(__atomic_exchange_n((p), (n), __ATOMIC_ACQ_REL))
-#ifdef __cplusplus
-}
-#endif
+
#endif /* GRPC_IMPL_CODEGEN_ATM_GCC_ATOMIC_H */
diff --git a/include/grpc/impl/codegen/byte_buffer.h b/include/grpc/impl/codegen/byte_buffer.h
index f8dfbd1d7d..082fb9b36f 100644
--- a/include/grpc/impl/codegen/byte_buffer.h
+++ b/include/grpc/impl/codegen/byte_buffer.h
@@ -21,9 +21,7 @@
#include <grpc/impl/codegen/grpc_types.h>
-#ifdef __cplusplus
-extern "C" {
-#endif
+
/** Returns a RAW byte buffer instance over the given slices (up to \a nslices).
*
@@ -79,8 +77,6 @@ grpc_byte_buffer_reader_readall(grpc_byte_buffer_reader* reader);
GRPCAPI grpc_byte_buffer* grpc_raw_byte_buffer_from_reader(
grpc_byte_buffer_reader* reader);
-#ifdef __cplusplus
-}
-#endif
+
#endif /* GRPC_IMPL_CODEGEN_BYTE_BUFFER_H */
diff --git a/include/grpc/impl/codegen/byte_buffer_reader.h b/include/grpc/impl/codegen/byte_buffer_reader.h
index e06e19558a..adb64e7831 100644
--- a/include/grpc/impl/codegen/byte_buffer_reader.h
+++ b/include/grpc/impl/codegen/byte_buffer_reader.h
@@ -19,9 +19,7 @@
#ifndef GRPC_IMPL_CODEGEN_BYTE_BUFFER_READER_H
#define GRPC_IMPL_CODEGEN_BYTE_BUFFER_READER_H
-#ifdef __cplusplus
-extern "C" {
-#endif
+
struct grpc_byte_buffer;
@@ -35,8 +33,6 @@ struct grpc_byte_buffer_reader {
} current;
};
-#ifdef __cplusplus
-}
-#endif
+
#endif /* GRPC_IMPL_CODEGEN_BYTE_BUFFER_READER_H */
diff --git a/include/grpc/impl/codegen/compression_types.h b/include/grpc/impl/codegen/compression_types.h
index 4419e2a447..ad19ea6b31 100644
--- a/include/grpc/impl/codegen/compression_types.h
+++ b/include/grpc/impl/codegen/compression_types.h
@@ -21,9 +21,7 @@
#include <grpc/impl/codegen/port_platform.h>
-#ifdef __cplusplus
-extern "C" {
-#endif
+
/** To be used as initial metadata key for the request of a concrete compression
* algorithm */
@@ -157,8 +155,6 @@ typedef struct grpc_compression_options {
} grpc_compression_options;
-#ifdef __cplusplus
-}
-#endif
+
#endif /* GRPC_IMPL_CODEGEN_COMPRESSION_TYPES_H */
diff --git a/include/grpc/impl/codegen/connectivity_state.h b/include/grpc/impl/codegen/connectivity_state.h
index b70dbef356..713652de24 100644
--- a/include/grpc/impl/codegen/connectivity_state.h
+++ b/include/grpc/impl/codegen/connectivity_state.h
@@ -19,9 +19,7 @@
#ifndef GRPC_IMPL_CODEGEN_CONNECTIVITY_STATE_H
#define GRPC_IMPL_CODEGEN_CONNECTIVITY_STATE_H
-#ifdef __cplusplus
-extern "C" {
-#endif
+
/** Connectivity state of a channel. */
typedef enum {
@@ -37,8 +35,6 @@ typedef enum {
GRPC_CHANNEL_SHUTDOWN
} grpc_connectivity_state;
-#ifdef __cplusplus
-}
-#endif
+
#endif /* GRPC_IMPL_CODEGEN_CONNECTIVITY_STATE_H */
diff --git a/include/grpc/impl/codegen/gpr_types.h b/include/grpc/impl/codegen/gpr_types.h
index d7bb54527e..153d4ec7db 100644
--- a/include/grpc/impl/codegen/gpr_types.h
+++ b/include/grpc/impl/codegen/gpr_types.h
@@ -23,9 +23,7 @@
#include <stddef.h>
-#ifdef __cplusplus
-extern "C" {
-#endif
+
/** The clocks we support. */
typedef enum {
@@ -52,8 +50,6 @@ typedef struct gpr_timespec {
gpr_clock_type clock_type;
} gpr_timespec;
-#ifdef __cplusplus
-}
-#endif
+
#endif /* GRPC_IMPL_CODEGEN_GPR_TYPES_H */
diff --git a/include/grpc/impl/codegen/grpc_types.h b/include/grpc/impl/codegen/grpc_types.h
index 03be610d25..faa21a4e40 100644
--- a/include/grpc/impl/codegen/grpc_types.h
+++ b/include/grpc/impl/codegen/grpc_types.h
@@ -29,9 +29,7 @@
#include <stddef.h>
-#ifdef __cplusplus
-extern "C" {
-#endif
+
typedef enum {
GRPC_BB_RAW
@@ -628,8 +626,6 @@ typedef struct grpc_completion_queue_attributes {
/** The completion queue factory structure is opaque to the callers of grpc */
typedef struct grpc_completion_queue_factory grpc_completion_queue_factory;
-#ifdef __cplusplus
-}
-#endif
+
#endif /* GRPC_IMPL_CODEGEN_GRPC_TYPES_H */
diff --git a/include/grpc/impl/codegen/propagation_bits.h b/include/grpc/impl/codegen/propagation_bits.h
index 824bdbd8c9..4eac3806fc 100644
--- a/include/grpc/impl/codegen/propagation_bits.h
+++ b/include/grpc/impl/codegen/propagation_bits.h
@@ -21,9 +21,7 @@
#include <grpc/impl/codegen/port_platform.h>
-#ifdef __cplusplus
-extern "C" {
-#endif
+
/** Propagation bits: this can be bitwise or-ed to form propagation_mask for
* grpc_call */
@@ -45,8 +43,6 @@ extern "C" {
0xffff | GRPC_PROPAGATE_DEADLINE | GRPC_PROPAGATE_CENSUS_STATS_CONTEXT | \
GRPC_PROPAGATE_CENSUS_TRACING_CONTEXT | GRPC_PROPAGATE_CANCELLATION)))
-#ifdef __cplusplus
-}
-#endif
+
#endif /* GRPC_IMPL_CODEGEN_PROPAGATION_BITS_H */
diff --git a/include/grpc/impl/codegen/status.h b/include/grpc/impl/codegen/status.h
index 9bc3dc9560..4f1bce3a92 100644
--- a/include/grpc/impl/codegen/status.h
+++ b/include/grpc/impl/codegen/status.h
@@ -19,9 +19,7 @@
#ifndef GRPC_IMPL_CODEGEN_STATUS_H
#define GRPC_IMPL_CODEGEN_STATUS_H
-#ifdef __cplusplus
-extern "C" {
-#endif
+
typedef enum {
/** Not an error; returned on success */
@@ -146,8 +144,6 @@ typedef enum {
GRPC_STATUS__DO_NOT_USE = -1
} grpc_status_code;
-#ifdef __cplusplus
-}
-#endif
+
#endif /* GRPC_IMPL_CODEGEN_STATUS_H */
diff --git a/include/grpc/impl/codegen/sync.h b/include/grpc/impl/codegen/sync.h
index 6cdb0c5153..b9cd7204c0 100644
--- a/include/grpc/impl/codegen/sync.h
+++ b/include/grpc/impl/codegen/sync.h
@@ -37,9 +37,7 @@
provides no memory barriers.
*/
-#ifdef __cplusplus
-extern "C" {
-#endif
+
/* Platform-specific type declarations of gpr_mu and gpr_cv. */
#include <grpc/impl/codegen/port_platform.h>
@@ -55,8 +53,6 @@ extern "C" {
#error Unable to determine platform for sync
#endif
-#ifdef __cplusplus
-}
-#endif
+
#endif /* GRPC_IMPL_CODEGEN_SYNC_H */
diff --git a/include/grpc/load_reporting.h b/include/grpc/load_reporting.h
index 55f50ea85e..23ae315a89 100644
--- a/include/grpc/load_reporting.h
+++ b/include/grpc/load_reporting.h
@@ -21,9 +21,7 @@
#include <grpc/impl/codegen/port_platform.h>
-#ifdef __cplusplus
-extern "C" {
-#endif
+
/** Metadata key for the gRPC LB load balancer token.
*
@@ -41,8 +39,6 @@ extern "C" {
* call. */
#define GRPC_LB_COST_MD_KEY "lb-cost-bin"
-#ifdef __cplusplus
-}
-#endif
+
#endif /* GRPC_LOAD_REPORTING_H */
diff --git a/include/grpc/slice.h b/include/grpc/slice.h
index 10b6a624b3..dd188d6849 100644
--- a/include/grpc/slice.h
+++ b/include/grpc/slice.h
@@ -22,9 +22,7 @@
#include <grpc/impl/codegen/slice.h>
#include <grpc/support/sync.h>
-#ifdef __cplusplus
-extern "C" {
-#endif
+
/** Increment the refcount of s. Requires slice is initialized.
Returns s. */
@@ -163,8 +161,6 @@ GPRAPI grpc_slice grpc_slice_dup(grpc_slice a);
NULL's. Returned string must be freed with gpr_free. */
GPRAPI char* grpc_slice_to_c_string(grpc_slice s);
-#ifdef __cplusplus
-}
-#endif
+
#endif /* GRPC_SLICE_H */
diff --git a/include/grpc/slice_buffer.h b/include/grpc/slice_buffer.h
index 6510c151b3..4ba9f600a5 100644
--- a/include/grpc/slice_buffer.h
+++ b/include/grpc/slice_buffer.h
@@ -21,9 +21,7 @@
#include <grpc/slice.h>
-#ifdef __cplusplus
-extern "C" {
-#endif
+
/** initialize a slice buffer */
GPRAPI void grpc_slice_buffer_init(grpc_slice_buffer* sb);
@@ -76,8 +74,6 @@ GPRAPI grpc_slice grpc_slice_buffer_take_first(grpc_slice_buffer* src);
GPRAPI void grpc_slice_buffer_undo_take_first(grpc_slice_buffer* src,
grpc_slice slice);
-#ifdef __cplusplus
-}
-#endif
+
#endif /* GRPC_SLICE_BUFFER_H */
diff --git a/include/grpc/support/alloc.h b/include/grpc/support/alloc.h
index 31cb225638..d9398a2902 100644
--- a/include/grpc/support/alloc.h
+++ b/include/grpc/support/alloc.h
@@ -23,9 +23,7 @@
#include <grpc/impl/codegen/port_platform.h>
-#ifdef __cplusplus
-extern "C" {
-#endif
+
typedef struct gpr_allocation_functions {
void* (*malloc_fn)(size_t size);
@@ -60,8 +58,6 @@ GPRAPI void gpr_set_allocation_functions(gpr_allocation_functions functions);
/** Return the family of allocation functions currently in effect. */
GPRAPI gpr_allocation_functions gpr_get_allocation_functions();
-#ifdef __cplusplus
-}
-#endif
+
#endif /* GRPC_SUPPORT_ALLOC_H */
diff --git a/include/grpc/support/avl.h b/include/grpc/support/avl.h
index b5a8c0ffa1..d43196f99b 100644
--- a/include/grpc/support/avl.h
+++ b/include/grpc/support/avl.h
@@ -21,9 +21,7 @@
#include <grpc/support/sync.h>
-#ifdef __cplusplus
-extern "C" {
-#endif
+
/** internal node of an AVL tree */
typedef struct gpr_avl_node {
@@ -95,8 +93,6 @@ GPRAPI int gpr_avl_maybe_get(gpr_avl avl, void* key, void** value,
/** Return 1 if avl is empty, 0 otherwise */
GPRAPI int gpr_avl_is_empty(gpr_avl avl);
-#ifdef __cplusplus
-}
-#endif
+
#endif /* GRPC_SUPPORT_AVL_H */
diff --git a/include/grpc/support/cmdline.h b/include/grpc/support/cmdline.h
index c34a109fbd..e242eb592b 100644
--- a/include/grpc/support/cmdline.h
+++ b/include/grpc/support/cmdline.h
@@ -21,9 +21,7 @@
#include <grpc/support/port_platform.h>
-#ifdef __cplusplus
-extern "C" {
-#endif
+
/** Simple command line parser.
@@ -81,8 +79,6 @@ GPRAPI void gpr_cmdline_destroy(gpr_cmdline* cl);
/** Get a string describing usage */
GPRAPI char* gpr_cmdline_usage_string(gpr_cmdline* cl, const char* argv0);
-#ifdef __cplusplus
-}
-#endif
+
#endif /* GRPC_SUPPORT_CMDLINE_H */
diff --git a/include/grpc/support/cpu.h b/include/grpc/support/cpu.h
index f0e898e859..dbc7c92993 100644
--- a/include/grpc/support/cpu.h
+++ b/include/grpc/support/cpu.h
@@ -21,9 +21,7 @@
#include <grpc/support/port_platform.h>
-#ifdef __cplusplus
-extern "C" {
-#endif
+
/** Interface providing CPU information for currently running system */
@@ -37,8 +35,6 @@ GPRAPI unsigned gpr_cpu_num_cores(void);
[0, gpr_cpu_num_cores() - 1] */
GPRAPI unsigned gpr_cpu_current_cpu(void);
-#ifdef __cplusplus
-} // extern "C"
-#endif
+
#endif /* GRPC_SUPPORT_CPU_H */
diff --git a/include/grpc/support/histogram.h b/include/grpc/support/histogram.h
index d2794d847e..cc08cfa688 100644
--- a/include/grpc/support/histogram.h
+++ b/include/grpc/support/histogram.h
@@ -22,9 +22,7 @@
#include <grpc/support/port_platform.h>
#include <stddef.h>
-#ifdef __cplusplus
-extern "C" {
-#endif
+
typedef struct gpr_histogram gpr_histogram;
@@ -57,8 +55,6 @@ GPRAPI void gpr_histogram_merge_contents(gpr_histogram* histogram,
double max_seen, double sum,
double sum_of_squares, double count);
-#ifdef __cplusplus
-}
-#endif
+
#endif /* GRPC_SUPPORT_HISTOGRAM_H */
diff --git a/include/grpc/support/host_port.h b/include/grpc/support/host_port.h
index 9805811bfb..7880b642b5 100644
--- a/include/grpc/support/host_port.h
+++ b/include/grpc/support/host_port.h
@@ -21,9 +21,7 @@
#include <grpc/support/port_platform.h>
-#ifdef __cplusplus
-extern "C" {
-#endif
+
/** Given a host and port, creates a newly-allocated string of the form
"host:port" or "[ho:st]:port", depending on whether the host contains colons
@@ -44,8 +42,6 @@ GPRAPI int gpr_join_host_port(char** out, const char* host, int port);
failure. */
GPRAPI int gpr_split_host_port(const char* name, char** host, char** port);
-#ifdef __cplusplus
-}
-#endif
+
#endif /* GRPC_SUPPORT_HOST_PORT_H */
diff --git a/include/grpc/support/log.h b/include/grpc/support/log.h
index 497cca9081..af8e623130 100644
--- a/include/grpc/support/log.h
+++ b/include/grpc/support/log.h
@@ -25,9 +25,7 @@
#include <grpc/impl/codegen/port_platform.h>
-#ifdef __cplusplus
-extern "C" {
-#endif
+
/** GPR log API.
@@ -96,8 +94,6 @@ GPRAPI void gpr_set_log_function(gpr_log_func func);
} \
} while (0)
-#ifdef __cplusplus
-}
-#endif
+
#endif /* GRPC_SUPPORT_LOG_H */
diff --git a/include/grpc/support/log_windows.h b/include/grpc/support/log_windows.h
index e833f9d9df..93d4fc73c4 100644
--- a/include/grpc/support/log_windows.h
+++ b/include/grpc/support/log_windows.h
@@ -21,9 +21,7 @@
#include <grpc/impl/codegen/port_platform.h>
-#ifdef __cplusplus
-extern "C" {
-#endif
+
/** Returns a string allocated with gpr_malloc that contains a UTF-8
* formatted error message, corresponding to the error messageid.
@@ -31,8 +29,6 @@ extern "C" {
*/
GPRAPI char* gpr_format_message(int messageid);
-#ifdef __cplusplus
-}
-#endif
+
#endif /* GRPC_SUPPORT_LOG_WINDOWS_H */
diff --git a/include/grpc/support/string_util.h b/include/grpc/support/string_util.h
index 2c7460fa15..5c5b60d67e 100644
--- a/include/grpc/support/string_util.h
+++ b/include/grpc/support/string_util.h
@@ -21,9 +21,7 @@
#include <grpc/support/port_platform.h>
-#ifdef __cplusplus
-extern "C" {
-#endif
+
/** String utility functions */
@@ -42,8 +40,6 @@ GPRAPI char* gpr_strdup(const char* src);
GPRAPI int gpr_asprintf(char** strp, const char* format, ...)
GPR_PRINT_FORMAT_CHECK(2, 3);
-#ifdef __cplusplus
-}
-#endif
+
#endif /* GRPC_SUPPORT_STRING_UTIL_H */
diff --git a/include/grpc/support/subprocess.h b/include/grpc/support/subprocess.h
index 175f7b50eb..a050c1ba82 100644
--- a/include/grpc/support/subprocess.h
+++ b/include/grpc/support/subprocess.h
@@ -21,9 +21,7 @@
#include <grpc/support/port_platform.h>
-#ifdef __cplusplus
-extern "C" {
-#endif
+
typedef struct gpr_subprocess gpr_subprocess;
@@ -37,8 +35,6 @@ GPRAPI void gpr_subprocess_destroy(gpr_subprocess* p);
GPRAPI int gpr_subprocess_join(gpr_subprocess* p);
GPRAPI void gpr_subprocess_interrupt(gpr_subprocess* p);
-#ifdef __cplusplus
-} // extern "C"
-#endif
+
#endif /* GRPC_SUPPORT_SUBPROCESS_H */
diff --git a/include/grpc/support/sync.h b/include/grpc/support/sync.h
index 75192673a6..2953e24944 100644
--- a/include/grpc/support/sync.h
+++ b/include/grpc/support/sync.h
@@ -22,9 +22,7 @@
#include <grpc/impl/codegen/gpr_types.h> /* for gpr_timespec */
#include <grpc/impl/codegen/sync.h>
-#ifdef __cplusplus
-extern "C" {
-#endif
+
/** --- Mutex interface ---
@@ -273,9 +271,6 @@ GPRAPI intptr_t gpr_stats_read(const gpr_stats_counter* c);
}
#endif /* 0 */
-#ifdef __cplusplus
-} // extern "C"
-
namespace grpc_core {
class mu_guard {
@@ -291,6 +286,5 @@ class mu_guard {
};
} // namespace grpc_core
-#endif
#endif /* GRPC_SUPPORT_SYNC_H */
diff --git a/include/grpc/support/thd.h b/include/grpc/support/thd.h
index 225d9d6c75..6d398931be 100644
--- a/include/grpc/support/thd.h
+++ b/include/grpc/support/thd.h
@@ -29,9 +29,7 @@
#include <grpc/support/port_platform.h>
-#ifdef __cplusplus
-extern "C" {
-#endif
+
typedef uintptr_t gpr_thd_id;
@@ -69,8 +67,6 @@ GPRAPI gpr_thd_id gpr_thd_currentid(void);
Calling this on a detached thread has unpredictable results. */
GPRAPI void gpr_thd_join(gpr_thd_id t);
-#ifdef __cplusplus
-}
-#endif
+
#endif /* GRPC_SUPPORT_THD_H */
diff --git a/include/grpc/support/time.h b/include/grpc/support/time.h
index 62d354aafe..1ed5ee6ae4 100644
--- a/include/grpc/support/time.h
+++ b/include/grpc/support/time.h
@@ -24,9 +24,7 @@
#include <stddef.h>
#include <time.h>
-#ifdef __cplusplus
-extern "C" {
-#endif
+
/** Time constants. */
GPRAPI gpr_timespec
@@ -83,8 +81,6 @@ GPRAPI void gpr_sleep_until(gpr_timespec until);
GPRAPI double gpr_timespec_to_micros(gpr_timespec t);
-#ifdef __cplusplus
-}
-#endif
+
#endif /* GRPC_SUPPORT_TIME_H */
diff --git a/include/grpc/support/tls_pthread.h b/include/grpc/support/tls_pthread.h
index fb0edd8e74..5a6ff129e8 100644
--- a/include/grpc/support/tls_pthread.h
+++ b/include/grpc/support/tls_pthread.h
@@ -34,12 +34,8 @@ struct gpr_pthread_thread_local {
#define gpr_tls_init(tls) GPR_ASSERT(0 == pthread_key_create(&(tls)->key, NULL))
#define gpr_tls_destroy(tls) pthread_key_delete((tls)->key)
#define gpr_tls_get(tls) ((intptr_t)pthread_getspecific((tls)->key))
-#ifdef __cplusplus
-extern "C" {
-#endif
+
intptr_t gpr_tls_set(struct gpr_pthread_thread_local* tls, intptr_t value);
-#ifdef __cplusplus
-}
-#endif
+
#endif /* GRPC_SUPPORT_TLS_PTHREAD_H */
diff --git a/src/core/ext/filters/client_channel/client_channel.h b/src/core/ext/filters/client_channel/client_channel.h
index 27862cf239..36165172a2 100644
--- a/src/core/ext/filters/client_channel/client_channel.h
+++ b/src/core/ext/filters/client_channel/client_channel.h
@@ -28,9 +28,7 @@ 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
@@ -56,8 +54,6 @@ void grpc_client_channel_watch_connectivity_state(
grpc_subchannel_call* grpc_client_channel_get_subchannel_call(
grpc_call_element* elem);
-#ifdef __cplusplus
-}
-#endif
+
#endif /* GRPC_CORE_EXT_FILTERS_CLIENT_CHANNEL_CLIENT_CHANNEL_H */
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 db8645cd00..9616e9fad0 100644
--- a/src/core/ext/filters/client_channel/client_channel_factory.h
+++ b/src/core/ext/filters/client_channel/client_channel_factory.h
@@ -27,9 +27,7 @@
// 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
@@ -78,8 +76,6 @@ grpc_channel* grpc_client_channel_factory_create_channel(
grpc_arg grpc_client_channel_factory_create_channel_arg(
grpc_client_channel_factory* factory);
-#ifdef __cplusplus
-}
-#endif
+
#endif /* GRPC_CORE_EXT_FILTERS_CLIENT_CHANNEL_CLIENT_CHANNEL_FACTORY_H */
diff --git a/src/core/ext/filters/client_channel/client_channel_plugin.cc b/src/core/ext/filters/client_channel/client_channel_plugin.cc
index eebef6827c..7b1e642bb8 100644
--- a/src/core/ext/filters/client_channel/client_channel_plugin.cc
+++ 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;
}
-extern "C" void grpc_client_channel_init(void) {
+void grpc_client_channel_init(void) {
grpc_lb_policy_registry_init();
grpc_resolver_registry_init();
grpc_retry_throttle_map_init();
@@ -84,7 +84,7 @@ extern "C" void grpc_client_channel_init(void) {
#endif
}
-extern "C" void grpc_client_channel_shutdown(void) {
+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.h b/src/core/ext/filters/client_channel/connector.h
index 12dc59bcdf..62b943852f 100644
--- a/src/core/ext/filters/client_channel/connector.h
+++ b/src/core/ext/filters/client_channel/connector.h
@@ -23,9 +23,7 @@
#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;
@@ -74,8 +72,6 @@ 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);
-#ifdef __cplusplus
-}
-#endif
+
#endif /* GRPC_CORE_EXT_FILTERS_CLIENT_CHANNEL_CONNECTOR_H */
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 05a23cdba3..c676c2ad55 100644
--- a/src/core/ext/filters/client_channel/http_connect_handshaker.h
+++ b/src/core/ext/filters/client_channel/http_connect_handshaker.h
@@ -28,15 +28,11 @@
/// 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();
-#ifdef __cplusplus
-}
-#endif
+
#endif /* GRPC_CORE_EXT_FILTERS_CLIENT_CHANNEL_HTTP_CONNECT_HANDSHAKER_H */
diff --git a/src/core/ext/filters/client_channel/http_proxy.h b/src/core/ext/filters/client_channel/http_proxy.h
index bdad03def3..894f548273 100644
--- a/src/core/ext/filters/client_channel/http_proxy.h
+++ b/src/core/ext/filters/client_channel/http_proxy.h
@@ -19,14 +19,10 @@
#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();
-#ifdef __cplusplus
-}
-#endif
+
#endif /* GRPC_CORE_EXT_FILTERS_CLIENT_CHANNEL_HTTP_PROXY_H */
diff --git a/src/core/ext/filters/client_channel/lb_policy.h b/src/core/ext/filters/client_channel/lb_policy.h
index 590094e67e..7c1f1942ef 100644
--- a/src/core/ext/filters/client_channel/lb_policy.h
+++ b/src/core/ext/filters/client_channel/lb_policy.h
@@ -23,9 +23,7 @@
#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) */
@@ -208,8 +206,6 @@ 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.h b/src/core/ext/filters/client_channel/lb_policy/grpclb/client_load_reporting_filter.h
index abf613a23b..b6cbd1b3c4 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,15 +21,11 @@
#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.cc b/src/core/ext/filters/client_channel/lb_policy/grpclb/grpclb.cc
index ad9a2bb83b..98f85ae52e 100644
--- a/src/core/ext/filters/client_channel/lb_policy/grpclb/grpclb.cc
+++ b/src/core/ext/filters/client_channel/lb_policy/grpclb/grpclb.cc
@@ -2001,7 +2001,7 @@ static bool maybe_add_client_load_reporting_filter(
return true;
}
-extern "C" void grpc_lb_policy_grpclb_init() {
+void grpc_lb_policy_grpclb_init() {
grpc_register_lb_policy(grpc_glb_lb_factory_create());
grpc_register_tracer(&grpc_lb_glb_trace);
#ifndef NDEBUG
@@ -2013,4 +2013,4 @@ extern "C" void grpc_lb_policy_grpclb_init() {
(void*)&grpc_client_load_reporting_filter);
}
-extern "C" void grpc_lb_policy_grpclb_shutdown() {}
+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 b6135a4768..1489594516 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,17 +21,13 @@
#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();
-#ifdef __cplusplus
-}
-#endif
+
#endif /* GRPC_CORE_EXT_FILTERS_CLIENT_CHANNEL_LB_POLICY_GRPCLB_GRPCLB_H */
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 39cbf53428..4bc8d71a39 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,9 +23,7 @@
#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*.
@@ -44,9 +42,7 @@ 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_client_stats.h b/src/core/ext/filters/client_channel/lb_policy/grpclb/grpclb_client_stats.h
index ce88cf9ee4..54eaa3e5c7 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,9 +23,7 @@
#include <grpc/impl/codegen/grpc_types.h>
-#ifdef __cplusplus
-extern "C" {
-#endif
+
typedef struct grpc_grpclb_client_stats grpc_grpclb_client_stats;
@@ -65,9 +63,7 @@ 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.h b/src/core/ext/filters/client_channel/lb_policy/grpclb/load_balancer_api.h
index 138012c63a..d0e632b10e 100644
--- a/src/core/ext/filters/client_channel/lb_policy/grpclb/load_balancer_api.h
+++ b/src/core/ext/filters/client_channel/lb_policy/grpclb/load_balancer_api.h
@@ -25,9 +25,7 @@
#include "src/core/ext/filters/client_channel/lb_policy/grpclb/proto/grpc/lb/v1/load_balancer.pb.h"
#include "src/core/ext/filters/client_channel/lb_policy_factory.h"
-#ifdef __cplusplus
-extern "C" {
-#endif
+
#define GRPC_GRPCLB_SERVICE_NAME_MAX_LENGTH 128
@@ -87,9 +85,7 @@ grpc_millis grpc_grpclb_duration_to_millis(grpc_grpclb_duration* duration_pb);
void grpc_grpclb_initial_response_destroy(
grpc_grpclb_initial_response* response);
-#ifdef __cplusplus
-}
-#endif
+
#endif /* GRPC_CORE_EXT_FILTERS_CLIENT_CHANNEL_LB_POLICY_GRPCLB_LOAD_BALANCER_API_H \
*/
diff --git a/src/core/ext/filters/client_channel/lb_policy/pick_first/pick_first.cc b/src/core/ext/filters/client_channel/lb_policy/pick_first/pick_first.cc
index dbd4754e87..4e249207fa 100644
--- a/src/core/ext/filters/client_channel/lb_policy/pick_first/pick_first.cc
+++ b/src/core/ext/filters/client_channel/lb_policy/pick_first/pick_first.cc
@@ -593,9 +593,9 @@ static grpc_lb_policy_factory* pick_first_lb_factory_create() {
/* Plugin registration */
-extern "C" void grpc_lb_policy_pick_first_init() {
+void grpc_lb_policy_pick_first_init() {
grpc_register_lb_policy(pick_first_lb_factory_create());
grpc_register_tracer(&grpc_lb_pick_first_trace);
}
-extern "C" void grpc_lb_policy_pick_first_shutdown() {}
+void grpc_lb_policy_pick_first_shutdown() {}
diff --git a/src/core/ext/filters/client_channel/lb_policy/round_robin/round_robin.cc b/src/core/ext/filters/client_channel/lb_policy/round_robin/round_robin.cc
index 6ea1f025df..359aa0e825 100644
--- a/src/core/ext/filters/client_channel/lb_policy/round_robin/round_robin.cc
+++ b/src/core/ext/filters/client_channel/lb_policy/round_robin/round_robin.cc
@@ -689,9 +689,9 @@ static grpc_lb_policy_factory* round_robin_lb_factory_create() {
/* Plugin registration */
-extern "C" void grpc_lb_policy_round_robin_init() {
+void grpc_lb_policy_round_robin_init() {
grpc_register_lb_policy(round_robin_lb_factory_create());
grpc_register_tracer(&grpc_lb_round_robin_trace);
}
-extern "C" void grpc_lb_policy_round_robin_shutdown() {}
+void grpc_lb_policy_round_robin_shutdown() {}
diff --git a/src/core/ext/filters/client_channel/lb_policy/subchannel_list.h b/src/core/ext/filters/client_channel/lb_policy/subchannel_list.h
index e18ad490e8..f3db9b15fc 100644
--- a/src/core/ext/filters/client_channel/lb_policy/subchannel_list.h
+++ b/src/core/ext/filters/client_channel/lb_policy/subchannel_list.h
@@ -36,9 +36,7 @@
// round_robin that could be refactored and moved here. In a future PR,
// need to clean this up.
-#ifdef __cplusplus
-extern "C" {
-#endif
+
typedef struct grpc_lb_subchannel_list grpc_lb_subchannel_list;
@@ -146,8 +144,6 @@ void grpc_lb_subchannel_list_shutdown_and_unref(
grpc_exec_ctx* exec_ctx, grpc_lb_subchannel_list* subchannel_list,
const char* reason);
-#ifdef __cplusplus
-}
-#endif
+
#endif /* GRPC_CORE_EXT_FILTERS_CLIENT_CHANNEL_LB_POLICY_SUBCHANNEL_LIST_H */
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 360a42b177..79c771221d 100644
--- a/src/core/ext/filters/client_channel/lb_policy_factory.h
+++ b/src/core/ext/filters/client_channel/lb_policy_factory.h
@@ -29,9 +29,7 @@
// 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;
@@ -134,8 +132,6 @@ 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);
-#ifdef __cplusplus
-}
-#endif
+
#endif /* GRPC_CORE_EXT_FILTERS_CLIENT_CHANNEL_LB_POLICY_FACTORY_H */
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 055f751b57..de089a8fc8 100644
--- a/src/core/ext/filters/client_channel/lb_policy_registry.h
+++ b/src/core/ext/filters/client_channel/lb_policy_registry.h
@@ -22,9 +22,7 @@
#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 */
@@ -41,8 +39,6 @@ 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);
-#ifdef __cplusplus
-}
-#endif
+
#endif /* GRPC_CORE_EXT_FILTERS_CLIENT_CHANNEL_LB_POLICY_REGISTRY_H */
diff --git a/src/core/ext/filters/client_channel/parse_address.h b/src/core/ext/filters/client_channel/parse_address.h
index b45859f9a2..825cd12393 100644
--- a/src/core/ext/filters/client_channel/parse_address.h
+++ b/src/core/ext/filters/client_channel/parse_address.h
@@ -24,9 +24,7 @@
#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. */
@@ -49,8 +47,6 @@ 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);
-#ifdef __cplusplus
-}
-#endif
+
#endif /* GRPC_CORE_EXT_FILTERS_CLIENT_CHANNEL_PARSE_ADDRESS_H */
diff --git a/src/core/ext/filters/client_channel/proxy_mapper.h b/src/core/ext/filters/client_channel/proxy_mapper.h
index bb8259f854..81ecfb71bb 100644
--- a/src/core/ext/filters/client_channel/proxy_mapper.h
+++ b/src/core/ext/filters/client_channel/proxy_mapper.h
@@ -25,9 +25,7 @@
#include "src/core/lib/iomgr/resolve_address.h"
-#ifdef __cplusplus
-extern "C" {
-#endif
+
typedef struct grpc_proxy_mapper grpc_proxy_mapper;
@@ -75,8 +73,6 @@ bool grpc_proxy_mapper_map_address(grpc_exec_ctx* exec_ctx,
void grpc_proxy_mapper_destroy(grpc_proxy_mapper* mapper);
-#ifdef __cplusplus
-}
-#endif
+
#endif /* GRPC_CORE_EXT_FILTERS_CLIENT_CHANNEL_PROXY_MAPPER_H */
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 39c607cefc..f17fdd89df 100644
--- a/src/core/ext/filters/client_channel/proxy_mapper_registry.h
+++ b/src/core/ext/filters/client_channel/proxy_mapper_registry.h
@@ -21,9 +21,7 @@
#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();
@@ -45,8 +43,6 @@ bool grpc_proxy_mappers_map_address(grpc_exec_ctx* exec_ctx,
grpc_resolved_address** new_address,
grpc_channel_args** new_args);
-#ifdef __cplusplus
-}
-#endif
+
#endif /* GRPC_CORE_EXT_FILTERS_CLIENT_CHANNEL_PROXY_MAPPER_REGISTRY_H */
diff --git a/src/core/ext/filters/client_channel/resolver.h b/src/core/ext/filters/client_channel/resolver.h
index a0eb0bcfdf..ac95666240 100644
--- a/src/core/ext/filters/client_channel/resolver.h
+++ b/src/core/ext/filters/client_channel/resolver.h
@@ -22,9 +22,7 @@
#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;
@@ -91,8 +89,6 @@ 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.cc b/src/core/ext/filters/client_channel/resolver/dns/c_ares/dns_resolver_ares.cc
index 07737b19d2..3a16b3492d 100644
--- a/src/core/ext/filters/client_channel/resolver/dns/c_ares/dns_resolver_ares.cc
+++ 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;
}
-extern "C" void grpc_resolver_dns_ares_init(void) {
+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 @@ extern "C" void grpc_resolver_dns_ares_init(void) {
gpr_free(resolver);
}
-extern "C" void grpc_resolver_dns_ares_shutdown(void) {
+void grpc_resolver_dns_ares_shutdown(void) {
char* resolver = gpr_getenv("GRPC_DNS_RESOLVER");
if (resolver != nullptr && gpr_stricmp(resolver, "ares") == 0) {
grpc_ares_cleanup();
@@ -451,8 +451,8 @@ extern "C" void grpc_resolver_dns_ares_shutdown(void) {
#else /* GRPC_ARES == 1 && !defined(GRPC_UV) */
-extern "C" void grpc_resolver_dns_ares_init(void) {}
+void grpc_resolver_dns_ares_init(void) {}
-extern "C" void grpc_resolver_dns_ares_shutdown(void) {}
+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 0062aa561a..54e04f7aeb 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
@@ -23,9 +23,7 @@
#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;
@@ -54,9 +52,7 @@ 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_wrapper.h b/src/core/ext/filters/client_channel/resolver/dns/c_ares/grpc_ares_wrapper.h
index 6882b7b1d1..8c6499f8f8 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,9 +25,7 @@
#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;
@@ -69,9 +67,7 @@ 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/native/dns_resolver.cc b/src/core/ext/filters/client_channel/resolver/dns/native/dns_resolver.cc
index 589c74807f..fc40ce6966 100644
--- a/src/core/ext/filters/client_channel/resolver/dns/native/dns_resolver.cc
+++ b/src/core/ext/filters/client_channel/resolver/dns/native/dns_resolver.cc
@@ -295,7 +295,7 @@ static grpc_resolver_factory* dns_resolver_factory_create() {
return &dns_resolver_factory;
}
-extern "C" void grpc_resolver_dns_native_init(void) {
+void grpc_resolver_dns_native_init(void) {
char* resolver = gpr_getenv("GRPC_DNS_RESOLVER");
if (resolver != nullptr && gpr_stricmp(resolver, "native") == 0) {
gpr_log(GPR_DEBUG, "Using native dns resolver");
@@ -313,4 +313,4 @@ extern "C" void grpc_resolver_dns_native_init(void) {
gpr_free(resolver);
}
-extern "C" void grpc_resolver_dns_native_shutdown(void) {}
+void grpc_resolver_dns_native_shutdown(void) {}
diff --git a/src/core/ext/filters/client_channel/resolver/fake/fake_resolver.cc b/src/core/ext/filters/client_channel/resolver/fake/fake_resolver.cc
index 85d7090144..44798ca434 100644
--- a/src/core/ext/filters/client_channel/resolver/fake/fake_resolver.cc
+++ 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};
-extern "C" void grpc_resolver_fake_init(void) {
+void grpc_resolver_fake_init(void) {
grpc_register_resolver_type(&fake_resolver_factory);
}
-extern "C" void grpc_resolver_fake_shutdown(void) {}
+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 3f341fa8ed..c56c34b59c 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,9 +21,7 @@
#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"
@@ -60,9 +58,7 @@ 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.cc b/src/core/ext/filters/client_channel/resolver/sockaddr/sockaddr_resolver.cc
index 1da8ab9161..f0934b5943 100644
--- a/src/core/ext/filters/client_channel/resolver/sockaddr/sockaddr_resolver.cc
+++ 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);
-extern "C" void grpc_resolver_sockaddr_init(void) {
+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 @@ extern "C" void grpc_resolver_sockaddr_init(void) {
#endif
}
-extern "C" void grpc_resolver_sockaddr_shutdown(void) {}
+void grpc_resolver_sockaddr_shutdown(void) {}
diff --git a/src/core/ext/filters/client_channel/resolver_factory.h b/src/core/ext/filters/client_channel/resolver_factory.h
index 62555a4f01..8bba90d0ac 100644
--- a/src/core/ext/filters/client_channel/resolver_factory.h
+++ b/src/core/ext/filters/client_channel/resolver_factory.h
@@ -24,9 +24,7 @@
#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;
@@ -71,8 +69,6 @@ grpc_resolver* grpc_resolver_factory_create_resolver(
char* grpc_resolver_factory_get_default_authority(
grpc_resolver_factory* factory, grpc_uri* uri);
-#ifdef __cplusplus
-}
-#endif
+
#endif /* GRPC_CORE_EXT_FILTERS_CLIENT_CHANNEL_RESOLVER_FACTORY_H */
diff --git a/src/core/ext/filters/client_channel/resolver_registry.h b/src/core/ext/filters/client_channel/resolver_registry.h
index 01a2d0b18b..6f7f8945c3 100644
--- a/src/core/ext/filters/client_channel/resolver_registry.h
+++ b/src/core/ext/filters/client_channel/resolver_registry.h
@@ -22,9 +22,7 @@
#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);
@@ -70,8 +68,6 @@ 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);
-#ifdef __cplusplus
-}
-#endif
+
#endif /* GRPC_CORE_EXT_FILTERS_CLIENT_CHANNEL_RESOLVER_REGISTRY_H */
diff --git a/src/core/ext/filters/client_channel/retry_throttle.h b/src/core/ext/filters/client_channel/retry_throttle.h
index 399383df78..305dd1ca5d 100644
--- a/src/core/ext/filters/client_channel/retry_throttle.h
+++ b/src/core/ext/filters/client_channel/retry_throttle.h
@@ -21,9 +21,7 @@
#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;
@@ -51,8 +49,6 @@ 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);
-#ifdef __cplusplus
-}
-#endif
+
#endif /* GRPC_CORE_EXT_FILTERS_CLIENT_CHANNEL_RETRY_THROTTLE_H */
diff --git a/src/core/ext/filters/client_channel/subchannel.h b/src/core/ext/filters/client_channel/subchannel.h
index 970f182ff0..44491c3cde 100644
--- a/src/core/ext/filters/client_channel/subchannel.h
+++ b/src/core/ext/filters/client_channel/subchannel.h
@@ -26,9 +26,7 @@
#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"
@@ -192,8 +190,6 @@ 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.h b/src/core/ext/filters/client_channel/subchannel_index.h
index 47f9c7bb1e..23ba7e210f 100644
--- a/src/core/ext/filters/client_channel/subchannel_index.h
+++ b/src/core/ext/filters/client_channel/subchannel_index.h
@@ -21,9 +21,7 @@
#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 */
@@ -82,8 +80,6 @@ void grpc_subchannel_index_unref(void);
* force_creation set. */
void grpc_subchannel_index_test_only_set_force_creation(bool force_creation);
-#ifdef __cplusplus
-}
-#endif
+
#endif /* GRPC_CORE_EXT_FILTERS_CLIENT_CHANNEL_SUBCHANNEL_INDEX_H */
diff --git a/src/core/ext/filters/client_channel/uri_parser.h b/src/core/ext/filters/client_channel/uri_parser.h
index cd877ade8d..3bf4c19654 100644
--- a/src/core/ext/filters/client_channel/uri_parser.h
+++ b/src/core/ext/filters/client_channel/uri_parser.h
@@ -22,9 +22,7 @@
#include <stddef.h>
#include "src/core/lib/iomgr/exec_ctx.h"
-#ifdef __cplusplus
-extern "C" {
-#endif
+
typedef struct {
char* scheme;
@@ -51,8 +49,6 @@ const char* grpc_uri_get_query_arg(const grpc_uri* uri, const char* key);
/** destroy a uri */
void grpc_uri_destroy(grpc_uri* uri);
-#ifdef __cplusplus
-}
-#endif
+
#endif /* GRPC_CORE_EXT_FILTERS_CLIENT_CHANNEL_URI_PARSER_H */
diff --git a/src/core/ext/filters/deadline/deadline_filter.cc b/src/core/ext/filters/deadline/deadline_filter.cc
index 849ce7153e..5db7584a59 100644
--- a/src/core/ext/filters/deadline/deadline_filter.cc
+++ b/src/core/ext/filters/deadline/deadline_filter.cc
@@ -382,7 +382,7 @@ static bool maybe_add_deadline_filter(grpc_exec_ctx* exec_ctx,
: true;
}
-extern "C" void grpc_deadline_filter_init(void) {
+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);
@@ -391,4 +391,4 @@ extern "C" void grpc_deadline_filter_init(void) {
maybe_add_deadline_filter, (void*)&grpc_server_deadline_filter);
}
-extern "C" void grpc_deadline_filter_shutdown(void) {}
+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 e665dc53ee..6be9015ab9 100644
--- a/src/core/ext/filters/deadline/deadline_filter.h
+++ b/src/core/ext/filters/deadline/deadline_filter.h
@@ -20,9 +20,7 @@
#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,
@@ -94,8 +92,6 @@ 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;
-#ifdef __cplusplus
-}
-#endif
+
#endif /* GRPC_CORE_EXT_FILTERS_DEADLINE_DEADLINE_FILTER_H */
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 9ed8e76915..1237c0a3de 100644
--- a/src/core/ext/filters/http/client/http_client_filter.h
+++ b/src/core/ext/filters/http/client/http_client_filter.h
@@ -20,9 +20,7 @@
#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;
@@ -30,8 +28,6 @@ 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.cc b/src/core/ext/filters/http/http_filters_plugin.cc
index 69dbde409c..61d73edfc0 100644
--- a/src/core/ext/filters/http/http_filters_plugin.cc
+++ 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;
}
-extern "C" void grpc_http_filters_init(void) {
+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 @@ extern "C" void grpc_http_filters_init(void) {
maybe_add_required_filter, (void*)&grpc_http_server_filter);
}
-extern "C" void grpc_http_filters_shutdown(void) {}
+void grpc_http_filters_shutdown(void) {}
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 79a2815655..c76682f5b5 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,9 +23,7 @@
#include "src/core/lib/channel/channel_stack.h"
-#ifdef __cplusplus
-extern "C" {
-#endif
+
/** Compression filter for outgoing data.
*
@@ -51,9 +49,7 @@ extern "C" {
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.h b/src/core/ext/filters/http/server/http_server_filter.h
index 4b38cc5bf7..2d724def18 100644
--- a/src/core/ext/filters/http/server/http_server_filter.h
+++ b/src/core/ext/filters/http/server/http_server_filter.h
@@ -21,15 +21,11 @@
#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.h b/src/core/ext/filters/load_reporting/server_load_reporting_filter.h
index 356f8b8e66..00e8e4c37f 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,15 +22,11 @@
#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.cc b/src/core/ext/filters/load_reporting/server_load_reporting_plugin.cc
index ab8387967c..accb7797dd 100644
--- a/src/core/ext/filters/load_reporting/server_load_reporting_plugin.cc
+++ 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 */
-extern "C" void grpc_server_load_reporting_plugin_init(void) {
+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);
}
-extern "C" void grpc_server_load_reporting_plugin_shutdown() {}
+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 a6448ce97e..af2bbfcc09 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,9 +23,7 @@
#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 {
@@ -59,9 +57,7 @@ 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.cc b/src/core/ext/filters/max_age/max_age_filter.cc
index 001f9f3906..89c17ae501 100644
--- a/src/core/ext/filters/max_age/max_age_filter.cc
+++ b/src/core/ext/filters/max_age/max_age_filter.cc
@@ -404,10 +404,10 @@ static bool maybe_add_max_age_filter(grpc_exec_ctx* exec_ctx,
}
}
-extern "C" void grpc_max_age_filter_init(void) {
+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, nullptr);
}
-extern "C" void grpc_max_age_filter_shutdown(void) {}
+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 eeeefd695e..e088598277 100644
--- a/src/core/ext/filters/max_age/max_age_filter.h
+++ b/src/core/ext/filters/max_age/max_age_filter.h
@@ -19,14 +19,10 @@
#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.cc b/src/core/ext/filters/message_size/message_size_filter.cc
index 2e81d09961..3d2252af2e 100644
--- a/src/core/ext/filters/message_size/message_size_filter.cc
+++ b/src/core/ext/filters/message_size/message_size_filter.cc
@@ -310,7 +310,7 @@ static bool maybe_add_message_size_filter(grpc_exec_ctx* exec_ctx,
}
}
-extern "C" void grpc_message_size_filter_init(void) {
+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, nullptr);
@@ -322,4 +322,4 @@ extern "C" void grpc_message_size_filter_init(void) {
maybe_add_message_size_filter, nullptr);
}
-extern "C" void grpc_message_size_filter_shutdown(void) {}
+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 da325d6f89..7c170fa7e1 100644
--- a/src/core/ext/filters/message_size/message_size_filter.h
+++ b/src/core/ext/filters/message_size/message_size_filter.h
@@ -19,14 +19,10 @@
#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.cc b/src/core/ext/filters/workarounds/workaround_cronet_compression_filter.cc
index 6bbb4d5739..f26cac26a4 100644
--- a/src/core/ext/filters/workarounds/workaround_cronet_compression_filter.cc
+++ 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, nullptr, nullptr);
}
-extern "C" void grpc_workaround_cronet_compression_filter_init(void) {
+void grpc_workaround_cronet_compression_filter_init(void) {
grpc_channel_init_register_stage(
GRPC_SERVER_CHANNEL, GRPC_WORKAROUND_PRIORITY_HIGH,
register_workaround_cronet_compression, nullptr);
@@ -204,4 +204,4 @@ extern "C" void grpc_workaround_cronet_compression_filter_init(void) {
parse_user_agent);
}
-extern "C" void grpc_workaround_cronet_compression_filter_shutdown(void) {}
+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 c8b07df63e..38a88cb631 100644
--- a/src/core/ext/filters/workarounds/workaround_cronet_compression_filter.h
+++ b/src/core/ext/filters/workarounds/workaround_cronet_compression_filter.h
@@ -19,15 +19,11 @@
#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.h b/src/core/ext/filters/workarounds/workaround_utils.h
index a954ad4001..4267b486c1 100644
--- a/src/core/ext/filters/workarounds/workaround_utils.h
+++ b/src/core/ext/filters/workarounds/workaround_utils.h
@@ -24,9 +24,7 @@
#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];
@@ -38,8 +36,6 @@ typedef bool (*user_agent_parser)(grpc_mdelem);
void grpc_register_workaround(uint32_t id, user_agent_parser parser);
-#ifdef __cplusplus
-}
-#endif
+
#endif /* GRPC_CORE_EXT_FILTERS_WORKAROUNDS_WORKAROUND_UTILS_H */
diff --git a/src/core/ext/transport/chttp2/alpn/alpn.h b/src/core/ext/transport/chttp2/alpn/alpn.h
index 4a420e83e0..8f13ebdfc2 100644
--- a/src/core/ext/transport/chttp2/alpn/alpn.h
+++ b/src/core/ext/transport/chttp2/alpn/alpn.h
@@ -21,9 +21,7 @@
#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);
@@ -35,8 +33,6 @@ size_t grpc_chttp2_num_alpn_versions(void);
* grpc_chttp2_num_alpn_versions()) */
const char* grpc_chttp2_get_alpn_version_index(size_t i);
-#ifdef __cplusplus
-}
-#endif
+
#endif /* GRPC_CORE_EXT_TRANSPORT_CHTTP2_ALPN_ALPN_H */
diff --git a/src/core/ext/transport/chttp2/client/chttp2_connector.h b/src/core/ext/transport/chttp2/client/chttp2_connector.h
index 63f264e0ef..dc8f26cc0a 100644
--- a/src/core/ext/transport/chttp2/client/chttp2_connector.h
+++ b/src/core/ext/transport/chttp2/client/chttp2_connector.h
@@ -19,16 +19,12 @@
#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/server/chttp2_server.h b/src/core/ext/transport/chttp2/server/chttp2_server.h
index 4e0e7aa617..ed798d243d 100644
--- a/src/core/ext/transport/chttp2/server/chttp2_server.h
+++ b/src/core/ext/transport/chttp2/server/chttp2_server.h
@@ -23,9 +23,7 @@
#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.
@@ -33,8 +31,6 @@ 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);
-#ifdef __cplusplus
-}
-#endif
+
#endif /* GRPC_CORE_EXT_TRANSPORT_CHTTP2_SERVER_CHTTP2_SERVER_H */
diff --git a/src/core/ext/transport/chttp2/transport/bin_decoder.h b/src/core/ext/transport/chttp2/transport/bin_decoder.h
index a9c4c9a0f6..33cff85835 100644
--- a/src/core/ext/transport/chttp2/transport/bin_decoder.h
+++ b/src/core/ext/transport/chttp2/transport/bin_decoder.h
@@ -22,9 +22,7 @@
#include <grpc/slice.h>
#include <stdbool.h>
-#ifdef __cplusplus
-extern "C" {
-#endif
+
struct grpc_base64_decode_context {
/* input/output: */
@@ -53,8 +51,6 @@ grpc_slice grpc_chttp2_base64_decode_with_length(grpc_exec_ctx* exec_ctx,
grpc_slice input,
size_t output_length);
-#ifdef __cplusplus
-}
-#endif
+
#endif /* GRPC_CORE_EXT_TRANSPORT_CHTTP2_TRANSPORT_BIN_DECODER_H */
diff --git a/src/core/ext/transport/chttp2/transport/bin_encoder.h b/src/core/ext/transport/chttp2/transport/bin_encoder.h
index 0be3633354..620a6e50d8 100644
--- a/src/core/ext/transport/chttp2/transport/bin_encoder.h
+++ b/src/core/ext/transport/chttp2/transport/bin_encoder.h
@@ -21,9 +21,7 @@
#include <grpc/slice.h>
-#ifdef __cplusplus
-extern "C" {
-#endif
+
/* base64 encode a slice. Returns a new slice, does not take ownership of the
input */
@@ -40,8 +38,6 @@ grpc_slice grpc_chttp2_huffman_compress(grpc_slice input);
return y; */
grpc_slice grpc_chttp2_base64_encode_and_huffman_compress(grpc_slice input);
-#ifdef __cplusplus
-}
-#endif
+
#endif /* GRPC_CORE_EXT_TRANSPORT_CHTTP2_TRANSPORT_BIN_ENCODER_H */
diff --git a/src/core/ext/transport/chttp2/transport/chttp2_plugin.cc b/src/core/ext/transport/chttp2/transport/chttp2_plugin.cc
index ac9ae5c395..6d09953830 100644
--- a/src/core/ext/transport/chttp2/transport/chttp2_plugin.cc
+++ 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"
-extern "C" void grpc_chttp2_plugin_init(void) {
+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 @@ extern "C" void grpc_chttp2_plugin_init(void) {
#endif
}
-extern "C" void grpc_chttp2_plugin_shutdown(void) {}
+void grpc_chttp2_plugin_shutdown(void) {}
diff --git a/src/core/ext/transport/chttp2/transport/chttp2_transport.h b/src/core/ext/transport/chttp2/transport/chttp2_transport.h
index 972104f62c..2b2c82af4d 100644
--- a/src/core/ext/transport/chttp2/transport/chttp2_transport.h
+++ b/src/core/ext/transport/chttp2/transport/chttp2_transport.h
@@ -23,9 +23,7 @@
#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;
@@ -45,8 +43,6 @@ 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.h b/src/core/ext/transport/chttp2/transport/flow_control.h
index 7dd348ed5f..46d00a1032 100644
--- a/src/core/ext/transport/chttp2/transport/flow_control.h
+++ b/src/core/ext/transport/chttp2/transport/flow_control.h
@@ -30,7 +30,7 @@
struct grpc_chttp2_transport;
struct grpc_chttp2_stream;
-extern "C" grpc_tracer_flag grpc_flowctl_trace;
+extern grpc_tracer_flag grpc_flowctl_trace;
namespace grpc {
namespace testing {
diff --git a/src/core/ext/transport/chttp2/transport/frame.h b/src/core/ext/transport/chttp2/transport/frame.h
index e7debdad79..404ee2fee4 100644
--- a/src/core/ext/transport/chttp2/transport/frame.h
+++ b/src/core/ext/transport/chttp2/transport/frame.h
@@ -24,9 +24,7 @@
#include "src/core/lib/iomgr/error.h"
-#ifdef __cplusplus
-extern "C" {
-#endif
+
/* defined in internal.h */
typedef struct grpc_chttp2_stream grpc_chttp2_stream;
@@ -47,8 +45,6 @@ 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.h b/src/core/ext/transport/chttp2/transport/frame_data.h
index 96f823a0ad..217927799a 100644
--- a/src/core/ext/transport/chttp2/transport/frame_data.h
+++ b/src/core/ext/transport/chttp2/transport/frame_data.h
@@ -28,9 +28,7 @@
#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,
@@ -84,8 +82,6 @@ grpc_error* grpc_deframe_unprocessed_incoming_frames(
grpc_slice_buffer* slices, grpc_slice* slice_out,
grpc_byte_stream** stream_out);
-#ifdef __cplusplus
-}
-#endif
+
#endif /* GRPC_CORE_EXT_TRANSPORT_CHTTP2_TRANSPORT_FRAME_DATA_H */
diff --git a/src/core/ext/transport/chttp2/transport/frame_goaway.h b/src/core/ext/transport/chttp2/transport/frame_goaway.h
index 9790d0b08d..b3c910f5ea 100644
--- a/src/core/ext/transport/chttp2/transport/frame_goaway.h
+++ b/src/core/ext/transport/chttp2/transport/frame_goaway.h
@@ -25,9 +25,7 @@
#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,
@@ -64,8 +62,6 @@ void grpc_chttp2_goaway_append(uint32_t last_stream_id, uint32_t error_code,
grpc_slice debug_data,
grpc_slice_buffer* slice_buffer);
-#ifdef __cplusplus
-}
-#endif
+
#endif /* GRPC_CORE_EXT_TRANSPORT_CHTTP2_TRANSPORT_FRAME_GOAWAY_H */
diff --git a/src/core/ext/transport/chttp2/transport/frame_ping.h b/src/core/ext/transport/chttp2/transport/frame_ping.h
index 034aad002e..0767182e09 100644
--- a/src/core/ext/transport/chttp2/transport/frame_ping.h
+++ b/src/core/ext/transport/chttp2/transport/frame_ping.h
@@ -23,9 +23,7 @@
#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;
@@ -45,8 +43,6 @@ 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);
-#ifdef __cplusplus
-}
-#endif
+
#endif /* GRPC_CORE_EXT_TRANSPORT_CHTTP2_TRANSPORT_FRAME_PING_H */
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 3f5417e993..dd98c04b6a 100644
--- a/src/core/ext/transport/chttp2/transport/frame_rst_stream.h
+++ b/src/core/ext/transport/chttp2/transport/frame_rst_stream.h
@@ -24,9 +24,7 @@
#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;
@@ -44,8 +42,6 @@ grpc_error* grpc_chttp2_rst_stream_parser_parse(grpc_exec_ctx* exec_ctx,
grpc_chttp2_stream* s,
grpc_slice slice, int is_last);
-#ifdef __cplusplus
-}
-#endif
+
#endif /* GRPC_CORE_EXT_TRANSPORT_CHTTP2_TRANSPORT_FRAME_RST_STREAM_H */
diff --git a/src/core/ext/transport/chttp2/transport/frame_settings.h b/src/core/ext/transport/chttp2/transport/frame_settings.h
index 18bde92815..52b4ef1924 100644
--- a/src/core/ext/transport/chttp2/transport/frame_settings.h
+++ b/src/core/ext/transport/chttp2/transport/frame_settings.h
@@ -25,9 +25,7 @@
#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,
@@ -62,8 +60,6 @@ grpc_error* grpc_chttp2_settings_parser_parse(grpc_exec_ctx* exec_ctx,
grpc_chttp2_stream* s,
grpc_slice slice, int is_last);
-#ifdef __cplusplus
-}
-#endif
+
#endif /* GRPC_CORE_EXT_TRANSPORT_CHTTP2_TRANSPORT_FRAME_SETTINGS_H */
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 daf7d2da6b..1b7e061c8b 100644
--- a/src/core/ext/transport/chttp2/transport/frame_window_update.h
+++ b/src/core/ext/transport/chttp2/transport/frame_window_update.h
@@ -24,9 +24,7 @@
#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;
@@ -43,8 +41,6 @@ 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);
-#ifdef __cplusplus
-}
-#endif
+
#endif /* GRPC_CORE_EXT_TRANSPORT_CHTTP2_TRANSPORT_FRAME_WINDOW_UPDATE_H */
diff --git a/src/core/ext/transport/chttp2/transport/hpack_encoder.h b/src/core/ext/transport/chttp2/transport/hpack_encoder.h
index fd01d1621a..0e11f99fd0 100644
--- a/src/core/ext/transport/chttp2/transport/hpack_encoder.h
+++ b/src/core/ext/transport/chttp2/transport/hpack_encoder.h
@@ -34,9 +34,7 @@
/* 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;
@@ -95,8 +93,6 @@ void grpc_chttp2_encode_header(grpc_exec_ctx* exec_ctx,
const grpc_encode_header_options* options,
grpc_slice_buffer* outbuf);
-#ifdef __cplusplus
-}
-#endif
+
#endif /* GRPC_CORE_EXT_TRANSPORT_CHTTP2_TRANSPORT_HPACK_ENCODER_H */
diff --git a/src/core/ext/transport/chttp2/transport/hpack_parser.h b/src/core/ext/transport/chttp2/transport/hpack_parser.h
index 838c482e4a..452165e8d0 100644
--- a/src/core/ext/transport/chttp2/transport/hpack_parser.h
+++ b/src/core/ext/transport/chttp2/transport/hpack_parser.h
@@ -27,9 +27,7 @@
#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;
@@ -115,8 +113,6 @@ grpc_error* grpc_chttp2_header_parser_parse(grpc_exec_ctx* exec_ctx,
grpc_chttp2_stream* s,
grpc_slice slice, int is_last);
-#ifdef __cplusplus
-}
-#endif
+
#endif /* GRPC_CORE_EXT_TRANSPORT_CHTTP2_TRANSPORT_HPACK_PARSER_H */
diff --git a/src/core/ext/transport/chttp2/transport/hpack_table.h b/src/core/ext/transport/chttp2/transport/hpack_table.h
index ddc8888f86..0e41dbeea5 100644
--- a/src/core/ext/transport/chttp2/transport/hpack_table.h
+++ b/src/core/ext/transport/chttp2/transport/hpack_table.h
@@ -24,9 +24,7 @@
#include "src/core/lib/iomgr/error.h"
#include "src/core/lib/transport/metadata.h"
-#ifdef __cplusplus
-extern "C" {
-#endif
+
/* HPACK header table */
@@ -98,8 +96,6 @@ 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.h b/src/core/ext/transport/chttp2/transport/http2_settings.h
index 86069b498b..baac528c9a 100644
--- a/src/core/ext/transport/chttp2/transport/http2_settings.h
+++ b/src/core/ext/transport/chttp2/transport/http2_settings.h
@@ -36,9 +36,7 @@ typedef enum {
#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);
@@ -60,8 +58,6 @@ typedef struct {
extern const grpc_chttp2_setting_parameters
grpc_chttp2_settings_parameters[GRPC_CHTTP2_NUM_SETTINGS];
-#ifdef __cplusplus
-}
-#endif
+
#endif /* GRPC_CORE_EXT_TRANSPORT_CHTTP2_TRANSPORT_HTTP2_SETTINGS_H */
diff --git a/src/core/ext/transport/chttp2/transport/huffsyms.h b/src/core/ext/transport/chttp2/transport/huffsyms.h
index 4002706bc0..7014fb60c4 100644
--- a/src/core/ext/transport/chttp2/transport/huffsyms.h
+++ b/src/core/ext/transport/chttp2/transport/huffsyms.h
@@ -19,9 +19,7 @@
#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 */
@@ -34,8 +32,6 @@ 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.h b/src/core/ext/transport/chttp2/transport/incoming_metadata.h
index 7ccb4a0126..9dbf8987d1 100644
--- a/src/core/ext/transport/chttp2/transport/incoming_metadata.h
+++ b/src/core/ext/transport/chttp2/transport/incoming_metadata.h
@@ -21,9 +21,7 @@
#include "src/core/lib/transport/transport.h"
-#ifdef __cplusplus
-extern "C" {
-#endif
+
typedef struct {
gpr_arena* arena;
@@ -49,8 +47,6 @@ grpc_error* grpc_chttp2_incoming_metadata_buffer_replace_or_add(
void grpc_chttp2_incoming_metadata_buffer_set_deadline(
grpc_chttp2_incoming_metadata_buffer* buffer, grpc_millis deadline);
-#ifdef __cplusplus
-}
-#endif
+
#endif /* GRPC_CORE_EXT_TRANSPORT_CHTTP2_TRANSPORT_INCOMING_METADATA_H */
diff --git a/src/core/ext/transport/chttp2/transport/internal.h b/src/core/ext/transport/chttp2/transport/internal.h
index 60cc280c43..c579b6be6b 100644
--- a/src/core/ext/transport/chttp2/transport/internal.h
+++ b/src/core/ext/transport/chttp2/transport/internal.h
@@ -42,9 +42,7 @@
#include "src/core/lib/transport/connectivity_state.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 */
@@ -778,8 +776,6 @@ 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/stream_map.h b/src/core/ext/transport/chttp2/transport/stream_map.h
index c89d20047c..37b71a3043 100644
--- a/src/core/ext/transport/chttp2/transport/stream_map.h
+++ b/src/core/ext/transport/chttp2/transport/stream_map.h
@@ -23,9 +23,7 @@
#include <stddef.h>
-#ifdef __cplusplus
-extern "C" {
-#endif
+
/* Data structure to map a uint32_t to a data object (represented by a void*)
@@ -69,8 +67,6 @@ void grpc_chttp2_stream_map_for_each(grpc_chttp2_stream_map* map,
void* value),
void* user_data);
-#ifdef __cplusplus
-}
-#endif
+
#endif /* GRPC_CORE_EXT_TRANSPORT_CHTTP2_TRANSPORT_STREAM_MAP_H */
diff --git a/src/core/ext/transport/chttp2/transport/varint.h b/src/core/ext/transport/chttp2/transport/varint.h
index d3a9d902c4..4da8aa5bd9 100644
--- a/src/core/ext/transport/chttp2/transport/varint.h
+++ b/src/core/ext/transport/chttp2/transport/varint.h
@@ -21,9 +21,7 @@
#include <grpc/support/port_platform.h>
-#ifdef __cplusplus
-extern "C" {
-#endif
+
/* Helpers for hpack varint encoding */
@@ -61,8 +59,6 @@ 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/cronet/transport/cronet_transport.h b/src/core/ext/transport/cronet/transport/cronet_transport.h
index 7643fdb585..699818904e 100644
--- a/src/core/ext/transport/cronet/transport/cronet_transport.h
+++ b/src/core/ext/transport/cronet/transport/cronet_transport.h
@@ -21,16 +21,12 @@
#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.cc b/src/core/ext/transport/inproc/inproc_plugin.cc
index 5d8a1c74ab..74451b3234 100644
--- a/src/core/ext/transport/inproc/inproc_plugin.cc
+++ b/src/core/ext/transport/inproc/inproc_plugin.cc
@@ -21,11 +21,11 @@
grpc_tracer_flag grpc_inproc_trace = GRPC_TRACER_INITIALIZER(false, "inproc");
-extern "C" void grpc_inproc_plugin_init(void) {
+void grpc_inproc_plugin_init(void) {
grpc_register_tracer(&grpc_inproc_trace);
grpc_inproc_transport_init();
}
-extern "C" void grpc_inproc_plugin_shutdown(void) {
+void grpc_inproc_plugin_shutdown(void) {
grpc_inproc_transport_shutdown();
}
diff --git a/src/core/ext/transport/inproc/inproc_transport.h b/src/core/ext/transport/inproc/inproc_transport.h
index 6e83af3b4c..74cba41afd 100644
--- a/src/core/ext/transport/inproc/inproc_transport.h
+++ b/src/core/ext/transport/inproc/inproc_transport.h
@@ -21,9 +21,7 @@
#include "src/core/lib/transport/transport_impl.h"
-#ifdef __cplusplus
-extern "C" {
-#endif
+
grpc_channel* grpc_inproc_channel_create(grpc_server* server,
grpc_channel_args* args,
@@ -34,8 +32,6 @@ extern grpc_tracer_flag grpc_inproc_trace;
void grpc_inproc_transport_init(void);
void grpc_inproc_transport_shutdown(void);
-#ifdef __cplusplus
-}
-#endif
+
#endif /* GRPC_CORE_EXT_TRANSPORT_INPROC_INPROC_TRANSPORT_H */
diff --git a/src/core/lib/backoff/backoff.h b/src/core/lib/backoff/backoff.h
index 1067281403..e59c343d59 100644
--- a/src/core/lib/backoff/backoff.h
+++ b/src/core/lib/backoff/backoff.h
@@ -21,9 +21,7 @@
#include "src/core/lib/iomgr/exec_ctx.h"
-#ifdef __cplusplus
-extern "C" {
-#endif
+
typedef struct {
/// const: how long to wait after the first failure before retrying
@@ -76,8 +74,6 @@ grpc_backoff_result grpc_backoff_step(grpc_exec_ctx* exec_ctx,
/// grpc_backoff_begin.
void grpc_backoff_reset(grpc_backoff* backoff);
-#ifdef __cplusplus
-}
-#endif
+
#endif /* GRPC_CORE_LIB_BACKOFF_BACKOFF_H */
diff --git a/src/core/lib/channel/channel_args.h b/src/core/lib/channel/channel_args.h
index d36761da57..7f8305dae3 100644
--- a/src/core/lib/channel/channel_args.h
+++ b/src/core/lib/channel/channel_args.h
@@ -23,9 +23,7 @@
#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.
@@ -153,8 +151,6 @@ 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);
-#ifdef __cplusplus
-}
-#endif
+
#endif /* GRPC_CORE_LIB_CHANNEL_CHANNEL_ARGS_H */
diff --git a/src/core/lib/channel/channel_stack.h b/src/core/lib/channel/channel_stack.h
index aa993112a0..478a03ee73 100644
--- a/src/core/lib/channel/channel_stack.h
+++ b/src/core/lib/channel/channel_stack.h
@@ -45,9 +45,7 @@
#include "src/core/lib/support/arena.h"
#include "src/core/lib/transport/transport.h"
-#ifdef __cplusplus
-extern "C" {
-#endif
+
typedef struct grpc_channel_element grpc_channel_element;
typedef struct grpc_call_element grpc_call_element;
@@ -290,8 +288,6 @@ extern grpc_tracer_flag grpc_trace_channel;
#define GRPC_CALL_LOG_OP(sev, elem, op) \
if (GRPC_TRACER_ON(grpc_trace_channel)) grpc_call_log_op(sev, elem, op)
-#ifdef __cplusplus
-}
-#endif
+
#endif /* GRPC_CORE_LIB_CHANNEL_CHANNEL_STACK_H */
diff --git a/src/core/lib/channel/channel_stack_builder.h b/src/core/lib/channel/channel_stack_builder.h
index 23134b7d10..4f5e1dc7d5 100644
--- a/src/core/lib/channel/channel_stack_builder.h
+++ b/src/core/lib/channel/channel_stack_builder.h
@@ -24,9 +24,7 @@
#include "src/core/lib/channel/channel_args.h"
#include "src/core/lib/channel/channel_stack.h"
-#ifdef __cplusplus
-extern "C" {
-#endif
+
/// grpc_channel_stack_builder offers a programmatic interface to selected
/// and order channel filters
@@ -162,8 +160,6 @@ void grpc_channel_stack_builder_destroy(grpc_exec_ctx* exec_ctx,
extern grpc_tracer_flag grpc_trace_channel_stack_builder;
-#ifdef __cplusplus
-}
-#endif
+
#endif /* GRPC_CORE_LIB_CHANNEL_CHANNEL_STACK_BUILDER_H */
diff --git a/src/core/lib/channel/connected_channel.h b/src/core/lib/channel/connected_channel.h
index cca19737dc..6807049ea3 100644
--- a/src/core/lib/channel/connected_channel.h
+++ b/src/core/lib/channel/connected_channel.h
@@ -21,9 +21,7 @@
#include "src/core/lib/channel/channel_stack_builder.h"
-#ifdef __cplusplus
-extern "C" {
-#endif
+
extern const grpc_channel_filter grpc_connected_filter;
@@ -34,8 +32,6 @@ 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);
-#ifdef __cplusplus
-}
-#endif
+
#endif /* GRPC_CORE_LIB_CHANNEL_CONNECTED_CHANNEL_H */
diff --git a/src/core/lib/channel/handshaker.h b/src/core/lib/channel/handshaker.h
index 8ed38c15ba..6f7b01bc5d 100644
--- a/src/core/lib/channel/handshaker.h
+++ b/src/core/lib/channel/handshaker.h
@@ -26,9 +26,7 @@
#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
@@ -168,8 +166,6 @@ 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);
-#ifdef __cplusplus
-}
-#endif
+
#endif /* GRPC_CORE_LIB_CHANNEL_HANDSHAKER_H */
diff --git a/src/core/lib/channel/handshaker_factory.h b/src/core/lib/channel/handshaker_factory.h
index 63d9b5af72..79e22c59b2 100644
--- a/src/core/lib/channel/handshaker_factory.h
+++ b/src/core/lib/channel/handshaker_factory.h
@@ -24,9 +24,7 @@
#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.
@@ -52,8 +50,6 @@ void grpc_handshaker_factory_add_handshakers(
void grpc_handshaker_factory_destroy(
grpc_exec_ctx* exec_ctx, grpc_handshaker_factory* handshaker_factory);
-#ifdef __cplusplus
-}
-#endif
+
#endif /* GRPC_CORE_LIB_CHANNEL_HANDSHAKER_FACTORY_H */
diff --git a/src/core/lib/channel/handshaker_registry.h b/src/core/lib/channel/handshaker_registry.h
index ddd280bea8..5c503ec883 100644
--- a/src/core/lib/channel/handshaker_registry.h
+++ b/src/core/lib/channel/handshaker_registry.h
@@ -24,9 +24,7 @@
#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,
@@ -49,8 +47,6 @@ void grpc_handshakers_add(grpc_exec_ctx* exec_ctx,
const grpc_channel_args* args,
grpc_handshake_manager* handshake_mgr);
-#ifdef __cplusplus
-}
-#endif
+
#endif /* GRPC_CORE_LIB_CHANNEL_HANDSHAKER_REGISTRY_H */
diff --git a/src/core/lib/compression/algorithm_metadata.h b/src/core/lib/compression/algorithm_metadata.h
index 17caf58f69..7e32fe1437 100644
--- a/src/core/lib/compression/algorithm_metadata.h
+++ b/src/core/lib/compression/algorithm_metadata.h
@@ -22,9 +22,7 @@
#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(
@@ -53,8 +51,6 @@ grpc_compression_algorithm grpc_compression_algorithm_from_slice(
grpc_stream_compression_algorithm grpc_stream_compression_algorithm_from_slice(
grpc_slice str);
-#ifdef __cplusplus
-}
-#endif
+
#endif /* GRPC_CORE_LIB_COMPRESSION_ALGORITHM_METADATA_H */
diff --git a/src/core/lib/compression/message_compress.h b/src/core/lib/compression/message_compress.h
index fffe175fd2..137e45431c 100644
--- a/src/core/lib/compression/message_compress.h
+++ b/src/core/lib/compression/message_compress.h
@@ -22,9 +22,7 @@
#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.
@@ -40,8 +38,6 @@ int grpc_msg_decompress(grpc_exec_ctx* exec_ctx,
grpc_compression_algorithm algorithm,
grpc_slice_buffer* input, grpc_slice_buffer* output);
-#ifdef __cplusplus
-}
-#endif
+
#endif /* GRPC_CORE_LIB_COMPRESSION_MESSAGE_COMPRESS_H */
diff --git a/src/core/lib/compression/stream_compression.h b/src/core/lib/compression/stream_compression.h
index b56c142543..8d4f0e725d 100644
--- a/src/core/lib/compression/stream_compression.h
+++ b/src/core/lib/compression/stream_compression.h
@@ -26,9 +26,7 @@
#include "src/core/lib/transport/static_metadata.h"
-#ifdef __cplusplus
-extern "C" {
-#endif
+
typedef struct grpc_stream_compression_vtable grpc_stream_compression_vtable;
@@ -115,8 +113,6 @@ 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.h b/src/core/lib/compression/stream_compression_gzip.h
index a3f1b0406f..735543f3f9 100644
--- a/src/core/lib/compression/stream_compression_gzip.h
+++ b/src/core/lib/compression/stream_compression_gzip.h
@@ -21,14 +21,10 @@
#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.h b/src/core/lib/compression/stream_compression_identity.h
index 3a729fafad..9f1166724b 100644
--- a/src/core/lib/compression/stream_compression_identity.h
+++ b/src/core/lib/compression/stream_compression_identity.h
@@ -21,15 +21,11 @@
#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.h b/src/core/lib/debug/stats.h
index 1c19e72345..1a3a9c5384 100644
--- a/src/core/lib/debug/stats.h
+++ b/src/core/lib/debug/stats.h
@@ -23,9 +23,7 @@
#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];
@@ -62,8 +60,6 @@ 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.h b/src/core/lib/debug/stats_data.h
index fbfcce83ba..7bd6ccff6f 100644
--- a/src/core/lib/debug/stats_data.h
+++ b/src/core/lib/debug/stats_data.h
@@ -24,9 +24,7 @@
#include <inttypes.h>
#include "src/core/lib/iomgr/exec_ctx.h"
-#ifdef __cplusplus
-extern "C" {
-#endif
+
typedef enum {
GRPC_STATS_COUNTER_CLIENT_CALLS_CREATED,
@@ -502,8 +500,6 @@ 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.h b/src/core/lib/debug/trace.h
index 7447d5d94a..237793eeb3 100644
--- a/src/core/lib/debug/trace.h
+++ b/src/core/lib/debug/trace.h
@@ -23,9 +23,7 @@
#include <grpc/support/port_platform.h>
#include <stdbool.h>
-#ifdef __cplusplus
-extern "C" {
-#endif
+
#if defined(__has_feature)
#if __has_feature(thread_sanitizer)
@@ -56,8 +54,6 @@ 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.h b/src/core/lib/http/format_request.h
index 32054805b4..65be293f1b 100644
--- a/src/core/lib/http/format_request.h
+++ b/src/core/lib/http/format_request.h
@@ -22,9 +22,7 @@
#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,
@@ -33,8 +31,6 @@ grpc_slice grpc_httpcli_format_post_request(const grpc_httpcli_request* request,
grpc_slice grpc_httpcli_format_connect_request(
const grpc_httpcli_request* request);
-#ifdef __cplusplus
-}
-#endif
+
#endif /* GRPC_CORE_LIB_HTTP_FORMAT_REQUEST_H */
diff --git a/src/core/lib/http/httpcli.h b/src/core/lib/http/httpcli.h
index a3411341ad..d1027b82c3 100644
--- a/src/core/lib/http/httpcli.h
+++ b/src/core/lib/http/httpcli.h
@@ -32,9 +32,7 @@
/* 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
@@ -127,8 +125,6 @@ typedef int (*grpc_httpcli_post_override)(
void grpc_httpcli_set_override(grpc_httpcli_get_override get,
grpc_httpcli_post_override post);
-#ifdef __cplusplus
-}
-#endif
+
#endif /* GRPC_CORE_LIB_HTTP_HTTPCLI_H */
diff --git a/src/core/lib/http/parser.h b/src/core/lib/http/parser.h
index 3d28481c4c..0a17e6b694 100644
--- a/src/core/lib/http/parser.h
+++ b/src/core/lib/http/parser.h
@@ -27,9 +27,7 @@
/* 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 {
@@ -113,8 +111,6 @@ void grpc_http_response_destroy(grpc_http_response* response);
extern grpc_tracer_flag grpc_http1_trace;
-#ifdef __cplusplus
-}
-#endif
+
#endif /* GRPC_CORE_LIB_HTTP_PARSER_H */
diff --git a/src/core/lib/iomgr/block_annotate.h b/src/core/lib/iomgr/block_annotate.h
index fcbfe9eb1a..6eecd651f9 100644
--- a/src/core/lib/iomgr/block_annotate.h
+++ b/src/core/lib/iomgr/block_annotate.h
@@ -19,16 +19,12 @@
#ifndef GRPC_CORE_LIB_IOMGR_BLOCK_ANNOTATE_H
#define GRPC_CORE_LIB_IOMGR_BLOCK_ANNOTATE_H
-#ifdef __cplusplus
-extern "C" {
-#endif
+
void gpr_thd_start_blocking_region();
void gpr_thd_end_blocking_region();
-#ifdef __cplusplus
-}
-#endif
+
/* These annotations identify the beginning and end of regions where
the code may block for reasons other than synchronization functions.
diff --git a/src/core/lib/iomgr/call_combiner.h b/src/core/lib/iomgr/call_combiner.h
index 527f84fce0..66aaf50a49 100644
--- a/src/core/lib/iomgr/call_combiner.h
+++ b/src/core/lib/iomgr/call_combiner.h
@@ -27,9 +27,7 @@
#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.
@@ -122,8 +120,6 @@ 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/combiner.h b/src/core/lib/iomgr/combiner.h
index f8a8b9df62..e37e621a75 100644
--- a/src/core/lib/iomgr/combiner.h
+++ b/src/core/lib/iomgr/combiner.h
@@ -26,9 +26,7 @@
#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.
@@ -67,8 +65,6 @@ 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.h b/src/core/lib/iomgr/endpoint.h
index 1b0a9e725e..8918438d23 100644
--- a/src/core/lib/iomgr/endpoint.h
+++ b/src/core/lib/iomgr/endpoint.h
@@ -26,9 +26,7 @@
#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. */
@@ -106,8 +104,6 @@ struct grpc_endpoint {
const grpc_endpoint_vtable* vtable;
};
-#ifdef __cplusplus
-}
-#endif
+
#endif /* GRPC_CORE_LIB_IOMGR_ENDPOINT_H */
diff --git a/src/core/lib/iomgr/endpoint_pair.h b/src/core/lib/iomgr/endpoint_pair.h
index 219eea8550..35158da0aa 100644
--- a/src/core/lib/iomgr/endpoint_pair.h
+++ b/src/core/lib/iomgr/endpoint_pair.h
@@ -21,9 +21,7 @@
#include "src/core/lib/iomgr/endpoint.h"
-#ifdef __cplusplus
-extern "C" {
-#endif
+
typedef struct {
grpc_endpoint* client;
@@ -33,8 +31,6 @@ typedef struct {
grpc_endpoint_pair grpc_iomgr_create_endpoint_pair(const char* name,
grpc_channel_args* args);
-#ifdef __cplusplus
-}
-#endif
+
#endif /* GRPC_CORE_LIB_IOMGR_ENDPOINT_PAIR_H */
diff --git a/src/core/lib/iomgr/error.h b/src/core/lib/iomgr/error.h
index 8d7aea4872..f0d4437a51 100644
--- a/src/core/lib/iomgr/error.h
+++ b/src/core/lib/iomgr/error.h
@@ -29,9 +29,7 @@
#include "src/core/lib/debug/trace.h"
-#ifdef __cplusplus
-extern "C" {
-#endif
+
/// Opaque representation of an error.
/// See https://github.com/grpc/grpc/blob/master/doc/core/grpc-error.md for a
@@ -205,8 +203,6 @@ bool grpc_log_if_error(const char* what, grpc_error* error, const char* file,
#define GRPC_LOG_IF_ERROR(what, error) \
grpc_log_if_error((what), (error), __FILE__, __LINE__)
-#ifdef __cplusplus
-}
-#endif
+
#endif /* GRPC_CORE_LIB_IOMGR_ERROR_H */
diff --git a/src/core/lib/iomgr/error_internal.h b/src/core/lib/iomgr/error_internal.h
index d5ccbae9e7..26088b2210 100644
--- a/src/core/lib/iomgr/error_internal.h
+++ b/src/core/lib/iomgr/error_internal.h
@@ -25,9 +25,7 @@
#include <grpc/support/sync.h>
#include "src/core/lib/iomgr/error.h"
-#ifdef __cplusplus
-extern "C" {
-#endif
+
typedef struct grpc_linked_error grpc_linked_error;
@@ -62,8 +60,6 @@ struct grpc_error {
bool grpc_error_is_special(struct grpc_error* err);
-#ifdef __cplusplus
-}
-#endif
+
#endif /* GRPC_CORE_LIB_IOMGR_ERROR_INTERNAL_H */
diff --git a/src/core/lib/iomgr/ev_epoll1_linux.h b/src/core/lib/iomgr/ev_epoll1_linux.h
index 3e66747f6c..03b61f5eb1 100644
--- a/src/core/lib/iomgr/ev_epoll1_linux.h
+++ b/src/core/lib/iomgr/ev_epoll1_linux.h
@@ -22,16 +22,12 @@
#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);
-#ifdef __cplusplus
-}
-#endif
+
#endif /* GRPC_CORE_LIB_IOMGR_EV_EPOLL1_LINUX_H */
diff --git a/src/core/lib/iomgr/ev_epollex_linux.h b/src/core/lib/iomgr/ev_epollex_linux.h
index 22b536c7d4..6eb980d593 100644
--- a/src/core/lib/iomgr/ev_epollex_linux.h
+++ b/src/core/lib/iomgr/ev_epollex_linux.h
@@ -22,15 +22,11 @@
#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);
-#ifdef __cplusplus
-}
-#endif
+
#endif /* GRPC_CORE_LIB_IOMGR_EV_EPOLLEX_LINUX_H */
diff --git a/src/core/lib/iomgr/ev_epollsig_linux.h b/src/core/lib/iomgr/ev_epollsig_linux.h
index ca68595734..15e94bba73 100644
--- a/src/core/lib/iomgr/ev_epollsig_linux.h
+++ b/src/core/lib/iomgr/ev_epollsig_linux.h
@@ -22,9 +22,7 @@
#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);
@@ -34,8 +32,6 @@ 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.h b/src/core/lib/iomgr/ev_poll_posix.h
index 626e95bc8f..820e14c337 100644
--- a/src/core/lib/iomgr/ev_poll_posix.h
+++ b/src/core/lib/iomgr/ev_poll_posix.h
@@ -21,15 +21,11 @@
#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);
-#ifdef __cplusplus
-}
-#endif
+
#endif /* GRPC_CORE_LIB_IOMGR_EV_POLL_POSIX_H */
diff --git a/src/core/lib/iomgr/ev_posix.cc b/src/core/lib/iomgr/ev_posix.cc
index 076d2e6bab..6157b54404 100644
--- a/src/core/lib/iomgr/ev_posix.cc
+++ b/src/core/lib/iomgr/ev_posix.cc
@@ -63,8 +63,6 @@ typedef struct {
namespace {
-extern "C" {
-
grpc_poll_function_type real_poll_function;
int dummy_poll(struct pollfd fds[], nfds_t nfds, int timeout) {
@@ -76,7 +74,6 @@ int dummy_poll(struct pollfd fds[], nfds_t nfds, int timeout) {
return -1;
}
}
-} // extern "C"
const grpc_event_engine_vtable* init_non_polling(bool explicit_request) {
if (!explicit_request) {
diff --git a/src/core/lib/iomgr/ev_posix.h b/src/core/lib/iomgr/ev_posix.h
index d719b8f3c9..acc7f3df39 100644
--- a/src/core/lib/iomgr/ev_posix.h
+++ b/src/core/lib/iomgr/ev_posix.h
@@ -27,9 +27,7 @@
#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 */
@@ -162,8 +160,6 @@ 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();
-#ifdef __cplusplus
-}
-#endif
+
#endif /* GRPC_CORE_LIB_IOMGR_EV_POSIX_H */
diff --git a/src/core/lib/iomgr/exec_ctx.h b/src/core/lib/iomgr/exec_ctx.h
index bd27506152..1baca89d6e 100644
--- a/src/core/lib/iomgr/exec_ctx.h
+++ b/src/core/lib/iomgr/exec_ctx.h
@@ -24,9 +24,7 @@
#include "src/core/lib/iomgr/closure.h"
-#ifdef __cplusplus
-extern "C" {
-#endif
+
typedef gpr_atm grpc_millis;
@@ -124,8 +122,4 @@ gpr_timespec grpc_millis_to_timespec(grpc_millis millis, gpr_clock_type clock);
grpc_millis grpc_timespec_to_millis_round_down(gpr_timespec timespec);
grpc_millis grpc_timespec_to_millis_round_up(gpr_timespec timespec);
-#ifdef __cplusplus
-}
-#endif
-
#endif /* GRPC_CORE_LIB_IOMGR_EXEC_CTX_H */
diff --git a/src/core/lib/iomgr/executor.h b/src/core/lib/iomgr/executor.h
index 8418ace06e..35823b0f0e 100644
--- a/src/core/lib/iomgr/executor.h
+++ b/src/core/lib/iomgr/executor.h
@@ -21,9 +21,7 @@
#include "src/core/lib/iomgr/closure.h"
-#ifdef __cplusplus
-extern "C" {
-#endif
+
typedef enum {
GRPC_EXECUTOR_SHORT,
@@ -49,8 +47,6 @@ bool grpc_executor_is_threaded();
grpc_executor_shutdown */
void grpc_executor_set_threading(grpc_exec_ctx* exec_ctx, bool enable);
-#ifdef __cplusplus
-}
-#endif
+
#endif /* GRPC_CORE_LIB_IOMGR_EXECUTOR_H */
diff --git a/src/core/lib/iomgr/gethostname.h b/src/core/lib/iomgr/gethostname.h
index 2e65b5ffbf..19da54378a 100644
--- a/src/core/lib/iomgr/gethostname.h
+++ b/src/core/lib/iomgr/gethostname.h
@@ -19,16 +19,12 @@
#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/iocp_windows.h b/src/core/lib/iomgr/iocp_windows.h
index d112c50538..ca6d3c91bd 100644
--- a/src/core/lib/iomgr/iocp_windows.h
+++ b/src/core/lib/iomgr/iocp_windows.h
@@ -27,9 +27,7 @@
#include "src/core/lib/iomgr/socket_windows.h"
-#ifdef __cplusplus
-extern "C" {
-#endif
+
typedef enum {
GRPC_IOCP_WORK_WORK,
@@ -45,9 +43,7 @@ void grpc_iocp_flush(void);
void grpc_iocp_shutdown(void);
void grpc_iocp_add_socket(grpc_winsocket*);
-#ifdef __cplusplus
-}
-#endif
+
#endif
diff --git a/src/core/lib/iomgr/iomgr.h b/src/core/lib/iomgr/iomgr.h
index d1549c8c63..4e4fb4a1a2 100644
--- a/src/core/lib/iomgr/iomgr.h
+++ b/src/core/lib/iomgr/iomgr.h
@@ -22,9 +22,7 @@
#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);
@@ -36,8 +34,6 @@ void grpc_iomgr_start(grpc_exec_ctx* exec_ctx);
* exec_ctx. */
void grpc_iomgr_shutdown(grpc_exec_ctx* exec_ctx);
-#ifdef __cplusplus
-}
-#endif
+
#endif /* GRPC_CORE_LIB_IOMGR_IOMGR_H */
diff --git a/src/core/lib/iomgr/iomgr_internal.h b/src/core/lib/iomgr/iomgr_internal.h
index b818c68da0..144a92a6c4 100644
--- a/src/core/lib/iomgr/iomgr_internal.h
+++ b/src/core/lib/iomgr/iomgr_internal.h
@@ -23,9 +23,7 @@
#include "src/core/lib/iomgr/iomgr.h"
-#ifdef __cplusplus
-extern "C" {
-#endif
+
typedef struct grpc_iomgr_object {
char* name;
@@ -44,8 +42,6 @@ void grpc_iomgr_platform_shutdown(void);
bool grpc_iomgr_abort_on_leaks(void);
-#ifdef __cplusplus
-}
-#endif
+
#endif /* GRPC_CORE_LIB_IOMGR_IOMGR_INTERNAL_H */
diff --git a/src/core/lib/iomgr/iomgr_uv.h b/src/core/lib/iomgr/iomgr_uv.h
index bc42ca8c1c..218e696e3a 100644
--- a/src/core/lib/iomgr/iomgr_uv.h
+++ b/src/core/lib/iomgr/iomgr_uv.h
@@ -23,17 +23,13 @@
#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() \
diff --git a/src/core/lib/iomgr/is_epollexclusive_available.h b/src/core/lib/iomgr/is_epollexclusive_available.h
index 9ae9c5c191..8dc7af0bce 100644
--- a/src/core/lib/iomgr/is_epollexclusive_available.h
+++ b/src/core/lib/iomgr/is_epollexclusive_available.h
@@ -21,14 +21,10 @@
#include <stdbool.h>
-#ifdef __cplusplus
-extern "C" {
-#endif
+
bool grpc_is_epollexclusive_available(void);
-#ifdef __cplusplus
-}
-#endif
+
#endif /* GRPC_CORE_LIB_IOMGR_IS_EPOLLEXCLUSIVE_AVAILABLE_H */
diff --git a/src/core/lib/iomgr/load_file.h b/src/core/lib/iomgr/load_file.h
index 5b367c189d..61e0cb1a1a 100644
--- a/src/core/lib/iomgr/load_file.h
+++ b/src/core/lib/iomgr/load_file.h
@@ -25,17 +25,13 @@
#include "src/core/lib/iomgr/error.h"
-#ifdef __cplusplus
-extern "C" {
-#endif
+
/* Loads the content of a file into a slice. add_null_terminator will add
a NULL terminator if non-zero. */
grpc_error* grpc_load_file(const char* filename, int add_null_terminator,
grpc_slice* slice);
-#ifdef __cplusplus
-}
-#endif
+
#endif /* GRPC_CORE_LIB_IOMGR_LOAD_FILE_H */
diff --git a/src/core/lib/iomgr/polling_entity.h b/src/core/lib/iomgr/polling_entity.h
index 867e085153..f0b4617a9d 100644
--- a/src/core/lib/iomgr/polling_entity.h
+++ b/src/core/lib/iomgr/polling_entity.h
@@ -22,9 +22,7 @@
#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,
@@ -68,8 +66,6 @@ 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);
-#ifdef __cplusplus
-}
-#endif
+
#endif /* GRPC_CORE_LIB_IOMGR_POLLING_ENTITY_H */
diff --git a/src/core/lib/iomgr/pollset.h b/src/core/lib/iomgr/pollset.h
index c99b930e8e..761aa80643 100644
--- a/src/core/lib/iomgr/pollset.h
+++ b/src/core/lib/iomgr/pollset.h
@@ -25,9 +25,7 @@
#include "src/core/lib/iomgr/exec_ctx.h"
-#ifdef __cplusplus
-extern "C" {
-#endif
+
#ifndef NDEBUG
extern grpc_tracer_flag grpc_trace_fd_refcount;
@@ -84,8 +82,6 @@ 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 0167a50a56..4a3793eccb 100644
--- a/src/core/lib/iomgr/pollset_set.h
+++ b/src/core/lib/iomgr/pollset_set.h
@@ -21,9 +21,7 @@
#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
@@ -48,8 +46,6 @@ void grpc_pollset_set_del_pollset_set(grpc_exec_ctx* exec_ctx,
grpc_pollset_set* bag,
grpc_pollset_set* item);
-#ifdef __cplusplus
-}
-#endif
+
#endif /* GRPC_CORE_LIB_IOMGR_POLLSET_SET_H */
diff --git a/src/core/lib/iomgr/pollset_uv.h b/src/core/lib/iomgr/pollset_uv.h
index 5cc9faf4ff..ce62297cc7 100644
--- a/src/core/lib/iomgr/pollset_uv.h
+++ b/src/core/lib/iomgr/pollset_uv.h
@@ -19,17 +19,13 @@
#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);
-#ifdef __cplusplus
-}
-#endif
+
#endif /* GRPC_CORE_LIB_IOMGR_POLLSET_UV_H */
diff --git a/src/core/lib/iomgr/pollset_windows.h b/src/core/lib/iomgr/pollset_windows.h
index f6da9da601..d0b4144c27 100644
--- a/src/core/lib/iomgr/pollset_windows.h
+++ b/src/core/lib/iomgr/pollset_windows.h
@@ -26,9 +26,7 @@
#ifdef GRPC_WINSOCK_SOCKET
#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
@@ -67,9 +65,7 @@ struct grpc_pollset {
void grpc_pollset_global_init(void);
void grpc_pollset_global_shutdown(void);
-#ifdef __cplusplus
-}
-#endif
+
#endif
diff --git a/src/core/lib/iomgr/resolve_address.h b/src/core/lib/iomgr/resolve_address.h
index 847e10f177..790d614aae 100644
--- a/src/core/lib/iomgr/resolve_address.h
+++ b/src/core/lib/iomgr/resolve_address.h
@@ -25,9 +25,7 @@
#define GRPC_MAX_SOCKADDR_SIZE 128
-#ifdef __cplusplus
-extern "C" {
-#endif
+
typedef struct {
char addr[GRPC_MAX_SOCKADDR_SIZE];
@@ -56,8 +54,6 @@ extern grpc_error* (*grpc_blocking_resolve_address)(
const char* name, const char* default_port,
grpc_resolved_addresses** addresses);
-#ifdef __cplusplus
-}
-#endif
+
#endif /* GRPC_CORE_LIB_IOMGR_RESOLVE_ADDRESS_H */
diff --git a/src/core/lib/iomgr/resource_quota.h b/src/core/lib/iomgr/resource_quota.h
index fcdf9c2de5..331efe0e35 100644
--- a/src/core/lib/iomgr/resource_quota.h
+++ b/src/core/lib/iomgr/resource_quota.h
@@ -24,9 +24,7 @@
#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.
@@ -154,8 +152,6 @@ grpc_slice grpc_resource_user_slice_malloc(grpc_exec_ctx* exec_ctx,
grpc_resource_user* resource_user,
size_t size);
-#ifdef __cplusplus
-}
-#endif
+
#endif /* GRPC_CORE_LIB_IOMGR_RESOURCE_QUOTA_H */
diff --git a/src/core/lib/iomgr/sockaddr_utils.h b/src/core/lib/iomgr/sockaddr_utils.h
index 090470d49e..0d5cc5bb42 100644
--- a/src/core/lib/iomgr/sockaddr_utils.h
+++ b/src/core/lib/iomgr/sockaddr_utils.h
@@ -21,9 +21,7 @@
#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.
@@ -81,8 +79,6 @@ const char* grpc_sockaddr_get_uri_scheme(const grpc_resolved_address* addr);
int grpc_sockaddr_get_family(const grpc_resolved_address* resolved_addr);
-#ifdef __cplusplus
-}
-#endif
+
#endif /* GRPC_CORE_LIB_IOMGR_SOCKADDR_UTILS_H */
diff --git a/src/core/lib/iomgr/socket_factory_posix.h b/src/core/lib/iomgr/socket_factory_posix.h
index e8257b07c4..920a72901e 100644
--- a/src/core/lib/iomgr/socket_factory_posix.h
+++ b/src/core/lib/iomgr/socket_factory_posix.h
@@ -23,9 +23,7 @@
#include <grpc/support/sync.h>
#include "src/core/lib/iomgr/resolve_address.h"
-#ifdef __cplusplus
-extern "C" {
-#endif
+
/** The virtual table of grpc_socket_factory */
typedef struct {
@@ -68,8 +66,6 @@ int grpc_socket_factory_compare(grpc_socket_factory* a, grpc_socket_factory* b);
grpc_socket_factory* grpc_socket_factory_ref(grpc_socket_factory* factory);
void grpc_socket_factory_unref(grpc_socket_factory* factory);
-#ifdef __cplusplus
-}
-#endif
+
#endif /* GRPC_CORE_LIB_IOMGR_SOCKET_FACTORY_POSIX_H */
diff --git a/src/core/lib/iomgr/socket_mutator.h b/src/core/lib/iomgr/socket_mutator.h
index b4103f7e93..703aee3145 100644
--- a/src/core/lib/iomgr/socket_mutator.h
+++ b/src/core/lib/iomgr/socket_mutator.h
@@ -24,9 +24,7 @@
#include <stdbool.h>
-#ifdef __cplusplus
-extern "C" {
-#endif
+
/** The virtual table of grpc_socket_mutator */
typedef struct {
@@ -60,8 +58,6 @@ int grpc_socket_mutator_compare(grpc_socket_mutator* a, grpc_socket_mutator* b);
grpc_socket_mutator* grpc_socket_mutator_ref(grpc_socket_mutator* mutator);
void grpc_socket_mutator_unref(grpc_socket_mutator* mutator);
-#ifdef __cplusplus
-}
-#endif
+
#endif /* GRPC_CORE_LIB_IOMGR_SOCKET_MUTATOR_H */
diff --git a/src/core/lib/iomgr/socket_utils.h b/src/core/lib/iomgr/socket_utils.h
index 4816ab6be7..dc5c4dc56e 100644
--- a/src/core/lib/iomgr/socket_utils.h
+++ b/src/core/lib/iomgr/socket_utils.h
@@ -21,15 +21,11 @@
#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);
-#ifdef __cplusplus
-}
-#endif
+
#endif /* GRPC_CORE_LIB_IOMGR_SOCKET_UTILS_H */
diff --git a/src/core/lib/iomgr/socket_utils_posix.h b/src/core/lib/iomgr/socket_utils_posix.h
index 7a9c8139e7..02fdd02e2b 100644
--- a/src/core/lib/iomgr/socket_utils_posix.h
+++ b/src/core/lib/iomgr/socket_utils_posix.h
@@ -29,9 +29,7 @@
#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,
@@ -133,8 +131,6 @@ 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);
-#ifdef __cplusplus
-}
-#endif
+
#endif /* GRPC_CORE_LIB_IOMGR_SOCKET_UTILS_POSIX_H */
diff --git a/src/core/lib/iomgr/socket_windows.h b/src/core/lib/iomgr/socket_windows.h
index c3ad99d82f..5a09c52b7a 100644
--- a/src/core/lib/iomgr/socket_windows.h
+++ b/src/core/lib/iomgr/socket_windows.h
@@ -31,9 +31,7 @@
#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
@@ -114,9 +112,7 @@ void grpc_socket_become_ready(grpc_exec_ctx* exec_ctx,
grpc_winsocket* winsocket,
grpc_winsocket_callback_info* ci);
-#ifdef __cplusplus
-}
-#endif
+
#endif
diff --git a/src/core/lib/iomgr/tcp_client.h b/src/core/lib/iomgr/tcp_client.h
index c18d8a9316..9ad06f2f9e 100644
--- a/src/core/lib/iomgr/tcp_client.h
+++ b/src/core/lib/iomgr/tcp_client.h
@@ -25,9 +25,7 @@
#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
@@ -41,8 +39,6 @@ void grpc_tcp_client_connect(grpc_exec_ctx* exec_ctx, grpc_closure* on_connect,
const grpc_resolved_address* addr,
grpc_millis deadline);
-#ifdef __cplusplus
-}
-#endif
+
#endif /* GRPC_CORE_LIB_IOMGR_TCP_CLIENT_H */
diff --git a/src/core/lib/iomgr/tcp_client_posix.cc b/src/core/lib/iomgr/tcp_client_posix.cc
index cb0f627c94..92120a5022 100644
--- a/src/core/lib/iomgr/tcp_client_posix.cc
+++ b/src/core/lib/iomgr/tcp_client_posix.cc
@@ -334,13 +334,11 @@ 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,
grpc_millis 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 13d917891e..aac74effba 100644
--- a/src/core/lib/iomgr/tcp_client_posix.h
+++ b/src/core/lib/iomgr/tcp_client_posix.h
@@ -23,16 +23,12 @@
#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);
-#ifdef __cplusplus
-}
-#endif
+
#endif /* GRPC_CORE_LIB_IOMGR_TCP_CLIENT_POSIX_H */
diff --git a/src/core/lib/iomgr/tcp_client_windows.cc b/src/core/lib/iomgr/tcp_client_windows.cc
index 103e6b78de..5e30725e90 100644
--- a/src/core/lib/iomgr/tcp_client_windows.cc
+++ b/src/core/lib/iomgr/tcp_client_windows.cc
@@ -226,13 +226,11 @@ 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,
grpc_millis 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.h b/src/core/lib/iomgr/tcp_posix.h
index ff1060b0ff..273e3277a9 100644
--- a/src/core/lib/iomgr/tcp_posix.h
+++ b/src/core/lib/iomgr/tcp_posix.h
@@ -33,9 +33,7 @@
#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;
@@ -57,8 +55,6 @@ 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);
-#ifdef __cplusplus
-}
-#endif
+
#endif /* GRPC_CORE_LIB_IOMGR_TCP_POSIX_H */
diff --git a/src/core/lib/iomgr/tcp_server.h b/src/core/lib/iomgr/tcp_server.h
index ef983199b8..ab271f997c 100644
--- a/src/core/lib/iomgr/tcp_server.h
+++ b/src/core/lib/iomgr/tcp_server.h
@@ -25,9 +25,7 @@
#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;
@@ -102,8 +100,6 @@ 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);
-#ifdef __cplusplus
-}
-#endif
+
#endif /* GRPC_CORE_LIB_IOMGR_TCP_SERVER_H */
diff --git a/src/core/lib/iomgr/tcp_server_utils_posix.h b/src/core/lib/iomgr/tcp_server_utils_posix.h
index 608fba3346..fb2510ec39 100644
--- a/src/core/lib/iomgr/tcp_server_utils_posix.h
+++ b/src/core/lib/iomgr/tcp_server_utils_posix.h
@@ -24,9 +24,7 @@
#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 {
@@ -121,8 +119,6 @@ grpc_error* grpc_tcp_server_prepare_socket(int fd,
/* Ruturn true if the platform supports ifaddrs */
bool grpc_tcp_server_have_ifaddrs(void);
-#ifdef __cplusplus
-}
-#endif
+
#endif /* GRPC_CORE_LIB_IOMGR_TCP_SERVER_UTILS_POSIX_H */
diff --git a/src/core/lib/iomgr/tcp_uv.h b/src/core/lib/iomgr/tcp_uv.h
index 708e8469e6..df12c882e0 100644
--- a/src/core/lib/iomgr/tcp_uv.h
+++ b/src/core/lib/iomgr/tcp_uv.h
@@ -42,17 +42,13 @@ 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);
-#ifdef __cplusplus
-}
-#endif
+
#endif /* GRPC_UV */
diff --git a/src/core/lib/iomgr/tcp_windows.h b/src/core/lib/iomgr/tcp_windows.h
index 9c7ccdf132..ccfde72723 100644
--- a/src/core/lib/iomgr/tcp_windows.h
+++ b/src/core/lib/iomgr/tcp_windows.h
@@ -35,9 +35,7 @@
#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.
@@ -48,9 +46,7 @@ grpc_endpoint* grpc_tcp_create(grpc_exec_ctx* exec_ctx, grpc_winsocket* socket,
grpc_error* grpc_tcp_prepare_socket(SOCKET sock);
-#ifdef __cplusplus
-}
-#endif
+
#endif
diff --git a/src/core/lib/iomgr/time_averaged_stats.h b/src/core/lib/iomgr/time_averaged_stats.h
index d38ed272b6..519bc2db16 100644
--- a/src/core/lib/iomgr/time_averaged_stats.h
+++ b/src/core/lib/iomgr/time_averaged_stats.h
@@ -19,9 +19,7 @@
#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
@@ -74,8 +72,6 @@ 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);
-#ifdef __cplusplus
-}
-#endif
+
#endif /* GRPC_CORE_LIB_IOMGR_TIME_AVERAGED_STATS_H */
diff --git a/src/core/lib/iomgr/timer.h b/src/core/lib/iomgr/timer.h
index cd8334eceb..9e454d995d 100644
--- a/src/core/lib/iomgr/timer.h
+++ b/src/core/lib/iomgr/timer.h
@@ -32,9 +32,7 @@
#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;
@@ -106,8 +104,6 @@ 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.cc b/src/core/lib/iomgr/timer_generic.cc
index a4bfbcb342..4216caa54f 100644
--- a/src/core/lib/iomgr/timer_generic.cc
+++ b/src/core/lib/iomgr/timer_generic.cc
@@ -42,11 +42,9 @@
#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.h b/src/core/lib/iomgr/timer_heap.h
index ae56e5a73e..12a7ab2884 100644
--- a/src/core/lib/iomgr/timer_heap.h
+++ b/src/core/lib/iomgr/timer_heap.h
@@ -21,9 +21,7 @@
#include "src/core/lib/iomgr/timer.h"
-#ifdef __cplusplus
-extern "C" {
-#endif
+
typedef struct {
grpc_timer** timers;
@@ -43,8 +41,6 @@ void grpc_timer_heap_pop(grpc_timer_heap* heap);
int grpc_timer_heap_is_empty(grpc_timer_heap* heap);
-#ifdef __cplusplus
-}
-#endif
+
#endif /* GRPC_CORE_LIB_IOMGR_TIMER_HEAP_H */
diff --git a/src/core/lib/iomgr/timer_manager.h b/src/core/lib/iomgr/timer_manager.h
index 72960d6ffc..861ee6845e 100644
--- a/src/core/lib/iomgr/timer_manager.h
+++ b/src/core/lib/iomgr/timer_manager.h
@@ -21,9 +21,7 @@
#include <stdbool.h>
-#ifdef __cplusplus
-extern "C" {
-#endif
+
/* Timer Manager tries to keep one thread waiting for the next timeout at all
times */
@@ -38,8 +36,6 @@ void grpc_timer_manager_set_threading(bool enabled);
* disabled */
void grpc_timer_manager_tick(void);
-#ifdef __cplusplus
-}
-#endif
+
#endif /* GRPC_CORE_LIB_IOMGR_TIMER_MANAGER_H */
diff --git a/src/core/lib/iomgr/timer_uv.cc b/src/core/lib/iomgr/timer_uv.cc
index df40e54ae6..3d0450cfb5 100644
--- a/src/core/lib/iomgr/timer_uv.cc
+++ b/src/core/lib/iomgr/timer_uv.cc
@@ -29,11 +29,9 @@
#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); }
diff --git a/src/core/lib/iomgr/udp_server.h b/src/core/lib/iomgr/udp_server.h
index bca0f049fb..6bd5b205c3 100644
--- a/src/core/lib/iomgr/udp_server.h
+++ b/src/core/lib/iomgr/udp_server.h
@@ -23,9 +23,7 @@
#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 */
@@ -77,8 +75,6 @@ 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);
-#ifdef __cplusplus
-}
-#endif
+
#endif /* GRPC_CORE_LIB_IOMGR_UDP_SERVER_H */
diff --git a/src/core/lib/iomgr/unix_sockets_posix.h b/src/core/lib/iomgr/unix_sockets_posix.h
index be3c33d9c2..a0d9072370 100644
--- a/src/core/lib/iomgr/unix_sockets_posix.h
+++ b/src/core/lib/iomgr/unix_sockets_posix.h
@@ -25,9 +25,7 @@
#include "src/core/lib/iomgr/resolve_address.h"
-#ifdef __cplusplus
-extern "C" {
-#endif
+
void grpc_create_socketpair_if_unix(int sv[2]);
@@ -42,8 +40,6 @@ void grpc_unlink_if_unix_domain_socket(
char* grpc_sockaddr_to_uri_unix_if_possible(
const grpc_resolved_address* resolved_addr);
-#ifdef __cplusplus
-}
-#endif
+
#endif /* GRPC_CORE_LIB_IOMGR_UNIX_SOCKETS_POSIX_H */
diff --git a/src/core/lib/iomgr/wakeup_fd_cv.h b/src/core/lib/iomgr/wakeup_fd_cv.h
index dcd7bdb560..94473318e5 100644
--- a/src/core/lib/iomgr/wakeup_fd_cv.h
+++ b/src/core/lib/iomgr/wakeup_fd_cv.h
@@ -40,9 +40,7 @@
#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;
@@ -68,8 +66,6 @@ typedef struct 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_pipe.h b/src/core/lib/iomgr/wakeup_fd_pipe.h
index 9bbb5e2ff7..bb1dfd7a26 100644
--- a/src/core/lib/iomgr/wakeup_fd_pipe.h
+++ b/src/core/lib/iomgr/wakeup_fd_pipe.h
@@ -21,14 +21,10 @@
#include "src/core/lib/iomgr/wakeup_fd_posix.h"
-#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.h b/src/core/lib/iomgr/wakeup_fd_posix.h
index ae7849f98c..65a80d44f4 100644
--- a/src/core/lib/iomgr/wakeup_fd_posix.h
+++ b/src/core/lib/iomgr/wakeup_fd_posix.h
@@ -49,9 +49,7 @@
#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);
@@ -95,8 +93,6 @@ 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.h b/src/core/lib/json/json.h
index c9fdec4ecb..0e841e0726 100644
--- a/src/core/lib/json/json.h
+++ b/src/core/lib/json/json.h
@@ -23,9 +23,7 @@
#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.
@@ -74,8 +72,6 @@ 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);
-#ifdef __cplusplus
-}
-#endif
+
#endif /* GRPC_CORE_LIB_JSON_JSON_H */
diff --git a/src/core/lib/json/json_reader.h b/src/core/lib/json/json_reader.h
index 2636d2b1d9..62718bbcdc 100644
--- a/src/core/lib/json/json_reader.h
+++ b/src/core/lib/json/json_reader.h
@@ -22,9 +22,7 @@
#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,
@@ -146,8 +144,6 @@ void grpc_json_reader_init(grpc_json_reader* reader,
*/
int grpc_json_reader_is_complete(grpc_json_reader* reader);
-#ifdef __cplusplus
-}
-#endif
+
#endif /* GRPC_CORE_LIB_JSON_JSON_READER_H */
diff --git a/src/core/lib/json/json_writer.h b/src/core/lib/json/json_writer.h
index 93eeb2031b..ead8426d03 100644
--- a/src/core/lib/json/json_writer.h
+++ b/src/core/lib/json/json_writer.h
@@ -35,9 +35,7 @@
#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. */
@@ -83,8 +81,6 @@ 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);
-#ifdef __cplusplus
-}
-#endif
+
#endif /* GRPC_CORE_LIB_JSON_JSON_WRITER_H */
diff --git a/src/core/lib/profiling/timers.h b/src/core/lib/profiling/timers.h
index 8b6c254c21..a0a0a4fff1 100644
--- a/src/core/lib/profiling/timers.h
+++ b/src/core/lib/profiling/timers.h
@@ -19,9 +19,7 @@
#ifndef GRPC_CORE_LIB_PROFILING_TIMERS_H
#define GRPC_CORE_LIB_PROFILING_TIMERS_H
-#ifdef __cplusplus
-extern "C" {
-#endif
+
void gpr_timers_global_init(void);
void gpr_timers_global_destroy(void);
@@ -84,9 +82,6 @@ void gpr_timer_set_enabled(int enabled);
#endif /* at least one profiler requested. */
-#ifdef __cplusplus
-}
-
#if (defined(GRPC_STAP_PROFILER) + defined(GRPC_BASIC_PROFILER) + \
defined(GRPC_CUSTOM_PROFILER))
namespace grpc {
@@ -111,6 +106,5 @@ class ProfileScope {
do { \
} while (false)
#endif
-#endif
#endif /* GRPC_CORE_LIB_PROFILING_TIMERS_H */
diff --git a/src/core/lib/security/context/security_context.h b/src/core/lib/security/context/security_context.h
index 4f049c4a3b..261bc167f5 100644
--- a/src/core/lib/security/context/security_context.h
+++ b/src/core/lib/security/context/security_context.h
@@ -26,9 +26,7 @@
extern grpc_tracer_flag grpc_trace_auth_context_refcount;
#endif
-#ifdef __cplusplus
-extern "C" {
-#endif
+
/* --- grpc_auth_context ---
@@ -116,8 +114,6 @@ grpc_auth_context* grpc_auth_context_from_arg(const grpc_arg* arg);
grpc_auth_context* grpc_find_auth_context_in_args(
const grpc_channel_args* args);
-#ifdef __cplusplus
-}
-#endif
+
#endif /* GRPC_CORE_LIB_SECURITY_CONTEXT_SECURITY_CONTEXT_H */
diff --git a/src/core/lib/security/credentials/composite/composite_credentials.h b/src/core/lib/security/credentials/composite/composite_credentials.h
index efb5f4f0c4..e3438dd3d1 100644
--- a/src/core/lib/security/credentials/composite/composite_credentials.h
+++ b/src/core/lib/security/credentials/composite/composite_credentials.h
@@ -21,9 +21,7 @@
#include "src/core/lib/security/credentials/credentials.h"
-#ifdef __cplusplus
-extern "C" {
-#endif
+
typedef struct {
grpc_call_credentials** creds_array;
@@ -57,9 +55,7 @@ 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.h b/src/core/lib/security/credentials/credentials.h
index c65b9660ea..f74b047edc 100644
--- a/src/core/lib/security/credentials/credentials.h
+++ b/src/core/lib/security/credentials/credentials.h
@@ -29,9 +29,7 @@
#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;
@@ -256,8 +254,6 @@ 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/fake/fake_credentials.h b/src/core/lib/security/credentials/fake/fake_credentials.h
index b8b58cc8fd..7645671cee 100644
--- a/src/core/lib/security/credentials/fake/fake_credentials.h
+++ b/src/core/lib/security/credentials/fake/fake_credentials.h
@@ -21,9 +21,7 @@
#include "src/core/lib/security/credentials/credentials.h"
-#ifdef __cplusplus
-extern "C" {
-#endif
+
/* -- Fake transport security credentials. -- */
@@ -60,8 +58,6 @@ typedef struct {
bool is_async;
} grpc_md_only_test_credentials;
-#ifdef __cplusplus
-}
-#endif
+
#endif /* GRPC_CORE_LIB_SECURITY_CREDENTIALS_FAKE_FAKE_CREDENTIALS_H */
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 a0f8dc954e..6453480f0f 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,9 +23,7 @@
#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 \
@@ -45,9 +43,7 @@ extern "C" {
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/jwt/json_token.h b/src/core/lib/security/credentials/jwt/json_token.h
index b2c3c09c25..038f470a42 100644
--- a/src/core/lib/security/credentials/jwt/json_token.h
+++ b/src/core/lib/security/credentials/jwt/json_token.h
@@ -19,9 +19,7 @@
#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>
@@ -74,8 +72,6 @@ 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.h b/src/core/lib/security/credentials/jwt/jwt_credentials.h
index d554613eed..cd461d217e 100644
--- a/src/core/lib/security/credentials/jwt/jwt_credentials.h
+++ b/src/core/lib/security/credentials/jwt/jwt_credentials.h
@@ -22,9 +22,7 @@
#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;
@@ -49,8 +47,6 @@ 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);
-#ifdef __cplusplus
-}
-#endif
+
#endif /* GRPC_CORE_LIB_SECURITY_CREDENTIALS_JWT_JWT_CREDENTIALS_H */
diff --git a/src/core/lib/security/credentials/jwt/jwt_verifier.h b/src/core/lib/security/credentials/jwt/jwt_verifier.h
index 8083cf9beb..98db50887b 100644
--- a/src/core/lib/security/credentials/jwt/jwt_verifier.h
+++ b/src/core/lib/security/credentials/jwt/jwt_verifier.h
@@ -32,9 +32,7 @@
#define GRPC_GOOGLE_SERVICE_ACCOUNTS_KEY_URL_PREFIX \
"www.googleapis.com/robot/v1/metadata/x509"
-#ifdef __cplusplus
-extern "C" {
-#endif
+
/* --- grpc_jwt_verifier_status. --- */
@@ -126,8 +124,6 @@ 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.h b/src/core/lib/security/credentials/oauth2/oauth2_credentials.h
index 32d3ff760d..57332f0a39 100644
--- a/src/core/lib/security/credentials/oauth2/oauth2_credentials.h
+++ b/src/core/lib/security/credentials/oauth2/oauth2_credentials.h
@@ -22,9 +22,7 @@
#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 {
@@ -106,8 +104,6 @@ grpc_oauth2_token_fetcher_credentials_parse_server_response(
grpc_exec_ctx* exec_ctx, const struct grpc_http_response* response,
grpc_mdelem* token_md, grpc_millis* token_lifetime);
-#ifdef __cplusplus
-}
-#endif
+
#endif /* GRPC_CORE_LIB_SECURITY_CREDENTIALS_OAUTH2_OAUTH2_CREDENTIALS_H */
diff --git a/src/core/lib/security/credentials/ssl/ssl_credentials.h b/src/core/lib/security/credentials/ssl/ssl_credentials.h
index 82b9ce11f6..5d10de71a3 100644
--- a/src/core/lib/security/credentials/ssl/ssl_credentials.h
+++ b/src/core/lib/security/credentials/ssl/ssl_credentials.h
@@ -20,9 +20,7 @@
#include "src/core/lib/security/credentials/credentials.h"
-#ifdef __cplusplus
-extern "C" {
-#endif
+
typedef struct {
grpc_channel_credentials base;
@@ -53,8 +51,6 @@ tsi_ssl_pem_key_cert_pair* grpc_convert_grpc_to_tsi_cert_pairs(
void grpc_tsi_ssl_pem_key_cert_pairs_destroy(tsi_ssl_pem_key_cert_pair* kp,
size_t num_key_cert_pairs);
-#ifdef __cplusplus
-}
-#endif
+
#endif /* GRPC_CORE_LIB_SECURITY_CREDENTIALS_SSL_SSL_CREDENTIALS_H */
diff --git a/src/core/lib/security/transport/auth_filters.h b/src/core/lib/security/transport/auth_filters.h
index 6376929890..add335d74f 100644
--- a/src/core/lib/security/transport/auth_filters.h
+++ b/src/core/lib/security/transport/auth_filters.h
@@ -22,9 +22,7 @@
#include <grpc/grpc_security.h>
#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;
@@ -36,8 +34,6 @@ void grpc_auth_metadata_context_build(
void grpc_auth_metadata_context_reset(grpc_auth_metadata_context* context);
-#ifdef __cplusplus
-}
-#endif
+
#endif /* GRPC_CORE_LIB_SECURITY_TRANSPORT_AUTH_FILTERS_H */
diff --git a/src/core/lib/security/transport/lb_targets_info.h b/src/core/lib/security/transport/lb_targets_info.h
index b4a0bc91da..0442d8df0b 100644
--- a/src/core/lib/security/transport/lb_targets_info.h
+++ b/src/core/lib/security/transport/lb_targets_info.h
@@ -21,9 +21,7 @@
#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(
@@ -33,8 +31,6 @@ 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);
-#ifdef __cplusplus
-}
-#endif
+
#endif /* GRPC_CORE_LIB_SECURITY_TRANSPORT_LB_TARGETS_INFO_H */
diff --git a/src/core/lib/security/transport/secure_endpoint.h b/src/core/lib/security/transport/secure_endpoint.h
index db8233f6e6..7f0843f17a 100644
--- a/src/core/lib/security/transport/secure_endpoint.h
+++ b/src/core/lib/security/transport/secure_endpoint.h
@@ -22,9 +22,7 @@
#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;
@@ -40,8 +38,6 @@ grpc_endpoint* grpc_secure_endpoint_create(
grpc_endpoint* to_wrap, grpc_slice* leftover_slices,
size_t leftover_nslices);
-#ifdef __cplusplus
-}
-#endif
+
#endif /* GRPC_CORE_LIB_SECURITY_TRANSPORT_SECURE_ENDPOINT_H */
diff --git a/src/core/lib/security/transport/security_connector.h b/src/core/lib/security/transport/security_connector.h
index 79fdbc1a66..d680db6c8e 100644
--- a/src/core/lib/security/transport/security_connector.h
+++ b/src/core/lib/security/transport/security_connector.h
@@ -29,9 +29,7 @@
#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;
@@ -261,8 +259,6 @@ 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.h b/src/core/lib/security/transport/security_handshaker.h
index 174f70f0dd..fd23a784a4 100644
--- a/src/core/lib/security/transport/security_handshaker.h
+++ b/src/core/lib/security/transport/security_handshaker.h
@@ -23,9 +23,7 @@
#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(
@@ -35,8 +33,6 @@ grpc_handshaker* grpc_security_handshaker_create(
/// Registers security handshaker factories.
void grpc_security_register_handshaker_factories();
-#ifdef __cplusplus
-}
-#endif
+
#endif /* GRPC_CORE_LIB_SECURITY_TRANSPORT_SECURITY_HANDSHAKER_H */
diff --git a/src/core/lib/security/transport/tsi_error.h b/src/core/lib/security/transport/tsi_error.h
index 4e8418f3fd..9dd7ab4a4e 100644
--- a/src/core/lib/security/transport/tsi_error.h
+++ b/src/core/lib/security/transport/tsi_error.h
@@ -22,14 +22,10 @@
#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);
-#ifdef __cplusplus
-}
-#endif
+
#endif /* GRPC_CORE_LIB_SECURITY_TRANSPORT_TSI_ERROR_H */
diff --git a/src/core/lib/security/util/json_util.h b/src/core/lib/security/util/json_util.h
index 7538f76120..f99edcd153 100644
--- a/src/core/lib/security/util/json_util.h
+++ b/src/core/lib/security/util/json_util.h
@@ -28,9 +28,7 @@
#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,
@@ -41,8 +39,6 @@ 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);
-#ifdef __cplusplus
-}
-#endif
+
#endif /* GRPC_CORE_LIB_SECURITY_UTIL_JSON_UTIL_H */
diff --git a/src/core/lib/slice/b64.h b/src/core/lib/slice/b64.h
index 467f5d848a..09a8418fd5 100644
--- a/src/core/lib/slice/b64.h
+++ b/src/core/lib/slice/b64.h
@@ -21,9 +21,7 @@
#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.
@@ -51,8 +49,6 @@ 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);
-#ifdef __cplusplus
-}
-#endif
+
#endif /* GRPC_CORE_LIB_SLICE_B64_H */
diff --git a/src/core/lib/slice/percent_encoding.h b/src/core/lib/slice/percent_encoding.h
index 22b5e8df31..e7cd0cd2c9 100644
--- a/src/core/lib/slice/percent_encoding.h
+++ b/src/core/lib/slice/percent_encoding.h
@@ -30,9 +30,7 @@
#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).
@@ -64,8 +62,6 @@ bool grpc_strict_percent_decode_slice(grpc_slice slice_in,
This cannot fail. */
grpc_slice grpc_permissive_percent_decode_slice(grpc_slice slice_in);
-#ifdef __cplusplus
-}
-#endif
+
#endif /* GRPC_CORE_LIB_SLICE_PERCENT_ENCODING_H */
diff --git a/src/core/lib/slice/slice_hash_table.h b/src/core/lib/slice/slice_hash_table.h
index f86f25ea7c..99a3928eeb 100644
--- a/src/core/lib/slice/slice_hash_table.h
+++ b/src/core/lib/slice/slice_hash_table.h
@@ -19,9 +19,7 @@
#include "src/core/lib/transport/metadata.h"
-#ifdef __cplusplus
-extern "C" {
-#endif
+
/** Hash table implementation.
*
@@ -71,8 +69,6 @@ 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);
-#ifdef __cplusplus
-}
-#endif
+
#endif /* GRPC_CORE_LIB_SLICE_SLICE_HASH_TABLE_H */
diff --git a/src/core/lib/slice/slice_internal.h b/src/core/lib/slice/slice_internal.h
index 2439fc0826..01c0dee87f 100644
--- a/src/core/lib/slice/slice_internal.h
+++ b/src/core/lib/slice/slice_internal.h
@@ -24,9 +24,7 @@
#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);
@@ -50,8 +48,6 @@ 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);
-#ifdef __cplusplus
-}
-#endif
+
#endif /* GRPC_CORE_LIB_SLICE_SLICE_INTERNAL_H */
diff --git a/src/core/lib/slice/slice_string_helpers.h b/src/core/lib/slice/slice_string_helpers.h
index acbc41e711..afbd90331e 100644
--- a/src/core/lib/slice/slice_string_helpers.h
+++ b/src/core/lib/slice/slice_string_helpers.h
@@ -28,9 +28,7 @@
#include "src/core/lib/support/string.h"
-#ifdef __cplusplus
-extern "C" {
-#endif
+
/* Calls gpr_dump on a slice. */
char* grpc_dump_slice(grpc_slice slice, uint32_t flags);
@@ -41,8 +39,6 @@ void grpc_slice_split(grpc_slice str, const char* sep, grpc_slice_buffer* dst);
bool grpc_parse_slice_to_uint32(grpc_slice str, uint32_t* result);
-#ifdef __cplusplus
-}
-#endif
+
#endif /* GRPC_CORE_LIB_SLICE_SLICE_STRING_HELPERS_H */
diff --git a/src/core/lib/slice/slice_traits.h b/src/core/lib/slice/slice_traits.h
index 7fdb6752cb..6e314a363b 100644
--- a/src/core/lib/slice/slice_traits.h
+++ b/src/core/lib/slice/slice_traits.h
@@ -22,16 +22,12 @@
#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);
-#ifdef __cplusplus
-}
-#endif
+
#endif /* GRPC_CORE_LIB_SLICE_SLICE_TRAITS_H */
diff --git a/src/core/lib/support/arena.h b/src/core/lib/support/arena.h
index 4d43c56bb9..9984c53fea 100644
--- a/src/core/lib/support/arena.h
+++ b/src/core/lib/support/arena.h
@@ -27,9 +27,7 @@
#include <stddef.h>
-#ifdef __cplusplus
-extern "C" {
-#endif
+
typedef struct gpr_arena gpr_arena;
@@ -40,8 +38,6 @@ 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/env.h b/src/core/lib/support/env.h
index f50d7bcb7a..fe51b70835 100644
--- a/src/core/lib/support/env.h
+++ b/src/core/lib/support/env.h
@@ -21,9 +21,7 @@
#include <stdio.h>
-#ifdef __cplusplus
-extern "C" {
-#endif
+
/* Env utility functions */
@@ -42,8 +40,6 @@ void gpr_setenv(const char* name, const char* value);
level of logging. So DO NOT USE THIS. */
const char* gpr_getenv_silent(const char* name, char** dst);
-#ifdef __cplusplus
-}
-#endif
+
#endif /* GRPC_CORE_LIB_SUPPORT_ENV_H */
diff --git a/src/core/lib/support/log.cc b/src/core/lib/support/log.cc
index e9adc6c349..2a40745e97 100644
--- a/src/core/lib/support/log.cc
+++ b/src/core/lib/support/log.cc
@@ -27,7 +27,7 @@
#include <stdio.h>
#include <string.h>
-extern "C" void gpr_default_log(gpr_log_func_args* args);
+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.cc b/src/core/lib/support/log_android.cc
index 73d24cd84d..648a016b50 100644
--- a/src/core/lib/support/log_android.cc
+++ b/src/core/lib/support/log_android.cc
@@ -39,7 +39,7 @@ static android_LogPriority severity_to_log_priority(gpr_log_severity severity) {
return ANDROID_LOG_DEFAULT;
}
-extern "C" void gpr_log(const char* file, int line, gpr_log_severity severity,
+void gpr_log(const char* file, int line, gpr_log_severity severity,
const char* format, ...) {
char* message = NULL;
va_list args;
@@ -50,7 +50,7 @@ extern "C" void gpr_log(const char* file, int line, gpr_log_severity severity,
free(message);
}
-extern "C" void gpr_default_log(gpr_log_func_args* args) {
+void gpr_default_log(gpr_log_func_args* args) {
const char* final_slash;
const char* display_file;
char* output = NULL;
diff --git a/src/core/lib/support/log_linux.cc b/src/core/lib/support/log_linux.cc
index e0e277fe87..6b1f1c71e4 100644
--- a/src/core/lib/support/log_linux.cc
+++ 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);
}
-extern "C" void gpr_default_log(gpr_log_func_args* args) {
+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.cc b/src/core/lib/support/log_posix.cc
index e765f91390..9fab480a8d 100644
--- a/src/core/lib/support/log_posix.cc
+++ b/src/core/lib/support/log_posix.cc
@@ -56,7 +56,7 @@ void gpr_log(const char* file, int line, gpr_log_severity severity,
gpr_free(allocated);
}
-extern "C" void gpr_default_log(gpr_log_func_args* args) {
+void gpr_default_log(gpr_log_func_args* args) {
const char* final_slash;
const char* display_file;
char time_buffer[64];
diff --git a/src/core/lib/support/log_windows.cc b/src/core/lib/support/log_windows.cc
index d4481791e2..0013bf448f 100644
--- a/src/core/lib/support/log_windows.cc
+++ b/src/core/lib/support/log_windows.cc
@@ -65,7 +65,7 @@ void gpr_log(const char* file, int line, gpr_log_severity severity,
}
/* Simple starter implementation */
-extern "C" void gpr_default_log(gpr_log_func_args* args) {
+void gpr_default_log(gpr_log_func_args* args) {
const char* final_slash;
const char* display_file;
char time_buffer[64];
diff --git a/src/core/lib/support/mpscq.h b/src/core/lib/support/mpscq.h
index fb22742050..743a62b325 100644
--- a/src/core/lib/support/mpscq.h
+++ b/src/core/lib/support/mpscq.h
@@ -24,9 +24,7 @@
#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:
@@ -84,8 +82,6 @@ gpr_mpscq_node* gpr_locked_mpscq_try_pop(gpr_locked_mpscq* q);
// Pop a node. Returns NULL only if the queue was empty at some point after
// calling this function
gpr_mpscq_node* gpr_locked_mpscq_pop(gpr_locked_mpscq* q);
-#ifdef __cplusplus
-}
-#endif
+
#endif /* GRPC_CORE_LIB_SUPPORT_MPSCQ_H */
diff --git a/src/core/lib/support/murmur_hash.h b/src/core/lib/support/murmur_hash.h
index d02bba6962..c28e58af27 100644
--- a/src/core/lib/support/murmur_hash.h
+++ b/src/core/lib/support/murmur_hash.h
@@ -23,15 +23,11 @@
#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/stack_lockfree.h b/src/core/lib/support/stack_lockfree.h
index 337ecc2b17..ebefc7560c 100644
--- a/src/core/lib/support/stack_lockfree.h
+++ b/src/core/lib/support/stack_lockfree.h
@@ -21,9 +21,7 @@
#include <stddef.h>
-#ifdef __cplusplus
-extern "C" {
-#endif
+
typedef struct gpr_stack_lockfree gpr_stack_lockfree;
@@ -39,8 +37,6 @@ 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.h b/src/core/lib/support/string.h
index 0b18ffcec1..8f95f899ce 100644
--- a/src/core/lib/support/string.h
+++ b/src/core/lib/support/string.h
@@ -24,9 +24,7 @@
#include <grpc/support/port_platform.h>
-#ifdef __cplusplus
-extern "C" {
-#endif
+
/* String utility functions */
@@ -109,8 +107,6 @@ void* gpr_memrchr(const void* s, int c, size_t n);
/** Return true if lower(s) equals "true", "yes" or "1", otherwise false. */
bool gpr_is_true(const char* s);
-#ifdef __cplusplus
-}
-#endif
+
#endif /* GRPC_CORE_LIB_SUPPORT_STRING_H */
diff --git a/src/core/lib/support/string_windows.h b/src/core/lib/support/string_windows.h
index 6771647581..18932e20a7 100644
--- a/src/core/lib/support/string_windows.h
+++ b/src/core/lib/support/string_windows.h
@@ -21,9 +21,7 @@
#include <grpc/support/port_platform.h>
-#ifdef __cplusplus
-extern "C" {
-#endif
+
#ifdef GPR_WINDOWS
@@ -33,8 +31,6 @@ 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/time_posix.cc b/src/core/lib/support/time_posix.cc
index 7f65205800..47a849480f 100644
--- a/src/core/lib/support/time_posix.cc
+++ b/src/core/lib/support/time_posix.cc
@@ -127,9 +127,7 @@ 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.h b/src/core/lib/support/time_precise.h
index 3befda3d86..650df6ce67 100644
--- a/src/core/lib/support/time_precise.h
+++ b/src/core/lib/support/time_precise.h
@@ -21,15 +21,11 @@
#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.cc b/src/core/lib/support/time_windows.cc
index 08c1b22964..fb17e5c079 100644
--- a/src/core/lib/support/time_windows.cc
+++ b/src/core/lib/support/time_windows.cc
@@ -68,9 +68,7 @@ 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/tmpfile.h b/src/core/lib/support/tmpfile.h
index 437d871786..e28f4cb11f 100644
--- a/src/core/lib/support/tmpfile.h
+++ b/src/core/lib/support/tmpfile.h
@@ -21,9 +21,7 @@
#include <stdio.h>
-#ifdef __cplusplus
-extern "C" {
-#endif
+
/* Creates a temporary file from a prefix.
If tmp_filename is not NULL, *tmp_filename is assigned the name of the
@@ -31,8 +29,6 @@ extern "C" {
unless an error occurs in which case it will be set to NULL. */
FILE* gpr_tmpfile(const char* prefix, char** tmp_filename);
-#ifdef __cplusplus
-}
-#endif
+
#endif /* GRPC_CORE_LIB_SUPPORT_TMPFILE_H */
diff --git a/src/core/lib/surface/alarm_internal.h b/src/core/lib/surface/alarm_internal.h
index 136b60547f..e4b9f34408 100644
--- a/src/core/lib/surface/alarm_internal.h
+++ b/src/core/lib/surface/alarm_internal.h
@@ -22,9 +22,7 @@
#include <grpc/support/log.h>
#include "src/core/lib/debug/trace.h"
-#ifdef __cplusplus
-extern "C" {
-#endif
+
#ifndef NDEBUG
@@ -41,8 +39,6 @@ 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.h b/src/core/lib/surface/api_trace.h
index 105abdf629..a72d80eaae 100644
--- a/src/core/lib/surface/api_trace.h
+++ b/src/core/lib/surface/api_trace.h
@@ -22,9 +22,7 @@
#include <grpc/support/log.h>
#include "src/core/lib/debug/trace.h"
-#ifdef __cplusplus
-extern "C" {
-#endif
+
extern grpc_tracer_flag grpc_api_trace;
@@ -51,8 +49,6 @@ 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/call.h b/src/core/lib/surface/call.h
index d4e596f84b..b30650781c 100644
--- a/src/core/lib/surface/call.h
+++ b/src/core/lib/surface/call.h
@@ -19,9 +19,7 @@
#ifndef GRPC_CORE_LIB_SURFACE_CALL_H
#define GRPC_CORE_LIB_SURFACE_CALL_H
-#ifdef __cplusplus
-extern "C" {
-#endif
+
#include "src/core/lib/channel/channel_stack.h"
#include "src/core/lib/channel/context.h"
@@ -115,8 +113,6 @@ grpc_compression_algorithm grpc_call_compression_for_level(
extern grpc_tracer_flag grpc_call_error_trace;
extern grpc_tracer_flag grpc_compression_trace;
-#ifdef __cplusplus
-}
-#endif
+
#endif /* GRPC_CORE_LIB_SURFACE_CALL_H */
diff --git a/src/core/lib/surface/call_test_only.h b/src/core/lib/surface/call_test_only.h
index 2ff4a487d5..c0815dc0f1 100644
--- a/src/core/lib/surface/call_test_only.h
+++ b/src/core/lib/surface/call_test_only.h
@@ -21,9 +21,7 @@
#include <grpc/grpc.h>
-#ifdef __cplusplus
-extern "C" {
-#endif
+
/** Return the compression algorithm from \a call.
*
@@ -54,8 +52,6 @@ uint32_t grpc_call_test_only_get_stream_encodings_accepted_by_peer(
grpc_stream_compression_algorithm
grpc_call_test_only_get_incoming_stream_encodings(grpc_call* call);
-#ifdef __cplusplus
-}
-#endif
+
#endif /* GRPC_CORE_LIB_SURFACE_CALL_TEST_ONLY_H */
diff --git a/src/core/lib/surface/channel.h b/src/core/lib/surface/channel.h
index 063e685f6b..c2786b50a2 100644
--- a/src/core/lib/surface/channel.h
+++ b/src/core/lib/surface/channel.h
@@ -23,9 +23,7 @@
#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,
@@ -85,8 +83,6 @@ 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.h b/src/core/lib/surface/channel_init.h
index 9932781081..e09fe1fdb8 100644
--- a/src/core/lib/surface/channel_init.h
+++ b/src/core/lib/surface/channel_init.h
@@ -25,9 +25,7 @@
#define GRPC_CHANNEL_INIT_BUILTIN_PRIORITY 10000
-#ifdef __cplusplus
-extern "C" {
-#endif
+
/// This module provides a way for plugins (and the grpc core library itself)
/// to register mutators for channel stacks.
@@ -74,8 +72,6 @@ bool grpc_channel_init_create_stack(grpc_exec_ctx* exec_ctx,
grpc_channel_stack_builder* builder,
grpc_channel_stack_type type);
-#ifdef __cplusplus
-}
-#endif
+
#endif /* GRPC_CORE_LIB_SURFACE_CHANNEL_INIT_H */
diff --git a/src/core/lib/surface/channel_stack_type.h b/src/core/lib/surface/channel_stack_type.h
index feecd3aa44..5a26248dfe 100644
--- a/src/core/lib/surface/channel_stack_type.h
+++ b/src/core/lib/surface/channel_stack_type.h
@@ -21,9 +21,7 @@
#include <stdbool.h>
-#ifdef __cplusplus
-extern "C" {
-#endif
+
typedef enum {
// normal top-half client channel with load-balancing, connection management
@@ -46,8 +44,6 @@ bool grpc_channel_stack_type_is_client(grpc_channel_stack_type type);
const char* grpc_channel_stack_type_string(grpc_channel_stack_type type);
-#ifdef __cplusplus
-}
-#endif
+
#endif /* GRPC_CORE_LIB_SURFACE_CHANNEL_STACK_TYPE_H */
diff --git a/src/core/lib/surface/completion_queue.h b/src/core/lib/surface/completion_queue.h
index 0ed9875f58..f4fa9a17f4 100644
--- a/src/core/lib/surface/completion_queue.h
+++ b/src/core/lib/surface/completion_queue.h
@@ -36,9 +36,7 @@ extern grpc_tracer_flag grpc_trace_pending_tags;
extern grpc_tracer_flag grpc_trace_cq_refcount;
#endif
-#ifdef __cplusplus
-extern "C" {
-#endif
+
typedef struct grpc_cq_completion {
gpr_mpscq_node node;
@@ -98,8 +96,6 @@ int grpc_get_cq_poll_num(grpc_completion_queue* cc);
grpc_completion_queue* grpc_completion_queue_create_internal(
grpc_cq_completion_type completion_type, grpc_cq_polling_type polling_type);
-#ifdef __cplusplus
-}
-#endif
+
#endif /* GRPC_CORE_LIB_SURFACE_COMPLETION_QUEUE_H */
diff --git a/src/core/lib/surface/completion_queue_factory.h b/src/core/lib/surface/completion_queue_factory.h
index af8f3d60c3..74c1c18b24 100644
--- a/src/core/lib/surface/completion_queue_factory.h
+++ b/src/core/lib/surface/completion_queue_factory.h
@@ -22,9 +22,7 @@
#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*,
@@ -37,8 +35,6 @@ struct grpc_completion_queue_factory {
grpc_completion_queue_factory_vtable* vtable;
};
-#ifdef __cplusplus
-}
-#endif
+
#endif /* GRPC_CORE_LIB_SURFACE_COMPLETION_QUEUE_FACTORY_H */
diff --git a/src/core/lib/surface/event_string.h b/src/core/lib/surface/event_string.h
index 4bdb11f35e..a763327862 100644
--- a/src/core/lib/surface/event_string.h
+++ b/src/core/lib/surface/event_string.h
@@ -21,15 +21,11 @@
#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);
-#ifdef __cplusplus
-}
-#endif
+
#endif /* GRPC_CORE_LIB_SURFACE_EVENT_STRING_H */
diff --git a/src/core/lib/surface/init.h b/src/core/lib/surface/init.h
index d429026327..c2969f972d 100644
--- a/src/core/lib/surface/init.h
+++ b/src/core/lib/surface/init.h
@@ -19,17 +19,13 @@
#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);
-#ifdef __cplusplus
-}
-#endif
+
#endif /* GRPC_CORE_LIB_SURFACE_INIT_H */
diff --git a/src/core/lib/surface/lame_client.cc b/src/core/lib/surface/lame_client.cc
index 7114a9f545..c32c9af50e 100644
--- a/src/core/lib/surface/lame_client.cc
+++ b/src/core/lib/surface/lame_client.cc
@@ -25,7 +25,6 @@
#include "src/core/lib/support/atomic.h"
-extern "C" {
#include "src/core/lib/channel/channel_stack.h"
#include "src/core/lib/support/string.h"
#include "src/core/lib/surface/api_trace.h"
@@ -33,7 +32,6 @@ extern "C" {
#include "src/core/lib/surface/channel.h"
#include "src/core/lib/surface/lame_client.h"
#include "src/core/lib/transport/static_metadata.h"
-}
namespace grpc_core {
@@ -146,7 +144,7 @@ static void destroy_channel_elem(grpc_exec_ctx* exec_ctx,
} // namespace grpc_core
-extern "C" const grpc_channel_filter grpc_lame_filter = {
+const grpc_channel_filter grpc_lame_filter = {
grpc_core::lame_start_transport_stream_op_batch,
grpc_core::lame_start_transport_op,
sizeof(grpc_core::CallData),
diff --git a/src/core/lib/surface/lame_client.h b/src/core/lib/surface/lame_client.h
index 2f6f9cd046..964e625f28 100644
--- a/src/core/lib/surface/lame_client.h
+++ b/src/core/lib/surface/lame_client.h
@@ -21,14 +21,10 @@
#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/server.h b/src/core/lib/surface/server.h
index e3c43f957d..e515e3099d 100644
--- a/src/core/lib/surface/server.h
+++ b/src/core/lib/surface/server.h
@@ -24,9 +24,7 @@
#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;
@@ -58,8 +56,6 @@ int grpc_server_has_open_connections(grpc_server* server);
void grpc_server_get_pollsets(grpc_server* server, grpc_pollset*** pollsets,
size_t* pollset_count);
-#ifdef __cplusplus
-}
-#endif
+
#endif /* GRPC_CORE_LIB_SURFACE_SERVER_H */
diff --git a/src/core/lib/surface/validate_metadata.h b/src/core/lib/surface/validate_metadata.h
index 9ca20692b5..30941b5f83 100644
--- a/src/core/lib/surface/validate_metadata.h
+++ b/src/core/lib/surface/validate_metadata.h
@@ -22,15 +22,11 @@
#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);
-#ifdef __cplusplus
-}
-#endif
+
#endif /* GRPC_CORE_LIB_SURFACE_VALIDATE_METADATA_H */
diff --git a/src/core/lib/transport/byte_stream.h b/src/core/lib/transport/byte_stream.h
index 54ad4b9796..8b660b3287 100644
--- a/src/core/lib/transport/byte_stream.h
+++ b/src/core/lib/transport/byte_stream.h
@@ -28,9 +28,7 @@
/** 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;
@@ -139,8 +137,6 @@ 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);
-#ifdef __cplusplus
-}
-#endif
+
#endif /* GRPC_CORE_LIB_TRANSPORT_BYTE_STREAM_H */
diff --git a/src/core/lib/transport/connectivity_state.h b/src/core/lib/transport/connectivity_state.h
index 792e27c43d..2d8dd14881 100644
--- a/src/core/lib/transport/connectivity_state.h
+++ b/src/core/lib/transport/connectivity_state.h
@@ -23,9 +23,7 @@
#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 */
@@ -88,8 +86,6 @@ 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);
-#ifdef __cplusplus
-}
-#endif
+
#endif /* GRPC_CORE_LIB_TRANSPORT_CONNECTIVITY_STATE_H */
diff --git a/src/core/lib/transport/error_utils.h b/src/core/lib/transport/error_utils.h
index 690e42058a..9cd1bc57d2 100644
--- a/src/core/lib/transport/error_utils.h
+++ b/src/core/lib/transport/error_utils.h
@@ -23,9 +23,7 @@
#include "src/core/lib/iomgr/exec_ctx.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
@@ -44,8 +42,6 @@ void grpc_error_get_status(grpc_exec_ctx* exec_ctx, grpc_error* error,
/// GRPC_ERROR_CANCELLED
bool grpc_error_has_clear_grpc_status(grpc_error* error);
-#ifdef __cplusplus
-}
-#endif
+
#endif /* GRPC_CORE_LIB_TRANSPORT_ERROR_UTILS_H */
diff --git a/src/core/lib/transport/metadata.h b/src/core/lib/transport/metadata.h
index 7e7e7b4c14..077b4ce0c5 100644
--- a/src/core/lib/transport/metadata.h
+++ b/src/core/lib/transport/metadata.h
@@ -29,9 +29,7 @@
extern grpc_tracer_flag grpc_trace_metadata;
#endif
-#ifdef __cplusplus
-extern "C" {
-#endif
+
/* This file provides a mechanism for tracking metadata through the grpc stack.
It's not intended for consumption outside of the library.
@@ -170,8 +168,6 @@ void grpc_mdelem_unref(grpc_exec_ctx* exec_ctx, grpc_mdelem md);
void grpc_mdctx_global_init(void);
void grpc_mdctx_global_shutdown(grpc_exec_ctx* exec_ctx);
-#ifdef __cplusplus
-}
-#endif
+
#endif /* GRPC_CORE_LIB_TRANSPORT_METADATA_H */
diff --git a/src/core/lib/transport/metadata_batch.h b/src/core/lib/transport/metadata_batch.h
index 7d17393249..cae79bf694 100644
--- a/src/core/lib/transport/metadata_batch.h
+++ b/src/core/lib/transport/metadata_batch.h
@@ -28,9 +28,7 @@
#include "src/core/lib/transport/metadata.h"
#include "src/core/lib/transport/static_metadata.h"
-#ifdef __cplusplus
-extern "C" {
-#endif
+
typedef struct grpc_linked_mdelem {
grpc_mdelem md;
@@ -146,8 +144,6 @@ void grpc_metadata_batch_assert_ok(grpc_metadata_batch* comd);
} while (0)
#endif
-#ifdef __cplusplus
-}
-#endif
+
#endif /* GRPC_CORE_LIB_TRANSPORT_METADATA_BATCH_H */
diff --git a/src/core/lib/transport/service_config.h b/src/core/lib/transport/service_config.h
index 405d0f5b41..7abd278c19 100644
--- a/src/core/lib/transport/service_config.h
+++ b/src/core/lib/transport/service_config.h
@@ -22,9 +22,7 @@
#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;
@@ -64,8 +62,6 @@ void* grpc_method_config_table_get(grpc_exec_ctx* exec_ctx,
const grpc_slice_hash_table* table,
grpc_slice path);
-#ifdef __cplusplus
-}
-#endif
+
#endif /* GRPC_CORE_LIB_TRANSPORT_SERVICE_CONFIG_H */
diff --git a/src/core/lib/transport/static_metadata.h b/src/core/lib/transport/static_metadata.h
index 8e73d5f278..d1a962461f 100644
--- a/src/core/lib/transport/static_metadata.h
+++ b/src/core/lib/transport/static_metadata.h
@@ -27,9 +27,7 @@
#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"
@@ -588,7 +586,5 @@ 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.h b/src/core/lib/transport/status_conversion.h
index b6fcebd4fa..70387539c5 100644
--- a/src/core/lib/transport/status_conversion.h
+++ b/src/core/lib/transport/status_conversion.h
@@ -23,9 +23,7 @@
#include "src/core/lib/iomgr/exec_ctx.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);
@@ -37,8 +35,6 @@ grpc_status_code grpc_http2_error_to_grpc_status(grpc_exec_ctx* exec_ctx,
grpc_status_code grpc_http2_status_to_grpc_status(int status);
int grpc_status_to_http2_status(grpc_status_code status);
-#ifdef __cplusplus
-}
-#endif
+
#endif /* GRPC_CORE_LIB_TRANSPORT_STATUS_CONVERSION_H */
diff --git a/src/core/lib/transport/timeout_encoding.h b/src/core/lib/transport/timeout_encoding.h
index 9c3c4599c9..4e5034ff15 100644
--- a/src/core/lib/transport/timeout_encoding.h
+++ b/src/core/lib/transport/timeout_encoding.h
@@ -27,17 +27,13 @@
#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(grpc_millis timeout, char* buffer);
int grpc_http2_decode_timeout(grpc_slice text, grpc_millis* timeout);
-#ifdef __cplusplus
-}
-#endif
+
#endif /* GRPC_CORE_LIB_TRANSPORT_TIMEOUT_ENCODING_H */
diff --git a/src/core/lib/transport/transport.h b/src/core/lib/transport/transport.h
index 973018e5a5..01f03121b6 100644
--- a/src/core/lib/transport/transport.h
+++ b/src/core/lib/transport/transport.h
@@ -31,9 +31,7 @@
#include "src/core/lib/transport/byte_stream.h"
#include "src/core/lib/transport/metadata_batch.h"
-#ifdef __cplusplus
-extern "C" {
-#endif
+
/* forward declarations */
typedef struct grpc_transport grpc_transport;
@@ -352,8 +350,6 @@ grpc_transport_op* grpc_make_transport_op(grpc_closure* on_consumed);
grpc_transport_stream_op_batch* grpc_make_transport_stream_op(
grpc_closure* on_consumed);
-#ifdef __cplusplus
-}
-#endif
+
#endif /* GRPC_CORE_LIB_TRANSPORT_TRANSPORT_H */
diff --git a/src/core/lib/transport/transport_impl.h b/src/core/lib/transport/transport_impl.h
index 22ad599e2e..5dedc25707 100644
--- a/src/core/lib/transport/transport_impl.h
+++ b/src/core/lib/transport/transport_impl.h
@@ -21,9 +21,7 @@
#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
@@ -73,8 +71,6 @@ struct grpc_transport {
const grpc_transport_vtable* vtable;
};
-#ifdef __cplusplus
-}
-#endif
+
#endif /* GRPC_CORE_LIB_TRANSPORT_TRANSPORT_IMPL_H */
diff --git a/src/core/plugin_registry/grpc_cronet_plugin_registry.cc b/src/core/plugin_registry/grpc_cronet_plugin_registry.cc
index e0422f6750..101e29c481 100644
--- a/src/core/plugin_registry/grpc_cronet_plugin_registry.cc
+++ b/src/core/plugin_registry/grpc_cronet_plugin_registry.cc
@@ -18,18 +18,18 @@
#include <grpc/grpc.h>
-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_http_filters_init(void);
+void grpc_http_filters_shutdown(void);
+void grpc_chttp2_plugin_init(void);
+void grpc_chttp2_plugin_shutdown(void);
+void grpc_deadline_filter_init(void);
+void grpc_deadline_filter_shutdown(void);
+void grpc_client_channel_init(void);
+void grpc_client_channel_shutdown(void);
+void grpc_tsi_gts_init(void);
+void grpc_tsi_gts_shutdown(void);
+void grpc_server_load_reporting_plugin_init(void);
+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.cc b/src/core/plugin_registry/grpc_plugin_registry.cc
index 339c9bb367..89be351785 100644
--- a/src/core/plugin_registry/grpc_plugin_registry.cc
+++ b/src/core/plugin_registry/grpc_plugin_registry.cc
@@ -18,40 +18,40 @@
#include <grpc/grpc.h>
-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 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_http_filters_init(void);
+void grpc_http_filters_shutdown(void);
+void grpc_chttp2_plugin_init(void);
+void grpc_chttp2_plugin_shutdown(void);
+void grpc_tsi_gts_init(void);
+void grpc_tsi_gts_shutdown(void);
+void grpc_deadline_filter_init(void);
+void grpc_deadline_filter_shutdown(void);
+void grpc_client_channel_init(void);
+void grpc_client_channel_shutdown(void);
+void grpc_inproc_plugin_init(void);
+void grpc_inproc_plugin_shutdown(void);
+void grpc_resolver_fake_init(void);
+void grpc_resolver_fake_shutdown(void);
+void grpc_lb_policy_grpclb_init(void);
+void grpc_lb_policy_grpclb_shutdown(void);
+void grpc_lb_policy_pick_first_init(void);
+void grpc_lb_policy_pick_first_shutdown(void);
+void grpc_lb_policy_round_robin_init(void);
+void grpc_lb_policy_round_robin_shutdown(void);
+void grpc_resolver_dns_ares_init(void);
+void grpc_resolver_dns_ares_shutdown(void);
+void grpc_resolver_dns_native_init(void);
+void grpc_resolver_dns_native_shutdown(void);
+void grpc_resolver_sockaddr_init(void);
+void grpc_resolver_sockaddr_shutdown(void);
+void grpc_server_load_reporting_plugin_init(void);
+void grpc_server_load_reporting_plugin_shutdown(void);
+void grpc_max_age_filter_init(void);
+void grpc_max_age_filter_shutdown(void);
+void grpc_message_size_filter_init(void);
+void grpc_message_size_filter_shutdown(void);
+void grpc_workaround_cronet_compression_filter_init(void);
+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.cc b/src/core/plugin_registry/grpc_unsecure_plugin_registry.cc
index c9fc17d34d..d73f946241 100644
--- a/src/core/plugin_registry/grpc_unsecure_plugin_registry.cc
+++ b/src/core/plugin_registry/grpc_unsecure_plugin_registry.cc
@@ -18,38 +18,38 @@
#include <grpc/grpc.h>
-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 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_http_filters_init(void);
+void grpc_http_filters_shutdown(void);
+void grpc_chttp2_plugin_init(void);
+void grpc_chttp2_plugin_shutdown(void);
+void grpc_deadline_filter_init(void);
+void grpc_deadline_filter_shutdown(void);
+void grpc_client_channel_init(void);
+void grpc_client_channel_shutdown(void);
+void grpc_inproc_plugin_init(void);
+void grpc_inproc_plugin_shutdown(void);
+void grpc_resolver_dns_ares_init(void);
+void grpc_resolver_dns_ares_shutdown(void);
+void grpc_resolver_dns_native_init(void);
+void grpc_resolver_dns_native_shutdown(void);
+void grpc_resolver_sockaddr_init(void);
+void grpc_resolver_sockaddr_shutdown(void);
+void grpc_resolver_fake_init(void);
+void grpc_resolver_fake_shutdown(void);
+void grpc_server_load_reporting_plugin_init(void);
+void grpc_server_load_reporting_plugin_shutdown(void);
+void grpc_lb_policy_grpclb_init(void);
+void grpc_lb_policy_grpclb_shutdown(void);
+void grpc_lb_policy_pick_first_init(void);
+void grpc_lb_policy_pick_first_shutdown(void);
+void grpc_lb_policy_round_robin_init(void);
+void grpc_lb_policy_round_robin_shutdown(void);
+void grpc_max_age_filter_init(void);
+void grpc_max_age_filter_shutdown(void);
+void grpc_message_size_filter_init(void);
+void grpc_message_size_filter_shutdown(void);
+void grpc_workaround_cronet_compression_filter_init(void);
+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.h b/src/core/tsi/fake_transport_security.h
index b90b9962f7..2a6edba003 100644
--- a/src/core/tsi/fake_transport_security.h
+++ b/src/core/tsi/fake_transport_security.h
@@ -21,9 +21,7 @@
#include "src/core/tsi/transport_security_interface.h"
-#ifdef __cplusplus
-extern "C" {
-#endif
+
/* Value for the TSI_CERTIFICATE_TYPE_PEER_PROPERTY property for FAKE certs. */
#define TSI_FAKE_CERTIFICATE_TYPE "FAKE"
@@ -44,8 +42,6 @@ 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);
-#ifdef __cplusplus
-}
-#endif
+
#endif /* GRPC_CORE_TSI_FAKE_TRANSPORT_SECURITY_H */
diff --git a/src/core/tsi/gts_transport_security.cc b/src/core/tsi/gts_transport_security.cc
index d5948c9516..2b099773c4 100644
--- a/src/core/tsi/gts_transport_security.cc
+++ 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; }
-extern "C" void grpc_tsi_gts_init() {
+void grpc_tsi_gts_init() {
memset(&g_gts_resource, 0, sizeof(gts_shared_resource));
gpr_mu_init(&g_gts_resource.mu);
}
-extern "C" void grpc_tsi_gts_shutdown() {
+void grpc_tsi_gts_shutdown() {
gpr_mu_destroy(&g_gts_resource.mu);
if (g_gts_resource.cq == nullptr) {
return;
diff --git a/src/core/tsi/gts_transport_security.h b/src/core/tsi/gts_transport_security.h
index 8bc2107270..aca03b0d27 100644
--- a/src/core/tsi/gts_transport_security.h
+++ b/src/core/tsi/gts_transport_security.h
@@ -23,9 +23,7 @@
#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;
@@ -38,8 +36,6 @@ typedef struct gts_shared_resource {
* TSI handshakes. */
gts_shared_resource* gts_get_shared_resource(void);
-#ifdef __cplusplus
-}
-#endif
+
#endif /* GRPC_CORE_TSI_GTS_TRANSPORT_SECURITY_H */
diff --git a/src/core/tsi/ssl_transport_security.h b/src/core/tsi/ssl_transport_security.h
index 595c4ccaec..e6011f71a4 100644
--- a/src/core/tsi/ssl_transport_security.h
+++ b/src/core/tsi/ssl_transport_security.h
@@ -21,9 +21,7 @@
#include "src/core/tsi/transport_security_interface.h"
-#ifdef __cplusplus
-extern "C" {
-#endif
+
/* Value for the TSI_CERTIFICATE_TYPE_PEER_PROPERTY property for X509 certs. */
#define TSI_X509_CERTIFICATE_TYPE "X509"
@@ -193,8 +191,6 @@ const tsi_ssl_handshaker_factory_vtable* tsi_ssl_handshaker_factory_swap_vtable(
tsi_ssl_handshaker_factory* factory,
tsi_ssl_handshaker_factory_vtable* new_vtable);
-#ifdef __cplusplus
-}
-#endif
+
#endif /* GRPC_CORE_TSI_SSL_TRANSPORT_SECURITY_H */
diff --git a/src/core/tsi/ssl_types.h b/src/core/tsi/ssl_types.h
index e0e967034b..06e6b44da9 100644
--- a/src/core/tsi/ssl_types.h
+++ b/src/core/tsi/ssl_types.h
@@ -19,9 +19,7 @@
#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:
@@ -41,8 +39,6 @@ extern "C" {
#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.h b/src/core/tsi/transport_security.h
index d639f857fe..9292e03813 100644
--- a/src/core/tsi/transport_security.h
+++ b/src/core/tsi/transport_security.h
@@ -24,9 +24,7 @@
#include "src/core/lib/debug/trace.h"
#include "src/core/tsi/transport_security_interface.h"
-#ifdef __cplusplus
-extern "C" {
-#endif
+
extern grpc_tracer_flag tsi_tracing_enabled;
@@ -126,8 +124,6 @@ tsi_result tsi_construct_string_peer_property_from_cstring(
/* Utils. */
char* tsi_strdup(const char* src); /* Sadly, no strdup in C89. */
-#ifdef __cplusplus
-}
-#endif
+
#endif /* GRPC_CORE_TSI_TRANSPORT_SECURITY_H */
diff --git a/src/core/tsi/transport_security_adapter.h b/src/core/tsi/transport_security_adapter.h
index 232705f02c..d999af2821 100644
--- a/src/core/tsi/transport_security_adapter.h
+++ b/src/core/tsi/transport_security_adapter.h
@@ -21,9 +21,7 @@
#include "src/core/tsi/transport_security_interface.h"
-#ifdef __cplusplus
-extern "C" {
-#endif
+
/* Create a tsi handshaker that takes an implementation of old interface and
converts into an implementation of new interface. In the old interface,
@@ -40,8 +38,6 @@ tsi_handshaker* tsi_create_adapter_handshaker(tsi_handshaker* wrapped);
the caller. */
tsi_handshaker* tsi_adapter_handshaker_get_wrapped(tsi_handshaker* adapter);
-#ifdef __cplusplus
-}
-#endif
+
#endif /* GRPC_CORE_TSI_TRANSPORT_SECURITY_ADAPTER_H */
diff --git a/src/core/tsi/transport_security_grpc.h b/src/core/tsi/transport_security_grpc.h
index 1c54693ec9..8ebee37b72 100644
--- a/src/core/tsi/transport_security_grpc.h
+++ b/src/core/tsi/transport_security_grpc.h
@@ -22,9 +22,7 @@
#include <grpc/slice_buffer.h>
#include "src/core/tsi/transport_security.h"
-#ifdef __cplusplus
-extern "C" {
-#endif
+
/* This method creates a tsi_zero_copy_grpc_protector object. It return TSI_OK
assuming there is no fatal error.
@@ -77,8 +75,6 @@ struct tsi_zero_copy_grpc_protector {
const tsi_zero_copy_grpc_protector_vtable* vtable;
};
-#ifdef __cplusplus
-}
-#endif
+
#endif /* GRPC_CORE_TSI_TRANSPORT_SECURITY_GRPC_H */
diff --git a/src/core/tsi/transport_security_interface.h b/src/core/tsi/transport_security_interface.h
index 54942a6b2a..fa1924bb62 100644
--- a/src/core/tsi/transport_security_interface.h
+++ b/src/core/tsi/transport_security_interface.h
@@ -24,9 +24,7 @@
#include "src/core/lib/debug/trace.h"
-#ifdef __cplusplus
-extern "C" {
-#endif
+
/* --- tsi result --- */
@@ -453,8 +451,6 @@ void tsi_init();
/* This method destroys the shared objects created by tsi_init. */
void tsi_destroy();
-#ifdef __cplusplus
-}
-#endif
+
#endif /* GRPC_CORE_TSI_TRANSPORT_SECURITY_INTERFACE_H */
diff --git a/src/cpp/common/channel_arguments.cc b/src/cpp/common/channel_arguments.cc
index f89f5f1f03..cae9ef953a 100644
--- a/src/cpp/common/channel_arguments.cc
+++ b/src/cpp/common/channel_arguments.cc
@@ -23,11 +23,10 @@
#include <grpc++/resource_quota.h>
#include <grpc/impl/codegen/grpc_types.h>
#include <grpc/support/log.h>
-extern "C" {
#include "src/core/lib/channel/channel_args.h"
#include "src/core/lib/iomgr/exec_ctx.h"
#include "src/core/lib/iomgr/socket_mutator.h"
-}
+
namespace grpc {
ChannelArguments::ChannelArguments() {
diff --git a/src/cpp/common/channel_filter.cc b/src/cpp/common/channel_filter.cc
index d1cfd2b48a..274079f8dd 100644
--- a/src/cpp/common/channel_filter.cc
+++ b/src/cpp/common/channel_filter.cc
@@ -18,9 +18,7 @@
#include <string.h>
-extern "C" {
#include "src/core/lib/channel/channel_stack.h"
-}
#include "src/cpp/common/channel_filter.h"
#include <grpc++/impl/codegen/slice.h>
diff --git a/src/cpp/common/channel_filter.h b/src/cpp/common/channel_filter.h
index 4fb81ecb1e..9fe9cf0aea 100644
--- a/src/cpp/common/channel_filter.h
+++ b/src/cpp/common/channel_filter.h
@@ -26,11 +26,9 @@
#include <functional>
#include <vector>
-extern "C" {
#include "src/core/lib/channel/channel_stack.h"
#include "src/core/lib/surface/channel_init.h"
#include "src/core/lib/transport/metadata_batch.h"
-}
/// An interface to define filters.
///
diff --git a/src/cpp/common/core_codegen.cc b/src/cpp/common/core_codegen.cc
index 3cbf08af9f..936d6996b2 100644
--- a/src/cpp/common/core_codegen.cc
+++ b/src/cpp/common/core_codegen.cc
@@ -33,9 +33,7 @@
#include "src/core/lib/profiling/timers.h"
-extern "C" {
struct grpc_byte_buffer;
-}
namespace grpc {
diff --git a/templates/src/core/plugin_registry.template b/templates/src/core/plugin_registry.template
index 8d7617129f..805ae9049f 100644
--- a/templates/src/core/plugin_registry.template
+++ b/templates/src/core/plugin_registry.template
@@ -25,8 +25,8 @@ template: |
#include <grpc/grpc.h>
%for plugin in selected.plugins:
- extern "C" void ${plugin}_init(void);
- extern "C" void ${plugin}_shutdown(void);
+ void ${plugin}_init(void);
+ void ${plugin}_shutdown(void);
%endfor
void grpc_register_built_in_plugins(void) {
diff --git a/test/core/end2end/cq_verifier.h b/test/core/end2end/cq_verifier.h
index 0b3b3fb349..90c93f11f1 100644
--- a/test/core/end2end/cq_verifier.h
+++ b/test/core/end2end/cq_verifier.h
@@ -24,9 +24,7 @@
#include <grpc/grpc.h>
#include "test/core/util/test_config.h"
-#ifdef __cplusplus
-extern "C" {
-#endif
+
/* A cq_verifier can verify that expected events arrive in a timely fashion
on a single completion queue */
@@ -63,8 +61,6 @@ int contains_metadata(grpc_metadata_array* array, const char* key,
int contains_metadata_slices(grpc_metadata_array* array, grpc_slice key,
grpc_slice value);
-#ifdef __cplusplus
-}
-#endif
+
#endif /* GRPC_TEST_CORE_END2END_CQ_VERIFIER_H */
diff --git a/test/core/end2end/data/ssl_test_data.h b/test/core/end2end/data/ssl_test_data.h
index e9c7dbceb2..558e6cfe97 100644
--- a/test/core/end2end/data/ssl_test_data.h
+++ b/test/core/end2end/data/ssl_test_data.h
@@ -19,9 +19,7 @@
#ifndef GRPC_TEST_CORE_END2END_DATA_SSL_TEST_DATA_H
#define GRPC_TEST_CORE_END2END_DATA_SSL_TEST_DATA_H
-#ifdef __cplusplus
-extern "C" {
-#endif
+
extern const char test_root_cert[];
extern const char test_server1_cert[];
@@ -31,8 +29,6 @@ extern const char test_self_signed_client_key[];
extern const char test_signed_client_cert[];
extern const char test_signed_client_key[];
-#ifdef __cplusplus
-}
-#endif
+
#endif /* GRPC_TEST_CORE_END2END_DATA_SSL_TEST_DATA_H */
diff --git a/test/core/end2end/end2end_tests.h b/test/core/end2end/end2end_tests.h
index 33943a7271..a56c955d1b 100644
--- a/test/core/end2end/end2end_tests.h
+++ b/test/core/end2end/end2end_tests.h
@@ -21,9 +21,7 @@
#include <grpc/grpc.h>
-#ifdef __cplusplus
-extern "C" {
-#endif
+
typedef struct grpc_end2end_test_fixture grpc_end2end_test_fixture;
typedef struct grpc_end2end_test_config grpc_end2end_test_config;
@@ -78,8 +76,6 @@ const grpc_slice* get_host_override_slice(const char* str,
void validate_host_override_string(const char* pattern, grpc_slice str,
grpc_end2end_test_config config);
-#ifdef __cplusplus
-}
-#endif
+
#endif /* GRPC_TEST_CORE_END2END_END2END_TESTS_H */
diff --git a/test/core/end2end/fuzzers/api_fuzzer.cc b/test/core/end2end/fuzzers/api_fuzzer.cc
index b8ec12586e..f169a7dbed 100644
--- a/test/core/end2end/fuzzers/api_fuzzer.cc
+++ b/test/core/end2end/fuzzers/api_fuzzer.cc
@@ -441,7 +441,7 @@ grpc_ares_request* my_dns_lookup_ares(
// client connection
// defined in tcp_client_posix.c
-extern "C" void (*grpc_tcp_client_connect_impl)(
+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, grpc_millis deadline);
diff --git a/test/core/end2end/tests/no_logging.cc b/test/core/end2end/tests/no_logging.cc
index 55d211c44a..bf8651221a 100644
--- a/test/core/end2end/tests/no_logging.cc
+++ b/test/core/end2end/tests/no_logging.cc
@@ -36,7 +36,7 @@ enum { TIMEOUT = 200000 };
static void* tag(intptr_t t) { return (void*)t; }
-extern "C" void gpr_default_log(gpr_log_func_args* args);
+void gpr_default_log(gpr_log_func_args* args);
static void test_no_log(gpr_log_func_args* args) {
char* message = nullptr;
diff --git a/test/core/util/port.h b/test/core/util/port.h
index 602099dea6..bb4fd91fee 100644
--- a/test/core/util/port.h
+++ b/test/core/util/port.h
@@ -19,9 +19,7 @@
#ifndef GRPC_TEST_CORE_UTIL_PORT_H
#define GRPC_TEST_CORE_UTIL_PORT_H
-#ifdef __cplusplus
-extern "C" {
-#endif
+
typedef struct grpc_pick_port_functions {
int (*pick_unused_port_fn)(void);
@@ -45,8 +43,6 @@ void grpc_recycle_unused_port(int port);
/** Request the family of pick_port functions in \a functions be used. */
void grpc_set_pick_port_functions(grpc_pick_port_functions functions);
-#ifdef __cplusplus
-}
-#endif
+
#endif /* GRPC_TEST_CORE_UTIL_PORT_H */
diff --git a/test/core/util/test_config.h b/test/core/util/test_config.h
index 4383fbfce8..adfec48662 100644
--- a/test/core/util/test_config.h
+++ b/test/core/util/test_config.h
@@ -21,9 +21,7 @@
#include <grpc/support/time.h>
-#ifdef __cplusplus
-extern "C" {
-#endif
+
extern int64_t g_fixture_slowdown_factor;
extern int64_t g_poller_slowdown_factor;
@@ -43,8 +41,6 @@ gpr_timespec grpc_timeout_milliseconds_to_deadline(int64_t time_ms);
void grpc_test_init(int argc, char** argv);
-#ifdef __cplusplus
-}
-#endif
+
#endif /* GRPC_TEST_CORE_UTIL_TEST_CONFIG_H */
diff --git a/test/cpp/client/client_channel_stress_test.cc b/test/cpp/client/client_channel_stress_test.cc
index 8940f6ff9e..0954b28df0 100644
--- a/test/cpp/client/client_channel_stress_test.cc
+++ b/test/cpp/client/client_channel_stress_test.cc
@@ -34,10 +34,8 @@
#include <grpc/support/thd.h>
#include <grpc/support/time.h>
-extern "C" {
#include "src/core/ext/filters/client_channel/resolver/fake/fake_resolver.h"
#include "src/core/lib/iomgr/sockaddr.h"
-}
#include "test/core/util/port.h"
#include "test/core/util/test_config.h"
diff --git a/test/cpp/interop/stress_test.cc b/test/cpp/interop/stress_test.cc
index 028ff11b20..4b39dc3211 100644
--- a/test/cpp/interop/stress_test.cc
+++ b/test/cpp/interop/stress_test.cc
@@ -36,9 +36,7 @@
#include "test/cpp/util/metrics_server.h"
#include "test/cpp/util/test_config.h"
-extern "C" {
extern void gpr_default_log(gpr_log_func_args* args);
-}
DEFINE_int32(metrics_port, 8081, "The metrics server port.");