Преглед на файлове

Hide some of the f* *printf, use them as well

Peter S. Mazinger преди 20 години
родител
ревизия
e385ba0d0d

+ 2 - 0
libc/stdio/_fopen.c

@@ -5,6 +5,8 @@
  * Dedicated to Toni.  See uClibc/DEDICATION.mjn3 for details.
  */
 
+#define isatty __isatty
+
 #include "_stdio.h"
 
 /*

+ 2 - 0
libc/stdio/_stdio.c

@@ -5,6 +5,8 @@
  * Dedicated to Toni.  See uClibc/DEDICATION.mjn3 for details.
  */
 
+#define isatty __isatty
+
 #include "_stdio.h"
 
 /* This is pretty much straight from uClibc, but with one important

+ 4 - 2
libc/stdio/asprintf.c

@@ -5,6 +5,8 @@
  * Dedicated to Toni.  See uClibc/DEDICATION.mjn3 for details.
  */
 
+#define vasprintf __vasprintf
+
 #include "_stdio.h"
 #include <stdarg.h>
 
@@ -12,7 +14,7 @@
 #warning Skipping asprintf and __asprintf since no vsnprintf!
 #else
 
-int __asprintf(char **__restrict buf, const char * __restrict format, ...)
+int attribute_hidden __asprintf(char **__restrict buf, const char * __restrict format, ...)
 {
 	va_list arg;
 	int rv;
@@ -24,6 +26,6 @@ int __asprintf(char **__restrict buf, const char * __restrict format, ...)
 	return rv;
 }
 
-weak_alias(__asprintf,asprintf)
+strong_alias(__asprintf,asprintf)
 
 #endif

+ 2 - 0
libc/stdio/dprintf.c

@@ -5,6 +5,8 @@
  * Dedicated to Toni.  See uClibc/DEDICATION.mjn3 for details.
  */
 
+#define vdprintf __vdprintf
+
 #include "_stdio.h"
 #include <stdarg.h>
 

+ 2 - 1
libc/stdio/fdopen.c

@@ -7,7 +7,7 @@
 
 #include "_stdio.h"
 
-FILE *fdopen(int filedes, const char *mode)
+FILE attribute_hidden *__fdopen(int filedes, const char *mode)
 {
 	intptr_t cur_mode;
 
@@ -15,3 +15,4 @@ FILE *fdopen(int filedes, const char *mode)
 		? _stdio_fopen(cur_mode, mode, NULL, filedes) 
 		: NULL;
 }
+strong_alias(__fdopen,fdopen)

+ 3 - 2
libc/stdio/fileno.c

@@ -23,12 +23,13 @@ int attribute_hidden __fileno_unlocked(register FILE *stream)
 
 weak_alias(__fileno_unlocked,fileno_unlocked);
 #ifndef __UCLIBC_HAS_THREADS__
+hidden_weak_alias(__fileno_unlocked,__fileno);
 weak_alias(__fileno_unlocked,fileno);
 #endif
 
 #elif defined __UCLIBC_HAS_THREADS__
 
-int fileno(register FILE *stream)
+int attribute_hidden __fileno(register FILE *stream)
 {
 	int retval;
 	__STDIO_AUTO_THREADLOCK_VAR;
@@ -41,5 +42,5 @@ int fileno(register FILE *stream)
 
 	return retval;
 }
-
+strong_alias(__fileno,fileno)
 #endif

+ 2 - 0
libc/stdio/fmemopen.c

@@ -5,6 +5,8 @@
  * Dedicated to Toni.  See uClibc/DEDICATION.mjn3 for details.
  */
 
+#define fopencookie __fopencookie
+
 #include "_stdio.h"
 
 #ifndef __UCLIBC_HAS_GLIBC_CUSTOM_STREAMS__

+ 4 - 1
libc/stdio/fopencookie.c

@@ -28,7 +28,7 @@
 /* Currently no real reentrancy issues other than a possible double close(). */
 
 #ifndef __BCC__
