[flang-commits] [PATCH] D88508: [flang][msvc] Define access flags under Windows. NFC.

Michael Kruse via Phabricator via flang-commits flang-commits at lists.llvm.org
Tue Sep 29 15:01:46 PDT 2020


This revision was automatically updated to reflect the committed changes.
Closed by commit rGbcd05599d0e5: [flang][msvc] Define access flags under Windows. NFC. (authored by Meinersbur).

Changed prior to commit:
  https://reviews.llvm.org/D88508?vs=295068&id=295129#toc

Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D88508

Files:
  flang/runtime/file.cpp


Index: flang/runtime/file.cpp
===================================================================
--- flang/runtime/file.cpp
+++ flang/runtime/file.cpp
@@ -397,6 +397,15 @@
 
 bool IsATerminal(int fd) { return ::isatty(fd); }
 
+#ifdef WIN32
+// Access flags are normally defined in unistd.h, which unavailable under
+// Windows. Instead, define the flags as documented at
+// https://docs.microsoft.com/en-us/cpp/c-runtime-library/reference/access-waccess
+#define F_OK 00
+#define W_OK 02
+#define R_OK 04
+#endif
+
 bool IsExtant(const char *path) { return ::access(path, F_OK) == 0; }
 bool MayRead(const char *path) { return ::access(path, R_OK) == 0; }
 bool MayWrite(const char *path) { return ::access(path, W_OK) == 0; }


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D88508.295129.patch
Type: text/x-patch
Size: 730 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/flang-commits/attachments/20200929/99d8dc06/attachment.bin>


More information about the flang-commits mailing list