diff --git a/mlibc/include/stdio.h b/mlibc/include/stdio.h index f3d4589f..e3ff2cf5 100644 --- a/mlibc/include/stdio.h +++ b/mlibc/include/stdio.h @@ -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 diff --git a/mlibc/libc-gcc.c b/mlibc/libc-gcc.c index 32575fcc..82e080d8 100644 --- a/mlibc/libc-gcc.c +++ b/mlibc/libc-gcc.c @@ -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) {