1 #ifndef COMPILERSPECIFIC_H
2 #define COMPILERSPECIFIC_H
4 ** $VER: CompilerSpecific.h 2.2 (1.10.97)
6 ** Copyright (C) 1997 Bernardo Innocenti. All rights reserved.
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:
15 ** Shared library entry point, with register args
18 ** Hook or boopsi dispatcher entry point with arguments
19 ** passed in registers
22 ** Please put function body inline to the calling code
25 ** Function uses standard C conventions for arguments
28 ** Function takes arguments in the specified 68K registers
31 ** Function takes arguments in registers choosen by the compiler
34 ** Function does not modify any global variable
36 ** FORMATCALL(archetype,string_index,first_to_check)
37 ** Function uses printf or scanf-like formatting
40 ** Function needs to reload context for small data model
43 ** Function will be called from within an interrupt
46 ** Function does never return
49 ** Variable must be aligned to longword boundaries
52 ** Variable must be stored in CHIP RAM
55 ** Put argument <arg> in 68K register <reg>
58 ** Return the minimum between <a> and <b>
61 ** Return the maximum between <a> and <b>
64 ** Return the absolute value of <a>
67 ** A string containing the name of the compiler
71 /* SAS/C 6.58 or better */
73 #define INLINE static __inline
74 #define STDARGS __stdargs
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
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
92 /* GeekGadgets GCC 2.7.2.1 or better */
94 #define INLINE static __inline
95 #define STDARGS __stdargs
96 #define ASMCALL /* nothing */
97 #define REGCALL /* nothing */
98 #define CONSTCALL __attribute__((const))
99 #define FORMATCALL(a,s,f) __attribute__((format(a,s,f)))
100 #define SAVEDS __attribute__((saveds))
101 #define INTERRUPT __attribute__((interrupt))
102 #define NORETURN __attribute__((noreturn))
103 #define ALIGNED __attribute__((aligned(4)))
104 #define REG(reg,arg) arg __asm(#reg)
105 #define _COMPILED_WITH "GCC"
107 #define min(a,b) (((a)<(b))?(a):(b))
108 #define max(a,b) (((a)>(b))?(a):(b))
109 #define abs(a) (((a)>0)?(a):-(a))
111 /* GCC produces code which calls these two functions
112 * to initialize and copy structures and arrays.
114 void INLINE STDARGS
bzero (char *buf
, int len
)
115 { while (len
--) *buf
++ = 0; }
117 void INLINE STDARGS
bcopy (char *src
, char *dest
, int len
)
118 { while (len
--) *dest
++ = *src
++; }
122 /* StormC 2.00.23 or better */
123 #define INLINE __inline
124 #define STDARGS /* nothing */
125 #define ASMCALL /* nothing */
126 #define REGCALL register
127 #define CONSTCALL /* unsupported */
128 #define FORMATCALL /* unsupported */
129 #define SAVEDS __saveds
130 #define INTERRUPT __interrupt
131 #define NORETURN /* unsupported */
132 #define ALIGNED /* unsupported */
134 #define REG(reg,arg) register __##reg arg
135 #define _COMPILED_WITH "StormC"
137 #define min(a,b) (((a)<(b))?(a):(b))
138 #define max(a,b) (((a)>(b))?(a):(b))
139 #define abs(a) (((a)>0)?(a):-(a))
141 #define _INLINE_INCLUDES
147 #define INLINE static inline
148 #define STDARGS /* ? */
149 #define ASMCALL /* ? */
150 #define REGCALL /* ? */
151 #define CONSTCALL /* unsupported */
152 #define FORMATCALL /* unsupported */
153 #define SAVEDS __saveds
154 #define INTERRUPT __interrupt
155 #define NORETURN /* unsupported */
156 #define ALIGNED __aligned
157 #define REG(reg,arg) register __##reg arg
158 #define _COMPILED_WITH "Maxon C"
160 /* For min(), max() and abs() */
161 #define USE_BUILTIN_MATH
164 #error Maxon C compiler support is untested. Please check all the above definitions
169 #define INLINE static __inline
170 #define STDARGS __stdargs
171 #define ASMCALL /* nothing */
172 #define REGCALL /* ? */
173 #define CONSTCALL /* unsupported */
174 #define FORMATCALL /* unsupported */
175 #define SAVEDS __geta4
176 #define INTERRUPT /* unsupported */
177 #define NORETURN /* unsupported */
178 #define ALIGNED __aligned
179 #define REG(reg,arg) __##reg arg
180 #define _COMPILED_WITH "DICE"
182 #define min(a,b) (((a)<(b))?(a):(b))
183 #define max(a,b) (((a)>(b))?(a):(b))
184 #define abs(a) (((a)>0)?(a):-(a))
186 #error DICE compiler support is untested. Please check all the above definitions
191 #define INLINE static
192 #define STDARGS /* ? */
193 #define ASMCALL /* ? */
194 #define REGCALL /* ? */
195 #define CONSTCALL /* unsupported */
196 #define FORMATCALL /* unsupported */
197 #define SAVEDS __geta4
198 #define INTERRUPT /* unsupported */
199 #define NORETURN /* unsupported */
200 #define ALIGNED __aligned
201 #define REG(reg,arg) __##reg arg
202 #define _COMPILED_WITH "Manx C"
204 #define min(a,b) (((a)<(b))?(a):(b))
205 #define max(a,b) (((a)>(b))?(a):(b))
206 #define abs(a) (((a)>0)?(a):-(a))
208 #error Aztec/Manx C compiler support is untested. Please check all the above definitions
210 #error Please add compiler specific definitions for your compiler
219 /* Special function attributes */
221 #define LIBCALL ASMCALL SAVEDS
222 #define HOOKCALL ASMCALL SAVEDS
225 /* AROS Compatibility: IPTR is a type which can store a pointer
226 * as well as a long integer.
234 #endif /* !COMPILERSPECIFIC_H */