16
0
mirror of https://github.com/MaSzyna-EU07/maszyna.git synced 2026-07-22 11:39:19 +02:00

linux support

This commit is contained in:
milek7
2017-07-31 00:25:19 +02:00
parent e7623fa18f
commit f7459f3434
64 changed files with 967 additions and 602 deletions

View File

@@ -120,7 +120,7 @@ bool UnSetFlag(int &Flag, int Value)
return true;
}
inline double Random(double a, double b)
double Random(double a, double b)
{
std::uniform_real_distribution<> dis(a, b);
return dis(Global::random_engine);
@@ -166,7 +166,7 @@ std::string ExchangeCharInString( std::string const &Source, char const &From, c
std::for_each(Source.cbegin(), Source.cend(), [&](char const idx) {
if( idx != From ) { replacement += idx; }
else {
if( To != NULL ) { replacement += To; } }
if( To != 0 ) { replacement += To; } }
} );
return replacement;
@@ -379,8 +379,9 @@ void ComputeALine(double X0, double Y0, double Xn, double Yn, double L, double R
}
bool FileExists( std::string const &Filename ) {
std::ifstream file( Filename );
std::string fn = Filename;
std::replace(fn.begin(), fn.end(), '\\', '/');
std::ifstream file( fn );
return( true == file.is_open() );
}