Merge pull request #2982 from lioncash/unique
Common: Remove StdMakeUnique.h
This commit is contained in:
commit
d52d8bf935
|
@ -867,7 +867,7 @@ add_custom_command(TARGET unittests POST_BUILD COMMAND ${CMAKE_CTEST_COMMAND})
|
|||
########################################
|
||||
# Start compiling our code
|
||||
#
|
||||
add_definitions(-std=gnu++0x)
|
||||
add_definitions(-std=c++1y)
|
||||
|
||||
# These aren't actually needed for C11/C++11
|
||||
# but some dependencies require them (LLVM, libav).
|
||||
|
|
|
@ -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" />
|
||||
|
|
|
@ -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" />
|
||||
|
|
|
@ -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
|
|
@ -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"
|
||||
|
|
|
@ -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"
|
||||
|
|
|
@ -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"
|
||||
|
|
|
@ -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"
|
||||
|
|
|
@ -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"
|
||||
|
|
|
@ -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"
|
||||
|
|
|
@ -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"
|
||||
|
|
|
@ -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"
|
||||
|
|
|
@ -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"
|
||||
|
||||
|
|
|
@ -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"
|
||||
|
|
|
@ -190,7 +190,7 @@ static void ExceptionThread(mach_port_t port)
|
|||
msg_out.flavor = 0;
|
||||
msg_out.new_stateCnt = 0;
|
||||
}
|
||||
msg_out.Head.msgh_size = offsetof(typeof(msg_out), new_state) + msg_out.new_stateCnt * sizeof(natural_t);
|
||||
msg_out.Head.msgh_size = offsetof(__typeof__(msg_out), new_state) + msg_out.new_stateCnt * sizeof(natural_t);
|
||||
|
||||
send_msg = &msg_out.Head;
|
||||
send_size = msg_out.Head.msgh_size;
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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"
|
||||
|
|
|
@ -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"
|
||||
|
|
|
@ -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"
|
||||
|
|
|
@ -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"
|
||||
|
||||
|
|
|
@ -2,12 +2,11 @@
|
|||
// Licensed under GPLv2+
|
||||
// Refer to the license.txt file included.
|
||||
|
||||
#include <memory>
|
||||
|
||||
#include "ui_GameTree.h"
|
||||
|
||||
#include "Common/StdMakeUnique.h"
|
||||
|
||||
#include "DolphinQt/GameList/GameTree.h"
|
||||
|
||||
#include "DolphinQt/Utils/Resources.h"
|
||||
#include "DolphinQt/Utils/Utils.h"
|
||||
|
||||
|
|
|
@ -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"
|
||||
|
|
|
@ -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"
|
||||
|
|
|
@ -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"
|
||||
|
|
Loading…
Reference in New Issue