Peter S. Mazinger 18 年 前
コミット
25fbf2080e

+ 16 - 14
libc/stdio/_stdio.h

@@ -347,20 +347,20 @@ extern int __stdio_trans2w_o(FILE *__restrict stream, int oflag) attribute_hidde
 #endif /* __STDIO_BUFFERS */
 /**********************************************************************/
 
-extern int __fputs_unlocked(const char *__restrict s, FILE *__restrict stream);
+extern int __fputs_unlocked(const char *__restrict s, FILE *__restrict stream) attribute_hidden;
 
 extern int __putchar_unlocked(int c);
 
 
 extern size_t __fwrite_unlocked(const void *__restrict ptr, size_t size,
-								size_t nmemb, FILE *__restrict stream);
+						size_t nmemb, FILE *__restrict stream) attribute_hidden;
 
 extern size_t __fread_unlocked(void *__restrict ptr, size_t size,
-							   size_t nmemb, FILE *__restrict stream);
+						size_t nmemb, FILE *__restrict stream) attribute_hidden;
 
-extern int __fputc_unlocked(int c, FILE *stream);
+extern int __fputc_unlocked(int c, FILE *stream) attribute_hidden;
 
-extern int __fflush_unlocked(FILE *stream);
+extern int __fflush_unlocked(FILE *stream) attribute_hidden;
 
 extern int __stdio_adjust_position(FILE *__restrict stream, __offmax_t *pos) attribute_hidden;
 
@@ -368,17 +368,19 @@ extern void __clearerr_unlocked(FILE *stream);
 extern int __feof_unlocked(FILE *stream);
 extern int __ferror_unlocked(FILE *stream);
 
-extern int __fgetc_unlocked(FILE *stream);
+extern int __fgetc_unlocked(FILE *stream) attribute_hidden;
 extern char *__fgets_unlocked(char *__restrict s, int n,
-							  FILE * __restrict stream);
+					FILE * __restrict stream) attribute_hidden;
 
-extern int __fileno_unlocked(FILE *stream);
+extern int __fileno_unlocked(FILE *stream) attribute_hidden;
 
-extern int __getchar_unlocked(void);
+extern int __getchar_unlocked(void) attribute_hidden;
 
+extern int __fseek(FILE *stream, long int offset, int whence) attribute_hidden;
+extern long int __ftell(FILE *stream) attribute_hidden;
 #ifdef __UCLIBC_HAS_LFS__
-extern int __fseeko64(FILE *stream, __off64_t offset, int whence);
-extern __off64_t __ftello64(FILE *stream);
+extern int __fseeko64(FILE *stream, __off64_t offset, int whence) attribute_hidden;
+extern __off64_t __ftello64(FILE *stream) attribute_hidden;
 #endif
 
 #ifdef __STDIO_HAS_OPENLIST
@@ -420,10 +422,10 @@ extern FILE *_stdio_fopen(intptr_t fname_or_mode,
 
 #ifdef __UCLIBC_HAS_WCHAR__
 extern size_t _wstdio_fwrite(const wchar_t *__restrict ws, size_t n,
-							 FILE *__restrict stream);
+						 FILE *__restrict stream) attribute_hidden;
 
-extern wint_t __fgetwc_unlocked(register FILE *stream);
-extern wint_t __fputwc_unlocked(wchar_t wc, FILE *stream);
+extern wint_t __fgetwc_unlocked(register FILE *stream) attribute_hidden;
+extern wint_t __fputwc_unlocked(wchar_t wc, FILE *stream) attribute_hidden;
 #endif
 
 /**********************************************************************/

+ 1 - 1
libc/stdio/_wfwrite.c

@@ -19,7 +19,7 @@ extern size_t __wcsnrtombs(char *__restrict dst,
 						   const wchar_t **__restrict src,
 						   size_t NWC, size_t len, mbstate_t *__restrict ps);
 
