From 0a4042afbdf9405cb6611d6d7173859eb957b480 Mon Sep 17 00:00:00 2001 From: kimocoder Date: Wed, 14 Nov 2018 23:39:13 +0100 Subject: [PATCH] Add kernel v4.20 support and minor compiler warning turned off --- Makefile | 2 ++ os_dep/linux/ioctl_cfg80211.c | 4 ++++ 2 files changed, 6 insertions(+) diff --git a/Makefile b/Makefile index 453964d..4b0431d 100755 --- a/Makefile +++ b/Makefile @@ -26,6 +26,8 @@ ifeq ($(GCC_VER_49),1) EXTRA_CFLAGS += -Wno-date-time -Wno-error=date-time # Fix compile error && warning on gcc 4.9 and later endif +EXTRA_CFLAGS += -Wno-vla + EXTRA_CFLAGS += -I$(src)/include EXTRA_LDFLAGS += --strip-debug diff --git a/os_dep/linux/ioctl_cfg80211.c b/os_dep/linux/ioctl_cfg80211.c index 1ede452..cfb2ed0 100644 --- a/os_dep/linux/ioctl_cfg80211.c +++ b/os_dep/linux/ioctl_cfg80211.c @@ -692,7 +692,11 @@ static u64 rtw_get_systime_us(void) return do_div(ts, 1000); #elif (LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 39)) struct timespec ts; +#if (LINUX_VERSION_CODE >= KERNEL_VERSION(4, 20, 0)) + getboottime(&ts); +#else get_monotonic_boottime(&ts); +#endif return ((u64)ts.tv_sec * 1000000) + ts.tv_nsec / 1000; #else struct timeval tv;