Brought up to date
[swftools.git] / lib / bladeenc / system.h
blobd112798e5f27244206ee63c1435f49d5bf5e8394
1 /*
2 (c) Copyright 1998-2000 - Tord Jansson
3 ======================================
5 This file is part of the BladeEnc MP3 Encoder, based on
6 ISO's reference code for MPEG Layer 3 compression.
8 This file doesn't contain any of the ISO reference code and
9 is copyright Tord Jansson (tord.jansson@swipnet.se).
11 BladeEnc is free software; you can redistribute this file
12 and/or modify it under the terms of the GNU Lesser General Public
13 License as published by the Free Software Foundation; either
14 version 2.1 of the License, or (at your option) any later version.
16 Use TABSIZE 4!!!
20 ------------ Changes ------------
22 2000-12-11 Andre Piotrowski
24 - added autodetection for Mac OS
26 2001-01-19 Tord Jansson
28 - Added Andrea Vallinotto's Amiga WarpOS changes.
29 - Added some more defines and cleaned up.
33 #ifndef __SYSTEM__
34 #define __SYSTEM__
38 /*==== THE SYSTEMS WE KNOW OF AND CAN AUTODETECT ==========================*/
40 #define UNIX_AUTOCONF 1 /* All well behaving UNIX systems where you run configure/make */
41 /* Includes Linux, *BSD, Solaris, IRIX, UnixWare, SCO Open Server, AIX, HPUX */
43 #define WIN32_INTEL 2 /* Windows 95/98/NT/2k etc on i386 compatible machines */
45 #define BEOS 3 /* BeOS, version 4.5+ on i386 and PPC */
47 #define MSDOS_DJGPP 4 /* MS-DOS protected mode using DJGPP */
49 #define MAC_OS 5 /* To compile the Mac version you also need Petteri Kamppuri's wrapper */
53 /*==== SYSTEMS WE SUPPORT BUT DON'T KNOW HOW TO AUTODETECT YET ==============*/
54 /*==== THESE NEEDS TO BE SET EXPLICITLY BELOW!!! ==============*/
57 #define WIN32_ALPHA 6 /* Windows NT on DEC/Compaq Alpha architectures */
59 #define IBM_OS2 7
61 #define ATARI_TOS 8
63 #define AMIGA_WOS 9 /* Amiga WarpOS */
66 /*= UNCOMMENT LINE AND SET SYSTEM HERE IF YOUR SYSTEM CAN'T BE AUTODETECTED! */
67 /*===========================================================================*/
68 /*#define SYSTEM MAC_OS*/
70 /*==== SYSTEM AUTODETECTION PROCEDURE ========================*/
72 #ifndef SYSTEM
73 # ifdef WIN32
74 # define SYSTEM WIN32_INTEL
75 # endif
77 # ifdef __BEOS__
78 # define SYSTEM BEOS
79 # endif
81 # ifdef __DJGPP__
82 # define SYSTEM MSDOS_DJGPP
83 # endif
85 # if defined(__dest_os) && (__dest_os == __mac_os) /* defined in "ansi_prefix.mac.h" */
86 # define SYSTEM MAC_OS
87 # endif
89 # ifndef SYSTEM
90 # define SYSTEM UNIX_AUTOCONF /* Take UNIX for granted... */
91 # endif
93 #endif
97 /*==== Low level defines ======================================================*/
100 LIST OF DEFINES
101 ===============
103 BYTEORDER [byteorder] Should either be set to BIG_ENDIAN or LITTLE_ENDIAN
104 depending on the processor.
106 DRAG_DROP Set if Drag-n-Drop operations are supported. If
107 defined, the hint for drag and drop is displayed
108 in the help text.
110 PRIO Set if priority can be set with the -PRIO switch
111 (UNIX_SYSTEM enables this automatically).
113 MSWIN Set this for MSWin systems. Includes "windows.h" etc.
115 WILDCARDS Set this if the program has to expand wildcards
116 itself on your system.
118 DIRECTORY_SEPARATOR Should either be '\\' or '/'.
119 (UNIX_SYSTEM automatically gives you '/').
121 WAIT_KEY Set this on systems where we as default want to
122 wait for a keypress before quiting.
124 UNIX_SYSTEM Set this for UNIX-systems that are posix and
125 (at least to some extent) bsd compliant to enable
126 stuff like config-file support, priority settings etc.
128 PAUSE_25_LINES Wait for keypress after 25 lines of output when
129 listing important information.
133 /* Most systems allready have these two defines, but some doesn't
134 so we have to put them here, before they are used. */
136 #ifndef BIG_ENDIAN
137 # define BIG_ENDIAN 4321
138 #endif
140 #ifndef LITTLE_ENDIAN
141 # define LITTLE_ENDIAN 1234
142 #endif
145 /*____ UNIX with Autoconf support _____________________________________________*/
147 #if SYSTEM == UNIX_AUTOCONF
148 # ifdef BYTE_ORDER
149 # define BYTEORDER BYTE_ORDER
150 # else
151 # include "../../config.h"
152 # if WORDS_BIGENDIAN
153 # define BYTEORDER BIG_ENDIAN
154 # else
155 # define BYTEORDER LITTLE_ENDIAN
156 # endif
157 # endif
158 # define UNIX_SYSTEM
159 #endif
161 /*_____ Windows 95/98/NT Intel defines ________________________________________*/
163 #if SYSTEM == WIN32_INTEL
165 # define BYTEORDER LITTLE_ENDIAN
166 # define DRAG_DROP
167 # define PRIO
168 # define MSWIN
169 # define WILDCARDS
170 # define DIRECTORY_SEPARATOR '\\'
171 # define WAIT_KEY
172 # define PAUSE_25_LINES
173 #endif
175 /*_____ Windows NT DEC Alpha defines __________________________________________*/
177 #if SYSTEM == WIN32_ALPHA
179 # define BYTEORDER LITTLE_ENDIAN
180 # define DRAG_DROP
181 # define PRIO
182 # define MSWIN
183 # define WILDCARDS
184 # define DIRECTORY_SEPARATOR '\\'
185 # define WAIT_KEY
186 # define PAUSE_25_LINES
187 #endif
190 /*____ OS/2 _________________________________________________________________*/
192 #if SYSTEM == IBM_OS2
194 # define BYTEORDER LITTLE_ENDIAN
195 # define PRIO
196 # define WILDCARDS
197 # define DIRECTORY_SEPARATOR '\\'
198 # define OS2
199 # define WAIT_KEY
200 # define PAUSE_25_LINES
201 #endif
204 /*____ Atari TOS ____________________________________________________________*/
206 #if SYSTEM == ATARI_TOS
208 # define BYTEORDER BIG_ENDIAN
209 # define DIRECTORY_SEPARATOR '\\'
210 # define TOS
211 # define PAUSE_25_LINES
212 #endif
214 /*____ MSDOS_DJGPP __________________________________________________________*/
216 #if SYSTEM == MSDOS_DJGPP
218 # define BYTEORDER LITTLE_ENDIAN
219 # define DIRECTORY_SEPARATOR '\\'
220 #endif
222 /*____ MAC_OS ________________________________________________________________*/
224 #if SYSTEM == MAC_OS
226 # define BYTEORDER BIG_ENDIAN
227 # define DIRECTORY_SEPARATOR ':'
228 #endif
230 /*____ BeOS PowerPC & x86 ___________________________________________________*/
232 #if SYSTEM == BEOS
234 # ifdef __i386__
235 # define BYTEORDER LITTLE_ENDIAN
236 # else
237 # define BYTEORDER BIG_ENDIAN
238 # endif
239 # define DIRECTORY_SEPARATOR '/'
240 #endif
242 /*____ Amiga PowerPC WarpOS / VBCC or Storm-GCC_______________________________*/
244 #if SYSTEM == AMIGA_WOS
245 # define BYTEORDER BIG_ENDIAN
246 # define DIRECTORY_SEPARATOR '/'
247 # define SECOND_DIRECTORY_SEPARATOR ':' /* Special case for volumes */
248 # define PRIO /* Yes, it can be done */
249 # define WILDCARDS /* Uses dos/ParsePatternNoCase() and friends.*/
250 # define PROTO_ARGS /* Undocumented, it's useful for GCC-Storm */
251 # ifdef __VBCC__
252 # pragma amiga-align
253 # endif
254 # include <dos/dos.h>
255 # ifdef __VBCC__
256 # pragma default-align
257 # endif
259 #endif
263 /*____ Some defines automatically gives other...*/
265 #ifdef UNIX_SYSTEM
266 # define PRIO
267 # define DIRECTORY_SEPARATOR '/'
268 #endif
271 /*==== COMPILER SPECIFIC DEFINES ============================================ */
273 Unfortunately the inline command differs slightly between compilers (for
274 example GCC calls it 'inline' while VC++ calls it '_inline'), so we have
275 to use our own define for it to keep everything compiler independent.
277 Inline just speeds things up, so if we don't recognice the architecture we
278 just define an empty INLINE and take a minor performance hit.
282 #ifdef __GNUC__ /* GNU C and family */
283 # define INLINE inline
284 #endif
286 #ifdef __TURBOC__ /* Borland Turbo C, Turbo C++, and Borland C++ */
287 # define INLINE __inline
288 #endif
290 #ifdef _MSC /* Visual C++ */
291 # define INLINE _inline
292 #endif
294 #ifdef __STORM
295 # define INLINE __inline /* Storm C4 */
296 #endif
298 #ifdef __VBCC__
299 # define INLINE /* VBCC */
300 #endif
302 #ifndef INLINE
303 # define INLINE /* Empty construct default, minor performance hit. */
304 #endif
307 /*____ To make sure that certain necessary defines are set... */
309 #ifndef FALSE
310 # define FALSE 0
311 #endif
313 #ifndef TRUE
314 # define TRUE 1
315 #endif
317 /*==== Other Global Definitions, placed here for convenience ==================*/
319 /*#define PRECISE_TIMER*/ /* Gives more accurate speed calculations, */
320 /* just for debug purposes. Disable in release version! */
322 typedef unsigned char uchar;
324 #if (defined(UNIX_SYSTEM) && !defined(SYS_TYPES_H) && !defined(_SYS_TYPES_H)) || (!defined UNIX_SYSTEM && !defined(__GNUC__))
325 typedef unsigned short ushort;
326 typedef unsigned int uint;
327 #endif
330 #endif /* __SYSTEM__ */