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 <daniel.verkamp@intel.com>
This commit is contained in:
parent
24119894f4
commit
35d53846b1
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user