diff options
| author | Shawn Hoffman <godisgovernment@gmail.com> | 2014-08-22 17:17:49 -0700 |
|---|---|---|
| committer | Shawn Hoffman <godisgovernment@gmail.com> | 2014-08-23 10:48:48 -0700 |
| commit | 327d35377dd0edfcb3f0a5d7b2853f23102eb950 (patch) | |
| tree | 5f9e8490eb13659fa17dd107c74c7cb1cc6d8fe0 /Source/Core/InputCommon/ControllerInterface | |
| parent | 6a5188c9bc567a070797a715bbffa47479a62b23 (diff) | |
windows: remove now-extraneous NOMINMAX and WIN32_LEAN_AND_MEAN #defines from dolphin code.
Wrap dinput.h in a header defining DIRECTINPUT_VERSION instead of repeating it multiple places.
Diffstat (limited to 'Source/Core/InputCommon/ControllerInterface')
6 files changed, 15 insertions, 14 deletions
diff --git a/Source/Core/InputCommon/ControllerInterface/DInput/DInput.cpp b/Source/Core/InputCommon/ControllerInterface/DInput/DInput.cpp index 48b5884312..aac795d880 100644 --- a/Source/Core/InputCommon/ControllerInterface/DInput/DInput.cpp +++ b/Source/Core/InputCommon/ControllerInterface/DInput/DInput.cpp @@ -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); diff --git a/Source/Core/InputCommon/ControllerInterface/DInput/DInput.h b/Source/Core/InputCommon/ControllerInterface/DInput/DInput.h index b4f1b27199..84f9832c53 100644 --- a/Source/Core/InputCommon/ControllerInterface/DInput/DInput.h +++ b/Source/Core/InputCommon/ControllerInterface/DInput/DInput.h @@ -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 { diff --git a/Source/Core/InputCommon/ControllerInterface/DInput/DInput8.h b/Source/Core/InputCommon/ControllerInterface/DInput/DInput8.h new file mode 100644 index 0000000000..8845b5740e --- /dev/null +++ b/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> diff --git a/Source/Core/InputCommon/ControllerInterface/DInput/DInputKeyboardMouse.h b/Source/Core/InputCommon/ControllerInterface/DInput/DInputKeyboardMouse.h index 558917e9cc..8f7ac67452 100644 --- a/Source/Core/InputCommon/ControllerInterface/DInput/DInputKeyboardMouse.h +++ b/Source/Core/InputCommon/ControllerInterface/DInput/DInputKeyboardMouse.h @@ -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 { diff --git a/Source/Core/InputCommon/ControllerInterface/ForceFeedback/ForceFeedbackDevice.h b/Source/Core/InputCommon/ControllerInterface/ForceFeedback/ForceFeedbackDevice.h index 54a465d83e..31a1884aae 100644 --- a/Source/Core/InputCommon/ControllerInterface/ForceFeedback/ForceFeedbackDevice.h +++ b/Source/Core/InputCommon/ControllerInterface/ForceFeedback/ForceFeedbackDevice.h @@ -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 diff --git a/Source/Core/InputCommon/ControllerInterface/XInput/XInput.h b/Source/Core/InputCommon/ControllerInterface/XInput/XInput.h index f3dc398904..3c9eadc395 100644 --- a/Source/Core/InputCommon/ControllerInterface/XInput/XInput.h +++ b/Source/Core/InputCommon/ControllerInterface/XInput/XInput.h @@ -5,7 +5,6 @@ #pragma once -#define NOMINMAX #include <windows.h> #include <XInput.h> |
