Arion 1.0.2-alpha
A high-performance C++ framework for emulating executable binaries.
 
Loading...
Searching...
No Matches
host_utils.hpp
Go to the documentation of this file.
1#ifndef ARION_HOST_UTILS_HPP
2#define ARION_HOST_UTILS_HPP
3
6
7namespace arion
8{
9
18{
19#if defined(__x86_64__) || defined(_M_X64)
21#elif defined(__i386__) || defined(_M_IX86)
22 return CPU_ARCH::X86_ARCH;
23#elif defined(__aarch64__) || defined(_M_ARM64)
25#elif defined(__arm__) || defined(_M_ARM)
26 return CPU_ARCH::ARM_ARCH;
27#else
28#error "Unsupported host CPU architecture"
29#endif
30 // The throw statement is technically unreachable due to the #error above,
31 // but kept for completeness if compilation proceeded without a known macro.
33}
34
35}; // namespace arion
36
37#endif // ARION_HOST_UTILS_HPP
Thrown when the host CPU architecture is not supported.
Definition global_excepts.hpp:359
Definition arch_x86-64.hpp:11
CPU_ARCH get_host_cpu_arch()
Definition host_utils.hpp:17
CPU_ARCH
Identifies a CPU architecture.
Definition global_defs.hpp:128
@ X8664_ARCH
The x86-64 CPU architecture.
Definition global_defs.hpp:134
@ X86_ARCH
The x86 CPU architecture.
Definition global_defs.hpp:132
@ ARM64_ARCH
The ARM64 CPU architecture.
Definition global_defs.hpp:138
@ ARM_ARCH
The ARM CPU architecture.
Definition global_defs.hpp:136