Packing control for generated types

This commit is contained in:
Pavel Kirienko
2014-03-03 16:27:06 +04:00
parent 02963500ec
commit 89f8925a76
2 changed files with 21 additions and 0 deletions
@@ -18,6 +18,17 @@ namespace uavcan
# endif
#endif
/**
* Struct layout control.
* Define UAVCAN_PACK_STRUCTS = 1 to reduce memory usage.
*/
#ifndef UAVCAN_PACKED_BEGIN
# define UAVCAN_PACKED_BEGIN _Pragma("pack(push, 1)")
#endif
#ifndef UAVCAN_PACKED_END
# define UAVCAN_PACKED_END _Pragma("pack(pop)")
#endif
/**
* Should be OK for any target arch up to AMD64 and any compiler.
* The library leverages compile-time checks to ensure that all types that are subject to dynamic allocation