win32: Fix return value for cairo_time_get

Without uint64_t we need to construct a cairo_int64_t from the struct of
smaller 32-bit types rather than just casting the larger 64-bit value.

Reported-by: Hakki Dogusan <dogusanh@tr.net>
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
This commit is contained in:
Chris Wilson 2012-05-20 10:54:07 +01:00
parent 5a7a9c93e7
commit dad69ce4d5

View file

@ -103,6 +103,25 @@ _cairo_time_1s (void)
return freq.QuadPart;
}
#ifndef HAVE_UINT64_T
static cairo_always_inline cairo_time_t
_cairo_time_from_large_integer (LARGE_INTEGER t)
{
cairo_int64_t r;
r = _cairo_int64_lsl (_cairo_int32_to_int64 (t.HighPart), 32);
r = _cairo_int64_add (r, _cairo_int32_to_int64 (t.LowPart));
return r;
}
#else
static cairo_always_inline cairo_time_t
_cairo_time_from_large_integer (LARGE_INTEGER t)
{
return t.QuadPart;
}
#endif
cairo_time_t
_cairo_time_get (void)
{
@ -110,7 +129,7 @@ _cairo_time_get (void)
QueryPerformanceCounter (&t);
return t.QuadPart;
return _cairo_time_from_large_integer(t);
}
#elif defined(CAIRO_CLOCK)