mirror of
https://github.com/TerryCavanagh/VVVVVV.git
synced 2026-02-01 02:34:41 +03:00
Add ifversion
This command adds `ifversion`, as both a simplified and internal command. The system works like so: - `ifversion(2.6,script2)` -> If you're on 2.6.0 or greater - `ifversion(2.6.0,script2)` -> Same as above - `ifversion(2.6.3,script2)` -> You're using 2.6.3 or greater - `ifversion(2.5,script2)` -> You're using 2.5 or greater - `ifversion(2,script2)` -> You're using 2.0.0 or greater (yep...) `ReleaseVersion.h` has a few new defines to make this possible, being `MAJOR_VERSION`, `MINOR_VERSION` and `PATCH_VERSION`. With the help of a few macros, `RELEASE_VERSION` is now constructed using those.
This commit is contained in:
@@ -1,6 +1,17 @@
|
||||
#ifndef RELEASEVERSION_H
|
||||
#define RELEASEVERSION_H
|
||||
|
||||
#define RELEASE_VERSION "v2.5"
|
||||
#define MAJOR_VERSION 2
|
||||
#define MINOR_VERSION 5
|
||||
#define PATCH_VERSION 0
|
||||
|
||||
#define VVV_STRINGIFY(x) #x
|
||||
#define VVV_TOSTRING(x) VVV_STRINGIFY(x)
|
||||
|
||||
#if PATCH_VERSION == 0
|
||||
#define RELEASE_VERSION "v" VVV_TOSTRING(MAJOR_VERSION) "." VVV_TOSTRING(MINOR_VERSION)
|
||||
#else
|
||||
#define RELEASE_VERSION "v" VVV_TOSTRING(MAJOR_VERSION) "." VVV_TOSTRING(MINOR_VERSION) "." VVV_TOSTRING(PATCH_VERSION)
|
||||
#endif
|
||||
|
||||
#endif /* RELEASEVERSION_H */
|
||||
|
||||
Reference in New Issue
Block a user