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