Fix so the following produces compileable code like it does in other language modules:
struct XYZ{};
%{ struct XYZ{}; %}
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk@6944 626c5289-ae23-0410-ae9c-e8d60b6d4f22
This commit is contained in:
parent
4bbc9c18b3
commit
8a22867e9a
1 changed files with 2 additions and 19 deletions
|
|
@ -45,7 +45,6 @@ char cvsroot_ruby_cxx[] = "$Header$";
|
||||||
|
|
||||||
String *type;
|
String *type;
|
||||||
String *prefix;
|
String *prefix;
|
||||||
String *header;
|
|
||||||
String *init;
|
String *init;
|
||||||
|
|
||||||
int constructor_defined;
|
int constructor_defined;
|
||||||
|
|
@ -60,7 +59,6 @@ char cvsroot_ruby_cxx[] = "$Header$";
|
||||||
mImpl = NewString("");
|
mImpl = NewString("");
|
||||||
type = NewString("");
|
type = NewString("");
|
||||||
prefix = NewString("");
|
prefix = NewString("");
|
||||||
header = NewString("");
|
|
||||||
init = NewString("");
|
init = NewString("");
|
||||||
constructor_defined = 0;
|
constructor_defined = 0;
|
||||||
destructor_defined = 0;
|
destructor_defined = 0;
|
||||||
|
|
@ -74,7 +72,6 @@ char cvsroot_ruby_cxx[] = "$Header$";
|
||||||
Delete(mname);
|
Delete(mname);
|
||||||
Delete(type);
|
Delete(type);
|
||||||
Delete(prefix);
|
Delete(prefix);
|
||||||
Delete(header);
|
|
||||||
Delete(init);
|
Delete(init);
|
||||||
Delete(temp);
|
Delete(temp);
|
||||||
}
|
}
|
||||||
|
|
@ -1618,7 +1615,6 @@ public:
|
||||||
Printf(klass->init, "c%s.destroy = (void (*)(void *)) free_%s;\n", klass->name, klass->mname);
|
Printf(klass->init, "c%s.destroy = (void (*)(void *)) free_%s;\n", klass->name, klass->mname);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
Replaceall(klass->header,"$freeproto", "");
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/* ----------------------------------------------------------------------
|
/* ----------------------------------------------------------------------
|
||||||
|
|
@ -1639,7 +1635,7 @@ public:
|
||||||
|
|
||||||
Clear(klass->type);
|
Clear(klass->type);
|
||||||
Printv(klass->type, Getattr(n,"classtype"), NIL);
|
Printv(klass->type, Getattr(n,"classtype"), NIL);
|
||||||
Printv(klass->header, "\nswig_class c", valid_name, ";\n", NIL);
|
Printv(f_wrappers, "swig_class c", valid_name, ";\n\n", NIL);
|
||||||
Printv(klass->init, "\n", tab4, NIL);
|
Printv(klass->init, "\n", tab4, NIL);
|
||||||
if (multipleInheritance) {
|
if (multipleInheritance) {
|
||||||
if (!useGlobalModule) {
|
if (!useGlobalModule) {
|
||||||
|
|
@ -1674,10 +1670,6 @@ public:
|
||||||
Printv(klass->init, "$allocator",NIL);
|
Printv(klass->init, "$allocator",NIL);
|
||||||
Printv(klass->init, "$initializer",NIL);
|
Printv(klass->init, "$initializer",NIL);
|
||||||
|
|
||||||
Printv(klass->header,
|
|
||||||
"$freeproto",
|
|
||||||
NIL);
|
|
||||||
|
|
||||||
Language::classHandler(n);
|
Language::classHandler(n);
|
||||||
|
|
||||||
handleBaseClasses(n);
|
handleBaseClasses(n);
|
||||||
|
|
@ -1688,8 +1680,6 @@ public:
|
||||||
Printv(klass->init, "rb_include_module(", klass->vname, ", ", klass->mImpl, ");\n", NIL);
|
Printv(klass->init, "rb_include_module(", klass->vname, ", ", klass->mImpl, ");\n", NIL);
|
||||||
}
|
}
|
||||||
|
|
||||||
Printv(f_header, klass->header,NIL);
|
|
||||||
|
|
||||||
String *s = NewString("");
|
String *s = NewString("");
|
||||||
Printv(s, tab4, "rb_undef_alloc_func(", klass->vname, ");\n", NIL);
|
Printv(s, tab4, "rb_undef_alloc_func(", klass->vname, ");\n", NIL);
|
||||||
Replaceall(klass->init,"$allocator", s);
|
Replaceall(klass->init,"$allocator", s);
|
||||||
|
|
@ -1835,21 +1825,16 @@ public:
|
||||||
Language::destructorHandler(n);
|
Language::destructorHandler(n);
|
||||||
|
|
||||||
String *freefunc = NewString("");
|
String *freefunc = NewString("");
|
||||||
String *freeproto = NewString("");
|
|
||||||
String *freebody = NewString("");
|
String *freebody = NewString("");
|
||||||
|
|
||||||
Printv(freefunc, "free_", klass->mname, NIL);
|
Printv(freefunc, "free_", klass->mname, NIL);
|
||||||
Printv(freeproto, "static void ", freefunc, "(", klass->type, " *);\n", NIL);
|
|
||||||
Printv(freebody, "static void\n",
|
Printv(freebody, "static void\n",
|
||||||
freefunc, "(", klass->type, " *", Swig_cparm_name(0,0), ") {\n",
|
freefunc, "(", klass->type, " *", Swig_cparm_name(0,0), ") {\n",
|
||||||
tab4, NIL);
|
tab4, NIL);
|
||||||
if (Extend) {
|
if (Extend) {
|
||||||
String *wrap = Getattr(n, "wrap:code");
|
String *wrap = Getattr(n, "wrap:code");
|
||||||
if (wrap) {
|
if (wrap) {
|
||||||
File *f_code = Swig_filebyname("header");
|
Printv(f_wrappers, wrap, NIL);
|
||||||
if (f_code) {
|
|
||||||
Printv(f_code, wrap, NIL);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
/* Printv(freebody, Swig_name_destroy(name), "(", Swig_cparm_name(0,0), ")", NIL); */
|
/* Printv(freebody, Swig_name_destroy(name), "(", Swig_cparm_name(0,0), ")", NIL); */
|
||||||
Printv(freebody,Getattr(n,"wrap:action"), NIL);
|
Printv(freebody,Getattr(n,"wrap:action"), NIL);
|
||||||
|
|
@ -1867,13 +1852,11 @@ public:
|
||||||
}
|
}
|
||||||
Printv(freebody, "}\n", NIL);
|
Printv(freebody, "}\n", NIL);
|
||||||
|
|
||||||
Replaceall(klass->header,"$freeproto", freeproto);
|
|
||||||
Printv(f_wrappers, freebody, NIL);
|
Printv(f_wrappers, freebody, NIL);
|
||||||
|
|
||||||
klass->destructor_defined = 1;
|
klass->destructor_defined = 1;
|
||||||
current = NO_CPP;
|
current = NO_CPP;
|
||||||
Delete(freefunc);
|
Delete(freefunc);
|
||||||
Delete(freeproto);
|
|
||||||
Delete(freebody);
|
Delete(freebody);
|
||||||
return SWIG_OK;
|
return SWIG_OK;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue