diff options
| author | Chia-I Wu <olv@lunarg.com> | 2015-02-11 13:23:57 -0700 |
|---|---|---|
| committer | Chia-I Wu <olv@lunarg.com> | 2015-02-12 13:24:03 -0700 |
| commit | 073ca69d64a3a77f1b376153a79abf882c9719c7 (patch) | |
| tree | 9ed4c1ae8a6e60e451b80b65dd56cec51b803e0c | |
| parent | 5b1d090d02e21e8dded49204a1ecd9a34c115f8f (diff) | |
| download | usermoji-073ca69d64a3a77f1b376153a79abf882c9719c7.tar.xz | |
icd: add U_ASSERT_ONLY
It can be applied to variables that are only used in assert().
| -rw-r--r-- | icd/common/icd-utils.h | 6 |
1 files changed, 6 insertions, 0 deletions
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 <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) |
