提交 161fa671 编写于 作者: A arvinzzz

feature: iccarm适配补充网络相关接口

close: #I5O540
Signed-off-by: Narvinzzz <zhaotianyu9@huawei.com>
上级 b82ff235
...@@ -34,4 +34,8 @@ ICCARM_ADAPT_SRC_COMMON = [ ...@@ -34,4 +34,8 @@ ICCARM_ADAPT_SRC_COMMON = [
"$MUSLPORTINGDIR/src/malloc.c", "$MUSLPORTINGDIR/src/malloc.c",
"$MUSLPORTINGDIR/src/fs.c", "$MUSLPORTINGDIR/src/fs.c",
"$MUSLPORTINGDIR/src/misc/realpath.c", "$MUSLPORTINGDIR/src/misc/realpath.c",
"$MUSLPORTINGDIR/src/network/htonl.c",
"$MUSLPORTINGDIR/src/network/htons.c",
"$MUSLPORTINGDIR/src/network/ntohl.c",
"$MUSLPORTINGDIR/src/network/ntohs.c",
] ]
#include <netinet/in.h>
#include <byteswap.h>
uint32_t htonl(uint32_t n)
{
union { int i; char c; } u = { 1 };
return u.c ? bswap_32(n) : n;
}
#include <netinet/in.h>
#include <byteswap.h>
uint16_t htons(uint16_t n)
{
union { int i; char c; } u = { 1 };
return u.c ? bswap_16(n) : n;
}
#include <netinet/in.h>
#include <byteswap.h>
uint32_t ntohl(uint32_t n)
{
union { int i; char c; } u = { 1 };
return u.c ? bswap_32(n) : n;
}
#include <netinet/in.h>
#include <byteswap.h>
uint16_t ntohs(uint16_t n)
{
union { int i; char c; } u = { 1 };
return u.c ? bswap_16(n) : n;
}
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册