Skip to content

Commit 5d31360

Browse files
authored
[libc++] Remove the inline namespace for std::filesystem in ABIv2 (#92971)
1 parent 63fc26c commit 5d31360

File tree

3 files changed

+9
-1
lines changed

3 files changed

+9
-1
lines changed

libcxx/include/__config

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -621,10 +621,16 @@ typedef __char32_t char32_t;
621621
inline namespace _LIBCPP_ABI_NAMESPACE {
622622
# define _LIBCPP_END_NAMESPACE_STD }} _LIBCPP_POP_EXTENSION_DIAGNOSTICS
623623

624+
#ifdef _LIBCPP_ABI_NO_FILESYSTEM_INLINE_NAMESPACE
625+
# define _LIBCPP_BEGIN_NAMESPACE_FILESYSTEM _LIBCPP_BEGIN_NAMESPACE_STD namespace filesystem {
626+
# define _LIBCPP_END_NAMESPACE_FILESYSTEM } _LIBCPP_END_NAMESPACE_STD
627+
#else
624628
# define _LIBCPP_BEGIN_NAMESPACE_FILESYSTEM _LIBCPP_BEGIN_NAMESPACE_STD \
625629
inline namespace __fs { namespace filesystem {
626630

627631
# define _LIBCPP_END_NAMESPACE_FILESYSTEM }} _LIBCPP_END_NAMESPACE_STD
632+
#endif
633+
628634
// clang-format on
629635

630636
# if __has_attribute(__enable_if__)

libcxx/include/__configuration/abi.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -89,6 +89,8 @@
8989
// requires code not to make these assumptions.
9090
# define _LIBCPP_ABI_USE_WRAP_ITER_IN_STD_ARRAY
9191
# define _LIBCPP_ABI_USE_WRAP_ITER_IN_STD_STRING_VIEW
92+
// Dont' add an inline namespace for `std::filesystem`
93+
# define _LIBCPP_ABI_NO_FILESYSTEM_INLINE_NAMESPACE
9294
#elif _LIBCPP_ABI_VERSION == 1
9395
# if !(defined(_LIBCPP_OBJECT_FORMAT_COFF) || defined(_LIBCPP_OBJECT_FORMAT_XCOFF))
9496
// Enable compiling copies of now inline methods into the dylib to support

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)