Commit graph

78 commits

Author SHA1 Message Date
Marcelo Matus
e8b3542f9a implement the naturalvar feature for global vars in java and csharp
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk/SWIG@8577 626c5289-ae23-0410-ae9c-e8d60b6d4f22
2006-01-28 02:38:00 +00:00
Marcelo Matus
55005e98ee Move rename/namewarn engine from parser.y to naming.c. The code was getting
too large to be in the parser.

Centralize the swig keys to avoid replication and wrong spellings.

Use more HashGetAttr where possible and other speed improvements
to compensate for the extra work introduced by the new rename/namewarn
mechanism.


git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk/SWIG@8170 626c5289-ae23-0410-ae9c-e8d60b6d4f22
2006-01-02 04:33:19 +00:00
Marcelo Matus
b034e6c266 add support for options in rename/namewarn and central methods to access the rename/warning hashs
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk/SWIG@8150 626c5289-ae23-0410-ae9c-e8d60b6d4f22
2005-12-31 10:41:54 +00:00
William S Fulton
751086e8e0 new $imclassname special variable to fix bugs changing the intermediary classname
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk/SWIG@8028 626c5289-ae23-0410-ae9c-e8d60b6d4f22
2005-12-21 22:54:47 +00:00
William S Fulton
8c397aaa13 Portability warning for files which will overwrite each other on case
insensitive file systems such as FAT32/NTFS.


git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk/SWIG@7832 626c5289-ae23-0410-ae9c-e8d60b6d4f22
2005-11-09 22:57:09 +00:00
Marcelo Matus
a4c0114c6a replace bad parameter names when neccessary
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk/SWIG@7699 626c5289-ae23-0410-ae9c-e8d60b6d4f22
2005-10-21 10:43:41 +00:00
William S Fulton
09444a7208 Fix for constants attempting to generate setters with %feature(immutable,"0")
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk/SWIG@7659 626c5289-ae23-0410-ae9c-e8d60b6d4f22
2005-10-15 01:14:21 +00:00
William S Fulton
adecc68977 Multiple inheritance warnings and ignored base classes fixes
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk/SWIG@7618 626c5289-ae23-0410-ae9c-e8d60b6d4f22
2005-10-08 11:42:20 +00:00
William S Fulton
963da5f126 Modify following features to work as flags, so that they can be truely set and unset:
cs:const


git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk/SWIG@7570 626c5289-ae23-0410-ae9c-e8d60b6d4f22
2005-09-30 23:20:54 +00:00
William S Fulton
656cb7ab06 Modify following features to work as flags, so that they can be truely set and unset:
new


git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk/SWIG@7564 626c5289-ae23-0410-ae9c-e8d60b6d4f22
2005-09-30 22:10:17 +00:00
William S Fulton
bed81d66d3 Better error message displayed when file cannot be opened
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk/SWIG@7416 626c5289-ae23-0410-ae9c-e8d60b6d4f22
2005-09-08 22:31:21 +00:00
William S Fulton
2aae38d3c0 Support for the null attribute in the out typemap to support return by value struct types
SWIG_exception changes


git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk/SWIG@7340 626c5289-ae23-0410-ae9c-e8d60b6d4f22
2005-07-22 21:23:17 +00:00
William S Fulton
8eb7e528b0 Make variable accessor functions the same across all modules for %extend with member variables to work consistently across all language modules and as documented. Use -oldvarnames commandline option to get the original variable names.
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk/SWIG@7313 626c5289-ae23-0410-ae9c-e8d60b6d4f22
2005-06-23 20:30:14 +00:00
William S Fulton
71011d09a9 more patches for dodgy gcc-2.96 compiler from Hugo van der Sanden
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk/SWIG@7303 626c5289-ae23-0410-ae9c-e8d60b6d4f22
2005-06-17 20:31:08 +00:00
William S Fulton
a2039dea5d fix for dodgy gcc-2.96 compilers
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk/SWIG@7291 626c5289-ae23-0410-ae9c-e8d60b6d4f22
2005-06-16 21:21:21 +00:00
William S Fulton
0870b84abc Uniform handling of SWIGEXPORT across SWIG (was DllExport)
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk/SWIG@7233 626c5289-ae23-0410-ae9c-e8d60b6d4f22
2005-05-27 22:40:40 +00:00
William S Fulton
b29514ffcf %csmethodmodifiers can be applied to variables as well as methods now.
%csmethodmodifiers will replace the virtual/new/override modifiers that SWIG thinks is
appropriate in addition to the default 'public'. This is necessary for some obscure cases
where SWIG might get the modifiers incorrect, for example with private inheritance.


