MSVC: implement `S_ISREG`, `S_ISDIR`, `S_IRUSR`, `S_IWUSR`
diff --git a/compat/posix-shims/unistd.h b/compat/posix-shims/unistd.h
index 17e4024..da46096 100644
--- a/compat/posix-shims/unistd.h
+++ b/compat/posix-shims/unistd.h
@@ -60,4 +60,17 @@
#define _POSIX_PATH_MAX 256
#endif
+#ifndef S_ISREG
+# define S_ISREG(m) (((m) & _S_IFMT) == _S_IFREG)
+#endif
+#ifndef S_ISDIR
+# define S_ISDIR(m) (((m) & _S_IFMT) == _S_IFDIR)
+#endif
+#ifndef S_IRUSR
+# define S_IRUSR _S_IREAD
+#endif
+#ifndef S_IWUSR
+# define S_IWUSR _S_IWRITE
+#endif
+
#endif /* unistd.h */