Gitiles
Code Review
Sign In
gerrit-public.fairphone.software
/
platform
/
external
/
musl
/
d1c24ac4ec721ea49c15b277eaebed30f8df1e4c
/
.
/
src
/
network
/
htonl.c
blob: b21dace04600aea25b95bcc9435a28f9ef6bfec2 [
file
] [
log
] [
blame
]
#include
<netinet/in.h>
uint32_t
htonl
(
uint32_t
n
)
{
union
{
uint8_t
b
[
4
];
uint32_t
i
;
}
u
=
{
{
n
>>
24
,
n
>>
16
,
n
>>
8
,
n
}
};
return
u
.
i
;
}