pgsql: windows: Define WIN32_LEAN_AND_MEAN to make compilation faster.

Started by Andres Freundalmost 5 years ago5 messagescomitters
Jump to latest
#1Andres Freund
andres@anarazel.de

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: /messages/by-id/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(+)

#2Tom Lane
tgl@sss.pgh.pa.us
In reply to: Andres Freund (#1)
Re: pgsql: windows: Define WIN32_LEAN_AND_MEAN to make compilation faster.

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

#3Andres Freund
andres@anarazel.de
In reply to: Tom Lane (#2)
Re: pgsql: windows: Define WIN32_LEAN_AND_MEAN to make compilation faster.

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

#4Tom Lane
tgl@sss.pgh.pa.us
In reply to: Andres Freund (#3)
Re: pgsql: windows: Define WIN32_LEAN_AND_MEAN to make compilation faster.

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

#5Andres Freund
andres@anarazel.de
In reply to: Andres Freund (#3)
Re: pgsql: windows: Define WIN32_LEAN_AND_MEAN to make compilation faster.

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.