From: Roy Marples Date: Wed, 24 Apr 2013 09:31:31 +0000 (+0000) Subject: Change from _unused to __unused to match NetBSD cdefs and avoid X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=refs%2Fheads%2Fdhcpcd-5.6;p=thirdparty%2Fdhcpcd.git Change from _unused to __unused to match NetBSD cdefs and avoid a compiler failure on linux-headers-3.7 --- diff --git a/common.h b/common.h index e11cc511..cc431272 100644 --- a/common.h +++ b/common.h @@ -51,13 +51,25 @@ } while (0 /* CONSTCOND */); #if __GNUC__ > 2 || defined(__INTEL_COMPILER) -# define _noreturn __attribute__((__noreturn__)) -# define _packed __attribute__((__packed__)) -# define _unused __attribute__((__unused__)) +# ifndef __dead +# define __dead __attribute__((__noreturn__)) +# endif +# ifndef __packed +# define __packed __attribute__((__packed__)) +# endif +# ifndef __unused +# define __unused __attribute__((__unused__)) +# endif #else -# define _noreturn -# define _packed -# define _unused +# ifndef __dead +# define __dead +# endif +# ifndef __packed +# define __packed +# endif +# ifndef __unused +# define __unused +# endif #endif /* We don't really need this as our supported systems define __restrict diff --git a/control.c b/control.c index 30e6e506..6c98b16a 100644 --- a/control.c +++ b/control.c @@ -97,7 +97,7 @@ handle_control_data(void *arg) /* ARGSUSED */ static void -handle_control(_unused void *arg) +handle_control(__unused void *arg) { struct sockaddr_un run; socklen_t len; diff --git a/dhcp.h b/dhcp.h index ea6a86e0..bbc83678 100644 --- a/dhcp.h +++ b/dhcp.h @@ -153,7 +153,7 @@ struct dhcp_message { uint8_t bootfile[BOOTFILE_LEN]; /* boot file name */ uint32_t cookie; uint8_t options[DHCP_OPTION_LEN]; /* message options - cookie */ -} _packed; +} __packed; struct dhcp_lease { struct in_addr addr; diff --git a/dhcpcd.c b/dhcpcd.c index 6aa93b88..2bf574d4 100644 --- a/dhcpcd.c +++ b/dhcpcd.c @@ -209,7 +209,7 @@ cleanup(void) /* ARGSUSED */ void -handle_exit_timeout(_unused void *arg) +handle_exit_timeout(__unused void *arg) { int timeout; @@ -1270,7 +1270,7 @@ start_interface(void *arg) /* ARGSUSED */ static void -handle_link(_unused void *arg) +handle_link(__unused void *arg) { if (manage_link(linkfd) == -1) syslog(LOG_ERR, "manage_link: %m"); @@ -1541,7 +1541,7 @@ reconf_reboot(int action, int argc, char **argv, int oi) /* ARGSUSED */ static void -handle_signal(_unused void *arg) +handle_signal(__unused void *arg) { struct interface *ifp; struct if_options *ifo; diff --git a/eloop.c b/eloop.c index 51fe0ac4..e2fe2b5f 100644 --- a/eloop.c +++ b/eloop.c @@ -285,7 +285,7 @@ eloop_init(void) } #endif -_noreturn void +__dead void start_eloop(void) { int msecs, n; diff --git a/if-bsd.c b/if-bsd.c index 1a35ab76..ecfdfc04 100644 --- a/if-bsd.c +++ b/if-bsd.c @@ -82,14 +82,14 @@ static char *link_buf; static ssize_t link_buflen; int -if_init(_unused struct interface *iface) +if_init(__unused struct interface *iface) { /* BSD promotes secondary address by default */ return 0; } int -if_conf(_unused struct interface *iface) +if_conf(__unused struct interface *iface) { /* No extra checks needed on BSD */ return 0; diff --git a/ipv6ns.c b/ipv6ns.c index 00bc6dfb..e5ed973d 100644 --- a/ipv6ns.c +++ b/ipv6ns.c @@ -257,7 +257,7 @@ ipv6ns_sendprobe(void *arg) /* ARGSUSED */ void -ipv6ns_handledata(_unused void *arg) +ipv6ns_handledata(__unused void *arg) { ssize_t len; struct cmsghdr *cm; diff --git a/ipv6rs.c b/ipv6rs.c index e7c9b46a..0add67af 100644 --- a/ipv6rs.c +++ b/ipv6rs.c @@ -66,7 +66,7 @@ struct nd_opt_rdnss { /* RDNSS option RFC 6106 */ uint16_t nd_opt_rdnss_reserved; uint32_t nd_opt_rdnss_lifetime; /* followed by list of IP prefixes */ -} _packed; +} __packed; #endif #ifndef ND_OPT_DNSSL @@ -77,7 +77,7 @@ struct nd_opt_dnssl { /* DNSSL option RFC 6106 */ uint16_t nd_opt_dnssl_reserved; uint32_t nd_opt_dnssl_lifetime; /* followed by list of DNS servers */ -} _packed; +} __packed; #endif /* Minimal IPv6 MTU */ @@ -388,7 +388,7 @@ add_router(struct ra *router) /* ARGSUSED */ void -ipv6rs_handledata(_unused void *arg) +ipv6rs_handledata(__unused void *arg) { ssize_t len, l, m, n, olen; struct cmsghdr *cm;