Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Merge pull request #857 from shuffle2/msvc-improvements
windows: remove now-extraneous NOMINMAX and WIN32_LEAN_AND_MEAN #defines
  • Loading branch information
shuffle2 committed Aug 23, 2014
2 parents 6a5188c + 327d353 commit f964a28
Show file tree
Hide file tree
Showing 12 changed files with 24 additions and 33 deletions.
10 changes: 0 additions & 10 deletions Source/Core/Common/Common.h
Expand Up @@ -4,9 +4,6 @@

#pragma once

// DO NOT EVER INCLUDE <windows.h> directly _or indirectly_ from this file
// since it slows down the build a lot.

#include <cstdio>
#include <cstdlib>
#include <cstring>
Expand Down Expand Up @@ -89,13 +86,6 @@ class NonCopyable

#elif defined _WIN32

// Check MSC ver
#if !defined _MSC_VER || _MSC_VER <= 1000
#error needs at least version 1000 of MSC
#endif

#define NOMINMAX

// Memory leak checks
#define CHECK_HEAP_INTEGRITY()

Expand Down
2 changes: 1 addition & 1 deletion Source/Core/Core/HW/WiimoteReal/IOWin.cpp
Expand Up @@ -9,7 +9,7 @@
#include <unordered_map>
#include <unordered_set>
#include <windows.h>
// The following Windows headers MUST be included after windows.h.
// The following Windows headers must be included AFTER windows.h.
#include <BluetoothAPIs.h> //NOLINT
#include <dbt.h> //NOLINT
#include <setupapi.h> //NOLINT
Expand Down
3 changes: 0 additions & 3 deletions Source/Core/InputCommon/ControllerEmu.h
Expand Up @@ -4,9 +4,6 @@

#pragma once

// windows crap
#define NOMINMAX

#include <algorithm>
#include <cmath>
#include <memory>
Expand Down
Expand Up @@ -48,8 +48,11 @@ std::string GetDeviceName(const LPDIRECTINPUTDEVICE8 device)
void Init(std::vector<Core::Device*>& devices, HWND hwnd)
{
IDirectInput8* idi8;
if (FAILED(DirectInput8Create(GetModuleHandle(nullptr), DIRECTINPUT_VERSION, IID_IDirectInput8, (LPVOID*)&idi8, nullptr)))
if (FAILED(DirectInput8Create(GetModuleHandle(nullptr), DIRECTINPUT_VERSION,
IID_IDirectInput8, (LPVOID*)&idi8, nullptr)))
{
return;
}

InitKeyboardMouse(idi8, devices, hwnd);
InitJoystick(idi8, devices, hwnd);
Expand Down
5 changes: 1 addition & 4 deletions Source/Core/InputCommon/ControllerInterface/DInput/DInput.h
Expand Up @@ -6,14 +6,11 @@

#define DINPUT_SOURCE_NAME "DInput"

#define DIRECTINPUT_VERSION 0x0800
#define WIN32_LEAN_AND_MEAN
#define NOMINMAX
#include <dinput.h>
#include <list>
#include <windows.h>

#include "InputCommon/ControllerInterface/Device.h"
#include "InputCommon/ControllerInterface/DInput/DInput8.h"

namespace ciface
{
Expand Down
8 changes: 8 additions & 0 deletions Source/Core/InputCommon/ControllerInterface/DInput/DInput8.h
@@ -0,0 +1,8 @@
// Copyright 2013 Dolphin Emulator Project
// Licensed under GPLv2
// Refer to the license.txt file included.

#pragma once

#define DIRECTINPUT_VERSION 0x0800
#include <dinput.h>
Expand Up @@ -4,13 +4,10 @@

#pragma once

#define DIRECTINPUT_VERSION 0x0800
#define WIN32_LEAN_AND_MEAN
#define NOMINMAX
#include <dinput.h>
#include <windows.h>

#include "InputCommon/ControllerInterface/Device.h"
#include "InputCommon/ControllerInterface/DInput/DInput8.h"

namespace ciface
{
Expand Down
Expand Up @@ -10,11 +10,8 @@
#include "InputCommon/ControllerInterface/Device.h"

#ifdef _WIN32
#define DIRECTINPUT_VERSION 0x0800
#define WIN32_LEAN_AND_MEAN
#define NOMINMAX
#include <Windows.h>
#include <dinput.h>
#include "InputCommon/ControllerInterface/DInput/DInput8.h"
#elif __APPLE__
#include "InputCommon/ControllerInterface/ForceFeedback/OSX/DirectInputAdapter.h"
#endif
Expand Down
Expand Up @@ -5,7 +5,6 @@

#pragma once

#define NOMINMAX
#include <windows.h>
#include <XInput.h>

Expand Down
5 changes: 3 additions & 2 deletions Source/Core/InputCommon/InputCommon.vcxproj
@@ -1,4 +1,4 @@
<?xml version="1.0" encoding="utf-8"?>
<?xml version="1.0" encoding="utf-8"?>
<Project DefaultTargets="Build" ToolsVersion="12.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<ItemGroup Label="ProjectConfigurations">
<ProjectConfiguration Include="Debug|x64">
Expand Down Expand Up @@ -51,6 +51,7 @@
<ClInclude Include="ControllerInterface\ControllerInterface.h" />
<ClInclude Include="ControllerInterface\Device.h" />
<ClInclude Include="ControllerInterface\DInput\DInput.h" />
<ClInclude Include="ControllerInterface\DInput\DInput8.h" />
<ClInclude Include="ControllerInterface\DInput\DInputJoystick.h" />
<ClInclude Include="ControllerInterface\DInput\DInputKeyboardMouse.h" />
<ClInclude Include="ControllerInterface\ExpressionParser.h" />
Expand All @@ -70,4 +71,4 @@
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
<ImportGroup Label="ExtensionTargets">
</ImportGroup>
</Project>
</Project>
7 changes: 5 additions & 2 deletions Source/Core/InputCommon/InputCommon.vcxproj.filters
@@ -1,4 +1,4 @@
<?xml version="1.0" encoding="utf-8"?>
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<ItemGroup>
<Filter Include="ControllerInterface">
Expand Down Expand Up @@ -70,8 +70,11 @@
<ClInclude Include="ControllerInterface\ForceFeedback\ForceFeedbackDevice.h">
<Filter>ControllerInterface\ForceFeedback</Filter>
</ClInclude>
<ClInclude Include="ControllerInterface\DInput\DInput8.h">
<Filter>ControllerInterface\DInput</Filter>
</ClInclude>
</ItemGroup>
<ItemGroup>
<Text Include="CMakeLists.txt" />
</ItemGroup>
</Project>
</Project>
1 change: 0 additions & 1 deletion Source/Core/VideoCommon/VideoCommon.h
Expand Up @@ -5,7 +5,6 @@
#pragma once

#ifdef _WIN32
#define WIN32_LEAN_AND_MEAN
#include <windows.h>
#endif

Expand Down

0 comments on commit f964a28

Please sign in to comment.