mirror of
https://github.com/RGBCube/serenity
synced 2025-07-27 05:47:35 +00:00
LibC: Uhm, htonl() shouldn't byte-swap on big endian machines.
This commit is contained in:
parent
3c4497aa2d
commit
0538adbabd
1 changed files with 4 additions and 0 deletions
|
@ -27,7 +27,11 @@ inline uint16_t ntohs(uint16_t value)
|
||||||
|
|
||||||
inline uint32_t htonl(uint32_t value)
|
inline uint32_t htonl(uint32_t value)
|
||||||
{
|
{
|
||||||
|
#if BYTE_ORDER == LITTLE_ENDIAN
|
||||||
return __builtin_bswap32(value);
|
return __builtin_bswap32(value);
|
||||||
|
#else
|
||||||
|
return value;
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
inline uint32_t ntohl(uint32_t value)
|
inline uint32_t ntohl(uint32_t value)
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue