(svn r27707) -Fix: Make the result of NewGRF's CARGO_NAME string code reliably print...
[openttd.git] / src / rev.cpp.in
blob899a565bbe52bbd877e65c7bb0bbcda127a1d7f9
1 /* $Id$ */
3 /*
4 * This file is part of OpenTTD.
5 * 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.
6 * 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.
7 * 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/>.
8 */
10 /** @file rev.cpp Autogenerated file with the revision and such of OpenTTD. */
12 #include "stdafx.h"
13 #include "core/bitmath_func.hpp"
14 #include "rev.h"
16 #include "safeguards.h"
18 /**
19 * Is this version of OpenTTD a release version?
20 * @return True if it is a release version.
22 bool IsReleasedVersion()
24 return HasBit(_openttd_newgrf_version, 19);
27 /**
28 * The text version of OpenTTD's revision.
29 * This will be either "<major>.<minor>.<build>[-RC<rc>]",
30 * "r<revision number>[M][-<branch>]" or "norev000".
32 * The major, minor and build are the numbers that describe releases of
33 * OpenTTD (like 0.5.3). "-RC" is used to flag release candidates.
35 * The revision number is fairly straight forward. The M is to show that
36 * the binary is made from modified source code. The branch shows the
37 * branch the revision is of and will not be there when it is trunk.
39 * norev000 is for non-releases that are made on systems without
40 * subversion or sources that are not a checkout of subversion.
42 const char _openttd_revision[] = "!!VERSION!!";
44 /**
45 * The text version of OpenTTD's build date.
46 * Updating the build date in this file is the safest as it generally gets
47 * updated for each revision in contrary to most other files that only see
48 * updates when they are actually changed themselves.
50 const char _openttd_build_date[] = __DATE__ " " __TIME__;
52 /**
53 * Let us know if current build was modified. This detection
54 * works even in the case when revision string is overridden by
55 * --revision argument.
56 * Value 0 means no modification, 1 is for unknown state
57 * (compiling from sources without any version control software)
58 * and 2 is for modified revision.
60 const byte _openttd_revision_modified = !!MODIFIED!!;
62 /**
63 * The NewGRF revision of OTTD:
64 * bits meaning.
65 * 28-31 major version
66 * 24-27 minor version
67 * 20-23 build
68 * 19 1 if it is a release, 0 if it is not.
69 * 0-18 revision number; 0 for releases and when the revision is unknown.
71 * The 19th bit is there so the development/betas/alpha, etc. leading to a
72 * final release will always have a lower version number than the released
73 * version, thus making comparisons on specific revisions easy.
75 const uint32 _openttd_newgrf_version = 1 << 28 | 7 << 24 | 0 << 20 | 0 << 19 | (!!REVISION!! & ((1 << 19) - 1));
77 #ifdef __MORPHOS__
78 /**
79 * Variable used by MorphOS to show the version.
81 extern const char morphos_versions_tag[] = "$VER: OpenTTD !!VERSION!! (!!DATE!!) OpenTTD Team [MorphOS, PowerPC]";
82 #endif