about summary refs log tree commit diff
path: root/sysdeps/ieee754/ldbl-opt/nldbl-compat.c
diff options
context:
space:
mode:
Diffstat (limited to 'sysdeps/ieee754/ldbl-opt/nldbl-compat.c')
-rw-r--r--sysdeps/ieee754/ldbl-opt/nldbl-compat.c61
1 files changed, 61 insertions, 0 deletions
diff --git a/sysdeps/ieee754/ldbl-opt/nldbl-compat.c b/sysdeps/ieee754/ldbl-opt/nldbl-compat.c
index 4f70207f2d..6883814d58 100644
--- a/sysdeps/ieee754/ldbl-opt/nldbl-compat.c
+++ b/sysdeps/ieee754/ldbl-opt/nldbl-compat.c
@@ -23,6 +23,7 @@
 #define __GLIBC_USE_DEPRECATED_SCANF 1
 
 #include <argp.h>
+#include <err.h>
 #include <stdarg.h>
 #include <stdio.h>
 #include <libio/strfile.h>
@@ -1011,6 +1012,66 @@ __nldbl_argp_failure (const struct argp_state *state, int status,
   va_end (ap);
 }
 
+#define VA_CALL(call)							\
+{									\
+  va_list ap;								\
+  va_start (ap, format);						\
+  call (format, ap, PRINTF_LDBL_IS_DBL);				\
+  va_end (ap);								\
+}
+
+void
+__nldbl_err (int status, const char *format, ...)
+{
+  VA_CALL (__vwarn_internal)
+  exit (status);
+}
+
+void
+__nldbl_errx (int status, const char *format, ...)
+{
+  VA_CALL (__vwarnx_internal)
+  exit (status);
+}
+
+void
+__nldbl_verr (int status, const char *format, __gnuc_va_list ap)
+{
+  __vwarn_internal (format, ap, PRINTF_LDBL_IS_DBL);
+  exit (status);
+}
+
+void
+__nldbl_verrx (int status, const char *format, __gnuc_va_list ap)
+{
+  __vwarnx_internal (format, ap, PRINTF_LDBL_IS_DBL);
+  exit (status);
+}
+
+void
+__nldbl_warn (const char *format, ...)
+{
+  VA_CALL (__vwarn_internal)
+}
+
+void
+__nldbl_warnx (const char *format, ...)
+{
+  VA_CALL (__vwarnx_internal)
+}
+
+void
+__nldbl_vwarn (const char *format, __gnuc_va_list ap)
+{
+  __vwarn_internal (format, ap, PRINTF_LDBL_IS_DBL);
+}
+
+void
+__nldbl_vwarnx (const char *format, __gnuc_va_list ap)
+{
+  __vwarnx_internal (format, ap, PRINTF_LDBL_IS_DBL);
+}
+
 #if LONG_DOUBLE_COMPAT(libc, GLIBC_2_0)
 compat_symbol (libc, __nldbl__IO_printf, _IO_printf, GLIBC_2_0);
 compat_symbol (libc, __nldbl__IO_sprintf, _IO_sprintf, GLIBC_2_0);