From 1b0a9ef1769a7fca36340f1df67f917d7f3e6456 Mon Sep 17 00:00:00 2001
From: ghazi <ghazi@138bc75d-0d04-0410-961f-82ee72b054a4>
Date: Wed, 20 Feb 2008 04:20:59 +0000
Subject: 	* inclhack.def (solaris_math_10): New. 	*
 tests/base/iso/math_c99.h: Update.

	* fixincl.x: Regenerate.



git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@132468 138bc75d-0d04-0410-961f-82ee72b054a4
---
 fixincludes/inclhack.def | 24 ++++++++++++++++++++++++
 1 file changed, 24 insertions(+)

(limited to 'fixincludes/inclhack.def')

diff --git a/fixincludes/inclhack.def b/fixincludes/inclhack.def
index fd8a694a9f7..e7447d497ae 100644
--- a/fixincludes/inclhack.def
+++ b/fixincludes/inclhack.def
@@ -3222,6 +3222,30 @@ fix = {
     "#define	isunordered(x, y)	((x) __builtin_isunordered(y))";
 };
 
+/*
+ * On Solaris 11, if you do isinf(NaN) you'll get a floating point
+ * exception.  Provide an alternative using GCC's builtin.
+ */
+
+fix = {
+    hackname  = solaris_math_10;
+    select    = '@\(#\)math_c99.h' "[ \t]+1.[0-9]+[ \t]+[0-9/]+ SMI";
+    files     = iso/math_c99.h;
+    c_fix     = format;
+    c_fix_arg = "#define\tisinf(x) __builtin_isinf(x)";
+    c_fix_arg = "^#define[ \t]+isinf\\(x\\)[ \t]+__extension__\\([ \t]*\\\\\n"
+                "[ \t]*\\{[ \t]*__typeof\\(x\\)[ \t]*__x_i[ \t]*=[ \t]*\\(x\\);[ \t]*\\\\\n"
+                "[ \t]*__x_i[ \t]*==[ \t]*\\(__typeof\\(__x_i\\)\\)[ \t]*INFINITY[ \t]*\\|\\|[ \t]*\\\\\n"
+                "[ \t]*__x_i[ \t]*==[ \t]*\\(__typeof\\(__x_i\\)\\)[ \t]*\\(-INFINITY\\);[ \t]*\\}\\)";
+    test_text =
+    '#pragma ident	"@(#)math_c99.h	1.12	07/01/21 SMI"'"\n"
+    "#undef	isinf\n"
+    "#define	isinf(x)	__extension__( \\\\\n"
+    "			{ __typeof(x) __x_i = (x); \\\\\n"
+    "			__x_i == (__typeof(__x_i)) INFINITY || \\\\\n"
+    "			__x_i == (__typeof(__x_i)) (-INFINITY); })";
+};
+
 /*
  *  Sun Solaris 2.5.1, 2.6 defines PTHREAD_{MUTEX|COND}_INITIALIZER
  *  incorrectly, so we replace them with versions that correspond to
-- 
cgit v1.2.1

