/**************************************************************************/1/* version.h */2/**************************************************************************/3/* This file is part of: */4/* GODOT ENGINE */5/* https://godotengine.org */6/**************************************************************************/7/* Copyright (c) 2014-present Godot Engine contributors (see AUTHORS.md). */8/* Copyright (c) 2007-2014 Juan Linietsky, Ariel Manzur. */9/* */10/* Permission is hereby granted, free of charge, to any person obtaining */11/* a copy of this software and associated documentation files (the */12/* "Software"), to deal in the Software without restriction, including */13/* without limitation the rights to use, copy, modify, merge, publish, */14/* distribute, sublicense, and/or sell copies of the Software, and to */15/* permit persons to whom the Software is furnished to do so, subject to */16/* the following conditions: */17/* */18/* The above copyright notice and this permission notice shall be */19/* included in all copies or substantial portions of the Software. */20/* */21/* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, */22/* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF */23/* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. */24/* IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY */25/* CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, */26/* TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE */27/* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */28/**************************************************************************/2930#pragma once3132#include "core/version_generated.gen.h" // IWYU pragma: export3334#include <stdint.h> // NOLINT(modernize-deprecated-headers) FIXME: MinGW compilation fails when changing to C++ Header.3536// Copied from typedefs.h to stay lean.37#ifndef _STR38#define _STR(m_x) #m_x39#define _MKSTR(m_x) _STR(m_x)40#endif4142// Godot versions are of the form <major>.<minor> for the initial release,43// and then <major>.<minor>.<patch> for subsequent bugfix releases where <patch> != 044// That's arbitrary, but we find it pretty and it's the current policy.4546// Defines the main "branch" version. Patch versions in this branch should be47// forward-compatible.48// Example: "3.1"49#define GODOT_VERSION_BRANCH _MKSTR(GODOT_VERSION_MAJOR) "." _MKSTR(GODOT_VERSION_MINOR)50#if GODOT_VERSION_PATCH51// Example: "3.1.4"52#define GODOT_VERSION_NUMBER GODOT_VERSION_BRANCH "." _MKSTR(GODOT_VERSION_PATCH)53#else // patch is 0, we don't include it in the "pretty" version number.54// Example: "3.1" instead of "3.1.0"55#define GODOT_VERSION_NUMBER GODOT_VERSION_BRANCH56#endif // GODOT_VERSION_PATCH5758// Version number encoded as hexadecimal int with one byte for each number,59// for easy comparison from code.60// Example: 3.1.4 will be 0x030104, making comparison easy from script.61#define GODOT_VERSION_HEX 0x10000 * GODOT_VERSION_MAJOR + 0x100 * GODOT_VERSION_MINOR + GODOT_VERSION_PATCH6263// Describes the full configuration of that Godot version, including the version number,64// the status (beta, stable, etc.), potential module-specific features (e.g. mono)65// and double-precision status.66// Example: "3.1.4.stable.mono.double"67#ifdef REAL_T_IS_DOUBLE68#define GODOT_VERSION_FULL_CONFIG GODOT_VERSION_NUMBER "." GODOT_VERSION_STATUS GODOT_VERSION_MODULE_CONFIG ".double"69#else70#define GODOT_VERSION_FULL_CONFIG GODOT_VERSION_NUMBER "." GODOT_VERSION_STATUS GODOT_VERSION_MODULE_CONFIG71#endif7273// Similar to GODOT_VERSION_FULL_CONFIG, but also includes the (potentially custom) GODOT_VERSION_BUILD74// description (e.g. official, custom_build, etc.).75// Example: "3.1.4.stable.mono.double.official"76#define GODOT_VERSION_FULL_BUILD GODOT_VERSION_FULL_CONFIG "." GODOT_VERSION_BUILD7778// Same as above, but prepended with Godot's name and a cosmetic "v" for "version".79// Example: "Godot v3.1.4.stable.official.mono.double"80#define GODOT_VERSION_FULL_NAME GODOT_VERSION_NAME " v" GODOT_VERSION_FULL_BUILD8182// Git commit hash, generated at build time in `core/version_hash.gen.cpp`.83extern const char *const GODOT_VERSION_HASH;8485// Git commit date UNIX timestamp (in seconds), generated at build time in `core/version_hash.gen.cpp`.86// Set to 0 if unknown.87extern const uint64_t GODOT_VERSION_TIMESTAMP;8889#ifndef DISABLE_DEPRECATED90// Compatibility with pre-4.5 modules.91#define VERSION_SHORT_NAME GODOT_VERSION_SHORT_NAME92#define VERSION_NAME GODOT_VERSION_NAME93#define VERSION_MAJOR GODOT_VERSION_MAJOR94#define VERSION_MINOR GODOT_VERSION_MINOR95#define VERSION_PATCH GODOT_VERSION_PATCH96#define VERSION_STATUS GODOT_VERSION_STATUS97#define VERSION_BUILD GODOT_VERSION_BUILD98#define VERSION_MODULE_CONFIG GODOT_VERSION_MODULE_CONFIG99#define VERSION_WEBSITE GODOT_VERSION_WEBSITE100#define VERSION_DOCS_BRANCH GODOT_VERSION_DOCS_BRANCH101#define VERSION_DOCS_URL GODOT_VERSION_DOCS_URL102#define VERSION_BRANCH GODOT_VERSION_BRANCH103#define VERSION_NUMBER GODOT_VERSION_NUMBER104#define VERSION_HEX GODOT_VERSION_HEX105#define VERSION_FULL_CONFIG GODOT_VERSION_FULL_CONFIG106#define VERSION_FULL_BUILD GODOT_VERSION_FULL_BUILD107#define VERSION_FULL_NAME GODOT_VERSION_FULL_NAME108#define VERSION_HASH GODOT_VERSION_HASH109#define VERSION_TIMESTAMP GODOT_VERSION_TIMESTAMP110#endif // DISABLE_DEPRECATED111112113