fix a typo..
[AROS-Contrib.git] / pack / xad_rar / SDI_compiler.h
bloba57e3ea5962b4886d40849c09330fa0e6f88bf52
1 #ifndef SDI_COMPILER_H
2 #define SDI_COMPILER_H
4 /* Includeheader
6 Name: SDI_compiler.h
7 Versionstring: $VER: SDI_compiler.h 1.13 (23.05.2004)
8 Author: SDI
9 Distribution: PD
10 Description: defines to hide compiler stuff
12 1.1 25.06.98 : created from data made by Gunter Nikl
13 1.2 17.11.99 : added VBCC
14 1.3 29.02.00 : fixed VBCC REG define
15 1.4 30.03.00 : fixed SAVEDS for VBCC
16 1.5 29.07.00 : added #undef statements (needed e.g. for AmiTCP together
17 with vbcc)
18 1.6 19.05.01 : added STACKEXT and Dice stuff
19 1.7 16.06.02 : added MorphOS specials and VARARGS68K
20 1.8 21.09.02 : added MorphOS register stuff
21 1.9 26.09.02 : added OFFSET macro. Thanks Frank Wille for suggestion
22 1.10 18.10.02 : reverted to old MorphOS-method for GCC
23 1.11 09.11.02 : added REGARGS define to MorphOS section
24 1.12 21.01.04 : added SDI_MORPHOSNOREG define to change behaviour
25 1.13 23.05.04 : added machine definitions
28 /* Define SDI_MORPHOSNOREG in your makefile to switch register based functions
29 to normal C-Style functions as it is default for PPC. */
32 ** This is PD (Public Domain). This means you can do with it whatever you want
33 ** without any restrictions. I only ask you to tell me improvements, so I may
34 ** fix the main line of this files as well.
36 ** To keep confusion level low: When changing this file, please note it in
37 ** above history list and indicate that the change was not made by myself
38 ** (e.g. add your name or nick name).
40 ** Dirk Stöcker <soft@dstoecker.de>
43 #ifdef ASM
44 #undef ASM
45 #endif
46 #ifdef REG
47 #undef REG
48 #endif
49 #ifdef LREG
50 #undef LREG
51 #endif
52 #ifdef CONST
53 #undef CONST
54 #endif
55 #ifdef SAVEDS
56 #undef SAVEDS
57 #endif
58 #ifdef INLINE
59 #undef INLINE
60 #endif
61 #ifdef REGARGS
62 #undef REGARGS
63 #endif
64 #ifdef STDARGS
65 #undef STDARGS
66 #endif
67 #ifdef OFFSET
68 #undef OFFSET
69 #endif
71 /* first "exceptions" */
73 #if defined(__MAXON__)
74 #define STDARGS
75 #define STACKEXT
76 #define REGARGS
77 #define SAVEDS
78 #define INLINE inline
79 #elif defined(__VBCC__)
80 #define STDARGS
81 #define STACKEXT
82 #define REGARGS
83 #define INLINE
84 #define OFFSET(p,m) __offsetof(struct p,m)
85 #if defined(__MORPHOS__)
86 #define REG(reg,arg) __reg(MOS__##reg) arg
88 /* NOTE: This assumes "quick native mode" when compiling libraries. */
89 #define MOS__a0 "r24"
90 #define MOS__a1 "r25"
91 #define MOS__a2 "r26"
92 #define MOS__a3 "r27"
93 #define MOS__a4 "r28"
94 #define MOS__a5 "r29"
95 #define MOS__a6 "r30"
96 /* #define MOS__a7 "r31" */
97 #define MOS__d0 "r16"
98 #define MOS__d1 "r17"
99 #define MOS__d2 "r18"
100 #define MOS__d3 "r19"
101 #define MOS__d4 "r20"
102 #define MOS__d5 "r21"
103 #define MOS__d6 "r22"
104 #define MOS__d7 "r23"
106 #else
107 #define REG(reg,arg) __reg(#reg) arg
108 #endif
109 #elif defined(__STORM__)
110 #define STDARGS
111 #define STACKEXT
112 #define REGARGS
113 #define INLINE inline
114 #elif defined(__SASC)
115 #define ASM(arg) arg __asm
116 #elif defined(__GNUC__)
118 #if defined(__amigaos4__)
119 #define REG(reg,arg) arg
120 #define ASM(arg) arg
121 #else
122 #define REG(reg,arg) arg __asm(#reg)
123 #define LREG(reg,arg) register REG(reg,arg)
124 #endif
126 /* Don`t use __stackext for the MorphOS version
127 because we anyway don`t have a libnix ppc with stackext
128 Also we define a VARARGS68K define here to specify
129 functions that should work with that special attribute
130 of the MOS gcc compiler for varargs68k handling. */
131 #if defined(__MORPHOS__)
132 #define STDARGS
133 #define STACKEXT
134 #define REGARGS
135 #define VARARGS68K __attribute__((varargs68k))
136 #endif
137 #elif defined(_DCC)
138 #define REG(reg,arg) __##reg arg
139 #define STACKEXT __stkcheck
140 #define STDARGS __stkargs
141 #define INLINE static
142 #endif
144 /* then "common" ones */
145 #if defined(__MORPHOS__) && defined(SDI_MORPHOSNOREG)
146 #ifdef REG
147 #undef REG
148 #endif
149 #define REG(reg,arg) arg
150 #endif
152 #if !defined(ASM)
153 #define ASM(arg) arg
154 #endif
155 #if !defined(REG)
156 #define REG(reg,arg) register __##reg arg
157 #endif
158 #if !defined(LREG)
159 #define LREG(reg,arg) register arg
160 #endif
161 #if !defined(CONST)
162 #define CONST const
163 #endif
164 #if !defined(SAVEDS)
165 #define SAVEDS __saveds
166 #endif
167 #if !defined(INLINE)
168 #define INLINE static __inline
169 #endif
170 #if !defined(REGARGS)
171 #define REGARGS __regargs
172 #endif
173 #if !defined(STDARGS)
174 #define STDARGS __stdargs
175 #endif
176 #if !defined(STACKEXT)
177 #define STACKEXT __stackext
178 #endif
179 #if !defined(VARARGS68K)
180 #define VARARGS68K
181 #endif
182 #if !defined(OFFSET)
183 #define OFFSET(structName, structEntry) \
184 ((char *)(&(((struct structName *)0)->structEntry))-(char *)0)
185 #endif
187 #if defined(__GNUC__) || defined(__VBCC__)
188 #if !defined(__mc68060) && !defined(__M68060)
189 #if !defined(__mc68040) && !defined(__M68040)
190 #if !defined(__mc68030) && !defined(__mc68020) \
191 && !defined(__M68030) && !defined(__M68020)
192 #define _M68000
193 #else
194 #define _M68020
195 #endif
196 #else
197 #define _M68040
198 #endif
199 #else
200 #define _M68060
201 #endif
202 #if defined(__HAVE_68881__) || defined(__M68881) || defined(__M68882)
203 #define _M68881
204 #endif
205 #endif
207 #endif /* SDI_COMPILER_H */