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 #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. */
15 /* 16 bit integer machines */
16 #if defined(__Z8001__) || defined(__Z8002__) || defined(__H8500__) || defined(__W65__) || defined (__mn10200__) || defined (__AVR__)
21 #define UINT_MAX 65535
24 #if defined (__H8300__) || defined (__H8300H__) || defined(__H8300S__) || defined (__H8300SX__)
25 #define __SMALL_BITFIELDS
29 #define INT_MAX __INT_MAX__
30 #define UINT_MAX (__INT_MAX__ * 2U + 1)
33 #if (defined(__CR16__) || defined(__CR16C__) ||defined(__CR16CP__))
35 #define __SMALL_BITFIELDS
39 #define UINT_MAX (__INT_MAX__ * 2U + 1)
43 #define INT_MAX 2147483647
44 #define UINT_MAX (__INT_MAX__ * 2U + 1)
49 #if defined (__xc16x__) || defined (__xc16xL__) || defined (__xc16xS__)
50 #define __SMALL_BITFIELDS
54 #define __SMALL_BITFIELDS
58 #define __SMALL_BITFIELDS
61 #define INT_MAX __INT_MAX__
62 #define UINT_MAX (__INT_MAX__ * 2U + 1)
63 #define _POINTER_INT short
66 #if defined(__mc68hc11__) || defined(__mc68hc12__) || defined(__mc68hc1x__)
69 #define INT_MAX __INT_MAX__
70 #define UINT_MAX (__INT_MAX__ * 2U + 1)
71 #define _POINTER_INT short
75 #define _FLOAT_RET double
80 /* in other words, go32 */
81 #define _FLOAT_RET double
83 #if defined(__linux__) || defined(__RDOS__)
84 /* we want the reentrancy structure to be returned by a function */
85 #define __DYNAMIC_REENT__
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
96 #define __SMALL_BITFIELDS
100 #define __SMALL_BITFIELDS
101 #define _POINTER_INT short
105 #define __ATTRIBUTE_IMPURE_PTR__ __attribute__((__sda__))
108 /* For the PowerPC eabi, force the _impure_ptr to be in .sdata */
110 #if defined(_CALL_SYSV)
111 #define __ATTRIBUTE_IMPURE_PTR__ __attribute__((__section__(".sdata")))
114 #define _LONG_DOUBLE double
118 /* Configure small REENT structure for Xilinx MicroBlaze platforms */
119 #if defined (__MICROBLAZE__)
123 /* Xilinx XMK uses Unix98 mutex */
125 #define _UNIX98_THREAD_MUTEX_ATTRIBUTES
129 #if defined(__mips__) && !defined(__rtems__)
130 #define __ATTRIBUTE_IMPURE_PTR__ __attribute__((__section__(".sdata")))
134 #define __SMALL_BITFIELDS
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
145 #define __SMALL_BITFIELDS
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
154 #define _POINTER_INT long
156 #define __BUFSIZ__ 16
158 #endif /* __m32c__ */
161 #define MALLOC_ALIGNMENT 16
162 #define __CUSTOM_FILE_IO__
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
172 # define __INT_MAX__ INT_MAX
174 # define __INT_MAX__ 2147483647
180 # define __LONG_MAX__ LONG_MAX
182 # if defined (__alpha__) || (defined (__sparc__) && defined(__arch64__)) \
183 || defined (__sparcv9)
184 # define __LONG_MAX__ 9223372036854775807L
186 # define __LONG_MAX__ 2147483647L
187 # endif /* __alpha__ || sparc64 */
190 /* End of block that should be kept in sync with GCC's limits.h. */
193 #define _POINTER_INT long
197 #define __ATTRIBUTE_IMPURE_PTR__ __attribute__((__section__(".sdata")))
200 #if __INT_MAX__ == 32767
201 #define __RAND_MAX 32767
203 #define __RAND_MAX 0x7fffffff
206 #if defined(__CYGWIN__)
207 #include <cygwin/config.h>
208 #if !defined (__STRICT_ANSI__) || (__STDC_VERSION__ >= 199901L)
209 #define __USE_XOPEN2K 1
213 #if defined(__rtems__)
214 #define __FILENAME_MAX__ 255
215 #define _READ_WRITE_RETURN_TYPE _ssize_t
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
233 #ifndef __WCHAR_MAX__
234 #if __INT_MAX__ == 32767 || defined (_WIN32)
235 #define __WCHAR_MAX__ 0xffffu
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
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
255 #endif /* __SYS_CONFIG_H__ */