2009-08-21 20:21:05 +00:00
|
|
|
/*
|
|
|
|
* This file is part of OpenTTD.
|
|
|
|
* OpenTTD is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, version 2.
|
|
|
|
* OpenTTD is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
|
|
|
|
* See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with OpenTTD. If not, see <http://www.gnu.org/licenses/>.
|
|
|
|
*/
|
|
|
|
|
2007-10-21 14:59:05 +00:00
|
|
|
/** @file rev.cpp Autogenerated file with the revision and such of OpenTTD. */
|
|
|
|
|
|
|
|
#include "stdafx.h"
|
2011-08-21 18:57:45 +00:00
|
|
|
#include "core/bitmath_func.hpp"
|
2008-05-04 21:53:36 +00:00
|
|
|
#include "rev.h"
|
2007-10-21 14:59:05 +00:00
|
|
|
|
2014-04-23 20:13:33 +00:00
|
|
|
#include "safeguards.h"
|
|
|
|
|
2011-08-21 18:57:45 +00:00
|
|
|
/**
|
|
|
|
* Is this version of OpenTTD a release version?
|
|
|
|
* @return True if it is a release version.
|
|
|
|
*/
|
|
|
|
bool IsReleasedVersion()
|
|
|
|
{
|
|
|
|
return HasBit(_openttd_newgrf_version, 19);
|
|
|
|
}
|
|
|
|
|
2007-10-21 14:59:05 +00:00
|
|
|
/**
|
|
|
|
* The text version of OpenTTD's revision.
|
2018-04-12 18:59:03 +00:00
|
|
|
* This will be either
|
|
|
|
* - "<tag>", like "<major>.<minor>.<build>[-RC<rc>]",
|
|
|
|
* - "<commitdate>-g<shorthash><modified>" in "master",
|
|
|
|
* - "<commitdate>-<branch>-g<shorthash><modified>" in other branches, or
|
|
|
|
* - "norev000", if the version is unknown.
|
2007-10-21 14:59:05 +00:00
|
|
|
*
|
|
|
|
* The major, minor and build are the numbers that describe releases of
|
|
|
|
* OpenTTD (like 0.5.3). "-RC" is used to flag release candidates.
|
|
|
|
*
|
2018-04-12 18:59:03 +00:00
|
|
|
* <modified> shows a "M", if the binary is made from modified source code.
|
2007-10-21 14:59:05 +00:00
|
|
|
*/
|
Add: introduce CMake for project management
CMake works on all our supported platforms, like MSVC, Mingw, GCC,
Clang, and many more. It allows for a single way of doing things,
so no longer we need shell scripts and vbs scripts to work on all
our supported platforms.
Additionally, CMake allows to generate project files for like MSVC,
KDevelop, etc.
This heavily reduces the lines of code we need to support multiple
platforms from a project perspective.
Addtiionally, this heavily improves our detection of libraries, etc.
2019-04-07 09:57:55 +00:00
|
|
|
const char _openttd_revision[] = "${REV_VERSION}";
|
2007-10-21 14:59:05 +00:00
|
|
|
|
2009-09-04 20:31:49 +00:00
|
|
|
/**
|
|
|
|
* The text version of OpenTTD's build date.
|
|
|
|
* Updating the build date in this file is the safest as it generally gets
|
|
|
|
* updated for each revision in contrary to most other files that only see
|
|
|
|
* updates when they are actually changed themselves.
|
|
|
|
*/
|
|
|
|
const char _openttd_build_date[] = __DATE__ " " __TIME__;
|
|
|
|
|
2019-01-27 13:04:49 +00:00
|
|
|
/**
|
|
|
|
* The git revision hash of this version.
|
|
|
|
*/
|
Add: introduce CMake for project management
CMake works on all our supported platforms, like MSVC, Mingw, GCC,
Clang, and many more. It allows for a single way of doing things,
so no longer we need shell scripts and vbs scripts to work on all
our supported platforms.
Additionally, CMake allows to generate project files for like MSVC,
KDevelop, etc.
This heavily reduces the lines of code we need to support multiple
platforms from a project perspective.
Addtiionally, this heavily improves our detection of libraries, etc.
2019-04-07 09:57:55 +00:00
|
|
|
const char _openttd_revision_hash[] = "${REV_HASH}";
|
2019-01-27 13:04:49 +00:00
|
|
|
|
2020-05-05 16:36:27 +00:00
|
|
|
/**
|
|
|
|
* The year of this version.
|
|
|
|
*/
|
Add: introduce CMake for project management
CMake works on all our supported platforms, like MSVC, Mingw, GCC,
Clang, and many more. It allows for a single way of doing things,
so no longer we need shell scripts and vbs scripts to work on all
our supported platforms.
Additionally, CMake allows to generate project files for like MSVC,
KDevelop, etc.
This heavily reduces the lines of code we need to support multiple
platforms from a project perspective.
Addtiionally, this heavily improves our detection of libraries, etc.
2019-04-07 09:57:55 +00:00
|
|
|
const char _openttd_revision_year[] = "${REV_YEAR}";
|
2020-05-05 16:36:27 +00:00
|
|
|
|
2008-06-03 18:35:58 +00:00
|
|
|
/**
|
|
|
|
* Let us know if current build was modified. This detection
|
2013-01-08 22:46:42 +00:00
|
|
|
* works even in the case when revision string is overridden by
|
2008-06-03 18:35:58 +00:00
|
|
|
* --revision argument.
|
|
|
|
* Value 0 means no modification, 1 is for unknown state
|
|
|
|
* (compiling from sources without any version control software)
|
|
|
|
* and 2 is for modified revision.
|
|
|
|
*/
|
Add: introduce CMake for project management
CMake works on all our supported platforms, like MSVC, Mingw, GCC,
Clang, and many more. It allows for a single way of doing things,
so no longer we need shell scripts and vbs scripts to work on all
our supported platforms.
Additionally, CMake allows to generate project files for like MSVC,
KDevelop, etc.
This heavily reduces the lines of code we need to support multiple
platforms from a project perspective.
Addtiionally, this heavily improves our detection of libraries, etc.
2019-04-07 09:57:55 +00:00
|
|
|
const byte _openttd_revision_modified = ${REV_MODIFIED};
|
2008-06-03 18:35:58 +00:00
|
|
|
|
2019-02-10 17:01:30 +00:00
|
|
|
/**
|
|
|
|
* Indicate whether this is a tagged version.
|
|
|
|
* If this is non-0, then _openttd_revision is the name of the tag,
|
|
|
|
* and the version is likely a beta, release candidate, or real release.
|
|
|
|
*/
|
Add: introduce CMake for project management
CMake works on all our supported platforms, like MSVC, Mingw, GCC,
Clang, and many more. It allows for a single way of doing things,
so no longer we need shell scripts and vbs scripts to work on all
our supported platforms.
Additionally, CMake allows to generate project files for like MSVC,
KDevelop, etc.
This heavily reduces the lines of code we need to support multiple
platforms from a project perspective.
Addtiionally, this heavily improves our detection of libraries, etc.
2019-04-07 09:57:55 +00:00
|
|
|
const byte _openttd_revision_tagged = ${REV_ISTAG};
|
2019-02-10 17:01:30 +00:00
|
|
|
|
2021-09-11 13:34:46 +00:00
|
|
|
/**
|
|
|
|
* To check compatibility of BaNaNaS content, this version string is used.
|
|
|
|
* It should never contain things like "beta", but only the release version
|
|
|
|
* we are compatible with.
|
|
|
|
*/
|
|
|
|
const char _openttd_content_version[] = "${REV_MAJOR}.${REV_MINOR}";
|
|
|
|
|
2007-10-21 14:59:05 +00:00
|
|
|
/**
|
|
|
|
* The NewGRF revision of OTTD:
|
|
|
|
* bits meaning.
|
2021-08-14 16:28:35 +00:00
|
|
|
* 24-31 major version + 16
|
|
|
|
* 20-23 minor version
|
2007-10-21 14:59:05 +00:00
|
|
|
* 19 1 if it is a release, 0 if it is not.
|
2018-07-01 10:15:00 +00:00
|
|
|
* 0-18 used to be the SVN revision, now just last revision before switch to git
|
2007-10-21 14:59:05 +00:00
|
|
|
*
|
|
|
|
* The 19th bit is there so the development/betas/alpha, etc. leading to a
|
|
|
|
* final release will always have a lower version number than the released
|
2013-01-08 22:46:42 +00:00
|
|
|
* version, thus making comparisons on specific revisions easy.
|
2021-08-14 16:28:35 +00:00
|
|
|
*
|
|
|
|
* The + 16 for the major version is because we went from 1.11.0 to 12.0, dropping
|
|
|
|
* the "patch" part of the version. To make sure "1.11.0" is smaller than "12.0", we
|
|
|
|
* have to adjust the major by 16.
|
2007-10-21 14:59:05 +00:00
|
|
|
*/
|
2021-08-14 16:28:35 +00:00
|
|
|
const uint32 _openttd_newgrf_version = (${REV_MAJOR} + 16) << 24 | ${REV_MINOR} << 20 | ${REV_ISSTABLETAG} << 19 | 28004;
|