1 #include <exec/types.h>
4 #include <aros/debug.h>
9 #ifndef COMPILERSPECIFIC_H
10 #define COMPILERSPECIFIC_H
12 ** $VER: CompilerSpecific.h 2.3 lcs (9.1.99)
14 ** Copyright (C) 1997 Bernardo Innocenti. All rights reserved.
16 ** Compiler specific definitions is here. You can add support
17 ** for other compilers in this header. Please return any changes
18 ** you make to me, so I can add them to my personal copy of this file.
20 ** Here is a short description of the macros defined below:
23 ** Shared library entry point, with register args
26 ** Hook or boopsi dispatcher entry point with arguments
27 ** passed in registers
30 ** Please put function body inline to the calling code
33 ** Function uses standard C conventions for arguments
36 ** Function takes arguments in the specified 68K registers
39 ** Function takes arguments in registers choosen by the compiler
42 ** Function does not modify any global variable
44 ** FORMATCALL(archetype,string_index,first_to_check)
45 ** Function uses printf or scanf-like formatting
48 ** Function needs to reload context for small data model
51 ** Function will be called from within an interrupt
54 ** Function does never return
57 ** Variable must be aligned to longword boundaries
60 ** Variable must be stored in CHIP RAM
63 ** Put argument <arg> in 68K register <reg>
66 ** Return the minimum between <a> and <b>
69 ** Return the maximum between <a> and <b>
72 ** Return the absolute value of <a>
75 ** A string containing the name of the compiler
79 /* SAS/C 6.58 or better */
81 #define INLINE static __inline
82 #define STDARGS __stdargs
84 #define REGCALL __regcall
85 #define CONSTCALL /* unsupported */
86 #define FORMATCALL /* unsupported */
87 #define SAVEDS __saveds
88 #define INTERRUPT __interrupt
89 #define NORETURN /* unsupported */
90 #define ALIGNED __aligned
92 #define REG(reg,arg) register __##reg arg
93 #define _COMPILED_WITH "SAS/C"
95 /* For min(), max() and abs() */
96 #define USE_BUILTIN_MATH
100 /* GeekGadgets GCC 2.7.2.1 or better */
102 #define INLINE static inline
103 #define STDARGS __attribute__((stkparm))
104 #define ASMCALL /* nothing */
105 #define REGCALL /* nothing */
106 #define CONSTCALL __attribute__((const))
107 #define FORMATCALL(a,s,f) __attribute__((format(a,s,f)))
108 #define SAVEDS __attribute__((saveds))
109 #define INTERRUPT __attribute__((interrupt))
110 #define NORETURN __attribute__((noreturn))
111 #define ALIGNED __attribute__((aligned(4)))
112 #define CHIP __attribute__((chip))
114 #define REG(reg,arg) arg __asm(#reg)
116 #define REG(reg,arg) arg
118 #define _COMPILED_WITH "GCC"
121 #define min(a,b) (((a)<(b))?(a):(b))
124 #define max(a,b) (((a)>(b))?(a):(b))
128 #define abs(a) (((a)>0)?(a):-(a))
133 /* GCC produces code which calls these two functions
134 * to initialize and copy structures and arrays.
136 static inline void __attribute__((stkparm
)) bzero (char *buf
, int len
)
137 { while (len
--) *buf
++ = 0; }
139 static inline void __attribute__((stkparm
)) bcopy (char *src
, char *dest
, int len
)
140 { while (len
--) *dest
++ = *src
++; }
145 /* StormC 2.00.23 or better */
146 #define INLINE __inline
147 #define STDARGS /* nothing */
148 #define ASMCALL /* nothing */
149 #define REGCALL register
150 #define CONSTCALL /* unsupported */
151 #define FORMATCALL /* unsupported */
152 #define SAVEDS __saveds
153 #define INTERRUPT __interrupt
154 #define NORETURN /* unsupported */
155 #define ALIGNED /* unsupported */
157 #define REG(reg,arg) register __##reg arg
158 #define _COMPILED_WITH "StormC"
160 #define min(a,b) (((a)<(b))?(a):(b))
161 #define max(a,b) (((a)>(b))?(a):(b))
162 #define abs(a) (((a)>0)?(a):-(a))
164 #define _INLINE_INCLUDES
170 #define INLINE static inline
171 #define STDARGS /* ? */
172 #define ASMCALL /* ? */
173 #define REGCALL /* ? */
174 #define CONSTCALL /* unsupported */
175 #define FORMATCALL /* unsupported */
176 #define SAVEDS __saveds
177 #define INTERRUPT __interrupt
178 #define NORETURN /* unsupported */
179 #define ALIGNED __aligned
180 #define REG(reg,arg) register __##reg arg
181 #define _COMPILED_WITH "Maxon C"
183 /* For min(), max() and abs() */
184 #define USE_BUILTIN_MATH
187 #error Maxon C compiler support is untested. Please check all the above definitions
192 #define INLINE static __inline
193 #define STDARGS __stdargs
194 #define ASMCALL /* nothing */
195 #define REGCALL /* ? */
196 #define CONSTCALL /* unsupported */
197 #define FORMATCALL /* unsupported */
198 #define SAVEDS __geta4
199 #define INTERRUPT /* unsupported */
200 #define NORETURN /* unsupported */
201 #define ALIGNED __aligned
202 #define REG(reg,arg) __##reg arg
203 #define _COMPILED_WITH "DICE"
206 #define min(a,b) (((a)<(b))?(a):(b))
209 #define max(a,b) (((a)>(b))?(a):(b))
212 #define abs(a) (((a)>0)?(a):-(a))
215 #error DICE compiler support is untested. Please check all the above definitions
220 #define INLINE static
221 #define STDARGS /* ? */
222 #define ASMCALL /* ? */
223 #define REGCALL /* ? */
224 #define CONSTCALL /* unsupported */
225 #define FORMATCALL /* unsupported */
226 #define SAVEDS __geta4
227 #define INTERRUPT /* unsupported */
228 #define NORETURN /* unsupported */
229 #define ALIGNED __aligned
230 #define REG(reg,arg) __##reg arg
231 #define _COMPILED_WITH "Manx C"
234 #define min(a,b) (((a)<(b))?(a):(b))
237 #define max(a,b) (((a)>(b))?(a):(b))
240 #define abs(a) (((a)>0)?(a):-(a))
243 #error Aztec/Manx C compiler support is untested. Please check all the above definitions
245 #error Please add compiler specific definitions for your compiler
254 /* Special function attributes */
256 #define LIBCALL ASMCALL SAVEDS
257 #define HOOKCALL ASMCALL SAVEDS
260 /* AROS Compatibility: IPTR is a type which can store a pointer
261 * as well as a long integer.
263 #ifndef AROS_INTPTR_TYPE
264 #define AROS_INTPTR_TYPE long
265 typedef unsigned AROS_INTPTR_TYPE IPTR
;
266 typedef signed AROS_INTPTR_TYPE SIPTR
;
267 #endif /* AROS_INTPTR_TYPE */
271 #endif /* !COMPILERSPECIFIC_H */