icd: add U_ASSERT_ONLY
It can be applied to variables that are only used in assert().
diff --git a/icd/common/icd-utils.h b/icd/common/icd-utils.h
index 76d8fa9..c8eedea 100644
--- a/icd/common/icd-utils.h
+++ b/icd/common/icd-utils.h
@@ -34,6 +34,12 @@
#include <strings.h> /* 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)