patch 8.2.4199: MS-Windows: Support for MSVC 2003 is not useful

Problem:    MS-Windows: Support for MSVC 2003 is not useful.
Solution:   Remove the exceptions for MSVC 2003. (Ken Takata, closes #9616)
This commit is contained in:
K.Takata
2022-01-24 11:24:08 +00:00
committed by Bram Moolenaar
parent 058ee7c569
commit c351dc1e0c
15 changed files with 31 additions and 199 deletions

View File

@ -44,12 +44,6 @@
#include <shlobj.h> #include <shlobj.h>
#include <wchar.h> #include <wchar.h>
/* Accommodate old versions of VC that don't have a modern Platform SDK */
#if (defined(_MSC_VER) && _MSC_VER < 1300) || !defined(MAXULONG_PTR)
# undef UINT_PTR
# define UINT_PTR UINT
#endif
#define ResultFromShort(i) ResultFromScode(MAKE_SCODE(SEVERITY_SUCCESS, 0, (USHORT)(i))) #define ResultFromShort(i) ResultFromScode(MAKE_SCODE(SEVERITY_SUCCESS, 0, (USHORT)(i)))
// Initialize GUIDs (should be done only and at-least once per DLL/EXE) // Initialize GUIDs (should be done only and at-least once per DLL/EXE)

View File

@ -1716,12 +1716,6 @@ comment_start(char_u *p, int starts_with_colon UNUSED)
* *
* This function may be called recursively! * This function may be called recursively!
*/ */
#if (_MSC_VER == 1200)
/*
* Avoid optimisation bug in VC++ version 6.0
*/
#pragma optimize( "g", off )
#endif
static char_u * static char_u *
do_one_cmd( do_one_cmd(
char_u **cmdlinep, char_u **cmdlinep,
@ -2648,9 +2642,6 @@ doend:
return ea.nextcmd; return ea.nextcmd;
} }
#if (_MSC_VER == 1200)
#pragma optimize( "", on )
#endif
static char ex_error_buf[MSG_BUF_LEN]; static char ex_error_buf[MSG_BUF_LEN];

View File

@ -629,8 +629,7 @@
&& (defined(FEAT_GUI_GTK) \ && (defined(FEAT_GUI_GTK) \
|| (defined(FEAT_GUI_MOTIF) && defined(HAVE_XM_NOTEBOOK_H)) \ || (defined(FEAT_GUI_MOTIF) && defined(HAVE_XM_NOTEBOOK_H)) \
|| defined(FEAT_GUI_HAIKU) \ || defined(FEAT_GUI_HAIKU) \
|| (defined(FEAT_GUI_MSWIN) \ || defined(FEAT_GUI_MSWIN))
&& (!defined(_MSC_VER) || _MSC_VER > 1020)))
# define FEAT_GUI_TABLINE # define FEAT_GUI_TABLINE
#endif #endif

View File

@ -4031,13 +4031,6 @@ _OnScroll(
# define ID_BEVAL_TOOLTIP 200 # define ID_BEVAL_TOOLTIP 200
# define BEVAL_TEXT_LEN MAXPATHL # define BEVAL_TEXT_LEN MAXPATHL
# if (defined(_MSC_VER) && _MSC_VER < 1300) || !defined(MAXULONG_PTR)
// Work around old versions of basetsd.h which wrongly declares
// UINT_PTR as unsigned long.
# undef UINT_PTR
# define UINT_PTR UINT
# endif
static BalloonEval *cur_beval = NULL; static BalloonEval *cur_beval = NULL;
static UINT_PTR BevalTimerId = 0; static UINT_PTR BevalTimerId = 0;
static DWORD LastActivity = 0; static DWORD LastActivity = 0;

View File

@ -838,11 +838,6 @@ cs_create_connection(int i)
HANDLE stdin_rd, stdout_rd; HANDLE stdin_rd, stdout_rd;
HANDLE stdout_wr, stdin_wr; HANDLE stdout_wr, stdin_wr;
BOOL created; BOOL created;
# if (defined(_MSC_VER) && (_MSC_VER >= 1300)) || defined(__MINGW32__)
# define OPEN_OH_ARGTYPE intptr_t
# else
# define OPEN_OH_ARGTYPE long
# endif
#endif #endif
#if defined(UNIX) #if defined(UNIX)
@ -1037,11 +1032,11 @@ err_closing:
CloseHandle(pi.hThread); CloseHandle(pi.hThread);
// TODO - tidy up after failure to create files on pipe handles. // TODO - tidy up after failure to create files on pipe handles.
if (((fd = _open_osfhandle((OPEN_OH_ARGTYPE)stdin_wr, if (((fd = _open_osfhandle((intptr_t)stdin_wr,
_O_TEXT|_O_APPEND)) < 0) _O_TEXT|_O_APPEND)) < 0)
|| ((csinfo[i].to_fp = _fdopen(fd, "w")) == NULL)) || ((csinfo[i].to_fp = _fdopen(fd, "w")) == NULL))
PERROR(_("cs_create_connection: fdopen for to_fp failed")); PERROR(_("cs_create_connection: fdopen for to_fp failed"));
if (((fd = _open_osfhandle((OPEN_OH_ARGTYPE)stdout_rd, if (((fd = _open_osfhandle((intptr_t)stdout_rd,
_O_TEXT|_O_RDONLY)) < 0) _O_TEXT|_O_RDONLY)) < 0)
|| ((csinfo[i].fr_fp = _fdopen(fd, "r")) == NULL)) || ((csinfo[i].fr_fp = _fdopen(fd, "r")) == NULL))
PERROR(_("cs_create_connection: fdopen for fr_fp failed")); PERROR(_("cs_create_connection: fdopen for fr_fp failed"));

View File

@ -30,13 +30,6 @@ extern HWND vim_parent_hwnd;
# define FINAL # define FINAL
#endif #endif
#if (defined(_MSC_VER) && _MSC_VER < 1300) || !defined(MAXULONG_PTR)
/* Work around old versions of basetsd.h which wrongly declares
* UINT_PTR as unsigned long */
# undef UINT_PTR
# define UINT_PTR UINT
#endif
#include "if_ole.h" // Interface definitions #include "if_ole.h" // Interface definitions
#include "iid_ole.c" // UUID definitions (compile here) #include "iid_ole.c" // UUID definitions (compile here)

View File

@ -32,11 +32,6 @@
# define RUBYEXTERN extern # define RUBYEXTERN extern
#endif #endif
// suggested by Ariya Mizutani
#if (_MSC_VER == 1200)
# undef _WIN32_WINNT
#endif
#ifdef DYNAMIC_RUBY #ifdef DYNAMIC_RUBY
/* /*
* This is tricky. In ruby.h there is (inline) function rb_class_of() * This is tricky. In ruby.h there is (inline) function rb_class_of()

View File

@ -166,9 +166,9 @@
# define mch_access(n, p) access((n), (p)) # define mch_access(n, p) access((n), (p))
# endif # endif
// Use 64-bit fstat function if available. // Use 64-bit fstat function on MS-Windows.
// NOTE: This condition is the same as for the stat_T type. // NOTE: This condition is the same as for the stat_T type.
# if (defined(_MSC_VER) && (_MSC_VER >= 1300)) || defined(__MINGW32__) # ifdef MSWIN
# define mch_fstat(n, p) _fstat64((n), (p)) # define mch_fstat(n, p) _fstat64((n), (p))
# else # else
# define mch_fstat(n, p) fstat((n), (p)) # define mch_fstat(n, p) fstat((n), (p))

View File

@ -429,23 +429,15 @@ slash_adjust(char_u *p)
} }
} }
// Use 64-bit stat functions if available. // Use 64-bit stat functions.
#ifdef HAVE_STAT64 #undef stat
# undef stat #undef _stat
# undef _stat #undef _wstat
# undef _wstat #undef _fstat
# undef _fstat #define stat _stat64
# define stat _stat64 #define _stat _stat64
# define _stat _stat64 #define _wstat _wstat64
# define _wstat _wstat64 #define _fstat _fstat64
# define _fstat _fstat64
#endif
#if (defined(_MSC_VER) && (_MSC_VER >= 1300)) || defined(__MINGW32__)
# define OPEN_OH_ARGTYPE intptr_t
#else
# define OPEN_OH_ARGTYPE long
#endif
static int static int
wstat_symlink_aware(const WCHAR *name, stat_T *stp) wstat_symlink_aware(const WCHAR *name, stat_T *stp)
@ -487,7 +479,7 @@ wstat_symlink_aware(const WCHAR *name, stat_T *stp)
{ {
int fd; int fd;
fd = _open_osfhandle((OPEN_OH_ARGTYPE)h, _O_RDONLY); fd = _open_osfhandle((intptr_t)h, _O_RDONLY);
n = _fstat(fd, (struct _stat *)stp); n = _fstat(fd, (struct _stat *)stp);
if ((n == 0) && (attr & FILE_ATTRIBUTE_DIRECTORY)) if ((n == 0) && (attr & FILE_ATTRIBUTE_DIRECTORY))
stp->st_mode = (stp->st_mode & ~S_IFREG) | S_IFDIR; stp->st_mode = (stp->st_mode & ~S_IFREG) | S_IFDIR;
@ -881,7 +873,7 @@ mch_libcall(
__except(EXCEPTION_EXECUTE_HANDLER) __except(EXCEPTION_EXECUTE_HANDLER)
{ {
if (GetExceptionCode() == EXCEPTION_STACK_OVERFLOW) if (GetExceptionCode() == EXCEPTION_STACK_OVERFLOW)
RESETSTKOFLW(); _resetstkoflw();
fRunTimeLinkSuccess = 0; fRunTimeLinkSuccess = 0;
} }
# endif # endif
@ -1043,14 +1035,7 @@ swap_me(COLORREF colorref)
return colorref; return colorref;
} }
// Attempt to make this work for old and new compilers static INT_PTR CALLBACK
# if !defined(_WIN64) && (!defined(_MSC_VER) || _MSC_VER < 1300)
# define PDP_RETVAL BOOL
# else
# define PDP_RETVAL INT_PTR
# endif
static PDP_RETVAL CALLBACK
PrintDlgProc( PrintDlgProc(
HWND hDlg, HWND hDlg,
UINT message, UINT message,

View File

@ -7464,88 +7464,6 @@ mch_copy_file_attribute(char_u *from, char_u *to)
return 0; return 0;
} }
#if defined(MYRESETSTKOFLW) || defined(PROTO)
/*
* Recreate a destroyed stack guard page in win32.
* Written by Benjamin Peterson.
*/
// These magic numbers are from the MS header files
# define MIN_STACK_WINNT 2
/*
* This function does the same thing as _resetstkoflw(), which is only
* available in DevStudio .net and later.
* Returns 0 for failure, 1 for success.
*/
int
myresetstkoflw(void)
{
BYTE *pStackPtr;
BYTE *pGuardPage;
BYTE *pStackBase;
BYTE *pLowestPossiblePage;
MEMORY_BASIC_INFORMATION mbi;
SYSTEM_INFO si;
DWORD nPageSize;
DWORD dummy;
// We need to know the system page size.
GetSystemInfo(&si);
nPageSize = si.dwPageSize;
// ...and the current stack pointer
pStackPtr = (BYTE*)_alloca(1);
// ...and the base of the stack.
if (VirtualQuery(pStackPtr, &mbi, sizeof mbi) == 0)
return 0;
pStackBase = (BYTE*)mbi.AllocationBase;
// ...and the page that's min_stack_req pages away from stack base; this is
// the lowest page we could use.
pLowestPossiblePage = pStackBase + MIN_STACK_WINNT * nPageSize;
{
// We want the first committed page in the stack Start at the stack
// base and move forward through memory until we find a committed block.
BYTE *pBlock = pStackBase;
for (;;)
{
if (VirtualQuery(pBlock, &mbi, sizeof mbi) == 0)
return 0;
pBlock += mbi.RegionSize;
if (mbi.State & MEM_COMMIT)
break;
}
// mbi now describes the first committed block in the stack.
if (mbi.Protect & PAGE_GUARD)
return 1;
// decide where the guard page should start
if ((long_u)(mbi.BaseAddress) < (long_u)pLowestPossiblePage)
pGuardPage = pLowestPossiblePage;
else
pGuardPage = (BYTE*)mbi.BaseAddress;
// allocate the guard page
if (!VirtualAlloc(pGuardPage, nPageSize, MEM_COMMIT, PAGE_READWRITE))
return 0;
// apply the guard attribute to the page
if (!VirtualProtect(pGuardPage, nPageSize, PAGE_READWRITE | PAGE_GUARD,
&dummy))
return 0;
}
return 1;
}
#endif
/* /*
* The command line arguments in UTF-16 * The command line arguments in UTF-16

View File

@ -47,13 +47,8 @@
#define FEAT_SHORTCUT // resolve shortcuts #define FEAT_SHORTCUT // resolve shortcuts
#if (!defined(_MSC_VER) || _MSC_VER > 1020) // Access Control List (actually security info).
/* #define HAVE_ACL
* Access Control List (actually security info).
* MSVC has acl stuff only in 5.0, not in 4.2, don't know about 4.3.
*/
# define HAVE_ACL
#endif
#define USE_FNAME_CASE // adjust case of file names #define USE_FNAME_CASE // adjust case of file names
#if !defined(FEAT_CLIPBOARD) #if !defined(FEAT_CLIPBOARD)
@ -134,17 +129,11 @@
# define IO_REPARSE_TAG_SYMLINK 0xA000000C # define IO_REPARSE_TAG_SYMLINK 0xA000000C
#endif #endif
#if defined(_MSC_VER) #ifdef _MSC_VER
// Support for __try / __except. All versions of MSVC are // Support for __try / __except. All versions of MSVC are
// expected to have this. Any other compilers that support it? // expected to have this. Any other compilers that support it?
# define HAVE_TRY_EXCEPT 1 # define HAVE_TRY_EXCEPT 1
# include <malloc.h> // for _resetstkoflw() # include <malloc.h> // for _resetstkoflw()
# if defined(_MSC_VER) && (_MSC_VER >= 1300)
# define RESETSTKOFLW _resetstkoflw
# else
# define RESETSTKOFLW myresetstkoflw
# define MYRESETSTKOFLW
# endif
#endif #endif
/* /*
@ -154,14 +143,8 @@
#ifdef _DEBUG #ifdef _DEBUG
# if defined(_MSC_VER) && (_MSC_VER >= 1000) # include <crtdbg.h>
// Use the new debugging tools in Visual C++ 4.x # define ASSERT(f) _ASSERT(f)
# include <crtdbg.h>
# define ASSERT(f) _ASSERT(f)
# else
# include <assert.h>
# define ASSERT(f) assert(f)
# endif
# define TRACE Trace # define TRACE Trace
# define TRACE0(sz) Trace(_T("%s"), _T(sz)) # define TRACE0(sz) Trace(_T("%s"), _T(sz))

View File

@ -64,7 +64,6 @@ int mch_access(char *n, int p);
int mch_open(const char *name, int flags, int mode); int mch_open(const char *name, int flags, int mode);
FILE *mch_fopen(const char *name, const char *mode); FILE *mch_fopen(const char *name, const char *mode);
int mch_copy_file_attribute(char_u *from, char_u *to); int mch_copy_file_attribute(char_u *from, char_u *to);
int myresetstkoflw(void);
int get_cmd_argsW(char ***argvp); int get_cmd_argsW(char ***argvp);
void free_cmd_argsW(void); void free_cmd_argsW(void);
void used_file_arg(char *name, int literal, int full_path, int diff_mode); void used_file_arg(char *name, int literal, int full_path, int diff_mode);

View File

@ -1022,14 +1022,6 @@ get8ctime(FILE *fd)
return n; return n;
} }
#ifdef _MSC_VER
# if (_MSC_VER <= 1200)
// This line is required for VC6 without the service pack. Also see the
// matching #pragma below.
# pragma optimize("", off)
# endif
#endif
/* /*
* Write time_T to file "fd" in 8 bytes. * Write time_T to file "fd" in 8 bytes.
* Returns FAIL when the write failed. * Returns FAIL when the write failed.
@ -1068,22 +1060,16 @@ time_to_bytes(time_T the_time, char_u *buf)
buf[bi++] = 0; buf[bi++] = 0;
else else
{ {
#if defined(SIZEOF_TIME_T) && SIZEOF_TIME_T > 4 # if defined(SIZEOF_TIME_T) && SIZEOF_TIME_T > 4
c = (int)(wtime >> (i * 8)); c = (int)(wtime >> (i * 8));
#else # else
c = (int)((long_u)wtime >> (i * 8)); c = (int)((long_u)wtime >> (i * 8));
#endif # endif
buf[bi++] = c; buf[bi++] = c;
} }
} }
} }
#ifdef _MSC_VER
# if (_MSC_VER <= 1200)
# pragma optimize("", on)
# endif
#endif
#endif #endif
/* /*

View File

@ -750,6 +750,8 @@ static char *(features[]) =
static int included_patches[] = static int included_patches[] =
{ /* Add new patch number below this line */ { /* Add new patch number below this line */
/**/
4199,
/**/ /**/
4198, 4198,
/**/ /**/

View File

@ -356,7 +356,7 @@ typedef __int64 long_i;
// that change size between 32-bit and 64-bit platforms. For any such type, // that change size between 32-bit and 64-bit platforms. For any such type,
// __w64 should appear only on the 32-bit definition of the typedef. // __w64 should appear only on the 32-bit definition of the typedef.
// Define __w64 as an empty token for everything but MSVC 7.x or later. // Define __w64 as an empty token for everything but MSVC 7.x or later.
# if !defined(_MSC_VER) || (_MSC_VER < 1300) # ifndef _MSC_VER
# define __w64 # define __w64
# endif # endif
typedef unsigned long __w64 long_u; typedef unsigned long __w64 long_u;
@ -383,7 +383,7 @@ typedef long __w64 long_i;
* We assume that when fseeko() is available then ftello() is too. * We assume that when fseeko() is available then ftello() is too.
* Note that Windows has different function names. * Note that Windows has different function names.
*/ */
#if (defined(_MSC_VER) && (_MSC_VER >= 1300)) || defined(__MINGW32__) #ifdef MSWIN
typedef __int64 off_T; typedef __int64 off_T;
# ifdef __MINGW32__ # ifdef __MINGW32__
# define vim_lseek lseek64 # define vim_lseek lseek64
@ -2162,9 +2162,8 @@ typedef struct
typedef int Clipboard_T; // This is required for the prototypes. typedef int Clipboard_T; // This is required for the prototypes.
#endif #endif
// Use 64-bit stat structure if available. // Use 64-bit stat structure on MS-Windows.
#if (defined(_MSC_VER) && (_MSC_VER >= 1300)) || defined(__MINGW32__) #ifdef MSWIN
# define HAVE_STAT64
typedef struct _stat64 stat_T; typedef struct _stat64 stat_T;
#else #else
typedef struct stat stat_T; typedef struct stat stat_T;