os_defs.h
Go to the documentation of this file.
1 #ifndef NVIM_OS_OS_DEFS_H
2 #define NVIM_OS_OS_DEFS_H
3 
4 #include <ctype.h>
5 #include <stdio.h>
6 #include <stdlib.h>
7 #include <sys/stat.h>
8 #include <sys/types.h>
9 
10 #ifdef WIN32
11 # include "nvim/os/win_defs.h"
12 #else
13 # include "nvim/os/unix_defs.h"
14 #endif
15 
16 #define BASENAMELEN (NAME_MAX - 5)
17 
18 // Use the system path length if it makes sense.
19 #if defined(PATH_MAX) && (PATH_MAX > 1024)
20 # define MAXPATHL PATH_MAX
21 #else
22 # define MAXPATHL 1024
23 #endif
24 
25 // Command-processing buffer. Use large buffers for all platforms.
26 #define CMDBUFFSIZE 1024
27 
28 // Note: Some systems need both string.h and strings.h (Savage). However,
29 // some systems can't handle both, only use string.h in that case.
30 #include <string.h>
31 #if defined(HAVE_STRINGS_H) && !defined(NO_STRINGS_WITH_STRING_H)
32 # include <strings.h>
33 #endif
34 
38 #define os_strerror uv_strerror
39 
40 #ifdef WIN32
41 # define os_strtok strtok_s
42 #else
43 # define os_strtok strtok_r
44 #endif
45 
46 #endif // NVIM_OS_OS_DEFS_H