Reset struct alignment back to standard after each #pragma pack (n)

When using #pragma pack (n) to change the alignment for a struct
to n bytes, it is necessary to reset the alignment to the standard
value as otherwise the changed alignment is used throughout the
whole program code which causes other structs to become unaligned.
This commit is contained in:
John Paul Adrian Glaubitz
2018-05-18 23:44:40 +02:00
parent 5e490b279f
commit 2fb79510f0
4 changed files with 4 additions and 0 deletions

1
gpt.h
View File

@@ -57,6 +57,7 @@ struct GPTHeader {
uint32_t partitionEntriesCRC;
unsigned char reserved2[GPT_RESERVED];
}; // struct GPTHeader
#pragma pack ()
// Data in GPT format
class GPTData {