Skip to content

Commit

Permalink
Define WIN32_LEAN_AND_MEAN globally
Browse files Browse the repository at this point in the history
  • Loading branch information
poiru committed Dec 24, 2013
1 parent c196396 commit da92def
Show file tree
Hide file tree
Showing 26 changed files with 27 additions and 14 deletions.
1 change: 0 additions & 1 deletion Application/Application.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@
*/

#define _CRTDBG_MAP_ALLOC
#define WIN32_LEAN_AND_MEAN
#include <crtdbg.h>
#include <Windows.h>
#include <ShellAPI.h>
Expand Down
2 changes: 1 addition & 1 deletion Build/VS/Rainmeter.Cpp.props
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@
<DisableSpecificWarnings>4351;4530</DisableSpecificWarnings>

<!-- Set the version macros to 0x0601 (Win7) to avoid using Win8 specific features in the Win8 SDK. -->
<PreprocessorDefinitions>WIN32;_WINDOWS;WINVER=0x0601;_WIN32_WINNT=0x0601;_WIN32_IE=0x0601;PSAPI_VERSION=1;_CRT_SECURE_NO_WARNINGS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<PreprocessorDefinitions>WIN32;_WINDOWS;WINVER=0x0601;_WIN32_WINNT=0x0601;_WIN32_IE=0x0601;PSAPI_VERSION=1;_CRT_SECURE_NO_WARNINGS;WIN32_LEAN_AND_MEAN;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<WarningLevel>Level3</WarningLevel>
</ClCompile>
<Link>
Expand Down
1 change: 1 addition & 0 deletions Common/Gfx/Canvas.h
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
#include "FontCollection.h"
#include "TextFormat.h"
#include <Windows.h>
#include <ole2.h> // For Gdiplus.h.
#include <GdiPlus.h>

