LRN: Enforce GCC bitfield layout for some structs on W32
authorChristian Grothoff <christian@grothoff.org>
Wed, 29 Feb 2012 12:50:51 +0000 (12:50 +0000)
committerChristian Grothoff <christian@grothoff.org>
Wed, 29 Feb 2012 12:50:51 +0000 (12:50 +0000)
src/include/gnunet_common.h
src/include/gnunet_dnsparser_lib.h
src/include/gnunet_tun_lib.h

index a1ef4ee24ba1e7c31c34856354eaa4d8573df1f9..f26d6bc986625757bc7e6010ba2885548b2b841b 100644 (file)
  */
 #define GNUNET_PACKED __attribute__((packed))
 
+/**
+ * gcc-ism to get gcc bitfield layout when compiling with -mms-bitfields
+ */
+#if MINGW
+#define GNUNET_GCC_STRUCT_LAYOUT __attribute__((gcc_struct))
+#else
+#define GNUNET_GCC_STRUCT_LAYOUT
+#endif
+
 /**
  * gcc-ism to document unused arguments
  */
index 0c310ba003feb342e9fb77c74cfa1e244841d5c2..28cc4c0485b38bb27dce93139a60aaf1cc66b54a 100644 (file)
@@ -128,7 +128,7 @@ struct GNUNET_DNSPARSER_Flags
    */
   unsigned int recursion_available  : 1 GNUNET_PACKED; 
   
-};
+} GNUNET_GCC_STRUCT_LAYOUT;
 
 
 /**
index dac11d6a876ed330f7a1716c55ed82eb4aece006..3bb1ea359a97689c435a69210dae09147872c7cb 100644 (file)
@@ -119,7 +119,7 @@ struct GNUNET_TUN_IPv4Header
    * Destination of the packet.
    */ 
   struct in_addr destination_address GNUNET_PACKED;
-};
+} GNUNET_GCC_STRUCT_LAYOUT;
 
 
 /**
@@ -163,7 +163,7 @@ struct GNUNET_TUN_IPv6Header
    * Destination of the packet.
    */ 
   struct in6_addr destination_address GNUNET_PACKED;
-};
+} GNUNET_GCC_STRUCT_LAYOUT;
 
 
 /**
@@ -224,7 +224,7 @@ struct GNUNET_TUN_TcpHeader
    * Urgent pointer.
    */
   uint16_t urgent_pointer GNUNET_PACKED;
-};
+} GNUNET_GCC_STRUCT_LAYOUT;
 
 
 /**