This is the mail archive of the gcc@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Compaq Tru64 bootstrap problems


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...  */


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]