Thread: pgsql: windows: Define WIN32_LEAN_AND_MEAN to make compilation faster.

pgsql: windows: Define WIN32_LEAN_AND_MEAN to make compilation faster.

From
Andres Freund
Date:
windows: Define WIN32_LEAN_AND_MEAN to make compilation faster.

windows.h includes a lot of other headers, slowing down compilation
significantly. WIN32_LEAN_AND_MEAN reduces that a bit. It'd be better to
remove the include of windows.h (as well as indirect inclusions of it) from such
a central place, but until then...

Discussion: https://postgr.es/m/20210921193035.pqzay43vpyv7in43@alap3.anarazel.de

Branch
------
master

Details
-------
https://git.postgresql.org/pg/commitdiff/8162464a25e5314e753c580389f76a9b7f69445b

Modified Files
--------------
src/include/port/win32_port.h | 8 ++++++++
1 file changed, 8 insertions(+)


Re: pgsql: windows: Define WIN32_LEAN_AND_MEAN to make compilation faster.

From
Tom Lane
Date:
Andres Freund <andres@anarazel.de> writes:
> windows: Define WIN32_LEAN_AND_MEAN to make compilation faster.

I happened to notice from grepping that
src/backend/port/win32/crashdump.c has its own

#define WIN32_LEAN_AND_MEAN

Can't we remove that now?  (I kind of wonder what good it did at all,
considering postgres.h has already pulled in <windows.h>.)

            regards, tom lane



Re: pgsql: windows: Define WIN32_LEAN_AND_MEAN to make compilation faster.

From
Andres Freund
Date:
Hi,

On 2021-11-06 18:24:21 -0400, Tom Lane wrote:
> Andres Freund <andres@anarazel.de> writes:
> > windows: Define WIN32_LEAN_AND_MEAN to make compilation faster.
> 
> I happened to notice from grepping that
> src/backend/port/win32/crashdump.c has its own
> 
> #define WIN32_LEAN_AND_MEAN
>
> Can't we remove that now?  (I kind of wonder what good it did at all,
> considering postgres.h has already pulled in <windows.h>.)

Yea, it seems pointless.

There's a semi-related weirdness: Several src/port/ files include <windows.h>
themselves (I guess that could be seen as prep for dropping windows.h from
win32_port.h).

Unless you're already done with that by the time I git pull, I'm gonna remove
that redundant WIN32_LEAN_AND_MEAN.

Greetings,

Andres Freund



Re: pgsql: windows: Define WIN32_LEAN_AND_MEAN to make compilation faster.

From
Tom Lane
Date:
Andres Freund <andres@anarazel.de> writes:
> There's a semi-related weirdness: Several src/port/ files include <windows.h>
> themselves (I guess that could be seen as prep for dropping windows.h from
> win32_port.h).

Hmm.

> Unless you're already done with that by the time I git pull, I'm gonna remove
> that redundant WIN32_LEAN_AND_MEAN.

No, I've not done anything --- feel free.

            regards, tom lane



Re: pgsql: windows: Define WIN32_LEAN_AND_MEAN to make compilation faster.

From
Andres Freund
Date:
On 2021-11-06 15:41:45 -0700, Andres Freund wrote:
> Unless you're already done with that by the time I git pull, I'm gonna remove
> that redundant WIN32_LEAN_AND_MEAN.

Done.