diff lib/math.in.h @ 9645:c8174371956e

Exploit the __builtin_signbit GCC built-in.
author Bruno Haible <bruno@clisp.org>
date Sat, 26 Jan 2008 02:26:52 +0100
parents 4a3319c82e39
children 7f3ed6b093be
line wrap: on
line diff
--- a/lib/math.in.h
+++ b/lib/math.in.h
@@ -353,6 +353,14 @@
 
 
 #if @GNULIB_SIGNBIT@
+# if @REPLACE_SIGNBIT_USING_GCC@
+#  undef signbit
+   /* GCC 4.0 and newer provides three built-ins for signbit.  */
+#  define signbit(x) \
+   (sizeof (x) == sizeof (long double) ? __builtin_signbitl (x) : \
+    sizeof (x) == sizeof (double) ? __builtin_signbit (x) : \
+    __builtin_signbitf (x))
+# endif
 # if @REPLACE_SIGNBIT@
 #  undef signbit
 extern int gl_signbitf (float arg);