]> gcc.gnu.org Git - gcc.git/commit
libstdc++: Fix filesystem::u8path for mingw targets (PR 95392)
authorJonathan Wakely <jwakely@redhat.com>
Mon, 1 Jun 2020 23:07:05 +0000 (00:07 +0100)
committerGiuliano Belinassi <giuliano.belinassi@usp.br>
Mon, 17 Aug 2020 16:09:33 +0000 (13:09 -0300)
commit44f2dc5539e523e445ffa26c563dedf54c746458
tree3d8c16efecb141d1b681db767d668fa5cdeb350e
parent51b4d6e1d8b9906810c15a58fd0e4ba9b1300247
libstdc++: Fix filesystem::u8path for mingw targets (PR 95392)

When I refactored filesystem::path string conversions in
r11-587-584d52b088f9fcf78704b504c3f1f07e17c1cded I failed to update the
mingw-specific code in filesystem::u8path, causing a bootstrap failure.

This fixes it, and further refactors the mingw-specific code along the
same lines as the previous commit. All conversions from UTF-8 strings to
wide strings now use the same helper function, __wstr_from_utf8.

PR libstdc++/95392
* include/bits/fs_path.h (path::_S_to_string): Move to
namespace-scope and rename to ...
(__detail::__string_from_range): ... this.
[WINDOWS] (__detail::__wstr_from_utf8): New function template to
convert a char sequence containing UTF-8 to wstring.
(path::_S_convert(Iter, Iter)): Adjust call to _S_to_string.
(path::_S_convert_loc(Iter, Iter, const locale&)): Likewise.
(u8path(InputIterator, InputIterator)) [WINDOWS]: Use
__string_from_range to obtain a contiguous range and
__wstr_from_utf8 to obtain a wide string.
(u8path(const Source&)) [WINDOWS]: Use __effective_range to
obtain a contiguous range and __wstr_from_utf8 to obtain a wide
string.
(path::_S_convert(const _EcharT*, const _EcharT)) [WINDOWS]:
Use __wstr_from_utf8.
libstdc++-v3/include/bits/fs_path.h
This page took 0.04938 seconds and 5 git commands to generate.