Commit graph

2,546 commits

Author SHA1 Message Date
Sylvestre Ledru
228b7d9a6c Merge remote-tracking branch 'origin/master' into gsoc2012-scilab 2013-09-13 10:03:56 +02:00
Sylvestre Ledru
7a88729c87 Remove trailing spaces in the generated code.
No functional changes
2013-09-13 10:02:39 +02:00
Sylvestre Ledru
2374ff914d Remove trailing spaces in the generated code 2013-09-13 09:50:21 +02:00
Sylvestre Ledru
9c5bac9887 Merge remote-tracking branch 'origin/master' into gsoc2012-scilab 2013-09-13 09:18:06 +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
Simon Marchetto
5c5528981e Scilab: remove generated code compilation errors & warnings 2013-09-11 19:19:29 +02:00
Simon Marchetto
2610403d69 Scilab: consider int as default type for STL container of values (so it works for container of enums) 2013-09-02 11:06:00 +02:00
Simon Marchetto
ed135cb99c Scilab: wrap enums to Scilab variables (if %feature scilab:const") 2013-09-02 11:06:00 +02:00
Simon Marchetto
2cf606c638 Scilab: add %feature scilab:const (constants are wrapped by Scilab variables) 2013-09-02 10:59:48 +02:00
Simon Marchetto
fcfb90219e Scilab: list helper getScilabListAndSize() 2013-09-02 10:55:07 +02:00
William S Fulton
678058dbc7 Revert non-scilab changes: Octave modifications 2013-08-30 19:07:10 +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
Simon Marchetto
7655b6df6d Scilab: fix arrays_global test case 2013-08-21 14:35:48 +02:00
Simon Marchetto
0fc9e4d0a4 Scilab: support of Scilab 5.3.3 (api_scilab: Rhs, Lhs, ..) 2013-08-19 17:57:56 +02: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
Simon Marchetto
2bd8c0eada Merge branch 'gsoc2012-scilab' of https://github.com/swig/swig into gsoc2012-scilab 2013-08-06 10:23:07 +02:00
Sylvestre Ledru
21e17eaa73 Merge remote-tracking branch 'origin/master' into gsoc2012-scilab
Conflicts:
	Examples/Makefile.in
2013-08-06 10:06:31 +02: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
Simon Marchetto
774dddca00 Scilab: fix li_std_vector & ignore_template_constructor test case
fix: return a runtime error for not supported type containers
2013-08-02 12:09:11 +02:00
Simon Marchetto
6735b9727f Scilab: fix arrays_global test_case 2013-07-31 18:28:45 +02:00
Simon Marchetto
255603639f Scilab: rollback, support of container<class*> only (not <class>) 2013-07-31 18:28:23 +02:00
Simon Marchetto
077e69a851 Scilab: fix SWIT_Init() close in C mode 2013-07-31 11:57:16 +02: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
Simon Marchetto
25ffa87cab Scilab: fix dynamic_cast test case
Close SWIG_Init() in Scilab executable.
2013-07-23 15:02:39 +02:00
Simon Marchetto
2ea501d488 Scilab: small typo fix 2013-07-22 17:39:25 +02:00
Simon Marchetto
c3992df0bb Scilab: support of containers of "complex type" values (like vector<class>) 2013-07-22 17:37:25 +02:00
Simon Marchetto
f09525bcd8 Scilab: add generic support for STL list 2013-07-19 17:59:49 +02:00
Simon Marchetto
bc80012e0a Scilab: add support for STL bool containers 2013-07-19 17:29:10 +02:00
Simon Marchetto
c66952a3f0 Scilab: add generic support for STL set 2013-07-18 08:56:48 +02:00
Simon Marchetto
983af237b0 Scilab: generic support for STL vector 2013-07-18 08:56:31 +02:00
Simon Marchetto
cdb6554fba Scilab: generic support for STL containers.
STL containers are mapped in Scilab as:
- for int, double, string: matrices (of int, or double, etc....)
- for other types (like pointers on objects): list of pointers
2013-07-18 08:56:24 +02:00
Simon Marchetto
3dd0ebdde9 Scilab: wrap SWIG_Init() function to initialize module SWIG types (needed for STL support) 2013-07-18 08:56:05 +02: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
Simon Marchetto
627e4002fe Scilab: small fix on int matrix typemap 2013-06-21 11:30:11 +02:00
Simon Marchetto
87e0005276 Scilab: reference passing default mode is INPUT (here fix for vectors) 2013-06-20 18:17:20 +02:00
Simon Marchetto
8ee91b4352 Scilab: add support of STL vector<string> 2013-06-20 11:15:13 +02:00
Simon Marchetto
e6af8948ef Scilab: add string matrix typemaps 2013-06-19 16:34:12 +02:00
Simon Marchetto
9b270b9f6a Scilab: fix matrix typemap parameter names 2013-06-19 16:28:57 +02:00
Simon Marchetto
347dee5cda Scilab: refactor SwigScilabStringToCharPtrAndSize (use String API getAllocatedString) 2013-06-19 16:10:24 +02:00
Simon Marchetto
1efaa1ae67 Scilab: refactor SwigScilabStringToCharPtr (use String API getAllocatedString()) 2013-06-19 16:10:23 +02:00
Simon Marchetto
6280dd2d1a Scilab: fix SWIG_FromCharPtr error 2013-06-19 16:10:23 +02:00