summaryrefslogtreecommitdiffstatshomepage
path: root/src/lib/netlist/nl_setup.cpp
diff options
context:
space:
mode:
author couriersud <couriersud@gmx.org>2020-06-14 00:04:34 +0200
committer couriersud <couriersud@gmx.org>2020-06-14 00:04:34 +0200
commitfe3bd223d83ec8cf1dbf8a8623b4367abb49c3b3 (patch)
treef93651dfcefa76889da5df0d4820b95115366f19 /src/lib/netlist/nl_setup.cpp
parent23c0490019ea90a33eb2b06ff9eb617e56357f13 (diff)
netlist: Fix copy elusion bug on OSX and clang < 8 [AJR, Couriersud]
Solution discussed with AJR in chat.
Diffstat (limited to 'src/lib/netlist/nl_setup.cpp')
-rw-r--r--src/lib/netlist/nl_setup.cpp15
1 files changed, 4 insertions, 11 deletions
diff --git a/src/lib/netlist/nl_setup.cpp b/src/lib/netlist/nl_setup.cpp
index 0608ce6cd99..d759ce13e92 100644
--- a/src/lib/netlist/nl_setup.cpp
+++ b/src/lib/netlist/nl_setup.cpp
@@ -15,13 +15,6 @@
#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
{
// ----------------------------------------------------------------------------------------
@@ -1602,17 +1595,17 @@ bool source_netlist_t::parse(nlparse_t &setup, const pstring &name)
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));
+ source_string_t::stream_ptr ret(std::make_unique<std::istringstream>(m_str));
ret->imbue(std::locale::classic());
- return MOVE_UNIQUE_PTR(ret);
+ return ret;
}
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));
+ source_mem_t::stream_ptr ret(std::make_unique<std::istringstream>(m_str, std::ios_base::binary));
ret->imbue(std::locale::classic());
- return MOVE_UNIQUE_PTR(ret);
+ return ret;
}
source_file_t::stream_ptr source_file_t::stream(const pstring &name)