added concrete implementations of putc(), getc(), getchar() and gets()
[tangerine.git] / workbench / classes / gadgets / gradientslider / CompilerSpecific.h
blob5f4411df9927e37c5b5f4e099ec2b33ccf510fcf
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 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++; }
120 #else
121 #ifdef __STORM__
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 */
133 #define CHIP __chip
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
142 #include <string.h>
143 #else
144 #ifdef __MAXON__
145 /* Maxon C/C++ */
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
162 #include <string.h>
164 #error Maxon C compiler support is untested. Please check all the above definitions
165 #else
166 #ifdef _DCC
167 /* DICE C */
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
187 #else
188 #ifdef AZTEC_C
189 /* Aztec/Manx C */
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
209 #else
210 #error Please add compiler specific definitions for your compiler
211 #endif
212 #endif
213 #endif
214 #endif
215 #endif
216 #endif
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.
228 #ifndef IPTR
229 #define IPTR LONG
230 #endif /* IPTR */
234 #endif /* !COMPILERSPECIFIC_H */