summaryrefslogtreecommitdiff
path: root/libc/stdio/fgetc.c
diff options
context:
space:
mode:
Diffstat (limited to 'libc/stdio/fgetc.c')
-rw-r--r--libc/stdio/fgetc.c20
1 files changed, 9 insertions, 11 deletions
diff --git a/libc/stdio/fgetc.c b/libc/stdio/fgetc.c
index c672d9fe9..c68c1fdb5 100644
--- a/libc/stdio/fgetc.c
+++ b/libc/stdio/fgetc.c
@@ -12,17 +12,8 @@
#undef getc
#undef getc_unlocked
-extern int __fgetc_unlocked(FILE *stream);
-
#ifdef __DO_UNLOCKED
-weak_alias(__fgetc_unlocked,fgetc_unlocked);
-weak_alias(__fgetc_unlocked,getc_unlocked);
-#ifndef __UCLIBC_HAS_THREADS__
-weak_alias(__fgetc_unlocked,fgetc);
-weak_alias(__fgetc_unlocked,getc);
-#endif
-
int __fgetc_unlocked(FILE *stream)
{
__STDIO_STREAM_VALIDATE(stream);
@@ -78,9 +69,14 @@ int __fgetc_unlocked(FILE *stream)
return EOF;
}
-#elif defined __UCLIBC_HAS_THREADS__
+weak_alias(__fgetc_unlocked,fgetc_unlocked);
+weak_alias(__fgetc_unlocked,getc_unlocked);
+#ifndef __UCLIBC_HAS_THREADS__
+weak_alias(__fgetc_unlocked,fgetc);
+weak_alias(__fgetc_unlocked,getc);
+#endif
-weak_alias(fgetc,getc);
+#elif defined __UCLIBC_HAS_THREADS__
int fgetc(register FILE *stream)
{
@@ -95,4 +91,6 @@ int fgetc(register FILE *stream)
}
}
+weak_alias(fgetc,getc);
+
#endif