Browse Source

Get rid of warnings, use internals, create new hidden versions

Peter S. Mazinger 19 years ago
parent
commit
d482ef60da

+ 1 - 0
libc/stdio/_stdio.h

@@ -398,6 +398,7 @@ extern int __feof_unlocked(FILE *stream);
 extern int __ferror_unlocked(FILE *stream);
 
 extern int __fgetc_unlocked_internal(FILE *stream) attribute_hidden;
+extern int __getc_unlocked(FILE *stream) attribute_hidden;
 extern char *__fgets_unlocked(char *__restrict s, int n,
 					FILE * __restrict stream) attribute_hidden;
 

+ 5 - 3
libc/stdio/fgets.c

@@ -58,15 +58,16 @@ char attribute_hidden *__fgets_unlocked(char *__restrict s, int n,
 	return NULL;
 }
 
-weak_alias(__fgets_unlocked,fgets_unlocked);
+weak_alias(__fgets_unlocked,fgets_unlocked)
 
 #ifndef __UCLIBC_HAS_THREADS__
-weak_alias(__fgets_unlocked,fgets);
+hidden_strong_alias(__fgets_unlocked,__fgets)
+weak_alias(__fgets_unlocked,fgets)
 #endif
 
 #elif defined __UCLIBC_HAS_THREADS__
 
