diff --git a/include/patty/ax25.h b/include/patty/ax25.h index 86acc01..39fe901 100644 --- a/include/patty/ax25.h +++ b/include/patty/ax25.h @@ -38,16 +38,11 @@ enum patty_ax25_proto { PATTY_AX25_PROTO_ESCAPE = 0xff }; -#pragma pack(push) -#pragma pack(1) - typedef struct _patty_ax25_addr { - char callsign[PATTY_AX25_CALLSTRLEN]; - uint8_t ssid; + char callsign[PATTY_AX25_CALLSTRLEN] __attribute__((packed, aligned(1))); + uint8_t ssid __attribute__((packed, aligned(1))); } patty_ax25_addr; -#pragma pack(pop) - enum patty_ax25_param_type { PATTY_AX25_PARAM_CLASSES = 2, PATTY_AX25_PARAM_HDLC = 3, diff --git a/include/patty/ax25/frame.h b/include/patty/ax25/frame.h index c848db8..9ff1865 100644 --- a/include/patty/ax25/frame.h +++ b/include/patty/ax25/frame.h @@ -89,22 +89,18 @@ enum patty_ax25_frame_xid_group_type { PATTY_AX25_FRAME_XID_GROUP_PARAMS = 0x80 }; -#pragma pack(push) -#pragma pack(1) - typedef struct _patty_ax25_frame_xid_group { - uint8_t format, - type; + uint8_t format __attribute__((packed, aligned(1))), + type __attribute__((packed, aligned(1))); - uint16_t len; + uint16_t len __attribute__((packed, aligned(1))); } patty_ax25_frame_xid_group; typedef struct _patty_ax25_frame_xid_param { - uint8_t id, len; + uint8_t id __attribute__((packed, aligned(1))), + len __attribute__((packed, aligned(1))); } patty_ax25_frame_xid_param; -#pragma pack(pop) - ssize_t patty_ax25_frame_decode_address(patty_ax25_frame *frame, const void *buf, size_t len);