From: Tom Lane <tgl@sss.pgh.pa.us>
To: Kevin Grittner <kgrittn@gmail.com>
Cc: pgsql-hackers@postgresql.org <pgsql-hackers@postgresql.org>
Subject: Re: [COMMITTERS] pgsql: Inline initial comparisons in TestForOldSnapshot()
Date: Fri, 22 Apr 2016 16:55:47 -0400
Message-ID: <30997.1461358547@sss.pgh.pa.us> (raw)
In-Reply-To: <CACjxUsP8eu+JO9ZxAeSgGJkAg+L73YC0F=hmmNLf-TKERF1dLg@mail.gmail.com>
References: <E1atExa-0001od-Dk@gemulon.postgresql.org>
<CACjxUsOOL8wjN7kge0hZTzZnfD7QkzwmLvXaeM+Fw=d_y0vdaQ@mail.gmail.com>
<CACjxUsNW5Eo35B2PeavbWFgK7A9hC=C-jshOZ2g1OW3xD8+g+w@mail.gmail.com>
<CACjxUsNsbpLtK097ed2JytrGcdaL0cjNoV8eWuuQhEpqvCqW9A@mail.gmail.com>
<15986.1461264316@sss.pgh.pa.us>
<CACjxUsP8eu+JO9ZxAeSgGJkAg+L73YC0F=hmmNLf-TKERF1dLg@mail.gmail.com>
List-Unsubscribe: <mailto:majordomo@postgresql.org?body=unsub%20pgsql-hackers>
Kevin Grittner <kgrittn@gmail.com> writes:
> Since I failed to find anything in our docs or C comments, and very
> scant clues in the Wiki and list archives, about when to use
> PGDLLIMPORT and PGDLLEXPORT I figured it might be helpful to
> clarify here, and maybe add something near one of the definitions.
> Based on your fix and the meager clues found elsewhere, along with
> randomly looking at a few points of existing usage, I infer that
> these should be specified from the perspective of loadable modules
> which we might want to build for Windows. That is, an extension
> would use PGDLLEXPORT for symbols it wanted to have the backends
> find, and core code should use PGDLLIMPORT for symbols that
> extensions or other loadable modules might need to find. These are
> used for both data locations and function names.
I resolutely refuse to become an expert on such things, but from existing
usage it seems we only need PGDLLIMPORT on the "extern"s for core global
variables that need to be accessible to extensions. If there is a
corresponding requirement for core functions, it must be getting handled
automatically somewhere in the Windows build systems.
There are no manual uses of PGDLLEXPORT anywhere in our tree --- it's
plastered on automatically by PG_MODULE_MAGIC and PG_FUNCTION_INFO_V1,
and that's all. I rather suspect that this is cargo-cult programming
and those uses are not really necessary, because if they are, how do V0
functions in extensions work? But as long as it's out of sight I don't
particularly care if they're there or not.
regards, tom lane
--
Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-hackers
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients from your mail client; the link fills in
the headers below: reply via email
Some clients, webmail especially, drop In-Reply-To and References from
a link, and the reply then starts a new thread: use the mbox below.
To: pgsql-committers@postgresql.org
Cc: tgl@sss.pgh.pa.us, kgrittn@gmail.com, pgsql-hackers@postgresql.org
Subject: Re: [COMMITTERS] pgsql: Inline initial comparisons in TestForOldSnapshot()
In-Reply-To: <30997.1461358547@sss.pgh.pa.us>
References: <E1atExa-0001od-Dk@gemulon.postgresql.org> <CACjxUsOOL8wjN7kge0hZTzZnfD7QkzwmLvXaeM+Fw=d_y0vdaQ@mail.gmail.com> <CACjxUsNW5Eo35B2PeavbWFgK7A9hC=C-jshOZ2g1OW3xD8+g+w@mail.gmail.com> <CACjxUsNsbpLtK097ed2JytrGcdaL0cjNoV8eWuuQhEpqvCqW9A@mail.gmail.com> <15986.1461264316@sss.pgh.pa.us> <CACjxUsP8eu+JO9ZxAeSgGJkAg+L73YC0F=hmmNLf-TKERF1dLg@mail.gmail.com> <30997.1461358547@sss.pgh.pa.us>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox