diff mbox

PR c++/69462: Provide FLT_EVAL_METHOD and DECIMAL_DIG in float.h.

Message ID 20160128124012.GA19249@linux.vnet.ibm.com
State New
Headers show

Commit Message

Dominik Vogt Jan. 28, 2016, 12:40 p.m. UTC
The attached patch (written by Jonathan, not me) makes
FLT_EVAL_METHOD and DECIMAL_DIG available in C++-11 as they should
be.

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=69462

Can this be committed (should it wait for stage1)?

Ciao

Dominik ^_^  ^_^

Comments

Jakub Jelinek Jan. 28, 2016, 2:41 p.m. UTC | #1
On Thu, Jan 28, 2016 at 01:40:12PM +0100, Dominik Vogt wrote:
> 	PR c++/69462
> 	* ginclude/float.h: Also provide FLT_EVAL_METHOD and DECIMAL_DIG for
> 	C++-11.

> >From 3b74be3a03105d608609f35b33bcf2ba43c0b5b9 Mon Sep 17 00:00:00 2001
> From: Dominik Vogt <vogt@linux.vnet.ibm.com>
> Date: Mon, 25 Jan 2016 11:59:06 +0100
> Subject: [PATCH] PR c++/69462: Provide FLT_EVAL_METHOD and
>  DECIMAL_DIG in float.h.
> 
> ---
>  gcc/ginclude/float.h | 3 ++-
>  1 file changed, 2 insertions(+), 1 deletion(-)
> 
> diff --git a/gcc/ginclude/float.h b/gcc/ginclude/float.h
> index 18f5aac..100e88a 100644
> --- a/gcc/ginclude/float.h
> +++ b/gcc/ginclude/float.h
> @@ -127,7 +127,8 @@ see the files COPYING3 and COPYING.RUNTIME respectively.  If not, see
>  #undef FLT_ROUNDS
>  #define FLT_ROUNDS 1
>  
> -#if defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L
> +#if (defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L) \
> +	|| (defined (__cplusplus) && __cplusplus >= 201103L)

The formatting is wrong, there is a tab before || when it should be aligned
below defined on the previous line.
Ok for trunk with that change.

	Jakub
diff mbox

Patch

From 3b74be3a03105d608609f35b33bcf2ba43c0b5b9 Mon Sep 17 00:00:00 2001
From: Dominik Vogt <vogt@linux.vnet.ibm.com>
Date: Mon, 25 Jan 2016 11:59:06 +0100
Subject: [PATCH] PR c++/69462: Provide FLT_EVAL_METHOD and
 DECIMAL_DIG in float.h.

---
 gcc/ginclude/float.h | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/gcc/ginclude/float.h b/gcc/ginclude/float.h
index 18f5aac..100e88a 100644
--- a/gcc/ginclude/float.h
+++ b/gcc/ginclude/float.h
@@ -127,7 +127,8 @@  see the files COPYING3 and COPYING.RUNTIME respectively.  If not, see
 #undef FLT_ROUNDS
 #define FLT_ROUNDS 1
 
-#if defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L
+#if (defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L) \
+	|| (defined (__cplusplus) && __cplusplus >= 201103L)
 /* The floating-point expression evaluation method.
         -1  indeterminate
          0  evaluate all operations and constants just to the range and
-- 
2.3.0