]> git.ipfire.org Git - thirdparty/gcc.git/commit
libstdc++: Simplify std::vprint_unicode for non-Windows targets
authorJonathan Wakely <jwakely@redhat.com>
Fri, 15 Dec 2023 12:24:26 +0000 (12:24 +0000)
committerJonathan Wakely <jwakely@redhat.com>
Fri, 15 Dec 2023 13:20:49 +0000 (13:20 +0000)
commit7d2e100058790e3407ae02b6db4a276957deaa4f
tree2313061f4499c2480e5256d64e4081d1161b960d
parent8a5cac92e7c20e13f01ca0cfa5dc00d014caf0d3
libstdc++: Simplify std::vprint_unicode for non-Windows targets

Since we don't need to do anything special to print Unicode on
non-Windows targets, we might as well just use std::vprint_nonunicode to
implement std::vprint_unicode. Removing the duplicated code should
reduce code size in cases where those calls aren't inlined.

Also use an RAII type for the unused case where a non-Windows target
calls __open_terminal(streambuf*) and needs to fclose the result. This
makes the code futureproof in case we ever start using the
__write_terminal function for non-Windows targets.

libstdc++-v3/ChangeLog:

* include/std/ostream (vprint_unicode) [_WIN32]: Use RAII guard.
(vprint_unicode) [!_WIN32]: Just call vprint_nonunicode.
* include/std/print (vprint_unicode) [!_WIN32]: Likewise.
libstdc++-v3/include/std/ostream
libstdc++-v3/include/std/print