Re: Patch: Remove gcc dependency in definition of inline functions

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: Patch: Remove gcc dependency in definition of inline functions
Дата
Msg-id 5046.1260980519@sss.pgh.pa.us
обсуждение исходный текст
Ответ на Re: Patch: Remove gcc dependency in definition of inline functions  (Marko Kreen <markokr@gmail.com>)
Ответы Re: Patch: Remove gcc dependency in definition of inline functions  (Kurt Harriman <harriman@acm.org>)
Список pgsql-hackers
Marko Kreen <markokr@gmail.com> writes:
> On 12/15/09, Kurt Harriman <harriman@acm.org> wrote:
>> Attached is a revised patch, offered for the 2010-01 commitfest.
>> It's also available in my git repository in the "submitted" branch:
>> 
>> http://git.postgresql.org/gitweb?p=users/harriman/share.git;a=shortlog;h=refs/heads/submitted

> -1.  The PG_INLINE is ugly.

FWIW, I think the patch is largely OK, except for the autoconf hackery
which I'm not the best-qualified person to opine on.  I would only
suggest that the cleanest coding would be
#ifdef USE_INLINE
static inline foo(...) ...
#else
... non-inline definition of foo
#endif

ie, go ahead and rely on autoconf's definition (if any) of "inline"
and add a policy symbol USE_INLINE to determine whether to use it.
The proposed PG_INLINE coding conflates the symbol needed in the code
with the policy choice.

Another possibility would be to call the policy symbol HAVE_INLINE,
but that (a) risks collision with a name defined by autoconf built-in
macros, and (b) looks like it merely indicates whether the compiler
*has* inline, not that we have made a choice about how to use it.
        regards, tom lane


В списке pgsql-hackers по дате отправления:

Предыдущее
От: Scott Bailey
Дата:
Сообщение: Re: idea - new aggregates median, listagg
Следующее
От: Marko Kreen
Дата:
Сообщение: Re: Patch: Remove gcc dependency in definition of inline functions