Skip to content

_MSC_VER is now always >= 1800 (Visual C++ 2013 / Visual C++ 12.0) #19226

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Dec 16, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 2 additions & 7 deletions perl.h
Original file line number Diff line number Diff line change
Expand Up @@ -543,11 +543,6 @@ __typeof__ and nothing else.
# endif
#endif

#if defined(_MSC_VER) && _MSC_VER < 1400
/* XXX older MSVC versions have a smallish macro buffer */
# define PERL_SMALL_MACRO_BUFFER
#endif

Comment on lines -546 to -550
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It should be possible to eliminate all PERL_SMALL_MACRO_BUFFER references, since the macro was added to support older MSVC and it isn't defined anywhere else.

@khw might have an opinion here.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think I oppose removal of this at this time. I think we may find it useful

/* on gcc (and clang), specify that a warning should be temporarily
* ignored; e.g.
*
Expand Down Expand Up @@ -600,7 +595,7 @@ __typeof__ and nothing else.
#define CLANG_DIAG_IGNORE_STMT(x) CLANG_DIAG_IGNORE(x) NOOP
#define CLANG_DIAG_RESTORE_STMT CLANG_DIAG_RESTORE NOOP

#if defined(_MSC_VER) && (_MSC_VER >= 1300)
#if defined(_MSC_VER)
# define MSVC_DIAG_IGNORE(x) __pragma(warning(push)) \
__pragma(warning(disable : x))
# define MSVC_DIAG_RESTORE __pragma(warning(pop))
Expand Down Expand Up @@ -1011,7 +1006,7 @@ Example usage:
* on unthreaded builds */
# elif (defined(USE_ITHREADS) || defined(USE_THREAD_SAFE_LOCALE)) \
&& ( defined(HAS_POSIX_2008_LOCALE) \
|| (defined(WIN32) && defined(_MSC_VER) && _MSC_VER >= 1400)) \
|| (defined(WIN32) && defined(_MSC_VER))) \
&& ! defined(NO_THREAD_SAFE_LOCALE)
# ifndef USE_THREAD_SAFE_LOCALE
# define USE_THREAD_SAFE_LOCALE
Expand Down
6 changes: 0 additions & 6 deletions util.c
Original file line number Diff line number Diff line change
Expand Up @@ -5775,12 +5775,6 @@ Perl_my_strlcpy(char *dst, const char *src, Size_t size)
}
#endif

#if defined(_MSC_VER) && (_MSC_VER >= 1300) && (_MSC_VER < 1400) && (WINVER < 0x0500)
/* VC7 or 7.1, building with pre-VC7 runtime libraries. */
long _ftol( double ); /* Defined by VC6 C libs. */
long _ftol2( double dblSource ) { return _ftol( dblSource ); }
#endif

PERL_STATIC_INLINE bool
S_gv_has_usable_name(pTHX_ GV *gv)
{
Expand Down
13 changes: 1 addition & 12 deletions win32/win32.c
Original file line number Diff line number Diff line change
Expand Up @@ -92,18 +92,7 @@ END_EXTERN_C
# define getlogin g_getlogin
#endif

/* VS2005 (MSC version 14) provides a mechanism to set an invalid
* parameter handler. This functionality is not available in the
* 64-bit compiler from the Platform SDK, which unfortunately also
* believes itself to be MSC version 14.
*
* There is no #define related to _set_invalid_parameter_handler(),
* but we can check for one of the constants defined for
* _set_abort_behavior(), which was introduced into stdlib.h at
* the same time.
*/

#if _MSC_VER >= 1400 && defined(_WRITE_ABORT_MSG)
#ifdef _MSC_VER
# define SET_INVALID_PARAMETER_HANDLER
#endif

Expand Down
27 changes: 1 addition & 26 deletions win32/win32.h
Original file line number Diff line number Diff line change
Expand Up @@ -260,17 +260,9 @@ typedef long uid_t;
typedef long gid_t;
typedef unsigned short mode_t;

#if _MSC_VER < 1800
#define isnan _isnan /* Defined already in VC++ 12.0 */
#endif
#define snprintf _snprintf
#define vsnprintf _vsnprintf

/* on VS2003, msvcrt.lib is missing these symbols */
#if _MSC_VER >= 1300 && _MSC_VER < 1400
# pragma intrinsic(_rotl64,_rotr64)
#endif

MSVC_DIAG_IGNORE(4756 4056)
PERL_STATIC_INLINE
double S_Infinity() {
Expand Down Expand Up @@ -620,17 +612,7 @@ void win32_wait_for_children(pTHX);
# define _CRTIMP __declspec(dllimport)
#endif


/* VS2005 has multiple ioinfo struct definitions through VS2005's release life
* VS2008-2012 have been stable but do not assume future VSs will have the
* same ioinfo struct, just because past struct stability. If research is done
* on the CRTs of future VSs, the version check can be bumped up so the newer
* VS uses a fixed ioinfo size. (Actually, only VS2013 (_MSC_VER 1800) hasn't
* been looked at; after that we cannot use the ioinfo struct anyway (see the
* #if above).)
*/
#if ! (_MSC_VER < 1400 || (_MSC_VER >= 1500 && _MSC_VER <= 1700) \
|| defined(__MINGW32__))
#ifndef __MINGW32__
/* size of ioinfo struct is determined at runtime */
# define WIN32_DYN_IOINFO_SIZE
#endif
Expand All @@ -647,12 +629,6 @@ typedef struct {
CRITICAL_SECTION lock;
/* this struct definition breaks ABI compatibility with
* not using, cl.exe's native VS version specitfic CRT. */
# if _MSC_VER >= 1400 && _MSC_VER < 1500
# error "This ioinfo struct is incomplete for Visual C 2005"
# endif
/* VS2005 CRT has at least 3 different definitions of this struct based on the
* CRT DLL's build number. */
# if _MSC_VER >= 1500
# ifndef _SAFECRT_IMPL
/* Not used in the safecrt downlevel. We do not define them, so we cannot
* use them accidentally */
Expand All @@ -664,7 +640,6 @@ typedef struct {
char dbcsBuffer; /* Buffer for the lead byte of dbcs when converting from dbcs to unicode */
BOOL dbcsBufferUsed; /* Bool for the lead byte buffer is used or not */
# endif
# endif
} ioinfo;
#else
typedef intptr_t ioinfo;
Expand Down