summaryrefslogtreecommitdiff
path: root/audio/mpg123/patches/patch-aj
blob: 58a38bbefbb12549ac94c0bb3b181316b683fea9 (plain)
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
$NetBSD: patch-aj,v 1.1 1999/10/12 04:43:15 simonb Exp $

--- mpg123.h.orig	Sat May 29 00:51:58 1999
+++ mpg123.h	Tue Oct 12 01:17:16 1999
@@ -56,8 +56,37 @@
 #  define real float
 #elif defined(REAL_IS_LONG_DOUBLE)
 #  define real long double
+#elif defined(REAL_IS_FIXED)
+# define real long
+
+# define REAL_RADIX		15
+# define REAL_FACTOR		(32.0 * 1024.0)
+
+# define REAL_PLUS_32767	( 32767 << REAL_RADIX )
+# define REAL_MINUS_32768	( -32768 << REAL_RADIX )
+
+# define DOUBLE_TO_REAL(x)	((int)((x) * REAL_FACTOR))
+# define REAL_TO_SHORT(x)	((x) >> REAL_RADIX)
+# define REAL_MUL(x, y)		(((long long)(x) * (long long)(y)) >> REAL_RADIX)
+
 #else
 #  define real double
+#endif
+
+#ifndef DOUBLE_TO_REAL
+# define DOUBLE_TO_REAL(x)	(x)
+#endif
+#ifndef REAL_TO_SHORT
+# define REAL_TO_SHORT(x)	(x)
+#endif
+#ifndef REAL_PLUS_32767
+# define REAL_PLUS_32767	32767.0
+#endif
+#ifndef REAL_MINUS_32768
+# define REAL_MINUS_32768	-32768.0
+#endif
+#ifndef REAL_MUL
+# define REAL_MUL(x, y)		((x) * (y))
 #endif
 
 #ifdef __GNUC__