Using |inline| in X.org codebase / was: Re: Usage of ANSI-C |const| in X11 code...

Roland Mainz roland.mainz at nrubsig.org
Wed Mar 30 16:34:31 PST 2005


Adam Jackson wrote:
[snip]
> > OK... how should the usage of |inline| be handled ? We need 1) a way to
> > detect support for |inline| and 2) a convention for what should be done
> > if |inline| isn't supported (just doing a |#define inline| isn't
> > possible as this may cause trouble with system includes (or better:
> > compiler-specific includes) so we either need something like |#ifdef
> > SUPPORTS_INLINE\n#define _Xstaticinline static inline\n#else\n#define
> > _Xinline static\n#endif| or a different way to guard this stuff... any
> > comments/suggestions/ideas ?
> 
> Well with autotools we can detect this at compile time... ;)

Yes yes... one point for the autotools... :)

> As with the const keyword, I don't know of _any_ compiler that doesn't support
> 'inline' as a keyword.  Which means I'm perfectly willing to just not worry
> about it until some poor sucker with an ancient compiler complains.

I would prefer if the X.org codebase could be compiled with strict
ANSI-C89 to gurantee maximum portability. If we let it slip now we may
end-up in later cleanup work which wouldn't be neccesary if we start to
use it properly from the beginning.
The alternative is to declare that Xorg trunk requires full ANSI-C99
compilance (I am not sure whether everone here will be happy with
that...) ...

> In other words, naked 'inline' is fine, as far as I'm concerned.
> 
> We appear to use both __inline and __inline__ for this, as well as the
> 'inline' keywords itself (mi/miarc.c for example).

;-(

----

Bye,
Roland

-- 
  __ .  . __
 (o.\ \/ /.o) roland.mainz at nrubsig.org
  \__\/\/__/  MPEG specialist, C&&JAVA&&Sun&&Unix programmer
  /O /==\ O\  TEL +49 641 7950090
 (;O/ \/ \O;)



More information about the xorg mailing list