Mercurial > vim
comparison src/os_mac.h @ 718:7b21554be7a1
updated for version 7.0219
author | vimboss |
---|---|
date | Thu, 09 Mar 2006 22:27:48 +0000 |
parents | 51794dc170f7 |
children | c2cae213194d |
comparison
equal
deleted
inserted
replaced
717:2fa8cb05b861 | 718:7b21554be7a1 |
---|---|
38 #endif | 38 #endif |
39 | 39 |
40 /* | 40 /* |
41 * Unix interface | 41 * Unix interface |
42 */ | 42 */ |
43 #if defined(__MWERKS__) /* for CodeWarrior */ | |
44 # include <unistd.h> | |
45 # include <utsname.h> | |
46 # include <unix.h> | |
47 #endif | |
48 #if defined(__APPLE_CC__) /* for Project Builder and ... */ | 43 #if defined(__APPLE_CC__) /* for Project Builder and ... */ |
49 # include <unistd.h> | 44 # include <unistd.h> |
50 #endif | |
51 /* Get stat.h or something similar. Comment: How come some OS get in in vim.h */ | 45 /* Get stat.h or something similar. Comment: How come some OS get in in vim.h */ |
52 #if defined(__MWERKS__) | |
53 # include <stat.h> | |
54 #endif | |
55 #if defined(__APPLE_CC__) | |
56 # include <sys/stat.h> | 46 # include <sys/stat.h> |
57 #endif | 47 /* && defined(HAVE_CURSE) */ |
58 #if defined(__MRC__) || defined(__SC__) /* for Apple MPW Compilers */ | |
59 /* There's no stat.h for MPW? */ | |
60 # ifdef powerc | |
61 # pragma options align=power | |
62 # endif | |
63 struct stat | |
64 { | |
65 UInt32 st_mtime; | |
66 UInt32 st_mode; | |
67 UInt32 st_size; | |
68 }; | |
69 # ifdef powerc | |
70 # pragma options align=reset | |
71 # endif | |
72 #endif | |
73 #if defined(__APPLE_CC__) /* && defined(HAVE_CURSE) */ | |
74 /* The curses.h from MacOS X provides by default some BACKWARD compatibilty | 48 /* The curses.h from MacOS X provides by default some BACKWARD compatibilty |
75 * definition which can cause us problem later on. So we undefine a few of them. */ | 49 * definition which can cause us problem later on. So we undefine a few of them. */ |
76 # include <curses.h> | 50 # include <curses.h> |
77 # undef reg | 51 # undef reg |
78 # undef ospeed | 52 # undef ospeed |
82 #include <signal.h> | 56 #include <signal.h> |
83 #include <errno.h> | 57 #include <errno.h> |
84 #include <stdio.h> | 58 #include <stdio.h> |
85 #include <stdlib.h> | 59 #include <stdlib.h> |
86 #include <time.h> | 60 #include <time.h> |
87 #ifdef MACOS_X | 61 #include <dirent.h> |
88 # include <dirent.h> | |
89 #endif | |
90 | |
91 /* | |
92 * Incompatibility checks | |
93 */ | |
94 | |
95 /* Got problem trying to use shared library in 68k */ | |
96 #if !defined(__POWERPC__) && !defined(__i386__) && defined(FEAT_PYTHON) | |
97 # undef FEAT_PYTHON | |
98 # warning Auto-disabling Python. Not yet supported in 68k. | |
99 #endif | |
100 | |
101 #if !defined(__POWERPC__) && !defined(__ppc__) && !defined(__i386__) | |
102 # if !__option(enumsalwaysint) | |
103 # error "You must compile with enums always int!" | |
104 # endif | |
105 # if defined(__MWERKS__) && !defined(__fourbyteints__) | |
106 # error "You must compile the project with 4-byte ints" | |
107 /* MPW ints are always 4 byte long */ | |
108 # endif | |
109 #endif | |
110 | 62 |
111 /* | 63 /* |
112 * MacOS specific #define | 64 * MacOS specific #define |
113 */ | 65 */ |
114 | 66 |
118 /* TODO: Should file such as ~/.vimrc reside instead in | 70 /* TODO: Should file such as ~/.vimrc reside instead in |
119 * ~/Library/Vim or ~/Library/Preferences/org.vim.vim/ ? (Dany) | 71 * ~/Library/Vim or ~/Library/Preferences/org.vim.vim/ ? (Dany) |
120 */ | 72 */ |
121 /* When compiled under MacOS X (including CARBON version) | 73 /* When compiled under MacOS X (including CARBON version) |
122 * we use the Unix File path style. Also when UNIX is defined. */ | 74 * we use the Unix File path style. Also when UNIX is defined. */ |
123 #if defined(UNIX) || (defined(TARGET_API_MAC_OSX) && TARGET_API_MAC_OSX) | |
124 # undef COLON_AS_PATHSEP | |
125 # define USE_UNIXFILENAME | 75 # define USE_UNIXFILENAME |
126 #else | |
127 # define COLON_AS_PATHSEP | |
128 # define DONT_ADD_PATHSEP_TO_DIR | |
129 #endif | |
130 | 76 |
131 | 77 |
132 /* | 78 /* |
133 * Generic Vim #define | 79 * Generic Vim #define |
134 */ | 80 */ |
174 * Names for the EXRC, HELP and temporary files. | 120 * Names for the EXRC, HELP and temporary files. |
175 * Some of these may have been defined in the makefile. | 121 * Some of these may have been defined in the makefile. |
176 */ | 122 */ |
177 | 123 |
178 #ifndef SYS_VIMRC_FILE | 124 #ifndef SYS_VIMRC_FILE |
179 # ifdef COLON_AS_PATHSEP | |
180 # define SYS_VIMRC_FILE "$VIM:vimrc" | |
181 # else | |
182 # define SYS_VIMRC_FILE "$VIM/vimrc" | 125 # define SYS_VIMRC_FILE "$VIM/vimrc" |
183 # endif | |
184 #endif | 126 #endif |
185 #ifndef SYS_GVIMRC_FILE | 127 #ifndef SYS_GVIMRC_FILE |
186 # ifdef COLON_AS_PATHSEP | |
187 # define SYS_GVIMRC_FILE "$VIM:gvimrc" | |
188 # else | |
189 # define SYS_GVIMRC_FILE "$VIM/gvimrc" | 128 # define SYS_GVIMRC_FILE "$VIM/gvimrc" |
190 # endif | |
191 #endif | 129 #endif |
192 #ifndef SYS_MENU_FILE | 130 #ifndef SYS_MENU_FILE |
193 # ifdef COLON_AS_PATHSEP | |
194 # define SYS_MENU_FILE "$VIMRUNTIME:menu.vim" | |
195 # else | |
196 # define SYS_MENU_FILE "$VIMRUNTIME/menu.vim" | 131 # define SYS_MENU_FILE "$VIMRUNTIME/menu.vim" |
197 # endif | |
198 #endif | 132 #endif |
199 #ifndef SYS_OPTWIN_FILE | 133 #ifndef SYS_OPTWIN_FILE |
200 # ifdef COLON_AS_PATHSEP | |
201 # define SYS_OPTWIN_FILE "$VIMRUNTIME:optwin.vim" | |
202 # else | |
203 # define SYS_OPTWIN_FILE "$VIMRUNTIME/optwin.vim" | 134 # define SYS_OPTWIN_FILE "$VIMRUNTIME/optwin.vim" |
204 # endif | |
205 #endif | 135 #endif |
206 #ifndef EVIM_FILE | 136 #ifndef EVIM_FILE |
207 # ifdef COLON_AS_PATHSEP | |
208 # define EVIM_FILE "$VIMRUNTIME:evim.vim" | |
209 # else | |
210 # define EVIM_FILE "$VIMRUNTIME/evim.vim" | 137 # define EVIM_FILE "$VIMRUNTIME/evim.vim" |
211 # endif | |
212 #endif | 138 #endif |
213 | 139 |
214 #ifdef FEAT_GUI | 140 #ifdef FEAT_GUI |
215 # ifndef USR_GVIMRC_FILE | 141 # ifndef USR_GVIMRC_FILE |
216 # ifdef COLON_AS_PATHSEP | |
217 # define USR_GVIMRC_FILE "$VIM:.gvimrc" | |
218 # else | |
219 # define USR_GVIMRC_FILE "~/.gvimrc" | 142 # define USR_GVIMRC_FILE "~/.gvimrc" |
220 # endif | |
221 # endif | 143 # endif |
222 # ifndef GVIMRC_FILE | 144 # ifndef GVIMRC_FILE |
223 # define GVIMRC_FILE "_gvimrc" | 145 # define GVIMRC_FILE "_gvimrc" |
224 # endif | 146 # endif |
225 #endif | 147 #endif |
226 #ifndef USR_VIMRC_FILE | 148 #ifndef USR_VIMRC_FILE |
227 # ifdef COLON_AS_PATHSEP | |
228 # define USR_VIMRC_FILE "$VIM:.vimrc" | |
229 # else | |
230 # define USR_VIMRC_FILE "~/.vimrc" | 149 # define USR_VIMRC_FILE "~/.vimrc" |
231 # endif | |
232 #endif | 150 #endif |
233 | 151 |
234 #ifndef USR_EXRC_FILE | 152 #ifndef USR_EXRC_FILE |
235 # ifdef COLON_AS_PATHSEP | |
236 # define USR_EXRC_FILE "$VIM:.exrc" | |
237 # else | |
238 # define USR_EXRC_FILE "~/.exrc" | 153 # define USR_EXRC_FILE "~/.exrc" |
239 # endif | |
240 #endif | 154 #endif |
241 | 155 |
242 #ifndef VIMRC_FILE | 156 #ifndef VIMRC_FILE |
243 # define VIMRC_FILE "_vimrc" | 157 # define VIMRC_FILE "_vimrc" |
244 #endif | 158 #endif |
246 #ifndef EXRC_FILE | 160 #ifndef EXRC_FILE |
247 # define EXRC_FILE "_exrc" | 161 # define EXRC_FILE "_exrc" |
248 #endif | 162 #endif |
249 | 163 |
250 #ifndef DFLT_HELPFILE | 164 #ifndef DFLT_HELPFILE |
251 # ifdef COLON_AS_PATHSEP | |
252 # define DFLT_HELPFILE "$VIMRUNTIME:doc:help.txt" | |
253 # else | |
254 # define DFLT_HELPFILE "$VIMRUNTIME/doc/help.txt" | 165 # define DFLT_HELPFILE "$VIMRUNTIME/doc/help.txt" |
255 # endif | |
256 #endif | 166 #endif |
257 | 167 |
258 #ifndef FILETYPE_FILE | 168 #ifndef FILETYPE_FILE |
259 # define FILETYPE_FILE "filetype.vim" | 169 # define FILETYPE_FILE "filetype.vim" |
260 #endif | 170 #endif |
273 #ifndef INDOFF_FILE | 183 #ifndef INDOFF_FILE |
274 # define INDOFF_FILE "indoff.vim" | 184 # define INDOFF_FILE "indoff.vim" |
275 #endif | 185 #endif |
276 | 186 |
277 #ifndef SYNTAX_FNAME | 187 #ifndef SYNTAX_FNAME |
278 # ifdef COLON_AS_PATHSEP | |
279 # define SYNTAX_FNAME "$VIMRUNTIME:syntax:%s.vim" | |
280 # else | |
281 # define SYNTAX_FNAME "$VIMRUNTIME/syntax/%s.vim" | 188 # define SYNTAX_FNAME "$VIMRUNTIME/syntax/%s.vim" |
282 # endif | |
283 #endif | 189 #endif |
284 | 190 |
285 #ifdef FEAT_VIMINFO | 191 #ifdef FEAT_VIMINFO |
286 # ifndef VIMINFO_FILE | 192 # ifndef VIMINFO_FILE |
287 # ifdef COLON_AS_PATHSEP | |
288 # define VIMINFO_FILE "$VIM:viminfo" | |
289 # else | |
290 # define VIMINFO_FILE "~/.viminfo" | 193 # define VIMINFO_FILE "~/.viminfo" |
291 # endif | |
292 # endif | 194 # endif |
293 #endif /* FEAT_VIMINFO */ | 195 #endif /* FEAT_VIMINFO */ |
294 | 196 |
295 #ifndef DFLT_BDIR | 197 #ifndef DFLT_BDIR |
296 # define DFLT_BDIR "." /* default for 'backupdir' */ | 198 # define DFLT_BDIR "." /* default for 'backupdir' */ |
299 #ifndef DFLT_DIR | 201 #ifndef DFLT_DIR |
300 # define DFLT_DIR "." /* default for 'directory' */ | 202 # define DFLT_DIR "." /* default for 'directory' */ |
301 #endif | 203 #endif |
302 | 204 |
303 #ifndef DFLT_VDIR | 205 #ifndef DFLT_VDIR |
304 # ifdef COLON_AS_PATHSEP | |
305 # define DFLT_VDIR "$VIM:vimfiles:view" /* default for 'viewdir' */ | |
306 # else | |
307 # define DFLT_VDIR "$VIM/vimfiles/view" /* default for 'viewdir' */ | 206 # define DFLT_VDIR "$VIM/vimfiles/view" /* default for 'viewdir' */ |
308 # endif | |
309 #endif | 207 #endif |
310 | 208 |
311 #define DFLT_ERRORFILE "errors.err" | 209 #define DFLT_ERRORFILE "errors.err" |
312 | 210 |
313 #ifndef DFLT_RUNTIMEPATH | 211 #ifndef DFLT_RUNTIMEPATH |
314 # ifdef COLON_AS_PATHSEP | |
315 # define DFLT_RUNTIMEPATH "$VIM:vimfiles,$VIMRUNTIME,$VIM:vimfiles:after" | |
316 # else | |
317 # define DFLT_RUNTIMEPATH "~/.vim,$VIM/vimfiles,$VIMRUNTIME,$VIM/vimfiles/after,~/.vim/after" | 212 # define DFLT_RUNTIMEPATH "~/.vim,$VIM/vimfiles,$VIMRUNTIME,$VIM/vimfiles/after,~/.vim/after" |
318 # endif | |
319 #endif | 213 #endif |
320 | 214 |
321 /* | 215 /* |
322 * Macintosh has plenty of memory, use large buffers | 216 * Macintosh has plenty of memory, use large buffers |
323 */ | 217 */ |
412 void Trace(char *fmt, ...); | 306 void Trace(char *fmt, ...); |
413 # else | 307 # else |
414 # define TRACE 1 ? (void)0 : printf | 308 # define TRACE 1 ? (void)0 : printf |
415 # endif | 309 # endif |
416 #endif | 310 #endif |
417 | |
418 #ifdef MACOS_CLASSIC | |
419 # define TRACE 1 ? (int)0 : printf | |
420 #endif |