mirror of
https://github.com/holub/mame
synced 2025-06-06 04:43:45 +03:00
nl_setup.cpp: Fix for some compilers not being CWG 1579 compliant (nw)
This commit is contained in:
parent
58f3c274f4
commit
0572ca886e
@ -15,6 +15,13 @@
|
||||
|
||||
#include "solver/nld_solver.h"
|
||||
|
||||
// Workaround for return value optimization failure in some older versions of clang
|
||||
#if defined(__APPLE__) && defined(__clang__) && __clang_major__ < 8
|
||||
#define MOVE_UNIQUE_PTR(x) (std::move(x))
|
||||
#else
|
||||
#define MOVE_UNIQUE_PTR(x) (x)
|
||||
#endif
|
||||
|
||||
namespace netlist
|
||||
{
|
||||
// ----------------------------------------------------------------------------------------
|
||||
@ -1597,7 +1604,7 @@ source_string_t::stream_ptr source_string_t::stream(const pstring &name)
|
||||
plib::unused_var(name);
|
||||
auto ret(std::make_unique<std::istringstream>(m_str));
|
||||
ret->imbue(std::locale::classic());
|
||||
return ret;
|
||||
return MOVE_UNIQUE_PTR(ret);
|
||||
}
|
||||
|
||||
source_mem_t::stream_ptr source_mem_t::stream(const pstring &name)
|
||||
@ -1605,7 +1612,7 @@ source_mem_t::stream_ptr source_mem_t::stream(const pstring &name)
|
||||
plib::unused_var(name);
|
||||
auto ret(std::make_unique<std::istringstream>(m_str, std::ios_base::binary));
|
||||
ret->imbue(std::locale::classic());
|
||||
return ret;
|
||||
return MOVE_UNIQUE_PTR(ret);
|
||||
}
|
||||
|
||||
source_file_t::stream_ptr source_file_t::stream(const pstring &name)
|
||||
|
Loading…
Reference in New Issue
Block a user