diff options
author | Christian Grothoff <christian@grothoff.org> | 2012-01-30 21:32:10 +0000 |
---|---|---|
committer | Christian Grothoff <christian@grothoff.org> | 2012-01-30 21:32:10 +0000 |
commit | 3415075bda4992dcef7ea51e29126b4a6b2f001c (patch) | |
tree | 80018eff689be498766c83870bcf161095837c7a /src/include/gnunet_tun_lib.h | |
parent | 77c03065a39f869a188b4e2e8cd6a88dc7a02fc8 (diff) | |
download | gnunet-3415075bda4992dcef7ea51e29126b4a6b2f001c.tar.gz gnunet-3415075bda4992dcef7ea51e29126b4a6b2f001c.zip |
-improve byteorder macro checks for FreeBSD
Diffstat (limited to 'src/include/gnunet_tun_lib.h')
-rw-r--r-- | src/include/gnunet_tun_lib.h | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/src/include/gnunet_tun_lib.h b/src/include/gnunet_tun_lib.h index 5bac236d9..f11a3af3e 100644 --- a/src/include/gnunet_tun_lib.h +++ b/src/include/gnunet_tun_lib.h | |||
@@ -70,12 +70,14 @@ struct GNUNET_TUN_Layer2PacketHeader | |||
70 | */ | 70 | */ |
71 | struct GNUNET_TUN_IPv4Header | 71 | struct GNUNET_TUN_IPv4Header |
72 | { | 72 | { |
73 | #if __BYTE_ORDER == __LITTLE_ENDIAN | 73 | #if __BYTE_ORDER == __LITTLE_ENDIAN || _BYTE_ORDER == _LITTLE_ENDIAN |
74 | unsigned int header_length:4 GNUNET_PACKED; | 74 | unsigned int header_length:4 GNUNET_PACKED; |
75 | unsigned int version:4 GNUNET_PACKED; | 75 | unsigned int version:4 GNUNET_PACKED; |
76 | #elif __BYTE_ORDER == __BIG_ENDIAN | 76 | #elif __BYTE_ORDER == __BIG_ENDIAN || _BYTE_ORDER == _BIG_ENDIAN |
77 | unsigned int version:4 GNUNET_PACKED; | 77 | unsigned int version:4 GNUNET_PACKED; |
78 | unsigned int header_length:4 GNUNET_PACKED; | 78 | unsigned int header_length:4 GNUNET_PACKED; |
79 | #else | ||
80 | #error byteorder undefined | ||
79 | #endif | 81 | #endif |
80 | uint8_t diff_serv; | 82 | uint8_t diff_serv; |
81 | 83 | ||
@@ -125,15 +127,17 @@ struct GNUNET_TUN_IPv4Header | |||
125 | */ | 127 | */ |
126 | struct GNUNET_TUN_IPv6Header | 128 | struct GNUNET_TUN_IPv6Header |
127 | { | 129 | { |
128 | #if __BYTE_ORDER == __LITTLE_ENDIAN | 130 | #if __BYTE_ORDER == __LITTLE_ENDIAN || _BYTE_ORDER == _LITTLE_ENDIAN |
129 | unsigned int traffic_class_h:4 GNUNET_PACKED; | 131 | unsigned int traffic_class_h:4 GNUNET_PACKED; |
130 | unsigned int version:4 GNUNET_PACKED; | 132 | unsigned int version:4 GNUNET_PACKED; |
131 | unsigned int traffic_class_l:4 GNUNET_PACKED; | 133 | unsigned int traffic_class_l:4 GNUNET_PACKED; |
132 | unsigned int flow_label:20 GNUNET_PACKED; | 134 | unsigned int flow_label:20 GNUNET_PACKED; |
133 | #elif __BYTE_ORDER == __BIG_ENDIAN | 135 | #elif __BYTE_ORDER == __BIG_ENDIAN || _BYTE_ORDER == _BIG_ENDIAN |
134 | unsigned int version:4 GNUNET_PACKED; | 136 | unsigned int version:4 GNUNET_PACKED; |
135 | unsigned int traffic_class:8 GNUNET_PACKED; | 137 | unsigned int traffic_class:8 GNUNET_PACKED; |
136 | unsigned int flow_label:20 GNUNET_PACKED; | 138 | unsigned int flow_label:20 GNUNET_PACKED; |
139 | #else | ||
140 | #error byteorder undefined | ||
137 | #endif | 141 | #endif |
138 | /** | 142 | /** |
139 | * Length of the payload, excluding this header. | 143 | * Length of the payload, excluding this header. |