Gitiles
Code Review
Sign In
gerrit-public.fairphone.software
/
platform
/
external
/
musl
/
29f3202b731185d993a399f04d2f3e3f78db5a81
/
.
/
src
/
network
/
ntohs.c
blob: 745cef425a1947f119880d499e7829146e049470 [
file
] [
log
] [
blame
]
#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
;
}