Skip to content

Instantly share code, notes, and snippets.

@mattn
Created July 1, 2009 01:31
Show Gist options
  • Save mattn/138543 to your computer and use it in GitHub Desktop.
Save mattn/138543 to your computer and use it in GitHub Desktop.
--- Coro/State.xs.orig 2009-06-29 15:11:50.000000000 +0900
+++ Coro/State.xs 2009-07-01 10:25:15.203125000 +0900
@@ -172,7 +172,7 @@
#endif
static double (*nvtime)(); /* so why doesn't it take void? */
-static void (*u2time)(pTHX_ UV ret[2]);
+static int (*u2time)(pTHX_ UV *);
/* we hijack an hopefully unused CV flag for our purposes */
#define CVf_SLF 0x4000
@@ -404,9 +404,10 @@
coro_clock_gettime (CORO_CLOCK_MONOTONIC, &ts);
time_real [0] = ts.tv_sec; time_real [1] = ts.tv_nsec;
#else
+ dTHX;
UV tv[2];
- u2time (aTHX_ &tv);
+ u2time (aTHX_ tv);
time_real [0] = tv [0];
time_real [1] = tv [1] * 1000;
#endif
@@ -3061,7 +3062,7 @@
nvtime = INT2PTR (double (*)(), SvIV (*svp));
svp = hv_fetch (PL_modglobal, "Time::U2time", 12, 0);
- u2time = INT2PTR (double (*)(), SvIV (*svp));
+ u2time = INT2PTR (int (*)(pTHX_ UV*), SvIV (*svp));
}
assert (("PRIO_NORMAL must be 0", !CORO_PRIO_NORMAL));
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment