From 868274823302c293bdf3d31a3415f19d4030864e Mon Sep 17 00:00:00 2001 From: Eric Andersen Date: Fri, 15 Dec 2006 00:12:23 +0000 Subject: Patch from Bernhard Fischer: fix compilation if PUTC_MACRO and/or GETC_MACRO is turned off --- libc/stdio/getchar.c | 2 ++ libc/stdio/gets.c | 6 ++---- 2 files changed, 4 insertions(+), 4 deletions(-) (limited to 'libc/stdio') diff --git a/libc/stdio/getchar.c b/libc/stdio/getchar.c index 6da8307b6..a8c39f8db 100644 --- a/libc/stdio/getchar.c +++ b/libc/stdio/getchar.c @@ -12,7 +12,9 @@ libc_hidden_proto(__fgetc_unlocked) #undef getchar #ifdef __DO_UNLOCKED +/* the only use of the hidden getchar_unlocked is in gets.c */ #undef getchar_unlocked +libc_hidden_proto(getchar_unlocked) int getchar_unlocked(void) { register FILE *stream = stdin; diff --git a/libc/stdio/gets.c b/libc/stdio/gets.c index dc541339b..85bb8475a 100644 --- a/libc/stdio/gets.c +++ b/libc/stdio/gets.c @@ -11,11 +11,9 @@ link_warning(gets, "the 'gets' function is dangerous and should not be used.") /* UNSAFE FUNCTION -- do not bother optimizing */ +/* disable macro, force actual function call */ +#undef getchar_unlocked libc_hidden_proto(getchar_unlocked) -libc_hidden_proto(__fgetc_unlocked) -#ifndef __STDIO_GETC_MACRO -#define __stdin stdin -#endif char *gets(char *s) { -- cgit v1.2.3