ViewVC Help
View File | Revision Log | Show Annotations | Download File
/cvs/Guard/Guard.xs
(Generate patch)

Comparing Guard/Guard.xs (file contents):
Revision 1.7 by root, Mon Dec 15 16:22:18 2008 UTC vs.
Revision 1.11 by root, Sun Jul 19 04:59:54 2009 UTC

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/* apparently < 5.8.8 */
8#ifndef SvSTASH_set
9# define SvSTASH_set(x,a) SvSTASH(x) = (a)
10#endif
11
12#ifndef PERL_MAGIC_ext
13# define PERL_MAGIC_ext '~'
14#endif
6 15
7static HV *guard_stash; 16static HV *guard_stash;
8 17
9static SV * 18static SV *
10guard_get_cv (pTHX_ SV *cb_sv) 19guard_get_cv (pTHX_ SV *cb_sv)
65 74
66static int 75static int
67guard_free (pTHX_ SV *cv, MAGIC *mg) 76guard_free (pTHX_ SV *cv, MAGIC *mg)
68{ 77{
69 exec_guard_cb (aTHX_ mg->mg_obj); 78 exec_guard_cb (aTHX_ mg->mg_obj);
79
80 return 0;
70} 81}
71 82
72static MGVTBL guard_vtbl = { 83static MGVTBL guard_vtbl = {
73 0, 0, 0, 0, 84 0, 0, 0, 0,
74 guard_free 85 guard_free
76 87
77MODULE = Guard PACKAGE = Guard 88MODULE = Guard PACKAGE = Guard
78 89
79BOOT: 90BOOT:
80 guard_stash = gv_stashpv ("Guard", 1); 91 guard_stash = gv_stashpv ("Guard", 1);
92 CvNODEBUG_on (get_cv ("Guard::scope_guard", 0)); /* otherwise calling scope can be the debugger */
81 93
82void 94void
83scope_guard (SV *block) 95scope_guard (SV *block)
84 PROTOTYPE: & 96 PROTOTYPE: &
85 CODE: 97 CODE:

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines