[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: #ifdef ALPHA?

On Fri, 4 Dec 1998, Oscar Levi wrote:

> On Fri, Dec 04, 1998 at 04:18:02PM -0800, Joey Hess wrote:
> > Hi, what's the correct way to ifdef something out so it's only done on the
> > alpha arch? Does #ifdef ALPHA work? Please cc to me, I'm not on this list.
> AFAIK, there is no ALPHA constant.  There is a __alpha in GCC.  Since
> we are patching for GCC or egcs, it may be ok to use it.  In general,
> it is better to avoid ifdefs for architectures and change the code
> according to the real problem.  For example, create a constant call
> ALIGN_BOUNDARY that is 4 for i386 and 8 for Alpha.  Set this in a
> config.h sort of way, and change the code to use the macro.  There
> should be a way to use this method in nearly every case.

I think this is a bug.  GCC should define __alpha__ (note __ *following* the
alpha) not __alpha.  Imake, for instance, has __alpha in various places in
its scripts, and is broken as a result.

The kernel uses:
#ifdef __alpha__
successfully in a couple of places.

-- Bob

Bob McElrath (mcelrath@draal.physics.wisc.edu) Univ. of Wisconsin at Madison

Reply to: