浏览代码

Workaround issue with structure packing not working on gcc/windows.

Ambroz Bizjak 9 年之前
父节点
当前提交
2b6f4d5505
共有 1 个文件被更改,包括 5 次插入0 次删除
  1. 5 0
      misc/packed.h

+ 5 - 0
misc/packed.h

@@ -44,7 +44,12 @@
 
 #define B_START_PACKED
 #define B_END_PACKED
+#if defined(__GNUC__) && defined(__MINGW32__)
+// Workaround https://gcc.gnu.org/bugzilla/show_bug.cgi?id=52991
+#define B_PACKED __attribute__((packed)) __attribute__((gcc_struct))
+#else
 #define B_PACKED __attribute__((packed))
+#endif
 
 #endif