This is the mail archive of the libc-hacker@sources.redhat.com mailing list for the glibc project.

Note that libc-hacker is a closed list. You may look at the archives of this list, but subscription and posting are not open.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[PATCH] Kill USE_IN_LIBIO conditionals in stdio-common/


Hi!

While playing with the ldbl optional patch, I thought I'd better avoid
having to touch dead ifndef USE_IN_LIBIO code as well.
This patch removes it from stdio-common directory.
I got identical libc.so without and with the patch (well, 2 different
immediates in instructions setting up arguments for __assert_fail).

2004-03-18  Jakub Jelinek  <jakub@redhat.com>

	* stdio-common/asprintf.c: Remove USE_IN_LIBIO conditionals.
	* stdio-common/dprintf.c: Likewise.
	* stdio-common/fprintf.c: Likewise.
	* stdio-common/getline.c: Likewise.
	* stdio-common/getw.c: Likewise.
	* stdio-common/perror.c: Likewise.
	* stdio-common/printf-prs.c: Likewise.
	* stdio-common/printf.c: Likewise.
	* stdio-common/printf_size.c: Likewise.
	* stdio-common/psignal.c: Likewise.
	* stdio-common/putw.c: Likewise.
	* stdio-common/scanf.c: Likewise.
	* stdio-common/snprintf.c: Likewise.
	* stdio-common/sprintf.c: Likewise.
	* stdio-common/sscanf.c: Likewise.
	* stdio-common/tstgetln.c: Likewise.
	* stdio-common/vfprintf.c: Likewise.

--- libc/stdio-common/printf-prs.c.jj	2003-06-12 00:07:37.000000000 +0200
+++ libc/stdio-common/printf-prs.c	2004-03-18 17:50:34.601574208 +0100
@@ -1,4 +1,5 @@
-/* Copyright (C) 1991,92,95,96,99,2000,2002,2003 Free Software Foundation, Inc.
+/* Copyright (C) 1991, 1992, 1995, 1996, 1999, 2000, 2002, 2003, 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
@@ -34,19 +35,10 @@
 # define ISASCII(Ch)	isascii (Ch)
 # define MBRLEN(Cp, L, St) __mbrlen (Cp, L, St)
 
-# ifdef USE_IN_LIBIO
-#  define PUT(F, S, N)	_IO_sputn (F, S, N)
-#  define PAD(Padchar)							      \
-  if (width > 0)							      \
-    done += INTUSE(_IO_padn) (s, Padchar, width)
-# else
-#  define PUTC(C, F)	putc (C, F)
-ssize_t __printf_pad __P ((FILE *, char pad, size_t n));
+# define PUT(F, S, N)	_IO_sputn (F, S, N)
 # define PAD(Padchar)							      \
   if (width > 0)							      \
-    { if (__printf_pad (s, Padchar, width) == -1)			      \
-	return -1; else done += width; }
-# endif
+    done += INTUSE(_IO_padn) (s, Padchar, width)
 #else
 # define vfprintf	vfwprintf
 # define CHAR_T		wchar_t
@@ -55,19 +47,10 @@ ssize_t __printf_pad __P ((FILE *, char 
 # define L_(Str)	L##Str
 # define ISDIGIT(Ch)	iswdigit (Ch)
 
-# ifdef USE_IN_LIBIO
 # define PUT(F, S, N)	_IO_sputn (F, S, N)
 # define PAD(Padchar)							      \
   if (width > 0)							      \
     done += _IO_wpadn (s, Padchar, width)
-# else
-#  define PUTC(C, F)	wputc (C, F)
-ssize_t __wprintf_pad __P ((FILE *, wchar_t pad, size_t n));
-# define PAD(Padchar)							      \
-  if (width > 0)							      \
-    { if (__wprintf_pad (s, Padchar, width) == -1)			      \
-	return -1; else done += width; }
-# endif
 #endif
 
 #define DONT_NEED_READ_INT
--- libc/stdio-common/sscanf.c.jj	2003-03-05 20:58:03.000000000 +0100
+++ libc/stdio-common/sscanf.c	2004-03-18 17:57:21.501881665 +0100
@@ -1,4 +1,5 @@
-/* Copyright (C) 1991,1995,1996,1998,2002,2003 Free Software Foundation, Inc.
+/* Copyright (C) 1991, 1995, 1996, 1998, 2002, 2003, 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
@@ -18,11 +19,8 @@
 
 #include <stdarg.h>
 #include <stdio.h>
-
-#ifdef USE_IN_LIBIO
-# include <libio/iolibio.h>
-# define __vsscanf(s, f, a) _IO_vsscanf (s, f, a)
-#endif
+#include <libio/iolibio.h>
+#define __vsscanf(s, f, a) _IO_vsscanf (s, f, a)
 
 /* Read formatted input from S, according to the format string FORMAT.  */
 /* VARARGS2 */
