Mi código solía funcionar en el pasado, pero ahora el tamaño de la estructura es de repente de 16 bytes. Solía ser 13 bytes. Recientemente actualicé de Xcode 4.2 a Xcode 4.3.1 (4E1019).pragma pack (1) ni __attribute__ ((aligned (1))) works
#pragma pack(1)
struct ChunkStruct {
uint32_t width;
uint32_t height;
uint8_t bit_depth;
uint8_t color_type;
uint8_t compression;
uint8_t filter;
uint8_t interlace;
};
#pragma pack()
STATIC_ASSERT(expected_13bytes, sizeof(struct ChunkStruct) == 13);
He intentado infructuosamente usando
#pragma pack(push, 1)
/* struct ChunkStruct { ... }; */
#pragma pack(pop)
también he intentado lo siguiente, pero sin suerte
struct ChunkStruct {
uint32_t width;
uint32_t height;
uint8_t bit_depth;
uint8_t color_type;
uint8_t compression;
uint8_t filter;
uint8_t interlace;
} __attribute__ ((aligned (1)));
Cómo empacar estructuras con Xcode 4.3.1?