Page MenuHomePhabricator

[3/N] [libcxx] Make filesystem::path::value_type wchar_t on windows
Needs ReviewPublic

Authored by mstorsjo on Tue, Nov 10, 1:29 AM.

Details

Reviewers
amccarth
EricWF
Group Reviewers
Restricted Project
Summary

Also set the preferred separator to backslash.

libc++ doesn't compile successfully for windows prior to this change, and this change on its own isn't enough to make it compile successfully either, but is the first stepping stone towards making it work correctly.

Most of operations.cpp will need to be touched, both for calling functions that take wchar paths, but also for using other windows specific functions instead of the posix functions used so far; that is handled in later commits.

Changing parts of operations.cpp to generalize the string type handling in code that doesn't touch system functions.

Diff Detail

Event Timeline

mstorsjo created this revision.Tue, Nov 10, 1:29 AM
Herald added a project: Restricted Project. · View Herald TranscriptTue, Nov 10, 1:29 AM
Herald added 1 blocking reviewer(s): Restricted Project. · View Herald Transcript
amccarth added inline comments.Tue, Dec 1, 1:55 PM
libcxx/src/filesystem/operations.cpp
176–179

Is "/" the preferred representation of the root directory even on Windows?

mstorsjo added inline comments.Tue, Dec 1, 2:01 PM
libcxx/src/filesystem/operations.cpp
176–179

No; this patch just handles the char->wchar transition. This particular case is changed to return backslashes in D91176 as part of making the path parser handle windows specific concepts as "root name".

mstorsjo added inline comments.Tue, Dec 1, 2:04 PM
libcxx/src/filesystem/operations.cpp
176–179

Ok, I see that I generally change the preferred separator to backslashes here, so I guess I could move that bit from that other patch into this one as well if you want it strictly that way - it originated in that patch as it came from trying to make the path parser/iterator return the right things.

mstorsjo updated this revision to Diff 308893.Wed, Dec 2, 12:20 AM

Rebased; moved bit from later patch for making PathParser::operator* return backslashes where relevant into this patch.