00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022 #ifndef LAME_MACHINE_H
00023 #define LAME_MACHINE_H
00024
00025 #include "version.h"
00026
00027 #if (LAME_RELEASE_VERSION == 0)
00028 #undef NDEBUG
00029 #endif
00030
00031 #include <stdio.h>
00032 #include <assert.h>
00033
00034 #ifdef STDC_HEADERS
00035 # include <stdlib.h>
00036 # include <string.h>
00037 #else
00038 # ifndef HAVE_STRCHR
00039 # define strchr index
00040 # define strrchr rindex
00041 # endif
00042 char *strchr(), *strrchr();
00043 # ifndef HAVE_MEMCPY
00044 # define memcpy(d, s, n) bcopy ((s), (d), (n))
00045 # define memmove(d, s, n) bcopy ((s), (d), (n))
00046 # endif
00047 #endif
00048
00049 #if defined(__riscos__) && defined(FPA10)
00050 # include "ymath.h"
00051 #else
00052 # include <math.h>
00053 #endif
00054 #include <limits.h>
00055
00056 #include <ctype.h>
00057
00058 #ifdef HAVE_ERRNO_H
00059 # include <errno.h>
00060 #endif
00061 #ifdef HAVE_FCNTL_H
00062 # include <fcntl.h>
00063 #endif
00064
00065 #if defined(macintosh)
00066 # include <types.h>
00067 # include <stat.h>
00068 #else
00069 # include <sys/types.h>
00070 # include <sys/stat.h>
00071 #endif
00072
00073 #ifdef HAVE_INTTYPES_H
00074 # include <inttypes.h>
00075 #else
00076 # ifdef HAVE_STDINT_H
00077 # include <stdint.h>
00078 # endif
00079 #endif
00080
00081 #ifdef WITH_DMALLOC
00082 #include <dmalloc.h>
00083 #endif
00084
00085
00086
00087
00088
00089
00090
00091
00092 #define POW20(x) (assert(0 <= (x+Q_MAX2) && x < Q_MAX), pow20[x+Q_MAX2])
00093
00094
00095
00096 #define IPOW20(x) (assert(0 <= x && x < Q_MAX), ipow20[x])
00097
00098
00099
00100
00101 #ifndef inline
00102 # define inline
00103 #endif
00104
00105 #if defined(_MSC_VER)
00106 # undef inline
00107 # define inline _inline
00108 #elif defined(__SASC) || defined(__GNUC__) || defined(__ICC) || defined(__ECC)
00109
00110 # undef inline
00111 # define inline __inline
00112 #endif
00113
00114 #if defined(_MSC_VER)
00115 # pragma warning( disable : 4244 )
00116
00117 #endif
00118
00119
00120
00121
00122
00123
00124
00125
00126
00127
00128 #if ( defined(_MSC_VER) || defined(__BORLANDC__) || defined(__MINGW32__) )
00129 # define WIN32_LEAN_AND_MEAN
00130 # include <windows.h>
00131 # include <float.h>
00132 # define FLOAT_MAX FLT_MAX
00133 #else
00134 # ifndef FLOAT
00135 typedef float FLOAT;
00136 # ifdef FLT_MAX
00137 # define FLOAT_MAX FLT_MAX
00138 # else
00139 # define FLOAT_MAX 1e37
00140 # endif
00141 # endif
00142 #endif
00143
00144 #ifndef FLOAT8
00145 typedef double FLOAT8;
00146 # ifdef DBL_MAX
00147 # define FLOAT8_MAX DBL_MAX
00148 # else
00149 # define FLOAT8_MAX 1e99
00150 # endif
00151 #else
00152 # ifdef FLT_MAX
00153 # define FLOAT8_MAX FLT_MAX
00154 # else
00155 # define FLOAT8_MAX 1e37
00156 # endif
00157 #endif
00158
00159
00160 typedef FLOAT sample_t;
00161 typedef sample_t stereo_t[2];
00162
00163
00164
00165 #endif
00166
00167