Subject: Re: leading/trailing underscores?
To: None <mcmahill@mtl.mit.edu>
From: Simon Burge <simonb@telstra.com.au>
List: tech-toolchain
Date: 01/12/1999 10:27:34
On Mon, 11 Jan 1999 12:59:00 -0500 (EST)  mcmahill@mtl.mit.edu wrote:

> > #  
> > #  on my pmax,
> > #  
> > # #define R3000 1
> > # #define SYSTYPE_BSD 1
> > # #define __NO_LEADING_UNDERSCORES__ 1
> > # #define __ANSI_COMPAT 1
> > # #define __NetBSD__ 1
> > # #define __KPRINTF_ATTRIBUTE__ 1
> > # #define _R3000 1
> > # #define MIPSEL 1
> > # #define __GP_SUPPORT__ 1
> > # #define mips 1
> > # #define __GNUC__ 1
> > # #define _SYSTYPE_BSD 1
> > # #define unix 1
> > 
> > Hrmmm..  that should definately define __ELF__.. how odd...
> thats what I thought.  The pmax is NetBSD-1.3.2. 

1.3.3 and -current on the pmax define __ELF__.

> but I guess, back to the original question, that in terms of leading
> underscores, the thing to do is something like:
> 
> #if defined(__ELF__) || defined(mips)
> #define ENTRY_NAME "myfunction"
> #else
> #define ENTRY_NAME "_myfunction"
> #endif
> 
> or something like that.  The ||defined(mips) takes care of broken(?) pmax
> machines that don't define __ELF__

As above, shouldn't be a problem from 1.3.3 onwards.

Simon.