Mercurial > vim
annotate src/os_win32.h @ 7699:854302b82ff9 v7.4.1148
commit https://github.com/vim/vim/commit/e5f2be61595fbbba77261f3bf1e032fe03a1966d
Author: Bram Moolenaar <Bram@vim.org>
Date: Thu Jan 21 20:24:34 2016 +0100
patch 7.4.1148
Problem: Default for MingW and Cygwin is still "normal".
Solution: Use "huge" as default. (Ken Takata)
author | Christian Brabandt <cb@256bit.org> |
---|---|
date | Thu, 21 Jan 2016 20:30:04 +0100 |
parents | 1420ccc9f610 |
children | cfed0e9f0ca2 |
rev | line source |
---|---|
7 | 1 /* vi:set ts=8 sts=4 sw=4: |
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 | |
9 /* | |
10 * Win32 (Windows NT and Windows 95) machine-dependent things. | |
11 */ | |
12 | |
13 #include "os_dos.h" /* common MS-DOS and Win32 stuff */ | |
14 #ifndef __CYGWIN__ | |
3927 | 15 /* cproto fails on missing include files */ |
16 # ifndef PROTO | |
17 # include <direct.h> /* for _mkdir() */ | |
18 # endif | |
7 | 19 #endif |
20 | |
638 | 21 /* Stop the VC2005 compiler from nagging. */ |
22 #if _MSC_VER >= 1400 | |
23 # define _CRT_SECURE_NO_DEPRECATE | |
24 # define _CRT_NONSTDC_NO_DEPRECATE | |
25 #endif | |
26 | |
7 | 27 #define BINARY_FILE_IO |
28 #define USE_EXE_NAME /* use argv[0] for $VIM */ | |
29 #define SYNC_DUP_CLOSE /* sync() a file with dup() and close() */ | |
30 #define USE_TERM_CONSOLE | |
31 #ifndef HAVE_STRING_H | |
32 # define HAVE_STRING_H | |
33 #endif | |
1620 | 34 #ifndef HAVE_MATH_H |
35 # define HAVE_MATH_H | |
36 #endif | |
7 | 37 #define HAVE_STRCSPN |
38 #ifndef __GNUC__ | |
39 #define HAVE_STRICMP | |
40 #define HAVE_STRNICMP | |
41 #endif | |
42 #ifndef HAVE_STRFTIME | |
43 # define HAVE_STRFTIME /* guessed */ | |
44 #endif | |
45 #define HAVE_MEMSET | |
46 #ifndef HAVE_LOCALE_H | |
47 # define HAVE_LOCALE_H 1 | |
48 #endif | |
49 #ifndef HAVE_FCNTL_H | |
50 # define HAVE_FCNTL_H | |
51 #endif | |
52 #ifndef HAVE_STDARG_H | |
53 # define HAVE_STDARG_H | |
54 #endif | |
55 #define HAVE_QSORT | |
56 #define HAVE_ST_MODE /* have stat.st_mode */ | |
57 | |
58 #define FEAT_SHORTCUT /* resolve shortcuts */ | |
59 | |
5049
72fcf674e545
updated for version 7.3.1268
Bram Moolenaar <bram@vim.org>
parents:
4789
diff
changeset
|
60 #if (!defined(__BORLANDC__) || __BORLANDC__ >= 0x550) \ |
7 | 61 && (!defined(_MSC_VER) || _MSC_VER > 1020) |
62 /* | |
63 * Access Control List (actually security info). | |
5049
72fcf674e545
updated for version 7.3.1268
Bram Moolenaar <bram@vim.org>
parents:
4789
diff
changeset
|
64 * Borland has the acl stuff only in version 5.5 and later. |
7 | 65 * MSVC in 5.0, not in 4.2, don't know about 4.3. |
66 */ | |
67 # define HAVE_ACL | |
68 #endif | |
69 | |
70 #define USE_FNAME_CASE /* adjust case of file names */ | |
5735 | 71 #if !defined(FEAT_CLIPBOARD) && defined(FEAT_MOUSE) |
7 | 72 # define FEAT_CLIPBOARD /* include clipboard support */ |
73 #endif | |
74 #if defined(__DATE__) && defined(__TIME__) | |
75 # define HAVE_DATE_TIME | |
76 #endif | |
77 #ifndef FEAT_GUI_W32 /* GUI works different */ | |
78 # define BREAKCHECK_SKIP 1 /* call mch_breakcheck() each time, it's fast */ | |
79 #endif | |
80 | |
7460
1420ccc9f610
commit https://github.com/vim/vim/commit/ee2739787f1e996739541bb60e6003b892497e03
Christian Brabandt <cb@256bit.org>
parents:
5735
diff
changeset
|
81 #define HAVE_TOTAL_MEM |
1420ccc9f610
commit https://github.com/vim/vim/commit/ee2739787f1e996739541bb60e6003b892497e03
Christian Brabandt <cb@256bit.org>
parents:
5735
diff
changeset
|
82 |
7 | 83 #define HAVE_PUTENV /* at least Bcc 5.2 and MSC have it */ |
84 | |
85 #ifdef FEAT_GUI_W32 | |
86 # define NO_CONSOLE /* don't included console-only code */ | |
87 #endif | |
88 | |
89 /* toupper() is not really broken, but it's very slow. Probably because of | |
90 * using Unicode characters on Windows NT */ | |
91 #define BROKEN_TOUPPER | |
92 | |
93 #define FNAME_ILLEGAL "\"*?><|" /* illegal characters in a file name */ | |
94 | |
95 #include <stdlib.h> | |
96 #include <time.h> | |
2241
60da25e3aab7
Correct use of long instead of off_t for file size. (James Vega)
Bram Moolenaar <bram@vim.org>
parents:
1620
diff
changeset
|
97 #include <sys/types.h> |
7 | 98 |
99 #ifndef STRICT | |
100 # define STRICT | |
101 #endif | |
102 #ifndef COBJMACROS | |
103 # define COBJMACROS /* For OLE: Enable "friendlier" access to objects */ | |
104 #endif | |
3927 | 105 #ifndef PROTO |
106 # include <windows.h> | |
5225
8f983df0299f
updated for version 7.4a.038
Bram Moolenaar <bram@vim.org>
parents:
5049
diff
changeset
|
107 # ifndef SM_CXPADDEDBORDER |
8f983df0299f
updated for version 7.4a.038
Bram Moolenaar <bram@vim.org>
parents:
5049
diff
changeset
|
108 # define SM_CXPADDEDBORDER 92 |
8f983df0299f
updated for version 7.4a.038
Bram Moolenaar <bram@vim.org>
parents:
5049
diff
changeset
|
109 # endif |
3927 | 110 #endif |
7 | 111 |
112 /* | |
113 * Win32 has plenty of memory, use large buffers | |
114 */ | |
115 #define CMDBUFFSIZE 1024 /* size of the command processing buffer */ | |
116 | |
3902 | 117 /* _MAX_PATH is only 260 (stdlib.h), but we want more for the 'path' option, |
7 | 118 * thus use a larger number. */ |
119 #define MAXPATHL 1024 | |
120 | |
121 #ifndef BASENAMELEN | |
122 # define BASENAMELEN (_MAX_PATH - 5) /* length of base of file name */ | |
123 #endif | |
124 | |
125 #define TEMPNAMELEN _MAX_PATH /* length of temp file name path */ | |
126 | |
127 #ifndef DFLT_MAXMEM | |
128 # define DFLT_MAXMEM (2*1024) /* use up to 2 Mbyte for a buffer */ | |
129 #endif | |
130 | |
131 #ifndef DFLT_MAXMEMTOT | |
132 # define DFLT_MAXMEMTOT (5*1024) /* use up to 5 Mbyte for Vim */ | |
133 #endif | |
134 | |
5376 | 135 /* |
136 * Reparse Point | |
137 */ | |
138 #ifndef FILE_ATTRIBUTE_REPARSE_POINT | |
139 # define FILE_ATTRIBUTE_REPARSE_POINT 0x00000400 | |
140 #endif | |
141 #ifndef IO_REPARSE_TAG_MOUNT_POINT | |
142 # define IO_REPARSE_TAG_MOUNT_POINT 0xA0000003 | |
143 #endif | |
144 #ifndef IO_REPARSE_TAG_SYMLINK | |
145 # define IO_REPARSE_TAG_SYMLINK 0xA000000C | |
146 #endif | |
147 | |
7 | 148 #if defined(_MSC_VER) || defined(__BORLANDC__) |
149 /* Support for __try / __except. All versions of MSVC and Borland C are | |
150 * expected to have this. Any other compilers that support it? */ | |
151 # define HAVE_TRY_EXCEPT 1 | |
152 # include <malloc.h> /* for _resetstkoflw() */ | |
153 # if defined(_MSC_VER) && (_MSC_VER >= 1300) | |
154 # define RESETSTKOFLW _resetstkoflw | |
155 # else | |
156 # define RESETSTKOFLW myresetstkoflw | |
157 # define MYRESETSTKOFLW | |
158 # endif | |
159 #endif | |
160 | |
161 /* | |
162 * Some simple debugging macros that look and behave a lot like their | |
163 * namesakes in MFC. | |
164 */ | |
165 | |
166 #ifdef _DEBUG | |
167 | |
168 # if defined(_MSC_VER) && (_MSC_VER >= 1000) | |
169 /* Use the new debugging tools in Visual C++ 4.x */ | |
170 # include <crtdbg.h> | |
171 # define ASSERT(f) _ASSERT(f) | |
172 # else | |
173 # include <assert.h> | |
174 # define ASSERT(f) assert(f) | |
175 # endif | |
176 | |
177 # define TRACE Trace | |
178 # define TRACE0(sz) Trace(_T("%s"), _T(sz)) | |
179 # define TRACE1(sz, p1) Trace(_T(sz), p1) | |
180 # define TRACE2(sz, p1, p2) Trace(_T(sz), p1, p2) | |
181 # define TRACE3(sz, p1, p2, p3) Trace(_T(sz), p1, p2, p3) | |
182 # define TRACE4(sz, p1, p2, p3, p4) Trace(_T(sz), p1, p2, p3, p4) | |
183 | |
184 /* In debug version, writes trace messages to debug stream */ | |
185 void __cdecl | |
186 Trace(char *pszFormat, ...); | |
187 | |
188 #else /* !_DEBUG */ | |
189 | |
190 /* These macros should all compile away to nothing */ | |
191 # define ASSERT(f) ((void)0) | |
192 # define TRACE 1 ? (void)0 : printf | |
193 # define TRACE0(sz) | |
194 # define TRACE1(sz, p1) | |
195 # define TRACE2(sz, p1, p2) | |
196 # define TRACE3(sz, p1, p2, p3) | |
197 # define TRACE4(sz, p1, p2, p3, p4) | |
198 | |
199 #endif /* !_DEBUG */ | |
200 | |
201 | |
202 #define ASSERT_POINTER(p, type) \ | |
203 ASSERT(((p) != NULL) && IsValidAddress((p), sizeof(type), FALSE)) | |
204 | |
205 #define ASSERT_NULL_OR_POINTER(p, type) \ | |
206 ASSERT(((p) == NULL) || IsValidAddress((p), sizeof(type), FALSE)) | |
207 | |
208 #define mch_setenv(name, val, x) setenv(name, val, x) | |
209 #define mch_getenv(x) (char_u *)getenv((char *)(x)) | |
210 #ifdef __BORLANDC__ | |
211 # define vim_mkdir(x, y) mkdir(x) | |
212 #else | |
2803 | 213 # define vim_mkdir(x, y) mch_mkdir(x) |
7 | 214 #endif |
3010 | 215 |
3927 | 216 #ifndef PROTO |
217 | |
4352 | 218 /* Enable common dialogs input unicode from IME if possible. */ |
3010 | 219 #ifdef FEAT_MBYTE |
220 /* The variables are defined in os_win32.c. */ | |
4238 | 221 extern LRESULT (WINAPI *pDispatchMessage)(CONST MSG *); |
3010 | 222 extern BOOL (WINAPI *pGetMessage)(LPMSG, HWND, UINT, UINT); |
223 extern BOOL (WINAPI *pIsDialogMessage)(HWND, LPMSG); | |
224 extern BOOL (WINAPI *pPeekMessage)(LPMSG, HWND, UINT, UINT, UINT); | |
225 #else | |
226 # define pDispatchMessage DispatchMessage | |
227 # define pGetMessage GetMessage | |
228 # define pIsDialogMessage IsDialogMessage | |
229 # define pPeekMessage PeekMessage | |
230 #endif | |
3927 | 231 |
232 #endif /* PROTO */ |