From 638bf559c2f1e8eba73cc7d272af4c38845932fc Mon Sep 17 00:00:00 2001 From: Steffen Vogel Date: Sun, 31 Aug 2014 16:21:16 +0000 Subject: [PATCH] on-wire messages should by float aligned! git-svn-id: https://zerberus.eonerc.rwth-aachen.de:8443/svn/s2ss/trunk@187 8ec27952-4edc-4aab-86aa-e87bb2611832 --- clients/opal/models/send_receive/include/msg_format.h | 6 ++++-- server/include/msg_format.h | 6 ++++-- 2 files changed, 8 insertions(+), 4 deletions(-) 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_ */