Expand "$null" in typemaps in C backend too
This is used in some exception-related typemaps, both in SWIG itself (although they're not used with C backend currently) and outside of it.
This commit is contained in:
parent
0706ed4d35
commit
45bb179407
2 changed files with 10 additions and 1 deletions
|
|
@ -607,6 +607,10 @@ Finally, the return value variable is returned.
|
||||||
return result;
|
return result;
|
||||||
</pre></div>
|
</pre></div>
|
||||||
|
|
||||||
|
Note that typemaps may use <tt>$null</tt> special variable which will be
|
||||||
|
replaced with either <tt>0</tt> or nothing, depending on whether the function
|
||||||
|
has a non-void return value or not.
|
||||||
|
|
||||||
<H4>The Proxy</H4>
|
<H4>The Proxy</H4>
|
||||||
Compared to the wrapper code generation, the header code is very simple.</br>
|
Compared to the wrapper code generation, the header code is very simple.</br>
|
||||||
Basically it contains just the declarations corresponding to the definitions
|
Basically it contains just the declarations corresponding to the definitions
|
||||||
|
|
|
||||||
|
|
@ -1026,8 +1026,13 @@ public:
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!is_void_return)
|
if (is_void_return) {
|
||||||
|
Replaceall(wrapper->code, "$null", "");
|
||||||
|
} else {
|
||||||
|
Replaceall(wrapper->code, "$null", "0");
|
||||||
|
|
||||||
Append(wrapper->code, "return result;\n");
|
Append(wrapper->code, "return result;\n");
|
||||||
|
}
|
||||||
|
|
||||||
Append(wrapper->code, "}\n");
|
Append(wrapper->code, "}\n");
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue