DoorKeeper/src/platform.h

72 lines
1.9 KiB
C
Raw Normal View History

#ifndef id054C8BCA27C84EAA825922EC0A4F3317
#define id054C8BCA27C84EAA825922EC0A4F3317
#if defined(__ANDROID__)
# define DK_POSIX
# define DK_ANDROID
# define DK_MOBILE
#elif defined(SAILFISHOS)
# define DK_POSIX
# define DK_SAILFISHOS
# define DK_MOBILE
#elif defined(__gnu_linux__) || defined(__linux__) || defined(linux)
# define DK_POSIX
# define DK_LINUX
# define DK_PC
#elif defined(_WIN16) || defined(_WIN32) || defined(_WIN64) || \
defined(__WIN32__) || defined(__TOS_WIN__) || defined(__WINDOWS__)
# if defined(_WIN32) || defined(__WIN32__)
# define DK_WIN32
# endif
# define DK_WINDOWS
# define DK_PC
#else
# error "Unknown platform"
#endif
#if defined(__amd64__) || defined(__amd64) || defined(__x86_64__) || \
defined(__x86_64) || defined(_M_X64) || defined(_M_AMD64)
# define DK_X86_64
# define DK_64_BIT
#elif defined(__arm__)
# if defined(__ARM_ARCH_6__)
# define DK_ARM_VERSION 6
# elif defined(__ARM_ARCH_7__)
# define DK_ARM_VERSION 7
# else
# error "Unknown ARM version"
# endif
# define DK_32_BIT
# define DK_ARM
#elif defined(_M_ARM)
# if _M_ARM != 6 && _M_ARM != 7
# error "Unknown ARM version"
# endif
# define DK_ARM_VERSION _M_ARM
# define DK_32_BIT
# define DK_ARM
#elif defined(__TARGET_ARCH_ARM)
# if __TARGET_ARCH_ARM != 6 && __TARGET_ARCH_ARM != 7
# error "Unknown ARM version"
# endif
# define DK_ARM_VERSION __TARGET_ARCH_ARM
# define DK_32_BIT
# define DK_ARM
#elif defined(__aarch64__)
# define DK_ARM
# define DK_64_BIT
#elif defined(i386) || defined(__i386) || defined(__i386__) || \
defined(__i486__) || defined(__i586__) || defined(__i686__) || \
defined(_M_I86) || defined(_M_IX86) || defined(_X86_) || defined(__INTEL__)
# define DK_X86
# define DK_32_BIT
#elif defined(__ia64__) || defined(_IA64) || defined(__IA64__) || \
defined(_M_IA64) || defined(__itanium__)
# define DK_IA64
# define DK_64_BIT
#else
# error "Unknown architecture"
#endif
#endif