Re: pgsql: Fix for globals.c- c.h must come first

2018-06-19 Thread Tom Lane
Andres Freund writes: > Are there arguments for doing this in postgres.h rather than c.h? No, c.h is the correct place. The core problem is that we have to include pg_config.h before et al in order to have consistent libc APIs (on platforms where this matters), and c.h is what does that. > I

Re: pgsql: Fix for globals.c- c.h must come first

2018-06-19 Thread Andres Freund
Hi, On 2018-06-19 14:19:56 -0400, Tom Lane wrote: > Andres Freund writes: > > On 2018-06-19 14:09:15 -0400, Tom Lane wrote: > >> Hm. You could imagine adding something like > >> > >> #ifdef some-relevant-macro > >> #error include ordering problem, c.h must come before system headers > >>

Re: pgsql: Fix for globals.c- c.h must come first

2018-06-19 Thread Tom Lane
I wrote: > It'd probably be good enough if the error detection worked with glibc's > headers. Even if nobody noticed before a particular patch went in, > the buildfarm would surely find it. On second thought, we'd also need a solution for Windows, because we have some files that only get

Re: pgsql: Fix for globals.c- c.h must come first

2018-06-19 Thread Tom Lane
Andres Freund writes: > On 2018-06-19 14:09:15 -0400, Tom Lane wrote: >> Hm. You could imagine adding something like >> >> #ifdef some-relevant-macro >> #error include ordering problem, c.h must come before system headers >> #endif >> >> near the head of c.h. But I'm not sure how we'd get

Re: pgsql: Fix for globals.c- c.h must come first

2018-06-19 Thread Andres Freund
On 2018-06-19 14:09:15 -0400, Tom Lane wrote: > Bruce Momjian writes: > > On Sat, May 19, 2018 at 01:20:47AM +, Stephen Frost wrote: > >> Commit da9b580 mistakenly put a system header before postgres.h (which > >> includes c.h). That can cause portability issues and broke (at least) > >>

Re: pgsql: Fix for globals.c- c.h must come first

2018-06-19 Thread Tom Lane
Bruce Momjian writes: > On Sat, May 19, 2018 at 01:20:47AM +, Stephen Frost wrote: >> Commit da9b580 mistakenly put a system header before postgres.h (which >> includes c.h). That can cause portability issues and broke (at least) >> builds with older Windows compilers. > I assume there is

Re: pgsql: Fix for globals.c- c.h must come first

2018-06-19 Thread Andres Freund
On 2018-06-19 13:58:34 -0400, Bruce Momjian wrote: > On Sat, May 19, 2018 at 01:20:47AM +, Stephen Frost wrote: > > Fix for globals.c- c.h must come first > > > > Commit da9b580 mistakenly put a system header before postgres.h (which > > includes c.h). That can cause portability issues and

Re: pgsql: Fix for globals.c- c.h must come first

2018-06-19 Thread Bruce Momjian
On Sat, May 19, 2018 at 01:20:47AM +, Stephen Frost wrote: > Fix for globals.c- c.h must come first > > Commit da9b580 mistakenly put a system header before postgres.h (which > includes c.h). That can cause portability issues and broke (at least) > builds with older Windows compilers. I

pgsql: Fix for globals.c- c.h must come first

2018-05-18 Thread Stephen Frost
Fix for globals.c- c.h must come first Commit da9b580 mistakenly put a system header before postgres.h (which includes c.h). That can cause portability issues and broke (at least) builds with older Windows compilers. Discovered by Mark Dilger. Discussion: