diff options
author | Ulrich Drepper <drepper@redhat.com> | 2005-10-15 00:39:12 +0000 |
---|---|---|
committer | Ulrich Drepper <drepper@redhat.com> | 2005-10-15 00:39:12 +0000 |
commit | 34b0ba283020a5a9cc25b4a3657cb162e9bc57c2 (patch) | |
tree | 6c4c1d5ef4851f9bb7443e595a2981cf0353fa28 /math/tgmath.h | |
parent | 504417ac9745bc83124f6719fd7c784c41d7924a (diff) | |
download | glibc-34b0ba283020a5a9cc25b4a3657cb162e9bc57c2.tar.gz glibc-34b0ba283020a5a9cc25b4a3657cb162e9bc57c2.tar.xz glibc-34b0ba283020a5a9cc25b4a3657cb162e9bc57c2.zip |
[BZ #865]
* math/tgmath.h: Correctly determine result type for __TGMATH_BINARY_REAL_ONLY, __TGMATH_TERNARY_FIRST_SECOND_REAL_ONLY, __TGMATH_TERNARY_REAL_ONLY, and __TGMATH_BINARY_REAL_IMAG. 2005-09-17 Andreas Jaeger <aj@suse.de> [BZ #865] * math/test-tgmath-int.c: New file. * math/Makefile (tests): Add test-tgmath-int. 2005-10-14 Ulrich Drepper <drepper@redhat.com>
Diffstat (limited to 'math/tgmath.h')
-rw-r--r-- | math/tgmath.h | 15 |
1 files changed, 10 insertions, 5 deletions
diff --git a/math/tgmath.h b/math/tgmath.h index ab2cc929ad..f3d23f6e52 100644 --- a/math/tgmath.h +++ b/math/tgmath.h @@ -1,4 +1,4 @@ -/* Copyright (C) 1997, 1998, 1999, 2000, 2001, 2003, 2004 +/* Copyright (C) 1997, 1998, 1999, 2000, 2001, 2003, 2004, 2005 Free Software Foundation, Inc. This file is part of the GNU C Library. @@ -98,7 +98,8 @@ __tgmres; })) # define __TGMATH_BINARY_REAL_ONLY(Val1, Val2, Fct) \ - (__extension__ ({ __tgmath_real_type ((Val1) + (Val2)) __tgmres; \ + (__extension__ ({ __typeof((__tgmath_real_type (Val1)) 0 \ + + (__tgmath_real_type (Val2)) 0) __tgmres; \ if ((sizeof (Val1) > sizeof (double) \ || sizeof (Val2) > sizeof (double)) \ && __builtin_classify_type ((Val1) + (Val2)) == 8) \ @@ -113,7 +114,8 @@ __tgmres; })) # define __TGMATH_TERNARY_FIRST_SECOND_REAL_ONLY(Val1, Val2, Val3, Fct) \ - (__extension__ ({ __tgmath_real_type ((Val1) + (Val2)) __tgmres; \ + (__extension__ ({ __typeof((__tgmath_real_type (Val1)) 0 \ + + (__tgmath_real_type (Val2)) 0) __tgmres; \ if ((sizeof (Val1) > sizeof (double) \ || sizeof (Val2) > sizeof (double)) \ && __builtin_classify_type ((Val1) + (Val2)) == 8) \ @@ -128,7 +130,9 @@ __tgmres; })) # define __TGMATH_TERNARY_REAL_ONLY(Val1, Val2, Val3, Fct) \ - (__extension__ ({ __tgmath_real_type ((Val1) + (Val2) + (Val3)) __tgmres;\ + (__extension__ ({ __typeof((__tgmath_real_type (Val1)) 0 \ + + (__tgmath_real_type (Val2)) 0 \ + + (__tgmath_real_type (Val3)) 0) __tgmres; \ if ((sizeof (Val1) > sizeof (double) \ || sizeof (Val2) > sizeof (double) \ || sizeof (Val3) > sizeof (double)) \ @@ -209,7 +213,8 @@ /* XXX This definition has to be changed as soon as the compiler understands the imaginary keyword. */ # define __TGMATH_BINARY_REAL_IMAG(Val1, Val2, Fct, Cfct) \ - (__extension__ ({ __tgmath_real_type ((Val1) + (Val2)) __tgmres; \ + (__extension__ ({ __typeof((__tgmath_real_type (Val1)) 0 \ + + (__tgmath_real_type (Val2)) 0) __tgmres; \ if ((sizeof (__real__ (Val1)) > sizeof (double) \ || sizeof (__real__ (Val2)) > sizeof (double)) \ && __builtin_classify_type (__real__ (Val1) \ |