summaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorUlf Hermann <[email protected]>2017-04-07 13:34:10 +0200
committerUlf Hermann <[email protected]>2017-05-02 12:43:15 +0000
commit764dfcb97f5728cb7f4a20f38b3df5f8bd00e05f (patch)
tree30b16069a01cdb363bdccd53b6b1f73f03ea9bdd /lib
parentcb951df3eaff5228d3900f38b71e550425b72670 (diff)
Make sure packed structs follow the gcc memory layout
On windows gcc by default generates code that follows the MSVC layout. We don't want that as it adds extra padding. Change-Id: I92efe5da2a2ad818783707ee96a9b8e0eb606dbd Reviewed-by: Christian Kandeler <[email protected]>
Diffstat (limited to 'lib')
-rw-r--r--lib/eu-config.h8
1 files changed, 8 insertions, 0 deletions
diff --git a/lib/eu-config.h b/lib/eu-config.h
index 07098282..135803e7 100644
--- a/lib/eu-config.h
+++ b/lib/eu-config.h
@@ -75,6 +75,14 @@
#define attribute_hidden /* empty */
#endif
+#ifdef HAVE_GCC_STRUCT
+#define attribute_packed \
+ __attribute__ ((packed, gcc_struct))
+#else
+#define attribute_packed \
+ __attribute__ ((packed))
+#endif
+
/* Define ALLOW_UNALIGNED if the architecture allows operations on
unaligned memory locations. */
#define SANITIZE_UNDEFINED 1