parent
857e447654
commit
9be3235988
3 changed files with 23 additions and 0 deletions
|
|
@ -9,6 +9,8 @@ if special_variable_macros.testJill(name) != "jilly":
|
||||||
raise "test failed"
|
raise "test failed"
|
||||||
if special_variable_macros.testMary(name) != "SWIGTYPE_p_NameWrap":
|
if special_variable_macros.testMary(name) != "SWIGTYPE_p_NameWrap":
|
||||||
raise "test failed"
|
raise "test failed"
|
||||||
|
if special_variable_macros.testJames(name) != "SWIGTYPE_Name":
|
||||||
|
raise "test failed"
|
||||||
if special_variable_macros.testJim(name) != "multiname num":
|
if special_variable_macros.testJim(name) != "multiname num":
|
||||||
raise "test failed"
|
raise "test failed"
|
||||||
if special_variable_macros.testJohn(special_variable_macros.PairIntBool(10, False)) != 123:
|
if special_variable_macros.testJohn(special_variable_macros.PairIntBool(10, False)) != 123:
|
||||||
|
|
|
||||||
|
|
@ -62,6 +62,14 @@ private:
|
||||||
/*%typemap(in) NameWrap *NAMEWRAP end */
|
/*%typemap(in) NameWrap *NAMEWRAP end */
|
||||||
%}
|
%}
|
||||||
|
|
||||||
|
// check $descriptor gets expanded properly when used in a fragment
|
||||||
|
%fragment("nameDescriptor", "header")
|
||||||
|
%{
|
||||||
|
/*%fragment("getNameDescriptor", "header") start */
|
||||||
|
static const char *nameDescriptor = "$descriptor(Name)";
|
||||||
|
/*%fragment("getNameDescriptor", "header") end */
|
||||||
|
%}
|
||||||
|
|
||||||
|
|
||||||
//////////////////////////////////////////////////////////////////////////////////////
|
//////////////////////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
|
|
@ -86,6 +94,14 @@ $typemap(in, NameWrap *NAMEWRAP)
|
||||||
// %typemap(in) Name *mary end
|
// %typemap(in) Name *mary end
|
||||||
}
|
}
|
||||||
|
|
||||||
|
%typemap(in, fragment="nameDescriptor") Name *james (Name temp) {
|
||||||
|
// %typemap(in) Name *james start
|
||||||
|
temp = Name(nameDescriptor);
|
||||||
|
(void)$input;
|
||||||
|
$1 = &temp;
|
||||||
|
// %typemap(in) Name *james end
|
||||||
|
}
|
||||||
|
|
||||||
%inline %{
|
%inline %{
|
||||||
const char * testFred(Name *fred) {
|
const char * testFred(Name *fred) {
|
||||||
return fred->getName();
|
return fred->getName();
|
||||||
|
|
@ -99,6 +115,9 @@ const char * testJill(Name *jill) {
|
||||||
const char * testMary(Name *mary) {
|
const char * testMary(Name *mary) {
|
||||||
return mary->getName();
|
return mary->getName();
|
||||||
}
|
}
|
||||||
|
const char * testJames(Name *james) {
|
||||||
|
return james->getName();
|
||||||
|
}
|
||||||
%}
|
%}
|
||||||
|
|
||||||
//////////////////////////////////////////////////////////////////////////////////////
|
//////////////////////////////////////////////////////////////////////////////////////
|
||||||
|
|
|
||||||
|
|
@ -60,6 +60,8 @@ void Swig_fragment_register(Node *fragment) {
|
||||||
}
|
}
|
||||||
Setfile(ccode, Getfile(fragment));
|
Setfile(ccode, Getfile(fragment));
|
||||||
Setline(ccode, Getline(fragment));
|
Setline(ccode, Getline(fragment));
|
||||||
|
/* Replace $descriptor() macros */
|
||||||
|
Swig_cparse_replace_descriptor(ccode);
|
||||||
Setattr(fragments, name, ccode);
|
Setattr(fragments, name, ccode);
|
||||||
if (debug)
|
if (debug)
|
||||||
Printf(stdout, "registering fragment %s %s\n", name, section);
|
Printf(stdout, "registering fragment %s %s\n", name, section);
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue