diff --git a/RewindClient.c b/RewindClient.c index e00bec7..389cf2f 100644 --- a/RewindClient.c +++ b/RewindClient.c @@ -2,7 +2,6 @@ #include #include -#include #include #include @@ -28,6 +27,29 @@ } #endif +#ifdef __linux__ +#include +#include +#endif + +#ifdef __MACH__ +#include +#include + +#define htobe16(value) OSSwapHostToBigInt16(value) +#define be16toh(value) OSSwapBigToHostInt16(value) +#define htobe32(value) OSSwapHostToBigInt32(value) +#define be32toh(value) OSSwapBigToHostInt32(value) + +#define htole16(value) OSSwapHostToLittleInt16(value) +#define le16toh(value) OSSwapLittleToHostInt16(value) +#define htole32(value) OSSwapHostToLittleInt32(value) +#define le32toh(value) OSSwapLittleToHostInt32(value) + +#define __bswap_16(value) OSSwapConstInt16(value) +#define __bswap_32(value) OSSwapConstInt32(value) +#endif + #define BUFFER_SIZE 256 #define CONNECTION_ATTEMPT_COUNT 5