Commit graph

296 commits

Author SHA1 Message Date
William S Fulton
62ba646c89 Moved non static function declarations from source files into header files
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk@5602 626c5289-ae23-0410-ae9c-e8d60b6d4f22
2003-12-28 21:48:39 +00:00
William S Fulton
9e35a6e442 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@5597 626c5289-ae23-0410-ae9c-e8d60b6d4f22
2003-12-28 21:06:02 +00:00
William S Fulton
cf3a5e6222 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@5590 626c5289-ae23-0410-ae9c-e8d60b6d4f22
2003-12-23 21:46:56 +00:00
William S Fulton
0af36656c1 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@5589 626c5289-ae23-0410-ae9c-e8d60b6d4f22
2003-12-23 21:45:38 +00:00
Art Yerkes
98e493b6fa Added suffix arg for c output.
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk@5588 626c5289-ae23-0410-ae9c-e8d60b6d4f22
2003-12-23 20:31:06 +00:00
Logan Johnson
6d30946aa4 *** empty log message ***
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk@5586 626c5289-ae23-0410-ae9c-e8d60b6d4f22
2003-12-22 17:23:02 +00:00
Logan Johnson
bc186c445c Fix for virtual_poly.i test case.
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk@5585 626c5289-ae23-0410-ae9c-e8d60b6d4f22
2003-12-22 17:12:06 +00:00
Dave Beazley
7e526a0b21 Turned on shadow classes by default.
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk@5577 626c5289-ae23-0410-ae9c-e8d60b6d4f22
2003-12-17 19:09:36 +00:00
Dave Beazley
80a9062f1d Removed config.h
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk@5576 626c5289-ae23-0410-ae9c-e8d60b6d4f22
2003-12-17 19:09:17 +00:00
Dave Beazley
6a6403d2bc Suppress warning 321 by default.
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk@5572 626c5289-ae23-0410-ae9c-e8d60b6d4f22
2003-12-16 03:43:51 +00:00
Dave Beazley
b29f77f801 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@5565 626c5289-ae23-0410-ae9c-e8d60b6d4f22
2003-12-14 15:42:32 +00:00
William S Fulton
66a19d43b0 remove SWIG_exception for director protected methods.
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk@5562 626c5289-ae23-0410-ae9c-e8d60b6d4f22
2003-12-13 23:52:31 +00:00
William S Fulton
c6de7c0de6 -dirprot display order
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk@5554 626c5289-ae23-0410-ae9c-e8d60b6d4f22
2003-12-13 00:16:08 +00:00
William S Fulton
baa06d2509 %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@5553 626c5289-ae23-0410-ae9c-e8d60b6d4f22
2003-12-13 00:13:10 +00:00
Marcelo Matus
0c01d1edcc swig -DSWIG_ALLKW was too ugly. Use -Wallkw instead. Reverting swig.swg
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk@5545 626c5289-ae23-0410-ae9c-e8d60b6d4f22
2003-12-12 06:12:29 +00:00
Marcelo Matus
beb5d78df2 bad spelling in warning
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk@5544 626c5289-ae23-0410-ae9c-e8d60b6d4f22
2003-12-12 06:09:53 +00:00
Marcelo Matus
14d87ed24d 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@5532 626c5289-ae23-0410-ae9c-e8d60b6d4f22
2003-12-11 01:59:12 +00:00
Marcelo Matus
7335663344 %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@5530 626c5289-ae23-0410-ae9c-e8d60b6d4f22
2003-12-10 23:10:31 +00:00
Marcelo Matus
9bc97cf587 minor clean up
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk@5528 626c5289-ae23-0410-ae9c-e8d60b6d4f22
2003-12-09 23:57:53 +00:00
Marcelo Matus
35ab21edbb 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@5526 626c5289-ae23-0410-ae9c-e8d60b6d4f22
2003-12-09 23:46:39 +00:00
Marcelo Matus
3a2ad32d92 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@5525 626c5289-ae23-0410-ae9c-e8d60b6d4f22
2003-12-09 23:24:37 +00:00
William S Fulton
6acb22fbfc Marcelo's suggestion for fixing polymorphic methods that return a polymorphic type.
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk@5524 626c5289-ae23-0410-ae9c-e8d60b6d4f22
2003-12-09 22:13:31 +00:00
William S Fulton
f0efb84549 pesky warning
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk@5522 626c5289-ae23-0410-ae9c-e8d60b6d4f22
2003-12-09 22:06:14 +00:00
Logan Johnson
b8069b70f2 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@5516 626c5289-ae23-0410-ae9c-e8d60b6d4f22
2003-12-09 18:11:26 +00:00
Marcelo Matus
6b6b041b64 emitting and testing protected methods for director protected members
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk@5512 626c5289-ae23-0410-ae9c-e8d60b6d4f22
2003-12-09 10:38:34 +00:00
Marcelo Matus
8199b93d1d detecting polymorphic virtual methods properly
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk@5511 626c5289-ae23-0410-ae9c-e8d60b6d4f22
2003-12-09 10:36:15 +00:00
Marcelo Matus
86edc68494 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@5510 626c5289-ae23-0410-ae9c-e8d60b6d4f22
2003-12-09 02:52:08 +00:00
Marcelo Matus
23fcdecaf7 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@5508 626c5289-ae23-0410-ae9c-e8d60b6d4f22
2003-12-08 23:42:37 +00:00
Marcelo Matus
80baf404c3 fix problem with protected members, and add some of them to the test
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk@5507 626c5289-ae23-0410-ae9c-e8d60b6d4f22
2003-12-08 22:50:46 +00:00
Marcelo Matus
7ea7abf7ff preventing generation of director protected members for languages with no director support
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk@5506 626c5289-ae23-0410-ae9c-e8d60b6d4f22
2003-12-08 22:21:11 +00:00
Marcelo Matus
c7d4362896 director protected support cleanup
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk@5505 626c5289-ae23-0410-ae9c-e8d60b6d4f22
2003-12-08 21:56:14 +00:00
Dave Beazley
9f9b71ed6c Fixed bus error. Removed inline functions. Minor cleanup.
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk@5500 626c5289-ae23-0410-ae9c-e8d60b6d4f22
2003-12-08 15:24:39 +00:00
Marcelo Matus
7bbbe3b274 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@5498 626c5289-ae23-0410-ae9c-e8d60b6d4f22
2003-12-07 23:00:02 +00:00
Marcelo Matus
6dbeba36af Added help for -nodirprot flag
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk@5492 626c5289-ae23-0410-ae9c-e8d60b6d4f22
2003-12-06 22:51:54 +00:00
Marcelo Matus
bb18c2d880 Fixed swapped arguments in is_member_director
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk@5491 626c5289-ae23-0410-ae9c-e8d60b6d4f22
2003-12-06 22:36:55 +00:00
Dave Beazley
3631c27ad3 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@5488 626c5289-ae23-0410-ae9c-e8d60b6d4f22
2003-12-05 18:50:16 +00:00
Marcelo Matus
217fe1d6d3 Force the generation of director methods even when -fvirtual is used
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk@5487 626c5289-ae23-0410-ae9c-e8d60b6d4f22
2003-12-05 08:58:26 +00:00
Marcelo Matus
75c1713b2d 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@5485 626c5289-ae23-0410-ae9c-e8d60b6d4f22
2003-12-05 01:59:28 +00:00
Art Yerkes
87f4bcef2e 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@5478 626c5289-ae23-0410-ae9c-e8d60b6d4f22
2003-12-04 06:57:57 +00:00
Art Yerkes
fbb9c8481d 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@5477 626c5289-ae23-0410-ae9c-e8d60b6d4f22
2003-12-04 06:15:07 +00:00
William S Fulton
e6b5758132 Use classtypeobj instead of classDeclaration:name for typemap searches.
Thanks Dave.


