From: Roy Marples Date: Wed, 24 Apr 2013 09:38:18 +0000 (+0000) Subject: Change from _unused to __unused to match NetBSD cdefs and avoid X-Git-Tag: v5.99.6~10 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=3491ea4d56abdb366001ad2776c643d946f9f561;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 7d5260d0..55ceb847 100644 --- a/common.h +++ b/common.h @@ -59,13 +59,25 @@ #endif #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 9884ab31..fa455517 100644 --- a/control.c +++ b/control.c @@ -115,7 +115,7 @@ control_handle_data(void *arg) /* ARGSUSED */ static void -control_handle(_unused void *arg) +control_handle(__unused void *arg) { struct sockaddr_un run; socklen_t len; diff --git a/dhcp.h b/dhcp.h index bd770c39..4dfbb6fc 100644 --- a/dhcp.h +++ b/dhcp.h @@ -151,7 +151,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/dhcp6.c b/dhcp6.c index 64286d02..c8fc8605 100644 --- a/dhcp6.c +++ b/dhcp6.c @@ -1539,7 +1539,7 @@ dhcp6_find_delegates(struct interface *ifp) /* ARGSUSED */ static void -dhcp6_handledata(_unused void *arg) +dhcp6_handledata(__unused void *arg) { ssize_t len; struct cmsghdr *cm; diff --git a/dhcp6.h b/dhcp6.h index 921dc7a2..861ca1cf 100644 --- a/dhcp6.h +++ b/dhcp6.h @@ -86,20 +86,20 @@ struct dhcp6_message { uint8_t type; uint8_t xid[3]; /* followed by options */ -} _packed; +} __packed; struct dhcp6_option { uint16_t code; uint16_t len; /* followed by data */ -} _packed; +} __packed; struct dhcp6_status { uint16_t code; uint16_t len; uint16_t status; /* followed by message */ -} _packed; +} __packed; #define D6_STATUS_OK 0 #define D6_STATUS_FAIL 1 diff --git a/dhcpcd.c b/dhcpcd.c index dee42dee..2aac91da 100644 --- a/dhcpcd.c +++ b/dhcpcd.c @@ -171,7 +171,7 @@ cleanup(void) /* ARGSUSED */ static void -handle_exit_timeout(_unused void *arg) +handle_exit_timeout(__unused void *arg) { int timeout; @@ -441,7 +441,7 @@ start_interface(void *arg) /* ARGSUSED */ static void -handle_link(_unused void *arg) +handle_link(__unused void *arg) { if (manage_link(linkfd) == -1) @@ -633,8 +633,9 @@ reconf_reboot(int action, int argc, char **argv, int oi) sort_interfaces(); } +/* ARGSUSED */ static void -sig_reboot(_unused void *arg) +sig_reboot(__unused void *arg) { struct if_options *ifo; int i; @@ -662,7 +663,7 @@ sig_reboot(_unused void *arg) } static void -sig_reconf(_unused void *arg) +sig_reconf(__unused void *arg) { struct interface *ifp; diff --git a/eloop.c b/eloop.c index c1a78f47..2936ca14 100644 --- a/eloop.c +++ b/eloop.c @@ -323,7 +323,7 @@ eloop_init(void) } #endif -_noreturn void +__dead void eloop_start(const sigset_t *sigmask) { int n; diff --git a/if-bsd.c b/if-bsd.c index 74fc0aea..6367be9d 100644 --- a/if-bsd.c +++ b/if-bsd.c @@ -81,14 +81,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 b4c85a45..0541ca53 100644 --- a/ipv6ns.c +++ b/ipv6ns.c @@ -71,7 +71,7 @@ static unsigned char *rcvbuf; static unsigned char ansbuf[1500]; static char ntopbuf[INET6_ADDRSTRLEN]; -static void ipv6ns_handledata(_unused void *arg); +static void ipv6ns_handledata(__unused void *arg); #if DEBUG_MEMORY static void @@ -259,7 +259,7 @@ ipv6ns_sendprobe(void *arg) /* ARGSUSED */ static 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 57d83b3b..363aaf87 100644 --- a/ipv6rs.c +++ b/ipv6rs.c @@ -69,7 +69,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 @@ -80,7 +80,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 */ @@ -395,7 +395,7 @@ add_router(struct ra *router) /* ARGSUSED */ static void -ipv6rs_handledata(_unused void *arg) +ipv6rs_handledata(__unused void *arg) { ssize_t len, l, m, n, olen; struct cmsghdr *cm; diff --git a/signals.c b/signals.c index 1dc4de96..4e2d299b 100644 --- a/signals.c +++ b/signals.c @@ -58,8 +58,9 @@ signal_handler(int sig) errno = serrno; } +/* ARGSUSED */ static void -signal_read(_unused void *arg) +signal_read(__unused void *arg) { int sig = -1; char buf[16];