blob: 6f980716f42a178bac4d783eb3be79867a3f8e3f (
plain) (
blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
|
--- ./source/jaudiolib/platform.h.orig Wed Aug 2 00:35:30 2006
+++ ./source/jaudiolib/platform.h Wed Aug 2 00:35:30 2006
@@ -0,0 +1,61 @@
+#ifndef _INCLUDE_PLATFORM_H_
+#define _INCLUDE_PLATFORM_H_
+
+#if (!defined __EXPORT__)
+#define __EXPORT__
+#endif
+
+#if (defined __WATCOMC__)
+#define snprintf _snprintf
+#endif
+
+static __inline unsigned short _swap16(unsigned short D)
+{
+#if PLATFORM_MACOSX
+ register unsigned short returnValue;
+ __asm__ volatile("lhbrx %0,0,%1"
+ : "=r" (returnValue)
+ : "r" (&D)
+ );
+ return returnValue;
+#else
+ return((D<<8)|(D>>8));
+#endif
+}
+
+static __inline unsigned int _swap32(unsigned int D)
+{
+#if PLATFORM_MACOSX
+ register unsigned int returnValue;
+ __asm__ volatile("lwbrx %0,0,%1"
+ : "=r" (returnValue)
+ : "r" (&D)
+ );
+ return returnValue;
+#else
+ return((D<<24)|((D<<8)&0x00FF0000)|((D>>8)&0x0000FF00)|(D>>24));
+#endif
+}
+
+#if PLATFORM_MACOSX
+#define PLATFORM_BIGENDIAN 1
+#define BUILDSWAP_INTEL16(x) _swap16(x)
+#define BUILDSWAP_INTEL32(x) _swap32(x)
+#else
+#if __BYTE_ORDER == __LITTLE_ENDIAN
+#define PLATFORM_LITTLEENDIAN 1
+#define BUILDSWAP_INTEL16(x) (x)
+#define BUILDSWAP_INTEL32(x) (x)
+#else
+#define PLATFORM_BIGENDIAN 1
+#define BUILDSWAP_INTEL16(x) _swap16(x)
+#define BUILDSWAP_INTEL32(x) _swap32(x)
+#endif
+#endif
+
+extern int has_altivec; /* PowerPC-specific. */
+
+#endif /* !defined _INCLUDE_PLATFORM_H_ */
+
+/* end of platform.h ... */
+
|