From 073ca69d64a3a77f1b376153a79abf882c9719c7 Mon Sep 17 00:00:00 2001 From: Chia-I Wu Date: Wed, 11 Feb 2015 13:23:57 -0700 Subject: icd: add U_ASSERT_ONLY It can be applied to variables that are only used in assert(). --- icd/common/icd-utils.h | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/icd/common/icd-utils.h b/icd/common/icd-utils.h index 76d8fa9c..c8eedea8 100644 --- a/icd/common/icd-utils.h +++ b/icd/common/icd-utils.h @@ -34,6 +34,12 @@ #include /* for ffs() */ #include "icd.h" +#if defined(NDEBUG) && defined(__GNUC__) +#define U_ASSERT_ONLY __attribute__((unused)) +#else +#define U_ASSERT_ONLY +#endif + #define ARRAY_SIZE(a) (sizeof(a) / sizeof(a[0])) #define u_popcount(u) __builtin_popcount(u) -- cgit v1.2.3