mirror of
https://github.com/holub/mame
synced 2025-04-19 23:12:11 +03:00
Make netlist compile with c++11, use own implementation of make_unique
to avoid c++14. (nw)
This commit is contained in:
parent
cac1c41edf
commit
f5179f7ec8
@ -42,7 +42,7 @@ NETLIB_OBJECT(log)
|
||||
enregister("I", m_I);
|
||||
|
||||
pstring filename = pfmt("{1}.log")(this->name());
|
||||
m_strm = std::make_unique<pofilestream>(filename);
|
||||
m_strm = pmake_unique<pofilestream>(filename);
|
||||
}
|
||||
NETLIB_DESTRUCTOR(log);
|
||||
NETLIB_UPDATEI();
|
||||
|
@ -10,6 +10,8 @@
|
||||
|
||||
#include <exception>
|
||||
#include <vector>
|
||||
#include <memory>
|
||||
#include <utility>
|
||||
|
||||
#include "pconfig.h"
|
||||
#include "pstring.h"
|
||||
@ -121,6 +123,11 @@ inline void pfree_array_t(T *p)
|
||||
|
||||
#endif
|
||||
|
||||
template<typename T, typename... Args>
|
||||
std::unique_ptr<T> pmake_unique(Args&&... args) {
|
||||
return std::unique_ptr<T>(new T(std::forward<Args>(args)...));
|
||||
}
|
||||
|
||||
class pmempool
|
||||
{
|
||||
private:
|
||||
|
@ -36,7 +36,7 @@ ATTR_COLD void pstate_manager_t::save_state_ptr(const pstring &stname, const pst
|
||||
"DT_FLOAT"
|
||||
};
|
||||
|
||||
auto p = std::make_unique<pstate_entry_t>(stname, dt, owner, size, count, ptr, is_ptr);
|
||||
auto p = pmake_unique<pstate_entry_t>(stname, dt, owner, size, count, ptr, is_ptr);
|
||||
m_save.push_back(std::move(p));
|
||||
}
|
||||
|
||||
@ -70,7 +70,7 @@ template<> ATTR_COLD void pstate_manager_t::save_item(pstate_callback_t &state,
|
||||
{
|
||||
//save_state_ptr(stname, DT_CUSTOM, 0, 1, &state);
|
||||
pstate_callback_t *state_p = &state;
|
||||
auto p = std::make_unique<pstate_entry_t>(stname, owner, state_p);
|
||||
auto p = pmake_unique<pstate_entry_t>(stname, owner, state_p);
|
||||
m_save.push_back(std::move(p));
|
||||
state.register_state(*this, stname);
|
||||
}
|
||||
|
@ -38,7 +38,7 @@ static pvector_t<int> bubble(const pvector_t<Class> &sl)
|
||||
void nl_convert_base_t::add_pin_alias(const pstring &devname, const pstring &name, const pstring &alias)
|
||||
{
|
||||
pstring pname = devname + "." + name;
|
||||
m_pins.add(pname, std::make_unique<pin_alias_t>(pname, devname + "." + alias));
|
||||
m_pins.add(pname, pmake_unique<pin_alias_t>(pname, devname + "." + alias));
|
||||
}
|
||||
|
||||
void nl_convert_base_t::add_ext_alias(const pstring &alias)
|
||||
|
Loading…
Reference in New Issue
Block a user