24 changes: 15 additions & 9 deletions libcxx/include/csignal
Original file line number Diff line number Diff line change
Expand Up @@ -39,19 +39,24 @@ int raise(int sig);
*/

#include <__config>
#include <__configuration/language.h>

#if defined(_LIBCPP_CXX03_LANG) && !defined(_LIBCPP_USE_CXX03_HEADERS)
# include <__cxx03/csignal>
#else
# include <__config>

// <signal.h> is not provided by libc++
#if __has_include(<signal.h>)
# include <signal.h>
# ifdef _LIBCPP_SIGNAL_H
# error "If libc++ starts defining <signal.h>, the __has_include check should move to libc++'s <signal.h>"
# if __has_include(<signal.h>)
# include <signal.h>
# ifdef _LIBCPP_SIGNAL_H
# error "If libc++ starts defining <signal.h>, the __has_include check should move to libc++'s <signal.h>"
# endif
# endif
#endif

#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
# pragma GCC system_header
#endif
# if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
# pragma GCC system_header
# endif

_LIBCPP_BEGIN_NAMESPACE_STD

Expand All @@ -60,5 +65,6 @@ using ::signal _LIBCPP_USING_IF_EXISTS;
using ::raise _LIBCPP_USING_IF_EXISTS;

_LIBCPP_END_NAMESPACE_STD
#endif // _LIBCPP_CXX03_LANG

#endif // _LIBCPP_CSIGNAL
24 changes: 15 additions & 9 deletions libcxx/include/cstdarg
Original file line number Diff line number Diff line change
Expand Up @@ -31,24 +31,30 @@ Types:
*/

#include <__config>
#include <__configuration/language.h>

#if defined(_LIBCPP_CXX03_LANG) && !defined(_LIBCPP_USE_CXX03_HEADERS)
# include <__cxx03/cstdarg>
#else
# include <__config>

// <stdarg.h> is not provided by libc++
#if __has_include(<stdarg.h>)
# include <stdarg.h>
# ifdef _LIBCPP_STDARG_H
# error "If libc++ starts defining <stdarg.h>, the __has_include check should move to libc++'s <stdarg.h>"
# if __has_include(<stdarg.h>)
# include <stdarg.h>
# ifdef _LIBCPP_STDARG_H
# error "If libc++ starts defining <stdarg.h>, the __has_include check should move to libc++'s <stdarg.h>"
# endif
# endif
#endif

#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
# pragma GCC system_header
#endif
# if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
# pragma GCC system_header
# endif

_LIBCPP_BEGIN_NAMESPACE_STD

using ::va_list _LIBCPP_USING_IF_EXISTS;

_LIBCPP_END_NAMESPACE_STD
#endif // _LIBCPP_CXX03_LANG

#endif // _LIBCPP_CSTDARG
18 changes: 12 additions & 6 deletions libcxx/include/cstdbool
Original file line number Diff line number Diff line change
Expand Up @@ -19,14 +19,20 @@ Macros:
*/

#include <__config>
#include <__configuration/language.h>

#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
# pragma GCC system_header
#endif
#if defined(_LIBCPP_CXX03_LANG) && !defined(_LIBCPP_USE_CXX03_HEADERS)
# include <__cxx03/cstdbool>
#else
# include <__config>

# if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
# pragma GCC system_header
# endif

#undef __bool_true_false_are_defined
#define __bool_true_false_are_defined 1
# undef __bool_true_false_are_defined
# define __bool_true_false_are_defined 1
#endif // _LIBCPP_CXX03_LANG

#if _LIBCPP_STD_VER >= 20

Expand Down
32 changes: 19 additions & 13 deletions libcxx/include/cstddef
Original file line number Diff line number Diff line change
Expand Up @@ -33,27 +33,33 @@ Types:
*/

#include <__config>
#include <version>
#include <__configuration/language.h>

#include <stddef.h>
#if defined(_LIBCPP_CXX03_LANG) && !defined(_LIBCPP_USE_CXX03_HEADERS)
# include <__cxx03/cstddef>
#else
# include <__config>
# include <version>

#ifndef _LIBCPP_STDDEF_H
# include <stddef.h>

# ifndef _LIBCPP_STDDEF_H
# error <cstddef> tried including <stddef.h> but didn't find libc++'s <stddef.h> header. \
This usually means that your header search paths are not configured properly. \
The header search paths should contain the C++ Standard Library headers before \
any C Standard Library, and you are probably using compiler flags that make that \
not be the case.
#endif
# endif

#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
# pragma GCC system_header
#endif
# if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
# pragma GCC system_header
# endif

#include <__cstddef/byte.h>
#include <__cstddef/max_align_t.h>
#include <__cstddef/nullptr_t.h>
#include <__cstddef/ptrdiff_t.h>
#include <__cstddef/size_t.h>
# include <__cstddef/byte.h>
# include <__cstddef/max_align_t.h>
# include <__cstddef/nullptr_t.h>
# include <__cstddef/ptrdiff_t.h>
# include <__cstddef/size_t.h>
#endif // _LIBCPP_CXX03_LANG

#endif // _LIBCPP_CSTDDEF
20 changes: 13 additions & 7 deletions libcxx/include/cstdint
Original file line number Diff line number Diff line change
Expand Up @@ -140,15 +140,20 @@ Types:
} // std
*/

#include <__config>
#include <__configuration/language.h>

#if __has_include(<stdint.h>)
# include <stdint.h>
#endif
#if defined(_LIBCPP_CXX03_LANG) && !defined(_LIBCPP_USE_CXX03_HEADERS)
# include <__cxx03/cstdint>
#else
# include <__config>

#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
# pragma GCC system_header
#endif
# if __has_include(<stdint.h>)
# include <stdint.h>
# endif

# if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
# pragma GCC system_header
# endif

_LIBCPP_BEGIN_NAMESPACE_STD

Expand Down Expand Up @@ -189,5 +194,6 @@ using ::intmax_t _LIBCPP_USING_IF_EXISTS;
using ::uintmax_t _LIBCPP_USING_IF_EXISTS;

_LIBCPP_END_NAMESPACE_STD
#endif // _LIBCPP_CXX03_LANG

#endif // _LIBCPP_CSTDINT
26 changes: 16 additions & 10 deletions libcxx/include/cstdio
Original file line number Diff line number Diff line change
Expand Up @@ -95,22 +95,27 @@ void perror(const char* s);
} // std
*/

#include <__config>
#include <__cstddef/size_t.h>
#include <__configuration/language.h>

#include <stdio.h>
#if defined(_LIBCPP_CXX03_LANG) && !defined(_LIBCPP_USE_CXX03_HEADERS)
# include <__cxx03/cstdio>
#else
# include <__config>
# include <__cstddef/size_t.h>

#ifndef _LIBCPP_STDIO_H
# include <stdio.h>

# ifndef _LIBCPP_STDIO_H
# error <cstdio> tried including <stdio.h> but didn't find libc++'s <stdio.h> header. \
This usually means that your header search paths are not configured properly. \
The header search paths should contain the C++ Standard Library headers before \
any C Standard Library, and you are probably using compiler flags that make that \
not be the case.
#endif
# endif

#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
# pragma GCC system_header
#endif
# if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
# pragma GCC system_header
# endif

_LIBCPP_BEGIN_NAMESPACE_STD

Expand Down Expand Up @@ -158,9 +163,9 @@ using ::tmpfile _LIBCPP_USING_IF_EXISTS;
using ::tmpnam _LIBCPP_USING_IF_EXISTS;

using ::getchar _LIBCPP_USING_IF_EXISTS;
#if _LIBCPP_STD_VER <= 11
# if _LIBCPP_STD_VER <= 11
using ::gets _LIBCPP_USING_IF_EXISTS;
#endif
# endif
using ::scanf _LIBCPP_USING_IF_EXISTS;
using ::vscanf _LIBCPP_USING_IF_EXISTS;

Expand All @@ -170,5 +175,6 @@ using ::puts _LIBCPP_USING_IF_EXISTS;
using ::vprintf _LIBCPP_USING_IF_EXISTS;

_LIBCPP_END_NAMESPACE_STD
#endif // _LIBCPP_CXX03_LANG

#endif // _LIBCPP_CSTDIO
34 changes: 20 additions & 14 deletions libcxx/include/cstdlib
Original file line number Diff line number Diff line change
Expand Up @@ -81,22 +81,27 @@ void *aligned_alloc(size_t alignment, size_t size); // C11
*/

#include <__config>
#include <__cstddef/size_t.h>
#include <__configuration/language.h>

#include <stdlib.h>
#if defined(_LIBCPP_CXX03_LANG) && !defined(_LIBCPP_USE_CXX03_HEADERS)
# include <__cxx03/cstdlib>
#else
# include <__config>
# include <__cstddef/size_t.h>

#ifndef _LIBCPP_STDLIB_H
# include <stdlib.h>

# ifndef _LIBCPP_STDLIB_H
# error <cstdlib> tried including <stdlib.h> but didn't find libc++'s <stdlib.h> header. \
This usually means that your header search paths are not configured properly. \
The header search paths should contain the C++ Standard Library headers before \
any C Standard Library, and you are probably using compiler flags that make that \
not be the case.
#endif
# endif

#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
# pragma GCC system_header
#endif
# if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
# pragma GCC system_header
# endif

_LIBCPP_BEGIN_NAMESPACE_STD

Expand Down Expand Up @@ -135,20 +140,21 @@ using ::div _LIBCPP_USING_IF_EXISTS;
using ::ldiv _LIBCPP_USING_IF_EXISTS;
using ::lldiv _LIBCPP_USING_IF_EXISTS;
using ::mblen _LIBCPP_USING_IF_EXISTS;
#if _LIBCPP_HAS_WIDE_CHARACTERS
# if _LIBCPP_HAS_WIDE_CHARACTERS
using ::mbtowc _LIBCPP_USING_IF_EXISTS;
using ::wctomb _LIBCPP_USING_IF_EXISTS;
using ::mbstowcs _LIBCPP_USING_IF_EXISTS;
using ::wcstombs _LIBCPP_USING_IF_EXISTS;
#endif
#if !defined(_LIBCPP_CXX03_LANG)
# endif
# if !defined(_LIBCPP_CXX03_LANG)
using ::at_quick_exit _LIBCPP_USING_IF_EXISTS;
using ::quick_exit _LIBCPP_USING_IF_EXISTS;
#endif
#if _LIBCPP_STD_VER >= 17
# endif
# if _LIBCPP_STD_VER >= 17
using ::aligned_alloc _LIBCPP_USING_IF_EXISTS;
#endif
# endif

_LIBCPP_END_NAMESPACE_STD
#endif // _LIBCPP_CXX03_LANG

#endif // _LIBCPP_CSTDLIB
24 changes: 15 additions & 9 deletions libcxx/include/cstring
Original file line number Diff line number Diff line change
Expand Up @@ -56,23 +56,28 @@ size_t strlen(const char* s);
*/

#include <__config>
#include <__cstddef/size_t.h>
#include <__type_traits/is_constant_evaluated.h>
#include <__configuration/language.h>

#include <string.h>
#if defined(_LIBCPP_CXX03_LANG) && !defined(_LIBCPP_USE_CXX03_HEADERS)
# include <__cxx03/cstring>
#else
# include <__config>
# include <__cstddef/size_t.h>
# include <__type_traits/is_constant_evaluated.h>

#ifndef _LIBCPP_STRING_H
# include <string.h>

# ifndef _LIBCPP_STRING_H
# error <cstring> tried including <string.h> but didn't find libc++'s <string.h> header. \
This usually means that your header search paths are not configured properly. \
The header search paths should contain the C++ Standard Library headers before \
any C Standard Library, and you are probably using compiler flags that make that \
not be the case.
#endif
# endif

#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
# pragma GCC system_header
#endif
# if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
# pragma GCC system_header
# endif

_LIBCPP_BEGIN_NAMESPACE_STD

Expand Down Expand Up @@ -100,5 +105,6 @@ using ::strerror _LIBCPP_USING_IF_EXISTS;
using ::strlen _LIBCPP_USING_IF_EXISTS;

