Skip to content

Commit c351dc1

Browse files
k-takatabrammool
authored andcommitted
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)
1 parent 058ee7c commit c351dc1

15 files changed

Lines changed: 31 additions & 199 deletions

File tree

src/GvimExt/gvimext.h

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -44,12 +44,6 @@
4444
#include <shlobj.h>
4545
#include <wchar.h>
4646

47-
/* Accommodate old versions of VC that don't have a modern Platform SDK */
48-
#if (defined(_MSC_VER) && _MSC_VER < 1300) || !defined(MAXULONG_PTR)
49-
# undef UINT_PTR
50-
# define UINT_PTR UINT
51-
#endif
52-
5347
#define ResultFromShort(i) ResultFromScode(MAKE_SCODE(SEVERITY_SUCCESS, 0, (USHORT)(i)))
5448

5549
// Initialize GUIDs (should be done only and at-least once per DLL/EXE)

src/ex_docmd.c

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1716,12 +1716,6 @@ comment_start(char_u *p, int starts_with_colon UNUSED)
17161716
*
17171717
* This function may be called recursively!
17181718
*/
1719-
#if (_MSC_VER == 1200)
1720-
/*
1721-
* Avoid optimisation bug in VC++ version 6.0
1722-
*/
1723-
#pragma optimize( "g", off )
1724-
#endif
17251719
static char_u *
17261720
do_one_cmd(
17271721
char_u **cmdlinep,
@@ -2648,9 +2642,6 @@ do_one_cmd(
26482642

26492643
return ea.nextcmd;
26502644
}
2651-
#if (_MSC_VER == 1200)
2652-
#pragma optimize( "", on )
2653-
#endif
26542645

26552646
static char ex_error_buf[MSG_BUF_LEN];
26562647

src/feature.h

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -629,8 +629,7 @@
629629
&& (defined(FEAT_GUI_GTK) \
630630
|| (defined(FEAT_GUI_MOTIF) && defined(HAVE_XM_NOTEBOOK_H)) \
631631
|| defined(FEAT_GUI_HAIKU) \
632-
|| (defined(FEAT_GUI_MSWIN) \
633-
&& (!defined(_MSC_VER) || _MSC_VER > 1020)))
632+
|| defined(FEAT_GUI_MSWIN))
634633
# define FEAT_GUI_TABLINE
635634
#endif
636635

