Merge pull request #1994 from nicolasnoble/c++-is-a-true-language-too-and-has-feelings

Properly exporting our C functions to C++.
pull/2000/head
David G. Quintas 10 years ago
commit eb0bf61bd2
  1. 8
      include/grpc/byte_buffer.h
  2. 8
      include/grpc/byte_buffer_reader.h
  3. 8
      include/grpc/census.h
  4. 4
      include/grpc/grpc_security.h
  5. 3
      include/grpc/support/tls_pthread.h

@ -37,6 +37,10 @@
#include <grpc/grpc.h>
#include <grpc/support/slice_buffer.h>
#ifdef __cplusplus
extern "C" {
#endif
typedef enum { GRPC_BB_SLICE_BUFFER } grpc_byte_buffer_type;
/* byte buffers are containers for messages passed in from the public api's */
@ -47,4 +51,8 @@ struct grpc_byte_buffer {
} data;
};
#ifdef __cplusplus
}
#endif
#endif /* GRPC_BYTE_BUFFER_H */

@ -37,6 +37,10 @@
#include <grpc/grpc.h>
#include <grpc/byte_buffer.h>
#ifdef __cplusplus
extern "C" {
#endif
struct grpc_byte_buffer_reader {
grpc_byte_buffer *buffer;
/* Different current objects correspond to different types of byte buffers */
@ -46,4 +50,8 @@ struct grpc_byte_buffer_reader {
} current;
};
#ifdef __cplusplus
}
#endif
#endif /* GRPC_BYTE_BUFFER_READER_H */

@ -40,6 +40,10 @@
#include <grpc/grpc.h>
#ifdef __cplusplus
extern "C" {
#endif
/* Identify census functionality that can be enabled via census_initialize(). */
enum census_functions {
CENSUS_NONE = 0, /* Do not enable census. */
@ -92,4 +96,8 @@ int census_context_deserialize(const char *buffer, census_context **context);
* future census calls will result in undefined behavior. */
void census_context_destroy(census_context *context);
#ifdef __cplusplus
}
#endif
#endif /* CENSUS_CENSUS_H */

@ -34,8 +34,8 @@
#ifndef GRPC_GRPC_SECURITY_H
#define GRPC_GRPC_SECURITY_H
#include "grpc.h"
#include "status.h"
#include <grpc/grpc.h>
#include <grpc/status.h>
#ifdef __cplusplus
extern "C" {

@ -49,6 +49,9 @@ 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)
#ifdef __cplusplus
extern "C"
#endif
gpr_intptr gpr_tls_set(struct gpr_pthread_thread_local *tls, gpr_intptr value);
#define gpr_tls_get(tls) ((gpr_intptr)pthread_getspecific((tls)->key))

Loading…
Cancel
Save