aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMåns Rullgård <mans@mansr.com>2008-07-18 01:18:59 +0000
committerMåns Rullgård <mans@mansr.com>2008-07-18 01:18:59 +0000
commitb7b38fb28abbf1c6e308fede822cf3222c9c2ac2 (patch)
tree198553994c86c881f102027f193b1869a087f81c
parentc6002ea14d457de10340d1dc907643294a77d504 (diff)
downloadffmpeg-b7b38fb28abbf1c6e308fede822cf3222c9c2ac2.tar.gz
intreadwrite: support DEC compiler __unaligned type qualifier
Originally committed as revision 14275 to svn://svn.ffmpeg.org/ffmpeg/trunk
-rw-r--r--libavutil/intreadwrite.h12
1 files changed, 11 insertions, 1 deletions
diff --git a/libavutil/intreadwrite.h b/libavutil/intreadwrite.h
index 3269f2803c..72ad5b3af3 100644
--- a/libavutil/intreadwrite.h
+++ b/libavutil/intreadwrite.h
@@ -37,7 +37,17 @@ struct unaligned_16 { uint16_t l; } __attribute__((packed));
#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)))