Commit 210d7248 authored by Daniele Lacamera's avatar Daniele Lacamera

Added PACKED_UNION_DEF for unions contained in packed structs, just to

please ARM-RVCT20
parent 275b8aa3
......@@ -34,7 +34,7 @@ struct pico_eth
extern const uint8_t PICO_ETHADDR_ALL[];
struct pico_trans
PACKED_STRUCT_DEF pico_trans
{
uint16_t sport;
uint16_t dport;
......
......@@ -9,10 +9,12 @@
#include <stdlib.h>
#include <string.h>
#ifdef __IAR_SYSTEMS_ICC__
#if defined __IAR_SYSTEMS_ICC__ || defined ATOP
# define PACKED_STRUCT_DEF __packed struct
# define PACKED_UNION_DEF __packed union
#else
# define PACKED_STRUCT_DEF struct __attribute__((packed))
# define PACKED_UNION_DEF union /* Sane compilers do not require packed unions */
#endif
#include "pico_constants.h"
......
......@@ -18,7 +18,7 @@ PACKED_STRUCT_DEF pico_icmp4_hdr {
uint16_t crc;
/* hun */
union hun_u {
PACKED_UNION_DEF hun_u {
uint8_t ih_pptr;
struct pico_ip4 ih_gwaddr;
struct {
......@@ -38,7 +38,7 @@ PACKED_STRUCT_DEF pico_icmp4_hdr {
} hun;
/* dun */
union dun_u {
PACKED_UNION_DEF dun_u {
struct {
uint32_t ts_otime;
uint32_t ts_rtime;
......
......@@ -48,7 +48,7 @@ struct pico_ipv6_link
PACKED_STRUCT_DEF pico_ipv6_exthdr {
uint8_t nxthdr;
union ipv6_ext_u {
PACKED_UNION_DEF ipv6_ext_u {
struct {
uint8_t len;
uint8_t options[0];
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment