diff --git a/components/openmw-mp/Utils.cpp b/components/openmw-mp/Utils.cpp index be9cc737b..11603beac 100644 --- a/components/openmw-mp/Utils.cpp +++ b/components/openmw-mp/Utils.cpp @@ -117,7 +117,7 @@ std::string Utils::toString(int num) return stream.str(); } -string Utils::replaceString(const string& source, const char* find, const char* replace) +std::string Utils::replaceString(const string& source, const char* find, const char* replace) { unsigned int find_len = strlen(find); unsigned int replace_len = strlen(replace); @@ -175,20 +175,23 @@ unsigned int ::Utils::crc32Checksum(const std::string &file) return crc32.checksum(); } +std::string Utils::getOperatingSystem() +{ +#if defined(_WIN32) + return "Windows"; +#elif defined(__linux) + return "Linux"; +#elif defined(__APPLE__) + return "OS X"; +#else + return "Unknown OS"; +#endif +} + void Utils::printVersion(std::string appName, std::string version, std::string commitHash, int protocol) { cout << appName << " " << version; - cout << " ("; -#if defined(_WIN32) - cout << "Windows"; -#elif defined(__linux) - cout << "Linux"; -#elif defined(__APPLE__) - cout << "OS X"; -#else - cout << "Unknown OS"; -#endif - cout << " "; + cout << " (" << getOperatingSystem() << " "; #if defined(__x86_64__) || defined(_M_X64) cout << "64-bit"; #elif defined(__i386__) || defined(_M_I86) diff --git a/components/openmw-mp/Utils.hpp b/components/openmw-mp/Utils.hpp index 98850c1ae..9fc4fded5 100644 --- a/components/openmw-mp/Utils.hpp +++ b/components/openmw-mp/Utils.hpp @@ -60,6 +60,8 @@ namespace Utils unsigned int crc32Checksum(const std::string &file); + std::string getOperatingSystem(); + void printVersion(std::string appName, std::string version, std::string commitHash, int protocol); void printWithWidth(std::ostringstream &sstr, std::string str, size_t width);