Re: narwhal and PGDLLIMPORT

Tom Lane <tgl@sss.pgh.pa.us>

From: Tom Lane <tgl@sss.pgh.pa.us>
To: Andres Freund <andres@2ndquadrant.com>
Cc: Marco Atzeri <marco.atzeri@gmail.com>, pgsql-hackers@postgresql.org
Date: 2014-02-15T15:16:50Z
Lists: pgsql-hackers

Commits

Same data as JSON: GET /api/v1/messages/:b64id/commits the thread's linked commits as JSON, with link sources. API reference →
  1. MinGW: Link with shell32.dll instead of shfolder.dll.

  2. Centralize getopt-related declarations in a new header file pg_getopt.h.

  3. Get rid of use of dlltool in Mingw builds.

  4. Export a few more symbols required for test_shm_mq module.

  5. Export set_latch_on_sigusr1 symbol for Windows.

  6. Use SHGetFolderPath instead of SHGetSpecialFolderPath to find the

Andres Freund <andres@2ndquadrant.com> writes:
> On 2014-02-12 14:11:10 -0500, Tom Lane wrote:
>> Marco Atzeri <marco.atzeri@gmail.com> writes:
>>> from /usr/include/getopt.h
>>> extern char __declspec(dllimport) *optarg;      /* argument associated 
>>> with option */

>> Hm.  All of our files that use getopt also do
>> extern char *optarg;

> So, now that brolga is revived, this unsurprisingly causes breakage
> there after the --disable-auto-export change. ISTM the easiest way to
> deal with this is to just adorn all those with a PGDLLIMPORT?

Uh, no, because that's backwards: we'd need the __declspec(dllimport)
in the backend code.

The best thing probably is not to have the duplicate declarations on
platforms that don't need 'em.  Unfortunately, I seem to recall that
the current coding was arrived at to forestall link problems on weird
platforms that *had* these symbols declared and yet we needed externs
anyway.  We might have to do something as ugly as "#ifndef CYGWIN".

			regards, tom lane