summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
Diffstat (limited to 'include')
-rw-r--r--include/a.out.h6
-rw-r--r--include/alloca.h33
-rw-r--r--include/arpa/inet.h6
-rw-r--r--include/arpa/nameser.h2
-rw-r--r--include/arpa/nameser_compat.h4
-rw-r--r--include/assert.h8
-rw-r--r--include/ctype.h33
-rw-r--r--include/elf.h8
-rw-r--r--include/features.h148
-rw-r--r--include/ieee754.h8
-rw-r--r--include/inttypes.h148
-rw-r--r--include/langinfo.h48
-rw-r--r--include/libc-internal.h38
-rw-r--r--include/limits.h23
-rw-r--r--include/locale.h10
-rw-r--r--include/math.h2
-rw-r--r--include/net/ethernet.h10
-rw-r--r--include/net/if_arp.h10
-rw-r--r--include/netinet/ether.h4
-rw-r--r--include/netinet/icmp6.h12
-rw-r--r--include/netinet/in.h41
-rw-r--r--include/netinet/ip6.h8
-rw-r--r--include/netinet/protocols.h62
-rw-r--r--include/nl_types.h2
-rw-r--r--include/paths.h1
-rw-r--r--include/regexp.h20
-rw-r--r--include/rpc/auth.h4
-rw-r--r--include/rpc/auth_des.h4
-rw-r--r--include/signal.h2
-rw-r--r--include/stdlib.h30
-rw-r--r--include/sys/mman.h6
-rw-r--r--include/sys/msg.h10
-rw-r--r--include/sys/poll.h2
-rw-r--r--include/sys/shm.h3
-rw-r--r--include/sys/socket.h9
-rw-r--r--include/sys/stat.h1
-rw-r--r--include/sys/statvfs.h8
-rw-r--r--include/sys/syscall.h10
-rw-r--r--include/sys/timex.h2
-rw-r--r--include/sys/utsname.h23
-rw-r--r--include/sys/wait.h2
-rw-r--r--include/utmp.h2
-rw-r--r--include/values.h2
43 files changed, 488 insertions, 327 deletions
diff --git a/include/a.out.h b/include/a.out.h
index d963de74c..027c49ad5 100644
--- a/include/a.out.h
+++ b/include/a.out.h
@@ -1,5 +1 @@
-#ifdef _LIBC
-# include_next <linux/a.out.h>
-#else
-# include <linux/a.out.h>
-#endif
+#include <linux/a.out.h>
diff --git a/include/alloca.h b/include/alloca.h
index b4fc31738..2565b4835 100644
--- a/include/alloca.h
+++ b/include/alloca.h
@@ -36,7 +36,38 @@ extern void *alloca (size_t __size) __THROW;
# define alloca(size) __builtin_alloca (size)
#endif /* GCC. */
-#define __MAX_ALLOCA_CUTOFF 65536
+#ifdef _LIBC
+# define __MAX_ALLOCA_CUTOFF 65536
+
+# include <bits/stackinfo.h>
+# ifdef _STACK_GROWS_DOWN
+# define extend_alloca(buf, len, newlen) \
+ (__typeof (buf)) ({ size_t __newlen = (newlen); \
+ char *__newbuf = alloca (__newlen); \
+ if (__newbuf + __newlen == (char *) buf) \
+ len += __newlen; \
+ else \
+ len = __newlen; \
+ __newbuf; })
+# elif defined _STACK_GROWS_UP
+# define extend_alloca(buf, len, newlen) \
+ (__typeof (buf)) ({ size_t __newlen = (newlen); \
+ char *__newbuf = alloca (__newlen); \
+ char *__buf = (buf); \
+ if (__buf + __newlen == __newbuf) \
+ { \
+ len += __newlen; \
+ __newbuf = __buf; \
+ } \
+ else \
+ len = __newlen; \
+ __newbuf; })
+# else
+# error unknown stack
+# define extend_alloca(buf, len, newlen) \
+ alloca (((len) = (newlen)))
+# endif
+#endif
__END_DECLS
diff --git a/include/arpa/inet.h b/include/arpa/inet.h
index 8ecad55f0..fbd715af0 100644
--- a/include/arpa/inet.h
+++ b/include/arpa/inet.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 1997, 1999, 2000, 2001 Free Software Foundation, Inc.
+/* Copyright (C) 1997, 1999, 2000, 2001, 2004 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -57,9 +57,11 @@ libc_hidden_proto(inet_network)
is a pointer to an internal array containing the string. */
extern char *inet_ntoa (struct in_addr __in) __THROW;
libc_hidden_proto(inet_ntoa)
+#ifdef __UCLIBC__
/* Recursion-safe flavor */
extern char *inet_ntoa_r (struct in_addr __in, char *__buf) __THROW;
libc_hidden_proto(inet_ntoa_r)
+#endif
/* Convert from presentation format of an Internet number in buffer
starting at CP to the binary network format and store result for
@@ -84,6 +86,7 @@ libc_hidden_proto(inet_ntop)
extern int inet_aton (__const char *__cp, struct in_addr *__inp) __THROW;
libc_hidden_proto(inet_aton)
+#if 0
/* Format a network number NET into presentation format and place result
in buffer starting at BUF with length of LEN bytes. */
extern char *inet_neta (in_addr_t __net, char *__buf, size_t __len) __THROW;
@@ -111,6 +114,7 @@ extern unsigned int inet_nsap_addr (__const char *__cp,
extern char *inet_nsap_ntoa (int __len, __const unsigned char *__cp,
char *__buf) __THROW;
#endif
+#endif
__END_DECLS
diff --git a/include/arpa/nameser.h b/include/arpa/nameser.h
index a9c199e25..917ba19b9 100644
--- a/include/arpa/nameser.h
+++ b/include/arpa/nameser.h
@@ -287,7 +287,7 @@ typedef enum __ns_type {
ns_t_naptr = 35, /* Naming Authority PoinTeR */
ns_t_kx = 36, /* Key Exchange */
ns_t_cert = 37, /* Certification record */
- ns_t_a6 = 38, /* IPv6 address (deprecates AAAA) */
+ ns_t_a6 = 38, /* IPv6 address (deprecated, use ns_t_aaaa) */
ns_t_dname = 39, /* Non-terminal DNAME (for IPv6) */
ns_t_sink = 40, /* Kitchen sink (experimentatl) */
ns_t_opt = 41, /* EDNS0 option (meta-RR) */
diff --git a/include/arpa/nameser_compat.h b/include/arpa/nameser_compat.h
index e3ef864cd..7fe46a16d 100644
--- a/include/arpa/nameser_compat.h
+++ b/include/arpa/nameser_compat.h
@@ -47,7 +47,7 @@
typedef struct {
unsigned id :16; /* query identification number */
-#if BYTE_ORDER == BIG_ENDIAN
+#if __BYTE_ORDER == __BIG_ENDIAN
/* fields in third byte */
unsigned qr: 1; /* response flag */
unsigned opcode: 4; /* purpose of message */
@@ -61,7 +61,7 @@ typedef struct {
unsigned cd: 1; /* checking disabled by resolver */
unsigned rcode :4; /* response code */
#endif
-#if BYTE_ORDER == LITTLE_ENDIAN || BYTE_ORDER == PDP_ENDIAN
+#if __BYTE_ORDER == __LITTLE_ENDIAN || __BYTE_ORDER == __PDP_ENDIAN
/* fields in third byte */
unsigned rd :1; /* recursion desired */
unsigned tc :1; /* truncated message */
diff --git a/include/assert.h b/include/assert.h
index 439179d8d..40b16059b 100644
--- a/include/assert.h
+++ b/include/assert.h
@@ -51,15 +51,15 @@
__BEGIN_DECLS
/* This prints an "Assertion failed" message and aborts. */
-extern void __assert __P((const char *, const char *, int, const char *));
+extern void __assert(const char *, const char *, unsigned int, const char *)
+ __THROW __attribute__ ((__noreturn__));
libc_hidden_proto(__assert)
__END_DECLS
# define assert(expr) \
- (__ASSERT_VOID_CAST ((expr) ? 0 : \
- (__assert (__STRING(expr), __FILE__, __LINE__, \
- __ASSERT_FUNCTION), 0)))
+ (__ASSERT_VOID_CAST ((expr) ? 0 : \
+ (__assert (__STRING(expr), __FILE__, __LINE__, __ASSERT_FUNCTION), 0)))
/* Version 2.4 and later of GCC define a magical variable `__PRETTY_FUNCTION__'
which contains the name of the function currently being defined.
diff --git a/include/ctype.h b/include/ctype.h
index da73a44fc..dcfeb1b3e 100644
--- a/include/ctype.h
+++ b/include/ctype.h
@@ -66,7 +66,8 @@ libc_hidden_proto(tolower)
extern int toupper(int __c) __THROW;
libc_hidden_proto(toupper)
-#if defined __USE_SVID || defined __USE_MISC || defined __USE_XOPEN
+#if (defined __USE_SVID || defined __USE_MISC || defined __USE_XOPEN) && \
+ defined __UCLIBC_SUSV4_LEGACY__
/* Return nonzero iff C is in the ASCII set
(i.e., is no more than 7 bits wide). */
extern int isascii(int __c) __THROW;
@@ -203,11 +204,12 @@ libc_hidden_proto(__ctype_tolower)
#endif /* __UCLIBC_HAS_XLOCALE__ */
-
+#ifdef __UCLIBC_SUSV4_LEGACY__
#define __isascii(c) (((c) & ~0x7f) == 0) /* If C is a 7 bit value. */
#define __toascii(c) ((c) & 0x7f) /* Mask off high bits. */
+#endif
-#if defined _LIBC && (defined IS_IN_libc || defined NOT_IN_libc)
+#ifdef _LIBC
/* These are uClibc-specific. */
#define __isdigit_char(C) (((unsigned char)((C) - '0')) <= 9)
#define __isdigit_int(C) (((unsigned int)((C) - '0')) <= 9)
@@ -278,13 +280,12 @@ __NTH (toupper (int __c))
# define toupper(c) __tobody(c, toupper, __UCLIBC_CTYPE_TOUPPER, (c))
# endif /* Optimizing gcc */
-# if defined __USE_SVID || defined __USE_MISC || defined __USE_XOPEN
+# if (defined __USE_SVID || defined __USE_MISC || defined __USE_XOPEN) \
+ && defined __UCLIBC_SUSV4_LEGACY__
# define isascii(c) __isascii (c)
# define toascii(c) __toascii (c)
-# if __UCLIBC_SUSV4_LEGACY__
-# define _tolower(c) ((int) (__UCLIBC_CTYPE_TOLOWER)[(int) (c)])
-# define _toupper(c) ((int) (__UCLIBC_CTYPE_TOUPPER)[(int) (c)])
-# endif
+# define _tolower(c) ((int) (__UCLIBC_CTYPE_TOLOWER)[(int) (c)])
+# define _toupper(c) ((int) (__UCLIBC_CTYPE_TOUPPER)[(int) (c)])
# endif
#endif /* not __cplusplus */
@@ -334,8 +335,8 @@ libc_hidden_proto(isxdigit_l)
extern int isblank_l(int, __locale_t) __THROW;
libc_hidden_proto(isblank_l)
-# if defined __USE_SVID || defined __USE_MISC || defined __USE_XOPEN
-
+# if (defined __USE_SVID || defined __USE_MISC || defined __USE_XOPEN) \
+ && defined __UCLIBC_SUSV4_LEGACY__
/* Return nonzero iff C is in the ASCII set
(i.e., is no more than 7 bits wide). */
extern int isascii_l (int __c) __THROW;
@@ -378,7 +379,8 @@ libc_hidden_proto(toupper_l)
# define __isxdigit_l(c,l) __isctype_l((c), _ISxdigit, (l))
# define __isblank_l(c,l) __isctype_l((c), _ISblank, (l))
-# if defined __USE_SVID || defined __USE_MISC || defined __USE_XOPEN
+# if (defined __USE_SVID || defined __USE_MISC || defined __USE_XOPEN) \
+ && defined __UCLIBC_SUSV4_LEGACY__
# define __isascii_l(c,l) ((l), __isascii (c))
# define __toascii_l(c,l) ((l), __toascii (c))
# endif
@@ -396,7 +398,8 @@ libc_hidden_proto(toupper_l)
# define isxdigit_l(c,l) __isxdigit_l ((c), (l))
# define isblank_l(c,l) __isblank_l ((c), (l))
-# if defined __USE_SVID || defined __USE_MISC || defined __USE_XOPEN
+# if (defined __USE_SVID || defined __USE_MISC || defined __USE_XOPEN) \
+ && defined __UCLIBC_SUSV4_LEGACY__
# define isascii_l(c,l) __isascii_l ((c), (l))
# define toascii_l(c,l) __toascii_l ((c), (l))
# endif
@@ -409,4 +412,10 @@ __END_DECLS
#endif /* __UCLIBC_HAS_CTYPE_TABLES__ */
+/* We define {__,}isascii for internal use only */
+#if defined _LIBC && !defined __UCLIBC_SUSV4_LEGACY__
+# define __isascii(c) (((c) & ~0x7f) == 0)
+# define isascii(c) __isascii (c)
+#endif
+
#endif /* ctype.h */
diff --git a/include/elf.h b/include/elf.h
index 0da4bf7a7..b86aa52be 100644
--- a/include/elf.h
+++ b/include/elf.h
@@ -2180,10 +2180,10 @@ typedef Elf32_Addr Elf32_Conflict;
#define R_PPC_DIAB_RELSDA_HA 185 /* like EMB_RELSDA, adjusted high 16 */
/* GNU relocs used in PIC code sequences. */
-#define R_PPC_REL16 249 /* word32 (sym-.) */
-#define R_PPC_REL16_LO 250 /* half16 (sym-.)@l */
-#define R_PPC_REL16_HI 251 /* half16 (sym-.)@h */
-#define R_PPC_REL16_HA 252 /* half16 (sym-.)@ha */
+#define R_PPC_REL16 249 /* word32 (sym+add-.) */
+#define R_PPC_REL16_LO 250 /* half16 (sym+add-.)@l */
+#define R_PPC_REL16_HI 251 /* half16 (sym+add-.)@h */
+#define R_PPC_REL16_HA 252 /* half16 (sym+add-.)@ha */
/* This is a phony reloc to handle any old fashioned TOC16 references
that may still be in object files. */
diff --git a/include/features.h b/include/features.h
index 66447e2ed..1d47b5660 100644
--- a/include/features.h
+++ b/include/features.h
@@ -19,35 +19,6 @@
#ifndef _FEATURES_H
#define _FEATURES_H 1
-/* This macro indicates that the installed library is uClibc. Use
- * __UCLIBC_MAJOR__ and __UCLIBC_MINOR__ to test for the features in
- * specific releases. */
-#define __UCLIBC__ 1
-
-/* Load up the current set of uClibc supported features along
- * with the current uClibc major and minor version numbers.
- * For uClibc release 0.9.26, these numbers would be:
- * #define __UCLIBC_MAJOR__ 0
- * #define __UCLIBC_MINOR__ 9
- * #define __UCLIBC_SUBLEVEL__ 26
- */
-#define __need_uClibc_config_h
-#include <bits/uClibc_config.h>
-#undef __need_uClibc_config_h
-#ifdef _LIBC
-#include <bits/uClibc_arch_features.h>
-#endif
-
-/* For uClibc, always optimize for size -- this should disable
- * a lot of expensive inlining...
- * TODO: this is wrong! __OPTIMIZE_SIZE__ is an indicator of
- * gcc -Os compile. We should not mess with compiler inlines.
- * We should instead disable __USE_EXTERN_INLINES unconditionally,
- * or maybe actually audit and test uclibc to work correctly
- * with __USE_EXTERN_INLINES on.
- */
-#define __OPTIMIZE_SIZE__ 1
-
/* These are defined by the user (or the compiler)
to specify the desired environment:
@@ -189,10 +160,8 @@
# define _XOPEN_SOURCE 700
# undef _XOPEN_SOURCE_EXTENDED
# define _XOPEN_SOURCE_EXTENDED 1
-# ifdef __UCLIBC_HAS_LFS__
-# undef _LARGEFILE64_SOURCE
-# define _LARGEFILE64_SOURCE 1
-# endif /* __UCLIBC_HAS_LFS__ */
+# undef _LARGEFILE64_SOURCE
+# define _LARGEFILE64_SOURCE 1
# undef _BSD_SOURCE
# define _BSD_SOURCE 1
# undef _SVID_SOURCE
@@ -201,6 +170,57 @@
# define _ATFILE_SOURCE 1
#endif
+/* This macro indicates that the installed library is uClibc. Use
+ * __UCLIBC_MAJOR__ and __UCLIBC_MINOR__ to test for the features in
+ * specific releases. */
+#define __UCLIBC__ 1
+
+#ifdef __UCLIBC__
+/* Load up the current set of uClibc supported features along
+ * with the current uClibc major and minor version numbers.
+ * For uClibc release 0.9.26, these numbers would be:
+ * #define __UCLIBC_MAJOR__ 0
+ * #define __UCLIBC_MINOR__ 9
+ * #define __UCLIBC_SUBLEVEL__ 26
+ */
+# define __need_uClibc_config_h
+# include <bits/uClibc_config.h>
+# undef __need_uClibc_config_h
+
+/* For uClibc, always optimize for size -- this should disable
+ * a lot of expensive inlining...
+ * TODO: this is wrong! __OPTIMIZE_SIZE__ is an indicator of
+ * gcc -Os compile. We should not mess with compiler inlines.
+ * We should instead disable __USE_EXTERN_INLINES unconditionally,
+ * or maybe actually audit and test uclibc to work correctly
+ * with __USE_EXTERN_INLINES on.
+ */
+# define __OPTIMIZE_SIZE__ 1
+
+/* disable unsupported features */
+# undef _FORTIFY_SOURCE
+# undef __LDBL_COMPAT
+
+# ifndef __UCLIBC_HAS_THREADS__
+# if defined _REENTRANT || defined _THREAD_SAFE
+# warning requested reentrant code, but thread support was disabled
+# undef _REENTRANT
+# undef _THREAD_SAFE
+# endif
+# endif
+
+# ifndef __UCLIBC_HAS_LFS__
+# undef _LARGEFILE64_SOURCE
+/* NOTE: This is probably incorrect on a 64-bit arch... */
+# if defined _FILE_OFFSET_BITS && _FILE_OFFSET_BITS == 64
+# error It appears you have defined _FILE_OFFSET_BITS=64. Unfortunately, \
+uClibc was built without large file support enabled.
+# endif
+# elif defined __BCC__
+# error BCC does not support LFS, please disable it
+# endif
+#endif /* __UCLIBC__ */
+
/* If nothing (other than _GNU_SOURCE) is defined,
define _BSD_SOURCE and _SVID_SOURCE. */
#if (!defined __STRICT_ANSI__ && !defined _ISOC99_SOURCE && \
@@ -329,8 +349,6 @@
# define __USE_REENTRANT 1
#endif
-/* uClibc does not support _FORTIFY_SOURCE */
-#undef _FORTIFY_SOURCE
#if defined _FORTIFY_SOURCE && _FORTIFY_SOURCE > 0 \
&& __GNUC_PREREQ (4, 1) && defined __OPTIMIZE__ && __OPTIMIZE__ > 0
# if _FORTIFY_SOURCE > 1
@@ -343,8 +361,10 @@
#endif
/* We do support the IEC 559 math functionality, real and complex. */
+#ifdef __UCLIBC_HAS_FLOATS__
#define __STDC_IEC_559__ 1
#define __STDC_IEC_559_COMPLEX__ 1
+#endif
#ifdef __UCLIBC_HAS_WCHAR__
/* wchar_t uses ISO 10646-1 (2nd ed., published 2000-09-15) / Unicode 3.1. */
@@ -362,14 +382,16 @@
/* This macro indicates that the installed library is the GNU C Library.
For historic reasons the value now is 6 and this will stay from now
on. The use of this variable is deprecated. */
-# undef __GNU_LIBRARY__
-# define __GNU_LIBRARY__ 6
+/* uClibc WARNING: leave these aligned to the left, don't put a space after '#', else
+ * broken apps could fail the check. */
+#undef __GNU_LIBRARY__
+#define __GNU_LIBRARY__ 6
/* Major and minor version number of the GNU C library package. Use
these macros to test for features in specific releases. */
/* Don't do it, if you want to keep uClibc happy. */
-# define __GLIBC__ 2
-# define __GLIBC_MINOR__ 2
+#define __GLIBC__ 2
+#define __GLIBC_MINOR__ 2
#endif
#define __GLIBC_PREREQ(maj, min) \
@@ -395,7 +417,9 @@
__USE_FILE_OFFSET64 but not __USE_LARGEFILE[64]. */
# if defined __USE_FILE_OFFSET64 && !defined __REDIRECT
# define __USE_LARGEFILE 1
+# ifdef __UCLIBC_HAS_LFS__
# define __USE_LARGEFILE64 1
+# endif
# endif
#endif /* !ASSEMBLER */
@@ -413,50 +437,12 @@
# define __USE_EXTERN_INLINES 1
#endif
-
-/* Make sure users large file options agree with uClibc's configuration. */
-#ifndef __UCLIBC_HAS_LFS__
-
-/* If uClibc was built without large file support, output an error if
- * 64-bit file offsets were requested.
- * NOTE: This is probably incorrect on a 64-bit arch... */
-# ifdef __USE_FILE_OFFSET64
-# error It appears you have defined _FILE_OFFSET_BITS=64. Unfortunately, \
-uClibc was built without large file support enabled.
-# endif
-
-/* If uClibc was built without large file support and _LARGEFILE64_SOURCE
- * is defined, undefine it. */
-# ifdef _LARGEFILE64_SOURCE
-# undef _LARGEFILE64_SOURCE
-# undef __USE_LARGEFILE64
-# endif
-
-/* If we're actually building uClibc with large file support,
- * define __USE_LARGEFILE64 and __USE_LARGEFILE. */
-#elif defined _LIBC
-# undef _LARGEFILE_SOURCE
-# undef _LARGEFILE64_SOURCE
-# undef _FILE_OFFSET_BITS
-# undef __USE_LARGEFILE
-# undef __USE_LARGEFILE64
-# undef __USE_FILE_OFFSET64
-# define _LARGEFILE_SOURCE 1
-# define _LARGEFILE64_SOURCE 1
-# define __USE_LARGEFILE 1
-# define __USE_LARGEFILE64 1
-#endif
-
#ifdef _LIBC
+# ifdef __UCLIBC_HAS_LFS__
+# undef _FILE_OFFSET_BITS
+# undef __USE_FILE_OFFSET64
+# endif
# include <libc-internal.h>
#endif
-/* Some people like to build up uClibc with *-elf toolchains, so
- * a little grease here until we drop '#ifdef __linux__' checks
- * from our source code.
- */
-#ifndef __linux__
-# define __linux__ 1
-#endif
-
#endif /* features.h */
diff --git a/include/ieee754.h b/include/ieee754.h
index 7131e5de6..b17c29ab7 100644
--- a/include/ieee754.h
+++ b/include/ieee754.h
@@ -80,7 +80,7 @@ union ieee754_double
unsigned int mantissa1:32;
#endif /* Big endian. */
#if __BYTE_ORDER == __LITTLE_ENDIAN
-# if __FLOAT_WORD_ORDER == BIG_ENDIAN
+# if __FLOAT_WORD_ORDER == __BIG_ENDIAN
unsigned int mantissa0:20;
unsigned int exponent:11;
unsigned int negative:1;
@@ -106,7 +106,7 @@ union ieee754_double
unsigned int mantissa0:19;
unsigned int mantissa1:32;
#else
-# if __FLOAT_WORD_ORDER == BIG_ENDIAN
+# if __FLOAT_WORD_ORDER == __BIG_ENDIAN
unsigned int mantissa0:19;
unsigned int quiet_nan:1;
unsigned int exponent:11;
@@ -142,7 +142,7 @@ union ieee854_long_double
unsigned int mantissa1:32;
#endif
#if __BYTE_ORDER == __LITTLE_ENDIAN
-# if __FLOAT_WORD_ORDER == BIG_ENDIAN
+# if __FLOAT_WORD_ORDER == __BIG_ENDIAN
unsigned int exponent:15;
unsigned int negative:1;
unsigned int empty:16;
@@ -171,7 +171,7 @@ union ieee854_long_double
unsigned int mantissa1:32;
#endif
#if __BYTE_ORDER == __LITTLE_ENDIAN
-# if __FLOAT_WORD_ORDER == BIG_ENDIAN
+# if __FLOAT_WORD_ORDER == __BIG_ENDIAN
unsigned int exponent:15;
unsigned int negative:1;
unsigned int empty:16;
diff --git a/include/inttypes.h b/include/inttypes.h
index b1d4302a2..137d3dbd4 100644
--- a/include/inttypes.h
+++ b/include/inttypes.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 1997, 1998, 1999, 2000, 2001 Free Software Foundation, Inc.
+/* Copyright (C) 1997-2001, 2004, 2007 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -70,8 +70,8 @@ typedef wchar_t __gwchar_t;
# define PRIdLEAST64 __PRI64_PREFIX "d"
# define PRIdFAST8 "d"
-# define PRIdFAST16 "d"
-# define PRIdFAST32 "d"
+# define PRIdFAST16 __PRIPTR_PREFIX "d"
+# define PRIdFAST32 __PRIPTR_PREFIX "d"
# define PRIdFAST64 __PRI64_PREFIX "d"
@@ -86,8 +86,8 @@ typedef wchar_t __gwchar_t;
# define PRIiLEAST64 __PRI64_PREFIX "i"
# define PRIiFAST8 "i"
-# define PRIiFAST16 "i"
-# define PRIiFAST32 "i"
+# define PRIiFAST16 __PRIPTR_PREFIX "i"
+# define PRIiFAST32 __PRIPTR_PREFIX "i"
# define PRIiFAST64 __PRI64_PREFIX "i"
/* Octal notation. */
@@ -102,8 +102,8 @@ typedef wchar_t __gwchar_t;
# define PRIoLEAST64 __PRI64_PREFIX "o"
# define PRIoFAST8 "o"
-# define PRIoFAST16 "o"
-# define PRIoFAST32 "o"
+# define PRIoFAST16 __PRIPTR_PREFIX "o"
+# define PRIoFAST32 __PRIPTR_PREFIX "o"
# define PRIoFAST64 __PRI64_PREFIX "o"
/* Unsigned integers. */
@@ -118,8 +118,8 @@ typedef wchar_t __gwchar_t;
# define PRIuLEAST64 __PRI64_PREFIX "u"
# define PRIuFAST8 "u"
-# define PRIuFAST16 "u"
-# define PRIuFAST32 "u"
+# define PRIuFAST16 __PRIPTR_PREFIX "u"
+# define PRIuFAST32 __PRIPTR_PREFIX "u"
# define PRIuFAST64 __PRI64_PREFIX "u"
/* lowercase hexadecimal notation. */
@@ -134,8 +134,8 @@ typedef wchar_t __gwchar_t;
# define PRIxLEAST64 __PRI64_PREFIX "x"
# define PRIxFAST8 "x"
-# define PRIxFAST16 "x"
-# define PRIxFAST32 "x"
+# define PRIxFAST16 __PRIPTR_PREFIX "x"
+# define PRIxFAST32 __PRIPTR_PREFIX "x"
# define PRIxFAST64 __PRI64_PREFIX "x"
/* UPPERCASE hexadecimal notation. */
@@ -150,8 +150,8 @@ typedef wchar_t __gwchar_t;
# define PRIXLEAST64 __PRI64_PREFIX "X"
# define PRIXFAST8 "X"
-# define PRIXFAST16 "X"
-# define PRIXFAST32 "X"
+# define PRIXFAST16 __PRIPTR_PREFIX "X"
+# define PRIXFAST32 __PRIPTR_PREFIX "X"
# define PRIXFAST64 __PRI64_PREFIX "X"
@@ -311,7 +311,7 @@ extern intmax_t strtoimax (__const char *__restrict __nptr,
extern uintmax_t strtoumax (__const char *__restrict __nptr,
char ** __restrict __endptr, int __base) __THROW;
-#if defined __UCLIBC_HAS_WCHAR__ && __UCLIBC_HAS_WCHAR__
+#ifdef __UCLIBC_HAS_WCHAR__
/* Like `wcstol' but convert to `intmax_t'. */
extern intmax_t wcstoimax (__const __gwchar_t *__restrict __nptr,
__gwchar_t **__restrict __endptr, int __base)
@@ -323,6 +323,126 @@ extern uintmax_t wcstoumax (__const __gwchar_t *__restrict __nptr,
__THROW;
#endif
+#if 0 /*def __USE_EXTERN_INLINES*/
+
+# if __WORDSIZE == 64
+
+extern long int __strtol_internal (__const char *__restrict __nptr,
+ char **__restrict __endptr,
+ int __base, int __group)
+ __THROW __nonnull ((1)) __wur;
+/* Like `strtol' but convert to `intmax_t'. */
+__extern_inline intmax_t
+__NTH (strtoimax (__const char *__restrict nptr, char **__restrict endptr,
+ int base))
+{
+ return __strtol_internal (nptr, endptr, base, 0);
+}
+
+extern unsigned long int __strtoul_internal (__const char *
+ __restrict __nptr,
+ char ** __restrict __endptr,
+ int __base, int __group)
+ __THROW __nonnull ((1)) __wur;
+/* Like `strtoul' but convert to `uintmax_t'. */
+__extern_inline uintmax_t
+__NTH (strtoumax (__const char *__restrict nptr, char **__restrict endptr,
+ int base))
+{
+ return __strtoul_internal (nptr, endptr, base, 0);
+}
+
+extern long int __wcstol_internal (__const __gwchar_t * __restrict __nptr,
+ __gwchar_t **__restrict __endptr,
+ int __base, int __group)
+ __THROW __nonnull ((1)) __wur;
+/* Like `wcstol' but convert to `intmax_t'. */
+__extern_inline intmax_t
+__NTH (wcstoimax (__const __gwchar_t *__restrict nptr,
+ __gwchar_t **__restrict endptr, int base))
+{
+ return __wcstol_internal (nptr, endptr, base, 0);
+}
+
+extern unsigned long int __wcstoul_internal (__const __gwchar_t *
+ __restrict __nptr,
+ __gwchar_t **
+ __restrict __endptr,
+ int __base, int __group)
+ __THROW __nonnull ((1)) __wur;
+/* Like `wcstoul' but convert to `uintmax_t'. */
+__extern_inline uintmax_t
+__NTH (wcstoumax (__const __gwchar_t *__restrict nptr,
+ __gwchar_t **__restrict endptr, int base))
+{
+ return __wcstoul_internal (nptr, endptr, base, 0);
+}
+
+# else /* __WORDSIZE == 32 */
+
+__extension__
+extern long long int __strtoll_internal (__const char *__restrict __nptr,
+ char **__restrict __endptr,
+ int __base, int __group)
+ __THROW __nonnull ((1)) __wur;
+/* Like `strtol' but convert to `intmax_t'. */
+__extern_inline intmax_t
+__NTH (strtoimax (__const char *__restrict nptr, char **__restrict endptr,
+ int base))
+{
+ return __strtoll_internal (nptr, endptr, base, 0);
+}
+
+__extension__
+extern unsigned long long int __strtoull_internal (__const char *
+ __restrict __nptr,
+ char **
+ __restrict __endptr,
+ int __base,
+ int __group)
+ __THROW __nonnull ((1)) __wur;
+/* Like `strtoul' but convert to `uintmax_t'. */
+__extern_inline uintmax_t
+__NTH (strtoumax (__const char *__restrict nptr, char **__restrict endptr,
+ int base))
+{
+ return __strtoull_internal (nptr, endptr, base, 0);
+}
+
+__extension__
+extern long long int __wcstoll_internal (__const __gwchar_t *
+ __restrict __nptr,
+ __gwchar_t **__restrict __endptr,
+ int __base, int __group)
+ __THROW __nonnull ((1)) __wur;
+/* Like `wcstol' but convert to `intmax_t'. */
+__extern_inline intmax_t
+__NTH (wcstoimax (__const __gwchar_t *__restrict nptr,
+ __gwchar_t **__restrict endptr, int base))
+{
+ return __wcstoll_internal (nptr, endptr, base, 0);
+}
+
+
+__extension__
+extern unsigned long long int __wcstoull_internal (__const __gwchar_t *
+ __restrict __nptr,
+ __gwchar_t **
+ __restrict __endptr,
+ int __base,
+ int __group)
+ __THROW __nonnull ((1)) __wur;
+/* Like `wcstoul' but convert to `uintmax_t'. */
+__extern_inline uintmax_t
+__NTH (wcstoumax (__const __gwchar_t *__restrict nptr,
+ __gwchar_t **__restrict endptr, int base))
+{