From 6e1f6440b99d74db314a9f1a1b27c050ef62a45c Mon Sep 17 00:00:00 2001 From: "Gabriel F. T. Gomes" Date: Wed, 4 Jul 2018 11:54:11 -0300 Subject: 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. --- argp/Makefile | 2 +- argp/argp.h | 4 ++++ argp/bits/argp-ldbl.h | 24 ++++++++++++++++++++++++ 3 files changed, 29 insertions(+), 1 deletion(-) create mode 100644 argp/bits/argp-ldbl.h (limited to 'argp') diff --git a/argp/Makefile b/argp/Makefile index bebd71c564..d5c2d77658 100644 --- a/argp/Makefile +++ b/argp/Makefile @@ -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) diff --git a/argp/argp.h b/argp/argp.h index fae6dfb3ef..c7322581bf 100644 --- a/argp/argp.h +++ b/argp/argp.h @@ -554,6 +554,10 @@ __NTH (__option_is_end (const struct argp_option *__opt)) # endif #endif /* Use extern inlines. */ +#ifdef __LDBL_COMPAT +# include +#endif + __END_DECLS #endif /* argp.h */ diff --git a/argp/bits/argp-ldbl.h b/argp/bits/argp-ldbl.h new file mode 100644 index 0000000000..86022a04ac --- /dev/null +++ b/argp/bits/argp-ldbl.h @@ -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 + . */ + +#ifndef _ARGP_H +# error "Never include directly; use instead." +#endif + +__LDBL_REDIR_DECL (argp_error) +__LDBL_REDIR_DECL (argp_failure) -- cgit 1.4.1