CyberEngineMkIII
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Pages
SystemChecks.hpp
Go to the documentation of this file.
1 #pragma once
2 
4 #if !defined(TARGET_OS_WINDOWS) && !defined(TARGET_OS_MAC) && !defined(TARGET_OS_LINUX)
5 #error CyberEngineMkIII must be compiled on Windows, OSX, or Linux
6 #endif
7 #if !defined(_M_X64) && !defined(__x86_64__)
8 #error CyberEngineMkIII must be compiled on an amd64 architecture CPU
9 #endif
10 
11 #ifdef FAKE_POSIX
12 #define __x86_64__
13 #define __LP64__
14 #endif
15 
17 #include <cstddef>
19 
20 static_assert(
21  sizeof(unsigned char) == 1
22  && sizeof(char) == 1
23  && sizeof(unsigned short) == 2
24  && sizeof(short) == 2
25  && sizeof(unsigned int) == 4
26  && sizeof(int) == 4
27  && sizeof(unsigned long long) == 8
28  && sizeof(long long) == 8
29  && sizeof(void*) == 8,
30  "A type size assertion failed");
31 static_assert(CYB::API::Endianess::Get() == CYB::API::Endianess::Type::LITTLE_ENDIAN, "CyberEngineMkIII relies on a little endian architecture");
32 
33 #ifndef ENABLE_TEST_HOOKS
34 #define ENABLE_TEST_HOOKS
35 #endif
static constexpr Type Get(void)
Get the endianess being compiled.