Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Eliminates std::filesystem usage in utils.cc #1346

Merged
merged 2 commits into from
Mar 2, 2022
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
29 changes: 1 addition & 28 deletions src/Util.cc
Original file line number Diff line number Diff line change
Expand Up @@ -15,21 +15,6 @@
*
*/

#ifndef __APPLE__
#if (defined(_MSVC_LANG))
#if (_MSVC_LANG >= 201703L || __cplusplus >= 201703L)
#include <filesystem> // c++17
#else
#define _SILENCE_EXPERIMENTAL_FILESYSTEM_DEPRECATION_WARNING
#include <experimental/filesystem>
#endif
#elif __GNUC__ < 8
#include <experimental/filesystem>
#else
#include <filesystem>
#endif
#endif

#include <ignition/common/Filesystem.hh>
#include <ignition/common/StringUtils.hh>
#include <ignition/common/Util.hh>
Expand Down Expand Up @@ -349,20 +334,8 @@ std::string asFullPath(const std::string &_uri, const std::string &_filePath)
return _uri;
}
#else
// Not a relative path, return unmodified
#if (defined(_MSVC_LANG))
#if (_MSVC_LANG >= 201703L || __cplusplus >= 201703L)
using namespace std::filesystem;
#else
using namespace std::experimental::filesystem;
#endif
#elif __GNUC__ < 8
using namespace std::experimental::filesystem;
#else
using namespace std::filesystem;
#endif
if (_uri.find("://") != std::string::npos ||
!path(_uri).is_relative())
!common::isRelativePath(_uri))
{
return _uri;
}
Expand Down