diff --git a/include/grpc/support/avl.h b/include/grpc/support/avl.h index d53ff5d9040..d8a5efd2ad5 100644 --- a/include/grpc/support/avl.h +++ b/include/grpc/support/avl.h @@ -21,6 +21,10 @@ #include +#ifdef __cplusplus +extern "C" { +#endif + /** internal node of an AVL tree */ typedef struct gpr_avl_node { gpr_refcount refs; @@ -91,4 +95,8 @@ 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/src/core/lib/iomgr/iomgr_uv.h b/src/core/lib/iomgr/iomgr_uv.h index 3b4daaa73ba..bc42ca8c1c0 100644 --- a/src/core/lib/iomgr/iomgr_uv.h +++ b/src/core/lib/iomgr/iomgr_uv.h @@ -23,10 +23,18 @@ #include +#ifdef __cplusplus +extern "C" { +#endif + /* The thread ID of the thread on which grpc was initialized. Used to verify * that all calls into libuv are made on that same thread */ extern gpr_thd_id g_init_thread; +#ifdef __cplusplus +} +#endif + #ifdef GRPC_UV_THREAD_CHECK #define GRPC_UV_ASSERT_SAME_THREAD() \ GPR_ASSERT(gpr_thd_currentid() == g_init_thread) diff --git a/src/core/lib/iomgr/network_status_tracker.c b/src/core/lib/iomgr/network_status_tracker.c index 4e5c1d5408c..fe5659160c1 100644 --- a/src/core/lib/iomgr/network_status_tracker.c +++ b/src/core/lib/iomgr/network_status_tracker.c @@ -17,6 +17,7 @@ */ #include "src/core/lib/iomgr/endpoint.h" +#include "src/core/lib/iomgr/network_status_tracker.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 34bc42fd7f3..8f57de81523 100644 --- a/src/core/lib/iomgr/wakeup_fd_cv.h +++ b/src/core/lib/iomgr/wakeup_fd_cv.h @@ -66,8 +66,10 @@ typedef struct cv_fd_table { grpc_poll_function_type poll; } cv_fd_table; +extern grpc_wakeup_fd_vtable grpc_cv_wakeup_fd_vtable; + #ifdef __cplusplus } #endif -#endif /* GRPC_CORE_LIB_IOMGR_WAKEUP_FD_CV_H */ \ No newline at end of file +#endif /* GRPC_CORE_LIB_IOMGR_WAKEUP_FD_CV_H */ diff --git a/src/core/lib/iomgr/wakeup_fd_pipe.c b/src/core/lib/iomgr/wakeup_fd_pipe.c index 4189488f8a3..c9c390b5872 100644 --- a/src/core/lib/iomgr/wakeup_fd_pipe.c +++ b/src/core/lib/iomgr/wakeup_fd_pipe.c @@ -21,6 +21,7 @@ #ifdef GRPC_POSIX_WAKEUP_FD #include "src/core/lib/iomgr/wakeup_fd_posix.h" +#include "src/core/lib/iomgr/wakeup_fd_pipe.h" #include #include diff --git a/src/core/lib/iomgr/wakeup_fd_pipe.h b/src/core/lib/iomgr/wakeup_fd_pipe.h index f860406bda7..c4c95ab3580 100644 --- a/src/core/lib/iomgr/wakeup_fd_pipe.h +++ b/src/core/lib/iomgr/wakeup_fd_pipe.h @@ -21,6 +21,14 @@ #include "src/core/lib/iomgr/wakeup_fd_posix.h" +#ifdef __cplusplus +extern "C" { +#endif + extern grpc_wakeup_fd_vtable grpc_pipe_wakeup_fd_vtable; +#ifdef __cplusplus +} +#endif + #endif /* GRPC_CORE_LIB_IOMGR_WAKEUP_FD_PIPE_H */ diff --git a/src/core/lib/iomgr/wakeup_fd_posix.c b/src/core/lib/iomgr/wakeup_fd_posix.c index 25daa7d3fb7..9af96d314b5 100644 --- a/src/core/lib/iomgr/wakeup_fd_posix.c +++ b/src/core/lib/iomgr/wakeup_fd_posix.c @@ -25,7 +25,6 @@ #include "src/core/lib/iomgr/wakeup_fd_pipe.h" #include "src/core/lib/iomgr/wakeup_fd_posix.h" -extern grpc_wakeup_fd_vtable grpc_cv_wakeup_fd_vtable; static const grpc_wakeup_fd_vtable *wakeup_fd_vtable = NULL; int grpc_allow_specialized_wakeup_fd = 1; diff --git a/src/core/lib/security/credentials/google_default/google_default_credentials.h b/src/core/lib/security/credentials/google_default/google_default_credentials.h index c3755e01a6b..66677873caf 100644 --- a/src/core/lib/security/credentials/google_default/google_default_credentials.h +++ b/src/core/lib/security/credentials/google_default/google_default_credentials.h @@ -23,6 +23,10 @@ #include "src/core/lib/security/credentials/credentials.h" +#ifdef __cplusplus +extern "C" { +#endif + #define GRPC_GOOGLE_CLOUD_SDK_CONFIG_DIRECTORY "gcloud" #define GRPC_GOOGLE_WELL_KNOWN_CREDENTIALS_FILE \ "application_default_credentials.json" @@ -41,5 +45,9 @@ void grpc_flush_cached_google_default_credentials(void); +#ifdef __cplusplus +} +#endif + #endif /* GRPC_CORE_LIB_SECURITY_CREDENTIALS_GOOGLE_DEFAULT_GOOGLE_DEFAULT_CREDENTIALS_H \ */ diff --git a/src/core/lib/security/transport/auth_filters.h b/src/core/lib/security/transport/auth_filters.h index bd5902a128a..ba5df7fe70f 100644 --- a/src/core/lib/security/transport/auth_filters.h +++ b/src/core/lib/security/transport/auth_filters.h @@ -21,7 +21,15 @@ #include "src/core/lib/channel/channel_stack.h" +#ifdef __cplusplus +extern "C" { +#endif + extern const grpc_channel_filter grpc_client_auth_filter; extern const grpc_channel_filter grpc_server_auth_filter; +#ifdef __cplusplus +} +#endif + #endif /* GRPC_CORE_LIB_SECURITY_TRANSPORT_AUTH_FILTERS_H */ diff --git a/src/core/lib/surface/alarm_internal.h b/src/core/lib/surface/alarm_internal.h index 7f2126c5c91..136b60547fa 100644 --- a/src/core/lib/surface/alarm_internal.h +++ b/src/core/lib/surface/alarm_internal.h @@ -22,6 +22,10 @@ #include #include "src/core/lib/debug/trace.h" +#ifdef __cplusplus +extern "C" { +#endif + #ifndef NDEBUG extern grpc_tracer_flag grpc_trace_alarm_refcount; @@ -37,4 +41,8 @@ extern grpc_tracer_flag grpc_trace_alarm_refcount; #endif /* defined(NDEBUG) */ +#ifdef __cplusplus +} +#endif + #endif /* GRPC_CORE_LIB_SURFACE_ALARM_INTERNAL_H */ diff --git a/src/core/lib/surface/api_trace.h b/src/core/lib/surface/api_trace.h index 849cbaaef6e..105abdf629d 100644 --- a/src/core/lib/surface/api_trace.h +++ b/src/core/lib/surface/api_trace.h @@ -22,6 +22,10 @@ #include #include "src/core/lib/debug/trace.h" +#ifdef __cplusplus +extern "C" { +#endif + extern grpc_tracer_flag grpc_api_trace; /* Provide unwrapping macros because we're in C89 and variadic macros weren't @@ -47,4 +51,8 @@ extern grpc_tracer_flag grpc_api_trace; gpr_log(GPR_INFO, fmt GRPC_API_TRACE_UNWRAP##nargs args); \ } +#ifdef __cplusplus +} +#endif + #endif /* GRPC_CORE_LIB_SURFACE_API_TRACE_H */ diff --git a/src/core/lib/surface/lame_client.h b/src/core/lib/surface/lame_client.h index 3ce353f101f..2f6f9cd046e 100644 --- a/src/core/lib/surface/lame_client.h +++ b/src/core/lib/surface/lame_client.h @@ -21,6 +21,14 @@ #include "src/core/lib/channel/channel_stack.h" +#ifdef __cplusplus +extern "C" { +#endif + extern const grpc_channel_filter grpc_lame_filter; +#ifdef __cplusplus +} +#endif + #endif /* GRPC_CORE_LIB_SURFACE_LAME_CLIENT_H */ diff --git a/src/core/lib/surface/validate_metadata.c b/src/core/lib/surface/validate_metadata.c index 61209ae48d1..81d07fae442 100644 --- a/src/core/lib/surface/validate_metadata.c +++ b/src/core/lib/surface/validate_metadata.c @@ -26,6 +26,7 @@ #include "src/core/lib/iomgr/error.h" #include "src/core/lib/slice/slice_internal.h" #include "src/core/lib/slice/slice_string_helpers.h" +#include "src/core/lib/surface/validate_metadata.h" static grpc_error *conforms_to(grpc_slice slice, const uint8_t *legal_bits, const char *err_desc) {