OCaml director return fix
Fixes director_unwrap_result testcase when returning Element *const *&
This commit is contained in:
parent
2f55379687
commit
0239ba5536
1 changed files with 4 additions and 11 deletions
|
|
@ -1647,20 +1647,13 @@ public:
|
||||||
/* any existing helper functions to handle this? */
|
/* any existing helper functions to handle this? */
|
||||||
if (!is_void) {
|
if (!is_void) {
|
||||||
if (!(ignored_method && !pure_virtual)) {
|
if (!(ignored_method && !pure_virtual)) {
|
||||||
/* A little explanation:
|
String *rettype = SwigType_str(returntype, 0);
|
||||||
* The director_enum test case makes a method whose return type
|
|
||||||
* is an enum type. returntype here is "int". gcc complains
|
|
||||||
* about an implicit enum conversion, and although i don't strictly
|
|
||||||
* agree with it, I'm working on fixing the error:
|
|
||||||
*
|
|
||||||
* Below is what I came up with. It's not great but it should
|
|
||||||
* always essentially work.
|
|
||||||
*/
|
|
||||||
if (!SwigType_isreference(returntype)) {
|
if (!SwigType_isreference(returntype)) {
|
||||||
Printf(w->code, "CAMLreturn_type((%s)c_result);\n", SwigType_lstr(returntype, ""));
|
Printf(w->code, "CAMLreturn_type((%s)c_result);\n", rettype);
|
||||||
} else {
|
} else {
|
||||||
Printf(w->code, "CAMLreturn_type(*c_result);\n");
|
Printf(w->code, "CAMLreturn_type((%s)*c_result);\n", rettype);
|
||||||
}
|
}
|
||||||
|
Delete(rettype);
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
Printf(w->code, "CAMLreturn0;\n");
|
Printf(w->code, "CAMLreturn0;\n");
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue