Skip to content

Commit

Permalink
Fix packed structures with mingw gcc >= 4.7
Browse files Browse the repository at this point in the history
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 :-\

Original patch provided by John Stebbins
<stebbins AT jetheaddev DOT com>. This patch implemented an idea
that was put forward by Mike Frysinger <vapier AT gentoo DOT org>.

Thanks to both!
  • Loading branch information
microe committed Feb 20, 2013
1 parent 026f519 commit 3762e09
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions configure.ac
Expand Up @@ -19,6 +19,7 @@ m4_define([dvdread_pre], [])

AC_INIT([libdvdread], [dvdread_major.dvdread_minor.dvdread_sub[]dvdread_pre])
AC_CONFIG_SRCDIR([src/dvdread/dvd_reader.h])
m4_include([m4/ax_check_compile_flag.m4])
AM_INIT_AUTOMAKE([1.6])

dnl create a config.h file (Automake will add -DHAVE_CONFIG_H)
Expand Down Expand Up @@ -202,6 +203,11 @@ DEBUG_CFLAGS="-g -DDEBUG $CFLAGS"

AC_SUBST(DEBUG_CFLAGS)

dnl ---------------------------------------------
dnl Check for bitfield compiler flag
dnl ---------------------------------------------
AX_CHECK_COMPILE_FLAG([-mno-ms-bitfields], [CFLAGS="-mno-ms-bitfields $CFLAGS"])

dnl ---------------------------------------------
dnl Check for doxygen (dynamic documentation generator)
dnl ---------------------------------------------
Expand Down

0 comments on commit 3762e09

Please sign in to comment.