summaryrefslogtreecommitdiff
path: root/src/xine-engine/bswap.h
diff options
context:
space:
mode:
authorRobin KAY <komadori@users.sourceforge.net>2002-10-06 03:48:13 +0000
committerRobin KAY <komadori@users.sourceforge.net>2002-10-06 03:48:13 +0000
commit24ed40652239b8e3841803e473b31736b4d04bca (patch)
tree32858182f1bbd66458e4467608cdad8efe6a9b09 /src/xine-engine/bswap.h
parent08d0890139902ec1a227d2bd429585534fa6ff24 (diff)
downloadxine-lib-24ed40652239b8e3841803e473b31736b4d04bca.tar.gz
xine-lib-24ed40652239b8e3841803e473b31736b4d04bca.tar.bz2
Workaround for code generation bug in gcc on SPARC. Mike's endian macros now moved to bswap.h
CVS patchset: 2794 CVS date: 2002/10/06 03:48:13
Diffstat (limited to 'src/xine-engine/bswap.h')
-rw-r--r--src/xine-engine/bswap.h34
1 files changed, 34 insertions, 0 deletions
diff --git a/src/xine-engine/bswap.h b/src/xine-engine/bswap.h
index 1351d0456..276dfcbf7 100644
--- a/src/xine-engine/bswap.h
+++ b/src/xine-engine/bswap.h
@@ -90,4 +90,38 @@ inline static unsigned long long int ByteSwap64(unsigned long long int x)
#define le2me_64(x) (x)
#endif
+#ifdef FPM_SPARC
+
+/*
+ * Workaround for code generation bug in gcc on SPARC
+ */
+
+#define BE_16(x) ((((uint8_t*)(x))[0] << 8) | ((uint8_t*)(x))[1])
+#define BE_32(x) ((((uint8_t*)(x))[0] << 24) | \
+ (((uint8_t*)(x))[1] << 16) | \
+ (((uint8_t*)(x))[2] << 8) | \
+ ((uint8_t*)(x))[3])
+#define LE_16(x) ((((uint8_t*)(x))[1] << 8) | ((uint8_t*)(x))[0])
+#define LE_32(x) ((((uint8_t*)(x))[3] << 24) | \
+ (((uint8_t*)(x))[2] << 16) | \
+ (((uint8_t*)(x))[1] << 8) | \
+ ((uint8_t*)(x))[0])
+
+#else
+
+#define BE_16(x) (be2me_16(*(uint16_t*)(x)))
+#define BE_32(x) (be2me_32(*(uint32_t*)(x)))
+#define LE_16(x) (le2me_16(*(uint16_t*)(x)))
+#define LE_32(x) (le2me_32(*(uint32_t*)(x)))
+
+#endif /* !FPM_SPARC */
+
+#ifdef WORDS_BIGENDIAN
+#define ME_16(x) BE_16(x)
+#define ME_32(x) BE_32(x)
+#else
+#define ME_16(x) LE_16(x)
+#define ME_32(x) LE_32(x)
+#endif
+
#endif