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.387 by root, Mon Feb 21 13:38:04 2011 UTC vs.
Revision 1.388 by root, Wed Feb 23 07:14:22 2011 UTC

22#ifndef SVs_PADSTALE 22#ifndef SVs_PADSTALE
23# define SVs_PADSTALE 0 23# define SVs_PADSTALE 0
24#endif 24#endif
25 25
26#ifdef WIN32 26#ifdef WIN32
27# undef HAS_GETTIMEOFDAY
27# undef setjmp 28# undef setjmp
28# undef longjmp 29# undef longjmp
29# undef _exit 30# undef _exit
30# define setjmp _setjmp /* deep magic */ 31# define setjmp _setjmp /* deep magic */
31#else 32#else
338 339
339 return tv.tv_sec + tv.tv_usec * 1e-6; 340 return tv.tv_sec + tv.tv_usec * 1e-6;
340} 341}
341 342
342static void 343static void
343time_init (void) 344time_init (pTHX)
344{ 345{
345 nvtime = coro_nvtime; 346 nvtime = coro_nvtime;
346 u2time = coro_u2time; 347 u2time = coro_u2time;
347} 348}
348 349
349#else 350#else
350 351
351static void 352static void
352time_init (void) 353time_init (pTHX)
353{ 354{
354 SV **svp; 355 SV **svp;
355 356
356 require_pv ("Time::HiRes"); 357 require_pv ("Time/HiRes.pm");
357 358
358 svp = hv_fetch (PL_modglobal, "Time::NVtime", 12, 0); 359 svp = hv_fetch (PL_modglobal, "Time::NVtime", 12, 0);
359 360
360 if (!svp) croak ("Time::HiRes is required"); 361 if (!svp) croak ("Time::HiRes is required, but missing.");
361 if (!SvIOK (*svp)) croak ("Time::NVtime isn't a function pointer"); 362 if (!SvIOK (*svp)) croak ("Time::NVtime isn't a function pointer");
362 363
363 nvtime = INT2PTR (double (*)(), SvIV (*svp)); 364 nvtime = INT2PTR (double (*)(), SvIV (*svp));
364 365
365 svp = hv_fetch (PL_modglobal, "Time::U2time", 12, 0); 366 svp = hv_fetch (PL_modglobal, "Time::U2time", 12, 0);
3161 coroapi.prepare_nop = prepare_nop; 3162 coroapi.prepare_nop = prepare_nop;
3162 coroapi.prepare_schedule = prepare_schedule; 3163 coroapi.prepare_schedule = prepare_schedule;
3163 coroapi.prepare_cede = prepare_cede; 3164 coroapi.prepare_cede = prepare_cede;
3164 coroapi.prepare_cede_notself = prepare_cede_notself; 3165 coroapi.prepare_cede_notself = prepare_cede_notself;
3165 3166
3166 time_init (); 3167 time_init (aTHX);
3167 3168
3168 assert (("PRIO_NORMAL must be 0", !CORO_PRIO_NORMAL)); 3169 assert (("PRIO_NORMAL must be 0", !CORO_PRIO_NORMAL));
3169} 3170}
3170 3171
3171SV * 3172SV *

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines