File tree Expand file tree Collapse file tree 2 files changed +9
-1
lines changed Expand file tree Collapse file tree 2 files changed +9
-1
lines changed Original file line number Diff line number Diff line change @@ -454,6 +454,14 @@ SOFTWARE.
454454 #define ETL_HAS_INITIALIZER_LIST 0
455455#endif
456456
457+ // *************************************
458+ // Determine if the ETL should use __attribute__((packed).
459+ #if defined(ETL_COMPILER_CLANG) || defined(ETL_COMPILER_GCC) || defined(ETL_COMPILER_INTEL)
460+ #define ETL_PACKED __attribute__ ((packed))
461+ #else
462+ #define ETL_PACKED
463+ #endif
464+
457465// *************************************
458466// Check for availability of certain builtins
459467#include " profiles/determine_builtin_support.h"
Original file line number Diff line number Diff line change @@ -227,7 +227,7 @@ namespace etl
227227 // /\tparam Endian The endianness of the arithmetic type.
228228 // *************************************************************************
229229 template <typename T, int Endian_>
230- class unaligned_type : public private_unaligned_type ::unaligned_type_common<sizeof (T)>
230+ class ETL_PACKED unaligned_type : public private_unaligned_type::unaligned_type_common<sizeof (T)>
231231 {
232232 public:
233233
You can’t perform that action at this time.
0 commit comments