diff --git a/compiler.h b/compiler.h index 9af5dc6c91..a2d5959e4b 100644 --- a/compiler.h +++ b/compiler.h @@ -12,6 +12,12 @@ #define QEMU_WARN_UNUSED_RESULT #endif +#if defined(_WIN32) +# define QEMU_PACKED __attribute__((gcc_struct, packed)) +#else +# define QEMU_PACKED __attribute__((packed)) +#endif + #define QEMU_BUILD_BUG_ON(x) \ typedef char qemu_build_bug_on__##__LINE__[(x)?-1:1];