diff options
author | Yash Tibrewal <yashkt@google.com> | 2017-09-21 12:57:30 -0700 |
---|---|---|
committer | Yash Tibrewal <yashkt@google.com> | 2017-10-02 16:23:34 -0700 |
commit | 53a47f09e2fe9755608eac9308a90d232fb1551f (patch) | |
tree | e0d723a311d5467d327a7f7ca1daebd79b8c4fea /src/core/lib | |
parent | a7e6d65a4864422854117149a6e98ff80e492fa9 (diff) |
Changes for C to C++. Adding extern C to header files for compatibility.
Diffstat (limited to 'src/core/lib')
-rw-r--r-- | src/core/lib/iomgr/iomgr_uv.h | 8 | ||||
-rw-r--r-- | src/core/lib/iomgr/network_status_tracker.c | 1 | ||||
-rw-r--r-- | src/core/lib/iomgr/wakeup_fd_cv.h | 4 | ||||
-rw-r--r-- | src/core/lib/iomgr/wakeup_fd_pipe.c | 1 | ||||
-rw-r--r-- | src/core/lib/iomgr/wakeup_fd_pipe.h | 8 | ||||
-rw-r--r-- | src/core/lib/iomgr/wakeup_fd_posix.c | 1 | ||||
-rw-r--r-- | src/core/lib/security/credentials/google_default/google_default_credentials.h | 8 | ||||
-rw-r--r-- | src/core/lib/security/transport/auth_filters.h | 8 | ||||
-rw-r--r-- | src/core/lib/surface/alarm_internal.h | 8 | ||||
-rw-r--r-- | src/core/lib/surface/api_trace.h | 8 | ||||
-rw-r--r-- | src/core/lib/surface/lame_client.h | 8 | ||||
-rw-r--r-- | src/core/lib/surface/validate_metadata.c | 1 |
12 files changed, 62 insertions, 2 deletions
diff --git a/src/core/lib/iomgr/iomgr_uv.h b/src/core/lib/iomgr/iomgr_uv.h index 3b4daaa73b..bc42ca8c1c 100644 --- a/src/core/lib/iomgr/iomgr_uv.h +++ b/src/core/lib/iomgr/iomgr_uv.h @@ -23,10 +23,18 @@ #include <grpc/support/thd.h> +#ifdef __cplusplus +extern "C" { +#endif + /* The thread ID of the thread on which grpc was initialized. Used to verify * that all calls into libuv are made on that same thread */ extern gpr_thd_id g_init_thread; +#ifdef __cplusplus +} +#endif + #ifdef GRPC_UV_THREAD_CHECK #define GRPC_UV_ASSERT_SAME_THREAD() \ GPR_ASSERT(gpr_thd_currentid() == g_init_thread) diff --git a/src/core/lib/iomgr/network_status_tracker.c b/src/core/lib/iomgr/network_status_tracker.c index 4e5c1d5408..fe5659160c 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 34bc42fd7f..8f57de8152 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 4189488f8a..c9c390b587 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 <errno.h> #include <string.h> diff --git a/src/core/lib/iomgr/wakeup_fd_pipe.h b/src/core/lib/iomgr/wakeup_fd_pipe.h index f860406bda..c4c95ab358 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 25daa7d3fb..9af96d314b 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 c3755e01a6..66677873ca 100644 --- a/src/core/lib/security/credentials/google_default/google_default_credentials.h +++ b/src/core/lib/security/credentials/google_default/google_default_credentials.h @@ -23,6 +23,10 @@ #include "src/core/lib/security/credentials/credentials.h" +#ifdef __cplusplus +extern "C" { +#endif + #define GRPC_GOOGLE_CLOUD_SDK_CONFIG_DIRECTORY "gcloud" #define GRPC_GOOGLE_WELL_KNOWN_CREDENTIALS_FILE \ "application_default_credentials.json" @@ -41,5 +45,9 @@ void grpc_flush_cached_google_default_credentials(void); +#ifdef __cplusplus +} +#endif + #endif /* GRPC_CORE_LIB_SECURITY_CREDENTIALS_GOOGLE_DEFAULT_GOOGLE_DEFAULT_CREDENTIALS_H \ */ diff --git a/src/core/lib/security/transport/auth_filters.h b/src/core/lib/security/transport/auth_filters.h index bd5902a128..ba5df7fe70 100644 --- a/src/core/lib/security/transport/auth_filters.h +++ b/src/core/lib/security/transport/auth_filters.h @@ -21,7 +21,15 @@ #include "src/core/lib/channel/channel_stack.h" +#ifdef __cplusplus +extern "C" { +#endif + extern const grpc_channel_filter grpc_client_auth_filter; extern const grpc_channel_filter grpc_server_auth_filter; +#ifdef __cplusplus +} +#endif + #endif /* GRPC_CORE_LIB_SECURITY_TRANSPORT_AUTH_FILTERS_H */ diff --git a/src/core/lib/surface/alarm_internal.h b/src/core/lib/surface/alarm_internal.h index 7f2126c5c9..136b60547f 100644 --- a/src/core/lib/surface/alarm_internal.h +++ b/src/core/lib/surface/alarm_internal.h @@ -22,6 +22,10 @@ #include <grpc/support/log.h> #include "src/core/lib/debug/trace.h" +#ifdef __cplusplus +extern "C" { +#endif + #ifndef NDEBUG extern grpc_tracer_flag grpc_trace_alarm_refcount; @@ -37,4 +41,8 @@ extern grpc_tracer_flag grpc_trace_alarm_refcount; #endif /* defined(NDEBUG) */ +#ifdef __cplusplus +} +#endif + #endif /* GRPC_CORE_LIB_SURFACE_ALARM_INTERNAL_H */ diff --git a/src/core/lib/surface/api_trace.h b/src/core/lib/surface/api_trace.h index 849cbaaef6..105abdf629 100644 --- a/src/core/lib/surface/api_trace.h +++ b/src/core/lib/surface/api_trace.h @@ -22,6 +22,10 @@ #include <grpc/support/log.h> #include "src/core/lib/debug/trace.h" +#ifdef __cplusplus +extern "C" { +#endif + extern grpc_tracer_flag grpc_api_trace; /* Provide unwrapping macros because we're in C89 and variadic macros weren't @@ -47,4 +51,8 @@ extern grpc_tracer_flag grpc_api_trace; gpr_log(GPR_INFO, fmt GRPC_API_TRACE_UNWRAP##nargs args); \ } +#ifdef __cplusplus +} +#endif + #endif /* GRPC_CORE_LIB_SURFACE_API_TRACE_H */ diff --git a/src/core/lib/surface/lame_client.h b/src/core/lib/surface/lame_client.h index 3ce353f101..2f6f9cd046 100644 --- a/src/core/lib/surface/lame_client.h +++ b/src/core/lib/surface/lame_client.h @@ -21,6 +21,14 @@ #include "src/core/lib/channel/channel_stack.h" +#ifdef __cplusplus +extern "C" { +#endif + extern const grpc_channel_filter grpc_lame_filter; +#ifdef __cplusplus +} +#endif + #endif /* GRPC_CORE_LIB_SURFACE_LAME_CLIENT_H */ diff --git a/src/core/lib/surface/validate_metadata.c b/src/core/lib/surface/validate_metadata.c index 61209ae48d..81d07fae44 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) { |