Skip to content

Commit a1df35f

Browse files
committed
[libc++] Remove the inline namespace for std::filesystem in ABIv2
1 parent 42ba740 commit a1df35f

File tree

2 files changed

+9
-1
lines changed

2 files changed

+9
-1
lines changed

libcxx/include/__config

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -166,6 +166,8 @@
166166
// requires code not to make these assumptions.
167167
# define _LIBCPP_ABI_USE_WRAP_ITER_IN_STD_ARRAY
168168
# define _LIBCPP_ABI_USE_WRAP_ITER_IN_STD_STRING_VIEW
169+
// Dont' add an inline namespace for `std::filesystem`
170+
# define _LIBCPP_ABI_NO_FILESYSTEM_INLINE_NAMESPACE
169171
# elif _LIBCPP_ABI_VERSION == 1
170172
# if !(defined(_LIBCPP_OBJECT_FORMAT_COFF) || defined(_LIBCPP_OBJECT_FORMAT_XCOFF))
171173
// Enable compiling copies of now inline methods into the dylib to support
@@ -831,10 +833,16 @@ typedef __char32_t char32_t;
831833
inline namespace _LIBCPP_ABI_NAMESPACE {
832834
# define _LIBCPP_END_NAMESPACE_STD }} _LIBCPP_POP_EXTENSION_DIAGNOSTICS
833835

836+
#ifdef _LIBCPP_ABI_NO_FILESYSTEM_INLINE_NAMESPACE
837+
# define _LIBCPP_BEGIN_NAMESPACE_FILESYSTEM _LIBCPP_BEGIN_NAMESPACE_STD namespace filesystem {
838+
# define _LIBCPP_END_NAMESPACE_FILESYSTEM } _LIBCPP_END_NAMESPACE_STD
839+
#else
834840
# define _LIBCPP_BEGIN_NAMESPACE_FILESYSTEM _LIBCPP_BEGIN_NAMESPACE_STD \
835841
inline namespace __fs { namespace filesystem {
836842

837843
# define _LIBCPP_END_NAMESPACE_FILESYSTEM }} _LIBCPP_END_NAMESPACE_STD
844+
#endif
845+
838846
// clang-format on
839847

840848
# if __has_attribute(__enable_if__)

libcxx/test/libcxx/input.output/filesystems/convert_file_time.pass.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@
3030
#endif
3131

3232
using namespace std::chrono;
33-
namespace fs = std::__fs::filesystem;
33+
namespace fs = std::filesystem;
3434
using fs::file_time_type;
3535
using fs::detail::time_util;
3636

0 commit comments

Comments
 (0)