changeset 1569:9fbb40a1228a v7.1.282

updated for version 7.1-282
author vimboss
date Sun, 16 Mar 2008 13:54:13 +0000
parents 4e581f1b08da
children f0cfff4dcc2f
files src/GvimExt/Makefile src/INSTALLpc.txt src/Make_mvc.mak src/dosinst.c src/if_ole.cpp src/if_ole.h src/if_ole.idl src/os_win32.c src/version.c
diffstat 9 files changed, 70 insertions(+), 30 deletions(-) [+]
line wrap: on
line diff
--- a/src/GvimExt/Makefile
+++ b/src/GvimExt/Makefile
@@ -24,7 +24,7 @@ gvimext.dll:    gvimext.obj	\
 gvimext.obj: gvimext.h
 
 .cpp.obj:
-    $(cc) $(cflags) -DFEAT_GETTEXT $(cvarsdll) $*.cpp
+    $(cc) $(cflags) -DFEAT_GETTEXT $(cvarsmt) $*.cpp
 
 gvimext.res: gvimext.rc
     $(rc) $(rcflags) $(rcvars)  gvimext.rc
--- a/src/INSTALLpc.txt
+++ b/src/INSTALLpc.txt
@@ -82,9 +82,8 @@ To compile and debug Vim with the VC2003
 |ms-platform-sdk|, |dotnet-1.1-redist|, |dotnet-1.1-sdk|,
 and |windbg-download|.
 
-It's easier to download Visual C++ 2005 Express Edition, |msvc-2005-express|.
-The advantage of the VC 2003 Toolkit is that it will be freely available
-long after VC 2005 Express Edition stops being free in November 2006.
+It's easier to download Visual C++ 2008 Express Edition, |msvc-2008-express|,
+which is freely available in perpetuity.
 
 The free Code::Blocks IDE works with the VC2003 Toolkit, as described at
     http://wiki.codeblocks.org/index.php?title=Integrating_Microsoft_Visual_Toolkit_2003_with_Code::Blocks_IDE
@@ -152,6 +151,14 @@ Instructions for integrating the Platfor
     http://msdn.microsoft.com/vstudio/express/visualc/usingpsdk/default.aspx
 
 
+Visual C++ 2008 Express Edition       *msvc-2008-express*
+-------------------------------
+
+Visual C++ 2008 Express Edition can be downloaded for free from:
+    http://msdn2.microsoft.com/en-us/express/default.aspx
+This includes the IDE and the debugger. You can build Vim with Make_mvc.mak.
+
+
 2. MinGW
 ========
 
--- a/src/Make_mvc.mak
+++ b/src/Make_mvc.mak
@@ -1,6 +1,7 @@
 # Makefile for Vim on Win32 (Windows NT/2000/XP/2003 and Windows 95/98/Me)
 # and Win64, using the Microsoft Visual C++ compilers. Known to work with
-# VC5, VC6 (VS98), VC7.0 (VS2002), VC7.1 (VS2003), and VC8 (VS2005).
+# VC5, VC6 (VS98), VC7.0 (VS2002), VC7.1 (VS2003), VC8 (VS2005),
+# and VC9 (VS2008).
 #
 # To build using other Windows compilers, see INSTALLpc.txt
 #
@@ -285,7 +286,8 @@ XPM_INC	  = -I $(XPM)\include
 # need shell32.lib for ExtractIcon()
 # gdi32.lib and comdlg32.lib for printing support
 # ole32.lib and uuid.lib are needed for FEAT_SHORTCUT
-CON_LIB = advapi32.lib shell32.lib gdi32.lib comdlg32.lib ole32.lib uuid.lib
+CON_LIB = oldnames.lib kernel32.lib advapi32.lib shell32.lib gdi32.lib \
+          comdlg32.lib ole32.lib uuid.lib /machine:$(CPU) /nodefaultlib
 !if "$(DELAYLOAD)" == "yes"
 CON_LIB = $(CON_LIB) /DELAYLOAD:comdlg32.dll /DELAYLOAD:ole32.dll DelayImp.lib
 !endif
