summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorYu Wang <yyuwang@codeaurora.org>2017-02-18 00:24:35 +0800
committerqcabuildsw <qcabuildsw@localhost>2017-02-28 11:47:21 -0800
commitc42692ade656a7069dfb597ce92e6f0b0493eb3c (patch)
tree1fd55b194da6a61c78319df38874a7d8565b29ac
parentdc8064cefae73203851d66a85da9aca6365bed53 (diff)
qcacld-3.0: 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: 2008540
-rw-r--r--core/utils/nlink/inc/wlan_nlink_common.h6
1 files changed, 5 insertions, 1 deletions
diff --git a/core/utils/nlink/inc/wlan_nlink_common.h b/core/utils/nlink/inc/wlan_nlink_common.h
index 7896c65994c1..ad531e1e96f5 100644
--- a/core/utils/nlink/inc/wlan_nlink_common.h
+++ b/core/utils/nlink/inc/wlan_nlink_common.h
@@ -38,8 +38,12 @@
#define WLAN_NLINK_COMMON_H__
#include <linux/netlink.h>
-#include <linux/if.h>
+#ifdef __KERNEL__
+#include <linux/if.h>
+#else
+#include <net/if.h>
+#endif
/*---------------------------------------------------------------------------
* External Functions