Plasma Engine  2.0
Loading...
Searching...
No Matches
DetectArchitecture.h
1#pragma once
2
3#if defined(__clang__) || defined(__GNUC__)
4
5# if defined(__x86_64__) || defined(__i386__)
6# undef PL_PLATFORM_ARCH_X86
7# define PL_PLATFORM_ARCH_X86 PL_ON
8# elif defined(__arm__) || defined(__aarch64__)
9# undef PL_PLATFORM_ARCH_ARM
10# define PL_PLATFORM_ARCH_ARM PL_ON
11# else
12# error unhandled target architecture
13# endif
14
15# if defined(__x86_64__) || defined(__aarch64__)
16# undef PL_PLATFORM_64BIT
17# define PL_PLATFORM_64BIT PL_ON
18# elif defined(__i386__) || defined(__arm__)
19# undef PL_PLATFORM_32BIT
20# define PL_PLATFORM_32BIT PL_ON
21# else
22# error unhandled platform bit count
23# endif
24
25#elif defined(_MSC_VER)
26
27# if defined(_M_AMD64) || defined(_M_IX86)
28# undef PL_PLATFORM_ARCH_X86
29# define PL_PLATFORM_ARCH_X86 PL_ON
30# elif defined(_M_ARM) || defined(_M_ARM64)
31# undef PL_PLATFORM_ARCH_ARM
32# define PL_PLATFORM_ARCH_ARM PL_ON
33# else
34# error unhandled target architecture
35# endif
36
37# if defined(_M_AMD64) || defined(_M_ARM64)
38# undef PL_PLATFORM_64BIT
39# define PL_PLATFORM_64BIT PL_ON
40# elif defined(_M_IX86) || defined(_M_ARM)
41# undef PL_PLATFORM_32BIT
42# define PL_PLATFORM_32BIT PL_ON
43# else
44# error unhandled platform bit count
45# endif
46
47#else
48# error unhandled compiler
49#endif