diff --git a/clients/opal/models/send_receive/include/msg_format.h b/clients/opal/models/send_receive/include/msg_format.h index e9676b28a..7de407a73 100644 --- a/clients/opal/models/send_receive/include/msg_format.h +++ b/clients/opal/models/send_receive/include/msg_format.h @@ -10,9 +10,11 @@ #include -#ifndef BYTE_ORDER +#ifdef __linux__ #define _BSD_SOURCE 1 #include +#elif !defined(BYTE_ORDER) + #error "Please define BYTE_ORDER" #endif #include "config.h" @@ -70,6 +72,6 @@ struct msg float f; /**< Floating point values (note msg::endian) */ uint32_t i; /**< Integer values (note msg::endian) */ } data[MSG_VALUES]; -} __attribute__((packed)); +} __attribute__((aligned(4), packed)); #endif /* _MSG_FORMAT_H_ */ diff --git a/server/include/msg_format.h b/server/include/msg_format.h index e9676b28a..7de407a73 100644 --- a/server/include/msg_format.h +++ b/server/include/msg_format.h @@ -10,9 +10,11 @@ #include -#ifndef BYTE_ORDER +#ifdef __linux__ #define _BSD_SOURCE 1 #include +#elif !defined(BYTE_ORDER) + #error "Please define BYTE_ORDER" #endif #include "config.h" @@ -70,6 +72,6 @@ struct msg float f; /**< Floating point values (note msg::endian) */ uint32_t i; /**< Integer values (note msg::endian) */ } data[MSG_VALUES]; -} __attribute__((packed)); +} __attribute__((aligned(4), packed)); #endif /* _MSG_FORMAT_H_ */