Skip to content

Commit 429a3e8

Browse files
committed
Use the availability macro properly(?)
1 parent 348a419 commit 429a3e8

File tree

3 files changed

+8
-7
lines changed

3 files changed

+8
-7
lines changed

libcxx/include/__text_encoding/te_impl.h

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -531,14 +531,13 @@ struct __te_impl {
531531
_LIBCPP_HIDDEN static __id __get_win32_acp();
532532
# endif
533533

534-
# if _LIBCPP_AVAILABILITY_HAS_TE_ENVIRONMENT
535-
[[nodiscard]] _LIBCPP_EXPORTED_FROM_ABI static __te_impl __environment();
534+
[[nodiscard]] _LIBCPP_AVAILABILITY_TE_ENVIRONMENT _LIBCPP_EXPORTED_FROM_ABI static __te_impl __environment();
536535

537536
template <__id _Id>
538-
[[nodiscard]] _LIBCPP_HIDE_FROM_ABI static bool __environment_is() {
537+
[[nodiscard]] _LIBCPP_AVAILABILITY_TE_ENVIRONMENT _LIBCPP_HIDE_FROM_ABI static bool __environment_is() {
539538
return __environment() == _Id;
540539
}
541-
# endif
540+
542541
# endif
543542

544543
const __te_data* __encoding_rep_ = __text_encoding_data + 1;

libcxx/include/text_encoding

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -107,12 +107,12 @@ public:
107107
return text_encoding(__te_impl::__literal());
108108
}
109109
# if _LIBCPP_HAS_LOCALIZATION && !defined(__ANDROID__)
110-
[[nodiscard]] _LIBCPP_HIDE_FROM_ABI static text_encoding environment() {
110+
[[nodiscard]] _LIBCPP_AVAILABILITY_TE_ENVIRONMENT _LIBCPP_HIDE_FROM_ABI static text_encoding environment() {
111111
return text_encoding(__te_impl::__environment());
112112
};
113113

114114
template <id _Id>
115-
[[nodiscard]] _LIBCPP_HIDE_FROM_ABI static bool environment_is() {
115+
[[nodiscard]] _LIBCPP_AVAILABILITY_TE_ENVIRONMENT _LIBCPP_HIDE_FROM_ABI static bool environment_is() {
116116
return __te_impl::__environment_is<_Id>();
117117
}
118118
# else

libcxx/src/text_encoding.cpp

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -249,6 +249,8 @@ _LIBCPP_HIDDEN __te_impl __te_impl::__get_env_encoding() {
249249
#endif // _LIBCPP_WIN32API
250250
}
251251

252-
__te_impl __te_impl::__environment() { return __te_impl::__get_env_encoding(); }
252+
_LIBCPP_AVAILABILITY_TE_ENVIRONMENT _LIBCPP_EXPORTED_FROM_ABI __te_impl __te_impl::__environment() {
253+
return __te_impl::__get_env_encoding();
254+
}
253255

254256
_LIBCPP_END_NAMESPACE_STD

0 commit comments

Comments
 (0)