Problem: MS-Windows: Support for MSVC 2003 is not useful.
Solution: Remove the exceptions for MSVC 2003. (Ken Takata, closes #9616)
#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)
*
* 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,
return ea.nextcmd;
}
-#if (_MSC_VER == 1200)
- #pragma optimize( "", on )
-#endif
static char ex_error_buf[MSG_BUF_LEN];
&& (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
# 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;
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)
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"));
# 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)
# 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()
# 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))
}
}
-// 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)
{
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;
__except(EXCEPTION_EXECUTE_HANDLER)
{
if (GetExceptionCode() == EXCEPTION_STACK_OVERFLOW)
- RESETSTKOFLW();
+ _resetstkoflw();
fRunTimeLinkSuccess = 0;
}
# endif
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,
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
#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))
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);
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.
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
/*
static int included_patches[] =
{ /* Add new patch number below this line */
+/**/
+ 4199,
/**/
4198,
/**/
// 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;
* 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
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;