From a57cdc84e2f38ea99fd464d8b5b6446c769cc545 Mon Sep 17 00:00:00 2001 From: Michael Stapelberg Date: Wed, 23 Jan 2019 08:56:40 +0100 Subject: Switch to autotools (#316) --- src/print_wireless_info.c | 17 ++++++++--------- 1 file changed, 8 insertions(+), 9 deletions(-) (limited to 'src/print_wireless_info.c') diff --git a/src/print_wireless_info.c b/src/print_wireless_info.c index 1d87c79..8b2d210 100644 --- a/src/print_wireless_info.c +++ b/src/print_wireless_info.c @@ -1,10 +1,13 @@ // vim:ts=4:sw=4:expandtab +#include #include #include +#include #include #include +#include -#ifdef LINUX +#ifdef __linux__ #include #include #include @@ -16,14 +19,12 @@ #endif #ifdef __APPLE__ -#include #define IW_ESSID_MAX_SIZE 32 #endif #ifdef __FreeBSD__ #include #include -#include #include #include #include @@ -36,7 +37,6 @@ #ifdef __DragonFly__ #include #include -#include #include #include #include @@ -49,7 +49,6 @@ #ifdef __OpenBSD__ #include -#include #include #include #include @@ -81,7 +80,7 @@ typedef struct { #ifdef IW_ESSID_MAX_SIZE char essid[IW_ESSID_MAX_SIZE + 1]; #endif -#ifdef LINUX +#ifdef __linux__ uint8_t bssid[ETH_ALEN]; #endif int quality; @@ -95,7 +94,7 @@ typedef struct { double frequency; } wireless_info_t; -#ifdef LINUX +#ifdef __linux__ // Like iw_print_bitrate, but without the dependency on libiw. static void print_bitrate(char *buffer, int buflen, int bitrate) { const int kilo = 1e3; @@ -275,7 +274,7 @@ static int gwi_scan_cb(struct nl_msg *msg, void *data) { static int get_wireless_info(const char *interface, wireless_info_t *info) { memset(info, 0, sizeof(wireless_info_t)); -#ifdef LINUX +#ifdef __linux__ struct nl_sock *sk = nl_socket_alloc(); if (genl_connect(sk) != 0) goto error1; @@ -589,7 +588,7 @@ void print_wireless_info(yajl_gen json_gen, char *buffer, const char *interface, outwalk += sprintf(outwalk, "%s", ip_address); walk += strlen("ip"); } -#ifdef LINUX +#ifdef __linux__ else if (BEGINS_WITH(walk + 1, "bitrate")) { char br_buffer[128]; -- cgit v1.2.3