From 7250c75146968c4836918df279c424a6278ee006 Mon Sep 17 00:00:00 2001 From: Yu Wang Date: Thu, 25 May 2017 21:25:55 +0800 Subject: [PATCH] qcacmn: fix compile error in APPs when include wlan_nlink_common.h wlan_nlink_common.h include linux/if.h, and linux/if.h refers to 'struct sockaddr' which is defined in linux/socket.h, and so it include linux/socket.h; however, in userspace, linux/socket.h doesn't define 'sockaddr', so it will cause errors when compiling userspace APP if it includs wlan_nlink_common.h. Add macro __KERNEL__ to determine which header file should be included: For userspace, include net/if.h, it will include sys/socket.h, which is for userspace; for kernel space, include linux/if.h. Change-Id: I3a2d8e6edb42871aa3599ef30fbb5d0d275764df CRs-Fixed: 2054409 --- utils/nlink/inc/wlan_nlink_common.h | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/utils/nlink/inc/wlan_nlink_common.h b/utils/nlink/inc/wlan_nlink_common.h index 724f2446be..d61613ef2b 100644 --- a/utils/nlink/inc/wlan_nlink_common.h +++ b/utils/nlink/inc/wlan_nlink_common.h @@ -38,8 +38,12 @@ #define WLAN_NLINK_COMMON_H__ #include -#include +#ifdef __KERNEL__ +#include +#else +#include +#endif /*--------------------------------------------------------------------------- * External Functions