@@ -40,8 +38,6 @@ sscanf (const char *s, const char *forma
 }
 libc_hidden_def (sscanf)
 
-#ifdef USE_IN_LIBIO
-# undef _IO_sscanf
+#undef _IO_sscanf
 /* This is for libg++.  */
 strong_alias (sscanf, _IO_sscanf)
-#endif
--- libc/stdio-common/getline.c.jj	2001-07-06 06:55:40.000000000 +0200
+++ libc/stdio-common/getline.c	2004-03-18 17:48:58.370766186 +0100
@@ -1,4 +1,5 @@
-/* Copyright (C) 1991, 1992, 1995, 1996, 1997 Free Software Foundation, Inc.
+/* Copyright (C) 1991, 1992, 1995, 1996, 1997, 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
@@ -21,12 +22,10 @@
 
 #undef __getline
 
-#ifdef USE_IN_LIBIO
-# include "../libio/libioP.h"
-# undef ssize_t
-# define ssize_t _IO_ssize_t
-# define __getdelim _IO_getdelim
-#endif
+#include "../libio/libioP.h"
+#undef ssize_t
+#define ssize_t _IO_ssize_t
+#define __getdelim _IO_getdelim
 
 /* Like getdelim, but always looks for a newline.  */
 ssize_t
--- libc/stdio-common/psignal.c.jj	2002-08-05 01:22:08.000000000 +0200
+++ libc/stdio-common/psignal.c	2004-03-18 17:54:30.223480150 +0100
@@ -1,4 +1,5 @@
-/* Copyright (C) 1991,1992,1995-1997,2001,2002 Free Software Foundation, Inc.
+/* Copyright (C) 1991, 1992, 1995, 1996, 1997, 2001, 2002, 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
@@ -20,9 +21,7 @@
 #include <signal.h>
 #include <stdlib.h>
 #include <libintl.h>
-#ifdef USE_IN_LIBIO
-# include <wchar.h>
-#endif
+#include <wchar.h>
 
 
 #ifndef	HAVE_GNU_LD
@@ -49,11 +48,9 @@ psignal (int sig, const char *s)
 
   if (sig >= 0 && sig < NSIG && (desc = INTUSE(_sys_siglist)[sig]) != NULL)
     {
-#ifdef USE_IN_LIBIO
       if (_IO_fwide (stderr, 0) > 0)
 	(void) __fwprintf (stderr, L"%s%s%s\n", s, colon, _(desc));
       else
-#endif
 	(void) fprintf (stderr, "%s%s%s\n", s, colon, _(desc));
     }
   else
@@ -62,11 +59,9 @@ psignal (int sig, const char *s)
 
       (void) __asprintf (&buf, _("%s%sUnknown signal %d\n"), s, colon, sig);
 
-#ifdef USE_IN_LIBIO
       if (_IO_fwide (stderr, 0) > 0)
 	(void) __fwprintf (stderr, L"%s",  buf);
       else
-#endif
 	(void) fputs (buf, stderr);
 
       free (buf);
--- libc/stdio-common/asprintf.c.jj	2002-04-09 21:44:48.000000000 +0200
+++ libc/stdio-common/asprintf.c	2004-03-18 17:47:32.061185836 +0100
@@ -1,4 +1,5 @@
-/* Copyright (C) 1991, 1995, 1997, 1998, 2002 Free Software Foundation, Inc.
+/* Copyright (C) 1991, 1995, 1997, 1998, 2002, 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
@@ -19,10 +20,8 @@
 #include <stdarg.h>
 #include <stdio.h>
 
-#ifdef USE_IN_LIBIO
-# include <libio/libioP.h>
-# define vasprintf(s, f, a) _IO_vasprintf (s, f, a)
-#endif
+#include <libio/libioP.h>
+#define vasprintf(s, f, a) _IO_vasprintf (s, f, a)
 #undef __asprintf
 
 /* Write formatted output from FORMAT to a string which is
--- libc/stdio-common/sprintf.c.jj	2002-08-10 11:24:42.000000000 +0200
+++ libc/stdio-common/sprintf.c	2004-03-18 17:56:49.633574830 +0100
@@ -1,4 +1,5 @@
-/* Copyright (C) 1991, 1995, 1997, 1998, 2002 Free Software Foundation, Inc.
+/* Copyright (C) 1991, 1995, 1997, 1998, 2002, 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
@@ -18,11 +19,8 @@
 
 #include <stdarg.h>
 #include <stdio.h>
-
-#ifdef USE_IN_LIBIO
-# include <libio/iolibio.h>
-# define vsprintf(s, f, a) INTUSE(_IO_vsprintf) (s, f, a)
-#endif
+#include <libio/iolibio.h>
+#define vsprintf(s, f, a) INTUSE(_IO_vsprintf) (s, f, a)
 
 /* Write formatted output into S, according to the format string FORMAT.  */
 /* VARARGS2 */