namespace Gfx {
Expand Down
1 change: 1 addition & 0 deletions Common/Gfx/CanvasD2D.h
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@
#include "Util/WICBitmapDIB.h"
#include <memory>
#include <string>
#include <ole2.h> // For Gdiplus.h.
#include <GdiPlus.h>
#include <d2d1_1.h>
#include <d2d1helper.h>
Expand Down
1 change: 1 addition & 0 deletions Common/Gfx/CanvasGDIP.h
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@
#include "TextFormatGDIP.h"
#include <memory>
#include <string>
#include <ole2.h> // For Gdiplus.h.
#include <GdiPlus.h>

namespace Gfx {
Expand Down
1 change: 1 addition & 0 deletions Common/Gfx/FontCollectionD2D.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
#include "FontCollectionD2D.h"
#include "CanvasD2D.h"
#include "Util/DWriteFontCollectionLoader.h"
#include <ole2.h> // For Gdiplus.h.
#include <GdiPlus.h>

namespace Gfx {
Expand Down
1 change: 1 addition & 0 deletions Common/Gfx/FontCollectionGDIP.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
*/

#include "FontCollectionGDIP.h"
#include <ole2.h> // For Gdiplus.h.
#include <GdiPlus.h>

namespace Gfx {
Expand Down
1 change: 1 addition & 0 deletions Common/Gfx/TextFormatGDIP.h
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@

#include "TextFormat.h"
#include <memory>
#include <ole2.h> // For Gdiplus.h.
#include <GdiPlus.h>

namespace Gfx {
Expand Down
1 change: 1 addition & 0 deletions Common/Gfx/Util/WICBitmapDIB.h
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
#define RM_GFX_UTIL_WICBITMAPDIB_H_

#include <Windows.h>
#include <ole2.h> // For Gdiplus.h.
#include <GdiPlus.h>
#include <wincodec.h>

Expand Down
1 change: 1 addition & 0 deletions Common/Gfx/Util/WICBitmapLockDIB.h
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
#define RM_GFX_UTIL_WICBITMAPLOCKDIB_H_

#include <Windows.h>
#include <ole2.h> // For Gdiplus.h.
#include <GdiPlus.h>
#include <wincodec.h>
#include "WICBitmapDIB.h"
Expand Down
1 change: 1 addition & 0 deletions Common/Gfx/Util/WICBitmapLockGDIP.h
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
#define RM_GFX_UTIL_WICBITMAPLOCKGDIP_H_

#include <Windows.h>
#include <ole2.h> // For Gdiplus.h.
#include <GdiPlus.h>
#include <wincodec.h>

Expand Down
12 changes: 6 additions & 6 deletions Common/RawString.h
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
#ifndef RM_COMMON_RAWSTRING_H_
#define RM_COMMON_RAWSTRING_H_

#include <windows.h>
#include <malloc.h>

class RawString
{
Expand All @@ -29,7 +29,7 @@ class RawString
{
}

RawString(const WCHAR* str) :
RawString(const wchar_t* str) :
m_String(str_alloc(str))
{
}
Expand All @@ -44,7 +44,7 @@ class RawString
clear();
}

RawString& operator=(const WCHAR* rhs)
RawString& operator=(const wchar_t* rhs)
{
clear();
m_String = str_alloc(rhs);
Expand All @@ -61,7 +61,7 @@ class RawString
return *this;
}

const WCHAR* c_str() const
const wchar_t* c_str() const
{
return m_String ? m_String : L"";
}
Expand All @@ -81,12 +81,12 @@ class RawString
}

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
1 change: 1 addition & 0 deletions Library/ConfigParser.h
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@
#include <unordered_map>
#include <algorithm>
#include <cstdint>
#include <ole2.h> // For Gdiplus.h.
#include <gdiplus.h>

class Rainmeter;
Expand Down
1 change: 1 addition & 0 deletions Library/Meter.h
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
#define __METER_H__

#include <windows.h>
#include <ole2.h> // For Gdiplus.h.
#include <gdiplus.h>
#include <vector>
#include <string>
Expand Down
3 changes: 1 addition & 2 deletions Library/StdAfx.h
Original file line number Diff line number Diff line change
Expand Up @@ -23,11 +23,10 @@
#include <crtdbg.h>

// WINAPI
#define WIN32_LEAN_AND_MEAN
#include <ws2tcpip.h>
#include <windows.h>
#include <windowsx.h>
#include <ole2.h>
#include <ole2.h> // For Gdiplus.h.
#include <gdiplus.h>
#include <dwmapi.h>
#include <comdef.h>
Expand Down
1 change: 1 addition & 0 deletions Library/TintedImage.h
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
#define __TINTEDIMAGE_H__

#include <windows.h>
#include <ole2.h> // For Gdiplus.h.
#include <gdiplus.h>
#include <string>
#include "MeterWindow.h"
Expand Down
1 change: 1 addition & 0 deletions Library/TrayWindow.h
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
#define __TRAYWINDOW_H__

#include <windows.h>
#include <ole2.h> // For Gdiplus.h.
#include <gdiplus.h>
#include <vector>

Expand Down
1 change: 1 addition & 0 deletions Plugins/PluginFileView/StdAfx.h
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@
#include <commctrl.h>
#include <commoncontrols.h>
#include <process.h>
#include <Shellapi.h>
#include <Shlwapi.h>

// STL
Expand Down
1 change: 1 addition & 0 deletions Plugins/PluginNowPlaying/StdAfx.h
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@
#include <WinInet.h>
#include <Psapi.h>
#include <comutil.h>
#include <ShellAPI.h>

// STL
#include <string>
Expand Down
1 change: 1 addition & 0 deletions Plugins/PluginPing/Ping.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
*/

#include <windows.h>
#include <Winsock2.h>
#include <string>
#include <Ipexport.h>
#include <Icmpapi.h>
Expand Down
1 change: 1 addition & 0 deletions Plugins/PluginPower/PowerPlugin.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
#include <time.h>
#include <errno.h>
#include <crtdbg.h>
#include <stdlib.h>
#include "../../Common/RawString.h"
#include "../../Library/Export.h" // Rainmeter's exported functions

Expand Down
1 change: 0 additions & 1 deletion Plugins/PluginRecycleManager/RecycleManager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/

#define WIN32_LEAN_AND_MEAN
#include <Windows.h>
#include <ShellAPI.h>
#include <process.h>
Expand Down
1 change: 0 additions & 1 deletion Plugins/PluginSysInfo/SysInfo.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/

#define WIN32_LEAN_AND_MEAN
#include <windows.h>
#include <Iphlpapi.h>
#include <Netlistmgr.h>
Expand Down
2 changes: 2 additions & 0 deletions Plugins/PluginWin7Audio/PolicyConfig.h
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@

#pragma once

#include <Mmreg.h>

// ----------------------------------------------------------------------------
// class CPolicyConfigClient
// {294935CE-F637-4E7C-A41B-AB255460B862}
Expand Down
1 change: 0 additions & 1 deletion SkinInstaller/SkinInstallerLauncher.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/

#define WIN32_LEAN_AND_MEAN
#include <Windows.h>
#include <Shlwapi.h>

Expand Down
1 change: 0 additions & 1 deletion SkinInstaller/StdAfx.h
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@
#define __STDAFX_H__

// WINAPI
#define WIN32_LEAN_AND_MEAN
#include <Windows.h>
#include <Windowsx.h>
#include <Commdlg.h>
Expand Down

0 comments on commit da92def

Please sign in to comment.