package = io.ktor.utils.io.bits.internal.utils
compilerOpts.ios = -DM_DARWIN
compilerOpts.osx = -DM_DARWIN
compilerOpts.watchos = -DM_DARWIN
compilerOpts.tvos = -DM_DARWIN
compilerOpts.mingw = -DMINGW
compilerOpts.x64 = -DM_ALLOW_UNALIGNED_ACCESS
compilerOpts.x86 = -DM_ALLOW_UNALIGNED_ACCESS
compilerOpts.arm64 = -DM_ALLOW_UNALIGNED_ACCESS
---

#ifdef M_ALLOW_UNALIGNED_ACCESS
#define UNALIGNED_ACCESS_ALLOWED 1
#else
#define UNALIGNED_ACCESS_ALLOWED 0
#endif

#if defined(M_DARWIN)
#include <machine/endian.h>
#elif defined(MINGW)
// nothing
#else
#include <endian.h>
#endif

#ifdef MINGW
#define PLATFORM_BIG_ENDIAN 0
#elif (BYTE_ORDER == BIG_ENDIAN)
#define PLATFORM_BIG_ENDIAN 1
#else
#define PLATFORM_BIG_ENDIAN 0
#endif
