Sign in
mojo
/
mojo-tools
/
8f8c21556bb8bc6ee96d310b1e6d892302b0bfc2
/
.
/
fusl
/
src
/
network
/
htons.c
blob: 31dc13e0b166f919a66d55352695c4107b767e90 [
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
;
}