commit 554e4f55db3b2df85a7f86ba619dcd086ecbc6f0
parent d0fd928af27887dbf361c4e99604c946bde37ce7
Author: Marcel Holtmann <marcel@holtmann.org>
Date: Thu, 1 Nov 2018 22:37:11 +0100
build: Fix includes for using with -std=c99 compiler option
Diffstat:
14 files changed, 28 insertions(+), 13 deletions(-)
diff --git a/src/eap-aka.c b/src/eap-aka.c
@@ -367,7 +367,7 @@ static void handle_challenge(struct eap_state *eap, const uint8_t *pkt,
goto chal_error;
}
- aka->kdf_in = strndup((const char *)(contents + 2),
+ aka->kdf_in = l_strndup((const char *)(contents + 2),
kdf_in_len);
break;
diff --git a/src/eap-sim.c b/src/eap-sim.c
@@ -27,6 +27,7 @@
#include <ctype.h>
#include <stdio.h>
#include <errno.h>
+#include <alloca.h>
#include <ell/ell.h>
#include "eap.h"
diff --git a/src/eap-wsc.c b/src/eap-wsc.c
@@ -1290,7 +1290,7 @@ static bool eap_wsc_load_settings(struct eap_state *eap,
'A' + wsc->device_password[i] - 'a';
}
} else
- wsc->device_password = strdup("00000000");
+ wsc->device_password = l_strdup("00000000");
if (!load_hexencoded(settings, "E-SNonce1", wsc->e_snonce1, 16))
l_getrandom(wsc->e_snonce1, 16);
diff --git a/src/eap.c b/src/eap.c
@@ -24,9 +24,10 @@
#include <config.h>
#endif
-#include <string.h>
+#define _GNU_SOURCE
#include <stdio.h>
#include <errno.h>
+#include <string.h>
#include <ell/ell.h>
#include "eap.h"
diff --git a/src/eapol.c b/src/eapol.c
@@ -25,6 +25,7 @@
#endif
#include <string.h>
+#include <alloca.h>
#include <linux/if_ether.h>
#include <ell/ell.h>
diff --git a/src/handshake.c b/src/handshake.c
@@ -73,7 +73,7 @@ void __handshake_set_install_igtk_func(handshake_install_igtk_func_t func)
void handshake_state_free(struct handshake_state *s)
{
- typeof(s->free) destroy = s->free;
+ __typeof__(s->free) destroy = s->free;
l_free(s->authenticator_ie);
l_free(s->supplicant_ie);
diff --git a/src/netdev.c b/src/netdev.c
@@ -25,6 +25,7 @@
#endif
#include <stdlib.h>
+#include <alloca.h>
#include <stdio.h>
#include <linux/rtnetlink.h>
#include <net/if_arp.h>
diff --git a/src/network.c b/src/network.c
@@ -25,9 +25,10 @@
#endif
#include <sys/types.h>
+#include <stdio.h>
#include <errno.h>
#include <limits.h>
-#include <stdio.h>
+#include <alloca.h>
#include <ell/ell.h>
@@ -1187,7 +1188,7 @@ bool network_register(struct network *network, const char *path)
l_info("Unable to register %s interface",
L_DBUS_INTERFACE_PROPERTIES);
- network->object_path = strdup(path);
+ network->object_path = l_strdup(path);
return true;
}
diff --git a/src/scan.c b/src/scan.c
@@ -24,9 +24,11 @@
#include <config.h>
#endif
+#define _GNU_SOURCE
#include <stdlib.h>
#include <stdio.h>
#include <errno.h>
+#include <time.h>
#include <sys/socket.h>
#include <limits.h>
#include <linux/if.h>
diff --git a/src/station.c b/src/station.c
@@ -24,9 +24,11 @@
#include <config.h>
#endif
+#define _GNU_SOURCE
#include <stdio.h>
#include <errno.h>
#include <time.h>
+#include <sys/time.h>
#include <linux/if_ether.h>
#include <ell/ell.h>
diff --git a/src/storage.c b/src/storage.c
@@ -25,16 +25,18 @@
#endif
#define _GNU_SOURCE
-#include <string.h>
-#include <stdarg.h>
#include <stdio.h>
+#include <errno.h>
+#include <ctype.h>
#include <fcntl.h>
-#include <sys/types.h>
-#include <sys/stat.h>
+#include <string.h>
+#include <stdarg.h>
#include <stdlib.h>
#include <unistd.h>
-#include <errno.h>
-#include <ctype.h>
+#include <time.h>
+#include <sys/time.h>
+#include <sys/types.h>
+#include <sys/stat.h>
#include <ell/ell.h>
diff --git a/src/storage.h b/src/storage.h
@@ -20,6 +20,8 @@
*
*/
+#include <time.h>
+
struct l_settings;
enum security;
diff --git a/src/util.h b/src/util.h
@@ -29,7 +29,7 @@
#define align_len(len, boundary) (((len)+(boundary)-1) & ~((boundary)-1))
#define container_of(ptr, type, member) ({ \
- const typeof( ((type *)0)->member ) *__mptr = (ptr); \
+ const __typeof__( ((type *)0)->member ) *__mptr = (ptr); \
(type *)( (char *)__mptr - offsetof(type,member) );})
#define MAC "%02x:%02x:%02x:%02x:%02x:%02x"
diff --git a/tools/hwsim.c b/tools/hwsim.c
@@ -28,6 +28,8 @@
#include <stdlib.h>
#include <getopt.h>
#include <signal.h>
+#include <time.h>
+#include <sys/time.h>
#include <linux/if_ether.h>
#include <linux/rtnetlink.h>
#include <net/if_arp.h>