summarylogtreecommitdiffstats
path: root/0011-Apply-gcc_struct-tag-to-packed-structs.patch
blob: 41cfb7fe5b4d396db4eb75fc429bbe73025aae7e (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
From 87db726b9a9ae61caf2ff167450625ce8f4076c3 Mon Sep 17 00:00:00 2001
From: Fabian Greffrath <fabian@greffrath.com>
Date: Mon, 24 Aug 2015 19:14:05 +0200
Subject: [PATCH 11/13] 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 10820c1..5377c8c 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
-- 
2.5.0