aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorZyX <kp-pav@yandex.ru>2017-07-04 17:12:00 +0300
committerZyX <kp-pav@yandex.ru>2017-07-04 18:37:01 +0300
commitf0b3029ad33cbba284c4e677a08b0e2488bf062b (patch)
tree73260490cc7704d0a4e222f1793bd1e6f3016fce /src
parent72b3fd96642e7b2c268e17953de3b2ed995eb3b4 (diff)
downloadrneovim-f0b3029ad33cbba284c4e677a08b0e2488bf062b.tar.gz
rneovim-f0b3029ad33cbba284c4e677a08b0e2488bf062b.tar.bz2
rneovim-f0b3029ad33cbba284c4e677a08b0e2488bf062b.zip
os: Add OS_STD*_FILENO constants
Diffstat (limited to 'src')
-rw-r--r--src/nvim/os/os_defs.h7
-rw-r--r--src/nvim/os/win_defs.h10
2 files changed, 17 insertions, 0 deletions
diff --git a/src/nvim/os/os_defs.h b/src/nvim/os/os_defs.h
index f81785675e..923a362b41 100644
--- a/src/nvim/os/os_defs.h
+++ b/src/nvim/os/os_defs.h
@@ -13,6 +13,13 @@
# include "nvim/os/unix_defs.h"
#endif
+/// File descriptor number used for standard IO streams
+enum {
+ OS_STDIN_FILENO = STDIN_FILENO,
+ OS_STDOUT_FILENO = STDOUT_FILENO,
+ OS_STDERR_FILENO = STDERR_FILENO,
+};
+
#define BASENAMELEN (NAME_MAX - 5)
// Use the system path length if it makes sense.
diff --git a/src/nvim/os/win_defs.h b/src/nvim/os/win_defs.h
index 7c980c3768..7ed70f6092 100644
--- a/src/nvim/os/win_defs.h
+++ b/src/nvim/os/win_defs.h
@@ -91,4 +91,14 @@ typedef SSIZE_T ssize_t;
# define S_ISCHR(m) (((m) & S_IFMT) == S_IFCHR)
#endif
+#ifndef STDIN_FILENO
+# define STDIN_FILENO 0
+#endif
+#ifndef STDOUT_FILENO
+# define STDOUT_FILENO 1
+#endif
+#ifndef STDERR_FILENO
+# define STDERR_FILENO 2
+#endif
+
#endif // NVIM_OS_WIN_DEFS_H