[issue775] osutil.c: inline keyword is a C99-ism
Giorgos Keramidas
keramida at ceid.upatras.gr
Thu Oct 11 12:29:26 UTC 2007
On 2007-10-11 09:47, James Bostock <mercurial-bugs at selenic.com> wrote:
>
> New submission from James Bostock <james.bostock at gmail.com>:
>
> Hi,
>
> The file osutil.c uses the inline keyword which, I believe, is a C99-ism. For
> older compilers, I suggest adding something like the following:
>
> /* Is there a better way to check for pre-C99? */
AFAIK, that's a good enough way :-)
> #if defined(__STDC__)
> #if !defined(__STDC_VERSION__) || (__STDC_VERSION__ < 199901L)
> #define inline
> #endif
> #endif
>
> Alternatively, mode_to_kind (the only inline function) could be
> actually inlined as it is only called once. Or maybe replaced by a
> preprocessor macro.
More information about the Mercurial-devel
mailing list