Re: Compiling extensions on Windows - Mailing list pgsql-hackers

From Tom Lane
Subject Re: Compiling extensions on Windows
Date
Msg-id 13260.1389456040@sss.pgh.pa.us
Whole thread Raw
In response to Re: Compiling extensions on Windows  (Craig Ringer <craig@2ndquadrant.com>)
Responses Re: Compiling extensions on Windows  (Magnus Hagander <magnus@hagander.net>)
Re: Compiling extensions on Windows  (Craig Ringer <craig@2ndquadrant.com>)
List pgsql-hackers
Craig Ringer <craig@2ndquadrant.com> writes:
> We don't set __declspec(dllexport) on extension functions automatically
> when building stand-alone on Windows. So it's necessary to explicitly
> specify PGDLLEXPORT for each function.

I'm not sure I believe this.  I don't see any PGDLLEXPORT symbols in any
of the standard contrib modules; how is it that they work?

> Instead we should perhaps be adding this automatically via a prototype
> generated by PG_FUNCTION_INFO_V1, or adding PGDLLEXPORT to all our
> example documentation. I think the latter is preferable because if we
> start generating a prototype for the base function in PG_FUNCTION_INFO
> when we didn't before it could break existing code.

> Comments?

One of the things I've always found particularly vile about Microsoft
is the way that they seem to think it's fine to make people sprinkle
Windows-only droppings throughout code that's supposed to be portable.
I'm not in favor of asking people to write out PGDLLEXPORT manually
on every function unless it's *absolutely* necessary, and the available
evidence suggests to me that it isn't.

So if it's really necessary to change anything here, I'd rather see us
take the approach of hiding it in PG_FUNCTION_INFO_V1.  What happens
if we do that and there's also a manually-written prototype?
        regards, tom lane



pgsql-hackers by date:

Previous
From: Florian Pflug
Date:
Subject: Re: array_length(anyarray)
Next
From: Bruce Momjian
Date:
Subject: Re: Standalone synchronous master