Adding cplusplus ifdefs for C linkage in header files

reviewable/pr12692/r4
Yash Tibrewal 7 years ago
parent f4f8dd768c
commit ac0c2d9036
  1. 8
      src/core/lib/support/arena.h
  2. 8
      src/core/lib/support/backoff.h
  3. 8
      src/core/lib/support/mpscq.h
  4. 8
      src/core/lib/support/murmur_hash.h
  5. 8
      src/core/lib/support/stack_lockfree.h
  6. 8
      src/core/lib/support/string_windows.h
  7. 8
      src/core/lib/support/time_precise.h

@ -27,6 +27,10 @@
#include <stddef.h>
#ifdef __cplusplus
extern "C" {
#endif
typedef struct gpr_arena gpr_arena;
// Create an arena, with \a initial_size bytes in the first allocated buffer
@ -36,4 +40,8 @@ void *gpr_arena_alloc(gpr_arena *arena, size_t size);
// Destroy an arena, returning the total number of bytes allocated
size_t gpr_arena_destroy(gpr_arena *arena);
#ifdef __cplusplus
}
#endif
#endif /* GRPC_CORE_LIB_SUPPORT_ARENA_H */

@ -21,6 +21,10 @@
#include <grpc/support/time.h>
#ifdef __cplusplus
extern "C" {
#endif
typedef struct {
/// const: how long to wait after the first failure before retrying
int64_t initial_connect_timeout;
@ -53,4 +57,8 @@ gpr_timespec gpr_backoff_step(gpr_backoff *backoff, gpr_timespec now);
/// instead
void gpr_backoff_reset(gpr_backoff *backoff);
#ifdef __cplusplus
}
#endif
#endif /* GRPC_CORE_LIB_SUPPORT_BACKOFF_H */

@ -23,6 +23,10 @@
#include <stdbool.h>
#include <stddef.h>
#ifdef __cplusplus
extern "C" {
#endif
// Multiple-producer single-consumer lock free queue, based upon the
// implementation from Dmitry Vyukov here:
// http://www.1024cores.net/home/lock-free-algorithms/queues/intrusive-mpsc-node-based-queue
@ -50,4 +54,8 @@ gpr_mpscq_node *gpr_mpscq_pop(gpr_mpscq *q);
// Pop a node; sets *empty to true if the queue is empty, or false if it is not
gpr_mpscq_node *gpr_mpscq_pop_and_check_end(gpr_mpscq *q, bool *empty);
#ifdef __cplusplus
}
#endif
#endif /* GRPC_CORE_LIB_SUPPORT_MPSCQ_H */

@ -23,7 +23,15 @@
#include <stddef.h>
#ifdef __cplusplus
extern "C" {
#endif
/* compute the hash of key (length len) */
uint32_t gpr_murmur_hash3(const void *key, size_t len, uint32_t seed);
#ifdef __cplusplus
}
#endif
#endif /* GRPC_CORE_LIB_SUPPORT_MURMUR_HASH_H */

@ -21,6 +21,10 @@
#include <stddef.h>
#ifdef __cplusplus
extern "C" {
#endif
typedef struct gpr_stack_lockfree gpr_stack_lockfree;
/* This stack must specify the maximum number of entries to track.
@ -35,4 +39,8 @@ int gpr_stack_lockfree_push(gpr_stack_lockfree *, int entry);
/* Returns -1 on empty or the actual entry number */
int gpr_stack_lockfree_pop(gpr_stack_lockfree *stack);
#ifdef __cplusplus
}
#endif
#endif /* GRPC_CORE_LIB_SUPPORT_STACK_LOCKFREE_H */

@ -21,6 +21,10 @@
#include <grpc/support/port_platform.h>
#ifdef __cplusplus
extern "C" {
#endif
#ifdef GPR_WINDOWS
/* These allocate new strings using gpr_malloc to convert from and to utf-8. */
@ -29,4 +33,8 @@ LPSTR gpr_tchar_to_char(LPCTSTR input);
#endif /* GPR_WINDOWS */
#ifdef __cplusplus
}
#endif
#endif /* GRPC_CORE_LIB_SUPPORT_STRING_WINDOWS_H */

@ -21,7 +21,15 @@
#include <grpc/support/time.h>
#ifdef __cplusplus
extern "C" {
#endif
void gpr_precise_clock_init(void);
void gpr_precise_clock_now(gpr_timespec *clk);
#ifdef __cplusplus
}
#endif
#endif /* GRPC_CORE_LIB_SUPPORT_TIME_PRECISE_H */

Loading…
Cancel
Save