xref: /OK3568_Linux_fs/buildroot/package/daemon/0002-Fix-build-with-NDEBUG-defined.patch (revision 4882a59341e53eb6f0b4789bf948001014eff981)
1From fc84d8d572ffcecb533fd6d6d025abea12ce027e Mon Sep 17 00:00:00 2001
2Message-Id: <fc84d8d572ffcecb533fd6d6d025abea12ce027e.1622722814.git.baruch@tkos.co.il>
3From: Baruch Siach <baruch@tkos.co.il>
4Date: Thu, 3 Jun 2021 15:01:10 +0300
5Subject: [PATCH] Fix build with NDEBUG defined
6
7Build with NDEBUG fails because the debug() macro becomes empty. This
8creates invalid syntax with the debug() call is the only statement in
9the body of a 'for' loop.
10
11This fixes build failures like:
12
13daemon.c: In function 'show':
14daemon.c:3607:2: error: expected expression before '}' token
15  }
16  ^
17
18Signed-off-by: Baruch Siach <baruch@tkos.co.il>
19---
20Upstream status: https://github.com/raforg/daemon/pull/3
21
22 libslack/err.h | 8 ++++----
23 1 file changed, 4 insertions(+), 4 deletions(-)
24
25diff --git a/libslack/err.h b/libslack/err.h
26index 106bdb01e074..7acfbe46d60a 100644
27--- a/libslack/err.h
28+++ b/libslack/err.h
29@@ -40,10 +40,10 @@
30 #undef check
31
32 #ifdef NDEBUG
33-#define debug(args)
34-#define vdebug(args)
35-#define debugsys(args)
36-#define vdebugsys(args)
37+#define debug(args) do {} while (0);
38+#define vdebug(args) do {} while (0);
39+#define debugsys(args) do {} while (0);
40+#define vdebugsys(args) do {} while (0);
41 #define check(cond, mesg) (void_cast(0))
42 #else
43 #define debug(args) debugf args;
44--
452.30.2
46
47