diff options
author | 2017-11-30 17:47:36 -0800 | |
---|---|---|
committer | 2017-11-30 17:47:36 -0800 | |
commit | 36522e9f8008cade840b75f53164602719577bc6 (patch) | |
tree | dad5fcaa9e6e23923da427fbe36d7dbd6f288ba3 /src/core/lib/iomgr | |
parent | ede1b2703d4058578b8b5830f006c89c9216521b (diff) | |
parent | 74a53c2440823e7b53741edba883ff1f4fb8f23a (diff) |
Merge master after no Extern C changes
Diffstat (limited to 'src/core/lib/iomgr')
54 files changed, 2 insertions, 402 deletions
diff --git a/src/core/lib/iomgr/block_annotate.h b/src/core/lib/iomgr/block_annotate.h index e3d4368d17..a57873aabb 100644 --- a/src/core/lib/iomgr/block_annotate.h +++ b/src/core/lib/iomgr/block_annotate.h @@ -19,19 +19,9 @@ #ifndef GRPC_CORE_LIB_IOMGR_BLOCK_ANNOTATE_H #define GRPC_CORE_LIB_IOMGR_BLOCK_ANNOTATE_H -#include "src/core/lib/iomgr/exec_ctx.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. These include poll, epoll, and getaddrinfo. */ diff --git a/src/core/lib/iomgr/call_combiner.h b/src/core/lib/iomgr/call_combiner.h index cf928a13f4..9f7e6ce1c9 100644 --- a/src/core/lib/iomgr/call_combiner.h +++ b/src/core/lib/iomgr/call_combiner.h @@ -27,10 +27,6 @@ #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. // @@ -112,8 +108,4 @@ void grpc_call_combiner_set_notify_on_cancel(grpc_call_combiner* call_combiner, void grpc_call_combiner_cancel(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 8555fa979f..46b9ac58be 100644 --- a/src/core/lib/iomgr/combiner.h +++ b/src/core/lib/iomgr/combiner.h @@ -26,10 +26,6 @@ #include "src/core/lib/iomgr/exec_ctx.h" #include "src/core/lib/support/mpscq.h" -#ifdef __cplusplus -extern "C" { -#endif - // Provides serialized access to some resource. // Each action queued on a combiner is executed serially in a borrowed thread. // The actual thread executing actions may change over time (but there will only @@ -65,8 +61,4 @@ bool grpc_combiner_continue_exec_ctx(); extern grpc_core::TraceFlag 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 10397fd98f..cd53099334 100644 --- a/src/core/lib/iomgr/endpoint.h +++ b/src/core/lib/iomgr/endpoint.h @@ -26,10 +26,6 @@ #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. */ @@ -97,8 +93,4 @@ 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..506ffc88b4 100644 --- a/src/core/lib/iomgr/endpoint_pair.h +++ b/src/core/lib/iomgr/endpoint_pair.h @@ -21,10 +21,6 @@ #include "src/core/lib/iomgr/endpoint.h" -#ifdef __cplusplus -extern "C" { -#endif - typedef struct { grpc_endpoint* client; grpc_endpoint* server; @@ -33,8 +29,4 @@ 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 d10bf0b359..4759ee0791 100644 --- a/src/core/lib/iomgr/error.h +++ b/src/core/lib/iomgr/error.h @@ -29,10 +29,6 @@ #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 /// full write up of this object. @@ -203,8 +199,4 @@ 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..6cb09c2cdb 100644 --- a/src/core/lib/iomgr/error_internal.h +++ b/src/core/lib/iomgr/error_internal.h @@ -25,10 +25,6 @@ #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; struct grpc_linked_error { @@ -62,8 +58,4 @@ 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..9a1b96bd45 100644 --- a/src/core/lib/iomgr/ev_epoll1_linux.h +++ b/src/core/lib/iomgr/ev_epoll1_linux.h @@ -22,16 +22,8 @@ #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..ffa7fc7f32 100644 --- a/src/core/lib/iomgr/ev_epollex_linux.h +++ b/src/core/lib/iomgr/ev_epollex_linux.h @@ -22,15 +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_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..5b8aba9d9f 100644 --- a/src/core/lib/iomgr/ev_epollsig_linux.h +++ b/src/core/lib/iomgr/ev_epollsig_linux.h @@ -22,10 +22,6 @@ #include "src/core/lib/iomgr/ev_posix.h" #include "src/core/lib/iomgr/port.h" -#ifdef __cplusplus -extern "C" { -#endif - const grpc_event_engine_vtable* grpc_init_epollsig_linux(bool explicit_request); #ifdef GRPC_LINUX_EPOLL @@ -34,8 +30,4 @@ 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..f6bc624d4f 100644 --- a/src/core/lib/iomgr/ev_poll_posix.h +++ b/src/core/lib/iomgr/ev_poll_posix.h @@ -21,15 +21,7 @@ #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 d8a349fd30..b516f93058 100644 --- a/src/core/lib/iomgr/ev_posix.cc +++ b/src/core/lib/iomgr/ev_posix.cc @@ -59,8 +59,6 @@ typedef struct { namespace { -extern "C" { - grpc_poll_function_type real_poll_function; int dummy_poll(struct pollfd fds[], nfds_t nfds, int timeout) { @@ -72,7 +70,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 39017a9fdd..62f1162a23 100644 --- a/src/core/lib/iomgr/ev_posix.h +++ b/src/core/lib/iomgr/ev_posix.h @@ -27,10 +27,6 @@ #include "src/core/lib/iomgr/pollset_set.h" #include "src/core/lib/iomgr/wakeup_fd_posix.h" -#ifdef __cplusplus -extern "C" { -#endif - extern grpc_core::TraceFlag grpc_polling_trace; /* Disabled by default */ typedef struct grpc_fd grpc_fd; @@ -144,8 +140,4 @@ 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 c8700f3352..b0c1740155 100644 --- a/src/core/lib/iomgr/exec_ctx.h +++ b/src/core/lib/iomgr/exec_ctx.h @@ -26,10 +26,6 @@ #include "src/core/lib/iomgr/closure.h" -#ifdef __cplusplus -extern "C" { -#endif - typedef gpr_atm grpc_millis; #define GRPC_MILLIS_INF_FUTURE GPR_ATM_MAX @@ -200,8 +196,4 @@ on outside context */ }; } // namespace grpc_core -#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 4f21f853f0..e16f11aa21 100644 --- a/src/core/lib/iomgr/executor.h +++ b/src/core/lib/iomgr/executor.h @@ -21,10 +21,6 @@ #include "src/core/lib/iomgr/closure.h" -#ifdef __cplusplus -extern "C" { -#endif - typedef enum { GRPC_EXECUTOR_SHORT, GRPC_EXECUTOR_LONG @@ -49,8 +45,4 @@ bool grpc_executor_is_threaded(); grpc_executor_shutdown */ void grpc_executor_set_threading(bool enable); -#ifdef __cplusplus -} -#endif - #endif /* GRPC_CORE_LIB_IOMGR_EXECUTOR_H */ diff --git a/src/core/lib/iomgr/fork_posix.cc b/src/core/lib/iomgr/fork_posix.cc index 969b7ac670..cc131408af 100644 --- a/src/core/lib/iomgr/fork_posix.cc +++ b/src/core/lib/iomgr/fork_posix.cc @@ -80,7 +80,9 @@ void grpc_postfork_child() { void grpc_fork_handlers_auto_register() { if (grpc_fork_support_enabled()) { +#ifdef GRPC_POSIX_FORK_ALLOW_PTHREAD_ATFORK pthread_atfork(grpc_prefork, grpc_postfork_parent, grpc_postfork_child); +#endif // GRPC_POSIX_FORK_ALLOW_PTHREAD_ATFORK } } diff --git a/src/core/lib/iomgr/gethostname.h b/src/core/lib/iomgr/gethostname.h index 2e65b5ffbf..9f10b4afa7 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 */ diff --git a/src/core/lib/iomgr/iocp_windows.h b/src/core/lib/iomgr/iocp_windows.h index 4e6f6ed106..75b0ff4a92 100644 --- a/src/core/lib/iomgr/iocp_windows.h +++ b/src/core/lib/iomgr/iocp_windows.h @@ -27,10 +27,6 @@ #include "src/core/lib/iomgr/socket_windows.h" -#ifdef __cplusplus -extern "C" { -#endif - typedef enum { GRPC_IOCP_WORK_WORK, GRPC_IOCP_WORK_TIMEOUT, @@ -44,10 +40,6 @@ void grpc_iocp_flush(void); void grpc_iocp_shutdown(void); void grpc_iocp_add_socket(grpc_winsocket*); -#ifdef __cplusplus -} -#endif - #endif #endif /* GRPC_CORE_LIB_IOMGR_IOCP_WINDOWS_H */ diff --git a/src/core/lib/iomgr/iomgr.h b/src/core/lib/iomgr/iomgr.h index ce9f60521c..3f238c660a 100644 --- a/src/core/lib/iomgr/iomgr.h +++ b/src/core/lib/iomgr/iomgr.h @@ -22,10 +22,6 @@ #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(); @@ -36,8 +32,4 @@ void grpc_iomgr_start(); * exec_ctx. */ void grpc_iomgr_shutdown(); -#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..20b3cb70d0 100644 --- a/src/core/lib/iomgr/iomgr_internal.h +++ b/src/core/lib/iomgr/iomgr_internal.h @@ -23,10 +23,6 @@ #include "src/core/lib/iomgr/iomgr.h" -#ifdef __cplusplus -extern "C" { -#endif - typedef struct grpc_iomgr_object { char* name; struct grpc_iomgr_object* next; @@ -44,8 +40,4 @@ 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..3b4daaa73b 100644 --- a/src/core/lib/iomgr/iomgr_uv.h +++ b/src/core/lib/iomgr/iomgr_uv.h @@ -23,18 +23,10 @@ #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/load_file.h b/src/core/lib/iomgr/load_file.h index 5b367c189d..a7336527ce 100644 --- a/src/core/lib/iomgr/load_file.h +++ b/src/core/lib/iomgr/load_file.h @@ -25,17 +25,9 @@ #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 6861acfb6d..0102d32c11 100644 --- a/src/core/lib/iomgr/polling_entity.h +++ b/src/core/lib/iomgr/polling_entity.h @@ -22,10 +22,6 @@ #include "src/core/lib/iomgr/pollset.h" #include "src/core/lib/iomgr/pollset_set.h" -#ifdef __cplusplus -extern "C" { -#endif - typedef enum grpc_pollset_tag { GRPC_POLLS_NONE, GRPC_POLLS_POLLSET, @@ -66,8 +62,5 @@ void grpc_polling_entity_add_to_pollset_set(grpc_polling_entity* pollent, * pollset_set \a * pss_dst */ void grpc_polling_entity_del_from_pollset_set(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 c32c086971..6bb3cd3e0c 100644 --- a/src/core/lib/iomgr/pollset.h +++ b/src/core/lib/iomgr/pollset.h @@ -25,10 +25,6 @@ #include "src/core/lib/iomgr/exec_ctx.h" -#ifdef __cplusplus -extern "C" { -#endif - extern grpc_core::DebugOnlyTraceFlag grpc_trace_fd_refcount; /* A grpc_pollset is a set of file descriptors that a higher level item is @@ -81,8 +77,4 @@ grpc_error* grpc_pollset_kick(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 4aa1a5977e..a94d0afe75 100644 --- a/src/core/lib/iomgr/pollset_set.h +++ b/src/core/lib/iomgr/pollset_set.h @@ -21,10 +21,6 @@ #include "src/core/lib/iomgr/pollset.h" -#ifdef __cplusplus -extern "C" { -#endif - /* A grpc_pollset_set is a set of pollsets that are interested in an action. Adding a pollset to a pollset_set automatically adds any fd's (etc) that have been registered with the set_set to that pollset. @@ -43,8 +39,4 @@ void grpc_pollset_set_add_pollset_set(grpc_pollset_set* bag, void grpc_pollset_set_del_pollset_set(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..566c110ca6 100644 --- a/src/core/lib/iomgr/pollset_uv.h +++ b/src/core/lib/iomgr/pollset_uv.h @@ -19,17 +19,9 @@ #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..93fe7d669b 100644 --- a/src/core/lib/iomgr/pollset_windows.h +++ b/src/core/lib/iomgr/pollset_windows.h @@ -26,10 +26,6 @@ #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 used to synchronize with the IOCP, and workers are condition variables @@ -67,10 +63,6 @@ struct grpc_pollset { void grpc_pollset_global_init(void); void grpc_pollset_global_shutdown(void); -#ifdef __cplusplus -} -#endif - #endif #endif /* GRPC_CORE_LIB_IOMGR_POLLSET_WINDOWS_H */ diff --git a/src/core/lib/iomgr/resolve_address.h b/src/core/lib/iomgr/resolve_address.h index f62f92b0bf..12fc2ed088 100644 --- a/src/core/lib/iomgr/resolve_address.h +++ b/src/core/lib/iomgr/resolve_address.h @@ -25,10 +25,6 @@ #define GRPC_MAX_SOCKADDR_SIZE 128 -#ifdef __cplusplus -extern "C" { -#endif - typedef struct { char addr[GRPC_MAX_SOCKADDR_SIZE]; size_t len; @@ -55,8 +51,4 @@ 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 ae7f487b5d..39e3aabf18 100644 --- a/src/core/lib/iomgr/resource_quota.h +++ b/src/core/lib/iomgr/resource_quota.h @@ -24,10 +24,6 @@ #include "src/core/lib/debug/trace.h" #include "src/core/lib/iomgr/exec_ctx.h" -#ifdef __cplusplus -extern "C" { -#endif - /** \file Tracks resource usage against a pool. The current implementation tracks only memory usage, but in the future @@ -145,8 +141,4 @@ void grpc_resource_user_alloc_slices( grpc_slice grpc_resource_user_slice_malloc(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..e3bd51a4ad 100644 --- a/src/core/lib/iomgr/sockaddr_utils.h +++ b/src/core/lib/iomgr/sockaddr_utils.h @@ -21,10 +21,6 @@ #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 +77,4 @@ 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..af57cc5b60 100644 --- a/src/core/lib/iomgr/socket_factory_posix.h +++ b/src/core/lib/iomgr/socket_factory_posix.h @@ -23,10 +23,6 @@ #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 { /** Replacement for socket(2) */ @@ -68,8 +64,4 @@ 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..0a97cf657f 100644 --- a/src/core/lib/iomgr/socket_mutator.h +++ b/src/core/lib/iomgr/socket_mutator.h @@ -24,10 +24,6 @@ #include <stdbool.h> -#ifdef __cplusplus -extern "C" { -#endif - /** The virtual table of grpc_socket_mutator */ typedef struct { /** Mutates the socket opitons of \a fd */ @@ -60,8 +56,4 @@ 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..9fd141b6de 100644 --- a/src/core/lib/iomgr/socket_utils.h +++ b/src/core/lib/iomgr/socket_utils.h @@ -21,15 +21,7 @@ #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..77df4205ff 100644 --- a/src/core/lib/iomgr/socket_utils_posix.h +++ b/src/core/lib/iomgr/socket_utils_posix.h @@ -29,10 +29,6 @@ #include "src/core/lib/iomgr/socket_factory_posix.h" #include "src/core/lib/iomgr/socket_mutator.h" -#ifdef __cplusplus -extern "C" { -#endif - /* a wrapper for accept or accept4 */ int grpc_accept4(int sockfd, grpc_resolved_address* resolved_addr, int nonblock, int cloexec); @@ -133,8 +129,4 @@ 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 4a1c624916..cb28f2b8df 100644 --- a/src/core/lib/iomgr/socket_windows.h +++ b/src/core/lib/iomgr/socket_windows.h @@ -31,10 +31,6 @@ #include "src/core/lib/iomgr/exec_ctx.h" #include "src/core/lib/iomgr/iomgr_internal.h" -#ifdef __cplusplus -extern "C" { -#endif - /* This holds the data for an outstanding read or write on a socket. The mutex to protect the concurrent access to that data is the one inside the winsocket wrapper. */ @@ -111,10 +107,6 @@ void grpc_socket_notify_on_read(grpc_winsocket* winsocket, void grpc_socket_become_ready(grpc_winsocket* winsocket, grpc_winsocket_callback_info* ci); -#ifdef __cplusplus -} -#endif - #endif #endif /* GRPC_CORE_LIB_IOMGR_SOCKET_WINDOWS_H */ diff --git a/src/core/lib/iomgr/tcp_client.h b/src/core/lib/iomgr/tcp_client.h index 04b91790eb..5f55d30955 100644 --- a/src/core/lib/iomgr/tcp_client.h +++ b/src/core/lib/iomgr/tcp_client.h @@ -25,10 +25,6 @@ #include "src/core/lib/iomgr/pollset_set.h" #include "src/core/lib/iomgr/resolve_address.h" -#ifdef __cplusplus -extern "C" { -#endif - /* Asynchronously connect to an address (specified as (addr, len)), and call cb with arg and the completed connection when done (or call cb with arg and NULL on failure). @@ -40,8 +36,4 @@ void grpc_tcp_client_connect(grpc_closure* on_connect, grpc_endpoint** endpoint, 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 84c5a674d4..15062a52cd 100644 --- a/src/core/lib/iomgr/tcp_client_posix.cc +++ b/src/core/lib/iomgr/tcp_client_posix.cc @@ -329,13 +329,11 @@ done: } // overridden by api_fuzzer.c -extern "C" { void (*grpc_tcp_client_connect_impl)( 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_closure* closure, grpc_endpoint** ep, grpc_pollset_set* interested_parties, diff --git a/src/core/lib/iomgr/tcp_client_posix.h b/src/core/lib/iomgr/tcp_client_posix.h index ae5dc30566..7d0f133a6b 100644 --- a/src/core/lib/iomgr/tcp_client_posix.h +++ b/src/core/lib/iomgr/tcp_client_posix.h @@ -23,15 +23,7 @@ #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_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_uv.cc b/src/core/lib/iomgr/tcp_client_uv.cc index 0cb688cf16..4e9c7cc11d 100644 --- a/src/core/lib/iomgr/tcp_client_uv.cc +++ b/src/core/lib/iomgr/tcp_client_uv.cc @@ -157,13 +157,11 @@ static void tcp_client_connect_impl(grpc_closure* closure, grpc_endpoint** ep, } // overridden by api_fuzzer.c -extern "C" { void (*grpc_tcp_client_connect_impl)( 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_closure* closure, grpc_endpoint** ep, grpc_pollset_set* interested_parties, diff --git a/src/core/lib/iomgr/tcp_client_windows.cc b/src/core/lib/iomgr/tcp_client_windows.cc index d67addd11c..5521a0a9ae 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_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_closure* closure, grpc_endpoint** ep, grpc_pollset_set* interested_parties, diff --git a/src/core/lib/iomgr/tcp_posix.h b/src/core/lib/iomgr/tcp_posix.h index 2fa1256ec7..4529c02beb 100644 --- a/src/core/lib/iomgr/tcp_posix.h +++ b/src/core/lib/iomgr/tcp_posix.h @@ -33,10 +33,6 @@ #include "src/core/lib/iomgr/endpoint.h" #include "src/core/lib/iomgr/ev_posix.h" -#ifdef __cplusplus -extern "C" { -#endif - extern grpc_core::TraceFlag grpc_tcp_trace; /* Create a tcp endpoint given a file desciptor and a read slice size. @@ -56,8 +52,4 @@ int grpc_tcp_fd(grpc_endpoint* ep); void grpc_tcp_destroy_and_release_fd(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 4d2bd8dc2a..038c765c6c 100644 --- a/src/core/lib/iomgr/tcp_server.h +++ b/src/core/lib/iomgr/tcp_server.h @@ -25,10 +25,6 @@ #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; @@ -99,8 +95,4 @@ void grpc_tcp_server_unref(grpc_tcp_server* s); /* Shutdown the fds of listeners. */ void grpc_tcp_server_shutdown_listeners(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..6046f257f9 100644 --- a/src/core/lib/iomgr/tcp_server_utils_posix.h +++ b/src/core/lib/iomgr/tcp_server_utils_posix.h @@ -24,10 +24,6 @@ #include "src/core/lib/iomgr/socket_utils_posix.h" #include "src/core/lib/iomgr/tcp_server.h" -#ifdef __cplusplus -extern "C" { -#endif - /* one listening port */ typedef struct grpc_tcp_listener { int fd; @@ -121,8 +117,4 @@ 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 4b4da3608f..fd6d19049a 100644 --- a/src/core/lib/iomgr/tcp_uv.h +++ b/src/core/lib/iomgr/tcp_uv.h @@ -42,18 +42,10 @@ extern grpc_core::TraceFlag 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 */ #endif /* GRPC_CORE_LIB_IOMGR_TCP_UV_H */ diff --git a/src/core/lib/iomgr/tcp_windows.h b/src/core/lib/iomgr/tcp_windows.h index 693037cab7..8578a358ea 100644 --- a/src/core/lib/iomgr/tcp_windows.h +++ b/src/core/lib/iomgr/tcp_windows.h @@ -35,10 +35,6 @@ #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,10 +44,6 @@ grpc_endpoint* grpc_tcp_create(grpc_winsocket* socket, grpc_error* grpc_tcp_prepare_socket(SOCKET sock); -#ifdef __cplusplus -} -#endif - #endif #endif /* GRPC_CORE_LIB_IOMGR_TCP_WINDOWS_H */ diff --git a/src/core/lib/iomgr/time_averaged_stats.h b/src/core/lib/iomgr/time_averaged_stats.h index d38ed272b6..8745f7fa13 100644 --- a/src/core/lib/iomgr/time_averaged_stats.h +++ b/src/core/lib/iomgr/time_averaged_stats.h @@ -19,10 +19,6 @@ #ifndef GRPC_CORE_LIB_IOMGR_TIME_AVERAGED_STATS_H #define GRPC_CORE_LIB_IOMGR_TIME_AVERAGED_STATS_H -#ifdef __cplusplus -extern "C" { -#endif - /* This tracks a time-decaying weighted average. It works by collecting batches of samples and then mixing their average into a time-decaying weighted mean. It is designed for batch operations where we do many adds @@ -74,8 +70,4 @@ 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 a74292eaf9..82049859c5 100644 --- a/src/core/lib/iomgr/timer.h +++ b/src/core/lib/iomgr/timer.h @@ -32,10 +32,6 @@ #include "src/core/lib/iomgr/exec_ctx.h" #include "src/core/lib/iomgr/iomgr.h" -#ifdef __cplusplus -extern "C" { -#endif - typedef struct grpc_timer grpc_timer; /* Initialize *timer. When expired or canceled, closure will be called with @@ -105,8 +101,4 @@ 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_heap.h b/src/core/lib/iomgr/timer_heap.h index ae56e5a73e..436eef55a6 100644 --- a/src/core/lib/iomgr/timer_heap.h +++ b/src/core/lib/iomgr/timer_heap.h @@ -21,10 +21,6 @@ #include "src/core/lib/iomgr/timer.h" -#ifdef __cplusplus -extern "C" { -#endif - typedef struct { grpc_timer** timers; uint32_t timer_count; @@ -43,8 +39,4 @@ 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..0ba502928a 100644 --- a/src/core/lib/iomgr/timer_manager.h +++ b/src/core/lib/iomgr/timer_manager.h @@ -21,10 +21,6 @@ #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 +34,4 @@ 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/udp_server.h b/src/core/lib/iomgr/udp_server.h index ff68474430..d9786be27c 100644 --- a/src/core/lib/iomgr/udp_server.h +++ b/src/core/lib/iomgr/udp_server.h @@ -23,10 +23,6 @@ #include "src/core/lib/iomgr/ev_posix.h" #include "src/core/lib/iomgr/resolve_address.h" -#ifdef __cplusplus -extern "C" { -#endif - /* Forward decl of struct grpc_server */ /* This is not typedef'ed to avoid a typedef-redefinition error */ struct grpc_server; @@ -72,8 +68,4 @@ int grpc_udp_server_add_port(grpc_udp_server* s, void grpc_udp_server_destroy(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..1c079e6e76 100644 --- a/src/core/lib/iomgr/unix_sockets_posix.h +++ b/src/core/lib/iomgr/unix_sockets_posix.h @@ -25,10 +25,6 @@ #include "src/core/lib/iomgr/resolve_address.h" -#ifdef __cplusplus -extern "C" { -#endif - void grpc_create_socketpair_if_unix(int sv[2]); grpc_error* grpc_resolve_unix_domain_address( @@ -42,8 +38,4 @@ 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..017e41bfa8 100644 --- a/src/core/lib/iomgr/wakeup_fd_cv.h +++ b/src/core/lib/iomgr/wakeup_fd_cv.h @@ -40,10 +40,6 @@ #define GRPC_FD_TO_IDX(fd) (-(fd)-1) #define GRPC_IDX_TO_FD(idx) (-(idx)-1) -#ifdef __cplusplus -extern "C" { -#endif - typedef struct cv_node { gpr_cv* cv; struct cv_node* next; @@ -68,8 +64,4 @@ 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..326a0c4e01 100644 --- a/src/core/lib/iomgr/wakeup_fd_pipe.h +++ b/src/core/lib/iomgr/wakeup_fd_pipe.h @@ -21,14 +21,6 @@ #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..a9584d0d48 100644 --- a/src/core/lib/iomgr/wakeup_fd_posix.h +++ b/src/core/lib/iomgr/wakeup_fd_posix.h @@ -49,10 +49,6 @@ #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 +91,4 @@ 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 */ |