Mercurial > hg > dhcpcd
changeset 1911:3f17dca949e6 draft dhcpcd-5.6
Change from _unused to __unused to match NetBSD cdefs and avoid
a compiler failure on linux-headers-3.7
| author | Roy Marples <roy@marples.name> |
|---|---|
| date | Wed, 24 Apr 2013 09:31:31 +0000 |
| parents | ac77c478e224 |
| children | |
| files | common.h control.c dhcp.h dhcpcd.c eloop.c if-bsd.c ipv6ns.c ipv6rs.c |
| diffstat | 8 files changed, 30 insertions(+), 18 deletions(-) [+] |
line wrap: on
line diff
--- a/common.h Thu Apr 04 22:20:33 2013 +0000 +++ b/common.h Wed Apr 24 09:31:31 2013 +0000 @@ -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
--- a/control.c Thu Apr 04 22:20:33 2013 +0000 +++ b/control.c Wed Apr 24 09:31:31 2013 +0000 @@ -97,7 +97,7 @@ /* ARGSUSED */ static void -handle_control(_unused void *arg) +handle_control(__unused void *arg) { struct sockaddr_un run; socklen_t len;
--- a/dhcp.h Thu Apr 04 22:20:33 2013 +0000 +++ b/dhcp.h Wed Apr 24 09:31:31 2013 +0000 @@ -153,7 +153,7 @@ 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;
--- a/dhcpcd.c Thu Apr 04 22:20:33 2013 +0000 +++ b/dhcpcd.c Wed Apr 24 09:31:31 2013 +0000 @@ -209,7 +209,7 @@ /* ARGSUSED */ void -handle_exit_timeout(_unused void *arg) +handle_exit_timeout(__unused void *arg) { int timeout; @@ -1270,7 +1270,7 @@ /* 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 @@ /* ARGSUSED */ static void -handle_signal(_unused void *arg) +handle_signal(__unused void *arg) { struct interface *ifp; struct if_options *ifo;
--- a/eloop.c Thu Apr 04 22:20:33 2013 +0000 +++ b/eloop.c Wed Apr 24 09:31:31 2013 +0000 @@ -285,7 +285,7 @@ } #endif -_noreturn void +__dead void start_eloop(void) { int msecs, n;
--- a/if-bsd.c Thu Apr 04 22:20:33 2013 +0000 +++ b/if-bsd.c Wed Apr 24 09:31:31 2013 +0000 @@ -82,14 +82,14 @@ 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;
--- a/ipv6ns.c Thu Apr 04 22:20:33 2013 +0000 +++ b/ipv6ns.c Wed Apr 24 09:31:31 2013 +0000 @@ -257,7 +257,7 @@ /* ARGSUSED */ void -ipv6ns_handledata(_unused void *arg) +ipv6ns_handledata(__unused void *arg) { ssize_t len; struct cmsghdr *cm;
--- a/ipv6rs.c Thu Apr 04 22:20:33 2013 +0000 +++ b/ipv6rs.c Wed Apr 24 09:31:31 2013 +0000 @@ -66,7 +66,7 @@ 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 @@ 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 @@ /* ARGSUSED */ void -ipv6rs_handledata(_unused void *arg) +ipv6rs_handledata(__unused void *arg) { ssize_t len, l, m, n, olen; struct cmsghdr *cm;
