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:
Daniel Verkamp 2016-03-25 16:35:23 -07:00
parent 24119894f4
commit 35d53846b1

View File

@ -46,14 +46,7 @@ extern "C" {
#ifdef static_assert #ifdef static_assert
#define SPDK_STATIC_ASSERT(cond, msg) static_assert(cond, msg) #define SPDK_STATIC_ASSERT(cond, msg) static_assert(cond, msg)
#else #else
/* #define SPDK_STATIC_ASSERT(cond, msg)
* 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]
#endif #endif
#ifdef __cplusplus #ifdef __cplusplus