comparison src/os_win32.c @ 3927:e6d8b44065bc v7.3.719

updated for version 7.3.719 Problem: Cannot run new version of cproto, it fails on missing include files. Solution: Add lots of #ifndef PROTO
author Bram Moolenaar <bram@vim.org>
date Tue, 20 Nov 2012 16:53:39 +0100
parents d24d309c365f
children d5b1d6177b37
comparison
equal deleted inserted replaced
3926:3ea4cfe2d1df 3927:e6d8b44065bc
27 #endif 27 #endif
28 28
29 #include <sys/types.h> 29 #include <sys/types.h>
30 #include <signal.h> 30 #include <signal.h>
31 #include <limits.h> 31 #include <limits.h>
32 #include <process.h> 32
33 /* cproto fails on missing include files */
34 #ifndef PROTO
35 # include <process.h>
36 #endif
33 37
34 #undef chdir 38 #undef chdir
35 #ifdef __GNUC__ 39 #ifdef __GNUC__
36 # ifndef __MINGW32__ 40 # ifndef __MINGW32__
37 # include <dirent.h> 41 # include <dirent.h>
38 # endif 42 # endif
39 #else 43 #else
40 # include <direct.h> 44 # include <direct.h>
41 #endif 45 #endif
42 46
43 #if defined(FEAT_TITLE) && !defined(FEAT_GUI_W32) 47 #ifndef PROTO
44 # include <shellapi.h> 48 # if defined(FEAT_TITLE) && !defined(FEAT_GUI_W32)
49 # include <shellapi.h>
50 # endif
45 #endif 51 #endif
46 52
47 #ifdef __MINGW32__ 53 #ifdef __MINGW32__
48 # ifndef FROM_LEFT_1ST_BUTTON_PRESSED 54 # ifndef FROM_LEFT_1ST_BUTTON_PRESSED
49 # define FROM_LEFT_1ST_BUTTON_PRESSED 0x0001 55 # define FROM_LEFT_1ST_BUTTON_PRESSED 0x0001
123 typedef int TOKEN_INFORMATION_CLASS; 129 typedef int TOKEN_INFORMATION_CLASS;
124 typedef int TRUSTEE; 130 typedef int TRUSTEE;
125 typedef int WORD; 131 typedef int WORD;
126 typedef int WCHAR; 132 typedef int WCHAR;
127 typedef void VOID; 133 typedef void VOID;
134 typedef int BY_HANDLE_FILE_INFORMATION;
128 #endif 135 #endif
129 136
130 #ifndef FEAT_GUI_W32 137 #ifndef FEAT_GUI_W32
131 /* Undocumented API in kernel32.dll needed to work around dead key bug in 138 /* Undocumented API in kernel32.dll needed to work around dead key bug in
132 * console-mode applications in NT 4.0. If you switch keyboard layouts 139 * console-mode applications in NT 4.0. If you switch keyboard layouts
150 #if defined(__BORLANDC__) 157 #if defined(__BORLANDC__)
151 /* Strangely Borland uses a non-standard name. */ 158 /* Strangely Borland uses a non-standard name. */
152 # define wcsicmp(a, b) wcscmpi((a), (b)) 159 # define wcsicmp(a, b) wcscmpi((a), (b))
153 #endif 160 #endif
154 161
162 #ifndef PROTO
163
155 /* Enable common dialogs input unicode from IME if posible. */ 164 /* Enable common dialogs input unicode from IME if posible. */
156 #ifdef FEAT_MBYTE 165 #ifdef FEAT_MBYTE
157 LRESULT (WINAPI *pDispatchMessage)(LPMSG) = DispatchMessage; 166 LRESULT (WINAPI *pDispatchMessage)(LPMSG) = DispatchMessage;
158 BOOL (WINAPI *pGetMessage)(LPMSG, HWND, UINT, UINT) = GetMessage; 167 BOOL (WINAPI *pGetMessage)(LPMSG, HWND, UINT, UINT) = GetMessage;
159 BOOL (WINAPI *pIsDialogMessage)(HWND, LPMSG) = IsDialogMessage; 168 BOOL (WINAPI *pIsDialogMessage)(HWND, LPMSG) = IsDialogMessage;
160 BOOL (WINAPI *pPeekMessage)(LPMSG, HWND, UINT, UINT, UINT) = PeekMessage; 169 BOOL (WINAPI *pPeekMessage)(LPMSG, HWND, UINT, UINT, UINT) = PeekMessage;
161 #endif 170 #endif
171
172 #endif /* PROTO */
162 173
163 #ifndef FEAT_GUI_W32 174 #ifndef FEAT_GUI_W32
164 /* Win32 Console handles for input and output */ 175 /* Win32 Console handles for input and output */
165 static HANDLE g_hConIn = INVALID_HANDLE_VALUE; 176 static HANDLE g_hConIn = INVALID_HANDLE_VALUE;
166 static HANDLE g_hConOut = INVALID_HANDLE_VALUE; 177 static HANDLE g_hConOut = INVALID_HANDLE_VALUE;
451 #endif 462 #endif
452 463
453 DWORD g_PlatformId; 464 DWORD g_PlatformId;
454 465
455 #ifdef HAVE_ACL 466 #ifdef HAVE_ACL
456 # include <aclapi.h> 467 # ifndef PROTO
468 # include <aclapi.h>
469 # endif
470
457 /* 471 /*
458 * These are needed to dynamically load the ADVAPI DLL, which is not 472 * These are needed to dynamically load the ADVAPI DLL, which is not
459 * implemented under Windows 95 (and causes VIM to crash) 473 * implemented under Windows 95 (and causes VIM to crash)
460 */ 474 */
461 typedef DWORD (WINAPI *PSNSECINFO) (LPTSTR, enum SE_OBJECT_TYPE, 475 typedef DWORD (WINAPI *PSNSECINFO) (LPTSTR, enum SE_OBJECT_TYPE,
1656 #else /* FEAT_GUI_W32 */ 1670 #else /* FEAT_GUI_W32 */
1657 return 0; 1671 return 0;
1658 #endif /* FEAT_GUI_W32 */ 1672 #endif /* FEAT_GUI_W32 */
1659 } 1673 }
1660 1674
1661 #ifndef __MINGW32__ 1675 #ifndef PROTO
1662 # include <shellapi.h> /* required for FindExecutable() */ 1676 # ifndef __MINGW32__
1677 # include <shellapi.h> /* required for FindExecutable() */
1678 # endif
1663 #endif 1679 #endif
1664 1680
1665 /* 1681 /*
1666 * Return TRUE if "name" is in $PATH. 1682 * Return TRUE if "name" is in $PATH.
1667 * TODO: Should somehow check if it's really executable. 1683 * TODO: Should somehow check if it's really executable.