mirror of
https://github.com/ETLCPP/etl.git
synced 2026-11-09 14:49:53 +08:00
Packed unaligned_type (#989)
This way, unaligned_types like etl::be_uint32_t can be used in places where POD types are expected.
This commit is contained in:
parent
99d7537506
commit
84eea5bb1f
@ -454,6 +454,14 @@ SOFTWARE.
|
||||
#define ETL_HAS_INITIALIZER_LIST 0
|
||||
#endif
|
||||
|
||||
//*************************************
|
||||
// Determine if the ETL should use __attribute__((packed).
|
||||
#if defined(ETL_COMPILER_CLANG) || defined(ETL_COMPILER_GCC) || defined(ETL_COMPILER_INTEL)
|
||||
#define ETL_PACKED __attribute__((packed))
|
||||
#else
|
||||
#define ETL_PACKED
|
||||
#endif
|
||||
|
||||
//*************************************
|
||||
// Check for availability of certain builtins
|
||||
#include "profiles/determine_builtin_support.h"
|
||||
|
||||
@ -227,7 +227,7 @@ namespace etl
|
||||
///\tparam Endian The endianness of the arithmetic type.
|
||||
//*************************************************************************
|
||||
template <typename T, int Endian_>
|
||||
class unaligned_type : public private_unaligned_type::unaligned_type_common<sizeof(T)>
|
||||
class ETL_PACKED unaligned_type : public private_unaligned_type::unaligned_type_common<sizeof(T)>
|
||||
{
|
||||
public:
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user