[libcxx-commits] [libcxx] 52c5f5a - [libcxx] [test] Fix building create_directory in MSVC configurations

Martin Storsjö via libcxx-commits libcxx-commits at lists.llvm.org
Sun Mar 7 13:31:54 PST 2021


Author: Martin Storsjö
Date: 2021-03-07T23:26:41+02:00
New Revision: 52c5f5ad5f203d4659f0613a6133f85688ff8266

URL: https://github.com/llvm/llvm-project/commit/52c5f5ad5f203d4659f0613a6133f85688ff8266
DIFF: https://github.com/llvm/llvm-project/commit/52c5f5ad5f203d4659f0613a6133f85688ff8266.diff

LOG: [libcxx] [test] Fix building create_directory in MSVC configurations

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.

Differential Revision: https://reviews.llvm.org/D98140

Added: 
    

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

Removed: 
    


################################################################################
diff  --git a/libcxx/test/std/input.output/filesystems/fs.op.funcs/fs.op.create_directory/create_directory.pass.cpp b/libcxx/test/std/input.output/filesystems/fs.op.funcs/fs.op.create_directory/create_directory.pass.cpp
index 30dea6140588..7554afa0f865 100644
--- a/libcxx/test/std/input.output/filesystems/fs.op.funcs/fs.op.create_directory/create_directory.pass.cpp
+++ b/libcxx/test/std/input.output/filesystems/fs.op.funcs/fs.op.create_directory/create_directory.pass.cpp
@@ -32,7 +32,7 @@
 using namespace fs;
 
 fs::perms read_umask() {
-    mode_t old_mask = umask(0);
+    auto old_mask = umask(0); // int on Windows, mode_t on POSIX.
     umask(old_mask); // reset the mask to the old value.
     return static_cast<fs::perms>(old_mask);
 }


        


More information about the libcxx-commits mailing list