From 35d53846b11880eea7976ade6845bc8a46ac497c Mon Sep 17 00:00:00 2001 From: Daniel Verkamp Date: Fri, 25 Mar 2016 16:35:23 -0700 Subject: [PATCH] Remove static_assert fallback for old compilers This does not work reliably, since the line number is not unique when multiple headers that use the assert macro are included. The automated test systems will catch any issues that would theoretically be missed by contributors compiling with old pre-static_assert compilers. Change-Id: I0ded2eeb61d20a28065358cf568a329749283155 Signed-off-by: Daniel Verkamp --- include/spdk/assert.h | 9 +-------- 1 file changed, 1 insertion(+), 8 deletions(-) diff --git a/include/spdk/assert.h b/include/spdk/assert.h index 80b65b0d0..b626879d6 100644 --- a/include/spdk/assert.h +++ b/include/spdk/assert.h @@ -46,14 +46,7 @@ extern "C" { #ifdef static_assert #define SPDK_STATIC_ASSERT(cond, msg) static_assert(cond, msg) #else -/* - * Fallback for older compilers that don't support static_assert - * - * The array size will expand to 0 if the condition is true, or - * -1 if the condition is false (causing compilation to fail). - */ -#define SPDK_STATIC_ASSERT(cond, msg) \ - typedef char SPDK_CONCAT(SPDK_STATIC_ASSERT_, __LINE__)[!!(cond) - 1] +#define SPDK_STATIC_ASSERT(cond, msg) #endif #ifdef __cplusplus