mirror of
https://github.com/pytorch/pytorch.git
synced 2025-10-20 21:14:14 +08:00
Signed-off-by: Edward Yang <ezyang@meta.com> Pull Request resolved: https://github.com/pytorch/pytorch/pull/162914 Approved by: https://github.com/Skylion007, https://github.com/dcci, https://github.com/cyyever
23 lines
637 B
C++
23 lines
637 B
C++
// Shim header for filesystem for compilers that are too old to have it not
|
|
// in the experimental namespace
|
|
|
|
#if __has_include(<filesystem>)
|
|
#include <filesystem>
|
|
#elif __has_include(<experimental/filesystem>)
|
|
#include <experimental/filesystem>
|
|
#else
|
|
#error "Neither <filesystem> nor <experimental/filesystem> is available."
|
|
#endif
|
|
|
|
namespace c10 {
|
|
|
|
#if __has_include(<filesystem>)
|
|
// NOLINTNEXTLINE(misc-unused-alias-decls)
|
|
namespace filesystem = std::filesystem;
|
|
#elif __has_include(<experimental/filesystem>)
|
|
// NOLINTNEXTLINE(misc-unused-alias-decls)
|
|
namespace filesystem = std::experimental::filesystem;
|
|
#endif
|
|
|
|
} // namespace c10
|