Blob Blame History Raw
To: vim-dev@vim.org
Subject: Patch 7.1.282 (extra)
Fcc: outbox
From: Bram Moolenaar <Bram@moolenaar.net>
Mime-Version: 1.0
Content-Type: text/plain; charset=ISO-8859-1
Content-Transfer-Encoding: 8bit
------------

Patch 7.1.282 (extra)
Problem:    Win64: Edit with Vim context menu isn't installed correctly.
	    Compiler warnings and a few other things.
Solution:   Add [ and ] to entry of class name.  Use UINT_PTR instead of UINT.
	    And a fixes for the other things. (George V.  Reilly)
Files:	    src/GvimExt/Makefile, src/dosinst.c, src/if_ole.cpp, src/if_ole.h,
	    src/if_ole.idl, src/INSTALLpc.txt,  src/Make_mvc.mak,
	    src/os_win32.c,


*** ../vim-7.1.281/src/GvimExt/Makefile	Sat May  5 12:51:46 2007
--- src/GvimExt/Makefile	Tue Jul 10 16:18:18 2007
***************
*** 24,30 ****
  gvimext.obj: gvimext.h
  
  .cpp.obj:
!     $(cc) $(cflags) -DFEAT_GETTEXT $(cvarsdll) $*.cpp
  
  gvimext.res: gvimext.rc
      $(rc) $(rcflags) $(rcvars)  gvimext.rc
--- 24,30 ----
  gvimext.obj: gvimext.h
  
  .cpp.obj:
!     $(cc) $(cflags) -DFEAT_GETTEXT $(cvarsmt) $*.cpp
  
  gvimext.res: gvimext.rc
      $(rc) $(rcflags) $(rcvars)  gvimext.rc
*** ../vim-7.1.281/src/dosinst.c	Thu May 10 20:54:39 2007
--- src/dosinst.c	Tue Jul 10 16:07:16 2007
***************
*** 1365,1371 ****
  
  	    printf("Creating \"Edit with Vim\" popup menu entry\n");
  
! 	    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);
--- 1365,1371 ----
  
  	    printf("Creating \"Edit with Vim\" popup menu entry\n");
  
! 	    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);
*** ../vim-7.1.281/src/if_ole.cpp	Wed Aug 16 17:34:09 2006
--- src/if_ole.cpp	Tue Sep 25 16:44:44 2007
***************
*** 34,39 ****
--- 34,45 ----
  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,113 ****
      STDMETHOD(SendKeys)(BSTR keys);
      STDMETHOD(Eval)(BSTR expr, BSTR *result);
      STDMETHOD(SetForeground)(void);
!     STDMETHOD(GetHwnd)(UINT *result);
  
  private:
      // Constructor is private - create using CVim::Create()
--- 113,119 ----
      STDMETHOD(SendKeys)(BSTR keys);
      STDMETHOD(Eval)(BSTR expr, BSTR *result);
      STDMETHOD(SetForeground)(void);
!     STDMETHOD(GetHwnd)(UINT_PTR *result);
  
  private:
      // Constructor is private - create using CVim::Create()
***************
*** 288,296 ****
  }
  
  STDMETHODIMP
! CVim::GetHwnd(UINT *result)
  {
!     *result = (UINT) s_hwnd;
      return S_OK;
  }
  
--- 294,302 ----
  }
  
  STDMETHODIMP
! CVim::GetHwnd(UINT_PTR *result)
  {
!     *result = (UINT_PTR)s_hwnd;
      return S_OK;
  }
  
*** ../vim-7.1.281/src/if_ole.h	Sun Jun 13 17:46:29 2004
--- src/if_ole.h	Tue Jul 10 16:21:18 2007
***************
*** 79,85 ****
  	virtual HRESULT STDMETHODCALLTYPE SetForeground( void) = 0;
  
  	virtual HRESULT STDMETHODCALLTYPE GetHwnd(
! 	    /* [retval][out] */ UINT __RPC_FAR *result) = 0;
  
      };
  
