1 #include <exec/types.h>
4 #include <aros/debug.h>
5 #include <aros/libcall.h>
10 #ifndef COMPILERSPECIFIC_H
11 #define COMPILERSPECIFIC_H
13 ** $VER: CompilerSpecific.h 2.3 lcs (9.1.99)
15 ** Copyright (C) 1997 Bernardo Innocenti. All rights reserved.
16 ** Copyright (C) 2009-2013 The AROS Development Team
18 ** Compiler specific definitions is here. You can add support
19 ** for other compilers in this header. Please return any changes
20 ** you make to me, so I can add them to my personal copy of this file.
22 ** Here is a short description of the macros defined below:
25 ** Shared library entry point, with register args
28 ** Hook or boopsi dispatcher entry point with arguments
29 ** passed in registers
32 ** Please put function body inline to the calling code
35 ** Function uses standard C conventions for arguments
38 ** Function takes arguments in the specified 68K registers
41 ** Function takes arguments in registers choosen by the compiler
44 ** Function does not modify any global variable
46 ** FORMATCALL(archetype,string_index,first_to_check)
47 ** Function uses printf or scanf-like formatting
50 ** Function needs to reload context for small data model
53 ** Function will be called from within an interrupt
56 ** Function does never return
59 ** Variable must be aligned to longword boundaries
62 ** Variable must be stored in CHIP RAM
65 ** Put argument <arg> in 68K register <reg>
68 ** Return the minimum between <a> and <b>
71 ** Return the maximum between <a> and <b>
74 ** Return the absolute value of <a>
77 ** A string containing the name of the compiler
81 /* SAS/C 6.58 or better */
83 #define INLINE static __inline
84 #define STDARGS __stdargs
86 #define REGCALL __regcall
87 #define CONSTCALL /* unsupported */
88 #define FORMATCALL /* unsupported */
89 #define SAVEDS __saveds
90 #define INTERRUPT __interrupt
91 #define NORETURN /* unsupported */
92 #define ALIGNED __aligned
94 #define REG(reg,arg) register __##reg arg
95 #define _COMPILED_WITH "SAS/C"
97 /* For min(), max() and abs() */
98 #define USE_BUILTIN_MATH
102 /* GeekGadgets GCC 2.7.2.1 or better */
104 #define INLINE static inline
105 #define STDARGS __attribute__((stkparm))
106 #define ASMCALL /* nothing */
107 #define REGCALL /* nothing */
108 #define CONSTCALL __attribute__((const))
109 #define FORMATCALL(a,s,f) __attribute__((format(a,s,f)))
110 #define SAVEDS __attribute__((saveds))
111 #define INTERRUPT __attribute__((interrupt))
112 #define NORETURN __attribute__((noreturn))
113 #define ALIGNED __attribute__((aligned(4)))
114 #define CHIP __attribute__((chip))
116 #define REG(reg,arg) arg __asm(#reg)
118 #define REG(reg,arg) arg
120 #define _COMPILED_WITH "GCC"
123 #define min(a,b) (((a)<(b))?(a):(b))
126 #define max(a,b) (((a)>(b))?(a):(b))
130 #define abs(a) (((a)>0)?(a):-(a))
135 /* GCC produces code which calls these two functions
136 * to initialize and copy structures and arrays.
138 static inline void __attribute__((stkparm
)) bzero (char *buf
, int len
)
139 { while (len
--) *buf
++ = 0; }
141 static inline void __attribute__((stkparm
)) bcopy (char *src
, char *dest
, int len
)
142 { while (len
--) *dest
++ = *src
++; }
147 /* StormC 2.00.23 or better */
148 #define INLINE __inline
149 #define STDARGS /* nothing */
150 #define ASMCALL /* nothing */
151 #define REGCALL register
152 #define CONSTCALL /* unsupported */
153 #define FORMATCALL /* unsupported */
154 #define SAVEDS __saveds
155 #define INTERRUPT __interrupt
156 #define NORETURN /* unsupported */
157 #define ALIGNED /* unsupported */
159 #define REG(reg,arg) register __##reg arg
160 #define _COMPILED_WITH "StormC"
162 #define min(a,b) (((a)<(b))?(a):(b))
163 #define max(a,b) (((a)>(b))?(a):(b))
164 #define abs(a) (((a)>0)?(a):-(a))
166 #define _INLINE_INCLUDES
172 #define INLINE static inline
173 #define STDARGS /* ? */
174 #define ASMCALL /* ? */
175 #define REGCALL /* ? */
176 #define CONSTCALL /* unsupported */
177 #define FORMATCALL /* unsupported */
178 #define SAVEDS __saveds
179 #define INTERRUPT __interrupt
180 #define NORETURN /* unsupported */
181 #define ALIGNED __aligned
182 #define REG(reg,arg) register __##reg arg
183 #define _COMPILED_WITH "Maxon C"
185 /* For min(), max() and abs() */
186 #define USE_BUILTIN_MATH
189 #error Maxon C compiler support is untested. Please check all the above definitions
194 #define INLINE static __inline
195 #define STDARGS __stdargs
196 #define ASMCALL /* nothing */
197 #define REGCALL /* ? */
198 #define CONSTCALL /* unsupported */
199 #define FORMATCALL /* unsupported */
200 #define SAVEDS __geta4
201 #define INTERRUPT /* unsupported */
202 #define NORETURN /* unsupported */
203 #define ALIGNED __aligned
204 #define REG(reg,arg) __##reg arg
205 #define _COMPILED_WITH "DICE"
208 #define min(a,b) (((a)<(b))?(a):(b))
211 #define max(a,b) (((a)>(b))?(a):(b))
214 #define abs(a) (((a)>0)?(a):-(a))
217 #error DICE compiler support is untested. Please check all the above definitions
222 #define INLINE static
223 #define STDARGS /* ? */
224 #define ASMCALL /* ? */
225 #define REGCALL /* ? */
226 #define CONSTCALL /* unsupported */
227 #define FORMATCALL /* unsupported */
228 #define SAVEDS __geta4
229 #define INTERRUPT /* unsupported */
230 #define NORETURN /* unsupported */
231 #define ALIGNED __aligned
232 #define REG(reg,arg) __##reg arg
233 #define _COMPILED_WITH "Manx C"
236 #define min(a,b) (((a)<(b))?(a):(b))
239 #define max(a,b) (((a)>(b))?(a):(b))
242 #define abs(a) (((a)>0)?(a):-(a))
245 #error Aztec/Manx C compiler support is untested. Please check all the above definitions
247 #error Please add compiler specific definitions for your compiler
256 /* Special function attributes */
258 #define LIBCALL ASMCALL SAVEDS
259 #define HOOKCALL ASMCALL SAVEDS
262 /* AROS Compatibility: IPTR is a type which can store a pointer
263 * as well as a long integer.
265 #ifndef AROS_INTPTR_TYPE
266 #define AROS_INTPTR_TYPE long
267 typedef unsigned AROS_INTPTR_TYPE IPTR
;
268 typedef signed AROS_INTPTR_TYPE SIPTR
;
269 #endif /* AROS_INTPTR_TYPE */
273 #endif /* !COMPILERSPECIFIC_H */