summaryrefslogtreecommitdiffstatshomepage
path: root/src/lib/netlist/nl_setup.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/lib/netlist/nl_setup.cpp')
-rw-r--r--src/lib/netlist/nl_setup.cpp11
1 files changed, 9 insertions, 2 deletions
diff --git a/src/lib/netlist/nl_setup.cpp b/src/lib/netlist/nl_setup.cpp
index b6c466be6e7..0608ce6cd99 100644
--- a/src/lib/netlist/nl_setup.cpp
+++ b/src/lib/netlist/nl_setup.cpp
@@ -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)