diff options
-rw-r--r-- | config/CMakeLists.txt | 2 | ||||
-rw-r--r-- | config/config.h.in | 1 | ||||
-rw-r--r-- | src/nvim/os/os_defs.h | 23 | ||||
-rw-r--r-- | src/nvim/os/unix_defs.h | 9 | ||||
-rw-r--r-- | src/nvim/os/win_defs.h | 2 |
5 files changed, 7 insertions, 30 deletions
diff --git a/config/CMakeLists.txt b/config/CMakeLists.txt index c64e7e1ddb..28b1e43ef7 100644 --- a/config/CMakeLists.txt +++ b/config/CMakeLists.txt @@ -16,7 +16,6 @@ check_type_size("void *" SIZEOF_VOID_PTR) check_symbol_exists(_NSGetEnviron crt_externs.h HAVE__NSGETENVIRON) # Headers -check_include_files(dirent.h HAVE_DIRENT_H) check_include_files(fcntl.h HAVE_FCNTL_H) check_include_files(iconv.h HAVE_ICONV_H) check_include_files(langinfo.h HAVE_LANGINFO_H) @@ -25,7 +24,6 @@ check_include_files(locale.h HAVE_LOCALE_H) check_include_files(pwd.h HAVE_PWD_H) check_include_files(strings.h HAVE_STRINGS_H) check_include_files(stropts.h HAVE_STROPTS_H) -check_include_files(sys/param.h HAVE_SYS_PARAM_H) check_include_files(sys/wait.h HAVE_SYS_WAIT_H) if(NOT HAVE_SYS_WAIT_H AND UNIX) # See if_cscope.c diff --git a/config/config.h.in b/config/config.h.in index b442a732e5..7975b89103 100644 --- a/config/config.h.in +++ b/config/config.h.in @@ -42,7 +42,6 @@ #cmakedefine HAVE_STRINGS_H #cmakedefine HAVE_STRNCASECMP #cmakedefine HAVE_STROPTS_H -#cmakedefine HAVE_SYS_PARAM_H #cmakedefine HAVE_SYS_UTSNAME_H #cmakedefine HAVE_SYS_WAIT_H #cmakedefine HAVE_UNISTD_H diff --git a/src/nvim/os/os_defs.h b/src/nvim/os/os_defs.h index 17196ee812..8afbd29292 100644 --- a/src/nvim/os/os_defs.h +++ b/src/nvim/os/os_defs.h @@ -13,28 +13,7 @@ # include "nvim/os/unix_defs.h" #endif -#if defined(DIRSIZ) && !defined(MAXNAMLEN) -# define MAXNAMLEN DIRSIZ -#endif - -#if defined(UFS_MAXNAMLEN) && !defined(MAXNAMLEN) -# define MAXNAMLEN UFS_MAXNAMLEN /* for dynix/ptx */ -#endif - -#if defined(NAME_MAX) && !defined(MAXNAMLEN) -# define MAXNAMLEN NAME_MAX /* for Linux before .99p3 */ -#endif - -#if defined(_MAX_PATH) && !defined(MAXNAMLEN) -# define MAXNAMLEN _MAX_PATH /* for Windows */ -#endif - -// Default value. -#ifndef MAXNAMLEN -# define MAXNAMLEN 512 -#endif - -#define BASENAMELEN (MAXNAMLEN - 5) +#define BASENAMELEN (NAME_MAX - 5) // Use the system path length if it makes sense. #if defined(PATH_MAX) && (PATH_MAX > 1000) diff --git a/src/nvim/os/unix_defs.h b/src/nvim/os/unix_defs.h index 4af468f8d9..78fc9331d1 100644 --- a/src/nvim/os/unix_defs.h +++ b/src/nvim/os/unix_defs.h @@ -1,13 +1,12 @@ #ifndef NVIM_OS_UNIX_DEFS_H #define NVIM_OS_UNIX_DEFS_H +// Windows doesn't have unistd.h, so we include it here to avoid numerous +// instances of `#ifdef HAVE_UNISTD_H'. #include <unistd.h> -#include <signal.h> -// Defines BSD, if it's a BSD system. -#ifdef HAVE_SYS_PARAM_H -# include <sys/param.h> -#endif +// POSIX.1-2008 says that NAME_MAX should be in here +#include <limits.h> #define TEMP_DIR_NAMES {"$TMPDIR", "/tmp", ".", "~"} #define TEMP_FILE_PATH_MAXLEN 256 diff --git a/src/nvim/os/win_defs.h b/src/nvim/os/win_defs.h index 698f41b3ca..e6a714601f 100644 --- a/src/nvim/os/win_defs.h +++ b/src/nvim/os/win_defs.h @@ -5,6 +5,8 @@ #include <sys/stat.h> #include <stdio.h> +#define NAME_MAX _MAX_PATH + #define TEMP_DIR_NAMES {"$TMP", "$TEMP", "$USERPROFILE", ""} #define TEMP_FILE_PATH_MAXLEN _MAX_PATH |