use gcc attributes to align and pack

This commit is contained in:
Daniel Agar
2016-04-27 20:44:15 -04:00
committed by Lorenz Meier
parent 76387b1693
commit eb29b33620
14 changed files with 47 additions and 25 deletions
+7
View File
@@ -46,6 +46,13 @@
// Hack until everything is using this header
#include <systemlib/visibility.h>
// Macro to define packed structures
#ifdef __GNUC__
#define ORBPACKED( __Declaration__ ) __Declaration__ __attribute__((aligned(4), packed))
#else
#define ORBPACKED( __Declaration__ ) __pragma( pack(push, 1) ) __Declaration__ __pragma( pack(pop) )
#endif
/**
* Object metadata.
*/