Commit graph

279 commits

Author SHA1 Message Date
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
Art Yerkes
5969a1c272 Removed needless normalization step.
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk/SWIG@5374 626c5289-ae23-0410-ae9c-e8d60b6d4f22
2003-11-23 12:33:41 +00:00
Art Yerkes
cab8fc7fb9 Added sizeof operator for classes (and struct, unions), enabled with
"sizeof"="1" on the module node.


git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk/SWIG@5370 626c5289-ae23-0410-ae9c-e8d60b6d4f22
2003-11-23 11:58:12 +00:00
Matthias Köppe
bb968bc558 Don't qualify member function names twice. (Thanks to John Lenz.)
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk/SWIG@5363 626c5289-ae23-0410-ae9c-e8d60b6d4f22
2003-11-21 09:18:10 +00:00
Dave Beazley
12882895d3 New option: -runtime
Changed -c option to -noruntime.   -c still works, but a warning is issued.


git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk/SWIG@5352 626c5289-ae23-0410-ae9c-e8d60b6d4f22
2003-11-20 03:29:37 +00:00
William S Fulton
164b304971 Contract assert macro modification to handle void and non-void return types
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk/SWIG@5339 626c5289-ae23-0410-ae9c-e8d60b6d4f22
2003-11-18 22:38:34 +00:00
William S Fulton
d85b463e0b Common director support functions moved to new file directors.cxx
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk/SWIG@5335 626c5289-ae23-0410-ae9c-e8d60b6d4f22
2003-11-18 20:21:39 +00:00
William S Fulton
4dfa0ed902 extern method declarations moved to header file
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk/SWIG@5334 626c5289-ae23-0410-ae9c-e8d60b6d4f22
2003-11-18 20:21:15 +00:00
Matthias Köppe
dcdebfd3e0 [Guile] Handle $input in "freearg" typemaps.
Never qualify GOOPS slot names with the class name.
Handle optional arguments properly in the GOOPS methods.


git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk/SWIG@5329 626c5289-ae23-0410-ae9c-e8d60b6d4f22
2003-11-18 15:51:52 +00:00
William S Fulton
fac1ef0de3 Director fixes for methods returning enums and references contributed by Scott Michel
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk/SWIG@5326 626c5289-ae23-0410-ae9c-e8d60b6d4f22
2003-11-16 17:05:40 +00:00
Dave Beazley
5f88de8fe7 Modified contract support (simplified).
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk/SWIG@5321 626c5289-ae23-0410-ae9c-e8d60b6d4f22
2003-11-14 18:58:13 +00:00
Dave Beazley
c0072eb5ed Major refactoring of contract code. Modifications include:
- Better parsing support. Contract sections are no longer hard-coded. New
      types of contracts can be added merely be adding an entry to a table.

    - Fixed argument naming problems with inheritance.  For example, if someone
      specified a contract for a base class and a contract for a derived
      class method, but they didn't use the same argument names in the
      contracts.

    - Fixed contracts for static member functions.

    - Reduced the amount of generated code--especially for inheritance.

    - Changed error messages to indicate inheritance hierarchy.

    - Fixed problems with duplicate contract checking code being
      emitted.

    - Reorganized code that collects contracts and deals with inheritance
      to be more generic---no hardcoded contract names or types.

    - Reorganized process by which contracts is collected.

    - Eliminated unimplemented features for release.


git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk/SWIG@5320 626c5289-ae23-0410-ae9c-e8d60b6d4f22
2003-11-14 18:57:51 +00:00
Dave Beazley
cac9367daf Simplified contract runtime API. Use SWIG_contract_assert() for all errors.
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk/SWIG@5317 626c5289-ae23-0410-ae9c-e8d60b6d4f22
2003-11-13 16:59:11 +00:00
Dave Beazley
72f738909e Contract checking now turned on by default. Some other cleanup.
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk/SWIG@5313 626c5289-ae23-0410-ae9c-e8d60b6d4f22
2003-11-13 04:17:52 +00:00
William S Fulton
d775051aff director ricochet removal from Scott Michel and generated director code tidy up
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk/SWIG@5309 626c5289-ae23-0410-ae9c-e8d60b6d4f22
2003-11-12 21:12:30 +00:00
Dave Beazley
2539fdc5fc Code generation improvements. Order of automatically generated methods is different.
Added special variable $action to python code fragments included with feature:shadow.
This expands to the name of the low-level C wrapper function.


git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk/SWIG@5306 626c5289-ae23-0410-ae9c-e8d60b6d4f22
2003-11-12 17:14:00 +00:00
William S Fulton
4536730c5a Scott Michel patch which removes supefluous ricochet director checking code except for pure virtual methods.
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk/SWIG@5288 626c5289-ae23-0410-ae9c-e8d60b6d4f22
2003-11-10 22:26:36 +00:00
Dave Beazley
44e5b13549 SafeInit function added.
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk/SWIG@5283 626c5289-ae23-0410-ae9c-e8d60b6d4f22
2003-11-09 03:51:12 +00:00