1 From 34b51e26555d05c00b2320f943a645added5dae4 Mon Sep 17 00:00:00 2001
2 From: Helmut Schaa <helmut.schaa@googlemail.com>
3 Date: Mon, 9 Dec 2013 14:15:11 +0100
4 Subject: [PATCH 5/6] lib/util.h: Disable ovs_assert when build with NDEBUG
6 Reduces binary size. Use a static inline function instead of
7 a macro to not get "unused variable" warning everywhere.
9 Signed-off-by: Helmut Schaa <helmut.schaa@googlemail.com>
12 1 file changed, 5 insertions(+)
14 diff --git a/lib/util.h b/lib/util.h
15 index 5c23962..9e5866d 100644
19 * - Writes the failure message to the log.
21 * - Not affected by NDEBUG. */
23 #define ovs_assert(CONDITION) \
24 if (!OVS_LIKELY(CONDITION)) { \
25 ovs_assert_failure(SOURCE_LOCATOR, __func__, #CONDITION); \
28 +static inline void ovs_assert(bool cond OVS_UNUSED) {}
31 void ovs_assert_failure(const char *, const char *, const char *) NO_RETURN;
33 /* Casts 'pointer' to 'type' and issues a compiler warning if the cast changes