Build system: add -mno-ms-bitfields when compiling with mingw

gcc 4.7.0 changed from "-mno-ms-bitfields" to "-mms-bitfields" (which
is how Microsoft's compilers do it). This means that even structures
with __attribute__((packed)) are sometimes padded. As MKVToolNix uses
padded structures solely inside itself without handing them over to
Windows APIs or external DLLs (assuming static compilation with MXE)
this is safe.
This commit is contained in:
Moritz Bunkus 2012-12-31 17:42:39 +01:00
parent f54b861491
commit a199c99508

View File

@ -92,6 +92,7 @@ def setup_globals
cflags_common += "#{c(:OPTIMIZATION_CFLAGS)} -D_FILE_OFFSET_BITS=64 #{c(:MATROSKA_CFLAGS)} #{c(:EBML_CFLAGS)} #{c(:EXTRA_CFLAGS)} #{c(:DEBUG_CFLAGS)} #{c(:PROFILING_CFLAGS)} #{c(:USER_CPPFLAGS)} "
cflags_common += "-DPACKAGE=\\\"#{c(:PACKAGE)}\\\" -DVERSION=\\\"#{c(:VERSION)}\\\" -DMTX_LOCALE_DIR=\\\"#{c(:localedir)}\\\" -DMTX_PKG_DATA_DIR=\\\"#{c(:pkgdatadir)}\\\" -DMTX_DOC_DIR=\\\"#{c(:docdir)}\\\" "
cflags_common += "#{c(:QUNUSED_ARGUMENTS)}"
cflags_common += "-mno-ms-bitfields " if c?(:MINGW)
ldflags_extra = c?(:MINGW) ? '' : "-Wl,--enable-auto-import"
$flags = {
:cflags => "#{cflags_common} #{c(:USER_CFLAGS)}",