Index: include/dnet/ip6.h =================================================================== --- include/dnet/ip6.h (revision 652) +++ include/dnet/ip6.h (working copy) @@ -25,7 +25,9 @@ } ip6_addr_t; #ifndef __GNUC__ -# define __attribute__(x) +# ifndef __attribute__ +# define __attribute__(x) +# endif # pragma pack(1) #endif Index: include/dnet/ip.h =================================================================== --- include/dnet/ip.h (revision 652) +++ include/dnet/ip.h (working copy) @@ -25,7 +25,9 @@ typedef uint32_t ip_addr_t; #ifndef __GNUC__ -# define __attribute__(x) +# ifndef __attribute__ +# define __attribute__(x) +# endif # pragma pack(1) #endif Index: include/dnet/sctp.h =================================================================== --- include/dnet/sctp.h (revision 652) +++ include/dnet/sctp.h (working copy) @@ -11,6 +11,13 @@ #ifndef DNET_SCTP_H #define DNET_SCTP_H +#ifndef __GNUC__ +# ifndef __attribute__ +# define __attribute__(x) +# endif +# pragma pack(1) +#endif + #define SCTP_HDR_LEN 12 struct sctp_hdr { @@ -18,7 +25,7 @@ uint16_t sh_dport; /* destination port */ uint32_t sh_vtag; /* sctp verification tag */ uint32_t sh_sum; /* sctp checksum */ -}; +} __attribute__((__packed__)); #define SCTP_PORT_MAX 65535 @@ -33,7 +40,7 @@ uint8_t sch_type; /* chunk type */ uint8_t sch_flags; /* chunk flags */ uint16_t sch_length; /* chunk length */ -}; +} __attribute__((__packed__)); /* chunk types */ #define SCTP_DATA 0x00 @@ -80,7 +87,7 @@ uint16_t schi_nos; /* Number of Outbound Streams */ uint16_t schi_nis; /* Number of Inbound Streams */ uint32_t schi_itsn; /* Initial TSN */ -}; +} __attribute__((__packed__)); #define sctp_pack_chunkhdr_init(hdr, type, flags, length, itag, \ arwnd, nos, nis, itsn) do { \ @@ -105,7 +112,7 @@ uint16_t schia_nos; /* Number of Outbound Streams */ uint16_t schia_nis; /* Number of Inbound Streams */ uint32_t schia_itsn; /* Initial TSN */ -}; +} __attribute__((__packed__)); #define sctp_pack_chunkhdr_init_ack(hdr, type, flags, length, itag, \ arwnd, nos, nis, itsn) do { \ @@ -126,7 +133,7 @@ struct sctp_chunkhdr chunkhdr; /* empty */ -}; +} __attribute__((__packed__)); #define sctp_pack_chunkhdr_abort(hdr, type, flags, length) do { \ struct sctp_chunkhdr_abort *sctp_pack_chip = \ @@ -141,7 +148,7 @@ struct sctp_chunkhdr chunkhdr; /* empty */ -}; +} __attribute__((__packed__)); #define sctp_pack_chunkhdr_shutdown_ack(hdr, type, flags, length) do { \ struct sctp_chunkhdr_shutdown_ack *sctp_pack_chip = \ @@ -156,7 +163,7 @@ struct sctp_chunkhdr chunkhdr; /* empty */ -}; +} __attribute__((__packed__)); #define sctp_pack_chunkhdr_cookie_echo(hdr, type, flags, length) do { \ struct sctp_chunkhdr_cookie_echo *sctp_pack_chip = \ @@ -164,5 +171,9 @@ sctp_pack_chunkhdr(sctp_pack_chip, type, flags, length); \ } while (0) +#ifndef __GNUC__ +# pragma pack() +#endif + #endif /* DNET_SCTP_H */ Index: include/dnet/arp.h =================================================================== --- include/dnet/arp.h (revision 652) +++ include/dnet/arp.h (working copy) @@ -16,7 +16,9 @@ #define ARP_ETHIP_LEN 20 /* base ARP message length */ #ifndef __GNUC__ -# define __attribute__(x) +# ifndef __attribute__ +# define __attribute__(x) +# endif # pragma pack(1) #endif Index: include/dnet/tcp.h =================================================================== --- include/dnet/tcp.h (revision 652) +++ include/dnet/tcp.h (working copy) @@ -17,7 +17,9 @@ #define TCP_HDR_LEN_MAX (TCP_HDR_LEN + TCP_OPT_LEN_MAX) #ifndef __GNUC__ -# define __attribute__(x) +# ifndef __attribute__ +# define __attribute__(x) +# endif # pragma pack(1) #endif Index: include/dnet/icmp.h =================================================================== --- include/dnet/icmp.h (revision 652) +++ include/dnet/icmp.h (working copy) @@ -16,7 +16,9 @@ #define ICMP_LEN_MIN 8 /* minimum ICMP message size, with header */ #ifndef __GNUC__ -# define __attribute__(x) +# ifndef __attribute__ +# define __attribute__(x) +# endif # pragma pack(1) #endif