[libc++] Guard __pad_and_output with _LIBCPP_HAS_LOCALIZATION (#116580)

This fixes errors for no-localization builds (possibly introduced by
#116223).
This commit is contained in:
A. Jiang 2024-11-18 17:03:29 +08:00 committed by GitHub
parent 4f78f85190
commit b5bc528c14
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 11 additions and 4 deletions

View File

@ -65,9 +65,11 @@ public:
_LIBCPP_HIDE_FROM_ABI ostreambuf_iterator& operator++(int) { return *this; }
_LIBCPP_HIDE_FROM_ABI bool failed() const _NOEXCEPT { return __sbuf_ == nullptr; }
#if _LIBCPP_HAS_LOCALIZATION
template <class _Ch, class _Tr>
friend _LIBCPP_HIDE_FROM_ABI ostreambuf_iterator<_Ch, _Tr> __pad_and_output(
ostreambuf_iterator<_Ch, _Tr> __s, const _Ch* __ob, const _Ch* __op, const _Ch* __oe, ios_base& __iob, _Ch __fl);
#endif // _LIBCPP_HAS_LOCALIZATION
};
_LIBCPP_END_NAMESPACE_STD

View File

@ -10,11 +10,14 @@
#define _LIBCPP___LOCALE_DIR_PAD_AND_OUTPUT_H
#include <__config>
#include <ios>
#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
# pragma GCC system_header
#endif
#if _LIBCPP_HAS_LOCALIZATION
# include <ios>
# if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
# pragma GCC system_header
# endif
_LIBCPP_BEGIN_NAMESPACE_STD
@ -80,4 +83,6 @@ _LIBCPP_HIDE_FROM_ABI ostreambuf_iterator<_CharT, _Traits> __pad_and_output(
_LIBCPP_END_NAMESPACE_STD
#endif // _LIBCPP_HAS_LOCALIZATION
#endif // _LIBCPP___LOCALE_DIR_PAD_AND_OUTPUT_H