Commit graph

2,454 commits

Author SHA1 Message Date
Vadim Zeitlin
ed28725a15 Add std_auto_ptr.i defining typemaps for returning std::auto_ptr<>.
These typemaps are currently defined for C#, Java and Python only and the
tests are provided only for these languages.

Also add a brief description of the new header to the documentation.
2013-12-03 23:45:20 +01:00
William S Fulton
cdefaaf794 Fixes for c_delete and c_delete_function tests 2013-11-21 20:20:56 +00:00
William S Fulton
c151a0d69a Add array function PHP keywords 2013-11-11 19:12:48 +00:00
William S Fulton
c7b5316912 Merge branch 'master' of https://github.com/BrantKyser/swig
- Remove using directives from the generated C# code and fully qualify the use of all .NET
  framework types in order to minimize potential name collisions from input files defining
  types, namespace, etc with the same name as .NET framework members.
- Globally qualify the use of .NET framework types in the System namespace
- Remove .NET 1.1 support, .NET 2 is the minimum for the C# module

Closes #79

* 'master' of https://github.com/BrantKyser/swig:
  Correct spelling of compatibility.
  Update documentation to reflect fully qualifying the use of .NET types in the generated code.
  Add support for SWIG2_CSHARP macro to create SWIG 2 backwards compatability mode.
  Remove using directives from the generated C# code and fully qualify the use of all .NET framework types in order to minimize potential name collisions from input files defining types, namespace, etc with the same name as .NET framework members.
  Since SWIG 3.0 removes support for .NET 1.1, cleanup the C# library by removing the use of the SWIG_DOTNET_1 macro.
  Globablly qualify the use of types from the .NET framework's System namespace in the C# module and library.
  Add test case to demonstrate the name collision that occurs in the generated C# code when a namespace is named System.
2013-11-09 11:32:50 +00:00
William S Fulton
e7a6be289e Rework the director.swg changes for director exception handling
- More robust implementation.
- Fix some bugs to give better exception messages when a user uses the
  director utility exception functions and classes.
- Replace unnecessarily shortened variable names for easier reading of
  code.
2013-11-07 22:51:35 +00:00
William S Fulton
fdc1772e38 Cosmetics/code style conformance in newly added Java director exception handling 2013-11-07 22:51:34 +00:00
William S Fulton
97fd20a58d Minor improvements to Java director:except patch 2013-10-23 18:43:13 +01:00
Marvin Greenberg
6736e74127 Add feature director:except for improved director exception handling in Java
Closes #91
2013-10-22 20:44:35 +01:00
Brant K. Kyser
5f53503b7d Correct spelling of compatibility. 2013-10-22 14:08:47 -05:00
Brant K. Kyser
3720b48847 Add support for SWIG2_CSHARP macro to create SWIG 2 backwards compatability mode. 2013-10-21 13:13:47 -05:00
William S Fulton
d15220cba4 Remove a couple of unused variable warnings in generated code 2013-10-18 19:10:42 +01:00
William S Fulton
1c5246ad66 Fix some gcc -Wall unused warnings in the Ruby wrappers
Fixes SF bug 1333.
2013-10-18 18:13:11 +01:00
William S Fulton
48eed4f9e4 Fix unused variable warning in Ruby wrappers when using gcc -Wall 2013-10-18 06:49:20 +01:00
William S Fulton
8da4d6712d Fix Visual Studio compile error in C++ wrappers due to #include <exception> within extern "C" block.
Fixes SF #1340
2013-10-17 21:54:58 +01:00
Brant K. Kyser
adb93980f2 Remove using directives from the generated C# code and fully qualify the use of all .NET framework types in order to minimize potential name collisions from input files defining types, namespace, etc with the same name as .NET framework members. 2013-10-17 15:44:24 -05:00
Brant K. Kyser
cb2df12630 Since SWIG 3.0 removes support for .NET 1.1, cleanup the C# library by removing the use of the SWIG_DOTNET_1 macro. 2013-10-17 13:58:32 -05:00
William S Fulton
0e54a51c10 Add missing #include <stddef.h> for offsetof when using -builtin.
Fixes SF #1345
2013-10-17 19:56:18 +01:00
Brant K. Kyser
3235570619 Globablly qualify the use of types from the .NET framework's System namespace in the C# module and library. 2013-10-17 13:27:48 -05:00
Atri
1a7f731d60 Lua: Fix void return for non-void functions
Commit #c3f3880d caused the functions
SWIGINTERN int SWIG_Lua_add_namespace_details(lua_State* L,
swig_lua_namespace* ns)
and
SWIGINTERN int SWIG_Lua_namespace_register(lua_State* L,
swig_lua_namespace* ns)
to return void when int returns were expected resulting in the build
failures for plplot's lua bindings for example. This commit fixes the
issue.

