welder 0.1.0
Bindings for annotated C++ types, from C++26 reflection
Loading...
Searching...
No Matches
version.hpp
Go to the documentation of this file.
1#pragma once
2
14
15#define WELDER_VERSION_MAJOR 0
16#define WELDER_VERSION_MINOR 1
17#define WELDER_VERSION_PATCH 0
18
21#define WELDER_VERSION (WELDER_VERSION_MAJOR * 1000000 \
22 + WELDER_VERSION_MINOR * 1000 \
23 + WELDER_VERSION_PATCH)
24
25#define WELDER_DETAIL_VERSION_STR2(x) #x
26#define WELDER_DETAIL_VERSION_STR(x) WELDER_DETAIL_VERSION_STR2(x)
27
29#define WELDER_VERSION_STRING \
30 WELDER_DETAIL_VERSION_STR(WELDER_VERSION_MAJOR) "." \
31 WELDER_DETAIL_VERSION_STR(WELDER_VERSION_MINOR) "." \
32 WELDER_DETAIL_VERSION_STR(WELDER_VERSION_PATCH)
33
52#define WELDER_ABI_NAMESPACE v0
53
54namespace welder::inline WELDER_ABI_NAMESPACE {
55
58inline constexpr int version_major{WELDER_VERSION_MAJOR};
59inline constexpr int version_minor{WELDER_VERSION_MINOR};
60inline constexpr int version_patch{WELDER_VERSION_PATCH};
61
62} // namespace welder
63
64// Drift guard: the headers spell the ABI namespace literally (`v0`); if
65// WELDER_ABI_NAMESPACE ever diverges from them, the constant above lands in a
66// different inline namespace and this name fails to resolve.
67static_assert(::welder::v0::version_major == WELDER_VERSION_MAJOR,
68 "WELDER_ABI_NAMESPACE is out of sync with the `v0` the headers spell");
constexpr int version_major
welder's version as constexpr integers, for C++-level dispatch (the macros above serve the preprocess...
Definition version.hpp:58
constexpr int version_patch
Definition version.hpp:60
constexpr int version_minor
Definition version.hpp:59
#define WELDER_VERSION_MINOR
welder's minor version component.
Definition version.hpp:16
#define WELDER_VERSION_MAJOR
welder's major version component.
Definition version.hpp:15
#define WELDER_VERSION_PATCH
welder's patch version component.
Definition version.hpp:17