summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRichard Braun <rbraun@sceen.net>2017-08-20 18:22:46 +0200
committerRichard Braun <rbraun@sceen.net>2017-08-20 18:22:46 +0200
commitbe26f4253a84a7fa4ef7bdc7789b085bf9dd3e34 (patch)
tree27c6acb4212ad5d0bd7a2a4a0d0e85b387584871
parentd4a423ff73cfb708a6388feedca2ad789cc9d3db (diff)
macros: redefine assert to avoid warnings when NDEBUG is defined
-rw-r--r--macros.h8
1 files changed, 8 insertions, 0 deletions
diff --git a/macros.h b/macros.h
index 6e3ff1e..dae21ce 100644
--- a/macros.h
+++ b/macros.h
@@ -86,4 +86,12 @@
#define __packed __attribute__((packed))
#endif
+/*
+ * XXX Suppress warnings caused by some implementations of assert().
+ */
+#ifdef NDEBUG
+#undef assert
+#define assert(x) ((void)(x))
+#endif /* NDEBUG */
+
#endif /* _MACROS_H */