diff options
-rw-r--r-- | handy.h | 2 | ||||
-rw-r--r-- | perl.h | 13 | ||||
-rw-r--r-- | util.h | 4 | ||||
-rw-r--r-- | win32/win32.h | 2 |
4 files changed, 11 insertions, 10 deletions
@@ -125,7 +125,7 @@ Null SV pointer. (No longer available when C<PERL_CORE> is defined.) #if (defined(__STDC_VERSION__) && __STDC_VERSION__ >= 199901L) || (defined(__SUNPRO_C)) /* C99 or close enough. */ # define FUNCTION__ __func__ #else -# if (defined(_MSC_VER) && _MSC_VER < 1300) || /* MSVC6 has neither __func__ nor __FUNCTION and no good workarounds, either. */ \ +# if (defined(USING_MSVC6)) || /* MSVC6 has neither __func__ nor __FUNCTION and no good workarounds, either. */ \ (defined(__DECC_VER)) /* Tru64 or VMS, and strict C89 being used, but not modern enough cc (in Tur64, -c99 not known, only -std1). */ # define FUNCTION__ "" # else @@ -109,6 +109,11 @@ # endif #endif +/* Microsoft Visual C++ 6.0 needs special treatment in numerous places */ +#if defined(WIN32) && defined(_MSC_VER) && _MSC_VER >= 1200 && _MSC_VER < 1300 +# define USING_MSVC6 +#endif + #undef START_EXTERN_C #undef END_EXTERN_C #undef EXTERN_C @@ -1605,13 +1610,11 @@ typedef UVTYPE UV; # else # undef IV_IS_QUAD # undef UV_IS_QUAD -#ifndef PERL_CORE +#if !defined(PERL_CORE) || defined(USING_MSVC6) /* We think that removing this decade-old undef this will cause too much breakage on CPAN for too little gain. (See RT #119753) - However, we do need HAS_QUAD in the core for use by the drand48 code. */ -# undef HAS_QUAD -#elif defined(_MSC_VER) && _MSC_VER < 1300 -/* Undef HAS_QUAD in core for Win32 VC6 because it has poor __int64 support. */ + However, we do need HAS_QUAD in the core for use by the drand48 code, + but not for Win32 VC6 because it has poor __int64 support. */ # undef HAS_QUAD #endif # endif @@ -55,12 +55,10 @@ This is a synonym for (! foldEQ_locale()) /* outside the core, perl.h undefs HAS_QUAD if IV isn't 64-bit We can't swap this to HAS_QUAD, because the logic here affects the type of perl_drand48_t below, and that is visible outside of the core. */ -#ifdef U64TYPE -# if !defined(_MSC_VER) || _MSC_VER >= 1300 +#if defined(U64TYPE) && !defined(USING_MSVC6) /* use a faster implementation when quads are available, * but not with VC6 on Windows */ # define PERL_DRAND48_QUAD -# endif #endif #ifdef PERL_DRAND48_QUAD diff --git a/win32/win32.h b/win32/win32.h index 47a1dc6024..79fe071351 100644 --- a/win32/win32.h +++ b/win32/win32.h @@ -246,7 +246,7 @@ typedef unsigned short mode_t; #define snprintf _snprintf #define vsnprintf _vsnprintf -#if _MSC_VER < 1300 +#ifdef USING_MSVC6 /* VC6 has broken NaN semantics: NaN == NaN returns true instead of false */ #define NAN_COMPARE_BROKEN 1 #endif |