From 632c2d8ebf7011ef8876f9c938ad8a296c148b57 Mon Sep 17 00:00:00 2001 From: Nuno Lopes <nlopes@microsoft.com> Date: Mon, 14 Aug 2017 20:10:17 +0100 Subject: [PATCH] use static_assert in COMPILE_TIME_ASSERT --- src/util/debug.h | 9 +-------- 1 file changed, 1 insertion(+), 8 deletions(-) diff --git a/src/util/debug.h b/src/util/debug.h index adc9fc6b7..e0ceb9a64 100644 --- a/src/util/debug.h +++ b/src/util/debug.h @@ -90,14 +90,7 @@ bool is_debug_enabled(const char * tag); exit(-1); \ } -#define MAKE_NAME2(LINE) zofty_ ## LINE -#define MAKE_NAME(LINE) MAKE_NAME2(LINE) -#define DBG_UNIQUE_NAME MAKE_NAME(__LINE__) -#ifdef __GNUC__ -#define COMPILE_TIME_ASSERT(expr) extern __attribute__((unused)) char DBG_UNIQUE_NAME[expr] -#else -#define COMPILE_TIME_ASSERT(expr) extern char DBG_UNIQUE_NAME[expr] -#endif +#define COMPILE_TIME_ASSERT(expr) static_assert(expr, "") void finalize_debug(); /*