1
2
3
4
5
6
7
8
9
10
11 #ifndef MC_UNIXCOMPAT_H
12 #define MC_UNIXCOMPAT_H
13
14 #include <fcntl.h>
15 #include <signal.h>
16 #include <unistd.h>
17
18 #include <sys/types.h>
19
20 #ifdef MAJOR_IN_MKDEV
21 #include <sys/mkdev.h>
22 #elif defined MAJOR_IN_SYSMACROS
23 #include <sys/sysmacros.h>
24 #endif
25
26 #if defined(HAVE_STRING_H)
27 #include <string.h>
28
29 #elif defined(HAVE_MEMORY_H)
30 #include <memory.h>
31 #else
32 #include <strings.h>
33
34 #endif
35
36 #if defined(__QNX__) && !defined(__QNXNTO__)
37
38 #include <unix.h>
39 #endif
40
41
42
43 #ifndef major
44 #warning major() is undefined. Device numbers will not be shown correctly.
45 #define major(devnum) (((devnum) >> 8) & 0xff)
46 #endif
47
48 #ifndef minor
49 #warning minor() is undefined. Device numbers will not be shown correctly.
50 #define minor(devnum) (((devnum) & 0xff))
51 #endif
52
53 #ifndef makedev
54 #warning makedev() is undefined. Device numbers will not be shown correctly.
55 #define makedev(major,minor) ((((major) & 0xff) << 8) | ((minor) & 0xff))
56 #endif
57
58 #ifndef STDIN_FILENO
59 #define STDIN_FILENO 0
60 #endif
61
62 #ifndef STDOUT_FILENO
63 #define STDOUT_FILENO 1
64 #endif
65
66 #ifndef STDERR_FILENO
67 #define STDERR_FILENO 2
68 #endif
69
70
71 #if !defined O_BINARY && defined _O_BINARY
72
73 #define O_BINARY _O_BINARY
74 #endif
75 #ifdef __BEOS__
76
77 #undef O_BINARY
78 #endif
79
80 #ifndef O_BINARY
81 #define O_BINARY 0
82 #endif
83
84
85 #ifndef O_NONBLOCK
86 #ifdef O_NDELAY
87 #define O_NONBLOCK O_NDELAY
88 #else
89 #define O_NONBLOCK FNDELAY
90 #endif
91 #endif
92
93
94 #ifndef PRIXMAX
95 #define PRIXMAX PRIxMAX
96 #endif
97
98
99 #ifdef ESC_CHAR
100 #undef ESC_CHAR
101 #endif
102
103 #define ESC_CHAR '\033'
104 #define ESC_STR "\033"
105
106
107 #define PATH_SEP '/'
108 #define PATH_SEP_STR "/"
109 #define IS_PATH_SEP(c) ((c) == PATH_SEP)
110 #define PATH_ENV_SEP ':'
111 #define TMPDIR_DEFAULT "/tmp"
112 #define SCRIPT_SUFFIX ""
113 #define get_default_editor() "vi"
114 #define OS_SORT_CASE_SENSITIVE_DEFAULT TRUE
115
116
117
118
119
120
121
122
123
124
125
126 #endif