1From 4dd5c2659722b44409cee28b4cea68cdeaa1f987 Mon Sep 17 00:00:00 2001
2From: Khem Raj <raj.khem@gmail.com>
3Date: Mon, 9 May 2016 22:03:57 +0000
4Subject: [PATCH] mdadm.h: Undefine dprintf before redefining
5
6dprintf is also defined in libc see
7usr/include/bits/stdio2.h, this comes into
8play especially when fortify sources is enabled
9and compilers like clang reports the override
10
11In file included from policy.c:25:
12./mdadm.h:1562:9: error: 'dprintf' macro redefined [-Werror,-Wmacro-redefined]
13        ^
14/mnt/oe/openembedded-core/build/tmp-glibc/sysroots/qemux86/usr/include/bits/stdio2.h:145:12: note: previous definition is here
15
16Signed-off-by: Khem Raj <raj.khem@gmail.com>
17Upstream-Status: Pending
18---
19 mdadm.h | 2 ++
20 1 file changed, 2 insertions(+)
21
22diff --git a/mdadm.h b/mdadm.h
23index 1f28b3e..04996e2 100644
24--- a/mdadm.h
25+++ b/mdadm.h
26@@ -1869,11 +1869,13 @@ static inline sighandler_t signal_s(int sig, sighandler_t handler)
27 }
28
29 #ifdef DEBUG
30+#undef dprintf
31 #define dprintf(fmt, arg...) \
32 	fprintf(stderr, "%s: %s: "fmt, Name, __func__, ##arg)
33 #define dprintf_cont(fmt, arg...) \
34 	fprintf(stderr, fmt, ##arg)
35 #else
36+#undef dprintf
37 #define dprintf(fmt, arg...) \
38         ({ if (0) fprintf(stderr, "%s: %s: " fmt, Name, __func__, ##arg); 0; })
39 #define dprintf_cont(fmt, arg...) \
40