Skip to content

Commit 0e0a681

Browse files
committed
Use _LIBCPP_LIBC_NEWLIB instead of _NEWLIB_VERSION
Use _LIBCPP_LIBC_NEWLIB instead of _NEWLIB_VERSION in the downstream change to enable fstream independently from filesystem to align with the new way of specifying the C library in use woth libcxx, see llvm/llvm-project#147956 Downstream issue: arm#375
1 parent 31770e4 commit 0e0a681

File tree

4 files changed

+5
-5
lines changed

4 files changed

+5
-5
lines changed

libcxx/include/fstream

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -192,7 +192,7 @@ typedef basic_fstream<wchar_t> wfstream;
192192
# include <__config>
193193

194194
// Downstream issue: #375 (Enable fstream independently of filesystem)
195-
# if _LIBCPP_HAS_FILESYSTEM && _LIBCPP_HAS_LOCALIZATION || defined(_NEWLIB_VERSION)
195+
# if _LIBCPP_HAS_FILESYSTEM && _LIBCPP_HAS_LOCALIZATION || defined(_LIBCPP_LIBC_NEWLIB)
196196

197197
# include <__algorithm/max.h>
198198
# include <__assert>

libcxx/src/ios.instantiations.cpp

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

4040
// Downstream issue: #375 (Enable fstream independently of filesystem)
41-
#if _LIBCPP_HAS_FILESYSTEM || defined(_NEWLIB_VERSION)
41+
#if _LIBCPP_HAS_FILESYSTEM || defined(_LIBCPP_LIBC_NEWLIB)
4242
template class _LIBCPP_CLASS_TEMPLATE_INSTANTIATION_VIS basic_ifstream<char>;
4343
template class _LIBCPP_CLASS_TEMPLATE_INSTANTIATION_VIS basic_ofstream<char>;
4444
template class _LIBCPP_CLASS_TEMPLATE_INSTANTIATION_VIS basic_filebuf<char>;

libcxx/src/ostream.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
#include <__config>
1010

1111
// Downstream issue: #375 (Enable fstream independently of filesystem)
12-
#if _LIBCPP_HAS_FILESYSTEM || defined(_NEWLIB_VERSION)
12+
#if _LIBCPP_HAS_FILESYSTEM || defined(_LIBCPP_LIBC_NEWLIB)
1313
# include <fstream>
1414
#endif
1515
#include <ostream>

libcxx/test/support/platform_support.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@
4141
# include <fcntl.h> // _O_EXCL, ...
4242
# include <sys/stat.h> // _S_IREAD, ...
4343
// Downstream issue: #375 (Enable fstream independently of filesystem)
44-
#elif defined(_NEWLIB_VERSION)
44+
#elif defined(_LIBCPP_LIBC_NEWLIB)
4545
// No need to include extra headers for the get_temp_file_name() implementation
4646
// below: tmpnam() is defined in <stdio.h>
4747
#elif __has_include(<unistd.h>)
@@ -75,7 +75,7 @@ inline std::string get_temp_file_name() {
7575
abort();
7676
}
7777
// Downstream issue: #375 (Enable fstream independently of filesystem)
78-
#elif defined(_NEWLIB_VERSION)
78+
#elif defined(_LIBCPP_LIBC_NEWLIB)
7979
char tmp_name[L_tmpnam];
8080
char *ret = tmpnam(tmp_name);
8181
if (ret == NULL) {

0 commit comments

Comments
 (0)