Details | Last modification | View Log | RSS feed
Rev | Author | Line No. | Line |
---|---|---|---|
26 | pmbaty | 1 | /* ACC -- Automatic Compiler Configuration |
2 | |||
3 | Copyright (C) 1996-2004 Markus Franz Xaver Johannes Oberhumer |
||
4 | All Rights Reserved. |
||
5 | |||
6 | This software is a copyrighted work licensed under the terms of |
||
7 | the GNU General Public License. Please consult the file "ACC_LICENSE" |
||
8 | for details. |
||
9 | |||
10 | Markus F.X.J. Oberhumer |
||
11 | <markus@oberhumer.com> |
||
12 | http://www.oberhumer.com/ |
||
13 | */ |
||
14 | |||
15 | |||
16 | /* |
||
17 | * Memory Model - exactly one of: |
||
18 | * |
||
19 | * ACC_MM_FLAT [default] |
||
20 | * ACC_MM_TINY |
||
21 | * ACC_MM_SMALL |
||
22 | * ACC_MM_MEDIUM |
||
23 | * ACC_MM_COMPACT |
||
24 | * ACC_MM_LARGE |
||
25 | * ACC_MM_HUGE |
||
26 | */ |
||
27 | |||
28 | #if (ACC_OS_DOS16 || ACC_OS_OS216 || ACC_OS_WIN16) |
||
29 | |||
30 | #if (UINT_MAX != ACC_0xffffL) |
||
31 | # error "this should not happen" |
||
32 | #endif |
||
33 | #if defined(__TINY__) || defined(M_I86TM) || defined(_M_I86TM) |
||
34 | # define ACC_MM_TINY 1 |
||
35 | #elif defined(__HUGE__) || defined(_HUGE_) || defined(M_I86HM) || defined(_M_I86HM) |
||
36 | # define ACC_MM_HUGE 1 |
||
37 | #elif defined(__SMALL__) || defined(M_I86SM) || defined(_M_I86SM) || defined(SMALL_MODEL) |
||
38 | # define ACC_MM_SMALL 1 |
||
39 | #elif defined(__MEDIUM__) || defined(M_I86MM) || defined(_M_I86MM) |
||
40 | # define ACC_MM_MEDIUM 1 |
||
41 | #elif defined(__COMPACT__) || defined(M_I86CM) || defined(_M_I86CM) |
||
42 | # define ACC_MM_COMPACT 1 |
||
43 | #elif defined(__LARGE__) || defined(M_I86LM) || defined(_M_I86LM) || defined(LARGE_MODEL) |
||
44 | # define ACC_MM_LARGE 1 |
||
45 | #elif (ACC_CC_AZTECC) |
||
46 | # if defined(_LARGE_CODE) && defined(_LARGE_DATA) |
||
47 | # define ACC_MM_LARGE 1 |
||
48 | # elif defined(_LARGE_CODE) |
||
49 | # define ACC_MM_MEDIUM 1 |
||
50 | # elif defined(_LARGE_DATA) |
||
51 | # define ACC_MM_COMPACT 1 |
||
52 | # else |
||
53 | # define ACC_MM_SMALL 1 |
||
54 | # endif |
||
55 | #elif (ACC_CC_ZORTECHC && defined(__VCM__)) |
||
56 | # define ACC_MM_LARGE 1 |
||
57 | #else |
||
58 | # error "unknown memory model" |
||
59 | #endif |
||
60 | |||
61 | |||
62 | /* ACC_HAVE_MM_HUGE_PTR ... working __huge pointers |
||
63 | * ACC_HAVE_MM_HUGE_ARRAY ... char __huge x[256*1024L] works */ |
||
64 | #define ACC_HAVE_MM_HUGE_PTR 1 |
||
65 | #define ACC_HAVE_MM_HUGE_ARRAY 1 |
||
66 | |||
67 | #if (ACC_MM_TINY) |
||
68 | # undef ACC_HAVE_MM_HUGE_ARRAY |
||
69 | #endif |
||
70 | |||
71 | #if (ACC_CC_AZTECC || ACC_CC_PACIFICC || ACC_CC_ZORTECHC) |
||
72 | # undef ACC_HAVE_MM_HUGE_PTR |
||
73 | # undef ACC_HAVE_MM_HUGE_ARRAY |
||
74 | #elif (ACC_CC_DMC || ACC_CC_SYMANTECC) |
||
75 | # undef ACC_HAVE_MM_HUGE_ARRAY |
||
76 | #elif (ACC_CC_MSC && defined(_QC)) |
||
77 | # undef ACC_HAVE_MM_HUGE_ARRAY |
||
78 | # if (_MSC_VER < 600) |
||
79 | # undef ACC_HAVE_MM_HUGE_PTR |
||
80 | # endif |
||
81 | #elif (ACC_CC_TURBOC && (__TURBOC__ < 0x0295)) |
||
82 | # undef ACC_HAVE_MM_HUGE_ARRAY |
||
83 | #elif (ACC_CC_WATCOMC && (__WATCOMC__ >= 1200)) |
||
84 | /* pointer arithmetics with __huge arrays seems broken in OpenWatcom 1.x */ |
||
85 | # undef ACC_HAVE_MM_HUGE_ARRAY |
||
86 | #endif |
||
87 | |||
88 | #ifdef __cplusplus |
||
89 | extern "C" { |
||
90 | #endif |
||
91 | #if (ACC_CC_BORLANDC && (__BORLANDC__ >= 0x0200)) |
||
92 | extern void __near __cdecl _AHSHIFT(void); |
||
93 | # define ACC_MM_AHSHIFT ((unsigned) _AHSHIFT) |
||
94 | #elif (ACC_CC_DMC || ACC_CC_SYMANTECC || ACC_CC_ZORTECHC) |
||
95 | extern void __near __cdecl _AHSHIFT(void); |
||
96 | # define ACC_MM_AHSHIFT ((unsigned) _AHSHIFT) |
||
97 | #elif (ACC_CC_MSC || ACC_CC_TOPSPEEDC) |
||
98 | extern void __near __cdecl _AHSHIFT(void); |
||
99 | # define ACC_MM_AHSHIFT ((unsigned) _AHSHIFT) |
||
100 | #elif (ACC_CC_TURBOC && (__TURBOC__ >= 0x0295)) |
||
101 | extern void __near __cdecl _AHSHIFT(void); |
||
102 | # define ACC_MM_AHSHIFT ((unsigned) _AHSHIFT) |
||
103 | #elif ((ACC_CC_AZTECC || ACC_CC_PACIFICC || ACC_CC_TURBOC) && ACC_OS_DOS16) |
||
104 | # define ACC_MM_AHSHIFT 12 |
||
105 | #elif (ACC_CC_WATCOMC) |
||
106 | extern unsigned char _HShift; |
||
107 | # define ACC_MM_AHSHIFT ((unsigned) _HShift) |
||
108 | #else |
||
109 | # error "FIXME - implement ACC_MM_AHSHIFT" |
||
110 | #endif |
||
111 | #ifdef __cplusplus |
||
112 | } /* extern "C" */ |
||
113 | #endif |
||
114 | |||
115 | |||
116 | #elif (ACC_ARCH_C166) |
||
117 | #if !defined(__MODEL__) |
||
118 | # error "FIXME - C166 __MODEL__" |
||
119 | #elif ((__MODEL__) == 0) |
||
120 | # define ACC_MM_SMALL 1 |
||
121 | #elif ((__MODEL__) == 1) |
||
122 | # define ACC_MM_SMALL 1 |
||
123 | #elif ((__MODEL__) == 2) |
||
124 | # define ACC_MM_LARGE 1 |
||
125 | #elif ((__MODEL__) == 3) |
||
126 | # define ACC_MM_TINY 1 |
||
127 | #elif ((__MODEL__) == 4) |
||
128 | # define ACC_MM_XTINY 1 |
||
129 | #elif ((__MODEL__) == 5) |
||
130 | # define ACC_MM_XSMALL 1 |
||
131 | #else |
||
132 | # error "FIXME - C166 __MODEL__" |
||
133 | #endif |
||
134 | |||
135 | |||
136 | #elif (ACC_ARCH_MCS251) |
||
137 | #if !defined(__MODEL__) |
||
138 | # error "FIXME - MCS251 __MODEL__" |
||
139 | #elif ((__MODEL__) == 0) |
||
140 | # define ACC_MM_SMALL 1 |
||
141 | #elif ((__MODEL__) == 2) |
||
142 | # define ACC_MM_LARGE 1 |
||
143 | #elif ((__MODEL__) == 3) |
||
144 | # define ACC_MM_TINY 1 |
||
145 | #elif ((__MODEL__) == 4) |
||
146 | # define ACC_MM_XTINY 1 |
||
147 | #elif ((__MODEL__) == 5) |
||
148 | # define ACC_MM_XSMALL 1 |
||
149 | #else |
||
150 | # error "FIXME - MCS251 __MODEL__" |
||
151 | #endif |
||
152 | |||
153 | |||
154 | #elif (ACC_ARCH_MCS51) |
||
155 | #if !defined(__MODEL__) |
||
156 | # error "FIXME - MCS51 __MODEL__" |
||
157 | #elif ((__MODEL__) == 1) |
||
158 | # define ACC_MM_SMALL 1 |
||
159 | #elif ((__MODEL__) == 2) |
||
160 | # define ACC_MM_LARGE 1 |
||
161 | #elif ((__MODEL__) == 3) |
||
162 | # define ACC_MM_TINY 1 |
||
163 | #elif ((__MODEL__) == 4) |
||
164 | # define ACC_MM_XTINY 1 |
||
165 | #elif ((__MODEL__) == 5) |
||
166 | # define ACC_MM_XSMALL 1 |
||
167 | #else |
||
168 | # error "FIXME - MCS51 __MODEL__" |
||
169 | #endif |
||
170 | |||
171 | #else |
||
172 | |||
173 | # define ACC_MM_FLAT 1 |
||
174 | |||
175 | #endif |
||
176 | |||
177 | |||
178 | #if (ACC_MM_FLAT) |
||
179 | # define ACC_INFO_MM "flat" |
||
180 | #elif (ACC_MM_TINY) |
||
181 | # define ACC_INFO_MM "tiny" |
||
182 | #elif (ACC_MM_SMALL) |
||
183 | # define ACC_INFO_MM "small" |
||
184 | #elif (ACC_MM_MEDIUM) |
||
185 | # define ACC_INFO_MM "medium" |
||
186 | #elif (ACC_MM_COMPACT) |
||
187 | # define ACC_INFO_MM "compact" |
||
188 | #elif (ACC_MM_LARGE) |
||
189 | # define ACC_INFO_MM "large" |
||
190 | #elif (ACC_MM_HUGE) |
||
191 | # define ACC_INFO_MM "huge" |
||
192 | #else |
||
193 | # error "unknown memory model" |
||
194 | #endif |
||
195 | |||
196 | |||
197 | /* |
||
198 | vi:ts=4:et |
||
199 | */ |