summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorK.Takata <kentkt@csc.jp>2022-01-24 11:24:08 +0000
committerBram Moolenaar <Bram@vim.org>2022-01-24 11:24:08 +0000
commitc351dc1e0ca959084ba36bb350291334bf74b9f8 (patch)
tree2f8979a19950eadb42d7d3cc61f725bd90ad33d6
parent058ee7c5699ef551be5aa04c66b3cffc436e9b08 (diff)
downloadvim-git-8.2.4199.tar.gz
patch 8.2.4199: MS-Windows: Support for MSVC 2003 is not usefulv8.2.4199
Problem: MS-Windows: Support for MSVC 2003 is not useful. Solution: Remove the exceptions for MSVC 2003. (Ken Takata, closes #9616)
-rw-r--r--src/GvimExt/gvimext.h6
-rw-r--r--src/ex_docmd.c9
-rw-r--r--src/feature.h3
-rw-r--r--src/gui_w32.c7
-rw-r--r--src/if_cscope.c9
-rw-r--r--src/if_ole.cpp7
-rw-r--r--src/if_ruby.c5
-rw-r--r--src/macros.h4
-rw-r--r--src/os_mswin.c39
-rw-r--r--src/os_win32.c82
-rw-r--r--src/os_win32.h27
-rw-r--r--src/proto/os_win32.pro1
-rw-r--r--src/time.c20
-rw-r--r--src/version.c2
-rw-r--r--src/vim.h9
15 files changed, 31 insertions, 199 deletions
diff --git a/src/GvimExt/gvimext.h b/src/GvimExt/gvimext.h
index b6be3a797..b85f32e20 100644
--- a/src/GvimExt/gvimext.h
+++ b/src/GvimExt/gvimext.h
@@ -44,12 +44,6 @@
#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)
diff --git a/src/ex_docmd.c b/src/ex_docmd.c
index 5f5f60fe0..fa06e06d8 100644
--- a/src/ex_docmd.c
+++ b/src/ex_docmd.c
@@ -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];
diff --git a/src/feature.h b/src/feature.h
index b2df6f9a5..ace02eb6e 100644
--- a/src/feature.h
+++ b/src/feature.h
@@ -629,8 +629,7 @@
&& (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
diff --git a/src/gui_w32.c b/src/gui_w32.c
index 50ea8f9cd..fae7034cd 100644
--- a/src/gui_w32.c
+++ b/src/gui_w32.c
@@ -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;
diff --git a/src/if_cscope.c b/src/if_cscope.c
index ccccb518b..9e0ec456b 100644
--- a/src/if_cscope.c
+++ b/src/if_cscope.c
@@ -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"));
diff --git a/src/if_ole.cpp b/src/if_ole.cpp
index f7108e4a7..e3e4cdb88 100644
--- a/src/if_ole.cpp
+++ b/src/if_ole.cpp
@@ -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)
diff --git a/src/if_ruby.c b/src/if_ruby.c
index c58c3c5f1..68c1e591a 100644
--- a/src/if_ruby.c
+++ b/src/if_ruby.c
@@ -32,11 +32,6 @@
# 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()
diff --git a/src/macros.h b/src/macros.h
index ae7ed1a7a..31b52194d 100644
--- a/src/macros.h
+++ b/src/macros.h
@@ -166,9 +166,9 @@
# 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))
diff --git a/src/os_mswin.c b/src/os_mswin.c
index 5db7bb783..57ac5828c 100644
--- a/src/os_mswin.c
+++ b/src/os_mswin.c
@@ -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,
diff --git a/src/os_win32.c b/src/os_win32.c
index ae6665261..c24e2a606 100644
--- a/src/os_win32.c
+++ b/src/os_win32.c
@@ -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
diff --git a/src/os_win32.h b/src/os_win32.h
index 116b9e829..d22772353 100644
--- a/src/os_win32.h
+++ b/src/os_win32.h
@@ -47,13 +47,8 @@
#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)
@@ -134,17 +129,11 @@
# 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
/*
@@ -154,14 +143,8 @@
#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))
diff --git a/src/proto/os_win32.pro b/src/proto/os_win32.pro
index 4d360d70e..5c50816c6 100644
--- a/src/proto/os_win32.pro
+++ b/src/proto/os_win32.pro
@@ -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);
diff --git a/src/time.c b/src/time.c
index 020f78dd0..78e20eb13 100644
--- a/src/time.c
+++ b/src/time.c
@@ -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
/*
diff --git a/src/version.c b/src/version.c
index d483b9a9f..621bc59a2 100644
--- a/src/version.c
+++ b/src/version.c
@@ -751,6 +751,8 @@ static char *(features[]) =
static int included_patches[] =
{ /* Add new patch number below this line */
/**/
+ 4199,
+/**/
4198,
/**/
4197,
diff --git a/src/vim.h b/src/vim.h
index 357873c56..f418e04c8 100644
--- 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;