]> rtime.felk.cvut.cz Git - rtems-devel.git/blob - newlib-patches/1.15.0/newlib-1.15.0-rtems4.8-20070413.diff
Update of the build and patches to rtems-4.7.1
[rtems-devel.git] / newlib-patches / 1.15.0 / newlib-1.15.0-rtems4.8-20070413.diff
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
4 @@ -242,9 +242,12 @@
5  #define SCNxMAX                __SCNMAX(x)
6  
7  /* ptr types */
8 -#if __have_longlong64
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)
17  #elif __have_long64
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
23 @@ -27,7 +27,7 @@
24  
25  /* necv70 was 9 as well. */
26  
27 -#ifdef __mc68000__
28 +#if defined(__m68k__) || defined(__mc68000__)
29  /*
30   * onsstack,sigmask,sp,pc,psl,d2-d7,a2-a6,
31   * fp2-fp7     for 68881.
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
35 @@ -393,6 +393,9 @@
36  #define UINTMAX_C(x)   x##UL
37  #endif
38  
39 +#ifdef __rtems__
40 +#include <machine/stdint.h>
41 +#endif
42  
43  #ifdef __cplusplus
44  }
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
48 @@ -148,6 +148,7 @@
49  #define ECASECLASH 137  /* Filename exists with different case */
50  #define EILSEQ 138
51  #define EOVERFLOW 139  /* Value too large for defined data type */
52 +#define ECANCELED 140  /* Operation canceled. */
53  
54  /* From cygwin32.  */
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
59 @@ -38,6 +38,7 @@
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
67 @@ -81,17 +82,89 @@
68  #endif
69  
70  #ifdef __CYGWIN__
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
85 +
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 */
164 +
165  #endif
166  
167  #ifdef __cplusplus
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
171 @@ -39,4 +39,7 @@
172  /* Iconv descriptor type */
173  typedef void *_iconv_t;
174  
175 +typedef long * __intptr_t;
176 +typedef unsigned long* __uintptr_t;
177 +
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
182 @@ -200,7 +200,7 @@
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));
191 @@ -212,7 +212,7 @@
192  int     _EXFUN(sync, (void));
193  #endif
194  #endif
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));
198  
199  #define        F_OK    0
200 @@ -231,63 +231,55 @@
201  #define STDERR_FILENO   2       /* standard error file descriptor */
202  
203  /*
204 - *  4.8.1 Get Configurable System Variables, P1003.1b-1993, p. 96
205 - *
206 - *  NOTE: Table 4-2, Configurable System Variables, p. 96
207 - */
208 -
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
233 -
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
251 -
252 -/*
253 - *  P1003.1c/D10, p. 52 adds the following.
254 + *  sysconf values per IEEE Std 1003.1, 2004 Edition
255   */
256  
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
303 -
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
311 -
312 -#if !defined(__rtems__)
313 -#define _SC_STREAM_MAX                 100
314 -#endif
315 -#if !defined(__CYGWIN__) && !defined(__rtems__)
316 -#define _SC_PRIORITY_SCHEDULING                101
317 -#endif
318 -  
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
347 +#define _SC_IPV6                         67
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
406 +
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
422  #ifdef __CYGWIN__
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
429  #endif
430  
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
435 @@ -226,6 +226,16 @@
436  
437  #endif
438  
439 +#if defined(_POSIX_MONOTONIC_CLOCK)
440 +
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. */
444 +
445 +#define CLOCK_MONOTONIC (clockid_t)4
446 +
447 +#endif
448 +
449  #if defined(_POSIX_CPUTIME)
450  
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
455 @@ -1,12 +0,0 @@
456 -/* ARM configuration file */
457 -
458 -#ifndef _MACHINE_ENDIAN_H
459 -# define _MACHINE_ENDIAN_H
460 -
461 -#ifdef __ARMEB__
462 -#define BYTE_ORDER BIG_ENDIAN
463 -#else
464 -#define BYTE_ORDER LITTLE_ENDIAN
465 -#endif
466 -
467 -#endif
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
471 @@ -50,7 +50,7 @@
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;
479  
480 @@ -191,12 +191,12 @@
481   *     P_16_COPY       swap from one location to another
482   */
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];                           \
488  }
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];                            \
494  }
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
498 @@ -48,7 +48,7 @@
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
510 @@ -92,13 +92,13 @@
511         BUFHEAD *bufp;
512         const DBT *key, *val;
513  {
514 -       __uint16_t *p;
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;
520  
521         cp = bufp->page;                /* Character pointer of p. */
522 -       p = (__uint16_t *)cp;
523 +       p = (__uint_least16_t *)cp;
524  
525         key_data = (char *)key->data;
526         key_size = key->size;
527 @@ -136,7 +136,7 @@
528                                 OFFSET(p) = off;
529                         } else
530                                 p[n - 2] = FULL_KEY;
531 -               p = (__uint16_t *)bufp->page;
532 +               p = (__uint_least16_t *)bufp->page;
533                 cp = bufp->page;
534                 bufp->flags |= BUF_MOD;
535         }
536 @@ -166,7 +166,7 @@
537                         if (!bufp)
538                                 return (-1);
539                         cp = bufp->page;
540 -                       p = (__uint16_t *)cp;
541 +                       p = (__uint_least16_t *)cp;
542                 } else
543                         p[n] = FULL_KEY_DATA;
544                 bufp->flags |= BUF_MOD;
545 @@ -191,12 +191,12 @@
546         BUFHEAD *bufp;
547  {
548         BUFHEAD *last_bfp, *rbufp;
549 -       __uint16_t *bp, pageno;
550 +       __uint_least16_t *bp, pageno;
551         int key_done, n;
552  
553         rbufp = bufp;
554         last_bfp = NULL;
555 -       bp = (__uint16_t *)bufp->page;
556 +       bp = (__uint_least16_t *)bufp->page;
557         pageno = 0;
558         key_done = 0;
559  
560 @@ -219,7 +219,7 @@
561                 last_bfp = rbufp;
562                 if (!rbufp)
563                         return (-1);            /* Error. */
564 -               bp = (__uint16_t *)rbufp->page;
565 +               bp = (__uint_least16_t *)rbufp->page;
566         }
567  
568         /*
569 @@ -234,7 +234,7 @@
570         pageno = bp[n - 1];
571  
572         /* Now, bp is the first page of the pair. */
573 -       bp = (__uint16_t *)bufp->page;
574 +       bp = (__uint_least16_t *)bufp->page;
575         if (n > 2) {
576                 /* There is an overflow page. */
577                 bp[1] = pageno;
578 @@ -272,13 +272,13 @@
579         char *key;
580         int size;
581  {
582 -       __uint16_t *bp;
583 +       __uint_least16_t *bp;
584         char *p;
585         int ksize;
586 -       __uint16_t bytes;
587 +       __uint_least16_t bytes;
588         char *kkey;
589  
590 -       bp = (__uint16_t *)bufp->page;
591 +       bp = (__uint_least16_t *)bufp->page;
592         p = bufp->page;
593         ksize = size;
594         kkey = key;
595 @@ -294,7 +294,7 @@
596                 if (!bufp)
597                         return (-3);
598                 p = bufp->page;
599 -               bp = (__uint16_t *)p;
600 +               bp = (__uint_least16_t *)p;
601                 ndx = 1;
602         }
603  
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
606   * bucket)
607   */
608 -extern __uint16_t
609 +extern __uint_least16_t
610  __find_last_page(hashp, bpp)
611         HTAB *hashp;
612         BUFHEAD **bpp;
613  {
614         BUFHEAD *bufp;
615 -       __uint16_t *bp, pageno;
616 +       __uint_least16_t *bp, pageno;
617         int n;
618  
619         bufp = *bpp;
620 -       bp = (__uint16_t *)bufp->page;
621 +       bp = (__uint_least16_t *)bufp->page;
622         for (;;) {
623                 n = bp[0];
624  
625 @@ -343,7 +343,7 @@
626                 bufp = __get_buf(hashp, pageno, bufp, 0);
627                 if (!bufp)
628                         return (0);     /* Need to indicate an error! */
629 -               bp = (__uint16_t *)bufp->page;
630 +               bp = (__uint_least16_t *)bufp->page;
631         }
632  
633         *bpp = bufp;
634 @@ -366,15 +366,15 @@
635         int set_current;
636  {
637         BUFHEAD *save_p;
638 -       __uint16_t *bp, len, off, save_addr;
639 +       __uint_least16_t *bp, len, off, save_addr;
640         char *tp;
641  
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);
646                 if (!bufp)
647                         return (-1);
648 -               bp = (__uint16_t *)bufp->page;
649 +               bp = (__uint_least16_t *)bufp->page;
650                 ndx = 1;
651         }
652  
653 @@ -382,7 +382,7 @@
654                 bufp = __get_buf(hashp, bp[bp[0] - 1], bufp, 0);
655                 if (!bufp)
656                         return (-1);
657 -               bp = (__uint16_t *)bufp->page;
658 +               bp = (__uint_least16_t *)bufp->page;
659                 save_p = bufp;
660                 save_addr = save_p->addr;
661                 off = bp[1];
662 @@ -403,7 +403,7 @@
663                         bufp = __get_buf(hashp, bp[bp[0] - 1], bufp, 0);
664                         if (!bufp)
665                                 return (-1);
666 -                       bp = (__uint16_t *)bufp->page;
667 +                       bp = (__uint_least16_t *)bufp->page;
668                 } else {
669                         /* The data is all on one page. */
670                         tp = (char *)bp;
671 @@ -422,7 +422,7 @@
672                                         if (!hashp->cpage)
673                                                 return (-1);
674                                         hashp->cndx = 1;
675 -                                       if (!((__uint16_t *)
676 +                                       if (!((__uint_least16_t *)
677                                             hashp->cpage->page)[0]) {
678                                                 hashp->cbucket++;
679                                                 hashp->cpage = NULL;
680 @@ -454,14 +454,14 @@
681         BUFHEAD *bufp;
682         int len, set;
683  {
684 -       __uint16_t *bp;
685 +       __uint_least16_t *bp;
686         char *p;
687         BUFHEAD *xbp;
688 -       __uint16_t save_addr;
689 +       __uint_least16_t save_addr;
690         int mylen, totlen;
691  
692         p = bufp->page;
693 -       bp = (__uint16_t *)p;
694 +       bp = (__uint_least16_t *)p;
695         mylen = hashp->BSIZE - bp[1];
696         save_addr = bufp->addr;
697  
698 @@ -481,7 +481,7 @@
699                                     __get_buf(hashp, bp[bp[0] - 1], bufp, 0);
700                                 if (!hashp->cpage)
701                                         return (-1);
702 -                               else if (!((__uint16_t *)hashp->cpage->page)[0]) {
703 +                               else if (!((__uint_least16_t *)hashp->cpage->page)[0]) {
704                                         hashp->cbucket++;
705                                         hashp->cpage = NULL;
706                                 }
707 @@ -533,10 +533,10 @@
708         BUFHEAD *xbp;
709         char *p;
710         int mylen, totlen;
711 -       __uint16_t *bp, save_addr;
712 +       __uint_least16_t *bp, save_addr;
713  
714         p = bufp->page;
715 -       bp = (__uint16_t *)p;
716 +       bp = (__uint_least16_t *)p;
717         mylen = hashp->BSIZE - bp[1];
718  
719         save_addr = bufp->addr;
720 @@ -579,11 +579,11 @@
721         SPLIT_RETURN *ret;
722  {
723         BUFHEAD *tmpp;
724 -       __uint16_t *tp;
725 +       __uint_least16_t *tp;
726         BUFHEAD *bp;
727         DBT key, val;
728         __uint32_t change;
729 -       __uint16_t free_space, n, off;
730 +       __uint_least16_t free_space, n, off;
731  
732         bp = big_keyp;
733  
734 @@ -615,14 +615,14 @@
735             (tmpp->ovfl ? tmpp->ovfl->addr : 0), (bp ? bp->addr : 0));
736  #endif
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;
740  #ifdef DEBUG
741         assert(FREESPACE(tp) >= OVFLSIZE);
742  #endif
743         n = tp[0];
744         off = OFFSET(tp);
745         free_space = FREESPACE(tp);
746 -       tp[++n] = (__uint16_t)addr;
747 +       tp[++n] = (__uint_least16_t)addr;
748         tp[++n] = OVFLPAGE;
749         tp[0] = n;
750         OFFSET(tp) = off;
751 @@ -638,7 +638,7 @@
752         ret->newp = np;
753         ret->oldp = op;
754  
755 -       tp = (__uint16_t *)big_keyp->page;
756 +       tp = (__uint_least16_t *)big_keyp->page;
757         big_keyp->flags |= BUF_MOD;
758         if (tp[0] > 2) {
759                 /*
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
763 @@ -176,7 +176,7 @@
764         BUFHEAD *next_xbp;
765         SEGMENT segp;
766         int segment_ndx;
767 -       __uint16_t oaddr, *shortp;
768 +       __uint_least16_t oaddr, *shortp;
769  
770         oaddr = 0;
771         bp = LRU;
772 @@ -212,7 +212,7 @@
773                          * Set oaddr before __put_page so that you get it
774                          * before bytes are swapped.
775                          */
776 -                       shortp = (__uint16_t *)bp->page;
777 +                       shortp = (__uint_least16_t *)bp->page;
778                         if (shortp[0])
779                                 oaddr = shortp[shortp[0] - 1];
780                         if ((bp->flags & BUF_MOD) && __put_page(hashp, bp->page,
781 @@ -255,7 +255,7 @@
782                                     (oaddr != xbp->addr))
783                                         break;
784  
785 -                               shortp = (__uint16_t *)xbp->page;
786 +                               shortp = (__uint_least16_t *)xbp->page;
787                                 if (shortp[0])
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 @@
794  {
795         BUFHEAD *rbufp;
796         BUFHEAD *bufp, *save_bufp;
797 -       __uint16_t *bp;
798 +       __uint_least16_t *bp;
799         int n, ndx, off, size;
800         char *kp;
801 -       __uint16_t pageno;
802 +       __uint_least16_t pageno;
803  
804  #ifdef HASH_STATISTICS
805         hash_accesses++;
806 @@ -647,7 +647,7 @@
807  
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 &&
815 @@ -666,7 +666,7 @@
816                                 return (ERROR);
817                         }
818                         /* FOR LOOP INIT */
819 -                       bp = (__uint16_t *)rbufp->page;
820 +                       bp = (__uint_least16_t *)rbufp->page;
821                         n = *bp++;
822                         ndx = 1;
823                         off = hashp->BSIZE;
824 @@ -688,7 +688,7 @@
825                                         return (ERROR);
826                                 }
827                                 /* FOR LOOP INIT */
828 -                               bp = (__uint16_t *)rbufp->page;
829 +                               bp = (__uint_least16_t *)rbufp->page;
830                                 n = *bp++;
831                                 ndx = 1;
832                                 off = hashp->BSIZE;
833 @@ -722,7 +722,7 @@
834                 save_bufp->flags &= ~BUF_PIN;
835                 return (ABNORMAL);
836         case HASH_GET:
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))
841                                 return (ERROR);
842 @@ -758,7 +758,7 @@
843         __uint32_t bucket;
844         BUFHEAD *bufp;
845         HTAB *hashp;
846 -       __uint16_t *bp, ndx;
847 +       __uint_least16_t *bp, ndx;
848  
849         hashp = (HTAB *)dbp->internal;
850         if (flag && flag != R_FIRST && flag != R_NEXT) {
851 @@ -783,7 +783,7 @@
852                                 if (!bufp)
853                                         return (ERROR);
854                                 hashp->cpage = bufp;
855 -                               bp = (__uint16_t *)bufp->page;
856 +                               bp = (__uint_least16_t *)bufp->page;
857                                 if (bp[0])
858                                         break;
859                         }
860 @@ -793,7 +793,7 @@
861                                 return (ABNORMAL);
862                         }
863                 } else
864 -                       bp = (__uint16_t *)hashp->cpage->page;
865 +                       bp = (__uint_least16_t *)hashp->cpage->page;
866  
867  #ifdef DEBUG
868                 assert(bp);
869 @@ -804,7 +804,7 @@
870                             __get_buf(hashp, bp[hashp->cndx], bufp, 0);
871                         if (!bufp)
872                                 return (ERROR);
873 -                       bp = (__uint16_t *)(bufp->page);
874 +                       bp = (__uint_least16_t *)(bufp->page);
875                         hashp->cndx = 1;
876                 }
877                 if (!bp[0]) {
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
881 @@ -102,7 +102,7 @@
882  #define NCACHED        32                      /* number of bit maps and spare 
883                                          * points */
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 
887                                                  * bitmaps */
888  } HASHHDR;
889  
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
893 @@ -77,16 +77,16 @@
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);
904  
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; \
912  }
913  
914  /*
915 @@ -99,9 +99,9 @@
916         char *p;
917         const DBT *key, *val;
918  {
919 -       __uint16_t *bp, n, off;
920 +       __uint_least16_t *bp, n, off;
921  
922 -       bp = (__uint16_t *)p;
923 +       bp = (__uint_least16_t *)p;
924  
925         /* Enter the key first. */
926         n = bp[0];
927 @@ -117,7 +117,7 @@
928  
929         /* Adjust page info. */
930         bp[0] = n;
931 -       bp[n + 1] = off - ((n + 3) * sizeof(__uint16_t));
932 +       bp[n + 1] = off - ((n + 3) * sizeof(__uint_least16_t));
933         bp[n + 2] = off;
934  }
935  
936 @@ -132,11 +132,11 @@
937         BUFHEAD *bufp;
938         int ndx;
939  {
940 -       __uint16_t *bp, newoff;
941 +       __uint_least16_t *bp, newoff;
942         int n;
943 -       __uint16_t pairlen;
944 +       __uint_least16_t pairlen;
945  
946 -       bp = (__uint16_t *)bufp->page;
947 +       bp = (__uint_least16_t *)bufp->page;
948         n = bp[0];
949  
950         if (bp[ndx + 1] < REAL_KEY)
951 @@ -167,7 +167,7 @@
952         }
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);
957         bp[0] = n - 2;
958         hashp->NKEYS--;
959  
960 @@ -185,15 +185,15 @@
961         __uint32_t obucket, nbucket;
962  {
963         BUFHEAD *new_bufp, *old_bufp;
964 -       __uint16_t *ino;
965 +       __uint_least16_t *ino;
966         char *np;
967         DBT key, val;
968         int n, ndx, retval;
969 -       __uint16_t copyto, diff, off, moved;
970 +       __uint_least16_t copyto, diff, off, moved;
971         char *op;
972  
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)
979                 return (-1);
980 @@ -204,7 +204,7 @@
981         old_bufp->flags |= (BUF_MOD | BUF_PIN);
982         new_bufp->flags |= (BUF_MOD | BUF_PIN);
983  
984 -       ino = (__uint16_t *)(op = old_bufp->page);
985 +       ino = (__uint_least16_t *)(op = old_bufp->page);
986         np = new_bufp->page;
987  
988         moved = 0;
989 @@ -246,13 +246,13 @@
990  
991         /* Now clean up the page */
992         ino[0] -= moved;
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;
996  
997  #ifdef DEBUG3
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);
1003  #endif
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. */
1008  {
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 */
1016  
1017         BUFHEAD *last_bfp;      /* Last buf header OVFL needing to be freed */
1018         DBT key, val;
1019         SPLIT_RETURN ret;
1020 -       __uint16_t n, off, ov_addr, scopyto;
1021 +       __uint_least16_t n, off, ov_addr, scopyto;
1022         char *cino;             /* Character value of ino */
1023  
1024         bufp = old_bufp;
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;
1031         last_bfp = NULL;
1032 -       scopyto = (__uint16_t)copyto;   /* ANSI */
1033 +       scopyto = (__uint_least16_t)copyto;     /* ANSI */
1034  
1035         n = ino[0] - 1;
1036         while (n < ino[0]) {
1037 @@ -310,16 +310,16 @@
1038                         old_bufp = ret.oldp;
1039                         if (!old_bufp)
1040                                 return (-1);
1041 -                       op = (__uint16_t *)old_bufp->page;
1042 +                       op = (__uint_least16_t *)old_bufp->page;
1043                         new_bufp = ret.newp;
1044                         if (!new_bufp)
1045                                 return (-1);
1046 -                       np = (__uint16_t *)new_bufp->page;
1047 +                       np = (__uint_least16_t *)new_bufp->page;
1048                         bufp = ret.nextp;
1049                         if (!bufp)
1050                                 return (0);
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) {
1056                         ov_addr = ino[n];
1057 @@ -329,14 +329,14 @@
1058                          */
1059                         ino[0] -= (moved + 2);
1060                         FREESPACE(ino) =
1061 -                           scopyto - sizeof(__uint16_t) * (ino[0] + 3);
1062 +                           scopyto - sizeof(__uint_least16_t) * (ino[0] + 3);
1063                         OFFSET(ino) = scopyto;
1064  
1065                         bufp = __get_buf(hashp, ov_addr, bufp, 0);
1066                         if (!bufp)
1067                                 return (-1);
1068  
1069 -                       ino = (__uint16_t *)bufp->page;
1070 +                       ino = (__uint_least16_t *)bufp->page;
1071                         n = 1;
1072                         scopyto = hashp->BSIZE;
1073                         moved = 0;
1074 @@ -364,7 +364,7 @@
1075                                             __add_ovflpage(hashp, old_bufp);
1076                                         if (!old_bufp)
1077                                                 return (-1);
1078 -                                       op = (__uint16_t *)old_bufp->page;
1079 +                                       op = (__uint_least16_t *)old_bufp->page;
1080                                         putpair((char *)op, &key, &val);
1081                                 }
1082                                 old_bufp->flags |= BUF_MOD;
1083 @@ -377,7 +377,7 @@
1084                                             __add_ovflpage(hashp, new_bufp);
1085                                         if (!new_bufp)
1086                                                 return (-1);
1087 -                                       np = (__uint16_t *)new_bufp->page;
1088 +                                       np = (__uint_least16_t *)new_bufp->page;
1089                                         putpair((char *)np, &key, &val);
1090                                 }
1091                                 new_bufp->flags |= BUF_MOD;
1092 @@ -402,10 +402,10 @@
1093         BUFHEAD *bufp;
1094         const DBT *key, *val;
1095  {
1096 -       __uint16_t *bp, *sop;
1097 +       __uint_least16_t *bp, *sop;
1098         int do_expand;
1099  
1100 -       bp = (__uint16_t *)bufp->page;
1101 +       bp = (__uint_least16_t *)bufp->page;
1102         do_expand = 0;
1103         while (bp[0] && (bp[2] < REAL_KEY || bp[bp[0]] < REAL_KEY))
1104                 /* Exception case */
1105 @@ -417,7 +417,7 @@
1106                         bufp = __get_buf(hashp, bp[bp[0] - 1], bufp, 0);
1107                         if (!bufp)
1108                                 return (-1);
1109 -                       bp = (__uint16_t *)bufp->page;
1110 +                       bp = (__uint_least16_t *)bufp->page;
1111                 } else
1112                         /* Try to squeeze key on this page */
1113                         if (FREESPACE(bp) > PAIRSIZE(key, val)) {
1114 @@ -427,7 +427,7 @@
1115                                 bufp = __get_buf(hashp, bp[bp[0] - 1], bufp, 0);
1116                                 if (!bufp)
1117                                         return (-1);
1118 -                               bp = (__uint16_t *)bufp->page;
1119 +                               bp = (__uint_least16_t *)bufp->page;
1120                         }
1121  
1122         if (PAIRFITS(bp, key, val))
1123 @@ -437,7 +437,7 @@
1124                 bufp = __add_ovflpage(hashp, bufp);
1125                 if (!bufp)
1126                         return (-1);
1127 -               sop = (__uint16_t *)bufp->page;
1128 +               sop = (__uint_least16_t *)bufp->page;
1129  
1130                 if (PAIRFITS(sop, key, val))
1131                         putpair((char *)sop, key, val);
1132 @@ -468,12 +468,12 @@
1133         HTAB *hashp;
1134         BUFHEAD *bufp;
1135  {
1136 -       __uint16_t *sp;
1137 -       __uint16_t ndx, ovfl_num;
1138 +       __uint_least16_t *sp;
1139 +       __uint_least16_t ndx, ovfl_num;
1140  #ifdef DEBUG1
1141         int tmp1, tmp2;
1142  #endif
1143 -       sp = (__uint16_t *)bufp->page;
1144 +       sp = (__uint_least16_t *)bufp->page;
1145  
1146         /* Check if we are dynamically determining the fill factor */
1147         if (hashp->FFACTOR == DEF_FFACTOR) {
1148 @@ -525,7 +525,7 @@
1149  {
1150         int fd, page, size;
1151         int rsize;
1152 -       __uint16_t *bp;
1153 +       __uint_least16_t *bp;
1154  
1155         fd = hashp->fp;
1156         size = hashp->BSIZE;
1157 @@ -541,7 +541,7 @@
1158         if ((lseek(fd, (off_t)page << hashp->BSHIFT, SEEK_SET) == -1) ||
1159             ((rsize = read(fd, p, size)) == -1))
1160                 return (-1);
1161 -       bp = (__uint16_t *)p;
1162 +       bp = (__uint_least16_t *)p;
1163         if (!rsize)
1164                 bp[0] = 0;      /* We hit the EOF, so initialize a new page */
1165         else
1166 @@ -600,9 +600,9 @@
1167                         for (i = 0; i < max; i++)
1168                                 M_32_SWAP(((int *)p)[i]);
1169                 } else {
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]);
1175                 }
1176         }
1177         if (is_bucket)
1178 @@ -643,7 +643,7 @@
1179             hashp->BSIZE - clearbytes);
1180         ip[clearints - 1] = ALL_SET << (nbits & BYTE_MASK);
1181         SETBIT(ip, 0);
1182 -       hashp->BITMAPS[ndx] = (__uint16_t)pnum;
1183 +       hashp->BITMAPS[ndx] = (__uint_least16_t)pnum;
1184         hashp->mapp[ndx] = ip;
1185         return (0);
1186  }
1187 @@ -663,13 +663,13 @@
1188         return (i);
1189  }
1190  
1191 -static __uint16_t
1192 +static __uint_least16_t
1193  overflow_page(hashp)
1194         HTAB *hashp;
1195  {
1196         __uint32_t *freep;
1197         int max_free, offset, splitnum;
1198 -       __uint16_t addr;
1199 +       __uint_least16_t addr;
1200         int bit, first_page, free_bit, free_page, i, in_use_bits, j;
1201  #ifdef DEBUG2
1202         int tmp1, tmp2;
1203 @@ -816,16 +816,16 @@
1204         HTAB *hashp;
1205         BUFHEAD *obufp;
1206  {
1207 -       __uint16_t addr;
1208 +       __uint_least16_t addr;
1209         __uint32_t *freep;
1210         int bit_address, free_page, free_bit;
1211 -       __uint16_t ndx;
1212 +       __uint_least16_t ndx;
1213  
1214         addr = obufp->addr;
1215  #ifdef DEBUG1
1216         (void)fprintf(stderr, "Freeing %d\n", addr);
1217  #endif
1218 -       ndx = (((__uint16_t)addr) >> SPLITSHIFT);
1219 +       ndx = (((__uint_least16_t)addr) >> SPLITSHIFT);
1220         bit_address =
1221             (ndx ? hashp->SPARES[ndx - 1] : 0) + (addr & SPLITMASK) - 1;
1222          if (bit_address < hashp->LAST_FREED)
1223 @@ -883,11 +883,11 @@
1224   */
1225  static void
1226  squeeze_key(sp, key, val)
1227 -       __uint16_t *sp;
1228 +       __uint_least16_t *sp;
1229         const DBT *key, *val;
1230  {
1231         char *p;
1232 -       __uint16_t free_space, n, off, pageno;
1233 +       __uint_least16_t free_space, n, off, pageno;
1234  
1235         p = (char *)sp;
1236         n = sp[0];
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
1240 @@ -74,20 +74,20 @@
1241   * You might as well do this up front.
1242   */
1243  
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))
1259  
1260  typedef struct {
1261         BUFHEAD *newp;
1262         BUFHEAD *oldp;
1263         BUFHEAD *nextp;
1264 -       __uint16_t next_addr;
1265 +       __uint_least16_t next_addr;
1266  }       SPLIT_RETURN;
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
1270 @@ -0,0 +1,31 @@
1271 +/*
1272 + *
1273 + */
1274 +#ifndef _MACHINE_STDINT_H
1275 +#define _MACHINE_STDINT_H
1276 +
1277 +#ifndef _STDINT_H
1278 +#error machine/stdint.h is an internal file and  must not be directly included
1279 +#endif
1280 +
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
1290 +#endif
1291 +
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
1299 +#endif
1300 +
1301 +#endif
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
1305 @@ -93,7 +93,6 @@
1306  #include <sys/resource.h>
1307  #include <sys/ucred.h>
1308  #include <sys/uio.h>
1309 -#include <sys/rtprio.h>
1310  
1311  #ifndef FALSE
1312  #define        FALSE   0
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
1316 @@ -81,7 +81,7 @@
1317         libc.a
1318  endif
1319  
1320 -noinst_DATA = stmp-targ-include
1321 +BUILT_SOURCES = stmp-targ-include
1322  
1323  toollib_DATA = $(CRT0) $(CRT1)
1324  
1325 @@ -186,9 +186,6 @@
1326  
1327  $(CRT1_DIR)$(CRT1): ; @true
1328  
1329 -
1330 -all-recursive: stmp-targ-include
1331 -
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
1338 @@ -103,7 +103,7 @@
1339         pdf-recursive ps-recursive uninstall-info-recursive \
1340         uninstall-recursive
1341  toollibDATA_INSTALL = $(INSTALL_DATA)
1342 -DATA = $(noinst_DATA) $(toollib_DATA)
1343 +DATA = $(toollib_DATA)
1344  ETAGS = etags
1345  CTAGS = ctags
1346  DEJATOOL = $(PACKAGE)
1347 @@ -205,12 +205,7 @@
1348  USE_LIBTOOL_FALSE = @USE_LIBTOOL_FALSE@
1349  USE_LIBTOOL_TRUE = @USE_LIBTOOL_TRUE@
1350  VERSION = @VERSION@
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@
1357  aext = @aext@
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@
1363  datadir = @datadir@
1364 +datarootdir = @datarootdir@
1365 +docdir = @docdir@
1366 +dvidir = @dvidir@
1367  exec_prefix = @exec_prefix@
1368  host = @host@
1369  host_alias = @host_alias@
1370  host_cpu = @host_cpu@
1371  host_os = @host_os@
1372  host_vendor = @host_vendor@
1373 +htmldir = @htmldir@
1374  includedir = @includedir@
1375  infodir = @infodir@
1376  install_sh = @install_sh@
1377 @@ -240,6 +239,7 @@
1378  libdir = @libdir@
1379  libexecdir = @libexecdir@
1380  libm_machine_dir = @libm_machine_dir@
1381 +localedir = @localedir@
1382  localstatedir = @localstatedir@
1383  lpfx = @lpfx@
1384  machine_dir = @machine_dir@
1385 @@ -248,8 +248,10 @@
1386  newlib_basedir = @newlib_basedir@
1387  oext = @oext@
1388  oldincludedir = @oldincludedir@
1389 +pdfdir = @pdfdir@
1390  prefix = @prefix@
1391  program_transform_name = @program_transform_name@
1392 +psdir = @psdir@
1393  sbindir = @sbindir@
1394  sharedstatedir = @sharedstatedir@
1395  subdirs = @subdirs@
1396 @@ -323,7 +325,7 @@
1397  @USE_LIBTOOL_FALSE@toollib_LIBRARIES = libm.a \
1398  @USE_LIBTOOL_FALSE@    libc.a
1399  
1400 -noinst_DATA = stmp-targ-include
1401 +BUILT_SOURCES = stmp-targ-include
1402  toollib_DATA = $(CRT0) $(CRT1)
1403  
1404  # The functions ldexp, frexp and modf are traditionally supplied in
1405 @@ -382,7 +384,7 @@
1406  
1407  # dejagnu support
1408  RUNTESTFLAGS = 
1409 -all: newlib.h
1410 +all: $(BUILT_SOURCES) newlib.h
1411         $(MAKE) $(AM_MAKEFLAGS) all-recursive
1412  
1413  .SUFFIXES:
1414 @@ -687,14 +689,16 @@
1415         done
1416  check-am:
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
1423  installdirs-am:
1424         for dir in "$(DESTDIR)$(toollibdir)" "$(DESTDIR)$(toollibdir)" "$(DESTDIR)$(toollibdir)"; do \
1425           test -z "$$dir" || $(mkdir_p) "$$dir"; \
1426         done
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
1433 @@ -719,6 +723,7 @@
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
1439  
1440  clean-am: clean-generic clean-libtool clean-toollibLIBRARIES \
1441 @@ -837,8 +842,6 @@
1442  
1443  $(CRT1_DIR)$(CRT1): ; @true
1444  
1445 -all-recursive: stmp-targ-include
1446 -
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.