We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent b554306 commit bcd0559Copy full SHA for bcd0559
flang/runtime/file.cpp
@@ -397,6 +397,15 @@ int OpenFile::PendingResult(const Terminator &terminator, int iostat) {
397
398
bool IsATerminal(int fd) { return ::isatty(fd); }
399
400
+#ifdef WIN32
401
+// Access flags are normally defined in unistd.h, which unavailable under
402
+// Windows. Instead, define the flags as documented at
403
+// https://docs.microsoft.com/en-us/cpp/c-runtime-library/reference/access-waccess
404
+#define F_OK 00
405
+#define W_OK 02
406
+#define R_OK 04
407
+#endif
408
+
409
bool IsExtant(const char *path) { return ::access(path, F_OK) == 0; }
410
bool MayRead(const char *path) { return ::access(path, R_OK) == 0; }
411
bool MayWrite(const char *path) { return ::access(path, W_OK) == 0; }
0 commit comments