Subject: Re: No "amiga" define in default compiler...
To: Chris Hopps <chopps@emunix.emich.edu>
From: None <mw@eunet.ch>
List: amiga-dev
Date: 03/12/1994 16:36:25
> > > The default compiler built from the sun-lamp sources
> > > does not define "amiga". Can/Should this be fixed?
> > >
> > I talked about this with Chris Hopps and he said, and I agreed
> > with him, the answer to this question is no. Any code that
> > NEEDS to know it's on an Amiga should put a special if case in
> > the Makefile, see Makefile in libkvm for details.
>
> exatcly.
Don't agree. Each machine should provide a unique define to identify it.
You'll have to do this with the hp300 release, to get all those "ifdef hp300"
right, the sun3 port probably wants to define sun, too. Long time ago, when
we created new defines for the amigados gcc compiler, the convention was:
#ifdef amigados
.. do something which is specific to AmigaDOS, like dealing with
logical devices ..
#ifdef amiga
.. do something which is specific to the Amiga hardware, if you have to
further differentiate under which OS you're running, use additional
sub-#ifdef.
For generic code (which will probably be 99% of all code), you should NOT
use "#ifdef amiga", but "#ifdef __NetBSD__", or if it's something really
cpu related, "#ifdef mc68000".
I don't think it's the right thing to forget about the machine you're running
on, even if that makes some things easier since it doesn't let people depend
on "#ifdef amiga". I for myself will use a compiler that does define amiga,
a machine-definition just doesn't belong into a Makefile.
-Markus
--
CHUUG/EUnet Switzerland Markus Wild
Zweierstrasse 35 Tel: +41 1 291 45 80 mw@eunet.ch
CH-8004 Zuerich Fax: +41 1 291 46 42 S=mw;P=EUnet;A=EUnet;C=CH
------------------------------------------------------------------------------