comparison src/os_mac.h @ 18753:6e3dc2d630c2 v8.1.2366

patch 8.1.2366: using old C style comments Commit: https://github.com/vim/vim/commit/9bf703d46a79fbffeb829246ea5ce385bddc4166 Author: Bram Moolenaar <Bram@vim.org> Date: Sat Nov 30 19:44:38 2019 +0100 patch 8.1.2366: using old C style comments Problem: Using old C style comments. Solution: Use // comments where appropriate.
author Bram Moolenaar <Bram@vim.org>
date Sat, 30 Nov 2019 19:45:03 +0100
parents 62b3805506b3
children c85d1e043d16
comparison
equal deleted inserted replaced
18752:9ec3c9cb4533 18753:6e3dc2d630c2
4 * 4 *
5 * Do ":help uganda" in Vim to read copying and usage conditions. 5 * Do ":help uganda" in Vim to read copying and usage conditions.
6 * Do ":help credits" in Vim to see a list of people who contributed. 6 * Do ":help credits" in Vim to see a list of people who contributed.
7 */ 7 */
8 8
9 /* Before Including the MacOS specific files, 9 // Before Including the MacOS specific files,
10 * lets set the OPAQUE_TOOLBOX_STRUCTS to 0 so we 10 // lets set the OPAQUE_TOOLBOX_STRUCTS to 0 so we
11 * can access the internal structures. 11 // can access the internal structures.
12 * (Until fully Carbon compliant) 12 // (Until fully Carbon compliant)
13 * TODO: Can we remove this? (Dany) 13 // TODO: Can we remove this? (Dany)
14 */
15 #if 0 14 #if 0
16 # define OPAQUE_TOOLBOX_STRUCTS 0 15 # define OPAQUE_TOOLBOX_STRUCTS 0
17 #endif 16 #endif
18 17
19 /* Include MAC_OS_X_VERSION_* macros */ 18 // Include MAC_OS_X_VERSION_* macros
20 #ifdef HAVE_AVAILABILITYMACROS_H 19 #ifdef HAVE_AVAILABILITYMACROS_H
21 # include <AvailabilityMacros.h> 20 # include <AvailabilityMacros.h>
22 #endif 21 #endif
23 22
24 /* 23 /*
26 * 25 *
27 * Include the Mac header files, unless also compiling with X11 (the header 26 * Include the Mac header files, unless also compiling with X11 (the header
28 * files have many conflicts). 27 * files have many conflicts).
29 */ 28 */
30 #ifdef FEAT_GUI_MAC 29 #ifdef FEAT_GUI_MAC
31 # include <Quickdraw.h> /* Apple calls it QuickDraw.h... */ 30 # include <Quickdraw.h> // Apple calls it QuickDraw.h...
32 # include <ToolUtils.h> 31 # include <ToolUtils.h>
33 # include <LowMem.h> 32 # include <LowMem.h>
34 # include <Scrap.h> 33 # include <Scrap.h>
35 # include <Sound.h> 34 # include <Sound.h>
36 # include <TextUtils.h> 35 # include <TextUtils.h>
41 #endif 40 #endif
42 41
43 /* 42 /*
44 * Unix interface 43 * Unix interface
45 */ 44 */
46 #if defined(__APPLE_CC__) /* for Project Builder and ... */ 45 #if defined(__APPLE_CC__) // for Project Builder and ...
47 # include <unistd.h> 46 # include <unistd.h>
48 /* Get stat.h or something similar. Comment: How come some OS get in in vim.h */ 47 // Get stat.h or something similar. Comment: How come some OS get in in vim.h
49 # include <sys/stat.h> 48 # include <sys/stat.h>
50 /* && defined(HAVE_CURSE) */ 49 // && defined(HAVE_CURSE)
51 /* The curses.h from MacOS X provides by default some BACKWARD compatibility 50 // The curses.h from MacOS X provides by default some BACKWARD compatibility
52 * definition which can cause us problem later on. So we undefine a few of them. */ 51 // definition which can cause us problem later on. So we undefine a few of them.
53 # include <curses.h> 52 # include <curses.h>
54 # undef reg 53 # undef reg
55 # undef ospeed 54 # undef ospeed
56 /* OK defined to 0 in MacOS X 10.2 curses! Remove it, we define it to be 1. */ 55 // OK defined to 0 in MacOS X 10.2 curses! Remove it, we define it to be 1.
57 # undef OK 56 # undef OK
58 #endif 57 #endif
59 #include <signal.h> 58 #include <signal.h>
60 #include <errno.h> 59 #include <errno.h>
61 #include <stdio.h> 60 #include <stdio.h>
65 64
66 /* 65 /*
67 * MacOS specific #define 66 * MacOS specific #define
68 */ 67 */
69 68
70 /* This will go away when CMD_KEY fully tested */ 69 // This will go away when CMD_KEY fully tested
71 #define USE_CMD_KEY 70 #define USE_CMD_KEY
72 /* On MacOS X use the / not the : */ 71 // On MacOS X use the / not the :
73 /* TODO: Should file such as ~/.vimrc reside instead in 72 // TODO: Should file such as ~/.vimrc reside instead in
74 * ~/Library/Vim or ~/Library/Preferences/org.vim.vim/ ? (Dany) 73 // ~/Library/Vim or ~/Library/Preferences/org.vim.vim/ ? (Dany)
75 */ 74 // When compiled under MacOS X (including CARBON version)
76 /* When compiled under MacOS X (including CARBON version) 75 // we use the Unix File path style. Also when UNIX is defined.
77 * we use the Unix File path style. Also when UNIX is defined. */
78 #define USE_UNIXFILENAME 76 #define USE_UNIXFILENAME
79 77
80 78
81 /* 79 /*
82 * Generic Vim #define 80 * Generic Vim #define
83 */ 81 */
84 82
85 #define FEAT_SOURCE_FFS 83 #define FEAT_SOURCE_FFS
86 #define FEAT_SOURCE_FF_MAC 84 #define FEAT_SOURCE_FF_MAC
87 85
88 #define USE_EXE_NAME /* to find $VIM */ 86 #define USE_EXE_NAME // to find $VIM
89 #define CASE_INSENSITIVE_FILENAME /* ignore case when comparing file names */ 87 #define CASE_INSENSITIVE_FILENAME // ignore case when comparing file names
90 #define SPACE_IN_FILENAME 88 #define SPACE_IN_FILENAME
91 #define BREAKCHECK_SKIP 32 /* call mch_breakcheck() each time, it's 89 #define BREAKCHECK_SKIP 32 // call mch_breakcheck() each time, it's
92 quite fast. Did I forgot to update the 90 // quite fast. Did I forgot to update the
93 comment */ 91 // comment
94 92
95 #define USE_FNAME_CASE /* make ":e os_Mac.c" open the file in its 93 #define USE_FNAME_CASE // make ":e os_Mac.c" open the file in its
96 original case, as "os_mac.c" */ 94 // original case, as "os_mac.c"
97 #define BINARY_FILE_IO 95 #define BINARY_FILE_IO
98 #define EOL_DEFAULT EOL_MAC 96 #define EOL_DEFAULT EOL_MAC
99 #define HAVE_AVAIL_MEM 97 #define HAVE_AVAIL_MEM
100 98
101 #ifndef HAVE_CONFIG_H 99 #ifndef HAVE_CONFIG_H
102 # define HAVE_STRING_H 100 # define HAVE_STRING_H
103 # define HAVE_STRCSPN 101 # define HAVE_STRCSPN
104 # define HAVE_MEMSET 102 # define HAVE_MEMSET
105 # define USE_TMPNAM /* use tmpnam() instead of mktemp() */ 103 # define USE_TMPNAM // use tmpnam() instead of mktemp()
106 # define HAVE_FCNTL_H 104 # define HAVE_FCNTL_H
107 # define HAVE_QSORT 105 # define HAVE_QSORT
108 # define HAVE_ST_MODE /* have stat.st_mode */ 106 # define HAVE_ST_MODE // have stat.st_mode
109 # define HAVE_MATH_H 107 # define HAVE_MATH_H
110 108
111 # if defined(__DATE__) && defined(__TIME__) 109 # if defined(__DATE__) && defined(__TIME__)
112 # define HAVE_DATE_TIME 110 # define HAVE_DATE_TIME
113 # endif 111 # endif
191 189
192 #ifdef FEAT_VIMINFO 190 #ifdef FEAT_VIMINFO
193 # ifndef VIMINFO_FILE 191 # ifndef VIMINFO_FILE
194 # define VIMINFO_FILE "~/.viminfo" 192 # define VIMINFO_FILE "~/.viminfo"
195 # endif 193 # endif
196 #endif /* FEAT_VIMINFO */ 194 #endif // FEAT_VIMINFO
197 195
198 #ifndef DFLT_BDIR 196 #ifndef DFLT_BDIR
199 # define DFLT_BDIR "." /* default for 'backupdir' */ 197 # define DFLT_BDIR "." // default for 'backupdir'
200 #endif 198 #endif
201 199
202 #ifndef DFLT_DIR 200 #ifndef DFLT_DIR
203 # define DFLT_DIR "." /* default for 'directory' */ 201 # define DFLT_DIR "." // default for 'directory'
204 #endif 202 #endif
205 203
206 #ifndef DFLT_VDIR 204 #ifndef DFLT_VDIR
207 # define DFLT_VDIR "$VIM/vimfiles/view" /* default for 'viewdir' */ 205 # define DFLT_VDIR "$VIM/vimfiles/view" // default for 'viewdir'
208 #endif 206 #endif
209 207
210 #define DFLT_ERRORFILE "errors.err" 208 #define DFLT_ERRORFILE "errors.err"
211 209
212 #ifndef DFLT_RUNTIMEPATH 210 #ifndef DFLT_RUNTIMEPATH
217 #endif 215 #endif
218 216
219 /* 217 /*
220 * Macintosh has plenty of memory, use large buffers 218 * Macintosh has plenty of memory, use large buffers
221 */ 219 */
222 #define CMDBUFFSIZE 1024 /* size of the command processing buffer */ 220 #define CMDBUFFSIZE 1024 // size of the command processing buffer
223 221
224 #ifndef DFLT_MAXMEM 222 #ifndef DFLT_MAXMEM
225 # define DFLT_MAXMEM 512 /* use up to 512 Kbyte for buffer */ 223 # define DFLT_MAXMEM 512 // use up to 512 Kbyte for buffer
226 #endif 224 #endif
227 225
228 #ifndef DFLT_MAXMEMTOT 226 #ifndef DFLT_MAXMEMTOT
229 # define DFLT_MAXMEMTOT 2048 /* use up to 2048 Kbyte for Vim */ 227 # define DFLT_MAXMEMTOT 2048 // use up to 2048 Kbyte for Vim
230 #endif 228 #endif
231 229
232 #define WILDCHAR_LIST "*?[{`$" 230 #define WILDCHAR_LIST "*?[{`$"
233 231
234 /**************/ 232 /**************/
237 #ifndef mch_getenv 235 #ifndef mch_getenv
238 # if defined(__APPLE_CC__) 236 # if defined(__APPLE_CC__)
239 # define mch_getenv(name) ((char_u *)getenv((char *)(name))) 237 # define mch_getenv(name) ((char_u *)getenv((char *)(name)))
240 # define mch_setenv(name, val, x) setenv(name, val, x) 238 # define mch_setenv(name, val, x) setenv(name, val, x)
241 # else 239 # else
242 /* vim_getenv() is in pty.c */ 240 // vim_getenv() is in pty.c
243 # define USE_VIMPTY_GETENV 241 # define USE_VIMPTY_GETENV
244 # define mch_getenv(x) vimpty_getenv(x) 242 # define mch_getenv(x) vimpty_getenv(x)
245 # define mch_setenv(name, val, x) setenv(name, val, x) 243 # define mch_setenv(name, val, x) setenv(name, val, x)
246 # endif 244 # endif
247 #endif 245 #endif
248 246
249 #ifndef HAVE_CONFIG_H 247 #ifndef HAVE_CONFIG_H
250 # ifdef __APPLE_CC__ 248 # ifdef __APPLE_CC__
251 /* Assuming compiling for MacOS X */ 249 // Assuming compiling for MacOS X
252 /* Trying to take advantage of the prebinding */ 250 // Trying to take advantage of the prebinding
253 # define HAVE_TGETENT 251 # define HAVE_TGETENT
254 # define OSPEED_EXTERN 252 # define OSPEED_EXTERN
255 # define UP_BC_PC_EXTERN 253 # define UP_BC_PC_EXTERN
256 # endif 254 # endif
257 #endif 255 #endif
258 256
259 /* Some "prep work" definition to be able to compile the MacOS X 257 // Some "prep work" definition to be able to compile the MacOS X
260 * version with os_unix.c instead of os_mac.c. Based on the result 258 // version with os_unix.c instead of os_mac.c. Based on the result
261 * of ./configure for console MacOS X. 259 // of ./configure for console MacOS X.
262 */
263 260
264 #ifndef SIGPROTOARG 261 #ifndef SIGPROTOARG
265 # define SIGPROTOARG (int) 262 # define SIGPROTOARG (int)
266 #endif 263 #endif
267 #ifndef SIGDEFARG 264 #ifndef SIGDEFARG
272 #endif 269 #endif
273 #undef HAVE_AVAIL_MEM 270 #undef HAVE_AVAIL_MEM
274 #ifndef HAVE_CONFIG_H 271 #ifndef HAVE_CONFIG_H
275 # define RETSIGTYPE void 272 # define RETSIGTYPE void
276 # define SIGRETURN return 273 # define SIGRETURN return
277 /*# define USE_SYSTEM */ /* Output ship do debugger :(, but ot compile */ 274 //# define USE_SYSTEM // Output ship do debugger :(, but not compile
278 # define HAVE_SYS_WAIT_H 1 /* Attempt */ 275 # define HAVE_SYS_WAIT_H 1 // Attempt
279 # define HAVE_TERMIOS_H 1 276 # define HAVE_TERMIOS_H 1
280 # define SYS_SELECT_WITH_SYS_TIME 1 277 # define SYS_SELECT_WITH_SYS_TIME 1
281 # define HAVE_SELECT 1 278 # define HAVE_SELECT 1
282 # define HAVE_SYS_SELECT_H 1 279 # define HAVE_SYS_SELECT_H 1
283 # define HAVE_PUTENV 280 # define HAVE_PUTENV
287 284
288 #if !defined(HAVE_CONFIG_H) 285 #if !defined(HAVE_CONFIG_H)
289 # define HAVE_PUTENV 286 # define HAVE_PUTENV
290 #endif 287 #endif
291 288
292 /* A Mac constant causing big problem to syntax highlighting */ 289 // A Mac constant causing big problem to syntax highlighting
293 #define UNKNOWN_CREATOR '\?\?\?\?' 290 #define UNKNOWN_CREATOR '\?\?\?\?'