|
@@ -28,6 +28,9 @@
|
|
/* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */
|
|
/* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */
|
|
/*************************************************************************/
|
|
/*************************************************************************/
|
|
|
|
|
|
|
|
+#ifndef GODOT_VERSION_H
|
|
|
|
+#define GODOT_VERSION_H
|
|
|
|
+
|
|
#include "core/version_generated.gen.h"
|
|
#include "core/version_generated.gen.h"
|
|
|
|
|
|
// Godot versions are of the form <major>.<minor> for the initial release,
|
|
// Godot versions are of the form <major>.<minor> for the initial release,
|
|
@@ -38,18 +41,18 @@
|
|
// forward-compatible.
|
|
// forward-compatible.
|
|
// Example: "3.1"
|
|
// Example: "3.1"
|
|
#define VERSION_BRANCH "" _MKSTR(VERSION_MAJOR) "." _MKSTR(VERSION_MINOR)
|
|
#define VERSION_BRANCH "" _MKSTR(VERSION_MAJOR) "." _MKSTR(VERSION_MINOR)
|
|
-#ifdef VERSION_PATCH
|
|
|
|
|
|
+#if VERSION_PATCH
|
|
// Example: "3.1.4"
|
|
// Example: "3.1.4"
|
|
#define VERSION_NUMBER "" VERSION_BRANCH "." _MKSTR(VERSION_PATCH)
|
|
#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,
|
|
// Version number encoded as hexadecimal int with one byte for each number,
|
|
// for easy comparison from code.
|
|
// for easy comparison from code.
|
|
// Example: 3.1.4 will be 0x030104, making comparison easy from script.
|
|
// Example: 3.1.4 will be 0x030104, making comparison easy from script.
|
|
#define VERSION_HEX 0x10000 * VERSION_MAJOR + 0x100 * VERSION_MINOR + VERSION_PATCH
|
|
#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,
|
|
// 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).
|
|
// 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".
|
|
// Same as above, but prepended with Godot's name and a cosmetic "v" for "version".
|
|
// Example: "Godot v3.1.4.stable.official.mono"
|
|
// Example: "Godot v3.1.4.stable.official.mono"
|
|
#define VERSION_FULL_NAME "" VERSION_NAME " v" VERSION_FULL_BUILD
|
|
#define VERSION_FULL_NAME "" VERSION_NAME " v" VERSION_FULL_BUILD
|
|
|
|
+
|
|
|
|
+#endif // GODOT_VERSION_H
|