-char *fgets(char *__restrict s, int n,
+char attribute_hidden *__fgets(char *__restrict s, int n,
 			register FILE * __restrict stream)
 {
 	char *retval;
@@ -80,5 +81,6 @@ char *fgets(char *__restrict s, int n,
 
 	return retval;
 }
+strong_alias(__fgets,fgets)
 
 #endif

+ 8 - 7
libc/stdio/fgetwc.c

@@ -108,16 +108,17 @@ wint_t attribute_hidden __fgetwc_unlocked(register FILE *stream)
 	return wi;
 }
 
-weak_alias(__fgetwc_unlocked,fgetwc_unlocked);
-weak_alias(__fgetwc_unlocked,getwc_unlocked);
+weak_alias(__fgetwc_unlocked,fgetwc_unlocked)
+weak_alias(__fgetwc_unlocked,getwc_unlocked)
 #ifndef __UCLIBC_HAS_THREADS__
-weak_alias(__fgetwc_unlocked,fgetwc);
-weak_alias(__fgetwc_unlocked,getwc);
+hidden_strong_alias(__fgetwc_unlocked,__fgetwc)
+weak_alias(__fgetwc_unlocked,fgetwc)
+weak_alias(__fgetwc_unlocked,getwc)
 #endif
 
 #elif defined __UCLIBC_HAS_THREADS__
 
-wint_t fgetwc(register FILE *stream)
+wint_t attribute_hidden __fgetwc(register FILE *stream)
 {
 	wint_t retval;
 	__STDIO_AUTO_THREADLOCK_VAR;
@@ -130,7 +131,7 @@ wint_t fgetwc(register FILE *stream)
 
 	return retval;
 }
-
-weak_alias(fgetwc,getwc);
+strong_alias(__fgetwc,fgetwc)
+weak_alias(__fgetwc,getwc)
 
 #endif

+ 2 - 0
libc/stdio/fopen.c

@@ -9,8 +9,10 @@
 
 #ifndef __DO_LARGEFILE
 # define FILEDES_ARG    (-1)
+#undef __fopen
 #undef fopen
 #else
+#undef __fopen64
 #undef fopen64
 #endif
 

+ 1 - 0
libc/stdio/fopen64.c

@@ -9,6 +9,7 @@
 
 #define __DO_LARGEFILE
 #define __fopen       __fopen64
+#undef fopen
 #define fopen         fopen64
 #define FILEDES_ARG   (-2)
 #include "fopen.c"

+ 5 - 3
libc/stdio/fputs.c

@@ -22,14 +22,15 @@ int attribute_hidden __fputs_unlocked(register const char * __restrict s,
 	return ((__fwrite_unlocked(s, 1, n, stream) == n) ? n : EOF);
 }
 
-weak_alias(__fputs_unlocked,fputs_unlocked);
+weak_alias(__fputs_unlocked,fputs_unlocked)
 #ifndef __UCLIBC_HAS_THREADS__
-weak_alias(__fputs_unlocked,fputs);
+hidden_strong_alias(__fputs_unlocked,__fputs)
+weak_alias(__fputs_unlocked,fputs)
 #endif
 
 #elif defined __UCLIBC_HAS_THREADS__
 
-int fputs(const char * __restrict s, register FILE * __restrict stream)
+int attribute_hidden __fputs(const char * __restrict s, register FILE * __restrict stream)
 {
 	int retval;
 	__STDIO_AUTO_THREADLOCK_VAR;
@@ -42,5 +43,6 @@ int fputs(const char * __restrict s, register FILE * __restrict stream)
 
 	return retval;
 }
+strong_alias(__fputs,fputs)
 
 #endif

+ 6 - 4
libc/stdio/fputws.c

@@ -9,9 +9,6 @@
 
 #include "_stdio.h"
 
-extern int __fputws_unlocked(const wchar_t *__restrict ws,
-					FILE *__restrict stream) attribute_hidden;
-
 #ifdef __DO_UNLOCKED
 
 int attribute_hidden __fputws_unlocked(const wchar_t *__restrict ws,
@@ -24,12 +21,16 @@ int attribute_hidden __fputws_unlocked(const wchar_t *__restrict ws,
 
 weak_alias(__fputws_unlocked,fputws_unlocked)
 #ifndef __UCLIBC_HAS_THREADS__
+hidden_strong_alias(__fputws_unlocked,__fputws)
 weak_alias(__fputws_unlocked,fputws)
 #endif
 
 #elif defined __UCLIBC_HAS_THREADS__
 
-int fputws(const wchar_t *__restrict ws, register FILE *__restrict stream)
+extern int __fputws_unlocked(const wchar_t *__restrict ws,
+					FILE *__restrict stream) attribute_hidden;
+
+int attribute_hidden __fputws(const wchar_t *__restrict ws, register FILE *__restrict stream)
 {
 	int retval;
 	__STDIO_AUTO_THREADLOCK_VAR;
@@ -42,5 +43,6 @@ int fputws(const wchar_t *__restrict ws, register FILE *__restrict stream)
 
 	return retval;
 }
+strong_alias(__fputws,fputws)
 
 #endif

+ 5 - 3
libc/stdio/getwchar.c

@@ -14,16 +14,18 @@ wint_t __getwchar_unlocked(void)
 	return __fgetwc_unlocked(stdin);
 }
 
-weak_alias(__getwchar_unlocked,getwchar_unlocked);
+weak_alias(__getwchar_unlocked,getwchar_unlocked)
 #ifndef __UCLIBC_HAS_THREADS__
-weak_alias(__getwchar_unlocked,getwchar);
+weak_alias(__getwchar_unlocked,getwchar)
 #endif
 
 #elif defined __UCLIBC_HAS_THREADS__
 
+extern wint_t __fgetwc (__FILE *__stream) attribute_hidden;
+
 wint_t getwchar(void)
 {
-	return fgetwc(stdin);
+	return __fgetwc(stdin);
 }
 
 #endif

+ 2 - 2
libc/stdio/old_vfprintf.c

@@ -166,7 +166,7 @@
 
 #ifdef __STDIO_BUFFERS
 
-#define PUTC(C,F)      putc_unlocked((C),(F))
+#define PUTC(C,F)      __putc_unlocked((C),(F))
 #define OUTNSTR        _outnstr
 #define _outnstr(stream, string, len)	__stdio_fwrite(string, len, stream)
 
@@ -199,7 +199,7 @@ static void _outnstr(FILE *stream, const unsigned char *s, size_t n)
 static void putc_unlocked_sprintf(int c, __FILE_vsnprintf *f)
 {
 	if (!__STDIO_STREAM_IS_FAKE_VSNPRINTF_NB(&f->f)) {
-		putc_unlocked(c, &f->f);
+		__putc_unlocked(c, &f->f);
 	} else if (f->bufpos < f->bufend) {
 		*f->bufpos++ = c;
 	}

+ 3 - 1
libc/stdio/popen.c

@@ -19,6 +19,8 @@
 #define dup2 __dup2
 #define fdopen __fdopen
 #define pipe __pipe
+#define vfork __vfork
+#define fork __fork
 
 #include <stdio.h>
 #include <stdlib.h>
@@ -109,7 +111,7 @@ FILE *popen(const char *command, const char *modes)
 
 		/* SUSv3 mandates an exit code of 127 for the child if the
 		 * command interpreter can not be invoked. */
-		_exit(127);
+		_exit_internal(127);
 	}
 	VFORK_UNLOCK;
 

+ 3 - 1
libc/stdio/putwchar.c

@@ -21,9 +21,11 @@ weak_alias(__putwchar_unlocked,putwchar);
 
 #elif defined __UCLIBC_HAS_THREADS__
 
+extern int __fputc (int __c, FILE *__stream) attribute_hidden;
+
 wint_t putwchar(wchar_t wc)
 {
-	return fputc(wc, stdout);
+	return __fputc(wc, stdout);
 }
 
 #endif

+ 2 - 2
libc/stdio/scanf.c

@@ -595,7 +595,7 @@ typedef unsigned char __uchar_t;
 #ifdef __UCLIBC_HAS_WCHAR__
 #define GETC(SC) (SC)->sc_getc((SC))
 #else  /* __UCLIBC_HAS_WCHAR__ */
-#define GETC(SC) getc_unlocked((SC)->fp)
+#define GETC(SC) __getc_unlocked((SC)->fp)
 #endif /* __UCLIBC_HAS_WCHAR__ */
 #endif
 
@@ -959,7 +959,7 @@ int attribute_hidden __psfs_parse_spec(register psfs_t *psfs)
 #ifdef L_vfscanf
 static int sc_getc(register struct scan_cookie *sc)
 {
-	return (getc_unlocked)(sc->fp);	/* Disable the macro. */
+	return (__getc_unlocked)(sc->fp);	/* Disable the macro. */
 }
 
 static int scan_getwc(register struct scan_cookie *sc)

+ 1 - 0
libc/stdio/vfprintf.c

@@ -95,6 +95,7 @@
 #define mbsrtowcs __mbsrtowcs
 #define btowc __btowc
 #define wcrtomb __wcrtomb
+#define fputws __fputws
 
 #define _ISOC99_SOURCE			/* for ULLONG primarily... */
 #define _GNU_SOURCE