From f120e78b5692e1c710f2335d36fd0593c447a613 Mon Sep 17 00:00:00 2001 From: Yuri Kunde Schlesner Date: Wed, 21 Sep 2016 00:13:46 -0700 Subject: [PATCH] Remove special rules for Windows.h and library includes --- src/.clang-format | 10 +++------- src/common/file_util.cpp | 1 + src/common/memory_util.cpp | 1 + src/common/string_util.cpp | 2 +- src/core/gdbstub/gdbstub.cpp | 2 +- src/video_core/shader/shader_jit_x64.cpp | 2 +- 6 files changed, 8 insertions(+), 10 deletions(-) diff --git a/src/.clang-format b/src/.clang-format index e4f5d6d7e..1c6b71b2e 100644 --- a/src/.clang-format +++ b/src/.clang-format @@ -46,14 +46,10 @@ DerivePointerAlignment: false DisableFormat: false ForEachMacros: [ foreach, Q_FOREACH, BOOST_FOREACH ] IncludeCategories: - - Regex: '^\<[wW]indows.h\>' - Priority: -3 - - Regex: '^\<(boost|catch|dynarmic|glad|inih|nihstro)/' - Priority: -1 - - Regex: '^\<(SDL|SoundTouch|Q)' - Priority: -1 - - Regex: '^\<' + - Regex: '^\<[^Q][^/.>]*\>' Priority: -2 + - Regex: '^\<' + Priority: -1 - Regex: '^\"' Priority: 0 IndentCaseLabels: false diff --git a/src/common/file_util.cpp b/src/common/file_util.cpp index 7a21962cc..14cbcac6b 100644 --- a/src/common/file_util.cpp +++ b/src/common/file_util.cpp @@ -10,6 +10,7 @@ #ifdef _WIN32 #include +// windows.h needs to be included before other windows headers #include // for GetSaveFileName #include // getcwd #include diff --git a/src/common/memory_util.cpp b/src/common/memory_util.cpp index e19d7202a..c19729b21 100644 --- a/src/common/memory_util.cpp +++ b/src/common/memory_util.cpp @@ -7,6 +7,7 @@ #ifdef _WIN32 #include +// Windows.h needs to be included before psapi.h #include #include "common/common_funcs.h" #include "common/string_util.h" diff --git a/src/common/string_util.cpp b/src/common/string_util.cpp index ca97e8ab4..596ae01bf 100644 --- a/src/common/string_util.cpp +++ b/src/common/string_util.cpp @@ -12,8 +12,8 @@ #include "common/logging/log.h" #include "common/string_util.h" #ifdef _MSC_VER -#include #include +#include #include "common/common_funcs.h" #else #include diff --git a/src/core/gdbstub/gdbstub.cpp b/src/core/gdbstub/gdbstub.cpp index 6d709bd15..7fc72d801 100644 --- a/src/core/gdbstub/gdbstub.cpp +++ b/src/core/gdbstub/gdbstub.cpp @@ -10,9 +10,9 @@ #include #include #include -#include #include #include +#include #ifdef _MSC_VER #include diff --git a/src/video_core/shader/shader_jit_x64.cpp b/src/video_core/shader/shader_jit_x64.cpp index 4d788755b..211c703ab 100644 --- a/src/video_core/shader/shader_jit_x64.cpp +++ b/src/video_core/shader/shader_jit_x64.cpp @@ -5,8 +5,8 @@ #include #include #include -#include #include +#include #include "common/assert.h" #include "common/logging/log.h" #include "common/vector_math.h"