Mirror of the Vim source from https://github.com/vim/vim
Révision | 9fbb40a1228a4d8a5f26d1dff8e2ab4e3bd870fe (tree) |
---|---|
l'heure | 2008-03-16 22:54:13 |
Auteur | vimboss |
Commiter | vimboss |
updated for version 7.1-282
@@ -24,7 +24,7 @@ | ||
24 | 24 | gvimext.obj: gvimext.h |
25 | 25 | |
26 | 26 | .cpp.obj: |
27 | - $(cc) $(cflags) -DFEAT_GETTEXT $(cvarsdll) $*.cpp | |
27 | + $(cc) $(cflags) -DFEAT_GETTEXT $(cvarsmt) $*.cpp | |
28 | 28 | |
29 | 29 | gvimext.res: gvimext.rc |
30 | 30 | $(rc) $(rcflags) $(rcvars) gvimext.rc |
@@ -82,9 +82,8 @@ | ||
82 | 82 | |ms-platform-sdk|, |dotnet-1.1-redist|, |dotnet-1.1-sdk|, |
83 | 83 | and |windbg-download|. |
84 | 84 | |
85 | -It's easier to download Visual C++ 2005 Express Edition, |msvc-2005-express|. | |
86 | -The advantage of the VC 2003 Toolkit is that it will be freely available | |
87 | -long after VC 2005 Express Edition stops being free in November 2006. | |
85 | +It's easier to download Visual C++ 2008 Express Edition, |msvc-2008-express|, | |
86 | +which is freely available in perpetuity. | |
88 | 87 | |
89 | 88 | The free Code::Blocks IDE works with the VC2003 Toolkit, as described at |
90 | 89 | http://wiki.codeblocks.org/index.php?title=Integrating_Microsoft_Visual_Toolkit_2003_with_Code::Blocks_IDE |
@@ -152,6 +151,14 @@ | ||
152 | 151 | http://msdn.microsoft.com/vstudio/express/visualc/usingpsdk/default.aspx |
153 | 152 | |
154 | 153 | |
154 | +Visual C++ 2008 Express Edition *msvc-2008-express* | |
155 | +------------------------------- | |
156 | + | |
157 | +Visual C++ 2008 Express Edition can be downloaded for free from: | |
158 | + http://msdn2.microsoft.com/en-us/express/default.aspx | |
159 | +This includes the IDE and the debugger. You can build Vim with Make_mvc.mak. | |
160 | + | |
161 | + | |
155 | 162 | 2. MinGW |
156 | 163 | ======== |
157 | 164 |
@@ -1,6 +1,7 @@ | ||
1 | 1 | # Makefile for Vim on Win32 (Windows NT/2000/XP/2003 and Windows 95/98/Me) |
2 | 2 | # and Win64, using the Microsoft Visual C++ compilers. Known to work with |
3 | -# VC5, VC6 (VS98), VC7.0 (VS2002), VC7.1 (VS2003), and VC8 (VS2005). | |
3 | +# VC5, VC6 (VS98), VC7.0 (VS2002), VC7.1 (VS2003), VC8 (VS2005), | |
4 | +# and VC9 (VS2008). | |
4 | 5 | # |
5 | 6 | # To build using other Windows compilers, see INSTALLpc.txt |
6 | 7 | # |
@@ -285,7 +286,8 @@ | ||
285 | 286 | # need shell32.lib for ExtractIcon() |
286 | 287 | # gdi32.lib and comdlg32.lib for printing support |
287 | 288 | # ole32.lib and uuid.lib are needed for FEAT_SHORTCUT |
288 | -CON_LIB = advapi32.lib shell32.lib gdi32.lib comdlg32.lib ole32.lib uuid.lib | |
289 | +CON_LIB = oldnames.lib kernel32.lib advapi32.lib shell32.lib gdi32.lib \ | |
290 | + comdlg32.lib ole32.lib uuid.lib /machine:$(CPU) /nodefaultlib | |
289 | 291 | !if "$(DELAYLOAD)" == "yes" |
290 | 292 | CON_LIB = $(CON_LIB) /DELAYLOAD:comdlg32.dll /DELAYLOAD:ole32.dll DelayImp.lib |
291 | 293 | !endif |
@@ -331,6 +333,7 @@ | ||
331 | 333 | !endif |
332 | 334 | !if "$(_NMAKE_VER)" == "6.00.8168.0" |
333 | 335 | MSVCVER = 6.0 |
336 | +CPU = ix86 | |
334 | 337 | !endif |
335 | 338 | !if "$(_NMAKE_VER)" == "7.00.9466" |
336 | 339 | MSVCVER = 7.0 |
@@ -344,6 +347,9 @@ | ||
344 | 347 | !if "$(_NMAKE_VER)" == "8.00.50727.762" |
345 | 348 | MSVCVER = 8.0 |
346 | 349 | !endif |
350 | +!if "$(_NMAKE_VER)" == "9.00.20706.01" | |
351 | +MSVCVER = 9.0 | |
352 | +!endif | |
347 | 353 | !endif |
348 | 354 | |
349 | 355 | # Abort bulding VIM if version of VC is unrecognised. |
@@ -352,13 +358,13 @@ | ||
352 | 358 | !message Cannot determine Visual C version being used. If you are using the |
353 | 359 | !message Windows SDK then you must have the environment variable MSVCVER set to |
354 | 360 | !message your version of the VC compiler. If you are not using the Express |
355 | -!message version of Visual C you van either set MSVCVER or update this makefile | |
356 | -!message to handle the new value for _NMAKE_VER. | |
361 | +!message version of Visual C, you can either set MSVCVER or update this makefile | |
362 | +!message to handle the new value for _NMAKE_VER, "$(_NMAKE_VER)". | |
357 | 363 | !error Make aborted. |
358 | 364 | !endif |
359 | 365 | |
360 | 366 | # Convert processor ID to MVC-compatible number |
361 | -!if "$(MSVCVER)" != "8.0" | |
367 | +!if ("$(MSVCVER)" != "8.0") && ("$(MSVCVER)" != "9.0") | |
362 | 368 | !if "$(CPUNR)" == "i386" |
363 | 369 | CPUARG = /G3 |
364 | 370 | !elseif "$(CPUNR)" == "i486" |
@@ -373,7 +379,7 @@ | ||
373 | 379 | CPUARG = |
374 | 380 | !endif |
375 | 381 | !else |
376 | -# VC8 only allows specifying SSE architecture | |
382 | +# VC8/9 only allows specifying SSE architecture | |
377 | 383 | !if "$(CPUNR)" == "pentium4" |
378 | 384 | CPUARG = /arch:SSE2 |
379 | 385 | !endif |
@@ -391,7 +397,7 @@ | ||
391 | 397 | !else # MAXSPEED |
392 | 398 | OPTFLAG = /Ox |
393 | 399 | !endif |
394 | -!if "$(MSVCVER)" == "8.0" | |
400 | +!if ("$(MSVCVER)" == "8.0") || ("$(MSVCVER)" == "9.0") | |
395 | 401 | # Use link time code generation if not worried about size |
396 | 402 | !if "$(OPTIMIZE)" != "SPACE" |
397 | 403 | OPTFLAG = $(OPTFLAG) /GL |
@@ -404,11 +410,11 @@ | ||
404 | 410 | LIBC = msvcrt.lib |
405 | 411 | ! else |
406 | 412 | LIBC = libcmt.lib |
407 | -CFLAGS = $(CFLAGS) /MT | |
413 | +CFLAGS = $(CFLAGS) /Zl /MT | |
408 | 414 | ! endif |
409 | 415 | !else # DEBUG |
410 | 416 | VIM = vimd |
411 | -! if "$(CPU)" == "i386" | |
417 | +! if ("$(CPU)" == "i386") || ("$(CPU)" == "ix86") | |
412 | 418 | DEBUGINFO = /ZI |
413 | 419 | ! endif |
414 | 420 | CFLAGS = $(CFLAGS) -D_DEBUG -DDEBUG /Od |
@@ -424,7 +430,7 @@ | ||
424 | 430 | LIBC = $(LIBC) msvcrtd.lib |
425 | 431 | ! else |
426 | 432 | LIBC = $(LIBC) libcmtd.lib |
427 | -CFLAGS = $(CFLAGS) /MTd | |
433 | +CFLAGS = $(CFLAGS) /Zl /MTd | |
428 | 434 | ! endif |
429 | 435 | !endif # DEBUG |
430 | 436 |
@@ -534,7 +540,7 @@ | ||
534 | 540 | $(OUTDIR)\gui_w32.obj \ |
535 | 541 | $(OUTDIR)\os_w32exe.obj |
536 | 542 | GUI_LIB = \ |
537 | - oldnames.lib kernel32.lib gdi32.lib version.lib $(IME_LIB) \ | |
543 | + gdi32.lib version.lib $(IME_LIB) \ | |
538 | 544 | winspool.lib comctl32.lib advapi32.lib shell32.lib \ |
539 | 545 | /machine:$(CPU) /nodefaultlib |
540 | 546 | !else |
@@ -757,7 +763,7 @@ | ||
757 | 763 | |
758 | 764 | # Report link time code generation progress if used. |
759 | 765 | !ifdef NODEBUG |
760 | -!if "$(MSVCVER)" == "8.0" | |
766 | +!if ("$(MSVCVER)" == "8.0") || ("$(MSVCVER)" == "9.0") | |
761 | 767 | !if "$(OPTIMIZE)" != "SPACE" |
762 | 768 | LINKARGS1 = $(LINKARGS1) /LTCG:STATUS |
763 | 769 | !endif |
@@ -1365,7 +1365,7 @@ | ||
1365 | 1365 | |
1366 | 1366 | printf("Creating \"Edit with Vim\" popup menu entry\n"); |
1367 | 1367 | |
1368 | - fprintf(fd, "HKEY_CLASSES_ROOT\\CLSID\\%s\n", vim_ext_clsid); | |
1368 | + fprintf(fd, "[HKEY_CLASSES_ROOT\\CLSID\\%s]\n", vim_ext_clsid); | |
1369 | 1369 | fprintf(fd, "@=\"%s\"\n", vim_ext_name); |
1370 | 1370 | fprintf(fd, "[HKEY_CLASSES_ROOT\\CLSID\\%s\\InProcServer32]\n", |
1371 | 1371 | vim_ext_clsid); |
@@ -34,6 +34,12 @@ | ||
34 | 34 | extern HWND vim_parent_hwnd; |
35 | 35 | } |
36 | 36 | |
37 | +#if _MSC_VER < 1300 | |
38 | +/* Work around old versions of basetsd.h which wrongly declares | |
39 | + * UINT_PTR as unsigned long */ | |
40 | +# define UINT_PTR UINT | |
41 | +#endif | |
42 | + | |
37 | 43 | #include "if_ole.h" // Interface definitions |
38 | 44 | #include "iid_ole.c" // UUID definitions (compile here) |
39 | 45 |
@@ -107,7 +113,7 @@ | ||
107 | 113 | STDMETHOD(SendKeys)(BSTR keys); |
108 | 114 | STDMETHOD(Eval)(BSTR expr, BSTR *result); |
109 | 115 | STDMETHOD(SetForeground)(void); |
110 | - STDMETHOD(GetHwnd)(UINT *result); | |
116 | + STDMETHOD(GetHwnd)(UINT_PTR *result); | |
111 | 117 | |
112 | 118 | private: |
113 | 119 | // Constructor is private - create using CVim::Create() |
@@ -288,9 +294,9 @@ | ||
288 | 294 | } |
289 | 295 | |
290 | 296 | STDMETHODIMP |
291 | -CVim::GetHwnd(UINT *result) | |
297 | +CVim::GetHwnd(UINT_PTR *result) | |
292 | 298 | { |
293 | - *result = (UINT) s_hwnd; | |
299 | + *result = (UINT_PTR)s_hwnd; | |
294 | 300 | return S_OK; |
295 | 301 | } |
296 | 302 |
@@ -79,7 +79,7 @@ | ||
79 | 79 | virtual HRESULT STDMETHODCALLTYPE SetForeground( void) = 0; |
80 | 80 | |
81 | 81 | virtual HRESULT STDMETHODCALLTYPE GetHwnd( |
82 | - /* [retval][out] */ UINT __RPC_FAR *result) = 0; | |
82 | + /* [retval][out] */ UINT_PTR __RPC_FAR *result) = 0; | |
83 | 83 | |
84 | 84 | }; |
85 | 85 |
@@ -143,7 +143,7 @@ | ||
143 | 143 | |
144 | 144 | HRESULT ( STDMETHODCALLTYPE __RPC_FAR *GetHwnd )( |
145 | 145 | IVim __RPC_FAR * This, |
146 | - /* [retval][out] */ UINT __RPC_FAR *result); | |
146 | + /* [retval][out] */ UINT_PTR __RPC_FAR *result); | |
147 | 147 | |
148 | 148 | END_INTERFACE |
149 | 149 | } IVimVtbl; |
@@ -236,7 +236,7 @@ | ||
236 | 236 | |
237 | 237 | HRESULT STDMETHODCALLTYPE IVim_GetHwnd_Proxy( |
238 | 238 | IVim __RPC_FAR * This, |
239 | - /* [retval][out] */ UINT __RPC_FAR *result); | |
239 | + /* [retval][out] */ UINT_PTR __RPC_FAR *result); | |
240 | 240 | |
241 | 241 | |
242 | 242 | void __RPC_STUB IVim_GetHwnd_Stub( |
@@ -20,7 +20,7 @@ | ||
20 | 20 | HRESULT SendKeys([in]BSTR keys); |
21 | 21 | HRESULT Eval([in]BSTR expr, [out, retval]BSTR* result); |
22 | 22 | HRESULT SetForeground(void); |
23 | - HRESULT GetHwnd([out, retval]UINT* result); | |
23 | + HRESULT GetHwnd([out, retval]UINT_PTR* result); | |
24 | 24 | }; |
25 | 25 | |
26 | 26 | // Component and type library definitions |
@@ -2856,7 +2856,7 @@ | ||
2856 | 2856 | windgoto((int)Rows - 1, 0); |
2857 | 2857 | g_fForceExit = TRUE; |
2858 | 2858 | |
2859 | - sprintf((char *)IObuff, _("Vim: Caught %s event\n"), | |
2859 | + vim_snprintf((char *)IObuff, IOSIZE, _("Vim: Caught %s event\n"), | |
2860 | 2860 | (dwCtrlType == CTRL_CLOSE_EVENT |
2861 | 2861 | ? _("close") |
2862 | 2862 | : dwCtrlType == CTRL_LOGOFF_EVENT |
@@ -3282,12 +3282,13 @@ | ||
3282 | 3282 | { |
3283 | 3283 | /* we use "command" or "cmd" to start the shell; slow but easy */ |
3284 | 3284 | char_u *newcmd; |
3285 | - | |
3286 | - newcmd = lalloc((long_u) ( | |
3285 | + long_u cmdlen = ( | |
3287 | 3286 | #ifdef FEAT_GUI_W32 |
3288 | 3287 | STRLEN(vimrun_path) + |
3289 | 3288 | #endif |
3290 | - STRLEN(p_sh) + STRLEN(p_shcf) + STRLEN(cmd) + 10), TRUE); | |
3289 | + STRLEN(p_sh) + STRLEN(p_shcf) + STRLEN(cmd) + 10); | |
3290 | + | |
3291 | + newcmd = lalloc(cmdlen, TRUE); | |
3291 | 3292 | if (newcmd != NULL) |
3292 | 3293 | { |
3293 | 3294 | char_u *cmdbase = (*cmd == '"' ? cmd + 1 : cmd); |
@@ -3373,14 +3374,15 @@ | ||
3373 | 3374 | if (!s_dont_use_vimrun) |
3374 | 3375 | /* Use vimrun to execute the command. It opens a console |
3375 | 3376 | * window, which can be closed without killing Vim. */ |
3376 | - sprintf((char *)newcmd, "%s%s%s %s %s", | |
3377 | + vim_snprintf((char *)newcmd, cmdlen, "%s%s%s %s %s", | |
3377 | 3378 | vimrun_path, |
3378 | 3379 | (msg_silent != 0 || (options & SHELL_DOOUT)) |
3379 | 3380 | ? "-s " : "", |
3380 | 3381 | p_sh, p_shcf, cmd); |
3381 | 3382 | else |
3382 | 3383 | #endif |
3383 | - sprintf((char *)newcmd, "%s %s %s", p_sh, p_shcf, cmd); | |
3384 | + vim_snprintf((char *)newcmd, cmdlen, "%s %s %s", | |
3385 | + p_sh, p_shcf, cmd); | |
3384 | 3386 | x = mch_system((char *)newcmd, options); |
3385 | 3387 | } |
3386 | 3388 | vim_free(newcmd); |
@@ -4664,12 +4666,29 @@ | ||
4664 | 4666 | # endif |
4665 | 4667 | ) |
4666 | 4668 | { |
4669 | +# if defined(DEBUG) && _MSC_VER > 1200 | |
4670 | + /* Work around an annoying assertion in the Microsoft debug CRT | |
4671 | + * when mode's text/binary setting doesn't match _get_fmode(). */ | |
4672 | + char newMode = mode[strlen(mode) - 1]; | |
4673 | + int oldMode = 0; | |
4674 | + | |
4675 | + _get_fmode(&oldMode); | |
4676 | + if (newMode == 't') | |
4677 | + _set_fmode(_O_TEXT); | |
4678 | + else if (newMode == 'b') | |
4679 | + _set_fmode(_O_BINARY); | |
4680 | +# endif | |
4667 | 4681 | wn = enc_to_ucs2(name, NULL); |
4668 | 4682 | wm = enc_to_ucs2(mode, NULL); |
4669 | 4683 | if (wn != NULL && wm != NULL) |
4670 | 4684 | f = _wfopen(wn, wm); |
4671 | 4685 | vim_free(wn); |
4672 | 4686 | vim_free(wm); |
4687 | + | |
4688 | +# if defined(DEBUG) && _MSC_VER > 1200 | |
4689 | + _set_fmode(oldMode); | |
4690 | +# endif | |
4691 | + | |
4673 | 4692 | if (f != NULL) |
4674 | 4693 | return f; |
4675 | 4694 | /* Retry with non-wide function (for Windows 98). Can't use |
@@ -667,6 +667,8 @@ | ||
667 | 667 | static int included_patches[] = |
668 | 668 | { /* Add new patch number below this line */ |
669 | 669 | /**/ |
670 | + 282, | |
671 | +/**/ | |
670 | 672 | 281, |
671 | 673 | /**/ |
672 | 674 | 280, |