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.
This commit is contained in:
Lioncash 2018-06-09 11:34:43 -04:00
parent 1d87584d69
commit 03414e8e84
13 changed files with 29 additions and 22 deletions

View File

@ -35,7 +35,7 @@
#include <limits>
#include <type_traits>
#include "Common.h"
#include "Common/Compiler.h"
/*
* Abstract bitfield class

View File

@ -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"

View File

@ -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

View File

@ -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" />

View File

@ -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" />

View File

@ -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

View File

@ -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"

View File

@ -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"

View File

@ -9,6 +9,7 @@
#include "Common/BitField.h"
#include "Common/CommonTypes.h"
#include "Common/Compiler.h"
enum class EFBCopyFormat;

View File

@ -6,8 +6,8 @@
#include <cstring>
#include "Common/Common.h"
#include "Common/CommonTypes.h"
#include "Common/Compiler.h"
#include "Common/Swap.h"
class DataReader

View File

@ -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"

View File

@ -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;

View File

@ -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"