Re: Create function prototype as part of PG_FUNCTION_INFO_V1
| От | Andres Freund |
|---|---|
| Тема | Re: Create function prototype as part of PG_FUNCTION_INFO_V1 |
| Дата | |
| Msg-id | 20140404140701.GD14419@alap3.anarazel.de обсуждение |
| Ответ на | Re: Create function prototype as part of PG_FUNCTION_INFO_V1 (Alvaro Herrera <alvherre@2ndquadrant.com>) |
| Ответы |
Re: Create function prototype as part of PG_FUNCTION_INFO_V1
|
| Список | pgsql-hackers |
On 2014-02-17 10:30:16 -0300, Alvaro Herrera wrote:
> Tom Lane wrote:
> > Peter Eisentraut <peter_e@gmx.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
В списке pgsql-hackers по дате отправления: