summaryrefslogtreecommitdiff
path: root/cv.h
diff options
context:
space:
mode:
authorSteve Hay <steve.m.hay@googlemail.com>2012-08-18 00:33:53 +0100
committerSteve Hay <steve.m.hay@googlemail.com>2012-08-18 00:33:53 +0100
commitf28d8eb1c114895944de593e05ba8271fe1b4fdf (patch)
tree35c1ae5be7136bac2677557917e75f5aa4e79083 /cv.h
parent9d2d23d98141e59338d57996fe0c74d36351f6e9 (diff)
downloadperl-f28d8eb1c114895944de593e05ba8271fe1b4fdf.tar.gz
Restore VC++ 6 build on Windows
Commits bb02a38feb and 1bd3586145 resulted in VC++ 6 complaining "error C2099: initializer is not a constant" when initializing bodies_by_type in sv.c. Workaround the apparent compiler bug using a patch from Jan Dubois, amended to be compiler-specific as suggested by Nicholas Clark since anonymous unions are not valid C89. Date: Wed, 15 Aug 2012 00:55:06 -0700 Message-ID: <005a01cd7abb$498294e0$dc87bea0$@activestate.com>
Diffstat (limited to 'cv.h')
-rw-r--r--cv.h4
1 files changed, 4 insertions, 0 deletions
diff --git a/cv.h b/cv.h
index e8cb162272..cd722f3c92 100644
--- a/cv.h
+++ b/cv.h
@@ -66,7 +66,11 @@ S_CvDEPTHp(const CV * const sv)
{
return SvTYPE(sv) == SVt_PVCV
? &((XPVCV*)SvANY(sv))->xcv_depth
+#if defined(_MSC_VER) && _MSC_VER < 1300
+ : &((XPVCV*)SvANY(sv))->xpvcuru_fmdepth;
+#else
: &((XPVCV*)SvANY(sv))->xpv_cur_u.xpvcuru_fmdepth;
+#endif
}
#if defined(__GNUC__) && !defined(PERL_GCC_BRACE_GROUPS_FORBIDDEN)
# define CvDEPTH(sv) (*({const CV *const _cvdepth = (const CV *)sv; \