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

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

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

@ -34,8 +34,8 @@
#ifndef GRPC_GRPC_SECURITY_H #ifndef GRPC_GRPC_SECURITY_H
#define GRPC_GRPC_SECURITY_H #define GRPC_GRPC_SECURITY_H
#include "grpc.h" #include <grpc/grpc.h>
#include "status.h" #include <grpc/status.h>
#ifdef __cplusplus #ifdef __cplusplus
extern "C" { 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_init(tls) GPR_ASSERT(0 == pthread_key_create(&(tls)->key, NULL))
#define gpr_tls_destroy(tls) pthread_key_delete((tls)->key) #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); 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)) #define gpr_tls_get(tls) ((gpr_intptr)pthread_getspecific((tls)->key))

Loading…
Cancel
Save