Skip to content

[libc++] Guard <codecvt> contents on _LIBCPP_HAS_LOCALIZATION #129112

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Feb 28, 2025
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
31 changes: 18 additions & 13 deletions libcxx/include/codecvt
Original file line number Diff line number Diff line change
Expand Up @@ -58,14 +58,17 @@ class codecvt_utf8_utf16
# include <__cxx03/codecvt>
#else
# include <__config>
# include <__locale>
# include <version>

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

# include <__locale>
# include <version>

# if _LIBCPP_STD_VER < 26 || defined(_LIBCPP_BUILDING_LIBRARY) || defined(_LIBCPP_ENABLE_CXX26_REMOVED_CODECVT)
# if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
# pragma GCC system_header
# endif

# if _LIBCPP_STD_VER < 26 || defined(_LIBCPP_BUILDING_LIBRARY) || defined(_LIBCPP_ENABLE_CXX26_REMOVED_CODECVT)

_LIBCPP_BEGIN_NAMESPACE_STD

Expand All @@ -76,7 +79,7 @@ enum _LIBCPP_DEPRECATED_IN_CXX17 codecvt_mode { consume_header = 4, generate_hea
template <class _Elem>
class __codecvt_utf8;

# if _LIBCPP_HAS_WIDE_CHARACTERS
# if _LIBCPP_HAS_WIDE_CHARACTERS
template <>
class _LIBCPP_EXPORTED_FROM_ABI __codecvt_utf8<wchar_t> : public codecvt<wchar_t, char, mbstate_t> {
unsigned long __maxcode_;
Expand Down Expand Up @@ -115,7 +118,7 @@ protected:
int do_length(state_type&, const extern_type* __frm, const extern_type* __end, size_t __mx) const override;
int do_max_length() const _NOEXCEPT override;
};
# endif // _LIBCPP_HAS_WIDE_CHARACTERS
# endif // _LIBCPP_HAS_WIDE_CHARACTERS

_LIBCPP_SUPPRESS_DEPRECATED_PUSH
template <>
Expand Down Expand Up @@ -206,7 +209,7 @@ _LIBCPP_SUPPRESS_DEPRECATED_POP
template <class _Elem, bool _LittleEndian>
class __codecvt_utf16;

# if _LIBCPP_HAS_WIDE_CHARACTERS
# if _LIBCPP_HAS_WIDE_CHARACTERS
template <>
class _LIBCPP_EXPORTED_FROM_ABI __codecvt_utf16<wchar_t, false> : public codecvt<wchar_t, char, mbstate_t> {
unsigned long __maxcode_;
Expand Down Expand Up @@ -284,7 +287,7 @@ protected:
int do_length(state_type&, const extern_type* __frm, const extern_type* __end, size_t __mx) const override;
int do_max_length() const _NOEXCEPT override;
};
# endif // _LIBCPP_HAS_WIDE_CHARACTERS
# endif // _LIBCPP_HAS_WIDE_CHARACTERS

_LIBCPP_SUPPRESS_DEPRECATED_PUSH
template <>
Expand Down Expand Up @@ -451,7 +454,7 @@ _LIBCPP_SUPPRESS_DEPRECATED_POP
template <class _Elem>
class __codecvt_utf8_utf16;

# if _LIBCPP_HAS_WIDE_CHARACTERS
# if _LIBCPP_HAS_WIDE_CHARACTERS
template <>
class _LIBCPP_EXPORTED_FROM_ABI __codecvt_utf8_utf16<wchar_t> : public codecvt<wchar_t, char, mbstate_t> {
unsigned long __maxcode_;
Expand Down Expand Up @@ -490,7 +493,7 @@ protected:
int do_length(state_type&, const extern_type* __frm, const extern_type* __end, size_t __mx) const override;
int do_max_length() const _NOEXCEPT override;
};
# endif // _LIBCPP_HAS_WIDE_CHARACTERS
# endif // _LIBCPP_HAS_WIDE_CHARACTERS

_LIBCPP_SUPPRESS_DEPRECATED_PUSH
template <>
Expand Down Expand Up @@ -579,7 +582,9 @@ _LIBCPP_SUPPRESS_DEPRECATED_POP

_LIBCPP_END_NAMESPACE_STD

# endif // _LIBCPP_STD_VER < 26 || defined(_LIBCPP_BUILDING_LIBRARY) || defined(_LIBCPP_ENABLE_CXX26_REMOVED_CODECVT)
# endif // _LIBCPP_STD_VER < 26 || defined(_LIBCPP_BUILDING_LIBRARY) || defined(_LIBCPP_ENABLE_CXX26_REMOVED_CODECVT)

# endif // _LIBCPP_HAS_LOCALIZATION

# if !defined(_LIBCPP_REMOVE_TRANSITIVE_INCLUDES) && _LIBCPP_STD_VER <= 20
# include <atomic>
Expand Down