From 01a7547a3f409e004b9f6df4314c1f42e53a9448 Mon Sep 17 00:00:00 2001 From: ncteisen Date: Thu, 16 Nov 2017 16:04:42 -0800 Subject: [PATCH] Re 89 the public headers --- include/grpc/census.h | 8 ++++++-- include/grpc/compression.h | 8 ++++++-- include/grpc/grpc.h | 8 ++++++-- include/grpc/grpc_cronet.h | 8 ++++++-- include/grpc/grpc_posix.h | 8 ++++++-- include/grpc/grpc_security.h | 8 ++++++-- include/grpc/grpc_security_constants.h | 8 ++++++-- include/grpc/impl/codegen/atm.h | 8 ++++++-- include/grpc/impl/codegen/atm_gcc_atomic.h | 8 ++++++-- include/grpc/impl/codegen/byte_buffer.h | 8 ++++++-- include/grpc/impl/codegen/byte_buffer_reader.h | 8 ++++++-- include/grpc/impl/codegen/compression_types.h | 8 ++++++-- include/grpc/impl/codegen/connectivity_state.h | 8 ++++++-- include/grpc/impl/codegen/gpr_types.h | 8 ++++++-- include/grpc/impl/codegen/grpc_types.h | 8 ++++++-- include/grpc/impl/codegen/propagation_bits.h | 8 ++++++-- include/grpc/impl/codegen/status.h | 8 ++++++-- include/grpc/impl/codegen/sync.h | 8 ++++++-- include/grpc/load_reporting.h | 8 ++++++-- include/grpc/slice.h | 8 ++++++-- include/grpc/slice_buffer.h | 8 ++++++-- include/grpc/support/alloc.h | 8 ++++++-- include/grpc/support/avl.h | 8 ++++++-- include/grpc/support/cmdline.h | 8 ++++++-- include/grpc/support/cpu.h | 8 ++++++-- include/grpc/support/histogram.h | 8 ++++++-- include/grpc/support/host_port.h | 8 ++++++-- include/grpc/support/log.h | 8 ++++++-- include/grpc/support/log_windows.h | 8 ++++++-- include/grpc/support/string_util.h | 8 ++++++-- include/grpc/support/subprocess.h | 8 ++++++-- include/grpc/support/sync.h | 8 +++++++- include/grpc/support/thd.h | 8 ++++++-- include/grpc/support/time.h | 8 ++++++-- include/grpc/support/tls_pthread.h | 8 ++++++-- 35 files changed, 211 insertions(+), 69 deletions(-) diff --git a/include/grpc/census.h b/include/grpc/census.h index d7f2fab50b5..2258af88989 100644 --- a/include/grpc/census.h +++ b/include/grpc/census.h @@ -21,7 +21,9 @@ #include - +#ifdef __cplusplus +extern "C" { +#endif /** A Census Context is a handle used by Census to represent the current tracing @@ -29,6 +31,8 @@ (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 c0db8c2bfa6..b42f428d7de 100644 --- a/include/grpc/compression.h +++ b/include/grpc/compression.h @@ -26,7 +26,9 @@ #include #include - +#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. */ @@ -83,6 +85,8 @@ 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 6d6d56a7b36..f083bc591e6 100644 --- a/include/grpc/grpc.h +++ b/include/grpc/grpc.h @@ -29,7 +29,9 @@ #include #include - +#ifdef __cplusplus +extern "C" { +#endif /*! \mainpage GRPC Core * @@ -464,6 +466,8 @@ 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 b3e7ec2705d..127d5d038d0 100644 --- a/include/grpc/grpc_cronet.h +++ b/include/grpc/grpc_cronet.h @@ -21,12 +21,16 @@ #include - +#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 f14cbaa81bb..fa7ebced3f3 100644 --- a/include/grpc/grpc_posix.h +++ b/include/grpc/grpc_posix.h @@ -24,7 +24,9 @@ #include - +#ifdef __cplusplus +extern "C" { +#endif /*! \mainpage GRPC Core POSIX * @@ -57,6 +59,8 @@ 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 f2a05074c2d..7e87217de78 100644 --- a/include/grpc/grpc_security.h +++ b/include/grpc/grpc_security.h @@ -23,7 +23,9 @@ #include #include - +#ifdef __cplusplus +extern "C" { +#endif /** --- Authentication Context. --- */ @@ -459,6 +461,8 @@ 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 1923525ea05..60e167eb885 100644 --- a/include/grpc/grpc_security_constants.h +++ b/include/grpc/grpc_security_constants.h @@ -19,7 +19,9 @@ #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" @@ -97,6 +99,8 @@ 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 7bb41c55d2a..00d83f0604f 100644 --- a/include/grpc/impl/codegen/atm.h +++ b/include/grpc/impl/codegen/atm.h @@ -79,13 +79,17 @@ #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 52eebb3c728..58797085482 100644 --- a/include/grpc/impl/codegen/atm_gcc_atomic.h +++ b/include/grpc/impl/codegen/atm_gcc_atomic.h @@ -23,7 +23,9 @@ __atomic_* interface. */ #include - +#ifdef __cplusplus +extern "C" { +#endif typedef intptr_t gpr_atm; #define GPR_ATM_MAX INTPTR_MAX @@ -82,6 +84,8 @@ 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 082fb9b36fb..f8dfbd1d7dc 100644 --- a/include/grpc/impl/codegen/byte_buffer.h +++ b/include/grpc/impl/codegen/byte_buffer.h @@ -21,7 +21,9 @@ #include - +#ifdef __cplusplus +extern "C" { +#endif /** Returns a RAW byte buffer instance over the given slices (up to \a nslices). * @@ -77,6 +79,8 @@ 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 adb64e78316..e06e19558a1 100644 --- a/include/grpc/impl/codegen/byte_buffer_reader.h +++ b/include/grpc/impl/codegen/byte_buffer_reader.h @@ -19,7 +19,9 @@ #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; @@ -33,6 +35,8 @@ 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 ad19ea6b31f..4419e2a4479 100644 --- a/include/grpc/impl/codegen/compression_types.h +++ b/include/grpc/impl/codegen/compression_types.h @@ -21,7 +21,9 @@ #include - +#ifdef __cplusplus +extern "C" { +#endif /** To be used as initial metadata key for the request of a concrete compression * algorithm */ @@ -155,6 +157,8 @@ 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 713652de24f..b70dbef3564 100644 --- a/include/grpc/impl/codegen/connectivity_state.h +++ b/include/grpc/impl/codegen/connectivity_state.h @@ -19,7 +19,9 @@ #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 { @@ -35,6 +37,8 @@ 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 153d4ec7db0..d7bb54527ec 100644 --- a/include/grpc/impl/codegen/gpr_types.h +++ b/include/grpc/impl/codegen/gpr_types.h @@ -23,7 +23,9 @@ #include - +#ifdef __cplusplus +extern "C" { +#endif /** The clocks we support. */ typedef enum { @@ -50,6 +52,8 @@ 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 faa21a4e409..03be610d255 100644 --- a/include/grpc/impl/codegen/grpc_types.h +++ b/include/grpc/impl/codegen/grpc_types.h @@ -29,7 +29,9 @@ #include - +#ifdef __cplusplus +extern "C" { +#endif typedef enum { GRPC_BB_RAW @@ -626,6 +628,8 @@ 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 4eac3806fcd..824bdbd8c9b 100644 --- a/include/grpc/impl/codegen/propagation_bits.h +++ b/include/grpc/impl/codegen/propagation_bits.h @@ -21,7 +21,9 @@ #include - +#ifdef __cplusplus +extern "C" { +#endif /** Propagation bits: this can be bitwise or-ed to form propagation_mask for * grpc_call */ @@ -43,6 +45,8 @@ 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 4f1bce3a921..9bc3dc95609 100644 --- a/include/grpc/impl/codegen/status.h +++ b/include/grpc/impl/codegen/status.h @@ -19,7 +19,9 @@ #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 */ @@ -144,6 +146,8 @@ 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 b9cd7204c00..6cdb0c5153d 100644 --- a/include/grpc/impl/codegen/sync.h +++ b/include/grpc/impl/codegen/sync.h @@ -37,7 +37,9 @@ provides no memory barriers. */ - +#ifdef __cplusplus +extern "C" { +#endif /* Platform-specific type declarations of gpr_mu and gpr_cv. */ #include @@ -53,6 +55,8 @@ #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 23ae315a895..55f50ea85e9 100644 --- a/include/grpc/load_reporting.h +++ b/include/grpc/load_reporting.h @@ -21,7 +21,9 @@ #include - +#ifdef __cplusplus +extern "C" { +#endif /** Metadata key for the gRPC LB load balancer token. * @@ -39,6 +41,8 @@ * 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 dd188d68495..10b6a624b32 100644 --- a/include/grpc/slice.h +++ b/include/grpc/slice.h @@ -22,7 +22,9 @@ #include #include - +#ifdef __cplusplus +extern "C" { +#endif /** Increment the refcount of s. Requires slice is initialized. Returns s. */ @@ -161,6 +163,8 @@ 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 4ba9f600a50..6510c151b3c 100644 --- a/include/grpc/slice_buffer.h +++ b/include/grpc/slice_buffer.h @@ -21,7 +21,9 @@ #include - +#ifdef __cplusplus +extern "C" { +#endif /** initialize a slice buffer */ GPRAPI void grpc_slice_buffer_init(grpc_slice_buffer* sb); @@ -74,6 +76,8 @@ 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 d9398a29026..31cb2256385 100644 --- a/include/grpc/support/alloc.h +++ b/include/grpc/support/alloc.h @@ -23,7 +23,9 @@ #include - +#ifdef __cplusplus +extern "C" { +#endif typedef struct gpr_allocation_functions { void* (*malloc_fn)(size_t size); @@ -58,6 +60,8 @@ 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 d43196f99bc..b5a8c0ffa1c 100644 --- a/include/grpc/support/avl.h +++ b/include/grpc/support/avl.h @@ -21,7 +21,9 @@ #include - +#ifdef __cplusplus +extern "C" { +#endif /** internal node of an AVL tree */ typedef struct gpr_avl_node { @@ -93,6 +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/include/grpc/support/cmdline.h b/include/grpc/support/cmdline.h index e242eb592ba..c34a109fbd9 100644 --- a/include/grpc/support/cmdline.h +++ b/include/grpc/support/cmdline.h @@ -21,7 +21,9 @@ #include - +#ifdef __cplusplus +extern "C" { +#endif /** Simple command line parser. @@ -79,6 +81,8 @@ 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 dbc7c92993d..f0e898e8596 100644 --- a/include/grpc/support/cpu.h +++ b/include/grpc/support/cpu.h @@ -21,7 +21,9 @@ #include - +#ifdef __cplusplus +extern "C" { +#endif /** Interface providing CPU information for currently running system */ @@ -35,6 +37,8 @@ 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 cc08cfa6884..d2794d847e8 100644 --- a/include/grpc/support/histogram.h +++ b/include/grpc/support/histogram.h @@ -22,7 +22,9 @@ #include #include - +#ifdef __cplusplus +extern "C" { +#endif typedef struct gpr_histogram gpr_histogram; @@ -55,6 +57,8 @@ 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 7880b642b55..9805811bfb6 100644 --- a/include/grpc/support/host_port.h +++ b/include/grpc/support/host_port.h @@ -21,7 +21,9 @@ #include - +#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 @@ -42,6 +44,8 @@ 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 af8e6231306..497cca90815 100644 --- a/include/grpc/support/log.h +++ b/include/grpc/support/log.h @@ -25,7 +25,9 @@ #include - +#ifdef __cplusplus +extern "C" { +#endif /** GPR log API. @@ -94,6 +96,8 @@ 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 93d4fc73c4e..e833f9d9dfd 100644 --- a/include/grpc/support/log_windows.h +++ b/include/grpc/support/log_windows.h @@ -21,7 +21,9 @@ #include - +#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. @@ -29,6 +31,8 @@ */ 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 5c5b60d67e5..2c7460fa157 100644 --- a/include/grpc/support/string_util.h +++ b/include/grpc/support/string_util.h @@ -21,7 +21,9 @@ #include - +#ifdef __cplusplus +extern "C" { +#endif /** String utility functions */ @@ -40,6 +42,8 @@ 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 a050c1ba827..175f7b50eba 100644 --- a/include/grpc/support/subprocess.h +++ b/include/grpc/support/subprocess.h @@ -21,7 +21,9 @@ #include - +#ifdef __cplusplus +extern "C" { +#endif typedef struct gpr_subprocess gpr_subprocess; @@ -35,6 +37,8 @@ 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 2953e24944f..75192673a6f 100644 --- a/include/grpc/support/sync.h +++ b/include/grpc/support/sync.h @@ -22,7 +22,9 @@ #include /* for gpr_timespec */ #include - +#ifdef __cplusplus +extern "C" { +#endif /** --- Mutex interface --- @@ -271,6 +273,9 @@ GPRAPI intptr_t gpr_stats_read(const gpr_stats_counter* c); } #endif /* 0 */ +#ifdef __cplusplus +} // extern "C" + namespace grpc_core { class mu_guard { @@ -286,5 +291,6 @@ 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 6d398931be5..225d9d6c755 100644 --- a/include/grpc/support/thd.h +++ b/include/grpc/support/thd.h @@ -29,7 +29,9 @@ #include - +#ifdef __cplusplus +extern "C" { +#endif typedef uintptr_t gpr_thd_id; @@ -67,6 +69,8 @@ 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 1ed5ee6ae40..62d354aafe8 100644 --- a/include/grpc/support/time.h +++ b/include/grpc/support/time.h @@ -24,7 +24,9 @@ #include #include - +#ifdef __cplusplus +extern "C" { +#endif /** Time constants. */ GPRAPI gpr_timespec @@ -81,6 +83,8 @@ 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 5a6ff129e8d..fb0edd8e744 100644 --- a/include/grpc/support/tls_pthread.h +++ b/include/grpc/support/tls_pthread.h @@ -34,8 +34,12 @@ 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 */