Closes #92
2013-10-12 17:51:49 +01:00
William S Fulton
7b08378145 Minor cleanup prior to merging to master 2013-10-11 21:48:45 +01:00
William S Fulton
bcb7aee022 Merge branch 'master' into gsoc2009-matevz
Conflicts:
	Examples/Makefile.in
	Examples/guile/Makefile.in
	Lib/php/php.swg
	Makefile.in
	Source/CParse/parser.y
	configure.ac
2013-10-10 07:26:09 +01:00
Olly Betts
12708c9241 Fix typos 2013-09-25 17:29:33 +12:00
Gavin Kinsey
43032339d0 Fixed a memory leak for java STRING_ARRAY
The allocation loop uses size, so the free loop should do the same,
not size-1.
2013-09-20 18:44:44 +01:00
William S Fulton
d0cb2b73db Remove X11 detection during configure
X11 is not used anywhere.
2013-09-18 00:40:24 +01:00
William S Fulton
0431664b18 Guile OUTPUT typemap fix
Fixes 'attempt to free a non-heap object' in some OUTPUT typemaps.
2013-09-15 10:43:49 +01:00
Sylvestre Ledru
7a88729c87 Remove trailing spaces in the generated code.
No functional changes
2013-09-13 10:02:39 +02:00
Artem Serebriyskiy
c3f3880d0c Lua static member access improvements.
1) Static members and static functions inside class can be accessed as ModuleName.ClassName.FunctionName (MemberName respectively). Old way aka ModuleName.ClassName_FunctionName still works.
2) Same goes for enums inside classes: ModuleName.ClassName.EnumValue1 etc.
3) More 'runme' tests for lua + modifications to existing tests to test new changes.

Code is loosely based upon python implemenation of the same thing.

Patch #62.
2013-09-12 21:32:26 +01:00
William S Fulton
a91cd0bc5c Infinity is now by default an acceptable value for type 'float'.
This fix makes the handling of type 'float' and 'double' the same. The implementation requires the
C99 isfinite() macro, or otherwise some platform dependent equivalents, to be available.
2013-09-12 07:28:12 +01:00
Miles Bader
c746ae7a0f Include Lua error locus in SWIG error messages
This is standard information in Lua error messages, and makes it much
easier to find bugs.
2013-08-30 06:56:33 +01:00
Miles Bader
663c41e248 Add Lua runtime helper functions for error-handling
Add two helper functions to the Lua runtime, "SWIG_Lua_pusherrstring"
and "SWIG_Lua_pushferrstring".

These are like the standard Lua functions lua_pushstring and
lua_pushfstring respectively, except that the strings are prefixed
with the location of the innermost Lua call-point (as generated by
luaL_where).
2013-08-30 06:56:33 +01:00
Vadim Zeitlin
9efaf954c7 Add support for std::map<> comparator template argument for C#.
Allow exporting maps using non-default comparison function.

Closes #77
2013-08-29 19:08:15 +01:00
William S Fulton
1cc735df5e %implicitconv will now accept None where the implicit conversion takes a C/C++ pointer.
Problem highlighted by Bo Peng on the swig-user mailing list. SF patch #230.
2013-08-28 20:28:15 +01:00
Kris Thielemans
a495b5a985 Remove SwigPyObject_print and SwigPyObject_str, and make the generated wrapper use the default python implementations, which will fall back to repr (for -builtin option).
Advantages:
- it avoids the swig user having to jump through hoops to get print to
  work as expected when redefining repr/str slots.
- typing the name of a variable on the python prompt now prints the
  result of a (possibly redefined) repr, without the swig user having to
do any extra work.
- when redefining repr, the swig user doesn't necessarily have to
  redefine str as it will call the redefined repr
