mirror of
https://sourceware.org/git/glibc.git
synced 2025-08-08 17:42:12 +03:00
Added Redirects to longdouble error functions [BZ #29033]
This patch redirects the error functions to the appropriate longdouble variants which enables the compiler to optimize for the abi ieeelongdouble. Signed-off-by: Sachin Monga <smonga@linux.ibm.com>
This commit is contained in:
committed by
Rajalakshmi Srinivasaraghavan
parent
f0dbe112f5
commit
1a57ab0c92
@@ -20,5 +20,50 @@
|
||||
# error "Never include <bits/error-ldbl.h> directly; use <error.h> instead."
|
||||
#endif
|
||||
|
||||
#if defined __extern_always_inline && defined __va_arg_pack
|
||||
extern void __REDIRECT_LDBL (__error_alias, (int __status, int __errnum,
|
||||
const char *__format, ...), error)
|
||||
__attribute__ ((__format__ (__printf__, 3, 4)));
|
||||
extern void __REDIRECT_LDBL (__error_noreturn, (int __status, int __errnum,
|
||||
const char *__format, ...), error)
|
||||
__attribute__ ((__noreturn__, __format__ (__printf__, 3, 4)));
|
||||
|
||||
|
||||
/* If we know the function will never return make sure the compiler
|
||||
realizes that, too. */
|
||||
__extern_always_inline void
|
||||
error (int __status, int __errnum, const char *__format, ...)
|
||||
{
|
||||
if (__builtin_constant_p (__status) && __status != 0)
|
||||
__error_noreturn (__status, __errnum, __format, __va_arg_pack ());
|
||||
else
|
||||
__error_alias (__status, __errnum, __format, __va_arg_pack ());
|
||||
}
|
||||
|
||||
|
||||
extern void __REDIRECT_LDBL (__error_at_line_alias, (int __status, int __errnum,
|
||||
const char *__fname, unsigned int __line,
|
||||
const char *__format, ...), error_at_line)
|
||||
__attribute__ ((__format__ (__printf__, 5, 6)));
|
||||
extern void __REDIRECT_LDBL (__error_at_line_noreturn, (int __status, int __errnum,
|
||||
const char *__fname, unsigned int __line,
|
||||
const char *__format, ...), error_at_line)
|
||||
__attribute__ ((__noreturn__, __format__ (__printf__, 5, 6)));
|
||||
|
||||
|
||||
/* If we know the function will never return make sure the compiler
|
||||
realizes that, too. */
|
||||
__extern_always_inline void
|
||||
error_at_line (int __status, int __errnum, const char *__fname,
|
||||
unsigned int __line, const char *__format, ...)
|
||||
{
|
||||
if (__builtin_constant_p (__status) && __status != 0)
|
||||
__error_at_line_noreturn (__status, __errnum, __fname, __line, __format,
|
||||
__va_arg_pack ());
|
||||
else
|
||||
__error_at_line_alias (__status, __errnum, __fname, __line,
|
||||
__format, __va_arg_pack ());
|
||||
}
|
||||
#endif
|
||||
__LDBL_REDIR_DECL (error)
|
||||
__LDBL_REDIR_DECL (error_at_line)
|
||||
|
Reference in New Issue
Block a user