From: Vincent Bernat Date: Sun, 19 Jun 2016 06:43:06 +0000 (+0200) Subject: build: ensure typeof is correctly defined X-Git-Tag: 0.9.5~32 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=bdc8f796579f0576b62166ed71c761510d9a2499;p=thirdparty%2Flldpd.git build: ensure typeof is correctly defined This could be typeof/__typeof/__typeof__. Fix #186. --- diff --git a/configure.ac b/configure.ac index dd723b0a..c18dba93 100644 --- a/configure.ac +++ b/configure.ac @@ -90,6 +90,8 @@ AX_CFLAGS_GCC_OPTION([-Wno-sign-compare], [LLDP_CFLAGS]) dnl Should be fixed lat AX_LDFLAGS_OPTION([-Wl,-z,relro], [LLDP_LDFLAGS]) AX_LDFLAGS_OPTION([-Wl,-z,now], [LLDP_LDFLAGS]) +AC_C_TYPEOF + # Hardening AC_ARG_ENABLE([hardening], [AS_HELP_STRING([--enable-hardening], diff --git a/src/daemon/interfaces-bsd.c b/src/daemon/interfaces-bsd.c index 3adaff1d..8b658e3c 100644 --- a/src/daemon/interfaces-bsd.c +++ b/src/daemon/interfaces-bsd.c @@ -470,7 +470,11 @@ ifbsd_macphy(struct lldpd *cfg, { #ifdef ENABLE_DOT3 struct ifmediareq ifmr = {}; +#ifdef HAVE_TYPEOF typeof(ifmr.ifm_ulist[0]) media_list[32] = {}; +#else + int media_list[32] = {}; +#endif ifmr.ifm_ulist = media_list; ifmr.ifm_count = 32; struct lldpd_port *port = &hardware->h_lport;