diff --git a/Source/Core/Common/BitField.h b/Source/Core/Common/BitField.h index 108921bdf0..74683e9c96 100644 --- a/Source/Core/Common/BitField.h +++ b/Source/Core/Common/BitField.h @@ -35,7 +35,7 @@ #include #include -#include "Common.h" +#include "Common/Compiler.h" /* * Abstract bitfield class diff --git a/Source/Core/Common/ChunkFile.h b/Source/Core/Common/ChunkFile.h index 43d194c3ac..c8e50938a9 100644 --- a/Source/Core/Common/ChunkFile.h +++ b/Source/Core/Common/ChunkFile.h @@ -26,8 +26,8 @@ #include #include "Common/Assert.h" -#include "Common/Common.h" #include "Common/CommonTypes.h" +#include "Common/Compiler.h" #include "Common/File.h" #include "Common/FileUtil.h" #include "Common/Flag.h" diff --git a/Source/Core/Common/Common.h b/Source/Core/Common/Common.h index d6a2210158..0b09b9ec19 100644 --- a/Source/Core/Common/Common.h +++ b/Source/Core/Common/Common.h @@ -4,14 +4,6 @@ #pragma once -#if defined(__GNUC__) || __clang__ -// Disable "unused function" warnings for the ones manually marked as such. -#define UNUSED __attribute__((unused)) -#else -// Not sure MSVC even checks this... -#define UNUSED -#endif - #if defined _WIN32 // Memory leak checks @@ -42,8 +34,6 @@ struct CrtDebugBreak #ifndef _WIN32 #include #define MAX_PATH PATH_MAX - -#define __forceinline inline __attribute__((always_inline)) #endif #ifdef _MSC_VER diff --git a/Source/Core/Common/Common.vcxproj b/Source/Core/Common/Common.vcxproj index b1a7261f11..2a38dd721c 100644 --- a/Source/Core/Common/Common.vcxproj +++ b/Source/Core/Common/Common.vcxproj @@ -54,6 +54,7 @@ + diff --git a/Source/Core/Common/Common.vcxproj.filters b/Source/Core/Common/Common.vcxproj.filters index a5163abff6..76793bd9ae 100644 --- a/Source/Core/Common/Common.vcxproj.filters +++ b/Source/Core/Common/Common.vcxproj.filters @@ -37,6 +37,7 @@ + diff --git a/Source/Core/Common/Compiler.h b/Source/Core/Common/Compiler.h new file mode 100644 index 0000000000..06313b375a --- /dev/null +++ b/Source/Core/Common/Compiler.h @@ -0,0 +1,17 @@ +// Copyright 2018 Dolphin Emulator Project +// Licensed under GPLv2+ +// Refer to the license.txt file included. + +#pragma once + +#if defined(__GNUC__) || __clang__ +// Disable "unused function" warnings for the ones manually marked as such. +#define UNUSED __attribute__((unused)) +#else +// Not sure MSVC even checks this... +#define UNUSED +#endif + +#ifndef _WIN32 +#define __forceinline inline __attribute__((always_inline)) +#endif diff --git a/Source/Core/Common/Crypto/ec.cpp b/Source/Core/Common/Crypto/ec.cpp index 78cd346ebd..4668293fc4 100644 --- a/Source/Core/Common/Crypto/ec.cpp +++ b/Source/Core/Common/Crypto/ec.cpp @@ -7,12 +7,9 @@ // http://www.gnu.org/licenses/old-licenses/gpl-2.0.txt #include -#include -#include -#include -#include +#include -#include "Common/Common.h" +#include "Common/Compiler.h" #include "Common/Crypto/bn.h" #include "Common/Crypto/ec.h" #include "Common/Random.h" diff --git a/Source/Core/Core/HW/WiimoteEmu/Attachment/Attachment.cpp b/Source/Core/Core/HW/WiimoteEmu/Attachment/Attachment.cpp index 479806fbb7..9f8325e679 100644 --- a/Source/Core/Core/HW/WiimoteEmu/Attachment/Attachment.cpp +++ b/Source/Core/Core/HW/WiimoteEmu/Attachment/Attachment.cpp @@ -8,8 +8,8 @@ #include #include -#include "Common/Common.h" #include "Common/CommonTypes.h" +#include "Common/Compiler.h" #include "Core/HW/WiimoteEmu/WiimoteEmu.h" #include "InputCommon/ControllerEmu/ControlGroup/Extension.h" diff --git a/Source/Core/VideoCommon/BPMemory.h b/Source/Core/VideoCommon/BPMemory.h index db4a5b5382..e0ff53f542 100644 --- a/Source/Core/VideoCommon/BPMemory.h +++ b/Source/Core/VideoCommon/BPMemory.h @@ -9,6 +9,7 @@ #include "Common/BitField.h" #include "Common/CommonTypes.h" +#include "Common/Compiler.h" enum class EFBCopyFormat; diff --git a/Source/Core/VideoCommon/DataReader.h b/Source/Core/VideoCommon/DataReader.h index fef031206f..91434fdc55 100644 --- a/Source/Core/VideoCommon/DataReader.h +++ b/Source/Core/VideoCommon/DataReader.h @@ -6,8 +6,8 @@ #include -#include "Common/Common.h" #include "Common/CommonTypes.h" +#include "Common/Compiler.h" #include "Common/Swap.h" class DataReader diff --git a/Source/Core/VideoCommon/IndexGenerator.cpp b/Source/Core/VideoCommon/IndexGenerator.cpp index 74f6a8a728..2d9ec0d098 100644 --- a/Source/Core/VideoCommon/IndexGenerator.cpp +++ b/Source/Core/VideoCommon/IndexGenerator.cpp @@ -4,8 +4,8 @@ #include -#include "Common/Common.h" #include "Common/CommonTypes.h" +#include "Common/Compiler.h" #include "Common/Logging/Log.h" #include "VideoCommon/IndexGenerator.h" #include "VideoCommon/OpcodeDecoding.h" diff --git a/Source/Core/VideoCommon/VertexLoaderUtils.h b/Source/Core/VideoCommon/VertexLoaderUtils.h index c8b1e2e54a..e32831d4dc 100644 --- a/Source/Core/VideoCommon/VertexLoaderUtils.h +++ b/Source/Core/VideoCommon/VertexLoaderUtils.h @@ -6,8 +6,8 @@ #include -#include "Common/Common.h" #include "Common/CommonTypes.h" +#include "Common/Compiler.h" extern u8* g_video_buffer_read_ptr; extern u8* g_vertex_manager_write_ptr; diff --git a/Source/Core/VideoCommon/VertexLoader_Normal.cpp b/Source/Core/VideoCommon/VertexLoader_Normal.cpp index 305fd85a6e..2676bc9ba4 100644 --- a/Source/Core/VideoCommon/VertexLoader_Normal.cpp +++ b/Source/Core/VideoCommon/VertexLoader_Normal.cpp @@ -7,8 +7,8 @@ #include #include -#include "Common/Common.h" #include "Common/CommonTypes.h" +#include "Common/Compiler.h" #include "VideoCommon/DataReader.h" #include "VideoCommon/VertexLoader.h"