diff options
author | chai <chaifix@163.com> | 2018-05-16 15:02:43 +0800 |
---|---|---|
committer | chai <chaifix@163.com> | 2018-05-16 15:02:43 +0800 |
commit | fdaf0e7eb6b9d9bdd7d5ab5f814f4ebbf791ff67 (patch) | |
tree | 6b9712381d6bce07554491acf900ec4b27e6ecb0 /src/utils/endian.h |
v0.1.0
Diffstat (limited to 'src/utils/endian.h')
-rw-r--r-- | src/utils/endian.h | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/src/utils/endian.h b/src/utils/endian.h new file mode 100644 index 0000000..df28ddb --- /dev/null +++ b/src/utils/endian.h @@ -0,0 +1,26 @@ +/** +* +*/ +#ifndef JIN_LIL_ENDIAN && JIN_BIG_ENDIAN + +#define JIN_LIL_ENDIAN 2 +#define JIN_BIG_ENDIAN 4 + +#endif + +#ifndef JIN_BYTEORDER +#ifdef __linux__ +#include <endian.h> +#define JIN_BYTEORDER __BYTE_ORDER +#else /* __linux__ */ +#if defined(__hppa__) || \ + defined(__m68k__) || defined(mc68000) || defined(_M_M68K) || \ + (defined(__MIPS__) && defined(__MISPEB__)) || \ + defined(__ppc__) || defined(__POWERPC__) || defined(_M_PPC) || \ + defined(__sparc__) +#define JIN_BYTEORDER JIN_BIG_ENDIAN +#else +#define JIN_BYTEORDER JIN_LIL_ENDIAN +#endif +#endif /* __linux__ */ +#endif /* !SDL_BYTEORDER */
\ No newline at end of file |