diff --git a/openrct2.vcxproj b/openrct2.vcxproj index 4d00677ce6..aa51afa3a1 100644 --- a/openrct2.vcxproj +++ b/openrct2.vcxproj @@ -273,6 +273,7 @@ + diff --git a/src/openrct2.c b/src/openrct2.c index 5fe2a3099d..f450fba13f 100644 --- a/src/openrct2.c +++ b/src/openrct2.c @@ -37,6 +37,7 @@ #include "title.h" #include "util/sawyercoding.h" #include "util/util.h" +#include "version.h" #include "world/mapgen.h" #if defined(__unix__) @@ -87,14 +88,14 @@ void openrct2_write_full_version_info(utf8 *buffer, size_t bufferSize) strcat(buffer, OPENRCT2_VERSION); // Build information - if (!str_is_null_or_empty(OPENRCT2_BRANCH)) { - sprintf(strchr(buffer, 0), "-%s", OPENRCT2_BRANCH); + if (!str_is_null_or_empty(gGitBranch)) { + sprintf(strchr(buffer, 0), "-%s", gGitBranch); } - if (!str_is_null_or_empty(OPENRCT2_COMMIT_SHA1_SHORT)) { - sprintf(strchr(buffer, 0), " build %s", OPENRCT2_COMMIT_SHA1_SHORT); + if (!str_is_null_or_empty(gCommitSha1Short)) { + sprintf(strchr(buffer, 0), " build %s", gCommitSha1Short); } - if (!str_is_null_or_empty(OPENRCT2_BUILD_SERVER)) { - sprintf(strchr(buffer, 0), " provided by %s", OPENRCT2_BUILD_SERVER); + if (!str_is_null_or_empty(gBuildServer)) { + sprintf(strchr(buffer, 0), " provided by %s", gBuildServer); } #if DEBUG diff --git a/src/version.c b/src/version.c new file mode 100644 index 0000000000..67dc2e2e48 --- /dev/null +++ b/src/version.c @@ -0,0 +1,45 @@ +#pragma region Copyright (c) 2014-2016 OpenRCT2 Developers +/***************************************************************************** + * OpenRCT2, an open source clone of Roller Coaster Tycoon 2. + * + * OpenRCT2 is the work of many authors, a full list can be found in contributors.md + * For more information, visit https://github.com/OpenRCT2/OpenRCT2 + * + * OpenRCT2 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, either version 3 of the License, or + * (at your option) any later version. + * + * A full copy of the GNU General Public License can be found in licence.txt + *****************************************************************************/ +#pragma endregion + +#ifdef OPENRCT2_BUILD_NUMBER + const char *gBuildNumber = OPENRCT2_BUILD_NUMBER; +#else + const char *gBuildNumber = ""; +#endif + +#ifdef OPENRCT2_BUILD_SERVER + const char *gBuildServer = OPENRCT2_BUILD_SERVER; +#else + const char *gBuildServer = ""; +#endif + +#ifdef OPENRCT2_BRANCH + const char *gGitBranch = OPENRCT2_BRANCH; +#else + const char *gGitBranch = ""; +#endif + +#ifdef OPENRCT2_COMMIT_SHA1 + const char *gCommitSha1 = OPENRCT2_COMMIT_SHA1; +#else + const char *gCommitSha1 = ""; +#endif + +#ifdef OPENRCT2_COMMIT_SHA1_SHORT + const char *gCommitSha1Short = OPENRCT2_COMMIT_SHA1_SHORT; +#else + const char *gCommitSha1Short = ""; +#endif diff --git a/src/version.h b/src/version.h index ca7239cea8..6cd96bce0d 100644 --- a/src/version.h +++ b/src/version.h @@ -40,20 +40,10 @@ #define OPENRCT2_TIMESTAMP __DATE__ " " __TIME__ // The following constants are for automated build servers -#ifndef OPENRCT2_BUILD_NUMBER - #define OPENRCT2_BUILD_NUMBER "" -#endif -#ifndef OPENRCT2_BUILD_SERVER - #define OPENRCT2_BUILD_SERVER "" -#endif -#ifndef OPENRCT2_BRANCH - #define OPENRCT2_BRANCH "develop" -#endif -#ifndef OPENRCT2_COMMIT_SHA1 - #define OPENRCT2_COMMIT_SHA1 "" -#endif -#ifndef OPENRCT2_COMMIT_SHA1_SHORT - #define OPENRCT2_COMMIT_SHA1_SHORT "" -#endif +extern const char *gBuildNumber; +extern const char *gBuildServer; +extern const char *gGitBranch; +extern const char *gCommitSha1; +extern const char *gCommitSha1Short; #endif