diff --git a/CMakeLists.txt b/CMakeLists.txt
index 2e448c92b66..fe838383f5a 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -1214,7 +1214,7 @@ add_library(grpc
src/core/ext/filters/message_size/message_size_filter.c
src/core/ext/filters/workarounds/workaround_cronet_compression_filter.c
src/core/ext/filters/workarounds/workaround_utils.c
- src/core/plugin_registry/grpc_plugin_registry.c
+ src/core/plugin_registry/grpc_plugin_registry.cc
)
if(WIN32 AND MSVC)
@@ -1523,7 +1523,7 @@ add_library(grpc_cronet
src/core/ext/transport/chttp2/client/chttp2_connector.c
src/core/ext/filters/load_reporting/server_load_reporting_filter.c
src/core/ext/filters/load_reporting/server_load_reporting_plugin.c
- src/core/plugin_registry/grpc_cronet_plugin_registry.c
+ src/core/plugin_registry/grpc_cronet_plugin_registry.cc
)
if(WIN32 AND MSVC)
@@ -2364,7 +2364,7 @@ add_library(grpc_unsecure
src/core/ext/filters/message_size/message_size_filter.c
src/core/ext/filters/workarounds/workaround_cronet_compression_filter.c
src/core/ext/filters/workarounds/workaround_utils.c
- src/core/plugin_registry/grpc_unsecure_plugin_registry.c
+ src/core/plugin_registry/grpc_unsecure_plugin_registry.cc
)
if(WIN32 AND MSVC)
diff --git a/Makefile b/Makefile
index 517ddfd90e0..7f657ef289a 100644
--- a/Makefile
+++ b/Makefile
@@ -3205,7 +3205,7 @@ LIBGRPC_SRC = \
src/core/ext/filters/message_size/message_size_filter.c \
src/core/ext/filters/workarounds/workaround_cronet_compression_filter.c \
src/core/ext/filters/workarounds/workaround_utils.c \
- src/core/plugin_registry/grpc_plugin_registry.c \
+ src/core/plugin_registry/grpc_plugin_registry.cc \
PUBLIC_HEADERS_C += \
include/grpc/impl/codegen/byte_buffer.h \
@@ -3514,7 +3514,7 @@ LIBGRPC_CRONET_SRC = \
src/core/ext/transport/chttp2/client/chttp2_connector.c \
src/core/ext/filters/load_reporting/server_load_reporting_filter.c \
src/core/ext/filters/load_reporting/server_load_reporting_plugin.c \
- src/core/plugin_registry/grpc_cronet_plugin_registry.c \
+ src/core/plugin_registry/grpc_cronet_plugin_registry.cc \
PUBLIC_HEADERS_C += \
include/grpc/impl/codegen/byte_buffer.h \
@@ -4323,7 +4323,7 @@ LIBGRPC_UNSECURE_SRC = \
src/core/ext/filters/message_size/message_size_filter.c \
src/core/ext/filters/workarounds/workaround_cronet_compression_filter.c \
src/core/ext/filters/workarounds/workaround_utils.c \
- src/core/plugin_registry/grpc_unsecure_plugin_registry.c \
+ src/core/plugin_registry/grpc_unsecure_plugin_registry.cc \
PUBLIC_HEADERS_C += \
include/grpc/impl/codegen/byte_buffer.h \
@@ -20188,8 +20188,8 @@ src/core/lib/security/transport/server_auth_filter.c: $(OPENSSL_DEP)
src/core/lib/security/transport/tsi_error.c: $(OPENSSL_DEP)
src/core/lib/security/util/json_util.c: $(OPENSSL_DEP)
src/core/lib/surface/init_secure.c: $(OPENSSL_DEP)
-src/core/plugin_registry/grpc_cronet_plugin_registry.c: $(OPENSSL_DEP)
-src/core/plugin_registry/grpc_plugin_registry.c: $(OPENSSL_DEP)
+src/core/plugin_registry/grpc_cronet_plugin_registry.cc: $(OPENSSL_DEP)
+src/core/plugin_registry/grpc_plugin_registry.cc: $(OPENSSL_DEP)
src/core/tsi/fake_transport_security.c: $(OPENSSL_DEP)
src/core/tsi/gts_transport_security.c: $(OPENSSL_DEP)
src/core/tsi/ssl_transport_security.c: $(OPENSSL_DEP)
diff --git a/binding.gyp b/binding.gyp
index b4f90382103..476e6fd3c4f 100644
--- a/binding.gyp
+++ b/binding.gyp
@@ -916,7 +916,7 @@
'src/core/ext/filters/message_size/message_size_filter.c',
'src/core/ext/filters/workarounds/workaround_cronet_compression_filter.c',
'src/core/ext/filters/workarounds/workaround_utils.c',
- 'src/core/plugin_registry/grpc_plugin_registry.c',
+ 'src/core/plugin_registry/grpc_plugin_registry.cc',
],
'conditions': [
['OS == "mac"', {
diff --git a/config.m4 b/config.m4
index 72f8a1e710b..edd4c64f261 100644
--- a/config.m4
+++ b/config.m4
@@ -345,7 +345,7 @@ if test "$PHP_GRPC" != "no"; then
src/core/ext/filters/message_size/message_size_filter.c \
src/core/ext/filters/workarounds/workaround_cronet_compression_filter.c \
src/core/ext/filters/workarounds/workaround_utils.c \
- src/core/plugin_registry/grpc_plugin_registry.c \
+ src/core/plugin_registry/grpc_plugin_registry.cc \
src/boringssl/err_data.c \
third_party/boringssl/crypto/aes/aes.c \
third_party/boringssl/crypto/aes/key_wrap.c \
diff --git a/config.w32 b/config.w32
index 5347baedc22..7247cfafdb1 100644
--- a/config.w32
+++ b/config.w32
@@ -322,7 +322,7 @@ if (PHP_GRPC != "no") {
"src\\core\\ext\\filters\\message_size\\message_size_filter.c " +
"src\\core\\ext\\filters\\workarounds\\workaround_cronet_compression_filter.c " +
"src\\core\\ext\\filters\\workarounds\\workaround_utils.c " +
- "src\\core\\plugin_registry\\grpc_plugin_registry.c " +
+ "src\\core\\plugin_registry\\grpc_plugin_registry.cc " +
"src\\boringssl\\err_data.c " +
"third_party\\boringssl\\crypto\\aes\\aes.c " +
"third_party\\boringssl\\crypto\\aes\\key_wrap.c " +
diff --git a/gRPC-Core.podspec b/gRPC-Core.podspec
index c76b9a3f4bd..487d35606ea 100644
--- a/gRPC-Core.podspec
+++ b/gRPC-Core.podspec
@@ -727,7 +727,7 @@ Pod::Spec.new do |s|
'src/core/ext/filters/message_size/message_size_filter.c',
'src/core/ext/filters/workarounds/workaround_cronet_compression_filter.c',
'src/core/ext/filters/workarounds/workaround_utils.c',
- 'src/core/plugin_registry/grpc_plugin_registry.c'
+ 'src/core/plugin_registry/grpc_plugin_registry.cc'
ss.private_header_files = 'src/core/lib/profiling/timers.h',
'src/core/lib/support/arena.h',
diff --git a/grpc.gemspec b/grpc.gemspec
index acf71cab782..93c0cb54fd8 100644
--- a/grpc.gemspec
+++ b/grpc.gemspec
@@ -667,7 +667,7 @@ Gem::Specification.new do |s|
s.files += %w( src/core/ext/filters/message_size/message_size_filter.c )
s.files += %w( src/core/ext/filters/workarounds/workaround_cronet_compression_filter.c )
s.files += %w( src/core/ext/filters/workarounds/workaround_utils.c )
- s.files += %w( src/core/plugin_registry/grpc_plugin_registry.c )
+ s.files += %w( src/core/plugin_registry/grpc_plugin_registry.cc )
s.files += %w( third_party/boringssl/crypto/aes/internal.h )
s.files += %w( third_party/boringssl/crypto/asn1/asn1_locl.h )
s.files += %w( third_party/boringssl/crypto/bio/internal.h )
diff --git a/grpc.gyp b/grpc.gyp
index 6331b76f473..9055dfe9015 100644
--- a/grpc.gyp
+++ b/grpc.gyp
@@ -482,7 +482,7 @@
'src/core/ext/filters/message_size/message_size_filter.c',
'src/core/ext/filters/workarounds/workaround_cronet_compression_filter.c',
'src/core/ext/filters/workarounds/workaround_utils.c',
- 'src/core/plugin_registry/grpc_plugin_registry.c',
+ 'src/core/plugin_registry/grpc_plugin_registry.cc',
],
},
{
@@ -1148,7 +1148,7 @@
'src/core/ext/filters/message_size/message_size_filter.c',
'src/core/ext/filters/workarounds/workaround_cronet_compression_filter.c',
'src/core/ext/filters/workarounds/workaround_utils.c',
- 'src/core/plugin_registry/grpc_unsecure_plugin_registry.c',
+ 'src/core/plugin_registry/grpc_unsecure_plugin_registry.cc',
],
},
{
diff --git a/package.xml b/package.xml
index 0eea122b24e..39d238e378f 100644
--- a/package.xml
+++ b/package.xml
@@ -679,7 +679,7 @@
-
+
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 005f5f9417b..95c3bafed82 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,13 +21,13 @@
#include "src/core/ext/filters/client_channel/uri_parser.h"
#include "src/core/lib/channel/channel_args.h"
-#define GRPC_ARG_FAKE_RESOLVER_RESPONSE_GENERATOR \
- "grpc.fake_resolver.response_generator"
-
#ifdef __cplusplus
extern "C" {
#endif
+#define GRPC_ARG_FAKE_RESOLVER_RESPONSE_GENERATOR \
+ "grpc.fake_resolver.response_generator"
+
void grpc_resolver_fake_init();
// Instances of \a grpc_fake_resolver_response_generator are passed to the
diff --git a/src/core/ext/filters/http/http_filters_plugin.c b/src/core/ext/filters/http/http_filters_plugin.c
index 88bd2250f9f..8f5b8563172 100644
--- a/src/core/ext/filters/http/http_filters_plugin.c
+++ b/src/core/ext/filters/http/http_filters_plugin.c
@@ -64,7 +64,7 @@ static bool maybe_add_required_filter(grpc_exec_ctx *exec_ctx,
: true;
}
-void grpc_http_filters_init(void) {
+extern "C" void grpc_http_filters_init(void) {
grpc_register_tracer(&grpc_compression_trace);
grpc_channel_init_register_stage(GRPC_CLIENT_SUBCHANNEL,
GRPC_CHANNEL_INIT_BUILTIN_PRIORITY,
@@ -86,4 +86,4 @@ void grpc_http_filters_init(void) {
maybe_add_required_filter, (void *)&grpc_http_server_filter);
}
-void grpc_http_filters_shutdown(void) {}
+extern "C" void grpc_http_filters_shutdown(void) {}
diff --git a/src/core/lib/debug/stats_data.h b/src/core/lib/debug/stats_data.h
index cf5bafbd047..28dab00117b 100644
--- a/src/core/lib/debug/stats_data.h
+++ b/src/core/lib/debug/stats_data.h
@@ -24,10 +24,6 @@
#include
#include "src/core/lib/iomgr/exec_ctx.h"
-#ifdef __cplusplus
-extern "C" {
-#endif
-
typedef enum {
GRPC_STATS_COUNTER_CLIENT_CALLS_CREATED,
GRPC_STATS_COUNTER_SERVER_CALLS_CREATED,
@@ -471,8 +467,4 @@ extern const int *const grpc_stats_histo_bucket_boundaries[13];
extern void (*const grpc_stats_inc_histogram[13])(grpc_exec_ctx *exec_ctx,
int x);
-#ifdef __cplusplus
-}
-#endif
-
#endif /* GRPC_CORE_LIB_DEBUG_STATS_DATA_H */
diff --git a/src/core/lib/debug/trace.c b/src/core/lib/debug/trace.c
index 7cb2789a19d..21b0d8c3a67 100644
--- a/src/core/lib/debug/trace.c
+++ b/src/core/lib/debug/trace.c
@@ -20,6 +20,7 @@
#include
+#include
#include
#include
#include "src/core/lib/support/env.h"
diff --git a/src/core/lib/iomgr/gethostname.h b/src/core/lib/iomgr/gethostname.h
index 4dcf50c591a..9c6b9d8d420 100644
--- a/src/core/lib/iomgr/gethostname.h
+++ b/src/core/lib/iomgr/gethostname.h
@@ -19,16 +19,8 @@
#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 */
\ No newline at end of file
+#endif /* GRPC_CORE_LIB_IOMGR_GETHOSTNAME_H */
diff --git a/src/core/lib/iomgr/network_status_tracker.c b/src/core/lib/iomgr/network_status_tracker.c
index fe5659160c1..57a7faa9f1c 100644
--- a/src/core/lib/iomgr/network_status_tracker.c
+++ b/src/core/lib/iomgr/network_status_tracker.c
@@ -16,8 +16,8 @@
*
*/
-#include "src/core/lib/iomgr/endpoint.h"
#include "src/core/lib/iomgr/network_status_tracker.h"
+#include "src/core/lib/iomgr/endpoint.h"
void grpc_network_status_shutdown(void) {}
diff --git a/src/core/lib/iomgr/wakeup_fd_cv.h b/src/core/lib/iomgr/wakeup_fd_cv.h
index 8f57de81523..dcd7bdb560f 100644
--- a/src/core/lib/iomgr/wakeup_fd_cv.h
+++ b/src/core/lib/iomgr/wakeup_fd_cv.h
@@ -66,7 +66,7 @@ typedef struct cv_fd_table {
grpc_poll_function_type poll;
} cv_fd_table;
-extern grpc_wakeup_fd_vtable grpc_cv_wakeup_fd_vtable;
+extern const grpc_wakeup_fd_vtable grpc_cv_wakeup_fd_vtable;
#ifdef __cplusplus
}
diff --git a/src/core/lib/iomgr/wakeup_fd_pipe.c b/src/core/lib/iomgr/wakeup_fd_pipe.c
index c9c390b5872..05d69dc9cc6 100644
--- a/src/core/lib/iomgr/wakeup_fd_pipe.c
+++ b/src/core/lib/iomgr/wakeup_fd_pipe.c
@@ -20,8 +20,8 @@
#ifdef GRPC_POSIX_WAKEUP_FD
-#include "src/core/lib/iomgr/wakeup_fd_posix.h"
#include "src/core/lib/iomgr/wakeup_fd_pipe.h"
+#include "src/core/lib/iomgr/wakeup_fd_posix.h"
#include
#include
diff --git a/src/core/lib/iomgr/wakeup_fd_pipe.h b/src/core/lib/iomgr/wakeup_fd_pipe.h
index c4c95ab3580..9bbb5e2ff7b 100644
--- a/src/core/lib/iomgr/wakeup_fd_pipe.h
+++ b/src/core/lib/iomgr/wakeup_fd_pipe.h
@@ -25,7 +25,7 @@
extern "C" {
#endif
-extern grpc_wakeup_fd_vtable grpc_pipe_wakeup_fd_vtable;
+extern const grpc_wakeup_fd_vtable grpc_pipe_wakeup_fd_vtable;
#ifdef __cplusplus
}
diff --git a/src/core/lib/security/credentials/jwt/json_token.c b/src/core/lib/security/credentials/jwt/json_token.c
index e41667c22f3..1f5cc7059da 100644
--- a/src/core/lib/security/credentials/jwt/json_token.c
+++ b/src/core/lib/security/credentials/jwt/json_token.c
@@ -20,6 +20,7 @@
#include
+#include
#include
#include
#include
diff --git a/src/core/lib/support/log.c b/src/core/lib/support/log.c
index fadb4d9a2cf..69f92e001c1 100644
--- a/src/core/lib/support/log.c
+++ b/src/core/lib/support/log.c
@@ -27,7 +27,7 @@
#include
#include
-extern void gpr_default_log(gpr_log_func_args *args);
+extern "C" void gpr_default_log(gpr_log_func_args *args);
static gpr_atm g_log_func = (gpr_atm)gpr_default_log;
static gpr_atm g_min_severity_to_print = GPR_LOG_VERBOSITY_UNSET;
diff --git a/src/core/lib/support/log_linux.c b/src/core/lib/support/log_linux.c
index 77550186932..0914acedf4f 100644
--- a/src/core/lib/support/log_linux.c
+++ b/src/core/lib/support/log_linux.c
@@ -56,7 +56,7 @@ void gpr_log(const char *file, int line, gpr_log_severity severity,
free(message);
}
-void gpr_default_log(gpr_log_func_args *args) {
+extern "C" void gpr_default_log(gpr_log_func_args *args) {
const char *final_slash;
char *prefix;
const char *display_file;
diff --git a/src/core/lib/support/log_posix.c b/src/core/lib/support/log_posix.c
index 8b376fce41f..855e8e7107f 100644
--- a/src/core/lib/support/log_posix.c
+++ b/src/core/lib/support/log_posix.c
@@ -57,7 +57,7 @@ void gpr_log(const char *file, int line, gpr_log_severity severity,
gpr_free(allocated);
}
-void gpr_default_log(gpr_log_func_args *args) {
+extern "C" void gpr_default_log(gpr_log_func_args *args) {
char *final_slash;
const char *display_file;
char time_buffer[64];
diff --git a/src/core/lib/support/log_windows.c b/src/core/lib/support/log_windows.c
index 0fdab79ae6c..b71dacd80a0 100644
--- a/src/core/lib/support/log_windows.c
+++ b/src/core/lib/support/log_windows.c
@@ -65,7 +65,7 @@ void gpr_log(const char *file, int line, gpr_log_severity severity,
}
/* Simple starter implementation */
-void gpr_default_log(gpr_log_func_args *args) {
+extern "C" void gpr_default_log(gpr_log_func_args *args) {
char *final_slash;
const char *display_file;
char time_buffer[64];
diff --git a/src/core/lib/surface/call.c b/src/core/lib/surface/call.c
index 03f47553a14..74e55d57416 100644
--- a/src/core/lib/surface/call.c
+++ b/src/core/lib/surface/call.c
@@ -41,6 +41,7 @@
#include "src/core/lib/support/string.h"
#include "src/core/lib/surface/api_trace.h"
#include "src/core/lib/surface/call.h"
+#include "src/core/lib/surface/call_test_only.h"
#include "src/core/lib/surface/channel.h"
#include "src/core/lib/surface/completion_queue.h"
#include "src/core/lib/surface/validate_metadata.h"
diff --git a/src/core/lib/surface/version.c b/src/core/lib/surface/version.cc
similarity index 100%
rename from src/core/lib/surface/version.c
rename to src/core/lib/surface/version.cc
diff --git a/src/core/plugin_registry/grpc_cronet_plugin_registry.c b/src/core/plugin_registry/grpc_cronet_plugin_registry.cc
similarity index 68%
rename from src/core/plugin_registry/grpc_cronet_plugin_registry.c
rename to src/core/plugin_registry/grpc_cronet_plugin_registry.cc
index 1c09f54ad97..e0422f67503 100644
--- a/src/core/plugin_registry/grpc_cronet_plugin_registry.c
+++ b/src/core/plugin_registry/grpc_cronet_plugin_registry.cc
@@ -18,18 +18,18 @@
#include
-extern void grpc_http_filters_init(void);
-extern void grpc_http_filters_shutdown(void);
-extern void grpc_chttp2_plugin_init(void);
-extern void grpc_chttp2_plugin_shutdown(void);
-extern void grpc_deadline_filter_init(void);
-extern void grpc_deadline_filter_shutdown(void);
-extern void grpc_client_channel_init(void);
-extern void grpc_client_channel_shutdown(void);
-extern void grpc_tsi_gts_init(void);
-extern void grpc_tsi_gts_shutdown(void);
-extern void grpc_server_load_reporting_plugin_init(void);
-extern void grpc_server_load_reporting_plugin_shutdown(void);
+extern "C" void grpc_http_filters_init(void);
+extern "C" void grpc_http_filters_shutdown(void);
+extern "C" void grpc_chttp2_plugin_init(void);
+extern "C" void grpc_chttp2_plugin_shutdown(void);
+extern "C" void grpc_deadline_filter_init(void);
+extern "C" void grpc_deadline_filter_shutdown(void);
+extern "C" void grpc_client_channel_init(void);
+extern "C" void grpc_client_channel_shutdown(void);
+extern "C" void grpc_tsi_gts_init(void);
+extern "C" void grpc_tsi_gts_shutdown(void);
+extern "C" void grpc_server_load_reporting_plugin_init(void);
+extern "C" void grpc_server_load_reporting_plugin_shutdown(void);
void grpc_register_built_in_plugins(void) {
grpc_register_plugin(grpc_http_filters_init,
diff --git a/src/core/plugin_registry/grpc_plugin_registry.c b/src/core/plugin_registry/grpc_plugin_registry.cc
similarity index 58%
rename from src/core/plugin_registry/grpc_plugin_registry.c
rename to src/core/plugin_registry/grpc_plugin_registry.cc
index 9cacf3d306c..2d332e2b915 100644
--- a/src/core/plugin_registry/grpc_plugin_registry.c
+++ b/src/core/plugin_registry/grpc_plugin_registry.cc
@@ -18,42 +18,42 @@
#include
-extern void grpc_http_filters_init(void);
-extern void grpc_http_filters_shutdown(void);
-extern void grpc_chttp2_plugin_init(void);
-extern void grpc_chttp2_plugin_shutdown(void);
-extern void grpc_tsi_gts_init(void);
-extern void grpc_tsi_gts_shutdown(void);
-extern void grpc_deadline_filter_init(void);
-extern void grpc_deadline_filter_shutdown(void);
-extern void grpc_client_channel_init(void);
-extern void grpc_client_channel_shutdown(void);
-extern void grpc_inproc_plugin_init(void);
-extern void grpc_inproc_plugin_shutdown(void);
-extern void grpc_resolver_fake_init(void);
-extern void grpc_resolver_fake_shutdown(void);
-extern void grpc_lb_policy_grpclb_init(void);
-extern void grpc_lb_policy_grpclb_shutdown(void);
-extern void grpc_lb_policy_pick_first_init(void);
-extern void grpc_lb_policy_pick_first_shutdown(void);
-extern void grpc_lb_policy_round_robin_init(void);
-extern void grpc_lb_policy_round_robin_shutdown(void);
-extern void grpc_resolver_dns_ares_init(void);
-extern void grpc_resolver_dns_ares_shutdown(void);
-extern void grpc_resolver_dns_native_init(void);
-extern void grpc_resolver_dns_native_shutdown(void);
-extern void grpc_resolver_sockaddr_init(void);
-extern void grpc_resolver_sockaddr_shutdown(void);
-extern void grpc_server_load_reporting_plugin_init(void);
-extern void grpc_server_load_reporting_plugin_shutdown(void);
-extern void census_grpc_plugin_init(void);
-extern void census_grpc_plugin_shutdown(void);
-extern void grpc_max_age_filter_init(void);
-extern void grpc_max_age_filter_shutdown(void);
-extern void grpc_message_size_filter_init(void);
-extern void grpc_message_size_filter_shutdown(void);
-extern void grpc_workaround_cronet_compression_filter_init(void);
-extern void grpc_workaround_cronet_compression_filter_shutdown(void);
+extern "C" void grpc_http_filters_init(void);
+extern "C" void grpc_http_filters_shutdown(void);
+extern "C" void grpc_chttp2_plugin_init(void);
+extern "C" void grpc_chttp2_plugin_shutdown(void);
+extern "C" void grpc_tsi_gts_init(void);
+extern "C" void grpc_tsi_gts_shutdown(void);
+extern "C" void grpc_deadline_filter_init(void);
+extern "C" void grpc_deadline_filter_shutdown(void);
+extern "C" void grpc_client_channel_init(void);
+extern "C" void grpc_client_channel_shutdown(void);
+extern "C" void grpc_inproc_plugin_init(void);
+extern "C" void grpc_inproc_plugin_shutdown(void);
+extern "C" void grpc_resolver_fake_init(void);
+extern "C" void grpc_resolver_fake_shutdown(void);
+extern "C" void grpc_lb_policy_grpclb_init(void);
+extern "C" void grpc_lb_policy_grpclb_shutdown(void);
+extern "C" void grpc_lb_policy_pick_first_init(void);
+extern "C" void grpc_lb_policy_pick_first_shutdown(void);
+extern "C" void grpc_lb_policy_round_robin_init(void);
+extern "C" void grpc_lb_policy_round_robin_shutdown(void);
+extern "C" void grpc_resolver_dns_ares_init(void);
+extern "C" void grpc_resolver_dns_ares_shutdown(void);
+extern "C" void grpc_resolver_dns_native_init(void);
+extern "C" void grpc_resolver_dns_native_shutdown(void);
+extern "C" void grpc_resolver_sockaddr_init(void);
+extern "C" void grpc_resolver_sockaddr_shutdown(void);
+extern "C" void grpc_server_load_reporting_plugin_init(void);
+extern "C" void grpc_server_load_reporting_plugin_shutdown(void);
+extern "C" void census_grpc_plugin_init(void);
+extern "C" void census_grpc_plugin_shutdown(void);
+extern "C" void grpc_max_age_filter_init(void);
+extern "C" void grpc_max_age_filter_shutdown(void);
+extern "C" void grpc_message_size_filter_init(void);
+extern "C" void grpc_message_size_filter_shutdown(void);
+extern "C" void grpc_workaround_cronet_compression_filter_init(void);
+extern "C" void grpc_workaround_cronet_compression_filter_shutdown(void);
void grpc_register_built_in_plugins(void) {
grpc_register_plugin(grpc_http_filters_init,
diff --git a/src/core/plugin_registry/grpc_unsecure_plugin_registry.c b/src/core/plugin_registry/grpc_unsecure_plugin_registry.cc
similarity index 58%
rename from src/core/plugin_registry/grpc_unsecure_plugin_registry.c
rename to src/core/plugin_registry/grpc_unsecure_plugin_registry.cc
index 7b90d796d57..78218582f02 100644
--- a/src/core/plugin_registry/grpc_unsecure_plugin_registry.c
+++ b/src/core/plugin_registry/grpc_unsecure_plugin_registry.cc
@@ -18,40 +18,40 @@
#include
-extern void grpc_http_filters_init(void);
-extern void grpc_http_filters_shutdown(void);
-extern void grpc_chttp2_plugin_init(void);
-extern void grpc_chttp2_plugin_shutdown(void);
-extern void grpc_deadline_filter_init(void);
-extern void grpc_deadline_filter_shutdown(void);
-extern void grpc_client_channel_init(void);
-extern void grpc_client_channel_shutdown(void);
-extern void grpc_inproc_plugin_init(void);
-extern void grpc_inproc_plugin_shutdown(void);
-extern void grpc_resolver_dns_ares_init(void);
-extern void grpc_resolver_dns_ares_shutdown(void);
-extern void grpc_resolver_dns_native_init(void);
-extern void grpc_resolver_dns_native_shutdown(void);
-extern void grpc_resolver_sockaddr_init(void);
-extern void grpc_resolver_sockaddr_shutdown(void);
-extern void grpc_resolver_fake_init(void);
-extern void grpc_resolver_fake_shutdown(void);
-extern void grpc_server_load_reporting_plugin_init(void);
-extern void grpc_server_load_reporting_plugin_shutdown(void);
-extern void grpc_lb_policy_grpclb_init(void);
-extern void grpc_lb_policy_grpclb_shutdown(void);
-extern void grpc_lb_policy_pick_first_init(void);
-extern void grpc_lb_policy_pick_first_shutdown(void);
-extern void grpc_lb_policy_round_robin_init(void);
-extern void grpc_lb_policy_round_robin_shutdown(void);
-extern void census_grpc_plugin_init(void);
-extern void census_grpc_plugin_shutdown(void);
-extern void grpc_max_age_filter_init(void);
-extern void grpc_max_age_filter_shutdown(void);
-extern void grpc_message_size_filter_init(void);
-extern void grpc_message_size_filter_shutdown(void);
-extern void grpc_workaround_cronet_compression_filter_init(void);
-extern void grpc_workaround_cronet_compression_filter_shutdown(void);
+extern "C" void grpc_http_filters_init(void);
+extern "C" void grpc_http_filters_shutdown(void);
+extern "C" void grpc_chttp2_plugin_init(void);
+extern "C" void grpc_chttp2_plugin_shutdown(void);
+extern "C" void grpc_deadline_filter_init(void);
+extern "C" void grpc_deadline_filter_shutdown(void);
+extern "C" void grpc_client_channel_init(void);
+extern "C" void grpc_client_channel_shutdown(void);
+extern "C" void grpc_inproc_plugin_init(void);
+extern "C" void grpc_inproc_plugin_shutdown(void);
+extern "C" void grpc_resolver_dns_ares_init(void);
+extern "C" void grpc_resolver_dns_ares_shutdown(void);
+extern "C" void grpc_resolver_dns_native_init(void);
+extern "C" void grpc_resolver_dns_native_shutdown(void);
+extern "C" void grpc_resolver_sockaddr_init(void);
+extern "C" void grpc_resolver_sockaddr_shutdown(void);
+extern "C" void grpc_resolver_fake_init(void);
+extern "C" void grpc_resolver_fake_shutdown(void);
+extern "C" void grpc_server_load_reporting_plugin_init(void);
+extern "C" void grpc_server_load_reporting_plugin_shutdown(void);
+extern "C" void grpc_lb_policy_grpclb_init(void);
+extern "C" void grpc_lb_policy_grpclb_shutdown(void);
+extern "C" void grpc_lb_policy_pick_first_init(void);
+extern "C" void grpc_lb_policy_pick_first_shutdown(void);
+extern "C" void grpc_lb_policy_round_robin_init(void);
+extern "C" void grpc_lb_policy_round_robin_shutdown(void);
+extern "C" void census_grpc_plugin_init(void);
+extern "C" void census_grpc_plugin_shutdown(void);
+extern "C" void grpc_max_age_filter_init(void);
+extern "C" void grpc_max_age_filter_shutdown(void);
+extern "C" void grpc_message_size_filter_init(void);
+extern "C" void grpc_message_size_filter_shutdown(void);
+extern "C" void grpc_workaround_cronet_compression_filter_init(void);
+extern "C" void grpc_workaround_cronet_compression_filter_shutdown(void);
void grpc_register_built_in_plugins(void) {
grpc_register_plugin(grpc_http_filters_init,
diff --git a/src/python/grpcio/grpc_core_dependencies.py b/src/python/grpcio/grpc_core_dependencies.py
index 7b684f2a585..29e210042d2 100644
--- a/src/python/grpcio/grpc_core_dependencies.py
+++ b/src/python/grpcio/grpc_core_dependencies.py
@@ -321,7 +321,7 @@ CORE_SOURCE_FILES = [
'src/core/ext/filters/message_size/message_size_filter.c',
'src/core/ext/filters/workarounds/workaround_cronet_compression_filter.c',
'src/core/ext/filters/workarounds/workaround_utils.c',
- 'src/core/plugin_registry/grpc_plugin_registry.c',
+ 'src/core/plugin_registry/grpc_plugin_registry.cc',
'src/boringssl/err_data.c',
'third_party/boringssl/crypto/aes/aes.c',
'third_party/boringssl/crypto/aes/key_wrap.c',
diff --git a/templates/src/core/lib/surface/version.c.template b/templates/src/core/lib/surface/version.cc.template
similarity index 100%
rename from templates/src/core/lib/surface/version.c.template
rename to templates/src/core/lib/surface/version.cc.template
diff --git a/templates/src/core/plugin_registry.template b/templates/src/core/plugin_registry.template
index cf0f4f523e5..8d7617129f8 100644
--- a/templates/src/core/plugin_registry.template
+++ b/templates/src/core/plugin_registry.template
@@ -2,7 +2,7 @@
---
foreach: libs
cond: selected.get('generate_plugin_registry', False)
-output_name: ${selected.name}_plugin_registry.c
+output_name: ${selected.name}_plugin_registry.cc
template: |
/*
*
@@ -25,8 +25,8 @@ template: |
#include
%for plugin in selected.plugins:
- extern void ${plugin}_init(void);
- extern void ${plugin}_shutdown(void);
+ extern "C" void ${plugin}_init(void);
+ extern "C" void ${plugin}_shutdown(void);
%endfor
void grpc_register_built_in_plugins(void) {
diff --git a/tools/buildgen/plugins/expand_filegroups.py b/tools/buildgen/plugins/expand_filegroups.py
index dc073d72b80..669704063eb 100755
--- a/tools/buildgen/plugins/expand_filegroups.py
+++ b/tools/buildgen/plugins/expand_filegroups.py
@@ -146,7 +146,7 @@ def mako_plugin(dictionary):
lib[lst] = vals
lib['plugins'] = plugins
if lib.get('generate_plugin_registry', False):
- lib['src'].append('src/core/plugin_registry/%s_plugin_registry.c' %
+ lib['src'].append('src/core/plugin_registry/%s_plugin_registry.cc' %
lib['name'])
for lst in FILEGROUP_LISTS:
lib[lst] = uniquify(lib.get(lst, []))
diff --git a/tools/doxygen/Doxyfile.core.internal b/tools/doxygen/Doxyfile.core.internal
index 33cafacdde1..205cb2971e4 100644
--- a/tools/doxygen/Doxyfile.core.internal
+++ b/tools/doxygen/Doxyfile.core.internal
@@ -1417,7 +1417,7 @@ src/core/lib/transport/transport.c \
src/core/lib/transport/transport.h \
src/core/lib/transport/transport_impl.h \
src/core/lib/transport/transport_op_string.c \
-src/core/plugin_registry/grpc_plugin_registry.c \
+src/core/plugin_registry/grpc_plugin_registry.cc \
src/core/tsi/README.md \
src/core/tsi/fake_transport_security.c \
src/core/tsi/fake_transport_security.h \