Commit graph

296 commits

Author SHA1 Message Date
William S Fulton
c00aaf0f5b Moved non static function declarations from source files into header files
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk/SWIG@5602 626c5289-ae23-0410-ae9c-e8d60b6d4f22
2003-12-28 21:48:39 +00:00
William S Fulton
bda422a29c Marcelo's patch which fixes virtual:type attribute always being set.
Removes incorrect warnings about covariant return types in Java and C#.


git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk/SWIG@5597 626c5289-ae23-0410-ae9c-e8d60b6d4f22
2003-12-28 21:06:02 +00:00
William S Fulton
e848fcb3d8 Covariant return type fixes...
Fixed error where the base class was being used to wrap the derived class C++ pointer.
Emit a warning when encountering these return types as the return type is changed to the base class type.


git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk/SWIG@5590 626c5289-ae23-0410-ae9c-e8d60b6d4f22
2003-12-23 21:46:56 +00:00
William S Fulton
965827544d Covariant return type fixes...
Fixed error where the base class was being used to wrap the derived class C++ pointer.
Also fixed runtime error when using directors - the wrong canonical description was not using the base class type.


git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk/SWIG@5589 626c5289-ae23-0410-ae9c-e8d60b6d4f22
2003-12-23 21:45:38 +00:00
Art Yerkes
04d18b7a1f Added suffix arg for c output.
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk/SWIG@5588 626c5289-ae23-0410-ae9c-e8d60b6d4f22
2003-12-23 20:31:06 +00:00
Logan Johnson
42fd4b9c42 *** empty log message ***
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk/SWIG@5586 626c5289-ae23-0410-ae9c-e8d60b6d4f22
2003-12-22 17:23:02 +00:00
Logan Johnson
944e1a77d2 Fix for virtual_poly.i test case.
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk/SWIG@5585 626c5289-ae23-0410-ae9c-e8d60b6d4f22
2003-12-22 17:12:06 +00:00
Dave Beazley
bfe9987444 Turned on shadow classes by default.
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk/SWIG@5577 626c5289-ae23-0410-ae9c-e8d60b6d4f22
2003-12-17 19:09:36 +00:00
Dave Beazley
df5ea38b6f Removed config.h
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk/SWIG@5576 626c5289-ae23-0410-ae9c-e8d60b6d4f22
2003-12-17 19:09:17 +00:00
Dave Beazley
d923c738f8 Suppress warning 321 by default.
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk/SWIG@5572 626c5289-ae23-0410-ae9c-e8d60b6d4f22
2003-12-16 03:43:51 +00:00
Dave Beazley
53906cdba1 Weakened constructor name check to work around nested-class hack reported by
Gustavo Niemeyer.


