diff options
author | joseph <joseph@7b3dc134-2b1b-0410-93df-9e9f96275f8d> | 2012-02-08 16:44:31 +0000 |
---|---|---|
committer | joseph <joseph@7b3dc134-2b1b-0410-93df-9e9f96275f8d> | 2012-02-08 16:44:31 +0000 |
commit | 78be84cd747c2e3965bf6c2fd5f702d6ff2f5525 (patch) | |
tree | c070a60ef7c5371bef8b7a559442a6920b394c8e /libc/libio | |
parent | de06548e980675e65a1e6d850bb8c3a3f7ec638d (diff) | |
download | eglibc2-78be84cd747c2e3965bf6c2fd5f702d6ff2f5525.tar.gz |
Merge changes between r16568 and r17050 from /fsf/trunk.
git-svn-id: svn://svn.eglibc.org/trunk@17051 7b3dc134-2b1b-0410-93df-9e9f96275f8d
Diffstat (limited to 'libc/libio')
-rw-r--r-- | libc/libio/bits/stdio.h | 4 | ||||
-rw-r--r-- | libc/libio/bits/stdio2.h | 63 | ||||
-rw-r--r-- | libc/libio/filedoalloc.c | 4 | ||||
-rw-r--r-- | libc/libio/fileops.c | 4 | ||||
-rw-r--r-- | libc/libio/genops.c | 4 | ||||
-rw-r--r-- | libc/libio/iofclose.c | 4 | ||||
-rw-r--r-- | libc/libio/iofdopen.c | 6 | ||||
-rw-r--r-- | libc/libio/iofopen.c | 4 | ||||
-rw-r--r-- | libc/libio/iofopen64.c | 4 | ||||
-rw-r--r-- | libc/libio/iogetdelim.c | 5 | ||||
-rw-r--r-- | libc/libio/iopopen.c | 4 | ||||
-rw-r--r-- | libc/libio/libio.h | 24 | ||||
-rw-r--r-- | libc/libio/libioP.h | 14 | ||||
-rw-r--r-- | libc/libio/obprintf.c | 4 | ||||
-rw-r--r-- | libc/libio/oldfileops.c | 4 | ||||
-rw-r--r-- | libc/libio/oldiofclose.c | 5 | ||||
-rw-r--r-- | libc/libio/oldiofdopen.c | 6 | ||||
-rw-r--r-- | libc/libio/oldiofopen.c | 4 | ||||
-rw-r--r-- | libc/libio/oldiopopen.c | 4 | ||||
-rw-r--r-- | libc/libio/stdio.h | 140 | ||||
-rw-r--r-- | libc/libio/wfiledoalloc.c | 4 | ||||
-rw-r--r-- | libc/libio/wgenops.c | 5 |
22 files changed, 137 insertions, 183 deletions
diff --git a/libc/libio/bits/stdio.h b/libc/libio/bits/stdio.h index 49303c690..7fb1b8423 100644 --- a/libc/libio/bits/stdio.h +++ b/libc/libio/bits/stdio.h @@ -1,5 +1,5 @@ /* Optimizing macros and inline functions for stdio functions. - Copyright (C) 1998, 2000, 2001, 2004, 2007 Free Software Foundation, Inc. + Copyright (C) 1998,2000,2001,2004,2007,2012 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 @@ -34,7 +34,7 @@ # if !(__USE_FORTIFY_LEVEL > 0 && defined __extern_always_inline) /* Write formatted output to stdout from argument list ARG. */ __STDIO_INLINE int -vprintf (__const char *__restrict __fmt, _G_va_list __arg) +vprintf (const char *__restrict __fmt, _G_va_list __arg) { return vfprintf (stdout, __fmt, __arg); } diff --git a/libc/libio/bits/stdio2.h b/libc/libio/bits/stdio2.h index 8c25aaae5..cbccea7f3 100644 --- a/libc/libio/bits/stdio2.h +++ b/libc/libio/bits/stdio2.h @@ -1,5 +1,5 @@ /* Checking macros for stdio functions. - Copyright (C) 2004, 2005, 2007, 2008 Free Software Foundation, Inc. + Copyright (C) 2004, 2005, 2007, 2008, 2012 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 @@ -22,14 +22,14 @@ #endif extern int __sprintf_chk (char *__restrict __s, int __flag, size_t __slen, - __const char *__restrict __format, ...) __THROW; + const char *__restrict __format, ...) __THROW; extern int __vsprintf_chk (char *__restrict __s, int __flag, size_t __slen, - __const char *__restrict __format, + const char *__restrict __format, _G_va_list __ap) __THROW; #ifdef __va_arg_pack __extern_always_inline int -__NTH (sprintf (char *__restrict __s, __const char *__restrict __fmt, ...)) +__NTH (sprintf (char *__restrict __s, const char *__restrict __fmt, ...)) { return __builtin___sprintf_chk (__s, __USE_FORTIFY_LEVEL - 1, __bos (__s), __fmt, __va_arg_pack ()); @@ -41,7 +41,7 @@ __NTH (sprintf (char *__restrict __s, __const char *__restrict __fmt, ...)) #endif __extern_always_inline int -__NTH (vsprintf (char *__restrict __s, __const char *__restrict __fmt, +__NTH (vsprintf (char *__restrict __s, const char *__restrict __fmt, _G_va_list __ap)) { return __builtin___vsprintf_chk (__s, __USE_FORTIFY_LEVEL - 1, @@ -51,16 +51,16 @@ __NTH (vsprintf (char *__restrict __s, __const char *__restrict __fmt, #if defined __USE_BSD || defined __USE_ISOC99 || defined __USE_UNIX98 extern int __snprintf_chk (char *__restrict __s, size_t __n, int __flag, - size_t __slen, __const char *__restrict __format, + size_t __slen, const char *__restrict __format, ...) __THROW; extern int __vsnprintf_chk (char *__restrict __s, size_t __n, int __flag, - size_t __slen, __const char *__restrict __format, + size_t __slen, const char *__restrict __format, _G_va_list __ap) __THROW; # ifdef __va_arg_pack __extern_always_inline int __NTH (snprintf (char *__restrict __s, size_t __n, - __const char *__restrict __fmt, ...)) + const char *__restrict __fmt, ...)) { return __builtin___snprintf_chk (__s, __n, __USE_FORTIFY_LEVEL - 1, __bos (__s), __fmt, __va_arg_pack ()); @@ -73,7 +73,7 @@ __NTH (snprintf (char *__restrict __s, size_t __n, __extern_always_inline int __NTH (vsnprintf (char *__restrict __s, size_t __n, - __const char *__restrict __fmt, _G_va_list __ap)) + const char *__restrict __fmt, _G_va_list __ap)) { return __builtin___vsnprintf_chk (__s, __n, __USE_FORTIFY_LEVEL - 1, __bos (__s), __fmt, __ap); @@ -84,23 +84,23 @@ __NTH (vsnprintf (char *__restrict __s, size_t __n, #if __USE_FORTIFY_LEVEL > 1 extern int __fprintf_chk (FILE *__restrict __stream, int __flag, - __const char *__restrict __format, ...); -extern int __printf_chk (int __flag, __const char *__restrict __format, ...); + const char *__restrict __format, ...); +extern int __printf_chk (int __flag, const char *__restrict __format, ...); extern int __vfprintf_chk (FILE *__restrict __stream, int __flag, - __const char *__restrict __format, _G_va_list __ap); -extern int __vprintf_chk (int __flag, __const char *__restrict __format, + const char *__restrict __format, _G_va_list __ap); +extern int __vprintf_chk (int __flag, const char *__restrict __format, _G_va_list __ap); # ifdef __va_arg_pack __extern_always_inline int -fprintf (FILE *__restrict __stream, __const char *__restrict __fmt, ...) +fprintf (FILE *__restrict __stream, const char *__restrict __fmt, ...) { return __fprintf_chk (__stream, __USE_FORTIFY_LEVEL - 1, __fmt, __va_arg_pack ()); } __extern_always_inline int -printf (__const char *__restrict __fmt, ...) +printf (const char *__restrict __fmt, ...) { return __printf_chk (__USE_FORTIFY_LEVEL - 1, __fmt, __va_arg_pack ()); } @@ -112,7 +112,7 @@ printf (__const char *__restrict __fmt, ...) # endif __extern_always_inline int -vprintf (__const char *__restrict __fmt, _G_va_list __ap) +vprintf (const char *__restrict __fmt, _G_va_list __ap) { #ifdef __USE_EXTERN_INLINES return __vfprintf_chk (stdout, __USE_FORTIFY_LEVEL - 1, __fmt, __ap); @@ -123,7 +123,7 @@ vprintf (__const char *__restrict __fmt, _G_va_list __ap) __extern_always_inline int vfprintf (FILE *__restrict __stream, - __const char *__restrict __fmt, _G_va_list __ap) + const char *__restrict __fmt, _G_va_list __ap) { return __vfprintf_chk (__stream, __USE_FORTIFY_LEVEL - 1, __fmt, __ap); } @@ -131,36 +131,36 @@ vfprintf (FILE *__restrict __stream, # ifdef __USE_GNU extern int __asprintf_chk (char **__restrict __ptr, int __flag, - __const char *__restrict __fmt, ...) + const char *__restrict __fmt, ...) __THROW __attribute__ ((__format__ (__printf__, 3, 4))) __wur; extern int __vasprintf_chk (char **__restrict __ptr, int __flag, - __const char *__restrict __fmt, _G_va_list __arg) + const char *__restrict __fmt, _G_va_list __arg) __THROW __attribute__ ((__format__ (__printf__, 3, 0))) __wur; -extern int __dprintf_chk (int __fd, int __flag, __const char *__restrict __fmt, +extern int __dprintf_chk (int __fd, int __flag, const char *__restrict __fmt, ...) __attribute__ ((__format__ (__printf__, 3, 4))); extern int __vdprintf_chk (int __fd, int __flag, - __const char *__restrict __fmt, _G_va_list __arg) + const char *__restrict __fmt, _G_va_list __arg) __attribute__ ((__format__ (__printf__, 3, 0))); extern int __obstack_printf_chk (struct obstack *__restrict __obstack, - int __flag, __const char *__restrict __format, + int __flag, const char *__restrict __format, ...) __THROW __attribute__ ((__format__ (__printf__, 3, 4))); extern int __obstack_vprintf_chk (struct obstack *__restrict __obstack, int __flag, - __const char *__restrict __format, + const char *__restrict __format, _G_va_list __args) __THROW __attribute__ ((__format__ (__printf__, 3, 0))); # ifdef __va_arg_pack __extern_always_inline int -__NTH (asprintf (char **__restrict __ptr, __const char *__restrict __fmt, ...)) +__NTH (asprintf (char **__restrict __ptr, const char *__restrict __fmt, ...)) { return __asprintf_chk (__ptr, __USE_FORTIFY_LEVEL - 1, __fmt, __va_arg_pack ()); } __extern_always_inline int -__NTH (__asprintf (char **__restrict __ptr, __const char *__restrict __fmt, +__NTH (__asprintf (char **__restrict __ptr, const char *__restrict __fmt, ...)) { return __asprintf_chk (__ptr, __USE_FORTIFY_LEVEL - 1, __fmt, @@ -168,7 +168,7 @@ __NTH (__asprintf (char **__restrict __ptr, __const char *__restrict __fmt, } __extern_always_inline int -dprintf (int __fd, __const char *__restrict __fmt, ...) +dprintf (int __fd, const char *__restrict __fmt, ...) { return __dprintf_chk (__fd, __USE_FORTIFY_LEVEL - 1, __fmt, __va_arg_pack ()); @@ -176,7 +176,7 @@ dprintf (int __fd, __const char *__restrict __fmt, ...) __extern_always_inline int __NTH (obstack_printf (struct obstack *__restrict __obstack, - __const char *__restrict __fmt, ...)) + const char *__restrict __fmt, ...)) { return __obstack_printf_chk (__obstack, __USE_FORTIFY_LEVEL - 1, __fmt, __va_arg_pack ()); @@ -193,21 +193,21 @@ __NTH (obstack_printf (struct obstack *__restrict __obstack, # endif __extern_always_inline int -__NTH (vasprintf (char **__restrict __ptr, __const char *__restrict __fmt, +__NTH (vasprintf (char **__restrict __ptr, const char *__restrict __fmt, _G_va_list __ap)) { return __vasprintf_chk (__ptr, __USE_FORTIFY_LEVEL - 1, __fmt, __ap); } __extern_always_inline int -vdprintf (int __fd, __const char *__restrict __fmt, _G_va_list __ap) +vdprintf (int __fd, const char *__restrict __fmt, _G_va_list __ap) { return __vdprintf_chk (__fd, __USE_FORTIFY_LEVEL - 1, __fmt, __ap); } __extern_always_inline int __NTH (obstack_vprintf (struct obstack *__restrict __obstack, - __const char *__restrict __fmt, _G_va_list __ap)) + const char *__restrict __fmt, _G_va_list __ap)) { return __obstack_vprintf_chk (__obstack, __USE_FORTIFY_LEVEL - 1, __fmt, __ap); @@ -217,6 +217,8 @@ __NTH (obstack_vprintf (struct obstack *__restrict __obstack, #endif +#if !defined __USE_ISOC11 \ + || (defined __cplusplus && __cplusplus <= 201103L && !defined __USE_GNU) extern char *__gets_chk (char *__str, size_t) __wur; extern char *__REDIRECT (__gets_warn, (char *__str), gets) __wur __warnattr ("please use fgets or getline instead, gets can't " @@ -229,6 +231,7 @@ gets (char *__str) return __gets_chk (__str, __bos (__str)); return __gets_warn (__str); } +#endif extern char *__fgets_chk (char *__restrict __s, size_t __size, int __n, FILE *__restrict __stream) __wur; diff --git a/libc/libio/filedoalloc.c b/libc/libio/filedoalloc.c index 4f62dcd91..6cbe2e242 100644 --- a/libc/libio/filedoalloc.c +++ b/libc/libio/filedoalloc.c @@ -1,4 +1,4 @@ -/* Copyright (C) 1993, 1997, 2001, 2002, 2011 Free Software Foundation, Inc. +/* Copyright (C) 1993, 1997, 2001-2002, 2011-2012 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 @@ -62,10 +62,8 @@ #include "libioP.h" #include <sys/types.h> #include <sys/stat.h> -#ifdef __STDC__ #include <stdlib.h> #include <unistd.h> -#endif #ifdef _LIBC # undef isatty diff --git a/libc/libio/fileops.c b/libc/libio/fileops.c index 429e2c9c6..dd20536f1 100644 --- a/libc/libio/fileops.c +++ b/libc/libio/fileops.c @@ -1,4 +1,4 @@ -/* Copyright (C) 1993, 1995, 1997-2005, 2006, 2007, 2008, 2009, 2011 +/* Copyright (C) 1993, 1995, 1997-2005, 2006, 2007, 2008, 2009, 2011-2012 Free Software Foundation, Inc. This file is part of the GNU C Library. Written by Per Bothner <bothner@cygnus.com>. @@ -41,9 +41,7 @@ #include <errno.h> #include <unistd.h> #include <gnu/option-groups.h> -#ifdef __STDC__ #include <stdlib.h> -#endif #if _LIBC # include "../wcsmbs/wcsmbsload.h" # include "../iconv/gconv_charset.h" diff --git a/libc/libio/genops.c b/libc/libio/genops.c index bb40c3435..aa5045654 100644 --- a/libc/libio/genops.c +++ b/libc/libio/genops.c @@ -1,4 +1,4 @@ -/* Copyright (C) 1993,1995,1997-2002, 2003, 2004, 2006, 2007, 2011 +/* Copyright (C) 1993,1995,1997-2002, 2003, 2004, 2006, 2007, 2011-2012 Free Software Foundation, Inc. This file is part of the GNU C Library. @@ -29,9 +29,7 @@ /* Generic or default I/O operations. */ #include "libioP.h" -#ifdef __STDC__ #include <stdlib.h> -#endif #include <string.h> #include <stdbool.h> #ifdef _LIBC diff --git a/libc/libio/iofclose.c b/libc/libio/iofclose.c index aa2ba4006..64e025b97 100644 --- a/libc/libio/iofclose.c +++ b/libc/libio/iofclose.c @@ -1,4 +1,4 @@ -/* Copyright (C) 1993,1995,1997-2004,2005 Free Software Foundation, Inc. +/* Copyright (C) 1993,1995,1997-2004,2005,2012 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 @@ -26,9 +26,7 @@ in files containing the exception. */ #include "libioP.h" -#ifdef __STDC__ #include <stdlib.h> -#endif #if _LIBC # include "../iconv/gconv_int.h" # include <shlib-compat.h> diff --git a/libc/libio/iofdopen.c b/libc/libio/iofdopen.c index 7f6e593e8..59f44147a 100644 --- a/libc/libio/iofdopen.c +++ b/libc/libio/iofdopen.c @@ -1,4 +1,4 @@ -/* Copyright (C) 1993,1994,1997,1998,1999,2000,2002,2003,2010 +/* Copyright (C) 1993,1994,1997,1998,1999,2000,2002,2003,2010,2012 Free Software Foundation, Inc. This file is part of the GNU C Library. @@ -26,9 +26,7 @@ This exception applies to code released by its copyright holders in files containing the exception. */ -#ifdef __STDC__ -# include <stdlib.h> -#endif +#include <stdlib.h> #include "libioP.h" #include <fcntl.h> diff --git a/libc/libio/iofopen.c b/libc/libio/iofopen.c index 5051f7a7a..15374188b 100644 --- a/libc/libio/iofopen.c +++ b/libc/libio/iofopen.c @@ -1,4 +1,4 @@ -/* Copyright (C) 1993,1997,1998,1999,2000,2002,2003 +/* Copyright (C) 1993,1997,1998,1999,2000,2002,2003,2012 Free Software Foundation, Inc. This file is part of the GNU C Library. @@ -27,10 +27,8 @@ in files containing the exception. */ #include "libioP.h" -#ifdef __STDC__ #include <stdlib.h> #include <stddef.h> -#endif #ifdef _LIBC # include <shlib-compat.h> #else diff --git a/libc/libio/iofopen64.c b/libc/libio/iofopen64.c index 69e62b8cd..fe4dc99c9 100644 --- a/libc/libio/iofopen64.c +++ b/libc/libio/iofopen64.c @@ -1,4 +1,4 @@ -/* Copyright (C) 1993, 1997, 1999, 2000, 2002 Free Software Foundation, Inc. +/* Copyright (C) 1993,1997,1999,2000,2002,2012 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 @@ -26,9 +26,7 @@ in files containing the exception. */ #include "libioP.h" -#ifdef __STDC__ #include <stdlib.h> -#endif _IO_FILE * _IO_fopen64 (filename, mode) diff --git a/libc/libio/iogetdelim.c b/libc/libio/iogetdelim.c index a362bf978..3ee7eac87 100644 --- a/libc/libio/iogetdelim.c +++ b/libc/libio/iogetdelim.c @@ -1,4 +1,5 @@ -/* Copyright (C) 1994,1996-1998,2001,2003,2005 Free Software Foundation, Inc. +/* Copyright (C) 1994,1996-1998,2001,2003,2005,2012 + 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 @@ -25,9 +26,7 @@ This exception applies to code released by its copyright holders in files containing the exception. */ -#ifdef __STDC__ #include <stdlib.h> -#endif #include "libioP.h" #include <string.h> #include <errno.h> diff --git a/libc/libio/iopopen.c b/libc/libio/iopopen.c index 1a5cc0f59..1b2b65438 100644 --- a/libc/libio/iopopen.c +++ b/libc/libio/iopopen.c @@ -1,4 +1,4 @@ -/* Copyright (C) 1993, 1997-2002, 2003, 2004, 2007, 2008 +/* Copyright (C) 1993, 1997-2002, 2003, 2004, 2007, 2008, 2012 Free Software Foundation, Inc. This file is part of the GNU C Library. Written by Per Bothner <bothner@cygnus.com>. @@ -34,9 +34,7 @@ #if _IO_HAVE_SYS_WAIT #include <signal.h> #include <unistd.h> -#ifdef __STDC__ #include <stdlib.h> -#endif #ifdef _LIBC # include <unistd.h> # include <shlib-compat.h> diff --git a/libc/libio/libio.h b/libc/libio/libio.h index bebc112a3..c37211f8e 100644 --- a/libc/libio/libio.h +++ b/libc/libio/libio.h @@ -1,4 +1,5 @@ -/* Copyright (C) 1991-1995,1997-2006,2007,2009,2011 Free Software Foundation, Inc. +/* Copyright (C) 1991-1995,1997-2007,2009,2011,2012 + Free Software Foundation, Inc. This file is part of the GNU C Library. Written by Per Bothner <bothner@cygnus.com>. @@ -61,26 +62,11 @@ # if _G_HAVE_SYS_CDEFS # include <sys/cdefs.h> # else -# ifdef __STDC__ -# define __P(p) p -# define __PMT(p) p -# else -# define __P(p) () -# define __PMT(p) () -# endif +# define __P(p) p +# define __PMT(p) p # endif #endif /*!__P*/ -/* For backward compatibility */ -#ifndef _PARAMS -# define _PARAMS(protos) __P(protos) -#endif /*!_PARAMS*/ - -#ifndef __STDC__ -# ifndef const -# define const -# endif -#endif #define _IO_UNIFIED_JUMPTABLES 1 #ifndef _G_HAVE_PRINTF_FP # define _IO_USE_DTOA 1 @@ -371,7 +357,7 @@ typedef __ssize_t __io_read_fn (void *__cookie, char *__buf, size_t __nbytes); opened for append (__mode.__append set), then set the file pointer to the end of the file and then do the write; if not, just write at the current file pointer. */ -typedef __ssize_t __io_write_fn (void *__cookie, __const char *__buf, +typedef __ssize_t __io_write_fn (void *__cookie, const char *__buf, size_t __n); /* Move COOKIE's file position to *POS bytes from the diff --git a/libc/libio/libioP.h b/libc/libio/libioP.h index ee6e52c2f..20aae3ed1 100644 --- a/libc/libio/libioP.h +++ b/libc/libio/libioP.h @@ -1,4 +1,4 @@ -/* Copyright (C) 1993, 1997-2003,2004,2005,2006,2007 +/* Copyright (C) 1993, 1997-2003,2004,2005,2006,2007,2012 Free Software Foundation, Inc. This file is part of the GNU C Library. @@ -650,11 +650,11 @@ extern _IO_off64_t _IO_wstr_seekoff (_IO_FILE *, _IO_off64_t, int, int) extern _IO_wint_t _IO_wstr_pbackfail (_IO_FILE *, _IO_wint_t) __THROW; extern void _IO_wstr_finish (_IO_FILE *, int) __THROW; -extern int _IO_vasprintf (char **result_ptr, __const char *format, +extern int _IO_vasprintf (char **result_ptr, const char *format, _IO_va_list args) __THROW; -extern int _IO_vdprintf (int d, __const char *format, _IO_va_list arg); +extern int _IO_vdprintf (int d, const char *format, _IO_va_list arg); extern int _IO_vsnprintf (char *string, _IO_size_t maxlen, - __const char *format, _IO_va_list args) __THROW; + const char *format, _IO_va_list args) __THROW; extern _IO_size_t _IO_getline (_IO_FILE *,char *, _IO_size_t, int, int); @@ -943,11 +943,7 @@ VTABLE_LABEL(builtinbuf_vtable, builtinbuf, 10) # endif #endif /* !defined(builtinbuf_vtable) && defined(__cplusplus) */ -#if defined(__STDC__) || defined(__cplusplus) -# define _IO_va_start(args, last) va_start(args, last) -#else -# define _IO_va_start(args, last) va_start(args) -#endif +#define _IO_va_start(args, last) va_start(args, last) extern struct _IO_fake_stdiobuf _IO_stdin_buf, _IO_stdout_buf, _IO_stderr_buf; diff --git a/libc/libio/obprintf.c b/libc/libio/obprintf.c index c715c2d4a..d099e56a5 100644 --- a/libc/libio/obprintf.c +++ b/libc/libio/obprintf.c @@ -1,5 +1,5 @@ /* Print output of stream to given obstack. - Copyright (C) 1996,1997,1999,2000,2001,2002,2003,2004,2005,2006,2008 + Copyright (C) 1996,1997,1999,2000,2001,2002,2003,2004,2005,2006,2008,2012 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by Ulrich Drepper <drepper@cygnus.com>, 1996. @@ -20,9 +20,7 @@ 02111-1307 USA. */ -#ifdef __STDC__ #include <stdlib.h> -#endif #include "libioP.h" #include "strfile.h" #include <assert.h> diff --git a/libc/libio/oldfileops.c b/libc/libio/oldfileops.c index 3e3daa8ae..900d30296 100644 --- a/libc/libio/oldfileops.c +++ b/libc/libio/oldfileops.c @@ -1,4 +1,4 @@ -/* Copyright (C) 1993, 1995, 1997-2004, 2005, 2007, 2011 +/* Copyright (C) 1993, 1995, 1997-2004, 2005, 2007, 2011-2012 Free Software Foundation, Inc. This file is part of the GNU C Library. Written by Per Bothner <bothner@cygnus.com>. @@ -42,9 +42,7 @@ #include <sys/stat.h> #include <string.h> #include <errno.h> -#ifdef __STDC__ #include <stdlib.h> -#endif #ifndef errno extern int errno; #endif diff --git a/libc/libio/oldiofclose.c b/libc/libio/oldiofclose.c index 62c315411..34829eae9 100644 --- a/libc/libio/oldiofclose.c +++ b/libc/libio/oldiofclose.c @@ -1,4 +1,5 @@ -/* Copyright (C) 1993,1995,1997-2002,2004,2005 Free Software Foundation, Inc. +/* Copyright (C) 1993,1995,1997-2002,2004,2005,2012 + 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 @@ -30,9 +31,7 @@ #define _IO_USE_OLD_IO_FILE #include "libioP.h" -#ifdef __STDC__ #include <stdlib.h> -#endif int attribute_compat_text_section diff --git a/libc/libio/oldiofdopen.c b/libc/libio/oldiofdopen.c index a1fc6675a..824c7be3e 100644 --- a/libc/libio/oldiofdopen.c +++ b/libc/libio/oldiofdopen.c @@ -1,4 +1,4 @@ -/* Copyright (C) 1993,94,97,99,2000,2002,2003,2004 +/* Copyright (C) 1993,94,97,99,2000,2002,2003,2004,2012 Free Software Foundation, Inc. This file is part of the GNU C Library. @@ -30,9 +30,7 @@ #if SHLIB_COMPAT (libc, GLIBC_2_0, GLIBC_2_1) #define _IO_USE_OLD_IO_FILE -#ifdef __STDC__ -# include <stdlib.h> -#endif +#include <stdlib.h> #include "libioP.h" #include <fcntl.h> diff --git a/libc/libio/oldiofopen.c b/libc/libio/oldiofopen.c index c761580a7..fcbc44366 100644 --- a/libc/libio/oldiofopen.c +++ b/libc/libio/oldiofopen.c @@ -1,4 +1,4 @@ -/* Copyright (C) 1993,1997,1999,2000,2002,2003,2004 +/* Copyright (C) 1993,1997,1999,2000,2002,2003,2004,2012 Free Software Foundation, Inc. This file is part of the GNU C Library. @@ -31,9 +31,7 @@ #define _IO_USE_OLD_IO_FILE #include "libioP.h" -#ifdef __STDC__ #include <stdlib.h> -#endif _IO_FILE * diff --git a/libc/libio/oldiopopen.c b/libc/libio/oldiopopen.c index 2fa1ac5a3..fe09aed84 100644 --- a/libc/libio/oldiopopen.c +++ b/libc/libio/oldiopopen.c @@ -1,4 +1,4 @@ -/* Copyright (C) 1998-2002, 2004 Free Software Foundation, Inc. +/* Copyright (C) 1998-2002, 2004, 2012 Free Software Foundation, Inc. This file is part of the GNU C Library. Written by Per Bothner <bothner@cygnus.com>. @@ -34,9 +34,7 @@ #if _IO_HAVE_SYS_WAIT #include <signal.h> #include <unistd.h> -#ifdef __STDC__ #include <stdlib.h> -#endif #ifdef _LIBC # include <unistd.h> #endif diff --git a/libc/libio/stdio.h b/libc/libio/stdio.h index d9cb573b6..e2efcf452 100644 --- a/libc/libio/stdio.h +++ b/libc/libio/stdio.h @@ -176,15 +176,15 @@ extern struct _IO_FILE *stderr; /* Standard error output stream. */ __BEGIN_NAMESPACE_STD /* Remove file FILENAME. */ -extern int remove (__const char *__filename) __THROW; +extern int remove (const char *__filename) __THROW; /* Rename file OLD to NEW. */ -extern int rename (__const char *__old, __const char *__new) __THROW; +extern int rename (const char *__old, const char *__new) __THROW; __END_NAMESPACE_STD #ifdef __USE_ATFILE /* Rename file OLD relative to OLDFD to NEW relative to NEWFD. */ -extern int renameat (int __oldfd, __const char *__old, int __newfd, - __const char *__new) __THROW; +extern int renameat (int __oldfd, const char *__old, int __newfd, + const char *__new) __THROW; #endif __BEGIN_NAMESPACE_STD @@ -225,7 +225,7 @@ extern char *tmpnam_r (char *__s) __THROW __wur; If not and if DIR is not NULL, that value is checked. If that fails, P_tmpdir is tried and finally "/tmp". The storage for the filename is allocated by `malloc'. */ -extern char *tempnam (__const char *__dir, __const char *__pfx) +extern char *tempnam (const char *__dir, const char *__pfx) __THROW __attribute_malloc__ __wur; #endif @@ -270,22 +270,22 @@ __BEGIN_NAMESPACE_STD This function is a possible cancellation point and therefore not marked with __THROW. */ -extern FILE *fopen (__const char *__restrict __filename, - __const char *__restrict __modes) __wur; +extern FILE *fopen (const char *__restrict __filename, + const char *__restrict __modes) __wur; /* Open a file, replacing an existing stream with it. This function is a possible cancellation point and therefore not marked with __THROW. */ -extern FILE *freopen (__const char *__restrict __filename, - __const char *__restrict __modes, +extern FILE *freopen (const char *__restrict __filename, + const char *__restrict __modes, FILE *__restrict __stream) __wur; #else # ifdef __REDIRECT -extern FILE *__REDIRECT (fopen, (__const char *__restrict __filename, - __const char *__restrict __modes), fopen64) +extern FILE *__REDIRECT (fopen, (const char *__restrict __filename, + const char *__restrict __modes), fopen64) __wur; -extern FILE *__REDIRECT (freopen, (__const char *__restrict __filename, - __const char *__restrict __modes, +extern FILE *__REDIRECT (freopen, (const char *__restrict __filename, + const char *__restrict __modes, FILE *__restrict __stream), freopen64) __wur; # else @@ -295,29 +295,29 @@ extern FILE *__REDIRECT (freopen, (__const char *__restrict __filename, #endif __END_NAMESPACE_STD #ifdef __USE_LARGEFILE64 -extern FILE *fopen64 (__const char *__restrict __filename, - __const char *__restrict __modes) __wur; -extern FILE *freopen64 (__const char *__restrict __filename, - __const char *__restrict __modes, +extern FILE *fopen64 (const char *__restrict __filename, + const char *__restrict __modes) __wur; +extern FILE *freopen64 (const char *__restrict __filename, + const char *__restrict __modes, FILE *__restrict __stream) __wur; #endif #ifdef __USE_POSIX /* Create a new stream that refers to an existing system file descriptor. */ -extern FILE *fdopen (int __fd, __const char *__modes) __THROW __wur; +extern FILE *fdopen (int __fd, const char *__modes) __THROW __wur; #endif #ifdef __USE_GNU /* Create a new stream that refers to the given magic cookie, and uses the given functions for input and output. */ extern FILE *fopencookie (void *__restrict __magic_cookie, - __const char *__restrict __modes, + const char *__restrict __modes, _IO_cookie_io_functions_t __io_funcs) __THROW __wur; #endif #ifdef __USE_XOPEN2K8 /* Create a new stream that refers to a memory buffer. */ -extern FILE *fmemopen (void *__s, size_t __len, __const char *__modes) +extern FILE *fmemopen (void *__s, size_t __len, const char *__modes) __THROW __wur; /* Open a stream that writes into a malloc'd buffer that is expanded as @@ -355,29 +355,29 @@ __BEGIN_NAMESPACE_STD This function is a possible cancellation point and therefore not marked with __THROW. */ extern int fprintf (FILE *__restrict __stream, - __const char *__restrict __format, ...); + const char *__restrict __format, ...); /* Write formatted output to stdout. This function is a possible cancellation point and therefore not marked with __THROW. */ -extern int printf (__const char *__restrict __format, ...); +extern int printf (const char *__restrict __format, ...); /* Write formatted output to S. */ extern int sprintf (char *__restrict __s, - __const char *__restrict __format, ...) __THROWNL; + const char *__restrict __format, ...) __THROWNL; /* Write formatted output to S from argument list ARG. This function is a possible cancellation point and therefore not marked with __THROW. */ -extern int vfprintf (FILE *__restrict __s, __const char *__restrict __format, +extern int vfprintf (FILE *__restrict __s, const char *__restrict __format, _G_va_list __arg); /* Write formatted output to stdout from argument list ARG. This function is a possible cancellation point and therefore not marked with __THROW. */ -extern int vprintf (__const char *__restrict __format, _G_va_list __arg); +extern int vprintf (const char *__restrict __format, _G_va_list __arg); /* Write formatted output to S from argument list ARG. */ -extern int vsprintf (char *__restrict __s, __const char *__restrict __format, +extern int vsprintf (char *__restrict __s, const char *__restrict __format, _G_va_list __arg) __THROWNL; __END_NAMESPACE_STD @@ -385,11 +385,11 @@ __END_NAMESPACE_STD __BEGIN_NAMESPACE_C99 /* Maximum chars of output to write in MAXLEN. */ extern int snprintf (char *__restrict __s, size_t __maxlen, - __const char *__restrict __format, ...) + const char *__restrict __format, ...) __THROWNL __attribute__ ((__format__ (__printf__, 3, 4))); extern int vsnprintf (char *__restrict __s, size_t __maxlen, - __const char *__restrict __format, _G_va_list __arg) + const char *__restrict __format, _G_va_list __arg) __THROWNL __attribute__ ((__format__ (__printf__, 3, 0))); __END_NAMESPACE_C99 #endif @@ -397,14 +397,14 @@ __END_NAMESPACE_C99 #ifdef __USE_GNU /* Write formatted output to a string dynamically allocated with `malloc'. Store the address of the string in *PTR. */ -extern int vasprintf (char **__restrict __ptr, __const char *__restrict __f, +extern int vasprintf (char **__restrict __ptr, const char *__restrict __f, _G_va_list __arg) __THROWNL __attribute__ ((__format__ (__printf__, 2, 0))) __wur; extern int __asprintf (char **__restrict __ptr, - __const char *__restrict __fmt, ...) + const char *__restrict __fmt, ...) __THROWNL __attribute__ ((__format__ (__printf__, 2, 3))) __wur; extern int asprintf (char **__restrict __ptr, - __const char *__restrict __fmt, ...) + const char *__restrict __fmt, ...) __THROWNL __attribute__ ((__format__ (__printf__, 2, 3))) __wur; #endif @@ -415,10 +415,10 @@ extern int asprintf (char **__restrict __ptr, cancellation point. But due to similarity with an POSIX interface or due to the implementation they are cancellation points and therefore not marked with __THROW. */ -extern int vdprintf (int __fd, __const char *__restrict __fmt, +extern int vdprintf (int __fd, const char *__restrict __fmt, _G_va_list __arg) __attribute__ ((__format__ (__printf__, 2, 0))); -extern int dprintf (int __fd, __const char *__restrict __fmt, ...) +extern int dprintf (int __fd, const char *__restrict __fmt, ...) __attribute__ ((__format__ (__printf__, 2, 3))); #endif @@ -429,15 +429,15 @@ __BEGIN_NAMESPACE_STD This function is a possible cancellation point and therefore not marked with __THROW. */ extern int fscanf (FILE *__restrict __stream, - __const char *__restrict __format, ...) __wur; + const char *__restrict __format, ...) __wur; /* Read formatted input from stdin. This function is a possible cancellation point and therefore not marked with __THROW. */ -extern int scanf (__const char *__restrict __format, ...) __wur; +extern int scanf (const char *__restrict __format, ...) __wur; /* Read formatted input from S. */ -extern int sscanf (__const char *__restrict __s, - __const char *__restrict __format, ...) __THROW; +extern int sscanf (const char *__restrict __s, + const char *__restrict __format, ...) __THROW; #if defined __USE_ISOC99 && !defined __USE_GNU \ && (!defined __LDBL_COMPAT || !defined __REDIRECT) \ @@ -447,19 +447,19 @@ extern int sscanf (__const char *__restrict __s, GNU extension which conflicts with valid %a followed by letter s, S or [. */ extern int __REDIRECT (fscanf, (FILE *__restrict __stream, - __const char *__restrict __format, ...), + const char *__restrict __format, ...), __isoc99_fscanf) __wur; -extern int __REDIRECT (scanf, (__const char *__restrict __format, ...), +extern int __REDIRECT (scanf, (const char *__restrict __format, ...), __isoc99_scanf) __wur; -extern int __REDIRECT_NTH (sscanf, (__const char *__restrict __s, - __const char *__restrict __format, ...), +extern int __REDIRECT_NTH (sscanf, (const char *__restrict __s, + const char *__restrict __format, ...), __isoc99_sscanf); # else extern int __isoc99_fscanf (FILE *__restrict __stream, - __const char *__restrict __format, ...) __wur; -extern int __isoc99_scanf (__const char *__restrict __format, ...) __wur; -extern int __isoc99_sscanf (__const char *__restrict __s, - __const char *__restrict __format, ...) __THROW; + const char *__restrict __format, ...) __wur; +extern int __isoc99_scanf (const char *__restrict __format, ...) __wur; +extern int __isoc99_sscanf (const char *__restrict __s, + const char *__restrict __format, ...) __THROW; # define fscanf __isoc99_fscanf # define scanf __isoc99_scanf # define sscanf __isoc99_sscanf @@ -474,7 +474,7 @@ __BEGIN_NAMESPACE_C99 This function is a possible cancellation point and therefore not marked with __THROW. */ -extern int vfscanf (FILE *__restrict __s, __const char *__restrict __format, +extern int vfscanf (FILE *__restrict __s, const char *__restrict __format, _G_va_list __arg) __attribute__ ((__format__ (__scanf__, 2, 0))) __wur; @@ -482,12 +482,12 @@ extern int vfscanf (FILE *__restrict __s, __const char *__restrict __format, This function is a possible cancellation point and therefore not marked with __THROW. */ -extern int vscanf (__const char *__restrict __format, _G_va_list __arg) +extern int vscanf (const char *__restrict __format, _G_va_list __arg) __attribute__ ((__format__ (__scanf__, 1, 0))) __wur; /* Read formatted input from S into argument list ARG. */ -extern int vsscanf (__const char *__restrict __s, - __const char *__restrict __format, _G_va_list __arg) +extern int vsscanf (const char *__restrict __s, + const char *__restrict __format, _G_va_list __arg) __THROW __attribute__ ((__format__ (__scanf__, 2, 0))); # if !defined __USE_GNU \ @@ -499,25 +499,25 @@ extern int vsscanf (__const char *__restrict __s, s, S or [. */ extern int __REDIRECT (vfscanf, (FILE *__restrict __s, - __const char *__restrict __format, _G_va_list __arg), + const char *__restrict __format, _G_va_list __arg), __isoc99_vfscanf) __attribute__ ((__format__ (__scanf__, 2, 0))) __wur; -extern int __REDIRECT (vscanf, (__const char *__restrict __format, +extern int __REDIRECT (vscanf, (const char *__restrict __format, _G_va_list __arg), __isoc99_vscanf) __attribute__ ((__format__ (__scanf__, 1, 0))) __wur; extern int __REDIRECT_NTH (vsscanf, - (__const char *__restrict __s, - __const char *__restrict __format, + (const char *__restrict __s, + const char *__restrict __format, _G_va_list __arg), __isoc99_vsscanf) __attribute__ ((__format__ (__scanf__, 2, 0))); # else extern int __isoc99_vfscanf (FILE *__restrict __s, - __const char *__restrict __format, + const char *__restrict __format, _G_va_list __arg) __wur; -extern int __isoc99_vscanf (__const char *__restrict __format, +extern int __isoc99_vscanf (const char *__restrict __format, _G_va_list __arg) __wur; -extern int __isoc99_vsscanf (__const char *__restrict __s, - __const char *__restrict __format, +extern int __isoc99_vsscanf (const char *__restrict __s, + const char *__restrict __format, _G_va_list __arg) __THROW; # define vfscanf __isoc99_vfscanf # define vscanf __isoc99_vscanf @@ -629,7 +629,7 @@ extern char *fgets (char *__restrict __s, int __n, FILE *__restrict __stream) __wur; #if !defined __USE_ISOC11 \ - || (defined __cplusplus && __cplusplus <= 201103L) + || (defined __cplusplus && __cplusplus <= 201103L && !defined __USE_GNU) /* Get a newline-terminated string from stdin, removing the newline. DO NOT USE THIS FUNCTION!! There is no limit on how much it will read. @@ -692,13 +692,13 @@ __BEGIN_NAMESPACE_STD This function is a possible cancellation point and therefore not marked with __THROW. */ -extern int fputs (__const char *__restrict __s, FILE *__restrict __stream); +extern int fputs (const char *__restrict __s, FILE *__restrict __stream); /* Write a string, followed by a newline, to stdout. This function is a possible cancellation point and therefore not marked with __THROW. */ -extern int puts (__const char *__s); +extern int puts (const char *__s); /* Push a character back onto the input buffer of STREAM. @@ -718,7 +718,7 @@ extern size_t fread (void *__restrict __ptr, size_t __size, This function is a possible cancellation point and therefore not marked with __THROW. */ -extern size_t fwrite (__const void *__restrict __ptr, size_t __size, +extern size_t fwrite (const void *__restrict __ptr, size_t __size, size_t __n, FILE *__restrict __s) __wur; __END_NAMESPACE_STD @@ -729,7 +729,7 @@ __END_NAMESPACE_STD cancellation point. But due to similarity with an POSIX interface or due to the implementation it is a cancellation point and therefore not marked with __THROW. */ -extern int fputs_unlocked (__const char *__restrict __s, +extern int fputs_unlocked (const char *__restrict __s, FILE *__restrict __stream); #endif @@ -742,7 +742,7 @@ extern int fputs_unlocked (__const char *__restrict __s, therefore not marked with __THROW. */ extern size_t fread_unlocked (void *__restrict __ptr, size_t __size, size_t __n, FILE *__restrict __stream) __wur; -extern size_t fwrite_unlocked (__const void *__restrict __ptr, size_t __size, +extern size_t fwrite_unlocked (const void *__restrict __ptr, size_t __size, size_t __n, FILE *__restrict __stream) __wur; #endif @@ -806,13 +806,13 @@ extern int fgetpos (FILE *__restrict __stream, fpos_t *__restrict __pos); This function is a possible cancellation point and therefore not marked with __THROW. */ -extern int fsetpos (FILE *__stream, __const fpos_t *__pos); +extern int fsetpos (FILE *__stream, const fpos_t *__pos); #else # ifdef __REDIRECT extern int __REDIRECT (fgetpos, (FILE *__restrict __stream, fpos_t *__restrict __pos), fgetpos64); extern int __REDIRECT (fsetpos, - (FILE *__stream, __const fpos_t *__pos), fsetpos64); + (FILE *__stream, const fpos_t *__pos), fsetpos64); # else # define fgetpos fgetpos64 # define fsetpos fsetpos64 @@ -824,7 +824,7 @@ __END_NAMESPACE_STD extern int fseeko64 (FILE *__stream, __off64_t __off, int __whence); extern __off64_t ftello64 (FILE *__stream) __wur; extern int fgetpos64 (FILE *__restrict __stream, fpos64_t *__restrict __pos); -extern int fsetpos64 (FILE *__stream, __const fpos64_t *__pos); +extern int fsetpos64 (FILE *__stream, const fpos64_t *__pos); #endif __BEGIN_NAMESPACE_STD @@ -849,7 +849,7 @@ __BEGIN_NAMESPACE_STD This function is a possible cancellation point and therefore not marked with __THROW. */ -extern void perror (__const char *__s); +extern void perror (const char *__s); __END_NAMESPACE_STD /* Provide the declarations for `sys_errlist' and `sys_nerr' if they @@ -876,7 +876,7 @@ extern int fileno_unlocked (FILE *__stream) __THROW __wur; This function is a possible cancellation point and therefore not marked with __THROW. */ -extern FILE *popen (__const char *__command, __const char *__modes) __wur; +extern FILE *popen (const char *__command, const char *__modes) __wur; /* Close a stream opened by popen and return the status of its child. @@ -903,10 +903,10 @@ struct obstack; /* See <obstack.h>. */ /* Write formatted output to an obstack. */ extern int obstack_printf (struct obstack *__restrict __obstack, - __const char *__restrict __format, ...) + const char *__restrict __format, ...) __THROWNL __attribute__ ((__format__ (__printf__, 2, 3))); extern int obstack_vprintf (struct obstack *__restrict __obstack, - __const char *__restrict __format, + const char *__restrict __format, _G_va_list __args) __THROWNL __attribute__ ((__format__ (__printf__, 2, 0))); #endif /* Use GNU. */ diff --git a/libc/libio/wfiledoalloc.c b/libc/libio/wfiledoalloc.c index 67a05175b..168bdddc2 100644 --- a/libc/libio/wfiledoalloc.c +++ b/libc/libio/wfiledoalloc.c @@ -1,4 +1,4 @@ -/* Copyright (C) 1993, 1997, 1999, 2000, 2002, 2006 +/* Copyright (C) 1993, 1997, 1999, 2000, 2002, 2006, 2012 Free Software Foundation, Inc. This file is part of the GNU C Library. @@ -63,10 +63,8 @@ #include "libioP.h" #include <sys/types.h> #include <sys/stat.h> -#ifdef __STDC__ #include <stdlib.h> #include <unistd.h> -#endif #ifdef _LIBC # undef isatty diff --git a/libc/libio/wgenops.c b/libc/libio/wgenops.c index e2adedd6d..d9709cab8 100644 --- a/libc/libio/wgenops.c +++ b/libc/libio/wgenops.c @@ -1,4 +1,5 @@ -/* Copyright (C) 1993,1995,1997-2002,2004,2006 Free Software Foundation, Inc. +/* Copyright (C) 1993,1995,1997-2002,2004,2006,2012 + Free Software Foundation, Inc. This file is part of the GNU C Library. Written by Ulrich Drepper <drepper@cygnus.com>. Based on the single byte version by Per Bothner <bothner@cygnus.com>. @@ -30,9 +31,7 @@ /* Generic or default I/O operations. */ #include "libioP.h" -#ifdef __STDC__ #include <stdlib.h> -#endif #include <string.h> #include <wchar.h> |