mirror of
https://github.com/bytecodealliance/wasm-micro-runtime.git
synced 2024-11-26 15:32:05 +00:00
Small change to make init of vars buildable in clang and clang++ (#1590)
This commit is contained in:
parent
2e77626d0f
commit
84e88e4f85
|
@ -90,9 +90,11 @@ wasi_addr_to_sockaddr(const __wasi_addr_t *wasi_addr,
|
|||
switch (wasi_addr->kind) {
|
||||
case IPv4:
|
||||
{
|
||||
struct sockaddr_in sock_addr_in = { 0 };
|
||||
struct sockaddr_in sock_addr_in;
|
||||
uint32_t s_addr;
|
||||
|
||||
memset(&sock_addr_in, 0, sizeof(sockaddr_in));
|
||||
|
||||
s_addr = (wasi_addr->addr.ip4.addr.n0 << 24)
|
||||
| (wasi_addr->addr.ip4.addr.n1 << 16)
|
||||
| (wasi_addr->addr.ip4.addr.n2 << 8)
|
||||
|
@ -108,7 +110,10 @@ wasi_addr_to_sockaddr(const __wasi_addr_t *wasi_addr,
|
|||
}
|
||||
case IPv6:
|
||||
{
|
||||
struct sockaddr_in6 sock_addr_in6 = { 0 };
|
||||
struct sockaddr_in6 sock_addr_in6;
|
||||
|
||||
memset(&sock_addr_in6, 0, sizeof(sockaddr_in6));
|
||||
|
||||
uint16_t *addr_buf = (uint16_t *)sock_addr_in6.sin6_addr.s6_addr;
|
||||
|
||||
addr_buf[0] = htons(wasi_addr->addr.ip6.addr.n0);
|
||||
|
|
Loading…
Reference in New Issue
Block a user