Subversion Repositories Kolibri OS

Rev

Rev 6099 | 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
 
6099 serge 78
#if defined(__m68k__) || defined(__mc68000__)
79
#define _READ_WRITE_RETURN_TYPE _ssize_t
80
#endif
81
 
4349 Serge 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 _HAVE_SYSTYPES
96
#define _READ_WRITE_RETURN_TYPE _ssize_t
97
#define __LARGE64_FILES 1
98
/* we use some glibc header files so turn on glibc large file feature */
99
#define _LARGEFILE64_SOURCE 1
100
#endif
101
#endif
102
 
103
#ifdef __mn10200__
104
#define __SMALL_BITFIELDS
105
#endif
106
 
107
#ifdef __AVR__
108
#define __SMALL_BITFIELDS
109
#define _POINTER_INT short
110
#endif
111
 
112
#ifdef __v850
113
#define __ATTRIBUTE_IMPURE_PTR__ __attribute__((__sda__))
114
#endif
115
 
116
/* For the PowerPC eabi, force the _impure_ptr to be in .sdata */
117
#if defined(__PPC__)
118
#if defined(_CALL_SYSV)
119
#define __ATTRIBUTE_IMPURE_PTR__ __attribute__((__section__(".sdata")))
120
#endif
121
#ifdef __SPE__
122
#define _LONG_DOUBLE double
123
#endif
124
#endif
125
 
126
/* Configure small REENT structure for Xilinx MicroBlaze platforms */
127
#if defined (__MICROBLAZE__)
128
#ifndef _REENT_SMALL
129
#define _REENT_SMALL
130
#endif
131
/* Xilinx XMK uses Unix98 mutex */
132
#ifdef __XMK__
133
#define _UNIX98_THREAD_MUTEX_ATTRIBUTES
134
#endif
135
#endif
136
 
137
#if defined(__mips__) && !defined(__rtems__)
138
#define __ATTRIBUTE_IMPURE_PTR__ __attribute__((__section__(".sdata")))
139
#endif
140
 
141
#ifdef __xstormy16__
142
#define __SMALL_BITFIELDS
143
#undef INT_MAX
144
#undef UINT_MAX
145
#define INT_MAX __INT_MAX__
146
#define UINT_MAX (__INT_MAX__ * 2U + 1)
147
#define MALLOC_ALIGNMENT 8
148
#define _POINTER_INT short
149
#define __BUFSIZ__ 16
150
#define _REENT_SMALL
151
#endif
4921 Serge 152
 
153
#if defined __MSP430__
154
#ifndef _REENT_SMALL
155
#define _REENT_SMALL
156
#endif
157
 
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
 
4349 Serge 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
 
6099 serge 188
#if defined(__or1k__) || defined(__or1knd__)
189
#define __DYNAMIC_REENT__
190
#endif
191
 
4349 Serge 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 
235
#endif
236
 
237
#if defined(__rtems__)
238
#define __FILENAME_MAX__ 255
239
#define _READ_WRITE_RETURN_TYPE _ssize_t
4921 Serge 240
#define __DYNAMIC_REENT__
241
#define _REENT_GLOBAL_ATEXIT
4349 Serge 242
#endif
243
 
244
#ifndef __EXPORT
245
#define __EXPORT
246
#endif
247
 
248
#ifndef __IMPORT
249
#define __IMPORT
250
#endif
251
 
252
/* Define return type of read/write routines.  In POSIX, the return type
253
   for read()/write() is "ssize_t" but legacy newlib code has been using
254
   "int" for some time.  If not specified, "int" is defaulted.  */
255
#ifndef _READ_WRITE_RETURN_TYPE
256
#define _READ_WRITE_RETURN_TYPE int
257
#endif
4921 Serge 258
/* Define `count' parameter of read/write routines.  In POSIX, the `count'
259
   parameter is "size_t" but legacy newlib code has been using "int" for some
260
   time.  If not specified, "int" is defaulted.  */
261
#ifndef _READ_WRITE_BUFSIZE_TYPE
262
#define _READ_WRITE_BUFSIZE_TYPE int
263
#endif
4349 Serge 264
 
265
#ifndef __WCHAR_MAX__
266
#if __INT_MAX__ == 32767 || defined (_WIN32)
267
#define __WCHAR_MAX__ 0xffffu
268
#endif
269
#endif
270
 
271
/* See if small reent asked for at configuration time and
272
   is not chosen by the platform by default.  */
273
#ifdef _WANT_REENT_SMALL
274
#ifndef _REENT_SMALL
275
#define _REENT_SMALL
276
#endif
277
#endif
278
 
279
/* If _MB_EXTENDED_CHARSETS_ALL is set, we want all of the extended
280
   charsets.  The extended charsets add a few functions and a couple
281
   of tables of a few K each. */
282
#ifdef _MB_EXTENDED_CHARSETS_ALL
283
#define _MB_EXTENDED_CHARSETS_ISO 1
284
#define _MB_EXTENDED_CHARSETS_WINDOWS 1
285
#endif
286
 
287
#endif /* __SYS_CONFIG_H__ */