summaryrefslogtreecommitdiff
path: root/av.h
diff options
context:
space:
mode:
authorKarl Williamson <khw@cpan.org>2016-03-19 22:48:54 -0600
committerKarl Williamson <khw@cpan.org>2016-03-19 23:00:35 -0600
commit8dbc0cc7f2b47d12cdda7f5e0c7ac82ebda704f2 (patch)
treed18b91d453060cece2967b5ec674fe9407eb99e5 /av.h
parent4ae69d38605cf6ef02d0d304ad4fbb45603ecabb (diff)
downloadperl-8dbc0cc7f2b47d12cdda7f5e0c7ac82ebda704f2.tar.gz
Imprison at_tindex_nomg()
This name is controversial. Use #ifdef's to keep it from being exposed outside of the places that already use it. And don't publicize that it exists.
Diffstat (limited to 'av.h')
-rw-r--r--av.h9
1 files changed, 8 insertions, 1 deletions
diff --git a/av.h b/av.h
index 9b9b373663..d6d21378e4 100644
--- a/av.h
+++ b/av.h
@@ -81,7 +81,14 @@ Same as C<av_top_index()>.
? mg_size(MUTABLE_SV(av)) : AvFILLp(av))
#define av_tindex(av) av_top_index(av)
-#define av_tindex_nomg(av) (__ASSERT_(SvTYPE(av) == SVt_PVAV) AvFILLp(av))
+#if defined(PERL_IN_REGCOMP_C) || defined(PERL_IN_REGEXEC_C) || defined(PERL_IN_UTF8_C)
+/* Note that it doesn't make sense to do this:
+ * SvGETMAGIC(av); IV x = av_tindex_nomg(av);
+ * This name is controversial, and so is restricted by the #ifdef to the places
+ * it already occurs
+ */
+# define av_tindex_nomg(av) (__ASSERT_(SvTYPE(av) == SVt_PVAV) AvFILLp(av))
+#endif
#define NEGATIVE_INDICES_VAR "NEGATIVE_INDICES"