-FILE *fopencookie(void * __restrict cookie, const char * __restrict mode,
+FILE attribute_hidden *__fopencookie(void * __restrict cookie, const char * __restrict mode,
 				  cookie_io_functions_t io_functions)
 #else
 FILE *_fopencookie(void * __restrict cookie, const char * __restrict mode,
@@ -57,3 +57,6 @@ FILE *_fopencookie(void * __restrict cookie, const char * __restrict mode,
 
 	return stream;
 }
+#ifndef __BCC__
+strong_alias(__fopencookie,fopencookie)
+#endif

+ 2 - 0
libc/stdio/open_memstream.c

@@ -5,6 +5,8 @@
  * Dedicated to Toni.  See uClibc/DEDICATION.mjn3 for details.
  */
 
+#define fopencookie __fopencookie
+
 #include "_stdio.h"
 
 #ifndef __UCLIBC_HAS_GLIBC_CUSTOM_STREAMS__

+ 1 - 0
libc/stdio/popen.c

@@ -17,6 +17,7 @@
 #define waitpid __waitpid
 #define execl __execl
 #define dup2 __dup2
+#define fdopen __fdopen
 
 #include <stdio.h>
 #include <stdlib.h>

+ 3 - 0
libc/stdio/remove.c

@@ -5,6 +5,9 @@
  * Dedicated to Toni.  See uClibc/DEDICATION.mjn3 for details.
  */
 
+#define rmdir __rmdir
+#define unlink __unlink
+
 #include "_stdio.h"
 
 #include <unistd.h>

+ 2 - 0
libc/stdio/swprintf.c

@@ -5,6 +5,8 @@
  * Dedicated to Toni.  See uClibc/DEDICATION.mjn3 for details.
  */
 
+#define vswprintf __vswprintf
+
 #include "_stdio.h"
 #include <stdarg.h>
 #include <wchar.h>

+ 2 - 0
libc/stdio/tmpfile.c

@@ -16,6 +16,8 @@
    write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
    Boston, MA 02111-1307, USA.  */
 
+#define fdopen __fdopen
+
 #include <features.h>
 #include <stdio.h>
 #include <unistd.h>

+ 2 - 1
libc/stdio/vasprintf.c

@@ -20,7 +20,7 @@
 #warning Skipping vasprintf since no vsnprintf!
 #else
 
-int vasprintf(char **__restrict buf, const char * __restrict format,
+int attribute_hidden __vasprintf(char **__restrict buf, const char * __restrict format,
 			 va_list arg)
 {
 #ifdef __UCLIBC_HAS_GLIBC_CUSTOM_STREAMS__
@@ -73,6 +73,7 @@ int vasprintf(char **__restrict buf, const char * __restrict format,
 	return rv;
 
 #endif /* __UCLIBC_HAS_GLIBC_CUSTOM_STREAMS__ */
+strong_alias(__vasprintf,vasprintf)
 }
 
 #endif

+ 2 - 1
libc/stdio/vdprintf.c

@@ -8,7 +8,7 @@
 #include "_stdio.h"
 #include <stdarg.h>
 
-int vdprintf(int filedes, const char * __restrict format, va_list arg)
+int attribute_hidden __vdprintf(int filedes, const char * __restrict format, va_list arg)
 {
 	FILE f;
 	int rv;
@@ -60,3 +60,4 @@ int vdprintf(int filedes, const char * __restrict format, va_list arg)
 
 	return rv;
 }
+strong_alias(__vdprintf,vdprintf)

+ 2 - 1
libc/stdio/vswprintf.c

@@ -13,7 +13,7 @@
 #warning Skipping vswprintf since no buffering!
 #else  /* __STDIO_BUFFERS */
 
-int vswprintf(wchar_t *__restrict buf, size_t size,
+int attribute_hidden __vswprintf(wchar_t *__restrict buf, size_t size,
 			  const wchar_t * __restrict format, va_list arg)
 {
 	FILE f;
@@ -66,5 +66,6 @@ int vswprintf(wchar_t *__restrict buf, size_t size,
 	}
 	return rv;
 }
+strong_alias(__vswprintf,vswprintf)
 
 #endif /* __STDIO_BUFFERS */