Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 15 additions & 0 deletions src/native/endian.h
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,21 @@
#define be64toh(x) OSSwapBigToHostInt64(x)
#define le64toh(x) OSSwapLittleToHostInt64(x)

#elif defined(__MINIOS__)

#include <endian.h>
#include <byteswap.h>

#if (BYTE_ORDER == LITTLE_ENDIAN)
#define htobe64(x) (bswap_64(x))
#define be64toh(x) (bswap_64(x))
#elif (BYTE_ORDER == BIG_ENDIAN)
#define htobe64(x) (x)
#define be64toh(x) (x)
#else
#error "Cannot determine byte order"
#endif

#else

/* Needs _DEFAULT_SOURCE with glibc */
Expand Down