aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristian Grothoff <christian@grothoff.org>2012-02-29 12:50:51 +0000
committerChristian Grothoff <christian@grothoff.org>2012-02-29 12:50:51 +0000
commit5191f087de98461a0b7bfa4ec36e0d980f2f3206 (patch)
tree03da7e00df3469defb48c5acbfc756976b36101a
parenta74f95cb209906901dc44cff013fa9200c4e2e4e (diff)
downloadgnunet-5191f087de98461a0b7bfa4ec36e0d980f2f3206.tar.gz
gnunet-5191f087de98461a0b7bfa4ec36e0d980f2f3206.zip
LRN: Enforce GCC bitfield layout for some structs on W32
-rw-r--r--src/include/gnunet_common.h9
-rw-r--r--src/include/gnunet_dnsparser_lib.h2
-rw-r--r--src/include/gnunet_tun_lib.h6
3 files changed, 13 insertions, 4 deletions
diff --git a/src/include/gnunet_common.h b/src/include/gnunet_common.h
index a1ef4ee24..f26d6bc98 100644
--- a/src/include/gnunet_common.h
+++ b/src/include/gnunet_common.h
@@ -141,6 +141,15 @@
141#define GNUNET_PACKED __attribute__((packed)) 141#define GNUNET_PACKED __attribute__((packed))
142 142
143/** 143/**
144 * gcc-ism to get gcc bitfield layout when compiling with -mms-bitfields
145 */
146#if MINGW
147#define GNUNET_GCC_STRUCT_LAYOUT __attribute__((gcc_struct))
148#else
149#define GNUNET_GCC_STRUCT_LAYOUT
150#endif
151
152/**
144 * gcc-ism to document unused arguments 153 * gcc-ism to document unused arguments
145 */ 154 */
146#define GNUNET_UNUSED __attribute__((unused)) 155#define GNUNET_UNUSED __attribute__((unused))
diff --git a/src/include/gnunet_dnsparser_lib.h b/src/include/gnunet_dnsparser_lib.h
index 0c310ba00..28cc4c048 100644
--- a/src/include/gnunet_dnsparser_lib.h
+++ b/src/include/gnunet_dnsparser_lib.h
@@ -128,7 +128,7 @@ struct GNUNET_DNSPARSER_Flags
128 */ 128 */
129 unsigned int recursion_available : 1 GNUNET_PACKED; 129 unsigned int recursion_available : 1 GNUNET_PACKED;
130 130
131}; 131} GNUNET_GCC_STRUCT_LAYOUT;
132 132
133 133
134/** 134/**
diff --git a/src/include/gnunet_tun_lib.h b/src/include/gnunet_tun_lib.h
index dac11d6a8..3bb1ea359 100644
--- a/src/include/gnunet_tun_lib.h
+++ b/src/include/gnunet_tun_lib.h
@@ -119,7 +119,7 @@ struct GNUNET_TUN_IPv4Header
119 * Destination of the packet. 119 * Destination of the packet.
120 */ 120 */
121 struct in_addr destination_address GNUNET_PACKED; 121 struct in_addr destination_address GNUNET_PACKED;
122}; 122} GNUNET_GCC_STRUCT_LAYOUT;
123 123
124 124
125/** 125/**
@@ -163,7 +163,7 @@ struct GNUNET_TUN_IPv6Header
163 * Destination of the packet. 163 * Destination of the packet.
164 */ 164 */
165 struct in6_addr destination_address GNUNET_PACKED; 165 struct in6_addr destination_address GNUNET_PACKED;
166}; 166} GNUNET_GCC_STRUCT_LAYOUT;
167 167
168 168
169/** 169/**
@@ -224,7 +224,7 @@ struct GNUNET_TUN_TcpHeader
224 * Urgent pointer. 224 * Urgent pointer.
225 */ 225 */
226 uint16_t urgent_pointer GNUNET_PACKED; 226 uint16_t urgent_pointer GNUNET_PACKED;
227}; 227} GNUNET_GCC_STRUCT_LAYOUT;
228 228
229 229
230/** 230/**