[libcxx-commits] [PATCH] D91171: [16/N] [libcxx] Implement the permissions function for windows

Louis Dionne via Phabricator via libcxx-commits libcxx-commits at lists.llvm.org
Tue Feb 2 12:35:11 PST 2021


ldionne requested changes to this revision.
ldionne added inline comments.
This revision now requires changes to proceed.


================
Comment at: libcxx/src/filesystem/operations.cpp:460
 ::mode_t posix_convert_perms(perms prms) {
   return static_cast< ::mode_t>(prms & perms::mask);
 }
----------------
I don't understand the purpose of that function. Isn't that equivalent to just `static_cast<::mode_t>(prms)`?

If so, this function is called only once below. Why don't we simply use:

```
#if defined(_LIBCPP_WIN32API)
  using ModeT = int;
#else
  using ModeT = ::mode_t;
#endif

const auto real_perms = static_cast<ModeT>(prms);
```

Well, you get the idea.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D91171/new/

https://reviews.llvm.org/D91171



More information about the libcxx-commits mailing list