diff options
author | zeertzjq <zeertzjq@outlook.com> | 2023-11-29 23:10:21 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-11-29 23:10:21 +0800 |
commit | 86cc791debba09c8ed1aa0d863be844108866a38 (patch) | |
tree | 7231cc3940e88ee6c6f963f641c99d23422ffc90 /src/nvim/os | |
parent | 18c1fd8e9d759da6806747910320dce6bea2ab42 (diff) | |
download | rneovim-86cc791debba09c8ed1aa0d863be844108866a38.tar.gz rneovim-86cc791debba09c8ed1aa0d863be844108866a38.tar.bz2 rneovim-86cc791debba09c8ed1aa0d863be844108866a38.zip |
refactor: move function macros out of vim_defs.h (#26300)
Diffstat (limited to 'src/nvim/os')
-rw-r--r-- | src/nvim/os/fs.c | 1 | ||||
-rw-r--r-- | src/nvim/os/os.h | 10 | ||||
-rw-r--r-- | src/nvim/os/os_defs.h | 10 |
3 files changed, 20 insertions, 1 deletions
diff --git a/src/nvim/os/fs.c b/src/nvim/os/fs.c index 3fc9e0ab69..8f939c3b40 100644 --- a/src/nvim/os/fs.c +++ b/src/nvim/os/fs.c @@ -53,6 +53,7 @@ #ifdef MSWIN # include "nvim/mbyte.h" # include "nvim/option.h" +# include "nvim/strings.h" #endif #ifdef INCLUDE_GENERATED_DECLARATIONS diff --git a/src/nvim/os/os.h b/src/nvim/os/os.h index cbc2be47e0..302d84d066 100644 --- a/src/nvim/os/os.h +++ b/src/nvim/os/os.h @@ -10,6 +10,16 @@ #include "nvim/os/os_defs.h" // IWYU pragma: export #include "nvim/os/stdpaths_defs.h" // IWYU pragma: keep +#define HAVE_PATHDEF + +// Some file names are stored in pathdef.c, which is generated from the +// Makefile to make their value depend on the Makefile. +#ifdef HAVE_PATHDEF +extern char *default_vim_dir; +extern char *default_vimruntime_dir; +extern char *default_lib_dir; +#endif + #ifdef INCLUDE_GENERATED_DECLARATIONS // IWYU pragma: begin_exports # include "os/env.h.generated.h" diff --git a/src/nvim/os/os_defs.h b/src/nvim/os/os_defs.h index 9db559e7a5..12de55a227 100644 --- a/src/nvim/os/os_defs.h +++ b/src/nvim/os/os_defs.h @@ -6,10 +6,12 @@ #include <sys/stat.h> #include <sys/types.h> +#include "auto/config.h" + // Note: Some systems need both string.h and strings.h (Savage). #include <string.h> #ifdef HAVE_STRINGS_H -# include <strings.h> +# include <strings.h> // IWYU pragma: export #endif #ifdef MSWIN @@ -105,3 +107,9 @@ # define S_ISLNK(m) 0 # endif #endif + +// BSD is supposed to cover FreeBSD and similar systems. +#if (defined(BSD) || defined(__FreeBSD_kernel__)) \ + && (defined(S_ISCHR) || defined(S_IFCHR)) +# define OPEN_CHR_FILES +#endif |