]> granicus.if.org Git - handbrake/commitdiff
build: Fix mingw crashes in libdvdread when using gcc >= 4.7
authorjstebbins <jstebbins.hb@gmail.com>
Sat, 26 Jan 2013 18:47:13 +0000 (18:47 +0000)
committerjstebbins <jstebbins.hb@gmail.com>
Sat, 26 Jan 2013 18:47:13 +0000 (18:47 +0000)
mingw gcc >= 4.7 now packs structures in a "MS compatible" fashion.
This breaks the normal expected behavior of packed structures.  To restore
the correct behavior, the option -mno-ms-bitfields must be added :-\

git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@5208 b64f7644-9d1e-0410-96f1-a4d463321fa5

contrib/libdvdread/P01-mingw-bitfields.patch [new file with mode: 0644]

diff --git a/contrib/libdvdread/P01-mingw-bitfields.patch b/contrib/libdvdread/P01-mingw-bitfields.patch
new file mode 100644 (file)
index 0000000..ae85213
--- /dev/null
@@ -0,0 +1,19 @@
+diff -Naur libdvdread.orig/configure.ac libdvdread/configure.ac
+--- libdvdread.orig/configure.ac       2009-01-08 14:57:10.000000000 -0800
++++ libdvdread/configure.ac    2013-01-26 10:35:21.366836184 -0800
+@@ -141,6 +141,15 @@
+   *mingw32*)
+     CFLAGS="-idirafter \$(top_srcdir)/msvc/include $CFLAGS"
+     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"