Skip site navigation (1) Skip section navigation (2)

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

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Marko Kreen <markokr(at)gmail(dot)com>
Cc: Kurt Harriman <harriman(at)acm(dot)org>, pgsql-hackers(at)postgresql(dot)org
Subject: Re: Patch: Remove gcc dependency in definition of inline functions
Date: 2009-12-16 16:21:59
Message-ID: 5046.1260980519@sss.pgh.pa.us (view raw or flat)
Thread:
Lists: pgsql-hackers
Marko Kreen <markokr(at)gmail(dot)com> writes:
> On 12/15/09, Kurt Harriman <harriman(at)acm(dot)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

In response to

Responses

pgsql-hackers by date

Next:From: Marko KreenDate: 2009-12-16 16:24:34
Subject: Re: Patch: Remove gcc dependency in definition of inline functions
Previous:From: Scott BaileyDate: 2009-12-16 16:10:57
Subject: Re: idea - new aggregates median, listagg

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group