Fix "define-method" generation for methods of classes with a

constructor.  Reported by Luigi Ballabio.


git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk/SWIG@7163 626c5289-ae23-0410-ae9c-e8d60b6d4f22
This commit is contained in:
Matthias Köppe 2005-04-22 12:28:51 +00:00
commit 8deae44cc6

View file

@ -126,6 +126,13 @@ static int primRenamer = 0; // if (use-modules ((...) :renamer ...) is expor
static int exportprimitive = 0; // -exportprimitive argument
static String *memberfunction_name = 0;
extern "C" {
static int has_classname(Node *class_node)
{
return Getattr(class_node, "guile:goopsclassname") != NULL;
}
}
class GUILE : public Language {
public:
@ -683,7 +690,7 @@ public:
* functionWrapper()
* Create a function declaration and register it with the interpreter.
* ------------------------------------------------------------ */
virtual int functionWrapper(Node *n) {
String *iname = Getattr(n,"sym:name");
SwigType *d = Getattr(n,"type");
@ -829,7 +836,8 @@ public:
if (goops) {
if (i < numreq) {
if (strcmp("void", Char(pt)) != 0) {
Node *class_node = Swig_symbol_clookup(pb, Getattr(n, "sym:symtab"));
Node *class_node = Swig_symbol_clookup_check(pb, Getattr(n, "sym:symtab"),
has_classname);
String *goopsclassname = (class_node == NULL) ? NULL :
Getattr(class_node, "guile:goopsclassname");
/* do input conversion */