From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 2181) id A692238312A4; Tue, 28 Jun 2022 11:59:02 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org A692238312A4 MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset="utf-8" From: Jonathan Wakely To: gcc-cvs@gcc.gnu.org, libstdc++-cvs@gcc.gnu.org Subject: [gcc r13-1325] libstdc++: Fix filesystem build for Windows X-Act-Checkin: gcc X-Git-Author: Jonathan Wakely X-Git-Refname: refs/heads/master X-Git-Oldrev: 133d0d422ebd18dbd215cfa5394aff9f938e7060 X-Git-Newrev: bb1f266a7d602ffee4a070f586351bdfafcb6150 Message-Id: <20220628115902.A692238312A4@sourceware.org> Date: Tue, 28 Jun 2022 11:59:02 +0000 (GMT) X-BeenThere: libstdc++-cvs@gcc.gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Libstdc++-cvs mailing list List-Unsubscribe: , List-Archive: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 28 Jun 2022 11:59:02 -0000 https://gcc.gnu.org/g:bb1f266a7d602ffee4a070f586351bdfafcb6150 commit r13-1325-gbb1f266a7d602ffee4a070f586351bdfafcb6150 Author: Jonathan Wakely Date: Tue Jun 28 12:56:19 2022 +0100 libstdc++: Fix filesystem build for Windows I only half remembered to use char_type instead of char for filesystem paths, so that it works with wchar_t on Windows. This fixes the bootstrap failure. libstdc++-v3/ChangeLog: * src/filesystem/dir-common.h (_Dir_base::_At_path): Use char_type consistently for paths. Diff: --- libstdc++-v3/src/filesystem/dir-common.h | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/libstdc++-v3/src/filesystem/dir-common.h b/libstdc++-v3/src/filesystem/dir-common.h index 4844b1ac453..228fab55afb 100644 --- a/libstdc++-v3/src/filesystem/dir-common.h +++ b/libstdc++-v3/src/filesystem/dir-common.h @@ -99,18 +99,22 @@ struct _Dir_base struct _At_path { // No file descriptor given, so interpret the pathname relative to the CWD. - _At_path(const char* p) noexcept + _At_path(const posix::char_type* p) noexcept : pathname(p), dir_fd(fdcwd()), offset(0) { } - _At_path(int fd, const char* p, size_t offset) noexcept + _At_path(int fd, const posix::char_type* p, size_t offset) noexcept : pathname(p), dir_fd(fd), offset(offset) { } - const char* path() const noexcept { return pathname; } + const posix::char_type* + path() const noexcept { return pathname; } - int dir() const noexcept { return dir_fd; } - const char* path_at_dir() const noexcept { return pathname + offset; } + int + dir() const noexcept { return dir_fd; } + + const posix::char_type* + path_at_dir() const noexcept { return pathname + offset; } private: const posix::char_type* pathname; // Full path relative to CWD.