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
|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
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
========
# 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
#
# 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
!endif
!if "$(_NMAKE_VER)" == "6.00.8168.0"
MSVCVER = 6.0
+CPU = ix86
!endif
!if "$(_NMAKE_VER)" == "7.00.9466"
MSVCVER = 7.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.
!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"
CPUARG =
!endif
!else
-# VC8 only allows specifying SSE architecture
+# VC8/9 only allows specifying SSE architecture
!if "$(CPUNR)" == "pentium4"
CPUARG = /arch:SSE2
!endif
!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
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
LIBC = $(LIBC) msvcrtd.lib
! else
LIBC = $(LIBC) libcmtd.lib
-CFLAGS = $(CFLAGS) /MTd
+CFLAGS = $(CFLAGS) /Zl /MTd
! endif
!endif # DEBUG
$(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
# 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
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);
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)
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()
}
STDMETHODIMP
-CVim::GetHwnd(UINT *result)
+CVim::GetHwnd(UINT_PTR *result)
{
- *result = (UINT) s_hwnd;
+ *result = (UINT_PTR)s_hwnd;
return S_OK;
}
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;
};
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;
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(
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
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
{
/* 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);
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);
# 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
static int included_patches[] =
{ /* Add new patch number below this line */
+/**/
+ 282,
/**/
281,
/**/