comparison src/os_mac.h @ 12716:351cf7c67bbe v8.0.1236

patch 8.0.1236: Mac features are confusing commit https://github.com/vim/vim/commit/d057301b1f28736f094affa17b190244ad56e8d9 Author: Bram Moolenaar <Bram@vim.org> Date: Sat Oct 28 21:11:06 2017 +0200 patch 8.0.1236: Mac features are confusing Problem: Mac features are confusing. Solution: Make feature names more consistent, add "osxdarwin". Rename feature flags, cleanup Mac code. (Kazunobu Kuriyama, closes #2178)
author Christian Brabandt <cb@256bit.org>
date Sat, 28 Oct 2017 21:15:35 +0200
parents 4aead6a9b7a9
children 65c29bd4548b
comparison
equal deleted inserted replaced
12715:279ec0abb4ac 12716:351cf7c67bbe
75 /* TODO: Should file such as ~/.vimrc reside instead in 75 /* TODO: Should file such as ~/.vimrc reside instead in
76 * ~/Library/Vim or ~/Library/Preferences/org.vim.vim/ ? (Dany) 76 * ~/Library/Vim or ~/Library/Preferences/org.vim.vim/ ? (Dany)
77 */ 77 */
78 /* When compiled under MacOS X (including CARBON version) 78 /* When compiled under MacOS X (including CARBON version)
79 * we use the Unix File path style. Also when UNIX is defined. */ 79 * we use the Unix File path style. Also when UNIX is defined. */
80 # define USE_UNIXFILENAME 80 #define USE_UNIXFILENAME
81 81
82 82
83 /* 83 /*
84 * Generic Vim #define 84 * Generic Vim #define
85 */ 85 */
92 #define SPACE_IN_FILENAME 92 #define SPACE_IN_FILENAME
93 #define BREAKCHECK_SKIP 32 /* call mch_breakcheck() each time, it's 93 #define BREAKCHECK_SKIP 32 /* call mch_breakcheck() each time, it's
94 quite fast. Did I forgot to update the 94 quite fast. Did I forgot to update the
95 comment */ 95 comment */
96 96
97
98 #define USE_FNAME_CASE /* make ":e os_Mac.c" open the file in its 97 #define USE_FNAME_CASE /* make ":e os_Mac.c" open the file in its
99 original case, as "os_mac.c" */ 98 original case, as "os_mac.c" */
100 #define BINARY_FILE_IO 99 #define BINARY_FILE_IO
101 #define EOL_DEFAULT EOL_MAC 100 #define EOL_DEFAULT EOL_MAC
102 #ifndef MACOS_X_UNIX /* I hope that switching these two lines */
103 # define USE_CR /* does what I want -- BNF */
104 # define NO_CONSOLE /* don't include console mode */
105 #endif
106 #define HAVE_AVAIL_MEM 101 #define HAVE_AVAIL_MEM
107 102
108 #ifndef HAVE_CONFIG_H 103 #ifndef HAVE_CONFIG_H
109 /* #define SYNC_DUP_CLOSE sync() a file with dup() and close() */ 104 /* #define SYNC_DUP_CLOSE sync() a file with dup() and close() */
110 # define HAVE_STRING_H 105 # define HAVE_STRING_H
126 * Names for the EXRC, HELP and temporary files. 121 * Names for the EXRC, HELP and temporary files.
127 * Some of these may have been defined in the makefile. 122 * Some of these may have been defined in the makefile.
128 */ 123 */
129 124
130 #ifndef SYS_VIMRC_FILE 125 #ifndef SYS_VIMRC_FILE
131 # define SYS_VIMRC_FILE "$VIM/vimrc" 126 # define SYS_VIMRC_FILE "$VIM/vimrc"
132 #endif 127 #endif
133 #ifndef SYS_GVIMRC_FILE 128 #ifndef SYS_GVIMRC_FILE
134 # define SYS_GVIMRC_FILE "$VIM/gvimrc" 129 # define SYS_GVIMRC_FILE "$VIM/gvimrc"
135 #endif 130 #endif
136 #ifndef SYS_MENU_FILE 131 #ifndef SYS_MENU_FILE
137 # define SYS_MENU_FILE "$VIMRUNTIME/menu.vim" 132 # define SYS_MENU_FILE "$VIMRUNTIME/menu.vim"
138 #endif 133 #endif
139 #ifndef SYS_OPTWIN_FILE 134 #ifndef SYS_OPTWIN_FILE
140 # define SYS_OPTWIN_FILE "$VIMRUNTIME/optwin.vim" 135 # define SYS_OPTWIN_FILE "$VIMRUNTIME/optwin.vim"
141 #endif 136 #endif
142 #ifndef VIM_DEFAULTS_FILE 137 #ifndef VIM_DEFAULTS_FILE
143 # define VIM_DEFAULTS_FILE "$VIMRUNTIME/defaults.vim" 138 # define VIM_DEFAULTS_FILE "$VIMRUNTIME/defaults.vim"
144 #endif 139 #endif
145 #ifndef EVIM_FILE 140 #ifndef EVIM_FILE
146 # define EVIM_FILE "$VIMRUNTIME/evim.vim" 141 # define EVIM_FILE "$VIMRUNTIME/evim.vim"
147 #endif 142 #endif
148 143
149 #ifdef FEAT_GUI 144 #ifdef FEAT_GUI
150 # ifndef USR_GVIMRC_FILE 145 # ifndef USR_GVIMRC_FILE
151 # define USR_GVIMRC_FILE "~/.gvimrc" 146 # define USR_GVIMRC_FILE "~/.gvimrc"
152 # endif 147 # endif
153 # ifndef GVIMRC_FILE 148 # ifndef GVIMRC_FILE
154 # define GVIMRC_FILE "_gvimrc" 149 # define GVIMRC_FILE "_gvimrc"
155 # endif 150 # endif
156 #endif 151 #endif
157 #ifndef USR_VIMRC_FILE 152 #ifndef USR_VIMRC_FILE
158 # define USR_VIMRC_FILE "~/.vimrc" 153 # define USR_VIMRC_FILE "~/.vimrc"
159 #endif 154 #endif
160 155
161 #ifndef USR_EXRC_FILE 156 #ifndef USR_EXRC_FILE
162 # define USR_EXRC_FILE "~/.exrc" 157 # define USR_EXRC_FILE "~/.exrc"
163 #endif 158 #endif
164 159
165 #ifndef VIMRC_FILE 160 #ifndef VIMRC_FILE
166 # define VIMRC_FILE "_vimrc" 161 # define VIMRC_FILE "_vimrc"
167 #endif 162 #endif
169 #ifndef EXRC_FILE 164 #ifndef EXRC_FILE
170 # define EXRC_FILE "_exrc" 165 # define EXRC_FILE "_exrc"
171 #endif 166 #endif
172 167
173 #ifndef DFLT_HELPFILE 168 #ifndef DFLT_HELPFILE
174 # define DFLT_HELPFILE "$VIMRUNTIME/doc/help.txt" 169 # define DFLT_HELPFILE "$VIMRUNTIME/doc/help.txt"
175 #endif 170 #endif
176 171
177 #ifndef FILETYPE_FILE 172 #ifndef FILETYPE_FILE
178 # define FILETYPE_FILE "filetype.vim" 173 # define FILETYPE_FILE "filetype.vim"
179 #endif 174 #endif
192 #ifndef INDOFF_FILE 187 #ifndef INDOFF_FILE
193 # define INDOFF_FILE "indoff.vim" 188 # define INDOFF_FILE "indoff.vim"
194 #endif 189 #endif
195 190
196 #ifndef SYNTAX_FNAME 191 #ifndef SYNTAX_FNAME
197 # define SYNTAX_FNAME "$VIMRUNTIME/syntax/%s.vim" 192 # define SYNTAX_FNAME "$VIMRUNTIME/syntax/%s.vim"
198 #endif 193 #endif
199 194
200 #ifdef FEAT_VIMINFO 195 #ifdef FEAT_VIMINFO
201 # ifndef VIMINFO_FILE 196 # ifndef VIMINFO_FILE
202 # define VIMINFO_FILE "~/.viminfo" 197 # define VIMINFO_FILE "~/.viminfo"
203 # endif 198 # endif
204 #endif /* FEAT_VIMINFO */ 199 #endif /* FEAT_VIMINFO */
205 200
206 #ifndef DFLT_BDIR 201 #ifndef DFLT_BDIR
207 # define DFLT_BDIR "." /* default for 'backupdir' */ 202 # define DFLT_BDIR "." /* default for 'backupdir' */
216 #endif 211 #endif
217 212
218 #define DFLT_ERRORFILE "errors.err" 213 #define DFLT_ERRORFILE "errors.err"
219 214
220 #ifndef DFLT_RUNTIMEPATH 215 #ifndef DFLT_RUNTIMEPATH
221 # define DFLT_RUNTIMEPATH "~/.vim,$VIM/vimfiles,$VIMRUNTIME,$VIM/vimfiles/after,~/.vim/after" 216 # define DFLT_RUNTIMEPATH "~/.vim,$VIM/vimfiles,$VIMRUNTIME,$VIM/vimfiles/after,~/.vim/after"
222 #endif 217 #endif
223 218
224 /* 219 /*
225 * Macintosh has plenty of memory, use large buffers 220 * Macintosh has plenty of memory, use large buffers
226 */ 221 */
227 #define CMDBUFFSIZE 1024 /* size of the command processing buffer */ 222 #define CMDBUFFSIZE 1024 /* size of the command processing buffer */
228
229 #if !defined(MACOS_X_UNIX)
230 # define MAXPATHL 256 /* Limited by the Pascal Strings */
231 # define BASENAMELEN (32-5-1) /* length of base of filename */
232 #endif
233 223
234 #ifndef DFLT_MAXMEM 224 #ifndef DFLT_MAXMEM
235 # define DFLT_MAXMEM 512 /* use up to 512 Kbyte for buffer */ 225 # define DFLT_MAXMEM 512 /* use up to 512 Kbyte for buffer */
236 #endif 226 #endif
237 227
243 233
244 /**************/ 234 /**************/
245 #define mch_rename(src, dst) rename(src, dst) 235 #define mch_rename(src, dst) rename(src, dst)
246 #define mch_remove(x) unlink((char *)(x)) 236 #define mch_remove(x) unlink((char *)(x))
247 #ifndef mch_getenv 237 #ifndef mch_getenv
248 # if defined(__MRC__) || defined(__SC__) 238 # if defined(__APPLE_CC__)
249 # define mch_getenv(name) ((char_u *)getenv((char *)(name))) 239 # define mch_getenv(name) ((char_u *)getenv((char *)(name)))
250 # define mch_setenv(name, val, x) setenv((name), (val))
251 # elif defined(__APPLE_CC__)
252 # define mch_getenv(name) ((char_u *)getenv((char *)(name)))
253 /*# define mch_setenv(name, val, x) setenv((name), (val)) */ /* Obsoleted by Dany on Oct 30, 2001 */
254 # define mch_setenv(name, val, x) setenv(name, val, x) 240 # define mch_setenv(name, val, x) setenv(name, val, x)
255 # else 241 # else
256 /* vim_getenv() is in pty.c */ 242 /* vim_getenv() is in pty.c */
257 # define USE_VIMPTY_GETENV 243 # define USE_VIMPTY_GETENV
258 # define mch_getenv(x) vimpty_getenv(x) 244 # define mch_getenv(x) vimpty_getenv(x)
273 /* Some "prep work" definition to be able to compile the MacOS X 259 /* Some "prep work" definition to be able to compile the MacOS X
274 * version with os_unix.c instead of os_mac.c. Based on the result 260 * version with os_unix.c instead of os_mac.c. Based on the result
275 * of ./configure for console MacOS X. 261 * of ./configure for console MacOS X.
276 */ 262 */
277 263
278 #ifdef MACOS_X_UNIX 264 #ifndef SIGPROTOARG
279 # ifndef SIGPROTOARG 265 # define SIGPROTOARG (int)
280 # define SIGPROTOARG (int) 266 #endif
281 # endif 267 #ifndef SIGDEFARG
282 # ifndef SIGDEFARG 268 # define SIGDEFARG(s) (s) int s UNUSED;
283 # define SIGDEFARG(s) (s) int s UNUSED; 269 #endif
284 # endif 270 #ifndef SIGDUMMYARG
285 # ifndef SIGDUMMYARG 271 # define SIGDUMMYARG 0
286 # define SIGDUMMYARG 0 272 #endif
287 # endif 273 #undef HAVE_AVAIL_MEM
288 # undef HAVE_AVAIL_MEM 274 #ifndef HAVE_CONFIG_H
289 # ifndef HAVE_CONFIG_H 275 # define RETSIGTYPE void
290 # define RETSIGTYPE void 276 # define SIGRETURN return
291 # define SIGRETURN return
292 /*# define USE_SYSTEM */ /* Output ship do debugger :(, but ot compile */ 277 /*# define USE_SYSTEM */ /* Output ship do debugger :(, but ot compile */
293 # define HAVE_SYS_WAIT_H 1 /* Attempt */ 278 # define HAVE_SYS_WAIT_H 1 /* Attempt */
294 # define HAVE_TERMIOS_H 1 279 # define HAVE_TERMIOS_H 1
295 # define SYS_SELECT_WITH_SYS_TIME 1 280 # define SYS_SELECT_WITH_SYS_TIME 1
296 # define HAVE_SELECT 1 281 # define HAVE_SELECT 1
297 # define HAVE_SYS_SELECT_H 1 282 # define HAVE_SYS_SELECT_H 1
298 # define HAVE_PUTENV 283 # define HAVE_PUTENV
299 # define HAVE_SETENV 284 # define HAVE_SETENV
300 # define HAVE_RENAME 285 # define HAVE_RENAME
301 # endif 286 #endif
302 #endif 287
303 288 #if !defined(HAVE_CONFIG_H)
304 #if defined(MACOS_X) && !defined(HAVE_CONFIG_H)
305 # define HAVE_PUTENV 289 # define HAVE_PUTENV
306 #endif 290 #endif
307 291
308 /* A Mac constant causing big problem to syntax highlighting */ 292 /* A Mac constant causing big problem to syntax highlighting */
309 #define UNKNOWN_CREATOR '\?\?\?\?' 293 #define UNKNOWN_CREATOR '\?\?\?\?'