diff --git a/include/flatbuffers/util.h b/include/flatbuffers/util.h index ba73d67bd..d2d8cae8e 100644 --- a/include/flatbuffers/util.h +++ b/include/flatbuffers/util.h @@ -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