Skip to content

Commit 66a562d

Browse files
committed
[libc++] Roll up fstream support into filesystem support
LIBCXX_ENABLE_FILESYSTEM should represent whether the platform has support for a filesystem, not just whether we support <filesystem>. This patch slightly generalizes the setting to also encompass whether we provide <fstream>, since that only makes sense when a filesystem is supported. Differential Revision: https://reviews.llvm.org/D152168
1 parent a3a4369 commit 66a562d

File tree

26 files changed

+53
-75
lines changed

26 files changed

+53
-75
lines changed

libcxx/CMakeLists.txt

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,10 @@ option(LIBCXX_ENABLE_ASSERTIONS
5757
by users in their own code regardless of this option." OFF)
5858
option(LIBCXX_ENABLE_SHARED "Build libc++ as a shared library." ON)
5959
option(LIBCXX_ENABLE_STATIC "Build libc++ as a static library." ON)
60-
option(LIBCXX_ENABLE_FILESYSTEM "Build filesystem as part of the main libc++ library" ON)
60+
option(LIBCXX_ENABLE_FILESYSTEM
61+
"Whether to include support for parts of the library that rely on a filesystem being
62+
available on the platform. This includes things like most parts of <filesystem> and
63+
others like <fstream>" ON)
6164
option(LIBCXX_INCLUDE_TESTS "Build the libc++ tests." ${LLVM_INCLUDE_TESTS})
6265
option(LIBCXX_ENABLE_DEBUG_MODE
6366
"Whether to build libc++ with the debug mode enabled.
@@ -76,8 +79,6 @@ option(LIBCXX_ENABLE_LOCALIZATION
7679
the C locale API (e.g. embedded). When localization is not supported,
7780
several parts of the library will be disabled: <iostream>, <regex>, <locale>
7881
will be completely unusable, and other parts may be only partly available." ON)
79-
option(LIBCXX_ENABLE_FSTREAM
80-
"Whether to include support for <fstream>." ON) # TODO: Consider rolling that into LIBCXX_ENABLE_FILESYSTEM
8182
option(LIBCXX_ENABLE_UNICODE
8283
"Whether to include support for Unicode in the library. Disabling Unicode can
8384
be useful when porting to platforms that don't support UTF-8 encoding (e.g.
@@ -779,10 +780,9 @@ config_define_if(LIBCXX_HAS_WIN32_THREAD_API _LIBCPP_HAS_THREAD_API_WIN32)
779780
config_define_if(LIBCXX_BUILD_EXTERNAL_THREAD_LIBRARY _LIBCPP_HAS_THREAD_LIBRARY_EXTERNAL)
780781
config_define_if(LIBCXX_HAS_MUSL_LIBC _LIBCPP_HAS_MUSL_LIBC)
781782
config_define_if(LIBCXX_NO_VCRUNTIME _LIBCPP_NO_VCRUNTIME)
782-
config_define_if_not(LIBCXX_ENABLE_FILESYSTEM _LIBCPP_HAS_NO_FILESYSTEM_LIBRARY)
783+
config_define_if_not(LIBCXX_ENABLE_FILESYSTEM _LIBCPP_HAS_NO_FILESYSTEM)
783784
config_define_if_not(LIBCXX_ENABLE_RANDOM_DEVICE _LIBCPP_HAS_NO_RANDOM_DEVICE)
784785
config_define_if_not(LIBCXX_ENABLE_LOCALIZATION _LIBCPP_HAS_NO_LOCALIZATION)
785-
config_define_if_not(LIBCXX_ENABLE_FSTREAM _LIBCPP_HAS_NO_FSTREAM)
786786
config_define_if_not(LIBCXX_ENABLE_UNICODE _LIBCPP_HAS_NO_UNICODE)
787787
config_define_if_not(LIBCXX_ENABLE_WIDE_CHARACTERS _LIBCPP_HAS_NO_WIDE_CHARACTERS)
788788
config_define_if_not(LIBCXX_ENABLE_VENDOR_AVAILABILITY_ANNOTATIONS _LIBCPP_HAS_NO_VENDOR_AVAILABILITY_ANNOTATIONS)

libcxx/cmake/caches/Generic-no-fstream.cmake

Lines changed: 0 additions & 1 deletion
This file was deleted.

libcxx/docs/ReleaseNotes.rst

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -153,3 +153,11 @@ Build System Changes
153153
- Building libc++ and libc++abi for Apple platforms now requires targeting macOS 10.13 and later.
154154
This is relevant for vendors building the libc++ shared library and for folks statically linking
155155
libc++ into an application that has back-deployment requirements on Apple platforms.
156+
157+
- ``LIBCXX_ENABLE_FILESYSTEM`` now represents whether a filesystem is supported on the platform instead
158+
of representing merely whether ``<filesystem>`` should be provided. This means that vendors building
159+
with ``LIBCXX_ENABLE_FILESYSTEM=OFF`` will now also get ``<fstream>`` excluded from their configuration
160+
of the library.
161+
162+
- ``LIBCXX_ENABLE_FSTREAM`` is not supported anymore, please use ``LIBCXX_ENABLE_FILESYSTEM=OFF`` if your
163+
platform does not have support for a filesystem.

libcxx/include/CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -990,7 +990,7 @@ set(files
990990
wctype.h
991991
)
992992

993-
foreach(feature LIBCXX_ENABLE_FILESYSTEM LIBCXX_ENABLE_LOCALIZATION LIBCXX_ENABLE_FSTREAM LIBCXX_ENABLE_THREADS LIBCXX_ENABLE_WIDE_CHARACTERS)
993+
foreach(feature LIBCXX_ENABLE_FILESYSTEM LIBCXX_ENABLE_LOCALIZATION LIBCXX_ENABLE_THREADS LIBCXX_ENABLE_WIDE_CHARACTERS)
994994
if (NOT ${${feature}})
995995
set(requires_${feature} "requires LIBCXX_CONFIGURED_WITHOUT_SUPPORT_FOR_THIS_HEADER")
996996
endif()

libcxx/include/__config_site.in

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,10 +24,9 @@
2424
#cmakedefine _LIBCPP_HAS_NO_VENDOR_AVAILABILITY_ANNOTATIONS
2525
#cmakedefine _LIBCPP_NO_VCRUNTIME
2626
#cmakedefine _LIBCPP_TYPEINFO_COMPARISON_IMPLEMENTATION @_LIBCPP_TYPEINFO_COMPARISON_IMPLEMENTATION@
27-
#cmakedefine _LIBCPP_HAS_NO_FILESYSTEM_LIBRARY
27+
#cmakedefine _LIBCPP_HAS_NO_FILESYSTEM
2828
#cmakedefine _LIBCPP_HAS_NO_RANDOM_DEVICE
2929
#cmakedefine _LIBCPP_HAS_NO_LOCALIZATION
30-
#cmakedefine _LIBCPP_HAS_NO_FSTREAM
3130
#cmakedefine _LIBCPP_HAS_NO_WIDE_CHARACTERS
3231
#cmakedefine01 _LIBCPP_ENABLE_ASSERTIONS_DEFAULT
3332
#cmakedefine _LIBCPP_ENABLE_DEBUG_MODE

libcxx/include/filesystem

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -457,7 +457,7 @@ inline constexpr bool std::ranges::enable_view<std::filesystem::recursive_direct
457457
// [fs.filesystem.syn]
458458
#include <compare>
459459

460-
#if defined(_LIBCPP_HAS_NO_FILESYSTEM_LIBRARY)
460+
#if defined(_LIBCPP_HAS_NO_FILESYSTEM)
461461
# error "The <filesystem> library is not supported since libc++ has been configured without support for a filesystem."
462462
#endif
463463

libcxx/include/fstream

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -194,7 +194,7 @@ typedef basic_fstream<wchar_t> wfstream;
194194
#include <typeinfo>
195195
#include <version>
196196

197-
#if !defined(_LIBCPP_HAS_NO_FILESYSTEM_LIBRARY)
197+
#if !defined(_LIBCPP_HAS_NO_FILESYSTEM)
198198
# include <filesystem>
199199
#endif
200200

@@ -209,7 +209,7 @@ _LIBCPP_PUSH_MACROS
209209
# define _LIBCPP_HAS_NO_OFF_T_FUNCTIONS
210210
#endif
211211

212-
#if !defined(_LIBCPP_HAS_NO_FSTREAM)
212+
#if !defined(_LIBCPP_HAS_NO_FILESYSTEM)
213213

214214
_LIBCPP_BEGIN_NAMESPACE_STD
215215

@@ -245,7 +245,7 @@ public:
245245
_LIBCPP_INLINE_VISIBILITY
246246
basic_filebuf* open(const string& __s, ios_base::openmode __mode);
247247

248-
#if _LIBCPP_STD_VER >= 17 && !defined(_LIBCPP_HAS_NO_FILESYSTEM_LIBRARY)
248+
#if _LIBCPP_STD_VER >= 17
249249
_LIBCPP_AVAILABILITY_FILESYSTEM _LIBCPP_INLINE_VISIBILITY
250250
basic_filebuf* open(const _VSTD_FS::path& __p, ios_base::openmode __mode) {
251251
return open(__p.c_str(), __mode);
@@ -1168,7 +1168,7 @@ public:
11681168
#endif
11691169
_LIBCPP_INLINE_VISIBILITY
11701170
explicit basic_ifstream(const string& __s, ios_base::openmode __mode = ios_base::in);
1171-
#if _LIBCPP_STD_VER >= 17 && !defined(_LIBCPP_HAS_NO_FILESYSTEM_LIBRARY)
1171+
#if _LIBCPP_STD_VER >= 17
11721172
_LIBCPP_AVAILABILITY_FILESYSTEM _LIBCPP_INLINE_VISIBILITY
11731173
explicit basic_ifstream(const filesystem::path& __p, ios_base::openmode __mode = ios_base::in)
11741174
: basic_ifstream(__p.c_str(), __mode) {}
@@ -1189,7 +1189,7 @@ public:
11891189
void open(const wchar_t* __s, ios_base::openmode __mode = ios_base::in);
11901190
#endif
11911191
void open(const string& __s, ios_base::openmode __mode = ios_base::in);
1192-
#if _LIBCPP_STD_VER >= 17 && !defined(_LIBCPP_HAS_NO_FILESYSTEM_LIBRARY)
1192+
#if _LIBCPP_STD_VER >= 17
11931193
_LIBCPP_AVAILABILITY_FILESYSTEM _LIBCPP_INLINE_VISIBILITY
11941194
void open(const filesystem::path& __p,
11951195
ios_base::openmode __mode = ios_base::in) {
@@ -1369,7 +1369,7 @@ public:
13691369
_LIBCPP_INLINE_VISIBILITY
13701370
explicit basic_ofstream(const string& __s, ios_base::openmode __mode = ios_base::out);
13711371

1372-
#if _LIBCPP_STD_VER >= 17 && !defined(_LIBCPP_HAS_NO_FILESYSTEM_LIBRARY)
1372+
#if _LIBCPP_STD_VER >= 17
13731373
_LIBCPP_AVAILABILITY_FILESYSTEM _LIBCPP_INLINE_VISIBILITY
13741374
explicit basic_ofstream(const filesystem::path& __p, ios_base::openmode __mode = ios_base::out)
13751375
: basic_ofstream(__p.c_str(), __mode) {}
@@ -1392,7 +1392,7 @@ public:
13921392
#endif
13931393
void open(const string& __s, ios_base::openmode __mode = ios_base::out);
13941394

1395-
#if _LIBCPP_STD_VER >= 17 && !defined(_LIBCPP_HAS_NO_FILESYSTEM_LIBRARY)
1395+
#if _LIBCPP_STD_VER >= 17
13961396
_LIBCPP_AVAILABILITY_FILESYSTEM _LIBCPP_INLINE_VISIBILITY
13971397
void open(const filesystem::path& __p, ios_base::openmode __mode = ios_base::out)
13981398
{ return open(__p.c_str(), __mode); }
@@ -1570,7 +1570,7 @@ public:
15701570
_LIBCPP_INLINE_VISIBILITY
15711571
explicit basic_fstream(const string& __s, ios_base::openmode __mode = ios_base::in | ios_base::out);
15721572

1573-
#if _LIBCPP_STD_VER >= 17 && !defined(_LIBCPP_HAS_NO_FILESYSTEM_LIBRARY)
1573+
#if _LIBCPP_STD_VER >= 17
15741574
_LIBCPP_AVAILABILITY_FILESYSTEM _LIBCPP_INLINE_VISIBILITY
15751575
explicit basic_fstream(const filesystem::path& __p, ios_base::openmode __mode = ios_base::in | ios_base::out)
15761576
: basic_fstream(__p.c_str(), __mode) {}
@@ -1595,7 +1595,7 @@ public:
15951595
#endif
15961596
_LIBCPP_HIDE_FROM_ABI void open(const string& __s, ios_base::openmode __mode = ios_base::in | ios_base::out);
15971597

1598-
#if _LIBCPP_STD_VER >= 17 && !defined(_LIBCPP_HAS_NO_FILESYSTEM_LIBRARY)
1598+
#if _LIBCPP_STD_VER >= 17
15991599
_LIBCPP_AVAILABILITY_FILESYSTEM _LIBCPP_INLINE_VISIBILITY
16001600
void open(const filesystem::path& __p, ios_base::openmode __mode = ios_base::in|ios_base::out)
16011601
{ return open(__p.c_str(), __mode); }
@@ -1745,7 +1745,7 @@ extern template class _LIBCPP_EXTERN_TEMPLATE_TYPE_VIS basic_filebuf<char>;
17451745

17461746
_LIBCPP_END_NAMESPACE_STD
17471747

1748-
#endif // _LIBCPP_HAS_NO_FSTREAM
1748+
#endif // _LIBCPP_HAS_NO_FILESYSTEM
17491749

17501750
_LIBCPP_POP_MACROS
17511751

libcxx/include/module.modulemap.in

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -976,7 +976,7 @@ module std [system] {
976976
}
977977
module fstream {
978978
@requires_LIBCXX_ENABLE_LOCALIZATION@
979-
@requires_LIBCXX_ENABLE_FSTREAM@
979+
@requires_LIBCXX_ENABLE_FILESYSTEM@
980980
header "fstream"
981981
export *
982982
}

libcxx/src/ios.instantiations.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ template class _LIBCPP_CLASS_TEMPLATE_INSTANTIATION_VIS basic_stringstream<char>
3737
template class _LIBCPP_CLASS_TEMPLATE_INSTANTIATION_VIS basic_ostringstream<char>;
3838
template class _LIBCPP_CLASS_TEMPLATE_INSTANTIATION_VIS basic_istringstream<char>;
3939

40-
#ifndef _LIBCPP_HAS_NO_FSTREAM
40+
#ifndef _LIBCPP_HAS_NO_FILESYSTEM
4141
template class _LIBCPP_CLASS_TEMPLATE_INSTANTIATION_VIS basic_ifstream<char>;
4242
template class _LIBCPP_CLASS_TEMPLATE_INSTANTIATION_VIS basic_ofstream<char>;
4343
template class _LIBCPP_CLASS_TEMPLATE_INSTANTIATION_VIS basic_filebuf<char>;

libcxx/test/libcxx/iterators/iterator.requirements/iterator.assoc.types/iterator.traits/legacy_bidirectional_iterator.compile.pass.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020

2121
#include <array>
2222
#include <deque>
23-
#ifndef TEST_HAS_NO_FILESYSTEM_LIBRARY
23+
#ifndef TEST_HAS_NO_FILESYSTEM
2424
#include <filesystem>
2525
#endif
2626
#include <forward_list>
@@ -61,7 +61,7 @@ static_assert(std::__iterator_traits_detail::__cpp17_bidirectional_iterator<std:
6161
static_assert(std::__iterator_traits_detail::__cpp17_bidirectional_iterator<std::deque<int>::const_reverse_iterator>);
6262

6363
// <filesystem>
64-
#ifndef TEST_HAS_NO_FILESYSTEM_LIBRARY
64+
#ifndef TEST_HAS_NO_FILESYSTEM
6565
static_assert(!std::__iterator_traits_detail::__cpp17_bidirectional_iterator<std::filesystem::directory_iterator>);
6666
static_assert(!std::__iterator_traits_detail::__cpp17_bidirectional_iterator<std::filesystem::recursive_directory_iterator>);
6767
#endif

libcxx/test/libcxx/iterators/iterator.requirements/iterator.assoc.types/iterator.traits/legacy_forward_iterator.compile.pass.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020

2121
#include <array>
2222
#include <deque>
23-
#ifndef TEST_HAS_NO_FILESYSTEM_LIBRARY
23+
#ifndef TEST_HAS_NO_FILESYSTEM
2424
#include <filesystem>
2525
#endif
2626
#include <forward_list>
@@ -61,7 +61,7 @@ static_assert(std::__iterator_traits_detail::__cpp17_forward_iterator<std::deque
6161
static_assert(std::__iterator_traits_detail::__cpp17_forward_iterator<std::deque<int>::const_reverse_iterator>);
6262

6363
// <filesystem>
64-
#ifndef TEST_HAS_NO_FILESYSTEM_LIBRARY
64+
#ifndef TEST_HAS_NO_FILESYSTEM
6565
static_assert(!std::__iterator_traits_detail::__cpp17_forward_iterator<std::filesystem::directory_iterator>);
6666
static_assert(!std::__iterator_traits_detail::__cpp17_forward_iterator<std::filesystem::recursive_directory_iterator>);
6767
#endif

libcxx/test/libcxx/iterators/iterator.requirements/iterator.assoc.types/iterator.traits/legacy_input_iterator.compile.pass.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020

2121
#include <array>
2222
#include <deque>
23-
#ifndef TEST_HAS_NO_FILESYSTEM_LIBRARY
23+
#ifndef TEST_HAS_NO_FILESYSTEM
2424
#include <filesystem>
2525
#endif
2626
#include <forward_list>
@@ -61,7 +61,7 @@ static_assert(std::__iterator_traits_detail::__cpp17_input_iterator<std::deque<i
6161
static_assert(std::__iterator_traits_detail::__cpp17_input_iterator<std::deque<int>::const_reverse_iterator>);
6262

6363
// <filesystem>
64-
#ifndef TEST_HAS_NO_FILESYSTEM_LIBRARY
64+
#ifndef TEST_HAS_NO_FILESYSTEM
6565
static_assert(std::__iterator_traits_detail::__cpp17_input_iterator<std::filesystem::directory_iterator>);
6666
static_assert(std::__iterator_traits_detail::__cpp17_input_iterator<std::filesystem::recursive_directory_iterator>);
6767
#endif

libcxx/test/libcxx/iterators/iterator.requirements/iterator.assoc.types/iterator.traits/legacy_iterator.compile.pass.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020

2121
#include <array>
2222
#include <deque>
23-
#ifndef TEST_HAS_NO_FILESYSTEM_LIBRARY
23+
#ifndef TEST_HAS_NO_FILESYSTEM
2424
#include <filesystem>
2525
#endif
2626
#include <forward_list>
@@ -61,7 +61,7 @@ static_assert(std::__iterator_traits_detail::__cpp17_iterator<std::deque<int>::r
6161
static_assert(std::__iterator_traits_detail::__cpp17_iterator<std::deque<int>::const_reverse_iterator>);
6262

6363
// <filesystem>
64-
#ifndef TEST_HAS_NO_FILESYSTEM_LIBRARY
64+
#ifndef TEST_HAS_NO_FILESYSTEM
6565
static_assert(std::__iterator_traits_detail::__cpp17_iterator<std::filesystem::directory_iterator>);
6666
static_assert(std::__iterator_traits_detail::__cpp17_iterator<std::filesystem::recursive_directory_iterator>);
6767
#endif

libcxx/test/libcxx/iterators/iterator.requirements/iterator.assoc.types/iterator.traits/legacy_random_access_iterator.compile.pass.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020

2121
#include <array>
2222
#include <deque>
23-
#ifndef TEST_HAS_NO_FILESYSTEM_LIBRARY
23+
#ifndef TEST_HAS_NO_FILESYSTEM
2424
#include <filesystem>
2525
#endif
2626
#include <forward_list>
@@ -61,7 +61,7 @@ static_assert(std::__iterator_traits_detail::__cpp17_random_access_iterator<std:
6161
static_assert(std::__iterator_traits_detail::__cpp17_random_access_iterator<std::deque<int>::const_reverse_iterator>);
6262

6363
// <filesystem>
64-
#ifndef TEST_HAS_NO_FILESYSTEM_LIBRARY
64+
#ifndef TEST_HAS_NO_FILESYSTEM
6565
static_assert(!std::__iterator_traits_detail::__cpp17_random_access_iterator<std::filesystem::directory_iterator>);
6666
static_assert(!std::__iterator_traits_detail::__cpp17_random_access_iterator<std::filesystem::recursive_directory_iterator>);
6767
#endif

libcxx/test/std/input.output/file.streams/lit.local.cfg

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,5 +2,5 @@
22
if "no-localization" in config.available_features:
33
config.unsupported = True
44

5-
if "no-fstream" in config.available_features:
5+
if "no-filesystem" in config.available_features:
66
config.unsupported = True

libcxx/test/std/input.output/stream.buffers/streambuf/streambuf.virtuals/streambuf.virt.put/xsputn.PR14074.pass.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
// basic_streambuf, but I can't seem to reproduce without going through one
1818
// of its derived classes.
1919

20-
// UNSUPPORTED: no-fstream
20+
// UNSUPPORTED: no-filesystem
2121

2222
#include <cassert>
2323
#include <cstddef>

libcxx/test/std/iterators/iterator.primitives/iterator.traits/cxx20_iterator_traits.compile.pass.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@
4040
# include <istream>
4141
#endif
4242

43-
#ifndef TEST_HAS_NO_FILESYSTEM_LIBRARY
43+
#ifndef TEST_HAS_NO_FILESYSTEM
4444
# include <filesystem>
4545
#endif
4646

@@ -156,7 +156,7 @@ static_assert(testConst<std::cregex_iterator, std::forward_iterator_tag, std::cm
156156
static_assert(testConst<std::cregex_token_iterator, std::forward_iterator_tag, std::csub_match>());
157157
#endif // !TEST_HAS_NO_LOCALIZATION
158158

159-
#ifndef TEST_HAS_NO_FILESYSTEM_LIBRARY
159+
#ifndef TEST_HAS_NO_FILESYSTEM
160160
static_assert(test<std::filesystem::directory_iterator, std::input_iterator_tag, std::filesystem::directory_entry,
161161
std::ptrdiff_t, const std::filesystem::directory_entry&, const std::filesystem::directory_entry*>());
162162
static_assert(test<std::filesystem::recursive_directory_iterator, std::input_iterator_tag,

libcxx/test/std/localization/locales/locale.convenience/conversions/conversions.buffer/overflow.pass.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,7 @@ int main(int, char**)
8888
}
8989
}
9090
// TODO: Move this to std::stringstream once https://llvm.org/PR59083 has been resolved
91-
#ifndef TEST_HAS_NO_FSTREAM
91+
#ifndef TEST_HAS_NO_FILESYSTEM
9292
{
9393
{
9494
std::ofstream bs("overflow.dat");
@@ -113,7 +113,7 @@ int main(int, char**)
113113
}
114114
std::remove("overflow.dat");
115115
}
116-
#endif // TEST_HAS_NO_FSTREAM
116+
#endif // TEST_HAS_NO_FILESYSTEM
117117

118118
return 0;
119119
}

libcxx/test/std/localization/locales/locale.convenience/conversions/conversions.buffer/seekoff.pass.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222
// XFAIL: no-wide-characters
2323

2424
// TODO: Avoid using <fstream> in this test.
25-
// XFAIL: no-fstream
25+
// XFAIL: no-filesystem
2626

2727
#include <locale>
2828
#include <codecvt>

libcxx/test/std/utilities/format/format.formattable/concept.formattable.compile.pass.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@
4242
#include "test_macros.h"
4343
#include "min_allocator.h"
4444

45-
#ifndef TEST_HAS_NO_FILESYSTEM_LIBRARY
45+
#ifndef TEST_HAS_NO_FILESYSTEM
4646
# include <filesystem>
4747
#endif
4848
#ifndef TEST_HAS_NO_LOCALIZATION
@@ -182,7 +182,7 @@ void test_P1636() {
182182
assert_is_not_formattable<std::bitset<42>, CharT>();
183183
assert_is_not_formattable<std::complex<double>, CharT>();
184184
assert_is_not_formattable<std::error_code, CharT>();
185-
#ifndef TEST_HAS_NO_FILESYSTEM_LIBRARY
185+
#ifndef TEST_HAS_NO_FILESYSTEM
186186
assert_is_not_formattable<std::filesystem::path, CharT>();
187187
#endif
188188
assert_is_not_formattable<std::shared_ptr<int>, CharT>();

libcxx/test/std/utilities/format/format.range/format.range.fmtkind/format_kind.compile.pass.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@
3535

3636
#include "test_macros.h"
3737

38-
#ifndef TEST_HAS_NO_FILESYSTEM_LIBRARY
38+
#ifndef TEST_HAS_NO_FILESYSTEM
3939
# include <filesystem>
4040
#endif
4141

@@ -67,7 +67,7 @@ struct recursive_range {
6767
static_assert(std::ranges::input_range<recursive_range>, "format_kind requires an input range");
6868
static_assert(std::format_kind<recursive_range> == std::range_format::disabled);
6969

70-
#ifndef TEST_HAS_NO_FILESYSTEM_LIBRARY
70+
#ifndef TEST_HAS_NO_FILESYSTEM
7171
static_assert(std::format_kind<std::filesystem::path> == std::range_format::disabled);
7272
#endif
7373

libcxx/test/support/test_macros.h

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -386,12 +386,8 @@ inline void DoNotOptimize(Tp const& value) {
386386
# define TEST_HAS_NO_THREADS
387387
#endif
388388

389-
#if defined(_LIBCPP_HAS_NO_FILESYSTEM_LIBRARY)
390-
# define TEST_HAS_NO_FILESYSTEM_LIBRARY
391-
#endif
392-
393-
#if defined(_LIBCPP_HAS_NO_FSTREAM)
394-
# define TEST_HAS_NO_FSTREAM
389+
#if defined(_LIBCPP_HAS_NO_FILESYSTEM)
390+
# define TEST_HAS_NO_FILESYSTEM
395391
#endif
396392

397393
#if defined(_LIBCPP_HAS_NO_FGETPOS_FSETPOS)

0 commit comments

Comments
 (0)