]> git.ipfire.org Git - thirdparty/dhcpcd.git/commitdiff
Work around silly __unused problem some more on Linux.
authorRoy Marples <roy@marples.name>
Thu, 25 Apr 2013 06:09:38 +0000 (06:09 +0000)
committerRoy Marples <roy@marples.name>
Thu, 25 Apr 2013 06:09:38 +0000 (06:09 +0000)
dhcp.h

diff --git a/dhcp.h b/dhcp.h
index 4dfbb6fc5ed028e71edf4374420c2aac839f4f30..fb4dcd19735496d7e1e94dd388fc6a51c67f4c0c 100644 (file)
--- a/dhcp.h
+++ b/dhcp.h
@@ -34,7 +34,6 @@
 #include <limits.h>
 #include <stdint.h>
 
-#include "common.h"
 #include "dhcp-common.h"
 
 /* UDP port numbers for DHCP */
@@ -134,6 +133,18 @@ enum FQDN {
 /* Some crappy DHCP servers require the BOOTP minimum length */
 #define BOOTP_MESSAGE_LENTH_MIN 300
 
+/* Don't import common.h as that defines __unused which causes problems
+ * on some Linux systems which define it as part of a structure */
+#if __GNUC__ > 2 || defined(__INTEL_COMPILER)
+# ifndef __packed
+#  define __packed   __attribute__((__packed__))
+# endif
+#else
+# ifndef __packed
+#  define __packed
+# endif
+#endif
+
 struct dhcp_message {
        uint8_t op;           /* message type */
        uint8_t hwtype;       /* hardware address type */