Mercurial > vim
annotate src/os_mac.h @ 29191:0af5fe160e4e v8.2.5115
patch 8.2.5115: search timeout is overrun with some patterns
Commit: https://github.com/vim/vim/commit/616592e0816d2d9f893fcd95e3e1e0fbc5893168
Author: Bram Moolenaar <Bram@vim.org>
Date: Fri Jun 17 15:17:10 2022 +0100
patch 8.2.5115: search timeout is overrun with some patterns
Problem: Search timeout is overrun with some patterns.
Solution: Check for timeout in more places. Make the flag volatile and
atomic. Use assert_inrange() to see what happened.
author | Bram Moolenaar <Bram@vim.org> |
---|---|
date | Fri, 17 Jun 2022 16:30:06 +0200 |
parents | c09c7ea83047 |
children | 1b2d6aa29267 |
rev | line source |
---|---|
10042
4aead6a9b7a9
commit https://github.com/vim/vim/commit/edf3f97ae2af024708ebb4ac614227327033ca47
Christian Brabandt <cb@256bit.org>
parents:
9669
diff
changeset
|
1 /* vi:set ts=8 sts=4 sw=4 noet: |
7 | 2 * |
3 * VIM - Vi IMproved by Bram Moolenaar | |
4 * | |
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. | |
7 */ | |
8 | |
29071
b90bca860b5a
patch 8.2.5057: using gettimeofday() for timeout is very inefficient
Bram Moolenaar <Bram@vim.org>
parents:
26771
diff
changeset
|
9 #ifndef OS_MAC__H |
b90bca860b5a
patch 8.2.5057: using gettimeofday() for timeout is very inefficient
Bram Moolenaar <Bram@vim.org>
parents:
26771
diff
changeset
|
10 #define OS_MAC__H |
b90bca860b5a
patch 8.2.5057: using gettimeofday() for timeout is very inefficient
Bram Moolenaar <Bram@vim.org>
parents:
26771
diff
changeset
|
11 |
18753
6e3dc2d630c2
patch 8.1.2366: using old C style comments
Bram Moolenaar <Bram@vim.org>
parents:
15605
diff
changeset
|
12 // Before Including the MacOS specific files, |
26771
fc859aea8cec
patch 8.2.3914: various spelling mistakes in comments
Bram Moolenaar <Bram@vim.org>
parents:
21745
diff
changeset
|
13 // let's set the OPAQUE_TOOLBOX_STRUCTS to 0 so we |
18753
6e3dc2d630c2
patch 8.1.2366: using old C style comments
Bram Moolenaar <Bram@vim.org>
parents:
15605
diff
changeset
|
14 // can access the internal structures. |
6e3dc2d630c2
patch 8.1.2366: using old C style comments
Bram Moolenaar <Bram@vim.org>
parents:
15605
diff
changeset
|
15 // (Until fully Carbon compliant) |
6e3dc2d630c2
patch 8.1.2366: using old C style comments
Bram Moolenaar <Bram@vim.org>
parents:
15605
diff
changeset
|
16 // TODO: Can we remove this? (Dany) |
7 | 17 #if 0 |
18 # define OPAQUE_TOOLBOX_STRUCTS 0 | |
19 #endif | |
20 | |
18753
6e3dc2d630c2
patch 8.1.2366: using old C style comments
Bram Moolenaar <Bram@vim.org>
parents:
15605
diff
changeset
|
21 // Include MAC_OS_X_VERSION_* macros |
5409 | 22 #ifdef HAVE_AVAILABILITYMACROS_H |
23 # include <AvailabilityMacros.h> | |
24 #endif | |
25 | |
7 | 26 /* |
27 * Unix interface | |
28 */ | |
18753
6e3dc2d630c2
patch 8.1.2366: using old C style comments
Bram Moolenaar <Bram@vim.org>
parents:
15605
diff
changeset
|
29 #if defined(__APPLE_CC__) // for Project Builder and ... |
7 | 30 # include <unistd.h> |
18753
6e3dc2d630c2
patch 8.1.2366: using old C style comments
Bram Moolenaar <Bram@vim.org>
parents:
15605
diff
changeset
|
31 // Get stat.h or something similar. Comment: How come some OS get in in vim.h |
7 | 32 # include <sys/stat.h> |
18753
6e3dc2d630c2
patch 8.1.2366: using old C style comments
Bram Moolenaar <Bram@vim.org>
parents:
15605
diff
changeset
|
33 // && defined(HAVE_CURSE) |
6e3dc2d630c2
patch 8.1.2366: using old C style comments
Bram Moolenaar <Bram@vim.org>
parents:
15605
diff
changeset
|
34 // The curses.h from MacOS X provides by default some BACKWARD compatibility |
6e3dc2d630c2
patch 8.1.2366: using old C style comments
Bram Moolenaar <Bram@vim.org>
parents:
15605
diff
changeset
|
35 // definition which can cause us problem later on. So we undefine a few of them. |
7 | 36 # include <curses.h> |
37 # undef reg | |
38 # undef ospeed | |
18753
6e3dc2d630c2
patch 8.1.2366: using old C style comments
Bram Moolenaar <Bram@vim.org>
parents:
15605
diff
changeset
|
39 // OK defined to 0 in MacOS X 10.2 curses! Remove it, we define it to be 1. |
7 | 40 # undef OK |
41 #endif | |
42 #include <signal.h> | |
43 #include <errno.h> | |
44 #include <stdio.h> | |
45 #include <stdlib.h> | |
46 #include <time.h> | |
718 | 47 #include <dirent.h> |
7 | 48 |
49 /* | |
50 * MacOS specific #define | |
51 */ | |
52 | |
18753
6e3dc2d630c2
patch 8.1.2366: using old C style comments
Bram Moolenaar <Bram@vim.org>
parents:
15605
diff
changeset
|
53 // This will go away when CMD_KEY fully tested |
7 | 54 #define USE_CMD_KEY |
18753
6e3dc2d630c2
patch 8.1.2366: using old C style comments
Bram Moolenaar <Bram@vim.org>
parents:
15605
diff
changeset
|
55 // On MacOS X use the / not the : |
6e3dc2d630c2
patch 8.1.2366: using old C style comments
Bram Moolenaar <Bram@vim.org>
parents:
15605
diff
changeset
|
56 // TODO: Should file such as ~/.vimrc reside instead in |
6e3dc2d630c2
patch 8.1.2366: using old C style comments
Bram Moolenaar <Bram@vim.org>
parents:
15605
diff
changeset
|
57 // ~/Library/Vim or ~/Library/Preferences/org.vim.vim/ ? (Dany) |
6e3dc2d630c2
patch 8.1.2366: using old C style comments
Bram Moolenaar <Bram@vim.org>
parents:
15605
diff
changeset
|
58 // When compiled under MacOS X (including CARBON version) |
6e3dc2d630c2
patch 8.1.2366: using old C style comments
Bram Moolenaar <Bram@vim.org>
parents:
15605
diff
changeset
|
59 // we use the Unix File path style. Also when UNIX is defined. |
12716
351cf7c67bbe
patch 8.0.1236: Mac features are confusing
Christian Brabandt <cb@256bit.org>
parents:
10042
diff
changeset
|
60 #define USE_UNIXFILENAME |
7 | 61 |
62 | |
63 /* | |
19709
c85d1e043d16
patch 8.2.0411: Mac: breakcheck is using a value from the stone ages
Bram Moolenaar <Bram@vim.org>
parents:
18753
diff
changeset
|
64 * Generic Vim #define for Mac |
7 | 65 */ |
66 | |
67 #define FEAT_SOURCE_FFS | |
68 #define FEAT_SOURCE_FF_MAC | |
69 | |
18753
6e3dc2d630c2
patch 8.1.2366: using old C style comments
Bram Moolenaar <Bram@vim.org>
parents:
15605
diff
changeset
|
70 #define USE_EXE_NAME // to find $VIM |
6e3dc2d630c2
patch 8.1.2366: using old C style comments
Bram Moolenaar <Bram@vim.org>
parents:
15605
diff
changeset
|
71 #define CASE_INSENSITIVE_FILENAME // ignore case when comparing file names |
7 | 72 #define SPACE_IN_FILENAME |
73 | |
18753
6e3dc2d630c2
patch 8.1.2366: using old C style comments
Bram Moolenaar <Bram@vim.org>
parents:
15605
diff
changeset
|
74 #define USE_FNAME_CASE // make ":e os_Mac.c" open the file in its |
6e3dc2d630c2
patch 8.1.2366: using old C style comments
Bram Moolenaar <Bram@vim.org>
parents:
15605
diff
changeset
|
75 // original case, as "os_mac.c" |
7 | 76 #define BINARY_FILE_IO |
77 #define EOL_DEFAULT EOL_MAC | |
78 #define HAVE_AVAIL_MEM | |
79 | |
80 #ifndef HAVE_CONFIG_H | |
81 # define HAVE_STRING_H | |
82 # define HAVE_STRCSPN | |
83 # define HAVE_MEMSET | |
18753
6e3dc2d630c2
patch 8.1.2366: using old C style comments
Bram Moolenaar <Bram@vim.org>
parents:
15605
diff
changeset
|
84 # define USE_TMPNAM // use tmpnam() instead of mktemp() |
7 | 85 # define HAVE_FCNTL_H |
86 # define HAVE_QSORT | |
18753
6e3dc2d630c2
patch 8.1.2366: using old C style comments
Bram Moolenaar <Bram@vim.org>
parents:
15605
diff
changeset
|
87 # define HAVE_ST_MODE // have stat.st_mode |
1619 | 88 # define HAVE_MATH_H |
7 | 89 |
90 # if defined(__DATE__) && defined(__TIME__) | |
91 # define HAVE_DATE_TIME | |
92 # endif | |
93 # define HAVE_STRFTIME | |
94 #endif | |
95 | |
96 /* | |
97 * Names for the EXRC, HELP and temporary files. | |
98 * Some of these may have been defined in the makefile. | |
99 */ | |
100 | |
101 #ifndef SYS_VIMRC_FILE | |
12716
351cf7c67bbe
patch 8.0.1236: Mac features are confusing
Christian Brabandt <cb@256bit.org>
parents:
10042
diff
changeset
|
102 # define SYS_VIMRC_FILE "$VIM/vimrc" |
7 | 103 #endif |
104 #ifndef SYS_GVIMRC_FILE | |
12716
351cf7c67bbe
patch 8.0.1236: Mac features are confusing
Christian Brabandt <cb@256bit.org>
parents:
10042
diff
changeset
|
105 # define SYS_GVIMRC_FILE "$VIM/gvimrc" |
7 | 106 #endif |
107 #ifndef SYS_MENU_FILE | |
12716
351cf7c67bbe
patch 8.0.1236: Mac features are confusing
Christian Brabandt <cb@256bit.org>
parents:
10042
diff
changeset
|
108 # define SYS_MENU_FILE "$VIMRUNTIME/menu.vim" |
7 | 109 #endif |
110 #ifndef SYS_OPTWIN_FILE | |
12716
351cf7c67bbe
patch 8.0.1236: Mac features are confusing
Christian Brabandt <cb@256bit.org>
parents:
10042
diff
changeset
|
111 # define SYS_OPTWIN_FILE "$VIMRUNTIME/optwin.vim" |
7 | 112 #endif |
9669
284b4eb307fc
commit https://github.com/vim/vim/commit/8c08b5b569e2a9e9f63dea514591ecfa2d3bb392
Christian Brabandt <cb@256bit.org>
parents:
5409
diff
changeset
|
113 #ifndef VIM_DEFAULTS_FILE |
12716
351cf7c67bbe
patch 8.0.1236: Mac features are confusing
Christian Brabandt <cb@256bit.org>
parents:
10042
diff
changeset
|
114 # define VIM_DEFAULTS_FILE "$VIMRUNTIME/defaults.vim" |
9669
284b4eb307fc
commit https://github.com/vim/vim/commit/8c08b5b569e2a9e9f63dea514591ecfa2d3bb392
Christian Brabandt <cb@256bit.org>
parents:
5409
diff
changeset
|
115 #endif |
7 | 116 #ifndef EVIM_FILE |
12716
351cf7c67bbe
patch 8.0.1236: Mac features are confusing
Christian Brabandt <cb@256bit.org>
parents:
10042
diff
changeset
|
117 # define EVIM_FILE "$VIMRUNTIME/evim.vim" |
7 | 118 #endif |
119 | |
120 #ifdef FEAT_GUI | |
121 # ifndef USR_GVIMRC_FILE | |
12716
351cf7c67bbe
patch 8.0.1236: Mac features are confusing
Christian Brabandt <cb@256bit.org>
parents:
10042
diff
changeset
|
122 # define USR_GVIMRC_FILE "~/.gvimrc" |
7 | 123 # endif |
124 # ifndef GVIMRC_FILE | |
125 # define GVIMRC_FILE "_gvimrc" | |
126 # endif | |
127 #endif | |
128 #ifndef USR_VIMRC_FILE | |
12716
351cf7c67bbe
patch 8.0.1236: Mac features are confusing
Christian Brabandt <cb@256bit.org>
parents:
10042
diff
changeset
|
129 # define USR_VIMRC_FILE "~/.vimrc" |
7 | 130 #endif |
131 | |
132 #ifndef USR_EXRC_FILE | |
12716
351cf7c67bbe
patch 8.0.1236: Mac features are confusing
Christian Brabandt <cb@256bit.org>
parents:
10042
diff
changeset
|
133 # define USR_EXRC_FILE "~/.exrc" |
7 | 134 #endif |
135 | |
136 #ifndef VIMRC_FILE | |
137 # define VIMRC_FILE "_vimrc" | |
138 #endif | |
139 | |
140 #ifndef EXRC_FILE | |
141 # define EXRC_FILE "_exrc" | |
142 #endif | |
143 | |
144 #ifndef DFLT_HELPFILE | |
12716
351cf7c67bbe
patch 8.0.1236: Mac features are confusing
Christian Brabandt <cb@256bit.org>
parents:
10042
diff
changeset
|
145 # define DFLT_HELPFILE "$VIMRUNTIME/doc/help.txt" |
7 | 146 #endif |
147 | |
148 #ifndef FILETYPE_FILE | |
149 # define FILETYPE_FILE "filetype.vim" | |
150 #endif | |
151 #ifndef FTPLUGIN_FILE | |
152 # define FTPLUGIN_FILE "ftplugin.vim" | |
153 #endif | |
154 #ifndef INDENT_FILE | |
155 # define INDENT_FILE "indent.vim" | |
156 #endif | |
157 #ifndef FTOFF_FILE | |
158 # define FTOFF_FILE "ftoff.vim" | |
159 #endif | |
160 #ifndef FTPLUGOF_FILE | |
161 # define FTPLUGOF_FILE "ftplugof.vim" | |
162 #endif | |
163 #ifndef INDOFF_FILE | |
164 # define INDOFF_FILE "indoff.vim" | |
165 #endif | |
166 | |
167 #ifndef SYNTAX_FNAME | |
12716
351cf7c67bbe
patch 8.0.1236: Mac features are confusing
Christian Brabandt <cb@256bit.org>
parents:
10042
diff
changeset
|
168 # define SYNTAX_FNAME "$VIMRUNTIME/syntax/%s.vim" |
7 | 169 #endif |
170 | |
171 #ifdef FEAT_VIMINFO | |
172 # ifndef VIMINFO_FILE | |
12716
351cf7c67bbe
patch 8.0.1236: Mac features are confusing
Christian Brabandt <cb@256bit.org>
parents:
10042
diff
changeset
|
173 # define VIMINFO_FILE "~/.viminfo" |
7 | 174 # endif |
18753
6e3dc2d630c2
patch 8.1.2366: using old C style comments
Bram Moolenaar <Bram@vim.org>
parents:
15605
diff
changeset
|
175 #endif // FEAT_VIMINFO |
7 | 176 |
177 #ifndef DFLT_BDIR | |
18753
6e3dc2d630c2
patch 8.1.2366: using old C style comments
Bram Moolenaar <Bram@vim.org>
parents:
15605
diff
changeset
|
178 # define DFLT_BDIR "." // default for 'backupdir' |
7 | 179 #endif |
180 | |
181 #ifndef DFLT_DIR | |
18753
6e3dc2d630c2
patch 8.1.2366: using old C style comments
Bram Moolenaar <Bram@vim.org>
parents:
15605
diff
changeset
|
182 # define DFLT_DIR "." // default for 'directory' |
7 | 183 #endif |
184 | |
185 #ifndef DFLT_VDIR | |
18753
6e3dc2d630c2
patch 8.1.2366: using old C style comments
Bram Moolenaar <Bram@vim.org>
parents:
15605
diff
changeset
|
186 # define DFLT_VDIR "$VIM/vimfiles/view" // default for 'viewdir' |
7 | 187 #endif |
188 | |
189 #define DFLT_ERRORFILE "errors.err" | |
18 | 190 |
191 #ifndef DFLT_RUNTIMEPATH | |
12716
351cf7c67bbe
patch 8.0.1236: Mac features are confusing
Christian Brabandt <cb@256bit.org>
parents:
10042
diff
changeset
|
192 # define DFLT_RUNTIMEPATH "~/.vim,$VIM/vimfiles,$VIMRUNTIME,$VIM/vimfiles/after,~/.vim/after" |
7 | 193 #endif |
13361
65c29bd4548b
patch 8.0.1554: custom plugins loaded with --clean
Christian Brabandt <cb@256bit.org>
parents:
12716
diff
changeset
|
194 #ifndef CLEAN_RUNTIMEPATH |
65c29bd4548b
patch 8.0.1554: custom plugins loaded with --clean
Christian Brabandt <cb@256bit.org>
parents:
12716
diff
changeset
|
195 # define CLEAN_RUNTIMEPATH "$VIM/vimfiles,$VIMRUNTIME,$VIM/vimfiles/after" |
65c29bd4548b
patch 8.0.1554: custom plugins loaded with --clean
Christian Brabandt <cb@256bit.org>
parents:
12716
diff
changeset
|
196 #endif |
7 | 197 |
198 /* | |
199 * Macintosh has plenty of memory, use large buffers | |
200 */ | |
18753
6e3dc2d630c2
patch 8.1.2366: using old C style comments
Bram Moolenaar <Bram@vim.org>
parents:
15605
diff
changeset
|
201 #define CMDBUFFSIZE 1024 // size of the command processing buffer |
7 | 202 |
203 #ifndef DFLT_MAXMEM | |
18753
6e3dc2d630c2
patch 8.1.2366: using old C style comments
Bram Moolenaar <Bram@vim.org>
parents:
15605
diff
changeset
|
204 # define DFLT_MAXMEM 512 // use up to 512 Kbyte for buffer |
7 | 205 #endif |
206 | |
207 #ifndef DFLT_MAXMEMTOT | |
18753
6e3dc2d630c2
patch 8.1.2366: using old C style comments
Bram Moolenaar <Bram@vim.org>
parents:
15605
diff
changeset
|
208 # define DFLT_MAXMEMTOT 2048 // use up to 2048 Kbyte for Vim |
7 | 209 #endif |
210 | |
211 #define WILDCHAR_LIST "*?[{`$" | |
212 | |
213 /**************/ | |
214 #define mch_rename(src, dst) rename(src, dst) | |
215 #define mch_remove(x) unlink((char *)(x)) | |
216 #ifndef mch_getenv | |
12716
351cf7c67bbe
patch 8.0.1236: Mac features are confusing
Christian Brabandt <cb@256bit.org>
parents:
10042
diff
changeset
|
217 # if defined(__APPLE_CC__) |
7 | 218 # define mch_getenv(name) ((char_u *)getenv((char *)(name))) |
219 # define mch_setenv(name, val, x) setenv(name, val, x) | |
220 # else | |
18753
6e3dc2d630c2
patch 8.1.2366: using old C style comments
Bram Moolenaar <Bram@vim.org>
parents:
15605
diff
changeset
|
221 // vim_getenv() is in pty.c |
7 | 222 # define USE_VIMPTY_GETENV |
223 # define mch_getenv(x) vimpty_getenv(x) | |
224 # define mch_setenv(name, val, x) setenv(name, val, x) | |
225 # endif | |
226 #endif | |
227 | |
228 #ifndef HAVE_CONFIG_H | |
229 # ifdef __APPLE_CC__ | |
18753
6e3dc2d630c2
patch 8.1.2366: using old C style comments
Bram Moolenaar <Bram@vim.org>
parents:
15605
diff
changeset
|
230 // Assuming compiling for MacOS X |
6e3dc2d630c2
patch 8.1.2366: using old C style comments
Bram Moolenaar <Bram@vim.org>
parents:
15605
diff
changeset
|
231 // Trying to take advantage of the prebinding |
7 | 232 # define HAVE_TGETENT |
233 # define OSPEED_EXTERN | |
234 # define UP_BC_PC_EXTERN | |
235 # endif | |
236 #endif | |
237 | |
18753
6e3dc2d630c2
patch 8.1.2366: using old C style comments
Bram Moolenaar <Bram@vim.org>
parents:
15605
diff
changeset
|
238 // Some "prep work" definition to be able to compile the MacOS X |
6e3dc2d630c2
patch 8.1.2366: using old C style comments
Bram Moolenaar <Bram@vim.org>
parents:
15605
diff
changeset
|
239 // version with os_unix.c instead of os_mac.c. Based on the result |
6e3dc2d630c2
patch 8.1.2366: using old C style comments
Bram Moolenaar <Bram@vim.org>
parents:
15605
diff
changeset
|
240 // of ./configure for console MacOS X. |
7 | 241 |
12716
351cf7c67bbe
patch 8.0.1236: Mac features are confusing
Christian Brabandt <cb@256bit.org>
parents:
10042
diff
changeset
|
242 #ifndef SIGPROTOARG |
351cf7c67bbe
patch 8.0.1236: Mac features are confusing
Christian Brabandt <cb@256bit.org>
parents:
10042
diff
changeset
|
243 # define SIGPROTOARG (int) |
351cf7c67bbe
patch 8.0.1236: Mac features are confusing
Christian Brabandt <cb@256bit.org>
parents:
10042
diff
changeset
|
244 #endif |
351cf7c67bbe
patch 8.0.1236: Mac features are confusing
Christian Brabandt <cb@256bit.org>
parents:
10042
diff
changeset
|
245 #ifndef SIGDEFARG |
351cf7c67bbe
patch 8.0.1236: Mac features are confusing
Christian Brabandt <cb@256bit.org>
parents:
10042
diff
changeset
|
246 # define SIGDEFARG(s) (s) int s UNUSED; |
351cf7c67bbe
patch 8.0.1236: Mac features are confusing
Christian Brabandt <cb@256bit.org>
parents:
10042
diff
changeset
|
247 #endif |
351cf7c67bbe
patch 8.0.1236: Mac features are confusing
Christian Brabandt <cb@256bit.org>
parents:
10042
diff
changeset
|
248 #ifndef SIGDUMMYARG |
351cf7c67bbe
patch 8.0.1236: Mac features are confusing
Christian Brabandt <cb@256bit.org>
parents:
10042
diff
changeset
|
249 # define SIGDUMMYARG 0 |
351cf7c67bbe
patch 8.0.1236: Mac features are confusing
Christian Brabandt <cb@256bit.org>
parents:
10042
diff
changeset
|
250 #endif |
351cf7c67bbe
patch 8.0.1236: Mac features are confusing
Christian Brabandt <cb@256bit.org>
parents:
10042
diff
changeset
|
251 #undef HAVE_AVAIL_MEM |
351cf7c67bbe
patch 8.0.1236: Mac features are confusing
Christian Brabandt <cb@256bit.org>
parents:
10042
diff
changeset
|
252 #ifndef HAVE_CONFIG_H |
18753
6e3dc2d630c2
patch 8.1.2366: using old C style comments
Bram Moolenaar <Bram@vim.org>
parents:
15605
diff
changeset
|
253 //# define USE_SYSTEM // Output ship do debugger :(, but not compile |
6e3dc2d630c2
patch 8.1.2366: using old C style comments
Bram Moolenaar <Bram@vim.org>
parents:
15605
diff
changeset
|
254 # define HAVE_SYS_WAIT_H 1 // Attempt |
12716
351cf7c67bbe
patch 8.0.1236: Mac features are confusing
Christian Brabandt <cb@256bit.org>
parents:
10042
diff
changeset
|
255 # define HAVE_TERMIOS_H 1 |
351cf7c67bbe
patch 8.0.1236: Mac features are confusing
Christian Brabandt <cb@256bit.org>
parents:
10042
diff
changeset
|
256 # define SYS_SELECT_WITH_SYS_TIME 1 |
351cf7c67bbe
patch 8.0.1236: Mac features are confusing
Christian Brabandt <cb@256bit.org>
parents:
10042
diff
changeset
|
257 # define HAVE_SELECT 1 |
351cf7c67bbe
patch 8.0.1236: Mac features are confusing
Christian Brabandt <cb@256bit.org>
parents:
10042
diff
changeset
|
258 # define HAVE_SYS_SELECT_H 1 |
351cf7c67bbe
patch 8.0.1236: Mac features are confusing
Christian Brabandt <cb@256bit.org>
parents:
10042
diff
changeset
|
259 # define HAVE_PUTENV |
351cf7c67bbe
patch 8.0.1236: Mac features are confusing
Christian Brabandt <cb@256bit.org>
parents:
10042
diff
changeset
|
260 # define HAVE_SETENV |
351cf7c67bbe
patch 8.0.1236: Mac features are confusing
Christian Brabandt <cb@256bit.org>
parents:
10042
diff
changeset
|
261 # define HAVE_RENAME |
7 | 262 #endif |
263 | |
12716
351cf7c67bbe
patch 8.0.1236: Mac features are confusing
Christian Brabandt <cb@256bit.org>
parents:
10042
diff
changeset
|
264 #if !defined(HAVE_CONFIG_H) |
7 | 265 # define HAVE_PUTENV |
266 #endif | |
267 | |
18753
6e3dc2d630c2
patch 8.1.2366: using old C style comments
Bram Moolenaar <Bram@vim.org>
parents:
15605
diff
changeset
|
268 // A Mac constant causing big problem to syntax highlighting |
7 | 269 #define UNKNOWN_CREATOR '\?\?\?\?' |
29071
b90bca860b5a
patch 8.2.5057: using gettimeofday() for timeout is very inefficient
Bram Moolenaar <Bram@vim.org>
parents:
26771
diff
changeset
|
270 |
b90bca860b5a
patch 8.2.5057: using gettimeofday() for timeout is very inefficient
Bram Moolenaar <Bram@vim.org>
parents:
26771
diff
changeset
|
271 #ifdef FEAT_RELTIME |
b90bca860b5a
patch 8.2.5057: using gettimeofday() for timeout is very inefficient
Bram Moolenaar <Bram@vim.org>
parents:
26771
diff
changeset
|
272 |
b90bca860b5a
patch 8.2.5057: using gettimeofday() for timeout is very inefficient
Bram Moolenaar <Bram@vim.org>
parents:
26771
diff
changeset
|
273 # include <dispatch/dispatch.h> |
b90bca860b5a
patch 8.2.5057: using gettimeofday() for timeout is very inefficient
Bram Moolenaar <Bram@vim.org>
parents:
26771
diff
changeset
|
274 |
29100
c09c7ea83047
patch 8.2.5071: with some Mac OS version clockid_t is redefined
Bram Moolenaar <Bram@vim.org>
parents:
29079
diff
changeset
|
275 # ifndef MAC_OS_X_VERSION_10_12 |
29071
b90bca860b5a
patch 8.2.5057: using gettimeofday() for timeout is very inefficient
Bram Moolenaar <Bram@vim.org>
parents:
26771
diff
changeset
|
276 typedef int clockid_t; |
b90bca860b5a
patch 8.2.5057: using gettimeofday() for timeout is very inefficient
Bram Moolenaar <Bram@vim.org>
parents:
26771
diff
changeset
|
277 # endif |
b90bca860b5a
patch 8.2.5057: using gettimeofday() for timeout is very inefficient
Bram Moolenaar <Bram@vim.org>
parents:
26771
diff
changeset
|
278 # ifndef CLOCK_REALTIME |
29100
c09c7ea83047
patch 8.2.5071: with some Mac OS version clockid_t is redefined
Bram Moolenaar <Bram@vim.org>
parents:
29079
diff
changeset
|
279 # define CLOCK_REALTIME 0 |
29071
b90bca860b5a
patch 8.2.5057: using gettimeofday() for timeout is very inefficient
Bram Moolenaar <Bram@vim.org>
parents:
26771
diff
changeset
|
280 # endif |
b90bca860b5a
patch 8.2.5057: using gettimeofday() for timeout is very inefficient
Bram Moolenaar <Bram@vim.org>
parents:
26771
diff
changeset
|
281 # ifndef CLOCK_MONOTONIC |
29100
c09c7ea83047
patch 8.2.5071: with some Mac OS version clockid_t is redefined
Bram Moolenaar <Bram@vim.org>
parents:
29079
diff
changeset
|
282 # define CLOCK_MONOTONIC 1 |
29071
b90bca860b5a
patch 8.2.5057: using gettimeofday() for timeout is very inefficient
Bram Moolenaar <Bram@vim.org>
parents:
26771
diff
changeset
|
283 # endif |
b90bca860b5a
patch 8.2.5057: using gettimeofday() for timeout is very inefficient
Bram Moolenaar <Bram@vim.org>
parents:
26771
diff
changeset
|
284 |
b90bca860b5a
patch 8.2.5057: using gettimeofday() for timeout is very inefficient
Bram Moolenaar <Bram@vim.org>
parents:
26771
diff
changeset
|
285 struct itimerspec |
b90bca860b5a
patch 8.2.5057: using gettimeofday() for timeout is very inefficient
Bram Moolenaar <Bram@vim.org>
parents:
26771
diff
changeset
|
286 { |
b90bca860b5a
patch 8.2.5057: using gettimeofday() for timeout is very inefficient
Bram Moolenaar <Bram@vim.org>
parents:
26771
diff
changeset
|
287 struct timespec it_interval; // timer period |
b90bca860b5a
patch 8.2.5057: using gettimeofday() for timeout is very inefficient
Bram Moolenaar <Bram@vim.org>
parents:
26771
diff
changeset
|
288 struct timespec it_value; // initial expiration |
b90bca860b5a
patch 8.2.5057: using gettimeofday() for timeout is very inefficient
Bram Moolenaar <Bram@vim.org>
parents:
26771
diff
changeset
|
289 }; |
b90bca860b5a
patch 8.2.5057: using gettimeofday() for timeout is very inefficient
Bram Moolenaar <Bram@vim.org>
parents:
26771
diff
changeset
|
290 |
b90bca860b5a
patch 8.2.5057: using gettimeofday() for timeout is very inefficient
Bram Moolenaar <Bram@vim.org>
parents:
26771
diff
changeset
|
291 struct sigevent; |
b90bca860b5a
patch 8.2.5057: using gettimeofday() for timeout is very inefficient
Bram Moolenaar <Bram@vim.org>
parents:
26771
diff
changeset
|
292 |
b90bca860b5a
patch 8.2.5057: using gettimeofday() for timeout is very inefficient
Bram Moolenaar <Bram@vim.org>
parents:
26771
diff
changeset
|
293 struct macos_timer |
b90bca860b5a
patch 8.2.5057: using gettimeofday() for timeout is very inefficient
Bram Moolenaar <Bram@vim.org>
parents:
26771
diff
changeset
|
294 { |
b90bca860b5a
patch 8.2.5057: using gettimeofday() for timeout is very inefficient
Bram Moolenaar <Bram@vim.org>
parents:
26771
diff
changeset
|
295 dispatch_queue_t tim_queue; |
b90bca860b5a
patch 8.2.5057: using gettimeofday() for timeout is very inefficient
Bram Moolenaar <Bram@vim.org>
parents:
26771
diff
changeset
|
296 dispatch_source_t tim_timer; |
b90bca860b5a
patch 8.2.5057: using gettimeofday() for timeout is very inefficient
Bram Moolenaar <Bram@vim.org>
parents:
26771
diff
changeset
|
297 void (*tim_func)(union sigval); |
b90bca860b5a
patch 8.2.5057: using gettimeofday() for timeout is very inefficient
Bram Moolenaar <Bram@vim.org>
parents:
26771
diff
changeset
|
298 void *tim_arg; |
b90bca860b5a
patch 8.2.5057: using gettimeofday() for timeout is very inefficient
Bram Moolenaar <Bram@vim.org>
parents:
26771
diff
changeset
|
299 }; |
b90bca860b5a
patch 8.2.5057: using gettimeofday() for timeout is very inefficient
Bram Moolenaar <Bram@vim.org>
parents:
26771
diff
changeset
|
300 |
b90bca860b5a
patch 8.2.5057: using gettimeofday() for timeout is very inefficient
Bram Moolenaar <Bram@vim.org>
parents:
26771
diff
changeset
|
301 typedef struct macos_timer *timer_t; |
b90bca860b5a
patch 8.2.5057: using gettimeofday() for timeout is very inefficient
Bram Moolenaar <Bram@vim.org>
parents:
26771
diff
changeset
|
302 |
b90bca860b5a
patch 8.2.5057: using gettimeofday() for timeout is very inefficient
Bram Moolenaar <Bram@vim.org>
parents:
26771
diff
changeset
|
303 extern int timer_create( |
b90bca860b5a
patch 8.2.5057: using gettimeofday() for timeout is very inefficient
Bram Moolenaar <Bram@vim.org>
parents:
26771
diff
changeset
|
304 clockid_t clockid, |
b90bca860b5a
patch 8.2.5057: using gettimeofday() for timeout is very inefficient
Bram Moolenaar <Bram@vim.org>
parents:
26771
diff
changeset
|
305 struct sigevent *sevp, |
b90bca860b5a
patch 8.2.5057: using gettimeofday() for timeout is very inefficient
Bram Moolenaar <Bram@vim.org>
parents:
26771
diff
changeset
|
306 timer_t *timerid); |
b90bca860b5a
patch 8.2.5057: using gettimeofday() for timeout is very inefficient
Bram Moolenaar <Bram@vim.org>
parents:
26771
diff
changeset
|
307 |
b90bca860b5a
patch 8.2.5057: using gettimeofday() for timeout is very inefficient
Bram Moolenaar <Bram@vim.org>
parents:
26771
diff
changeset
|
308 extern int timer_delete(timer_t timerid); |
b90bca860b5a
patch 8.2.5057: using gettimeofday() for timeout is very inefficient
Bram Moolenaar <Bram@vim.org>
parents:
26771
diff
changeset
|
309 |
b90bca860b5a
patch 8.2.5057: using gettimeofday() for timeout is very inefficient
Bram Moolenaar <Bram@vim.org>
parents:
26771
diff
changeset
|
310 extern int timer_settime( |
b90bca860b5a
patch 8.2.5057: using gettimeofday() for timeout is very inefficient
Bram Moolenaar <Bram@vim.org>
parents:
26771
diff
changeset
|
311 timer_t timerid, int flags, |
b90bca860b5a
patch 8.2.5057: using gettimeofday() for timeout is very inefficient
Bram Moolenaar <Bram@vim.org>
parents:
26771
diff
changeset
|
312 const struct itimerspec *new_value, |
b90bca860b5a
patch 8.2.5057: using gettimeofday() for timeout is very inefficient
Bram Moolenaar <Bram@vim.org>
parents:
26771
diff
changeset
|
313 struct itimerspec *unused); |
b90bca860b5a
patch 8.2.5057: using gettimeofday() for timeout is very inefficient
Bram Moolenaar <Bram@vim.org>
parents:
26771
diff
changeset
|
314 |
b90bca860b5a
patch 8.2.5057: using gettimeofday() for timeout is very inefficient
Bram Moolenaar <Bram@vim.org>
parents:
26771
diff
changeset
|
315 #endif // FEAT_RELTIME |
b90bca860b5a
patch 8.2.5057: using gettimeofday() for timeout is very inefficient
Bram Moolenaar <Bram@vim.org>
parents:
26771
diff
changeset
|
316 |
b90bca860b5a
patch 8.2.5057: using gettimeofday() for timeout is very inefficient
Bram Moolenaar <Bram@vim.org>
parents:
26771
diff
changeset
|
317 #endif // OS_MAC__H |