Commit bf73f6d2 by Andrew Pinski Committed by Andrew Pinski

re PR target/15642 (NAN Is Not a Constant Because __APPLE_CC__ is Not Defined (OK in Apple 3.3.0))

2006-01-19  Andrew Pinski  <pinskia@physics.uc.edu>

        PR target/15642
        * inclhack.def (AAB_darwin7_9_long_double_funcs [replace]): Define
        __APPLE_CC_ as 1345.
        (broken_nan): New.
        * fixincl.x: Regenerate.

From-SVN: r109973
parent 786872fd
2006-01-19 Andrew Pinski <pinskia@physics.uc.edu>
PR target/15642
* inclhack.def (AAB_darwin7_9_long_double_funcs [replace]): Define
__APPLE_CC_ as 1345.
(broken_nan): New.
* fixincl.x: Regenerate.
2005-11-24 Bruce Korb <bkorb@gnu.org> 2005-11-24 Bruce Korb <bkorb@gnu.org>
* fixincl.c(write_replacement) "here strings" in AutoGen often/generally * fixincl.c(write_replacement) "here strings" in AutoGen often/generally
......
...@@ -2,11 +2,11 @@ ...@@ -2,11 +2,11 @@
* *
* DO NOT EDIT THIS FILE (fixincl.x) * DO NOT EDIT THIS FILE (fixincl.x)
* *
* It has been AutoGen-ed Thursday November 24, 2005 at 09:46:46 PM PST * It has been AutoGen-ed Thursday January 19, 2006 at 12:17:28 PM EST
* From the definitions inclhack.def * From the definitions inclhack.def
* and the template file fixincl * and the template file fixincl
*/ */
/* DO NOT CVS-MERGE THIS FILE, EITHER Thu Nov 24 21:46:46 PST 2005 /* DO NOT CVS-MERGE THIS FILE, EITHER Thu Jan 19 12:17:28 EST 2006
* *
* You must regenerate it. Use the ./genfixes script. * You must regenerate it. Use the ./genfixes script.
* *
...@@ -15,7 +15,7 @@ ...@@ -15,7 +15,7 @@
* certain ANSI-incompatible system header files which are fixed to work * 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. * correctly with ANSI C and placed in a directory that GNU C will search.
* *
* This file contains 193 fixup descriptions. * This file contains 194 fixup descriptions.
* *
* See README for more information. * See README for more information.
* *
...@@ -26,8 +26,7 @@ ...@@ -26,8 +26,7 @@
* *
* You may redistribute it and/or modify it under the terms of the * You may redistribute it and/or modify it under the terms of the
* GNU General Public License, as published by the Free Software * GNU General Public License, as published by the Free Software
* Foundation; either version 2 of the License, or (at your option) * Foundation; either version 2, or (at your option) any later version.
* any later version.
* *
* inclhack is distributed in the hope that it will be useful, * inclhack is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of * but WITHOUT ANY WARRANTY; without even the implied warranty of
...@@ -35,10 +34,10 @@ ...@@ -35,10 +34,10 @@
* See the GNU General Public License for more details. * See the GNU General Public License for more details.
* *
* You should have received a copy of the GNU General Public License * You should have received a copy of the GNU General Public License
* along with inclhack. If not, write to: * along with inclhack. See the file "COPYING". If not,
* The Free Software Foundation, Inc., * write to: The Free Software Foundation, Inc.,
* 51 Franklin Street, Fifth Floor * 59 Temple Place - Suite 330,
* Boston, MA 02110-1301, USA. * Boston, MA 02111-1307, USA.
*/ */
/* * * * * * * * * * * * * * * * * * * * * * * * * * /* * * * * * * * * * * * * * * * * * * * * * * * * *
...@@ -77,7 +76,11 @@ static const char* apzAab_Darwin7_9_Long_Double_FuncsPatch[] = { ...@@ -77,7 +76,11 @@ static const char* apzAab_Darwin7_9_Long_Double_FuncsPatch[] = {
"/* This file prototypes the long double functions available on Mac OS\n\ "/* This file prototypes the long double functions available on Mac OS\n\
10.3.9. */\n\ 10.3.9. */\n\
#ifndef __MATH__\n\ #ifndef __MATH__\n\
# undef __APPLE_CC__\n\
# define __APPLE_CC__ 1345\n\
# include_next <architecture/ppc/math.h>\n\ # include_next <architecture/ppc/math.h>\n\
# undef __APPLE_CC__\n\
# define __APPLE_CC__ 1\n\
# ifndef __LIBMLDBL_COMPAT\n\ # ifndef __LIBMLDBL_COMPAT\n\
# ifdef __LONG_DOUBLE_128__\n\ # ifdef __LONG_DOUBLE_128__\n\
# define __LIBMLDBL_COMPAT(sym) __asm(\"_\" #sym \"$LDBL128\")\n\ # define __LIBMLDBL_COMPAT(sym) __asm(\"_\" #sym \"$LDBL128\")\n\
...@@ -1677,6 +1680,48 @@ static const char* apzBroken_CabsPatch[] = { ...@@ -1677,6 +1680,48 @@ static const char* apzBroken_CabsPatch[] = {
/* * * * * * * * * * * * * * * * * * * * * * * * * * /* * * * * * * * * * * * * * * * * * * * * * * * * *
* *
* Description of Broken_Nan fix
*/
tSCC zBroken_NanName[] =
"broken_nan";
/*
* File name selection pattern
*/
tSCC zBroken_NanList[] =
"|architecture/ppc/math.h|architecture/i386/math.h|";
/*
* Machine/OS name selection pattern
*/
#define apzBroken_NanMachs (const char**)NULL
/*
* content selection pattern - do fix if pattern found
*/
tSCC zBroken_NanSelect0[] =
"#if defined(__APPLE_CC__) && (__APPLE_CC__ >= 1345)";
/*
* content bypass pattern - skip fix if pattern found
*/
tSCC zBroken_NanBypass0[] =
"powl";
#define BROKEN_NAN_TEST_CT 2
static tTestDesc aBroken_NanTests[] = {
{ TT_NEGREP, zBroken_NanBypass0, (regex_t*)NULL },
{ TT_EGREP, zBroken_NanSelect0, (regex_t*)NULL }, };
/*
* Fix Command Arguments for Broken_Nan
*/
static const char* apzBroken_NanPatch[] = {
"format",
"#if 1",
(char*)NULL };
/* * * * * * * * * * * * * * * * * * * * * * * * * *
*
* Description of Bsd_Stdio_Attrs_Conflict fix * Description of Bsd_Stdio_Attrs_Conflict fix
*/ */
tSCC zBsd_Stdio_Attrs_ConflictName[] = tSCC zBsd_Stdio_Attrs_ConflictName[] =
...@@ -7849,9 +7894,9 @@ static const char* apzX11_SprintfPatch[] = { ...@@ -7849,9 +7894,9 @@ static const char* apzX11_SprintfPatch[] = {
* *
* List of all fixes * List of all fixes
*/ */
#define REGEX_COUNT 235 #define REGEX_COUNT 237
#define MACH_LIST_SIZE_LIMIT 261 #define MACH_LIST_SIZE_LIMIT 261
#define FIX_COUNT 193 #define FIX_COUNT 194
/* /*
* Enumerate the fixes * Enumerate the fixes
...@@ -7894,6 +7939,7 @@ typedef enum { ...@@ -7894,6 +7939,7 @@ typedef enum {
BROKEN_ASSERT_STDIO_FIXIDX, BROKEN_ASSERT_STDIO_FIXIDX,
BROKEN_ASSERT_STDLIB_FIXIDX, BROKEN_ASSERT_STDLIB_FIXIDX,
BROKEN_CABS_FIXIDX, BROKEN_CABS_FIXIDX,
BROKEN_NAN_FIXIDX,
BSD_STDIO_ATTRS_CONFLICT_FIXIDX, BSD_STDIO_ATTRS_CONFLICT_FIXIDX,
CTRL_QUOTES_DEF_FIXIDX, CTRL_QUOTES_DEF_FIXIDX,
CTRL_QUOTES_USE_FIXIDX, CTRL_QUOTES_USE_FIXIDX,
...@@ -8238,6 +8284,11 @@ tFixDesc fixDescList[ FIX_COUNT ] = { ...@@ -8238,6 +8284,11 @@ tFixDesc fixDescList[ FIX_COUNT ] = {
BROKEN_CABS_TEST_CT, FD_MACH_ONLY | FD_SUBROUTINE, BROKEN_CABS_TEST_CT, FD_MACH_ONLY | FD_SUBROUTINE,
aBroken_CabsTests, apzBroken_CabsPatch, 0 }, aBroken_CabsTests, apzBroken_CabsPatch, 0 },
{ zBroken_NanName, zBroken_NanList,
apzBroken_NanMachs,
BROKEN_NAN_TEST_CT, FD_MACH_ONLY | FD_SUBROUTINE,
aBroken_NanTests, apzBroken_NanPatch, 0 },
{ zBsd_Stdio_Attrs_ConflictName, zBsd_Stdio_Attrs_ConflictList, { zBsd_Stdio_Attrs_ConflictName, zBsd_Stdio_Attrs_ConflictList,
apzBsd_Stdio_Attrs_ConflictMachs, apzBsd_Stdio_Attrs_ConflictMachs,
BSD_STDIO_ATTRS_CONFLICT_TEST_CT, FD_MACH_ONLY | FD_SUBROUTINE, BSD_STDIO_ATTRS_CONFLICT_TEST_CT, FD_MACH_ONLY | FD_SUBROUTINE,
......
...@@ -20,6 +20,7 @@ autogen definitions fixincl; ...@@ -20,6 +20,7 @@ autogen definitions fixincl;
FIXINC_DEBUG = yes; FIXINC_DEBUG = yes;
#endif #endif
/* /*
* On Mac OS 10.3.9, the 'long double' functions are available in * On Mac OS 10.3.9, the 'long double' functions are available in
* libSystem, but are not prototyped in math.h. * libSystem, but are not prototyped in math.h.
...@@ -33,7 +34,11 @@ fix = { ...@@ -33,7 +34,11 @@ fix = {
/* This file prototypes the long double functions available on Mac OS /* This file prototypes the long double functions available on Mac OS
10.3.9. */ 10.3.9. */
#ifndef __MATH__ #ifndef __MATH__
# undef __APPLE_CC__
# define __APPLE_CC__ 1345
# include_next <architecture/ppc/math.h> # include_next <architecture/ppc/math.h>
# undef __APPLE_CC__
# define __APPLE_CC__ 1
# ifndef __LIBMLDBL_COMPAT # ifndef __LIBMLDBL_COMPAT
# ifdef __LONG_DOUBLE_128__ # ifdef __LONG_DOUBLE_128__
# define __LIBMLDBL_COMPAT(sym) __asm("_" #sym "$LDBL128") # define __LIBMLDBL_COMPAT(sym) __asm("_" #sym "$LDBL128")
...@@ -1042,6 +1047,21 @@ fix = { ...@@ -1042,6 +1047,21 @@ fix = {
"extern double cabs(struct __cabs_s);"; "extern double cabs(struct __cabs_s);";
}; };
/*
* Fixup Darwin's broken check for __builtin_nanf.
*/
fix = {
hackname = broken_nan;
files = "architecture/ppc/math.h";
files = "architecture/i386/math.h";
select = "#if defined(__APPLE_CC__) && (__APPLE_CC__ >= 1345)";
bypass = "powl";
c_fix = format;
c_fix_arg = "#if 1";
test_text = "#if defined(__APPLE_CC__) && (__APPLE_CC__ >= 1345)";
};
/* /*
* Various systems derived from BSD4.4 contain a macro definition * Various systems derived from BSD4.4 contain a macro definition
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment