Commit 35d53846 authored by Daniel Verkamp's avatar Daniel Verkamp
Browse files

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: default avatarDaniel Verkamp <daniel.verkamp@intel.com>
parent 24119894
Loading
Loading
Loading
Loading
+1 −8
Original line number Diff line number Diff line
@@ -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