Definitions for ntohl etc. that don't require us to include netinet/in.h. We wrap gbswap_32 and gbswap_16 in functions rather than just #defining them because in debug mode, gcc doesn't correctly handle the (rather involved) definitions of bswap_32. gcc guarantees that inline functions are as fast as macros, so this isn't a performance hit.
| 512 | // gcc guarantees that inline functions are as fast as macros, so |
| 513 | // this isn't a performance hit. |
| 514 | inline uint16_t ghtons(uint16_t x) { return gbswap_16(x); } |
| 515 | inline uint32_t ghtonl(uint32_t x) { return gbswap_32(x); } |
| 516 | inline uint64_t ghtonll(uint64_t x) { return gbswap_64(x); } |
| 517 |