Gitiles
Code Review
Sign In
gerrit-public.fairphone.software
/
platform
/
external
/
musl
/
6651ef1f060738ee1f50cac1fe6d8ce64c359022
/
.
/
src
/
network
/
htons.c
blob: 03a3a1d59ed4d5d10272d2751920ce3f8bec080b [
file
] [
log
] [
blame
]
#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
;
}