X-Git-Url: https://git.saurik.com/apple/xnu.git/blobdiff_plain/b0d623f7f2ae71ed96e60569f61f9a9a27016e80..d190cdc3f5544636abb56dc1874be391d3e1b148:/bsd/sys/_endian.h?ds=sidebyside diff --git a/bsd/sys/_endian.h b/bsd/sys/_endian.h index 3fb0f062f..6e00b6c0b 100644 --- a/bsd/sys/_endian.h +++ b/bsd/sys/_endian.h @@ -113,10 +113,16 @@ __END_DECLS #define htons(x) ((__uint16_t)(x)) #if defined(KERNEL) || (!defined(_POSIX_C_SOURCE) || defined(_DARWIN_C_SOURCE)) + +#define ntohll(x) ((__uint64_t)(x)) +#define htonll(x) ((__uint64_t)(x)) + #define NTOHL(x) (x) #define NTOHS(x) (x) +#define NTOHLL(x) (x) #define HTONL(x) (x) #define HTONS(x) (x) +#define HTONLL(x) (x) #endif /* defined(KERNEL) || (!defined(_POSIX_C_SOURCE) || defined(_DARWIN_C_SOURCE)) */ #else /* __DARWIN_BYTE_ORDER == __DARWIN_LITTLE_ENDIAN */ @@ -130,10 +136,16 @@ __END_DECLS #define htonl(x) __DARWIN_OSSwapInt32(x) #if defined(KERNEL) || (!defined(_POSIX_C_SOURCE) || defined(_DARWIN_C_SOURCE)) + +#define ntohll(x) __DARWIN_OSSwapInt64(x) +#define htonll(x) __DARWIN_OSSwapInt64(x) + #define NTOHL(x) (x) = ntohl((__uint32_t)x) #define NTOHS(x) (x) = ntohs((__uint16_t)x) +#define NTOHLL(x) (x) = ntohll((__uint64_t)x) #define HTONL(x) (x) = htonl((__uint32_t)x) #define HTONS(x) (x) = htons((__uint16_t)x) +#define HTONLL(x) (x) = htonll((__uint64_t)x) #endif /* defined(KERNEL) || (!defined(_POSIX_C_SOURCE) || defined(_DARWIN_C_SOURCE)) */ #endif /* __DARWIN_BYTE_ORDER */ #endif /* !_SYS__ENDIAN_H_ */