diff --git a/Source/.clang-format b/Source/.clang-format index 5ab9898109..aff0336fd4 100644 --- a/Source/.clang-format +++ b/Source/.clang-format @@ -45,10 +45,12 @@ DerivePointerAlignment: false DisableFormat: false ForEachMacros: [] IncludeCategories: - - Regex: '^<' + - Regex: '^<[Ww]indows\.h>$' Priority: 1 - - Regex: '^"' + - Regex: '^<' Priority: 2 + - Regex: '^"' + Priority: 3 IndentCaseLabels: false IndentWidth: 2 IndentWrappedFunctionNames: false diff --git a/Source/Core/AudioCommon/XAudio2Stream.h b/Source/Core/AudioCommon/XAudio2Stream.h index eb45634154..7fcb8f7b00 100644 --- a/Source/Core/AudioCommon/XAudio2Stream.h +++ b/Source/Core/AudioCommon/XAudio2Stream.h @@ -15,6 +15,8 @@ #ifdef _WIN32 +#include + struct StreamingVoiceContext; struct IXAudio2; struct IXAudio2MasteringVoice; diff --git a/Source/Core/Common/Atomic_Win32.h b/Source/Core/Common/Atomic_Win32.h index 1a6f160b86..1260cd72bb 100644 --- a/Source/Core/Common/Atomic_Win32.h +++ b/Source/Core/Common/Atomic_Win32.h @@ -8,8 +8,7 @@ #include -#include "Common/Common.h" -#include "Common/Intrinsics.h" +#include "Common/CommonTypes.h" // Atomic operations are performed in a single step by the CPU. It is // impossible for other threads to see the operation "half-done." diff --git a/Source/Core/Common/FileUtil.cpp b/Source/Core/Common/FileUtil.cpp index 652a2e466c..f4f3986b76 100644 --- a/Source/Core/Common/FileUtil.cpp +++ b/Source/Core/Common/FileUtil.cpp @@ -20,12 +20,12 @@ #include "Common/Logging/Log.h" #ifdef _WIN32 +#include #include // for GetSaveFileName #include // getcwd #include #include // guid stuff #include -#include #else #include #include diff --git a/Source/Core/Common/GL/GLInterface/WGL.h b/Source/Core/Common/GL/GLInterface/WGL.h index 24e2b942ca..e6f0ff3c66 100644 --- a/Source/Core/Common/GL/GLInterface/WGL.h +++ b/Source/Core/Common/GL/GLInterface/WGL.h @@ -4,6 +4,7 @@ #pragma once +#include #include #include "Common/GL/GLInterfaceBase.h" diff --git a/Source/Core/Common/Logging/ConsoleListenerWin.cpp b/Source/Core/Common/Logging/ConsoleListenerWin.cpp index 1a6bdf16e9..4dca963757 100644 --- a/Source/Core/Common/Logging/ConsoleListenerWin.cpp +++ b/Source/Core/Common/Logging/ConsoleListenerWin.cpp @@ -2,7 +2,7 @@ // Licensed under GPLv2+ // Refer to the license.txt file included. -#include +#include #include "Common/Logging/ConsoleListener.h" diff --git a/Source/Core/Common/MemoryUtil.cpp b/Source/Core/Common/MemoryUtil.cpp index 2b1ed11d18..5ce39e1052 100644 --- a/Source/Core/Common/MemoryUtil.cpp +++ b/Source/Core/Common/MemoryUtil.cpp @@ -13,8 +13,8 @@ #include "Common/MsgHandler.h" #ifdef _WIN32 -#include #include +#include #include "Common/StringUtil.h" #else #include diff --git a/Source/Core/Common/Misc.cpp b/Source/Core/Common/Misc.cpp index 870294092c..69ff018471 100644 --- a/Source/Core/Common/Misc.cpp +++ b/Source/Core/Common/Misc.cpp @@ -8,6 +8,10 @@ #include "Common/CommonFuncs.h" +#ifdef _WIN32 +#include +#endif + // Generic function to get last error message. // Call directly after the command or use the error num. // This function might change the error code. diff --git a/Source/Core/Common/MsgHandler.cpp b/Source/Core/Common/MsgHandler.cpp index caf8d99f15..77c5547996 100644 --- a/Source/Core/Common/MsgHandler.cpp +++ b/Source/Core/Common/MsgHandler.cpp @@ -12,6 +12,10 @@ #include "Common/MsgHandler.h" #include "Common/StringUtil.h" +#ifdef _WIN32 +#include +#endif + bool DefaultMsgHandler(const char* caption, const char* text, bool yes_no, int Style); static MsgAlertHandler msg_handler = DefaultMsgHandler; static bool AlertEnabled = true; diff --git a/Source/Core/Common/Profiler.cpp b/Source/Core/Common/Profiler.cpp index 0c7807a532..fdc356a164 100644 --- a/Source/Core/Common/Profiler.cpp +++ b/Source/Core/Common/Profiler.cpp @@ -2,6 +2,7 @@ // Licensed under GPLv2+ // Refer to the license.txt file included. +#include #include #include #include diff --git a/Source/Core/Common/SettingsHandler.cpp b/Source/Core/Common/SettingsHandler.cpp index a87fc478f5..9b5d91e4f5 100644 --- a/Source/Core/Common/SettingsHandler.cpp +++ b/Source/Core/Common/SettingsHandler.cpp @@ -11,9 +11,9 @@ #include #ifdef _WIN32 +#include #include #include -#include #include "Common/CommonFuncs.h" // snprintf #endif diff --git a/Source/Core/Common/Thread.cpp b/Source/Core/Common/Thread.cpp index a03b9c2e57..909016e7ae 100644 --- a/Source/Core/Common/Thread.cpp +++ b/Source/Core/Common/Thread.cpp @@ -6,7 +6,9 @@ #include "Common/CommonFuncs.h" #include "Common/CommonTypes.h" -#ifndef _WIN32 +#ifdef _WIN32 +#include +#else #include #endif diff --git a/Source/Core/Common/Timer.cpp b/Source/Core/Common/Timer.cpp index 752664c1b6..081dd2008c 100644 --- a/Source/Core/Common/Timer.cpp +++ b/Source/Core/Common/Timer.cpp @@ -7,9 +7,9 @@ #include #ifdef _WIN32 +#include #include #include -#include #else #include #endif diff --git a/Source/Core/Core/HW/WiimoteReal/IOWin.cpp b/Source/Core/Core/HW/WiimoteReal/IOWin.cpp index ab53232d5b..6cfea743bb 100644 --- a/Source/Core/Core/HW/WiimoteReal/IOWin.cpp +++ b/Source/Core/Core/HW/WiimoteReal/IOWin.cpp @@ -6,20 +6,20 @@ #include #include #include -#include #include #include -// clang-format off #include -// The following Windows headers must be included AFTER windows.h. #include #include -#include -// initguid.h must be included before Devpkey.h -#include #include +#include #include + +// initguid.h must be included before Devpkey.h +// clang-format off +#include +#include // clang-format on #include "Common/CommonFuncs.h" diff --git a/Source/Core/Core/IOS/WFS/WFSI.h b/Source/Core/Core/IOS/WFS/WFSI.h index c4c644f7ea..0c1973184e 100644 --- a/Source/Core/Core/IOS/WFS/WFSI.h +++ b/Source/Core/Core/IOS/WFS/WFSI.h @@ -4,6 +4,7 @@ #pragma once +#include #include #include diff --git a/Source/Core/InputCommon/ControllerInterface/DInput/XInputFilter.cpp b/Source/Core/InputCommon/ControllerInterface/DInput/XInputFilter.cpp index 246501dd70..c873a304d5 100644 --- a/Source/Core/InputCommon/ControllerInterface/DInput/XInputFilter.cpp +++ b/Source/Core/InputCommon/ControllerInterface/DInput/XInputFilter.cpp @@ -6,10 +6,8 @@ #include #include -// clang-format off #include #include -// clang-format on namespace ciface { diff --git a/Source/Core/InputCommon/ControllerInterface/XInput/XInput.h b/Source/Core/InputCommon/ControllerInterface/XInput/XInput.h index 52530e9a00..f2a81e3840 100644 --- a/Source/Core/InputCommon/ControllerInterface/XInput/XInput.h +++ b/Source/Core/InputCommon/ControllerInterface/XInput/XInput.h @@ -9,8 +9,8 @@ #pragma once -#include #include +#include #include "InputCommon/ControllerInterface/ControllerInterface.h" diff --git a/Source/Core/VideoCommon/AVIDump.cpp b/Source/Core/VideoCommon/AVIDump.cpp index ce1b377045..20494ba882 100644 --- a/Source/Core/VideoCommon/AVIDump.cpp +++ b/Source/Core/VideoCommon/AVIDump.cpp @@ -70,7 +70,7 @@ bool AVIDump::Start(int w, int h) s_last_pts = 0; InitAVCodec(); - bool success = CreateFile(); + bool success = CreateVideoFile(); if (!success) { CloseFile(); @@ -79,7 +79,7 @@ bool AVIDump::Start(int w, int h) return success; } -bool AVIDump::CreateFile() +bool AVIDump::CreateVideoFile() { AVCodec* codec = nullptr; diff --git a/Source/Core/VideoCommon/AVIDump.h b/Source/Core/VideoCommon/AVIDump.h index b9158774a3..91b2b1b668 100644 --- a/Source/Core/VideoCommon/AVIDump.h +++ b/Source/Core/VideoCommon/AVIDump.h @@ -9,7 +9,7 @@ class AVIDump { private: - static bool CreateFile(); + static bool CreateVideoFile(); static void CloseFile(); static void CheckResolution(int width, int height);