Fixed #6231 (mingw compiler error: Path::getAbsoluteFilePath)

This commit is contained in:
Daniel Marjamäki 2014-10-21 18:46:09 +02:00
parent a3efa1e180
commit dd6ade9831
1 changed files with 5 additions and 5 deletions

View File

@ -223,15 +223,15 @@ bool Path::isHeader(const std::string &path)
std::string Path::getAbsoluteFilePath(const std::string& filePath) std::string Path::getAbsoluteFilePath(const std::string& filePath)
{ {
std::string absolute_path; std::string absolute_path;
#if defined(__linux__) || defined(__sun) || defined(__hpux) || defined(__GNUC__) #ifdef _WIN32
char absolute[_MAX_PATH];
if (_fullpath(absolute, filePath.c_str(), _MAX_PATH))
absolute_path = absolute;
#elif defined(__linux__) || defined(__sun) || defined(__hpux) || defined(__GNUC__)
char * absolute = realpath(filePath.c_str(), NULL); char * absolute = realpath(filePath.c_str(), NULL);
if (absolute) if (absolute)
absolute_path = absolute; absolute_path = absolute;
free(absolute); free(absolute);
#elif defined(_WIN32)
char absolute[_MAX_PATH];
if (_fullpath(absolute, filePath.c_str(), _MAX_PATH))
absolute_path = absolute;
#else #else
#error Platform absolute path function needed #error Platform absolute path function needed
#endif #endif