1 #ifndef __SYS_CONFIG_H__
2 #define __SYS_CONFIG_H__
4 #include <machine/ieeefp.h> /* floating point macros */
5 #include <sys/features.h> /* POSIX defs */
8 #define MALLOC_ALIGNMENT 16
12 #define __DYNAMIC_REENT__
15 /* exceptions first */
16 #if defined(__H8500__) || defined(__W65__)
17 #define __SMALL_BITFIELDS
18 /* ??? This conditional is true for the h8500 and the w65, defining H8300
19 in those cases probably isn't the right thing to do. */
23 /* 16 bit integer machines */
24 #if defined(__Z8001__) || defined(__Z8002__) || defined(__H8500__) || defined(__W65__) || defined (__mn10200__) || defined (__AVR__) || defined (__MSP430__)
29 #define UINT_MAX 65535
32 #if defined (__H8300__) || defined (__H8300H__) || defined(__H8300S__) || defined (__H8300SX__)
33 #define __SMALL_BITFIELDS
37 #define INT_MAX __INT_MAX__
38 #define UINT_MAX (__INT_MAX__ * 2U + 1)
41 #if (defined(__CR16__) || defined(__CR16C__) ||defined(__CR16CP__))
43 #define __SMALL_BITFIELDS
47 #define UINT_MAX (__INT_MAX__ * 2U + 1)
51 #define INT_MAX 2147483647
52 #define UINT_MAX (__INT_MAX__ * 2U + 1)
57 #if defined (__xc16x__) || defined (__xc16xL__) || defined (__xc16xS__)
58 #define __SMALL_BITFIELDS
62 #define __SMALL_BITFIELDS
66 #define __SMALL_BITFIELDS
69 #define INT_MAX __INT_MAX__
70 #define UINT_MAX (__INT_MAX__ * 2U + 1)
71 #define _POINTER_INT short
74 #if defined(__mc68hc11__) || defined(__mc68hc12__) || defined(__mc68hc1x__)
77 #define INT_MAX __INT_MAX__
78 #define UINT_MAX (__INT_MAX__ * 2U + 1)
79 #define _POINTER_INT short
82 #if defined(__m68k__) || defined(__mc68000__) || defined(__riscv)
83 #define _READ_WRITE_RETURN_TYPE _ssize_t
87 #define _FLOAT_RET double
92 /* in other words, go32 */
93 #define _FLOAT_RET double
95 #if defined(__linux__) || defined(__RDOS__)
96 /* we want the reentrancy structure to be returned by a function */
97 #define __DYNAMIC_REENT__
99 #define _READ_WRITE_RETURN_TYPE _ssize_t
100 #define __LARGE64_FILES 1
101 /* we use some glibc header files so turn on glibc large file feature */
102 #define _LARGEFILE64_SOURCE 1
107 #define __SMALL_BITFIELDS
111 #define __SMALL_BITFIELDS
112 #define _POINTER_INT short
115 #if defined(__v850) && !defined(__rtems__)
116 #define __ATTRIBUTE_IMPURE_PTR__ __attribute__((__sda__))
119 /* For the PowerPC eabi, force the _impure_ptr to be in .sdata */
121 #if defined(_CALL_SYSV)
122 #define __ATTRIBUTE_IMPURE_PTR__ __attribute__((__section__(".sdata")))
125 #define _LONG_DOUBLE double
129 /* Configure small REENT structure for Xilinx MicroBlaze platforms */
130 #if defined (__MICROBLAZE__) && !defined(__rtems__)
134 /* Xilinx XMK uses Unix98 mutex */
136 #define _UNIX98_THREAD_MUTEX_ATTRIBUTES
140 #if defined(__mips__) && !defined(__rtems__)
141 #define __ATTRIBUTE_IMPURE_PTR__ __attribute__((__section__(".sdata")))
145 #define __SMALL_BITFIELDS
148 #define INT_MAX __INT_MAX__
149 #define UINT_MAX (__INT_MAX__ * 2U + 1)
150 #define MALLOC_ALIGNMENT 8
151 #define _POINTER_INT short
152 #define __BUFSIZ__ 16
156 #if defined __MSP430__
161 #define __BUFSIZ__ 256
162 #define __SMALL_BITFIELDS
164 #ifdef __MSP430X_LARGE__
165 #define _POINTER_INT __int20
167 #define _POINTER_INT int
172 #define __SMALL_BITFIELDS
175 #define INT_MAX __INT_MAX__
176 #define UINT_MAX (__INT_MAX__ * 2U + 1)
177 #define MALLOC_ALIGNMENT 8
178 #if defined(__r8c_cpu__) || defined(__m16c_cpu__)
179 #define _POINTER_INT short
181 #define _POINTER_INT long
183 #define __BUFSIZ__ 16
185 #endif /* __m32c__ */
188 #define MALLOC_ALIGNMENT 16
189 #define __CUSTOM_FILE_IO__
192 #if defined(__or1k__) || defined(__or1knd__)
193 #define __DYNAMIC_REENT__
196 /* This block should be kept in sync with GCC's limits.h. The point
197 of having these definitions here is to not include limits.h, which
198 would pollute the user namespace, while still using types of the
199 the correct widths when deciding how to define __int32_t and
203 # define __INT_MAX__ INT_MAX
205 # define __INT_MAX__ 2147483647
211 # define __LONG_MAX__ LONG_MAX
213 # if defined (__alpha__) || (defined (__sparc__) && defined(__arch64__)) \
214 || defined (__sparcv9)
215 # define __LONG_MAX__ 9223372036854775807L
217 # define __LONG_MAX__ 2147483647L
218 # endif /* __alpha__ || sparc64 */
221 /* End of block that should be kept in sync with GCC's limits.h. */
224 #define _POINTER_INT long
228 #define __ATTRIBUTE_IMPURE_PTR__ __attribute__((__section__(".sdata")))
231 #if __INT_MAX__ == 32767
232 #define __RAND_MAX 32767
234 #define __RAND_MAX 0x7fffffff
237 #if defined(__CYGWIN__)
238 #include <cygwin/config.h>
241 #if defined(__rtems__)
242 #define __FILENAME_MAX__ 255
243 #define _READ_WRITE_RETURN_TYPE _ssize_t
244 #define __DYNAMIC_REENT__
255 /* Define return type of read/write routines. In POSIX, the return type
256 for read()/write() is "ssize_t" but legacy newlib code has been using
257 "int" for some time. If not specified, "int" is defaulted. */
258 #ifndef _READ_WRITE_RETURN_TYPE
259 #define _READ_WRITE_RETURN_TYPE int
261 /* Define `count' parameter of read/write routines. In POSIX, the `count'
262 parameter is "size_t" but legacy newlib code has been using "int" for some
263 time. If not specified, "int" is defaulted. */
264 #ifndef _READ_WRITE_BUFSIZE_TYPE
265 #define _READ_WRITE_BUFSIZE_TYPE int
268 #ifndef __WCHAR_MAX__
269 #if __INT_MAX__ == 32767 || defined (_WIN32)
270 #define __WCHAR_MAX__ 0xffffu
274 /* See if small reent asked for at configuration time and
275 is not chosen by the platform by default. */
276 #ifdef _WANT_REENT_SMALL
282 #ifdef _WANT_USE_LONG_TIME_T
283 #ifndef _USE_LONG_TIME_T
284 #define _USE_LONG_TIME_T
288 #ifdef _WANT_USE_GDTOA
294 #ifdef _WANT_REENT_BACKWARD_BINARY_COMPAT
295 #ifndef _REENT_BACKWARD_BINARY_COMPAT
296 #define _REENT_BACKWARD_BINARY_COMPAT
300 #ifdef _WANT_REENT_THREAD_LOCAL
301 #ifndef _REENT_THREAD_LOCAL
302 #define _REENT_THREAD_LOCAL
306 /* If _MB_EXTENDED_CHARSETS_ALL is set, we want all of the extended
307 charsets. The extended charsets add a few functions and a couple
308 of tables of a few K each. */
309 #ifdef _MB_EXTENDED_CHARSETS_ALL
310 #define _MB_EXTENDED_CHARSETS_ISO 1
311 #define _MB_EXTENDED_CHARSETS_WINDOWS 1
314 #endif /* __SYS_CONFIG_H__ */