diff options
author | Nick Ing-Simmons <nik@tiuk.ti.com> | 1997-11-07 23:52:35 +0000 |
---|---|---|
committer | Nick Ing-Simmons <nik@tiuk.ti.com> | 1997-11-07 23:52:35 +0000 |
commit | aeea060ce4b653ecf5b0731f1cbfcf468f688acd (patch) | |
tree | 071ed1fbe63cb80bbddce550bd8c0b9942527b3f /sv.h | |
parent | e77eedc24c0252a902559034f2aa207f216529cc (diff) | |
download | perl-aeea060ce4b653ecf5b0731f1cbfcf468f688acd.tar.gz |
Reverse integrate Malcolm's chanes into local
repository, then import result back into my view
of Malcolm's repository.
Builds and passes (most) tests with GNU C++/Solaris
and Borland C++, Win32.
p4raw-id: //depot/ansiperl@210
Diffstat (limited to 'sv.h')
-rw-r--r-- | sv.h | 32 |
1 files changed, 23 insertions, 9 deletions
@@ -70,6 +70,7 @@ struct io { #define SvANY(sv) (sv)->sv_any #define SvFLAGS(sv) (sv)->sv_flags +#define SvREFCNT(sv) (sv)->sv_refcnt #ifdef __GNUC__ # define SvREFCNT_inc(sv) ({SV* nsv=(SV*)(sv); if(nsv) ++SvREFCNT(nsv); nsv;}) @@ -82,7 +83,6 @@ struct io { #endif #define SvREFCNT_dec(sv) sv_free((SV*)sv) -#endif #define SVTYPEMASK 0xff #define SvTYPE(sv) ((sv)->sv_flags & SVTYPEMASK) @@ -546,19 +546,33 @@ struct xpvio { ? SvNVX(sv) != 0.0 \ : sv_2bool(sv) ) -#define SvIVx(sv) ((Sv = (sv)), SvIV(Sv)) -#define SvUVx(sv) ((Sv = (sv)), SvUV(Sv)) -#define SvNVx(sv) ((Sv = (sv)), SvNV(Sv)) -#define SvPVx(sv, lp) ((Sv = (sv)), SvPV(Sv, lp)) +#ifdef __GNUC__ +# define SvIVx(sv) ({SV *nsv = (SV*)(sv); SvIV(nsv); }) +# define SvUVx(sv) ({SV *nsv = (SV*)(sv); SvUV(nsv); }) +# define SvNVx(sv) ({SV *nsv = (SV*)(sv); SvNV(nsv); }) +# define SvPVx(sv, lp) ({SV *nsv = (sv); SvPV(nsv, lp); }) +#else +# define SvIVx(sv) ((Sv = (sv)), SvIV(Sv)) +# define SvUVx(sv) ((Sv = (sv)), SvUV(Sv)) +# define SvNVx(sv) ((Sv = (sv)), SvNV(Sv)) +# define SvPVx(sv, lp) ((Sv = (sv)), SvPV(Sv, lp)) +#endif /* __GNUC__ */ + #define SvTRUEx(sv) ((Sv = (sv)), SvTRUE(Sv)) #endif /* CRIPPLED_CC */ #define newRV_inc(sv) newRV(sv) -#ifndef CRIPPLED_CC -#undef newRV_noinc -#define newRV_noinc(sv) ((Sv = newRV(sv)), --SvREFCNT(SvRV(Sv)), Sv) -#endif +#ifdef __GNUC__ +# undef newRV_noinc +# define newRV_noinc(sv) ({SV *nsv=newRV((sv)); --SvREFCNT(SvRV(nsv)); nsv;}) +#else +# if defined(CRIPPLED_CC) || defined(USE_THREADS) +# else +# undef newRV_noinc +# define newRV_noinc(sv) ((Sv = newRV(sv)), --SvREFCNT(SvRV(Sv)), Sv) +# endif +#endif /* __GNUC__ */ /* the following macro updates any magic values this sv is associated with */ |