From da92def9fc7f1beccab5ed9518d5cd38c94a0d91 Mon Sep 17 00:00:00 2001 From: Birunthan Mohanathas Date: Tue, 24 Dec 2013 11:20:19 +0000 Subject: [PATCH] Define WIN32_LEAN_AND_MEAN globally --- Application/Application.cpp | 1 - Build/VS/Rainmeter.Cpp.props | 2 +- Common/Gfx/Canvas.h | 1 + Common/Gfx/CanvasD2D.h | 1 + Common/Gfx/CanvasGDIP.h | 1 + Common/Gfx/FontCollectionD2D.cpp | 1 + Common/Gfx/FontCollectionGDIP.cpp | 1 + Common/Gfx/TextFormatGDIP.h | 1 + Common/Gfx/Util/WICBitmapDIB.h | 1 + Common/Gfx/Util/WICBitmapLockDIB.h | 1 + Common/Gfx/Util/WICBitmapLockGDIP.h | 1 + Common/RawString.h | 12 ++++++------ Library/ConfigParser.h | 1 + Library/Meter.h | 1 + Library/StdAfx.h | 3 +-- Library/TintedImage.h | 1 + Library/TrayWindow.h | 1 + Plugins/PluginFileView/StdAfx.h | 1 + Plugins/PluginNowPlaying/StdAfx.h | 1 + Plugins/PluginPing/Ping.cpp | 1 + Plugins/PluginPower/PowerPlugin.cpp | 1 + Plugins/PluginRecycleManager/RecycleManager.cpp | 1 - Plugins/PluginSysInfo/SysInfo.cpp | 1 - Plugins/PluginWin7Audio/PolicyConfig.h | 2 ++ SkinInstaller/SkinInstallerLauncher.cpp | 1 - SkinInstaller/StdAfx.h | 1 - 26 files changed, 27 insertions(+), 14 deletions(-) diff --git a/Application/Application.cpp b/Application/Application.cpp index ee54ba7e..30fabb26 100644 --- a/Application/Application.cpp +++ b/Application/Application.cpp @@ -17,7 +17,6 @@ */ #define _CRTDBG_MAP_ALLOC -#define WIN32_LEAN_AND_MEAN #include #include #include diff --git a/Build/VS/Rainmeter.Cpp.props b/Build/VS/Rainmeter.Cpp.props index df45b8c4..b59979c5 100644 --- a/Build/VS/Rainmeter.Cpp.props +++ b/Build/VS/Rainmeter.Cpp.props @@ -58,7 +58,7 @@ 4351;4530 - WIN32;_WINDOWS;WINVER=0x0601;_WIN32_WINNT=0x0601;_WIN32_IE=0x0601;PSAPI_VERSION=1;_CRT_SECURE_NO_WARNINGS;%(PreprocessorDefinitions) + WIN32;_WINDOWS;WINVER=0x0601;_WIN32_WINNT=0x0601;_WIN32_IE=0x0601;PSAPI_VERSION=1;_CRT_SECURE_NO_WARNINGS;WIN32_LEAN_AND_MEAN;%(PreprocessorDefinitions) Level3 diff --git a/Common/Gfx/Canvas.h b/Common/Gfx/Canvas.h index 5b7b88dd..160c5a83 100644 --- a/Common/Gfx/Canvas.h +++ b/Common/Gfx/Canvas.h @@ -22,6 +22,7 @@ #include "FontCollection.h" #include "TextFormat.h" #include +#include // For Gdiplus.h. #include namespace Gfx { diff --git a/Common/Gfx/CanvasD2D.h b/Common/Gfx/CanvasD2D.h index 25039761..5e0dea73 100644 --- a/Common/Gfx/CanvasD2D.h +++ b/Common/Gfx/CanvasD2D.h @@ -25,6 +25,7 @@ #include "Util/WICBitmapDIB.h" #include #include +#include // For Gdiplus.h. #include #include #include diff --git a/Common/Gfx/CanvasGDIP.h b/Common/Gfx/CanvasGDIP.h index 7205e2bf..5ba39260 100644 --- a/Common/Gfx/CanvasGDIP.h +++ b/Common/Gfx/CanvasGDIP.h @@ -24,6 +24,7 @@ #include "TextFormatGDIP.h" #include #include +#include // For Gdiplus.h. #include namespace Gfx { diff --git a/Common/Gfx/FontCollectionD2D.cpp b/Common/Gfx/FontCollectionD2D.cpp index ab0837ea..3eb2a5d2 100644 --- a/Common/Gfx/FontCollectionD2D.cpp +++ b/Common/Gfx/FontCollectionD2D.cpp @@ -19,6 +19,7 @@ #include "FontCollectionD2D.h" #include "CanvasD2D.h" #include "Util/DWriteFontCollectionLoader.h" +#include // For Gdiplus.h. #include namespace Gfx { diff --git a/Common/Gfx/FontCollectionGDIP.cpp b/Common/Gfx/FontCollectionGDIP.cpp index cbcd61ec..9e5dcc32 100644 --- a/Common/Gfx/FontCollectionGDIP.cpp +++ b/Common/Gfx/FontCollectionGDIP.cpp @@ -17,6 +17,7 @@ */ #include "FontCollectionGDIP.h" +#include // For Gdiplus.h. #include namespace Gfx { diff --git a/Common/Gfx/TextFormatGDIP.h b/Common/Gfx/TextFormatGDIP.h index 010130a8..d12e20c6 100644 --- a/Common/Gfx/TextFormatGDIP.h +++ b/Common/Gfx/TextFormatGDIP.h @@ -21,6 +21,7 @@ #include "TextFormat.h" #include +#include // For Gdiplus.h. #include namespace Gfx { diff --git a/Common/Gfx/Util/WICBitmapDIB.h b/Common/Gfx/Util/WICBitmapDIB.h index 38d7932c..0cdd4a4b 100644 --- a/Common/Gfx/Util/WICBitmapDIB.h +++ b/Common/Gfx/Util/WICBitmapDIB.h @@ -20,6 +20,7 @@ #define RM_GFX_UTIL_WICBITMAPDIB_H_ #include +#include // For Gdiplus.h. #include #include diff --git a/Common/Gfx/Util/WICBitmapLockDIB.h b/Common/Gfx/Util/WICBitmapLockDIB.h index 0222a5fc..96b9f376 100644 --- a/Common/Gfx/Util/WICBitmapLockDIB.h +++ b/Common/Gfx/Util/WICBitmapLockDIB.h @@ -20,6 +20,7 @@ #define RM_GFX_UTIL_WICBITMAPLOCKDIB_H_ #include +#include // For Gdiplus.h. #include #include #include "WICBitmapDIB.h" diff --git a/Common/Gfx/Util/WICBitmapLockGDIP.h b/Common/Gfx/Util/WICBitmapLockGDIP.h index a2ac6ede..13c997e8 100644 --- a/Common/Gfx/Util/WICBitmapLockGDIP.h +++ b/Common/Gfx/Util/WICBitmapLockGDIP.h @@ -20,6 +20,7 @@ #define RM_GFX_UTIL_WICBITMAPLOCKGDIP_H_ #include +#include // For Gdiplus.h. #include #include diff --git a/Common/RawString.h b/Common/RawString.h index c93a08a0..ef3c3f30 100644 --- a/Common/RawString.h +++ b/Common/RawString.h @@ -19,7 +19,7 @@ #ifndef RM_COMMON_RAWSTRING_H_ #define RM_COMMON_RAWSTRING_H_ -#include +#include class RawString { @@ -29,7 +29,7 @@ public: { } - RawString(const WCHAR* str) : + RawString(const wchar_t* str) : m_String(str_alloc(str)) { } @@ -44,7 +44,7 @@ public: clear(); } - RawString& operator=(const WCHAR* rhs) + RawString& operator=(const wchar_t* rhs) { clear(); m_String = str_alloc(rhs); @@ -61,7 +61,7 @@ public: return *this; } - const WCHAR* c_str() const + const wchar_t* c_str() const { return m_String ? m_String : L""; } @@ -81,12 +81,12 @@ public: } private: - WCHAR* str_alloc(const WCHAR* str) + wchar_t* str_alloc(const wchar_t* str) { return str ? _wcsdup(str) : nullptr; } - WCHAR* m_String; + wchar_t* m_String; }; #endif diff --git a/Library/ConfigParser.h b/Library/ConfigParser.h index 65b20980..d8c6d54a 100644 --- a/Library/ConfigParser.h +++ b/Library/ConfigParser.h @@ -28,6 +28,7 @@ #include #include #include +#include // For Gdiplus.h. #include class Rainmeter; diff --git a/Library/Meter.h b/Library/Meter.h index ce44da3b..a63a2e09 100644 --- a/Library/Meter.h +++ b/Library/Meter.h @@ -20,6 +20,7 @@ #define __METER_H__ #include +#include // For Gdiplus.h. #include #include #include diff --git a/Library/StdAfx.h b/Library/StdAfx.h index be55f7e4..84826088 100644 --- a/Library/StdAfx.h +++ b/Library/StdAfx.h @@ -23,11 +23,10 @@ #include // WINAPI -#define WIN32_LEAN_AND_MEAN #include #include #include -#include +#include // For Gdiplus.h. #include #include #include diff --git a/Library/TintedImage.h b/Library/TintedImage.h index 63eb16f4..ba982514 100644 --- a/Library/TintedImage.h +++ b/Library/TintedImage.h @@ -20,6 +20,7 @@ #define __TINTEDIMAGE_H__ #include +#include // For Gdiplus.h. #include #include #include "MeterWindow.h" diff --git a/Library/TrayWindow.h b/Library/TrayWindow.h index 419cf863..ae7df7cd 100644 --- a/Library/TrayWindow.h +++ b/Library/TrayWindow.h @@ -20,6 +20,7 @@ #define __TRAYWINDOW_H__ #include +#include // For Gdiplus.h. #include #include diff --git a/Plugins/PluginFileView/StdAfx.h b/Plugins/PluginFileView/StdAfx.h index b932eac0..09d50e79 100644 --- a/Plugins/PluginFileView/StdAfx.h +++ b/Plugins/PluginFileView/StdAfx.h @@ -24,6 +24,7 @@ #include #include #include +#include #include // STL diff --git a/Plugins/PluginNowPlaying/StdAfx.h b/Plugins/PluginNowPlaying/StdAfx.h index a0038f87..ab410e85 100644 --- a/Plugins/PluginNowPlaying/StdAfx.h +++ b/Plugins/PluginNowPlaying/StdAfx.h @@ -24,6 +24,7 @@ #include #include #include +#include // STL #include diff --git a/Plugins/PluginPing/Ping.cpp b/Plugins/PluginPing/Ping.cpp index fd6a6f8b..16f57437 100644 --- a/Plugins/PluginPing/Ping.cpp +++ b/Plugins/PluginPing/Ping.cpp @@ -17,6 +17,7 @@ */ #include +#include #include #include #include diff --git a/Plugins/PluginPower/PowerPlugin.cpp b/Plugins/PluginPower/PowerPlugin.cpp index e9ba1297..b531bcfe 100644 --- a/Plugins/PluginPower/PowerPlugin.cpp +++ b/Plugins/PluginPower/PowerPlugin.cpp @@ -21,6 +21,7 @@ #include #include #include +#include #include "../../Common/RawString.h" #include "../../Library/Export.h" // Rainmeter's exported functions diff --git a/Plugins/PluginRecycleManager/RecycleManager.cpp b/Plugins/PluginRecycleManager/RecycleManager.cpp index 184f602a..b9233ec5 100644 --- a/Plugins/PluginRecycleManager/RecycleManager.cpp +++ b/Plugins/PluginRecycleManager/RecycleManager.cpp @@ -16,7 +16,6 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ -#define WIN32_LEAN_AND_MEAN #include #include #include diff --git a/Plugins/PluginSysInfo/SysInfo.cpp b/Plugins/PluginSysInfo/SysInfo.cpp index cab8d47f..fa652023 100644 --- a/Plugins/PluginSysInfo/SysInfo.cpp +++ b/Plugins/PluginSysInfo/SysInfo.cpp @@ -16,7 +16,6 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ -#define WIN32_LEAN_AND_MEAN #include #include #include diff --git a/Plugins/PluginWin7Audio/PolicyConfig.h b/Plugins/PluginWin7Audio/PolicyConfig.h index 605998b8..e4e07fbd 100644 --- a/Plugins/PluginWin7Audio/PolicyConfig.h +++ b/Plugins/PluginWin7Audio/PolicyConfig.h @@ -8,6 +8,8 @@ #pragma once +#include + // ---------------------------------------------------------------------------- // class CPolicyConfigClient // {294935CE-F637-4E7C-A41B-AB255460B862} diff --git a/SkinInstaller/SkinInstallerLauncher.cpp b/SkinInstaller/SkinInstallerLauncher.cpp index d514fca7..9508fce9 100644 --- a/SkinInstaller/SkinInstallerLauncher.cpp +++ b/SkinInstaller/SkinInstallerLauncher.cpp @@ -16,7 +16,6 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ -#define WIN32_LEAN_AND_MEAN #include #include diff --git a/SkinInstaller/StdAfx.h b/SkinInstaller/StdAfx.h index fecead05..774226f4 100644 --- a/SkinInstaller/StdAfx.h +++ b/SkinInstaller/StdAfx.h @@ -20,7 +20,6 @@ #define __STDAFX_H__ // WINAPI -#define WIN32_LEAN_AND_MEAN #include #include #include