diff options
author | Jesse Luehrs <doy@tozt.net> | 2010-11-13 22:19:27 -0600 |
---|---|---|
committer | Jesse Luehrs <doy@tozt.net> | 2010-11-13 22:28:26 -0600 |
commit | 3720d1a13fa8f0ac849cfaf320efc847db454cca (patch) | |
tree | 41b9e71a036109918fae2f4ece75354b37330cbb | |
parent | 520f29d6a96684ce7a681e07084ee1f0c90bc67e (diff) | |
download | package-stash-xs-3720d1a13fa8f0ac849cfaf320efc847db454cca.tar.gz package-stash-xs-3720d1a13fa8f0ac849cfaf320efc847db454cca.zip |
make sure the SV glob slot is always populated on 5.8
-rw-r--r-- | Stash.xs | 10 |
1 files changed, 10 insertions, 0 deletions
@@ -39,11 +39,21 @@ #define GvCVOK(g) GvCVu(g) /* XXX: should this really be GvCVu? or GvCV? */ #define GvIOOK(g) GvIO(g) +#if PERL_VERSION < 10 +#define GvSetSV(g,v) do { \ + SV *_v = (SV*)(v); \ + SvREFCNT_dec(GvSV(g)); \ + if ((GvSV(g) = _v ? _v : newSV(0))) \ + GvIMPORTED_SV_on(g); \ +} while (0) +#else #define GvSetSV(g,v) do { \ SvREFCNT_dec(GvSV(g)); \ if ((GvSV(g) = (SV*)(v))) \ GvIMPORTED_SV_on(g); \ } while (0) +#endif + #define GvSetAV(g,v) do { \ SvREFCNT_dec(GvAV(g)); \ if ((GvAV(g) = (AV*)(v))) \ |