@@ -40,6 +38,4 @@ sprintf (char *s, const char *format, ..
 }
 libc_hidden_def (sprintf)
 
-#ifdef USE_IN_LIBIO
 strong_alias(sprintf, _IO_sprintf)
-#endif
--- libc/stdio-common/getw.c.jj	2002-02-26 02:43:54.000000000 +0100
+++ libc/stdio-common/getw.c	2004-03-18 17:49:14.360909479 +0100
@@ -1,4 +1,4 @@
-/* Copyright (C) 1991, 1997, 1998, 2002 Free Software Foundation, Inc.
+/* Copyright (C) 1991, 1997, 1998, 2002, 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
@@ -18,10 +18,8 @@
 
 #include <stdio.h>
 
-#ifdef USE_IN_LIBIO
-# include <libio/iolibio.h>
-# define fread(p, m, n, s) INTUSE(_IO_fread) (p, m, n, s)
-#endif
+#include <libio/iolibio.h>
+#define fread(p, m, n, s) INTUSE(_IO_fread) (p, m, n, s)
 
 /* Read a word (int) from STREAM.  */
 int
--- libc/stdio-common/fprintf.c.jj	2002-08-10 11:24:42.000000000 +0200
+++ libc/stdio-common/fprintf.c	2004-03-18 17:48:31.600548809 +0100
@@ -1,4 +1,4 @@
-/* Copyright (C) 1991,97,2002 Free Software Foundation, Inc.
+/* Copyright (C) 1991,97,2002,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
@@ -36,9 +36,7 @@ fprintf (FILE *stream, const char *forma
 }
 libc_hidden_def (fprintf)
 
-#ifdef USE_IN_LIBIO
 /* We define the function with the real name here.  But deep down in
    libio the original function _IO_fprintf is also needed.  So make
    an alias.  */
 weak_alias (fprintf, _IO_fprintf)
-#endif
--- libc/stdio-common/vfprintf.c.jj	2004-01-27 15:44:24.000000000 +0100
+++ libc/stdio-common/vfprintf.c	2004-03-18 17:59:10.719359059 +0100
@@ -1,4 +1,4 @@
-/* Copyright (C) 1991-2002, 2003 Free Software Foundation, Inc.
+/* Copyright (C) 1991-2002, 2003, 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
@@ -39,15 +39,13 @@
    implementation as defined in ISO/IEC 9899:1990/Amendment 1:1995.  */
 
 
