This is an archive of the discontinued LLVM Phabricator instance.

[libcxx] [test] Fix building create_directory in MSVC configurations
ClosedPublic

Authored by mstorsjo on Mar 7 2021, 2:19 AM.

Details

Summary

Don't use the mode_t type - the official windows sdk doesn't have that type.
(Mingw headers does have such a typedef though.) The umask function returns
int on windows, in both header variants.

Thus just use auto to deduce the umask return type automatically.

Diff Detail

Event Timeline

mstorsjo requested review of this revision.Mar 7 2021, 2:19 AM
mstorsjo created this revision.
Herald added a project: Restricted Project. · View Herald TranscriptMar 7 2021, 2:19 AM
Herald added a reviewer: Restricted Project. · View Herald Transcript
Quuxplusone added a subscriber: Quuxplusone.

Accepted iff you add the requested comment.

libcxx/test/std/input.output/filesystems/fs.op.funcs/fs.op.create_directory/create_directory.pass.cpp
35

Please add a comment on this line: // int on Windows, mode_t on POSIX.
Otherwise someone'll just change it back in the future.

curdeius accepted this revision.Mar 7 2021, 9:24 AM
curdeius added a subscriber: curdeius.

LGTM with Arthur's suggestion.

This revision is now accepted and ready to land.Mar 7 2021, 9:24 AM
mstorsjo added inline comments.Mar 7 2021, 1:17 PM
libcxx/test/std/input.output/filesystems/fs.op.funcs/fs.op.create_directory/create_directory.pass.cpp
35

Good point, will do before pushing.