system.h
上传用户:bjsgzm
上传日期:2007-01-08
资源大小:256k
文件大小:9k
源码类别:

mpeg/mp3

开发平台:

Visual C++

  1. /*
  2. (c) Copyright 1998, 1999 - Tord Jansson
  3. =======================================
  4. This file is part of the BladeEnc MP3 Encoder, based on
  5. ISO's reference code for MPEG Layer 3 compression.
  6. This file doesn't contain any of the ISO reference code and
  7. is copyright Tord Jansson (tord.jansson@swipnet.se).
  8. BladeEnc is free software; you can redistribute this file
  9. and/or modify it under the terms of the GNU Lesser General Public
  10. License as published by the Free Software Foundation; either
  11. version 2.1 of the License, or (at your option) any later version.
  12. */
  13. /*==== High level defines =====================================================*/
  14. #define WIN32_INTEL             0
  15. #define WIN32_ALPHA             1
  16. #define LINUX_I386              2
  17. #define LINUX_PPC               3
  18. #define LINUX_SPARC     4
  19. #define LINUX_ALPHA 5
  20. #define SOLARIS                 6
  21. #define IBM_OS2                 7
  22. #define IRIX 8
  23. #define ATARI_TOS 9
  24. #define UNIXWARE7 10
  25. #define SCO5 11
  26. #define ULTRIX 12
  27. #define NETBSD 13
  28. #define OPENBSD 14
  29. #define HPUX 15
  30. #define MSDOS_DJGPP 16
  31. #define MAC_OS 17 /* To compile the Mac version you also need Petteri Kamppuri's wrapper */
  32. #define BEOS_PPC 18
  33. #ifndef SYSTEM
  34. # define SYSTEM LINUX_I386 /* Set current system here, select */
  35. #endif /* from list above. */
  36. /*#define PRECISE_TIMER*/ /* Gives more accurate speed calculations, */
  37. /* just for debug purposes. Disable in release version! */
  38.  
  39. /*==== Low level defines ======================================================*/
  40.  
  41. /*
  42.   LIST OF DEFINES
  43.   ===============
  44.   BYTEORDER [byteorder]     Should either be set to BIG_ENDIAN or LITTLE_ENDIAN depending on the processor.
  45.   INLINE    [prefix]        Defines the prefix for inline functions, normally _inline.
  46.                              Skip this define if your compiler doesn't support inline functions.
  47.   DRAG_DROP                 Set if Drag-n-Drop operations are supported. If defined, the hint for drag and drop
  48.                              is displayed in the help text.
  49.   PRIO                      Set if priority can be set with the -PRIO switch (UNIX_SYSTEM enables this automatically).
  50.   MSWIN                     Set this for windows systems. Includes "windows.h" etc.
  51.   WILDCARDS                 Set this if the program has to expand wildcards itself on your system.
  52.   NO_ZERO_CALLOC            Set this to work around a bug when allocation 0 bytes memory with some compilers.
  53.   DIRECTORY_SEPARATOR Should either be '\' or '/'.
  54.   WAIT_KEY Set this on systems where we as default want to wait for a keypress before quiting.
  55.   UNIX_SYSTEM Set this for UNIX-systems that are posix and (at least to some extent) bsd compliant
  56.  to enable stuff like config-file support, priority settings etc.
  57.   PAUSE_25_LINES Wait for keypress after 25 lines of output when listing important information.
  58. */
  59. /*  Most systems allready have these two defines, but some doesn't 
  60.     so we have to put them here, before they are used. */
  61. #ifndef BIG_ENDIAN
  62. # define BIG_ENDIAN 4321
  63. #endif
  64. #ifndef LITTLE_ENDIAN
  65. # define LITTLE_ENDIAN 1234
  66. #endif
  67.  
  68. /*_____ Windows 95/98/NT Intel defines ________________________________________*/
  69. #if     SYSTEM == WIN32_INTEL
  70. # define BYTEORDER LITTLE_ENDIAN
  71. # define INLINE _inline
  72. # define DRAG_DROP
  73. # define PRIO
  74. # define MSWIN
  75. # define WILDCARDS
  76. # define DIRECTORY_SEPARATOR '\'
  77. # define WAIT_KEY
  78. # define PAUSE_25_LINES
  79. #endif
  80. /*_____ Windows NT DEC Alpha defines __________________________________________*/
  81. #if SYSTEM == WIN32_ALPHA
  82. # define BYTEORDER LITTLE_ENDIAN
  83. # define INLINE _inline
  84. # define DRAG_DROP
  85. # define PRIO
  86. # define MSWIN
  87. # define WILDCARDS
  88. # define DIRECTORY_SEPARATOR '\'
  89. # define WAIT_KEY
  90. # define PAUSE_25_LINES
  91. #endif
  92. /*____ Linux i386 defines ___________________________________________________*/
  93. #if SYSTEM == LINUX_I386
  94. # define BYTEORDER LITTLE_ENDIAN
  95. # define INLINE inline
  96. # define DIRECTORY_SEPARATOR '/'
  97. # define UNIX_SYSTEM
  98. #endif
  99. /*____ Linux Sparc defines __________________________________________________*/
  100. #if SYSTEM == LINUX_SPARC
  101. # define BYTEORDER BIG_ENDIAN
  102. # define INLINE inline
  103. # define DIRECTORY_SEPARATOR '/'
  104. # define UNIX_SYSTEM
  105. #endif
  106. /*____ LinuxPPC defines _____________________________________________________*/
  107. #if SYSTEM == LINUX_PPC
  108. # define BYTEORDER               BIG_ENDIAN
  109. # define INLINE inline
  110. # define DIRECTORY_SEPARATOR     '/'
  111. # define UNIX_SYSTEM
  112. #endif
  113. /*____ Linux Alpha defines __________________________________________________*/
  114. #if SYSTEM == LINUX_ALPHA
  115. # define BYTEORDER LITTLE_ENDIAN
  116. # define DIRECTORY_SEPARATOR '/'
  117. # define UNIX_SYSTEM
  118. #endif
  119. /*____ Solaris defines ______________________________________________________*/
  120. #if SYSTEM == SOLARIS
  121. # define BYTEORDER BIG_ENDIAN
  122. # define DIRECTORY_SEPARATOR '/'
  123. # define UNIX_SYSTEM
  124. #endif
  125. /*____ OS/2 _________________________________________________________________*/
  126. #if SYSTEM == IBM_OS2
  127. # define BYTEORDER LITTLE_ENDIAN
  128. # define INLINE inline
  129. # define PRIO
  130. # define WILDCARDS
  131. # define DIRECTORY_SEPARATOR '\'
  132. # define OS2
  133. # define WAIT_KEY
  134. # define PAUSE_25_LINES
  135. #endif
  136. /*____ IRIX defines _________________________________________________________*/
  137. #if SYSTEM == IRIX
  138. # define BYTEORDER BIG_ENDIAN
  139. # define DIRECTORY_SEPARATOR '/'
  140. # define UNIX_SYSTEM
  141. #endif
  142. /*____ Atari TOS ____________________________________________________________*/
  143. #if SYSTEM == ATARI_TOS
  144. # define BYTEORDER BIG_ENDIAN
  145. # define INLINE inline
  146. # define DIRECTORY_SEPARATOR '\'
  147. # define TOS
  148. # define PAUSE_25_LINES
  149.  #endif
  150. /*____ UNIXWARE7 ____________________________________________________________*/
  151. #if SYSTEM == UNIXWARE7
  152. # define BYTEORDER LITTLE_ENDIAN
  153. # define DIRECTORY_SEPARATOR '/'
  154. # define UNIX_SYSTEM
  155. #endif
  156. /*____ SCO OpenServer 5.x ___________________________________________________*/
  157. #if SYSTEM == SCO5
  158. # define BYTEORDER LITTLE_ENDIAN
  159. # define DIRECTORY_SEPARATOR '/'
  160. # define UNIX_SYSTEM
  161. #endif
  162. /*____ Ultrix defines ________________________________________________________*/
  163. #if SYSTEM == ULTRIX
  164. # define BYTEORDER LITTLE_ENDIAN
  165. # define DIRECTORY_SEPARATOR '/'
  166. # define HAVE_USHORT
  167. # define HAVE_UINT
  168. # include <sys/types.h>                  /* for uint and ushort */
  169. # define UNIX_SYSTEM
  170. #endif
  171. /*____ NetBSD defines ________________________________________________________*/
  172. #if SYSTEM == NETBSD
  173. # include <machine/endian.h>
  174. # define BYTEORDER BYTE_ORDER
  175. # define DIRECTORY_SEPARATOR '/'
  176. # define HAVE_USHORT
  177. # define HAVE_UINT
  178. # define UNIX_SYSTEM
  179. #endif
  180. /*____ OpenBSD defines ________________________________________________________*/
  181. #if SYSTEM == OPENBSD
  182. # include <machine/endian.h>
  183. # define BYTEORDER BYTE_ORDER
  184. # define DIRECTORY_SEPARATOR '/'
  185. # define HAVE_USHORT
  186. # define HAVE_UINT
  187. # define UNIX_SYSTEM
  188. #endif
  189. /*____ HP/UX defines ________________________________________________________*/
  190. #if SYSTEM == HPUX
  191. # define     BYTEORDER BIG_ENDIAN
  192. # define DIRECTORY_SEPARATOR     '/'
  193. # define     INLINE
  194. # define UNIX_SYSTEM
  195. #endif
  196. /*____ MSDOS_DJGPP _________________________________________________________*/
  197. #if SYSTEM == MSDOS_DJGPP
  198. # define          BYTEORDER LITTLE_ENDIAN
  199. # define          INLINE inline
  200. # define DIRECTORY_SEPARATOR '\'
  201. #endif
  202. /*____ MAC_OS ________________________________________________________________*/
  203. #if SYSTEM == MAC_OS
  204. # define BYTEORDER BIG_ENDIAN
  205. # define INLINE inline
  206. # define DIRECTORY_SEPARATOR ':'
  207. # define NO_ZERO_CALLOC
  208. #endif
  209. /*____ BeOS PowerPC ___________________________________________________*/
  210. #if SYSTEM == BEOS_PPC
  211. # define  BYTEORDER BIG_ENDIAN
  212. # define  DIRECTORY_SEPARATOR '/'
  213. # define  INLINE inline
  214. #endif
  215. /*____ Some defines automatically gives other...*/
  216. #ifdef UNIX_SYSTEM
  217. # ifndef PRIO
  218. # define PRIO
  219. # endif
  220. #endif
  221. /*____ To make sure that certain necessary defines are set... */
  222. #ifndef INLINE
  223. # define INLINE
  224. #endif
  225. /*==== Other Global Definitions, placed here for convenience ==================*/
  226. #ifndef FALSE
  227. # define         FALSE           0
  228. #endif
  229. #ifndef TRUE
  230. # define         TRUE            1
  231. #endif
  232. typedef unsigned char  uchar;
  233. #if !defined(SYS_TYPES_H) && !defined(_SYS_TYPES_H)
  234. # ifndef HAVE_USHORT
  235. typedef unsigned short ushort;
  236. # endif
  237. # ifndef HAVE_UINT
  238. typedef unsigned int uint;
  239. # endif
  240. #endif