Skip to content

Commit 5c89a70

Browse files
committed
[libc++][print] Renames __use_unicode.
This is addresses a review comment in llvm#73262.
1 parent 5841140 commit 5c89a70

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
@@ -188,13 +188,13 @@ namespace __print {
188188
//
189189

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

200200
_LIBCPP_HIDE_FROM_ABI inline bool __is_terminal(FILE* __stream) {
@@ -329,7 +329,7 @@ __vprint_unicode([[maybe_unused]] FILE* __stream,
329329
template <class... _Args>
330330
_LIBCPP_HIDE_FROM_ABI void print(FILE* __stream, format_string<_Args...> __fmt, _Args&&... __args) {
331331
# ifndef _LIBCPP_HAS_NO_UNICODE
332-
if constexpr (__print::__use_unicode)
332+
if constexpr (__print::__use_unicode_execution_charset)
333333
__print::__vprint_unicode(__stream, __fmt.get(), std::make_format_args(__args...), false);
334334
else
335335
__print::__vprint_nonunicode(__stream, __fmt.get(), std::make_format_args(__args...), false);
@@ -349,7 +349,7 @@ _LIBCPP_HIDE_FROM_ABI void println(FILE* __stream, format_string<_Args...> __fmt
349349
// Note the wording in the Standard is inefficient. The output of
350350
// std::format is a std::string which is then copied. This solution
351351
// just appends a newline at the end of the output.
352-
if constexpr (__print::__use_unicode)
352+
if constexpr (__print::__use_unicode_execution_charset)
353353
__print::__vprint_unicode(__stream, __fmt.get(), std::make_format_args(__args...), true);
354354
else
355355
__print::__vprint_nonunicode(__stream, __fmt.get(), std::make_format_args(__args...), true);

0 commit comments

Comments
 (0)