]> git.vpit.fr Git - perl/modules/subs-auto.git/blob - auto.xs
Document that the pragma doesn't propagate into eval STRING
[perl/modules/subs-auto.git] / auto.xs
1 /* This file is part of the subs::auto Perl module.
2  * See http://search.cpan.org/dist/subs-auto/ */
3
4 #define PERL_NO_GET_CONTEXT
5 #include "EXTERN.h"
6 #include "perl.h"
7 #include "XSUB.h"
8
9 MODULE = subs::auto      PACKAGE = subs::auto
10
11 PROTOTYPES: ENABLE
12
13 void
14 _delete_sub(SV *fqn)
15 PREINIT:
16  GV *gv;
17 PPCODE:
18  gv = gv_fetchsv(fqn, 0, 0);
19  if (gv) {
20   CV *cv = GvCV(gv);
21   GvCV(gv) = NULL;
22   SvREFCNT_dec(cv);
23  }
24  XSRETURN(0);