--- 79,85 ----
  	virtual HRESULT STDMETHODCALLTYPE SetForeground( void) = 0;
  
  	virtual HRESULT STDMETHODCALLTYPE GetHwnd(
! 	    /* [retval][out] */ UINT_PTR __RPC_FAR *result) = 0;
  
      };
  
***************
*** 143,149 ****
  
  	HRESULT ( STDMETHODCALLTYPE __RPC_FAR *GetHwnd )(
  	    IVim __RPC_FAR * This,
! 	    /* [retval][out] */ UINT __RPC_FAR *result);
  
  	END_INTERFACE
      } IVimVtbl;
--- 143,149 ----
  
  	HRESULT ( STDMETHODCALLTYPE __RPC_FAR *GetHwnd )(
  	    IVim __RPC_FAR * This,
! 	    /* [retval][out] */ UINT_PTR __RPC_FAR *result);
  
  	END_INTERFACE
      } IVimVtbl;
***************
*** 236,242 ****
  
  HRESULT STDMETHODCALLTYPE IVim_GetHwnd_Proxy(
      IVim __RPC_FAR * This,
!     /* [retval][out] */ UINT __RPC_FAR *result);
  
  
  void __RPC_STUB IVim_GetHwnd_Stub(
--- 236,242 ----
  
  HRESULT STDMETHODCALLTYPE IVim_GetHwnd_Proxy(
      IVim __RPC_FAR * This,
!     /* [retval][out] */ UINT_PTR __RPC_FAR *result);
  
  
  void __RPC_STUB IVim_GetHwnd_Stub(
*** ../vim-7.1.281/src/if_ole.idl	Sun Jun 13 17:22:03 2004
--- src/if_ole.idl	Tue Jul 10 16:21:45 2007
***************
*** 20,26 ****
  	HRESULT SendKeys([in]BSTR keys);
  	HRESULT Eval([in]BSTR expr, [out, retval]BSTR* result);
  	HRESULT SetForeground(void);
! 	HRESULT GetHwnd([out, retval]UINT* result);
  };
  
  // Component and type library definitions
--- 20,26 ----
  	HRESULT SendKeys([in]BSTR keys);
  	HRESULT Eval([in]BSTR expr, [out, retval]BSTR* result);
  	HRESULT SetForeground(void);
! 	HRESULT GetHwnd([out, retval]UINT_PTR* result);
  };
  
  // Component and type library definitions
*** ../vim-7.1.281/src/INSTALLpc.txt	Sun Apr 30 20:29:26 2006
--- src/INSTALLpc.txt	Wed Mar 12 15:01:37 2008
***************
*** 82,90 ****
  |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.
  
  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
--- 82,89 ----
  |ms-platform-sdk|, |dotnet-1.1-redist|, |dotnet-1.1-sdk|,
  and |windbg-download|.
  
! 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,157 ****
--- 151,164 ----
      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
  ========
  
*** ../vim-7.1.281/src/Make_mvc.mak	Wed Oct  3 13:28:40 2007
--- src/Make_mvc.mak	Wed Mar 12 15:09:55 2008
***************
*** 1,6 ****
  # 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).
  #
  # To build using other Windows compilers, see INSTALLpc.txt
  #
--- 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), VC8 (VS2005),
! # and VC9 (VS2008).
  #
  # To build using other Windows compilers, see INSTALLpc.txt
  #
***************
*** 285,291 ****
  # 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
  !if "$(DELAYLOAD)" == "yes"
  CON_LIB = $(CON_LIB) /DELAYLOAD:comdlg32.dll /DELAYLOAD:ole32.dll DelayImp.lib
  !endif
--- 286,293 ----
  # 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 = 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,336 ****
--- 333,339 ----
  !endif
  !if "$(_NMAKE_VER)" == "6.00.8168.0"
  MSVCVER = 6.0
+ CPU = ix86
  !endif
  !if "$(_NMAKE_VER)" == "7.00.9466"
  MSVCVER = 7.0
***************
*** 344,349 ****
--- 347,355 ----
  !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,364 ****
  !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.
  !error Make aborted.
  !endif
  
  # Convert processor ID to MVC-compatible number
! !if "$(MSVCVER)" != "8.0"
  !if "$(CPUNR)" == "i386"
  CPUARG = /G3
  !elseif "$(CPUNR)" == "i486"
--- 358,370 ----
  !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 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") && ("$(MSVCVER)" != "9.0")
  !if "$(CPUNR)" == "i386"
  CPUARG = /G3
  !elseif "$(CPUNR)" == "i486"
***************
*** 373,379 ****
  CPUARG =
  !endif
  !else
! # VC8 only allows specifying SSE architecture
  !if "$(CPUNR)" == "pentium4"
  CPUARG = /arch:SSE2
  !endif
--- 379,385 ----
  CPUARG =
  !endif
  !else
! # VC8/9 only allows specifying SSE architecture
  !if "$(CPUNR)" == "pentium4"
  CPUARG = /arch:SSE2
  !endif
***************
*** 391,397 ****
  !else # MAXSPEED
  OPTFLAG = /Ox
  !endif
! !if "$(MSVCVER)" == "8.0"
  # Use link time code generation if not worried about size
  !if "$(OPTIMIZE)" != "SPACE"
  OPTFLAG = $(OPTFLAG) /GL
--- 397,403 ----
  !else # MAXSPEED
  OPTFLAG = /Ox
  !endif
! !if ("$(MSVCVER)" == "8.0") || ("$(MSVCVER)" == "9.0")
  # Use link time code generation if not worried about size
  !if "$(OPTIMIZE)" != "SPACE"
  OPTFLAG = $(OPTFLAG) /GL
***************
*** 404,414 ****
  LIBC = msvcrt.lib
  ! else
  LIBC = libcmt.lib
! CFLAGS = $(CFLAGS) /MT
  ! endif
  !else  # DEBUG
  VIM = vimd
! ! if "$(CPU)" == "i386"
  DEBUGINFO = /ZI
  ! endif
  CFLAGS = $(CFLAGS) -D_DEBUG -DDEBUG /Od
--- 410,420 ----
  LIBC = msvcrt.lib
  ! else
  LIBC = libcmt.lib
! CFLAGS = $(CFLAGS) /Zl /MT
  ! endif
  !else  # DEBUG
  VIM = vimd
! ! if ("$(CPU)" == "i386") || ("$(CPU)" == "ix86")
  DEBUGINFO = /ZI
  ! endif
  CFLAGS = $(CFLAGS) -D_DEBUG -DDEBUG /Od
***************
*** 424,430 ****
  LIBC = $(LIBC) msvcrtd.lib
  ! else
  LIBC = $(LIBC) libcmtd.lib
! CFLAGS = $(CFLAGS) /MTd
  ! endif
  !endif # DEBUG
  
--- 430,436 ----
  LIBC = $(LIBC) msvcrtd.lib
  ! else
  LIBC = $(LIBC) libcmtd.lib
! CFLAGS = $(CFLAGS) /Zl /MTd
  ! endif
  !endif # DEBUG
  
***************
*** 534,540 ****
  	$(OUTDIR)\gui_w32.obj \
  	$(OUTDIR)\os_w32exe.obj
  GUI_LIB = \
! 	oldnames.lib kernel32.lib gdi32.lib version.lib $(IME_LIB) \
  	winspool.lib comctl32.lib advapi32.lib shell32.lib \
  	/machine:$(CPU) /nodefaultlib
  !else
--- 540,546 ----
  	$(OUTDIR)\gui_w32.obj \
  	$(OUTDIR)\os_w32exe.obj
  GUI_LIB = \
! 	gdi32.lib version.lib $(IME_LIB) \
  	winspool.lib comctl32.lib advapi32.lib shell32.lib \
  	/machine:$(CPU) /nodefaultlib
  !else
***************
*** 757,763 ****
  
  # Report link time code generation progress if used. 
  !ifdef NODEBUG
