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