summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMike Kaganski <mike.kaganski@collabora.com>2017-09-17 23:30:37 +0300
committerMike Kaganski <mike.kaganski@collabora.com>2017-09-18 01:13:30 +0200
commitafeff9102c2935139de4efd40fd2286dce396706 (patch)
tree6eddd462cb8d14f3a40f63d1fa4c4f7ed8d4bd2a
parent164f6ba4e2501ef87639aa4d07699bbf58bdaac0 (diff)
Use even more WIN32_LEAN_AND_MEAN
Change-Id: I538fe5b41156366e0e87b3a93e58a3947afd18f5 Reviewed-on: https://gerrit.libreoffice.org/42398 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
-rw-r--r--bean/native/win32/com_sun_star_comp_beans_LocalOfficeWindow.c3
-rw-r--r--extensions/source/config/ldap/ldapaccess.hxx3
-rw-r--r--hwpfilter/source/mzstring.cxx3
-rw-r--r--idlc/source/options.cxx18
-rw-r--r--include/connectivity/odbc.hxx3
-rw-r--r--l10ntools/source/helpmerge.cxx3
-rw-r--r--lingucomponent/source/lingutil/lingutil.cxx3
-rw-r--r--sal/osl/w32/backtrace.cxx3
-rw-r--r--sal/osl/w32/dllentry.cxx14
-rw-r--r--setup_native/source/win32/customactions/regactivex/regactivex.cxx3
-rw-r--r--shell/inc/spsupp/registrar.hpp3
-rw-r--r--shell/source/backends/localebe/localebackend.cxx3
-rw-r--r--shell/source/backends/wininetbe/wininetbackend.cxx3
-rw-r--r--shell/source/win32/shlxthandler/ooofilt/ooofilt.cxx3
-rw-r--r--shell/source/win32/shlxthandler/ooofilt/propspec.cxx3
-rw-r--r--shell/source/win32/shlxthandler/ooofilt/propspec.hxx3
-rw-r--r--shell/source/win32/shlxthandler/ooofilt/stream_helper.cxx3
-rw-r--r--shell/source/win32/shlxthandler/propsheets/listviewbuilder.hxx3
-rw-r--r--shell/source/win32/shlxthandler/util/registry.cxx3
-rw-r--r--shell/source/win32/spsupp/registrar.cxx1
-rw-r--r--soltools/mkdepend/collectdircontent.hxx3
-rw-r--r--svl/source/config/languageoptions.cxx3
-rw-r--r--svl/source/svdde/ddeimp.hxx3
-rw-r--r--sw/source/ui/vba/vbasystem.cxx3
-rw-r--r--tools/source/datetime/tdate.cxx3
-rw-r--r--tools/source/datetime/ttime.cxx3
-rw-r--r--tools/source/stream/strmwnt.cxx3
-rw-r--r--vcl/opengl/win/WinDeviceInfo.cxx4
-rw-r--r--vcl/win/window/keynames.cxx3
-rw-r--r--vcl/win/window/salframe.cxx3
-rw-r--r--winaccessibility/inc/AccObject.hxx5
-rw-r--r--winaccessibility/inc/AccObjectWinManager.hxx3
-rw-r--r--winaccessibility/source/UAccCOM/stdafx.h3
-rw-r--r--xmlhelp/source/cxxhelp/provider/databases.cxx3
-rw-r--r--xmlsecurity/source/xmlsec/mscrypt/akmngr.hxx3
-rw-r--r--xmlsecurity/source/xmlsec/mscrypt/sanextension_mscryptimpl.hxx3
-rw-r--r--xmlsecurity/source/xmlsec/mscrypt/securityenvironment_mscryptimpl.cxx3
-rw-r--r--xmlsecurity/source/xmlsec/mscrypt/securityenvironment_mscryptimpl.hxx3
-rw-r--r--xmlsecurity/source/xmlsec/mscrypt/x509certificate_mscryptimpl.hxx3
39 files changed, 118 insertions, 26 deletions
diff --git a/bean/native/win32/com_sun_star_comp_beans_LocalOfficeWindow.c b/bean/native/win32/com_sun_star_comp_beans_LocalOfficeWindow.c
index 177d27630e67..dc3ee5b4bb35 100644
--- a/bean/native/win32/com_sun_star_comp_beans_LocalOfficeWindow.c
+++ b/bean/native/win32/com_sun_star_comp_beans_LocalOfficeWindow.c
@@ -20,6 +20,9 @@
#if defined _MSC_VER
#pragma warning(push, 1)
#endif
+#if !defined WIN32_LEAN_AND_MEAN
+# define WIN32_LEAN_AND_MEAN
+#endif
#include <windows.h>
#if defined _MSC_VER
#pragma warning(pop)
diff --git a/extensions/source/config/ldap/ldapaccess.hxx b/extensions/source/config/ldap/ldapaccess.hxx
index 4b101b371934..7f9cf6673fba 100644
--- a/extensions/source/config/ldap/ldapaccess.hxx
+++ b/extensions/source/config/ldap/ldapaccess.hxx
@@ -25,6 +25,9 @@
#include <map>
#ifdef _WIN32
+#if !defined WIN32_LEAN_AND_MEAN
+# define WIN32_LEAN_AND_MEAN
+#endif
#include <windows.h>
#include <winldap.h>
#else // !defined WNT
diff --git a/hwpfilter/source/mzstring.cxx b/hwpfilter/source/mzstring.cxx
index e5db9967f827..6b579e47b8f6 100644
--- a/hwpfilter/source/mzstring.cxx
+++ b/hwpfilter/source/mzstring.cxx
@@ -24,6 +24,9 @@
#include "mzstring.h"
#ifdef _WIN32
+# if !defined WIN32_LEAN_AND_MEAN
+# define WIN32_LEAN_AND_MEAN
+# endif
# include <windows.h>
#endif
#include <stdio.h>
diff --git a/idlc/source/options.cxx b/idlc/source/options.cxx
index b183c2bf6889..cbbd55b895a8 100644
--- a/idlc/source/options.cxx
+++ b/idlc/source/options.cxx
@@ -28,24 +28,12 @@
#include "osl/file.hxx"
#ifdef _WIN32
+# if !defined WIN32_LEAN_AND_MEAN
+# define WIN32_LEAN_AND_MEAN
+# endif
# include <windows.h>
#endif
-/*
-#ifndef WIN32_LEAN_AND_MEAN
-# define WIN32_LEAN_AND_MEAN
-# ifdef _MSC_VER
-# pragma warning(push,1)
-# endif
-# include <windows.h>
-# ifdef _MSC_VER
-# pragma warning(pop)
-# endif
-# include <tchar.h>
-# undef WIN32_LEAN_AND_MEAN
-#endif
-*/
-
#include <stdio.h>
#include <string.h>
diff --git a/include/connectivity/odbc.hxx b/include/connectivity/odbc.hxx
index 5ce6d8768070..a39a426975fc 100644
--- a/include/connectivity/odbc.hxx
+++ b/include/connectivity/odbc.hxx
@@ -32,6 +32,9 @@
// just to go with calling convention of windows
#if SYSTEM_ODBC_HEADERS
+#if !defined WIN32_LEAN_AND_MEAN
+# define WIN32_LEAN_AND_MEAN
+#endif
#include <windows.h>
#define SQL_API __stdcall
#include <sqlext.h>
diff --git a/l10ntools/source/helpmerge.cxx b/l10ntools/source/helpmerge.cxx
index 1933afdd6325..19aee8aa84a2 100644
--- a/l10ntools/source/helpmerge.cxx
+++ b/l10ntools/source/helpmerge.cxx
@@ -36,6 +36,9 @@
#include <vector>
#include <rtl/strbuf.hxx>
#ifdef _WIN32
+#if !defined WIN32_LEAN_AND_MEAN
+# define WIN32_LEAN_AND_MEAN
+#endif
#include <windows.h>
#undef CopyFile
#include <direct.h>
diff --git a/lingucomponent/source/lingutil/lingutil.cxx b/lingucomponent/source/lingutil/lingutil.cxx
index ee7981a46b1b..ab45124575c1 100644
--- a/lingucomponent/source/lingutil/lingutil.cxx
+++ b/lingucomponent/source/lingutil/lingutil.cxx
@@ -18,6 +18,9 @@
*/
#if defined(_WIN32)
+#if !defined WIN32_LEAN_AND_MEAN
+# define WIN32_LEAN_AND_MEAN
+#endif
#include <windows.h>
#endif
diff --git a/sal/osl/w32/backtrace.cxx b/sal/osl/w32/backtrace.cxx
index 574e4a450f48..b8866322e940 100644
--- a/sal/osl/w32/backtrace.cxx
+++ b/sal/osl/w32/backtrace.cxx
@@ -12,6 +12,9 @@
#include <limits>
#include <memory>
+#if !defined WIN32_LEAN_AND_MEAN
+# define WIN32_LEAN_AND_MEAN
+#endif
#include <windows.h>
#include <process.h>
#include <iostream>
diff --git a/sal/osl/w32/dllentry.cxx b/sal/osl/w32/dllentry.cxx
index 0bce302e935a..bc575ac5b7d8 100644
--- a/sal/osl/w32/dllentry.cxx
+++ b/sal/osl/w32/dllentry.cxx
@@ -17,19 +17,13 @@
* the License at http://www.apache.org/licenses/LICENSE-2.0 .
*/
-#ifdef _MSC_VER
-#pragma warning(push,1) /* disable warnings within system headers */
-#endif
-#include <windows.h>
-#ifdef _MSC_VER
-#pragma warning(pop)
+#include <systools/win32/uwinapi.h>
+#include <tlhelp32.h>
+#include <rpc.h>
+#include <winsock.h>
#ifdef _DEBUG
#include <crtdbg.h>
#endif
-#endif
-#include <tlhelp32.h>
-#include <systools/win32/uwinapi.h>
-#include <winsock.h>
#include <osl/diagnose.h>
#include <sal/types.h>
#include <float.h>
diff --git a/setup_native/source/win32/customactions/regactivex/regactivex.cxx b/setup_native/source/win32/customactions/regactivex/regactivex.cxx
index b0be045b7f25..b7e4cedf6a8c 100644
--- a/setup_native/source/win32/customactions/regactivex/regactivex.cxx
+++ b/setup_native/source/win32/customactions/regactivex/regactivex.cxx
@@ -22,6 +22,9 @@
#ifdef _MSC_VER
#pragma warning(push, 1) /* disable warnings within system headers */
#endif
+#if !defined WIN32_LEAN_AND_MEAN
+# define WIN32_LEAN_AND_MEAN
+#endif
#include <windows.h>
#include <msiquery.h>
#ifdef _MSC_VER
diff --git a/shell/inc/spsupp/registrar.hpp b/shell/inc/spsupp/registrar.hpp
index 21f0c22d9688..a2a2db49616a 100644
--- a/shell/inc/spsupp/registrar.hpp
+++ b/shell/inc/spsupp/registrar.hpp
@@ -10,6 +10,9 @@
#ifndef INCLUDED_SHELL_INC_SPSUPP_REGISTRAR_H
#define INCLUDED_SHELL_INC_SPSUPP_REGISTRAR_H
+#if !defined WIN32_LEAN_AND_MEAN
+# define WIN32_LEAN_AND_MEAN
+#endif
#include "windows.h"
class Registrar {
diff --git a/shell/source/backends/localebe/localebackend.cxx b/shell/source/backends/localebe/localebackend.cxx
index d51571071ab4..ff9b81b406b6 100644
--- a/shell/source/backends/localebe/localebackend.cxx
+++ b/shell/source/backends/localebe/localebackend.cxx
@@ -34,6 +34,9 @@
#if defined _MSC_VER
#pragma warning(push, 1)
#endif
+#if !defined WIN32_LEAN_AND_MEAN
+# define WIN32_LEAN_AND_MEAN
+#endif
#include <windows.h>
#if defined _MSC_VER
#pragma warning(pop)
diff --git a/shell/source/backends/wininetbe/wininetbackend.cxx b/shell/source/backends/wininetbe/wininetbackend.cxx
index d6af801ad9b0..9f4f2d8f9556 100644
--- a/shell/source/backends/wininetbe/wininetbackend.cxx
+++ b/shell/source/backends/wininetbe/wininetbackend.cxx
@@ -25,6 +25,9 @@
#if defined _MSC_VER
#pragma warning(push, 1)
#endif
+#if !defined WIN32_LEAN_AND_MEAN
+# define WIN32_LEAN_AND_MEAN
+#endif
#include <windows.h>
#include <wininet.h>
#include <sal/alloca.h>
diff --git a/shell/source/win32/shlxthandler/ooofilt/ooofilt.cxx b/shell/source/win32/shlxthandler/ooofilt/ooofilt.cxx
index f312c8927de8..c1df310962cc 100644
--- a/shell/source/win32/shlxthandler/ooofilt/ooofilt.cxx
+++ b/shell/source/win32/shlxthandler/ooofilt/ooofilt.cxx
@@ -48,6 +48,9 @@
#if defined _MSC_VER
#pragma warning(push, 1)
#endif
+#if !defined WIN32_LEAN_AND_MEAN
+# define WIN32_LEAN_AND_MEAN
+#endif
#include <windows.h>
#if defined _MSC_VER
#pragma warning(pop)
diff --git a/shell/source/win32/shlxthandler/ooofilt/propspec.cxx b/shell/source/win32/shlxthandler/ooofilt/propspec.cxx
index 1defe9644852..88a194e9a603 100644
--- a/shell/source/win32/shlxthandler/ooofilt/propspec.cxx
+++ b/shell/source/win32/shlxthandler/ooofilt/propspec.cxx
@@ -29,6 +29,9 @@
#if defined _MSC_VER
#pragma warning(push, 1)
#endif
+#if !defined WIN32_LEAN_AND_MEAN
+# define WIN32_LEAN_AND_MEAN
+#endif
#include <windows.h>
#include <filter.h>
#if defined _MSC_VER
diff --git a/shell/source/win32/shlxthandler/ooofilt/propspec.hxx b/shell/source/win32/shlxthandler/ooofilt/propspec.hxx
index 963493c0a49c..bd771407fedf 100644
--- a/shell/source/win32/shlxthandler/ooofilt/propspec.hxx
+++ b/shell/source/win32/shlxthandler/ooofilt/propspec.hxx
@@ -27,6 +27,9 @@
#if defined _MSC_VER
#pragma warning(push, 1)
#endif
+#if !defined WIN32_LEAN_AND_MEAN
+# define WIN32_LEAN_AND_MEAN
+#endif
#include <windows.h>
#include <ole2.h>
#include <ntquery.h>
diff --git a/shell/source/win32/shlxthandler/ooofilt/stream_helper.cxx b/shell/source/win32/shlxthandler/ooofilt/stream_helper.cxx
index b53c56410c3f..5d8e67c58b0f 100644
--- a/shell/source/win32/shlxthandler/ooofilt/stream_helper.cxx
+++ b/shell/source/win32/shlxthandler/ooofilt/stream_helper.cxx
@@ -21,6 +21,9 @@
#if defined _MSC_VER
#pragma warning(push, 1)
#endif
+#if !defined WIN32_LEAN_AND_MEAN
+# define WIN32_LEAN_AND_MEAN
+#endif
#include <windows.h>
#if defined _MSC_VER
#pragma warning(pop)
diff --git a/shell/source/win32/shlxthandler/propsheets/listviewbuilder.hxx b/shell/source/win32/shlxthandler/propsheets/listviewbuilder.hxx
index 300c269c7e4d..1555c1fec3ed 100644
--- a/shell/source/win32/shlxthandler/propsheets/listviewbuilder.hxx
+++ b/shell/source/win32/shlxthandler/propsheets/listviewbuilder.hxx
@@ -23,6 +23,9 @@
#if defined _MSC_VER
#pragma warning(push, 1)
#endif
+#if !defined WIN32_LEAN_AND_MEAN
+# define WIN32_LEAN_AND_MEAN
+#endif
#include <windows.h>
#if defined _MSC_VER
#pragma warning(pop)
diff --git a/shell/source/win32/shlxthandler/util/registry.cxx b/shell/source/win32/shlxthandler/util/registry.cxx
index 9a6480962aa8..9c76be19cab2 100644
--- a/shell/source/win32/shlxthandler/util/registry.cxx
+++ b/shell/source/win32/shlxthandler/util/registry.cxx
@@ -21,6 +21,9 @@
#if defined _MSC_VER
#pragma warning(push, 1)
#endif
+#if !defined WIN32_LEAN_AND_MEAN
+# define WIN32_LEAN_AND_MEAN
+#endif
#include <windows.h>
#if defined _MSC_VER
#pragma warning(pop)
diff --git a/shell/source/win32/spsupp/registrar.cxx b/shell/source/win32/spsupp/registrar.cxx
index 5d49efe7c88c..9a5718dcd884 100644
--- a/shell/source/win32/spsupp/registrar.cxx
+++ b/shell/source/win32/spsupp/registrar.cxx
@@ -9,6 +9,7 @@
#include "registrar.hpp"
#include "wchar.h"
+#include "objbase.h"
namespace {
diff --git a/soltools/mkdepend/collectdircontent.hxx b/soltools/mkdepend/collectdircontent.hxx
index 09a0ed518d1c..bc4160a7437d 100644
--- a/soltools/mkdepend/collectdircontent.hxx
+++ b/soltools/mkdepend/collectdircontent.hxx
@@ -9,6 +9,9 @@
#include <string>
#if defined(_WIN32)
+#if !defined WIN32_LEAN_AND_MEAN
+# define WIN32_LEAN_AND_MEAN
+#endif
#include <windows.h>
#include <algorithm>
#else
diff --git a/svl/source/config/languageoptions.cxx b/svl/source/config/languageoptions.cxx
index c7314aede9ce..bb256d9f70f3 100644
--- a/svl/source/config/languageoptions.cxx
+++ b/svl/source/config/languageoptions.cxx
@@ -30,6 +30,9 @@
#include "officecfg/System.hxx"
#ifdef _WIN32
+#if !defined WIN32_LEAN_AND_MEAN
+# define WIN32_LEAN_AND_MEAN
+#endif
#include <windows.h>
#endif
diff --git a/svl/source/svdde/ddeimp.hxx b/svl/source/svdde/ddeimp.hxx
index b891a1509476..22df0864002e 100644
--- a/svl/source/svdde/ddeimp.hxx
+++ b/svl/source/svdde/ddeimp.hxx
@@ -20,6 +20,9 @@
#ifndef INCLUDED_SVL_SOURCE_SVDDE_DDEIMP_HXX
#define INCLUDED_SVL_SOURCE_SVDDE_DDEIMP_HXX
+#if !defined WIN32_LEAN_AND_MEAN
+# define WIN32_LEAN_AND_MEAN
+#endif
#include <windows.h>
#include <ddeml.h>
diff --git a/sw/source/ui/vba/vbasystem.cxx b/sw/source/ui/vba/vbasystem.cxx
index 270d22dd2fd7..c98df33e3595 100644
--- a/sw/source/ui/vba/vbasystem.cxx
+++ b/sw/source/ui/vba/vbasystem.cxx
@@ -29,6 +29,9 @@
#pragma warning (push, 1)
#pragma warning (disable: 4005)
#endif
+#if !defined WIN32_LEAN_AND_MEAN
+# define WIN32_LEAN_AND_MEAN
+#endif
#include <windows.h>
#if defined _MSC_VER
#pragma warning (pop)
diff --git a/tools/source/datetime/tdate.cxx b/tools/source/datetime/tdate.cxx
index 899f5c1b819e..93cf49b0ce9c 100644
--- a/tools/source/datetime/tdate.cxx
+++ b/tools/source/datetime/tdate.cxx
@@ -18,6 +18,9 @@
*/
#if defined(_WIN32)
+#if !defined WIN32_LEAN_AND_MEAN
+# define WIN32_LEAN_AND_MEAN
+#endif
#include <windows.h>
#else
#include <time.h>
diff --git a/tools/source/datetime/ttime.cxx b/tools/source/datetime/ttime.cxx
index 4f469906118e..d02cf20ac257 100644
--- a/tools/source/datetime/ttime.cxx
+++ b/tools/source/datetime/ttime.cxx
@@ -22,6 +22,9 @@
#include <cerrno>
#if defined(_WIN32)
+#if !defined WIN32_LEAN_AND_MEAN
+# define WIN32_LEAN_AND_MEAN
+#endif
#include <windows.h>
#include <mmsystem.h>
#elif defined UNX
diff --git a/tools/source/stream/strmwnt.cxx b/tools/source/stream/strmwnt.cxx
index 1635ed42a3a8..3c629b1b9cba 100644
--- a/tools/source/stream/strmwnt.cxx
+++ b/tools/source/stream/strmwnt.cxx
@@ -23,6 +23,9 @@
#include <limits.h>
#ifdef _WIN32
+#if !defined WIN32_LEAN_AND_MEAN
+# define WIN32_LEAN_AND_MEAN
+#endif
#include <windows.h>
#endif
diff --git a/vcl/opengl/win/WinDeviceInfo.cxx b/vcl/opengl/win/WinDeviceInfo.cxx
index cb9f1d2943e6..2ec963491327 100644
--- a/vcl/opengl/win/WinDeviceInfo.cxx
+++ b/vcl/opengl/win/WinDeviceInfo.cxx
@@ -12,7 +12,11 @@
#include "opengl/win/blocklist_parser.hxx"
#include <config_folders.h>
+#if !defined WIN32_LEAN_AND_MEAN
+# define WIN32_LEAN_AND_MEAN
+#endif
#include <windows.h>
+#include <objbase.h>
#include <setupapi.h>
#include <algorithm>
#include <cstdint>
diff --git a/vcl/win/window/keynames.cxx b/vcl/win/window/keynames.cxx
index c6c41001c07e..6ca192ba7d5c 100644
--- a/vcl/win/window/keynames.cxx
+++ b/vcl/win/window/keynames.cxx
@@ -23,6 +23,9 @@
#include <win/salframe.h>
+#if !defined WIN32_LEAN_AND_MEAN
+# define WIN32_LEAN_AND_MEAN
+#endif
#include <windows.h>
// Use unique ;) names to avoid clashes with the KEY_* (especially
diff --git a/vcl/win/window/salframe.cxx b/vcl/win/window/salframe.cxx
index 4bcb1d6e09da..e2c444a3e182 100644
--- a/vcl/win/window/salframe.cxx
+++ b/vcl/win/window/salframe.cxx
@@ -88,6 +88,9 @@
#include <time.h>
+#if !defined WIN32_LEAN_AND_MEAN
+# define WIN32_LEAN_AND_MEAN
+#endif
#include <windows.h>
#include <shobjidl.h>
#include <propkey.h>
diff --git a/winaccessibility/inc/AccObject.hxx b/winaccessibility/inc/AccObject.hxx
index 89ae14b5e011..74c5ac129c1a 100644
--- a/winaccessibility/inc/AccObject.hxx
+++ b/winaccessibility/inc/AccObject.hxx
@@ -22,8 +22,11 @@
#include <vector>
#include <map>
-#include <oleacc.h>
+#if !defined WIN32_LEAN_AND_MEAN
+# define WIN32_LEAN_AND_MEAN
+#endif
#include <windows.h>
+#include <oleacc.h>
#include <rtl/ref.hxx>
diff --git a/winaccessibility/inc/AccObjectWinManager.hxx b/winaccessibility/inc/AccObjectWinManager.hxx
index df90cc80b993..259aebf6adb8 100644
--- a/winaccessibility/inc/AccObjectWinManager.hxx
+++ b/winaccessibility/inc/AccObjectWinManager.hxx
@@ -22,6 +22,9 @@
#include <com/sun/star/accessibility/XAccessible.hpp>
#include <map>
+#if !defined WIN32_LEAN_AND_MEAN
+# define WIN32_LEAN_AND_MEAN
+#endif
#include <windows.h>
#include <rtl/ref.hxx>
#include "ResIDGenerator.hxx"
diff --git a/winaccessibility/source/UAccCOM/stdafx.h b/winaccessibility/source/UAccCOM/stdafx.h
index 12bf35a524d4..e25bfe98c450 100644
--- a/winaccessibility/source/UAccCOM/stdafx.h
+++ b/winaccessibility/source/UAccCOM/stdafx.h
@@ -31,6 +31,9 @@
#define _ATL_APARTMENT_THREADED
#include <prewin.h>
+#if !defined WIN32_LEAN_AND_MEAN
+# define WIN32_LEAN_AND_MEAN
+#endif
#include <windows.h>
#if defined __clang__
diff --git a/xmlhelp/source/cxxhelp/provider/databases.cxx b/xmlhelp/source/cxxhelp/provider/databases.cxx
index 4546d3b950de..9b16270d4d1f 100644
--- a/xmlhelp/source/cxxhelp/provider/databases.cxx
+++ b/xmlhelp/source/cxxhelp/provider/databases.cxx
@@ -68,6 +68,9 @@
#include "urlparameter.hxx"
#ifdef _WIN32
+#if !defined WIN32_LEAN_AND_MEAN
+# define WIN32_LEAN_AND_MEAN
+#endif
#include <windows.h>
#endif
diff --git a/xmlsecurity/source/xmlsec/mscrypt/akmngr.hxx b/xmlsecurity/source/xmlsec/mscrypt/akmngr.hxx
index 174c127d3ad8..670c80928f0a 100644
--- a/xmlsecurity/source/xmlsec/mscrypt/akmngr.hxx
+++ b/xmlsecurity/source/xmlsec/mscrypt/akmngr.hxx
@@ -19,6 +19,9 @@
#ifndef INCLUDED_XMLSECURITY_SOURCE_XMLSEC_MSCRYPT_AKMNGR_HXX
#define INCLUDED_XMLSECURITY_SOURCE_XMLSEC_MSCRYPT_AKMNGR_HXX
+#if !defined WIN32_LEAN_AND_MEAN
+# define WIN32_LEAN_AND_MEAN
+#endif
#include <windows.h>
#include <wincrypt.h>
diff --git a/xmlsecurity/source/xmlsec/mscrypt/sanextension_mscryptimpl.hxx b/xmlsecurity/source/xmlsec/mscrypt/sanextension_mscryptimpl.hxx
index 795e08d1a7cf..9fb5f3b76b64 100644
--- a/xmlsecurity/source/xmlsec/mscrypt/sanextension_mscryptimpl.hxx
+++ b/xmlsecurity/source/xmlsec/mscrypt/sanextension_mscryptimpl.hxx
@@ -23,6 +23,9 @@
#ifdef _MSC_VER
#pragma warning(push,1)
#endif
+#if !defined WIN32_LEAN_AND_MEAN
+# define WIN32_LEAN_AND_MEAN
+#endif
#include "Windows.h"
#include "WinCrypt.h"
#ifdef _MSC_VER
diff --git a/xmlsecurity/source/xmlsec/mscrypt/securityenvironment_mscryptimpl.cxx b/xmlsecurity/source/xmlsec/mscrypt/securityenvironment_mscryptimpl.cxx
index 93296b1b4221..8df7520a9897 100644
--- a/xmlsecurity/source/xmlsec/mscrypt/securityenvironment_mscryptimpl.cxx
+++ b/xmlsecurity/source/xmlsec/mscrypt/securityenvironment_mscryptimpl.cxx
@@ -25,6 +25,9 @@
#ifdef _MSC_VER
#pragma warning(push,1)
#endif
+#if !defined WIN32_LEAN_AND_MEAN
+# define WIN32_LEAN_AND_MEAN
+#endif
#include "Windows.h"
#include "WinCrypt.h"
#ifdef _MSC_VER
diff --git a/xmlsecurity/source/xmlsec/mscrypt/securityenvironment_mscryptimpl.hxx b/xmlsecurity/source/xmlsec/mscrypt/securityenvironment_mscryptimpl.hxx
index 4bed0b9005c5..5c29eb776cfa 100644
--- a/xmlsecurity/source/xmlsec/mscrypt/securityenvironment_mscryptimpl.hxx
+++ b/xmlsecurity/source/xmlsec/mscrypt/securityenvironment_mscryptimpl.hxx
@@ -23,6 +23,9 @@
#ifdef _MSC_VER
#pragma warning(push,1)
#endif
+#if !defined WIN32_LEAN_AND_MEAN
+# define WIN32_LEAN_AND_MEAN
+#endif
#include <windows.h>
#include <wincrypt.h>
#ifdef _MSC_VER
diff --git a/xmlsecurity/source/xmlsec/mscrypt/x509certificate_mscryptimpl.hxx b/xmlsecurity/source/xmlsec/mscrypt/x509certificate_mscryptimpl.hxx
index ce63a8acc170..fbfd59a422a9 100644
--- a/xmlsecurity/source/xmlsec/mscrypt/x509certificate_mscryptimpl.hxx
+++ b/xmlsecurity/source/xmlsec/mscrypt/x509certificate_mscryptimpl.hxx
@@ -23,6 +23,9 @@
#ifdef _MSC_VER
#pragma warning(push,1)
#endif
+#if !defined WIN32_LEAN_AND_MEAN
+# define WIN32_LEAN_AND_MEAN
+#endif
#include "Windows.h"
#include "WinCrypt.h"
#ifdef _MSC_VER