summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBernard Xiong <[email protected]>2018-10-16 11:13:01 +0800
committerGitHub <[email protected]>2018-10-16 11:13:01 +0800
commit5d6f122ffc36cc162158b0ec45f65a81aeacac9e (patch)
tree82ca0f97ea31873073e185a37fd3e32a09618065
parentb21b1080c438ebd93a37eabfcd202a5aff6b73f4 (diff)
parente2b5fcd07450b0fa2014cba450a896a9bd61cc72 (diff)
Merge pull request #1901 from armink/fix_sal
Fix sal
-rw-r--r--components/net/at/at_socket/at_socket.c4
-rw-r--r--components/net/sal_socket/impl/af_inet_at.c4
-rw-r--r--components/net/sal_socket/impl/af_inet_lwip.c4
3 files changed, 12 insertions, 0 deletions
diff --git a/components/net/at/at_socket/at_socket.c b/components/net/at/at_socket/at_socket.c
index 69112204fa..6fd2e765d4 100644
--- a/components/net/at/at_socket/at_socket.c
+++ b/components/net/at/at_socket/at_socket.c
@@ -23,6 +23,8 @@
#define LOG_TAG "at.skt"
#include <at_log.h>
+#ifdef AT_USING_SOCKET
+
#define HTONS_PORT(x) ((((x) & 0x00ffUL) << 8) | (((x) & 0xff00UL) >> 8))
#define NIPQUAD(addr) \
((unsigned char *)&addr)[0], \
@@ -1175,3 +1177,5 @@ void at_socket_device_register(const struct at_device_ops *ops)
RT_ASSERT(ops->at_set_event_cb);
at_dev_ops = (struct at_device_ops *) ops;
}
+
+#endif /* AT_USING_SOCKET */
diff --git a/components/net/sal_socket/impl/af_inet_at.c b/components/net/sal_socket/impl/af_inet_at.c
index fe7ad6cd13..c064283a61 100644
--- a/components/net/sal_socket/impl/af_inet_at.c
+++ b/components/net/sal_socket/impl/af_inet_at.c
@@ -20,6 +20,8 @@
#include <dfs_poll.h>
#endif
+#ifdef SAL_USING_AT
+
#ifdef SAL_USING_POSIX
static int at_poll(struct dfs_fd *file, struct rt_pollreq *req)
{
@@ -111,3 +113,5 @@ int at_inet_init(void)
return 0;
}
INIT_COMPONENT_EXPORT(at_inet_init);
+
+#endif /* SAL_USING_AT */
diff --git a/components/net/sal_socket/impl/af_inet_lwip.c b/components/net/sal_socket/impl/af_inet_lwip.c
index e20e16ffaf..41ea9ac968 100644
--- a/components/net/sal_socket/impl/af_inet_lwip.c
+++ b/components/net/sal_socket/impl/af_inet_lwip.c
@@ -30,6 +30,8 @@
#endif
#endif
+#ifdef SAL_USING_LWIP
+
#ifdef SAL_USING_POSIX
/*
* Re-define lwip socket
@@ -293,3 +295,5 @@ int lwip_inet_init(void)
return 0;
}
INIT_COMPONENT_EXPORT(lwip_inet_init);
+
+#endif /* SAL_USING_LWIP */