]> granicus.if.org Git - vim/commitdiff
patch 8.2.4199: MS-Windows: Support for MSVC 2003 is not useful v8.2.4199
authorK.Takata <kentkt@csc.jp>
Mon, 24 Jan 2022 11:24:08 +0000 (11:24 +0000)
committerBram Moolenaar <Bram@vim.org>
Mon, 24 Jan 2022 11:24:08 +0000 (11:24 +0000)
Problem:    MS-Windows: Support for MSVC 2003 is not useful.
Solution:   Remove the exceptions for MSVC 2003. (Ken Takata, closes #9616)

15 files changed:
src/GvimExt/gvimext.h
src/ex_docmd.c
src/feature.h
src/gui_w32.c
src/if_cscope.c
src/if_ole.cpp
src/if_ruby.c
src/macros.h
src/os_mswin.c
src/os_win32.c
src/os_win32.h
src/proto/os_win32.pro
src/time.c
src/version.c
src/vim.h

index b6be3a7975b718c507c83cace079753c45ecdb8d..b85f32e2046083e1480d7d1cd4364da2fd201741 100644 (file)
 #include <shlobj.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)))
 
 // Initialize GUIDs (should be done only and at-least once per DLL/EXE)
index 5f5f60fe0b74d5136efb88038854a66f465ec0ac..fa06e06d8a55278ba7596e76a315922956115dd4 100644 (file)
@@ -1716,12 +1716,6 @@ comment_start(char_u *p, int starts_with_colon UNUSED)
  *
  * 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 *
 do_one_cmd(
     char_u     **cmdlinep,
@@ -2648,9 +2642,6 @@ doend:
 
     return ea.nextcmd;
 }
-#if (_MSC_VER == 1200)
- #pragma optimize( "", on )
-#endif
 
 static char ex_error_buf[MSG_BUF_LEN];
 
index b2df6f9a5c8e9c18f50440e7746d4185d7417f00..ace02eb6eb00380e825b1c3871e8b5e8cc8e97ac 100644 (file)
     && (defined(FEAT_GUI_GTK) \
        || (defined(FEAT_GUI_MOTIF) && defined(HAVE_XM_NOTEBOOK_H)) \
        || defined(FEAT_GUI_HAIKU) \
-       || (defined(FEAT_GUI_MSWIN) \
-           && (!defined(_MSC_VER) || _MSC_VER > 1020)))
+       || defined(FEAT_GUI_MSWIN))
 # define FEAT_GUI_TABLINE
 #endif
 
index 50ea8f9cd1a54e1fc9c1cf91437a0069a59237e3..fae7034cdf6c36cd7bc6009c41d92e2136c82bb9 100644 (file)
@@ -4031,13 +4031,6 @@ _OnScroll(
 # define ID_BEVAL_TOOLTIP   200
 # 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 UINT_PTR            BevalTimerId = 0;
 static DWORD       LastActivity = 0;
index ccccb518b3fcce8553501d9efcd1b8ac0b661a6c..9e0ec456be3a757f69e29e073ceff524890050f1 100644 (file)
@@ -838,11 +838,6 @@ cs_create_connection(int i)
     HANDLE     stdin_rd, stdout_rd;
     HANDLE     stdout_wr, stdin_wr;
     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
 
 #if defined(UNIX)
@@ -1037,11 +1032,11 @@ err_closing:
     CloseHandle(pi.hThread);
 
     // 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)
            || ((csinfo[i].to_fp = _fdopen(fd, "w")) == NULL))
        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)
            || ((csinfo[i].fr_fp = _fdopen(fd, "r")) == NULL))
        PERROR(_("cs_create_connection: fdopen for fr_fp failed"));
index f7108e4a74ede525381cabd62efad4387b3351a1..e3e4cdb889f44aea03ff3ca4ffa2ce7a2b729645 100644 (file)
@@ -30,13 +30,6 @@ extern HWND vim_parent_hwnd;
 # define FINAL
 #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 "iid_ole.c"   // UUID definitions (compile here)
 
