From a0b6ad239c846c3804e2cc4fd65e0d94452de949 Mon Sep 17 00:00:00 2001 From: Augustin Cavalier Date: Thu, 3 Mar 2022 15:16:00 -0500 Subject: [PATCH] GCC2 fixes. --- src/ap/hostapd.h | 2 +- src/common/ieee802_11_common.h | 2 +- src/common/ieee802_11_defs.h | 6 +++--- src/drivers/driver_bsd.c | 5 +++++ wpa_supplicant/bss.h | 2 +- wpa_supplicant/wpa_gui-haiku/main_haiku.cpp | 1 + 6 files changed, 12 insertions(+), 6 deletions(-) diff --git a/src/ap/hostapd.h b/src/ap/hostapd.h index f3ca752..aee5518 100644 --- a/src/ap/hostapd.h +++ b/src/ap/hostapd.h @@ -146,7 +146,7 @@ struct hostapd_sae_commit_queue { struct dl_list list; int rssi; size_t len; - u8 msg[]; + u8 msg[0]; }; /** diff --git a/src/common/ieee802_11_common.h b/src/common/ieee802_11_common.h index 3c57803..0c846dc 100644 --- a/src/common/ieee802_11_common.h +++ b/src/common/ieee802_11_common.h @@ -15,7 +15,7 @@ struct element { u8 id; u8 datalen; - u8 data[]; + u8 data[0]; } STRUCT_PACKED; struct hostapd_hw_modes; diff --git a/src/common/ieee802_11_defs.h b/src/common/ieee802_11_defs.h index d04d2d6..41d157f 100644 --- a/src/common/ieee802_11_defs.h +++ b/src/common/ieee802_11_defs.h @@ -1001,12 +1001,12 @@ struct ieee80211_mgmt { struct { u8 action; u8 trans_id[WLAN_SA_QUERY_TR_ID_LEN]; - u8 variable[]; /* OCI element */ + u8 variable[0]; /* OCI element */ } STRUCT_PACKED sa_query_req; struct { u8 action; /* */ u8 trans_id[WLAN_SA_QUERY_TR_ID_LEN]; - u8 variable[]; /* OCI element */ + u8 variable[0]; /* OCI element */ } STRUCT_PACKED sa_query_resp; struct { u8 action; @@ -1067,7 +1067,7 @@ struct ieee80211_mgmt { struct { u8 action; /* 12 */ u8 dialog_token; - u8 variable[]; + u8 variable[0]; } STRUCT_PACKED coloc_intf_report; struct { u8 action; /* 15 */ diff --git a/src/drivers/driver_bsd.c b/src/drivers/driver_bsd.c index 602ea6a..6172836 100644 --- a/src/drivers/driver_bsd.c +++ b/src/drivers/driver_bsd.c @@ -36,7 +36,12 @@ #include #endif /* __GLIBC__ */ #include +/* hack: avoids "incomplete type" errors */ +#undef __HAIKU__ +#define __FreeBSD__ #include +#undef __FreeBSD__ +#define __HAIKU__ #include #endif /* __DragonFly__ || __GLIBC__ */ #if defined(__FreeBSD__) || defined(__FreeBSD_kernel__) diff --git a/wpa_supplicant/bss.h b/wpa_supplicant/bss.h index 4078b9b..11e0b90 100644 --- a/wpa_supplicant/bss.h +++ b/wpa_supplicant/bss.h @@ -122,7 +122,7 @@ struct wpa_bss { size_t beacon_ie_len; /* followed by ie_len octets of IEs */ /* followed by beacon_ie_len octets of IEs */ - u8 ies[]; + u8 ies[0]; }; static inline const u8 * wpa_bss_ie_ptr(const struct wpa_bss *bss) diff --git a/wpa_supplicant/wpa_gui-haiku/main_haiku.cpp b/wpa_supplicant/wpa_gui-haiku/main_haiku.cpp index b589882..1394e88 100644 --- a/wpa_supplicant/wpa_gui-haiku/main_haiku.cpp +++ b/wpa_supplicant/wpa_gui-haiku/main_haiku.cpp @@ -53,6 +53,7 @@ extern "C" { #undef B_TRANSLATION_CONTEXT #define B_TRANSLATION_CONTEXT "wpa_supplicant" +#undef bool static const uint32 kMsgJoinTimeout = 'jnto'; static const char *kWPASupplicantKeyring = "wpa_supplicant"; -- 2.42.0