-#ifdef USE_IN_LIBIO
-/* This code is for use in libio.  */
-# include <libioP.h>
-# define FILE		_IO_FILE
-# undef va_list
-# define va_list	_IO_va_list
-# undef BUFSIZ
-# define BUFSIZ		_IO_BUFSIZ
-# define ARGCHECK(S, Format) \
+#include <libioP.h>
+#define FILE		_IO_FILE
+#undef va_list
+#define va_list	_IO_va_list
+#undef BUFSIZ
+#define BUFSIZ		_IO_BUFSIZ
+#define ARGCHECK(S, Format) \
   do									      \
     {									      \
       /* Check file argument for consistence.  */			      \
@@ -63,95 +61,46 @@
 	  return -1;							      \
 	}								      \
     } while (0)
-# define UNBUFFERED_P(S) ((S)->_IO_file_flags & _IO_UNBUFFERED)
+#define UNBUFFERED_P(S) ((S)->_IO_file_flags & _IO_UNBUFFERED)
 
-# ifndef COMPILE_WPRINTF
-#  define vfprintf	_IO_vfprintf
-#  define CHAR_T	char
-#  define UCHAR_T	unsigned char
-#  define INT_T		int
-#  define L_(Str)	Str
-#  define ISDIGIT(Ch)	((unsigned int) ((Ch) - '0') < 10)
+#ifndef COMPILE_WPRINTF
+# define vfprintf	_IO_vfprintf
+# define CHAR_T		char
+# define UCHAR_T	unsigned char
+# define INT_T		int
+# define L_(Str)	Str
+# define ISDIGIT(Ch)	((unsigned int) ((Ch) - '0') < 10)
 
-#  define PUT(F, S, N)	_IO_sputn ((F), (S), (N))
-#  define PAD(Padchar) \
+# define PUT(F, S, N)	_IO_sputn ((F), (S), (N))
+# define PAD(Padchar) \
   if (width > 0)							      \
     done += INTUSE(_IO_padn) (s, (Padchar), width)
-#  define PUTC(C, F)	_IO_putc_unlocked (C, F)
-#  define ORIENT	if (_IO_vtable_offset (s) == 0 && _IO_fwide (s, -1) != -1)\
+# define PUTC(C, F)	_IO_putc_unlocked (C, F)
+# define ORIENT		if (_IO_vtable_offset (s) == 0 && _IO_fwide (s, -1) != -1)\
 			  return -1
-# else
-#  define vfprintf	_IO_vfwprintf
-#  define CHAR_T	wchar_t
+#else
+# define vfprintf	_IO_vfwprintf
+# define CHAR_T		wchar_t
 /* This is a hack!!!  There should be a type uwchar_t.  */
-#  define UCHAR_T	unsigned int /* uwchar_t */
-#  define INT_T		wint_t
-#  define L_(Str)	L##Str
-#  define ISDIGIT(Ch)	((unsigned int) ((Ch) - L'0') < 10)
+# define UCHAR_T	unsigned int /* uwchar_t */
+# define INT_T		wint_t
+# define L_(Str)	L##Str
+# define ISDIGIT(Ch)	((unsigned int) ((Ch) - L'0') < 10)
 
-#  include "_itowa.h"
+# include "_itowa.h"
 
-#  define PUT(F, S, N)	_IO_sputn ((F), (S), (N))
-#  define PAD(Padchar) \
+# define PUT(F, S, N)	_IO_sputn ((F), (S), (N))
+# define PAD(Padchar) \
   if (width > 0)							      \
     done += _IO_wpadn (s, (Padchar), width)
-#  define PUTC(C, F)	_IO_putwc_unlocked (C, F)
-#  define ORIENT	if (_IO_fwide (s, 1) != 1) return -1
+# define PUTC(C, F)	_IO_putwc_unlocked (C, F)
+# define ORIENT		if (_IO_fwide (s, 1) != 1) return -1
 