git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk@5462 626c5289-ae23-0410-ae9c-e8d60b6d4f22
2003-12-02 22:16:00 +00:00
Dave Beazley
16704c7262 Fixed [ 852119 ] recursive inheritance in output .pm, perl5
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk@5460 626c5289-ae23-0410-ae9c-e8d60b6d4f22
2003-12-02 21:57:41 +00:00
Dave Beazley
65734165ca 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@5457 626c5289-ae23-0410-ae9c-e8d60b6d4f22
2003-12-02 18:56:59 +00:00
Art Yerkes
08d4b05e03 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@5455 626c5289-ae23-0410-ae9c-e8d60b6d4f22
2003-12-02 08:50:39 +00:00
William S Fulton
337c3dd301 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@5450 626c5289-ae23-0410-ae9c-e8d60b6d4f22
2003-11-30 21:18:40 +00:00
William S Fulton
6bda2826e0 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@5439 626c5289-ae23-0410-ae9c-e8d60b6d4f22
2003-11-28 23:12:28 +00:00
William S Fulton
0a39ab52c8 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@5438 626c5289-ae23-0410-ae9c-e8d60b6d4f22
2003-11-28 23:08:14 +00:00
Dave Beazley
2acc6de7fc [ 841074 ] better croaking (PATCH)
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk@5395 626c5289-ae23-0410-ae9c-e8d60b6d4f22
2003-11-25 17:06:56 +00:00
Art Yerkes
c62459060e Missing NIL in Printv.
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk@5389 626c5289-ae23-0410-ae9c-e8d60b6d4f22
2003-11-25 07:08:38 +00:00
Dave Beazley
00be2c2492 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@5386 626c5289-ae23-0410-ae9c-e8d60b6d4f22
2003-11-25 03:51:35 +00:00