Index: win/makefile.vc =================================================================== --- win/makefile.vc (revision 61405) +++ win/makefile.vc (working copy) @@ -403,11 +403,6 @@ guilflags = $(lflags) -subsystem:windows baselibs = kernel32.lib advapi32.lib user32.lib -# Avoid 'unresolved external symbol __security_cookie' errors. -# c.f. http://support.microsoft.com/?id=894573 -!if "$(MACHINE)" == "IA64" || "$(MACHINE)" == "AMD64" -baselibs = $(baselibs) bufferoverflowU.lib -!endif #--------------------------------------------------------------------- # TclTest flags Index: win/tclWinConsole.c =================================================================== --- win/tclWinConsole.c (revision 61405) +++ win/tclWinConsole.c (working copy) @@ -706,7 +706,7 @@ */ if (ReadConsole(infoPtr->handle, (LPVOID) buf, (DWORD) bufSize, &count, - (LPOVERLAPPED) NULL) == TRUE) { + (LPVOID) NULL) == TRUE) { buf[count] = '\0'; return count; } Index: win/nmakehlp.c =================================================================== --- win/nmakehlp.c (revision 61405) +++ win/nmakehlp.c (working copy) @@ -20,7 +20,7 @@ #pragma comment (lib, "kernel32.lib") #include #include -#if defined(_M_IA64) || defined(_M_AMD64) +#if _MSC_FULL_VER > 140000000 && _MSC_FULL_VER <= 140040310 #pragma comment(lib, "bufferoverflowU") #endif Index: generic/tcl.h =================================================================== --- generic/tcl.h (revision 61405) +++ generic/tcl.h (working copy) @@ -67,6 +67,11 @@ /* * The following definitions set up the proper options for Windows * compilers. We use this method because there is no autoconf equivalent. + * The need to stipulate bufferoverflowU.lib during linking depends on + * the version of the Microsoft compiler we're using. The pragma + * approach below is the recommended way of dealing with the issue by + * Microsoft. See the following URL for a relevant discussion: + * http://forums.microsoft.com/MSDN/ShowPost.aspx?PostID=72235&SiteID=1 */ #ifndef __WIN32__ @@ -75,6 +80,9 @@ # ifndef WIN32 # define WIN32 # endif +# if _MSC_FULL_VER > 140000000 && _MSC_FULL_VER <= 140040310 +# pragma comment(lib, "bufferoverflowU") +# endif # endif #endif @@ -383,7 +391,7 @@ # define TCL_LL_MODIFIER "L" # define TCL_LL_MODIFIER_SIZE 1 # else /* __BORLANDC__ */ -# if _MSC_VER < 1400 || !defined(_M_IX86) +# if _MSC_VER < 1400 && !defined(_M_IX86) typedef struct _stati64 Tcl_StatBuf; # else typedef struct _stat64 Tcl_StatBuf;