Skip to content

Commit a8b3deb

Browse files
authored
[libc++][print] Renames __use_unicode. (#76290)
This is addresses a review comment in #73262.
1 parent 127fc79 commit a8b3deb

File tree

2 files changed

+7
-7
lines changed

2 files changed

+7
-7
lines changed

libcxx/include/ostream

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1137,7 +1137,7 @@ template <class... _Args>
11371137
_LIBCPP_AVAILABILITY_PRINT _LIBCPP_HIDE_FROM_ABI void
11381138
print(ostream& __os, format_string<_Args...> __fmt, _Args&&... __args) {
11391139
# ifndef _LIBCPP_HAS_NO_UNICODE
1140-
if constexpr (__print::__use_unicode)
1140+
if constexpr (__print::__use_unicode_execution_charset)
11411141
std::__vprint_unicode(__os, __fmt.get(), std::make_format_args(__args...), false);
11421142
else
11431143
std::__vprint_nonunicode(__os, __fmt.get(), std::make_format_args(__args...), false);
@@ -1153,7 +1153,7 @@ println(ostream& __os, format_string<_Args...> __fmt, _Args&&... __args) {
11531153
// Note the wording in the Standard is inefficient. The output of
11541154
// std::format is a std::string which is then copied. This solution
11551155
// just appends a newline at the end of the output.
1156-
if constexpr (__print::__use_unicode)
1156+
if constexpr (__print::__use_unicode_execution_charset)
11571157
std::__vprint_unicode(__os, __fmt.get(), std::make_format_args(__args...), true);
11581158
else
11591159
std::__vprint_nonunicode(__os, __fmt.get(), std::make_format_args(__args...), true);

libcxx/include/print

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -192,13 +192,13 @@ namespace __print {
192192
//
193193

194194
# ifdef _LIBCPP_HAS_NO_UNICODE
195-
inline constexpr bool __use_unicode = false;
195+
inline constexpr bool __use_unicode_execution_charset = false;
196196
# elif defined(_MSVC_EXECUTION_CHARACTER_SET)
197197
// This is the same test MSVC STL uses in their implementation of <print>
198198
// See: https://learn.microsoft.com/en-us/windows/win32/intl/code-page-identifiers
199-
inline constexpr bool __use_unicode = _MSVC_EXECUTION_CHARACTER_SET == 65001;
199+
inline constexpr bool __use_unicode_execution_charset = _MSVC_EXECUTION_CHARACTER_SET == 65001;
200200
# else
201-
inline constexpr bool __use_unicode = true;
201+
inline constexpr bool __use_unicode_execution_charset = true;
202202
# endif
203203

204204
_LIBCPP_HIDE_FROM_ABI inline bool __is_terminal(FILE* __stream) {
@@ -333,7 +333,7 @@ __vprint_unicode([[maybe_unused]] FILE* __stream,
333333
template <class... _Args>
334334
_LIBCPP_HIDE_FROM_ABI void print(FILE* __stream, format_string<_Args...> __fmt, _Args&&... __args) {
335335
# ifndef _LIBCPP_HAS_NO_UNICODE
336-
if constexpr (__print::__use_unicode)
336+
if constexpr (__print::__use_unicode_execution_charset)
337337
__print::__vprint_unicode(__stream, __fmt.get(), std::make_format_args(__args...), false);
338338
else
339339
__print::__vprint_nonunicode(__stream, __fmt.get(), std::make_format_args(__args...), false);
@@ -353,7 +353,7 @@ _LIBCPP_HIDE_FROM_ABI void println(FILE* __stream, format_string<_Args...> __fmt
353353
// Note the wording in the Standard is inefficient. The output of
354354
// std::format is a std::string which is then copied. This solution
355355
// just appends a newline at the end of the output.
356-
if constexpr (__print::__use_unicode)
356+
if constexpr (__print::__use_unicode_execution_charset)
357357
__print::__vprint_unicode(__stream, __fmt.get(), std::make_format_args(__args...), true);
358358
else
359359
__print::__vprint_nonunicode(__stream, __fmt.get(), std::make_format_args(__args...), true);

0 commit comments

Comments
 (0)