about summary refs log tree commit diff
path: root/math/tgmath.h
diff options
context:
space:
mode:
authorUlrich Drepper <drepper@redhat.com>2008-11-01 02:28:57 +0000
committerUlrich Drepper <drepper@redhat.com>2008-11-01 02:28:57 +0000
commitacd44dbc7a0e6001406eb9e46eecab3ae34d9966 (patch)
tree8ee36c5c78e8e58489707450eebfdc3a52a2530f /math/tgmath.h
parentbf837fa36ff39d077b09ce592b1c4c38592586c1 (diff)
downloadglibc-acd44dbc7a0e6001406eb9e46eecab3ae34d9966.tar.gz
glibc-acd44dbc7a0e6001406eb9e46eecab3ae34d9966.tar.xz
glibc-acd44dbc7a0e6001406eb9e46eecab3ae34d9966.zip
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.
		
Diffstat (limited to 'math/tgmath.h')
-rw-r--r--math/tgmath.h9
1 files changed, 8 insertions, 1 deletions
diff --git a/math/tgmath.h b/math/tgmath.h
index 4f45aaa0f2..eefdd26c9c 100644
--- a/math/tgmath.h
+++ b/math/tgmath.h
@@ -48,7 +48,14 @@
 
 /* 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.  */