Use _LDBL_EQ_DBL in nexttowardf.c

Message ID 37dc8c3b-3b39-00b8-0f6a-f3125b4196c7@mentor.com
State New
Headers show
Series
  • Use _LDBL_EQ_DBL in nexttowardf.c
Related show

Commit Message

Tom de Vries May 7, 2018, 9:39 a.m.
Hi,

quoting from here ( https://sourceware.org/ml/newlib/2014/msg00688.html ):
...
 > Drop the FORCE_EVAL macro, and wrap nexttowardf in _LDBL_EQ_DBL as 

per > Craig's suggestion.
...

Actually, the patch that Jon submitted there is the same as before, and 
is missing those changes.

The commit does contain those changes, except that it uses the 
non-existing macro _LDBL_EQ_DOUBLE instead of _LDBL_EQ_DBL.

This patch fixes that.

OK?

[ Found this by running into a link error "unresolved symbol 
nexttowardf" for gcc testcase gcc/testsuite/gcc.dg/nextafter-2.c using 
the standalone nvptx toolchain. ]

Thanks,
- Tom

Comments

Jeff Johnston May 7, 2018, 4:23 p.m. | #1
Patch applied.

-- Jeff J.

On Mon, May 7, 2018 at 5:39 AM, Tom de Vries <Tom_deVries@mentor.com> wrote:

> Hi,

>

> quoting from here ( https://sourceware.org/ml/newlib/2014/msg00688.html ):

> ...

> > Drop the FORCE_EVAL macro, and wrap nexttowardf in _LDBL_EQ_DBL as per >

> Craig's suggestion.

> ...

>

> Actually, the patch that Jon submitted there is the same as before, and is

> missing those changes.

>

> The commit does contain those changes, except that it uses the

> non-existing macro _LDBL_EQ_DOUBLE instead of _LDBL_EQ_DBL.

>

> This patch fixes that.

>

> OK?

>

> [ Found this by running into a link error "unresolved symbol nexttowardf"

> for gcc testcase gcc/testsuite/gcc.dg/nextafter-2.c using the standalone

> nvptx toolchain. ]

>

> Thanks,

> - Tom

>
Jon Roelofs May 9, 2018, 3:03 a.m. | #2
LGTM

Jon

On Mon, May 7, 2018 at 3:39 AM Tom de Vries <Tom_deVries@mentor.com> wrote:

> Hi,

>

> quoting from here ( https://sourceware.org/ml/newlib/2014/msg00688.html ):

> ...

>  > Drop the FORCE_EVAL macro, and wrap nexttowardf in _LDBL_EQ_DBL as

> per > Craig's suggestion.

> ...

>

> Actually, the patch that Jon submitted there is the same as before, and

> is missing those changes.

>

> The commit does contain those changes, except that it uses the

> non-existing macro _LDBL_EQ_DOUBLE instead of _LDBL_EQ_DBL.

>

> This patch fixes that.

>

> OK?

>

> [ Found this by running into a link error "unresolved symbol

> nexttowardf" for gcc testcase gcc/testsuite/gcc.dg/nextafter-2.c using

> the standalone nvptx toolchain. ]

>

> Thanks,

> - Tom

>

Patch

Use _LDBL_EQ_DBL in nexttowardf.c

2018-05-07  Tom de Vries  <tom@codesourcery.com>

	* libm/common/nexttowardf.c: Use _LDBL_EQ_DBL instead of
	_LDBL_EQ_DOUBLE.

---
 newlib/libm/common/nexttowardf.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/newlib/libm/common/nexttowardf.c b/newlib/libm/common/nexttowardf.c
index 6f47319..e2a1d90 100644
--- a/newlib/libm/common/nexttowardf.c
+++ b/newlib/libm/common/nexttowardf.c
@@ -33,7 +33,7 @@  union fshape {
 // This is only necessary because the implementation of isnan only works
 // properly when long double == double.
 // See: https://sourceware.org/ml/newlib/2014/msg00684.html
-#ifdef _LDBL_EQ_DOUBLE
+#ifdef _LDBL_EQ_DBL
 
 float
 nexttowardf (float x, long double y)
@@ -75,4 +75,4 @@  nexttowardf (float x, long double y)
   return ux.value;
 }
 
-#endif // _LDBL_EQ_DOUBLE
+#endif // _LDBL_EQ_DBL