]> git.ipfire.org Git - thirdparty/dhcpcd.git/commitdiff
Change from _unused to __unused to match NetBSD cdefs and avoid
authorRoy Marples <roy@marples.name>
Wed, 24 Apr 2013 09:38:18 +0000 (09:38 +0000)
committerRoy Marples <roy@marples.name>
Wed, 24 Apr 2013 09:38:18 +0000 (09:38 +0000)
a compiler failure on linux-headers-3.7

common.h
control.c
dhcp.h
dhcp6.c
dhcp6.h
dhcpcd.c
eloop.c
if-bsd.c
ipv6ns.c
ipv6rs.c
signals.c

index 7d5260d039d4ecbf2d67cbb85572c3b69a3c8654..55ceb847b607e3c170dd05edfce933276cafa0de 100644 (file)
--- a/common.h
+++ b/common.h
 #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
index 9884ab317702761e97f710f9566cc4c8c80debd4..fa455517e137820c5d21f41188e17cf27c7a6a07 100644 (file)
--- 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 bd770c3999fa3ba903088c5f089378756706171a..4dfbb6fc5ed028e71edf4374420c2aac839f4f30 100644 (file)
--- 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 64286d02f87cebbb7542754e07ce9fdc4dee0c66..c8fc8605bf0faf6864de181c3f73a938ca36ca15 100644 (file)
--- 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 921dc7a24d013aface1191732e57c7cecc95dd60..861ca1cfd9fddf3223d3c68d97e7a4e6aae7b886 100644 (file)
--- 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
index dee42deef616da389307080503199fb7027d697f..2aac91daba7e26bd96d6a7646d16b3543d85aaee 100644 (file)
--- 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 c1a78f476966f63dbf6219540798841abce1415e..2936ca148dddc23b159bd20b95a77383cb2decf6 100644 (file)
--- 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;
index 74fc0aea5e3b35f3bf760223e0f8903b3d641894..6367be9d5e779ab0c7a1385fb0684372a22452d7 100644 (file)
--- 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;
index b4c85a45abd9bc10314fbaaa7ce4700668308eae..0541ca53af58c257437fa7aa5976eef5d4f6e623 100644 (file)
--- 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;
index 57d83b3bd81357d605cac8e251d073b6edc0fde9..363aaf87870d0276e442b85b61067fb56af2a815 100644 (file)
--- 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;
index 1dc4de96b334f9217a0732aa53e4bbdd7f5d32ad..4e2d299b671aae06017ffbc6abc0b21131ba1a85 100644 (file)
--- 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];