KallistiOS git master
Independent SDK for the Sega Dreamcast
Loading...
Searching...
No Matches

Compile-time checks against KOS's current version. More...

Macros

#define KOS_VERSION_ABOVE(major, minor, patch)
 Compile-time check for being above a given KOS version.
 
#define KOS_VERSION_MIN(major, minor, patch)
 Compile-time check for a minimum KOS version.
 
#define KOS_VERSION_IS(major, minor, patch)
 Compile-time check for an exact KOS version.
 
#define KOS_VERSION_MAX(major, minor, patch)
 Compile-time check for a maximum KOS version.
 
#define KOS_VERSION_BELOW(major, minor, patch)
 Compile-time check for being below a given KOS version.
 

Detailed Description

Compile-time checks against KOS's current version.

This API provides several utility macros to check for a particular exact, min, or max compile-time version for KOS.

They are meant to be used with the preprocessor like so:

#if KOS_VERSION_MIN(2, 0, 0)
// Do something requiring at least KOS 2.0.0 to compile.
#elif KOS_VERSION_BELOW(2, 5, 1)
// Do something that was deprecated in KOS 2.5.1.
#elif KOS_VERSION_IS(3, 1, 2)
// Do something for an exact version match.
#endif

Macro Definition Documentation

◆ KOS_VERSION_ABOVE

#define KOS_VERSION_ABOVE ( major,
minor,
patch )
Value:
KOS_VERSION_MAKE_ABOVE(major, minor, patch, KOS_VERSION)
#define KOS_VERSION
KOS's current version as an integer ID.
Definition version.h:105
#define KOS_VERSION_MAKE_ABOVE(major, minor, patch, version)
Creates a check for being above a given version.
Definition version.h:307

Compile-time check for being above a given KOS version.

Checks to see whether the current KOS version is higher than the given version.

Parameters
majorMajor version component.
minorMinor version component.
patchPatch version component.
Return values
trueKOS's version is higher.
falseKOS's version is the same or lower.

◆ KOS_VERSION_BELOW

#define KOS_VERSION_BELOW ( major,
minor,
patch )
Value:
KOS_VERSION_MAKE_BELOW(major, minor, patch, KOS_VERSION)
#define KOS_VERSION_MAKE_BELOW(major, minor, patch, version)
Creates a check for being below a given version.
Definition version.h:380

Compile-time check for being below a given KOS version.

Checks to see whether the current KOS version is lower than the given version.

Parameters
majorMajor version component.
minorMinor version component.
patchPatch version component.
Return values
trueKOS's version is lower.
falseKOS's version is the same or higher.

◆ KOS_VERSION_IS

#define KOS_VERSION_IS ( major,
minor,
patch )
Value:
KOS_VERSION_MAKE_IS(major, minor, patch, KOS_VERSION)
#define KOS_VERSION_MAKE_IS(major, minor, patch, version)
Creates an exact version check.
Definition version.h:343

Compile-time check for an exact KOS version.

Checks to see whether the current KOS version matches the given version.

Parameters
majorMajor version component.
minorMinor version component.
patchPatch version component.
Return values
trueKOS's version is the same.
falseKOS's version is different.

◆ KOS_VERSION_MAX

#define KOS_VERSION_MAX ( major,
minor,
patch )
Value:
KOS_VERSION_MAKE_MAX(major, minor, patch, KOS_VERSION)
#define KOS_VERSION_MAKE_MAX(major, minor, patch, version)
Creates a maximum version check.
Definition version.h:362

Compile-time check for a maximum KOS version.

Checks to see whether the current KOS version is the same or lower than the given version.

Parameters
majorMajor version component.
minorMinor version component.
patchPatch version component.
Return values
trueKOS's version is the the same or lower.
falseKOS's version is higher.

◆ KOS_VERSION_MIN

#define KOS_VERSION_MIN ( major,
minor,
patch )
Value:
KOS_VERSION_MAKE_MIN(major, minor, patch, KOS_VERSION)
#define KOS_VERSION_MAKE_MIN(major, minor, patch, version)
Creates a minimum version check.
Definition version.h:325

Compile-time check for a minimum KOS version.

Checks to see whether the current KOS version is the same or higher than the given version.

Parameters
majorMajor version component.
minorMinor version component.
patchPatch version component.
Return values
trueKOS's version is the same or higher.
falseKOS's version is lower.