aboutsummaryrefslogtreecommitdiffhomepage
path: root/include
diff options
context:
space:
mode:
authorGravatar Yash Tibrewal <yashkt@google.com>2018-11-05 13:56:06 -0800
committerGravatar Yash Tibrewal <yashkt@google.com>2018-11-05 13:56:06 -0800
commitf240af0cb81be776539b799aec45fdde0e48d68b (patch)
treeda7217acc93f4ddf0952bbe22ce93339528fd930 /include
parent673887d6d2b1c69a771ef157bca6906cf7cb6c4a (diff)
Add GPR_CODEGEN_DEBUG_ASSERT
Diffstat (limited to 'include')
-rw-r--r--include/grpcpp/impl/codegen/core_codegen_interface.h11
1 files changed, 11 insertions, 0 deletions
diff --git a/include/grpcpp/impl/codegen/core_codegen_interface.h b/include/grpcpp/impl/codegen/core_codegen_interface.h
index 25e3abccca..c70afe876d 100644
--- a/include/grpcpp/impl/codegen/core_codegen_interface.h
+++ b/include/grpcpp/impl/codegen/core_codegen_interface.h
@@ -19,6 +19,8 @@
#ifndef GRPCPP_IMPL_CODEGEN_CORE_CODEGEN_INTERFACE_H
#define GRPCPP_IMPL_CODEGEN_CORE_CODEGEN_INTERFACE_H
+#include <cassert>
+
#include <grpc/impl/codegen/byte_buffer_reader.h>
#include <grpc/impl/codegen/grpc_types.h>
#include <grpc/impl/codegen/sync.h>
@@ -145,6 +147,15 @@ extern CoreCodegenInterface* g_core_codegen_interface;
} \
} while (0)
+/// Codegen specific version of \a GPR_DEBUG_ASSERT.
+#ifndef NDEBUG
+#define GPR_CODEGEN_DEBUG_ASSERT(x) GPR_CODEGEN_ASSERT(x)
+#else
+#define GPR_CODEGEN_DEBUG_ASSERT(x) \
+ do { \
+ } while (0)
+#endif
+
} // namespace grpc
#endif // GRPCPP_IMPL_CODEGEN_CORE_CODEGEN_INTERFACE_H