commit 9a64ee60dd3e68c78292b97241616ac1d7a01c15
Author: Christian Krause <c...@fedoraproject.org>
Date:   Thu Jan 6 23:12:43 2011 +0100

    [mono] fix alignment issues on x86

 bindings/mono/Makefile.include            |    2 +-
 bindings/mono/libgpod-sharp/Artwork.cs    |    4 ++++
 bindings/mono/libgpod-sharp/Chapter.cs    |    4 ++++
 bindings/mono/libgpod-sharp/IpodInfo.cs   |    5 +++++
 bindings/mono/libgpod-sharp/PhotoAlbum.cs |    5 +++++
 bindings/mono/libgpod-sharp/Playlist.cs   |    5 +++++
 bindings/mono/libgpod-sharp/Track.cs      |    4 ++++
 configure.ac                              |    7 +++++++
 8 files changed, 35 insertions(+), 1 deletions(-)
---
diff --git a/bindings/mono/Makefile.include b/bindings/mono/Makefile.include
index 504b059..a587456 100644
--- a/bindings/mono/Makefile.include
+++ b/bindings/mono/Makefile.include
@@ -18,7 +18,7 @@ all: $(ASSEMBLY_FILE)
 $(ASSEMBLY_FILE).mdb: $(ASSEMBLY_FILE)
 
 $(ASSEMBLY_FILE): $(SOURCES_BUILD)
-       $(MCS) -debug -unsafe -target:$(TARGET) -out:$@ $(LINK) $(SOURCES_BUILD)
+       $(MCS) $(GMCS_FLAGS) -debug -unsafe -target:$(TARGET) -out:$@ $(LINK) 
$(SOURCES_BUILD)
 
 EXTRA_DIST = $(SOURCES_BUILD)
 
diff --git a/bindings/mono/libgpod-sharp/Artwork.cs 
b/bindings/mono/libgpod-sharp/Artwork.cs
index 5be7369..5773e35 100644
--- a/bindings/mono/libgpod-sharp/Artwork.cs
+++ b/bindings/mono/libgpod-sharp/Artwork.cs
@@ -24,7 +24,11 @@ namespace GPod {
        using native;
        
        namespace native {
+#if ALIGNMENT_X86_LINUX
+               [StructLayout (LayoutKind.Sequential, Pack=4)]
+#else
                [StructLayout (LayoutKind.Sequential)]
+#endif
                internal struct Itdb_Artwork {
                        public IntPtr thumbnail;
                        public uint   id;
diff --git a/bindings/mono/libgpod-sharp/Chapter.cs 
b/bindings/mono/libgpod-sharp/Chapter.cs
index 66ca556..ea632cd 100644
--- a/bindings/mono/libgpod-sharp/Chapter.cs
+++ b/bindings/mono/libgpod-sharp/Chapter.cs
@@ -22,7 +22,11 @@ namespace GPod {
        using native;
        
        namespace native {
+#if ALIGNMENT_X86_LINUX
+               [StructLayout (LayoutKind.Sequential, Pack=4)]
+#else
                [StructLayout (LayoutKind.Sequential)]
+#endif
                internal struct Itdb_Chapter {
                        public uint   startpos;
                        public IntPtr chaptertitle;
diff --git a/bindings/mono/libgpod-sharp/IpodInfo.cs 
b/bindings/mono/libgpod-sharp/IpodInfo.cs
index 697041b..14024eb 100644
--- a/bindings/mono/libgpod-sharp/IpodInfo.cs
+++ b/bindings/mono/libgpod-sharp/IpodInfo.cs
@@ -23,6 +23,11 @@ namespace GPod {
        using System.Collections.Generic;
        
        namespace native {
+#if ALIGNMENT_X86_LINUX
+               [StructLayout (LayoutKind.Sequential, Pack=4)]
+#else
+               [StructLayout (LayoutKind.Sequential)]
+#endif
                internal struct Itdb_IpodInfo {
                        public IntPtr         model_number;
                        public double         capacity;
diff --git a/bindings/mono/libgpod-sharp/PhotoAlbum.cs 
b/bindings/mono/libgpod-sharp/PhotoAlbum.cs
index 42b2365..4a248ec 100644
--- a/bindings/mono/libgpod-sharp/PhotoAlbum.cs
+++ b/bindings/mono/libgpod-sharp/PhotoAlbum.cs
@@ -24,6 +24,11 @@ namespace GPod {
        using native;
        
        namespace native {
+#if ALIGNMENT_X86_LINUX
+               [StructLayout (LayoutKind.Sequential, Pack=4)]
+#else
+               [StructLayout (LayoutKind.Sequential)]
+#endif
                internal struct Itdb_PhotoAlbum {
                        public IntPtr photodb;
                        public IntPtr name;
diff --git a/bindings/mono/libgpod-sharp/Playlist.cs 
b/bindings/mono/libgpod-sharp/Playlist.cs
index 7ff5a68..48e4e32 100644
--- a/bindings/mono/libgpod-sharp/Playlist.cs
+++ b/bindings/mono/libgpod-sharp/Playlist.cs
@@ -24,6 +24,11 @@ namespace GPod {
        using native;
        
        namespace native {
+#if ALIGNMENT_X86_LINUX
+               [StructLayout (LayoutKind.Sequential, Pack=4)]
+#else
+               [StructLayout (LayoutKind.Sequential)]
+#endif
                internal struct Itdb_Playlist {
                        public IntPtr itdb;
                        public IntPtr name;
diff --git a/bindings/mono/libgpod-sharp/Track.cs 
b/bindings/mono/libgpod-sharp/Track.cs
index 434df7e..ce716fa 100644
--- a/bindings/mono/libgpod-sharp/Track.cs
+++ b/bindings/mono/libgpod-sharp/Track.cs
@@ -24,7 +24,11 @@ namespace GPod {
        
        
        namespace native {
+#if ALIGNMENT_X86_LINUX
+               [StructLayout (LayoutKind.Sequential, Pack=4)]
+#else
                [StructLayout (LayoutKind.Sequential)]
+#endif
                internal struct Itdb_Track {
                        public IntPtr           itdb;
                        public IntPtr           title;
diff --git a/configure.ac b/configure.ac
index a52ac3a..c3ea6c2 100644
--- a/configure.ac
+++ b/configure.ac
@@ -315,6 +315,13 @@ dnl **************************************************
 MONO_MIN_VERSION=1.9.1
 GTK_SHARP_MIN_VERSION=2.12
 LIBGPOD_CHECK_MONO
+AC_CHECK_ALIGNOF([double])
+if test "$ac_cv_alignof_double" -eq 4 ; then
+    GMCS_FLAGS=-define:ALIGNMENT_X86_LINUX
+else
+    GMCS_FLAGS=
+fi
+AC_SUBST(GMCS_FLAGS)
 
 dnl warnings bits, copied from gnome-keyring configure.in
 dnl Turn on the additional warnings last, so -Werror doesn't affect other 
tests.

------------------------------------------------------------------------------
Enable your software for Intel(R) Active Management Technology to meet the
growing manageability and security demands of your customers. Businesses
are taking advantage of Intel(R) vPro (TM) technology - will your software 
be a part of the solution? Download the Intel(R) Manageability Checker 
today! http://p.sf.net/sfu/intel-dev2devmar
_______________________________________________
gtkpod-cvs2 mailing list
gtkpod-cvs2@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/gtkpod-cvs2

Reply via email to