Explorar o código

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

Ambroz Bizjak %!s(int64=9) %!d(string=hai) anos
pai
achega
2b6f4d5505
Modificáronse 1 ficheiros con 5 adicións e 0 borrados
  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