$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__