Subversion Repositories Kolibri OS

Rev

Rev 4874 | Rev 6099 | Go to most recent revision | Details | Compare with Previous | Last modification | View Log | RSS feed

Rev Author Line No. Line
4349 Serge 1
#ifndef __SYS_CONFIG_H__
2
#define __SYS_CONFIG_H__
3
 
4
#include   /* floating point macros */
5
#include 	/* POSIX defs */
6
 
4921 Serge 7
#ifdef __aarch64__
8
#define MALLOC_ALIGNMENT 16
9
#endif
10
 
4349 Serge 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
#ifdef ___AM29K__
79
#define _FLOAT_RET double
80
#endif
81
 
82
#ifdef __i386__
83
#ifndef __unix__
84
/* in other words, go32 */
85
#define _FLOAT_RET double
86
#endif
87
#if defined(__linux__) || defined(__RDOS__)
88
/* we want the reentrancy structure to be returned by a function */
89
#define __DYNAMIC_REENT__
90
#define HAVE_GETDATE
91
#define _HAVE_SYSTYPES
92
#define _READ_WRITE_RETURN_TYPE _ssize_t
93
#define __LARGE64_FILES 1
94
/* we use some glibc header files so turn on glibc large file feature */
95
#define _LARGEFILE64_SOURCE 1
96
#endif
97
#endif
98
 
99
#ifdef __mn10200__
100
#define __SMALL_BITFIELDS
101
#endif
102
 
103
#ifdef __AVR__
104
#define __SMALL_BITFIELDS
105
#define _POINTER_INT short
106
#endif
107
 
108
#ifdef __v850
109
#define __ATTRIBUTE_IMPURE_PTR__ __attribute__((__sda__))
110
#endif
111
 
112
/* For the PowerPC eabi, force the _impure_ptr to be in .sdata */
113
#if defined(__PPC__)
114
#if defined(_CALL_SYSV)
115
#define __ATTRIBUTE_IMPURE_PTR__ __attribute__((__section__(".sdata")))
116
#endif
117
#ifdef __SPE__
118
#define _LONG_DOUBLE double
119
#endif
120
#endif
121
 
122
/* Configure small REENT structure for Xilinx MicroBlaze platforms */
123
#if defined (__MICROBLAZE__)
124
#ifndef _REENT_SMALL
125
#define _REENT_SMALL
126
#endif
127
/* Xilinx XMK uses Unix98 mutex */
128
#ifdef __XMK__
129
#define _UNIX98_THREAD_MUTEX_ATTRIBUTES
130
#endif
131
#endif
132
 
133
#if defined(__mips__) && !defined(__rtems__)
134
#define __ATTRIBUTE_IMPURE_PTR__ __attribute__((__section__(".sdata")))
135
#endif
136
 
137
#ifdef __xstormy16__
138
#define __SMALL_BITFIELDS
139
#undef INT_MAX
140
#undef UINT_MAX
141
#define INT_MAX __INT_MAX__
142
#define UINT_MAX (__INT_MAX__ * 2U + 1)
143
#define MALLOC_ALIGNMENT 8
144
#define _POINTER_INT short
145
#define __BUFSIZ__ 16
146
#define _REENT_SMALL
147
#endif
4921 Serge 148
 
149
#if defined __MSP430__
150
#ifndef _REENT_SMALL
151
#define _REENT_SMALL
152
#endif
153
 
154
#define __SMALL_BITFIELDS
155
 
156
#ifdef __MSP430X_LARGE__
157
#define _POINTER_INT long
158
#else
159
#define _POINTER_INT int
160
#endif
161
#endif
162
 
4349 Serge 163
#ifdef __m32c__
164
#define __SMALL_BITFIELDS
165
#undef INT_MAX
166
#undef UINT_MAX
167
#define INT_MAX __INT_MAX__
168
#define UINT_MAX (__INT_MAX__ * 2U + 1)
169
#define MALLOC_ALIGNMENT 8
170
#if defined(__r8c_cpu__) || defined(__m16c_cpu__)
171
#define _POINTER_INT short
172
#else
173
#define _POINTER_INT long
174
#endif
175
#define __BUFSIZ__ 16
176
#define _REENT_SMALL
177
#endif /* __m32c__ */
178
 
