diff options
Diffstat (limited to 'core/version.h')
-rw-r--r-- | core/version.h | 17 |
1 files changed, 11 insertions, 6 deletions
diff --git a/core/version.h b/core/version.h index a790152ca4..42c85c1b13 100644 --- a/core/version.h +++ b/core/version.h @@ -28,6 +28,9 @@ /* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ /*************************************************************************/ +#ifndef GODOT_VERSION_H +#define GODOT_VERSION_H + #include "core/version_generated.gen.h" // Godot versions are of the form <major>.<minor> for the initial release, @@ -38,18 +41,18 @@ // forward-compatible. // Example: "3.1" #define VERSION_BRANCH "" _MKSTR(VERSION_MAJOR) "." _MKSTR(VERSION_MINOR) -#ifdef VERSION_PATCH +#if VERSION_PATCH // Example: "3.1.4" #define VERSION_NUMBER "" VERSION_BRANCH "." _MKSTR(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 VERSION_NUMBER "" VERSION_BRANCH +#endif // 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 VERSION_HEX 0x10000 * VERSION_MAJOR + 0x100 * VERSION_MINOR + VERSION_PATCH -#else -// Example: "3.1" -#define VERSION_NUMBER "" VERSION_BRANCH -#define VERSION_HEX 0x10000 * VERSION_MAJOR + 0x100 * VERSION_MINOR -#endif // VERSION_PATCH // Describes the full configuration of that Godot version, including the version number, // the status (beta, stable, etc.) and potential module-specific features (e.g. mono). @@ -64,3 +67,5 @@ // Same as above, but prepended with Godot's name and a cosmetic "v" for "version". // Example: "Godot v3.1.4.stable.official.mono" #define VERSION_FULL_NAME "" VERSION_NAME " v" VERSION_FULL_BUILD + +#endif // GODOT_VERSION_H |