aboutsummaryrefslogtreecommitdiffhomepage
path: root/include
diff options
context:
space:
mode:
authorGravatar David Garcia Quintas <dgq@google.com>2016-03-08 00:07:14 -0800
committerGravatar David Garcia Quintas <dgq@google.com>2016-03-08 00:07:14 -0800
commit8c3d9943f6061c9c2370ab7e165cb9219adc7a02 (patch)
tree4b67618dc52a7805f020d30399cc5cfd85e430b1 /include
parente1ce31eda3321bb0052416ba47145809a8199f1e (diff)
compiles!
Diffstat (limited to 'include')
-rw-r--r--include/grpc++/impl/codegen/core_codegen_interface.h15
-rw-r--r--include/grpc++/impl/codegen/string_ref.h2
-rw-r--r--include/grpc++/impl/grpc_library.h8
3 files changed, 17 insertions, 8 deletions
diff --git a/include/grpc++/impl/codegen/core_codegen_interface.h b/include/grpc++/impl/codegen/core_codegen_interface.h
index f043f96072..a27c1f8057 100644
--- a/include/grpc++/impl/codegen/core_codegen_interface.h
+++ b/include/grpc++/impl/codegen/core_codegen_interface.h
@@ -41,6 +41,10 @@
namespace grpc {
+class CoreCodegenInterface;
+
+extern CoreCodegenInterface* g_core_codegen_interface;
+
class CoreCodegenInterface {
public:
virtual grpc_completion_queue* grpc_completion_queue_create(
@@ -74,12 +78,11 @@ class CoreCodegenInterface {
};
/* XXX */
-#define GPR_CODEGEN_ASSERT(x) \
- do { \
- if (!(x)) { \
- extern CoreCodegenInterface* g_core_codegen_interface; \
- g_core_codegen_interface->assert_fail(#x); \
- } \
+#define GPR_CODEGEN_ASSERT(x) \
+ do { \
+ if (!(x)) { \
+ grpc::g_core_codegen_interface->assert_fail(#x); \
+ } \
} while (0)
} // namespace grpc
diff --git a/include/grpc++/impl/codegen/string_ref.h b/include/grpc++/impl/codegen/string_ref.h
index 29d85d92dc..4af2000ffd 100644
--- a/include/grpc++/impl/codegen/string_ref.h
+++ b/include/grpc++/impl/codegen/string_ref.h
@@ -60,7 +60,7 @@ class string_ref {
typedef std::reverse_iterator<const_iterator> const_reverse_iterator;
// constants
- const static size_t npos = size_t(-1);
+ const static size_t npos;
// construct/copy.
string_ref() : data_(nullptr), length_(0) {}
diff --git a/include/grpc++/impl/grpc_library.h b/include/grpc++/impl/grpc_library.h
index e8a075f5eb..207053e63b 100644
--- a/include/grpc++/impl/grpc_library.h
+++ b/include/grpc++/impl/grpc_library.h
@@ -40,6 +40,8 @@
#include <grpc++/impl/codegen/grpc_library.h>
#include <grpc/grpc.h>
+#include "src/cpp/codegen/core_codegen.h"
+
namespace grpc {
namespace internal {
@@ -51,10 +53,14 @@ class GrpcLibrary GRPC_FINAL : public GrpcLibraryInterface {
};
static GrpcLibrary g_gli;
+static CoreCodegen g_core_codegen;
class GrpcLibraryInitializer GRPC_FINAL {
public:
- GrpcLibraryInitializer() { grpc::g_glip = &g_gli; }
+ GrpcLibraryInitializer() {
+ grpc::g_glip = &g_gli;
+ grpc::g_core_codegen_interface = &g_core_codegen;
+ }
/// A no-op method to force the linker to reference this class, which will
/// take care of initializing and shutting down the gRPC runtime.