Commit graph

4,386 commits

Author SHA1 Message Date
Karl Wette
e24ec40895 Octave: add support for version 4.2
- .travis.yml:
  - ppa:kwwette/octaves has Octave version 4.2, also run C++11 tests
- configure.ac:
  - prefer Octave program "octave-cli" to "octave"
  - extract any -std=* flags from CXX, add to OCTAVE_CXXFLAGS
- Lib/typemaps/fragments.swg:
  - SWIG_isfinite_func(): extern "C++" is required as this fragment can
    end up inside an extern "C" { } block
- Lib/octave:
  - add std_wstring.i (copied from std_string.i) for C++11 tests
- Lib/octave/octrun.swg:
  - move Octave version-checking macros to octruntime.swg
  - Octave single()/double() functions now call .as_single()/.as_double()
    methods; redirect calls to __float__() method as per .scalar_value()
  - << and >> operators are no longer supported by Octave
- Lib/octave/octruntime.swg:
  - move Octave version-checking macros here for conditional #includes
  - #include interpreter.h instead of #toplev.h
  - #include call-stack.h (now needed for octave_call_stack)
  - unwind_protect is now in octave:: namespace
  - error_state and warning_state are deprecated; use try/catch to catch
    errors in feval() instead
  - always set octave_exit = ::_Exit, to try to prevent segfault on exit
- Lib/octave/octopers.swg:
  - << and >> operators are no longer supported by Octave
- Lib/octave/exception.i:
  - Add macro SWIG_RETHROW_OCTAVE_EXCEPTIONS which rethrows any
    exceptions raised by Octave >= 4.2
- Examples/test-suite/exception_order.i:
  - Use macro SWIG_RETHROW_OCTAVE_EXCEPTIONS to rethrow exceptions
    raised by error() function in Octave >= 4.2
- Update Doc/Manual/Octave.html and CHANGES.current
2017-01-22 11:53:12 +13:00
William S Fulton
0e48622ca3 Merge branch 'wkalinin-override_fix'
* wkalinin-override_fix:
  test case added for "override" from imported module
  #733 - wrong "override" calculation in import mode
2017-01-16 19:48:19 +00:00
William S Fulton
4c1152efcd Merge branch 'fschlimb-templ_def_cache'
* fschlimb-templ_def_cache:
  Add template_default_cache runtime tests
  Fix template_default_cache testcase
  template_default_cache is a multi-module test
  using 2-level caching as suggested by @wsfulton
  account for explicitly qualified scopes
  adding test
  restricting chaching template default types
2017-01-16 07:50:13 +00:00
William S Fulton
6db71c690a Add template_default_cache runtime tests
Also correct illegal C++ namespace names
2017-01-16 07:46:03 +00:00
William S Fulton
6f54a00db7 Fix template_default_cache testcase 2017-01-16 07:19:27 +00:00
William S Fulton
3d2e57b0f2 Add %proxycode directive for adding code into proxy classes for C#, D and Java 2017-01-13 20:43:50 +00:00
William S Fulton
88e2d02ead Document %insert filename and add test for it 2017-01-13 20:43:50 +00:00
Frank Schlimbach
974d822b5f template_default_cache is a multi-module test 2017-01-11 03:10:40 -06:00
Frank Schlimbach
be92482e27 using 2-level caching as suggested by @wsfulton 2017-01-09 09:46:33 -06:00
William S Fulton
fade04962e Merge branch 'sunoru-master'
* sunoru-master:
  Correct some whitespace changes
  Realign for some comments.
  Fix some typos in docs and examples and make the code look nicer.
2017-01-01 14:29:52 +00:00
Karl Wette
9e66af3fef Octave: do not dump Octave core in examples/test suite scripts
- If Octave segfaults during cleanup, it usually cannot dump its core
  and therefore just freezes, which hold up e.g Travis build jobs
2017-01-01 19:06:51 +13:00
sunoru
8985c34809 Fix some typos in docs and examples and make the code look nicer. 2016-12-31 23:06:56 +08:00
William S Fulton
4963a7f88f Fix Python 2 builtin tp_hash hashfunc closure regression when using "python:slot"
Closes https://github.com/swig/swig/issues/843
2016-12-23 23:41:07 +00:00
William S Fulton
f9158e525f Revert "Merge pull request #853 from ivannp/underscores"
This reverts commit a964098754, reversing
changes made to bda3a11f9e.

