welder 0.1.0
Bindings for annotated C++ types, from C++26 reflection
Loading...
Searching...
No Matches
version.hpp File Reference

welder's version identity and ABI namespace. More...

This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Namespaces

namespace  WELDER_ABI_NAMESPACE

Macros

#define WELDER_VERSION_MAJOR   0
 welder's major version component.
#define WELDER_VERSION_MINOR   1
 welder's minor version component.
#define WELDER_VERSION_PATCH   0
 welder's patch version component.
#define WELDER_VERSION
 One monotonically comparable number: major * 1'000'000 + minor * 1'000 + patch#if WELDER_VERSION >= 1000 reads "at least 0.1.0".
#define WELDER_DETAIL_VERSION_STR2(x)
#define WELDER_DETAIL_VERSION_STR(x)
#define WELDER_VERSION_STRING
 The version as a string literal, "major.minor.patch".
#define WELDER_ABI_NAMESPACE   v0
 The ABI namespace: every welder:: name actually lives in this inline namespace (namespace welder { … } throughout the headers).

Variables

constexpr int WELDER_ABI_NAMESPACE::version_major {WELDER_VERSION_MAJOR}
 welder's version as constexpr integers, for C++-level dispatch (the macros above serve the preprocessor).
constexpr int WELDER_ABI_NAMESPACE::version_minor {WELDER_VERSION_MINOR}
constexpr int WELDER_ABI_NAMESPACE::version_patch {WELDER_VERSION_PATCH}

Detailed Description

welder's version identity and ABI namespace.

The three version components below are the single source of truth: the top-level CMakeLists.txt parses them for project(welder VERSION …) and conanfile.py reads them the same way — bump them here only.

Note
Intentionally free of any standard-library include (like the rest of the vocabulary), and free of any reflection use — safe to include from a TU compiled under any language level when all you need is the version.

Definition in file version.hpp.

Macro Definition Documentation

◆ WELDER_ABI_NAMESPACE

#define WELDER_ABI_NAMESPACE   v0

The ABI namespace: every welder:: name actually lives in this inline namespace (namespace welder { … } throughout the headers).

Inline, so it is invisible in source — you spell welder::weld, welder::welder<Rod> as ever — but it is part of the mangled symbol names. welder is header-only: every TU instantiates its own copy of the templates it uses, and when two libraries built against different welder versions are linked into one binary, the linker would otherwise silently merge those (weak) symbols across versions — an ODR violation with undefined behavior. Versioned, the two sets of symbols stay distinct: each library runs the welder it was built with, and mixing welder types across the two fails loudly (different types) instead of corrupting silently.

Bumped only on ABI-breaking releases, not on every version. The headers spell the namespace literally (v0); this macro is for code that needs to name* the ABI namespace programmatically, and the guard below keeps the two in sync.

Definition at line 52 of file version.hpp.

◆ WELDER_DETAIL_VERSION_STR

#define WELDER_DETAIL_VERSION_STR ( x)
Value:
#define WELDER_DETAIL_VERSION_STR2(x)
Definition version.hpp:25

Definition at line 26 of file version.hpp.

◆ WELDER_DETAIL_VERSION_STR2

#define WELDER_DETAIL_VERSION_STR2 ( x)
Value:
#x

Definition at line 25 of file version.hpp.

◆ WELDER_VERSION

#define WELDER_VERSION
Value:
#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

One monotonically comparable number: major * 1'000'000 + minor * 1'000 + patch#if WELDER_VERSION >= 1000 reads "at least 0.1.0".

Definition at line 21 of file version.hpp.

◆ WELDER_VERSION_MAJOR

#define WELDER_VERSION_MAJOR   0

welder's major version component.

Definition at line 15 of file version.hpp.

◆ WELDER_VERSION_MINOR

#define WELDER_VERSION_MINOR   1

welder's minor version component.

Definition at line 16 of file version.hpp.

◆ WELDER_VERSION_PATCH

#define WELDER_VERSION_PATCH   0

welder's patch version component.

Definition at line 17 of file version.hpp.

◆ WELDER_VERSION_STRING

#define WELDER_VERSION_STRING
Value:
WELDER_DETAIL_VERSION_STR(WELDER_VERSION_MINOR) "." \
WELDER_DETAIL_VERSION_STR(WELDER_VERSION_PATCH)
#define WELDER_DETAIL_VERSION_STR(x)
Definition version.hpp:26

The version as a string literal, "major.minor.patch".

Definition at line 29 of file version.hpp.