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

From Craig Ringer
Subject Re: Compiling extensions on Windows
Date
Msg-id 52D1079B.8000404@2ndquadrant.com
Whole thread Raw
In response to Re: Compiling extensions on Windows  (Sandeep Thakkar <sandeep.thakkar@enterprisedb.com>)
Responses Re: Compiling extensions on Windows  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-hackers
On 01/06/2014 07:44 PM, Sandeep Thakkar wrote:
> Okay.
> 
> BTW, I just checked that Windows 32bit installer ships the libintl.h.
> Did you try if it works for you? Or it requires more headers? Somehow,
> Windows 64bit installer installer missed it. I'll fix the build script. 

Actually, on second thoughts there were two other issues. One I reported
separately (double-inclusion of pg_config_os.h due to _WIN32 vs WIN32).
The other is worth looking at here.

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. We seem to work around this in
the Perl build toolchain by forcing export of everything not explicitly
static (which is, btw, a pretty crappy thing we should revisit in favour
of using PGDLLEXPORT and -fvisibility=hidden on Linux).

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?

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



pgsql-hackers by date:

Previous
From: Craig Ringer
Date:
Subject: Re: Compiling extensions on Windows
Next
From: Simon Riggs
Date:
Subject: Re: Add CREATE support to event triggers