SWIG should only provide default operator names that provide special
standard or conventional meaning in the target language.
2016-12-22 19:47:54 +00:00
Joseph Wang
a964098754 Merge pull request #853 from ivannp/underscores
Renamed all operators beginning with underscore.
2016-12-21 21:59:32 +08:00
William S Fulton
e6b270b6dc Suppress incorrect warning when a keyword is used in template classes
Closes https://github.com/swig/swig/issues/845
2016-12-20 19:44:57 +00:00
Simon Marchetto
15b3c1dfa3 [Scilab] fix test scilab_pointer_conversion_function for scilab 5.3.3 2016-12-19 15:04:30 +01:00
William S Fulton
bdf71b0067 Zero initialize %array_functions and %array_class 2016-12-18 17:50:47 +00:00
William S Fulton
cc56765a7a Zero initialize newly created arrays
For consistency to previous fixes:
https://github.com/swig/swig/pull/208
https://github.com/swig/swig/issues/440
2016-12-18 17:50:47 +00:00
William S Fulton
173c028dd4 Add test and changes entry for Python -builtin %array_class fix
Issue https://github.com/swig/swig/issues/446
2016-12-18 17:50:47 +00:00
Ivan Popivanov
5ec5266284 Renamed all operators beginning with underscore. 2016-12-17 16:26:10 -08:00
Brian Caine
391bb79cba Added support for guile's native pointer type 2016-12-16 15:15:13 +13:00
Simon Marchetto
88b4827d87 scilab: SWIG_ptr() accepts mlist typed pointers and converts them to pointers 2016-12-15 23:57:42 +01:00
Vadim Zeitlin
07ebbe84b8 Fix pep8 E265 error in testcase 2016-12-11 22:20:44 +00:00
Olly Betts
fa785cdd46 [PHP7] Send errors to stderr so they escape RUNPIPE 2016-12-06 08:35:22 +13:00
William S Fulton
f632ed34f7 Fix python_moduleimport test for -builtn 2016-12-03 16:07:59 +00:00
William S Fulton
2a42031b08 Custom Python module importing code
Add optional moduleimport attribute to %module so that the
default module import code can be overridden. See the
"Searching for the wrapper module" documentation in Python.html.
Example:

  %module(moduleimport="import _foo") foo

$module also expands to the low-level C/C++ module name, so
the following is the same as above

  %module(moduleimport="import $module") foo

Issue https://github.com/swig/swig/issues/769
2016-12-01 18:59:33 +00:00
Olly Betts
855b8dfcf6 Fix PHP5 examples to use php5 make targets
Only a subset had been updated.
2016-12-01 11:52:25 +13:00
Olly Betts
c8a5f84cd1 [PHP7] Wrap bool constants as PHP booleans
Leave PHP5 wrapping them as integers as this change could cause
incompatibilities.

Fixes issue https://github.com/swig/swig/issues/686 noted by Nishant
Gupta.
2016-11-30 17:19:11 +13:00
Olly Betts
75a00cd15e [PHP7] Make default C++ extension .cxx
This is SWIG's default for every language except PHP, and now is a
good time to make this change so that once we drop PHP5 support, we'll
have the same default everywhere.  It's easy to override the default
with -cppext cxx to get the PHP5 behaviour.
2016-11-30 13:27:13 +13:00
Olly Betts
c7f593e1b1 Enable li_factory testcase for PHP
It already works and already even has a runtest!
2016-11-30 13:07:36 +13:00
Olly Betts
1169874f59 [PHP] Add support for PHP7.
PHP5's C extension API has changed substantially so you need to use
-php7 to specify you want PHP7 compatible wrappers.
Fixes https://github.com/swig/swig/issues/571
2016-11-30 13:05:59 +13:00
Olly Betts
bb98147965 Remove 'static' targets from PHP examples
The machinery these targets need to work no longer exists, and as
far as I can make out was removed before the code was put under
version control.
2016-11-30 12:15:42 +13:00
William S Fulton
7268f58c4c Fix %rename override of wildcard %rename for templates
%rename(GlobalIntOperator) *::operator bool; // wildcard %rename
%rename(XIntOperator) X::operator bool; // fix now overrides first %rename above
OR
%rename(XIntOperator) X<int>::operator bool; // fix now overrides first %rename above

