This is the mail archive of the libc-alpha@sourceware.org mailing list for the glibc project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [PATCH] Preserve ::is{inf,nan}{f,l} prototypes even for C++11 and later


On 01/02/16 17:21 +0100, Jakub Jelinek wrote:
The recent changes disable not just ::is{inf,nan} prototypes that are
incompatible with C++11 and later and that are defined in <cmath> or
libstdc++ <math.h> wrapper, but also the ::is{inf,nan}{f,l} prototypes,
that are not incompatible with C++11.  This patch adds them back.

N.B. I also posted Jakub's patch at
https://sourceware.org/ml/libc-alpha/2016-02/msg00020.html with some
more context. The patch is the same though, so you can ignroe my
duplicate.


---
math/bits/mathcalls.h | 8 ++++++--
1 file changed, 6 insertions(+), 2 deletions(-)

diff --git a/math/bits/mathcalls.h b/math/bits/mathcalls.h
index a48345d..1b82fcd 100644
--- a/math/bits/mathcalls.h
+++ b/math/bits/mathcalls.h
@@ -196,7 +196,9 @@ __MATHDECL_1 (int,__finite,, (_Mdouble_ __value)) __attribute__ ((__const__));
_Mdouble_END_NAMESPACE

#ifdef __USE_MISC
-# if !defined __cplusplus || __cplusplus < 201103L /* Conflicts with C++11.  */
+# if (!defined __cplusplus \
+      || __cplusplus < 201103L /* isinf conflicts with C++11.  */ \
+      || __MATH_DECLARING_DOUBLE == 0) /* isinff or isinfl don't.  */
/* Return 0 if VALUE is finite or NaN, +1 if it
   is +Infinity, -1 if it is -Infinity.  */
__MATHDECL_1 (int,isinf,, (_Mdouble_ __value)) __attribute__ ((__const__));
@@ -232,7 +234,9 @@ __END_NAMESPACE_C99
__MATHDECL_1 (int,__isnan,, (_Mdouble_ __value)) __attribute__ ((__const__));

#if defined __USE_MISC || (defined __USE_XOPEN && !defined __USE_XOPEN2K)
-# if !defined __cplusplus || __cplusplus < 201103L /* Conflicts with C++11.  */
+# if (!defined __cplusplus \
+      || __cplusplus < 201103L /* isinf conflicts with C++11.  */ \
+      || __MATH_DECLARING_DOUBLE == 0) /* isinff or isinfl don't.  */
/* Return nonzero if VALUE is not a number.  */
__MATHDECL_1 (int,isnan,, (_Mdouble_ __value)) __attribute__ ((__const__));
# endif
--
2.4.3



Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]