Update.
authorUlrich Drepper <drepper@redhat.com>
Mon, 3 Mar 2003 19:41:03 +0000 (19:41 +0000)
committerUlrich Drepper <drepper@redhat.com>
Mon, 3 Mar 2003 19:41:03 +0000 (19:41 +0000)
2003-03-03  Andreas Jaeger  <aj@suse.de>

* math/tgmath.h (__TGMATH_UNARY_REAL_RET_ONLY): New definition.
(llrint): Use it to correct return type.
(lrint): Likewise.
(lround): Likewise.
(llround): Likewise.

* po/gl.po: Likewise.

ChangeLog
math/tgmath.h

index 7fe9b19..b4269a2 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,11 @@
+2003-03-03  Andreas Jaeger  <aj@suse.de>
+
+       * math/tgmath.h (__TGMATH_UNARY_REAL_RET_ONLY): New definition.
+       (llrint): Use it to correct return type.
+       (lrint): Likewise.
+       (lround): Likewise.
+       (llround): Likewise.
+
 2003-03-03  Ulrich Drepper  <drepper@redhat.com>
 
        * elf/dl-load.c (struct filebuf): For 64-bit platforms use 640
@@ -27,6 +35,7 @@
 
        * po/es.po: Update from translation team.
        * po/fr.po: Likewise.
+       * po/gl.po: Likewise.
        * po/sk.po: Likewise.
        * po/sv.po: Likewise.
 
index 5fb683f..8b75cb5 100644 (file)
@@ -1,4 +1,4 @@
-/* Copyright (C) 1997, 1998, 1999, 2000, 2001 Free Software Foundation, Inc.
+/* Copyright (C) 1997, 1998, 1999, 2000, 2001, 2003 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
                         __tgmres = Fct (Val);                                \
                       else if (sizeof (Val) == sizeof (float))               \
                         __tgmres = Fct##f (Val);                             \
-                      else                                                   \
+                      else                                                   \
+                        __tgmres = __tgml(Fct) (Val);                        \
+                      __tgmres; }))
+
+# define __TGMATH_UNARY_REAL_RET_ONLY(Val, RetType, Fct) \
+     (__extension__ ({ RetType __tgmres;                                     \
+                      if (sizeof (Val) == sizeof (double)                    \
+                          || __builtin_classify_type (Val) != 8)             \
+                        __tgmres = Fct (Val);                                \
+                      else if (sizeof (Val) == sizeof (float))               \
+                        __tgmres = Fct##f (Val);                             \
+                      else                                                   \
                         __tgmres = __tgml(Fct) (Val);                        \
                       __tgmres; }))
 
@@ -81,7 +92,7 @@
                         __tgmres = Fct (Val1, Val2);                         \
                       else if (sizeof (Val1) == sizeof (float))              \
                         __tgmres = Fct##f (Val1, Val2);                      \
-                      else                                                   \
+                      else                                                   \
                         __tgmres = __tgml(Fct) (Val1, Val2);                 \
                       __tgmres; }))
 
                           else                                               \
                             __tgmres = Cfct (Val);                           \
                         }                                                    \
-                      else                                                   \
+                      else                                                   \
                         {                                                    \
                           if (sizeof (__real__ (Val)) == sizeof (Val))       \
                             __tgmres = Fct##f (Val);                         \
                         __tgmres = Fct (Val);                                \
                       else if (sizeof (Val) == sizeof (__complex__ float))   \
                         __tgmres = Fct##f (Val);                             \
-                      else                                                   \
+                      else                                                   \
                         __tgmres = __tgml(Fct) (Val);                        \
                       __tgmres; }))
 
 
 /* Round X to nearest integral value according to current rounding
    direction.  */
-#define lrint(Val) __TGMATH_UNARY_REAL_ONLY (Val, lrint)
-#define llrint(Val) __TGMATH_UNARY_REAL_ONLY (Val, llrint)
+#define lrint(Val) __TGMATH_UNARY_REAL_RET_ONLY (Val, long int, lrint)
+#define llrint(Val) __TGMATH_UNARY_REAL_RET_ONLY (Val, long long int, llrint)
 
 /* Round X to nearest integral value, rounding halfway cases away from
    zero.  */
-#define lround(Val) __TGMATH_UNARY_REAL_ONLY (Val, lround)
-#define llround(Val) __TGMATH_UNARY_REAL_ONLY (Val, llround)
+#define lround(Val) __TGMATH_UNARY_REAL_RET_ONLY (Val, long int, lround)
+#define llround(Val) __TGMATH_UNARY_REAL_RET_ONLY (Val, long long int, llround)
 
 
 /* Return X with its signed changed to Y's.  */