Revision ad620c29
b/osdep.h | ||
---|---|---|
8 | 8 |
#include <sys/signal.h> |
9 | 9 |
#endif |
10 | 10 |
|
11 |
#ifndef _WIN32 |
|
12 | 11 |
#include <sys/time.h> |
13 |
#endif |
|
14 | 12 |
|
15 | 13 |
#ifndef glue |
16 | 14 |
#define xglue(x, y) x ## y |
... | ... | |
131 | 129 |
|
132 | 130 |
int qemu_create_pidfile(const char *filename); |
133 | 131 |
|
132 |
#ifdef _WIN32 |
|
133 |
static inline void qemu_timersub(const struct timeval *val1, |
|
134 |
const struct timeval *val2, |
|
135 |
struct timeval *res) |
|
136 |
{ |
|
137 |
res->tv_sec = val1->tv_sec - val2->tv_sec; |
|
138 |
if (val1->tv_usec < val2->tv_usec) { |
|
139 |
res->tv_sec--; |
|
140 |
res->tv_usec = val1->tv_usec - val2->tv_usec + 1000 * 1000; |
|
141 |
} else { |
|
142 |
res->tv_usec = val1->tv_usec - val2->tv_usec; |
|
143 |
} |
|
144 |
} |
|
145 |
#else |
|
146 |
#define qemu_timersub timersub |
|
147 |
#endif |
|
148 |
|
|
134 | 149 |
#endif |
b/ui/vnc.c | ||
---|---|---|
2302 | 2302 |
} |
2303 | 2303 |
} |
2304 | 2304 |
|
2305 |
timersub(tv, &VNC_REFRESH_STATS, &res); |
|
2305 |
qemu_timersub(tv, &VNC_REFRESH_STATS, &res);
|
|
2306 | 2306 |
|
2307 | 2307 |
if (timercmp(&vd->guest.last_freq_check, &res, >)) { |
2308 | 2308 |
return has_dirty; |
... | ... | |
2320 | 2320 |
} |
2321 | 2321 |
|
2322 | 2322 |
max = rect->times[(rect->idx + count - 1) % count]; |
2323 |
timersub(tv, &max, &res); |
|
2323 |
qemu_timersub(tv, &max, &res);
|
|
2324 | 2324 |
|
2325 | 2325 |
if (timercmp(&res, &VNC_REFRESH_LOSSY, >)) { |
2326 | 2326 |
rect->freq = 0; |
... | ... | |
2331 | 2331 |
|
2332 | 2332 |
min = rect->times[rect->idx]; |
2333 | 2333 |
max = rect->times[(rect->idx + count - 1) % count]; |
2334 |
timersub(&max, &min, &res); |
|
2334 |
qemu_timersub(&max, &min, &res);
|
|
2335 | 2335 |
|
2336 | 2336 |
rect->freq = res.tv_sec + res.tv_usec / 1000000.; |
2337 | 2337 |
rect->freq /= count; |
Also available in: Unified diff