[DVDnav-discuss] [PATCH] Fix packed structures with mingw gcc >= 4.7

John Stebbins stebbins at jetheaddev.com
Sat Jan 26 19:56:17 CET 2013


As of gcc 4.7, structures are packed in a "MS compatible" format by
default.  If you want the correct behavior, you must add
-mno-ms-bitfields to CFLAGS :-\
---
 configure.ac | 9 +++++++++
 1 file changed, 9 insertions(+)

diff --git a/configure.ac b/configure.ac
index 30cab8d..fbd5fa7 100644
--- a/configure.ac
+++ b/configure.ac
@@ -163,6 +163,15 @@ case $host in
         AC_SUBST(DYNAMIC_LD_LIBS)
     fi
     LDFLAGS="-no-undefined $LDFLAGS"
+    if test "$GCC" = "yes" ; then
+        gcc_version="`$CC -dumpversion`"
+        gcc_version_major=$(echo $gcc_version | cut -d"." -f1)
+        gcc_version_minor=$(echo $gcc_version | cut -d"." -f2)
+        gcc_version_patch=$(echo $gcc_version | cut -d"." -f3)
+        if test $gcc_version_major -ge 4 -a $gcc_version_minor -ge 7 ; then
+            CFLAGS="-mno-ms-bitfields $CFLAGS"
+        fi
+    fi
     ;;
   *cygwin*)
     LDFLAGS="-no-undefined $LDFLAGS"
-- 
1.7.11.7

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 490 bytes
Desc: OpenPGP digital signature
URL: <http://lists.mplayerhq.hu/pipermail/dvdnav-discuss/attachments/20130126/98dc70ec/attachment.asc>


More information about the DVDnav-discuss mailing list