#ifndef WIN32 ... #define PACKED __attribute__((packed)) #else #pragma pack(1) #define PACKED #endif typedef struct PACKED { ... } blabla, *pblabla;