summaryrefslogtreecommitdiff
path: root/ext/XS-APItest/APItest.xs
diff options
context:
space:
mode:
Diffstat (limited to 'ext/XS-APItest/APItest.xs')
-rw-r--r--ext/XS-APItest/APItest.xs33
1 files changed, 33 insertions, 0 deletions
diff --git a/ext/XS-APItest/APItest.xs b/ext/XS-APItest/APItest.xs
index 3bad3286f2..23dd9637c6 100644
--- a/ext/XS-APItest/APItest.xs
+++ b/ext/XS-APItest/APItest.xs
@@ -923,6 +923,39 @@ amagic_deref_call(sv, what)
/* The reference is owned by something else. */
PUSHs(amagic_deref_call(sv, what));
+# I'd certainly like to discourage the use of this macro, given that we now
+# have amagic_deref_call
+
+SV *
+tryAMAGICunDEREF_var(sv, what)
+ SV *sv
+ int what
+ PPCODE:
+ {
+ SV **sp = &sv;
+ switch(what) {
+ case to_av_amg:
+ tryAMAGICunDEREF(to_av);
+ break;
+ case to_cv_amg:
+ tryAMAGICunDEREF(to_cv);
+ break;
+ case to_gv_amg:
+ tryAMAGICunDEREF(to_gv);
+ break;
+ case to_hv_amg:
+ tryAMAGICunDEREF(to_hv);
+ break;
+ case to_sv_amg:
+ tryAMAGICunDEREF(to_sv);
+ break;
+ default:
+ croak("Invalid value %d passed to tryAMAGICunDEREF_var", what);
+ }
+ }
+ /* The reference is owned by something else. */
+ PUSHs(sv);
+
MODULE = XS::APItest PACKAGE = XS::APItest::XSUB
BOOT: