#include <sys/_endian.h>
sys/_endian.h
macrontohs
#define ntohs(x) __DARWIN_OSSwapInt16(x)
macrohtons
#define htons(x) __DARWIN_OSSwapInt16(x)
macrontohl
#define ntohl(x) __DARWIN_OSSwapInt32(x)
macrohtonl
#define htonl(x) __DARWIN_OSSwapInt32(x)
macrontohll
#define ntohll(x) __DARWIN_OSSwapInt64(x)
macrohtonll
#define htonll(x) __DARWIN_OSSwapInt64(x)
macroNTOHL
#define NTOHL(x) (x) = ntohl((__uint32_t)x)
macroNTOHS
#define NTOHS(x) (x) = ntohs((__uint16_t)x)
macroNTOHLL
#define NTOHLL(x) (x) = ntohll((__uint64_t)x)
macroHTONL
#define HTONL(x) (x) = htonl((__uint32_t)x)
macroHTONS
#define HTONS(x) (x) = htons((__uint16_t)x)
macroHTONLL
#define HTONLL(x) (x) = htonll((__uint64_t)x)