aboutsummaryrefslogtreecommitdiff
path: root/src/nvim/os/win_defs.h
diff options
context:
space:
mode:
authorMichael Reed <m.reed@mykolab.com>2016-01-14 16:05:23 -0500
committerMichael Reed <m.reed@mykolab.com>2016-01-14 23:38:26 -0500
commit07265d221fbd3b4fd16440caab49c70d14370079 (patch)
tree07118b6756dfe5c34204112c228bb72b7f83aa11 /src/nvim/os/win_defs.h
parent24fbb2c866039d61107fa1f6a2efe86bb6951e55 (diff)
downloadrneovim-07265d221fbd3b4fd16440caab49c70d14370079.tar.gz
rneovim-07265d221fbd3b4fd16440caab49c70d14370079.tar.bz2
rneovim-07265d221fbd3b4fd16440caab49c70d14370079.zip
Misc. macro cleanup
- ROOT_UID's comment is misleading, as it's always defined to 0. - SEEK_{SET,END} & O_NOFOLLOW should already be defined on Unix-like systems in <stdio.h> and <fcntl.h>, respectively. In any case, neither of those #ifdef blocks should be in the middle of source files. - The S_IS{LNK,DIR,...} macros should only be undefined on Windows.
Diffstat (limited to 'src/nvim/os/win_defs.h')
-rw-r--r--src/nvim/os/win_defs.h22
1 files changed, 22 insertions, 0 deletions
diff --git a/src/nvim/os/win_defs.h b/src/nvim/os/win_defs.h
index 673fff3ad0..2ce74c9818 100644
--- a/src/nvim/os/win_defs.h
+++ b/src/nvim/os/win_defs.h
@@ -50,4 +50,26 @@ typedef SSIZE_T ssize_t;
# endif
#endif
+#if !defined(S_ISDIR) && defined(S_IFDIR)
+# define S_ISDIR(m) (((m) & S_IFMT) == S_IFDIR)
+#endif
+#if !defined(S_ISREG) && defined(S_IFREG)
+# define S_ISREG(m) (((m) & S_IFMT) == S_IFREG)
+#endif
+#if !defined(S_ISLNK) && defined(S_IFLNK)
+# define S_ISLNK(m) (((m) & S_IFMT) == S_IFLNK)
+#endif
+#if !defined(S_ISBLK) && defined(S_IFBLK)
+# define S_ISBLK(m) (((m) & S_IFMT) == S_IFBLK)
+#endif
+#if !defined(S_ISSOCK) && defined(S_IFSOCK)
+# define S_ISSOCK(m) (((m) & S_IFMT) == S_IFSOCK)
+#endif
+#if !defined(S_ISFIFO) && defined(S_IFIFO)
+# define S_ISFIFO(m) (((m) & S_IFMT) == S_IFIFO)
+#endif
+#if !defined(S_ISCHR) && defined(S_IFCHR)
+# define S_ISCHR(m) (((m) & S_IFMT) == S_IFCHR)
+#endif
+
#endif // NVIM_OS_WIN_DEFS_H