diff --git a/src/defs.h b/src/defs.h index b0721087..06886880 100644 --- a/src/defs.h +++ b/src/defs.h @@ -147,14 +147,6 @@ # endif #endif /* __fallthrough */ -#ifndef __packed -# if defined(__GNUC__) || __has_attribute(packed) -# define __packed __attribute__((packed)) -# else -# define __packed -# endif -#endif /* __packed */ - #ifndef __aligned # if defined(__GNUC__) || __has_attribute(aligned) # define __aligned(N) __attribute__((aligned(N))) diff --git a/test/chrono.h b/test/chrono.h index 4be7e46e..d5e9f658 100644 --- a/test/chrono.h +++ b/test/chrono.h @@ -20,9 +20,11 @@ namespace chrono { +#pragma pack(push, 1) + typedef union time { uint64_t fixedpoint; - struct __packed { + struct { #if __BYTE_ORDER__ == __ORDER_LITTLE_ENDIAN__ uint32_t fractional; union { @@ -42,6 +44,8 @@ typedef union time { uint32_t seconds() const { return utc; } } time; +#pragma pack(pop) + uint32_t ns2fractional(uint32_t); uint32_t fractional2ns(uint32_t); uint32_t us2fractional(uint32_t);