Added a few new version methods for compilter and platform

This commit is contained in:
Mark Vejvoda
2010-05-12 22:54:42 +00:00
parent 23ebbb15ad
commit 36c7ccfff1
2 changed files with 26 additions and 6 deletions

View File

@@ -32,12 +32,23 @@ string getCrashDumpFileName(){
return "glest" + glestVersionString + ".dmp"; return "glest" + glestVersionString + ".dmp";
} }
string getNetworkVersionString() { string getPlatformNameString() {
string version = glestVersionString + " built: " + string(__DATE__) + " " + string(__TIME__); string platform = "";
#if defined(WIN32) && defined(_MSC_VER) #if defined(WIN32)
version += " Compiled using MSC_VER: " + intToStr(_MSC_VER); platform = "Windows";
#elif defined(__GNUC__) #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__)
# if defined(__GNUC_PATCHLEVEL__) # if defined(__GNUC_PATCHLEVEL__)
# define __GNUC_VERSION__ (__GNUC__ * 10000 \ # define __GNUC_VERSION__ (__GNUC__ * 10000 \
@@ -48,12 +59,19 @@ string getNetworkVersionString() {
+ __GNUC_MINOR__ * 100) + __GNUC_MINOR__ * 100)
# endif # endif
#endif #endif
version = "GNUC: " + intToStr(__GNUC_VERSION__);
version += " Compiled using GNUC_VERSION: " + intToStr(__GNUC_VERSION__); #else
version = "???";
#endif #endif
return version; return version;
} }
string getNetworkVersionString() {
string version = glestVersionString + " built: " + string(__DATE__) + " " + string(__TIME__);
version += " Compiled with " + getCompilerNameString();
return version;
}
string getCompileDateTime() { string getCompileDateTime() {
return string(__DATE__) + " " + string(__TIME__); return string(__DATE__) + " " + string(__TIME__);
} }

View File

@@ -27,6 +27,8 @@ extern const string glestVersionString;
extern const string networkVersionString; extern const string networkVersionString;
string getCrashDumpFileName(); string getCrashDumpFileName();
string getPlatformNameString();
string getCompilerNameString();
string getNetworkVersionString(); string getNetworkVersionString();
string getNetworkPlatformFreeVersionString(); string getNetworkPlatformFreeVersionString();
string getAboutString1(int i); string getAboutString1(int i);