[Spice-commits] Branch '0.8' - 2 commits - spice/barrier.h spice/end-packed.h spice/start-packed.h

Hans de Goede jwrdegoede at kemper.freedesktop.org
Fri Feb 11 05:32:58 PST 2011


 spice/barrier.h      |    9 +++++++++
 spice/end-packed.h   |    4 +---
 spice/start-packed.h |    4 ++++
 3 files changed, 14 insertions(+), 3 deletions(-)

New commits:
commit e8ab669dfac0abc663c979e3d0dd02678c264c6f
Author: Arnon Gilboa <agilboa at redhat.com>
Date:   Wed Feb 2 11:21:11 2011 +0200

    define spice_mb MemoryBarrier for WIN64
    
    __asm is not supported on _WIN64, so use macro instead
    required for Windows x64 guest display driver (qxldd.dll)

diff --git a/spice/barrier.h b/spice/barrier.h
index 8c81c86..710da09 100644
--- a/spice/barrier.h
+++ b/spice/barrier.h
@@ -33,14 +33,23 @@
 #define _H_SPICE_BARRIER
 
 #ifdef __GNUC__
+
 #ifdef __i386__
 #define spice_mb() __asm__ __volatile__ ("lock; addl $0,0(%%esp)": : :"memory")
 #else
 //mfence
 #define spice_mb() __asm__ __volatile__ ("lock; addl $0,0(%%rsp)": : :"memory")
 #endif
+
+#else
+
+#ifdef _WIN64
+//__asm not supported on _WIN64, so use macro instead.
+#define spice_mb MemoryBarrier
 #else
 #define spice_mb() __asm {lock add [esp], 0}
 #endif
 
+#endif
+
 #endif /* _H_SPICE_BARRIER */
commit 41946c45cf072b82c5eb0c8c499f77c568c1a887
Author: Marc-André Lureau <marcandre.lureau at redhat.com>
Date:   Wed Dec 29 14:23:59 2010 +0100

    mingw32: specify packing alignment to 1 byte, to override -mms-bitfield
    
    Ex: G_STRUCT_OFFSET(SpiceLinkReply, num_channel_caps) is 172 bytes
    when compiled with -mms-bitfield, and 170 bytes without.
    
    GLib/Gtk are compiled with -mms-bitfield, and it is necessary to
    compile with the same option for compatibility. The pack pragma
    for MINGW32 corrects the structure alignement.
    
    We could use the pack pragma for GNUC unconditionally, that could help
    to ensure struct binary compatibility between different compiled
    flavours.

diff --git a/spice/end-packed.h b/spice/end-packed.h
index e191737..1acea18 100644
--- a/spice/end-packed.h
+++ b/spice/end-packed.h
@@ -33,8 +33,6 @@
 
 #undef SPICE_ATTR_PACKED
 
-#ifndef __GNUC__
-
+#if defined(__MINGW32__) || !defined(__GNUC__)
 #pragma pack(pop)
-
 #endif
diff --git a/spice/start-packed.h b/spice/start-packed.h
index 78ec7c7..ab3fa98 100644
--- a/spice/start-packed.h
+++ b/spice/start-packed.h
@@ -49,6 +49,10 @@
 
 #define SPICE_ATTR_PACKED __attribute__ ((__packed__))
 
+#ifdef __MINGW32__
+#pragma pack(push,1)
+#endif
+
 #else
 
 #pragma pack(push)


More information about the Spice-commits mailing list