changeset 525:0d4beab5e3c9 libavutil

intreadwrite: support DEC compiler __unaligned type qualifier
author mru
date Fri, 18 Jul 2008 01:18:59 +0000
parents 3cb148a1c8cd
children 27593a5d8acd
files intreadwrite.h
diffstat 1 files changed, 11 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/intreadwrite.h	Thu Jul 17 18:42:19 2008 +0000
+++ b/intreadwrite.h	Fri Jul 18 01:18:59 2008 +0000
@@ -37,7 +37,17 @@
 #define AV_WN32(a, b) (((struct unaligned_32 *) (a))->l) = (b)
 #define AV_WN64(a, b) (((struct unaligned_64 *) (a))->l) = (b)
 
-#else /* __GNUC__ */
+#elif defined(__DECC)
+
+#define AV_RN16(a) (*((const __unaligned uint16_t*)(a)))
+#define AV_RN32(a) (*((const __unaligned uint32_t*)(a)))
+#define AV_RN64(a) (*((const __unaligned uint64_t*)(a)))
+
+#define AV_WN16(a, b) *((__unaligned uint16_t*)(a)) = (b)
+#define AV_WN32(a, b) *((__unaligned uint32_t*)(a)) = (b)
+#define AV_WN64(a, b) *((__unaligned uint64_t*)(a)) = (b)
+
+#else
 
 #define AV_RN16(a) (*((const uint16_t*)(a)))
 #define AV_RN32(a) (*((const uint32_t*)(a)))