git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk/SWIG@5565 626c5289-ae23-0410-ae9c-e8d60b6d4f22
2003-12-14 15:42:32 +00:00
William S Fulton
71e1ac56cc remove SWIG_exception for director protected methods.
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk/SWIG@5562 626c5289-ae23-0410-ae9c-e8d60b6d4f22
2003-12-13 23:52:31 +00:00
William S Fulton
e7d72724aa -dirprot display order
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk/SWIG@5554 626c5289-ae23-0410-ae9c-e8d60b6d4f22
2003-12-13 00:16:08 +00:00
William S Fulton
2e0346a3a6 %javamethodmodifiers (java) and %csmethodmodifiers (C#) operate slightly differently.
Previously this had to be present to set the method modifiers. Now this feature is only
used if it exists for the method being wrapped. The default is "public" as previous
however, when wrapping protected director methods it is "protected".


git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk/SWIG@5553 626c5289-ae23-0410-ae9c-e8d60b6d4f22
2003-12-13 00:13:10 +00:00
Marcelo Matus
8abe741cdc swig -DSWIG_ALLKW was too ugly. Use -Wallkw instead. Reverting swig.swg
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk/SWIG@5545 626c5289-ae23-0410-ae9c-e8d60b6d4f22
2003-12-12 06:12:29 +00:00
Marcelo Matus
2f45350a89 bad spelling in warning
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk/SWIG@5544 626c5289-ae23-0410-ae9c-e8d60b6d4f22
2003-12-12 06:09:53 +00:00
Marcelo Matus
72984676ca Lateral change to add runtime "reprotection" at the python
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
2003-12-11 01:59:12 +00:00
Marcelo Matus
c41374becc %rename(x) Foo::y();
%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
2003-12-10 23:10:31 +00:00
Marcelo Matus
2fe581fff7 minor clean up
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk/SWIG@5528 626c5289-ae23-0410-ae9c-e8d60b6d4f22
2003-12-09 23:57:53 +00:00
Marcelo Matus
f7e02f46fc fixed the problem with 'using' and protected mebers. now it seems to be safe to generate the protected members as protected again. all the test are running and the director_protected_runme.rb now test for the right access control
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk/SWIG@5526 626c5289-ae23-0410-ae9c-e8d60b6d4f22
2003-12-09 23:46:39 +00:00
Marcelo Matus
66ae9df8b1 promote the 'using' methods to public. Also, fix a sef. fault for using with pointers, see using_pointers.i
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk/SWIG@5525 626c5289-ae23-0410-ae9c-e8d60b6d4f22
2003-12-09 23:24:37 +00:00
William S Fulton
4d9d790028 Marcelo's suggestion for fixing polymorphic methods that return a polymorphic type.
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk/SWIG@5524 626c5289-ae23-0410-ae9c-e8d60b6d4f22
2003-12-09 22:13:31 +00:00
William S Fulton
e2ec38e21b pesky warning
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk/SWIG@5522 626c5289-ae23-0410-ae9c-e8d60b6d4f22
2003-12-09 22:06:14 +00:00
Logan Johnson
1d86fe950b Fixed RUBY::create_command() so that we never define an instance method
by calling rb_define_protected_method(), even if the corresponding C++
member function is declared protected. The "protected" access modifier
has different interpretations in C++ and Ruby, and this was causing the
using_protected runtime test for Ruby to break.


git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk/SWIG@5516 626c5289-ae23-0410-ae9c-e8d60b6d4f22
2003-12-09 18:11:26 +00:00
Marcelo Matus
ae75ec65dd emitting and testing protected methods for director protected members
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk/SWIG@5512 626c5289-ae23-0410-ae9c-e8d60b6d4f22
2003-12-09 10:38:34 +00:00
Marcelo Matus
833b2f7f0a detecting polymorphic virtual methods properly
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk/SWIG@5511 626c5289-ae23-0410-ae9c-e8d60b6d4f22
2003-12-09 10:36:15 +00:00
Marcelo Matus
634b973f31 The dirprot feature is now disabled by default. Added dirprot option and ruby runtime examples.
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk/SWIG@5510 626c5289-ae23-0410-ae9c-e8d60b6d4f22
2003-12-09 02:52:08 +00:00
Marcelo Matus
4507660097 setting the dirprot support to 0 in the meantime, can be set back with -dirprot
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk/SWIG@5508 626c5289-ae23-0410-ae9c-e8d60b6d4f22
2003-12-08 23:42:37 +00:00
Marcelo Matus
93dd1e228e fix problem with protected members, and add some of them to the test
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk/SWIG@5507 626c5289-ae23-0410-ae9c-e8d60b6d4f22
2003-12-08 22:50:46 +00:00
Marcelo Matus
26e9014fc9 preventing generation of director protected members for languages with no director support
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk/SWIG@5506 626c5289-ae23-0410-ae9c-e8d60b6d4f22
2003-12-08 22:21:11 +00:00
Marcelo Matus
7b69dddba0 director protected support cleanup
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk/SWIG@5505 626c5289-ae23-0410-ae9c-e8d60b6d4f22
2003-12-08 21:56:14 +00:00
Dave Beazley
9e98fd1252 Fixed bus error. Removed inline functions. Minor cleanup.
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk/SWIG@5500 626c5289-ae23-0410-ae9c-e8d60b6d4f22
2003-12-08 15:24:39 +00:00
Marcelo Matus
bbde8dafa9 Moving the director protected member support to the top level. Now it should works in all the languages. Test it.
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk/SWIG@5498 626c5289-ae23-0410-ae9c-e8d60b6d4f22
2003-12-07 23:00:02 +00:00
Marcelo Matus
7e7da85e84 Added help for -nodirprot flag
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk/SWIG@5492 626c5289-ae23-0410-ae9c-e8d60b6d4f22
2003-12-06 22:51:54 +00:00
Marcelo Matus
732f69101e Fixed swapped arguments in is_member_director
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk/SWIG@5491 626c5289-ae23-0410-ae9c-e8d60b6d4f22
2003-12-06 22:36:55 +00:00
Dave Beazley
ac0be15578 Restored patch that added "classtypeobj" attribute.
Guys..... please be careful when committing.  I added this patch a couple of days
ago and now it's suddenly gone.  What's the deal?  Did someone commit an old version
of lang.cxx on top of this patch?

-- Dave


git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk/SWIG@5488 626c5289-ae23-0410-ae9c-e8d60b6d4f22
2003-12-05 18:50:16 +00:00
Marcelo Matus
d52d165d6f Force the generation of director methods even when -fvirtual is used
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk/SWIG@5487 626c5289-ae23-0410-ae9c-e8d60b6d4f22
2003-12-05 08:58:26 +00:00
Marcelo Matus
0f19564193 Fixes to support protected members with director, proper virtual member recognition and support of the nodirector feature
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk/SWIG@5485 626c5289-ae23-0410-ae9c-e8d60b6d4f22
2003-12-05 01:59:28 +00:00
Art Yerkes
35e21e1c68 This example both shows the new enum literal facility, and is a regression
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
2003-12-04 06:57:57 +00:00
Art Yerkes
e0dca0ec65 shapes example: slight correction to depth map.
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
2003-12-04 06:15:07 +00:00
William S Fulton
e021185ad1 Use classtypeobj instead of classDeclaration:name for typemap searches.
Thanks Dave.


git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk/SWIG@5462 626c5289-ae23-0410-ae9c-e8d60b6d4f22
2003-12-02 22:16:00 +00:00
Dave Beazley
a5717296e7 Fixed [ 852119 ] recursive inheritance in output .pm, perl5
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk/SWIG@5460 626c5289-ae23-0410-ae9c-e8d60b6d4f22
2003-12-02 21:57:41 +00:00
Dave Beazley
1c7cbccaa8 Added new attribute to class nodes
"classtypeobj"

This is the raw, SWIG type-system representation of the class type.  This
should be used in all typemap lookups and operations involving the class name.

Note:  There is inconsistent use of the "classtype" attribute across language modules--
especially in code related to directors.   To avoid breaking the universe, I have
decided to store the correct type encoding as "classtypeobj" instead of replacing
"classtype".   As modules are checked they can elect to use "classtype" or "classtypeobj"
as appropriate.

Note: William, you should use "classtypeobj" to fix the typemap problem (probably).


git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk/SWIG@5457 626c5289-ae23-0410-ae9c-e8d60b6d4f22
2003-12-02 18:56:59 +00:00
Art Yerkes
074327ba72 All test cases compile except director_abstract. I clued from what
William Fulton and Dave were talking about regarding the template parameters
and (), and this solved a bunch of wierd little problems I was having.


git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk/SWIG@5455 626c5289-ae23-0410-ae9c-e8d60b6d4f22
2003-12-02 08:50:39 +00:00
William S Fulton
e4ee860602 Minor bug fix from that initializes the jlong pseudo-pointer to 0 in director methods (makes the Java equals method based on getCPtr() work consistently.)
Submitted by Scott Michel.


git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk/SWIG@5450 626c5289-ae23-0410-ae9c-e8d60b6d4f22
2003-11-30 21:18:40 +00:00
William S Fulton
a9c2e7aef3 Director fix for #include "xxxx_wrap.h". Was incorrectly adding a directory in some situations. See #848335.
#849064 fixed. Any classes with a non public destructor now have a public delete() method which throw a runtime exception. The delete() method was previously protected.


git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk/SWIG@5439 626c5289-ae23-0410-ae9c-e8d60b6d4f22
2003-11-28 23:12:28 +00:00
William S Fulton
ed5a4bbb63 Director fix for #include "xxxx_wrap.h". Was incorrectly adding a directory in some situations. See #848335.
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk/SWIG@5438 626c5289-ae23-0410-ae9c-e8d60b6d4f22
2003-11-28 23:08:14 +00:00
Dave Beazley
465eebfb32 [ 841074 ] better croaking (PATCH)
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk/SWIG@5395 626c5289-ae23-0410-ae9c-e8d60b6d4f22
2003-11-25 17:06:56 +00:00
Art Yerkes
573cc1cebf Missing NIL in Printv.
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk/SWIG@5389 626c5289-ae23-0410-ae9c-e8d60b6d4f22
2003-11-25 07:08:38 +00:00
Dave Beazley
9e2752c39d Fixed cross module linking of base-classes. Base classes are now located using SWIG_TypeQuery()
during module initialization.


git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk/SWIG@5386 626c5289-ae23-0410-ae9c-e8d60b6d4f22
2003-11-25 03:51:35 +00:00