]> git.saurik.com Git - apple/libc.git/blobdiff - stdio/FreeBSD/getwchar.c
Libc-1439.100.3.tar.gz
[apple/libc.git] / stdio / FreeBSD / getwchar.c
index b0ae3ba9d95e87f0aba16882ac87dafcfa9d56ef..f5c2dd667ce30e0bd538f9824ef2166cc54f4509 100644 (file)
@@ -25,7 +25,9 @@
  */
 
 #include <sys/cdefs.h>
-__FBSDID("$FreeBSD: src/lib/libc/stdio/getwchar.c,v 1.2 2002/09/28 07:43:44 tjr Exp $");
+__FBSDID("$FreeBSD: src/lib/libc/stdio/getwchar.c,v 1.3 2004/05/25 10:42:52 tjr Exp $");
+
+#include "xlocale_private.h"
 
 #include "namespace.h"
 #include <stdio.h>
@@ -34,6 +36,8 @@ __FBSDID("$FreeBSD: src/lib/libc/stdio/getwchar.c,v 1.2 2002/09/28 07:43:44 tjr
 #include "libc_private.h"
 #include "local.h"
 
+#undef getwchar
+
 /*
  * Synonym for fgetwc(stdin).
  */
@@ -41,5 +45,13 @@ wint_t
 getwchar(void)
 {
 
-       return (fgetwc(stdin));
+       return (fgetwc_l(stdin, __current_locale()));
+}
+
+wint_t
+getwchar_l(locale_t loc)
+{
+
+       /* no need to call NORMALIZE_LOCALE(loc) because fgetwc_l will */
+       return (fgetwc_l(stdin, loc));
 }