summaryrefslogtreecommitdiff
path: root/inline.h
diff options
context:
space:
mode:
authorFather Chrysostomos <sprout@cpan.org>2012-08-18 13:16:31 -0700
committerFather Chrysostomos <sprout@cpan.org>2012-08-21 16:38:35 -0700
commit1afe1db112afcab7a87a011bd5c02cf0cc8ea95c (patch)
tree063b55c2d87b8b5f6961fc63f69c2e9c812ac60d /inline.h
parent541377b1bd73cdee43dd47958251827cfdc59320 (diff)
downloadperl-1afe1db112afcab7a87a011bd5c02cf0cc8ea95c.tar.gz
Move S_CvDEPTHp from cv.h to inline.h; shrink macros
This allows us to use assert() inside S_CvDEPTHp, so we no longer need GCC and non-GCC variants of the macro that calls it.
Diffstat (limited to 'inline.h')
-rw-r--r--inline.h11
1 files changed, 11 insertions, 0 deletions
diff --git a/inline.h b/inline.h
index eee1097b1e..2b988a2019 100644
--- a/inline.h
+++ b/inline.h
@@ -12,6 +12,17 @@
* Each section names the header file that the functions "belong" to.
*/
+/* ------------------------------- cv.h ------------------------------- */
+
+PERL_STATIC_INLINE I32 *
+S_CvDEPTHp(const CV * const sv)
+{
+ assert(SvTYPE(sv) == SVt_PVCV || SvTYPE(sv) == SVt_PVFM);
+ return SvTYPE(sv) == SVt_PVCV
+ ? &((XPVCV*)SvANY(sv))->xcv_depth
+ : &((XPVCV*)SvANY(sv))->xpv_fmdepth;
+}
+
/* ------------------------------- sv.h ------------------------------- */
PERL_STATIC_INLINE SV *