LibC: Uhm, htonl() shouldn't byte-swap on big endian machines.
This commit is contained in:
parent
3c4497aa2d
commit
0538adbabd
Notes:
sideshowbarker
2024-07-19 13:28:53 +09:00
Author: https://github.com/awesomekling Commit: https://github.com/SerenityOS/serenity/commit/0538adbabd2
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)
|
||||
{
|
||||
#if BYTE_ORDER == LITTLE_ENDIAN
|
||||
return __builtin_bswap32(value);
|
||||
#else
|
||||
return value;
|
||||
#endif
|
||||
}
|
||||
|
||||
inline uint32_t ntohl(uint32_t value)
|
||||
|
|
Loading…
Add table
Reference in a new issue