179
#ifdef __SPU__
180
#define MALLOC_ALIGNMENT 16
181
#define __CUSTOM_FILE_IO__
182
#endif
183
 
184
/* This block should be kept in sync with GCC's limits.h.  The point
185
   of having these definitions here is to not include limits.h, which
186
   would pollute the user namespace, while still using types of the
187
   the correct widths when deciding how to define __int32_t and
188
   __int64_t.  */
189
#ifndef __INT_MAX__
190
# ifdef INT_MAX
191
#  define __INT_MAX__ INT_MAX
192
# else
193
#  define __INT_MAX__ 2147483647
194
# endif
195
#endif
196
 
197
#ifndef __LONG_MAX__
198
# ifdef LONG_MAX
199
#  define __LONG_MAX__ LONG_MAX
200
# else
201
#  if defined (__alpha__) || (defined (__sparc__) && defined(__arch64__)) \
202
      || defined (__sparcv9)
203
#   define __LONG_MAX__ 9223372036854775807L
204
#  else
205
#   define __LONG_MAX__ 2147483647L
206
#  endif /* __alpha__ || sparc64 */
207
# endif
208
#endif
209
/* End of block that should be kept in sync with GCC's limits.h.  */
210
 
211
#ifndef _POINTER_INT
212
#define _POINTER_INT long
213
#endif
214
 
215
#ifdef __frv__
216
#define __ATTRIBUTE_IMPURE_PTR__ __attribute__((__section__(".sdata")))
217
#endif
218
#undef __RAND_MAX
219
#if __INT_MAX__ == 32767
220
#define __RAND_MAX 32767
221
#else
222
#define __RAND_MAX 0x7fffffff
223
#endif
224
 
225
#if defined(__CYGWIN__)
226
#include 
227
#if !defined (__STRICT_ANSI__) || (__STDC_VERSION__ >= 199901L)
228
#define __USE_XOPEN2K 1
229
#endif
230
#endif
231
 
232
#if defined(__rtems__)
233
#define __FILENAME_MAX__ 255
234
#define _READ_WRITE_RETURN_TYPE _ssize_t
4921 Serge 235
#define __DYNAMIC_REENT__
236
#define _REENT_GLOBAL_ATEXIT
4349 Serge 237
#endif
238
 
239
#ifndef __EXPORT
240
#define __EXPORT
241
#endif
242
 
243
#ifndef __IMPORT
244
#define __IMPORT
245
#endif
246
 
247
/* Define return type of read/write routines.  In POSIX, the return type
248
   for read()/write() is "ssize_t" but legacy newlib code has been using
249
   "int" for some time.  If not specified, "int" is defaulted.  */
250
#ifndef _READ_WRITE_RETURN_TYPE
251
#define _READ_WRITE_RETURN_TYPE int
252
#endif
4921 Serge 253
/* Define `count' parameter of read/write routines.  In POSIX, the `count'
254
   parameter is "size_t" but legacy newlib code has been using "int" for some
255
   time.  If not specified, "int" is defaulted.  */
256
#ifndef _READ_WRITE_BUFSIZE_TYPE
257
#define _READ_WRITE_BUFSIZE_TYPE int
258
#endif
4349 Serge 259
 
260
#ifndef __WCHAR_MAX__
261
#if __INT_MAX__ == 32767 || defined (_WIN32)
262
#define __WCHAR_MAX__ 0xffffu
263
#endif
264
#endif
265
 
266
/* See if small reent asked for at configuration time and
267
   is not chosen by the platform by default.  */
268
#ifdef _WANT_REENT_SMALL
269
#ifndef _REENT_SMALL
270
#define _REENT_SMALL
271
#endif
272
#endif
273
 
274
/* If _MB_EXTENDED_CHARSETS_ALL is set, we want all of the extended
275
   charsets.  The extended charsets add a few functions and a couple
276
   of tables of a few K each. */
277
#ifdef _MB_EXTENDED_CHARSETS_ALL
278
#define _MB_EXTENDED_CHARSETS_ISO 1
279
#define _MB_EXTENDED_CHARSETS_WINDOWS 1
280
#endif
281
 
282
#endif /* __SYS_CONFIG_H__ */