summaryrefslogtreecommitdiffstats
path: root/core/version.h
diff options
context:
space:
mode:
Diffstat (limited to 'core/version.h')
-rw-r--r--core/version.h48
1 files changed, 44 insertions, 4 deletions
diff --git a/core/version.h b/core/version.h
index 18a97cadf0..46f137f084 100644
--- a/core/version.h
+++ b/core/version.h
@@ -41,7 +41,7 @@
#define _MKSTR(m_x) _STR(m_x)
#endif
-// Godot versions are of the form <major>.<minor> for the initial release,
+// Redot versions are of the form <major>.<minor> for the initial release,
// and then <major>.<minor>.<patch> for subsequent bugfix releases where <patch> != 0
// That's arbitrary, but we find it pretty and it's the current policy.
@@ -62,7 +62,7 @@
// Example: 3.1.4 will be 0x030104, making comparison easy from script.
#define VERSION_HEX 0x10000 * VERSION_MAJOR + 0x100 * VERSION_MINOR + VERSION_PATCH
-// Describes the full configuration of that Godot version, including the version number,
+// Describes the full configuration of that Redot version, including the version number,
// the status (beta, stable, etc.) and potential module-specific features (e.g. mono).
// Example: "3.1.4.stable.mono"
#define VERSION_FULL_CONFIG VERSION_NUMBER "." VERSION_STATUS VERSION_MODULE_CONFIG
@@ -72,8 +72,8 @@
// Example: "3.1.4.stable.mono.official"
#define VERSION_FULL_BUILD VERSION_FULL_CONFIG "." VERSION_BUILD
-// Same as above, but prepended with Godot's name and a cosmetic "v" for "version".
-// Example: "Godot v3.1.4.stable.official.mono"
+// Same as above, but prepended with Redot's name and a cosmetic "v" for "version".
+// Example: "Redot v3.1.4.stable.official.mono"
#define VERSION_FULL_NAME VERSION_NAME " v" VERSION_FULL_BUILD
// Git commit hash, generated at build time in `core/version_hash.gen.cpp`.
@@ -83,4 +83,44 @@ extern const char *const VERSION_HASH;
// Set to 0 if unknown.
extern const uint64_t VERSION_TIMESTAMP;
+// Defines the main "branch" version. Patch versions in this branch should be
+// forward-compatible.
+// Example: "3.1"
+#define GODOT_VERSION_BRANCH _MKSTR(GODOT_VERSION_MAJOR) "." _MKSTR(GODOT_VERSION_MINOR)
+#if GODOT_VERSION_PATCH
+// Example: "3.1.4"
+#define GODOT_VERSION_NUMBER GODOT_VERSION_BRANCH "." _MKSTR(GODOT_VERSION_PATCH)
+#else // patch is 0, we don't include it in the "pretty" version number.
+// Example: "3.1" instead of "3.1.0"
+#define GODOT_VERSION_NUMBER GODOT_VERSION_BRANCH
+#endif // GODOT_VERSION_PATCH
+
+// Version number encoded as hexadecimal int with one byte for each number,
+// for easy comparison from code.
+// Example: 3.1.4 will be 0x030104, making comparison easy from script.
+#define GODOT_VERSION_HEX 0x10000 * GODOT_VERSION_MAJOR + 0x100 * GODOT_VERSION_MINOR + GODOT_VERSION_PATCH
+
+// TODO: determine how to deal with godot compatible versioning behavior
+
+// Describes the full configuration of that Redot version, including the version number,
+// the status (beta, stable, etc.) and potential module-specific features (e.g. mono).
+// Example: "3.1.4.stable.mono"
+// #define GODOT_VERSION_FULL_CONFIG VERSION_NUMBER "." GODOT_VERSION_STATUS VERSION_MODULE_CONFIG
+
+// Similar to GODOT_VERSION_FULL_CONFIG, but also includes the (potentially custom) VERSION_BUILD
+// description (e.g. official, custom_build, etc.).
+// Example: "3.1.4.stable.mono.official"
+// #define GODOT_VERSION_FULL_BUILD GODOT_VERSION_FULL_CONFIG "." GODOT_VERSION_BUILD
+
+// Same as above, but prepended with Redot's name and a cosmetic "v" for "version".
+// Example: "Godot v3.1.4.stable.official.mono"
+// #define GODOT_VERSION_FULL_NAME GODOT_VERSION_NAME " v" GODOT_VERSION_FULL_BUILD
+
+// Git commit hash, generated at build time in `core/version_hash.gen.cpp`.
+// extern const char *const GODOT_VERSION_HASH;
+
+// Git commit date UNIX timestamp (in seconds), generated at build time in `core/version_hash.gen.cpp`.
+// Set to 0 if unknown.
+// extern const uint64_t GODOT_VERSION_TIMESTAMP;
+
#endif // VERSION_H