Re: Rationalizing declarations of src/common/ variables

2021-11-29 Thread Tom Lane
Robert Haas writes: > On Mon, Nov 29, 2021 at 10:03 AM Tom Lane wrote: >> Either of these ways would require that FRONTEND is already set correctly >> when c.h is read. But all of the hacks you mention do ensure that. > Yeah. Are you aware of any other, worse hacks? Worse than which? Anyway,

Re: Rationalizing declarations of src/common/ variables

2021-11-29 Thread Robert Haas
On Mon, Nov 29, 2021 at 10:03 AM Tom Lane wrote: > Either of these ways would require that FRONTEND is already set correctly > when c.h is read. But all of the hacks you mention do ensure that. Yeah. Are you aware of any other, worse hacks? -- Robert Haas EDB: http://www.enterprisedb.com

Re: Rationalizing declarations of src/common/ variables

2021-11-29 Thread Tom Lane
Robert Haas writes: > On Mon, Nov 29, 2021 at 9:27 AM Tom Lane wrote: >> Robert Haas writes: >>> What's the value of introducing PGDLLIMPORT_FE? I mean suppose we just >>> make PGDLLIMPORT expand to nothing in front-end code. >> Hmm ... fair question. It feels like that risks breaking somethin

Re: Rationalizing declarations of src/common/ variables

2021-11-29 Thread Robert Haas
On Mon, Nov 29, 2021 at 9:27 AM Tom Lane wrote: > Robert Haas writes: > > What's the value of introducing PGDLLIMPORT_FE? I mean suppose we just > > make PGDLLIMPORT expand to nothing in front-end code. > > Hmm ... fair question. It feels like that risks breaking something, > but offhand I can't

Re: Rationalizing declarations of src/common/ variables

2021-11-29 Thread Tom Lane
Robert Haas writes: > What's the value of introducing PGDLLIMPORT_FE? I mean suppose we just > make PGDLLIMPORT expand to nothing in front-end code. Hmm ... fair question. It feels like that risks breaking something, but offhand I can't see what, as long as we're certain that FRONTEND is set cor

Re: Rationalizing declarations of src/common/ variables

2021-11-29 Thread Robert Haas
On Mon, Nov 29, 2021 at 12:57 AM Tom Lane wrote: > Here's a draft patch. I'm not in love with the name "PGDLLIMPORT_FE" > and would welcome better ideas. What's the value of introducing PGDLLIMPORT_FE? I mean suppose we just make PGDLLIMPORT expand to nothing in front-end code. -- Robert Haas

Re: Rationalizing declarations of src/common/ variables

2021-11-28 Thread Bharath Rupireddy
On Mon, Nov 29, 2021 at 11:27 AM Tom Lane wrote: > > We've been burnt by this issue repeatedly (cf c2d1eea9e, d025cf88b, > 11b500072) so I think it's time to try to formalize and document > what to do to export a variable from src/common/ or src/port/. +1 to document it. > Here's a draft patch.

Rationalizing declarations of src/common/ variables

2021-11-28 Thread Tom Lane
We've been burnt by this issue repeatedly (cf c2d1eea9e, d025cf88b, 11b500072) so I think it's time to try to formalize and document what to do to export a variable from src/common/ or src/port/. Here's a draft patch. I'm not in love with the name "PGDLLIMPORT_FE" and would welcome better ideas.