Re: Create function prototype as part of PG_FUNCTION_INFO_V1

From: Andres Freund <andres(at)2ndquadrant(dot)com>
To: Alvaro Herrera <alvherre(at)2ndquadrant(dot)com>
Cc: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, Peter Eisentraut <peter_e(at)gmx(dot)net>, pgsql-hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Create function prototype as part of PG_FUNCTION_INFO_V1
Date: 2014-04-04 14:07:01
Message-ID: 20140404140701.GD14419@alap3.anarazel.de
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On 2014-02-17 10:30:16 -0300, Alvaro Herrera wrote:
> Tom Lane wrote:
> > Peter Eisentraut <peter_e(at)gmx(dot)net> writes:
> > > On 2/15/14, 10:22 AM, Tom Lane wrote:
> > >> Yes it does; people who fail to remove their manual externs will get
> > >> Windows-only build failures (or at least warnings; it's not very clear
> > >> which declaration will win).
> >
> > > The manual externs and the automatically provided ones are exactly the
> > > same. Why would that fail?
> >
> > Maybe I'm remembering the wrong patch. I thought what this patch was
> > intending was to put PGDLLEXPORT into the automatically-provided externs.
>
> This hunk is the essence of this patch:
>
> #define PG_FUNCTION_INFO_V1(funcname) \
> +Datum funcname(PG_FUNCTION_ARGS); \
> extern PGDLLEXPORT const Pg_finfo_record * CppConcat(pg_finfo_,funcname)(void); \
>
>
> Note that PGDLLEXPORT is already there. This patch is just about
> additionally providing the prototype.

The PGDLLEXPORT is attached to the variable, no the function tho. If
somebody previously tried to do the correct thing and attached
PGDLLEXPORT to their own *function* prototoype, it would cause problems
now.

Greetings,

Andres Freund

--
Andres Freund http://www.2ndQuadrant.com/
PostgreSQL Development, 24x7 Support, Training & Services

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Andres Freund 2014-04-04 14:10:54 Re: Optimize kernel readahead using buffer access strategy
Previous Message Robert Haas 2014-04-04 14:01:37 Re: Dynamic Shared Memory stuff