revert between 56095 -> 55830 in arch
[AROS.git] / workbench / classes / datatypes / sound / CompilerSpecific.h
blob0ac84ef973e0dcf5878de5d57d34503bc0121aa4
1 #ifndef COMPILERSPECIFIC_H
2 #define COMPILERSPECIFIC_H
3 /*
4 ** $VER: CompilerSpecific.h 2.2 (1.10.97)
5 **
6 ** Copyright (C) 1997 Bernardo Innocenti. All rights reserved.
7 **
8 ** Compiler specific definitions is here. You can add support
9 ** for other compilers in this header. Please return any changes
10 ** you make to me, so I can add them to my personal copy of this file.
12 ** Here is a short description of the macros defined below:
14 ** LIBCALL
15 ** Shared library entry point, with register args
17 ** HOOKCALL
18 ** Hook or boopsi dispatcher entry point with arguments
19 ** passed in registers
21 ** INLINE
22 ** Please put function body inline to the calling code
24 ** STDARGS
25 ** Function uses standard C conventions for arguments
27 ** ASMCALL
28 ** Function takes arguments in the specified 68K registers
30 ** REGCALL
31 ** Function takes arguments in registers choosen by the compiler
33 ** CONSTCALL
34 ** Function does not modify any global variable
36 ** FORMATCALL(archetype,string_index,first_to_check)
37 ** Function uses printf or scanf-like formatting
39 ** SAVEDS
40 ** Function needs to reload context for small data model
42 ** INTERRUPT
43 ** Function will be called from within an interrupt
45 ** NORETURN
46 ** Function does never return
48 ** ALIGNED
49 ** Variable must be aligned to longword boundaries
51 ** CHIP
52 ** Variable must be stored in CHIP RAM
54 ** REG(reg,arg)
55 ** Put argument <arg> in 68K register <reg>
57 ** min(a,b)
58 ** Return the minimum between <a> and <b>
60 ** max(a,b)
61 ** Return the maximum between <a> and <b>
63 ** abs(a)
64 ** Return the absolute value of <a>
66 ** _COMPILED_WITH
67 ** A string containing the name of the compiler
70 #ifdef __SASC
71 /* SAS/C 6.58 or better */
73 #define INLINE static __inline
74 #define STDARGS __stdargs
75 #define ASMCALL __asm
76 #define REGCALL __regcall
77 #define CONSTCALL /* unsupported */
78 #define FORMATCALL /* unsupported */
79 #define SAVEDS __saveds
80 #define INTERRUPT __interrupt
81 #define NORETURN /* unsupported */
82 #define ALIGNED __aligned
83 #define CHIP __chip
84 #define REG(reg,arg) register __##reg arg
85 #define _COMPILED_WITH "SAS/C"
87 /* For min(), max() and abs() */
88 #define USE_BUILTIN_MATH
89 #include <string.h>
90 #else
91 #ifdef __GNUC__
92 /* GeekGadgets GCC 2.7.2.1 or better */
94 #define INLINE static inline
95 #define ASMCALL /* nothing */
96 #define REGCALL /* nothing */
97 #define CONSTCALL __attribute__((const))
98 #define FORMATCALL(a,s,f) __attribute__((format(a,s,f)))
99 #define NORETURN __attribute__((noreturn))
100 #ifdef __AROS__
101 #define STDARGS
102 #define SAVEDS
103 #define INTERRUPT
104 #define ALIGNED
105 #define REG(reg,arg) arg
107 #define __regargs
108 #define __interrupt
110 #else
111 #define STDARGS __attribute__((stkparm))
112 #define SAVEDS __attribute__((saveds))
113 #define INTERRUPT __attribute__((interrupt))
114 #define ALIGNED __attribute__((aligned(4)))
115 #define REG(reg,arg) arg __asm(#reg)
116 #endif
118 #define _COMPILED_WITH "GCC"
120 #define min(a,b) (((a)<(b))?(a):(b))
121 #define max(a,b) (((a)>(b))?(a):(b))
122 #define abs(a) (((a)>0)?(a):-(a))
124 /* GCC produces code which calls these two functions
125 * to initialize and copy structures and arrays.
127 #ifdef __AROS__
128 #include <string.h>
129 #else
130 void INLINE STDARGS bzero (char *buf, int len)
131 { while (len--) *buf++ = 0; }
133 void INLINE STDARGS bcopy (char *src, char *dest, int len)
134 { while (len--) *dest++ = *src++; }
135 #endif
137 #else
138 #ifdef __STORM__
139 /* StormC 2.00.23 or better */
140 #define INLINE __inline
141 #define STDARGS /* nothing */
142 #define ASMCALL /* nothing */
143 #define REGCALL register
144 #define CONSTCALL /* unsupported */
145 #define FORMATCALL /* unsupported */
146 #define SAVEDS __saveds
147 #define INTERRUPT __interrupt
148 #define NORETURN /* unsupported */
149 #define ALIGNED /* unsupported */
150 #define CHIP __chip
151 #define REG(reg,arg) register __##reg arg
152 #define _COMPILED_WITH "StormC"
154 #define min(a,b) (((a)<(b))?(a):(b))
155 #define max(a,b) (((a)>(b))?(a):(b))
156 #define abs(a) (((a)>0)?(a):-(a))
158 #define _INLINE_INCLUDES
159 #include <string.h>
160 #else
161 #ifdef __MAXON__
162 /* Maxon C/C++ */
164 #define INLINE static inline
165 #define STDARGS /* ? */
166 #define ASMCALL /* ? */
167 #define REGCALL /* ? */
168 #define CONSTCALL /* unsupported */
169 #define FORMATCALL /* unsupported */
170 #define SAVEDS __saveds
171 #define INTERRUPT __interrupt
172 #define NORETURN /* unsupported */
173 #define ALIGNED __aligned
174 #define REG(reg,arg) register __##reg arg
175 #define _COMPILED_WITH "Maxon C"
177 /* For min(), max() and abs() */
178 #define USE_BUILTIN_MATH
179 #include <string.h>
181 #error Maxon C compiler support is untested. Please check all the above definitions
182 #else
183 #ifdef _DCC
184 /* DICE C */
186 #define INLINE static __inline
187 #define STDARGS __stdargs
188 #define ASMCALL /* nothing */
189 #define REGCALL /* ? */
190 #define CONSTCALL /* unsupported */
191 #define FORMATCALL /* unsupported */
192 #define SAVEDS __geta4
193 #define INTERRUPT /* unsupported */
194 #define NORETURN /* unsupported */
195 #define ALIGNED __aligned
196 #define REG(reg,arg) __##reg arg
197 #define _COMPILED_WITH "DICE"
199 #define min(a,b) (((a)<(b))?(a):(b))
200 #define max(a,b) (((a)>(b))?(a):(b))
201 #define abs(a) (((a)>0)?(a):-(a))
203 #error DICE compiler support is untested. Please check all the above definitions
204 #else
205 #ifdef AZTEC_C
206 /* Aztec/Manx C */
208 #define INLINE static
209 #define STDARGS /* ? */
210 #define ASMCALL /* ? */
211 #define REGCALL /* ? */
212 #define CONSTCALL /* unsupported */
213 #define FORMATCALL /* unsupported */
214 #define SAVEDS __geta4
215 #define INTERRUPT /* unsupported */
216 #define NORETURN /* unsupported */
217 #define ALIGNED __aligned
218 #define REG(reg,arg) __##reg arg
219 #define _COMPILED_WITH "Manx C"
221 #define min(a,b) (((a)<(b))?(a):(b))
222 #define max(a,b) (((a)>(b))?(a):(b))
223 #define abs(a) (((a)>0)?(a):-(a))
225 #error Aztec/Manx C compiler support is untested. Please check all the above definitions
226 #else
227 #error Please add compiler specific definitions for your compiler
228 #endif
229 #endif
230 #endif
231 #endif
232 #endif
233 #endif
236 /* Special function attributes */
238 #define LIBCALL ASMCALL SAVEDS
239 #define HOOKCALL ASMCALL SAVEDS
242 /* AROS Compatibility: IPTR is a type which can store a pointer
243 * as well as a long integer.
245 #ifndef __AROS__
247 #ifndef IPTR
248 #define IPTR ULONG
249 #endif /* IPTR */
251 #endif
255 #endif /* !COMPILERSPECIFIC_H */