diff --git a/libcxx/include/fstream b/libcxx/include/fstream --- a/libcxx/include/fstream +++ b/libcxx/include/fstream @@ -186,7 +186,11 @@ #include <__locale> #include #include + +#if _LIBCPP_STD_VER >= 17 && !defined(_MSC_VER) #include +#define _LIBCPP_ENABLE_FILESYSTEM_OVERLOADS +#endif #if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER) #pragma GCC system_header @@ -235,7 +239,7 @@ _LIBCPP_INLINE_VISIBILITY basic_filebuf* open(const string& __s, ios_base::openmode __mode); -#if _LIBCPP_STD_VER >= 17 +#ifdef _LIBCPP_ENABLE_FILESYSTEM_OVERLOADS _LIBCPP_AVAILABILITY_FILESYSTEM _LIBCPP_INLINE_VISIBILITY basic_filebuf* open(const _VSTD_FS::path& __p, ios_base::openmode __mode) { return open(__p.c_str(), __mode); @@ -1151,11 +1155,11 @@ #endif _LIBCPP_INLINE_VISIBILITY explicit basic_ifstream(const string& __s, ios_base::openmode __mode = ios_base::in); -#if _LIBCPP_STD_VER >= 17 +#ifdef _LIBCPP_ENABLE_FILESYSTEM_OVERLOADS _LIBCPP_AVAILABILITY_FILESYSTEM _LIBCPP_INLINE_VISIBILITY explicit basic_ifstream(const filesystem::path& __p, ios_base::openmode __mode = ios_base::in) : basic_ifstream(__p.c_str(), __mode) {} -#endif // _LIBCPP_STD_VER >= 17 +#endif // _LIBCPP_ENABLE_FILESYSTEM_OVERLOADS #endif #ifndef _LIBCPP_CXX03_LANG _LIBCPP_INLINE_VISIBILITY @@ -1177,13 +1181,13 @@ void open(const wchar_t* __s, ios_base::openmode __mode = ios_base::in); #endif void open(const string& __s, ios_base::openmode __mode = ios_base::in); -#if _LIBCPP_STD_VER >= 17 +#ifdef _LIBCPP_ENABLE_FILESYSTEM_OVERLOADS _LIBCPP_AVAILABILITY_FILESYSTEM _LIBCPP_INLINE_VISIBILITY void open(const filesystem::path& __p, ios_base::openmode __mode = ios_base::in) { return open(__p.c_str(), __mode); } -#endif // _LIBCPP_STD_VER >= 17 +#endif // _LIBCPP_ENABLE_FILESYSTEM_OVERLOADS _LIBCPP_INLINE_VISIBILITY void __open(int __fd, ios_base::openmode __mode); @@ -1365,11 +1369,11 @@ _LIBCPP_INLINE_VISIBILITY explicit basic_ofstream(const string& __s, ios_base::openmode __mode = ios_base::out); -#if _LIBCPP_STD_VER >= 17 +#ifdef _LIBCPP_ENABLE_FILESYSTEM_OVERLOADS _LIBCPP_AVAILABILITY_FILESYSTEM _LIBCPP_INLINE_VISIBILITY explicit basic_ofstream(const filesystem::path& __p, ios_base::openmode __mode = ios_base::out) : basic_ofstream(__p.c_str(), __mode) {} -#endif // _LIBCPP_STD_VER >= 17 +#endif // _LIBCPP_ENABLE_FILESYSTEM_OVERLOADS #ifndef _LIBCPP_CXX03_LANG _LIBCPP_INLINE_VISIBILITY @@ -1392,11 +1396,11 @@ #endif void open(const string& __s, ios_base::openmode __mode = ios_base::out); -#if _LIBCPP_STD_VER >= 17 +#ifdef _LIBCPP_ENABLE_FILESYSTEM_OVERLOADS _LIBCPP_AVAILABILITY_FILESYSTEM _LIBCPP_INLINE_VISIBILITY void open(const filesystem::path& __p, ios_base::openmode __mode = ios_base::out) { return open(__p.c_str(), __mode); } -#endif // _LIBCPP_STD_VER >= 17 +#endif // _LIBCPP_ENABLE_FILESYSTEM_OVERLOADS _LIBCPP_INLINE_VISIBILITY void __open(int __fd, ios_base::openmode __mode); @@ -1579,11 +1583,11 @@ _LIBCPP_INLINE_VISIBILITY explicit basic_fstream(const string& __s, ios_base::openmode __mode = ios_base::in | ios_base::out); -#if _LIBCPP_STD_VER >= 17 +#ifdef _LIBCPP_ENABLE_FILESYSTEM_OVERLOADS _LIBCPP_AVAILABILITY_FILESYSTEM _LIBCPP_INLINE_VISIBILITY explicit basic_fstream(const filesystem::path& __p, ios_base::openmode __mode = ios_base::in | ios_base::out) : basic_fstream(__p.c_str(), __mode) {} -#endif // _LIBCPP_STD_VER >= 17 +#endif // _LIBCPP_ENABLE_FILESYSTEM_OVERLOADS #endif #ifndef _LIBCPP_CXX03_LANG @@ -1607,11 +1611,11 @@ #endif void open(const string& __s, ios_base::openmode __mode = ios_base::in | ios_base::out); -#if _LIBCPP_STD_VER >= 17 +#ifdef _LIBCPP_ENABLE_FILESYSTEM_OVERLOADS _LIBCPP_AVAILABILITY_FILESYSTEM _LIBCPP_INLINE_VISIBILITY void open(const filesystem::path& __p, ios_base::openmode __mode = ios_base::in|ios_base::out) { return open(__p.c_str(), __mode); } -#endif // _LIBCPP_STD_VER >= 17 +#endif // _LIBCPP_ENABLE_FILESYSTEM_OVERLOADS #endif _LIBCPP_INLINE_VISIBILITY