2 * Machine dependent defines/includes for LAME.
4 * Copyright (c) 1999 A.L. Faber
6 * This library is free software; you can redistribute it and/or
7 * modify it under the terms of the GNU Library General Public
8 * License as published by the Free Software Foundation; either
9 * version 2 of the License, or (at your option) any later version.
11 * This library is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 * Library General Public License for more details.
16 * You should have received a copy of the GNU Library General Public
17 * License along with this library; if not, write to the
18 * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
19 * Boston, MA 02111-1307, USA.
22 #ifndef LAME_MACHINE_H
23 #define LAME_MACHINE_H
33 # define strrchr rindex
35 char *strchr (), *strrchr ();
37 # define memcpy(d, s, n) bcopy ((s), (d), (n))
38 # define memmove(d, s, n) bcopy ((s), (d), (n))
42 #if defined(__riscos__) && defined(FPA10)
57 #if defined(macintosh)
61 # include <sys/types.h>
62 # include <sys/stat.h>
66 * 3 different types of pow() functions:
69 * - exp() on some machines this is claimed to be faster than pow()
72 #define POW20(x) pow20[x]
73 //#define POW20(x) pow(2.0,((double)(x)-210)*.25)
74 //#define POW20(x) exp( ((double)(x)-210)*(.25*LOG2) )
76 #define IPOW20(x) ipow20[x]
77 //#define IPOW20(x) exp( -((double)(x)-210)*.1875*LOG2 )
78 //#define IPOW20(x) pow(2.0,-((double)(x)-210)*.1875)
80 #define IIPOW20_(x) iipow20_[x]
82 /* in case this is used without configure */
91 # define inline _inline
92 #elif defined(__SASC) || defined(__GNUC__) || defined(__ICC) || defined(__ECC)
93 /* if __GNUC__ we always want to inline, not only if the user requests it */
95 # define inline __inline
99 # pragma warning( disable : 4244 )
100 //# pragma warning( disable : 4305 )
104 * FLOAT for variables which require at least 32 bits
105 * FLOAT8 for variables which require at least 64 bits
107 * On some machines, 64 bit will be faster than 32 bit. Also, some math
108 * routines require 64 bit float, so setting FLOAT=float will result in a
109 * lot of conversions.
112 #if ( defined(_MSC_VER) || defined(__BORLANDC__) || defined(__MINGW32__) )
113 # define WIN32_LEAN_AND_MEAN
114 # include <windows.h>
119 # define FLOAT_MAX FLT_MAX
121 # define FLOAT_MAX 1e99 /* approx */
126 #ifndef FLOAT8 /* NOTE: RH: 7/00: if FLOAT8=float, it breaks resampling and VBR code */
127 typedef double FLOAT8;
129 # define FLOAT8_MAX DBL_MAX
131 # define FLOAT8_MAX 1e99 /* approx */
135 # define FLOAT8_MAX FLT_MAX
137 # define FLOAT8_MAX 1e99 /* approx */
141 /* Various integer types */
143 #if defined _WIN32 && !defined __CYGWIN__
144 typedef unsigned char u_char;
145 #elif defined __DECALPHA__
147 #elif defined OS_AMIGAOS
149 #elif defined __DJGPP__
150 typedef unsigned char u_char;
151 #elif !defined __GNUC__ || defined __STRICT_ANSI__
152 typedef unsigned char u_char;
157 /* sample_t must be floating point, at least 32 bits */
158 typedef FLOAT sample_t;
159 typedef sample_t stereo_t [2];
163 /* end of machine.h */