-#  define _itoa(Val, Buf, Base, Case) _itowa (Val, Buf, Base, Case)
-#  define _itoa_word(Val, Buf, Base, Case) _itowa_word (Val, Buf, Base, Case)
-#  undef EOF
-#  define EOF WEOF
-# endif
-#else /* ! USE_IN_LIBIO */
-/* This code is for use in the GNU C library.  */
-# define ARGCHECK(S, Format) \
-  do									      \
-    {									      \
-      /* Check file argument for consistence.  */			      \
-      if (!__validfp (S) || !S->__mode.__write)				      \
-	{								      \
-	  __set_errno (EBADF);						      \
-	  return -1;							      \
-	}								      \
-      if (Format == NULL)						      \
-	{								      \
-	  __set_errno (EINVAL);						      \
-	  return -1;							      \
-	}								      \
-      if (!S->__seen)							      \
-	{								      \
-	  if (__flshfp (S, EOF) == EOF)					      \
-	    return -1;							      \
-	}								      \
-    }									      \
-   while (0)
-# define UNBUFFERED_P(s) ((s)->__buffer == NULL)
-
-# define CHAR_T         char
-# define UCHAR_T        unsigned char
-# define INT_T		int
-# define L_(Str)	Str
-# define ISDIGIT(Ch)	isdigit (Ch)
-
-# define PUT(F, S, N)	fwrite (S, 1, N, F)
-ssize_t __printf_pad __P ((FILE *, char pad, size_t n));
-# define PAD(Padchar)                                                         \
-  if (width > 0)                                                              \
-    { ssize_t __res = __printf_pad (s, (Padchar), width);                     \
-      if (__res == -1)                                                        \
-        {                                                                     \
-          done = -1;                                                          \
-          goto all_done;                                                      \
-        }                                                                     \
-      done += __res; }
-# define PUTC(C, F)    putc (C, F)
-
-/* XXX These declarations should go as soon as the stdio header files
-   have these prototypes.   */
-extern void __flockfile (FILE *);
-extern void __funlockfile (FILE *);
-#endif /* USE_IN_LIBIO */
+# define _itoa(Val, Buf, Base, Case) _itowa (Val, Buf, Base, Case)
+# define _itoa_word(Val, Buf, Base, Case) _itowa_word (Val, Buf, Base, Case)
+# undef EOF
+# define EOF WEOF
+#endif
 
 #include "_i18n_number.h"
 