_LIBCPP_END_NAMESPACE_STD
#endif // _LIBCPP_CXX03_LANG

#endif // _LIBCPP_CSTRING
18 changes: 12 additions & 6 deletions libcxx/include/ctgmath
Original file line number Diff line number Diff line change
Expand Up @@ -18,12 +18,18 @@
*/

#include <cmath>
#include <complex>

#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
# pragma GCC system_header
#endif
#include <__configuration/language.h>

#if defined(_LIBCPP_CXX03_LANG) && !defined(_LIBCPP_USE_CXX03_HEADERS)
# include <__cxx03/ctgmath>
#else
# include <cmath>
# include <complex>

# if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
# pragma GCC system_header
# endif
#endif // _LIBCPP_CXX03_LANG

#if _LIBCPP_STD_VER >= 20

Expand Down
34 changes: 20 additions & 14 deletions libcxx/include/ctime
Original file line number Diff line number Diff line change
Expand Up @@ -45,29 +45,34 @@ int timespec_get( struct timespec *ts, int base); // C++17
*/

#include <__config>
#include <__cstddef/size_t.h>
#include <__configuration/language.h>

#if defined(_LIBCPP_CXX03_LANG) && !defined(_LIBCPP_USE_CXX03_HEADERS)
# include <__cxx03/ctime>
#else
# include <__config>
# include <__cstddef/size_t.h>

// <time.h> is not provided by libc++
#if __has_include(<time.h>)
# include <time.h>
# ifdef _LIBCPP_TIME_H
# error "If libc++ starts defining <time.h>, the __has_include check should move to libc++'s <time.h>"
# if __has_include(<time.h>)
# include <time.h>
# ifdef _LIBCPP_TIME_H
# error "If libc++ starts defining <time.h>, the __has_include check should move to libc++'s <time.h>"
# endif
# endif
#endif

#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
# pragma GCC system_header
#endif
# if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
# pragma GCC system_header
# endif

_LIBCPP_BEGIN_NAMESPACE_STD

using ::clock_t _LIBCPP_USING_IF_EXISTS;
using ::time_t _LIBCPP_USING_IF_EXISTS;
using ::tm _LIBCPP_USING_IF_EXISTS;
#if _LIBCPP_STD_VER >= 17
# if _LIBCPP_STD_VER >= 17
using ::timespec _LIBCPP_USING_IF_EXISTS;
#endif
# endif
using ::clock _LIBCPP_USING_IF_EXISTS;
using ::difftime _LIBCPP_USING_IF_EXISTS;
using ::mktime _LIBCPP_USING_IF_EXISTS;
Expand All @@ -77,10 +82,11 @@ using ::ctime _LIBCPP_USING_IF_EXISTS;
using ::gmtime _LIBCPP_USING_IF_EXISTS;
using ::localtime _LIBCPP_USING_IF_EXISTS;
using ::strftime _LIBCPP_USING_IF_EXISTS;
#if _LIBCPP_STD_VER >= 17
# if _LIBCPP_STD_VER >= 17
using ::timespec_get _LIBCPP_USING_IF_EXISTS;
#endif
# endif

_LIBCPP_END_NAMESPACE_STD
#endif // _LIBCPP_CXX03_LANG

#endif // _LIBCPP_CTIME
62 changes: 34 additions & 28 deletions libcxx/include/ctype.h
Original file line number Diff line number Diff line change
Expand Up @@ -29,33 +29,39 @@ int tolower(int c);
int toupper(int c);
*/

#include <__config>

#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
# pragma GCC system_header
#endif

#if __has_include_next(<ctype.h>)
# include_next <ctype.h>
#endif

#ifdef __cplusplus

# undef isalnum
# undef isalpha
# undef isblank
# undef iscntrl
# undef isdigit
# undef isgraph
# undef islower
# undef isprint
# undef ispunct
# undef isspace
# undef isupper
# undef isxdigit
# undef tolower
# undef toupper

#endif
#include <__configuration/language.h>

#if defined(_LIBCPP_CXX03_LANG) && !defined(_LIBCPP_USE_CXX03_HEADERS)
# include <__cxx03/ctype.h>
#else
# include <__config>

# if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
# pragma GCC system_header
# endif

# if __has_include_next(<ctype.h>)
# include_next <ctype.h>
# endif

# ifdef __cplusplus

# undef isalnum
# undef isalpha
# undef isblank
# undef iscntrl
# undef isdigit
# undef isgraph
# undef islower
# undef isprint
# undef ispunct
# undef isspace
# undef isupper
# undef isxdigit
# undef tolower
# undef toupper

# endif
#endif // _LIBCPP_CXX03_LANG

#endif // _LIBCPP_CTYPE_H
30 changes: 18 additions & 12 deletions libcxx/include/cuchar
Original file line number Diff line number Diff line change
Expand Up @@ -36,40 +36,46 @@ size_t c32rtomb(char* s, char32_t c32, mbstate_t* ps);
*/

#include <__config>
#include <__cstddef/size_t.h>
#include <__configuration/language.h>

#include <uchar.h>
#if defined(_LIBCPP_CXX03_LANG) && !defined(_LIBCPP_USE_CXX03_HEADERS)
# include <__cxx03/cuchar>
#else
# include <__config>
# include <__cstddef/size_t.h>

#ifndef _LIBCPP_UCHAR_H
# include <uchar.h>

# ifndef _LIBCPP_UCHAR_H
# error <cuchar> tried including <uchar.h> but didn't find libc++'s <uchar.h> header. \
This usually means that your header search paths are not configured properly. \
The header search paths should contain the C++ Standard Library headers before \
any C Standard Library, and you are probably using compiler flags that make that \
not be the case.
#endif
# endif

#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
# pragma GCC system_header
#endif
# if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
# pragma GCC system_header
# endif

_LIBCPP_BEGIN_NAMESPACE_STD

#if !defined(_LIBCPP_CXX03_LANG)
# if !defined(_LIBCPP_CXX03_LANG)

using ::mbstate_t _LIBCPP_USING_IF_EXISTS;

# if _LIBCPP_HAS_C8RTOMB_MBRTOC8
# if _LIBCPP_HAS_C8RTOMB_MBRTOC8
using ::mbrtoc8 _LIBCPP_USING_IF_EXISTS;
using ::c8rtomb _LIBCPP_USING_IF_EXISTS;
# endif
# endif
using ::mbrtoc16 _LIBCPP_USING_IF_EXISTS;
using ::c16rtomb _LIBCPP_USING_IF_EXISTS;
using ::mbrtoc32 _LIBCPP_USING_IF_EXISTS;
using ::c32rtomb _LIBCPP_USING_IF_EXISTS;

#endif // _LIBCPP_CXX03_LANG
# endif // _LIBCPP_CXX03_LANG

_LIBCPP_END_NAMESPACE_STD
#endif // _LIBCPP_CXX03_LANG

#endif // _LIBCPP_CUCHAR
60 changes: 33 additions & 27 deletions libcxx/include/cwchar
Original file line number Diff line number Diff line change
Expand Up @@ -102,28 +102,33 @@ size_t wcsrtombs(char* restrict dst, const wchar_t** restrict src, size_t len,
*/

#include <__config>
#include <__cstddef/size_t.h>
#include <__type_traits/copy_cv.h>
#include <__type_traits/is_constant_evaluated.h>
#include <__type_traits/is_equality_comparable.h>
#include <__type_traits/is_same.h>
#include <__type_traits/remove_cv.h>
#include <cwctype>
#include <__configuration/language.h>

#include <wchar.h>
#if defined(_LIBCPP_CXX03_LANG) && !defined(_LIBCPP_USE_CXX03_HEADERS)
# include <__cxx03/cwchar>
#else
# include <__config>
# include <__cstddef/size_t.h>
# include <__type_traits/copy_cv.h>
# include <__type_traits/is_constant_evaluated.h>
# include <__type_traits/is_equality_comparable.h>
# include <__type_traits/is_same.h>
# include <__type_traits/remove_cv.h>
# include <cwctype>

# include <wchar.h>

#ifndef _LIBCPP_WCHAR_H
# ifndef _LIBCPP_WCHAR_H
# error <cwchar> tried including <wchar.h> but didn't find libc++'s <wchar.h> header. \
This usually means that your header search paths are not configured properly. \
The header search paths should contain the C++ Standard Library headers before \
any C Standard Library, and you are probably using compiler flags that make that \
not be the case.
#endif
# endif

#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
# pragma GCC system_header
#endif
# if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
# pragma GCC system_header
# endif

_LIBCPP_BEGIN_NAMESPACE_STD

Expand Down Expand Up @@ -194,24 +199,24 @@ using ::vwprintf _LIBCPP_USING_IF_EXISTS;
using ::wprintf _LIBCPP_USING_IF_EXISTS;

inline _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX14 size_t __constexpr_wcslen(const wchar_t* __str) {
#if __has_builtin(__builtin_wcslen)
# if __has_builtin(__builtin_wcslen)
return __builtin_wcslen(__str);
#else
# else
if (!__libcpp_is_constant_evaluated())
return std::wcslen(__str);

size_t __len = 0;
for (; *__str != L'\0'; ++__str)
++__len;
return __len;
#endif
# endif
}

inline _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX14 int
__constexpr_wmemcmp(const wchar_t* __lhs, const wchar_t* __rhs, size_t __count) {
#if __has_builtin(__builtin_wmemcmp)
# if __has_builtin(__builtin_wmemcmp)
return __builtin_wmemcmp(__lhs, __rhs, __count);
#else
# else
if (!__libcpp_is_constant_evaluated())
return std::wmemcmp(__lhs, __rhs, __count);

Expand All @@ -222,7 +227,7 @@ __constexpr_wmemcmp(const wchar_t* __lhs, const wchar_t* __rhs, size_t __count)
return 1;
}
return 0;
#endif
# endif
}

template <class _Tp, class _Up>
Expand All @@ -231,18 +236,18 @@ _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX14 _Tp* __constexpr_wmemchr(_Tp
__libcpp_is_trivially_equality_comparable<_Tp, _Tp>::value,
"Calling wmemchr on non-trivially equality comparable types is unsafe.");

#if __has_builtin(__builtin_wmemchr)
# if __has_builtin(__builtin_wmemchr)
if (!__libcpp_is_constant_evaluated()) {
wchar_t __value_buffer = 0;
__builtin_memcpy(&__value_buffer, &__value, sizeof(wchar_t));
return reinterpret_cast<_Tp*>(
__builtin_wmemchr(reinterpret_cast<__copy_cv_t<_Tp, wchar_t>*>(__str), __value_buffer, __count));
}
# if _LIBCPP_STD_VER >= 17
# if _LIBCPP_STD_VER >= 17
else if constexpr (is_same_v<remove_cv_t<_Tp>, wchar_t>)
return __builtin_wmemchr(__str, __value, __count);
# endif
#endif // __has_builtin(__builtin_wmemchr)
# endif
# endif // __has_builtin(__builtin_wmemchr)

