Subject: Re: Change to sunos_exec.[ch]
To: Todd Vierling <tv@pobox.com>
From: Richard Earnshaw <rearnsha@arm.com>
List: current-users
Date: 08/10/1998 13:12:27
> On Mon, 10 Aug 1998, Jason Thorpe wrote:
> 
> :  > #undef __sparc__
> :  > #define __sparc__ 1
> :  > 
> :  > in src/sys/arch/sparc/include/param.h.  (Perhaps even types.h.)  That way,
> :  > the source tree won't be broken pending a toolchain update.
> : 
> : Are you saying that the NetBSD/sparc compiler doesn't define __sparc__?!
> 
> *predefines:
> -Dunix -Dsparc -D__NetBSD__ -D__KPRINTF_ATTRIBUTE__ -Asystem(unix)
> -Asystem(NetBSD) -Acpu(sparc) -Amachine(sparc)
> 
> Doesn't look like it to me - now, I may not have a fully updated compiler
> (it's about a month or two old), but someone should be able to compile this
> code from a 1.3 box.

Gcc always fixes this up by duplicating each -D in predefines that isn't 
prefixed with __ with one that is surrounded by them, so -Dsparc will 
cause -D__sparc__ to be defined as well.  In part this is so that -Dsparc 
can then be deleted when gcc -ansi is used (since -Dsparc would pollute 
the name space).

gcc.c:
                      if (*y != '_'
                          || (*(y+1) != '_' && ! ISUPPER (*(y+1))))
                        {
                          /* Stick __ at front of macro name.  */
                          *x++ = '_';
                          *x++ = '_';
                          /* Arrange to stick __ at the end as well.  */
                          flag = 1;
                        }

Richard.