svn commit: trunk/uClibc: include libc/stdio

andersen at uclibc.org andersen at uclibc.org
Fri Dec 15 00:12:23 UTC 2006


Author: andersen
Date: 2006-12-14 16:12:23 -0800 (Thu, 14 Dec 2006)
New Revision: 16933

Log:
Patch from Bernhard Fischer:
fix compilation if PUTC_MACRO and/or GETC_MACRO is turned off


Modified:
   trunk/uClibc/include/stdio.h
   trunk/uClibc/libc/stdio/getchar.c
   trunk/uClibc/libc/stdio/gets.c


Changeset:
Modified: trunk/uClibc/include/stdio.h
===================================================================
--- trunk/uClibc/include/stdio.h	2006-12-15 00:02:30 UTC (rev 16932)
+++ trunk/uClibc/include/stdio.h	2006-12-15 00:12:23 UTC (rev 16933)
@@ -840,7 +840,14 @@
 #define fputc_unlocked(_ch, _fp)     __FPUTC_UNLOCKED(_ch, _fp)
 #endif
 
+#ifndef __STDIO_GETC_MACRO
+#define __stdin stdin
+#endif
 #define getchar()                    __GETC(__stdin)
+
+#ifndef __STDIO_PUTC_MACRO
+#define __stdout stdout
+#endif
 #define putchar(_ch)                 __PUTC((_ch), __stdout)
 
 #if defined __USE_POSIX || defined __USE_MISC

Modified: trunk/uClibc/libc/stdio/getchar.c
===================================================================
--- trunk/uClibc/libc/stdio/getchar.c	2006-12-15 00:02:30 UTC (rev 16932)
+++ trunk/uClibc/libc/stdio/getchar.c	2006-12-15 00:12:23 UTC (rev 16933)
@@ -12,7 +12,9 @@
 #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;

Modified: trunk/uClibc/libc/stdio/gets.c
===================================================================
--- trunk/uClibc/libc/stdio/gets.c	2006-12-15 00:02:30 UTC (rev 16932)
+++ trunk/uClibc/libc/stdio/gets.c	2006-12-15 00:12:23 UTC (rev 16933)
@@ -11,11 +11,9 @@
 
 /* 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)
 {




More information about the uClibc-cvs mailing list