summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRoy Marples <roy@marples.name>2013-04-24 09:31:31 +0000
committerRoy Marples <roy@marples.name>2013-04-24 09:31:31 +0000
commit6691a3fbc4ee9d9e965e357da6ca4dd5d1ca9549 (patch)
tree9a4c3fa276f9d9b2f59c7d2d2cb7b5530e8f1496
parentdc934496379cc795f28c5e83ca671383877b82f2 (diff)
downloaddhcpcd-5.6.tar.xz
Change from _unused to __unused to match NetBSD cdefs and avoiddhcpcd-5.6
a compiler failure on linux-headers-3.7
-rw-r--r--common.h24
-rw-r--r--control.c2
-rw-r--r--dhcp.h2
-rw-r--r--dhcpcd.c6
-rw-r--r--eloop.c2
-rw-r--r--if-bsd.c4
-rw-r--r--ipv6ns.c2
-rw-r--r--ipv6rs.c6
8 files changed, 30 insertions, 18 deletions
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;