git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk/SWIG@7227 626c5289-ae23-0410-ae9c-e8d60b6d4f22
2005-05-26 20:49:03 +00:00
William S Fulton
d00a8ee60f Covariant return types fixes
Any method which hides a base method is marked (for C# 'new' method modifier)


git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk/SWIG@7209 626c5289-ae23-0410-ae9c-e8d60b6d4f22
2005-05-23 21:03:50 +00:00
William S Fulton
7a72389977 covariant and override attributes better name
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk/SWIG@7196 626c5289-ae23-0410-ae9c-e8d60b6d4f22
2005-05-20 22:32:34 +00:00
William S Fulton
9bd7f1ec9a whitespace fixes
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk/SWIG@7191 626c5289-ae23-0410-ae9c-e8d60b6d4f22
2005-05-13 21:40:55 +00:00
William S Fulton
a0712b227f C# attribute support added - %csattributes feature, %csattributes typemap
and inattributes & outattributes typemap attributes for the imtype and cstype typemaps.


git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk/SWIG@7184 626c5289-ae23-0410-ae9c-e8d60b6d4f22
2005-05-12 20:19:47 +00:00
William S Fulton
9be34b6b9a support for asymmetric type marshalling - added out attribute for ctype, imtype and cstype typemaps
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk/SWIG@7172 626c5289-ae23-0410-ae9c-e8d60b6d4f22
2005-04-28 21:59:17 +00:00
William S Fulton
acfb93f939 Fix typemap matching when wrapping variables (global, member and static member variables).
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk/SWIG@7152 626c5289-ae23-0410-ae9c-e8d60b6d4f22
2005-04-14 20:19:59 +00:00
William S Fulton
de090d94b1 warning change
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk/SWIG@7090 626c5289-ae23-0410-ae9c-e8d60b6d4f22
2005-03-20 22:11:11 +00:00
William S Fulton
f149a9f3d1 swig -help prints to stdout not stderr now
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk/SWIG@6964 626c5289-ae23-0410-ae9c-e8d60b6d4f22
2005-02-15 23:04:10 +00:00
William S Fulton
1df331a843 Code using SWIG_exception macro will now correctly return immediately back to managed code.
When wrapping member variables, the PInvoke code is emitted before the C# code - fixes subtle bugs in typemap matching rules.
More fixes to ensure typemap matching rules work for member variable and global variable properties.


git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk/SWIG@6948 626c5289-ae23-0410-ae9c-e8d60b6d4f22
2005-02-15 21:57:15 +00:00
William S Fulton
91b75b245f More of the new C# exceptions
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk/SWIG@6935 626c5289-ae23-0410-ae9c-e8d60b6d4f22
2005-02-05 00:45:57 +00:00
William S Fulton
bac8f43f79 C# exception handling improvements - they are robust and don't leak anymore. Requires typemap modifications using attribute canthrow in any unmanaged code typemaps that throw an exception and excode attribute in csout and csconstruct typemaps.
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk/SWIG@6934 626c5289-ae23-0410-ae9c-e8d60b6d4f22
2005-02-02 22:44:32 +00:00
William S Fulton
e5addbab84 new typemap: csconstruct. This typemap contains the code that goes into the proxy constructor.
The generated code is slightly different. A method called swigSetup is called during construction of the proxy object.
This is for a future change where a try finally block needs to be put around an unmanaged call during construction (for a new c++ to c# exception conversion handling mechanism)


git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk/SWIG@6922 626c5289-ae23-0410-ae9c-e8d60b6d4f22
2005-01-10 22:35:37 +00:00
William S Fulton
347f342fab tidyup
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk/SWIG@6839 626c5289-ae23-0410-ae9c-e8d60b6d4f22
2004-12-06 22:53:09 +00:00
William S Fulton
380d10aac8 Fixes for enums no longer being handled as integers in the core.
New special variable $*csclassname to compliment $&csclassname and $csclassname.


git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk/SWIG@6777 626c5289-ae23-0410-ae9c-e8d60b6d4f22
2004-11-28 19:04:28 +00:00
William S Fulton
dc12af75b6 various fixes to remove warnings
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk/SWIG@6580 626c5289-ae23-0410-ae9c-e8d60b6d4f22
2004-11-01 21:10:06 +00:00
William S Fulton
909096be81 -dllimport commandline option and $dllimport special variable to specify the DllImport attribute
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk/SWIG@6501 626c5289-ae23-0410-ae9c-e8d60b6d4f22
2004-10-25 20:43:32 +00:00
John Lenz
75e462baa8 Removed ability to share type information by C linking
All type sharing happens through a global variable in the target language.


git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk/SWIG@6390 626c5289-ae23-0410-ae9c-e8d60b6d4f22
2004-10-16 18:23:59 +00:00
William S Fulton
16a711e90f Fixes to compile on some buggy Redhat gcc 2.96 versions
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk/SWIG@6089 626c5289-ae23-0410-ae9c-e8d60b6d4f22
2004-08-12 21:12:21 +00:00
William S Fulton
e86362442a Support for %csconstvalue added (better compile time constants)
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk/SWIG@5999 626c5289-ae23-0410-ae9c-e8d60b6d4f22
2004-06-27 20:56:54 +00:00
William S Fulton
2846e01760 csgetcptr and csptrconstructormodifiers typemap replaced by the csbody/csbody_derived typemap
csclassmodifiers typemap now contains the class type
imclassclassmodifiers and moduleclassmodifiers pragmas now contain the class type
$module special variable support


git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk/SWIG@5969 626c5289-ae23-0410-ae9c-e8d60b6d4f22
2004-06-03 22:39:16 +00:00
William S Fulton
ac4df70a4c typesafe enum support for storing the enum name (for ToString)
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk/SWIG@5959 626c5289-ae23-0410-ae9c-e8d60b6d4f22
2004-05-31 07:25:18 +00:00
William S Fulton
97f5ccb180 New enum wrapping options implemented and bug fixes:
Proper C# enums
Typesafe enum pattern
Original approach using integers for each enum item


git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk/SWIG@5924 626c5289-ae23-0410-ae9c-e8d60b6d4f22
2004-05-24 20:19:36 +00:00
William S Fulton
9ae5f973d2 %import fix for C# enums
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk/SWIG@5884 626c5289-ae23-0410-ae9c-e8d60b6d4f22
2004-04-22 20:56:48 +00:00
William S Fulton
41724c135f C++ enums are no longer wrapped by integers, they are now wrapped by C# enums.
For Example, given C++:

                enum AnEnum { foo, bar };
                typedef AnEnum AnEnumeration;
                void something(AnEnum e, AnEnumeration f);

            The following is generated:

                public enum AnEnum {
                  foo,
                  bar
                }
                public static void something(AnEnum e, AnEnum f) {...}

See the changes file for further details


git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk/SWIG@5851 626c5289-ae23-0410-ae9c-e8d60b6d4f22
2004-04-09 19:41:40 +00:00
William S Fulton
173a25a6fd New commandline option -namespace for putting all generated classes into a C# namespace.
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk/SWIG@5739 626c5289-ae23-0410-ae9c-e8d60b6d4f22
2004-02-24 21:05:48 +00:00
William S Fulton
ad5d600aeb Bill Hoffman patch to stop crashing when typewrapper class cannot be created. Overloading fixes for when methods cannot be disambiguated.
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk/SWIG@5712 626c5289-ae23-0410-ae9c-e8d60b6d4f22
2004-02-12 21:48:37 +00:00
William S Fulton
11561b2499 Eric Sunshine patch - Mods to work on NextStep
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk/SWIG@5674 626c5289-ae23-0410-ae9c-e8d60b6d4f22
2004-01-22 22:42:18 +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
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
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
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
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
e381e8ba60 $module name substitution to enable name mangling with the module name for the delegate registering functions.
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk/SWIG@5224 626c5289-ae23-0410-ae9c-e8d60b6d4f22
2003-11-01 00:48:32 +00:00