--- libaitmqtt/inc/aitmqtt.h 2013/05/30 09:18:33 1.3 +++ libaitmqtt/inc/aitmqtt.h 2016/09/14 15:52:36 1.3.4.1 @@ -3,7 +3,7 @@ * by Michael Pounov * * $Author: misho $ -* $Id: aitmqtt.h,v 1.3 2013/05/30 09:18:33 misho Exp $ +* $Id: aitmqtt.h,v 1.3.4.1 2016/09/14 15:52:36 misho Exp $ * ************************************************************************** The ELWIX and AITNET software is distributed under the following @@ -12,7 +12,7 @@ terms: All of the documentation and software included in the ELWIX and AITNET Releases is copyrighted by ELWIX - Sofia/Bulgaria -Copyright 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012, 2013 +Copyright 2004 - 2016 by Michael Pounov . All rights reserved. Redistribution and use in source and binary forms, with or without @@ -69,7 +69,7 @@ struct mqtthdr { unsigned char val; } mqtt_msg; unsigned char mqtt_len[1]; /* may be grow to 4 bytes */ -} __packed; +} __attribute__((packed)); #define MQTTHDR_MSGINIT(x) (assert((x)), (x)->mqtt_msg.val ^= (x)->mqtt_msg.val) #define MQTTHDR_DATA_SIZEOF(x) (assert((x)), mqtt_decodeLen((x)->mqtt_len, NULL)) @@ -170,7 +170,7 @@ typedef struct { typedef struct { mqtt_len_t var_sb; unsigned char var_data[0]; -} __packed mqtthdr_var_t; +} __attribute__((packed)) mqtthdr_var_t; #define MQTTHDR_VAR_SIZEOF(x) (assert((x)), sizeof(mqtt_len_t) + ntohs((x)->var_sb.val)) typedef unsigned char mqtthdr_protover_t; @@ -186,12 +186,12 @@ typedef union { username:1; }; unsigned char flags; -} __packed mqtthdr_connflgs_t; +} __attribute__((packed)) mqtthdr_connflgs_t; typedef struct { unsigned char reserved; unsigned char retcode; -} __packed mqtthdr_connack_t; +} __attribute__((packed)) mqtthdr_connack_t; // -------------------------------------------------------