summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTobias Klauser <tklauser@distanz.ch>2017-01-06 13:46:34 +0100
committerTobias Klauser <tklauser@distanz.ch>2017-01-06 13:46:34 +0100
commit5fc94b05da91439d9f62e8d1098d463b1f548da4 (patch)
treee16223c482f1a1bc680f7bd5773863b783378619
parent1073ece433c9922fab10edebae7b6f9d0115da8f (diff)
compiler: Avoid redefinitions of __unused and __packed
FreeBSD defines these in sys/cdefs.h Signed-off-by: Tobias Klauser <tklauser@distanz.ch>
-rw-r--r--compiler.h8
1 files changed, 6 insertions, 2 deletions
diff --git a/compiler.h b/compiler.h
index 3559050..4180086 100644
--- a/compiler.h
+++ b/compiler.h
@@ -22,8 +22,12 @@
#ifdef __GNUC__
# define __noreturn __attribute__((noreturn))
# define __warn_unused_result __attribute__((warn_unused_result))
-# define __packed __attribute__((packed))
-# define __unused __attribute__((unused))
+# ifndef __packed
+# define __packed __attribute__((packed))
+# endif
+# ifndef __unused
+# define __unused __attribute__((unused))
+# endif
# ifndef offsetof
# define offsetof(a, b) __builtin_offsetof(a, b)
# endif