@@ -331,6 +333,7 @@ MSVCVER = 5.0
 !endif
 !if "$(_NMAKE_VER)" == "6.00.8168.0"
 MSVCVER = 6.0
+CPU = ix86
 !endif
 !if "$(_NMAKE_VER)" == "7.00.9466"
 MSVCVER = 7.0
@@ -344,6 +347,9 @@ MSVCVER = 8.0
 !if "$(_NMAKE_VER)" == "8.00.50727.762"
 MSVCVER = 8.0
 !endif
+!if "$(_NMAKE_VER)" == "9.00.20706.01"
+MSVCVER = 9.0
+!endif
 !endif
 
 # Abort bulding VIM if version of VC is unrecognised.
@@ -352,13 +358,13 @@ MSVCVER = 8.0
 !message Cannot determine Visual C version being used.  If you are using the
 !message Windows SDK then you must have the environment variable MSVCVER set to
 !message your version of the VC compiler.  If you are not using the Express
-!message version of Visual C you van either set MSVCVER or update this makefile
-!message to handle the new value for _NMAKE_VER.
+!message version of Visual C, you can either set MSVCVER or update this makefile
+!message to handle the new value for _NMAKE_VER, "$(_NMAKE_VER)".
 !error Make aborted.
 !endif
 
 # Convert processor ID to MVC-compatible number
-!if "$(MSVCVER)" != "8.0"
+!if ("$(MSVCVER)" != "8.0") && ("$(MSVCVER)" != "9.0")
 !if "$(CPUNR)" == "i386"
 CPUARG = /G3
 !elseif "$(CPUNR)" == "i486"
@@ -373,7 +379,7 @@ CPUARG = /G7 /arch:SSE2
 CPUARG =
 !endif
 !else
-# VC8 only allows specifying SSE architecture
+# VC8/9 only allows specifying SSE architecture
 !if "$(CPUNR)" == "pentium4"
 CPUARG = /arch:SSE2
 !endif
@@ -391,7 +397,7 @@ OPTFLAG = /O2
 !else # MAXSPEED
 OPTFLAG = /Ox
 !endif
-!if "$(MSVCVER)" == "8.0"
+!if ("$(MSVCVER)" == "8.0") || ("$(MSVCVER)" == "9.0")
 # Use link time code generation if not worried about size
 !if "$(OPTIMIZE)" != "SPACE"
 OPTFLAG = $(OPTFLAG) /GL
@@ -404,11 +410,11 @@ CFLAGS = $(CFLAGS) /MD
 LIBC = msvcrt.lib
 ! else
 LIBC = libcmt.lib
-CFLAGS = $(CFLAGS) /MT
+CFLAGS = $(CFLAGS) /Zl /MT
 ! endif
 !else  # DEBUG
 VIM = vimd
-! if "$(CPU)" == "i386"
+! if ("$(CPU)" == "i386") || ("$(CPU)" == "ix86")
 DEBUGINFO = /ZI
 ! endif
 CFLAGS = $(CFLAGS) -D_DEBUG -DDEBUG /Od
@@ -424,7 +430,7 @@ CFLAGS = $(CFLAGS) /MDd
 LIBC = $(LIBC) msvcrtd.lib
 ! else
 LIBC = $(LIBC) libcmtd.lib
-CFLAGS = $(CFLAGS) /MTd
+CFLAGS = $(CFLAGS) /Zl /MTd
 ! endif
 !endif # DEBUG
 
@@ -534,7 +540,7 @@ GUI_OBJ = \
 	$(OUTDIR)\gui_w32.obj \
 	$(OUTDIR)\os_w32exe.obj
 GUI_LIB = \
-	oldnames.lib kernel32.lib gdi32.lib version.lib $(IME_LIB) \
+	gdi32.lib version.lib $(IME_LIB) \
 	winspool.lib comctl32.lib advapi32.lib shell32.lib \
 	/machine:$(CPU) /nodefaultlib
 !else
