Rev 1693 | Go to most recent revision | Details | Compare with Previous | Last modification | View Log | RSS feed
Rev | Author | Line No. | Line |
---|---|---|---|
1693 | serge | 1 | #ifndef __SYS_CONFIG_H__ |
2 | #define __SYS_CONFIG_H__ |
||
3 | |||
4 | #include |
||
5 | #include |
||
6 | |||
7 | /* exceptions first */ |
||
8 | #if defined(__H8500__) || defined(__W65__) |
||
9 | #define __SMALL_BITFIELDS |
||
10 | /* ??? This conditional is true for the h8500 and the w65, defining H8300 |
||
11 | in those cases probably isn't the right thing to do. */ |
||
12 | #define H8300 1 |
||
13 | #endif |
||
14 | |||
15 | /* 16 bit integer machines */ |
||
16 | #if defined(__Z8001__) || defined(__Z8002__) || defined(__H8500__) || defined(__W65__) || defined (__mn10200__) || defined (__AVR__) |
||
17 | |||
18 | #undef INT_MAX |
||
19 | #undef UINT_MAX |
||
20 | #define INT_MAX 32767 |
||
21 | #define UINT_MAX 65535 |
||
22 | #endif |
||
23 | |||
24 | #if defined (__H8300__) || defined (__H8300H__) || defined(__H8300S__) || defined (__H8300SX__) |
||
25 | #define __SMALL_BITFIELDS |
||
26 | #define H8300 1 |
||
27 | #undef INT_MAX |
||
28 | #undef UINT_MAX |
||
29 | #define INT_MAX __INT_MAX__ |
||
30 | #define UINT_MAX (__INT_MAX__ * 2U + 1) |
||
31 | #endif |
||
32 | |||
2168 | serge | 33 | #if (defined(__CR16__) || defined(__CR16C__) ||defined(__CR16CP__)) |
34 | #ifndef __INT32__ |
||
35 | #define __SMALL_BITFIELDS |
||
36 | #undef INT_MAX |
||
37 | #undef UINT_MAX |
||
38 | #define INT_MAX 32767 |
||
39 | #define UINT_MAX (__INT_MAX__ * 2U + 1) |
||
40 | #else /* INT32 */ |
||
41 | #undef INT_MAX |
||
42 | #undef UINT_MAX |
||
43 | #define INT_MAX 2147483647 |
||
44 | #define UINT_MAX (__INT_MAX__ * 2U + 1) |
||
45 | #endif /* INT32 */ |
||
46 | |||
47 | #endif /* CR16C */ |
||
48 | |||
1693 | serge | 49 | #if defined (__xc16x__) || defined (__xc16xL__) || defined (__xc16xS__) |
50 | #define __SMALL_BITFIELDS |
||
51 | #endif |
||
52 | |||
53 | #ifdef __W65__ |
||
54 | #define __SMALL_BITFIELDS |
||
55 | #endif |
||
56 | |||
57 | #if defined(__D10V__) |
||
58 | #define __SMALL_BITFIELDS |
||
59 | #undef INT_MAX |
||
60 | #undef UINT_MAX |
||
61 | #define INT_MAX __INT_MAX__ |
||
62 | #define UINT_MAX (__INT_MAX__ * 2U + 1) |
||
63 | #define _POINTER_INT short |
||
64 | #endif |
||
65 | |||
66 | #if defined(__mc68hc11__) || defined(__mc68hc12__) || defined(__mc68hc1x__) |
||
67 | #undef INT_MAX |
||
68 | #undef UINT_MAX |
||
69 | #define INT_MAX __INT_MAX__ |
||
70 | #define UINT_MAX (__INT_MAX__ * 2U + 1) |
||
71 | #define _POINTER_INT short |
||
72 | #endif |
||
73 | |||
74 | #ifdef ___AM29K__ |
||
75 | #define _FLOAT_RET double |
||
76 | #endif |
||
77 | |||
78 | #ifdef __i386__ |
||
79 | #ifndef __unix__ |
||
80 | /* in other words, go32 */ |
||
81 | #define _FLOAT_RET double |
||
82 | #endif |
||
83 | #if defined(__linux__) || defined(__RDOS__) |
||
84 | /* we want the reentrancy structure to be returned by a function */ |
||
85 | #define __DYNAMIC_REENT__ |
||
86 | #define HAVE_GETDATE |
||
87 | #define _HAVE_SYSTYPES |
||
88 | #define _READ_WRITE_RETURN_TYPE _ssize_t |
||
89 | #define __LARGE64_FILES 1 |
||
90 | /* we use some glibc header files so turn on glibc large file feature */ |
||
91 | #define _LARGEFILE64_SOURCE 1 |
||
92 | #endif |
||
93 | #endif |
||
94 | |||
95 | #ifdef __mn10200__ |
||
96 | #define __SMALL_BITFIELDS |
||
97 | #endif |
||
98 | |||
99 | #ifdef __AVR__ |
||
100 | #define __SMALL_BITFIELDS |
||
101 | #define _POINTER_INT short |
||
102 | #endif |
||
103 | |||
104 | #ifdef __v850 |
||
105 | #define __ATTRIBUTE_IMPURE_PTR__ __attribute__((__sda__)) |
||
106 | #endif |
||
107 | |||
108 | /* For the PowerPC eabi, force the _impure_ptr to be in .sdata */ |
||
109 | #if defined(__PPC__) |
||
110 | #if defined(_CALL_SYSV) |
||
111 | #define __ATTRIBUTE_IMPURE_PTR__ __attribute__((__section__(".sdata"))) |
||
112 | #endif |
||
113 | #ifdef __SPE__ |
||
114 | #define _LONG_DOUBLE double |
||
115 | #endif |
||
116 | #endif |
||
117 | |||
118 | /* Configure small REENT structure for Xilinx MicroBlaze platforms */ |
||
119 | #if defined (__MICROBLAZE__) |
||
120 | #ifndef _REENT_SMALL |
||
121 | #define _REENT_SMALL |
||
122 | #endif |
||
123 | /* Xilinx XMK uses Unix98 mutex */ |
||
124 | #ifdef __XMK__ |
||
125 | #define _UNIX98_THREAD_MUTEX_ATTRIBUTES |
||
126 | #endif |
||
127 | #endif |
||
128 | |||
129 | #if defined(__mips__) && !defined(__rtems__) |
||
130 | #define __ATTRIBUTE_IMPURE_PTR__ __attribute__((__section__(".sdata"))) |
||
131 | #endif |
||
132 | |||
133 | #ifdef __xstormy16__ |
||
134 | #define __SMALL_BITFIELDS |
||
135 | #undef INT_MAX |
||
136 | #undef UINT_MAX |
||
137 | #define INT_MAX __INT_MAX__ |
||
138 | #define UINT_MAX (__INT_MAX__ * 2U + 1) |
||
139 | #define MALLOC_ALIGNMENT 8 |
||
140 | #define _POINTER_INT short |
||
141 | #define __BUFSIZ__ 16 |
||
142 | #define _REENT_SMALL |
||
143 | #endif |
||
144 | #ifdef __m32c__ |
||
145 | #define __SMALL_BITFIELDS |
||
146 | #undef INT_MAX |
||
147 | #undef UINT_MAX |
||
148 | #define INT_MAX __INT_MAX__ |
||
149 | #define UINT_MAX (__INT_MAX__ * 2U + 1) |
||
150 | #define MALLOC_ALIGNMENT 8 |
||
151 | #if defined(__r8c_cpu__) || defined(__m16c_cpu__) |
||
152 | #define _POINTER_INT short |
||
153 | #else |
||
154 | #define _POINTER_INT long |
||
155 | #endif |
||
156 | #define __BUFSIZ__ 16 |
||
157 | #define _REENT_SMALL |
||
158 | #endif /* __m32c__ */ |
||
159 | |||
160 | #ifdef __SPU__ |
||
161 | #define MALLOC_ALIGNMENT 16 |
||
162 | #define __CUSTOM_FILE_IO__ |
||
163 | #endif |
||
164 | |||
165 | /* This block should be kept in sync with GCC's limits.h. The point |
||
166 | of having these definitions here is to not include limits.h, which |
||
167 | would pollute the user namespace, while still using types of the |
||
168 | the correct widths when deciding how to define __int32_t and |
||
169 | __int64_t. */ |
||
170 | #ifndef __INT_MAX__ |
||
171 | # ifdef INT_MAX |
||
172 | # define __INT_MAX__ INT_MAX |
||
173 | # else |
||
174 | # define __INT_MAX__ 2147483647 |
||
175 | # endif |
||
176 | #endif |
||
177 | |||
178 | #ifndef __LONG_MAX__ |
||
179 | # ifdef LONG_MAX |
||
180 | # define __LONG_MAX__ LONG_MAX |
||
181 | # else |
||
182 | # if defined (__alpha__) || (defined (__sparc__) && defined(__arch64__)) \ |
||
183 | || defined (__sparcv9) |
||
184 | # define __LONG_MAX__ 9223372036854775807L |
||
185 | # else |
||
186 | # define __LONG_MAX__ 2147483647L |
||
187 | # endif /* __alpha__ || sparc64 */ |
||
188 | # endif |
||
189 | #endif |
||
190 | /* End of block that should be kept in sync with GCC's limits.h. */ |
||
191 | |||
192 | #ifndef _POINTER_INT |
||
193 | #define _POINTER_INT long |
||
194 | #endif |
||
195 | |||
196 | #ifdef __frv__ |
||
197 | #define __ATTRIBUTE_IMPURE_PTR__ __attribute__((__section__(".sdata"))) |
||
198 | #endif |
||
199 | #undef __RAND_MAX |
||
200 | #if __INT_MAX__ == 32767 |
||
201 | #define __RAND_MAX 32767 |
||
202 | #else |
||
203 | #define __RAND_MAX 0x7fffffff |
||
204 | #endif |
||
205 | |||
206 | #if defined(__CYGWIN__) |
||
207 | #include |
||
208 | #if !defined (__STRICT_ANSI__) || (__STDC_VERSION__ >= 199901L) |
||
209 | #define __USE_XOPEN2K 1 |
||
210 | #endif |
||
211 | #endif |
||
212 | |||
213 | #if defined(__rtems__) |
||
214 | #define __FILENAME_MAX__ 255 |
||
215 | #define _READ_WRITE_RETURN_TYPE _ssize_t |
||
216 | #endif |
||
217 | |||
218 | #ifndef __EXPORT |
||
219 | #define __EXPORT |
||
220 | #endif |
||
221 | |||
222 | #ifndef __IMPORT |
||
223 | #define __IMPORT |
||
224 | #endif |
||
225 | |||
226 | /* Define return type of read/write routines. In POSIX, the return type |
||
227 | for read()/write() is "ssize_t" but legacy newlib code has been using |
||
228 | "int" for some time. If not specified, "int" is defaulted. */ |
||
229 | #ifndef _READ_WRITE_RETURN_TYPE |
||
230 | #define _READ_WRITE_RETURN_TYPE int |
||
231 | #endif |
||
232 | |||
233 | #ifndef __WCHAR_MAX__ |
||
234 | #if __INT_MAX__ == 32767 || defined (_WIN32) |
||
235 | #define __WCHAR_MAX__ 0xffffu |
||
236 | #endif |
||
237 | #endif |
||
238 | |||
239 | /* See if small reent asked for at configuration time and |
||
240 | is not chosen by the platform by default. */ |
||
241 | #ifdef _WANT_REENT_SMALL |
||
242 | #ifndef _REENT_SMALL |
||
243 | #define _REENT_SMALL |
||
244 | #endif |
||
245 | #endif |
||
246 | |||
247 | /* If _MB_EXTENDED_CHARSETS_ALL is set, we want all of the extended |
||
248 | charsets. The extended charsets add a few functions and a couple |
||
249 | of tables of a few K each. */ |
||
250 | #ifdef _MB_EXTENDED_CHARSETS_ALL |
||
251 | #define _MB_EXTENDED_CHARSETS_ISO 1 |
||
252 | #define _MB_EXTENDED_CHARSETS_WINDOWS 1 |
||
253 | #endif |
||
254 | |||
255 | #endif /* __SYS_CONFIG_H__ */ |