未验证 提交 fbfed933 编写于 作者: O openharmony_ci 提交者: Gitee

!486 【回合monthly0816】feature: iccarm适配新增网络相关接口

Merge pull request !486 from Zhaotianyu/cherry-pick-1661423169
......@@ -34,4 +34,8 @@ ICCARM_ADAPT_SRC_COMMON = [
"$MUSLPORTINGDIR/src/malloc.c",
"$MUSLPORTINGDIR/src/fs.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.
先完成此消息的编辑!
想要评论请 注册