From adbfbd5977104987bee9f946f691683b756305e8 Mon Sep 17 00:00:00 2001 From: ncteisen Date: Thu, 16 Nov 2017 15:35:45 -0800 Subject: Remove all extern C --- include/grpc++/impl/codegen/core_codegen_interface.h | 4 ---- 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 ++------ 36 files changed, 69 insertions(+), 215 deletions(-) (limited to 'include') diff --git a/include/grpc++/impl/codegen/core_codegen_interface.h b/include/grpc++/impl/codegen/core_codegen_interface.h index 1949cdab76..d7ad7a4b57 100644 --- a/include/grpc++/impl/codegen/core_codegen_interface.h +++ b/include/grpc++/impl/codegen/core_codegen_interface.h @@ -25,10 +25,6 @@ #include #include -extern "C" { -struct grpc_byte_buffer; -} - namespace grpc { /// Interface between the codegen library and the minimal subset of core diff --git a/include/grpc/census.h b/include/grpc/census.h index 2258af8898..d7f2fab50b 100644 --- a/include/grpc/census.h +++ b/include/grpc/census.h @@ -21,9 +21,7 @@ #include -#ifdef __cplusplus -extern "C" { -#endif + /** A Census Context is a handle used by Census to represent the current tracing @@ -31,8 +29,6 @@ extern "C" { (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 b42f428d7d..c0db8c2bfa 100644 --- a/include/grpc/compression.h +++ b/include/grpc/compression.h @@ -26,9 +26,7 @@ #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. */ @@ -85,8 +83,6 @@ 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 f083bc591e..6d6d56a7b3 100644 --- a/include/grpc/grpc.h +++ b/include/grpc/grpc.h @@ -29,9 +29,7 @@ #include #include -#ifdef __cplusplus -extern "C" { -#endif + /*! \mainpage GRPC Core * @@ -466,8 +464,6 @@ 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 127d5d038d..b3e7ec2705 100644 --- a/include/grpc/grpc_cronet.h +++ b/include/grpc/grpc_cronet.h @@ -21,16 +21,12 @@ #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 fa7ebced3f..f14cbaa81b 100644 --- a/include/grpc/grpc_posix.h +++ b/include/grpc/grpc_posix.h @@ -24,9 +24,7 @@ #include -#ifdef __cplusplus -extern "C" { -#endif + /*! \mainpage GRPC Core POSIX * @@ -59,8 +57,6 @@ 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 7e87217de7..f2a05074c2 100644 --- a/include/grpc/grpc_security.h +++ b/include/grpc/grpc_security.h @@ -23,9 +23,7 @@ #include #include -#ifdef __cplusplus -extern "C" { -#endif + /** --- Authentication Context. --- */ @@ -461,8 +459,6 @@ 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 60e167eb88..1923525ea0 100644 --- a/include/grpc/grpc_security_constants.h +++ b/include/grpc/grpc_security_constants.h @@ -19,9 +19,7 @@ #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" @@ -99,8 +97,6 @@ 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 00d83f0604..7bb41c55d2 100644 --- a/include/grpc/impl/codegen/atm.h +++ b/include/grpc/impl/codegen/atm.h @@ -79,17 +79,13 @@ #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 5879708548..52eebb3c72 100644 --- a/include/grpc/impl/codegen/atm_gcc_atomic.h +++ b/include/grpc/impl/codegen/atm_gcc_atomic.h @@ -23,9 +23,7 @@ __atomic_* interface. */ #include -#ifdef __cplusplus -extern "C" { -#endif + typedef intptr_t gpr_atm; #define GPR_ATM_MAX INTPTR_MAX @@ -84,8 +82,6 @@ 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 f8dfbd1d7d..082fb9b36f 100644 --- a/include/grpc/impl/codegen/byte_buffer.h +++ b/include/grpc/impl/codegen/byte_buffer.h @@ -21,9 +21,7 @@ #include -#ifdef __cplusplus -extern "C" { -#endif + /** Returns a RAW byte buffer instance over the given slices (up to \a nslices). * @@ -79,8 +77,6 @@ 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 e06e19558a..adb64e7831 100644 --- a/include/grpc/impl/codegen/byte_buffer_reader.h +++ b/include/grpc/impl/codegen/byte_buffer_reader.h @@ -19,9 +19,7 @@ #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; @@ -35,8 +33,6 @@ 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 4419e2a447..ad19ea6b31 100644 --- a/include/grpc/impl/codegen/compression_types.h +++ b/include/grpc/impl/codegen/compression_types.h @@ -21,9 +21,7 @@ #include -#ifdef __cplusplus -extern "C" { -#endif + /** To be used as initial metadata key for the request of a concrete compression * algorithm */ @@ -157,8 +155,6 @@ 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 b70dbef356..713652de24 100644 --- a/include/grpc/impl/codegen/connectivity_state.h +++ b/include/grpc/impl/codegen/connectivity_state.h @@ -19,9 +19,7 @@ #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 { @@ -37,8 +35,6 @@ 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 d7bb54527e..153d4ec7db 100644 --- a/include/grpc/impl/codegen/gpr_types.h +++ b/include/grpc/impl/codegen/gpr_types.h @@ -23,9 +23,7 @@ #include -#ifdef __cplusplus -extern "C" { -#endif + /** The clocks we support. */ typedef enum { @@ -52,8 +50,6 @@ 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 03be610d25..faa21a4e40 100644 --- a/include/grpc/impl/codegen/grpc_types.h +++ b/include/grpc/impl/codegen/grpc_types.h @@ -29,9 +29,7 @@ #include -#ifdef __cplusplus -extern "C" { -#endif + typedef enum { GRPC_BB_RAW @@ -628,8 +626,6 @@ 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 824bdbd8c9..4eac3806fc 100644 --- a/include/grpc/impl/codegen/propagation_bits.h +++ b/include/grpc/impl/codegen/propagation_bits.h @@ -21,9 +21,7 @@ #include -#ifdef __cplusplus -extern "C" { -#endif + /** Propagation bits: this can be bitwise or-ed to form propagation_mask for * grpc_call */ @@ -45,8 +43,6 @@ extern "C" { 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 9bc3dc9560..4f1bce3a92 100644 --- a/include/grpc/impl/codegen/status.h +++ b/include/grpc/impl/codegen/status.h @@ -19,9 +19,7 @@ #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 */ @@ -146,8 +144,6 @@ 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 6cdb0c5153..b9cd7204c0 100644 --- a/include/grpc/impl/codegen/sync.h +++ b/include/grpc/impl/codegen/sync.h @@ -37,9 +37,7 @@ provides no memory barriers. */ -#ifdef __cplusplus -extern "C" { -#endif + /* Platform-specific type declarations of gpr_mu and gpr_cv. */ #include @@ -55,8 +53,6 @@ extern "C" { #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 55f50ea85e..23ae315a89 100644 --- a/include/grpc/load_reporting.h +++ b/include/grpc/load_reporting.h @@ -21,9 +21,7 @@ #include -#ifdef __cplusplus -extern "C" { -#endif + /** Metadata key for the gRPC LB load balancer token. * @@ -41,8 +39,6 @@ extern "C" { * 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 10b6a624b3..dd188d6849 100644 --- a/include/grpc/slice.h +++ b/include/grpc/slice.h @@ -22,9 +22,7 @@ #include #include -#ifdef __cplusplus -extern "C" { -#endif + /** Increment the refcount of s. Requires slice is initialized. Returns s. */ @@ -163,8 +161,6 @@ 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 6510c151b3..4ba9f600a5 100644 --- a/include/grpc/slice_buffer.h +++ b/include/grpc/slice_buffer.h @@ -21,9 +21,7 @@ #include -#ifdef __cplusplus -extern "C" { -#endif + /** initialize a slice buffer */ GPRAPI void grpc_slice_buffer_init(grpc_slice_buffer* sb); @@ -76,8 +74,6 @@ 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 31cb225638..d9398a2902 100644 --- a/include/grpc/support/alloc.h +++ b/include/grpc/support/alloc.h @@ -23,9 +23,7 @@ #include -#ifdef __cplusplus -extern "C" { -#endif + typedef struct gpr_allocation_functions { void* (*malloc_fn)(size_t size); @@ -60,8 +58,6 @@ 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 b5a8c0ffa1..d43196f99b 100644 --- a/include/grpc/support/avl.h +++ b/include/grpc/support/avl.h @@ -21,9 +21,7 @@ #include -#ifdef __cplusplus -extern "C" { -#endif + /** internal node of an AVL tree */ typedef struct gpr_avl_node { @@ -95,8 +93,6 @@ 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 c34a109fbd..e242eb592b 100644 --- a/include/grpc/support/cmdline.h +++ b/include/grpc/support/cmdline.h @@ -21,9 +21,7 @@ #include -#ifdef __cplusplus -extern "C" { -#endif + /** Simple command line parser. @@ -81,8 +79,6 @@ 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 f0e898e859..dbc7c92993 100644 --- a/include/grpc/support/cpu.h +++ b/include/grpc/support/cpu.h @@ -21,9 +21,7 @@ #include -#ifdef __cplusplus -extern "C" { -#endif + /** Interface providing CPU information for currently running system */ @@ -37,8 +35,6 @@ 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 d2794d847e..cc08cfa688 100644 --- a/include/grpc/support/histogram.h +++ b/include/grpc/support/histogram.h @@ -22,9 +22,7 @@ #include #include -#ifdef __cplusplus -extern "C" { -#endif + typedef struct gpr_histogram gpr_histogram; @@ -57,8 +55,6 @@ 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 9805811bfb..7880b642b5 100644 --- a/include/grpc/support/host_port.h +++ b/include/grpc/support/host_port.h @@ -21,9 +21,7 @@ #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 @@ -44,8 +42,6 @@ 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 497cca9081..af8e623130 100644 --- a/include/grpc/support/log.h +++ b/include/grpc/support/log.h @@ -25,9 +25,7 @@ #include -#ifdef __cplusplus -extern "C" { -#endif + /** GPR log API. @@ -96,8 +94,6 @@ 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 e833f9d9df..93d4fc73c4 100644 --- a/include/grpc/support/log_windows.h +++ b/include/grpc/support/log_windows.h @@ -21,9 +21,7 @@ #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. @@ -31,8 +29,6 @@ extern "C" { */ 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 2c7460fa15..5c5b60d67e 100644 --- a/include/grpc/support/string_util.h +++ b/include/grpc/support/string_util.h @@ -21,9 +21,7 @@ #include -#ifdef __cplusplus -extern "C" { -#endif + /** String utility functions */ @@ -42,8 +40,6 @@ 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 175f7b50eb..a050c1ba82 100644 --- a/include/grpc/support/subprocess.h +++ b/include/grpc/support/subprocess.h @@ -21,9 +21,7 @@ #include -#ifdef __cplusplus -extern "C" { -#endif + typedef struct gpr_subprocess gpr_subprocess; @@ -37,8 +35,6 @@ 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 75192673a6..2953e24944 100644 --- a/include/grpc/support/sync.h +++ b/include/grpc/support/sync.h @@ -22,9 +22,7 @@ #include /* for gpr_timespec */ #include -#ifdef __cplusplus -extern "C" { -#endif + /** --- Mutex interface --- @@ -273,9 +271,6 @@ GPRAPI intptr_t gpr_stats_read(const gpr_stats_counter* c); } #endif /* 0 */ -#ifdef __cplusplus -} // extern "C" - namespace grpc_core { class mu_guard { @@ -291,6 +286,5 @@ 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 225d9d6c75..6d398931be 100644 --- a/include/grpc/support/thd.h +++ b/include/grpc/support/thd.h @@ -29,9 +29,7 @@ #include -#ifdef __cplusplus -extern "C" { -#endif + typedef uintptr_t gpr_thd_id; @@ -69,8 +67,6 @@ 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 62d354aafe..1ed5ee6ae4 100644 --- a/include/grpc/support/time.h +++ b/include/grpc/support/time.h @@ -24,9 +24,7 @@ #include #include -#ifdef __cplusplus -extern "C" { -#endif + /** Time constants. */ GPRAPI gpr_timespec @@ -83,8 +81,6 @@ 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 fb0edd8e74..5a6ff129e8 100644 --- a/include/grpc/support/tls_pthread.h +++ b/include/grpc/support/tls_pthread.h @@ -34,12 +34,8 @@ 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 */ -- cgit v1.2.3 From 01a7547a3f409e004b9f6df4314c1f42e53a9448 Mon Sep 17 00:00:00 2001 From: ncteisen Date: Thu, 16 Nov 2017 16:04:42 -0800 Subject: 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(-) (limited to 'include') diff --git a/include/grpc/census.h b/include/grpc/census.h index d7f2fab50b..2258af8898 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 c0db8c2bfa..b42f428d7d 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 6d6d56a7b3..f083bc591e 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 b3e7ec2705..127d5d038d 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 f14cbaa81b..fa7ebced3f 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 f2a05074c2..7e87217de7 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 1923525ea0..60e167eb88 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 7bb41c55d2..00d83f0604 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 52eebb3c72..5879708548 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 082fb9b36f..f8dfbd1d7d 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 adb64e7831..e06e19558a 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 ad19ea6b31..4419e2a447 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 713652de24..b70dbef356 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 153d4ec7db..d7bb54527e 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 faa21a4e40..03be610d25 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 4eac3806fc..824bdbd8c9 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 4f1bce3a92..9bc3dc9560 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 b9cd7204c0..6cdb0c5153 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 23ae315a89..55f50ea85e 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 dd188d6849..10b6a624b3 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 4ba9f600a5..6510c151b3 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 d9398a2902..31cb225638 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 d43196f99b..b5a8c0ffa1 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 e242eb592b..c34a109fbd 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 dbc7c92993..f0e898e859 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 cc08cfa688..d2794d847e 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 7880b642b5..9805811bfb 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 af8e623130..497cca9081 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 93d4fc73c4..e833f9d9df 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 5c5b60d67e..2c7460fa15 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 a050c1ba82..175f7b50eb 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 2953e24944..75192673a6 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 6d398931be..225d9d6c75 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 1ed5ee6ae4..62d354aafe 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 5a6ff129e8..fb0edd8e74 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 */ -- cgit v1.2.3