[Spice-commits] Branch '0.6' - 3 commits - spice/barrier.h spice/end-packed.h spice/macros.h spice/start-packed.h

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


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

New commits:
commit 7134a4591c65b5c72550341b069e1eed97030048
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 432519f7126c44cc56ae2e6257642077360c2865
Author: Hans de Goede <hdegoede at redhat.com>
Date:   Fri Jan 21 15:39:09 2011 +0100

    Update license header for spice/macros.h
    
    This one mistakenly had a GPL header rather then an LGPL header.

diff --git a/spice/macros.h b/spice/macros.h
index 1d1934f..62157b4 100644
--- a/spice/macros.h
+++ b/spice/macros.h
@@ -2,18 +2,18 @@
 /*
    Copyright (C) 2010 Red Hat, Inc.
 
-   This program is free software; you can redistribute it and/or
-   modify it under the terms of the GNU General Public License as
-   published by the Free Software Foundation; either version 2 of
-   the License, or (at your option) any later version.
+   This library is free software; you can redistribute it and/or
+   modify it under the terms of the GNU Lesser General Public
+   License as published by the Free Software Foundation; either
+   version 2.1 of the License, or (at your option) any later version.
 
    This program is distributed in the hope that it will be useful,
    but WITHOUT ANY WARRANTY; without even the implied warranty of
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    GNU General Public License for more details.
 
-   You should have received a copy of the GNU General Public License
-   along with this program.  If not, see <http://www.gnu.org/licenses/>.
+   You should have received a copy of the GNU Lesser General Public
+   License along with this library; if not, see <http://www.gnu.org/licenses/>.
 */
 
 /* This file is to a large extent based on gmacros.h from glib
commit 1043a5df4d3f3a31124d1074045eee3757e14ee7
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