mirror of
https://git.rwth-aachen.de/acs/public/villas/node/
synced 2025-03-09 00:00:00 +01:00
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
This commit is contained in:
parent
7fb7d6157f
commit
638bf559c2
2 changed files with 8 additions and 4 deletions
|
@ -10,9 +10,11 @@
|
|||
|
||||
#include <stdint.h>
|
||||
|
||||
#ifndef BYTE_ORDER
|
||||
#ifdef __linux__
|
||||
#define _BSD_SOURCE 1
|
||||
#include <endian.h>
|
||||
#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_ */
|
||||
|
|
|
@ -10,9 +10,11 @@
|
|||
|
||||
#include <stdint.h>
|
||||
|
||||
#ifndef BYTE_ORDER
|
||||
#ifdef __linux__
|
||||
#define _BSD_SOURCE 1
|
||||
#include <endian.h>
|
||||
#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_ */
|
||||
|
|
Loading…
Add table
Reference in a new issue