2008-10-24 Joseph Myers <joseph@codesourcery.com>
authorUlrich Drepper <drepper@redhat.com>
Sat, 1 Nov 2008 02:28:57 +0000 (02:28 +0000)
committerUlrich Drepper <drepper@redhat.com>
Sat, 1 Nov 2008 02:28:57 +0000 (02:28 +0000)
    Ulrich Drepper  <drepper@redhat.com>

* math/tgmath.h (__floating_type): Use __builtin_classify_type in
definition for GCC 3.1 and later.

ChangeLog
math/tgmath.h

index e590178..bfd6957 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+2008-10-24  Joseph Myers  <joseph@codesourcery.com>
+           Ulrich Drepper  <drepper@redhat.com>
+
+       * math/tgmath.h (__floating_type): Use __builtin_classify_type in
+       definition for GCC 3.1 and later.
+               
 2008-10-31  Jakub Jelinek  <jakub@redhat.com>
 
        * elf/dl-tls.c (__tls_get_addr): After calling _dl_update_slotinfo
index 4f45aaa..eefdd26 100644 (file)
 
 /* 1 if 'type' is a floating type, 0 if 'type' is an integer type.
    Allows for _Bool.  Expands to an integer constant expression.  */
-# define __floating_type(type) (((type) 0.25) && ((type) 0.25 - 1))
+# if __GNUC_PREREQ (3, 1)
+#  define __floating_type(type) \
+  (__builtin_classify_type ((type) 0) == 8 \
+   || (__builtin_classify_type ((type) 0) == 9 \
+       && __builtin_classify_type (__real__ ((type) 0)) == 8))
+# else
+#  define __floating_type(type) (((type) 0.25) && ((type) 0.25 - 1))
+# endif
 
 /* The tgmath real type for T, where E is 0 if T is an integer type and
    1 for a floating type.  */