From: Stefan Weil <sw@weilnetz.de>
To: Peter Maydell <peter.maydell@linaro.org>
Cc: Stefan Weil <sw@weilnetz.de>, qemu-devel@nongnu.org
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 [thread overview]
Message-ID: <1395296712-25274-4-git-send-email-sw@weilnetz.de> (raw)
In-Reply-To: <1395296712-25274-1-git-send-email-sw@weilnetz.de>
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 <sw@weilnetz.de>
---
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
next prev parent reply other threads:[~2014-03-20 6:25 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-03-20 6:25 [Qemu-devel] [PULL for 2.0 0/5] MinGW related patches Stefan Weil
2014-03-20 6:25 ` [Qemu-devel] [PULL for 2.0 1/5] gtk: Support GTK without VTE Stefan Weil
2014-03-20 6:25 ` [Qemu-devel] [PULL for 2.0 2/5] w32: Add and use intermediate include file for windows.h Stefan Weil
2014-03-20 6:25 ` Stefan Weil [this message]
2014-03-20 6:25 ` [Qemu-devel] [PULL for 2.0 4/5] w32: Reduce dependencies in sysemu/os-win32.h Stefan Weil
2014-03-20 6:25 ` [Qemu-devel] [PULL for 2.0 5/5] w32: Replace Windows specific data types in common header files Stefan Weil
2014-03-20 14:00 ` Andreas Färber
2014-03-20 6:29 ` [Qemu-devel] [PULL for 2.0 0/5] MinGW related patches Stefan Weil
2014-03-20 12:45 ` Peter Maydell
2014-03-20 19:12 ` Stefan Weil
2014-03-20 19:16 ` Peter Maydell
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1395296712-25274-4-git-send-email-sw@weilnetz.de \
--to=sw@weilnetz.de \
--cc=peter.maydell@linaro.org \
--cc=qemu-devel@nongnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).