@@ -757,7 +763,7 @@ LINKARGS2 = $(CON_LIB) $(GUI_LIB) $(LIBC
 
 # Report link time code generation progress if used. 
 !ifdef NODEBUG
-!if "$(MSVCVER)" == "8.0"
+!if ("$(MSVCVER)" == "8.0") || ("$(MSVCVER)" == "9.0")
 !if "$(OPTIMIZE)" != "SPACE"
 LINKARGS1 = $(LINKARGS1) /LTCG:STATUS
 !endif
--- a/src/dosinst.c
+++ b/src/dosinst.c
@@ -1365,7 +1365,7 @@ install_registry(void)
 
 	    printf("Creating \"Edit with Vim\" popup menu entry\n");
 
-	    fprintf(fd, "HKEY_CLASSES_ROOT\\CLSID\\%s\n", vim_ext_clsid);
+	    fprintf(fd, "[HKEY_CLASSES_ROOT\\CLSID\\%s]\n", vim_ext_clsid);
 	    fprintf(fd, "@=\"%s\"\n", vim_ext_name);
 	    fprintf(fd, "[HKEY_CLASSES_ROOT\\CLSID\\%s\\InProcServer32]\n",
 							       vim_ext_clsid);
--- a/src/if_ole.cpp
+++ b/src/if_ole.cpp
@@ -34,6 +34,12 @@ extern HWND s_hwnd;
 extern HWND vim_parent_hwnd;
 }
 
+#if _MSC_VER < 1300
+/* Work around old versions of basetsd.h which wrongly declares
+ * UINT_PTR as unsigned long */
+# define UINT_PTR UINT
+#endif
+
 #include "if_ole.h"	// Interface definitions
 #include "iid_ole.c"	// UUID definitions (compile here)
 
@@ -107,7 +113,7 @@ public:
     STDMETHOD(SendKeys)(BSTR keys);
     STDMETHOD(Eval)(BSTR expr, BSTR *result);
     STDMETHOD(SetForeground)(void);
-    STDMETHOD(GetHwnd)(UINT *result);
+    STDMETHOD(GetHwnd)(UINT_PTR *result);
 
 private:
     // Constructor is private - create using CVim::Create()
@@ -288,9 +294,9 @@ CVim::Invoke(
 }
 
 STDMETHODIMP
-CVim::GetHwnd(UINT *result)
+CVim::GetHwnd(UINT_PTR *result)
 {
-    *result = (UINT) s_hwnd;
+    *result = (UINT_PTR)s_hwnd;
     return S_OK;
 }
 
--- a/src/if_ole.h
+++ b/src/if_ole.h
@@ -79,7 +79,7 @@ EXTERN_C const IID IID_IVim;
 	virtual HRESULT STDMETHODCALLTYPE SetForeground( void) = 0;
 
 	virtual HRESULT STDMETHODCALLTYPE GetHwnd(
-	    /* [retval][out] */ UINT __RPC_FAR *result) = 0;
+	    /* [retval][out] */ UINT_PTR __RPC_FAR *result) = 0;
 
     };
 
@@ -143,7 +143,7 @@ EXTERN_C const IID IID_IVim;
 
 	HRESULT ( STDMETHODCALLTYPE __RPC_FAR *GetHwnd )(
 	    IVim __RPC_FAR * This,
-	    /* [retval][out] */ UINT __RPC_FAR *result);
+	    /* [retval][out] */ UINT_PTR __RPC_FAR *result);
 
 	END_INTERFACE
     } IVimVtbl;
@@ -236,7 +236,7 @@ void __RPC_STUB IVim_SetForeground_Stub(
 
 HRESULT STDMETHODCALLTYPE IVim_GetHwnd_Proxy(
     IVim __RPC_FAR * This,
-    /* [retval][out] */ UINT __RPC_FAR *result);
+    /* [retval][out] */ UINT_PTR __RPC_FAR *result);
 
 
 void __RPC_STUB IVim_GetHwnd_Stub(
--- a/src/if_ole.idl
+++ b/src/if_ole.idl
@@ -20,7 +20,7 @@ interface IVim : IDispatch
 	HRESULT SendKeys([in]BSTR keys);
 	HRESULT Eval([in]BSTR expr, [out, retval]BSTR* result);
 	HRESULT SetForeground(void);
-	HRESULT GetHwnd([out, retval]UINT* result);
+	HRESULT GetHwnd([out, retval]UINT_PTR* result);
 };
 
 // Component and type library definitions
