summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSteve Hay <steve.m.hay@googlemail.com>2013-09-19 14:27:10 +0100
committerSteve Hay <steve.m.hay@googlemail.com>2013-09-19 14:50:43 +0100
commit9ea4080170688502a51eb7f66ecfafe8f08c4cd8 (patch)
treee57792439df20034f04ad57cec922950e36c2964
parente8384d8ddf034f3e8db40d1beac3236976fa05ba (diff)
downloadperl-9ea4080170688502a51eb7f66ecfafe8f08c4cd8.tar.gz
Add a USING_MSVC6 macro to identify Microsoft Visual C++ 6.0
This simplifies some of the logic necessary for coping with its various problems. Suggested by Nicholas Clark.
-rw-r--r--handy.h2
-rw-r--r--perl.h13
-rw-r--r--util.h4
-rw-r--r--win32/win32.h2
4 files changed, 11 insertions, 10 deletions
diff --git a/handy.h b/handy.h
index 27fb18b574..f80ba2c9a5 100644
--- a/handy.h
+++ b/handy.h
@@ -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
diff --git a/perl.h b/perl.h
index 0da8ed7671..1e8e870f6f 100644
--- a/perl.h
+++ b/perl.h
@@ -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
diff --git a/util.h b/util.h
index 87a3f26914..08544f5600 100644
--- a/util.h
+++ b/util.h
@@ -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