src/main.cpp

changeset 437
51313dba897d
parent 436
4268a5507725
child 455
c5d14d112034
equal deleted inserted replaced
436:4268a5507725 437:51313dba897d
94 va_start (va, fmtstr); 94 va_start (va, fmtstr);
95 vprintf (fmtstr, va); 95 vprintf (fmtstr, va);
96 va_end (va); 96 va_end (va);
97 } 97 }
98 98
99 const char* versionString() { 99 str versionString() {
100 if (g_versionString.length() == 0) { 100 if (g_versionString.length() == 0) {
101 #if VERSION_PATCH == 0 101 #if VERSION_PATCH == 0
102 g_versionString = fmt ("%1.%2", VERSION_MAJOR, VERSION_MINOR); 102 g_versionString = fmt ("%1.%2", VERSION_MAJOR, VERSION_MINOR);
103 #else 103 #else
104 g_versionString = fmt ("%1.%2.%3", VERSION_MAJOR, VERSION_MINOR, VERSION_PATCH); 104 g_versionString = fmt ("%1.%2.%3", VERSION_MAJOR, VERSION_MINOR, VERSION_PATCH);
105 #endif // VERSION_PATCH 105 #endif // VERSION_PATCH
106 } 106 }
107 107
108 return g_versionString.toStdString().c_str(); 108 return g_versionString;
109 } 109 }
110 110
111 const char* versionMoniker() { 111 str versionMoniker() {
112 #if BUILD_ID == BUILD_INTERNAL 112 #if BUILD_ID == BUILD_INTERNAL
113 return " Internal"; 113 return "Internal";
114 #elif BUILD_ID == BUILD_ALPHA 114 #elif BUILD_ID == BUILD_ALPHA
115 return " Alpha"; 115 return "Alpha";
116 #elif BUILD_ID == BUILD_BETA 116 #elif BUILD_ID == BUILD_BETA
117 return " Beta"; 117 return "Beta";
118 #elif BUILD_ID == BUILD_RC 118 #elif BUILD_ID == BUILD_RC
119 return " RC"; 119 return fmt ("RC %1", RC_NUMBER);
120 #else 120 #else
121 return ""; 121 return "";
122 #endif // BUILD_ID 122 #endif // BUILD_ID
123 } 123 }
124 124
125 const char* fullVersionString() { 125 str fullVersionString() {
126 if (g_fullVersionString.length() == 0) 126 return fmt ("v%1 %2", versionString(), versionMoniker());
127 g_fullVersionString = fmt ("v%1%2", versionString(), versionMoniker());
128
129 return g_fullVersionString.toStdString().c_str();
130 } 127 }
131 128
132 static void bombBox (str msg) { 129 static void bombBox (str msg) {
133 msg.replace ("\n", "<br />"); 130 msg.replace ("\n", "<br />");
134 131

mercurial