for (; __count; --__count) {
if (*__str == __value)
Expand All @@ -254,8 +259,9 @@ _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX14 _Tp* __constexpr_wmemchr(_Tp

_LIBCPP_END_NAMESPACE_STD

#if !defined(_LIBCPP_REMOVE_TRANSITIVE_INCLUDES) && _LIBCPP_STD_VER <= 20
# include <cstddef>
#endif
# if !defined(_LIBCPP_REMOVE_TRANSITIVE_INCLUDES) && _LIBCPP_STD_VER <= 20
# include <cstddef>
# endif
#endif // _LIBCPP_CXX03_LANG

#endif // _LIBCPP_CWCHAR
26 changes: 16 additions & 10 deletions libcxx/include/cwctype
Original file line number Diff line number Diff line change
Expand Up @@ -49,26 +49,31 @@ wctrans_t wctrans(const char* property);
*/

#include <__config>
#include <cctype>
#include <__configuration/language.h>

#include <wctype.h>
#if defined(_LIBCPP_CXX03_LANG) && !defined(_LIBCPP_USE_CXX03_HEADERS)
# include <__cxx03/cwctype>
#else
# include <__config>
# include <cctype>

#ifndef _LIBCPP_WCTYPE_H
# include <wctype.h>

# ifndef _LIBCPP_WCTYPE_H
# error <cwctype> tried including <wctype.h> but didn't find libc++'s <wctype.h> header. \
This usually means that your header search paths are not configured properly. \
The header search paths should contain the C++ Standard Library headers before \
any C Standard Library, and you are probably using compiler flags that make that \
not be the case.
#endif
# endif

#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
# pragma GCC system_header
#endif
# if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
# pragma GCC system_header
# endif

_LIBCPP_BEGIN_NAMESPACE_STD

#if defined(_LIBCPP_INCLUDED_C_LIBRARY_WCTYPE_H)
# if defined(_LIBCPP_INCLUDED_C_LIBRARY_WCTYPE_H)
using ::wint_t _LIBCPP_USING_IF_EXISTS;
using ::wctrans_t _LIBCPP_USING_IF_EXISTS;
using ::wctype_t _LIBCPP_USING_IF_EXISTS;
Expand All @@ -90,8 +95,9 @@ using ::towlower _LIBCPP_USING_IF_EXISTS;
using ::towupper _LIBCPP_USING_IF_EXISTS;
using ::towctrans _LIBCPP_USING_IF_EXISTS;
using ::wctrans _LIBCPP_USING_IF_EXISTS;
#endif // _LIBCPP_INCLUDED_C_LIBRARY_WCTYPE_H
# endif // _LIBCPP_INCLUDED_C_LIBRARY_WCTYPE_H

_LIBCPP_END_NAMESPACE_STD
#endif // _LIBCPP_CXX03_LANG

#endif // _LIBCPP_CWCTYPE
350 changes: 178 additions & 172 deletions libcxx/include/deque

Large diffs are not rendered by default.

542 changes: 274 additions & 268 deletions libcxx/include/errno.h

Large diffs are not rendered by default.

40 changes: 23 additions & 17 deletions libcxx/include/exception
Original file line number Diff line number Diff line change
Expand Up @@ -76,22 +76,28 @@ template <class E> void rethrow_if_nested(const E& e);
*/

#include <__config>
#include <__exception/exception.h>
#include <__exception/exception_ptr.h>
#include <__exception/nested_exception.h>
#include <__exception/operations.h>
#include <__exception/terminate.h>
#include <version>

#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
# pragma GCC system_header
#endif

#if !defined(_LIBCPP_REMOVE_TRANSITIVE_INCLUDES) && _LIBCPP_STD_VER <= 20
# include <cstddef>
# include <cstdlib>
# include <type_traits>
#endif
#include <__configuration/language.h>

#if defined(_LIBCPP_CXX03_LANG) && !defined(_LIBCPP_USE_CXX03_HEADERS)
# include <__cxx03/exception>
#else
# include <__config>
# include <__exception/exception.h>
# include <__exception/exception_ptr.h>
# include <__exception/nested_exception.h>
# include <__exception/operations.h>
# include <__exception/terminate.h>
# include <version>

# if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
# pragma GCC system_header
# endif

# if !defined(_LIBCPP_REMOVE_TRANSITIVE_INCLUDES) && _LIBCPP_STD_VER <= 20
# include <cstddef>
# include <cstdlib>
# include <type_traits>
# endif
#endif // _LIBCPP_CXX03_LANG

#endif // _LIBCPP_EXCEPTION
42 changes: 24 additions & 18 deletions libcxx/include/execution
Original file line number Diff line number Diff line change
Expand Up @@ -32,17 +32,22 @@ namespace std {
}
*/

#include <__config>
#include <__type_traits/is_execution_policy.h>
#include <__type_traits/is_same.h>
#include <__type_traits/remove_cvref.h>
#include <version>

#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
# pragma GCC system_header
#endif
#include <__configuration/language.h>

#if defined(_LIBCPP_CXX03_LANG) && !defined(_LIBCPP_USE_CXX03_HEADERS)
# include <__cxx03/execution>
#else
# include <__config>
# include <__type_traits/is_execution_policy.h>
# include <__type_traits/is_same.h>
# include <__type_traits/remove_cvref.h>
# include <version>

# if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
# pragma GCC system_header
# endif

#if !defined(_LIBCPP_HAS_NO_INCOMPLETE_PSTL) && _LIBCPP_STD_VER >= 17
# if !defined(_LIBCPP_HAS_NO_INCOMPLETE_PSTL) && _LIBCPP_STD_VER >= 17

_LIBCPP_BEGIN_NAMESPACE_STD

Expand Down Expand Up @@ -79,7 +84,7 @@ struct __unsequenced_policy {

constexpr __unsequenced_policy __unseq{__disable_user_instantiations_tag{}};

# if _LIBCPP_STD_VER >= 20
# if _LIBCPP_STD_VER >= 20

struct unsequenced_policy {
_LIBCPP_HIDE_FROM_ABI constexpr explicit unsequenced_policy(__disable_user_instantiations_tag) {}
Expand All @@ -89,7 +94,7 @@ struct unsequenced_policy {

inline constexpr unsequenced_policy unseq{__disable_user_instantiations_tag{}};

# endif // _LIBCPP_STD_VER >= 20
# endif // _LIBCPP_STD_VER >= 20

} // namespace execution

Expand Down Expand Up @@ -117,14 +122,14 @@ inline constexpr bool __is_unsequenced_execution_policy_impl<execution::__unsequ
template <>
inline constexpr bool __is_unsequenced_execution_policy_impl<execution::parallel_unsequenced_policy> = true;

# if _LIBCPP_STD_VER >= 20
# if _LIBCPP_STD_VER >= 20
template <>
inline constexpr bool is_execution_policy_v<execution::unsequenced_policy> = true;

template <>
inline constexpr bool __is_unsequenced_execution_policy_impl<execution::unsequenced_policy> = true;

# endif
# endif

template <class _Tp>
struct is_execution_policy : bool_constant<is_execution_policy_v<_Tp>> {};
Expand All @@ -140,10 +145,11 @@ _LIBCPP_HIDE_FROM_ABI auto __remove_parallel_policy(const _ExecutionPolicy&) {

_LIBCPP_END_NAMESPACE_STD

#endif // !defined(_LIBCPP_HAS_NO_INCOMPLETE_PSTL) && _LIBCPP_STD_VER >= 17
# endif // !defined(_LIBCPP_HAS_NO_INCOMPLETE_PSTL) && _LIBCPP_STD_VER >= 17

#if !defined(_LIBCPP_REMOVE_TRANSITIVE_INCLUDES) && _LIBCPP_STD_VER <= 20
# include <cstddef>
#endif
# if !defined(_LIBCPP_REMOVE_TRANSITIVE_INCLUDES) && _LIBCPP_STD_VER <= 20
# include <cstddef>
# endif
#endif // _LIBCPP_CXX03_LANG

#endif // _LIBCPP_EXECUTION
29 changes: 18 additions & 11 deletions libcxx/include/expected
Original file line number Diff line number Diff line change
Expand Up @@ -38,19 +38,26 @@ namespace std {
*/

#include <__config>
#include <__configuration/language.h>

#if _LIBCPP_STD_VER >= 23
# include <__expected/bad_expected_access.h>
# include <__expected/expected.h>
# include <__expected/unexpect.h>
# include <__expected/unexpected.h>
#endif
#if defined(_LIBCPP_CXX03_LANG) && !defined(_LIBCPP_USE_CXX03_HEADERS)
# include <__cxx03/expected>
#else
# include <__config>

#include <version>
# if _LIBCPP_STD_VER >= 23
# include <__expected/bad_expected_access.h>
# include <__expected/expected.h>
# include <__expected/unexpect.h>
# include <__expected/unexpected.h>
# endif

#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
# pragma GCC system_header
#endif
# include <version>

# if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
# pragma GCC system_header
# endif

#endif // _LIBCPP_CXX03_LANG

#endif // _LIBCPP_EXPECTED
90 changes: 48 additions & 42 deletions libcxx/include/fenv.h
Original file line number Diff line number Diff line change
Expand Up @@ -49,66 +49,72 @@ int feupdateenv(const fenv_t* envp);
*/

#include <__config>
#include <__configuration/language.h>

#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
# pragma GCC system_header
#endif
#if defined(_LIBCPP_CXX03_LANG) && !defined(_LIBCPP_USE_CXX03_HEADERS)
# include <__cxx03/fenv.h>
#else
# include <__config>

#if __has_include_next(<fenv.h>)
# include_next <fenv.h>
#endif
# if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
# pragma GCC system_header
# endif

# if __has_include_next(<fenv.h>)
# include_next <fenv.h>
# endif

#ifdef __cplusplus
# ifdef __cplusplus

extern "C++" {

# ifdef feclearexcept
# undef feclearexcept
# endif
# ifdef feclearexcept
# undef feclearexcept
# endif

# ifdef fegetexceptflag
# undef fegetexceptflag
# endif
# ifdef fegetexceptflag
# undef fegetexceptflag
# endif

# ifdef feraiseexcept
# undef feraiseexcept
# endif
# ifdef feraiseexcept
# undef feraiseexcept
# endif

# ifdef fesetexceptflag
# undef fesetexceptflag
# endif
# ifdef fesetexceptflag
# undef fesetexceptflag
# endif

# ifdef fetestexcept
# undef fetestexcept
# endif
# ifdef fetestexcept
# undef fetestexcept
# endif

# ifdef fegetround
# undef fegetround
# endif
# ifdef fegetround
# undef fegetround
# endif

# ifdef fesetround
# undef fesetround
# endif
# ifdef fesetround
# undef fesetround
# endif

# ifdef fegetenv
# undef fegetenv
# endif
# ifdef fegetenv
# undef fegetenv
# endif

# ifdef feholdexcept
# undef feholdexcept
# endif
# ifdef feholdexcept
# undef feholdexcept
# endif

# ifdef fesetenv
# undef fesetenv
# endif
# ifdef fesetenv
# undef fesetenv
# endif

# ifdef feupdateenv
# undef feupdateenv
# endif
# ifdef feupdateenv
# undef feupdateenv
# endif

} // extern "C++"

#endif // defined(__cplusplus)
# endif // defined(__cplusplus)
#endif // _LIBCPP_CXX03_LANG

#endif // _LIBCPP_FENV_H
78 changes: 42 additions & 36 deletions libcxx/include/filesystem
Original file line number Diff line number Diff line change
Expand Up @@ -533,45 +533,51 @@ inline constexpr bool std::ranges::enable_view<std::filesystem::recursive_direct
*/

#include <__config>

#if _LIBCPP_STD_VER >= 17
# include <__filesystem/copy_options.h>
# include <__filesystem/directory_entry.h>
# include <__filesystem/directory_iterator.h>
# include <__filesystem/directory_options.h>
# include <__filesystem/file_status.h>
# include <__filesystem/file_time_type.h>
# include <__filesystem/file_type.h>
# include <__filesystem/filesystem_error.h>
# include <__filesystem/operations.h>
# include <__filesystem/path.h>
# include <__filesystem/path_iterator.h>
# include <__filesystem/perm_options.h>
# include <__filesystem/perms.h>
# include <__filesystem/recursive_directory_iterator.h>
# include <__filesystem/space_info.h>
# include <__filesystem/u8path.h>
#endif

#include <version>
#include <__configuration/language.h>

#if defined(_LIBCPP_CXX03_LANG) && !defined(_LIBCPP_USE_CXX03_HEADERS)
# include <__cxx03/filesystem>
#else
# include <__config>

# if _LIBCPP_STD_VER >= 17
# include <__filesystem/copy_options.h>
# include <__filesystem/directory_entry.h>
# include <__filesystem/directory_iterator.h>
# include <__filesystem/directory_options.h>
# include <__filesystem/file_status.h>
# include <__filesystem/file_time_type.h>
# include <__filesystem/file_type.h>
# include <__filesystem/filesystem_error.h>
# include <__filesystem/operations.h>
# include <__filesystem/path.h>
# include <__filesystem/path_iterator.h>
# include <__filesystem/perm_options.h>
# include <__filesystem/perms.h>
# include <__filesystem/recursive_directory_iterator.h>
# include <__filesystem/space_info.h>
# include <__filesystem/u8path.h>
# endif

# include <version>

// standard-mandated includes

// [fs.filesystem.syn]
#include <compare>

#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
# pragma GCC system_header
#endif

#if !defined(_LIBCPP_REMOVE_TRANSITIVE_INCLUDES) && _LIBCPP_STD_VER <= 20
# include <concepts>
# include <cstdlib>
# include <cstring>
# include <iosfwd>
# include <new>
# include <system_error>
#endif
# include <compare>

# if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
# pragma GCC system_header
# endif

# if !defined(_LIBCPP_REMOVE_TRANSITIVE_INCLUDES) && _LIBCPP_STD_VER <= 20
# include <concepts>
# include <cstdlib>
# include <cstring>
# include <iosfwd>
# include <new>
# include <system_error>
# endif
#endif // _LIBCPP_CXX03_LANG

#endif // _LIBCPP_FILESYSTEM
36 changes: 21 additions & 15 deletions libcxx/include/float.h
Original file line number Diff line number Diff line change
Expand Up @@ -70,26 +70,32 @@
*/

#include <__config>
#include <__configuration/language.h>

#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
# pragma GCC system_header
#endif
#if defined(_LIBCPP_CXX03_LANG) && !defined(_LIBCPP_USE_CXX03_HEADERS)
# include <__cxx03/float.h>
#else
# include <__config>

#if __has_include_next(<float.h>)
# include_next <float.h>
#endif

#ifdef __cplusplus

# ifndef FLT_EVAL_METHOD
# define FLT_EVAL_METHOD __FLT_EVAL_METHOD__
# if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
# pragma GCC system_header
# endif

# ifndef DECIMAL_DIG
# define DECIMAL_DIG __DECIMAL_DIG__
# if __has_include_next(<float.h>)
# include_next <float.h>
# endif

#endif // __cplusplus
# ifdef __cplusplus

# ifndef FLT_EVAL_METHOD
# define FLT_EVAL_METHOD __FLT_EVAL_METHOD__
# endif

# ifndef DECIMAL_DIG
# define DECIMAL_DIG __DECIMAL_DIG__
# endif

# endif // __cplusplus
#endif // _LIBCPP_CXX03_LANG

#endif // _LIBCPP_FLOAT_H
134 changes: 70 additions & 64 deletions libcxx/include/format
Original file line number Diff line number Diff line change
Expand Up @@ -191,70 +191,76 @@ namespace std {
*/

#include <__config>

#if _LIBCPP_STD_VER >= 20
# include <__format/buffer.h>
# include <__format/concepts.h>
# include <__format/container_adaptor.h>
# include <__format/enable_insertable.h>
# include <__format/escaped_output_table.h>
# include <__format/extended_grapheme_cluster_table.h>
# include <__format/format_arg.h>
# include <__format/format_arg_store.h>
# include <__format/format_args.h>
# include <__format/format_context.h>
# include <__format/format_error.h>
# include <__format/format_functions.h>
# include <__format/format_parse_context.h>
# include <__format/format_string.h>
# include <__format/format_to_n_result.h>
# include <__format/formatter.h>
# include <__format/formatter_bool.h>
# include <__format/formatter_char.h>
# include <__format/formatter_floating_point.h>
# include <__format/formatter_integer.h>
# include <__format/formatter_pointer.h>
# include <__format/formatter_string.h>
# include <__format/formatter_tuple.h>
# include <__format/parser_std_format_spec.h>
# include <__format/range_default_formatter.h>
# include <__format/range_formatter.h>
# include <__format/unicode.h>
# include <__fwd/format.h>
#endif

#include <version>

#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
# pragma GCC system_header
#endif

#if !defined(_LIBCPP_REMOVE_TRANSITIVE_INCLUDES) && _LIBCPP_STD_VER <= 20
# include <array>
# include <cctype>
# include <cerrno>
# include <clocale>
# include <cmath>
# include <cstddef>
# include <cstdint>
# include <cstdlib>
# include <cstring>
# include <initializer_list>
# include <limits>
# include <locale>
# include <new>
# include <optional>
# include <queue>
# include <stack>
# include <stdexcept>
# include <string>
# include <string_view>
# include <tuple>

# if _LIBCPP_HAS_WIDE_CHARACTERS
# include <cwchar>
#include <__configuration/language.h>

#if defined(_LIBCPP_CXX03_LANG) && !defined(_LIBCPP_USE_CXX03_HEADERS)
# include <__cxx03/format>
#else
# include <__config>

# if _LIBCPP_STD_VER >= 20
# include <__format/buffer.h>
# include <__format/concepts.h>
# include <__format/container_adaptor.h>
# include <__format/enable_insertable.h>
# include <__format/escaped_output_table.h>
# include <__format/extended_grapheme_cluster_table.h>
# include <__format/format_arg.h>
# include <__format/format_arg_store.h>
# include <__format/format_args.h>
# include <__format/format_context.h>
# include <__format/format_error.h>
# include <__format/format_functions.h>
# include <__format/format_parse_context.h>
# include <__format/format_string.h>
# include <__format/format_to_n_result.h>
# include <__format/formatter.h>
# include <__format/formatter_bool.h>
# include <__format/formatter_char.h>
# include <__format/formatter_floating_point.h>
# include <__format/formatter_integer.h>
# include <__format/formatter_pointer.h>
# include <__format/formatter_string.h>
# include <__format/formatter_tuple.h>
# include <__format/parser_std_format_spec.h>
# include <__format/range_default_formatter.h>
# include <__format/range_formatter.h>
# include <__format/unicode.h>
# include <__fwd/format.h>
# endif
#endif

# include <version>

# if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
# pragma GCC system_header
# endif

# if !defined(_LIBCPP_REMOVE_TRANSITIVE_INCLUDES) && _LIBCPP_STD_VER <= 20
# include <array>
# include <cctype>
# include <cerrno>
# include <clocale>
# include <cmath>
# include <cstddef>
# include <cstdint>
# include <cstdlib>
# include <cstring>
# include <initializer_list>
# include <limits>
# include <locale>
# include <new>
# include <optional>
# include <queue>
# include <stack>
# include <stdexcept>
# include <string>
# include <string_view>
# include <tuple>

# if _LIBCPP_HAS_WIDE_CHARACTERS
# include <cwchar>
# endif
# endif
#endif // _LIBCPP_CXX03_LANG

#endif // _LIBCPP_FORMAT
288 changes: 147 additions & 141 deletions libcxx/include/forward_list

Large diffs are not rendered by default.

282 changes: 144 additions & 138 deletions libcxx/include/fstream

Large diffs are not rendered by default.

133 changes: 67 additions & 66 deletions libcxx/include/functional
Original file line number Diff line number Diff line change
Expand Up @@ -527,72 +527,73 @@ POLICY: For non-variadic implementations, the number of arguments is limited
*/

#include <__config>

#include <__functional/binary_function.h>
#include <__functional/binary_negate.h>
#include <__functional/bind.h>
#include <__functional/binder1st.h>
#include <__functional/binder2nd.h>
#include <__functional/hash.h>
#include <__functional/mem_fn.h> // TODO: deprecate
#include <__functional/mem_fun_ref.h>
#include <__functional/operations.h>
#include <__functional/pointer_to_binary_function.h>
#include <__functional/pointer_to_unary_function.h>
#include <__functional/reference_wrapper.h>
#include <__functional/unary_function.h>
#include <__functional/unary_negate.h>

#ifndef _LIBCPP_CXX03_LANG
# include <__functional/function.h>
#endif

#if _LIBCPP_STD_VER >= 17
# include <__functional/boyer_moore_searcher.h>
# include <__functional/default_searcher.h>
# include <__functional/invoke.h>
# include <__functional/not_fn.h>
#endif

#if _LIBCPP_STD_VER >= 20
# include <__functional/bind_back.h>
# include <__functional/bind_front.h>
# include <__functional/identity.h>
# include <__functional/ranges_operations.h>
# include <__type_traits/unwrap_ref.h>
#endif

#include <version>

#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
# pragma GCC system_header
#endif

#if !defined(_LIBCPP_REMOVE_TRANSITIVE_INCLUDES) && defined(_LIBCPP_CXX03_LANG)
# include <limits>
# include <new>
#endif

#if !defined(_LIBCPP_REMOVE_TRANSITIVE_INCLUDES) && _LIBCPP_STD_VER <= 14
# include <array>
# include <initializer_list>
# include <unordered_map>
#endif

#if !defined(_LIBCPP_REMOVE_TRANSITIVE_INCLUDES) && _LIBCPP_STD_VER <= 20
# include <atomic>
# include <concepts>
# include <cstdlib>
# include <exception>
# include <iosfwd>
# include <memory>
# include <stdexcept>
# include <tuple>
# include <type_traits>
# include <typeinfo>
# include <utility>
# include <vector>
#include <__configuration/language.h>

#if defined(_LIBCPP_CXX03_LANG) && !defined(_LIBCPP_USE_CXX03_HEADERS)
# include <__cxx03/functional>
#else
# include <__config>

# include <__functional/binary_function.h>
# include <__functional/binary_negate.h>
# include <__functional/bind.h>
# include <__functional/binder1st.h>
# include <__functional/binder2nd.h>
# include <__functional/hash.h>
# include <__functional/mem_fn.h> // TODO: deprecate
# include <__functional/mem_fun_ref.h>
# include <__functional/operations.h>
# include <__functional/pointer_to_binary_function.h>
# include <__functional/pointer_to_unary_function.h>
# include <__functional/reference_wrapper.h>
# include <__functional/unary_function.h>
# include <__functional/unary_negate.h>

# ifndef _LIBCPP_CXX03_LANG
# include <__functional/function.h>
# endif

# if _LIBCPP_STD_VER >= 17
# include <__functional/boyer_moore_searcher.h>
# include <__functional/default_searcher.h>
# include <__functional/invoke.h>
# include <__functional/not_fn.h>
# endif

# if _LIBCPP_STD_VER >= 20
# include <__functional/bind_back.h>
# include <__functional/bind_front.h>
# include <__functional/identity.h>
# include <__functional/ranges_operations.h>
# include <__type_traits/unwrap_ref.h>
# endif

# include <version>

# if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
# pragma GCC system_header
# endif

# if !defined(_LIBCPP_REMOVE_TRANSITIVE_INCLUDES) && _LIBCPP_STD_VER <= 14
# include <array>
# include <initializer_list>
# include <unordered_map>
# endif

# if !defined(_LIBCPP_REMOVE_TRANSITIVE_INCLUDES) && _LIBCPP_STD_VER <= 20
# include <atomic>
# include <concepts>
# include <cstdlib>
# include <exception>
# include <iosfwd>
# include <memory>
# include <stdexcept>
# include <tuple>
# include <type_traits>
# include <typeinfo>
# include <utility>
# include <vector>
# endif
#endif

#endif // _LIBCPP_FUNCTIONAL
242 changes: 124 additions & 118 deletions libcxx/include/future

Large diffs are not rendered by default.

16 changes: 11 additions & 5 deletions libcxx/include/initializer_list
Original file line number Diff line number Diff line change
Expand Up @@ -42,18 +42,23 @@ template<class E> const E* end(initializer_list<E> il) noexcept; // constexpr in
*/

#include <__configuration/language.h>

#if defined(_LIBCPP_CXX03_LANG) && !defined(_LIBCPP_USE_CXX03_HEADERS)
# include <__cxx03/initializer_list>
#else
#include <__config>
#include <__cstddef/size_t.h>
#include <version>

#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
# pragma GCC system_header
#endif
# if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
# pragma GCC system_header
# endif

namespace std // purposefully not versioned
{

#ifndef _LIBCPP_CXX03_LANG
# ifndef _LIBCPP_CXX03_LANG

template <class _Ep>
class _LIBCPP_TEMPLATE_VIS initializer_list {
Expand Down Expand Up @@ -92,9 +97,10 @@ inline _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX14 const _Ep* end(initia
return __il.end();
}

#endif // !defined(_LIBCPP_CXX03_LANG)
# endif // !defined(_LIBCPP_CXX03_LANG)

} // namespace std
#endif // _LIBCPP_CXX03_LANG

#if !defined(_LIBCPP_REMOVE_TRANSITIVE_INCLUDES) && _LIBCPP_STD_VER <= 20
# include <cstddef>
Expand Down
36 changes: 21 additions & 15 deletions libcxx/include/inttypes.h
Original file line number Diff line number Diff line change
Expand Up @@ -235,30 +235,36 @@ uintmax_t wcstoumax(const wchar_t* restrict nptr, wchar_t** restrict endptr, int
*/

#include <__config>
#include <__configuration/language.h>

#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
# pragma GCC system_header
#endif
#if defined(_LIBCPP_CXX03_LANG) && !defined(_LIBCPP_USE_CXX03_HEADERS)
# include <__cxx03/inttypes.h>
#else
# include <__config>

# if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
# pragma GCC system_header
# endif

/* C99 stdlib (e.g. glibc < 2.18) does not provide format macros needed
for C++11 unless __STDC_FORMAT_MACROS is defined
*/
#if defined(__cplusplus) && !defined(__STDC_FORMAT_MACROS)
# define __STDC_FORMAT_MACROS
#endif
# if defined(__cplusplus) && !defined(__STDC_FORMAT_MACROS)
# define __STDC_FORMAT_MACROS
# endif

#if __has_include_next(<inttypes.h>)
# include_next <inttypes.h>
#endif
# if __has_include_next(<inttypes.h>)
# include_next <inttypes.h>
# endif

#ifdef __cplusplus
# ifdef __cplusplus

# include <stdint.h>
# include <stdint.h>

# undef imaxabs
# undef imaxdiv
# undef imaxabs
# undef imaxdiv

#endif // __cplusplus
# endif // __cplusplus
#endif // _LIBCPP_CXX03_LANG

#endif // _LIBCPP_INTTYPES_H
94 changes: 50 additions & 44 deletions libcxx/include/iomanip
Original file line number Diff line number Diff line change
Expand Up @@ -42,19 +42,24 @@ template <class charT, class traits, class Allocator>
*/

#include <__config>
#include <__configuration/language.h>

#if _LIBCPP_HAS_LOCALIZATION
#if defined(_LIBCPP_CXX03_LANG) && !defined(_LIBCPP_USE_CXX03_HEADERS)
# include <__cxx03/iomanip>
#else
# include <__config>

# include <__ostream/put_character_sequence.h>
# include <ios>
# include <iosfwd>
# include <locale>
# include <version>
# if _LIBCPP_HAS_LOCALIZATION

# if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
# pragma GCC system_header
# endif
# include <__ostream/put_character_sequence.h>
# include <ios>
# include <iosfwd>
# include <locale>
# include <version>

# if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
# pragma GCC system_header
# endif

_LIBCPP_BEGIN_NAMESPACE_STD

Expand Down Expand Up @@ -237,9 +242,9 @@ public:
template <class _CharT, class _Traits, class _MoneyT>
_LIBCPP_HIDE_FROM_ABI basic_istream<_CharT, _Traits>&
operator>>(basic_istream<_CharT, _Traits>& __is, const __iom_t7<_MoneyT>& __x) {
# if _LIBCPP_HAS_EXCEPTIONS
# if _LIBCPP_HAS_EXCEPTIONS
try {
# endif // _LIBCPP_HAS_EXCEPTIONS
# endif // _LIBCPP_HAS_EXCEPTIONS
typename basic_istream<_CharT, _Traits>::sentry __s(__is);
if (__s) {
typedef istreambuf_iterator<_CharT, _Traits> _Ip;
Expand All @@ -249,11 +254,11 @@ operator>>(basic_istream<_CharT, _Traits>& __is, const __iom_t7<_MoneyT>& __x) {
__mf.get(_Ip(__is), _Ip(), __x.__intl_, __is, __err, __x.__mon_);
__is.setstate(__err);
}
# if _LIBCPP_HAS_EXCEPTIONS
# if _LIBCPP_HAS_EXCEPTIONS
} catch (...) {
__is.__set_badbit_and_consider_rethrow();
}
# endif // _LIBCPP_HAS_EXCEPTIONS
# endif // _LIBCPP_HAS_EXCEPTIONS
return __is;
}

Expand Down Expand Up @@ -286,9 +291,9 @@ public:
template <class _CharT, class _Traits, class _MoneyT>
_LIBCPP_HIDE_FROM_ABI basic_ostream<_CharT, _Traits>&
operator<<(basic_ostream<_CharT, _Traits>& __os, const __iom_t8<_MoneyT>& __x) {
# if _LIBCPP_HAS_EXCEPTIONS
# if _LIBCPP_HAS_EXCEPTIONS
try {
# endif // _LIBCPP_HAS_EXCEPTIONS
# endif // _LIBCPP_HAS_EXCEPTIONS
typename basic_ostream<_CharT, _Traits>::sentry __s(__os);
if (__s) {
typedef ostreambuf_iterator<_CharT, _Traits> _Op;
Expand All @@ -297,11 +302,11 @@ operator<<(basic_ostream<_CharT, _Traits>& __os, const __iom_t8<_MoneyT>& __x) {
if (__mf.put(_Op(__os), __x.__intl_, __os, __os.fill(), __x.__mon_).failed())
__os.setstate(ios_base::badbit);
}
# if _LIBCPP_HAS_EXCEPTIONS
# if _LIBCPP_HAS_EXCEPTIONS
} catch (...) {
__os.__set_badbit_and_consider_rethrow();
}
# endif // _LIBCPP_HAS_EXCEPTIONS
# endif // _LIBCPP_HAS_EXCEPTIONS
return __os;
}

Expand Down Expand Up @@ -334,9 +339,9 @@ public:
template <class _CharT, class _Traits>
_LIBCPP_HIDE_FROM_ABI basic_istream<_CharT, _Traits>&
operator>>(basic_istream<_CharT, _Traits>& __is, const __iom_t9<_CharT>& __x) {
# if _LIBCPP_HAS_EXCEPTIONS
# if _LIBCPP_HAS_EXCEPTIONS
try {
# endif // _LIBCPP_HAS_EXCEPTIONS
# endif // _LIBCPP_HAS_EXCEPTIONS
typename basic_istream<_CharT, _Traits>::sentry __s(__is);
if (__s) {
typedef istreambuf_iterator<_CharT, _Traits> _Ip;
Expand All @@ -346,11 +351,11 @@ operator>>(basic_istream<_CharT, _Traits>& __is, const __iom_t9<_CharT>& __x) {
__tf.get(_Ip(__is), _Ip(), __is, __err, __x.__tm_, __x.__fmt_, __x.__fmt_ + _Traits::length(__x.__fmt_));
__is.setstate(__err);
}
# if _LIBCPP_HAS_EXCEPTIONS
# if _LIBCPP_HAS_EXCEPTIONS
} catch (...) {
__is.__set_badbit_and_consider_rethrow();
}
# endif // _LIBCPP_HAS_EXCEPTIONS
# endif // _LIBCPP_HAS_EXCEPTIONS
return __is;
}

Expand Down Expand Up @@ -383,9 +388,9 @@ public:
template <class _CharT, class _Traits>
_LIBCPP_HIDE_FROM_ABI basic_ostream<_CharT, _Traits>&
operator<<(basic_ostream<_CharT, _Traits>& __os, const __iom_t10<_CharT>& __x) {
# if _LIBCPP_HAS_EXCEPTIONS
# if _LIBCPP_HAS_EXCEPTIONS
try {
# endif // _LIBCPP_HAS_EXCEPTIONS
# endif // _LIBCPP_HAS_EXCEPTIONS
typename basic_ostream<_CharT, _Traits>::sentry __s(__os);
if (__s) {
typedef ostreambuf_iterator<_CharT, _Traits> _Op;
Expand All @@ -395,11 +400,11 @@ operator<<(basic_ostream<_CharT, _Traits>& __os, const __iom_t10<_CharT>& __x) {
.failed())
__os.setstate(ios_base::badbit);
}
# if _LIBCPP_HAS_EXCEPTIONS
# if _LIBCPP_HAS_EXCEPTIONS
} catch (...) {
__os.__set_badbit_and_consider_rethrow();
}
# endif // _LIBCPP_HAS_EXCEPTIONS
# endif // _LIBCPP_HAS_EXCEPTIONS
return __os;
}

Expand Down Expand Up @@ -511,7 +516,7 @@ __quoted(basic_string<_CharT, _Traits, _Allocator>& __s, _CharT __delim = _CharT
return __quoted_proxy<_CharT, _Traits, _Allocator>(__s, __delim, __escape);
}

# if _LIBCPP_STD_VER >= 14
# if _LIBCPP_STD_VER >= 14

template <class _CharT>
_LIBCPP_HIDE_FROM_ABI auto quoted(const _CharT* __s, _CharT __delim = _CharT('"'), _CharT __escape = _CharT('\\')) {
Expand Down Expand Up @@ -541,25 +546,26 @@ quoted(basic_string_view<_CharT, _Traits> __sv, _CharT __delim = _CharT('"'), _C
return __quoted_output_proxy<_CharT, _Traits>(__sv.data(), __sv.data() + __sv.size(), __delim, __escape);
}

# endif // _LIBCPP_STD_VER >= 14
# endif // _LIBCPP_STD_VER >= 14

_LIBCPP_END_NAMESPACE_STD

#endif // _LIBCPP_HAS_LOCALIZATION

#if !defined(_LIBCPP_REMOVE_TRANSITIVE_INCLUDES) && _LIBCPP_STD_VER <= 20
# include <array>
# include <bitset>
# include <deque>
# include <format>
# include <functional>
# include <istream>
# include <ostream>
# include <print>
# include <queue>
# include <stack>
# include <unordered_map>
# include <vector>
#endif
# endif // _LIBCPP_HAS_LOCALIZATION

# if !defined(_LIBCPP_REMOVE_TRANSITIVE_INCLUDES) && _LIBCPP_STD_VER <= 20
# include <array>
# include <bitset>
# include <deque>
# include <format>
# include <functional>
# include <istream>
# include <ostream>
# include <print>
# include <queue>
# include <stack>
# include <unordered_map>
# include <vector>
# endif
#endif // _LIBCPP_CXX03_LANG

#endif // _LIBCPP_IOMANIP
126 changes: 66 additions & 60 deletions libcxx/include/ios
Original file line number Diff line number Diff line change
Expand Up @@ -211,37 +211,42 @@ storage-class-specifier const error_category& iostream_category() noexcept;
*/

#include <__config>

#if _LIBCPP_HAS_LOCALIZATION

# include <__fwd/ios.h>
# include <__ios/fpos.h>
# include <__locale>
# include <__memory/addressof.h>
# include <__system_error/error_category.h>
# include <__system_error/error_code.h>
# include <__system_error/error_condition.h>
# include <__system_error/system_error.h>
# include <__utility/swap.h>
# include <__verbose_abort>
# include <version>
#include <__configuration/language.h>

#if defined(_LIBCPP_CXX03_LANG) && !defined(_LIBCPP_USE_CXX03_HEADERS)
# include <__cxx03/ios>
#else
# include <__config>

# if _LIBCPP_HAS_LOCALIZATION

# include <__fwd/ios.h>
# include <__ios/fpos.h>
# include <__locale>
# include <__memory/addressof.h>
# include <__system_error/error_category.h>
# include <__system_error/error_code.h>
# include <__system_error/error_condition.h>
# include <__system_error/system_error.h>
# include <__utility/swap.h>
# include <__verbose_abort>
# include <version>

// standard-mandated includes

// [ios.syn]
# include <iosfwd>
# include <iosfwd>

# if _LIBCPP_HAS_ATOMIC_HEADER
# include <__atomic/atomic.h> // for __xindex_
# endif
# if _LIBCPP_HAS_ATOMIC_HEADER
# include <__atomic/atomic.h> // for __xindex_
# endif

# if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
# pragma GCC system_header
# endif
# if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
# pragma GCC system_header
# endif

_LIBCPP_PUSH_MACROS
# include <__undef_macros>
# include <__undef_macros>

_LIBCPP_BEGIN_NAMESPACE_STD

Expand Down Expand Up @@ -284,20 +289,20 @@ public:
static const openmode in = 0x08;
static const openmode out = 0x10;
static const openmode trunc = 0x20;
# if _LIBCPP_STD_VER >= 23
# if _LIBCPP_STD_VER >= 23
static const openmode noreplace = 0x40;
# endif
# endif

enum seekdir { beg, cur, end };

# if _LIBCPP_STD_VER <= 14
# if _LIBCPP_STD_VER <= 14
typedef iostate io_state;
typedef openmode open_mode;
typedef seekdir seek_dir;

typedef std::streamoff streamoff;
typedef std::streampos streampos;
# endif
# endif

class _LIBCPP_EXPORTED_FROM_ABI Init;

Expand Down Expand Up @@ -397,11 +402,11 @@ private:
size_t __event_cap_;
// TODO(EricWF): Enable this for both Clang and GCC. Currently it is only
// enabled with clang.
# if _LIBCPP_HAS_C_ATOMIC_IMP && _LIBCPP_HAS_THREADS
# if _LIBCPP_HAS_C_ATOMIC_IMP && _LIBCPP_HAS_THREADS
static atomic<int> __xindex_;
# else
# else
static int __xindex_;
# endif
# endif
long* __iarray_;
size_t __iarray_size_;
size_t __iarray_cap_;
Expand All @@ -417,10 +422,10 @@ _LIBCPP_DECLARE_STRONG_ENUM_EPILOG(io_errc)
template <>
struct _LIBCPP_TEMPLATE_VIS is_error_code_enum<io_errc> : public true_type {};

# ifdef _LIBCPP_CXX03_LANG
# ifdef _LIBCPP_CXX03_LANG
template <>
struct _LIBCPP_TEMPLATE_VIS is_error_code_enum<io_errc::__lx> : public true_type {};
# endif
# endif

_LIBCPP_EXPORTED_FROM_ABI const error_category& iostream_category() _NOEXCEPT;

Expand All @@ -441,11 +446,11 @@ public:
};

[[__noreturn__]] inline _LIBCPP_HIDE_FROM_ABI void __throw_failure(char const* __msg) {
# if _LIBCPP_HAS_EXCEPTIONS
# if _LIBCPP_HAS_EXCEPTIONS
throw ios_base::failure(__msg);
# else
# else
_LIBCPP_VERBOSE_ABORT("ios_base::failure was thrown in -fno-exceptions mode with message \"%s\"", __msg);
# endif
# endif
}

class _LIBCPP_EXPORTED_FROM_ABI ios_base::Init {
Expand Down Expand Up @@ -569,13 +574,13 @@ public:
static_assert(is_same<_CharT, typename traits_type::char_type>::value,
"traits_type::char_type must be the same type as CharT");

# ifdef _LIBCPP_CXX03_LANG
# ifdef _LIBCPP_CXX03_LANG
// Preserve the ability to compare with literal 0,
// and implicitly convert to bool, but not implicitly convert to int.
_LIBCPP_HIDE_FROM_ABI operator void*() const { return fail() ? nullptr : (void*)this; }
# else
# else
_LIBCPP_HIDE_FROM_ABI explicit operator bool() const { return !fail(); }
# endif
# endif

_LIBCPP_HIDE_FROM_ABI bool operator!() const { return fail(); }
_LIBCPP_HIDE_FROM_ABI iostate rdstate() const { return ios_base::rdstate(); }
Expand Down Expand Up @@ -625,11 +630,11 @@ protected:
private:
basic_ostream<char_type, traits_type>* __tie_;

# if defined(_LIBCPP_ABI_IOS_ALLOW_ARBITRARY_FILL_VALUE)
# if defined(_LIBCPP_ABI_IOS_ALLOW_ARBITRARY_FILL_VALUE)
using _FillType = _FillHelper<traits_type>;
# else
# else
using _FillType = _SentinelValueFill<traits_type>;
# endif
# endif
mutable _FillType __fill_;
};

Expand Down Expand Up @@ -744,9 +749,9 @@ inline _LIBCPP_HIDE_FROM_ABI void basic_ios<_CharT, _Traits>::set_rdbuf(basic_st

extern template class _LIBCPP_EXTERN_TEMPLATE_TYPE_VIS basic_ios<char>;

# if _LIBCPP_HAS_WIDE_CHARACTERS
# if _LIBCPP_HAS_WIDE_CHARACTERS
extern template class _LIBCPP_EXTERN_TEMPLATE_TYPE_VIS basic_ios<wchar_t>;
# endif
# endif

_LIBCPP_HIDE_FROM_ABI inline ios_base& boolalpha(ios_base& __str) {
__str.setf(ios_base::boolalpha);
Expand Down Expand Up @@ -872,22 +877,23 @@ _LIBCPP_END_NAMESPACE_STD

_LIBCPP_POP_MACROS

#endif // _LIBCPP_HAS_LOCALIZATION

#if !defined(_LIBCPP_REMOVE_TRANSITIVE_INCLUDES) && _LIBCPP_STD_VER <= 20
# include <atomic>
# include <concepts>
# include <cstddef>
# include <cstdlib>
# include <cstring>
# include <initializer_list>
# include <limits>
# include <mutex>
# include <new>
# include <stdexcept>
# include <system_error>
# include <type_traits>
# include <typeinfo>
#endif
# endif // _LIBCPP_HAS_LOCALIZATION

# if !defined(_LIBCPP_REMOVE_TRANSITIVE_INCLUDES) && _LIBCPP_STD_VER <= 20
# include <atomic>
# include <concepts>
# include <cstddef>
# include <cstdlib>
# include <cstring>
# include <initializer_list>
# include <limits>
# include <mutex>
# include <new>
# include <stdexcept>
# include <system_error>
# include <type_traits>
# include <typeinfo>
# endif
#endif // _LIBCPP_CXX03_LANG

#endif // _LIBCPP_IOS
56 changes: 31 additions & 25 deletions libcxx/include/iosfwd
Original file line number Diff line number Diff line change
Expand Up @@ -105,21 +105,26 @@ using wosyncstream = basic_osyncstream<wchar_t>; // C++20
*/

#include <__config>
#include <__fwd/fstream.h>
#include <__fwd/ios.h>
#include <__fwd/istream.h>
#include <__fwd/memory.h>
#include <__fwd/ostream.h>
#include <__fwd/sstream.h>
#include <__fwd/streambuf.h>
#include <__fwd/string.h>
#include <__std_mbstate_t.h>
#include <version>

#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
# pragma GCC system_header
#endif
#include <__configuration/language.h>

#if defined(_LIBCPP_CXX03_LANG) && !defined(_LIBCPP_USE_CXX03_HEADERS)
# include <__cxx03/iosfwd>
#else
# include <__config>
# include <__fwd/fstream.h>
# include <__fwd/ios.h>
# include <__fwd/istream.h>
# include <__fwd/memory.h>
# include <__fwd/ostream.h>
# include <__fwd/sstream.h>
# include <__fwd/streambuf.h>
# include <__fwd/string.h>
# include <__std_mbstate_t.h>
# include <version>

# if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
# pragma GCC system_header
# endif

_LIBCPP_BEGIN_NAMESPACE_STD

Expand All @@ -131,34 +136,34 @@ class _LIBCPP_TEMPLATE_VIS ostreambuf_iterator;
template <class _State>
class _LIBCPP_TEMPLATE_VIS fpos;
typedef fpos<mbstate_t> streampos;
#if _LIBCPP_HAS_WIDE_CHARACTERS
# if _LIBCPP_HAS_WIDE_CHARACTERS
typedef fpos<mbstate_t> wstreampos;
#endif
#if _LIBCPP_HAS_CHAR8_T
# endif
# if _LIBCPP_HAS_CHAR8_T
typedef fpos<mbstate_t> u8streampos;
#endif
# endif
typedef fpos<mbstate_t> u16streampos;
typedef fpos<mbstate_t> u32streampos;

#if _LIBCPP_STD_VER >= 20 && !defined(_LIBCPP_HAS_NO_EXPERIMENTAL_SYNCSTREAM)
# if _LIBCPP_STD_VER >= 20 && !defined(_LIBCPP_HAS_NO_EXPERIMENTAL_SYNCSTREAM)

template <class _CharT, class _Traits = char_traits<_CharT>, class _Allocator = allocator<_CharT>>
class basic_syncbuf;

using syncbuf = basic_syncbuf<char>;
# if _LIBCPP_HAS_WIDE_CHARACTERS
# if _LIBCPP_HAS_WIDE_CHARACTERS
using wsyncbuf = basic_syncbuf<wchar_t>;
# endif
# endif

template <class _CharT, class _Traits = char_traits<_CharT>, class _Allocator = allocator<_CharT>>
class basic_osyncstream;

using osyncstream = basic_osyncstream<char>;
# if _LIBCPP_HAS_WIDE_CHARACTERS
# if _LIBCPP_HAS_WIDE_CHARACTERS
using wosyncstream = basic_osyncstream<wchar_t>;
# endif
# endif

#endif // _LIBCPP_STD_VER >= 20 && !defined(_LIBCPP_HAS_NO_EXPERIMENTAL_SYNCSTREAM)
# endif // _LIBCPP_STD_VER >= 20 && !defined(_LIBCPP_HAS_NO_EXPERIMENTAL_SYNCSTREAM)

template <class _CharT, class _Traits>
class __save_flags {
Expand All @@ -182,5 +187,6 @@ public:
};

_LIBCPP_END_NAMESPACE_STD
#endif // _LIBCPP_CXX03_LANG

#endif // _LIBCPP_IOSFWD
28 changes: 17 additions & 11 deletions libcxx/include/iostream
Original file line number Diff line number Diff line change
Expand Up @@ -33,20 +33,25 @@ extern wostream wclog;
*/

#include <__config>
#include <version>
#include <__configuration/language.h>

#if defined(_LIBCPP_CXX03_LANG) && !defined(_LIBCPP_USE_CXX03_HEADERS)
# include <__cxx03/iostream>
#else
# include <__config>
# include <version>

// standard-mandated includes

// [iostream.syn]
#include <ios>
#include <istream>
#include <ostream>
#include <streambuf>
# include <ios>
# include <istream>
# include <ostream>
# include <streambuf>

#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
# pragma GCC system_header
#endif
# if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
# pragma GCC system_header
# endif

_LIBCPP_BEGIN_NAMESPACE_STD

Expand All @@ -55,13 +60,14 @@ extern _LIBCPP_EXPORTED_FROM_ABI ostream cout;
extern _LIBCPP_EXPORTED_FROM_ABI ostream cerr;
extern _LIBCPP_EXPORTED_FROM_ABI ostream clog;

#if _LIBCPP_HAS_WIDE_CHARACTERS
# if _LIBCPP_HAS_WIDE_CHARACTERS
extern _LIBCPP_EXPORTED_FROM_ABI wistream wcin;
extern _LIBCPP_EXPORTED_FROM_ABI wostream wcout;
extern _LIBCPP_EXPORTED_FROM_ABI wostream wcerr;
extern _LIBCPP_EXPORTED_FROM_ABI wostream wclog;
#endif
# endif

_LIBCPP_END_NAMESPACE_STD
#endif // _LIBCPP_CXX03_LANG

#endif // _LIBCPP_IOSTREAM
258 changes: 132 additions & 126 deletions libcxx/include/istream

Large diffs are not rendered by default.

142 changes: 74 additions & 68 deletions libcxx/include/iterator
Original file line number Diff line number Diff line change
Expand Up @@ -679,77 +679,83 @@ template <class E> constexpr const E* data(initializer_list<E> il) noexcept;
*/

#include <__config>
#include <__iterator/access.h>
#include <__iterator/advance.h>
#include <__iterator/back_insert_iterator.h>
#include <__iterator/distance.h>
#include <__iterator/front_insert_iterator.h>
#include <__iterator/insert_iterator.h>
#include <__iterator/istream_iterator.h>
#include <__iterator/istreambuf_iterator.h>
#include <__iterator/iterator.h>
#include <__iterator/iterator_traits.h>
#include <__iterator/move_iterator.h>
#include <__iterator/next.h>
#include <__iterator/ostream_iterator.h>
#include <__iterator/ostreambuf_iterator.h>
#include <__iterator/prev.h>
#include <__iterator/reverse_iterator.h>
#include <__iterator/wrap_iter.h>

#if _LIBCPP_STD_VER >= 14
# include <__iterator/reverse_access.h>
#endif

#if _LIBCPP_STD_VER >= 17
# include <__iterator/data.h>
# include <__iterator/empty.h>
# include <__iterator/size.h>
#endif

#if _LIBCPP_STD_VER >= 20
# include <__iterator/common_iterator.h>
# include <__iterator/concepts.h>
# include <__iterator/counted_iterator.h>
# include <__iterator/default_sentinel.h>
# include <__iterator/incrementable_traits.h>
# include <__iterator/indirectly_comparable.h>
# include <__iterator/iter_move.h>
# include <__iterator/iter_swap.h>
# include <__iterator/mergeable.h>
# include <__iterator/move_sentinel.h>
# include <__iterator/permutable.h>
# include <__iterator/projected.h>
# include <__iterator/readable_traits.h>
# include <__iterator/sortable.h>
# include <__iterator/unreachable_sentinel.h>
#endif

#include <version>
#include <__configuration/language.h>

#if defined(_LIBCPP_CXX03_LANG) && !defined(_LIBCPP_USE_CXX03_HEADERS)
# include <__cxx03/iterator>
#else
# include <__config>
# include <__iterator/access.h>
# include <__iterator/advance.h>
# include <__iterator/back_insert_iterator.h>
# include <__iterator/distance.h>
# include <__iterator/front_insert_iterator.h>
# include <__iterator/insert_iterator.h>
# include <__iterator/istream_iterator.h>
# include <__iterator/istreambuf_iterator.h>
# include <__iterator/iterator.h>
# include <__iterator/iterator_traits.h>
# include <__iterator/move_iterator.h>
# include <__iterator/next.h>
# include <__iterator/ostream_iterator.h>
# include <__iterator/ostreambuf_iterator.h>
# include <__iterator/prev.h>
# include <__iterator/reverse_iterator.h>
# include <__iterator/wrap_iter.h>

# if _LIBCPP_STD_VER >= 14
# include <__iterator/reverse_access.h>
# endif

# if _LIBCPP_STD_VER >= 17
# include <__iterator/data.h>
# include <__iterator/empty.h>
# include <__iterator/size.h>
# endif

# if _LIBCPP_STD_VER >= 20
# include <__iterator/common_iterator.h>
# include <__iterator/concepts.h>
# include <__iterator/counted_iterator.h>
# include <__iterator/default_sentinel.h>
# include <__iterator/incrementable_traits.h>
# include <__iterator/indirectly_comparable.h>
# include <__iterator/iter_move.h>
# include <__iterator/iter_swap.h>
# include <__iterator/mergeable.h>
# include <__iterator/move_sentinel.h>
# include <__iterator/permutable.h>
# include <__iterator/projected.h>
# include <__iterator/readable_traits.h>
# include <__iterator/sortable.h>
# include <__iterator/unreachable_sentinel.h>
# endif

# include <version>

// standard-mandated includes

// [iterator.synopsis]
#include <compare>
#include <concepts>

#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
# pragma GCC system_header
#endif

#if !defined(_LIBCPP_REMOVE_TRANSITIVE_INCLUDES) && _LIBCPP_STD_VER <= 17
# include <variant>
#endif

#if !defined(_LIBCPP_REMOVE_TRANSITIVE_INCLUDES) && _LIBCPP_STD_VER <= 20
# include <cstddef>
# include <cstdlib>
# include <exception>
# include <new>
# include <type_traits>
# include <typeinfo>
# include <utility>
#endif
# include <compare>
# include <concepts>

# if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
# pragma GCC system_header
# endif

# if !defined(_LIBCPP_REMOVE_TRANSITIVE_INCLUDES) && _LIBCPP_STD_VER <= 17
# include <variant>
# endif

# if !defined(_LIBCPP_REMOVE_TRANSITIVE_INCLUDES) && _LIBCPP_STD_VER <= 20
# include <cstddef>
# include <cstdlib>
# include <exception>
# include <new>
# include <type_traits>
# include <typeinfo>
# include <utility>
# endif
#endif // _LIBCPP_CXX03_LANG

#endif // _LIBCPP_ITERATOR
46 changes: 26 additions & 20 deletions libcxx/include/latch
Original file line number Diff line number Diff line change
Expand Up @@ -40,26 +40,31 @@ namespace std
*/

#include <__config>
#include <__configuration/language.h>

#if _LIBCPP_HAS_THREADS
#if defined(_LIBCPP_CXX03_LANG) && !defined(_LIBCPP_USE_CXX03_HEADERS)
# include <__cxx03/latch>
#else
# include <__config>

# include <__assert>
# include <__atomic/atomic.h>
# include <__atomic/atomic_sync.h>
# include <__atomic/memory_order.h>
# include <__cstddef/ptrdiff_t.h>
# include <limits>
# include <version>
# if _LIBCPP_HAS_THREADS

# if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
# pragma GCC system_header
# endif
# include <__assert>
# include <__atomic/atomic.h>
# include <__atomic/atomic_sync.h>
# include <__atomic/memory_order.h>
# include <__cstddef/ptrdiff_t.h>
# include <limits>
# include <version>

# if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
# pragma GCC system_header
# endif

_LIBCPP_PUSH_MACROS
# include <__undef_macros>
# include <__undef_macros>

# if _LIBCPP_STD_VER >= 20
# if _LIBCPP_STD_VER >= 20

_LIBCPP_BEGIN_NAMESPACE_STD

Expand Down Expand Up @@ -117,15 +122,16 @@ private:

_LIBCPP_END_NAMESPACE_STD

# endif // _LIBCPP_STD_VER >= 20
# endif // _LIBCPP_STD_VER >= 20

_LIBCPP_POP_MACROS

#endif // _LIBCPP_HAS_THREADS
# endif // _LIBCPP_HAS_THREADS

#if !defined(_LIBCPP_REMOVE_TRANSITIVE_INCLUDES) && _LIBCPP_STD_VER <= 20
# include <atomic>
# include <cstddef>
#endif
# if !defined(_LIBCPP_REMOVE_TRANSITIVE_INCLUDES) && _LIBCPP_STD_VER <= 20
# include <atomic>
# include <cstddef>
# endif
#endif // _LIBCPP_CXX03_LANG

#endif // _LIBCPP_LATCH
60 changes: 33 additions & 27 deletions libcxx/include/limits
Original file line number Diff line number Diff line change
Expand Up @@ -102,18 +102,23 @@ template<> class numeric_limits<cv long double>;
*/

#include <__config>
#include <__type_traits/is_arithmetic.h>
#include <__type_traits/is_signed.h>
#include <__type_traits/remove_cv.h>
#include <__configuration/language.h>

#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
# pragma GCC system_header
#endif
#if defined(_LIBCPP_CXX03_LANG) && !defined(_LIBCPP_USE_CXX03_HEADERS)
# include <__cxx03/limits>
#else
# include <__config>
# include <__type_traits/is_arithmetic.h>
# include <__type_traits/is_signed.h>
# include <__type_traits/remove_cv.h>

# if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
# pragma GCC system_header
# endif

_LIBCPP_PUSH_MACROS
#include <__undef_macros>
#include <version>
# include <__undef_macros>
# include <version>

_LIBCPP_BEGIN_NAMESPACE_STD

Expand Down Expand Up @@ -227,11 +232,11 @@ protected:
static _LIBCPP_CONSTEXPR const bool is_bounded = true;
static _LIBCPP_CONSTEXPR const bool is_modulo = !std::is_signed<_Tp>::value;

#if defined(__i386__) || defined(__x86_64__) || defined(__pnacl__) || defined(__wasm__)
# if defined(__i386__) || defined(__x86_64__) || defined(__pnacl__) || defined(__wasm__)
static _LIBCPP_CONSTEXPR const bool traps = true;
#else
# else
static _LIBCPP_CONSTEXPR const bool traps = false;
#endif
# endif
static _LIBCPP_CONSTEXPR const bool tinyness_before = false;
static _LIBCPP_CONSTEXPR const float_round_style round_style = round_toward_zero;
};
Expand Down Expand Up @@ -332,11 +337,11 @@ protected:
static _LIBCPP_CONSTEXPR const bool is_modulo = false;

static _LIBCPP_CONSTEXPR const bool traps = false;
#if (defined(__arm__) || defined(__aarch64__))
# if (defined(__arm__) || defined(__aarch64__))
static _LIBCPP_CONSTEXPR const bool tinyness_before = true;
#else
# else
static _LIBCPP_CONSTEXPR const bool tinyness_before = false;
#endif
# endif
static _LIBCPP_CONSTEXPR const float_round_style round_style = round_to_nearest;
};

Expand Down Expand Up @@ -389,11 +394,11 @@ protected:
static _LIBCPP_CONSTEXPR const bool is_modulo = false;

static _LIBCPP_CONSTEXPR const bool traps = false;
#if (defined(__arm__) || defined(__aarch64__))
# if (defined(__arm__) || defined(__aarch64__))
static _LIBCPP_CONSTEXPR const bool tinyness_before = true;
#else
# else
static _LIBCPP_CONSTEXPR const bool tinyness_before = false;
#endif
# endif
static _LIBCPP_CONSTEXPR const float_round_style round_style = round_to_nearest;
};

Expand Down Expand Up @@ -441,20 +446,20 @@ protected:
return __LDBL_DENORM_MIN__;
}

#if defined(__powerpc__) && defined(__LONG_DOUBLE_IBM128__)
# if defined(__powerpc__) && defined(__LONG_DOUBLE_IBM128__)
static _LIBCPP_CONSTEXPR const bool is_iec559 = false;
#else
# else
static _LIBCPP_CONSTEXPR const bool is_iec559 = true;
#endif
# endif
static _LIBCPP_CONSTEXPR const bool is_bounded = true;
static _LIBCPP_CONSTEXPR const bool is_modulo = false;

static _LIBCPP_CONSTEXPR const bool traps = false;
#if (defined(__arm__) || defined(__aarch64__))
# if (defined(__arm__) || defined(__aarch64__))
static _LIBCPP_CONSTEXPR const bool tinyness_before = true;
#else
# else
static _LIBCPP_CONSTEXPR const bool tinyness_before = false;
#endif
# endif
static _LIBCPP_CONSTEXPR const float_round_style round_style = round_to_nearest;
};

Expand Down Expand Up @@ -530,8 +535,9 @@ _LIBCPP_END_NAMESPACE_STD

_LIBCPP_POP_MACROS

#if !defined(_LIBCPP_REMOVE_TRANSITIVE_INCLUDES) && _LIBCPP_STD_VER <= 20
# include <type_traits>
#endif
# if !defined(_LIBCPP_REMOVE_TRANSITIVE_INCLUDES) && _LIBCPP_STD_VER <= 20
# include <type_traits>
# endif
#endif // _LIBCPP_CXX03_LANG

#endif // _LIBCPP_LIMITS
332 changes: 169 additions & 163 deletions libcxx/include/list

Large diffs are not rendered by default.

312 changes: 159 additions & 153 deletions libcxx/include/locale

Large diffs are not rendered by default.

298 changes: 151 additions & 147 deletions libcxx/include/map

Large diffs are not rendered by default.

170 changes: 88 additions & 82 deletions libcxx/include/math.h
Original file line number Diff line number Diff line change
Expand Up @@ -291,93 +291,98 @@ long double truncl(long double x);
*/

# include <__config>
# include <__configuration/language.h>

# if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
# pragma GCC system_header
# endif

# if __has_include_next(<math.h>)
# include_next <math.h>
# endif

# ifdef __cplusplus

// We support including .h headers inside 'extern "C"' contexts, so switch
// back to C++ linkage before including these C++ headers.
extern "C++" {

# ifdef fpclassify
# undef fpclassify
# endif

# ifdef signbit
# undef signbit
# endif

# ifdef isfinite
# undef isfinite
# endif
# if defined(_LIBCPP_CXX03_LANG) && !defined(_LIBCPP_USE_CXX03_HEADERS)
# include <__cxx03/math.h>
# else
# include <__config>

# ifdef isinf
# undef isinf
# if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
# pragma GCC system_header
# endif

# ifdef isnan
# undef isnan
# if __has_include_next(<math.h>)
# include_next <math.h>
# endif

# ifdef isnormal
# undef isnormal
# endif

# ifdef isgreater
# undef isgreater
# endif

# ifdef isgreaterequal
# undef isgreaterequal
# endif

# ifdef isless
# undef isless
# endif
# ifdef __cplusplus

# ifdef islessequal
# undef islessequal
# endif

# ifdef islessgreater
# undef islessgreater
# endif

# ifdef isunordered
# undef isunordered
# endif
// We support including .h headers inside 'extern "C"' contexts, so switch
// back to C++ linkage before including these C++ headers.
extern "C++" {

# include <__math/abs.h>
# include <__math/copysign.h>
# include <__math/error_functions.h>
# include <__math/exponential_functions.h>
# include <__math/fdim.h>
# include <__math/fma.h>
# include <__math/gamma.h>
# include <__math/hyperbolic_functions.h>
# include <__math/hypot.h>
# include <__math/inverse_hyperbolic_functions.h>
# include <__math/inverse_trigonometric_functions.h>
# include <__math/logarithms.h>
# include <__math/min_max.h>
# include <__math/modulo.h>
# include <__math/remainder.h>
# include <__math/roots.h>
# include <__math/rounding_functions.h>
# include <__math/traits.h>
# include <__math/trigonometric_functions.h>
# include <__type_traits/enable_if.h>
# include <__type_traits/is_floating_point.h>
# include <__type_traits/is_integral.h>
# include <stdlib.h>
# ifdef fpclassify
# undef fpclassify
# endif

# ifdef signbit
# undef signbit
# endif

# ifdef isfinite
# undef isfinite
# endif

# ifdef isinf
# undef isinf
# endif

# ifdef isnan
# undef isnan
# endif

# ifdef isnormal
# undef isnormal
# endif

# ifdef isgreater
# undef isgreater
# endif

# ifdef isgreaterequal
# undef isgreaterequal
# endif

# ifdef isless
# undef isless
# endif

# ifdef islessequal
# undef islessequal
# endif

# ifdef islessgreater
# undef islessgreater
# endif

# ifdef isunordered
# undef isunordered
# endif

# include <__math/abs.h>
# include <__math/copysign.h>
# include <__math/error_functions.h>
# include <__math/exponential_functions.h>
# include <__math/fdim.h>
# include <__math/fma.h>
# include <__math/gamma.h>
# include <__math/hyperbolic_functions.h>
# include <__math/hypot.h>
# include <__math/inverse_hyperbolic_functions.h>
# include <__math/inverse_trigonometric_functions.h>
# include <__math/logarithms.h>
# include <__math/min_max.h>
# include <__math/modulo.h>
# include <__math/remainder.h>
# include <__math/roots.h>
# include <__math/rounding_functions.h>
# include <__math/traits.h>
# include <__math/trigonometric_functions.h>
# include <__type_traits/enable_if.h>
# include <__type_traits/is_floating_point.h>
# include <__type_traits/is_integral.h>
# include <stdlib.h>

// fpclassify relies on implementation-defined constants, so we can't move it to a detail header
_LIBCPP_BEGIN_NAMESPACE_STD
Expand Down Expand Up @@ -415,7 +420,7 @@ using std::__math::fpclassify;
using std::__math::signbit;

// The MSVC runtime already provides these functions as templates
# ifndef _LIBCPP_MSVCRT
# ifndef _LIBCPP_MSVCRT
using std::__math::isfinite;
using std::__math::isgreater;
using std::__math::isgreaterequal;
Expand All @@ -426,7 +431,7 @@ using std::__math::islessgreater;
using std::__math::isnan;
using std::__math::isnormal;
using std::__math::isunordered;
# endif // _LIBCPP_MSVCRT
# endif // _LIBCPP_MSVCRT

// abs
//
Expand Down Expand Up @@ -501,7 +506,8 @@ using std::__math::trunc;

} // extern "C++"

# endif // __cplusplus
# endif // __cplusplus
# endif // _LIBCPP_CXX03_LANG

#else // _LIBCPP_MATH_H

Expand Down
41 changes: 24 additions & 17 deletions libcxx/include/mdspan
Original file line number Diff line number Diff line change
Expand Up @@ -408,22 +408,29 @@ namespace std {
#ifndef _LIBCPP_MDSPAN
#define _LIBCPP_MDSPAN

#include <__config>

#if _LIBCPP_STD_VER >= 23
# include <__fwd/mdspan.h>
# include <__mdspan/default_accessor.h>
# include <__mdspan/extents.h>
# include <__mdspan/layout_left.h>
# include <__mdspan/layout_right.h>
# include <__mdspan/layout_stride.h>
# include <__mdspan/mdspan.h>
#endif

#include <version>

#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
# pragma GCC system_header
#endif
#include <__configuration/language.h>

#if defined(_LIBCPP_CXX03_LANG) && !defined(_LIBCPP_USE_CXX03_HEADERS)
# include <__cxx03/mdspan>
#else
# include <__config>

# if _LIBCPP_STD_VER >= 23
# include <__fwd/mdspan.h>
# include <__mdspan/default_accessor.h>
# include <__mdspan/extents.h>
# include <__mdspan/layout_left.h>
# include <__mdspan/layout_right.h>
# include <__mdspan/layout_stride.h>
# include <__mdspan/mdspan.h>
# endif

# include <version>

# if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
# pragma GCC system_header
# endif

#endif // _LIBCPP_CXX03_LANG

#endif // _LIBCPP_MDSPAN
110 changes: 58 additions & 52 deletions libcxx/include/memory
Original file line number Diff line number Diff line change
Expand Up @@ -934,65 +934,71 @@ template<class Pointer = void, class Smart, class... Args>

// clang-format on

#include <__config>
#include <__memory/addressof.h>
#include <__memory/align.h>
#include <__memory/allocator.h>
#include <__memory/allocator_arg_t.h>
#include <__memory/allocator_traits.h>
#include <__memory/auto_ptr.h>
#include <__memory/inout_ptr.h>
#include <__memory/out_ptr.h>
#include <__memory/pointer_traits.h>
#include <__memory/raw_storage_iterator.h>
#include <__memory/shared_ptr.h>
#include <__memory/temporary_buffer.h>
#include <__memory/uninitialized_algorithms.h>
#include <__memory/unique_ptr.h>
#include <__memory/uses_allocator.h>
#include <__configuration/language.h>

#if defined(_LIBCPP_CXX03_LANG) && !defined(_LIBCPP_USE_CXX03_HEADERS)
# include <__cxx03/memory>
#else
# include <__config>
# include <__memory/addressof.h>
# include <__memory/align.h>
# include <__memory/allocator.h>
# include <__memory/allocator_arg_t.h>
# include <__memory/allocator_traits.h>
# include <__memory/auto_ptr.h>
# include <__memory/inout_ptr.h>
# include <__memory/out_ptr.h>
# include <__memory/pointer_traits.h>
# include <__memory/raw_storage_iterator.h>
# include <__memory/shared_ptr.h>
# include <__memory/temporary_buffer.h>
# include <__memory/uninitialized_algorithms.h>
# include <__memory/unique_ptr.h>
# include <__memory/uses_allocator.h>

// standard-mandated includes

#if _LIBCPP_STD_VER >= 17
# include <__memory/construct_at.h>
#endif
# if _LIBCPP_STD_VER >= 17
# include <__memory/construct_at.h>
# endif

#if _LIBCPP_STD_VER >= 20
# include <__memory/assume_aligned.h>
# include <__memory/concepts.h>
# include <__memory/ranges_construct_at.h>
# include <__memory/ranges_uninitialized_algorithms.h>
# include <__memory/uses_allocator_construction.h>
#endif
# if _LIBCPP_STD_VER >= 20
# include <__memory/assume_aligned.h>
# include <__memory/concepts.h>
# include <__memory/ranges_construct_at.h>
# include <__memory/ranges_uninitialized_algorithms.h>
# include <__memory/uses_allocator_construction.h>
# endif

#if _LIBCPP_STD_VER >= 23
# include <__memory/allocate_at_least.h>
#endif
# if _LIBCPP_STD_VER >= 23
# include <__memory/allocate_at_least.h>
# endif

#include <version>
# include <version>

// [memory.syn]
#include <compare>

#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
# pragma GCC system_header
#endif

#if !defined(_LIBCPP_REMOVE_TRANSITIVE_INCLUDES) && _LIBCPP_STD_VER <= 20
# include <atomic>
# include <concepts>
# include <cstddef>
# include <cstdint>
# include <cstdlib>
# include <cstring>
# include <iosfwd>
# include <iterator>
# include <new>
# include <stdexcept>
# include <tuple>
# include <type_traits>
# include <typeinfo>
# include <utility>
#endif
# include <compare>

# if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
# pragma GCC system_header
# endif

# if !defined(_LIBCPP_REMOVE_TRANSITIVE_INCLUDES) && _LIBCPP_STD_VER <= 20
# include <atomic>
# include <concepts>
# include <cstddef>
# include <cstdint>
# include <cstdlib>
# include <cstring>
# include <iosfwd>
# include <iterator>
# include <new>
# include <stdexcept>
# include <tuple>
# include <type_traits>
# include <typeinfo>
# include <utility>
# endif
#endif // _LIBCPP_CXX03_LANG

#endif // _LIBCPP_MEMORY
54 changes: 30 additions & 24 deletions libcxx/include/memory_resource
Original file line number Diff line number Diff line change
Expand Up @@ -49,29 +49,35 @@ namespace std::pmr {
*/

#include <__config>

#if _LIBCPP_STD_VER >= 17
# include <__memory_resource/memory_resource.h>
# include <__memory_resource/monotonic_buffer_resource.h>
# include <__memory_resource/polymorphic_allocator.h>
# include <__memory_resource/pool_options.h>
# include <__memory_resource/synchronized_pool_resource.h>
# include <__memory_resource/unsynchronized_pool_resource.h>
#endif

#include <version>

#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
# pragma GCC system_header
#endif

#if !defined(_LIBCPP_REMOVE_TRANSITIVE_INCLUDES) && _LIBCPP_STD_VER >= 17 && _LIBCPP_STD_VER <= 20
# include <mutex>
#endif

#if !defined(_LIBCPP_REMOVE_TRANSITIVE_INCLUDES) && _LIBCPP_STD_VER <= 20
# include <stdexcept>
#endif
#include <__configuration/language.h>

#if defined(_LIBCPP_CXX03_LANG) && !defined(_LIBCPP_USE_CXX03_HEADERS)
# include <__cxx03/memory_resource>
#else
# include <__config>

# if _LIBCPP_STD_VER >= 17
# include <__memory_resource/memory_resource.h>
# include <__memory_resource/monotonic_buffer_resource.h>
# include <__memory_resource/polymorphic_allocator.h>
# include <__memory_resource/pool_options.h>
# include <__memory_resource/synchronized_pool_resource.h>
# include <__memory_resource/unsynchronized_pool_resource.h>
# endif

# include <version>

# if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
# pragma GCC system_header
# endif

# if !defined(_LIBCPP_REMOVE_TRANSITIVE_INCLUDES) && _LIBCPP_STD_VER >= 17 && _LIBCPP_STD_VER <= 20
# include <mutex>
# endif

# if !defined(_LIBCPP_REMOVE_TRANSITIVE_INCLUDES) && _LIBCPP_STD_VER <= 20
# include <stdexcept>
# endif
#endif // _LIBCPP_CXX03_LANG

#endif /* _LIBCPP_MEMORY_RESOURCE */
Loading