diff --git a/tools/common.h b/tools/common.h index 0fa849f..34ef5ec 100644 --- a/tools/common.h +++ b/tools/common.h @@ -120,6 +120,12 @@ # define ntohll(x) ((uint64_t)ntohl((x) & 0xFFFFFFFF) << 32) | ntohl((uint64_t)(x) >> 32) # endif # endif +#elif defined(__APPLE__) +# if !defined(be64toh) +# include +# define be64toh(v) OSSwapBigToHostInt64(v) +# define htobe64(v) OSSwapHostToBigInt64(v) +# endif #endif #ifndef htonll