CRLF
[ghsmtp.git] / fs.hpp
blob16f0714f3f3f994b1089bfd3b0ddf57293ed4e69
1 #ifndef FS_DOT_HPP
2 #define FS_DOT_HPP
4 // Normally I would consider it rude to have a "using …" in a header
5 // file, but in this case the whole point is to conditionally define a
6 // short namespace that gives us a filesystem library.
8 #if __has_include(<filesystem>)
10 #include <filesystem>
11 namespace fs = std::filesystem;
12 using std::error_code;
14 // clang-format off
15 #elif __has_include(<experimental/filesystem>)
16 // clang-format on
18 #include <experimental/filesystem>
19 namespace fs = std::experimental::filesystem;
20 using std::error_code;
22 #else
24 #define BOOST_FILESYSTEM_NO_DEPRECATED
25 #include <boost/filesystem.hpp>
26 namespace fs = boost::filesystem;
27 using boost::system::error_code;
29 #endif
31 #endif // FS_DOT_HPP