index c58c3c5f1362afe92bc5aa266adeabb319ddf1f4..68c1e591ac146b8bf1aad10ca5ffc3c69639bdab 100644 (file)
 # define RUBYEXTERN extern
 #endif
 
-// suggested by Ariya Mizutani
-#if (_MSC_VER == 1200)
-# undef _WIN32_WINNT
-#endif
-
 #ifdef DYNAMIC_RUBY
 /*
  * This is tricky.  In ruby.h there is (inline) function rb_class_of()
index ae7ed1a7aeffbbcd8ba69ff136c269b689c79a66..31b52194d4779827fa926d7d5407e72eb2d1a379 100644 (file)
 #   define mch_access(n, p)    access((n), (p))
 # 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.
-# if (defined(_MSC_VER) && (_MSC_VER >= 1300)) || defined(__MINGW32__)
+# ifdef MSWIN
 #  define mch_fstat(n, p)      _fstat64((n), (p))
 # else
 #  define mch_fstat(n, p)      fstat((n), (p))
index 5db7bb7837c25da5cbcffe8e09e809464f72a5ed..57ac5828ca6a6101979e51487ee9244d103890ee 100644 (file)
@@ -429,23 +429,15 @@ slash_adjust(char_u *p)
     }
 }
 
-// Use 64-bit stat functions if available.
-#ifdef HAVE_STAT64
-# undef stat
-# undef _stat
-# undef _wstat
-# undef _fstat
-# define stat _stat64
-# define _stat _stat64
-# define _wstat _wstat64
-# 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
+// Use 64-bit stat functions.
+#undef stat
+#undef _stat
+#undef _wstat
+#undef _fstat
+#define stat _stat64
+#define _stat _stat64
+#define _wstat _wstat64
+#define _fstat _fstat64
 
     static int
 wstat_symlink_aware(const WCHAR *name, stat_T *stp)
@@ -487,7 +479,7 @@ wstat_symlink_aware(const WCHAR *name, stat_T *stp)
        {
            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);
            if ((n == 0) && (attr & FILE_ATTRIBUTE_DIRECTORY))
                stp->st_mode = (stp->st_mode & ~S_IFREG) | S_IFDIR;
@@ -881,7 +873,7 @@ mch_libcall(
        __except(EXCEPTION_EXECUTE_HANDLER)
        {
            if (GetExceptionCode() == EXCEPTION_STACK_OVERFLOW)
-               RESETSTKOFLW();
+               _resetstkoflw();
            fRunTimeLinkSuccess = 0;
        }
 # endif
@@ -1043,14 +1035,7 @@ swap_me(COLORREF colorref)
     return colorref;
 }
 
-// Attempt to make this work for old and new compilers
-# if !defined(_WIN64) && (!defined(_MSC_VER) || _MSC_VER < 1300)
-#  define PDP_RETVAL BOOL
-# else
-#  define PDP_RETVAL INT_PTR
-# endif
-
-    static PDP_RETVAL CALLBACK
+    static INT_PTR CALLBACK
 PrintDlgProc(
        HWND hDlg,
        UINT message,
index ae666526102e51939ce07e1cf91e699afe69b155..c24e2a606b4461f6a2af9469fcaf1ff7019852fa 100644 (file)
@@ -7464,88 +7464,6 @@ mch_copy_file_attribute(char_u *from, char_u *to)
     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
index 116b9e8296711d0f2b9639e8e25352bf97d618fa..d22772353b8f33ba8cb930e08d1d510483904e31 100644 (file)
 
 #define FEAT_SHORTCUT          // resolve shortcuts
 
-#if (!defined(_MSC_VER) || _MSC_VER > 1020)
-/*
- * 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
+// Access Control List (actually security info).
+#define HAVE_ACL
 
 #define USE_FNAME_CASE         // adjust case of file names
 #if !defined(FEAT_CLIPBOARD)
 # define IO_REPARSE_TAG_SYMLINK                0xA000000C
 #endif
 
-#if defined(_MSC_VER)
+#ifdef _MSC_VER
     // Support for __try / __except.  All versions of MSVC are
     // expected to have this.  Any other compilers that support it?
 # define HAVE_TRY_EXCEPT 1
 # include <malloc.h>           // for _resetstkoflw()
-# if defined(_MSC_VER) && (_MSC_VER >= 1300)
-#  define RESETSTKOFLW _resetstkoflw
-# else
-#  define RESETSTKOFLW myresetstkoflw
-#  define MYRESETSTKOFLW
-# endif
 #endif
 
 /*
 
 #ifdef _DEBUG
 
-# if defined(_MSC_VER) &&  (_MSC_VER >= 1000)
-   // Use the new debugging tools in Visual C++ 4.x
-#  include <crtdbg.h>
-#  define ASSERT(f) _ASSERT(f)
-# else
-#  include <assert.h>
-#  define ASSERT(f) assert(f)
-# endif
+# include <crtdbg.h>
+# define ASSERT(f) _ASSERT(f)
 
 # define TRACE                 Trace
 # define TRACE0(sz)            Trace(_T("%s"), _T(sz))
index 4d360d70e2edf148f7e1a6eef9cccfc6fb64ca8b..5c50816c6f5b1c3289025c141c79359cc5404189 100644 (file)
@@ -64,7 +64,6 @@ int mch_access(char *n, int p);
 int mch_open(const char *name, int flags, int mode);
 FILE *mch_fopen(const char *name, const char *mode);
 int mch_copy_file_attribute(char_u *from, char_u *to);
-int myresetstkoflw(void);
 int get_cmd_argsW(char ***argvp);
 void free_cmd_argsW(void);
 void used_file_arg(char *name, int literal, int full_path, int diff_mode);
index 020f78dd0e8e278d10d22f41a460af5a1ddc9598..78e20eb13c71e1bb266e00a5fbb0a25db186b3c4 100644 (file)
@@ -1022,14 +1022,6 @@ get8ctime(FILE *fd)
     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.
  * Returns FAIL when the write failed.
@@ -1068,22 +1060,16 @@ time_to_bytes(time_T the_time, char_u *buf)
            buf[bi++] = 0;
        else
        {
-#if defined(SIZEOF_TIME_T) && SIZEOF_TIME_T > 4
+# if defined(SIZEOF_TIME_T) && SIZEOF_TIME_T > 4
            c = (int)(wtime >> (i * 8));
-#else
+# else
            c = (int)((long_u)wtime >> (i * 8));
-#endif
+# endif
            buf[bi++] = c;
        }
     }
 }
 
-#ifdef _MSC_VER
-# if (_MSC_VER <= 1200)
- #  pragma optimize("", on)
-# endif
-#endif
-
 #endif
 
 /*
index d483b9a9fe27de3fa6a9a2b6815cfa0e7a933dd4..621bc59a208118a3c663a167493502bd175c197c 100644 (file)
@@ -750,6 +750,8 @@ static char *(features[]) =
 
 static int included_patches[] =
 {   /* Add new patch number below this line */
+/**/
+    4199,
 /**/
     4198,
 /**/
index 357873c56ee6c5a66d8543d6952abd19d5908e38..f418e04c8f25ae3aa68ae83a5d11c438116c8571 100644 (file)
--- a/src/vim.h
+++ b/src/vim.h
@@ -356,7 +356,7 @@ typedef              __int64        long_i;
   // 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.
   // 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
 # endif
 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.
  * Note that Windows has different function names.
  */
-#if (defined(_MSC_VER) && (_MSC_VER >= 1300)) || defined(__MINGW32__)
+#ifdef MSWIN
 typedef __int64 off_T;
 # ifdef __MINGW32__
 #  define vim_lseek lseek64
@@ -2162,9 +2162,8 @@ typedef struct
 typedef int Clipboard_T;       // This is required for the prototypes.
 #endif
 
-// Use 64-bit stat structure if available.
-#if (defined(_MSC_VER) && (_MSC_VER >= 1300)) || defined(__MINGW32__)
-# define HAVE_STAT64
+// Use 64-bit stat structure on MS-Windows.
+#ifdef MSWIN
 typedef struct _stat64 stat_T;
 #else
 typedef struct stat stat_T;