diff options
author | cbdev <cb@cbcdn.com> | 2019-12-07 20:22:03 +0100 |
---|---|---|
committer | cbdev <cb@cbcdn.com> | 2019-12-07 20:22:03 +0100 |
commit | f95dae04478b32fccaf7c6ebe1ecfd4e2fef1358 (patch) | |
tree | 6f545dc81166ee1a0f1b21b5245a70bcbf05751d /portability.h | |
parent | 534207d16314a4f6a69d36cf2305a3fe435a769b (diff) | |
parent | 1bb3b9a3eaf94af045c39a1ff1ee8bf9b8e5b8ec (diff) | |
download | midimonster-f95dae04478b32fccaf7c6ebe1ecfd4e2fef1358.tar.gz midimonster-f95dae04478b32fccaf7c6ebe1ecfd4e2fef1358.tar.bz2 midimonster-f95dae04478b32fccaf7c6ebe1ecfd4e2fef1358.zip |
Merge current master
Diffstat (limited to 'portability.h')
-rw-r--r-- | portability.h | 25 |
1 files changed, 24 insertions, 1 deletions
diff --git a/portability.h b/portability.h index 71d72fc..f0bfd07 100644 --- a/portability.h +++ b/portability.h @@ -1,5 +1,7 @@ #ifdef __APPLE__ - #define CLOCK_MONOTONIC_RAW _CLOCK_MONOTONIC_RAW + #ifndef CLOCK_MONOTONIC_COARSE + #define CLOCK_MONOTONIC_COARSE _CLOCK_MONOTONIC_RAW + #endif #include <libkern/OSByteOrder.h> #define htobe16(x) OSSwapHostToBigInt16(x) @@ -17,3 +19,24 @@ #define be64toh(x) OSSwapBigToHostInt64(x) #define le64toh(x) OSSwapLittleToHostInt64(x) #endif + +#ifdef _WIN32 + #define WIN32_LEAN_AND_MEAN + #include <windows.h> + #include <winsock2.h> + + #define htobe16(x) htons(x) + #define be16toh(x) ntohs(x) + + #define htobe32(x) htonl(x) + #define be32toh(x) ntohl(x) + + #define htobe64(x) _byteswap_uint64(x) + #define htole64(x) (x) + #define be64toh(x) _byteswap_uint64(x) + #define le64toh(x) (x) + + #define PRIsize_t "Iu" +#else + #define PRIsize_t "zu" +#endif |