Browse Source

use fputwc in putwchar()

use fputwc instead of fputc
add hidden fputwc to avoid jump relocation

Signed-off-by: Peter S. Mazinger <ps.m@gmx.net>
Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
Peter S. Mazinger 13 years ago
parent
commit
6da1949cb5
3 changed files with 4 additions and 4 deletions
  1. 1 0
      include/wchar.h
  2. 2 0
      libc/stdio/fputwc.c
  3. 1 4
      libc/stdio/putwchar.c

+ 1 - 0
include/wchar.h

@@ -656,6 +656,7 @@ extern wint_t getwchar (void);
    These functions are possible cancellation points and therefore not
    marked with __THROW.  */
 extern wint_t fputwc (wchar_t __wc, __FILE *__stream);
+libc_hidden_proto(fputwc)
 extern wint_t putwc (wchar_t __wc, __FILE *__stream);
 
 /* Write a character to stdout.

+ 2 - 0
libc/stdio/fputwc.c

@@ -19,6 +19,7 @@ libc_hidden_def(fputwc_unlocked)
 strong_alias(fputwc_unlocked,putwc_unlocked)
 #ifndef __UCLIBC_HAS_THREADS__
 strong_alias(fputwc_unlocked,fputwc)
+libc_hidden_def(fputwc)
 strong_alias(fputwc_unlocked,putwc)
 #endif
 
@@ -37,6 +38,7 @@ wint_t fputwc(wchar_t wc, register FILE *stream)
 
 	return retval;
 }
+libc_hidden_def(fputwc)
 
 strong_alias(fputwc,putwc)
 

+ 1 - 4
libc/stdio/putwchar.c

@@ -9,7 +9,6 @@
 
 #ifdef __DO_UNLOCKED
 
-
 wint_t putwchar_unlocked(wchar_t wc)
 {
 	return fputwc_unlocked(wc, stdout);
@@ -21,11 +20,9 @@ strong_alias(putwchar_unlocked,putwchar)
 
 #elif defined __UCLIBC_HAS_THREADS__
 
-/* psm: should this be fputwc? */
-
 wint_t putwchar(wchar_t wc)
 {
-	return fputc(wc, stdout);
+	return fputwc(wc, stdout);
 }
 
 #endif