Zth (libzth)
version.h
Go to the documentation of this file.
1 #ifndef ZTH_VERSION_H
2 #define ZTH_VERSION_H
3 /*
4  * Zth (libzth), a cooperative userspace multitasking library.
5  * Copyright (C) 2019-2022 Jochem Rutgers
6  *
7  * This Source Code Form is subject to the terms of the Mozilla Public
8  * License, v. 2.0. If a copy of the MPL was not distributed with this
9  * file, You can obtain one at https://mozilla.org/MPL/2.0/.
10  */
11 
12 #include <libzth/util.h>
13 
14 // clang-format off
15 #define ZTH_VERSION_MAJOR 1
16 #define ZTH_VERSION_MINOR 1
17 #define ZTH_VERSION_PATCH 1
18 #define ZTH_VERSION_SUFFIX "-alpha"
19 // clang-format on
20 
47 #define ZTH_VERSION \
48  ZTH_STRINGIFY(ZTH_VERSION_MAJOR) \
49  "." ZTH_STRINGIFY(ZTH_VERSION_MINOR) "." ZTH_STRINGIFY(ZTH_VERSION_PATCH) ZTH_VERSION_SUFFIX
50 
60 #define ZTH_VERSION_NUM (ZTH_VERSION_MAJOR * 10000L + ZTH_VERSION_MINOR * 100L + ZTH_VERSION_PATCH)
61 
62 #ifdef __cplusplus
63 namespace zth {
68 ZTH_EXPORT constexpr inline char const* version() noexcept
69 {
70  return ZTH_VERSION;
71 }
72 } // namespace zth
73 
79 EXTERN_C ZTH_EXPORT ZTH_INLINE char const* zth_version() noexcept
80 {
81  return zth::version();
82 }
83 #else // !__cplusplus
84 ZTH_EXPORT char const* zth_version();
85 #endif // __cplusplus
86 
87 #endif // ZTH_VERSION_H
char const * zth_version() noexcept
Returns the version of Zth.
Definition: version.h:79
#define ZTH_VERSION
Zth version as string literal.
Definition: version.h:47
constexpr char const * version() noexcept
Returns the version of Zth.
Definition: version.h:68
#define ZTH_INLINE
Definition: macros.h:130
Definition: allocator.h:23