diff options
Diffstat (limited to 'src/doomdef.h')
-rw-r--r-- | src/doomdef.h | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/src/doomdef.h b/src/doomdef.h index 37c6810c..bcd27e27 100644 --- a/src/doomdef.h +++ b/src/doomdef.h @@ -32,6 +32,21 @@ #include <string.h> // +// The packed attribute forces structures to be packed into the minimum +// space necessary. If this is not done, the compiler may align structure +// fields differently to optimise memory access, inflating the overall +// structure size. It is important to use the packed attribute on certain +// structures where alignment is important, particularly data read/written +// to disk. +// + +#ifdef __GNUC__ +#define PACKEDATTR __attribute__((packed)) +#else +#define PACKEDATTR +#endif + +// // Global parameters/defines. // // DOOM version |