Fixed #6231 (mingw compiler error: Path::getAbsoluteFilePath)
This commit is contained in:
parent
a3efa1e180
commit
dd6ade9831
10
lib/path.cpp
10
lib/path.cpp
|
@ -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
|
||||||
|
|
Loading…
Reference in New Issue