mescc: Tinycc support: eputs as function for gcc.

* mlibc/libc-gcc.c (eputs)[POSIX]: New function.
* mlibc/include/stdio.h (eputs)[POSIX]: Remove define.
This commit is contained in:
Jan Nieuwenhuizen 2017-08-06 12:16:34 +02:00
parent dd66f9b5d2
commit 513180eb2c
2 changed files with 9 additions and 12 deletions

View File

@ -47,16 +47,15 @@ int fdputs (char const* s, int fd);
#undef puts
#define puts(x) fdputs(x, STDOUT)
#define eputs(x) fdputs(x, STDERR)
#define fputs fdputs
#ifdef putc
#undef putc
#endif
int getchar ();
int eputs (char const* s);
int fdputc (int c, int fd);
int getchar ();
#define fputc fdputc
#define ungetc fdungetc

View File

@ -245,14 +245,6 @@ strcpy (char *dest, char const *src)
return dest;
}
int
eputs (char const* s)
{
int i = strlen (s);
write (STDERR, s, i);
return 0;
}
int
fputs (char const* s, int fd)
{
@ -469,7 +461,11 @@ fdputs (char const* s, int fd)
return 0;
}
#if POSIX
int
eputs (char const* s)
{
return fdputs (s, STDERR);
}
int
fdputc (int c, int fd)
@ -478,6 +474,8 @@ fdputc (int c, int fd)
return 0;
}
#if POSIX
int
putchar (int c)
{