25#ifndef JAU_OS_SUPPORT_HPP_
26#define JAU_OS_SUPPORT_HPP_
64 #if defined(__EMSCRIPTEN__)
65 #define JAU_OS_TYPE_UNIX 1
66 #define JAU_OS_TYPE_WASM 1
67 return 0b00000001000000000000000000000001U;
68 #elif defined(__QNXNTO__)
69 #define JAU_OS_TYPE_UNIX 1
70 #define JAU_OS_TYPE_QNXNTO 1
71 return 0b00000000000000000001000000000001U;
72 #elif defined(__APPLE__) && defined(__MACH__)
73 #define JAU_OS_TYPE_UNIX 1
74 #define JAU_OS_TYPE_DARWIN 1
75 return 0b00000000000000000000100000000001U;
76 #elif defined(__FreeBSD__)
77 #define JAU_OS_TYPE_UNIX 1
78 #define JAU_OS_TYPE_FREEBSD 1
79 return 0b00000000000000000000010000000001U;
80 #elif defined(__ANDROID__)
81 #define JAU_OS_TYPE_UNIX 1
82 #define JAU_OS_TYPE_ANDROID 1
83 return 0b00000000000000000000001100000001U;
84 #elif defined(__linux__)
85 #define JAU_OS_TYPE_UNIX 1
86 #define JAU_OS_TYPE_LINUX 1
87 return 0b00000000000000000000000100000001U;
89 #define JAU_OS_TYPE_WINDOWS 1
90 return 0b00000000000000000000000000000010U;
92 #define JAU_OS_TYPE_UNIX 1
93 return 0b00000000000000000000000000000001U;
101 Unix = 0b00000000000000000000000000000001U,
103 Windows = 0b00000000000000000000000000000010U,
105 Linux = 0b00000000000000000000000100000001U,
107 Android = 0b00000000000000000000001100000001U,
109 FreeBSD = 0b00000000000000000000010000000001U,
111 Darwin = 0b00000000000000000000100000000001U,
113 QnxNTO = 0b00000000000000000001000000000001U,
115 GenWasm = 0b00000001000000000000000000000000U,
117 Emscripten = 0b00000001000000000000000000000001U,
122 return static_cast<uint32_t
>(rhs);
125 return static_cast<os_type_t>(~number(rhs));
152 return !(lhs == rhs);
155 return bits == (mask & bits);
233 sb.append(
", node ").append(
nodename);
238 sb.append(
", ").append(
version);
267 #if defined(__EMSCRIPTEN__)
273 #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 constexpr_cxx20
constexpr qualifier replacement for C++20 constexpr.
constexpr_cxx20 std::string dir_separator() noexcept
Returns the OS's path separator as a string, e.g.
constexpr os_type_t operator~(const os_type_t rhs) noexcept
constexpr os_type_t & operator&=(os_type_t &lhs, const os_type_t rhs) noexcept
constexpr bool operator!=(const os_type_t lhs, const os_type_t rhs) noexcept
constexpr bool is_defined_os_type(const os_type_t v) noexcept
Evaluates true if the given os_type is defined, i.e.
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_set(const os_type_t mask, const os_type_t bits) noexcept
constexpr os_type_t & operator^=(os_type_t &lhs, const os_type_t rhs) noexcept
constexpr bool is_emscripten() noexcept
Evaluates true if platform os_type::native contains os_type::Emscripten.
constexpr os_type_t operator|(const os_type_t lhs, const os_type_t rhs) noexcept
constexpr uint32_t number(const os_type_t rhs) noexcept
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 bool operator==(const os_type_t lhs, const os_type_t rhs) noexcept
constexpr abi_type_t get_abi_type(const jau::cpu::cpu_family_t cpu) noexcept
constexpr_cxx20 std::string path_separator() noexcept
Returns the OS's path separator as a string, e.g.
std::string get_os_and_arch(const os_type_t os, const jau::cpu::cpu_family_t cpu, const abi_type_t abi, const endian_t e) noexcept
Returns the common name for the given os_type, jau::cpu::cpu_family, abi_type and endian.
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 os_type_t operator&(const os_type_t lhs, const os_type_t rhs) noexcept
constexpr os_type_t operator^(const os_type_t lhs, const os_type_t rhs) noexcept
constexpr char dir_separator_char() noexcept
Returns the OS's path separator character, e.g.
constexpr os_type_t & operator|=(os_type_t &lhs, const os_type_t rhs) noexcept
std::string to_string(const os_type_t mask) noexcept
Return the string representation of os_type.
constexpr bool is_generic_wasm() noexcept
Evaluates true if platform os_type::native contains os_type::GenWasm.
std::string get_platform_info(std::string &sb) noexcept
@ 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.
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