Skip to content

Commit a832762

Browse files
committed
Fixed a compile errror
1 parent 006aeb1 commit a832762

2 files changed

Lines changed: 7 additions & 1 deletion

File tree

src/core/modules/entities/entities_props_wrap.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -117,7 +117,7 @@ void export_send_table(scope _props)
117117
void export_send_prop(scope _props)
118118
{
119119
EXPOSE_FUNCTION_TYPEDEF(BoostSendVarProxyFn, "SendVarProxyFn")
120-
EXPOSE_FUNCTION_TYPEDEF(BoostDataTableProxyFn, "DataTableProxyFn")
120+
EXPOSE_FUNCTION_TYPEDEF_RET(BoostDataTableProxyFn, "DataTableProxyFn", return_by_value_policy())
121121

122122
class_<SendProp, SendProp *, boost::noncopyable> SendProp_("SendProp", no_init);
123123

src/core/utilities/wrap_macros.h

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,12 @@ inline void* GetFuncPtr(Function func)
6868
.def(GET_PTR_NAME, &GetFuncPtr<cpp_name>, return_by_value_policy()) \
6969
;
7070

71+
#define EXPOSE_FUNCTION_TYPEDEF_RET(cpp_name, py_name, policy) \
72+
class_<cpp_name>(py_name, no_init) \
73+
.def("__call__", &cpp_name::operator(), policy) \
74+
.def(GET_PTR_NAME, &GetFuncPtr<cpp_name>, return_by_value_policy()) \
75+
;
76+
7177
//---------------------------------------------------------------------------------
7278
// Surround boost python statements with this macro in order to handle exceptions.
7379
//---------------------------------------------------------------------------------

0 commit comments

Comments
 (0)