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