Added extra compiler specific structure packing options.

This commit is contained in:
Richard Barry 2008-09-22 13:16:59 +00:00
parent d6ec78a568
commit aa2ffbfde5
10 changed files with 54 additions and 0 deletions

View file

@ -79,6 +79,9 @@ void icmp_time_exceeded(struct pbuf *p, enum icmp_te_type t);
# include "arch/bpstruct.h"
#endif
PACK_STRUCT_BEGIN
#if (defined(__MWERKS__) || defined(__CWCC__))
#pragma options align= packed
#endif
struct icmp_echo_hdr {
PACK_STRUCT_FIELD(u16_t _type_code);
PACK_STRUCT_FIELD(u16_t chksum);
@ -88,6 +91,9 @@ struct icmp_echo_hdr {
PACK_STRUCT_END
PACK_STRUCT_BEGIN
#if (defined(__MWERKS__) || defined(__CWCC__))
#pragma options align= packed
#endif
struct icmp_dur_hdr {
PACK_STRUCT_FIELD(u16_t _type_code);
PACK_STRUCT_FIELD(u16_t chksum);
@ -96,6 +102,9 @@ struct icmp_dur_hdr {
PACK_STRUCT_END
PACK_STRUCT_BEGIN
#if (defined(__MWERKS__) || defined(__CWCC__))
#pragma options align= packed
#endif
struct icmp_te_hdr {
PACK_STRUCT_FIELD(u16_t _type_code);
PACK_STRUCT_FIELD(u16_t chksum);

View file

@ -84,6 +84,9 @@ extern "C" {
# include "arch/bpstruct.h"
#endif
PACK_STRUCT_BEGIN
#if (defined(__MWERKS__) || defined(__CWCC__))
#pragma options align= packed
#endif
struct igmp_msg {
PACK_STRUCT_FIELD(u8_t igmp_msgtype);
PACK_STRUCT_FIELD(u8_t igmp_maxresp);

View file

@ -114,6 +114,9 @@ struct ip_pcb {
# include "arch/bpstruct.h"
#endif
PACK_STRUCT_BEGIN
#if (defined(__MWERKS__) || defined(__CWCC__))
#pragma options align= packed
#endif
struct ip_hdr {
/* version / header length / type of service */
PACK_STRUCT_FIELD(u16_t _v_hl_tos);

View file

@ -42,6 +42,9 @@ extern "C" {
# include "arch/bpstruct.h"
#endif
PACK_STRUCT_BEGIN
#if (defined(__MWERKS__) || defined(__CWCC__))
#pragma options align= packed
#endif
struct ip_addr {
PACK_STRUCT_FIELD(u32_t addr);
} PACK_STRUCT_STRUCT;
@ -58,6 +61,9 @@ PACK_STRUCT_END
# include "arch/bpstruct.h"
#endif
PACK_STRUCT_BEGIN
#if (defined(__MWERKS__) || defined(__CWCC__))
#pragma options align= packed
#endif
struct ip_addr2 {
PACK_STRUCT_FIELD(u16_t addrw[2]);
} PACK_STRUCT_STRUCT;

View file

@ -44,6 +44,9 @@ extern "C" {
# include "arch/bpstruct.h"
#endif
PACK_STRUCT_BEGIN
#if (defined(__MWERKS__) || defined(__CWCC__))
#pragma options align= packed
#endif
struct ip_addr {
PACK_STRUCT_FIELD(u32_t addr[4]);
} PACK_STRUCT_STRUCT;
@ -60,6 +63,9 @@ PACK_STRUCT_END
# include "arch/bpstruct.h"
#endif
PACK_STRUCT_BEGIN
#if (defined(__MWERKS__) || defined(__CWCC__))
#pragma options align= packed
#endif
struct ip_addr2 {
PACK_STRUCT_FIELD(u16_t addrw[2]);
} PACK_STRUCT_STRUCT;

View file

@ -76,6 +76,9 @@ struct dhcp
# include "arch/bpstruct.h"
#endif
PACK_STRUCT_BEGIN
#if (defined(__MWERKS__) || defined(__CWCC__))
#pragma options align= packed
#endif
/** minimum set of fields of any DHCP message */
struct dhcp_msg
{

View file

@ -210,6 +210,9 @@ void tcp_rexmit_rto (struct tcp_pcb *pcb);
# include "arch/bpstruct.h"
#endif
PACK_STRUCT_BEGIN
#if (defined(__MWERKS__) || defined(__CWCC__))
#pragma options align= packed
#endif
struct tcp_hdr {
PACK_STRUCT_FIELD(u16_t src);
PACK_STRUCT_FIELD(u16_t dest);

View file

@ -52,6 +52,9 @@ extern "C" {
# include "arch/bpstruct.h"
#endif
PACK_STRUCT_BEGIN
#if (defined(__MWERKS__) || defined(__CWCC__))
#pragma options align= packed
#endif
struct udp_hdr {
PACK_STRUCT_FIELD(u16_t src);
PACK_STRUCT_FIELD(u16_t dest); /* src/dest UDP ports */

View file

@ -60,6 +60,9 @@ extern "C" {
# include "arch/bpstruct.h"
#endif
PACK_STRUCT_BEGIN
#if (defined(__MWERKS__) || defined(__CWCC__))
#pragma options align= packed
#endif
struct eth_addr {
PACK_STRUCT_FIELD(u8_t addr[ETHARP_HWADDR_LEN]);
} PACK_STRUCT_STRUCT;
@ -72,6 +75,9 @@ PACK_STRUCT_END
# include "arch/bpstruct.h"
#endif
PACK_STRUCT_BEGIN
#if (defined(__MWERKS__) || defined(__CWCC__))
#pragma options align= packed
#endif
struct eth_hdr {
#if ETH_PAD_SIZE
PACK_STRUCT_FIELD(u8_t padding[ETH_PAD_SIZE]);
@ -89,6 +95,9 @@ PACK_STRUCT_END
# include "arch/bpstruct.h"
#endif
PACK_STRUCT_BEGIN
#if (defined(__MWERKS__) || defined(__CWCC__))
#pragma options align= packed
#endif
/** the ARP message */
struct etharp_hdr {
PACK_STRUCT_FIELD(struct eth_hdr ethhdr);
@ -110,6 +119,9 @@ PACK_STRUCT_END
# include "arch/bpstruct.h"
#endif
PACK_STRUCT_BEGIN
#if (defined(__MWERKS__) || defined(__CWCC__))
#pragma options align= packed
#endif
struct ethip_hdr {
PACK_STRUCT_FIELD(struct eth_hdr eth);
PACK_STRUCT_FIELD(struct ip_hdr ip);

View file

@ -78,6 +78,9 @@
# include "arch/bpstruct.h"
#endif
PACK_STRUCT_BEGIN
#if (defined(__MWERKS__) || defined(__CWCC__))
#pragma options align= packed
#endif
struct pppoehdr {
PACK_STRUCT_FIELD(u8_t vertype);
PACK_STRUCT_FIELD(u8_t code);
@ -93,6 +96,9 @@ PACK_STRUCT_END
# include "arch/bpstruct.h"
#endif
PACK_STRUCT_BEGIN
#if (defined(__MWERKS__) || defined(__CWCC__))
#pragma options align= packed
#endif
struct pppoetag {
PACK_STRUCT_FIELD(u16_t tag);
PACK_STRUCT_FIELD(u16_t len);