#pragma pack() is also supported in GCC

This commit is contained in:
Jozef Nagy 2024-03-30 09:43:51 +01:00
parent 4d1fb71456
commit 2b8129b83b
No known key found for this signature in database
GPG key ID: 5B49DC29F09685D6
2 changed files with 3 additions and 29 deletions

View file

@ -197,10 +197,7 @@ typedef struct {
} EFI_GUID;
// MBR Partition Entry
#if defined(_MSC_VER)
#pragma pack(1)
#endif
typedef struct {
UINT8 BootIndicator;
UINT8 StartHead;
@ -212,36 +209,22 @@ typedef struct {
UINT8 EndTrack;
UINT8 StartingLBA[4];
UINT8 SizeInLBA[4];
#if defined(_MSC_VER)
} MBR_PARTITION_RECORD;
#pragma pack()
#else
} __attribute__((packed)) MBR_PARTITION_RECORD;
#endif
// Master Boot Record
#if defined(_MSC_VER)
#pragma pack(1)
#endif
typedef struct {
UINT8 BootStrapCode[440];
UINT8 UniqueMbrSignature[4];
UINT8 Unknown[2];
MBR_PARTITION_RECORD Partition[4];
UINT16 Signature;
#if defined(_MSC_VER)
} MASTER_BOOT_RECORD;
#pragma pack()
#else
} __attribute__((packed)) MASTER_BOOT_RECORD;
#endif
// GPT Partition Entry
#if defined(_MSC_VER)
#pragma pack(1)
#endif
typedef struct {
EFI_GUID PartitionTypeGUID;
EFI_GUID UniquePartitionGUID;
@ -249,11 +232,7 @@ typedef struct {
EFI_LBA EndingLBA;
UINT64 Attributes;
CHAR16 PartitionName[36];
#if defined(_MSC_VER)
} EFI_PARTITION_ENTRY;
#pragma pack()
#else
} __attribute__((packed)) EFI_PARTITION_ENTRY;
#endif
#endif /* EFI_TYPES_H */