Forgot the alignment for compact structs.

Signed-off-by: Nev3r <apophycens@gmail.com>
This commit is contained in:
Nev3r 2018-11-25 11:35:19 +01:00
parent b48c1d1ce6
commit d7b3cf9314
2 changed files with 13 additions and 7 deletions

View File

@ -79,13 +79,6 @@ int snprintf(char *str, size_t n, const char *fmt, ...);
#define O_BINARY 0 #define O_BINARY 0
#endif #endif
#if defined(_MSC_VER)
#pragma pack(1)
#endif
#if defined(_MSC_VER)
#pragma pack()
#endif
typedef struct typedef struct
{ {
@ -466,6 +459,9 @@ static boolean ResFindSignature (FILE* handle, char endPat[], UINT32 startpos)
return false; return false;
} }
#if defined(_MSC_VER)
#pragma pack(1)
#endif
typedef struct zend_s typedef struct zend_s
{ {
char signature[4]; char signature[4];
@ -513,6 +509,9 @@ typedef struct zlentry_s
UINT16 namelen; UINT16 namelen;
UINT16 xtralen; UINT16 xtralen;
} ATTRPACK zlentry_t; } ATTRPACK zlentry_t;
#if defined(_MSC_VER)
#pragma pack()
#endif
/** Create a lumpinfo_t array for a PKZip file. /** Create a lumpinfo_t array for a PKZip file.
*/ */

View File

@ -24,12 +24,19 @@
// a raw entry of the wad directory // a raw entry of the wad directory
// NOTE: This sits here and not in w_wad.c because p_setup.c makes use of it to load map WADs inside PK3s. // NOTE: This sits here and not in w_wad.c because p_setup.c makes use of it to load map WADs inside PK3s.
#if defined(_MSC_VER)
#pragma pack(1)
#endif
typedef struct typedef struct
{ {
UINT32 filepos; // file offset of the resource UINT32 filepos; // file offset of the resource
UINT32 size; // size of the resource UINT32 size; // size of the resource
char name[8]; // name of the resource char name[8]; // name of the resource
} ATTRPACK filelump_t; } ATTRPACK filelump_t;
#if defined(_MSC_VER)
#pragma pack()
#endif
// ============================================================== // ==============================================================
// WAD FILE STRUCTURE DEFINITIONS // WAD FILE STRUCTURE DEFINITIONS