summaryrefslogtreecommitdiffstatshomepage
path: root/src
diff options
context:
space:
mode:
author smf- <smf-@users.noreply.github.com>2018-01-29 12:06:51 +0000
committer smf- <smf-@users.noreply.github.com>2018-01-29 12:07:47 +0000
commit6f377beb873cf7496645626e0234b4bb4c3e9a2e (patch)
treed56a2b60acabca76086c83bdcd5acd2e11afb097 /src
parent6fb696211b93ced646f7bda09d8ffb5302e420c6 (diff)
fix is_set() when generic_function is an int array (nw)
Diffstat (limited to 'src')
-rw-r--r--src/lib/netlist/plib/ppmf.h15
1 files changed, 14 insertions, 1 deletions
diff --git a/src/lib/netlist/plib/ppmf.h b/src/lib/netlist/plib/ppmf.h
index 726a6c63b42..dec380f4a8b 100644
--- a/src/lib/netlist/plib/ppmf.h
+++ b/src/lib/netlist/plib/ppmf.h
@@ -181,7 +181,19 @@ namespace plib {
function_ptr t = *reinterpret_cast<function_ptr *>(&m_func);
return (obj->*t)(std::forward<Targs>(args)...);
}
- bool is_set() { return m_func != nullptr; }
+ bool is_set() {
+#if defined(_MSC_VER) || (defined (__INTEL_COMPILER) && defined (_M_X64))
+ int *p = reinterpret_cast<int *>(&m_func);
+ int *e = p + sizeof(generic_function) / sizeof(int);
+ for (; p < e; p++)
+ if (*p != 0)
+ return true;
+
+ return false;
+#else
+ return m_func != nullptr;
+#endif
+ }
private:
generic_function m_func;
#if 0 && defined(_MSC_VER)
@@ -235,6 +247,7 @@ namespace plib {
pmfp(MemberFunctionType mftp, O *object)
: pmfp_base<R, Targs...>()
{
+ printf("constructor\n");
this->set(mftp, object);
}