From dd6ade98314aed772156d3a623e02d97c3b57b87 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20Marjam=C3=A4ki?= Date: Tue, 21 Oct 2014 18:46:09 +0200 Subject: [PATCH] Fixed #6231 (mingw compiler error: Path::getAbsoluteFilePath) --- lib/path.cpp | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/lib/path.cpp b/lib/path.cpp index bad593e98..e81d385ef 100644 --- a/lib/path.cpp +++ b/lib/path.cpp @@ -223,15 +223,15 @@ bool Path::isHeader(const std::string &path) std::string Path::getAbsoluteFilePath(const std::string& filePath) { 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); if (absolute) absolute_path = absolute; free(absolute); -#elif defined(_WIN32) - char absolute[_MAX_PATH]; - if (_fullpath(absolute, filePath.c_str(), _MAX_PATH)) - absolute_path = absolute; #else #error Platform absolute path function needed #endif