aboutsummaryrefslogtreecommitdiff
path: root/src/nvim/os
diff options
context:
space:
mode:
authorb-r-o-c-k <brockmammen@gmail.com>2018-02-28 19:14:27 -0600
committerb-r-o-c-k <brockmammen@gmail.com>2018-02-28 19:37:58 -0600
commit60a341a05f2d2a351a172b36e7f01e579e49ab02 (patch)
treeb811a2c07ffeccde4200bd233c75b0a580ef77eb /src/nvim/os
parent2c414fbbb1a869a4d9d3dd1076d198945ee74a7e (diff)
downloadrneovim-60a341a05f2d2a351a172b36e7f01e579e49ab02.tar.gz
rneovim-60a341a05f2d2a351a172b36e7f01e579e49ab02.tar.bz2
rneovim-60a341a05f2d2a351a172b36e7f01e579e49ab02.zip
build/msvc: Fix standard IO file number definitions
With MSVC, STDOUT_FILENO and STDERR_FILENO are defined as function calls instead of constants, meaning they can't be assigned to enum values. The enum was only used in one file, so it has been removed. A definition for STDIN_FILENO has been added that is consistent with the other two definitions.
Diffstat (limited to 'src/nvim/os')
-rw-r--r--src/nvim/os/os_defs.h7
-rw-r--r--src/nvim/os/win_defs.h3
2 files changed, 3 insertions, 7 deletions
diff --git a/src/nvim/os/os_defs.h b/src/nvim/os/os_defs.h
index 923a362b41..f81785675e 100644
--- a/src/nvim/os/os_defs.h
+++ b/src/nvim/os/os_defs.h
@@ -13,13 +13,6 @@
# 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 48607845cc..faee06304c 100644
--- a/src/nvim/os/win_defs.h
+++ b/src/nvim/os/win_defs.h
@@ -45,6 +45,9 @@
# ifndef restrict
# define restrict __restrict
# endif
+# ifndef STDIN_FILENO
+# define STDIN_FILENO _fileno(stdin)
+# endif
# ifndef STDOUT_FILENO
# define STDOUT_FILENO _fileno(stdout)
# endif