source: rtems/contrib/crossrpms/patches/newlib-1.15.0-rtems4.8-20070804.diff @ b39173b0

4.104.114.84.95
Last change on this file since b39173b0 was b39173b0, checked in by Ralf Corsepius <ralf.corsepius@…>, on 08/04/07 at 04:34:30

Add tar.h.

  • Property mode set to 100644
File size: 47.1 KB
RevLine 
[b39173b0]1diff -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-08-04 06:32:17.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)
20diff -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-08-04 06:32:17.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.
32diff -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-08-04 06:32:17.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 }
45diff -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-08-04 06:32:17.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 */
56diff -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-08-04 06:32:17.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
168diff -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-08-04 06:32:17.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 */
179diff -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-08-04 06:32:17.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.  */
432diff -uNr newlib-1.15.0.orig/newlib/libc/include/tar.h newlib-1.15.0/newlib/libc/include/tar.h
433--- newlib-1.15.0.orig/newlib/libc/include/tar.h        1970-01-01 01:00:00.000000000 +0100
434+++ newlib-1.15.0/newlib/libc/include/tar.h     2007-08-04 06:32:17.000000000 +0200
435@@ -0,0 +1,39 @@
436+/*
437+ * tar.h
438+ */
439+
440+#ifndef _TAR_H
441+#define _TAR_H
442+
443+/* General definitions */
444+#define TMAGIC                 "ustar" /* ustar plus null byte. */
445+#define TMAGLEN        6       /* Length of the above. */
446+#define TVERSION       "00"    /* 00 without a null byte. */
447+#define TVERSLEN       2       /* Length of the above. */
448+
449+/* Typeflag field definitions */
450+#define REGTYPE        '0'     /* Regular file. */
451+#define AREGTYPE       '\0'    /* Regular file. */
452+#define LNKTYPE                '1'     /* Link. */
453+#define SYMTYPE                '2'     /* Symbolic link. */
454+#define CHRTYPE                '3'     /* Character special. */
455+#define BLKTYPE                '4'     /* Block special. */
456+#define DIRTYPE                '5'     /* Directory. */
457+#define FIFOTYPE       '6'     /* FIFO special. */
458+#define CONTTYPE       '7'     /* Reserved. */
459+
460+/* Mode field bit definitions (octal) */
461+#define        TSUID           04000   /* Set UID on execution. */
462+#define        TSGID           02000   /* Set GID on execution. */
463+#define        TSVTX           01000   /* On directories, restricted deletion flag. */
464+#define        TUREAD          00400   /* Read by owner. */
465+#define        TUWRITE         00200   /* Write by owner. */
466+#define        TUEXEC          00100   /* Execute/search by owner. */
467+#define        TGREAD          00040   /* Read by group. */
468+#define        TGWRITE         00020   /* Write by group. */
469+#define        TGEXEC          00010   /* Execute/search by group. */
470+#define        TOREAD          00004   /* Read by other. */
471+#define        TOWRITE         00002   /* Write by other. */
472+#define        TOEXEC          00001   /* Execute/search by other. */
473+
474+#endif
475diff -uNr newlib-1.15.0.orig/newlib/libc/include/time.h newlib-1.15.0/newlib/libc/include/time.h
476--- newlib-1.15.0.orig/newlib/libc/include/time.h       2005-11-18 16:57:24.000000000 +0100
477+++ newlib-1.15.0/newlib/libc/include/time.h    2007-08-04 06:32:17.000000000 +0200
478@@ -226,6 +226,16 @@
479 
480 #endif
481 
482+#if defined(_POSIX_MONOTONIC_CLOCK)
483+
484+/*  The identifier for the system-wide monotonic clock, which is defined
485+    as a clock whose value cannot be set via clock_settime() and which
486+    cannot have backward clock jumps. */
487+
488+#define CLOCK_MONOTONIC (clockid_t)4
489+
490+#endif
491+
492 #if defined(_POSIX_CPUTIME)
493 
494 /* Accessing a Process CPU-time CLock, P1003.4b/D8, p. 55 */
495diff -uNr newlib-1.15.0.orig/newlib/libc/machine/arm/machine/endian.h newlib-1.15.0/newlib/libc/machine/arm/machine/endian.h
496--- newlib-1.15.0.orig/newlib/libc/machine/arm/machine/endian.h 2004-05-07 22:29:24.000000000 +0200
497+++ newlib-1.15.0/newlib/libc/machine/arm/machine/endian.h      1970-01-01 01:00:00.000000000 +0100
498@@ -1,12 +0,0 @@
499-/* ARM configuration file */
500-
501-#ifndef _MACHINE_ENDIAN_H
502-# define _MACHINE_ENDIAN_H
503-
504-#ifdef __ARMEB__
505-#define BYTE_ORDER BIG_ENDIAN
506-#else
507-#define BYTE_ORDER LITTLE_ENDIAN
508-#endif
509-
510-#endif
511diff -uNr newlib-1.15.0.orig/newlib/libc/search/db_local.h newlib-1.15.0/newlib/libc/search/db_local.h
512--- newlib-1.15.0.orig/newlib/libc/search/db_local.h    2002-06-25 01:05:08.000000000 +0200
513+++ newlib-1.15.0/newlib/libc/search/db_local.h 2007-08-04 06:32:17.000000000 +0200
514@@ -50,7 +50,7 @@
515 #define        MAX_PAGE_NUMBER 0xffffffff      /* >= # of pages in a file */
516 typedef __uint32_t     pgno_t;
517 #define        MAX_PAGE_OFFSET 65535           /* >= # of bytes in a page */
518-typedef __uint16_t     indx_t;
519+typedef __uint_least16_t       indx_t;
520 #define        MAX_REC_NUMBER  0xffffffff      /* >= # of records in a tree */
521 typedef __uint32_t     recno_t;
522 
523@@ -191,12 +191,12 @@
524  *     P_16_COPY       swap from one location to another
525  */
526 #define        M_16_SWAP(a) {                                                  \
527-       __uint16_t _tmp = a;                                            \
528+       __uint_least16_t _tmp = a;                                              \
529        ((char *)&a)[0] = ((char *)&_tmp)[1];                           \
530        ((char *)&a)[1] = ((char *)&_tmp)[0];                           \
531 }
532 #define        P_16_SWAP(a) {                                                  \
533-       __uint16_t _tmp = *(__uint16_t *)a;                             \
534+       __uint_least16_t _tmp = *(__uint_least16_t *)a;                         \
535        ((char *)a)[0] = ((char *)&_tmp)[1];                            \
536        ((char *)a)[1] = ((char *)&_tmp)[0];                            \
537 }
538diff -uNr newlib-1.15.0.orig/newlib/libc/search/extern.h newlib-1.15.0/newlib/libc/search/extern.h
539--- newlib-1.15.0.orig/newlib/libc/search/extern.h      2002-06-20 21:51:31.000000000 +0200
540+++ newlib-1.15.0/newlib/libc/search/extern.h   2007-08-04 06:32:17.000000000 +0200
541@@ -48,7 +48,7 @@
542 int     __delpair(HTAB *, BUFHEAD *, int);
543 int     __expand_table(HTAB *);
544 int     __find_bigpair(HTAB *, BUFHEAD *, int, char *, int);
545-__uint16_t      __find_last_page(HTAB *, BUFHEAD **);
546+__uint_least16_t        __find_last_page(HTAB *, BUFHEAD **);
547 void    __free_ovflpage(HTAB *, BUFHEAD *);
548 BUFHEAD        *__get_buf(HTAB *, __uint32_t, BUFHEAD *, int);
549 int     __get_page(HTAB *, char *, __uint32_t, int, int, int);
550diff -uNr newlib-1.15.0.orig/newlib/libc/search/hash_bigkey.c newlib-1.15.0/newlib/libc/search/hash_bigkey.c
551--- newlib-1.15.0.orig/newlib/libc/search/hash_bigkey.c 2006-06-07 21:22:59.000000000 +0200
552+++ newlib-1.15.0/newlib/libc/search/hash_bigkey.c      2007-08-04 06:32:17.000000000 +0200
553@@ -92,13 +92,13 @@
554        BUFHEAD *bufp;
555        const DBT *key, *val;
556 {
557-       __uint16_t *p;
558+       __uint_least16_t *p;
559        int key_size, n, val_size;
560-       __uint16_t space, move_bytes, off;
561+       __uint_least16_t space, move_bytes, off;
562        char *cp, *key_data, *val_data;
563 
564        cp = bufp->page;                /* Character pointer of p. */
565-       p = (__uint16_t *)cp;
566+       p = (__uint_least16_t *)cp;
567 
568        key_data = (char *)key->data;
569        key_size = key->size;
570@@ -136,7 +136,7 @@
571                                OFFSET(p) = off;
572                        } else
573                                p[n - 2] = FULL_KEY;
574-               p = (__uint16_t *)bufp->page;
575+               p = (__uint_least16_t *)bufp->page;
576                cp = bufp->page;
577                bufp->flags |= BUF_MOD;
578        }
579@@ -166,7 +166,7 @@
580                        if (!bufp)
581                                return (-1);
582                        cp = bufp->page;
583-                       p = (__uint16_t *)cp;
584+                       p = (__uint_least16_t *)cp;
585                } else
586                        p[n] = FULL_KEY_DATA;
587                bufp->flags |= BUF_MOD;
588@@ -191,12 +191,12 @@
589        BUFHEAD *bufp;
590 {
591        BUFHEAD *last_bfp, *rbufp;
592-       __uint16_t *bp, pageno;
593+       __uint_least16_t *bp, pageno;
594        int key_done, n;
595 
596        rbufp = bufp;
597        last_bfp = NULL;
598-       bp = (__uint16_t *)bufp->page;
599+       bp = (__uint_least16_t *)bufp->page;
600        pageno = 0;
601        key_done = 0;
602 
603@@ -219,7 +219,7 @@
604                last_bfp = rbufp;
605                if (!rbufp)
606                        return (-1);            /* Error. */
607-               bp = (__uint16_t *)rbufp->page;
608+               bp = (__uint_least16_t *)rbufp->page;
609        }
610 
611        /*
612@@ -234,7 +234,7 @@
613        pageno = bp[n - 1];
614 
615        /* Now, bp is the first page of the pair. */
616-       bp = (__uint16_t *)bufp->page;
617+       bp = (__uint_least16_t *)bufp->page;
618        if (n > 2) {
619                /* There is an overflow page. */
620                bp[1] = pageno;
621@@ -272,13 +272,13 @@
622        char *key;
623        int size;
624 {
625-       __uint16_t *bp;
626+       __uint_least16_t *bp;
627        char *p;
628        int ksize;
629-       __uint16_t bytes;
630+       __uint_least16_t bytes;
631        char *kkey;
632 
633-       bp = (__uint16_t *)bufp->page;
634+       bp = (__uint_least16_t *)bufp->page;
635        p = bufp->page;
636        ksize = size;
637        kkey = key;
638@@ -294,7 +294,7 @@
639                if (!bufp)
640                        return (-3);
641                p = bufp->page;
642-               bp = (__uint16_t *)p;
643+               bp = (__uint_least16_t *)p;
644                ndx = 1;
645        }
646 
647@@ -316,17 +316,17 @@
648  * of the pair; 0 if there isn't any (i.e. big pair is the last key in the
649  * bucket)
650  */
651-extern __uint16_t
652+extern __uint_least16_t
653 __find_last_page(hashp, bpp)
654        HTAB *hashp;
655        BUFHEAD **bpp;
656 {
657        BUFHEAD *bufp;
658-       __uint16_t *bp, pageno;
659+       __uint_least16_t *bp, pageno;
660        int n;
661 
662        bufp = *bpp;
663-       bp = (__uint16_t *)bufp->page;
664+       bp = (__uint_least16_t *)bufp->page;
665        for (;;) {
666                n = bp[0];
667 
668@@ -343,7 +343,7 @@
669                bufp = __get_buf(hashp, pageno, bufp, 0);
670                if (!bufp)
671                        return (0);     /* Need to indicate an error! */
672-               bp = (__uint16_t *)bufp->page;
673+               bp = (__uint_least16_t *)bufp->page;
674        }
675 
676        *bpp = bufp;
677@@ -366,15 +366,15 @@
678        int set_current;
679 {
680        BUFHEAD *save_p;
681-       __uint16_t *bp, len, off, save_addr;
682+       __uint_least16_t *bp, len, off, save_addr;
683        char *tp;
684 
685-       bp = (__uint16_t *)bufp->page;
686+       bp = (__uint_least16_t *)bufp->page;
687        while (bp[ndx + 1] == PARTIAL_KEY) {
688                bufp = __get_buf(hashp, bp[bp[0] - 1], bufp, 0);
689                if (!bufp)
690                        return (-1);
691-               bp = (__uint16_t *)bufp->page;
692+               bp = (__uint_least16_t *)bufp->page;
693                ndx = 1;
694        }
695 
696@@ -382,7 +382,7 @@
697                bufp = __get_buf(hashp, bp[bp[0] - 1], bufp, 0);
698                if (!bufp)
699                        return (-1);
700-               bp = (__uint16_t *)bufp->page;
701+               bp = (__uint_least16_t *)bufp->page;
702                save_p = bufp;
703                save_addr = save_p->addr;
704                off = bp[1];
705@@ -403,7 +403,7 @@
706                        bufp = __get_buf(hashp, bp[bp[0] - 1], bufp, 0);
707                        if (!bufp)
708                                return (-1);
709-                       bp = (__uint16_t *)bufp->page;
710+                       bp = (__uint_least16_t *)bufp->page;
711                } else {
712                        /* The data is all on one page. */
713                        tp = (char *)bp;
714@@ -422,7 +422,7 @@
715                                        if (!hashp->cpage)
716                                                return (-1);
717                                        hashp->cndx = 1;
718-                                       if (!((__uint16_t *)
719+                                       if (!((__uint_least16_t *)
720                                            hashp->cpage->page)[0]) {
721                                                hashp->cbucket++;
722                                                hashp->cpage = NULL;
723@@ -454,14 +454,14 @@
724        BUFHEAD *bufp;
725        int len, set;
726 {
727-       __uint16_t *bp;
728+       __uint_least16_t *bp;
729        char *p;
730        BUFHEAD *xbp;
731-       __uint16_t save_addr;
732+       __uint_least16_t save_addr;
733        int mylen, totlen;
734 
735        p = bufp->page;
736-       bp = (__uint16_t *)p;
737+       bp = (__uint_least16_t *)p;
738        mylen = hashp->BSIZE - bp[1];
739        save_addr = bufp->addr;
740 
741@@ -481,7 +481,7 @@
742                                    __get_buf(hashp, bp[bp[0] - 1], bufp, 0);
743                                if (!hashp->cpage)
744                                        return (-1);
745-                               else if (!((__uint16_t *)hashp->cpage->page)[0]) {
746+                               else if (!((__uint_least16_t *)hashp->cpage->page)[0]) {
747                                        hashp->cbucket++;
748                                        hashp->cpage = NULL;
749                                }
750@@ -533,10 +533,10 @@
751        BUFHEAD *xbp;
752        char *p;
753        int mylen, totlen;
754-       __uint16_t *bp, save_addr;
755+       __uint_least16_t *bp, save_addr;
756 
757        p = bufp->page;
758-       bp = (__uint16_t *)p;
759+       bp = (__uint_least16_t *)p;
760        mylen = hashp->BSIZE - bp[1];
761 
762        save_addr = bufp->addr;
763@@ -579,11 +579,11 @@
764        SPLIT_RETURN *ret;
765 {
766        BUFHEAD *tmpp;
767-       __uint16_t *tp;
768+       __uint_least16_t *tp;
769        BUFHEAD *bp;
770        DBT key, val;
771        __uint32_t change;
772-       __uint16_t free_space, n, off;
773+       __uint_least16_t free_space, n, off;
774 
775        bp = big_keyp;
776 
777@@ -615,14 +615,14 @@
778            (tmpp->ovfl ? tmpp->ovfl->addr : 0), (bp ? bp->addr : 0));
779 #endif
780        tmpp->ovfl = bp;        /* one of op/np point to big_keyp */
781-       tp = (__uint16_t *)tmpp->page;
782+       tp = (__uint_least16_t *)tmpp->page;
783 #ifdef DEBUG
784        assert(FREESPACE(tp) >= OVFLSIZE);
785 #endif
786        n = tp[0];
787        off = OFFSET(tp);
788        free_space = FREESPACE(tp);
789-       tp[++n] = (__uint16_t)addr;
790+       tp[++n] = (__uint_least16_t)addr;
791        tp[++n] = OVFLPAGE;
792        tp[0] = n;
793        OFFSET(tp) = off;
794@@ -638,7 +638,7 @@
795        ret->newp = np;
796        ret->oldp = op;
797 
798-       tp = (__uint16_t *)big_keyp->page;
799+       tp = (__uint_least16_t *)big_keyp->page;
800        big_keyp->flags |= BUF_MOD;
801        if (tp[0] > 2) {
802                /*
803diff -uNr newlib-1.15.0.orig/newlib/libc/search/hash_buf.c newlib-1.15.0/newlib/libc/search/hash_buf.c
804--- newlib-1.15.0.orig/newlib/libc/search/hash_buf.c    2004-05-26 19:57:10.000000000 +0200
805+++ newlib-1.15.0/newlib/libc/search/hash_buf.c 2007-08-04 06:32:17.000000000 +0200
806@@ -176,7 +176,7 @@
807        BUFHEAD *next_xbp;
808        SEGMENT segp;
809        int segment_ndx;
810-       __uint16_t oaddr, *shortp;
811+       __uint_least16_t oaddr, *shortp;
812 
813        oaddr = 0;
814        bp = LRU;
815@@ -212,7 +212,7 @@
816                         * Set oaddr before __put_page so that you get it
817                         * before bytes are swapped.
818                         */
819-                       shortp = (__uint16_t *)bp->page;
820+                       shortp = (__uint_least16_t *)bp->page;
821                        if (shortp[0])
822                                oaddr = shortp[shortp[0] - 1];
823                        if ((bp->flags & BUF_MOD) && __put_page(hashp, bp->page,
824@@ -255,7 +255,7 @@
825                                    (oaddr != xbp->addr))
826                                        break;
827 
828-                               shortp = (__uint16_t *)xbp->page;
829+                               shortp = (__uint_least16_t *)xbp->page;
830                                if (shortp[0])
831                                        /* set before __put_page */
832                                        oaddr = shortp[shortp[0] - 1];
833diff -uNr newlib-1.15.0.orig/newlib/libc/search/hash.c newlib-1.15.0/newlib/libc/search/hash.c
834--- newlib-1.15.0.orig/newlib/libc/search/hash.c        2004-05-26 19:57:10.000000000 +0200
835+++ newlib-1.15.0/newlib/libc/search/hash.c     2007-08-04 06:32:17.000000000 +0200
836@@ -628,10 +628,10 @@
837 {
838        BUFHEAD *rbufp;
839        BUFHEAD *bufp, *save_bufp;
840-       __uint16_t *bp;
841+       __uint_least16_t *bp;
842        int n, ndx, off, size;
843        char *kp;
844-       __uint16_t pageno;
845+       __uint_least16_t pageno;
846 
847 #ifdef HASH_STATISTICS
848        hash_accesses++;
849@@ -647,7 +647,7 @@
850 
851        /* Pin the bucket chain */
852        rbufp->flags |= BUF_PIN;
853-       for (bp = (__uint16_t *)rbufp->page, n = *bp++, ndx = 1; ndx < n;)
854+       for (bp = (__uint_least16_t *)rbufp->page, n = *bp++, ndx = 1; ndx < n;)
855                if (bp[1] >= REAL_KEY) {
856                        /* Real key/data pair */
857                        if (size == off - *bp &&
858@@ -666,7 +666,7 @@
859                                return (ERROR);
860                        }
861                        /* FOR LOOP INIT */
862-                       bp = (__uint16_t *)rbufp->page;
863+                       bp = (__uint_least16_t *)rbufp->page;
864                        n = *bp++;
865                        ndx = 1;
866                        off = hashp->BSIZE;
867@@ -688,7 +688,7 @@
868                                        return (ERROR);
869                                }
870                                /* FOR LOOP INIT */
871-                               bp = (__uint16_t *)rbufp->page;
872+                               bp = (__uint_least16_t *)rbufp->page;
873                                n = *bp++;
874                                ndx = 1;
875                                off = hashp->BSIZE;
876@@ -722,7 +722,7 @@
877                save_bufp->flags &= ~BUF_PIN;
878                return (ABNORMAL);
879        case HASH_GET:
880-               bp = (__uint16_t *)rbufp->page;
881+               bp = (__uint_least16_t *)rbufp->page;
882                if (bp[ndx + 1] < REAL_KEY) {
883                        if (__big_return(hashp, rbufp, ndx, val, 0))
884                                return (ERROR);
885@@ -758,7 +758,7 @@
886        __uint32_t bucket;
887        BUFHEAD *bufp;
888        HTAB *hashp;
889-       __uint16_t *bp, ndx;
890+       __uint_least16_t *bp, ndx;
891 
892        hashp = (HTAB *)dbp->internal;
893        if (flag && flag != R_FIRST && flag != R_NEXT) {
894@@ -783,7 +783,7 @@
895                                if (!bufp)
896                                        return (ERROR);
897                                hashp->cpage = bufp;
898-                               bp = (__uint16_t *)bufp->page;
899+                               bp = (__uint_least16_t *)bufp->page;
900                                if (bp[0])
901                                        break;
902                        }
903@@ -793,7 +793,7 @@
904                                return (ABNORMAL);
905                        }
906                } else
907-                       bp = (__uint16_t *)hashp->cpage->page;
908+                       bp = (__uint_least16_t *)hashp->cpage->page;
909 
910 #ifdef DEBUG
911                assert(bp);
912@@ -804,7 +804,7 @@
913                            __get_buf(hashp, bp[hashp->cndx], bufp, 0);
914                        if (!bufp)
915                                return (ERROR);
916-                       bp = (__uint16_t *)(bufp->page);
917+                       bp = (__uint_least16_t *)(bufp->page);
918                        hashp->cndx = 1;
919                }
920                if (!bp[0]) {
921diff -uNr newlib-1.15.0.orig/newlib/libc/search/hash.h newlib-1.15.0/newlib/libc/search/hash.h
922--- newlib-1.15.0.orig/newlib/libc/search/hash.h        2002-07-02 20:18:58.000000000 +0200
923+++ newlib-1.15.0/newlib/libc/search/hash.h     2007-08-04 06:32:17.000000000 +0200
924@@ -102,7 +102,7 @@
925 #define NCACHED        32                      /* number of bit maps and spare
926                                         * points */
927        int             spares[NCACHED];/* spare pages for overflow */
928-       __uint16_t      bitmaps[NCACHED];       /* address of overflow page
929+       __uint_least16_t        bitmaps[NCACHED];       /* address of overflow page
930                                                 * bitmaps */
931 } HASHHDR;
932 
933diff -uNr newlib-1.15.0.orig/newlib/libc/search/hash_page.c newlib-1.15.0/newlib/libc/search/hash_page.c
934--- newlib-1.15.0.orig/newlib/libc/search/hash_page.c   2002-09-19 23:28:51.000000000 +0200
935+++ newlib-1.15.0/newlib/libc/search/hash_page.c        2007-08-04 06:32:17.000000000 +0200
936@@ -77,16 +77,16 @@
937 static __uint32_t      *fetch_bitmap(HTAB *, int);
938 static __uint32_t       first_free(__uint32_t);
939 static int      open_temp(HTAB *);
940-static __uint16_t       overflow_page(HTAB *);
941+static __uint_least16_t         overflow_page(HTAB *);
942 static void     putpair(char *, const DBT *, const DBT *);
943-static void     squeeze_key(__uint16_t *, const DBT *, const DBT *);
944+static void     squeeze_key(__uint_least16_t *, const DBT *, const DBT *);
945 static int      ugly_split
946 (HTAB *, __uint32_t, BUFHEAD *, BUFHEAD *, int, int);
947 
948 #define        PAGE_INIT(P) { \
949-       ((__uint16_t *)(P))[0] = 0; \
950-       ((__uint16_t *)(P))[1] = hashp->BSIZE - 3 * sizeof(__uint16_t); \
951-       ((__uint16_t *)(P))[2] = hashp->BSIZE; \
952+       ((__uint_least16_t *)(P))[0] = 0; \
953+       ((__uint_least16_t *)(P))[1] = hashp->BSIZE - 3 * sizeof(__uint_least16_t); \
954+       ((__uint_least16_t *)(P))[2] = hashp->BSIZE; \
955 }
956 
957 /*
958@@ -99,9 +99,9 @@
959        char *p;
960        const DBT *key, *val;
961 {
962-       __uint16_t *bp, n, off;
963+       __uint_least16_t *bp, n, off;
964 
965-       bp = (__uint16_t *)p;
966+       bp = (__uint_least16_t *)p;
967 
968        /* Enter the key first. */
969        n = bp[0];
970@@ -117,7 +117,7 @@
971 
972        /* Adjust page info. */
973        bp[0] = n;
974-       bp[n + 1] = off - ((n + 3) * sizeof(__uint16_t));
975+       bp[n + 1] = off - ((n + 3) * sizeof(__uint_least16_t));
976        bp[n + 2] = off;
977 }
978 
979@@ -132,11 +132,11 @@
980        BUFHEAD *bufp;
981        int ndx;
982 {
983-       __uint16_t *bp, newoff;
984+       __uint_least16_t *bp, newoff;
985        int n;
986-       __uint16_t pairlen;
987+       __uint_least16_t pairlen;
988 
989-       bp = (__uint16_t *)bufp->page;
990+       bp = (__uint_least16_t *)bufp->page;
991        n = bp[0];
992 
993        if (bp[ndx + 1] < REAL_KEY)
994@@ -167,7 +167,7 @@
995        }
996        /* Finally adjust the page data */
997        bp[n] = OFFSET(bp) + pairlen;
998-       bp[n - 1] = bp[n + 1] + pairlen + 2 * sizeof(__uint16_t);
999+       bp[n - 1] = bp[n + 1] + pairlen + 2 * sizeof(__uint_least16_t);
1000        bp[0] = n - 2;
1001        hashp->NKEYS--;
1002 
1003@@ -185,15 +185,15 @@
1004        __uint32_t obucket, nbucket;
1005 {
1006        BUFHEAD *new_bufp, *old_bufp;
1007-       __uint16_t *ino;
1008+       __uint_least16_t *ino;
1009        char *np;
1010        DBT key, val;
1011        int n, ndx, retval;
1012-       __uint16_t copyto, diff, off, moved;
1013+       __uint_least16_t copyto, diff, off, moved;
1014        char *op;
1015 
1016-       copyto = (__uint16_t)hashp->BSIZE;
1017-       off = (__uint16_t)hashp->BSIZE;
1018+       copyto = (__uint_least16_t)hashp->BSIZE;
1019+       off = (__uint_least16_t)hashp->BSIZE;
1020        old_bufp = __get_buf(hashp, obucket, NULL, 0);
1021        if (old_bufp == NULL)
1022                return (-1);
1023@@ -204,7 +204,7 @@
1024        old_bufp->flags |= (BUF_MOD | BUF_PIN);
1025        new_bufp->flags |= (BUF_MOD | BUF_PIN);
1026 
1027-       ino = (__uint16_t *)(op = old_bufp->page);
1028+       ino = (__uint_least16_t *)(op = old_bufp->page);
1029        np = new_bufp->page;
1030 
1031        moved = 0;
1032@@ -246,13 +246,13 @@
1033 
1034        /* Now clean up the page */
1035        ino[0] -= moved;
1036-       FREESPACE(ino) = copyto - sizeof(__uint16_t) * (ino[0] + 3);
1037+       FREESPACE(ino) = copyto - sizeof(__uint_least16_t) * (ino[0] + 3);
1038        OFFSET(ino) = copyto;
1039 
1040 #ifdef DEBUG3
1041        (void)fprintf(stderr, "split %d/%d\n",
1042-           ((__uint16_t *)np)[0] / 2,
1043-           ((__uint16_t *)op)[0] / 2);
1044+           ((__uint_least16_t *)np)[0] / 2,
1045+           ((__uint_least16_t *)op)[0] / 2);
1046 #endif
1047        /* unpin both pages */
1048        old_bufp->flags &= ~BUF_PIN;
1049@@ -284,22 +284,22 @@
1050        int moved;              /* Number of pairs moved to new page. */
1051 {
1052        BUFHEAD *bufp;          /* Buffer header for ino */
1053-       __uint16_t *ino;                /* Page keys come off of */
1054-       __uint16_t *np;         /* New page */
1055-       __uint16_t *op;         /* Page keys go on to if they aren't moving */
1056+       __uint_least16_t *ino;          /* Page keys come off of */
1057+       __uint_least16_t *np;           /* New page */
1058+       __uint_least16_t *op;           /* Page keys go on to if they aren't moving */
1059 
1060        BUFHEAD *last_bfp;      /* Last buf header OVFL needing to be freed */
1061        DBT key, val;
1062        SPLIT_RETURN ret;
1063-       __uint16_t n, off, ov_addr, scopyto;
1064+       __uint_least16_t n, off, ov_addr, scopyto;
1065        char *cino;             /* Character value of ino */
1066 
1067        bufp = old_bufp;
1068-       ino = (__uint16_t *)old_bufp->page;
1069-       np = (__uint16_t *)new_bufp->page;
1070-       op = (__uint16_t *)old_bufp->page;
1071+       ino = (__uint_least16_t *)old_bufp->page;
1072+       np = (__uint_least16_t *)new_bufp->page;
1073+       op = (__uint_least16_t *)old_bufp->page;
1074        last_bfp = NULL;
1075-       scopyto = (__uint16_t)copyto;   /* ANSI */
1076+       scopyto = (__uint_least16_t)copyto;     /* ANSI */
1077 
1078        n = ino[0] - 1;
1079        while (n < ino[0]) {
1080@@ -310,16 +310,16 @@
1081                        old_bufp = ret.oldp;
1082                        if (!old_bufp)
1083                                return (-1);
1084-                       op = (__uint16_t *)old_bufp->page;
1085+                       op = (__uint_least16_t *)old_bufp->page;
1086                        new_bufp = ret.newp;
1087                        if (!new_bufp)
1088                                return (-1);
1089-                       np = (__uint16_t *)new_bufp->page;
1090+                       np = (__uint_least16_t *)new_bufp->page;
1091                        bufp = ret.nextp;
1092                        if (!bufp)
1093                                return (0);
1094                        cino = (char *)bufp->page;
1095-                       ino = (__uint16_t *)cino;
1096+                       ino = (__uint_least16_t *)cino;
1097                        last_bfp = ret.nextp;
1098                } else if (ino[n + 1] == OVFLPAGE) {
1099                        ov_addr = ino[n];
1100@@ -329,14 +329,14 @@
1101                         */
1102                        ino[0] -= (moved + 2);
1103                        FREESPACE(ino) =
1104-                           scopyto - sizeof(__uint16_t) * (ino[0] + 3);
1105+                           scopyto - sizeof(__uint_least16_t) * (ino[0] + 3);
1106                        OFFSET(ino) = scopyto;
1107 
1108                        bufp = __get_buf(hashp, ov_addr, bufp, 0);
1109                        if (!bufp)
1110                                return (-1);
1111 
1112-                       ino = (__uint16_t *)bufp->page;
1113+                       ino = (__uint_least16_t *)bufp->page;
1114                        n = 1;
1115                        scopyto = hashp->BSIZE;
1116                        moved = 0;
1117@@ -364,7 +364,7 @@
1118                                            __add_ovflpage(hashp, old_bufp);
1119                                        if (!old_bufp)
1120                                                return (-1);
1121-                                       op = (__uint16_t *)old_bufp->page;
1122+                                       op = (__uint_least16_t *)old_bufp->page;
1123                                        putpair((char *)op, &key, &val);
1124                                }
1125                                old_bufp->flags |= BUF_MOD;
1126@@ -377,7 +377,7 @@
1127                                            __add_ovflpage(hashp, new_bufp);
1128                                        if (!new_bufp)
1129                                                return (-1);
1130-                                       np = (__uint16_t *)new_bufp->page;
1131+                                       np = (__uint_least16_t *)new_bufp->page;
1132                                        putpair((char *)np, &key, &val);
1133                                }
1134                                new_bufp->flags |= BUF_MOD;
1135@@ -402,10 +402,10 @@
1136        BUFHEAD *bufp;
1137        const DBT *key, *val;
1138 {
1139-       __uint16_t *bp, *sop;
1140+       __uint_least16_t *bp, *sop;
1141        int do_expand;
1142 
1143-       bp = (__uint16_t *)bufp->page;
1144+       bp = (__uint_least16_t *)bufp->page;
1145        do_expand = 0;
1146        while (bp[0] && (bp[2] < REAL_KEY || bp[bp[0]] < REAL_KEY))
1147                /* Exception case */
1148@@ -417,7 +417,7 @@
1149                        bufp = __get_buf(hashp, bp[bp[0] - 1], bufp, 0);
1150                        if (!bufp)
1151                                return (-1);
1152-                       bp = (__uint16_t *)bufp->page;
1153+                       bp = (__uint_least16_t *)bufp->page;
1154                } else
1155                        /* Try to squeeze key on this page */
1156                        if (FREESPACE(bp) > PAIRSIZE(key, val)) {
1157@@ -427,7 +427,7 @@
1158                                bufp = __get_buf(hashp, bp[bp[0] - 1], bufp, 0);
1159                                if (!bufp)
1160                                        return (-1);
1161-                               bp = (__uint16_t *)bufp->page;
1162+                               bp = (__uint_least16_t *)bufp->page;
1163                        }
1164 
1165        if (PAIRFITS(bp, key, val))
1166@@ -437,7 +437,7 @@
1167                bufp = __add_ovflpage(hashp, bufp);
1168                if (!bufp)
1169                        return (-1);
1170-               sop = (__uint16_t *)bufp->page;
1171+               sop = (__uint_least16_t *)bufp->page;
1172 
1173                if (PAIRFITS(sop, key, val))
1174                        putpair((char *)sop, key, val);
1175@@ -468,12 +468,12 @@
1176        HTAB *hashp;
1177        BUFHEAD *bufp;
1178 {
1179-       __uint16_t *sp;
1180-       __uint16_t ndx, ovfl_num;
1181+       __uint_least16_t *sp;
1182+       __uint_least16_t ndx, ovfl_num;
1183 #ifdef DEBUG1
1184        int tmp1, tmp2;
1185 #endif
1186-       sp = (__uint16_t *)bufp->page;
1187+       sp = (__uint_least16_t *)bufp->page;
1188 
1189        /* Check if we are dynamically determining the fill factor */
1190        if (hashp->FFACTOR == DEF_FFACTOR) {
1191@@ -525,7 +525,7 @@
1192 {
1193        int fd, page, size;
1194        int rsize;
1195-       __uint16_t *bp;
1196+       __uint_least16_t *bp;
1197 
1198        fd = hashp->fp;
1199        size = hashp->BSIZE;
1200@@ -541,7 +541,7 @@
1201        if ((lseek(fd, (off_t)page << hashp->BSHIFT, SEEK_SET) == -1) ||
1202            ((rsize = read(fd, p, size)) == -1))
1203                return (-1);
1204-       bp = (__uint16_t *)p;
1205+       bp = (__uint_least16_t *)p;
1206        if (!rsize)
1207                bp[0] = 0;      /* We hit the EOF, so initialize a new page */
1208        else
1209@@ -600,9 +600,9 @@
1210                        for (i = 0; i < max; i++)
1211                                M_32_SWAP(((int *)p)[i]);
1212                } else {
1213-                       max = ((__uint16_t *)p)[0] + 2;
1214+                       max = ((__uint_least16_t *)p)[0] + 2;
1215                        for (i = 0; i <= max; i++)
1216-                               M_16_SWAP(((__uint16_t *)p)[i]);
1217+                               M_16_SWAP(((__uint_least16_t *)p)[i]);
1218                }
1219        }
1220        if (is_bucket)
1221@@ -643,7 +643,7 @@
1222            hashp->BSIZE - clearbytes);
1223        ip[clearints - 1] = ALL_SET << (nbits & BYTE_MASK);
1224        SETBIT(ip, 0);
1225-       hashp->BITMAPS[ndx] = (__uint16_t)pnum;
1226+       hashp->BITMAPS[ndx] = (__uint_least16_t)pnum;
1227        hashp->mapp[ndx] = ip;
1228        return (0);
1229 }
1230@@ -663,13 +663,13 @@
1231        return (i);
1232 }
1233 
1234-static __uint16_t
1235+static __uint_least16_t
1236 overflow_page(hashp)
1237        HTAB *hashp;
1238 {
1239        __uint32_t *freep;
1240        int max_free, offset, splitnum;
1241-       __uint16_t addr;
1242+       __uint_least16_t addr;
1243        int bit, first_page, free_bit, free_page, i, in_use_bits, j;
1244 #ifdef DEBUG2
1245        int tmp1, tmp2;
1246@@ -816,16 +816,16 @@
1247        HTAB *hashp;
1248        BUFHEAD *obufp;
1249 {
1250-       __uint16_t addr;
1251+       __uint_least16_t addr;
1252        __uint32_t *freep;
1253        int bit_address, free_page, free_bit;
1254-       __uint16_t ndx;
1255+       __uint_least16_t ndx;
1256 
1257        addr = obufp->addr;
1258 #ifdef DEBUG1
1259        (void)fprintf(stderr, "Freeing %d\n", addr);
1260 #endif
1261-       ndx = (((__uint16_t)addr) >> SPLITSHIFT);
1262+       ndx = (((__uint_least16_t)addr) >> SPLITSHIFT);
1263        bit_address =
1264            (ndx ? hashp->SPARES[ndx - 1] : 0) + (addr & SPLITMASK) - 1;
1265         if (bit_address < hashp->LAST_FREED)
1266@@ -883,11 +883,11 @@
1267  */
1268 static void
1269 squeeze_key(sp, key, val)
1270-       __uint16_t *sp;
1271+       __uint_least16_t *sp;
1272        const DBT *key, *val;
1273 {
1274        char *p;
1275-       __uint16_t free_space, n, off, pageno;
1276+       __uint_least16_t free_space, n, off, pageno;
1277 
1278        p = (char *)sp;
1279        n = sp[0];
1280diff -uNr newlib-1.15.0.orig/newlib/libc/search/page.h newlib-1.15.0/newlib/libc/search/page.h
1281--- newlib-1.15.0.orig/newlib/libc/search/page.h        2002-06-20 21:51:31.000000000 +0200
1282+++ newlib-1.15.0/newlib/libc/search/page.h     2007-08-04 06:32:17.000000000 +0200
1283@@ -74,20 +74,20 @@
1284  * You might as well do this up front.
1285  */
1286 
1287-#define        PAIRSIZE(K,D)   (2*sizeof(__uint16_t) + (K)->size + (D)->size)
1288-#define BIGOVERHEAD    (4*sizeof(__uint16_t))
1289-#define KEYSIZE(K)     (4*sizeof(__uint16_t) + (K)->size);
1290-#define OVFLSIZE       (2*sizeof(__uint16_t))
1291+#define        PAIRSIZE(K,D)   (2*sizeof(__uint_least16_t) + (K)->size + (D)->size)
1292+#define BIGOVERHEAD    (4*sizeof(__uint_least16_t))
1293+#define KEYSIZE(K)     (4*sizeof(__uint_least16_t) + (K)->size);
1294+#define OVFLSIZE       (2*sizeof(__uint_least16_t))
1295 #define FREESPACE(P)   ((P)[(P)[0]+1])
1296 #define        OFFSET(P)       ((P)[(P)[0]+2])
1297 #define PAIRFITS(P,K,D) \
1298        (((P)[2] >= REAL_KEY) && \
1299            (PAIRSIZE((K),(D)) + OVFLSIZE) <= FREESPACE((P)))
1300-#define PAGE_META(N)   (((N)+3) * sizeof(__uint16_t))
1301+#define PAGE_META(N)   (((N)+3) * sizeof(__uint_least16_t))
1302 
1303 typedef struct {
1304        BUFHEAD *newp;
1305        BUFHEAD *oldp;
1306        BUFHEAD *nextp;
1307-       __uint16_t next_addr;
1308+       __uint_least16_t next_addr;
1309 }       SPLIT_RETURN;
1310diff -uNr newlib-1.15.0.orig/newlib/libc/sys/rtems/machine/stdint.h newlib-1.15.0/newlib/libc/sys/rtems/machine/stdint.h
1311--- newlib-1.15.0.orig/newlib/libc/sys/rtems/machine/stdint.h   1970-01-01 01:00:00.000000000 +0100
1312+++ newlib-1.15.0/newlib/libc/sys/rtems/machine/stdint.h        2007-08-04 06:32:17.000000000 +0200
1313@@ -0,0 +1,31 @@
1314+/*
1315+ *
1316+ */
1317+#ifndef _MACHINE_STDINT_H
1318+#define _MACHINE_STDINT_H
1319+
1320+#ifndef _STDINT_H
1321+#error machine/stdint.h is an internal file and  must not be directly included
1322+#endif
1323+
1324+#if defined(__sparc__) \
1325+  || defined(__powerpc__) || defined(__PPC__) \
1326+  || defined(__mips__) \
1327+  || defined(__sh__) \
1328+  || defined(__AVR__) \
1329+  || defined(_C4x) || defined(_C3x) \
1330+  || defined(__H8300__)
1331+/* PTRDIFF_TYPE = int */
1332+#define __ptrint_t_int_defined 1
1333+#endif
1334+
1335+#if defined(__i386__) \
1336+  || defined(__m68k__) \
1337+  || defined(__bfin__) \
1338+  || defined(__arm__) \
1339+  || defined(__H8300S__) || defined(__H8300H__)
1340+/* PTRDIFF_TYPE = long */
1341+#define __ptrint_t_long_defined 1
1342+#endif
1343+
1344+#endif
1345diff -uNr newlib-1.15.0.orig/newlib/libc/sys/rtems/sys/param.h newlib-1.15.0/newlib/libc/sys/rtems/sys/param.h
1346--- newlib-1.15.0.orig/newlib/libc/sys/rtems/sys/param.h        2004-05-07 22:29:24.000000000 +0200
1347+++ newlib-1.15.0/newlib/libc/sys/rtems/sys/param.h     2007-08-04 06:32:17.000000000 +0200
1348@@ -93,7 +93,6 @@
1349 #include <sys/resource.h>
1350 #include <sys/ucred.h>
1351 #include <sys/uio.h>
1352-#include <sys/rtprio.h>
1353 
1354 #ifndef FALSE
1355 #define        FALSE   0
1356diff -uNr newlib-1.15.0.orig/newlib/Makefile.am newlib-1.15.0/newlib/Makefile.am
1357--- newlib-1.15.0.orig/newlib/Makefile.am       2006-06-05 19:42:57.000000000 +0200
1358+++ newlib-1.15.0/newlib/Makefile.am    2007-08-04 06:32:17.000000000 +0200
1359@@ -81,7 +81,7 @@
1360        libc.a
1361 endif
1362 
1363-noinst_DATA = stmp-targ-include
1364+BUILT_SOURCES = stmp-targ-include
1365 
1366 toollib_DATA = $(CRT0) $(CRT1)
1367 
1368@@ -186,9 +186,6 @@
1369 
1370 $(CRT1_DIR)$(CRT1): ; @true
1371 
1372-
1373-all-recursive: stmp-targ-include
1374-
1375 # The targ-include directory just holds the includes files for the
1376 # particular system and machine we have been configured for.  It is
1377 # used while building.
1378diff -uNr newlib-1.15.0.orig/newlib/Makefile.in newlib-1.15.0/newlib/Makefile.in
1379--- newlib-1.15.0.orig/newlib/Makefile.in       2006-12-18 21:32:41.000000000 +0100
1380+++ newlib-1.15.0/newlib/Makefile.in    2007-08-04 06:32:17.000000000 +0200
1381@@ -103,7 +103,7 @@
1382        pdf-recursive ps-recursive uninstall-info-recursive \
1383        uninstall-recursive
1384 toollibDATA_INSTALL = $(INSTALL_DATA)
1385-DATA = $(noinst_DATA) $(toollib_DATA)
1386+DATA = $(toollib_DATA)
1387 ETAGS = etags
1388 CTAGS = ctags
1389 DEJATOOL = $(PACKAGE)
1390@@ -205,12 +205,7 @@
1391 USE_LIBTOOL_FALSE = @USE_LIBTOOL_FALSE@
1392 USE_LIBTOOL_TRUE = @USE_LIBTOOL_TRUE@
1393 VERSION = @VERSION@
1394-ac_ct_AR = @ac_ct_AR@
1395-ac_ct_AS = @ac_ct_AS@
1396 ac_ct_CC = @ac_ct_CC@
1397-ac_ct_RANLIB = @ac_ct_RANLIB@
1398-ac_ct_READELF = @ac_ct_READELF@
1399-ac_ct_STRIP = @ac_ct_STRIP@
1400 aext = @aext@
1401 am__fastdepCC_FALSE = @am__fastdepCC_FALSE@
1402 am__fastdepCC_TRUE = @am__fastdepCC_TRUE@
1403@@ -226,12 +221,16 @@
1404 build_os = @build_os@
1405 build_vendor = @build_vendor@
1406 datadir = @datadir@
1407+datarootdir = @datarootdir@
1408+docdir = @docdir@
1409+dvidir = @dvidir@
1410 exec_prefix = @exec_prefix@
1411 host = @host@
1412 host_alias = @host_alias@
1413 host_cpu = @host_cpu@
1414 host_os = @host_os@
1415 host_vendor = @host_vendor@
1416+htmldir = @htmldir@
1417 includedir = @includedir@
1418 infodir = @infodir@
1419 install_sh = @install_sh@
1420@@ -240,6 +239,7 @@
1421 libdir = @libdir@
1422 libexecdir = @libexecdir@
1423 libm_machine_dir = @libm_machine_dir@
1424+localedir = @localedir@
1425 localstatedir = @localstatedir@
1426 lpfx = @lpfx@
1427 machine_dir = @machine_dir@
1428@@ -248,8 +248,10 @@
1429 newlib_basedir = @newlib_basedir@
1430 oext = @oext@
1431 oldincludedir = @oldincludedir@
1432+pdfdir = @pdfdir@
1433 prefix = @prefix@
1434 program_transform_name = @program_transform_name@
1435+psdir = @psdir@
1436 sbindir = @sbindir@
1437 sharedstatedir = @sharedstatedir@
1438 subdirs = @subdirs@
1439@@ -323,7 +325,7 @@
1440 @USE_LIBTOOL_FALSE@toollib_LIBRARIES = libm.a \
1441 @USE_LIBTOOL_FALSE@    libc.a
1442 
1443-noinst_DATA = stmp-targ-include
1444+BUILT_SOURCES = stmp-targ-include
1445 toollib_DATA = $(CRT0) $(CRT1)
1446 
1447 # The functions ldexp, frexp and modf are traditionally supplied in
1448@@ -382,7 +384,7 @@
1449 
1450 # dejagnu support
1451 RUNTESTFLAGS =
1452-all: newlib.h
1453+all: $(BUILT_SOURCES) newlib.h
1454        $(MAKE) $(AM_MAKEFLAGS) all-recursive
1455 
1456 .SUFFIXES:
1457@@ -687,14 +689,16 @@
1458        done
1459 check-am:
1460        $(MAKE) $(AM_MAKEFLAGS) check-DEJAGNU
1461-check: check-recursive
1462+check: $(BUILT_SOURCES)
1463+       $(MAKE) $(AM_MAKEFLAGS) check-recursive
1464 all-am: Makefile $(LIBRARIES) $(LTLIBRARIES) $(DATA) newlib.h
1465 installdirs: installdirs-recursive
1466 installdirs-am:
1467        for dir in "$(DESTDIR)$(toollibdir)" "$(DESTDIR)$(toollibdir)" "$(DESTDIR)$(toollibdir)"; do \
1468          test -z "$$dir" || $(mkdir_p) "$$dir"; \
1469        done
1470-install: install-recursive
1471+install: $(BUILT_SOURCES)
1472+       $(MAKE) $(AM_MAKEFLAGS) install-recursive
1473 install-exec: install-exec-recursive
1474 install-data: install-data-recursive
1475 uninstall: uninstall-recursive
1476@@ -719,6 +723,7 @@
1477 maintainer-clean-generic:
1478        @echo "This command is intended for maintainers to use"
1479        @echo "it deletes files that may require special tools to rebuild."
1480+       -test -z "$(BUILT_SOURCES)" || rm -f $(BUILT_SOURCES)
1481 clean: clean-recursive
1482 
1483 clean-am: clean-generic clean-libtool clean-toollibLIBRARIES \
1484@@ -837,8 +842,6 @@
1485 
1486 $(CRT1_DIR)$(CRT1): ; @true
1487 
1488-all-recursive: stmp-targ-include
1489-
1490 # The targ-include directory just holds the includes files for the
1491 # particular system and machine we have been configured for.  It is
1492 # used while building.
Note: See TracBrowser for help on using the repository browser.