Commit graph

2,430 commits

Author SHA1 Message Date
William S Fulton
7fa1058a8a Configure fix and warning fix for Go 2015-03-14 23:40:30 +00:00
Ian Lance Taylor
32bb4dcd6d Merge branch 'master' of git://github.com/swig/swig 2015-03-12 08:14:17 -07:00
Ian Lance Taylor
eccfa288b8 [Go] Consistently use the same type when dispatching to an overloaded
function.
2015-03-12 08:13:16 -07:00
Olly Betts
7ba0652677 Create director_common.swg for language-indep code
Move -DSWIG_DIRECTOR_STATIC handling there, so this is now supported for
all languages with director support, not just Python and PHP.
2015-03-12 19:51:11 +13:00
Ian Lance Taylor
a6a9a89524 [Go] Fix overloading on an undefined type. 2015-03-06 17:51:30 -08:00
Ian Lance Taylor
b15a66f2ab [Go] Use imtype when checking for pointer in cgo type. Permit func,
map, chan values to be converted to pointers when using cgo.
2015-03-04 14:25:10 -08:00
Ian Lance Taylor
9ad497c08e [Go] Add -cgo option, required for Go version 1.5 and later. 2015-03-02 14:03:33 -08:00
Olly Betts
df36d84f1b Avoid debug code segfaults when top==NULL 2015-02-26 14:59:49 +13:00
Olly Betts
de1cae9319 Fix segmentation fault when top==NULL
Introduced by nested class handling (reported in issue#346 by Paweł Tomulik).
2015-02-26 14:57:19 +13:00
Ian Lance Taylor
1dd401899f [Go] Change SWIG directors to use a handle instead of a Go pointer.
In future releases of Go it will not be possible to pass Go pointers
into C/C++ code.  The handle is automatically translated back to the
Go value using a Go map.  Since directors must be explicitly deleted,
we can reliably use that call to remove the handle from the map.
2015-02-22 11:09:58 -08:00
Ian Lance Taylor
40f5b1ecc6 [Go] Fixes so that the go_subdir_import test will work with gccgo. 2015-02-22 11:01:24 -08:00
Misha Seltzer
fcf2b68e84 Fixed errors due to last sync. 2015-02-17 10:27:45 +02:00
Misha Seltzer
8da4d20308 Fixed SWIG go for cases when SWIG %import-s another package which is located in a subdirectory. 2015-02-17 10:27:45 +02:00
William S Fulton
37bd50ddf9 Guile - fix generated code for static const char member variables when defined and declared inline. 2015-02-11 23:34:23 +00:00
William S Fulton
1ef899a57b Merge branch 'stricter-warnings'
* stricter-warnings:
  Go changes for wrappers to compile as ISO C90
  Scilab typecheck typemaps fix for C90
  No error for one Javascript node warning
  Warning fix in testcase for Javascript node
  nested_extend_c testcase fix when compiled by C++ target languages
  Temporarily remove -Werror for Scilab testing
  C90 fixes for Javascript JSC
  There are a couple of testcases that aren't compliant and supression via pragmas doesn't work for gcc < 4.8
  Warning suppression change
  Scilab typemap fixes for C89
  compiler warning suppression correction in testcase
  Suppress pedantic warnings in C# testcases
  Suppress pedantic warnings in testcases
  Pedantic warning fix in testcase
  pedantic warning fix for D wrappers
  Travis testing to use testflags.py for setting CFLAGS and CXXFLAGS
  Add travis build for error-declaration-after-statement branch
2015-02-11 23:33:26 +00:00
William S Fulton
e3a8ee1927 Go changes for wrappers to compile as ISO C90
Fixes:
ISO C90 forbids mixed declarations and code [-Werror=declaration-after-statement]
2015-02-11 23:32:46 +00:00
William S Fulton
59ff3e6a3a C90 fixes for Javascript JSC 2015-02-11 23:32:45 +00:00
Ian Lance Taylor
1863b191bf [Go] Refactor some functions to make it easier to move to a new
approach for generating Go interfaces.  No functional changes.
2015-02-09 11:21:58 -08:00
Ian Lance Taylor
0a021a938e [Go] Remove all generated calls to _swig_makegostring, as it will no
longer as of Go 1.5.  In Go 1.5 or later user calls to
_swig_makegostring will fail at link time.

Instead, use goout and godirectorin typemaps to allocate strings in Go
code.

Change the Go typemaps support to ignore empty strings, so that we can
define empty strings for regular types so that %apply will override
the definitions for string types.

Fix the gccgo code to wrap SwigCgoCallback around all godirectorin
typemaps.

Add a few newlines after typemap code so that the typemaps don't have
to include them.
2015-02-05 10:15:37 -08:00
Ian Lance Taylor
2562c1eb41 [Go] Remove all calls to _swig_goallocate in the Go runtime, except
for the one from _swig_makegostring.  _swig_goallocate can not work
with the future Go 1.5 release.  When using Go 1.5 attempts to call
_swig_goallocate will fail at link time.
2015-02-04 16:08:44 -08:00
Ian Lance Taylor
2752d78ce6 [Go] Use a unique name for the wrapper functions, since they are
publicly visible.  This permits linking together different SWIG
wrappers in the same program if they wrap the same function.  The
unique name is generated by hashing the .swig file.
2015-02-04 13:18:00 -08:00
William S Fulton
39a75442a1 Fix Python -classic and property setting
Setting properties on classic classes was broken in swig-3.0.3 by attempting to use __setattr__. This regression is fixed now by using __dict__ again when using -classic.

Fixes patch #232.
2015-01-30 23:27:22 +00:00
William S Fulton
727d74f6be Python C89 fix mixed code and declarations compiler error in constants code from patch #250 2015-01-28 08:09:06 +00:00
William S Fulton
760d603918 Warning and error fixes for Solaris Sun Studio compiler 2015-01-27 19:30:24 +00:00
William S Fulton
1fae569960 Add missing SWIGSCILAB in wrappers and fix unions test for non-scilab languages 2015-01-26 21:03:45 +00:00
Simon Marchetto
0544765abd remove -nobuilder option 2015-01-26 12:29:40 +01:00
Simon Marchetto
4c66489fd7 remove useless direct_gateway function in wrapper 2015-01-26 12:11:13 +01:00
Simon Marchetto
adc4b788df Merge remote-tracking branch 'origin/master' into gsoc2012-scilab
Conflicts:
	.gitignore
	.travis.yml
	configure.ac
2015-01-26 10:50:20 +01:00
Olly Betts
b3003f1f9f [PHP] When wrapping a returned resource as an object, check if all
cases wrap it in the same class, and if so eliminate the pointless
switch statement wrapper we previously generated.
2015-01-23 13:56:13 +13:00
William S Fulton
d3051c5b04 Merge branch 'ConroyJ-master'
* ConroyJ-master:
  Updated usage string for -cppcast/-nocppcast in octave.cxx
  Attempting fixes for Octave shared_ptr support
2015-01-22 20:06:55 +00:00
William S Fulton
6f48e57090 Scilab command line options put in alphabetical order and some html tweaks 2015-01-22 20:03:16 +00:00
William S Fulton
96c19872bd Scilab cosmetics 2015-01-19 07:52:47 +00:00
William S Fulton
06fb68af5b Merge branch 'ptomulik-fix/py-object-const'
* ptomulik-fix/py-object-const:
  constant_directive_runme.py and classic classes
  additional fixes to %constant directive
  make %constant directive to work with structs/classes
2015-01-15 20:18:21 +00:00
William S Fulton
afba5b755a Fix Python default args when using kwargs
Recent default arg handling fixes didn't fix the case when kwargs is turned on
2015-01-15 07:54:36 +00:00
Simon Marchetto
b11f4d8e62 reduce slightly the gateway source 2015-01-14 15:43:46 +01:00
Olly Betts
0dd685bad2 Fix PHP crash in director_finalizer 2015-01-14 15:38:55 +13:00
Olly Betts
ea5be4e508 Fix PHP backend for default_args testcase 2015-01-14 10:44:54 +13:00
William S Fulton
944fbfb426 Python 3 default args fix
Fix 0U and 0L as default args for Python 3 (tests committed in
previously commit of default_args.i).
Relates to issue #294.
2015-01-13 07:55:31 +00:00
William S Fulton
9d87b9f099 Revert introduction of python:defaultargs feature
See issue #294
2015-01-12 21:35:47 +00:00
Simon Marchetto
18832e938c fix buildermode error with Scilab V6 2015-01-12 16:20:03 +01:00
Simon Marchetto
66f150b853 fix Scilab V6 support after merge of gateway & wrapper sources 2015-01-12 16:19:35 +01:00
Olly Betts
682b4dd843 [PHP] Fix segfault in director upcall check
Manifest only when using PHP built with ZTS enabled.
2015-01-12 13:53:01 +13:00
William S Fulton
06e361dbf2 Fix linux gcc warnings and strtol corrections 2015-01-11 17:30:25 +00:00
Vadim Zeitlin
adbe3f2e77 Python default arg improvements
Merge the code fixes from patch #294 to more reliably generate
default argument values into the python layer.
2015-01-11 16:42:21 +00:00
Jeremy
2696a6e0ff Updated usage string for -cppcast/-nocppcast in octave.cxx 2015-01-09 14:51:44 -05:00
William S Fulton
38ba81811e Fix Python default argument handing broken since swig-3.0.3
Default values are no longer generated as Python code by default.
They must be explicitly turned on using the "python:defaultargs" feature.

Closes #294
Closes #296

The problems in these two issues when "python:defaultargs" is turned
on still need to be fixed and should be addressed in separate patches.
The important thing is the default code generation is now fixed.
2015-01-09 00:34:17 +00:00
Simon Marchetto
9c5003b022 do no generate builder by default 2015-01-08 14:06:04 +01:00
Olly Betts
fc60a97ebe Drop deprecated warnings for ancient options
Support for -stat was removed in SWIG 1.3 Alpha 1 nearly 15 years ago,
and the documentation options were removed prior to that, so issuing a
warning that they are deprecated and ignoring them serves no useful
purpose now.
2015-01-08 10:55:58 +13:00
Olly Betts
cd16059c66 Provide -cppext as a general command line option
Provide -cppext as a general command line option for setting the
extension used for generated C++ files (previously it was specific
to the PHP backend).  Deprecate the equivalent -suffix option
provided by the Ocaml backend, but continue to support that for
now.
2015-01-08 10:54:37 +13:00
Olly Betts
0acebe2289 Split -help output into 4 chunks instead of 3
I believe the aim is to keep these below 2KB to avoid string literal
length limits on some compiler, but they slowly creep up in size, so
split into more chunks and rebalance the contents.
2015-01-08 10:14:18 +13:00