From: Roy Marples Date: Thu, 25 Apr 2013 06:09:38 +0000 (+0000) Subject: Work around silly __unused problem some more on Linux. X-Git-Tag: v5.99.6~9 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=42c572707b53d5b349d951d576e0298eec38fad7;p=thirdparty%2Fdhcpcd.git Work around silly __unused problem some more on Linux. --- diff --git a/dhcp.h b/dhcp.h index 4dfbb6fc..fb4dcd19 100644 --- a/dhcp.h +++ b/dhcp.h @@ -34,7 +34,6 @@ #include #include -#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 */