Revision 0c76e635 libavutil/intreadwrite.h
libavutil/intreadwrite.h | ||
---|---|---|
177 | 177 |
|
178 | 178 |
#if HAVE_ATTRIBUTE_PACKED |
179 | 179 |
|
180 |
struct unaligned_64 { uint64_t l; } __attribute__((packed));
|
|
181 |
struct unaligned_32 { uint32_t l; } __attribute__((packed));
|
|
182 |
struct unaligned_16 { uint16_t l; } __attribute__((packed));
|
|
180 |
union unaligned_64 { uint64_t l; } __attribute__((packed)) av_alias;
|
|
181 |
union unaligned_32 { uint32_t l; } __attribute__((packed)) av_alias;
|
|
182 |
union unaligned_16 { uint16_t l; } __attribute__((packed)) av_alias;
|
|
183 | 183 |
|
184 |
# define AV_RN(s, p) (((const struct unaligned_##s *) (p))->l)
|
|
185 |
# define AV_WN(s, p, v) ((((struct unaligned_##s *) (p))->l) = (v))
|
|
184 |
# define AV_RN(s, p) (((const union unaligned_##s *) (p))->l)
|
|
185 |
# define AV_WN(s, p, v) ((((union unaligned_##s *) (p))->l) = (v))
|
|
186 | 186 |
|
187 | 187 |
#elif defined(__DECC) |
188 | 188 |
|
... | ... | |
191 | 191 |
|
192 | 192 |
#elif HAVE_FAST_UNALIGNED |
193 | 193 |
|
194 |
# define AV_RN(s, p) (*((const uint##s##_t*)(p)))
|
|
195 |
# define AV_WN(s, p, v) (*((uint##s##_t*)(p)) = (v))
|
|
194 |
# define AV_RN(s, p) (((const av_alias##s*)(p))->u##s)
|
|
195 |
# define AV_WN(s, p, v) (((uint##s##_t*)(p))->u##s = (v))
|
|
196 | 196 |
|
197 | 197 |
#else |
198 | 198 |
|
Also available in: Unified diff