#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
# 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
# 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
/* 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
#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