@@ -20,5 +20,54 @@
# error "Never include <bits/error-ldbl.h> directly; use <error.h> instead."
#endif
-__LDBL_REDIR_DECL (error)
-__LDBL_REDIR_DECL (error_at_line)
+
+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 ());
+}
@@ -567,6 +567,8 @@
# define __LDBL_REDIR(name, proto) ... unused__ldbl_redir
# define __LDBL_REDIR_DECL(name) \
extern __typeof (name) name __asm (__ASMNAME ("__" #name "ieee128"));
+# define __REDIRECT_LDBL(name, proto, alias) \
+ name proto __asm (__ASMNAME ("__" #alias "ieee128"))
/* Alias name defined automatically, with leading underscores. */
# define __LDBL_REDIR2_DECL(name) \
@@ -584,7 +586,6 @@
__LDBL_REDIR1_NTH (name, proto, __##alias##ieee128)
/* Unused. */
-# define __REDIRECT_LDBL(name, proto, alias) ... unused__redirect_ldbl
# define __LDBL_REDIR_NTH(name, proto) ... unused__ldbl_redir_nth
# else