- the behaviour is exactly the same as without the -builtin option while
  requiring no extra work by the user (aside from adding the
%feature("python:slot...) statements of course)
- the patch simplifies pyrun.swg a tiny bit.

Disadvantage:
- default str() will give different (but clearer?) output on swigged
  classes compared to unpatched swig

SF Bug #326
2013-08-07 20:22:03 +01:00
William S Fulton
80f8d1d922 Fix for missing C++ code in std::multimap wrappers.
%template for a std::multimap generated uncompilable code unless a
%template for a std::map of the same template types was also coded up.

This patch is needed in conjunction with previous commit - 5f1fff1849

Closes #64
Closes #65
2013-08-06 07:02:49 +01:00
Andrew Simmons
5f1fff1849 Copied std::pair<> fragment from Lib/std/std_map.i into Lib/std/std_multimap.i. This fixes an error when a std::multimap template is wrapped by itself. 2013-07-25 18:23:45 +01:00
joequant
93b63969f9 change to allow file SEXP return values 2013-07-14 20:28:17 +08:00
William S Fulton
d0af4f50d3 Add %pythonbegin directive.
For adding code at the beginning of the generated .py file.
2013-07-05 06:30:16 +01:00
William S Fulton
ace8fcd972 SWIG_AsWCharPtrAndSize improper operation if cptr NULL
SF bug #1327

This doesn't have any noticeable effect with the usage of
SWIG_AsWCharPtrAndSize as shipped by SWIG, but could be a problem if a
user is using this function with cptr equal to zero and psize is non-zero
 - the length would be incorrectly set due to the call to PyUnicode_GetSize
failing.
2013-07-02 18:58:56 +01:00
Olly Betts
c8a879303c Fix comment typo (interpeters) 2013-07-02 12:29:28 +12:00
William S Fulton
7491be12e5 Uninitialized variable fix in SWIG_Python_NonDynamicSetAttr when using -builtin.
SF patch #340
2013-07-01 20:09:31 +01:00
William S Fulton
0058eea3ad Add SF patch #342 fix some director classes crashing on object deletion when using -builtin.
Fixes SF bug #1301 and python test cases director_basic and
director_classic seg faulting when used with -builtin.

Patch from Christian Delbaere.
2013-07-01 19:25:34 +01:00
Karl Wette
d72e3dd899 Octave: add SWIGRUNTIMEINLINE to SWIG_Octave_SetConstant() 2013-06-13 17:46:47 +02:00
William S Fulton
7f95c7bb3e Use a less confusing macro name, SWIG_PYTHON_NO_DEBUG => SWIG_PYTHON_INTERPRETER_NO_DEBUG 2013-06-11 19:15:57 +01:00
William S Fulton
5cdfc503e1 Add SWIG_PYTHON_NO_DEBUG macro for building Debug wrappers against the Python Debug dll 2013-06-11 00:22:21 -07:00
William S Fulton
3834036e13 Fix Ruby regression with missing rb_complex_new function.
Affects Ruby versions prior to 1.9 using std::complex wrappers if just using std::complex
as an output type. Also fix the Complex helper functions external visibility (to static by default).

Closes #52
2013-06-07 19:56:38 +01:00
Olly Betts
abfa75b169 [PHP] Fix SWIG_ZTS_ConvertResourcePtr() not to dereference NULL
if the type lookup fails.
2013-06-04 12:53:27 +12:00
William S Fulton
5481270c2a Fix Python 3 inconsistency handling -ve numbers for unsigned C types.
An OverFlow error is now consistently thrown instead of a TypeError.

Fixes primitive_types testcase for Python 3
2013-05-25 10:36:14 +01:00
Artem Serebriyskiy
3e188e508d Add test case for attributes with moderately complex templates
* New test case tests that %attribute macros correctly supports passing
  template with multiple parameters as class name or attribute type name

* Some further changes were made to %attribute macros - now
  AttributeType is protected with %arg as well. This allows you
  to have attributes of type e.g. std::pair<int,int> etc

Update CHANGES file for %attribute template fixes

Closes #48
2013-05-25 00:44:36 +01:00
Artem Serebriyskiy
c956c4c87f Fix %arg in Lib/attribute.i 2013-05-25 00:37:57 +01:00
Artem Serebriyskiy
3357ee85cd Fix all attributes macroses 2013-05-25 00:37:57 +01:00