From af0172162f7c653cad6a11ed1c1a5459bc154465 Mon Sep 17 00:00:00 2001 From: "Peter S. Mazinger" Date: Sat, 14 Jan 2006 00:58:03 +0000 Subject: hidden_def/hidden_proto: convert all users (I hope) termios split, add some missing headers, other jump relocs removed --- libc/misc/error/err.c | 48 +++++++++++++++++++++++++++++------------------- libc/misc/error/error.c | 24 ++++++++++++++---------- 2 files changed, 43 insertions(+), 29 deletions(-) (limited to 'libc/misc/error') diff --git a/libc/misc/error/err.c b/libc/misc/error/err.c index 43fe60cc6..f27a5e7e8 100644 --- a/libc/misc/error/err.c +++ b/libc/misc/error/err.c @@ -5,8 +5,6 @@ * Dedicated to Toni. See uClibc/DEDICATION.mjn3 for details. */ -#define vfprintf __vfprintf - #define _GNU_SOURCE #include #include @@ -22,6 +20,18 @@ #warning REMINDER: Deal with wide oriented stderr case. #endif +libc_hidden_proto(vwarn) +libc_hidden_proto(vwarnx) +libc_hidden_proto(err) +libc_hidden_proto(verr) +libc_hidden_proto(verrx) + +libc_hidden_proto(fprintf) +libc_hidden_proto(vfprintf) +libc_hidden_proto(__xpg_strerror_r) +libc_hidden_proto(exit) +libc_hidden_proto(vfprintf) + static void vwarn_work(const char *format, va_list args, int showerr) { /* 0123 45678 9 a b*/ @@ -34,7 +44,7 @@ static void vwarn_work(const char *format, va_list args, int showerr) f = fmt + 11; /* At 11. */ if (showerr) { f -= 4; /* At 7. */ - __xpg_strerror_r_internal(errno, buf, sizeof(buf)); + __xpg_strerror_r(errno, buf, sizeof(buf)); } __STDIO_AUTO_THREADLOCK(stderr); @@ -49,68 +59,68 @@ static void vwarn_work(const char *format, va_list args, int showerr) __STDIO_AUTO_THREADUNLOCK(stderr); } -void attribute_hidden __vwarn(const char *format, va_list args) +void vwarn(const char *format, va_list args) { vwarn_work(format, args, 1); } -strong_alias(__vwarn,vwarn) +libc_hidden_def(vwarn) void warn(const char *format, ...) { va_list args; va_start(args, format); - __vwarn(format, args); + vwarn(format, args); va_end(args); } -void attribute_hidden __vwarnx(const char *format, va_list args) +void vwarnx(const char *format, va_list args) { vwarn_work(format, args, 0); } -strong_alias(__vwarnx,vwarnx) +libc_hidden_def(vwarnx) void warnx(const char *format, ...) { va_list args; va_start(args, format); - __vwarnx(format, args); + vwarnx(format, args); va_end(args); } -void attribute_hidden __verr(int status, const char *format, va_list args) +void verr(int status, const char *format, va_list args) { - __vwarn(format, args); - __exit(status); + vwarn(format, args); + exit(status); } -strong_alias(__verr,verr) +libc_hidden_def(verr) void attribute_noreturn err(int status, const char *format, ...) { va_list args; va_start(args, format); - __verr(status, format, args); + verr(status, format, args); /* This should get optimized away. We'll leave it now for safety. */ /* The loop is added only to keep gcc happy. */ while(1) va_end(args); } -void attribute_hidden __verrx(int status, const char *format, va_list args) +void verrx(int status, const char *format, va_list args) { - __vwarnx(format, args); - __exit(status); + vwarnx(format, args); + exit(status); } -strong_alias(__verrx,verrx) +libc_hidden_def(verrx) void attribute_noreturn errx(int status, const char *format, ...) { va_list args; va_start(args, format); - __verrx(status, format, args); + verrx(status, format, args); /* This should get optimized away. We'll leave it now for safety. */ /* The loop is added only to keep gcc happy. */ while(1) diff --git a/libc/misc/error/error.c b/libc/misc/error/error.c index 60605c212..1c2585345 100644 --- a/libc/misc/error/error.c +++ b/libc/misc/error/error.c @@ -22,17 +22,21 @@ /* Written by David MacKenzie . */ /* Adjusted slightly by Erik Andersen */ -#define strerror __strerror -#define vfprintf __vfprintf -#define fflush __fflush - #include #include #include #include #include "error.h" -extern int __putc(int c, FILE *stream) attribute_hidden; +libc_hidden_proto(strcmp) +libc_hidden_proto(strerror) +libc_hidden_proto(fprintf) +libc_hidden_proto(exit) +libc_hidden_proto(putc) +libc_hidden_proto(vfprintf) +libc_hidden_proto(fflush) +libc_hidden_proto(fputc) +libc_hidden_proto(__fputc_unlocked) /* This variable is incremented each time `error' is called. */ unsigned int error_message_count = 0; @@ -59,9 +63,9 @@ void __error (int status, int errnum, const char *message, ...) if (errnum) { fprintf (stderr, ": %s", strerror (errnum)); } - __putc ('\n', stderr); + putc ('\n', stderr); if (status) - __exit (status); + exit (status); } void __error_at_line (int status, int errnum, const char *file_name, @@ -74,7 +78,7 @@ void __error_at_line (int status, int errnum, const char *file_name, static unsigned int old_line_number; if (old_line_number == line_number && - (file_name == old_file_name || !__strcmp (old_file_name, file_name))) + (file_name == old_file_name || !strcmp (old_file_name, file_name))) /* Simply return and print nothing. */ return; @@ -95,9 +99,9 @@ void __error_at_line (int status, int errnum, const char *file_name, if (errnum) { fprintf (stderr, ": %s", strerror (errnum)); } - __putc ('\n', stderr); + putc ('\n', stderr); if (status) - __exit (status); + exit (status); } /* Use the weaks here in an effort at controlling namespace pollution */ -- cgit v1.2.3