@@ -22,7 +22,7 @@ subdir := argp
include ../Makeconfig
-headers = argp.h
+headers = argp.h bits/argp-ldbl.h
routines = $(addprefix argp-, ba fmtstream fs-xinl help parse pv \
pvh xinl eexst)
@@ -554,6 +554,10 @@ __NTH (__option_is_end (const struct argp_option *__opt))
# endif
#endif /* Use extern inlines. */
+#ifdef __LDBL_COMPAT
+# include <bits/argp-ldbl.h>
+#endif
+
__END_DECLS
#endif /* argp.h */
new file mode 100644
@@ -0,0 +1,24 @@
+/* Redirections for argp functions for -mlong-double-64.
+ Copyright (C) 2018 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with the GNU C Library; if not, see
+ <http://www.gnu.org/licenses/>. */
+
+#ifndef _ARGP_H
+# error "Never include <bits/argp-ldbl.h> directly; use <argp.h> instead."
+#endif
+
+__LDBL_REDIR_DECL (argp_error)
+__LDBL_REDIR_DECL (argp_failure)
@@ -1,6 +1,17 @@
#ifndef _ARGP_H
#include <argp/argp.h>
+/* Prototypes for internal argp.h functions. */
+#include <stdarg.h>
+void
+__argp_error_internal (const struct argp_state *state, const char *fmt,
+ va_list ap, unsigned int mode_flags);
+
+void
+__argp_failure_internal (const struct argp_state *state, int status,
+ int errnum, const char *fmt, va_list ap,
+ unsigned int mode_flags);
+
#ifndef _ISOMAC
extern __typeof (__argp_error) __argp_error attribute_hidden;
extern __typeof (__argp_failure) __argp_failure attribute_hidden;
new file mode 100644
@@ -0,0 +1 @@
+#include <argp/bits/argp-ldbl.h>
@@ -78,6 +78,9 @@ libc {
__nldbl___dprintf_chk; __nldbl___vdprintf_chk;
__nldbl___obstack_printf_chk; __nldbl___obstack_vprintf_chk;
}
+ GLIBC_2.29 {
+ __nldbl_argp_error; __nldbl_argp_failure;
+ }
}
libm {
NLDBL_VERSION {
@@ -17,6 +17,7 @@
License along with the GNU C Library; if not, see
<http://www.gnu.org/licenses/>. */
+#include <argp.h>
#include <stdarg.h>
#include <stdio.h>
#include <libio/strfile.h>
@@ -985,6 +986,26 @@ __nldbl___isoc99_wscanf (const wchar_t *fmt, ...)
return ret;
}
+void
+__nldbl_argp_error (const struct argp_state *state, const char *fmt, ...)
+{
+ va_list ap;
+ va_start (ap, fmt);
+ __argp_error_internal (state, fmt, ap, PRINTF_LDBL_IS_DBL);
+ va_end (ap);
+}
+
+void
+__nldbl_argp_failure (const struct argp_state *state, int status,
+ int errnum, const char *fmt, ...)
+{
+ va_list ap;
+ va_start (ap, fmt);
+ __argp_failure_internal (state, status, errnum, fmt, ap,
+ PRINTF_LDBL_IS_DBL);
+ va_end (ap);
+}
+
#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);
@@ -26,6 +26,7 @@
/* Avoid long double prototypes. */
#define __NO_LONG_DOUBLE_MATH 1
+#include <argp.h>
#include <stdarg.h>
#include <stdlib.h>
#include <stdint.h>
@@ -76,6 +77,8 @@ NLDBL_DECL (__isoc99_swscanf);
NLDBL_DECL (__isoc99_vwscanf);
NLDBL_DECL (__isoc99_vfwscanf);
NLDBL_DECL (__isoc99_vswscanf);
+NLDBL_DECL (argp_error);
+NLDBL_DECL (argp_failure);
/* These do not exist in the normal interface, but must exist in the
__nldbl interface so that they can be called from libnldbl. */
@@ -2033,6 +2033,8 @@ GLIBC_2.28 thrd_current F
GLIBC_2.28 thrd_equal F
GLIBC_2.28 thrd_sleep F
GLIBC_2.28 thrd_yield F
+GLIBC_2.29 __nldbl_argp_error F
+GLIBC_2.29 __nldbl_argp_failure F
GLIBC_2.29 getcpu F
GLIBC_2.29 posix_spawn_file_actions_addchdir_np F
GLIBC_2.29 posix_spawn_file_actions_addfchdir_np F
@@ -1993,6 +1993,8 @@ GLIBC_2.28 thrd_current F
GLIBC_2.28 thrd_equal F
GLIBC_2.28 thrd_sleep F
GLIBC_2.28 thrd_yield F
+GLIBC_2.29 __nldbl_argp_error F
+GLIBC_2.29 __nldbl_argp_failure F
GLIBC_2.29 getcpu F
GLIBC_2.29 posix_spawn_file_actions_addchdir_np F
GLIBC_2.29 posix_spawn_file_actions_addfchdir_np F
@@ -1997,6 +1997,8 @@ GLIBC_2.28 thrd_current F
GLIBC_2.28 thrd_equal F
GLIBC_2.28 thrd_sleep F
GLIBC_2.28 thrd_yield F
+GLIBC_2.29 __nldbl_argp_error F
+GLIBC_2.29 __nldbl_argp_failure F
GLIBC_2.29 getcpu F
GLIBC_2.29 posix_spawn_file_actions_addchdir_np F
GLIBC_2.29 posix_spawn_file_actions_addfchdir_np F
@@ -123,6 +123,8 @@ GLIBC_2.28 thrd_current F
GLIBC_2.28 thrd_equal F
GLIBC_2.28 thrd_sleep F
GLIBC_2.28 thrd_yield F
+GLIBC_2.29 __nldbl_argp_error F
+GLIBC_2.29 __nldbl_argp_failure F
GLIBC_2.29 getcpu F
GLIBC_2.29 posix_spawn_file_actions_addchdir_np F
GLIBC_2.29 posix_spawn_file_actions_addfchdir_np F
@@ -2228,6 +2228,8 @@ GLIBC_2.28 thrd_current F
GLIBC_2.28 thrd_equal F
GLIBC_2.28 thrd_sleep F
GLIBC_2.28 thrd_yield F
+GLIBC_2.29 __nldbl_argp_error F
+GLIBC_2.29 __nldbl_argp_failure F
GLIBC_2.29 getcpu F
GLIBC_2.29 posix_spawn_file_actions_addchdir_np F
GLIBC_2.29 posix_spawn_file_actions_addfchdir_np F
@@ -2002,6 +2002,8 @@ GLIBC_2.28 thrd_current F
GLIBC_2.28 thrd_equal F
GLIBC_2.28 thrd_sleep F
GLIBC_2.28 thrd_yield F
+GLIBC_2.29 __nldbl_argp_error F
+GLIBC_2.29 __nldbl_argp_failure F
GLIBC_2.29 getcpu F
GLIBC_2.29 posix_spawn_file_actions_addchdir_np F
GLIBC_2.29 posix_spawn_file_actions_addfchdir_np F
@@ -1908,6 +1908,8 @@ GLIBC_2.28 thrd_equal F
GLIBC_2.28 thrd_sleep F
GLIBC_2.28 thrd_yield F
GLIBC_2.29 __fentry__ F
+GLIBC_2.29 __nldbl_argp_error F
+GLIBC_2.29 __nldbl_argp_failure F
GLIBC_2.29 getcpu F
GLIBC_2.29 posix_spawn_file_actions_addchdir_np F
GLIBC_2.29 posix_spawn_file_actions_addfchdir_np F
@@ -1996,6 +1996,8 @@ GLIBC_2.28 thrd_current F
GLIBC_2.28 thrd_equal F
GLIBC_2.28 thrd_sleep F
GLIBC_2.28 thrd_yield F
+GLIBC_2.29 __nldbl_argp_error F
+GLIBC_2.29 __nldbl_argp_failure F
GLIBC_2.29 getcpu F
GLIBC_2.29 posix_spawn_file_actions_addchdir_np F
GLIBC_2.29 posix_spawn_file_actions_addfchdir_np F