HikoGUI
A low latency retained GUI
Loading...
Searching...
No Matches
architecture.hpp
1// Copyright Take Vos 2019-2022.
2// Distributed under the Boost Software License, Version 1.0.
3// (See accompanying file LICENSE_1_0.txt or copy at https://www.boost.org/LICENSE_1_0.txt)
4
10#pragma once
11
12#include "../macros.hpp"
13
14#include <exception>
15#include <cstddef>
16#include <type_traits>
17#if defined(__APPLE__)
18#include <TargetConditionals.h>
19#endif
20
21hi_export_module(hikogui.utility.architecture);
22
23hi_export namespace hi::inline v1 {
24
25
26#if (HI_COMPILER == HI_CC_GCC || HI_COMPILER == HI_CC_CLANG)
27#if (HI_PROCESSOR == HI_CPU_X86_64 || HI_PROCESSOR == HI_CPU_ARM64)
28#if (HI_STD_LIBRARY == HI_STL_GCC || HI_STD_LIBRARY == HI_STL_LLVM)
29#define HI_HAS_INT128 1
30
33using int128_t = __int128;
34
37using uint128_t = unsigned __int128;
38
39#endif
40#endif
41#endif
42
43#if HI_OPERATING_SYSTEM == HI_OS_WINDOWS
44using os_handle = void *;
45//using file_handle = os_handle;
46using thread_id = uint32_t;
47constexpr std::size_t maximum_num_cpus = 64;
48
49#elif HI_OPERATING_SYSTEM == HI_OS_MACOS
50using os_handle = int;
51//using file_handle = int;
52using thread_id = uint32_t;
53constexpr std::size_t maximum_num_cpus = CPU_SETSIZE;
54
55#elif HI_OPERATING_SYSTEM == HI_OS_LINUX
56using os_handle = int;
57//using file_handle = int;
58using thread_id = uint32_t;
59constexpr std::size_t maximum_num_cpus = CPU_SETSIZE;
60
61#else
62#error "Not implemented."
63#endif
64
65
66} // namespace hi::inline v1
67
68namespace std {
69
70// Due to a bug in clang it will emit a undefined symbol to _Literal_zero_is_expected()
71// Which is only called from a consteval function (which should never emit code, ever).
72#if defined(__clang__) and defined(_CPPLIB_VER)
73inline void _Literal_zero_is_expected(void)
74{
76}
77#endif
78
79}
STL namespace.
DOXYGEN BUG.
Definition algorithm_misc.hpp:20
__int128 int128_t
Signed 128 bit integer.
Definition architecture.hpp:33
unsigned __int128 uint128_t
Unsigned 128 bit integer.
Definition architecture.hpp:37
T terminate(T... args)