summaryrefslogtreecommitdiff
path: root/sv.h
diff options
context:
space:
mode:
authorFather Chrysostomos <sprout@cpan.org>2010-09-24 22:22:26 -0700
committerFather Chrysostomos <sprout@cpan.org>2010-09-24 22:22:26 -0700
commit396a5c010b97dacac9ad5dd6e03dce6156d95cb7 (patch)
treeffc905c6ee58099f509b37e4db7516730638429e /sv.h
parenta7e935015aa7c242f0e4ad14366401108880ed0b (diff)
downloadperl-396a5c010b97dacac9ad5dd6e03dce6156d95cb7.tar.gz
define SvTRUE_nomg for compilers other than gcc
This time I *really* broke the Windows build!
Diffstat (limited to 'sv.h')
-rw-r--r--sv.h15
1 files changed, 15 insertions, 0 deletions
diff --git a/sv.h b/sv.h
index c081d6a890..f309d362e1 100644
--- a/sv.h
+++ b/sv.h
@@ -1707,6 +1707,21 @@ Like sv_utf8_upgrade, but doesn't do magic on C<sv>
: SvNOK(sv) \
? SvNVX(sv) != 0.0 \
: sv_2bool(sv) )
+# define SvTRUE_nomg(sv) ( \
+ !sv \
+ ? 0 \
+ : SvPOK(sv) \
+ ? ((PL_Xpv = (XPV*)SvANY(PL_Sv = (sv))) && \
+ (PL_Xpv->xpv_cur > 1 || \
+ (PL_Xpv->xpv_cur && *PL_Sv->sv_u.svu_pv != '0')) \
+ ? 1 \
+ : 0) \
+ : \
+ SvIOK(sv) \
+ ? SvIVX(sv) != 0 \
+ : SvNOK(sv) \
+ ? SvNVX(sv) != 0.0 \
+ : sv_2bool_flags(sv,0) )
# define SvTRUEx(sv) ((PL_Sv = (sv)), SvTRUE(PL_Sv))
#endif /* __GNU__ */