From 4f8b04f0bf4abbc466f79836397fc98aa9ea77b3 Mon Sep 17 00:00:00 2001 From: Marcelo Matus Date: Tue, 26 Oct 2004 18:13:48 +0000 Subject: [PATCH] scott's fix for director + def. const. git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk/SWIG@6519 626c5289-ae23-0410-ae9c-e8d60b6d4f22 --- Source/Modules/lang.cxx | 23 +++++++++++++++-------- 1 file changed, 15 insertions(+), 8 deletions(-) diff --git a/Source/Modules/lang.cxx b/Source/Modules/lang.cxx index 7b31a29a8..70e81ab5c 100644 --- a/Source/Modules/lang.cxx +++ b/Source/Modules/lang.cxx @@ -1698,16 +1698,23 @@ int Language::classDirectorConstructors(Node *n) { } classDirectorDefaultConstructor(n); default_ctor = 1; - } else { - /* this is just to support old java behavior, ie, the default - constructor is always emitted, even when protected, and not - needed, since there is a public constructor already defined. */ - if (!default_ctor && !protected_ctor) { - if (Getattr(parent,"allocate:default_base_constructor")) { - classDirectorDefaultConstructor(n); - } + } + /* this is just to support old java behavior, ie, the default + constructor is always emitted, even when protected, and not + needed, since there is a public constructor already defined. + + (scottm) This code is needed here to make the director_abstract + + test generate compileable code (Example2 in director_abastract.i). + + (mmatus) This is very strange, since swig compiled with gcc3.2.3 + doesn't need it here.... + */ + if (!default_ctor && !protected_ctor) { + if (Getattr(parent,"allocate:default_base_constructor")) { + classDirectorDefaultConstructor(n); } } + return SWIG_OK; }