Skip to content

Commit

Permalink
Avoid conflicts with external components
Browse files Browse the repository at this point in the history
Global namespace alias might cause conflicts with external components.
  • Loading branch information
kone-tlammi committed Aug 1, 2023
1 parent 09e9f84 commit fc18ec5
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions include/cpr/filesystem.h
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,20 @@
#ifdef CPR_USE_BOOST_FILESYSTEM
#define BOOST_FILESYSTEM_VERSION 4 // Use the latest, with the closest behavior to std::filesystem.
#include <boost/filesystem.hpp>
namespace cpr {
namespace fs = boost::filesystem;
}
// cppcheck-suppress preprocessorErrorDirective
#elif __has_include(<filesystem>)
#include <filesystem>
namespace cpr {
namespace fs = std::filesystem;
}
#elif __has_include("experimental/filesystem")
#include <experimental/filesystem>
namespace cpr {
namespace fs = std::experimental::filesystem;
}
#else
#error "Failed to include <filesystem> header!"
#endif
Expand Down

0 comments on commit fc18ec5

Please sign in to comment.