Fixed Windows compile errors.

This commit is contained in:
Pieter Hulshoff 2019-12-05 16:51:46 +01:00
parent 5ce7f58002
commit 999d9747e9
4 changed files with 11 additions and 2 deletions

View File

@ -97,7 +97,7 @@ Page *PageBuilder::buildPage( std::string collectionName )
layoutPath = Utils::combinePath(layoutPath, "layout");
}
layoutFile = Utils::combinePath(layoutPath, layoutPage + ".xml");
layoutFileAspect = Utils::combinePath(layoutPath, layoutPage + " " + std::to_string( screenWidth_/std::__gcd( screenWidth_, screenHeight_ ) ) + "x" + std::to_string( screenHeight_/std::__gcd( screenWidth_, screenHeight_ ) ) + ".xml" );
layoutFileAspect = Utils::combinePath(layoutPath, layoutPage + " " + std::to_string( screenWidth_/Utils::gcd( screenWidth_, screenHeight_ ) ) + "x" + std::to_string( screenHeight_/Utils::gcd( screenWidth_, screenHeight_ ) ) + ".xml" );
Logger::write(Logger::ZONE_INFO, "Layout", "Initializing " + layoutFileAspect);

View File

@ -266,3 +266,11 @@ void Utils::listToVector( std::string str, std::vector<std::string> &vec, char d
}
vec.push_back( Utils::trimEnds( str.substr( previous, current - previous ) ) );
}
int Utils::gcd( int a, int b )
{
if (b == 0)
return a;
return gcd( b, a % b );
}

View File

@ -36,6 +36,7 @@ public:
static std::string filterComments(std::string line);
static std::string trimEnds(std::string str);
static void listToVector( std::string str, std::vector<std::string> &vec, char delimiter );
static int gcd( int a, int b );
//todo: there has to be a better way to do this
static std::string combinePath(std::list<std::string> &paths);

View File

@ -21,7 +21,7 @@
std::string retrofe_version_major = "0";
std::string retrofe_version_minor = "9";
std::string retrofe_version_build = "18";
std::string retrofe_version_build = "19";
std::string Version::getString( )