MSVC: Fix usage of gcc __attribute__((packed))

Yes, this is ugly but sadly there's no standard way to define packed
structs
This commit is contained in:
darkstar
2018-02-21 20:46:07 +01:00
parent d213bcf735
commit 93f9233fb6

View File

@@ -386,6 +386,11 @@ static int image_is_track_audio(uint8_t id, uint32_t pos, int ismsf)
return attr == AUDIO_TRACK;
}
#ifdef _MSC_VER
#pragma pack(push, 1)
#define __attribute__(x)
#endif
typedef struct __attribute__((__packed__))
{
uint8_t user_data[2048];
@@ -433,6 +438,11 @@ typedef union __attribute__((__packed__))
uint8_t buffer[2856];
} sector_buffer_t;
#ifdef _MSC_VER
#pragma pack(pop)
#undef __attribute__
#endif
sector_buffer_t cdrom_sector_buffer;
int cdrom_sector_size;