--- a/src/os_win32.c
+++ b/src/os_win32.c
@@ -2856,7 +2856,7 @@ handler_routine(
 	windgoto((int)Rows - 1, 0);
 	g_fForceExit = TRUE;
 
-	sprintf((char *)IObuff, _("Vim: Caught %s event\n"),
+	vim_snprintf((char *)IObuff, IOSIZE, _("Vim: Caught %s event\n"),
 		(dwCtrlType == CTRL_CLOSE_EVENT
 		     ? _("close")
 		     : dwCtrlType == CTRL_LOGOFF_EVENT
@@ -3282,12 +3282,13 @@ mch_call_shell(
     {
 	/* we use "command" or "cmd" to start the shell; slow but easy */
 	char_u *newcmd;
-
-	newcmd = lalloc((long_u) (
+	long_u cmdlen =  (
 #ifdef FEAT_GUI_W32
 		STRLEN(vimrun_path) +
 #endif
-		STRLEN(p_sh) + STRLEN(p_shcf) + STRLEN(cmd) + 10), TRUE);
+		STRLEN(p_sh) + STRLEN(p_shcf) + STRLEN(cmd) + 10);
+
+	newcmd = lalloc(cmdlen, TRUE);
 	if (newcmd != NULL)
 	{
 	    char_u *cmdbase = (*cmd == '"' ? cmd + 1 : cmd);
@@ -3373,14 +3374,15 @@ mch_call_shell(
 		if (!s_dont_use_vimrun)
 		    /* Use vimrun to execute the command.  It opens a console
 		     * window, which can be closed without killing Vim. */
-		    sprintf((char *)newcmd, "%s%s%s %s %s",
+                    vim_snprintf((char *)newcmd, cmdlen, "%s%s%s %s %s",
 			    vimrun_path,
 			    (msg_silent != 0 || (options & SHELL_DOOUT))
 								 ? "-s " : "",
 			    p_sh, p_shcf, cmd);
 		else
 #endif
-		    sprintf((char *)newcmd, "%s %s %s", p_sh, p_shcf, cmd);
+                    vim_snprintf((char *)newcmd, cmdlen, "%s %s %s",
+							   p_sh, p_shcf, cmd);
 		x = mch_system((char *)newcmd, options);
 	    }
 	    vim_free(newcmd);
@@ -4664,12 +4666,29 @@ mch_fopen(char *name, char *mode)
 # endif
        )
     {
+# if defined(DEBUG) && _MSC_VER > 1200
+	/* Work around an annoying assertion in the Microsoft debug CRT
+	 * when mode's text/binary setting doesn't match _get_fmode(). */
+	char newMode = mode[strlen(mode) - 1];
+	int oldMode = 0;
+
+	_get_fmode(&oldMode);
+	if (newMode == 't')
+	    _set_fmode(_O_TEXT);
+	else if (newMode == 'b')
+	    _set_fmode(_O_BINARY);
+# endif
 	wn = enc_to_ucs2(name, NULL);
 	wm = enc_to_ucs2(mode, NULL);
 	if (wn != NULL && wm != NULL)
 	    f = _wfopen(wn, wm);
 	vim_free(wn);
 	vim_free(wm);
+
+# if defined(DEBUG) && _MSC_VER > 1200
+	_set_fmode(oldMode);
+# endif
+
 	if (f != NULL)
 	    return f;
 	/* Retry with non-wide function (for Windows 98). Can't use
--- a/src/version.c
+++ b/src/version.c
@@ -667,6 +667,8 @@ static char *(features[]) =
 static int included_patches[] =
 {   /* Add new patch number below this line */
 /**/
+    282,
+/**/
     281,
 /**/
     280,