[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Usage of "inline" in gettext.h
From: |
Bruno Haible |
Subject: |
Re: Usage of "inline" in gettext.h |
Date: |
Wed, 8 Aug 2007 00:54:09 +0200 |
User-agent: |
KMail/1.5.4 |
Lasse Collin wrote:
> I'm using gettext 0.16.1. There is a comment in gettext.h about usage of
> const: ...
>
> So it suggest using AC_C_CONST in configure.ac.
AC_C_CONST is obsolete for several years already. The autoconf doc says:
This macro is obsolescent, as current C compilers support `const'.
New programs need not use this macro.
> #ifdef __GNUC__
> __inline
> #else
> #ifdef __cplusplus
> inline
> #endif
> #endif
> static const char *
>
> Is this a left-over from the past, or why the same thing cannot be done
> with the inline keyword (use AC_C_INLINE)?
This is a good observation. You are free to change your copy of gettext.h
to use just 'inline' instead of this cascaded #ifdef, and use AC_C_INLINE.
> To me, it sounds like a bad
> idea to support inline only with C++ compilers and GCC, since GCC
> probably isn't the only C compiler supporting C99's inline.
Yes. On the other hand, I wanted to avoid the use of an autoconf macro here,
because if a maintainer forgets to use AC_C_INLINE, his users will get fatal
compilation errors on some platforms. Whereas in the current state, the
worst effect is some unneeded binary code in executables on some platforms.
Bruno