DefaultIOSystem close assimp/assimp/issues/108 : use correct macro to

detect vs-compiler.
This commit is contained in:
Kim Kulling
2015-09-21 20:43:58 +02:00
parent 6b1cac5743
commit 34ee4c4b9a
2 changed files with 13 additions and 10 deletions

View File

@@ -135,8 +135,8 @@ inline void MakeAbsolutePath (const char* in, char* _out)
{
ai_assert(in && _out);
char* ret;
#ifdef _WIN32
ret = ::_fullpath(_out, in,PATHLIMIT);
#if defined _WIN32 && !defined __GNUC__
ret = ::_fullpath( _out, in, PATHLIMIT );
#else
// use realpath
ret = realpath(in, _out);
@@ -167,8 +167,8 @@ bool DefaultIOSystem::ComparePaths (const char* one, const char* second) const
return !ASSIMP_stricmp(temp1,temp2);
}
std::string DefaultIOSystem::fileName(std::string path)
// ------------------------------------------------------------------------------------------------
std::string DefaultIOSystem::fileName( const std::string &path )
{
std::string ret = path;
std::size_t last = ret.find_last_of("\\/");
@@ -177,7 +177,8 @@ std::string DefaultIOSystem::fileName(std::string path)
}
std::string DefaultIOSystem::completeBaseName(std::string path)
// ------------------------------------------------------------------------------------------------
std::string DefaultIOSystem::completeBaseName( const std::string &path )
{
std::string ret = fileName(path);
std::size_t pos = ret.find_last_of('.');
@@ -185,8 +186,8 @@ std::string DefaultIOSystem::completeBaseName(std::string path)
return ret;
}
std::string DefaultIOSystem::absolutePath(std::string path)
// ------------------------------------------------------------------------------------------------
std::string DefaultIOSystem::absolutePath( const std::string &path )
{
std::string ret = path;
std::size_t last = ret.find_last_of("\\/");
@@ -194,4 +195,6 @@ std::string DefaultIOSystem::absolutePath(std::string path)
return ret;
}
// ------------------------------------------------------------------------------------------------
#undef PATHLIMIT