1 | #define PERL_NO_GET_CONTEXT |
1 | #define PERL_NO_GET_CONTEXT |
2 | |
2 | |
3 | #include "EXTERN.h" |
3 | #include "EXTERN.h" |
4 | #include "perl.h" |
4 | #include "perl.h" |
5 | #include "XSUB.h" |
5 | #include "XSUB.h" |
|
|
6 | |
|
|
7 | #ifndef SvSTASH_set |
|
|
8 | # define SvSTASH_set(x,a) SvSTASH(x) = (a) |
|
|
9 | #endif |
|
|
10 | |
|
|
11 | #ifndef PERL_MAGIC_ext |
|
|
12 | # define PERL_MAGIC_ext '~' |
|
|
13 | #endif |
6 | |
14 | |
7 | static HV *guard_stash; |
15 | static HV *guard_stash; |
8 | |
16 | |
9 | static SV * |
17 | static SV * |
10 | guard_get_cv (pTHX_ SV *cb_sv) |
18 | guard_get_cv (pTHX_ SV *cb_sv) |
… | |
… | |
78 | |
86 | |
79 | MODULE = Guard PACKAGE = Guard |
87 | MODULE = Guard PACKAGE = Guard |
80 | |
88 | |
81 | BOOT: |
89 | BOOT: |
82 | guard_stash = gv_stashpv ("Guard", 1); |
90 | guard_stash = gv_stashpv ("Guard", 1); |
|
|
91 | CvNODEBUG_on (get_cv ("Guard::scope_guard", 0)); /* otherwise calling scope can be the debugger */ |
83 | |
92 | |
84 | void |
93 | void |
85 | scope_guard (SV *block) |
94 | scope_guard (SV *block) |
86 | PROTOTYPE: & |
95 | PROTOTYPE: & |
87 | CODE: |
96 | CODE: |