Java wrapping mechanism doesn't work, showing the
need to use a different way to wrap polymorphic classes.
They are two runtime examples: one for java, which is
failing, and one for python, which works fine.
Detailed description of the case can be found
in the three files committed.
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk/SWIG@5582 626c5289-ae23-0410-ae9c-e8d60b6d4f22
They will give you and idea of what is currently working.
If you have another case you think we need to test, please
send me an email to add it and trying it here.
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk/SWIG@5581 626c5289-ae23-0410-ae9c-e8d60b6d4f22
the function 'need_protected' outside parser.y,
ie, if more subtle cases appear, they can be
fixed without changing parser.y.
Now parser.y looks much more like the original 1.32.
Source/CParse/parser.y: moving and fixing 'need_protected'
Source/CParse/util.c: moving and fixing 'need_protected'
Examples/test-suite/director_protected.i: more %rename cases
Examples/test-suite/director_using.i: fixing bad module name
The errors in question where related to the mix of
%rename + (typedef|static) + protected + dirprot_mode:
%rename(s) Foo::p;
%rename(q) Foo::r;
%inline {
class Foo {
public:
virtual ~Foo() {}
int p(){ return 1;}
int r(){ return 1;}
protected:
typedef int q();
static int s();
};
since q and s look like functions, the parser was adding them
completly to the symbol table, and clashing latter with the
attemped renames.
The error was only visible when dirprot was enabled, with
the old behavior it was ok.
Marcelo
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk/SWIG@5533 626c5289-ae23-0410-ae9c-e8d60b6d4f22
side for protected director members.
Lib/python/director.swg: added needed code for runtime checking
Source/Modules/python.cxx: added needed code for runtime checking
director_protected_runme.py: checks now that the runtime protection is working
The extra runtime checking is only done for protected members,
so, the old public directors members don't feel any overhead.
This finished the director protected support for the python language.
Java and Ocalm will need to add the "reprotection" mechanism latter.
But as in the python case, the changes will be localized in the
languages files, and there will be no need to touch the core
files anymore.
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk/SWIG@5532 626c5289-ae23-0410-ae9c-e8d60b6d4f22
%inline %{
class Foo {
protected:
void x();
public:
void y();
};
%}
will work in plain or plain director mode, but it will complain the
same as before with director protected support.
The reason is that the parser emmits the warning, and at that stage it
is not possible to decide if the protected Foo::x() could or not
conflict with the renamed Foo::y(), since Foo::x() could be virtual,
even when no "virtual" attribute is used.
Core:
parser.y: Detect the dirprot mode and prevents the generation of
protected symbols at the parsing stage.
lang.cxx: Export the director_protected_mode for parser.y and the
director protected member detection is much cleaner.
main.cxx: Fix the -dirprot flag, it was working in SWIG_FEATURE but
not in the command line.(minor thing not relate to the error).
swigmod.h: added Lang::dirprot_mode() for cleaner detection.
utils.cxx: is_member_director() centralizes and improve the test.
Test suite:
protected_rename.i: added %inline, so it can compile now.
director_protected.i: more cases, checking using %rename.
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk/SWIG@5530 626c5289-ae23-0410-ae9c-e8d60b6d4f22
test against the enum scoping problem I had.
Ocaml.cxx: Accidentally reintroduced the enum scoping problem, so I added
an example that will fail if this is ever broken again.
I encountered the actual problem in avifile.h
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk/SWIG@5478 626c5289-ae23-0410-ae9c-e8d60b6d4f22
makedebugtop: include swig.cmo
Lib: factored out more common code, slightly reorganized class type.
added director define and exceptions.
std_string: length from the original ocaml string (no longer depends on
null termination)
ocamldec.swg/ocaml.swg: added caml_string_len
Examples/Makefile.in: quiet about checking out files.
Ocaml.cxx:
Fixed abstract director test case.
Include/exclude director.swg based on directors being enabled.
Final edits for 1.3.20, barring bugs being discovered.
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk/SWIG@5477 626c5289-ae23-0410-ae9c-e8d60b6d4f22