foxygit / doom Log in
commit 9d814494e521de5d75dc10d032da67cc28f9820a
Author:     Fabian Greffrath <fabian@greffrath.com>
AuthorDate: Mon Aug 24 19:14:05 2015 +0200
Commit:     Fabian Greffrath <fabian@greffrath.com>
CommitDate: Mon Aug 24 19:14:05 2015 +0200

    Apply gcc_struct tag to packed structs

    GCC fails to properly pack structs although they are tagged with
    __attribute__((__packed__)) if called with -mms-bitfields which has
    become the default on Windows at some point:

    https://gcc.gnu.org/bugzilla/show_bug.cgi?id=52991
---
 src/doomtype.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/doomtype.h b/src/doomtype.h
index 3b92973d..1883344c 100644
--- a/src/doomtype.h
+++ b/src/doomtype.h
@@ -51,7 +51,7 @@
 //

 #ifdef __GNUC__
-#define PACKEDATTR __attribute__((packed))
+#define PACKEDATTR __attribute__((packed,gcc_struct))
 #else
 #define PACKEDATTR
 #endif