Refer to <memory> directly, not through "compiler-make_unique.h"

This commit is contained in:
Kp 2020-05-02 21:18:43 +00:00
parent 3add38df3d
commit db7b4b3f88
39 changed files with 38 additions and 87 deletions

View file

@ -35,8 +35,7 @@ COPYRIGHT 1993-1998 PARALLAX SOFTWARE CORPORATION. ALL RIGHTS RESERVED.
#include "ogl_init.h"
#endif
#include "bitmap.h"
#include "compiler-make_unique.h"
#include <memory>
namespace dcx {

View file

@ -26,8 +26,7 @@ COPYRIGHT 1993-1998 PARALLAX SOFTWARE CORPORATION. ALL RIGHTS RESERVED.
#if DXX_USE_OGL
#include "ogl_init.h"
#endif
#include "compiler-make_unique.h"
#include <memory>
namespace dcx {

View file

@ -1,37 +0,0 @@
#pragma once
#include <memory>
#ifdef DXX_HAVE_CXX14_MAKE_UNIQUE
using std::make_unique;
#else
namespace detail {
template <typename T>
struct unique_enable
{
typedef std::unique_ptr<T> scalar_type;
};
template <typename T>
struct unique_enable<T[]>
{
typedef std::unique_ptr<T[]> vector_type;
typedef T element_type;
};
template <typename T, std::size_t N>
struct unique_enable<T[N]> {};
}
template <typename T, typename... Args>
static inline typename detail::unique_enable<T>::scalar_type make_unique(Args&&... args)
{
return typename detail::unique_enable<T>::scalar_type{new T(std::forward<Args>(args)...)};
}
template <typename T>
static inline typename detail::unique_enable<T>::vector_type make_unique(std::size_t N)
{
return typename detail::unique_enable<T>::vector_type{new typename detail::unique_enable<T>::element_type[N]()};
}
#endif

View file

@ -39,9 +39,9 @@
#include "u_mem.h"
#include "pack.h"
#include "ntstring.h"
#include "compiler-make_unique.h"
#include "partial_range.h"
#include <array>
#include <memory>
#ifdef DXX_CONSTANT_TRUE
#define _DXX_PHYSFS_CHECK_SIZE_CONSTANT(S,v) DXX_CONSTANT_TRUE((S) > (v))

View file

@ -38,9 +38,9 @@ COPYRIGHT 1993-1999 PARALLAX SOFTWARE CORPORATION. ALL RIGHTS RESERVED.
#include "fwd-gr.h"
#include "varutil.h"
#include "window.h"
#include "compiler-make_unique.h"
#include "ntstring.h"
#include <array>
#include <memory>
namespace dcx {

View file

@ -27,8 +27,8 @@
#include "cvar.h"
#include "physfsx.h"
#include "compiler-make_unique.h"
#include "compiler-range_for.h"
#include <memory>
namespace {

View file

@ -24,10 +24,10 @@
#include "dxxsconf.h"
#include "dsx-ns.h"
#include "compiler-make_unique.h"
#include "compiler-range_for.h"
#include "d_range.h"
#include "partial_range.h"
#include <memory>
namespace dcx {

View file

@ -37,8 +37,7 @@ COPYRIGHT 1993-1999 PARALLAX SOFTWARE CORPORATION. ALL RIGHTS RESERVED.
#include "mouse.h"
#include "timer.h"
#include "dxxerror.h"
#include "compiler-make_unique.h"
#include <memory>
namespace dcx {

View file

@ -33,9 +33,9 @@ COPYRIGHT 1993-1999 PARALLAX SOFTWARE CORPORATION. ALL RIGHTS RESERVED.
#include "physfsx.h"
#include "physfs_list.h"
#include "compiler-make_unique.h"
#include "compiler-range_for.h"
#include "d_range.h"
#include <memory>
namespace dcx {

View file

@ -31,9 +31,9 @@ COPYRIGHT 1993-1999 PARALLAX SOFTWARE CORPORATION. ALL RIGHTS RESERVED.
#include "func.h"
#include "dxxerror.h"
#include "compiler-make_unique.h"
#include "compiler-range_for.h"
#include "d_range.h"
#include <memory>
namespace dcx {

View file

@ -30,7 +30,7 @@ COPYRIGHT 1993-1999 PARALLAX SOFTWARE CORPORATION. ALL RIGHTS RESERVED.
#include "dxxsconf.h"
#include "dsx-ns.h"
#include "compiler-make_unique.h"
#include <memory>
namespace dcx {

View file

@ -32,8 +32,8 @@ COPYRIGHT 1993-1999 PARALLAX SOFTWARE CORPORATION. ALL RIGHTS RESERVED.
#include "dxxsconf.h"
#include "dsx-ns.h"
#include "compiler-make_unique.h"
#include <array>
#include <memory>
namespace dcx {

View file

@ -52,8 +52,7 @@ COPYRIGHT 1993-1998 PARALLAX SOFTWARE CORPORATION. ALL RIGHTS RESERVED.
#include "piggy.h"
#include "u_mem.h"
#include "event.h"
#include "compiler-make_unique.h"
#include <memory>
//-------------------------------------------------------------------------
// Variables for this module...

View file

@ -23,9 +23,9 @@
#include "physfsx.h"
#include "compiler-begin.h"
#include "compiler-make_unique.h"
#include "compiler-range_for.h"
#include "partial_range.h"
#include <memory>
//#define D2TMAP_CONV // used for testing

View file

@ -13,8 +13,7 @@
#endif
#include "mvelib.h"
#include "compiler-make_unique.h"
#include <memory>
static const char MVE_HEADER[] = "Interplay MVE File\x1A";
constexpr short MVE_HDRCONST1 = 0x001A;

View file

@ -40,8 +40,7 @@
#include "args.h"
#include "console.h"
#include "u_mem.h"
#include "compiler-make_unique.h"
#include <memory>
#define MVE_OPCODE_ENDOFSTREAM 0x00
#define MVE_OPCODE_ENDOFCHUNK 0x01

View file

@ -50,9 +50,9 @@ COPYRIGHT 1993-1999 PARALLAX SOFTWARE CORPORATION. ALL RIGHTS RESERVED.
#endif
#include "compiler-range_for.h"
#include "compiler-make_unique.h"
#include "partial_range.h"
#include <array>
#include <memory>
static font_x_scale_float FONTSCALE_X()
{

View file

@ -72,8 +72,7 @@
#endif
#include "ogl_sync.h"
#include "compiler-make_unique.h"
#include <memory>
using std::min;
using std::max;

View file

@ -60,12 +60,12 @@
#include "object.h"
#include "args.h"
#include "compiler-make_unique.h"
#include "compiler-range_for.h"
#include "d_range.h"
#include "partial_range.h"
#include <algorithm>
#include <memory>
#include <utility>
using std::max;

View file

@ -36,8 +36,7 @@
#include "maths.h"
#include "piggy.h"
#include "u_mem.h"
#include "compiler-make_unique.h"
#include <memory>
#define MIX_DIGI_DEBUG 0
#define MIX_OUTPUT_FORMAT AUDIO_S16

View file

@ -29,9 +29,9 @@
#include "config.h"
#include "palette.h"
#include "compiler-make_unique.h"
#include "compiler-range_for.h"
#include "d_range.h"
#include <memory>
using std::min;

View file

@ -24,8 +24,8 @@
#include "physfs_list.h"
#include "digi.h"
#include "compiler-make_unique.h"
#include "partial_range.h"
#include <memory>
namespace dcx {

View file

@ -56,8 +56,8 @@ COPYRIGHT 1993-1998 PARALLAX SOFTWARE CORPORATION. ALL RIGHTS RESERVED.
#include "centers.h"
#include "u_mem.h"
#include "compiler-make_unique.h"
#include "compiler-range_for.h"
#include <memory>
//-------------------------------------------------------------------------
// Variables for this module...

View file

@ -50,9 +50,9 @@ COPYRIGHT 1993-1998 PARALLAX SOFTWARE CORPORATION. ALL RIGHTS RESERVED.
#include "piggy.h"
#include "u_mem.h"
#include "compiler-make_unique.h"
#include "compiler-range_for.h"
#include "partial_range.h"
#include <memory>
//-------------------------------------------------------------------------
// Variables for this module...

View file

@ -56,9 +56,9 @@ COPYRIGHT 1993-1998 PARALLAX SOFTWARE CORPORATION. ALL RIGHTS RESERVED.
#include "bm.h"
#include "u_mem.h"
#include "compiler-make_unique.h"
#include "compiler-range_for.h"
#include "d_enumerate.h"
#include <memory>
static int GoodyNextID();
static int GoodyPrevID();

View file

@ -53,10 +53,10 @@ COPYRIGHT 1993-1998 PARALLAX SOFTWARE CORPORATION. ALL RIGHTS RESERVED.
#include "u_mem.h"
#include "d_enumerate.h"
#include "compiler-make_unique.h"
#include "compiler-range_for.h"
#include "d_range.h"
#include "partial_range.h"
#include <memory>
#include <utility>
static int wall_add_to_side(fvcvertptr &vcvertptr, wall_array &Walls, const vmsegptridx_t segp, unsigned side, unsigned type);

View file

@ -84,9 +84,9 @@ COPYRIGHT 1993-1999 PARALLAX SOFTWARE CORPORATION. ALL RIGHTS RESERVED.
#include "args.h"
#include "physics.h"
#include "compiler-make_unique.h"
#include "compiler-range_for.h"
#include "partial_range.h"
#include <memory>
#define LEAVE_TIME 0x4000

View file

@ -66,9 +66,9 @@ COPYRIGHT 1993-1999 PARALLAX SOFTWARE CORPORATION. ALL RIGHTS RESERVED.
#endif
#include "compiler-range_for.h"
#include "compiler-make_unique.h"
#include "d_range.h"
#include "partial_range.h"
#include <memory>
std::array<ubyte, MAX_SOUNDS> Sounds, AltSounds;

View file

@ -43,8 +43,7 @@ COPYRIGHT 1993-1999 PARALLAX SOFTWARE CORPORATION. ALL RIGHTS RESERVED.
#include "u_mem.h"
#include "physfsx.h"
#include "nvparse.h"
#include "compiler-make_unique.h"
#include <memory>
namespace dcx {
CCfg CGameCfg;

View file

@ -57,8 +57,7 @@ COPYRIGHT 1993-1999 PARALLAX SOFTWARE CORPORATION. ALL RIGHTS RESERVED.
#include "args.h"
#endif
#include "piggy.h"
#include "compiler-make_unique.h"
#include <memory>
#define ROW_SPACING (SHEIGHT / 17)
#define NUM_LINES 20 //14

View file

@ -41,8 +41,8 @@ COPYRIGHT 1993-1999 PARALLAX SOFTWARE CORPORATION. ALL RIGHTS RESERVED.
#include "dxxsconf.h"
#include "compiler-range_for.h"
#include "compiler-make_unique.h"
#include "partial_range.h"
#include <memory>
//Internal constants and structures for this library

View file

@ -93,10 +93,10 @@ COPYRIGHT 1993-1999 PARALLAX SOFTWARE CORPORATION. ALL RIGHTS RESERVED.
#include "dxxsconf.h"
#include "dsx-ns.h"
#include "compiler-make_unique.h"
#include "compiler-range_for.h"
#include "d_range.h"
#include "partial_range.h"
#include <memory>
#include <utility>
// Menu IDs...

View file

@ -58,10 +58,10 @@ COPYRIGHT 1993-1999 PARALLAX SOFTWARE CORPORATION. ALL RIGHTS RESERVED.
#endif
#include "null_sentinel_iterator.h"
#include "compiler-make_unique.h"
#include "compiler-poison.h"
#include "compiler-range_for.h"
#include "d_enumerate.h"
#include <memory>
#define BIMD1_BRIEFING_FILE "briefing.txb"

View file

@ -59,9 +59,9 @@ COPYRIGHT 1993-1999 PARALLAX SOFTWARE CORPORATION. ALL RIGHTS RESERVED.
#include "console.h"
#include "compiler-cf_assert.h"
#include "compiler-range_for.h"
#include "compiler-make_unique.h"
#include "d_range.h"
#include "partial_range.h"
#include <memory>
#if defined(DXX_BUILD_DESCENT_I)
#include "custom.h"

View file

@ -52,8 +52,8 @@ COPYRIGHT 1993-1999 PARALLAX SOFTWARE CORPORATION. ALL RIGHTS RESERVED.
#endif
#include "bm.h"
#include "compiler-make_unique.h"
#include "partial_range.h"
#include <memory>
namespace dcx {
unsigned N_polygon_models = 0;

View file

@ -44,8 +44,8 @@ COPYRIGHT 1993-1999 PARALLAX SOFTWARE CORPORATION. ALL RIGHTS RESERVED.
#include "args.h"
#include "physfsx.h"
#include "game.h"
#include "compiler-make_unique.h"
#include "console.h"
#include <memory>
namespace dcx {

View file

@ -43,8 +43,7 @@ COPYRIGHT 1993-1999 PARALLAX SOFTWARE CORPORATION. ALL RIGHTS RESERVED.
#include "player.h"
#include "segment.h"
#include "terrain.h"
#include "compiler-make_unique.h"
#include <memory>
#define GRID_MAX_SIZE 64
#define GRID_SCALE i2f(2*20)

View file

@ -35,8 +35,7 @@ COPYRIGHT 1993-1999 PARALLAX SOFTWARE CORPORATION. ALL RIGHTS RESERVED.
#include "text.h"
#include "strutil.h"
#include "args.h"
#include "compiler-make_unique.h"
#include <memory>
#ifdef GENERATE_BUILTIN_TEXT_TABLE
#include <ctype.h>

View file

@ -67,9 +67,9 @@ COPYRIGHT 1993-1999 PARALLAX SOFTWARE CORPORATION. ALL RIGHTS RESERVED.
#include "args.h"
#include "strutil.h"
#include "compiler-make_unique.h"
#include "compiler-range_for.h"
#include "partial_range.h"
#include <memory>
#if defined(DXX_BUILD_DESCENT_I)
constexpr std::true_type EMULATING_D1{};