diff options
| author | Lioncash <mathew1800@gmail.com> | 2015-09-06 02:39:35 -0400 |
|---|---|---|
| committer | Lioncash <mathew1800@gmail.com> | 2015-09-06 04:09:53 -0400 |
| commit | 4fc71e97089d5113a2dc7bb22c5ae2b498aebf16 (patch) | |
| tree | 75c1665b31be8b2c748d4911576649e73871831a /Source/Core | |
| parent | 4991c6340ac33e9804a28aadc2f46b7af44c9c62 (diff) | |
Common: Remove StdMakeUnique.h
Diffstat (limited to 'Source/Core')
22 files changed, 25 insertions, 108 deletions
diff --git a/Source/Core/Common/Common.vcxproj b/Source/Core/Common/Common.vcxproj index 9303e37939..ec67edf054 100644 --- a/Source/Core/Common/Common.vcxproj +++ b/Source/Core/Common/Common.vcxproj @@ -75,7 +75,6 @@ <ClInclude Include="Profiler.h" /> <ClInclude Include="SDCardUtil.h" /> <ClInclude Include="SettingsHandler.h" /> - <ClInclude Include="StdMakeUnique.h" /> <ClInclude Include="StringUtil.h" /> <ClInclude Include="SymbolDB.h" /> <ClInclude Include="SysConf.h" /> diff --git a/Source/Core/Common/Common.vcxproj.filters b/Source/Core/Common/Common.vcxproj.filters index 712122b3d1..64c29fb0ab 100644 --- a/Source/Core/Common/Common.vcxproj.filters +++ b/Source/Core/Common/Common.vcxproj.filters @@ -46,7 +46,6 @@ <ClInclude Include="Profiler.h" /> <ClInclude Include="SDCardUtil.h" /> <ClInclude Include="SettingsHandler.h" /> - <ClInclude Include="StdMakeUnique.h" /> <ClInclude Include="StringUtil.h" /> <ClInclude Include="SymbolDB.h" /> <ClInclude Include="SysConf.h" /> diff --git a/Source/Core/Common/StdMakeUnique.h b/Source/Core/Common/StdMakeUnique.h deleted file mode 100644 index b3e38649d8..0000000000 --- a/Source/Core/Common/StdMakeUnique.h +++ /dev/null @@ -1,82 +0,0 @@ -// Copyright 2014 Dolphin Emulator Project -// Licensed under GPLv2+ -// Refer to the license.txt file included. - -#pragma once - -// VS 2013 defines __cplusplus as 199711L but has std::make_unique. -#if __cplusplus > 201103L || _MSC_VER >= 1800 -#include <memory> -#else - -// Implementation of C++14 std::make_unique, which is not supported by all the -// compilers we care about yet. -// -// NOTE: This code is based on the libc++ implementation of std::make_unique. -// -// Copyright (c) 2009-2014 by the libc++ contributors. -// -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and associated documentation files (the "Software"), to -// deal in the Software without restriction, including without limitation the -// rights to use, copy, modify, merge, publish, distribute, sublicense, and/or -// sell copies of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in -// all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING -// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS -// IN THE SOFTWARE. - -#include <cstddef> -#include <memory> -#include <type_traits> - -namespace std -{ - -struct unspecified {}; - -template<class T> -struct unique_if -{ - typedef std::unique_ptr<T> unique_single; -}; - -template<class T> -struct unique_if<T[]> -{ - typedef std::unique_ptr<T[]> unique_array_unknown_bound; -}; - -template<class T, size_t N> -struct unique_if<T[N]> -{ - typedef void unique_array_known_bound; -}; - -template<class T, class... Args> -inline typename unique_if<T>::unique_single make_unique(Args&&... args) -{ - return std::unique_ptr<T>(new T(std::forward<Args>(args)...)); -} - -template<class T> -inline typename unique_if<T>::unique_array_unknown_bound make_unique(size_t n) -{ - typedef typename std::remove_extent<T>::type U; - return std::unique_ptr<T>(new U[n]()); -} - -template<class T, class... Args> -typename unique_if<T>::unique_array_known_bound make_unique(Args&&...) = delete; - -} // namespace std - -#endif // __cplusplus diff --git a/Source/Core/Core/Boot/Boot_ELF.cpp b/Source/Core/Core/Boot/Boot_ELF.cpp index 7f09fa7f2a..447e6f6f7b 100644 --- a/Source/Core/Core/Boot/Boot_ELF.cpp +++ b/Source/Core/Core/Boot/Boot_ELF.cpp @@ -2,9 +2,9 @@ // Licensed under GPLv2+ // Refer to the license.txt file included. -#include "Common/FileUtil.h" -#include "Common/StdMakeUnique.h" +#include <memory> +#include "Common/FileUtil.h" #include "Core/Boot/Boot.h" #include "Core/Boot/ElfReader.h" #include "Core/HLE/HLE.h" diff --git a/Source/Core/Core/Boot/Boot_WiiWAD.cpp b/Source/Core/Core/Boot/Boot_WiiWAD.cpp index 66f2ed2b7d..a267227f49 100644 --- a/Source/Core/Core/Boot/Boot_WiiWAD.cpp +++ b/Source/Core/Core/Boot/Boot_WiiWAD.cpp @@ -8,7 +8,6 @@ #include "Common/CommonPaths.h" #include "Common/FileUtil.h" #include "Common/NandPaths.h" -#include "Common/StdMakeUnique.h" #include "Core/ConfigManager.h" #include "Core/PatchEngine.h" diff --git a/Source/Core/Core/HW/EXI_DeviceAGP.cpp b/Source/Core/Core/HW/EXI_DeviceAGP.cpp index c166ce4aca..e4ebe433f1 100644 --- a/Source/Core/Core/HW/EXI_DeviceAGP.cpp +++ b/Source/Core/Core/HW/EXI_DeviceAGP.cpp @@ -2,10 +2,11 @@ // Licensed under GPLv2+ // Refer to the license.txt file included. +#include <memory> + #include "Common/ChunkFile.h" #include "Common/FileUtil.h" #include "Common/MemoryUtil.h" -#include "Common/StdMakeUnique.h" #include "Core/ConfigManager.h" #include "Core/Core.h" #include "Core/HW/EXI_Device.h" diff --git a/Source/Core/Core/HW/EXI_DeviceGecko.cpp b/Source/Core/Core/HW/EXI_DeviceGecko.cpp index a189568ae7..c475b817c6 100644 --- a/Source/Core/Core/HW/EXI_DeviceGecko.cpp +++ b/Source/Core/Core/HW/EXI_DeviceGecko.cpp @@ -2,9 +2,11 @@ // Licensed under GPLv2+ // Refer to the license.txt file included. +#include <memory> +#include <thread> + #include "Common/ChunkFile.h" #include "Common/CommonFuncs.h" -#include "Common/StdMakeUnique.h" #include "Common/StringUtil.h" #include "Common/Thread.h" #include "Core/Core.h" diff --git a/Source/Core/Core/HW/EXI_DeviceMemoryCard.cpp b/Source/Core/Core/HW/EXI_DeviceMemoryCard.cpp index 722b69f153..0a154f3a43 100644 --- a/Source/Core/Core/HW/EXI_DeviceMemoryCard.cpp +++ b/Source/Core/Core/HW/EXI_DeviceMemoryCard.cpp @@ -2,11 +2,12 @@ // Licensed under GPLv2+ // Refer to the license.txt file included. +#include <memory> + #include "Common/ChunkFile.h" #include "Common/CommonTypes.h" #include "Common/FileUtil.h" #include "Common/NandPaths.h" -#include "Common/StdMakeUnique.h" #include "Common/StringUtil.h" #include "Core/ConfigManager.h" #include "Core/Core.h" diff --git a/Source/Core/Core/HW/GCMemcardDirectory.cpp b/Source/Core/Core/HW/GCMemcardDirectory.cpp index 99e680c14e..4a630a4c03 100644 --- a/Source/Core/Core/HW/GCMemcardDirectory.cpp +++ b/Source/Core/Core/HW/GCMemcardDirectory.cpp @@ -1,12 +1,14 @@ // Copyright 2014 Dolphin Emulator Project // Licensed under GPLv2+ // Refer to the license.txt file included. + #include <cinttypes> +#include <memory> + #include "Common/ChunkFile.h" #include "Common/CommonTypes.h" #include "Common/FileSearch.h" #include "Common/FileUtil.h" -#include "Common/StdMakeUnique.h" #include "Common/Thread.h" #include "Core/ConfigManager.h" #include "Core/Core.h" diff --git a/Source/Core/Core/HW/GCMemcardRaw.cpp b/Source/Core/Core/HW/GCMemcardRaw.cpp index b1494d2e65..c3c41a8347 100644 --- a/Source/Core/Core/HW/GCMemcardRaw.cpp +++ b/Source/Core/Core/HW/GCMemcardRaw.cpp @@ -3,9 +3,10 @@ // Refer to the license.txt file included. #include <chrono> +#include <memory> + #include "Common/ChunkFile.h" #include "Common/FileUtil.h" -#include "Common/StdMakeUnique.h" #include "Common/Thread.h" #include "Core/ConfigManager.h" #include "Core/Core.h" diff --git a/Source/Core/Core/HW/SI_DeviceGBA.cpp b/Source/Core/Core/HW/SI_DeviceGBA.cpp index 9850f2d0ed..f80dd5a56a 100644 --- a/Source/Core/Core/HW/SI_DeviceGBA.cpp +++ b/Source/Core/Core/HW/SI_DeviceGBA.cpp @@ -2,12 +2,12 @@ // Licensed under GPLv2+ // Refer to the license.txt file included. +#include <memory> #include <mutex> #include <queue> #include "Common/CommonFuncs.h" #include "Common/Flag.h" -#include "Common/StdMakeUnique.h" #include "Common/Thread.h" #include "Common/Logging/Log.h" #include "Core/ConfigManager.h" diff --git a/Source/Core/Core/HW/WiiSaveCrypted.cpp b/Source/Core/Core/HW/WiiSaveCrypted.cpp index beae07402d..80b230f8a1 100644 --- a/Source/Core/Core/HW/WiiSaveCrypted.cpp +++ b/Source/Core/Core/HW/WiiSaveCrypted.cpp @@ -11,6 +11,7 @@ #include <cstddef> #include <cstdio> #include <cstring> +#include <memory> #include <string> #include <vector> #include <polarssl/aes.h> @@ -21,7 +22,6 @@ #include "Common/FileUtil.h" #include "Common/MathUtil.h" #include "Common/NandPaths.h" -#include "Common/StdMakeUnique.h" #include "Common/StringUtil.h" #include "Common/Crypto/ec.h" diff --git a/Source/Core/Core/IPC_HLE/WII_IPC_HLE_Device_es.cpp b/Source/Core/Core/IPC_HLE/WII_IPC_HLE_Device_es.cpp index 3567b25aba..01a7279e6b 100644 --- a/Source/Core/Core/IPC_HLE/WII_IPC_HLE_Device_es.cpp +++ b/Source/Core/Core/IPC_HLE/WII_IPC_HLE_Device_es.cpp @@ -36,13 +36,13 @@ // need to include this before polarssl/aes.h, // otherwise we may not get __STDC_FORMAT_MACROS #include <cinttypes> +#include <memory> #include <polarssl/aes.h> #include "Common/ChunkFile.h" #include "Common/CommonPaths.h" #include "Common/FileUtil.h" #include "Common/NandPaths.h" -#include "Common/StdMakeUnique.h" #include "Common/StringUtil.h" #include "Core/ConfigManager.h" #include "Core/ec_wii.h" diff --git a/Source/Core/Core/NetPlayServer.cpp b/Source/Core/Core/NetPlayServer.cpp index 2a48d37f7e..7ed283a4c0 100644 --- a/Source/Core/Core/NetPlayServer.cpp +++ b/Source/Core/Core/NetPlayServer.cpp @@ -2,12 +2,12 @@ // Licensed under GPLv2+ // Refer to the license.txt file included. +#include <memory> #include <string> #include <vector> #include "Common/ENetUtil.h" #include "Common/FileUtil.h" #include "Common/IniFile.h" -#include "Common/StdMakeUnique.h" #include "Common/StringUtil.h" #include "Core/ConfigManager.h" #include "Core/NetPlayClient.h" //for NetPlayUI diff --git a/Source/Core/Core/PowerPC/Jit64IL/JitIL.cpp b/Source/Core/Core/PowerPC/Jit64IL/JitIL.cpp index a2901f01c2..036e765145 100644 --- a/Source/Core/Core/PowerPC/Jit64IL/JitIL.cpp +++ b/Source/Core/Core/PowerPC/Jit64IL/JitIL.cpp @@ -11,7 +11,6 @@ #include "Common/Common.h" #include "Common/FileUtil.h" #include "Common/Intrinsics.h" -#include "Common/StdMakeUnique.h" #include "Common/StringUtil.h" #include "Core/PatchEngine.h" #include "Core/HLE/HLE.h" diff --git a/Source/Core/Core/PowerPC/JitILCommon/IR.cpp b/Source/Core/Core/PowerPC/JitILCommon/IR.cpp index c96dfcea93..824ce44d87 100644 --- a/Source/Core/Core/PowerPC/JitILCommon/IR.cpp +++ b/Source/Core/Core/PowerPC/JitILCommon/IR.cpp @@ -127,7 +127,6 @@ TODO (in no particular order): #include <string> #include "Common/FileUtil.h" -#include "Common/StdMakeUnique.h" #include "Common/StringUtil.h" #include "Core/Core.h" #include "Core/CoreTiming.h" diff --git a/Source/Core/DolphinQt/AboutDialog.cpp b/Source/Core/DolphinQt/AboutDialog.cpp index c9beca3d10..55f18377cc 100644 --- a/Source/Core/DolphinQt/AboutDialog.cpp +++ b/Source/Core/DolphinQt/AboutDialog.cpp @@ -2,13 +2,13 @@ // Licensed under GPLv2+ // Refer to the license.txt file included. +#include <memory> #include <QDesktopServices> #include <QUrl> #include "ui_AboutDialog.h" #include "Common/Common.h" -#include "Common/StdMakeUnique.h" #include "DolphinQt/AboutDialog.h" #include "DolphinQt/Utils/Utils.h" diff --git a/Source/Core/DolphinQt/GameList/GameGrid.cpp b/Source/Core/DolphinQt/GameList/GameGrid.cpp index ebce076ccb..8bf92087bd 100644 --- a/Source/Core/DolphinQt/GameList/GameGrid.cpp +++ b/Source/Core/DolphinQt/GameList/GameGrid.cpp @@ -2,9 +2,9 @@ // Licensed under GPLv2+ // Refer to the license.txt file included. -#include "ui_GameGrid.h" +#include <memory> -#include "Common/StdMakeUnique.h" +#include "ui_GameGrid.h" #include "DolphinQt/GameList/GameGrid.h" diff --git a/Source/Core/DolphinQt/GameList/GameTree.cpp b/Source/Core/DolphinQt/GameList/GameTree.cpp index b218d6072f..68dda6a419 100644 --- a/Source/Core/DolphinQt/GameList/GameTree.cpp +++ b/Source/Core/DolphinQt/GameList/GameTree.cpp @@ -2,12 +2,11 @@ // Licensed under GPLv2+ // Refer to the license.txt file included. -#include "ui_GameTree.h" +#include <memory> -#include "Common/StdMakeUnique.h" +#include "ui_GameTree.h" #include "DolphinQt/GameList/GameTree.h" - #include "DolphinQt/Utils/Resources.h" #include "DolphinQt/Utils/Utils.h" diff --git a/Source/Core/DolphinQt/MainWindow.cpp b/Source/Core/DolphinQt/MainWindow.cpp index c842c27158..4c371678e5 100644 --- a/Source/Core/DolphinQt/MainWindow.cpp +++ b/Source/Core/DolphinQt/MainWindow.cpp @@ -2,6 +2,7 @@ // Licensed under GPLv2+ // Refer to the license.txt file included. +#include <memory> #include <QActionGroup> #include <QDesktopServices> #include <QFileDialog> @@ -10,8 +11,6 @@ #include "ui_MainWindow.h" -#include "Common/StdMakeUnique.h" - #include "Core/BootManager.h" #include "Core/ConfigManager.h" #include "Core/HW/ProcessorInterface.h" diff --git a/Source/Core/DolphinQt/SystemInfo.cpp b/Source/Core/DolphinQt/SystemInfo.cpp index 1d27324779..ba2764593c 100644 --- a/Source/Core/DolphinQt/SystemInfo.cpp +++ b/Source/Core/DolphinQt/SystemInfo.cpp @@ -2,6 +2,7 @@ // Licensed under GPLv2+ // Refer to the license.txt file included. +#include <memory> #include <QClipboard> #include <QPushButton> #include <QThread> @@ -10,7 +11,6 @@ #include "Common/Common.h" #include "Common/CPUDetect.h" -#include "Common/StdMakeUnique.h" #include "DolphinQt/SystemInfo.h" #include "DolphinQt/Utils/Utils.h" diff --git a/Source/Core/DolphinWX/GameListCtrl.cpp b/Source/Core/DolphinWX/GameListCtrl.cpp index a386485ce3..b2a6e49a82 100644 --- a/Source/Core/DolphinWX/GameListCtrl.cpp +++ b/Source/Core/DolphinWX/GameListCtrl.cpp @@ -31,7 +31,6 @@ #include "Common/FileSearch.h" #include "Common/FileUtil.h" #include "Common/MathUtil.h" -#include "Common/StdMakeUnique.h" #include "Common/StringUtil.h" #include "Common/SysConf.h" #include "Core/ConfigManager.h" |
