summaryrefslogtreecommitdiff
path: root/fixincludes
diff options
context:
space:
mode:
authorghazi <ghazi@138bc75d-0d04-0410-961f-82ee72b054a4>2008-02-20 04:20:59 +0000
committerghazi <ghazi@138bc75d-0d04-0410-961f-82ee72b054a4>2008-02-20 04:20:59 +0000
commit1b0a9ef1769a7fca36340f1df67f917d7f3e6456 (patch)
treebca251aea4e82b3a8827eaa7b41fff22abb82ee8 /fixincludes
parente297899b22f48347baae758a753bd6d08efef1ec (diff)
downloadgcc-1b0a9ef1769a7fca36340f1df67f917d7f3e6456.tar.gz
* 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
Diffstat (limited to 'fixincludes')
-rw-r--r--fixincludes/ChangeLog7
-rw-r--r--fixincludes/fixincl.x76
-rw-r--r--fixincludes/inclhack.def24
-rw-r--r--fixincludes/tests/base/iso/math_c99.h7
4 files changed, 101 insertions, 13 deletions
diff --git a/fixincludes/ChangeLog b/fixincludes/ChangeLog
index 7a8c78a99cd..c241666d047 100644
--- a/fixincludes/ChangeLog
+++ b/fixincludes/ChangeLog
@@ -1,3 +1,10 @@
+2008-02-19 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
+
+ * inclhack.def (solaris_math_10): New.
+ * tests/base/iso/math_c99.h: Update.
+
+ * fixincl.x: Regenerate.
+
2008-02-04 Ismail Dönmez <ismail@pardus.org.tr>
* inclhack.def: (bsd_stdio_attrs_conflict, freebsd_gcc3_breakage,
diff --git a/fixincludes/fixincl.x b/fixincludes/fixincl.x
index f6602004e62..9da75308834 100644
--- a/fixincludes/fixincl.x
+++ b/fixincludes/fixincl.x
@@ -2,11 +2,11 @@
*
* DO NOT EDIT THIS FILE (fixincl.x)
*
- * It has been AutoGen-ed Monday February 4, 2008 at 09:22:58 PM GMTST
+ * It has been AutoGen-ed Wednesday February 20, 2008 at 05:10:00 AM CET
* From the definitions inclhack.def
* and the template file fixincl
*/
-/* DO NOT SVN-MERGE THIS FILE, EITHER Mon Feb 4 21:22:58 GMTST 2008
+/* DO NOT SVN-MERGE THIS FILE, EITHER Wed Feb 20 05:10:00 CET 2008
*
* You must regenerate it. Use the ./genfixes script.
*
@@ -15,25 +15,30 @@
* certain ANSI-incompatible system header files which are fixed to work
* correctly with ANSI C and placed in a directory that GNU C will search.
*
- * This file contains 211 fixup descriptions.
+ * This file contains 212 fixup descriptions.
*
* See README for more information.
*
* inclhack copyright (c) 1998, 1999, 2000, 2001
* The Free Software Foundation, Inc.
*
- * inclhack is free software: you can redistribute it and/or modify it
- * under the terms of the GNU General Public License as published by the
- * Free Software Foundation, either version 3 of the License, or
- * (at your option) any later version.
+ * inclhack is free software.
*
- * inclhack is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
+ * You may redistribute it and/or modify it under the terms of the
+ * GNU General Public License, as published by the Free Software
+ * Foundation; either version 2 of the License, or (at your option)
+ * any later version.
+ *
+ * inclhack is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
* See the GNU General Public License for more details.
*
- * You should have received a copy of the GNU General Public License along
- * with this program. If not, see <http://www.gnu.org/licenses/>.
+ * You should have received a copy of the GNU General Public License
+ * along with inclhack. If not, write to:
+ * The Free Software Foundation, Inc.,
+ * 51 Franklin Street, Fifth Floor
+ * Boston, MA 02110-1301, USA.
*/
/* * * * * * * * * * * * * * * * * * * * * * * * * *
@@ -5886,6 +5891,45 @@ static const char* apzSolaris_Math_9Patch[] = {
/* * * * * * * * * * * * * * * * * * * * * * * * * *
*
+ * Description of Solaris_Math_10 fix
+ */
+tSCC zSolaris_Math_10Name[] =
+ "solaris_math_10";
+
+/*
+ * File name selection pattern
+ */
+tSCC zSolaris_Math_10List[] =
+ "iso/math_c99.h\0";
+/*
+ * Machine/OS name selection pattern
+ */
+#define apzSolaris_Math_10Machs (const char**)NULL
+
+/*
+ * content selection pattern - do fix if pattern found
+ */
+tSCC zSolaris_Math_10Select0[] =
+ "@\\(#\\)math_c99.h[ \t]+1.[0-9]+[ \t]+[0-9/]+ SMI";
+
+#define SOLARIS_MATH_10_TEST_CT 1
+static tTestDesc aSolaris_Math_10Tests[] = {
+ { TT_EGREP, zSolaris_Math_10Select0, (regex_t*)NULL }, };
+
+/*
+ * Fix Command Arguments for Solaris_Math_10
+ */
+static const char* apzSolaris_Math_10Patch[] = {
+ "format",
+ "#define\tisinf(x) __builtin_isinf(x)",
+ "^#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]*\\}\\)",
+ (char*)NULL };
+
+/* * * * * * * * * * * * * * * * * * * * * * * * * *
+ *
* Description of Solaris_Mutex_Init_1 fix
*/
tSCC zSolaris_Mutex_Init_1Name[] =
@@ -8567,9 +8611,9 @@ static const char* apzX11_SprintfPatch[] = {
*
* List of all fixes
*/
-#define REGEX_COUNT 254
+#define REGEX_COUNT 255
#define MACH_LIST_SIZE_LIMIT 261
-#define FIX_COUNT 211
+#define FIX_COUNT 212
/*
* Enumerate the fixes
@@ -8718,6 +8762,7 @@ typedef enum {
SOLARIS_MATH_4_FIXIDX,
SOLARIS_MATH_8_FIXIDX,
SOLARIS_MATH_9_FIXIDX,
+ SOLARIS_MATH_10_FIXIDX,
SOLARIS_MUTEX_INIT_1_FIXIDX,
SOLARIS_MUTEX_INIT_2_FIXIDX,
SOLARIS_RWLOCK_INIT_1_FIXIDX,
@@ -9504,6 +9549,11 @@ tFixDesc fixDescList[ FIX_COUNT ] = {
SOLARIS_MATH_9_TEST_CT, FD_MACH_ONLY | FD_SUBROUTINE,
aSolaris_Math_9Tests, apzSolaris_Math_9Patch, 0 },
+ { zSolaris_Math_10Name, zSolaris_Math_10List,
+ apzSolaris_Math_10Machs,
+ SOLARIS_MATH_10_TEST_CT, FD_MACH_ONLY | FD_SUBROUTINE,
+ aSolaris_Math_10Tests, apzSolaris_Math_10Patch, 0 },
+
{ zSolaris_Mutex_Init_1Name, zSolaris_Mutex_Init_1List,
apzSolaris_Mutex_Init_1Machs,
SOLARIS_MUTEX_INIT_1_TEST_CT, FD_MACH_ONLY,
diff --git a/fixincludes/inclhack.def b/fixincludes/inclhack.def
index fd8a694a9f7..e7447d497ae 100644
--- a/fixincludes/inclhack.def
+++ b/fixincludes/inclhack.def
@@ -3223,6 +3223,30 @@ fix = {
};
/*
+ * 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
* the definition. We also explicitly name this fix "1" and the next
diff --git a/fixincludes/tests/base/iso/math_c99.h b/fixincludes/tests/base/iso/math_c99.h
index e87ca874276..e3b27994422 100644
--- a/fixincludes/tests/base/iso/math_c99.h
+++ b/fixincludes/tests/base/iso/math_c99.h
@@ -77,3 +77,10 @@
#undef isunordered
#define isunordered(x, y) __builtin_isunordered(x, y)
#endif /* SOLARIS_MATH_9_CHECK */
+
+
+#if defined( SOLARIS_MATH_10_CHECK )
+#pragma ident "@(#)math_c99.h 1.12 07/01/21 SMI"
+#undef isinf
+#define isinf(x) __builtin_isinf(x)
+#endif /* SOLARIS_MATH_10_CHECK */