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 #undef puts
#define puts(x) fdputs(x, STDOUT) #define puts(x) fdputs(x, STDOUT)
#define eputs(x) fdputs(x, STDERR)
#define fputs fdputs #define fputs fdputs
#ifdef putc #ifdef putc
#undef putc #undef putc
#endif #endif
int getchar (); int eputs (char const* s);
int fdputc (int c, int fd); int fdputc (int c, int fd);
int getchar ();
#define fputc fdputc #define fputc fdputc
#define ungetc fdungetc #define ungetc fdungetc

View File

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