@@ -1266,10 +1215,7 @@ vfprintf (FILE *s, const CHAR_T *format,
 
 #ifdef ORIENT
   /* Check for correct orientation.  */
-  if (
-# ifdef USE_IN_LIBIO
-      _IO_vtable_offset (s) == 0 &&
-# endif
+  if (_IO_vtable_offset (s) == 0 &&
       _IO_fwide (s, sizeof (CHAR_T) == 1 ? -1 : 1)
       != (sizeof (CHAR_T) == 1 ? -1 : 1))
     /* The stream is already oriented otherwise.  */
@@ -1305,13 +1251,8 @@ vfprintf (FILE *s, const CHAR_T *format,
 #endif
 
   /* Lock stream.  */
-#ifdef USE_IN_LIBIO
   _IO_cleanup_region_start ((void (*) (void *)) &_IO_funlockfile, s);
   _IO_flockfile (s);
-#else
-  __libc_cleanup_region_start (1, (void (*) (void *)) &__funlockfile, s);
-  __flockfile (s);
-#endif
 
   /* Write the literal text before the first format.  */
   outstring ((const UCHAR_T *) format,
@@ -1906,13 +1847,8 @@ all_done:
   if (__builtin_expect (workstart != NULL, 0))
     free (workstart);
   /* Unlock the stream.  */
-#ifdef USE_IN_LIBIO
   _IO_funlockfile (s);
   _IO_cleanup_region_end (0);
-#else
-  __funlockfile (s);
-  __libc_cleanup_region_end (0);
-#endif
 
   return done;
 }
@@ -2041,7 +1977,6 @@ group_number (CHAR_T *w, CHAR_T *rear_pt
   return w;
 }
 
-#ifdef USE_IN_LIBIO
 /* Helper "class" for `fprintf to unbuffered': creates a temporary buffer.  */
 struct helper_file
   {
@@ -2159,7 +2094,7 @@ buffered_vfprintf (register _IO_FILE *s,
   _IO_JUMPS (&helper._f) = (struct _IO_jump_t *) &_IO_helper_jumps;
 
   /* Now print to helper instead.  */
-#if defined USE_IN_LIBIO && !defined COMPILE_WPRINTF
+#ifndef COMPILE_WPRINTF
   result = INTUSE(_IO_vfprintf) (hp, format, args);
 #else
   result = vfprintf (hp, format, args);
@@ -2193,91 +2128,25 @@ buffered_vfprintf (register _IO_FILE *s,
   return result;
 }
 
-#else /* !USE_IN_LIBIO */
-
-static int
-internal_function
-buffered_vfprintf (register FILE *s, const CHAR_T *format, va_list args)
-{
-  char buf[BUFSIZ];
-  int result;
-
-  /* Orient the stream.  */
-#ifdef ORIENT
-  ORIENT;
-#endif
-
-  s->__bufp = s->__buffer = buf;
-  s->__bufsize = sizeof buf;
-  s->__put_limit = s->__buffer + s->__bufsize;
-  s->__get_limit = s->__buffer;
-
-  /* Now use buffer to print.  */
-  result = vfprintf (s, format, args);
-
-  if (fflush (s) == EOF)
-    result = -1;
-  s->__buffer = s->__bufp = s->__get_limit = s->__put_limit = NULL;
-  s->__bufsize = 0;
-
-  return result;
-}
-
-/* Pads string with given number of a specified character.
-   This code is taken from iopadn.c of the GNU I/O library.  */
-#define PADSIZE 16
-static const CHAR_T blanks[PADSIZE] =
-{ L_(' '), L_(' '), L_(' '), L_(' '), L_(' '), L_(' '), L_(' '), L_(' '),
-  L_(' '), L_(' '), L_(' '), L_(' '), L_(' '), L_(' '), L_(' '), L_(' ') };
-static const CHAR_T zeroes[PADSIZE] =
-{ L_('0'), L_('0'), L_('0'), L_('0'), L_('0'), L_('0'), L_('0'), L_('0'),
-  L_('0'), L_('0'), L_('0'), L_('0'), L_('0'), L_('0'), L_('0'), L_('0') };
-
-ssize_t
-#ifndef COMPILE_WPRINTF
-__printf_pad (FILE *s, char pad, size_t count)
-#else
-__wprintf_pad (FILE *s, wchar_t pad, size_t count)
-#endif
-{
-  const CHAR_T *padptr;
-  register size_t i;
-
-  padptr = pad == L_(' ') ? blanks : zeroes;
-
-  for (i = count; i >= PADSIZE; i -= PADSIZE)
-    if (PUT (s, padptr, PADSIZE) != PADSIZE)
-      return -1;
-  if (i > 0)
-    if (PUT (s, padptr, i) != i)
-      return -1;
-
-  return count;
-}
-#undef PADSIZE
-#endif /* USE_IN_LIBIO */
-
-#ifdef USE_IN_LIBIO
-# undef vfprintf
-# ifdef strong_alias
+#undef vfprintf
+#ifdef strong_alias
 /* This is for glibc.  */
-#  ifdef COMPILE_WPRINTF
+# ifdef COMPILE_WPRINTF
 strong_alias (_IO_vfwprintf, __vfwprintf);
 weak_alias (_IO_vfwprintf, vfwprintf);
-#  else
+# else
 strong_alias (_IO_vfprintf, vfprintf);
 libc_hidden_def (vfprintf)
 INTDEF(_IO_vfprintf)
-#  endif
-# else
-#  if defined __ELF__ || defined __GNU_LIBRARY__
-#   include <gnu-stabs.h>
-#   ifdef weak_alias
-#    ifdef COMPILE_WPRINTF
+# endif
+#else
+# if defined __ELF__ || defined __GNU_LIBRARY__
+#  include <gnu-stabs.h>
+#  ifdef weak_alias
+#   ifdef COMPILE_WPRINTF
 weak_alias (_IO_vfwprintf, vfwprintf);
-#    else
+#   else
 weak_alias (_IO_vfprintf, vfprintf);
-#    endif
 #   endif
 #  endif
 # endif
--- libc/stdio-common/putw.c.jj	2002-02-26 02:43:54.000000000 +0100
+++ libc/stdio-common/putw.c	2004-03-18 17:54:52.541493064 +0100
@@ -1,4 +1,4 @@
-/* Copyright (C) 1991, 1997, 1998, 2002 Free Software Foundation, Inc.
+/* Copyright (C) 1991, 1997, 1998, 2002, 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
@@ -17,11 +17,8 @@
    02111-1307 USA.  */
 
 #include <stdio.h>
-
-#ifdef USE_IN_LIBIO
-# include <libio/iolibio.h>
-# define fwrite(p, n, m, s) INTUSE(_IO_fwrite) (p, n, m, s)
-#endif
+#include <libio/iolibio.h>
+#define fwrite(p, n, m, s) INTUSE(_IO_fwrite) (p, n, m, s)
 
 /* Write the word (int) W to STREAM.  */
 int
--- libc/stdio-common/scanf.c.jj	2002-02-26 02:43:54.000000000 +0100
+++ libc/stdio-common/scanf.c	2004-03-18 17:55:21.906247098 +0100
@@ -1,4 +1,5 @@
-/* Copyright (C) 1991, 1995, 1996, 1997, 2002 Free Software Foundation, Inc.
+/* Copyright (C) 1991, 1995, 1996, 1997, 2002, 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
@@ -19,9 +20,7 @@
 #include <stdarg.h>
 #include <stdio.h>
 
-#ifdef USE_IN_LIBIO
-# include <libioP.h>
-#endif
+#include <libioP.h>
 
 
 /* Read formatted input from stdin according to the format string FORMAT.  */
@@ -33,11 +32,7 @@ scanf (const char *format, ...)
   int done;
 
   va_start (arg, format);
-#ifdef USE_IN_LIBIO
   done = INTUSE(_IO_vfscanf) (stdin, format, arg, NULL);
-#else
-  done = vfscanf (stdin, format, arg);
-#endif
   va_end (arg);
 
   return done;
--- libc/stdio-common/perror.c.jj	2003-04-17 06:00:30.000000000 +0200
+++ libc/stdio-common/perror.c	2004-03-18 17:49:40.514237085 +0100
@@ -1,4 +1,4 @@
-/* Copyright (C) 1991-1993,1997,1998,2000-2003 Free Software Foundation, Inc.
+/* Copyright (C) 1991-1993,1997,1998,2000-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
@@ -21,9 +21,7 @@
 #include <string.h>
 #include <unistd.h>
 #include <wchar.h>
-#ifdef USE_IN_LIBIO
-# include "libioP.h"
-#endif
+#include "libioP.h"
 
 static void
 perror_internal (FILE *fp, const char *s, int errnum)
@@ -39,11 +37,9 @@ perror_internal (FILE *fp, const char *s
 
   errstring = __strerror_r (errnum, buf, sizeof buf);
 
-#ifdef USE_IN_LIBIO
   if (_IO_fwide (fp, 0) > 0)
     (void) __fwprintf (fp, L"%s%s%s\n", s, colon, errstring);
   else
-#endif
     (void) fprintf (fp, "%s%s%s\n", s, colon, errstring);
 }
 
--- libc/stdio-common/dprintf.c.jj	2002-08-10 11:24:42.000000000 +0200
+++ libc/stdio-common/dprintf.c	2004-03-18 17:47:54.126243788 +0100
@@ -1,4 +1,4 @@
-/* Copyright (C) 1991,95,97,98,2002 Free Software Foundation, Inc.
+/* Copyright (C) 1991,95,97,98,2002,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
@@ -19,10 +19,8 @@
 #include <stdarg.h>
 #include <stdio.h>
 
-#ifdef USE_IN_LIBIO
-# include <libio/libioP.h>
-# define vdprintf(d, f, a) _IO_vdprintf (d, f, a)
-#endif
+#include <libio/libioP.h>
+#define vdprintf(d, f, a) _IO_vdprintf (d, f, a)
 
 /* Write formatted output to D, according to the format string FORMAT.  */
 /* VARARGS2 */
--- libc/stdio-common/snprintf.c.jj	2001-07-06 06:55:41.000000000 +0200
+++ libc/stdio-common/snprintf.c	2004-03-18 17:56:24.976979657 +0100
@@ -1,4 +1,4 @@
-/* Copyright (C) 1991, 1995, 1997, 1998 Free Software Foundation, Inc.
+/* Copyright (C) 1991, 1995, 1997, 1998, 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
@@ -19,10 +19,8 @@
 #include <stdarg.h>
 #include <stdio.h>
 
-#ifdef USE_IN_LIBIO
-# include <libio/libioP.h>
-# define __vsnprintf(s, l, f, a) _IO_vsnprintf (s, l, f, a)
-#endif
+#include <libio/libioP.h>
+#define __vsnprintf(s, l, f, a) _IO_vsnprintf (s, l, f, a)
 
 /* Write formatted output into S, according to the format
    string FORMAT, writing no more than MAXLEN characters.  */
--- libc/stdio-common/tstgetln.c.jj	2001-07-06 06:55:41.000000000 +0200
+++ libc/stdio-common/tstgetln.c	2004-03-18 17:57:51.375544851 +0100
@@ -1,4 +1,5 @@
-/* Copyright (C) 1992, 1995, 1996, 1997, 1998 Free Software Foundation, Inc.
+/* Copyright (C) 1992, 1995, 1996, 1997, 1998, 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
@@ -17,11 +18,8 @@
    02111-1307 USA.  */
 
 #include <stdio.h>
-
-#ifdef USE_IN_LIBIO
-# undef ssize_t
-# define ssize_t _IO_ssize_t
-#endif
+#undef ssize_t
+#define ssize_t _IO_ssize_t
 
 int
 main (int argc, char *argv[])
--- libc/stdio-common/printf_size.c.jj	2004-02-09 14:52:34.000000000 +0100
+++ libc/stdio-common/printf_size.c	2004-03-18 17:53:47.246158020 +0100
@@ -23,30 +23,20 @@
 #include <ieee754.h>
 #include <math.h>
 #include <printf.h>
-#ifdef USE_IN_LIBIO
-# include <libioP.h>
-#else
-# include <stdio.h>
-#endif
+#include <libioP.h>
 
 
 /* This defines make it possible to use the same code for GNU C library and
    the GNU I/O library.	 */
-#ifdef USE_IN_LIBIO
-# define PUT(f, s, n) _IO_sputn (f, s, n)
-# define PAD(f, c, n) (wide ? _IO_wpadn (f, c, n) : INTUSE(_IO_padn) (f, c, n))
+#define PUT(f, s, n) _IO_sputn (f, s, n)
+#define PAD(f, c, n) (wide ? _IO_wpadn (f, c, n) : INTUSE(_IO_padn) (f, c, n))
 /* We use this file GNU C library and GNU I/O library.	So make
    names equal.	 */
-# undef putc
-# define putc(c, f) (wide \
-		     ? (int)_IO_putwc_unlocked (c, f) : _IO_putc_unlocked (c, f))
-# define size_t	_IO_size_t
-# define FILE	_IO_FILE
-#else	/* ! USE_IN_LIBIO */
-# define PUT(f, s, n) fwrite (s, 1, n, f)
-# define PAD(f, c, n) __printf_pad (f, c, n)
-ssize_t __printf_pad __P ((FILE *, char pad, int n)); /* In vfprintf.c.  */
-#endif	/* USE_IN_LIBIO */
+#undef putc
+#define putc(c, f) (wide \
+		    ? (int)_IO_putwc_unlocked (c, f) : _IO_putc_unlocked (c, f))
+#define size_t	_IO_size_t
+#define FILE	_IO_FILE
 
 /* Macros for doing the actual output.  */
 
--- libc/stdio-common/printf.c.jj	2001-07-06 06:55:40.000000000 +0200
+++ libc/stdio-common/printf.c	2004-03-18 17:46:55.284756173 +0100
@@ -1,4 +1,5 @@
-/* Copyright (C) 1991, 1995, 1996, 1997, 2001 Free Software Foundation, Inc.
+/* Copyright (C) 1991, 1995, 1996, 1997, 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
@@ -36,8 +37,6 @@ printf (const char *format, ...)
   return done;
 }
 
-#ifdef USE_IN_LIBIO
-# undef _IO_printf
+#undef _IO_printf
 /* This is for libg++.  */
 strong_alias (printf, _IO_printf);
-#endif

	Jakub


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]