-size_t _wstdio_fwrite(const wchar_t *__restrict ws, size_t n,
+size_t attribute_hidden _wstdio_fwrite(const wchar_t *__restrict ws, size_t n,
 					  register FILE *__restrict stream)
 {
 	size_t r, count;

+ 1 - 1
libc/stdio/fflush.c

@@ -31,7 +31,7 @@
 #endif
 
 
-int __fflush_unlocked(register FILE *stream)
+int attribute_hidden __fflush_unlocked(register FILE *stream)
 {
 #ifdef __STDIO_BUFFERS
 

+ 1 - 1
libc/stdio/fgetc.c

@@ -14,7 +14,7 @@
 
 #ifdef __DO_UNLOCKED
 
-int __fgetc_unlocked(FILE *stream)
+int attribute_hidden __fgetc_unlocked(FILE *stream)
 {
 	__STDIO_STREAM_VALIDATE(stream);
 

+ 6 - 2
libc/stdio/fgetpos.c

@@ -7,6 +7,10 @@
 
 #include "_stdio.h"
 
+#ifndef __DO_LARGEFILE
+#define FTELL __ftell
+#endif
+
 int fgetpos(FILE * __restrict stream, register fpos_t * __restrict pos)
 {
 #ifdef __STDIO_MBSTATE
@@ -16,7 +20,7 @@ int fgetpos(FILE * __restrict stream, register fpos_t * __restrict pos)
 
 	__STDIO_AUTO_THREADLOCK(stream);
 
-	if ((pos->__pos = ftell(stream)) >= 0) {
+	if ((pos->__pos = FTELL(stream)) >= 0) {
 		__COPY_MBSTATE(&(pos->__mbstate), &(stream->__state));
 		pos->__mblen_pending = stream->__ungot_width[0];
 		retval = 0;
@@ -28,7 +32,7 @@ int fgetpos(FILE * __restrict stream, register fpos_t * __restrict pos)
 
 #else
 
-	return ((pos->__pos = ftell(stream)) >= 0) ? 0 : -1;
+	return ((pos->__pos = FTELL(stream)) >= 0) ? 0 : -1;
 
 #endif
 }

+ 1 - 1
libc/stdio/fgetpos64.c

@@ -10,5 +10,5 @@
 #define __DO_LARGEFILE
 #define fgetpos	fgetpos64
 #define fpos_t		fpos64_t
-#define ftell		ftello64
+#define FTELL		__ftello64
 #include "fgetpos.c"

+ 1 - 1
libc/stdio/fgets.c

@@ -9,7 +9,7 @@
 
 #ifdef __DO_UNLOCKED
 
-char *__fgets_unlocked(char *__restrict s, int n,
+char attribute_hidden *__fgets_unlocked(char *__restrict s, int n,
 					   register FILE * __restrict stream)
 {
 	register char *p;

+ 1 - 1
libc/stdio/fgetwc.c

@@ -17,7 +17,7 @@ static void munge_stream(register FILE *stream, unsigned char *buf)
 	__STDIO_STREAM_DISABLE_PUTC(stream);
 }
 
-wint_t __fgetwc_unlocked(register FILE *stream)
+wint_t attribute_hidden __fgetwc_unlocked(register FILE *stream)
 {
 	wint_t wi;
 	wchar_t wc[1];

+ 2 - 2
libc/stdio/fgetws.c

@@ -8,11 +8,11 @@
 #include "_stdio.h"
 
 extern wchar_t *__fgetws_unlocked(wchar_t *__restrict ws, int n,
-								  FILE *__restrict stream);
+						FILE *__restrict stream) attribute_hidden;
 
 #ifdef __DO_UNLOCKED
 
-wchar_t *__fgetws_unlocked(wchar_t *__restrict ws, int n,
+wchar_t attribute_hidden *__fgetws_unlocked(wchar_t *__restrict ws, int n,
 						   FILE *__restrict stream)
 {
 	register wchar_t *p = ws;

+ 1 - 1
libc/stdio/fileno.c

@@ -9,7 +9,7 @@
 
 #ifdef __DO_UNLOCKED
 
-int __fileno_unlocked(register FILE *stream)
+int attribute_hidden __fileno_unlocked(register FILE *stream)
 {
 	__STDIO_STREAM_VALIDATE(stream);
 

+ 1 - 1
libc/stdio/fputc.c

@@ -14,7 +14,7 @@
 
 #ifdef __DO_UNLOCKED
 
-int __fputc_unlocked(int c, register FILE *stream)
+int attribute_hidden __fputc_unlocked(int c, register FILE *stream)
 {
 	__STDIO_STREAM_VALIDATE(stream);
 

+ 1 - 1
libc/stdio/fputs.c

@@ -14,7 +14,7 @@
 
 #ifdef __DO_UNLOCKED
 
-int __fputs_unlocked(register const char * __restrict s,
+int attribute_hidden __fputs_unlocked(register const char * __restrict s,
 					 FILE * __restrict stream)
 {
 	size_t n = strlen(s);

+ 1 - 1
libc/stdio/fputwc.c

@@ -9,7 +9,7 @@
 
 #ifdef __DO_UNLOCKED
 
-wint_t __fputwc_unlocked(wchar_t wc, FILE *stream)
+wint_t attribute_hidden __fputwc_unlocked(wchar_t wc, FILE *stream)
 {
 	return _wstdio_fwrite(&wc, 1, stream) ? wc : WEOF;
 }

+ 4 - 4
libc/stdio/fputws.c

@@ -8,11 +8,11 @@
 #include "_stdio.h"
 
 extern int __fputws_unlocked(const wchar_t *__restrict ws,
-							 FILE *__restrict stream);
+					FILE *__restrict stream) attribute_hidden;
 
 #ifdef __DO_UNLOCKED
 
-int __fputws_unlocked(const wchar_t *__restrict ws,
+int attribute_hidden __fputws_unlocked(const wchar_t *__restrict ws,
 					  register FILE *__restrict stream)
 {
 	size_t n = wcslen(ws);
@@ -20,9 +20,9 @@ int __fputws_unlocked(const wchar_t *__restrict ws,
 	return (_wstdio_fwrite(ws, n, stream) == n) ? 0 : -1;
 }
 
-weak_alias(__fputws_unlocked,fputws_unlocked);
+weak_alias(__fputws_unlocked,fputws_unlocked)
 #ifndef __UCLIBC_HAS_THREADS__
-weak_alias(__fputws_unlocked,fputws);
+weak_alias(__fputws_unlocked,fputws)
 #endif
 
 #elif defined __UCLIBC_HAS_THREADS__

+ 1 - 1
libc/stdio/fread.c

@@ -9,7 +9,7 @@
 
 #ifdef __DO_UNLOCKED
 
-size_t __fread_unlocked(void * __restrict ptr, size_t size, size_t nmemb,
+size_t attribute_hidden __fread_unlocked(void * __restrict ptr, size_t size, size_t nmemb,
 						FILE * __restrict stream)
 {
 	__STDIO_STREAM_VALIDATE(stream);

+ 5 - 4
libc/stdio/fseeko.c

@@ -12,11 +12,11 @@
 #endif
 
 #ifndef __DO_LARGEFILE
-# define FSEEK         fseek
+# define FSEEK         __fseek
 # define OFFSET_TYPE   long int
 #endif
 
-int FSEEK(register FILE *stream, OFFSET_TYPE offset, int whence)
+int attribute_hidden FSEEK(register FILE *stream, OFFSET_TYPE offset, int whence)
 {
 #if defined(__UCLIBC_HAS_LFS__) && !defined(__DO_LARGEFILE)
 
@@ -74,7 +74,8 @@ int FSEEK(register FILE *stream, OFFSET_TYPE offset, int whence)
 }
 
 #ifdef __DO_LARGEFILE
-weak_alias(__fseeko64,fseeko64);
+weak_alias(__fseeko64,fseeko64)
 #else
-weak_alias(fseek,fseeko);
+weak_alias(__fseek,fseek)
+weak_alias(fseek,fseeko)
 #endif

+ 5 - 4
libc/stdio/ftello.c

@@ -8,11 +8,11 @@
 #include "_stdio.h"
 
 #ifndef __DO_LARGEFILE
-# define FTELL         ftell
+# define FTELL         __ftell
 # define OFFSET_TYPE   long int
 #endif
 
-OFFSET_TYPE FTELL(register FILE *stream)
+OFFSET_TYPE attribute_hidden FTELL(register FILE *stream)
 {
 #if defined(__UCLIBC_HAS_LFS__) && !defined(__DO_LARGEFILE)
 
@@ -47,7 +47,8 @@ OFFSET_TYPE FTELL(register FILE *stream)
 }
 
 #ifdef __DO_LARGEFILE
-weak_alias(__ftello64,ftello64);
+weak_alias(__ftello64,ftello64)
 #else
-weak_alias(ftell,ftello);
+weak_alias(__ftell,ftell)
+weak_alias(ftell,ftello)
 #endif

+ 1 - 1
libc/stdio/fwrite.c

@@ -9,7 +9,7 @@
 
 #ifdef __DO_UNLOCKED
 
-size_t __fwrite_unlocked(const void * __restrict ptr, size_t size,
+size_t attribute_hidden __fwrite_unlocked(const void * __restrict ptr, size_t size,
 						 size_t nmemb, register FILE * __restrict stream)
 {
 	__STDIO_STREAM_VALIDATE(stream);

+ 1 - 1
libc/stdio/getchar.c

@@ -12,7 +12,7 @@
 
 #ifdef __DO_UNLOCKED
 
-int __getchar_unlocked(void)
+int attribute_hidden __getchar_unlocked(void)
 {
 	register FILE *stream = stdin;
 

+ 2 - 2
libc/stdio/scanf.c

@@ -1015,7 +1015,7 @@ static int sc_getc(register struct scan_cookie *sc)
 			sc->fp->__modeflags |= __FLAG_EOF;
 			return EOF;
 		}
-	} else if ((wc = fgetwc_unlocked(sc->fp)) == WEOF) {
+	} else if ((wc = __fgetwc_unlocked(sc->fp)) == WEOF) {
 		return EOF;
 	}
 
@@ -1061,7 +1061,7 @@ static int scan_getwc(register struct scan_cookie *sc)
 				sc->ungot_flag |= 2;
 				return -1;
 			}
-		} else if ((wc = fgetwc_unlocked(sc->fp)) == WEOF) {
+		} else if ((wc = __fgetwc_unlocked(sc->fp)) == WEOF) {
 			sc->ungot_flag |= 2;
 			return -1;
 		}