ThreadSchedule 3.0.0
Modern C++ thread management library
Loading...
Searching...
No Matches
runtime.hpp
Go to the documentation of this file.
1#pragma once
2
8#include "export.hpp"
9
10#include <cstdint>
11
12namespace threadschedule
13{
14
16enum class build_mode : std::uint8_t
17{
22};
23
24#if defined(THREADSCHEDULE_RUNTIME)
25inline constexpr bool is_runtime_build = true;
27#else
28inline constexpr bool is_runtime_build = false;
29
30[[nodiscard]] inline constexpr auto
32{
34}
35#endif
36
37[[nodiscard]] inline constexpr auto
38build_mode_string() noexcept -> char const*
39{
40 return is_runtime_build ? "runtime" : "header-only";
41}
42
43} // namespace threadschedule
Export macros for ThreadSchedule's optional C++ runtime.
#define THREADSCHEDULE_API
Symbol visibility/import-export marker for runtime builds.
Definition export.hpp:22
constexpr auto build_mode_string() noexcept -> char const *
Definition runtime.hpp:38
build_mode
Describes whether ThreadSchedule uses inline storage or its shared runtime.
Definition runtime.hpp:17
@ header_only
Header-only mode: implementation is compiled into each translation unit.
@ runtime
Runtime mode: implementation is provided by the shared runtime library.
constexpr bool is_runtime_build
Definition runtime.hpp:28
constexpr auto current_build_mode() noexcept -> build_mode
Definition runtime.hpp:31