# HG changeset patch # User Santeri Piippo # Date 1396944445 -10800 # Node ID 2ca8316e01099a72165bd266a5ee98cca4af8d29 # Parent 5cfbf4dffebf2010957c848e8dc4feaa24dc81b7 - some tweaks to version.cc diff -r 5cfbf4dffebf -r 2ca8316e0109 src/version.cc --- a/src/version.cc Tue Apr 08 11:03:44 2014 +0300 +++ b/src/version.cc Tue Apr 08 11:07:25 2014 +0300 @@ -16,42 +16,46 @@ * along with this program. If not, see . */ +// Note: only using stock C stuff in this file, keeping the STL/Qt stuff out +// makes this simple file very fast to compile, which is nice since this file +// must be compiled every time I commit something. + #include #include #include "version.h" #include "gitinfo.h" -char gVersionString[64] = {'\0'}; -char gFullVersionString[256] = {'\0'}; +char g_versionString[64] = {'\0'}; +char g_fullVersionString[256] = {'\0'}; // ============================================================================= // const char* versionString() { - if (gVersionString[0] == '\0') + if (g_versionString[0] == '\0') { #if VERSION_PATCH == 0 - sprintf (gVersionString, "%d.%d", VERSION_MAJOR, VERSION_MINOR); + sprintf (g_versionString, "%d.%d", VERSION_MAJOR, VERSION_MINOR); #else - sprintf (gVersionString, "%d.%d.%d", VERSION_MAJOR, VERSION_MINOR, VERSION_PATCH); + sprintf (g_versionString, "%d.%d.%d", VERSION_MAJOR, VERSION_MINOR, VERSION_PATCH); #endif // VERSION_PATCH } - return gVersionString; + return g_versionString; } // ============================================================================= // const char* fullVersionString() { - if (gFullVersionString[0] == '\0') + if (g_fullVersionString[0] == '\0') { #if BUILD_ID != BUILD_RELEASE - strcpy (gFullVersionString, GIT_DESCRIPTION); + strcpy (g_fullVersionString, GIT_DESCRIPTION); #else - sprintf (gFullVersionString, "v%s", versionString()); + sprintf (g_fullVersionString, "v%s", versionString()); #endif } - return gFullVersionString; + return g_fullVersionString; }