23#ifndef __KOS_VERSION_H
24#define __KOS_VERSION_H
100#define KOS_VERSION_MAJOR 2
101#define KOS_VERSION_MINOR 1
102#define KOS_VERSION_PATCH 0
106 KOS_VERSION_MAKE(KOS_VERSION_MAJOR, KOS_VERSION_MINOR, KOS_VERSION_PATCH)
109#define KOS_VERSION_STRING \
110 KOS_VERSION_MAKE_STRING(KOS_VERSION_MAJOR, \
149#define KOS_VERSION_ABOVE(major, minor, patch) \
150 KOS_VERSION_MAKE_ABOVE(major, minor, patch, KOS_VERSION)
165#define KOS_VERSION_MIN(major, minor, patch) \
166 KOS_VERSION_MAKE_MIN(major, minor, patch, KOS_VERSION)
179#define KOS_VERSION_IS(major, minor, patch) \
180 KOS_VERSION_MAKE_IS(major, minor, patch, KOS_VERSION)
194#define KOS_VERSION_MAX(major, minor, patch) \
195 KOS_VERSION_MAKE_MAX(major, minor, patch, KOS_VERSION)
210#define KOS_VERSION_BELOW(major, minor, patch) \
211 KOS_VERSION_MAKE_BELOW(major, minor, patch, KOS_VERSION)
251#define KOS_VERSION_MAKE(major, minor, patch) \
252 (((major) << 16) | ((minor) << 8) | (patch))
265#define KOS_VERSION_MAKE_STRING(major, minor, patch) \
266 KOS_STRINGIFY(major) "." \
267 KOS_STRINGIFY(minor) "." \
289#define KOS_VERSION_MAKE_COMPARISON(major, minor, patch, op, version) \
290 (KOS_VERSION_MAKE(major, minor, patch) op (version & 0xffffff))
307#define KOS_VERSION_MAKE_ABOVE(major, minor, patch, version) \
308 (KOS_VERSION_MAKE_COMPARISON(major, minor, patch, <, version))
325#define KOS_VERSION_MAKE_MIN(major, minor, patch, version) \
326 (KOS_VERSION_MAKE_COMPARISON(major, minor, patch, <=, version))
343#define KOS_VERSION_MAKE_IS(major, minor, patch, version) \
344 (KOS_VERSION_MAKE_COMPARISON(major, minor, patch, ==, version))
362#define KOS_VERSION_MAKE_MAX(major, minor, patch, version) \
363 (KOS_VERSION_MAKE_COMPARISON(major, minor, patch, >=, version))
380#define KOS_VERSION_MAKE_BELOW(major, minor, patch, version) \
381 (KOS_VERSION_MAKE_COMPARISON(major, minor, patch, >, version))
385#define KOS_STRINGIFY(str) #str
Definitions for builtin attributes and compiler directives.
bool kos_version_min(uint8_t major, uint16_t minor, uint8_t patch)
Minimum version run-time check for KOS.
bool kos_version_below(uint8_t major, uint16_t minor, uint8_t patch)
Below version run-time check for KOS.
bool kos_version_max(uint8_t major, uint16_t minor, uint8_t patch)
Maximum version run-time check for KOS.
bool kos_version_is(uint8_t major, uint16_t minor, uint8_t patch)
Exact version run-time check for KOS.
bool kos_version_above(uint8_t major, uint16_t minor, uint8_t patch)
Above version run-time check for KOS.
kos_version_t kos_version(void)
Returns the current KOS version ID at run-time.
const char * kos_version_string(void)
Returns the string representation of the current KOS version at run-time.
uint32_t kos_version_t
Type of a KOS version identifier.
Definition version.h:415