diff --git a/libcxx/CMakeLists.txt b/libcxx/CMakeLists.txt --- a/libcxx/CMakeLists.txt +++ b/libcxx/CMakeLists.txt @@ -263,11 +263,7 @@ # Feature options ------------------------------------------------------------- option(LIBCXX_ENABLE_EXCEPTIONS "Use exceptions." ON) option(LIBCXX_ENABLE_RTTI "Use run time type information." ON) -option(LIBCXX_ENABLE_GLOBAL_FILESYSTEM_NAMESPACE "Build libc++ with support for the global filesystem namespace." ON) -option(LIBCXX_ENABLE_STDIN "Build libc++ with support for stdin/std::cin." ON) -option(LIBCXX_ENABLE_STDOUT "Build libc++ with support for stdout/std::cout." ON) option(LIBCXX_ENABLE_THREADS "Build libc++ with support for threads." ON) -option(LIBCXX_ENABLE_THREAD_UNSAFE_C_FUNCTIONS "Build libc++ with support for thread-unsafe C functions" ON) option(LIBCXX_ENABLE_MONOTONIC_CLOCK "Build libc++ with support for a monotonic clock. This option may only be set to OFF when LIBCXX_ENABLE_THREADS=OFF." ON) @@ -868,12 +864,8 @@ config_define_if(LIBCXX_ABI_FORCE_ITANIUM _LIBCPP_ABI_FORCE_ITANIUM) config_define_if(LIBCXX_ABI_FORCE_MICROSOFT _LIBCPP_ABI_FORCE_MICROSOFT) config_define_if(LIBCXX_HIDE_FROM_ABI_PER_TU_BY_DEFAULT _LIBCPP_HIDE_FROM_ABI_PER_TU_BY_DEFAULT) -config_define_if_not(LIBCXX_ENABLE_GLOBAL_FILESYSTEM_NAMESPACE _LIBCPP_HAS_NO_GLOBAL_FILESYSTEM_NAMESPACE) -config_define_if_not(LIBCXX_ENABLE_STDIN _LIBCPP_HAS_NO_STDIN) -config_define_if_not(LIBCXX_ENABLE_STDOUT _LIBCPP_HAS_NO_STDOUT) config_define_if_not(LIBCXX_ENABLE_THREADS _LIBCPP_HAS_NO_THREADS) config_define_if_not(LIBCXX_ENABLE_MONOTONIC_CLOCK _LIBCPP_HAS_NO_MONOTONIC_CLOCK) -config_define_if_not(LIBCXX_ENABLE_THREAD_UNSAFE_C_FUNCTIONS _LIBCPP_HAS_NO_THREAD_UNSAFE_C_FUNCTIONS) if (NOT LIBCXX_TYPEINFO_COMPARISON_IMPLEMENTATION STREQUAL "default") config_define("${LIBCXX_TYPEINFO_COMPARISON_IMPLEMENTATION}" _LIBCPP_TYPEINFO_COMPARISON_IMPLEMENTATION) endif() diff --git a/libcxx/docs/DesignDocs/CapturingConfigInfo.rst b/libcxx/docs/DesignDocs/CapturingConfigInfo.rst --- a/libcxx/docs/DesignDocs/CapturingConfigInfo.rst +++ b/libcxx/docs/DesignDocs/CapturingConfigInfo.rst @@ -65,12 +65,8 @@ #ifndef _LIBCPP_CONFIG_SITE #define _LIBCPP_CONFIG_SITE - /* #undef _LIBCPP_HAS_NO_GLOBAL_FILESYSTEM_NAMESPACE */ - /* #undef _LIBCPP_HAS_NO_STDIN */ - /* #undef _LIBCPP_HAS_NO_STDOUT */ #define _LIBCPP_HAS_NO_THREADS /* #undef _LIBCPP_HAS_NO_MONOTONIC_CLOCK */ - /* #undef _LIBCPP_HAS_NO_THREAD_UNSAFE_C_FUNCTIONS */ #endif // -*- C++ -*- diff --git a/libcxx/include/__config b/libcxx/include/__config --- a/libcxx/include/__config +++ b/libcxx/include/__config @@ -318,7 +318,7 @@ # endif #endif // __sun__ -#if defined(__OpenBSD__) || defined(__CloudABI__) +#if defined(__OpenBSD__) // Certain architectures provide arc4random(). Prefer using // arc4random() over /dev/{u,}random to make it possible to obtain // random data even when using sandboxing mechanisms such as chroots, @@ -935,7 +935,7 @@ #endif #if defined(__APPLE__) || defined(__FreeBSD__) || defined(_LIBCPP_MSVCRT_LIKE) || \ - defined(__sun__) || defined(__NetBSD__) || defined(__CloudABI__) + defined(__sun__) || defined(__NetBSD__) #define _LIBCPP_LOCALE__L_EXTENSIONS 1 #endif @@ -1139,7 +1139,6 @@ defined(__linux__) || \ defined(__GNU__) || \ defined(__APPLE__) || \ - defined(__CloudABI__) || \ defined(__sun__) || \ defined(__MVS__) || \ defined(_AIX) || \ @@ -1213,21 +1212,6 @@ # define _LIBCPP_HAS_TRIVIAL_CONDVAR_DESTRUCTION #endif -// Systems that use capability-based security (FreeBSD with Capsicum, -// Nuxi CloudABI) may only provide local filesystem access (using *at()). -// Functions like open(), rename(), unlink() and stat() should not be -// used, as they attempt to access the global filesystem namespace. -#ifdef __CloudABI__ -#define _LIBCPP_HAS_NO_GLOBAL_FILESYSTEM_NAMESPACE -#endif - -// CloudABI is intended for running networked services. Processes do not -// have standard input and output channels. -#ifdef __CloudABI__ -#define _LIBCPP_HAS_NO_STDIN -#define _LIBCPP_HAS_NO_STDOUT -#endif - // Some systems do not provide gets() in their C library, for security reasons. #if defined(_LIBCPP_MSVCRT) || \ (defined(__FreeBSD_version) && __FreeBSD_version >= 1300043) || \ @@ -1235,18 +1219,12 @@ # define _LIBCPP_C_HAS_NO_GETS #endif -#if defined(__BIONIC__) || defined(__CloudABI__) || defined(__NuttX__) || \ +#if defined(__BIONIC__) || defined(__NuttX__) || \ defined(__Fuchsia__) || defined(__wasi__) || defined(_LIBCPP_HAS_MUSL_LIBC) || \ defined(__MVS__) || defined(__OpenBSD__) #define _LIBCPP_PROVIDES_DEFAULT_RUNE_TABLE #endif -// Thread-unsafe functions such as strtok() and localtime() -// are not available. -#ifdef __CloudABI__ -#define _LIBCPP_HAS_NO_THREAD_UNSAFE_C_FUNCTIONS -#endif - #if __has_feature(cxx_atomic) || __has_extension(c_atomic) || __has_keyword(_Atomic) # define _LIBCPP_HAS_C_ATOMIC_IMP #elif defined(_LIBCPP_COMPILER_GCC) diff --git a/libcxx/include/__config_site.in b/libcxx/include/__config_site.in --- a/libcxx/include/__config_site.in +++ b/libcxx/include/__config_site.in @@ -14,12 +14,8 @@ #cmakedefine _LIBCPP_ABI_FORCE_ITANIUM #cmakedefine _LIBCPP_ABI_FORCE_MICROSOFT #cmakedefine _LIBCPP_HIDE_FROM_ABI_PER_TU_BY_DEFAULT -#cmakedefine _LIBCPP_HAS_NO_GLOBAL_FILESYSTEM_NAMESPACE -#cmakedefine _LIBCPP_HAS_NO_STDIN -#cmakedefine _LIBCPP_HAS_NO_STDOUT #cmakedefine _LIBCPP_HAS_NO_THREADS #cmakedefine _LIBCPP_HAS_NO_MONOTONIC_CLOCK -#cmakedefine _LIBCPP_HAS_NO_THREAD_UNSAFE_C_FUNCTIONS #cmakedefine _LIBCPP_HAS_MUSL_LIBC #cmakedefine _LIBCPP_HAS_THREAD_API_PTHREAD #cmakedefine _LIBCPP_HAS_THREAD_API_EXTERNAL diff --git a/libcxx/include/clocale b/libcxx/include/clocale --- a/libcxx/include/clocale +++ b/libcxx/include/clocale @@ -44,9 +44,7 @@ _LIBCPP_BEGIN_NAMESPACE_STD using ::lconv _LIBCPP_USING_IF_EXISTS; -#ifndef _LIBCPP_HAS_NO_THREAD_UNSAFE_C_FUNCTIONS using ::setlocale _LIBCPP_USING_IF_EXISTS; -#endif using ::localeconv _LIBCPP_USING_IF_EXISTS; _LIBCPP_END_NAMESPACE_STD diff --git a/libcxx/include/cstdio b/libcxx/include/cstdio --- a/libcxx/include/cstdio +++ b/libcxx/include/cstdio @@ -145,30 +145,24 @@ using ::ferror _LIBCPP_USING_IF_EXISTS; using ::perror _LIBCPP_USING_IF_EXISTS; -#ifndef _LIBCPP_HAS_NO_GLOBAL_FILESYSTEM_NAMESPACE using ::fopen _LIBCPP_USING_IF_EXISTS; using ::freopen _LIBCPP_USING_IF_EXISTS; using ::remove _LIBCPP_USING_IF_EXISTS; using ::rename _LIBCPP_USING_IF_EXISTS; using ::tmpfile _LIBCPP_USING_IF_EXISTS; using ::tmpnam _LIBCPP_USING_IF_EXISTS; -#endif -#ifndef _LIBCPP_HAS_NO_STDIN using ::getchar _LIBCPP_USING_IF_EXISTS; #if _LIBCPP_STD_VER <= 11 && !defined(_LIBCPP_C_HAS_NO_GETS) using ::gets _LIBCPP_USING_IF_EXISTS; #endif using ::scanf _LIBCPP_USING_IF_EXISTS; using ::vscanf _LIBCPP_USING_IF_EXISTS; -#endif -#ifndef _LIBCPP_HAS_NO_STDOUT using ::printf _LIBCPP_USING_IF_EXISTS; using ::putchar _LIBCPP_USING_IF_EXISTS; using ::puts _LIBCPP_USING_IF_EXISTS; using ::vprintf _LIBCPP_USING_IF_EXISTS; -#endif _LIBCPP_END_NAMESPACE_STD diff --git a/libcxx/include/cstring b/libcxx/include/cstring --- a/libcxx/include/cstring +++ b/libcxx/include/cstring @@ -84,9 +84,7 @@ using ::strrchr _LIBCPP_USING_IF_EXISTS; using ::strspn _LIBCPP_USING_IF_EXISTS; using ::strstr _LIBCPP_USING_IF_EXISTS; -#ifndef _LIBCPP_HAS_NO_THREAD_UNSAFE_C_FUNCTIONS using ::strtok _LIBCPP_USING_IF_EXISTS; -#endif using ::memset _LIBCPP_USING_IF_EXISTS; using ::strerror _LIBCPP_USING_IF_EXISTS; using ::strlen _LIBCPP_USING_IF_EXISTS; diff --git a/libcxx/include/ctime b/libcxx/include/ctime --- a/libcxx/include/ctime +++ b/libcxx/include/ctime @@ -79,12 +79,10 @@ using ::difftime _LIBCPP_USING_IF_EXISTS; using ::mktime _LIBCPP_USING_IF_EXISTS; using ::time _LIBCPP_USING_IF_EXISTS; -#ifndef _LIBCPP_HAS_NO_THREAD_UNSAFE_C_FUNCTIONS using ::asctime _LIBCPP_USING_IF_EXISTS; using ::ctime _LIBCPP_USING_IF_EXISTS; using ::gmtime _LIBCPP_USING_IF_EXISTS; using ::localtime _LIBCPP_USING_IF_EXISTS; -#endif using ::strftime _LIBCPP_USING_IF_EXISTS; #if _LIBCPP_STD_VER > 14 && defined(_LIBCPP_HAS_TIMESPEC_GET) && !defined(_LIBCPP_HAS_TIMESPEC_GET_NOT_ACTUALLY_PROVIDED) using ::timespec_get _LIBCPP_USING_IF_EXISTS; diff --git a/libcxx/include/cwchar b/libcxx/include/cwchar --- a/libcxx/include/cwchar +++ b/libcxx/include/cwchar @@ -175,17 +175,13 @@ using ::mbsrtowcs _LIBCPP_USING_IF_EXISTS; using ::wcsrtombs _LIBCPP_USING_IF_EXISTS; -#ifndef _LIBCPP_HAS_NO_STDIN using ::getwchar _LIBCPP_USING_IF_EXISTS; using ::vwscanf _LIBCPP_USING_IF_EXISTS; using ::wscanf _LIBCPP_USING_IF_EXISTS; -#endif -#ifndef _LIBCPP_HAS_NO_STDOUT using ::putwchar _LIBCPP_USING_IF_EXISTS; using ::vwprintf _LIBCPP_USING_IF_EXISTS; using ::wprintf _LIBCPP_USING_IF_EXISTS; -#endif _LIBCPP_END_NAMESPACE_STD diff --git a/libcxx/include/fstream b/libcxx/include/fstream --- a/libcxx/include/fstream +++ b/libcxx/include/fstream @@ -230,7 +230,6 @@ // 27.9.1.4 Members: _LIBCPP_INLINE_VISIBILITY bool is_open() const; -#ifndef _LIBCPP_HAS_NO_GLOBAL_FILESYSTEM_NAMESPACE basic_filebuf* open(const char* __s, ios_base::openmode __mode); #ifdef _LIBCPP_HAS_OPEN_WITH_WCHAR basic_filebuf* open(const wchar_t* __s, ios_base::openmode __mode); @@ -246,7 +245,6 @@ #endif _LIBCPP_INLINE_VISIBILITY basic_filebuf* __open(int __fd, ios_base::openmode __mode); -#endif basic_filebuf* close(); _LIBCPP_INLINE_VISIBILITY @@ -542,7 +540,6 @@ _LIBCPP_UNREACHABLE(); } -#ifndef _LIBCPP_HAS_NO_GLOBAL_FILESYSTEM_NAMESPACE template basic_filebuf<_CharT, _Traits>* basic_filebuf<_CharT, _Traits>::open(const char* __s, ios_base::openmode __mode) @@ -685,7 +682,6 @@ { return open(__s.c_str(), __mode); } -#endif template basic_filebuf<_CharT, _Traits>* @@ -1141,7 +1137,6 @@ _LIBCPP_INLINE_VISIBILITY basic_ifstream(); -#ifndef _LIBCPP_HAS_NO_GLOBAL_FILESYSTEM_NAMESPACE _LIBCPP_INLINE_VISIBILITY explicit basic_ifstream(const char* __s, ios_base::openmode __mode = ios_base::in); #ifdef _LIBCPP_HAS_OPEN_WITH_WCHAR @@ -1155,7 +1150,6 @@ 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_INLINE_VISIBILITY basic_ifstream(basic_ifstream&& __rhs); _LIBCPP_INLINE_VISIBILITY @@ -1167,7 +1161,6 @@ basic_filebuf* rdbuf() const; _LIBCPP_INLINE_VISIBILITY bool is_open() const; -#ifndef _LIBCPP_HAS_NO_GLOBAL_FILESYSTEM_NAMESPACE void open(const char* __s, ios_base::openmode __mode = ios_base::in); #ifdef _LIBCPP_HAS_OPEN_WITH_WCHAR void open(const wchar_t* __s, ios_base::openmode __mode = ios_base::in); @@ -1183,7 +1176,6 @@ _LIBCPP_INLINE_VISIBILITY void __open(int __fd, ios_base::openmode __mode); -#endif _LIBCPP_INLINE_VISIBILITY void close(); @@ -1198,7 +1190,6 @@ { } -#ifndef _LIBCPP_HAS_NO_GLOBAL_FILESYSTEM_NAMESPACE template inline basic_ifstream<_CharT, _Traits>::basic_ifstream(const char* __s, ios_base::openmode __mode) @@ -1227,7 +1218,6 @@ if (__sb_.open(__s, __mode | ios_base::in) == nullptr) this->setstate(ios_base::failbit); } -#endif template inline @@ -1281,7 +1271,6 @@ return __sb_.is_open(); } -#ifndef _LIBCPP_HAS_NO_GLOBAL_FILESYSTEM_NAMESPACE template void basic_ifstream<_CharT, _Traits>::open(const char* __s, ios_base::openmode __mode) @@ -1323,7 +1312,6 @@ else this->setstate(ios_base::failbit); } -#endif template inline @@ -1375,7 +1363,6 @@ basic_filebuf* rdbuf() const; _LIBCPP_INLINE_VISIBILITY bool is_open() const; -#ifndef _LIBCPP_HAS_NO_GLOBAL_FILESYSTEM_NAMESPACE void open(const char* __s, ios_base::openmode __mode = ios_base::out); #ifdef _LIBCPP_HAS_OPEN_WITH_WCHAR void open(const wchar_t* __s, ios_base::openmode __mode = ios_base::out); @@ -1390,7 +1377,6 @@ _LIBCPP_INLINE_VISIBILITY void __open(int __fd, ios_base::openmode __mode); -#endif _LIBCPP_INLINE_VISIBILITY void close(); @@ -1405,7 +1391,6 @@ { } -#ifndef _LIBCPP_HAS_NO_GLOBAL_FILESYSTEM_NAMESPACE template inline basic_ofstream<_CharT, _Traits>::basic_ofstream(const char* __s, ios_base::openmode __mode) @@ -1434,7 +1419,6 @@ if (__sb_.open(__s, __mode | ios_base::out) == nullptr) this->setstate(ios_base::failbit); } -#endif template inline @@ -1488,7 +1472,6 @@ return __sb_.is_open(); } -#ifndef _LIBCPP_HAS_NO_GLOBAL_FILESYSTEM_NAMESPACE template void basic_ofstream<_CharT, _Traits>::open(const char* __s, ios_base::openmode __mode) @@ -1530,7 +1513,6 @@ else this->setstate(ios_base::failbit); } -#endif template inline @@ -1556,7 +1538,6 @@ _LIBCPP_INLINE_VISIBILITY basic_fstream(); -#ifndef _LIBCPP_HAS_NO_GLOBAL_FILESYSTEM_NAMESPACE _LIBCPP_INLINE_VISIBILITY explicit basic_fstream(const char* __s, ios_base::openmode __mode = ios_base::in | ios_base::out); #ifdef _LIBCPP_HAS_OPEN_WITH_WCHAR @@ -1572,7 +1553,6 @@ : basic_fstream(__p.c_str(), __mode) {} #endif // _LIBCPP_STD_VER >= 17 -#endif _LIBCPP_INLINE_VISIBILITY basic_fstream(basic_fstream&& __rhs); @@ -1586,7 +1566,6 @@ basic_filebuf* rdbuf() const; _LIBCPP_INLINE_VISIBILITY bool is_open() const; -#ifndef _LIBCPP_HAS_NO_GLOBAL_FILESYSTEM_NAMESPACE void open(const char* __s, ios_base::openmode __mode = ios_base::in | ios_base::out); #ifdef _LIBCPP_HAS_OPEN_WITH_WCHAR void open(const wchar_t* __s, ios_base::openmode __mode = ios_base::in | ios_base::out); @@ -1599,7 +1578,6 @@ { return open(__p.c_str(), __mode); } #endif // _LIBCPP_STD_VER >= 17 -#endif _LIBCPP_INLINE_VISIBILITY void close(); @@ -1614,7 +1592,6 @@ { } -#ifndef _LIBCPP_HAS_NO_GLOBAL_FILESYSTEM_NAMESPACE template inline basic_fstream<_CharT, _Traits>::basic_fstream(const char* __s, ios_base::openmode __mode) @@ -1643,7 +1620,6 @@ if (__sb_.open(__s, __mode) == nullptr) this->setstate(ios_base::failbit); } -#endif template inline @@ -1697,7 +1673,6 @@ return __sb_.is_open(); } -#ifndef _LIBCPP_HAS_NO_GLOBAL_FILESYSTEM_NAMESPACE template void basic_fstream<_CharT, _Traits>::open(const char* __s, ios_base::openmode __mode) @@ -1729,7 +1704,6 @@ else this->setstate(ios_base::failbit); } -#endif template inline diff --git a/libcxx/include/iostream b/libcxx/include/iostream --- a/libcxx/include/iostream +++ b/libcxx/include/iostream @@ -45,14 +45,10 @@ _LIBCPP_BEGIN_NAMESPACE_STD -#ifndef _LIBCPP_HAS_NO_STDIN extern _LIBCPP_FUNC_VIS istream cin; extern _LIBCPP_FUNC_VIS wistream wcin; -#endif -#ifndef _LIBCPP_HAS_NO_STDOUT extern _LIBCPP_FUNC_VIS ostream cout; extern _LIBCPP_FUNC_VIS wostream wcout; -#endif extern _LIBCPP_FUNC_VIS ostream cerr; extern _LIBCPP_FUNC_VIS wostream wcerr; extern _LIBCPP_FUNC_VIS ostream clog; diff --git a/libcxx/include/locale b/libcxx/include/locale --- a/libcxx/include/locale +++ b/libcxx/include/locale @@ -230,7 +230,7 @@ #if defined(__APPLE__) || defined(__FreeBSD__) # define _LIBCPP_GET_C_LOCALE 0 -#elif defined(__CloudABI__) || defined(__NetBSD__) +#elif defined(__NetBSD__) # define _LIBCPP_GET_C_LOCALE LC_C_LOCALE #else # define _LIBCPP_GET_C_LOCALE __cloc() diff --git a/libcxx/src/iostream.cpp b/libcxx/src/iostream.cpp --- a/libcxx/src/iostream.cpp +++ b/libcxx/src/iostream.cpp @@ -17,7 +17,6 @@ _LIBCPP_BEGIN_NAMESPACE_STD -#ifndef _LIBCPP_HAS_NO_STDIN _ALIGNAS_TYPE (istream) _LIBCPP_FUNC_VIS char cin[sizeof(istream)] #if defined(_LIBCPP_ABI_MICROSOFT) && defined(__clang__) __asm__("?cin@" _LIBCPP_ABI_NAMESPACE_STR "@std@@3V?$basic_istream@DU?$char_traits@D@" _LIBCPP_ABI_NAMESPACE_STR "@std@@@12@A") @@ -32,9 +31,7 @@ ; _ALIGNAS_TYPE (__stdinbuf ) static char __wcin[sizeof(__stdinbuf )]; static mbstate_t mb_wcin; -#endif -#ifndef _LIBCPP_HAS_NO_STDOUT _ALIGNAS_TYPE (ostream) _LIBCPP_FUNC_VIS char cout[sizeof(ostream)] #if defined(_LIBCPP_ABI_MICROSOFT) && defined(__clang__) __asm__("?cout@" _LIBCPP_ABI_NAMESPACE_STR "@std@@3V?$basic_ostream@DU?$char_traits@D@" _LIBCPP_ABI_NAMESPACE_STR "@std@@@12@A") @@ -49,7 +46,6 @@ ; _ALIGNAS_TYPE (__stdoutbuf) static char __wcout[sizeof(__stdoutbuf)]; static mbstate_t mb_wcout; -#endif _ALIGNAS_TYPE (ostream) _LIBCPP_FUNC_VIS char cerr[sizeof(ostream)] #if defined(_LIBCPP_ABI_MICROSOFT) && defined(__clang__) @@ -107,39 +103,29 @@ { force_locale_initialization(); -#ifndef _LIBCPP_HAS_NO_STDIN istream* cin_ptr = ::new(cin) istream(::new(__cin) __stdinbuf (stdin, &mb_cin)); wistream* wcin_ptr = ::new(wcin) wistream(::new(__wcin) __stdinbuf (stdin, &mb_wcin)); -#endif -#ifndef _LIBCPP_HAS_NO_STDOUT ostream* cout_ptr = ::new(cout) ostream(::new(__cout) __stdoutbuf(stdout, &mb_cout)); wostream* wcout_ptr = ::new(wcout) wostream(::new(__wcout) __stdoutbuf(stdout, &mb_wcout)); -#endif ostream* cerr_ptr = ::new(cerr) ostream(::new(__cerr) __stdoutbuf(stderr, &mb_cerr)); ::new(clog) ostream(cerr_ptr->rdbuf()); wostream* wcerr_ptr = ::new(wcerr) wostream(::new(__wcerr) __stdoutbuf(stderr, &mb_wcerr)); ::new(wclog) wostream(wcerr_ptr->rdbuf()); -#if !defined(_LIBCPP_HAS_NO_STDIN) && !defined(_LIBCPP_HAS_NO_STDOUT) cin_ptr->tie(cout_ptr); wcin_ptr->tie(wcout_ptr); -#endif _VSTD::unitbuf(*cerr_ptr); _VSTD::unitbuf(*wcerr_ptr); -#ifndef _LIBCPP_HAS_NO_STDOUT cerr_ptr->tie(cout_ptr); wcerr_ptr->tie(wcout_ptr); -#endif } DoIOSInit::~DoIOSInit() { -#ifndef _LIBCPP_HAS_NO_STDOUT ostream* cout_ptr = reinterpret_cast(cout); wostream* wcout_ptr = reinterpret_cast(wcout); cout_ptr->flush(); wcout_ptr->flush(); -#endif ostream* clog_ptr = reinterpret_cast(clog); wostream* wclog_ptr = reinterpret_cast(wclog); diff --git a/libcxx/test/libcxx/input.output/file.streams/c.files/no.global.filesystem.namespace/fopen.compile.fail.cpp b/libcxx/test/libcxx/input.output/file.streams/c.files/no.global.filesystem.namespace/fopen.compile.fail.cpp deleted file mode 100644 --- a/libcxx/test/libcxx/input.output/file.streams/c.files/no.global.filesystem.namespace/fopen.compile.fail.cpp +++ /dev/null @@ -1,18 +0,0 @@ -//===----------------------------------------------------------------------===// -// -// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. -// See https://llvm.org/LICENSE.txt for license information. -// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception -// -//===----------------------------------------------------------------------===// - -// REQUIRES: libcpp-has-no-global-filesystem-namespace - -#include - -int main(int, char**) { - // fopen is not available on systems without a global filesystem namespace. - std::fopen("", ""); - - return 0; -} diff --git a/libcxx/test/libcxx/input.output/file.streams/c.files/no.global.filesystem.namespace/rename.compile.fail.cpp b/libcxx/test/libcxx/input.output/file.streams/c.files/no.global.filesystem.namespace/rename.compile.fail.cpp deleted file mode 100644 --- a/libcxx/test/libcxx/input.output/file.streams/c.files/no.global.filesystem.namespace/rename.compile.fail.cpp +++ /dev/null @@ -1,18 +0,0 @@ -//===----------------------------------------------------------------------===// -// -// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. -// See https://llvm.org/LICENSE.txt for license information. -// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception -// -//===----------------------------------------------------------------------===// - -// REQUIRES: libcpp-has-no-global-filesystem-namespace - -#include - -int main(int, char**) { - // rename is not available on systems without a global filesystem namespace. - std::rename("", ""); - - return 0; -} diff --git a/libcxx/test/libcxx/utilities/time/date.time/asctime.thread-unsafe.compile.fail.cpp b/libcxx/test/libcxx/utilities/time/date.time/asctime.thread-unsafe.compile.fail.cpp deleted file mode 100644 --- a/libcxx/test/libcxx/utilities/time/date.time/asctime.thread-unsafe.compile.fail.cpp +++ /dev/null @@ -1,19 +0,0 @@ -//===----------------------------------------------------------------------===// -// -// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. -// See https://llvm.org/LICENSE.txt for license information. -// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception -// -//===----------------------------------------------------------------------===// - -// REQUIRES: libcpp-has-no-thread-unsafe-c-functions - -#include - -int main(int, char**) { - // asctime is not thread-safe. - std::time_t t = 0; - std::asctime(&t); - - return 0; -} diff --git a/libcxx/test/libcxx/utilities/time/date.time/ctime.thread-unsafe.compile.fail.cpp b/libcxx/test/libcxx/utilities/time/date.time/ctime.thread-unsafe.compile.fail.cpp deleted file mode 100644 --- a/libcxx/test/libcxx/utilities/time/date.time/ctime.thread-unsafe.compile.fail.cpp +++ /dev/null @@ -1,19 +0,0 @@ -//===----------------------------------------------------------------------===// -// -// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. -// See https://llvm.org/LICENSE.txt for license information. -// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception -// -//===----------------------------------------------------------------------===// - -// REQUIRES: libcpp-has-no-thread-unsafe-c-functions - -#include - -int main(int, char**) { - // ctime is not thread-safe. - std::time_t t = 0; - std::ctime(&t); - - return 0; -} diff --git a/libcxx/test/libcxx/utilities/time/date.time/gmtime.thread-unsafe.compile.fail.cpp b/libcxx/test/libcxx/utilities/time/date.time/gmtime.thread-unsafe.compile.fail.cpp deleted file mode 100644 --- a/libcxx/test/libcxx/utilities/time/date.time/gmtime.thread-unsafe.compile.fail.cpp +++ /dev/null @@ -1,19 +0,0 @@ -//===----------------------------------------------------------------------===// -// -// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. -// See https://llvm.org/LICENSE.txt for license information. -// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception -// -//===----------------------------------------------------------------------===// - -// REQUIRES: libcpp-has-no-thread-unsafe-c-functions - -#include - -int main(int, char**) { - // gmtime is not thread-safe. - std::time_t t = 0; - std::gmtime(&t); - - return 0; -} diff --git a/libcxx/test/libcxx/utilities/time/date.time/localtime.thread-unsafe.compile.fail.cpp b/libcxx/test/libcxx/utilities/time/date.time/localtime.thread-unsafe.compile.fail.cpp deleted file mode 100644 --- a/libcxx/test/libcxx/utilities/time/date.time/localtime.thread-unsafe.compile.fail.cpp +++ /dev/null @@ -1,19 +0,0 @@ -//===----------------------------------------------------------------------===// -// -// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. -// See https://llvm.org/LICENSE.txt for license information. -// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception -// -//===----------------------------------------------------------------------===// - -// REQUIRES: libcpp-has-no-thread-unsafe-c-functions - -#include - -int main(int, char**) { - // localtime is not thread-safe. - std::time_t t = 0; - std::localtime(&t); - - return 0; -} diff --git a/libcxx/test/std/depr/depr.c.headers/string_h.pass.cpp b/libcxx/test/std/depr/depr.c.headers/string_h.pass.cpp --- a/libcxx/test/std/depr/depr.c.headers/string_h.pass.cpp +++ b/libcxx/test/std/depr/depr.c.headers/string_h.pass.cpp @@ -47,9 +47,7 @@ ASSERT_SAME_TYPE(size_t, decltype(strspn(cpc, cpc))); ASSERT_SAME_TYPE(char*, decltype(strstr(cp, cpc))); ASSERT_SAME_TYPE(const char*, decltype(strstr(cpc, cpc))); -#ifndef _LIBCPP_HAS_NO_THREAD_UNSAFE_C_FUNCTIONS ASSERT_SAME_TYPE(char*, decltype(strtok(cp, cpc))); -#endif ASSERT_SAME_TYPE(void*, decltype(memset(vp, 0, s))); ASSERT_SAME_TYPE(char*, decltype(strerror(0))); ASSERT_SAME_TYPE(size_t, decltype(strlen(cpc))); diff --git a/libcxx/test/std/depr/depr.c.headers/wchar_h.pass.cpp b/libcxx/test/std/depr/depr.c.headers/wchar_h.pass.cpp --- a/libcxx/test/std/depr/depr.c.headers/wchar_h.pass.cpp +++ b/libcxx/test/std/depr/depr.c.headers/wchar_h.pass.cpp @@ -115,18 +115,12 @@ ASSERT_SAME_TYPE(size_t, decltype(wcrtomb(ns, L' ', &mb))); ASSERT_SAME_TYPE(size_t, decltype(mbsrtowcs(ws, (const char**)0, s, &mb))); ASSERT_SAME_TYPE(size_t, decltype(wcsrtombs(ns, (const wchar_t**)0, s, &mb))); - -#ifndef _LIBCPP_HAS_NO_STDIN ASSERT_SAME_TYPE(wint_t, decltype(getwchar())); ASSERT_SAME_TYPE(int, decltype(vwscanf(L"", va))); ASSERT_SAME_TYPE(int, decltype(wscanf(L""))); -#endif - -#ifndef _LIBCPP_HAS_NO_STDOUT ASSERT_SAME_TYPE(wint_t, decltype(putwchar(L' '))); ASSERT_SAME_TYPE(int, decltype(vwprintf(L"", va))); ASSERT_SAME_TYPE(int, decltype(wprintf(L""))); -#endif return 0; } diff --git a/libcxx/test/std/input.output/file.streams/c.files/cstdio.pass.cpp b/libcxx/test/std/input.output/file.streams/c.files/cstdio.pass.cpp --- a/libcxx/test/std/input.output/file.streams/c.files/cstdio.pass.cpp +++ b/libcxx/test/std/input.output/file.streams/c.files/cstdio.pass.cpp @@ -136,16 +136,13 @@ static_assert((std::is_same::value), ""); static_assert((std::is_same::value), ""); -#ifndef _LIBCPP_HAS_NO_GLOBAL_FILESYSTEM_NAMESPACE static_assert((std::is_same::value), ""); static_assert((std::is_same::value), ""); static_assert((std::is_same::value), ""); static_assert((std::is_same::value), ""); static_assert((std::is_same::value), ""); static_assert((std::is_same::value), ""); -#endif -#ifndef _LIBCPP_HAS_NO_STDIN static_assert((std::is_same::value), ""); #if TEST_STD_VER <= 11 # pragma GCC diagnostic push @@ -155,14 +152,11 @@ #endif static_assert((std::is_same::value), ""); static_assert((std::is_same::value), ""); -#endif -#ifndef _LIBCPP_HAS_NO_STDOUT static_assert((std::is_same::value), ""); static_assert((std::is_same::value), ""); static_assert((std::is_same::value), ""); static_assert((std::is_same::value), ""); -#endif return 0; } diff --git a/libcxx/test/std/input.output/file.streams/fstreams/lit.local.cfg b/libcxx/test/std/input.output/file.streams/fstreams/lit.local.cfg deleted file mode 100644 --- a/libcxx/test/std/input.output/file.streams/fstreams/lit.local.cfg +++ /dev/null @@ -1,2 +0,0 @@ -if 'libcpp-has-no-global-filesystem-namespace' in config.available_features: - config.unsupported = True diff --git a/libcxx/test/std/input.output/iostream.objects/init.pass.cpp b/libcxx/test/std/input.output/iostream.objects/init.pass.cpp --- a/libcxx/test/std/input.output/iostream.objects/init.pass.cpp +++ b/libcxx/test/std/input.output/iostream.objects/init.pass.cpp @@ -6,8 +6,6 @@ // //===----------------------------------------------------------------------===// -// UNSUPPORTED: libcpp-has-no-stdin, libcpp-has-no-stdout - // Make sure that the iostreams are initialized before everything else. // This has been an issue when statically linking libc++ in some contexts. // See https://llvm.org/PR28954 for details. diff --git a/libcxx/test/std/input.output/iostream.objects/narrow.stream.objects/cin.sh.cpp b/libcxx/test/std/input.output/iostream.objects/narrow.stream.objects/cin.sh.cpp --- a/libcxx/test/std/input.output/iostream.objects/narrow.stream.objects/cin.sh.cpp +++ b/libcxx/test/std/input.output/iostream.objects/narrow.stream.objects/cin.sh.cpp @@ -6,8 +6,6 @@ // //===----------------------------------------------------------------------===// -// XFAIL: libcpp-has-no-stdin - // // istream cin; diff --git a/libcxx/test/std/input.output/iostream.objects/narrow.stream.objects/cout.sh.cpp b/libcxx/test/std/input.output/iostream.objects/narrow.stream.objects/cout.sh.cpp --- a/libcxx/test/std/input.output/iostream.objects/narrow.stream.objects/cout.sh.cpp +++ b/libcxx/test/std/input.output/iostream.objects/narrow.stream.objects/cout.sh.cpp @@ -6,8 +6,6 @@ // //===----------------------------------------------------------------------===// -// XFAIL: libcpp-has-no-stdout - // // istream cout; diff --git a/libcxx/test/std/input.output/iostream.objects/wide.stream.objects/wcin.sh.cpp b/libcxx/test/std/input.output/iostream.objects/wide.stream.objects/wcin.sh.cpp --- a/libcxx/test/std/input.output/iostream.objects/wide.stream.objects/wcin.sh.cpp +++ b/libcxx/test/std/input.output/iostream.objects/wide.stream.objects/wcin.sh.cpp @@ -6,8 +6,6 @@ // //===----------------------------------------------------------------------===// -// XFAIL: libcpp-has-no-stdin - // // istream wcin; diff --git a/libcxx/test/std/input.output/iostream.objects/wide.stream.objects/wcout.sh.cpp b/libcxx/test/std/input.output/iostream.objects/wide.stream.objects/wcout.sh.cpp --- a/libcxx/test/std/input.output/iostream.objects/wide.stream.objects/wcout.sh.cpp +++ b/libcxx/test/std/input.output/iostream.objects/wide.stream.objects/wcout.sh.cpp @@ -6,7 +6,6 @@ // //===----------------------------------------------------------------------===// -// XFAIL: libcpp-has-no-stdout // XFAIL: LIBCXX-WINDOWS-FIXME // diff --git a/libcxx/test/std/language.support/support.runtime/ctime.pass.cpp b/libcxx/test/std/language.support/support.runtime/ctime.pass.cpp --- a/libcxx/test/std/language.support/support.runtime/ctime.pass.cpp +++ b/libcxx/test/std/language.support/support.runtime/ctime.pass.cpp @@ -41,12 +41,10 @@ static_assert((std::is_same::value), ""); static_assert((std::is_same::value), ""); static_assert((std::is_same::value), ""); -#ifndef _LIBCPP_HAS_NO_THREAD_UNSAFE_C_FUNCTIONS static_assert((std::is_same::value), ""); static_assert((std::is_same::value), ""); static_assert((std::is_same::value), ""); static_assert((std::is_same::value), ""); -#endif char* c1 = 0; const char* c2 = 0; ((void)c1); // Prevent unused warning diff --git a/libcxx/test/std/localization/c.locales/clocale.pass.cpp b/libcxx/test/std/localization/c.locales/clocale.pass.cpp --- a/libcxx/test/std/localization/c.locales/clocale.pass.cpp +++ b/libcxx/test/std/localization/c.locales/clocale.pass.cpp @@ -13,8 +13,6 @@ #include "test_macros.h" -#ifndef _LIBCPP_HAS_NO_THREAD_UNSAFE_C_FUNCTIONS - #ifndef LC_ALL #error LC_ALL not defined #endif @@ -39,8 +37,6 @@ #error LC_TIME not defined #endif -#endif // !_LIBCPP_HAS_NO_THREAD_UNSAFE_C_FUNCTIONS - #ifndef NULL #error NULL not defined #endif @@ -49,9 +45,7 @@ { std::lconv lc; ((void)lc); // Prevent unused warning -#ifndef _LIBCPP_HAS_NO_THREAD_UNSAFE_C_FUNCTIONS static_assert((std::is_same::value), ""); -#endif static_assert((std::is_same::value), ""); return 0; diff --git a/libcxx/test/std/localization/locales/locale.convenience/conversions/conversions.buffer/lit.local.cfg b/libcxx/test/std/localization/locales/locale.convenience/conversions/conversions.buffer/lit.local.cfg deleted file mode 100644 --- a/libcxx/test/std/localization/locales/locale.convenience/conversions/conversions.buffer/lit.local.cfg +++ /dev/null @@ -1,2 +0,0 @@ -if 'libcpp-has-no-global-filesystem-namespace' in config.available_features: - config.unsupported = True diff --git a/libcxx/test/std/strings/c.strings/cstring.pass.cpp b/libcxx/test/std/strings/c.strings/cstring.pass.cpp --- a/libcxx/test/std/strings/c.strings/cstring.pass.cpp +++ b/libcxx/test/std/strings/c.strings/cstring.pass.cpp @@ -48,9 +48,7 @@ ASSERT_SAME_TYPE(std::size_t, decltype(std::strspn(cpc, cpc))); ASSERT_SAME_TYPE(char*, decltype(std::strstr(cp, cpc))); ASSERT_SAME_TYPE(const char*, decltype(std::strstr(cpc, cpc))); -#ifndef _LIBCPP_HAS_NO_THREAD_UNSAFE_C_FUNCTIONS ASSERT_SAME_TYPE(char*, decltype(std::strtok(cp, cpc))); -#endif ASSERT_SAME_TYPE(void*, decltype(std::memset(vp, 0, s))); ASSERT_SAME_TYPE(char*, decltype(std::strerror(0))); ASSERT_SAME_TYPE(std::size_t, decltype(std::strlen(cpc))); diff --git a/libcxx/test/std/strings/c.strings/cwchar.pass.cpp b/libcxx/test/std/strings/c.strings/cwchar.pass.cpp --- a/libcxx/test/std/strings/c.strings/cwchar.pass.cpp +++ b/libcxx/test/std/strings/c.strings/cwchar.pass.cpp @@ -116,17 +116,13 @@ ASSERT_SAME_TYPE(std::size_t, decltype(std::mbsrtowcs(ws, (const char**)0, s, &mb))); ASSERT_SAME_TYPE(std::size_t, decltype(std::wcsrtombs(ns, (const wchar_t**)0, s, &mb))); -#ifndef _LIBCPP_HAS_NO_STDIN ASSERT_SAME_TYPE(std::wint_t, decltype(std::getwchar())); ASSERT_SAME_TYPE(int, decltype(std::vwscanf(L"", va))); ASSERT_SAME_TYPE(int, decltype(std::wscanf(L""))); -#endif -#ifndef _LIBCPP_HAS_NO_STDOUT ASSERT_SAME_TYPE(std::wint_t, decltype(std::putwchar(L' '))); ASSERT_SAME_TYPE(int, decltype(std::vwprintf(L"", va))); ASSERT_SAME_TYPE(int, decltype(std::wprintf(L""))); -#endif return 0; } diff --git a/libcxx/test/support/platform_support.h b/libcxx/test/support/platform_support.h --- a/libcxx/test/support/platform_support.h +++ b/libcxx/test/support/platform_support.h @@ -25,17 +25,6 @@ # define LOCALE_fr_CA_ISO8859_1 "fr-CA" # define LOCALE_ru_RU_UTF_8 "ru-RU" # define LOCALE_zh_CN_UTF_8 "zh-CN" -#elif defined(__CloudABI__) - // Timezones are integrated into locales through LC_TIMEZONE_MASK on - // CloudABI. LC_ALL_MASK can only be used if a timezone has also been - // provided. UTC should be all right. -# define LOCALE_en_US "en_US" -# define LOCALE_en_US_UTF_8 "en_US.UTF-8@UTC" -# define LOCALE_fr_FR_UTF_8 "fr_FR.UTF-8@UTC" -# define LOCALE_fr_CA_ISO8859_1 "fr_CA.ISO-8859-1@UTC" -# define LOCALE_cs_CZ_ISO8859_2 "cs_CZ.ISO-8859-2@UTC" -# define LOCALE_ru_RU_UTF_8 "ru_RU.UTF-8@UTC" -# define LOCALE_zh_CN_UTF_8 "zh_CN.UTF-8@UTC" #else # define LOCALE_en_US "en_US" # define LOCALE_en_US_UTF_8 "en_US.UTF-8" @@ -71,7 +60,6 @@ } #endif -#ifndef __CloudABI__ inline std::string get_temp_file_name() { @@ -110,8 +98,6 @@ } #endif // _LIBCPP_HAS_OPEN_WITH_WCHAR -#endif // __CloudABI__ - #if defined(_CS_GNU_LIBC_VERSION) inline bool glibc_version_less_than(char const* version) { std::string test_version = std::string("glibc ") + version; diff --git a/libcxx/utils/libcxx/test/features.py b/libcxx/utils/libcxx/test/features.py --- a/libcxx/utils/libcxx/test/features.py +++ b/libcxx/utils/libcxx/test/features.py @@ -89,11 +89,7 @@ # `libcpp-xxx-yyy-zzz`. When a macro is defined to a specific value # (e.g. `_LIBCPP_ABI_VERSION=2`), the feature is `libcpp-xxx-yyy-zzz=`. macros = { - '_LIBCPP_HAS_NO_GLOBAL_FILESYSTEM_NAMESPACE': 'libcpp-has-no-global-filesystem-namespace', '_LIBCPP_HAS_NO_MONOTONIC_CLOCK': 'libcpp-has-no-monotonic-clock', - '_LIBCPP_HAS_NO_STDIN': 'libcpp-has-no-stdin', - '_LIBCPP_HAS_NO_STDOUT': 'libcpp-has-no-stdout', - '_LIBCPP_HAS_NO_THREAD_UNSAFE_C_FUNCTIONS': 'libcpp-has-no-thread-unsafe-c-functions', '_LIBCPP_HAS_NO_THREADS': 'libcpp-has-no-threads', '_LIBCPP_HAS_THREAD_API_EXTERNAL': 'libcpp-has-thread-api-external', '_LIBCPP_HAS_THREAD_API_PTHREAD': 'libcpp-has-thread-api-pthread',