mirror of
https://gitee.com/mirrors_PX4/PX4-Autopilot.git
synced 2026-10-25 01:23:35 +08:00
Packing control for generated types
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user