source: CLRX/CLRadeonExtender/trunk/Check64Bit.cpp @ 4652

Last change on this file since 4652 was 3375, checked in by matszpk, 21 months ago

CLRadeonExtender: Make checking bitness more portable in CMakeLists.txt (bitness depends on compiler). remove obsolete a checking mingw64.

File size: 2.0 KB
Line 
1/* architecture setup */
2
3#if defined(__i386__) || defined(__i486__) || defined(__i586__) || defined(__i686__) || \
4        defined(_M_IX86) || defined(__i386) || defined(_X86_)
5#  define HAVE_ARCH_INTEL 1
6#  define HAVE_ARCH_X86 1
7#  define HAVE_32BIT 1
8#endif
9
10#if defined(__amd64__) || defined(__amd64) || defined(__x86_64__) || defined(__x86_64) || \
11        defined(_M_X64) || defined(_M_AMD64)
12#  define HAVE_ARCH_INTEL 1
13#  define HAVE_ARCH_X86_64 1
14#  define HAVE_64BIT 1
15#endif
16
17#if defined(__powerpc__) || defined(__powerpc) || defined(_M_PPC) || \
18    defined(__POWERPC__) || defined(__ppc)
19#  define HAVE_ARCH_POWERPC 1
20#  if defined(__powerpc64__) || defined(__ppc64__) || _M_PPC>=620 || defined(__arch64__)
21#    define HAVE_ARCH_POWERPC64 1
22#    define HAVE_64BIT 1
23#  else
24#    define HAVE_ARCH_POWERPC32 1
25#    define HAVE_32BIT 1
26#  endif
27#endif
28
29#if defined(__arm__) || defined(__thumb__) || defined(_M_ARM) || defined(_M_ARMT)
30#  define HAVE_ARCH_ARM 1
31#  if defined(__aarch64__)
32#    define HAVE_ARCH_ARM64 1
33#    define HAVE_64BIT 1
34#  else
35#    define HAVE_ARCH_ARM32 1
36#    define HAVE_32BIT 1
37#  endif
38#endif
39
40#if !defined(HAVE_ARCH_ARM) && defined(__aarch64__)
41#  define HAVE_ARCH_ARM 1
42#  define HAVE_ARCH_ARM64 1
43#  define HAVE_64BIT 1
44#endif
45
46/* endianness */
47#if defined(__BIG_ENDIAN__) || defined(__ARMEB__) || defined(__THUMBEB__) || \
48    defined(__AARCH64EB__) || defined(_MIPSEB)  || defined(__MIPSEB__) || \
49    defined(__MIPSEB)
50#  define HAVE_BIG_ENDIAN 1
51#else
52#  define HAVE_LITTLE_ENDIAN 1
53#endif
54
55/* machine bits */
56#if !defined(HAVE_32BIT) && !defined(HAVE_64BIT)
57#  ifdef _WIN64
58#    define HAVE_64BIT 1
59#  else
60#    ifdef _WIN32
61#      define HAVE_32BIT 1
62#    endif
63#  endif
64#endif
65
66#if !defined(HAVE_32BIT) && !defined(HAVE_64BIT)
67#  if defined(__SIZEOF_POINTER__) && __SIZEOF_POINTER__==8
68#    define HAVE_64BIT 1
69#  else
70#    define HAVE_32BIT 1
71#  endif
72#endif
73
74#ifdef HAVE_32BIT
75#error "This is not 64-bit system"
76#endif
77
78int main()
79{
80    return 0;
81}
Note: See TracBrowser for help on using the repository browser.