summaryrefslogtreecommitdiffstats
path: root/contrib/libdvdread/P01-mingw-bitfields.patch
blob: ae852134afe7d4d1e63d2b57371e0ea8daccdfc2 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
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"