From 36c7ccfff1138b9f0124f72bd3fa005df7c56d13 Mon Sep 17 00:00:00 2001 From: Mark Vejvoda Date: Wed, 12 May 2010 22:54:42 +0000 Subject: [PATCH] Added a few new version methods for compilter and platform --- source/glest_game/facilities/game_util.cpp | 30 +++++++++++++++++----- source/glest_game/facilities/game_util.h | 2 ++ 2 files changed, 26 insertions(+), 6 deletions(-) diff --git a/source/glest_game/facilities/game_util.cpp b/source/glest_game/facilities/game_util.cpp index 15426406..4e4af5a2 100644 --- a/source/glest_game/facilities/game_util.cpp +++ b/source/glest_game/facilities/game_util.cpp @@ -32,12 +32,23 @@ string getCrashDumpFileName(){ return "glest" + glestVersionString + ".dmp"; } -string getNetworkVersionString() { - string version = glestVersionString + " built: " + string(__DATE__) + " " + string(__TIME__); -#if defined(WIN32) && defined(_MSC_VER) - version += " Compiled using MSC_VER: " + intToStr(_MSC_VER); +string getPlatformNameString() { + string platform = ""; +#if defined(WIN32) + platform = "Windows"; #elif defined(__GNUC__) + platform = "GNU"; +#else + platform = "???"; +#endif + return platform; +} +string getCompilerNameString() { + string version = ""; +#if defined(WIN32) && defined(_MSC_VER) + version = "VC++: " + intToStr(_MSC_VER); +#elif defined(__GNUC__) #if defined(__GNUC__) # if defined(__GNUC_PATCHLEVEL__) # define __GNUC_VERSION__ (__GNUC__ * 10000 \ @@ -48,12 +59,19 @@ string getNetworkVersionString() { + __GNUC_MINOR__ * 100) # endif #endif - - version += " Compiled using GNUC_VERSION: " + intToStr(__GNUC_VERSION__); + version = "GNUC: " + intToStr(__GNUC_VERSION__); +#else + version = "???"; #endif return version; } +string getNetworkVersionString() { + string version = glestVersionString + " built: " + string(__DATE__) + " " + string(__TIME__); + version += " Compiled with " + getCompilerNameString(); + return version; +} + string getCompileDateTime() { return string(__DATE__) + " " + string(__TIME__); } diff --git a/source/glest_game/facilities/game_util.h b/source/glest_game/facilities/game_util.h index 288b3beb..d81c6bf7 100644 --- a/source/glest_game/facilities/game_util.h +++ b/source/glest_game/facilities/game_util.h @@ -27,6 +27,8 @@ extern const string glestVersionString; extern const string networkVersionString; string getCrashDumpFileName(); +string getPlatformNameString(); +string getCompilerNameString(); string getNetworkVersionString(); string getNetworkPlatformFreeVersionString(); string getAboutString1(int i);