aboutsummaryrefslogtreecommitdiff
path: root/oslib-win32.c
diff options
context:
space:
mode:
authorPaolo Bonzini <pbonzini@redhat.com>2012-11-02 15:43:20 +0100
committerAnthony Liguori <aliguori@us.ibm.com>2012-11-02 13:07:54 -0500
commit1f001dc7bc9e435bf231a5b0edcad1c7c2bd6214 (patch)
tree531f1ce25757189d2ac450a42f8eea75cf50e6fb /oslib-win32.c
parent2a0dfd004d9fae4adf2ccfcb2e3b1a76906b48a0 (diff)
downloadqemu-1f001dc7bc9e435bf231a5b0edcad1c7c2bd6214.zip
qemu-1f001dc7bc9e435bf231a5b0edcad1c7c2bd6214.tar.gz
qemu-1f001dc7bc9e435bf231a5b0edcad1c7c2bd6214.tar.bz2
compiler: support Darwin weak references
Weakrefs only tell you if the symbol was defined elsewhere, so you need a further check at runtime to pick the default definition when needed. This could be automated by the compiler, but it does not do it. Signed-off-by: Paolo Bonzini <pbonzini@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
Diffstat (limited to 'oslib-win32.c')
-rw-r--r--oslib-win32.c12
1 files changed, 7 insertions, 5 deletions
diff --git a/oslib-win32.c b/oslib-win32.c
index 9ca83df..326a2bd 100644
--- a/oslib-win32.c
+++ b/oslib-win32.c
@@ -32,6 +32,13 @@
#include "trace.h"
#include "qemu_socket.h"
+static void default_qemu_fd_register(int fd)
+{
+}
+QEMU_WEAK_ALIAS(qemu_fd_register, default_qemu_fd_register);
+#define qemu_fd_register \
+ QEMU_WEAK_REF(qemu_fd_register, default_qemu_fd_register)
+
void *qemu_oom_check(void *ptr)
{
if (ptr == NULL) {
@@ -150,8 +157,3 @@ int qemu_get_thread_id(void)
{
return GetCurrentThreadId();
}
-
-static void default_qemu_fd_register(int fd)
-{
-}
-QEMU_WEAK_ALIAS(qemu_fd_register, default_qemu_fd_register);