[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PULL for 2.0 3/5] w32: Move inline function from header fi
From: |
Stefan Weil |
Subject: |
[Qemu-devel] [PULL for 2.0 3/5] w32: Move inline function from header file to C source |
Date: |
Thu, 20 Mar 2014 07:25:10 +0100 |
A lot of files depend on qemu/timer.h. We don't want that all these files
depend on windows.h, too.
Signed-off-by: Stefan Weil <address@hidden>
---
include/qemu/timer.h | 8 +-------
util/qemu-timer-common.c | 11 ++++++++++-
2 files changed, 11 insertions(+), 8 deletions(-)
diff --git a/include/qemu/timer.h b/include/qemu/timer.h
index 7f9a074..19316b7 100644
--- a/include/qemu/timer.h
+++ b/include/qemu/timer.h
@@ -712,14 +712,8 @@ static inline int64_t get_clock_realtime(void)
also used by simpletrace backend and tracepoints would cause
an infinite recursion! */
#ifdef _WIN32
-extern int64_t clock_freq;
-static inline int64_t get_clock(void)
-{
- LARGE_INTEGER ti;
- QueryPerformanceCounter(&ti);
- return muldiv64(ti.QuadPart, get_ticks_per_sec(), clock_freq);
-}
+int64_t get_clock(void);
#else
diff --git a/util/qemu-timer-common.c b/util/qemu-timer-common.c
index 95e0847..22b0109 100644
--- a/util/qemu-timer-common.c
+++ b/util/qemu-timer-common.c
@@ -28,7 +28,16 @@
#ifdef _WIN32
-int64_t clock_freq;
+#include "qemu/winapi.h" /* QueryPerformanceCounter, ... */
+
+static int64_t clock_freq;
+
+int64_t get_clock(void)
+{
+ LARGE_INTEGER ti;
+ QueryPerformanceCounter(&ti);
+ return muldiv64(ti.QuadPart, get_ticks_per_sec(), clock_freq);
+}
static void __attribute__((constructor)) init_get_clock(void)
{
--
1.7.10.4
- [Qemu-devel] [PULL for 2.0 0/5] MinGW related patches, Stefan Weil, 2014/03/20
- [Qemu-devel] [PULL for 2.0 4/5] w32: Reduce dependencies in sysemu/os-win32.h, Stefan Weil, 2014/03/20
- [Qemu-devel] [PULL for 2.0 3/5] w32: Move inline function from header file to C source,
Stefan Weil <=
- [Qemu-devel] [PULL for 2.0 2/5] w32: Add and use intermediate include file for windows.h, Stefan Weil, 2014/03/20
- [Qemu-devel] [PULL for 2.0 5/5] w32: Replace Windows specific data types in common header files, Stefan Weil, 2014/03/20
- [Qemu-devel] [PULL for 2.0 1/5] gtk: Support GTK without VTE, Stefan Weil, 2014/03/20
- Re: [Qemu-devel] [PULL for 2.0 0/5] MinGW related patches, Stefan Weil, 2014/03/20