]> git.ipfire.org Git - thirdparty/hostap.git/commitdiff
Define __maybe_unused
authorJouni Malinen <j@w1.fi>
Sun, 29 Dec 2013 11:37:17 +0000 (13:37 +0200)
committerJouni Malinen <j@w1.fi>
Sun, 29 Dec 2013 11:38:27 +0000 (13:38 +0200)
This can be used to silence compiler warnings in cases where #ifdef
blocks can leave some variables or functions unused and there is no
cleaner way of avoiding the warnings.

Signed-hostap: Jouni Malinen <j@w1.fi>

src/utils/common.h

index 7997deb8f49b064a710097e8bb764415d9b2e60e..a85cc159df63573b47fb08ef1c75c1b8f9ae061b 100644 (file)
@@ -459,6 +459,14 @@ typedef u64 __bitwise le64;
 #endif /* __GNUC__ */
 #endif /* __must_check */
 
+#ifndef __maybe_unused
+#if __GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 4)
+#define __maybe_unused __attribute__((unused))
+#else
+#define __maybe_unused
+#endif /* __GNUC__ */
+#endif /* __must_check */
+
 int hwaddr_aton(const char *txt, u8 *addr);
 int hwaddr_compact_aton(const char *txt, u8 *addr);
 int hwaddr_aton2(const char *txt, u8 *addr);