summaryrefslogtreecommitdiff
path: root/sv.h
diff options
context:
space:
mode:
authorNick Ing-Simmons <nik@tiuk.ti.com>1997-11-07 01:37:28 +0000
committerNick Ing-Simmons <nik@tiuk.ti.com>1997-11-07 01:37:28 +0000
commite77eedc24c0252a902559034f2aa207f216529cc (patch)
treed59ef6c28b87613607887003bd9d900644335b67 /sv.h
parent4e35701fd273ba8d0093a29660dee38a92408e9b (diff)
parent5756a3ac9bce8d31d81b13d0e57cdc87e2565fe4 (diff)
downloadperl-e77eedc24c0252a902559034f2aa207f216529cc.tar.gz
Raw integrate of latest perl
p4raw-id: //depot/ansiperl@208
Diffstat (limited to 'sv.h')
-rw-r--r--sv.h15
1 files changed, 9 insertions, 6 deletions
diff --git a/sv.h b/sv.h
index 7a283a6334..c888d8fcac 100644
--- a/sv.h
+++ b/sv.h
@@ -71,13 +71,16 @@ struct io {
#define SvANY(sv) (sv)->sv_any
#define SvFLAGS(sv) (sv)->sv_flags
-#define SvREFCNT(sv) (sv)->sv_refcnt
-#ifdef CRIPPLED_CC
-#define SvREFCNT_inc(sv) sv_newref((SV*)sv)
-#define SvREFCNT_dec(sv) sv_free((SV*)sv)
+#ifdef __GNUC__
+# define SvREFCNT_inc(sv) ({SV* nsv=(SV*)(sv); if(nsv) ++SvREFCNT(nsv); nsv;})
#else
-#define SvREFCNT_inc(sv) ((Sv = (SV*)(sv)), \
- (Sv && ++SvREFCNT(Sv)), (SV*)Sv)
+# if defined(CRIPPLED_CC) || defined(USE_THREADS)
+# define SvREFCNT_inc(sv) sv_newref((SV*)sv)
+# else
+# define SvREFCNT_inc(sv) ((Sv=(SV*)(sv)), (Sv && ++SvREFCNT(Sv)), (SV*)Sv)
+# endif
+#endif
+
#define SvREFCNT_dec(sv) sv_free((SV*)sv)
#endif