This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: Compaq Tru64 bootstrap problems
- From: Neil Booth <neil at daikokuya dot demon dot co dot uk>
- To: Richard Henderson <rth at redhat dot com>, Roger Sayle <roger at eyesopen dot com>,gcc at gcc dot gnu dot org, Zack Weinberg <zack at codesourcery dot com>
- Date: Thu, 30 May 2002 23:14:38 +0100
- Subject: Re: Compaq Tru64 bootstrap problems
- References: <20020526223841.A31867@redhat.com> <Pine.LNX.4.33.0205301332400.13447-100000@www.eyesopen.com> <20020530134501.A5397@redhat.com>
Richard Henderson wrote:-
> On Thu, May 30, 2002 at 01:54:58PM -0600, Roger Sayle wrote:
> > Normally, <sys/timers.h> gets its definition of "struct timespec"
> > from <sys/timemisc.h> where the definition is guarded by the CPP
> > directive:
> >
> > #if defined(__LANGUAGE_C__) || defined(__cplusplus)
> >
> > My guess is that with the recent predefines reorganization we are
> > no longer defining "__LANGUAGE_C__" on alpha*-dec-osf5.1. Hopefully,
> > the fix is trivial, but if not I can file a GNATS bootstrap PR.
>
> Indeed that would appear to be the case.
>
> The code in builtin_define_std doesn't look right.
> Given LANGUAGE_C it defines
>
> _LANGUAGE_C
> _LANGUAGE_C__
>
> not the expected
>
> __LANGUAGE_C
> __LANGUAGE_C__
>
> Zack or Neil, can you comment?
Silly me. Does this fix it? I've only checked it compiles;
I don't have time right now to check it DTRT.
Neil.
* c-common.c (builtin_define_std): Correct logic.
Index: c-common.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/c-common.c,v
retrieving revision 1.338
diff -u -p -r1.338 c-common.c
--- c-common.c 30 May 2002 21:28:11 -0000 1.338
+++ c-common.c 30 May 2002 22:12:53 -0000
@@ -4440,10 +4440,13 @@ builtin_define_std (macro)
/* prepend __ (or maybe just _) if in user's namespace. */
memcpy (p, macro, len + 1);
- if (*p != '_')
- *--p = '_';
- if (p[1] != '_' && !ISUPPER (p[1]))
- *--p = '_';
+ if (!( *p == '_' && (p[1] == '_' || ISUPPER (p[1]))))
+ {
+ if (*p != '_')
+ *--p = '_';
+ if (p[1] != '_')
+ *--p = '_';
+ }
cpp_define (parse_in, p);
/* If it was in user's namespace... */