lib: Support gcc-4.6.4: Implement rewind.

* lib/stdio/rewind.c: Move from ../stub.  Implement.
* include/stdio.h (rewind): Declare.
* build-aux/configure-lib.sh (libc_gnu_SOURCES): Update include.
* lib/stub/rewind.c: Remove.
This commit is contained in:
Jan Nieuwenhuizen 2019-02-08 13:56:25 +01:00 committed by Jan (janneke) Nieuwenhuizen
parent 2792233e56
commit 3f5a2523ac
No known key found for this signature in database
GPG Key ID: F3C1A0D9C1D65273
3 changed files with 7 additions and 12 deletions

View File

@ -338,6 +338,7 @@ lib/stdio/fgets.c
lib/stdio/freopen.c
lib/stdio/fscanf.c
lib/stdio/perror.c
lib/stdio/rewind.c
lib/stdio/vfscanf.c
lib/stdlib/__exit.c
lib/stdlib/abort.c
@ -384,7 +385,6 @@ lib/stub/pclose.c
lib/stub/popen.c
lib/stub/pow.c
lib/stub/rand.c
lib/stub/rewind.c
lib/stub/setbuf.c
lib/stub/setgrent.c
lib/stub/setlocale.c

View File

@ -77,6 +77,7 @@ int putc (int c, FILE * stream);
int putchar (int c);
int puts (char const *s);
int remove (char const *file_name);
void rewind (FILE * stream);
int setvbuf (FILE * stream, char *buf, int mode, size_t size);
int ungetc (int c, FILE * stream);
long ftell (FILE * stream);

View File

@ -1,6 +1,6 @@
/* -*-comment-start: "//";comment-end:""-*-
* GNU Mes --- Maxwell Equations of Software
* Copyright © 2018 Jan (janneke) Nieuwenhuizen <janneke@gnu.org>
* Copyright © 2018,2019 Jan (janneke) Nieuwenhuizen <janneke@gnu.org>
*
* This file is part of GNU Mes.
*
@ -18,16 +18,10 @@
* along with GNU Mes. If not, see <http://www.gnu.org/licenses/>.
*/
#include <mes/lib.h>
#include <errno.h>
#include <stdio.h>
int
rewind (int x)
void
rewind (FILE * stream)
{
static int stub = 0;
if (__mes_debug () && !stub)
eputs ("rewind stub\n");
stub = 1;
errno = 0;
return 0;
fseek (stream, 0, SEEK_SET);
}