diff options
author | Father Chrysostomos <sprout@cpan.org> | 2012-08-17 16:52:50 -0700 |
---|---|---|
committer | Father Chrysostomos <sprout@cpan.org> | 2012-08-17 18:15:43 -0700 |
commit | 501ba3026277333479fde2f8462a44127ed55fa9 (patch) | |
tree | 38ab9c1a72d8f854658be92a0c3929a70afd567c | |
parent | 40429ee3823684b44041b4036cd3ba2322094f97 (diff) | |
download | perl-501ba3026277333479fde2f8462a44127ed55fa9.tar.gz |
sv.h: Don’t repeat _XPV_HEAD
-rw-r--r-- | cv.h | 6 | ||||
-rw-r--r-- | sv.h | 24 |
2 files changed, 9 insertions, 21 deletions
@@ -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; \ @@ -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 */ |