From 2fb79510f0452e91b72cefa704268a569b9885e9 Mon Sep 17 00:00:00 2001 From: John Paul Adrian Glaubitz Date: Fri, 18 May 2018 23:44:40 +0200 Subject: 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. --- basicmbr.h | 1 + 1 file changed, 1 insertion(+) (limited to 'basicmbr.h') diff --git a/basicmbr.h b/basicmbr.h index b809856..21f962e 100644 --- a/basicmbr.h +++ b/basicmbr.h @@ -34,6 +34,7 @@ struct TempMBR { struct MBRRecord partitions[4]; uint16_t MBRSignature; }; // struct TempMBR +#pragma pack () // Possible states of the MBR enum MBRValidity {invalid, gpt, hybrid, mbr}; -- cgit v1.2.1