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

Comparing Coro/Coro/State.xs (file contents):
Revision 1.287 by root, Mon Nov 17 07:03:12 2008 UTC vs.
Revision 1.288 by root, Mon Nov 17 07:14:50 2008 UTC

94#ifndef GV_NOTQUAL 94#ifndef GV_NOTQUAL
95# define GV_NOTQUAL 0 95# define GV_NOTQUAL 0
96#endif 96#endif
97#ifndef newSV 97#ifndef newSV
98# define newSV(l) NEWSV(0,l) 98# define newSV(l) NEWSV(0,l)
99#endif
100#ifndef CvISXSUB_on
101# define CvISXSUB_on(cv) (void)cv
99#endif 102#endif
100 103
101/* 5.8.7 */ 104/* 5.8.7 */
102#ifndef SvRV_set 105#ifndef SvRV_set
103# define SvRV_set(s,v) SvRV(s) = (v) 106# define SvRV_set(s,v) SvRV(s) = (v)
2247 2250
2248 for (i = 0; i < items; ++i) 2251 for (i = 0; i < items; ++i)
2249 PUSHs (arg [i]); 2252 PUSHs (arg [i]);
2250 2253
2251 /* now push the callback closure */ 2254 /* now push the callback closure */
2252 PUSHs (sv_2mortal (gensub (coro_aio_callback, (void *)SvREFCNT_inc_NN ((SV *)state)))); 2255 PUSHs (sv_2mortal (gensub (aTHX_ coro_aio_callback, (void *)SvREFCNT_inc_NN ((SV *)state))));
2253 2256
2254 /* now call the AIO function - we assume our request is uncancelable */ 2257 /* now call the AIO function - we assume our request is uncancelable */
2255 PUTBACK; 2258 PUTBACK;
2256 call_sv ((SV *)req, G_VOID | G_DISCARD); 2259 call_sv ((SV *)req, G_VOID | G_DISCARD);
2257 } 2260 }
2263} 2266}
2264 2267
2265static void 2268static void
2266coro_aio_req_xs (pTHX_ CV *cv) 2269coro_aio_req_xs (pTHX_ CV *cv)
2267{ 2270{
2268 dVAR;
2269 dXSARGS; 2271 dXSARGS;
2270 2272
2271 CORO_EXECUTE_SLF_XS (slf_init_aio_req); 2273 CORO_EXECUTE_SLF_XS (slf_init_aio_req);
2272 2274
2273 XSRETURN_EMPTY; 2275 XSRETURN_EMPTY;
2874 CODE: 2876 CODE:
2875{ 2877{
2876 HV *st; 2878 HV *st;
2877 GV *gvp; 2879 GV *gvp;
2878 CV *req_cv = sv_2cv (req, &st, &gvp, 0); 2880 CV *req_cv = sv_2cv (req, &st, &gvp, 0);
2881 /* newXSproto doesn't return the CV on 5.8 */
2879 CV *slf_cv = newXSproto (target, coro_aio_req_xs, __FILE__, proto); 2882 CV *slf_cv = newXS (target, coro_aio_req_xs, __FILE__);
2883 sv_setpv ((SV *)slf_cv, proto);
2880 sv_magicext ((SV *)slf_cv, (SV *)req_cv, CORO_MAGIC_type_aio, 0, 0, 0); 2884 sv_magicext ((SV *)slf_cv, (SV *)req_cv, CORO_MAGIC_type_aio, 0, 0, 0);
2881} 2885}
2882 2886

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines