Loading...
Searching...
No Matches
version.h
Go to the documentation of this file.
1
15
16#pragma once
17
18#include <stdint.h>
19
20#ifdef __cplusplus
21extern "C" {
22#endif
23
30enum {
37};
38
51#define LIARA_MAKE_VERSION(major, minor, patch) \
52 (((uint32_t)(major) << 22) | ((uint32_t)(minor) << 12) | (uint32_t)(patch))
53
67static inline uint32_t liara_make_version(uint32_t major, uint32_t minor, uint32_t patch) { return LIARA_MAKE_VERSION(major, minor, patch); }
68
79#define LIARA_VERSION_MAJOR(v) (((uint32_t)(v) >> 22) & 0x3FFu)
80
91#define LIARA_VERSION_MINOR(v) (((uint32_t)(v) >> 12) & 0x3FFu)
92
103#define LIARA_VERSION_PATCH(v) ((uint32_t)(v) & 0xFFFu)
104
116static inline uint32_t liara_version_major(uint32_t v) { return LIARA_VERSION_MAJOR(v); }
117
129static inline uint32_t liara_version_minor(uint32_t v) { return LIARA_VERSION_MINOR(v); }
130
142static inline uint32_t liara_version_patch(uint32_t v) { return LIARA_VERSION_PATCH(v); }
143
152#define LIARA_INTERFACE_VERSION \
153 LIARA_MAKE_VERSION( \
154 LIARA_INTERFACE_VERSION_MAJOR, \
155 LIARA_INTERFACE_VERSION_MINOR, \
156 LIARA_INTERFACE_VERSION_PATCH)
157
168static inline uint32_t liara_interface_version(void) { return LIARA_INTERFACE_VERSION; }
169
170#ifdef __cplusplus
171}
172#endif
static uint32_t liara_version_major(uint32_t v)
Inline function to extract the major version component from a combined version number.
Definition version.h:116
#define LIARA_MAKE_VERSION(major, minor, patch)
Create a version number from major, minor, and patch components.
Definition version.h:51
static uint32_t liara_version_minor(uint32_t v)
Inline function to extract the minor version component from a combined version number.
Definition version.h:129
static uint32_t liara_interface_version(void)
Inline function to get the current version of the Liara interface.
Definition version.h:168
#define LIARA_INTERFACE_VERSION
The current version of the Liara interface.
Definition version.h:152
#define LIARA_VERSION_PATCH(v)
Extract the patch version component from a combined version number.
Definition version.h:103
@ LIARA_INTERFACE_VERSION_MAJOR
Definition version.h:32
@ LIARA_INTERFACE_VERSION_PATCH
Definition version.h:36
@ LIARA_INTERFACE_VERSION_MINOR
Definition version.h:34
static uint32_t liara_version_patch(uint32_t v)
Inline function to extract the patch version component from a combined version number.
Definition version.h:142
#define LIARA_VERSION_MAJOR(v)
Extract the major version component from a combined version number.
Definition version.h:79
#define LIARA_VERSION_MINOR(v)
Extract the minor version component from a combined version number.
Definition version.h:91
static uint32_t liara_make_version(uint32_t major, uint32_t minor, uint32_t patch)
Inline function to create a version number from major, minor, and patch components.
Definition version.h:67