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

From: Kurt Harriman <harriman(at)acm(dot)org>
To: Marko Kreen <markokr(at)gmail(dot)com>
Cc: pgsql-hackers(at)postgresql(dot)org
Subject: Re: Patch: Remove gcc dependency in definition of inline functions
Date: 2009-12-16 02:30:08
Message-ID: 4B284630.9000300@acm.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On 12/15/2009 2:09 PM, Marko Kreen wrote:
>
> Oh. Ok then. Force-inline seems better fix as we may want to use
> it for other reasons too (converting big macros).
>
> So it seems like a good moment to solve it for gcc too.

Is ordinary inlining not sufficient?

If deluxe inlining is something that might be wanted in the
future, but isn't needed right now, perhaps we should wait
until then.

> Your worry ii) can be ignored, managing to compile on such
> compilers is already overachievement.

I think so too. With your opinion added to mine, do we constitute a
consensus of the pg community? Someone might object that a sample of
two individuals is insufficiently representative of the whole, but
away with the pedants: let us not quibble over trifles.

> The question is now what should we put into configure and what into
> headers.

PostgreSQL seems mostly to follow the GNU

> Simplest would be to have plain AC_C_INLINE in configure
> and then in header (c.h?):
>
> #ifdef _MSC_VER
> #undef inline
> #define inline __forceinline
> #else
> #ifdef __GNUC__
> #undef inline
> #define inline inline __attribute__((always_inline))
> #endif
> #endif
>
> (Not compile tested :)
>
> Or should we put that logic also into configure,
> so that the config.h already contains proper 'inline'?
>
> Although fitting it into win32 buildsystem seems to be bit more
> complex in that case...

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message KaiGai Kohei 2009-12-16 02:56:02 Re: Adding support for SE-Linux security
Previous Message Florian G. Pflug 2009-12-16 01:56:05 Re: Compiling HEAD with -Werror int 64-bit mode