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:
@@ -386,6 +386,11 @@ static int image_is_track_audio(uint8_t id, uint32_t pos, int ismsf)
|
|||||||
return attr == AUDIO_TRACK;
|
return attr == AUDIO_TRACK;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#ifdef _MSC_VER
|
||||||
|
#pragma pack(push, 1)
|
||||||
|
#define __attribute__(x)
|
||||||
|
#endif
|
||||||
|
|
||||||
typedef struct __attribute__((__packed__))
|
typedef struct __attribute__((__packed__))
|
||||||
{
|
{
|
||||||
uint8_t user_data[2048];
|
uint8_t user_data[2048];
|
||||||
@@ -433,6 +438,11 @@ typedef union __attribute__((__packed__))
|
|||||||
uint8_t buffer[2856];
|
uint8_t buffer[2856];
|
||||||
} sector_buffer_t;
|
} sector_buffer_t;
|
||||||
|
|
||||||
|
#ifdef _MSC_VER
|
||||||
|
#pragma pack(pop)
|
||||||
|
#undef __attribute__
|
||||||
|
#endif
|
||||||
|
|
||||||
sector_buffer_t cdrom_sector_buffer;
|
sector_buffer_t cdrom_sector_buffer;
|
||||||
|
|
||||||
int cdrom_sector_size;
|
int cdrom_sector_size;
|
||||||
|
|||||||
Reference in New Issue
Block a user