Subject: Re: Should PR 18434 be closed?
To: der Mouse <mouse@Rodents.Montreal.QC.CA>
From: Sami Kantoluoto <sami.kantoluoto@embedtronics.fi>
List: tech-kern
Date: 04/07/2003 13:42:34
On Mon, Apr 07, 2003 at 06:30:32AM -0400, der Mouse wrote:
> > The reason why wi.c couldn't compile is that DELAY() macro on hpcmips
> > was defined as a block like below and wi.c used DELAY() as a
> > expression.

> If you're willing to depend on gcc, you could write it as
> 
> #define DELAY(n) ({ 

How about inline function? Something like:

static __inline void DELAY(int N)
{
  register int N = cpuspeed * (n);
  while (--N > 0);
}

Probably needs __attribute__((unused)) (or extern __inline)..


      -sk