diff options
| author | Lioncash <mathew1800@gmail.com> | 2018-06-09 11:34:43 -0400 |
|---|---|---|
| committer | Lioncash <mathew1800@gmail.com> | 2018-06-09 12:10:05 -0400 |
| commit | 03414e8e848fd99e2ea83f4466a1cf34c2ad6807 (patch) | |
| tree | 5a6f4d14864dd717257ddc40e4bc2501c44590db /Source | |
| parent | 1d87584d69e3fdd730502127274fcbd85cebd591 (diff) | |
Common: Add header for compiler-specifics
Instead of globbing things under an ambiguous Common.h header, move
compiler-specifics over to Compiler.h. This gives us a dedicated home
for anything related to compilers that we want to make functional across
all compilers that we support.
This moves us a little closer to eliminating Common.h entirely.
Diffstat (limited to 'Source')
| -rw-r--r-- | Source/Core/Common/BitField.h | 2 | ||||
| -rw-r--r-- | Source/Core/Common/ChunkFile.h | 2 | ||||
| -rw-r--r-- | Source/Core/Common/Common.h | 10 | ||||
| -rw-r--r-- | Source/Core/Common/Common.vcxproj | 1 | ||||
| -rw-r--r-- | Source/Core/Common/Common.vcxproj.filters | 1 | ||||
| -rw-r--r-- | Source/Core/Common/Compiler.h | 17 | ||||
| -rw-r--r-- | Source/Core/Common/Crypto/ec.cpp | 7 | ||||
| -rw-r--r-- | Source/Core/Core/HW/WiimoteEmu/Attachment/Attachment.cpp | 2 | ||||
| -rw-r--r-- | Source/Core/VideoCommon/BPMemory.h | 1 | ||||
| -rw-r--r-- | Source/Core/VideoCommon/DataReader.h | 2 | ||||
| -rw-r--r-- | Source/Core/VideoCommon/IndexGenerator.cpp | 2 | ||||
| -rw-r--r-- | Source/Core/VideoCommon/VertexLoaderUtils.h | 2 | ||||
| -rw-r--r-- | Source/Core/VideoCommon/VertexLoader_Normal.cpp | 2 |
13 files changed, 29 insertions, 22 deletions
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 <limits> #include <type_traits> -#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 <vector> #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 <limits.h> #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 @@ <ClInclude Include="CommonFuncs.h" /> <ClInclude Include="CommonPaths.h" /> <ClInclude Include="CommonTypes.h" /> + <ClInclude Include="Compiler.h" /> <ClInclude Include="Config\Config.h" /> <ClInclude Include="Config\ConfigInfo.h" /> <ClInclude Include="Config\Enums.h" /> 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 @@ <ClInclude Include="CommonFuncs.h" /> <ClInclude Include="CommonPaths.h" /> <ClInclude Include="CommonTypes.h" /> + <ClInclude Include="Compiler.h" /> <ClInclude Include="Config\Config.h" /> <ClInclude Include="Config\Enums.h" /> <ClInclude Include="Config\Layer.h" /> 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 <algorithm> -#include <cstdio> -#include <cstdlib> -#include <ctime> -#include <string.h> +#include <cstring> -#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 <array> #include <cstring> -#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 <cstring> -#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 <cstddef> -#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 <cstring> -#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 <cmath> #include <type_traits> -#include "Common/Common.h" #include "Common/CommonTypes.h" +#include "Common/Compiler.h" #include "VideoCommon/DataReader.h" #include "VideoCommon/VertexLoader.h" |
