[libc++] Guard contents on _LIBCPP_HAS_LOCALIZATION (#129112) · llvm/llvm-project@dcc378e (original) (raw)

`@@ -58,14 +58,17 @@ class codecvt_utf8_utf16

`

58

58

`# include <__cxx03/codecvt>

`

59

59

`#else

`

60

60

`# include <__config>

`

61

``

`-

include <__locale>

`

62

``

`-

include

`

63

61

``

64

``

`-

if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)

`

65

``

`-

pragma GCC system_header

`

66

``

`-

endif

`

``

62

`+

if _LIBCPP_HAS_LOCALIZATION

`

``

63

+

``

64

`+

include <__locale>

`

``

65

`+

include

`

67

66

``

68

``

`-

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

`

``

67

`+

if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)

`

``

68

`+

pragma GCC system_header

`

``

69

`+

endif

`

``

70

+

``

71

`+

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

`

69

72

``

70

73

`_LIBCPP_BEGIN_NAMESPACE_STD

`

71

74

``

`@@ -76,7 +79,7 @@ enum _LIBCPP_DEPRECATED_IN_CXX17 codecvt_mode { consume_header = 4, generate_hea

`

76

79

`template

`

77

80

`class __codecvt_utf8;

`

78

81

``

79

``

`-

if _LIBCPP_HAS_WIDE_CHARACTERS

`

``

82

`+

if _LIBCPP_HAS_WIDE_CHARACTERS

`

80

83

`template <>

`

81

84

`class _LIBCPP_EXPORTED_FROM_ABI __codecvt_utf8 : public codecvt<wchar_t, char, mbstate_t> {

`

82

85

`unsigned long _maxcode;

`

`@@ -115,7 +118,7 @@ protected:

`

115

118

`int do_length(state_type&, const extern_type* __frm, const extern_type* __end, size_t __mx) const override;

`

116

119

`int do_max_length() const _NOEXCEPT override;

`

117

120

`};

`

118

``

`-

endif // _LIBCPP_HAS_WIDE_CHARACTERS

`

``

121

`+

endif // _LIBCPP_HAS_WIDE_CHARACTERS

`

119

122

``

120

123

`_LIBCPP_SUPPRESS_DEPRECATED_PUSH

`

121

124

`template <>

`

`@@ -206,7 +209,7 @@ _LIBCPP_SUPPRESS_DEPRECATED_POP

`

206

209

`template <class _Elem, bool _LittleEndian>

`

207

210

`class __codecvt_utf16;

`

208

211

``

209

``

`-

if _LIBCPP_HAS_WIDE_CHARACTERS

`

``

212

`+

if _LIBCPP_HAS_WIDE_CHARACTERS

`

210

213

`template <>

`

211

214

`class _LIBCPP_EXPORTED_FROM_ABI __codecvt_utf16<wchar_t, false> : public codecvt<wchar_t, char, mbstate_t> {

`

212

215

`unsigned long _maxcode;

`

`@@ -284,7 +287,7 @@ protected:

`

284

287

`int do_length(state_type&, const extern_type* __frm, const extern_type* __end, size_t __mx) const override;

`

285

288

`int do_max_length() const _NOEXCEPT override;

`

286

289

`};

`

287

``

`-

endif // _LIBCPP_HAS_WIDE_CHARACTERS

`

``

290

`+

endif // _LIBCPP_HAS_WIDE_CHARACTERS

`

288

291

``

289

292

`_LIBCPP_SUPPRESS_DEPRECATED_PUSH

`

290

293

`template <>

`

`@@ -451,7 +454,7 @@ _LIBCPP_SUPPRESS_DEPRECATED_POP

`

451

454

`template

`

452

455

`class __codecvt_utf8_utf16;

`

453

456

``

454

``

`-

if _LIBCPP_HAS_WIDE_CHARACTERS

`

``

457

`+

if _LIBCPP_HAS_WIDE_CHARACTERS

`

455

458

`template <>

`

456

459

`class _LIBCPP_EXPORTED_FROM_ABI __codecvt_utf8_utf16 : public codecvt<wchar_t, char, mbstate_t> {

`

457

460

`unsigned long _maxcode;

`

`@@ -490,7 +493,7 @@ protected:

`

490

493

`int do_length(state_type&, const extern_type* __frm, const extern_type* __end, size_t __mx) const override;

`

491

494

`int do_max_length() const _NOEXCEPT override;

`

492

495

`};

`

493

``

`-

endif // _LIBCPP_HAS_WIDE_CHARACTERS

`

``

496

`+

endif // _LIBCPP_HAS_WIDE_CHARACTERS

`

494

497

``

495

498

`_LIBCPP_SUPPRESS_DEPRECATED_PUSH

`

496

499

`template <>

`

`@@ -579,7 +582,9 @@ _LIBCPP_SUPPRESS_DEPRECATED_POP

`

579

582

``

580

583

`_LIBCPP_END_NAMESPACE_STD

`

581

584

``

582

``

`-

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

`

``

585

`+

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

`

``

586

+

``

587

`+

endif // _LIBCPP_HAS_LOCALIZATION

`

583

588

``

584

589

`# if !defined(_LIBCPP_REMOVE_TRANSITIVE_INCLUDES) && _LIBCPP_STD_VER <= 20

`

585

590

`# include

`