From e850f3caad7db8cb353a42479c3e03704e8dc1e8 Mon Sep 17 00:00:00 2001 From: "Nicolas \"Pixel\" Noble" Date: Thu, 4 Jun 2015 01:40:14 +0200 Subject: [PATCH] Adding GRPC_MUST_USE_RESULT --- include/grpc/support/port_platform.h | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/include/grpc/support/port_platform.h b/include/grpc/support/port_platform.h index a695acf2056..077eeb1c07a 100644 --- a/include/grpc/support/port_platform.h +++ b/include/grpc/support/port_platform.h @@ -266,4 +266,12 @@ typedef uintptr_t gpr_uintptr; power of two */ #define GPR_MAX_ALIGNMENT 16 +#ifndef GRPC_MUST_USE_RESULT +#ifdef __GNUC__ +#define GRPC_MUST_USE_RESULT __attribute__ ((warn_unused_result)) +#else +#define GRPC_MUST_USE_RESULT +#endif +#endif + #endif /* GRPC_SUPPORT_PORT_PLATFORM_H */