diff options
Diffstat (limited to 'libc/stdio/stdio.c')
-rw-r--r-- | libc/stdio/stdio.c | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/libc/stdio/stdio.c b/libc/stdio/stdio.c index f87a69416..d35dd7a66 100644 --- a/libc/stdio/stdio.c +++ b/libc/stdio/stdio.c @@ -1000,6 +1000,25 @@ FILE *fdopen(int fd, __const char *mode) } #endif + +#ifdef L_getc +#undef getc +int getc(FILE *stream) +{ + return(((stream)->bufpos >= (stream)->bufread)? fgetc(stream) : + (*(stream)->bufpos++)); +} +#endif + +#ifdef L_putc +#undef putc +int putc(int c, FILE *stream) +{ + return(((stream)->bufpos >= (stream)->bufwrite)? fputc((c), (stream)) : + (unsigned char) (*(stream)->bufpos++ = (c)) ); +} +#endif + #ifdef L_getchar #undef getchar int getchar(void) |