Skip to content

Commit

Permalink
Tiny op_wrap fix
Browse files Browse the repository at this point in the history
git-svn-id: http://svn.dsource.org/projects/pyd/trunk@47 1df65b71-e716-0410-9316-ac55df2b1602
  • Loading branch information
KirkMcDonald authored and KirkMcDonald committed Nov 26, 2006
1 parent 994aff7 commit 1b3078a
Showing 1 changed file with 12 additions and 5 deletions.
17 changes: 12 additions & 5 deletions infrastructure/pyd/op_wrap.d
Original file line number Diff line number Diff line change
Expand Up @@ -121,17 +121,24 @@ template wrapped_class_as_mapping(T) {
template opfunc_binary_wrap(T, alias opfn) {
alias wrapped_class_object!(T) wrap_object;
alias ParameterTypeTuple!(opfn) Info;
alias ReturnType!(opfn) Ret;
extern(C)
PyObject* func(PyObject* self, PyObject* o) {
return exception_catcher(delegate PyObject*() {
auto dg = dg_wrapper((cast(wrap_object*)self).d_obj, &opfn);
pragma(msg, prettytypeof!(typeof(dg)));
pragma(msg, symbolnameof!(opfn));
return _py(
dg(
d_type!(Info[0])(o)
)
);
static if (is(Ret == void)) {
dg(d_type!(Info[0])(o));
Py_INCREF(Py_None);
return Py_None;
} else {
return _py(
dg(
d_type!(Info[0])(o)
)
);
}
});
}
}
Expand Down

0 comments on commit 1b3078a

Please sign in to comment.