template<typename T> struct X {
  operator bool();
  ...
};
%template(Xint) X<int>;
2016-11-28 22:50:52 +00:00
Joseph C Wang
bff182d556 fix #697 - miscounting comma in member lists
fix method for counting comma in member list
2016-11-12 00:23:41 +08:00
William S Fulton
bdda0a0829 Python - fix compilation error when using -extranative and -builtin.
Closes #816
2016-11-02 22:00:54 +00:00
William S Fulton
c74397bfd0 Merge branch 'liorgold-alias-template'
* liorgold-alias-template:
  Warning header cosmetics
  Fix decl attribute in C++11 alias templates
  Add C++11 alias templates
2016-11-02 09:10:59 +00:00
William S Fulton
eda0779e76 C# std::array changes file addition
Fix C# warnings in test-case too.
2016-10-30 22:35:59 +00:00
William S Fulton
d48b1712a8 Merge branch 'myd7349-master'
* myd7349-master:
  Convert the Java runtime testcase cpp11_li_std_array_runme to C#
  Add C++11 std::array interface file for C#
  SWIG_STD_VECTOR_ENHANCED for std::wstring
2016-10-30 22:27:47 +00:00
William S Fulton
ed3bc81dca Compiler warning fixes in testcase 2016-10-30 13:54:33 +00:00
William S Fulton
96015de0dd Update documentation for using SWIG_ConvertPtr example usage
Add a test case to test the example documentation typemaps
2016-10-23 20:16:35 +01:00
William S Fulton
129ef8ea8f Correct docs and examples to call SWIG_fail after setting a Python error
Although 'return NULL' works, it may miss out on some cleanup and NULL
is the wrong value to return in generated code for overloaded functions.
2016-10-23 20:16:35 +01:00
William S Fulton
e9e6a99f0f Add missing VOID_INT_PTR director typemaps 2016-10-23 16:18:05 +01:00
William S Fulton
f89b8836dd Merge branch 'jiulongw-master'
* jiulongw-master:
  Fix go wrapper compilation error
  Fix missing semicolon in golang wrapper
  Fix extra quote escape in golang
  Fix #define error when value contains char in compound expression
  Add more test case for char const expression in enum
  Revert "Add enum test cases with const char in compound expression"
  Add runtime tests for char in compound expression patch
  Add enum test cases with const char in compound expression
  Fix enum error when value contains char in compound expression
2016-10-23 10:32:48 +01:00
William S Fulton
5df10e380e Fix some test-suite warnings 2016-10-16 19:10:35 +01:00
William S Fulton
58461c1ffd php run test fixes for new functions in testcase 2016-10-15 17:58:21 +01:00
William S Fulton
f9ba371ee4 Remove li_boost_array testcase
Too many problems, this attempt to use std::array typemaps for boost::array
isn't really working. Latest problem is clang compile failures on OSX.
2016-10-15 17:58:17 +01:00
William S Fulton
4b4540056d Turn off Python pickle test for old style classes 2016-10-14 19:48:37 +01:00
William S Fulton
d2cb98c134 Pickle test additions
These are not working yet for all combinations of builtin and PY3
The goal is to have a sensible default error that states that
pickling is not supported.
2016-10-14 07:30:44 +01:00
William S Fulton
96fae38be2 Fix Python pickling and metaclass for builtin wrappers
The metaclass (SwigPyObjectType) for SWIG objects was not defined in
a way that let importlib successfully import the Python wrappers.
The pickle module failed because it couldn't determine what module the
SWIG wrapped objects are in.

I've changed the definition of SwigPyObjectType using more normal
builtin type definitions. There are still some open questions:
- None of the builtin types, like swig_static_var_getset_descriptor and
  SwigPyObject are added into any module. No call to PyModule_AddObject
  is made, so isinstance cannot be used for any wrapped type, all of
  which are derived from SwigPyObject.

Closes #808
2016-10-14 07:30:44 +01:00