25#ifndef JAU_OS_SUPPORT_HPP_
26#define JAU_OS_SUPPORT_HPP_
65 #if defined(__EMSCRIPTEN__)
66 #define JAU_OS_TYPE_UNIX 1
67 #define JAU_OS_TYPE_WASM 1
68 #if defined(__EMSCRIPTEN_PTHREADS__)
69 #define JAU_OS_HAS_PTHREAD 1
71 #define JAU_OS_HAS_PTHREAD 0
73 return 0b00000001000000000000000000000001U;
74 #elif defined(__QNXNTO__)
75 #define JAU_OS_TYPE_UNIX 1
76 #define JAU_OS_TYPE_QNXNTO 1
77 #define JAU_OS_HAS_PTHREAD 1
78 return 0b00000000000000000001000000000001U;
79 #elif defined(__APPLE__) && defined(__MACH__)
80 #define JAU_OS_TYPE_UNIX 1
81 #define JAU_OS_TYPE_DARWIN 1
82 #define JAU_OS_HAS_PTHREAD 1
83 return 0b00000000000000000000100000000001U;
84 #elif defined(__FreeBSD__)
85 #define JAU_OS_TYPE_UNIX 1
86 #define JAU_OS_TYPE_FREEBSD 1
87 #define JAU_OS_HAS_PTHREAD 1
88 return 0b00000000000000000000010000000001U;
89 #elif defined(__ANDROID__)
90 #define JAU_OS_TYPE_UNIX 1
91 #define JAU_OS_TYPE_ANDROID 1
92 #define JAU_OS_HAS_PTHREAD 1
93 return 0b00000000000000000000001100000001U;
94 #elif defined(__linux__)
95 #define JAU_OS_TYPE_UNIX 1
96 #define JAU_OS_TYPE_LINUX 1
97 #define JAU_OS_HAS_PTHREAD 1
98 return 0b00000000000000000000000100000001U;
100 #define JAU_OS_TYPE_WINDOWS 1
101 #define JAU_OS_HAS_PTHREAD 1
102 return 0b00000000000000000000000000000010U;
104 #define JAU_OS_TYPE_UNIX 1
105 #define JAU_OS_HAS_PTHREAD 1
106 return 0b00000000000000000000000000000001U;
116 Unix = 0b00000000000000000000000000000001U,
118 Windows = 0b00000000000000000000000000000010U,
120 Linux = 0b00000000000000000000000100000001U,
122 Android = 0b00000000000000000000001100000001U,
124 FreeBSD = 0b00000000000000000000010000000001U,
126 Darwin = 0b00000000000000000000100000000001U,
128 QnxNTO = 0b00000000000000000001000000000001U,
130 GenWasm = 0b00000001000000000000000000000000U,
199 #if JAU_OS_HAS_PTHREAD
216 sb.append(
", node ").append(
nodename);
221 sb.append(
", ").append(
version);
250 #if defined(__EMSCRIPTEN__)
256 #if defined(__EMSCRIPTEN__)
static const CpuInfo & get() noexcept
Returns reference to const singleton instance.
endian_t
Endian identifier, indicating endianess of all scalar types.
@ native
Identifier for native platform type, one of the above.
#define JAU_MAKE_ENUM_STRING(type,...)
#define constexpr_cxx20
constexpr qualifier replacement for C++20 constexpr.
#define JAU_MAKE_BITFIELD_ENUM_STRING(type,...)
constexpr bool is_set(const E mask, const E bits) noexcept
constexpr_cxx20 std::string dir_separator() noexcept
Returns the OS's path separator as a string, e.g.
std::string get_os_and_arch() noexcept
Returns this hosts's common name, see get_os_and_arch()
constexpr bool is_defined_os_type(const os_type_t v) noexcept
Evaluates true if the given os_type is defined, i.e.
std::string get_platform_info() noexcept
constexpr bool is_freebsd() noexcept
Evaluates true if platform os_type::native contains os_type::FreeBSD.
bool get_rt_os_info(RuntimeOSInfo &info) noexcept
constexpr char path_separator_char() noexcept
Returns the OS's path separator character, e.g.
constexpr bool is_darwin() noexcept
Evaluates true if platform os_type::native contains os_type::Darwin.
constexpr bool is_emscripten() noexcept
Evaluates true if platform os_type::native contains os_type::Emscripten.
constexpr bool has_pthread() noexcept
Evaluates true if platform supports posix compatible threading.
os_type_t
OS type bits and unique IDs.
constexpr bool is_unix() noexcept
Evaluates true if platform os_type::native contains os_type::Unix.
constexpr bool is_linux() noexcept
Evaluates true if platform os_type::native contains os_type::Linux.
constexpr_cxx20 std::string path_separator() noexcept
Returns the OS's path separator as a string, e.g.
constexpr bool is_qnxnto() noexcept
Evaluates true if platform os_type::native contains os_type::QnxNTO.
constexpr bool is_android() noexcept
Evaluates true if platform os_type::native contains os_type::Android.
constexpr bool is_windows() noexcept
Evaluates true if platform os_type::native contains os_type::Windows.
constexpr char dir_separator_char() noexcept
Returns the OS's path separator character, e.g.
abi_type_t get_abi_type() noexcept
constexpr bool is_generic_wasm() noexcept
Evaluates true if platform os_type::native contains os_type::GenWasm.
@ Emscripten
WebAssembly with Unix/Posix suport bit (emscripten)
@ Unix
Unix bit, contained by: linux, android, freebsd, darwin.
@ native
Identifier for native OS type, one of the above.
@ FreeBSD
FreeBSD bit, includes: unix.
@ Darwin
Darwin (Apple OSX and iOS) bit, includes: unix.
@ GenWasm
Generic WebAssembly bit.
@ QnxNTO
QNX NTO (>= 6) bit, includes: unix.
@ Android
Android bit, includes: linux and unix.
@ Linux
Linux bit, contained by: android; includes: unix.
@ wasm32_gen
WASM Generic (32bit)
@ wasm64_gen
WASM Generic (64bit)
@ gnu_armel
ARM GNU-EABI ARMEL -mfloat-abi=softfp.
@ wasm32_ems
WASM Emscripten (32bit)
@ wasm64_ems
WASM Emscripten (64bit)
@ aarch64
ARM EABI AARCH64 (64bit)
@ gnu_armhf
ARM GNU-EABI ARMHF -mfloat-abi=hard.
@ wasm64
WebAssembly 64-bit.
@ wasm32
WebAssembly 32-bit.
Author: Sven Gothel sgothel@jausoft.com Copyright Gothel Software e.K.
constexpr uint32_t get_host_os_id() noexcept
Author: Sven Gothel sgothel@jausoft.com Copyright (c) 2024 Gothel Software e.K.
std::string to_string() noexcept