qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Stefan Weil <sw@weilnetz.de>
To: qemu-devel@nongnu.org
Cc: kwolf@redhat.com, pbonzini@redhat.com,
	Stefan Weil <sw@weilnetz.de>,
	stefanha@redhat.com, peter.maydell@linaro.org
Subject: [Qemu-devel] [PATCH v2 2/5] w32: Move inline function from header file to C source
Date: Fri,  7 Mar 2014 23:17:44 +0100	[thread overview]
Message-ID: <1394230667-17037-3-git-send-email-sw@weilnetz.de> (raw)
In-Reply-To: <1394230667-17037-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

  parent reply	other threads:[~2014-03-07 22:18 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-03-07 22:17 [Qemu-devel] [PATCH v2 0/5] w32: Reduce dependency on Windows API Stefan Weil
2014-03-07 22:17 ` [Qemu-devel] [PATCH v2 1/5] w32: Add and use intermediate include file for windows.h Stefan Weil
2014-03-10  8:56   ` Markus Armbruster
2014-03-10 17:38     ` Stefan Weil
2014-03-07 22:17 ` Stefan Weil [this message]
2014-03-07 22:17 ` [Qemu-devel] [PATCH v2 3/5] w32: Reduce dependencies in sysemu/os-win32.h Stefan Weil
2014-03-07 22:17 ` [Qemu-devel] [PATCH v2 4/5] w32: Replace Windows specific data types in common header files Stefan Weil
2014-03-10 15:17   ` Stefan Hajnoczi
2014-03-10 18:34     ` Stefan Weil
2014-03-11  7:51       ` Stefan Hajnoczi
2014-03-11  8:06       ` Paolo Bonzini
2014-03-07 22:17 ` [Qemu-devel] [PATCH v2 5/5] block: Review include statements for winioctl.h Stefan Weil
2014-03-10 15:18 ` [Qemu-devel] [PATCH v2 0/5] w32: Reduce dependency on Windows API Stefan Hajnoczi

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=1394230667-17037-3-git-send-email-sw@weilnetz.de \
    --to=sw@weilnetz.de \
    --cc=kwolf@redhat.com \
    --cc=pbonzini@redhat.com \
    --cc=peter.maydell@linaro.org \
    --cc=qemu-devel@nongnu.org \
    --cc=stefanha@redhat.com \
    /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).