git.postgresql.org Git - postgresql.git/commitdiff

git projects / postgresql.git / commitdiff
? search:
summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: de744e9)
windows: Define WIN32_LEAN_AND_MEAN to make compilation faster.
Fri, 1 Oct 2021 16:50:45 +0000 (09:50 -0700)
Mon, 4 Oct 2021 20:16:12 +0000 (13:16 -0700)
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


diff --git a/src/include/port/win32_port.h b/src/include/port/win32_port.h
index 093a009aee56d9a395d9280dfbac49dc1999ee2c..c1c4831595ae31e242dbfab123e53d4309319ea8 100644 (file)
--- a/src/include/port/win32_port.h
+++ b/src/include/port/win32_port.h
@@ -43,6 +43,14 @@
#define _WINSOCKAPI_
#endif
+/*
+ * 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...
+ */
+#define WIN32_LEAN_AND_MEAN
+
#include <winsock2.h>
#include <ws2tcpip.h>
#include <windows.h>
This is the main PostgreSQL git repository.
RSS Atom

AltStyle によって変換されたページ (->オリジナル) /