aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorJouni Malinen <j@w1.fi>2013-12-29 11:37:17 (GMT)
committerJouni Malinen <j@w1.fi>2013-12-29 11:38:27 (GMT)
commit1450e1e3199bb26fe6944bfb4474755523b0cc88 (patch)
treece59861745bdcadf1779ad311504619c0d6e651a /src
parent912b34f000afaa98a9d4970d76543df075ace563 (diff)
downloadhostap-1450e1e3199bb26fe6944bfb4474755523b0cc88.zip
hostap-1450e1e3199bb26fe6944bfb4474755523b0cc88.tar.gz
hostap-1450e1e3199bb26fe6944bfb4474755523b0cc88.tar.bz2
Define __maybe_unused
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>
Diffstat (limited to 'src')
-rw-r--r--src/utils/common.h8
1 files changed, 8 insertions, 0 deletions
diff --git a/src/utils/common.h b/src/utils/common.h
index 7997deb..a85cc15 100644
--- a/src/utils/common.h
+++ b/src/utils/common.h
@@ -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);