aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDavid Yuste <dyuste@gcc.gnu.org>2011-02-25 14:23:23 +0000
committerDavid Yuste <dyuste@gcc.gnu.org>2011-02-25 14:23:23 +0000
commit8dde519766f76bc4e6807cd1b9f18840c64fd934 (patch)
tree218f20e63c08cb3c1dcff918ecc4ee1a833e95ea
parentccdc60d209a9dbcef627d8e287c50f27d013ecf1 (diff)
Added stdlib:flieno
git-svn-id: https://gcc.gnu.org/svn/gcc/branches/st/cli-be@170495 138bc75d-0d04-0410-961f-82ee72b054a4
-rw-r--r--libstd/include/stdio.h1
-rw-r--r--libstd/src/Makefile.am1
-rw-r--r--libstd/src/Makefile.in28
-rw-r--r--libstd/src/fileno.c36
4 files changed, 64 insertions, 2 deletions
diff --git a/libstd/include/stdio.h b/libstd/include/stdio.h
index 59a5a02af45..4c16528c642 100644
--- a/libstd/include/stdio.h
+++ b/libstd/include/stdio.h
@@ -47,6 +47,7 @@ LIBSTD_LPROTO(FILE *, fopen, const char* restrict, const char *restrict);
LIBSTD_LPROTO(int, fclose, FILE *restrict);
LIBSTD_LPROTO(int, fflush, FILE *restrict);
LIBSTD_LPROTO(FILE *, freopen, const char *restrict, const char *restrict, FILE *restrict);
+LIBSTD_LPROTO(int, fileno, FILE *restrict);
#define BUFSIZ __LIBSTD_BUFSIZ
diff --git a/libstd/src/Makefile.am b/libstd/src/Makefile.am
index 756afc81ed1..485858cb630 100644
--- a/libstd/src/Makefile.am
+++ b/libstd/src/Makefile.am
@@ -35,6 +35,7 @@ SRC = _Exit.c \
fgetc.c \
fgetpos.c \
fgets.c \
+ fileno.c \
float.c \
fopen.c \
fprintf.c \
diff --git a/libstd/src/Makefile.in b/libstd/src/Makefile.in
index 3b22605c0a0..cdf2fa3de9d 100644
--- a/libstd/src/Makefile.in
+++ b/libstd/src/Makefile.in
@@ -72,7 +72,7 @@ am__objects_1 = libstd_la-_Exit.lo libstd_la-__io_device.lo \
libstd_la-div.lo libstd_la-errno.lo libstd_la-exit.lo \
libstd_la-fclose.lo libstd_la-fenv.lo libstd_la-feof.lo \
libstd_la-ferror.lo libstd_la-fflush.lo libstd_la-fgetc.lo \
- libstd_la-fgetpos.lo libstd_la-fgets.lo libstd_la-float.lo \
+ libstd_la-fgetpos.lo libstd_la-fgets.lo libstd_la-fileno.lo libstd_la-float.lo \
libstd_la-fopen.lo libstd_la-fprintf.lo libstd_la-fputc.lo \
libstd_la-fputs.lo libstd_la-fread.lo libstd_la-free.lo \
libstd_la-freopen.lo libstd_la-fscanf.lo libstd_la-fseek.lo \
@@ -132,7 +132,7 @@ am__objects_2 = libstd_dll-_Exit.$(OBJEXT) \
libstd_dll-fclose.$(OBJEXT) libstd_dll-fenv.$(OBJEXT) \
libstd_dll-feof.$(OBJEXT) libstd_dll-ferror.$(OBJEXT) \
libstd_dll-fflush.$(OBJEXT) libstd_dll-fgetc.$(OBJEXT) \
- libstd_dll-fgetpos.$(OBJEXT) libstd_dll-fgets.$(OBJEXT) \
+ libstd_dll-fgetpos.$(OBJEXT) libstd_dll-fgets.$(OBJEXT) libstd_dll-fileno.$(OBJEXT) \
libstd_dll-float.$(OBJEXT) libstd_dll-fopen.$(OBJEXT) \
libstd_dll-fprintf.$(OBJEXT) libstd_dll-fputc.$(OBJEXT) \
libstd_dll-fputs.$(OBJEXT) libstd_dll-fread.$(OBJEXT) \
@@ -352,6 +352,7 @@ SRC = _Exit.c \
fgetc.c \
fgetpos.c \
fgets.c \
+ fileno.c \
float.c \
fopen.c \
fprintf.c \
@@ -575,6 +576,7 @@ distclean-compile:
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libstd_dll-fgetc.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libstd_dll-fgetpos.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libstd_dll-fgets.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libstd_dll-fileno.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libstd_dll-float.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libstd_dll-fopen.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libstd_dll-fprintf.Po@am__quote@
@@ -705,6 +707,7 @@ distclean-compile:
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libstd_la-fgetc.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libstd_la-fgetpos.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libstd_la-fgets.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libstd_la-fileno.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libstd_la-float.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libstd_la-fopen.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libstd_la-fprintf.Plo@am__quote@
@@ -1073,6 +1076,13 @@ libstd_la-fgets.lo: fgets.c
@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
@am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libstd_la_CFLAGS) $(CFLAGS) -c -o libstd_la-fgets.lo `test -f 'fgets.c' || echo '$(srcdir)/'`fgets.c
+libstd_la-fileno.lo: fileno.c
+@am__fastdepCC_TRUE@ if $(LIBTOOL) --tag=CC --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libstd_la_CFLAGS) $(CFLAGS) -MT libstd_la-fileno.lo -MD -MP -MF "$(DEPDIR)/libstd_la-fileno.Tpo" -c -o libstd_la-fileno.lo `test -f 'fileno.c' || echo '$(srcdir)/'`fileno.c; \
+@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/libstd_la-fileno.Tpo" "$(DEPDIR)/libstd_la-fileno.Plo"; else rm -f "$(DEPDIR)/libstd_la-fileno.Tpo"; exit 1; fi
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='fileno.c' object='libstd_la-fileno.lo' libtool=yes @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libstd_la_CFLAGS) $(CFLAGS) -c -o libstd_la-fileno.lo `test -f 'fileno.c' || echo '$(srcdir)/'`fileno.c
+
libstd_la-float.lo: float.c
@am__fastdepCC_TRUE@ if $(LIBTOOL) --tag=CC --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libstd_la_CFLAGS) $(CFLAGS) -MT libstd_la-float.lo -MD -MP -MF "$(DEPDIR)/libstd_la-float.Tpo" -c -o libstd_la-float.lo `test -f 'float.c' || echo '$(srcdir)/'`float.c; \
@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/libstd_la-float.Tpo" "$(DEPDIR)/libstd_la-float.Plo"; else rm -f "$(DEPDIR)/libstd_la-float.Tpo"; exit 1; fi
@@ -2235,6 +2245,20 @@ libstd_dll-fgets.obj: fgets.c
@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libstd_dll_CFLAGS) $(CFLAGS) -c -o libstd_dll-fgets.obj `if test -f 'fgets.c'; then $(CYGPATH_W) 'fgets.c'; else $(CYGPATH_W) '$(srcdir)/fgets.c'; fi`
+libstd_dll-fileno.o: fileno.c
+@am__fastdepCC_TRUE@ if $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libstd_dll_CFLAGS) $(CFLAGS) -MT libstd_dll-fileno.o -MD -MP -MF "$(DEPDIR)/libstd_dll-fileno.Tpo" -c -o libstd_dll-fileno.o `test -f 'fileno.c' || echo '$(srcdir)/'`fileno.c; \
+@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/libstd_dll-fileno.Tpo" "$(DEPDIR)/libstd_dll-fileno.Po"; else rm -f "$(DEPDIR)/libstd_dll-fileno.Tpo"; exit 1; fi
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='fileno.c' object='libstd_dll-fileno.o' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libstd_dll_CFLAGS) $(CFLAGS) -c -o libstd_dll-fileno.o `test -f 'fileno.c' || echo '$(srcdir)/'`fileno.c
+
+libstd_dll-fileno.obj: fileno.c
+@am__fastdepCC_TRUE@ if $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libstd_dll_CFLAGS) $(CFLAGS) -MT libstd_dll-fileno.obj -MD -MP -MF "$(DEPDIR)/libstd_dll-fileno.Tpo" -c -o libstd_dll-fileno.obj `if test -f 'fileno.c'; then $(CYGPATH_W) 'fileno.c'; else $(CYGPATH_W) '$(srcdir)/fileno.c'; fi`; \
+@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/libstd_dll-fileno.Tpo" "$(DEPDIR)/libstd_dll-fileno.Po"; else rm -f "$(DEPDIR)/libstd_dll-fileno.Tpo"; exit 1; fi
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='fileno.c' object='libstd_dll-fileno.obj' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libstd_dll_CFLAGS) $(CFLAGS) -c -o libstd_dll-fileno.obj `if test -f 'fileno.c'; then $(CYGPATH_W) 'fileno.c'; else $(CYGPATH_W) '$(srcdir)/fileno.c'; fi`
+
libstd_dll-float.o: float.c
@am__fastdepCC_TRUE@ if $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libstd_dll_CFLAGS) $(CFLAGS) -MT libstd_dll-float.o -MD -MP -MF "$(DEPDIR)/libstd_dll-float.Tpo" -c -o libstd_dll-float.o `test -f 'float.c' || echo '$(srcdir)/'`float.c; \
@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/libstd_dll-float.Tpo" "$(DEPDIR)/libstd_dll-float.Po"; else rm -f "$(DEPDIR)/libstd_dll-float.Tpo"; exit 1; fi
diff --git a/libstd/src/fileno.c b/libstd/src/fileno.c
new file mode 100644
index 00000000000..5e145da66b5
--- /dev/null
+++ b/libstd/src/fileno.c
@@ -0,0 +1,36 @@
+/*
+
+ Copyright (C) 2007-2008 Free Software Foundation, Inc.
+ Contributed by STMicroelectronics
+
+This file is part of GCC.
+
+GCC is free software; you can redistribute it and/or modify it under
+the terms of the GNU General Public License as published by the Free
+Software Foundation; either version 2, or (at your option) any later
+version.
+
+GCC is distributed in the hope that it will be useful, but WITHOUT ANY
+WARRANTY; without even the implied warranty of MERCHANTABILITY or
+FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
+for more details.
+
+You should have received a copy of the GNU General Public License
+along with GCC; see the file COPYING. If not, write to the Free
+Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA
+02110-1301, USA. */
+
+/* If we are compiling this, we are sure this is to build C-runtime*/
+#define __LIBSTD_CRT_BUILD
+
+#include <stdio.h>
+#include <string.h>
+
+#include "__io.h"
+
+
+LIBSTD_LPROTO_IMPL(int, fileno, FILE *restrict stream)
+{
+ return stream->fd;
+}
+