Fix compile on Linux.
authorRoy Marples <roy@marples.name>
Wed, 18 Mar 2015 17:08:22 +0000 (17:08 +0000)
committerRoy Marples <roy@marples.name>
Wed, 18 Mar 2015 17:08:22 +0000 (17:08 +0000)
src/dhcpcd-curses/common.h
src/libdhcpcd/wpa.c

index aeb1ccfc3a607d7e6242e12b5ab549610ef92408..ea46b6d97fb304b01bce730bc1baaafddf2a2d35 100644 (file)
 #define MSEC_PER_SEC           1000L
 #define MSEC_PER_NSEC          1000000L
 
+#ifndef TIMEVAL_TO_TIMESPEC
+#define        TIMEVAL_TO_TIMESPEC(tv, ts) do {                                \
+       (ts)->tv_sec = (tv)->tv_sec;                                    \
+       (ts)->tv_nsec = (tv)->tv_usec * USEC_PER_NSEC;                  \
+} while (0 /* CONSTCOND */)
+#endif
+
 /* Some systems don't define timespec macros */
 #ifndef timespecclear
 #define timespecclear(tsp)      (tsp)->tv_sec = (time_t)((tsp)->tv_nsec = 0L)
index 03f5e9aae36d6b8ff415f0cd23f0f9071ddf2a5c..d7bdd3be7ac0012230b42647467cfba28c8c99aa 100644 (file)
@@ -172,11 +172,12 @@ dhcpcd_attach_detach(DHCPCD_WPA *wpa, bool attach)
        return true;
 }
 
+#define UNUSED(x)      (void)(x)
 bool
-dhcpcd_wpa_can_background_scan(__unused DHCPCD_WPA *wpa)
+dhcpcd_wpa_can_background_scan(DHCPCD_WPA *wpa)
 {
 
-       wpa = NULL; /* BSD will use this moving forwards */
+       UNUSED(wpa); /* BSD will use this moving forwards */
 #ifdef __linux__
        return true;
 #else