! !if "$(MSVCVER)" == "8.0"
  !if "$(OPTIMIZE)" != "SPACE"
  LINKARGS1 = $(LINKARGS1) /LTCG:STATUS
  !endif
--- 763,769 ----
  
  # Report link time code generation progress if used. 
  !ifdef NODEBUG
! !if ("$(MSVCVER)" == "8.0") || ("$(MSVCVER)" == "9.0")
  !if "$(OPTIMIZE)" != "SPACE"
  LINKARGS1 = $(LINKARGS1) /LTCG:STATUS
  !endif
*** ../vim-7.1.281/src/os_win32.c	Tue Nov 20 17:21:28 2007
--- src/os_win32.c	Wed Mar 12 15:24:33 2008
***************
*** 2856,2862 ****
  	windgoto((int)Rows - 1, 0);
  	g_fForceExit = TRUE;
  
! 	sprintf((char *)IObuff, _("Vim: Caught %s event\n"),
  		(dwCtrlType == CTRL_CLOSE_EVENT
  		     ? _("close")
  		     : dwCtrlType == CTRL_LOGOFF_EVENT
--- 2856,2862 ----
  	windgoto((int)Rows - 1, 0);
  	g_fForceExit = TRUE;
  
! 	vim_snprintf((char *)IObuff, IOSIZE, _("Vim: Caught %s event\n"),
  		(dwCtrlType == CTRL_CLOSE_EVENT
  		     ? _("close")
  		     : dwCtrlType == CTRL_LOGOFF_EVENT
***************
*** 3282,3293 ****
      {
  	/* we use "command" or "cmd" to start the shell; slow but easy */
  	char_u *newcmd;
! 
! 	newcmd = lalloc((long_u) (
  #ifdef FEAT_GUI_W32
  		STRLEN(vimrun_path) +
  #endif
! 		STRLEN(p_sh) + STRLEN(p_shcf) + STRLEN(cmd) + 10), TRUE);
  	if (newcmd != NULL)
  	{
  	    char_u *cmdbase = (*cmd == '"' ? cmd + 1 : cmd);
--- 3282,3294 ----
      {
  	/* we use "command" or "cmd" to start the shell; slow but easy */
  	char_u *newcmd;
! 	long_u cmdlen =  (
  #ifdef FEAT_GUI_W32
  		STRLEN(vimrun_path) +
  #endif
! 		STRLEN(p_sh) + STRLEN(p_shcf) + STRLEN(cmd) + 10);
! 
! 	newcmd = lalloc(cmdlen, TRUE);
  	if (newcmd != NULL)
  	{
  	    char_u *cmdbase = (*cmd == '"' ? cmd + 1 : cmd);
***************
*** 3373,3386 ****
  		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",
  			    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);
  		x = mch_system((char *)newcmd, options);
  	    }
  	    vim_free(newcmd);
--- 3374,3388 ----
  		if (!s_dont_use_vimrun)
  		    /* Use vimrun to execute the command.  It opens a console
  		     * window, which can be closed without killing Vim. */
!                     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
!                     vim_snprintf((char *)newcmd, cmdlen, "%s %s %s",
! 							   p_sh, p_shcf, cmd);
  		x = mch_system((char *)newcmd, options);
  	    }
  	    vim_free(newcmd);
***************
*** 4664,4675 ****
--- 4666,4694 ----
  # 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
*** ../vim-7.1.281/src/version.c	Sun Mar 16 13:09:14 2008
--- src/version.c	Sun Mar 16 14:49:21 2008
***************
*** 668,669 ****
--- 668,671 ----
  {   /* Add new patch number below this line */
+ /**/
+     282,
  /**/

-- 
Amazing but true: If all the salmon caught in Canada in one year were laid
end to end across the Sahara Desert, the smell would be absolutely awful.

 /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net   \\\
///        sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
\\\        download, build and distribute -- http://www.A-A-P.org        ///
 \\\            help me help AIDS victims -- http://ICCF-Holland.org    ///