Skip to content
Snippets Groups Projects
Commit 4731c7e5 authored by Chris Pickett's avatar Chris Pickett
Browse files

Fix build for platforms not supporting realpath

Added a check for a preprocessor definition that can be set if the platform you're building for doesn't support any notion of absolute path resolution/realpath()/etc.
parent a6a38f60
No related branches found
No related tags found
No related merge requests found
......@@ -219,6 +219,9 @@ inline void EnsureDirExists(const std::string &filepath) {
// Obtains the absolute path from any other path.
// Returns the input path if the absolute path couldn't be resolved.
inline std::string AbsolutePath(const std::string &filepath) {
#ifdef NO_ABSOLUTE_PATH_RESOLUTION
return filepath;
#else
#ifdef _WIN32
char abs_path[MAX_PATH];
return GetFullPathNameA(filepath.c_str(), MAX_PATH, abs_path, nullptr)
......@@ -228,6 +231,7 @@ inline std::string AbsolutePath(const std::string &filepath) {
#endif
? abs_path
: filepath;
#endif // NO_ABSOLUTE_PATH_RESOLUTION
}
// To and from UTF-8 unicode conversion functions
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment