1
0
mirror of https://sourceware.org/git/glibc.git synced 2025-08-08 17:42:12 +03:00

ldbl-opt: Add argp_error and argp_failure (bug 23983)

The functions argp_error and argp_failure are missing support for
printing long double values when long double has the same format as
double.  This patch adds the new functions __nldbl_argp_error and
__nldbl_argp_failure, as well as header magic to redirect calls to them
when -mlong-double-64 is in use.

Tested for powerpc, powerpc64 and powerpc64le.
This commit is contained in:
Gabriel F. T. Gomes
2018-07-04 11:54:11 -03:00
parent c259196b50
commit 6e1f6440b9
17 changed files with 112 additions and 1 deletions

View File

@@ -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)

View File

@@ -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 */

24
argp/bits/argp-ldbl.h Normal file
View File

@@ -0,0 +1,24 @@
/* Redirections for argp functions for -mlong-double-64.
Copyright (C) 2019 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)