This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
sv.h: Don’t repeat _XPV_HEAD
authorFather Chrysostomos <sprout@cpan.org>
Fri, 17 Aug 2012 23:52:50 +0000 (16:52 -0700)
committerFather Chrysostomos <sprout@cpan.org>
Sat, 18 Aug 2012 01:15:43 +0000 (18:15 -0700)
cv.h
sv.h

diff --git a/cv.h b/cv.h
index cd722f3..36a3592 100644 (file)
--- a/cv.h
+++ b/cv.h
@@ -66,11 +66,7 @@ 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
+       : &((XPVCV*)SvANY(sv))->xpv_fmdepth;
 }
 #if defined(__GNUC__) && !defined(PERL_GCC_BRACE_GROUPS_FORBIDDEN)
 #  define CvDEPTH(sv) (*({const CV *const _cvdepth = (const CV *)sv; \
diff --git a/sv.h b/sv.h
index 1c0a0f1..ef2b1ae 100644 (file)
--- a/sv.h
+++ b/sv.h
@@ -417,30 +417,22 @@ perform the upgrade if necessary.  See C<svtype>.
  * using an anonymous union, but only for MSVC6 since that isn't C89.
  */
 #if defined(_MSC_VER) && _MSC_VER < 1300
-#define _XPV_HEAD                                                      \
-    HV*                xmg_stash;      /* class package */                     \
-    union _xmgu        xmg_u;                                                  \
-    union {                                                            \
-       STRLEN  xpvcuru_cur;    /* length of svu_pv as a C string */    \
-       I32     xpvcuru_fmdepth;                                        \
-    };                                                                 \
-    STRLEN     xpv_len         /* allocated size */
+# define _XPV_CUR_U_NAME
+# define xpv_cur       xpvcuru_cur
+# define xpv_fmdepth   xpvcuru_fmdepth
 #else
+# define _XPV_CUR_U_NAME xpv_cur_u
+# define xpv_cur       xpv_cur_u.xpvcuru_cur
+# define xpv_fmdepth   xpv_cur_u.xpvcuru_fmdepth
+#endif
 #define _XPV_HEAD                                                      \
     HV*                xmg_stash;      /* class package */                     \
     union _xmgu        xmg_u;                                                  \
     union {                                                            \
        STRLEN  xpvcuru_cur;    /* length of svu_pv as a C string */    \
        I32     xpvcuru_fmdepth;                                        \
-    }          xpv_cur_u;                                              \
+    }          _XPV_CUR_U_NAME;                                        \
     STRLEN     xpv_len         /* allocated size */
-#endif
-
-#if defined(_MSC_VER) && _MSC_VER < 1300
-#define xpv_cur        xpvcuru_cur
-#else
-#define xpv_cur        xpv_cur_u.xpvcuru_cur
-#endif
 
 union _xnvu {
     NV     xnv_nv;             /* numeric value, if any */