From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 2155) id C02F9385AC2C; Fri, 17 Nov 2023 12:11:11 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org C02F9385AC2C DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1700223071; bh=2uAp1OpxmjHxjYdYsd33bHdZqSkJJsuyOcD5uFaYBmU=; h=From:To:Subject:Date:From; b=VCcFEQ9YmmuHUS6yAUCB+sukTrdxuKhzGGcxLO6IwG9Q/XEfFfGgbI2fQlxfu8AnZ OK5VKFXCNbdanX/MulgX1Dr40EKejk+xQQHlfQcDOCy9jRVdDvmMchI00pJuFqQFzC njadscqAxi7TdXAXAPw0Yjywmuuk/o9uRvmVCNK4= Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable From: Corinna Vinschen To: newlib-cvs@sourceware.org Subject: [newlib-cygwin/main] v{fs}printf/v{fs}wprintf: create external output helpers X-Act-Checkin: newlib-cygwin X-Git-Author: Corinna Vinschen X-Git-Refname: refs/heads/main X-Git-Oldrev: 7e4840bc459d5105a9d6290df1323ba1360ba081 X-Git-Newrev: 61ccd3f94f92bcfc0940f0595ea5b3b72bce3c6d Message-Id: <20231117121111.C02F9385AC2C@sourceware.org> Date: Fri, 17 Nov 2023 12:11:11 +0000 (GMT) List-Id: https://sourceware.org/git/gitweb.cgi?p=3Dnewlib-cygwin.git;h=3D61ccd3f94f9= 2bcfc0940f0595ea5b3b72bce3c6d commit 61ccd3f94f92bcfc0940f0595ea5b3b72bce3c6d Author: Corinna Vinschen AuthorDate: Thu Nov 16 20:34:55 2023 +0100 Commit: Corinna Vinschen CommitDate: Fri Nov 17 13:10:20 2023 +0100 v{fs}printf/v{fs}wprintf: create external output helpers =20 So far, the printf family of functions has two output helper functions called __sprint_r and __sfputs_r. Both are called from all variants of vfprintf as well as vfwprintf. There are also analogue helper functions for the string-creating functions vsprintf/vswprintf called __ssprint_r and __ssputs_r. =20 However, the helpers are built once when building vfprintf/vsprintf with the INTEGER_ONLY flag, and then they are part of the vfiprintf.c and vsiprintf.c files. =20 The problem is this: =20 Even if a process only calls vfwprintf or the non-INTEGER_ONLY vfprintf it will always have to include the INTEGER_ONLY vfiprintf. Otherwise the helper functions are undefined. Analogue for the string-creating functions. =20 That's a useless waste of space by including one (or two) big, unused function, if newlib is linked in statically. =20 Create new files to define the printf output helpers separately and split them into byte-oriented and wide-char-oriented functions. This allows to link only the required functions. =20 Also, simplify the string output helpers and fix a potential (but unlikely) buffer overflow in __ssprint_r. =20 Fixes: 8a0efa53e449 ("import newlib-2000-02-17 snapshot") Fixes: 6121968b198d ("* libc/include/stdio.h (__VALIST): Guard against = multiple definition.") Signed-off-by: Corinna Vinschen Diff: --- newlib/Makefile.in | 157 +++++++++++++++++++++++- newlib/libc/stdio/Makefile.inc | 10 +- newlib/libc/stdio/sfputs_r.c | 23 ++++ newlib/libc/stdio/sfputws_r.c | 24 ++++ newlib/libc/stdio/sprint_r.c | 30 +++++ newlib/libc/stdio/ssprint_r.c | 36 ++++++ newlib/libc/stdio/ssputs_r.c | 69 +++++++++++ newlib/libc/stdio/ssputws_r.c | 21 ++++ newlib/libc/stdio/sswprint_r.c | 38 ++++++ newlib/libc/stdio/swprint_r.c | 46 ++++++++ newlib/libc/stdio/vfprintf.c | 262 ++-----------------------------------= ---- newlib/libc/stdio/vfwprintf.c | 16 +-- 12 files changed, 467 insertions(+), 265 deletions(-) diff --git a/newlib/Makefile.in b/newlib/Makefile.in index 4cb3534cc4a0..ff2f88ff756e 100644 --- a/newlib/Makefile.in +++ b/newlib/Makefile.in @@ -237,7 +237,15 @@ check_PROGRAMS =3D @HAVE_STDIO_DIR_TRUE@@NEWLIB_NANO_FORMATTED_IO_FALSE@ libc/stdio/viscanf.c= \ @HAVE_STDIO_DIR_TRUE@@NEWLIB_NANO_FORMATTED_IO_FALSE@ libc/stdio/vsiprintf= .c \ @HAVE_STDIO_DIR_TRUE@@NEWLIB_NANO_FORMATTED_IO_FALSE@ libc/stdio/vsiscanf.= c \ -@HAVE_STDIO_DIR_TRUE@@NEWLIB_NANO_FORMATTED_IO_FALSE@ libc/stdio/vsniprint= f.c +@HAVE_STDIO_DIR_TRUE@@NEWLIB_NANO_FORMATTED_IO_FALSE@ libc/stdio/vsniprint= f.c \ +@HAVE_STDIO_DIR_TRUE@@NEWLIB_NANO_FORMATTED_IO_FALSE@ libc/stdio/sfputs_r.= c \ +@HAVE_STDIO_DIR_TRUE@@NEWLIB_NANO_FORMATTED_IO_FALSE@ libc/stdio/sfputws_r= .c \ +@HAVE_STDIO_DIR_TRUE@@NEWLIB_NANO_FORMATTED_IO_FALSE@ libc/stdio/sprint_r.= c \ +@HAVE_STDIO_DIR_TRUE@@NEWLIB_NANO_FORMATTED_IO_FALSE@ libc/stdio/swprint_r= .c \ +@HAVE_STDIO_DIR_TRUE@@NEWLIB_NANO_FORMATTED_IO_FALSE@ libc/stdio/ssputs_r.= c \ +@HAVE_STDIO_DIR_TRUE@@NEWLIB_NANO_FORMATTED_IO_FALSE@ libc/stdio/ssputws_r= .c \ +@HAVE_STDIO_DIR_TRUE@@NEWLIB_NANO_FORMATTED_IO_FALSE@ libc/stdio/ssprint_r= .c \ +@HAVE_STDIO_DIR_TRUE@@NEWLIB_NANO_FORMATTED_IO_FALSE@ libc/stdio/sswprint_= r.c =20 @HAVE_STDIO_DIR_TRUE@am__append_12 =3D libc/stdio/clearerr.c \ @HAVE_STDIO_DIR_TRUE@ libc/stdio/fclose.c libc/stdio/fdopen.c \ @@ -1172,7 +1180,15 @@ am__objects_5 =3D libc/stdlib/libc_a-rpmatch.$(OBJEX= T) \ @HAVE_STDIO_DIR_TRUE@@NEWLIB_NANO_FORMATTED_IO_FALSE@ libc/stdio/libc_a-vi= scanf.$(OBJEXT) \ @HAVE_STDIO_DIR_TRUE@@NEWLIB_NANO_FORMATTED_IO_FALSE@ libc/stdio/libc_a-vs= iprintf.$(OBJEXT) \ @HAVE_STDIO_DIR_TRUE@@NEWLIB_NANO_FORMATTED_IO_FALSE@ libc/stdio/libc_a-vs= iscanf.$(OBJEXT) \ -@HAVE_STDIO_DIR_TRUE@@NEWLIB_NANO_FORMATTED_IO_FALSE@ libc/stdio/libc_a-vs= niprintf.$(OBJEXT) +@HAVE_STDIO_DIR_TRUE@@NEWLIB_NANO_FORMATTED_IO_FALSE@ libc/stdio/libc_a-vs= niprintf.$(OBJEXT) \ +@HAVE_STDIO_DIR_TRUE@@NEWLIB_NANO_FORMATTED_IO_FALSE@ libc/stdio/libc_a-sf= puts_r.$(OBJEXT) \ +@HAVE_STDIO_DIR_TRUE@@NEWLIB_NANO_FORMATTED_IO_FALSE@ libc/stdio/libc_a-sf= putws_r.$(OBJEXT) \ +@HAVE_STDIO_DIR_TRUE@@NEWLIB_NANO_FORMATTED_IO_FALSE@ libc/stdio/libc_a-sp= rint_r.$(OBJEXT) \ +@HAVE_STDIO_DIR_TRUE@@NEWLIB_NANO_FORMATTED_IO_FALSE@ libc/stdio/libc_a-sw= print_r.$(OBJEXT) \ +@HAVE_STDIO_DIR_TRUE@@NEWLIB_NANO_FORMATTED_IO_FALSE@ libc/stdio/libc_a-ss= puts_r.$(OBJEXT) \ +@HAVE_STDIO_DIR_TRUE@@NEWLIB_NANO_FORMATTED_IO_FALSE@ libc/stdio/libc_a-ss= putws_r.$(OBJEXT) \ +@HAVE_STDIO_DIR_TRUE@@NEWLIB_NANO_FORMATTED_IO_FALSE@ libc/stdio/libc_a-ss= print_r.$(OBJEXT) \ +@HAVE_STDIO_DIR_TRUE@@NEWLIB_NANO_FORMATTED_IO_FALSE@ libc/stdio/libc_a-ss= wprint_r.$(OBJEXT) @ELIX_LEVEL_1_FALSE@@HAVE_STDIO_DIR_TRUE@@NEWLIB_NANO_FORMATTED_IO_FALSE@a= m__objects_12 =3D libc/stdio/libc_a-asiprintf.$(OBJEXT) \ @ELIX_LEVEL_1_FALSE@@HAVE_STDIO_DIR_TRUE@@NEWLIB_NANO_FORMATTED_IO_FALSE@ = libc/stdio/libc_a-vasiprintf.$(OBJEXT) @ELIX_LEVEL_1_FALSE@@HAVE_STDIO_DIR_TRUE@am__objects_13 =3D libc/stdio/lib= c_a-asprintf.$(OBJEXT) \ @@ -3907,6 +3923,7 @@ pdfdir =3D @pdfdir@ prefix =3D @prefix@ program_transform_name =3D @program_transform_name@ psdir =3D @psdir@ +runstatedir =3D @runstatedir@ sbindir =3D @sbindir@ shared_machine_dir =3D @shared_machine_dir@ sharedstatedir =3D @sharedstatedir@ @@ -5949,6 +5966,22 @@ libc/stdio/libc_a-vsiscanf.$(OBJEXT): libc/stdio/$(a= m__dirstamp) \ libc/stdio/$(DEPDIR)/$(am__dirstamp) libc/stdio/libc_a-vsniprintf.$(OBJEXT): libc/stdio/$(am__dirstamp) \ libc/stdio/$(DEPDIR)/$(am__dirstamp) +libc/stdio/libc_a-sfputs_r.$(OBJEXT): libc/stdio/$(am__dirstamp) \ + libc/stdio/$(DEPDIR)/$(am__dirstamp) +libc/stdio/libc_a-sfputws_r.$(OBJEXT): libc/stdio/$(am__dirstamp) \ + libc/stdio/$(DEPDIR)/$(am__dirstamp) +libc/stdio/libc_a-sprint_r.$(OBJEXT): libc/stdio/$(am__dirstamp) \ + libc/stdio/$(DEPDIR)/$(am__dirstamp) +libc/stdio/libc_a-swprint_r.$(OBJEXT): libc/stdio/$(am__dirstamp) \ + libc/stdio/$(DEPDIR)/$(am__dirstamp) +libc/stdio/libc_a-ssputs_r.$(OBJEXT): libc/stdio/$(am__dirstamp) \ + libc/stdio/$(DEPDIR)/$(am__dirstamp) +libc/stdio/libc_a-ssputws_r.$(OBJEXT): libc/stdio/$(am__dirstamp) \ + libc/stdio/$(DEPDIR)/$(am__dirstamp) +libc/stdio/libc_a-ssprint_r.$(OBJEXT): libc/stdio/$(am__dirstamp) \ + libc/stdio/$(DEPDIR)/$(am__dirstamp) +libc/stdio/libc_a-sswprint_r.$(OBJEXT): libc/stdio/$(am__dirstamp) \ + libc/stdio/$(DEPDIR)/$(am__dirstamp) libc/stdio/libc_a-clearerr.$(OBJEXT): libc/stdio/$(am__dirstamp) \ libc/stdio/$(DEPDIR)/$(am__dirstamp) libc/stdio/libc_a-fclose.$(OBJEXT): libc/stdio/$(am__dirstamp) \ @@ -13417,12 +13450,19 @@ distclean-compile: @AMDEP_TRUE@@am__include@ @am__quote@libc/stdio/$(DEPDIR)/libc_a-setbuffer= .Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@libc/stdio/$(DEPDIR)/libc_a-setlinebu= f.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@libc/stdio/$(DEPDIR)/libc_a-setvbuf.P= o@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@libc/stdio/$(DEPDIR)/libc_a-sfputs_r.= Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@libc/stdio/$(DEPDIR)/libc_a-sfputws_r= .Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@libc/stdio/$(DEPDIR)/libc_a-siprintf.= Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@libc/stdio/$(DEPDIR)/libc_a-siscanf.P= o@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@libc/stdio/$(DEPDIR)/libc_a-sniprintf= .Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@libc/stdio/$(DEPDIR)/libc_a-snprintf.= Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@libc/stdio/$(DEPDIR)/libc_a-sprint_r.= Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@libc/stdio/$(DEPDIR)/libc_a-sprintf.P= o@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@libc/stdio/$(DEPDIR)/libc_a-sscanf.Po= @am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@libc/stdio/$(DEPDIR)/libc_a-ssprint_r= .Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@libc/stdio/$(DEPDIR)/libc_a-ssputs_r.= Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@libc/stdio/$(DEPDIR)/libc_a-ssputws_r= .Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@libc/stdio/$(DEPDIR)/libc_a-sswprint_= r.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@libc/stdio/$(DEPDIR)/libc_a-stdio.Po@= am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@libc/stdio/$(DEPDIR)/libc_a-stdio_ext= .Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@libc/stdio/$(DEPDIR)/libc_a-svfiprint= f.Po@am__quote@ @@ -13433,6 +13473,7 @@ distclean-compile: @AMDEP_TRUE@@am__include@ @am__quote@libc/stdio/$(DEPDIR)/libc_a-svfscanf.= Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@libc/stdio/$(DEPDIR)/libc_a-svfwprint= f.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@libc/stdio/$(DEPDIR)/libc_a-svfwscanf= .Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@libc/stdio/$(DEPDIR)/libc_a-swprint_r= .Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@libc/stdio/$(DEPDIR)/libc_a-swprintf.= Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@libc/stdio/$(DEPDIR)/libc_a-swscanf.P= o@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@libc/stdio/$(DEPDIR)/libc_a-tmpfile.P= o@am__quote@ @@ -23963,6 +24004,118 @@ libc/stdio/libc_a-vsniprintf.obj: libc/stdio/vsni= printf.c @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=3D$(DEPDIR) $(CCDEPMODE) $(depcom= p) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDE= S) $(INCLUDES) $(libc_a_CPPFLAGS) $(CPPFLAGS) $(libc_a_CFLAGS) $(CFLAGS) -c= -o libc/stdio/libc_a-vsniprintf.obj `if test -f 'libc/stdio/vsniprintf.c';= then $(CYGPATH_W) 'libc/stdio/vsniprintf.c'; else $(CYGPATH_W) '$(srcdir)/= libc/stdio/vsniprintf.c'; fi` =20 +libc/stdio/libc_a-sfputs_r.o: libc/stdio/sfputs_r.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDE= S) $(libc_a_CPPFLAGS) $(CPPFLAGS) $(libc_a_CFLAGS) $(CFLAGS) -MT libc/stdio= /libc_a-sfputs_r.o -MD -MP -MF libc/stdio/$(DEPDIR)/libc_a-sfputs_r.Tpo -c = -o libc/stdio/libc_a-sfputs_r.o `test -f 'libc/stdio/sfputs_r.c' || echo '$= (srcdir)/'`libc/stdio/sfputs_r.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) libc/stdio/$(DEPDIR)/libc_a-sfput= s_r.Tpo libc/stdio/$(DEPDIR)/libc_a-sfputs_r.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source=3D'libc/stdio/sfputs_r.= c' object=3D'libc/stdio/libc_a-sfputs_r.o' libtool=3Dno @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=3D$(DEPDIR) $(CCDEPMODE) $(depcom= p) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDE= S) $(INCLUDES) $(libc_a_CPPFLAGS) $(CPPFLAGS) $(libc_a_CFLAGS) $(CFLAGS) -c= -o libc/stdio/libc_a-sfputs_r.o `test -f 'libc/stdio/sfputs_r.c' || echo '= $(srcdir)/'`libc/stdio/sfputs_r.c + +libc/stdio/libc_a-sfputs_r.obj: libc/stdio/sfputs_r.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDE= S) $(libc_a_CPPFLAGS) $(CPPFLAGS) $(libc_a_CFLAGS) $(CFLAGS) -MT libc/stdio= /libc_a-sfputs_r.obj -MD -MP -MF libc/stdio/$(DEPDIR)/libc_a-sfputs_r.Tpo -= c -o libc/stdio/libc_a-sfputs_r.obj `if test -f 'libc/stdio/sfputs_r.c'; th= en $(CYGPATH_W) 'libc/stdio/sfputs_r.c'; else $(CYGPATH_W) '$(srcdir)/libc/= stdio/sfputs_r.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) libc/stdio/$(DEPDIR)/libc_a-sfput= s_r.Tpo libc/stdio/$(DEPDIR)/libc_a-sfputs_r.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source=3D'libc/stdio/sfputs_r.= c' object=3D'libc/stdio/libc_a-sfputs_r.obj' libtool=3Dno @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=3D$(DEPDIR) $(CCDEPMODE) $(depcom= p) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDE= S) $(INCLUDES) $(libc_a_CPPFLAGS) $(CPPFLAGS) $(libc_a_CFLAGS) $(CFLAGS) -c= -o libc/stdio/libc_a-sfputs_r.obj `if test -f 'libc/stdio/sfputs_r.c'; the= n $(CYGPATH_W) 'libc/stdio/sfputs_r.c'; else $(CYGPATH_W) '$(srcdir)/libc/s= tdio/sfputs_r.c'; fi` + +libc/stdio/libc_a-sfputws_r.o: libc/stdio/sfputws_r.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDE= S) $(libc_a_CPPFLAGS) $(CPPFLAGS) $(libc_a_CFLAGS) $(CFLAGS) -MT libc/stdio= /libc_a-sfputws_r.o -MD -MP -MF libc/stdio/$(DEPDIR)/libc_a-sfputws_r.Tpo -= c -o libc/stdio/libc_a-sfputws_r.o `test -f 'libc/stdio/sfputws_r.c' || ech= o '$(srcdir)/'`libc/stdio/sfputws_r.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) libc/stdio/$(DEPDIR)/libc_a-sfput= ws_r.Tpo libc/stdio/$(DEPDIR)/libc_a-sfputws_r.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source=3D'libc/stdio/sfputws_r= .c' object=3D'libc/stdio/libc_a-sfputws_r.o' libtool=3Dno @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=3D$(DEPDIR) $(CCDEPMODE) $(depcom= p) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDE= S) $(INCLUDES) $(libc_a_CPPFLAGS) $(CPPFLAGS) $(libc_a_CFLAGS) $(CFLAGS) -c= -o libc/stdio/libc_a-sfputws_r.o `test -f 'libc/stdio/sfputws_r.c' || echo= '$(srcdir)/'`libc/stdio/sfputws_r.c + +libc/stdio/libc_a-sfputws_r.obj: libc/stdio/sfputws_r.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDE= S) $(libc_a_CPPFLAGS) $(CPPFLAGS) $(libc_a_CFLAGS) $(CFLAGS) -MT libc/stdio= /libc_a-sfputws_r.obj -MD -MP -MF libc/stdio/$(DEPDIR)/libc_a-sfputws_r.Tpo= -c -o libc/stdio/libc_a-sfputws_r.obj `if test -f 'libc/stdio/sfputws_r.c'= ; then $(CYGPATH_W) 'libc/stdio/sfputws_r.c'; else $(CYGPATH_W) '$(srcdir)/= libc/stdio/sfputws_r.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) libc/stdio/$(DEPDIR)/libc_a-sfput= ws_r.Tpo libc/stdio/$(DEPDIR)/libc_a-sfputws_r.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source=3D'libc/stdio/sfputws_r= .c' object=3D'libc/stdio/libc_a-sfputws_r.obj' libtool=3Dno @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=3D$(DEPDIR) $(CCDEPMODE) $(depcom= p) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDE= S) $(INCLUDES) $(libc_a_CPPFLAGS) $(CPPFLAGS) $(libc_a_CFLAGS) $(CFLAGS) -c= -o libc/stdio/libc_a-sfputws_r.obj `if test -f 'libc/stdio/sfputws_r.c'; t= hen $(CYGPATH_W) 'libc/stdio/sfputws_r.c'; else $(CYGPATH_W) '$(srcdir)/lib= c/stdio/sfputws_r.c'; fi` + +libc/stdio/libc_a-sprint_r.o: libc/stdio/sprint_r.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDE= S) $(libc_a_CPPFLAGS) $(CPPFLAGS) $(libc_a_CFLAGS) $(CFLAGS) -MT libc/stdio= /libc_a-sprint_r.o -MD -MP -MF libc/stdio/$(DEPDIR)/libc_a-sprint_r.Tpo -c = -o libc/stdio/libc_a-sprint_r.o `test -f 'libc/stdio/sprint_r.c' || echo '$= (srcdir)/'`libc/stdio/sprint_r.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) libc/stdio/$(DEPDIR)/libc_a-sprin= t_r.Tpo libc/stdio/$(DEPDIR)/libc_a-sprint_r.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source=3D'libc/stdio/sprint_r.= c' object=3D'libc/stdio/libc_a-sprint_r.o' libtool=3Dno @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=3D$(DEPDIR) $(CCDEPMODE) $(depcom= p) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDE= S) $(INCLUDES) $(libc_a_CPPFLAGS) $(CPPFLAGS) $(libc_a_CFLAGS) $(CFLAGS) -c= -o libc/stdio/libc_a-sprint_r.o `test -f 'libc/stdio/sprint_r.c' || echo '= $(srcdir)/'`libc/stdio/sprint_r.c + +libc/stdio/libc_a-sprint_r.obj: libc/stdio/sprint_r.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDE= S) $(libc_a_CPPFLAGS) $(CPPFLAGS) $(libc_a_CFLAGS) $(CFLAGS) -MT libc/stdio= /libc_a-sprint_r.obj -MD -MP -MF libc/stdio/$(DEPDIR)/libc_a-sprint_r.Tpo -= c -o libc/stdio/libc_a-sprint_r.obj `if test -f 'libc/stdio/sprint_r.c'; th= en $(CYGPATH_W) 'libc/stdio/sprint_r.c'; else $(CYGPATH_W) '$(srcdir)/libc/= stdio/sprint_r.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) libc/stdio/$(DEPDIR)/libc_a-sprin= t_r.Tpo libc/stdio/$(DEPDIR)/libc_a-sprint_r.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source=3D'libc/stdio/sprint_r.= c' object=3D'libc/stdio/libc_a-sprint_r.obj' libtool=3Dno @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=3D$(DEPDIR) $(CCDEPMODE) $(depcom= p) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDE= S) $(INCLUDES) $(libc_a_CPPFLAGS) $(CPPFLAGS) $(libc_a_CFLAGS) $(CFLAGS) -c= -o libc/stdio/libc_a-sprint_r.obj `if test -f 'libc/stdio/sprint_r.c'; the= n $(CYGPATH_W) 'libc/stdio/sprint_r.c'; else $(CYGPATH_W) '$(srcdir)/libc/s= tdio/sprint_r.c'; fi` + +libc/stdio/libc_a-swprint_r.o: libc/stdio/swprint_r.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDE= S) $(libc_a_CPPFLAGS) $(CPPFLAGS) $(libc_a_CFLAGS) $(CFLAGS) -MT libc/stdio= /libc_a-swprint_r.o -MD -MP -MF libc/stdio/$(DEPDIR)/libc_a-swprint_r.Tpo -= c -o libc/stdio/libc_a-swprint_r.o `test -f 'libc/stdio/swprint_r.c' || ech= o '$(srcdir)/'`libc/stdio/swprint_r.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) libc/stdio/$(DEPDIR)/libc_a-swpri= nt_r.Tpo libc/stdio/$(DEPDIR)/libc_a-swprint_r.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source=3D'libc/stdio/swprint_r= .c' object=3D'libc/stdio/libc_a-swprint_r.o' libtool=3Dno @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=3D$(DEPDIR) $(CCDEPMODE) $(depcom= p) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDE= S) $(INCLUDES) $(libc_a_CPPFLAGS) $(CPPFLAGS) $(libc_a_CFLAGS) $(CFLAGS) -c= -o libc/stdio/libc_a-swprint_r.o `test -f 'libc/stdio/swprint_r.c' || echo= '$(srcdir)/'`libc/stdio/swprint_r.c + +libc/stdio/libc_a-swprint_r.obj: libc/stdio/swprint_r.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDE= S) $(libc_a_CPPFLAGS) $(CPPFLAGS) $(libc_a_CFLAGS) $(CFLAGS) -MT libc/stdio= /libc_a-swprint_r.obj -MD -MP -MF libc/stdio/$(DEPDIR)/libc_a-swprint_r.Tpo= -c -o libc/stdio/libc_a-swprint_r.obj `if test -f 'libc/stdio/swprint_r.c'= ; then $(CYGPATH_W) 'libc/stdio/swprint_r.c'; else $(CYGPATH_W) '$(srcdir)/= libc/stdio/swprint_r.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) libc/stdio/$(DEPDIR)/libc_a-swpri= nt_r.Tpo libc/stdio/$(DEPDIR)/libc_a-swprint_r.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source=3D'libc/stdio/swprint_r= .c' object=3D'libc/stdio/libc_a-swprint_r.obj' libtool=3Dno @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=3D$(DEPDIR) $(CCDEPMODE) $(depcom= p) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDE= S) $(INCLUDES) $(libc_a_CPPFLAGS) $(CPPFLAGS) $(libc_a_CFLAGS) $(CFLAGS) -c= -o libc/stdio/libc_a-swprint_r.obj `if test -f 'libc/stdio/swprint_r.c'; t= hen $(CYGPATH_W) 'libc/stdio/swprint_r.c'; else $(CYGPATH_W) '$(srcdir)/lib= c/stdio/swprint_r.c'; fi` + +libc/stdio/libc_a-ssputs_r.o: libc/stdio/ssputs_r.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDE= S) $(libc_a_CPPFLAGS) $(CPPFLAGS) $(libc_a_CFLAGS) $(CFLAGS) -MT libc/stdio= /libc_a-ssputs_r.o -MD -MP -MF libc/stdio/$(DEPDIR)/libc_a-ssputs_r.Tpo -c = -o libc/stdio/libc_a-ssputs_r.o `test -f 'libc/stdio/ssputs_r.c' || echo '$= (srcdir)/'`libc/stdio/ssputs_r.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) libc/stdio/$(DEPDIR)/libc_a-ssput= s_r.Tpo libc/stdio/$(DEPDIR)/libc_a-ssputs_r.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source=3D'libc/stdio/ssputs_r.= c' object=3D'libc/stdio/libc_a-ssputs_r.o' libtool=3Dno @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=3D$(DEPDIR) $(CCDEPMODE) $(depcom= p) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDE= S) $(INCLUDES) $(libc_a_CPPFLAGS) $(CPPFLAGS) $(libc_a_CFLAGS) $(CFLAGS) -c= -o libc/stdio/libc_a-ssputs_r.o `test -f 'libc/stdio/ssputs_r.c' || echo '= $(srcdir)/'`libc/stdio/ssputs_r.c + +libc/stdio/libc_a-ssputs_r.obj: libc/stdio/ssputs_r.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDE= S) $(libc_a_CPPFLAGS) $(CPPFLAGS) $(libc_a_CFLAGS) $(CFLAGS) -MT libc/stdio= /libc_a-ssputs_r.obj -MD -MP -MF libc/stdio/$(DEPDIR)/libc_a-ssputs_r.Tpo -= c -o libc/stdio/libc_a-ssputs_r.obj `if test -f 'libc/stdio/ssputs_r.c'; th= en $(CYGPATH_W) 'libc/stdio/ssputs_r.c'; else $(CYGPATH_W) '$(srcdir)/libc/= stdio/ssputs_r.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) libc/stdio/$(DEPDIR)/libc_a-ssput= s_r.Tpo libc/stdio/$(DEPDIR)/libc_a-ssputs_r.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source=3D'libc/stdio/ssputs_r.= c' object=3D'libc/stdio/libc_a-ssputs_r.obj' libtool=3Dno @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=3D$(DEPDIR) $(CCDEPMODE) $(depcom= p) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDE= S) $(INCLUDES) $(libc_a_CPPFLAGS) $(CPPFLAGS) $(libc_a_CFLAGS) $(CFLAGS) -c= -o libc/stdio/libc_a-ssputs_r.obj `if test -f 'libc/stdio/ssputs_r.c'; the= n $(CYGPATH_W) 'libc/stdio/ssputs_r.c'; else $(CYGPATH_W) '$(srcdir)/libc/s= tdio/ssputs_r.c'; fi` + +libc/stdio/libc_a-ssputws_r.o: libc/stdio/ssputws_r.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDE= S) $(libc_a_CPPFLAGS) $(CPPFLAGS) $(libc_a_CFLAGS) $(CFLAGS) -MT libc/stdio= /libc_a-ssputws_r.o -MD -MP -MF libc/stdio/$(DEPDIR)/libc_a-ssputws_r.Tpo -= c -o libc/stdio/libc_a-ssputws_r.o `test -f 'libc/stdio/ssputws_r.c' || ech= o '$(srcdir)/'`libc/stdio/ssputws_r.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) libc/stdio/$(DEPDIR)/libc_a-ssput= ws_r.Tpo libc/stdio/$(DEPDIR)/libc_a-ssputws_r.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source=3D'libc/stdio/ssputws_r= .c' object=3D'libc/stdio/libc_a-ssputws_r.o' libtool=3Dno @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=3D$(DEPDIR) $(CCDEPMODE) $(depcom= p) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDE= S) $(INCLUDES) $(libc_a_CPPFLAGS) $(CPPFLAGS) $(libc_a_CFLAGS) $(CFLAGS) -c= -o libc/stdio/libc_a-ssputws_r.o `test -f 'libc/stdio/ssputws_r.c' || echo= '$(srcdir)/'`libc/stdio/ssputws_r.c + +libc/stdio/libc_a-ssputws_r.obj: libc/stdio/ssputws_r.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDE= S) $(libc_a_CPPFLAGS) $(CPPFLAGS) $(libc_a_CFLAGS) $(CFLAGS) -MT libc/stdio= /libc_a-ssputws_r.obj -MD -MP -MF libc/stdio/$(DEPDIR)/libc_a-ssputws_r.Tpo= -c -o libc/stdio/libc_a-ssputws_r.obj `if test -f 'libc/stdio/ssputws_r.c'= ; then $(CYGPATH_W) 'libc/stdio/ssputws_r.c'; else $(CYGPATH_W) '$(srcdir)/= libc/stdio/ssputws_r.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) libc/stdio/$(DEPDIR)/libc_a-ssput= ws_r.Tpo libc/stdio/$(DEPDIR)/libc_a-ssputws_r.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source=3D'libc/stdio/ssputws_r= .c' object=3D'libc/stdio/libc_a-ssputws_r.obj' libtool=3Dno @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=3D$(DEPDIR) $(CCDEPMODE) $(depcom= p) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDE= S) $(INCLUDES) $(libc_a_CPPFLAGS) $(CPPFLAGS) $(libc_a_CFLAGS) $(CFLAGS) -c= -o libc/stdio/libc_a-ssputws_r.obj `if test -f 'libc/stdio/ssputws_r.c'; t= hen $(CYGPATH_W) 'libc/stdio/ssputws_r.c'; else $(CYGPATH_W) '$(srcdir)/lib= c/stdio/ssputws_r.c'; fi` + +libc/stdio/libc_a-ssprint_r.o: libc/stdio/ssprint_r.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDE= S) $(libc_a_CPPFLAGS) $(CPPFLAGS) $(libc_a_CFLAGS) $(CFLAGS) -MT libc/stdio= /libc_a-ssprint_r.o -MD -MP -MF libc/stdio/$(DEPDIR)/libc_a-ssprint_r.Tpo -= c -o libc/stdio/libc_a-ssprint_r.o `test -f 'libc/stdio/ssprint_r.c' || ech= o '$(srcdir)/'`libc/stdio/ssprint_r.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) libc/stdio/$(DEPDIR)/libc_a-sspri= nt_r.Tpo libc/stdio/$(DEPDIR)/libc_a-ssprint_r.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source=3D'libc/stdio/ssprint_r= .c' object=3D'libc/stdio/libc_a-ssprint_r.o' libtool=3Dno @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=3D$(DEPDIR) $(CCDEPMODE) $(depcom= p) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDE= S) $(INCLUDES) $(libc_a_CPPFLAGS) $(CPPFLAGS) $(libc_a_CFLAGS) $(CFLAGS) -c= -o libc/stdio/libc_a-ssprint_r.o `test -f 'libc/stdio/ssprint_r.c' || echo= '$(srcdir)/'`libc/stdio/ssprint_r.c + +libc/stdio/libc_a-ssprint_r.obj: libc/stdio/ssprint_r.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDE= S) $(libc_a_CPPFLAGS) $(CPPFLAGS) $(libc_a_CFLAGS) $(CFLAGS) -MT libc/stdio= /libc_a-ssprint_r.obj -MD -MP -MF libc/stdio/$(DEPDIR)/libc_a-ssprint_r.Tpo= -c -o libc/stdio/libc_a-ssprint_r.obj `if test -f 'libc/stdio/ssprint_r.c'= ; then $(CYGPATH_W) 'libc/stdio/ssprint_r.c'; else $(CYGPATH_W) '$(srcdir)/= libc/stdio/ssprint_r.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) libc/stdio/$(DEPDIR)/libc_a-sspri= nt_r.Tpo libc/stdio/$(DEPDIR)/libc_a-ssprint_r.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source=3D'libc/stdio/ssprint_r= .c' object=3D'libc/stdio/libc_a-ssprint_r.obj' libtool=3Dno @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=3D$(DEPDIR) $(CCDEPMODE) $(depcom= p) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDE= S) $(INCLUDES) $(libc_a_CPPFLAGS) $(CPPFLAGS) $(libc_a_CFLAGS) $(CFLAGS) -c= -o libc/stdio/libc_a-ssprint_r.obj `if test -f 'libc/stdio/ssprint_r.c'; t= hen $(CYGPATH_W) 'libc/stdio/ssprint_r.c'; else $(CYGPATH_W) '$(srcdir)/lib= c/stdio/ssprint_r.c'; fi` + +libc/stdio/libc_a-sswprint_r.o: libc/stdio/sswprint_r.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDE= S) $(libc_a_CPPFLAGS) $(CPPFLAGS) $(libc_a_CFLAGS) $(CFLAGS) -MT libc/stdio= /libc_a-sswprint_r.o -MD -MP -MF libc/stdio/$(DEPDIR)/libc_a-sswprint_r.Tpo= -c -o libc/stdio/libc_a-sswprint_r.o `test -f 'libc/stdio/sswprint_r.c' ||= echo '$(srcdir)/'`libc/stdio/sswprint_r.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) libc/stdio/$(DEPDIR)/libc_a-sswpr= int_r.Tpo libc/stdio/$(DEPDIR)/libc_a-sswprint_r.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source=3D'libc/stdio/sswprint_= r.c' object=3D'libc/stdio/libc_a-sswprint_r.o' libtool=3Dno @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=3D$(DEPDIR) $(CCDEPMODE) $(depcom= p) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDE= S) $(INCLUDES) $(libc_a_CPPFLAGS) $(CPPFLAGS) $(libc_a_CFLAGS) $(CFLAGS) -c= -o libc/stdio/libc_a-sswprint_r.o `test -f 'libc/stdio/sswprint_r.c' || ec= ho '$(srcdir)/'`libc/stdio/sswprint_r.c + +libc/stdio/libc_a-sswprint_r.obj: libc/stdio/sswprint_r.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDE= S) $(libc_a_CPPFLAGS) $(CPPFLAGS) $(libc_a_CFLAGS) $(CFLAGS) -MT libc/stdio= /libc_a-sswprint_r.obj -MD -MP -MF libc/stdio/$(DEPDIR)/libc_a-sswprint_r.T= po -c -o libc/stdio/libc_a-sswprint_r.obj `if test -f 'libc/stdio/sswprint_= r.c'; then $(CYGPATH_W) 'libc/stdio/sswprint_r.c'; else $(CYGPATH_W) '$(src= dir)/libc/stdio/sswprint_r.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) libc/stdio/$(DEPDIR)/libc_a-sswpr= int_r.Tpo libc/stdio/$(DEPDIR)/libc_a-sswprint_r.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source=3D'libc/stdio/sswprint_= r.c' object=3D'libc/stdio/libc_a-sswprint_r.obj' libtool=3Dno @AMDEPBACKSLA= SH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=3D$(DEPDIR) $(CCDEPMODE) $(depcom= p) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDE= S) $(INCLUDES) $(libc_a_CPPFLAGS) $(CPPFLAGS) $(libc_a_CFLAGS) $(CFLAGS) -c= -o libc/stdio/libc_a-sswprint_r.obj `if test -f 'libc/stdio/sswprint_r.c';= then $(CYGPATH_W) 'libc/stdio/sswprint_r.c'; else $(CYGPATH_W) '$(srcdir)/= libc/stdio/sswprint_r.c'; fi` + libc/stdio/libc_a-clearerr.o: libc/stdio/clearerr.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDE= S) $(libc_a_CPPFLAGS) $(CPPFLAGS) $(libc_a_CFLAGS) $(CFLAGS) -MT libc/stdio= /libc_a-clearerr.o -MD -MP -MF libc/stdio/$(DEPDIR)/libc_a-clearerr.Tpo -c = -o libc/stdio/libc_a-clearerr.o `test -f 'libc/stdio/clearerr.c' || echo '$= (srcdir)/'`libc/stdio/clearerr.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) libc/stdio/$(DEPDIR)/libc_a-clear= err.Tpo libc/stdio/$(DEPDIR)/libc_a-clearerr.Po diff --git a/newlib/libc/stdio/Makefile.inc b/newlib/libc/stdio/Makefile.inc index 2126ceaf5911..0780e5c602b9 100644 --- a/newlib/libc/stdio/Makefile.inc +++ b/newlib/libc/stdio/Makefile.inc @@ -33,7 +33,15 @@ libc_a_SOURCES +=3D \ %D%/viscanf.c \ %D%/vsiprintf.c \ %D%/vsiscanf.c \ - %D%/vsniprintf.c + %D%/vsniprintf.c \ + %D%/sfputs_r.c \ + %D%/sfputws_r.c \ + %D%/sprint_r.c \ + %D%/swprint_r.c \ + %D%/ssputs_r.c \ + %D%/ssputws_r.c \ + %D%/ssprint_r.c \ + %D%/sswprint_r.c endif =20 libc_a_SOURCES +=3D \ diff --git a/newlib/libc/stdio/sfputs_r.c b/newlib/libc/stdio/sfputs_r.c new file mode 100644 index 000000000000..8e5fc067f344 --- /dev/null +++ b/newlib/libc/stdio/sfputs_r.c @@ -0,0 +1,23 @@ +#include + +#ifndef _FVWRITE_IN_STREAMIO + +#include +#include + +int +__sfputs_r (struct _reent *ptr, + FILE *fp, + const char *buf, + size_t len) +{ + register int i; + + for (i =3D 0; i < len; i++) { + if (_fputc_r (ptr, buf[i], fp) =3D=3D EOF) + return -1; + } + return (0); +} + +#endif diff --git a/newlib/libc/stdio/sfputws_r.c b/newlib/libc/stdio/sfputws_r.c new file mode 100644 index 000000000000..94b04348ed6e --- /dev/null +++ b/newlib/libc/stdio/sfputws_r.c @@ -0,0 +1,24 @@ +#include + +#ifndef _FVWRITE_IN_STREAMIO + +#include +#include +#include + +int +__sfputws_r (struct _reent *ptr, + FILE *fp, + const wchar_t *buf, + size_t len) +{ + register int i; + + for (i =3D 0; i < len; i++) { + if (_fputwc_r (ptr, buf[i], fp) =3D=3D WEOF) + return -1; + } + return (0); +} + +#endif diff --git a/newlib/libc/stdio/sprint_r.c b/newlib/libc/stdio/sprint_r.c new file mode 100644 index 000000000000..81c7b7f23659 --- /dev/null +++ b/newlib/libc/stdio/sprint_r.c @@ -0,0 +1,30 @@ +#include + +#ifdef _FVWRITE_IN_STREAMIO + +#include +#include +#include "fvwrite.h" + +/* + * Flush out all the vectors defined by the given uio, + * then reset it so that it can be reused. + */ +int +__sprint_r (struct _reent *ptr, + FILE *fp, + register struct __suio *uio) +{ + register int err =3D 0; + + if (uio->uio_resid =3D=3D 0) { + uio->uio_iovcnt =3D 0; + return (0); + } + err =3D __sfvwrite_r(ptr, fp, uio); + uio->uio_resid =3D 0; + uio->uio_iovcnt =3D 0; + return (err); +} + +#endif diff --git a/newlib/libc/stdio/ssprint_r.c b/newlib/libc/stdio/ssprint_r.c new file mode 100644 index 000000000000..eedbd6a9390e --- /dev/null +++ b/newlib/libc/stdio/ssprint_r.c @@ -0,0 +1,36 @@ +#include + +#ifdef _FVWRITE_IN_STREAMIO + +#include +#include +#include "fvwrite.h" + +extern int __ssputs_r (struct _reent *ptr, FILE *fp, const char *buf, + size_t len); + +int +__ssprint_r (struct _reent *ptr, + FILE *fp, + register struct __suio *uio) +{ + register struct __siov *iov =3D uio->uio_iov; + register size_t len; + int ret =3D 0; + + while (uio->uio_resid > 0 && uio->uio_iovcnt-- > 0) { + if ((len =3D iov->iov_len) > 0) { + if (__ssputs_r (ptr, fp, iov->iov_base, len) =3D=3D EOF) { + ret =3D EOF; + break; + } + uio->uio_resid -=3D len; /* pretend we copied all */ + } + iov++; + } + uio->uio_resid =3D 0; + uio->uio_iovcnt =3D 0; + return ret; +} + +#endif diff --git a/newlib/libc/stdio/ssputs_r.c b/newlib/libc/stdio/ssputs_r.c new file mode 100644 index 000000000000..abd18ef4bfd7 --- /dev/null +++ b/newlib/libc/stdio/ssputs_r.c @@ -0,0 +1,69 @@ +#include + +#include +#include +#include +#include +#include + +int +__ssputs_r (struct _reent *ptr, + FILE *fp, + const char *buf, + size_t len) +{ + register int w; + + w =3D fp->_w; + if (len >=3D w && fp->_flags & (__SMBF | __SOPT)) { + /* must be asprintf family */ + unsigned char *str; + int curpos =3D (fp->_p - fp->_bf._base); + /* Choose a geometric growth factor to avoid + * quadratic realloc behavior, but use a rate less + * than (1+sqrt(5))/2 to accomodate malloc + * overhead. asprintf EXPECTS us to overallocate, so + * that it can add a trailing \0 without + * reallocating. The new allocation should thus be + * max(prev_size*1.5, curpos+len+1). */ + int newsize =3D fp->_bf._size * 3 / 2; + if (newsize < curpos + len + 1) + newsize =3D curpos + len + 1; + if (fp->_flags & __SOPT) + { + /* asnprintf leaves original buffer alone. */ + str =3D (unsigned char *)_malloc_r (ptr, newsize); + if (!str) + goto err; + memcpy (str, fp->_bf._base, curpos); + fp->_flags =3D (fp->_flags & ~__SOPT) | __SMBF; + } + else + { + str =3D (unsigned char *)_realloc_r (ptr, fp->_bf._base, + newsize); + if (!str) { + /* Free unneeded buffer. */ + _free_r (ptr, fp->_bf._base); + goto err; + } + } + fp->_bf._base =3D str; + fp->_p =3D str + curpos; + fp->_bf._size =3D newsize; + w =3D len; + fp->_w =3D newsize - curpos; + } + if (len < w) + w =3D len; + memmove ((void *) fp->_p, (void *) buf, (size_t) (w)); + fp->_w -=3D w; + fp->_p +=3D w; + + return 0; + +err: + _REENT_ERRNO(ptr) =3D ENOMEM; + fp->_flags |=3D __SERR; + return EOF; +} diff --git a/newlib/libc/stdio/ssputws_r.c b/newlib/libc/stdio/ssputws_r.c new file mode 100644 index 000000000000..07ceba800eb1 --- /dev/null +++ b/newlib/libc/stdio/ssputws_r.c @@ -0,0 +1,21 @@ +#include + +#ifndef _FVWRITE_IN_STREAMIO + +#include +#include +#include + +extern int __ssputs_r (struct _reent *ptr, FILE *fp, const char *buf, + size_t len); + +int +__ssputws_r (struct _reent *ptr, + FILE *fp, + const wchar_t *buf, + size_t len) +{ + return __ssputs_r (ptr, fp, (const char *) buf, len * sizeof (wchar_t)); +} + +#endif diff --git a/newlib/libc/stdio/sswprint_r.c b/newlib/libc/stdio/sswprint_r.c new file mode 100644 index 000000000000..963e31df38b0 --- /dev/null +++ b/newlib/libc/stdio/sswprint_r.c @@ -0,0 +1,38 @@ +#include + +#ifdef _FVWRITE_IN_STREAMIO + +#include +#include +#include +#include "fvwrite.h" + +extern int __ssputs_r (struct _reent *ptr, FILE *fp, const char *buf, + size_t len); + +int +__sswprint_r (struct _reent *ptr, + FILE *fp, + register struct __suio *uio) +{ + register struct __siov *iov =3D uio->uio_iov; + register size_t len; + int ret =3D 0; + + while (uio->uio_resid > 0 && uio->uio_iovcnt-- > 0) { + if ((len =3D iov->iov_len) > 0) { + if (__ssputs_r (ptr, fp, iov->iov_base, + len * sizeof (wchar_t)) =3D=3D EOF) { + ret =3D -1; + break; + } + uio->uio_resid -=3D len; /* pretend we copied all */ + } + iov++; + } + uio->uio_resid =3D 0; + uio->uio_iovcnt =3D 0; + return ret; +} + +#endif diff --git a/newlib/libc/stdio/swprint_r.c b/newlib/libc/stdio/swprint_r.c new file mode 100644 index 000000000000..e4be0c839a25 --- /dev/null +++ b/newlib/libc/stdio/swprint_r.c @@ -0,0 +1,46 @@ +#include + +#ifdef _FVWRITE_IN_STREAMIO + +#include +#include +#include +#include "fvwrite.h" + +/* + * Flush out all the vectors defined by the given uio, + * then reset it so that it can be reused. + */ +int +__swprint_r (struct _reent *ptr, + FILE *fp, + register struct __suio *uio) +{ + register int err =3D 0; + struct __siov *iov; + wchar_t *p; + int i, len; + + if (uio->uio_resid =3D=3D 0) { + uio->uio_iovcnt =3D 0; + return (0); + } + iov =3D uio->uio_iov; + for (; uio->uio_resid !=3D 0; + uio->uio_resid -=3D len, iov++) { + p =3D (wchar_t *) iov->iov_base; + len =3D iov->iov_len; + for (i =3D 0; i < len; i++) { + if (_fputwc_r (ptr, p[i], fp) =3D=3D WEOF) { + err =3D -1; + goto out; + } + } + } +out: + uio->uio_resid =3D 0; + uio->uio_iovcnt =3D 0; + return (err); +} + +#endif diff --git a/newlib/libc/stdio/vfprintf.c b/newlib/libc/stdio/vfprintf.c index 42272abe44c5..feb1fab56063 100644 --- a/newlib/libc/stdio/vfprintf.c +++ b/newlib/libc/stdio/vfprintf.c @@ -174,270 +174,24 @@ static char *rcsid =3D "$Id$"; #endif =20 #ifdef STRING_ONLY + # ifdef _FVWRITE_IN_STREAMIO # define __SPRINT __ssprint_r + int __ssprint_r (struct _reent *, FILE *, register struct __suio *); # else # define __SPRINT __ssputs_r + int __ssputs_r (struct _reent *, FILE *, const char *, size_t); # endif -#else + +#else /* !STRING_ONLY */ + # ifdef _FVWRITE_IN_STREAMIO # define __SPRINT __sprint_r + int __sprint_r (struct _reent *, FILE *, register struct __suio *); # else # define __SPRINT __sfputs_r + int __sfputs_r (struct _reent *, FILE *, const char *buf, size_t); # endif -#endif - -/* The __sprint_r/__ssprint_r functions are shared between all versions of - vfprintf and vfwprintf. They must only be defined once, which we do in - the INTEGER_ONLY versions here. */ -#ifdef STRING_ONLY -#ifdef INTEGER_ONLY -#ifndef _FVWRITE_IN_STREAMIO -int -__ssputs_r (struct _reent *ptr, - FILE *fp, - const char *buf, - size_t len) -{ - register int w; - - w =3D fp->_w; - if (len >=3D w && fp->_flags & (__SMBF | __SOPT)) { - /* must be asprintf family */ - unsigned char *str; - int curpos =3D (fp->_p - fp->_bf._base); - /* Choose a geometric growth factor to avoid - * quadratic realloc behavior, but use a rate less - * than (1+sqrt(5))/2 to accomodate malloc - * overhead. asprintf EXPECTS us to overallocate, so - * that it can add a trailing \0 without - * reallocating. The new allocation should thus be - * max(prev_size*1.5, curpos+len+1). */ - int newsize =3D fp->_bf._size * 3 / 2; - if (newsize < curpos + len + 1) - newsize =3D curpos + len + 1; - if (fp->_flags & __SOPT) - { - /* asnprintf leaves original buffer alone. */ - str =3D (unsigned char *)_malloc_r (ptr, newsize); - if (!str) - { - _REENT_ERRNO(ptr) =3D ENOMEM; - goto err; - } - memcpy (str, fp->_bf._base, curpos); - fp->_flags =3D (fp->_flags & ~__SOPT) | __SMBF; - } - else - { - str =3D (unsigned char *)_realloc_r (ptr, fp->_bf._base, - newsize); - if (!str) { - /* Free unneeded buffer. */ - _free_r (ptr, fp->_bf._base); - /* Ensure correct errno, even if free - * changed it. */ - _REENT_ERRNO(ptr) =3D ENOMEM; - goto err; - } - } - fp->_bf._base =3D str; - fp->_p =3D str + curpos; - fp->_bf._size =3D newsize; - w =3D len; - fp->_w =3D newsize - curpos; - } - if (len < w) - w =3D len; - (void)memmove ((void *) fp->_p, (void *) buf, (size_t) (w)); - fp->_w -=3D w; - fp->_p +=3D w; - - return 0; - -err: - fp->_flags |=3D __SERR; - return EOF; -} -#endif - -int -__ssprint_r (struct _reent *ptr, - FILE *fp, - register struct __suio *uio) -{ - register size_t len; - register int w; - register struct __siov *iov; - register const char *p =3D NULL; - - iov =3D uio->uio_iov; - len =3D 0; - - if (uio->uio_resid =3D=3D 0) { - uio->uio_iovcnt =3D 0; - return (0); - } - - do { - while (len =3D=3D 0) { - p =3D iov->iov_base; - len =3D iov->iov_len; - iov++; - } - w =3D fp->_w; - if (len >=3D w && fp->_flags & (__SMBF | __SOPT)) { - /* must be asprintf family */ - unsigned char *str; - int curpos =3D (fp->_p - fp->_bf._base); - /* Choose a geometric growth factor to avoid - * quadratic realloc behavior, but use a rate less - * than (1+sqrt(5))/2 to accomodate malloc - * overhead. asprintf EXPECTS us to overallocate, so - * that it can add a trailing \0 without - * reallocating. The new allocation should thus be - * max(prev_size*1.5, curpos+len+1). */ - int newsize =3D fp->_bf._size * 3 / 2; - if (newsize < curpos + len + 1) - newsize =3D curpos + len + 1; - if (fp->_flags & __SOPT) - { - /* asnprintf leaves original buffer alone. */ - str =3D (unsigned char *)_malloc_r (ptr, newsize); - if (!str) - { - _REENT_ERRNO(ptr) =3D ENOMEM; - goto err; - } - memcpy (str, fp->_bf._base, curpos); - fp->_flags =3D (fp->_flags & ~__SOPT) | __SMBF; - } - else - { - str =3D (unsigned char *)_realloc_r (ptr, fp->_bf._base, - newsize); - if (!str) { - /* Free unneeded buffer. */ - _free_r (ptr, fp->_bf._base); - /* Ensure correct errno, even if free - * changed it. */ - _REENT_ERRNO(ptr) =3D ENOMEM; - goto err; - } - } - fp->_bf._base =3D str; - fp->_p =3D str + curpos; - fp->_bf._size =3D newsize; - w =3D len; - fp->_w =3D newsize - curpos; - } - if (len < w) - w =3D len; - (void)memmove ((void *) fp->_p, (void *) p, (size_t) (w)); - fp->_w -=3D w; - fp->_p +=3D w; - w =3D len; /* pretend we copied all */ - p +=3D w; - len -=3D w; - } while ((uio->uio_resid -=3D w) !=3D 0); - - uio->uio_resid =3D 0; - uio->uio_iovcnt =3D 0; - return 0; - -err: - fp->_flags |=3D __SERR; - uio->uio_resid =3D 0; - uio->uio_iovcnt =3D 0; - return EOF; -} -#else /* !INTEGER_ONLY */ -#ifndef _FVWRITE_IN_STREAMIO -int __ssputs_r (struct _reent *, FILE *, const char *, size_t); -#endif -int __ssprint_r (struct _reent *, FILE *, register struct __suio *); -#endif /* !INTEGER_ONLY */ - -#else /* !STRING_ONLY */ -#ifdef INTEGER_ONLY - -#ifndef _FVWRITE_IN_STREAMIO -int -__sfputs_r (struct _reent *ptr, - FILE *fp, - const char *buf, - size_t len) -{ - register int i; - -#if defined _WIDE_ORIENT && (!defined _ELIX_LEVEL || _ELIX_LEVEL >=3D 4) - if (fp->_flags2 & __SWID) { - wchar_t *p; - - p =3D (wchar_t *) buf; - for (i =3D 0; i < (len / sizeof (wchar_t)); i++) { - if (_fputwc_r (ptr, p[i], fp) =3D=3D WEOF) - return -1; - } - } else { -#else - { -#endif - for (i =3D 0; i < len; i++) { - if (_fputc_r (ptr, buf[i], fp) =3D=3D EOF) - return -1; - } - } - return (0); -} -#endif -/* - * Flush out all the vectors defined by the given uio, - * then reset it so that it can be reused. - */ -int -__sprint_r (struct _reent *ptr, - FILE *fp, - register struct __suio *uio) -{ - register int err =3D 0; - - if (uio->uio_resid =3D=3D 0) { - uio->uio_iovcnt =3D 0; - return (0); - } -#if defined _WIDE_ORIENT && (!defined _ELIX_LEVEL || _ELIX_LEVEL >=3D 4) - if (fp->_flags2 & __SWID) { - struct __siov *iov; - wchar_t *p; - int i, len; - - iov =3D uio->uio_iov; - for (; uio->uio_resid !=3D 0; - uio->uio_resid -=3D len * sizeof (wchar_t), iov++) { - p =3D (wchar_t *) iov->iov_base; - len =3D iov->iov_len / sizeof (wchar_t); - for (i =3D 0; i < len; i++) { - if (_fputwc_r (ptr, p[i], fp) =3D=3D WEOF) { - err =3D -1; - goto out; - } - } - } - } else -#endif - err =3D __sfvwrite_r(ptr, fp, uio); -out: - uio->uio_resid =3D 0; - uio->uio_iovcnt =3D 0; - return (err); -} -#else /* !INTEGER_ONLY */ -#ifndef _FVWRITE_IN_STREAMIO -int __sfputs_r (struct _reent *, FILE *, const char *buf, size_t); -#endif -int __sprint_r (struct _reent *, FILE *, register struct __suio *); -#endif /* !INTEGER_ONLY */ =20 #ifdef _UNBUF_STREAM_OPT /* diff --git a/newlib/libc/stdio/vfwprintf.c b/newlib/libc/stdio/vfwprintf.c index bbabbdaee8fb..5a5c368298d2 100644 --- a/newlib/libc/stdio/vfwprintf.c +++ b/newlib/libc/stdio/vfwprintf.c @@ -153,18 +153,18 @@ int _VFWPRINTF_R (struct _reent *, FILE *, const wcha= r_t *, va_list); /* Defined in vfprintf.c. */ #ifdef _FVWRITE_IN_STREAMIO # ifdef STRING_ONLY -# define __SPRINT __ssprint_r +# define __SPRINT __sswprint_r # else -# define __SPRINT __sprint_r +# define __SPRINT __swprint_r # endif int __SPRINT (struct _reent *, FILE *, register struct __suio *); #else # ifdef STRING_ONLY -# define __SPRINT __ssputs_r +# define __SPRINT __ssputws_r # else -# define __SPRINT __sfputs_r +# define __SPRINT __sfputws_r # endif -int __SPRINT (struct _reent *, FILE *, const char *, size_t); +int __SPRINT (struct _reent *, FILE *, const wchar_t *, size_t); #endif #ifndef STRING_ONLY #ifdef _UNBUF_STREAM_OPT @@ -479,8 +479,8 @@ _VFWPRINTF_R (struct _reent *data, #ifdef _FVWRITE_IN_STREAMIO #define PRINT(ptr, len) { \ iovp->iov_base =3D (char *) (ptr); \ - iovp->iov_len =3D (len) * sizeof (wchar_t); \ - uio.uio_resid +=3D (len) * sizeof (wchar_t); \ + iovp->iov_len =3D (len); \ + uio.uio_resid +=3D iovp->iov_len; \ iovp++; \ if (++uio.uio_iovcnt >=3D NIOV) { \ if (__SPRINT(data, fp, &uio)) \ @@ -513,7 +513,7 @@ _VFWPRINTF_R (struct _reent *data, } #else #define PRINT(ptr, len) { \ - if (__SPRINT (data, fp, (const char *)(ptr), (len) * sizeof (wchar_t)) = =3D=3D EOF) \ + if (__SPRINT (data, fp, (ptr), (len)) =3D=3D EOF) \ goto error; \ } #define PAD(howmany, with) { \