1 diff -uNr newlib-1.15.0.orig/newlib/libc/include/inttypes.h newlib-1.15.0/newlib/libc/include/inttypes.h
2 --- newlib-1.15.0.orig/newlib/libc/include/inttypes.h 2005-12-16 20:03:12.000000000 +0100
3 +++ newlib-1.15.0/newlib/libc/include/inttypes.h 2007-04-13 10:41:47.000000000 +0200
5 #define SCNxMAX __SCNMAX(x)
9 -#define __PRIPTR(x) __STRINGIFY(ll##x)
10 -#define __SCNPTR(x) __STRINGIFY(ll##x)
11 +#if __ptrint_t_long_defined
12 +#define __PRIPTR(x) __STRINGIFY(l##x)
13 +#define __SCNPTR(x) __STRINGIFY(l##x)
14 +#elif __ptrint_t_int_defined
15 +#define __PRIPTR(x) __STRINGIFY(x)
16 +#define __SCNPTR(x) __STRINGIFY(x)
18 #define __PRIPTR(x) __STRINGIFY(l##x)
19 #define __SCNPTR(x) __STRINGIFY(l##x)
20 diff -uNr newlib-1.15.0.orig/newlib/libc/include/machine/setjmp.h newlib-1.15.0/newlib/libc/include/machine/setjmp.h
21 --- newlib-1.15.0.orig/newlib/libc/include/machine/setjmp.h 2006-12-18 17:48:03.000000000 +0100
22 +++ newlib-1.15.0/newlib/libc/include/machine/setjmp.h 2007-04-13 10:41:47.000000000 +0200
25 /* necv70 was 9 as well. */
28 +#if defined(__m68k__) || defined(__mc68000__)
30 * onsstack,sigmask,sp,pc,psl,d2-d7,a2-a6,
32 diff -uNr newlib-1.15.0.orig/newlib/libc/include/stdint.h newlib-1.15.0/newlib/libc/include/stdint.h
33 --- newlib-1.15.0.orig/newlib/libc/include/stdint.h 2006-08-16 23:39:43.000000000 +0200
34 +++ newlib-1.15.0/newlib/libc/include/stdint.h 2007-04-13 10:41:47.000000000 +0200
36 #define UINTMAX_C(x) x##UL
40 +#include <machine/stdint.h>
45 diff -uNr newlib-1.15.0.orig/newlib/libc/include/sys/errno.h newlib-1.15.0/newlib/libc/include/sys/errno.h
46 --- newlib-1.15.0.orig/newlib/libc/include/sys/errno.h 2002-09-24 16:10:12.000000000 +0200
47 +++ newlib-1.15.0/newlib/libc/include/sys/errno.h 2007-04-13 10:41:47.000000000 +0200
49 #define ECASECLASH 137 /* Filename exists with different case */
51 #define EOVERFLOW 139 /* Value too large for defined data type */
52 +#define ECANCELED 140 /* Operation canceled. */
55 #define EWOULDBLOCK EAGAIN /* Operation would block */
56 diff -uNr newlib-1.15.0.orig/newlib/libc/include/sys/features.h newlib-1.15.0/newlib/libc/include/sys/features.h
57 --- newlib-1.15.0.orig/newlib/libc/include/sys/features.h 2006-09-14 00:09:27.000000000 +0200
58 +++ newlib-1.15.0/newlib/libc/include/sys/features.h 2007-04-13 10:41:47.000000000 +0200
60 #define _POSIX_MEMLOCK_RANGE 1
61 #define _POSIX_MEMORY_PROTECTION 1
62 #define _POSIX_MESSAGE_PASSING 1
63 +#define _POSIX_MONOTONIC_CLOCK 200112L
64 #define _POSIX_PRIORITIZED_IO 1
65 #define _POSIX_PRIORITY_SCHEDULING 1
66 #define _POSIX_REALTIME_SIGNALS 1
71 -# define _POSIX_JOB_CONTROL 1
72 -# define _POSIX_SAVED_IDS 0
73 -# define _POSIX_VERSION 199009L
74 -# define _POSIX_THREADS 1
75 -# define _POSIX_THREAD_PROCESS_SHARED 1
76 -# define _POSIX_THREAD_SAFE_FUNCTIONS 1
77 -# define _POSIX_THREAD_PRIORITY_SCHEDULING 1
78 -# define _POSIX_THREAD_ATTR_STACKSIZE 1
79 -# define _POSIX_SEMAPHORES 1
80 -# define _POSIX_TIMERS 1
81 -# define _POSIX_MEMLOCK_RANGE 1
82 +#define _POSIX_VERSION 200112L
83 +#define _POSIX2_VERSION 200112L
84 +#define _XOPEN_VERSION 600
86 +#define _POSIX_ADVISORY_INFO 200112L
87 +/* #define _POSIX_ASYNCHRONOUS_IO -1 */
88 +/* #define _POSIX_BARRIERS -1 */
89 +#define _POSIX_CHOWN_RESTRICTED 1
90 +/* #define _POSIX_CLOCK_SELECTION -1 */
91 +/* #define _POSIX_CPUTIME -1 */
92 +#define _POSIX_FSYNC 200112L
93 +#define _POSIX_IPV6 200112L
94 +#define _POSIX_JOB_CONTROL 1
95 +#define _POSIX_MAPPED_FILES 200112L
96 +/* #define _POSIX_MEMLOCK -1 */
97 +#define _POSIX_MEMLOCK_RANGE 200112L
98 +#define _POSIX_MEMORY_PROTECTION 200112L
99 +/* #define _POSIX_MESSAGE_PASSING -1 */
100 +/* #define _POSIX_MONOTONIC_CLOCK -1 */
101 +#define _POSIX_NO_TRUNC 1
102 +/* #define _POSIX_PRIORITIZED_IO -1 */
103 +#define _POSIX_PRIORITY_SCHEDULING 200112L
104 +#define _POSIX_RAW_SOCKETS 200112L
105 +#define _POSIX_READER_WRITER_LOCKS 200112L
106 +#define _POSIX_REALTIME_SIGNALS 200112L
107 +#define _POSIX_REGEXP 1
108 +#define _POSIX_SAVED_IDS 1
109 +#define _POSIX_SEMAPHORES 1
110 +/* #define _POSIX_SHARED_MEMORY_OBJECTS -1 */
111 +#define _POSIX_SHELL 1
112 +/* #define _POSIX_SPAWN -1 */
113 +/* #define _POSIX_SPIN_LOCKS -1 */
114 +/* #define _POSIX_SPORADIC_SERVER -1 */
115 +#define _POSIX_SYNCHRONIZED_IO 200112L
116 +/* #define _POSIX_THREAD_ATTR_STACKADDR -1 */
117 +#define _POSIX_THREAD_ATTR_STACKSIZE 200112L
118 +/* #define _POSIX_THREAD_CPUTIME -1 */
119 +/* #define _POSIX_THREAD_PRIO_INHERIT -1 */
120 +/* #define _POSIX_THREAD_PRIO_PROTECT -1 */
121 +#define _POSIX_THREAD_PRIORITY_SCHEDULING 200112L
122 +#define _POSIX_THREAD_PROCESS_SHARED 200112L
123 +#define _POSIX_THREAD_SAFE_FUNCTIONS 200112L
124 +/* #define _POSIX_THREAD_SPORADIC_SERVER -1 */
125 +#define _POSIX_THREADS 200112L
126 +/* #define _POSIX_TIMEOUTS -1 */
127 +#define _POSIX_TIMERS 1
128 +/* #define _POSIX_TRACE -1 */
129 +/* #define _POSIX_TRACE_EVENT_FILTER -1 */
130 +/* #define _POSIX_TRACE_INHERIT -1 */
131 +/* #define _POSIX_TRACE_LOG -1 */
132 +/* #define _POSIX_TYPED_MEMORY_OBJECTS -1 */
133 +#define _POSIX_VDISABLE '\0'
134 +#define _POSIX2_C_BIND 200112L
135 +#define _POSIX2_C_DEV 200112L
136 +#define _POSIX2_CHAR_TERM 200112L
137 +/* #define _POSIX2_FORT_DEV -1 */
138 +/* #define _POSIX2_FORT_RUN -1 */
139 +/* #define _POSIX2_LOCALEDEF -1 */
140 +/* #define _POSIX2_PBS -1 */
141 +/* #define _POSIX2_PBS_ACCOUNTING -1 */
142 +/* #define _POSIX2_PBS_CHECKPOINT -1 */
143 +/* #define _POSIX2_PBS_LOCATE -1 */
144 +/* #define _POSIX2_PBS_MESSAGE -1 */
145 +/* #define _POSIX2_PBS_TRACK -1 */
146 +#define _POSIX2_SW_DEV 200112L
147 +#define _POSIX2_UPE 200112L
148 +/* #define _POSIX_V6_ILP32_OFF32 -1 */
149 +#define _XBS5_ILP32_OFF32 _POSIX_V6_ILP32_OFF32
150 +#define _POSIX_V6_ILP32_OFFBIG 1
151 +#define _XBS5_ILP32_OFFBIG _POSIX_V6_ILP32_OFFBIG
152 +/* #define _POSIX_V6_LP64_OFF64 -1 */
153 +#define _XBS5_LP64_OFF64 _POSIX_V6_LP64_OFF64
154 +/* #define _POSIX_V6_LPBIG_OFFBIG -1 */
155 +#define _XBS5_LPBIG_OFFBIG _POSIX_V6_LPBIG_OFFBIG
156 +#define _XOPEN_CRYPT 1
157 +#define _XOPEN_ENH_I18N 1
158 +/* #define _XOPEN_LEGACY -1 */
159 +/* #define _XOPEN_REALTIME -1 */
160 +/* #define _XOPEN_REALTIME_THREADS -1 */
161 +#define _XOPEN_SHM 1
162 +/* #define _XOPEN_STREAMS -1 */
163 +/* #define _XOPEN_UNIX -1 */
168 diff -uNr newlib-1.15.0.orig/newlib/libc/include/sys/_types.h newlib-1.15.0/newlib/libc/include/sys/_types.h
169 --- newlib-1.15.0.orig/newlib/libc/include/sys/_types.h 2004-06-11 22:37:09.000000000 +0200
170 +++ newlib-1.15.0/newlib/libc/include/sys/_types.h 2007-04-13 10:41:47.000000000 +0200
172 /* Iconv descriptor type */
173 typedef void *_iconv_t;
175 +typedef long * __intptr_t;
176 +typedef unsigned long* __uintptr_t;
178 #endif /* _SYS__TYPES_H */
179 diff -uNr newlib-1.15.0.orig/newlib/libc/include/sys/unistd.h newlib-1.15.0/newlib/libc/include/sys/unistd.h
180 --- newlib-1.15.0.orig/newlib/libc/include/sys/unistd.h 2006-11-07 16:33:40.000000000 +0100
181 +++ newlib-1.15.0/newlib/libc/include/sys/unistd.h 2007-04-13 10:41:47.000000000 +0200
183 int _EXFUN(getdtablesize, (void));
184 int _EXFUN(setdtablesize, (int));
185 useconds_t _EXFUN(ualarm, (useconds_t __useconds, useconds_t __interval));
186 -unsigned _EXFUN(usleep, (unsigned int __useconds));
187 +int _EXFUN(usleep, (useconds_t __useconds));
188 #if !(defined (_WINSOCK_H) || defined (__USE_W32_SOCKETS))
189 /* winsock[2].h defines as __stdcall, and with int as 2nd arg */
190 int _EXFUN(gethostname, (char *__name, size_t __len));
192 int _EXFUN(sync, (void));
195 -int _EXFUN(readlink, (const char *__path, char *__buf, int __buflen));
196 +ssize_t _EXFUN(readlink, (const char *__path, char *__buf, size_t __buflen));
197 int _EXFUN(symlink, (const char *__name1, const char *__name2));
200 @@ -231,63 +231,55 @@
201 #define STDERR_FILENO 2 /* standard error file descriptor */
204 - * 4.8.1 Get Configurable System Variables, P1003.1b-1993, p. 96
206 - * NOTE: Table 4-2, Configurable System Variables, p. 96
209 -#define _SC_ARG_MAX 0
210 -#define _SC_CHILD_MAX 1
211 -#define _SC_CLK_TCK 2
212 -#define _SC_NGROUPS_MAX 3
213 -#define _SC_OPEN_MAX 4
214 - /* no _SC_STREAM_MAX */
215 -#define _SC_JOB_CONTROL 5
216 -#define _SC_SAVED_IDS 6
217 -#define _SC_VERSION 7
218 -#define _SC_PAGESIZE 8
219 -/* CYGWIN-specific values .. do not touch */
220 -#define _SC_NPROCESSORS_CONF 9
221 -#define _SC_NPROCESSORS_ONLN 10
222 -#define _SC_PHYS_PAGES 11
223 -#define _SC_AVPHYS_PAGES 12
224 -/* end of CYGWIN-specific values */
225 -#define _SC_MQ_OPEN_MAX 13
226 -#define _SC_MQ_PRIO_MAX 14
227 -#define _SC_RTSIG_MAX 15
228 -#define _SC_SEM_NSEMS_MAX 16
229 -#define _SC_SEM_VALUE_MAX 17
230 -#define _SC_SIGQUEUE_MAX 18
231 -#define _SC_TIMER_MAX 19
232 -#define _SC_TZNAME_MAX 20
234 -#define _SC_ASYNCHRONOUS_IO 21
235 -#define _SC_FSYNC 22
236 -#define _SC_MAPPED_FILES 23
237 -#define _SC_MEMLOCK 24
238 -#define _SC_MEMLOCK_RANGE 25
239 -#define _SC_MEMORY_PROTECTION 26
240 -#define _SC_MESSAGE_PASSING 27
241 -#define _SC_PRIORITIZED_IO 28
242 -#define _SC_REALTIME_SIGNALS 29
243 -#define _SC_SEMAPHORES 30
244 -#define _SC_SHARED_MEMORY_OBJECTS 31
245 -#define _SC_SYNCHRONIZED_IO 32
246 -#define _SC_TIMERS 33
247 -#define _SC_AIO_LISTIO_MAX 34
248 -#define _SC_AIO_MAX 35
249 -#define _SC_AIO_PRIO_DELTA_MAX 36
250 -#define _SC_DELAYTIMER_MAX 37
253 - * P1003.1c/D10, p. 52 adds the following.
254 + * sysconf values per IEEE Std 1003.1, 2004 Edition
257 +#define _SC_ARG_MAX 0
258 +#define _SC_CHILD_MAX 1
259 +#define _SC_CLK_TCK 2
260 +#define _SC_NGROUPS_MAX 3
261 +#define _SC_OPEN_MAX 4
262 +#define _SC_JOB_CONTROL 5
263 +#define _SC_SAVED_IDS 6
264 +#define _SC_VERSION 7
265 +#define _SC_PAGESIZE 8
266 +#define _SC_PAGE_SIZE _SC_PAGESIZE
267 +/* These are non-POSIX values we accidentally introduced in 2000 without
268 + guarding them. Keeping them unguarded for backward compatibility. */
269 +#define _SC_NPROCESSORS_CONF 9
270 +#define _SC_NPROCESSORS_ONLN 10
271 +#define _SC_PHYS_PAGES 11
272 +#define _SC_AVPHYS_PAGES 12
273 +/* End of non-POSIX values. */
274 +#define _SC_MQ_OPEN_MAX 13
275 +#define _SC_MQ_PRIO_MAX 14
276 +#define _SC_RTSIG_MAX 15
277 +#define _SC_SEM_NSEMS_MAX 16
278 +#define _SC_SEM_VALUE_MAX 17
279 +#define _SC_SIGQUEUE_MAX 18
280 +#define _SC_TIMER_MAX 19
281 +#define _SC_TZNAME_MAX 20
282 +#define _SC_ASYNCHRONOUS_IO 21
283 +#define _SC_FSYNC 22
284 +#define _SC_MAPPED_FILES 23
285 +#define _SC_MEMLOCK 24
286 +#define _SC_MEMLOCK_RANGE 25
287 +#define _SC_MEMORY_PROTECTION 26
288 +#define _SC_MESSAGE_PASSING 27
289 +#define _SC_PRIORITIZED_IO 28
290 +#define _SC_REALTIME_SIGNALS 29
291 +#define _SC_SEMAPHORES 30
292 +#define _SC_SHARED_MEMORY_OBJECTS 31
293 +#define _SC_SYNCHRONIZED_IO 32
294 +#define _SC_TIMERS 33
295 +#define _SC_AIO_LISTIO_MAX 34
296 +#define _SC_AIO_MAX 35
297 +#define _SC_AIO_PRIO_DELTA_MAX 36
298 +#define _SC_DELAYTIMER_MAX 37
299 #define _SC_THREAD_KEYS_MAX 38
300 #define _SC_THREAD_STACK_MIN 39
301 #define _SC_THREAD_THREADS_MAX 40
302 #define _SC_TTY_NAME_MAX 41
304 #define _SC_THREADS 42
305 #define _SC_THREAD_ATTR_STACKADDR 43
306 #define _SC_THREAD_ATTR_STACKSIZE 44
307 @@ -302,34 +294,99 @@
308 #define _SC_GETPW_R_SIZE_MAX 51
309 #define _SC_LOGIN_NAME_MAX 52
310 #define _SC_THREAD_DESTRUCTOR_ITERATIONS 53
312 -#if !defined(__rtems__)
313 -#define _SC_STREAM_MAX 100
315 -#if !defined(__CYGWIN__) && !defined(__rtems__)
316 -#define _SC_PRIORITY_SCHEDULING 101
319 -# define _PC_LINK_MAX 0
320 -# define _PC_MAX_CANON 1
321 -# define _PC_MAX_INPUT 2
322 -# define _PC_NAME_MAX 3
323 -# define _PC_PATH_MAX 4
324 -# define _PC_PIPE_BUF 5
325 -# define _PC_CHOWN_RESTRICTED 6
326 -# define _PC_NO_TRUNC 7
327 -# define _PC_VDISABLE 8
328 -# define _PC_ASYNC_IO 9
329 -# define _PC_PRIO_IO 10
330 -# define _PC_SYNC_IO 11
331 -# define _PC_FILESIZEBITS 12
332 -# define _PC_2_SYMLINKS 13
333 -# define _PC_SYMLINK_MAX 14
334 +#define _SC_ADVISORY_INFO 54
335 +#define _SC_ATEXIT_MAX 55
336 +#define _SC_BARRIERS 56
337 +#define _SC_BC_BASE_MAX 57
338 +#define _SC_BC_DIM_MAX 58
339 +#define _SC_BC_SCALE_MAX 59
340 +#define _SC_BC_STRING_MAX 60
341 +#define _SC_CLOCK_SELECTION 61
342 +#define _SC_COLL_WEIGHTS_MAX 62
343 +#define _SC_CPUTIME 63
344 +#define _SC_EXPR_NEST_MAX 64
345 +#define _SC_HOST_NAME_MAX 65
346 +#define _SC_IOV_MAX 66
348 +#define _SC_LINE_MAX 68
349 +#define _SC_MONOTONIC_CLOCK 69
350 +#define _SC_RAW_SOCKETS 70
351 +#define _SC_READER_WRITER_LOCKS 71
352 +#define _SC_REGEXP 72
353 +#define _SC_RE_DUP_MAX 73
354 +#define _SC_SHELL 74
355 +#define _SC_SPAWN 75
356 +#define _SC_SPIN_LOCKS 76
357 +#define _SC_SPORADIC_SERVER 77
358 +#define _SC_SS_REPL_MAX 78
359 +#define _SC_SYMLOOP_MAX 79
360 +#define _SC_THREAD_CPUTIME 80
361 +#define _SC_THREAD_SPORADIC_SERVER 81
362 +#define _SC_TIMEOUTS 82
363 +#define _SC_TRACE 83
364 +#define _SC_TRACE_EVENT_FILTER 84
365 +#define _SC_TRACE_EVENT_NAME_MAX 85
366 +#define _SC_TRACE_INHERIT 86
367 +#define _SC_TRACE_LOG 87
368 +#define _SC_TRACE_NAME_MAX 88
369 +#define _SC_TRACE_SYS_MAX 89
370 +#define _SC_TRACE_USER_EVENT_MAX 90
371 +#define _SC_TYPED_MEMORY_OBJECTS 91
372 +#define _SC_V6_ILP32_OFF32 92
373 +#define _SC_XBS5_ILP32_OFF32 _SC_V6_ILP32_OFF32
374 +#define _SC_V6_ILP32_OFFBIG 93
375 +#define _SC_XBS5_ILP32_OFFBIG _SC_V6_ILP32_OFFBIG
376 +#define _SC_V6_LP64_OFF64 94
377 +#define _SC_XBS5_LP64_OFF64 _SC_V6_LP64_OFF64
378 +#define _SC_V6_LPBIG_OFFBIG 95
379 +#define _SC_XBS5_LPBIG_OFFBIG _SC_V6_LPBIG_OFFBIG
380 +#define _SC_XOPEN_CRYPT 96
381 +#define _SC_XOPEN_ENH_I18N 97
382 +#define _SC_XOPEN_LEGACY 98
383 +#define _SC_XOPEN_REALTIME 99
384 +#define _SC_STREAM_MAX 100
385 +#define _SC_PRIORITY_SCHEDULING 101
386 +#define _SC_XOPEN_REALTIME_THREADS 102
387 +#define _SC_XOPEN_SHM 103
388 +#define _SC_XOPEN_STREAMS 104
389 +#define _SC_XOPEN_UNIX 105
390 +#define _SC_XOPEN_VERSION 106
391 +#define _SC_2_CHAR_TERM 107
392 +#define _SC_2_C_BIND 108
393 +#define _SC_2_C_DEV 109
394 +#define _SC_2_FORT_DEV 110
395 +#define _SC_2_FORT_RUN 111
396 +#define _SC_2_LOCALEDEF 112
397 +#define _SC_2_PBS 113
398 +#define _SC_2_PBS_ACCOUNTING 114
399 +#define _SC_2_PBS_CHECKPOINT 115
400 +#define _SC_2_PBS_LOCATE 116
401 +#define _SC_2_PBS_MESSAGE 117
402 +#define _SC_2_PBS_TRACK 118
403 +#define _SC_2_SW_DEV 119
404 +#define _SC_2_UPE 120
405 +#define _SC_2_VERSION 121
407 +#define _PC_LINK_MAX 0
408 +#define _PC_MAX_CANON 1
409 +#define _PC_MAX_INPUT 2
410 +#define _PC_NAME_MAX 3
411 +#define _PC_PATH_MAX 4
412 +#define _PC_PIPE_BUF 5
413 +#define _PC_CHOWN_RESTRICTED 6
414 +#define _PC_NO_TRUNC 7
415 +#define _PC_VDISABLE 8
416 +#define _PC_ASYNC_IO 9
417 +#define _PC_PRIO_IO 10
418 +#define _PC_SYNC_IO 11
419 +#define _PC_FILESIZEBITS 12
420 +#define _PC_2_SYMLINKS 13
421 +#define _PC_SYMLINK_MAX 14
423 /* Ask for POSIX permission bits support. */
424 -# define _PC_POSIX_PERMISSIONS 90
425 +#define _PC_POSIX_PERMISSIONS 90
426 /* Ask for full POSIX permission support including uid/gid settings. */
427 -# define _PC_POSIX_SECURITY 91
428 +#define _PC_POSIX_SECURITY 91
431 /* FIXME: This is temporary until winsup gets sorted out. */
432 diff -uNr newlib-1.15.0.orig/newlib/libc/include/time.h newlib-1.15.0/newlib/libc/include/time.h
433 --- newlib-1.15.0.orig/newlib/libc/include/time.h 2005-11-18 16:57:24.000000000 +0100
434 +++ newlib-1.15.0/newlib/libc/include/time.h 2007-04-13 10:41:47.000000000 +0200
439 +#if defined(_POSIX_MONOTONIC_CLOCK)
441 +/* The identifier for the system-wide monotonic clock, which is defined
442 + as a clock whose value cannot be set via clock_settime() and which
443 + cannot have backward clock jumps. */
445 +#define CLOCK_MONOTONIC (clockid_t)4
449 #if defined(_POSIX_CPUTIME)
451 /* Accessing a Process CPU-time CLock, P1003.4b/D8, p. 55 */
452 diff -uNr newlib-1.15.0.orig/newlib/libc/machine/arm/machine/endian.h newlib-1.15.0/newlib/libc/machine/arm/machine/endian.h
453 --- newlib-1.15.0.orig/newlib/libc/machine/arm/machine/endian.h 2004-05-07 22:29:24.000000000 +0200
454 +++ newlib-1.15.0/newlib/libc/machine/arm/machine/endian.h 1970-01-01 01:00:00.000000000 +0100
456 -/* ARM configuration file */
458 -#ifndef _MACHINE_ENDIAN_H
459 -# define _MACHINE_ENDIAN_H
462 -#define BYTE_ORDER BIG_ENDIAN
464 -#define BYTE_ORDER LITTLE_ENDIAN
468 diff -uNr newlib-1.15.0.orig/newlib/libc/search/db_local.h newlib-1.15.0/newlib/libc/search/db_local.h
469 --- newlib-1.15.0.orig/newlib/libc/search/db_local.h 2002-06-25 01:05:08.000000000 +0200
470 +++ newlib-1.15.0/newlib/libc/search/db_local.h 2007-04-13 10:41:47.000000000 +0200
472 #define MAX_PAGE_NUMBER 0xffffffff /* >= # of pages in a file */
473 typedef __uint32_t pgno_t;
474 #define MAX_PAGE_OFFSET 65535 /* >= # of bytes in a page */
475 -typedef __uint16_t indx_t;
476 +typedef __uint_least16_t indx_t;
477 #define MAX_REC_NUMBER 0xffffffff /* >= # of records in a tree */
478 typedef __uint32_t recno_t;
480 @@ -191,12 +191,12 @@
481 * P_16_COPY swap from one location to another
483 #define M_16_SWAP(a) { \
484 - __uint16_t _tmp = a; \
485 + __uint_least16_t _tmp = a; \
486 ((char *)&a)[0] = ((char *)&_tmp)[1]; \
487 ((char *)&a)[1] = ((char *)&_tmp)[0]; \
489 #define P_16_SWAP(a) { \
490 - __uint16_t _tmp = *(__uint16_t *)a; \
491 + __uint_least16_t _tmp = *(__uint_least16_t *)a; \
492 ((char *)a)[0] = ((char *)&_tmp)[1]; \
493 ((char *)a)[1] = ((char *)&_tmp)[0]; \
495 diff -uNr newlib-1.15.0.orig/newlib/libc/search/extern.h newlib-1.15.0/newlib/libc/search/extern.h
496 --- newlib-1.15.0.orig/newlib/libc/search/extern.h 2002-06-20 21:51:31.000000000 +0200
497 +++ newlib-1.15.0/newlib/libc/search/extern.h 2007-04-13 10:41:47.000000000 +0200
499 int __delpair(HTAB *, BUFHEAD *, int);
500 int __expand_table(HTAB *);
501 int __find_bigpair(HTAB *, BUFHEAD *, int, char *, int);
502 -__uint16_t __find_last_page(HTAB *, BUFHEAD **);
503 +__uint_least16_t __find_last_page(HTAB *, BUFHEAD **);
504 void __free_ovflpage(HTAB *, BUFHEAD *);
505 BUFHEAD *__get_buf(HTAB *, __uint32_t, BUFHEAD *, int);
506 int __get_page(HTAB *, char *, __uint32_t, int, int, int);
507 diff -uNr newlib-1.15.0.orig/newlib/libc/search/hash_bigkey.c newlib-1.15.0/newlib/libc/search/hash_bigkey.c
508 --- newlib-1.15.0.orig/newlib/libc/search/hash_bigkey.c 2006-06-07 21:22:59.000000000 +0200
509 +++ newlib-1.15.0/newlib/libc/search/hash_bigkey.c 2007-04-13 10:41:47.000000000 +0200
512 const DBT *key, *val;
515 + __uint_least16_t *p;
516 int key_size, n, val_size;
517 - __uint16_t space, move_bytes, off;
518 + __uint_least16_t space, move_bytes, off;
519 char *cp, *key_data, *val_data;
521 cp = bufp->page; /* Character pointer of p. */
522 - p = (__uint16_t *)cp;
523 + p = (__uint_least16_t *)cp;
525 key_data = (char *)key->data;
526 key_size = key->size;
531 - p = (__uint16_t *)bufp->page;
532 + p = (__uint_least16_t *)bufp->page;
534 bufp->flags |= BUF_MOD;
540 - p = (__uint16_t *)cp;
541 + p = (__uint_least16_t *)cp;
543 p[n] = FULL_KEY_DATA;
544 bufp->flags |= BUF_MOD;
545 @@ -191,12 +191,12 @@
548 BUFHEAD *last_bfp, *rbufp;
549 - __uint16_t *bp, pageno;
550 + __uint_least16_t *bp, pageno;
555 - bp = (__uint16_t *)bufp->page;
556 + bp = (__uint_least16_t *)bufp->page;
563 return (-1); /* Error. */
564 - bp = (__uint16_t *)rbufp->page;
565 + bp = (__uint_least16_t *)rbufp->page;
572 /* Now, bp is the first page of the pair. */
573 - bp = (__uint16_t *)bufp->page;
574 + bp = (__uint_least16_t *)bufp->page;
576 /* There is an overflow page. */
578 @@ -272,13 +272,13 @@
583 + __uint_least16_t *bp;
587 + __uint_least16_t bytes;
590 - bp = (__uint16_t *)bufp->page;
591 + bp = (__uint_least16_t *)bufp->page;
599 - bp = (__uint16_t *)p;
600 + bp = (__uint_least16_t *)p;
604 @@ -316,17 +316,17 @@
605 * of the pair; 0 if there isn't any (i.e. big pair is the last key in the
609 +extern __uint_least16_t
610 __find_last_page(hashp, bpp)
615 - __uint16_t *bp, pageno;
616 + __uint_least16_t *bp, pageno;
620 - bp = (__uint16_t *)bufp->page;
621 + bp = (__uint_least16_t *)bufp->page;
626 bufp = __get_buf(hashp, pageno, bufp, 0);
628 return (0); /* Need to indicate an error! */
629 - bp = (__uint16_t *)bufp->page;
630 + bp = (__uint_least16_t *)bufp->page;
634 @@ -366,15 +366,15 @@
638 - __uint16_t *bp, len, off, save_addr;
639 + __uint_least16_t *bp, len, off, save_addr;
642 - bp = (__uint16_t *)bufp->page;
643 + bp = (__uint_least16_t *)bufp->page;
644 while (bp[ndx + 1] == PARTIAL_KEY) {
645 bufp = __get_buf(hashp, bp[bp[0] - 1], bufp, 0);
648 - bp = (__uint16_t *)bufp->page;
649 + bp = (__uint_least16_t *)bufp->page;
654 bufp = __get_buf(hashp, bp[bp[0] - 1], bufp, 0);
657 - bp = (__uint16_t *)bufp->page;
658 + bp = (__uint_least16_t *)bufp->page;
660 save_addr = save_p->addr;
663 bufp = __get_buf(hashp, bp[bp[0] - 1], bufp, 0);
666 - bp = (__uint16_t *)bufp->page;
667 + bp = (__uint_least16_t *)bufp->page;
669 /* The data is all on one page. */
675 - if (!((__uint16_t *)
676 + if (!((__uint_least16_t *)
677 hashp->cpage->page)[0]) {
680 @@ -454,14 +454,14 @@
685 + __uint_least16_t *bp;
688 - __uint16_t save_addr;
689 + __uint_least16_t save_addr;
693 - bp = (__uint16_t *)p;
694 + bp = (__uint_least16_t *)p;
695 mylen = hashp->BSIZE - bp[1];
696 save_addr = bufp->addr;
699 __get_buf(hashp, bp[bp[0] - 1], bufp, 0);
702 - else if (!((__uint16_t *)hashp->cpage->page)[0]) {
703 + else if (!((__uint_least16_t *)hashp->cpage->page)[0]) {
707 @@ -533,10 +533,10 @@
711 - __uint16_t *bp, save_addr;
712 + __uint_least16_t *bp, save_addr;
715 - bp = (__uint16_t *)p;
716 + bp = (__uint_least16_t *)p;
717 mylen = hashp->BSIZE - bp[1];
719 save_addr = bufp->addr;
720 @@ -579,11 +579,11 @@
725 + __uint_least16_t *tp;
729 - __uint16_t free_space, n, off;
730 + __uint_least16_t free_space, n, off;
734 @@ -615,14 +615,14 @@
735 (tmpp->ovfl ? tmpp->ovfl->addr : 0), (bp ? bp->addr : 0));
737 tmpp->ovfl = bp; /* one of op/np point to big_keyp */
738 - tp = (__uint16_t *)tmpp->page;
739 + tp = (__uint_least16_t *)tmpp->page;
741 assert(FREESPACE(tp) >= OVFLSIZE);
745 free_space = FREESPACE(tp);
746 - tp[++n] = (__uint16_t)addr;
747 + tp[++n] = (__uint_least16_t)addr;
755 - tp = (__uint16_t *)big_keyp->page;
756 + tp = (__uint_least16_t *)big_keyp->page;
757 big_keyp->flags |= BUF_MOD;
760 diff -uNr newlib-1.15.0.orig/newlib/libc/search/hash_buf.c newlib-1.15.0/newlib/libc/search/hash_buf.c
761 --- newlib-1.15.0.orig/newlib/libc/search/hash_buf.c 2004-05-26 19:57:10.000000000 +0200
762 +++ newlib-1.15.0/newlib/libc/search/hash_buf.c 2007-04-13 10:41:47.000000000 +0200
767 - __uint16_t oaddr, *shortp;
768 + __uint_least16_t oaddr, *shortp;
773 * Set oaddr before __put_page so that you get it
774 * before bytes are swapped.
776 - shortp = (__uint16_t *)bp->page;
777 + shortp = (__uint_least16_t *)bp->page;
779 oaddr = shortp[shortp[0] - 1];
780 if ((bp->flags & BUF_MOD) && __put_page(hashp, bp->page,
782 (oaddr != xbp->addr))
785 - shortp = (__uint16_t *)xbp->page;
786 + shortp = (__uint_least16_t *)xbp->page;
788 /* set before __put_page */
789 oaddr = shortp[shortp[0] - 1];
790 diff -uNr newlib-1.15.0.orig/newlib/libc/search/hash.c newlib-1.15.0/newlib/libc/search/hash.c
791 --- newlib-1.15.0.orig/newlib/libc/search/hash.c 2004-05-26 19:57:10.000000000 +0200
792 +++ newlib-1.15.0/newlib/libc/search/hash.c 2007-04-13 10:41:47.000000000 +0200
793 @@ -628,10 +628,10 @@
796 BUFHEAD *bufp, *save_bufp;
798 + __uint_least16_t *bp;
799 int n, ndx, off, size;
802 + __uint_least16_t pageno;
804 #ifdef HASH_STATISTICS
808 /* Pin the bucket chain */
809 rbufp->flags |= BUF_PIN;
810 - for (bp = (__uint16_t *)rbufp->page, n = *bp++, ndx = 1; ndx < n;)
811 + for (bp = (__uint_least16_t *)rbufp->page, n = *bp++, ndx = 1; ndx < n;)
812 if (bp[1] >= REAL_KEY) {
813 /* Real key/data pair */
814 if (size == off - *bp &&
819 - bp = (__uint16_t *)rbufp->page;
820 + bp = (__uint_least16_t *)rbufp->page;
828 - bp = (__uint16_t *)rbufp->page;
829 + bp = (__uint_least16_t *)rbufp->page;
834 save_bufp->flags &= ~BUF_PIN;
837 - bp = (__uint16_t *)rbufp->page;
838 + bp = (__uint_least16_t *)rbufp->page;
839 if (bp[ndx + 1] < REAL_KEY) {
840 if (__big_return(hashp, rbufp, ndx, val, 0))
846 - __uint16_t *bp, ndx;
847 + __uint_least16_t *bp, ndx;
849 hashp = (HTAB *)dbp->internal;
850 if (flag && flag != R_FIRST && flag != R_NEXT) {
855 - bp = (__uint16_t *)bufp->page;
856 + bp = (__uint_least16_t *)bufp->page;
864 - bp = (__uint16_t *)hashp->cpage->page;
865 + bp = (__uint_least16_t *)hashp->cpage->page;
870 __get_buf(hashp, bp[hashp->cndx], bufp, 0);
873 - bp = (__uint16_t *)(bufp->page);
874 + bp = (__uint_least16_t *)(bufp->page);
878 diff -uNr newlib-1.15.0.orig/newlib/libc/search/hash.h newlib-1.15.0/newlib/libc/search/hash.h
879 --- newlib-1.15.0.orig/newlib/libc/search/hash.h 2002-07-02 20:18:58.000000000 +0200
880 +++ newlib-1.15.0/newlib/libc/search/hash.h 2007-04-13 10:41:47.000000000 +0200
882 #define NCACHED 32 /* number of bit maps and spare
884 int spares[NCACHED];/* spare pages for overflow */
885 - __uint16_t bitmaps[NCACHED]; /* address of overflow page
886 + __uint_least16_t bitmaps[NCACHED]; /* address of overflow page
890 diff -uNr newlib-1.15.0.orig/newlib/libc/search/hash_page.c newlib-1.15.0/newlib/libc/search/hash_page.c
891 --- newlib-1.15.0.orig/newlib/libc/search/hash_page.c 2002-09-19 23:28:51.000000000 +0200
892 +++ newlib-1.15.0/newlib/libc/search/hash_page.c 2007-04-13 10:41:47.000000000 +0200
894 static __uint32_t *fetch_bitmap(HTAB *, int);
895 static __uint32_t first_free(__uint32_t);
896 static int open_temp(HTAB *);
897 -static __uint16_t overflow_page(HTAB *);
898 +static __uint_least16_t overflow_page(HTAB *);
899 static void putpair(char *, const DBT *, const DBT *);
900 -static void squeeze_key(__uint16_t *, const DBT *, const DBT *);
901 +static void squeeze_key(__uint_least16_t *, const DBT *, const DBT *);
902 static int ugly_split
903 (HTAB *, __uint32_t, BUFHEAD *, BUFHEAD *, int, int);
905 #define PAGE_INIT(P) { \
906 - ((__uint16_t *)(P))[0] = 0; \
907 - ((__uint16_t *)(P))[1] = hashp->BSIZE - 3 * sizeof(__uint16_t); \
908 - ((__uint16_t *)(P))[2] = hashp->BSIZE; \
909 + ((__uint_least16_t *)(P))[0] = 0; \
910 + ((__uint_least16_t *)(P))[1] = hashp->BSIZE - 3 * sizeof(__uint_least16_t); \
911 + ((__uint_least16_t *)(P))[2] = hashp->BSIZE; \
917 const DBT *key, *val;
919 - __uint16_t *bp, n, off;
920 + __uint_least16_t *bp, n, off;
922 - bp = (__uint16_t *)p;
923 + bp = (__uint_least16_t *)p;
925 /* Enter the key first. */
929 /* Adjust page info. */
931 - bp[n + 1] = off - ((n + 3) * sizeof(__uint16_t));
932 + bp[n + 1] = off - ((n + 3) * sizeof(__uint_least16_t));
936 @@ -132,11 +132,11 @@
940 - __uint16_t *bp, newoff;
941 + __uint_least16_t *bp, newoff;
943 - __uint16_t pairlen;
944 + __uint_least16_t pairlen;
946 - bp = (__uint16_t *)bufp->page;
947 + bp = (__uint_least16_t *)bufp->page;
950 if (bp[ndx + 1] < REAL_KEY)
953 /* Finally adjust the page data */
954 bp[n] = OFFSET(bp) + pairlen;
955 - bp[n - 1] = bp[n + 1] + pairlen + 2 * sizeof(__uint16_t);
956 + bp[n - 1] = bp[n + 1] + pairlen + 2 * sizeof(__uint_least16_t);
960 @@ -185,15 +185,15 @@
961 __uint32_t obucket, nbucket;
963 BUFHEAD *new_bufp, *old_bufp;
965 + __uint_least16_t *ino;
969 - __uint16_t copyto, diff, off, moved;
970 + __uint_least16_t copyto, diff, off, moved;
973 - copyto = (__uint16_t)hashp->BSIZE;
974 - off = (__uint16_t)hashp->BSIZE;
975 + copyto = (__uint_least16_t)hashp->BSIZE;
976 + off = (__uint_least16_t)hashp->BSIZE;
977 old_bufp = __get_buf(hashp, obucket, NULL, 0);
978 if (old_bufp == NULL)
981 old_bufp->flags |= (BUF_MOD | BUF_PIN);
982 new_bufp->flags |= (BUF_MOD | BUF_PIN);
984 - ino = (__uint16_t *)(op = old_bufp->page);
985 + ino = (__uint_least16_t *)(op = old_bufp->page);
989 @@ -246,13 +246,13 @@
991 /* Now clean up the page */
993 - FREESPACE(ino) = copyto - sizeof(__uint16_t) * (ino[0] + 3);
994 + FREESPACE(ino) = copyto - sizeof(__uint_least16_t) * (ino[0] + 3);
995 OFFSET(ino) = copyto;
998 (void)fprintf(stderr, "split %d/%d\n",
999 - ((__uint16_t *)np)[0] / 2,
1000 - ((__uint16_t *)op)[0] / 2);
1001 + ((__uint_least16_t *)np)[0] / 2,
1002 + ((__uint_least16_t *)op)[0] / 2);
1004 /* unpin both pages */
1005 old_bufp->flags &= ~BUF_PIN;
1006 @@ -284,22 +284,22 @@
1007 int moved; /* Number of pairs moved to new page. */
1009 BUFHEAD *bufp; /* Buffer header for ino */
1010 - __uint16_t *ino; /* Page keys come off of */
1011 - __uint16_t *np; /* New page */
1012 - __uint16_t *op; /* Page keys go on to if they aren't moving */
1013 + __uint_least16_t *ino; /* Page keys come off of */
1014 + __uint_least16_t *np; /* New page */
1015 + __uint_least16_t *op; /* Page keys go on to if they aren't moving */
1017 BUFHEAD *last_bfp; /* Last buf header OVFL needing to be freed */
1020 - __uint16_t n, off, ov_addr, scopyto;
1021 + __uint_least16_t n, off, ov_addr, scopyto;
1022 char *cino; /* Character value of ino */
1025 - ino = (__uint16_t *)old_bufp->page;
1026 - np = (__uint16_t *)new_bufp->page;
1027 - op = (__uint16_t *)old_bufp->page;
1028 + ino = (__uint_least16_t *)old_bufp->page;
1029 + np = (__uint_least16_t *)new_bufp->page;
1030 + op = (__uint_least16_t *)old_bufp->page;
1032 - scopyto = (__uint16_t)copyto; /* ANSI */
1033 + scopyto = (__uint_least16_t)copyto; /* ANSI */
1036 while (n < ino[0]) {
1037 @@ -310,16 +310,16 @@
1038 old_bufp = ret.oldp;
1041 - op = (__uint16_t *)old_bufp->page;
1042 + op = (__uint_least16_t *)old_bufp->page;
1043 new_bufp = ret.newp;
1046 - np = (__uint16_t *)new_bufp->page;
1047 + np = (__uint_least16_t *)new_bufp->page;
1051 cino = (char *)bufp->page;
1052 - ino = (__uint16_t *)cino;
1053 + ino = (__uint_least16_t *)cino;
1054 last_bfp = ret.nextp;
1055 } else if (ino[n + 1] == OVFLPAGE) {
1057 @@ -329,14 +329,14 @@
1059 ino[0] -= (moved + 2);
1061 - scopyto - sizeof(__uint16_t) * (ino[0] + 3);
1062 + scopyto - sizeof(__uint_least16_t) * (ino[0] + 3);
1063 OFFSET(ino) = scopyto;
1065 bufp = __get_buf(hashp, ov_addr, bufp, 0);
1069 - ino = (__uint16_t *)bufp->page;
1070 + ino = (__uint_least16_t *)bufp->page;
1072 scopyto = hashp->BSIZE;
1075 __add_ovflpage(hashp, old_bufp);
1078 - op = (__uint16_t *)old_bufp->page;
1079 + op = (__uint_least16_t *)old_bufp->page;
1080 putpair((char *)op, &key, &val);
1082 old_bufp->flags |= BUF_MOD;
1084 __add_ovflpage(hashp, new_bufp);
1087 - np = (__uint16_t *)new_bufp->page;
1088 + np = (__uint_least16_t *)new_bufp->page;
1089 putpair((char *)np, &key, &val);
1091 new_bufp->flags |= BUF_MOD;
1092 @@ -402,10 +402,10 @@
1094 const DBT *key, *val;
1096 - __uint16_t *bp, *sop;
1097 + __uint_least16_t *bp, *sop;
1100 - bp = (__uint16_t *)bufp->page;
1101 + bp = (__uint_least16_t *)bufp->page;
1103 while (bp[0] && (bp[2] < REAL_KEY || bp[bp[0]] < REAL_KEY))
1104 /* Exception case */
1106 bufp = __get_buf(hashp, bp[bp[0] - 1], bufp, 0);
1109 - bp = (__uint16_t *)bufp->page;
1110 + bp = (__uint_least16_t *)bufp->page;
1112 /* Try to squeeze key on this page */
1113 if (FREESPACE(bp) > PAIRSIZE(key, val)) {
1115 bufp = __get_buf(hashp, bp[bp[0] - 1], bufp, 0);
1118 - bp = (__uint16_t *)bufp->page;
1119 + bp = (__uint_least16_t *)bufp->page;
1122 if (PAIRFITS(bp, key, val))
1124 bufp = __add_ovflpage(hashp, bufp);
1127 - sop = (__uint16_t *)bufp->page;
1128 + sop = (__uint_least16_t *)bufp->page;
1130 if (PAIRFITS(sop, key, val))
1131 putpair((char *)sop, key, val);
1132 @@ -468,12 +468,12 @@
1137 - __uint16_t ndx, ovfl_num;
1138 + __uint_least16_t *sp;
1139 + __uint_least16_t ndx, ovfl_num;
1143 - sp = (__uint16_t *)bufp->page;
1144 + sp = (__uint_least16_t *)bufp->page;
1146 /* Check if we are dynamically determining the fill factor */
1147 if (hashp->FFACTOR == DEF_FFACTOR) {
1153 + __uint_least16_t *bp;
1156 size = hashp->BSIZE;
1158 if ((lseek(fd, (off_t)page << hashp->BSHIFT, SEEK_SET) == -1) ||
1159 ((rsize = read(fd, p, size)) == -1))
1161 - bp = (__uint16_t *)p;
1162 + bp = (__uint_least16_t *)p;
1164 bp[0] = 0; /* We hit the EOF, so initialize a new page */
1167 for (i = 0; i < max; i++)
1168 M_32_SWAP(((int *)p)[i]);
1170 - max = ((__uint16_t *)p)[0] + 2;
1171 + max = ((__uint_least16_t *)p)[0] + 2;
1172 for (i = 0; i <= max; i++)
1173 - M_16_SWAP(((__uint16_t *)p)[i]);
1174 + M_16_SWAP(((__uint_least16_t *)p)[i]);
1179 hashp->BSIZE - clearbytes);
1180 ip[clearints - 1] = ALL_SET << (nbits & BYTE_MASK);
1182 - hashp->BITMAPS[ndx] = (__uint16_t)pnum;
1183 + hashp->BITMAPS[ndx] = (__uint_least16_t)pnum;
1184 hashp->mapp[ndx] = ip;
1187 @@ -663,13 +663,13 @@
1192 +static __uint_least16_t
1193 overflow_page(hashp)
1197 int max_free, offset, splitnum;
1199 + __uint_least16_t addr;
1200 int bit, first_page, free_bit, free_page, i, in_use_bits, j;
1203 @@ -816,16 +816,16 @@
1208 + __uint_least16_t addr;
1210 int bit_address, free_page, free_bit;
1212 + __uint_least16_t ndx;
1216 (void)fprintf(stderr, "Freeing %d\n", addr);
1218 - ndx = (((__uint16_t)addr) >> SPLITSHIFT);
1219 + ndx = (((__uint_least16_t)addr) >> SPLITSHIFT);
1221 (ndx ? hashp->SPARES[ndx - 1] : 0) + (addr & SPLITMASK) - 1;
1222 if (bit_address < hashp->LAST_FREED)
1223 @@ -883,11 +883,11 @@
1226 squeeze_key(sp, key, val)
1228 + __uint_least16_t *sp;
1229 const DBT *key, *val;
1232 - __uint16_t free_space, n, off, pageno;
1233 + __uint_least16_t free_space, n, off, pageno;
1237 diff -uNr newlib-1.15.0.orig/newlib/libc/search/page.h newlib-1.15.0/newlib/libc/search/page.h
1238 --- newlib-1.15.0.orig/newlib/libc/search/page.h 2002-06-20 21:51:31.000000000 +0200
1239 +++ newlib-1.15.0/newlib/libc/search/page.h 2007-04-13 10:41:47.000000000 +0200
1241 * You might as well do this up front.
1244 -#define PAIRSIZE(K,D) (2*sizeof(__uint16_t) + (K)->size + (D)->size)
1245 -#define BIGOVERHEAD (4*sizeof(__uint16_t))
1246 -#define KEYSIZE(K) (4*sizeof(__uint16_t) + (K)->size);
1247 -#define OVFLSIZE (2*sizeof(__uint16_t))
1248 +#define PAIRSIZE(K,D) (2*sizeof(__uint_least16_t) + (K)->size + (D)->size)
1249 +#define BIGOVERHEAD (4*sizeof(__uint_least16_t))
1250 +#define KEYSIZE(K) (4*sizeof(__uint_least16_t) + (K)->size);
1251 +#define OVFLSIZE (2*sizeof(__uint_least16_t))
1252 #define FREESPACE(P) ((P)[(P)[0]+1])
1253 #define OFFSET(P) ((P)[(P)[0]+2])
1254 #define PAIRFITS(P,K,D) \
1255 (((P)[2] >= REAL_KEY) && \
1256 (PAIRSIZE((K),(D)) + OVFLSIZE) <= FREESPACE((P)))
1257 -#define PAGE_META(N) (((N)+3) * sizeof(__uint16_t))
1258 +#define PAGE_META(N) (((N)+3) * sizeof(__uint_least16_t))
1264 - __uint16_t next_addr;
1265 + __uint_least16_t next_addr;
1267 diff -uNr newlib-1.15.0.orig/newlib/libc/sys/rtems/machine/stdint.h newlib-1.15.0/newlib/libc/sys/rtems/machine/stdint.h
1268 --- newlib-1.15.0.orig/newlib/libc/sys/rtems/machine/stdint.h 1970-01-01 01:00:00.000000000 +0100
1269 +++ newlib-1.15.0/newlib/libc/sys/rtems/machine/stdint.h 2007-04-13 10:41:47.000000000 +0200
1274 +#ifndef _MACHINE_STDINT_H
1275 +#define _MACHINE_STDINT_H
1278 +#error machine/stdint.h is an internal file and must not be directly included
1281 +#if defined(__sparc__) \
1282 + || defined(__powerpc__) || defined(__PPC__) \
1283 + || defined(__mips__) \
1284 + || defined(__sh__) \
1285 + || defined(__AVR__) \
1286 + || defined(_C4x) || defined(_C3x) \
1287 + || defined(__H8300__)
1288 +/* PTRDIFF_TYPE = int */
1289 +#define __ptrint_t_int_defined 1
1292 +#if defined(__i386__) \
1293 + || defined(__m68k__) \
1294 + || defined(__bfin__) \
1295 + || defined(__arm__) \
1296 + || defined(__H8300S__) || defined(__H8300H__)
1297 +/* PTRDIFF_TYPE = long */
1298 +#define __ptrint_t_long_defined 1
1302 diff -uNr newlib-1.15.0.orig/newlib/libc/sys/rtems/sys/param.h newlib-1.15.0/newlib/libc/sys/rtems/sys/param.h
1303 --- newlib-1.15.0.orig/newlib/libc/sys/rtems/sys/param.h 2004-05-07 22:29:24.000000000 +0200
1304 +++ newlib-1.15.0/newlib/libc/sys/rtems/sys/param.h 2007-04-13 10:41:47.000000000 +0200
1306 #include <sys/resource.h>
1307 #include <sys/ucred.h>
1308 #include <sys/uio.h>
1309 -#include <sys/rtprio.h>
1313 diff -uNr newlib-1.15.0.orig/newlib/Makefile.am newlib-1.15.0/newlib/Makefile.am
1314 --- newlib-1.15.0.orig/newlib/Makefile.am 2006-06-05 19:42:57.000000000 +0200
1315 +++ newlib-1.15.0/newlib/Makefile.am 2007-04-13 10:41:47.000000000 +0200
1320 -noinst_DATA = stmp-targ-include
1321 +BUILT_SOURCES = stmp-targ-include
1323 toollib_DATA = $(CRT0) $(CRT1)
1327 $(CRT1_DIR)$(CRT1): ; @true
1330 -all-recursive: stmp-targ-include
1332 # The targ-include directory just holds the includes files for the
1333 # particular system and machine we have been configured for. It is
1334 # used while building.
1335 diff -uNr newlib-1.15.0.orig/newlib/Makefile.in newlib-1.15.0/newlib/Makefile.in
1336 --- newlib-1.15.0.orig/newlib/Makefile.in 2006-12-18 21:32:41.000000000 +0100
1337 +++ newlib-1.15.0/newlib/Makefile.in 2007-04-13 10:41:47.000000000 +0200
1339 pdf-recursive ps-recursive uninstall-info-recursive \
1341 toollibDATA_INSTALL = $(INSTALL_DATA)
1342 -DATA = $(noinst_DATA) $(toollib_DATA)
1343 +DATA = $(toollib_DATA)
1346 DEJATOOL = $(PACKAGE)
1347 @@ -205,12 +205,7 @@
1348 USE_LIBTOOL_FALSE = @USE_LIBTOOL_FALSE@
1349 USE_LIBTOOL_TRUE = @USE_LIBTOOL_TRUE@
1351 -ac_ct_AR = @ac_ct_AR@
1352 -ac_ct_AS = @ac_ct_AS@
1353 ac_ct_CC = @ac_ct_CC@
1354 -ac_ct_RANLIB = @ac_ct_RANLIB@
1355 -ac_ct_READELF = @ac_ct_READELF@
1356 -ac_ct_STRIP = @ac_ct_STRIP@
1358 am__fastdepCC_FALSE = @am__fastdepCC_FALSE@
1359 am__fastdepCC_TRUE = @am__fastdepCC_TRUE@
1360 @@ -226,12 +221,16 @@
1361 build_os = @build_os@
1362 build_vendor = @build_vendor@
1364 +datarootdir = @datarootdir@
1367 exec_prefix = @exec_prefix@
1369 host_alias = @host_alias@
1370 host_cpu = @host_cpu@
1372 host_vendor = @host_vendor@
1373 +htmldir = @htmldir@
1374 includedir = @includedir@
1376 install_sh = @install_sh@
1379 libexecdir = @libexecdir@
1380 libm_machine_dir = @libm_machine_dir@
1381 +localedir = @localedir@
1382 localstatedir = @localstatedir@
1384 machine_dir = @machine_dir@
1385 @@ -248,8 +248,10 @@
1386 newlib_basedir = @newlib_basedir@
1388 oldincludedir = @oldincludedir@
1391 program_transform_name = @program_transform_name@
1394 sharedstatedir = @sharedstatedir@
1397 @USE_LIBTOOL_FALSE@toollib_LIBRARIES = libm.a \
1398 @USE_LIBTOOL_FALSE@ libc.a
1400 -noinst_DATA = stmp-targ-include
1401 +BUILT_SOURCES = stmp-targ-include
1402 toollib_DATA = $(CRT0) $(CRT1)
1404 # The functions ldexp, frexp and modf are traditionally supplied in
1410 +all: $(BUILT_SOURCES) newlib.h
1411 $(MAKE) $(AM_MAKEFLAGS) all-recursive
1414 @@ -687,14 +689,16 @@
1417 $(MAKE) $(AM_MAKEFLAGS) check-DEJAGNU
1418 -check: check-recursive
1419 +check: $(BUILT_SOURCES)
1420 + $(MAKE) $(AM_MAKEFLAGS) check-recursive
1421 all-am: Makefile $(LIBRARIES) $(LTLIBRARIES) $(DATA) newlib.h
1422 installdirs: installdirs-recursive
1424 for dir in "$(DESTDIR)$(toollibdir)" "$(DESTDIR)$(toollibdir)" "$(DESTDIR)$(toollibdir)"; do \
1425 test -z "$$dir" || $(mkdir_p) "$$dir"; \
1427 -install: install-recursive
1428 +install: $(BUILT_SOURCES)
1429 + $(MAKE) $(AM_MAKEFLAGS) install-recursive
1430 install-exec: install-exec-recursive
1431 install-data: install-data-recursive
1432 uninstall: uninstall-recursive
1434 maintainer-clean-generic:
1435 @echo "This command is intended for maintainers to use"
1436 @echo "it deletes files that may require special tools to rebuild."
1437 + -test -z "$(BUILT_SOURCES)" || rm -f $(BUILT_SOURCES)
1438 clean: clean-recursive
1440 clean-am: clean-generic clean-libtool clean-toollibLIBRARIES \
1443 $(CRT1_DIR)$(CRT1): ; @true
1445 -all-recursive: stmp-targ-include
1447 # The targ-include directory just holds the includes files for the
1448 # particular system and machine we have been configured for. It is
1449 # used while building.