Skip to content

Commit

Permalink
mavlink_types.h: use MAVPACKED instead of PACKED
Browse files Browse the repository at this point in the history
the name PACKED is too generic, and may already be defined
  • Loading branch information
Andrew Tridgell committed Dec 2, 2014
1 parent b6a4a69 commit f115f77
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions pymavlink/generator/C/include_v1.0/mavlink_types.h
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,9 @@

// Macro to define packed structures
#ifdef __GNUC__
#define PACKED( __Declaration__ ) __Declaration__ __attribute__((packed))
#define MAVPACKED( __Declaration__ ) __Declaration__ __attribute__((packed))
#else
#define PACKED( __Declaration__ ) __pragma( pack(push, 1) ) __Declaration__ __pragma( pack(pop) )
#define MAVPACKED( __Declaration__ ) __pragma( pack(push, 1) ) __Declaration__ __pragma( pack(pop) )
#endif

#ifndef MAVLINK_MAX_PAYLOAD_LEN
Expand Down Expand Up @@ -50,7 +50,7 @@
* and re-instanted on the receiving side using the
* native type as well.
*/
PACKED(
MAVPACKED(
typedef struct param_union {
union {
float param_float;
Expand Down Expand Up @@ -79,7 +79,7 @@ typedef struct param_union {
* which should be the same as gcc on little-endian arm. When using shifts/masks the value will be treated as a 64 bit unsigned number,
* and the bits pulled out using the shifts/masks.
*/
PACKED(
MAVPACKED(
typedef union {
struct {
uint8_t is_double:1;
Expand All @@ -103,13 +103,13 @@ typedef union {
* This structure is required to make the mavlink_send_xxx convenience functions
* work, as it tells the library what the current system and component ID are.
*/
PACKED(
MAVPACKED(
typedef struct __mavlink_system {
uint8_t sysid; ///< Used by the MAVLink message_xx_send() convenience function
uint8_t compid; ///< Used by the MAVLink message_xx_send() convenience function
}) mavlink_system_t;

PACKED(
MAVPACKED(
typedef struct __mavlink_message {
uint16_t checksum; ///< sent at end of packet
uint8_t magic; ///< protocol magic marker
Expand All @@ -121,7 +121,7 @@ typedef struct __mavlink_message {
uint64_t payload64[(MAVLINK_MAX_PAYLOAD_LEN+MAVLINK_NUM_CHECKSUM_BYTES+7)/8];
}) mavlink_message_t;

PACKED(
MAVPACKED(
typedef struct __mavlink_extended_message {
mavlink_message_t base_msg;
int32_t extended_payload_len; ///< Length of extended payload if any
Expand Down

0 comments on commit f115f77

Please sign in to comment.