src/gui_w32.c

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -4031,13 +4031,6 @@ _OnScroll(
40314031
# define ID_BEVAL_TOOLTIP 200
40324032
# define BEVAL_TEXT_LEN MAXPATHL
40334033

4034-
# if (defined(_MSC_VER) && _MSC_VER < 1300) || !defined(MAXULONG_PTR)
4035-
// Work around old versions of basetsd.h which wrongly declares
4036-
// UINT_PTR as unsigned long.
4037-
# undef UINT_PTR
4038-
# define UINT_PTR UINT
4039-
# endif
4040-
40414034
static BalloonEval *cur_beval = NULL;
40424035
static UINT_PTR BevalTimerId = 0;
40434036
static DWORD LastActivity = 0;

src/if_cscope.c

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -838,11 +838,6 @@ cs_create_connection(int i)
838838
HANDLE stdin_rd, stdout_rd;
839839
HANDLE stdout_wr, stdin_wr;
840840
BOOL created;
841-
# if (defined(_MSC_VER) && (_MSC_VER >= 1300)) || defined(__MINGW32__)
842-
# define OPEN_OH_ARGTYPE intptr_t
843-
# else
844-
# define OPEN_OH_ARGTYPE long
845-
# endif
846841
#endif
847842

848843
#if defined(UNIX)
@@ -1037,11 +1032,11 @@ cs_create_connection(int i)
10371032
CloseHandle(pi.hThread);
10381033

10391034
// TODO - tidy up after failure to create files on pipe handles.
1040-
if (((fd = _open_osfhandle((OPEN_OH_ARGTYPE)stdin_wr,
1035+
if (((fd = _open_osfhandle((intptr_t)stdin_wr,
10411036
_O_TEXT|_O_APPEND)) < 0)
10421037
|| ((csinfo[i].to_fp = _fdopen(fd, "w")) == NULL))
10431038
PERROR(_("cs_create_connection: fdopen for to_fp failed"));
1044-
if (((fd = _open_osfhandle((OPEN_OH_ARGTYPE)stdout_rd,
1039+
if (((fd = _open_osfhandle((intptr_t)stdout_rd,
10451040
_O_TEXT|_O_RDONLY)) < 0)
10461041
|| ((csinfo[i].fr_fp = _fdopen(fd, "r")) == NULL))
10471042
PERROR(_("cs_create_connection: fdopen for fr_fp failed"));

src/if_ole.cpp

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -30,13 +30,6 @@ extern HWND vim_parent_hwnd;
3030
# define FINAL
3131
#endif
3232

33-
#if (defined(_MSC_VER) && _MSC_VER < 1300) || !defined(MAXULONG_PTR)
34-
/* Work around old versions of basetsd.h which wrongly declares
35-
* UINT_PTR as unsigned long */
36-
# undef UINT_PTR
37-
# define UINT_PTR UINT
38-
#endif
39-
4033
#include "if_ole.h" // Interface definitions
4134
#include "iid_ole.c" // UUID definitions (compile here)
4235

src/if_ruby.c

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -32,11 +32,6 @@
3232
# define RUBYEXTERN extern
3333
#endif
3434

35-
// suggested by Ariya Mizutani
36-
#if (_MSC_VER == 1200)
37-
# undef _WIN32_WINNT
38-
#endif
39-
4035
#ifdef DYNAMIC_RUBY
4136
/*
4237
* This is tricky. In ruby.h there is (inline) function rb_class_of()

src/macros.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -166,9 +166,9 @@
166166
# define mch_access(n, p) access((n), (p))
167167
# endif
168168

169-
// Use 64-bit fstat function if available.
169+
// Use 64-bit fstat function on MS-Windows.
170170
// NOTE: This condition is the same as for the stat_T type.
171-
# if (defined(_MSC_VER) && (_MSC_VER >= 1300)) || defined(__MINGW32__)
171+
# ifdef MSWIN
172172
# define mch_fstat(n, p) _fstat64((n), (p))
173173
# else
174174
# define mch_fstat(n, p) fstat((n), (p))

src/os_mswin.c

Lines changed: 12 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -429,23 +429,15 @@ slash_adjust(char_u *p)
429429
}
430430
}
431431

432-
// Use 64-bit stat functions if available.
433-
#ifdef HAVE_STAT64
434-
# undef stat
435-
# undef _stat
436-
# undef _wstat
437-
# undef _fstat
438-
# define stat _stat64
439-
# define _stat _stat64
440-
# define _wstat _wstat64
441-
# define _fstat _fstat64
442-
#endif
443-
444-
#if (defined(_MSC_VER) && (_MSC_VER >= 1300)) || defined(__MINGW32__)
445-
# define OPEN_OH_ARGTYPE intptr_t
446-
#else
447-
# define OPEN_OH_ARGTYPE long
448-
#endif
432+
// Use 64-bit stat functions.
433+
#undef stat
434+
#undef _stat
435+
#undef _wstat
436+
#undef _fstat
437+
#define stat _stat64
438+
#define _stat _stat64
439+
#define _wstat _wstat64
440+
#define _fstat _fstat64
449441

450442
static int
451443
wstat_symlink_aware(const WCHAR *name, stat_T *stp)
@@ -487,7 +479,7 @@ wstat_symlink_aware(const WCHAR *name, stat_T *stp)
487479
{
488480
int fd;
489481

490-
fd = _open_osfhandle((OPEN_OH_ARGTYPE)h, _O_RDONLY);
482+
fd = _open_osfhandle((intptr_t)h, _O_RDONLY);
491483
n = _fstat(fd, (struct _stat *)stp);
492484
if ((n == 0) && (attr & FILE_ATTRIBUTE_DIRECTORY))
493485
stp->st_mode = (stp->st_mode & ~S_IFREG) | S_IFDIR;
@@ -881,7 +873,7 @@ mch_libcall(
881873
__except(EXCEPTION_EXECUTE_HANDLER)
882874
{
883875
if (GetExceptionCode() == EXCEPTION_STACK_OVERFLOW)
884-
RESETSTKOFLW();
876+
_resetstkoflw();
885877
fRunTimeLinkSuccess = 0;
886878
}
887879
# endif
@@ -1043,14 +1035,7 @@ swap_me(COLORREF colorref)
10431035
return colorref;
10441036
}
10451037

1046-
// Attempt to make this work for old and new compilers
1047-
# if !defined(_WIN64) && (!defined(_MSC_VER) || _MSC_VER < 1300)
1048-
# define PDP_RETVAL BOOL
1049-
# else
1050-
# define PDP_RETVAL INT_PTR
1051-
# endif
1052-
1053-
static PDP_RETVAL CALLBACK
1038+
static INT_PTR CALLBACK
10541039
PrintDlgProc(
10551040
HWND hDlg,
10561041
UINT message,

src/os_win32.c

Lines changed: 0 additions & 82 deletions
Original file line numberDiff line numberDiff line change
@@ -7464,88 +7464,6 @@ mch_copy_file_attribute(char_u *from, char_u *to)
74647464
return 0;
74657465
}
74667466

7467-
#if defined(MYRESETSTKOFLW) || defined(PROTO)
7468-
/*
7469-
* Recreate a destroyed stack guard page in win32.
7470-
* Written by Benjamin Peterson.
7471-
*/
7472-
7473-
// These magic numbers are from the MS header files
7474-
# define MIN_STACK_WINNT 2
7475-
7476-
/*
7477-
* This function does the same thing as _resetstkoflw(), which is only
7478-
* available in DevStudio .net and later.
7479-
* Returns 0 for failure, 1 for success.
7480-
*/
7481-
int
7482-
myresetstkoflw(void)
7483-
{
7484-
BYTE *pStackPtr;
7485-
BYTE *pGuardPage;
7486-
BYTE *pStackBase;
7487-
BYTE *pLowestPossiblePage;
7488-
MEMORY_BASIC_INFORMATION mbi;
7489-
SYSTEM_INFO si;
7490-
DWORD nPageSize;
7491-
DWORD dummy;
7492-
7493-
// We need to know the system page size.
7494-
GetSystemInfo(&si);
7495-
nPageSize = si.dwPageSize;
7496-
7497-
// ...and the current stack pointer
7498-
pStackPtr = (BYTE*)_alloca(1);
7499-
7500-
// ...and the base of the stack.
7501-
if (VirtualQuery(pStackPtr, &mbi, sizeof mbi) == 0)
7502-
return 0;
7503-
pStackBase = (BYTE*)mbi.AllocationBase;
7504-
7505-
// ...and the page that's min_stack_req pages away from stack base; this is
7506-
// the lowest page we could use.
7507-
pLowestPossiblePage = pStackBase + MIN_STACK_WINNT * nPageSize;
7508-
7509-
{
7510-
// We want the first committed page in the stack Start at the stack
7511-
// base and move forward through memory until we find a committed block.
7512-
BYTE *pBlock = pStackBase;
7513-
7514-
for (;;)
7515-
{
7516-
if (VirtualQuery(pBlock, &mbi, sizeof mbi) == 0)
7517-
return 0;
7518-
7519-
pBlock += mbi.RegionSize;
7520-
7521-
if (mbi.State & MEM_COMMIT)
7522-
break;
7523-
}
7524-
7525-
// mbi now describes the first committed block in the stack.
7526-
if (mbi.Protect & PAGE_GUARD)
7527-
return 1;
7528-
7529-
// decide where the guard page should start
7530-
if ((long_u)(mbi.BaseAddress) < (long_u)pLowestPossiblePage)
7531-
pGuardPage = pLowestPossiblePage;
7532-
else
7533-
pGuardPage = (BYTE*)mbi.BaseAddress;
7534-
7535-
// allocate the guard page
7536-
if (!VirtualAlloc(pGuardPage, nPageSize, MEM_COMMIT, PAGE_READWRITE))
7537-
return 0;
7538-
7539-
// apply the guard attribute to the page
7540-
if (!VirtualProtect(pGuardPage, nPageSize, PAGE_READWRITE | PAGE_GUARD,
7541-
&dummy))
7542-
return 0;
7543-
}
7544-
7545-
return 1;
7546-
}
7547-
#endif
7548-
75497467

75507468
/*
75517469
* The command line arguments in UTF-16

0 commit comments

Comments
 (0)