Mercurial > vim
comparison src/os_win32.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 | 9f51d0cef8da |
children | 1cae476a7c82 |
comparison
equal
deleted
inserted
replaced
18752:9ec3c9cb4533 | 18753:6e3dc2d630c2 |
---|---|
8 | 8 |
9 /* | 9 /* |
10 * Win32 (Windows NT and Windows 95) machine-dependent things. | 10 * Win32 (Windows NT and Windows 95) machine-dependent things. |
11 */ | 11 */ |
12 | 12 |
13 #include "os_dos.h" /* common MS-DOS and Win32 stuff */ | 13 #include "os_dos.h" // common MS-DOS and Win32 stuff |
14 #ifndef __CYGWIN__ | 14 #ifndef __CYGWIN__ |
15 /* cproto fails on missing include files */ | 15 // cproto fails on missing include files |
16 # ifndef PROTO | 16 # ifndef PROTO |
17 # include <direct.h> /* for _mkdir() */ | 17 # include <direct.h> // for _mkdir() |
18 # endif | 18 # endif |
19 #endif | 19 #endif |
20 | 20 |
21 /* Stop the VC2005 compiler from nagging. */ | 21 // Stop the VC2005 compiler from nagging. |
22 #if _MSC_VER >= 1400 | 22 #if _MSC_VER >= 1400 |
23 # define _CRT_SECURE_NO_DEPRECATE | 23 # define _CRT_SECURE_NO_DEPRECATE |
24 # define _CRT_NONSTDC_NO_DEPRECATE | 24 # define _CRT_NONSTDC_NO_DEPRECATE |
25 #endif | 25 #endif |
26 | 26 |
27 #define BINARY_FILE_IO | 27 #define BINARY_FILE_IO |
28 #define USE_EXE_NAME /* use argv[0] for $VIM */ | 28 #define USE_EXE_NAME // use argv[0] for $VIM |
29 #define USE_TERM_CONSOLE | 29 #define USE_TERM_CONSOLE |
30 #ifndef HAVE_STRING_H | 30 #ifndef HAVE_STRING_H |
31 # define HAVE_STRING_H | 31 # define HAVE_STRING_H |
32 #endif | 32 #endif |
33 #ifndef HAVE_MATH_H | 33 #ifndef HAVE_MATH_H |
37 #ifndef __GNUC__ | 37 #ifndef __GNUC__ |
38 #define HAVE_STRICMP | 38 #define HAVE_STRICMP |
39 #define HAVE_STRNICMP | 39 #define HAVE_STRNICMP |
40 #endif | 40 #endif |
41 #ifndef HAVE_STRFTIME | 41 #ifndef HAVE_STRFTIME |
42 # define HAVE_STRFTIME /* guessed */ | 42 # define HAVE_STRFTIME // guessed |
43 #endif | 43 #endif |
44 #define HAVE_MEMSET | 44 #define HAVE_MEMSET |
45 #ifndef HAVE_LOCALE_H | 45 #ifndef HAVE_LOCALE_H |
46 # define HAVE_LOCALE_H 1 | 46 # define HAVE_LOCALE_H 1 |
47 #endif | 47 #endif |
48 #ifndef HAVE_FCNTL_H | 48 #ifndef HAVE_FCNTL_H |
49 # define HAVE_FCNTL_H | 49 # define HAVE_FCNTL_H |
50 #endif | 50 #endif |
51 #define HAVE_QSORT | 51 #define HAVE_QSORT |
52 #define HAVE_ST_MODE /* have stat.st_mode */ | 52 #define HAVE_ST_MODE // have stat.st_mode |
53 | 53 |
54 #define FEAT_SHORTCUT /* resolve shortcuts */ | 54 #define FEAT_SHORTCUT // resolve shortcuts |
55 | 55 |
56 #if (!defined(_MSC_VER) || _MSC_VER > 1020) | 56 #if (!defined(_MSC_VER) || _MSC_VER > 1020) |
57 /* | 57 /* |
58 * Access Control List (actually security info). | 58 * Access Control List (actually security info). |
59 * MSVC has acl stuff only in 5.0, not in 4.2, don't know about 4.3. | 59 * MSVC has acl stuff only in 5.0, not in 4.2, don't know about 4.3. |
60 */ | 60 */ |
61 # define HAVE_ACL | 61 # define HAVE_ACL |
62 #endif | 62 #endif |
63 | 63 |
64 #define USE_FNAME_CASE /* adjust case of file names */ | 64 #define USE_FNAME_CASE // adjust case of file names |
65 #if !defined(FEAT_CLIPBOARD) | 65 #if !defined(FEAT_CLIPBOARD) |
66 # define FEAT_CLIPBOARD /* include clipboard support */ | 66 # define FEAT_CLIPBOARD // include clipboard support |
67 #endif | 67 #endif |
68 #if defined(__DATE__) && defined(__TIME__) | 68 #if defined(__DATE__) && defined(__TIME__) |
69 # define HAVE_DATE_TIME | 69 # define HAVE_DATE_TIME |
70 #endif | 70 #endif |
71 #ifndef FEAT_GUI_MSWIN /* GUI works different */ | 71 #ifndef FEAT_GUI_MSWIN // GUI works different |
72 # define BREAKCHECK_SKIP 1 /* call mch_breakcheck() each time, it's fast */ | 72 # define BREAKCHECK_SKIP 1 // call mch_breakcheck() each time, it's fast |
73 #endif | 73 #endif |
74 | 74 |
75 #define HAVE_TOTAL_MEM | 75 #define HAVE_TOTAL_MEM |
76 | 76 |
77 #define HAVE_PUTENV /* at least Bcc 5.2 and MSC have it */ | 77 #define HAVE_PUTENV // at least Bcc 5.2 and MSC have it |
78 | 78 |
79 #if defined(FEAT_GUI_MSWIN) && !defined(VIMDLL) | 79 #if defined(FEAT_GUI_MSWIN) && !defined(VIMDLL) |
80 # define NO_CONSOLE /* don't included console-only code */ | 80 # define NO_CONSOLE // don't included console-only code |
81 #endif | 81 #endif |
82 | 82 |
83 /* toupper() is not really broken, but it's very slow. Probably because of | 83 // toupper() is not really broken, but it's very slow. Probably because of |
84 * using Unicode characters on Windows NT */ | 84 // using Unicode characters on Windows NT |
85 #define BROKEN_TOUPPER | 85 #define BROKEN_TOUPPER |
86 | 86 |
87 #define FNAME_ILLEGAL "\"*?><|" /* illegal characters in a file name */ | 87 #define FNAME_ILLEGAL "\"*?><|" // illegal characters in a file name |
88 | 88 |
89 #include <signal.h> | 89 #include <signal.h> |
90 #include <stdlib.h> | 90 #include <stdlib.h> |
91 #include <time.h> | 91 #include <time.h> |
92 #include <sys/types.h> | 92 #include <sys/types.h> |
93 | 93 |
94 #ifndef STRICT | 94 #ifndef STRICT |
95 # define STRICT | 95 # define STRICT |
96 #endif | 96 #endif |
97 #ifndef COBJMACROS | 97 #ifndef COBJMACROS |
98 # define COBJMACROS /* For OLE: Enable "friendlier" access to objects */ | 98 # define COBJMACROS // For OLE: Enable "friendlier" access to objects |
99 #endif | 99 #endif |
100 #ifndef PROTO | 100 #ifndef PROTO |
101 # include <windows.h> | 101 # include <windows.h> |
102 # ifndef SM_CXPADDEDBORDER | 102 # ifndef SM_CXPADDEDBORDER |
103 # define SM_CXPADDEDBORDER 92 | 103 # define SM_CXPADDEDBORDER 92 |
105 #endif | 105 #endif |
106 | 106 |
107 /* | 107 /* |
108 * Win32 has plenty of memory, use large buffers | 108 * Win32 has plenty of memory, use large buffers |
109 */ | 109 */ |
110 #define CMDBUFFSIZE 1024 /* size of the command processing buffer */ | 110 #define CMDBUFFSIZE 1024 // size of the command processing buffer |
111 | 111 |
112 /* _MAX_PATH is only 260 (stdlib.h), but we want more for the 'path' option, | 112 // _MAX_PATH is only 260 (stdlib.h), but we want more for the 'path' option, |
113 * thus use a larger number. */ | 113 // thus use a larger number. |
114 #define MAXPATHL 1024 | 114 #define MAXPATHL 1024 |
115 | 115 |
116 #ifndef BASENAMELEN | 116 #ifndef BASENAMELEN |
117 # define BASENAMELEN (_MAX_PATH - 5) /* length of base of file name */ | 117 # define BASENAMELEN (_MAX_PATH - 5) // length of base of file name |
118 #endif | 118 #endif |
119 | 119 |
120 #define TEMPNAMELEN _MAX_PATH /* length of temp file name path */ | 120 #define TEMPNAMELEN _MAX_PATH // length of temp file name path |
121 | 121 |
122 #ifndef DFLT_MAXMEM | 122 #ifndef DFLT_MAXMEM |
123 # define DFLT_MAXMEM (2*1024) /* use up to 2 Mbyte for a buffer */ | 123 # define DFLT_MAXMEM (2*1024) // use up to 2 Mbyte for a buffer |
124 #endif | 124 #endif |
125 | 125 |
126 #ifndef DFLT_MAXMEMTOT | 126 #ifndef DFLT_MAXMEMTOT |
127 # define DFLT_MAXMEMTOT (5*1024) /* use up to 5 Mbyte for Vim */ | 127 # define DFLT_MAXMEMTOT (5*1024) // use up to 5 Mbyte for Vim |
128 #endif | 128 #endif |
129 | 129 |
130 /* | 130 /* |
131 * Reparse Point | 131 * Reparse Point |
132 */ | 132 */ |
139 #ifndef IO_REPARSE_TAG_SYMLINK | 139 #ifndef IO_REPARSE_TAG_SYMLINK |
140 # define IO_REPARSE_TAG_SYMLINK 0xA000000C | 140 # define IO_REPARSE_TAG_SYMLINK 0xA000000C |
141 #endif | 141 #endif |
142 | 142 |
143 #if defined(_MSC_VER) | 143 #if defined(_MSC_VER) |
144 /* Support for __try / __except. All versions of MSVC are | 144 // Support for __try / __except. All versions of MSVC are |
145 * expected to have this. Any other compilers that support it? */ | 145 // expected to have this. Any other compilers that support it? |
146 # define HAVE_TRY_EXCEPT 1 | 146 # define HAVE_TRY_EXCEPT 1 |
147 # include <malloc.h> /* for _resetstkoflw() */ | 147 # include <malloc.h> // for _resetstkoflw() |
148 # if defined(_MSC_VER) && (_MSC_VER >= 1300) | 148 # if defined(_MSC_VER) && (_MSC_VER >= 1300) |
149 # define RESETSTKOFLW _resetstkoflw | 149 # define RESETSTKOFLW _resetstkoflw |
150 # else | 150 # else |
151 # define RESETSTKOFLW myresetstkoflw | 151 # define RESETSTKOFLW myresetstkoflw |
152 # define MYRESETSTKOFLW | 152 # define MYRESETSTKOFLW |
159 */ | 159 */ |
160 | 160 |
161 #ifdef _DEBUG | 161 #ifdef _DEBUG |
162 | 162 |
163 # if defined(_MSC_VER) && (_MSC_VER >= 1000) | 163 # if defined(_MSC_VER) && (_MSC_VER >= 1000) |
164 /* Use the new debugging tools in Visual C++ 4.x */ | 164 // Use the new debugging tools in Visual C++ 4.x |
165 # include <crtdbg.h> | 165 # include <crtdbg.h> |
166 # define ASSERT(f) _ASSERT(f) | 166 # define ASSERT(f) _ASSERT(f) |
167 # else | 167 # else |
168 # include <assert.h> | 168 # include <assert.h> |
169 # define ASSERT(f) assert(f) | 169 # define ASSERT(f) assert(f) |
174 # define TRACE1(sz, p1) Trace(_T(sz), p1) | 174 # define TRACE1(sz, p1) Trace(_T(sz), p1) |
175 # define TRACE2(sz, p1, p2) Trace(_T(sz), p1, p2) | 175 # define TRACE2(sz, p1, p2) Trace(_T(sz), p1, p2) |
176 # define TRACE3(sz, p1, p2, p3) Trace(_T(sz), p1, p2, p3) | 176 # define TRACE3(sz, p1, p2, p3) Trace(_T(sz), p1, p2, p3) |
177 # define TRACE4(sz, p1, p2, p3, p4) Trace(_T(sz), p1, p2, p3, p4) | 177 # define TRACE4(sz, p1, p2, p3, p4) Trace(_T(sz), p1, p2, p3, p4) |
178 | 178 |
179 /* In debug version, writes trace messages to debug stream */ | 179 // In debug version, writes trace messages to debug stream |
180 void __cdecl | 180 void __cdecl |
181 Trace(char *pszFormat, ...); | 181 Trace(char *pszFormat, ...); |
182 | 182 |
183 #else /* !_DEBUG */ | 183 #else // !_DEBUG |
184 | 184 |
185 /* These macros should all compile away to nothing */ | 185 // These macros should all compile away to nothing |
186 # define ASSERT(f) ((void)0) | 186 # define ASSERT(f) ((void)0) |
187 # define TRACE 1 ? (void)0 : printf | 187 # define TRACE 1 ? (void)0 : printf |
188 # define TRACE0(sz) | 188 # define TRACE0(sz) |
189 # define TRACE1(sz, p1) | 189 # define TRACE1(sz, p1) |
190 # define TRACE2(sz, p1, p2) | 190 # define TRACE2(sz, p1, p2) |
191 # define TRACE3(sz, p1, p2, p3) | 191 # define TRACE3(sz, p1, p2, p3) |
192 # define TRACE4(sz, p1, p2, p3, p4) | 192 # define TRACE4(sz, p1, p2, p3, p4) |
193 | 193 |
194 #endif /* !_DEBUG */ | 194 #endif // !_DEBUG |
195 | 195 |
196 | 196 |
197 #define ASSERT_POINTER(p, type) \ | 197 #define ASSERT_POINTER(p, type) \ |
198 ASSERT(((p) != NULL) && IsValidAddress((p), sizeof(type), FALSE)) | 198 ASSERT(((p) != NULL) && IsValidAddress((p), sizeof(type), FALSE)) |
199 | 199 |
204 # define HAVE_SETENV | 204 # define HAVE_SETENV |
205 #endif | 205 #endif |
206 #define mch_getenv(x) (char_u *)getenv((char *)(x)) | 206 #define mch_getenv(x) (char_u *)getenv((char *)(x)) |
207 #define vim_mkdir(x, y) mch_mkdir(x) | 207 #define vim_mkdir(x, y) mch_mkdir(x) |
208 | 208 |
209 /* Enable common dialogs input unicode from IME if possible. */ | 209 // Enable common dialogs input unicode from IME if possible. |
210 #define pDispatchMessage DispatchMessageW | 210 #define pDispatchMessage DispatchMessageW |
211 #define pGetMessage GetMessageW | 211 #define pGetMessage GetMessageW |
212 #define pIsDialogMessage IsDialogMessageW | 212 #define pIsDialogMessage IsDialogMessageW |
213 #define pPeekMessage PeekMessageW | 213 #define pPeekMessage PeekMessageW |